@farthershore/cli 0.24.4 → 0.26.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.
- package/README.md +31 -26
- package/dist/index.js +244 -123
- package/dist/mcp.js +29 -35
- package/package.json +3 -3
package/dist/mcp.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __createRequire } from "node:module";const require=__createRequire(import.meta.url);
|
|
3
|
-
var j0=Object.create;var up=Object.defineProperty;var U0=Object.getOwnPropertyDescriptor;var L0=Object.getOwnPropertyNames;var M0=Object.getPrototypeOf,Z0=Object.prototype.hasOwnProperty;var R=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Jt=(t,e)=>{for(var n in e)up(t,n,{get:e[n],enumerable:!0})},F0=(t,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of L0(e))!Z0.call(t,r)&&r!==n&&up(t,r,{get:()=>e[r],enumerable:!(o=U0(e,r))||o.enumerable});return t};var av=(t,e,n)=>(n=t!=null?j0(M0(t)):{},F0(e||!t||!t.__esModule?up(n,"default",{value:t,enumerable:!0}):n,t));var Ca=R(ce=>{"use strict";Object.defineProperty(ce,"__esModule",{value:!0});ce.regexpCode=ce.getEsmExportName=ce.getProperty=ce.safeStringify=ce.stringify=ce.strConcat=ce.addCodeArg=ce.str=ce._=ce.nil=ce._Code=ce.Name=ce.IDENTIFIER=ce._CodeOrName=void 0;var Ra=class{};ce._CodeOrName=Ra;ce.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var nn=class extends Ra{constructor(e){if(super(),!ce.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};ce.Name=nn;var kt=class extends Ra{constructor(e){super(),this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((n,o)=>`${n}${o}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((n,o)=>(o instanceof nn&&(n[o.str]=(n[o.str]||0)+1),n),{})}};ce._Code=kt;ce.nil=new kt("");function bS(t,...e){let n=[t[0]],o=0;for(;o<e.length;)ug(n,e[o]),n.push(t[++o]);return new kt(n)}ce._=bS;var cg=new kt("+");function kS(t,...e){let n=[Aa(t[0])],o=0;for(;o<e.length;)n.push(cg),ug(n,e[o]),n.push(cg,Aa(t[++o]));return PC(n),new kt(n)}ce.str=kS;function ug(t,e){e instanceof kt?t.push(...e._items):e instanceof nn?t.push(e):t.push(AC(e))}ce.addCodeArg=ug;function PC(t){let e=1;for(;e<t.length-1;){if(t[e]===cg){let n=OC(t[e-1],t[e+1]);if(n!==void 0){t.splice(e-1,3,n);continue}t[e++]="+"}e++}}function OC(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof nn||t[t.length-1]!=='"'?void 0:typeof e!="string"?`${t.slice(0,-1)}${e}"`:e[0]==='"'?t.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(t instanceof nn))return`"${t}${e.slice(1)}`}function RC(t,e){return e.emptyStr()?t:t.emptyStr()?e:kS`${t}${e}`}ce.strConcat=RC;function AC(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:Aa(Array.isArray(t)?t.join(","):t)}function CC(t){return new kt(Aa(t))}ce.stringify=CC;function Aa(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}ce.safeStringify=Aa;function NC(t){return typeof t=="string"&&ce.IDENTIFIER.test(t)?new kt(`.${t}`):bS`[${t}]`}ce.getProperty=NC;function zC(t){if(typeof t=="string"&&ce.IDENTIFIER.test(t))return new kt(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}ce.getEsmExportName=zC;function DC(t){return new kt(t.toString())}ce.regexpCode=DC});var pg=R(st=>{"use strict";Object.defineProperty(st,"__esModule",{value:!0});st.ValueScope=st.ValueScopeName=st.Scope=st.varKinds=st.UsedValueState=void 0;var at=Ca(),lg=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},Kl;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(Kl||(st.UsedValueState=Kl={}));st.varKinds={const:new at.Name("const"),let:new at.Name("let"),var:new at.Name("var")};var Gl=class{constructor({prefixes:e,parent:n}={}){this._names={},this._prefixes=e,this._parent=n}toName(e){return e instanceof at.Name?e:this.name(e)}name(e){return new at.Name(this._newName(e))}_newName(e){let n=this._names[e]||this._nameGroup(e);return`${e}${n.index++}`}_nameGroup(e){var n,o;if(!((o=(n=this._parent)===null||n===void 0?void 0:n._prefixes)===null||o===void 0)&&o.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};st.Scope=Gl;var Wl=class extends at.Name{constructor(e,n){super(n),this.prefix=e}setValue(e,{property:n,itemIndex:o}){this.value=e,this.scopePath=(0,at._)`.${new at.Name(n)}[${o}]`}};st.ValueScopeName=Wl;var jC=(0,at._)`\n`,dg=class extends Gl{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?jC:at.nil}}get(){return this._scope}name(e){return new Wl(e,this._newName(e))}value(e,n){var o;if(n.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let r=this.toName(e),{prefix:i}=r,a=(o=n.key)!==null&&o!==void 0?o:n.ref,c=this._values[i];if(c){let l=c.get(a);if(l)return l}else c=this._values[i]=new Map;c.set(a,r);let u=this._scope[i]||(this._scope[i]=[]),d=u.length;return u[d]=n.ref,r.setValue(n,{property:i,itemIndex:d}),r}getValue(e,n){let o=this._values[e];if(o)return o.get(n)}scopeRefs(e,n=this._values){return this._reduceValues(n,o=>{if(o.scopePath===void 0)throw new Error(`CodeGen: name "${o}" has no value`);return(0,at._)`${e}${o.scopePath}`})}scopeCode(e=this._values,n,o){return this._reduceValues(e,r=>{if(r.value===void 0)throw new Error(`CodeGen: name "${r}" has no value`);return r.value.code},n,o)}_reduceValues(e,n,o={},r){let i=at.nil;for(let a in e){let c=e[a];if(!c)continue;let u=o[a]=o[a]||new Map;c.forEach(d=>{if(u.has(d))return;u.set(d,Kl.Started);let l=n(d);if(l){let p=this.opts.es5?st.varKinds.var:st.varKinds.const;i=(0,at._)`${i}${p} ${d} = ${l};${this.opts._n}`}else if(l=r?.(d))i=(0,at._)`${i}${l}${this.opts._n}`;else throw new lg(d);u.set(d,Kl.Completed)})}return i}};st.ValueScope=dg});var Y=R(ee=>{"use strict";Object.defineProperty(ee,"__esModule",{value:!0});ee.or=ee.and=ee.not=ee.CodeGen=ee.operators=ee.varKinds=ee.ValueScopeName=ee.ValueScope=ee.Scope=ee.Name=ee.regexpCode=ee.stringify=ee.getProperty=ee.nil=ee.strConcat=ee.str=ee._=void 0;var oe=Ca(),Ct=pg(),Ar=Ca();Object.defineProperty(ee,"_",{enumerable:!0,get:function(){return Ar._}});Object.defineProperty(ee,"str",{enumerable:!0,get:function(){return Ar.str}});Object.defineProperty(ee,"strConcat",{enumerable:!0,get:function(){return Ar.strConcat}});Object.defineProperty(ee,"nil",{enumerable:!0,get:function(){return Ar.nil}});Object.defineProperty(ee,"getProperty",{enumerable:!0,get:function(){return Ar.getProperty}});Object.defineProperty(ee,"stringify",{enumerable:!0,get:function(){return Ar.stringify}});Object.defineProperty(ee,"regexpCode",{enumerable:!0,get:function(){return Ar.regexpCode}});Object.defineProperty(ee,"Name",{enumerable:!0,get:function(){return Ar.Name}});var Ql=pg();Object.defineProperty(ee,"Scope",{enumerable:!0,get:function(){return Ql.Scope}});Object.defineProperty(ee,"ValueScope",{enumerable:!0,get:function(){return Ql.ValueScope}});Object.defineProperty(ee,"ValueScopeName",{enumerable:!0,get:function(){return Ql.ValueScopeName}});Object.defineProperty(ee,"varKinds",{enumerable:!0,get:function(){return Ql.varKinds}});ee.operators={GT:new oe._Code(">"),GTE:new oe._Code(">="),LT:new oe._Code("<"),LTE:new oe._Code("<="),EQ:new oe._Code("==="),NEQ:new oe._Code("!=="),NOT:new oe._Code("!"),OR:new oe._Code("||"),AND:new oe._Code("&&"),ADD:new oe._Code("+")};var nr=class{optimizeNodes(){return this}optimizeNames(e,n){return this}},mg=class extends nr{constructor(e,n,o){super(),this.varKind=e,this.name=n,this.rhs=o}render({es5:e,_n:n}){let o=e?Ct.varKinds.var:this.varKind,r=this.rhs===void 0?"":` = ${this.rhs}`;return`${o} ${this.name}${r};`+n}optimizeNames(e,n){if(e[this.name.str])return this.rhs&&(this.rhs=wo(this.rhs,e,n)),this}get names(){return this.rhs instanceof oe._CodeOrName?this.rhs.names:{}}},Jl=class extends nr{constructor(e,n,o){super(),this.lhs=e,this.rhs=n,this.sideEffects=o}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,n){if(!(this.lhs instanceof oe.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=wo(this.rhs,e,n),this}get names(){let e=this.lhs instanceof oe.Name?{}:{...this.lhs.names};return Xl(e,this.rhs)}},fg=class extends Jl{constructor(e,n,o,r){super(e,o,r),this.op=n}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},hg=class extends nr{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},gg=class extends nr{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},_g=class extends nr{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},yg=class extends nr{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,n){return this.code=wo(this.code,e,n),this}get names(){return this.code instanceof oe._CodeOrName?this.code.names:{}}},Na=class extends nr{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((n,o)=>n+o.render(e),"")}optimizeNodes(){let{nodes:e}=this,n=e.length;for(;n--;){let o=e[n].optimizeNodes();Array.isArray(o)?e.splice(n,1,...o):o?e[n]=o:e.splice(n,1)}return e.length>0?this:void 0}optimizeNames(e,n){let{nodes:o}=this,r=o.length;for(;r--;){let i=o[r];i.optimizeNames(e,n)||(UC(e,i.names),o.splice(r,1))}return o.length>0?this:void 0}get names(){return this.nodes.reduce((e,n)=>sn(e,n.names),{})}},or=class extends Na{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},vg=class extends Na{},Io=class extends or{};Io.kind="else";var on=class t extends or{constructor(e,n){super(n),this.condition=e}render(e){let n=`if(${this.condition})`+super.render(e);return this.else&&(n+="else "+this.else.render(e)),n}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let n=this.else;if(n){let o=n.optimizeNodes();n=this.else=Array.isArray(o)?new Io(o):o}if(n)return e===!1?n instanceof t?n:n.nodes:this.nodes.length?this:new t(xS(e),n instanceof t?[n]:n.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,n){var o;if(this.else=(o=this.else)===null||o===void 0?void 0:o.optimizeNames(e,n),!!(super.optimizeNames(e,n)||this.else))return this.condition=wo(this.condition,e,n),this}get names(){let e=super.names;return Xl(e,this.condition),this.else&&sn(e,this.else.names),e}};on.kind="if";var an=class extends or{};an.kind="for";var bg=class extends an{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,n){if(super.optimizeNames(e,n))return this.iteration=wo(this.iteration,e,n),this}get names(){return sn(super.names,this.iteration.names)}},kg=class extends an{constructor(e,n,o,r){super(),this.varKind=e,this.name=n,this.from=o,this.to=r}render(e){let n=e.es5?Ct.varKinds.var:this.varKind,{name:o,from:r,to:i}=this;return`for(${n} ${o}=${r}; ${o}<${i}; ${o}++)`+super.render(e)}get names(){let e=Xl(super.names,this.from);return Xl(e,this.to)}},Yl=class extends an{constructor(e,n,o,r){super(),this.loop=e,this.varKind=n,this.name=o,this.iterable=r}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,n){if(super.optimizeNames(e,n))return this.iterable=wo(this.iterable,e,n),this}get names(){return sn(super.names,this.iterable.names)}},za=class extends or{constructor(e,n,o){super(),this.name=e,this.args=n,this.async=o}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};za.kind="func";var Da=class extends Na{render(e){return"return "+super.render(e)}};Da.kind="return";var xg=class extends or{render(e){let n="try"+super.render(e);return this.catch&&(n+=this.catch.render(e)),this.finally&&(n+=this.finally.render(e)),n}optimizeNodes(){var e,n;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(n=this.finally)===null||n===void 0||n.optimizeNodes(),this}optimizeNames(e,n){var o,r;return super.optimizeNames(e,n),(o=this.catch)===null||o===void 0||o.optimizeNames(e,n),(r=this.finally)===null||r===void 0||r.optimizeNames(e,n),this}get names(){let e=super.names;return this.catch&&sn(e,this.catch.names),this.finally&&sn(e,this.finally.names),e}},ja=class extends or{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};ja.kind="catch";var Ua=class extends or{render(e){return"finally"+super.render(e)}};Ua.kind="finally";var Sg=class{constructor(e,n={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...n,_n:n.lines?`
|
|
4
|
-
`:""},this._extScope=e,this._scope=new Ct.Scope({parent:e}),this._nodes=[new vg]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,n){let o=this._extScope.value(e,n);return(this._values[o.prefix]||(this._values[o.prefix]=new Set)).add(o),o}getScopeValue(e,n){return this._extScope.getValue(e,n)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,n,o,r){let i=this._scope.toName(n);return o!==void 0&&r&&(this._constants[i.str]=o),this._leafNode(new mg(e,i,o)),i}const(e,n,o){return this._def(Ct.varKinds.const,e,n,o)}let(e,n,o){return this._def(Ct.varKinds.let,e,n,o)}var(e,n,o){return this._def(Ct.varKinds.var,e,n,o)}assign(e,n,o){return this._leafNode(new Jl(e,n,o))}add(e,n){return this._leafNode(new fg(e,ee.operators.ADD,n))}code(e){return typeof e=="function"?e():e!==oe.nil&&this._leafNode(new yg(e)),this}object(...e){let n=["{"];for(let[o,r]of e)n.length>1&&n.push(","),n.push(o),(o!==r||this.opts.es5)&&(n.push(":"),(0,oe.addCodeArg)(n,r));return n.push("}"),new oe._Code(n)}if(e,n,o){if(this._blockNode(new on(e)),n&&o)this.code(n).else().code(o).endIf();else if(n)this.code(n).endIf();else if(o)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new on(e))}else(){return this._elseNode(new Io)}endIf(){return this._endBlockNode(on,Io)}_for(e,n){return this._blockNode(e),n&&this.code(n).endFor(),this}for(e,n){return this._for(new bg(e),n)}forRange(e,n,o,r,i=this.opts.es5?Ct.varKinds.var:Ct.varKinds.let){let a=this._scope.toName(e);return this._for(new kg(i,a,n,o),()=>r(a))}forOf(e,n,o,r=Ct.varKinds.const){let i=this._scope.toName(e);if(this.opts.es5){let a=n instanceof oe.Name?n:this.var("_arr",n);return this.forRange("_i",0,(0,oe._)`${a}.length`,c=>{this.var(i,(0,oe._)`${a}[${c}]`),o(i)})}return this._for(new Yl("of",r,i,n),()=>o(i))}forIn(e,n,o,r=this.opts.es5?Ct.varKinds.var:Ct.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,oe._)`Object.keys(${n})`,o);let i=this._scope.toName(e);return this._for(new Yl("in",r,i,n),()=>o(i))}endFor(){return this._endBlockNode(an)}label(e){return this._leafNode(new hg(e))}break(e){return this._leafNode(new gg(e))}return(e){let n=new Da;if(this._blockNode(n),this.code(e),n.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Da)}try(e,n,o){if(!n&&!o)throw new Error('CodeGen: "try" without "catch" and "finally"');let r=new xg;if(this._blockNode(r),this.code(e),n){let i=this.name("e");this._currNode=r.catch=new ja(i),n(i)}return o&&(this._currNode=r.finally=new Ua,this.code(o)),this._endBlockNode(ja,Ua)}throw(e){return this._leafNode(new _g(e))}block(e,n){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(n),this}endBlock(e){let n=this._blockStarts.pop();if(n===void 0)throw new Error("CodeGen: not in self-balancing block");let o=this._nodes.length-n;if(o<0||e!==void 0&&o!==e)throw new Error(`CodeGen: wrong number of nodes: ${o} vs ${e} expected`);return this._nodes.length=n,this}func(e,n=oe.nil,o,r){return this._blockNode(new za(e,n,o)),r&&this.code(r).endFunc(),this}endFunc(){return this._endBlockNode(za)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,n){let o=this._currNode;if(o instanceof e||n&&o instanceof n)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${n?`${e.kind}/${n.kind}`:e.kind}"`)}_elseNode(e){let n=this._currNode;if(!(n instanceof on))throw new Error('CodeGen: "else" without "if"');return this._currNode=n.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let n=this._nodes;n[n.length-1]=e}};ee.CodeGen=Sg;function sn(t,e){for(let n in e)t[n]=(t[n]||0)+(e[n]||0);return t}function Xl(t,e){return e instanceof oe._CodeOrName?sn(t,e.names):t}function wo(t,e,n){if(t instanceof oe.Name)return o(t);if(!r(t))return t;return new oe._Code(t._items.reduce((i,a)=>(a instanceof oe.Name&&(a=o(a)),a instanceof oe._Code?i.push(...a._items):i.push(a),i),[]));function o(i){let a=n[i.str];return a===void 0||e[i.str]!==1?i:(delete e[i.str],a)}function r(i){return i instanceof oe._Code&&i._items.some(a=>a instanceof oe.Name&&e[a.str]===1&&n[a.str]!==void 0)}}function UC(t,e){for(let n in e)t[n]=(t[n]||0)-(e[n]||0)}function xS(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,oe._)`!${$g(t)}`}ee.not=xS;var LC=SS(ee.operators.AND);function MC(...t){return t.reduce(LC)}ee.and=MC;var ZC=SS(ee.operators.OR);function FC(...t){return t.reduce(ZC)}ee.or=FC;function SS(t){return(e,n)=>e===oe.nil?n:n===oe.nil?e:(0,oe._)`${$g(e)} ${t} ${$g(n)}`}function $g(t){return t instanceof oe.Name?t:(0,oe._)`(${t})`}});var ie=R(te=>{"use strict";Object.defineProperty(te,"__esModule",{value:!0});te.checkStrictMode=te.getErrorPath=te.Type=te.useFunc=te.setEvaluated=te.evaluatedPropsToName=te.mergeEvaluated=te.eachItem=te.unescapeJsonPointer=te.escapeJsonPointer=te.escapeFragment=te.unescapeFragment=te.schemaRefOrVal=te.schemaHasRulesButRef=te.schemaHasRules=te.checkUnknownRules=te.alwaysValidSchema=te.toHash=void 0;var ke=Y(),VC=Ca();function qC(t){let e={};for(let n of t)e[n]=!0;return e}te.toHash=qC;function BC(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(wS(t,e),!ES(e,t.self.RULES.all))}te.alwaysValidSchema=BC;function wS(t,e=t.schema){let{opts:n,self:o}=t;if(!n.strictSchema||typeof e=="boolean")return;let r=o.RULES.keywords;for(let i in e)r[i]||OS(t,`unknown keyword: "${i}"`)}te.checkUnknownRules=wS;function ES(t,e){if(typeof t=="boolean")return!t;for(let n in t)if(e[n])return!0;return!1}te.schemaHasRules=ES;function HC(t,e){if(typeof t=="boolean")return!t;for(let n in t)if(n!=="$ref"&&e.all[n])return!0;return!1}te.schemaHasRulesButRef=HC;function KC({topSchemaRef:t,schemaPath:e},n,o,r){if(!r){if(typeof n=="number"||typeof n=="boolean")return n;if(typeof n=="string")return(0,ke._)`${n}`}return(0,ke._)`${t}${e}${(0,ke.getProperty)(o)}`}te.schemaRefOrVal=KC;function GC(t){return TS(decodeURIComponent(t))}te.unescapeFragment=GC;function WC(t){return encodeURIComponent(wg(t))}te.escapeFragment=WC;function wg(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}te.escapeJsonPointer=wg;function TS(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}te.unescapeJsonPointer=TS;function JC(t,e){if(Array.isArray(t))for(let n of t)e(n);else e(t)}te.eachItem=JC;function $S({mergeNames:t,mergeToName:e,mergeValues:n,resultToName:o}){return(r,i,a,c)=>{let u=a===void 0?i:a instanceof ke.Name?(i instanceof ke.Name?t(r,i,a):e(r,i,a),a):i instanceof ke.Name?(e(r,a,i),i):n(i,a);return c===ke.Name&&!(u instanceof ke.Name)?o(r,u):u}}te.mergeEvaluated={props:$S({mergeNames:(t,e,n)=>t.if((0,ke._)`${n} !== true && ${e} !== undefined`,()=>{t.if((0,ke._)`${e} === true`,()=>t.assign(n,!0),()=>t.assign(n,(0,ke._)`${n} || {}`).code((0,ke._)`Object.assign(${n}, ${e})`))}),mergeToName:(t,e,n)=>t.if((0,ke._)`${n} !== true`,()=>{e===!0?t.assign(n,!0):(t.assign(n,(0,ke._)`${n} || {}`),Eg(t,n,e))}),mergeValues:(t,e)=>t===!0?!0:{...t,...e},resultToName:PS}),items:$S({mergeNames:(t,e,n)=>t.if((0,ke._)`${n} !== true && ${e} !== undefined`,()=>t.assign(n,(0,ke._)`${e} === true ? true : ${n} > ${e} ? ${n} : ${e}`)),mergeToName:(t,e,n)=>t.if((0,ke._)`${n} !== true`,()=>t.assign(n,e===!0?!0:(0,ke._)`${n} > ${e} ? ${n} : ${e}`)),mergeValues:(t,e)=>t===!0?!0:Math.max(t,e),resultToName:(t,e)=>t.var("items",e)})};function PS(t,e){if(e===!0)return t.var("props",!0);let n=t.var("props",(0,ke._)`{}`);return e!==void 0&&Eg(t,n,e),n}te.evaluatedPropsToName=PS;function Eg(t,e,n){Object.keys(n).forEach(o=>t.assign((0,ke._)`${e}${(0,ke.getProperty)(o)}`,!0))}te.setEvaluated=Eg;var IS={};function YC(t,e){return t.scopeValue("func",{ref:e,code:IS[e.code]||(IS[e.code]=new VC._Code(e.code))})}te.useFunc=YC;var Ig;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(Ig||(te.Type=Ig={}));function XC(t,e,n){if(t instanceof ke.Name){let o=e===Ig.Num;return n?o?(0,ke._)`"[" + ${t} + "]"`:(0,ke._)`"['" + ${t} + "']"`:o?(0,ke._)`"/" + ${t}`:(0,ke._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return n?(0,ke.getProperty)(t).toString():"/"+wg(t)}te.getErrorPath=XC;function OS(t,e,n=t.opts.strictSchema){if(n){if(e=`strict mode: ${e}`,n===!0)throw new Error(e);t.self.logger.warn(e)}}te.checkStrictMode=OS});var ir=R(Tg=>{"use strict";Object.defineProperty(Tg,"__esModule",{value:!0});var Fe=Y(),QC={data:new Fe.Name("data"),valCxt:new Fe.Name("valCxt"),instancePath:new Fe.Name("instancePath"),parentData:new Fe.Name("parentData"),parentDataProperty:new Fe.Name("parentDataProperty"),rootData:new Fe.Name("rootData"),dynamicAnchors:new Fe.Name("dynamicAnchors"),vErrors:new Fe.Name("vErrors"),errors:new Fe.Name("errors"),this:new Fe.Name("this"),self:new Fe.Name("self"),scope:new Fe.Name("scope"),json:new Fe.Name("json"),jsonPos:new Fe.Name("jsonPos"),jsonLen:new Fe.Name("jsonLen"),jsonPart:new Fe.Name("jsonPart")};Tg.default=QC});var La=R(Ve=>{"use strict";Object.defineProperty(Ve,"__esModule",{value:!0});Ve.extendErrors=Ve.resetErrorsCount=Ve.reportExtraError=Ve.reportError=Ve.keyword$DataError=Ve.keywordError=void 0;var ae=Y(),ed=ie(),Xe=ir();Ve.keywordError={message:({keyword:t})=>(0,ae.str)`must pass "${t}" keyword validation`};Ve.keyword$DataError={message:({keyword:t,schemaType:e})=>e?(0,ae.str)`"${t}" keyword must be ${e} ($data)`:(0,ae.str)`"${t}" keyword is invalid ($data)`};function eN(t,e=Ve.keywordError,n,o){let{it:r}=t,{gen:i,compositeRule:a,allErrors:c}=r,u=CS(t,e,n);o??(a||c)?RS(i,u):AS(r,(0,ae._)`[${u}]`)}Ve.reportError=eN;function tN(t,e=Ve.keywordError,n){let{it:o}=t,{gen:r,compositeRule:i,allErrors:a}=o,c=CS(t,e,n);RS(r,c),i||a||AS(o,Xe.default.vErrors)}Ve.reportExtraError=tN;function rN(t,e){t.assign(Xe.default.errors,e),t.if((0,ae._)`${Xe.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,ae._)`${Xe.default.vErrors}.length`,e),()=>t.assign(Xe.default.vErrors,null)))}Ve.resetErrorsCount=rN;function nN({gen:t,keyword:e,schemaValue:n,data:o,errsCount:r,it:i}){if(r===void 0)throw new Error("ajv implementation error");let a=t.name("err");t.forRange("i",r,Xe.default.errors,c=>{t.const(a,(0,ae._)`${Xe.default.vErrors}[${c}]`),t.if((0,ae._)`${a}.instancePath === undefined`,()=>t.assign((0,ae._)`${a}.instancePath`,(0,ae.strConcat)(Xe.default.instancePath,i.errorPath))),t.assign((0,ae._)`${a}.schemaPath`,(0,ae.str)`${i.errSchemaPath}/${e}`),i.opts.verbose&&(t.assign((0,ae._)`${a}.schema`,n),t.assign((0,ae._)`${a}.data`,o))})}Ve.extendErrors=nN;function RS(t,e){let n=t.const("err",e);t.if((0,ae._)`${Xe.default.vErrors} === null`,()=>t.assign(Xe.default.vErrors,(0,ae._)`[${n}]`),(0,ae._)`${Xe.default.vErrors}.push(${n})`),t.code((0,ae._)`${Xe.default.errors}++`)}function AS(t,e){let{gen:n,validateName:o,schemaEnv:r}=t;r.$async?n.throw((0,ae._)`new ${t.ValidationError}(${e})`):(n.assign((0,ae._)`${o}.errors`,e),n.return(!1))}var cn={keyword:new ae.Name("keyword"),schemaPath:new ae.Name("schemaPath"),params:new ae.Name("params"),propertyName:new ae.Name("propertyName"),message:new ae.Name("message"),schema:new ae.Name("schema"),parentSchema:new ae.Name("parentSchema")};function CS(t,e,n){let{createErrors:o}=t.it;return o===!1?(0,ae._)`{}`:oN(t,e,n)}function oN(t,e,n={}){let{gen:o,it:r}=t,i=[iN(r,n),aN(t,n)];return sN(t,e,i),o.object(...i)}function iN({errorPath:t},{instancePath:e}){let n=e?(0,ae.str)`${t}${(0,ed.getErrorPath)(e,ed.Type.Str)}`:t;return[Xe.default.instancePath,(0,ae.strConcat)(Xe.default.instancePath,n)]}function aN({keyword:t,it:{errSchemaPath:e}},{schemaPath:n,parentSchema:o}){let r=o?e:(0,ae.str)`${e}/${t}`;return n&&(r=(0,ae.str)`${r}${(0,ed.getErrorPath)(n,ed.Type.Str)}`),[cn.schemaPath,r]}function sN(t,{params:e,message:n},o){let{keyword:r,data:i,schemaValue:a,it:c}=t,{opts:u,propertyName:d,topSchemaRef:l,schemaPath:p}=c;o.push([cn.keyword,r],[cn.params,typeof e=="function"?e(t):e||(0,ae._)`{}`]),u.messages&&o.push([cn.message,typeof n=="function"?n(t):n]),u.verbose&&o.push([cn.schema,a],[cn.parentSchema,(0,ae._)`${l}${p}`],[Xe.default.data,i]),d&&o.push([cn.propertyName,d])}});var zS=R(Eo=>{"use strict";Object.defineProperty(Eo,"__esModule",{value:!0});Eo.boolOrEmptySchema=Eo.topBoolOrEmptySchema=void 0;var cN=La(),uN=Y(),lN=ir(),dN={message:"boolean schema is false"};function pN(t){let{gen:e,schema:n,validateName:o}=t;n===!1?NS(t,!1):typeof n=="object"&&n.$async===!0?e.return(lN.default.data):(e.assign((0,uN._)`${o}.errors`,null),e.return(!0))}Eo.topBoolOrEmptySchema=pN;function mN(t,e){let{gen:n,schema:o}=t;o===!1?(n.var(e,!1),NS(t)):n.var(e,!0)}Eo.boolOrEmptySchema=mN;function NS(t,e){let{gen:n,data:o}=t,r={gen:n,keyword:"false schema",data:o,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,cN.reportError)(r,dN,void 0,e)}});var Pg=R(To=>{"use strict";Object.defineProperty(To,"__esModule",{value:!0});To.getRules=To.isJSONType=void 0;var fN=["string","number","integer","boolean","null","object","array"],hN=new Set(fN);function gN(t){return typeof t=="string"&&hN.has(t)}To.isJSONType=gN;function _N(){let t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...t,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}To.getRules=_N});var Og=R(Cr=>{"use strict";Object.defineProperty(Cr,"__esModule",{value:!0});Cr.shouldUseRule=Cr.shouldUseGroup=Cr.schemaHasRulesForType=void 0;function yN({schema:t,self:e},n){let o=e.RULES.types[n];return o&&o!==!0&&DS(t,o)}Cr.schemaHasRulesForType=yN;function DS(t,e){return e.rules.some(n=>jS(t,n))}Cr.shouldUseGroup=DS;function jS(t,e){var n;return t[e.keyword]!==void 0||((n=e.definition.implements)===null||n===void 0?void 0:n.some(o=>t[o]!==void 0))}Cr.shouldUseRule=jS});var Ma=R(qe=>{"use strict";Object.defineProperty(qe,"__esModule",{value:!0});qe.reportTypeError=qe.checkDataTypes=qe.checkDataType=qe.coerceAndCheckDataType=qe.getJSONTypes=qe.getSchemaTypes=qe.DataType=void 0;var vN=Pg(),bN=Og(),kN=La(),J=Y(),US=ie(),Po;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(Po||(qe.DataType=Po={}));function xN(t){let e=LS(t.type);if(e.includes("null")){if(t.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&t.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');t.nullable===!0&&e.push("null")}return e}qe.getSchemaTypes=xN;function LS(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(vN.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}qe.getJSONTypes=LS;function SN(t,e){let{gen:n,data:o,opts:r}=t,i=$N(e,r.coerceTypes),a=e.length>0&&!(i.length===0&&e.length===1&&(0,bN.schemaHasRulesForType)(t,e[0]));if(a){let c=Ag(e,o,r.strictNumbers,Po.Wrong);n.if(c,()=>{i.length?IN(t,e,i):Cg(t)})}return a}qe.coerceAndCheckDataType=SN;var MS=new Set(["string","number","integer","boolean","null"]);function $N(t,e){return e?t.filter(n=>MS.has(n)||e==="array"&&n==="array"):[]}function IN(t,e,n){let{gen:o,data:r,opts:i}=t,a=o.let("dataType",(0,J._)`typeof ${r}`),c=o.let("coerced",(0,J._)`undefined`);i.coerceTypes==="array"&&o.if((0,J._)`${a} == 'object' && Array.isArray(${r}) && ${r}.length == 1`,()=>o.assign(r,(0,J._)`${r}[0]`).assign(a,(0,J._)`typeof ${r}`).if(Ag(e,r,i.strictNumbers),()=>o.assign(c,r))),o.if((0,J._)`${c} !== undefined`);for(let d of n)(MS.has(d)||d==="array"&&i.coerceTypes==="array")&&u(d);o.else(),Cg(t),o.endIf(),o.if((0,J._)`${c} !== undefined`,()=>{o.assign(r,c),wN(t,c)});function u(d){switch(d){case"string":o.elseIf((0,J._)`${a} == "number" || ${a} == "boolean"`).assign(c,(0,J._)`"" + ${r}`).elseIf((0,J._)`${r} === null`).assign(c,(0,J._)`""`);return;case"number":o.elseIf((0,J._)`${a} == "boolean" || ${r} === null
|
|
5
|
-
|| (${
|
|
6
|
-
|| (${
|
|
7
|
-
|| ${a} === "boolean" || ${r} === null`).assign(c,(0,J._)`[${r}]`)}}}function wN({gen:t,parentData:e,parentDataProperty:n},o){t.if((0,J._)`${e} !== undefined`,()=>t.assign((0,J._)`${e}[${n}]`,o))}function Rg(t,e,n,o=Po.Correct){let r=o===Po.Correct?J.operators.EQ:J.operators.NEQ,i;switch(t){case"null":return(0,J._)`${e} ${r} null`;case"array":i=(0,J._)`Array.isArray(${e})`;break;case"object":i=(0,J._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":i=a((0,J._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":i=a();break;default:return(0,J._)`typeof ${e} ${r} ${t}`}return o===Po.Correct?i:(0,J.not)(i);function a(c=J.nil){return(0,J.and)((0,J._)`typeof ${e} == "number"`,c,n?(0,J._)`isFinite(${e})`:J.nil)}}qe.checkDataType=Rg;function Ag(t,e,n,o){if(t.length===1)return Rg(t[0],e,n,o);let r,i=(0,US.toHash)(t);if(i.array&&i.object){let a=(0,J._)`typeof ${e} != "object"`;r=i.null?a:(0,J._)`!${e} || ${a}`,delete i.null,delete i.array,delete i.object}else r=J.nil;i.number&&delete i.integer;for(let a in i)r=(0,J.and)(r,Rg(a,e,n,o));return r}qe.checkDataTypes=Ag;var EN={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>typeof t=="string"?(0,J._)`{type: ${t}}`:(0,J._)`{type: ${e}}`};function Cg(t){let e=TN(t);(0,kN.reportError)(e,EN)}qe.reportTypeError=Cg;function TN(t){let{gen:e,data:n,schema:o}=t,r=(0,US.schemaRefOrVal)(t,o,"type");return{gen:e,keyword:"type",data:n,schema:o.type,schemaCode:r,schemaValue:r,parentSchema:o,params:{},it:t}}});var FS=R(td=>{"use strict";Object.defineProperty(td,"__esModule",{value:!0});td.assignDefaults=void 0;var Oo=Y(),PN=ie();function ON(t,e){let{properties:n,items:o}=t.schema;if(e==="object"&&n)for(let r in n)ZS(t,r,n[r].default);else e==="array"&&Array.isArray(o)&&o.forEach((r,i)=>ZS(t,i,r.default))}td.assignDefaults=ON;function ZS(t,e,n){let{gen:o,compositeRule:r,data:i,opts:a}=t;if(n===void 0)return;let c=(0,Oo._)`${i}${(0,Oo.getProperty)(e)}`;if(r){(0,PN.checkStrictMode)(t,`default is ignored for: ${c}`);return}let u=(0,Oo._)`${c} === undefined`;a.useDefaults==="empty"&&(u=(0,Oo._)`${u} || ${c} === null || ${c} === ""`),o.if(u,(0,Oo._)`${c} = ${(0,Oo.stringify)(n)}`)}});var xt=R(ye=>{"use strict";Object.defineProperty(ye,"__esModule",{value:!0});ye.validateUnion=ye.validateArray=ye.usePattern=ye.callValidateCode=ye.schemaProperties=ye.allSchemaProperties=ye.noPropertyInData=ye.propertyInData=ye.isOwnProperty=ye.hasPropFunc=ye.reportMissingProp=ye.checkMissingProp=ye.checkReportMissingProp=void 0;var Se=Y(),Ng=ie(),Nr=ir(),RN=ie();function AN(t,e){let{gen:n,data:o,it:r}=t;n.if(Dg(n,o,e,r.opts.ownProperties),()=>{t.setParams({missingProperty:(0,Se._)`${e}`},!0),t.error()})}ye.checkReportMissingProp=AN;function CN({gen:t,data:e,it:{opts:n}},o,r){return(0,Se.or)(...o.map(i=>(0,Se.and)(Dg(t,e,i,n.ownProperties),(0,Se._)`${r} = ${i}`)))}ye.checkMissingProp=CN;function NN(t,e){t.setParams({missingProperty:e},!0),t.error()}ye.reportMissingProp=NN;function VS(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,Se._)`Object.prototype.hasOwnProperty`})}ye.hasPropFunc=VS;function zg(t,e,n){return(0,Se._)`${VS(t)}.call(${e}, ${n})`}ye.isOwnProperty=zg;function zN(t,e,n,o){let r=(0,Se._)`${e}${(0,Se.getProperty)(n)} !== undefined`;return o?(0,Se._)`${r} && ${zg(t,e,n)}`:r}ye.propertyInData=zN;function Dg(t,e,n,o){let r=(0,Se._)`${e}${(0,Se.getProperty)(n)} === undefined`;return o?(0,Se.or)(r,(0,Se.not)(zg(t,e,n))):r}ye.noPropertyInData=Dg;function qS(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}ye.allSchemaProperties=qS;function DN(t,e){return qS(e).filter(n=>!(0,Ng.alwaysValidSchema)(t,e[n]))}ye.schemaProperties=DN;function jN({schemaCode:t,data:e,it:{gen:n,topSchemaRef:o,schemaPath:r,errorPath:i},it:a},c,u,d){let l=d?(0,Se._)`${t}, ${e}, ${o}${r}`:e,p=[[Nr.default.instancePath,(0,Se.strConcat)(Nr.default.instancePath,i)],[Nr.default.parentData,a.parentData],[Nr.default.parentDataProperty,a.parentDataProperty],[Nr.default.rootData,Nr.default.rootData]];a.opts.dynamicRef&&p.push([Nr.default.dynamicAnchors,Nr.default.dynamicAnchors]);let m=(0,Se._)`${l}, ${n.object(...p)}`;return u!==Se.nil?(0,Se._)`${c}.call(${u}, ${m})`:(0,Se._)`${c}(${m})`}ye.callValidateCode=jN;var UN=(0,Se._)`new RegExp`;function LN({gen:t,it:{opts:e}},n){let o=e.unicodeRegExp?"u":"",{regExp:r}=e.code,i=r(n,o);return t.scopeValue("pattern",{key:i.toString(),ref:i,code:(0,Se._)`${r.code==="new RegExp"?UN:(0,RN.useFunc)(t,r)}(${n}, ${o})`})}ye.usePattern=LN;function MN(t){let{gen:e,data:n,keyword:o,it:r}=t,i=e.name("valid");if(r.allErrors){let c=e.let("valid",!0);return a(()=>e.assign(c,!1)),c}return e.var(i,!0),a(()=>e.break()),i;function a(c){let u=e.const("len",(0,Se._)`${n}.length`);e.forRange("i",0,u,d=>{t.subschema({keyword:o,dataProp:d,dataPropType:Ng.Type.Num},i),e.if((0,Se.not)(i),c)})}}ye.validateArray=MN;function ZN(t){let{gen:e,schema:n,keyword:o,it:r}=t;if(!Array.isArray(n))throw new Error("ajv implementation error");if(n.some(u=>(0,Ng.alwaysValidSchema)(r,u))&&!r.opts.unevaluated)return;let a=e.let("valid",!1),c=e.name("_valid");e.block(()=>n.forEach((u,d)=>{let l=t.subschema({keyword:o,schemaProp:d,compositeRule:!0},c);e.assign(a,(0,Se._)`${a} || ${c}`),t.mergeValidEvaluated(l,c)||e.if((0,Se.not)(a))})),t.result(a,()=>t.reset(),()=>t.error(!0))}ye.validateUnion=ZN});var KS=R(Bt=>{"use strict";Object.defineProperty(Bt,"__esModule",{value:!0});Bt.validateKeywordUsage=Bt.validSchemaType=Bt.funcKeywordCode=Bt.macroKeywordCode=void 0;var Qe=Y(),un=ir(),FN=xt(),VN=La();function qN(t,e){let{gen:n,keyword:o,schema:r,parentSchema:i,it:a}=t,c=e.macro.call(a.self,r,i,a),u=HS(n,o,c);a.opts.validateSchema!==!1&&a.self.validateSchema(c,!0);let d=n.name("valid");t.subschema({schema:c,schemaPath:Qe.nil,errSchemaPath:`${a.errSchemaPath}/${o}`,topSchemaRef:u,compositeRule:!0},d),t.pass(d,()=>t.error(!0))}Bt.macroKeywordCode=qN;function BN(t,e){var n;let{gen:o,keyword:r,schema:i,parentSchema:a,$data:c,it:u}=t;KN(u,e);let d=!c&&e.compile?e.compile.call(u.self,i,a,u):e.validate,l=HS(o,r,d),p=o.let("valid");t.block$data(p,m),t.ok((n=e.valid)!==null&&n!==void 0?n:p);function m(){if(e.errors===!1)v(),e.modifying&&BS(t),b(()=>t.error());else{let E=e.async?f():g();e.modifying&&BS(t),b(()=>HN(t,E))}}function f(){let E=o.let("ruleErrs",null);return o.try(()=>v((0,Qe._)`await `),N=>o.assign(p,!1).if((0,Qe._)`${N} instanceof ${u.ValidationError}`,()=>o.assign(E,(0,Qe._)`${N}.errors`),()=>o.throw(N))),E}function g(){let E=(0,Qe._)`${l}.errors`;return o.assign(E,null),v(Qe.nil),E}function v(E=e.async?(0,Qe._)`await `:Qe.nil){let N=u.opts.passContext?un.default.this:un.default.self,z=!("compile"in e&&!c||e.schema===!1);o.assign(p,(0,Qe._)`${E}${(0,FN.callValidateCode)(t,l,N,z)}`,e.modifying)}function b(E){var N;o.if((0,Qe.not)((N=e.valid)!==null&&N!==void 0?N:p),E)}}Bt.funcKeywordCode=BN;function BS(t){let{gen:e,data:n,it:o}=t;e.if(o.parentData,()=>e.assign(n,(0,Qe._)`${o.parentData}[${o.parentDataProperty}]`))}function HN(t,e){let{gen:n}=t;n.if((0,Qe._)`Array.isArray(${e})`,()=>{n.assign(un.default.vErrors,(0,Qe._)`${un.default.vErrors} === null ? ${e} : ${un.default.vErrors}.concat(${e})`).assign(un.default.errors,(0,Qe._)`${un.default.vErrors}.length`),(0,VN.extendErrors)(t)},()=>t.error())}function KN({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function HS(t,e,n){if(n===void 0)throw new Error(`keyword "${e}" failed to compile`);return t.scopeValue("keyword",typeof n=="function"?{ref:n}:{ref:n,code:(0,Qe.stringify)(n)})}function GN(t,e,n=!1){return!e.length||e.some(o=>o==="array"?Array.isArray(t):o==="object"?t&&typeof t=="object"&&!Array.isArray(t):typeof t==o||n&&typeof t>"u")}Bt.validSchemaType=GN;function WN({schema:t,opts:e,self:n,errSchemaPath:o},r,i){if(Array.isArray(r.keyword)?!r.keyword.includes(i):r.keyword!==i)throw new Error("ajv implementation error");let a=r.dependencies;if(a?.some(c=>!Object.prototype.hasOwnProperty.call(t,c)))throw new Error(`parent schema must have dependencies of ${i}: ${a.join(",")}`);if(r.validateSchema&&!r.validateSchema(t[i])){let u=`keyword "${i}" value is invalid at path "${o}": `+n.errorsText(r.validateSchema.errors);if(e.validateSchema==="log")n.logger.error(u);else throw new Error(u)}}Bt.validateKeywordUsage=WN});var WS=R(zr=>{"use strict";Object.defineProperty(zr,"__esModule",{value:!0});zr.extendSubschemaMode=zr.extendSubschemaData=zr.getSubschema=void 0;var Ht=Y(),GS=ie();function JN(t,{keyword:e,schemaProp:n,schema:o,schemaPath:r,errSchemaPath:i,topSchemaRef:a}){if(e!==void 0&&o!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){let c=t.schema[e];return n===void 0?{schema:c,schemaPath:(0,Ht._)`${t.schemaPath}${(0,Ht.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:c[n],schemaPath:(0,Ht._)`${t.schemaPath}${(0,Ht.getProperty)(e)}${(0,Ht.getProperty)(n)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,GS.escapeFragment)(n)}`}}if(o!==void 0){if(r===void 0||i===void 0||a===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:o,schemaPath:r,topSchemaRef:a,errSchemaPath:i}}throw new Error('either "keyword" or "schema" must be passed')}zr.getSubschema=JN;function YN(t,e,{dataProp:n,dataPropType:o,data:r,dataTypes:i,propertyName:a}){if(r!==void 0&&n!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:c}=e;if(n!==void 0){let{errorPath:d,dataPathArr:l,opts:p}=e,m=c.let("data",(0,Ht._)`${e.data}${(0,Ht.getProperty)(n)}`,!0);u(m),t.errorPath=(0,Ht.str)`${d}${(0,GS.getErrorPath)(n,o,p.jsPropertySyntax)}`,t.parentDataProperty=(0,Ht._)`${n}`,t.dataPathArr=[...l,t.parentDataProperty]}if(r!==void 0){let d=r instanceof Ht.Name?r:c.let("data",r,!0);u(d),a!==void 0&&(t.propertyName=a)}i&&(t.dataTypes=i);function u(d){t.data=d,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,d]}}zr.extendSubschemaData=YN;function XN(t,{jtdDiscriminator:e,jtdMetadata:n,compositeRule:o,createErrors:r,allErrors:i}){o!==void 0&&(t.compositeRule=o),r!==void 0&&(t.createErrors=r),i!==void 0&&(t.allErrors=i),t.jtdDiscriminator=e,t.jtdMetadata=n}zr.extendSubschemaMode=XN});var jg=R((c9,JS)=>{"use strict";JS.exports=function t(e,n){if(e===n)return!0;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(e.constructor!==n.constructor)return!1;var o,r,i;if(Array.isArray(e)){if(o=e.length,o!=n.length)return!1;for(r=o;r--!==0;)if(!t(e[r],n[r]))return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if(i=Object.keys(e),o=i.length,o!==Object.keys(n).length)return!1;for(r=o;r--!==0;)if(!Object.prototype.hasOwnProperty.call(n,i[r]))return!1;for(r=o;r--!==0;){var a=i[r];if(!t(e[a],n[a]))return!1}return!0}return e!==e&&n!==n}});var XS=R((u9,YS)=>{"use strict";var Dr=YS.exports=function(t,e,n){typeof e=="function"&&(n=e,e={}),n=e.cb||n;var o=typeof n=="function"?n:n.pre||function(){},r=n.post||function(){};rd(e,o,r,t,"",t)};Dr.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Dr.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Dr.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Dr.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 rd(t,e,n,o,r,i,a,c,u,d){if(o&&typeof o=="object"&&!Array.isArray(o)){e(o,r,i,a,c,u,d);for(var l in o){var p=o[l];if(Array.isArray(p)){if(l in Dr.arrayKeywords)for(var m=0;m<p.length;m++)rd(t,e,n,p[m],r+"/"+l+"/"+m,i,r,l,o,m)}else if(l in Dr.propsKeywords){if(p&&typeof p=="object")for(var f in p)rd(t,e,n,p[f],r+"/"+l+"/"+QN(f),i,r,l,o,f)}else(l in Dr.keywords||t.allKeys&&!(l in Dr.skipKeywords))&&rd(t,e,n,p,r+"/"+l,i,r,l,o)}n(o,r,i,a,c,u,d)}}function QN(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}});var Za=R(ct=>{"use strict";Object.defineProperty(ct,"__esModule",{value:!0});ct.getSchemaRefs=ct.resolveUrl=ct.normalizeId=ct._getFullPath=ct.getFullPath=ct.inlineRef=void 0;var ez=ie(),tz=jg(),rz=XS(),nz=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function oz(t,e=!0){return typeof t=="boolean"?!0:e===!0?!Ug(t):e?QS(t)<=e:!1}ct.inlineRef=oz;var iz=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Ug(t){for(let e in t){if(iz.has(e))return!0;let n=t[e];if(Array.isArray(n)&&n.some(Ug)||typeof n=="object"&&Ug(n))return!0}return!1}function QS(t){let e=0;for(let n in t){if(n==="$ref")return 1/0;if(e++,!nz.has(n)&&(typeof t[n]=="object"&&(0,ez.eachItem)(t[n],o=>e+=QS(o)),e===1/0))return 1/0}return e}function e$(t,e="",n){n!==!1&&(e=Ro(e));let o=t.parse(e);return t$(t,o)}ct.getFullPath=e$;function t$(t,e){return t.serialize(e).split("#")[0]+"#"}ct._getFullPath=t$;var az=/#\/?$/;function Ro(t){return t?t.replace(az,""):""}ct.normalizeId=Ro;function sz(t,e,n){return n=Ro(n),t.resolve(e,n)}ct.resolveUrl=sz;var cz=/^[a-z_][-a-z0-9._]*$/i;function uz(t,e){if(typeof t=="boolean")return{};let{schemaId:n,uriResolver:o}=this.opts,r=Ro(t[n]||e),i={"":r},a=e$(o,r,!1),c={},u=new Set;return rz(t,{allKeys:!0},(p,m,f,g)=>{if(g===void 0)return;let v=a+m,b=i[g];typeof p[n]=="string"&&(b=E.call(this,p[n])),N.call(this,p.$anchor),N.call(this,p.$dynamicAnchor),i[m]=b;function E(z){let j=this.opts.uriResolver.resolve;if(z=Ro(b?j(b,z):z),u.has(z))throw l(z);u.add(z);let D=this.refs[z];return typeof D=="string"&&(D=this.refs[D]),typeof D=="object"?d(p,D.schema,z):z!==Ro(v)&&(z[0]==="#"?(d(p,c[z],z),c[z]=p):this.refs[z]=v),z}function N(z){if(typeof z=="string"){if(!cz.test(z))throw new Error(`invalid anchor "${z}"`);E.call(this,`#${z}`)}}}),c;function d(p,m,f){if(m!==void 0&&!tz(p,m))throw l(f)}function l(p){return new Error(`reference "${p}" resolves to more than one schema`)}}ct.getSchemaRefs=uz});var qa=R(jr=>{"use strict";Object.defineProperty(jr,"__esModule",{value:!0});jr.getData=jr.KeywordCxt=jr.validateFunctionCode=void 0;var a$=zS(),r$=Ma(),Mg=Og(),nd=Ma(),lz=FS(),Va=KS(),Lg=WS(),Z=Y(),H=ir(),dz=Za(),ar=ie(),Fa=La();function pz(t){if(u$(t)&&(l$(t),c$(t))){hz(t);return}s$(t,()=>(0,a$.topBoolOrEmptySchema)(t))}jr.validateFunctionCode=pz;function s$({gen:t,validateName:e,schema:n,schemaEnv:o,opts:r},i){r.code.es5?t.func(e,(0,Z._)`${H.default.data}, ${H.default.valCxt}`,o.$async,()=>{t.code((0,Z._)`"use strict"; ${n$(n,r)}`),fz(t,r),t.code(i)}):t.func(e,(0,Z._)`${H.default.data}, ${mz(r)}`,o.$async,()=>t.code(n$(n,r)).code(i))}function mz(t){return(0,Z._)`{${H.default.instancePath}="", ${H.default.parentData}, ${H.default.parentDataProperty}, ${H.default.rootData}=${H.default.data}${t.dynamicRef?(0,Z._)`, ${H.default.dynamicAnchors}={}`:Z.nil}}={}`}function fz(t,e){t.if(H.default.valCxt,()=>{t.var(H.default.instancePath,(0,Z._)`${H.default.valCxt}.${H.default.instancePath}`),t.var(H.default.parentData,(0,Z._)`${H.default.valCxt}.${H.default.parentData}`),t.var(H.default.parentDataProperty,(0,Z._)`${H.default.valCxt}.${H.default.parentDataProperty}`),t.var(H.default.rootData,(0,Z._)`${H.default.valCxt}.${H.default.rootData}`),e.dynamicRef&&t.var(H.default.dynamicAnchors,(0,Z._)`${H.default.valCxt}.${H.default.dynamicAnchors}`)},()=>{t.var(H.default.instancePath,(0,Z._)`""`),t.var(H.default.parentData,(0,Z._)`undefined`),t.var(H.default.parentDataProperty,(0,Z._)`undefined`),t.var(H.default.rootData,H.default.data),e.dynamicRef&&t.var(H.default.dynamicAnchors,(0,Z._)`{}`)})}function hz(t){let{schema:e,opts:n,gen:o}=t;s$(t,()=>{n.$comment&&e.$comment&&p$(t),bz(t),o.let(H.default.vErrors,null),o.let(H.default.errors,0),n.unevaluated&&gz(t),d$(t),Sz(t)})}function gz(t){let{gen:e,validateName:n}=t;t.evaluated=e.const("evaluated",(0,Z._)`${n}.evaluated`),e.if((0,Z._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,Z._)`${t.evaluated}.props`,(0,Z._)`undefined`)),e.if((0,Z._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,Z._)`${t.evaluated}.items`,(0,Z._)`undefined`))}function n$(t,e){let n=typeof t=="object"&&t[e.schemaId];return n&&(e.code.source||e.code.process)?(0,Z._)`/*# sourceURL=${n} */`:Z.nil}function _z(t,e){if(u$(t)&&(l$(t),c$(t))){yz(t,e);return}(0,a$.boolOrEmptySchema)(t,e)}function c$({schema:t,self:e}){if(typeof t=="boolean")return!t;for(let n in t)if(e.RULES.all[n])return!0;return!1}function u$(t){return typeof t.schema!="boolean"}function yz(t,e){let{schema:n,gen:o,opts:r}=t;r.$comment&&n.$comment&&p$(t),kz(t),xz(t);let i=o.const("_errs",H.default.errors);d$(t,i),o.var(e,(0,Z._)`${i} === ${H.default.errors}`)}function l$(t){(0,ar.checkUnknownRules)(t),vz(t)}function d$(t,e){if(t.opts.jtd)return o$(t,[],!1,e);let n=(0,r$.getSchemaTypes)(t.schema),o=(0,r$.coerceAndCheckDataType)(t,n);o$(t,n,!o,e)}function vz(t){let{schema:e,errSchemaPath:n,opts:o,self:r}=t;e.$ref&&o.ignoreKeywordsWithRef&&(0,ar.schemaHasRulesButRef)(e,r.RULES)&&r.logger.warn(`$ref: keywords ignored in schema at path "${n}"`)}function bz(t){let{schema:e,opts:n}=t;e.default!==void 0&&n.useDefaults&&n.strictSchema&&(0,ar.checkStrictMode)(t,"default is ignored in the schema root")}function kz(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,dz.resolveUrl)(t.opts.uriResolver,t.baseId,e))}function xz(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function p$({gen:t,schemaEnv:e,schema:n,errSchemaPath:o,opts:r}){let i=n.$comment;if(r.$comment===!0)t.code((0,Z._)`${H.default.self}.logger.log(${i})`);else if(typeof r.$comment=="function"){let a=(0,Z.str)`${o}/$comment`,c=t.scopeValue("root",{ref:e.root});t.code((0,Z._)`${H.default.self}.opts.$comment(${i}, ${a}, ${c}.schema)`)}}function Sz(t){let{gen:e,schemaEnv:n,validateName:o,ValidationError:r,opts:i}=t;n.$async?e.if((0,Z._)`${H.default.errors} === 0`,()=>e.return(H.default.data),()=>e.throw((0,Z._)`new ${r}(${H.default.vErrors})`)):(e.assign((0,Z._)`${o}.errors`,H.default.vErrors),i.unevaluated&&$z(t),e.return((0,Z._)`${H.default.errors} === 0`))}function $z({gen:t,evaluated:e,props:n,items:o}){n instanceof Z.Name&&t.assign((0,Z._)`${e}.props`,n),o instanceof Z.Name&&t.assign((0,Z._)`${e}.items`,o)}function o$(t,e,n,o){let{gen:r,schema:i,data:a,allErrors:c,opts:u,self:d}=t,{RULES:l}=d;if(i.$ref&&(u.ignoreKeywordsWithRef||!(0,ar.schemaHasRulesButRef)(i,l))){r.block(()=>f$(t,"$ref",l.all.$ref.definition));return}u.jtd||Iz(t,e),r.block(()=>{for(let m of l.rules)p(m);p(l.post)});function p(m){(0,Mg.shouldUseGroup)(i,m)&&(m.type?(r.if((0,nd.checkDataType)(m.type,a,u.strictNumbers)),i$(t,m),e.length===1&&e[0]===m.type&&n&&(r.else(),(0,nd.reportTypeError)(t)),r.endIf()):i$(t,m),c||r.if((0,Z._)`${H.default.errors} === ${o||0}`))}}function i$(t,e){let{gen:n,schema:o,opts:{useDefaults:r}}=t;r&&(0,lz.assignDefaults)(t,e.type),n.block(()=>{for(let i of e.rules)(0,Mg.shouldUseRule)(o,i)&&f$(t,i.keyword,i.definition,e.type)})}function Iz(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(wz(t,e),t.opts.allowUnionTypes||Ez(t,e),Tz(t,t.dataTypes))}function wz(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(n=>{m$(t.dataTypes,n)||Zg(t,`type "${n}" not allowed by context "${t.dataTypes.join(",")}"`)}),Oz(t,e)}}function Ez(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&Zg(t,"use allowUnionTypes to allow union type keyword")}function Tz(t,e){let n=t.self.RULES.all;for(let o in n){let r=n[o];if(typeof r=="object"&&(0,Mg.shouldUseRule)(t.schema,r)){let{type:i}=r.definition;i.length&&!i.some(a=>Pz(e,a))&&Zg(t,`missing type "${i.join(",")}" for keyword "${o}"`)}}}function Pz(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}function m$(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}function Oz(t,e){let n=[];for(let o of t.dataTypes)m$(e,o)?n.push(o):e.includes("integer")&&o==="number"&&n.push("integer");t.dataTypes=n}function Zg(t,e){let n=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${n}" (strictTypes)`,(0,ar.checkStrictMode)(t,e,t.opts.strictTypes)}var od=class{constructor(e,n,o){if((0,Va.validateKeywordUsage)(e,n,o),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=o,this.data=e.data,this.schema=e.schema[o],this.$data=n.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,ar.schemaRefOrVal)(e,this.schema,o,this.$data),this.schemaType=n.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=n,this.$data)this.schemaCode=e.gen.const("vSchema",h$(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,Va.validSchemaType)(this.schema,n.schemaType,n.allowUndefined))throw new Error(`${o} value must be ${JSON.stringify(n.schemaType)}`);("code"in n?n.trackErrors:n.errors!==!1)&&(this.errsCount=e.gen.const("_errs",H.default.errors))}result(e,n,o){this.failResult((0,Z.not)(e),n,o)}failResult(e,n,o){this.gen.if(e),o?o():this.error(),n?(this.gen.else(),n(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,n){this.failResult((0,Z.not)(e),void 0,n)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:n}=this;this.fail((0,Z._)`${n} !== undefined && (${(0,Z.or)(this.invalid$data(),e)})`)}error(e,n,o){if(n){this.setParams(n),this._error(e,o),this.setParams({});return}this._error(e,o)}_error(e,n){(e?Fa.reportExtraError:Fa.reportError)(this,this.def.error,n)}$dataError(){(0,Fa.reportError)(this,this.def.$dataError||Fa.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,Fa.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,n){n?Object.assign(this.params,e):this.params=e}block$data(e,n,o=Z.nil){this.gen.block(()=>{this.check$data(e,o),n()})}check$data(e=Z.nil,n=Z.nil){if(!this.$data)return;let{gen:o,schemaCode:r,schemaType:i,def:a}=this;o.if((0,Z.or)((0,Z._)`${r} === undefined`,n)),e!==Z.nil&&o.assign(e,!0),(i.length||a.validateSchema)&&(o.elseIf(this.invalid$data()),this.$dataError(),e!==Z.nil&&o.assign(e,!1)),o.else()}invalid$data(){let{gen:e,schemaCode:n,schemaType:o,def:r,it:i}=this;return(0,Z.or)(a(),c());function a(){if(o.length){if(!(n instanceof Z.Name))throw new Error("ajv implementation error");let u=Array.isArray(o)?o:[o];return(0,Z._)`${(0,nd.checkDataTypes)(u,n,i.opts.strictNumbers,nd.DataType.Wrong)}`}return Z.nil}function c(){if(r.validateSchema){let u=e.scopeValue("validate$data",{ref:r.validateSchema});return(0,Z._)`!${u}(${n})`}return Z.nil}}subschema(e,n){let o=(0,Lg.getSubschema)(this.it,e);(0,Lg.extendSubschemaData)(o,this.it,e),(0,Lg.extendSubschemaMode)(o,e);let r={...this.it,...o,items:void 0,props:void 0};return _z(r,n),r}mergeEvaluated(e,n){let{it:o,gen:r}=this;o.opts.unevaluated&&(o.props!==!0&&e.props!==void 0&&(o.props=ar.mergeEvaluated.props(r,e.props,o.props,n)),o.items!==!0&&e.items!==void 0&&(o.items=ar.mergeEvaluated.items(r,e.items,o.items,n)))}mergeValidEvaluated(e,n){let{it:o,gen:r}=this;if(o.opts.unevaluated&&(o.props!==!0||o.items!==!0))return r.if(n,()=>this.mergeEvaluated(e,Z.Name)),!0}};jr.KeywordCxt=od;function f$(t,e,n,o){let r=new od(t,n,e);"code"in n?n.code(r,o):r.$data&&n.validate?(0,Va.funcKeywordCode)(r,n):"macro"in n?(0,Va.macroKeywordCode)(r,n):(n.compile||n.validate)&&(0,Va.funcKeywordCode)(r,n)}var Rz=/^\/(?:[^~]|~0|~1)*$/,Az=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function h$(t,{dataLevel:e,dataNames:n,dataPathArr:o}){let r,i;if(t==="")return H.default.rootData;if(t[0]==="/"){if(!Rz.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);r=t,i=H.default.rootData}else{let d=Az.exec(t);if(!d)throw new Error(`Invalid JSON-pointer: ${t}`);let l=+d[1];if(r=d[2],r==="#"){if(l>=e)throw new Error(u("property/index",l));return o[e-l]}if(l>e)throw new Error(u("data",l));if(i=n[e-l],!r)return i}let a=i,c=r.split("/");for(let d of c)d&&(i=(0,Z._)`${i}${(0,Z.getProperty)((0,ar.unescapeJsonPointer)(d))}`,a=(0,Z._)`${a} && ${i}`);return a;function u(d,l){return`Cannot access ${d} ${l} levels up, current level is ${e}`}}jr.getData=h$});var id=R(Vg=>{"use strict";Object.defineProperty(Vg,"__esModule",{value:!0});var Fg=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};Vg.default=Fg});var Ba=R(Hg=>{"use strict";Object.defineProperty(Hg,"__esModule",{value:!0});var qg=Za(),Bg=class extends Error{constructor(e,n,o,r){super(r||`can't resolve reference ${o} from id ${n}`),this.missingRef=(0,qg.resolveUrl)(e,n,o),this.missingSchema=(0,qg.normalizeId)((0,qg.getFullPath)(e,this.missingRef))}};Hg.default=Bg});var sd=R(St=>{"use strict";Object.defineProperty(St,"__esModule",{value:!0});St.resolveSchema=St.getCompilingSchema=St.resolveRef=St.compileSchema=St.SchemaEnv=void 0;var Nt=Y(),Cz=id(),ln=ir(),zt=Za(),g$=ie(),Nz=qa(),Ao=class{constructor(e){var n;this.refs={},this.dynamicAnchors={};let o;typeof e.schema=="object"&&(o=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(n=e.baseId)!==null&&n!==void 0?n:(0,zt.normalizeId)(o?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=o?.$async,this.refs={}}};St.SchemaEnv=Ao;function Gg(t){let e=_$.call(this,t);if(e)return e;let n=(0,zt.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:o,lines:r}=this.opts.code,{ownProperties:i}=this.opts,a=new Nt.CodeGen(this.scope,{es5:o,lines:r,ownProperties:i}),c;t.$async&&(c=a.scopeValue("Error",{ref:Cz.default,code:(0,Nt._)`require("ajv/dist/runtime/validation_error").default`}));let u=a.scopeName("validate");t.validateName=u;let d={gen:a,allErrors:this.opts.allErrors,data:ln.default.data,parentData:ln.default.parentData,parentDataProperty:ln.default.parentDataProperty,dataNames:[ln.default.data],dataPathArr:[Nt.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:a.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,Nt.stringify)(t.schema)}:{ref:t.schema}),validateName:u,ValidationError:c,schema:t.schema,schemaEnv:t,rootId:n,baseId:t.baseId||n,schemaPath:Nt.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Nt._)`""`,opts:this.opts,self:this},l;try{this._compilations.add(t),(0,Nz.validateFunctionCode)(d),a.optimize(this.opts.code.optimize);let p=a.toString();l=`${a.scopeRefs(ln.default.scope)}return ${p}`,this.opts.code.process&&(l=this.opts.code.process(l,t));let f=new Function(`${ln.default.self}`,`${ln.default.scope}`,l)(this,this.scope.get());if(this.scope.value(u,{ref:f}),f.errors=null,f.schema=t.schema,f.schemaEnv=t,t.$async&&(f.$async=!0),this.opts.code.source===!0&&(f.source={validateName:u,validateCode:p,scopeValues:a._values}),this.opts.unevaluated){let{props:g,items:v}=d;f.evaluated={props:g instanceof Nt.Name?void 0:g,items:v instanceof Nt.Name?void 0:v,dynamicProps:g instanceof Nt.Name,dynamicItems:v instanceof Nt.Name},f.source&&(f.source.evaluated=(0,Nt.stringify)(f.evaluated))}return t.validate=f,t}catch(p){throw delete t.validate,delete t.validateName,l&&this.logger.error("Error compiling schema, function code:",l),p}finally{this._compilations.delete(t)}}St.compileSchema=Gg;function zz(t,e,n){var o;n=(0,zt.resolveUrl)(this.opts.uriResolver,e,n);let r=t.refs[n];if(r)return r;let i=Uz.call(this,t,n);if(i===void 0){let a=(o=t.localRefs)===null||o===void 0?void 0:o[n],{schemaId:c}=this.opts;a&&(i=new Ao({schema:a,schemaId:c,root:t,baseId:e}))}if(i!==void 0)return t.refs[n]=Dz.call(this,i)}St.resolveRef=zz;function Dz(t){return(0,zt.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:Gg.call(this,t)}function _$(t){for(let e of this._compilations)if(jz(e,t))return e}St.getCompilingSchema=_$;function jz(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function Uz(t,e){let n;for(;typeof(n=this.refs[e])=="string";)e=n;return n||this.schemas[e]||ad.call(this,t,e)}function ad(t,e){let n=this.opts.uriResolver.parse(e),o=(0,zt._getFullPath)(this.opts.uriResolver,n),r=(0,zt.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&o===r)return Kg.call(this,n,t);let i=(0,zt.normalizeId)(o),a=this.refs[i]||this.schemas[i];if(typeof a=="string"){let c=ad.call(this,t,a);return typeof c?.schema!="object"?void 0:Kg.call(this,n,c)}if(typeof a?.schema=="object"){if(a.validate||Gg.call(this,a),i===(0,zt.normalizeId)(e)){let{schema:c}=a,{schemaId:u}=this.opts,d=c[u];return d&&(r=(0,zt.resolveUrl)(this.opts.uriResolver,r,d)),new Ao({schema:c,schemaId:u,root:t,baseId:r})}return Kg.call(this,n,a)}}St.resolveSchema=ad;var Lz=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Kg(t,{baseId:e,schema:n,root:o}){var r;if(((r=t.fragment)===null||r===void 0?void 0:r[0])!=="/")return;for(let c of t.fragment.slice(1).split("/")){if(typeof n=="boolean")return;let u=n[(0,g$.unescapeFragment)(c)];if(u===void 0)return;n=u;let d=typeof n=="object"&&n[this.opts.schemaId];!Lz.has(c)&&d&&(e=(0,zt.resolveUrl)(this.opts.uriResolver,e,d))}let i;if(typeof n!="boolean"&&n.$ref&&!(0,g$.schemaHasRulesButRef)(n,this.RULES)){let c=(0,zt.resolveUrl)(this.opts.uriResolver,e,n.$ref);i=ad.call(this,o,c)}let{schemaId:a}=this.opts;if(i=i||new Ao({schema:n,schemaId:a,root:o,baseId:e}),i.schema!==i.root.schema)return i}});var y$=R((h9,Mz)=>{Mz.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 Yg=R((g9,$$)=>{"use strict";var Zz=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),b$=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),Wg=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),k$=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),Fz=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function Jg(t){let e="",n=0,o=0;for(o=0;o<t.length;o++)if(n=t[o].charCodeAt(0),n!==48){if(!(n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102))return"";e+=t[o];break}for(o+=1;o<t.length;o++){if(n=t[o].charCodeAt(0),!(n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102))return"";e+=t[o]}return e}var Vz=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function v$(t){return t.length=0,!0}function qz(t,e,n){if(t.length){let o=Jg(t);if(o!=="")e.push(o);else return n.error=!0,!1;t.length=0}return!0}function Bz(t){let e=0,n={error:!1,address:"",zone:""},o=[],r=[],i=!1,a=!1,c=qz;for(let u=0;u<t.length;u++){let d=t[u];if(!(d==="["||d==="]"))if(d===":"){if(i===!0&&(a=!0),!c(r,o,n))break;if(++e>7){n.error=!0;break}u>0&&t[u-1]===":"&&(i=!0),o.push(":");continue}else if(d==="%"){if(!c(r,o,n))break;c=v$}else{r.push(d);continue}}return r.length&&(c===v$?n.zone=r.join(""):a?o.push(r.join("")):o.push(Jg(r))),n.address=o.join(""),n}function x$(t){if(Hz(t,":")<2)return{host:t,isIPV6:!1};let e=Bz(t);if(e.error)return{host:t,isIPV6:!1};{let n=e.address,o=e.address;return e.zone&&(n+="%"+e.zone,o+="%25"+e.zone),{host:n,isIPV6:!0,escapedHost:o}}}function Hz(t,e){let n=0;for(let o=0;o<t.length;o++)t[o]===e&&n++;return n}function Kz(t){let e=t,n=[],o=-1,r=0;for(;r=e.length;){if(r===1){if(e===".")break;if(e==="/"){n.push("/");break}else{n.push(e);break}}else if(r===2){if(e[0]==="."){if(e[1]===".")break;if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&(e[1]==="."||e[1]==="/")){n.push("/");break}}else if(r===3&&e==="/.."){n.length!==0&&n.pop(),n.push("/");break}if(e[0]==="."){if(e[1]==="."){if(e[2]==="/"){e=e.slice(3);continue}}else if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&e[1]==="."){if(e[2]==="/"){e=e.slice(2);continue}else if(e[2]==="."&&e[3]==="/"){e=e.slice(3),n.length!==0&&n.pop();continue}}if((o=e.indexOf("/",1))===-1){n.push(e);break}else n.push(e.slice(0,o)),e=e.slice(o)}return n.join("")}var Gz={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},Wz=/[@/?#:]/g,Jz=/[@/?#]/g;function S$(t,e){let n=e?Jz:Wz;return n.lastIndex=0,t.replace(n,o=>Gz[o])}function Yz(t,e=!1){if(t.indexOf("%")===-1)return t;let n="";for(let o=0;o<t.length;o++){if(t[o]==="%"&&o+2<t.length){let r=t.slice(o+1,o+3);if(Wg(r)){let i=r.toUpperCase(),a=String.fromCharCode(parseInt(i,16));e&&k$(a)?n+=a:n+="%"+i,o+=2;continue}}n+=t[o]}return n}function Xz(t){let e="";for(let n=0;n<t.length;n++){if(t[n]==="%"&&n+2<t.length){let o=t.slice(n+1,n+3);if(Wg(o)){let r=o.toUpperCase(),i=String.fromCharCode(parseInt(r,16));i!=="."&&k$(i)?e+=i:e+="%"+r,n+=2;continue}}Fz(t[n])?e+=t[n]:e+=escape(t[n])}return e}function Qz(t){let e="";for(let n=0;n<t.length;n++){if(t[n]==="%"&&n+2<t.length){let o=t.slice(n+1,n+3);if(Wg(o)){e+="%"+o.toUpperCase(),n+=2;continue}}e+=escape(t[n])}return e}function eD(t){let e=[];if(t.userinfo!==void 0&&(e.push(t.userinfo),e.push("@")),t.host!==void 0){let n=unescape(t.host);if(!b$(n)){let o=x$(n);o.isIPV6===!0?n=`[${o.escapedHost}]`:n=S$(n,!1)}e.push(n)}return(typeof t.port=="number"||typeof t.port=="string")&&(e.push(":"),e.push(String(t.port))),e.length?e.join(""):void 0}$$.exports={nonSimpleDomain:Vz,recomposeAuthority:eD,reescapeHostDelimiters:S$,normalizePercentEncoding:Yz,normalizePathEncoding:Xz,escapePreservingEscapes:Qz,removeDotSegments:Kz,isIPv4:b$,isUUID:Zz,normalizeIPv6:x$,stringArrayToHexStripped:Jg}});var P$=R((_9,T$)=>{"use strict";var{isUUID:tD}=Yg(),rD=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,nD=["http","https","ws","wss","urn","urn:uuid"];function oD(t){return nD.indexOf(t)!==-1}function Xg(t){return t.secure===!0?!0:t.secure===!1?!1:t.scheme?t.scheme.length===3&&(t.scheme[0]==="w"||t.scheme[0]==="W")&&(t.scheme[1]==="s"||t.scheme[1]==="S")&&(t.scheme[2]==="s"||t.scheme[2]==="S"):!1}function I$(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}function w$(t){let e=String(t.scheme).toLowerCase()==="https";return(t.port===(e?443:80)||t.port==="")&&(t.port=void 0),t.path||(t.path="/"),t}function iD(t){return t.secure=Xg(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}function aD(t){if((t.port===(Xg(t)?443:80)||t.port==="")&&(t.port=void 0),typeof t.secure=="boolean"&&(t.scheme=t.secure?"wss":"ws",t.secure=void 0),t.resourceName){let[e,n]=t.resourceName.split("?");t.path=e&&e!=="/"?e:void 0,t.query=n,t.resourceName=void 0}return t.fragment=void 0,t}function sD(t,e){if(!t.path)return t.error="URN can not be parsed",t;let n=t.path.match(rD);if(n){let o=e.scheme||t.scheme||"urn";t.nid=n[1].toLowerCase(),t.nss=n[2];let r=`${o}:${e.nid||t.nid}`,i=Qg(r);t.path=void 0,i&&(t=i.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}function cD(t,e){if(t.nid===void 0)throw new Error("URN without nid cannot be serialized");let n=e.scheme||t.scheme||"urn",o=t.nid.toLowerCase(),r=`${n}:${e.nid||o}`,i=Qg(r);i&&(t=i.serialize(t,e));let a=t,c=t.nss;return a.path=`${o||e.nid}:${c}`,e.skipEscape=!0,a}function uD(t,e){let n=t;return n.uuid=n.nss,n.nss=void 0,!e.tolerant&&(!n.uuid||!tD(n.uuid))&&(n.error=n.error||"UUID is not valid."),n}function lD(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}var E$={scheme:"http",domainHost:!0,parse:I$,serialize:w$},dD={scheme:"https",domainHost:E$.domainHost,parse:I$,serialize:w$},cd={scheme:"ws",domainHost:!0,parse:iD,serialize:aD},pD={scheme:"wss",domainHost:cd.domainHost,parse:cd.parse,serialize:cd.serialize},mD={scheme:"urn",parse:sD,serialize:cD,skipNormalize:!0},fD={scheme:"urn:uuid",parse:uD,serialize:lD,skipNormalize:!0},ud={http:E$,https:dD,ws:cd,wss:pD,urn:mD,"urn:uuid":fD};Object.setPrototypeOf(ud,null);function Qg(t){return t&&(ud[t]||ud[t.toLowerCase()])||void 0}T$.exports={wsIsSecure:Xg,SCHEMES:ud,isValidSchemeName:oD,getSchemeHandler:Qg}});var z$=R((y9,ld)=>{"use strict";var{normalizeIPv6:hD,removeDotSegments:Ha,recomposeAuthority:gD,normalizePercentEncoding:_D,normalizePathEncoding:yD,escapePreservingEscapes:vD,reescapeHostDelimiters:bD,isIPv4:kD,nonSimpleDomain:xD}=Yg(),{SCHEMES:SD,getSchemeHandler:R$}=P$();function $D(t,e){return typeof t=="string"?t=PD(t,e):typeof t=="object"&&(t=Co(dn(t,e),e)),t}function ID(t,e,n){let o=n?Object.assign({scheme:"null"},n):{scheme:"null"},r=A$(Co(t,o),Co(e,o),o,!0);return o.skipEscape=!0,dn(r,o)}function A$(t,e,n,o){let r={};return o||(t=Co(dn(t,n),n),e=Co(dn(e,n),n)),n=n||{},!n.tolerant&&e.scheme?(r.scheme=e.scheme,r.userinfo=e.userinfo,r.host=e.host,r.port=e.port,r.path=Ha(e.path||""),r.query=e.query):(e.userinfo!==void 0||e.host!==void 0||e.port!==void 0?(r.userinfo=e.userinfo,r.host=e.host,r.port=e.port,r.path=Ha(e.path||""),r.query=e.query):(e.path?(e.path[0]==="/"?r.path=Ha(e.path):((t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)&&!t.path?r.path="/"+e.path:t.path?r.path=t.path.slice(0,t.path.lastIndexOf("/")+1)+e.path:r.path=e.path,r.path=Ha(r.path)),r.query=e.query):(r.path=t.path,e.query!==void 0?r.query=e.query:r.query=t.query),r.userinfo=t.userinfo,r.host=t.host,r.port=t.port),r.scheme=t.scheme),r.fragment=e.fragment,r}function wD(t,e,n){let o=O$(t,n),r=O$(e,n);return o!==void 0&&r!==void 0&&o.toLowerCase()===r.toLowerCase()}function dn(t,e){let n={host:t.host,scheme:t.scheme,userinfo:t.userinfo,port:t.port,path:t.path,query:t.query,nid:t.nid,nss:t.nss,uuid:t.uuid,fragment:t.fragment,reference:t.reference,resourceName:t.resourceName,secure:t.secure,error:""},o=Object.assign({},e),r=[],i=R$(o.scheme||n.scheme);i&&i.serialize&&i.serialize(n,o),n.path!==void 0&&(o.skipEscape?n.path=_D(n.path):(n.path=vD(n.path),n.scheme!==void 0&&(n.path=n.path.split("%3A").join(":")))),o.reference!=="suffix"&&n.scheme&&r.push(n.scheme,":");let a=gD(n);if(a!==void 0&&(o.reference!=="suffix"&&r.push("//"),r.push(a),n.path&&n.path[0]!=="/"&&r.push("/")),n.path!==void 0){let c=n.path;!o.absolutePath&&(!i||!i.absolutePath)&&(c=Ha(c)),a===void 0&&c[0]==="/"&&c[1]==="/"&&(c="/%2F"+c.slice(2)),r.push(c)}return n.query!==void 0&&r.push("?",n.query),n.fragment!==void 0&&r.push("#",n.fragment),r.join("")}var ED=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function TD(t,e){if(e[2]!==void 0&&t.path&&t.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof t.port=="number"&&(t.port<0||t.port>65535))return"URI port is malformed."}function C$(t,e){let n=Object.assign({},e),o={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},r=!1,i=!1;n.reference==="suffix"&&(n.scheme?t=n.scheme+":"+t:t="//"+t);let a=t.match(ED);if(a){o.scheme=a[1],o.userinfo=a[3],o.host=a[4],o.port=parseInt(a[5],10),o.path=a[6]||"",o.query=a[7],o.fragment=a[8],isNaN(o.port)&&(o.port=a[5]);let c=TD(o,a);if(c!==void 0&&(o.error=o.error||c,r=!0),o.host)if(kD(o.host)===!1){let l=hD(o.host);o.host=l.host.toLowerCase(),i=l.isIPV6}else i=!0;o.scheme===void 0&&o.userinfo===void 0&&o.host===void 0&&o.port===void 0&&o.query===void 0&&!o.path?o.reference="same-document":o.scheme===void 0?o.reference="relative":o.fragment===void 0?o.reference="absolute":o.reference="uri",n.reference&&n.reference!=="suffix"&&n.reference!==o.reference&&(o.error=o.error||"URI is not a "+n.reference+" reference.");let u=R$(n.scheme||o.scheme);if(!n.unicodeSupport&&(!u||!u.unicodeSupport)&&o.host&&(n.domainHost||u&&u.domainHost)&&i===!1&&xD(o.host))try{o.host=URL.domainToASCII(o.host.toLowerCase())}catch(d){o.error=o.error||"Host's domain name can not be converted to ASCII: "+d}if((!u||u&&!u.skipNormalize)&&(t.indexOf("%")!==-1&&(o.scheme!==void 0&&(o.scheme=unescape(o.scheme)),o.host!==void 0&&(o.host=bD(unescape(o.host),i))),o.path&&(o.path=yD(o.path)),o.fragment))try{o.fragment=encodeURI(decodeURIComponent(o.fragment))}catch{o.error=o.error||"URI malformed"}u&&u.parse&&u.parse(o,n)}else o.error=o.error||"URI can not be parsed.";return{parsed:o,malformedAuthorityOrPort:r}}function Co(t,e){return C$(t,e).parsed}function PD(t,e){return N$(t,e).normalized}function N$(t,e){let{parsed:n,malformedAuthorityOrPort:o}=C$(t,e);return{normalized:o?t:dn(n,e),malformedAuthorityOrPort:o}}function O$(t,e){if(typeof t=="string"){let{normalized:n,malformedAuthorityOrPort:o}=N$(t,e);return o?void 0:n}if(typeof t=="object")return dn(t,e)}var e_={SCHEMES:SD,normalize:$D,resolve:ID,resolveComponent:A$,equal:wD,serialize:dn,parse:Co};ld.exports=e_;ld.exports.default=e_;ld.exports.fastUri=e_});var j$=R(t_=>{"use strict";Object.defineProperty(t_,"__esModule",{value:!0});var D$=z$();D$.code='require("ajv/dist/runtime/uri").default';t_.default=D$});var B$=R(Ue=>{"use strict";Object.defineProperty(Ue,"__esModule",{value:!0});Ue.CodeGen=Ue.Name=Ue.nil=Ue.stringify=Ue.str=Ue._=Ue.KeywordCxt=void 0;var OD=qa();Object.defineProperty(Ue,"KeywordCxt",{enumerable:!0,get:function(){return OD.KeywordCxt}});var No=Y();Object.defineProperty(Ue,"_",{enumerable:!0,get:function(){return No._}});Object.defineProperty(Ue,"str",{enumerable:!0,get:function(){return No.str}});Object.defineProperty(Ue,"stringify",{enumerable:!0,get:function(){return No.stringify}});Object.defineProperty(Ue,"nil",{enumerable:!0,get:function(){return No.nil}});Object.defineProperty(Ue,"Name",{enumerable:!0,get:function(){return No.Name}});Object.defineProperty(Ue,"CodeGen",{enumerable:!0,get:function(){return No.CodeGen}});var RD=id(),F$=Ba(),AD=Pg(),Ka=sd(),CD=Y(),Ga=Za(),dd=Ma(),n_=ie(),U$=y$(),ND=j$(),V$=(t,e)=>new RegExp(t,e);V$.code="new RegExp";var zD=["removeAdditional","useDefaults","coerceTypes"],DD=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),jD={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."},UD={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},L$=200;function LD(t){var e,n,o,r,i,a,c,u,d,l,p,m,f,g,v,b,E,N,z,j,D,lt,ht,ci,sp;let ui=t.strict,cp=(e=t.code)===null||e===void 0?void 0:e.optimize,ov=cp===!0||cp===void 0?1:cp||0,iv=(o=(n=t.code)===null||n===void 0?void 0:n.regExp)!==null&&o!==void 0?o:V$,D0=(r=t.uriResolver)!==null&&r!==void 0?r:ND.default;return{strictSchema:(a=(i=t.strictSchema)!==null&&i!==void 0?i:ui)!==null&&a!==void 0?a:!0,strictNumbers:(u=(c=t.strictNumbers)!==null&&c!==void 0?c:ui)!==null&&u!==void 0?u:!0,strictTypes:(l=(d=t.strictTypes)!==null&&d!==void 0?d:ui)!==null&&l!==void 0?l:"log",strictTuples:(m=(p=t.strictTuples)!==null&&p!==void 0?p:ui)!==null&&m!==void 0?m:"log",strictRequired:(g=(f=t.strictRequired)!==null&&f!==void 0?f:ui)!==null&&g!==void 0?g:!1,code:t.code?{...t.code,optimize:ov,regExp:iv}:{optimize:ov,regExp:iv},loopRequired:(v=t.loopRequired)!==null&&v!==void 0?v:L$,loopEnum:(b=t.loopEnum)!==null&&b!==void 0?b:L$,meta:(E=t.meta)!==null&&E!==void 0?E:!0,messages:(N=t.messages)!==null&&N!==void 0?N:!0,inlineRefs:(z=t.inlineRefs)!==null&&z!==void 0?z:!0,schemaId:(j=t.schemaId)!==null&&j!==void 0?j:"$id",addUsedSchema:(D=t.addUsedSchema)!==null&&D!==void 0?D:!0,validateSchema:(lt=t.validateSchema)!==null&<!==void 0?lt:!0,validateFormats:(ht=t.validateFormats)!==null&&ht!==void 0?ht:!0,unicodeRegExp:(ci=t.unicodeRegExp)!==null&&ci!==void 0?ci:!0,int32range:(sp=t.int32range)!==null&&sp!==void 0?sp:!0,uriResolver:D0}}var Wa=class{constructor(e={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...LD(e)};let{es5:n,lines:o}=this.opts.code;this.scope=new CD.ValueScope({scope:{},prefixes:DD,es5:n,lines:o}),this.logger=BD(e.logger);let r=e.validateFormats;e.validateFormats=!1,this.RULES=(0,AD.getRules)(),M$.call(this,jD,e,"NOT SUPPORTED"),M$.call(this,UD,e,"DEPRECATED","warn"),this._metaOpts=VD.call(this),e.formats&&ZD.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&FD.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),MD.call(this),e.validateFormats=r}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:n,schemaId:o}=this.opts,r=U$;o==="id"&&(r={...U$},r.id=r.$id,delete r.$id),n&&e&&this.addMetaSchema(r,r[o],!1)}defaultMeta(){let{meta:e,schemaId:n}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[n]||e:void 0}validate(e,n){let o;if(typeof e=="string"){if(o=this.getSchema(e),!o)throw new Error(`no schema with key or ref "${e}"`)}else o=this.compile(e);let r=o(n);return"$async"in o||(this.errors=o.errors),r}compile(e,n){let o=this._addSchema(e,n);return o.validate||this._compileSchemaEnv(o)}compileAsync(e,n){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:o}=this.opts;return r.call(this,e,n);async function r(l,p){await i.call(this,l.$schema);let m=this._addSchema(l,p);return m.validate||a.call(this,m)}async function i(l){l&&!this.getSchema(l)&&await r.call(this,{$ref:l},!0)}async function a(l){try{return this._compileSchemaEnv(l)}catch(p){if(!(p instanceof F$.default))throw p;return c.call(this,p),await u.call(this,p.missingSchema),a.call(this,l)}}function c({missingSchema:l,missingRef:p}){if(this.refs[l])throw new Error(`AnySchema ${l} is loaded but ${p} cannot be resolved`)}async function u(l){let p=await d.call(this,l);this.refs[l]||await i.call(this,p.$schema),this.refs[l]||this.addSchema(p,l,n)}async function d(l){let p=this._loading[l];if(p)return p;try{return await(this._loading[l]=o(l))}finally{delete this._loading[l]}}}addSchema(e,n,o,r=this.opts.validateSchema){if(Array.isArray(e)){for(let a of e)this.addSchema(a,void 0,o,r);return this}let i;if(typeof e=="object"){let{schemaId:a}=this.opts;if(i=e[a],i!==void 0&&typeof i!="string")throw new Error(`schema ${a} must be string`)}return n=(0,Ga.normalizeId)(n||i),this._checkUnique(n),this.schemas[n]=this._addSchema(e,o,n,r,!0),this}addMetaSchema(e,n,o=this.opts.validateSchema){return this.addSchema(e,n,!0,o),this}validateSchema(e,n){if(typeof e=="boolean")return!0;let o;if(o=e.$schema,o!==void 0&&typeof o!="string")throw new Error("$schema must be a string");if(o=o||this.opts.defaultMeta||this.defaultMeta(),!o)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let r=this.validate(o,e);if(!r&&n){let i="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(i);else throw new Error(i)}return r}getSchema(e){let n;for(;typeof(n=Z$.call(this,e))=="string";)e=n;if(n===void 0){let{schemaId:o}=this.opts,r=new Ka.SchemaEnv({schema:{},schemaId:o});if(n=Ka.resolveSchema.call(this,r,e),!n)return;this.refs[e]=n}return n.validate||this._compileSchemaEnv(n)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let n=Z$.call(this,e);return typeof n=="object"&&this._cache.delete(n.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{let n=e;this._cache.delete(n);let o=e[this.opts.schemaId];return o&&(o=(0,Ga.normalizeId)(o),delete this.schemas[o],delete this.refs[o]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let n of e)this.addKeyword(n);return this}addKeyword(e,n){let o;if(typeof e=="string")o=e,typeof n=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),n.keyword=o);else if(typeof e=="object"&&n===void 0){if(n=e,o=n.keyword,Array.isArray(o)&&!o.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(KD.call(this,o,n),!n)return(0,n_.eachItem)(o,i=>r_.call(this,i)),this;WD.call(this,n);let r={...n,type:(0,dd.getJSONTypes)(n.type),schemaType:(0,dd.getJSONTypes)(n.schemaType)};return(0,n_.eachItem)(o,r.type.length===0?i=>r_.call(this,i,r):i=>r.type.forEach(a=>r_.call(this,i,r,a))),this}getKeyword(e){let n=this.RULES.all[e];return typeof n=="object"?n.definition:!!n}removeKeyword(e){let{RULES:n}=this;delete n.keywords[e],delete n.all[e];for(let o of n.rules){let r=o.rules.findIndex(i=>i.keyword===e);r>=0&&o.rules.splice(r,1)}return this}addFormat(e,n){return typeof n=="string"&&(n=new RegExp(n)),this.formats[e]=n,this}errorsText(e=this.errors,{separator:n=", ",dataVar:o="data"}={}){return!e||e.length===0?"No errors":e.map(r=>`${o}${r.instancePath} ${r.message}`).reduce((r,i)=>r+n+i)}$dataMetaSchema(e,n){let o=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let r of n){let i=r.split("/").slice(1),a=e;for(let c of i)a=a[c];for(let c in o){let u=o[c];if(typeof u!="object")continue;let{$data:d}=u.definition,l=a[c];d&&l&&(a[c]=q$(l))}}return e}_removeAllSchemas(e,n){for(let o in e){let r=e[o];(!n||n.test(o))&&(typeof r=="string"?delete e[o]:r&&!r.meta&&(this._cache.delete(r.schema),delete e[o]))}}_addSchema(e,n,o,r=this.opts.validateSchema,i=this.opts.addUsedSchema){let a,{schemaId:c}=this.opts;if(typeof e=="object")a=e[c];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof e!="boolean")throw new Error("schema must be object or boolean")}let u=this._cache.get(e);if(u!==void 0)return u;o=(0,Ga.normalizeId)(a||o);let d=Ga.getSchemaRefs.call(this,e,o);return u=new Ka.SchemaEnv({schema:e,schemaId:c,meta:n,baseId:o,localRefs:d}),this._cache.set(u.schema,u),i&&!o.startsWith("#")&&(o&&this._checkUnique(o),this.refs[o]=u),r&&this.validateSchema(e,!0),u}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):Ka.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let n=this.opts;this.opts=this._metaOpts;try{Ka.compileSchema.call(this,e)}finally{this.opts=n}}};Wa.ValidationError=RD.default;Wa.MissingRefError=F$.default;Ue.default=Wa;function M$(t,e,n,o="error"){for(let r in t){let i=r;i in e&&this.logger[o](`${n}: option ${r}. ${t[i]}`)}}function Z$(t){return t=(0,Ga.normalizeId)(t),this.schemas[t]||this.refs[t]}function MD(){let t=this.opts.schemas;if(t)if(Array.isArray(t))this.addSchema(t);else for(let e in t)this.addSchema(t[e],e)}function ZD(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}function FD(t){if(Array.isArray(t)){this.addVocabulary(t);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let e in t){let n=t[e];n.keyword||(n.keyword=e),this.addKeyword(n)}}function VD(){let t={...this.opts};for(let e of zD)delete t[e];return t}var qD={log(){},warn(){},error(){}};function BD(t){if(t===!1)return qD;if(t===void 0)return console;if(t.log&&t.warn&&t.error)return t;throw new Error("logger must implement log, warn and error methods")}var HD=/^[a-z_$][a-z0-9_$:-]*$/i;function KD(t,e){let{RULES:n}=this;if((0,n_.eachItem)(t,o=>{if(n.keywords[o])throw new Error(`Keyword ${o} is already defined`);if(!HD.test(o))throw new Error(`Keyword ${o} has invalid name`)}),!!e&&e.$data&&!("code"in e||"validate"in e))throw new Error('$data keyword must have "code" or "validate" function')}function r_(t,e,n){var o;let r=e?.post;if(n&&r)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:i}=this,a=r?i.post:i.rules.find(({type:u})=>u===n);if(a||(a={type:n,rules:[]},i.rules.push(a)),i.keywords[t]=!0,!e)return;let c={keyword:t,definition:{...e,type:(0,dd.getJSONTypes)(e.type),schemaType:(0,dd.getJSONTypes)(e.schemaType)}};e.before?GD.call(this,a,c,e.before):a.rules.push(c),i.all[t]=c,(o=e.implements)===null||o===void 0||o.forEach(u=>this.addKeyword(u))}function GD(t,e,n){let o=t.rules.findIndex(r=>r.keyword===n);o>=0?t.rules.splice(o,0,e):(t.rules.push(e),this.logger.warn(`rule ${n} is not defined`))}function WD(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=q$(e)),t.validateSchema=this.compile(e,!0))}var JD={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function q$(t){return{anyOf:[t,JD]}}});var H$=R(o_=>{"use strict";Object.defineProperty(o_,"__esModule",{value:!0});var YD={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};o_.default=YD});var J$=R(pn=>{"use strict";Object.defineProperty(pn,"__esModule",{value:!0});pn.callRef=pn.getValidate=void 0;var XD=Ba(),K$=xt(),ut=Y(),zo=ir(),G$=sd(),pd=ie(),QD={keyword:"$ref",schemaType:"string",code(t){let{gen:e,schema:n,it:o}=t,{baseId:r,schemaEnv:i,validateName:a,opts:c,self:u}=o,{root:d}=i;if((n==="#"||n==="#/")&&r===d.baseId)return p();let l=G$.resolveRef.call(u,d,r,n);if(l===void 0)throw new XD.default(o.opts.uriResolver,r,n);if(l instanceof G$.SchemaEnv)return m(l);return f(l);function p(){if(i===d)return md(t,a,i,i.$async);let g=e.scopeValue("root",{ref:d});return md(t,(0,ut._)`${g}.validate`,d,d.$async)}function m(g){let v=W$(t,g);md(t,v,g,g.$async)}function f(g){let v=e.scopeValue("schema",c.code.source===!0?{ref:g,code:(0,ut.stringify)(g)}:{ref:g}),b=e.name("valid"),E=t.subschema({schema:g,dataTypes:[],schemaPath:ut.nil,topSchemaRef:v,errSchemaPath:n},b);t.mergeEvaluated(E),t.ok(b)}}};function W$(t,e){let{gen:n}=t;return e.validate?n.scopeValue("validate",{ref:e.validate}):(0,ut._)`${n.scopeValue("wrapper",{ref:e})}.validate`}pn.getValidate=W$;function md(t,e,n,o){let{gen:r,it:i}=t,{allErrors:a,schemaEnv:c,opts:u}=i,d=u.passContext?zo.default.this:ut.nil;o?l():p();function l(){if(!c.$async)throw new Error("async schema referenced by sync schema");let g=r.let("valid");r.try(()=>{r.code((0,ut._)`await ${(0,K$.callValidateCode)(t,e,d)}`),f(e),a||r.assign(g,!0)},v=>{r.if((0,ut._)`!(${v} instanceof ${i.ValidationError})`,()=>r.throw(v)),m(v),a||r.assign(g,!1)}),t.ok(g)}function p(){t.result((0,K$.callValidateCode)(t,e,d),()=>f(e),()=>m(e))}function m(g){let v=(0,ut._)`${g}.errors`;r.assign(zo.default.vErrors,(0,ut._)`${zo.default.vErrors} === null ? ${v} : ${zo.default.vErrors}.concat(${v})`),r.assign(zo.default.errors,(0,ut._)`${zo.default.vErrors}.length`)}function f(g){var v;if(!i.opts.unevaluated)return;let b=(v=n?.validate)===null||v===void 0?void 0:v.evaluated;if(i.props!==!0)if(b&&!b.dynamicProps)b.props!==void 0&&(i.props=pd.mergeEvaluated.props(r,b.props,i.props));else{let E=r.var("props",(0,ut._)`${g}.evaluated.props`);i.props=pd.mergeEvaluated.props(r,E,i.props,ut.Name)}if(i.items!==!0)if(b&&!b.dynamicItems)b.items!==void 0&&(i.items=pd.mergeEvaluated.items(r,b.items,i.items));else{let E=r.var("items",(0,ut._)`${g}.evaluated.items`);i.items=pd.mergeEvaluated.items(r,E,i.items,ut.Name)}}}pn.callRef=md;pn.default=QD});var Y$=R(i_=>{"use strict";Object.defineProperty(i_,"__esModule",{value:!0});var ej=H$(),tj=J$(),rj=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",ej.default,tj.default];i_.default=rj});var X$=R(a_=>{"use strict";Object.defineProperty(a_,"__esModule",{value:!0});var fd=Y(),Ur=fd.operators,hd={maximum:{okStr:"<=",ok:Ur.LTE,fail:Ur.GT},minimum:{okStr:">=",ok:Ur.GTE,fail:Ur.LT},exclusiveMaximum:{okStr:"<",ok:Ur.LT,fail:Ur.GTE},exclusiveMinimum:{okStr:">",ok:Ur.GT,fail:Ur.LTE}},nj={message:({keyword:t,schemaCode:e})=>(0,fd.str)`must be ${hd[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,fd._)`{comparison: ${hd[t].okStr}, limit: ${e}}`},oj={keyword:Object.keys(hd),type:"number",schemaType:"number",$data:!0,error:nj,code(t){let{keyword:e,data:n,schemaCode:o}=t;t.fail$data((0,fd._)`${n} ${hd[e].fail} ${o} || isNaN(${n})`)}};a_.default=oj});var Q$=R(s_=>{"use strict";Object.defineProperty(s_,"__esModule",{value:!0});var Ja=Y(),ij={message:({schemaCode:t})=>(0,Ja.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,Ja._)`{multipleOf: ${t}}`},aj={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:ij,code(t){let{gen:e,data:n,schemaCode:o,it:r}=t,i=r.opts.multipleOfPrecision,a=e.let("res"),c=i?(0,Ja._)`Math.abs(Math.round(${a}) - ${a}) > 1e-${i}`:(0,Ja._)`${a} !== parseInt(${a})`;t.fail$data((0,Ja._)`(${o} === 0 || (${a} = ${n}/${o}, ${c}))`)}};s_.default=aj});var tI=R(c_=>{"use strict";Object.defineProperty(c_,"__esModule",{value:!0});function eI(t){let e=t.length,n=0,o=0,r;for(;o<e;)n++,r=t.charCodeAt(o++),r>=55296&&r<=56319&&o<e&&(r=t.charCodeAt(o),(r&64512)===56320&&o++);return n}c_.default=eI;eI.code='require("ajv/dist/runtime/ucs2length").default'});var rI=R(u_=>{"use strict";Object.defineProperty(u_,"__esModule",{value:!0});var mn=Y(),sj=ie(),cj=tI(),uj={message({keyword:t,schemaCode:e}){let n=t==="maxLength"?"more":"fewer";return(0,mn.str)`must NOT have ${n} than ${e} characters`},params:({schemaCode:t})=>(0,mn._)`{limit: ${t}}`},lj={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:uj,code(t){let{keyword:e,data:n,schemaCode:o,it:r}=t,i=e==="maxLength"?mn.operators.GT:mn.operators.LT,a=r.opts.unicode===!1?(0,mn._)`${n}.length`:(0,mn._)`${(0,sj.useFunc)(t.gen,cj.default)}(${n})`;t.fail$data((0,mn._)`${a} ${i} ${o}`)}};u_.default=lj});var nI=R(l_=>{"use strict";Object.defineProperty(l_,"__esModule",{value:!0});var dj=xt(),pj=ie(),Do=Y(),mj={message:({schemaCode:t})=>(0,Do.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,Do._)`{pattern: ${t}}`},fj={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:mj,code(t){let{gen:e,data:n,$data:o,schema:r,schemaCode:i,it:a}=t,c=a.opts.unicodeRegExp?"u":"";if(o){let{regExp:u}=a.opts.code,d=u.code==="new RegExp"?(0,Do._)`new RegExp`:(0,pj.useFunc)(e,u),l=e.let("valid");e.try(()=>e.assign(l,(0,Do._)`${d}(${i}, ${c}).test(${n})`),()=>e.assign(l,!1)),t.fail$data((0,Do._)`!${l}`)}else{let u=(0,dj.usePattern)(t,r);t.fail$data((0,Do._)`!${u}.test(${n})`)}}};l_.default=fj});var oI=R(d_=>{"use strict";Object.defineProperty(d_,"__esModule",{value:!0});var Ya=Y(),hj={message({keyword:t,schemaCode:e}){let n=t==="maxProperties"?"more":"fewer";return(0,Ya.str)`must NOT have ${n} than ${e} properties`},params:({schemaCode:t})=>(0,Ya._)`{limit: ${t}}`},gj={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:hj,code(t){let{keyword:e,data:n,schemaCode:o}=t,r=e==="maxProperties"?Ya.operators.GT:Ya.operators.LT;t.fail$data((0,Ya._)`Object.keys(${n}).length ${r} ${o}`)}};d_.default=gj});var iI=R(p_=>{"use strict";Object.defineProperty(p_,"__esModule",{value:!0});var Xa=xt(),Qa=Y(),_j=ie(),yj={message:({params:{missingProperty:t}})=>(0,Qa.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,Qa._)`{missingProperty: ${t}}`},vj={keyword:"required",type:"object",schemaType:"array",$data:!0,error:yj,code(t){let{gen:e,schema:n,schemaCode:o,data:r,$data:i,it:a}=t,{opts:c}=a;if(!i&&n.length===0)return;let u=n.length>=c.loopRequired;if(a.allErrors?d():l(),c.strictRequired){let f=t.parentSchema.properties,{definedProperties:g}=t.it;for(let v of n)if(f?.[v]===void 0&&!g.has(v)){let b=a.schemaEnv.baseId+a.errSchemaPath,E=`required property "${v}" is not defined at "${b}" (strictRequired)`;(0,_j.checkStrictMode)(a,E,a.opts.strictRequired)}}function d(){if(u||i)t.block$data(Qa.nil,p);else for(let f of n)(0,Xa.checkReportMissingProp)(t,f)}function l(){let f=e.let("missing");if(u||i){let g=e.let("valid",!0);t.block$data(g,()=>m(f,g)),t.ok(g)}else e.if((0,Xa.checkMissingProp)(t,n,f)),(0,Xa.reportMissingProp)(t,f),e.else()}function p(){e.forOf("prop",o,f=>{t.setParams({missingProperty:f}),e.if((0,Xa.noPropertyInData)(e,r,f,c.ownProperties),()=>t.error())})}function m(f,g){t.setParams({missingProperty:f}),e.forOf(f,o,()=>{e.assign(g,(0,Xa.propertyInData)(e,r,f,c.ownProperties)),e.if((0,Qa.not)(g),()=>{t.error(),e.break()})},Qa.nil)}}};p_.default=vj});var aI=R(m_=>{"use strict";Object.defineProperty(m_,"__esModule",{value:!0});var es=Y(),bj={message({keyword:t,schemaCode:e}){let n=t==="maxItems"?"more":"fewer";return(0,es.str)`must NOT have ${n} than ${e} items`},params:({schemaCode:t})=>(0,es._)`{limit: ${t}}`},kj={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:bj,code(t){let{keyword:e,data:n,schemaCode:o}=t,r=e==="maxItems"?es.operators.GT:es.operators.LT;t.fail$data((0,es._)`${n}.length ${r} ${o}`)}};m_.default=kj});var gd=R(f_=>{"use strict";Object.defineProperty(f_,"__esModule",{value:!0});var sI=jg();sI.code='require("ajv/dist/runtime/equal").default';f_.default=sI});var cI=R(g_=>{"use strict";Object.defineProperty(g_,"__esModule",{value:!0});var h_=Ma(),Le=Y(),xj=ie(),Sj=gd(),$j={message:({params:{i:t,j:e}})=>(0,Le.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>(0,Le._)`{i: ${t}, j: ${e}}`},Ij={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:$j,code(t){let{gen:e,data:n,$data:o,schema:r,parentSchema:i,schemaCode:a,it:c}=t;if(!o&&!r)return;let u=e.let("valid"),d=i.items?(0,h_.getSchemaTypes)(i.items):[];t.block$data(u,l,(0,Le._)`${a} === false`),t.ok(u);function l(){let g=e.let("i",(0,Le._)`${n}.length`),v=e.let("j");t.setParams({i:g,j:v}),e.assign(u,!0),e.if((0,Le._)`${g} > 1`,()=>(p()?m:f)(g,v))}function p(){return d.length>0&&!d.some(g=>g==="object"||g==="array")}function m(g,v){let b=e.name("item"),E=(0,h_.checkDataTypes)(d,b,c.opts.strictNumbers,h_.DataType.Wrong),N=e.const("indices",(0,Le._)`{}`);e.for((0,Le._)`;${g}--;`,()=>{e.let(b,(0,Le._)`${n}[${g}]`),e.if(E,(0,Le._)`continue`),d.length>1&&e.if((0,Le._)`typeof ${b} == "string"`,(0,Le._)`${b} += "_"`),e.if((0,Le._)`typeof ${N}[${b}] == "number"`,()=>{e.assign(v,(0,Le._)`${N}[${b}]`),t.error(),e.assign(u,!1).break()}).code((0,Le._)`${N}[${b}] = ${g}`)})}function f(g,v){let b=(0,xj.useFunc)(e,Sj.default),E=e.name("outer");e.label(E).for((0,Le._)`;${g}--;`,()=>e.for((0,Le._)`${v} = ${g}; ${v}--;`,()=>e.if((0,Le._)`${b}(${n}[${g}], ${n}[${v}])`,()=>{t.error(),e.assign(u,!1).break(E)})))}}};g_.default=Ij});var uI=R(y_=>{"use strict";Object.defineProperty(y_,"__esModule",{value:!0});var __=Y(),wj=ie(),Ej=gd(),Tj={message:"must be equal to constant",params:({schemaCode:t})=>(0,__._)`{allowedValue: ${t}}`},Pj={keyword:"const",$data:!0,error:Tj,code(t){let{gen:e,data:n,$data:o,schemaCode:r,schema:i}=t;o||i&&typeof i=="object"?t.fail$data((0,__._)`!${(0,wj.useFunc)(e,Ej.default)}(${n}, ${r})`):t.fail((0,__._)`${i} !== ${n}`)}};y_.default=Pj});var lI=R(v_=>{"use strict";Object.defineProperty(v_,"__esModule",{value:!0});var ts=Y(),Oj=ie(),Rj=gd(),Aj={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,ts._)`{allowedValues: ${t}}`},Cj={keyword:"enum",schemaType:"array",$data:!0,error:Aj,code(t){let{gen:e,data:n,$data:o,schema:r,schemaCode:i,it:a}=t;if(!o&&r.length===0)throw new Error("enum must have non-empty array");let c=r.length>=a.opts.loopEnum,u,d=()=>u??(u=(0,Oj.useFunc)(e,Rj.default)),l;if(c||o)l=e.let("valid"),t.block$data(l,p);else{if(!Array.isArray(r))throw new Error("ajv implementation error");let f=e.const("vSchema",i);l=(0,ts.or)(...r.map((g,v)=>m(f,v)))}t.pass(l);function p(){e.assign(l,!1),e.forOf("v",i,f=>e.if((0,ts._)`${d()}(${n}, ${f})`,()=>e.assign(l,!0).break()))}function m(f,g){let v=r[g];return typeof v=="object"&&v!==null?(0,ts._)`${d()}(${n}, ${f}[${g}])`:(0,ts._)`${n} === ${v}`}}};v_.default=Cj});var dI=R(b_=>{"use strict";Object.defineProperty(b_,"__esModule",{value:!0});var Nj=X$(),zj=Q$(),Dj=rI(),jj=nI(),Uj=oI(),Lj=iI(),Mj=aI(),Zj=cI(),Fj=uI(),Vj=lI(),qj=[Nj.default,zj.default,Dj.default,jj.default,Uj.default,Lj.default,Mj.default,Zj.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},Fj.default,Vj.default];b_.default=qj});var x_=R(rs=>{"use strict";Object.defineProperty(rs,"__esModule",{value:!0});rs.validateAdditionalItems=void 0;var fn=Y(),k_=ie(),Bj={message:({params:{len:t}})=>(0,fn.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,fn._)`{limit: ${t}}`},Hj={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:Bj,code(t){let{parentSchema:e,it:n}=t,{items:o}=e;if(!Array.isArray(o)){(0,k_.checkStrictMode)(n,'"additionalItems" is ignored when "items" is not an array of schemas');return}pI(t,o)}};function pI(t,e){let{gen:n,schema:o,data:r,keyword:i,it:a}=t;a.items=!0;let c=n.const("len",(0,fn._)`${r}.length`);if(o===!1)t.setParams({len:e.length}),t.pass((0,fn._)`${c} <= ${e.length}`);else if(typeof o=="object"&&!(0,k_.alwaysValidSchema)(a,o)){let d=n.var("valid",(0,fn._)`${c} <= ${e.length}`);n.if((0,fn.not)(d),()=>u(d)),t.ok(d)}function u(d){n.forRange("i",e.length,c,l=>{t.subschema({keyword:i,dataProp:l,dataPropType:k_.Type.Num},d),a.allErrors||n.if((0,fn.not)(d),()=>n.break())})}}rs.validateAdditionalItems=pI;rs.default=Hj});var S_=R(ns=>{"use strict";Object.defineProperty(ns,"__esModule",{value:!0});ns.validateTuple=void 0;var mI=Y(),_d=ie(),Kj=xt(),Gj={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:n}=t;if(Array.isArray(e))return fI(t,"additionalItems",e);n.items=!0,!(0,_d.alwaysValidSchema)(n,e)&&t.ok((0,Kj.validateArray)(t))}};function fI(t,e,n=t.schema){let{gen:o,parentSchema:r,data:i,keyword:a,it:c}=t;l(r),c.opts.unevaluated&&n.length&&c.items!==!0&&(c.items=_d.mergeEvaluated.items(o,n.length,c.items));let u=o.name("valid"),d=o.const("len",(0,mI._)`${i}.length`);n.forEach((p,m)=>{(0,_d.alwaysValidSchema)(c,p)||(o.if((0,mI._)`${d} > ${m}`,()=>t.subschema({keyword:a,schemaProp:m,dataProp:m},u)),t.ok(u))});function l(p){let{opts:m,errSchemaPath:f}=c,g=n.length,v=g===p.minItems&&(g===p.maxItems||p[e]===!1);if(m.strictTuples&&!v){let b=`"${a}" is ${g}-tuple, but minItems or maxItems/${e} are not specified or different at path "${f}"`;(0,_d.checkStrictMode)(c,b,m.strictTuples)}}}ns.validateTuple=fI;ns.default=Gj});var hI=R($_=>{"use strict";Object.defineProperty($_,"__esModule",{value:!0});var Wj=S_(),Jj={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,Wj.validateTuple)(t,"items")};$_.default=Jj});var _I=R(I_=>{"use strict";Object.defineProperty(I_,"__esModule",{value:!0});var gI=Y(),Yj=ie(),Xj=xt(),Qj=x_(),e1={message:({params:{len:t}})=>(0,gI.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,gI._)`{limit: ${t}}`},t1={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:e1,code(t){let{schema:e,parentSchema:n,it:o}=t,{prefixItems:r}=n;o.items=!0,!(0,Yj.alwaysValidSchema)(o,e)&&(r?(0,Qj.validateAdditionalItems)(t,r):t.ok((0,Xj.validateArray)(t)))}};I_.default=t1});var yI=R(w_=>{"use strict";Object.defineProperty(w_,"__esModule",{value:!0});var $t=Y(),yd=ie(),r1={message:({params:{min:t,max:e}})=>e===void 0?(0,$t.str)`must contain at least ${t} valid item(s)`:(0,$t.str)`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?(0,$t._)`{minContains: ${t}}`:(0,$t._)`{minContains: ${t}, maxContains: ${e}}`},n1={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:r1,code(t){let{gen:e,schema:n,parentSchema:o,data:r,it:i}=t,a,c,{minContains:u,maxContains:d}=o;i.opts.next?(a=u===void 0?1:u,c=d):a=1;let l=e.const("len",(0,$t._)`${r}.length`);if(t.setParams({min:a,max:c}),c===void 0&&a===0){(0,yd.checkStrictMode)(i,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(c!==void 0&&a>c){(0,yd.checkStrictMode)(i,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,yd.alwaysValidSchema)(i,n)){let v=(0,$t._)`${l} >= ${a}`;c!==void 0&&(v=(0,$t._)`${v} && ${l} <= ${c}`),t.pass(v);return}i.items=!0;let p=e.name("valid");c===void 0&&a===1?f(p,()=>e.if(p,()=>e.break())):a===0?(e.let(p,!0),c!==void 0&&e.if((0,$t._)`${r}.length > 0`,m)):(e.let(p,!1),m()),t.result(p,()=>t.reset());function m(){let v=e.name("_valid"),b=e.let("count",0);f(v,()=>e.if(v,()=>g(b)))}function f(v,b){e.forRange("i",0,l,E=>{t.subschema({keyword:"contains",dataProp:E,dataPropType:yd.Type.Num,compositeRule:!0},v),b()})}function g(v){e.code((0,$t._)`${v}++`),c===void 0?e.if((0,$t._)`${v} >= ${a}`,()=>e.assign(p,!0).break()):(e.if((0,$t._)`${v} > ${c}`,()=>e.assign(p,!1).break()),a===1?e.assign(p,!0):e.if((0,$t._)`${v} >= ${a}`,()=>e.assign(p,!0)))}}};w_.default=n1});var kI=R(Kt=>{"use strict";Object.defineProperty(Kt,"__esModule",{value:!0});Kt.validateSchemaDeps=Kt.validatePropertyDeps=Kt.error=void 0;var E_=Y(),o1=ie(),os=xt();Kt.error={message:({params:{property:t,depsCount:e,deps:n}})=>{let o=e===1?"property":"properties";return(0,E_.str)`must have ${o} ${n} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:n,missingProperty:o}})=>(0,E_._)`{property: ${t},
|
|
8
|
-
missingProperty: ${
|
|
3
|
+
var OR=Object.create;var sp=Object.defineProperty;var PR=Object.getOwnPropertyDescriptor;var AR=Object.getOwnPropertyNames;var NR=Object.getPrototypeOf,CR=Object.prototype.hasOwnProperty;var O=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Jt=(t,e)=>{for(var n in e)sp(t,n,{get:e[n],enumerable:!0})},zR=(t,e,n,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of AR(e))!CR.call(t,r)&&r!==n&&sp(t,r,{get:()=>e[r],enumerable:!(i=PR(e,r))||i.enumerable});return t};var fy=(t,e,n)=>(n=t!=null?OR(NR(t)):{},zR(e||!t||!t.__esModule?sp(n,"default",{value:t,enumerable:!0}):n,t));var Ps=O(ce=>{"use strict";Object.defineProperty(ce,"__esModule",{value:!0});ce.regexpCode=ce.getEsmExportName=ce.getProperty=ce.safeStringify=ce.stringify=ce.strConcat=ce.addCodeArg=ce.str=ce._=ce.nil=ce._Code=ce.Name=ce.IDENTIFIER=ce._CodeOrName=void 0;var Rs=class{};ce._CodeOrName=Rs;ce.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var ir=class extends Rs{constructor(e){if(super(),!ce.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};ce.Name=ir;var kt=class extends Rs{constructor(e){super(),this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((n,i)=>`${n}${i}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((n,i)=>(i instanceof ir&&(n[i.str]=(n[i.str]||0)+1),n),{})}};ce._Code=kt;ce.nil=new kt("");function TS(t,...e){let n=[t[0]],i=0;for(;i<e.length;)sg(n,e[i]),n.push(t[++i]);return new kt(n)}ce._=TS;var og=new kt("+");function RS(t,...e){let n=[Os(t[0])],i=0;for(;i<e.length;)n.push(og),sg(n,e[i]),n.push(og,Os(t[++i]));return xN(n),new kt(n)}ce.str=RS;function sg(t,e){e instanceof kt?t.push(...e._items):e instanceof ir?t.push(e):t.push(IN(e))}ce.addCodeArg=sg;function xN(t){let e=1;for(;e<t.length-1;){if(t[e]===og){let n=SN(t[e-1],t[e+1]);if(n!==void 0){t.splice(e-1,3,n);continue}t[e++]="+"}e++}}function SN(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof ir||t[t.length-1]!=='"'?void 0:typeof e!="string"?`${t.slice(0,-1)}${e}"`:e[0]==='"'?t.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(t instanceof ir))return`"${t}${e.slice(1)}`}function $N(t,e){return e.emptyStr()?t:t.emptyStr()?e:RS`${t}${e}`}ce.strConcat=$N;function IN(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:Os(Array.isArray(t)?t.join(","):t)}function wN(t){return new kt(Os(t))}ce.stringify=wN;function Os(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}ce.safeStringify=Os;function EN(t){return typeof t=="string"&&ce.IDENTIFIER.test(t)?new kt(`.${t}`):TS`[${t}]`}ce.getProperty=EN;function TN(t){if(typeof t=="string"&&ce.IDENTIFIER.test(t))return new kt(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}ce.getEsmExportName=TN;function RN(t){return new kt(t.toString())}ce.regexpCode=RN});var ug=O(st=>{"use strict";Object.defineProperty(st,"__esModule",{value:!0});st.ValueScope=st.ValueScopeName=st.Scope=st.varKinds=st.UsedValueState=void 0;var ot=Ps(),ag=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},Bl;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(Bl||(st.UsedValueState=Bl={}));st.varKinds={const:new ot.Name("const"),let:new ot.Name("let"),var:new ot.Name("var")};var ql=class{constructor({prefixes:e,parent:n}={}){this._names={},this._prefixes=e,this._parent=n}toName(e){return e instanceof ot.Name?e:this.name(e)}name(e){return new ot.Name(this._newName(e))}_newName(e){let n=this._names[e]||this._nameGroup(e);return`${e}${n.index++}`}_nameGroup(e){var n,i;if(!((i=(n=this._parent)===null||n===void 0?void 0:n._prefixes)===null||i===void 0)&&i.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};st.Scope=ql;var Vl=class extends ot.Name{constructor(e,n){super(n),this.prefix=e}setValue(e,{property:n,itemIndex:i}){this.value=e,this.scopePath=(0,ot._)`.${new ot.Name(n)}[${i}]`}};st.ValueScopeName=Vl;var ON=(0,ot._)`\n`,cg=class extends ql{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?ON:ot.nil}}get(){return this._scope}name(e){return new Vl(e,this._newName(e))}value(e,n){var i;if(n.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let r=this.toName(e),{prefix:o}=r,s=(i=n.key)!==null&&i!==void 0?i:n.ref,c=this._values[o];if(c){let l=c.get(s);if(l)return l}else c=this._values[o]=new Map;c.set(s,r);let u=this._scope[o]||(this._scope[o]=[]),d=u.length;return u[d]=n.ref,r.setValue(n,{property:o,itemIndex:d}),r}getValue(e,n){let i=this._values[e];if(i)return i.get(n)}scopeRefs(e,n=this._values){return this._reduceValues(n,i=>{if(i.scopePath===void 0)throw new Error(`CodeGen: name "${i}" has no value`);return(0,ot._)`${e}${i.scopePath}`})}scopeCode(e=this._values,n,i){return this._reduceValues(e,r=>{if(r.value===void 0)throw new Error(`CodeGen: name "${r}" has no value`);return r.value.code},n,i)}_reduceValues(e,n,i={},r){let o=ot.nil;for(let s in e){let c=e[s];if(!c)continue;let u=i[s]=i[s]||new Map;c.forEach(d=>{if(u.has(d))return;u.set(d,Bl.Started);let l=n(d);if(l){let p=this.opts.es5?st.varKinds.var:st.varKinds.const;o=(0,ot._)`${o}${p} ${d} = ${l};${this.opts._n}`}else if(l=r?.(d))o=(0,ot._)`${o}${l}${this.opts._n}`;else throw new ag(d);u.set(d,Bl.Completed)})}return o}};st.ValueScope=cg});var Y=O(ee=>{"use strict";Object.defineProperty(ee,"__esModule",{value:!0});ee.or=ee.and=ee.not=ee.CodeGen=ee.operators=ee.varKinds=ee.ValueScopeName=ee.ValueScope=ee.Scope=ee.Name=ee.regexpCode=ee.stringify=ee.getProperty=ee.nil=ee.strConcat=ee.str=ee._=void 0;var ie=Ps(),Nt=ug(),On=Ps();Object.defineProperty(ee,"_",{enumerable:!0,get:function(){return On._}});Object.defineProperty(ee,"str",{enumerable:!0,get:function(){return On.str}});Object.defineProperty(ee,"strConcat",{enumerable:!0,get:function(){return On.strConcat}});Object.defineProperty(ee,"nil",{enumerable:!0,get:function(){return On.nil}});Object.defineProperty(ee,"getProperty",{enumerable:!0,get:function(){return On.getProperty}});Object.defineProperty(ee,"stringify",{enumerable:!0,get:function(){return On.stringify}});Object.defineProperty(ee,"regexpCode",{enumerable:!0,get:function(){return On.regexpCode}});Object.defineProperty(ee,"Name",{enumerable:!0,get:function(){return On.Name}});var Wl=ug();Object.defineProperty(ee,"Scope",{enumerable:!0,get:function(){return Wl.Scope}});Object.defineProperty(ee,"ValueScope",{enumerable:!0,get:function(){return Wl.ValueScope}});Object.defineProperty(ee,"ValueScopeName",{enumerable:!0,get:function(){return Wl.ValueScopeName}});Object.defineProperty(ee,"varKinds",{enumerable:!0,get:function(){return Wl.varKinds}});ee.operators={GT:new ie._Code(">"),GTE:new ie._Code(">="),LT:new ie._Code("<"),LTE:new ie._Code("<="),EQ:new ie._Code("==="),NEQ:new ie._Code("!=="),NOT:new ie._Code("!"),OR:new ie._Code("||"),AND:new ie._Code("&&"),ADD:new ie._Code("+")};var rn=class{optimizeNodes(){return this}optimizeNames(e,n){return this}},lg=class extends rn{constructor(e,n,i){super(),this.varKind=e,this.name=n,this.rhs=i}render({es5:e,_n:n}){let i=e?Nt.varKinds.var:this.varKind,r=this.rhs===void 0?"":` = ${this.rhs}`;return`${i} ${this.name}${r};`+n}optimizeNames(e,n){if(e[this.name.str])return this.rhs&&(this.rhs=xi(this.rhs,e,n)),this}get names(){return this.rhs instanceof ie._CodeOrName?this.rhs.names:{}}},Hl=class extends rn{constructor(e,n,i){super(),this.lhs=e,this.rhs=n,this.sideEffects=i}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,n){if(!(this.lhs instanceof ie.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=xi(this.rhs,e,n),this}get names(){let e=this.lhs instanceof ie.Name?{}:{...this.lhs.names};return Gl(e,this.rhs)}},dg=class extends Hl{constructor(e,n,i,r){super(e,i,r),this.op=n}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},pg=class extends rn{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},mg=class extends rn{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},fg=class extends rn{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},hg=class extends rn{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,n){return this.code=xi(this.code,e,n),this}get names(){return this.code instanceof ie._CodeOrName?this.code.names:{}}},As=class extends rn{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((n,i)=>n+i.render(e),"")}optimizeNodes(){let{nodes:e}=this,n=e.length;for(;n--;){let i=e[n].optimizeNodes();Array.isArray(i)?e.splice(n,1,...i):i?e[n]=i:e.splice(n,1)}return e.length>0?this:void 0}optimizeNames(e,n){let{nodes:i}=this,r=i.length;for(;r--;){let o=i[r];o.optimizeNames(e,n)||(PN(e,o.names),i.splice(r,1))}return i.length>0?this:void 0}get names(){return this.nodes.reduce((e,n)=>ar(e,n.names),{})}},on=class extends As{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},gg=class extends As{},ki=class extends on{};ki.kind="else";var or=class t extends on{constructor(e,n){super(n),this.condition=e}render(e){let n=`if(${this.condition})`+super.render(e);return this.else&&(n+="else "+this.else.render(e)),n}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let n=this.else;if(n){let i=n.optimizeNodes();n=this.else=Array.isArray(i)?new ki(i):i}if(n)return e===!1?n instanceof t?n:n.nodes:this.nodes.length?this:new t(OS(e),n instanceof t?[n]:n.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,n){var i;if(this.else=(i=this.else)===null||i===void 0?void 0:i.optimizeNames(e,n),!!(super.optimizeNames(e,n)||this.else))return this.condition=xi(this.condition,e,n),this}get names(){let e=super.names;return Gl(e,this.condition),this.else&&ar(e,this.else.names),e}};or.kind="if";var sr=class extends on{};sr.kind="for";var bg=class extends sr{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,n){if(super.optimizeNames(e,n))return this.iteration=xi(this.iteration,e,n),this}get names(){return ar(super.names,this.iteration.names)}},_g=class extends sr{constructor(e,n,i,r){super(),this.varKind=e,this.name=n,this.from=i,this.to=r}render(e){let n=e.es5?Nt.varKinds.var:this.varKind,{name:i,from:r,to:o}=this;return`for(${n} ${i}=${r}; ${i}<${o}; ${i}++)`+super.render(e)}get names(){let e=Gl(super.names,this.from);return Gl(e,this.to)}},Kl=class extends sr{constructor(e,n,i,r){super(),this.loop=e,this.varKind=n,this.name=i,this.iterable=r}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,n){if(super.optimizeNames(e,n))return this.iterable=xi(this.iterable,e,n),this}get names(){return ar(super.names,this.iterable.names)}},Ns=class extends on{constructor(e,n,i){super(),this.name=e,this.args=n,this.async=i}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};Ns.kind="func";var Cs=class extends As{render(e){return"return "+super.render(e)}};Cs.kind="return";var yg=class extends on{render(e){let n="try"+super.render(e);return this.catch&&(n+=this.catch.render(e)),this.finally&&(n+=this.finally.render(e)),n}optimizeNodes(){var e,n;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(n=this.finally)===null||n===void 0||n.optimizeNodes(),this}optimizeNames(e,n){var i,r;return super.optimizeNames(e,n),(i=this.catch)===null||i===void 0||i.optimizeNames(e,n),(r=this.finally)===null||r===void 0||r.optimizeNames(e,n),this}get names(){let e=super.names;return this.catch&&ar(e,this.catch.names),this.finally&&ar(e,this.finally.names),e}},zs=class extends on{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};zs.kind="catch";var Ds=class extends on{render(e){return"finally"+super.render(e)}};Ds.kind="finally";var vg=class{constructor(e,n={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...n,_n:n.lines?`
|
|
4
|
+
`:""},this._extScope=e,this._scope=new Nt.Scope({parent:e}),this._nodes=[new gg]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,n){let i=this._extScope.value(e,n);return(this._values[i.prefix]||(this._values[i.prefix]=new Set)).add(i),i}getScopeValue(e,n){return this._extScope.getValue(e,n)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,n,i,r){let o=this._scope.toName(n);return i!==void 0&&r&&(this._constants[o.str]=i),this._leafNode(new lg(e,o,i)),o}const(e,n,i){return this._def(Nt.varKinds.const,e,n,i)}let(e,n,i){return this._def(Nt.varKinds.let,e,n,i)}var(e,n,i){return this._def(Nt.varKinds.var,e,n,i)}assign(e,n,i){return this._leafNode(new Hl(e,n,i))}add(e,n){return this._leafNode(new dg(e,ee.operators.ADD,n))}code(e){return typeof e=="function"?e():e!==ie.nil&&this._leafNode(new hg(e)),this}object(...e){let n=["{"];for(let[i,r]of e)n.length>1&&n.push(","),n.push(i),(i!==r||this.opts.es5)&&(n.push(":"),(0,ie.addCodeArg)(n,r));return n.push("}"),new ie._Code(n)}if(e,n,i){if(this._blockNode(new or(e)),n&&i)this.code(n).else().code(i).endIf();else if(n)this.code(n).endIf();else if(i)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new or(e))}else(){return this._elseNode(new ki)}endIf(){return this._endBlockNode(or,ki)}_for(e,n){return this._blockNode(e),n&&this.code(n).endFor(),this}for(e,n){return this._for(new bg(e),n)}forRange(e,n,i,r,o=this.opts.es5?Nt.varKinds.var:Nt.varKinds.let){let s=this._scope.toName(e);return this._for(new _g(o,s,n,i),()=>r(s))}forOf(e,n,i,r=Nt.varKinds.const){let o=this._scope.toName(e);if(this.opts.es5){let s=n instanceof ie.Name?n:this.var("_arr",n);return this.forRange("_i",0,(0,ie._)`${s}.length`,c=>{this.var(o,(0,ie._)`${s}[${c}]`),i(o)})}return this._for(new Kl("of",r,o,n),()=>i(o))}forIn(e,n,i,r=this.opts.es5?Nt.varKinds.var:Nt.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,ie._)`Object.keys(${n})`,i);let o=this._scope.toName(e);return this._for(new Kl("in",r,o,n),()=>i(o))}endFor(){return this._endBlockNode(sr)}label(e){return this._leafNode(new pg(e))}break(e){return this._leafNode(new mg(e))}return(e){let n=new Cs;if(this._blockNode(n),this.code(e),n.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Cs)}try(e,n,i){if(!n&&!i)throw new Error('CodeGen: "try" without "catch" and "finally"');let r=new yg;if(this._blockNode(r),this.code(e),n){let o=this.name("e");this._currNode=r.catch=new zs(o),n(o)}return i&&(this._currNode=r.finally=new Ds,this.code(i)),this._endBlockNode(zs,Ds)}throw(e){return this._leafNode(new fg(e))}block(e,n){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(n),this}endBlock(e){let n=this._blockStarts.pop();if(n===void 0)throw new Error("CodeGen: not in self-balancing block");let i=this._nodes.length-n;if(i<0||e!==void 0&&i!==e)throw new Error(`CodeGen: wrong number of nodes: ${i} vs ${e} expected`);return this._nodes.length=n,this}func(e,n=ie.nil,i,r){return this._blockNode(new Ns(e,n,i)),r&&this.code(r).endFunc(),this}endFunc(){return this._endBlockNode(Ns)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,n){let i=this._currNode;if(i instanceof e||n&&i instanceof n)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${n?`${e.kind}/${n.kind}`:e.kind}"`)}_elseNode(e){let n=this._currNode;if(!(n instanceof or))throw new Error('CodeGen: "else" without "if"');return this._currNode=n.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let n=this._nodes;n[n.length-1]=e}};ee.CodeGen=vg;function ar(t,e){for(let n in e)t[n]=(t[n]||0)+(e[n]||0);return t}function Gl(t,e){return e instanceof ie._CodeOrName?ar(t,e.names):t}function xi(t,e,n){if(t instanceof ie.Name)return i(t);if(!r(t))return t;return new ie._Code(t._items.reduce((o,s)=>(s instanceof ie.Name&&(s=i(s)),s instanceof ie._Code?o.push(...s._items):o.push(s),o),[]));function i(o){let s=n[o.str];return s===void 0||e[o.str]!==1?o:(delete e[o.str],s)}function r(o){return o instanceof ie._Code&&o._items.some(s=>s instanceof ie.Name&&e[s.str]===1&&n[s.str]!==void 0)}}function PN(t,e){for(let n in e)t[n]=(t[n]||0)-(e[n]||0)}function OS(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,ie._)`!${kg(t)}`}ee.not=OS;var AN=PS(ee.operators.AND);function NN(...t){return t.reduce(AN)}ee.and=NN;var CN=PS(ee.operators.OR);function zN(...t){return t.reduce(CN)}ee.or=zN;function PS(t){return(e,n)=>e===ie.nil?n:n===ie.nil?e:(0,ie._)`${kg(e)} ${t} ${kg(n)}`}function kg(t){return t instanceof ie.Name?t:(0,ie._)`(${t})`}});var oe=O(te=>{"use strict";Object.defineProperty(te,"__esModule",{value:!0});te.checkStrictMode=te.getErrorPath=te.Type=te.useFunc=te.setEvaluated=te.evaluatedPropsToName=te.mergeEvaluated=te.eachItem=te.unescapeJsonPointer=te.escapeJsonPointer=te.escapeFragment=te.unescapeFragment=te.schemaRefOrVal=te.schemaHasRulesButRef=te.schemaHasRules=te.checkUnknownRules=te.alwaysValidSchema=te.toHash=void 0;var ve=Y(),DN=Ps();function jN(t){let e={};for(let n of t)e[n]=!0;return e}te.toHash=jN;function UN(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(CS(t,e),!zS(e,t.self.RULES.all))}te.alwaysValidSchema=UN;function CS(t,e=t.schema){let{opts:n,self:i}=t;if(!n.strictSchema||typeof e=="boolean")return;let r=i.RULES.keywords;for(let o in e)r[o]||US(t,`unknown keyword: "${o}"`)}te.checkUnknownRules=CS;function zS(t,e){if(typeof t=="boolean")return!t;for(let n in t)if(e[n])return!0;return!1}te.schemaHasRules=zS;function MN(t,e){if(typeof t=="boolean")return!t;for(let n in t)if(n!=="$ref"&&e.all[n])return!0;return!1}te.schemaHasRulesButRef=MN;function LN({topSchemaRef:t,schemaPath:e},n,i,r){if(!r){if(typeof n=="number"||typeof n=="boolean")return n;if(typeof n=="string")return(0,ve._)`${n}`}return(0,ve._)`${t}${e}${(0,ve.getProperty)(i)}`}te.schemaRefOrVal=LN;function ZN(t){return DS(decodeURIComponent(t))}te.unescapeFragment=ZN;function FN(t){return encodeURIComponent(Sg(t))}te.escapeFragment=FN;function Sg(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}te.escapeJsonPointer=Sg;function DS(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}te.unescapeJsonPointer=DS;function BN(t,e){if(Array.isArray(t))for(let n of t)e(n);else e(t)}te.eachItem=BN;function AS({mergeNames:t,mergeToName:e,mergeValues:n,resultToName:i}){return(r,o,s,c)=>{let u=s===void 0?o:s instanceof ve.Name?(o instanceof ve.Name?t(r,o,s):e(r,o,s),s):o instanceof ve.Name?(e(r,s,o),o):n(o,s);return c===ve.Name&&!(u instanceof ve.Name)?i(r,u):u}}te.mergeEvaluated={props:AS({mergeNames:(t,e,n)=>t.if((0,ve._)`${n} !== true && ${e} !== undefined`,()=>{t.if((0,ve._)`${e} === true`,()=>t.assign(n,!0),()=>t.assign(n,(0,ve._)`${n} || {}`).code((0,ve._)`Object.assign(${n}, ${e})`))}),mergeToName:(t,e,n)=>t.if((0,ve._)`${n} !== true`,()=>{e===!0?t.assign(n,!0):(t.assign(n,(0,ve._)`${n} || {}`),$g(t,n,e))}),mergeValues:(t,e)=>t===!0?!0:{...t,...e},resultToName:jS}),items:AS({mergeNames:(t,e,n)=>t.if((0,ve._)`${n} !== true && ${e} !== undefined`,()=>t.assign(n,(0,ve._)`${e} === true ? true : ${n} > ${e} ? ${n} : ${e}`)),mergeToName:(t,e,n)=>t.if((0,ve._)`${n} !== true`,()=>t.assign(n,e===!0?!0:(0,ve._)`${n} > ${e} ? ${n} : ${e}`)),mergeValues:(t,e)=>t===!0?!0:Math.max(t,e),resultToName:(t,e)=>t.var("items",e)})};function jS(t,e){if(e===!0)return t.var("props",!0);let n=t.var("props",(0,ve._)`{}`);return e!==void 0&&$g(t,n,e),n}te.evaluatedPropsToName=jS;function $g(t,e,n){Object.keys(n).forEach(i=>t.assign((0,ve._)`${e}${(0,ve.getProperty)(i)}`,!0))}te.setEvaluated=$g;var NS={};function qN(t,e){return t.scopeValue("func",{ref:e,code:NS[e.code]||(NS[e.code]=new DN._Code(e.code))})}te.useFunc=qN;var xg;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(xg||(te.Type=xg={}));function VN(t,e,n){if(t instanceof ve.Name){let i=e===xg.Num;return n?i?(0,ve._)`"[" + ${t} + "]"`:(0,ve._)`"['" + ${t} + "']"`:i?(0,ve._)`"/" + ${t}`:(0,ve._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return n?(0,ve.getProperty)(t).toString():"/"+Sg(t)}te.getErrorPath=VN;function US(t,e,n=t.opts.strictSchema){if(n){if(e=`strict mode: ${e}`,n===!0)throw new Error(e);t.self.logger.warn(e)}}te.checkStrictMode=US});var sn=O(Ig=>{"use strict";Object.defineProperty(Ig,"__esModule",{value:!0});var qe=Y(),HN={data:new qe.Name("data"),valCxt:new qe.Name("valCxt"),instancePath:new qe.Name("instancePath"),parentData:new qe.Name("parentData"),parentDataProperty:new qe.Name("parentDataProperty"),rootData:new qe.Name("rootData"),dynamicAnchors:new qe.Name("dynamicAnchors"),vErrors:new qe.Name("vErrors"),errors:new qe.Name("errors"),this:new qe.Name("this"),self:new qe.Name("self"),scope:new qe.Name("scope"),json:new qe.Name("json"),jsonPos:new qe.Name("jsonPos"),jsonLen:new qe.Name("jsonLen"),jsonPart:new qe.Name("jsonPart")};Ig.default=HN});var js=O(Ve=>{"use strict";Object.defineProperty(Ve,"__esModule",{value:!0});Ve.extendErrors=Ve.resetErrorsCount=Ve.reportExtraError=Ve.reportError=Ve.keyword$DataError=Ve.keywordError=void 0;var se=Y(),Jl=oe(),Xe=sn();Ve.keywordError={message:({keyword:t})=>(0,se.str)`must pass "${t}" keyword validation`};Ve.keyword$DataError={message:({keyword:t,schemaType:e})=>e?(0,se.str)`"${t}" keyword must be ${e} ($data)`:(0,se.str)`"${t}" keyword is invalid ($data)`};function KN(t,e=Ve.keywordError,n,i){let{it:r}=t,{gen:o,compositeRule:s,allErrors:c}=r,u=ZS(t,e,n);i??(s||c)?MS(o,u):LS(r,(0,se._)`[${u}]`)}Ve.reportError=KN;function GN(t,e=Ve.keywordError,n){let{it:i}=t,{gen:r,compositeRule:o,allErrors:s}=i,c=ZS(t,e,n);MS(r,c),o||s||LS(i,Xe.default.vErrors)}Ve.reportExtraError=GN;function WN(t,e){t.assign(Xe.default.errors,e),t.if((0,se._)`${Xe.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,se._)`${Xe.default.vErrors}.length`,e),()=>t.assign(Xe.default.vErrors,null)))}Ve.resetErrorsCount=WN;function JN({gen:t,keyword:e,schemaValue:n,data:i,errsCount:r,it:o}){if(r===void 0)throw new Error("ajv implementation error");let s=t.name("err");t.forRange("i",r,Xe.default.errors,c=>{t.const(s,(0,se._)`${Xe.default.vErrors}[${c}]`),t.if((0,se._)`${s}.instancePath === undefined`,()=>t.assign((0,se._)`${s}.instancePath`,(0,se.strConcat)(Xe.default.instancePath,o.errorPath))),t.assign((0,se._)`${s}.schemaPath`,(0,se.str)`${o.errSchemaPath}/${e}`),o.opts.verbose&&(t.assign((0,se._)`${s}.schema`,n),t.assign((0,se._)`${s}.data`,i))})}Ve.extendErrors=JN;function MS(t,e){let n=t.const("err",e);t.if((0,se._)`${Xe.default.vErrors} === null`,()=>t.assign(Xe.default.vErrors,(0,se._)`[${n}]`),(0,se._)`${Xe.default.vErrors}.push(${n})`),t.code((0,se._)`${Xe.default.errors}++`)}function LS(t,e){let{gen:n,validateName:i,schemaEnv:r}=t;r.$async?n.throw((0,se._)`new ${t.ValidationError}(${e})`):(n.assign((0,se._)`${i}.errors`,e),n.return(!1))}var cr={keyword:new se.Name("keyword"),schemaPath:new se.Name("schemaPath"),params:new se.Name("params"),propertyName:new se.Name("propertyName"),message:new se.Name("message"),schema:new se.Name("schema"),parentSchema:new se.Name("parentSchema")};function ZS(t,e,n){let{createErrors:i}=t.it;return i===!1?(0,se._)`{}`:YN(t,e,n)}function YN(t,e,n={}){let{gen:i,it:r}=t,o=[XN(r,n),QN(t,n)];return eC(t,e,o),i.object(...o)}function XN({errorPath:t},{instancePath:e}){let n=e?(0,se.str)`${t}${(0,Jl.getErrorPath)(e,Jl.Type.Str)}`:t;return[Xe.default.instancePath,(0,se.strConcat)(Xe.default.instancePath,n)]}function QN({keyword:t,it:{errSchemaPath:e}},{schemaPath:n,parentSchema:i}){let r=i?e:(0,se.str)`${e}/${t}`;return n&&(r=(0,se.str)`${r}${(0,Jl.getErrorPath)(n,Jl.Type.Str)}`),[cr.schemaPath,r]}function eC(t,{params:e,message:n},i){let{keyword:r,data:o,schemaValue:s,it:c}=t,{opts:u,propertyName:d,topSchemaRef:l,schemaPath:p}=c;i.push([cr.keyword,r],[cr.params,typeof e=="function"?e(t):e||(0,se._)`{}`]),u.messages&&i.push([cr.message,typeof n=="function"?n(t):n]),u.verbose&&i.push([cr.schema,s],[cr.parentSchema,(0,se._)`${l}${p}`],[Xe.default.data,o]),d&&i.push([cr.propertyName,d])}});var BS=O(Si=>{"use strict";Object.defineProperty(Si,"__esModule",{value:!0});Si.boolOrEmptySchema=Si.topBoolOrEmptySchema=void 0;var tC=js(),nC=Y(),rC=sn(),iC={message:"boolean schema is false"};function oC(t){let{gen:e,schema:n,validateName:i}=t;n===!1?FS(t,!1):typeof n=="object"&&n.$async===!0?e.return(rC.default.data):(e.assign((0,nC._)`${i}.errors`,null),e.return(!0))}Si.topBoolOrEmptySchema=oC;function sC(t,e){let{gen:n,schema:i}=t;i===!1?(n.var(e,!1),FS(t)):n.var(e,!0)}Si.boolOrEmptySchema=sC;function FS(t,e){let{gen:n,data:i}=t,r={gen:n,keyword:"false schema",data:i,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,tC.reportError)(r,iC,void 0,e)}});var wg=O($i=>{"use strict";Object.defineProperty($i,"__esModule",{value:!0});$i.getRules=$i.isJSONType=void 0;var aC=["string","number","integer","boolean","null","object","array"],cC=new Set(aC);function uC(t){return typeof t=="string"&&cC.has(t)}$i.isJSONType=uC;function lC(){let t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...t,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}$i.getRules=lC});var Eg=O(Pn=>{"use strict";Object.defineProperty(Pn,"__esModule",{value:!0});Pn.shouldUseRule=Pn.shouldUseGroup=Pn.schemaHasRulesForType=void 0;function dC({schema:t,self:e},n){let i=e.RULES.types[n];return i&&i!==!0&&qS(t,i)}Pn.schemaHasRulesForType=dC;function qS(t,e){return e.rules.some(n=>VS(t,n))}Pn.shouldUseGroup=qS;function VS(t,e){var n;return t[e.keyword]!==void 0||((n=e.definition.implements)===null||n===void 0?void 0:n.some(i=>t[i]!==void 0))}Pn.shouldUseRule=VS});var Us=O(He=>{"use strict";Object.defineProperty(He,"__esModule",{value:!0});He.reportTypeError=He.checkDataTypes=He.checkDataType=He.coerceAndCheckDataType=He.getJSONTypes=He.getSchemaTypes=He.DataType=void 0;var pC=wg(),mC=Eg(),fC=js(),J=Y(),HS=oe(),Ii;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(Ii||(He.DataType=Ii={}));function hC(t){let e=KS(t.type);if(e.includes("null")){if(t.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&t.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');t.nullable===!0&&e.push("null")}return e}He.getSchemaTypes=hC;function KS(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(pC.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}He.getJSONTypes=KS;function gC(t,e){let{gen:n,data:i,opts:r}=t,o=bC(e,r.coerceTypes),s=e.length>0&&!(o.length===0&&e.length===1&&(0,mC.schemaHasRulesForType)(t,e[0]));if(s){let c=Rg(e,i,r.strictNumbers,Ii.Wrong);n.if(c,()=>{o.length?_C(t,e,o):Og(t)})}return s}He.coerceAndCheckDataType=gC;var GS=new Set(["string","number","integer","boolean","null"]);function bC(t,e){return e?t.filter(n=>GS.has(n)||e==="array"&&n==="array"):[]}function _C(t,e,n){let{gen:i,data:r,opts:o}=t,s=i.let("dataType",(0,J._)`typeof ${r}`),c=i.let("coerced",(0,J._)`undefined`);o.coerceTypes==="array"&&i.if((0,J._)`${s} == 'object' && Array.isArray(${r}) && ${r}.length == 1`,()=>i.assign(r,(0,J._)`${r}[0]`).assign(s,(0,J._)`typeof ${r}`).if(Rg(e,r,o.strictNumbers),()=>i.assign(c,r))),i.if((0,J._)`${c} !== undefined`);for(let d of n)(GS.has(d)||d==="array"&&o.coerceTypes==="array")&&u(d);i.else(),Og(t),i.endIf(),i.if((0,J._)`${c} !== undefined`,()=>{i.assign(r,c),yC(t,c)});function u(d){switch(d){case"string":i.elseIf((0,J._)`${s} == "number" || ${s} == "boolean"`).assign(c,(0,J._)`"" + ${r}`).elseIf((0,J._)`${r} === null`).assign(c,(0,J._)`""`);return;case"number":i.elseIf((0,J._)`${s} == "boolean" || ${r} === null
|
|
5
|
+
|| (${s} == "string" && ${r} && ${r} == +${r})`).assign(c,(0,J._)`+${r}`);return;case"integer":i.elseIf((0,J._)`${s} === "boolean" || ${r} === null
|
|
6
|
+
|| (${s} === "string" && ${r} && ${r} == +${r} && !(${r} % 1))`).assign(c,(0,J._)`+${r}`);return;case"boolean":i.elseIf((0,J._)`${r} === "false" || ${r} === 0 || ${r} === null`).assign(c,!1).elseIf((0,J._)`${r} === "true" || ${r} === 1`).assign(c,!0);return;case"null":i.elseIf((0,J._)`${r} === "" || ${r} === 0 || ${r} === false`),i.assign(c,null);return;case"array":i.elseIf((0,J._)`${s} === "string" || ${s} === "number"
|
|
7
|
+
|| ${s} === "boolean" || ${r} === null`).assign(c,(0,J._)`[${r}]`)}}}function yC({gen:t,parentData:e,parentDataProperty:n},i){t.if((0,J._)`${e} !== undefined`,()=>t.assign((0,J._)`${e}[${n}]`,i))}function Tg(t,e,n,i=Ii.Correct){let r=i===Ii.Correct?J.operators.EQ:J.operators.NEQ,o;switch(t){case"null":return(0,J._)`${e} ${r} null`;case"array":o=(0,J._)`Array.isArray(${e})`;break;case"object":o=(0,J._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":o=s((0,J._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":o=s();break;default:return(0,J._)`typeof ${e} ${r} ${t}`}return i===Ii.Correct?o:(0,J.not)(o);function s(c=J.nil){return(0,J.and)((0,J._)`typeof ${e} == "number"`,c,n?(0,J._)`isFinite(${e})`:J.nil)}}He.checkDataType=Tg;function Rg(t,e,n,i){if(t.length===1)return Tg(t[0],e,n,i);let r,o=(0,HS.toHash)(t);if(o.array&&o.object){let s=(0,J._)`typeof ${e} != "object"`;r=o.null?s:(0,J._)`!${e} || ${s}`,delete o.null,delete o.array,delete o.object}else r=J.nil;o.number&&delete o.integer;for(let s in o)r=(0,J.and)(r,Tg(s,e,n,i));return r}He.checkDataTypes=Rg;var vC={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>typeof t=="string"?(0,J._)`{type: ${t}}`:(0,J._)`{type: ${e}}`};function Og(t){let e=kC(t);(0,fC.reportError)(e,vC)}He.reportTypeError=Og;function kC(t){let{gen:e,data:n,schema:i}=t,r=(0,HS.schemaRefOrVal)(t,i,"type");return{gen:e,keyword:"type",data:n,schema:i.type,schemaCode:r,schemaValue:r,parentSchema:i,params:{},it:t}}});var JS=O(Yl=>{"use strict";Object.defineProperty(Yl,"__esModule",{value:!0});Yl.assignDefaults=void 0;var wi=Y(),xC=oe();function SC(t,e){let{properties:n,items:i}=t.schema;if(e==="object"&&n)for(let r in n)WS(t,r,n[r].default);else e==="array"&&Array.isArray(i)&&i.forEach((r,o)=>WS(t,o,r.default))}Yl.assignDefaults=SC;function WS(t,e,n){let{gen:i,compositeRule:r,data:o,opts:s}=t;if(n===void 0)return;let c=(0,wi._)`${o}${(0,wi.getProperty)(e)}`;if(r){(0,xC.checkStrictMode)(t,`default is ignored for: ${c}`);return}let u=(0,wi._)`${c} === undefined`;s.useDefaults==="empty"&&(u=(0,wi._)`${u} || ${c} === null || ${c} === ""`),i.if(u,(0,wi._)`${c} = ${(0,wi.stringify)(n)}`)}});var xt=O(_e=>{"use strict";Object.defineProperty(_e,"__esModule",{value:!0});_e.validateUnion=_e.validateArray=_e.usePattern=_e.callValidateCode=_e.schemaProperties=_e.allSchemaProperties=_e.noPropertyInData=_e.propertyInData=_e.isOwnProperty=_e.hasPropFunc=_e.reportMissingProp=_e.checkMissingProp=_e.checkReportMissingProp=void 0;var Se=Y(),Pg=oe(),An=sn(),$C=oe();function IC(t,e){let{gen:n,data:i,it:r}=t;n.if(Ng(n,i,e,r.opts.ownProperties),()=>{t.setParams({missingProperty:(0,Se._)`${e}`},!0),t.error()})}_e.checkReportMissingProp=IC;function wC({gen:t,data:e,it:{opts:n}},i,r){return(0,Se.or)(...i.map(o=>(0,Se.and)(Ng(t,e,o,n.ownProperties),(0,Se._)`${r} = ${o}`)))}_e.checkMissingProp=wC;function EC(t,e){t.setParams({missingProperty:e},!0),t.error()}_e.reportMissingProp=EC;function YS(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,Se._)`Object.prototype.hasOwnProperty`})}_e.hasPropFunc=YS;function Ag(t,e,n){return(0,Se._)`${YS(t)}.call(${e}, ${n})`}_e.isOwnProperty=Ag;function TC(t,e,n,i){let r=(0,Se._)`${e}${(0,Se.getProperty)(n)} !== undefined`;return i?(0,Se._)`${r} && ${Ag(t,e,n)}`:r}_e.propertyInData=TC;function Ng(t,e,n,i){let r=(0,Se._)`${e}${(0,Se.getProperty)(n)} === undefined`;return i?(0,Se.or)(r,(0,Se.not)(Ag(t,e,n))):r}_e.noPropertyInData=Ng;function XS(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}_e.allSchemaProperties=XS;function RC(t,e){return XS(e).filter(n=>!(0,Pg.alwaysValidSchema)(t,e[n]))}_e.schemaProperties=RC;function OC({schemaCode:t,data:e,it:{gen:n,topSchemaRef:i,schemaPath:r,errorPath:o},it:s},c,u,d){let l=d?(0,Se._)`${t}, ${e}, ${i}${r}`:e,p=[[An.default.instancePath,(0,Se.strConcat)(An.default.instancePath,o)],[An.default.parentData,s.parentData],[An.default.parentDataProperty,s.parentDataProperty],[An.default.rootData,An.default.rootData]];s.opts.dynamicRef&&p.push([An.default.dynamicAnchors,An.default.dynamicAnchors]);let m=(0,Se._)`${l}, ${n.object(...p)}`;return u!==Se.nil?(0,Se._)`${c}.call(${u}, ${m})`:(0,Se._)`${c}(${m})`}_e.callValidateCode=OC;var PC=(0,Se._)`new RegExp`;function AC({gen:t,it:{opts:e}},n){let i=e.unicodeRegExp?"u":"",{regExp:r}=e.code,o=r(n,i);return t.scopeValue("pattern",{key:o.toString(),ref:o,code:(0,Se._)`${r.code==="new RegExp"?PC:(0,$C.useFunc)(t,r)}(${n}, ${i})`})}_e.usePattern=AC;function NC(t){let{gen:e,data:n,keyword:i,it:r}=t,o=e.name("valid");if(r.allErrors){let c=e.let("valid",!0);return s(()=>e.assign(c,!1)),c}return e.var(o,!0),s(()=>e.break()),o;function s(c){let u=e.const("len",(0,Se._)`${n}.length`);e.forRange("i",0,u,d=>{t.subschema({keyword:i,dataProp:d,dataPropType:Pg.Type.Num},o),e.if((0,Se.not)(o),c)})}}_e.validateArray=NC;function CC(t){let{gen:e,schema:n,keyword:i,it:r}=t;if(!Array.isArray(n))throw new Error("ajv implementation error");if(n.some(u=>(0,Pg.alwaysValidSchema)(r,u))&&!r.opts.unevaluated)return;let s=e.let("valid",!1),c=e.name("_valid");e.block(()=>n.forEach((u,d)=>{let l=t.subschema({keyword:i,schemaProp:d,compositeRule:!0},c);e.assign(s,(0,Se._)`${s} || ${c}`),t.mergeValidEvaluated(l,c)||e.if((0,Se.not)(s))})),t.result(s,()=>t.reset(),()=>t.error(!0))}_e.validateUnion=CC});var t$=O(Vt=>{"use strict";Object.defineProperty(Vt,"__esModule",{value:!0});Vt.validateKeywordUsage=Vt.validSchemaType=Vt.funcKeywordCode=Vt.macroKeywordCode=void 0;var Qe=Y(),ur=sn(),zC=xt(),DC=js();function jC(t,e){let{gen:n,keyword:i,schema:r,parentSchema:o,it:s}=t,c=e.macro.call(s.self,r,o,s),u=e$(n,i,c);s.opts.validateSchema!==!1&&s.self.validateSchema(c,!0);let d=n.name("valid");t.subschema({schema:c,schemaPath:Qe.nil,errSchemaPath:`${s.errSchemaPath}/${i}`,topSchemaRef:u,compositeRule:!0},d),t.pass(d,()=>t.error(!0))}Vt.macroKeywordCode=jC;function UC(t,e){var n;let{gen:i,keyword:r,schema:o,parentSchema:s,$data:c,it:u}=t;LC(u,e);let d=!c&&e.compile?e.compile.call(u.self,o,s,u):e.validate,l=e$(i,r,d),p=i.let("valid");t.block$data(p,m),t.ok((n=e.valid)!==null&&n!==void 0?n:p);function m(){if(e.errors===!1)y(),e.modifying&&QS(t),v(()=>t.error());else{let E=e.async?f():h();e.modifying&&QS(t),v(()=>MC(t,E))}}function f(){let E=i.let("ruleErrs",null);return i.try(()=>y((0,Qe._)`await `),C=>i.assign(p,!1).if((0,Qe._)`${C} instanceof ${u.ValidationError}`,()=>i.assign(E,(0,Qe._)`${C}.errors`),()=>i.throw(C))),E}function h(){let E=(0,Qe._)`${l}.errors`;return i.assign(E,null),y(Qe.nil),E}function y(E=e.async?(0,Qe._)`await `:Qe.nil){let C=u.opts.passContext?ur.default.this:ur.default.self,z=!("compile"in e&&!c||e.schema===!1);i.assign(p,(0,Qe._)`${E}${(0,zC.callValidateCode)(t,l,C,z)}`,e.modifying)}function v(E){var C;i.if((0,Qe.not)((C=e.valid)!==null&&C!==void 0?C:p),E)}}Vt.funcKeywordCode=UC;function QS(t){let{gen:e,data:n,it:i}=t;e.if(i.parentData,()=>e.assign(n,(0,Qe._)`${i.parentData}[${i.parentDataProperty}]`))}function MC(t,e){let{gen:n}=t;n.if((0,Qe._)`Array.isArray(${e})`,()=>{n.assign(ur.default.vErrors,(0,Qe._)`${ur.default.vErrors} === null ? ${e} : ${ur.default.vErrors}.concat(${e})`).assign(ur.default.errors,(0,Qe._)`${ur.default.vErrors}.length`),(0,DC.extendErrors)(t)},()=>t.error())}function LC({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function e$(t,e,n){if(n===void 0)throw new Error(`keyword "${e}" failed to compile`);return t.scopeValue("keyword",typeof n=="function"?{ref:n}:{ref:n,code:(0,Qe.stringify)(n)})}function ZC(t,e,n=!1){return!e.length||e.some(i=>i==="array"?Array.isArray(t):i==="object"?t&&typeof t=="object"&&!Array.isArray(t):typeof t==i||n&&typeof t>"u")}Vt.validSchemaType=ZC;function FC({schema:t,opts:e,self:n,errSchemaPath:i},r,o){if(Array.isArray(r.keyword)?!r.keyword.includes(o):r.keyword!==o)throw new Error("ajv implementation error");let s=r.dependencies;if(s?.some(c=>!Object.prototype.hasOwnProperty.call(t,c)))throw new Error(`parent schema must have dependencies of ${o}: ${s.join(",")}`);if(r.validateSchema&&!r.validateSchema(t[o])){let u=`keyword "${o}" value is invalid at path "${i}": `+n.errorsText(r.validateSchema.errors);if(e.validateSchema==="log")n.logger.error(u);else throw new Error(u)}}Vt.validateKeywordUsage=FC});var r$=O(Nn=>{"use strict";Object.defineProperty(Nn,"__esModule",{value:!0});Nn.extendSubschemaMode=Nn.extendSubschemaData=Nn.getSubschema=void 0;var Ht=Y(),n$=oe();function BC(t,{keyword:e,schemaProp:n,schema:i,schemaPath:r,errSchemaPath:o,topSchemaRef:s}){if(e!==void 0&&i!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){let c=t.schema[e];return n===void 0?{schema:c,schemaPath:(0,Ht._)`${t.schemaPath}${(0,Ht.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:c[n],schemaPath:(0,Ht._)`${t.schemaPath}${(0,Ht.getProperty)(e)}${(0,Ht.getProperty)(n)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,n$.escapeFragment)(n)}`}}if(i!==void 0){if(r===void 0||o===void 0||s===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:i,schemaPath:r,topSchemaRef:s,errSchemaPath:o}}throw new Error('either "keyword" or "schema" must be passed')}Nn.getSubschema=BC;function qC(t,e,{dataProp:n,dataPropType:i,data:r,dataTypes:o,propertyName:s}){if(r!==void 0&&n!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:c}=e;if(n!==void 0){let{errorPath:d,dataPathArr:l,opts:p}=e,m=c.let("data",(0,Ht._)`${e.data}${(0,Ht.getProperty)(n)}`,!0);u(m),t.errorPath=(0,Ht.str)`${d}${(0,n$.getErrorPath)(n,i,p.jsPropertySyntax)}`,t.parentDataProperty=(0,Ht._)`${n}`,t.dataPathArr=[...l,t.parentDataProperty]}if(r!==void 0){let d=r instanceof Ht.Name?r:c.let("data",r,!0);u(d),s!==void 0&&(t.propertyName=s)}o&&(t.dataTypes=o);function u(d){t.data=d,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,d]}}Nn.extendSubschemaData=qC;function VC(t,{jtdDiscriminator:e,jtdMetadata:n,compositeRule:i,createErrors:r,allErrors:o}){i!==void 0&&(t.compositeRule=i),r!==void 0&&(t.createErrors=r),o!==void 0&&(t.allErrors=o),t.jtdDiscriminator=e,t.jtdMetadata=n}Nn.extendSubschemaMode=VC});var Cg=O((x9,i$)=>{"use strict";i$.exports=function t(e,n){if(e===n)return!0;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(e.constructor!==n.constructor)return!1;var i,r,o;if(Array.isArray(e)){if(i=e.length,i!=n.length)return!1;for(r=i;r--!==0;)if(!t(e[r],n[r]))return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if(o=Object.keys(e),i=o.length,i!==Object.keys(n).length)return!1;for(r=i;r--!==0;)if(!Object.prototype.hasOwnProperty.call(n,o[r]))return!1;for(r=i;r--!==0;){var s=o[r];if(!t(e[s],n[s]))return!1}return!0}return e!==e&&n!==n}});var s$=O((S9,o$)=>{"use strict";var Cn=o$.exports=function(t,e,n){typeof e=="function"&&(n=e,e={}),n=e.cb||n;var i=typeof n=="function"?n:n.pre||function(){},r=n.post||function(){};Xl(e,i,r,t,"",t)};Cn.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Cn.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Cn.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Cn.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 Xl(t,e,n,i,r,o,s,c,u,d){if(i&&typeof i=="object"&&!Array.isArray(i)){e(i,r,o,s,c,u,d);for(var l in i){var p=i[l];if(Array.isArray(p)){if(l in Cn.arrayKeywords)for(var m=0;m<p.length;m++)Xl(t,e,n,p[m],r+"/"+l+"/"+m,o,r,l,i,m)}else if(l in Cn.propsKeywords){if(p&&typeof p=="object")for(var f in p)Xl(t,e,n,p[f],r+"/"+l+"/"+HC(f),o,r,l,i,f)}else(l in Cn.keywords||t.allKeys&&!(l in Cn.skipKeywords))&&Xl(t,e,n,p,r+"/"+l,o,r,l,i)}n(i,r,o,s,c,u,d)}}function HC(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}});var Ms=O(at=>{"use strict";Object.defineProperty(at,"__esModule",{value:!0});at.getSchemaRefs=at.resolveUrl=at.normalizeId=at._getFullPath=at.getFullPath=at.inlineRef=void 0;var KC=oe(),GC=Cg(),WC=s$(),JC=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function YC(t,e=!0){return typeof t=="boolean"?!0:e===!0?!zg(t):e?a$(t)<=e:!1}at.inlineRef=YC;var XC=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function zg(t){for(let e in t){if(XC.has(e))return!0;let n=t[e];if(Array.isArray(n)&&n.some(zg)||typeof n=="object"&&zg(n))return!0}return!1}function a$(t){let e=0;for(let n in t){if(n==="$ref")return 1/0;if(e++,!JC.has(n)&&(typeof t[n]=="object"&&(0,KC.eachItem)(t[n],i=>e+=a$(i)),e===1/0))return 1/0}return e}function c$(t,e="",n){n!==!1&&(e=Ei(e));let i=t.parse(e);return u$(t,i)}at.getFullPath=c$;function u$(t,e){return t.serialize(e).split("#")[0]+"#"}at._getFullPath=u$;var QC=/#\/?$/;function Ei(t){return t?t.replace(QC,""):""}at.normalizeId=Ei;function ez(t,e,n){return n=Ei(n),t.resolve(e,n)}at.resolveUrl=ez;var tz=/^[a-z_][-a-z0-9._]*$/i;function nz(t,e){if(typeof t=="boolean")return{};let{schemaId:n,uriResolver:i}=this.opts,r=Ei(t[n]||e),o={"":r},s=c$(i,r,!1),c={},u=new Set;return WC(t,{allKeys:!0},(p,m,f,h)=>{if(h===void 0)return;let y=s+m,v=o[h];typeof p[n]=="string"&&(v=E.call(this,p[n])),C.call(this,p.$anchor),C.call(this,p.$dynamicAnchor),o[m]=v;function E(z){let j=this.opts.uriResolver.resolve;if(z=Ei(v?j(v,z):z),u.has(z))throw l(z);u.add(z);let D=this.refs[z];return typeof D=="string"&&(D=this.refs[D]),typeof D=="object"?d(p,D.schema,z):z!==Ei(y)&&(z[0]==="#"?(d(p,c[z],z),c[z]=p):this.refs[z]=y),z}function C(z){if(typeof z=="string"){if(!tz.test(z))throw new Error(`invalid anchor "${z}"`);E.call(this,`#${z}`)}}}),c;function d(p,m,f){if(m!==void 0&&!GC(p,m))throw l(f)}function l(p){return new Error(`reference "${p}" resolves to more than one schema`)}}at.getSchemaRefs=nz});var Fs=O(zn=>{"use strict";Object.defineProperty(zn,"__esModule",{value:!0});zn.getData=zn.KeywordCxt=zn.validateFunctionCode=void 0;var f$=BS(),l$=Us(),jg=Eg(),Ql=Us(),rz=JS(),Zs=t$(),Dg=r$(),Z=Y(),H=sn(),iz=Ms(),an=oe(),Ls=js();function oz(t){if(b$(t)&&(_$(t),g$(t))){cz(t);return}h$(t,()=>(0,f$.topBoolOrEmptySchema)(t))}zn.validateFunctionCode=oz;function h$({gen:t,validateName:e,schema:n,schemaEnv:i,opts:r},o){r.code.es5?t.func(e,(0,Z._)`${H.default.data}, ${H.default.valCxt}`,i.$async,()=>{t.code((0,Z._)`"use strict"; ${d$(n,r)}`),az(t,r),t.code(o)}):t.func(e,(0,Z._)`${H.default.data}, ${sz(r)}`,i.$async,()=>t.code(d$(n,r)).code(o))}function sz(t){return(0,Z._)`{${H.default.instancePath}="", ${H.default.parentData}, ${H.default.parentDataProperty}, ${H.default.rootData}=${H.default.data}${t.dynamicRef?(0,Z._)`, ${H.default.dynamicAnchors}={}`:Z.nil}}={}`}function az(t,e){t.if(H.default.valCxt,()=>{t.var(H.default.instancePath,(0,Z._)`${H.default.valCxt}.${H.default.instancePath}`),t.var(H.default.parentData,(0,Z._)`${H.default.valCxt}.${H.default.parentData}`),t.var(H.default.parentDataProperty,(0,Z._)`${H.default.valCxt}.${H.default.parentDataProperty}`),t.var(H.default.rootData,(0,Z._)`${H.default.valCxt}.${H.default.rootData}`),e.dynamicRef&&t.var(H.default.dynamicAnchors,(0,Z._)`${H.default.valCxt}.${H.default.dynamicAnchors}`)},()=>{t.var(H.default.instancePath,(0,Z._)`""`),t.var(H.default.parentData,(0,Z._)`undefined`),t.var(H.default.parentDataProperty,(0,Z._)`undefined`),t.var(H.default.rootData,H.default.data),e.dynamicRef&&t.var(H.default.dynamicAnchors,(0,Z._)`{}`)})}function cz(t){let{schema:e,opts:n,gen:i}=t;h$(t,()=>{n.$comment&&e.$comment&&v$(t),mz(t),i.let(H.default.vErrors,null),i.let(H.default.errors,0),n.unevaluated&&uz(t),y$(t),gz(t)})}function uz(t){let{gen:e,validateName:n}=t;t.evaluated=e.const("evaluated",(0,Z._)`${n}.evaluated`),e.if((0,Z._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,Z._)`${t.evaluated}.props`,(0,Z._)`undefined`)),e.if((0,Z._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,Z._)`${t.evaluated}.items`,(0,Z._)`undefined`))}function d$(t,e){let n=typeof t=="object"&&t[e.schemaId];return n&&(e.code.source||e.code.process)?(0,Z._)`/*# sourceURL=${n} */`:Z.nil}function lz(t,e){if(b$(t)&&(_$(t),g$(t))){dz(t,e);return}(0,f$.boolOrEmptySchema)(t,e)}function g$({schema:t,self:e}){if(typeof t=="boolean")return!t;for(let n in t)if(e.RULES.all[n])return!0;return!1}function b$(t){return typeof t.schema!="boolean"}function dz(t,e){let{schema:n,gen:i,opts:r}=t;r.$comment&&n.$comment&&v$(t),fz(t),hz(t);let o=i.const("_errs",H.default.errors);y$(t,o),i.var(e,(0,Z._)`${o} === ${H.default.errors}`)}function _$(t){(0,an.checkUnknownRules)(t),pz(t)}function y$(t,e){if(t.opts.jtd)return p$(t,[],!1,e);let n=(0,l$.getSchemaTypes)(t.schema),i=(0,l$.coerceAndCheckDataType)(t,n);p$(t,n,!i,e)}function pz(t){let{schema:e,errSchemaPath:n,opts:i,self:r}=t;e.$ref&&i.ignoreKeywordsWithRef&&(0,an.schemaHasRulesButRef)(e,r.RULES)&&r.logger.warn(`$ref: keywords ignored in schema at path "${n}"`)}function mz(t){let{schema:e,opts:n}=t;e.default!==void 0&&n.useDefaults&&n.strictSchema&&(0,an.checkStrictMode)(t,"default is ignored in the schema root")}function fz(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,iz.resolveUrl)(t.opts.uriResolver,t.baseId,e))}function hz(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function v$({gen:t,schemaEnv:e,schema:n,errSchemaPath:i,opts:r}){let o=n.$comment;if(r.$comment===!0)t.code((0,Z._)`${H.default.self}.logger.log(${o})`);else if(typeof r.$comment=="function"){let s=(0,Z.str)`${i}/$comment`,c=t.scopeValue("root",{ref:e.root});t.code((0,Z._)`${H.default.self}.opts.$comment(${o}, ${s}, ${c}.schema)`)}}function gz(t){let{gen:e,schemaEnv:n,validateName:i,ValidationError:r,opts:o}=t;n.$async?e.if((0,Z._)`${H.default.errors} === 0`,()=>e.return(H.default.data),()=>e.throw((0,Z._)`new ${r}(${H.default.vErrors})`)):(e.assign((0,Z._)`${i}.errors`,H.default.vErrors),o.unevaluated&&bz(t),e.return((0,Z._)`${H.default.errors} === 0`))}function bz({gen:t,evaluated:e,props:n,items:i}){n instanceof Z.Name&&t.assign((0,Z._)`${e}.props`,n),i instanceof Z.Name&&t.assign((0,Z._)`${e}.items`,i)}function p$(t,e,n,i){let{gen:r,schema:o,data:s,allErrors:c,opts:u,self:d}=t,{RULES:l}=d;if(o.$ref&&(u.ignoreKeywordsWithRef||!(0,an.schemaHasRulesButRef)(o,l))){r.block(()=>x$(t,"$ref",l.all.$ref.definition));return}u.jtd||_z(t,e),r.block(()=>{for(let m of l.rules)p(m);p(l.post)});function p(m){(0,jg.shouldUseGroup)(o,m)&&(m.type?(r.if((0,Ql.checkDataType)(m.type,s,u.strictNumbers)),m$(t,m),e.length===1&&e[0]===m.type&&n&&(r.else(),(0,Ql.reportTypeError)(t)),r.endIf()):m$(t,m),c||r.if((0,Z._)`${H.default.errors} === ${i||0}`))}}function m$(t,e){let{gen:n,schema:i,opts:{useDefaults:r}}=t;r&&(0,rz.assignDefaults)(t,e.type),n.block(()=>{for(let o of e.rules)(0,jg.shouldUseRule)(i,o)&&x$(t,o.keyword,o.definition,e.type)})}function _z(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(yz(t,e),t.opts.allowUnionTypes||vz(t,e),kz(t,t.dataTypes))}function yz(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(n=>{k$(t.dataTypes,n)||Ug(t,`type "${n}" not allowed by context "${t.dataTypes.join(",")}"`)}),Sz(t,e)}}function vz(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&Ug(t,"use allowUnionTypes to allow union type keyword")}function kz(t,e){let n=t.self.RULES.all;for(let i in n){let r=n[i];if(typeof r=="object"&&(0,jg.shouldUseRule)(t.schema,r)){let{type:o}=r.definition;o.length&&!o.some(s=>xz(e,s))&&Ug(t,`missing type "${o.join(",")}" for keyword "${i}"`)}}}function xz(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}function k$(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}function Sz(t,e){let n=[];for(let i of t.dataTypes)k$(e,i)?n.push(i):e.includes("integer")&&i==="number"&&n.push("integer");t.dataTypes=n}function Ug(t,e){let n=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${n}" (strictTypes)`,(0,an.checkStrictMode)(t,e,t.opts.strictTypes)}var ed=class{constructor(e,n,i){if((0,Zs.validateKeywordUsage)(e,n,i),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=i,this.data=e.data,this.schema=e.schema[i],this.$data=n.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,an.schemaRefOrVal)(e,this.schema,i,this.$data),this.schemaType=n.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=n,this.$data)this.schemaCode=e.gen.const("vSchema",S$(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,Zs.validSchemaType)(this.schema,n.schemaType,n.allowUndefined))throw new Error(`${i} value must be ${JSON.stringify(n.schemaType)}`);("code"in n?n.trackErrors:n.errors!==!1)&&(this.errsCount=e.gen.const("_errs",H.default.errors))}result(e,n,i){this.failResult((0,Z.not)(e),n,i)}failResult(e,n,i){this.gen.if(e),i?i():this.error(),n?(this.gen.else(),n(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,n){this.failResult((0,Z.not)(e),void 0,n)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:n}=this;this.fail((0,Z._)`${n} !== undefined && (${(0,Z.or)(this.invalid$data(),e)})`)}error(e,n,i){if(n){this.setParams(n),this._error(e,i),this.setParams({});return}this._error(e,i)}_error(e,n){(e?Ls.reportExtraError:Ls.reportError)(this,this.def.error,n)}$dataError(){(0,Ls.reportError)(this,this.def.$dataError||Ls.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,Ls.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,n){n?Object.assign(this.params,e):this.params=e}block$data(e,n,i=Z.nil){this.gen.block(()=>{this.check$data(e,i),n()})}check$data(e=Z.nil,n=Z.nil){if(!this.$data)return;let{gen:i,schemaCode:r,schemaType:o,def:s}=this;i.if((0,Z.or)((0,Z._)`${r} === undefined`,n)),e!==Z.nil&&i.assign(e,!0),(o.length||s.validateSchema)&&(i.elseIf(this.invalid$data()),this.$dataError(),e!==Z.nil&&i.assign(e,!1)),i.else()}invalid$data(){let{gen:e,schemaCode:n,schemaType:i,def:r,it:o}=this;return(0,Z.or)(s(),c());function s(){if(i.length){if(!(n instanceof Z.Name))throw new Error("ajv implementation error");let u=Array.isArray(i)?i:[i];return(0,Z._)`${(0,Ql.checkDataTypes)(u,n,o.opts.strictNumbers,Ql.DataType.Wrong)}`}return Z.nil}function c(){if(r.validateSchema){let u=e.scopeValue("validate$data",{ref:r.validateSchema});return(0,Z._)`!${u}(${n})`}return Z.nil}}subschema(e,n){let i=(0,Dg.getSubschema)(this.it,e);(0,Dg.extendSubschemaData)(i,this.it,e),(0,Dg.extendSubschemaMode)(i,e);let r={...this.it,...i,items:void 0,props:void 0};return lz(r,n),r}mergeEvaluated(e,n){let{it:i,gen:r}=this;i.opts.unevaluated&&(i.props!==!0&&e.props!==void 0&&(i.props=an.mergeEvaluated.props(r,e.props,i.props,n)),i.items!==!0&&e.items!==void 0&&(i.items=an.mergeEvaluated.items(r,e.items,i.items,n)))}mergeValidEvaluated(e,n){let{it:i,gen:r}=this;if(i.opts.unevaluated&&(i.props!==!0||i.items!==!0))return r.if(n,()=>this.mergeEvaluated(e,Z.Name)),!0}};zn.KeywordCxt=ed;function x$(t,e,n,i){let r=new ed(t,n,e);"code"in n?n.code(r,i):r.$data&&n.validate?(0,Zs.funcKeywordCode)(r,n):"macro"in n?(0,Zs.macroKeywordCode)(r,n):(n.compile||n.validate)&&(0,Zs.funcKeywordCode)(r,n)}var $z=/^\/(?:[^~]|~0|~1)*$/,Iz=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function S$(t,{dataLevel:e,dataNames:n,dataPathArr:i}){let r,o;if(t==="")return H.default.rootData;if(t[0]==="/"){if(!$z.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);r=t,o=H.default.rootData}else{let d=Iz.exec(t);if(!d)throw new Error(`Invalid JSON-pointer: ${t}`);let l=+d[1];if(r=d[2],r==="#"){if(l>=e)throw new Error(u("property/index",l));return i[e-l]}if(l>e)throw new Error(u("data",l));if(o=n[e-l],!r)return o}let s=o,c=r.split("/");for(let d of c)d&&(o=(0,Z._)`${o}${(0,Z.getProperty)((0,an.unescapeJsonPointer)(d))}`,s=(0,Z._)`${s} && ${o}`);return s;function u(d,l){return`Cannot access ${d} ${l} levels up, current level is ${e}`}}zn.getData=S$});var td=O(Lg=>{"use strict";Object.defineProperty(Lg,"__esModule",{value:!0});var Mg=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};Lg.default=Mg});var Bs=O(Bg=>{"use strict";Object.defineProperty(Bg,"__esModule",{value:!0});var Zg=Ms(),Fg=class extends Error{constructor(e,n,i,r){super(r||`can't resolve reference ${i} from id ${n}`),this.missingRef=(0,Zg.resolveUrl)(e,n,i),this.missingSchema=(0,Zg.normalizeId)((0,Zg.getFullPath)(e,this.missingRef))}};Bg.default=Fg});var rd=O(St=>{"use strict";Object.defineProperty(St,"__esModule",{value:!0});St.resolveSchema=St.getCompilingSchema=St.resolveRef=St.compileSchema=St.SchemaEnv=void 0;var Ct=Y(),wz=td(),lr=sn(),zt=Ms(),$$=oe(),Ez=Fs(),Ti=class{constructor(e){var n;this.refs={},this.dynamicAnchors={};let i;typeof e.schema=="object"&&(i=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(n=e.baseId)!==null&&n!==void 0?n:(0,zt.normalizeId)(i?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=i?.$async,this.refs={}}};St.SchemaEnv=Ti;function Vg(t){let e=I$.call(this,t);if(e)return e;let n=(0,zt.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:i,lines:r}=this.opts.code,{ownProperties:o}=this.opts,s=new Ct.CodeGen(this.scope,{es5:i,lines:r,ownProperties:o}),c;t.$async&&(c=s.scopeValue("Error",{ref:wz.default,code:(0,Ct._)`require("ajv/dist/runtime/validation_error").default`}));let u=s.scopeName("validate");t.validateName=u;let d={gen:s,allErrors:this.opts.allErrors,data:lr.default.data,parentData:lr.default.parentData,parentDataProperty:lr.default.parentDataProperty,dataNames:[lr.default.data],dataPathArr:[Ct.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:s.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,Ct.stringify)(t.schema)}:{ref:t.schema}),validateName:u,ValidationError:c,schema:t.schema,schemaEnv:t,rootId:n,baseId:t.baseId||n,schemaPath:Ct.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Ct._)`""`,opts:this.opts,self:this},l;try{this._compilations.add(t),(0,Ez.validateFunctionCode)(d),s.optimize(this.opts.code.optimize);let p=s.toString();l=`${s.scopeRefs(lr.default.scope)}return ${p}`,this.opts.code.process&&(l=this.opts.code.process(l,t));let f=new Function(`${lr.default.self}`,`${lr.default.scope}`,l)(this,this.scope.get());if(this.scope.value(u,{ref:f}),f.errors=null,f.schema=t.schema,f.schemaEnv=t,t.$async&&(f.$async=!0),this.opts.code.source===!0&&(f.source={validateName:u,validateCode:p,scopeValues:s._values}),this.opts.unevaluated){let{props:h,items:y}=d;f.evaluated={props:h instanceof Ct.Name?void 0:h,items:y instanceof Ct.Name?void 0:y,dynamicProps:h instanceof Ct.Name,dynamicItems:y instanceof Ct.Name},f.source&&(f.source.evaluated=(0,Ct.stringify)(f.evaluated))}return t.validate=f,t}catch(p){throw delete t.validate,delete t.validateName,l&&this.logger.error("Error compiling schema, function code:",l),p}finally{this._compilations.delete(t)}}St.compileSchema=Vg;function Tz(t,e,n){var i;n=(0,zt.resolveUrl)(this.opts.uriResolver,e,n);let r=t.refs[n];if(r)return r;let o=Pz.call(this,t,n);if(o===void 0){let s=(i=t.localRefs)===null||i===void 0?void 0:i[n],{schemaId:c}=this.opts;s&&(o=new Ti({schema:s,schemaId:c,root:t,baseId:e}))}if(o!==void 0)return t.refs[n]=Rz.call(this,o)}St.resolveRef=Tz;function Rz(t){return(0,zt.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:Vg.call(this,t)}function I$(t){for(let e of this._compilations)if(Oz(e,t))return e}St.getCompilingSchema=I$;function Oz(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function Pz(t,e){let n;for(;typeof(n=this.refs[e])=="string";)e=n;return n||this.schemas[e]||nd.call(this,t,e)}function nd(t,e){let n=this.opts.uriResolver.parse(e),i=(0,zt._getFullPath)(this.opts.uriResolver,n),r=(0,zt.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&i===r)return qg.call(this,n,t);let o=(0,zt.normalizeId)(i),s=this.refs[o]||this.schemas[o];if(typeof s=="string"){let c=nd.call(this,t,s);return typeof c?.schema!="object"?void 0:qg.call(this,n,c)}if(typeof s?.schema=="object"){if(s.validate||Vg.call(this,s),o===(0,zt.normalizeId)(e)){let{schema:c}=s,{schemaId:u}=this.opts,d=c[u];return d&&(r=(0,zt.resolveUrl)(this.opts.uriResolver,r,d)),new Ti({schema:c,schemaId:u,root:t,baseId:r})}return qg.call(this,n,s)}}St.resolveSchema=nd;var Az=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function qg(t,{baseId:e,schema:n,root:i}){var r;if(((r=t.fragment)===null||r===void 0?void 0:r[0])!=="/")return;for(let c of t.fragment.slice(1).split("/")){if(typeof n=="boolean")return;let u=n[(0,$$.unescapeFragment)(c)];if(u===void 0)return;n=u;let d=typeof n=="object"&&n[this.opts.schemaId];!Az.has(c)&&d&&(e=(0,zt.resolveUrl)(this.opts.uriResolver,e,d))}let o;if(typeof n!="boolean"&&n.$ref&&!(0,$$.schemaHasRulesButRef)(n,this.RULES)){let c=(0,zt.resolveUrl)(this.opts.uriResolver,e,n.$ref);o=nd.call(this,i,c)}let{schemaId:s}=this.opts;if(o=o||new Ti({schema:n,schemaId:s,root:i,baseId:e}),o.schema!==o.root.schema)return o}});var w$=O((R9,Nz)=>{Nz.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 Gg=O((O9,A$)=>{"use strict";var Cz=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),T$=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),Hg=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),R$=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),zz=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function Kg(t){let e="",n=0,i=0;for(i=0;i<t.length;i++)if(n=t[i].charCodeAt(0),n!==48){if(!(n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102))return"";e+=t[i];break}for(i+=1;i<t.length;i++){if(n=t[i].charCodeAt(0),!(n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102))return"";e+=t[i]}return e}var Dz=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function E$(t){return t.length=0,!0}function jz(t,e,n){if(t.length){let i=Kg(t);if(i!=="")e.push(i);else return n.error=!0,!1;t.length=0}return!0}function Uz(t){let e=0,n={error:!1,address:"",zone:""},i=[],r=[],o=!1,s=!1,c=jz;for(let u=0;u<t.length;u++){let d=t[u];if(!(d==="["||d==="]"))if(d===":"){if(o===!0&&(s=!0),!c(r,i,n))break;if(++e>7){n.error=!0;break}u>0&&t[u-1]===":"&&(o=!0),i.push(":");continue}else if(d==="%"){if(!c(r,i,n))break;c=E$}else{r.push(d);continue}}return r.length&&(c===E$?n.zone=r.join(""):s?i.push(r.join("")):i.push(Kg(r))),n.address=i.join(""),n}function O$(t){if(Mz(t,":")<2)return{host:t,isIPV6:!1};let e=Uz(t);if(e.error)return{host:t,isIPV6:!1};{let n=e.address,i=e.address;return e.zone&&(n+="%"+e.zone,i+="%25"+e.zone),{host:n,isIPV6:!0,escapedHost:i}}}function Mz(t,e){let n=0;for(let i=0;i<t.length;i++)t[i]===e&&n++;return n}function Lz(t){let e=t,n=[],i=-1,r=0;for(;r=e.length;){if(r===1){if(e===".")break;if(e==="/"){n.push("/");break}else{n.push(e);break}}else if(r===2){if(e[0]==="."){if(e[1]===".")break;if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&(e[1]==="."||e[1]==="/")){n.push("/");break}}else if(r===3&&e==="/.."){n.length!==0&&n.pop(),n.push("/");break}if(e[0]==="."){if(e[1]==="."){if(e[2]==="/"){e=e.slice(3);continue}}else if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&e[1]==="."){if(e[2]==="/"){e=e.slice(2);continue}else if(e[2]==="."&&e[3]==="/"){e=e.slice(3),n.length!==0&&n.pop();continue}}if((i=e.indexOf("/",1))===-1){n.push(e);break}else n.push(e.slice(0,i)),e=e.slice(i)}return n.join("")}var Zz={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},Fz=/[@/?#:]/g,Bz=/[@/?#]/g;function P$(t,e){let n=e?Bz:Fz;return n.lastIndex=0,t.replace(n,i=>Zz[i])}function qz(t,e=!1){if(t.indexOf("%")===-1)return t;let n="";for(let i=0;i<t.length;i++){if(t[i]==="%"&&i+2<t.length){let r=t.slice(i+1,i+3);if(Hg(r)){let o=r.toUpperCase(),s=String.fromCharCode(parseInt(o,16));e&&R$(s)?n+=s:n+="%"+o,i+=2;continue}}n+=t[i]}return n}function Vz(t){let e="";for(let n=0;n<t.length;n++){if(t[n]==="%"&&n+2<t.length){let i=t.slice(n+1,n+3);if(Hg(i)){let r=i.toUpperCase(),o=String.fromCharCode(parseInt(r,16));o!=="."&&R$(o)?e+=o:e+="%"+r,n+=2;continue}}zz(t[n])?e+=t[n]:e+=escape(t[n])}return e}function Hz(t){let e="";for(let n=0;n<t.length;n++){if(t[n]==="%"&&n+2<t.length){let i=t.slice(n+1,n+3);if(Hg(i)){e+="%"+i.toUpperCase(),n+=2;continue}}e+=escape(t[n])}return e}function Kz(t){let e=[];if(t.userinfo!==void 0&&(e.push(t.userinfo),e.push("@")),t.host!==void 0){let n=unescape(t.host);if(!T$(n)){let i=O$(n);i.isIPV6===!0?n=`[${i.escapedHost}]`:n=P$(n,!1)}e.push(n)}return(typeof t.port=="number"||typeof t.port=="string")&&(e.push(":"),e.push(String(t.port))),e.length?e.join(""):void 0}A$.exports={nonSimpleDomain:Dz,recomposeAuthority:Kz,reescapeHostDelimiters:P$,normalizePercentEncoding:qz,normalizePathEncoding:Vz,escapePreservingEscapes:Hz,removeDotSegments:Lz,isIPv4:T$,isUUID:Cz,normalizeIPv6:O$,stringArrayToHexStripped:Kg}});var j$=O((P9,D$)=>{"use strict";var{isUUID:Gz}=Gg(),Wz=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,Jz=["http","https","ws","wss","urn","urn:uuid"];function Yz(t){return Jz.indexOf(t)!==-1}function Wg(t){return t.secure===!0?!0:t.secure===!1?!1:t.scheme?t.scheme.length===3&&(t.scheme[0]==="w"||t.scheme[0]==="W")&&(t.scheme[1]==="s"||t.scheme[1]==="S")&&(t.scheme[2]==="s"||t.scheme[2]==="S"):!1}function N$(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}function C$(t){let e=String(t.scheme).toLowerCase()==="https";return(t.port===(e?443:80)||t.port==="")&&(t.port=void 0),t.path||(t.path="/"),t}function Xz(t){return t.secure=Wg(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}function Qz(t){if((t.port===(Wg(t)?443:80)||t.port==="")&&(t.port=void 0),typeof t.secure=="boolean"&&(t.scheme=t.secure?"wss":"ws",t.secure=void 0),t.resourceName){let[e,n]=t.resourceName.split("?");t.path=e&&e!=="/"?e:void 0,t.query=n,t.resourceName=void 0}return t.fragment=void 0,t}function eD(t,e){if(!t.path)return t.error="URN can not be parsed",t;let n=t.path.match(Wz);if(n){let i=e.scheme||t.scheme||"urn";t.nid=n[1].toLowerCase(),t.nss=n[2];let r=`${i}:${e.nid||t.nid}`,o=Jg(r);t.path=void 0,o&&(t=o.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}function tD(t,e){if(t.nid===void 0)throw new Error("URN without nid cannot be serialized");let n=e.scheme||t.scheme||"urn",i=t.nid.toLowerCase(),r=`${n}:${e.nid||i}`,o=Jg(r);o&&(t=o.serialize(t,e));let s=t,c=t.nss;return s.path=`${i||e.nid}:${c}`,e.skipEscape=!0,s}function nD(t,e){let n=t;return n.uuid=n.nss,n.nss=void 0,!e.tolerant&&(!n.uuid||!Gz(n.uuid))&&(n.error=n.error||"UUID is not valid."),n}function rD(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}var z$={scheme:"http",domainHost:!0,parse:N$,serialize:C$},iD={scheme:"https",domainHost:z$.domainHost,parse:N$,serialize:C$},id={scheme:"ws",domainHost:!0,parse:Xz,serialize:Qz},oD={scheme:"wss",domainHost:id.domainHost,parse:id.parse,serialize:id.serialize},sD={scheme:"urn",parse:eD,serialize:tD,skipNormalize:!0},aD={scheme:"urn:uuid",parse:nD,serialize:rD,skipNormalize:!0},od={http:z$,https:iD,ws:id,wss:oD,urn:sD,"urn:uuid":aD};Object.setPrototypeOf(od,null);function Jg(t){return t&&(od[t]||od[t.toLowerCase()])||void 0}D$.exports={wsIsSecure:Wg,SCHEMES:od,isValidSchemeName:Yz,getSchemeHandler:Jg}});var B$=O((A9,sd)=>{"use strict";var{normalizeIPv6:cD,removeDotSegments:qs,recomposeAuthority:uD,normalizePercentEncoding:lD,normalizePathEncoding:dD,escapePreservingEscapes:pD,reescapeHostDelimiters:mD,isIPv4:fD,nonSimpleDomain:hD}=Gg(),{SCHEMES:gD,getSchemeHandler:M$}=j$();function bD(t,e){return typeof t=="string"?t=SD(t,e):typeof t=="object"&&(t=Ri(dr(t,e),e)),t}function _D(t,e,n){let i=n?Object.assign({scheme:"null"},n):{scheme:"null"},r=L$(Ri(t,i),Ri(e,i),i,!0);return i.skipEscape=!0,dr(r,i)}function L$(t,e,n,i){let r={};return i||(t=Ri(dr(t,n),n),e=Ri(dr(e,n),n)),n=n||{},!n.tolerant&&e.scheme?(r.scheme=e.scheme,r.userinfo=e.userinfo,r.host=e.host,r.port=e.port,r.path=qs(e.path||""),r.query=e.query):(e.userinfo!==void 0||e.host!==void 0||e.port!==void 0?(r.userinfo=e.userinfo,r.host=e.host,r.port=e.port,r.path=qs(e.path||""),r.query=e.query):(e.path?(e.path[0]==="/"?r.path=qs(e.path):((t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)&&!t.path?r.path="/"+e.path:t.path?r.path=t.path.slice(0,t.path.lastIndexOf("/")+1)+e.path:r.path=e.path,r.path=qs(r.path)),r.query=e.query):(r.path=t.path,e.query!==void 0?r.query=e.query:r.query=t.query),r.userinfo=t.userinfo,r.host=t.host,r.port=t.port),r.scheme=t.scheme),r.fragment=e.fragment,r}function yD(t,e,n){let i=U$(t,n),r=U$(e,n);return i!==void 0&&r!==void 0&&i.toLowerCase()===r.toLowerCase()}function dr(t,e){let n={host:t.host,scheme:t.scheme,userinfo:t.userinfo,port:t.port,path:t.path,query:t.query,nid:t.nid,nss:t.nss,uuid:t.uuid,fragment:t.fragment,reference:t.reference,resourceName:t.resourceName,secure:t.secure,error:""},i=Object.assign({},e),r=[],o=M$(i.scheme||n.scheme);o&&o.serialize&&o.serialize(n,i),n.path!==void 0&&(i.skipEscape?n.path=lD(n.path):(n.path=pD(n.path),n.scheme!==void 0&&(n.path=n.path.split("%3A").join(":")))),i.reference!=="suffix"&&n.scheme&&r.push(n.scheme,":");let s=uD(n);if(s!==void 0&&(i.reference!=="suffix"&&r.push("//"),r.push(s),n.path&&n.path[0]!=="/"&&r.push("/")),n.path!==void 0){let c=n.path;!i.absolutePath&&(!o||!o.absolutePath)&&(c=qs(c)),s===void 0&&c[0]==="/"&&c[1]==="/"&&(c="/%2F"+c.slice(2)),r.push(c)}return n.query!==void 0&&r.push("?",n.query),n.fragment!==void 0&&r.push("#",n.fragment),r.join("")}var vD=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u,kD=/^(?:[^#/:?]+:)?\/\/([^/?#]*)/;function xD(t,e){if(e[2]!==void 0&&t.path&&t.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof t.port=="number"&&(t.port<0||t.port>65535))return"URI port is malformed."}function Z$(t,e){let n=Object.assign({},e),i={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},r=!1,o=!1;n.reference==="suffix"&&(n.scheme?t=n.scheme+":"+t:t="//"+t);let s=t.match(kD);s!==null&&s[1].indexOf("\\")!==-1&&(i.error="URI authority must not contain a literal backslash.",r=!0);let c=t.match(vD);if(c){i.scheme=c[1],i.userinfo=c[3],i.host=c[4],i.port=parseInt(c[5],10),i.path=c[6]||"",i.query=c[7],i.fragment=c[8],isNaN(i.port)&&(i.port=c[5]);let u=xD(i,c);if(u!==void 0&&(i.error=i.error||u,r=!0),i.host)if(fD(i.host)===!1){let p=cD(i.host);i.host=p.host.toLowerCase(),o=p.isIPV6}else o=!0;i.scheme===void 0&&i.userinfo===void 0&&i.host===void 0&&i.port===void 0&&i.query===void 0&&!i.path?i.reference="same-document":i.scheme===void 0?i.reference="relative":i.fragment===void 0?i.reference="absolute":i.reference="uri",n.reference&&n.reference!=="suffix"&&n.reference!==i.reference&&(i.error=i.error||"URI is not a "+n.reference+" reference.");let d=M$(n.scheme||i.scheme);if(!n.unicodeSupport&&(!d||!d.unicodeSupport)&&i.host&&(n.domainHost||d&&d.domainHost)&&o===!1&&hD(i.host))try{i.host=new URL("http://"+i.host).hostname}catch(l){i.error=i.error||"Host's domain name can not be converted to ASCII: "+l}if((!d||d&&!d.skipNormalize)&&(t.indexOf("%")!==-1&&(i.scheme!==void 0&&(i.scheme=unescape(i.scheme)),i.host!==void 0&&(i.host=mD(unescape(i.host),o))),i.path&&(i.path=dD(i.path)),i.fragment))try{i.fragment=encodeURI(decodeURIComponent(i.fragment))}catch{i.error=i.error||"URI malformed"}d&&d.parse&&d.parse(i,n)}else i.error=i.error||"URI can not be parsed.";return{parsed:i,malformedAuthorityOrPort:r}}function Ri(t,e){return Z$(t,e).parsed}function SD(t,e){return F$(t,e).normalized}function F$(t,e){let{parsed:n,malformedAuthorityOrPort:i}=Z$(t,e);return{normalized:i?t:dr(n,e),malformedAuthorityOrPort:i}}function U$(t,e){if(typeof t=="string"){let{normalized:n,malformedAuthorityOrPort:i}=F$(t,e);return i?void 0:n}if(typeof t=="object")return dr(t,e)}var Yg={SCHEMES:gD,normalize:bD,resolve:_D,resolveComponent:L$,equal:yD,serialize:dr,parse:Ri};sd.exports=Yg;sd.exports.default=Yg;sd.exports.fastUri=Yg});var V$=O(Xg=>{"use strict";Object.defineProperty(Xg,"__esModule",{value:!0});var q$=B$();q$.code='require("ajv/dist/runtime/uri").default';Xg.default=q$});var Q$=O(Le=>{"use strict";Object.defineProperty(Le,"__esModule",{value:!0});Le.CodeGen=Le.Name=Le.nil=Le.stringify=Le.str=Le._=Le.KeywordCxt=void 0;var $D=Fs();Object.defineProperty(Le,"KeywordCxt",{enumerable:!0,get:function(){return $D.KeywordCxt}});var Oi=Y();Object.defineProperty(Le,"_",{enumerable:!0,get:function(){return Oi._}});Object.defineProperty(Le,"str",{enumerable:!0,get:function(){return Oi.str}});Object.defineProperty(Le,"stringify",{enumerable:!0,get:function(){return Oi.stringify}});Object.defineProperty(Le,"nil",{enumerable:!0,get:function(){return Oi.nil}});Object.defineProperty(Le,"Name",{enumerable:!0,get:function(){return Oi.Name}});Object.defineProperty(Le,"CodeGen",{enumerable:!0,get:function(){return Oi.CodeGen}});var ID=td(),J$=Bs(),wD=wg(),Vs=rd(),ED=Y(),Hs=Ms(),ad=Us(),eb=oe(),H$=w$(),TD=V$(),Y$=(t,e)=>new RegExp(t,e);Y$.code="new RegExp";var RD=["removeAdditional","useDefaults","coerceTypes"],OD=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),PD={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."},AD={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},K$=200;function ND(t){var e,n,i,r,o,s,c,u,d,l,p,m,f,h,y,v,E,C,z,j,D,ut,ht,oo,ip;let so=t.strict,op=(e=t.code)===null||e===void 0?void 0:e.optimize,py=op===!0||op===void 0?1:op||0,my=(i=(n=t.code)===null||n===void 0?void 0:n.regExp)!==null&&i!==void 0?i:Y$,RR=(r=t.uriResolver)!==null&&r!==void 0?r:TD.default;return{strictSchema:(s=(o=t.strictSchema)!==null&&o!==void 0?o:so)!==null&&s!==void 0?s:!0,strictNumbers:(u=(c=t.strictNumbers)!==null&&c!==void 0?c:so)!==null&&u!==void 0?u:!0,strictTypes:(l=(d=t.strictTypes)!==null&&d!==void 0?d:so)!==null&&l!==void 0?l:"log",strictTuples:(m=(p=t.strictTuples)!==null&&p!==void 0?p:so)!==null&&m!==void 0?m:"log",strictRequired:(h=(f=t.strictRequired)!==null&&f!==void 0?f:so)!==null&&h!==void 0?h:!1,code:t.code?{...t.code,optimize:py,regExp:my}:{optimize:py,regExp:my},loopRequired:(y=t.loopRequired)!==null&&y!==void 0?y:K$,loopEnum:(v=t.loopEnum)!==null&&v!==void 0?v:K$,meta:(E=t.meta)!==null&&E!==void 0?E:!0,messages:(C=t.messages)!==null&&C!==void 0?C:!0,inlineRefs:(z=t.inlineRefs)!==null&&z!==void 0?z:!0,schemaId:(j=t.schemaId)!==null&&j!==void 0?j:"$id",addUsedSchema:(D=t.addUsedSchema)!==null&&D!==void 0?D:!0,validateSchema:(ut=t.validateSchema)!==null&&ut!==void 0?ut:!0,validateFormats:(ht=t.validateFormats)!==null&&ht!==void 0?ht:!0,unicodeRegExp:(oo=t.unicodeRegExp)!==null&&oo!==void 0?oo:!0,int32range:(ip=t.int32range)!==null&&ip!==void 0?ip:!0,uriResolver:RR}}var Ks=class{constructor(e={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...ND(e)};let{es5:n,lines:i}=this.opts.code;this.scope=new ED.ValueScope({scope:{},prefixes:OD,es5:n,lines:i}),this.logger=MD(e.logger);let r=e.validateFormats;e.validateFormats=!1,this.RULES=(0,wD.getRules)(),G$.call(this,PD,e,"NOT SUPPORTED"),G$.call(this,AD,e,"DEPRECATED","warn"),this._metaOpts=jD.call(this),e.formats&&zD.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&DD.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),CD.call(this),e.validateFormats=r}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:n,schemaId:i}=this.opts,r=H$;i==="id"&&(r={...H$},r.id=r.$id,delete r.$id),n&&e&&this.addMetaSchema(r,r[i],!1)}defaultMeta(){let{meta:e,schemaId:n}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[n]||e:void 0}validate(e,n){let i;if(typeof e=="string"){if(i=this.getSchema(e),!i)throw new Error(`no schema with key or ref "${e}"`)}else i=this.compile(e);let r=i(n);return"$async"in i||(this.errors=i.errors),r}compile(e,n){let i=this._addSchema(e,n);return i.validate||this._compileSchemaEnv(i)}compileAsync(e,n){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:i}=this.opts;return r.call(this,e,n);async function r(l,p){await o.call(this,l.$schema);let m=this._addSchema(l,p);return m.validate||s.call(this,m)}async function o(l){l&&!this.getSchema(l)&&await r.call(this,{$ref:l},!0)}async function s(l){try{return this._compileSchemaEnv(l)}catch(p){if(!(p instanceof J$.default))throw p;return c.call(this,p),await u.call(this,p.missingSchema),s.call(this,l)}}function c({missingSchema:l,missingRef:p}){if(this.refs[l])throw new Error(`AnySchema ${l} is loaded but ${p} cannot be resolved`)}async function u(l){let p=await d.call(this,l);this.refs[l]||await o.call(this,p.$schema),this.refs[l]||this.addSchema(p,l,n)}async function d(l){let p=this._loading[l];if(p)return p;try{return await(this._loading[l]=i(l))}finally{delete this._loading[l]}}}addSchema(e,n,i,r=this.opts.validateSchema){if(Array.isArray(e)){for(let s of e)this.addSchema(s,void 0,i,r);return this}let o;if(typeof e=="object"){let{schemaId:s}=this.opts;if(o=e[s],o!==void 0&&typeof o!="string")throw new Error(`schema ${s} must be string`)}return n=(0,Hs.normalizeId)(n||o),this._checkUnique(n),this.schemas[n]=this._addSchema(e,i,n,r,!0),this}addMetaSchema(e,n,i=this.opts.validateSchema){return this.addSchema(e,n,!0,i),this}validateSchema(e,n){if(typeof e=="boolean")return!0;let i;if(i=e.$schema,i!==void 0&&typeof i!="string")throw new Error("$schema must be a string");if(i=i||this.opts.defaultMeta||this.defaultMeta(),!i)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let r=this.validate(i,e);if(!r&&n){let o="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(o);else throw new Error(o)}return r}getSchema(e){let n;for(;typeof(n=W$.call(this,e))=="string";)e=n;if(n===void 0){let{schemaId:i}=this.opts,r=new Vs.SchemaEnv({schema:{},schemaId:i});if(n=Vs.resolveSchema.call(this,r,e),!n)return;this.refs[e]=n}return n.validate||this._compileSchemaEnv(n)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let n=W$.call(this,e);return typeof n=="object"&&this._cache.delete(n.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{let n=e;this._cache.delete(n);let i=e[this.opts.schemaId];return i&&(i=(0,Hs.normalizeId)(i),delete this.schemas[i],delete this.refs[i]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let n of e)this.addKeyword(n);return this}addKeyword(e,n){let i;if(typeof e=="string")i=e,typeof n=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),n.keyword=i);else if(typeof e=="object"&&n===void 0){if(n=e,i=n.keyword,Array.isArray(i)&&!i.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(ZD.call(this,i,n),!n)return(0,eb.eachItem)(i,o=>Qg.call(this,o)),this;BD.call(this,n);let r={...n,type:(0,ad.getJSONTypes)(n.type),schemaType:(0,ad.getJSONTypes)(n.schemaType)};return(0,eb.eachItem)(i,r.type.length===0?o=>Qg.call(this,o,r):o=>r.type.forEach(s=>Qg.call(this,o,r,s))),this}getKeyword(e){let n=this.RULES.all[e];return typeof n=="object"?n.definition:!!n}removeKeyword(e){let{RULES:n}=this;delete n.keywords[e],delete n.all[e];for(let i of n.rules){let r=i.rules.findIndex(o=>o.keyword===e);r>=0&&i.rules.splice(r,1)}return this}addFormat(e,n){return typeof n=="string"&&(n=new RegExp(n)),this.formats[e]=n,this}errorsText(e=this.errors,{separator:n=", ",dataVar:i="data"}={}){return!e||e.length===0?"No errors":e.map(r=>`${i}${r.instancePath} ${r.message}`).reduce((r,o)=>r+n+o)}$dataMetaSchema(e,n){let i=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let r of n){let o=r.split("/").slice(1),s=e;for(let c of o)s=s[c];for(let c in i){let u=i[c];if(typeof u!="object")continue;let{$data:d}=u.definition,l=s[c];d&&l&&(s[c]=X$(l))}}return e}_removeAllSchemas(e,n){for(let i in e){let r=e[i];(!n||n.test(i))&&(typeof r=="string"?delete e[i]:r&&!r.meta&&(this._cache.delete(r.schema),delete e[i]))}}_addSchema(e,n,i,r=this.opts.validateSchema,o=this.opts.addUsedSchema){let s,{schemaId:c}=this.opts;if(typeof e=="object")s=e[c];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof e!="boolean")throw new Error("schema must be object or boolean")}let u=this._cache.get(e);if(u!==void 0)return u;i=(0,Hs.normalizeId)(s||i);let d=Hs.getSchemaRefs.call(this,e,i);return u=new Vs.SchemaEnv({schema:e,schemaId:c,meta:n,baseId:i,localRefs:d}),this._cache.set(u.schema,u),o&&!i.startsWith("#")&&(i&&this._checkUnique(i),this.refs[i]=u),r&&this.validateSchema(e,!0),u}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):Vs.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let n=this.opts;this.opts=this._metaOpts;try{Vs.compileSchema.call(this,e)}finally{this.opts=n}}};Ks.ValidationError=ID.default;Ks.MissingRefError=J$.default;Le.default=Ks;function G$(t,e,n,i="error"){for(let r in t){let o=r;o in e&&this.logger[i](`${n}: option ${r}. ${t[o]}`)}}function W$(t){return t=(0,Hs.normalizeId)(t),this.schemas[t]||this.refs[t]}function CD(){let t=this.opts.schemas;if(t)if(Array.isArray(t))this.addSchema(t);else for(let e in t)this.addSchema(t[e],e)}function zD(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}function DD(t){if(Array.isArray(t)){this.addVocabulary(t);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let e in t){let n=t[e];n.keyword||(n.keyword=e),this.addKeyword(n)}}function jD(){let t={...this.opts};for(let e of RD)delete t[e];return t}var UD={log(){},warn(){},error(){}};function MD(t){if(t===!1)return UD;if(t===void 0)return console;if(t.log&&t.warn&&t.error)return t;throw new Error("logger must implement log, warn and error methods")}var LD=/^[a-z_$][a-z0-9_$:-]*$/i;function ZD(t,e){let{RULES:n}=this;if((0,eb.eachItem)(t,i=>{if(n.keywords[i])throw new Error(`Keyword ${i} is already defined`);if(!LD.test(i))throw new Error(`Keyword ${i} has invalid name`)}),!!e&&e.$data&&!("code"in e||"validate"in e))throw new Error('$data keyword must have "code" or "validate" function')}function Qg(t,e,n){var i;let r=e?.post;if(n&&r)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:o}=this,s=r?o.post:o.rules.find(({type:u})=>u===n);if(s||(s={type:n,rules:[]},o.rules.push(s)),o.keywords[t]=!0,!e)return;let c={keyword:t,definition:{...e,type:(0,ad.getJSONTypes)(e.type),schemaType:(0,ad.getJSONTypes)(e.schemaType)}};e.before?FD.call(this,s,c,e.before):s.rules.push(c),o.all[t]=c,(i=e.implements)===null||i===void 0||i.forEach(u=>this.addKeyword(u))}function FD(t,e,n){let i=t.rules.findIndex(r=>r.keyword===n);i>=0?t.rules.splice(i,0,e):(t.rules.push(e),this.logger.warn(`rule ${n} is not defined`))}function BD(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=X$(e)),t.validateSchema=this.compile(e,!0))}var qD={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function X$(t){return{anyOf:[t,qD]}}});var eI=O(tb=>{"use strict";Object.defineProperty(tb,"__esModule",{value:!0});var VD={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};tb.default=VD});var iI=O(pr=>{"use strict";Object.defineProperty(pr,"__esModule",{value:!0});pr.callRef=pr.getValidate=void 0;var HD=Bs(),tI=xt(),ct=Y(),Pi=sn(),nI=rd(),cd=oe(),KD={keyword:"$ref",schemaType:"string",code(t){let{gen:e,schema:n,it:i}=t,{baseId:r,schemaEnv:o,validateName:s,opts:c,self:u}=i,{root:d}=o;if((n==="#"||n==="#/")&&r===d.baseId)return p();let l=nI.resolveRef.call(u,d,r,n);if(l===void 0)throw new HD.default(i.opts.uriResolver,r,n);if(l instanceof nI.SchemaEnv)return m(l);return f(l);function p(){if(o===d)return ud(t,s,o,o.$async);let h=e.scopeValue("root",{ref:d});return ud(t,(0,ct._)`${h}.validate`,d,d.$async)}function m(h){let y=rI(t,h);ud(t,y,h,h.$async)}function f(h){let y=e.scopeValue("schema",c.code.source===!0?{ref:h,code:(0,ct.stringify)(h)}:{ref:h}),v=e.name("valid"),E=t.subschema({schema:h,dataTypes:[],schemaPath:ct.nil,topSchemaRef:y,errSchemaPath:n},v);t.mergeEvaluated(E),t.ok(v)}}};function rI(t,e){let{gen:n}=t;return e.validate?n.scopeValue("validate",{ref:e.validate}):(0,ct._)`${n.scopeValue("wrapper",{ref:e})}.validate`}pr.getValidate=rI;function ud(t,e,n,i){let{gen:r,it:o}=t,{allErrors:s,schemaEnv:c,opts:u}=o,d=u.passContext?Pi.default.this:ct.nil;i?l():p();function l(){if(!c.$async)throw new Error("async schema referenced by sync schema");let h=r.let("valid");r.try(()=>{r.code((0,ct._)`await ${(0,tI.callValidateCode)(t,e,d)}`),f(e),s||r.assign(h,!0)},y=>{r.if((0,ct._)`!(${y} instanceof ${o.ValidationError})`,()=>r.throw(y)),m(y),s||r.assign(h,!1)}),t.ok(h)}function p(){t.result((0,tI.callValidateCode)(t,e,d),()=>f(e),()=>m(e))}function m(h){let y=(0,ct._)`${h}.errors`;r.assign(Pi.default.vErrors,(0,ct._)`${Pi.default.vErrors} === null ? ${y} : ${Pi.default.vErrors}.concat(${y})`),r.assign(Pi.default.errors,(0,ct._)`${Pi.default.vErrors}.length`)}function f(h){var y;if(!o.opts.unevaluated)return;let v=(y=n?.validate)===null||y===void 0?void 0:y.evaluated;if(o.props!==!0)if(v&&!v.dynamicProps)v.props!==void 0&&(o.props=cd.mergeEvaluated.props(r,v.props,o.props));else{let E=r.var("props",(0,ct._)`${h}.evaluated.props`);o.props=cd.mergeEvaluated.props(r,E,o.props,ct.Name)}if(o.items!==!0)if(v&&!v.dynamicItems)v.items!==void 0&&(o.items=cd.mergeEvaluated.items(r,v.items,o.items));else{let E=r.var("items",(0,ct._)`${h}.evaluated.items`);o.items=cd.mergeEvaluated.items(r,E,o.items,ct.Name)}}}pr.callRef=ud;pr.default=KD});var oI=O(nb=>{"use strict";Object.defineProperty(nb,"__esModule",{value:!0});var GD=eI(),WD=iI(),JD=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",GD.default,WD.default];nb.default=JD});var sI=O(rb=>{"use strict";Object.defineProperty(rb,"__esModule",{value:!0});var ld=Y(),Dn=ld.operators,dd={maximum:{okStr:"<=",ok:Dn.LTE,fail:Dn.GT},minimum:{okStr:">=",ok:Dn.GTE,fail:Dn.LT},exclusiveMaximum:{okStr:"<",ok:Dn.LT,fail:Dn.GTE},exclusiveMinimum:{okStr:">",ok:Dn.GT,fail:Dn.LTE}},YD={message:({keyword:t,schemaCode:e})=>(0,ld.str)`must be ${dd[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,ld._)`{comparison: ${dd[t].okStr}, limit: ${e}}`},XD={keyword:Object.keys(dd),type:"number",schemaType:"number",$data:!0,error:YD,code(t){let{keyword:e,data:n,schemaCode:i}=t;t.fail$data((0,ld._)`${n} ${dd[e].fail} ${i} || isNaN(${n})`)}};rb.default=XD});var aI=O(ib=>{"use strict";Object.defineProperty(ib,"__esModule",{value:!0});var Gs=Y(),QD={message:({schemaCode:t})=>(0,Gs.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,Gs._)`{multipleOf: ${t}}`},ej={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:QD,code(t){let{gen:e,data:n,schemaCode:i,it:r}=t,o=r.opts.multipleOfPrecision,s=e.let("res"),c=o?(0,Gs._)`Math.abs(Math.round(${s}) - ${s}) > 1e-${o}`:(0,Gs._)`${s} !== parseInt(${s})`;t.fail$data((0,Gs._)`(${i} === 0 || (${s} = ${n}/${i}, ${c}))`)}};ib.default=ej});var uI=O(ob=>{"use strict";Object.defineProperty(ob,"__esModule",{value:!0});function cI(t){let e=t.length,n=0,i=0,r;for(;i<e;)n++,r=t.charCodeAt(i++),r>=55296&&r<=56319&&i<e&&(r=t.charCodeAt(i),(r&64512)===56320&&i++);return n}ob.default=cI;cI.code='require("ajv/dist/runtime/ucs2length").default'});var lI=O(sb=>{"use strict";Object.defineProperty(sb,"__esModule",{value:!0});var mr=Y(),tj=oe(),nj=uI(),rj={message({keyword:t,schemaCode:e}){let n=t==="maxLength"?"more":"fewer";return(0,mr.str)`must NOT have ${n} than ${e} characters`},params:({schemaCode:t})=>(0,mr._)`{limit: ${t}}`},ij={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:rj,code(t){let{keyword:e,data:n,schemaCode:i,it:r}=t,o=e==="maxLength"?mr.operators.GT:mr.operators.LT,s=r.opts.unicode===!1?(0,mr._)`${n}.length`:(0,mr._)`${(0,tj.useFunc)(t.gen,nj.default)}(${n})`;t.fail$data((0,mr._)`${s} ${o} ${i}`)}};sb.default=ij});var dI=O(ab=>{"use strict";Object.defineProperty(ab,"__esModule",{value:!0});var oj=xt(),sj=oe(),Ai=Y(),aj={message:({schemaCode:t})=>(0,Ai.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,Ai._)`{pattern: ${t}}`},cj={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:aj,code(t){let{gen:e,data:n,$data:i,schema:r,schemaCode:o,it:s}=t,c=s.opts.unicodeRegExp?"u":"";if(i){let{regExp:u}=s.opts.code,d=u.code==="new RegExp"?(0,Ai._)`new RegExp`:(0,sj.useFunc)(e,u),l=e.let("valid");e.try(()=>e.assign(l,(0,Ai._)`${d}(${o}, ${c}).test(${n})`),()=>e.assign(l,!1)),t.fail$data((0,Ai._)`!${l}`)}else{let u=(0,oj.usePattern)(t,r);t.fail$data((0,Ai._)`!${u}.test(${n})`)}}};ab.default=cj});var pI=O(cb=>{"use strict";Object.defineProperty(cb,"__esModule",{value:!0});var Ws=Y(),uj={message({keyword:t,schemaCode:e}){let n=t==="maxProperties"?"more":"fewer";return(0,Ws.str)`must NOT have ${n} than ${e} properties`},params:({schemaCode:t})=>(0,Ws._)`{limit: ${t}}`},lj={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:uj,code(t){let{keyword:e,data:n,schemaCode:i}=t,r=e==="maxProperties"?Ws.operators.GT:Ws.operators.LT;t.fail$data((0,Ws._)`Object.keys(${n}).length ${r} ${i}`)}};cb.default=lj});var mI=O(ub=>{"use strict";Object.defineProperty(ub,"__esModule",{value:!0});var Js=xt(),Ys=Y(),dj=oe(),pj={message:({params:{missingProperty:t}})=>(0,Ys.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,Ys._)`{missingProperty: ${t}}`},mj={keyword:"required",type:"object",schemaType:"array",$data:!0,error:pj,code(t){let{gen:e,schema:n,schemaCode:i,data:r,$data:o,it:s}=t,{opts:c}=s;if(!o&&n.length===0)return;let u=n.length>=c.loopRequired;if(s.allErrors?d():l(),c.strictRequired){let f=t.parentSchema.properties,{definedProperties:h}=t.it;for(let y of n)if(f?.[y]===void 0&&!h.has(y)){let v=s.schemaEnv.baseId+s.errSchemaPath,E=`required property "${y}" is not defined at "${v}" (strictRequired)`;(0,dj.checkStrictMode)(s,E,s.opts.strictRequired)}}function d(){if(u||o)t.block$data(Ys.nil,p);else for(let f of n)(0,Js.checkReportMissingProp)(t,f)}function l(){let f=e.let("missing");if(u||o){let h=e.let("valid",!0);t.block$data(h,()=>m(f,h)),t.ok(h)}else e.if((0,Js.checkMissingProp)(t,n,f)),(0,Js.reportMissingProp)(t,f),e.else()}function p(){e.forOf("prop",i,f=>{t.setParams({missingProperty:f}),e.if((0,Js.noPropertyInData)(e,r,f,c.ownProperties),()=>t.error())})}function m(f,h){t.setParams({missingProperty:f}),e.forOf(f,i,()=>{e.assign(h,(0,Js.propertyInData)(e,r,f,c.ownProperties)),e.if((0,Ys.not)(h),()=>{t.error(),e.break()})},Ys.nil)}}};ub.default=mj});var fI=O(lb=>{"use strict";Object.defineProperty(lb,"__esModule",{value:!0});var Xs=Y(),fj={message({keyword:t,schemaCode:e}){let n=t==="maxItems"?"more":"fewer";return(0,Xs.str)`must NOT have ${n} than ${e} items`},params:({schemaCode:t})=>(0,Xs._)`{limit: ${t}}`},hj={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:fj,code(t){let{keyword:e,data:n,schemaCode:i}=t,r=e==="maxItems"?Xs.operators.GT:Xs.operators.LT;t.fail$data((0,Xs._)`${n}.length ${r} ${i}`)}};lb.default=hj});var pd=O(db=>{"use strict";Object.defineProperty(db,"__esModule",{value:!0});var hI=Cg();hI.code='require("ajv/dist/runtime/equal").default';db.default=hI});var gI=O(mb=>{"use strict";Object.defineProperty(mb,"__esModule",{value:!0});var pb=Us(),Ze=Y(),gj=oe(),bj=pd(),_j={message:({params:{i:t,j:e}})=>(0,Ze.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>(0,Ze._)`{i: ${t}, j: ${e}}`},yj={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:_j,code(t){let{gen:e,data:n,$data:i,schema:r,parentSchema:o,schemaCode:s,it:c}=t;if(!i&&!r)return;let u=e.let("valid"),d=o.items?(0,pb.getSchemaTypes)(o.items):[];t.block$data(u,l,(0,Ze._)`${s} === false`),t.ok(u);function l(){let h=e.let("i",(0,Ze._)`${n}.length`),y=e.let("j");t.setParams({i:h,j:y}),e.assign(u,!0),e.if((0,Ze._)`${h} > 1`,()=>(p()?m:f)(h,y))}function p(){return d.length>0&&!d.some(h=>h==="object"||h==="array")}function m(h,y){let v=e.name("item"),E=(0,pb.checkDataTypes)(d,v,c.opts.strictNumbers,pb.DataType.Wrong),C=e.const("indices",(0,Ze._)`{}`);e.for((0,Ze._)`;${h}--;`,()=>{e.let(v,(0,Ze._)`${n}[${h}]`),e.if(E,(0,Ze._)`continue`),d.length>1&&e.if((0,Ze._)`typeof ${v} == "string"`,(0,Ze._)`${v} += "_"`),e.if((0,Ze._)`typeof ${C}[${v}] == "number"`,()=>{e.assign(y,(0,Ze._)`${C}[${v}]`),t.error(),e.assign(u,!1).break()}).code((0,Ze._)`${C}[${v}] = ${h}`)})}function f(h,y){let v=(0,gj.useFunc)(e,bj.default),E=e.name("outer");e.label(E).for((0,Ze._)`;${h}--;`,()=>e.for((0,Ze._)`${y} = ${h}; ${y}--;`,()=>e.if((0,Ze._)`${v}(${n}[${h}], ${n}[${y}])`,()=>{t.error(),e.assign(u,!1).break(E)})))}}};mb.default=yj});var bI=O(hb=>{"use strict";Object.defineProperty(hb,"__esModule",{value:!0});var fb=Y(),vj=oe(),kj=pd(),xj={message:"must be equal to constant",params:({schemaCode:t})=>(0,fb._)`{allowedValue: ${t}}`},Sj={keyword:"const",$data:!0,error:xj,code(t){let{gen:e,data:n,$data:i,schemaCode:r,schema:o}=t;i||o&&typeof o=="object"?t.fail$data((0,fb._)`!${(0,vj.useFunc)(e,kj.default)}(${n}, ${r})`):t.fail((0,fb._)`${o} !== ${n}`)}};hb.default=Sj});var _I=O(gb=>{"use strict";Object.defineProperty(gb,"__esModule",{value:!0});var Qs=Y(),$j=oe(),Ij=pd(),wj={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,Qs._)`{allowedValues: ${t}}`},Ej={keyword:"enum",schemaType:"array",$data:!0,error:wj,code(t){let{gen:e,data:n,$data:i,schema:r,schemaCode:o,it:s}=t;if(!i&&r.length===0)throw new Error("enum must have non-empty array");let c=r.length>=s.opts.loopEnum,u,d=()=>u??(u=(0,$j.useFunc)(e,Ij.default)),l;if(c||i)l=e.let("valid"),t.block$data(l,p);else{if(!Array.isArray(r))throw new Error("ajv implementation error");let f=e.const("vSchema",o);l=(0,Qs.or)(...r.map((h,y)=>m(f,y)))}t.pass(l);function p(){e.assign(l,!1),e.forOf("v",o,f=>e.if((0,Qs._)`${d()}(${n}, ${f})`,()=>e.assign(l,!0).break()))}function m(f,h){let y=r[h];return typeof y=="object"&&y!==null?(0,Qs._)`${d()}(${n}, ${f}[${h}])`:(0,Qs._)`${n} === ${y}`}}};gb.default=Ej});var yI=O(bb=>{"use strict";Object.defineProperty(bb,"__esModule",{value:!0});var Tj=sI(),Rj=aI(),Oj=lI(),Pj=dI(),Aj=pI(),Nj=mI(),Cj=fI(),zj=gI(),Dj=bI(),jj=_I(),Uj=[Tj.default,Rj.default,Oj.default,Pj.default,Aj.default,Nj.default,Cj.default,zj.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},Dj.default,jj.default];bb.default=Uj});var yb=O(ea=>{"use strict";Object.defineProperty(ea,"__esModule",{value:!0});ea.validateAdditionalItems=void 0;var fr=Y(),_b=oe(),Mj={message:({params:{len:t}})=>(0,fr.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,fr._)`{limit: ${t}}`},Lj={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:Mj,code(t){let{parentSchema:e,it:n}=t,{items:i}=e;if(!Array.isArray(i)){(0,_b.checkStrictMode)(n,'"additionalItems" is ignored when "items" is not an array of schemas');return}vI(t,i)}};function vI(t,e){let{gen:n,schema:i,data:r,keyword:o,it:s}=t;s.items=!0;let c=n.const("len",(0,fr._)`${r}.length`);if(i===!1)t.setParams({len:e.length}),t.pass((0,fr._)`${c} <= ${e.length}`);else if(typeof i=="object"&&!(0,_b.alwaysValidSchema)(s,i)){let d=n.var("valid",(0,fr._)`${c} <= ${e.length}`);n.if((0,fr.not)(d),()=>u(d)),t.ok(d)}function u(d){n.forRange("i",e.length,c,l=>{t.subschema({keyword:o,dataProp:l,dataPropType:_b.Type.Num},d),s.allErrors||n.if((0,fr.not)(d),()=>n.break())})}}ea.validateAdditionalItems=vI;ea.default=Lj});var vb=O(ta=>{"use strict";Object.defineProperty(ta,"__esModule",{value:!0});ta.validateTuple=void 0;var kI=Y(),md=oe(),Zj=xt(),Fj={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:n}=t;if(Array.isArray(e))return xI(t,"additionalItems",e);n.items=!0,!(0,md.alwaysValidSchema)(n,e)&&t.ok((0,Zj.validateArray)(t))}};function xI(t,e,n=t.schema){let{gen:i,parentSchema:r,data:o,keyword:s,it:c}=t;l(r),c.opts.unevaluated&&n.length&&c.items!==!0&&(c.items=md.mergeEvaluated.items(i,n.length,c.items));let u=i.name("valid"),d=i.const("len",(0,kI._)`${o}.length`);n.forEach((p,m)=>{(0,md.alwaysValidSchema)(c,p)||(i.if((0,kI._)`${d} > ${m}`,()=>t.subschema({keyword:s,schemaProp:m,dataProp:m},u)),t.ok(u))});function l(p){let{opts:m,errSchemaPath:f}=c,h=n.length,y=h===p.minItems&&(h===p.maxItems||p[e]===!1);if(m.strictTuples&&!y){let v=`"${s}" is ${h}-tuple, but minItems or maxItems/${e} are not specified or different at path "${f}"`;(0,md.checkStrictMode)(c,v,m.strictTuples)}}}ta.validateTuple=xI;ta.default=Fj});var SI=O(kb=>{"use strict";Object.defineProperty(kb,"__esModule",{value:!0});var Bj=vb(),qj={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,Bj.validateTuple)(t,"items")};kb.default=qj});var II=O(xb=>{"use strict";Object.defineProperty(xb,"__esModule",{value:!0});var $I=Y(),Vj=oe(),Hj=xt(),Kj=yb(),Gj={message:({params:{len:t}})=>(0,$I.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,$I._)`{limit: ${t}}`},Wj={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:Gj,code(t){let{schema:e,parentSchema:n,it:i}=t,{prefixItems:r}=n;i.items=!0,!(0,Vj.alwaysValidSchema)(i,e)&&(r?(0,Kj.validateAdditionalItems)(t,r):t.ok((0,Hj.validateArray)(t)))}};xb.default=Wj});var wI=O(Sb=>{"use strict";Object.defineProperty(Sb,"__esModule",{value:!0});var $t=Y(),fd=oe(),Jj={message:({params:{min:t,max:e}})=>e===void 0?(0,$t.str)`must contain at least ${t} valid item(s)`:(0,$t.str)`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?(0,$t._)`{minContains: ${t}}`:(0,$t._)`{minContains: ${t}, maxContains: ${e}}`},Yj={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:Jj,code(t){let{gen:e,schema:n,parentSchema:i,data:r,it:o}=t,s,c,{minContains:u,maxContains:d}=i;o.opts.next?(s=u===void 0?1:u,c=d):s=1;let l=e.const("len",(0,$t._)`${r}.length`);if(t.setParams({min:s,max:c}),c===void 0&&s===0){(0,fd.checkStrictMode)(o,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(c!==void 0&&s>c){(0,fd.checkStrictMode)(o,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,fd.alwaysValidSchema)(o,n)){let y=(0,$t._)`${l} >= ${s}`;c!==void 0&&(y=(0,$t._)`${y} && ${l} <= ${c}`),t.pass(y);return}o.items=!0;let p=e.name("valid");c===void 0&&s===1?f(p,()=>e.if(p,()=>e.break())):s===0?(e.let(p,!0),c!==void 0&&e.if((0,$t._)`${r}.length > 0`,m)):(e.let(p,!1),m()),t.result(p,()=>t.reset());function m(){let y=e.name("_valid"),v=e.let("count",0);f(y,()=>e.if(y,()=>h(v)))}function f(y,v){e.forRange("i",0,l,E=>{t.subschema({keyword:"contains",dataProp:E,dataPropType:fd.Type.Num,compositeRule:!0},y),v()})}function h(y){e.code((0,$t._)`${y}++`),c===void 0?e.if((0,$t._)`${y} >= ${s}`,()=>e.assign(p,!0).break()):(e.if((0,$t._)`${y} > ${c}`,()=>e.assign(p,!1).break()),s===1?e.assign(p,!0):e.if((0,$t._)`${y} >= ${s}`,()=>e.assign(p,!0)))}}};Sb.default=Yj});var RI=O(Kt=>{"use strict";Object.defineProperty(Kt,"__esModule",{value:!0});Kt.validateSchemaDeps=Kt.validatePropertyDeps=Kt.error=void 0;var $b=Y(),Xj=oe(),na=xt();Kt.error={message:({params:{property:t,depsCount:e,deps:n}})=>{let i=e===1?"property":"properties";return(0,$b.str)`must have ${i} ${n} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:n,missingProperty:i}})=>(0,$b._)`{property: ${t},
|
|
8
|
+
missingProperty: ${i},
|
|
9
9
|
depsCount: ${e},
|
|
10
|
-
deps: ${n}}`};var i1={keyword:"dependencies",type:"object",schemaType:"object",error:Kt.error,code(t){let[e,n]=a1(t);vI(t,e),bI(t,n)}};function a1({schema:t}){let e={},n={};for(let o in t){if(o==="__proto__")continue;let r=Array.isArray(t[o])?e:n;r[o]=t[o]}return[e,n]}function vI(t,e=t.schema){let{gen:n,data:o,it:r}=t;if(Object.keys(e).length===0)return;let i=n.let("missing");for(let a in e){let c=e[a];if(c.length===0)continue;let u=(0,os.propertyInData)(n,o,a,r.opts.ownProperties);t.setParams({property:a,depsCount:c.length,deps:c.join(", ")}),r.allErrors?n.if(u,()=>{for(let d of c)(0,os.checkReportMissingProp)(t,d)}):(n.if((0,E_._)`${u} && (${(0,os.checkMissingProp)(t,c,i)})`),(0,os.reportMissingProp)(t,i),n.else())}}Kt.validatePropertyDeps=vI;function bI(t,e=t.schema){let{gen:n,data:o,keyword:r,it:i}=t,a=n.name("valid");for(let c in e)(0,o1.alwaysValidSchema)(i,e[c])||(n.if((0,os.propertyInData)(n,o,c,i.opts.ownProperties),()=>{let u=t.subschema({keyword:r,schemaProp:c},a);t.mergeValidEvaluated(u,a)},()=>n.var(a,!0)),t.ok(a))}Kt.validateSchemaDeps=bI;Kt.default=i1});var SI=R(T_=>{"use strict";Object.defineProperty(T_,"__esModule",{value:!0});var xI=Y(),s1=ie(),c1={message:"property name must be valid",params:({params:t})=>(0,xI._)`{propertyName: ${t.propertyName}}`},u1={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:c1,code(t){let{gen:e,schema:n,data:o,it:r}=t;if((0,s1.alwaysValidSchema)(r,n))return;let i=e.name("valid");e.forIn("key",o,a=>{t.setParams({propertyName:a}),t.subschema({keyword:"propertyNames",data:a,dataTypes:["string"],propertyName:a,compositeRule:!0},i),e.if((0,xI.not)(i),()=>{t.error(!0),r.allErrors||e.break()})}),t.ok(i)}};T_.default=u1});var O_=R(P_=>{"use strict";Object.defineProperty(P_,"__esModule",{value:!0});var vd=xt(),Dt=Y(),l1=ir(),bd=ie(),d1={message:"must NOT have additional properties",params:({params:t})=>(0,Dt._)`{additionalProperty: ${t.additionalProperty}}`},p1={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:d1,code(t){let{gen:e,schema:n,parentSchema:o,data:r,errsCount:i,it:a}=t;if(!i)throw new Error("ajv implementation error");let{allErrors:c,opts:u}=a;if(a.props=!0,u.removeAdditional!=="all"&&(0,bd.alwaysValidSchema)(a,n))return;let d=(0,vd.allSchemaProperties)(o.properties),l=(0,vd.allSchemaProperties)(o.patternProperties);p(),t.ok((0,Dt._)`${i} === ${l1.default.errors}`);function p(){e.forIn("key",r,b=>{!d.length&&!l.length?g(b):e.if(m(b),()=>g(b))})}function m(b){let E;if(d.length>8){let N=(0,bd.schemaRefOrVal)(a,o.properties,"properties");E=(0,vd.isOwnProperty)(e,N,b)}else d.length?E=(0,Dt.or)(...d.map(N=>(0,Dt._)`${b} === ${N}`)):E=Dt.nil;return l.length&&(E=(0,Dt.or)(E,...l.map(N=>(0,Dt._)`${(0,vd.usePattern)(t,N)}.test(${b})`))),(0,Dt.not)(E)}function f(b){e.code((0,Dt._)`delete ${r}[${b}]`)}function g(b){if(u.removeAdditional==="all"||u.removeAdditional&&n===!1){f(b);return}if(n===!1){t.setParams({additionalProperty:b}),t.error(),c||e.break();return}if(typeof n=="object"&&!(0,bd.alwaysValidSchema)(a,n)){let E=e.name("valid");u.removeAdditional==="failing"?(v(b,E,!1),e.if((0,Dt.not)(E),()=>{t.reset(),f(b)})):(v(b,E),c||e.if((0,Dt.not)(E),()=>e.break()))}}function v(b,E,N){let z={keyword:"additionalProperties",dataProp:b,dataPropType:bd.Type.Str};N===!1&&Object.assign(z,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(z,E)}}};P_.default=p1});var wI=R(A_=>{"use strict";Object.defineProperty(A_,"__esModule",{value:!0});var m1=qa(),$I=xt(),R_=ie(),II=O_(),f1={keyword:"properties",type:"object",schemaType:"object",code(t){let{gen:e,schema:n,parentSchema:o,data:r,it:i}=t;i.opts.removeAdditional==="all"&&o.additionalProperties===void 0&&II.default.code(new m1.KeywordCxt(i,II.default,"additionalProperties"));let a=(0,$I.allSchemaProperties)(n);for(let p of a)i.definedProperties.add(p);i.opts.unevaluated&&a.length&&i.props!==!0&&(i.props=R_.mergeEvaluated.props(e,(0,R_.toHash)(a),i.props));let c=a.filter(p=>!(0,R_.alwaysValidSchema)(i,n[p]));if(c.length===0)return;let u=e.name("valid");for(let p of c)d(p)?l(p):(e.if((0,$I.propertyInData)(e,r,p,i.opts.ownProperties)),l(p),i.allErrors||e.else().var(u,!0),e.endIf()),t.it.definedProperties.add(p),t.ok(u);function d(p){return i.opts.useDefaults&&!i.compositeRule&&n[p].default!==void 0}function l(p){t.subschema({keyword:"properties",schemaProp:p,dataProp:p},u)}}};A_.default=f1});var OI=R(C_=>{"use strict";Object.defineProperty(C_,"__esModule",{value:!0});var EI=xt(),kd=Y(),TI=ie(),PI=ie(),h1={keyword:"patternProperties",type:"object",schemaType:"object",code(t){let{gen:e,schema:n,data:o,parentSchema:r,it:i}=t,{opts:a}=i,c=(0,EI.allSchemaProperties)(n),u=c.filter(v=>(0,TI.alwaysValidSchema)(i,n[v]));if(c.length===0||u.length===c.length&&(!i.opts.unevaluated||i.props===!0))return;let d=a.strictSchema&&!a.allowMatchingProperties&&r.properties,l=e.name("valid");i.props!==!0&&!(i.props instanceof kd.Name)&&(i.props=(0,PI.evaluatedPropsToName)(e,i.props));let{props:p}=i;m();function m(){for(let v of c)d&&f(v),i.allErrors?g(v):(e.var(l,!0),g(v),e.if(l))}function f(v){for(let b in d)new RegExp(v).test(b)&&(0,TI.checkStrictMode)(i,`property ${b} matches pattern ${v} (use allowMatchingProperties)`)}function g(v){e.forIn("key",o,b=>{e.if((0,kd._)`${(0,EI.usePattern)(t,v)}.test(${b})`,()=>{let E=u.includes(v);E||t.subschema({keyword:"patternProperties",schemaProp:v,dataProp:b,dataPropType:PI.Type.Str},l),i.opts.unevaluated&&p!==!0?e.assign((0,kd._)`${p}[${b}]`,!0):!E&&!i.allErrors&&e.if((0,kd.not)(l),()=>e.break())})})}}};C_.default=h1});var RI=R(N_=>{"use strict";Object.defineProperty(N_,"__esModule",{value:!0});var g1=ie(),_1={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:n,it:o}=t;if((0,g1.alwaysValidSchema)(o,n)){t.fail();return}let r=e.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},r),t.failResult(r,()=>t.reset(),()=>t.error())},error:{message:"must NOT be valid"}};N_.default=_1});var AI=R(z_=>{"use strict";Object.defineProperty(z_,"__esModule",{value:!0});var y1=xt(),v1={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:y1.validateUnion,error:{message:"must match a schema in anyOf"}};z_.default=v1});var CI=R(D_=>{"use strict";Object.defineProperty(D_,"__esModule",{value:!0});var xd=Y(),b1=ie(),k1={message:"must match exactly one schema in oneOf",params:({params:t})=>(0,xd._)`{passingSchemas: ${t.passing}}`},x1={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:k1,code(t){let{gen:e,schema:n,parentSchema:o,it:r}=t;if(!Array.isArray(n))throw new Error("ajv implementation error");if(r.opts.discriminator&&o.discriminator)return;let i=n,a=e.let("valid",!1),c=e.let("passing",null),u=e.name("_valid");t.setParams({passing:c}),e.block(d),t.result(a,()=>t.reset(),()=>t.error(!0));function d(){i.forEach((l,p)=>{let m;(0,b1.alwaysValidSchema)(r,l)?e.var(u,!0):m=t.subschema({keyword:"oneOf",schemaProp:p,compositeRule:!0},u),p>0&&e.if((0,xd._)`${u} && ${a}`).assign(a,!1).assign(c,(0,xd._)`[${c}, ${p}]`).else(),e.if(u,()=>{e.assign(a,!0),e.assign(c,p),m&&t.mergeEvaluated(m,xd.Name)})})}}};D_.default=x1});var NI=R(j_=>{"use strict";Object.defineProperty(j_,"__esModule",{value:!0});var S1=ie(),$1={keyword:"allOf",schemaType:"array",code(t){let{gen:e,schema:n,it:o}=t;if(!Array.isArray(n))throw new Error("ajv implementation error");let r=e.name("valid");n.forEach((i,a)=>{if((0,S1.alwaysValidSchema)(o,i))return;let c=t.subschema({keyword:"allOf",schemaProp:a},r);t.ok(r),t.mergeEvaluated(c)})}};j_.default=$1});var jI=R(U_=>{"use strict";Object.defineProperty(U_,"__esModule",{value:!0});var Sd=Y(),DI=ie(),I1={message:({params:t})=>(0,Sd.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,Sd._)`{failingKeyword: ${t.ifClause}}`},w1={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:I1,code(t){let{gen:e,parentSchema:n,it:o}=t;n.then===void 0&&n.else===void 0&&(0,DI.checkStrictMode)(o,'"if" without "then" and "else" is ignored');let r=zI(o,"then"),i=zI(o,"else");if(!r&&!i)return;let a=e.let("valid",!0),c=e.name("_valid");if(u(),t.reset(),r&&i){let l=e.let("ifClause");t.setParams({ifClause:l}),e.if(c,d("then",l),d("else",l))}else r?e.if(c,d("then")):e.if((0,Sd.not)(c),d("else"));t.pass(a,()=>t.error(!0));function u(){let l=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},c);t.mergeEvaluated(l)}function d(l,p){return()=>{let m=t.subschema({keyword:l},c);e.assign(a,c),t.mergeValidEvaluated(m,a),p?e.assign(p,(0,Sd._)`${l}`):t.setParams({ifClause:l})}}}};function zI(t,e){let n=t.schema[e];return n!==void 0&&!(0,DI.alwaysValidSchema)(t,n)}U_.default=w1});var UI=R(L_=>{"use strict";Object.defineProperty(L_,"__esModule",{value:!0});var E1=ie(),T1={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:n}){e.if===void 0&&(0,E1.checkStrictMode)(n,`"${t}" without "if" is ignored`)}};L_.default=T1});var LI=R(M_=>{"use strict";Object.defineProperty(M_,"__esModule",{value:!0});var P1=x_(),O1=hI(),R1=S_(),A1=_I(),C1=yI(),N1=kI(),z1=SI(),D1=O_(),j1=wI(),U1=OI(),L1=RI(),M1=AI(),Z1=CI(),F1=NI(),V1=jI(),q1=UI();function B1(t=!1){let e=[L1.default,M1.default,Z1.default,F1.default,V1.default,q1.default,z1.default,D1.default,N1.default,j1.default,U1.default];return t?e.push(O1.default,A1.default):e.push(P1.default,R1.default),e.push(C1.default),e}M_.default=B1});var MI=R(Z_=>{"use strict";Object.defineProperty(Z_,"__esModule",{value:!0});var Oe=Y(),H1={message:({schemaCode:t})=>(0,Oe.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,Oe._)`{format: ${t}}`},K1={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:H1,code(t,e){let{gen:n,data:o,$data:r,schema:i,schemaCode:a,it:c}=t,{opts:u,errSchemaPath:d,schemaEnv:l,self:p}=c;if(!u.validateFormats)return;r?m():f();function m(){let g=n.scopeValue("formats",{ref:p.formats,code:u.code.formats}),v=n.const("fDef",(0,Oe._)`${g}[${a}]`),b=n.let("fType"),E=n.let("format");n.if((0,Oe._)`typeof ${v} == "object" && !(${v} instanceof RegExp)`,()=>n.assign(b,(0,Oe._)`${v}.type || "string"`).assign(E,(0,Oe._)`${v}.validate`),()=>n.assign(b,(0,Oe._)`"string"`).assign(E,v)),t.fail$data((0,Oe.or)(N(),z()));function N(){return u.strictSchema===!1?Oe.nil:(0,Oe._)`${a} && !${E}`}function z(){let j=l.$async?(0,Oe._)`(${v}.async ? await ${E}(${o}) : ${E}(${o}))`:(0,Oe._)`${E}(${o})`,D=(0,Oe._)`(typeof ${E} == "function" ? ${j} : ${E}.test(${o}))`;return(0,Oe._)`${E} && ${E} !== true && ${b} === ${e} && !${D}`}}function f(){let g=p.formats[i];if(!g){N();return}if(g===!0)return;let[v,b,E]=z(g);v===e&&t.pass(j());function N(){if(u.strictSchema===!1){p.logger.warn(D());return}throw new Error(D());function D(){return`unknown format "${i}" ignored in schema at path "${d}"`}}function z(D){let lt=D instanceof RegExp?(0,Oe.regexpCode)(D):u.code.formats?(0,Oe._)`${u.code.formats}${(0,Oe.getProperty)(i)}`:void 0,ht=n.scopeValue("formats",{key:i,ref:D,code:lt});return typeof D=="object"&&!(D instanceof RegExp)?[D.type||"string",D.validate,(0,Oe._)`${ht}.validate`]:["string",D,ht]}function j(){if(typeof g=="object"&&!(g instanceof RegExp)&&g.async){if(!l.$async)throw new Error("async format in sync schema");return(0,Oe._)`await ${E}(${o})`}return typeof b=="function"?(0,Oe._)`${E}(${o})`:(0,Oe._)`${E}.test(${o})`}}}};Z_.default=K1});var ZI=R(F_=>{"use strict";Object.defineProperty(F_,"__esModule",{value:!0});var G1=MI(),W1=[G1.default];F_.default=W1});var FI=R(jo=>{"use strict";Object.defineProperty(jo,"__esModule",{value:!0});jo.contentVocabulary=jo.metadataVocabulary=void 0;jo.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];jo.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var qI=R(V_=>{"use strict";Object.defineProperty(V_,"__esModule",{value:!0});var J1=Y$(),Y1=dI(),X1=LI(),Q1=ZI(),VI=FI(),eU=[J1.default,Y1.default,(0,X1.default)(),Q1.default,VI.metadataVocabulary,VI.contentVocabulary];V_.default=eU});var HI=R($d=>{"use strict";Object.defineProperty($d,"__esModule",{value:!0});$d.DiscrError=void 0;var BI;(function(t){t.Tag="tag",t.Mapping="mapping"})(BI||($d.DiscrError=BI={}))});var GI=R(B_=>{"use strict";Object.defineProperty(B_,"__esModule",{value:!0});var Uo=Y(),q_=HI(),KI=sd(),tU=Ba(),rU=ie(),nU={message:({params:{discrError:t,tagName:e}})=>t===q_.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:n}})=>(0,Uo._)`{error: ${t}, tag: ${n}, tagValue: ${e}}`},oU={keyword:"discriminator",type:"object",schemaType:"object",error:nU,code(t){let{gen:e,data:n,schema:o,parentSchema:r,it:i}=t,{oneOf:a}=r;if(!i.opts.discriminator)throw new Error("discriminator: requires discriminator option");let c=o.propertyName;if(typeof c!="string")throw new Error("discriminator: requires propertyName");if(o.mapping)throw new Error("discriminator: mapping is not supported");if(!a)throw new Error("discriminator: requires oneOf keyword");let u=e.let("valid",!1),d=e.const("tag",(0,Uo._)`${n}${(0,Uo.getProperty)(c)}`);e.if((0,Uo._)`typeof ${d} == "string"`,()=>l(),()=>t.error(!1,{discrError:q_.DiscrError.Tag,tag:d,tagName:c})),t.ok(u);function l(){let f=m();e.if(!1);for(let g in f)e.elseIf((0,Uo._)`${d} === ${g}`),e.assign(u,p(f[g]));e.else(),t.error(!1,{discrError:q_.DiscrError.Mapping,tag:d,tagName:c}),e.endIf()}function p(f){let g=e.name("valid"),v=t.subschema({keyword:"oneOf",schemaProp:f},g);return t.mergeEvaluated(v,Uo.Name),g}function m(){var f;let g={},v=E(r),b=!0;for(let j=0;j<a.length;j++){let D=a[j];if(D?.$ref&&!(0,rU.schemaHasRulesButRef)(D,i.self.RULES)){let ht=D.$ref;if(D=KI.resolveRef.call(i.self,i.schemaEnv.root,i.baseId,ht),D instanceof KI.SchemaEnv&&(D=D.schema),D===void 0)throw new tU.default(i.opts.uriResolver,i.baseId,ht)}let lt=(f=D?.properties)===null||f===void 0?void 0:f[c];if(typeof lt!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${c}"`);b=b&&(v||E(D)),N(lt,j)}if(!b)throw new Error(`discriminator: "${c}" must be required`);return g;function E({required:j}){return Array.isArray(j)&&j.includes(c)}function N(j,D){if(j.const)z(j.const,D);else if(j.enum)for(let lt of j.enum)z(lt,D);else throw new Error(`discriminator: "properties/${c}" must have "const" or "enum"`)}function z(j,D){if(typeof j!="string"||j in g)throw new Error(`discriminator: "${c}" values must be unique strings`);g[j]=D}}}};B_.default=oU});var WI=R((aK,iU)=>{iU.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 K_=R(($e,H_)=>{"use strict";Object.defineProperty($e,"__esModule",{value:!0});$e.MissingRefError=$e.ValidationError=$e.CodeGen=$e.Name=$e.nil=$e.stringify=$e.str=$e._=$e.KeywordCxt=$e.Ajv=void 0;var aU=B$(),sU=qI(),cU=GI(),JI=WI(),uU=["/properties"],Id="http://json-schema.org/draft-07/schema",Lo=class extends aU.default{_addVocabularies(){super._addVocabularies(),sU.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(cU.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(JI,uU):JI;this.addMetaSchema(e,Id,!1),this.refs["http://json-schema.org/schema"]=Id}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(Id)?Id:void 0)}};$e.Ajv=Lo;H_.exports=$e=Lo;H_.exports.Ajv=Lo;Object.defineProperty($e,"__esModule",{value:!0});$e.default=Lo;var lU=qa();Object.defineProperty($e,"KeywordCxt",{enumerable:!0,get:function(){return lU.KeywordCxt}});var Mo=Y();Object.defineProperty($e,"_",{enumerable:!0,get:function(){return Mo._}});Object.defineProperty($e,"str",{enumerable:!0,get:function(){return Mo.str}});Object.defineProperty($e,"stringify",{enumerable:!0,get:function(){return Mo.stringify}});Object.defineProperty($e,"nil",{enumerable:!0,get:function(){return Mo.nil}});Object.defineProperty($e,"Name",{enumerable:!0,get:function(){return Mo.Name}});Object.defineProperty($e,"CodeGen",{enumerable:!0,get:function(){return Mo.CodeGen}});var dU=id();Object.defineProperty($e,"ValidationError",{enumerable:!0,get:function(){return dU.default}});var pU=Ba();Object.defineProperty($e,"MissingRefError",{enumerable:!0,get:function(){return pU.default}})});var ow=R(Wt=>{"use strict";Object.defineProperty(Wt,"__esModule",{value:!0});Wt.formatNames=Wt.fastFormats=Wt.fullFormats=void 0;function Gt(t,e){return{validate:t,compare:e}}Wt.fullFormats={date:Gt(ew,Y_),time:Gt(W_(!0),X_),"date-time":Gt(YI(!0),rw),"iso-time":Gt(W_(),tw),"iso-date-time":Gt(YI(),nw),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:yU,"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:IU,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:vU,int32:{type:"number",validate:xU},int64:{type:"number",validate:SU},float:{type:"number",validate:QI},double:{type:"number",validate:QI},password:!0,binary:!0};Wt.fastFormats={...Wt.fullFormats,date:Gt(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,Y_),time:Gt(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,X_),"date-time":Gt(/^\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,rw),"iso-time":Gt(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,tw),"iso-date-time":Gt(/^\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,nw),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};Wt.formatNames=Object.keys(Wt.fullFormats);function mU(t){return t%4===0&&(t%100!==0||t%400===0)}var fU=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,hU=[0,31,28,31,30,31,30,31,31,30,31,30,31];function ew(t){let e=fU.exec(t);if(!e)return!1;let n=+e[1],o=+e[2],r=+e[3];return o>=1&&o<=12&&r>=1&&r<=(o===2&&mU(n)?29:hU[o])}function Y_(t,e){if(t&&e)return t>e?1:t<e?-1:0}var G_=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function W_(t){return function(n){let o=G_.exec(n);if(!o)return!1;let r=+o[1],i=+o[2],a=+o[3],c=o[4],u=o[5]==="-"?-1:1,d=+(o[6]||0),l=+(o[7]||0);if(d>23||l>59||t&&!c)return!1;if(r<=23&&i<=59&&a<60)return!0;let p=i-l*u,m=r-d*u-(p<0?1:0);return(m===23||m===-1)&&(p===59||p===-1)&&a<61}}function X_(t,e){if(!(t&&e))return;let n=new Date("2020-01-01T"+t).valueOf(),o=new Date("2020-01-01T"+e).valueOf();if(n&&o)return n-o}function tw(t,e){if(!(t&&e))return;let n=G_.exec(t),o=G_.exec(e);if(n&&o)return t=n[1]+n[2]+n[3],e=o[1]+o[2]+o[3],t>e?1:t<e?-1:0}var J_=/t|\s/i;function YI(t){let e=W_(t);return function(o){let r=o.split(J_);return r.length===2&&ew(r[0])&&e(r[1])}}function rw(t,e){if(!(t&&e))return;let n=new Date(t).valueOf(),o=new Date(e).valueOf();if(n&&o)return n-o}function nw(t,e){if(!(t&&e))return;let[n,o]=t.split(J_),[r,i]=e.split(J_),a=Y_(n,r);if(a!==void 0)return a||X_(o,i)}var gU=/\/|:/,_U=/^(?:[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 yU(t){return gU.test(t)&&_U.test(t)}var XI=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function vU(t){return XI.lastIndex=0,XI.test(t)}var bU=-(2**31),kU=2**31-1;function xU(t){return Number.isInteger(t)&&t<=kU&&t>=bU}function SU(t){return Number.isInteger(t)}function QI(){return!0}var $U=/[^\\]\\Z/;function IU(t){if($U.test(t))return!1;try{return new RegExp(t),!0}catch{return!1}}});var iw=R(Zo=>{"use strict";Object.defineProperty(Zo,"__esModule",{value:!0});Zo.formatLimitDefinition=void 0;var wU=K_(),jt=Y(),Lr=jt.operators,wd={formatMaximum:{okStr:"<=",ok:Lr.LTE,fail:Lr.GT},formatMinimum:{okStr:">=",ok:Lr.GTE,fail:Lr.LT},formatExclusiveMaximum:{okStr:"<",ok:Lr.LT,fail:Lr.GTE},formatExclusiveMinimum:{okStr:">",ok:Lr.GT,fail:Lr.LTE}},EU={message:({keyword:t,schemaCode:e})=>(0,jt.str)`should be ${wd[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,jt._)`{comparison: ${wd[t].okStr}, limit: ${e}}`};Zo.formatLimitDefinition={keyword:Object.keys(wd),type:"string",schemaType:"string",$data:!0,error:EU,code(t){let{gen:e,data:n,schemaCode:o,keyword:r,it:i}=t,{opts:a,self:c}=i;if(!a.validateFormats)return;let u=new wU.KeywordCxt(i,c.RULES.all.format.definition,"format");u.$data?d():l();function d(){let m=e.scopeValue("formats",{ref:c.formats,code:a.code.formats}),f=e.const("fmt",(0,jt._)`${m}[${u.schemaCode}]`);t.fail$data((0,jt.or)((0,jt._)`typeof ${f} != "object"`,(0,jt._)`${f} instanceof RegExp`,(0,jt._)`typeof ${f}.compare != "function"`,p(f)))}function l(){let m=u.schema,f=c.formats[m];if(!f||f===!0)return;if(typeof f!="object"||f instanceof RegExp||typeof f.compare!="function")throw new Error(`"${r}": format "${m}" does not define "compare" function`);let g=e.scopeValue("formats",{key:m,ref:f,code:a.code.formats?(0,jt._)`${a.code.formats}${(0,jt.getProperty)(m)}`:void 0});t.fail$data(p(g))}function p(m){return(0,jt._)`${m}.compare(${n}, ${o}) ${wd[r].fail} 0`}},dependencies:["format"]};var TU=t=>(t.addKeyword(Zo.formatLimitDefinition),t);Zo.default=TU});var uw=R((is,cw)=>{"use strict";Object.defineProperty(is,"__esModule",{value:!0});var Fo=ow(),PU=iw(),Q_=Y(),aw=new Q_.Name("fullFormats"),OU=new Q_.Name("fastFormats"),ey=(t,e={keywords:!0})=>{if(Array.isArray(e))return sw(t,e,Fo.fullFormats,aw),t;let[n,o]=e.mode==="fast"?[Fo.fastFormats,OU]:[Fo.fullFormats,aw],r=e.formats||Fo.formatNames;return sw(t,r,n,o),e.keywords&&(0,PU.default)(t),t};ey.get=(t,e="full")=>{let o=(e==="fast"?Fo.fastFormats:Fo.fullFormats)[t];if(!o)throw new Error(`Unknown format "${t}"`);return o};function sw(t,e,n,o){var r,i;(r=(i=t.opts.code).formats)!==null&&r!==void 0||(i.formats=(0,Q_._)`require("ajv-formats/dist/formats").${o}`);for(let a of e)t.addFormat(a,n[a])}cw.exports=is=ey;Object.defineProperty(is,"__esModule",{value:!0});is.default=ey});import Rx from"node:process";var s={};Jt(s,{$brand:()=>dp,$input:()=>Em,$output:()=>wm,NEVER:()=>lp,TimePrecision:()=>Pm,ZodAny:()=>qf,ZodArray:()=>Gf,ZodBase64:()=>ol,ZodBase64URL:()=>il,ZodBigInt:()=>to,ZodBigIntFormat:()=>cl,ZodBoolean:()=>eo,ZodCIDRv4:()=>rl,ZodCIDRv6:()=>nl,ZodCUID:()=>Wu,ZodCUID2:()=>Ju,ZodCatch:()=>fh,ZodCodec:()=>ia,ZodCustom:()=>aa,ZodCustomStringFormat:()=>Xn,ZodDate:()=>ea,ZodDefault:()=>ch,ZodDiscriminatedUnion:()=>Jf,ZodE164:()=>al,ZodEmail:()=>Hu,ZodEmoji:()=>Ku,ZodEnum:()=>Jn,ZodError:()=>iR,ZodExactOptional:()=>ih,ZodFile:()=>nh,ZodFirstPartyTypeKind:()=>Eh,ZodFunction:()=>$h,ZodGUID:()=>Wi,ZodIPv4:()=>el,ZodIPv6:()=>tl,ZodISODate:()=>Mu,ZodISODateTime:()=>Lu,ZodISODuration:()=>Fu,ZodISOTime:()=>Zu,ZodIntersection:()=>Yf,ZodIssueCode:()=>sR,ZodJWT:()=>sl,ZodKSUID:()=>Qu,ZodLazy:()=>kh,ZodLiteral:()=>rh,ZodMAC:()=>Mf,ZodMap:()=>eh,ZodNaN:()=>gh,ZodNanoID:()=>Gu,ZodNever:()=>Hf,ZodNonOptional:()=>dl,ZodNull:()=>Vf,ZodNullable:()=>sh,ZodNumber:()=>Qn,ZodNumberFormat:()=>Qr,ZodObject:()=>ta,ZodOptional:()=>no,ZodPipe:()=>oa,ZodPrefault:()=>lh,ZodPreprocess:()=>_h,ZodPromise:()=>Sh,ZodReadonly:()=>yh,ZodRealError:()=>it,ZodRecord:()=>Wn,ZodSet:()=>th,ZodString:()=>Yn,ZodStringFormat:()=>he,ZodSuccess:()=>mh,ZodSymbol:()=>Zf,ZodTemplateLiteral:()=>bh,ZodTransform:()=>oh,ZodTuple:()=>Xf,ZodType:()=>K,ZodULID:()=>Yu,ZodURL:()=>Xi,ZodUUID:()=>Vt,ZodUndefined:()=>Ff,ZodUnion:()=>ra,ZodUnknown:()=>Bf,ZodVoid:()=>Kf,ZodXID:()=>Xu,ZodXor:()=>Wf,_ZodString:()=>Bu,_default:()=>uh,_function:()=>nx,any:()=>Uk,array:()=>X,base64:()=>kk,base64url:()=>xk,bigint:()=>Ck,boolean:()=>Pe,catch:()=>hh,check:()=>ox,cidrv4:()=>vk,cidrv6:()=>bk,clone:()=>Ae,codec:()=>Qk,coerce:()=>Th,config:()=>Te,core:()=>Tt,cuid:()=>dk,cuid2:()=>pk,custom:()=>pl,date:()=>Mk,decode:()=>Cf,decodeAsync:()=>zf,describe:()=>ix,discriminatedUnion:()=>na,e164:()=>Sk,email:()=>tk,emoji:()=>uk,encode:()=>Af,encodeAsync:()=>Nf,endsWith:()=>Zn,enum:()=>ze,exactOptional:()=>ah,file:()=>Wk,flattenError:()=>_i,float32:()=>Pk,float64:()=>Ok,formatError:()=>yi,fromJSONSchema:()=>dx,function:()=>nx,getErrorMap:()=>uR,globalRegistry:()=>Ce,gt:()=>Zt,gte:()=>Ge,guid:()=>rk,hash:()=>Tk,hex:()=>Ek,hostname:()=>wk,httpUrl:()=>ck,includes:()=>Ln,instanceof:()=>sx,int:()=>Vu,int32:()=>Rk,int64:()=>Nk,intersection:()=>ro,invertCodec:()=>ex,ipv4:()=>gk,ipv6:()=>yk,iso:()=>$r,json:()=>ux,jwt:()=>$k,keyof:()=>Zk,ksuid:()=>hk,lazy:()=>xh,length:()=>Jr,literal:()=>L,locales:()=>Cn,looseObject:()=>Ne,looseRecord:()=>Bk,lowercase:()=>jn,lt:()=>Mt,lte:()=>dt,mac:()=>_k,map:()=>Hk,maxLength:()=>Wr,maxSize:()=>br,meta:()=>ax,mime:()=>Fn,minLength:()=>Xt,minSize:()=>Ft,multipleOf:()=>vr,nan:()=>Xk,nanoid:()=>lk,nativeEnum:()=>Gk,negative:()=>Su,never:()=>ul,nonnegative:()=>Iu,nonoptional:()=>ph,nonpositive:()=>$u,normalize:()=>Vn,null:()=>Qi,nullable:()=>Ji,nullish:()=>Jk,number:()=>se,object:()=>A,optional:()=>be,overwrite:()=>Et,parse:()=>Tf,parseAsync:()=>Pf,partialRecord:()=>qk,pipe:()=>qu,positive:()=>xu,prefault:()=>dh,preprocess:()=>sa,prettifyError:()=>Sp,promise:()=>rx,property:()=>wu,readonly:()=>vh,record:()=>me,refine:()=>Ih,regex:()=>Dn,regexes:()=>ot,registry:()=>eu,safeDecode:()=>jf,safeDecodeAsync:()=>Lf,safeEncode:()=>Df,safeEncodeAsync:()=>Uf,safeParse:()=>Of,safeParseAsync:()=>Rf,set:()=>Kk,setErrorMap:()=>cR,size:()=>Gr,slugify:()=>Kn,startsWith:()=>Mn,strictObject:()=>Fk,string:()=>y,stringFormat:()=>Ik,stringbool:()=>cx,success:()=>Yk,superRefine:()=>wh,symbol:()=>Dk,templateLiteral:()=>tx,toJSONSchema:()=>Xr,toLowerCase:()=>Bn,toUpperCase:()=>Hn,transform:()=>ll,treeifyError:()=>xp,trim:()=>qn,tuple:()=>Qf,uint32:()=>Ak,uint64:()=>zk,ulid:()=>mk,undefined:()=>jk,union:()=>_e,unknown:()=>ge,uppercase:()=>Un,url:()=>sk,util:()=>S,uuid:()=>nk,uuidv4:()=>ok,uuidv6:()=>ik,uuidv7:()=>ak,void:()=>Lk,xid:()=>fk,xor:()=>Vk});var Tt={};Jt(Tt,{$ZodAny:()=>vc,$ZodArray:()=>$c,$ZodAsyncError:()=>wt,$ZodBase64:()=>uc,$ZodBase64URL:()=>lc,$ZodBigInt:()=>Si,$ZodBigIntFormat:()=>hc,$ZodBoolean:()=>Pn,$ZodCIDRv4:()=>sc,$ZodCIDRv6:()=>cc,$ZodCUID:()=>Qs,$ZodCUID2:()=>ec,$ZodCatch:()=>Fc,$ZodCheck:()=>fe,$ZodCheckBigIntFormat:()=>tm,$ZodCheckEndsWith:()=>mm,$ZodCheckGreaterThan:()=>Fs,$ZodCheckIncludes:()=>dm,$ZodCheckLengthEquals:()=>sm,$ZodCheckLessThan:()=>Zs,$ZodCheckLowerCase:()=>um,$ZodCheckMaxLength:()=>im,$ZodCheckMaxSize:()=>rm,$ZodCheckMimeType:()=>hm,$ZodCheckMinLength:()=>am,$ZodCheckMinSize:()=>nm,$ZodCheckMultipleOf:()=>Qp,$ZodCheckNumberFormat:()=>em,$ZodCheckOverwrite:()=>gm,$ZodCheckProperty:()=>fm,$ZodCheckRegex:()=>cm,$ZodCheckSizeEquals:()=>om,$ZodCheckStartsWith:()=>pm,$ZodCheckStringFormat:()=>Tn,$ZodCheckUpperCase:()=>lm,$ZodCodec:()=>Rn,$ZodCustom:()=>Wc,$ZodCustomStringFormat:()=>mc,$ZodDate:()=>Sc,$ZodDefault:()=>Uc,$ZodDiscriminatedUnion:()=>Ec,$ZodE164:()=>dc,$ZodEmail:()=>Ws,$ZodEmoji:()=>Ys,$ZodEncodeError:()=>dr,$ZodEnum:()=>Ac,$ZodError:()=>gi,$ZodExactOptional:()=>Dc,$ZodFile:()=>Nc,$ZodFunction:()=>Hc,$ZodGUID:()=>Ks,$ZodIPv4:()=>oc,$ZodIPv6:()=>ic,$ZodISODate:()=>bm,$ZodISODateTime:()=>vm,$ZodISODuration:()=>xm,$ZodISOTime:()=>km,$ZodIntersection:()=>Tc,$ZodJWT:()=>pc,$ZodKSUID:()=>nc,$ZodLazy:()=>Gc,$ZodLiteral:()=>Cc,$ZodMAC:()=>ac,$ZodMap:()=>Oc,$ZodNaN:()=>Vc,$ZodNanoID:()=>Xs,$ZodNever:()=>kc,$ZodNonOptional:()=>Mc,$ZodNull:()=>yc,$ZodNullable:()=>jc,$ZodNumber:()=>xi,$ZodNumberFormat:()=>fc,$ZodObject:()=>Ic,$ZodObjectJIT:()=>$m,$ZodOptional:()=>Ii,$ZodPipe:()=>wi,$ZodPrefault:()=>Lc,$ZodPreprocess:()=>Im,$ZodPromise:()=>Kc,$ZodReadonly:()=>qc,$ZodRealError:()=>nt,$ZodRecord:()=>Pc,$ZodRegistry:()=>Qc,$ZodSet:()=>Rc,$ZodString:()=>yr,$ZodStringFormat:()=>pe,$ZodSuccess:()=>Zc,$ZodSymbol:()=>gc,$ZodTemplateLiteral:()=>Bc,$ZodTransform:()=>zc,$ZodTuple:()=>$i,$ZodType:()=>B,$ZodULID:()=>tc,$ZodURL:()=>Js,$ZodUUID:()=>Gs,$ZodUndefined:()=>_c,$ZodUnion:()=>On,$ZodUnknown:()=>bc,$ZodVoid:()=>xc,$ZodXID:()=>rc,$ZodXor:()=>wc,$brand:()=>dp,$constructor:()=>h,$input:()=>Em,$output:()=>wm,Doc:()=>ki,JSONSchema:()=>Xb,JSONSchemaGenerator:()=>ju,NEVER:()=>lp,TimePrecision:()=>Pm,_any:()=>gu,_array:()=>Um,_base64:()=>qi,_base64url:()=>Bi,_bigint:()=>lu,_boolean:()=>uu,_catch:()=>YO,_check:()=>Yb,_cidrv4:()=>Fi,_cidrv6:()=>Vi,_coercedBigint:()=>Dm,_coercedBoolean:()=>zm,_coercedDate:()=>jm,_coercedNumber:()=>Nm,_coercedString:()=>Tm,_cuid:()=>zi,_cuid2:()=>Di,_custom:()=>Tu,_date:()=>bu,_decode:()=>As,_decodeAsync:()=>Ns,_default:()=>GO,_discriminatedUnion:()=>DO,_e164:()=>Hi,_email:()=>Ti,_emoji:()=>Ci,_encode:()=>Rs,_encodeAsync:()=>Cs,_endsWith:()=>Zn,_enum:()=>FO,_file:()=>Eu,_float32:()=>iu,_float64:()=>au,_gt:()=>Zt,_gte:()=>Ge,_guid:()=>Nn,_includes:()=>Ln,_int:()=>ou,_int32:()=>su,_int64:()=>du,_intersection:()=>jO,_ipv4:()=>Mi,_ipv6:()=>Zi,_isoDate:()=>Rm,_isoDateTime:()=>Om,_isoDuration:()=>Cm,_isoTime:()=>Am,_jwt:()=>Ki,_ksuid:()=>Li,_lazy:()=>tR,_length:()=>Jr,_literal:()=>qO,_lowercase:()=>jn,_lt:()=>Mt,_lte:()=>dt,_mac:()=>ru,_map:()=>MO,_max:()=>dt,_maxLength:()=>Wr,_maxSize:()=>br,_mime:()=>Fn,_min:()=>Ge,_minLength:()=>Xt,_minSize:()=>Ft,_multipleOf:()=>vr,_nan:()=>ku,_nanoid:()=>Ni,_nativeEnum:()=>VO,_negative:()=>Su,_never:()=>yu,_nonnegative:()=>Iu,_nonoptional:()=>WO,_nonpositive:()=>$u,_normalize:()=>Vn,_null:()=>hu,_nullable:()=>KO,_number:()=>nu,_optional:()=>HO,_overwrite:()=>Et,_parse:()=>$n,_parseAsync:()=>In,_pipe:()=>XO,_positive:()=>xu,_promise:()=>rR,_property:()=>wu,_readonly:()=>QO,_record:()=>LO,_refine:()=>Pu,_regex:()=>Dn,_safeDecode:()=>Ds,_safeDecodeAsync:()=>Us,_safeEncode:()=>zs,_safeEncodeAsync:()=>js,_safeParse:()=>wn,_safeParseAsync:()=>En,_set:()=>ZO,_size:()=>Gr,_slugify:()=>Kn,_startsWith:()=>Mn,_string:()=>tu,_stringFormat:()=>Yr,_stringbool:()=>Cu,_success:()=>JO,_superRefine:()=>Ou,_symbol:()=>mu,_templateLiteral:()=>eR,_toLowerCase:()=>Bn,_toUpperCase:()=>Hn,_transform:()=>BO,_trim:()=>qn,_tuple:()=>UO,_uint32:()=>cu,_uint64:()=>pu,_ulid:()=>ji,_undefined:()=>fu,_union:()=>NO,_unknown:()=>_u,_uppercase:()=>Un,_url:()=>zn,_uuid:()=>Pi,_uuidv4:()=>Oi,_uuidv6:()=>Ri,_uuidv7:()=>Ai,_void:()=>vu,_xid:()=>Ui,_xor:()=>zO,clone:()=>Ae,config:()=>Te,createStandardJSONSchemaMethod:()=>Gn,createToJSONSchemaMethod:()=>Lm,decode:()=>bv,decodeAsync:()=>xv,describe:()=>Ru,encode:()=>vv,encodeAsync:()=>kv,extractDefs:()=>xr,finalize:()=>Sr,flattenError:()=>_i,formatError:()=>yi,globalConfig:()=>Vr,globalRegistry:()=>Ce,initializeContext:()=>kr,isValidBase64:()=>Sm,isValidBase64URL:()=>Kv,isValidJWT:()=>Gv,locales:()=>Cn,meta:()=>Au,parse:()=>Br,parseAsync:()=>Hr,prettifyError:()=>Sp,process:()=>de,regexes:()=>ot,registry:()=>eu,safeDecode:()=>$v,safeDecodeAsync:()=>wv,safeEncode:()=>Sv,safeEncodeAsync:()=>Iv,safeParse:()=>gr,safeParseAsync:()=>_r,toDotPath:()=>yv,toJSONSchema:()=>Xr,treeifyError:()=>xp,util:()=>S,version:()=>_m});var sv,lp=Object.freeze({status:"aborted"});function h(t,e,n){function o(c,u){if(c._zod||Object.defineProperty(c,"_zod",{value:{def:u,constr:a,traits:new Set},enumerable:!1}),c._zod.traits.has(t))return;c._zod.traits.add(t),e(c,u);let d=a.prototype,l=Object.keys(d);for(let p=0;p<l.length;p++){let m=l[p];m in c||(c[m]=d[m].bind(c))}}let r=n?.Parent??Object;class i extends r{}Object.defineProperty(i,"name",{value:t});function a(c){var u;let d=n?.Parent?new i:this;o(d,c),(u=d._zod).deferred??(u.deferred=[]);for(let l of d._zod.deferred)l();return d}return Object.defineProperty(a,"init",{value:o}),Object.defineProperty(a,Symbol.hasInstance,{value:c=>n?.Parent&&c instanceof n.Parent?!0:c?._zod?.traits?.has(t)}),Object.defineProperty(a,"name",{value:t}),a}var dp=Symbol("zod_brand"),wt=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},dr=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}};(sv=globalThis).__zod_globalConfig??(sv.__zod_globalConfig={});var Vr=globalThis.__zod_globalConfig;function Te(t){return t&&Object.assign(Vr,t),Vr}var S={};Jt(S,{BIGINT_FORMAT_RANGES:()=>bp,Class:()=>mp,NUMBER_FORMAT_RANGES:()=>vp,aborted:()=>hr,allowsEval:()=>gp,assert:()=>K0,assertEqual:()=>V0,assertIs:()=>B0,assertNever:()=>H0,assertNotEqual:()=>q0,assignProp:()=>mr,base64ToUint8Array:()=>hv,base64urlToUint8Array:()=>oP,cached:()=>xn,captureStackTrace:()=>Ps,cleanEnum:()=>nP,cleanRegex:()=>pi,clone:()=>Ae,cloneDef:()=>W0,createTransparentProxy:()=>tP,defineLazy:()=>W,esc:()=>Ts,escapeRegex:()=>gt,explicitlyAborted:()=>kp,extend:()=>dv,finalizeIssue:()=>Ke,floatSafeRemainder:()=>fp,getElementAtPath:()=>J0,getEnumValues:()=>di,getLengthableOrigin:()=>hi,getParsedType:()=>eP,getSizableOrigin:()=>fi,hexToUint8Array:()=>aP,isObject:()=>qr,isPlainObject:()=>fr,issue:()=>Sn,joinValues:()=>_,jsonStringifyReplacer:()=>kn,merge:()=>rP,mergeDefs:()=>Yt,normalizeParams:()=>I,nullish:()=>pr,numKeys:()=>Q0,objectClone:()=>G0,omit:()=>lv,optionalKeys:()=>yp,parsedType:()=>x,partial:()=>mv,pick:()=>uv,prefixIssues:()=>rt,primitiveTypes:()=>_p,promiseAllObject:()=>Y0,propertyKeyTypes:()=>mi,randomString:()=>X0,required:()=>fv,safeExtend:()=>pv,shallowClone:()=>Os,slugify:()=>hp,stringifyPrimitive:()=>k,uint8ArrayToBase64:()=>gv,uint8ArrayToBase64url:()=>iP,uint8ArrayToHex:()=>sP,unwrapMessage:()=>li});function V0(t){return t}function q0(t){return t}function B0(t){}function H0(t){throw new Error("Unexpected value in exhaustive check")}function K0(t){}function di(t){let e=Object.values(t).filter(o=>typeof o=="number");return Object.entries(t).filter(([o,r])=>e.indexOf(+o)===-1).map(([o,r])=>r)}function _(t,e="|"){return t.map(n=>k(n)).join(e)}function kn(t,e){return typeof e=="bigint"?e.toString():e}function xn(t){return{get value(){{let n=t();return Object.defineProperty(this,"value",{value:n}),n}throw new Error("cached value already set")}}}function pr(t){return t==null}function pi(t){let e=t.startsWith("^")?1:0,n=t.endsWith("$")?t.length-1:t.length;return t.slice(e,n)}function fp(t,e){let n=t/e,o=Math.round(n),r=Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-o)<r?0:n-o}var cv=Symbol("evaluating");function W(t,e,n){let o;Object.defineProperty(t,e,{get(){if(o!==cv)return o===void 0&&(o=cv,o=n()),o},set(r){Object.defineProperty(t,e,{value:r})},configurable:!0})}function G0(t){return Object.create(Object.getPrototypeOf(t),Object.getOwnPropertyDescriptors(t))}function mr(t,e,n){Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Yt(...t){let e={};for(let n of t){let o=Object.getOwnPropertyDescriptors(n);Object.assign(e,o)}return Object.defineProperties({},e)}function W0(t){return Yt(t._zod.def)}function J0(t,e){return e?e.reduce((n,o)=>n?.[o],t):t}function Y0(t){let e=Object.keys(t),n=e.map(o=>t[o]);return Promise.all(n).then(o=>{let r={};for(let i=0;i<e.length;i++)r[e[i]]=o[i];return r})}function X0(t=10){let e="abcdefghijklmnopqrstuvwxyz",n="";for(let o=0;o<t;o++)n+=e[Math.floor(Math.random()*e.length)];return n}function Ts(t){return JSON.stringify(t)}function hp(t){return t.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Ps="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function qr(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}var gp=xn(()=>{if(Vr.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let t=Function;return new t(""),!0}catch{return!1}});function fr(t){if(qr(t)===!1)return!1;let e=t.constructor;if(e===void 0||typeof e!="function")return!0;let n=e.prototype;return!(qr(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function Os(t){return fr(t)?{...t}:Array.isArray(t)?[...t]:t instanceof Map?new Map(t):t instanceof Set?new Set(t):t}function Q0(t){let e=0;for(let n in t)Object.prototype.hasOwnProperty.call(t,n)&&e++;return e}var eP=t=>{let e=typeof t;switch(e){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(t)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(t)?"array":t===null?"null":t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?"promise":typeof Map<"u"&&t instanceof Map?"map":typeof Set<"u"&&t instanceof Set?"set":typeof Date<"u"&&t instanceof Date?"date":typeof File<"u"&&t instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${e}`)}},mi=new Set(["string","number","symbol"]),_p=new Set(["string","number","bigint","boolean","symbol","undefined"]);function gt(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ae(t,e,n){let o=new t._zod.constr(e??t._zod.def);return(!e||n?.parent)&&(o._zod.parent=t),o}function I(t){let e=t;if(!e)return{};if(typeof e=="string")return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:()=>e.error}:e}function tP(t){let e;return new Proxy({},{get(n,o,r){return e??(e=t()),Reflect.get(e,o,r)},set(n,o,r,i){return e??(e=t()),Reflect.set(e,o,r,i)},has(n,o){return e??(e=t()),Reflect.has(e,o)},deleteProperty(n,o){return e??(e=t()),Reflect.deleteProperty(e,o)},ownKeys(n){return e??(e=t()),Reflect.ownKeys(e)},getOwnPropertyDescriptor(n,o){return e??(e=t()),Reflect.getOwnPropertyDescriptor(e,o)},defineProperty(n,o,r){return e??(e=t()),Reflect.defineProperty(e,o,r)}})}function k(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}function yp(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}var vp={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},bp={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function uv(t,e){let n=t._zod.def,o=n.checks;if(o&&o.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let i=Yt(t._zod.def,{get shape(){let a={};for(let c in e){if(!(c in n.shape))throw new Error(`Unrecognized key: "${c}"`);e[c]&&(a[c]=n.shape[c])}return mr(this,"shape",a),a},checks:[]});return Ae(t,i)}function lv(t,e){let n=t._zod.def,o=n.checks;if(o&&o.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let i=Yt(t._zod.def,{get shape(){let a={...t._zod.def.shape};for(let c in e){if(!(c in n.shape))throw new Error(`Unrecognized key: "${c}"`);e[c]&&delete a[c]}return mr(this,"shape",a),a},checks:[]});return Ae(t,i)}function dv(t,e){if(!fr(e))throw new Error("Invalid input to extend: expected a plain object");let n=t._zod.def.checks;if(n&&n.length>0){let i=t._zod.def.shape;for(let a in e)if(Object.getOwnPropertyDescriptor(i,a)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let r=Yt(t._zod.def,{get shape(){let i={...t._zod.def.shape,...e};return mr(this,"shape",i),i}});return Ae(t,r)}function pv(t,e){if(!fr(e))throw new Error("Invalid input to safeExtend: expected a plain object");let n=Yt(t._zod.def,{get shape(){let o={...t._zod.def.shape,...e};return mr(this,"shape",o),o}});return Ae(t,n)}function rP(t,e){if(t._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let n=Yt(t._zod.def,{get shape(){let o={...t._zod.def.shape,...e._zod.def.shape};return mr(this,"shape",o),o},get catchall(){return e._zod.def.catchall},checks:e._zod.def.checks??[]});return Ae(t,n)}function mv(t,e,n){let r=e._zod.def.checks;if(r&&r.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let a=Yt(e._zod.def,{get shape(){let c=e._zod.def.shape,u={...c};if(n)for(let d in n){if(!(d in c))throw new Error(`Unrecognized key: "${d}"`);n[d]&&(u[d]=t?new t({type:"optional",innerType:c[d]}):c[d])}else for(let d in c)u[d]=t?new t({type:"optional",innerType:c[d]}):c[d];return mr(this,"shape",u),u},checks:[]});return Ae(e,a)}function fv(t,e,n){let o=Yt(e._zod.def,{get shape(){let r=e._zod.def.shape,i={...r};if(n)for(let a in n){if(!(a in i))throw new Error(`Unrecognized key: "${a}"`);n[a]&&(i[a]=new t({type:"nonoptional",innerType:r[a]}))}else for(let a in r)i[a]=new t({type:"nonoptional",innerType:r[a]});return mr(this,"shape",i),i}});return Ae(e,o)}function hr(t,e=0){if(t.aborted===!0)return!0;for(let n=e;n<t.issues.length;n++)if(t.issues[n]?.continue!==!0)return!0;return!1}function kp(t,e=0){if(t.aborted===!0)return!0;for(let n=e;n<t.issues.length;n++)if(t.issues[n]?.continue===!1)return!0;return!1}function rt(t,e){return e.map(n=>{var o;return(o=n).path??(o.path=[]),n.path.unshift(t),n})}function li(t){return typeof t=="string"?t:t?.message}function Ke(t,e,n){let o=t.message?t.message:li(t.inst?._zod.def?.error?.(t))??li(e?.error?.(t))??li(n.customError?.(t))??li(n.localeError?.(t))??"Invalid input",{inst:r,continue:i,input:a,...c}=t;return c.path??(c.path=[]),c.message=o,e?.reportInput&&(c.input=a),c}function fi(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}function hi(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function x(t){let e=typeof t;switch(e){case"number":return Number.isNaN(t)?"nan":"number";case"object":{if(t===null)return"null";if(Array.isArray(t))return"array";let n=t;if(n&&Object.getPrototypeOf(n)!==Object.prototype&&"constructor"in n&&n.constructor)return n.constructor.name}}return e}function Sn(...t){let[e,n,o]=t;return typeof e=="string"?{message:e,code:"custom",input:n,inst:o}:{...e}}function nP(t){return Object.entries(t).filter(([e,n])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function hv(t){let e=atob(t),n=new Uint8Array(e.length);for(let o=0;o<e.length;o++)n[o]=e.charCodeAt(o);return n}function gv(t){let e="";for(let n=0;n<t.length;n++)e+=String.fromCharCode(t[n]);return btoa(e)}function oP(t){let e=t.replace(/-/g,"+").replace(/_/g,"/"),n="=".repeat((4-e.length%4)%4);return hv(e+n)}function iP(t){return gv(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function aP(t){let e=t.replace(/^0x/,"");if(e.length%2!==0)throw new Error("Invalid hex string length");let n=new Uint8Array(e.length/2);for(let o=0;o<e.length;o+=2)n[o/2]=Number.parseInt(e.slice(o,o+2),16);return n}function sP(t){return Array.from(t).map(e=>e.toString(16).padStart(2,"0")).join("")}var mp=class{constructor(...e){}};var _v=(t,e)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:!1}),Object.defineProperty(t,"issues",{value:e,enumerable:!1}),t.message=JSON.stringify(e,kn,2),Object.defineProperty(t,"toString",{value:()=>t.message,enumerable:!1})},gi=h("$ZodError",_v),nt=h("$ZodError",_v,{Parent:Error});function _i(t,e=n=>n.message){let n={},o=[];for(let r of t.issues)r.path.length>0?(n[r.path[0]]=n[r.path[0]]||[],n[r.path[0]].push(e(r))):o.push(e(r));return{formErrors:o,fieldErrors:n}}function yi(t,e=n=>n.message){let n={_errors:[]},o=(r,i=[])=>{for(let a of r.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(c=>o({issues:c},[...i,...a.path]));else if(a.code==="invalid_key")o({issues:a.issues},[...i,...a.path]);else if(a.code==="invalid_element")o({issues:a.issues},[...i,...a.path]);else{let c=[...i,...a.path];if(c.length===0)n._errors.push(e(a));else{let u=n,d=0;for(;d<c.length;){let l=c[d];d===c.length-1?(u[l]=u[l]||{_errors:[]},u[l]._errors.push(e(a))):u[l]=u[l]||{_errors:[]},u=u[l],d++}}}};return o(t),n}function xp(t,e=n=>n.message){let n={errors:[]},o=(r,i=[])=>{var a,c;for(let u of r.issues)if(u.code==="invalid_union"&&u.errors.length)u.errors.map(d=>o({issues:d},[...i,...u.path]));else if(u.code==="invalid_key")o({issues:u.issues},[...i,...u.path]);else if(u.code==="invalid_element")o({issues:u.issues},[...i,...u.path]);else{let d=[...i,...u.path];if(d.length===0){n.errors.push(e(u));continue}let l=n,p=0;for(;p<d.length;){let m=d[p],f=p===d.length-1;typeof m=="string"?(l.properties??(l.properties={}),(a=l.properties)[m]??(a[m]={errors:[]}),l=l.properties[m]):(l.items??(l.items=[]),(c=l.items)[m]??(c[m]={errors:[]}),l=l.items[m]),f&&l.errors.push(e(u)),p++}}};return o(t),n}function yv(t){let e=[],n=t.map(o=>typeof o=="object"?o.key:o);for(let o of n)typeof o=="number"?e.push(`[${o}]`):typeof o=="symbol"?e.push(`[${JSON.stringify(String(o))}]`):/[^\w$]/.test(o)?e.push(`[${JSON.stringify(o)}]`):(e.length&&e.push("."),e.push(o));return e.join("")}function Sp(t){let e=[],n=[...t.issues].sort((o,r)=>(o.path??[]).length-(r.path??[]).length);for(let o of n)e.push(`\u2716 ${o.message}`),o.path?.length&&e.push(` \u2192 at ${yv(o.path)}`);return e.join(`
|
|
11
|
-
`)}var $n=t=>(e,n,o,r)=>{let i=o?{...o,async:!1}:{async:!1},a=e._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new wt;if(a.issues.length){let c=new(r?.Err??t)(a.issues.map(u=>Ke(u,i,Te())));throw Ps(c,r?.callee),c}return a.value},Br=$n(nt),In=t=>async(e,n,o,r)=>{let i=o?{...o,async:!0}:{async:!0},a=e._zod.run({value:n,issues:[]},i);if(a instanceof Promise&&(a=await a),a.issues.length){let c=new(r?.Err??t)(a.issues.map(u=>Ke(u,i,Te())));throw Ps(c,r?.callee),c}return a.value},Hr=In(nt),wn=t=>(e,n,o)=>{let r=o?{...o,async:!1}:{async:!1},i=e._zod.run({value:n,issues:[]},r);if(i instanceof Promise)throw new wt;return i.issues.length?{success:!1,error:new(t??gi)(i.issues.map(a=>Ke(a,r,Te())))}:{success:!0,data:i.value}},gr=wn(nt),En=t=>async(e,n,o)=>{let r=o?{...o,async:!0}:{async:!0},i=e._zod.run({value:n,issues:[]},r);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new t(i.issues.map(a=>Ke(a,r,Te())))}:{success:!0,data:i.value}},_r=En(nt),Rs=t=>(e,n,o)=>{let r=o?{...o,direction:"backward"}:{direction:"backward"};return $n(t)(e,n,r)},vv=Rs(nt),As=t=>(e,n,o)=>$n(t)(e,n,o),bv=As(nt),Cs=t=>async(e,n,o)=>{let r=o?{...o,direction:"backward"}:{direction:"backward"};return In(t)(e,n,r)},kv=Cs(nt),Ns=t=>async(e,n,o)=>In(t)(e,n,o),xv=Ns(nt),zs=t=>(e,n,o)=>{let r=o?{...o,direction:"backward"}:{direction:"backward"};return wn(t)(e,n,r)},Sv=zs(nt),Ds=t=>(e,n,o)=>wn(t)(e,n,o),$v=Ds(nt),js=t=>async(e,n,o)=>{let r=o?{...o,direction:"backward"}:{direction:"backward"};return En(t)(e,n,r)},Iv=js(nt),Us=t=>async(e,n,o)=>En(t)(e,n,o),wv=Us(nt);var ot={};Jt(ot,{base64:()=>Lp,base64url:()=>Ls,bigint:()=>Hp,boolean:()=>Gp,browserEmail:()=>gP,cidrv4:()=>jp,cidrv6:()=>Up,cuid:()=>$p,cuid2:()=>Ip,date:()=>Fp,datetime:()=>qp,domain:()=>vP,duration:()=>Op,e164:()=>Zp,email:()=>Ap,emoji:()=>Cp,extendedDuration:()=>uP,guid:()=>Rp,hex:()=>bP,hostname:()=>yP,html5Email:()=>mP,httpProtocol:()=>Mp,idnEmail:()=>hP,integer:()=>Kp,ipv4:()=>Np,ipv6:()=>zp,ksuid:()=>Tp,lowercase:()=>Yp,mac:()=>Dp,md5_base64:()=>xP,md5_base64url:()=>SP,md5_hex:()=>kP,nanoid:()=>Pp,null:()=>Wp,number:()=>Ms,rfc5322Email:()=>fP,sha1_base64:()=>IP,sha1_base64url:()=>wP,sha1_hex:()=>$P,sha256_base64:()=>TP,sha256_base64url:()=>PP,sha256_hex:()=>EP,sha384_base64:()=>RP,sha384_base64url:()=>AP,sha384_hex:()=>OP,sha512_base64:()=>NP,sha512_base64url:()=>zP,sha512_hex:()=>CP,string:()=>Bp,time:()=>Vp,ulid:()=>wp,undefined:()=>Jp,unicodeEmail:()=>Ev,uppercase:()=>Xp,uuid:()=>Kr,uuid4:()=>lP,uuid6:()=>dP,uuid7:()=>pP,xid:()=>Ep});var $p=/^[cC][0-9a-z]{6,}$/,Ip=/^[0-9a-z]+$/,wp=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Ep=/^[0-9a-vA-V]{20}$/,Tp=/^[A-Za-z0-9]{27}$/,Pp=/^[a-zA-Z0-9_-]{21}$/,Op=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,uP=/^[-+]?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)?)??$/,Rp=/^([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})$/,Kr=t=>t?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,lP=Kr(4),dP=Kr(6),pP=Kr(7),Ap=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,mP=/^[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])?)*$/,fP=/^(([^<>()\[\]\\.,;:\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,}))$/,Ev=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,hP=Ev,gP=/^[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])?)*$/,_P="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Cp(){return new RegExp(_P,"u")}var Np=/^(?:(?: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])$/,zp=/^(([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}|:))$/,Dp=t=>{let e=gt(t??":");return new RegExp(`^(?:[0-9A-F]{2}${e}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${e}){5}[0-9a-f]{2}$`)},jp=/^((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])$/,Up=/^(([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])$/,Lp=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Ls=/^[A-Za-z0-9_-]*$/,yP=/^(?=.{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])?)*\.?$/,vP=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Mp=/^https?$/,Zp=/^\+[1-9]\d{6,14}$/,Tv="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Fp=new RegExp(`^${Tv}$`);function Pv(t){let e="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof t.precision=="number"?t.precision===-1?`${e}`:t.precision===0?`${e}:[0-5]\\d`:`${e}:[0-5]\\d\\.\\d{${t.precision}}`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Vp(t){return new RegExp(`^${Pv(t)}$`)}function qp(t){let e=Pv({precision:t.precision}),n=["Z"];t.local&&n.push(""),t.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let o=`${e}(?:${n.join("|")})`;return new RegExp(`^${Tv}T(?:${o})$`)}var Bp=t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},Hp=/^-?\d+n?$/,Kp=/^-?\d+$/,Ms=/^-?\d+(?:\.\d+)?$/,Gp=/^(?:true|false)$/i,Wp=/^null$/i;var Jp=/^undefined$/i;var Yp=/^[^A-Z]*$/,Xp=/^[^a-z]*$/,bP=/^[0-9a-fA-F]*$/;function vi(t,e){return new RegExp(`^[A-Za-z0-9+/]{${t}}${e}$`)}function bi(t){return new RegExp(`^[A-Za-z0-9_-]{${t}}$`)}var kP=/^[0-9a-fA-F]{32}$/,xP=vi(22,"=="),SP=bi(22),$P=/^[0-9a-fA-F]{40}$/,IP=vi(27,"="),wP=bi(27),EP=/^[0-9a-fA-F]{64}$/,TP=vi(43,"="),PP=bi(43),OP=/^[0-9a-fA-F]{96}$/,RP=vi(64,""),AP=bi(64),CP=/^[0-9a-fA-F]{128}$/,NP=vi(86,"=="),zP=bi(86);var fe=h("$ZodCheck",(t,e)=>{var n;t._zod??(t._zod={}),t._zod.def=e,(n=t._zod).onattach??(n.onattach=[])}),Rv={number:"number",bigint:"bigint",object:"date"},Zs=h("$ZodCheckLessThan",(t,e)=>{fe.init(t,e);let n=Rv[typeof e.value];t._zod.onattach.push(o=>{let r=o._zod.bag,i=(e.inclusive?r.maximum:r.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value<i&&(e.inclusive?r.maximum=e.value:r.exclusiveMaximum=e.value)}),t._zod.check=o=>{(e.inclusive?o.value<=e.value:o.value<e.value)||o.issues.push({origin:n,code:"too_big",maximum:typeof e.value=="object"?e.value.getTime():e.value,input:o.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),Fs=h("$ZodCheckGreaterThan",(t,e)=>{fe.init(t,e);let n=Rv[typeof e.value];t._zod.onattach.push(o=>{let r=o._zod.bag,i=(e.inclusive?r.minimum:r.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>i&&(e.inclusive?r.minimum=e.value:r.exclusiveMinimum=e.value)}),t._zod.check=o=>{(e.inclusive?o.value>=e.value:o.value>e.value)||o.issues.push({origin:n,code:"too_small",minimum:typeof e.value=="object"?e.value.getTime():e.value,input:o.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),Qp=h("$ZodCheckMultipleOf",(t,e)=>{fe.init(t,e),t._zod.onattach.push(n=>{var o;(o=n._zod.bag).multipleOf??(o.multipleOf=e.value)}),t._zod.check=n=>{if(typeof n.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%e.value===BigInt(0):fp(n.value,e.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:e.value,input:n.value,inst:t,continue:!e.abort})}}),em=h("$ZodCheckNumberFormat",(t,e)=>{fe.init(t,e),e.format=e.format||"float64";let n=e.format?.includes("int"),o=n?"int":"number",[r,i]=vp[e.format];t._zod.onattach.push(a=>{let c=a._zod.bag;c.format=e.format,c.minimum=r,c.maximum=i,n&&(c.pattern=Kp)}),t._zod.check=a=>{let c=a.value;if(n){if(!Number.isInteger(c)){a.issues.push({expected:o,format:e.format,code:"invalid_type",continue:!1,input:c,inst:t});return}if(!Number.isSafeInteger(c)){c>0?a.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:o,inclusive:!0,continue:!e.abort}):a.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:o,inclusive:!0,continue:!e.abort});return}}c<r&&a.issues.push({origin:"number",input:c,code:"too_small",minimum:r,inclusive:!0,inst:t,continue:!e.abort}),c>i&&a.issues.push({origin:"number",input:c,code:"too_big",maximum:i,inclusive:!0,inst:t,continue:!e.abort})}}),tm=h("$ZodCheckBigIntFormat",(t,e)=>{fe.init(t,e);let[n,o]=bp[e.format];t._zod.onattach.push(r=>{let i=r._zod.bag;i.format=e.format,i.minimum=n,i.maximum=o}),t._zod.check=r=>{let i=r.value;i<n&&r.issues.push({origin:"bigint",input:i,code:"too_small",minimum:n,inclusive:!0,inst:t,continue:!e.abort}),i>o&&r.issues.push({origin:"bigint",input:i,code:"too_big",maximum:o,inclusive:!0,inst:t,continue:!e.abort})}}),rm=h("$ZodCheckMaxSize",(t,e)=>{var n;fe.init(t,e),(n=t._zod.def).when??(n.when=o=>{let r=o.value;return!pr(r)&&r.size!==void 0}),t._zod.onattach.push(o=>{let r=o._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<r&&(o._zod.bag.maximum=e.maximum)}),t._zod.check=o=>{let r=o.value;r.size<=e.maximum||o.issues.push({origin:fi(r),code:"too_big",maximum:e.maximum,inclusive:!0,input:r,inst:t,continue:!e.abort})}}),nm=h("$ZodCheckMinSize",(t,e)=>{var n;fe.init(t,e),(n=t._zod.def).when??(n.when=o=>{let r=o.value;return!pr(r)&&r.size!==void 0}),t._zod.onattach.push(o=>{let r=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>r&&(o._zod.bag.minimum=e.minimum)}),t._zod.check=o=>{let r=o.value;r.size>=e.minimum||o.issues.push({origin:fi(r),code:"too_small",minimum:e.minimum,inclusive:!0,input:r,inst:t,continue:!e.abort})}}),om=h("$ZodCheckSizeEquals",(t,e)=>{var n;fe.init(t,e),(n=t._zod.def).when??(n.when=o=>{let r=o.value;return!pr(r)&&r.size!==void 0}),t._zod.onattach.push(o=>{let r=o._zod.bag;r.minimum=e.size,r.maximum=e.size,r.size=e.size}),t._zod.check=o=>{let r=o.value,i=r.size;if(i===e.size)return;let a=i>e.size;o.issues.push({origin:fi(r),...a?{code:"too_big",maximum:e.size}:{code:"too_small",minimum:e.size},inclusive:!0,exact:!0,input:o.value,inst:t,continue:!e.abort})}}),im=h("$ZodCheckMaxLength",(t,e)=>{var n;fe.init(t,e),(n=t._zod.def).when??(n.when=o=>{let r=o.value;return!pr(r)&&r.length!==void 0}),t._zod.onattach.push(o=>{let r=o._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<r&&(o._zod.bag.maximum=e.maximum)}),t._zod.check=o=>{let r=o.value;if(r.length<=e.maximum)return;let a=hi(r);o.issues.push({origin:a,code:"too_big",maximum:e.maximum,inclusive:!0,input:r,inst:t,continue:!e.abort})}}),am=h("$ZodCheckMinLength",(t,e)=>{var n;fe.init(t,e),(n=t._zod.def).when??(n.when=o=>{let r=o.value;return!pr(r)&&r.length!==void 0}),t._zod.onattach.push(o=>{let r=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>r&&(o._zod.bag.minimum=e.minimum)}),t._zod.check=o=>{let r=o.value;if(r.length>=e.minimum)return;let a=hi(r);o.issues.push({origin:a,code:"too_small",minimum:e.minimum,inclusive:!0,input:r,inst:t,continue:!e.abort})}}),sm=h("$ZodCheckLengthEquals",(t,e)=>{var n;fe.init(t,e),(n=t._zod.def).when??(n.when=o=>{let r=o.value;return!pr(r)&&r.length!==void 0}),t._zod.onattach.push(o=>{let r=o._zod.bag;r.minimum=e.length,r.maximum=e.length,r.length=e.length}),t._zod.check=o=>{let r=o.value,i=r.length;if(i===e.length)return;let a=hi(r),c=i>e.length;o.issues.push({origin:a,...c?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:o.value,inst:t,continue:!e.abort})}}),Tn=h("$ZodCheckStringFormat",(t,e)=>{var n,o;fe.init(t,e),t._zod.onattach.push(r=>{let i=r._zod.bag;i.format=e.format,e.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(e.pattern))}),e.pattern?(n=t._zod).check??(n.check=r=>{e.pattern.lastIndex=0,!e.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:e.format,input:r.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})}):(o=t._zod).check??(o.check=()=>{})}),cm=h("$ZodCheckRegex",(t,e)=>{Tn.init(t,e),t._zod.check=n=>{e.pattern.lastIndex=0,!e.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:e.pattern.toString(),inst:t,continue:!e.abort})}}),um=h("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=Yp),Tn.init(t,e)}),lm=h("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=Xp),Tn.init(t,e)}),dm=h("$ZodCheckIncludes",(t,e)=>{fe.init(t,e);let n=gt(e.includes),o=new RegExp(typeof e.position=="number"?`^.{${e.position}}${n}`:n);e.pattern=o,t._zod.onattach.push(r=>{let i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(o)}),t._zod.check=r=>{r.value.includes(e.includes,e.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:r.value,inst:t,continue:!e.abort})}}),pm=h("$ZodCheckStartsWith",(t,e)=>{fe.init(t,e);let n=new RegExp(`^${gt(e.prefix)}.*`);e.pattern??(e.pattern=n),t._zod.onattach.push(o=>{let r=o._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(n)}),t._zod.check=o=>{o.value.startsWith(e.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:o.value,inst:t,continue:!e.abort})}}),mm=h("$ZodCheckEndsWith",(t,e)=>{fe.init(t,e);let n=new RegExp(`.*${gt(e.suffix)}$`);e.pattern??(e.pattern=n),t._zod.onattach.push(o=>{let r=o._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(n)}),t._zod.check=o=>{o.value.endsWith(e.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:o.value,inst:t,continue:!e.abort})}});function Ov(t,e,n){t.issues.length&&e.issues.push(...rt(n,t.issues))}var fm=h("$ZodCheckProperty",(t,e)=>{fe.init(t,e),t._zod.check=n=>{let o=e.schema._zod.run({value:n.value[e.property],issues:[]},{});if(o instanceof Promise)return o.then(r=>Ov(r,n,e.property));Ov(o,n,e.property)}}),hm=h("$ZodCheckMimeType",(t,e)=>{fe.init(t,e);let n=new Set(e.mime);t._zod.onattach.push(o=>{o._zod.bag.mime=e.mime}),t._zod.check=o=>{n.has(o.value.type)||o.issues.push({code:"invalid_value",values:e.mime,input:o.value.type,inst:t,continue:!e.abort})}}),gm=h("$ZodCheckOverwrite",(t,e)=>{fe.init(t,e),t._zod.check=n=>{n.value=e.tx(n.value)}});var ki=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let o=e.split(`
|
|
12
|
-
`).filter(
|
|
13
|
-
`))}};var _m={major:4,minor:4,patch:3};var B=h("$ZodType",(t,e)=>{var n;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=_m;let o=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&o.unshift(t);for(let r of o)for(let i of r._zod.onattach)i(t);if(o.length===0)(n=t._zod).deferred??(n.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{let r=(a,c,u)=>{let d=hr(a),l;for(let p of c){if(p._zod.def.when){if(kp(a)||!p._zod.def.when(a))continue}else if(d)continue;let m=a.issues.length,f=p._zod.check(a);if(f instanceof Promise&&u?.async===!1)throw new wt;if(l||f instanceof Promise)l=(l??Promise.resolve()).then(async()=>{await f,a.issues.length!==m&&(d||(d=hr(a,m)))});else{if(a.issues.length===m)continue;d||(d=hr(a,m))}}return l?l.then(()=>a):a},i=(a,c,u)=>{if(hr(a))return a.aborted=!0,a;let d=r(c,o,u);if(d instanceof Promise){if(u.async===!1)throw new wt;return d.then(l=>t._zod.parse(l,u))}return t._zod.parse(d,u)};t._zod.run=(a,c)=>{if(c.skipChecks)return t._zod.parse(a,c);if(c.direction==="backward"){let d=t._zod.parse({value:a.value,issues:[]},{...c,skipChecks:!0});return d instanceof Promise?d.then(l=>i(l,a,c)):i(d,a,c)}let u=t._zod.parse(a,c);if(u instanceof Promise){if(c.async===!1)throw new wt;return u.then(d=>r(d,o,c))}return r(u,o,c)}}W(t,"~standard",()=>({validate:r=>{try{let i=gr(t,r);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return _r(t,r).then(a=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}))}),yr=h("$ZodString",(t,e)=>{B.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??Bp(t._zod.bag),t._zod.parse=(n,o)=>{if(e.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:t}),n}}),pe=h("$ZodStringFormat",(t,e)=>{Tn.init(t,e),yr.init(t,e)}),Ks=h("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=Rp),pe.init(t,e)}),Gs=h("$ZodUUID",(t,e)=>{if(e.version){let o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(o===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=Kr(o))}else e.pattern??(e.pattern=Kr());pe.init(t,e)}),Ws=h("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=Ap),pe.init(t,e)}),Js=h("$ZodURL",(t,e)=>{pe.init(t,e),t._zod.check=n=>{try{let o=n.value.trim();if(!e.normalize&&e.protocol?.source===Mp.source&&!/^https?:\/\//i.test(o)){n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:t,continue:!e.abort});return}let r=new URL(o);e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(r.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:e.hostname.source,input:n.value,inst:t,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(r.protocol.endsWith(":")?r.protocol.slice(0,-1):r.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:n.value,inst:t,continue:!e.abort})),e.normalize?n.value=r.href:n.value=o;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:t,continue:!e.abort})}}}),Ys=h("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=Cp()),pe.init(t,e)}),Xs=h("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=Pp),pe.init(t,e)}),Qs=h("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=$p),pe.init(t,e)}),ec=h("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=Ip),pe.init(t,e)}),tc=h("$ZodULID",(t,e)=>{e.pattern??(e.pattern=wp),pe.init(t,e)}),rc=h("$ZodXID",(t,e)=>{e.pattern??(e.pattern=Ep),pe.init(t,e)}),nc=h("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=Tp),pe.init(t,e)}),vm=h("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=qp(e)),pe.init(t,e)}),bm=h("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=Fp),pe.init(t,e)}),km=h("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=Vp(e)),pe.init(t,e)}),xm=h("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=Op),pe.init(t,e)}),oc=h("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=Np),pe.init(t,e),t._zod.bag.format="ipv4"}),ic=h("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=zp),pe.init(t,e),t._zod.bag.format="ipv6",t._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:t,continue:!e.abort})}}}),ac=h("$ZodMAC",(t,e)=>{e.pattern??(e.pattern=Dp(e.delimiter)),pe.init(t,e),t._zod.bag.format="mac"}),sc=h("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=jp),pe.init(t,e)}),cc=h("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=Up),pe.init(t,e),t._zod.check=n=>{let o=n.value.split("/");try{if(o.length!==2)throw new Error;let[r,i]=o;if(!i)throw new Error;let a=Number(i);if(`${a}`!==i)throw new Error;if(a<0||a>128)throw new Error;new URL(`http://[${r}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:t,continue:!e.abort})}}});function Sm(t){if(t==="")return!0;if(/\s/.test(t)||t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}var uc=h("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=Lp),pe.init(t,e),t._zod.bag.contentEncoding="base64",t._zod.check=n=>{Sm(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:t,continue:!e.abort})}});function Kv(t){if(!Ls.test(t))return!1;let e=t.replace(/[-_]/g,o=>o==="-"?"+":"/"),n=e.padEnd(Math.ceil(e.length/4)*4,"=");return Sm(n)}var lc=h("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=Ls),pe.init(t,e),t._zod.bag.contentEncoding="base64url",t._zod.check=n=>{Kv(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:t,continue:!e.abort})}}),dc=h("$ZodE164",(t,e)=>{e.pattern??(e.pattern=Zp),pe.init(t,e)});function Gv(t,e=null){try{let n=t.split(".");if(n.length!==3)return!1;let[o]=n;if(!o)return!1;let r=JSON.parse(atob(o));return!("typ"in r&&r?.typ!=="JWT"||!r.alg||e&&(!("alg"in r)||r.alg!==e))}catch{return!1}}var pc=h("$ZodJWT",(t,e)=>{pe.init(t,e),t._zod.check=n=>{Gv(n.value,e.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:t,continue:!e.abort})}}),mc=h("$ZodCustomStringFormat",(t,e)=>{pe.init(t,e),t._zod.check=n=>{e.fn(n.value)||n.issues.push({code:"invalid_format",format:e.format,input:n.value,inst:t,continue:!e.abort})}}),xi=h("$ZodNumber",(t,e)=>{B.init(t,e),t._zod.pattern=t._zod.bag.pattern??Ms,t._zod.parse=(n,o)=>{if(e.coerce)try{n.value=Number(n.value)}catch{}let r=n.value;if(typeof r=="number"&&!Number.isNaN(r)&&Number.isFinite(r))return n;let i=typeof r=="number"?Number.isNaN(r)?"NaN":Number.isFinite(r)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:r,inst:t,...i?{received:i}:{}}),n}}),fc=h("$ZodNumberFormat",(t,e)=>{em.init(t,e),xi.init(t,e)}),Pn=h("$ZodBoolean",(t,e)=>{B.init(t,e),t._zod.pattern=Gp,t._zod.parse=(n,o)=>{if(e.coerce)try{n.value=!!n.value}catch{}let r=n.value;return typeof r=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:r,inst:t}),n}}),Si=h("$ZodBigInt",(t,e)=>{B.init(t,e),t._zod.pattern=Hp,t._zod.parse=(n,o)=>{if(e.coerce)try{n.value=BigInt(n.value)}catch{}return typeof n.value=="bigint"||n.issues.push({expected:"bigint",code:"invalid_type",input:n.value,inst:t}),n}}),hc=h("$ZodBigIntFormat",(t,e)=>{tm.init(t,e),Si.init(t,e)}),gc=h("$ZodSymbol",(t,e)=>{B.init(t,e),t._zod.parse=(n,o)=>{let r=n.value;return typeof r=="symbol"||n.issues.push({expected:"symbol",code:"invalid_type",input:r,inst:t}),n}}),_c=h("$ZodUndefined",(t,e)=>{B.init(t,e),t._zod.pattern=Jp,t._zod.values=new Set([void 0]),t._zod.parse=(n,o)=>{let r=n.value;return typeof r>"u"||n.issues.push({expected:"undefined",code:"invalid_type",input:r,inst:t}),n}}),yc=h("$ZodNull",(t,e)=>{B.init(t,e),t._zod.pattern=Wp,t._zod.values=new Set([null]),t._zod.parse=(n,o)=>{let r=n.value;return r===null||n.issues.push({expected:"null",code:"invalid_type",input:r,inst:t}),n}}),vc=h("$ZodAny",(t,e)=>{B.init(t,e),t._zod.parse=n=>n}),bc=h("$ZodUnknown",(t,e)=>{B.init(t,e),t._zod.parse=n=>n}),kc=h("$ZodNever",(t,e)=>{B.init(t,e),t._zod.parse=(n,o)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:t}),n)}),xc=h("$ZodVoid",(t,e)=>{B.init(t,e),t._zod.parse=(n,o)=>{let r=n.value;return typeof r>"u"||n.issues.push({expected:"void",code:"invalid_type",input:r,inst:t}),n}}),Sc=h("$ZodDate",(t,e)=>{B.init(t,e),t._zod.parse=(n,o)=>{if(e.coerce)try{n.value=new Date(n.value)}catch{}let r=n.value,i=r instanceof Date;return i&&!Number.isNaN(r.getTime())||n.issues.push({expected:"date",code:"invalid_type",input:r,...i?{received:"Invalid Date"}:{},inst:t}),n}});function Cv(t,e,n){t.issues.length&&e.issues.push(...rt(n,t.issues)),e.value[n]=t.value}var $c=h("$ZodArray",(t,e)=>{B.init(t,e),t._zod.parse=(n,o)=>{let r=n.value;if(!Array.isArray(r))return n.issues.push({expected:"array",code:"invalid_type",input:r,inst:t}),n;n.value=Array(r.length);let i=[];for(let a=0;a<r.length;a++){let c=r[a],u=e.element._zod.run({value:c,issues:[]},o);u instanceof Promise?i.push(u.then(d=>Cv(d,n,a))):Cv(u,n,a)}return i.length?Promise.all(i).then(()=>n):n}});function Hs(t,e,n,o,r,i){let a=n in o;if(t.issues.length){if(r&&i&&!a)return;e.issues.push(...rt(n,t.issues))}if(!a&&!r){t.issues.length||e.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]});return}t.value===void 0?a&&(e.value[n]=void 0):e.value[n]=t.value}function Wv(t){let e=Object.keys(t.shape);for(let o of e)if(!t.shape?.[o]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${o}": expected a Zod schema`);let n=yp(t.shape);return{...t,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(n)}}function Jv(t,e,n,o,r,i){let a=[],c=r.keySet,u=r.catchall._zod,d=u.def.type,l=u.optin==="optional",p=u.optout==="optional";for(let m in e){if(m==="__proto__"||c.has(m))continue;if(d==="never"){a.push(m);continue}let f=u.run({value:e[m],issues:[]},o);f instanceof Promise?t.push(f.then(g=>Hs(g,n,m,e,l,p))):Hs(f,n,m,e,l,p)}return a.length&&n.issues.push({code:"unrecognized_keys",keys:a,input:e,inst:i}),t.length?Promise.all(t).then(()=>n):n}var Ic=h("$ZodObject",(t,e)=>{if(B.init(t,e),!Object.getOwnPropertyDescriptor(e,"shape")?.get){let c=e.shape;Object.defineProperty(e,"shape",{get:()=>{let u={...c};return Object.defineProperty(e,"shape",{value:u}),u}})}let o=xn(()=>Wv(e));W(t._zod,"propValues",()=>{let c=e.shape,u={};for(let d in c){let l=c[d]._zod;if(l.values){u[d]??(u[d]=new Set);for(let p of l.values)u[d].add(p)}}return u});let r=qr,i=e.catchall,a;t._zod.parse=(c,u)=>{a??(a=o.value);let d=c.value;if(!r(d))return c.issues.push({expected:"object",code:"invalid_type",input:d,inst:t}),c;c.value={};let l=[],p=a.shape;for(let m of a.keys){let f=p[m],g=f._zod.optin==="optional",v=f._zod.optout==="optional",b=f._zod.run({value:d[m],issues:[]},u);b instanceof Promise?l.push(b.then(E=>Hs(E,c,m,d,g,v))):Hs(b,c,m,d,g,v)}return i?Jv(l,d,c,u,o.value,t):l.length?Promise.all(l).then(()=>c):c}}),$m=h("$ZodObjectJIT",(t,e)=>{Ic.init(t,e);let n=t._zod.parse,o=xn(()=>Wv(e)),r=m=>{let f=new ki(["shape","payload","ctx"]),g=o.value,v=z=>{let j=Ts(z);return`shape[${j}]._zod.run({ value: input[${j}], issues: [] }, ctx)`};f.write("const input = payload.value;");let b=Object.create(null),E=0;for(let z of g.keys)b[z]=`key_${E++}`;f.write("const newResult = {};");for(let z of g.keys){let j=b[z],D=Ts(z),lt=m[z],ht=lt?._zod?.optin==="optional",ci=lt?._zod?.optout==="optional";f.write(`const ${j} = ${v(z)};`),ht&&ci?f.write(`
|
|
10
|
+
deps: ${n}}`};var Qj={keyword:"dependencies",type:"object",schemaType:"object",error:Kt.error,code(t){let[e,n]=eU(t);EI(t,e),TI(t,n)}};function eU({schema:t}){let e={},n={};for(let i in t){if(i==="__proto__")continue;let r=Array.isArray(t[i])?e:n;r[i]=t[i]}return[e,n]}function EI(t,e=t.schema){let{gen:n,data:i,it:r}=t;if(Object.keys(e).length===0)return;let o=n.let("missing");for(let s in e){let c=e[s];if(c.length===0)continue;let u=(0,na.propertyInData)(n,i,s,r.opts.ownProperties);t.setParams({property:s,depsCount:c.length,deps:c.join(", ")}),r.allErrors?n.if(u,()=>{for(let d of c)(0,na.checkReportMissingProp)(t,d)}):(n.if((0,$b._)`${u} && (${(0,na.checkMissingProp)(t,c,o)})`),(0,na.reportMissingProp)(t,o),n.else())}}Kt.validatePropertyDeps=EI;function TI(t,e=t.schema){let{gen:n,data:i,keyword:r,it:o}=t,s=n.name("valid");for(let c in e)(0,Xj.alwaysValidSchema)(o,e[c])||(n.if((0,na.propertyInData)(n,i,c,o.opts.ownProperties),()=>{let u=t.subschema({keyword:r,schemaProp:c},s);t.mergeValidEvaluated(u,s)},()=>n.var(s,!0)),t.ok(s))}Kt.validateSchemaDeps=TI;Kt.default=Qj});var PI=O(Ib=>{"use strict";Object.defineProperty(Ib,"__esModule",{value:!0});var OI=Y(),tU=oe(),nU={message:"property name must be valid",params:({params:t})=>(0,OI._)`{propertyName: ${t.propertyName}}`},rU={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:nU,code(t){let{gen:e,schema:n,data:i,it:r}=t;if((0,tU.alwaysValidSchema)(r,n))return;let o=e.name("valid");e.forIn("key",i,s=>{t.setParams({propertyName:s}),t.subschema({keyword:"propertyNames",data:s,dataTypes:["string"],propertyName:s,compositeRule:!0},o),e.if((0,OI.not)(o),()=>{t.error(!0),r.allErrors||e.break()})}),t.ok(o)}};Ib.default=rU});var Eb=O(wb=>{"use strict";Object.defineProperty(wb,"__esModule",{value:!0});var hd=xt(),Dt=Y(),iU=sn(),gd=oe(),oU={message:"must NOT have additional properties",params:({params:t})=>(0,Dt._)`{additionalProperty: ${t.additionalProperty}}`},sU={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:oU,code(t){let{gen:e,schema:n,parentSchema:i,data:r,errsCount:o,it:s}=t;if(!o)throw new Error("ajv implementation error");let{allErrors:c,opts:u}=s;if(s.props=!0,u.removeAdditional!=="all"&&(0,gd.alwaysValidSchema)(s,n))return;let d=(0,hd.allSchemaProperties)(i.properties),l=(0,hd.allSchemaProperties)(i.patternProperties);p(),t.ok((0,Dt._)`${o} === ${iU.default.errors}`);function p(){e.forIn("key",r,v=>{!d.length&&!l.length?h(v):e.if(m(v),()=>h(v))})}function m(v){let E;if(d.length>8){let C=(0,gd.schemaRefOrVal)(s,i.properties,"properties");E=(0,hd.isOwnProperty)(e,C,v)}else d.length?E=(0,Dt.or)(...d.map(C=>(0,Dt._)`${v} === ${C}`)):E=Dt.nil;return l.length&&(E=(0,Dt.or)(E,...l.map(C=>(0,Dt._)`${(0,hd.usePattern)(t,C)}.test(${v})`))),(0,Dt.not)(E)}function f(v){e.code((0,Dt._)`delete ${r}[${v}]`)}function h(v){if(u.removeAdditional==="all"||u.removeAdditional&&n===!1){f(v);return}if(n===!1){t.setParams({additionalProperty:v}),t.error(),c||e.break();return}if(typeof n=="object"&&!(0,gd.alwaysValidSchema)(s,n)){let E=e.name("valid");u.removeAdditional==="failing"?(y(v,E,!1),e.if((0,Dt.not)(E),()=>{t.reset(),f(v)})):(y(v,E),c||e.if((0,Dt.not)(E),()=>e.break()))}}function y(v,E,C){let z={keyword:"additionalProperties",dataProp:v,dataPropType:gd.Type.Str};C===!1&&Object.assign(z,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(z,E)}}};wb.default=sU});var CI=O(Rb=>{"use strict";Object.defineProperty(Rb,"__esModule",{value:!0});var aU=Fs(),AI=xt(),Tb=oe(),NI=Eb(),cU={keyword:"properties",type:"object",schemaType:"object",code(t){let{gen:e,schema:n,parentSchema:i,data:r,it:o}=t;o.opts.removeAdditional==="all"&&i.additionalProperties===void 0&&NI.default.code(new aU.KeywordCxt(o,NI.default,"additionalProperties"));let s=(0,AI.allSchemaProperties)(n);for(let p of s)o.definedProperties.add(p);o.opts.unevaluated&&s.length&&o.props!==!0&&(o.props=Tb.mergeEvaluated.props(e,(0,Tb.toHash)(s),o.props));let c=s.filter(p=>!(0,Tb.alwaysValidSchema)(o,n[p]));if(c.length===0)return;let u=e.name("valid");for(let p of c)d(p)?l(p):(e.if((0,AI.propertyInData)(e,r,p,o.opts.ownProperties)),l(p),o.allErrors||e.else().var(u,!0),e.endIf()),t.it.definedProperties.add(p),t.ok(u);function d(p){return o.opts.useDefaults&&!o.compositeRule&&n[p].default!==void 0}function l(p){t.subschema({keyword:"properties",schemaProp:p,dataProp:p},u)}}};Rb.default=cU});var UI=O(Ob=>{"use strict";Object.defineProperty(Ob,"__esModule",{value:!0});var zI=xt(),bd=Y(),DI=oe(),jI=oe(),uU={keyword:"patternProperties",type:"object",schemaType:"object",code(t){let{gen:e,schema:n,data:i,parentSchema:r,it:o}=t,{opts:s}=o,c=(0,zI.allSchemaProperties)(n),u=c.filter(y=>(0,DI.alwaysValidSchema)(o,n[y]));if(c.length===0||u.length===c.length&&(!o.opts.unevaluated||o.props===!0))return;let d=s.strictSchema&&!s.allowMatchingProperties&&r.properties,l=e.name("valid");o.props!==!0&&!(o.props instanceof bd.Name)&&(o.props=(0,jI.evaluatedPropsToName)(e,o.props));let{props:p}=o;m();function m(){for(let y of c)d&&f(y),o.allErrors?h(y):(e.var(l,!0),h(y),e.if(l))}function f(y){for(let v in d)new RegExp(y).test(v)&&(0,DI.checkStrictMode)(o,`property ${v} matches pattern ${y} (use allowMatchingProperties)`)}function h(y){e.forIn("key",i,v=>{e.if((0,bd._)`${(0,zI.usePattern)(t,y)}.test(${v})`,()=>{let E=u.includes(y);E||t.subschema({keyword:"patternProperties",schemaProp:y,dataProp:v,dataPropType:jI.Type.Str},l),o.opts.unevaluated&&p!==!0?e.assign((0,bd._)`${p}[${v}]`,!0):!E&&!o.allErrors&&e.if((0,bd.not)(l),()=>e.break())})})}}};Ob.default=uU});var MI=O(Pb=>{"use strict";Object.defineProperty(Pb,"__esModule",{value:!0});var lU=oe(),dU={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:n,it:i}=t;if((0,lU.alwaysValidSchema)(i,n)){t.fail();return}let r=e.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},r),t.failResult(r,()=>t.reset(),()=>t.error())},error:{message:"must NOT be valid"}};Pb.default=dU});var LI=O(Ab=>{"use strict";Object.defineProperty(Ab,"__esModule",{value:!0});var pU=xt(),mU={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:pU.validateUnion,error:{message:"must match a schema in anyOf"}};Ab.default=mU});var ZI=O(Nb=>{"use strict";Object.defineProperty(Nb,"__esModule",{value:!0});var _d=Y(),fU=oe(),hU={message:"must match exactly one schema in oneOf",params:({params:t})=>(0,_d._)`{passingSchemas: ${t.passing}}`},gU={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:hU,code(t){let{gen:e,schema:n,parentSchema:i,it:r}=t;if(!Array.isArray(n))throw new Error("ajv implementation error");if(r.opts.discriminator&&i.discriminator)return;let o=n,s=e.let("valid",!1),c=e.let("passing",null),u=e.name("_valid");t.setParams({passing:c}),e.block(d),t.result(s,()=>t.reset(),()=>t.error(!0));function d(){o.forEach((l,p)=>{let m;(0,fU.alwaysValidSchema)(r,l)?e.var(u,!0):m=t.subschema({keyword:"oneOf",schemaProp:p,compositeRule:!0},u),p>0&&e.if((0,_d._)`${u} && ${s}`).assign(s,!1).assign(c,(0,_d._)`[${c}, ${p}]`).else(),e.if(u,()=>{e.assign(s,!0),e.assign(c,p),m&&t.mergeEvaluated(m,_d.Name)})})}}};Nb.default=gU});var FI=O(Cb=>{"use strict";Object.defineProperty(Cb,"__esModule",{value:!0});var bU=oe(),_U={keyword:"allOf",schemaType:"array",code(t){let{gen:e,schema:n,it:i}=t;if(!Array.isArray(n))throw new Error("ajv implementation error");let r=e.name("valid");n.forEach((o,s)=>{if((0,bU.alwaysValidSchema)(i,o))return;let c=t.subschema({keyword:"allOf",schemaProp:s},r);t.ok(r),t.mergeEvaluated(c)})}};Cb.default=_U});var VI=O(zb=>{"use strict";Object.defineProperty(zb,"__esModule",{value:!0});var yd=Y(),qI=oe(),yU={message:({params:t})=>(0,yd.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,yd._)`{failingKeyword: ${t.ifClause}}`},vU={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:yU,code(t){let{gen:e,parentSchema:n,it:i}=t;n.then===void 0&&n.else===void 0&&(0,qI.checkStrictMode)(i,'"if" without "then" and "else" is ignored');let r=BI(i,"then"),o=BI(i,"else");if(!r&&!o)return;let s=e.let("valid",!0),c=e.name("_valid");if(u(),t.reset(),r&&o){let l=e.let("ifClause");t.setParams({ifClause:l}),e.if(c,d("then",l),d("else",l))}else r?e.if(c,d("then")):e.if((0,yd.not)(c),d("else"));t.pass(s,()=>t.error(!0));function u(){let l=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},c);t.mergeEvaluated(l)}function d(l,p){return()=>{let m=t.subschema({keyword:l},c);e.assign(s,c),t.mergeValidEvaluated(m,s),p?e.assign(p,(0,yd._)`${l}`):t.setParams({ifClause:l})}}}};function BI(t,e){let n=t.schema[e];return n!==void 0&&!(0,qI.alwaysValidSchema)(t,n)}zb.default=vU});var HI=O(Db=>{"use strict";Object.defineProperty(Db,"__esModule",{value:!0});var kU=oe(),xU={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:n}){e.if===void 0&&(0,kU.checkStrictMode)(n,`"${t}" without "if" is ignored`)}};Db.default=xU});var KI=O(jb=>{"use strict";Object.defineProperty(jb,"__esModule",{value:!0});var SU=yb(),$U=SI(),IU=vb(),wU=II(),EU=wI(),TU=RI(),RU=PI(),OU=Eb(),PU=CI(),AU=UI(),NU=MI(),CU=LI(),zU=ZI(),DU=FI(),jU=VI(),UU=HI();function MU(t=!1){let e=[NU.default,CU.default,zU.default,DU.default,jU.default,UU.default,RU.default,OU.default,TU.default,PU.default,AU.default];return t?e.push($U.default,wU.default):e.push(SU.default,IU.default),e.push(EU.default),e}jb.default=MU});var GI=O(Ub=>{"use strict";Object.defineProperty(Ub,"__esModule",{value:!0});var Oe=Y(),LU={message:({schemaCode:t})=>(0,Oe.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,Oe._)`{format: ${t}}`},ZU={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:LU,code(t,e){let{gen:n,data:i,$data:r,schema:o,schemaCode:s,it:c}=t,{opts:u,errSchemaPath:d,schemaEnv:l,self:p}=c;if(!u.validateFormats)return;r?m():f();function m(){let h=n.scopeValue("formats",{ref:p.formats,code:u.code.formats}),y=n.const("fDef",(0,Oe._)`${h}[${s}]`),v=n.let("fType"),E=n.let("format");n.if((0,Oe._)`typeof ${y} == "object" && !(${y} instanceof RegExp)`,()=>n.assign(v,(0,Oe._)`${y}.type || "string"`).assign(E,(0,Oe._)`${y}.validate`),()=>n.assign(v,(0,Oe._)`"string"`).assign(E,y)),t.fail$data((0,Oe.or)(C(),z()));function C(){return u.strictSchema===!1?Oe.nil:(0,Oe._)`${s} && !${E}`}function z(){let j=l.$async?(0,Oe._)`(${y}.async ? await ${E}(${i}) : ${E}(${i}))`:(0,Oe._)`${E}(${i})`,D=(0,Oe._)`(typeof ${E} == "function" ? ${j} : ${E}.test(${i}))`;return(0,Oe._)`${E} && ${E} !== true && ${v} === ${e} && !${D}`}}function f(){let h=p.formats[o];if(!h){C();return}if(h===!0)return;let[y,v,E]=z(h);y===e&&t.pass(j());function C(){if(u.strictSchema===!1){p.logger.warn(D());return}throw new Error(D());function D(){return`unknown format "${o}" ignored in schema at path "${d}"`}}function z(D){let ut=D instanceof RegExp?(0,Oe.regexpCode)(D):u.code.formats?(0,Oe._)`${u.code.formats}${(0,Oe.getProperty)(o)}`:void 0,ht=n.scopeValue("formats",{key:o,ref:D,code:ut});return typeof D=="object"&&!(D instanceof RegExp)?[D.type||"string",D.validate,(0,Oe._)`${ht}.validate`]:["string",D,ht]}function j(){if(typeof h=="object"&&!(h instanceof RegExp)&&h.async){if(!l.$async)throw new Error("async format in sync schema");return(0,Oe._)`await ${E}(${i})`}return typeof v=="function"?(0,Oe._)`${E}(${i})`:(0,Oe._)`${E}.test(${i})`}}}};Ub.default=ZU});var WI=O(Mb=>{"use strict";Object.defineProperty(Mb,"__esModule",{value:!0});var FU=GI(),BU=[FU.default];Mb.default=BU});var JI=O(Ni=>{"use strict";Object.defineProperty(Ni,"__esModule",{value:!0});Ni.contentVocabulary=Ni.metadataVocabulary=void 0;Ni.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Ni.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var XI=O(Lb=>{"use strict";Object.defineProperty(Lb,"__esModule",{value:!0});var qU=oI(),VU=yI(),HU=KI(),KU=WI(),YI=JI(),GU=[qU.default,VU.default,(0,HU.default)(),KU.default,YI.metadataVocabulary,YI.contentVocabulary];Lb.default=GU});var ew=O(vd=>{"use strict";Object.defineProperty(vd,"__esModule",{value:!0});vd.DiscrError=void 0;var QI;(function(t){t.Tag="tag",t.Mapping="mapping"})(QI||(vd.DiscrError=QI={}))});var nw=O(Fb=>{"use strict";Object.defineProperty(Fb,"__esModule",{value:!0});var Ci=Y(),Zb=ew(),tw=rd(),WU=Bs(),JU=oe(),YU={message:({params:{discrError:t,tagName:e}})=>t===Zb.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:n}})=>(0,Ci._)`{error: ${t}, tag: ${n}, tagValue: ${e}}`},XU={keyword:"discriminator",type:"object",schemaType:"object",error:YU,code(t){let{gen:e,data:n,schema:i,parentSchema:r,it:o}=t,{oneOf:s}=r;if(!o.opts.discriminator)throw new Error("discriminator: requires discriminator option");let c=i.propertyName;if(typeof c!="string")throw new Error("discriminator: requires propertyName");if(i.mapping)throw new Error("discriminator: mapping is not supported");if(!s)throw new Error("discriminator: requires oneOf keyword");let u=e.let("valid",!1),d=e.const("tag",(0,Ci._)`${n}${(0,Ci.getProperty)(c)}`);e.if((0,Ci._)`typeof ${d} == "string"`,()=>l(),()=>t.error(!1,{discrError:Zb.DiscrError.Tag,tag:d,tagName:c})),t.ok(u);function l(){let f=m();e.if(!1);for(let h in f)e.elseIf((0,Ci._)`${d} === ${h}`),e.assign(u,p(f[h]));e.else(),t.error(!1,{discrError:Zb.DiscrError.Mapping,tag:d,tagName:c}),e.endIf()}function p(f){let h=e.name("valid"),y=t.subschema({keyword:"oneOf",schemaProp:f},h);return t.mergeEvaluated(y,Ci.Name),h}function m(){var f;let h={},y=E(r),v=!0;for(let j=0;j<s.length;j++){let D=s[j];if(D?.$ref&&!(0,JU.schemaHasRulesButRef)(D,o.self.RULES)){let ht=D.$ref;if(D=tw.resolveRef.call(o.self,o.schemaEnv.root,o.baseId,ht),D instanceof tw.SchemaEnv&&(D=D.schema),D===void 0)throw new WU.default(o.opts.uriResolver,o.baseId,ht)}let ut=(f=D?.properties)===null||f===void 0?void 0:f[c];if(typeof ut!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${c}"`);v=v&&(y||E(D)),C(ut,j)}if(!v)throw new Error(`discriminator: "${c}" must be required`);return h;function E({required:j}){return Array.isArray(j)&&j.includes(c)}function C(j,D){if(j.const)z(j.const,D);else if(j.enum)for(let ut of j.enum)z(ut,D);else throw new Error(`discriminator: "properties/${c}" must have "const" or "enum"`)}function z(j,D){if(typeof j!="string"||j in h)throw new Error(`discriminator: "${c}" values must be unique strings`);h[j]=D}}}};Fb.default=XU});var rw=O((vK,QU)=>{QU.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 qb=O(($e,Bb)=>{"use strict";Object.defineProperty($e,"__esModule",{value:!0});$e.MissingRefError=$e.ValidationError=$e.CodeGen=$e.Name=$e.nil=$e.stringify=$e.str=$e._=$e.KeywordCxt=$e.Ajv=void 0;var e1=Q$(),t1=XI(),n1=nw(),iw=rw(),r1=["/properties"],kd="http://json-schema.org/draft-07/schema",zi=class extends e1.default{_addVocabularies(){super._addVocabularies(),t1.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(n1.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(iw,r1):iw;this.addMetaSchema(e,kd,!1),this.refs["http://json-schema.org/schema"]=kd}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(kd)?kd:void 0)}};$e.Ajv=zi;Bb.exports=$e=zi;Bb.exports.Ajv=zi;Object.defineProperty($e,"__esModule",{value:!0});$e.default=zi;var i1=Fs();Object.defineProperty($e,"KeywordCxt",{enumerable:!0,get:function(){return i1.KeywordCxt}});var Di=Y();Object.defineProperty($e,"_",{enumerable:!0,get:function(){return Di._}});Object.defineProperty($e,"str",{enumerable:!0,get:function(){return Di.str}});Object.defineProperty($e,"stringify",{enumerable:!0,get:function(){return Di.stringify}});Object.defineProperty($e,"nil",{enumerable:!0,get:function(){return Di.nil}});Object.defineProperty($e,"Name",{enumerable:!0,get:function(){return Di.Name}});Object.defineProperty($e,"CodeGen",{enumerable:!0,get:function(){return Di.CodeGen}});var o1=td();Object.defineProperty($e,"ValidationError",{enumerable:!0,get:function(){return o1.default}});var s1=Bs();Object.defineProperty($e,"MissingRefError",{enumerable:!0,get:function(){return s1.default}})});var pw=O(Wt=>{"use strict";Object.defineProperty(Wt,"__esModule",{value:!0});Wt.formatNames=Wt.fastFormats=Wt.fullFormats=void 0;function Gt(t,e){return{validate:t,compare:e}}Wt.fullFormats={date:Gt(cw,Gb),time:Gt(Hb(!0),Wb),"date-time":Gt(ow(!0),lw),"iso-time":Gt(Hb(),uw),"iso-date-time":Gt(ow(),dw),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:p1,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:y1,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:m1,int32:{type:"number",validate:g1},int64:{type:"number",validate:b1},float:{type:"number",validate:aw},double:{type:"number",validate:aw},password:!0,binary:!0};Wt.fastFormats={...Wt.fullFormats,date:Gt(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,Gb),time:Gt(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,Wb),"date-time":Gt(/^\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,lw),"iso-time":Gt(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,uw),"iso-date-time":Gt(/^\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,dw),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};Wt.formatNames=Object.keys(Wt.fullFormats);function a1(t){return t%4===0&&(t%100!==0||t%400===0)}var c1=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,u1=[0,31,28,31,30,31,30,31,31,30,31,30,31];function cw(t){let e=c1.exec(t);if(!e)return!1;let n=+e[1],i=+e[2],r=+e[3];return i>=1&&i<=12&&r>=1&&r<=(i===2&&a1(n)?29:u1[i])}function Gb(t,e){if(t&&e)return t>e?1:t<e?-1:0}var Vb=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function Hb(t){return function(n){let i=Vb.exec(n);if(!i)return!1;let r=+i[1],o=+i[2],s=+i[3],c=i[4],u=i[5]==="-"?-1:1,d=+(i[6]||0),l=+(i[7]||0);if(d>23||l>59||t&&!c)return!1;if(r<=23&&o<=59&&s<60)return!0;let p=o-l*u,m=r-d*u-(p<0?1:0);return(m===23||m===-1)&&(p===59||p===-1)&&s<61}}function Wb(t,e){if(!(t&&e))return;let n=new Date("2020-01-01T"+t).valueOf(),i=new Date("2020-01-01T"+e).valueOf();if(n&&i)return n-i}function uw(t,e){if(!(t&&e))return;let n=Vb.exec(t),i=Vb.exec(e);if(n&&i)return t=n[1]+n[2]+n[3],e=i[1]+i[2]+i[3],t>e?1:t<e?-1:0}var Kb=/t|\s/i;function ow(t){let e=Hb(t);return function(i){let r=i.split(Kb);return r.length===2&&cw(r[0])&&e(r[1])}}function lw(t,e){if(!(t&&e))return;let n=new Date(t).valueOf(),i=new Date(e).valueOf();if(n&&i)return n-i}function dw(t,e){if(!(t&&e))return;let[n,i]=t.split(Kb),[r,o]=e.split(Kb),s=Gb(n,r);if(s!==void 0)return s||Wb(i,o)}var l1=/\/|:/,d1=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function p1(t){return l1.test(t)&&d1.test(t)}var sw=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function m1(t){return sw.lastIndex=0,sw.test(t)}var f1=-(2**31),h1=2**31-1;function g1(t){return Number.isInteger(t)&&t<=h1&&t>=f1}function b1(t){return Number.isInteger(t)}function aw(){return!0}var _1=/[^\\]\\Z/;function y1(t){if(_1.test(t))return!1;try{return new RegExp(t),!0}catch{return!1}}});var mw=O(ji=>{"use strict";Object.defineProperty(ji,"__esModule",{value:!0});ji.formatLimitDefinition=void 0;var v1=qb(),jt=Y(),jn=jt.operators,xd={formatMaximum:{okStr:"<=",ok:jn.LTE,fail:jn.GT},formatMinimum:{okStr:">=",ok:jn.GTE,fail:jn.LT},formatExclusiveMaximum:{okStr:"<",ok:jn.LT,fail:jn.GTE},formatExclusiveMinimum:{okStr:">",ok:jn.GT,fail:jn.LTE}},k1={message:({keyword:t,schemaCode:e})=>(0,jt.str)`should be ${xd[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,jt._)`{comparison: ${xd[t].okStr}, limit: ${e}}`};ji.formatLimitDefinition={keyword:Object.keys(xd),type:"string",schemaType:"string",$data:!0,error:k1,code(t){let{gen:e,data:n,schemaCode:i,keyword:r,it:o}=t,{opts:s,self:c}=o;if(!s.validateFormats)return;let u=new v1.KeywordCxt(o,c.RULES.all.format.definition,"format");u.$data?d():l();function d(){let m=e.scopeValue("formats",{ref:c.formats,code:s.code.formats}),f=e.const("fmt",(0,jt._)`${m}[${u.schemaCode}]`);t.fail$data((0,jt.or)((0,jt._)`typeof ${f} != "object"`,(0,jt._)`${f} instanceof RegExp`,(0,jt._)`typeof ${f}.compare != "function"`,p(f)))}function l(){let m=u.schema,f=c.formats[m];if(!f||f===!0)return;if(typeof f!="object"||f instanceof RegExp||typeof f.compare!="function")throw new Error(`"${r}": format "${m}" does not define "compare" function`);let h=e.scopeValue("formats",{key:m,ref:f,code:s.code.formats?(0,jt._)`${s.code.formats}${(0,jt.getProperty)(m)}`:void 0});t.fail$data(p(h))}function p(m){return(0,jt._)`${m}.compare(${n}, ${i}) ${xd[r].fail} 0`}},dependencies:["format"]};var x1=t=>(t.addKeyword(ji.formatLimitDefinition),t);ji.default=x1});var bw=O((ra,gw)=>{"use strict";Object.defineProperty(ra,"__esModule",{value:!0});var Ui=pw(),S1=mw(),Jb=Y(),fw=new Jb.Name("fullFormats"),$1=new Jb.Name("fastFormats"),Yb=(t,e={keywords:!0})=>{if(Array.isArray(e))return hw(t,e,Ui.fullFormats,fw),t;let[n,i]=e.mode==="fast"?[Ui.fastFormats,$1]:[Ui.fullFormats,fw],r=e.formats||Ui.formatNames;return hw(t,r,n,i),e.keywords&&(0,S1.default)(t),t};Yb.get=(t,e="full")=>{let i=(e==="fast"?Ui.fastFormats:Ui.fullFormats)[t];if(!i)throw new Error(`Unknown format "${t}"`);return i};function hw(t,e,n,i){var r,o;(r=(o=t.opts.code).formats)!==null&&r!==void 0||(o.formats=(0,Jb._)`require("ajv-formats/dist/formats").${i}`);for(let s of e)t.addFormat(s,n[s])}gw.exports=ra=Yb;Object.defineProperty(ra,"__esModule",{value:!0});ra.default=Yb});import Mx from"node:process";var a={};Jt(a,{$brand:()=>cp,$input:()=>$m,$output:()=>Sm,NEVER:()=>ap,TimePrecision:()=>wm,ZodAny:()=>Zf,ZodArray:()=>Vf,ZodBase64:()=>el,ZodBase64URL:()=>tl,ZodBigInt:()=>Xr,ZodBigIntFormat:()=>il,ZodBoolean:()=>Yr,ZodCIDRv4:()=>Xu,ZodCIDRv6:()=>Qu,ZodCUID:()=>Vu,ZodCUID2:()=>Hu,ZodCatch:()=>dh,ZodCodec:()=>rs,ZodCustom:()=>is,ZodCustomStringFormat:()=>Wr,ZodDate:()=>Xo,ZodDefault:()=>oh,ZodDiscriminatedUnion:()=>Kf,ZodE164:()=>nl,ZodEmail:()=>Fu,ZodEmoji:()=>Bu,ZodEnum:()=>Kr,ZodError:()=>XO,ZodExactOptional:()=>nh,ZodFile:()=>eh,ZodFirstPartyTypeKind:()=>$h,ZodFunction:()=>kh,ZodGUID:()=>Ko,ZodIPv4:()=>Ju,ZodIPv6:()=>Yu,ZodISODate:()=>Du,ZodISODateTime:()=>zu,ZodISODuration:()=>Uu,ZodISOTime:()=>ju,ZodIntersection:()=>Gf,ZodIssueCode:()=>eP,ZodJWT:()=>rl,ZodKSUID:()=>Wu,ZodLazy:()=>_h,ZodLiteral:()=>Qf,ZodMAC:()=>jf,ZodMap:()=>Yf,ZodNaN:()=>mh,ZodNanoID:()=>qu,ZodNever:()=>Bf,ZodNonOptional:()=>al,ZodNull:()=>Lf,ZodNullable:()=>ih,ZodNumber:()=>Jr,ZodNumberFormat:()=>er,ZodObject:()=>Qo,ZodOptional:()=>ei,ZodPipe:()=>ns,ZodPrefault:()=>ah,ZodPreprocess:()=>fh,ZodPromise:()=>vh,ZodReadonly:()=>hh,ZodRealError:()=>it,ZodRecord:()=>Hr,ZodSet:()=>Xf,ZodString:()=>Gr,ZodStringFormat:()=>he,ZodSuccess:()=>lh,ZodSymbol:()=>Uf,ZodTemplateLiteral:()=>bh,ZodTransform:()=>th,ZodTuple:()=>Wf,ZodType:()=>K,ZodULID:()=>Ku,ZodURL:()=>Jo,ZodUUID:()=>Bt,ZodUndefined:()=>Mf,ZodUnion:()=>es,ZodUnknown:()=>Ff,ZodVoid:()=>qf,ZodXID:()=>Gu,ZodXor:()=>Hf,_ZodString:()=>Zu,_default:()=>sh,_function:()=>dx,any:()=>Hk,array:()=>X,base64:()=>Rk,base64url:()=>Ok,bigint:()=>Zk,boolean:()=>Re,catch:()=>ph,check:()=>px,cidrv4:()=>Ek,cidrv6:()=>Tk,clone:()=>Ce,codec:()=>ax,coerce:()=>Ih,config:()=>Te,core:()=>Tt,cuid:()=>yk,cuid2:()=>vk,custom:()=>cl,date:()=>Gk,decode:()=>Of,decodeAsync:()=>Af,describe:()=>mx,discriminatedUnion:()=>ts,e164:()=>Pk,email:()=>uk,emoji:()=>bk,encode:()=>Rf,encodeAsync:()=>Pf,endsWith:()=>Ur,enum:()=>je,exactOptional:()=>rh,file:()=>rx,flattenError:()=>ho,float32:()=>jk,float64:()=>Uk,formatError:()=>go,fromJSONSchema:()=>yx,function:()=>dx,getErrorMap:()=>nP,globalRegistry:()=>ze,gt:()=>Zt,gte:()=>Ge,guid:()=>lk,hash:()=>Dk,hex:()=>zk,hostname:()=>Ck,httpUrl:()=>gk,includes:()=>Dr,instanceof:()=>hx,int:()=>Mu,int32:()=>Mk,int64:()=>Fk,intersection:()=>Qr,invertCodec:()=>cx,ipv4:()=>$k,ipv6:()=>wk,iso:()=>xn,json:()=>bx,jwt:()=>Ak,keyof:()=>Wk,ksuid:()=>Sk,lazy:()=>yh,length:()=>Yn,literal:()=>M,locales:()=>Or,looseObject:()=>De,looseRecord:()=>Qk,lowercase:()=>Cr,lt:()=>Lt,lte:()=>lt,mac:()=>Ik,map:()=>ex,maxLength:()=>Jn,maxSize:()=>_n,meta:()=>fx,mime:()=>Mr,minLength:()=>Xt,minSize:()=>Ft,multipleOf:()=>bn,nan:()=>sx,nanoid:()=>_k,nativeEnum:()=>nx,negative:()=>yu,never:()=>ol,nonnegative:()=>ku,nonoptional:()=>uh,nonpositive:()=>vu,normalize:()=>Lr,null:()=>Yo,nullable:()=>Go,nullish:()=>ix,number:()=>ae,object:()=>P,optional:()=>ye,overwrite:()=>Et,parse:()=>If,parseAsync:()=>wf,partialRecord:()=>Xk,pipe:()=>Lu,positive:()=>_u,prefault:()=>ch,preprocess:()=>os,prettifyError:()=>vp,promise:()=>lx,property:()=>xu,readonly:()=>gh,record:()=>me,refine:()=>xh,regex:()=>Nr,regexes:()=>rt,registry:()=>Jc,safeDecode:()=>Cf,safeDecodeAsync:()=>Df,safeEncode:()=>Nf,safeEncodeAsync:()=>zf,safeParse:()=>Ef,safeParseAsync:()=>Tf,set:()=>tx,setErrorMap:()=>tP,size:()=>Wn,slugify:()=>qr,startsWith:()=>jr,strictObject:()=>Jk,string:()=>_,stringFormat:()=>Nk,stringbool:()=>gx,success:()=>ox,superRefine:()=>Sh,symbol:()=>qk,templateLiteral:()=>ux,toJSONSchema:()=>Qn,toLowerCase:()=>Fr,toUpperCase:()=>Br,transform:()=>sl,treeifyError:()=>yp,trim:()=>Zr,tuple:()=>Jf,uint32:()=>Lk,uint64:()=>Bk,ulid:()=>kk,undefined:()=>Vk,union:()=>be,unknown:()=>ge,uppercase:()=>zr,url:()=>hk,util:()=>S,uuid:()=>dk,uuidv4:()=>pk,uuidv6:()=>mk,uuidv7:()=>fk,void:()=>Kk,xid:()=>xk,xor:()=>Yk});var Tt={};Jt(Tt,{$ZodAny:()=>hc,$ZodArray:()=>vc,$ZodAsyncError:()=>wt,$ZodBase64:()=>oc,$ZodBase64URL:()=>sc,$ZodBigInt:()=>ko,$ZodBigIntFormat:()=>dc,$ZodBoolean:()=>wr,$ZodCIDRv4:()=>rc,$ZodCIDRv6:()=>ic,$ZodCUID:()=>Wa,$ZodCUID2:()=>Ja,$ZodCatch:()=>Uc,$ZodCheck:()=>fe,$ZodCheckBigIntFormat:()=>Xp,$ZodCheckEndsWith:()=>lm,$ZodCheckGreaterThan:()=>Ua,$ZodCheckIncludes:()=>cm,$ZodCheckLengthEquals:()=>im,$ZodCheckLessThan:()=>ja,$ZodCheckLowerCase:()=>sm,$ZodCheckMaxLength:()=>nm,$ZodCheckMaxSize:()=>Qp,$ZodCheckMimeType:()=>pm,$ZodCheckMinLength:()=>rm,$ZodCheckMinSize:()=>em,$ZodCheckMultipleOf:()=>Jp,$ZodCheckNumberFormat:()=>Yp,$ZodCheckOverwrite:()=>mm,$ZodCheckProperty:()=>dm,$ZodCheckRegex:()=>om,$ZodCheckSizeEquals:()=>tm,$ZodCheckStartsWith:()=>um,$ZodCheckStringFormat:()=>Ir,$ZodCheckUpperCase:()=>am,$ZodCodec:()=>Tr,$ZodCustom:()=>Vc,$ZodCustomStringFormat:()=>uc,$ZodDate:()=>yc,$ZodDefault:()=>Cc,$ZodDiscriminatedUnion:()=>Sc,$ZodE164:()=>ac,$ZodEmail:()=>Va,$ZodEmoji:()=>Ka,$ZodEncodeError:()=>un,$ZodEnum:()=>Tc,$ZodError:()=>fo,$ZodExactOptional:()=>Ac,$ZodFile:()=>Oc,$ZodFunction:()=>Fc,$ZodGUID:()=>Ba,$ZodIPv4:()=>ec,$ZodIPv6:()=>tc,$ZodISODate:()=>bm,$ZodISODateTime:()=>gm,$ZodISODuration:()=>ym,$ZodISOTime:()=>_m,$ZodIntersection:()=>$c,$ZodJWT:()=>cc,$ZodKSUID:()=>Qa,$ZodLazy:()=>qc,$ZodLiteral:()=>Rc,$ZodMAC:()=>nc,$ZodMap:()=>wc,$ZodNaN:()=>Mc,$ZodNanoID:()=>Ga,$ZodNever:()=>bc,$ZodNonOptional:()=>Dc,$ZodNull:()=>fc,$ZodNullable:()=>Nc,$ZodNumber:()=>vo,$ZodNumberFormat:()=>lc,$ZodObject:()=>kc,$ZodObjectJIT:()=>km,$ZodOptional:()=>So,$ZodPipe:()=>$o,$ZodPrefault:()=>zc,$ZodPreprocess:()=>xm,$ZodPromise:()=>Bc,$ZodReadonly:()=>Lc,$ZodRealError:()=>nt,$ZodRecord:()=>Ic,$ZodRegistry:()=>Wc,$ZodSet:()=>Ec,$ZodString:()=>gn,$ZodStringFormat:()=>pe,$ZodSuccess:()=>jc,$ZodSymbol:()=>pc,$ZodTemplateLiteral:()=>Zc,$ZodTransform:()=>Pc,$ZodTuple:()=>xo,$ZodType:()=>V,$ZodULID:()=>Ya,$ZodURL:()=>Ha,$ZodUUID:()=>qa,$ZodUndefined:()=>mc,$ZodUnion:()=>Er,$ZodUnknown:()=>gc,$ZodVoid:()=>_c,$ZodXID:()=>Xa,$ZodXor:()=>xc,$brand:()=>cp,$constructor:()=>g,$input:()=>$m,$output:()=>Sm,Doc:()=>yo,JSONSchema:()=>sk,JSONSchemaGenerator:()=>Nu,NEVER:()=>ap,TimePrecision:()=>wm,_any:()=>pu,_array:()=>zm,_base64:()=>Fo,_base64url:()=>Bo,_bigint:()=>su,_boolean:()=>ou,_catch:()=>qO,_check:()=>ok,_cidrv4:()=>Lo,_cidrv6:()=>Zo,_coercedBigint:()=>Nm,_coercedBoolean:()=>Am,_coercedDate:()=>Cm,_coercedNumber:()=>Pm,_coercedString:()=>Im,_cuid:()=>No,_cuid2:()=>Co,_custom:()=>$u,_date:()=>gu,_decode:()=>Ta,_decodeAsync:()=>Oa,_default:()=>ZO,_discriminatedUnion:()=>RO,_e164:()=>qo,_email:()=>wo,_emoji:()=>Po,_encode:()=>Ea,_encodeAsync:()=>Ra,_endsWith:()=>Ur,_enum:()=>zO,_file:()=>Su,_float32:()=>tu,_float64:()=>nu,_gt:()=>Zt,_gte:()=>Ge,_guid:()=>Pr,_includes:()=>Dr,_int:()=>eu,_int32:()=>ru,_int64:()=>au,_intersection:()=>OO,_ipv4:()=>Uo,_ipv6:()=>Mo,_isoDate:()=>Tm,_isoDateTime:()=>Em,_isoDuration:()=>Om,_isoTime:()=>Rm,_jwt:()=>Vo,_ksuid:()=>jo,_lazy:()=>GO,_length:()=>Yn,_literal:()=>jO,_lowercase:()=>Cr,_lt:()=>Lt,_lte:()=>lt,_mac:()=>Xc,_map:()=>NO,_max:()=>lt,_maxLength:()=>Jn,_maxSize:()=>_n,_mime:()=>Mr,_min:()=>Ge,_minLength:()=>Xt,_minSize:()=>Ft,_multipleOf:()=>bn,_nan:()=>bu,_nanoid:()=>Ao,_nativeEnum:()=>DO,_negative:()=>yu,_never:()=>fu,_nonnegative:()=>ku,_nonoptional:()=>FO,_nonpositive:()=>vu,_normalize:()=>Lr,_null:()=>du,_nullable:()=>LO,_number:()=>Qc,_optional:()=>MO,_overwrite:()=>Et,_parse:()=>kr,_parseAsync:()=>xr,_pipe:()=>VO,_positive:()=>_u,_promise:()=>WO,_property:()=>xu,_readonly:()=>HO,_record:()=>AO,_refine:()=>Iu,_regex:()=>Nr,_safeDecode:()=>Aa,_safeDecodeAsync:()=>Ca,_safeEncode:()=>Pa,_safeEncodeAsync:()=>Na,_safeParse:()=>Sr,_safeParseAsync:()=>$r,_set:()=>CO,_size:()=>Wn,_slugify:()=>qr,_startsWith:()=>jr,_string:()=>Yc,_stringFormat:()=>Xn,_stringbool:()=>Ru,_success:()=>BO,_superRefine:()=>wu,_symbol:()=>uu,_templateLiteral:()=>KO,_toLowerCase:()=>Fr,_toUpperCase:()=>Br,_transform:()=>UO,_trim:()=>Zr,_tuple:()=>PO,_uint32:()=>iu,_uint64:()=>cu,_ulid:()=>zo,_undefined:()=>lu,_union:()=>EO,_unknown:()=>mu,_uppercase:()=>zr,_url:()=>Ar,_uuid:()=>Eo,_uuidv4:()=>To,_uuidv6:()=>Ro,_uuidv7:()=>Oo,_void:()=>hu,_xid:()=>Do,_xor:()=>TO,clone:()=>Ce,config:()=>Te,createStandardJSONSchemaMethod:()=>Vr,createToJSONSchemaMethod:()=>Dm,decode:()=>Ty,decodeAsync:()=>Oy,describe:()=>Eu,encode:()=>Ey,encodeAsync:()=>Ry,extractDefs:()=>vn,finalize:()=>kn,flattenError:()=>ho,formatError:()=>go,globalConfig:()=>qn,globalRegistry:()=>ze,initializeContext:()=>yn,isValidBase64:()=>vm,isValidBase64URL:()=>tv,isValidJWT:()=>nv,locales:()=>Or,meta:()=>Tu,parse:()=>Hn,parseAsync:()=>Kn,prettifyError:()=>vp,process:()=>de,regexes:()=>rt,registry:()=>Jc,safeDecode:()=>Ay,safeDecodeAsync:()=>Cy,safeEncode:()=>Py,safeEncodeAsync:()=>Ny,safeParse:()=>fn,safeParseAsync:()=>hn,toDotPath:()=>wy,toJSONSchema:()=>Qn,treeifyError:()=>yp,util:()=>S,version:()=>fm});var hy,ap=Object.freeze({status:"aborted"});function g(t,e,n){function i(c,u){if(c._zod||Object.defineProperty(c,"_zod",{value:{def:u,constr:s,traits:new Set},enumerable:!1}),c._zod.traits.has(t))return;c._zod.traits.add(t),e(c,u);let d=s.prototype,l=Object.keys(d);for(let p=0;p<l.length;p++){let m=l[p];m in c||(c[m]=d[m].bind(c))}}let r=n?.Parent??Object;class o extends r{}Object.defineProperty(o,"name",{value:t});function s(c){var u;let d=n?.Parent?new o:this;i(d,c),(u=d._zod).deferred??(u.deferred=[]);for(let l of d._zod.deferred)l();return d}return Object.defineProperty(s,"init",{value:i}),Object.defineProperty(s,Symbol.hasInstance,{value:c=>n?.Parent&&c instanceof n.Parent?!0:c?._zod?.traits?.has(t)}),Object.defineProperty(s,"name",{value:t}),s}var cp=Symbol("zod_brand"),wt=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},un=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}};(hy=globalThis).__zod_globalConfig??(hy.__zod_globalConfig={});var qn=globalThis.__zod_globalConfig;function Te(t){return t&&Object.assign(qn,t),qn}var S={};Jt(S,{BIGINT_FORMAT_RANGES:()=>bp,Class:()=>lp,NUMBER_FORMAT_RANGES:()=>gp,aborted:()=>mn,allowsEval:()=>mp,assert:()=>LR,assertEqual:()=>DR,assertIs:()=>UR,assertNever:()=>MR,assertNotEqual:()=>jR,assignProp:()=>dn,base64ToUint8Array:()=>Sy,base64urlToUint8Array:()=>YR,cached:()=>yr,captureStackTrace:()=>Ia,cleanEnum:()=>JR,cleanRegex:()=>uo,clone:()=>Ce,cloneDef:()=>FR,createTransparentProxy:()=>GR,defineLazy:()=>W,esc:()=>$a,escapeRegex:()=>gt,explicitlyAborted:()=>_p,extend:()=>yy,finalizeIssue:()=>Ke,floatSafeRemainder:()=>dp,getElementAtPath:()=>BR,getEnumValues:()=>co,getLengthableOrigin:()=>mo,getParsedType:()=>KR,getSizableOrigin:()=>po,hexToUint8Array:()=>QR,isObject:()=>Vn,isPlainObject:()=>pn,issue:()=>vr,joinValues:()=>b,jsonStringifyReplacer:()=>_r,merge:()=>WR,mergeDefs:()=>Yt,normalizeParams:()=>I,nullish:()=>ln,numKeys:()=>HR,objectClone:()=>ZR,omit:()=>_y,optionalKeys:()=>hp,parsedType:()=>x,partial:()=>ky,pick:()=>by,prefixIssues:()=>tt,primitiveTypes:()=>fp,promiseAllObject:()=>qR,propertyKeyTypes:()=>lo,randomString:()=>VR,required:()=>xy,safeExtend:()=>vy,shallowClone:()=>wa,slugify:()=>pp,stringifyPrimitive:()=>k,uint8ArrayToBase64:()=>$y,uint8ArrayToBase64url:()=>XR,uint8ArrayToHex:()=>e0,unwrapMessage:()=>ao});function DR(t){return t}function jR(t){return t}function UR(t){}function MR(t){throw new Error("Unexpected value in exhaustive check")}function LR(t){}function co(t){let e=Object.values(t).filter(i=>typeof i=="number");return Object.entries(t).filter(([i,r])=>e.indexOf(+i)===-1).map(([i,r])=>r)}function b(t,e="|"){return t.map(n=>k(n)).join(e)}function _r(t,e){return typeof e=="bigint"?e.toString():e}function yr(t){return{get value(){{let n=t();return Object.defineProperty(this,"value",{value:n}),n}throw new Error("cached value already set")}}}function ln(t){return t==null}function uo(t){let e=t.startsWith("^")?1:0,n=t.endsWith("$")?t.length-1:t.length;return t.slice(e,n)}function dp(t,e){let n=t/e,i=Math.round(n),r=Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-i)<r?0:n-i}var gy=Symbol("evaluating");function W(t,e,n){let i;Object.defineProperty(t,e,{get(){if(i!==gy)return i===void 0&&(i=gy,i=n()),i},set(r){Object.defineProperty(t,e,{value:r})},configurable:!0})}function ZR(t){return Object.create(Object.getPrototypeOf(t),Object.getOwnPropertyDescriptors(t))}function dn(t,e,n){Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Yt(...t){let e={};for(let n of t){let i=Object.getOwnPropertyDescriptors(n);Object.assign(e,i)}return Object.defineProperties({},e)}function FR(t){return Yt(t._zod.def)}function BR(t,e){return e?e.reduce((n,i)=>n?.[i],t):t}function qR(t){let e=Object.keys(t),n=e.map(i=>t[i]);return Promise.all(n).then(i=>{let r={};for(let o=0;o<e.length;o++)r[e[o]]=i[o];return r})}function VR(t=10){let e="abcdefghijklmnopqrstuvwxyz",n="";for(let i=0;i<t;i++)n+=e[Math.floor(Math.random()*e.length)];return n}function $a(t){return JSON.stringify(t)}function pp(t){return t.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Ia="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function Vn(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}var mp=yr(()=>{if(qn.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let t=Function;return new t(""),!0}catch{return!1}});function pn(t){if(Vn(t)===!1)return!1;let e=t.constructor;if(e===void 0||typeof e!="function")return!0;let n=e.prototype;return!(Vn(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function wa(t){return pn(t)?{...t}:Array.isArray(t)?[...t]:t instanceof Map?new Map(t):t instanceof Set?new Set(t):t}function HR(t){let e=0;for(let n in t)Object.prototype.hasOwnProperty.call(t,n)&&e++;return e}var KR=t=>{let e=typeof t;switch(e){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(t)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(t)?"array":t===null?"null":t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?"promise":typeof Map<"u"&&t instanceof Map?"map":typeof Set<"u"&&t instanceof Set?"set":typeof Date<"u"&&t instanceof Date?"date":typeof File<"u"&&t instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${e}`)}},lo=new Set(["string","number","symbol"]),fp=new Set(["string","number","bigint","boolean","symbol","undefined"]);function gt(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ce(t,e,n){let i=new t._zod.constr(e??t._zod.def);return(!e||n?.parent)&&(i._zod.parent=t),i}function I(t){let e=t;if(!e)return{};if(typeof e=="string")return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:()=>e.error}:e}function GR(t){let e;return new Proxy({},{get(n,i,r){return e??(e=t()),Reflect.get(e,i,r)},set(n,i,r,o){return e??(e=t()),Reflect.set(e,i,r,o)},has(n,i){return e??(e=t()),Reflect.has(e,i)},deleteProperty(n,i){return e??(e=t()),Reflect.deleteProperty(e,i)},ownKeys(n){return e??(e=t()),Reflect.ownKeys(e)},getOwnPropertyDescriptor(n,i){return e??(e=t()),Reflect.getOwnPropertyDescriptor(e,i)},defineProperty(n,i,r){return e??(e=t()),Reflect.defineProperty(e,i,r)}})}function k(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}function hp(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}var gp={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},bp={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function by(t,e){let n=t._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let o=Yt(t._zod.def,{get shape(){let s={};for(let c in e){if(!(c in n.shape))throw new Error(`Unrecognized key: "${c}"`);e[c]&&(s[c]=n.shape[c])}return dn(this,"shape",s),s},checks:[]});return Ce(t,o)}function _y(t,e){let n=t._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let o=Yt(t._zod.def,{get shape(){let s={...t._zod.def.shape};for(let c in e){if(!(c in n.shape))throw new Error(`Unrecognized key: "${c}"`);e[c]&&delete s[c]}return dn(this,"shape",s),s},checks:[]});return Ce(t,o)}function yy(t,e){if(!pn(e))throw new Error("Invalid input to extend: expected a plain object");let n=t._zod.def.checks;if(n&&n.length>0){let o=t._zod.def.shape;for(let s in e)if(Object.getOwnPropertyDescriptor(o,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let r=Yt(t._zod.def,{get shape(){let o={...t._zod.def.shape,...e};return dn(this,"shape",o),o}});return Ce(t,r)}function vy(t,e){if(!pn(e))throw new Error("Invalid input to safeExtend: expected a plain object");let n=Yt(t._zod.def,{get shape(){let i={...t._zod.def.shape,...e};return dn(this,"shape",i),i}});return Ce(t,n)}function WR(t,e){if(t._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let n=Yt(t._zod.def,{get shape(){let i={...t._zod.def.shape,...e._zod.def.shape};return dn(this,"shape",i),i},get catchall(){return e._zod.def.catchall},checks:e._zod.def.checks??[]});return Ce(t,n)}function ky(t,e,n){let r=e._zod.def.checks;if(r&&r.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let s=Yt(e._zod.def,{get shape(){let c=e._zod.def.shape,u={...c};if(n)for(let d in n){if(!(d in c))throw new Error(`Unrecognized key: "${d}"`);n[d]&&(u[d]=t?new t({type:"optional",innerType:c[d]}):c[d])}else for(let d in c)u[d]=t?new t({type:"optional",innerType:c[d]}):c[d];return dn(this,"shape",u),u},checks:[]});return Ce(e,s)}function xy(t,e,n){let i=Yt(e._zod.def,{get shape(){let r=e._zod.def.shape,o={...r};if(n)for(let s in n){if(!(s in o))throw new Error(`Unrecognized key: "${s}"`);n[s]&&(o[s]=new t({type:"nonoptional",innerType:r[s]}))}else for(let s in r)o[s]=new t({type:"nonoptional",innerType:r[s]});return dn(this,"shape",o),o}});return Ce(e,i)}function mn(t,e=0){if(t.aborted===!0)return!0;for(let n=e;n<t.issues.length;n++)if(t.issues[n]?.continue!==!0)return!0;return!1}function _p(t,e=0){if(t.aborted===!0)return!0;for(let n=e;n<t.issues.length;n++)if(t.issues[n]?.continue===!1)return!0;return!1}function tt(t,e){return e.map(n=>{var i;return(i=n).path??(i.path=[]),n.path.unshift(t),n})}function ao(t){return typeof t=="string"?t:t?.message}function Ke(t,e,n){let i=t.message?t.message:ao(t.inst?._zod.def?.error?.(t))??ao(e?.error?.(t))??ao(n.customError?.(t))??ao(n.localeError?.(t))??"Invalid input",{inst:r,continue:o,input:s,...c}=t;return c.path??(c.path=[]),c.message=i,e?.reportInput&&(c.input=s),c}function po(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}function mo(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function x(t){let e=typeof t;switch(e){case"number":return Number.isNaN(t)?"nan":"number";case"object":{if(t===null)return"null";if(Array.isArray(t))return"array";let n=t;if(n&&Object.getPrototypeOf(n)!==Object.prototype&&"constructor"in n&&n.constructor)return n.constructor.name}}return e}function vr(...t){let[e,n,i]=t;return typeof e=="string"?{message:e,code:"custom",input:n,inst:i}:{...e}}function JR(t){return Object.entries(t).filter(([e,n])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function Sy(t){let e=atob(t),n=new Uint8Array(e.length);for(let i=0;i<e.length;i++)n[i]=e.charCodeAt(i);return n}function $y(t){let e="";for(let n=0;n<t.length;n++)e+=String.fromCharCode(t[n]);return btoa(e)}function YR(t){let e=t.replace(/-/g,"+").replace(/_/g,"/"),n="=".repeat((4-e.length%4)%4);return Sy(e+n)}function XR(t){return $y(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function QR(t){let e=t.replace(/^0x/,"");if(e.length%2!==0)throw new Error("Invalid hex string length");let n=new Uint8Array(e.length/2);for(let i=0;i<e.length;i+=2)n[i/2]=Number.parseInt(e.slice(i,i+2),16);return n}function e0(t){return Array.from(t).map(e=>e.toString(16).padStart(2,"0")).join("")}var lp=class{constructor(...e){}};var Iy=(t,e)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:!1}),Object.defineProperty(t,"issues",{value:e,enumerable:!1}),t.message=JSON.stringify(e,_r,2),Object.defineProperty(t,"toString",{value:()=>t.message,enumerable:!1})},fo=g("$ZodError",Iy),nt=g("$ZodError",Iy,{Parent:Error});function ho(t,e=n=>n.message){let n={},i=[];for(let r of t.issues)r.path.length>0?(n[r.path[0]]=n[r.path[0]]||[],n[r.path[0]].push(e(r))):i.push(e(r));return{formErrors:i,fieldErrors:n}}function go(t,e=n=>n.message){let n={_errors:[]},i=(r,o=[])=>{for(let s of r.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(c=>i({issues:c},[...o,...s.path]));else if(s.code==="invalid_key")i({issues:s.issues},[...o,...s.path]);else if(s.code==="invalid_element")i({issues:s.issues},[...o,...s.path]);else{let c=[...o,...s.path];if(c.length===0)n._errors.push(e(s));else{let u=n,d=0;for(;d<c.length;){let l=c[d];d===c.length-1?(u[l]=u[l]||{_errors:[]},u[l]._errors.push(e(s))):u[l]=u[l]||{_errors:[]},u=u[l],d++}}}};return i(t),n}function yp(t,e=n=>n.message){let n={errors:[]},i=(r,o=[])=>{var s,c;for(let u of r.issues)if(u.code==="invalid_union"&&u.errors.length)u.errors.map(d=>i({issues:d},[...o,...u.path]));else if(u.code==="invalid_key")i({issues:u.issues},[...o,...u.path]);else if(u.code==="invalid_element")i({issues:u.issues},[...o,...u.path]);else{let d=[...o,...u.path];if(d.length===0){n.errors.push(e(u));continue}let l=n,p=0;for(;p<d.length;){let m=d[p],f=p===d.length-1;typeof m=="string"?(l.properties??(l.properties={}),(s=l.properties)[m]??(s[m]={errors:[]}),l=l.properties[m]):(l.items??(l.items=[]),(c=l.items)[m]??(c[m]={errors:[]}),l=l.items[m]),f&&l.errors.push(e(u)),p++}}};return i(t),n}function wy(t){let e=[],n=t.map(i=>typeof i=="object"?i.key:i);for(let i of n)typeof i=="number"?e.push(`[${i}]`):typeof i=="symbol"?e.push(`[${JSON.stringify(String(i))}]`):/[^\w$]/.test(i)?e.push(`[${JSON.stringify(i)}]`):(e.length&&e.push("."),e.push(i));return e.join("")}function vp(t){let e=[],n=[...t.issues].sort((i,r)=>(i.path??[]).length-(r.path??[]).length);for(let i of n)e.push(`\u2716 ${i.message}`),i.path?.length&&e.push(` \u2192 at ${wy(i.path)}`);return e.join(`
|
|
11
|
+
`)}var kr=t=>(e,n,i,r)=>{let o=i?{...i,async:!1}:{async:!1},s=e._zod.run({value:n,issues:[]},o);if(s instanceof Promise)throw new wt;if(s.issues.length){let c=new(r?.Err??t)(s.issues.map(u=>Ke(u,o,Te())));throw Ia(c,r?.callee),c}return s.value},Hn=kr(nt),xr=t=>async(e,n,i,r)=>{let o=i?{...i,async:!0}:{async:!0},s=e._zod.run({value:n,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let c=new(r?.Err??t)(s.issues.map(u=>Ke(u,o,Te())));throw Ia(c,r?.callee),c}return s.value},Kn=xr(nt),Sr=t=>(e,n,i)=>{let r=i?{...i,async:!1}:{async:!1},o=e._zod.run({value:n,issues:[]},r);if(o instanceof Promise)throw new wt;return o.issues.length?{success:!1,error:new(t??fo)(o.issues.map(s=>Ke(s,r,Te())))}:{success:!0,data:o.value}},fn=Sr(nt),$r=t=>async(e,n,i)=>{let r=i?{...i,async:!0}:{async:!0},o=e._zod.run({value:n,issues:[]},r);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new t(o.issues.map(s=>Ke(s,r,Te())))}:{success:!0,data:o.value}},hn=$r(nt),Ea=t=>(e,n,i)=>{let r=i?{...i,direction:"backward"}:{direction:"backward"};return kr(t)(e,n,r)},Ey=Ea(nt),Ta=t=>(e,n,i)=>kr(t)(e,n,i),Ty=Ta(nt),Ra=t=>async(e,n,i)=>{let r=i?{...i,direction:"backward"}:{direction:"backward"};return xr(t)(e,n,r)},Ry=Ra(nt),Oa=t=>async(e,n,i)=>xr(t)(e,n,i),Oy=Oa(nt),Pa=t=>(e,n,i)=>{let r=i?{...i,direction:"backward"}:{direction:"backward"};return Sr(t)(e,n,r)},Py=Pa(nt),Aa=t=>(e,n,i)=>Sr(t)(e,n,i),Ay=Aa(nt),Na=t=>async(e,n,i)=>{let r=i?{...i,direction:"backward"}:{direction:"backward"};return $r(t)(e,n,r)},Ny=Na(nt),Ca=t=>async(e,n,i)=>$r(t)(e,n,i),Cy=Ca(nt);var rt={};Jt(rt,{base64:()=>Dp,base64url:()=>za,bigint:()=>Bp,boolean:()=>Vp,browserEmail:()=>u0,cidrv4:()=>Cp,cidrv6:()=>zp,cuid:()=>kp,cuid2:()=>xp,date:()=>Mp,datetime:()=>Zp,domain:()=>p0,duration:()=>Ep,e164:()=>Up,email:()=>Rp,emoji:()=>Op,extendedDuration:()=>n0,guid:()=>Tp,hex:()=>m0,hostname:()=>d0,html5Email:()=>s0,httpProtocol:()=>jp,idnEmail:()=>c0,integer:()=>qp,ipv4:()=>Pp,ipv6:()=>Ap,ksuid:()=>Ip,lowercase:()=>Gp,mac:()=>Np,md5_base64:()=>h0,md5_base64url:()=>g0,md5_hex:()=>f0,nanoid:()=>wp,null:()=>Hp,number:()=>Da,rfc5322Email:()=>a0,sha1_base64:()=>_0,sha1_base64url:()=>y0,sha1_hex:()=>b0,sha256_base64:()=>k0,sha256_base64url:()=>x0,sha256_hex:()=>v0,sha384_base64:()=>$0,sha384_base64url:()=>I0,sha384_hex:()=>S0,sha512_base64:()=>E0,sha512_base64url:()=>T0,sha512_hex:()=>w0,string:()=>Fp,time:()=>Lp,ulid:()=>Sp,undefined:()=>Kp,unicodeEmail:()=>zy,uppercase:()=>Wp,uuid:()=>Gn,uuid4:()=>r0,uuid6:()=>i0,uuid7:()=>o0,xid:()=>$p});var kp=/^[cC][0-9a-z]{6,}$/,xp=/^[0-9a-z]+$/,Sp=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,$p=/^[0-9a-vA-V]{20}$/,Ip=/^[A-Za-z0-9]{27}$/,wp=/^[a-zA-Z0-9_-]{21}$/,Ep=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,n0=/^[-+]?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)?)??$/,Tp=/^([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})$/,Gn=t=>t?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,r0=Gn(4),i0=Gn(6),o0=Gn(7),Rp=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,s0=/^[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])?)*$/,a0=/^(([^<>()\[\]\\.,;:\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,}))$/,zy=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,c0=zy,u0=/^[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])?)*$/,l0="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Op(){return new RegExp(l0,"u")}var Pp=/^(?:(?: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])$/,Ap=/^(([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}|:))$/,Np=t=>{let e=gt(t??":");return new RegExp(`^(?:[0-9A-F]{2}${e}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${e}){5}[0-9a-f]{2}$`)},Cp=/^((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])$/,zp=/^(([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])$/,Dp=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,za=/^[A-Za-z0-9_-]*$/,d0=/^(?=.{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])?)*\.?$/,p0=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,jp=/^https?$/,Up=/^\+[1-9]\d{6,14}$/,Dy="(?:(?:\\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])))",Mp=new RegExp(`^${Dy}$`);function jy(t){let e="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof t.precision=="number"?t.precision===-1?`${e}`:t.precision===0?`${e}:[0-5]\\d`:`${e}:[0-5]\\d\\.\\d{${t.precision}}`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Lp(t){return new RegExp(`^${jy(t)}$`)}function Zp(t){let e=jy({precision:t.precision}),n=["Z"];t.local&&n.push(""),t.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let i=`${e}(?:${n.join("|")})`;return new RegExp(`^${Dy}T(?:${i})$`)}var Fp=t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},Bp=/^-?\d+n?$/,qp=/^-?\d+$/,Da=/^-?\d+(?:\.\d+)?$/,Vp=/^(?:true|false)$/i,Hp=/^null$/i;var Kp=/^undefined$/i;var Gp=/^[^A-Z]*$/,Wp=/^[^a-z]*$/,m0=/^[0-9a-fA-F]*$/;function bo(t,e){return new RegExp(`^[A-Za-z0-9+/]{${t}}${e}$`)}function _o(t){return new RegExp(`^[A-Za-z0-9_-]{${t}}$`)}var f0=/^[0-9a-fA-F]{32}$/,h0=bo(22,"=="),g0=_o(22),b0=/^[0-9a-fA-F]{40}$/,_0=bo(27,"="),y0=_o(27),v0=/^[0-9a-fA-F]{64}$/,k0=bo(43,"="),x0=_o(43),S0=/^[0-9a-fA-F]{96}$/,$0=bo(64,""),I0=_o(64),w0=/^[0-9a-fA-F]{128}$/,E0=bo(86,"=="),T0=_o(86);var fe=g("$ZodCheck",(t,e)=>{var n;t._zod??(t._zod={}),t._zod.def=e,(n=t._zod).onattach??(n.onattach=[])}),My={number:"number",bigint:"bigint",object:"date"},ja=g("$ZodCheckLessThan",(t,e)=>{fe.init(t,e);let n=My[typeof e.value];t._zod.onattach.push(i=>{let r=i._zod.bag,o=(e.inclusive?r.maximum:r.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value<o&&(e.inclusive?r.maximum=e.value:r.exclusiveMaximum=e.value)}),t._zod.check=i=>{(e.inclusive?i.value<=e.value:i.value<e.value)||i.issues.push({origin:n,code:"too_big",maximum:typeof e.value=="object"?e.value.getTime():e.value,input:i.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),Ua=g("$ZodCheckGreaterThan",(t,e)=>{fe.init(t,e);let n=My[typeof e.value];t._zod.onattach.push(i=>{let r=i._zod.bag,o=(e.inclusive?r.minimum:r.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>o&&(e.inclusive?r.minimum=e.value:r.exclusiveMinimum=e.value)}),t._zod.check=i=>{(e.inclusive?i.value>=e.value:i.value>e.value)||i.issues.push({origin:n,code:"too_small",minimum:typeof e.value=="object"?e.value.getTime():e.value,input:i.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),Jp=g("$ZodCheckMultipleOf",(t,e)=>{fe.init(t,e),t._zod.onattach.push(n=>{var i;(i=n._zod.bag).multipleOf??(i.multipleOf=e.value)}),t._zod.check=n=>{if(typeof n.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%e.value===BigInt(0):dp(n.value,e.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:e.value,input:n.value,inst:t,continue:!e.abort})}}),Yp=g("$ZodCheckNumberFormat",(t,e)=>{fe.init(t,e),e.format=e.format||"float64";let n=e.format?.includes("int"),i=n?"int":"number",[r,o]=gp[e.format];t._zod.onattach.push(s=>{let c=s._zod.bag;c.format=e.format,c.minimum=r,c.maximum=o,n&&(c.pattern=qp)}),t._zod.check=s=>{let c=s.value;if(n){if(!Number.isInteger(c)){s.issues.push({expected:i,format:e.format,code:"invalid_type",continue:!1,input:c,inst:t});return}if(!Number.isSafeInteger(c)){c>0?s.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:i,inclusive:!0,continue:!e.abort}):s.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:i,inclusive:!0,continue:!e.abort});return}}c<r&&s.issues.push({origin:"number",input:c,code:"too_small",minimum:r,inclusive:!0,inst:t,continue:!e.abort}),c>o&&s.issues.push({origin:"number",input:c,code:"too_big",maximum:o,inclusive:!0,inst:t,continue:!e.abort})}}),Xp=g("$ZodCheckBigIntFormat",(t,e)=>{fe.init(t,e);let[n,i]=bp[e.format];t._zod.onattach.push(r=>{let o=r._zod.bag;o.format=e.format,o.minimum=n,o.maximum=i}),t._zod.check=r=>{let o=r.value;o<n&&r.issues.push({origin:"bigint",input:o,code:"too_small",minimum:n,inclusive:!0,inst:t,continue:!e.abort}),o>i&&r.issues.push({origin:"bigint",input:o,code:"too_big",maximum:i,inclusive:!0,inst:t,continue:!e.abort})}}),Qp=g("$ZodCheckMaxSize",(t,e)=>{var n;fe.init(t,e),(n=t._zod.def).when??(n.when=i=>{let r=i.value;return!ln(r)&&r.size!==void 0}),t._zod.onattach.push(i=>{let r=i._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<r&&(i._zod.bag.maximum=e.maximum)}),t._zod.check=i=>{let r=i.value;r.size<=e.maximum||i.issues.push({origin:po(r),code:"too_big",maximum:e.maximum,inclusive:!0,input:r,inst:t,continue:!e.abort})}}),em=g("$ZodCheckMinSize",(t,e)=>{var n;fe.init(t,e),(n=t._zod.def).when??(n.when=i=>{let r=i.value;return!ln(r)&&r.size!==void 0}),t._zod.onattach.push(i=>{let r=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>r&&(i._zod.bag.minimum=e.minimum)}),t._zod.check=i=>{let r=i.value;r.size>=e.minimum||i.issues.push({origin:po(r),code:"too_small",minimum:e.minimum,inclusive:!0,input:r,inst:t,continue:!e.abort})}}),tm=g("$ZodCheckSizeEquals",(t,e)=>{var n;fe.init(t,e),(n=t._zod.def).when??(n.when=i=>{let r=i.value;return!ln(r)&&r.size!==void 0}),t._zod.onattach.push(i=>{let r=i._zod.bag;r.minimum=e.size,r.maximum=e.size,r.size=e.size}),t._zod.check=i=>{let r=i.value,o=r.size;if(o===e.size)return;let s=o>e.size;i.issues.push({origin:po(r),...s?{code:"too_big",maximum:e.size}:{code:"too_small",minimum:e.size},inclusive:!0,exact:!0,input:i.value,inst:t,continue:!e.abort})}}),nm=g("$ZodCheckMaxLength",(t,e)=>{var n;fe.init(t,e),(n=t._zod.def).when??(n.when=i=>{let r=i.value;return!ln(r)&&r.length!==void 0}),t._zod.onattach.push(i=>{let r=i._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<r&&(i._zod.bag.maximum=e.maximum)}),t._zod.check=i=>{let r=i.value;if(r.length<=e.maximum)return;let s=mo(r);i.issues.push({origin:s,code:"too_big",maximum:e.maximum,inclusive:!0,input:r,inst:t,continue:!e.abort})}}),rm=g("$ZodCheckMinLength",(t,e)=>{var n;fe.init(t,e),(n=t._zod.def).when??(n.when=i=>{let r=i.value;return!ln(r)&&r.length!==void 0}),t._zod.onattach.push(i=>{let r=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>r&&(i._zod.bag.minimum=e.minimum)}),t._zod.check=i=>{let r=i.value;if(r.length>=e.minimum)return;let s=mo(r);i.issues.push({origin:s,code:"too_small",minimum:e.minimum,inclusive:!0,input:r,inst:t,continue:!e.abort})}}),im=g("$ZodCheckLengthEquals",(t,e)=>{var n;fe.init(t,e),(n=t._zod.def).when??(n.when=i=>{let r=i.value;return!ln(r)&&r.length!==void 0}),t._zod.onattach.push(i=>{let r=i._zod.bag;r.minimum=e.length,r.maximum=e.length,r.length=e.length}),t._zod.check=i=>{let r=i.value,o=r.length;if(o===e.length)return;let s=mo(r),c=o>e.length;i.issues.push({origin:s,...c?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:i.value,inst:t,continue:!e.abort})}}),Ir=g("$ZodCheckStringFormat",(t,e)=>{var n,i;fe.init(t,e),t._zod.onattach.push(r=>{let o=r._zod.bag;o.format=e.format,e.pattern&&(o.patterns??(o.patterns=new Set),o.patterns.add(e.pattern))}),e.pattern?(n=t._zod).check??(n.check=r=>{e.pattern.lastIndex=0,!e.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:e.format,input:r.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})}):(i=t._zod).check??(i.check=()=>{})}),om=g("$ZodCheckRegex",(t,e)=>{Ir.init(t,e),t._zod.check=n=>{e.pattern.lastIndex=0,!e.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:e.pattern.toString(),inst:t,continue:!e.abort})}}),sm=g("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=Gp),Ir.init(t,e)}),am=g("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=Wp),Ir.init(t,e)}),cm=g("$ZodCheckIncludes",(t,e)=>{fe.init(t,e);let n=gt(e.includes),i=new RegExp(typeof e.position=="number"?`^.{${e.position}}${n}`:n);e.pattern=i,t._zod.onattach.push(r=>{let o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(i)}),t._zod.check=r=>{r.value.includes(e.includes,e.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:r.value,inst:t,continue:!e.abort})}}),um=g("$ZodCheckStartsWith",(t,e)=>{fe.init(t,e);let n=new RegExp(`^${gt(e.prefix)}.*`);e.pattern??(e.pattern=n),t._zod.onattach.push(i=>{let r=i._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(n)}),t._zod.check=i=>{i.value.startsWith(e.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:i.value,inst:t,continue:!e.abort})}}),lm=g("$ZodCheckEndsWith",(t,e)=>{fe.init(t,e);let n=new RegExp(`.*${gt(e.suffix)}$`);e.pattern??(e.pattern=n),t._zod.onattach.push(i=>{let r=i._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(n)}),t._zod.check=i=>{i.value.endsWith(e.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:i.value,inst:t,continue:!e.abort})}});function Uy(t,e,n){t.issues.length&&e.issues.push(...tt(n,t.issues))}var dm=g("$ZodCheckProperty",(t,e)=>{fe.init(t,e),t._zod.check=n=>{let i=e.schema._zod.run({value:n.value[e.property],issues:[]},{});if(i instanceof Promise)return i.then(r=>Uy(r,n,e.property));Uy(i,n,e.property)}}),pm=g("$ZodCheckMimeType",(t,e)=>{fe.init(t,e);let n=new Set(e.mime);t._zod.onattach.push(i=>{i._zod.bag.mime=e.mime}),t._zod.check=i=>{n.has(i.value.type)||i.issues.push({code:"invalid_value",values:e.mime,input:i.value.type,inst:t,continue:!e.abort})}}),mm=g("$ZodCheckOverwrite",(t,e)=>{fe.init(t,e),t._zod.check=n=>{n.value=e.tx(n.value)}});var yo=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let i=e.split(`
|
|
12
|
+
`).filter(s=>s),r=Math.min(...i.map(s=>s.length-s.trimStart().length)),o=i.map(s=>s.slice(r)).map(s=>" ".repeat(this.indent*2)+s);for(let s of o)this.content.push(s)}compile(){let e=Function,n=this?.args,r=[...(this?.content??[""]).map(o=>` ${o}`)];return new e(...n,r.join(`
|
|
13
|
+
`))}};var fm={major:4,minor:4,patch:3};var V=g("$ZodType",(t,e)=>{var n;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=fm;let i=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&i.unshift(t);for(let r of i)for(let o of r._zod.onattach)o(t);if(i.length===0)(n=t._zod).deferred??(n.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{let r=(s,c,u)=>{let d=mn(s),l;for(let p of c){if(p._zod.def.when){if(_p(s)||!p._zod.def.when(s))continue}else if(d)continue;let m=s.issues.length,f=p._zod.check(s);if(f instanceof Promise&&u?.async===!1)throw new wt;if(l||f instanceof Promise)l=(l??Promise.resolve()).then(async()=>{await f,s.issues.length!==m&&(d||(d=mn(s,m)))});else{if(s.issues.length===m)continue;d||(d=mn(s,m))}}return l?l.then(()=>s):s},o=(s,c,u)=>{if(mn(s))return s.aborted=!0,s;let d=r(c,i,u);if(d instanceof Promise){if(u.async===!1)throw new wt;return d.then(l=>t._zod.parse(l,u))}return t._zod.parse(d,u)};t._zod.run=(s,c)=>{if(c.skipChecks)return t._zod.parse(s,c);if(c.direction==="backward"){let d=t._zod.parse({value:s.value,issues:[]},{...c,skipChecks:!0});return d instanceof Promise?d.then(l=>o(l,s,c)):o(d,s,c)}let u=t._zod.parse(s,c);if(u instanceof Promise){if(c.async===!1)throw new wt;return u.then(d=>r(d,i,c))}return r(u,i,c)}}W(t,"~standard",()=>({validate:r=>{try{let o=fn(t,r);return o.success?{value:o.data}:{issues:o.error?.issues}}catch{return hn(t,r).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},vendor:"zod",version:1}))}),gn=g("$ZodString",(t,e)=>{V.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??Fp(t._zod.bag),t._zod.parse=(n,i)=>{if(e.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:t}),n}}),pe=g("$ZodStringFormat",(t,e)=>{Ir.init(t,e),gn.init(t,e)}),Ba=g("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=Tp),pe.init(t,e)}),qa=g("$ZodUUID",(t,e)=>{if(e.version){let i={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(i===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=Gn(i))}else e.pattern??(e.pattern=Gn());pe.init(t,e)}),Va=g("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=Rp),pe.init(t,e)}),Ha=g("$ZodURL",(t,e)=>{pe.init(t,e),t._zod.check=n=>{try{let i=n.value.trim();if(!e.normalize&&e.protocol?.source===jp.source&&!/^https?:\/\//i.test(i)){n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:t,continue:!e.abort});return}let r=new URL(i);e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(r.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:e.hostname.source,input:n.value,inst:t,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(r.protocol.endsWith(":")?r.protocol.slice(0,-1):r.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:n.value,inst:t,continue:!e.abort})),e.normalize?n.value=r.href:n.value=i;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:t,continue:!e.abort})}}}),Ka=g("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=Op()),pe.init(t,e)}),Ga=g("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=wp),pe.init(t,e)}),Wa=g("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=kp),pe.init(t,e)}),Ja=g("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=xp),pe.init(t,e)}),Ya=g("$ZodULID",(t,e)=>{e.pattern??(e.pattern=Sp),pe.init(t,e)}),Xa=g("$ZodXID",(t,e)=>{e.pattern??(e.pattern=$p),pe.init(t,e)}),Qa=g("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=Ip),pe.init(t,e)}),gm=g("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=Zp(e)),pe.init(t,e)}),bm=g("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=Mp),pe.init(t,e)}),_m=g("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=Lp(e)),pe.init(t,e)}),ym=g("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=Ep),pe.init(t,e)}),ec=g("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=Pp),pe.init(t,e),t._zod.bag.format="ipv4"}),tc=g("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=Ap),pe.init(t,e),t._zod.bag.format="ipv6",t._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:t,continue:!e.abort})}}}),nc=g("$ZodMAC",(t,e)=>{e.pattern??(e.pattern=Np(e.delimiter)),pe.init(t,e),t._zod.bag.format="mac"}),rc=g("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=Cp),pe.init(t,e)}),ic=g("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=zp),pe.init(t,e),t._zod.check=n=>{let i=n.value.split("/");try{if(i.length!==2)throw new Error;let[r,o]=i;if(!o)throw new Error;let s=Number(o);if(`${s}`!==o)throw new Error;if(s<0||s>128)throw new Error;new URL(`http://[${r}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:t,continue:!e.abort})}}});function vm(t){if(t==="")return!0;if(/\s/.test(t)||t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}var oc=g("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=Dp),pe.init(t,e),t._zod.bag.contentEncoding="base64",t._zod.check=n=>{vm(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:t,continue:!e.abort})}});function tv(t){if(!za.test(t))return!1;let e=t.replace(/[-_]/g,i=>i==="-"?"+":"/"),n=e.padEnd(Math.ceil(e.length/4)*4,"=");return vm(n)}var sc=g("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=za),pe.init(t,e),t._zod.bag.contentEncoding="base64url",t._zod.check=n=>{tv(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:t,continue:!e.abort})}}),ac=g("$ZodE164",(t,e)=>{e.pattern??(e.pattern=Up),pe.init(t,e)});function nv(t,e=null){try{let n=t.split(".");if(n.length!==3)return!1;let[i]=n;if(!i)return!1;let r=JSON.parse(atob(i));return!("typ"in r&&r?.typ!=="JWT"||!r.alg||e&&(!("alg"in r)||r.alg!==e))}catch{return!1}}var cc=g("$ZodJWT",(t,e)=>{pe.init(t,e),t._zod.check=n=>{nv(n.value,e.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:t,continue:!e.abort})}}),uc=g("$ZodCustomStringFormat",(t,e)=>{pe.init(t,e),t._zod.check=n=>{e.fn(n.value)||n.issues.push({code:"invalid_format",format:e.format,input:n.value,inst:t,continue:!e.abort})}}),vo=g("$ZodNumber",(t,e)=>{V.init(t,e),t._zod.pattern=t._zod.bag.pattern??Da,t._zod.parse=(n,i)=>{if(e.coerce)try{n.value=Number(n.value)}catch{}let r=n.value;if(typeof r=="number"&&!Number.isNaN(r)&&Number.isFinite(r))return n;let o=typeof r=="number"?Number.isNaN(r)?"NaN":Number.isFinite(r)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:r,inst:t,...o?{received:o}:{}}),n}}),lc=g("$ZodNumberFormat",(t,e)=>{Yp.init(t,e),vo.init(t,e)}),wr=g("$ZodBoolean",(t,e)=>{V.init(t,e),t._zod.pattern=Vp,t._zod.parse=(n,i)=>{if(e.coerce)try{n.value=!!n.value}catch{}let r=n.value;return typeof r=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:r,inst:t}),n}}),ko=g("$ZodBigInt",(t,e)=>{V.init(t,e),t._zod.pattern=Bp,t._zod.parse=(n,i)=>{if(e.coerce)try{n.value=BigInt(n.value)}catch{}return typeof n.value=="bigint"||n.issues.push({expected:"bigint",code:"invalid_type",input:n.value,inst:t}),n}}),dc=g("$ZodBigIntFormat",(t,e)=>{Xp.init(t,e),ko.init(t,e)}),pc=g("$ZodSymbol",(t,e)=>{V.init(t,e),t._zod.parse=(n,i)=>{let r=n.value;return typeof r=="symbol"||n.issues.push({expected:"symbol",code:"invalid_type",input:r,inst:t}),n}}),mc=g("$ZodUndefined",(t,e)=>{V.init(t,e),t._zod.pattern=Kp,t._zod.values=new Set([void 0]),t._zod.parse=(n,i)=>{let r=n.value;return typeof r>"u"||n.issues.push({expected:"undefined",code:"invalid_type",input:r,inst:t}),n}}),fc=g("$ZodNull",(t,e)=>{V.init(t,e),t._zod.pattern=Hp,t._zod.values=new Set([null]),t._zod.parse=(n,i)=>{let r=n.value;return r===null||n.issues.push({expected:"null",code:"invalid_type",input:r,inst:t}),n}}),hc=g("$ZodAny",(t,e)=>{V.init(t,e),t._zod.parse=n=>n}),gc=g("$ZodUnknown",(t,e)=>{V.init(t,e),t._zod.parse=n=>n}),bc=g("$ZodNever",(t,e)=>{V.init(t,e),t._zod.parse=(n,i)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:t}),n)}),_c=g("$ZodVoid",(t,e)=>{V.init(t,e),t._zod.parse=(n,i)=>{let r=n.value;return typeof r>"u"||n.issues.push({expected:"void",code:"invalid_type",input:r,inst:t}),n}}),yc=g("$ZodDate",(t,e)=>{V.init(t,e),t._zod.parse=(n,i)=>{if(e.coerce)try{n.value=new Date(n.value)}catch{}let r=n.value,o=r instanceof Date;return o&&!Number.isNaN(r.getTime())||n.issues.push({expected:"date",code:"invalid_type",input:r,...o?{received:"Invalid Date"}:{},inst:t}),n}});function Zy(t,e,n){t.issues.length&&e.issues.push(...tt(n,t.issues)),e.value[n]=t.value}var vc=g("$ZodArray",(t,e)=>{V.init(t,e),t._zod.parse=(n,i)=>{let r=n.value;if(!Array.isArray(r))return n.issues.push({expected:"array",code:"invalid_type",input:r,inst:t}),n;n.value=Array(r.length);let o=[];for(let s=0;s<r.length;s++){let c=r[s],u=e.element._zod.run({value:c,issues:[]},i);u instanceof Promise?o.push(u.then(d=>Zy(d,n,s))):Zy(u,n,s)}return o.length?Promise.all(o).then(()=>n):n}});function Fa(t,e,n,i,r,o){let s=n in i;if(t.issues.length){if(r&&o&&!s)return;e.issues.push(...tt(n,t.issues))}if(!s&&!r){t.issues.length||e.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]});return}t.value===void 0?s&&(e.value[n]=void 0):e.value[n]=t.value}function rv(t){let e=Object.keys(t.shape);for(let i of e)if(!t.shape?.[i]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${i}": expected a Zod schema`);let n=hp(t.shape);return{...t,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(n)}}function iv(t,e,n,i,r,o){let s=[],c=r.keySet,u=r.catchall._zod,d=u.def.type,l=u.optin==="optional",p=u.optout==="optional";for(let m in e){if(m==="__proto__"||c.has(m))continue;if(d==="never"){s.push(m);continue}let f=u.run({value:e[m],issues:[]},i);f instanceof Promise?t.push(f.then(h=>Fa(h,n,m,e,l,p))):Fa(f,n,m,e,l,p)}return s.length&&n.issues.push({code:"unrecognized_keys",keys:s,input:e,inst:o}),t.length?Promise.all(t).then(()=>n):n}var kc=g("$ZodObject",(t,e)=>{if(V.init(t,e),!Object.getOwnPropertyDescriptor(e,"shape")?.get){let c=e.shape;Object.defineProperty(e,"shape",{get:()=>{let u={...c};return Object.defineProperty(e,"shape",{value:u}),u}})}let i=yr(()=>rv(e));W(t._zod,"propValues",()=>{let c=e.shape,u={};for(let d in c){let l=c[d]._zod;if(l.values){u[d]??(u[d]=new Set);for(let p of l.values)u[d].add(p)}}return u});let r=Vn,o=e.catchall,s;t._zod.parse=(c,u)=>{s??(s=i.value);let d=c.value;if(!r(d))return c.issues.push({expected:"object",code:"invalid_type",input:d,inst:t}),c;c.value={};let l=[],p=s.shape;for(let m of s.keys){let f=p[m],h=f._zod.optin==="optional",y=f._zod.optout==="optional",v=f._zod.run({value:d[m],issues:[]},u);v instanceof Promise?l.push(v.then(E=>Fa(E,c,m,d,h,y))):Fa(v,c,m,d,h,y)}return o?iv(l,d,c,u,i.value,t):l.length?Promise.all(l).then(()=>c):c}}),km=g("$ZodObjectJIT",(t,e)=>{kc.init(t,e);let n=t._zod.parse,i=yr(()=>rv(e)),r=m=>{let f=new yo(["shape","payload","ctx"]),h=i.value,y=z=>{let j=$a(z);return`shape[${j}]._zod.run({ value: input[${j}], issues: [] }, ctx)`};f.write("const input = payload.value;");let v=Object.create(null),E=0;for(let z of h.keys)v[z]=`key_${E++}`;f.write("const newResult = {};");for(let z of h.keys){let j=v[z],D=$a(z),ut=m[z],ht=ut?._zod?.optin==="optional",oo=ut?._zod?.optout==="optional";f.write(`const ${j} = ${y(z)};`),ht&&oo?f.write(`
|
|
14
14
|
if (${j}.issues.length) {
|
|
15
15
|
if (${D} in input) {
|
|
16
16
|
payload.issues = payload.issues.concat(${j}.issues.map(iss => ({
|
|
@@ -69,36 +69,30 @@ var j0=Object.create;var up=Object.defineProperty;var U0=Object.getOwnPropertyDe
|
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
`)}f.write("payload.value = newResult;"),f.write("return payload;");let N=f.compile();return(z,j)=>N(m,z,j)},i,a=qr,c=!Vr.jitless,d=c&&gp.value,l=e.catchall,p;t._zod.parse=(m,f)=>{p??(p=o.value);let g=m.value;return a(g)?c&&d&&f?.async===!1&&f.jitless!==!0?(i||(i=r(e.shape)),m=i(m,f),l?Jv([],g,m,f,p,t):m):n(m,f):(m.issues.push({expected:"object",code:"invalid_type",input:g,inst:t}),m)}});function Nv(t,e,n,o){for(let i of t)if(i.issues.length===0)return e.value=i.value,e;let r=t.filter(i=>!hr(i));return r.length===1?(e.value=r[0].value,r[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:n,errors:t.map(i=>i.issues.map(a=>Ke(a,o,Te())))}),e)}var On=h("$ZodUnion",(t,e)=>{B.init(t,e),W(t._zod,"optin",()=>e.options.some(o=>o._zod.optin==="optional")?"optional":void 0),W(t._zod,"optout",()=>e.options.some(o=>o._zod.optout==="optional")?"optional":void 0),W(t._zod,"values",()=>{if(e.options.every(o=>o._zod.values))return new Set(e.options.flatMap(o=>Array.from(o._zod.values)))}),W(t._zod,"pattern",()=>{if(e.options.every(o=>o._zod.pattern)){let o=e.options.map(r=>r._zod.pattern);return new RegExp(`^(${o.map(r=>pi(r.source)).join("|")})$`)}});let n=e.options.length===1?e.options[0]._zod.run:null;t._zod.parse=(o,r)=>{if(n)return n(o,r);let i=!1,a=[];for(let c of e.options){let u=c._zod.run({value:o.value,issues:[]},r);if(u instanceof Promise)a.push(u),i=!0;else{if(u.issues.length===0)return u;a.push(u)}}return i?Promise.all(a).then(c=>Nv(c,o,t,r)):Nv(a,o,t,r)}});function zv(t,e,n,o){let r=t.filter(i=>i.issues.length===0);return r.length===1?(e.value=r[0].value,e):(r.length===0?e.issues.push({code:"invalid_union",input:e.value,inst:n,errors:t.map(i=>i.issues.map(a=>Ke(a,o,Te())))}):e.issues.push({code:"invalid_union",input:e.value,inst:n,errors:[],inclusive:!1}),e)}var wc=h("$ZodXor",(t,e)=>{On.init(t,e),e.inclusive=!1;let n=e.options.length===1?e.options[0]._zod.run:null;t._zod.parse=(o,r)=>{if(n)return n(o,r);let i=!1,a=[];for(let c of e.options){let u=c._zod.run({value:o.value,issues:[]},r);u instanceof Promise?(a.push(u),i=!0):a.push(u)}return i?Promise.all(a).then(c=>zv(c,o,t,r)):zv(a,o,t,r)}}),Ec=h("$ZodDiscriminatedUnion",(t,e)=>{e.inclusive=!1,On.init(t,e);let n=t._zod.parse;W(t._zod,"propValues",()=>{let r={};for(let i of e.options){let a=i._zod.propValues;if(!a||Object.keys(a).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(i)}"`);for(let[c,u]of Object.entries(a)){r[c]||(r[c]=new Set);for(let d of u)r[c].add(d)}}return r});let o=xn(()=>{let r=e.options,i=new Map;for(let a of r){let c=a._zod.propValues?.[e.discriminator];if(!c||c.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(a)}"`);for(let u of c){if(i.has(u))throw new Error(`Duplicate discriminator value "${String(u)}"`);i.set(u,a)}}return i});t._zod.parse=(r,i)=>{let a=r.value;if(!qr(a))return r.issues.push({code:"invalid_type",expected:"object",input:a,inst:t}),r;let c=o.value.get(a?.[e.discriminator]);return c?c._zod.run(r,i):e.unionFallback||i.direction==="backward"?n(r,i):(r.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,options:Array.from(o.value.keys()),input:a,path:[e.discriminator],inst:t}),r)}}),Tc=h("$ZodIntersection",(t,e)=>{B.init(t,e),t._zod.parse=(n,o)=>{let r=n.value,i=e.left._zod.run({value:r,issues:[]},o),a=e.right._zod.run({value:r,issues:[]},o);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([u,d])=>Dv(n,u,d)):Dv(n,i,a)}});function ym(t,e){if(t===e)return{valid:!0,data:t};if(t instanceof Date&&e instanceof Date&&+t==+e)return{valid:!0,data:t};if(fr(t)&&fr(e)){let n=Object.keys(e),o=Object.keys(t).filter(i=>n.indexOf(i)!==-1),r={...t,...e};for(let i of o){let a=ym(t[i],e[i]);if(!a.valid)return{valid:!1,mergeErrorPath:[i,...a.mergeErrorPath]};r[i]=a.data}return{valid:!0,data:r}}if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let o=0;o<t.length;o++){let r=t[o],i=e[o],a=ym(r,i);if(!a.valid)return{valid:!1,mergeErrorPath:[o,...a.mergeErrorPath]};n.push(a.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Dv(t,e,n){let o=new Map,r;for(let c of e.issues)if(c.code==="unrecognized_keys"){r??(r=c);for(let u of c.keys)o.has(u)||o.set(u,{}),o.get(u).l=!0}else t.issues.push(c);for(let c of n.issues)if(c.code==="unrecognized_keys")for(let u of c.keys)o.has(u)||o.set(u,{}),o.get(u).r=!0;else t.issues.push(c);let i=[...o].filter(([,c])=>c.l&&c.r).map(([c])=>c);if(i.length&&r&&t.issues.push({...r,keys:i}),hr(t))return t;let a=ym(e.value,n.value);if(!a.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`);return t.value=a.data,t}var $i=h("$ZodTuple",(t,e)=>{B.init(t,e);let n=e.items;t._zod.parse=(o,r)=>{let i=o.value;if(!Array.isArray(i))return o.issues.push({input:i,inst:t,expected:"tuple",code:"invalid_type"}),o;o.value=[];let a=[],c=jv(n,"optin"),u=jv(n,"optout");if(!e.rest){if(i.length<c)return o.issues.push({code:"too_small",minimum:c,inclusive:!0,input:i,inst:t,origin:"array"}),o;i.length>n.length&&o.issues.push({code:"too_big",maximum:n.length,inclusive:!0,input:i,inst:t,origin:"array"})}let d=new Array(n.length);for(let l=0;l<n.length;l++){let p=n[l]._zod.run({value:i[l],issues:[]},r);p instanceof Promise?a.push(p.then(m=>{d[l]=m})):d[l]=p}if(e.rest){let l=n.length-1,p=i.slice(n.length);for(let m of p){l++;let f=e.rest._zod.run({value:m,issues:[]},r);f instanceof Promise?a.push(f.then(g=>Uv(g,o,l))):Uv(f,o,l)}}return a.length?Promise.all(a).then(()=>Lv(d,o,n,i,u)):Lv(d,o,n,i,u)}});function jv(t,e){for(let n=t.length-1;n>=0;n--)if(t[n]._zod[e]!=="optional")return n+1;return 0}function Uv(t,e,n){t.issues.length&&e.issues.push(...rt(n,t.issues)),e.value[n]=t.value}function Lv(t,e,n,o,r){for(let i=0;i<n.length;i++){let a=t[i],c=i<o.length;if(a.issues.length){if(!c&&i>=r){e.value.length=i;break}e.issues.push(...rt(i,a.issues))}e.value[i]=a.value}for(let i=e.value.length-1;i>=o.length&&(n[i]._zod.optout==="optional"&&e.value[i]===void 0);i--)e.value.length=i;return e}var Pc=h("$ZodRecord",(t,e)=>{B.init(t,e),t._zod.parse=(n,o)=>{let r=n.value;if(!fr(r))return n.issues.push({expected:"record",code:"invalid_type",input:r,inst:t}),n;let i=[],a=e.keyType._zod.values;if(a){n.value={};let c=new Set;for(let d of a)if(typeof d=="string"||typeof d=="number"||typeof d=="symbol"){c.add(typeof d=="number"?d.toString():d);let l=e.keyType._zod.run({value:d,issues:[]},o);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(l.issues.length){n.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(f=>Ke(f,o,Te())),input:d,path:[d],inst:t});continue}let p=l.value,m=e.valueType._zod.run({value:r[d],issues:[]},o);m instanceof Promise?i.push(m.then(f=>{f.issues.length&&n.issues.push(...rt(d,f.issues)),n.value[p]=f.value})):(m.issues.length&&n.issues.push(...rt(d,m.issues)),n.value[p]=m.value)}let u;for(let d in r)c.has(d)||(u=u??[],u.push(d));u&&u.length>0&&n.issues.push({code:"unrecognized_keys",input:r,inst:t,keys:u})}else{n.value={};for(let c of Reflect.ownKeys(r)){if(c==="__proto__"||!Object.prototype.propertyIsEnumerable.call(r,c))continue;let u=e.keyType._zod.run({value:c,issues:[]},o);if(u instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof c=="string"&&Ms.test(c)&&u.issues.length){let p=e.keyType._zod.run({value:Number(c),issues:[]},o);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");p.issues.length===0&&(u=p)}if(u.issues.length){e.mode==="loose"?n.value[c]=r[c]:n.issues.push({code:"invalid_key",origin:"record",issues:u.issues.map(p=>Ke(p,o,Te())),input:c,path:[c],inst:t});continue}let l=e.valueType._zod.run({value:r[c],issues:[]},o);l instanceof Promise?i.push(l.then(p=>{p.issues.length&&n.issues.push(...rt(c,p.issues)),n.value[u.value]=p.value})):(l.issues.length&&n.issues.push(...rt(c,l.issues)),n.value[u.value]=l.value)}}return i.length?Promise.all(i).then(()=>n):n}}),Oc=h("$ZodMap",(t,e)=>{B.init(t,e),t._zod.parse=(n,o)=>{let r=n.value;if(!(r instanceof Map))return n.issues.push({expected:"map",code:"invalid_type",input:r,inst:t}),n;let i=[];n.value=new Map;for(let[a,c]of r){let u=e.keyType._zod.run({value:a,issues:[]},o),d=e.valueType._zod.run({value:c,issues:[]},o);u instanceof Promise||d instanceof Promise?i.push(Promise.all([u,d]).then(([l,p])=>{Mv(l,p,n,a,r,t,o)})):Mv(u,d,n,a,r,t,o)}return i.length?Promise.all(i).then(()=>n):n}});function Mv(t,e,n,o,r,i,a){t.issues.length&&(mi.has(typeof o)?n.issues.push(...rt(o,t.issues)):n.issues.push({code:"invalid_key",origin:"map",input:r,inst:i,issues:t.issues.map(c=>Ke(c,a,Te()))})),e.issues.length&&(mi.has(typeof o)?n.issues.push(...rt(o,e.issues)):n.issues.push({origin:"map",code:"invalid_element",input:r,inst:i,key:o,issues:e.issues.map(c=>Ke(c,a,Te()))})),n.value.set(t.value,e.value)}var Rc=h("$ZodSet",(t,e)=>{B.init(t,e),t._zod.parse=(n,o)=>{let r=n.value;if(!(r instanceof Set))return n.issues.push({input:r,inst:t,expected:"set",code:"invalid_type"}),n;let i=[];n.value=new Set;for(let a of r){let c=e.valueType._zod.run({value:a,issues:[]},o);c instanceof Promise?i.push(c.then(u=>Zv(u,n))):Zv(c,n)}return i.length?Promise.all(i).then(()=>n):n}});function Zv(t,e){t.issues.length&&e.issues.push(...t.issues),e.value.add(t.value)}var Ac=h("$ZodEnum",(t,e)=>{B.init(t,e);let n=di(e.entries),o=new Set(n);t._zod.values=o,t._zod.pattern=new RegExp(`^(${n.filter(r=>mi.has(typeof r)).map(r=>typeof r=="string"?gt(r):r.toString()).join("|")})$`),t._zod.parse=(r,i)=>{let a=r.value;return o.has(a)||r.issues.push({code:"invalid_value",values:n,input:a,inst:t}),r}}),Cc=h("$ZodLiteral",(t,e)=>{if(B.init(t,e),e.values.length===0)throw new Error("Cannot create literal schema with no valid values");let n=new Set(e.values);t._zod.values=n,t._zod.pattern=new RegExp(`^(${e.values.map(o=>typeof o=="string"?gt(o):o?gt(o.toString()):String(o)).join("|")})$`),t._zod.parse=(o,r)=>{let i=o.value;return n.has(i)||o.issues.push({code:"invalid_value",values:e.values,input:i,inst:t}),o}}),Nc=h("$ZodFile",(t,e)=>{B.init(t,e),t._zod.parse=(n,o)=>{let r=n.value;return r instanceof File||n.issues.push({expected:"file",code:"invalid_type",input:r,inst:t}),n}}),zc=h("$ZodTransform",(t,e)=>{B.init(t,e),t._zod.optin="optional",t._zod.parse=(n,o)=>{if(o.direction==="backward")throw new dr(t.constructor.name);let r=e.transform(n.value,n);if(o.async)return(r instanceof Promise?r:Promise.resolve(r)).then(a=>(n.value=a,n.fallback=!0,n));if(r instanceof Promise)throw new wt;return n.value=r,n.fallback=!0,n}});function Fv(t,e){return e===void 0&&(t.issues.length||t.fallback)?{issues:[],value:void 0}:t}var Ii=h("$ZodOptional",(t,e)=>{B.init(t,e),t._zod.optin="optional",t._zod.optout="optional",W(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),W(t._zod,"pattern",()=>{let n=e.innerType._zod.pattern;return n?new RegExp(`^(${pi(n.source)})?$`):void 0}),t._zod.parse=(n,o)=>{if(e.innerType._zod.optin==="optional"){let r=n.value,i=e.innerType._zod.run(n,o);return i instanceof Promise?i.then(a=>Fv(a,r)):Fv(i,r)}return n.value===void 0?n:e.innerType._zod.run(n,o)}}),Dc=h("$ZodExactOptional",(t,e)=>{Ii.init(t,e),W(t._zod,"values",()=>e.innerType._zod.values),W(t._zod,"pattern",()=>e.innerType._zod.pattern),t._zod.parse=(n,o)=>e.innerType._zod.run(n,o)}),jc=h("$ZodNullable",(t,e)=>{B.init(t,e),W(t._zod,"optin",()=>e.innerType._zod.optin),W(t._zod,"optout",()=>e.innerType._zod.optout),W(t._zod,"pattern",()=>{let n=e.innerType._zod.pattern;return n?new RegExp(`^(${pi(n.source)}|null)$`):void 0}),W(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),t._zod.parse=(n,o)=>n.value===null?n:e.innerType._zod.run(n,o)}),Uc=h("$ZodDefault",(t,e)=>{B.init(t,e),t._zod.optin="optional",W(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(n,o)=>{if(o.direction==="backward")return e.innerType._zod.run(n,o);if(n.value===void 0)return n.value=e.defaultValue,n;let r=e.innerType._zod.run(n,o);return r instanceof Promise?r.then(i=>Vv(i,e)):Vv(r,e)}});function Vv(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}var Lc=h("$ZodPrefault",(t,e)=>{B.init(t,e),t._zod.optin="optional",W(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(n,o)=>(o.direction==="backward"||n.value===void 0&&(n.value=e.defaultValue),e.innerType._zod.run(n,o))}),Mc=h("$ZodNonOptional",(t,e)=>{B.init(t,e),W(t._zod,"values",()=>{let n=e.innerType._zod.values;return n?new Set([...n].filter(o=>o!==void 0)):void 0}),t._zod.parse=(n,o)=>{let r=e.innerType._zod.run(n,o);return r instanceof Promise?r.then(i=>qv(i,t)):qv(r,t)}});function qv(t,e){return!t.issues.length&&t.value===void 0&&t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:e}),t}var Zc=h("$ZodSuccess",(t,e)=>{B.init(t,e),t._zod.parse=(n,o)=>{if(o.direction==="backward")throw new dr("ZodSuccess");let r=e.innerType._zod.run(n,o);return r instanceof Promise?r.then(i=>(n.value=i.issues.length===0,n)):(n.value=r.issues.length===0,n)}}),Fc=h("$ZodCatch",(t,e)=>{B.init(t,e),t._zod.optin="optional",W(t._zod,"optout",()=>e.innerType._zod.optout),W(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(n,o)=>{if(o.direction==="backward")return e.innerType._zod.run(n,o);let r=e.innerType._zod.run(n,o);return r instanceof Promise?r.then(i=>(n.value=i.value,i.issues.length&&(n.value=e.catchValue({...n,error:{issues:i.issues.map(a=>Ke(a,o,Te()))},input:n.value}),n.issues=[],n.fallback=!0),n)):(n.value=r.value,r.issues.length&&(n.value=e.catchValue({...n,error:{issues:r.issues.map(i=>Ke(i,o,Te()))},input:n.value}),n.issues=[],n.fallback=!0),n)}}),Vc=h("$ZodNaN",(t,e)=>{B.init(t,e),t._zod.parse=(n,o)=>((typeof n.value!="number"||!Number.isNaN(n.value))&&n.issues.push({input:n.value,inst:t,expected:"nan",code:"invalid_type"}),n)}),wi=h("$ZodPipe",(t,e)=>{B.init(t,e),W(t._zod,"values",()=>e.in._zod.values),W(t._zod,"optin",()=>e.in._zod.optin),W(t._zod,"optout",()=>e.out._zod.optout),W(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(n,o)=>{if(o.direction==="backward"){let i=e.out._zod.run(n,o);return i instanceof Promise?i.then(a=>Vs(a,e.in,o)):Vs(i,e.in,o)}let r=e.in._zod.run(n,o);return r instanceof Promise?r.then(i=>Vs(i,e.out,o)):Vs(r,e.out,o)}});function Vs(t,e,n){return t.issues.length?(t.aborted=!0,t):e._zod.run({value:t.value,issues:t.issues,fallback:t.fallback},n)}var Rn=h("$ZodCodec",(t,e)=>{B.init(t,e),W(t._zod,"values",()=>e.in._zod.values),W(t._zod,"optin",()=>e.in._zod.optin),W(t._zod,"optout",()=>e.out._zod.optout),W(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(n,o)=>{if((o.direction||"forward")==="forward"){let i=e.in._zod.run(n,o);return i instanceof Promise?i.then(a=>qs(a,e,o)):qs(i,e,o)}else{let i=e.out._zod.run(n,o);return i instanceof Promise?i.then(a=>qs(a,e,o)):qs(i,e,o)}}});function qs(t,e,n){if(t.issues.length)return t.aborted=!0,t;if((n.direction||"forward")==="forward"){let r=e.transform(t.value,t);return r instanceof Promise?r.then(i=>Bs(t,i,e.out,n)):Bs(t,r,e.out,n)}else{let r=e.reverseTransform(t.value,t);return r instanceof Promise?r.then(i=>Bs(t,i,e.in,n)):Bs(t,r,e.in,n)}}function Bs(t,e,n,o){return t.issues.length?(t.aborted=!0,t):n._zod.run({value:e,issues:t.issues},o)}var Im=h("$ZodPreprocess",(t,e)=>{wi.init(t,e)}),qc=h("$ZodReadonly",(t,e)=>{B.init(t,e),W(t._zod,"propValues",()=>e.innerType._zod.propValues),W(t._zod,"values",()=>e.innerType._zod.values),W(t._zod,"optin",()=>e.innerType?._zod?.optin),W(t._zod,"optout",()=>e.innerType?._zod?.optout),t._zod.parse=(n,o)=>{if(o.direction==="backward")return e.innerType._zod.run(n,o);let r=e.innerType._zod.run(n,o);return r instanceof Promise?r.then(Bv):Bv(r)}});function Bv(t){return t.value=Object.freeze(t.value),t}var Bc=h("$ZodTemplateLiteral",(t,e)=>{B.init(t,e);let n=[];for(let o of e.parts)if(typeof o=="object"&&o!==null){if(!o._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...o._zod.traits].shift()}`);let r=o._zod.pattern instanceof RegExp?o._zod.pattern.source:o._zod.pattern;if(!r)throw new Error(`Invalid template literal part: ${o._zod.traits}`);let i=r.startsWith("^")?1:0,a=r.endsWith("$")?r.length-1:r.length;n.push(r.slice(i,a))}else if(o===null||_p.has(typeof o))n.push(gt(`${o}`));else throw new Error(`Invalid template literal part: ${o}`);t._zod.pattern=new RegExp(`^${n.join("")}$`),t._zod.parse=(o,r)=>typeof o.value!="string"?(o.issues.push({input:o.value,inst:t,expected:"string",code:"invalid_type"}),o):(t._zod.pattern.lastIndex=0,t._zod.pattern.test(o.value)||o.issues.push({input:o.value,inst:t,code:"invalid_format",format:e.format??"template_literal",pattern:t._zod.pattern.source}),o)}),Hc=h("$ZodFunction",(t,e)=>(B.init(t,e),t._def=e,t._zod.def=e,t.implement=n=>{if(typeof n!="function")throw new Error("implement() must be called with a function");return function(...o){let r=t._def.input?Br(t._def.input,o):o,i=Reflect.apply(n,this,r);return t._def.output?Br(t._def.output,i):i}},t.implementAsync=n=>{if(typeof n!="function")throw new Error("implementAsync() must be called with a function");return async function(...o){let r=t._def.input?await Hr(t._def.input,o):o,i=await Reflect.apply(n,this,r);return t._def.output?await Hr(t._def.output,i):i}},t._zod.parse=(n,o)=>typeof n.value!="function"?(n.issues.push({code:"invalid_type",expected:"function",input:n.value,inst:t}),n):(t._def.output&&t._def.output._zod.def.type==="promise"?n.value=t.implementAsync(n.value):n.value=t.implement(n.value),n),t.input=(...n)=>{let o=t.constructor;return Array.isArray(n[0])?new o({type:"function",input:new $i({type:"tuple",items:n[0],rest:n[1]}),output:t._def.output}):new o({type:"function",input:n[0],output:t._def.output})},t.output=n=>{let o=t.constructor;return new o({type:"function",input:t._def.input,output:n})},t)),Kc=h("$ZodPromise",(t,e)=>{B.init(t,e),t._zod.parse=(n,o)=>Promise.resolve(n.value).then(r=>e.innerType._zod.run({value:r,issues:[]},o))}),Gc=h("$ZodLazy",(t,e)=>{B.init(t,e),W(t._zod,"innerType",()=>{let n=e;return n._cachedInner||(n._cachedInner=e.getter()),n._cachedInner}),W(t._zod,"pattern",()=>t._zod.innerType?._zod?.pattern),W(t._zod,"propValues",()=>t._zod.innerType?._zod?.propValues),W(t._zod,"optin",()=>t._zod.innerType?._zod?.optin??void 0),W(t._zod,"optout",()=>t._zod.innerType?._zod?.optout??void 0),t._zod.parse=(n,o)=>t._zod.innerType._zod.run(n,o)}),Wc=h("$ZodCustom",(t,e)=>{fe.init(t,e),B.init(t,e),t._zod.parse=(n,o)=>n,t._zod.check=n=>{let o=n.value,r=e.fn(o);if(r instanceof Promise)return r.then(i=>Hv(i,n,o,t));Hv(r,n,o,t)}});function Hv(t,e,n,o){if(!t){let r={code:"custom",input:n,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(r.params=o._zod.def.params),e.issues.push(Sn(r))}}var Cn={};Jt(Cn,{ar:()=>Yv,az:()=>Xv,be:()=>eb,bg:()=>tb,ca:()=>rb,cs:()=>nb,da:()=>ob,de:()=>ib,el:()=>ab,en:()=>Jc,eo:()=>sb,es:()=>cb,fa:()=>ub,fi:()=>lb,fr:()=>db,frCA:()=>pb,he:()=>mb,hr:()=>fb,hu:()=>hb,hy:()=>_b,id:()=>yb,is:()=>vb,it:()=>bb,ja:()=>kb,ka:()=>xb,kh:()=>Sb,km:()=>Yc,ko:()=>$b,lt:()=>wb,mk:()=>Eb,ms:()=>Tb,nl:()=>Pb,no:()=>Ob,ota:()=>Rb,pl:()=>Cb,ps:()=>Ab,pt:()=>Nb,ro:()=>zb,ru:()=>jb,sl:()=>Ub,sv:()=>Lb,ta:()=>Mb,th:()=>Zb,tr:()=>Fb,ua:()=>Vb,uk:()=>Xc,ur:()=>qb,uz:()=>Bb,vi:()=>Hb,yo:()=>Wb,zhCN:()=>Kb,zhTW:()=>Gb});var jP=()=>{let t={string:{unit:"\u062D\u0631\u0641",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},file:{unit:"\u0628\u0627\u064A\u062A",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},array:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},set:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"}};function e(r){return t[r]??null}let n={regex:"\u0645\u062F\u062E\u0644",email:"\u0628\u0631\u064A\u062F \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",url:"\u0631\u0627\u0628\u0637",emoji:"\u0625\u064A\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u064A\u062E \u0648\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",date:"\u062A\u0627\u0631\u064A\u062E \u0628\u0645\u0639\u064A\u0627\u0631 ISO",time:"\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",duration:"\u0645\u062F\u0629 \u0628\u0645\u0639\u064A\u0627\u0631 ISO",ipv4:"\u0639\u0646\u0648\u0627\u0646 IPv4",ipv6:"\u0639\u0646\u0648\u0627\u0646 IPv6",cidrv4:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv4",cidrv6:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv6",base64:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64-encoded",base64url:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64url-encoded",json_string:"\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",e164:"\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"},o={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=x(r.input),c=o[a]??a;return/^[A-Z]/.test(r.expected)?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 instanceof ${r.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${c}`:`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${i}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${c}`}case"invalid_value":return r.values.length===1?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${k(r.values[0])}`:`\u0627\u062E\u062A\u064A\u0627\u0631 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062A\u0648\u0642\u0639 \u0627\u0646\u062A\u0642\u0627\u0621 \u0623\u062D\u062F \u0647\u0630\u0647 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A: ${_(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=e(r.origin);return a?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${r.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${i} ${r.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631"}`:`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${r.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${i} ${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=e(r.origin);return a?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${r.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${i} ${r.minimum.toString()} ${a.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${r.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${i} ${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${r.prefix}"`:i.format==="ends_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0646\u062A\u0647\u064A \u0628\u0640 "${i.suffix}"`:i.format==="includes"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0636\u0645\u0651\u064E\u0646 "${i.includes}"`:i.format==="regex"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0637\u0627\u0628\u0642 \u0627\u0644\u0646\u0645\u0637 ${i.pattern}`:`${n[i.format]??r.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`}case"not_multiple_of":return`\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${r.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${r.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${r.keys.length>1?"\u0629":""}: ${_(r.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${r.origin}`;case"invalid_union":return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644";case"invalid_element":return`\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${r.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}};function Yv(){return{localeError:jP()}}var UP=()=>{let t={string:{unit:"simvol",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"element",verb:"olmal\u0131d\u0131r"},set:{unit:"element",verb:"olmal\u0131d\u0131r"}};function e(r){return t[r]??null}let n={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"},o={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=x(r.input),c=o[a]??a;return/^[A-Z]/.test(r.expected)?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n instanceof ${r.expected}, daxil olan ${c}`:`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${i}, daxil olan ${c}`}case"invalid_value":return r.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${k(r.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${_(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=e(r.origin);return a?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${r.origin??"d\u0259y\u0259r"} ${i}${r.maximum.toString()} ${a.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${r.origin??"d\u0259y\u0259r"} ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=e(r.origin);return a?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${r.origin} ${i}${r.minimum.toString()} ${a.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${r.origin} ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${i.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:i.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${i.suffix}" il\u0259 bitm\u0259lidir`:i.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${i.includes}" daxil olmal\u0131d\u0131r`:i.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${i.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${n[i.format]??r.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${r.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${r.keys.length>1?"lar":""}: ${_(r.keys,", ")}`;case"invalid_key":return`${r.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${r.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}};function Xv(){return{localeError:UP()}}function Qv(t,e,n,o){let r=Math.abs(t),i=r%10,a=r%100;return a>=11&&a<=19?o:i===1?e:i>=2&&i<=4?n:o}var LP=()=>{let t={string:{unit:{one:"\u0441\u0456\u043C\u0432\u0430\u043B",few:"\u0441\u0456\u043C\u0432\u0430\u043B\u044B",many:"\u0441\u0456\u043C\u0432\u0430\u043B\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u044B",many:"\u0431\u0430\u0439\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"}};function e(r){return t[r]??null}let n={regex:"\u0443\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0430\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0456 \u0447\u0430\u0441",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0447\u0430\u0441",duration:"ISO \u043F\u0440\u0430\u0446\u044F\u0433\u043B\u0430\u0441\u0446\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0430\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0430\u0441",cidrv4:"IPv4 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",base64:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64",base64url:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64url",json_string:"JSON \u0440\u0430\u0434\u043E\u043A",e164:"\u043D\u0443\u043C\u0430\u0440 E.164",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"},o={nan:"NaN",number:"\u043B\u0456\u043A",array:"\u043C\u0430\u0441\u0456\u045E"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=x(r.input),c=o[a]??a;return/^[A-Z]/.test(r.expected)?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F instanceof ${r.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${c}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${i}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${c}`}case"invalid_value":return r.values.length===1?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${k(r.values[0])}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0432\u0430\u0440\u044B\u044F\u043D\u0442: \u0447\u0430\u043A\u0430\u045E\u0441\u044F \u0430\u0434\u0437\u0456\u043D \u0437 ${_(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=e(r.origin);if(a){let c=Number(r.maximum),u=Qv(c,a.unit.one,a.unit.few,a.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${a.verb} ${i}${r.maximum.toString()} ${u}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=e(r.origin);if(a){let c=Number(r.minimum),u=Qv(c,a.unit.one,a.unit.few,a.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${r.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${a.verb} ${i}${r.minimum.toString()} ${u}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${r.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u043F\u0430\u0447\u044B\u043D\u0430\u0446\u0446\u0430 \u0437 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u0430\u043A\u0430\u043D\u0447\u0432\u0430\u0446\u0446\u0430 \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u043C\u044F\u0448\u0447\u0430\u0446\u044C "${i.includes}"`:i.format==="regex"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0430\u0434\u043F\u0430\u0432\u044F\u0434\u0430\u0446\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${n[i.format]??r.format}`}case"not_multiple_of":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${r.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${r.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${_(r.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${r.origin}`;case"invalid_union":return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434";case"invalid_element":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u0430\u0435 \u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435 \u045E ${r.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}};function eb(){return{localeError:LP()}}var MP=()=>{let t={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},file:{unit:"\u0431\u0430\u0439\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"}};function e(r){return t[r]??null}let n={regex:"\u0432\u0445\u043E\u0434",email:"\u0438\u043C\u0435\u0439\u043B \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0436\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u043F\u0440\u043E\u0434\u044A\u043B\u0436\u0438\u0442\u0435\u043B\u043D\u043E\u0441\u0442",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"base64-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",base64url:"base64url-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",json_string:"JSON \u043D\u0438\u0437",e164:"E.164 \u043D\u043E\u043C\u0435\u0440",jwt:"JWT",template_literal:"\u0432\u0445\u043E\u0434"},o={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=x(r.input),c=o[a]??a;return/^[A-Z]/.test(r.expected)?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D instanceof ${r.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${c}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${i}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${c}`}case"invalid_value":return r.values.length===1?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${k(r.values[0])}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u043E\u043F\u0446\u0438\u044F: \u043E\u0447\u0430\u043A\u0432\u0430\u043D\u043E \u0435\u0434\u043D\u043E \u043E\u0442 ${_(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=e(r.origin);return a?`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${r.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${i}${r.maximum.toString()} ${a.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430"}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${r.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0431\u044A\u0434\u0435 ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=e(r.origin);return a?`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${r.origin} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${i}${r.minimum.toString()} ${a.unit}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${r.origin} \u0434\u0430 \u0431\u044A\u0434\u0435 ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u0432\u0430 \u0441 "${i.prefix}"`;if(i.format==="ends_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u0432\u044A\u0440\u0448\u0432\u0430 \u0441 "${i.suffix}"`;if(i.format==="includes")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0432\u043A\u043B\u044E\u0447\u0432\u0430 "${i.includes}"`;if(i.format==="regex")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0441\u044A\u0432\u043F\u0430\u0434\u0430 \u0441 ${i.pattern}`;let a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D";return i.format==="emoji"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),i.format==="datetime"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),i.format==="date"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),i.format==="time"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),i.format==="duration"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),`${a} ${n[i.format]??r.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E \u0447\u0438\u0441\u043B\u043E: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0431\u044A\u0434\u0435 \u043A\u0440\u0430\u0442\u043D\u043E \u043D\u0430 ${r.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0437\u043F\u043E\u0437\u043D\u0430\u0442${r.keys.length>1?"\u0438":""} \u043A\u043B\u044E\u0447${r.keys.length>1?"\u043E\u0432\u0435":""}: ${_(r.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043A\u043B\u044E\u0447 \u0432 ${r.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434";case"invalid_element":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442 \u0432 ${r.origin}`;default:return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434"}}};function tb(){return{localeError:MP()}}var ZP=()=>{let t={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function e(r){return t[r]??null}let n={regex:"entrada",email:"adre\xE7a electr\xF2nica",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\xE7a IPv4",ipv6:"adre\xE7a IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},o={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=x(r.input),c=o[a]??a;return/^[A-Z]/.test(r.expected)?`Tipus inv\xE0lid: s'esperava instanceof ${r.expected}, s'ha rebut ${c}`:`Tipus inv\xE0lid: s'esperava ${i}, s'ha rebut ${c}`}case"invalid_value":return r.values.length===1?`Valor inv\xE0lid: s'esperava ${k(r.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${_(r.values," o ")}`;case"too_big":{let i=r.inclusive?"com a m\xE0xim":"menys de",a=e(r.origin);return a?`Massa gran: s'esperava que ${r.origin??"el valor"} contingu\xE9s ${i} ${r.maximum.toString()} ${a.unit??"elements"}`:`Massa gran: s'esperava que ${r.origin??"el valor"} fos ${i} ${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?"com a m\xEDnim":"m\xE9s de",a=e(r.origin);return a?`Massa petit: s'esperava que ${r.origin} contingu\xE9s ${i} ${r.minimum.toString()} ${a.unit}`:`Massa petit: s'esperava que ${r.origin} fos ${i} ${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${i.prefix}"`:i.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${i.suffix}"`:i.format==="includes"?`Format inv\xE0lid: ha d'incloure "${i.includes}"`:i.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${i.pattern}`:`Format inv\xE0lid per a ${n[i.format]??r.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${r.divisor}`;case"unrecognized_keys":return`Clau${r.keys.length>1?"s":""} no reconeguda${r.keys.length>1?"s":""}: ${_(r.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${r.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${r.origin}`;default:return"Entrada inv\xE0lida"}}};function rb(){return{localeError:ZP()}}var FP=()=>{let t={string:{unit:"znak\u016F",verb:"m\xEDt"},file:{unit:"bajt\u016F",verb:"m\xEDt"},array:{unit:"prvk\u016F",verb:"m\xEDt"},set:{unit:"prvk\u016F",verb:"m\xEDt"}};function e(r){return t[r]??null}let n={regex:"regul\xE1rn\xED v\xFDraz",email:"e-mailov\xE1 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 \u010Das ve form\xE1tu ISO",date:"datum ve form\xE1tu ISO",time:"\u010Das ve form\xE1tu ISO",duration:"doba trv\xE1n\xED ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64",base64url:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64url",json_string:"\u0159et\u011Bzec ve form\xE1tu JSON",e164:"\u010D\xEDslo E.164",jwt:"JWT",template_literal:"vstup"},o={nan:"NaN",number:"\u010D\xEDslo",string:"\u0159et\u011Bzec",function:"funkce",array:"pole"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=x(r.input),c=o[a]??a;return/^[A-Z]/.test(r.expected)?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no instanceof ${r.expected}, obdr\u017Eeno ${c}`:`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${i}, obdr\u017Eeno ${c}`}case"invalid_value":return r.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${k(r.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${_(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=e(r.origin);return a?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${r.origin??"hodnota"} mus\xED m\xEDt ${i}${r.maximum.toString()} ${a.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${r.origin??"hodnota"} mus\xED b\xFDt ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=e(r.origin);return a?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${r.origin??"hodnota"} mus\xED m\xEDt ${i}${r.minimum.toString()} ${a.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${r.origin??"hodnota"} mus\xED b\xFDt ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${i.prefix}"`:i.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${i.suffix}"`:i.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${i.includes}"`:i.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${i.pattern}`:`Neplatn\xFD form\xE1t ${n[i.format]??r.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${r.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${_(r.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${r.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${r.origin}`;default:return"Neplatn\xFD vstup"}}};function nb(){return{localeError:FP()}}var VP=()=>{let t={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function e(r){return t[r]??null}let n={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\xE6t",date:"ISO-dato",time:"ISO-klokkesl\xE6t",duration:"ISO-varighed",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",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"},o={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"s\xE6t",file:"fil"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=x(r.input),c=o[a]??a;return/^[A-Z]/.test(r.expected)?`Ugyldigt input: forventede instanceof ${r.expected}, fik ${c}`:`Ugyldigt input: forventede ${i}, fik ${c}`}case"invalid_value":return r.values.length===1?`Ugyldig v\xE6rdi: forventede ${k(r.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${_(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=e(r.origin),c=o[r.origin]??r.origin;return a?`For stor: forventede ${c??"value"} ${a.verb} ${i} ${r.maximum.toString()} ${a.unit??"elementer"}`:`For stor: forventede ${c??"value"} havde ${i} ${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=e(r.origin),c=o[r.origin]??r.origin;return a?`For lille: forventede ${c} ${a.verb} ${i} ${r.minimum.toString()} ${a.unit}`:`For lille: forventede ${c} havde ${i} ${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Ugyldig streng: skal starte med "${i.prefix}"`:i.format==="ends_with"?`Ugyldig streng: skal ende med "${i.suffix}"`:i.format==="includes"?`Ugyldig streng: skal indeholde "${i.includes}"`:i.format==="regex"?`Ugyldig streng: skal matche m\xF8nsteret ${i.pattern}`:`Ugyldig ${n[i.format]??r.format}`}case"not_multiple_of":return`Ugyldigt tal: skal v\xE6re deleligt med ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Ukendte n\xF8gler":"Ukendt n\xF8gle"}: ${_(r.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8gle i ${r.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig v\xE6rdi i ${r.origin}`;default:return"Ugyldigt input"}}};function ob(){return{localeError:VP()}}var qP=()=>{let t={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 e(r){return t[r]??null}let n={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"},o={nan:"NaN",number:"Zahl",array:"Array"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=x(r.input),c=o[a]??a;return/^[A-Z]/.test(r.expected)?`Ung\xFCltige Eingabe: erwartet instanceof ${r.expected}, erhalten ${c}`:`Ung\xFCltige Eingabe: erwartet ${i}, erhalten ${c}`}case"invalid_value":return r.values.length===1?`Ung\xFCltige Eingabe: erwartet ${k(r.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${_(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=e(r.origin);return a?`Zu gro\xDF: erwartet, dass ${r.origin??"Wert"} ${i}${r.maximum.toString()} ${a.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${r.origin??"Wert"} ${i}${r.maximum.toString()} ist`}case"too_small":{let i=r.inclusive?">=":">",a=e(r.origin);return a?`Zu klein: erwartet, dass ${r.origin} ${i}${r.minimum.toString()} ${a.unit} hat`:`Zu klein: erwartet, dass ${r.origin} ${i}${r.minimum.toString()} ist`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Ung\xFCltiger String: muss mit "${i.prefix}" beginnen`:i.format==="ends_with"?`Ung\xFCltiger String: muss mit "${i.suffix}" enden`:i.format==="includes"?`Ung\xFCltiger String: muss "${i.includes}" enthalten`:i.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${i.pattern} entsprechen`:`Ung\xFCltig: ${n[i.format]??r.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${r.divisor} sein`;case"unrecognized_keys":return`${r.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${_(r.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${r.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${r.origin}`;default:return"Ung\xFCltige Eingabe"}}};function ib(){return{localeError:qP()}}var BP=()=>{let t={string:{unit:"\u03C7\u03B1\u03C1\u03B1\u03BA\u03C4\u03AE\u03C1\u03B5\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},file:{unit:"bytes",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},array:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},set:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},map:{unit:"\u03BA\u03B1\u03C4\u03B1\u03C7\u03C9\u03C1\u03AE\u03C3\u03B5\u03B9\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"}};function e(r){return t[r]??null}let n={regex:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2",email:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 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 \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1 \u03BA\u03B1\u03B9 \u03CE\u03C1\u03B1",date:"ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1",time:"ISO \u03CE\u03C1\u03B1",duration:"ISO \u03B4\u03B9\u03AC\u03C1\u03BA\u03B5\u03B9\u03B1",ipv4:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv4",ipv6:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv6",mac:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 MAC",cidrv4:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv4",cidrv6:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv6",base64:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64",base64url:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64url",json_string:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC JSON",e164:"\u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2 E.164",jwt:"JWT",template_literal:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"},o={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=x(r.input),c=o[a]??a;return typeof r.expected=="string"&&/^[A-Z]/.test(r.expected)?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD instanceof ${r.expected}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${c}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${i}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${c}`}case"invalid_value":return r.values.length===1?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${k(r.values[0])}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03C0\u03B9\u03BB\u03BF\u03B3\u03AE: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD \u03AD\u03BD\u03B1 \u03B1\u03C0\u03CC ${_(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=e(r.origin);return a?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${r.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${i}${r.maximum.toString()} ${a.unit??"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1"}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${r.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=e(r.origin);return a?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${r.origin} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${i}${r.minimum.toString()} ${a.unit}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${r.origin} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03BE\u03B5\u03BA\u03B9\u03BD\u03AC \u03BC\u03B5 "${i.prefix}"`:i.format==="ends_with"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B5\u03BB\u03B5\u03B9\u03CE\u03BD\u03B5\u03B9 \u03BC\u03B5 "${i.suffix}"`:i.format==="includes"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C0\u03B5\u03C1\u03B9\u03AD\u03C7\u03B5\u03B9 "${i.includes}"`:i.format==="regex"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B1\u03B9\u03C1\u03B9\u03AC\u03B6\u03B5\u03B9 \u03BC\u03B5 \u03C4\u03BF \u03BC\u03BF\u03C4\u03AF\u03B2\u03BF ${i.pattern}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF: ${n[i.format]??r.format}`}case"not_multiple_of":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF\u03C2 \u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 \u03C0\u03BF\u03BB\u03BB\u03B1\u03C0\u03BB\u03AC\u03C3\u03B9\u03BF \u03C4\u03BF\u03C5 ${r.divisor}`;case"unrecognized_keys":return`\u0386\u03B3\u03BD\u03C9\u03C3\u03C4${r.keys.length>1?"\u03B1":"\u03BF"} \u03BA\u03BB\u03B5\u03B9\u03B4${r.keys.length>1?"\u03B9\u03AC":"\u03AF"}: ${_(r.keys,", ")}`;case"invalid_key":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF \u03BA\u03BB\u03B5\u03B9\u03B4\u03AF \u03C3\u03C4\u03BF ${r.origin}`;case"invalid_union":return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2";case"invalid_element":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C4\u03B9\u03BC\u03AE \u03C3\u03C4\u03BF ${r.origin}`;default:return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"}}};function ab(){return{localeError:BP()}}var HP=()=>{let t={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function e(r){return t[r]??null}let n={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=x(r.input),c=o[a]??a;return`Invalid input: expected ${i}, received ${c}`}case"invalid_value":return r.values.length===1?`Invalid input: expected ${k(r.values[0])}`:`Invalid option: expected one of ${_(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=e(r.origin);return a?`Too big: expected ${r.origin??"value"} to have ${i}${r.maximum.toString()} ${a.unit??"elements"}`:`Too big: expected ${r.origin??"value"} to be ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=e(r.origin);return a?`Too small: expected ${r.origin} to have ${i}${r.minimum.toString()} ${a.unit}`:`Too small: expected ${r.origin} to be ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Invalid string: must start with "${i.prefix}"`:i.format==="ends_with"?`Invalid string: must end with "${i.suffix}"`:i.format==="includes"?`Invalid string: must include "${i.includes}"`:i.format==="regex"?`Invalid string: must match pattern ${i.pattern}`:`Invalid ${n[i.format]??r.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${r.divisor}`;case"unrecognized_keys":return`Unrecognized key${r.keys.length>1?"s":""}: ${_(r.keys,", ")}`;case"invalid_key":return`Invalid key in ${r.origin}`;case"invalid_union":return r.options&&Array.isArray(r.options)&&r.options.length>0?`Invalid discriminator value. Expected ${r.options.map(a=>`'${a}'`).join(" | ")}`:"Invalid input";case"invalid_element":return`Invalid value in ${r.origin}`;default:return"Invalid input"}}};function Jc(){return{localeError:HP()}}var KP=()=>{let t={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function e(r){return t[r]??null}let n={regex:"enigo",email:"retadreso",url:"URL",emoji:"emo\u011Dio",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\u016Dro",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"},o={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=x(r.input),c=o[a]??a;return/^[A-Z]/.test(r.expected)?`Nevalida enigo: atendi\u011Dis instanceof ${r.expected}, ricevi\u011Dis ${c}`:`Nevalida enigo: atendi\u011Dis ${i}, ricevi\u011Dis ${c}`}case"invalid_value":return r.values.length===1?`Nevalida enigo: atendi\u011Dis ${k(r.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${_(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=e(r.origin);return a?`Tro granda: atendi\u011Dis ke ${r.origin??"valoro"} havu ${i}${r.maximum.toString()} ${a.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${r.origin??"valoro"} havu ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=e(r.origin);return a?`Tro malgranda: atendi\u011Dis ke ${r.origin} havu ${i}${r.minimum.toString()} ${a.unit}`:`Tro malgranda: atendi\u011Dis ke ${r.origin} estu ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${i.prefix}"`:i.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${i.suffix}"`:i.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${i.includes}"`:i.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${i.pattern}`:`Nevalida ${n[i.format]??r.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${r.divisor}`;case"unrecognized_keys":return`Nekonata${r.keys.length>1?"j":""} \u015Dlosilo${r.keys.length>1?"j":""}: ${_(r.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${r.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${r.origin}`;default:return"Nevalida enigo"}}};function sb(){return{localeError:KP()}}var GP=()=>{let t={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function e(r){return t[r]??null}let n={regex:"entrada",email:"direcci\xF3n de correo electr\xF3nico",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\xF3n ISO",ipv4:"direcci\xF3n IPv4",ipv6:"direcci\xF3n IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},o={nan:"NaN",string:"texto",number:"n\xFAmero",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"n\xFAmero grande",symbol:"s\xEDmbolo",undefined:"indefinido",null:"nulo",function:"funci\xF3n",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeraci\xF3n",union:"uni\xF3n",literal:"literal",promise:"promesa",void:"vac\xEDo",never:"nunca",unknown:"desconocido",any:"cualquiera"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=x(r.input),c=o[a]??a;return/^[A-Z]/.test(r.expected)?`Entrada inv\xE1lida: se esperaba instanceof ${r.expected}, recibido ${c}`:`Entrada inv\xE1lida: se esperaba ${i}, recibido ${c}`}case"invalid_value":return r.values.length===1?`Entrada inv\xE1lida: se esperaba ${k(r.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${_(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=e(r.origin),c=o[r.origin]??r.origin;return a?`Demasiado grande: se esperaba que ${c??"valor"} tuviera ${i}${r.maximum.toString()} ${a.unit??"elementos"}`:`Demasiado grande: se esperaba que ${c??"valor"} fuera ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=e(r.origin),c=o[r.origin]??r.origin;return a?`Demasiado peque\xF1o: se esperaba que ${c} tuviera ${i}${r.minimum.toString()} ${a.unit}`:`Demasiado peque\xF1o: se esperaba que ${c} fuera ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${i.prefix}"`:i.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${i.suffix}"`:i.format==="includes"?`Cadena inv\xE1lida: debe incluir "${i.includes}"`:i.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${i.pattern}`:`Inv\xE1lido ${n[i.format]??r.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${r.divisor}`;case"unrecognized_keys":return`Llave${r.keys.length>1?"s":""} desconocida${r.keys.length>1?"s":""}: ${_(r.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${o[r.origin]??r.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${o[r.origin]??r.origin}`;default:return"Entrada inv\xE1lida"}}};function cb(){return{localeError:GP()}}var WP=()=>{let t={string:{unit:"\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},array:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},set:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"}};function e(r){return t[r]??null}let n={regex:"\u0648\u0631\u0648\u062F\u06CC",email:"\u0622\u062F\u0631\u0633 \u0627\u06CC\u0645\u06CC\u0644",url:"URL",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u06CC\u062E \u0648 \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",date:"\u062A\u0627\u0631\u06CC\u062E \u0627\u06CC\u0632\u0648",time:"\u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",duration:"\u0645\u062F\u062A \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",ipv4:"IPv4 \u0622\u062F\u0631\u0633",ipv6:"IPv6 \u0622\u062F\u0631\u0633",cidrv4:"IPv4 \u062F\u0627\u0645\u0646\u0647",cidrv6:"IPv6 \u062F\u0627\u0645\u0646\u0647",base64:"base64-encoded \u0631\u0634\u062A\u0647",base64url:"base64url-encoded \u0631\u0634\u062A\u0647",json_string:"JSON \u0631\u0634\u062A\u0647",e164:"E.164 \u0639\u062F\u062F",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"},o={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0622\u0631\u0627\u06CC\u0647"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=x(r.input),c=o[a]??a;return/^[A-Z]/.test(r.expected)?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A instanceof ${r.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${c} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`:`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${i} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${c} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`}case"invalid_value":return r.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${k(r.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`:`\u06AF\u0632\u06CC\u0646\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A \u06CC\u06A9\u06CC \u0627\u0632 ${_(r.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let i=r.inclusive?"<=":"<",a=e(r.origin);return a?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${r.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${i}${r.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${r.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${i}${r.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let i=r.inclusive?">=":">",a=e(r.origin);return a?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${r.origin} \u0628\u0627\u06CC\u062F ${i}${r.minimum.toString()} ${a.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${r.origin} \u0628\u0627\u06CC\u062F ${i}${r.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${i.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:i.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${i.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:i.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${i.includes}" \u0628\u0627\u0634\u062F`:i.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${i.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${n[i.format]??r.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`}case"not_multiple_of":return`\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${r.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${r.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${_(r.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${r.origin}`;case"invalid_union":return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631";case"invalid_element":return`\u0645\u0642\u062F\u0627\u0631 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 ${r.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}};function ub(){return{localeError:WP()}}var JP=()=>{let t={string:{unit:"merkki\xE4",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\xE4iv\xE4m\xE4\xE4r\xE4n"}};function e(r){return t[r]??null}let n={regex:"s\xE4\xE4nn\xF6llinen lauseke",email:"s\xE4hk\xF6postiosoite",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\xE4iv\xE4m\xE4\xE4r\xE4",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"},o={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=x(r.input),c=o[a]??a;return/^[A-Z]/.test(r.expected)?`Virheellinen tyyppi: odotettiin instanceof ${r.expected}, oli ${c}`:`Virheellinen tyyppi: odotettiin ${i}, oli ${c}`}case"invalid_value":return r.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${k(r.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${_(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=e(r.origin);return a?`Liian suuri: ${a.subject} t\xE4ytyy olla ${i}${r.maximum.toString()} ${a.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=e(r.origin);return a?`Liian pieni: ${a.subject} t\xE4ytyy olla ${i}${r.minimum.toString()} ${a.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${i.prefix}"`:i.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${i.suffix}"`:i.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${i.includes}"`:i.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${i.pattern}`:`Virheellinen ${n[i.format]??r.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${r.divisor} monikerta`;case"unrecognized_keys":return`${r.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${_(r.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\xF6te"}}};function lb(){return{localeError:JP()}}var YP=()=>{let t={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(r){return t[r]??null}let n={regex:"entr\xE9e",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\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},o={string:"cha\xEEne",number:"nombre",int:"entier",boolean:"bool\xE9en",bigint:"grand entier",symbol:"symbole",undefined:"ind\xE9fini",null:"null",never:"jamais",void:"vide",date:"date",array:"tableau",object:"objet",tuple:"tuple",record:"enregistrement",map:"carte",set:"ensemble",file:"fichier",nonoptional:"non-optionnel",nan:"NaN",function:"fonction"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=x(r.input),c=o[a]??a;return/^[A-Z]/.test(r.expected)?`Entr\xE9e invalide : instanceof ${r.expected} attendu, ${c} re\xE7u`:`Entr\xE9e invalide : ${i} attendu, ${c} re\xE7u`}case"invalid_value":return r.values.length===1?`Entr\xE9e invalide : ${k(r.values[0])} attendu`:`Option invalide : une valeur parmi ${_(r.values,"|")} attendue`;case"too_big":{let i=r.inclusive?"<=":"<",a=e(r.origin);return a?`Trop grand : ${o[r.origin]??"valeur"} doit ${a.verb} ${i}${r.maximum.toString()} ${a.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${o[r.origin]??"valeur"} doit \xEAtre ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=e(r.origin);return a?`Trop petit : ${o[r.origin]??"valeur"} doit ${a.verb} ${i}${r.minimum.toString()} ${a.unit}`:`Trop petit : ${o[r.origin]??"valeur"} doit \xEAtre ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${i.prefix}"`:i.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${i.suffix}"`:i.format==="includes"?`Cha\xEEne invalide : doit inclure "${i.includes}"`:i.format==="regex"?`Cha\xEEne invalide : doit correspondre au mod\xE8le ${i.pattern}`:`${n[i.format]??r.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${r.divisor}`;case"unrecognized_keys":return`Cl\xE9${r.keys.length>1?"s":""} non reconnue${r.keys.length>1?"s":""} : ${_(r.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${r.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${r.origin}`;default:return"Entr\xE9e invalide"}}};function db(){return{localeError:YP()}}var XP=()=>{let t={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(r){return t[r]??null}let n={regex:"entr\xE9e",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\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},o={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=x(r.input),c=o[a]??a;return/^[A-Z]/.test(r.expected)?`Entr\xE9e invalide : attendu instanceof ${r.expected}, re\xE7u ${c}`:`Entr\xE9e invalide : attendu ${i}, re\xE7u ${c}`}case"invalid_value":return r.values.length===1?`Entr\xE9e invalide : attendu ${k(r.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${_(r.values,"|")}`;case"too_big":{let i=r.inclusive?"\u2264":"<",a=e(r.origin);return a?`Trop grand : attendu que ${r.origin??"la valeur"} ait ${i}${r.maximum.toString()} ${a.unit}`:`Trop grand : attendu que ${r.origin??"la valeur"} soit ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?"\u2265":">",a=e(r.origin);return a?`Trop petit : attendu que ${r.origin} ait ${i}${r.minimum.toString()} ${a.unit}`:`Trop petit : attendu que ${r.origin} soit ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${i.prefix}"`:i.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${i.suffix}"`:i.format==="includes"?`Cha\xEEne invalide : doit inclure "${i.includes}"`:i.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${i.pattern}`:`${n[i.format]??r.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${r.divisor}`;case"unrecognized_keys":return`Cl\xE9${r.keys.length>1?"s":""} non reconnue${r.keys.length>1?"s":""} : ${_(r.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${r.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${r.origin}`;default:return"Entr\xE9e invalide"}}};function pb(){return{localeError:XP()}}var QP=()=>{let t={string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA",gender:"f"},number:{label:"\u05DE\u05E1\u05E4\u05E8",gender:"m"},boolean:{label:"\u05E2\u05E8\u05DA \u05D1\u05D5\u05DC\u05D9\u05D0\u05E0\u05D9",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA",gender:"m"},array:{label:"\u05DE\u05E2\u05E8\u05DA",gender:"m"},object:{label:"\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8",gender:"m"},null:{label:"\u05E2\u05E8\u05DA \u05E8\u05D9\u05E7 (null)",gender:"m"},undefined:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05DE\u05D5\u05D2\u05D3\u05E8 (undefined)",gender:"m"},symbol:{label:"\u05E1\u05D9\u05DE\u05D1\u05D5\u05DC (Symbol)",gender:"m"},function:{label:"\u05E4\u05D5\u05E0\u05E7\u05E6\u05D9\u05D4",gender:"f"},map:{label:"\u05DE\u05E4\u05D4 (Map)",gender:"f"},set:{label:"\u05E7\u05D1\u05D5\u05E6\u05D4 (Set)",gender:"f"},file:{label:"\u05E7\u05D5\u05D1\u05E5",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05D9\u05D3\u05D5\u05E2",gender:"m"},value:{label:"\u05E2\u05E8\u05DA",gender:"m"}},e={string:{unit:"\u05EA\u05D5\u05D5\u05D9\u05DD",shortLabel:"\u05E7\u05E6\u05E8",longLabel:"\u05D0\u05E8\u05D5\u05DA"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},number:{unit:"",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"}},n=d=>d?t[d]:void 0,o=d=>{let l=n(d);return l?l.label:d??t.unknown.label},r=d=>`\u05D4${o(d)}`,i=d=>(n(d)?.gender??"m")==="f"?"\u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA":"\u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA",a=d=>d?e[d]??null:null,c={regex:{label:"\u05E7\u05DC\u05D8",gender:"m"},email:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",gender:"f"},url:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",gender:"f"},emoji:{label:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",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:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",gender:"m"},time:{label:"\u05D6\u05DE\u05DF ISO",gender:"m"},duration:{label:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",gender:"m"},ipv4:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",gender:"f"},ipv6:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",gender:"f"},cidrv4:{label:"\u05D8\u05D5\u05D5\u05D7 IPv4",gender:"m"},cidrv6:{label:"\u05D8\u05D5\u05D5\u05D7 IPv6",gender:"m"},base64:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",gender:"f"},base64url:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",gender:"f"},json_string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",gender:"f"},e164:{label:"\u05DE\u05E1\u05E4\u05E8 E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},includes:{label:"\u05E7\u05DC\u05D8",gender:"m"},lowercase:{label:"\u05E7\u05DC\u05D8",gender:"m"},starts_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},uppercase:{label:"\u05E7\u05DC\u05D8",gender:"m"}},u={nan:"NaN"};return d=>{switch(d.code){case"invalid_type":{let l=d.expected,p=u[l??""]??o(l),m=x(d.input),f=u[m]??t[m]?.label??m;return/^[A-Z]/.test(d.expected)?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA instanceof ${d.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${f}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${p}, \u05D4\u05EA\u05E7\u05D1\u05DC ${f}`}case"invalid_value":{if(d.values.length===1)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05E2\u05E8\u05DA \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA ${k(d.values[0])}`;let l=d.values.map(f=>k(f));if(d.values.length===2)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${l[0]} \u05D0\u05D5 ${l[1]}`;let p=l[l.length-1];return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${l.slice(0,-1).join(", ")} \u05D0\u05D5 ${p}`}case"too_big":{let l=a(d.origin),p=r(d.origin??"value");if(d.origin==="string")return`${l?.longLabel??"\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${d.maximum.toString()} ${l?.unit??""} ${d.inclusive?"\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA":"\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim();if(d.origin==="number"){let g=d.inclusive?`\u05E7\u05D8\u05DF \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${d.maximum}`:`\u05E7\u05D8\u05DF \u05DE-${d.maximum}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${g}`}if(d.origin==="array"||d.origin==="set"){let g=d.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",v=d.inclusive?`${d.maximum} ${l?.unit??""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA`:`\u05E4\u05D7\u05D5\u05EA \u05DE-${d.maximum} ${l?.unit??""}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${p} ${g} \u05DC\u05D4\u05DB\u05D9\u05DC ${v}`.trim()}let m=d.inclusive?"<=":"<",f=i(d.origin??"value");return l?.unit?`${l.longLabel} \u05DE\u05D3\u05D9: ${p} ${f} ${m}${d.maximum.toString()} ${l.unit}`:`${l?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${p} ${f} ${m}${d.maximum.toString()}`}case"too_small":{let l=a(d.origin),p=r(d.origin??"value");if(d.origin==="string")return`${l?.shortLabel??"\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${d.minimum.toString()} ${l?.unit??""} ${d.inclusive?"\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8":"\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim();if(d.origin==="number"){let g=d.inclusive?`\u05D2\u05D3\u05D5\u05DC \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${d.minimum}`:`\u05D2\u05D3\u05D5\u05DC \u05DE-${d.minimum}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${g}`}if(d.origin==="array"||d.origin==="set"){let g=d.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA";if(d.minimum===1&&d.inclusive){let b=(d.origin==="set","\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3");return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${p} ${g} \u05DC\u05D4\u05DB\u05D9\u05DC ${b}`}let v=d.inclusive?`${d.minimum} ${l?.unit??""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8`:`\u05D9\u05D5\u05EA\u05E8 \u05DE-${d.minimum} ${l?.unit??""}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${p} ${g} \u05DC\u05D4\u05DB\u05D9\u05DC ${v}`.trim()}let m=d.inclusive?">=":">",f=i(d.origin??"value");return l?.unit?`${l.shortLabel} \u05DE\u05D3\u05D9: ${p} ${f} ${m}${d.minimum.toString()} ${l.unit}`:`${l?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${p} ${f} ${m}${d.minimum.toString()}`}case"invalid_format":{let l=d;if(l.format==="starts_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1 "${l.prefix}"`;if(l.format==="ends_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${l.suffix}"`;if(l.format==="includes")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${l.includes}"`;if(l.format==="regex")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${l.pattern}`;let p=c[l.format],m=p?.label??l.format,g=(p?.gender??"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return`${m} \u05DC\u05D0 ${g}`}case"not_multiple_of":return`\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ${d.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${d.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${d.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${_(d.keys,", ")}`;case"invalid_key":return"\u05E9\u05D3\u05D4 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8";case"invalid_union":return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF";case"invalid_element":return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${r(d.origin??"array")}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}};function mb(){return{localeError:QP()}}var eO=()=>{let t={string:{unit:"znakova",verb:"imati"},file:{unit:"bajtova",verb:"imati"},array:{unit:"stavki",verb:"imati"},set:{unit:"stavki",verb:"imati"}};function e(r){return t[r]??null}let n={regex:"unos",email:"email 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:"ISO datum i vrijeme",date:"ISO datum",time:"ISO vrijeme",duration:"ISO trajanje",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"IPv4 raspon",cidrv6:"IPv6 raspon",base64:"base64 kodirani tekst",base64url:"base64url kodirani tekst",json_string:"JSON tekst",e164:"E.164 broj",jwt:"JWT",template_literal:"unos"},o={nan:"NaN",string:"tekst",number:"broj",boolean:"boolean",array:"niz",object:"objekt",set:"skup",file:"datoteka",date:"datum",bigint:"bigint",symbol:"simbol",undefined:"undefined",null:"null",function:"funkcija",map:"mapa"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=x(r.input),c=o[a]??a;return/^[A-Z]/.test(r.expected)?`Neispravan unos: o\u010Dekuje se instanceof ${r.expected}, a primljeno je ${c}`:`Neispravan unos: o\u010Dekuje se ${i}, a primljeno je ${c}`}case"invalid_value":return r.values.length===1?`Neispravna vrijednost: o\u010Dekivano ${k(r.values[0])}`:`Neispravna opcija: o\u010Dekivano jedno od ${_(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=e(r.origin),c=o[r.origin]??r.origin;return a?`Preveliko: o\u010Dekivano da ${c??"vrijednost"} ima ${i}${r.maximum.toString()} ${a.unit??"elemenata"}`:`Preveliko: o\u010Dekivano da ${c??"vrijednost"} bude ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=e(r.origin),c=o[r.origin]??r.origin;return a?`Premalo: o\u010Dekivano da ${c} ima ${i}${r.minimum.toString()} ${a.unit}`:`Premalo: o\u010Dekivano da ${c} bude ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Neispravan tekst: mora zapo\u010Dinjati s "${i.prefix}"`:i.format==="ends_with"?`Neispravan tekst: mora zavr\u0161avati s "${i.suffix}"`:i.format==="includes"?`Neispravan tekst: mora sadr\u017Eavati "${i.includes}"`:i.format==="regex"?`Neispravan tekst: mora odgovarati uzorku ${i.pattern}`:`Neispravna ${n[i.format]??r.format}`}case"not_multiple_of":return`Neispravan broj: mora biti vi\u0161ekratnik od ${r.divisor}`;case"unrecognized_keys":return`Neprepoznat${r.keys.length>1?"i klju\u010Devi":" klju\u010D"}: ${_(r.keys,", ")}`;case"invalid_key":return`Neispravan klju\u010D u ${o[r.origin]??r.origin}`;case"invalid_union":return"Neispravan unos";case"invalid_element":return`Neispravna vrijednost u ${o[r.origin]??r.origin}`;default:return"Neispravan unos"}}};function fb(){return{localeError:eO()}}var tO=()=>{let t={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function e(r){return t[r]??null}let n={regex:"bemenet",email:"email c\xEDm",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\u0151b\xE9lyeg",date:"ISO d\xE1tum",time:"ISO id\u0151",duration:"ISO id\u0151intervallum",ipv4:"IPv4 c\xEDm",ipv6:"IPv6 c\xEDm",cidrv4:"IPv4 tartom\xE1ny",cidrv6:"IPv6 tartom\xE1ny",base64:"base64-k\xF3dolt string",base64url:"base64url-k\xF3dolt string",json_string:"JSON string",e164:"E.164 sz\xE1m",jwt:"JWT",template_literal:"bemenet"},o={nan:"NaN",number:"sz\xE1m",array:"t\xF6mb"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=x(r.input),c=o[a]??a;return/^[A-Z]/.test(r.expected)?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k instanceof ${r.expected}, a kapott \xE9rt\xE9k ${c}`:`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${i}, a kapott \xE9rt\xE9k ${c}`}case"invalid_value":return r.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${k(r.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${_(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=e(r.origin);return a?`T\xFAl nagy: ${r.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${i}${r.maximum.toString()} ${a.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${r.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=e(r.origin);return a?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${r.origin} m\xE9rete t\xFAl kicsi ${i}${r.minimum.toString()} ${a.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${r.origin} t\xFAl kicsi ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\xC9rv\xE9nytelen string: "${i.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:i.format==="ends_with"?`\xC9rv\xE9nytelen string: "${i.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:i.format==="includes"?`\xC9rv\xE9nytelen string: "${i.includes}" \xE9rt\xE9ket kell tartalmaznia`:i.format==="regex"?`\xC9rv\xE9nytelen string: ${i.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${n[i.format]??r.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${r.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${r.keys.length>1?"s":""}: ${_(r.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${r.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${r.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}};function hb(){return{localeError:tO()}}function gb(t,e,n){return Math.abs(t)===1?e:n}function An(t){if(!t)return"";let e=["\u0561","\u0565","\u0568","\u056B","\u0578","\u0578\u0582","\u0585"],n=t[t.length-1];return t+(e.includes(n)?"\u0576":"\u0568")}var rO=()=>{let t={string:{unit:{one:"\u0576\u0577\u0561\u0576",many:"\u0576\u0577\u0561\u0576\u0576\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},file:{unit:{one:"\u0562\u0561\u0575\u0569",many:"\u0562\u0561\u0575\u0569\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},array:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},set:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"}};function e(r){return t[r]??null}let n={regex:"\u0574\u0578\u0582\u057F\u0584",email:"\u0567\u056C. \u0570\u0561\u057D\u0581\u0565",url:"URL",emoji:"\u0567\u0574\u0578\u057B\u056B",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E \u0587 \u056A\u0561\u0574",date:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E",time:"ISO \u056A\u0561\u0574",duration:"ISO \u057F\u0587\u0578\u0572\u0578\u0582\u0569\u0575\u0578\u0582\u0576",ipv4:"IPv4 \u0570\u0561\u057D\u0581\u0565",ipv6:"IPv6 \u0570\u0561\u057D\u0581\u0565",cidrv4:"IPv4 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",cidrv6:"IPv6 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",base64:"base64 \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",base64url:"base64url \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",json_string:"JSON \u057F\u0578\u0572",e164:"E.164 \u0570\u0561\u0574\u0561\u0580",jwt:"JWT",template_literal:"\u0574\u0578\u0582\u057F\u0584"},o={nan:"NaN",number:"\u0569\u056B\u057E",array:"\u0566\u0561\u0576\u0563\u057E\u0561\u056E"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=x(r.input),c=o[a]??a;return/^[A-Z]/.test(r.expected)?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 instanceof ${r.expected}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${c}`:`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${i}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${c}`}case"invalid_value":return r.values.length===1?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${k(r.values[1])}`:`\u054D\u056D\u0561\u056C \u057F\u0561\u0580\u0562\u0565\u0580\u0561\u056F\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 \u0570\u0565\u057F\u0587\u0575\u0561\u056C\u0576\u0565\u0580\u056B\u0581 \u0574\u0565\u056F\u0568\u055D ${_(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=e(r.origin);if(a){let c=Number(r.maximum),u=gb(c,a.unit.one,a.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${An(r.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${i}${r.maximum.toString()} ${u}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${An(r.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056C\u056B\u0576\u056B ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=e(r.origin);if(a){let c=Number(r.minimum),u=gb(c,a.unit.one,a.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${An(r.origin)} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${i}${r.minimum.toString()} ${u}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${An(r.origin)} \u056C\u056B\u0576\u056B ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057D\u056F\u057D\u057E\u056B "${i.prefix}"-\u0578\u057E`:i.format==="ends_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0561\u057E\u0561\u0580\u057F\u057E\u056B "${i.suffix}"-\u0578\u057E`:i.format==="includes"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057A\u0561\u0580\u0578\u0582\u0576\u0561\u056F\u056B "${i.includes}"`:i.format==="regex"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0570\u0561\u0574\u0561\u057A\u0561\u057F\u0561\u057D\u056D\u0561\u0576\u056B ${i.pattern} \u0571\u0587\u0561\u0579\u0561\u0583\u056B\u0576`:`\u054D\u056D\u0561\u056C ${n[i.format]??r.format}`}case"not_multiple_of":return`\u054D\u056D\u0561\u056C \u0569\u056B\u057E\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0562\u0561\u0566\u0574\u0561\u057A\u0561\u057F\u056B\u056F \u056C\u056B\u0576\u056B ${r.divisor}-\u056B`;case"unrecognized_keys":return`\u0549\u0573\u0561\u0576\u0561\u0579\u057E\u0561\u056E \u0562\u0561\u0576\u0561\u056C\u056B${r.keys.length>1?"\u0576\u0565\u0580":""}. ${_(r.keys,", ")}`;case"invalid_key":return`\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${An(r.origin)}-\u0578\u0582\u0574`;case"invalid_union":return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574";case"invalid_element":return`\u054D\u056D\u0561\u056C \u0561\u0580\u056A\u0565\u0584 ${An(r.origin)}-\u0578\u0582\u0574`;default:return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}};function _b(){return{localeError:rO()}}var nO=()=>{let t={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function e(r){return t[r]??null}let n={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"},o={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=x(r.input),c=o[a]??a;return/^[A-Z]/.test(r.expected)?`Input tidak valid: diharapkan instanceof ${r.expected}, diterima ${c}`:`Input tidak valid: diharapkan ${i}, diterima ${c}`}case"invalid_value":return r.values.length===1?`Input tidak valid: diharapkan ${k(r.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${_(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=e(r.origin);return a?`Terlalu besar: diharapkan ${r.origin??"value"} memiliki ${i}${r.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: diharapkan ${r.origin??"value"} menjadi ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=e(r.origin);return a?`Terlalu kecil: diharapkan ${r.origin} memiliki ${i}${r.minimum.toString()} ${a.unit}`:`Terlalu kecil: diharapkan ${r.origin} menjadi ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`String tidak valid: harus dimulai dengan "${i.prefix}"`:i.format==="ends_with"?`String tidak valid: harus berakhir dengan "${i.suffix}"`:i.format==="includes"?`String tidak valid: harus menyertakan "${i.includes}"`:i.format==="regex"?`String tidak valid: harus sesuai pola ${i.pattern}`:`${n[i.format]??r.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${r.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${r.keys.length>1?"s":""}: ${_(r.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${r.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${r.origin}`;default:return"Input tidak valid"}}};function yb(){return{localeError:nO()}}var oO=()=>{let t={string:{unit:"stafi",verb:"a\xF0 hafa"},file:{unit:"b\xE6ti",verb:"a\xF0 hafa"},array:{unit:"hluti",verb:"a\xF0 hafa"},set:{unit:"hluti",verb:"a\xF0 hafa"}};function e(r){return t[r]??null}let n={regex:"gildi",email:"netfang",url:"vefsl\xF3\xF0",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\xEDmi",date:"ISO dagsetning",time:"ISO t\xEDmi",duration:"ISO t\xEDmalengd",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\xF6lugildi",jwt:"JWT",template_literal:"gildi"},o={nan:"NaN",number:"n\xFAmer",array:"fylki"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=x(r.input),c=o[a]??a;return/^[A-Z]/.test(r.expected)?`Rangt gildi: \xDE\xFA sl\xF3st inn ${c} \xFEar sem \xE1 a\xF0 vera instanceof ${r.expected}`:`Rangt gildi: \xDE\xFA sl\xF3st inn ${c} \xFEar sem \xE1 a\xF0 vera ${i}`}case"invalid_value":return r.values.length===1?`Rangt gildi: gert r\xE1\xF0 fyrir ${k(r.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${_(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=e(r.origin);return a?`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${r.origin??"gildi"} hafi ${i}${r.maximum.toString()} ${a.unit??"hluti"}`:`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${r.origin??"gildi"} s\xE9 ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=e(r.origin);return a?`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${r.origin} hafi ${i}${r.minimum.toString()} ${a.unit}`:`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${r.origin} s\xE9 ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 byrja \xE1 "${i.prefix}"`:i.format==="ends_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 enda \xE1 "${i.suffix}"`:i.format==="includes"?`\xD3gildur strengur: ver\xF0ur a\xF0 innihalda "${i.includes}"`:i.format==="regex"?`\xD3gildur strengur: ver\xF0ur a\xF0 fylgja mynstri ${i.pattern}`:`Rangt ${n[i.format]??r.format}`}case"not_multiple_of":return`R\xF6ng tala: ver\xF0ur a\xF0 vera margfeldi af ${r.divisor}`;case"unrecognized_keys":return`\xD3\xFEekkt ${r.keys.length>1?"ir lyklar":"ur lykill"}: ${_(r.keys,", ")}`;case"invalid_key":return`Rangur lykill \xED ${r.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi \xED ${r.origin}`;default:return"Rangt gildi"}}};function vb(){return{localeError:oO()}}var iO=()=>{let t={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function e(r){return t[r]??null}let n={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"},o={nan:"NaN",number:"numero",array:"vettore"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=x(r.input),c=o[a]??a;return/^[A-Z]/.test(r.expected)?`Input non valido: atteso instanceof ${r.expected}, ricevuto ${c}`:`Input non valido: atteso ${i}, ricevuto ${c}`}case"invalid_value":return r.values.length===1?`Input non valido: atteso ${k(r.values[0])}`:`Opzione non valida: atteso uno tra ${_(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=e(r.origin);return a?`Troppo grande: ${r.origin??"valore"} deve avere ${i}${r.maximum.toString()} ${a.unit??"elementi"}`:`Troppo grande: ${r.origin??"valore"} deve essere ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=e(r.origin);return a?`Troppo piccolo: ${r.origin} deve avere ${i}${r.minimum.toString()} ${a.unit}`:`Troppo piccolo: ${r.origin} deve essere ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Stringa non valida: deve iniziare con "${i.prefix}"`:i.format==="ends_with"?`Stringa non valida: deve terminare con "${i.suffix}"`:i.format==="includes"?`Stringa non valida: deve includere "${i.includes}"`:i.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${i.pattern}`:`Input non valido: ${n[i.format]??r.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${r.divisor}`;case"unrecognized_keys":return`Chiav${r.keys.length>1?"i":"e"} non riconosciut${r.keys.length>1?"e":"a"}: ${_(r.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${r.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${r.origin}`;default:return"Input non valido"}}};function bb(){return{localeError:iO()}}var aO=()=>{let t={string:{unit:"\u6587\u5B57",verb:"\u3067\u3042\u308B"},file:{unit:"\u30D0\u30A4\u30C8",verb:"\u3067\u3042\u308B"},array:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"},set:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"}};function e(r){return t[r]??null}let n={regex:"\u5165\u529B\u5024",email:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",url:"URL",emoji:"\u7D75\u6587\u5B57",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u6642",date:"ISO\u65E5\u4ED8",time:"ISO\u6642\u523B",duration:"ISO\u671F\u9593",ipv4:"IPv4\u30A2\u30C9\u30EC\u30B9",ipv6:"IPv6\u30A2\u30C9\u30EC\u30B9",cidrv4:"IPv4\u7BC4\u56F2",cidrv6:"IPv6\u7BC4\u56F2",base64:"base64\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",base64url:"base64url\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",json_string:"JSON\u6587\u5B57\u5217",e164:"E.164\u756A\u53F7",jwt:"JWT",template_literal:"\u5165\u529B\u5024"},o={nan:"NaN",number:"\u6570\u5024",array:"\u914D\u5217"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=x(r.input),c=o[a]??a;return/^[A-Z]/.test(r.expected)?`\u7121\u52B9\u306A\u5165\u529B: instanceof ${r.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${c}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u5165\u529B: ${i}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${c}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`}case"invalid_value":return r.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${k(r.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${_(r.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let i=r.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",a=e(r.origin);return a?`\u5927\u304D\u3059\u304E\u308B\u5024: ${r.origin??"\u5024"}\u306F${r.maximum.toString()}${a.unit??"\u8981\u7D20"}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${r.origin??"\u5024"}\u306F${r.maximum.toString()}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let i=r.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",a=e(r.origin);return a?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${r.origin}\u306F${r.minimum.toString()}${a.unit}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${r.origin}\u306F${r.minimum.toString()}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${i.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${n[i.format]??r.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${r.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"unrecognized_keys":return`\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${r.keys.length>1?"\u7FA4":""}: ${_(r.keys,"\u3001")}`;case"invalid_key":return`${r.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${r.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}};function kb(){return{localeError:aO()}}var sO=()=>{let t={string:{unit:"\u10E1\u10D8\u10DB\u10D1\u10DD\u10DA\u10DD",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},file:{unit:"\u10D1\u10D0\u10D8\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},array:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},set:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"}};function e(r){return t[r]??null}let n={regex:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0",email:"\u10D4\u10DA-\u10E4\u10DD\u10E1\u10E2\u10D8\u10E1 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",url:"URL",emoji:"\u10D4\u10DB\u10DD\u10EF\u10D8",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8-\u10D3\u10E0\u10DD",date:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8",time:"\u10D3\u10E0\u10DD",duration:"\u10EE\u10D0\u10DC\u10D2\u10E0\u10EB\u10DA\u10D8\u10D5\u10DD\u10D1\u10D0",ipv4:"IPv4 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",ipv6:"IPv6 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",cidrv4:"IPv4 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",cidrv6:"IPv6 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",base64:"base64-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",base64url:"base64url-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",json_string:"JSON \u10D5\u10D4\u10DA\u10D8",e164:"E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",jwt:"JWT",template_literal:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"},o={nan:"NaN",number:"\u10E0\u10D8\u10EA\u10EE\u10D5\u10D8",string:"\u10D5\u10D4\u10DA\u10D8",boolean:"\u10D1\u10E3\u10DA\u10D4\u10D0\u10DC\u10D8",function:"\u10E4\u10E3\u10DC\u10E5\u10EA\u10D8\u10D0",array:"\u10DB\u10D0\u10E1\u10D8\u10D5\u10D8"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=x(r.input),c=o[a]??a;return/^[A-Z]/.test(r.expected)?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 instanceof ${r.expected}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${c}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${i}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${c}`}case"invalid_value":return r.values.length===1?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${k(r.values[0])}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D0\u10E0\u10D8\u10D0\u10DC\u10E2\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8\u10D0 \u10D4\u10E0\u10D7-\u10D4\u10E0\u10D7\u10D8 ${_(r.values,"|")}-\u10D3\u10D0\u10DC`;case"too_big":{let i=r.inclusive?"<=":"<",a=e(r.origin);return a?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${r.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} ${a.verb} ${i}${r.maximum.toString()} ${a.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${r.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} \u10D8\u10E7\u10DD\u10E1 ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=e(r.origin);return a?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${r.origin} ${a.verb} ${i}${r.minimum.toString()} ${a.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${r.origin} \u10D8\u10E7\u10DD\u10E1 ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10EC\u10E7\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${i.prefix}"-\u10D8\u10D7`:i.format==="ends_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10DB\u10D7\u10D0\u10D5\u10E0\u10D3\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${i.suffix}"-\u10D8\u10D7`:i.format==="includes"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1 "${i.includes}"-\u10E1`:i.format==="regex"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D4\u10E1\u10D0\u10D1\u10D0\u10DB\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 \u10E8\u10D0\u10D1\u10DA\u10DD\u10DC\u10E1 ${i.pattern}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${n[i.format]??r.format}`}case"not_multiple_of":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E0\u10D8\u10EA\u10EE\u10D5\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10E7\u10DD\u10E1 ${r.divisor}-\u10D8\u10E1 \u10EF\u10D4\u10E0\u10D0\u10D3\u10D8`;case"unrecognized_keys":return`\u10E3\u10EA\u10DC\u10DD\u10D1\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1${r.keys.length>1?"\u10D4\u10D1\u10D8":"\u10D8"}: ${_(r.keys,", ")}`;case"invalid_key":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1\u10D8 ${r.origin}-\u10E8\u10D8`;case"invalid_union":return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0";case"invalid_element":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0 ${r.origin}-\u10E8\u10D8`;default:return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"}}};function xb(){return{localeError:sO()}}var cO=()=>{let t={string:{unit:"\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},file:{unit:"\u1794\u17C3",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},array:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},set:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"}};function e(r){return t[r]??null}let n={regex:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B",email:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793\u17A2\u17CA\u17B8\u1798\u17C2\u179B",url:"URL",emoji:"\u179F\u1789\u17D2\u1789\u17B6\u17A2\u17B6\u179A\u1798\u17D2\u1798\u178E\u17CD",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 \u1793\u17B7\u1784\u1798\u17C9\u17C4\u1784 ISO",date:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 ISO",time:"\u1798\u17C9\u17C4\u1784 ISO",duration:"\u179A\u1799\u17C8\u1796\u17C1\u179B ISO",ipv4:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",ipv6:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",cidrv4:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",cidrv6:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",base64:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64",base64url:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64url",json_string:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",e164:"\u179B\u17C1\u1781 E.164",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"},o={nan:"NaN",number:"\u179B\u17C1\u1781",array:"\u17A2\u17B6\u179A\u17C1 (Array)",null:"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=x(r.input),c=o[a]??a;return/^[A-Z]/.test(r.expected)?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A instanceof ${r.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${c}`:`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${i} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${c}`}case"invalid_value":return r.values.length===1?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${k(r.values[0])}`:`\u1787\u1798\u17D2\u179A\u17BE\u179F\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1787\u17B6\u1798\u17BD\u1799\u1780\u17D2\u1793\u17BB\u1784\u1785\u17C6\u178E\u17C4\u1798 ${_(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=e(r.origin);return a?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${i} ${r.maximum.toString()} ${a.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${i} ${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=e(r.origin);return a?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.origin} ${i} ${r.minimum.toString()} ${a.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.origin} ${i} ${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1785\u17B6\u1794\u17CB\u1795\u17D2\u178F\u17BE\u1798\u178A\u17C4\u1799 "${i.prefix}"`:i.format==="ends_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1794\u1789\u17D2\u1785\u1794\u17CB\u178A\u17C4\u1799 "${i.suffix}"`:i.format==="includes"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1798\u17B6\u1793 "${i.includes}"`:i.format==="regex"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1795\u17D2\u1782\u17BC\u1795\u17D2\u1782\u1784\u1793\u17B9\u1784\u1791\u1798\u17D2\u179A\u1784\u17CB\u178A\u17C2\u179B\u1794\u17B6\u1793\u1780\u17C6\u178E\u178F\u17CB ${i.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${n[i.format]??r.format}`}case"not_multiple_of":return`\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${r.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${_(r.keys,", ")}`;case"invalid_key":return`\u179F\u17C4\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${r.origin}`;case"invalid_union":return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C";case"invalid_element":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${r.origin}`;default:return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C"}}};function Yc(){return{localeError:cO()}}function Sb(){return Yc()}var uO=()=>{let t={string:{unit:"\uBB38\uC790",verb:"to have"},file:{unit:"\uBC14\uC774\uD2B8",verb:"to have"},array:{unit:"\uAC1C",verb:"to have"},set:{unit:"\uAC1C",verb:"to have"}};function e(r){return t[r]??null}let n={regex:"\uC785\uB825",email:"\uC774\uBA54\uC77C \uC8FC\uC18C",url:"URL",emoji:"\uC774\uBAA8\uC9C0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \uB0A0\uC9DC\uC2DC\uAC04",date:"ISO \uB0A0\uC9DC",time:"ISO \uC2DC\uAC04",duration:"ISO \uAE30\uAC04",ipv4:"IPv4 \uC8FC\uC18C",ipv6:"IPv6 \uC8FC\uC18C",cidrv4:"IPv4 \uBC94\uC704",cidrv6:"IPv6 \uBC94\uC704",base64:"base64 \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",base64url:"base64url \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",json_string:"JSON \uBB38\uC790\uC5F4",e164:"E.164 \uBC88\uD638",jwt:"JWT",template_literal:"\uC785\uB825"},o={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=x(r.input),c=o[a]??a;return/^[A-Z]/.test(r.expected)?`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 instanceof ${r.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${c}\uC785\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${i}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${c}\uC785\uB2C8\uB2E4`}case"invalid_value":return r.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${k(r.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${_(r.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let i=r.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",a=i==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",c=e(r.origin),u=c?.unit??"\uC694\uC18C";return c?`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${r.maximum.toString()}${u} ${i}${a}`:`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${r.maximum.toString()} ${i}${a}`}case"too_small":{let i=r.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",a=i==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",c=e(r.origin),u=c?.unit??"\uC694\uC18C";return c?`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${r.minimum.toString()}${u} ${i}${a}`:`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${r.minimum.toString()} ${i}${a}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:i.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:i.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:i.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${i.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${n[i.format]??r.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${r.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${_(r.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${r.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${r.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}};function $b(){return{localeError:uO()}}var Ei=t=>t.charAt(0).toUpperCase()+t.slice(1);function Ib(t){let e=Math.abs(t),n=e%10,o=e%100;return o>=11&&o<=19||n===0?"many":n===1?"one":"few"}var lO=()=>{let t={string:{unit:{one:"simbolis",few:"simboliai",many:"simboli\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne ilgesn\u0117 kaip",notInclusive:"turi b\u016Bti trumpesn\u0117 kaip"},bigger:{inclusive:"turi b\u016Bti ne trumpesn\u0117 kaip",notInclusive:"turi b\u016Bti ilgesn\u0117 kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"bait\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne didesnis kaip",notInclusive:"turi b\u016Bti ma\u017Eesnis kaip"},bigger:{inclusive:"turi b\u016Bti ne ma\u017Eesnis kaip",notInclusive:"turi b\u016Bti didesnis kaip"}}},array:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}},set:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}}};function e(r,i,a,c){let u=t[r]??null;return u===null?u:{unit:u.unit[i],verb:u.verb[c][a?"inclusive":"notInclusive"]}}let n={regex:"\u012Fvestis",email:"el. pa\u0161to 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\u0117",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 u\u017Ekoduota eilut\u0117",base64url:"base64url u\u017Ekoduota eilut\u0117",json_string:"JSON eilut\u0117",e164:"E.164 numeris",jwt:"JWT",template_literal:"\u012Fvestis"},o={nan:"NaN",number:"skai\u010Dius",bigint:"sveikasis skai\u010Dius",string:"eilut\u0117",boolean:"login\u0117 reik\u0161m\u0117",undefined:"neapibr\u0117\u017Eta reik\u0161m\u0117",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulin\u0117 reik\u0161m\u0117"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=x(r.input),c=o[a]??a;return/^[A-Z]/.test(r.expected)?`Gautas tipas ${c}, o tik\u0117tasi - instanceof ${r.expected}`:`Gautas tipas ${c}, o tik\u0117tasi - ${i}`}case"invalid_value":return r.values.length===1?`Privalo b\u016Bti ${k(r.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${_(r.values,"|")} pasirinkim\u0173`;case"too_big":{let i=o[r.origin]??r.origin,a=e(r.origin,Ib(Number(r.maximum)),r.inclusive??!1,"smaller");if(a?.verb)return`${Ei(i??r.origin??"reik\u0161m\u0117")} ${a.verb} ${r.maximum.toString()} ${a.unit??"element\u0173"}`;let c=r.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return`${Ei(i??r.origin??"reik\u0161m\u0117")} turi b\u016Bti ${c} ${r.maximum.toString()} ${a?.unit}`}case"too_small":{let i=o[r.origin]??r.origin,a=e(r.origin,Ib(Number(r.minimum)),r.inclusive??!1,"bigger");if(a?.verb)return`${Ei(i??r.origin??"reik\u0161m\u0117")} ${a.verb} ${r.minimum.toString()} ${a.unit??"element\u0173"}`;let c=r.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return`${Ei(i??r.origin??"reik\u0161m\u0117")} turi b\u016Bti ${c} ${r.minimum.toString()} ${a?.unit}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Eilut\u0117 privalo prasid\u0117ti "${i.prefix}"`:i.format==="ends_with"?`Eilut\u0117 privalo pasibaigti "${i.suffix}"`:i.format==="includes"?`Eilut\u0117 privalo \u012Ftraukti "${i.includes}"`:i.format==="regex"?`Eilut\u0117 privalo atitikti ${i.pattern}`:`Neteisingas ${n[i.format]??r.format}`}case"not_multiple_of":return`Skai\u010Dius privalo b\u016Bti ${r.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpa\u017Eint${r.keys.length>1?"i":"as"} rakt${r.keys.length>1?"ai":"as"}: ${_(r.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga \u012Fvestis";case"invalid_element":{let i=o[r.origin]??r.origin;return`${Ei(i??r.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}};function wb(){return{localeError:lO()}}var dO=()=>{let t={string:{unit:"\u0437\u043D\u0430\u0446\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},file:{unit:"\u0431\u0430\u0458\u0442\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},array:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},set:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"}};function e(r){return t[r]??null}let n={regex:"\u0432\u043D\u0435\u0441",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u043D\u0430 \u0435-\u043F\u043E\u0448\u0442\u0430",url:"URL",emoji:"\u0435\u043C\u043E\u045F\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0443\u043C \u0438 \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0443\u043C",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u0432\u0440\u0435\u043C\u0435\u0442\u0440\u0430\u0435\u045A\u0435",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441\u0430",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441\u0430",cidrv4:"IPv4 \u043E\u043F\u0441\u0435\u0433",cidrv6:"IPv6 \u043E\u043F\u0441\u0435\u0433",base64:"base64-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",base64url:"base64url-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",json_string:"JSON \u043D\u0438\u0437\u0430",e164:"E.164 \u0431\u0440\u043E\u0458",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"},o={nan:"NaN",number:"\u0431\u0440\u043E\u0458",array:"\u043D\u0438\u0437\u0430"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=x(r.input),c=o[a]??a;return/^[A-Z]/.test(r.expected)?`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 instanceof ${r.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${c}`:`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${i}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${c}`}case"invalid_value":return r.values.length===1?`Invalid input: expected ${k(r.values[0])}`:`\u0413\u0440\u0435\u0448\u0430\u043D\u0430 \u043E\u043F\u0446\u0438\u0458\u0430: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 \u0435\u0434\u043D\u0430 ${_(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=e(r.origin);return a?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${r.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${i}${r.maximum.toString()} ${a.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${r.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=e(r.origin);return a?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${r.origin} \u0434\u0430 \u0438\u043C\u0430 ${i}${r.minimum.toString()} ${a.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${r.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u043D\u0443\u0432\u0430 \u0441\u043E "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u0432\u0440\u0448\u0443\u0432\u0430 \u0441\u043E "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0432\u043A\u043B\u0443\u0447\u0443\u0432\u0430 "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u043E\u0434\u0433\u043E\u0430\u0440\u0430 \u043D\u0430 \u043F\u0430\u0442\u0435\u0440\u043D\u043E\u0442 ${i.pattern}`:`Invalid ${n[i.format]??r.format}`}case"not_multiple_of":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438":"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${_(r.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${r.origin}`;case"invalid_union":return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441";case"invalid_element":return`\u0413\u0440\u0435\u0448\u043D\u0430 \u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442 \u0432\u043E ${r.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}};function Eb(){return{localeError:dO()}}var pO=()=>{let t={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function e(r){return t[r]??null}let n={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"},o={nan:"NaN",number:"nombor"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=x(r.input),c=o[a]??a;return/^[A-Z]/.test(r.expected)?`Input tidak sah: dijangka instanceof ${r.expected}, diterima ${c}`:`Input tidak sah: dijangka ${i}, diterima ${c}`}case"invalid_value":return r.values.length===1?`Input tidak sah: dijangka ${k(r.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${_(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=e(r.origin);return a?`Terlalu besar: dijangka ${r.origin??"nilai"} ${a.verb} ${i}${r.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: dijangka ${r.origin??"nilai"} adalah ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=e(r.origin);return a?`Terlalu kecil: dijangka ${r.origin} ${a.verb} ${i}${r.minimum.toString()} ${a.unit}`:`Terlalu kecil: dijangka ${r.origin} adalah ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`String tidak sah: mesti bermula dengan "${i.prefix}"`:i.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${i.suffix}"`:i.format==="includes"?`String tidak sah: mesti mengandungi "${i.includes}"`:i.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${i.pattern}`:`${n[i.format]??r.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${r.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${_(r.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${r.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${r.origin}`;default:return"Input tidak sah"}}};function Tb(){return{localeError:pO()}}var mO=()=>{let t={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function e(r){return t[r]??null}let n={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"},o={nan:"NaN",number:"getal"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=x(r.input),c=o[a]??a;return/^[A-Z]/.test(r.expected)?`Ongeldige invoer: verwacht instanceof ${r.expected}, ontving ${c}`:`Ongeldige invoer: verwacht ${i}, ontving ${c}`}case"invalid_value":return r.values.length===1?`Ongeldige invoer: verwacht ${k(r.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${_(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=e(r.origin),c=r.origin==="date"?"laat":r.origin==="string"?"lang":"groot";return a?`Te ${c}: verwacht dat ${r.origin??"waarde"} ${i}${r.maximum.toString()} ${a.unit??"elementen"} ${a.verb}`:`Te ${c}: verwacht dat ${r.origin??"waarde"} ${i}${r.maximum.toString()} is`}case"too_small":{let i=r.inclusive?">=":">",a=e(r.origin),c=r.origin==="date"?"vroeg":r.origin==="string"?"kort":"klein";return a?`Te ${c}: verwacht dat ${r.origin} ${i}${r.minimum.toString()} ${a.unit} ${a.verb}`:`Te ${c}: verwacht dat ${r.origin} ${i}${r.minimum.toString()} is`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Ongeldige tekst: moet met "${i.prefix}" beginnen`:i.format==="ends_with"?`Ongeldige tekst: moet op "${i.suffix}" eindigen`:i.format==="includes"?`Ongeldige tekst: moet "${i.includes}" bevatten`:i.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${i.pattern}`:`Ongeldig: ${n[i.format]??r.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${r.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${r.keys.length>1?"s":""}: ${_(r.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${r.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${r.origin}`;default:return"Ongeldige invoer"}}};function Pb(){return{localeError:mO()}}var fO=()=>{let t={string:{unit:"tegn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"elementer",verb:"\xE5 inneholde"},set:{unit:"elementer",verb:"\xE5 inneholde"}};function e(r){return t[r]??null}let n={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\xE5de",ipv6:"IPv6-omr\xE5de",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"},o={nan:"NaN",number:"tall",array:"liste"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=x(r.input),c=o[a]??a;return/^[A-Z]/.test(r.expected)?`Ugyldig input: forventet instanceof ${r.expected}, fikk ${c}`:`Ugyldig input: forventet ${i}, fikk ${c}`}case"invalid_value":return r.values.length===1?`Ugyldig verdi: forventet ${k(r.values[0])}`:`Ugyldig valg: forventet en av ${_(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=e(r.origin);return a?`For stor(t): forventet ${r.origin??"value"} til \xE5 ha ${i}${r.maximum.toString()} ${a.unit??"elementer"}`:`For stor(t): forventet ${r.origin??"value"} til \xE5 ha ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=e(r.origin);return a?`For lite(n): forventet ${r.origin} til \xE5 ha ${i}${r.minimum.toString()} ${a.unit}`:`For lite(n): forventet ${r.origin} til \xE5 ha ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${i.prefix}"`:i.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${i.suffix}"`:i.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${i.includes}"`:i.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${i.pattern}`:`Ugyldig ${n[i.format]??r.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${_(r.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${r.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${r.origin}`;default:return"Ugyldig input"}}};function Ob(){return{localeError:fO()}}var hO=()=>{let t={string:{unit:"harf",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"unsur",verb:"olmal\u0131d\u0131r"},set:{unit:"unsur",verb:"olmal\u0131d\u0131r"}};function e(r){return t[r]??null}let n={regex:"giren",email:"epostag\xE2h",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\xE2m\u0131",date:"ISO tarihi",time:"ISO zaman\u0131",duration:"ISO m\xFCddeti",ipv4:"IPv4 ni\u015F\xE2n\u0131",ipv6:"IPv6 ni\u015F\xE2n\u0131",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-\u015Fifreli metin",base64url:"base64url-\u015Fifreli metin",json_string:"JSON metin",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"giren"},o={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=x(r.input),c=o[a]??a;return/^[A-Z]/.test(r.expected)?`F\xE2sit giren: umulan instanceof ${r.expected}, al\u0131nan ${c}`:`F\xE2sit giren: umulan ${i}, al\u0131nan ${c}`}case"invalid_value":return r.values.length===1?`F\xE2sit giren: umulan ${k(r.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${_(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=e(r.origin);return a?`Fazla b\xFCy\xFCk: ${r.origin??"value"}, ${i}${r.maximum.toString()} ${a.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${r.origin??"value"}, ${i}${r.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let i=r.inclusive?">=":">",a=e(r.origin);return a?`Fazla k\xFC\xE7\xFCk: ${r.origin}, ${i}${r.minimum.toString()} ${a.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${r.origin}, ${i}${r.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let i=r;return i.format==="starts_with"?`F\xE2sit metin: "${i.prefix}" ile ba\u015Flamal\u0131.`:i.format==="ends_with"?`F\xE2sit metin: "${i.suffix}" ile bitmeli.`:i.format==="includes"?`F\xE2sit metin: "${i.includes}" ihtiv\xE2 etmeli.`:i.format==="regex"?`F\xE2sit metin: ${i.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${n[i.format]??r.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${r.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${r.keys.length>1?"s":""}: ${_(r.keys,", ")}`;case"invalid_key":return`${r.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${r.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}};function Rb(){return{localeError:hO()}}var gO=()=>{let t={string:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},file:{unit:"\u0628\u0627\u06CC\u067C\u0633",verb:"\u0648\u0644\u0631\u064A"},array:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},set:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"}};function e(r){return t[r]??null}let n={regex:"\u0648\u0631\u0648\u062F\u064A",email:"\u0628\u0631\u06CC\u069A\u0646\u0627\u0644\u06CC\u06A9",url:"\u06CC\u0648 \u0622\u0631 \u0627\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0646\u06CC\u067C\u0647 \u0627\u0648 \u0648\u062E\u062A",date:"\u0646\u06D0\u067C\u0647",time:"\u0648\u062E\u062A",duration:"\u0645\u0648\u062F\u0647",ipv4:"\u062F IPv4 \u067E\u062A\u0647",ipv6:"\u062F IPv6 \u067E\u062A\u0647",cidrv4:"\u062F IPv4 \u0633\u0627\u062D\u0647",cidrv6:"\u062F IPv6 \u0633\u0627\u062D\u0647",base64:"base64-encoded \u0645\u062A\u0646",base64url:"base64url-encoded \u0645\u062A\u0646",json_string:"JSON \u0645\u062A\u0646",e164:"\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"},o={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0627\u0631\u06D0"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=x(r.input),c=o[a]??a;return/^[A-Z]/.test(r.expected)?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F instanceof ${r.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${c} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`:`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${i} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${c} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`}case"invalid_value":return r.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${k(r.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${_(r.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let i=r.inclusive?"<=":"<",a=e(r.origin);return a?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${r.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${i}${r.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${r.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${i}${r.maximum.toString()} \u0648\u064A`}case"too_small":{let i=r.inclusive?">=":">",a=e(r.origin);return a?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${r.origin} \u0628\u0627\u06CC\u062F ${i}${r.minimum.toString()} ${a.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${r.origin} \u0628\u0627\u06CC\u062F ${i}${r.minimum.toString()} \u0648\u064A`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${i.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:i.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${i.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:i.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${i.includes}" \u0648\u0644\u0631\u064A`:i.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${i.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${n[i.format]??r.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${r.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${r.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${_(r.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${r.origin} \u06A9\u06D0`;case"invalid_union":return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A";case"invalid_element":return`\u0646\u0627\u0633\u0645 \u0639\u0646\u0635\u0631 \u067E\u0647 ${r.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}};function Ab(){return{localeError:gO()}}var _O=()=>{let t={string:{unit:"znak\xF3w",verb:"mie\u0107"},file:{unit:"bajt\xF3w",verb:"mie\u0107"},array:{unit:"element\xF3w",verb:"mie\u0107"},set:{unit:"element\xF3w",verb:"mie\u0107"}};function e(r){return t[r]??null}let n={regex:"wyra\u017Cenie",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\u0105g znak\xF3w zakodowany w formacie base64",base64url:"ci\u0105g znak\xF3w zakodowany w formacie base64url",json_string:"ci\u0105g znak\xF3w w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wej\u015Bcie"},o={nan:"NaN",number:"liczba",array:"tablica"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=x(r.input),c=o[a]??a;return/^[A-Z]/.test(r.expected)?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano instanceof ${r.expected}, otrzymano ${c}`:`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${i}, otrzymano ${c}`}case"invalid_value":return r.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${k(r.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${_(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=e(r.origin);return a?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${r.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${i}${r.maximum.toString()} ${a.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${r.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=e(r.origin);return a?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${r.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${i}${r.minimum.toString()} ${a.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${r.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${i.prefix}"`:i.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${i.suffix}"`:i.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${i.includes}"`:i.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${i.pattern}`:`Nieprawid\u0142ow(y/a/e) ${n[i.format]??r.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${r.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${r.keys.length>1?"s":""}: ${_(r.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${r.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${r.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}};function Cb(){return{localeError:_O()}}var yO=()=>{let t={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function e(r){return t[r]??null}let n={regex:"padr\xE3o",email:"endere\xE7o 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\xE7\xE3o ISO",ipv4:"endere\xE7o IPv4",ipv6:"endere\xE7o 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\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},o={nan:"NaN",number:"n\xFAmero",null:"nulo"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=x(r.input),c=o[a]??a;return/^[A-Z]/.test(r.expected)?`Tipo inv\xE1lido: esperado instanceof ${r.expected}, recebido ${c}`:`Tipo inv\xE1lido: esperado ${i}, recebido ${c}`}case"invalid_value":return r.values.length===1?`Entrada inv\xE1lida: esperado ${k(r.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${_(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=e(r.origin);return a?`Muito grande: esperado que ${r.origin??"valor"} tivesse ${i}${r.maximum.toString()} ${a.unit??"elementos"}`:`Muito grande: esperado que ${r.origin??"valor"} fosse ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=e(r.origin);return a?`Muito pequeno: esperado que ${r.origin} tivesse ${i}${r.minimum.toString()} ${a.unit}`:`Muito pequeno: esperado que ${r.origin} fosse ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${i.prefix}"`:i.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${i.suffix}"`:i.format==="includes"?`Texto inv\xE1lido: deve incluir "${i.includes}"`:i.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${i.pattern}`:`${n[i.format]??r.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${r.divisor}`;case"unrecognized_keys":return`Chave${r.keys.length>1?"s":""} desconhecida${r.keys.length>1?"s":""}: ${_(r.keys,", ")}`;case"invalid_key":return`Chave inv\xE1lida em ${r.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido em ${r.origin}`;default:return"Campo inv\xE1lido"}}};function Nb(){return{localeError:yO()}}var vO=()=>{let t={string:{unit:"caractere",verb:"s\u0103 aib\u0103"},file:{unit:"octe\u021Bi",verb:"s\u0103 aib\u0103"},array:{unit:"elemente",verb:"s\u0103 aib\u0103"},set:{unit:"elemente",verb:"s\u0103 aib\u0103"},map:{unit:"intr\u0103ri",verb:"s\u0103 aib\u0103"}};function e(r){return t[r]??null}let n={regex:"intrare",email:"adres\u0103 de 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:"dat\u0103 \u0219i or\u0103 ISO",date:"dat\u0103 ISO",time:"or\u0103 ISO",duration:"durat\u0103 ISO",ipv4:"adres\u0103 IPv4",ipv6:"adres\u0103 IPv6",mac:"adres\u0103 MAC",cidrv4:"interval IPv4",cidrv6:"interval IPv6",base64:"\u0219ir codat base64",base64url:"\u0219ir codat base64url",json_string:"\u0219ir JSON",e164:"num\u0103r E.164",jwt:"JWT",template_literal:"intrare"},o={nan:"NaN",string:"\u0219ir",number:"num\u0103r",boolean:"boolean",function:"func\u021Bie",array:"matrice",object:"obiect",undefined:"nedefinit",symbol:"simbol",bigint:"num\u0103r mare",void:"void",never:"never",map:"hart\u0103",set:"set"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=x(r.input),c=o[a]??a;return`Intrare invalid\u0103: a\u0219teptat ${i}, primit ${c}`}case"invalid_value":return r.values.length===1?`Intrare invalid\u0103: a\u0219teptat ${k(r.values[0])}`:`Op\u021Biune invalid\u0103: a\u0219teptat una dintre ${_(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=e(r.origin);return a?`Prea mare: a\u0219teptat ca ${r.origin??"valoarea"} ${a.verb} ${i}${r.maximum.toString()} ${a.unit??"elemente"}`:`Prea mare: a\u0219teptat ca ${r.origin??"valoarea"} s\u0103 fie ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=e(r.origin);return a?`Prea mic: a\u0219teptat ca ${r.origin} ${a.verb} ${i}${r.minimum.toString()} ${a.unit}`:`Prea mic: a\u0219teptat ca ${r.origin} s\u0103 fie ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u0218ir invalid: trebuie s\u0103 \xEEnceap\u0103 cu "${i.prefix}"`:i.format==="ends_with"?`\u0218ir invalid: trebuie s\u0103 se termine cu "${i.suffix}"`:i.format==="includes"?`\u0218ir invalid: trebuie s\u0103 includ\u0103 "${i.includes}"`:i.format==="regex"?`\u0218ir invalid: trebuie s\u0103 se potriveasc\u0103 cu modelul ${i.pattern}`:`Format invalid: ${n[i.format]??r.format}`}case"not_multiple_of":return`Num\u0103r invalid: trebuie s\u0103 fie multiplu de ${r.divisor}`;case"unrecognized_keys":return`Chei nerecunoscute: ${_(r.keys,", ")}`;case"invalid_key":return`Cheie invalid\u0103 \xEEn ${r.origin}`;case"invalid_union":return"Intrare invalid\u0103";case"invalid_element":return`Valoare invalid\u0103 \xEEn ${r.origin}`;default:return"Intrare invalid\u0103"}}};function zb(){return{localeError:vO()}}function Db(t,e,n,o){let r=Math.abs(t),i=r%10,a=r%100;return a>=11&&a<=19?o:i===1?e:i>=2&&i<=4?n:o}var bO=()=>{let t={string:{unit:{one:"\u0441\u0438\u043C\u0432\u043E\u043B",few:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",many:"\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u0430",many:"\u0431\u0430\u0439\u0442"},verb:"\u0438\u043C\u0435\u0442\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"}};function e(r){return t[r]??null}let n={regex:"\u0432\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u044F",duration:"ISO \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64",base64url:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64url",json_string:"JSON \u0441\u0442\u0440\u043E\u043A\u0430",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"},o={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0441\u0438\u0432"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=x(r.input),c=o[a]??a;return/^[A-Z]/.test(r.expected)?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C instanceof ${r.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${c}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${i}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${c}`}case"invalid_value":return r.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${k(r.values[0])}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0434\u043D\u043E \u0438\u0437 ${_(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=e(r.origin);if(a){let c=Number(r.maximum),u=Db(c,a.unit.one,a.unit.few,a.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${i}${r.maximum.toString()} ${u}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=e(r.origin);if(a){let c=Number(r.minimum),u=Db(c,a.unit.one,a.unit.few,a.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${r.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${i}${r.minimum.toString()} ${u}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${r.origin} \u0431\u0443\u0434\u0435\u0442 ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0442\u044C\u0441\u044F \u0441 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${n[i.format]??r.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${r.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${r.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${r.keys.length>1?"\u0438":""}: ${_(r.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${r.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435";case"invalid_element":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432 ${r.origin}`;default:return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"}}};function jb(){return{localeError:bO()}}var kO=()=>{let t={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function e(r){return t[r]??null}let n={regex:"vnos",email:"e-po\u0161tni 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 \u010Das",date:"ISO datum",time:"ISO \u010Das",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 \u0161tevilka",jwt:"JWT",template_literal:"vnos"},o={nan:"NaN",number:"\u0161tevilo",array:"tabela"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=x(r.input),c=o[a]??a;return/^[A-Z]/.test(r.expected)?`Neveljaven vnos: pri\u010Dakovano instanceof ${r.expected}, prejeto ${c}`:`Neveljaven vnos: pri\u010Dakovano ${i}, prejeto ${c}`}case"invalid_value":return r.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${k(r.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${_(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=e(r.origin);return a?`Preveliko: pri\u010Dakovano, da bo ${r.origin??"vrednost"} imelo ${i}${r.maximum.toString()} ${a.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${r.origin??"vrednost"} ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=e(r.origin);return a?`Premajhno: pri\u010Dakovano, da bo ${r.origin} imelo ${i}${r.minimum.toString()} ${a.unit}`:`Premajhno: pri\u010Dakovano, da bo ${r.origin} ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${i.prefix}"`:i.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${i.suffix}"`:i.format==="includes"?`Neveljaven niz: mora vsebovati "${i.includes}"`:i.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${i.pattern}`:`Neveljaven ${n[i.format]??r.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${r.divisor}`;case"unrecognized_keys":return`Neprepoznan${r.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${_(r.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${r.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${r.origin}`;default:return"Neveljaven vnos"}}};function Ub(){return{localeError:kO()}}var xO=()=>{let t={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att inneh\xE5lla"},set:{unit:"objekt",verb:"att inneh\xE5lla"}};function e(r){return t[r]??null}let n={regex:"regulj\xE4rt 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\xE4ng",base64url:"base64url-kodad str\xE4ng",json_string:"JSON-str\xE4ng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"},o={nan:"NaN",number:"antal",array:"lista"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=x(r.input),c=o[a]??a;return/^[A-Z]/.test(r.expected)?`Ogiltig inmatning: f\xF6rv\xE4ntat instanceof ${r.expected}, fick ${c}`:`Ogiltig inmatning: f\xF6rv\xE4ntat ${i}, fick ${c}`}case"invalid_value":return r.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${k(r.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${_(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=e(r.origin);return a?`F\xF6r stor(t): f\xF6rv\xE4ntade ${r.origin??"v\xE4rdet"} att ha ${i}${r.maximum.toString()} ${a.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${r.origin??"v\xE4rdet"} att ha ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=e(r.origin);return a?`F\xF6r lite(t): f\xF6rv\xE4ntade ${r.origin??"v\xE4rdet"} att ha ${i}${r.minimum.toString()} ${a.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${r.origin??"v\xE4rdet"} att ha ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${i.prefix}"`:i.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${i.suffix}"`:i.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${i.includes}"`:i.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${i.pattern}"`:`Ogiltig(t) ${n[i.format]??r.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${_(r.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${r.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${r.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}};function Lb(){return{localeError:xO()}}var SO=()=>{let t={string:{unit:"\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},file:{unit:"\u0BAA\u0BC8\u0B9F\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},array:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},set:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"}};function e(r){return t[r]??null}let n={regex:"\u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1",email:"\u0BAE\u0BBF\u0BA9\u0BCD\u0BA9\u0B9E\u0BCD\u0B9A\u0BB2\u0BCD \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",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 \u0BA4\u0BC7\u0BA4\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",date:"ISO \u0BA4\u0BC7\u0BA4\u0BBF",time:"ISO \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",duration:"ISO \u0B95\u0BBE\u0BB2 \u0B85\u0BB3\u0BB5\u0BC1",ipv4:"IPv4 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",ipv6:"IPv6 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",cidrv4:"IPv4 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",cidrv6:"IPv6 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",base64:"base64-encoded \u0B9A\u0BB0\u0BAE\u0BCD",base64url:"base64url-encoded \u0B9A\u0BB0\u0BAE\u0BCD",json_string:"JSON \u0B9A\u0BB0\u0BAE\u0BCD",e164:"E.164 \u0B8E\u0BA3\u0BCD",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"\u0B8E\u0BA3\u0BCD",array:"\u0B85\u0BA3\u0BBF",null:"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=x(r.input),c=o[a]??a;return/^[A-Z]/.test(r.expected)?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 instanceof ${r.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${c}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${i}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${c}`}case"invalid_value":return r.values.length===1?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${k(r.values[0])}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0BAE\u0BCD: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${_(r.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let i=r.inclusive?"<=":"<",a=e(r.origin);return a?`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${r.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${i}${r.maximum.toString()} ${a.unit??"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${r.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${i}${r.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let i=r.inclusive?">=":">",a=e(r.origin);return a?`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${r.origin} ${i}${r.minimum.toString()} ${a.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${r.origin} ${i}${r.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${i.pattern} \u0BAE\u0BC1\u0BB1\u0BC8\u0BAA\u0BBE\u0B9F\u0BCD\u0B9F\u0BC1\u0B9F\u0BA9\u0BCD \u0BAA\u0BCA\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${n[i.format]??r.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${r.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;case"unrecognized_keys":return`\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${r.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${_(r.keys,", ")}`;case"invalid_key":return`${r.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0B9A\u0BC8`;case"invalid_union":return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1";case"invalid_element":return`${r.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1`;default:return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1"}}};function Mb(){return{localeError:SO()}}var $O=()=>{let t={string:{unit:"\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},file:{unit:"\u0E44\u0E1A\u0E15\u0E4C",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},array:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},set:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"}};function e(r){return t[r]??null}let n={regex:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",email:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",url:"URL",emoji:"\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",date:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",time:"\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",duration:"\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",ipv4:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",ipv6:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",cidrv4:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",cidrv6:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",base64:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",base64url:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",json_string:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",e164:"\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",jwt:"\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",template_literal:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"},o={nan:"NaN",number:"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02",array:"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)",null:"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=x(r.input),c=o[a]??a;return/^[A-Z]/.test(r.expected)?`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 instanceof ${r.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${c}`:`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${i} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${c}`}case"invalid_value":return r.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${k(r.values[0])}`:`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ${_(r.values,"|")}`;case"too_big":{let i=r.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",a=e(r.origin);return a?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${r.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${r.maximum.toString()} ${a.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${r.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",a=e(r.origin);return a?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${r.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${r.minimum.toString()} ${a.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${r.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22 "${i.prefix}"`:i.format==="ends_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22 "${i.suffix}"`:i.format==="includes"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 "${i.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:i.format==="regex"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14 ${i.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${n[i.format]??r.format}`}case"not_multiple_of":return`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${r.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`;case"unrecognized_keys":return`\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${_(r.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${r.origin}`;case"invalid_union":return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E44\u0E21\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E22\u0E39\u0E40\u0E19\u0E35\u0E22\u0E19\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E44\u0E27\u0E49";case"invalid_element":return`\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${r.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}};function Zb(){return{localeError:$O()}}var IO=()=>{let t={string:{unit:"karakter",verb:"olmal\u0131"},file:{unit:"bayt",verb:"olmal\u0131"},array:{unit:"\xF6\u011Fe",verb:"olmal\u0131"},set:{unit:"\xF6\u011Fe",verb:"olmal\u0131"}};function e(r){return t[r]??null}let n={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\xFCre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aral\u0131\u011F\u0131",cidrv6:"IPv6 aral\u0131\u011F\u0131",base64:"base64 ile \u015Fifrelenmi\u015F metin",base64url:"base64url ile \u015Fifrelenmi\u015F metin",json_string:"JSON dizesi",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"\u015Eablon dizesi"},o={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=x(r.input),c=o[a]??a;return/^[A-Z]/.test(r.expected)?`Ge\xE7ersiz de\u011Fer: beklenen instanceof ${r.expected}, al\u0131nan ${c}`:`Ge\xE7ersiz de\u011Fer: beklenen ${i}, al\u0131nan ${c}`}case"invalid_value":return r.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${k(r.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${_(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=e(r.origin);return a?`\xC7ok b\xFCy\xFCk: beklenen ${r.origin??"de\u011Fer"} ${i}${r.maximum.toString()} ${a.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${r.origin??"de\u011Fer"} ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=e(r.origin);return a?`\xC7ok k\xFC\xE7\xFCk: beklenen ${r.origin} ${i}${r.minimum.toString()} ${a.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${r.origin} ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Ge\xE7ersiz metin: "${i.prefix}" ile ba\u015Flamal\u0131`:i.format==="ends_with"?`Ge\xE7ersiz metin: "${i.suffix}" ile bitmeli`:i.format==="includes"?`Ge\xE7ersiz metin: "${i.includes}" i\xE7ermeli`:i.format==="regex"?`Ge\xE7ersiz metin: ${i.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${n[i.format]??r.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${r.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${r.keys.length>1?"lar":""}: ${_(r.keys,", ")}`;case"invalid_key":return`${r.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${r.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}};function Fb(){return{localeError:IO()}}var wO=()=>{let t={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},file:{unit:"\u0431\u0430\u0439\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"}};function e(r){return t[r]??null}let n={regex:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0457 \u043F\u043E\u0448\u0442\u0438",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0434\u0430\u0442\u0430 \u0442\u0430 \u0447\u0430\u0441 ISO",date:"\u0434\u0430\u0442\u0430 ISO",time:"\u0447\u0430\u0441 ISO",duration:"\u0442\u0440\u0438\u0432\u0430\u043B\u0456\u0441\u0442\u044C ISO",ipv4:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv4",ipv6:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv6",cidrv4:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv4",cidrv6:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv6",base64:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64",base64url:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64url",json_string:"\u0440\u044F\u0434\u043E\u043A JSON",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"},o={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=x(r.input),c=o[a]??a;return/^[A-Z]/.test(r.expected)?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F instanceof ${r.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${c}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${i}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${c}`}case"invalid_value":return r.values.length===1?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${k(r.values[0])}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430 \u043E\u043F\u0446\u0456\u044F: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u043D\u0435 \u0437 ${_(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=e(r.origin);return a?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${a.verb} ${i}${r.maximum.toString()} ${a.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=e(r.origin);return a?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${r.origin} ${a.verb} ${i}${r.minimum.toString()} ${a.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${r.origin} \u0431\u0443\u0434\u0435 ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043F\u043E\u0447\u0438\u043D\u0430\u0442\u0438\u0441\u044F \u0437 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0437\u0430\u043A\u0456\u043D\u0447\u0443\u0432\u0430\u0442\u0438\u0441\u044F \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043C\u0456\u0441\u0442\u0438\u0442\u0438 "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${n[i.format]??r.format}`}case"not_multiple_of":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${r.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${r.keys.length>1?"\u0456":""}: ${_(r.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${r.origin}`;case"invalid_union":return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456";case"invalid_element":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0443 ${r.origin}`;default:return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"}}};function Xc(){return{localeError:wO()}}function Vb(){return Xc()}var EO=()=>{let t={string:{unit:"\u062D\u0631\u0648\u0641",verb:"\u06C1\u0648\u0646\u0627"},file:{unit:"\u0628\u0627\u0626\u0679\u0633",verb:"\u06C1\u0648\u0646\u0627"},array:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"},set:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"}};function e(r){return t[r]??null}let n={regex:"\u0627\u0646 \u067E\u0679",email:"\u0627\u06CC \u0645\u06CC\u0644 \u0627\u06CC\u0688\u0631\u06CC\u0633",url:"\u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",uuidv4:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 4",uuidv6:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 6",nanoid:"\u0646\u06CC\u0646\u0648 \u0622\u0626\u06CC \u0688\u06CC",guid:"\u062C\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid2:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC 2",ulid:"\u06CC\u0648 \u0627\u06CC\u0644 \u0622\u0626\u06CC \u0688\u06CC",xid:"\u0627\u06CC\u06A9\u0633 \u0622\u0626\u06CC \u0688\u06CC",ksuid:"\u06A9\u06D2 \u0627\u06CC\u0633 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",datetime:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0688\u06CC\u0679 \u0679\u0627\u0626\u0645",date:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u062A\u0627\u0631\u06CC\u062E",time:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0648\u0642\u062A",duration:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0645\u062F\u062A",ipv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0627\u06CC\u0688\u0631\u06CC\u0633",ipv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0627\u06CC\u0688\u0631\u06CC\u0633",cidrv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0631\u06CC\u0646\u062C",cidrv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0631\u06CC\u0646\u062C",base64:"\u0628\u06CC\u0633 64 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",base64url:"\u0628\u06CC\u0633 64 \u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",json_string:"\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",e164:"\u0627\u06CC 164 \u0646\u0645\u0628\u0631",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"},o={nan:"NaN",number:"\u0646\u0645\u0628\u0631",array:"\u0622\u0631\u06D2",null:"\u0646\u0644"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=x(r.input),c=o[a]??a;return/^[A-Z]/.test(r.expected)?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: instanceof ${r.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${c} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`:`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${i} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${c} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`}case"invalid_value":return r.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${k(r.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${_(r.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let i=r.inclusive?"<=":"<",a=e(r.origin);return a?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${r.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${i}${r.maximum.toString()} ${a.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${r.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${i}${r.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let i=r.inclusive?">=":">",a=e(r.origin);return a?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${r.origin} \u06A9\u06D2 ${i}${r.minimum.toString()} ${a.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${r.origin} \u06A9\u0627 ${i}${r.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${i.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${n[i.format]??r.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${r.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;case"unrecognized_keys":return`\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${r.keys.length>1?"\u0632":""}: ${_(r.keys,"\u060C ")}`;case"invalid_key":return`${r.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${r.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}};function qb(){return{localeError:EO()}}var TO=()=>{let t={string:{unit:"belgi",verb:"bo\u2018lishi kerak"},file:{unit:"bayt",verb:"bo\u2018lishi kerak"},array:{unit:"element",verb:"bo\u2018lishi kerak"},set:{unit:"element",verb:"bo\u2018lishi kerak"},map:{unit:"yozuv",verb:"bo\u2018lishi kerak"}};function e(r){return t[r]??null}let n={regex:"kirish",email:"elektron pochta manzili",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 sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",jwt:"JWT",template_literal:"kirish"},o={nan:"NaN",number:"raqam",array:"massiv"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=x(r.input),c=o[a]??a;return/^[A-Z]/.test(r.expected)?`Noto\u2018g\u2018ri kirish: kutilgan instanceof ${r.expected}, qabul qilingan ${c}`:`Noto\u2018g\u2018ri kirish: kutilgan ${i}, qabul qilingan ${c}`}case"invalid_value":return r.values.length===1?`Noto\u2018g\u2018ri kirish: kutilgan ${k(r.values[0])}`:`Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${_(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=e(r.origin);return a?`Juda katta: kutilgan ${r.origin??"qiymat"} ${i}${r.maximum.toString()} ${a.unit} ${a.verb}`:`Juda katta: kutilgan ${r.origin??"qiymat"} ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=e(r.origin);return a?`Juda kichik: kutilgan ${r.origin} ${i}${r.minimum.toString()} ${a.unit} ${a.verb}`:`Juda kichik: kutilgan ${r.origin} ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Noto\u2018g\u2018ri satr: "${i.prefix}" bilan boshlanishi kerak`:i.format==="ends_with"?`Noto\u2018g\u2018ri satr: "${i.suffix}" bilan tugashi kerak`:i.format==="includes"?`Noto\u2018g\u2018ri satr: "${i.includes}" ni o\u2018z ichiga olishi kerak`:i.format==="regex"?`Noto\u2018g\u2018ri satr: ${i.pattern} shabloniga mos kelishi kerak`:`Noto\u2018g\u2018ri ${n[i.format]??r.format}`}case"not_multiple_of":return`Noto\u2018g\u2018ri raqam: ${r.divisor} ning karralisi bo\u2018lishi kerak`;case"unrecognized_keys":return`Noma\u2019lum kalit${r.keys.length>1?"lar":""}: ${_(r.keys,", ")}`;case"invalid_key":return`${r.origin} dagi kalit noto\u2018g\u2018ri`;case"invalid_union":return"Noto\u2018g\u2018ri kirish";case"invalid_element":return`${r.origin} da noto\u2018g\u2018ri qiymat`;default:return"Noto\u2018g\u2018ri kirish"}}};function Bb(){return{localeError:TO()}}var PO=()=>{let t={string:{unit:"k\xFD t\u1EF1",verb:"c\xF3"},file:{unit:"byte",verb:"c\xF3"},array:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"},set:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"}};function e(r){return t[r]??null}let n={regex:"\u0111\u1EA7u v\xE0o",email:"\u0111\u1ECBa ch\u1EC9 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\xE0y gi\u1EDD ISO",date:"ng\xE0y ISO",time:"gi\u1EDD ISO",duration:"kho\u1EA3ng th\u1EDDi gian ISO",ipv4:"\u0111\u1ECBa ch\u1EC9 IPv4",ipv6:"\u0111\u1ECBa ch\u1EC9 IPv6",cidrv4:"d\u1EA3i IPv4",cidrv6:"d\u1EA3i IPv6",base64:"chu\u1ED7i m\xE3 h\xF3a base64",base64url:"chu\u1ED7i m\xE3 h\xF3a base64url",json_string:"chu\u1ED7i JSON",e164:"s\u1ED1 E.164",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"},o={nan:"NaN",number:"s\u1ED1",array:"m\u1EA3ng"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=x(r.input),c=o[a]??a;return/^[A-Z]/.test(r.expected)?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i instanceof ${r.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${c}`:`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${i}, nh\u1EADn \u0111\u01B0\u1EE3c ${c}`}case"invalid_value":return r.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${k(r.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${_(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=e(r.origin);return a?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${r.origin??"gi\xE1 tr\u1ECB"} ${a.verb} ${i}${r.maximum.toString()} ${a.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${r.origin??"gi\xE1 tr\u1ECB"} ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=e(r.origin);return a?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${r.origin} ${a.verb} ${i}${r.minimum.toString()} ${a.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${r.origin} ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${i.prefix}"`:i.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${i.suffix}"`:i.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${i.includes}"`:i.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${i.pattern}`:`${n[i.format]??r.format} kh\xF4ng h\u1EE3p l\u1EC7`}case"not_multiple_of":return`S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${r.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${_(r.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${r.origin}`;case"invalid_union":return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7";case"invalid_element":return`Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7 trong ${r.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}};function Hb(){return{localeError:PO()}}var OO=()=>{let t={string:{unit:"\u5B57\u7B26",verb:"\u5305\u542B"},file:{unit:"\u5B57\u8282",verb:"\u5305\u542B"},array:{unit:"\u9879",verb:"\u5305\u542B"},set:{unit:"\u9879",verb:"\u5305\u542B"}};function e(r){return t[r]??null}let n={regex:"\u8F93\u5165",email:"\u7535\u5B50\u90AE\u4EF6",url:"URL",emoji:"\u8868\u60C5\u7B26\u53F7",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u671F\u65F6\u95F4",date:"ISO\u65E5\u671F",time:"ISO\u65F6\u95F4",duration:"ISO\u65F6\u957F",ipv4:"IPv4\u5730\u5740",ipv6:"IPv6\u5730\u5740",cidrv4:"IPv4\u7F51\u6BB5",cidrv6:"IPv6\u7F51\u6BB5",base64:"base64\u7F16\u7801\u5B57\u7B26\u4E32",base64url:"base64url\u7F16\u7801\u5B57\u7B26\u4E32",json_string:"JSON\u5B57\u7B26\u4E32",e164:"E.164\u53F7\u7801",jwt:"JWT",template_literal:"\u8F93\u5165"},o={nan:"NaN",number:"\u6570\u5B57",array:"\u6570\u7EC4",null:"\u7A7A\u503C(null)"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=x(r.input),c=o[a]??a;return/^[A-Z]/.test(r.expected)?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B instanceof ${r.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${c}`:`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${i}\uFF0C\u5B9E\u9645\u63A5\u6536 ${c}`}case"invalid_value":return r.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${k(r.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${_(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=e(r.origin);return a?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${r.origin??"\u503C"} ${i}${r.maximum.toString()} ${a.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${r.origin??"\u503C"} ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=e(r.origin);return a?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${r.origin} ${i}${r.minimum.toString()} ${a.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${r.origin} ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${i.prefix}" \u5F00\u5934`:i.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${i.suffix}" \u7ED3\u5C3E`:i.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${i.includes}"`:i.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${i.pattern}`:`\u65E0\u6548${n[i.format]??r.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${r.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${_(r.keys,", ")}`;case"invalid_key":return`${r.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${r.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}};function Kb(){return{localeError:OO()}}var RO=()=>{let t={string:{unit:"\u5B57\u5143",verb:"\u64C1\u6709"},file:{unit:"\u4F4D\u5143\u7D44",verb:"\u64C1\u6709"},array:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"},set:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"}};function e(r){return t[r]??null}let n={regex:"\u8F38\u5165",email:"\u90F5\u4EF6\u5730\u5740",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 \u65E5\u671F\u6642\u9593",date:"ISO \u65E5\u671F",time:"ISO \u6642\u9593",duration:"ISO \u671F\u9593",ipv4:"IPv4 \u4F4D\u5740",ipv6:"IPv6 \u4F4D\u5740",cidrv4:"IPv4 \u7BC4\u570D",cidrv6:"IPv6 \u7BC4\u570D",base64:"base64 \u7DE8\u78BC\u5B57\u4E32",base64url:"base64url \u7DE8\u78BC\u5B57\u4E32",json_string:"JSON \u5B57\u4E32",e164:"E.164 \u6578\u503C",jwt:"JWT",template_literal:"\u8F38\u5165"},o={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=x(r.input),c=o[a]??a;return/^[A-Z]/.test(r.expected)?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA instanceof ${r.expected}\uFF0C\u4F46\u6536\u5230 ${c}`:`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${i}\uFF0C\u4F46\u6536\u5230 ${c}`}case"invalid_value":return r.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${k(r.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${_(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=e(r.origin);return a?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${r.origin??"\u503C"} \u61C9\u70BA ${i}${r.maximum.toString()} ${a.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${r.origin??"\u503C"} \u61C9\u70BA ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=e(r.origin);return a?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${r.origin} \u61C9\u70BA ${i}${r.minimum.toString()} ${a.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${r.origin} \u61C9\u70BA ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${i.prefix}" \u958B\u982D`:i.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${i.suffix}" \u7D50\u5C3E`:i.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${i.includes}"`:i.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${i.pattern}`:`\u7121\u6548\u7684 ${n[i.format]??r.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${r.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${r.keys.length>1?"\u5011":""}\uFF1A${_(r.keys,"\u3001")}`;case"invalid_key":return`${r.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${r.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}};function Gb(){return{localeError:RO()}}var AO=()=>{let t={string:{unit:"\xE0mi",verb:"n\xED"},file:{unit:"bytes",verb:"n\xED"},array:{unit:"nkan",verb:"n\xED"},set:{unit:"nkan",verb:"n\xED"}};function e(r){return t[r]??null}let n={regex:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9",email:"\xE0d\xEDr\u1EB9\u0301s\xEC \xECm\u1EB9\u0301l\xEC",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:"\xE0k\xF3k\xF2 ISO",date:"\u1ECDj\u1ECD\u0301 ISO",time:"\xE0k\xF3k\xF2 ISO",duration:"\xE0k\xF3k\xF2 t\xF3 p\xE9 ISO",ipv4:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv4",ipv6:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv6",cidrv4:"\xE0gb\xE8gb\xE8 IPv4",cidrv6:"\xE0gb\xE8gb\xE8 IPv6",base64:"\u1ECD\u0300r\u1ECD\u0300 t\xED a k\u1ECD\u0301 n\xED base64",base64url:"\u1ECD\u0300r\u1ECD\u0300 base64url",json_string:"\u1ECD\u0300r\u1ECD\u0300 JSON",e164:"n\u1ECD\u0301mb\xE0 E.164",jwt:"JWT",template_literal:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9"},o={nan:"NaN",number:"n\u1ECD\u0301mb\xE0",array:"akop\u1ECD"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,a=x(r.input),c=o[a]??a;return/^[A-Z]/.test(r.expected)?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi instanceof ${r.expected}, \xE0m\u1ECD\u0300 a r\xED ${c}`:`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${i}, \xE0m\u1ECD\u0300 a r\xED ${c}`}case"invalid_value":return r.values.length===1?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${k(r.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${_(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=e(r.origin);return a?`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${r.origin??"iye"} ${a.verb} ${i}${r.maximum} ${a.unit}`:`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${i}${r.maximum}`}case"too_small":{let i=r.inclusive?">=":">",a=e(r.origin);return a?`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${r.origin} ${a.verb} ${i}${r.minimum} ${a.unit}`:`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${i}${r.minimum}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\u1EB9\u0300r\u1EB9\u0300 p\u1EB9\u0300l\xFA "${i.prefix}"`:i.format==="ends_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 par\xED p\u1EB9\u0300l\xFA "${i.suffix}"`:i.format==="includes"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 n\xED "${i.includes}"`:i.format==="regex"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\xE1 \xE0p\u1EB9\u1EB9r\u1EB9 mu ${i.pattern}`:`A\u1E63\xEC\u1E63e: ${n[i.format]??r.format}`}case"not_multiple_of":return`N\u1ECD\u0301mb\xE0 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 j\u1EB9\u0301 \xE8y\xE0 p\xEDp\xEDn ti ${r.divisor}`;case"unrecognized_keys":return`B\u1ECDt\xECn\xEC \xE0\xECm\u1ECD\u0300: ${_(r.keys,", ")}`;case"invalid_key":return`B\u1ECDt\xECn\xEC a\u1E63\xEC\u1E63e n\xEDn\xFA ${r.origin}`;case"invalid_union":return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e";case"invalid_element":return`Iye a\u1E63\xEC\u1E63e n\xEDn\xFA ${r.origin}`;default:return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e"}}};function Wb(){return{localeError:AO()}}var Jb,wm=Symbol("ZodOutput"),Em=Symbol("ZodInput"),Qc=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...n){let o=n[0];return this._map.set(e,o),o&&typeof o=="object"&&"id"in o&&this._idmap.set(o.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let n=this._map.get(e);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(e),this}get(e){let n=e._zod.parent;if(n){let o={...this.get(n)??{}};delete o.id;let r={...o,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function eu(){return new Qc}(Jb=globalThis).__zod_globalRegistry??(Jb.__zod_globalRegistry=eu());var Ce=globalThis.__zod_globalRegistry;function tu(t,e){return new t({type:"string",...I(e)})}function Tm(t,e){return new t({type:"string",coerce:!0,...I(e)})}function Ti(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...I(e)})}function Nn(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...I(e)})}function Pi(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...I(e)})}function Oi(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...I(e)})}function Ri(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...I(e)})}function Ai(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...I(e)})}function zn(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...I(e)})}function Ci(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...I(e)})}function Ni(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...I(e)})}function zi(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...I(e)})}function Di(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...I(e)})}function ji(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...I(e)})}function Ui(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...I(e)})}function Li(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...I(e)})}function Mi(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...I(e)})}function Zi(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...I(e)})}function ru(t,e){return new t({type:"string",format:"mac",check:"string_format",abort:!1,...I(e)})}function Fi(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...I(e)})}function Vi(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...I(e)})}function qi(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...I(e)})}function Bi(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...I(e)})}function Hi(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...I(e)})}function Ki(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...I(e)})}var Pm={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function Om(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...I(e)})}function Rm(t,e){return new t({type:"string",format:"date",check:"string_format",...I(e)})}function Am(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...I(e)})}function Cm(t,e){return new t({type:"string",format:"duration",check:"string_format",...I(e)})}function nu(t,e){return new t({type:"number",checks:[],...I(e)})}function Nm(t,e){return new t({type:"number",coerce:!0,checks:[],...I(e)})}function ou(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...I(e)})}function iu(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float32",...I(e)})}function au(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float64",...I(e)})}function su(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"int32",...I(e)})}function cu(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"uint32",...I(e)})}function uu(t,e){return new t({type:"boolean",...I(e)})}function zm(t,e){return new t({type:"boolean",coerce:!0,...I(e)})}function lu(t,e){return new t({type:"bigint",...I(e)})}function Dm(t,e){return new t({type:"bigint",coerce:!0,...I(e)})}function du(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...I(e)})}function pu(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...I(e)})}function mu(t,e){return new t({type:"symbol",...I(e)})}function fu(t,e){return new t({type:"undefined",...I(e)})}function hu(t,e){return new t({type:"null",...I(e)})}function gu(t){return new t({type:"any"})}function _u(t){return new t({type:"unknown"})}function yu(t,e){return new t({type:"never",...I(e)})}function vu(t,e){return new t({type:"void",...I(e)})}function bu(t,e){return new t({type:"date",...I(e)})}function jm(t,e){return new t({type:"date",coerce:!0,...I(e)})}function ku(t,e){return new t({type:"nan",...I(e)})}function Mt(t,e){return new Zs({check:"less_than",...I(e),value:t,inclusive:!1})}function dt(t,e){return new Zs({check:"less_than",...I(e),value:t,inclusive:!0})}function Zt(t,e){return new Fs({check:"greater_than",...I(e),value:t,inclusive:!1})}function Ge(t,e){return new Fs({check:"greater_than",...I(e),value:t,inclusive:!0})}function xu(t){return Zt(0,t)}function Su(t){return Mt(0,t)}function $u(t){return dt(0,t)}function Iu(t){return Ge(0,t)}function vr(t,e){return new Qp({check:"multiple_of",...I(e),value:t})}function br(t,e){return new rm({check:"max_size",...I(e),maximum:t})}function Ft(t,e){return new nm({check:"min_size",...I(e),minimum:t})}function Gr(t,e){return new om({check:"size_equals",...I(e),size:t})}function Wr(t,e){return new im({check:"max_length",...I(e),maximum:t})}function Xt(t,e){return new am({check:"min_length",...I(e),minimum:t})}function Jr(t,e){return new sm({check:"length_equals",...I(e),length:t})}function Dn(t,e){return new cm({check:"string_format",format:"regex",...I(e),pattern:t})}function jn(t){return new um({check:"string_format",format:"lowercase",...I(t)})}function Un(t){return new lm({check:"string_format",format:"uppercase",...I(t)})}function Ln(t,e){return new dm({check:"string_format",format:"includes",...I(e),includes:t})}function Mn(t,e){return new pm({check:"string_format",format:"starts_with",...I(e),prefix:t})}function Zn(t,e){return new mm({check:"string_format",format:"ends_with",...I(e),suffix:t})}function wu(t,e,n){return new fm({check:"property",property:t,schema:e,...I(n)})}function Fn(t,e){return new hm({check:"mime_type",mime:t,...I(e)})}function Et(t){return new gm({check:"overwrite",tx:t})}function Vn(t){return Et(e=>e.normalize(t))}function qn(){return Et(t=>t.trim())}function Bn(){return Et(t=>t.toLowerCase())}function Hn(){return Et(t=>t.toUpperCase())}function Kn(){return Et(t=>hp(t))}function Um(t,e,n){return new t({type:"array",element:e,...I(n)})}function NO(t,e,n){return new t({type:"union",options:e,...I(n)})}function zO(t,e,n){return new t({type:"union",options:e,inclusive:!1,...I(n)})}function DO(t,e,n,o){return new t({type:"union",options:n,discriminator:e,...I(o)})}function jO(t,e,n){return new t({type:"intersection",left:e,right:n})}function UO(t,e,n,o){let r=n instanceof B,i=r?o:n,a=r?n:null;return new t({type:"tuple",items:e,rest:a,...I(i)})}function LO(t,e,n,o){return new t({type:"record",keyType:e,valueType:n,...I(o)})}function MO(t,e,n,o){return new t({type:"map",keyType:e,valueType:n,...I(o)})}function ZO(t,e,n){return new t({type:"set",valueType:e,...I(n)})}function FO(t,e,n){let o=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new t({type:"enum",entries:o,...I(n)})}function VO(t,e,n){return new t({type:"enum",entries:e,...I(n)})}function qO(t,e,n){return new t({type:"literal",values:Array.isArray(e)?e:[e],...I(n)})}function Eu(t,e){return new t({type:"file",...I(e)})}function BO(t,e){return new t({type:"transform",transform:e})}function HO(t,e){return new t({type:"optional",innerType:e})}function KO(t,e){return new t({type:"nullable",innerType:e})}function GO(t,e,n){return new t({type:"default",innerType:e,get defaultValue(){return typeof n=="function"?n():Os(n)}})}function WO(t,e,n){return new t({type:"nonoptional",innerType:e,...I(n)})}function JO(t,e){return new t({type:"success",innerType:e})}function YO(t,e,n){return new t({type:"catch",innerType:e,catchValue:typeof n=="function"?n:()=>n})}function XO(t,e,n){return new t({type:"pipe",in:e,out:n})}function QO(t,e){return new t({type:"readonly",innerType:e})}function eR(t,e,n){return new t({type:"template_literal",parts:e,...I(n)})}function tR(t,e){return new t({type:"lazy",getter:e})}function rR(t,e){return new t({type:"promise",innerType:e})}function Tu(t,e,n){let o=I(n);return o.abort??(o.abort=!0),new t({type:"custom",check:"custom",fn:e,...o})}function Pu(t,e,n){return new t({type:"custom",check:"custom",fn:e,...I(n)})}function Ou(t,e){let n=Yb(o=>(o.addIssue=r=>{if(typeof r=="string")o.issues.push(Sn(r,o.value,n._zod.def));else{let i=r;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=o.value),i.inst??(i.inst=n),i.continue??(i.continue=!n._zod.def.abort),o.issues.push(Sn(i))}},t(o.value,o)),e);return n}function Yb(t,e){let n=new fe({check:"custom",...I(e)});return n._zod.check=t,n}function Ru(t){let e=new fe({check:"describe"});return e._zod.onattach=[n=>{let o=Ce.get(n)??{};Ce.add(n,{...o,description:t})}],e._zod.check=()=>{},e}function Au(t){let e=new fe({check:"meta"});return e._zod.onattach=[n=>{let o=Ce.get(n)??{};Ce.add(n,{...o,...t})}],e._zod.check=()=>{},e}function Cu(t,e){let n=I(e),o=n.truthy??["true","1","yes","on","y","enabled"],r=n.falsy??["false","0","no","off","n","disabled"];n.case!=="sensitive"&&(o=o.map(f=>typeof f=="string"?f.toLowerCase():f),r=r.map(f=>typeof f=="string"?f.toLowerCase():f));let i=new Set(o),a=new Set(r),c=t.Codec??Rn,u=t.Boolean??Pn,d=t.String??yr,l=new d({type:"string",error:n.error}),p=new u({type:"boolean",error:n.error}),m=new c({type:"pipe",in:l,out:p,transform:((f,g)=>{let v=f;return n.case!=="sensitive"&&(v=v.toLowerCase()),i.has(v)?!0:a.has(v)?!1:(g.issues.push({code:"invalid_value",expected:"stringbool",values:[...i,...a],input:g.value,inst:m,continue:!1}),{})}),reverseTransform:((f,g)=>f===!0?o[0]||"true":r[0]||"false"),error:n.error});return m}function Yr(t,e,n,o={}){let r=I(o),i={...I(o),check:"string_format",type:"string",format:e,fn:typeof n=="function"?n:c=>n.test(c),...r};return n instanceof RegExp&&(i.pattern=n),new t(i)}function kr(t){let e=t?.target??"draft-2020-12";return e==="draft-4"&&(e="draft-04"),e==="draft-7"&&(e="draft-07"),{processors:t.processors??{},metadataRegistry:t?.metadata??Ce,target:e,unrepresentable:t?.unrepresentable??"throw",override:t?.override??(()=>{}),io:t?.io??"output",counter:0,seen:new Map,cycles:t?.cycles??"ref",reused:t?.reused??"inline",external:t?.external??void 0}}function de(t,e,n={path:[],schemaPath:[]}){var o;let r=t._zod.def,i=e.seen.get(t);if(i)return i.count++,n.schemaPath.includes(t)&&(i.cycle=n.path),i.schema;let a={schema:{},count:1,cycle:void 0,path:n.path};e.seen.set(t,a);let c=t._zod.toJSONSchema?.();if(c)a.schema=c;else{let l={...n,schemaPath:[...n.schemaPath,t],path:n.path};if(t._zod.processJSONSchema)t._zod.processJSONSchema(e,a.schema,l);else{let m=a.schema,f=e.processors[r.type];if(!f)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${r.type}`);f(t,e,m,l)}let p=t._zod.parent;p&&(a.ref||(a.ref=p),de(p,e,l),e.seen.get(p).isParent=!0)}let u=e.metadataRegistry.get(t);return u&&Object.assign(a.schema,u),e.io==="input"&&We(t)&&(delete a.schema.examples,delete a.schema.default),e.io==="input"&&"_prefault"in a.schema&&((o=a.schema).default??(o.default=a.schema._prefault)),delete a.schema._prefault,e.seen.get(t).schema}function xr(t,e){let n=t.seen.get(e);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=new Map;for(let a of t.seen.entries()){let c=t.metadataRegistry.get(a[0])?.id;if(c){let u=o.get(c);if(u&&u!==a[0])throw new Error(`Duplicate schema id "${c}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(c,a[0])}}let r=a=>{let c=t.target==="draft-2020-12"?"$defs":"definitions";if(t.external){let p=t.external.registry.get(a[0])?.id,m=t.external.uri??(g=>g);if(p)return{ref:m(p)};let f=a[1].defId??a[1].schema.id??`schema${t.counter++}`;return a[1].defId=f,{defId:f,ref:`${m("__shared")}#/${c}/${f}`}}if(a[1]===n)return{ref:"#"};let d=`#/${c}/`,l=a[1].schema.id??`__schema${t.counter++}`;return{defId:l,ref:d+l}},i=a=>{if(a[1].schema.$ref)return;let c=a[1],{ref:u,defId:d}=r(a);c.def={...c.schema},d&&(c.defId=d);let l=c.schema;for(let p in l)delete l[p];l.$ref=u};if(t.cycles==="throw")for(let a of t.seen.entries()){let c=a[1];if(c.cycle)throw new Error(`Cycle detected: #/${c.cycle?.join("/")}/<root>
|
|
72
|
+
`)}f.write("payload.value = newResult;"),f.write("return payload;");let C=f.compile();return(z,j)=>C(m,z,j)},o,s=Vn,c=!qn.jitless,d=c&&mp.value,l=e.catchall,p;t._zod.parse=(m,f)=>{p??(p=i.value);let h=m.value;return s(h)?c&&d&&f?.async===!1&&f.jitless!==!0?(o||(o=r(e.shape)),m=o(m,f),l?iv([],h,m,f,p,t):m):n(m,f):(m.issues.push({expected:"object",code:"invalid_type",input:h,inst:t}),m)}});function Fy(t,e,n,i){for(let o of t)if(o.issues.length===0)return e.value=o.value,e;let r=t.filter(o=>!mn(o));return r.length===1?(e.value=r[0].value,r[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:n,errors:t.map(o=>o.issues.map(s=>Ke(s,i,Te())))}),e)}var Er=g("$ZodUnion",(t,e)=>{V.init(t,e),W(t._zod,"optin",()=>e.options.some(i=>i._zod.optin==="optional")?"optional":void 0),W(t._zod,"optout",()=>e.options.some(i=>i._zod.optout==="optional")?"optional":void 0),W(t._zod,"values",()=>{if(e.options.every(i=>i._zod.values))return new Set(e.options.flatMap(i=>Array.from(i._zod.values)))}),W(t._zod,"pattern",()=>{if(e.options.every(i=>i._zod.pattern)){let i=e.options.map(r=>r._zod.pattern);return new RegExp(`^(${i.map(r=>uo(r.source)).join("|")})$`)}});let n=e.options.length===1?e.options[0]._zod.run:null;t._zod.parse=(i,r)=>{if(n)return n(i,r);let o=!1,s=[];for(let c of e.options){let u=c._zod.run({value:i.value,issues:[]},r);if(u instanceof Promise)s.push(u),o=!0;else{if(u.issues.length===0)return u;s.push(u)}}return o?Promise.all(s).then(c=>Fy(c,i,t,r)):Fy(s,i,t,r)}});function By(t,e,n,i){let r=t.filter(o=>o.issues.length===0);return r.length===1?(e.value=r[0].value,e):(r.length===0?e.issues.push({code:"invalid_union",input:e.value,inst:n,errors:t.map(o=>o.issues.map(s=>Ke(s,i,Te())))}):e.issues.push({code:"invalid_union",input:e.value,inst:n,errors:[],inclusive:!1}),e)}var xc=g("$ZodXor",(t,e)=>{Er.init(t,e),e.inclusive=!1;let n=e.options.length===1?e.options[0]._zod.run:null;t._zod.parse=(i,r)=>{if(n)return n(i,r);let o=!1,s=[];for(let c of e.options){let u=c._zod.run({value:i.value,issues:[]},r);u instanceof Promise?(s.push(u),o=!0):s.push(u)}return o?Promise.all(s).then(c=>By(c,i,t,r)):By(s,i,t,r)}}),Sc=g("$ZodDiscriminatedUnion",(t,e)=>{e.inclusive=!1,Er.init(t,e);let n=t._zod.parse;W(t._zod,"propValues",()=>{let r={};for(let o of e.options){let s=o._zod.propValues;if(!s||Object.keys(s).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(o)}"`);for(let[c,u]of Object.entries(s)){r[c]||(r[c]=new Set);for(let d of u)r[c].add(d)}}return r});let i=yr(()=>{let r=e.options,o=new Map;for(let s of r){let c=s._zod.propValues?.[e.discriminator];if(!c||c.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(s)}"`);for(let u of c){if(o.has(u))throw new Error(`Duplicate discriminator value "${String(u)}"`);o.set(u,s)}}return o});t._zod.parse=(r,o)=>{let s=r.value;if(!Vn(s))return r.issues.push({code:"invalid_type",expected:"object",input:s,inst:t}),r;let c=i.value.get(s?.[e.discriminator]);return c?c._zod.run(r,o):e.unionFallback||o.direction==="backward"?n(r,o):(r.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,options:Array.from(i.value.keys()),input:s,path:[e.discriminator],inst:t}),r)}}),$c=g("$ZodIntersection",(t,e)=>{V.init(t,e),t._zod.parse=(n,i)=>{let r=n.value,o=e.left._zod.run({value:r,issues:[]},i),s=e.right._zod.run({value:r,issues:[]},i);return o instanceof Promise||s instanceof Promise?Promise.all([o,s]).then(([u,d])=>qy(n,u,d)):qy(n,o,s)}});function hm(t,e){if(t===e)return{valid:!0,data:t};if(t instanceof Date&&e instanceof Date&&+t==+e)return{valid:!0,data:t};if(pn(t)&&pn(e)){let n=Object.keys(e),i=Object.keys(t).filter(o=>n.indexOf(o)!==-1),r={...t,...e};for(let o of i){let s=hm(t[o],e[o]);if(!s.valid)return{valid:!1,mergeErrorPath:[o,...s.mergeErrorPath]};r[o]=s.data}return{valid:!0,data:r}}if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let i=0;i<t.length;i++){let r=t[i],o=e[i],s=hm(r,o);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};n.push(s.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function qy(t,e,n){let i=new Map,r;for(let c of e.issues)if(c.code==="unrecognized_keys"){r??(r=c);for(let u of c.keys)i.has(u)||i.set(u,{}),i.get(u).l=!0}else t.issues.push(c);for(let c of n.issues)if(c.code==="unrecognized_keys")for(let u of c.keys)i.has(u)||i.set(u,{}),i.get(u).r=!0;else t.issues.push(c);let o=[...i].filter(([,c])=>c.l&&c.r).map(([c])=>c);if(o.length&&r&&t.issues.push({...r,keys:o}),mn(t))return t;let s=hm(e.value,n.value);if(!s.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);return t.value=s.data,t}var xo=g("$ZodTuple",(t,e)=>{V.init(t,e);let n=e.items;t._zod.parse=(i,r)=>{let o=i.value;if(!Array.isArray(o))return i.issues.push({input:o,inst:t,expected:"tuple",code:"invalid_type"}),i;i.value=[];let s=[],c=Vy(n,"optin"),u=Vy(n,"optout");if(!e.rest){if(o.length<c)return i.issues.push({code:"too_small",minimum:c,inclusive:!0,input:o,inst:t,origin:"array"}),i;o.length>n.length&&i.issues.push({code:"too_big",maximum:n.length,inclusive:!0,input:o,inst:t,origin:"array"})}let d=new Array(n.length);for(let l=0;l<n.length;l++){let p=n[l]._zod.run({value:o[l],issues:[]},r);p instanceof Promise?s.push(p.then(m=>{d[l]=m})):d[l]=p}if(e.rest){let l=n.length-1,p=o.slice(n.length);for(let m of p){l++;let f=e.rest._zod.run({value:m,issues:[]},r);f instanceof Promise?s.push(f.then(h=>Hy(h,i,l))):Hy(f,i,l)}}return s.length?Promise.all(s).then(()=>Ky(d,i,n,o,u)):Ky(d,i,n,o,u)}});function Vy(t,e){for(let n=t.length-1;n>=0;n--)if(t[n]._zod[e]!=="optional")return n+1;return 0}function Hy(t,e,n){t.issues.length&&e.issues.push(...tt(n,t.issues)),e.value[n]=t.value}function Ky(t,e,n,i,r){for(let o=0;o<n.length;o++){let s=t[o],c=o<i.length;if(s.issues.length){if(!c&&o>=r){e.value.length=o;break}e.issues.push(...tt(o,s.issues))}e.value[o]=s.value}for(let o=e.value.length-1;o>=i.length&&(n[o]._zod.optout==="optional"&&e.value[o]===void 0);o--)e.value.length=o;return e}var Ic=g("$ZodRecord",(t,e)=>{V.init(t,e),t._zod.parse=(n,i)=>{let r=n.value;if(!pn(r))return n.issues.push({expected:"record",code:"invalid_type",input:r,inst:t}),n;let o=[],s=e.keyType._zod.values;if(s){n.value={};let c=new Set;for(let d of s)if(typeof d=="string"||typeof d=="number"||typeof d=="symbol"){c.add(typeof d=="number"?d.toString():d);let l=e.keyType._zod.run({value:d,issues:[]},i);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(l.issues.length){n.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(f=>Ke(f,i,Te())),input:d,path:[d],inst:t});continue}let p=l.value,m=e.valueType._zod.run({value:r[d],issues:[]},i);m instanceof Promise?o.push(m.then(f=>{f.issues.length&&n.issues.push(...tt(d,f.issues)),n.value[p]=f.value})):(m.issues.length&&n.issues.push(...tt(d,m.issues)),n.value[p]=m.value)}let u;for(let d in r)c.has(d)||(u=u??[],u.push(d));u&&u.length>0&&n.issues.push({code:"unrecognized_keys",input:r,inst:t,keys:u})}else{n.value={};for(let c of Reflect.ownKeys(r)){if(c==="__proto__"||!Object.prototype.propertyIsEnumerable.call(r,c))continue;let u=e.keyType._zod.run({value:c,issues:[]},i);if(u instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof c=="string"&&Da.test(c)&&u.issues.length){let p=e.keyType._zod.run({value:Number(c),issues:[]},i);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");p.issues.length===0&&(u=p)}if(u.issues.length){e.mode==="loose"?n.value[c]=r[c]:n.issues.push({code:"invalid_key",origin:"record",issues:u.issues.map(p=>Ke(p,i,Te())),input:c,path:[c],inst:t});continue}let l=e.valueType._zod.run({value:r[c],issues:[]},i);l instanceof Promise?o.push(l.then(p=>{p.issues.length&&n.issues.push(...tt(c,p.issues)),n.value[u.value]=p.value})):(l.issues.length&&n.issues.push(...tt(c,l.issues)),n.value[u.value]=l.value)}}return o.length?Promise.all(o).then(()=>n):n}}),wc=g("$ZodMap",(t,e)=>{V.init(t,e),t._zod.parse=(n,i)=>{let r=n.value;if(!(r instanceof Map))return n.issues.push({expected:"map",code:"invalid_type",input:r,inst:t}),n;let o=[];n.value=new Map;for(let[s,c]of r){let u=e.keyType._zod.run({value:s,issues:[]},i),d=e.valueType._zod.run({value:c,issues:[]},i);u instanceof Promise||d instanceof Promise?o.push(Promise.all([u,d]).then(([l,p])=>{Gy(l,p,n,s,r,t,i)})):Gy(u,d,n,s,r,t,i)}return o.length?Promise.all(o).then(()=>n):n}});function Gy(t,e,n,i,r,o,s){t.issues.length&&(lo.has(typeof i)?n.issues.push(...tt(i,t.issues)):n.issues.push({code:"invalid_key",origin:"map",input:r,inst:o,issues:t.issues.map(c=>Ke(c,s,Te()))})),e.issues.length&&(lo.has(typeof i)?n.issues.push(...tt(i,e.issues)):n.issues.push({origin:"map",code:"invalid_element",input:r,inst:o,key:i,issues:e.issues.map(c=>Ke(c,s,Te()))})),n.value.set(t.value,e.value)}var Ec=g("$ZodSet",(t,e)=>{V.init(t,e),t._zod.parse=(n,i)=>{let r=n.value;if(!(r instanceof Set))return n.issues.push({input:r,inst:t,expected:"set",code:"invalid_type"}),n;let o=[];n.value=new Set;for(let s of r){let c=e.valueType._zod.run({value:s,issues:[]},i);c instanceof Promise?o.push(c.then(u=>Wy(u,n))):Wy(c,n)}return o.length?Promise.all(o).then(()=>n):n}});function Wy(t,e){t.issues.length&&e.issues.push(...t.issues),e.value.add(t.value)}var Tc=g("$ZodEnum",(t,e)=>{V.init(t,e);let n=co(e.entries),i=new Set(n);t._zod.values=i,t._zod.pattern=new RegExp(`^(${n.filter(r=>lo.has(typeof r)).map(r=>typeof r=="string"?gt(r):r.toString()).join("|")})$`),t._zod.parse=(r,o)=>{let s=r.value;return i.has(s)||r.issues.push({code:"invalid_value",values:n,input:s,inst:t}),r}}),Rc=g("$ZodLiteral",(t,e)=>{if(V.init(t,e),e.values.length===0)throw new Error("Cannot create literal schema with no valid values");let n=new Set(e.values);t._zod.values=n,t._zod.pattern=new RegExp(`^(${e.values.map(i=>typeof i=="string"?gt(i):i?gt(i.toString()):String(i)).join("|")})$`),t._zod.parse=(i,r)=>{let o=i.value;return n.has(o)||i.issues.push({code:"invalid_value",values:e.values,input:o,inst:t}),i}}),Oc=g("$ZodFile",(t,e)=>{V.init(t,e),t._zod.parse=(n,i)=>{let r=n.value;return r instanceof File||n.issues.push({expected:"file",code:"invalid_type",input:r,inst:t}),n}}),Pc=g("$ZodTransform",(t,e)=>{V.init(t,e),t._zod.optin="optional",t._zod.parse=(n,i)=>{if(i.direction==="backward")throw new un(t.constructor.name);let r=e.transform(n.value,n);if(i.async)return(r instanceof Promise?r:Promise.resolve(r)).then(s=>(n.value=s,n.fallback=!0,n));if(r instanceof Promise)throw new wt;return n.value=r,n.fallback=!0,n}});function Jy(t,e){return e===void 0&&(t.issues.length||t.fallback)?{issues:[],value:void 0}:t}var So=g("$ZodOptional",(t,e)=>{V.init(t,e),t._zod.optin="optional",t._zod.optout="optional",W(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),W(t._zod,"pattern",()=>{let n=e.innerType._zod.pattern;return n?new RegExp(`^(${uo(n.source)})?$`):void 0}),t._zod.parse=(n,i)=>{if(e.innerType._zod.optin==="optional"){let r=n.value,o=e.innerType._zod.run(n,i);return o instanceof Promise?o.then(s=>Jy(s,r)):Jy(o,r)}return n.value===void 0?n:e.innerType._zod.run(n,i)}}),Ac=g("$ZodExactOptional",(t,e)=>{So.init(t,e),W(t._zod,"values",()=>e.innerType._zod.values),W(t._zod,"pattern",()=>e.innerType._zod.pattern),t._zod.parse=(n,i)=>e.innerType._zod.run(n,i)}),Nc=g("$ZodNullable",(t,e)=>{V.init(t,e),W(t._zod,"optin",()=>e.innerType._zod.optin),W(t._zod,"optout",()=>e.innerType._zod.optout),W(t._zod,"pattern",()=>{let n=e.innerType._zod.pattern;return n?new RegExp(`^(${uo(n.source)}|null)$`):void 0}),W(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),t._zod.parse=(n,i)=>n.value===null?n:e.innerType._zod.run(n,i)}),Cc=g("$ZodDefault",(t,e)=>{V.init(t,e),t._zod.optin="optional",W(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(n,i)=>{if(i.direction==="backward")return e.innerType._zod.run(n,i);if(n.value===void 0)return n.value=e.defaultValue,n;let r=e.innerType._zod.run(n,i);return r instanceof Promise?r.then(o=>Yy(o,e)):Yy(r,e)}});function Yy(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}var zc=g("$ZodPrefault",(t,e)=>{V.init(t,e),t._zod.optin="optional",W(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(n,i)=>(i.direction==="backward"||n.value===void 0&&(n.value=e.defaultValue),e.innerType._zod.run(n,i))}),Dc=g("$ZodNonOptional",(t,e)=>{V.init(t,e),W(t._zod,"values",()=>{let n=e.innerType._zod.values;return n?new Set([...n].filter(i=>i!==void 0)):void 0}),t._zod.parse=(n,i)=>{let r=e.innerType._zod.run(n,i);return r instanceof Promise?r.then(o=>Xy(o,t)):Xy(r,t)}});function Xy(t,e){return!t.issues.length&&t.value===void 0&&t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:e}),t}var jc=g("$ZodSuccess",(t,e)=>{V.init(t,e),t._zod.parse=(n,i)=>{if(i.direction==="backward")throw new un("ZodSuccess");let r=e.innerType._zod.run(n,i);return r instanceof Promise?r.then(o=>(n.value=o.issues.length===0,n)):(n.value=r.issues.length===0,n)}}),Uc=g("$ZodCatch",(t,e)=>{V.init(t,e),t._zod.optin="optional",W(t._zod,"optout",()=>e.innerType._zod.optout),W(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(n,i)=>{if(i.direction==="backward")return e.innerType._zod.run(n,i);let r=e.innerType._zod.run(n,i);return r instanceof Promise?r.then(o=>(n.value=o.value,o.issues.length&&(n.value=e.catchValue({...n,error:{issues:o.issues.map(s=>Ke(s,i,Te()))},input:n.value}),n.issues=[],n.fallback=!0),n)):(n.value=r.value,r.issues.length&&(n.value=e.catchValue({...n,error:{issues:r.issues.map(o=>Ke(o,i,Te()))},input:n.value}),n.issues=[],n.fallback=!0),n)}}),Mc=g("$ZodNaN",(t,e)=>{V.init(t,e),t._zod.parse=(n,i)=>((typeof n.value!="number"||!Number.isNaN(n.value))&&n.issues.push({input:n.value,inst:t,expected:"nan",code:"invalid_type"}),n)}),$o=g("$ZodPipe",(t,e)=>{V.init(t,e),W(t._zod,"values",()=>e.in._zod.values),W(t._zod,"optin",()=>e.in._zod.optin),W(t._zod,"optout",()=>e.out._zod.optout),W(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(n,i)=>{if(i.direction==="backward"){let o=e.out._zod.run(n,i);return o instanceof Promise?o.then(s=>Ma(s,e.in,i)):Ma(o,e.in,i)}let r=e.in._zod.run(n,i);return r instanceof Promise?r.then(o=>Ma(o,e.out,i)):Ma(r,e.out,i)}});function Ma(t,e,n){return t.issues.length?(t.aborted=!0,t):e._zod.run({value:t.value,issues:t.issues,fallback:t.fallback},n)}var Tr=g("$ZodCodec",(t,e)=>{V.init(t,e),W(t._zod,"values",()=>e.in._zod.values),W(t._zod,"optin",()=>e.in._zod.optin),W(t._zod,"optout",()=>e.out._zod.optout),W(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(n,i)=>{if((i.direction||"forward")==="forward"){let o=e.in._zod.run(n,i);return o instanceof Promise?o.then(s=>La(s,e,i)):La(o,e,i)}else{let o=e.out._zod.run(n,i);return o instanceof Promise?o.then(s=>La(s,e,i)):La(o,e,i)}}});function La(t,e,n){if(t.issues.length)return t.aborted=!0,t;if((n.direction||"forward")==="forward"){let r=e.transform(t.value,t);return r instanceof Promise?r.then(o=>Za(t,o,e.out,n)):Za(t,r,e.out,n)}else{let r=e.reverseTransform(t.value,t);return r instanceof Promise?r.then(o=>Za(t,o,e.in,n)):Za(t,r,e.in,n)}}function Za(t,e,n,i){return t.issues.length?(t.aborted=!0,t):n._zod.run({value:e,issues:t.issues},i)}var xm=g("$ZodPreprocess",(t,e)=>{$o.init(t,e)}),Lc=g("$ZodReadonly",(t,e)=>{V.init(t,e),W(t._zod,"propValues",()=>e.innerType._zod.propValues),W(t._zod,"values",()=>e.innerType._zod.values),W(t._zod,"optin",()=>e.innerType?._zod?.optin),W(t._zod,"optout",()=>e.innerType?._zod?.optout),t._zod.parse=(n,i)=>{if(i.direction==="backward")return e.innerType._zod.run(n,i);let r=e.innerType._zod.run(n,i);return r instanceof Promise?r.then(Qy):Qy(r)}});function Qy(t){return t.value=Object.freeze(t.value),t}var Zc=g("$ZodTemplateLiteral",(t,e)=>{V.init(t,e);let n=[];for(let i of e.parts)if(typeof i=="object"&&i!==null){if(!i._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...i._zod.traits].shift()}`);let r=i._zod.pattern instanceof RegExp?i._zod.pattern.source:i._zod.pattern;if(!r)throw new Error(`Invalid template literal part: ${i._zod.traits}`);let o=r.startsWith("^")?1:0,s=r.endsWith("$")?r.length-1:r.length;n.push(r.slice(o,s))}else if(i===null||fp.has(typeof i))n.push(gt(`${i}`));else throw new Error(`Invalid template literal part: ${i}`);t._zod.pattern=new RegExp(`^${n.join("")}$`),t._zod.parse=(i,r)=>typeof i.value!="string"?(i.issues.push({input:i.value,inst:t,expected:"string",code:"invalid_type"}),i):(t._zod.pattern.lastIndex=0,t._zod.pattern.test(i.value)||i.issues.push({input:i.value,inst:t,code:"invalid_format",format:e.format??"template_literal",pattern:t._zod.pattern.source}),i)}),Fc=g("$ZodFunction",(t,e)=>(V.init(t,e),t._def=e,t._zod.def=e,t.implement=n=>{if(typeof n!="function")throw new Error("implement() must be called with a function");return function(...i){let r=t._def.input?Hn(t._def.input,i):i,o=Reflect.apply(n,this,r);return t._def.output?Hn(t._def.output,o):o}},t.implementAsync=n=>{if(typeof n!="function")throw new Error("implementAsync() must be called with a function");return async function(...i){let r=t._def.input?await Kn(t._def.input,i):i,o=await Reflect.apply(n,this,r);return t._def.output?await Kn(t._def.output,o):o}},t._zod.parse=(n,i)=>typeof n.value!="function"?(n.issues.push({code:"invalid_type",expected:"function",input:n.value,inst:t}),n):(t._def.output&&t._def.output._zod.def.type==="promise"?n.value=t.implementAsync(n.value):n.value=t.implement(n.value),n),t.input=(...n)=>{let i=t.constructor;return Array.isArray(n[0])?new i({type:"function",input:new xo({type:"tuple",items:n[0],rest:n[1]}),output:t._def.output}):new i({type:"function",input:n[0],output:t._def.output})},t.output=n=>{let i=t.constructor;return new i({type:"function",input:t._def.input,output:n})},t)),Bc=g("$ZodPromise",(t,e)=>{V.init(t,e),t._zod.parse=(n,i)=>Promise.resolve(n.value).then(r=>e.innerType._zod.run({value:r,issues:[]},i))}),qc=g("$ZodLazy",(t,e)=>{V.init(t,e),W(t._zod,"innerType",()=>{let n=e;return n._cachedInner||(n._cachedInner=e.getter()),n._cachedInner}),W(t._zod,"pattern",()=>t._zod.innerType?._zod?.pattern),W(t._zod,"propValues",()=>t._zod.innerType?._zod?.propValues),W(t._zod,"optin",()=>t._zod.innerType?._zod?.optin??void 0),W(t._zod,"optout",()=>t._zod.innerType?._zod?.optout??void 0),t._zod.parse=(n,i)=>t._zod.innerType._zod.run(n,i)}),Vc=g("$ZodCustom",(t,e)=>{fe.init(t,e),V.init(t,e),t._zod.parse=(n,i)=>n,t._zod.check=n=>{let i=n.value,r=e.fn(i);if(r instanceof Promise)return r.then(o=>ev(o,n,i,t));ev(r,n,i,t)}});function ev(t,e,n,i){if(!t){let r={code:"custom",input:n,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(r.params=i._zod.def.params),e.issues.push(vr(r))}}var Or={};Jt(Or,{ar:()=>ov,az:()=>sv,be:()=>cv,bg:()=>uv,ca:()=>lv,cs:()=>dv,da:()=>pv,de:()=>mv,el:()=>fv,en:()=>Hc,eo:()=>hv,es:()=>gv,fa:()=>bv,fi:()=>_v,fr:()=>yv,frCA:()=>vv,he:()=>kv,hr:()=>xv,hu:()=>Sv,hy:()=>Iv,id:()=>wv,is:()=>Ev,it:()=>Tv,ja:()=>Rv,ka:()=>Ov,kh:()=>Pv,km:()=>Kc,ko:()=>Av,lt:()=>Cv,mk:()=>zv,ms:()=>Dv,nl:()=>jv,no:()=>Uv,ota:()=>Mv,pl:()=>Zv,ps:()=>Lv,pt:()=>Fv,ro:()=>Bv,ru:()=>Vv,sl:()=>Hv,sv:()=>Kv,ta:()=>Gv,th:()=>Wv,tr:()=>Jv,ua:()=>Yv,uk:()=>Gc,ur:()=>Xv,uz:()=>Qv,vi:()=>ek,yo:()=>rk,zhCN:()=>tk,zhTW:()=>nk});var O0=()=>{let t={string:{unit:"\u062D\u0631\u0641",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},file:{unit:"\u0628\u0627\u064A\u062A",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},array:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},set:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"}};function e(r){return t[r]??null}let n={regex:"\u0645\u062F\u062E\u0644",email:"\u0628\u0631\u064A\u062F \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",url:"\u0631\u0627\u0628\u0637",emoji:"\u0625\u064A\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u064A\u062E \u0648\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",date:"\u062A\u0627\u0631\u064A\u062E \u0628\u0645\u0639\u064A\u0627\u0631 ISO",time:"\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",duration:"\u0645\u062F\u0629 \u0628\u0645\u0639\u064A\u0627\u0631 ISO",ipv4:"\u0639\u0646\u0648\u0627\u0646 IPv4",ipv6:"\u0639\u0646\u0648\u0627\u0646 IPv6",cidrv4:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv4",cidrv6:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv6",base64:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64-encoded",base64url:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64url-encoded",json_string:"\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",e164:"\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 instanceof ${r.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${c}`:`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${o}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${c}`}case"invalid_value":return r.values.length===1?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${k(r.values[0])}`:`\u0627\u062E\u062A\u064A\u0627\u0631 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062A\u0648\u0642\u0639 \u0627\u0646\u062A\u0642\u0627\u0621 \u0623\u062D\u062F \u0647\u0630\u0647 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A: ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${r.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${o} ${r.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631"}`:`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${r.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${o} ${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${r.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${o} ${r.minimum.toString()} ${s.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${r.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${o} ${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${r.prefix}"`:o.format==="ends_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0646\u062A\u0647\u064A \u0628\u0640 "${o.suffix}"`:o.format==="includes"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0636\u0645\u0651\u064E\u0646 "${o.includes}"`:o.format==="regex"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0637\u0627\u0628\u0642 \u0627\u0644\u0646\u0645\u0637 ${o.pattern}`:`${n[o.format]??r.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`}case"not_multiple_of":return`\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${r.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${r.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${r.keys.length>1?"\u0629":""}: ${b(r.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${r.origin}`;case"invalid_union":return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644";case"invalid_element":return`\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${r.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}};function ov(){return{localeError:O0()}}var P0=()=>{let t={string:{unit:"simvol",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"element",verb:"olmal\u0131d\u0131r"},set:{unit:"element",verb:"olmal\u0131d\u0131r"}};function e(r){return t[r]??null}let n={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"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n instanceof ${r.expected}, daxil olan ${c}`:`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${o}, daxil olan ${c}`}case"invalid_value":return r.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${k(r.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${r.origin??"d\u0259y\u0259r"} ${o}${r.maximum.toString()} ${s.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${r.origin??"d\u0259y\u0259r"} ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${r.origin} ${o}${r.minimum.toString()} ${s.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${r.origin} ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${o.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:o.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${o.suffix}" il\u0259 bitm\u0259lidir`:o.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${o.includes}" daxil olmal\u0131d\u0131r`:o.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${o.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${n[o.format]??r.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${r.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${r.keys.length>1?"lar":""}: ${b(r.keys,", ")}`;case"invalid_key":return`${r.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${r.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}};function sv(){return{localeError:P0()}}function av(t,e,n,i){let r=Math.abs(t),o=r%10,s=r%100;return s>=11&&s<=19?i:o===1?e:o>=2&&o<=4?n:i}var A0=()=>{let t={string:{unit:{one:"\u0441\u0456\u043C\u0432\u0430\u043B",few:"\u0441\u0456\u043C\u0432\u0430\u043B\u044B",many:"\u0441\u0456\u043C\u0432\u0430\u043B\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u044B",many:"\u0431\u0430\u0439\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"}};function e(r){return t[r]??null}let n={regex:"\u0443\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0430\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0456 \u0447\u0430\u0441",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0447\u0430\u0441",duration:"ISO \u043F\u0440\u0430\u0446\u044F\u0433\u043B\u0430\u0441\u0446\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0430\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0430\u0441",cidrv4:"IPv4 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",base64:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64",base64url:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64url",json_string:"JSON \u0440\u0430\u0434\u043E\u043A",e164:"\u043D\u0443\u043C\u0430\u0440 E.164",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"},i={nan:"NaN",number:"\u043B\u0456\u043A",array:"\u043C\u0430\u0441\u0456\u045E"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F instanceof ${r.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${c}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${o}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${c}`}case"invalid_value":return r.values.length===1?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${k(r.values[0])}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0432\u0430\u0440\u044B\u044F\u043D\u0442: \u0447\u0430\u043A\u0430\u045E\u0441\u044F \u0430\u0434\u0437\u0456\u043D \u0437 ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);if(s){let c=Number(r.maximum),u=av(c,s.unit.one,s.unit.few,s.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${s.verb} ${o}${r.maximum.toString()} ${u}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);if(s){let c=Number(r.minimum),u=av(c,s.unit.one,s.unit.few,s.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${r.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${s.verb} ${o}${r.minimum.toString()} ${u}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${r.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u043F\u0430\u0447\u044B\u043D\u0430\u0446\u0446\u0430 \u0437 "${o.prefix}"`:o.format==="ends_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u0430\u043A\u0430\u043D\u0447\u0432\u0430\u0446\u0446\u0430 \u043D\u0430 "${o.suffix}"`:o.format==="includes"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u043C\u044F\u0448\u0447\u0430\u0446\u044C "${o.includes}"`:o.format==="regex"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0430\u0434\u043F\u0430\u0432\u044F\u0434\u0430\u0446\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${o.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${n[o.format]??r.format}`}case"not_multiple_of":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${r.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${r.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${b(r.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${r.origin}`;case"invalid_union":return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434";case"invalid_element":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u0430\u0435 \u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435 \u045E ${r.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}};function cv(){return{localeError:A0()}}var N0=()=>{let t={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},file:{unit:"\u0431\u0430\u0439\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"}};function e(r){return t[r]??null}let n={regex:"\u0432\u0445\u043E\u0434",email:"\u0438\u043C\u0435\u0439\u043B \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0436\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u043F\u0440\u043E\u0434\u044A\u043B\u0436\u0438\u0442\u0435\u043B\u043D\u043E\u0441\u0442",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"base64-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",base64url:"base64url-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",json_string:"JSON \u043D\u0438\u0437",e164:"E.164 \u043D\u043E\u043C\u0435\u0440",jwt:"JWT",template_literal:"\u0432\u0445\u043E\u0434"},i={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D instanceof ${r.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${c}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${o}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${c}`}case"invalid_value":return r.values.length===1?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${k(r.values[0])}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u043E\u043F\u0446\u0438\u044F: \u043E\u0447\u0430\u043A\u0432\u0430\u043D\u043E \u0435\u0434\u043D\u043E \u043E\u0442 ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${r.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${o}${r.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430"}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${r.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0431\u044A\u0434\u0435 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${r.origin} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${o}${r.minimum.toString()} ${s.unit}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${r.origin} \u0434\u0430 \u0431\u044A\u0434\u0435 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;if(o.format==="starts_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u0432\u0430 \u0441 "${o.prefix}"`;if(o.format==="ends_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u0432\u044A\u0440\u0448\u0432\u0430 \u0441 "${o.suffix}"`;if(o.format==="includes")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0432\u043A\u043B\u044E\u0447\u0432\u0430 "${o.includes}"`;if(o.format==="regex")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0441\u044A\u0432\u043F\u0430\u0434\u0430 \u0441 ${o.pattern}`;let s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D";return o.format==="emoji"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="datetime"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="date"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),o.format==="time"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="duration"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),`${s} ${n[o.format]??r.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E \u0447\u0438\u0441\u043B\u043E: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0431\u044A\u0434\u0435 \u043A\u0440\u0430\u0442\u043D\u043E \u043D\u0430 ${r.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0437\u043F\u043E\u0437\u043D\u0430\u0442${r.keys.length>1?"\u0438":""} \u043A\u043B\u044E\u0447${r.keys.length>1?"\u043E\u0432\u0435":""}: ${b(r.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043A\u043B\u044E\u0447 \u0432 ${r.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434";case"invalid_element":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442 \u0432 ${r.origin}`;default:return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434"}}};function uv(){return{localeError:N0()}}var C0=()=>{let t={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function e(r){return t[r]??null}let n={regex:"entrada",email:"adre\xE7a electr\xF2nica",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\xE7a IPv4",ipv6:"adre\xE7a IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Tipus inv\xE0lid: s'esperava instanceof ${r.expected}, s'ha rebut ${c}`:`Tipus inv\xE0lid: s'esperava ${o}, s'ha rebut ${c}`}case"invalid_value":return r.values.length===1?`Valor inv\xE0lid: s'esperava ${k(r.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${b(r.values," o ")}`;case"too_big":{let o=r.inclusive?"com a m\xE0xim":"menys de",s=e(r.origin);return s?`Massa gran: s'esperava que ${r.origin??"el valor"} contingu\xE9s ${o} ${r.maximum.toString()} ${s.unit??"elements"}`:`Massa gran: s'esperava que ${r.origin??"el valor"} fos ${o} ${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?"com a m\xEDnim":"m\xE9s de",s=e(r.origin);return s?`Massa petit: s'esperava que ${r.origin} contingu\xE9s ${o} ${r.minimum.toString()} ${s.unit}`:`Massa petit: s'esperava que ${r.origin} fos ${o} ${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${o.prefix}"`:o.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${o.suffix}"`:o.format==="includes"?`Format inv\xE0lid: ha d'incloure "${o.includes}"`:o.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${o.pattern}`:`Format inv\xE0lid per a ${n[o.format]??r.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${r.divisor}`;case"unrecognized_keys":return`Clau${r.keys.length>1?"s":""} no reconeguda${r.keys.length>1?"s":""}: ${b(r.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${r.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${r.origin}`;default:return"Entrada inv\xE0lida"}}};function lv(){return{localeError:C0()}}var z0=()=>{let t={string:{unit:"znak\u016F",verb:"m\xEDt"},file:{unit:"bajt\u016F",verb:"m\xEDt"},array:{unit:"prvk\u016F",verb:"m\xEDt"},set:{unit:"prvk\u016F",verb:"m\xEDt"}};function e(r){return t[r]??null}let n={regex:"regul\xE1rn\xED v\xFDraz",email:"e-mailov\xE1 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 \u010Das ve form\xE1tu ISO",date:"datum ve form\xE1tu ISO",time:"\u010Das ve form\xE1tu ISO",duration:"doba trv\xE1n\xED ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64",base64url:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64url",json_string:"\u0159et\u011Bzec ve form\xE1tu JSON",e164:"\u010D\xEDslo E.164",jwt:"JWT",template_literal:"vstup"},i={nan:"NaN",number:"\u010D\xEDslo",string:"\u0159et\u011Bzec",function:"funkce",array:"pole"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no instanceof ${r.expected}, obdr\u017Eeno ${c}`:`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${o}, obdr\u017Eeno ${c}`}case"invalid_value":return r.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${k(r.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${r.origin??"hodnota"} mus\xED m\xEDt ${o}${r.maximum.toString()} ${s.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${r.origin??"hodnota"} mus\xED b\xFDt ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${r.origin??"hodnota"} mus\xED m\xEDt ${o}${r.minimum.toString()} ${s.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${r.origin??"hodnota"} mus\xED b\xFDt ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${o.prefix}"`:o.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${o.suffix}"`:o.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${o.includes}"`:o.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${o.pattern}`:`Neplatn\xFD form\xE1t ${n[o.format]??r.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${r.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${b(r.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${r.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${r.origin}`;default:return"Neplatn\xFD vstup"}}};function dv(){return{localeError:z0()}}var D0=()=>{let t={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function e(r){return t[r]??null}let n={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\xE6t",date:"ISO-dato",time:"ISO-klokkesl\xE6t",duration:"ISO-varighed",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",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"},i={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"s\xE6t",file:"fil"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Ugyldigt input: forventede instanceof ${r.expected}, fik ${c}`:`Ugyldigt input: forventede ${o}, fik ${c}`}case"invalid_value":return r.values.length===1?`Ugyldig v\xE6rdi: forventede ${k(r.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin),c=i[r.origin]??r.origin;return s?`For stor: forventede ${c??"value"} ${s.verb} ${o} ${r.maximum.toString()} ${s.unit??"elementer"}`:`For stor: forventede ${c??"value"} havde ${o} ${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin),c=i[r.origin]??r.origin;return s?`For lille: forventede ${c} ${s.verb} ${o} ${r.minimum.toString()} ${s.unit}`:`For lille: forventede ${c} havde ${o} ${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Ugyldig streng: skal starte med "${o.prefix}"`:o.format==="ends_with"?`Ugyldig streng: skal ende med "${o.suffix}"`:o.format==="includes"?`Ugyldig streng: skal indeholde "${o.includes}"`:o.format==="regex"?`Ugyldig streng: skal matche m\xF8nsteret ${o.pattern}`:`Ugyldig ${n[o.format]??r.format}`}case"not_multiple_of":return`Ugyldigt tal: skal v\xE6re deleligt med ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Ukendte n\xF8gler":"Ukendt n\xF8gle"}: ${b(r.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8gle i ${r.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig v\xE6rdi i ${r.origin}`;default:return"Ugyldigt input"}}};function pv(){return{localeError:D0()}}var j0=()=>{let t={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 e(r){return t[r]??null}let n={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"},i={nan:"NaN",number:"Zahl",array:"Array"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Ung\xFCltige Eingabe: erwartet instanceof ${r.expected}, erhalten ${c}`:`Ung\xFCltige Eingabe: erwartet ${o}, erhalten ${c}`}case"invalid_value":return r.values.length===1?`Ung\xFCltige Eingabe: erwartet ${k(r.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Zu gro\xDF: erwartet, dass ${r.origin??"Wert"} ${o}${r.maximum.toString()} ${s.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${r.origin??"Wert"} ${o}${r.maximum.toString()} ist`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Zu klein: erwartet, dass ${r.origin} ${o}${r.minimum.toString()} ${s.unit} hat`:`Zu klein: erwartet, dass ${r.origin} ${o}${r.minimum.toString()} ist`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Ung\xFCltiger String: muss mit "${o.prefix}" beginnen`:o.format==="ends_with"?`Ung\xFCltiger String: muss mit "${o.suffix}" enden`:o.format==="includes"?`Ung\xFCltiger String: muss "${o.includes}" enthalten`:o.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${o.pattern} entsprechen`:`Ung\xFCltig: ${n[o.format]??r.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${r.divisor} sein`;case"unrecognized_keys":return`${r.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${b(r.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${r.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${r.origin}`;default:return"Ung\xFCltige Eingabe"}}};function mv(){return{localeError:j0()}}var U0=()=>{let t={string:{unit:"\u03C7\u03B1\u03C1\u03B1\u03BA\u03C4\u03AE\u03C1\u03B5\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},file:{unit:"bytes",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},array:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},set:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},map:{unit:"\u03BA\u03B1\u03C4\u03B1\u03C7\u03C9\u03C1\u03AE\u03C3\u03B5\u03B9\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"}};function e(r){return t[r]??null}let n={regex:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2",email:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 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 \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1 \u03BA\u03B1\u03B9 \u03CE\u03C1\u03B1",date:"ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1",time:"ISO \u03CE\u03C1\u03B1",duration:"ISO \u03B4\u03B9\u03AC\u03C1\u03BA\u03B5\u03B9\u03B1",ipv4:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv4",ipv6:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv6",mac:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 MAC",cidrv4:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv4",cidrv6:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv6",base64:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64",base64url:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64url",json_string:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC JSON",e164:"\u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2 E.164",jwt:"JWT",template_literal:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return typeof r.expected=="string"&&/^[A-Z]/.test(r.expected)?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD instanceof ${r.expected}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${c}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${o}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${c}`}case"invalid_value":return r.values.length===1?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${k(r.values[0])}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03C0\u03B9\u03BB\u03BF\u03B3\u03AE: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD \u03AD\u03BD\u03B1 \u03B1\u03C0\u03CC ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${r.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${o}${r.maximum.toString()} ${s.unit??"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1"}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${r.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${r.origin} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${o}${r.minimum.toString()} ${s.unit}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${r.origin} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03BE\u03B5\u03BA\u03B9\u03BD\u03AC \u03BC\u03B5 "${o.prefix}"`:o.format==="ends_with"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B5\u03BB\u03B5\u03B9\u03CE\u03BD\u03B5\u03B9 \u03BC\u03B5 "${o.suffix}"`:o.format==="includes"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C0\u03B5\u03C1\u03B9\u03AD\u03C7\u03B5\u03B9 "${o.includes}"`:o.format==="regex"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B1\u03B9\u03C1\u03B9\u03AC\u03B6\u03B5\u03B9 \u03BC\u03B5 \u03C4\u03BF \u03BC\u03BF\u03C4\u03AF\u03B2\u03BF ${o.pattern}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF: ${n[o.format]??r.format}`}case"not_multiple_of":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF\u03C2 \u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 \u03C0\u03BF\u03BB\u03BB\u03B1\u03C0\u03BB\u03AC\u03C3\u03B9\u03BF \u03C4\u03BF\u03C5 ${r.divisor}`;case"unrecognized_keys":return`\u0386\u03B3\u03BD\u03C9\u03C3\u03C4${r.keys.length>1?"\u03B1":"\u03BF"} \u03BA\u03BB\u03B5\u03B9\u03B4${r.keys.length>1?"\u03B9\u03AC":"\u03AF"}: ${b(r.keys,", ")}`;case"invalid_key":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF \u03BA\u03BB\u03B5\u03B9\u03B4\u03AF \u03C3\u03C4\u03BF ${r.origin}`;case"invalid_union":return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2";case"invalid_element":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C4\u03B9\u03BC\u03AE \u03C3\u03C4\u03BF ${r.origin}`;default:return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"}}};function fv(){return{localeError:U0()}}var M0=()=>{let t={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function e(r){return t[r]??null}let n={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"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return`Invalid input: expected ${o}, received ${c}`}case"invalid_value":return r.values.length===1?`Invalid input: expected ${k(r.values[0])}`:`Invalid option: expected one of ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Too big: expected ${r.origin??"value"} to have ${o}${r.maximum.toString()} ${s.unit??"elements"}`:`Too big: expected ${r.origin??"value"} to be ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Too small: expected ${r.origin} to have ${o}${r.minimum.toString()} ${s.unit}`:`Too small: expected ${r.origin} to be ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Invalid string: must start with "${o.prefix}"`:o.format==="ends_with"?`Invalid string: must end with "${o.suffix}"`:o.format==="includes"?`Invalid string: must include "${o.includes}"`:o.format==="regex"?`Invalid string: must match pattern ${o.pattern}`:`Invalid ${n[o.format]??r.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${r.divisor}`;case"unrecognized_keys":return`Unrecognized key${r.keys.length>1?"s":""}: ${b(r.keys,", ")}`;case"invalid_key":return`Invalid key in ${r.origin}`;case"invalid_union":return r.options&&Array.isArray(r.options)&&r.options.length>0?`Invalid discriminator value. Expected ${r.options.map(s=>`'${s}'`).join(" | ")}`:"Invalid input";case"invalid_element":return`Invalid value in ${r.origin}`;default:return"Invalid input"}}};function Hc(){return{localeError:M0()}}var L0=()=>{let t={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function e(r){return t[r]??null}let n={regex:"enigo",email:"retadreso",url:"URL",emoji:"emo\u011Dio",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\u016Dro",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"},i={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Nevalida enigo: atendi\u011Dis instanceof ${r.expected}, ricevi\u011Dis ${c}`:`Nevalida enigo: atendi\u011Dis ${o}, ricevi\u011Dis ${c}`}case"invalid_value":return r.values.length===1?`Nevalida enigo: atendi\u011Dis ${k(r.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Tro granda: atendi\u011Dis ke ${r.origin??"valoro"} havu ${o}${r.maximum.toString()} ${s.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${r.origin??"valoro"} havu ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Tro malgranda: atendi\u011Dis ke ${r.origin} havu ${o}${r.minimum.toString()} ${s.unit}`:`Tro malgranda: atendi\u011Dis ke ${r.origin} estu ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${o.prefix}"`:o.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${o.suffix}"`:o.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${o.includes}"`:o.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${o.pattern}`:`Nevalida ${n[o.format]??r.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${r.divisor}`;case"unrecognized_keys":return`Nekonata${r.keys.length>1?"j":""} \u015Dlosilo${r.keys.length>1?"j":""}: ${b(r.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${r.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${r.origin}`;default:return"Nevalida enigo"}}};function hv(){return{localeError:L0()}}var Z0=()=>{let t={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function e(r){return t[r]??null}let n={regex:"entrada",email:"direcci\xF3n de correo electr\xF3nico",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\xF3n ISO",ipv4:"direcci\xF3n IPv4",ipv6:"direcci\xF3n IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},i={nan:"NaN",string:"texto",number:"n\xFAmero",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"n\xFAmero grande",symbol:"s\xEDmbolo",undefined:"indefinido",null:"nulo",function:"funci\xF3n",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeraci\xF3n",union:"uni\xF3n",literal:"literal",promise:"promesa",void:"vac\xEDo",never:"nunca",unknown:"desconocido",any:"cualquiera"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Entrada inv\xE1lida: se esperaba instanceof ${r.expected}, recibido ${c}`:`Entrada inv\xE1lida: se esperaba ${o}, recibido ${c}`}case"invalid_value":return r.values.length===1?`Entrada inv\xE1lida: se esperaba ${k(r.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin),c=i[r.origin]??r.origin;return s?`Demasiado grande: se esperaba que ${c??"valor"} tuviera ${o}${r.maximum.toString()} ${s.unit??"elementos"}`:`Demasiado grande: se esperaba que ${c??"valor"} fuera ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin),c=i[r.origin]??r.origin;return s?`Demasiado peque\xF1o: se esperaba que ${c} tuviera ${o}${r.minimum.toString()} ${s.unit}`:`Demasiado peque\xF1o: se esperaba que ${c} fuera ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${o.prefix}"`:o.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${o.suffix}"`:o.format==="includes"?`Cadena inv\xE1lida: debe incluir "${o.includes}"`:o.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${o.pattern}`:`Inv\xE1lido ${n[o.format]??r.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${r.divisor}`;case"unrecognized_keys":return`Llave${r.keys.length>1?"s":""} desconocida${r.keys.length>1?"s":""}: ${b(r.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${i[r.origin]??r.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${i[r.origin]??r.origin}`;default:return"Entrada inv\xE1lida"}}};function gv(){return{localeError:Z0()}}var F0=()=>{let t={string:{unit:"\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},array:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},set:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"}};function e(r){return t[r]??null}let n={regex:"\u0648\u0631\u0648\u062F\u06CC",email:"\u0622\u062F\u0631\u0633 \u0627\u06CC\u0645\u06CC\u0644",url:"URL",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u06CC\u062E \u0648 \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",date:"\u062A\u0627\u0631\u06CC\u062E \u0627\u06CC\u0632\u0648",time:"\u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",duration:"\u0645\u062F\u062A \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",ipv4:"IPv4 \u0622\u062F\u0631\u0633",ipv6:"IPv6 \u0622\u062F\u0631\u0633",cidrv4:"IPv4 \u062F\u0627\u0645\u0646\u0647",cidrv6:"IPv6 \u062F\u0627\u0645\u0646\u0647",base64:"base64-encoded \u0631\u0634\u062A\u0647",base64url:"base64url-encoded \u0631\u0634\u062A\u0647",json_string:"JSON \u0631\u0634\u062A\u0647",e164:"E.164 \u0639\u062F\u062F",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"},i={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0622\u0631\u0627\u06CC\u0647"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A instanceof ${r.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${c} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`:`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${o} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${c} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`}case"invalid_value":return r.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${k(r.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`:`\u06AF\u0632\u06CC\u0646\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A \u06CC\u06A9\u06CC \u0627\u0632 ${b(r.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${r.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${o}${r.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${r.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${o}${r.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${r.origin} \u0628\u0627\u06CC\u062F ${o}${r.minimum.toString()} ${s.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${r.origin} \u0628\u0627\u06CC\u062F ${o}${r.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${o.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:o.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${o.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:o.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${o.includes}" \u0628\u0627\u0634\u062F`:o.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${o.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${n[o.format]??r.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`}case"not_multiple_of":return`\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${r.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${r.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${b(r.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${r.origin}`;case"invalid_union":return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631";case"invalid_element":return`\u0645\u0642\u062F\u0627\u0631 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 ${r.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}};function bv(){return{localeError:F0()}}var B0=()=>{let t={string:{unit:"merkki\xE4",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\xE4iv\xE4m\xE4\xE4r\xE4n"}};function e(r){return t[r]??null}let n={regex:"s\xE4\xE4nn\xF6llinen lauseke",email:"s\xE4hk\xF6postiosoite",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\xE4iv\xE4m\xE4\xE4r\xE4",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"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Virheellinen tyyppi: odotettiin instanceof ${r.expected}, oli ${c}`:`Virheellinen tyyppi: odotettiin ${o}, oli ${c}`}case"invalid_value":return r.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${k(r.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Liian suuri: ${s.subject} t\xE4ytyy olla ${o}${r.maximum.toString()} ${s.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Liian pieni: ${s.subject} t\xE4ytyy olla ${o}${r.minimum.toString()} ${s.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${o.prefix}"`:o.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${o.suffix}"`:o.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${o.includes}"`:o.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${o.pattern}`:`Virheellinen ${n[o.format]??r.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${r.divisor} monikerta`;case"unrecognized_keys":return`${r.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${b(r.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\xF6te"}}};function _v(){return{localeError:B0()}}var q0=()=>{let t={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(r){return t[r]??null}let n={regex:"entr\xE9e",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\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},i={string:"cha\xEEne",number:"nombre",int:"entier",boolean:"bool\xE9en",bigint:"grand entier",symbol:"symbole",undefined:"ind\xE9fini",null:"null",never:"jamais",void:"vide",date:"date",array:"tableau",object:"objet",tuple:"tuple",record:"enregistrement",map:"carte",set:"ensemble",file:"fichier",nonoptional:"non-optionnel",nan:"NaN",function:"fonction"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Entr\xE9e invalide : instanceof ${r.expected} attendu, ${c} re\xE7u`:`Entr\xE9e invalide : ${o} attendu, ${c} re\xE7u`}case"invalid_value":return r.values.length===1?`Entr\xE9e invalide : ${k(r.values[0])} attendu`:`Option invalide : une valeur parmi ${b(r.values,"|")} attendue`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Trop grand : ${i[r.origin]??"valeur"} doit ${s.verb} ${o}${r.maximum.toString()} ${s.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${i[r.origin]??"valeur"} doit \xEAtre ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Trop petit : ${i[r.origin]??"valeur"} doit ${s.verb} ${o}${r.minimum.toString()} ${s.unit}`:`Trop petit : ${i[r.origin]??"valeur"} doit \xEAtre ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${o.prefix}"`:o.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${o.suffix}"`:o.format==="includes"?`Cha\xEEne invalide : doit inclure "${o.includes}"`:o.format==="regex"?`Cha\xEEne invalide : doit correspondre au mod\xE8le ${o.pattern}`:`${n[o.format]??r.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${r.divisor}`;case"unrecognized_keys":return`Cl\xE9${r.keys.length>1?"s":""} non reconnue${r.keys.length>1?"s":""} : ${b(r.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${r.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${r.origin}`;default:return"Entr\xE9e invalide"}}};function yv(){return{localeError:q0()}}var V0=()=>{let t={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(r){return t[r]??null}let n={regex:"entr\xE9e",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\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Entr\xE9e invalide : attendu instanceof ${r.expected}, re\xE7u ${c}`:`Entr\xE9e invalide : attendu ${o}, re\xE7u ${c}`}case"invalid_value":return r.values.length===1?`Entr\xE9e invalide : attendu ${k(r.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"\u2264":"<",s=e(r.origin);return s?`Trop grand : attendu que ${r.origin??"la valeur"} ait ${o}${r.maximum.toString()} ${s.unit}`:`Trop grand : attendu que ${r.origin??"la valeur"} soit ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?"\u2265":">",s=e(r.origin);return s?`Trop petit : attendu que ${r.origin} ait ${o}${r.minimum.toString()} ${s.unit}`:`Trop petit : attendu que ${r.origin} soit ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${o.prefix}"`:o.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${o.suffix}"`:o.format==="includes"?`Cha\xEEne invalide : doit inclure "${o.includes}"`:o.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${o.pattern}`:`${n[o.format]??r.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${r.divisor}`;case"unrecognized_keys":return`Cl\xE9${r.keys.length>1?"s":""} non reconnue${r.keys.length>1?"s":""} : ${b(r.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${r.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${r.origin}`;default:return"Entr\xE9e invalide"}}};function vv(){return{localeError:V0()}}var H0=()=>{let t={string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA",gender:"f"},number:{label:"\u05DE\u05E1\u05E4\u05E8",gender:"m"},boolean:{label:"\u05E2\u05E8\u05DA \u05D1\u05D5\u05DC\u05D9\u05D0\u05E0\u05D9",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA",gender:"m"},array:{label:"\u05DE\u05E2\u05E8\u05DA",gender:"m"},object:{label:"\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8",gender:"m"},null:{label:"\u05E2\u05E8\u05DA \u05E8\u05D9\u05E7 (null)",gender:"m"},undefined:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05DE\u05D5\u05D2\u05D3\u05E8 (undefined)",gender:"m"},symbol:{label:"\u05E1\u05D9\u05DE\u05D1\u05D5\u05DC (Symbol)",gender:"m"},function:{label:"\u05E4\u05D5\u05E0\u05E7\u05E6\u05D9\u05D4",gender:"f"},map:{label:"\u05DE\u05E4\u05D4 (Map)",gender:"f"},set:{label:"\u05E7\u05D1\u05D5\u05E6\u05D4 (Set)",gender:"f"},file:{label:"\u05E7\u05D5\u05D1\u05E5",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05D9\u05D3\u05D5\u05E2",gender:"m"},value:{label:"\u05E2\u05E8\u05DA",gender:"m"}},e={string:{unit:"\u05EA\u05D5\u05D5\u05D9\u05DD",shortLabel:"\u05E7\u05E6\u05E8",longLabel:"\u05D0\u05E8\u05D5\u05DA"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},number:{unit:"",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"}},n=d=>d?t[d]:void 0,i=d=>{let l=n(d);return l?l.label:d??t.unknown.label},r=d=>`\u05D4${i(d)}`,o=d=>(n(d)?.gender??"m")==="f"?"\u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA":"\u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA",s=d=>d?e[d]??null:null,c={regex:{label:"\u05E7\u05DC\u05D8",gender:"m"},email:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",gender:"f"},url:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",gender:"f"},emoji:{label:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",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:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",gender:"m"},time:{label:"\u05D6\u05DE\u05DF ISO",gender:"m"},duration:{label:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",gender:"m"},ipv4:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",gender:"f"},ipv6:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",gender:"f"},cidrv4:{label:"\u05D8\u05D5\u05D5\u05D7 IPv4",gender:"m"},cidrv6:{label:"\u05D8\u05D5\u05D5\u05D7 IPv6",gender:"m"},base64:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",gender:"f"},base64url:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",gender:"f"},json_string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",gender:"f"},e164:{label:"\u05DE\u05E1\u05E4\u05E8 E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},includes:{label:"\u05E7\u05DC\u05D8",gender:"m"},lowercase:{label:"\u05E7\u05DC\u05D8",gender:"m"},starts_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},uppercase:{label:"\u05E7\u05DC\u05D8",gender:"m"}},u={nan:"NaN"};return d=>{switch(d.code){case"invalid_type":{let l=d.expected,p=u[l??""]??i(l),m=x(d.input),f=u[m]??t[m]?.label??m;return/^[A-Z]/.test(d.expected)?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA instanceof ${d.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${f}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${p}, \u05D4\u05EA\u05E7\u05D1\u05DC ${f}`}case"invalid_value":{if(d.values.length===1)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05E2\u05E8\u05DA \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA ${k(d.values[0])}`;let l=d.values.map(f=>k(f));if(d.values.length===2)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${l[0]} \u05D0\u05D5 ${l[1]}`;let p=l[l.length-1];return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${l.slice(0,-1).join(", ")} \u05D0\u05D5 ${p}`}case"too_big":{let l=s(d.origin),p=r(d.origin??"value");if(d.origin==="string")return`${l?.longLabel??"\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${d.maximum.toString()} ${l?.unit??""} ${d.inclusive?"\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA":"\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim();if(d.origin==="number"){let h=d.inclusive?`\u05E7\u05D8\u05DF \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${d.maximum}`:`\u05E7\u05D8\u05DF \u05DE-${d.maximum}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${h}`}if(d.origin==="array"||d.origin==="set"){let h=d.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",y=d.inclusive?`${d.maximum} ${l?.unit??""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA`:`\u05E4\u05D7\u05D5\u05EA \u05DE-${d.maximum} ${l?.unit??""}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${p} ${h} \u05DC\u05D4\u05DB\u05D9\u05DC ${y}`.trim()}let m=d.inclusive?"<=":"<",f=o(d.origin??"value");return l?.unit?`${l.longLabel} \u05DE\u05D3\u05D9: ${p} ${f} ${m}${d.maximum.toString()} ${l.unit}`:`${l?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${p} ${f} ${m}${d.maximum.toString()}`}case"too_small":{let l=s(d.origin),p=r(d.origin??"value");if(d.origin==="string")return`${l?.shortLabel??"\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${d.minimum.toString()} ${l?.unit??""} ${d.inclusive?"\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8":"\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim();if(d.origin==="number"){let h=d.inclusive?`\u05D2\u05D3\u05D5\u05DC \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${d.minimum}`:`\u05D2\u05D3\u05D5\u05DC \u05DE-${d.minimum}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${h}`}if(d.origin==="array"||d.origin==="set"){let h=d.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA";if(d.minimum===1&&d.inclusive){let v=(d.origin==="set","\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3");return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${p} ${h} \u05DC\u05D4\u05DB\u05D9\u05DC ${v}`}let y=d.inclusive?`${d.minimum} ${l?.unit??""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8`:`\u05D9\u05D5\u05EA\u05E8 \u05DE-${d.minimum} ${l?.unit??""}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${p} ${h} \u05DC\u05D4\u05DB\u05D9\u05DC ${y}`.trim()}let m=d.inclusive?">=":">",f=o(d.origin??"value");return l?.unit?`${l.shortLabel} \u05DE\u05D3\u05D9: ${p} ${f} ${m}${d.minimum.toString()} ${l.unit}`:`${l?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${p} ${f} ${m}${d.minimum.toString()}`}case"invalid_format":{let l=d;if(l.format==="starts_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1 "${l.prefix}"`;if(l.format==="ends_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${l.suffix}"`;if(l.format==="includes")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${l.includes}"`;if(l.format==="regex")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${l.pattern}`;let p=c[l.format],m=p?.label??l.format,h=(p?.gender??"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return`${m} \u05DC\u05D0 ${h}`}case"not_multiple_of":return`\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ${d.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${d.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${d.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${b(d.keys,", ")}`;case"invalid_key":return"\u05E9\u05D3\u05D4 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8";case"invalid_union":return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF";case"invalid_element":return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${r(d.origin??"array")}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}};function kv(){return{localeError:H0()}}var K0=()=>{let t={string:{unit:"znakova",verb:"imati"},file:{unit:"bajtova",verb:"imati"},array:{unit:"stavki",verb:"imati"},set:{unit:"stavki",verb:"imati"}};function e(r){return t[r]??null}let n={regex:"unos",email:"email 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:"ISO datum i vrijeme",date:"ISO datum",time:"ISO vrijeme",duration:"ISO trajanje",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"IPv4 raspon",cidrv6:"IPv6 raspon",base64:"base64 kodirani tekst",base64url:"base64url kodirani tekst",json_string:"JSON tekst",e164:"E.164 broj",jwt:"JWT",template_literal:"unos"},i={nan:"NaN",string:"tekst",number:"broj",boolean:"boolean",array:"niz",object:"objekt",set:"skup",file:"datoteka",date:"datum",bigint:"bigint",symbol:"simbol",undefined:"undefined",null:"null",function:"funkcija",map:"mapa"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Neispravan unos: o\u010Dekuje se instanceof ${r.expected}, a primljeno je ${c}`:`Neispravan unos: o\u010Dekuje se ${o}, a primljeno je ${c}`}case"invalid_value":return r.values.length===1?`Neispravna vrijednost: o\u010Dekivano ${k(r.values[0])}`:`Neispravna opcija: o\u010Dekivano jedno od ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin),c=i[r.origin]??r.origin;return s?`Preveliko: o\u010Dekivano da ${c??"vrijednost"} ima ${o}${r.maximum.toString()} ${s.unit??"elemenata"}`:`Preveliko: o\u010Dekivano da ${c??"vrijednost"} bude ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin),c=i[r.origin]??r.origin;return s?`Premalo: o\u010Dekivano da ${c} ima ${o}${r.minimum.toString()} ${s.unit}`:`Premalo: o\u010Dekivano da ${c} bude ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Neispravan tekst: mora zapo\u010Dinjati s "${o.prefix}"`:o.format==="ends_with"?`Neispravan tekst: mora zavr\u0161avati s "${o.suffix}"`:o.format==="includes"?`Neispravan tekst: mora sadr\u017Eavati "${o.includes}"`:o.format==="regex"?`Neispravan tekst: mora odgovarati uzorku ${o.pattern}`:`Neispravna ${n[o.format]??r.format}`}case"not_multiple_of":return`Neispravan broj: mora biti vi\u0161ekratnik od ${r.divisor}`;case"unrecognized_keys":return`Neprepoznat${r.keys.length>1?"i klju\u010Devi":" klju\u010D"}: ${b(r.keys,", ")}`;case"invalid_key":return`Neispravan klju\u010D u ${i[r.origin]??r.origin}`;case"invalid_union":return"Neispravan unos";case"invalid_element":return`Neispravna vrijednost u ${i[r.origin]??r.origin}`;default:return"Neispravan unos"}}};function xv(){return{localeError:K0()}}var G0=()=>{let t={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function e(r){return t[r]??null}let n={regex:"bemenet",email:"email c\xEDm",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\u0151b\xE9lyeg",date:"ISO d\xE1tum",time:"ISO id\u0151",duration:"ISO id\u0151intervallum",ipv4:"IPv4 c\xEDm",ipv6:"IPv6 c\xEDm",cidrv4:"IPv4 tartom\xE1ny",cidrv6:"IPv6 tartom\xE1ny",base64:"base64-k\xF3dolt string",base64url:"base64url-k\xF3dolt string",json_string:"JSON string",e164:"E.164 sz\xE1m",jwt:"JWT",template_literal:"bemenet"},i={nan:"NaN",number:"sz\xE1m",array:"t\xF6mb"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k instanceof ${r.expected}, a kapott \xE9rt\xE9k ${c}`:`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${o}, a kapott \xE9rt\xE9k ${c}`}case"invalid_value":return r.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${k(r.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`T\xFAl nagy: ${r.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${o}${r.maximum.toString()} ${s.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${r.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${r.origin} m\xE9rete t\xFAl kicsi ${o}${r.minimum.toString()} ${s.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${r.origin} t\xFAl kicsi ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\xC9rv\xE9nytelen string: "${o.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:o.format==="ends_with"?`\xC9rv\xE9nytelen string: "${o.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:o.format==="includes"?`\xC9rv\xE9nytelen string: "${o.includes}" \xE9rt\xE9ket kell tartalmaznia`:o.format==="regex"?`\xC9rv\xE9nytelen string: ${o.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${n[o.format]??r.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${r.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${r.keys.length>1?"s":""}: ${b(r.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${r.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${r.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}};function Sv(){return{localeError:G0()}}function $v(t,e,n){return Math.abs(t)===1?e:n}function Rr(t){if(!t)return"";let e=["\u0561","\u0565","\u0568","\u056B","\u0578","\u0578\u0582","\u0585"],n=t[t.length-1];return t+(e.includes(n)?"\u0576":"\u0568")}var W0=()=>{let t={string:{unit:{one:"\u0576\u0577\u0561\u0576",many:"\u0576\u0577\u0561\u0576\u0576\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},file:{unit:{one:"\u0562\u0561\u0575\u0569",many:"\u0562\u0561\u0575\u0569\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},array:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},set:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"}};function e(r){return t[r]??null}let n={regex:"\u0574\u0578\u0582\u057F\u0584",email:"\u0567\u056C. \u0570\u0561\u057D\u0581\u0565",url:"URL",emoji:"\u0567\u0574\u0578\u057B\u056B",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E \u0587 \u056A\u0561\u0574",date:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E",time:"ISO \u056A\u0561\u0574",duration:"ISO \u057F\u0587\u0578\u0572\u0578\u0582\u0569\u0575\u0578\u0582\u0576",ipv4:"IPv4 \u0570\u0561\u057D\u0581\u0565",ipv6:"IPv6 \u0570\u0561\u057D\u0581\u0565",cidrv4:"IPv4 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",cidrv6:"IPv6 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",base64:"base64 \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",base64url:"base64url \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",json_string:"JSON \u057F\u0578\u0572",e164:"E.164 \u0570\u0561\u0574\u0561\u0580",jwt:"JWT",template_literal:"\u0574\u0578\u0582\u057F\u0584"},i={nan:"NaN",number:"\u0569\u056B\u057E",array:"\u0566\u0561\u0576\u0563\u057E\u0561\u056E"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 instanceof ${r.expected}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${c}`:`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${o}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${c}`}case"invalid_value":return r.values.length===1?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${k(r.values[1])}`:`\u054D\u056D\u0561\u056C \u057F\u0561\u0580\u0562\u0565\u0580\u0561\u056F\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 \u0570\u0565\u057F\u0587\u0575\u0561\u056C\u0576\u0565\u0580\u056B\u0581 \u0574\u0565\u056F\u0568\u055D ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);if(s){let c=Number(r.maximum),u=$v(c,s.unit.one,s.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Rr(r.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${o}${r.maximum.toString()} ${u}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Rr(r.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056C\u056B\u0576\u056B ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);if(s){let c=Number(r.minimum),u=$v(c,s.unit.one,s.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Rr(r.origin)} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${o}${r.minimum.toString()} ${u}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Rr(r.origin)} \u056C\u056B\u0576\u056B ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057D\u056F\u057D\u057E\u056B "${o.prefix}"-\u0578\u057E`:o.format==="ends_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0561\u057E\u0561\u0580\u057F\u057E\u056B "${o.suffix}"-\u0578\u057E`:o.format==="includes"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057A\u0561\u0580\u0578\u0582\u0576\u0561\u056F\u056B "${o.includes}"`:o.format==="regex"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0570\u0561\u0574\u0561\u057A\u0561\u057F\u0561\u057D\u056D\u0561\u0576\u056B ${o.pattern} \u0571\u0587\u0561\u0579\u0561\u0583\u056B\u0576`:`\u054D\u056D\u0561\u056C ${n[o.format]??r.format}`}case"not_multiple_of":return`\u054D\u056D\u0561\u056C \u0569\u056B\u057E\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0562\u0561\u0566\u0574\u0561\u057A\u0561\u057F\u056B\u056F \u056C\u056B\u0576\u056B ${r.divisor}-\u056B`;case"unrecognized_keys":return`\u0549\u0573\u0561\u0576\u0561\u0579\u057E\u0561\u056E \u0562\u0561\u0576\u0561\u056C\u056B${r.keys.length>1?"\u0576\u0565\u0580":""}. ${b(r.keys,", ")}`;case"invalid_key":return`\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${Rr(r.origin)}-\u0578\u0582\u0574`;case"invalid_union":return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574";case"invalid_element":return`\u054D\u056D\u0561\u056C \u0561\u0580\u056A\u0565\u0584 ${Rr(r.origin)}-\u0578\u0582\u0574`;default:return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}};function Iv(){return{localeError:W0()}}var J0=()=>{let t={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function e(r){return t[r]??null}let n={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"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Input tidak valid: diharapkan instanceof ${r.expected}, diterima ${c}`:`Input tidak valid: diharapkan ${o}, diterima ${c}`}case"invalid_value":return r.values.length===1?`Input tidak valid: diharapkan ${k(r.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Terlalu besar: diharapkan ${r.origin??"value"} memiliki ${o}${r.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: diharapkan ${r.origin??"value"} menjadi ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Terlalu kecil: diharapkan ${r.origin} memiliki ${o}${r.minimum.toString()} ${s.unit}`:`Terlalu kecil: diharapkan ${r.origin} menjadi ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`String tidak valid: harus dimulai dengan "${o.prefix}"`:o.format==="ends_with"?`String tidak valid: harus berakhir dengan "${o.suffix}"`:o.format==="includes"?`String tidak valid: harus menyertakan "${o.includes}"`:o.format==="regex"?`String tidak valid: harus sesuai pola ${o.pattern}`:`${n[o.format]??r.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${r.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${r.keys.length>1?"s":""}: ${b(r.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${r.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${r.origin}`;default:return"Input tidak valid"}}};function wv(){return{localeError:J0()}}var Y0=()=>{let t={string:{unit:"stafi",verb:"a\xF0 hafa"},file:{unit:"b\xE6ti",verb:"a\xF0 hafa"},array:{unit:"hluti",verb:"a\xF0 hafa"},set:{unit:"hluti",verb:"a\xF0 hafa"}};function e(r){return t[r]??null}let n={regex:"gildi",email:"netfang",url:"vefsl\xF3\xF0",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\xEDmi",date:"ISO dagsetning",time:"ISO t\xEDmi",duration:"ISO t\xEDmalengd",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\xF6lugildi",jwt:"JWT",template_literal:"gildi"},i={nan:"NaN",number:"n\xFAmer",array:"fylki"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Rangt gildi: \xDE\xFA sl\xF3st inn ${c} \xFEar sem \xE1 a\xF0 vera instanceof ${r.expected}`:`Rangt gildi: \xDE\xFA sl\xF3st inn ${c} \xFEar sem \xE1 a\xF0 vera ${o}`}case"invalid_value":return r.values.length===1?`Rangt gildi: gert r\xE1\xF0 fyrir ${k(r.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${r.origin??"gildi"} hafi ${o}${r.maximum.toString()} ${s.unit??"hluti"}`:`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${r.origin??"gildi"} s\xE9 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${r.origin} hafi ${o}${r.minimum.toString()} ${s.unit}`:`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${r.origin} s\xE9 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 byrja \xE1 "${o.prefix}"`:o.format==="ends_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 enda \xE1 "${o.suffix}"`:o.format==="includes"?`\xD3gildur strengur: ver\xF0ur a\xF0 innihalda "${o.includes}"`:o.format==="regex"?`\xD3gildur strengur: ver\xF0ur a\xF0 fylgja mynstri ${o.pattern}`:`Rangt ${n[o.format]??r.format}`}case"not_multiple_of":return`R\xF6ng tala: ver\xF0ur a\xF0 vera margfeldi af ${r.divisor}`;case"unrecognized_keys":return`\xD3\xFEekkt ${r.keys.length>1?"ir lyklar":"ur lykill"}: ${b(r.keys,", ")}`;case"invalid_key":return`Rangur lykill \xED ${r.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi \xED ${r.origin}`;default:return"Rangt gildi"}}};function Ev(){return{localeError:Y0()}}var X0=()=>{let t={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function e(r){return t[r]??null}let n={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"},i={nan:"NaN",number:"numero",array:"vettore"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Input non valido: atteso instanceof ${r.expected}, ricevuto ${c}`:`Input non valido: atteso ${o}, ricevuto ${c}`}case"invalid_value":return r.values.length===1?`Input non valido: atteso ${k(r.values[0])}`:`Opzione non valida: atteso uno tra ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Troppo grande: ${r.origin??"valore"} deve avere ${o}${r.maximum.toString()} ${s.unit??"elementi"}`:`Troppo grande: ${r.origin??"valore"} deve essere ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Troppo piccolo: ${r.origin} deve avere ${o}${r.minimum.toString()} ${s.unit}`:`Troppo piccolo: ${r.origin} deve essere ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Stringa non valida: deve iniziare con "${o.prefix}"`:o.format==="ends_with"?`Stringa non valida: deve terminare con "${o.suffix}"`:o.format==="includes"?`Stringa non valida: deve includere "${o.includes}"`:o.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${o.pattern}`:`Input non valido: ${n[o.format]??r.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${r.divisor}`;case"unrecognized_keys":return`Chiav${r.keys.length>1?"i":"e"} non riconosciut${r.keys.length>1?"e":"a"}: ${b(r.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${r.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${r.origin}`;default:return"Input non valido"}}};function Tv(){return{localeError:X0()}}var Q0=()=>{let t={string:{unit:"\u6587\u5B57",verb:"\u3067\u3042\u308B"},file:{unit:"\u30D0\u30A4\u30C8",verb:"\u3067\u3042\u308B"},array:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"},set:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"}};function e(r){return t[r]??null}let n={regex:"\u5165\u529B\u5024",email:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",url:"URL",emoji:"\u7D75\u6587\u5B57",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u6642",date:"ISO\u65E5\u4ED8",time:"ISO\u6642\u523B",duration:"ISO\u671F\u9593",ipv4:"IPv4\u30A2\u30C9\u30EC\u30B9",ipv6:"IPv6\u30A2\u30C9\u30EC\u30B9",cidrv4:"IPv4\u7BC4\u56F2",cidrv6:"IPv6\u7BC4\u56F2",base64:"base64\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",base64url:"base64url\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",json_string:"JSON\u6587\u5B57\u5217",e164:"E.164\u756A\u53F7",jwt:"JWT",template_literal:"\u5165\u529B\u5024"},i={nan:"NaN",number:"\u6570\u5024",array:"\u914D\u5217"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u7121\u52B9\u306A\u5165\u529B: instanceof ${r.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${c}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u5165\u529B: ${o}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${c}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`}case"invalid_value":return r.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${k(r.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${b(r.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let o=r.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",s=e(r.origin);return s?`\u5927\u304D\u3059\u304E\u308B\u5024: ${r.origin??"\u5024"}\u306F${r.maximum.toString()}${s.unit??"\u8981\u7D20"}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${r.origin??"\u5024"}\u306F${r.maximum.toString()}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let o=r.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",s=e(r.origin);return s?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${r.origin}\u306F${r.minimum.toString()}${s.unit}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${r.origin}\u306F${r.minimum.toString()}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${o.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${n[o.format]??r.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${r.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"unrecognized_keys":return`\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${r.keys.length>1?"\u7FA4":""}: ${b(r.keys,"\u3001")}`;case"invalid_key":return`${r.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${r.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}};function Rv(){return{localeError:Q0()}}var eO=()=>{let t={string:{unit:"\u10E1\u10D8\u10DB\u10D1\u10DD\u10DA\u10DD",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},file:{unit:"\u10D1\u10D0\u10D8\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},array:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},set:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"}};function e(r){return t[r]??null}let n={regex:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0",email:"\u10D4\u10DA-\u10E4\u10DD\u10E1\u10E2\u10D8\u10E1 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",url:"URL",emoji:"\u10D4\u10DB\u10DD\u10EF\u10D8",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8-\u10D3\u10E0\u10DD",date:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8",time:"\u10D3\u10E0\u10DD",duration:"\u10EE\u10D0\u10DC\u10D2\u10E0\u10EB\u10DA\u10D8\u10D5\u10DD\u10D1\u10D0",ipv4:"IPv4 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",ipv6:"IPv6 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",cidrv4:"IPv4 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",cidrv6:"IPv6 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",base64:"base64-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",base64url:"base64url-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",json_string:"JSON \u10D5\u10D4\u10DA\u10D8",e164:"E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",jwt:"JWT",template_literal:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"},i={nan:"NaN",number:"\u10E0\u10D8\u10EA\u10EE\u10D5\u10D8",string:"\u10D5\u10D4\u10DA\u10D8",boolean:"\u10D1\u10E3\u10DA\u10D4\u10D0\u10DC\u10D8",function:"\u10E4\u10E3\u10DC\u10E5\u10EA\u10D8\u10D0",array:"\u10DB\u10D0\u10E1\u10D8\u10D5\u10D8"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 instanceof ${r.expected}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${c}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${o}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${c}`}case"invalid_value":return r.values.length===1?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${k(r.values[0])}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D0\u10E0\u10D8\u10D0\u10DC\u10E2\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8\u10D0 \u10D4\u10E0\u10D7-\u10D4\u10E0\u10D7\u10D8 ${b(r.values,"|")}-\u10D3\u10D0\u10DC`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${r.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} ${s.verb} ${o}${r.maximum.toString()} ${s.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${r.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} \u10D8\u10E7\u10DD\u10E1 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${r.origin} ${s.verb} ${o}${r.minimum.toString()} ${s.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${r.origin} \u10D8\u10E7\u10DD\u10E1 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10EC\u10E7\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${o.prefix}"-\u10D8\u10D7`:o.format==="ends_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10DB\u10D7\u10D0\u10D5\u10E0\u10D3\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${o.suffix}"-\u10D8\u10D7`:o.format==="includes"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1 "${o.includes}"-\u10E1`:o.format==="regex"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D4\u10E1\u10D0\u10D1\u10D0\u10DB\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 \u10E8\u10D0\u10D1\u10DA\u10DD\u10DC\u10E1 ${o.pattern}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${n[o.format]??r.format}`}case"not_multiple_of":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E0\u10D8\u10EA\u10EE\u10D5\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10E7\u10DD\u10E1 ${r.divisor}-\u10D8\u10E1 \u10EF\u10D4\u10E0\u10D0\u10D3\u10D8`;case"unrecognized_keys":return`\u10E3\u10EA\u10DC\u10DD\u10D1\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1${r.keys.length>1?"\u10D4\u10D1\u10D8":"\u10D8"}: ${b(r.keys,", ")}`;case"invalid_key":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1\u10D8 ${r.origin}-\u10E8\u10D8`;case"invalid_union":return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0";case"invalid_element":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0 ${r.origin}-\u10E8\u10D8`;default:return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"}}};function Ov(){return{localeError:eO()}}var tO=()=>{let t={string:{unit:"\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},file:{unit:"\u1794\u17C3",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},array:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},set:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"}};function e(r){return t[r]??null}let n={regex:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B",email:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793\u17A2\u17CA\u17B8\u1798\u17C2\u179B",url:"URL",emoji:"\u179F\u1789\u17D2\u1789\u17B6\u17A2\u17B6\u179A\u1798\u17D2\u1798\u178E\u17CD",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 \u1793\u17B7\u1784\u1798\u17C9\u17C4\u1784 ISO",date:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 ISO",time:"\u1798\u17C9\u17C4\u1784 ISO",duration:"\u179A\u1799\u17C8\u1796\u17C1\u179B ISO",ipv4:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",ipv6:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",cidrv4:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",cidrv6:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",base64:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64",base64url:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64url",json_string:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",e164:"\u179B\u17C1\u1781 E.164",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"},i={nan:"NaN",number:"\u179B\u17C1\u1781",array:"\u17A2\u17B6\u179A\u17C1 (Array)",null:"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A instanceof ${r.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${c}`:`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${o} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${c}`}case"invalid_value":return r.values.length===1?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${k(r.values[0])}`:`\u1787\u1798\u17D2\u179A\u17BE\u179F\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1787\u17B6\u1798\u17BD\u1799\u1780\u17D2\u1793\u17BB\u1784\u1785\u17C6\u178E\u17C4\u1798 ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${o} ${r.maximum.toString()} ${s.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${o} ${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.origin} ${o} ${r.minimum.toString()} ${s.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.origin} ${o} ${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1785\u17B6\u1794\u17CB\u1795\u17D2\u178F\u17BE\u1798\u178A\u17C4\u1799 "${o.prefix}"`:o.format==="ends_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1794\u1789\u17D2\u1785\u1794\u17CB\u178A\u17C4\u1799 "${o.suffix}"`:o.format==="includes"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1798\u17B6\u1793 "${o.includes}"`:o.format==="regex"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1795\u17D2\u1782\u17BC\u1795\u17D2\u1782\u1784\u1793\u17B9\u1784\u1791\u1798\u17D2\u179A\u1784\u17CB\u178A\u17C2\u179B\u1794\u17B6\u1793\u1780\u17C6\u178E\u178F\u17CB ${o.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${n[o.format]??r.format}`}case"not_multiple_of":return`\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${r.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${b(r.keys,", ")}`;case"invalid_key":return`\u179F\u17C4\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${r.origin}`;case"invalid_union":return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C";case"invalid_element":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${r.origin}`;default:return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C"}}};function Kc(){return{localeError:tO()}}function Pv(){return Kc()}var nO=()=>{let t={string:{unit:"\uBB38\uC790",verb:"to have"},file:{unit:"\uBC14\uC774\uD2B8",verb:"to have"},array:{unit:"\uAC1C",verb:"to have"},set:{unit:"\uAC1C",verb:"to have"}};function e(r){return t[r]??null}let n={regex:"\uC785\uB825",email:"\uC774\uBA54\uC77C \uC8FC\uC18C",url:"URL",emoji:"\uC774\uBAA8\uC9C0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \uB0A0\uC9DC\uC2DC\uAC04",date:"ISO \uB0A0\uC9DC",time:"ISO \uC2DC\uAC04",duration:"ISO \uAE30\uAC04",ipv4:"IPv4 \uC8FC\uC18C",ipv6:"IPv6 \uC8FC\uC18C",cidrv4:"IPv4 \uBC94\uC704",cidrv6:"IPv6 \uBC94\uC704",base64:"base64 \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",base64url:"base64url \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",json_string:"JSON \uBB38\uC790\uC5F4",e164:"E.164 \uBC88\uD638",jwt:"JWT",template_literal:"\uC785\uB825"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 instanceof ${r.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${c}\uC785\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${o}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${c}\uC785\uB2C8\uB2E4`}case"invalid_value":return r.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${k(r.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${b(r.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let o=r.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",s=o==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",c=e(r.origin),u=c?.unit??"\uC694\uC18C";return c?`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${r.maximum.toString()}${u} ${o}${s}`:`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${r.maximum.toString()} ${o}${s}`}case"too_small":{let o=r.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",s=o==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",c=e(r.origin),u=c?.unit??"\uC694\uC18C";return c?`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${r.minimum.toString()}${u} ${o}${s}`:`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${r.minimum.toString()} ${o}${s}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:o.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:o.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:o.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${o.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${n[o.format]??r.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${r.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${b(r.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${r.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${r.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}};function Av(){return{localeError:nO()}}var Io=t=>t.charAt(0).toUpperCase()+t.slice(1);function Nv(t){let e=Math.abs(t),n=e%10,i=e%100;return i>=11&&i<=19||n===0?"many":n===1?"one":"few"}var rO=()=>{let t={string:{unit:{one:"simbolis",few:"simboliai",many:"simboli\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne ilgesn\u0117 kaip",notInclusive:"turi b\u016Bti trumpesn\u0117 kaip"},bigger:{inclusive:"turi b\u016Bti ne trumpesn\u0117 kaip",notInclusive:"turi b\u016Bti ilgesn\u0117 kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"bait\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne didesnis kaip",notInclusive:"turi b\u016Bti ma\u017Eesnis kaip"},bigger:{inclusive:"turi b\u016Bti ne ma\u017Eesnis kaip",notInclusive:"turi b\u016Bti didesnis kaip"}}},array:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}},set:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}}};function e(r,o,s,c){let u=t[r]??null;return u===null?u:{unit:u.unit[o],verb:u.verb[c][s?"inclusive":"notInclusive"]}}let n={regex:"\u012Fvestis",email:"el. pa\u0161to 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\u0117",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 u\u017Ekoduota eilut\u0117",base64url:"base64url u\u017Ekoduota eilut\u0117",json_string:"JSON eilut\u0117",e164:"E.164 numeris",jwt:"JWT",template_literal:"\u012Fvestis"},i={nan:"NaN",number:"skai\u010Dius",bigint:"sveikasis skai\u010Dius",string:"eilut\u0117",boolean:"login\u0117 reik\u0161m\u0117",undefined:"neapibr\u0117\u017Eta reik\u0161m\u0117",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulin\u0117 reik\u0161m\u0117"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Gautas tipas ${c}, o tik\u0117tasi - instanceof ${r.expected}`:`Gautas tipas ${c}, o tik\u0117tasi - ${o}`}case"invalid_value":return r.values.length===1?`Privalo b\u016Bti ${k(r.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${b(r.values,"|")} pasirinkim\u0173`;case"too_big":{let o=i[r.origin]??r.origin,s=e(r.origin,Nv(Number(r.maximum)),r.inclusive??!1,"smaller");if(s?.verb)return`${Io(o??r.origin??"reik\u0161m\u0117")} ${s.verb} ${r.maximum.toString()} ${s.unit??"element\u0173"}`;let c=r.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return`${Io(o??r.origin??"reik\u0161m\u0117")} turi b\u016Bti ${c} ${r.maximum.toString()} ${s?.unit}`}case"too_small":{let o=i[r.origin]??r.origin,s=e(r.origin,Nv(Number(r.minimum)),r.inclusive??!1,"bigger");if(s?.verb)return`${Io(o??r.origin??"reik\u0161m\u0117")} ${s.verb} ${r.minimum.toString()} ${s.unit??"element\u0173"}`;let c=r.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return`${Io(o??r.origin??"reik\u0161m\u0117")} turi b\u016Bti ${c} ${r.minimum.toString()} ${s?.unit}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Eilut\u0117 privalo prasid\u0117ti "${o.prefix}"`:o.format==="ends_with"?`Eilut\u0117 privalo pasibaigti "${o.suffix}"`:o.format==="includes"?`Eilut\u0117 privalo \u012Ftraukti "${o.includes}"`:o.format==="regex"?`Eilut\u0117 privalo atitikti ${o.pattern}`:`Neteisingas ${n[o.format]??r.format}`}case"not_multiple_of":return`Skai\u010Dius privalo b\u016Bti ${r.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpa\u017Eint${r.keys.length>1?"i":"as"} rakt${r.keys.length>1?"ai":"as"}: ${b(r.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga \u012Fvestis";case"invalid_element":{let o=i[r.origin]??r.origin;return`${Io(o??r.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}};function Cv(){return{localeError:rO()}}var iO=()=>{let t={string:{unit:"\u0437\u043D\u0430\u0446\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},file:{unit:"\u0431\u0430\u0458\u0442\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},array:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},set:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"}};function e(r){return t[r]??null}let n={regex:"\u0432\u043D\u0435\u0441",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u043D\u0430 \u0435-\u043F\u043E\u0448\u0442\u0430",url:"URL",emoji:"\u0435\u043C\u043E\u045F\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0443\u043C \u0438 \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0443\u043C",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u0432\u0440\u0435\u043C\u0435\u0442\u0440\u0430\u0435\u045A\u0435",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441\u0430",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441\u0430",cidrv4:"IPv4 \u043E\u043F\u0441\u0435\u0433",cidrv6:"IPv6 \u043E\u043F\u0441\u0435\u0433",base64:"base64-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",base64url:"base64url-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",json_string:"JSON \u043D\u0438\u0437\u0430",e164:"E.164 \u0431\u0440\u043E\u0458",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"},i={nan:"NaN",number:"\u0431\u0440\u043E\u0458",array:"\u043D\u0438\u0437\u0430"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 instanceof ${r.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${c}`:`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${c}`}case"invalid_value":return r.values.length===1?`Invalid input: expected ${k(r.values[0])}`:`\u0413\u0440\u0435\u0448\u0430\u043D\u0430 \u043E\u043F\u0446\u0438\u0458\u0430: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 \u0435\u0434\u043D\u0430 ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${r.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${o}${r.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${r.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${r.origin} \u0434\u0430 \u0438\u043C\u0430 ${o}${r.minimum.toString()} ${s.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${r.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u043D\u0443\u0432\u0430 \u0441\u043E "${o.prefix}"`:o.format==="ends_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u0432\u0440\u0448\u0443\u0432\u0430 \u0441\u043E "${o.suffix}"`:o.format==="includes"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0432\u043A\u043B\u0443\u0447\u0443\u0432\u0430 "${o.includes}"`:o.format==="regex"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u043E\u0434\u0433\u043E\u0430\u0440\u0430 \u043D\u0430 \u043F\u0430\u0442\u0435\u0440\u043D\u043E\u0442 ${o.pattern}`:`Invalid ${n[o.format]??r.format}`}case"not_multiple_of":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438":"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${b(r.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${r.origin}`;case"invalid_union":return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441";case"invalid_element":return`\u0413\u0440\u0435\u0448\u043D\u0430 \u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442 \u0432\u043E ${r.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}};function zv(){return{localeError:iO()}}var oO=()=>{let t={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function e(r){return t[r]??null}let n={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"},i={nan:"NaN",number:"nombor"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Input tidak sah: dijangka instanceof ${r.expected}, diterima ${c}`:`Input tidak sah: dijangka ${o}, diterima ${c}`}case"invalid_value":return r.values.length===1?`Input tidak sah: dijangka ${k(r.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Terlalu besar: dijangka ${r.origin??"nilai"} ${s.verb} ${o}${r.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: dijangka ${r.origin??"nilai"} adalah ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Terlalu kecil: dijangka ${r.origin} ${s.verb} ${o}${r.minimum.toString()} ${s.unit}`:`Terlalu kecil: dijangka ${r.origin} adalah ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`String tidak sah: mesti bermula dengan "${o.prefix}"`:o.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${o.suffix}"`:o.format==="includes"?`String tidak sah: mesti mengandungi "${o.includes}"`:o.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${o.pattern}`:`${n[o.format]??r.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${r.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${b(r.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${r.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${r.origin}`;default:return"Input tidak sah"}}};function Dv(){return{localeError:oO()}}var sO=()=>{let t={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function e(r){return t[r]??null}let n={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"},i={nan:"NaN",number:"getal"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Ongeldige invoer: verwacht instanceof ${r.expected}, ontving ${c}`:`Ongeldige invoer: verwacht ${o}, ontving ${c}`}case"invalid_value":return r.values.length===1?`Ongeldige invoer: verwacht ${k(r.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin),c=r.origin==="date"?"laat":r.origin==="string"?"lang":"groot";return s?`Te ${c}: verwacht dat ${r.origin??"waarde"} ${o}${r.maximum.toString()} ${s.unit??"elementen"} ${s.verb}`:`Te ${c}: verwacht dat ${r.origin??"waarde"} ${o}${r.maximum.toString()} is`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin),c=r.origin==="date"?"vroeg":r.origin==="string"?"kort":"klein";return s?`Te ${c}: verwacht dat ${r.origin} ${o}${r.minimum.toString()} ${s.unit} ${s.verb}`:`Te ${c}: verwacht dat ${r.origin} ${o}${r.minimum.toString()} is`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Ongeldige tekst: moet met "${o.prefix}" beginnen`:o.format==="ends_with"?`Ongeldige tekst: moet op "${o.suffix}" eindigen`:o.format==="includes"?`Ongeldige tekst: moet "${o.includes}" bevatten`:o.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${o.pattern}`:`Ongeldig: ${n[o.format]??r.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${r.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${r.keys.length>1?"s":""}: ${b(r.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${r.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${r.origin}`;default:return"Ongeldige invoer"}}};function jv(){return{localeError:sO()}}var aO=()=>{let t={string:{unit:"tegn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"elementer",verb:"\xE5 inneholde"},set:{unit:"elementer",verb:"\xE5 inneholde"}};function e(r){return t[r]??null}let n={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\xE5de",ipv6:"IPv6-omr\xE5de",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"},i={nan:"NaN",number:"tall",array:"liste"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Ugyldig input: forventet instanceof ${r.expected}, fikk ${c}`:`Ugyldig input: forventet ${o}, fikk ${c}`}case"invalid_value":return r.values.length===1?`Ugyldig verdi: forventet ${k(r.values[0])}`:`Ugyldig valg: forventet en av ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`For stor(t): forventet ${r.origin??"value"} til \xE5 ha ${o}${r.maximum.toString()} ${s.unit??"elementer"}`:`For stor(t): forventet ${r.origin??"value"} til \xE5 ha ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`For lite(n): forventet ${r.origin} til \xE5 ha ${o}${r.minimum.toString()} ${s.unit}`:`For lite(n): forventet ${r.origin} til \xE5 ha ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${o.prefix}"`:o.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${o.suffix}"`:o.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${o.includes}"`:o.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${o.pattern}`:`Ugyldig ${n[o.format]??r.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${b(r.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${r.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${r.origin}`;default:return"Ugyldig input"}}};function Uv(){return{localeError:aO()}}var cO=()=>{let t={string:{unit:"harf",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"unsur",verb:"olmal\u0131d\u0131r"},set:{unit:"unsur",verb:"olmal\u0131d\u0131r"}};function e(r){return t[r]??null}let n={regex:"giren",email:"epostag\xE2h",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\xE2m\u0131",date:"ISO tarihi",time:"ISO zaman\u0131",duration:"ISO m\xFCddeti",ipv4:"IPv4 ni\u015F\xE2n\u0131",ipv6:"IPv6 ni\u015F\xE2n\u0131",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-\u015Fifreli metin",base64url:"base64url-\u015Fifreli metin",json_string:"JSON metin",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"giren"},i={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`F\xE2sit giren: umulan instanceof ${r.expected}, al\u0131nan ${c}`:`F\xE2sit giren: umulan ${o}, al\u0131nan ${c}`}case"invalid_value":return r.values.length===1?`F\xE2sit giren: umulan ${k(r.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Fazla b\xFCy\xFCk: ${r.origin??"value"}, ${o}${r.maximum.toString()} ${s.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${r.origin??"value"}, ${o}${r.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Fazla k\xFC\xE7\xFCk: ${r.origin}, ${o}${r.minimum.toString()} ${s.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${r.origin}, ${o}${r.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let o=r;return o.format==="starts_with"?`F\xE2sit metin: "${o.prefix}" ile ba\u015Flamal\u0131.`:o.format==="ends_with"?`F\xE2sit metin: "${o.suffix}" ile bitmeli.`:o.format==="includes"?`F\xE2sit metin: "${o.includes}" ihtiv\xE2 etmeli.`:o.format==="regex"?`F\xE2sit metin: ${o.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${n[o.format]??r.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${r.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${r.keys.length>1?"s":""}: ${b(r.keys,", ")}`;case"invalid_key":return`${r.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${r.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}};function Mv(){return{localeError:cO()}}var uO=()=>{let t={string:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},file:{unit:"\u0628\u0627\u06CC\u067C\u0633",verb:"\u0648\u0644\u0631\u064A"},array:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},set:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"}};function e(r){return t[r]??null}let n={regex:"\u0648\u0631\u0648\u062F\u064A",email:"\u0628\u0631\u06CC\u069A\u0646\u0627\u0644\u06CC\u06A9",url:"\u06CC\u0648 \u0622\u0631 \u0627\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0646\u06CC\u067C\u0647 \u0627\u0648 \u0648\u062E\u062A",date:"\u0646\u06D0\u067C\u0647",time:"\u0648\u062E\u062A",duration:"\u0645\u0648\u062F\u0647",ipv4:"\u062F IPv4 \u067E\u062A\u0647",ipv6:"\u062F IPv6 \u067E\u062A\u0647",cidrv4:"\u062F IPv4 \u0633\u0627\u062D\u0647",cidrv6:"\u062F IPv6 \u0633\u0627\u062D\u0647",base64:"base64-encoded \u0645\u062A\u0646",base64url:"base64url-encoded \u0645\u062A\u0646",json_string:"JSON \u0645\u062A\u0646",e164:"\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"},i={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0627\u0631\u06D0"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F instanceof ${r.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${c} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`:`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${o} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${c} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`}case"invalid_value":return r.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${k(r.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${b(r.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${r.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${o}${r.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${r.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${o}${r.maximum.toString()} \u0648\u064A`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${r.origin} \u0628\u0627\u06CC\u062F ${o}${r.minimum.toString()} ${s.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${r.origin} \u0628\u0627\u06CC\u062F ${o}${r.minimum.toString()} \u0648\u064A`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${o.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:o.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${o.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:o.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${o.includes}" \u0648\u0644\u0631\u064A`:o.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${o.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${n[o.format]??r.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${r.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${r.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${b(r.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${r.origin} \u06A9\u06D0`;case"invalid_union":return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A";case"invalid_element":return`\u0646\u0627\u0633\u0645 \u0639\u0646\u0635\u0631 \u067E\u0647 ${r.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}};function Lv(){return{localeError:uO()}}var lO=()=>{let t={string:{unit:"znak\xF3w",verb:"mie\u0107"},file:{unit:"bajt\xF3w",verb:"mie\u0107"},array:{unit:"element\xF3w",verb:"mie\u0107"},set:{unit:"element\xF3w",verb:"mie\u0107"}};function e(r){return t[r]??null}let n={regex:"wyra\u017Cenie",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\u0105g znak\xF3w zakodowany w formacie base64",base64url:"ci\u0105g znak\xF3w zakodowany w formacie base64url",json_string:"ci\u0105g znak\xF3w w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wej\u015Bcie"},i={nan:"NaN",number:"liczba",array:"tablica"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano instanceof ${r.expected}, otrzymano ${c}`:`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${o}, otrzymano ${c}`}case"invalid_value":return r.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${k(r.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${r.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${o}${r.maximum.toString()} ${s.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${r.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${r.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${o}${r.minimum.toString()} ${s.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${r.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${o.prefix}"`:o.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${o.suffix}"`:o.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${o.includes}"`:o.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${o.pattern}`:`Nieprawid\u0142ow(y/a/e) ${n[o.format]??r.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${r.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${r.keys.length>1?"s":""}: ${b(r.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${r.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${r.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}};function Zv(){return{localeError:lO()}}var dO=()=>{let t={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function e(r){return t[r]??null}let n={regex:"padr\xE3o",email:"endere\xE7o 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\xE7\xE3o ISO",ipv4:"endere\xE7o IPv4",ipv6:"endere\xE7o 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\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},i={nan:"NaN",number:"n\xFAmero",null:"nulo"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Tipo inv\xE1lido: esperado instanceof ${r.expected}, recebido ${c}`:`Tipo inv\xE1lido: esperado ${o}, recebido ${c}`}case"invalid_value":return r.values.length===1?`Entrada inv\xE1lida: esperado ${k(r.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Muito grande: esperado que ${r.origin??"valor"} tivesse ${o}${r.maximum.toString()} ${s.unit??"elementos"}`:`Muito grande: esperado que ${r.origin??"valor"} fosse ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Muito pequeno: esperado que ${r.origin} tivesse ${o}${r.minimum.toString()} ${s.unit}`:`Muito pequeno: esperado que ${r.origin} fosse ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${o.prefix}"`:o.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${o.suffix}"`:o.format==="includes"?`Texto inv\xE1lido: deve incluir "${o.includes}"`:o.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${o.pattern}`:`${n[o.format]??r.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${r.divisor}`;case"unrecognized_keys":return`Chave${r.keys.length>1?"s":""} desconhecida${r.keys.length>1?"s":""}: ${b(r.keys,", ")}`;case"invalid_key":return`Chave inv\xE1lida em ${r.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido em ${r.origin}`;default:return"Campo inv\xE1lido"}}};function Fv(){return{localeError:dO()}}var pO=()=>{let t={string:{unit:"caractere",verb:"s\u0103 aib\u0103"},file:{unit:"octe\u021Bi",verb:"s\u0103 aib\u0103"},array:{unit:"elemente",verb:"s\u0103 aib\u0103"},set:{unit:"elemente",verb:"s\u0103 aib\u0103"},map:{unit:"intr\u0103ri",verb:"s\u0103 aib\u0103"}};function e(r){return t[r]??null}let n={regex:"intrare",email:"adres\u0103 de 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:"dat\u0103 \u0219i or\u0103 ISO",date:"dat\u0103 ISO",time:"or\u0103 ISO",duration:"durat\u0103 ISO",ipv4:"adres\u0103 IPv4",ipv6:"adres\u0103 IPv6",mac:"adres\u0103 MAC",cidrv4:"interval IPv4",cidrv6:"interval IPv6",base64:"\u0219ir codat base64",base64url:"\u0219ir codat base64url",json_string:"\u0219ir JSON",e164:"num\u0103r E.164",jwt:"JWT",template_literal:"intrare"},i={nan:"NaN",string:"\u0219ir",number:"num\u0103r",boolean:"boolean",function:"func\u021Bie",array:"matrice",object:"obiect",undefined:"nedefinit",symbol:"simbol",bigint:"num\u0103r mare",void:"void",never:"never",map:"hart\u0103",set:"set"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return`Intrare invalid\u0103: a\u0219teptat ${o}, primit ${c}`}case"invalid_value":return r.values.length===1?`Intrare invalid\u0103: a\u0219teptat ${k(r.values[0])}`:`Op\u021Biune invalid\u0103: a\u0219teptat una dintre ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Prea mare: a\u0219teptat ca ${r.origin??"valoarea"} ${s.verb} ${o}${r.maximum.toString()} ${s.unit??"elemente"}`:`Prea mare: a\u0219teptat ca ${r.origin??"valoarea"} s\u0103 fie ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Prea mic: a\u0219teptat ca ${r.origin} ${s.verb} ${o}${r.minimum.toString()} ${s.unit}`:`Prea mic: a\u0219teptat ca ${r.origin} s\u0103 fie ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u0218ir invalid: trebuie s\u0103 \xEEnceap\u0103 cu "${o.prefix}"`:o.format==="ends_with"?`\u0218ir invalid: trebuie s\u0103 se termine cu "${o.suffix}"`:o.format==="includes"?`\u0218ir invalid: trebuie s\u0103 includ\u0103 "${o.includes}"`:o.format==="regex"?`\u0218ir invalid: trebuie s\u0103 se potriveasc\u0103 cu modelul ${o.pattern}`:`Format invalid: ${n[o.format]??r.format}`}case"not_multiple_of":return`Num\u0103r invalid: trebuie s\u0103 fie multiplu de ${r.divisor}`;case"unrecognized_keys":return`Chei nerecunoscute: ${b(r.keys,", ")}`;case"invalid_key":return`Cheie invalid\u0103 \xEEn ${r.origin}`;case"invalid_union":return"Intrare invalid\u0103";case"invalid_element":return`Valoare invalid\u0103 \xEEn ${r.origin}`;default:return"Intrare invalid\u0103"}}};function Bv(){return{localeError:pO()}}function qv(t,e,n,i){let r=Math.abs(t),o=r%10,s=r%100;return s>=11&&s<=19?i:o===1?e:o>=2&&o<=4?n:i}var mO=()=>{let t={string:{unit:{one:"\u0441\u0438\u043C\u0432\u043E\u043B",few:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",many:"\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u0430",many:"\u0431\u0430\u0439\u0442"},verb:"\u0438\u043C\u0435\u0442\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"}};function e(r){return t[r]??null}let n={regex:"\u0432\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u044F",duration:"ISO \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64",base64url:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64url",json_string:"JSON \u0441\u0442\u0440\u043E\u043A\u0430",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"},i={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0441\u0438\u0432"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C instanceof ${r.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${c}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${o}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${c}`}case"invalid_value":return r.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${k(r.values[0])}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0434\u043D\u043E \u0438\u0437 ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);if(s){let c=Number(r.maximum),u=qv(c,s.unit.one,s.unit.few,s.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${o}${r.maximum.toString()} ${u}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);if(s){let c=Number(r.minimum),u=qv(c,s.unit.one,s.unit.few,s.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${r.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${o}${r.minimum.toString()} ${u}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${r.origin} \u0431\u0443\u0434\u0435\u0442 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0442\u044C\u0441\u044F \u0441 "${o.prefix}"`:o.format==="ends_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 "${o.suffix}"`:o.format==="includes"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C "${o.includes}"`:o.format==="regex"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${o.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${n[o.format]??r.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${r.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${r.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${r.keys.length>1?"\u0438":""}: ${b(r.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${r.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435";case"invalid_element":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432 ${r.origin}`;default:return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"}}};function Vv(){return{localeError:mO()}}var fO=()=>{let t={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function e(r){return t[r]??null}let n={regex:"vnos",email:"e-po\u0161tni 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 \u010Das",date:"ISO datum",time:"ISO \u010Das",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 \u0161tevilka",jwt:"JWT",template_literal:"vnos"},i={nan:"NaN",number:"\u0161tevilo",array:"tabela"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Neveljaven vnos: pri\u010Dakovano instanceof ${r.expected}, prejeto ${c}`:`Neveljaven vnos: pri\u010Dakovano ${o}, prejeto ${c}`}case"invalid_value":return r.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${k(r.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Preveliko: pri\u010Dakovano, da bo ${r.origin??"vrednost"} imelo ${o}${r.maximum.toString()} ${s.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${r.origin??"vrednost"} ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Premajhno: pri\u010Dakovano, da bo ${r.origin} imelo ${o}${r.minimum.toString()} ${s.unit}`:`Premajhno: pri\u010Dakovano, da bo ${r.origin} ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${o.prefix}"`:o.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${o.suffix}"`:o.format==="includes"?`Neveljaven niz: mora vsebovati "${o.includes}"`:o.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${o.pattern}`:`Neveljaven ${n[o.format]??r.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${r.divisor}`;case"unrecognized_keys":return`Neprepoznan${r.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${b(r.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${r.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${r.origin}`;default:return"Neveljaven vnos"}}};function Hv(){return{localeError:fO()}}var hO=()=>{let t={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att inneh\xE5lla"},set:{unit:"objekt",verb:"att inneh\xE5lla"}};function e(r){return t[r]??null}let n={regex:"regulj\xE4rt 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\xE4ng",base64url:"base64url-kodad str\xE4ng",json_string:"JSON-str\xE4ng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"},i={nan:"NaN",number:"antal",array:"lista"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Ogiltig inmatning: f\xF6rv\xE4ntat instanceof ${r.expected}, fick ${c}`:`Ogiltig inmatning: f\xF6rv\xE4ntat ${o}, fick ${c}`}case"invalid_value":return r.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${k(r.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`F\xF6r stor(t): f\xF6rv\xE4ntade ${r.origin??"v\xE4rdet"} att ha ${o}${r.maximum.toString()} ${s.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${r.origin??"v\xE4rdet"} att ha ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`F\xF6r lite(t): f\xF6rv\xE4ntade ${r.origin??"v\xE4rdet"} att ha ${o}${r.minimum.toString()} ${s.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${r.origin??"v\xE4rdet"} att ha ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${o.prefix}"`:o.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${o.suffix}"`:o.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${o.includes}"`:o.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${o.pattern}"`:`Ogiltig(t) ${n[o.format]??r.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${b(r.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${r.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${r.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}};function Kv(){return{localeError:hO()}}var gO=()=>{let t={string:{unit:"\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},file:{unit:"\u0BAA\u0BC8\u0B9F\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},array:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},set:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"}};function e(r){return t[r]??null}let n={regex:"\u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1",email:"\u0BAE\u0BBF\u0BA9\u0BCD\u0BA9\u0B9E\u0BCD\u0B9A\u0BB2\u0BCD \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",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 \u0BA4\u0BC7\u0BA4\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",date:"ISO \u0BA4\u0BC7\u0BA4\u0BBF",time:"ISO \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",duration:"ISO \u0B95\u0BBE\u0BB2 \u0B85\u0BB3\u0BB5\u0BC1",ipv4:"IPv4 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",ipv6:"IPv6 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",cidrv4:"IPv4 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",cidrv6:"IPv6 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",base64:"base64-encoded \u0B9A\u0BB0\u0BAE\u0BCD",base64url:"base64url-encoded \u0B9A\u0BB0\u0BAE\u0BCD",json_string:"JSON \u0B9A\u0BB0\u0BAE\u0BCD",e164:"E.164 \u0B8E\u0BA3\u0BCD",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"\u0B8E\u0BA3\u0BCD",array:"\u0B85\u0BA3\u0BBF",null:"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 instanceof ${r.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${c}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${c}`}case"invalid_value":return r.values.length===1?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${k(r.values[0])}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0BAE\u0BCD: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${b(r.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${r.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${o}${r.maximum.toString()} ${s.unit??"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${r.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${o}${r.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${r.origin} ${o}${r.minimum.toString()} ${s.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${r.origin} ${o}${r.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${o.pattern} \u0BAE\u0BC1\u0BB1\u0BC8\u0BAA\u0BBE\u0B9F\u0BCD\u0B9F\u0BC1\u0B9F\u0BA9\u0BCD \u0BAA\u0BCA\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${n[o.format]??r.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${r.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;case"unrecognized_keys":return`\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${r.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${b(r.keys,", ")}`;case"invalid_key":return`${r.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0B9A\u0BC8`;case"invalid_union":return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1";case"invalid_element":return`${r.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1`;default:return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1"}}};function Gv(){return{localeError:gO()}}var bO=()=>{let t={string:{unit:"\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},file:{unit:"\u0E44\u0E1A\u0E15\u0E4C",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},array:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},set:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"}};function e(r){return t[r]??null}let n={regex:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",email:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",url:"URL",emoji:"\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",date:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",time:"\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",duration:"\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",ipv4:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",ipv6:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",cidrv4:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",cidrv6:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",base64:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",base64url:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",json_string:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",e164:"\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",jwt:"\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",template_literal:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"},i={nan:"NaN",number:"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02",array:"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)",null:"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 instanceof ${r.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${c}`:`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${o} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${c}`}case"invalid_value":return r.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${k(r.values[0])}`:`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",s=e(r.origin);return s?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${r.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${r.maximum.toString()} ${s.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${r.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",s=e(r.origin);return s?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${r.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${r.minimum.toString()} ${s.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${r.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22 "${o.prefix}"`:o.format==="ends_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22 "${o.suffix}"`:o.format==="includes"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 "${o.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:o.format==="regex"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14 ${o.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${n[o.format]??r.format}`}case"not_multiple_of":return`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${r.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`;case"unrecognized_keys":return`\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${b(r.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${r.origin}`;case"invalid_union":return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E44\u0E21\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E22\u0E39\u0E40\u0E19\u0E35\u0E22\u0E19\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E44\u0E27\u0E49";case"invalid_element":return`\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${r.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}};function Wv(){return{localeError:bO()}}var _O=()=>{let t={string:{unit:"karakter",verb:"olmal\u0131"},file:{unit:"bayt",verb:"olmal\u0131"},array:{unit:"\xF6\u011Fe",verb:"olmal\u0131"},set:{unit:"\xF6\u011Fe",verb:"olmal\u0131"}};function e(r){return t[r]??null}let n={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\xFCre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aral\u0131\u011F\u0131",cidrv6:"IPv6 aral\u0131\u011F\u0131",base64:"base64 ile \u015Fifrelenmi\u015F metin",base64url:"base64url ile \u015Fifrelenmi\u015F metin",json_string:"JSON dizesi",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"\u015Eablon dizesi"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Ge\xE7ersiz de\u011Fer: beklenen instanceof ${r.expected}, al\u0131nan ${c}`:`Ge\xE7ersiz de\u011Fer: beklenen ${o}, al\u0131nan ${c}`}case"invalid_value":return r.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${k(r.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`\xC7ok b\xFCy\xFCk: beklenen ${r.origin??"de\u011Fer"} ${o}${r.maximum.toString()} ${s.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${r.origin??"de\u011Fer"} ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\xC7ok k\xFC\xE7\xFCk: beklenen ${r.origin} ${o}${r.minimum.toString()} ${s.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${r.origin} ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Ge\xE7ersiz metin: "${o.prefix}" ile ba\u015Flamal\u0131`:o.format==="ends_with"?`Ge\xE7ersiz metin: "${o.suffix}" ile bitmeli`:o.format==="includes"?`Ge\xE7ersiz metin: "${o.includes}" i\xE7ermeli`:o.format==="regex"?`Ge\xE7ersiz metin: ${o.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${n[o.format]??r.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${r.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${r.keys.length>1?"lar":""}: ${b(r.keys,", ")}`;case"invalid_key":return`${r.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${r.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}};function Jv(){return{localeError:_O()}}var yO=()=>{let t={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},file:{unit:"\u0431\u0430\u0439\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"}};function e(r){return t[r]??null}let n={regex:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0457 \u043F\u043E\u0448\u0442\u0438",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0434\u0430\u0442\u0430 \u0442\u0430 \u0447\u0430\u0441 ISO",date:"\u0434\u0430\u0442\u0430 ISO",time:"\u0447\u0430\u0441 ISO",duration:"\u0442\u0440\u0438\u0432\u0430\u043B\u0456\u0441\u0442\u044C ISO",ipv4:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv4",ipv6:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv6",cidrv4:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv4",cidrv6:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv6",base64:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64",base64url:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64url",json_string:"\u0440\u044F\u0434\u043E\u043A JSON",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"},i={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F instanceof ${r.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${c}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${o}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${c}`}case"invalid_value":return r.values.length===1?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${k(r.values[0])}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430 \u043E\u043F\u0446\u0456\u044F: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u043D\u0435 \u0437 ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${s.verb} ${o}${r.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${r.origin} ${s.verb} ${o}${r.minimum.toString()} ${s.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${r.origin} \u0431\u0443\u0434\u0435 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043F\u043E\u0447\u0438\u043D\u0430\u0442\u0438\u0441\u044F \u0437 "${o.prefix}"`:o.format==="ends_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0437\u0430\u043A\u0456\u043D\u0447\u0443\u0432\u0430\u0442\u0438\u0441\u044F \u043D\u0430 "${o.suffix}"`:o.format==="includes"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043C\u0456\u0441\u0442\u0438\u0442\u0438 "${o.includes}"`:o.format==="regex"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${o.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${n[o.format]??r.format}`}case"not_multiple_of":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${r.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${r.keys.length>1?"\u0456":""}: ${b(r.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${r.origin}`;case"invalid_union":return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456";case"invalid_element":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0443 ${r.origin}`;default:return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"}}};function Gc(){return{localeError:yO()}}function Yv(){return Gc()}var vO=()=>{let t={string:{unit:"\u062D\u0631\u0648\u0641",verb:"\u06C1\u0648\u0646\u0627"},file:{unit:"\u0628\u0627\u0626\u0679\u0633",verb:"\u06C1\u0648\u0646\u0627"},array:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"},set:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"}};function e(r){return t[r]??null}let n={regex:"\u0627\u0646 \u067E\u0679",email:"\u0627\u06CC \u0645\u06CC\u0644 \u0627\u06CC\u0688\u0631\u06CC\u0633",url:"\u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",uuidv4:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 4",uuidv6:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 6",nanoid:"\u0646\u06CC\u0646\u0648 \u0622\u0626\u06CC \u0688\u06CC",guid:"\u062C\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid2:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC 2",ulid:"\u06CC\u0648 \u0627\u06CC\u0644 \u0622\u0626\u06CC \u0688\u06CC",xid:"\u0627\u06CC\u06A9\u0633 \u0622\u0626\u06CC \u0688\u06CC",ksuid:"\u06A9\u06D2 \u0627\u06CC\u0633 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",datetime:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0688\u06CC\u0679 \u0679\u0627\u0626\u0645",date:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u062A\u0627\u0631\u06CC\u062E",time:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0648\u0642\u062A",duration:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0645\u062F\u062A",ipv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0627\u06CC\u0688\u0631\u06CC\u0633",ipv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0627\u06CC\u0688\u0631\u06CC\u0633",cidrv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0631\u06CC\u0646\u062C",cidrv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0631\u06CC\u0646\u062C",base64:"\u0628\u06CC\u0633 64 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",base64url:"\u0628\u06CC\u0633 64 \u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",json_string:"\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",e164:"\u0627\u06CC 164 \u0646\u0645\u0628\u0631",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"},i={nan:"NaN",number:"\u0646\u0645\u0628\u0631",array:"\u0622\u0631\u06D2",null:"\u0646\u0644"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: instanceof ${r.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${c} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`:`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${o} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${c} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`}case"invalid_value":return r.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${k(r.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${b(r.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${r.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${o}${r.maximum.toString()} ${s.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${r.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${o}${r.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${r.origin} \u06A9\u06D2 ${o}${r.minimum.toString()} ${s.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${r.origin} \u06A9\u0627 ${o}${r.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${o.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${n[o.format]??r.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${r.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;case"unrecognized_keys":return`\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${r.keys.length>1?"\u0632":""}: ${b(r.keys,"\u060C ")}`;case"invalid_key":return`${r.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${r.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}};function Xv(){return{localeError:vO()}}var kO=()=>{let t={string:{unit:"belgi",verb:"bo\u2018lishi kerak"},file:{unit:"bayt",verb:"bo\u2018lishi kerak"},array:{unit:"element",verb:"bo\u2018lishi kerak"},set:{unit:"element",verb:"bo\u2018lishi kerak"},map:{unit:"yozuv",verb:"bo\u2018lishi kerak"}};function e(r){return t[r]??null}let n={regex:"kirish",email:"elektron pochta manzili",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 sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",jwt:"JWT",template_literal:"kirish"},i={nan:"NaN",number:"raqam",array:"massiv"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`Noto\u2018g\u2018ri kirish: kutilgan instanceof ${r.expected}, qabul qilingan ${c}`:`Noto\u2018g\u2018ri kirish: kutilgan ${o}, qabul qilingan ${c}`}case"invalid_value":return r.values.length===1?`Noto\u2018g\u2018ri kirish: kutilgan ${k(r.values[0])}`:`Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Juda katta: kutilgan ${r.origin??"qiymat"} ${o}${r.maximum.toString()} ${s.unit} ${s.verb}`:`Juda katta: kutilgan ${r.origin??"qiymat"} ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Juda kichik: kutilgan ${r.origin} ${o}${r.minimum.toString()} ${s.unit} ${s.verb}`:`Juda kichik: kutilgan ${r.origin} ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Noto\u2018g\u2018ri satr: "${o.prefix}" bilan boshlanishi kerak`:o.format==="ends_with"?`Noto\u2018g\u2018ri satr: "${o.suffix}" bilan tugashi kerak`:o.format==="includes"?`Noto\u2018g\u2018ri satr: "${o.includes}" ni o\u2018z ichiga olishi kerak`:o.format==="regex"?`Noto\u2018g\u2018ri satr: ${o.pattern} shabloniga mos kelishi kerak`:`Noto\u2018g\u2018ri ${n[o.format]??r.format}`}case"not_multiple_of":return`Noto\u2018g\u2018ri raqam: ${r.divisor} ning karralisi bo\u2018lishi kerak`;case"unrecognized_keys":return`Noma\u2019lum kalit${r.keys.length>1?"lar":""}: ${b(r.keys,", ")}`;case"invalid_key":return`${r.origin} dagi kalit noto\u2018g\u2018ri`;case"invalid_union":return"Noto\u2018g\u2018ri kirish";case"invalid_element":return`${r.origin} da noto\u2018g\u2018ri qiymat`;default:return"Noto\u2018g\u2018ri kirish"}}};function Qv(){return{localeError:kO()}}var xO=()=>{let t={string:{unit:"k\xFD t\u1EF1",verb:"c\xF3"},file:{unit:"byte",verb:"c\xF3"},array:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"},set:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"}};function e(r){return t[r]??null}let n={regex:"\u0111\u1EA7u v\xE0o",email:"\u0111\u1ECBa ch\u1EC9 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\xE0y gi\u1EDD ISO",date:"ng\xE0y ISO",time:"gi\u1EDD ISO",duration:"kho\u1EA3ng th\u1EDDi gian ISO",ipv4:"\u0111\u1ECBa ch\u1EC9 IPv4",ipv6:"\u0111\u1ECBa ch\u1EC9 IPv6",cidrv4:"d\u1EA3i IPv4",cidrv6:"d\u1EA3i IPv6",base64:"chu\u1ED7i m\xE3 h\xF3a base64",base64url:"chu\u1ED7i m\xE3 h\xF3a base64url",json_string:"chu\u1ED7i JSON",e164:"s\u1ED1 E.164",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"},i={nan:"NaN",number:"s\u1ED1",array:"m\u1EA3ng"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i instanceof ${r.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${c}`:`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${o}, nh\u1EADn \u0111\u01B0\u1EE3c ${c}`}case"invalid_value":return r.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${k(r.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${r.origin??"gi\xE1 tr\u1ECB"} ${s.verb} ${o}${r.maximum.toString()} ${s.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${r.origin??"gi\xE1 tr\u1ECB"} ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${r.origin} ${s.verb} ${o}${r.minimum.toString()} ${s.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${r.origin} ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${o.prefix}"`:o.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${o.suffix}"`:o.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${o.includes}"`:o.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${o.pattern}`:`${n[o.format]??r.format} kh\xF4ng h\u1EE3p l\u1EC7`}case"not_multiple_of":return`S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${r.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${b(r.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${r.origin}`;case"invalid_union":return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7";case"invalid_element":return`Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7 trong ${r.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}};function ek(){return{localeError:xO()}}var SO=()=>{let t={string:{unit:"\u5B57\u7B26",verb:"\u5305\u542B"},file:{unit:"\u5B57\u8282",verb:"\u5305\u542B"},array:{unit:"\u9879",verb:"\u5305\u542B"},set:{unit:"\u9879",verb:"\u5305\u542B"}};function e(r){return t[r]??null}let n={regex:"\u8F93\u5165",email:"\u7535\u5B50\u90AE\u4EF6",url:"URL",emoji:"\u8868\u60C5\u7B26\u53F7",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u671F\u65F6\u95F4",date:"ISO\u65E5\u671F",time:"ISO\u65F6\u95F4",duration:"ISO\u65F6\u957F",ipv4:"IPv4\u5730\u5740",ipv6:"IPv6\u5730\u5740",cidrv4:"IPv4\u7F51\u6BB5",cidrv6:"IPv6\u7F51\u6BB5",base64:"base64\u7F16\u7801\u5B57\u7B26\u4E32",base64url:"base64url\u7F16\u7801\u5B57\u7B26\u4E32",json_string:"JSON\u5B57\u7B26\u4E32",e164:"E.164\u53F7\u7801",jwt:"JWT",template_literal:"\u8F93\u5165"},i={nan:"NaN",number:"\u6570\u5B57",array:"\u6570\u7EC4",null:"\u7A7A\u503C(null)"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B instanceof ${r.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${c}`:`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${o}\uFF0C\u5B9E\u9645\u63A5\u6536 ${c}`}case"invalid_value":return r.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${k(r.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${r.origin??"\u503C"} ${o}${r.maximum.toString()} ${s.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${r.origin??"\u503C"} ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${r.origin} ${o}${r.minimum.toString()} ${s.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${r.origin} ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${o.prefix}" \u5F00\u5934`:o.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${o.suffix}" \u7ED3\u5C3E`:o.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${o.includes}"`:o.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${o.pattern}`:`\u65E0\u6548${n[o.format]??r.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${r.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${b(r.keys,", ")}`;case"invalid_key":return`${r.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${r.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}};function tk(){return{localeError:SO()}}var $O=()=>{let t={string:{unit:"\u5B57\u5143",verb:"\u64C1\u6709"},file:{unit:"\u4F4D\u5143\u7D44",verb:"\u64C1\u6709"},array:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"},set:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"}};function e(r){return t[r]??null}let n={regex:"\u8F38\u5165",email:"\u90F5\u4EF6\u5730\u5740",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 \u65E5\u671F\u6642\u9593",date:"ISO \u65E5\u671F",time:"ISO \u6642\u9593",duration:"ISO \u671F\u9593",ipv4:"IPv4 \u4F4D\u5740",ipv6:"IPv6 \u4F4D\u5740",cidrv4:"IPv4 \u7BC4\u570D",cidrv6:"IPv6 \u7BC4\u570D",base64:"base64 \u7DE8\u78BC\u5B57\u4E32",base64url:"base64url \u7DE8\u78BC\u5B57\u4E32",json_string:"JSON \u5B57\u4E32",e164:"E.164 \u6578\u503C",jwt:"JWT",template_literal:"\u8F38\u5165"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA instanceof ${r.expected}\uFF0C\u4F46\u6536\u5230 ${c}`:`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${o}\uFF0C\u4F46\u6536\u5230 ${c}`}case"invalid_value":return r.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${k(r.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${r.origin??"\u503C"} \u61C9\u70BA ${o}${r.maximum.toString()} ${s.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${r.origin??"\u503C"} \u61C9\u70BA ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${r.origin} \u61C9\u70BA ${o}${r.minimum.toString()} ${s.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${r.origin} \u61C9\u70BA ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${o.prefix}" \u958B\u982D`:o.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${o.suffix}" \u7D50\u5C3E`:o.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${o.includes}"`:o.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${o.pattern}`:`\u7121\u6548\u7684 ${n[o.format]??r.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${r.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${r.keys.length>1?"\u5011":""}\uFF1A${b(r.keys,"\u3001")}`;case"invalid_key":return`${r.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${r.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}};function nk(){return{localeError:$O()}}var IO=()=>{let t={string:{unit:"\xE0mi",verb:"n\xED"},file:{unit:"bytes",verb:"n\xED"},array:{unit:"nkan",verb:"n\xED"},set:{unit:"nkan",verb:"n\xED"}};function e(r){return t[r]??null}let n={regex:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9",email:"\xE0d\xEDr\u1EB9\u0301s\xEC \xECm\u1EB9\u0301l\xEC",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:"\xE0k\xF3k\xF2 ISO",date:"\u1ECDj\u1ECD\u0301 ISO",time:"\xE0k\xF3k\xF2 ISO",duration:"\xE0k\xF3k\xF2 t\xF3 p\xE9 ISO",ipv4:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv4",ipv6:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv6",cidrv4:"\xE0gb\xE8gb\xE8 IPv4",cidrv6:"\xE0gb\xE8gb\xE8 IPv6",base64:"\u1ECD\u0300r\u1ECD\u0300 t\xED a k\u1ECD\u0301 n\xED base64",base64url:"\u1ECD\u0300r\u1ECD\u0300 base64url",json_string:"\u1ECD\u0300r\u1ECD\u0300 JSON",e164:"n\u1ECD\u0301mb\xE0 E.164",jwt:"JWT",template_literal:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9"},i={nan:"NaN",number:"n\u1ECD\u0301mb\xE0",array:"akop\u1ECD"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(r.input),c=i[s]??s;return/^[A-Z]/.test(r.expected)?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi instanceof ${r.expected}, \xE0m\u1ECD\u0300 a r\xED ${c}`:`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${o}, \xE0m\u1ECD\u0300 a r\xED ${c}`}case"invalid_value":return r.values.length===1?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${k(r.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${b(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${r.origin??"iye"} ${s.verb} ${o}${r.maximum} ${s.unit}`:`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${o}${r.maximum}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${r.origin} ${s.verb} ${o}${r.minimum} ${s.unit}`:`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${o}${r.minimum}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\u1EB9\u0300r\u1EB9\u0300 p\u1EB9\u0300l\xFA "${o.prefix}"`:o.format==="ends_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 par\xED p\u1EB9\u0300l\xFA "${o.suffix}"`:o.format==="includes"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 n\xED "${o.includes}"`:o.format==="regex"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\xE1 \xE0p\u1EB9\u1EB9r\u1EB9 mu ${o.pattern}`:`A\u1E63\xEC\u1E63e: ${n[o.format]??r.format}`}case"not_multiple_of":return`N\u1ECD\u0301mb\xE0 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 j\u1EB9\u0301 \xE8y\xE0 p\xEDp\xEDn ti ${r.divisor}`;case"unrecognized_keys":return`B\u1ECDt\xECn\xEC \xE0\xECm\u1ECD\u0300: ${b(r.keys,", ")}`;case"invalid_key":return`B\u1ECDt\xECn\xEC a\u1E63\xEC\u1E63e n\xEDn\xFA ${r.origin}`;case"invalid_union":return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e";case"invalid_element":return`Iye a\u1E63\xEC\u1E63e n\xEDn\xFA ${r.origin}`;default:return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e"}}};function rk(){return{localeError:IO()}}var ik,Sm=Symbol("ZodOutput"),$m=Symbol("ZodInput"),Wc=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...n){let i=n[0];return this._map.set(e,i),i&&typeof i=="object"&&"id"in i&&this._idmap.set(i.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let n=this._map.get(e);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(e),this}get(e){let n=e._zod.parent;if(n){let i={...this.get(n)??{}};delete i.id;let r={...i,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function Jc(){return new Wc}(ik=globalThis).__zod_globalRegistry??(ik.__zod_globalRegistry=Jc());var ze=globalThis.__zod_globalRegistry;function Yc(t,e){return new t({type:"string",...I(e)})}function Im(t,e){return new t({type:"string",coerce:!0,...I(e)})}function wo(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...I(e)})}function Pr(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...I(e)})}function Eo(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...I(e)})}function To(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...I(e)})}function Ro(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...I(e)})}function Oo(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...I(e)})}function Ar(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...I(e)})}function Po(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...I(e)})}function Ao(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...I(e)})}function No(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...I(e)})}function Co(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...I(e)})}function zo(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...I(e)})}function Do(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...I(e)})}function jo(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...I(e)})}function Uo(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...I(e)})}function Mo(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...I(e)})}function Xc(t,e){return new t({type:"string",format:"mac",check:"string_format",abort:!1,...I(e)})}function Lo(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...I(e)})}function Zo(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...I(e)})}function Fo(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...I(e)})}function Bo(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...I(e)})}function qo(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...I(e)})}function Vo(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...I(e)})}var wm={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function Em(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...I(e)})}function Tm(t,e){return new t({type:"string",format:"date",check:"string_format",...I(e)})}function Rm(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...I(e)})}function Om(t,e){return new t({type:"string",format:"duration",check:"string_format",...I(e)})}function Qc(t,e){return new t({type:"number",checks:[],...I(e)})}function Pm(t,e){return new t({type:"number",coerce:!0,checks:[],...I(e)})}function eu(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...I(e)})}function tu(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float32",...I(e)})}function nu(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float64",...I(e)})}function ru(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"int32",...I(e)})}function iu(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"uint32",...I(e)})}function ou(t,e){return new t({type:"boolean",...I(e)})}function Am(t,e){return new t({type:"boolean",coerce:!0,...I(e)})}function su(t,e){return new t({type:"bigint",...I(e)})}function Nm(t,e){return new t({type:"bigint",coerce:!0,...I(e)})}function au(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...I(e)})}function cu(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...I(e)})}function uu(t,e){return new t({type:"symbol",...I(e)})}function lu(t,e){return new t({type:"undefined",...I(e)})}function du(t,e){return new t({type:"null",...I(e)})}function pu(t){return new t({type:"any"})}function mu(t){return new t({type:"unknown"})}function fu(t,e){return new t({type:"never",...I(e)})}function hu(t,e){return new t({type:"void",...I(e)})}function gu(t,e){return new t({type:"date",...I(e)})}function Cm(t,e){return new t({type:"date",coerce:!0,...I(e)})}function bu(t,e){return new t({type:"nan",...I(e)})}function Lt(t,e){return new ja({check:"less_than",...I(e),value:t,inclusive:!1})}function lt(t,e){return new ja({check:"less_than",...I(e),value:t,inclusive:!0})}function Zt(t,e){return new Ua({check:"greater_than",...I(e),value:t,inclusive:!1})}function Ge(t,e){return new Ua({check:"greater_than",...I(e),value:t,inclusive:!0})}function _u(t){return Zt(0,t)}function yu(t){return Lt(0,t)}function vu(t){return lt(0,t)}function ku(t){return Ge(0,t)}function bn(t,e){return new Jp({check:"multiple_of",...I(e),value:t})}function _n(t,e){return new Qp({check:"max_size",...I(e),maximum:t})}function Ft(t,e){return new em({check:"min_size",...I(e),minimum:t})}function Wn(t,e){return new tm({check:"size_equals",...I(e),size:t})}function Jn(t,e){return new nm({check:"max_length",...I(e),maximum:t})}function Xt(t,e){return new rm({check:"min_length",...I(e),minimum:t})}function Yn(t,e){return new im({check:"length_equals",...I(e),length:t})}function Nr(t,e){return new om({check:"string_format",format:"regex",...I(e),pattern:t})}function Cr(t){return new sm({check:"string_format",format:"lowercase",...I(t)})}function zr(t){return new am({check:"string_format",format:"uppercase",...I(t)})}function Dr(t,e){return new cm({check:"string_format",format:"includes",...I(e),includes:t})}function jr(t,e){return new um({check:"string_format",format:"starts_with",...I(e),prefix:t})}function Ur(t,e){return new lm({check:"string_format",format:"ends_with",...I(e),suffix:t})}function xu(t,e,n){return new dm({check:"property",property:t,schema:e,...I(n)})}function Mr(t,e){return new pm({check:"mime_type",mime:t,...I(e)})}function Et(t){return new mm({check:"overwrite",tx:t})}function Lr(t){return Et(e=>e.normalize(t))}function Zr(){return Et(t=>t.trim())}function Fr(){return Et(t=>t.toLowerCase())}function Br(){return Et(t=>t.toUpperCase())}function qr(){return Et(t=>pp(t))}function zm(t,e,n){return new t({type:"array",element:e,...I(n)})}function EO(t,e,n){return new t({type:"union",options:e,...I(n)})}function TO(t,e,n){return new t({type:"union",options:e,inclusive:!1,...I(n)})}function RO(t,e,n,i){return new t({type:"union",options:n,discriminator:e,...I(i)})}function OO(t,e,n){return new t({type:"intersection",left:e,right:n})}function PO(t,e,n,i){let r=n instanceof V,o=r?i:n,s=r?n:null;return new t({type:"tuple",items:e,rest:s,...I(o)})}function AO(t,e,n,i){return new t({type:"record",keyType:e,valueType:n,...I(i)})}function NO(t,e,n,i){return new t({type:"map",keyType:e,valueType:n,...I(i)})}function CO(t,e,n){return new t({type:"set",valueType:e,...I(n)})}function zO(t,e,n){let i=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new t({type:"enum",entries:i,...I(n)})}function DO(t,e,n){return new t({type:"enum",entries:e,...I(n)})}function jO(t,e,n){return new t({type:"literal",values:Array.isArray(e)?e:[e],...I(n)})}function Su(t,e){return new t({type:"file",...I(e)})}function UO(t,e){return new t({type:"transform",transform:e})}function MO(t,e){return new t({type:"optional",innerType:e})}function LO(t,e){return new t({type:"nullable",innerType:e})}function ZO(t,e,n){return new t({type:"default",innerType:e,get defaultValue(){return typeof n=="function"?n():wa(n)}})}function FO(t,e,n){return new t({type:"nonoptional",innerType:e,...I(n)})}function BO(t,e){return new t({type:"success",innerType:e})}function qO(t,e,n){return new t({type:"catch",innerType:e,catchValue:typeof n=="function"?n:()=>n})}function VO(t,e,n){return new t({type:"pipe",in:e,out:n})}function HO(t,e){return new t({type:"readonly",innerType:e})}function KO(t,e,n){return new t({type:"template_literal",parts:e,...I(n)})}function GO(t,e){return new t({type:"lazy",getter:e})}function WO(t,e){return new t({type:"promise",innerType:e})}function $u(t,e,n){let i=I(n);return i.abort??(i.abort=!0),new t({type:"custom",check:"custom",fn:e,...i})}function Iu(t,e,n){return new t({type:"custom",check:"custom",fn:e,...I(n)})}function wu(t,e){let n=ok(i=>(i.addIssue=r=>{if(typeof r=="string")i.issues.push(vr(r,i.value,n._zod.def));else{let o=r;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=i.value),o.inst??(o.inst=n),o.continue??(o.continue=!n._zod.def.abort),i.issues.push(vr(o))}},t(i.value,i)),e);return n}function ok(t,e){let n=new fe({check:"custom",...I(e)});return n._zod.check=t,n}function Eu(t){let e=new fe({check:"describe"});return e._zod.onattach=[n=>{let i=ze.get(n)??{};ze.add(n,{...i,description:t})}],e._zod.check=()=>{},e}function Tu(t){let e=new fe({check:"meta"});return e._zod.onattach=[n=>{let i=ze.get(n)??{};ze.add(n,{...i,...t})}],e._zod.check=()=>{},e}function Ru(t,e){let n=I(e),i=n.truthy??["true","1","yes","on","y","enabled"],r=n.falsy??["false","0","no","off","n","disabled"];n.case!=="sensitive"&&(i=i.map(f=>typeof f=="string"?f.toLowerCase():f),r=r.map(f=>typeof f=="string"?f.toLowerCase():f));let o=new Set(i),s=new Set(r),c=t.Codec??Tr,u=t.Boolean??wr,d=t.String??gn,l=new d({type:"string",error:n.error}),p=new u({type:"boolean",error:n.error}),m=new c({type:"pipe",in:l,out:p,transform:((f,h)=>{let y=f;return n.case!=="sensitive"&&(y=y.toLowerCase()),o.has(y)?!0:s.has(y)?!1:(h.issues.push({code:"invalid_value",expected:"stringbool",values:[...o,...s],input:h.value,inst:m,continue:!1}),{})}),reverseTransform:((f,h)=>f===!0?i[0]||"true":r[0]||"false"),error:n.error});return m}function Xn(t,e,n,i={}){let r=I(i),o={...I(i),check:"string_format",type:"string",format:e,fn:typeof n=="function"?n:c=>n.test(c),...r};return n instanceof RegExp&&(o.pattern=n),new t(o)}function yn(t){let e=t?.target??"draft-2020-12";return e==="draft-4"&&(e="draft-04"),e==="draft-7"&&(e="draft-07"),{processors:t.processors??{},metadataRegistry:t?.metadata??ze,target:e,unrepresentable:t?.unrepresentable??"throw",override:t?.override??(()=>{}),io:t?.io??"output",counter:0,seen:new Map,cycles:t?.cycles??"ref",reused:t?.reused??"inline",external:t?.external??void 0}}function de(t,e,n={path:[],schemaPath:[]}){var i;let r=t._zod.def,o=e.seen.get(t);if(o)return o.count++,n.schemaPath.includes(t)&&(o.cycle=n.path),o.schema;let s={schema:{},count:1,cycle:void 0,path:n.path};e.seen.set(t,s);let c=t._zod.toJSONSchema?.();if(c)s.schema=c;else{let l={...n,schemaPath:[...n.schemaPath,t],path:n.path};if(t._zod.processJSONSchema)t._zod.processJSONSchema(e,s.schema,l);else{let m=s.schema,f=e.processors[r.type];if(!f)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${r.type}`);f(t,e,m,l)}let p=t._zod.parent;p&&(s.ref||(s.ref=p),de(p,e,l),e.seen.get(p).isParent=!0)}let u=e.metadataRegistry.get(t);return u&&Object.assign(s.schema,u),e.io==="input"&&We(t)&&(delete s.schema.examples,delete s.schema.default),e.io==="input"&&"_prefault"in s.schema&&((i=s.schema).default??(i.default=s.schema._prefault)),delete s.schema._prefault,e.seen.get(t).schema}function vn(t,e){let n=t.seen.get(e);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");let i=new Map;for(let s of t.seen.entries()){let c=t.metadataRegistry.get(s[0])?.id;if(c){let u=i.get(c);if(u&&u!==s[0])throw new Error(`Duplicate schema id "${c}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);i.set(c,s[0])}}let r=s=>{let c=t.target==="draft-2020-12"?"$defs":"definitions";if(t.external){let p=t.external.registry.get(s[0])?.id,m=t.external.uri??(h=>h);if(p)return{ref:m(p)};let f=s[1].defId??s[1].schema.id??`schema${t.counter++}`;return s[1].defId=f,{defId:f,ref:`${m("__shared")}#/${c}/${f}`}}if(s[1]===n)return{ref:"#"};let d=`#/${c}/`,l=s[1].schema.id??`__schema${t.counter++}`;return{defId:l,ref:d+l}},o=s=>{if(s[1].schema.$ref)return;let c=s[1],{ref:u,defId:d}=r(s);c.def={...c.schema},d&&(c.defId=d);let l=c.schema;for(let p in l)delete l[p];l.$ref=u};if(t.cycles==="throw")for(let s of t.seen.entries()){let c=s[1];if(c.cycle)throw new Error(`Cycle detected: #/${c.cycle?.join("/")}/<root>
|
|
73
73
|
|
|
74
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let a of t.seen.entries()){let c=a[1];if(e===a[0]){i(a);continue}if(t.external){let d=t.external.registry.get(a[0])?.id;if(e!==a[0]&&d){i(a);continue}}if(t.metadataRegistry.get(a[0])?.id){i(a);continue}if(c.cycle){i(a);continue}if(c.count>1&&t.reused==="ref"){i(a);continue}}}function Sr(t,e){let n=t.seen.get(e);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=c=>{let u=t.seen.get(c);if(u.ref===null)return;let d=u.def??u.schema,l={...d},p=u.ref;if(u.ref=null,p){o(p);let f=t.seen.get(p),g=f.schema;if(g.$ref&&(t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0")?(d.allOf=d.allOf??[],d.allOf.push(g)):Object.assign(d,g),Object.assign(d,l),c._zod.parent===p)for(let b in d)b==="$ref"||b==="allOf"||b in l||delete d[b];if(g.$ref&&f.def)for(let b in d)b==="$ref"||b==="allOf"||b in f.def&&JSON.stringify(d[b])===JSON.stringify(f.def[b])&&delete d[b]}let m=c._zod.parent;if(m&&m!==p){o(m);let f=t.seen.get(m);if(f?.schema.$ref&&(d.$ref=f.schema.$ref,f.def))for(let g in d)g==="$ref"||g==="allOf"||g in f.def&&JSON.stringify(d[g])===JSON.stringify(f.def[g])&&delete d[g]}t.override({zodSchema:c,jsonSchema:d,path:u.path??[]})};for(let c of[...t.seen.entries()].reverse())o(c[0]);let r={};if(t.target==="draft-2020-12"?r.$schema="https://json-schema.org/draft/2020-12/schema":t.target==="draft-07"?r.$schema="http://json-schema.org/draft-07/schema#":t.target==="draft-04"?r.$schema="http://json-schema.org/draft-04/schema#":t.target,t.external?.uri){let c=t.external.registry.get(e)?.id;if(!c)throw new Error("Schema is missing an `id` property");r.$id=t.external.uri(c)}Object.assign(r,n.def??n.schema);let i=t.metadataRegistry.get(e)?.id;i!==void 0&&r.id===i&&delete r.id;let a=t.external?.defs??{};for(let c of t.seen.entries()){let u=c[1];u.def&&u.defId&&(u.def.id===u.defId&&delete u.def.id,a[u.defId]=u.def)}t.external||Object.keys(a).length>0&&(t.target==="draft-2020-12"?r.$defs=a:r.definitions=a);try{let c=JSON.parse(JSON.stringify(r));return Object.defineProperty(c,"~standard",{value:{...e["~standard"],jsonSchema:{input:Gn(e,"input",t.processors),output:Gn(e,"output",t.processors)}},enumerable:!1,writable:!1}),c}catch{throw new Error("Error converting schema to JSON.")}}function We(t,e){let n=e??{seen:new Set};if(n.seen.has(t))return!1;n.seen.add(t);let o=t._zod.def;if(o.type==="transform")return!0;if(o.type==="array")return We(o.element,n);if(o.type==="set")return We(o.valueType,n);if(o.type==="lazy")return We(o.getter(),n);if(o.type==="promise"||o.type==="optional"||o.type==="nonoptional"||o.type==="nullable"||o.type==="readonly"||o.type==="default"||o.type==="prefault")return We(o.innerType,n);if(o.type==="intersection")return We(o.left,n)||We(o.right,n);if(o.type==="record"||o.type==="map")return We(o.keyType,n)||We(o.valueType,n);if(o.type==="pipe")return t._zod.traits.has("$ZodCodec")?!0:We(o.in,n)||We(o.out,n);if(o.type==="object"){for(let r in o.shape)if(We(o.shape[r],n))return!0;return!1}if(o.type==="union"){for(let r of o.options)if(We(r,n))return!0;return!1}if(o.type==="tuple"){for(let r of o.items)if(We(r,n))return!0;return!!(o.rest&&We(o.rest,n))}return!1}var Lm=(t,e={})=>n=>{let o=kr({...n,processors:e});return de(t,o),xr(o,t),Sr(o,t)},Gn=(t,e,n={})=>o=>{let{libraryOptions:r,target:i}=o??{},a=kr({...r??{},target:i,io:e,processors:n});return de(t,a),xr(a,t),Sr(a,t)};var nR={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Mm=(t,e,n,o)=>{let r=n;r.type="string";let{minimum:i,maximum:a,format:c,patterns:u,contentEncoding:d}=t._zod.bag;if(typeof i=="number"&&(r.minLength=i),typeof a=="number"&&(r.maxLength=a),c&&(r.format=nR[c]??c,r.format===""&&delete r.format,c==="time"&&delete r.format),d&&(r.contentEncoding=d),u&&u.size>0){let l=[...u];l.length===1?r.pattern=l[0].source:l.length>1&&(r.allOf=[...l.map(p=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:p.source}))])}},Zm=(t,e,n,o)=>{let r=n,{minimum:i,maximum:a,format:c,multipleOf:u,exclusiveMaximum:d,exclusiveMinimum:l}=t._zod.bag;typeof c=="string"&&c.includes("int")?r.type="integer":r.type="number";let p=typeof l=="number"&&l>=(i??Number.NEGATIVE_INFINITY),m=typeof d=="number"&&d<=(a??Number.POSITIVE_INFINITY),f=e.target==="draft-04"||e.target==="openapi-3.0";p?f?(r.minimum=l,r.exclusiveMinimum=!0):r.exclusiveMinimum=l:typeof i=="number"&&(r.minimum=i),m?f?(r.maximum=d,r.exclusiveMaximum=!0):r.exclusiveMaximum=d:typeof a=="number"&&(r.maximum=a),typeof u=="number"&&(r.multipleOf=u)},Fm=(t,e,n,o)=>{n.type="boolean"},Vm=(t,e,n,o)=>{if(e.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},qm=(t,e,n,o)=>{if(e.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},Bm=(t,e,n,o)=>{e.target==="openapi-3.0"?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"},Hm=(t,e,n,o)=>{if(e.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},Km=(t,e,n,o)=>{if(e.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},Gm=(t,e,n,o)=>{n.not={}},Wm=(t,e,n,o)=>{},Jm=(t,e,n,o)=>{},Ym=(t,e,n,o)=>{if(e.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},Xm=(t,e,n,o)=>{let r=t._zod.def,i=di(r.entries);i.every(a=>typeof a=="number")&&(n.type="number"),i.every(a=>typeof a=="string")&&(n.type="string"),n.enum=i},Qm=(t,e,n,o)=>{let r=t._zod.def,i=[];for(let a of r.values)if(a===void 0){if(e.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof a=="bigint"){if(e.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");i.push(Number(a))}else i.push(a);if(i.length!==0)if(i.length===1){let a=i[0];n.type=a===null?"null":typeof a,e.target==="draft-04"||e.target==="openapi-3.0"?n.enum=[a]:n.const=a}else i.every(a=>typeof a=="number")&&(n.type="number"),i.every(a=>typeof a=="string")&&(n.type="string"),i.every(a=>typeof a=="boolean")&&(n.type="boolean"),i.every(a=>a===null)&&(n.type="null"),n.enum=i},ef=(t,e,n,o)=>{if(e.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},tf=(t,e,n,o)=>{let r=n,i=t._zod.pattern;if(!i)throw new Error("Pattern not found in template literal");r.type="string",r.pattern=i.source},rf=(t,e,n,o)=>{let r=n,i={type:"string",format:"binary",contentEncoding:"binary"},{minimum:a,maximum:c,mime:u}=t._zod.bag;a!==void 0&&(i.minLength=a),c!==void 0&&(i.maxLength=c),u?u.length===1?(i.contentMediaType=u[0],Object.assign(r,i)):(Object.assign(r,i),r.anyOf=u.map(d=>({contentMediaType:d}))):Object.assign(r,i)},nf=(t,e,n,o)=>{n.type="boolean"},of=(t,e,n,o)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},af=(t,e,n,o)=>{if(e.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},sf=(t,e,n,o)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},cf=(t,e,n,o)=>{if(e.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},uf=(t,e,n,o)=>{if(e.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},lf=(t,e,n,o)=>{let r=n,i=t._zod.def,{minimum:a,maximum:c}=t._zod.bag;typeof a=="number"&&(r.minItems=a),typeof c=="number"&&(r.maxItems=c),r.type="array",r.items=de(i.element,e,{...o,path:[...o.path,"items"]})},df=(t,e,n,o)=>{let r=n,i=t._zod.def;r.type="object",r.properties={};let a=i.shape;for(let d in a)r.properties[d]=de(a[d],e,{...o,path:[...o.path,"properties",d]});let c=new Set(Object.keys(a)),u=new Set([...c].filter(d=>{let l=i.shape[d]._zod;return e.io==="input"?l.optin===void 0:l.optout===void 0}));u.size>0&&(r.required=Array.from(u)),i.catchall?._zod.def.type==="never"?r.additionalProperties=!1:i.catchall?i.catchall&&(r.additionalProperties=de(i.catchall,e,{...o,path:[...o.path,"additionalProperties"]})):e.io==="output"&&(r.additionalProperties=!1)},zu=(t,e,n,o)=>{let r=t._zod.def,i=r.inclusive===!1,a=r.options.map((c,u)=>de(c,e,{...o,path:[...o.path,i?"oneOf":"anyOf",u]}));i?n.oneOf=a:n.anyOf=a},pf=(t,e,n,o)=>{let r=t._zod.def,i=de(r.left,e,{...o,path:[...o.path,"allOf",0]}),a=de(r.right,e,{...o,path:[...o.path,"allOf",1]}),c=d=>"allOf"in d&&Object.keys(d).length===1,u=[...c(i)?i.allOf:[i],...c(a)?a.allOf:[a]];n.allOf=u},mf=(t,e,n,o)=>{let r=n,i=t._zod.def;r.type="array";let a=e.target==="draft-2020-12"?"prefixItems":"items",c=e.target==="draft-2020-12"||e.target==="openapi-3.0"?"items":"additionalItems",u=i.items.map((m,f)=>de(m,e,{...o,path:[...o.path,a,f]})),d=i.rest?de(i.rest,e,{...o,path:[...o.path,c,...e.target==="openapi-3.0"?[i.items.length]:[]]}):null;e.target==="draft-2020-12"?(r.prefixItems=u,d&&(r.items=d)):e.target==="openapi-3.0"?(r.items={anyOf:u},d&&r.items.anyOf.push(d),r.minItems=u.length,d||(r.maxItems=u.length)):(r.items=u,d&&(r.additionalItems=d));let{minimum:l,maximum:p}=t._zod.bag;typeof l=="number"&&(r.minItems=l),typeof p=="number"&&(r.maxItems=p)},ff=(t,e,n,o)=>{let r=n,i=t._zod.def;r.type="object";let a=i.keyType,u=a._zod.bag?.patterns;if(i.mode==="loose"&&u&&u.size>0){let l=de(i.valueType,e,{...o,path:[...o.path,"patternProperties","*"]});r.patternProperties={};for(let p of u)r.patternProperties[p.source]=l}else(e.target==="draft-07"||e.target==="draft-2020-12")&&(r.propertyNames=de(i.keyType,e,{...o,path:[...o.path,"propertyNames"]})),r.additionalProperties=de(i.valueType,e,{...o,path:[...o.path,"additionalProperties"]});let d=a._zod.values;if(d){let l=[...d].filter(p=>typeof p=="string"||typeof p=="number");l.length>0&&(r.required=l)}},hf=(t,e,n,o)=>{let r=t._zod.def,i=de(r.innerType,e,o),a=e.seen.get(t);e.target==="openapi-3.0"?(a.ref=r.innerType,n.nullable=!0):n.anyOf=[i,{type:"null"}]},gf=(t,e,n,o)=>{let r=t._zod.def;de(r.innerType,e,o);let i=e.seen.get(t);i.ref=r.innerType},_f=(t,e,n,o)=>{let r=t._zod.def;de(r.innerType,e,o);let i=e.seen.get(t);i.ref=r.innerType,n.default=JSON.parse(JSON.stringify(r.defaultValue))},yf=(t,e,n,o)=>{let r=t._zod.def;de(r.innerType,e,o);let i=e.seen.get(t);i.ref=r.innerType,e.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(r.defaultValue)))},vf=(t,e,n,o)=>{let r=t._zod.def;de(r.innerType,e,o);let i=e.seen.get(t);i.ref=r.innerType;let a;try{a=r.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=a},bf=(t,e,n,o)=>{let r=t._zod.def,i=r.in._zod.traits.has("$ZodTransform"),a=e.io==="input"?i?r.out:r.in:r.out;de(a,e,o);let c=e.seen.get(t);c.ref=a},kf=(t,e,n,o)=>{let r=t._zod.def;de(r.innerType,e,o);let i=e.seen.get(t);i.ref=r.innerType,n.readOnly=!0},xf=(t,e,n,o)=>{let r=t._zod.def;de(r.innerType,e,o);let i=e.seen.get(t);i.ref=r.innerType},Du=(t,e,n,o)=>{let r=t._zod.def;de(r.innerType,e,o);let i=e.seen.get(t);i.ref=r.innerType},Sf=(t,e,n,o)=>{let r=t._zod.innerType;de(r,e,o);let i=e.seen.get(t);i.ref=r},Nu={string:Mm,number:Zm,boolean:Fm,bigint:Vm,symbol:qm,null:Bm,undefined:Hm,void:Km,never:Gm,any:Wm,unknown:Jm,date:Ym,enum:Xm,literal:Qm,nan:ef,template_literal:tf,file:rf,success:nf,custom:of,function:af,transform:sf,map:cf,set:uf,array:lf,object:df,union:zu,intersection:pf,tuple:mf,record:ff,nullable:hf,nonoptional:gf,default:_f,prefault:yf,catch:vf,pipe:bf,readonly:kf,promise:xf,optional:Du,lazy:Sf};function Xr(t,e){if("_idmap"in t){let o=t,r=kr({...e,processors:Nu}),i={};for(let u of o._idmap.entries()){let[d,l]=u;de(l,r)}let a={},c={registry:o,uri:e?.uri,defs:i};r.external=c;for(let u of o._idmap.entries()){let[d,l]=u;xr(r,l),a[d]=Sr(r,l)}if(Object.keys(i).length>0){let u=r.target==="draft-2020-12"?"$defs":"definitions";a.__shared={[u]:i}}return{schemas:a}}let n=kr({...e,processors:Nu});return de(t,n),xr(n,t),Sr(n,t)}var ju=class{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(e){this.ctx.counter=e}get seen(){return this.ctx.seen}constructor(e){let n=e?.target??"draft-2020-12";n==="draft-4"&&(n="draft-04"),n==="draft-7"&&(n="draft-07"),this.ctx=kr({processors:Nu,target:n,...e?.metadata&&{metadata:e.metadata},...e?.unrepresentable&&{unrepresentable:e.unrepresentable},...e?.override&&{override:e.override},...e?.io&&{io:e.io}})}process(e,n={path:[],schemaPath:[]}){return de(e,this.ctx,n)}emit(e,n){n&&(n.cycles&&(this.ctx.cycles=n.cycles),n.reused&&(this.ctx.reused=n.reused),n.external&&(this.ctx.external=n.external)),xr(this.ctx,e);let o=Sr(this.ctx,e),{"~standard":r,...i}=o;return i}};var Xb={};var Gi={};Jt(Gi,{ZodAny:()=>qf,ZodArray:()=>Gf,ZodBase64:()=>ol,ZodBase64URL:()=>il,ZodBigInt:()=>to,ZodBigIntFormat:()=>cl,ZodBoolean:()=>eo,ZodCIDRv4:()=>rl,ZodCIDRv6:()=>nl,ZodCUID:()=>Wu,ZodCUID2:()=>Ju,ZodCatch:()=>fh,ZodCodec:()=>ia,ZodCustom:()=>aa,ZodCustomStringFormat:()=>Xn,ZodDate:()=>ea,ZodDefault:()=>ch,ZodDiscriminatedUnion:()=>Jf,ZodE164:()=>al,ZodEmail:()=>Hu,ZodEmoji:()=>Ku,ZodEnum:()=>Jn,ZodExactOptional:()=>ih,ZodFile:()=>nh,ZodFunction:()=>$h,ZodGUID:()=>Wi,ZodIPv4:()=>el,ZodIPv6:()=>tl,ZodIntersection:()=>Yf,ZodJWT:()=>sl,ZodKSUID:()=>Qu,ZodLazy:()=>kh,ZodLiteral:()=>rh,ZodMAC:()=>Mf,ZodMap:()=>eh,ZodNaN:()=>gh,ZodNanoID:()=>Gu,ZodNever:()=>Hf,ZodNonOptional:()=>dl,ZodNull:()=>Vf,ZodNullable:()=>sh,ZodNumber:()=>Qn,ZodNumberFormat:()=>Qr,ZodObject:()=>ta,ZodOptional:()=>no,ZodPipe:()=>oa,ZodPrefault:()=>lh,ZodPreprocess:()=>_h,ZodPromise:()=>Sh,ZodReadonly:()=>yh,ZodRecord:()=>Wn,ZodSet:()=>th,ZodString:()=>Yn,ZodStringFormat:()=>he,ZodSuccess:()=>mh,ZodSymbol:()=>Zf,ZodTemplateLiteral:()=>bh,ZodTransform:()=>oh,ZodTuple:()=>Xf,ZodType:()=>K,ZodULID:()=>Yu,ZodURL:()=>Xi,ZodUUID:()=>Vt,ZodUndefined:()=>Ff,ZodUnion:()=>ra,ZodUnknown:()=>Bf,ZodVoid:()=>Kf,ZodXID:()=>Xu,ZodXor:()=>Wf,_ZodString:()=>Bu,_default:()=>uh,_function:()=>nx,any:()=>Uk,array:()=>X,base64:()=>kk,base64url:()=>xk,bigint:()=>Ck,boolean:()=>Pe,catch:()=>hh,check:()=>ox,cidrv4:()=>vk,cidrv6:()=>bk,codec:()=>Qk,cuid:()=>dk,cuid2:()=>pk,custom:()=>pl,date:()=>Mk,describe:()=>ix,discriminatedUnion:()=>na,e164:()=>Sk,email:()=>tk,emoji:()=>uk,enum:()=>ze,exactOptional:()=>ah,file:()=>Wk,float32:()=>Pk,float64:()=>Ok,function:()=>nx,guid:()=>rk,hash:()=>Tk,hex:()=>Ek,hostname:()=>wk,httpUrl:()=>ck,instanceof:()=>sx,int:()=>Vu,int32:()=>Rk,int64:()=>Nk,intersection:()=>ro,invertCodec:()=>ex,ipv4:()=>gk,ipv6:()=>yk,json:()=>ux,jwt:()=>$k,keyof:()=>Zk,ksuid:()=>hk,lazy:()=>xh,literal:()=>L,looseObject:()=>Ne,looseRecord:()=>Bk,mac:()=>_k,map:()=>Hk,meta:()=>ax,nan:()=>Xk,nanoid:()=>lk,nativeEnum:()=>Gk,never:()=>ul,nonoptional:()=>ph,null:()=>Qi,nullable:()=>Ji,nullish:()=>Jk,number:()=>se,object:()=>A,optional:()=>be,partialRecord:()=>qk,pipe:()=>qu,prefault:()=>dh,preprocess:()=>sa,promise:()=>rx,readonly:()=>vh,record:()=>me,refine:()=>Ih,set:()=>Kk,strictObject:()=>Fk,string:()=>y,stringFormat:()=>Ik,stringbool:()=>cx,success:()=>Yk,superRefine:()=>wh,symbol:()=>Dk,templateLiteral:()=>tx,transform:()=>ll,tuple:()=>Qf,uint32:()=>Ak,uint64:()=>zk,ulid:()=>mk,undefined:()=>jk,union:()=>_e,unknown:()=>ge,url:()=>sk,uuid:()=>nk,uuidv4:()=>ok,uuidv6:()=>ik,uuidv7:()=>ak,void:()=>Lk,xid:()=>fk,xor:()=>Vk});var Uu={};Jt(Uu,{endsWith:()=>Zn,gt:()=>Zt,gte:()=>Ge,includes:()=>Ln,length:()=>Jr,lowercase:()=>jn,lt:()=>Mt,lte:()=>dt,maxLength:()=>Wr,maxSize:()=>br,mime:()=>Fn,minLength:()=>Xt,minSize:()=>Ft,multipleOf:()=>vr,negative:()=>Su,nonnegative:()=>Iu,nonpositive:()=>$u,normalize:()=>Vn,overwrite:()=>Et,positive:()=>xu,property:()=>wu,regex:()=>Dn,size:()=>Gr,slugify:()=>Kn,startsWith:()=>Mn,toLowerCase:()=>Bn,toUpperCase:()=>Hn,trim:()=>qn,uppercase:()=>Un});var $r={};Jt($r,{ZodISODate:()=>Mu,ZodISODateTime:()=>Lu,ZodISODuration:()=>Fu,ZodISOTime:()=>Zu,date:()=>If,datetime:()=>$f,duration:()=>Ef,time:()=>wf});var Lu=h("ZodISODateTime",(t,e)=>{vm.init(t,e),he.init(t,e)});function $f(t){return Om(Lu,t)}var Mu=h("ZodISODate",(t,e)=>{bm.init(t,e),he.init(t,e)});function If(t){return Rm(Mu,t)}var Zu=h("ZodISOTime",(t,e)=>{km.init(t,e),he.init(t,e)});function wf(t){return Am(Zu,t)}var Fu=h("ZodISODuration",(t,e)=>{xm.init(t,e),he.init(t,e)});function Ef(t){return Cm(Fu,t)}var Qb=(t,e)=>{gi.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:n=>yi(t,n)},flatten:{value:n=>_i(t,n)},addIssue:{value:n=>{t.issues.push(n),t.message=JSON.stringify(t.issues,kn,2)}},addIssues:{value:n=>{t.issues.push(...n),t.message=JSON.stringify(t.issues,kn,2)}},isEmpty:{get(){return t.issues.length===0}}})},iR=h("ZodError",Qb),it=h("ZodError",Qb,{Parent:Error});var Tf=$n(it),Pf=In(it),Of=wn(it),Rf=En(it),Af=Rs(it),Cf=As(it),Nf=Cs(it),zf=Ns(it),Df=zs(it),jf=Ds(it),Uf=js(it),Lf=Us(it);var ek=new WeakMap;function Yi(t,e,n){let o=Object.getPrototypeOf(t),r=ek.get(o);if(r||(r=new Set,ek.set(o,r)),!r.has(e)){r.add(e);for(let i in n){let a=n[i];Object.defineProperty(o,i,{configurable:!0,enumerable:!1,get(){let c=a.bind(this);return Object.defineProperty(this,i,{configurable:!0,writable:!0,enumerable:!0,value:c}),c},set(c){Object.defineProperty(this,i,{configurable:!0,writable:!0,enumerable:!0,value:c})}})}}}var K=h("ZodType",(t,e)=>(B.init(t,e),Object.assign(t["~standard"],{jsonSchema:{input:Gn(t,"input"),output:Gn(t,"output")}}),t.toJSONSchema=Lm(t,{}),t.def=e,t.type=e.type,Object.defineProperty(t,"_def",{value:e}),t.parse=(n,o)=>Tf(t,n,o,{callee:t.parse}),t.safeParse=(n,o)=>Of(t,n,o),t.parseAsync=async(n,o)=>Pf(t,n,o,{callee:t.parseAsync}),t.safeParseAsync=async(n,o)=>Rf(t,n,o),t.spa=t.safeParseAsync,t.encode=(n,o)=>Af(t,n,o),t.decode=(n,o)=>Cf(t,n,o),t.encodeAsync=async(n,o)=>Nf(t,n,o),t.decodeAsync=async(n,o)=>zf(t,n,o),t.safeEncode=(n,o)=>Df(t,n,o),t.safeDecode=(n,o)=>jf(t,n,o),t.safeEncodeAsync=async(n,o)=>Uf(t,n,o),t.safeDecodeAsync=async(n,o)=>Lf(t,n,o),Yi(t,"ZodType",{check(...n){let o=this.def;return this.clone(S.mergeDefs(o,{checks:[...o.checks??[],...n.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0})},with(...n){return this.check(...n)},clone(n,o){return Ae(this,n,o)},brand(){return this},register(n,o){return n.add(this,o),this},refine(n,o){return this.check(Ih(n,o))},superRefine(n,o){return this.check(wh(n,o))},overwrite(n){return this.check(Et(n))},optional(){return be(this)},exactOptional(){return ah(this)},nullable(){return Ji(this)},nullish(){return be(Ji(this))},nonoptional(n){return ph(this,n)},array(){return X(this)},or(n){return _e([this,n])},and(n){return ro(this,n)},transform(n){return qu(this,ll(n))},default(n){return uh(this,n)},prefault(n){return dh(this,n)},catch(n){return hh(this,n)},pipe(n){return qu(this,n)},readonly(){return vh(this)},describe(n){let o=this.clone();return Ce.add(o,{description:n}),o},meta(...n){if(n.length===0)return Ce.get(this);let o=this.clone();return Ce.add(o,n[0]),o},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(n){return n(this)}}),Object.defineProperty(t,"description",{get(){return Ce.get(t)?.description},configurable:!0}),t)),Bu=h("_ZodString",(t,e)=>{yr.init(t,e),K.init(t,e),t._zod.processJSONSchema=(o,r,i)=>Mm(t,o,r,i);let n=t._zod.bag;t.format=n.format??null,t.minLength=n.minimum??null,t.maxLength=n.maximum??null,Yi(t,"_ZodString",{regex(...o){return this.check(Dn(...o))},includes(...o){return this.check(Ln(...o))},startsWith(...o){return this.check(Mn(...o))},endsWith(...o){return this.check(Zn(...o))},min(...o){return this.check(Xt(...o))},max(...o){return this.check(Wr(...o))},length(...o){return this.check(Jr(...o))},nonempty(...o){return this.check(Xt(1,...o))},lowercase(o){return this.check(jn(o))},uppercase(o){return this.check(Un(o))},trim(){return this.check(qn())},normalize(...o){return this.check(Vn(...o))},toLowerCase(){return this.check(Bn())},toUpperCase(){return this.check(Hn())},slugify(){return this.check(Kn())}})}),Yn=h("ZodString",(t,e)=>{yr.init(t,e),Bu.init(t,e),t.email=n=>t.check(Ti(Hu,n)),t.url=n=>t.check(zn(Xi,n)),t.jwt=n=>t.check(Ki(sl,n)),t.emoji=n=>t.check(Ci(Ku,n)),t.guid=n=>t.check(Nn(Wi,n)),t.uuid=n=>t.check(Pi(Vt,n)),t.uuidv4=n=>t.check(Oi(Vt,n)),t.uuidv6=n=>t.check(Ri(Vt,n)),t.uuidv7=n=>t.check(Ai(Vt,n)),t.nanoid=n=>t.check(Ni(Gu,n)),t.guid=n=>t.check(Nn(Wi,n)),t.cuid=n=>t.check(zi(Wu,n)),t.cuid2=n=>t.check(Di(Ju,n)),t.ulid=n=>t.check(ji(Yu,n)),t.base64=n=>t.check(qi(ol,n)),t.base64url=n=>t.check(Bi(il,n)),t.xid=n=>t.check(Ui(Xu,n)),t.ksuid=n=>t.check(Li(Qu,n)),t.ipv4=n=>t.check(Mi(el,n)),t.ipv6=n=>t.check(Zi(tl,n)),t.cidrv4=n=>t.check(Fi(rl,n)),t.cidrv6=n=>t.check(Vi(nl,n)),t.e164=n=>t.check(Hi(al,n)),t.datetime=n=>t.check($f(n)),t.date=n=>t.check(If(n)),t.time=n=>t.check(wf(n)),t.duration=n=>t.check(Ef(n))});function y(t){return tu(Yn,t)}var he=h("ZodStringFormat",(t,e)=>{pe.init(t,e),Bu.init(t,e)}),Hu=h("ZodEmail",(t,e)=>{Ws.init(t,e),he.init(t,e)});function tk(t){return Ti(Hu,t)}var Wi=h("ZodGUID",(t,e)=>{Ks.init(t,e),he.init(t,e)});function rk(t){return Nn(Wi,t)}var Vt=h("ZodUUID",(t,e)=>{Gs.init(t,e),he.init(t,e)});function nk(t){return Pi(Vt,t)}function ok(t){return Oi(Vt,t)}function ik(t){return Ri(Vt,t)}function ak(t){return Ai(Vt,t)}var Xi=h("ZodURL",(t,e)=>{Js.init(t,e),he.init(t,e)});function sk(t){return zn(Xi,t)}function ck(t){return zn(Xi,{protocol:ot.httpProtocol,hostname:ot.domain,...S.normalizeParams(t)})}var Ku=h("ZodEmoji",(t,e)=>{Ys.init(t,e),he.init(t,e)});function uk(t){return Ci(Ku,t)}var Gu=h("ZodNanoID",(t,e)=>{Xs.init(t,e),he.init(t,e)});function lk(t){return Ni(Gu,t)}var Wu=h("ZodCUID",(t,e)=>{Qs.init(t,e),he.init(t,e)});function dk(t){return zi(Wu,t)}var Ju=h("ZodCUID2",(t,e)=>{ec.init(t,e),he.init(t,e)});function pk(t){return Di(Ju,t)}var Yu=h("ZodULID",(t,e)=>{tc.init(t,e),he.init(t,e)});function mk(t){return ji(Yu,t)}var Xu=h("ZodXID",(t,e)=>{rc.init(t,e),he.init(t,e)});function fk(t){return Ui(Xu,t)}var Qu=h("ZodKSUID",(t,e)=>{nc.init(t,e),he.init(t,e)});function hk(t){return Li(Qu,t)}var el=h("ZodIPv4",(t,e)=>{oc.init(t,e),he.init(t,e)});function gk(t){return Mi(el,t)}var Mf=h("ZodMAC",(t,e)=>{ac.init(t,e),he.init(t,e)});function _k(t){return ru(Mf,t)}var tl=h("ZodIPv6",(t,e)=>{ic.init(t,e),he.init(t,e)});function yk(t){return Zi(tl,t)}var rl=h("ZodCIDRv4",(t,e)=>{sc.init(t,e),he.init(t,e)});function vk(t){return Fi(rl,t)}var nl=h("ZodCIDRv6",(t,e)=>{cc.init(t,e),he.init(t,e)});function bk(t){return Vi(nl,t)}var ol=h("ZodBase64",(t,e)=>{uc.init(t,e),he.init(t,e)});function kk(t){return qi(ol,t)}var il=h("ZodBase64URL",(t,e)=>{lc.init(t,e),he.init(t,e)});function xk(t){return Bi(il,t)}var al=h("ZodE164",(t,e)=>{dc.init(t,e),he.init(t,e)});function Sk(t){return Hi(al,t)}var sl=h("ZodJWT",(t,e)=>{pc.init(t,e),he.init(t,e)});function $k(t){return Ki(sl,t)}var Xn=h("ZodCustomStringFormat",(t,e)=>{mc.init(t,e),he.init(t,e)});function Ik(t,e,n={}){return Yr(Xn,t,e,n)}function wk(t){return Yr(Xn,"hostname",ot.hostname,t)}function Ek(t){return Yr(Xn,"hex",ot.hex,t)}function Tk(t,e){let n=e?.enc??"hex",o=`${t}_${n}`,r=ot[o];if(!r)throw new Error(`Unrecognized hash format: ${o}`);return Yr(Xn,o,r,e)}var Qn=h("ZodNumber",(t,e)=>{xi.init(t,e),K.init(t,e),t._zod.processJSONSchema=(o,r,i)=>Zm(t,o,r,i),Yi(t,"ZodNumber",{gt(o,r){return this.check(Zt(o,r))},gte(o,r){return this.check(Ge(o,r))},min(o,r){return this.check(Ge(o,r))},lt(o,r){return this.check(Mt(o,r))},lte(o,r){return this.check(dt(o,r))},max(o,r){return this.check(dt(o,r))},int(o){return this.check(Vu(o))},safe(o){return this.check(Vu(o))},positive(o){return this.check(Zt(0,o))},nonnegative(o){return this.check(Ge(0,o))},negative(o){return this.check(Mt(0,o))},nonpositive(o){return this.check(dt(0,o))},multipleOf(o,r){return this.check(vr(o,r))},step(o,r){return this.check(vr(o,r))},finite(){return this}});let n=t._zod.bag;t.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,t.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,t.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),t.isFinite=!0,t.format=n.format??null});function se(t){return nu(Qn,t)}var Qr=h("ZodNumberFormat",(t,e)=>{fc.init(t,e),Qn.init(t,e)});function Vu(t){return ou(Qr,t)}function Pk(t){return iu(Qr,t)}function Ok(t){return au(Qr,t)}function Rk(t){return su(Qr,t)}function Ak(t){return cu(Qr,t)}var eo=h("ZodBoolean",(t,e)=>{Pn.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,o,r)=>Fm(t,n,o,r)});function Pe(t){return uu(eo,t)}var to=h("ZodBigInt",(t,e)=>{Si.init(t,e),K.init(t,e),t._zod.processJSONSchema=(o,r,i)=>Vm(t,o,r,i),t.gte=(o,r)=>t.check(Ge(o,r)),t.min=(o,r)=>t.check(Ge(o,r)),t.gt=(o,r)=>t.check(Zt(o,r)),t.gte=(o,r)=>t.check(Ge(o,r)),t.min=(o,r)=>t.check(Ge(o,r)),t.lt=(o,r)=>t.check(Mt(o,r)),t.lte=(o,r)=>t.check(dt(o,r)),t.max=(o,r)=>t.check(dt(o,r)),t.positive=o=>t.check(Zt(BigInt(0),o)),t.negative=o=>t.check(Mt(BigInt(0),o)),t.nonpositive=o=>t.check(dt(BigInt(0),o)),t.nonnegative=o=>t.check(Ge(BigInt(0),o)),t.multipleOf=(o,r)=>t.check(vr(o,r));let n=t._zod.bag;t.minValue=n.minimum??null,t.maxValue=n.maximum??null,t.format=n.format??null});function Ck(t){return lu(to,t)}var cl=h("ZodBigIntFormat",(t,e)=>{hc.init(t,e),to.init(t,e)});function Nk(t){return du(cl,t)}function zk(t){return pu(cl,t)}var Zf=h("ZodSymbol",(t,e)=>{gc.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,o,r)=>qm(t,n,o,r)});function Dk(t){return mu(Zf,t)}var Ff=h("ZodUndefined",(t,e)=>{_c.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,o,r)=>Hm(t,n,o,r)});function jk(t){return fu(Ff,t)}var Vf=h("ZodNull",(t,e)=>{yc.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,o,r)=>Bm(t,n,o,r)});function Qi(t){return hu(Vf,t)}var qf=h("ZodAny",(t,e)=>{vc.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,o,r)=>Wm(t,n,o,r)});function Uk(){return gu(qf)}var Bf=h("ZodUnknown",(t,e)=>{bc.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,o,r)=>Jm(t,n,o,r)});function ge(){return _u(Bf)}var Hf=h("ZodNever",(t,e)=>{kc.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,o,r)=>Gm(t,n,o,r)});function ul(t){return yu(Hf,t)}var Kf=h("ZodVoid",(t,e)=>{xc.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,o,r)=>Km(t,n,o,r)});function Lk(t){return vu(Kf,t)}var ea=h("ZodDate",(t,e)=>{Sc.init(t,e),K.init(t,e),t._zod.processJSONSchema=(o,r,i)=>Ym(t,o,r,i),t.min=(o,r)=>t.check(Ge(o,r)),t.max=(o,r)=>t.check(dt(o,r));let n=t._zod.bag;t.minDate=n.minimum?new Date(n.minimum):null,t.maxDate=n.maximum?new Date(n.maximum):null});function Mk(t){return bu(ea,t)}var Gf=h("ZodArray",(t,e)=>{$c.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,o,r)=>lf(t,n,o,r),t.element=e.element,Yi(t,"ZodArray",{min(n,o){return this.check(Xt(n,o))},nonempty(n){return this.check(Xt(1,n))},max(n,o){return this.check(Wr(n,o))},length(n,o){return this.check(Jr(n,o))},unwrap(){return this.element}})});function X(t,e){return Um(Gf,t,e)}function Zk(t){let e=t._zod.def.shape;return ze(Object.keys(e))}var ta=h("ZodObject",(t,e)=>{$m.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,o,r)=>df(t,n,o,r),S.defineLazy(t,"shape",()=>e.shape),Yi(t,"ZodObject",{keyof(){return ze(Object.keys(this._zod.def.shape))},catchall(n){return this.clone({...this._zod.def,catchall:n})},passthrough(){return this.clone({...this._zod.def,catchall:ge()})},loose(){return this.clone({...this._zod.def,catchall:ge()})},strict(){return this.clone({...this._zod.def,catchall:ul()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(n){return S.extend(this,n)},safeExtend(n){return S.safeExtend(this,n)},merge(n){return S.merge(this,n)},pick(n){return S.pick(this,n)},omit(n){return S.omit(this,n)},partial(...n){return S.partial(no,this,n[0])},required(...n){return S.required(dl,this,n[0])}})});function A(t,e){let n={type:"object",shape:t??{},...S.normalizeParams(e)};return new ta(n)}function Fk(t,e){return new ta({type:"object",shape:t,catchall:ul(),...S.normalizeParams(e)})}function Ne(t,e){return new ta({type:"object",shape:t,catchall:ge(),...S.normalizeParams(e)})}var ra=h("ZodUnion",(t,e)=>{On.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,o,r)=>zu(t,n,o,r),t.options=e.options});function _e(t,e){return new ra({type:"union",options:t,...S.normalizeParams(e)})}var Wf=h("ZodXor",(t,e)=>{ra.init(t,e),wc.init(t,e),t._zod.processJSONSchema=(n,o,r)=>zu(t,n,o,r),t.options=e.options});function Vk(t,e){return new Wf({type:"union",options:t,inclusive:!1,...S.normalizeParams(e)})}var Jf=h("ZodDiscriminatedUnion",(t,e)=>{ra.init(t,e),Ec.init(t,e)});function na(t,e,n){return new Jf({type:"union",options:e,discriminator:t,...S.normalizeParams(n)})}var Yf=h("ZodIntersection",(t,e)=>{Tc.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,o,r)=>pf(t,n,o,r)});function ro(t,e){return new Yf({type:"intersection",left:t,right:e})}var Xf=h("ZodTuple",(t,e)=>{$i.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,o,r)=>mf(t,n,o,r),t.rest=n=>t.clone({...t._zod.def,rest:n})});function Qf(t,e,n){let o=e instanceof B,r=o?n:e,i=o?e:null;return new Xf({type:"tuple",items:t,rest:i,...S.normalizeParams(r)})}var Wn=h("ZodRecord",(t,e)=>{Pc.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,o,r)=>ff(t,n,o,r),t.keyType=e.keyType,t.valueType=e.valueType});function me(t,e,n){return!e||!e._zod?new Wn({type:"record",keyType:y(),valueType:t,...S.normalizeParams(e)}):new Wn({type:"record",keyType:t,valueType:e,...S.normalizeParams(n)})}function qk(t,e,n){let o=Ae(t);return o._zod.values=void 0,new Wn({type:"record",keyType:o,valueType:e,...S.normalizeParams(n)})}function Bk(t,e,n){return new Wn({type:"record",keyType:t,valueType:e,mode:"loose",...S.normalizeParams(n)})}var eh=h("ZodMap",(t,e)=>{Oc.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,o,r)=>cf(t,n,o,r),t.keyType=e.keyType,t.valueType=e.valueType,t.min=(...n)=>t.check(Ft(...n)),t.nonempty=n=>t.check(Ft(1,n)),t.max=(...n)=>t.check(br(...n)),t.size=(...n)=>t.check(Gr(...n))});function Hk(t,e,n){return new eh({type:"map",keyType:t,valueType:e,...S.normalizeParams(n)})}var th=h("ZodSet",(t,e)=>{Rc.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,o,r)=>uf(t,n,o,r),t.min=(...n)=>t.check(Ft(...n)),t.nonempty=n=>t.check(Ft(1,n)),t.max=(...n)=>t.check(br(...n)),t.size=(...n)=>t.check(Gr(...n))});function Kk(t,e){return new th({type:"set",valueType:t,...S.normalizeParams(e)})}var Jn=h("ZodEnum",(t,e)=>{Ac.init(t,e),K.init(t,e),t._zod.processJSONSchema=(o,r,i)=>Xm(t,o,r,i),t.enum=e.entries,t.options=Object.values(e.entries);let n=new Set(Object.keys(e.entries));t.extract=(o,r)=>{let i={};for(let a of o)if(n.has(a))i[a]=e.entries[a];else throw new Error(`Key ${a} not found in enum`);return new Jn({...e,checks:[],...S.normalizeParams(r),entries:i})},t.exclude=(o,r)=>{let i={...e.entries};for(let a of o)if(n.has(a))delete i[a];else throw new Error(`Key ${a} not found in enum`);return new Jn({...e,checks:[],...S.normalizeParams(r),entries:i})}});function ze(t,e){let n=Array.isArray(t)?Object.fromEntries(t.map(o=>[o,o])):t;return new Jn({type:"enum",entries:n,...S.normalizeParams(e)})}function Gk(t,e){return new Jn({type:"enum",entries:t,...S.normalizeParams(e)})}var rh=h("ZodLiteral",(t,e)=>{Cc.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,o,r)=>Qm(t,n,o,r),t.values=new Set(e.values),Object.defineProperty(t,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});function L(t,e){return new rh({type:"literal",values:Array.isArray(t)?t:[t],...S.normalizeParams(e)})}var nh=h("ZodFile",(t,e)=>{Nc.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,o,r)=>rf(t,n,o,r),t.min=(n,o)=>t.check(Ft(n,o)),t.max=(n,o)=>t.check(br(n,o)),t.mime=(n,o)=>t.check(Fn(Array.isArray(n)?n:[n],o))});function Wk(t){return Eu(nh,t)}var oh=h("ZodTransform",(t,e)=>{zc.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,o,r)=>sf(t,n,o,r),t._zod.parse=(n,o)=>{if(o.direction==="backward")throw new dr(t.constructor.name);n.addIssue=i=>{if(typeof i=="string")n.issues.push(S.issue(i,n.value,e));else{let a=i;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=n.value),a.inst??(a.inst=t),n.issues.push(S.issue(a))}};let r=e.transform(n.value,n);return r instanceof Promise?r.then(i=>(n.value=i,n.fallback=!0,n)):(n.value=r,n.fallback=!0,n)}});function ll(t){return new oh({type:"transform",transform:t})}var no=h("ZodOptional",(t,e)=>{Ii.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,o,r)=>Du(t,n,o,r),t.unwrap=()=>t._zod.def.innerType});function be(t){return new no({type:"optional",innerType:t})}var ih=h("ZodExactOptional",(t,e)=>{Dc.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,o,r)=>Du(t,n,o,r),t.unwrap=()=>t._zod.def.innerType});function ah(t){return new ih({type:"optional",innerType:t})}var sh=h("ZodNullable",(t,e)=>{jc.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,o,r)=>hf(t,n,o,r),t.unwrap=()=>t._zod.def.innerType});function Ji(t){return new sh({type:"nullable",innerType:t})}function Jk(t){return be(Ji(t))}var ch=h("ZodDefault",(t,e)=>{Uc.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,o,r)=>_f(t,n,o,r),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function uh(t,e){return new ch({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():S.shallowClone(e)}})}var lh=h("ZodPrefault",(t,e)=>{Lc.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,o,r)=>yf(t,n,o,r),t.unwrap=()=>t._zod.def.innerType});function dh(t,e){return new lh({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():S.shallowClone(e)}})}var dl=h("ZodNonOptional",(t,e)=>{Mc.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,o,r)=>gf(t,n,o,r),t.unwrap=()=>t._zod.def.innerType});function ph(t,e){return new dl({type:"nonoptional",innerType:t,...S.normalizeParams(e)})}var mh=h("ZodSuccess",(t,e)=>{Zc.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,o,r)=>nf(t,n,o,r),t.unwrap=()=>t._zod.def.innerType});function Yk(t){return new mh({type:"success",innerType:t})}var fh=h("ZodCatch",(t,e)=>{Fc.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,o,r)=>vf(t,n,o,r),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function hh(t,e){return new fh({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}var gh=h("ZodNaN",(t,e)=>{Vc.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,o,r)=>ef(t,n,o,r)});function Xk(t){return ku(gh,t)}var oa=h("ZodPipe",(t,e)=>{wi.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,o,r)=>bf(t,n,o,r),t.in=e.in,t.out=e.out});function qu(t,e){return new oa({type:"pipe",in:t,out:e})}var ia=h("ZodCodec",(t,e)=>{oa.init(t,e),Rn.init(t,e)});function Qk(t,e,n){return new ia({type:"pipe",in:t,out:e,transform:n.decode,reverseTransform:n.encode})}function ex(t){let e=t._zod.def;return new ia({type:"pipe",in:e.out,out:e.in,transform:e.reverseTransform,reverseTransform:e.transform})}var _h=h("ZodPreprocess",(t,e)=>{oa.init(t,e),Im.init(t,e)}),yh=h("ZodReadonly",(t,e)=>{qc.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,o,r)=>kf(t,n,o,r),t.unwrap=()=>t._zod.def.innerType});function vh(t){return new yh({type:"readonly",innerType:t})}var bh=h("ZodTemplateLiteral",(t,e)=>{Bc.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,o,r)=>tf(t,n,o,r)});function tx(t,e){return new bh({type:"template_literal",parts:t,...S.normalizeParams(e)})}var kh=h("ZodLazy",(t,e)=>{Gc.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,o,r)=>Sf(t,n,o,r),t.unwrap=()=>t._zod.def.getter()});function xh(t){return new kh({type:"lazy",getter:t})}var Sh=h("ZodPromise",(t,e)=>{Kc.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,o,r)=>xf(t,n,o,r),t.unwrap=()=>t._zod.def.innerType});function rx(t){return new Sh({type:"promise",innerType:t})}var $h=h("ZodFunction",(t,e)=>{Hc.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,o,r)=>af(t,n,o,r)});function nx(t){return new $h({type:"function",input:Array.isArray(t?.input)?Qf(t?.input):t?.input??X(ge()),output:t?.output??ge()})}var aa=h("ZodCustom",(t,e)=>{Wc.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,o,r)=>of(t,n,o,r)});function ox(t){let e=new fe({check:"custom"});return e._zod.check=t,e}function pl(t,e){return Tu(aa,t??(()=>!0),e)}function Ih(t,e={}){return Pu(aa,t,e)}function wh(t,e){return Ou(t,e)}var ix=Ru,ax=Au;function sx(t,e={}){let n=new aa({type:"custom",check:"custom",fn:o=>o instanceof t,abort:!0,...S.normalizeParams(e)});return n._zod.bag.Class=t,n._zod.check=o=>{o.value instanceof t||o.issues.push({code:"invalid_type",expected:t.name,input:o.value,inst:n,path:[...n._zod.def.path??[]]})},n}var cx=(...t)=>Cu({Codec:ia,Boolean:eo,String:Yn},...t);function ux(t){let e=xh(()=>_e([y(t),se(),Pe(),Qi(),X(e),me(y(),e)]));return e}function sa(t,e){return new _h({type:"pipe",in:ll(t),out:e})}var sR={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 cR(t){Te({customError:t})}function uR(){return Te().customError}var Eh;Eh||(Eh={});var T={...Gi,...Uu,iso:$r},lR=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function dR(t,e){let n=t.$schema;return n==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":n==="http://json-schema.org/draft-07/schema#"?"draft-7":n==="http://json-schema.org/draft-04/schema#"?"draft-4":e??"draft-2020-12"}function pR(t,e){if(!t.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let n=t.slice(1).split("/").filter(Boolean);if(n.length===0)return e.rootSchema;let o=e.version==="draft-2020-12"?"$defs":"definitions";if(n[0]===o){let r=n[1];if(!r||!e.defs[r])throw new Error(`Reference not found: ${t}`);return e.defs[r]}throw new Error(`Reference not found: ${t}`)}function lx(t,e){if(t.not!==void 0){if(typeof t.not=="object"&&Object.keys(t.not).length===0)return T.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(t.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(t.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(t.if!==void 0||t.then!==void 0||t.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(t.dependentSchemas!==void 0||t.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(t.$ref){let r=t.$ref;if(e.refs.has(r))return e.refs.get(r);if(e.processing.has(r))return T.lazy(()=>{if(!e.refs.has(r))throw new Error(`Circular reference not resolved: ${r}`);return e.refs.get(r)});e.processing.add(r);let i=pR(r,e),a=Me(i,e);return e.refs.set(r,a),e.processing.delete(r),a}if(t.enum!==void 0){let r=t.enum;if(e.version==="openapi-3.0"&&t.nullable===!0&&r.length===1&&r[0]===null)return T.null();if(r.length===0)return T.never();if(r.length===1)return T.literal(r[0]);if(r.every(a=>typeof a=="string"))return T.enum(r);let i=r.map(a=>T.literal(a));return i.length<2?i[0]:T.union([i[0],i[1],...i.slice(2)])}if(t.const!==void 0)return T.literal(t.const);let n=t.type;if(Array.isArray(n)){let r=n.map(i=>{let a={...t,type:i};return lx(a,e)});return r.length===0?T.never():r.length===1?r[0]:T.union(r)}if(!n)return T.any();let o;switch(n){case"string":{let r=T.string();if(t.format){let i=t.format;i==="email"?r=r.check(T.email()):i==="uri"||i==="uri-reference"?r=r.check(T.url()):i==="uuid"||i==="guid"?r=r.check(T.uuid()):i==="date-time"?r=r.check(T.iso.datetime()):i==="date"?r=r.check(T.iso.date()):i==="time"?r=r.check(T.iso.time()):i==="duration"?r=r.check(T.iso.duration()):i==="ipv4"?r=r.check(T.ipv4()):i==="ipv6"?r=r.check(T.ipv6()):i==="mac"?r=r.check(T.mac()):i==="cidr"?r=r.check(T.cidrv4()):i==="cidr-v6"?r=r.check(T.cidrv6()):i==="base64"?r=r.check(T.base64()):i==="base64url"?r=r.check(T.base64url()):i==="e164"?r=r.check(T.e164()):i==="jwt"?r=r.check(T.jwt()):i==="emoji"?r=r.check(T.emoji()):i==="nanoid"?r=r.check(T.nanoid()):i==="cuid"?r=r.check(T.cuid()):i==="cuid2"?r=r.check(T.cuid2()):i==="ulid"?r=r.check(T.ulid()):i==="xid"?r=r.check(T.xid()):i==="ksuid"&&(r=r.check(T.ksuid()))}typeof t.minLength=="number"&&(r=r.min(t.minLength)),typeof t.maxLength=="number"&&(r=r.max(t.maxLength)),t.pattern&&(r=r.regex(new RegExp(t.pattern))),o=r;break}case"number":case"integer":{let r=n==="integer"?T.number().int():T.number();typeof t.minimum=="number"&&(r=r.min(t.minimum)),typeof t.maximum=="number"&&(r=r.max(t.maximum)),typeof t.exclusiveMinimum=="number"?r=r.gt(t.exclusiveMinimum):t.exclusiveMinimum===!0&&typeof t.minimum=="number"&&(r=r.gt(t.minimum)),typeof t.exclusiveMaximum=="number"?r=r.lt(t.exclusiveMaximum):t.exclusiveMaximum===!0&&typeof t.maximum=="number"&&(r=r.lt(t.maximum)),typeof t.multipleOf=="number"&&(r=r.multipleOf(t.multipleOf)),o=r;break}case"boolean":{o=T.boolean();break}case"null":{o=T.null();break}case"object":{let r={},i=t.properties||{},a=new Set(t.required||[]);for(let[u,d]of Object.entries(i)){let l=Me(d,e);r[u]=a.has(u)?l:l.optional()}if(t.propertyNames){let u=Me(t.propertyNames,e),d=t.additionalProperties&&typeof t.additionalProperties=="object"?Me(t.additionalProperties,e):T.any();if(Object.keys(r).length===0){o=T.record(u,d);break}let l=T.object(r).passthrough(),p=T.looseRecord(u,d);o=T.intersection(l,p);break}if(t.patternProperties){let u=t.patternProperties,d=Object.keys(u),l=[];for(let m of d){let f=Me(u[m],e),g=T.string().regex(new RegExp(m));l.push(T.looseRecord(g,f))}let p=[];if(Object.keys(r).length>0&&p.push(T.object(r).passthrough()),p.push(...l),p.length===0)o=T.object({}).passthrough();else if(p.length===1)o=p[0];else{let m=T.intersection(p[0],p[1]);for(let f=2;f<p.length;f++)m=T.intersection(m,p[f]);o=m}break}let c=T.object(r);t.additionalProperties===!1?o=c.strict():typeof t.additionalProperties=="object"?o=c.catchall(Me(t.additionalProperties,e)):o=c.passthrough();break}case"array":{let r=t.prefixItems,i=t.items;if(r&&Array.isArray(r)){let a=r.map(u=>Me(u,e)),c=i&&typeof i=="object"&&!Array.isArray(i)?Me(i,e):void 0;c?o=T.tuple(a).rest(c):o=T.tuple(a),typeof t.minItems=="number"&&(o=o.check(T.minLength(t.minItems))),typeof t.maxItems=="number"&&(o=o.check(T.maxLength(t.maxItems)))}else if(Array.isArray(i)){let a=i.map(u=>Me(u,e)),c=t.additionalItems&&typeof t.additionalItems=="object"?Me(t.additionalItems,e):void 0;c?o=T.tuple(a).rest(c):o=T.tuple(a),typeof t.minItems=="number"&&(o=o.check(T.minLength(t.minItems))),typeof t.maxItems=="number"&&(o=o.check(T.maxLength(t.maxItems)))}else if(i!==void 0){let a=Me(i,e),c=T.array(a);typeof t.minItems=="number"&&(c=c.min(t.minItems)),typeof t.maxItems=="number"&&(c=c.max(t.maxItems)),o=c}else o=T.array(T.any());break}default:throw new Error(`Unsupported type: ${n}`)}return o}function Me(t,e){if(typeof t=="boolean")return t?T.any():T.never();let n=lx(t,e),o=t.type||t.enum!==void 0||t.const!==void 0;if(t.anyOf&&Array.isArray(t.anyOf)){let c=t.anyOf.map(d=>Me(d,e)),u=T.union(c);n=o?T.intersection(n,u):u}if(t.oneOf&&Array.isArray(t.oneOf)){let c=t.oneOf.map(d=>Me(d,e)),u=T.xor(c);n=o?T.intersection(n,u):u}if(t.allOf&&Array.isArray(t.allOf))if(t.allOf.length===0)n=o?n:T.any();else{let c=o?n:Me(t.allOf[0],e),u=o?0:1;for(let d=u;d<t.allOf.length;d++)c=T.intersection(c,Me(t.allOf[d],e));n=c}t.nullable===!0&&e.version==="openapi-3.0"&&(n=T.nullable(n)),t.readOnly===!0&&(n=T.readonly(n)),t.default!==void 0&&(n=n.default(t.default));let r={},i=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let c of i)c in t&&(r[c]=t[c]);let a=["contentEncoding","contentMediaType","contentSchema"];for(let c of a)c in t&&(r[c]=t[c]);for(let c of Object.keys(t))lR.has(c)||(r[c]=t[c]);return Object.keys(r).length>0&&e.registry.add(n,r),t.description&&(n=n.describe(t.description)),n}function dx(t,e){if(typeof t=="boolean")return t?T.any():T.never();let n;try{n=JSON.parse(JSON.stringify(t))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let o=dR(n,e?.defaultTarget),r=n.$defs||n.definitions||{},i={version:o,defs:r,refs:new Map,processing:new Set,rootSchema:n,registry:e?.registry??Ce};return Me(n,i)}var Th={};Jt(Th,{bigint:()=>gR,boolean:()=>hR,date:()=>_R,number:()=>fR,string:()=>mR});function mR(t){return Tm(Yn,t)}function fR(t){return Nm(Qn,t)}function hR(t){return zm(eo,t)}function gR(t){return Dm(to,t)}function _R(t){return jm(ea,t)}Te(Jc());var Oh="2025-11-25";var px=[Oh,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],Ir="io.modelcontextprotocol/related-task",fl="2.0",Re=pl(t=>t!==null&&(typeof t=="object"||typeof t=="function")),mx=_e([y(),se().int()]),fx=y(),x2=Ne({ttl:se().optional(),pollInterval:se().optional()}),yR=A({ttl:se().optional()}),vR=A({taskId:y()}),Rh=Ne({progressToken:mx.optional(),[Ir]:vR.optional()}),pt=A({_meta:Rh.optional()}),ca=pt.extend({task:yR.optional()}),hx=t=>ca.safeParse(t).success,De=A({method:y(),params:pt.loose().optional()}),_t=A({_meta:Rh.optional()}),yt=A({method:y(),params:_t.loose().optional()}),je=Ne({_meta:Rh.optional()}),hl=_e([y(),se().int()]),gx=A({jsonrpc:L(fl),id:hl,...De.shape}).strict(),Ah=t=>gx.safeParse(t).success,_x=A({jsonrpc:L(fl),...yt.shape}).strict(),yx=t=>_x.safeParse(t).success,Ch=A({jsonrpc:L(fl),id:hl,result:je}).strict(),ua=t=>Ch.safeParse(t).success;var F;(function(t){t[t.ConnectionClosed=-32e3]="ConnectionClosed",t[t.RequestTimeout=-32001]="RequestTimeout",t[t.ParseError=-32700]="ParseError",t[t.InvalidRequest=-32600]="InvalidRequest",t[t.MethodNotFound=-32601]="MethodNotFound",t[t.InvalidParams=-32602]="InvalidParams",t[t.InternalError=-32603]="InternalError",t[t.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(F||(F={}));var Nh=A({jsonrpc:L(fl),id:hl.optional(),error:A({code:se().int(),message:y(),data:ge().optional()})}).strict();var vx=t=>Nh.safeParse(t).success;var bx=_e([gx,_x,Ch,Nh]),S2=_e([Ch,Nh]),gl=je.strict(),bR=_t.extend({requestId:hl.optional(),reason:y().optional()}),_l=yt.extend({method:L("notifications/cancelled"),params:bR}),kR=A({src:y(),mimeType:y().optional(),sizes:X(y()).optional(),theme:ze(["light","dark"]).optional()}),la=A({icons:X(kR).optional()}),oo=A({name:y(),title:y().optional()}),kx=oo.extend({...oo.shape,...la.shape,version:y(),websiteUrl:y().optional(),description:y().optional()}),xR=ro(A({applyDefaults:Pe().optional()}),me(y(),ge())),SR=sa(t=>t&&typeof t=="object"&&!Array.isArray(t)&&Object.keys(t).length===0?{form:{}}:t,ro(A({form:xR.optional(),url:Re.optional()}),me(y(),ge()).optional())),$R=Ne({list:Re.optional(),cancel:Re.optional(),requests:Ne({sampling:Ne({createMessage:Re.optional()}).optional(),elicitation:Ne({create:Re.optional()}).optional()}).optional()}),IR=Ne({list:Re.optional(),cancel:Re.optional(),requests:Ne({tools:Ne({call:Re.optional()}).optional()}).optional()}),wR=A({experimental:me(y(),Re).optional(),sampling:A({context:Re.optional(),tools:Re.optional()}).optional(),elicitation:SR.optional(),roots:A({listChanged:Pe().optional()}).optional(),tasks:$R.optional(),extensions:me(y(),Re).optional()}),ER=pt.extend({protocolVersion:y(),capabilities:wR,clientInfo:kx}),zh=De.extend({method:L("initialize"),params:ER});var TR=A({experimental:me(y(),Re).optional(),logging:Re.optional(),completions:Re.optional(),prompts:A({listChanged:Pe().optional()}).optional(),resources:A({subscribe:Pe().optional(),listChanged:Pe().optional()}).optional(),tools:A({listChanged:Pe().optional()}).optional(),tasks:IR.optional(),extensions:me(y(),Re).optional()}),PR=je.extend({protocolVersion:y(),capabilities:TR,serverInfo:kx,instructions:y().optional()}),Dh=yt.extend({method:L("notifications/initialized"),params:_t.optional()});var yl=De.extend({method:L("ping"),params:pt.optional()}),OR=A({progress:se(),total:be(se()),message:be(y())}),RR=A({..._t.shape,...OR.shape,progressToken:mx}),vl=yt.extend({method:L("notifications/progress"),params:RR}),AR=pt.extend({cursor:fx.optional()}),da=De.extend({params:AR.optional()}),pa=je.extend({nextCursor:fx.optional()}),CR=ze(["working","input_required","completed","failed","cancelled"]),ma=A({taskId:y(),status:CR,ttl:_e([se(),Qi()]),createdAt:y(),lastUpdatedAt:y(),pollInterval:be(se()),statusMessage:be(y())}),io=je.extend({task:ma}),NR=_t.merge(ma),fa=yt.extend({method:L("notifications/tasks/status"),params:NR}),bl=De.extend({method:L("tasks/get"),params:pt.extend({taskId:y()})}),kl=je.merge(ma),xl=De.extend({method:L("tasks/result"),params:pt.extend({taskId:y()})}),$2=je.loose(),Sl=da.extend({method:L("tasks/list")}),$l=pa.extend({tasks:X(ma)}),Il=De.extend({method:L("tasks/cancel"),params:pt.extend({taskId:y()})}),xx=je.merge(ma),Sx=A({uri:y(),mimeType:be(y()),_meta:me(y(),ge()).optional()}),$x=Sx.extend({text:y()}),jh=y().refine(t=>{try{return atob(t),!0}catch{return!1}},{message:"Invalid Base64 string"}),Ix=Sx.extend({blob:jh}),ha=ze(["user","assistant"]),ao=A({audience:X(ha).optional(),priority:se().min(0).max(1).optional(),lastModified:$r.datetime({offset:!0}).optional()}),wx=A({...oo.shape,...la.shape,uri:y(),description:be(y()),mimeType:be(y()),size:be(se()),annotations:ao.optional(),_meta:be(Ne({}))}),zR=A({...oo.shape,...la.shape,uriTemplate:y(),description:be(y()),mimeType:be(y()),annotations:ao.optional(),_meta:be(Ne({}))}),wl=da.extend({method:L("resources/list")}),DR=pa.extend({resources:X(wx)}),El=da.extend({method:L("resources/templates/list")}),jR=pa.extend({resourceTemplates:X(zR)}),Uh=pt.extend({uri:y()}),UR=Uh,Tl=De.extend({method:L("resources/read"),params:UR}),LR=je.extend({contents:X(_e([$x,Ix]))}),MR=yt.extend({method:L("notifications/resources/list_changed"),params:_t.optional()}),ZR=Uh,FR=De.extend({method:L("resources/subscribe"),params:ZR}),VR=Uh,qR=De.extend({method:L("resources/unsubscribe"),params:VR}),BR=_t.extend({uri:y()}),HR=yt.extend({method:L("notifications/resources/updated"),params:BR}),KR=A({name:y(),description:be(y()),required:be(Pe())}),GR=A({...oo.shape,...la.shape,description:be(y()),arguments:be(X(KR)),_meta:be(Ne({}))}),Pl=da.extend({method:L("prompts/list")}),WR=pa.extend({prompts:X(GR)}),JR=pt.extend({name:y(),arguments:me(y(),y()).optional()}),Ol=De.extend({method:L("prompts/get"),params:JR}),Lh=A({type:L("text"),text:y(),annotations:ao.optional(),_meta:me(y(),ge()).optional()}),Mh=A({type:L("image"),data:jh,mimeType:y(),annotations:ao.optional(),_meta:me(y(),ge()).optional()}),Zh=A({type:L("audio"),data:jh,mimeType:y(),annotations:ao.optional(),_meta:me(y(),ge()).optional()}),YR=A({type:L("tool_use"),name:y(),id:y(),input:me(y(),ge()),_meta:me(y(),ge()).optional()}),XR=A({type:L("resource"),resource:_e([$x,Ix]),annotations:ao.optional(),_meta:me(y(),ge()).optional()}),QR=wx.extend({type:L("resource_link")}),Fh=_e([Lh,Mh,Zh,QR,XR]),eA=A({role:ha,content:Fh}),tA=je.extend({description:y().optional(),messages:X(eA)}),rA=yt.extend({method:L("notifications/prompts/list_changed"),params:_t.optional()}),nA=A({title:y().optional(),readOnlyHint:Pe().optional(),destructiveHint:Pe().optional(),idempotentHint:Pe().optional(),openWorldHint:Pe().optional()}),oA=A({taskSupport:ze(["required","optional","forbidden"]).optional()}),Ex=A({...oo.shape,...la.shape,description:y().optional(),inputSchema:A({type:L("object"),properties:me(y(),Re).optional(),required:X(y()).optional()}).catchall(ge()),outputSchema:A({type:L("object"),properties:me(y(),Re).optional(),required:X(y()).optional()}).catchall(ge()).optional(),annotations:nA.optional(),execution:oA.optional(),_meta:me(y(),ge()).optional()}),Rl=da.extend({method:L("tools/list")}),iA=pa.extend({tools:X(Ex)}),Al=je.extend({content:X(Fh).default([]),structuredContent:me(y(),ge()).optional(),isError:Pe().optional()}),I2=Al.or(je.extend({toolResult:ge()})),aA=ca.extend({name:y(),arguments:me(y(),ge()).optional()}),so=De.extend({method:L("tools/call"),params:aA}),sA=yt.extend({method:L("notifications/tools/list_changed"),params:_t.optional()}),w2=A({autoRefresh:Pe().default(!0),debounceMs:se().int().nonnegative().default(300)}),ga=ze(["debug","info","notice","warning","error","critical","alert","emergency"]),cA=pt.extend({level:ga}),Vh=De.extend({method:L("logging/setLevel"),params:cA}),uA=_t.extend({level:ga,logger:y().optional(),data:ge()}),lA=yt.extend({method:L("notifications/message"),params:uA}),dA=A({name:y().optional()}),pA=A({hints:X(dA).optional(),costPriority:se().min(0).max(1).optional(),speedPriority:se().min(0).max(1).optional(),intelligencePriority:se().min(0).max(1).optional()}),mA=A({mode:ze(["auto","required","none"]).optional()}),fA=A({type:L("tool_result"),toolUseId:y().describe("The unique identifier for the corresponding tool call."),content:X(Fh).default([]),structuredContent:A({}).loose().optional(),isError:Pe().optional(),_meta:me(y(),ge()).optional()}),hA=na("type",[Lh,Mh,Zh]),ml=na("type",[Lh,Mh,Zh,YR,fA]),gA=A({role:ha,content:_e([ml,X(ml)]),_meta:me(y(),ge()).optional()}),_A=ca.extend({messages:X(gA),modelPreferences:pA.optional(),systemPrompt:y().optional(),includeContext:ze(["none","thisServer","allServers"]).optional(),temperature:se().optional(),maxTokens:se().int(),stopSequences:X(y()).optional(),metadata:Re.optional(),tools:X(Ex).optional(),toolChoice:mA.optional()}),yA=De.extend({method:L("sampling/createMessage"),params:_A}),_a=je.extend({model:y(),stopReason:be(ze(["endTurn","stopSequence","maxTokens"]).or(y())),role:ha,content:hA}),qh=je.extend({model:y(),stopReason:be(ze(["endTurn","stopSequence","maxTokens","toolUse"]).or(y())),role:ha,content:_e([ml,X(ml)])}),vA=A({type:L("boolean"),title:y().optional(),description:y().optional(),default:Pe().optional()}),bA=A({type:L("string"),title:y().optional(),description:y().optional(),minLength:se().optional(),maxLength:se().optional(),format:ze(["email","uri","date","date-time"]).optional(),default:y().optional()}),kA=A({type:ze(["number","integer"]),title:y().optional(),description:y().optional(),minimum:se().optional(),maximum:se().optional(),default:se().optional()}),xA=A({type:L("string"),title:y().optional(),description:y().optional(),enum:X(y()),default:y().optional()}),SA=A({type:L("string"),title:y().optional(),description:y().optional(),oneOf:X(A({const:y(),title:y()})),default:y().optional()}),$A=A({type:L("string"),title:y().optional(),description:y().optional(),enum:X(y()),enumNames:X(y()).optional(),default:y().optional()}),IA=_e([xA,SA]),wA=A({type:L("array"),title:y().optional(),description:y().optional(),minItems:se().optional(),maxItems:se().optional(),items:A({type:L("string"),enum:X(y())}),default:X(y()).optional()}),EA=A({type:L("array"),title:y().optional(),description:y().optional(),minItems:se().optional(),maxItems:se().optional(),items:A({anyOf:X(A({const:y(),title:y()}))}),default:X(y()).optional()}),TA=_e([wA,EA]),PA=_e([$A,IA,TA]),OA=_e([PA,vA,bA,kA]),RA=ca.extend({mode:L("form").optional(),message:y(),requestedSchema:A({type:L("object"),properties:me(y(),OA),required:X(y()).optional()})}),AA=ca.extend({mode:L("url"),message:y(),elicitationId:y(),url:y().url()}),CA=_e([RA,AA]),NA=De.extend({method:L("elicitation/create"),params:CA}),zA=_t.extend({elicitationId:y()}),DA=yt.extend({method:L("notifications/elicitation/complete"),params:zA}),co=je.extend({action:ze(["accept","decline","cancel"]),content:sa(t=>t===null?void 0:t,me(y(),_e([y(),se(),Pe(),X(y())])).optional())}),jA=A({type:L("ref/resource"),uri:y()});var UA=A({type:L("ref/prompt"),name:y()}),LA=pt.extend({ref:_e([UA,jA]),argument:A({name:y(),value:y()}),context:A({arguments:me(y(),y()).optional()}).optional()}),Cl=De.extend({method:L("completion/complete"),params:LA});function Tx(t){if(t.params.ref.type!=="ref/prompt")throw new TypeError(`Expected CompleteRequestPrompt, but got ${t.params.ref.type}`)}function Px(t){if(t.params.ref.type!=="ref/resource")throw new TypeError(`Expected CompleteRequestResourceTemplate, but got ${t.params.ref.type}`)}var MA=je.extend({completion:Ne({values:X(y()).max(100),total:be(se().int()),hasMore:be(Pe())})}),ZA=A({uri:y().startsWith("file://"),name:y().optional(),_meta:me(y(),ge()).optional()}),FA=De.extend({method:L("roots/list"),params:pt.optional()}),Bh=je.extend({roots:X(ZA)}),VA=yt.extend({method:L("notifications/roots/list_changed"),params:_t.optional()}),E2=_e([yl,zh,Cl,Vh,Ol,Pl,wl,El,Tl,FR,qR,so,Rl,bl,xl,Sl,Il]),T2=_e([_l,vl,Dh,VA,fa]),P2=_e([gl,_a,qh,co,Bh,kl,$l,io]),O2=_e([yl,yA,NA,FA,bl,xl,Sl,Il]),R2=_e([_l,vl,lA,HR,MR,sA,rA,fa,DA]),A2=_e([gl,PR,MA,tA,WR,DR,jR,LR,Al,iA,kl,$l,io]),M=class t extends Error{constructor(e,n,o){super(`MCP error ${e}: ${n}`),this.code=e,this.data=o,this.name="McpError"}static fromError(e,n,o){if(e===F.UrlElicitationRequired&&o){let r=o;if(r.elicitations)return new Ph(r.elicitations,n)}return new t(e,n,o)}},Ph=class extends M{constructor(e,n=`URL elicitation${e.length>1?"s":""} required`){super(F.UrlElicitationRequired,n,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}};var Nl=class{append(e){this._buffer=this._buffer?Buffer.concat([this._buffer,e]):e}readMessage(){if(!this._buffer)return null;let e=this._buffer.indexOf(`
|
|
75
|
-
`);if(e===-1)return null;let n=this._buffer.toString("utf8",0,e).replace(/\r$/,"");return this._buffer=this._buffer.subarray(e+1),
|
|
76
|
-
`}var zl=class{constructor(e=Rx.stdin,n=Rx.stdout){this._stdin=e,this._stdout=n,this._readBuffer=new Nl,this._started=!1,this._ondata=o=>{this._readBuffer.append(o),this.processReadBuffer()},this._onerror=o=>{this.onerror?.(o)}}async start(){if(this._started)throw new Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.");this._started=!0,this._stdin.on("data",this._ondata),this._stdin.on("error",this._onerror)}processReadBuffer(){for(;;)try{let e=this._readBuffer.readMessage();if(e===null)break;this.onmessage?.(e)}catch(e){this.onerror?.(e)}}async close(){this._stdin.off("data",this._ondata),this._stdin.off("error",this._onerror),this._stdin.listenerCount("data")===0&&this._stdin.pause(),this._readBuffer.clear(),this.onclose?.()}send(e){return new Promise(n=>{let o=Ox(e);this._stdout.write(o)?n():this._stdout.once("drain",n)})}};var re;(function(t){t.assertEqual=r=>{};function e(r){}t.assertIs=e;function n(r){throw new Error}t.assertNever=n,t.arrayToEnum=r=>{let i={};for(let a of r)i[a]=a;return i},t.getValidEnumValues=r=>{let i=t.objectKeys(r).filter(c=>typeof r[r[c]]!="number"),a={};for(let c of i)a[c]=r[c];return t.objectValues(a)},t.objectValues=r=>t.objectKeys(r).map(function(i){return r[i]}),t.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{let i=[];for(let a in r)Object.prototype.hasOwnProperty.call(r,a)&&i.push(a);return i},t.find=(r,i)=>{for(let a of r)if(i(a))return a},t.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&Number.isFinite(r)&&Math.floor(r)===r;function o(r,i=" | "){return r.map(a=>typeof a=="string"?`'${a}'`:a).join(i)}t.joinValues=o,t.jsonStringifyReplacer=(r,i)=>typeof i=="bigint"?i.toString():i})(re||(re={}));var Ax;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(Ax||(Ax={}));var C=re.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Qt=t=>{switch(typeof t){case"undefined":return C.undefined;case"string":return C.string;case"number":return Number.isNaN(t)?C.nan:C.number;case"boolean":return C.boolean;case"function":return C.function;case"bigint":return C.bigint;case"symbol":return C.symbol;case"object":return Array.isArray(t)?C.array:t===null?C.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?C.promise:typeof Map<"u"&&t instanceof Map?C.map:typeof Set<"u"&&t instanceof Set?C.set:typeof Date<"u"&&t instanceof Date?C.date:C.object;default:return C.unknown}};var $=re.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);var mt=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=o=>{this.issues=[...this.issues,o]},this.addIssues=(o=[])=>{this.issues=[...this.issues,...o]};let n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){let n=e||function(i){return i.message},o={_errors:[]},r=i=>{for(let a of i.issues)if(a.code==="invalid_union")a.unionErrors.map(r);else if(a.code==="invalid_return_type")r(a.returnTypeError);else if(a.code==="invalid_arguments")r(a.argumentsError);else if(a.path.length===0)o._errors.push(n(a));else{let c=o,u=0;for(;u<a.path.length;){let d=a.path[u];u===a.path.length-1?(c[d]=c[d]||{_errors:[]},c[d]._errors.push(n(a))):c[d]=c[d]||{_errors:[]},c=c[d],u++}}};return r(this),o}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,re.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){let n=Object.create(null),o=[];for(let r of this.issues)if(r.path.length>0){let i=r.path[0];n[i]=n[i]||[],n[i].push(e(r))}else o.push(e(r));return{formErrors:o,fieldErrors:n}}get formErrors(){return this.flatten()}};mt.create=t=>new mt(t);var BA=(t,e)=>{let n;switch(t.code){case $.invalid_type:t.received===C.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case $.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,re.jsonStringifyReplacer)}`;break;case $.unrecognized_keys:n=`Unrecognized key(s) in object: ${re.joinValues(t.keys,", ")}`;break;case $.invalid_union:n="Invalid input";break;case $.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${re.joinValues(t.options)}`;break;case $.invalid_enum_value:n=`Invalid enum value. Expected ${re.joinValues(t.options)}, received '${t.received}'`;break;case $.invalid_arguments:n="Invalid function arguments";break;case $.invalid_return_type:n="Invalid function return type";break;case $.invalid_date:n="Invalid date";break;case $.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:re.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case $.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case $.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case $.custom:n="Invalid input";break;case $.invalid_intersection_types:n="Intersection results could not be merged";break;case $.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case $.not_finite:n="Number must be finite";break;default:n=e.defaultError,re.assertNever(t)}return{message:n}},wr=BA;var HA=wr;function ya(){return HA}var Dl=t=>{let{data:e,path:n,errorMaps:o,issueData:r}=t,i=[...n,...r.path||[]],a={...r,path:i};if(r.message!==void 0)return{...r,path:i,message:r.message};let c="",u=o.filter(d=>!!d).slice().reverse();for(let d of u)c=d(a,{data:e,defaultError:c}).message;return{...r,path:i,message:c}};function P(t,e){let n=ya(),o=Dl({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===wr?void 0:wr].filter(r=>!!r)});t.common.issues.push(o)}var Ze=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){let o=[];for(let r of n){if(r.status==="aborted")return V;r.status==="dirty"&&e.dirty(),o.push(r.value)}return{status:e.value,value:o}}static async mergeObjectAsync(e,n){let o=[];for(let r of n){let i=await r.key,a=await r.value;o.push({key:i,value:a})}return t.mergeObjectSync(e,o)}static mergeObjectSync(e,n){let o={};for(let r of n){let{key:i,value:a}=r;if(i.status==="aborted"||a.status==="aborted")return V;i.status==="dirty"&&e.dirty(),a.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof a.value<"u"||r.alwaysSet)&&(o[i.value]=a.value)}return{status:e.value,value:o}}},V=Object.freeze({status:"aborted"}),uo=t=>({status:"dirty",value:t}),Je=t=>({status:"valid",value:t}),Hh=t=>t.status==="aborted",Kh=t=>t.status==="dirty",en=t=>t.status==="valid",va=t=>typeof Promise<"u"&&t instanceof Promise;var U;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(U||(U={}));var vt=class{constructor(e,n,o,r){this._cachedPath=[],this.parent=e,this.data=n,this._path=o,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},Cx=(t,e)=>{if(en(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let n=new mt(t.common.issues);return this._error=n,this._error}}};function G(t){if(!t)return{};let{errorMap:e,invalid_type_error:n,required_error:o,description:r}=t;if(e&&(n||o))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:r}:{errorMap:(a,c)=>{let{message:u}=t;return a.code==="invalid_enum_value"?{message:u??c.defaultError}:typeof c.data>"u"?{message:u??o??c.defaultError}:a.code!=="invalid_type"?{message:c.defaultError}:{message:u??n??c.defaultError}},description:r}}var Q=class{get description(){return this._def.description}_getType(e){return Qt(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:Qt(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Ze,ctx:{common:e.parent.common,data:e.data,parsedType:Qt(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let n=this._parse(e);if(va(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){let n=this._parse(e);return Promise.resolve(n)}parse(e,n){let o=this.safeParse(e,n);if(o.success)return o.data;throw o.error}safeParse(e,n){let o={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Qt(e)},r=this._parseSync({data:e,path:o.path,parent:o});return Cx(o,r)}"~validate"(e){let n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Qt(e)};if(!this["~standard"].async)try{let o=this._parseSync({data:e,path:[],parent:n});return en(o)?{value:o.value}:{issues:n.common.issues}}catch(o){o?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(o=>en(o)?{value:o.value}:{issues:n.common.issues})}async parseAsync(e,n){let o=await this.safeParseAsync(e,n);if(o.success)return o.data;throw o.error}async safeParseAsync(e,n){let o={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Qt(e)},r=this._parse({data:e,path:o.path,parent:o}),i=await(va(r)?r:Promise.resolve(r));return Cx(o,i)}refine(e,n){let o=r=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(r):n;return this._refinement((r,i)=>{let a=e(r),c=()=>i.addIssue({code:$.custom,...o(r)});return typeof Promise<"u"&&a instanceof Promise?a.then(u=>u?!0:(c(),!1)):a?!0:(c(),!1)})}refinement(e,n){return this._refinement((o,r)=>e(o)?!0:(r.addIssue(typeof n=="function"?n(o,r):n),!1))}_refinement(e){return new Ot({schema:this,typeName:w.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return Pt.create(this,this._def)}nullable(){return rr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Tr.create(this)}promise(){return tn.create(this,this._def)}or(e){return ho.create([this,e],this._def)}and(e){return go.create(this,e,this._def)}transform(e){return new Ot({...G(this._def),schema:this,typeName:w.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let n=typeof e=="function"?e:()=>e;return new ko({...G(this._def),innerType:this,defaultValue:n,typeName:w.ZodDefault})}brand(){return new jl({typeName:w.ZodBranded,type:this,...G(this._def)})}catch(e){let n=typeof e=="function"?e:()=>e;return new xo({...G(this._def),innerType:this,catchValue:n,typeName:w.ZodCatch})}describe(e){let n=this.constructor;return new n({...this._def,description:e})}pipe(e){return Ul.create(this,e)}readonly(){return So.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},KA=/^c[^\s-]{8,}$/i,GA=/^[0-9a-z]+$/,WA=/^[0-9A-HJKMNP-TV-Z]{26}$/i,JA=/^[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,YA=/^[a-z0-9_-]{21}$/i,XA=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,QA=/^[-+]?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)?)??$/,eC=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,tC="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Gh,rC=/^(?:(?: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])$/,nC=/^(?:(?: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])$/,oC=/^(([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]))$/,iC=/^(([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])$/,aC=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,sC=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Nx="((\\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])))",cC=new RegExp(`^${Nx}$`);function zx(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function uC(t){return new RegExp(`^${zx(t)}$`)}function lC(t){let e=`${Nx}T${zx(t)}`,n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function dC(t,e){return!!((e==="v4"||!e)&&rC.test(t)||(e==="v6"||!e)&&oC.test(t))}function pC(t,e){if(!XA.test(t))return!1;try{let[n]=t.split(".");if(!n)return!1;let o=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),r=JSON.parse(atob(o));return!(typeof r!="object"||r===null||"typ"in r&&r?.typ!=="JWT"||!r.alg||e&&r.alg!==e)}catch{return!1}}function mC(t,e){return!!((e==="v4"||!e)&&nC.test(t)||(e==="v6"||!e)&&iC.test(t))}var po=class t extends Q{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==C.string){let i=this._getOrReturnCtx(e);return P(i,{code:$.invalid_type,expected:C.string,received:i.parsedType}),V}let o=new Ze,r;for(let i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(r=this._getOrReturnCtx(e,r),P(r,{code:$.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),o.dirty());else if(i.kind==="max")e.data.length>i.value&&(r=this._getOrReturnCtx(e,r),P(r,{code:$.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),o.dirty());else if(i.kind==="length"){let a=e.data.length>i.value,c=e.data.length<i.value;(a||c)&&(r=this._getOrReturnCtx(e,r),a?P(r,{code:$.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):c&&P(r,{code:$.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),o.dirty())}else if(i.kind==="email")eC.test(e.data)||(r=this._getOrReturnCtx(e,r),P(r,{validation:"email",code:$.invalid_string,message:i.message}),o.dirty());else if(i.kind==="emoji")Gh||(Gh=new RegExp(tC,"u")),Gh.test(e.data)||(r=this._getOrReturnCtx(e,r),P(r,{validation:"emoji",code:$.invalid_string,message:i.message}),o.dirty());else if(i.kind==="uuid")JA.test(e.data)||(r=this._getOrReturnCtx(e,r),P(r,{validation:"uuid",code:$.invalid_string,message:i.message}),o.dirty());else if(i.kind==="nanoid")YA.test(e.data)||(r=this._getOrReturnCtx(e,r),P(r,{validation:"nanoid",code:$.invalid_string,message:i.message}),o.dirty());else if(i.kind==="cuid")KA.test(e.data)||(r=this._getOrReturnCtx(e,r),P(r,{validation:"cuid",code:$.invalid_string,message:i.message}),o.dirty());else if(i.kind==="cuid2")GA.test(e.data)||(r=this._getOrReturnCtx(e,r),P(r,{validation:"cuid2",code:$.invalid_string,message:i.message}),o.dirty());else if(i.kind==="ulid")WA.test(e.data)||(r=this._getOrReturnCtx(e,r),P(r,{validation:"ulid",code:$.invalid_string,message:i.message}),o.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{r=this._getOrReturnCtx(e,r),P(r,{validation:"url",code:$.invalid_string,message:i.message}),o.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(r=this._getOrReturnCtx(e,r),P(r,{validation:"regex",code:$.invalid_string,message:i.message}),o.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(r=this._getOrReturnCtx(e,r),P(r,{code:$.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),o.dirty()):i.kind==="toLowerCase"?e.data=e.data.toLowerCase():i.kind==="toUpperCase"?e.data=e.data.toUpperCase():i.kind==="startsWith"?e.data.startsWith(i.value)||(r=this._getOrReturnCtx(e,r),P(r,{code:$.invalid_string,validation:{startsWith:i.value},message:i.message}),o.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(r=this._getOrReturnCtx(e,r),P(r,{code:$.invalid_string,validation:{endsWith:i.value},message:i.message}),o.dirty()):i.kind==="datetime"?lC(i).test(e.data)||(r=this._getOrReturnCtx(e,r),P(r,{code:$.invalid_string,validation:"datetime",message:i.message}),o.dirty()):i.kind==="date"?cC.test(e.data)||(r=this._getOrReturnCtx(e,r),P(r,{code:$.invalid_string,validation:"date",message:i.message}),o.dirty()):i.kind==="time"?uC(i).test(e.data)||(r=this._getOrReturnCtx(e,r),P(r,{code:$.invalid_string,validation:"time",message:i.message}),o.dirty()):i.kind==="duration"?QA.test(e.data)||(r=this._getOrReturnCtx(e,r),P(r,{validation:"duration",code:$.invalid_string,message:i.message}),o.dirty()):i.kind==="ip"?dC(e.data,i.version)||(r=this._getOrReturnCtx(e,r),P(r,{validation:"ip",code:$.invalid_string,message:i.message}),o.dirty()):i.kind==="jwt"?pC(e.data,i.alg)||(r=this._getOrReturnCtx(e,r),P(r,{validation:"jwt",code:$.invalid_string,message:i.message}),o.dirty()):i.kind==="cidr"?mC(e.data,i.version)||(r=this._getOrReturnCtx(e,r),P(r,{validation:"cidr",code:$.invalid_string,message:i.message}),o.dirty()):i.kind==="base64"?aC.test(e.data)||(r=this._getOrReturnCtx(e,r),P(r,{validation:"base64",code:$.invalid_string,message:i.message}),o.dirty()):i.kind==="base64url"?sC.test(e.data)||(r=this._getOrReturnCtx(e,r),P(r,{validation:"base64url",code:$.invalid_string,message:i.message}),o.dirty()):re.assertNever(i);return{status:o.value,value:e.data}}_regex(e,n,o){return this.refinement(r=>e.test(r),{validation:n,code:$.invalid_string,...U.errToObj(o)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...U.errToObj(e)})}url(e){return this._addCheck({kind:"url",...U.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...U.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...U.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...U.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...U.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...U.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...U.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...U.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...U.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...U.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...U.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...U.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...U.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...U.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...U.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...U.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n?.position,...U.errToObj(n?.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...U.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...U.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...U.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...U.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...U.errToObj(n)})}nonempty(e){return this.min(1,U.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};po.create=t=>new po({checks:[],typeName:w.ZodString,coerce:t?.coerce??!1,...G(t)});function fC(t,e){let n=(t.toString().split(".")[1]||"").length,o=(e.toString().split(".")[1]||"").length,r=n>o?n:o,i=Number.parseInt(t.toFixed(r).replace(".","")),a=Number.parseInt(e.toFixed(r).replace(".",""));return i%a/10**r}var ba=class t extends Q{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==C.number){let i=this._getOrReturnCtx(e);return P(i,{code:$.invalid_type,expected:C.number,received:i.parsedType}),V}let o,r=new Ze;for(let i of this._def.checks)i.kind==="int"?re.isInteger(e.data)||(o=this._getOrReturnCtx(e,o),P(o,{code:$.invalid_type,expected:"integer",received:"float",message:i.message}),r.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(o=this._getOrReturnCtx(e,o),P(o,{code:$.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),r.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(o=this._getOrReturnCtx(e,o),P(o,{code:$.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),r.dirty()):i.kind==="multipleOf"?fC(e.data,i.value)!==0&&(o=this._getOrReturnCtx(e,o),P(o,{code:$.not_multiple_of,multipleOf:i.value,message:i.message}),r.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(o=this._getOrReturnCtx(e,o),P(o,{code:$.not_finite,message:i.message}),r.dirty()):re.assertNever(i);return{status:r.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,U.toString(n))}gt(e,n){return this.setLimit("min",e,!1,U.toString(n))}lte(e,n){return this.setLimit("max",e,!0,U.toString(n))}lt(e,n){return this.setLimit("max",e,!1,U.toString(n))}setLimit(e,n,o,r){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:o,message:U.toString(r)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:U.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:U.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:U.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:U.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:U.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:U.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:U.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:U.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:U.toString(e)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&re.isInteger(e.value))}get isFinite(){let e=null,n=null;for(let o of this._def.checks){if(o.kind==="finite"||o.kind==="int"||o.kind==="multipleOf")return!0;o.kind==="min"?(n===null||o.value>n)&&(n=o.value):o.kind==="max"&&(e===null||o.value<e)&&(e=o.value)}return Number.isFinite(n)&&Number.isFinite(e)}};ba.create=t=>new ba({checks:[],typeName:w.ZodNumber,coerce:t?.coerce||!1,...G(t)});var ka=class t extends Q{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==C.bigint)return this._getInvalidInput(e);let o,r=new Ze;for(let i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(o=this._getOrReturnCtx(e,o),P(o,{code:$.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),r.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(o=this._getOrReturnCtx(e,o),P(o,{code:$.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),r.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(o=this._getOrReturnCtx(e,o),P(o,{code:$.not_multiple_of,multipleOf:i.value,message:i.message}),r.dirty()):re.assertNever(i);return{status:r.value,value:e.data}}_getInvalidInput(e){let n=this._getOrReturnCtx(e);return P(n,{code:$.invalid_type,expected:C.bigint,received:n.parsedType}),V}gte(e,n){return this.setLimit("min",e,!0,U.toString(n))}gt(e,n){return this.setLimit("min",e,!1,U.toString(n))}lte(e,n){return this.setLimit("max",e,!0,U.toString(n))}lt(e,n){return this.setLimit("max",e,!1,U.toString(n))}setLimit(e,n,o,r){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:o,message:U.toString(r)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:U.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:U.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:U.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:U.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:U.toString(n)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};ka.create=t=>new ka({checks:[],typeName:w.ZodBigInt,coerce:t?.coerce??!1,...G(t)});var xa=class extends Q{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==C.boolean){let o=this._getOrReturnCtx(e);return P(o,{code:$.invalid_type,expected:C.boolean,received:o.parsedType}),V}return Je(e.data)}};xa.create=t=>new xa({typeName:w.ZodBoolean,coerce:t?.coerce||!1,...G(t)});var Sa=class t extends Q{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==C.date){let i=this._getOrReturnCtx(e);return P(i,{code:$.invalid_type,expected:C.date,received:i.parsedType}),V}if(Number.isNaN(e.data.getTime())){let i=this._getOrReturnCtx(e);return P(i,{code:$.invalid_date}),V}let o=new Ze,r;for(let i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(r=this._getOrReturnCtx(e,r),P(r,{code:$.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),o.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(r=this._getOrReturnCtx(e,r),P(r,{code:$.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),o.dirty()):re.assertNever(i);return{status:o.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:U.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:U.toString(n)})}get minDate(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}};Sa.create=t=>new Sa({checks:[],coerce:t?.coerce||!1,typeName:w.ZodDate,...G(t)});var $a=class extends Q{_parse(e){if(this._getType(e)!==C.symbol){let o=this._getOrReturnCtx(e);return P(o,{code:$.invalid_type,expected:C.symbol,received:o.parsedType}),V}return Je(e.data)}};$a.create=t=>new $a({typeName:w.ZodSymbol,...G(t)});var mo=class extends Q{_parse(e){if(this._getType(e)!==C.undefined){let o=this._getOrReturnCtx(e);return P(o,{code:$.invalid_type,expected:C.undefined,received:o.parsedType}),V}return Je(e.data)}};mo.create=t=>new mo({typeName:w.ZodUndefined,...G(t)});var fo=class extends Q{_parse(e){if(this._getType(e)!==C.null){let o=this._getOrReturnCtx(e);return P(o,{code:$.invalid_type,expected:C.null,received:o.parsedType}),V}return Je(e.data)}};fo.create=t=>new fo({typeName:w.ZodNull,...G(t)});var Ia=class extends Q{constructor(){super(...arguments),this._any=!0}_parse(e){return Je(e.data)}};Ia.create=t=>new Ia({typeName:w.ZodAny,...G(t)});var Er=class extends Q{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Je(e.data)}};Er.create=t=>new Er({typeName:w.ZodUnknown,...G(t)});var qt=class extends Q{_parse(e){let n=this._getOrReturnCtx(e);return P(n,{code:$.invalid_type,expected:C.never,received:n.parsedType}),V}};qt.create=t=>new qt({typeName:w.ZodNever,...G(t)});var wa=class extends Q{_parse(e){if(this._getType(e)!==C.undefined){let o=this._getOrReturnCtx(e);return P(o,{code:$.invalid_type,expected:C.void,received:o.parsedType}),V}return Je(e.data)}};wa.create=t=>new wa({typeName:w.ZodVoid,...G(t)});var Tr=class t extends Q{_parse(e){let{ctx:n,status:o}=this._processInputParams(e),r=this._def;if(n.parsedType!==C.array)return P(n,{code:$.invalid_type,expected:C.array,received:n.parsedType}),V;if(r.exactLength!==null){let a=n.data.length>r.exactLength.value,c=n.data.length<r.exactLength.value;(a||c)&&(P(n,{code:a?$.too_big:$.too_small,minimum:c?r.exactLength.value:void 0,maximum:a?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),o.dirty())}if(r.minLength!==null&&n.data.length<r.minLength.value&&(P(n,{code:$.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),o.dirty()),r.maxLength!==null&&n.data.length>r.maxLength.value&&(P(n,{code:$.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),o.dirty()),n.common.async)return Promise.all([...n.data].map((a,c)=>r.type._parseAsync(new vt(n,a,n.path,c)))).then(a=>Ze.mergeArray(o,a));let i=[...n.data].map((a,c)=>r.type._parseSync(new vt(n,a,n.path,c)));return Ze.mergeArray(o,i)}get element(){return this._def.type}min(e,n){return new t({...this._def,minLength:{value:e,message:U.toString(n)}})}max(e,n){return new t({...this._def,maxLength:{value:e,message:U.toString(n)}})}length(e,n){return new t({...this._def,exactLength:{value:e,message:U.toString(n)}})}nonempty(e){return this.min(1,e)}};Tr.create=(t,e)=>new Tr({type:t,minLength:null,maxLength:null,exactLength:null,typeName:w.ZodArray,...G(e)});function lo(t){if(t instanceof ft){let e={};for(let n in t.shape){let o=t.shape[n];e[n]=Pt.create(lo(o))}return new ft({...t._def,shape:()=>e})}else return t instanceof Tr?new Tr({...t._def,type:lo(t.element)}):t instanceof Pt?Pt.create(lo(t.unwrap())):t instanceof rr?rr.create(lo(t.unwrap())):t instanceof tr?tr.create(t.items.map(e=>lo(e))):t}var ft=class t extends Q{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),n=re.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==C.object){let d=this._getOrReturnCtx(e);return P(d,{code:$.invalid_type,expected:C.object,received:d.parsedType}),V}let{status:o,ctx:r}=this._processInputParams(e),{shape:i,keys:a}=this._getCached(),c=[];if(!(this._def.catchall instanceof qt&&this._def.unknownKeys==="strip"))for(let d in r.data)a.includes(d)||c.push(d);let u=[];for(let d of a){let l=i[d],p=r.data[d];u.push({key:{status:"valid",value:d},value:l._parse(new vt(r,p,r.path,d)),alwaysSet:d in r.data})}if(this._def.catchall instanceof qt){let d=this._def.unknownKeys;if(d==="passthrough")for(let l of c)u.push({key:{status:"valid",value:l},value:{status:"valid",value:r.data[l]}});else if(d==="strict")c.length>0&&(P(r,{code:$.unrecognized_keys,keys:c}),o.dirty());else if(d!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let d=this._def.catchall;for(let l of c){let p=r.data[l];u.push({key:{status:"valid",value:l},value:d._parse(new vt(r,p,r.path,l)),alwaysSet:l in r.data})}}return r.common.async?Promise.resolve().then(async()=>{let d=[];for(let l of u){let p=await l.key,m=await l.value;d.push({key:p,value:m,alwaysSet:l.alwaysSet})}return d}).then(d=>Ze.mergeObjectSync(o,d)):Ze.mergeObjectSync(o,u)}get shape(){return this._def.shape()}strict(e){return U.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,o)=>{let r=this._def.errorMap?.(n,o).message??o.defaultError;return n.code==="unrecognized_keys"?{message:U.errToObj(e).message??r}:{message:r}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:w.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let n={};for(let o of re.objectKeys(e))e[o]&&this.shape[o]&&(n[o]=this.shape[o]);return new t({...this._def,shape:()=>n})}omit(e){let n={};for(let o of re.objectKeys(this.shape))e[o]||(n[o]=this.shape[o]);return new t({...this._def,shape:()=>n})}deepPartial(){return lo(this)}partial(e){let n={};for(let o of re.objectKeys(this.shape)){let r=this.shape[o];e&&!e[o]?n[o]=r:n[o]=r.optional()}return new t({...this._def,shape:()=>n})}required(e){let n={};for(let o of re.objectKeys(this.shape))if(e&&!e[o])n[o]=this.shape[o];else{let i=this.shape[o];for(;i instanceof Pt;)i=i._def.innerType;n[o]=i}return new t({...this._def,shape:()=>n})}keyof(){return Dx(re.objectKeys(this.shape))}};ft.create=(t,e)=>new ft({shape:()=>t,unknownKeys:"strip",catchall:qt.create(),typeName:w.ZodObject,...G(e)});ft.strictCreate=(t,e)=>new ft({shape:()=>t,unknownKeys:"strict",catchall:qt.create(),typeName:w.ZodObject,...G(e)});ft.lazycreate=(t,e)=>new ft({shape:t,unknownKeys:"strip",catchall:qt.create(),typeName:w.ZodObject,...G(e)});var ho=class extends Q{_parse(e){let{ctx:n}=this._processInputParams(e),o=this._def.options;function r(i){for(let c of i)if(c.result.status==="valid")return c.result;for(let c of i)if(c.result.status==="dirty")return n.common.issues.push(...c.ctx.common.issues),c.result;let a=i.map(c=>new mt(c.ctx.common.issues));return P(n,{code:$.invalid_union,unionErrors:a}),V}if(n.common.async)return Promise.all(o.map(async i=>{let a={...n,common:{...n.common,issues:[]},parent:null};return{result:await i._parseAsync({data:n.data,path:n.path,parent:a}),ctx:a}})).then(r);{let i,a=[];for(let u of o){let d={...n,common:{...n.common,issues:[]},parent:null},l=u._parseSync({data:n.data,path:n.path,parent:d});if(l.status==="valid")return l;l.status==="dirty"&&!i&&(i={result:l,ctx:d}),d.common.issues.length&&a.push(d.common.issues)}if(i)return n.common.issues.push(...i.ctx.common.issues),i.result;let c=a.map(u=>new mt(u));return P(n,{code:$.invalid_union,unionErrors:c}),V}}get options(){return this._def.options}};ho.create=(t,e)=>new ho({options:t,typeName:w.ZodUnion,...G(e)});var er=t=>t instanceof _o?er(t.schema):t instanceof Ot?er(t.innerType()):t instanceof yo?[t.value]:t instanceof vo?t.options:t instanceof bo?re.objectValues(t.enum):t instanceof ko?er(t._def.innerType):t instanceof mo?[void 0]:t instanceof fo?[null]:t instanceof Pt?[void 0,...er(t.unwrap())]:t instanceof rr?[null,...er(t.unwrap())]:t instanceof jl||t instanceof So?er(t.unwrap()):t instanceof xo?er(t._def.innerType):[],Wh=class t extends Q{_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==C.object)return P(n,{code:$.invalid_type,expected:C.object,received:n.parsedType}),V;let o=this.discriminator,r=n.data[o],i=this.optionsMap.get(r);return i?n.common.async?i._parseAsync({data:n.data,path:n.path,parent:n}):i._parseSync({data:n.data,path:n.path,parent:n}):(P(n,{code:$.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[o]}),V)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,o){let r=new Map;for(let i of n){let a=er(i.shape[e]);if(!a.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let c of a){if(r.has(c))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(c)}`);r.set(c,i)}}return new t({typeName:w.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:r,...G(o)})}};function Jh(t,e){let n=Qt(t),o=Qt(e);if(t===e)return{valid:!0,data:t};if(n===C.object&&o===C.object){let r=re.objectKeys(e),i=re.objectKeys(t).filter(c=>r.indexOf(c)!==-1),a={...t,...e};for(let c of i){let u=Jh(t[c],e[c]);if(!u.valid)return{valid:!1};a[c]=u.data}return{valid:!0,data:a}}else if(n===C.array&&o===C.array){if(t.length!==e.length)return{valid:!1};let r=[];for(let i=0;i<t.length;i++){let a=t[i],c=e[i],u=Jh(a,c);if(!u.valid)return{valid:!1};r.push(u.data)}return{valid:!0,data:r}}else return n===C.date&&o===C.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var go=class extends Q{_parse(e){let{status:n,ctx:o}=this._processInputParams(e),r=(i,a)=>{if(Hh(i)||Hh(a))return V;let c=Jh(i.value,a.value);return c.valid?((Kh(i)||Kh(a))&&n.dirty(),{status:n.value,value:c.data}):(P(o,{code:$.invalid_intersection_types}),V)};return o.common.async?Promise.all([this._def.left._parseAsync({data:o.data,path:o.path,parent:o}),this._def.right._parseAsync({data:o.data,path:o.path,parent:o})]).then(([i,a])=>r(i,a)):r(this._def.left._parseSync({data:o.data,path:o.path,parent:o}),this._def.right._parseSync({data:o.data,path:o.path,parent:o}))}};go.create=(t,e,n)=>new go({left:t,right:e,typeName:w.ZodIntersection,...G(n)});var tr=class t extends Q{_parse(e){let{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==C.array)return P(o,{code:$.invalid_type,expected:C.array,received:o.parsedType}),V;if(o.data.length<this._def.items.length)return P(o,{code:$.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),V;!this._def.rest&&o.data.length>this._def.items.length&&(P(o,{code:$.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());let i=[...o.data].map((a,c)=>{let u=this._def.items[c]||this._def.rest;return u?u._parse(new vt(o,a,o.path,c)):null}).filter(a=>!!a);return o.common.async?Promise.all(i).then(a=>Ze.mergeArray(n,a)):Ze.mergeArray(n,i)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};tr.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new tr({items:t,typeName:w.ZodTuple,rest:null,...G(e)})};var Yh=class t extends Q{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==C.object)return P(o,{code:$.invalid_type,expected:C.object,received:o.parsedType}),V;let r=[],i=this._def.keyType,a=this._def.valueType;for(let c in o.data)r.push({key:i._parse(new vt(o,c,o.path,c)),value:a._parse(new vt(o,o.data[c],o.path,c)),alwaysSet:c in o.data});return o.common.async?Ze.mergeObjectAsync(n,r):Ze.mergeObjectSync(n,r)}get element(){return this._def.valueType}static create(e,n,o){return n instanceof Q?new t({keyType:e,valueType:n,typeName:w.ZodRecord,...G(o)}):new t({keyType:po.create(),valueType:e,typeName:w.ZodRecord,...G(n)})}},Ea=class extends Q{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==C.map)return P(o,{code:$.invalid_type,expected:C.map,received:o.parsedType}),V;let r=this._def.keyType,i=this._def.valueType,a=[...o.data.entries()].map(([c,u],d)=>({key:r._parse(new vt(o,c,o.path,[d,"key"])),value:i._parse(new vt(o,u,o.path,[d,"value"]))}));if(o.common.async){let c=new Map;return Promise.resolve().then(async()=>{for(let u of a){let d=await u.key,l=await u.value;if(d.status==="aborted"||l.status==="aborted")return V;(d.status==="dirty"||l.status==="dirty")&&n.dirty(),c.set(d.value,l.value)}return{status:n.value,value:c}})}else{let c=new Map;for(let u of a){let d=u.key,l=u.value;if(d.status==="aborted"||l.status==="aborted")return V;(d.status==="dirty"||l.status==="dirty")&&n.dirty(),c.set(d.value,l.value)}return{status:n.value,value:c}}}};Ea.create=(t,e,n)=>new Ea({valueType:e,keyType:t,typeName:w.ZodMap,...G(n)});var Ta=class t extends Q{_parse(e){let{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==C.set)return P(o,{code:$.invalid_type,expected:C.set,received:o.parsedType}),V;let r=this._def;r.minSize!==null&&o.data.size<r.minSize.value&&(P(o,{code:$.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),n.dirty()),r.maxSize!==null&&o.data.size>r.maxSize.value&&(P(o,{code:$.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),n.dirty());let i=this._def.valueType;function a(u){let d=new Set;for(let l of u){if(l.status==="aborted")return V;l.status==="dirty"&&n.dirty(),d.add(l.value)}return{status:n.value,value:d}}let c=[...o.data.values()].map((u,d)=>i._parse(new vt(o,u,o.path,d)));return o.common.async?Promise.all(c).then(u=>a(u)):a(c)}min(e,n){return new t({...this._def,minSize:{value:e,message:U.toString(n)}})}max(e,n){return new t({...this._def,maxSize:{value:e,message:U.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}};Ta.create=(t,e)=>new Ta({valueType:t,minSize:null,maxSize:null,typeName:w.ZodSet,...G(e)});var Xh=class t extends Q{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==C.function)return P(n,{code:$.invalid_type,expected:C.function,received:n.parsedType}),V;function o(c,u){return Dl({data:c,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,ya(),wr].filter(d=>!!d),issueData:{code:$.invalid_arguments,argumentsError:u}})}function r(c,u){return Dl({data:c,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,ya(),wr].filter(d=>!!d),issueData:{code:$.invalid_return_type,returnTypeError:u}})}let i={errorMap:n.common.contextualErrorMap},a=n.data;if(this._def.returns instanceof tn){let c=this;return Je(async function(...u){let d=new mt([]),l=await c._def.args.parseAsync(u,i).catch(f=>{throw d.addIssue(o(u,f)),d}),p=await Reflect.apply(a,this,l);return await c._def.returns._def.type.parseAsync(p,i).catch(f=>{throw d.addIssue(r(p,f)),d})})}else{let c=this;return Je(function(...u){let d=c._def.args.safeParse(u,i);if(!d.success)throw new mt([o(u,d.error)]);let l=Reflect.apply(a,this,d.data),p=c._def.returns.safeParse(l,i);if(!p.success)throw new mt([r(l,p.error)]);return p.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:tr.create(e).rest(Er.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,o){return new t({args:e||tr.create([]).rest(Er.create()),returns:n||Er.create(),typeName:w.ZodFunction,...G(o)})}},_o=class extends Q{get schema(){return this._def.getter()}_parse(e){let{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}};_o.create=(t,e)=>new _o({getter:t,typeName:w.ZodLazy,...G(e)});var yo=class extends Q{_parse(e){if(e.data!==this._def.value){let n=this._getOrReturnCtx(e);return P(n,{received:n.data,code:$.invalid_literal,expected:this._def.value}),V}return{status:"valid",value:e.data}}get value(){return this._def.value}};yo.create=(t,e)=>new yo({value:t,typeName:w.ZodLiteral,...G(e)});function Dx(t,e){return new vo({values:t,typeName:w.ZodEnum,...G(e)})}var vo=class t extends Q{_parse(e){if(typeof e.data!="string"){let n=this._getOrReturnCtx(e),o=this._def.values;return P(n,{expected:re.joinValues(o),received:n.parsedType,code:$.invalid_type}),V}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let n=this._getOrReturnCtx(e),o=this._def.values;return P(n,{received:n.data,code:$.invalid_enum_value,options:o}),V}return Je(e.data)}get options(){return this._def.values}get enum(){let e={};for(let n of this._def.values)e[n]=n;return e}get Values(){let e={};for(let n of this._def.values)e[n]=n;return e}get Enum(){let e={};for(let n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return t.create(e,{...this._def,...n})}exclude(e,n=this._def){return t.create(this.options.filter(o=>!e.includes(o)),{...this._def,...n})}};vo.create=Dx;var bo=class extends Q{_parse(e){let n=re.getValidEnumValues(this._def.values),o=this._getOrReturnCtx(e);if(o.parsedType!==C.string&&o.parsedType!==C.number){let r=re.objectValues(n);return P(o,{expected:re.joinValues(r),received:o.parsedType,code:$.invalid_type}),V}if(this._cache||(this._cache=new Set(re.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let r=re.objectValues(n);return P(o,{received:o.data,code:$.invalid_enum_value,options:r}),V}return Je(e.data)}get enum(){return this._def.values}};bo.create=(t,e)=>new bo({values:t,typeName:w.ZodNativeEnum,...G(e)});var tn=class extends Q{unwrap(){return this._def.type}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==C.promise&&n.common.async===!1)return P(n,{code:$.invalid_type,expected:C.promise,received:n.parsedType}),V;let o=n.parsedType===C.promise?n.data:Promise.resolve(n.data);return Je(o.then(r=>this._def.type.parseAsync(r,{path:n.path,errorMap:n.common.contextualErrorMap})))}};tn.create=(t,e)=>new tn({type:t,typeName:w.ZodPromise,...G(e)});var Ot=class extends Q{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===w.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:n,ctx:o}=this._processInputParams(e),r=this._def.effect||null,i={addIssue:a=>{P(o,a),a.fatal?n.abort():n.dirty()},get path(){return o.path}};if(i.addIssue=i.addIssue.bind(i),r.type==="preprocess"){let a=r.transform(o.data,i);if(o.common.async)return Promise.resolve(a).then(async c=>{if(n.value==="aborted")return V;let u=await this._def.schema._parseAsync({data:c,path:o.path,parent:o});return u.status==="aborted"?V:u.status==="dirty"?uo(u.value):n.value==="dirty"?uo(u.value):u});{if(n.value==="aborted")return V;let c=this._def.schema._parseSync({data:a,path:o.path,parent:o});return c.status==="aborted"?V:c.status==="dirty"?uo(c.value):n.value==="dirty"?uo(c.value):c}}if(r.type==="refinement"){let a=c=>{let u=r.refinement(c,i);if(o.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return c};if(o.common.async===!1){let c=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});return c.status==="aborted"?V:(c.status==="dirty"&&n.dirty(),a(c.value),{status:n.value,value:c.value})}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(c=>c.status==="aborted"?V:(c.status==="dirty"&&n.dirty(),a(c.value).then(()=>({status:n.value,value:c.value}))))}if(r.type==="transform")if(o.common.async===!1){let a=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});if(!en(a))return V;let c=r.transform(a.value,i);if(c instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:c}}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(a=>en(a)?Promise.resolve(r.transform(a.value,i)).then(c=>({status:n.value,value:c})):V);re.assertNever(r)}};Ot.create=(t,e,n)=>new Ot({schema:t,typeName:w.ZodEffects,effect:e,...G(n)});Ot.createWithPreprocess=(t,e,n)=>new Ot({schema:e,effect:{type:"preprocess",transform:t},typeName:w.ZodEffects,...G(n)});var Pt=class extends Q{_parse(e){return this._getType(e)===C.undefined?Je(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Pt.create=(t,e)=>new Pt({innerType:t,typeName:w.ZodOptional,...G(e)});var rr=class extends Q{_parse(e){return this._getType(e)===C.null?Je(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};rr.create=(t,e)=>new rr({innerType:t,typeName:w.ZodNullable,...G(e)});var ko=class extends Q{_parse(e){let{ctx:n}=this._processInputParams(e),o=n.data;return n.parsedType===C.undefined&&(o=this._def.defaultValue()),this._def.innerType._parse({data:o,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};ko.create=(t,e)=>new ko({innerType:t,typeName:w.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...G(e)});var xo=class extends Q{_parse(e){let{ctx:n}=this._processInputParams(e),o={...n,common:{...n.common,issues:[]}},r=this._def.innerType._parse({data:o.data,path:o.path,parent:{...o}});return va(r)?r.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new mt(o.common.issues)},input:o.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new mt(o.common.issues)},input:o.data})}}removeCatch(){return this._def.innerType}};xo.create=(t,e)=>new xo({innerType:t,typeName:w.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...G(e)});var Pa=class extends Q{_parse(e){if(this._getType(e)!==C.nan){let o=this._getOrReturnCtx(e);return P(o,{code:$.invalid_type,expected:C.nan,received:o.parsedType}),V}return{status:"valid",value:e.data}}};Pa.create=t=>new Pa({typeName:w.ZodNaN,...G(t)});var jl=class extends Q{_parse(e){let{ctx:n}=this._processInputParams(e),o=n.data;return this._def.type._parse({data:o,path:n.path,parent:n})}unwrap(){return this._def.type}},Ul=class t extends Q{_parse(e){let{status:n,ctx:o}=this._processInputParams(e);if(o.common.async)return(async()=>{let i=await this._def.in._parseAsync({data:o.data,path:o.path,parent:o});return i.status==="aborted"?V:i.status==="dirty"?(n.dirty(),uo(i.value)):this._def.out._parseAsync({data:i.value,path:o.path,parent:o})})();{let r=this._def.in._parseSync({data:o.data,path:o.path,parent:o});return r.status==="aborted"?V:r.status==="dirty"?(n.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:o.path,parent:o})}}static create(e,n){return new t({in:e,out:n,typeName:w.ZodPipeline})}},So=class extends Q{_parse(e){let n=this._def.innerType._parse(e),o=r=>(en(r)&&(r.value=Object.freeze(r.value)),r);return va(n)?n.then(r=>o(r)):o(n)}unwrap(){return this._def.innerType}};So.create=(t,e)=>new So({innerType:t,typeName:w.ZodReadonly,...G(e)});var rV={object:ft.lazycreate},w;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(w||(w={}));var nV=po.create,oV=ba.create,iV=Pa.create,aV=ka.create,sV=xa.create,cV=Sa.create,uV=$a.create,lV=mo.create,dV=fo.create,pV=Ia.create,mV=Er.create,fV=qt.create,hV=wa.create,gV=Tr.create,jx=ft.create,_V=ft.strictCreate,yV=ho.create,vV=Wh.create,bV=go.create,kV=tr.create,xV=Yh.create,SV=Ea.create,$V=Ta.create,IV=Xh.create,wV=_o.create,EV=yo.create,TV=vo.create,PV=bo.create,OV=tn.create,RV=Ot.create,AV=Pt.create,CV=rr.create,NV=Ot.createWithPreprocess,zV=Ul.create;var gC=h("ZodMiniType",(t,e)=>{if(!t._zod)throw new Error("Uninitialized schema in ZodMiniType.");B.init(t,e),t.def=e,t.type=e.type,t.parse=(n,o)=>Br(t,n,o,{callee:t.parse}),t.safeParse=(n,o)=>gr(t,n,o),t.parseAsync=async(n,o)=>Hr(t,n,o,{callee:t.parseAsync}),t.safeParseAsync=async(n,o)=>_r(t,n,o),t.check=(...n)=>t.clone({...e,checks:[...e.checks??[],...n.map(o=>typeof o=="function"?{_zod:{check:o,def:{check:"custom"},onattach:[]}}:o)]},{parent:!0}),t.with=t.check,t.clone=(n,o)=>Ae(t,n,o),t.brand=()=>t,t.register=((n,o)=>(n.add(t,o),t)),t.apply=n=>n(t)});var _C=h("ZodMiniObject",(t,e)=>{Ic.init(t,e),gC.init(t,e),W(t,"shape",()=>e.shape)});function Qh(t,e){let n={type:"object",shape:t??{},...I(e)};return new _C(n)}function bt(t){return!!t._zod}function rn(t){let e=Object.values(t);if(e.length===0)return Qh({});let n=e.every(bt),o=e.every(r=>!bt(r));if(n)return Qh(t);if(o)return jx(t);throw new Error("Mixed Zod versions detected in object shape.")}function Pr(t,e){return bt(t)?gr(t,e):t.safeParse(e)}async function Ll(t,e){return bt(t)?await _r(t,e):await t.safeParseAsync(e)}function Or(t){if(!t)return;let e;if(bt(t)?e=t._zod?.def?.shape:e=t.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function $o(t){if(t){if(typeof t=="object"){let e=t,n=t;if(!e._def&&!n._zod){let o=Object.values(t);if(o.length>0&&o.every(r=>typeof r=="object"&&r!==null&&(r._def!==void 0||r._zod!==void 0||typeof r.parse=="function")))return rn(t)}}if(bt(t)){let n=t._zod?.def;if(n&&(n.type==="object"||n.shape!==void 0))return t}else if(t.shape!==void 0)return t}}function Ml(t){if(t&&typeof t=="object"){if("message"in t&&typeof t.message=="string")return t.message;if("issues"in t&&Array.isArray(t.issues)&&t.issues.length>0){let e=t.issues[0];if(e&&typeof e=="object"&&"message"in e)return String(e.message)}try{return JSON.stringify(t)}catch{return String(t)}}return String(t)}function Ux(t){return t.description}function Lx(t){if(bt(t))return t._zod?.def?.type==="optional";let e=t;return typeof t.isOptional=="function"?t.isOptional():e._def?.typeName==="ZodOptional"}function Zl(t){if(bt(t)){let i=t._zod?.def;if(i){if(i.value!==void 0)return i.value;if(Array.isArray(i.values)&&i.values.length>0)return i.values[0]}}let n=t._def;if(n){if(n.value!==void 0)return n.value;if(Array.isArray(n.values)&&n.values.length>0)return n.values[0]}let o=t.value;if(o!==void 0)return o}function Rr(t){return t==="completed"||t==="failed"||t==="cancelled"}var Zx=Symbol("Let zodToJsonSchema decide on which parser to use");var Mx={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"},Fx=t=>typeof t=="string"?{...Mx,name:t}:{...Mx,...t};var Vx=t=>{let e=Fx(t),n=e.name!==void 0?[...e.basePath,e.definitionPath,e.name]:e.basePath;return{...e,flags:{hasReferencedOpenAiAnyType:!1},currentPath:n,propertyPath:void 0,seen:new Map(Object.entries(e.definitions).map(([o,r])=>[r._def,{def:r._def,path:[...e.basePath,e.definitionPath,o],jsonSchema:void 0}]))}};function eg(t,e,n,o){o?.errorMessages&&n&&(t.errorMessage={...t.errorMessage,[e]:n})}function ne(t,e,n,o,r){t[e]=n,eg(t,e,o,r)}var Fl=(t,e)=>{let n=0;for(;n<t.length&&n<e.length&&t[n]===e[n];n++);return[(t.length-n).toString(),...e.slice(n)].join("/")};function Ie(t){if(t.target!=="openAi")return{};let e=[...t.basePath,t.definitionPath,t.openAiAnyTypeName];return t.flags.hasReferencedOpenAiAnyType=!0,{$ref:t.$refStrategy==="relative"?Fl(e,t.currentPath):e.join("/")}}function qx(t,e){let n={type:"array"};return t.type?._def&&t.type?._def?.typeName!==w.ZodAny&&(n.items=q(t.type._def,{...e,currentPath:[...e.currentPath,"items"]})),t.minLength&&ne(n,"minItems",t.minLength.value,t.minLength.message,e),t.maxLength&&ne(n,"maxItems",t.maxLength.value,t.maxLength.message,e),t.exactLength&&(ne(n,"minItems",t.exactLength.value,t.exactLength.message,e),ne(n,"maxItems",t.exactLength.value,t.exactLength.message,e)),n}function Bx(t,e){let n={type:"integer",format:"int64"};if(!t.checks)return n;for(let o of t.checks)switch(o.kind){case"min":e.target==="jsonSchema7"?o.inclusive?ne(n,"minimum",o.value,o.message,e):ne(n,"exclusiveMinimum",o.value,o.message,e):(o.inclusive||(n.exclusiveMinimum=!0),ne(n,"minimum",o.value,o.message,e));break;case"max":e.target==="jsonSchema7"?o.inclusive?ne(n,"maximum",o.value,o.message,e):ne(n,"exclusiveMaximum",o.value,o.message,e):(o.inclusive||(n.exclusiveMaximum=!0),ne(n,"maximum",o.value,o.message,e));break;case"multipleOf":ne(n,"multipleOf",o.value,o.message,e);break}return n}function Hx(){return{type:"boolean"}}function Vl(t,e){return q(t.type._def,e)}var Kx=(t,e)=>q(t.innerType._def,e);function tg(t,e,n){let o=n??e.dateStrategy;if(Array.isArray(o))return{anyOf:o.map((r,i)=>tg(t,e,r))};switch(o){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return vC(t,e)}}var vC=(t,e)=>{let n={type:"integer",format:"unix-time"};if(e.target==="openApi3")return n;for(let o of t.checks)switch(o.kind){case"min":ne(n,"minimum",o.value,o.message,e);break;case"max":ne(n,"maximum",o.value,o.message,e);break}return n};function Gx(t,e){return{...q(t.innerType._def,e),default:t.defaultValue()}}function Wx(t,e){return e.effectStrategy==="input"?q(t.schema._def,e):Ie(e)}function Jx(t){return{type:"string",enum:Array.from(t.values)}}var bC=t=>"type"in t&&t.type==="string"?!1:"allOf"in t;function Yx(t,e){let n=[q(t.left._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),q(t.right._def,{...e,currentPath:[...e.currentPath,"allOf","1"]})].filter(i=>!!i),o=e.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,r=[];return n.forEach(i=>{if(bC(i))r.push(...i.allOf),i.unevaluatedProperties===void 0&&(o=void 0);else{let a=i;if("additionalProperties"in i&&i.additionalProperties===!1){let{additionalProperties:c,...u}=i;a=u}else o=void 0;r.push(a)}}),r.length?{allOf:r,...o}:void 0}function Xx(t,e){let n=typeof t.value;return n!=="bigint"&&n!=="number"&&n!=="boolean"&&n!=="string"?{type:Array.isArray(t.value)?"array":"object"}:e.target==="openApi3"?{type:n==="bigint"?"integer":n,enum:[t.value]}:{type:n==="bigint"?"integer":n,const:t.value}}var rg,Rt={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:()=>(rg===void 0&&(rg=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),rg),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 ql(t,e){let n={type:"string"};if(t.checks)for(let o of t.checks)switch(o.kind){case"min":ne(n,"minLength",typeof n.minLength=="number"?Math.max(n.minLength,o.value):o.value,o.message,e);break;case"max":ne(n,"maxLength",typeof n.maxLength=="number"?Math.min(n.maxLength,o.value):o.value,o.message,e);break;case"email":switch(e.emailStrategy){case"format:email":At(n,"email",o.message,e);break;case"format:idn-email":At(n,"idn-email",o.message,e);break;case"pattern:zod":Ye(n,Rt.email,o.message,e);break}break;case"url":At(n,"uri",o.message,e);break;case"uuid":At(n,"uuid",o.message,e);break;case"regex":Ye(n,o.regex,o.message,e);break;case"cuid":Ye(n,Rt.cuid,o.message,e);break;case"cuid2":Ye(n,Rt.cuid2,o.message,e);break;case"startsWith":Ye(n,RegExp(`^${ng(o.value,e)}`),o.message,e);break;case"endsWith":Ye(n,RegExp(`${ng(o.value,e)}$`),o.message,e);break;case"datetime":At(n,"date-time",o.message,e);break;case"date":At(n,"date",o.message,e);break;case"time":At(n,"time",o.message,e);break;case"duration":At(n,"duration",o.message,e);break;case"length":ne(n,"minLength",typeof n.minLength=="number"?Math.max(n.minLength,o.value):o.value,o.message,e),ne(n,"maxLength",typeof n.maxLength=="number"?Math.min(n.maxLength,o.value):o.value,o.message,e);break;case"includes":{Ye(n,RegExp(ng(o.value,e)),o.message,e);break}case"ip":{o.version!=="v6"&&At(n,"ipv4",o.message,e),o.version!=="v4"&&At(n,"ipv6",o.message,e);break}case"base64url":Ye(n,Rt.base64url,o.message,e);break;case"jwt":Ye(n,Rt.jwt,o.message,e);break;case"cidr":{o.version!=="v6"&&Ye(n,Rt.ipv4Cidr,o.message,e),o.version!=="v4"&&Ye(n,Rt.ipv6Cidr,o.message,e);break}case"emoji":Ye(n,Rt.emoji(),o.message,e);break;case"ulid":{Ye(n,Rt.ulid,o.message,e);break}case"base64":{switch(e.base64Strategy){case"format:binary":{At(n,"binary",o.message,e);break}case"contentEncoding:base64":{ne(n,"contentEncoding","base64",o.message,e);break}case"pattern:zod":{Ye(n,Rt.base64,o.message,e);break}}break}case"nanoid":Ye(n,Rt.nanoid,o.message,e);case"toLowerCase":case"toUpperCase":case"trim":break;default:}return n}function ng(t,e){return e.patternStrategy==="escape"?xC(t):t}var kC=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function xC(t){let e="";for(let n=0;n<t.length;n++)kC.has(t[n])||(e+="\\"),e+=t[n];return e}function At(t,e,n,o){t.format||t.anyOf?.some(r=>r.format)?(t.anyOf||(t.anyOf=[]),t.format&&(t.anyOf.push({format:t.format,...t.errorMessage&&o.errorMessages&&{errorMessage:{format:t.errorMessage.format}}}),delete t.format,t.errorMessage&&(delete t.errorMessage.format,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.anyOf.push({format:e,...n&&o.errorMessages&&{errorMessage:{format:n}}})):ne(t,"format",e,n,o)}function Ye(t,e,n,o){t.pattern||t.allOf?.some(r=>r.pattern)?(t.allOf||(t.allOf=[]),t.pattern&&(t.allOf.push({pattern:t.pattern,...t.errorMessage&&o.errorMessages&&{errorMessage:{pattern:t.errorMessage.pattern}}}),delete t.pattern,t.errorMessage&&(delete t.errorMessage.pattern,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.allOf.push({pattern:Qx(e,o),...n&&o.errorMessages&&{errorMessage:{pattern:n}}})):ne(t,"pattern",Qx(e,o),n,o)}function Qx(t,e){if(!e.applyRegexFlags||!t.flags)return t.source;let n={i:t.flags.includes("i"),m:t.flags.includes("m"),s:t.flags.includes("s")},o=n.i?t.source.toLowerCase():t.source,r="",i=!1,a=!1,c=!1;for(let u=0;u<o.length;u++){if(i){r+=o[u],i=!1;continue}if(n.i){if(a){if(o[u].match(/[a-z]/)){c?(r+=o[u],r+=`${o[u-2]}-${o[u]}`.toUpperCase(),c=!1):o[u+1]==="-"&&o[u+2]?.match(/[a-z]/)?(r+=o[u],c=!0):r+=`${o[u]}${o[u].toUpperCase()}`;continue}}else if(o[u].match(/[a-z]/)){r+=`[${o[u]}${o[u].toUpperCase()}]`;continue}}if(n.m){if(o[u]==="^"){r+=`(^|(?<=[\r
|
|
77
|
-
]))`;continue}else if(
|
|
78
|
-
]))`;continue}}if(n.s&&
|
|
79
|
-
`:`[${
|
|
80
|
-
]`;continue}r+=o[u],o[u]==="\\"?i=!0:a&&o[u]==="]"?a=!1:!a&&o[u]==="["&&(a=!0)}try{new RegExp(r)}catch{return console.warn(`Could not convert regex pattern at ${e.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),t.source}return r}function Bl(t,e){if(e.target==="openAi"&&console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead."),e.target==="openApi3"&&t.keyType?._def.typeName===w.ZodEnum)return{type:"object",required:t.keyType._def.values,properties:t.keyType._def.values.reduce((o,r)=>({...o,[r]:q(t.valueType._def,{...e,currentPath:[...e.currentPath,"properties",r]})??Ie(e)}),{}),additionalProperties:e.rejectedAdditionalProperties};let n={type:"object",additionalProperties:q(t.valueType._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]})??e.allowedAdditionalProperties};if(e.target==="openApi3")return n;if(t.keyType?._def.typeName===w.ZodString&&t.keyType._def.checks?.length){let{type:o,...r}=ql(t.keyType._def,e);return{...n,propertyNames:r}}else{if(t.keyType?._def.typeName===w.ZodEnum)return{...n,propertyNames:{enum:t.keyType._def.values}};if(t.keyType?._def.typeName===w.ZodBranded&&t.keyType._def.type._def.typeName===w.ZodString&&t.keyType._def.type._def.checks?.length){let{type:o,...r}=Vl(t.keyType._def,e);return{...n,propertyNames:r}}}return n}function eS(t,e){if(e.mapStrategy==="record")return Bl(t,e);let n=q(t.keyType._def,{...e,currentPath:[...e.currentPath,"items","items","0"]})||Ie(e),o=q(t.valueType._def,{...e,currentPath:[...e.currentPath,"items","items","1"]})||Ie(e);return{type:"array",maxItems:125,items:{type:"array",items:[n,o],minItems:2,maxItems:2}}}function tS(t){let e=t.values,o=Object.keys(t.values).filter(i=>typeof e[e[i]]!="number").map(i=>e[i]),r=Array.from(new Set(o.map(i=>typeof i)));return{type:r.length===1?r[0]==="string"?"string":"number":["string","number"],enum:o}}function rS(t){return t.target==="openAi"?void 0:{not:Ie({...t,currentPath:[...t.currentPath,"not"]})}}function nS(t){return t.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}var Oa={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function iS(t,e){if(e.target==="openApi3")return oS(t,e);let n=t.options instanceof Map?Array.from(t.options.values()):t.options;if(n.every(o=>o._def.typeName in Oa&&(!o._def.checks||!o._def.checks.length))){let o=n.reduce((r,i)=>{let a=Oa[i._def.typeName];return a&&!r.includes(a)?[...r,a]:r},[]);return{type:o.length>1?o:o[0]}}else if(n.every(o=>o._def.typeName==="ZodLiteral"&&!o.description)){let o=n.reduce((r,i)=>{let a=typeof i._def.value;switch(a){case"string":case"number":case"boolean":return[...r,a];case"bigint":return[...r,"integer"];case"object":if(i._def.value===null)return[...r,"null"];default:return r}},[]);if(o.length===n.length){let r=o.filter((i,a,c)=>c.indexOf(i)===a);return{type:r.length>1?r:r[0],enum:n.reduce((i,a)=>i.includes(a._def.value)?i:[...i,a._def.value],[])}}}else if(n.every(o=>o._def.typeName==="ZodEnum"))return{type:"string",enum:n.reduce((o,r)=>[...o,...r._def.values.filter(i=>!o.includes(i))],[])};return oS(t,e)}var oS=(t,e)=>{let n=(t.options instanceof Map?Array.from(t.options.values()):t.options).map((o,r)=>q(o._def,{...e,currentPath:[...e.currentPath,"anyOf",`${r}`]})).filter(o=>!!o&&(!e.strictUnions||typeof o=="object"&&Object.keys(o).length>0));return n.length?{anyOf:n}:void 0};function aS(t,e){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(t.innerType._def.typeName)&&(!t.innerType._def.checks||!t.innerType._def.checks.length))return e.target==="openApi3"?{type:Oa[t.innerType._def.typeName],nullable:!0}:{type:[Oa[t.innerType._def.typeName],"null"]};if(e.target==="openApi3"){let o=q(t.innerType._def,{...e,currentPath:[...e.currentPath]});return o&&"$ref"in o?{allOf:[o],nullable:!0}:o&&{...o,nullable:!0}}let n=q(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","0"]});return n&&{anyOf:[n,{type:"null"}]}}function sS(t,e){let n={type:"number"};if(!t.checks)return n;for(let o of t.checks)switch(o.kind){case"int":n.type="integer",eg(n,"type",o.message,e);break;case"min":e.target==="jsonSchema7"?o.inclusive?ne(n,"minimum",o.value,o.message,e):ne(n,"exclusiveMinimum",o.value,o.message,e):(o.inclusive||(n.exclusiveMinimum=!0),ne(n,"minimum",o.value,o.message,e));break;case"max":e.target==="jsonSchema7"?o.inclusive?ne(n,"maximum",o.value,o.message,e):ne(n,"exclusiveMaximum",o.value,o.message,e):(o.inclusive||(n.exclusiveMaximum=!0),ne(n,"maximum",o.value,o.message,e));break;case"multipleOf":ne(n,"multipleOf",o.value,o.message,e);break}return n}function cS(t,e){let n=e.target==="openAi",o={type:"object",properties:{}},r=[],i=t.shape();for(let c in i){let u=i[c];if(u===void 0||u._def===void 0)continue;let d=$C(u);d&&n&&(u._def.typeName==="ZodOptional"&&(u=u._def.innerType),u.isNullable()||(u=u.nullable()),d=!1);let l=q(u._def,{...e,currentPath:[...e.currentPath,"properties",c],propertyPath:[...e.currentPath,"properties",c]});l!==void 0&&(o.properties[c]=l,d||r.push(c))}r.length&&(o.required=r);let a=SC(t,e);return a!==void 0&&(o.additionalProperties=a),o}function SC(t,e){if(t.catchall._def.typeName!=="ZodNever")return q(t.catchall._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]});switch(t.unknownKeys){case"passthrough":return e.allowedAdditionalProperties;case"strict":return e.rejectedAdditionalProperties;case"strip":return e.removeAdditionalStrategy==="strict"?e.allowedAdditionalProperties:e.rejectedAdditionalProperties}}function $C(t){try{return t.isOptional()}catch{return!0}}var uS=(t,e)=>{if(e.currentPath.toString()===e.propertyPath?.toString())return q(t.innerType._def,e);let n=q(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","1"]});return n?{anyOf:[{not:Ie(e)},n]}:Ie(e)};var lS=(t,e)=>{if(e.pipeStrategy==="input")return q(t.in._def,e);if(e.pipeStrategy==="output")return q(t.out._def,e);let n=q(t.in._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),o=q(t.out._def,{...e,currentPath:[...e.currentPath,"allOf",n?"1":"0"]});return{allOf:[n,o].filter(r=>r!==void 0)}};function dS(t,e){return q(t.type._def,e)}function pS(t,e){let o={type:"array",uniqueItems:!0,items:q(t.valueType._def,{...e,currentPath:[...e.currentPath,"items"]})};return t.minSize&&ne(o,"minItems",t.minSize.value,t.minSize.message,e),t.maxSize&&ne(o,"maxItems",t.maxSize.value,t.maxSize.message,e),o}function mS(t,e){return t.rest?{type:"array",minItems:t.items.length,items:t.items.map((n,o)=>q(n._def,{...e,currentPath:[...e.currentPath,"items",`${o}`]})).reduce((n,o)=>o===void 0?n:[...n,o],[]),additionalItems:q(t.rest._def,{...e,currentPath:[...e.currentPath,"additionalItems"]})}:{type:"array",minItems:t.items.length,maxItems:t.items.length,items:t.items.map((n,o)=>q(n._def,{...e,currentPath:[...e.currentPath,"items",`${o}`]})).reduce((n,o)=>o===void 0?n:[...n,o],[])}}function fS(t){return{not:Ie(t)}}function hS(t){return Ie(t)}var gS=(t,e)=>q(t.innerType._def,e);var _S=(t,e,n)=>{switch(e){case w.ZodString:return ql(t,n);case w.ZodNumber:return sS(t,n);case w.ZodObject:return cS(t,n);case w.ZodBigInt:return Bx(t,n);case w.ZodBoolean:return Hx();case w.ZodDate:return tg(t,n);case w.ZodUndefined:return fS(n);case w.ZodNull:return nS(n);case w.ZodArray:return qx(t,n);case w.ZodUnion:case w.ZodDiscriminatedUnion:return iS(t,n);case w.ZodIntersection:return Yx(t,n);case w.ZodTuple:return mS(t,n);case w.ZodRecord:return Bl(t,n);case w.ZodLiteral:return Xx(t,n);case w.ZodEnum:return Jx(t);case w.ZodNativeEnum:return tS(t);case w.ZodNullable:return aS(t,n);case w.ZodOptional:return uS(t,n);case w.ZodMap:return eS(t,n);case w.ZodSet:return pS(t,n);case w.ZodLazy:return()=>t.getter()._def;case w.ZodPromise:return dS(t,n);case w.ZodNaN:case w.ZodNever:return rS(n);case w.ZodEffects:return Wx(t,n);case w.ZodAny:return Ie(n);case w.ZodUnknown:return hS(n);case w.ZodDefault:return Gx(t,n);case w.ZodBranded:return Vl(t,n);case w.ZodReadonly:return gS(t,n);case w.ZodCatch:return Kx(t,n);case w.ZodPipeline:return lS(t,n);case w.ZodFunction:case w.ZodVoid:case w.ZodSymbol:return;default:return(o=>{})(e)}};function q(t,e,n=!1){let o=e.seen.get(t);if(e.override){let c=e.override?.(t,e,o,n);if(c!==Zx)return c}if(o&&!n){let c=IC(o,e);if(c!==void 0)return c}let r={def:t,path:e.currentPath,jsonSchema:void 0};e.seen.set(t,r);let i=_S(t,t.typeName,e),a=typeof i=="function"?q(i(),e):i;if(a&&wC(t,e,a),e.postProcess){let c=e.postProcess(a,t,e);return r.jsonSchema=a,c}return r.jsonSchema=a,a}var IC=(t,e)=>{switch(e.$refStrategy){case"root":return{$ref:t.path.join("/")};case"relative":return{$ref:Fl(e.currentPath,t.path)};case"none":case"seen":return t.path.length<e.currentPath.length&&t.path.every((n,o)=>e.currentPath[o]===n)?(console.warn(`Recursive reference detected at ${e.currentPath.join("/")}! Defaulting to any`),Ie(e)):e.$refStrategy==="seen"?Ie(e):void 0}},wC=(t,e,n)=>(t.description&&(n.description=t.description,e.markdownDescription&&(n.markdownDescription=t.description)),n);var og=(t,e)=>{let n=Vx(e),o=typeof e=="object"&&e.definitions?Object.entries(e.definitions).reduce((u,[d,l])=>({...u,[d]:q(l._def,{...n,currentPath:[...n.basePath,n.definitionPath,d]},!0)??Ie(n)}),{}):void 0,r=typeof e=="string"?e:e?.nameStrategy==="title"?void 0:e?.name,i=q(t._def,r===void 0?n:{...n,currentPath:[...n.basePath,n.definitionPath,r]},!1)??Ie(n),a=typeof e=="object"&&e.name!==void 0&&e.nameStrategy==="title"?e.name:void 0;a!==void 0&&(i.title=a),n.flags.hasReferencedOpenAiAnyType&&(o||(o={}),o[n.openAiAnyTypeName]||(o[n.openAiAnyTypeName]={type:["string","number","integer","boolean","array","null"],items:{$ref:n.$refStrategy==="relative"?"1":[...n.basePath,n.definitionPath,n.openAiAnyTypeName].join("/")}}));let c=r===void 0?o?{...i,[n.definitionPath]:o}:i:{$ref:[...n.$refStrategy==="relative"?[]:n.basePath,n.definitionPath,r].join("/"),[n.definitionPath]:{...o,[r]:i}};return n.target==="jsonSchema7"?c.$schema="http://json-schema.org/draft-07/schema#":(n.target==="jsonSchema2019-09"||n.target==="openAi")&&(c.$schema="https://json-schema.org/draft/2019-09/schema#"),n.target==="openAi"&&("anyOf"in c||"oneOf"in c||"allOf"in c||"type"in c&&Array.isArray(c.type))&&console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property."),c};function EC(t){return!t||t==="jsonSchema7"||t==="draft-7"?"draft-7":t==="jsonSchema2019-09"||t==="draft-2020-12"?"draft-2020-12":"draft-7"}function ig(t,e){return bt(t)?Xr(t,{target:EC(e?.target),io:e?.pipeStrategy??"input"}):og(t,{strictUnions:e?.strictUnions??!0,pipeStrategy:e?.pipeStrategy??"input"})}function ag(t){let n=Or(t)?.method;if(!n)throw new Error("Schema is missing a method literal");let o=Zl(n);if(typeof o!="string")throw new Error("Schema method literal must be a string");return o}function sg(t,e){let n=Pr(t,e);if(!n.success)throw n.error;return n.data}var TC=6e4,Hl=class{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(_l,n=>{this._oncancel(n)}),this.setNotificationHandler(vl,n=>{this._onprogress(n)}),this.setRequestHandler(yl,n=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(bl,async(n,o)=>{let r=await this._taskStore.getTask(n.params.taskId,o.sessionId);if(!r)throw new M(F.InvalidParams,"Failed to retrieve task: Task not found");return{...r}}),this.setRequestHandler(xl,async(n,o)=>{let r=async()=>{let i=n.params.taskId;if(this._taskMessageQueue){let c;for(;c=await this._taskMessageQueue.dequeue(i,o.sessionId);){if(c.type==="response"||c.type==="error"){let u=c.message,d=u.id,l=this._requestResolvers.get(d);if(l)if(this._requestResolvers.delete(d),c.type==="response")l(u);else{let p=u,m=new M(p.error.code,p.error.message,p.error.data);l(m)}else{let p=c.type==="response"?"Response":"Error";this._onerror(new Error(`${p} handler missing for request ${d}`))}continue}await this._transport?.send(c.message,{relatedRequestId:o.requestId})}}let a=await this._taskStore.getTask(i,o.sessionId);if(!a)throw new M(F.InvalidParams,`Task not found: ${i}`);if(!Rr(a.status))return await this._waitForTaskUpdate(i,o.signal),await r();if(Rr(a.status)){let c=await this._taskStore.getTaskResult(i,o.sessionId);return this._clearTaskQueue(i),{...c,_meta:{...c._meta,[Ir]:{taskId:i}}}}return await r()};return await r()}),this.setRequestHandler(Sl,async(n,o)=>{try{let{tasks:r,nextCursor:i}=await this._taskStore.listTasks(n.params?.cursor,o.sessionId);return{tasks:r,nextCursor:i,_meta:{}}}catch(r){throw new M(F.InvalidParams,`Failed to list tasks: ${r instanceof Error?r.message:String(r)}`)}}),this.setRequestHandler(Il,async(n,o)=>{try{let r=await this._taskStore.getTask(n.params.taskId,o.sessionId);if(!r)throw new M(F.InvalidParams,`Task not found: ${n.params.taskId}`);if(Rr(r.status))throw new M(F.InvalidParams,`Cannot cancel task in terminal status: ${r.status}`);await this._taskStore.updateTaskStatus(n.params.taskId,"cancelled","Client cancelled task execution.",o.sessionId),this._clearTaskQueue(n.params.taskId);let i=await this._taskStore.getTask(n.params.taskId,o.sessionId);if(!i)throw new M(F.InvalidParams,`Task not found after cancellation: ${n.params.taskId}`);return{_meta:{},...i}}catch(r){throw r instanceof M?r:new M(F.InvalidRequest,`Failed to cancel task: ${r instanceof Error?r.message:String(r)}`)}}))}async _oncancel(e){if(!e.params.requestId)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,n,o,r,i=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(r,n),startTime:Date.now(),timeout:n,maxTotalTimeout:o,resetTimeoutOnProgress:i,onTimeout:r})}_resetTimeout(e){let n=this._timeoutInfo.get(e);if(!n)return!1;let o=Date.now()-n.startTime;if(n.maxTotalTimeout&&o>=n.maxTotalTimeout)throw this._timeoutInfo.delete(e),M.fromError(F.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:n.maxTotalTimeout,totalElapsed:o});return clearTimeout(n.timeoutId),n.timeoutId=setTimeout(n.onTimeout,n.timeout),!0}_cleanupTimeout(e){let n=this._timeoutInfo.get(e);n&&(clearTimeout(n.timeoutId),this._timeoutInfo.delete(e))}async connect(e){if(this._transport)throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=e;let n=this.transport?.onclose;this._transport.onclose=()=>{n?.(),this._onclose()};let o=this.transport?.onerror;this._transport.onerror=i=>{o?.(i),this._onerror(i)};let r=this._transport?.onmessage;this._transport.onmessage=(i,a)=>{r?.(i,a),ua(i)||vx(i)?this._onresponse(i):Ah(i)?this._onrequest(i,a):yx(i)?this._onnotification(i):this._onerror(new Error(`Unknown message type: ${JSON.stringify(i)}`))},await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(let o of this._timeoutInfo.values())clearTimeout(o.timeoutId);this._timeoutInfo.clear();for(let o of this._requestHandlerAbortControllers.values())o.abort();this._requestHandlerAbortControllers.clear();let n=M.fromError(F.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(let o of e.values())o(n)}_onerror(e){this.onerror?.(e)}_onnotification(e){let n=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;n!==void 0&&Promise.resolve().then(()=>n(e)).catch(o=>this._onerror(new Error(`Uncaught error in notification handler: ${o}`)))}_onrequest(e,n){let o=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,r=this._transport,i=e.params?._meta?.[Ir]?.taskId;if(o===void 0){let l={jsonrpc:"2.0",id:e.id,error:{code:F.MethodNotFound,message:"Method not found"}};i&&this._taskMessageQueue?this._enqueueTaskMessage(i,{type:"error",message:l,timestamp:Date.now()},r?.sessionId).catch(p=>this._onerror(new Error(`Failed to enqueue error response: ${p}`))):r?.send(l).catch(p=>this._onerror(new Error(`Failed to send an error response: ${p}`)));return}let a=new AbortController;this._requestHandlerAbortControllers.set(e.id,a);let c=hx(e.params)?e.params.task:void 0,u=this._taskStore?this.requestTaskStore(e,r?.sessionId):void 0,d={signal:a.signal,sessionId:r?.sessionId,_meta:e.params?._meta,sendNotification:async l=>{if(a.signal.aborted)return;let p={relatedRequestId:e.id};i&&(p.relatedTask={taskId:i}),await this.notification(l,p)},sendRequest:async(l,p,m)=>{if(a.signal.aborted)throw new M(F.ConnectionClosed,"Request was cancelled");let f={...m,relatedRequestId:e.id};i&&!f.relatedTask&&(f.relatedTask={taskId:i});let g=f.relatedTask?.taskId??i;return g&&u&&await u.updateTaskStatus(g,"input_required"),await this.request(l,p,f)},authInfo:n?.authInfo,requestId:e.id,requestInfo:n?.requestInfo,taskId:i,taskStore:u,taskRequestedTtl:c?.ttl,closeSSEStream:n?.closeSSEStream,closeStandaloneSSEStream:n?.closeStandaloneSSEStream};Promise.resolve().then(()=>{c&&this.assertTaskHandlerCapability(e.method)}).then(()=>o(e,d)).then(async l=>{if(a.signal.aborted)return;let p={result:l,jsonrpc:"2.0",id:e.id};i&&this._taskMessageQueue?await this._enqueueTaskMessage(i,{type:"response",message:p,timestamp:Date.now()},r?.sessionId):await r?.send(p)},async l=>{if(a.signal.aborted)return;let p={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(l.code)?l.code:F.InternalError,message:l.message??"Internal error",...l.data!==void 0&&{data:l.data}}};i&&this._taskMessageQueue?await this._enqueueTaskMessage(i,{type:"error",message:p,timestamp:Date.now()},r?.sessionId):await r?.send(p)}).catch(l=>this._onerror(new Error(`Failed to send response: ${l}`))).finally(()=>{this._requestHandlerAbortControllers.get(e.id)===a&&this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){let{progressToken:n,...o}=e.params,r=Number(n),i=this._progressHandlers.get(r);if(!i){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let a=this._responseHandlers.get(r),c=this._timeoutInfo.get(r);if(c&&a&&c.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(u){this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),a(u);return}i(o)}_onresponse(e){let n=Number(e.id),o=this._requestResolvers.get(n);if(o){if(this._requestResolvers.delete(n),ua(e))o(e);else{let a=new M(e.error.code,e.error.message,e.error.data);o(a)}return}let r=this._responseHandlers.get(n);if(r===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(n),this._cleanupTimeout(n);let i=!1;if(ua(e)&&e.result&&typeof e.result=="object"){let a=e.result;if(a.task&&typeof a.task=="object"){let c=a.task;typeof c.taskId=="string"&&(i=!0,this._taskProgressTokens.set(c.taskId,n))}}if(i||this._progressHandlers.delete(n),ua(e))r(e);else{let a=M.fromError(e.error.code,e.error.message,e.error.data);r(a)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,n,o){let{task:r}=o??{};if(!r){try{yield{type:"result",result:await this.request(e,n,o)}}catch(a){yield{type:"error",error:a instanceof M?a:new M(F.InternalError,String(a))}}return}let i;try{let a=await this.request(e,io,o);if(a.task)i=a.task.taskId,yield{type:"taskCreated",task:a.task};else throw new M(F.InternalError,"Task creation did not return a task");for(;;){let c=await this.getTask({taskId:i},o);if(yield{type:"taskStatus",task:c},Rr(c.status)){c.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:i},n,o)}:c.status==="failed"?yield{type:"error",error:new M(F.InternalError,`Task ${i} failed`)}:c.status==="cancelled"&&(yield{type:"error",error:new M(F.InternalError,`Task ${i} was cancelled`)});return}if(c.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:i},n,o)};return}let u=c.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(d=>setTimeout(d,u)),o?.signal?.throwIfAborted()}}catch(a){yield{type:"error",error:a instanceof M?a:new M(F.InternalError,String(a))}}}request(e,n,o){let{relatedRequestId:r,resumptionToken:i,onresumptiontoken:a,task:c,relatedTask:u}=o??{};return new Promise((d,l)=>{let p=N=>{l(N)};if(!this._transport){p(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),c&&this.assertTaskCapability(e.method)}catch(N){p(N);return}o?.signal?.throwIfAborted();let m=this._requestMessageId++,f={...e,jsonrpc:"2.0",id:m};o?.onprogress&&(this._progressHandlers.set(m,o.onprogress),f.params={...e.params,_meta:{...e.params?._meta||{},progressToken:m}}),c&&(f.params={...f.params,task:c}),u&&(f.params={...f.params,_meta:{...f.params?._meta||{},[Ir]:u}});let g=N=>{this._responseHandlers.delete(m),this._progressHandlers.delete(m),this._cleanupTimeout(m),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:m,reason:String(N)}},{relatedRequestId:r,resumptionToken:i,onresumptiontoken:a}).catch(j=>this._onerror(new Error(`Failed to send cancellation: ${j}`)));let z=N instanceof M?N:new M(F.RequestTimeout,String(N));l(z)};this._responseHandlers.set(m,N=>{if(!o?.signal?.aborted){if(N instanceof Error)return l(N);try{let z=Pr(n,N.result);z.success?d(z.data):l(z.error)}catch(z){l(z)}}}),o?.signal?.addEventListener("abort",()=>{g(o?.signal?.reason)});let v=o?.timeout??TC,b=()=>g(M.fromError(F.RequestTimeout,"Request timed out",{timeout:v}));this._setupTimeout(m,v,o?.maxTotalTimeout,b,o?.resetTimeoutOnProgress??!1);let E=u?.taskId;if(E){let N=z=>{let j=this._responseHandlers.get(m);j?j(z):this._onerror(new Error(`Response handler missing for side-channeled request ${m}`))};this._requestResolvers.set(m,N),this._enqueueTaskMessage(E,{type:"request",message:f,timestamp:Date.now()}).catch(z=>{this._cleanupTimeout(m),l(z)})}else this._transport.send(f,{relatedRequestId:r,resumptionToken:i,onresumptiontoken:a}).catch(N=>{this._cleanupTimeout(m),l(N)})})}async getTask(e,n){return this.request({method:"tasks/get",params:e},kl,n)}async getTaskResult(e,n,o){return this.request({method:"tasks/result",params:e},n,o)}async listTasks(e,n){return this.request({method:"tasks/list",params:e},$l,n)}async cancelTask(e,n){return this.request({method:"tasks/cancel",params:e},xx,n)}async notification(e,n){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(e.method);let o=n?.relatedTask?.taskId;if(o){let c={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[Ir]:n.relatedTask}}};await this._enqueueTaskMessage(o,{type:"notification",message:c,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!n?.relatedRequestId&&!n?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let c={...e,jsonrpc:"2.0"};n?.relatedTask&&(c={...c,params:{...c.params,_meta:{...c.params?._meta||{},[Ir]:n.relatedTask}}}),this._transport?.send(c,n).catch(u=>this._onerror(u))});return}let a={...e,jsonrpc:"2.0"};n?.relatedTask&&(a={...a,params:{...a.params,_meta:{...a.params?._meta||{},[Ir]:n.relatedTask}}}),await this._transport.send(a,n)}setRequestHandler(e,n){let o=ag(e);this.assertRequestHandlerCapability(o),this._requestHandlers.set(o,(r,i)=>{let a=sg(e,r);return Promise.resolve(n(a,i))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,n){let o=ag(e);this._notificationHandlers.set(o,r=>{let i=sg(e,r);return Promise.resolve(n(i))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){let n=this._taskProgressTokens.get(e);n!==void 0&&(this._progressHandlers.delete(n),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,n,o){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");let r=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,n,o,r)}async _clearTaskQueue(e,n){if(this._taskMessageQueue){let o=await this._taskMessageQueue.dequeueAll(e,n);for(let r of o)if(r.type==="request"&&Ah(r.message)){let i=r.message.id,a=this._requestResolvers.get(i);a?(a(new M(F.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(i)):this._onerror(new Error(`Resolver missing for request ${i} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,n){let o=this._options?.defaultTaskPollInterval??1e3;try{let r=await this._taskStore?.getTask(e);r?.pollInterval&&(o=r.pollInterval)}catch{}return new Promise((r,i)=>{if(n.aborted){i(new M(F.InvalidRequest,"Request cancelled"));return}let a=setTimeout(r,o);n.addEventListener("abort",()=>{clearTimeout(a),i(new M(F.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,n){let o=this._taskStore;if(!o)throw new Error("No task store configured");return{createTask:async r=>{if(!e)throw new Error("No request provided");return await o.createTask(r,e.id,{method:e.method,params:e.params},n)},getTask:async r=>{let i=await o.getTask(r,n);if(!i)throw new M(F.InvalidParams,"Failed to retrieve task: Task not found");return i},storeTaskResult:async(r,i,a)=>{await o.storeTaskResult(r,i,a,n);let c=await o.getTask(r,n);if(c){let u=fa.parse({method:"notifications/tasks/status",params:c});await this.notification(u),Rr(c.status)&&this._cleanupTaskProgressHandler(r)}},getTaskResult:r=>o.getTaskResult(r,n),updateTaskStatus:async(r,i,a)=>{let c=await o.getTask(r,n);if(!c)throw new M(F.InvalidParams,`Task "${r}" not found - it may have been cleaned up`);if(Rr(c.status))throw new M(F.InvalidParams,`Cannot update task "${r}" from terminal status "${c.status}" to "${i}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await o.updateTaskStatus(r,i,a,n);let u=await o.getTask(r,n);if(u){let d=fa.parse({method:"notifications/tasks/status",params:u});await this.notification(d),Rr(u.status)&&this._cleanupTaskProgressHandler(r)}},listTasks:r=>o.listTasks(r,n)}}};function yS(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function vS(t,e){let n={...t};for(let o in e){let r=o,i=e[r];if(i===void 0)continue;let a=n[r];yS(a)&&yS(i)?n[r]={...a,...i}:n[r]=i}return n}var lw=av(K_(),1),dw=av(uw(),1);function RU(){let t=new lw.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return(0,dw.default)(t),t}var Ed=class{constructor(e){this._ajv=e??RU()}getValidator(e){let n="$id"in e&&typeof e.$id=="string"?this._ajv.getSchema(e.$id)??this._ajv.compile(e):this._ajv.compile(e);return o=>n(o)?{valid:!0,data:o,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(n.errors)}}};var Td=class{constructor(e){this._server=e}requestStream(e,n,o){return this._server.requestStream(e,n,o)}createMessageStream(e,n){let o=this._server.getClientCapabilities();if((e.tools||e.toolChoice)&&!o?.sampling?.tools)throw new Error("Client does not support sampling tools capability.");if(e.messages.length>0){let r=e.messages[e.messages.length-1],i=Array.isArray(r.content)?r.content:[r.content],a=i.some(l=>l.type==="tool_result"),c=e.messages.length>1?e.messages[e.messages.length-2]:void 0,u=c?Array.isArray(c.content)?c.content:[c.content]:[],d=u.some(l=>l.type==="tool_use");if(a){if(i.some(l=>l.type!=="tool_result"))throw new Error("The last message must contain only tool_result content if any is present");if(!d)throw new Error("tool_result blocks are not matching any tool_use from the previous message")}if(d){let l=new Set(u.filter(m=>m.type==="tool_use").map(m=>m.id)),p=new Set(i.filter(m=>m.type==="tool_result").map(m=>m.toolUseId));if(l.size!==p.size||![...l].every(m=>p.has(m)))throw new Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return this.requestStream({method:"sampling/createMessage",params:e},_a,n)}elicitInputStream(e,n){let o=this._server.getClientCapabilities(),r=e.mode??"form";switch(r){case"url":{if(!o?.elicitation?.url)throw new Error("Client does not support url elicitation.");break}case"form":{if(!o?.elicitation?.form)throw new Error("Client does not support form elicitation.");break}}let i=r==="form"&&e.mode===void 0?{...e,mode:"form"}:e;return this.requestStream({method:"elicitation/create",params:i},co,n)}async getTask(e,n){return this._server.getTask({taskId:e},n)}async getTaskResult(e,n,o){return this._server.getTaskResult({taskId:e},n,o)}async listTasks(e,n){return this._server.listTasks(e?{cursor:e}:void 0,n)}async cancelTask(e,n){return this._server.cancelTask({taskId:e},n)}};function pw(t,e,n){if(!t)throw new Error(`${n} does not support task creation (required for ${e})`);switch(e){case"tools/call":if(!t.tools?.call)throw new Error(`${n} does not support task creation for tools/call (required for ${e})`);break;default:break}}function mw(t,e,n){if(!t)throw new Error(`${n} does not support task creation (required for ${e})`);switch(e){case"sampling/createMessage":if(!t.sampling?.createMessage)throw new Error(`${n} does not support task creation for sampling/createMessage (required for ${e})`);break;case"elicitation/create":if(!t.elicitation?.create)throw new Error(`${n} does not support task creation for elicitation/create (required for ${e})`);break;default:break}}var Pd=class extends Hl{constructor(e,n){super(n),this._serverInfo=e,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(ga.options.map((o,r)=>[o,r])),this.isMessageIgnored=(o,r)=>{let i=this._loggingLevels.get(r);return i?this.LOG_LEVEL_SEVERITY.get(o)<this.LOG_LEVEL_SEVERITY.get(i):!1},this._capabilities=n?.capabilities??{},this._instructions=n?.instructions,this._jsonSchemaValidator=n?.jsonSchemaValidator??new Ed,this.setRequestHandler(zh,o=>this._oninitialize(o)),this.setNotificationHandler(Dh,()=>this.oninitialized?.()),this._capabilities.logging&&this.setRequestHandler(Vh,async(o,r)=>{let i=r.sessionId||r.requestInfo?.headers["mcp-session-id"]||void 0,{level:a}=o.params,c=ga.safeParse(a);return c.success&&this._loggingLevels.set(i,c.data),{}})}get experimental(){return this._experimental||(this._experimental={tasks:new Td(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=vS(this._capabilities,e)}setRequestHandler(e,n){let r=Or(e)?.method;if(!r)throw new Error("Schema is missing a method literal");let i;if(bt(r)){let c=r;i=c._zod?.def?.value??c.value}else{let c=r;i=c._def?.value??c.value}if(typeof i!="string")throw new Error("Schema method literal must be a string");if(i==="tools/call"){let c=async(u,d)=>{let l=Pr(so,u);if(!l.success){let g=l.error instanceof Error?l.error.message:String(l.error);throw new M(F.InvalidParams,`Invalid tools/call request: ${g}`)}let{params:p}=l.data,m=await Promise.resolve(n(u,d));if(p.task){let g=Pr(io,m);if(!g.success){let v=g.error instanceof Error?g.error.message:String(g.error);throw new M(F.InvalidParams,`Invalid task creation result: ${v}`)}return g.data}let f=Pr(Al,m);if(!f.success){let g=f.error instanceof Error?f.error.message:String(f.error);throw new M(F.InvalidParams,`Invalid tools/call result: ${g}`)}return f.data};return super.setRequestHandler(e,c)}return super.setRequestHandler(e,n)}assertCapabilityForMethod(e){switch(e){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw new Error(`Client does not support sampling (required for ${e})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw new Error(`Client does not support elicitation (required for ${e})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw new Error(`Client does not support listing roots (required for ${e})`);break;case"ping":break}}assertNotificationCapability(e){switch(e){case"notifications/message":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw new Error(`Server does not support notifying about resources (required for ${e})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new Error(`Server does not support notifying of tool list changes (required for ${e})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new Error(`Server does not support notifying of prompt list changes (required for ${e})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw new Error(`Client does not support URL elicitation (required for ${e})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case"completion/complete":if(!this._capabilities.completions)throw new Error(`Server does not support completions (required for ${e})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw new Error(`Server does not support resources (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new Error(`Server does not support tools (required for ${e})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Server does not support tasks capability (required for ${e})`);break;case"ping":case"initialize":break}}assertTaskCapability(e){mw(this._clientCapabilities?.tasks?.requests,e,"Client")}assertTaskHandlerCapability(e){this._capabilities&&pw(this._capabilities.tasks?.requests,e,"Server")}async _oninitialize(e){let n=e.params.protocolVersion;return this._clientCapabilities=e.params.capabilities,this._clientVersion=e.params.clientInfo,{protocolVersion:px.includes(n)?n:Oh,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"},gl)}async createMessage(e,n){if((e.tools||e.toolChoice)&&!this._clientCapabilities?.sampling?.tools)throw new Error("Client does not support sampling tools capability.");if(e.messages.length>0){let o=e.messages[e.messages.length-1],r=Array.isArray(o.content)?o.content:[o.content],i=r.some(d=>d.type==="tool_result"),a=e.messages.length>1?e.messages[e.messages.length-2]:void 0,c=a?Array.isArray(a.content)?a.content:[a.content]:[],u=c.some(d=>d.type==="tool_use");if(i){if(r.some(d=>d.type!=="tool_result"))throw new Error("The last message must contain only tool_result content if any is present");if(!u)throw new Error("tool_result blocks are not matching any tool_use from the previous message")}if(u){let d=new Set(c.filter(p=>p.type==="tool_use").map(p=>p.id)),l=new Set(r.filter(p=>p.type==="tool_result").map(p=>p.toolUseId));if(d.size!==l.size||![...d].every(p=>l.has(p)))throw new Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return e.tools?this.request({method:"sampling/createMessage",params:e},qh,n):this.request({method:"sampling/createMessage",params:e},_a,n)}async elicitInput(e,n){switch(e.mode??"form"){case"url":{if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support url elicitation.");let r=e;return this.request({method:"elicitation/create",params:r},co,n)}case"form":{if(!this._clientCapabilities?.elicitation?.form)throw new Error("Client does not support form elicitation.");let r=e.mode==="form"?e:{...e,mode:"form"},i=await this.request({method:"elicitation/create",params:r},co,n);if(i.action==="accept"&&i.content&&r.requestedSchema)try{let c=this._jsonSchemaValidator.getValidator(r.requestedSchema)(i.content);if(!c.valid)throw new M(F.InvalidParams,`Elicitation response content does not match requested schema: ${c.errorMessage}`)}catch(a){throw a instanceof M?a:new M(F.InternalError,`Error validating elicitation response: ${a instanceof Error?a.message:String(a)}`)}return i}}}createElicitationCompletionNotifier(e,n){if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support URL elicitation (required for notifications/elicitation/complete)");return()=>this.notification({method:"notifications/elicitation/complete",params:{elicitationId:e}},n)}async listRoots(e,n){return this.request({method:"roots/list",params:e},Bh,n)}async sendLoggingMessage(e,n){if(this._capabilities.logging&&!this.isMessageIgnored(e.level,n))return this.notification({method:"notifications/message",params:e})}async sendResourceUpdated(e){return this.notification({method:"notifications/resources/updated",params:e})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}};var hw=Symbol.for("mcp.completable");function ty(t){return!!t&&typeof t=="object"&&hw in t}function gw(t){return t[hw]?.complete}var fw;(function(t){t.Completable="McpCompletable"})(fw||(fw={}));var AU=/^[A-Za-z0-9._-]{1,128}$/;function CU(t){let e=[];if(t.length===0)return{isValid:!1,warnings:["Tool name cannot be empty"]};if(t.length>128)return{isValid:!1,warnings:[`Tool name exceeds maximum length of 128 characters (current: ${t.length})`]};if(t.includes(" ")&&e.push("Tool name contains spaces, which may cause parsing issues"),t.includes(",")&&e.push("Tool name contains commas, which may cause parsing issues"),(t.startsWith("-")||t.endsWith("-"))&&e.push("Tool name starts or ends with a dash, which may cause parsing issues in some contexts"),(t.startsWith(".")||t.endsWith("."))&&e.push("Tool name starts or ends with a dot, which may cause parsing issues in some contexts"),!AU.test(t)){let n=t.split("").filter(o=>!/[A-Za-z0-9._-]/.test(o)).filter((o,r,i)=>i.indexOf(o)===r);return e.push(`Tool name contains invalid characters: ${n.map(o=>`"${o}"`).join(", ")}`,"Allowed characters are: A-Z, a-z, 0-9, underscore (_), dash (-), and dot (.)"),{isValid:!1,warnings:e}}return{isValid:!0,warnings:e}}function NU(t,e){if(e.length>0){console.warn(`Tool name validation warning for "${t}":`);for(let n of e)console.warn(` - ${n}`);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 ry(t){let e=CU(t);return NU(t,e.warnings),e.isValid}var Od=class{constructor(e){this._mcpServer=e}registerToolTask(e,n,o){let r={taskSupport:"required",...n.execution};if(r.taskSupport==="forbidden")throw new Error(`Cannot register task-based tool '${e}' with taskSupport 'forbidden'. Use registerTool() instead.`);return this._mcpServer._createRegisteredTool(e,n.title,n.description,n.inputSchema,n.outputSchema,n.annotations,r,n._meta,o)}};var Rd=class{constructor(e,n){this._registeredResources={},this._registeredResourceTemplates={},this._registeredTools={},this._registeredPrompts={},this._toolHandlersInitialized=!1,this._completionHandlerInitialized=!1,this._resourceHandlersInitialized=!1,this._promptHandlersInitialized=!1,this.server=new Pd(e,n)}get experimental(){return this._experimental||(this._experimental={tasks:new Od(this)}),this._experimental}async connect(e){return await this.server.connect(e)}async close(){await this.server.close()}setToolRequestHandlers(){this._toolHandlersInitialized||(this.server.assertCanSetRequestHandler(Mr(Rl)),this.server.assertCanSetRequestHandler(Mr(so)),this.server.registerCapabilities({tools:{listChanged:!0}}),this.server.setRequestHandler(Rl,()=>({tools:Object.entries(this._registeredTools).filter(([,e])=>e.enabled).map(([e,n])=>{let o={name:e,title:n.title,description:n.description,inputSchema:(()=>{let r=$o(n.inputSchema);return r?ig(r,{strictUnions:!0,pipeStrategy:"input"}):zU})(),annotations:n.annotations,execution:n.execution,_meta:n._meta};if(n.outputSchema){let r=$o(n.outputSchema);r&&(o.outputSchema=ig(r,{strictUnions:!0,pipeStrategy:"output"}))}return o})})),this.server.setRequestHandler(so,async(e,n)=>{try{let o=this._registeredTools[e.params.name];if(!o)throw new M(F.InvalidParams,`Tool ${e.params.name} not found`);if(!o.enabled)throw new M(F.InvalidParams,`Tool ${e.params.name} disabled`);let r=!!e.params.task,i=o.execution?.taskSupport,a="createTask"in o.handler;if((i==="required"||i==="optional")&&!a)throw new M(F.InternalError,`Tool ${e.params.name} has taskSupport '${i}' but was not registered with registerToolTask`);if(i==="required"&&!r)throw new M(F.MethodNotFound,`Tool ${e.params.name} requires task augmentation (taskSupport: 'required')`);if(i==="optional"&&!r&&a)return await this.handleAutomaticTaskPolling(o,e,n);let c=await this.validateToolInput(o,e.params.arguments,e.params.name),u=await this.executeToolHandler(o,c,n);return r||await this.validateToolOutput(o,u,e.params.name),u}catch(o){if(o instanceof M&&o.code===F.UrlElicitationRequired)throw o;return this.createToolError(o instanceof Error?o.message:String(o))}}),this._toolHandlersInitialized=!0)}createToolError(e){return{content:[{type:"text",text:e}],isError:!0}}async validateToolInput(e,n,o){if(!e.inputSchema)return;let i=$o(e.inputSchema)??e.inputSchema,a=await Ll(i,n);if(!a.success){let c="error"in a?a.error:"Unknown error",u=Ml(c);throw new M(F.InvalidParams,`Input validation error: Invalid arguments for tool ${o}: ${u}`)}return a.data}async validateToolOutput(e,n,o){if(!e.outputSchema||!("content"in n)||n.isError)return;if(!n.structuredContent)throw new M(F.InvalidParams,`Output validation error: Tool ${o} has an output schema but no structured content was provided`);let r=$o(e.outputSchema),i=await Ll(r,n.structuredContent);if(!i.success){let a="error"in i?i.error:"Unknown error",c=Ml(a);throw new M(F.InvalidParams,`Output validation error: Invalid structured content for tool ${o}: ${c}`)}}async executeToolHandler(e,n,o){let r=e.handler;if("createTask"in r){if(!o.taskStore)throw new Error("No task store provided.");let a={...o,taskStore:o.taskStore};if(e.inputSchema){let c=r;return await Promise.resolve(c.createTask(n,a))}else{let c=r;return await Promise.resolve(c.createTask(a))}}if(e.inputSchema){let a=r;return await Promise.resolve(a(n,o))}else{let a=r;return await Promise.resolve(a(o))}}async handleAutomaticTaskPolling(e,n,o){if(!o.taskStore)throw new Error("No task store provided for task-capable tool.");let r=await this.validateToolInput(e,n.params.arguments,n.params.name),i=e.handler,a={...o,taskStore:o.taskStore},c=r?await Promise.resolve(i.createTask(r,a)):await Promise.resolve(i.createTask(a)),u=c.task.taskId,d=c.task,l=d.pollInterval??5e3;for(;d.status!=="completed"&&d.status!=="failed"&&d.status!=="cancelled";){await new Promise(m=>setTimeout(m,l));let p=await o.taskStore.getTask(u);if(!p)throw new M(F.InternalError,`Task ${u} not found during polling`);d=p}return await o.taskStore.getTaskResult(u)}setCompletionRequestHandler(){this._completionHandlerInitialized||(this.server.assertCanSetRequestHandler(Mr(Cl)),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler(Cl,async e=>{switch(e.params.ref.type){case"ref/prompt":return Tx(e),this.handlePromptCompletion(e,e.params.ref);case"ref/resource":return Px(e),this.handleResourceCompletion(e,e.params.ref);default:throw new M(F.InvalidParams,`Invalid completion reference: ${e.params.ref}`)}}),this._completionHandlerInitialized=!0)}async handlePromptCompletion(e,n){let o=this._registeredPrompts[n.name];if(!o)throw new M(F.InvalidParams,`Prompt ${n.name} not found`);if(!o.enabled)throw new M(F.InvalidParams,`Prompt ${n.name} disabled`);if(!o.argsSchema)return as;let i=Or(o.argsSchema)?.[e.params.argument.name];if(!ty(i))return as;let a=gw(i);if(!a)return as;let c=await a(e.params.argument.value,e.params.context);return yw(c)}async handleResourceCompletion(e,n){let o=Object.values(this._registeredResourceTemplates).find(a=>a.resourceTemplate.uriTemplate.toString()===n.uri);if(!o){if(this._registeredResources[n.uri])return as;throw new M(F.InvalidParams,`Resource template ${e.params.ref.uri} not found`)}let r=o.resourceTemplate.completeCallback(e.params.argument.name);if(!r)return as;let i=await r(e.params.argument.value,e.params.context);return yw(i)}setResourceRequestHandlers(){this._resourceHandlersInitialized||(this.server.assertCanSetRequestHandler(Mr(wl)),this.server.assertCanSetRequestHandler(Mr(El)),this.server.assertCanSetRequestHandler(Mr(Tl)),this.server.registerCapabilities({resources:{listChanged:!0}}),this.server.setRequestHandler(wl,async(e,n)=>{let o=Object.entries(this._registeredResources).filter(([i,a])=>a.enabled).map(([i,a])=>({uri:i,name:a.name,...a.metadata})),r=[];for(let i of Object.values(this._registeredResourceTemplates)){if(!i.resourceTemplate.listCallback)continue;let a=await i.resourceTemplate.listCallback(n);for(let c of a.resources)r.push({...i.metadata,...c})}return{resources:[...o,...r]}}),this.server.setRequestHandler(El,async()=>({resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([n,o])=>({name:n,uriTemplate:o.resourceTemplate.uriTemplate.toString(),...o.metadata}))})),this.server.setRequestHandler(Tl,async(e,n)=>{let o=new URL(e.params.uri),r=this._registeredResources[o.toString()];if(r){if(!r.enabled)throw new M(F.InvalidParams,`Resource ${o} disabled`);return r.readCallback(o,n)}for(let i of Object.values(this._registeredResourceTemplates)){let a=i.resourceTemplate.uriTemplate.match(o.toString());if(a)return i.readCallback(o,a,n)}throw new M(F.InvalidParams,`Resource ${o} not found`)}),this._resourceHandlersInitialized=!0)}setPromptRequestHandlers(){this._promptHandlersInitialized||(this.server.assertCanSetRequestHandler(Mr(Pl)),this.server.assertCanSetRequestHandler(Mr(Ol)),this.server.registerCapabilities({prompts:{listChanged:!0}}),this.server.setRequestHandler(Pl,()=>({prompts:Object.entries(this._registeredPrompts).filter(([,e])=>e.enabled).map(([e,n])=>({name:e,title:n.title,description:n.description,arguments:n.argsSchema?DU(n.argsSchema):void 0}))})),this.server.setRequestHandler(Ol,async(e,n)=>{let o=this._registeredPrompts[e.params.name];if(!o)throw new M(F.InvalidParams,`Prompt ${e.params.name} not found`);if(!o.enabled)throw new M(F.InvalidParams,`Prompt ${e.params.name} disabled`);if(o.argsSchema){let r=$o(o.argsSchema),i=await Ll(r,e.params.arguments);if(!i.success){let u="error"in i?i.error:"Unknown error",d=Ml(u);throw new M(F.InvalidParams,`Invalid arguments for prompt ${e.params.name}: ${d}`)}let a=i.data,c=o.callback;return await Promise.resolve(c(a,n))}else{let r=o.callback;return await Promise.resolve(r(n))}}),this._promptHandlersInitialized=!0)}resource(e,n,...o){let r;typeof o[0]=="object"&&(r=o.shift());let i=o[0];if(typeof n=="string"){if(this._registeredResources[n])throw new Error(`Resource ${n} is already registered`);let a=this._createRegisteredResource(e,void 0,n,r,i);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),a}else{if(this._registeredResourceTemplates[e])throw new Error(`Resource template ${e} is already registered`);let a=this._createRegisteredResourceTemplate(e,void 0,n,r,i);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),a}}registerResource(e,n,o,r){if(typeof n=="string"){if(this._registeredResources[n])throw new Error(`Resource ${n} is already registered`);let i=this._createRegisteredResource(e,o.title,n,o,r);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),i}else{if(this._registeredResourceTemplates[e])throw new Error(`Resource template ${e} is already registered`);let i=this._createRegisteredResourceTemplate(e,o.title,n,o,r);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),i}}_createRegisteredResource(e,n,o,r,i){let a={name:e,title:n,metadata:r,readCallback:i,enabled:!0,disable:()=>a.update({enabled:!1}),enable:()=>a.update({enabled:!0}),remove:()=>a.update({uri:null}),update:c=>{typeof c.uri<"u"&&c.uri!==o&&(delete this._registeredResources[o],c.uri&&(this._registeredResources[c.uri]=a)),typeof c.name<"u"&&(a.name=c.name),typeof c.title<"u"&&(a.title=c.title),typeof c.metadata<"u"&&(a.metadata=c.metadata),typeof c.callback<"u"&&(a.readCallback=c.callback),typeof c.enabled<"u"&&(a.enabled=c.enabled),this.sendResourceListChanged()}};return this._registeredResources[o]=a,a}_createRegisteredResourceTemplate(e,n,o,r,i){let a={resourceTemplate:o,title:n,metadata:r,readCallback:i,enabled:!0,disable:()=>a.update({enabled:!1}),enable:()=>a.update({enabled:!0}),remove:()=>a.update({name:null}),update:d=>{typeof d.name<"u"&&d.name!==e&&(delete this._registeredResourceTemplates[e],d.name&&(this._registeredResourceTemplates[d.name]=a)),typeof d.title<"u"&&(a.title=d.title),typeof d.template<"u"&&(a.resourceTemplate=d.template),typeof d.metadata<"u"&&(a.metadata=d.metadata),typeof d.callback<"u"&&(a.readCallback=d.callback),typeof d.enabled<"u"&&(a.enabled=d.enabled),this.sendResourceListChanged()}};this._registeredResourceTemplates[e]=a;let c=o.uriTemplate.variableNames;return Array.isArray(c)&&c.some(d=>!!o.completeCallback(d))&&this.setCompletionRequestHandler(),a}_createRegisteredPrompt(e,n,o,r,i){let a={title:n,description:o,argsSchema:r===void 0?void 0:rn(r),callback:i,enabled:!0,disable:()=>a.update({enabled:!1}),enable:()=>a.update({enabled:!0}),remove:()=>a.update({name:null}),update:c=>{typeof c.name<"u"&&c.name!==e&&(delete this._registeredPrompts[e],c.name&&(this._registeredPrompts[c.name]=a)),typeof c.title<"u"&&(a.title=c.title),typeof c.description<"u"&&(a.description=c.description),typeof c.argsSchema<"u"&&(a.argsSchema=rn(c.argsSchema)),typeof c.callback<"u"&&(a.callback=c.callback),typeof c.enabled<"u"&&(a.enabled=c.enabled),this.sendPromptListChanged()}};return this._registeredPrompts[e]=a,r&&Object.values(r).some(u=>{let d=u instanceof no?u._def?.innerType:u;return ty(d)})&&this.setCompletionRequestHandler(),a}_createRegisteredTool(e,n,o,r,i,a,c,u,d){ry(e);let l={title:n,description:o,inputSchema:_w(r),outputSchema:_w(i),annotations:a,execution:c,_meta:u,handler:d,enabled:!0,disable:()=>l.update({enabled:!1}),enable:()=>l.update({enabled:!0}),remove:()=>l.update({name:null}),update:p=>{typeof p.name<"u"&&p.name!==e&&(typeof p.name=="string"&&ry(p.name),delete this._registeredTools[e],p.name&&(this._registeredTools[p.name]=l)),typeof p.title<"u"&&(l.title=p.title),typeof p.description<"u"&&(l.description=p.description),typeof p.paramsSchema<"u"&&(l.inputSchema=rn(p.paramsSchema)),typeof p.outputSchema<"u"&&(l.outputSchema=rn(p.outputSchema)),typeof p.callback<"u"&&(l.handler=p.callback),typeof p.annotations<"u"&&(l.annotations=p.annotations),typeof p._meta<"u"&&(l._meta=p._meta),typeof p.enabled<"u"&&(l.enabled=p.enabled),this.sendToolListChanged()}};return this._registeredTools[e]=l,this.setToolRequestHandlers(),this.sendToolListChanged(),l}tool(e,...n){if(this._registeredTools[e])throw new Error(`Tool ${e} is already registered`);let o,r,i,a;if(typeof n[0]=="string"&&(o=n.shift()),n.length>1){let u=n[0];if(ny(u))r=n.shift(),n.length>1&&typeof n[0]=="object"&&n[0]!==null&&!ny(n[0])&&(a=n.shift());else if(typeof u=="object"&&u!==null){if(Object.values(u).some(d=>typeof d=="object"&&d!==null))throw new Error(`Tool ${e} expected a Zod schema or ToolAnnotations, but received an unrecognized object`);a=n.shift()}}let c=n[0];return this._createRegisteredTool(e,void 0,o,r,i,a,{taskSupport:"forbidden"},void 0,c)}registerTool(e,n,o){if(this._registeredTools[e])throw new Error(`Tool ${e} is already registered`);let{title:r,description:i,inputSchema:a,outputSchema:c,annotations:u,_meta:d}=n;return this._createRegisteredTool(e,r,i,a,c,u,{taskSupport:"forbidden"},d,o)}prompt(e,...n){if(this._registeredPrompts[e])throw new Error(`Prompt ${e} is already registered`);let o;typeof n[0]=="string"&&(o=n.shift());let r;n.length>1&&(r=n.shift());let i=n[0],a=this._createRegisteredPrompt(e,void 0,o,r,i);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),a}registerPrompt(e,n,o){if(this._registeredPrompts[e])throw new Error(`Prompt ${e} is already registered`);let{title:r,description:i,argsSchema:a}=n,c=this._createRegisteredPrompt(e,r,i,a,o);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),c}isConnected(){return this.server.transport!==void 0}async sendLoggingMessage(e,n){return this.server.sendLoggingMessage(e,n)}sendResourceListChanged(){this.isConnected()&&this.server.sendResourceListChanged()}sendToolListChanged(){this.isConnected()&&this.server.sendToolListChanged()}sendPromptListChanged(){this.isConnected()&&this.server.sendPromptListChanged()}};var zU={type:"object",properties:{}};function vw(t){return t!==null&&typeof t=="object"&&"parse"in t&&typeof t.parse=="function"&&"safeParse"in t&&typeof t.safeParse=="function"}function bw(t){return"_def"in t||"_zod"in t||vw(t)}function ny(t){return typeof t!="object"||t===null||bw(t)?!1:Object.keys(t).length===0?!0:Object.values(t).some(vw)}function _w(t){if(t){if(ny(t))return rn(t);if(!bw(t))throw new Error("inputSchema must be a Zod schema or raw shape, received an unrecognized object");return t}}function DU(t){let e=Or(t);return e?Object.entries(e).map(([n,o])=>{let r=Ux(o),i=Lx(o);return{name:n,description:r,required:!i}}):[]}function Mr(t){let n=Or(t)?.method;if(!n)throw new Error("Schema is missing a method literal");let o=Zl(n);if(typeof o=="string")return o;throw new Error("Schema method literal must be a string")}function yw(t){return{completion:{values:t.slice(0,100),total:t.length,hasMore:t.length>100}}}var as={completion:{values:[],hasMore:!1}};var ss=s.object({endpoint:s.string().min(1).max(256).optional(),apiKey:s.string().min(1).max(256).optional(),workspace:s.string().min(1).max(256).optional(),region:s.string().min(1).max(256).optional(),feature:s.string().min(1).max(256).optional()}).strict(),kw=s.enum(["SUM","COUNT","MAX","UNIQUE_COUNT","LATEST"]),oy=s.object({d:s.number().int().nonnegative(),w:s.number().int().positive(),c:s.number().nonnegative(),agg:kw.default("COUNT").optional(),valueProperty:s.string().optional(),uniqueProperty:s.string().optional(),provenance:s.enum(["plan","manual","provider"]).optional(),warnAt:s.number().min(0).max(1).optional(),scope:ss.optional()}),jU=s.object({kind:s.literal("credential_validity")}),UU=s.object({kind:s.literal("track_only_bypass")}),LU=s.object({kind:s.literal("lifecycle_block"),blockOn:s.array(s.string()).default(["SUSPENDED","CANCELLED","INACTIVE"]),code:s.string().default("subscription_inactive")}),MU=s.object({kind:s.literal("identity_requirement"),require:s.enum(["org_only","org_and_user"]).default("org_only")}),ZU=s.object({kind:s.literal("scope"),requireExplicit:s.boolean().default(!0)}),FU=s.object({kind:s.literal("permission"),mode:s.enum(["grace","closed"]).optional()}),VU=s.object({kind:s.literal("feature_gate"),feature:s.string().min(1).max(120)}),qU=s.object({kind:s.literal("geo_restriction"),allow:s.array(s.string().length(2).regex(/^[A-Z]{2}$/)).optional(),block:s.array(s.string().length(2).regex(/^[A-Z]{2}$/)).optional()}).refine(t=>t.allow!==void 0||t.block!==void 0,{message:"geo_restriction requires either `allow` or `block`"}),BU=s.enum(["fixed_window","sliding_window","token_bucket"]),HU=oy.extend({kind:s.literal("rate_limit"),m:s.enum(["e","t"]).default("e"),strategy:BU.default("fixed_window"),bucket_capacity:s.number().positive().optional(),refill_rate_per_second:s.number().positive().optional()}).superRefine((t,e)=>{t.strategy==="token_bucket"?(t.bucket_capacity===void 0&&e.addIssue({code:"custom",message:"token_bucket strategy requires `bucket_capacity` (positive number)",path:["bucket_capacity"]}),t.refill_rate_per_second===void 0&&e.addIssue({code:"custom",message:"token_bucket strategy requires `refill_rate_per_second` (positive number)",path:["refill_rate_per_second"]})):(t.bucket_capacity!==void 0&&e.addIssue({code:"custom",message:`bucket_capacity is only valid when strategy === 'token_bucket' (got '${t.strategy}')`,path:["bucket_capacity"]}),t.refill_rate_per_second!==void 0&&e.addIssue({code:"custom",message:`refill_rate_per_second is only valid when strategy === 'token_bucket' (got '${t.strategy}')`,path:["refill_rate_per_second"]}))}),KU=s.enum(["fixed_window","sliding_window"]),GU=oy.extend({kind:s.literal("quota"),ovr:s.enum(["BLOCK","ALLOW_AND_BILL"]),strategy:KU.default("fixed_window")}),WU=oy.extend({kind:s.literal("credit_balance"),ovr:s.enum(["BLOCK","ALLOW_AND_BILL"])}),JU=s.object({kind:s.literal("concurrency"),capability:s.string().min(1).max(120),limit:s.number().int().positive(),lease_ttl_seconds:s.number().int().positive().max(3600).default(60)}),YU=s.object({kind:s.literal("capability_limit"),capability:s.string().min(1).max(120),limit:s.union([s.number().int().nonnegative(),s.boolean()])}),XU=s.object({kind:s.literal("resource_count"),resource:s.string().min(1).max(120),limit:s.number().int().nonnegative(),actionId:s.string().min(1).max(160).optional()}),QU=s.object({kind:s.literal("reservation"),dimension:s.string().min(1).max(120),max_outstanding:s.number().int().positive(),hold_seconds:s.number().int().positive().max(86400)}),eL=s.enum(["plan","manual","provider"]),Ad=s.object({maxInputTokens:s.number().int().positive().optional(),maxOutputTokens:s.number().int().positive().optional(),maxContextTokens:s.number().int().positive().optional(),maxPayloadBytes:s.number().int().positive().optional(),enforcement:s.enum(["enforce","track"]).default("enforce"),failMode:s.enum(["open","closed"]).default("open"),tokenCountSource:s.enum(["declared","estimated"]).optional(),scope:ss.optional()}).refine(xw,{message:"capacity requires at least one ceiling (maxInputTokens / maxOutputTokens / maxContextTokens / maxPayloadBytes)"});function xw(t){return t.maxInputTokens!==void 0||t.maxOutputTokens!==void 0||t.maxContextTokens!==void 0||t.maxPayloadBytes!==void 0}var tL=s.object({kind:s.literal("capacity"),maxInputTokens:s.number().int().positive().optional(),maxOutputTokens:s.number().int().positive().optional(),maxContextTokens:s.number().int().positive().optional(),maxPayloadBytes:s.number().int().positive().optional(),enforcement:s.enum(["enforce","track"]).default("enforce"),failMode:s.enum(["open","closed"]).default("open"),tokenCountSource:s.enum(["declared","estimated"]).optional(),scope:ss.optional(),provenance:eL.optional()}).refine(xw,{message:"capacity requires at least one ceiling (maxInputTokens / maxOutputTokens / maxContextTokens / maxPayloadBytes)"}),iy=s.discriminatedUnion("kind",[jU,UU,LU,MU,ZU,FU,VU,qU,HU,GU,WU,YU,XU,JU,QU,tL]);var cs=["customer_feature","control_plane","admin_internal","background_job","webhook","healthcheck","unclassified"],BK=new Set(cs);var Cd=s.object({trafficClass:s.enum(cs),policySource:s.enum(["declared","inherited","defaulted","legacy_inferred"]),limitParticipation:s.object({profile:s.enum(["customer_usage","business_capacity","control_plane","admin_internal","platform_abuse_only","healthcheck","none"]),pools:s.array(s.string().min(1)).optional(),scopes:s.array(s.object({endpoint:s.string().optional(),apiKey:s.string().optional(),workspace:s.string().optional(),region:s.string().optional(),feature:s.string().optional()}).passthrough()).optional(),metrics:s.array(s.string().min(1)).optional()}).passthrough(),customerBillingPolicy:s.object({customerBillable:s.boolean(),meterKey:s.string().min(1).optional(),chargeableOutcomes:s.enum(["success_only","success_and_partial","attempted","trusted_actual_usage_only"]),invoiceBehavior:s.string().optional()}).passthrough(),providerCostPolicy:s.object({providerCostTracked:s.boolean(),declaredProviderHint:s.string().optional(),declaredModelHint:s.string().optional()}).passthrough()}).passthrough();var rG=s.object({keyId:s.string().min(1),orgId:s.string().min(1),actorType:s.enum(["org","user"]).optional(),actorId:s.string().nullable().optional(),productId:s.string().min(1),compiledPlanId:s.string().min(1),entitlementHash:s.string().optional(),subjectKey:s.string().min(1),subscriptionId:s.string().min(1),currentPeriodId:s.string().optional(),currentPeriodStartMs:s.number().optional(),subscriberId:s.string().min(1),apiKeyId:s.string().nullable(),entitlementVersion:s.number(),identityRequirement:s.enum(["org_only","org_and_user"]),status:s.enum(["active","revoked"]),expiresAt:s.number().nullable().optional(),subscriberStatus:s.enum(["ONBOARDING","ACTIVE","SUSPENDED"]),subscriptionStatus:s.string().min(1),environment:s.enum(["production","sandbox"]).optional(),environmentId:s.string().optional(),scopes:s.array(s.string()).readonly().optional(),entitlement:s.record(s.string(),s.unknown()).nullable().optional()});var Sw=s.object({unit:s.enum(["requests","tokens","computeMs","dollars"]),window:s.enum(["second","minute","hour","day","week","month"]),capacity:s.number()}),rL=s.object({id:s.string().min(1),slug:s.string().optional(),transportMode:s.enum(["direct","tunnel"]),verificationRequired:s.boolean().optional(),originUrl:s.string().optional(),originHostname:s.string().optional(),accessCredentialRef:s.string().optional(),policyVersion:s.string().optional()}),nG=s.object({id:s.string().min(1),origin:s.string().min(1),sandboxOrigin:s.string().nullable().optional(),authHeader:s.string().optional(),pricing:s.object({requests:s.number().optional(),tokens:s.number().optional(),computeMs:s.number().optional(),per_request:s.number().optional()}).catchall(s.number().optional()).optional(),metering:s.object({tokens:s.object({estimatePerRequest:s.number().optional()}).optional(),computeMs:s.object({estimatePerRequest:s.number().optional()}).optional(),billOn4xx:s.boolean().optional()}).optional(),tenantLimits:s.array(Sw).readonly().optional(),userLimits:s.array(Sw).readonly().optional(),environmentId:s.string().optional(),contextTokenSecret:s.string().nullable().optional(),timeoutMs:s.number().positive().optional(),idleTimeoutMs:s.number().positive().optional(),backends:s.array(rL).optional(),defaultBackendId:s.string().optional(),verificationRequired:s.boolean().optional(),hasPublicRoutes:s.boolean().optional()});var nL=s.object({perRequestMinUnitsByDim:s.record(s.string(),s.number()).optional(),creditPoolMicros:s.number().optional(),perDimUnitCostMicros:s.record(s.string(),s.number()).optional()}),oL=s.object({source:s.enum(["fixed","provider_catalog"]),meterKey:s.string(),selector:s.string().optional(),measures:s.array(s.string()),catalog:s.string().optional(),pricePolicy:s.string().optional(),markupPercent:s.number().optional(),fixedRatesMicros:s.record(s.string(),s.record(s.string(),s.number())).optional()}),iL=s.object({key:s.string(),display:s.string(),unit:s.string().optional(),aggregation:s.enum(["SUM","COUNT","MAX","UNIQUE_COUNT","LATEST"]),window:s.enum(["minute","hour","day","month","billing_period"]),enforcementType:s.string()}),aL=s.object({feature:s.string(),method:s.string(),path:s.string(),meters:s.array(s.string()).optional(),usagePolicy:Cd.optional(),policyResolutionMode:s.enum(["legacy","policy"]).optional()}),oG=s.object({v:s.number(),sub:s.string(),compiledPlanId:s.string().min(1),planType:s.string(),ts:s.number(),constraints:s.array(iy),cv:s.number(),policyResolutionMode:s.enum(["legacy","policy"]).optional(),dm:s.record(s.string(),s.number()),dmv:s.number().optional(),floor:nL.nullable().optional(),displayDims:s.array(s.number()).optional(),meterSemantics:s.record(s.string(),iL).optional(),rp:s.record(s.string(),oL).optional(),fr:s.array(aL).optional(),sig:s.string().min(1),sigKid:s.string().optional(),environmentId:s.string().optional()}).passthrough();var iG=s.object({subscriptionId:s.string().min(1),activePeriodId:s.string().optional(),activeCompiledPlanId:s.string().min(1),activeEntitlementHash:s.string().optional(),enforcementMode:s.enum(["STRICT","GRACE","TRACK_ONLY"]),postStreamLockouts:s.array(s.object({code:s.literal("post_stream_overspend"),reason:s.literal("usage_exhausted"),constraintKey:s.string().min(1),cycleId:s.string().min(1),dimension:s.string().min(1),currentCapacity:s.number().nonnegative(),observedUsage:s.number().nonnegative(),lockedAt:s.string().min(1),expiresAt:s.string().min(1)})).optional(),gracePeriodEndsAt:s.string().optional(),trialEndsAt:s.string().optional(),scheduledTransition:s.object({kind:s.string(),timing:s.string(),scheduledFor:s.string(),toCompiledPlanId:s.string().nullable()}).optional(),creditPool:s.object({periodStartMs:s.number(),periodEndMs:s.number(),grantedCents:s.number(),policy:s.enum(["block","allow"]),epoch:s.number()}).optional(),resourceCounts:s.record(s.string(),s.number()).optional(),dedicatedShard:s.enum(["ACTIVE","DRAINING"]).optional(),memberAuthz:s.record(s.string(),s.object({permissions:s.array(s.string()),roles:s.array(s.string())})).optional(),memberAuthzComputedAt:s.number().optional(),generation:s.number(),updatedAt:s.string()});var sL=["DRAFT","ACTIVE"],cG=s.enum(sL),cL=["ONBOARDING","ACTIVE","SUSPENDED"],$w=s.enum(cL),uL=["ACTIVE","REVOKED"],uG=s.enum(uL),lL=["BLOCK","ALLOW_AND_BILL"],Iw=s.enum(lL),dL=["ACTIVE","ARCHIVED"],lG=s.enum(dL),pL=["ACTIVE","EXPERIMENTAL","LEGACY_STABLE","PHASING_OUT","SUPERSEDED","ARCHIVED"],dG=s.enum(pL);var ww=["input","output","total","cached_read_input","cache_creation_input","context","max_output","estimated_output","actual_output","streaming_output"],Nd=[{id:"requests",label:"API requests",description:"Count every call \u2014 the right default for most APIs.",meters:[{key:"requests",display:"Requests",unit:"request"}]},{id:"ai-tokens",label:"AI tokens",description:"LLM-style token metering alongside calls. The gateway can estimate tokens per request and settle actuals from @farthershore/backend reports.",meters:[{key:"requests",display:"Requests",unit:"request"},{key:"tokens_used",display:"Tokens Used",unit:"token"}]},{id:"credits",label:"Credits",description:"Price work in abstract credits (e.g. one image = 5 credits). Report each call's dynamic credit cost through @farthershore/backend.",meters:[{key:"requests",display:"Requests",unit:"request"},{key:"credits",display:"Credits",unit:"credit"}]},{id:"spend",label:"Metered spend",description:"Pass-through spend in cents (OpenRouter-style) reported through @farthershore/backend. Pairs with prepaid credit wallets.",meters:[{key:"requests",display:"Requests",unit:"request"},{key:"dollars",display:"Spend",unit:"cent"}]},{id:"compute",label:"Compute time",description:"Bill milliseconds of compute, settled from @farthershore/backend reports.",meters:[{key:"requests",display:"Requests",unit:"request"},{key:"compute_ms",display:"Compute Time",unit:"ms"}]}];function Ew(t){let e=t.trim().toLowerCase();return Nd.find(n=>n.id===e)}function Tw(){return Nd.map(t=>t.id)}var mL="FS_RUNTIME_TOKEN";var fL={payload:"x-fs-metering",signature:"x-fs-metering-sig",token:"x-fs-metering-token"};var gG={environmentVariable:mL,presentation:fL.token,storage:"sha256-hash-only"};var Pw={missingSignature:"missing_signature",malformedSignature:"malformed_signature",unknownKeyId:"unknown_key_id",jwksUnavailable:"jwks_unavailable",badSignature:"bad_signature",bodyHashMismatch:"body_hash_mismatch",routeMismatch:"route_mismatch",clockSkew:"clock_skew",expiredSignature:"expired_signature",replayedNonce:"replayed_nonce",bodyTooLarge:"body_too_large",environmentMismatch:"environment_mismatch",missingToken:"missing_token",invalidToken:"invalid_token",contextUnverified:"context_unverified"};var _G=10*1024*1024;var hL=["CHECKOUT_COMPLETED","PLAN_CHANGED","CANCELLED","RESTORED","UNSCHEDULED_CANCELLATION","PRICE_ROLLOVER","PAUSED","RESUMED","PLAN_CHANGE_SCHEDULED","PLAN_CHANGE_ABORTED","SCHEDULE_CREATED","SCHEDULE_UPDATED","SCHEDULE_RELEASED","SCHEDULE_COMPLETED","SCHEDULE_ABORTED","CANCEL_SCHEDULED","PAYMENT_FAILED","PAYMENT_RECOVERED","PAYMENT_RECOVERED_FROM_SUSPENDED","PAYMENT_ACTION_REQUIRED","RECURRING_PAYMENT","REFUND_PROCESSED","DISPUTE_OPENED","DISPUTE_FUNDS_WITHDRAWN","DISPUTE_CLOSED","DISPUTE_FUNDS_REINSTATED","DISPUTE_CREDIT_REVOKED","DISPUTE_CREDIT_REINSTATED","MIN_SPEND_TRUE_UP"],bG=s.enum(hL);var ay=["BRANCH_PREFIX","PULL_REQUEST","DISABLED"];var gL=s.object({d:s.number(),w:s.number(),capacity:s.number(),remaining:s.number(),windowStart:s.number(),windowEnd:s.number()}),_L=s.record(s.string(),gL),yL=s.object({allocations:s.array(s.number()),expiresAt:s.number()}),vL=s.record(s.string(),yL),bL=s.record(s.string(),s.bigint()),TG=s.object({subscriptionId:s.string(),handoffToken:s.string(),targetShardId:s.string(),policyVersion:s.number(),entitlementVersion:s.number().nullable(),windowStates:_L,activeLeases:vL,totalsByDimension:bL.optional(),billingCycleId:s.string().nullable().optional(),billingCycleStartMs:s.number().optional()});var Ow=new Set(["read","export","download"]);var Rw={org:["read","create","update","delete","manage_settings","manage_billing"],business:["read","create","update","delete","publish","archive"],plan:["read","create","update","delete","promote_version"],makertoken:["read","create","rotate","revoke"],webhook:["read","configure","rotate_secret"],persona:["read","issue","rotate","revoke"],experimental:["promote","rollback"],migration:["create"],auth_provider_connection:["read","create","update","delete"],subscription:["read","cancel","restore","change_plan"],usage:["read","export"],invoice:["read","pay","download"],billing:["read","manage_subscription","refund","change_payment_method"],team:["read","invite","remove_member","change_role","manage_rbac","assign_product_role"],apikey:["read","create","rotate","revoke"],audit_log:["read","export"]},CG=Object.keys(Rw),NG=Object.fromEntries(Object.entries(Rw).map(([t,e])=>[t,{read:e.filter(n=>Ow.has(n)),write:e.filter(n=>!Ow.has(n))}]));var kL=new Set(["GET","HEAD","OPTIONS"]);function sy(t,e){return kL.has(e.toUpperCase())?`${t}:read`:`${t}:write`}var xL={gatewayProjectRead:"gateway:project:read",gatewayResourceWrite:"gateway:resource:write",usageWrite:"usage:write",authzDeniedWrite:"authz-denied:write",reservationAuthorize:"reservation:authorize",reservationFinalize:"reservation:finalize",internalCronRun:"internal:cron:run",personaManage:"persona:manage"},UG=Object.values(xL);var SL=["managed_frontend","custom_frontend","embedded_sdk","public_api","cli","agent","webhook","admin","internal"],Cw=s.enum(SL),Aw=s.string().min(1).max(128),$L=s.object({d:s.number().int().nonnegative(),w:s.number().int().positive(),rem:s.number(),cap:s.number()}).strict(),Nw=s.object({v:s.literal(1),entV:s.number().int().nonnegative().optional(),entHash:Aw.optional(),featureGrant:s.boolean().optional(),gates:s.array(Aw).max(16).optional(),limits:s.array($L).max(16).optional()}).strict();var IL=s.object({requestId:s.string(),eventId:s.string(),tenantId:s.string(),slug:s.string(),subscriptionId:s.string(),subscriberId:s.string(),apiKeyId:s.string().nullable(),compiledPlanId:s.string(),subscriberStatus:$w,subscriptionStatus:s.string(),productId:s.string(),statusCode:s.number(),path:s.string(),latencyMs:s.number(),rawDimsUnits:s.record(s.string(),s.number()),matchedRouteMeters:s.array(s.string().min(1)).optional(),servedRouteScopes:s.array(s.string().min(1)).optional(),meterSettlements:s.array(s.object({meterId:s.string(),meterType:s.enum(["exact_pre_request","estimated_then_settled","postpaid","strict_concurrency"]),reserved:s.number(),actual:s.number(),delta:s.number(),dimension:s.number().int().nonnegative(),leaseId:s.string()})).optional(),reportingAttested:s.boolean(),customerBillable:s.boolean(),postStreamPending:s.boolean().optional(),measureContext:s.record(s.string(),s.unknown()).optional(),creditUnitsConsumed:s.record(s.string(),s.number()).optional(),timestamp:s.number(),environmentId:s.string().nullable().optional(),orgId:s.string().optional(),actorType:s.enum(["org","user"]).optional(),actorId:s.string().nullable().optional(),subjectKey:s.string().optional(),overageBehavior:Iw.optional(),environment:s.enum(["production","sandbox"]).optional(),surface:Cw.optional(),actionId:s.string().min(1).max(128).optional(),subjectType:s.string().min(1).max(128).optional(),subjectId:s.string().min(1).max(256).optional(),decision:Nw.optional(),decisionId:s.string().min(1).max(256).optional(),denyClass:s.enum(["quota","rate","concurrency","capacity","spend","adaptive"]).optional(),blockingConstraintId:s.string().min(1).max(256).optional(),providerSettlements:s.array(s.object({meterId:s.string(),providerReported:s.number(),reconciled:s.number()})).optional(),usagePolicyId:s.string().min(1).max(256).optional(),policySource:s.enum(["declared","inherited","defaulted","legacy_inferred"]).optional(),trafficClass:s.enum(cs).optional(),limitProfile:s.enum(["customer_usage","business_capacity","control_plane","admin_internal","platform_abuse_only","healthcheck","none"]).optional(),leaseId:s.string(),transactionId:s.string(),gatewayMetadata:s.object({shardId:s.string(),policyVersion:s.number().int().nonnegative().optional(),artifactVersion:s.number().int().nonnegative().default(0),artifactHash:s.string().regex(/^sha256_[a-f0-9]{64}$/).optional(),leaseTelemetry:s.object({consumeRequests:s.number().int().nonnegative(),localLeaseHits:s.number().int().nonnegative(),doAllocationAttempts:s.number().int().nonnegative(),doAllocationGrants:s.number().int().nonnegative(),doAllocationDenials:s.number().int().nonnegative(),doUnavailable:s.number().int().nonnegative(),doCircuitOpen:s.number().int().nonnegative(),leaseRefreshSingleflightJoins:s.number().int().nonnegative(),leaseRefreshSingleflightJoinRate:s.number().min(0).max(1),expiredLeasesReaped:s.number().int().nonnegative(),expiredLeaseReclaimedGrant:s.array(s.number().nonnegative()),reconcileRequests:s.number().int().nonnegative(),reconcilePositiveDeltas:s.number().int().nonnegative(),reconcileNoLocalLease:s.number().int().nonnegative(),doReconcileAttempts:s.number().int().nonnegative(),doReconcileFailures:s.number().int().nonnegative(),unspentLeaseRemainderReturns:s.number().int().nonnegative(),unspentLeaseRemainderReturnFailures:s.number().int().nonnegative(),unspentLeaseRemainderReturnedGrant:s.array(s.number().nonnegative()),maxObservedPositiveReconcileDelta:s.array(s.number().nonnegative()),requestToDoRatio:s.number().nonnegative(),localLeaseHitRate:s.number().min(0).max(1),localSpendRate:s.number().min(0).max(1),maxObservedActiveLeases:s.number().int().nonnegative(),maxObservedOutstandingGrant:s.array(s.number().nonnegative()),maxObservedOutstandingGrantRatio:s.number().nonnegative(),maxObservedEmergencyReserveGrant:s.array(s.number().nonnegative()),maxObservedEmergencyReserveGrantRatio:s.number().nonnegative(),maxObservedLeaseGrant:s.array(s.number().nonnegative()),maxObservedLeaseGrantRatio:s.number().nonnegative(),maxObservedLeaseTtlMs:s.number().int().nonnegative()}).optional(),artifactCacheTelemetry:s.object({reads:s.number().int().nonnegative(),l0FreshHits:s.number().int().nonnegative(),l0Misses:s.number().int().nonnegative(),l0StaleServes:s.number().int().nonnegative(),l0StaleIfErrorServes:s.number().int().nonnegative(),l0BlockingRefreshes:s.number().int().nonnegative(),l0SingleflightJoins:s.number().int().nonnegative(),l0EarlyRefreshes:s.number().int().nonnegative(),l1Hits:s.number().int().nonnegative(),l1Misses:s.number().int().nonnegative(),l1Rejected:s.number().int().nonnegative(),l1WriteFailures:s.number().int().nonnegative(),kvHits:s.number().int().nonnegative(),kvMisses:s.number().int().nonnegative(),kvTimeouts:s.number().int().nonnegative(),kvCircuitOpenReads:s.number().int().nonnegative(),resultHits:s.number().int().nonnegative(),resultMisses:s.number().int().nonnegative(),resultDenied:s.number().int().nonnegative(),resultUnavailable:s.number().int().nonnegative(),backgroundRefreshErrors:s.number().int().nonnegative(),l0HitRate:s.number().min(0).max(1),l0SingleflightJoinRate:s.number().min(0).max(1),l0EarlyRefreshRate:s.number().min(0).max(1),l1HitRate:s.number().min(0).max(1),kvHitRate:s.number().min(0).max(1),resultHitRate:s.number().min(0).max(1),staleServeRate:s.number().min(0).max(1)}).optional(),gatewayVersion:s.string()}).passthrough()}).passthrough();var wL=s.object({path:s.string(),code:s.string(),message:s.string()}),GG=s.object({reason:s.literal("schema_validation_failed"),receivedAt:s.string(),rawPayload:s.unknown(),issues:s.array(wL),consumerVersion:s.string().optional(),originalMessageId:s.string().optional()});var zw=[{name:"subscription.created",webhook:!0,description:"A subscriber subscription was created."},{name:"subscription.updated",webhook:!0,description:"A subscriber subscription changed (plan, status, trial)."},{name:"subscription.canceled",webhook:!0,description:"A subscriber subscription was canceled."},{name:"payment.succeeded",webhook:!0,description:"A Stripe payment succeeded for a subscription."},{name:"payment.failed",webhook:!0,description:"A Stripe payment failed for a subscription."},{name:"rate_limit.exceeded",webhook:!0,description:"The gateway denied a request for exceeding a rate limit."},{name:"entitlement.changed",webhook:!0,description:"A compiled entitlement/plan was (re)published."},{name:"usage.threshold_reached",webhook:!0,description:"A metered-usage threshold was crossed."},{name:"change_set.created",webhook:!1,description:"A governed Evolution ChangeSet was proposed (draft created)."},{name:"change_set.approved",webhook:!1,description:"A governed Evolution ChangeSet was approved."},{name:"change_set.applied",webhook:!1,description:"A governed Evolution ChangeSet was applied to live state."},{name:"change_set.rolled_back",webhook:!1,description:"A governed Evolution ChangeSet was rolled back."},{name:"change_set.cancelled",webhook:!1,description:"A governed Evolution ChangeSet was cancelled."},{name:"billing.event_recorded",webhook:!1,description:"A BillingEvent row was recorded; the fact references it by id (the authoritative billing row is unchanged \u2014 exact-accounting invariant)."},{name:"authz.decision",webhook:!1,description:"An authorization decision (ALLOW/DENY) mirrored from the audit log onto the spine; AuditLog stays authoritative."},{name:"repo.changed",webhook:!1,description:"A default-branch push to the business's repo touched paths at least one enabled automation rule watches (payload: branch, headSha, bounded changed-path list). Emitted pre-filtered \u2014 never on every push \u2014 so path-triggered automations (e.g. legal/** changed \u2192 notify subscribers) can fire deterministically."},{name:"automation.rule_fired",webhook:!1,description:"An enabled AutomationRule matched a spine fact (trigger + all conditions held) and its actions were scheduled."},{name:"automation.action_succeeded",webhook:!1,description:"An AutomationRule action ran to success."},{name:"automation.action_failed",webhook:!1,description:"An AutomationRule action failed (will retry per the queue)."},{name:"automation.action_denied",webhook:!1,description:"An AutomationRule action was DENIED \u2014 the automation actor lacked the action's native permission (automation is a first-class authz subject, never a bypass). Recorded + audited; the action did not run."},{name:"automation.notification",webhook:!1,description:"A notification recorded by an AutomationRule `create_notification` action \u2014 a spine fact other surfaces (portal/admin) read; no separate notification runtime."},{name:"access_request.created",webhook:!1,description:"A subscriber member requested a missing permission (AccessRequest row created). Internal \u2014 the Communication layer notifies the subscriber's admins (who can grant it)."},{name:"access_request.resolved",webhook:!1,description:"A pending AccessRequest was resolved (approved or denied) by an owner/admin. Internal \u2014 notifies the subscriber's admins."},{name:"build.failed",webhook:!1,description:"A build for the business (frontend/portal or Business-SDK) failed and did not go live. Internal \u2014 the Communication layer notifies the org's members (opt-out-able, category: deployments)."},{name:"product.published",webhook:!1,description:"A business went live for the first time (DRAFT\u2192ACTIVE first publish). Internal \u2014 notifies the org's members (category: deployments)."},{name:"workflow.failed",webhook:!1,description:"A platform workflow (config apply / Stripe sync / subscription transition) reached a terminal FAILED state. Internal \u2014 notifies the org's admins (category: deployments)."},{name:"pr.review_posted",webhook:!1,description:"The platform posted (or updated) its Business-as-Code impact report on a managed-repo pull request. Internal \u2014 emails the org's members the review synopsis + a link to the PR (category: deployments)."}],EL=zw.map(t=>t.name),Dw=zw.filter(t=>t.webhook).map(t=>t.name),YG=s.enum(EL);var jw=["subscription.created","subscription.updated","subscription.canceled","payment.succeeded","payment.failed","rate_limit.exceeded","entitlement.changed","usage.threshold_reached"],cy=jw;{let t=new Set(Dw),e=new Set(jw),n=[...t].filter(r=>!e.has(r)),o=[...e].filter(r=>!t.has(r));if(n.length>0||o.length>0)throw new Error(`[webhooks/events] WEBHOOK_EVENT_NAMES drifted from the events catalog. Missing from order tuple: [${n.join(", ")}]; extra in order tuple: [${o.join(", ")}]. Reconcile ../events/catalog.ts (webhook: true entries) with WEBHOOK_EVENT_ORDER in this file.`)}var Vo=s.enum(cy);var Ut=s.enum(["immediate","period_end","grandfather"]),qo=s.object({default:Ut.default("period_end"),when:s.object({price_increase:Ut.optional(),price_decrease:Ut.optional(),feature_added:Ut.optional(),feature_removed:Ut.optional(),limit_increased:Ut.optional(),limit_reduced:Ut.optional(),credit_increased:Ut.optional(),credit_reduced:Ut.optional(),rating_changed:Ut.optional()}).strict().default({price_increase:"period_end",price_decrease:"immediate",feature_added:"immediate",feature_removed:"period_end",limit_increased:"immediate",limit_reduced:"period_end",credit_increased:"immediate",credit_reduced:"period_end",rating_changed:"period_end"}),allowImmediatePriceIncrease:s.boolean().default(!1),allowImmediateEntitlementReduction:s.boolean().default(!1)}).strict().superRefine((t,e)=>{(t.when.price_increase??t.default)==="immediate"&&!t.allowImmediatePriceIncrease&&e.addIssue({code:"custom",path:["when","price_increase"],message:"price_increase cannot switch immediately without allowImmediatePriceIncrease: true"});for(let n of["feature_removed","limit_reduced","credit_reduced"])(t.when[n]??t.default)==="immediate"&&!t.allowImmediateEntitlementReduction&&e.addIssue({code:"custom",path:["when",n],message:`${n} cannot switch immediately without allowImmediateEntitlementReduction: true`})}),TL=qo.parse({});var PL=s.object({kind:s.literal("credit"),amount_cents:s.number().int().nonnegative(),recurs:s.boolean().optional(),expires_after_days:s.number().int().positive().optional(),label:s.string().min(1).max(120).optional()}),OL=s.object({kind:s.literal("top_up"),sku:s.string().min(1).max(120),label:s.string().min(1).max(200),price_cents:s.number().int().positive(),credit_cents:s.number().int().positive()}),sr=s.discriminatedUnion("kind",[PL,OL]);function Uw(t){return t.kind==="credit"&&t.recurs===!0&&t.label===void 0}function Lw(t){return t.kind==="credit"&&t.recurs!==!0&&t.label===void 0}function uy(t,e,n=["grants"]){if(!t)return;let o=0,r=0;for(let i of t)Uw(i)?o+=1:Lw(i)&&(r+=1);o>1&&e.addIssue({code:"custom",message:"At most one recurring `credit` grant (recurs:true, no label) is allowed \u2014 recurring credit is a single canonical entry.",path:n}),r>1&&e.addIssue({code:"custom",message:"At most one one-time `credit` grant (recurs:false, no label) is allowed \u2014 one-time credit is a single canonical entry.",path:n})}function Mw(t){return t.grants&&t.grants.length>0?[...t.grants]:[]}function ly(t){return Mw(t).find(Uw)?.amount_cents??0}function zd(t){return Mw(t).find(Lw)?.amount_cents??0}var RL=s.object({percent:s.number().int().min(0).max(100)}),AL=s.object({threshold_cents:s.number().int().nonnegative(),refill_cents:s.number().int().positive()}),cr=s.object({rollover:RL.optional(),auto_recharge:AL.optional()});var Zw=s.enum(["linear","active_count","event_count"]);var CL=s.object({up_to:s.number().int().positive().nullable(),price_per_unit_micros:s.number().int().nonnegative()}),NL=s.object({strategy:s.enum(["graduated","volume"]),tiers:s.array(CL).min(1).max(20)}),ur=s.object({dimension:s.string().min(1).max(64).regex(/^[a-z0-9_]+$/,"Meter dimension must be lowercase alphanumeric with underscores"),kind:Zw.default("linear"),price_per_unit_micros:s.number().int().nonnegative().default(0),tiered:NL.optional(),included_units:s.number().int().positive().optional()}).superRefine((t,e)=>{if(t.tiered&&t.price_per_unit_micros>0&&e.addIssue({code:"custom",message:"`tiered` is mutually exclusive with a non-zero `price_per_unit_micros` \u2014 drop one",path:["tiered"]}),t.included_units!==void 0&&t.tiered&&e.addIssue({code:"custom",message:"`included_units` is mutually exclusive with `tiered` \u2014 a tiered schedule already expresses the included allotment as a zero-priced first tier",path:["included_units"]}),t.tiered){let n=0,o=!1;for(let r=0;r<t.tiered.tiers.length;r++){let i=t.tiered.tiers[r];if(o){e.addIssue({code:"custom",message:"Open-ended tier (`up_to: null`) must be the final tier",path:["tiered","tiers",r,"up_to"]});break}if(i.up_to===null){o=!0;continue}i.up_to<=n&&e.addIssue({code:"custom",message:`Tier upper bounds must be strictly ascending (tier ${r} = ${i.up_to} <= previous ${n})`,path:["tiered","tiers",r,"up_to"]}),n=i.up_to}o||e.addIssue({code:"custom",message:"The final tier of a `tiered` schedule must be open-ended (`up_to: null`)",path:["tiered","tiers",t.tiered.tiers.length-1,"up_to"]})}}),hn=s.enum(["month","year"]),zL=s.object({meters:s.array(ur).default([]),recurring_fee_cents:s.number().int().nonnegative().default(0),billing_interval:hn.default("month"),grants:s.array(sr).max(40).default([]),creditPolicy:cr.optional(),trial_days:s.number().int().nonnegative().default(0),max_monthly_spend_cents:s.number().int().nonnegative().optional()});var DL=s.string().min(1),jL=s.object({type:s.literal("named"),name:s.enum(["second","minute","hour","day","week","month"])}),UL=s.object({type:s.literal("custom"),seconds:s.number().int().positive(),label:s.string().optional()}),LL=s.discriminatedUnion("type",[jL,UL]),Zr=s.object({dimension:DL,window:LL,capacity:s.number().nonnegative(),enforcement:s.enum(["enforce","track"]).optional(),warnAt:s.number().min(0).max(1).optional(),scope:ss.optional(),acknowledgeUnreachable:s.boolean().optional()}),fW=s.array(Zr).max(20);var ML=s.enum(["NONE","PRORATE","CREDIT"]).default("NONE"),ZL={meters:s.array(ur).default([]),recurring_fee_cents:s.number().int().nonnegative().default(0),billing_interval:hn.default("month"),trial_days:s.number().int().nonnegative().default(0),max_monthly_spend_cents:s.number().int().nonnegative().optional(),min_monthly_spend_cents:s.number().int().nonnegative().optional(),grants:s.array(sr).max(40).default([]),creditPolicy:cr.optional()},FL={meters:s.array(ur).optional(),recurring_fee_cents:s.number().int().nonnegative().optional(),billing_interval:hn.optional(),trial_days:s.number().int().nonnegative().optional(),max_monthly_spend_cents:s.number().int().nonnegative().optional(),min_monthly_spend_cents:s.number().int().nonnegative().optional(),grants:s.array(sr).max(40).optional(),creditPolicy:cr.optional()},VL=s.object({id:s.string().min(1).max(64).regex(/^[a-z0-9_-]+$/,"Variant id must be lowercase alphanumeric with hyphens/underscores"),label:s.string().max(200).optional(),rolloutPercent:s.number().int().min(0).max(100),assignmentSeed:s.string().min(1).max(100).default("default"),prorationOnRollback:ML,...FL,limits:s.array(Zr).max(20).optional(),featureGates:s.record(s.string(),s.boolean()).optional(),capability_limits:s.record(s.string().min(1).max(120),s.union([s.number().int().nonnegative(),s.boolean()])).optional(),overageBehavior:s.enum(["block","allow_and_bill"]).optional(),capacity:Ad.optional()}),Fw=VL.superRefine((t,e)=>{uy(t.grants,e)}),Vw=s.object({key:s.string().min(1).max(64).regex(/^[a-z0-9_-]+$/,"Plan key must be lowercase alphanumeric with hyphens/underscores"),name:s.string().min(1).max(100),description:s.string().max(500).optional(),details:s.array(s.string().max(200)).max(10).optional(),...ZL,free:s.boolean().default(!1),limits:s.array(Zr).max(20).default([]),featureGates:s.record(s.string(),s.boolean()).optional(),capability_limits:s.record(s.string().min(1).max(120),s.union([s.number().int().nonnegative(),s.boolean()])).default({}),overageBehavior:s.enum(["block","allow_and_bill"]).default("block"),selfServeEnabled:s.boolean().default(!0),capacity:Ad.optional(),legacy:s.boolean().optional().default(!1),variants:s.array(Fw).max(4).optional(),archive:s.object({at:s.string().datetime().optional(),transitionTo:s.string().optional(),strategy:s.enum(["auto","explicit","block"]).default("auto")}).optional()}),Dd=Vw.superRefine((t,e)=>{uy(t.grants,e)});var qL=/^\$\{[A-Z][A-Z0-9_]{0,127}\}$/,dy=s.string().min(3).max(200).refine(t=>qL.test(t),{message:"secret must use ${VAR} interpolation syntax (e.g. ${WEBHOOK_SECRET}); raw secrets in YAML are rejected. Define the env var in the per-product secret store and reference it here."}),py=s.object({maxAttempts:s.number().int().min(1).max(20).default(5),backoff:s.enum(["exponential","fixed"]).default("exponential")}),my=s.object({id:s.string().min(1).max(64).regex(/^[a-z0-9_-]+$/,"Webhook endpoint id must be lowercase alphanumeric with hyphens/underscores"),url:s.string().url("webhooks.endpoints[].url must be a valid URL"),secret:dy,events:s.array(Vo).min(1,"webhooks.endpoints[].events must subscribe to \u2265 1 event"),enabled:s.boolean().default(!0),retryPolicy:py.default({maxAttempts:5,backoff:"exponential"})}),fy=s.object({endpoints:s.array(my).max(50).default([])});var BL=s.object({meters:s.array(ur).optional(),recurring_fee_cents:s.number().int().nonnegative().optional(),billing_interval:hn.optional(),grants:s.array(sr).max(40).optional(),creditPolicy:cr.optional(),trial_days:s.number().int().nonnegative().optional(),max_monthly_spend_cents:s.number().int().nonnegative().optional(),limits:s.array(Zr).max(20).optional(),featureGates:s.record(s.string(),s.boolean()).optional(),overageBehavior:s.enum(["block","allow_and_bill"]).optional(),selfServeEnabled:s.boolean().optional(),legacy:s.boolean().optional()}).strict(),HL=s.object({url:s.string().url().optional(),secret:dy.optional(),events:s.array(Vo).optional(),enabled:s.boolean().optional(),retryPolicy:py.partial().optional()}).strict(),KL=s.object({plans:s.record(s.string(),BL).optional(),webhooks:s.object({endpoints:s.record(s.string(),HL).optional()}).strict().optional()}).strict(),hy=s.record(s.string().min(1).max(64),KL);var qw=1,Bw=["plans_table","usage_card","api_keys_panel","billing_summary","credit_balance","feature_panel","business_docs","audit_log","team_panel","markdown"],Hw=["/","/pricing","/dashboard","/dashboard/*","/settings","/settings/*","/team","/audit-log","/docs","/docs/*","/terms","/privacy","/persona","/persona-sign-in"],Kw=s.string().min(1).max(200).regex(/^\/[a-zA-Z0-9_./-]*$/,"path must start with / and contain only [a-zA-Z0-9_./-]"),gy=s.string().min(1).max(120).regex(/^[a-z0-9_-]+$/),_y=s.string().min(1).max(120).regex(/^(\*|[a-z0-9_-]+:(\*|[a-z0-9_-]+))$/,"permission must be '*' or '<subject>:<verb>' (verb may be '*')"),GL=s.enum(["hide","disable","readOnly","denied","upsell"]).default("hide"),Gw=s.object({label:s.string().min(1).max(80),path:Kw,capability:gy.optional(),permission:_y.optional()}),Ww=s.enum(Bw),Jw=s.object({component:Ww,props:s.record(s.string().min(1).max(80),s.unknown()).optional(),capability:gy.optional(),permission:_y.optional(),gateMode:GL}),Yw=s.object({path:Kw,title:s.string().min(1).max(120),requiresAuth:s.boolean(),capability:gy.optional(),permission:_y.optional(),components:s.array(Jw).max(12).default([])}),yy=s.object({version:s.literal(qw),nav:s.array(Gw).max(12).default([]),pages:s.array(Yw).max(24).default([])}).superRefine((t,e)=>{let n=new Set;t.pages.forEach((o,r)=>{n.has(o.path)&&e.addIssue({code:"custom",message:`duplicate frontend page path "${o.path}"`,path:["pages",r,"path"]}),n.add(o.path),Xw(o.path)&&e.addIssue({code:"custom",message:`frontend page path "${o.path}" is reserved by the template`,path:["pages",r,"path"]})})});function Xw(t){return Hw.some(e=>{if(e.endsWith("/*")){let n=e.slice(0,-2);return t===n||t.startsWith(`${n}/`)}return t===e})}var Qw=s.enum(["subscription","subject"]),eE=s.enum(["reported","action_inferred"]),tE=s.string().min(1).max(100).regex(/^[a-z0-9_.:-]+$/),rE=s.object({name:tE,display:s.string().min(1).max(120).optional(),scope:Qw.default("subscription"),subjectType:s.string().min(1).max(64).regex(/^[a-zA-Z0-9_.:-]+$/).optional(),countSource:eE.default("reported")}).superRefine((t,e)=>{t.scope==="subject"&&!t.subjectType&&e.addIssue({code:"custom",path:["subjectType"],message:"subjectType is required when resource scope is subject"}),t.scope==="subscription"&&t.subjectType&&e.addIssue({code:"custom",path:["subjectType"],message:"subjectType is only valid for subject-scoped counted resources"})}),vy=s.array(rE).max(100).default([]);var nE=/^[a-z0-9][a-z0-9_-]*$/,by=s.string().min(1).max(64).regex(nE,"backend id must be a lowercase slug ([a-z0-9][a-z0-9_-]*)"),oE=s.enum(["direct","tunnel"]),iE=s.enum(["embedded","sidecar"]);var aE=s.object({mode:oE.default("direct"),runner:iE.optional()}).strict(),sE=s.object({required:s.boolean().default(!1)}).strict(),cE=s.object({url:s.string().url().optional(),hostname:s.string().min(1).max(255).optional(),weight:s.number().int().min(0).max(1e3).optional()}).strict(),uE=s.discriminatedUnion("policy",[s.object({policy:s.literal("single")}).strict(),s.object({policy:s.literal("weighted")}).strict()]),lE=s.object({name:s.string().min(1).max(120).optional(),slug:by.optional(),transport:aE.default({mode:"direct"}),verification:sE.default({required:!1}),meters:s.array(s.string().min(1).max(64)).max(100).optional(),default:s.boolean().optional(),originUrl:s.string().url().optional(),originHostname:s.string().min(1).max(255).optional(),endpoints:s.array(cE).optional(),selection:uE.optional()}).strict(),ky=s.record(by,lE),Bo=by,Ho={unknownBackendInRoute:"UNKNOWN_BACKEND_IN_ROUTE",ambiguousDefaultBackend:"AMBIGUOUS_DEFAULT_BACKEND",routeMeterNotAllowedByBackend:"ROUTE_METER_NOT_ALLOWED_BY_BACKEND",unknownMeterInBackend:"UNKNOWN_METER_IN_BACKEND",multiEndpointNotSupported:"BACKEND_MULTI_ENDPOINT_NOT_SUPPORTED"};function xy(t){let e=Object.keys(t??{});if(e.length===0)return{defaultId:null,ambiguous:!1};if(e.length===1)return{defaultId:e[0],ambiguous:!1};let n=e.filter(o=>t[o]?.default===!0);return n.length===1?{defaultId:n[0],ambiguous:!1}:{defaultId:null,ambiguous:!0}}var WL=s.string().min(2).max(20).regex(/^\d+(ms|s|m|h)$/,"rate_limit window must look like `60s`, `5m`, `1h`"),dE=s.object({strategy:s.enum(["token_bucket","sliding_window","fixed_window"]).default("token_bucket"),dimensions:s.array(s.enum(["subscription","credential","ip","route"])).min(1).max(4).default(["subscription"]),limits:s.array(s.object({window:WL,max:s.number().int().positive().max(1e7)})).min(1).max(10),fail_open:s.object({max_consecutive_failures:s.number().int().positive().default(100),max_window_seconds:s.number().int().positive().default(60),recovery_threshold:s.number().int().positive().default(50),degraded_mode:s.enum(["safe_mode_block","safe_mode_throttle","runtime_killswitch_trigger"]).default("safe_mode_throttle")}).default({max_consecutive_failures:100,max_window_seconds:60,recovery_threshold:50,degraded_mode:"safe_mode_throttle"})}),pE=s.object({header_name:s.string().min(1).max(100).default("x-api-key"),upstream_token_source:s.discriminatedUnion("type",[s.object({type:s.literal("none")}),s.object({type:s.literal("static_bearer"),token_secret_ref:s.string().min(1).max(200).describe("Reference into the secret store (e.g. CF Secret name); not the raw token")})]).default({type:"none"}),scope_mode:s.enum(["strict","advisory","off"]).default("strict")}),mE=s.object({max_in_flight:s.number().int().positive().max(1e4),dimensions:s.array(s.enum(["subscription","credential","capability"])).min(1).max(3).default(["subscription"]),capability:s.string().min(1).max(120).optional(),lease_ttl_seconds:s.number().int().positive().max(600).default(30),fail_open:s.object({max_consecutive_failures:s.number().int().positive().default(50),max_window_seconds:s.number().int().positive().default(60),recovery_threshold:s.number().int().positive().default(20),degraded_mode:s.enum(["safe_mode_block","safe_mode_throttle","runtime_killswitch_trigger"]).default("safe_mode_throttle")}).default({max_consecutive_failures:50,max_window_seconds:60,recovery_threshold:20,degraded_mode:"safe_mode_throttle"})}),fE=s.object({max_attempts:s.number().int().min(1).max(5).default(2),retry_on_status:s.array(s.number().int().min(400).max(599)).min(1).max(20).default([502,503,504]),backoff:s.object({initial_ms:s.number().int().positive().max(5e3).default(100),multiplier:s.number().positive().max(10).default(2),jitter:s.enum(["none","full","equal"]).default("equal"),total_budget_ms:s.number().int().positive().max(3e4).default(5e3)}).default({initial_ms:100,multiplier:2,jitter:"equal",total_budget_ms:5e3})}),hE=s.object({applies_to:s.enum(["request","response","both"]).default("request"),rewrites:s.array(s.object({source:s.string().min(1).max(200),target:s.string().min(1).max(200).nullable()})).min(1).max(20)});var Sy=s.discriminatedUnion("type",[s.object({type:s.literal("rate_limit"),config:dE}),s.object({type:s.literal("auth"),config:pE}),s.object({type:s.literal("concurrency"),config:mE}),s.object({type:s.literal("retry"),config:fE}),s.object({type:s.literal("transform"),config:hE})]);var jd=s.enum(["long","short","blocking"]).default("long"),gE=s.object({route_types:s.array(s.enum(["http"])).max(5).optional(),meters:s.array(s.string().min(1).max(64)).max(20).optional(),auth_modes:s.array(s.enum(["api_key","oauth2","anonymous"])).max(5).optional()});var $y=s.intersection(s.object({name:s.string().min(1).max(64).regex(/^[a-z0-9_-]+$/,"Policy name must be lowercase alphanumeric with hyphens/underscores"),description:s.string().max(500).optional(),compatible_with:gE.default({}),mutation_class:s.enum(["runtime","contractual"]).default("runtime"),cacheProfile:jd}),Sy);var JL=s.enum(["query","mutation"]),YL=s.enum(["none","metadata","full"]),XL=s.object({type:s.string().min(1).max(64).regex(/^[a-zA-Z0-9_.:-]+$/),from:s.enum(["header","path_param"]),name:s.string().min(1).max(120)}),QL=s.object({resource:s.string().min(1).max(100).regex(/^[a-z0-9_.:-]+$/),effect:s.enum(["create","delete"])}),_E=s.object({id:s.string().min(1).max(160).regex(/^[a-z0-9_.:-]+$/),title:s.string().min(1).max(160).optional(),kind:JL,actorType:s.string().min(1).max(64).regex(/^[a-zA-Z0-9_.:-]+$/).optional(),subject:XL.optional(),inputSchemaRef:s.string().min(1).max(240).optional(),audit:YL.default("metadata"),resource:QL.optional()});var yE=s.object({method:s.enum(["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS","*"]).default("*"),path:s.string().min(1).max(500).regex(/^\/[a-zA-Z0-9_/:.{}*-]*$/,"path must start with / and contain only [a-zA-Z0-9_/:.{}*-]")});function eM(t){let e=t.trim();if(!e)return!1;let[n,o,r]=e.split("-");if(r!==void 0||!/^\d{3}$/.test(n??""))return!1;let i=Number(n),a=o===void 0?i:Number(o);return o!==void 0&&!/^\d{3}$/.test(o)?!1:i>=100&&i<=599&&a>=100&&a<=599&&i<=a}function vE(t){return t.split(",").every(eM)}var Ud=s.union([s.string().min(1).max(100).refine(vE,{message:"onStatusCodes must be comma-separated HTTP status codes or numeric ranges, e.g. 200-299,304"}),s.array(s.number().int().min(100).max(599)).min(1).max(100)]),bE=s.enum(["public","required"]),kE=s.enum(["network","5xx"]),xE=s.object({maxAttempts:s.number().int().min(1).max(3),retryOn:s.array(kE).min(1).max(2),backoff:s.object({base:s.number().int().min(0).max(6e4),max:s.number().int().min(0).max(6e4),jitter:s.number().min(0).max(1)}).strict().refine(t=>t.max>=t.base,{message:"retry.backoff.max must be >= retry.backoff.base"}),budgetRatio:s.number().min(0).max(1)}).strict(),SE=s.object({authMode:bE.optional(),timeoutMs:s.number().int().min(1).max(6e5).optional(),idleTimeoutMs:s.number().int().min(1).max(6e5).optional(),retry:xE.optional()}).strict(),Ld=s.object({dimension:s.string().min(1).max(64).default("requests"),window:s.union([s.object({type:s.literal("named"),name:s.enum(["second","minute","hour","day","week","month"])}),s.object({type:s.literal("custom"),seconds:s.number().int().positive(),label:s.string().min(1).max(64).optional()})]),capacity:s.number().nonnegative(),enforcement:s.enum(["enforce","track"]).default("enforce")}).strict(),$E=s.object({match:yE,metering:s.object({defaults:s.record(s.string().min(1).max(64),s.number().finite().nonnegative()).optional(),reports:s.array(s.string().min(1).max(64)).max(20).optional(),estimates:s.record(s.string().min(1).max(64),s.number().finite().nonnegative()).optional(),onStatusCodes:Ud.optional(),postStreamBilling:s.boolean().optional()}).optional(),unmetered:s.boolean().optional(),inheritDefaultMeters:s.boolean().optional(),action:s.string().min(1).max(160).regex(/^[a-z0-9_.:-]+$/).optional(),backend:Bo.optional(),usagePolicy:Cd.optional(),policy:SE.optional(),limits:s.array(Ld).min(1).max(8).optional()}).strict(),IE=s.object({override_origin:s.string().url("override_origin must be a valid URL").nullable().default(null)}),wE=s.object({rollout_key:s.string().min(1).max(120).regex(/^[a-z0-9_-]+$/,"rollout_key must be lowercase alphanumeric with hyphens/underscores").optional(),required_flags:s.array(s.string().min(1).max(120).regex(/^[a-z0-9_-]+$/)).max(10).optional()}),Iy=s.object({feature:s.string().min(1).max(100).regex(/^[a-z0-9_.:-]+$/,"feature key must be lowercase alphanumeric with [_.:-]"),description:s.string().max(500).optional(),mutation_class:s.enum(["runtime","contractual"]).default("contractual"),cacheProfile:jd,routes:s.array($E).min(1).max(50),upstream:IE.default({override_origin:null}),policies:s.array(s.string().min(1).max(64).regex(/^[a-z0-9_-]+$/)).max(20).default([]),runtime:wE.default({}),plans:s.array(s.string().min(1).max(64)).max(20).default([]),actions:s.array(_E).max(100).optional(),backend:Bo.optional()}).strict();function EE(t,e){t.usagePricing!==void 0&&e.addIssue({code:"custom",path:["usagePricing"],message:"usagePricing is not supported. Define usage.meters.<key>.rating instead."})}function TE(t,e){t.filter(o=>o.free).length>1&&e.addIssue({code:"custom",path:["plans"],message:"Only one free plan is allowed per product"}),t.forEach((o,r)=>{o.free&&(tM(o,r,e),rM(o,r,e))})}function tM(t,e,n){(zE(t)??0)!==0&&n.addIssue({code:"custom",path:["plans",e,"recurring_fee_cents"],message:"Free plans must have zero price"})}function rM(t,e,n){t.limits.some(r=>!r.enforcement||r.enforcement==="enforce")||n.addIssue({code:"custom",path:["plans",e,"limits"],message:"Free plans must include at least one hard enforced limit"})}function PE(t,e){let n=new Map;t.forEach((o,r)=>{if(o.free)return;let i=zE(o);if(i===void 0||i<=0)return;let a=sM(o,i),c=n.get(a);if(c){e.addIssue({code:"custom",path:["plans",r,"recurring_fee_cents"],message:`Paid plan price duplicates plan "${c}" (${a})`});return}n.set(a,o.key)})}function OE(t,e){let n=new Set((t.metering?.meters??[]).map(r=>r.key).filter(r=>typeof r=="string"&&r.length>0)),o=new Set(Object.keys(t.usage?.meters??{}));t.plans.forEach((r,i)=>{let a=r.meters;a&&a.forEach((c,u)=>{let d=c.dimension;typeof d!="string"||d.length===0||n.has(d)||o.has(d)||e.addIssue({code:"custom",path:["plans",i,"meters",u,"dimension"],message:`Plan "${r.key}" prices meter "${d}" but no metering.meters[] entry and no usage.meters[] entry declares it.`})})})}function RE(t,e){if(!t.features)return;let n=new Set(t.plans.map(o=>o.key));for(let[o,r]of Object.entries(t.features)){if(!r.plans)continue;r.plans.forEach((a,c)=>{n.has(a)||e.addIssue({code:"custom",path:["features",o,"plans",c],message:`Feature "${o}" references unknown plan "${a}"`})});let i=new Set;r.plans.forEach((a,c)=>{i.has(a)&&e.addIssue({code:"custom",path:["features",o,"plans",c],message:`Feature "${o}" lists plan "${a}" more than once`}),i.add(a)})}}function AE(t,e){if(!t.features)return;let n=new Set((t.metering?.meters??[]).map(r=>r.key).filter(r=>typeof r=="string"&&r.length>0)),o=!1;for(let[r,i]of Object.entries(t.features))(i.routes??[]).forEach((c,u)=>{let d=wy(c);d.length!==0&&(o=!0,d.forEach((l,p)=>{n.has(l)||e.addIssue({code:"custom",path:["features",r,"routes",u,"metering",p],message:`Route references unknown meter "${l}". Declare it in metering.meters[].`})}))});o&&n.size===0&&e.addIssue({code:"custom",path:["metering","meters"],message:"One or more routes declare metering keys but `metering.meters[]` is empty. Declare meters at the product level first."})}function nM(t,e){let n=new Map;for(let o of t.plans)n.set(o.key,new Set);if(!t.features){for(let o of n.values())for(let r of e)o.add(r);return n}for(let o of Object.values(t.features))oM(o,n);return n}function oM(t,e){let n=t.plans??[],o=t.routes??[];for(let r of n){let i=e.get(r);if(i)for(let a of o){if(a.unmetered===!0)continue;let c=wy(a);if(c.length>0){for(let u of c)i.add(u);continue}}}}function wy(t){let e=new Set;for(let n of Object.keys(t.metering?.defaults??{}))e.add(n);for(let n of t.metering?.reports??[])e.add(n);for(let n of Object.keys(t.metering?.estimates??{}))e.add(n);return[...e]}function iM(t){if(!t||typeof t!="object")return null;let e=t;return typeof e.dimension=="string"?e.dimension:null}var aM=new Set(["credits"]);function CE(t,e){if(!t.plans||t.plans.length===0)return;let n=new Set((t.metering?.meters??[]).map(i=>i.key).filter(i=>typeof i=="string"&&i.length>0)),o=new Set(Object.keys(t.usage?.meters??{})),r=nM(t,n);t.plans.forEach((i,a)=>{let c=i.limits??[],u=r.get(i.key)??new Set;c.forEach((d,l)=>{if(d&&typeof d=="object"?d.acknowledgeUnreachable===!0:!1)return;let m=iM(d);m&&(u.has(m)||o.has(m)||aM.has(m)||e.addIssue({code:"custom",path:["plans",a,"limits",l,"meter"],message:`Plan "${i.key}" limits meter "${m}" but no route in any granted feature emits this meter, and the meter is not declared under usage.meters either. Either grant a feature whose routes meter "${m}" to this plan, declare the meter under metering.meters[] or usage.meters, or set acknowledgeUnreachable: true if the limit is intentional (e.g. soft budget).`}))})})}function NE(t,e){let n=t.backend;if(!n||Object.keys(n).length===0)return;let o=new Set(Object.keys(n)),r=new Set((t.metering?.meters??[]).map(u=>u.key).filter(u=>typeof u=="string"&&u.length>0));for(let[u,d]of Object.entries(n))(d.meters??[]).forEach((l,p)=>{r.has(l)||e.addIssue({code:"custom",path:["backend",u,"meters",p],message:`${Ho.unknownMeterInBackend}: backend "${u}" allows meter "${l}" but no metering.meters[] entry declares it.`})});let{defaultId:i,ambiguous:a}=xy(n),c=!1;for(let u of Object.values(t.features??{}))for(let d of u.routes??[])d.backend===void 0&&(c=!0);a&&c&&e.addIssue({code:"custom",path:["backend"],message:`${Ho.ambiguousDefaultBackend}: product declares ${o.size} backends but no single default \u2014 mark exactly one backend \`default: true\` or bind every route explicitly.`});for(let[u,d]of Object.entries(t.features??{}))(d.routes??[]).forEach((l,p)=>{let m=l.backend??i;if(l.backend!==void 0&&!o.has(l.backend)){e.addIssue({code:"custom",path:["features",u,"routes",p,"backend"],message:`${Ho.unknownBackendInRoute}: route binds backend "${l.backend}" which is not declared in the product \`backend\` block.`});return}if(!m)return;let g=n[m]?.meters;if(!g)return;let v=new Set(g);for(let b of wy(l))v.has(b)||e.addIssue({code:"custom",path:["features",u,"routes",p,"metering"],message:`${Ho.routeMeterNotAllowedByBackend}: route meters "${b}" but backend "${m}" does not allow it (backend.meters[] = [${g.join(", ")}]).`})})}function zE(t){return t.recurring_fee_cents}function sM(t,e){return`USD:month:${e}`}var cM=s.object({subdomain:s.string().min(1).max(63).regex(/^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/,"Subdomain must be lowercase alphanumeric with optional hyphens")}),DE=s.enum(["exact_pre_request","estimated_then_settled","postpaid","strict_concurrency"]),uM=s.enum(ww),Ey=s.object({key:s.string().min(1).max(64).regex(/^[a-z0-9_]+$/,"Meter key must be lowercase alphanumeric with underscores"),display:s.string().min(1).max(100),unit:s.string().max(20).optional(),estimate:s.number().finite().nonnegative().optional(),routeDefault:s.number().finite().nonnegative().optional(),enforcementType:DE.default("estimated_then_settled"),aggregation:s.enum(["SUM","COUNT","MAX","UNIQUE_COUNT","LATEST"]).default("COUNT"),window:s.enum(["minute","hour","day","month","billing_period"]).default("billing_period"),valueProperty:s.string().optional(),uniqueProperty:s.string().optional(),groupBy:s.array(s.string()).optional(),eventCode:s.string().optional(),tokenCategory:uM.optional(),reserveStrategy:s.enum(["reserve_max","estimate","count_actual"]).optional(),reserveCeiling:s.number().int().positive().optional(),pairsWith:s.string().min(1).max(64).optional()}),jE=s.string().min(1).max(64).regex(/^[a-z0-9_]+$/,"Usage measure must be lowercase alphanumeric with underscores"),lM=s.enum(["pass_through","markup"]),dM=s.object({source:s.literal("fixed"),rates:s.record(s.string().min(1),s.record(jE,s.number().int().nonnegative()))}),pM=s.object({source:s.literal("provider_catalog"),catalog:s.string().min(1).max(100),pricePolicy:lM.default("pass_through"),markupPercent:s.number().nonnegative().max(1e4).optional(),marginMicros:s.number().int().nonnegative().optional()}),UE=s.discriminatedUnion("source",[dM,pM]),LE=s.object({selector:s.string().min(1).max(100).optional(),measures:s.array(jE).min(1).max(20),rating:UE.optional()}),ME=s.object({meters:s.record(s.string().min(1).max(64).regex(/^[a-z0-9_]+$/),LE)}),mM=s.object({defaults:s.record(s.string().min(1).max(64),s.number().finite().nonnegative()).optional(),reports:s.array(s.string().min(1).max(64)).max(20).optional(),estimates:s.record(s.string().min(1).max(64),s.number().finite().nonnegative()).optional(),onStatusCodes:Ud.optional(),postStreamBilling:s.boolean().optional()}),ZE=s.object({method:s.enum(["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS","*"]).default("*"),path:s.string().min(1).max(500).regex(/^\/[a-zA-Z0-9_/:.{}*-]*$/,"path must start with / and contain only [a-zA-Z0-9_/:.{}*-]"),unmetered:s.boolean().optional(),metering:mM.optional(),inheritDefaultMeters:s.boolean().optional(),backend:Bo.optional(),limits:s.array(Ld).min(1).max(8).optional()}).strict(),Ty=s.object({description:s.string().max(500).optional(),routes:s.array(ZE).min(1).max(50),plans:s.array(s.string().min(1)).min(1).max(20)}),FE=s.record(s.string().min(1).max(100).regex(/^[a-z0-9_.:-]+$/),Ty),VE=s.enum(["report","pull_request"]),qE=s.enum(["safe","non_blocking","economic_risk","blocking"]),BE=s.object({cleanup:s.object({enabled:s.boolean().default(!1),mode:VE.default("report")}).default({enabled:!1,mode:"report"}),change_approval:s.object({auto_merge_max_risk:s.enum(["none","safe","non_blocking"]).default("none"),require_human_for:s.array(qE).default(["economic_risk","blocking"])}).default({auto_merge_max_risk:"none",require_human_for:["economic_risk","blocking"]})}).default({cleanup:{enabled:!1,mode:"report"},change_approval:{auto_merge_max_risk:"none",require_human_for:["economic_risk","blocking"]}}),HE=s.enum(["org_only","org_and_user"]),KE=s.enum(["clerk","test-personas"]),GE=s.object({identity_requirement:HE.optional(),context_tokens:s.object({enabled:s.boolean().default(!0)}).optional(),portal_auth:s.object({strategy:KE}).optional()}),WE=s.enum(["frontend","api","docs","widget","dashboard","webhook","worker","agent"]),JE=s.object({key:s.string().min(1).max(64).regex(/^[a-z0-9_-]+$/,"Surface key must be lowercase alphanumeric with hyphens/underscores"),type:WE,display:s.string().min(1).max(100).optional(),description:s.string().max(500).optional()}),YE=s.object({key:s.string().min(1).max(64).regex(/^[a-z0-9_-]+$/,"Entitlement key must be lowercase alphanumeric with hyphens/underscores"),description:s.string().max(500).optional(),capabilities:s.array(s.string().min(1).max(100)).max(100).optional(),featureGates:s.record(s.string().min(1),s.boolean()).optional(),limits:s.array(Zr).max(100).optional(),meters:s.array(s.string().min(1).max(64)).max(100).optional()}),XE=s.array(JE).max(20).default([]),QE=s.array(YE).max(100).default([]),eT=s.enum(["async_job","agent_task","scheduled","lifecycle","background"]),tT=s.discriminatedUnion("type",[s.object({type:s.literal("manual")}),s.object({type:s.literal("schedule"),cron:s.string().min(1).max(120)}),s.object({type:s.literal("event"),event:s.string().min(1).max(120)}),s.object({type:s.literal("api"),path:s.string().min(1).max(240).regex(/^\//,"path must start with /")}),s.object({type:s.literal("lifecycle"),event:s.string().min(1).max(120)})]),rT=s.object({key:s.string().min(1).max(64).regex(/^[a-z0-9_-]+$/,"Workflow key must be lowercase alphanumeric with hyphens/underscores"),title:s.string().min(1).max(120).optional(),description:s.string().max(1e3).optional(),kind:eT,trigger:tT,capabilities:s.array(s.string().min(1).max(100)).max(100).optional(),meters:s.array(s.string().min(1).max(64)).max(100).optional(),estimates:s.record(s.string().min(1).max(64),s.number().finite()).optional(),metadata:s.record(s.string().min(1),s.unknown()).optional()}),nT=s.array(rT).max(100).default([]),gn=s.object({product:s.object({name:s.string().min(1).max(100),visibility:s.enum(["public","private"]).default("public"),rbac:s.union([s.boolean(),s.object({capability:s.string().min(1)}).strict()]).optional()}),gateway:s.object({authHeader:s.string().min(1).max(100).default("x-api-key"),upstreamAuth:s.object({type:s.enum(["none","static_bearer"]),token:s.string().optional()}).default({type:"none"})}),metering:s.object({meters:s.array(Ey).max(10).default([]),billOn4xx:s.boolean().default(!1)}).default({meters:[],billOn4xx:!1}),backend:ky.optional(),usage:ME.optional(),usagePricing:s.never({error:"usagePricing is not supported. Define usage.meters.<key>.rating instead."}).optional(),features:FE.optional(),resources:vy,policies:BE,customer_context:GE.optional(),surfaces:XE,entitlements:QE,workflows:nT,frontend:yy.optional(),billing:s.object({applyLimitUpgradesInstantly:s.boolean().optional(),subscriberChangePolicy:qo.default({default:"period_end",when:{price_increase:"period_end",price_decrease:"immediate",feature_added:"immediate",feature_removed:"period_end",limit_increased:"immediate",limit_reduced:"period_end",credit_increased:"immediate",credit_reduced:"period_end",rating_changed:"period_end"},allowImmediatePriceIncrease:!1,allowImmediateEntitlementReduction:!1})}).default({subscriberChangePolicy:{default:"period_end",when:{price_increase:"period_end",price_decrease:"immediate",feature_added:"immediate",feature_removed:"period_end",limit_increased:"immediate",limit_reduced:"period_end",credit_increased:"immediate",credit_reduced:"period_end",rating_changed:"period_end"},allowImmediatePriceIncrease:!1,allowImmediateEntitlementReduction:!1}}),plans:s.array(Dd).max(4).default([]),lifecycle:s.object({breaking_changes:s.object({require_deprecation_window_days:s.number().int().nonnegative().default(0),require_successor_route:s.boolean().default(!1)}).default({require_deprecation_window_days:0,require_successor_route:!1})}).default({breaking_changes:{require_deprecation_window_days:0,require_successor_route:!1}}),webhooks:fy.optional(),environments:hy.optional(),ephemeral:s.object({defaultPlan:s.string().min(1).optional()}).optional()}).superRefine((t,e)=>{EE(t,e),TE(t.plans,e),PE(t.plans,e),OE(t,e),RE(t,e),AE(t,e),CE(t,e),NE(t,e)}),fM=s.object({product:gn.shape.product}),hM=s.object({gateway:gn.shape.gateway}),gM=s.object({metering:gn.shape.metering}),_M=s.object({plans:gn.shape.plans});var Py=s.object({capability:s.string().min(1).max(120).regex(/^[a-z0-9_-]+$/,"capability name must be lowercase alphanumeric with hyphens/underscores"),description:s.string().max(500).optional(),mutation_class:s.enum(["runtime","contractual"]).default("contractual"),includes_features:s.array(s.string().min(1).max(100).regex(/^[a-z0-9_.:-]+$/)).max(20).default([]),includes_policies:s.array(s.string().min(1).max(64).regex(/^[a-z0-9_-]+$/)).max(20).default([]),includes_capabilities:s.array(s.string().min(1).max(120).regex(/^[a-z0-9_-]+$/)).max(20).default([])});var oT=1,iT="business",yM=`${iT}/business.ts`,vM=s.object({irVersion:s.literal(oT),sdkVersion:s.string().min(1).max(64),product:gn,routes:s.array(Iy).max(200).default([]),policies:s.array($y).max(200).default([]),capabilities:s.array(Py).max(200).default([])}).strict();var Q5=s.object({subscriberChangePolicy:qo.optional()}),e3=s.object({code:s.string(),kind:s.enum(["percent_off","amount_off","free_months"]),amount:s.number().optional(),durationMonths:s.number(),applicablePlanIds:s.array(s.string()).optional(),maxRedemptions:s.number().optional(),activeFrom:s.string().optional(),activeUntil:s.string().optional(),status:s.enum(["ACTIVE","ARCHIVED"]).optional()}),t3=s.object({id:s.string(),actorUserId:s.string().optional(),action:s.string(),decision:s.string().optional(),timestamp:s.string(),details:s.unknown().optional()}),r3=s.object({name:s.string(),branch:s.string().optional(),isProduction:s.boolean().optional()}),n3=s.object({id:s.string(),name:s.string(),apiKeyId:s.string().optional()});var bM=["IMMEDIATE_NO_PRORATE","IMMEDIATE_PRORATE_CHARGE_NEW","IMMEDIATE_PRORATE_REFUND_OLD","IMMEDIATE_PRORATE_BOTH","DEFER_TO_PERIOD_END"],l3=s.enum(bM);var aT=s.object({id:s.string(),billingCycleId:s.string(),effectiveStart:s.string(),effectiveEnd:s.string(),compiledPlanId:s.string()}),sT=s.object({currentPeriod:aT,priorPeriod:aT.optional()});var kM=s.object({subjectKey:s.string(),subscriptionId:s.string(),subscriberId:s.string(),productId:s.string(),organizationId:s.string(),compiledPlanId:s.string(),activeEntitlementHash:s.string().optional(),generation:s.number(),enforcementMode:s.enum(["STRICT","GRACE","TRACK_ONLY"]),dedicatedShard:s.enum(["ACTIVE","DRAINING"]).optional(),resourceCounts:s.record(s.string(),s.number()).optional(),memberAuthz:s.record(s.string(),s.object({permissions:s.array(s.string()),roles:s.array(s.string())})).optional(),memberAuthzComputedAt:s.number().optional(),postStreamLockouts:s.array(s.object({code:s.literal("post_stream_overspend"),reason:s.literal("usage_exhausted"),constraintKey:s.string().min(1),cycleId:s.string().min(1),dimension:s.string().min(1),currentCapacity:s.number().nonnegative(),observedUsage:s.number().nonnegative(),lockedAt:s.string().min(1),expiresAt:s.string().min(1)})).optional(),subscriptionStatus:s.string(),subscriberStatus:s.string(),scopes:s.array(s.string()),periods:sT,expiresAt:s.number().optional(),trialEndsAt:s.string().optional()}),xM=s.discriminatedUnion("kind",[s.object({kind:s.literal("found"),state:kM,expiresAt:s.number(),ttlSeconds:s.number()}),s.object({kind:s.literal("not_found"),negativeCacheTtlSeconds:s.number().default(60)}),s.object({kind:s.literal("revoked"),negativeCacheTtlSeconds:s.number().default(300),reason:s.string().optional()}),s.object({kind:s.literal("rate_limited"),retryAfterSeconds:s.number().default(10)})]),g3=s.object({environmentId:s.string().nullable(),subjectKeys:s.array(s.string()).min(1).max(500)}),_3=s.object({results:s.array(s.object({subjectKey:s.string(),result:xM}))}),SM=s.object({keyId:s.string(),orgId:s.string(),productId:s.string(),compiledPlanId:s.string(),entitlementHash:s.string().optional(),subscriptionId:s.string(),subscriberId:s.string(),apiKeyId:s.string().nullable(),subjectKey:s.string(),entitlementVersion:s.number().int(),identityRequirement:s.enum(["org_only","org_and_user"]),status:s.enum(["active","revoked"]),subscriberStatus:s.enum(["ONBOARDING","ACTIVE","SUSPENDED"]),subscriptionStatus:s.string(),environment:s.enum(["production","sandbox"]).optional(),environmentId:s.string().optional(),scopes:s.array(s.string()).default([]),entitlement:s.unknown().optional(),actorType:s.enum(["org","user"]).optional(),actorId:s.string().nullable().optional(),currentPeriodId:s.string().optional(),currentPeriodStartMs:s.number().int().nonnegative().optional(),expiresAt:s.number().nullable().optional()}),y3=s.discriminatedUnion("kind",[s.object({kind:s.literal("found"),record:SM,expiresAt:s.number(),ttlSeconds:s.number()}),s.object({kind:s.literal("not_found"),negativeCacheTtlSeconds:s.number().default(60)}),s.object({kind:s.literal("revoked"),negativeCacheTtlSeconds:s.number().default(300),reason:s.string().optional()}),s.object({kind:s.literal("rate_limited"),retryAfterSeconds:s.number().default(10)})]),v3=s.discriminatedUnion("kind",[s.object({kind:s.literal("found"),entitlement:s.unknown(),expiresAt:s.number(),ttlSeconds:s.number()}),s.object({kind:s.literal("not_found"),negativeCacheTtlSeconds:s.number().default(60)}),s.object({kind:s.literal("rate_limited"),retryAfterSeconds:s.number().default(10)})]),$M=s.object({id:s.string(),origin:s.string(),sandboxOrigin:s.string().nullable().optional(),authHeader:s.string().optional(),pricing:s.record(s.string(),s.number()).optional(),metering:s.object({tokens:s.object({estimatePerRequest:s.number().optional()}).optional(),computeMs:s.object({estimatePerRequest:s.number().optional()}).optional(),billOn4xx:s.boolean().optional()}).optional(),tenantLimits:s.array(s.object({unit:s.enum(["requests","tokens","computeMs","dollars"]),window:s.enum(["second","minute","hour","day","week","month"]),capacity:s.number()})).optional(),userLimits:s.array(s.object({unit:s.enum(["requests","tokens","computeMs","dollars"]),window:s.enum(["second","minute","hour","day","week","month"]),capacity:s.number()})).optional(),environmentId:s.string().optional(),contextTokenSecret:s.string().nullable().optional(),timeoutMs:s.number().positive().optional(),idleTimeoutMs:s.number().positive().optional(),hasPublicRoutes:s.boolean().optional()}),b3=s.discriminatedUnion("kind",[s.object({kind:s.literal("found"),tenant:$M,expiresAt:s.number(),ttlSeconds:s.number()}),s.object({kind:s.literal("not_found"),negativeCacheTtlSeconds:s.number().default(60)}),s.object({kind:s.literal("rate_limited"),retryAfterSeconds:s.number().default(10)})]);var Md=["consumer_api_key","consumer_session_token","test_persona_session_token","builder_master_key","builder_session_token","maker_jwt","service_jwt","internal_service","context_token"],cT=s.enum(Md);var IM=s.object({fromIssuer:s.string().min(1),fromTokenId:s.string().min(1),intent:s.string().min(1)}),uT=s.object({issuer:s.string().min(1),issuedAt:s.number().int().nonnegative(),expiresAt:s.number().int().nonnegative().optional(),tokenId:s.string().min(1).optional(),delegationChain:s.array(IM)});var Oy=["template","embedded","provisioned","agent"],wM=s.enum(Oy),EM=["builder_user","builder_org","maker","consumer_subject","internal_service","service_jwt","agent_runtime"],TM=s.enum(EM),lT=s.object({kind:TM,id:s.string().min(1),label:s.string().optional()}),PM=["subscription","organization","platform"],OM=s.enum(PM),RM=s.object({kind:OM,id:s.string().min(1)}),AM=s.object({type:cT,id:s.string().min(1),hint:s.string().max(8).optional()}),CM=s.object({compiledPlanId:s.string().min(1),fromCache:s.boolean().optional()}),dT=s.object({requestId:s.string().min(1),surface:wM,builderOrgId:s.string().min(1),productId:s.string().min(1).optional(),runtimeId:s.string().min(1).optional(),template:s.string().optional(),caller:lT,actor:lT,billingSubject:RM,credential:AM,capability:s.string().min(1),scopes:s.array(s.string()),entitlement:CM.optional(),trust:uT});var us;(function(t){t.AUTHZ_DECISION="authz_decision",t.ENTITLEMENT_DECISION="entitlement_decision",t.RUNTIME_LIMIT_DECISION="runtime_limit_decision",t.RESOURCE_GOVERNANCE_DECISION="resource_governance_decision",t.RESOURCE_MUTATION="resource_mutation",t.LIFECYCLE_EVENT="lifecycle_event",t.RUNTIME_CONTEXT_CREATED="runtime_context_created",t.SYSTEM_ACTION="system_action"})(us||(us={}));var pT=Object.values(us),L3=s.enum(pT),mT=s.object({decisionId:s.string().optional(),ctx:dT,details:s.record(s.string(),s.unknown()).optional(),createdAt:s.string().min(1)}),NM=pT.filter(t=>t!==us.SYSTEM_ACTION),zM=mT.extend({kind:s.enum(NM)}),DM=mT.extend({kind:s.literal(us.SYSTEM_ACTION),actorType:s.string().min(1),action:s.string().min(1)}),M3=s.discriminatedUnion("kind",[zM,DM]);var ue=["template","agent"],jM=["provisioned"],fT=[...Oy],le=["builder_master_key","builder_session_token","maker_jwt"],Ko=["service_jwt","internal_service"],Ry=["consumer_api_key","consumer_session_token","test_persona_session_token","context_token"],hT=[...Md],ls="subscriptions:write",UM=[{id:"products.create",operation:"Create a product",requiredScopes:["products:write"],allowedSurfaces:ue,allowedCredentialTypes:le,description:"Create a new product in the builder org"},{id:"products.update",operation:"Update a product",requiredScopes:["products:write"],allowedSurfaces:ue,allowedCredentialTypes:le,description:"Update product metadata or compiled config"},{id:"products.delete",operation:"Delete a product",requiredScopes:["products:write"],allowedSurfaces:ue,allowedCredentialTypes:le,description:"Delete a product (soft-archive if subscriptions exist)"},{id:"products.read",operation:"Read a product",requiredScopes:["products:read"],allowedSurfaces:ue,allowedCredentialTypes:le,description:"Read product metadata + compiled config"},{id:"products.publish",operation:"Publish a product",requiredScopes:["products:write"],allowedSurfaces:ue,allowedCredentialTypes:le,description:"Compile + publish the product to the gateway"},{id:"plans.create",operation:"Create a plan",requiredScopes:["plans:write"],allowedSurfaces:ue,allowedCredentialTypes:le,description:"Add a new plan to a product"},{id:"plans.update",operation:"Update a plan",requiredScopes:["plans:write"],allowedSurfaces:ue,allowedCredentialTypes:le,description:"Update plan pricing, limits, or features"},{id:"plans.delete",operation:"Delete a plan",requiredScopes:["plans:write"],allowedSurfaces:ue,allowedCredentialTypes:le,description:"Delete a plan (denied if subscriptions are attached)"},{id:"plans.publish",operation:"Publish a plan",requiredScopes:["plans:write"],allowedSurfaces:ue,allowedCredentialTypes:le,description:"Mark a plan as available for new subscriptions"},{id:"subscriptions.create",operation:"Create a subscription",requiredScopes:[ls],allowedSurfaces:ue,allowedCredentialTypes:[...le,...Ko],description:"Provision a new subscription for a subscriber"},{id:"subscriptions.update",operation:"Update a subscription",requiredScopes:[ls],allowedSurfaces:ue,allowedCredentialTypes:[...le,...Ko],description:"Change plan, enforcement mode, or schedule"},{id:"subscriptions.cancel",operation:"Cancel a subscription",requiredScopes:[ls],allowedSurfaces:ue,allowedCredentialTypes:[...le,...Ko],description:"Cancel a subscription (immediate or end-of-period)"},{id:"subscriptions.pause",operation:"Pause a subscription",requiredScopes:[ls],allowedSurfaces:ue,allowedCredentialTypes:[...le,...Ko],description:"Pause a subscription (no usage, no billing)"},{id:"subscriptions.resume",operation:"Resume a subscription",requiredScopes:[ls],allowedSurfaces:ue,allowedCredentialTypes:[...le,...Ko],description:"Resume a paused subscription"},{id:"subscriptions.read",operation:"Read a subscription",requiredScopes:["subscriptions:read"],allowedSurfaces:ue,allowedCredentialTypes:[...le,...Ko],description:"Read subscription state and usage"},{id:"webhooks.create",operation:"Create a webhook endpoint",requiredScopes:["webhooks:write"],allowedSurfaces:ue,allowedCredentialTypes:le,description:"Register a new webhook endpoint URL"},{id:"webhooks.update",operation:"Update a webhook endpoint",requiredScopes:["webhooks:write"],allowedSurfaces:ue,allowedCredentialTypes:le,description:"Update endpoint URL, secret, or subscribed events"},{id:"webhooks.delete",operation:"Delete a webhook endpoint",requiredScopes:["webhooks:write"],allowedSurfaces:ue,allowedCredentialTypes:le,description:"Remove a webhook endpoint"},{id:"webhooks.test",operation:"Send a test webhook payload",requiredScopes:["webhooks:write"],allowedSurfaces:ue,allowedCredentialTypes:le,description:"Trigger a synthetic payload to verify an endpoint"},{id:"api-keys.create",operation:"Create an API key",requiredScopes:["api-keys:write"],allowedSurfaces:ue,allowedCredentialTypes:le,description:"Mint a new consumer or master API key"},{id:"api-keys.revoke",operation:"Revoke an API key",requiredScopes:["api-keys:write"],allowedSurfaces:ue,allowedCredentialTypes:le,description:"Revoke an API key (immediate invalidation)"},{id:"api-keys.read",operation:"Read API key metadata",requiredScopes:["api-keys:read"],allowedSurfaces:ue,allowedCredentialTypes:le,description:"Read key id + hint + scopes (never the secret)"},{id:"organizations.create",operation:"Create an organization",requiredScopes:["orgs:write"],allowedSurfaces:["template"],allowedCredentialTypes:["builder_session_token"],description:"Create a builder org (top-level signup)"},{id:"organizations.update",operation:"Update an organization",requiredScopes:["orgs:write"],allowedSurfaces:ue,allowedCredentialTypes:le,description:"Update org metadata or billing email"},{id:"members.invite",operation:"Invite a member to an organization",requiredScopes:["members:write"],allowedSurfaces:ue,allowedCredentialTypes:le,description:"Send an invitation to join the org"},{id:"members.remove",operation:"Remove a member from an organization",requiredScopes:["members:write"],allowedSurfaces:ue,allowedCredentialTypes:le,description:"Revoke a member's access to the org"},{id:"projects.create",operation:"Create a project",requiredScopes:["projects:write"],allowedSurfaces:ue,allowedCredentialTypes:le,description:"Create a project (groups products + environments)"},{id:"environments.create",operation:"Create an environment",requiredScopes:["environments:write"],allowedSurfaces:ue,allowedCredentialTypes:le,description:"Add a deployment environment (stage / branch)"},{id:"environments.delete",operation:"Delete an environment",requiredScopes:["environments:write"],allowedSurfaces:ue,allowedCredentialTypes:le,description:"Remove a deployment environment"},{id:"billing.portal-redirect",operation:"Generate Stripe customer-portal redirect",requiredScopes:["billing:portal"],allowedSurfaces:ue,allowedCredentialTypes:[...le,...Ry],description:"Mint a one-time Stripe portal-session redirect URL"},{id:"billing.read",operation:"Read billing state",requiredScopes:["billing:read"],allowedSurfaces:ue,allowedCredentialTypes:[...le,...Ry],description:"Read invoices, balances, scheduled changes"},{id:"runtime-context.read",operation:"Read the caller's runtime context",requiredScopes:[],allowedSurfaces:fT,allowedCredentialTypes:hT,description:"Introspect the resolved RuntimeContext (minus secrets)"},{id:"capabilities.list",operation:"List registered capabilities",requiredScopes:[],allowedSurfaces:fT,allowedCredentialTypes:hT,description:"List all capabilities the registry knows about"},{id:"explain-denial.read",operation:"Explain a denial decision",requiredScopes:["audit:read"],allowedSurfaces:ue,allowedCredentialTypes:le,description:"Look up a decision id + return the full ctx + reason"},{id:"replay.execute",operation:"Replay a historical billing period",requiredScopes:["replay:execute"],allowedSurfaces:ue,allowedCredentialTypes:le,description:"Re-run billing for a past period; verify deltas"},{id:"rollback.execute",operation:"Execute a GitHub-driven product rollback",requiredScopes:["rollback:execute"],allowedSurfaces:ue,allowedCredentialTypes:le,description:"Revert business.ts to a previous commit (dry-run capable)"},{id:"api.invoke",operation:"Invoke a consumer-facing gateway route",requiredScopes:[],allowedSurfaces:jM,allowedCredentialTypes:Ry,description:"Consumer-side traffic into a deployed product (catch-all). The EntitlementEngine + RuntimeLimitEngine handle the fine-grained gating; this capability is the umbrella entry-point."}],q3=Object.freeze(UM);var LM=["BusinessApplyWorkflow","RollbackWorkflow","StripeSyncWorkflow","WebhookDispatchWorkflow","SubscriptionTransitionWorkflow","CompiledPlanLifecycleWorkflow","ShardReshardWorkflow","MaintenanceJobWorkflow"],G3=s.enum(LM),MM=["transient","permanent","rollback-required","human-intervention"],W3=s.enum(MM);var ZM=["SAFE_AUTOMATIC","REQUIRES_APPROVAL","IRREVERSIBLE","BILLING_IMPACTING","EDGE_BREAKING"],J3=s.enum(ZM);var rJ=s.object({workflowExecutionId:s.string().min(1),eventType:s.string().min(1),phase:s.string().min(1).optional(),stepId:s.string().min(1).optional(),cohortKey:s.string().min(1).optional(),payload:s.record(s.string(),s.unknown()),occurredAt:s.string().min(1),correlationId:s.string().min(1).optional()}).transform(t=>({...t,workflowExecutionId:t.workflowExecutionId,stepId:t.stepId===void 0?void 0:t.stepId}));var FM=["GATEWAY","HOSTED_UI_PAGE","HOSTED_UI_PROXY"],VM=["platform_requests"],qM=s.object({requestId:s.string().optional(),productId:s.string().optional(),route:s.string().optional(),usageEventId:s.string().optional()}).strict(),BM=s.object({organizationId:s.string().min(1),source:s.enum(FM),dimension:s.enum(VM),quantity:s.number().int().positive(),idempotencyKey:s.string().min(1).max(512),occurredAt:s.string().datetime(),metadata:qM.optional()}).strict(),$J=s.object({entries:s.array(BM).min(1).max(500)});var gT={contract:{label:"Managed as code",summary:"Declarative product state, canonical in the GitHub repo; the API returns 409 MANAGED_BY_CODE once published. Author via the manifest + push.",canonicalHome:"repo",mcpMayWrite:!1},operate:{label:"Runtime operation",summary:"Imperative action on the running platform; never in the repo. Tokens, usage, readiness, builds, publish triggers, runtime knobs, brand edits.",canonicalHome:"api",mcpMayWrite:!0},dual:{label:"Repo or API",summary:"Reconciles via either the repo or the API/MCP; both converge to the same state. Preview environments are the canonical example.",canonicalHome:"both",mcpMayWrite:!0}};function HM(t){return gT[t].mcpMayWrite}function KM(t){return gT[t].canonicalHome}function _T(t,e){return e==="write"&&!HM(t)?`An MCP tool that writes cannot have operationClass "${t}": ${t}-class state is managed as code in the business repo (canonical home: ${KM(t)}). Make the tool read-only, or author the change in the manifest and push instead.`:null}var et={VALIDATION_ERROR:"VALIDATION_ERROR",CONFLICT:"CONFLICT",NOT_FOUND:"NOT_FOUND",NOT_IMPLEMENTED:"NOT_IMPLEMENTED",NOT_CONFIGURED:"NOT_CONFIGURED",INTERNAL_ERROR:"INTERNAL_ERROR",SERVICE_UNAVAILABLE:"SERVICE_UNAVAILABLE",RATE_LIMIT_EXCEEDED:"RATE_LIMIT_EXCEEDED",DELETE_CONFIRMATION_REQUIRED:"DELETE_CONFIRMATION_REQUIRED",MISSING_HOST:"MISSING_HOST",MISSING_CONNECTIONS:"MISSING_CONNECTIONS",SECRET_NOT_CONFIGURED:"SECRET_NOT_CONFIGURED",UNAUTHORIZED:"UNAUTHORIZED",FORBIDDEN:"FORBIDDEN",SEALED_VARIABLE:"SEALED_VARIABLE",INVALID_ACCESS_KEY:"INVALID_ACCESS_KEY",AUTO_KEY_CREATION_FAILED:"AUTO_KEY_CREATION_FAILED",PERSONA_NOT_FOUND:"PERSONA_NOT_FOUND",PERSONA_REVOKED:"PERSONA_REVOKED",PERSONA_SESSIONS_NOT_SUPPORTED:"PERSONA_SESSIONS_NOT_SUPPORTED",NOT_TEST_PERSONA_ENV:"NOT_TEST_PERSONA_ENV",PERSONA_AUTH_DISABLED_IN_PROD:"PERSONA_AUTH_DISABLED_IN_PROD",MAKER_TOKEN_NOT_FOUND:"MAKER_TOKEN_NOT_FOUND",MAKER_TOKEN_NOT_REVOKED:"MAKER_TOKEN_NOT_REVOKED",MAKER_TOKEN_NO_PRODUCT:"MAKER_TOKEN_NO_PRODUCT",MAKER_TOKEN_REVOKED:"MAKER_TOKEN_REVOKED",ORGANIZATION_NOT_FOUND:"ORGANIZATION_NOT_FOUND",ORG_HAS_ACTIVE_SUBSCRIPTIONS:"ORG_HAS_ACTIVE_SUBSCRIPTIONS",ORG_HAS_OUTSTANDING_BALANCE:"ORG_HAS_OUTSTANDING_BALANCE",PERSONAL_ORG_NOT_DELETABLE:"PERSONAL_ORG_NOT_DELETABLE",PERSONAL_OWNER_IMMUTABLE:"PERSONAL_OWNER_IMMUTABLE",PERSONAL_CO_OWNER_NOT_ALLOWED:"PERSONAL_CO_OWNER_NOT_ALLOWED",PRIMARY_OWNER_TRANSFER_REQUIRED:"PRIMARY_OWNER_TRANSFER_REQUIRED",MEMBER_NOT_FOUND:"MEMBER_NOT_FOUND",INVITATION_NOT_FOUND:"INVITATION_NOT_FOUND",RBAC_REQUIRES_TEAM_ORG:"RBAC_REQUIRES_TEAM_ORG",RBAC_NOT_ENABLED_BY_PRODUCT:"RBAC_NOT_ENABLED_BY_PRODUCT",RBAC_CAPABILITY_NOT_GRANTED:"RBAC_CAPABILITY_NOT_GRANTED",UNKNOWN_PERMISSION:"UNKNOWN_PERMISSION",CUSTOMER_NOT_FOUND:"CUSTOMER_NOT_FOUND",PRODUCT_NOT_FOUND:"PRODUCT_NOT_FOUND",PRODUCT_DELETE_BLOCKED:"PRODUCT_DELETE_BLOCKED",PRODUCT_REPO_NOT_LINKED:"PRODUCT_REPO_NOT_LINKED",PRODUCT_SCOPE_MISMATCH:"PRODUCT_SCOPE_MISMATCH",YAML_PARSE_ERROR:"YAML_PARSE_ERROR",COMPILATION_NOT_FOUND:"COMPILATION_NOT_FOUND",PLAN_NOT_FOUND:"PLAN_NOT_FOUND",PLAN_HAS_ACTIVE_SUBSCRIPTIONS:"PLAN_HAS_ACTIVE_SUBSCRIPTIONS",PLAN_SLUG_CONFLICT:"PLAN_SLUG_CONFLICT",PLAN_UPGRADE_REQUIRED:"PLAN_UPGRADE_REQUIRED",PLAN_OFFER_CHANGED:"PLAN_OFFER_CHANGED",SLUG_CONFLICT:"SLUG_CONFLICT",SLUG_BLOCKED:"SLUG_BLOCKED",SLUG_OFFENSIVE:"SLUG_OFFENSIVE",SLUG_RESERVED:"SLUG_RESERVED",SLUG_IMPERSONATION:"SLUG_IMPERSONATION",SLUG_INVALID_FORMAT:"SLUG_INVALID_FORMAT",SLUG_VALIDATOR_NOT_READY:"SLUG_VALIDATOR_NOT_READY",PRICING_PREVIEW_FAILED:"PRICING_PREVIEW_FAILED",PRICING_REPLAY_FAILED:"PRICING_REPLAY_FAILED",RESERVATION_NOT_FOUND:"RESERVATION_NOT_FOUND",PROMO_CODE_NOT_FOUND:"PROMO_CODE_NOT_FOUND",PROMO_CODE_INVALID:"PROMO_CODE_INVALID",BILLING_EVENT_NOT_FOUND:"BILLING_EVENT_NOT_FOUND",BILLING_NOT_CONFIGURED:"BILLING_NOT_CONFIGURED",SUBSCRIPTION_NOT_READY:"SUBSCRIPTION_NOT_READY",SUBSCRIPTION_FETCH_FAILED:"SUBSCRIPTION_FETCH_FAILED",INVALID_STATE:"INVALID_STATE",DUPLICATE_TRANSITION:"DUPLICATE_TRANSITION",LEGACY_STABLE_NOT_SELF_SERVICE:"LEGACY_STABLE_NOT_SELF_SERVICE",ARCHIVED_TARGET:"ARCHIVED_TARGET",FREE_TO_PAID_VIA_CHECKOUT_ONLY:"FREE_TO_PAID_VIA_CHECKOUT_ONLY",CAPABILITY_LIMIT_EXCEEDED:"CAPABILITY_LIMIT_EXCEEDED",CAPABILITY_CHECK_UNAVAILABLE:"CAPABILITY_CHECK_UNAVAILABLE",STRIPE_NOT_CONFIGURED:"STRIPE_NOT_CONFIGURED",STRIPE_BALANCE_OUTSTANDING:"STRIPE_BALANCE_OUTSTANDING",STRIPE_OPERATION_FAILED:"STRIPE_OPERATION_FAILED",STRIPE_RESYNC_FAILED:"STRIPE_RESYNC_FAILED",CHECKOUT_SESSION_FAILED:"CHECKOUT_SESSION_FAILED",POLAR_PRODUCT_NOT_CONFIGURED:"POLAR_PRODUCT_NOT_CONFIGURED",BILLING_TAX_NOT_ENROLLED:"BILLING_TAX_NOT_ENROLLED",WEBHOOK_NOT_FOUND:"WEBHOOK_NOT_FOUND",WEBHOOK_DISPATCH_FAILED:"WEBHOOK_DISPATCH_FAILED",WEBHOOK_SECRET_NOT_CONFIGURED:"WEBHOOK_SECRET_NOT_CONFIGURED",INVALID_WEBHOOK_SIGNATURE:"INVALID_WEBHOOK_SIGNATURE",MISSING_RAW_BODY:"MISSING_RAW_BODY",WEBHOOK_REDIRECTED:"WEBHOOK_REDIRECTED",MANAGED_BY_CODE:"MANAGED_BY_CODE",GITHUB_CONNECTION_NOT_FOUND:"GITHUB_CONNECTION_NOT_FOUND",GITHUB_NOT_CONNECTED:"GITHUB_NOT_CONNECTED",GITHUB_SYNC_FAILED:"GITHUB_SYNC_FAILED",GITHUB_SYNC_UNAVAILABLE:"GITHUB_SYNC_UNAVAILABLE",GITHUB_TOKEN_FAILED:"GITHUB_TOKEN_FAILED",GIT_PROVIDER_NOT_CONFIGURED:"GIT_PROVIDER_NOT_CONFIGURED",ENVIRONMENT_NOT_FOUND:"ENVIRONMENT_NOT_FOUND",ENVIRONMENT_CLEANUP_FAILED:"ENVIRONMENT_CLEANUP_FAILED",DEPLOYMENT_RUN_NOT_FOUND:"DEPLOYMENT_RUN_NOT_FOUND",BRANCH_NO_MATCHING_ENV:"BRANCH_NO_MATCHING_ENV",APPLY_SPEC_FAILED:"APPLY_SPEC_FAILED",BOOTSTRAP_FAILED:"BOOTSTRAP_FAILED",JOB_ALREADY_RUNNING:"JOB_ALREADY_RUNNING",LOGO_DELETE_FAILED:"LOGO_DELETE_FAILED",LOGO_UPLOAD_FAILED:"LOGO_UPLOAD_FAILED",INVALID_LOGO_FORMAT:"INVALID_LOGO_FORMAT",CHANGE_SET_STALE:"CHANGE_SET_STALE",SIMULATION_STALE:"SIMULATION_STALE",IDEMPOTENCY_KEY_REUSED:"IDEMPOTENCY_KEY_REUSED",SELF_APPROVAL_FORBIDDEN:"SELF_APPROVAL_FORBIDDEN",HUMAN_APPROVAL_REQUIRED:"HUMAN_APPROVAL_REQUIRED",GOVERNED_BY_CHANGE_SET:"GOVERNED_BY_CHANGE_SET",COMPENSATION_REQUIRED:"COMPENSATION_REQUIRED",MIGRATION_TOO_LARGE:"MIGRATION_TOO_LARGE"};var PJ={missing_token:et.UNAUTHORIZED,invalid_token:et.UNAUTHORIZED,context_unverified:et.UNAUTHORIZED,missing_signature:et.UNAUTHORIZED,malformed_signature:et.UNAUTHORIZED,unknown_key_id:et.UNAUTHORIZED,bad_signature:et.UNAUTHORIZED,expired_signature:et.UNAUTHORIZED,clock_skew:et.UNAUTHORIZED,replayed_nonce:et.UNAUTHORIZED,body_hash_mismatch:et.UNAUTHORIZED,route_mismatch:et.UNAUTHORIZED,environment_mismatch:et.UNAUTHORIZED,jwks_unavailable:et.SERVICE_UNAVAILABLE,body_too_large:et.VALIDATION_ERROR};var OJ=Object.values(Pw);var xe={BATCHER_ENUM:"batcher-enum",RUNTIME_INLINE:"runtime-inline",CONSTRAINT:"constraint",GATEWAY_ERROR:"gateway-error"};var yT={limit_allocator_unavailable:{statuses:[503],source:xe.BATCHER_ENUM,retryAfter:!0,verifiedAt:["engine/enforcement/runtime.ts:471"]},limit_exceeded:{statuses:[402],source:xe.BATCHER_ENUM,retryAfter:!0,verifiedAt:["engine/enforcement/batcher.ts:326","engine/enforcement/constraints/quota.ts:69"]},rate_limited:{statuses:[429],source:xe.BATCHER_ENUM,retryAfter:!0,verifiedAt:["engine/enforcement/batcher.ts:328","engine/enforcement/constraints/rate-limit.ts:74","engine/pipeline/rate-limit.ts:83"]},credit_exhausted:{statuses:[402],source:xe.BATCHER_ENUM,retryAfter:!0,verifiedAt:["engine/enforcement/batcher.ts:333"]},enforcement_denied:{statuses:[402],source:xe.BATCHER_ENUM,retryAfter:!0,verifiedAt:["engine/enforcement/batcher.ts:335"]},feature_not_enabled:{statuses:[403],source:xe.RUNTIME_INLINE,retryAfter:!1,verifiedAt:["engine/enforcement/runtime.ts:188"]},invalid_entitlement_shape:{statuses:[503],source:xe.RUNTIME_INLINE,retryAfter:!0,verifiedAt:["engine/enforcement/runtime.ts:144"]},unsupported_constraint_schema:{statuses:[503],source:xe.RUNTIME_INLINE,retryAfter:!1,verifiedAt:["engine/enforcement/runtime.ts:154"]},enforcement_error:{statuses:[500],source:xe.RUNTIME_INLINE,retryAfter:!1,verifiedAt:["engine/enforcement/runtime.ts:342"]},enforcement_dependency_unavailable:{statuses:[503],source:xe.RUNTIME_INLINE,retryAfter:!1,verifiedAt:["engine/enforcement/runtime.ts:427"]},concurrency_limit_exceeded:{statuses:[429],source:xe.CONSTRAINT,retryAfter:!0,verifiedAt:["engine/enforcement/constraints/concurrency.ts"]},concurrency_context_unavailable:{statuses:[503],source:xe.CONSTRAINT,retryAfter:!0,verifiedAt:["engine/enforcement/constraints/concurrency.ts:291"]},concurrency_coordinator_unavailable:{statuses:[503],source:xe.CONSTRAINT,retryAfter:!0,verifiedAt:["engine/enforcement/constraints/concurrency.ts:305"]},key_expired:{statuses:[401],source:xe.CONSTRAINT,retryAfter:!1,verifiedAt:["engine/enforcement/constraints/credential-validity.ts:33"]},permission_denied:{statuses:[403],source:xe.CONSTRAINT,retryAfter:!1,verifiedAt:["engine/enforcement/constraints/permission.ts:63"]},permission_unresolved:{statuses:[403],source:xe.CONSTRAINT,retryAfter:!1,verifiedAt:["engine/enforcement/constraints/permission.ts"]},geo_context_unavailable:{statuses:[503],source:xe.CONSTRAINT,retryAfter:!0,verifiedAt:["engine/enforcement/constraints/geo-restriction.ts:44"]},geo_blocked:{statuses:[403],source:xe.CONSTRAINT,retryAfter:!1,verifiedAt:["engine/enforcement/constraints/geo-restriction.ts:51"]},geo_not_allowed:{statuses:[403],source:xe.CONSTRAINT,retryAfter:!1,verifiedAt:["engine/enforcement/constraints/geo-restriction.ts:58"]},resource_count_limit_exceeded:{statuses:[403,402],source:xe.CONSTRAINT,retryAfter:!1,verifiedAt:["engine/enforcement/constraints/resource-count.ts:95","apps/core:routes/internal/gateway-resources.ts:144"]},post_stream_overspend:{statuses:[402],source:xe.CONSTRAINT,retryAfter:!0,verifiedAt:["engine/enforcement/constraints/lifecycle-block.ts"]},request_too_large:{statuses:[413],source:xe.CONSTRAINT,retryAfter:!1,verifiedAt:["engine/enforcement/constraints/capacity.ts"]},resolver_rate_limited:{statuses:[503],source:xe.GATEWAY_ERROR,retryAfter:!0,verifiedAt:["engine/errors.ts:55"]},resolver_unavailable:{statuses:[503],source:xe.GATEWAY_ERROR,retryAfter:!0,verifiedAt:["engine/errors.ts:73"]},credential_resolver_miss_rate_limited:{statuses:[429],source:xe.GATEWAY_ERROR,retryAfter:!0,verifiedAt:["engine/errors.ts:89"]},provider_throttled:{statuses:[503],source:xe.GATEWAY_ERROR,retryAfter:!0,verifiedAt:["engine/pipeline/provider-adapter.ts"]}},GM=Object.keys(yT);var WM=new Set([429,503]),AJ=new Set(GM.filter(t=>yT[t].statuses.every(e=>WM.has(e))));var JM=["quota","rate","concurrency","capacity","spend","adaptive"],NJ=new Set(JM);var YM=[402,403,413,429],DJ=new Set(YM);var HJ=s.object({targetUrl:s.string().url().refine(t=>t.startsWith("https://"),{message:"targetUrl must be https"}),variableName:s.string().min(1).regex(/^[A-Z][A-Z0-9_]*$/,{message:"variableName must be UPPER_SNAKE (e.g. MY_API_KEY)"}),header:s.string().min(1),template:s.string().min(1),method:s.string().min(1),body:s.unknown().optional()}).strict();import{existsSync as Cy,mkdirSync as XM,readFileSync as xT,writeFileSync as o8}from"node:fs";import{homedir as QM}from"node:os";import{join as Ny}from"node:path";var vT="https://core.farthershore.com";var zy=Ny(QM(),".farthershore"),bT=Ny(zy,"config.json"),kT=Ny(zy,"credentials.json");function e4(t){Cy(t)||XM(t,{recursive:!0,mode:448})}var Ay={apiUrl:vT};function ST(){if(e4(zy),!Cy(bT))return Ay;try{let t=JSON.parse(xT(bT,"utf-8"));return{...Ay,...t}}catch{return Ay}}function $T(){if(!Cy(kT))return null;try{return JSON.parse(xT(kT,"utf-8"))}catch{return null}}var O=class extends Error{constructor(n,o,r){super(n);this.status=o;this.name="CliError",this.code=r?.code,this.details=r?.details,this.param=r?.param}status;code;details;param};function IT(t){if(t)return t;let e=process.env.FARTHERSHORE_TOKEN;if(e)return e;let n=$T();if(n?.token)return n.token;throw new O("Not authenticated. Run `farthershore auth login` or set FARTHERSHORE_TOKEN environment variable.")}var Go="x-fs-surface",Wo="cli",t4="management";function Be(t,e){let n=new URLSearchParams;for(let[r,i]of Object.entries(e))i&&n.set(r,i);let o=n.toString();return o?`${t}?${o}`:t}function wT(t){let e=t.includes("?")?"&":"?";return`${t}${e}dry_run=true`}var r4=new Set([429,500,502,503,504]),n4=3,o4=3e4,ET=200,i4=4e3,a4=t=>new Promise(e=>setTimeout(e,t));function TT(t,e){if(e){let o=Number(e);if(Number.isFinite(o)&&o>=0)return Math.min(o*1e3,1e4)}return Math.min(ET*2**(t-1),i4)+Math.floor(Math.random()*ET)}function PT(t,e){let n=t.toUpperCase();return n==="GET"||n==="HEAD"?!0:"Idempotency-Key"in e}function OT(t){let e=t.retry?.attempts??n4,n=t.retry?.sleep??a4;async function o(l,p,m){let f=m?e:1,g;for(let v=1;v<=f;v++){let b=new AbortController,E=setTimeout(()=>b.abort(),o4);try{let N=await fetch(l,{...p,signal:b.signal});if(m&&v<f&&r4.has(N.status)){let z=N.headers?.get?.("retry-after")??null;await n(TT(v,z));continue}return N}catch(N){if(g=N,m&&v<f){await n(TT(v,null));continue}throw N}finally{clearTimeout(E)}}throw g}let r=null;async function i(){let l=await fetch(`${t.apiUrl}/auth/cli/exchange`,{method:"POST",headers:{Authorization:`Bearer ${t.token}`,"Content-Type":"application/json",[Go]:Wo}});if(!l.ok){let m=(await l.json().catch(()=>null))?.error,f=typeof m=="string"?{message:m}:m;throw new O(f?.message??l.statusText,l.status,{code:f?.code,details:f?.details})}return r=await l.json(),r}function a(l){return l.split("/",3)[1]===t4}async function c(l){if(!t.token.startsWith("mk_")||a(l))return t.token;let p=r?Date.parse(r.expiresAt):0;return(!r||p-Date.now()<6e4)&&await i(),r.accessToken}async function u(l,p,m,f){let g=await c(p),v=f?.dryRun?wT(p):p,b={Authorization:`Bearer ${g}`,"Content-Type":"application/json",[Go]:Wo};f?.idempotencyKey&&(b["Idempotency-Key"]=f.idempotencyKey);let E=await o(`${t.apiUrl}${v}`,{method:l,headers:b,body:m?JSON.stringify(m):void 0},f?.retryOnTransient===!1?!1:PT(l,b));if(!E.ok){let z=(await E.json().catch(()=>null))?.error,j=typeof z=="string"?{message:z}:z;throw new O(j?.message??E.statusText,E.status,{code:j?.code,details:j?.details})}if(E.status!==204)return E.json()}async function d(l,p,m,f,g){let v=await c(p),b=g?.dryRun?wT(p):p,E={Authorization:`Bearer ${v}`,"Content-Type":f,[Go]:Wo};g?.idempotencyKey&&(E["Idempotency-Key"]=g.idempotencyKey);let N=await o(`${t.apiUrl}${b}`,{method:l,headers:E,body:m},g?.retryOnTransient===!1?!1:PT(l,E));if(!N.ok){let j=(await N.json().catch(()=>null))?.error,D=typeof j=="string"?{message:j}:j;throw new O(D?.message??N.statusText,N.status,{code:D?.code,details:D?.details})}if(N.status!==204)return N.json()}return{exchangeCliToken:i,authWhoami:async()=>{if(t.token.startsWith("mk_")){let p=await u("GET","/management/whoami");return{kind:"maker",tokenId:p.tokenId,organizationId:p.organizationId,productId:p.productId,scopes:p.scopes}}return{kind:"builder",...await u("POST","/builder/context/bootstrap")}},bootstrap:()=>u("POST","/builder/context/bootstrap"),listProducts:()=>u("GET","/businesses"),initProduct:(l,p)=>u("POST","/businesses/init",l,p),updateProduct:(l,p,m,f)=>u("PATCH",Be(`/businesses/${l}`,{env:m?.env}),p,f),uploadBrandAsset:(l,p,m,f,g)=>d("PUT",`/businesses/${l}/${p}`,m,f,g),deleteBrandAsset:(l,p,m)=>u("DELETE",`/businesses/${l}/${p}`,void 0,m),publishProduct:(l,p,m)=>u("POST",`/businesses/${l}/publish`,p&&Object.keys(p).length>0?p:void 0,m),migratePlan:(l,p,m,f)=>u("POST",`/businesses/${l}/plans/${encodeURIComponent(p)}/migration-batches`,m,f),getProduct:(l,p)=>u("GET",Be(`/businesses/${l}`,{env:p?.env})),getDeployments:l=>u("GET",`/businesses/${l}/deployments`),listApplyTimeline:(l,p)=>u("GET",Be(`/businesses/${l}/apply-timeline`,{env:p?.env})),proposeConsumerChangeSet:(l,p,m,f,g)=>u("POST",Be(`/businesses/${l}/consumers/${encodeURIComponent(p)}/change-sets`,{env:f?.env}),m,g),listConsumerChangeSets:(l,p,m)=>u("GET",Be(`/businesses/${l}/consumers/${encodeURIComponent(p)}/change-sets`,{env:m?.env,status:m?.status,cursor:m?.cursor,limit:m?.limit!==void 0?String(m.limit):void 0})),getConsumerChangeSet:(l,p,m,f)=>u("GET",Be(`/businesses/${l}/consumers/${encodeURIComponent(p)}/change-sets/${encodeURIComponent(m)}`,{env:f?.env})),previewConsumerChangeSet:(l,p,m,f)=>u("POST",Be(`/businesses/${l}/consumers/${encodeURIComponent(p)}/change-sets/${encodeURIComponent(m)}/preview`,{env:f?.env})),compileManifest:(l,p,m)=>u("POST",`/businesses/${l}/manifest/compile`,{ir:p,...m?.env?{env:m.env}:{}}),listEnvironments:l=>u("GET",`/businesses/${l}/environments`),createEnvironment:(l,p,m)=>u("POST",`/businesses/${l}/environments`,p,m),deleteEnvironment:(l,p)=>u("DELETE",`/businesses/${l}/environments/${encodeURIComponent(p)}`),deleteProduct:(l,p)=>u("DELETE",`/businesses/${l}`,p?.deleteGitHubRepo?{deleteGitHubRepo:!0}:void 0),builderListConsumers:(l,p)=>u("GET",Be(`/businesses/${l}/consumers`,{env:p?.env})),builderBlockConsumer:(l,p)=>u("POST",`/businesses/${l}/consumers/${encodeURIComponent(p)}/block`),builderRemoveConsumer:(l,p)=>u("POST",`/businesses/${l}/consumers/${encodeURIComponent(p)}/remove`),builderAssignConsumerMemberRoles:(l,p,m,f)=>u("POST",`/businesses/${l}/consumers/${encodeURIComponent(p)}/members/${encodeURIComponent(m)}/roles`,{roles:f}),listPromoCodes:l=>u("GET",`/businesses/${l}/promo-codes`),createPromoCode:(l,p)=>u("POST",`/businesses/${l}/promo-codes`,p),updatePromoCode:(l,p,m)=>u("PATCH",`/businesses/${l}/promo-codes/${p}`,m),managementListPlans:l=>u("GET",`/management/businesses/${l}/plans`),managementGetUsage:l=>u("GET",`/management/businesses/${l}/usage`),managementListMakerTokens:()=>u("GET","/maker-tokens"),managementCreateMakerToken:(l,p)=>u("POST","/maker-tokens",l,p),managementRevokeMakerToken:l=>u("DELETE",`/maker-tokens/${l}`),managementRotateMakerToken:(l,p,m)=>u("POST",`/maker-tokens/${l}/rotate`,p,m),managementHardDeleteMakerToken:l=>u("DELETE",`/maker-tokens/${l}/hard`),managementListWebhooks:(l,p)=>u("GET",Be(`/management/businesses/${l}/webhooks`,{limit:p?.limit})),managementCreateWebhook:(l,p,m)=>u("POST",`/management/businesses/${l}/webhooks`,p,m),managementUpdateWebhook:(l,p,m,f)=>u("PATCH",`/management/businesses/${l}/webhooks/${p}`,m,f),managementDeleteWebhook:(l,p)=>u("DELETE",`/management/businesses/${l}/webhooks/${p}`),managementTestWebhook:(l,p)=>u("POST",`/management/businesses/${l}/webhooks/${p}/test`),managementListWebhookDeliveries:(l,p,m)=>u("GET",Be(`/management/businesses/${l}/webhooks/${p}/deliveries`,{limit:m?.limit})),builderListBackends:l=>u("GET",`/businesses/${l}/backends`),builderCreateBackend:(l,p,m)=>u("POST",`/businesses/${l}/backends`,p,m),builderDeleteBackend:(l,p)=>u("DELETE",`/businesses/${l}/backends/${p}`),builderListRuntimeTokens:l=>u("GET",`/businesses/${l}/runtime-tokens`),builderCreateRuntimeToken:(l,p,m)=>u("POST",`/businesses/${l}/runtime-tokens`,p,m),builderRotateRuntimeToken:(l,p,m)=>u("POST",`/businesses/${l}/runtime-tokens/${p}/rotate`,void 0,m),builderRevokeRuntimeToken:(l,p)=>u("DELETE",`/businesses/${l}/runtime-tokens/${p}`),builderFrontendDeploy:(l,p,m)=>u("POST",`/businesses/${l}/frontend/deploy`,p,m),builderFrontendStatus:(l,p)=>u("GET",`/businesses/${l}/frontend/status${p?`?environmentId=${encodeURIComponent(p)}`:""}`),builderFrontendReleases:(l,p)=>u("GET",`/businesses/${l}/frontend/releases${p?`?environmentId=${encodeURIComponent(p)}`:""}`),builderFrontendRollback:(l,p,m)=>u("POST",`/businesses/${l}/frontend/rollback`,p,m),builderListBulletin:(l,p)=>u("GET",Be(`/businesses/${l}/bulletin`,{kind:p?.kind,status:p?.status,cursor:p?.cursor,limit:p?.limit})),builderGetBulletinPost:(l,p)=>u("GET",`/businesses/${l}/bulletin/${encodeURIComponent(p)}`),builderSetBulletinStatus:(l,p,m)=>u("PATCH",`/businesses/${l}/bulletin/${encodeURIComponent(p)}`,{status:m}),builderListAgents:l=>u("GET",`/businesses/${l}/agents`),builderAgentStatus:(l,p)=>u("GET",`/businesses/${l}/agents/${encodeURIComponent(p)}`),builderAgentRunDetail:(l,p,m)=>u("GET",`/businesses/${l}/agents/${encodeURIComponent(p)}/runs/${encodeURIComponent(m)}`),builderConfigureAgent:(l,p,m,f)=>u("PUT",`/businesses/${l}/agents/${encodeURIComponent(p)}`,m,f),builderBusinessVariables:async(l,p)=>(await u("GET",Be(`/businesses/${l}/variables`,{environmentId:p}))).variables,builderSetBusinessVariable:async(l,p,m)=>(await u("PUT",`/businesses/${l}/variables/${encodeURIComponent(p)}`,m)).variable,builderRevealBusinessVariable:(l,p,m)=>u("GET",Be(`/businesses/${l}/variables/${encodeURIComponent(p)}/reveal`,{environmentId:m})),builderSealBusinessVariable:async(l,p,m)=>(await u("POST",Be(`/businesses/${l}/variables/${encodeURIComponent(p)}/seal`,{environmentId:m}))).data,builderDeleteBusinessVariable:(l,p,m)=>u("DELETE",Be(`/businesses/${l}/variables/${encodeURIComponent(p)}`,{environmentId:m})),builderGitHubStatus:()=>u("GET","/builder/git/github/status"),productStripeStatus:l=>u("GET",`/businesses/${l}/stripe/status`),issuePersonaBootstrapKey:async(l,p,m)=>{let f=await fetch(`${t.apiUrl}/portal/businesses/${l}/environments/${p}/test/bootstrap-key`,{method:"POST",headers:{Authorization:`Bearer ${t.token}`,"Content-Type":"application/json",[Go]:Wo},body:JSON.stringify(m??{})});if(!f.ok){let v=(await f.json().catch(()=>null))?.error,b=typeof v=="string"?{message:v}:v;throw new O(b?.message??f.statusText,f.status,{code:b?.code,details:b?.details})}return f.json()},listPersonas:async(l,p)=>{let m=await fetch(`${t.apiUrl}/portal/businesses/${l}/environments/${p}/test/personas`,{method:"GET",headers:{Authorization:`Bearer ${t.token}`,[Go]:Wo}});if(!m.ok){let g=(await m.json().catch(()=>null))?.error,v=typeof g=="string"?{message:g}:g;throw new O(v?.message??m.statusText,m.status,{code:v?.code,details:v?.details})}return m.json()},revokePersona:async(l,p,m)=>{let f=await fetch(`${t.apiUrl}/portal/businesses/${l}/environments/${p}/test/personas/${m}`,{method:"DELETE",headers:{Authorization:`Bearer ${t.token}`,[Go]:Wo}});if(!f.ok){let v=(await f.json().catch(()=>null))?.error,b=typeof v=="string"?{message:v}:v;throw new O(b?.message??f.statusText,f.status,{code:b?.code,details:b?.details})}return f.json()},getProductConfig:(l,p)=>u("GET",Be(`/businesses/${l}/config`,{format:"json",env:p?.env,state:p?.state})),updateProductConfigDraft:(l,p,m)=>u("PATCH",`/businesses/${l}/config/draft`,{spec:p,env:m?.env,branch:m?.branch,source:m?.source,baseDraftHash:m?.baseDraftHash})}}var RT=(t=0)=>e=>`\x1B[${e+t}m`,AT=(t=0)=>e=>`\x1B[${38+t};5;${e}m`,CT=(t=0)=>(e,n,o)=>`\x1B[${38+t};2;${e};${n};${o}m`,we={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},h8=Object.keys(we.modifier),s4=Object.keys(we.color),c4=Object.keys(we.bgColor),g8=[...s4,...c4];function u4(){let t=new Map;for(let[e,n]of Object.entries(we)){for(let[o,r]of Object.entries(n))we[o]={open:`\x1B[${r[0]}m`,close:`\x1B[${r[1]}m`},n[o]=we[o],t.set(r[0],r[1]);Object.defineProperty(we,e,{value:n,enumerable:!1})}return Object.defineProperty(we,"codes",{value:t,enumerable:!1}),we.color.close="\x1B[39m",we.bgColor.close="\x1B[49m",we.color.ansi=RT(),we.color.ansi256=AT(),we.color.ansi16m=CT(),we.bgColor.ansi=RT(10),we.bgColor.ansi256=AT(10),we.bgColor.ansi16m=CT(10),Object.defineProperties(we,{rgbToAnsi256:{value(e,n,o){return e===n&&n===o?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(n/255*5)+Math.round(o/255*5)},enumerable:!1},hexToRgb:{value(e){let n=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!n)return[0,0,0];let[o]=n;o.length===3&&(o=[...o].map(i=>i+i).join(""));let r=Number.parseInt(o,16);return[r>>16&255,r>>8&255,r&255]},enumerable:!1},hexToAnsi256:{value:e=>we.rgbToAnsi256(...we.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return 90+(e-8);let n,o,r;if(e>=232)n=((e-232)*10+8)/255,o=n,r=n;else{e-=16;let c=e%36;n=Math.floor(e/36)/5,o=Math.floor(c/6)/5,r=c%6/5}let i=Math.max(n,o,r)*2;if(i===0)return 30;let a=30+(Math.round(r)<<2|Math.round(o)<<1|Math.round(n));return i===2&&(a+=60),a},enumerable:!1},rgbToAnsi:{value:(e,n,o)=>we.ansi256ToAnsi(we.rgbToAnsi256(e,n,o)),enumerable:!1},hexToAnsi:{value:e=>we.ansi256ToAnsi(we.hexToAnsi256(e)),enumerable:!1}}),we}var l4=u4(),Lt=l4;import Dy from"node:process";import d4 from"node:os";import NT from"node:tty";function It(t,e=globalThis.Deno?globalThis.Deno.args:Dy.argv){let n=t.startsWith("-")?"":t.length===1?"-":"--",o=e.indexOf(n+t),r=e.indexOf("--");return o!==-1&&(r===-1||o<r)}var{env:Ee}=Dy,Zd;It("no-color")||It("no-colors")||It("color=false")||It("color=never")?Zd=0:(It("color")||It("colors")||It("color=true")||It("color=always"))&&(Zd=1);function p4(){if("FORCE_COLOR"in Ee)return Ee.FORCE_COLOR==="true"?1:Ee.FORCE_COLOR==="false"?0:Ee.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(Ee.FORCE_COLOR,10),3)}function m4(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function f4(t,{streamIsTTY:e,sniffFlags:n=!0}={}){let o=p4();o!==void 0&&(Zd=o);let r=n?Zd:o;if(r===0)return 0;if(n){if(It("color=16m")||It("color=full")||It("color=truecolor"))return 3;if(It("color=256"))return 2}if("TF_BUILD"in Ee&&"AGENT_NAME"in Ee)return 1;if(t&&!e&&r===void 0)return 0;let i=r||0;if(Ee.TERM==="dumb")return i;if(Dy.platform==="win32"){let a=d4.release().split(".");return Number(a[0])>=10&&Number(a[2])>=10586?Number(a[2])>=14931?3:2:1}if("CI"in Ee)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(a=>a in Ee)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(a=>a in Ee)||Ee.CI_NAME==="codeship"?1:i;if("TEAMCITY_VERSION"in Ee)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Ee.TEAMCITY_VERSION)?1:0;if(Ee.COLORTERM==="truecolor"||Ee.TERM==="xterm-kitty"||Ee.TERM==="xterm-ghostty"||Ee.TERM==="wezterm")return 3;if("TERM_PROGRAM"in Ee){let a=Number.parseInt((Ee.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Ee.TERM_PROGRAM){case"iTerm.app":return a>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Ee.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Ee.TERM)||"COLORTERM"in Ee?1:i}function zT(t,e={}){let n=f4(t,{streamIsTTY:t&&t.isTTY,...e});return m4(n)}var h4={stdout:zT({isTTY:NT.isatty(1)}),stderr:zT({isTTY:NT.isatty(2)})},DT=h4;function jT(t,e,n){let o=t.indexOf(e);if(o===-1)return t;let r=e.length,i=0,a="";do a+=t.slice(i,o)+e+n,i=o+r,o=t.indexOf(e,i);while(o!==-1);return a+=t.slice(i),a}function UT(t,e,n,o){let r=0,i="";do{let a=t[o-1]==="\r";i+=t.slice(r,a?o-1:o)+e+(a?`\r
|
|
74
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let s of t.seen.entries()){let c=s[1];if(e===s[0]){o(s);continue}if(t.external){let d=t.external.registry.get(s[0])?.id;if(e!==s[0]&&d){o(s);continue}}if(t.metadataRegistry.get(s[0])?.id){o(s);continue}if(c.cycle){o(s);continue}if(c.count>1&&t.reused==="ref"){o(s);continue}}}function kn(t,e){let n=t.seen.get(e);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");let i=c=>{let u=t.seen.get(c);if(u.ref===null)return;let d=u.def??u.schema,l={...d},p=u.ref;if(u.ref=null,p){i(p);let f=t.seen.get(p),h=f.schema;if(h.$ref&&(t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0")?(d.allOf=d.allOf??[],d.allOf.push(h)):Object.assign(d,h),Object.assign(d,l),c._zod.parent===p)for(let v in d)v==="$ref"||v==="allOf"||v in l||delete d[v];if(h.$ref&&f.def)for(let v in d)v==="$ref"||v==="allOf"||v in f.def&&JSON.stringify(d[v])===JSON.stringify(f.def[v])&&delete d[v]}let m=c._zod.parent;if(m&&m!==p){i(m);let f=t.seen.get(m);if(f?.schema.$ref&&(d.$ref=f.schema.$ref,f.def))for(let h in d)h==="$ref"||h==="allOf"||h in f.def&&JSON.stringify(d[h])===JSON.stringify(f.def[h])&&delete d[h]}t.override({zodSchema:c,jsonSchema:d,path:u.path??[]})};for(let c of[...t.seen.entries()].reverse())i(c[0]);let r={};if(t.target==="draft-2020-12"?r.$schema="https://json-schema.org/draft/2020-12/schema":t.target==="draft-07"?r.$schema="http://json-schema.org/draft-07/schema#":t.target==="draft-04"?r.$schema="http://json-schema.org/draft-04/schema#":t.target,t.external?.uri){let c=t.external.registry.get(e)?.id;if(!c)throw new Error("Schema is missing an `id` property");r.$id=t.external.uri(c)}Object.assign(r,n.def??n.schema);let o=t.metadataRegistry.get(e)?.id;o!==void 0&&r.id===o&&delete r.id;let s=t.external?.defs??{};for(let c of t.seen.entries()){let u=c[1];u.def&&u.defId&&(u.def.id===u.defId&&delete u.def.id,s[u.defId]=u.def)}t.external||Object.keys(s).length>0&&(t.target==="draft-2020-12"?r.$defs=s:r.definitions=s);try{let c=JSON.parse(JSON.stringify(r));return Object.defineProperty(c,"~standard",{value:{...e["~standard"],jsonSchema:{input:Vr(e,"input",t.processors),output:Vr(e,"output",t.processors)}},enumerable:!1,writable:!1}),c}catch{throw new Error("Error converting schema to JSON.")}}function We(t,e){let n=e??{seen:new Set};if(n.seen.has(t))return!1;n.seen.add(t);let i=t._zod.def;if(i.type==="transform")return!0;if(i.type==="array")return We(i.element,n);if(i.type==="set")return We(i.valueType,n);if(i.type==="lazy")return We(i.getter(),n);if(i.type==="promise"||i.type==="optional"||i.type==="nonoptional"||i.type==="nullable"||i.type==="readonly"||i.type==="default"||i.type==="prefault")return We(i.innerType,n);if(i.type==="intersection")return We(i.left,n)||We(i.right,n);if(i.type==="record"||i.type==="map")return We(i.keyType,n)||We(i.valueType,n);if(i.type==="pipe")return t._zod.traits.has("$ZodCodec")?!0:We(i.in,n)||We(i.out,n);if(i.type==="object"){for(let r in i.shape)if(We(i.shape[r],n))return!0;return!1}if(i.type==="union"){for(let r of i.options)if(We(r,n))return!0;return!1}if(i.type==="tuple"){for(let r of i.items)if(We(r,n))return!0;return!!(i.rest&&We(i.rest,n))}return!1}var Dm=(t,e={})=>n=>{let i=yn({...n,processors:e});return de(t,i),vn(i,t),kn(i,t)},Vr=(t,e,n={})=>i=>{let{libraryOptions:r,target:o}=i??{},s=yn({...r??{},target:o,io:e,processors:n});return de(t,s),vn(s,t),kn(s,t)};var JO={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},jm=(t,e,n,i)=>{let r=n;r.type="string";let{minimum:o,maximum:s,format:c,patterns:u,contentEncoding:d}=t._zod.bag;if(typeof o=="number"&&(r.minLength=o),typeof s=="number"&&(r.maxLength=s),c&&(r.format=JO[c]??c,r.format===""&&delete r.format,c==="time"&&delete r.format),d&&(r.contentEncoding=d),u&&u.size>0){let l=[...u];l.length===1?r.pattern=l[0].source:l.length>1&&(r.allOf=[...l.map(p=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:p.source}))])}},Um=(t,e,n,i)=>{let r=n,{minimum:o,maximum:s,format:c,multipleOf:u,exclusiveMaximum:d,exclusiveMinimum:l}=t._zod.bag;typeof c=="string"&&c.includes("int")?r.type="integer":r.type="number";let p=typeof l=="number"&&l>=(o??Number.NEGATIVE_INFINITY),m=typeof d=="number"&&d<=(s??Number.POSITIVE_INFINITY),f=e.target==="draft-04"||e.target==="openapi-3.0";p?f?(r.minimum=l,r.exclusiveMinimum=!0):r.exclusiveMinimum=l:typeof o=="number"&&(r.minimum=o),m?f?(r.maximum=d,r.exclusiveMaximum=!0):r.exclusiveMaximum=d:typeof s=="number"&&(r.maximum=s),typeof u=="number"&&(r.multipleOf=u)},Mm=(t,e,n,i)=>{n.type="boolean"},Lm=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},Zm=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},Fm=(t,e,n,i)=>{e.target==="openapi-3.0"?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"},Bm=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},qm=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},Vm=(t,e,n,i)=>{n.not={}},Hm=(t,e,n,i)=>{},Km=(t,e,n,i)=>{},Gm=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},Wm=(t,e,n,i)=>{let r=t._zod.def,o=co(r.entries);o.every(s=>typeof s=="number")&&(n.type="number"),o.every(s=>typeof s=="string")&&(n.type="string"),n.enum=o},Jm=(t,e,n,i)=>{let r=t._zod.def,o=[];for(let s of r.values)if(s===void 0){if(e.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof s=="bigint"){if(e.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");o.push(Number(s))}else o.push(s);if(o.length!==0)if(o.length===1){let s=o[0];n.type=s===null?"null":typeof s,e.target==="draft-04"||e.target==="openapi-3.0"?n.enum=[s]:n.const=s}else o.every(s=>typeof s=="number")&&(n.type="number"),o.every(s=>typeof s=="string")&&(n.type="string"),o.every(s=>typeof s=="boolean")&&(n.type="boolean"),o.every(s=>s===null)&&(n.type="null"),n.enum=o},Ym=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},Xm=(t,e,n,i)=>{let r=n,o=t._zod.pattern;if(!o)throw new Error("Pattern not found in template literal");r.type="string",r.pattern=o.source},Qm=(t,e,n,i)=>{let r=n,o={type:"string",format:"binary",contentEncoding:"binary"},{minimum:s,maximum:c,mime:u}=t._zod.bag;s!==void 0&&(o.minLength=s),c!==void 0&&(o.maxLength=c),u?u.length===1?(o.contentMediaType=u[0],Object.assign(r,o)):(Object.assign(r,o),r.anyOf=u.map(d=>({contentMediaType:d}))):Object.assign(r,o)},ef=(t,e,n,i)=>{n.type="boolean"},tf=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},nf=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},rf=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},of=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},sf=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},af=(t,e,n,i)=>{let r=n,o=t._zod.def,{minimum:s,maximum:c}=t._zod.bag;typeof s=="number"&&(r.minItems=s),typeof c=="number"&&(r.maxItems=c),r.type="array",r.items=de(o.element,e,{...i,path:[...i.path,"items"]})},cf=(t,e,n,i)=>{let r=n,o=t._zod.def;r.type="object",r.properties={};let s=o.shape;for(let d in s)r.properties[d]=de(s[d],e,{...i,path:[...i.path,"properties",d]});let c=new Set(Object.keys(s)),u=new Set([...c].filter(d=>{let l=o.shape[d]._zod;return e.io==="input"?l.optin===void 0:l.optout===void 0}));u.size>0&&(r.required=Array.from(u)),o.catchall?._zod.def.type==="never"?r.additionalProperties=!1:o.catchall?o.catchall&&(r.additionalProperties=de(o.catchall,e,{...i,path:[...i.path,"additionalProperties"]})):e.io==="output"&&(r.additionalProperties=!1)},Pu=(t,e,n,i)=>{let r=t._zod.def,o=r.inclusive===!1,s=r.options.map((c,u)=>de(c,e,{...i,path:[...i.path,o?"oneOf":"anyOf",u]}));o?n.oneOf=s:n.anyOf=s},uf=(t,e,n,i)=>{let r=t._zod.def,o=de(r.left,e,{...i,path:[...i.path,"allOf",0]}),s=de(r.right,e,{...i,path:[...i.path,"allOf",1]}),c=d=>"allOf"in d&&Object.keys(d).length===1,u=[...c(o)?o.allOf:[o],...c(s)?s.allOf:[s]];n.allOf=u},lf=(t,e,n,i)=>{let r=n,o=t._zod.def;r.type="array";let s=e.target==="draft-2020-12"?"prefixItems":"items",c=e.target==="draft-2020-12"||e.target==="openapi-3.0"?"items":"additionalItems",u=o.items.map((m,f)=>de(m,e,{...i,path:[...i.path,s,f]})),d=o.rest?de(o.rest,e,{...i,path:[...i.path,c,...e.target==="openapi-3.0"?[o.items.length]:[]]}):null;e.target==="draft-2020-12"?(r.prefixItems=u,d&&(r.items=d)):e.target==="openapi-3.0"?(r.items={anyOf:u},d&&r.items.anyOf.push(d),r.minItems=u.length,d||(r.maxItems=u.length)):(r.items=u,d&&(r.additionalItems=d));let{minimum:l,maximum:p}=t._zod.bag;typeof l=="number"&&(r.minItems=l),typeof p=="number"&&(r.maxItems=p)},df=(t,e,n,i)=>{let r=n,o=t._zod.def;r.type="object";let s=o.keyType,u=s._zod.bag?.patterns;if(o.mode==="loose"&&u&&u.size>0){let l=de(o.valueType,e,{...i,path:[...i.path,"patternProperties","*"]});r.patternProperties={};for(let p of u)r.patternProperties[p.source]=l}else(e.target==="draft-07"||e.target==="draft-2020-12")&&(r.propertyNames=de(o.keyType,e,{...i,path:[...i.path,"propertyNames"]})),r.additionalProperties=de(o.valueType,e,{...i,path:[...i.path,"additionalProperties"]});let d=s._zod.values;if(d){let l=[...d].filter(p=>typeof p=="string"||typeof p=="number");l.length>0&&(r.required=l)}},pf=(t,e,n,i)=>{let r=t._zod.def,o=de(r.innerType,e,i),s=e.seen.get(t);e.target==="openapi-3.0"?(s.ref=r.innerType,n.nullable=!0):n.anyOf=[o,{type:"null"}]},mf=(t,e,n,i)=>{let r=t._zod.def;de(r.innerType,e,i);let o=e.seen.get(t);o.ref=r.innerType},ff=(t,e,n,i)=>{let r=t._zod.def;de(r.innerType,e,i);let o=e.seen.get(t);o.ref=r.innerType,n.default=JSON.parse(JSON.stringify(r.defaultValue))},hf=(t,e,n,i)=>{let r=t._zod.def;de(r.innerType,e,i);let o=e.seen.get(t);o.ref=r.innerType,e.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(r.defaultValue)))},gf=(t,e,n,i)=>{let r=t._zod.def;de(r.innerType,e,i);let o=e.seen.get(t);o.ref=r.innerType;let s;try{s=r.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=s},bf=(t,e,n,i)=>{let r=t._zod.def,o=r.in._zod.traits.has("$ZodTransform"),s=e.io==="input"?o?r.out:r.in:r.out;de(s,e,i);let c=e.seen.get(t);c.ref=s},_f=(t,e,n,i)=>{let r=t._zod.def;de(r.innerType,e,i);let o=e.seen.get(t);o.ref=r.innerType,n.readOnly=!0},yf=(t,e,n,i)=>{let r=t._zod.def;de(r.innerType,e,i);let o=e.seen.get(t);o.ref=r.innerType},Au=(t,e,n,i)=>{let r=t._zod.def;de(r.innerType,e,i);let o=e.seen.get(t);o.ref=r.innerType},vf=(t,e,n,i)=>{let r=t._zod.innerType;de(r,e,i);let o=e.seen.get(t);o.ref=r},Ou={string:jm,number:Um,boolean:Mm,bigint:Lm,symbol:Zm,null:Fm,undefined:Bm,void:qm,never:Vm,any:Hm,unknown:Km,date:Gm,enum:Wm,literal:Jm,nan:Ym,template_literal:Xm,file:Qm,success:ef,custom:tf,function:nf,transform:rf,map:of,set:sf,array:af,object:cf,union:Pu,intersection:uf,tuple:lf,record:df,nullable:pf,nonoptional:mf,default:ff,prefault:hf,catch:gf,pipe:bf,readonly:_f,promise:yf,optional:Au,lazy:vf};function Qn(t,e){if("_idmap"in t){let i=t,r=yn({...e,processors:Ou}),o={};for(let u of i._idmap.entries()){let[d,l]=u;de(l,r)}let s={},c={registry:i,uri:e?.uri,defs:o};r.external=c;for(let u of i._idmap.entries()){let[d,l]=u;vn(r,l),s[d]=kn(r,l)}if(Object.keys(o).length>0){let u=r.target==="draft-2020-12"?"$defs":"definitions";s.__shared={[u]:o}}return{schemas:s}}let n=yn({...e,processors:Ou});return de(t,n),vn(n,t),kn(n,t)}var Nu=class{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(e){this.ctx.counter=e}get seen(){return this.ctx.seen}constructor(e){let n=e?.target??"draft-2020-12";n==="draft-4"&&(n="draft-04"),n==="draft-7"&&(n="draft-07"),this.ctx=yn({processors:Ou,target:n,...e?.metadata&&{metadata:e.metadata},...e?.unrepresentable&&{unrepresentable:e.unrepresentable},...e?.override&&{override:e.override},...e?.io&&{io:e.io}})}process(e,n={path:[],schemaPath:[]}){return de(e,this.ctx,n)}emit(e,n){n&&(n.cycles&&(this.ctx.cycles=n.cycles),n.reused&&(this.ctx.reused=n.reused),n.external&&(this.ctx.external=n.external)),vn(this.ctx,e);let i=kn(this.ctx,e),{"~standard":r,...o}=i;return o}};var sk={};var Ho={};Jt(Ho,{ZodAny:()=>Zf,ZodArray:()=>Vf,ZodBase64:()=>el,ZodBase64URL:()=>tl,ZodBigInt:()=>Xr,ZodBigIntFormat:()=>il,ZodBoolean:()=>Yr,ZodCIDRv4:()=>Xu,ZodCIDRv6:()=>Qu,ZodCUID:()=>Vu,ZodCUID2:()=>Hu,ZodCatch:()=>dh,ZodCodec:()=>rs,ZodCustom:()=>is,ZodCustomStringFormat:()=>Wr,ZodDate:()=>Xo,ZodDefault:()=>oh,ZodDiscriminatedUnion:()=>Kf,ZodE164:()=>nl,ZodEmail:()=>Fu,ZodEmoji:()=>Bu,ZodEnum:()=>Kr,ZodExactOptional:()=>nh,ZodFile:()=>eh,ZodFunction:()=>kh,ZodGUID:()=>Ko,ZodIPv4:()=>Ju,ZodIPv6:()=>Yu,ZodIntersection:()=>Gf,ZodJWT:()=>rl,ZodKSUID:()=>Wu,ZodLazy:()=>_h,ZodLiteral:()=>Qf,ZodMAC:()=>jf,ZodMap:()=>Yf,ZodNaN:()=>mh,ZodNanoID:()=>qu,ZodNever:()=>Bf,ZodNonOptional:()=>al,ZodNull:()=>Lf,ZodNullable:()=>ih,ZodNumber:()=>Jr,ZodNumberFormat:()=>er,ZodObject:()=>Qo,ZodOptional:()=>ei,ZodPipe:()=>ns,ZodPrefault:()=>ah,ZodPreprocess:()=>fh,ZodPromise:()=>vh,ZodReadonly:()=>hh,ZodRecord:()=>Hr,ZodSet:()=>Xf,ZodString:()=>Gr,ZodStringFormat:()=>he,ZodSuccess:()=>lh,ZodSymbol:()=>Uf,ZodTemplateLiteral:()=>bh,ZodTransform:()=>th,ZodTuple:()=>Wf,ZodType:()=>K,ZodULID:()=>Ku,ZodURL:()=>Jo,ZodUUID:()=>Bt,ZodUndefined:()=>Mf,ZodUnion:()=>es,ZodUnknown:()=>Ff,ZodVoid:()=>qf,ZodXID:()=>Gu,ZodXor:()=>Hf,_ZodString:()=>Zu,_default:()=>sh,_function:()=>dx,any:()=>Hk,array:()=>X,base64:()=>Rk,base64url:()=>Ok,bigint:()=>Zk,boolean:()=>Re,catch:()=>ph,check:()=>px,cidrv4:()=>Ek,cidrv6:()=>Tk,codec:()=>ax,cuid:()=>yk,cuid2:()=>vk,custom:()=>cl,date:()=>Gk,describe:()=>mx,discriminatedUnion:()=>ts,e164:()=>Pk,email:()=>uk,emoji:()=>bk,enum:()=>je,exactOptional:()=>rh,file:()=>rx,float32:()=>jk,float64:()=>Uk,function:()=>dx,guid:()=>lk,hash:()=>Dk,hex:()=>zk,hostname:()=>Ck,httpUrl:()=>gk,instanceof:()=>hx,int:()=>Mu,int32:()=>Mk,int64:()=>Fk,intersection:()=>Qr,invertCodec:()=>cx,ipv4:()=>$k,ipv6:()=>wk,json:()=>bx,jwt:()=>Ak,keyof:()=>Wk,ksuid:()=>Sk,lazy:()=>yh,literal:()=>M,looseObject:()=>De,looseRecord:()=>Qk,mac:()=>Ik,map:()=>ex,meta:()=>fx,nan:()=>sx,nanoid:()=>_k,nativeEnum:()=>nx,never:()=>ol,nonoptional:()=>uh,null:()=>Yo,nullable:()=>Go,nullish:()=>ix,number:()=>ae,object:()=>P,optional:()=>ye,partialRecord:()=>Xk,pipe:()=>Lu,prefault:()=>ch,preprocess:()=>os,promise:()=>lx,readonly:()=>gh,record:()=>me,refine:()=>xh,set:()=>tx,strictObject:()=>Jk,string:()=>_,stringFormat:()=>Nk,stringbool:()=>gx,success:()=>ox,superRefine:()=>Sh,symbol:()=>qk,templateLiteral:()=>ux,transform:()=>sl,tuple:()=>Jf,uint32:()=>Lk,uint64:()=>Bk,ulid:()=>kk,undefined:()=>Vk,union:()=>be,unknown:()=>ge,url:()=>hk,uuid:()=>dk,uuidv4:()=>pk,uuidv6:()=>mk,uuidv7:()=>fk,void:()=>Kk,xid:()=>xk,xor:()=>Yk});var Cu={};Jt(Cu,{endsWith:()=>Ur,gt:()=>Zt,gte:()=>Ge,includes:()=>Dr,length:()=>Yn,lowercase:()=>Cr,lt:()=>Lt,lte:()=>lt,maxLength:()=>Jn,maxSize:()=>_n,mime:()=>Mr,minLength:()=>Xt,minSize:()=>Ft,multipleOf:()=>bn,negative:()=>yu,nonnegative:()=>ku,nonpositive:()=>vu,normalize:()=>Lr,overwrite:()=>Et,positive:()=>_u,property:()=>xu,regex:()=>Nr,size:()=>Wn,slugify:()=>qr,startsWith:()=>jr,toLowerCase:()=>Fr,toUpperCase:()=>Br,trim:()=>Zr,uppercase:()=>zr});var xn={};Jt(xn,{ZodISODate:()=>Du,ZodISODateTime:()=>zu,ZodISODuration:()=>Uu,ZodISOTime:()=>ju,date:()=>xf,datetime:()=>kf,duration:()=>$f,time:()=>Sf});var zu=g("ZodISODateTime",(t,e)=>{gm.init(t,e),he.init(t,e)});function kf(t){return Em(zu,t)}var Du=g("ZodISODate",(t,e)=>{bm.init(t,e),he.init(t,e)});function xf(t){return Tm(Du,t)}var ju=g("ZodISOTime",(t,e)=>{_m.init(t,e),he.init(t,e)});function Sf(t){return Rm(ju,t)}var Uu=g("ZodISODuration",(t,e)=>{ym.init(t,e),he.init(t,e)});function $f(t){return Om(Uu,t)}var ak=(t,e)=>{fo.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:n=>go(t,n)},flatten:{value:n=>ho(t,n)},addIssue:{value:n=>{t.issues.push(n),t.message=JSON.stringify(t.issues,_r,2)}},addIssues:{value:n=>{t.issues.push(...n),t.message=JSON.stringify(t.issues,_r,2)}},isEmpty:{get(){return t.issues.length===0}}})},XO=g("ZodError",ak),it=g("ZodError",ak,{Parent:Error});var If=kr(it),wf=xr(it),Ef=Sr(it),Tf=$r(it),Rf=Ea(it),Of=Ta(it),Pf=Ra(it),Af=Oa(it),Nf=Pa(it),Cf=Aa(it),zf=Na(it),Df=Ca(it);var ck=new WeakMap;function Wo(t,e,n){let i=Object.getPrototypeOf(t),r=ck.get(i);if(r||(r=new Set,ck.set(i,r)),!r.has(e)){r.add(e);for(let o in n){let s=n[o];Object.defineProperty(i,o,{configurable:!0,enumerable:!1,get(){let c=s.bind(this);return Object.defineProperty(this,o,{configurable:!0,writable:!0,enumerable:!0,value:c}),c},set(c){Object.defineProperty(this,o,{configurable:!0,writable:!0,enumerable:!0,value:c})}})}}}var K=g("ZodType",(t,e)=>(V.init(t,e),Object.assign(t["~standard"],{jsonSchema:{input:Vr(t,"input"),output:Vr(t,"output")}}),t.toJSONSchema=Dm(t,{}),t.def=e,t.type=e.type,Object.defineProperty(t,"_def",{value:e}),t.parse=(n,i)=>If(t,n,i,{callee:t.parse}),t.safeParse=(n,i)=>Ef(t,n,i),t.parseAsync=async(n,i)=>wf(t,n,i,{callee:t.parseAsync}),t.safeParseAsync=async(n,i)=>Tf(t,n,i),t.spa=t.safeParseAsync,t.encode=(n,i)=>Rf(t,n,i),t.decode=(n,i)=>Of(t,n,i),t.encodeAsync=async(n,i)=>Pf(t,n,i),t.decodeAsync=async(n,i)=>Af(t,n,i),t.safeEncode=(n,i)=>Nf(t,n,i),t.safeDecode=(n,i)=>Cf(t,n,i),t.safeEncodeAsync=async(n,i)=>zf(t,n,i),t.safeDecodeAsync=async(n,i)=>Df(t,n,i),Wo(t,"ZodType",{check(...n){let i=this.def;return this.clone(S.mergeDefs(i,{checks:[...i.checks??[],...n.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0})},with(...n){return this.check(...n)},clone(n,i){return Ce(this,n,i)},brand(){return this},register(n,i){return n.add(this,i),this},refine(n,i){return this.check(xh(n,i))},superRefine(n,i){return this.check(Sh(n,i))},overwrite(n){return this.check(Et(n))},optional(){return ye(this)},exactOptional(){return rh(this)},nullable(){return Go(this)},nullish(){return ye(Go(this))},nonoptional(n){return uh(this,n)},array(){return X(this)},or(n){return be([this,n])},and(n){return Qr(this,n)},transform(n){return Lu(this,sl(n))},default(n){return sh(this,n)},prefault(n){return ch(this,n)},catch(n){return ph(this,n)},pipe(n){return Lu(this,n)},readonly(){return gh(this)},describe(n){let i=this.clone();return ze.add(i,{description:n}),i},meta(...n){if(n.length===0)return ze.get(this);let i=this.clone();return ze.add(i,n[0]),i},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(n){return n(this)}}),Object.defineProperty(t,"description",{get(){return ze.get(t)?.description},configurable:!0}),t)),Zu=g("_ZodString",(t,e)=>{gn.init(t,e),K.init(t,e),t._zod.processJSONSchema=(i,r,o)=>jm(t,i,r,o);let n=t._zod.bag;t.format=n.format??null,t.minLength=n.minimum??null,t.maxLength=n.maximum??null,Wo(t,"_ZodString",{regex(...i){return this.check(Nr(...i))},includes(...i){return this.check(Dr(...i))},startsWith(...i){return this.check(jr(...i))},endsWith(...i){return this.check(Ur(...i))},min(...i){return this.check(Xt(...i))},max(...i){return this.check(Jn(...i))},length(...i){return this.check(Yn(...i))},nonempty(...i){return this.check(Xt(1,...i))},lowercase(i){return this.check(Cr(i))},uppercase(i){return this.check(zr(i))},trim(){return this.check(Zr())},normalize(...i){return this.check(Lr(...i))},toLowerCase(){return this.check(Fr())},toUpperCase(){return this.check(Br())},slugify(){return this.check(qr())}})}),Gr=g("ZodString",(t,e)=>{gn.init(t,e),Zu.init(t,e),t.email=n=>t.check(wo(Fu,n)),t.url=n=>t.check(Ar(Jo,n)),t.jwt=n=>t.check(Vo(rl,n)),t.emoji=n=>t.check(Po(Bu,n)),t.guid=n=>t.check(Pr(Ko,n)),t.uuid=n=>t.check(Eo(Bt,n)),t.uuidv4=n=>t.check(To(Bt,n)),t.uuidv6=n=>t.check(Ro(Bt,n)),t.uuidv7=n=>t.check(Oo(Bt,n)),t.nanoid=n=>t.check(Ao(qu,n)),t.guid=n=>t.check(Pr(Ko,n)),t.cuid=n=>t.check(No(Vu,n)),t.cuid2=n=>t.check(Co(Hu,n)),t.ulid=n=>t.check(zo(Ku,n)),t.base64=n=>t.check(Fo(el,n)),t.base64url=n=>t.check(Bo(tl,n)),t.xid=n=>t.check(Do(Gu,n)),t.ksuid=n=>t.check(jo(Wu,n)),t.ipv4=n=>t.check(Uo(Ju,n)),t.ipv6=n=>t.check(Mo(Yu,n)),t.cidrv4=n=>t.check(Lo(Xu,n)),t.cidrv6=n=>t.check(Zo(Qu,n)),t.e164=n=>t.check(qo(nl,n)),t.datetime=n=>t.check(kf(n)),t.date=n=>t.check(xf(n)),t.time=n=>t.check(Sf(n)),t.duration=n=>t.check($f(n))});function _(t){return Yc(Gr,t)}var he=g("ZodStringFormat",(t,e)=>{pe.init(t,e),Zu.init(t,e)}),Fu=g("ZodEmail",(t,e)=>{Va.init(t,e),he.init(t,e)});function uk(t){return wo(Fu,t)}var Ko=g("ZodGUID",(t,e)=>{Ba.init(t,e),he.init(t,e)});function lk(t){return Pr(Ko,t)}var Bt=g("ZodUUID",(t,e)=>{qa.init(t,e),he.init(t,e)});function dk(t){return Eo(Bt,t)}function pk(t){return To(Bt,t)}function mk(t){return Ro(Bt,t)}function fk(t){return Oo(Bt,t)}var Jo=g("ZodURL",(t,e)=>{Ha.init(t,e),he.init(t,e)});function hk(t){return Ar(Jo,t)}function gk(t){return Ar(Jo,{protocol:rt.httpProtocol,hostname:rt.domain,...S.normalizeParams(t)})}var Bu=g("ZodEmoji",(t,e)=>{Ka.init(t,e),he.init(t,e)});function bk(t){return Po(Bu,t)}var qu=g("ZodNanoID",(t,e)=>{Ga.init(t,e),he.init(t,e)});function _k(t){return Ao(qu,t)}var Vu=g("ZodCUID",(t,e)=>{Wa.init(t,e),he.init(t,e)});function yk(t){return No(Vu,t)}var Hu=g("ZodCUID2",(t,e)=>{Ja.init(t,e),he.init(t,e)});function vk(t){return Co(Hu,t)}var Ku=g("ZodULID",(t,e)=>{Ya.init(t,e),he.init(t,e)});function kk(t){return zo(Ku,t)}var Gu=g("ZodXID",(t,e)=>{Xa.init(t,e),he.init(t,e)});function xk(t){return Do(Gu,t)}var Wu=g("ZodKSUID",(t,e)=>{Qa.init(t,e),he.init(t,e)});function Sk(t){return jo(Wu,t)}var Ju=g("ZodIPv4",(t,e)=>{ec.init(t,e),he.init(t,e)});function $k(t){return Uo(Ju,t)}var jf=g("ZodMAC",(t,e)=>{nc.init(t,e),he.init(t,e)});function Ik(t){return Xc(jf,t)}var Yu=g("ZodIPv6",(t,e)=>{tc.init(t,e),he.init(t,e)});function wk(t){return Mo(Yu,t)}var Xu=g("ZodCIDRv4",(t,e)=>{rc.init(t,e),he.init(t,e)});function Ek(t){return Lo(Xu,t)}var Qu=g("ZodCIDRv6",(t,e)=>{ic.init(t,e),he.init(t,e)});function Tk(t){return Zo(Qu,t)}var el=g("ZodBase64",(t,e)=>{oc.init(t,e),he.init(t,e)});function Rk(t){return Fo(el,t)}var tl=g("ZodBase64URL",(t,e)=>{sc.init(t,e),he.init(t,e)});function Ok(t){return Bo(tl,t)}var nl=g("ZodE164",(t,e)=>{ac.init(t,e),he.init(t,e)});function Pk(t){return qo(nl,t)}var rl=g("ZodJWT",(t,e)=>{cc.init(t,e),he.init(t,e)});function Ak(t){return Vo(rl,t)}var Wr=g("ZodCustomStringFormat",(t,e)=>{uc.init(t,e),he.init(t,e)});function Nk(t,e,n={}){return Xn(Wr,t,e,n)}function Ck(t){return Xn(Wr,"hostname",rt.hostname,t)}function zk(t){return Xn(Wr,"hex",rt.hex,t)}function Dk(t,e){let n=e?.enc??"hex",i=`${t}_${n}`,r=rt[i];if(!r)throw new Error(`Unrecognized hash format: ${i}`);return Xn(Wr,i,r,e)}var Jr=g("ZodNumber",(t,e)=>{vo.init(t,e),K.init(t,e),t._zod.processJSONSchema=(i,r,o)=>Um(t,i,r,o),Wo(t,"ZodNumber",{gt(i,r){return this.check(Zt(i,r))},gte(i,r){return this.check(Ge(i,r))},min(i,r){return this.check(Ge(i,r))},lt(i,r){return this.check(Lt(i,r))},lte(i,r){return this.check(lt(i,r))},max(i,r){return this.check(lt(i,r))},int(i){return this.check(Mu(i))},safe(i){return this.check(Mu(i))},positive(i){return this.check(Zt(0,i))},nonnegative(i){return this.check(Ge(0,i))},negative(i){return this.check(Lt(0,i))},nonpositive(i){return this.check(lt(0,i))},multipleOf(i,r){return this.check(bn(i,r))},step(i,r){return this.check(bn(i,r))},finite(){return this}});let n=t._zod.bag;t.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,t.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,t.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),t.isFinite=!0,t.format=n.format??null});function ae(t){return Qc(Jr,t)}var er=g("ZodNumberFormat",(t,e)=>{lc.init(t,e),Jr.init(t,e)});function Mu(t){return eu(er,t)}function jk(t){return tu(er,t)}function Uk(t){return nu(er,t)}function Mk(t){return ru(er,t)}function Lk(t){return iu(er,t)}var Yr=g("ZodBoolean",(t,e)=>{wr.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Mm(t,n,i,r)});function Re(t){return ou(Yr,t)}var Xr=g("ZodBigInt",(t,e)=>{ko.init(t,e),K.init(t,e),t._zod.processJSONSchema=(i,r,o)=>Lm(t,i,r,o),t.gte=(i,r)=>t.check(Ge(i,r)),t.min=(i,r)=>t.check(Ge(i,r)),t.gt=(i,r)=>t.check(Zt(i,r)),t.gte=(i,r)=>t.check(Ge(i,r)),t.min=(i,r)=>t.check(Ge(i,r)),t.lt=(i,r)=>t.check(Lt(i,r)),t.lte=(i,r)=>t.check(lt(i,r)),t.max=(i,r)=>t.check(lt(i,r)),t.positive=i=>t.check(Zt(BigInt(0),i)),t.negative=i=>t.check(Lt(BigInt(0),i)),t.nonpositive=i=>t.check(lt(BigInt(0),i)),t.nonnegative=i=>t.check(Ge(BigInt(0),i)),t.multipleOf=(i,r)=>t.check(bn(i,r));let n=t._zod.bag;t.minValue=n.minimum??null,t.maxValue=n.maximum??null,t.format=n.format??null});function Zk(t){return su(Xr,t)}var il=g("ZodBigIntFormat",(t,e)=>{dc.init(t,e),Xr.init(t,e)});function Fk(t){return au(il,t)}function Bk(t){return cu(il,t)}var Uf=g("ZodSymbol",(t,e)=>{pc.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Zm(t,n,i,r)});function qk(t){return uu(Uf,t)}var Mf=g("ZodUndefined",(t,e)=>{mc.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Bm(t,n,i,r)});function Vk(t){return lu(Mf,t)}var Lf=g("ZodNull",(t,e)=>{fc.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Fm(t,n,i,r)});function Yo(t){return du(Lf,t)}var Zf=g("ZodAny",(t,e)=>{hc.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Hm(t,n,i,r)});function Hk(){return pu(Zf)}var Ff=g("ZodUnknown",(t,e)=>{gc.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Km(t,n,i,r)});function ge(){return mu(Ff)}var Bf=g("ZodNever",(t,e)=>{bc.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Vm(t,n,i,r)});function ol(t){return fu(Bf,t)}var qf=g("ZodVoid",(t,e)=>{_c.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,i,r)=>qm(t,n,i,r)});function Kk(t){return hu(qf,t)}var Xo=g("ZodDate",(t,e)=>{yc.init(t,e),K.init(t,e),t._zod.processJSONSchema=(i,r,o)=>Gm(t,i,r,o),t.min=(i,r)=>t.check(Ge(i,r)),t.max=(i,r)=>t.check(lt(i,r));let n=t._zod.bag;t.minDate=n.minimum?new Date(n.minimum):null,t.maxDate=n.maximum?new Date(n.maximum):null});function Gk(t){return gu(Xo,t)}var Vf=g("ZodArray",(t,e)=>{vc.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,i,r)=>af(t,n,i,r),t.element=e.element,Wo(t,"ZodArray",{min(n,i){return this.check(Xt(n,i))},nonempty(n){return this.check(Xt(1,n))},max(n,i){return this.check(Jn(n,i))},length(n,i){return this.check(Yn(n,i))},unwrap(){return this.element}})});function X(t,e){return zm(Vf,t,e)}function Wk(t){let e=t._zod.def.shape;return je(Object.keys(e))}var Qo=g("ZodObject",(t,e)=>{km.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,i,r)=>cf(t,n,i,r),S.defineLazy(t,"shape",()=>e.shape),Wo(t,"ZodObject",{keyof(){return je(Object.keys(this._zod.def.shape))},catchall(n){return this.clone({...this._zod.def,catchall:n})},passthrough(){return this.clone({...this._zod.def,catchall:ge()})},loose(){return this.clone({...this._zod.def,catchall:ge()})},strict(){return this.clone({...this._zod.def,catchall:ol()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(n){return S.extend(this,n)},safeExtend(n){return S.safeExtend(this,n)},merge(n){return S.merge(this,n)},pick(n){return S.pick(this,n)},omit(n){return S.omit(this,n)},partial(...n){return S.partial(ei,this,n[0])},required(...n){return S.required(al,this,n[0])}})});function P(t,e){let n={type:"object",shape:t??{},...S.normalizeParams(e)};return new Qo(n)}function Jk(t,e){return new Qo({type:"object",shape:t,catchall:ol(),...S.normalizeParams(e)})}function De(t,e){return new Qo({type:"object",shape:t,catchall:ge(),...S.normalizeParams(e)})}var es=g("ZodUnion",(t,e)=>{Er.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Pu(t,n,i,r),t.options=e.options});function be(t,e){return new es({type:"union",options:t,...S.normalizeParams(e)})}var Hf=g("ZodXor",(t,e)=>{es.init(t,e),xc.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Pu(t,n,i,r),t.options=e.options});function Yk(t,e){return new Hf({type:"union",options:t,inclusive:!1,...S.normalizeParams(e)})}var Kf=g("ZodDiscriminatedUnion",(t,e)=>{es.init(t,e),Sc.init(t,e)});function ts(t,e,n){return new Kf({type:"union",options:e,discriminator:t,...S.normalizeParams(n)})}var Gf=g("ZodIntersection",(t,e)=>{$c.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,i,r)=>uf(t,n,i,r)});function Qr(t,e){return new Gf({type:"intersection",left:t,right:e})}var Wf=g("ZodTuple",(t,e)=>{xo.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,i,r)=>lf(t,n,i,r),t.rest=n=>t.clone({...t._zod.def,rest:n})});function Jf(t,e,n){let i=e instanceof V,r=i?n:e,o=i?e:null;return new Wf({type:"tuple",items:t,rest:o,...S.normalizeParams(r)})}var Hr=g("ZodRecord",(t,e)=>{Ic.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,i,r)=>df(t,n,i,r),t.keyType=e.keyType,t.valueType=e.valueType});function me(t,e,n){return!e||!e._zod?new Hr({type:"record",keyType:_(),valueType:t,...S.normalizeParams(e)}):new Hr({type:"record",keyType:t,valueType:e,...S.normalizeParams(n)})}function Xk(t,e,n){let i=Ce(t);return i._zod.values=void 0,new Hr({type:"record",keyType:i,valueType:e,...S.normalizeParams(n)})}function Qk(t,e,n){return new Hr({type:"record",keyType:t,valueType:e,mode:"loose",...S.normalizeParams(n)})}var Yf=g("ZodMap",(t,e)=>{wc.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,i,r)=>of(t,n,i,r),t.keyType=e.keyType,t.valueType=e.valueType,t.min=(...n)=>t.check(Ft(...n)),t.nonempty=n=>t.check(Ft(1,n)),t.max=(...n)=>t.check(_n(...n)),t.size=(...n)=>t.check(Wn(...n))});function ex(t,e,n){return new Yf({type:"map",keyType:t,valueType:e,...S.normalizeParams(n)})}var Xf=g("ZodSet",(t,e)=>{Ec.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,i,r)=>sf(t,n,i,r),t.min=(...n)=>t.check(Ft(...n)),t.nonempty=n=>t.check(Ft(1,n)),t.max=(...n)=>t.check(_n(...n)),t.size=(...n)=>t.check(Wn(...n))});function tx(t,e){return new Xf({type:"set",valueType:t,...S.normalizeParams(e)})}var Kr=g("ZodEnum",(t,e)=>{Tc.init(t,e),K.init(t,e),t._zod.processJSONSchema=(i,r,o)=>Wm(t,i,r,o),t.enum=e.entries,t.options=Object.values(e.entries);let n=new Set(Object.keys(e.entries));t.extract=(i,r)=>{let o={};for(let s of i)if(n.has(s))o[s]=e.entries[s];else throw new Error(`Key ${s} not found in enum`);return new Kr({...e,checks:[],...S.normalizeParams(r),entries:o})},t.exclude=(i,r)=>{let o={...e.entries};for(let s of i)if(n.has(s))delete o[s];else throw new Error(`Key ${s} not found in enum`);return new Kr({...e,checks:[],...S.normalizeParams(r),entries:o})}});function je(t,e){let n=Array.isArray(t)?Object.fromEntries(t.map(i=>[i,i])):t;return new Kr({type:"enum",entries:n,...S.normalizeParams(e)})}function nx(t,e){return new Kr({type:"enum",entries:t,...S.normalizeParams(e)})}var Qf=g("ZodLiteral",(t,e)=>{Rc.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Jm(t,n,i,r),t.values=new Set(e.values),Object.defineProperty(t,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});function M(t,e){return new Qf({type:"literal",values:Array.isArray(t)?t:[t],...S.normalizeParams(e)})}var eh=g("ZodFile",(t,e)=>{Oc.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Qm(t,n,i,r),t.min=(n,i)=>t.check(Ft(n,i)),t.max=(n,i)=>t.check(_n(n,i)),t.mime=(n,i)=>t.check(Mr(Array.isArray(n)?n:[n],i))});function rx(t){return Su(eh,t)}var th=g("ZodTransform",(t,e)=>{Pc.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,i,r)=>rf(t,n,i,r),t._zod.parse=(n,i)=>{if(i.direction==="backward")throw new un(t.constructor.name);n.addIssue=o=>{if(typeof o=="string")n.issues.push(S.issue(o,n.value,e));else{let s=o;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=n.value),s.inst??(s.inst=t),n.issues.push(S.issue(s))}};let r=e.transform(n.value,n);return r instanceof Promise?r.then(o=>(n.value=o,n.fallback=!0,n)):(n.value=r,n.fallback=!0,n)}});function sl(t){return new th({type:"transform",transform:t})}var ei=g("ZodOptional",(t,e)=>{So.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Au(t,n,i,r),t.unwrap=()=>t._zod.def.innerType});function ye(t){return new ei({type:"optional",innerType:t})}var nh=g("ZodExactOptional",(t,e)=>{Ac.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Au(t,n,i,r),t.unwrap=()=>t._zod.def.innerType});function rh(t){return new nh({type:"optional",innerType:t})}var ih=g("ZodNullable",(t,e)=>{Nc.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,i,r)=>pf(t,n,i,r),t.unwrap=()=>t._zod.def.innerType});function Go(t){return new ih({type:"nullable",innerType:t})}function ix(t){return ye(Go(t))}var oh=g("ZodDefault",(t,e)=>{Cc.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,i,r)=>ff(t,n,i,r),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function sh(t,e){return new oh({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():S.shallowClone(e)}})}var ah=g("ZodPrefault",(t,e)=>{zc.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,i,r)=>hf(t,n,i,r),t.unwrap=()=>t._zod.def.innerType});function ch(t,e){return new ah({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():S.shallowClone(e)}})}var al=g("ZodNonOptional",(t,e)=>{Dc.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,i,r)=>mf(t,n,i,r),t.unwrap=()=>t._zod.def.innerType});function uh(t,e){return new al({type:"nonoptional",innerType:t,...S.normalizeParams(e)})}var lh=g("ZodSuccess",(t,e)=>{jc.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,i,r)=>ef(t,n,i,r),t.unwrap=()=>t._zod.def.innerType});function ox(t){return new lh({type:"success",innerType:t})}var dh=g("ZodCatch",(t,e)=>{Uc.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,i,r)=>gf(t,n,i,r),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function ph(t,e){return new dh({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}var mh=g("ZodNaN",(t,e)=>{Mc.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Ym(t,n,i,r)});function sx(t){return bu(mh,t)}var ns=g("ZodPipe",(t,e)=>{$o.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,i,r)=>bf(t,n,i,r),t.in=e.in,t.out=e.out});function Lu(t,e){return new ns({type:"pipe",in:t,out:e})}var rs=g("ZodCodec",(t,e)=>{ns.init(t,e),Tr.init(t,e)});function ax(t,e,n){return new rs({type:"pipe",in:t,out:e,transform:n.decode,reverseTransform:n.encode})}function cx(t){let e=t._zod.def;return new rs({type:"pipe",in:e.out,out:e.in,transform:e.reverseTransform,reverseTransform:e.transform})}var fh=g("ZodPreprocess",(t,e)=>{ns.init(t,e),xm.init(t,e)}),hh=g("ZodReadonly",(t,e)=>{Lc.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,i,r)=>_f(t,n,i,r),t.unwrap=()=>t._zod.def.innerType});function gh(t){return new hh({type:"readonly",innerType:t})}var bh=g("ZodTemplateLiteral",(t,e)=>{Zc.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Xm(t,n,i,r)});function ux(t,e){return new bh({type:"template_literal",parts:t,...S.normalizeParams(e)})}var _h=g("ZodLazy",(t,e)=>{qc.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,i,r)=>vf(t,n,i,r),t.unwrap=()=>t._zod.def.getter()});function yh(t){return new _h({type:"lazy",getter:t})}var vh=g("ZodPromise",(t,e)=>{Bc.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,i,r)=>yf(t,n,i,r),t.unwrap=()=>t._zod.def.innerType});function lx(t){return new vh({type:"promise",innerType:t})}var kh=g("ZodFunction",(t,e)=>{Fc.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,i,r)=>nf(t,n,i,r)});function dx(t){return new kh({type:"function",input:Array.isArray(t?.input)?Jf(t?.input):t?.input??X(ge()),output:t?.output??ge()})}var is=g("ZodCustom",(t,e)=>{Vc.init(t,e),K.init(t,e),t._zod.processJSONSchema=(n,i,r)=>tf(t,n,i,r)});function px(t){let e=new fe({check:"custom"});return e._zod.check=t,e}function cl(t,e){return $u(is,t??(()=>!0),e)}function xh(t,e={}){return Iu(is,t,e)}function Sh(t,e){return wu(t,e)}var mx=Eu,fx=Tu;function hx(t,e={}){let n=new is({type:"custom",check:"custom",fn:i=>i instanceof t,abort:!0,...S.normalizeParams(e)});return n._zod.bag.Class=t,n._zod.check=i=>{i.value instanceof t||i.issues.push({code:"invalid_type",expected:t.name,input:i.value,inst:n,path:[...n._zod.def.path??[]]})},n}var gx=(...t)=>Ru({Codec:rs,Boolean:Yr,String:Gr},...t);function bx(t){let e=yh(()=>be([_(t),ae(),Re(),Yo(),X(e),me(_(),e)]));return e}function os(t,e){return new fh({type:"pipe",in:sl(t),out:e})}var eP={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 tP(t){Te({customError:t})}function nP(){return Te().customError}var $h;$h||($h={});var T={...Ho,...Cu,iso:xn},rP=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function iP(t,e){let n=t.$schema;return n==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":n==="http://json-schema.org/draft-07/schema#"?"draft-7":n==="http://json-schema.org/draft-04/schema#"?"draft-4":e??"draft-2020-12"}function oP(t,e){if(!t.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let n=t.slice(1).split("/").filter(Boolean);if(n.length===0)return e.rootSchema;let i=e.version==="draft-2020-12"?"$defs":"definitions";if(n[0]===i){let r=n[1];if(!r||!e.defs[r])throw new Error(`Reference not found: ${t}`);return e.defs[r]}throw new Error(`Reference not found: ${t}`)}function _x(t,e){if(t.not!==void 0){if(typeof t.not=="object"&&Object.keys(t.not).length===0)return T.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(t.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(t.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(t.if!==void 0||t.then!==void 0||t.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(t.dependentSchemas!==void 0||t.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(t.$ref){let r=t.$ref;if(e.refs.has(r))return e.refs.get(r);if(e.processing.has(r))return T.lazy(()=>{if(!e.refs.has(r))throw new Error(`Circular reference not resolved: ${r}`);return e.refs.get(r)});e.processing.add(r);let o=oP(r,e),s=Fe(o,e);return e.refs.set(r,s),e.processing.delete(r),s}if(t.enum!==void 0){let r=t.enum;if(e.version==="openapi-3.0"&&t.nullable===!0&&r.length===1&&r[0]===null)return T.null();if(r.length===0)return T.never();if(r.length===1)return T.literal(r[0]);if(r.every(s=>typeof s=="string"))return T.enum(r);let o=r.map(s=>T.literal(s));return o.length<2?o[0]:T.union([o[0],o[1],...o.slice(2)])}if(t.const!==void 0)return T.literal(t.const);let n=t.type;if(Array.isArray(n)){let r=n.map(o=>{let s={...t,type:o};return _x(s,e)});return r.length===0?T.never():r.length===1?r[0]:T.union(r)}if(!n)return T.any();let i;switch(n){case"string":{let r=T.string();if(t.format){let o=t.format;o==="email"?r=r.check(T.email()):o==="uri"||o==="uri-reference"?r=r.check(T.url()):o==="uuid"||o==="guid"?r=r.check(T.uuid()):o==="date-time"?r=r.check(T.iso.datetime()):o==="date"?r=r.check(T.iso.date()):o==="time"?r=r.check(T.iso.time()):o==="duration"?r=r.check(T.iso.duration()):o==="ipv4"?r=r.check(T.ipv4()):o==="ipv6"?r=r.check(T.ipv6()):o==="mac"?r=r.check(T.mac()):o==="cidr"?r=r.check(T.cidrv4()):o==="cidr-v6"?r=r.check(T.cidrv6()):o==="base64"?r=r.check(T.base64()):o==="base64url"?r=r.check(T.base64url()):o==="e164"?r=r.check(T.e164()):o==="jwt"?r=r.check(T.jwt()):o==="emoji"?r=r.check(T.emoji()):o==="nanoid"?r=r.check(T.nanoid()):o==="cuid"?r=r.check(T.cuid()):o==="cuid2"?r=r.check(T.cuid2()):o==="ulid"?r=r.check(T.ulid()):o==="xid"?r=r.check(T.xid()):o==="ksuid"&&(r=r.check(T.ksuid()))}typeof t.minLength=="number"&&(r=r.min(t.minLength)),typeof t.maxLength=="number"&&(r=r.max(t.maxLength)),t.pattern&&(r=r.regex(new RegExp(t.pattern))),i=r;break}case"number":case"integer":{let r=n==="integer"?T.number().int():T.number();typeof t.minimum=="number"&&(r=r.min(t.minimum)),typeof t.maximum=="number"&&(r=r.max(t.maximum)),typeof t.exclusiveMinimum=="number"?r=r.gt(t.exclusiveMinimum):t.exclusiveMinimum===!0&&typeof t.minimum=="number"&&(r=r.gt(t.minimum)),typeof t.exclusiveMaximum=="number"?r=r.lt(t.exclusiveMaximum):t.exclusiveMaximum===!0&&typeof t.maximum=="number"&&(r=r.lt(t.maximum)),typeof t.multipleOf=="number"&&(r=r.multipleOf(t.multipleOf)),i=r;break}case"boolean":{i=T.boolean();break}case"null":{i=T.null();break}case"object":{let r={},o=t.properties||{},s=new Set(t.required||[]);for(let[u,d]of Object.entries(o)){let l=Fe(d,e);r[u]=s.has(u)?l:l.optional()}if(t.propertyNames){let u=Fe(t.propertyNames,e),d=t.additionalProperties&&typeof t.additionalProperties=="object"?Fe(t.additionalProperties,e):T.any();if(Object.keys(r).length===0){i=T.record(u,d);break}let l=T.object(r).passthrough(),p=T.looseRecord(u,d);i=T.intersection(l,p);break}if(t.patternProperties){let u=t.patternProperties,d=Object.keys(u),l=[];for(let m of d){let f=Fe(u[m],e),h=T.string().regex(new RegExp(m));l.push(T.looseRecord(h,f))}let p=[];if(Object.keys(r).length>0&&p.push(T.object(r).passthrough()),p.push(...l),p.length===0)i=T.object({}).passthrough();else if(p.length===1)i=p[0];else{let m=T.intersection(p[0],p[1]);for(let f=2;f<p.length;f++)m=T.intersection(m,p[f]);i=m}break}let c=T.object(r);t.additionalProperties===!1?i=c.strict():typeof t.additionalProperties=="object"?i=c.catchall(Fe(t.additionalProperties,e)):i=c.passthrough();break}case"array":{let r=t.prefixItems,o=t.items;if(r&&Array.isArray(r)){let s=r.map(u=>Fe(u,e)),c=o&&typeof o=="object"&&!Array.isArray(o)?Fe(o,e):void 0;c?i=T.tuple(s).rest(c):i=T.tuple(s),typeof t.minItems=="number"&&(i=i.check(T.minLength(t.minItems))),typeof t.maxItems=="number"&&(i=i.check(T.maxLength(t.maxItems)))}else if(Array.isArray(o)){let s=o.map(u=>Fe(u,e)),c=t.additionalItems&&typeof t.additionalItems=="object"?Fe(t.additionalItems,e):void 0;c?i=T.tuple(s).rest(c):i=T.tuple(s),typeof t.minItems=="number"&&(i=i.check(T.minLength(t.minItems))),typeof t.maxItems=="number"&&(i=i.check(T.maxLength(t.maxItems)))}else if(o!==void 0){let s=Fe(o,e),c=T.array(s);typeof t.minItems=="number"&&(c=c.min(t.minItems)),typeof t.maxItems=="number"&&(c=c.max(t.maxItems)),i=c}else i=T.array(T.any());break}default:throw new Error(`Unsupported type: ${n}`)}return i}function Fe(t,e){if(typeof t=="boolean")return t?T.any():T.never();let n=_x(t,e),i=t.type||t.enum!==void 0||t.const!==void 0;if(t.anyOf&&Array.isArray(t.anyOf)){let c=t.anyOf.map(d=>Fe(d,e)),u=T.union(c);n=i?T.intersection(n,u):u}if(t.oneOf&&Array.isArray(t.oneOf)){let c=t.oneOf.map(d=>Fe(d,e)),u=T.xor(c);n=i?T.intersection(n,u):u}if(t.allOf&&Array.isArray(t.allOf))if(t.allOf.length===0)n=i?n:T.any();else{let c=i?n:Fe(t.allOf[0],e),u=i?0:1;for(let d=u;d<t.allOf.length;d++)c=T.intersection(c,Fe(t.allOf[d],e));n=c}t.nullable===!0&&e.version==="openapi-3.0"&&(n=T.nullable(n)),t.readOnly===!0&&(n=T.readonly(n)),t.default!==void 0&&(n=n.default(t.default));let r={},o=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let c of o)c in t&&(r[c]=t[c]);let s=["contentEncoding","contentMediaType","contentSchema"];for(let c of s)c in t&&(r[c]=t[c]);for(let c of Object.keys(t))rP.has(c)||(r[c]=t[c]);return Object.keys(r).length>0&&e.registry.add(n,r),t.description&&(n=n.describe(t.description)),n}function yx(t,e){if(typeof t=="boolean")return t?T.any():T.never();let n;try{n=JSON.parse(JSON.stringify(t))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let i=iP(n,e?.defaultTarget),r=n.$defs||n.definitions||{},o={version:i,defs:r,refs:new Map,processing:new Set,rootSchema:n,registry:e?.registry??ze};return Fe(n,o)}var Ih={};Jt(Ih,{bigint:()=>uP,boolean:()=>cP,date:()=>lP,number:()=>aP,string:()=>sP});function sP(t){return Im(Gr,t)}function aP(t){return Pm(Jr,t)}function cP(t){return Am(Yr,t)}function uP(t){return Nm(Xr,t)}function lP(t){return Cm(Xo,t)}Te(Hc());var Eh="2025-11-25";var vx=[Eh,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],Sn="io.modelcontextprotocol/related-task",ll="2.0",Ae=cl(t=>t!==null&&(typeof t=="object"||typeof t=="function")),kx=be([_(),ae().int()]),xx=_(),DB=De({ttl:ae().optional(),pollInterval:ae().optional()}),dP=P({ttl:ae().optional()}),pP=P({taskId:_()}),Th=De({progressToken:kx.optional(),[Sn]:pP.optional()}),dt=P({_meta:Th.optional()}),ss=dt.extend({task:dP.optional()}),Sx=t=>ss.safeParse(t).success,Ue=P({method:_(),params:dt.loose().optional()}),bt=P({_meta:Th.optional()}),_t=P({method:_(),params:bt.loose().optional()}),Me=De({_meta:Th.optional()}),dl=be([_(),ae().int()]),$x=P({jsonrpc:M(ll),id:dl,...Ue.shape}).strict(),Rh=t=>$x.safeParse(t).success,Ix=P({jsonrpc:M(ll),..._t.shape}).strict(),wx=t=>Ix.safeParse(t).success,Oh=P({jsonrpc:M(ll),id:dl,result:Me}).strict(),as=t=>Oh.safeParse(t).success;var F;(function(t){t[t.ConnectionClosed=-32e3]="ConnectionClosed",t[t.RequestTimeout=-32001]="RequestTimeout",t[t.ParseError=-32700]="ParseError",t[t.InvalidRequest=-32600]="InvalidRequest",t[t.MethodNotFound=-32601]="MethodNotFound",t[t.InvalidParams=-32602]="InvalidParams",t[t.InternalError=-32603]="InternalError",t[t.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(F||(F={}));var Ph=P({jsonrpc:M(ll),id:dl.optional(),error:P({code:ae().int(),message:_(),data:ge().optional()})}).strict();var Ex=t=>Ph.safeParse(t).success;var Tx=be([$x,Ix,Oh,Ph]),jB=be([Oh,Ph]),pl=Me.strict(),mP=bt.extend({requestId:dl.optional(),reason:_().optional()}),ml=_t.extend({method:M("notifications/cancelled"),params:mP}),fP=P({src:_(),mimeType:_().optional(),sizes:X(_()).optional(),theme:je(["light","dark"]).optional()}),cs=P({icons:X(fP).optional()}),ti=P({name:_(),title:_().optional()}),Rx=ti.extend({...ti.shape,...cs.shape,version:_(),websiteUrl:_().optional(),description:_().optional()}),hP=Qr(P({applyDefaults:Re().optional()}),me(_(),ge())),gP=os(t=>t&&typeof t=="object"&&!Array.isArray(t)&&Object.keys(t).length===0?{form:{}}:t,Qr(P({form:hP.optional(),url:Ae.optional()}),me(_(),ge()).optional())),bP=De({list:Ae.optional(),cancel:Ae.optional(),requests:De({sampling:De({createMessage:Ae.optional()}).optional(),elicitation:De({create:Ae.optional()}).optional()}).optional()}),_P=De({list:Ae.optional(),cancel:Ae.optional(),requests:De({tools:De({call:Ae.optional()}).optional()}).optional()}),yP=P({experimental:me(_(),Ae).optional(),sampling:P({context:Ae.optional(),tools:Ae.optional()}).optional(),elicitation:gP.optional(),roots:P({listChanged:Re().optional()}).optional(),tasks:bP.optional(),extensions:me(_(),Ae).optional()}),vP=dt.extend({protocolVersion:_(),capabilities:yP,clientInfo:Rx}),Ah=Ue.extend({method:M("initialize"),params:vP});var kP=P({experimental:me(_(),Ae).optional(),logging:Ae.optional(),completions:Ae.optional(),prompts:P({listChanged:Re().optional()}).optional(),resources:P({subscribe:Re().optional(),listChanged:Re().optional()}).optional(),tools:P({listChanged:Re().optional()}).optional(),tasks:_P.optional(),extensions:me(_(),Ae).optional()}),xP=Me.extend({protocolVersion:_(),capabilities:kP,serverInfo:Rx,instructions:_().optional()}),Nh=_t.extend({method:M("notifications/initialized"),params:bt.optional()});var fl=Ue.extend({method:M("ping"),params:dt.optional()}),SP=P({progress:ae(),total:ye(ae()),message:ye(_())}),$P=P({...bt.shape,...SP.shape,progressToken:kx}),hl=_t.extend({method:M("notifications/progress"),params:$P}),IP=dt.extend({cursor:xx.optional()}),us=Ue.extend({params:IP.optional()}),ls=Me.extend({nextCursor:xx.optional()}),wP=je(["working","input_required","completed","failed","cancelled"]),ds=P({taskId:_(),status:wP,ttl:be([ae(),Yo()]),createdAt:_(),lastUpdatedAt:_(),pollInterval:ye(ae()),statusMessage:ye(_())}),ni=Me.extend({task:ds}),EP=bt.merge(ds),ps=_t.extend({method:M("notifications/tasks/status"),params:EP}),gl=Ue.extend({method:M("tasks/get"),params:dt.extend({taskId:_()})}),bl=Me.merge(ds),_l=Ue.extend({method:M("tasks/result"),params:dt.extend({taskId:_()})}),UB=Me.loose(),yl=us.extend({method:M("tasks/list")}),vl=ls.extend({tasks:X(ds)}),kl=Ue.extend({method:M("tasks/cancel"),params:dt.extend({taskId:_()})}),Ox=Me.merge(ds),Px=P({uri:_(),mimeType:ye(_()),_meta:me(_(),ge()).optional()}),Ax=Px.extend({text:_()}),Ch=_().refine(t=>{try{return atob(t),!0}catch{return!1}},{message:"Invalid Base64 string"}),Nx=Px.extend({blob:Ch}),ms=je(["user","assistant"]),ri=P({audience:X(ms).optional(),priority:ae().min(0).max(1).optional(),lastModified:xn.datetime({offset:!0}).optional()}),Cx=P({...ti.shape,...cs.shape,uri:_(),description:ye(_()),mimeType:ye(_()),size:ye(ae()),annotations:ri.optional(),_meta:ye(De({}))}),TP=P({...ti.shape,...cs.shape,uriTemplate:_(),description:ye(_()),mimeType:ye(_()),annotations:ri.optional(),_meta:ye(De({}))}),xl=us.extend({method:M("resources/list")}),RP=ls.extend({resources:X(Cx)}),Sl=us.extend({method:M("resources/templates/list")}),OP=ls.extend({resourceTemplates:X(TP)}),zh=dt.extend({uri:_()}),PP=zh,$l=Ue.extend({method:M("resources/read"),params:PP}),AP=Me.extend({contents:X(be([Ax,Nx]))}),NP=_t.extend({method:M("notifications/resources/list_changed"),params:bt.optional()}),CP=zh,zP=Ue.extend({method:M("resources/subscribe"),params:CP}),DP=zh,jP=Ue.extend({method:M("resources/unsubscribe"),params:DP}),UP=bt.extend({uri:_()}),MP=_t.extend({method:M("notifications/resources/updated"),params:UP}),LP=P({name:_(),description:ye(_()),required:ye(Re())}),ZP=P({...ti.shape,...cs.shape,description:ye(_()),arguments:ye(X(LP)),_meta:ye(De({}))}),Il=us.extend({method:M("prompts/list")}),FP=ls.extend({prompts:X(ZP)}),BP=dt.extend({name:_(),arguments:me(_(),_()).optional()}),wl=Ue.extend({method:M("prompts/get"),params:BP}),Dh=P({type:M("text"),text:_(),annotations:ri.optional(),_meta:me(_(),ge()).optional()}),jh=P({type:M("image"),data:Ch,mimeType:_(),annotations:ri.optional(),_meta:me(_(),ge()).optional()}),Uh=P({type:M("audio"),data:Ch,mimeType:_(),annotations:ri.optional(),_meta:me(_(),ge()).optional()}),qP=P({type:M("tool_use"),name:_(),id:_(),input:me(_(),ge()),_meta:me(_(),ge()).optional()}),VP=P({type:M("resource"),resource:be([Ax,Nx]),annotations:ri.optional(),_meta:me(_(),ge()).optional()}),HP=Cx.extend({type:M("resource_link")}),Mh=be([Dh,jh,Uh,HP,VP]),KP=P({role:ms,content:Mh}),GP=Me.extend({description:_().optional(),messages:X(KP)}),WP=_t.extend({method:M("notifications/prompts/list_changed"),params:bt.optional()}),JP=P({title:_().optional(),readOnlyHint:Re().optional(),destructiveHint:Re().optional(),idempotentHint:Re().optional(),openWorldHint:Re().optional()}),YP=P({taskSupport:je(["required","optional","forbidden"]).optional()}),zx=P({...ti.shape,...cs.shape,description:_().optional(),inputSchema:P({type:M("object"),properties:me(_(),Ae).optional(),required:X(_()).optional()}).catchall(ge()),outputSchema:P({type:M("object"),properties:me(_(),Ae).optional(),required:X(_()).optional()}).catchall(ge()).optional(),annotations:JP.optional(),execution:YP.optional(),_meta:me(_(),ge()).optional()}),El=us.extend({method:M("tools/list")}),XP=ls.extend({tools:X(zx)}),Tl=Me.extend({content:X(Mh).default([]),structuredContent:me(_(),ge()).optional(),isError:Re().optional()}),MB=Tl.or(Me.extend({toolResult:ge()})),QP=ss.extend({name:_(),arguments:me(_(),ge()).optional()}),ii=Ue.extend({method:M("tools/call"),params:QP}),eA=_t.extend({method:M("notifications/tools/list_changed"),params:bt.optional()}),LB=P({autoRefresh:Re().default(!0),debounceMs:ae().int().nonnegative().default(300)}),fs=je(["debug","info","notice","warning","error","critical","alert","emergency"]),tA=dt.extend({level:fs}),Lh=Ue.extend({method:M("logging/setLevel"),params:tA}),nA=bt.extend({level:fs,logger:_().optional(),data:ge()}),rA=_t.extend({method:M("notifications/message"),params:nA}),iA=P({name:_().optional()}),oA=P({hints:X(iA).optional(),costPriority:ae().min(0).max(1).optional(),speedPriority:ae().min(0).max(1).optional(),intelligencePriority:ae().min(0).max(1).optional()}),sA=P({mode:je(["auto","required","none"]).optional()}),aA=P({type:M("tool_result"),toolUseId:_().describe("The unique identifier for the corresponding tool call."),content:X(Mh).default([]),structuredContent:P({}).loose().optional(),isError:Re().optional(),_meta:me(_(),ge()).optional()}),cA=ts("type",[Dh,jh,Uh]),ul=ts("type",[Dh,jh,Uh,qP,aA]),uA=P({role:ms,content:be([ul,X(ul)]),_meta:me(_(),ge()).optional()}),lA=ss.extend({messages:X(uA),modelPreferences:oA.optional(),systemPrompt:_().optional(),includeContext:je(["none","thisServer","allServers"]).optional(),temperature:ae().optional(),maxTokens:ae().int(),stopSequences:X(_()).optional(),metadata:Ae.optional(),tools:X(zx).optional(),toolChoice:sA.optional()}),dA=Ue.extend({method:M("sampling/createMessage"),params:lA}),hs=Me.extend({model:_(),stopReason:ye(je(["endTurn","stopSequence","maxTokens"]).or(_())),role:ms,content:cA}),Zh=Me.extend({model:_(),stopReason:ye(je(["endTurn","stopSequence","maxTokens","toolUse"]).or(_())),role:ms,content:be([ul,X(ul)])}),pA=P({type:M("boolean"),title:_().optional(),description:_().optional(),default:Re().optional()}),mA=P({type:M("string"),title:_().optional(),description:_().optional(),minLength:ae().optional(),maxLength:ae().optional(),format:je(["email","uri","date","date-time"]).optional(),default:_().optional()}),fA=P({type:je(["number","integer"]),title:_().optional(),description:_().optional(),minimum:ae().optional(),maximum:ae().optional(),default:ae().optional()}),hA=P({type:M("string"),title:_().optional(),description:_().optional(),enum:X(_()),default:_().optional()}),gA=P({type:M("string"),title:_().optional(),description:_().optional(),oneOf:X(P({const:_(),title:_()})),default:_().optional()}),bA=P({type:M("string"),title:_().optional(),description:_().optional(),enum:X(_()),enumNames:X(_()).optional(),default:_().optional()}),_A=be([hA,gA]),yA=P({type:M("array"),title:_().optional(),description:_().optional(),minItems:ae().optional(),maxItems:ae().optional(),items:P({type:M("string"),enum:X(_())}),default:X(_()).optional()}),vA=P({type:M("array"),title:_().optional(),description:_().optional(),minItems:ae().optional(),maxItems:ae().optional(),items:P({anyOf:X(P({const:_(),title:_()}))}),default:X(_()).optional()}),kA=be([yA,vA]),xA=be([bA,_A,kA]),SA=be([xA,pA,mA,fA]),$A=ss.extend({mode:M("form").optional(),message:_(),requestedSchema:P({type:M("object"),properties:me(_(),SA),required:X(_()).optional()})}),IA=ss.extend({mode:M("url"),message:_(),elicitationId:_(),url:_().url()}),wA=be([$A,IA]),EA=Ue.extend({method:M("elicitation/create"),params:wA}),TA=bt.extend({elicitationId:_()}),RA=_t.extend({method:M("notifications/elicitation/complete"),params:TA}),oi=Me.extend({action:je(["accept","decline","cancel"]),content:os(t=>t===null?void 0:t,me(_(),be([_(),ae(),Re(),X(_())])).optional())}),OA=P({type:M("ref/resource"),uri:_()});var PA=P({type:M("ref/prompt"),name:_()}),AA=dt.extend({ref:be([PA,OA]),argument:P({name:_(),value:_()}),context:P({arguments:me(_(),_()).optional()}).optional()}),Rl=Ue.extend({method:M("completion/complete"),params:AA});function Dx(t){if(t.params.ref.type!=="ref/prompt")throw new TypeError(`Expected CompleteRequestPrompt, but got ${t.params.ref.type}`)}function jx(t){if(t.params.ref.type!=="ref/resource")throw new TypeError(`Expected CompleteRequestResourceTemplate, but got ${t.params.ref.type}`)}var NA=Me.extend({completion:De({values:X(_()).max(100),total:ye(ae().int()),hasMore:ye(Re())})}),CA=P({uri:_().startsWith("file://"),name:_().optional(),_meta:me(_(),ge()).optional()}),zA=Ue.extend({method:M("roots/list"),params:dt.optional()}),Fh=Me.extend({roots:X(CA)}),DA=_t.extend({method:M("notifications/roots/list_changed"),params:bt.optional()}),ZB=be([fl,Ah,Rl,Lh,wl,Il,xl,Sl,$l,zP,jP,ii,El,gl,_l,yl,kl]),FB=be([ml,hl,Nh,DA,ps]),BB=be([pl,hs,Zh,oi,Fh,bl,vl,ni]),qB=be([fl,dA,EA,zA,gl,_l,yl,kl]),VB=be([ml,hl,rA,MP,NP,eA,WP,ps,RA]),HB=be([pl,xP,NA,GP,FP,RP,OP,AP,Tl,XP,bl,vl,ni]),L=class t extends Error{constructor(e,n,i){super(`MCP error ${e}: ${n}`),this.code=e,this.data=i,this.name="McpError"}static fromError(e,n,i){if(e===F.UrlElicitationRequired&&i){let r=i;if(r.elicitations)return new wh(r.elicitations,n)}return new t(e,n,i)}},wh=class extends L{constructor(e,n=`URL elicitation${e.length>1?"s":""} required`){super(F.UrlElicitationRequired,n,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}};var Ol=class{append(e){this._buffer=this._buffer?Buffer.concat([this._buffer,e]):e}readMessage(){if(!this._buffer)return null;let e=this._buffer.indexOf(`
|
|
75
|
+
`);if(e===-1)return null;let n=this._buffer.toString("utf8",0,e).replace(/\r$/,"");return this._buffer=this._buffer.subarray(e+1),jA(n)}clear(){this._buffer=void 0}};function jA(t){return Tx.parse(JSON.parse(t))}function Ux(t){return JSON.stringify(t)+`
|
|
76
|
+
`}var Pl=class{constructor(e=Mx.stdin,n=Mx.stdout){this._stdin=e,this._stdout=n,this._readBuffer=new Ol,this._started=!1,this._ondata=i=>{this._readBuffer.append(i),this.processReadBuffer()},this._onerror=i=>{this.onerror?.(i)}}async start(){if(this._started)throw new Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.");this._started=!0,this._stdin.on("data",this._ondata),this._stdin.on("error",this._onerror)}processReadBuffer(){for(;;)try{let e=this._readBuffer.readMessage();if(e===null)break;this.onmessage?.(e)}catch(e){this.onerror?.(e)}}async close(){this._stdin.off("data",this._ondata),this._stdin.off("error",this._onerror),this._stdin.listenerCount("data")===0&&this._stdin.pause(),this._readBuffer.clear(),this.onclose?.()}send(e){return new Promise(n=>{let i=Ux(e);this._stdout.write(i)?n():this._stdout.once("drain",n)})}};var ne;(function(t){t.assertEqual=r=>{};function e(r){}t.assertIs=e;function n(r){throw new Error}t.assertNever=n,t.arrayToEnum=r=>{let o={};for(let s of r)o[s]=s;return o},t.getValidEnumValues=r=>{let o=t.objectKeys(r).filter(c=>typeof r[r[c]]!="number"),s={};for(let c of o)s[c]=r[c];return t.objectValues(s)},t.objectValues=r=>t.objectKeys(r).map(function(o){return r[o]}),t.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{let o=[];for(let s in r)Object.prototype.hasOwnProperty.call(r,s)&&o.push(s);return o},t.find=(r,o)=>{for(let s of r)if(o(s))return s},t.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&Number.isFinite(r)&&Math.floor(r)===r;function i(r,o=" | "){return r.map(s=>typeof s=="string"?`'${s}'`:s).join(o)}t.joinValues=i,t.jsonStringifyReplacer=(r,o)=>typeof o=="bigint"?o.toString():o})(ne||(ne={}));var Lx;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(Lx||(Lx={}));var A=ne.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Qt=t=>{switch(typeof t){case"undefined":return A.undefined;case"string":return A.string;case"number":return Number.isNaN(t)?A.nan:A.number;case"boolean":return A.boolean;case"function":return A.function;case"bigint":return A.bigint;case"symbol":return A.symbol;case"object":return Array.isArray(t)?A.array:t===null?A.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?A.promise:typeof Map<"u"&&t instanceof Map?A.map:typeof Set<"u"&&t instanceof Set?A.set:typeof Date<"u"&&t instanceof Date?A.date:A.object;default:return A.unknown}};var $=ne.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);var pt=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};let n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){let n=e||function(o){return o.message},i={_errors:[]},r=o=>{for(let s of o.issues)if(s.code==="invalid_union")s.unionErrors.map(r);else if(s.code==="invalid_return_type")r(s.returnTypeError);else if(s.code==="invalid_arguments")r(s.argumentsError);else if(s.path.length===0)i._errors.push(n(s));else{let c=i,u=0;for(;u<s.path.length;){let d=s.path[u];u===s.path.length-1?(c[d]=c[d]||{_errors:[]},c[d]._errors.push(n(s))):c[d]=c[d]||{_errors:[]},c=c[d],u++}}};return r(this),i}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,ne.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){let n=Object.create(null),i=[];for(let r of this.issues)if(r.path.length>0){let o=r.path[0];n[o]=n[o]||[],n[o].push(e(r))}else i.push(e(r));return{formErrors:i,fieldErrors:n}}get formErrors(){return this.flatten()}};pt.create=t=>new pt(t);var UA=(t,e)=>{let n;switch(t.code){case $.invalid_type:t.received===A.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case $.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,ne.jsonStringifyReplacer)}`;break;case $.unrecognized_keys:n=`Unrecognized key(s) in object: ${ne.joinValues(t.keys,", ")}`;break;case $.invalid_union:n="Invalid input";break;case $.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${ne.joinValues(t.options)}`;break;case $.invalid_enum_value:n=`Invalid enum value. Expected ${ne.joinValues(t.options)}, received '${t.received}'`;break;case $.invalid_arguments:n="Invalid function arguments";break;case $.invalid_return_type:n="Invalid function return type";break;case $.invalid_date:n="Invalid date";break;case $.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:ne.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case $.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case $.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case $.custom:n="Invalid input";break;case $.invalid_intersection_types:n="Intersection results could not be merged";break;case $.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case $.not_finite:n="Number must be finite";break;default:n=e.defaultError,ne.assertNever(t)}return{message:n}},$n=UA;var MA=$n;function gs(){return MA}var Al=t=>{let{data:e,path:n,errorMaps:i,issueData:r}=t,o=[...n,...r.path||[]],s={...r,path:o};if(r.message!==void 0)return{...r,path:o,message:r.message};let c="",u=i.filter(d=>!!d).slice().reverse();for(let d of u)c=d(s,{data:e,defaultError:c}).message;return{...r,path:o,message:c}};function R(t,e){let n=gs(),i=Al({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===$n?void 0:$n].filter(r=>!!r)});t.common.issues.push(i)}var Be=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){let i=[];for(let r of n){if(r.status==="aborted")return B;r.status==="dirty"&&e.dirty(),i.push(r.value)}return{status:e.value,value:i}}static async mergeObjectAsync(e,n){let i=[];for(let r of n){let o=await r.key,s=await r.value;i.push({key:o,value:s})}return t.mergeObjectSync(e,i)}static mergeObjectSync(e,n){let i={};for(let r of n){let{key:o,value:s}=r;if(o.status==="aborted"||s.status==="aborted")return B;o.status==="dirty"&&e.dirty(),s.status==="dirty"&&e.dirty(),o.value!=="__proto__"&&(typeof s.value<"u"||r.alwaysSet)&&(i[o.value]=s.value)}return{status:e.value,value:i}}},B=Object.freeze({status:"aborted"}),si=t=>({status:"dirty",value:t}),Je=t=>({status:"valid",value:t}),Bh=t=>t.status==="aborted",qh=t=>t.status==="dirty",tr=t=>t.status==="valid",bs=t=>typeof Promise<"u"&&t instanceof Promise;var U;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(U||(U={}));var yt=class{constructor(e,n,i,r){this._cachedPath=[],this.parent=e,this.data=n,this._path=i,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},Zx=(t,e)=>{if(tr(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let n=new pt(t.common.issues);return this._error=n,this._error}}};function G(t){if(!t)return{};let{errorMap:e,invalid_type_error:n,required_error:i,description:r}=t;if(e&&(n||i))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:r}:{errorMap:(s,c)=>{let{message:u}=t;return s.code==="invalid_enum_value"?{message:u??c.defaultError}:typeof c.data>"u"?{message:u??i??c.defaultError}:s.code!=="invalid_type"?{message:c.defaultError}:{message:u??n??c.defaultError}},description:r}}var Q=class{get description(){return this._def.description}_getType(e){return Qt(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:Qt(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Be,ctx:{common:e.parent.common,data:e.data,parsedType:Qt(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let n=this._parse(e);if(bs(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){let n=this._parse(e);return Promise.resolve(n)}parse(e,n){let i=this.safeParse(e,n);if(i.success)return i.data;throw i.error}safeParse(e,n){let i={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Qt(e)},r=this._parseSync({data:e,path:i.path,parent:i});return Zx(i,r)}"~validate"(e){let n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Qt(e)};if(!this["~standard"].async)try{let i=this._parseSync({data:e,path:[],parent:n});return tr(i)?{value:i.value}:{issues:n.common.issues}}catch(i){i?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(i=>tr(i)?{value:i.value}:{issues:n.common.issues})}async parseAsync(e,n){let i=await this.safeParseAsync(e,n);if(i.success)return i.data;throw i.error}async safeParseAsync(e,n){let i={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Qt(e)},r=this._parse({data:e,path:i.path,parent:i}),o=await(bs(r)?r:Promise.resolve(r));return Zx(i,o)}refine(e,n){let i=r=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(r):n;return this._refinement((r,o)=>{let s=e(r),c=()=>o.addIssue({code:$.custom,...i(r)});return typeof Promise<"u"&&s instanceof Promise?s.then(u=>u?!0:(c(),!1)):s?!0:(c(),!1)})}refinement(e,n){return this._refinement((i,r)=>e(i)?!0:(r.addIssue(typeof n=="function"?n(i,r):n),!1))}_refinement(e){return new Ot({schema:this,typeName:w.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return Rt.create(this,this._def)}nullable(){return nn.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return wn.create(this)}promise(){return nr.create(this,this._def)}or(e){return di.create([this,e],this._def)}and(e){return pi.create(this,e,this._def)}transform(e){return new Ot({...G(this._def),schema:this,typeName:w.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let n=typeof e=="function"?e:()=>e;return new bi({...G(this._def),innerType:this,defaultValue:n,typeName:w.ZodDefault})}brand(){return new Nl({typeName:w.ZodBranded,type:this,...G(this._def)})}catch(e){let n=typeof e=="function"?e:()=>e;return new _i({...G(this._def),innerType:this,catchValue:n,typeName:w.ZodCatch})}describe(e){let n=this.constructor;return new n({...this._def,description:e})}pipe(e){return Cl.create(this,e)}readonly(){return yi.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},LA=/^c[^\s-]{8,}$/i,ZA=/^[0-9a-z]+$/,FA=/^[0-9A-HJKMNP-TV-Z]{26}$/i,BA=/^[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,qA=/^[a-z0-9_-]{21}$/i,VA=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,HA=/^[-+]?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)?)??$/,KA=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,GA="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Vh,WA=/^(?:(?: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])$/,JA=/^(?:(?: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])$/,YA=/^(([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]))$/,XA=/^(([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])$/,QA=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,eN=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Fx="((\\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])))",tN=new RegExp(`^${Fx}$`);function Bx(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function nN(t){return new RegExp(`^${Bx(t)}$`)}function rN(t){let e=`${Fx}T${Bx(t)}`,n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function iN(t,e){return!!((e==="v4"||!e)&&WA.test(t)||(e==="v6"||!e)&&YA.test(t))}function oN(t,e){if(!VA.test(t))return!1;try{let[n]=t.split(".");if(!n)return!1;let i=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),r=JSON.parse(atob(i));return!(typeof r!="object"||r===null||"typ"in r&&r?.typ!=="JWT"||!r.alg||e&&r.alg!==e)}catch{return!1}}function sN(t,e){return!!((e==="v4"||!e)&&JA.test(t)||(e==="v6"||!e)&&XA.test(t))}var ci=class t extends Q{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==A.string){let o=this._getOrReturnCtx(e);return R(o,{code:$.invalid_type,expected:A.string,received:o.parsedType}),B}let i=new Be,r;for(let o of this._def.checks)if(o.kind==="min")e.data.length<o.value&&(r=this._getOrReturnCtx(e,r),R(r,{code:$.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),i.dirty());else if(o.kind==="max")e.data.length>o.value&&(r=this._getOrReturnCtx(e,r),R(r,{code:$.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),i.dirty());else if(o.kind==="length"){let s=e.data.length>o.value,c=e.data.length<o.value;(s||c)&&(r=this._getOrReturnCtx(e,r),s?R(r,{code:$.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):c&&R(r,{code:$.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),i.dirty())}else if(o.kind==="email")KA.test(e.data)||(r=this._getOrReturnCtx(e,r),R(r,{validation:"email",code:$.invalid_string,message:o.message}),i.dirty());else if(o.kind==="emoji")Vh||(Vh=new RegExp(GA,"u")),Vh.test(e.data)||(r=this._getOrReturnCtx(e,r),R(r,{validation:"emoji",code:$.invalid_string,message:o.message}),i.dirty());else if(o.kind==="uuid")BA.test(e.data)||(r=this._getOrReturnCtx(e,r),R(r,{validation:"uuid",code:$.invalid_string,message:o.message}),i.dirty());else if(o.kind==="nanoid")qA.test(e.data)||(r=this._getOrReturnCtx(e,r),R(r,{validation:"nanoid",code:$.invalid_string,message:o.message}),i.dirty());else if(o.kind==="cuid")LA.test(e.data)||(r=this._getOrReturnCtx(e,r),R(r,{validation:"cuid",code:$.invalid_string,message:o.message}),i.dirty());else if(o.kind==="cuid2")ZA.test(e.data)||(r=this._getOrReturnCtx(e,r),R(r,{validation:"cuid2",code:$.invalid_string,message:o.message}),i.dirty());else if(o.kind==="ulid")FA.test(e.data)||(r=this._getOrReturnCtx(e,r),R(r,{validation:"ulid",code:$.invalid_string,message:o.message}),i.dirty());else if(o.kind==="url")try{new URL(e.data)}catch{r=this._getOrReturnCtx(e,r),R(r,{validation:"url",code:$.invalid_string,message:o.message}),i.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(e.data)||(r=this._getOrReturnCtx(e,r),R(r,{validation:"regex",code:$.invalid_string,message:o.message}),i.dirty())):o.kind==="trim"?e.data=e.data.trim():o.kind==="includes"?e.data.includes(o.value,o.position)||(r=this._getOrReturnCtx(e,r),R(r,{code:$.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),i.dirty()):o.kind==="toLowerCase"?e.data=e.data.toLowerCase():o.kind==="toUpperCase"?e.data=e.data.toUpperCase():o.kind==="startsWith"?e.data.startsWith(o.value)||(r=this._getOrReturnCtx(e,r),R(r,{code:$.invalid_string,validation:{startsWith:o.value},message:o.message}),i.dirty()):o.kind==="endsWith"?e.data.endsWith(o.value)||(r=this._getOrReturnCtx(e,r),R(r,{code:$.invalid_string,validation:{endsWith:o.value},message:o.message}),i.dirty()):o.kind==="datetime"?rN(o).test(e.data)||(r=this._getOrReturnCtx(e,r),R(r,{code:$.invalid_string,validation:"datetime",message:o.message}),i.dirty()):o.kind==="date"?tN.test(e.data)||(r=this._getOrReturnCtx(e,r),R(r,{code:$.invalid_string,validation:"date",message:o.message}),i.dirty()):o.kind==="time"?nN(o).test(e.data)||(r=this._getOrReturnCtx(e,r),R(r,{code:$.invalid_string,validation:"time",message:o.message}),i.dirty()):o.kind==="duration"?HA.test(e.data)||(r=this._getOrReturnCtx(e,r),R(r,{validation:"duration",code:$.invalid_string,message:o.message}),i.dirty()):o.kind==="ip"?iN(e.data,o.version)||(r=this._getOrReturnCtx(e,r),R(r,{validation:"ip",code:$.invalid_string,message:o.message}),i.dirty()):o.kind==="jwt"?oN(e.data,o.alg)||(r=this._getOrReturnCtx(e,r),R(r,{validation:"jwt",code:$.invalid_string,message:o.message}),i.dirty()):o.kind==="cidr"?sN(e.data,o.version)||(r=this._getOrReturnCtx(e,r),R(r,{validation:"cidr",code:$.invalid_string,message:o.message}),i.dirty()):o.kind==="base64"?QA.test(e.data)||(r=this._getOrReturnCtx(e,r),R(r,{validation:"base64",code:$.invalid_string,message:o.message}),i.dirty()):o.kind==="base64url"?eN.test(e.data)||(r=this._getOrReturnCtx(e,r),R(r,{validation:"base64url",code:$.invalid_string,message:o.message}),i.dirty()):ne.assertNever(o);return{status:i.value,value:e.data}}_regex(e,n,i){return this.refinement(r=>e.test(r),{validation:n,code:$.invalid_string,...U.errToObj(i)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...U.errToObj(e)})}url(e){return this._addCheck({kind:"url",...U.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...U.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...U.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...U.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...U.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...U.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...U.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...U.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...U.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...U.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...U.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...U.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...U.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...U.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...U.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...U.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n?.position,...U.errToObj(n?.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...U.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...U.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...U.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...U.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...U.errToObj(n)})}nonempty(e){return this.min(1,U.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};ci.create=t=>new ci({checks:[],typeName:w.ZodString,coerce:t?.coerce??!1,...G(t)});function aN(t,e){let n=(t.toString().split(".")[1]||"").length,i=(e.toString().split(".")[1]||"").length,r=n>i?n:i,o=Number.parseInt(t.toFixed(r).replace(".","")),s=Number.parseInt(e.toFixed(r).replace(".",""));return o%s/10**r}var _s=class t extends Q{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==A.number){let o=this._getOrReturnCtx(e);return R(o,{code:$.invalid_type,expected:A.number,received:o.parsedType}),B}let i,r=new Be;for(let o of this._def.checks)o.kind==="int"?ne.isInteger(e.data)||(i=this._getOrReturnCtx(e,i),R(i,{code:$.invalid_type,expected:"integer",received:"float",message:o.message}),r.dirty()):o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(i=this._getOrReturnCtx(e,i),R(i,{code:$.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),r.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(i=this._getOrReturnCtx(e,i),R(i,{code:$.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),r.dirty()):o.kind==="multipleOf"?aN(e.data,o.value)!==0&&(i=this._getOrReturnCtx(e,i),R(i,{code:$.not_multiple_of,multipleOf:o.value,message:o.message}),r.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(i=this._getOrReturnCtx(e,i),R(i,{code:$.not_finite,message:o.message}),r.dirty()):ne.assertNever(o);return{status:r.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,U.toString(n))}gt(e,n){return this.setLimit("min",e,!1,U.toString(n))}lte(e,n){return this.setLimit("max",e,!0,U.toString(n))}lt(e,n){return this.setLimit("max",e,!1,U.toString(n))}setLimit(e,n,i,r){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:i,message:U.toString(r)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:U.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:U.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:U.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:U.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:U.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:U.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:U.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:U.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:U.toString(e)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&ne.isInteger(e.value))}get isFinite(){let e=null,n=null;for(let i of this._def.checks){if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf")return!0;i.kind==="min"?(n===null||i.value>n)&&(n=i.value):i.kind==="max"&&(e===null||i.value<e)&&(e=i.value)}return Number.isFinite(n)&&Number.isFinite(e)}};_s.create=t=>new _s({checks:[],typeName:w.ZodNumber,coerce:t?.coerce||!1,...G(t)});var ys=class t extends Q{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==A.bigint)return this._getInvalidInput(e);let i,r=new Be;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(i=this._getOrReturnCtx(e,i),R(i,{code:$.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),r.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(i=this._getOrReturnCtx(e,i),R(i,{code:$.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),r.dirty()):o.kind==="multipleOf"?e.data%o.value!==BigInt(0)&&(i=this._getOrReturnCtx(e,i),R(i,{code:$.not_multiple_of,multipleOf:o.value,message:o.message}),r.dirty()):ne.assertNever(o);return{status:r.value,value:e.data}}_getInvalidInput(e){let n=this._getOrReturnCtx(e);return R(n,{code:$.invalid_type,expected:A.bigint,received:n.parsedType}),B}gte(e,n){return this.setLimit("min",e,!0,U.toString(n))}gt(e,n){return this.setLimit("min",e,!1,U.toString(n))}lte(e,n){return this.setLimit("max",e,!0,U.toString(n))}lt(e,n){return this.setLimit("max",e,!1,U.toString(n))}setLimit(e,n,i,r){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:i,message:U.toString(r)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:U.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:U.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:U.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:U.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:U.toString(n)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};ys.create=t=>new ys({checks:[],typeName:w.ZodBigInt,coerce:t?.coerce??!1,...G(t)});var vs=class extends Q{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==A.boolean){let i=this._getOrReturnCtx(e);return R(i,{code:$.invalid_type,expected:A.boolean,received:i.parsedType}),B}return Je(e.data)}};vs.create=t=>new vs({typeName:w.ZodBoolean,coerce:t?.coerce||!1,...G(t)});var ks=class t extends Q{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==A.date){let o=this._getOrReturnCtx(e);return R(o,{code:$.invalid_type,expected:A.date,received:o.parsedType}),B}if(Number.isNaN(e.data.getTime())){let o=this._getOrReturnCtx(e);return R(o,{code:$.invalid_date}),B}let i=new Be,r;for(let o of this._def.checks)o.kind==="min"?e.data.getTime()<o.value&&(r=this._getOrReturnCtx(e,r),R(r,{code:$.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),i.dirty()):o.kind==="max"?e.data.getTime()>o.value&&(r=this._getOrReturnCtx(e,r),R(r,{code:$.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),i.dirty()):ne.assertNever(o);return{status:i.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:U.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:U.toString(n)})}get minDate(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}};ks.create=t=>new ks({checks:[],coerce:t?.coerce||!1,typeName:w.ZodDate,...G(t)});var xs=class extends Q{_parse(e){if(this._getType(e)!==A.symbol){let i=this._getOrReturnCtx(e);return R(i,{code:$.invalid_type,expected:A.symbol,received:i.parsedType}),B}return Je(e.data)}};xs.create=t=>new xs({typeName:w.ZodSymbol,...G(t)});var ui=class extends Q{_parse(e){if(this._getType(e)!==A.undefined){let i=this._getOrReturnCtx(e);return R(i,{code:$.invalid_type,expected:A.undefined,received:i.parsedType}),B}return Je(e.data)}};ui.create=t=>new ui({typeName:w.ZodUndefined,...G(t)});var li=class extends Q{_parse(e){if(this._getType(e)!==A.null){let i=this._getOrReturnCtx(e);return R(i,{code:$.invalid_type,expected:A.null,received:i.parsedType}),B}return Je(e.data)}};li.create=t=>new li({typeName:w.ZodNull,...G(t)});var Ss=class extends Q{constructor(){super(...arguments),this._any=!0}_parse(e){return Je(e.data)}};Ss.create=t=>new Ss({typeName:w.ZodAny,...G(t)});var In=class extends Q{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Je(e.data)}};In.create=t=>new In({typeName:w.ZodUnknown,...G(t)});var qt=class extends Q{_parse(e){let n=this._getOrReturnCtx(e);return R(n,{code:$.invalid_type,expected:A.never,received:n.parsedType}),B}};qt.create=t=>new qt({typeName:w.ZodNever,...G(t)});var $s=class extends Q{_parse(e){if(this._getType(e)!==A.undefined){let i=this._getOrReturnCtx(e);return R(i,{code:$.invalid_type,expected:A.void,received:i.parsedType}),B}return Je(e.data)}};$s.create=t=>new $s({typeName:w.ZodVoid,...G(t)});var wn=class t extends Q{_parse(e){let{ctx:n,status:i}=this._processInputParams(e),r=this._def;if(n.parsedType!==A.array)return R(n,{code:$.invalid_type,expected:A.array,received:n.parsedType}),B;if(r.exactLength!==null){let s=n.data.length>r.exactLength.value,c=n.data.length<r.exactLength.value;(s||c)&&(R(n,{code:s?$.too_big:$.too_small,minimum:c?r.exactLength.value:void 0,maximum:s?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),i.dirty())}if(r.minLength!==null&&n.data.length<r.minLength.value&&(R(n,{code:$.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),i.dirty()),r.maxLength!==null&&n.data.length>r.maxLength.value&&(R(n,{code:$.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),i.dirty()),n.common.async)return Promise.all([...n.data].map((s,c)=>r.type._parseAsync(new yt(n,s,n.path,c)))).then(s=>Be.mergeArray(i,s));let o=[...n.data].map((s,c)=>r.type._parseSync(new yt(n,s,n.path,c)));return Be.mergeArray(i,o)}get element(){return this._def.type}min(e,n){return new t({...this._def,minLength:{value:e,message:U.toString(n)}})}max(e,n){return new t({...this._def,maxLength:{value:e,message:U.toString(n)}})}length(e,n){return new t({...this._def,exactLength:{value:e,message:U.toString(n)}})}nonempty(e){return this.min(1,e)}};wn.create=(t,e)=>new wn({type:t,minLength:null,maxLength:null,exactLength:null,typeName:w.ZodArray,...G(e)});function ai(t){if(t instanceof mt){let e={};for(let n in t.shape){let i=t.shape[n];e[n]=Rt.create(ai(i))}return new mt({...t._def,shape:()=>e})}else return t instanceof wn?new wn({...t._def,type:ai(t.element)}):t instanceof Rt?Rt.create(ai(t.unwrap())):t instanceof nn?nn.create(ai(t.unwrap())):t instanceof tn?tn.create(t.items.map(e=>ai(e))):t}var mt=class t extends Q{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),n=ne.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==A.object){let d=this._getOrReturnCtx(e);return R(d,{code:$.invalid_type,expected:A.object,received:d.parsedType}),B}let{status:i,ctx:r}=this._processInputParams(e),{shape:o,keys:s}=this._getCached(),c=[];if(!(this._def.catchall instanceof qt&&this._def.unknownKeys==="strip"))for(let d in r.data)s.includes(d)||c.push(d);let u=[];for(let d of s){let l=o[d],p=r.data[d];u.push({key:{status:"valid",value:d},value:l._parse(new yt(r,p,r.path,d)),alwaysSet:d in r.data})}if(this._def.catchall instanceof qt){let d=this._def.unknownKeys;if(d==="passthrough")for(let l of c)u.push({key:{status:"valid",value:l},value:{status:"valid",value:r.data[l]}});else if(d==="strict")c.length>0&&(R(r,{code:$.unrecognized_keys,keys:c}),i.dirty());else if(d!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let d=this._def.catchall;for(let l of c){let p=r.data[l];u.push({key:{status:"valid",value:l},value:d._parse(new yt(r,p,r.path,l)),alwaysSet:l in r.data})}}return r.common.async?Promise.resolve().then(async()=>{let d=[];for(let l of u){let p=await l.key,m=await l.value;d.push({key:p,value:m,alwaysSet:l.alwaysSet})}return d}).then(d=>Be.mergeObjectSync(i,d)):Be.mergeObjectSync(i,u)}get shape(){return this._def.shape()}strict(e){return U.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,i)=>{let r=this._def.errorMap?.(n,i).message??i.defaultError;return n.code==="unrecognized_keys"?{message:U.errToObj(e).message??r}:{message:r}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:w.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let n={};for(let i of ne.objectKeys(e))e[i]&&this.shape[i]&&(n[i]=this.shape[i]);return new t({...this._def,shape:()=>n})}omit(e){let n={};for(let i of ne.objectKeys(this.shape))e[i]||(n[i]=this.shape[i]);return new t({...this._def,shape:()=>n})}deepPartial(){return ai(this)}partial(e){let n={};for(let i of ne.objectKeys(this.shape)){let r=this.shape[i];e&&!e[i]?n[i]=r:n[i]=r.optional()}return new t({...this._def,shape:()=>n})}required(e){let n={};for(let i of ne.objectKeys(this.shape))if(e&&!e[i])n[i]=this.shape[i];else{let o=this.shape[i];for(;o instanceof Rt;)o=o._def.innerType;n[i]=o}return new t({...this._def,shape:()=>n})}keyof(){return qx(ne.objectKeys(this.shape))}};mt.create=(t,e)=>new mt({shape:()=>t,unknownKeys:"strip",catchall:qt.create(),typeName:w.ZodObject,...G(e)});mt.strictCreate=(t,e)=>new mt({shape:()=>t,unknownKeys:"strict",catchall:qt.create(),typeName:w.ZodObject,...G(e)});mt.lazycreate=(t,e)=>new mt({shape:t,unknownKeys:"strip",catchall:qt.create(),typeName:w.ZodObject,...G(e)});var di=class extends Q{_parse(e){let{ctx:n}=this._processInputParams(e),i=this._def.options;function r(o){for(let c of o)if(c.result.status==="valid")return c.result;for(let c of o)if(c.result.status==="dirty")return n.common.issues.push(...c.ctx.common.issues),c.result;let s=o.map(c=>new pt(c.ctx.common.issues));return R(n,{code:$.invalid_union,unionErrors:s}),B}if(n.common.async)return Promise.all(i.map(async o=>{let s={...n,common:{...n.common,issues:[]},parent:null};return{result:await o._parseAsync({data:n.data,path:n.path,parent:s}),ctx:s}})).then(r);{let o,s=[];for(let u of i){let d={...n,common:{...n.common,issues:[]},parent:null},l=u._parseSync({data:n.data,path:n.path,parent:d});if(l.status==="valid")return l;l.status==="dirty"&&!o&&(o={result:l,ctx:d}),d.common.issues.length&&s.push(d.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;let c=s.map(u=>new pt(u));return R(n,{code:$.invalid_union,unionErrors:c}),B}}get options(){return this._def.options}};di.create=(t,e)=>new di({options:t,typeName:w.ZodUnion,...G(e)});var en=t=>t instanceof mi?en(t.schema):t instanceof Ot?en(t.innerType()):t instanceof fi?[t.value]:t instanceof hi?t.options:t instanceof gi?ne.objectValues(t.enum):t instanceof bi?en(t._def.innerType):t instanceof ui?[void 0]:t instanceof li?[null]:t instanceof Rt?[void 0,...en(t.unwrap())]:t instanceof nn?[null,...en(t.unwrap())]:t instanceof Nl||t instanceof yi?en(t.unwrap()):t instanceof _i?en(t._def.innerType):[],Hh=class t extends Q{_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==A.object)return R(n,{code:$.invalid_type,expected:A.object,received:n.parsedType}),B;let i=this.discriminator,r=n.data[i],o=this.optionsMap.get(r);return o?n.common.async?o._parseAsync({data:n.data,path:n.path,parent:n}):o._parseSync({data:n.data,path:n.path,parent:n}):(R(n,{code:$.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),B)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,i){let r=new Map;for(let o of n){let s=en(o.shape[e]);if(!s.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let c of s){if(r.has(c))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(c)}`);r.set(c,o)}}return new t({typeName:w.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:r,...G(i)})}};function Kh(t,e){let n=Qt(t),i=Qt(e);if(t===e)return{valid:!0,data:t};if(n===A.object&&i===A.object){let r=ne.objectKeys(e),o=ne.objectKeys(t).filter(c=>r.indexOf(c)!==-1),s={...t,...e};for(let c of o){let u=Kh(t[c],e[c]);if(!u.valid)return{valid:!1};s[c]=u.data}return{valid:!0,data:s}}else if(n===A.array&&i===A.array){if(t.length!==e.length)return{valid:!1};let r=[];for(let o=0;o<t.length;o++){let s=t[o],c=e[o],u=Kh(s,c);if(!u.valid)return{valid:!1};r.push(u.data)}return{valid:!0,data:r}}else return n===A.date&&i===A.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var pi=class extends Q{_parse(e){let{status:n,ctx:i}=this._processInputParams(e),r=(o,s)=>{if(Bh(o)||Bh(s))return B;let c=Kh(o.value,s.value);return c.valid?((qh(o)||qh(s))&&n.dirty(),{status:n.value,value:c.data}):(R(i,{code:$.invalid_intersection_types}),B)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([o,s])=>r(o,s)):r(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}};pi.create=(t,e,n)=>new pi({left:t,right:e,typeName:w.ZodIntersection,...G(n)});var tn=class t extends Q{_parse(e){let{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==A.array)return R(i,{code:$.invalid_type,expected:A.array,received:i.parsedType}),B;if(i.data.length<this._def.items.length)return R(i,{code:$.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),B;!this._def.rest&&i.data.length>this._def.items.length&&(R(i,{code:$.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());let o=[...i.data].map((s,c)=>{let u=this._def.items[c]||this._def.rest;return u?u._parse(new yt(i,s,i.path,c)):null}).filter(s=>!!s);return i.common.async?Promise.all(o).then(s=>Be.mergeArray(n,s)):Be.mergeArray(n,o)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};tn.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new tn({items:t,typeName:w.ZodTuple,rest:null,...G(e)})};var Gh=class t extends Q{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==A.object)return R(i,{code:$.invalid_type,expected:A.object,received:i.parsedType}),B;let r=[],o=this._def.keyType,s=this._def.valueType;for(let c in i.data)r.push({key:o._parse(new yt(i,c,i.path,c)),value:s._parse(new yt(i,i.data[c],i.path,c)),alwaysSet:c in i.data});return i.common.async?Be.mergeObjectAsync(n,r):Be.mergeObjectSync(n,r)}get element(){return this._def.valueType}static create(e,n,i){return n instanceof Q?new t({keyType:e,valueType:n,typeName:w.ZodRecord,...G(i)}):new t({keyType:ci.create(),valueType:e,typeName:w.ZodRecord,...G(n)})}},Is=class extends Q{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==A.map)return R(i,{code:$.invalid_type,expected:A.map,received:i.parsedType}),B;let r=this._def.keyType,o=this._def.valueType,s=[...i.data.entries()].map(([c,u],d)=>({key:r._parse(new yt(i,c,i.path,[d,"key"])),value:o._parse(new yt(i,u,i.path,[d,"value"]))}));if(i.common.async){let c=new Map;return Promise.resolve().then(async()=>{for(let u of s){let d=await u.key,l=await u.value;if(d.status==="aborted"||l.status==="aborted")return B;(d.status==="dirty"||l.status==="dirty")&&n.dirty(),c.set(d.value,l.value)}return{status:n.value,value:c}})}else{let c=new Map;for(let u of s){let d=u.key,l=u.value;if(d.status==="aborted"||l.status==="aborted")return B;(d.status==="dirty"||l.status==="dirty")&&n.dirty(),c.set(d.value,l.value)}return{status:n.value,value:c}}}};Is.create=(t,e,n)=>new Is({valueType:e,keyType:t,typeName:w.ZodMap,...G(n)});var ws=class t extends Q{_parse(e){let{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==A.set)return R(i,{code:$.invalid_type,expected:A.set,received:i.parsedType}),B;let r=this._def;r.minSize!==null&&i.data.size<r.minSize.value&&(R(i,{code:$.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),n.dirty()),r.maxSize!==null&&i.data.size>r.maxSize.value&&(R(i,{code:$.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),n.dirty());let o=this._def.valueType;function s(u){let d=new Set;for(let l of u){if(l.status==="aborted")return B;l.status==="dirty"&&n.dirty(),d.add(l.value)}return{status:n.value,value:d}}let c=[...i.data.values()].map((u,d)=>o._parse(new yt(i,u,i.path,d)));return i.common.async?Promise.all(c).then(u=>s(u)):s(c)}min(e,n){return new t({...this._def,minSize:{value:e,message:U.toString(n)}})}max(e,n){return new t({...this._def,maxSize:{value:e,message:U.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}};ws.create=(t,e)=>new ws({valueType:t,minSize:null,maxSize:null,typeName:w.ZodSet,...G(e)});var Wh=class t extends Q{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==A.function)return R(n,{code:$.invalid_type,expected:A.function,received:n.parsedType}),B;function i(c,u){return Al({data:c,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,gs(),$n].filter(d=>!!d),issueData:{code:$.invalid_arguments,argumentsError:u}})}function r(c,u){return Al({data:c,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,gs(),$n].filter(d=>!!d),issueData:{code:$.invalid_return_type,returnTypeError:u}})}let o={errorMap:n.common.contextualErrorMap},s=n.data;if(this._def.returns instanceof nr){let c=this;return Je(async function(...u){let d=new pt([]),l=await c._def.args.parseAsync(u,o).catch(f=>{throw d.addIssue(i(u,f)),d}),p=await Reflect.apply(s,this,l);return await c._def.returns._def.type.parseAsync(p,o).catch(f=>{throw d.addIssue(r(p,f)),d})})}else{let c=this;return Je(function(...u){let d=c._def.args.safeParse(u,o);if(!d.success)throw new pt([i(u,d.error)]);let l=Reflect.apply(s,this,d.data),p=c._def.returns.safeParse(l,o);if(!p.success)throw new pt([r(l,p.error)]);return p.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:tn.create(e).rest(In.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,i){return new t({args:e||tn.create([]).rest(In.create()),returns:n||In.create(),typeName:w.ZodFunction,...G(i)})}},mi=class extends Q{get schema(){return this._def.getter()}_parse(e){let{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}};mi.create=(t,e)=>new mi({getter:t,typeName:w.ZodLazy,...G(e)});var fi=class extends Q{_parse(e){if(e.data!==this._def.value){let n=this._getOrReturnCtx(e);return R(n,{received:n.data,code:$.invalid_literal,expected:this._def.value}),B}return{status:"valid",value:e.data}}get value(){return this._def.value}};fi.create=(t,e)=>new fi({value:t,typeName:w.ZodLiteral,...G(e)});function qx(t,e){return new hi({values:t,typeName:w.ZodEnum,...G(e)})}var hi=class t extends Q{_parse(e){if(typeof e.data!="string"){let n=this._getOrReturnCtx(e),i=this._def.values;return R(n,{expected:ne.joinValues(i),received:n.parsedType,code:$.invalid_type}),B}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let n=this._getOrReturnCtx(e),i=this._def.values;return R(n,{received:n.data,code:$.invalid_enum_value,options:i}),B}return Je(e.data)}get options(){return this._def.values}get enum(){let e={};for(let n of this._def.values)e[n]=n;return e}get Values(){let e={};for(let n of this._def.values)e[n]=n;return e}get Enum(){let e={};for(let n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return t.create(e,{...this._def,...n})}exclude(e,n=this._def){return t.create(this.options.filter(i=>!e.includes(i)),{...this._def,...n})}};hi.create=qx;var gi=class extends Q{_parse(e){let n=ne.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(e);if(i.parsedType!==A.string&&i.parsedType!==A.number){let r=ne.objectValues(n);return R(i,{expected:ne.joinValues(r),received:i.parsedType,code:$.invalid_type}),B}if(this._cache||(this._cache=new Set(ne.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let r=ne.objectValues(n);return R(i,{received:i.data,code:$.invalid_enum_value,options:r}),B}return Je(e.data)}get enum(){return this._def.values}};gi.create=(t,e)=>new gi({values:t,typeName:w.ZodNativeEnum,...G(e)});var nr=class extends Q{unwrap(){return this._def.type}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==A.promise&&n.common.async===!1)return R(n,{code:$.invalid_type,expected:A.promise,received:n.parsedType}),B;let i=n.parsedType===A.promise?n.data:Promise.resolve(n.data);return Je(i.then(r=>this._def.type.parseAsync(r,{path:n.path,errorMap:n.common.contextualErrorMap})))}};nr.create=(t,e)=>new nr({type:t,typeName:w.ZodPromise,...G(e)});var Ot=class extends Q{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===w.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:n,ctx:i}=this._processInputParams(e),r=this._def.effect||null,o={addIssue:s=>{R(i,s),s.fatal?n.abort():n.dirty()},get path(){return i.path}};if(o.addIssue=o.addIssue.bind(o),r.type==="preprocess"){let s=r.transform(i.data,o);if(i.common.async)return Promise.resolve(s).then(async c=>{if(n.value==="aborted")return B;let u=await this._def.schema._parseAsync({data:c,path:i.path,parent:i});return u.status==="aborted"?B:u.status==="dirty"?si(u.value):n.value==="dirty"?si(u.value):u});{if(n.value==="aborted")return B;let c=this._def.schema._parseSync({data:s,path:i.path,parent:i});return c.status==="aborted"?B:c.status==="dirty"?si(c.value):n.value==="dirty"?si(c.value):c}}if(r.type==="refinement"){let s=c=>{let u=r.refinement(c,o);if(i.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return c};if(i.common.async===!1){let c=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return c.status==="aborted"?B:(c.status==="dirty"&&n.dirty(),s(c.value),{status:n.value,value:c.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(c=>c.status==="aborted"?B:(c.status==="dirty"&&n.dirty(),s(c.value).then(()=>({status:n.value,value:c.value}))))}if(r.type==="transform")if(i.common.async===!1){let s=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!tr(s))return B;let c=r.transform(s.value,o);if(c instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:c}}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(s=>tr(s)?Promise.resolve(r.transform(s.value,o)).then(c=>({status:n.value,value:c})):B);ne.assertNever(r)}};Ot.create=(t,e,n)=>new Ot({schema:t,typeName:w.ZodEffects,effect:e,...G(n)});Ot.createWithPreprocess=(t,e,n)=>new Ot({schema:e,effect:{type:"preprocess",transform:t},typeName:w.ZodEffects,...G(n)});var Rt=class extends Q{_parse(e){return this._getType(e)===A.undefined?Je(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Rt.create=(t,e)=>new Rt({innerType:t,typeName:w.ZodOptional,...G(e)});var nn=class extends Q{_parse(e){return this._getType(e)===A.null?Je(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};nn.create=(t,e)=>new nn({innerType:t,typeName:w.ZodNullable,...G(e)});var bi=class extends Q{_parse(e){let{ctx:n}=this._processInputParams(e),i=n.data;return n.parsedType===A.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};bi.create=(t,e)=>new bi({innerType:t,typeName:w.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...G(e)});var _i=class extends Q{_parse(e){let{ctx:n}=this._processInputParams(e),i={...n,common:{...n.common,issues:[]}},r=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return bs(r)?r.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new pt(i.common.issues)},input:i.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new pt(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}};_i.create=(t,e)=>new _i({innerType:t,typeName:w.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...G(e)});var Es=class extends Q{_parse(e){if(this._getType(e)!==A.nan){let i=this._getOrReturnCtx(e);return R(i,{code:$.invalid_type,expected:A.nan,received:i.parsedType}),B}return{status:"valid",value:e.data}}};Es.create=t=>new Es({typeName:w.ZodNaN,...G(t)});var Nl=class extends Q{_parse(e){let{ctx:n}=this._processInputParams(e),i=n.data;return this._def.type._parse({data:i,path:n.path,parent:n})}unwrap(){return this._def.type}},Cl=class t extends Q{_parse(e){let{status:n,ctx:i}=this._processInputParams(e);if(i.common.async)return(async()=>{let o=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return o.status==="aborted"?B:o.status==="dirty"?(n.dirty(),si(o.value)):this._def.out._parseAsync({data:o.value,path:i.path,parent:i})})();{let r=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return r.status==="aborted"?B:r.status==="dirty"?(n.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:i.path,parent:i})}}static create(e,n){return new t({in:e,out:n,typeName:w.ZodPipeline})}},yi=class extends Q{_parse(e){let n=this._def.innerType._parse(e),i=r=>(tr(r)&&(r.value=Object.freeze(r.value)),r);return bs(n)?n.then(r=>i(r)):i(n)}unwrap(){return this._def.innerType}};yi.create=(t,e)=>new yi({innerType:t,typeName:w.ZodReadonly,...G(e)});var g2={object:mt.lazycreate},w;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(w||(w={}));var b2=ci.create,_2=_s.create,y2=Es.create,v2=ys.create,k2=vs.create,x2=ks.create,S2=xs.create,$2=ui.create,I2=li.create,w2=Ss.create,E2=In.create,T2=qt.create,R2=$s.create,O2=wn.create,Vx=mt.create,P2=mt.strictCreate,A2=di.create,N2=Hh.create,C2=pi.create,z2=tn.create,D2=Gh.create,j2=Is.create,U2=ws.create,M2=Wh.create,L2=mi.create,Z2=fi.create,F2=hi.create,B2=gi.create,q2=nr.create,V2=Ot.create,H2=Rt.create,K2=nn.create,G2=Ot.createWithPreprocess,W2=Cl.create;var uN=g("ZodMiniType",(t,e)=>{if(!t._zod)throw new Error("Uninitialized schema in ZodMiniType.");V.init(t,e),t.def=e,t.type=e.type,t.parse=(n,i)=>Hn(t,n,i,{callee:t.parse}),t.safeParse=(n,i)=>fn(t,n,i),t.parseAsync=async(n,i)=>Kn(t,n,i,{callee:t.parseAsync}),t.safeParseAsync=async(n,i)=>hn(t,n,i),t.check=(...n)=>t.clone({...e,checks:[...e.checks??[],...n.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]},{parent:!0}),t.with=t.check,t.clone=(n,i)=>Ce(t,n,i),t.brand=()=>t,t.register=((n,i)=>(n.add(t,i),t)),t.apply=n=>n(t)});var lN=g("ZodMiniObject",(t,e)=>{kc.init(t,e),uN.init(t,e),W(t,"shape",()=>e.shape)});function Jh(t,e){let n={type:"object",shape:t??{},...I(e)};return new lN(n)}function vt(t){return!!t._zod}function rr(t){let e=Object.values(t);if(e.length===0)return Jh({});let n=e.every(vt),i=e.every(r=>!vt(r));if(n)return Jh(t);if(i)return Vx(t);throw new Error("Mixed Zod versions detected in object shape.")}function En(t,e){return vt(t)?fn(t,e):t.safeParse(e)}async function zl(t,e){return vt(t)?await hn(t,e):await t.safeParseAsync(e)}function Tn(t){if(!t)return;let e;if(vt(t)?e=t._zod?.def?.shape:e=t.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function vi(t){if(t){if(typeof t=="object"){let e=t,n=t;if(!e._def&&!n._zod){let i=Object.values(t);if(i.length>0&&i.every(r=>typeof r=="object"&&r!==null&&(r._def!==void 0||r._zod!==void 0||typeof r.parse=="function")))return rr(t)}}if(vt(t)){let n=t._zod?.def;if(n&&(n.type==="object"||n.shape!==void 0))return t}else if(t.shape!==void 0)return t}}function Dl(t){if(t&&typeof t=="object"){if("message"in t&&typeof t.message=="string")return t.message;if("issues"in t&&Array.isArray(t.issues)&&t.issues.length>0){let e=t.issues[0];if(e&&typeof e=="object"&&"message"in e)return String(e.message)}try{return JSON.stringify(t)}catch{return String(t)}}return String(t)}function Hx(t){return t.description}function Kx(t){if(vt(t))return t._zod?.def?.type==="optional";let e=t;return typeof t.isOptional=="function"?t.isOptional():e._def?.typeName==="ZodOptional"}function jl(t){if(vt(t)){let o=t._zod?.def;if(o){if(o.value!==void 0)return o.value;if(Array.isArray(o.values)&&o.values.length>0)return o.values[0]}}let n=t._def;if(n){if(n.value!==void 0)return n.value;if(Array.isArray(n.values)&&n.values.length>0)return n.values[0]}let i=t.value;if(i!==void 0)return i}function Rn(t){return t==="completed"||t==="failed"||t==="cancelled"}var Wx=Symbol("Let zodToJsonSchema decide on which parser to use");var Gx={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"},Jx=t=>typeof t=="string"?{...Gx,name:t}:{...Gx,...t};var Yx=t=>{let e=Jx(t),n=e.name!==void 0?[...e.basePath,e.definitionPath,e.name]:e.basePath;return{...e,flags:{hasReferencedOpenAiAnyType:!1},currentPath:n,propertyPath:void 0,seen:new Map(Object.entries(e.definitions).map(([i,r])=>[r._def,{def:r._def,path:[...e.basePath,e.definitionPath,i],jsonSchema:void 0}]))}};function Yh(t,e,n,i){i?.errorMessages&&n&&(t.errorMessage={...t.errorMessage,[e]:n})}function re(t,e,n,i,r){t[e]=n,Yh(t,e,i,r)}var Ul=(t,e)=>{let n=0;for(;n<t.length&&n<e.length&&t[n]===e[n];n++);return[(t.length-n).toString(),...e.slice(n)].join("/")};function Ie(t){if(t.target!=="openAi")return{};let e=[...t.basePath,t.definitionPath,t.openAiAnyTypeName];return t.flags.hasReferencedOpenAiAnyType=!0,{$ref:t.$refStrategy==="relative"?Ul(e,t.currentPath):e.join("/")}}function Xx(t,e){let n={type:"array"};return t.type?._def&&t.type?._def?.typeName!==w.ZodAny&&(n.items=q(t.type._def,{...e,currentPath:[...e.currentPath,"items"]})),t.minLength&&re(n,"minItems",t.minLength.value,t.minLength.message,e),t.maxLength&&re(n,"maxItems",t.maxLength.value,t.maxLength.message,e),t.exactLength&&(re(n,"minItems",t.exactLength.value,t.exactLength.message,e),re(n,"maxItems",t.exactLength.value,t.exactLength.message,e)),n}function Qx(t,e){let n={type:"integer",format:"int64"};if(!t.checks)return n;for(let i of t.checks)switch(i.kind){case"min":e.target==="jsonSchema7"?i.inclusive?re(n,"minimum",i.value,i.message,e):re(n,"exclusiveMinimum",i.value,i.message,e):(i.inclusive||(n.exclusiveMinimum=!0),re(n,"minimum",i.value,i.message,e));break;case"max":e.target==="jsonSchema7"?i.inclusive?re(n,"maximum",i.value,i.message,e):re(n,"exclusiveMaximum",i.value,i.message,e):(i.inclusive||(n.exclusiveMaximum=!0),re(n,"maximum",i.value,i.message,e));break;case"multipleOf":re(n,"multipleOf",i.value,i.message,e);break}return n}function eS(){return{type:"boolean"}}function Ml(t,e){return q(t.type._def,e)}var tS=(t,e)=>q(t.innerType._def,e);function Xh(t,e,n){let i=n??e.dateStrategy;if(Array.isArray(i))return{anyOf:i.map((r,o)=>Xh(t,e,r))};switch(i){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return pN(t,e)}}var pN=(t,e)=>{let n={type:"integer",format:"unix-time"};if(e.target==="openApi3")return n;for(let i of t.checks)switch(i.kind){case"min":re(n,"minimum",i.value,i.message,e);break;case"max":re(n,"maximum",i.value,i.message,e);break}return n};function nS(t,e){return{...q(t.innerType._def,e),default:t.defaultValue()}}function rS(t,e){return e.effectStrategy==="input"?q(t.schema._def,e):Ie(e)}function iS(t){return{type:"string",enum:Array.from(t.values)}}var mN=t=>"type"in t&&t.type==="string"?!1:"allOf"in t;function oS(t,e){let n=[q(t.left._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),q(t.right._def,{...e,currentPath:[...e.currentPath,"allOf","1"]})].filter(o=>!!o),i=e.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,r=[];return n.forEach(o=>{if(mN(o))r.push(...o.allOf),o.unevaluatedProperties===void 0&&(i=void 0);else{let s=o;if("additionalProperties"in o&&o.additionalProperties===!1){let{additionalProperties:c,...u}=o;s=u}else i=void 0;r.push(s)}}),r.length?{allOf:r,...i}:void 0}function sS(t,e){let n=typeof t.value;return n!=="bigint"&&n!=="number"&&n!=="boolean"&&n!=="string"?{type:Array.isArray(t.value)?"array":"object"}:e.target==="openApi3"?{type:n==="bigint"?"integer":n,enum:[t.value]}:{type:n==="bigint"?"integer":n,const:t.value}}var Qh,Pt={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:()=>(Qh===void 0&&(Qh=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Qh),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 Ll(t,e){let n={type:"string"};if(t.checks)for(let i of t.checks)switch(i.kind){case"min":re(n,"minLength",typeof n.minLength=="number"?Math.max(n.minLength,i.value):i.value,i.message,e);break;case"max":re(n,"maxLength",typeof n.maxLength=="number"?Math.min(n.maxLength,i.value):i.value,i.message,e);break;case"email":switch(e.emailStrategy){case"format:email":At(n,"email",i.message,e);break;case"format:idn-email":At(n,"idn-email",i.message,e);break;case"pattern:zod":Ye(n,Pt.email,i.message,e);break}break;case"url":At(n,"uri",i.message,e);break;case"uuid":At(n,"uuid",i.message,e);break;case"regex":Ye(n,i.regex,i.message,e);break;case"cuid":Ye(n,Pt.cuid,i.message,e);break;case"cuid2":Ye(n,Pt.cuid2,i.message,e);break;case"startsWith":Ye(n,RegExp(`^${eg(i.value,e)}`),i.message,e);break;case"endsWith":Ye(n,RegExp(`${eg(i.value,e)}$`),i.message,e);break;case"datetime":At(n,"date-time",i.message,e);break;case"date":At(n,"date",i.message,e);break;case"time":At(n,"time",i.message,e);break;case"duration":At(n,"duration",i.message,e);break;case"length":re(n,"minLength",typeof n.minLength=="number"?Math.max(n.minLength,i.value):i.value,i.message,e),re(n,"maxLength",typeof n.maxLength=="number"?Math.min(n.maxLength,i.value):i.value,i.message,e);break;case"includes":{Ye(n,RegExp(eg(i.value,e)),i.message,e);break}case"ip":{i.version!=="v6"&&At(n,"ipv4",i.message,e),i.version!=="v4"&&At(n,"ipv6",i.message,e);break}case"base64url":Ye(n,Pt.base64url,i.message,e);break;case"jwt":Ye(n,Pt.jwt,i.message,e);break;case"cidr":{i.version!=="v6"&&Ye(n,Pt.ipv4Cidr,i.message,e),i.version!=="v4"&&Ye(n,Pt.ipv6Cidr,i.message,e);break}case"emoji":Ye(n,Pt.emoji(),i.message,e);break;case"ulid":{Ye(n,Pt.ulid,i.message,e);break}case"base64":{switch(e.base64Strategy){case"format:binary":{At(n,"binary",i.message,e);break}case"contentEncoding:base64":{re(n,"contentEncoding","base64",i.message,e);break}case"pattern:zod":{Ye(n,Pt.base64,i.message,e);break}}break}case"nanoid":Ye(n,Pt.nanoid,i.message,e);case"toLowerCase":case"toUpperCase":case"trim":break;default:}return n}function eg(t,e){return e.patternStrategy==="escape"?hN(t):t}var fN=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function hN(t){let e="";for(let n=0;n<t.length;n++)fN.has(t[n])||(e+="\\"),e+=t[n];return e}function At(t,e,n,i){t.format||t.anyOf?.some(r=>r.format)?(t.anyOf||(t.anyOf=[]),t.format&&(t.anyOf.push({format:t.format,...t.errorMessage&&i.errorMessages&&{errorMessage:{format:t.errorMessage.format}}}),delete t.format,t.errorMessage&&(delete t.errorMessage.format,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.anyOf.push({format:e,...n&&i.errorMessages&&{errorMessage:{format:n}}})):re(t,"format",e,n,i)}function Ye(t,e,n,i){t.pattern||t.allOf?.some(r=>r.pattern)?(t.allOf||(t.allOf=[]),t.pattern&&(t.allOf.push({pattern:t.pattern,...t.errorMessage&&i.errorMessages&&{errorMessage:{pattern:t.errorMessage.pattern}}}),delete t.pattern,t.errorMessage&&(delete t.errorMessage.pattern,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.allOf.push({pattern:aS(e,i),...n&&i.errorMessages&&{errorMessage:{pattern:n}}})):re(t,"pattern",aS(e,i),n,i)}function aS(t,e){if(!e.applyRegexFlags||!t.flags)return t.source;let n={i:t.flags.includes("i"),m:t.flags.includes("m"),s:t.flags.includes("s")},i=n.i?t.source.toLowerCase():t.source,r="",o=!1,s=!1,c=!1;for(let u=0;u<i.length;u++){if(o){r+=i[u],o=!1;continue}if(n.i){if(s){if(i[u].match(/[a-z]/)){c?(r+=i[u],r+=`${i[u-2]}-${i[u]}`.toUpperCase(),c=!1):i[u+1]==="-"&&i[u+2]?.match(/[a-z]/)?(r+=i[u],c=!0):r+=`${i[u]}${i[u].toUpperCase()}`;continue}}else if(i[u].match(/[a-z]/)){r+=`[${i[u]}${i[u].toUpperCase()}]`;continue}}if(n.m){if(i[u]==="^"){r+=`(^|(?<=[\r
|
|
77
|
+
]))`;continue}else if(i[u]==="$"){r+=`($|(?=[\r
|
|
78
|
+
]))`;continue}}if(n.s&&i[u]==="."){r+=s?`${i[u]}\r
|
|
79
|
+
`:`[${i[u]}\r
|
|
80
|
+
]`;continue}r+=i[u],i[u]==="\\"?o=!0:s&&i[u]==="]"?s=!1:!s&&i[u]==="["&&(s=!0)}try{new RegExp(r)}catch{return console.warn(`Could not convert regex pattern at ${e.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),t.source}return r}function Zl(t,e){if(e.target==="openAi"&&console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead."),e.target==="openApi3"&&t.keyType?._def.typeName===w.ZodEnum)return{type:"object",required:t.keyType._def.values,properties:t.keyType._def.values.reduce((i,r)=>({...i,[r]:q(t.valueType._def,{...e,currentPath:[...e.currentPath,"properties",r]})??Ie(e)}),{}),additionalProperties:e.rejectedAdditionalProperties};let n={type:"object",additionalProperties:q(t.valueType._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]})??e.allowedAdditionalProperties};if(e.target==="openApi3")return n;if(t.keyType?._def.typeName===w.ZodString&&t.keyType._def.checks?.length){let{type:i,...r}=Ll(t.keyType._def,e);return{...n,propertyNames:r}}else{if(t.keyType?._def.typeName===w.ZodEnum)return{...n,propertyNames:{enum:t.keyType._def.values}};if(t.keyType?._def.typeName===w.ZodBranded&&t.keyType._def.type._def.typeName===w.ZodString&&t.keyType._def.type._def.checks?.length){let{type:i,...r}=Ml(t.keyType._def,e);return{...n,propertyNames:r}}}return n}function cS(t,e){if(e.mapStrategy==="record")return Zl(t,e);let n=q(t.keyType._def,{...e,currentPath:[...e.currentPath,"items","items","0"]})||Ie(e),i=q(t.valueType._def,{...e,currentPath:[...e.currentPath,"items","items","1"]})||Ie(e);return{type:"array",maxItems:125,items:{type:"array",items:[n,i],minItems:2,maxItems:2}}}function uS(t){let e=t.values,i=Object.keys(t.values).filter(o=>typeof e[e[o]]!="number").map(o=>e[o]),r=Array.from(new Set(i.map(o=>typeof o)));return{type:r.length===1?r[0]==="string"?"string":"number":["string","number"],enum:i}}function lS(t){return t.target==="openAi"?void 0:{not:Ie({...t,currentPath:[...t.currentPath,"not"]})}}function dS(t){return t.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}var Ts={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function mS(t,e){if(e.target==="openApi3")return pS(t,e);let n=t.options instanceof Map?Array.from(t.options.values()):t.options;if(n.every(i=>i._def.typeName in Ts&&(!i._def.checks||!i._def.checks.length))){let i=n.reduce((r,o)=>{let s=Ts[o._def.typeName];return s&&!r.includes(s)?[...r,s]:r},[]);return{type:i.length>1?i:i[0]}}else if(n.every(i=>i._def.typeName==="ZodLiteral"&&!i.description)){let i=n.reduce((r,o)=>{let s=typeof o._def.value;switch(s){case"string":case"number":case"boolean":return[...r,s];case"bigint":return[...r,"integer"];case"object":if(o._def.value===null)return[...r,"null"];default:return r}},[]);if(i.length===n.length){let r=i.filter((o,s,c)=>c.indexOf(o)===s);return{type:r.length>1?r:r[0],enum:n.reduce((o,s)=>o.includes(s._def.value)?o:[...o,s._def.value],[])}}}else if(n.every(i=>i._def.typeName==="ZodEnum"))return{type:"string",enum:n.reduce((i,r)=>[...i,...r._def.values.filter(o=>!i.includes(o))],[])};return pS(t,e)}var pS=(t,e)=>{let n=(t.options instanceof Map?Array.from(t.options.values()):t.options).map((i,r)=>q(i._def,{...e,currentPath:[...e.currentPath,"anyOf",`${r}`]})).filter(i=>!!i&&(!e.strictUnions||typeof i=="object"&&Object.keys(i).length>0));return n.length?{anyOf:n}:void 0};function fS(t,e){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(t.innerType._def.typeName)&&(!t.innerType._def.checks||!t.innerType._def.checks.length))return e.target==="openApi3"?{type:Ts[t.innerType._def.typeName],nullable:!0}:{type:[Ts[t.innerType._def.typeName],"null"]};if(e.target==="openApi3"){let i=q(t.innerType._def,{...e,currentPath:[...e.currentPath]});return i&&"$ref"in i?{allOf:[i],nullable:!0}:i&&{...i,nullable:!0}}let n=q(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","0"]});return n&&{anyOf:[n,{type:"null"}]}}function hS(t,e){let n={type:"number"};if(!t.checks)return n;for(let i of t.checks)switch(i.kind){case"int":n.type="integer",Yh(n,"type",i.message,e);break;case"min":e.target==="jsonSchema7"?i.inclusive?re(n,"minimum",i.value,i.message,e):re(n,"exclusiveMinimum",i.value,i.message,e):(i.inclusive||(n.exclusiveMinimum=!0),re(n,"minimum",i.value,i.message,e));break;case"max":e.target==="jsonSchema7"?i.inclusive?re(n,"maximum",i.value,i.message,e):re(n,"exclusiveMaximum",i.value,i.message,e):(i.inclusive||(n.exclusiveMaximum=!0),re(n,"maximum",i.value,i.message,e));break;case"multipleOf":re(n,"multipleOf",i.value,i.message,e);break}return n}function gS(t,e){let n=e.target==="openAi",i={type:"object",properties:{}},r=[],o=t.shape();for(let c in o){let u=o[c];if(u===void 0||u._def===void 0)continue;let d=bN(u);d&&n&&(u._def.typeName==="ZodOptional"&&(u=u._def.innerType),u.isNullable()||(u=u.nullable()),d=!1);let l=q(u._def,{...e,currentPath:[...e.currentPath,"properties",c],propertyPath:[...e.currentPath,"properties",c]});l!==void 0&&(i.properties[c]=l,d||r.push(c))}r.length&&(i.required=r);let s=gN(t,e);return s!==void 0&&(i.additionalProperties=s),i}function gN(t,e){if(t.catchall._def.typeName!=="ZodNever")return q(t.catchall._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]});switch(t.unknownKeys){case"passthrough":return e.allowedAdditionalProperties;case"strict":return e.rejectedAdditionalProperties;case"strip":return e.removeAdditionalStrategy==="strict"?e.allowedAdditionalProperties:e.rejectedAdditionalProperties}}function bN(t){try{return t.isOptional()}catch{return!0}}var bS=(t,e)=>{if(e.currentPath.toString()===e.propertyPath?.toString())return q(t.innerType._def,e);let n=q(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","1"]});return n?{anyOf:[{not:Ie(e)},n]}:Ie(e)};var _S=(t,e)=>{if(e.pipeStrategy==="input")return q(t.in._def,e);if(e.pipeStrategy==="output")return q(t.out._def,e);let n=q(t.in._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),i=q(t.out._def,{...e,currentPath:[...e.currentPath,"allOf",n?"1":"0"]});return{allOf:[n,i].filter(r=>r!==void 0)}};function yS(t,e){return q(t.type._def,e)}function vS(t,e){let i={type:"array",uniqueItems:!0,items:q(t.valueType._def,{...e,currentPath:[...e.currentPath,"items"]})};return t.minSize&&re(i,"minItems",t.minSize.value,t.minSize.message,e),t.maxSize&&re(i,"maxItems",t.maxSize.value,t.maxSize.message,e),i}function kS(t,e){return t.rest?{type:"array",minItems:t.items.length,items:t.items.map((n,i)=>q(n._def,{...e,currentPath:[...e.currentPath,"items",`${i}`]})).reduce((n,i)=>i===void 0?n:[...n,i],[]),additionalItems:q(t.rest._def,{...e,currentPath:[...e.currentPath,"additionalItems"]})}:{type:"array",minItems:t.items.length,maxItems:t.items.length,items:t.items.map((n,i)=>q(n._def,{...e,currentPath:[...e.currentPath,"items",`${i}`]})).reduce((n,i)=>i===void 0?n:[...n,i],[])}}function xS(t){return{not:Ie(t)}}function SS(t){return Ie(t)}var $S=(t,e)=>q(t.innerType._def,e);var IS=(t,e,n)=>{switch(e){case w.ZodString:return Ll(t,n);case w.ZodNumber:return hS(t,n);case w.ZodObject:return gS(t,n);case w.ZodBigInt:return Qx(t,n);case w.ZodBoolean:return eS();case w.ZodDate:return Xh(t,n);case w.ZodUndefined:return xS(n);case w.ZodNull:return dS(n);case w.ZodArray:return Xx(t,n);case w.ZodUnion:case w.ZodDiscriminatedUnion:return mS(t,n);case w.ZodIntersection:return oS(t,n);case w.ZodTuple:return kS(t,n);case w.ZodRecord:return Zl(t,n);case w.ZodLiteral:return sS(t,n);case w.ZodEnum:return iS(t);case w.ZodNativeEnum:return uS(t);case w.ZodNullable:return fS(t,n);case w.ZodOptional:return bS(t,n);case w.ZodMap:return cS(t,n);case w.ZodSet:return vS(t,n);case w.ZodLazy:return()=>t.getter()._def;case w.ZodPromise:return yS(t,n);case w.ZodNaN:case w.ZodNever:return lS(n);case w.ZodEffects:return rS(t,n);case w.ZodAny:return Ie(n);case w.ZodUnknown:return SS(n);case w.ZodDefault:return nS(t,n);case w.ZodBranded:return Ml(t,n);case w.ZodReadonly:return $S(t,n);case w.ZodCatch:return tS(t,n);case w.ZodPipeline:return _S(t,n);case w.ZodFunction:case w.ZodVoid:case w.ZodSymbol:return;default:return(i=>{})(e)}};function q(t,e,n=!1){let i=e.seen.get(t);if(e.override){let c=e.override?.(t,e,i,n);if(c!==Wx)return c}if(i&&!n){let c=_N(i,e);if(c!==void 0)return c}let r={def:t,path:e.currentPath,jsonSchema:void 0};e.seen.set(t,r);let o=IS(t,t.typeName,e),s=typeof o=="function"?q(o(),e):o;if(s&&yN(t,e,s),e.postProcess){let c=e.postProcess(s,t,e);return r.jsonSchema=s,c}return r.jsonSchema=s,s}var _N=(t,e)=>{switch(e.$refStrategy){case"root":return{$ref:t.path.join("/")};case"relative":return{$ref:Ul(e.currentPath,t.path)};case"none":case"seen":return t.path.length<e.currentPath.length&&t.path.every((n,i)=>e.currentPath[i]===n)?(console.warn(`Recursive reference detected at ${e.currentPath.join("/")}! Defaulting to any`),Ie(e)):e.$refStrategy==="seen"?Ie(e):void 0}},yN=(t,e,n)=>(t.description&&(n.description=t.description,e.markdownDescription&&(n.markdownDescription=t.description)),n);var tg=(t,e)=>{let n=Yx(e),i=typeof e=="object"&&e.definitions?Object.entries(e.definitions).reduce((u,[d,l])=>({...u,[d]:q(l._def,{...n,currentPath:[...n.basePath,n.definitionPath,d]},!0)??Ie(n)}),{}):void 0,r=typeof e=="string"?e:e?.nameStrategy==="title"?void 0:e?.name,o=q(t._def,r===void 0?n:{...n,currentPath:[...n.basePath,n.definitionPath,r]},!1)??Ie(n),s=typeof e=="object"&&e.name!==void 0&&e.nameStrategy==="title"?e.name:void 0;s!==void 0&&(o.title=s),n.flags.hasReferencedOpenAiAnyType&&(i||(i={}),i[n.openAiAnyTypeName]||(i[n.openAiAnyTypeName]={type:["string","number","integer","boolean","array","null"],items:{$ref:n.$refStrategy==="relative"?"1":[...n.basePath,n.definitionPath,n.openAiAnyTypeName].join("/")}}));let c=r===void 0?i?{...o,[n.definitionPath]:i}:o:{$ref:[...n.$refStrategy==="relative"?[]:n.basePath,n.definitionPath,r].join("/"),[n.definitionPath]:{...i,[r]:o}};return n.target==="jsonSchema7"?c.$schema="http://json-schema.org/draft-07/schema#":(n.target==="jsonSchema2019-09"||n.target==="openAi")&&(c.$schema="https://json-schema.org/draft/2019-09/schema#"),n.target==="openAi"&&("anyOf"in c||"oneOf"in c||"allOf"in c||"type"in c&&Array.isArray(c.type))&&console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property."),c};function vN(t){return!t||t==="jsonSchema7"||t==="draft-7"?"draft-7":t==="jsonSchema2019-09"||t==="draft-2020-12"?"draft-2020-12":"draft-7"}function ng(t,e){return vt(t)?Qn(t,{target:vN(e?.target),io:e?.pipeStrategy??"input"}):tg(t,{strictUnions:e?.strictUnions??!0,pipeStrategy:e?.pipeStrategy??"input"})}function rg(t){let n=Tn(t)?.method;if(!n)throw new Error("Schema is missing a method literal");let i=jl(n);if(typeof i!="string")throw new Error("Schema method literal must be a string");return i}function ig(t,e){let n=En(t,e);if(!n.success)throw n.error;return n.data}var kN=6e4,Fl=class{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(ml,n=>{this._oncancel(n)}),this.setNotificationHandler(hl,n=>{this._onprogress(n)}),this.setRequestHandler(fl,n=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(gl,async(n,i)=>{let r=await this._taskStore.getTask(n.params.taskId,i.sessionId);if(!r)throw new L(F.InvalidParams,"Failed to retrieve task: Task not found");return{...r}}),this.setRequestHandler(_l,async(n,i)=>{let r=async()=>{let o=n.params.taskId;if(this._taskMessageQueue){let c;for(;c=await this._taskMessageQueue.dequeue(o,i.sessionId);){if(c.type==="response"||c.type==="error"){let u=c.message,d=u.id,l=this._requestResolvers.get(d);if(l)if(this._requestResolvers.delete(d),c.type==="response")l(u);else{let p=u,m=new L(p.error.code,p.error.message,p.error.data);l(m)}else{let p=c.type==="response"?"Response":"Error";this._onerror(new Error(`${p} handler missing for request ${d}`))}continue}await this._transport?.send(c.message,{relatedRequestId:i.requestId})}}let s=await this._taskStore.getTask(o,i.sessionId);if(!s)throw new L(F.InvalidParams,`Task not found: ${o}`);if(!Rn(s.status))return await this._waitForTaskUpdate(o,i.signal),await r();if(Rn(s.status)){let c=await this._taskStore.getTaskResult(o,i.sessionId);return this._clearTaskQueue(o),{...c,_meta:{...c._meta,[Sn]:{taskId:o}}}}return await r()};return await r()}),this.setRequestHandler(yl,async(n,i)=>{try{let{tasks:r,nextCursor:o}=await this._taskStore.listTasks(n.params?.cursor,i.sessionId);return{tasks:r,nextCursor:o,_meta:{}}}catch(r){throw new L(F.InvalidParams,`Failed to list tasks: ${r instanceof Error?r.message:String(r)}`)}}),this.setRequestHandler(kl,async(n,i)=>{try{let r=await this._taskStore.getTask(n.params.taskId,i.sessionId);if(!r)throw new L(F.InvalidParams,`Task not found: ${n.params.taskId}`);if(Rn(r.status))throw new L(F.InvalidParams,`Cannot cancel task in terminal status: ${r.status}`);await this._taskStore.updateTaskStatus(n.params.taskId,"cancelled","Client cancelled task execution.",i.sessionId),this._clearTaskQueue(n.params.taskId);let o=await this._taskStore.getTask(n.params.taskId,i.sessionId);if(!o)throw new L(F.InvalidParams,`Task not found after cancellation: ${n.params.taskId}`);return{_meta:{},...o}}catch(r){throw r instanceof L?r:new L(F.InvalidRequest,`Failed to cancel task: ${r instanceof Error?r.message:String(r)}`)}}))}async _oncancel(e){if(!e.params.requestId)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,n,i,r,o=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(r,n),startTime:Date.now(),timeout:n,maxTotalTimeout:i,resetTimeoutOnProgress:o,onTimeout:r})}_resetTimeout(e){let n=this._timeoutInfo.get(e);if(!n)return!1;let i=Date.now()-n.startTime;if(n.maxTotalTimeout&&i>=n.maxTotalTimeout)throw this._timeoutInfo.delete(e),L.fromError(F.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:n.maxTotalTimeout,totalElapsed:i});return clearTimeout(n.timeoutId),n.timeoutId=setTimeout(n.onTimeout,n.timeout),!0}_cleanupTimeout(e){let n=this._timeoutInfo.get(e);n&&(clearTimeout(n.timeoutId),this._timeoutInfo.delete(e))}async connect(e){if(this._transport)throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=e;let n=this.transport?.onclose;this._transport.onclose=()=>{n?.(),this._onclose()};let i=this.transport?.onerror;this._transport.onerror=o=>{i?.(o),this._onerror(o)};let r=this._transport?.onmessage;this._transport.onmessage=(o,s)=>{r?.(o,s),as(o)||Ex(o)?this._onresponse(o):Rh(o)?this._onrequest(o,s):wx(o)?this._onnotification(o):this._onerror(new Error(`Unknown message type: ${JSON.stringify(o)}`))},await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(let i of this._timeoutInfo.values())clearTimeout(i.timeoutId);this._timeoutInfo.clear();for(let i of this._requestHandlerAbortControllers.values())i.abort();this._requestHandlerAbortControllers.clear();let n=L.fromError(F.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(let i of e.values())i(n)}_onerror(e){this.onerror?.(e)}_onnotification(e){let n=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;n!==void 0&&Promise.resolve().then(()=>n(e)).catch(i=>this._onerror(new Error(`Uncaught error in notification handler: ${i}`)))}_onrequest(e,n){let i=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,r=this._transport,o=e.params?._meta?.[Sn]?.taskId;if(i===void 0){let l={jsonrpc:"2.0",id:e.id,error:{code:F.MethodNotFound,message:"Method not found"}};o&&this._taskMessageQueue?this._enqueueTaskMessage(o,{type:"error",message:l,timestamp:Date.now()},r?.sessionId).catch(p=>this._onerror(new Error(`Failed to enqueue error response: ${p}`))):r?.send(l).catch(p=>this._onerror(new Error(`Failed to send an error response: ${p}`)));return}let s=new AbortController;this._requestHandlerAbortControllers.set(e.id,s);let c=Sx(e.params)?e.params.task:void 0,u=this._taskStore?this.requestTaskStore(e,r?.sessionId):void 0,d={signal:s.signal,sessionId:r?.sessionId,_meta:e.params?._meta,sendNotification:async l=>{if(s.signal.aborted)return;let p={relatedRequestId:e.id};o&&(p.relatedTask={taskId:o}),await this.notification(l,p)},sendRequest:async(l,p,m)=>{if(s.signal.aborted)throw new L(F.ConnectionClosed,"Request was cancelled");let f={...m,relatedRequestId:e.id};o&&!f.relatedTask&&(f.relatedTask={taskId:o});let h=f.relatedTask?.taskId??o;return h&&u&&await u.updateTaskStatus(h,"input_required"),await this.request(l,p,f)},authInfo:n?.authInfo,requestId:e.id,requestInfo:n?.requestInfo,taskId:o,taskStore:u,taskRequestedTtl:c?.ttl,closeSSEStream:n?.closeSSEStream,closeStandaloneSSEStream:n?.closeStandaloneSSEStream};Promise.resolve().then(()=>{c&&this.assertTaskHandlerCapability(e.method)}).then(()=>i(e,d)).then(async l=>{if(s.signal.aborted)return;let p={result:l,jsonrpc:"2.0",id:e.id};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"response",message:p,timestamp:Date.now()},r?.sessionId):await r?.send(p)},async l=>{if(s.signal.aborted)return;let p={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(l.code)?l.code:F.InternalError,message:l.message??"Internal error",...l.data!==void 0&&{data:l.data}}};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"error",message:p,timestamp:Date.now()},r?.sessionId):await r?.send(p)}).catch(l=>this._onerror(new Error(`Failed to send response: ${l}`))).finally(()=>{this._requestHandlerAbortControllers.get(e.id)===s&&this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){let{progressToken:n,...i}=e.params,r=Number(n),o=this._progressHandlers.get(r);if(!o){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let s=this._responseHandlers.get(r),c=this._timeoutInfo.get(r);if(c&&s&&c.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(u){this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),s(u);return}o(i)}_onresponse(e){let n=Number(e.id),i=this._requestResolvers.get(n);if(i){if(this._requestResolvers.delete(n),as(e))i(e);else{let s=new L(e.error.code,e.error.message,e.error.data);i(s)}return}let r=this._responseHandlers.get(n);if(r===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(n),this._cleanupTimeout(n);let o=!1;if(as(e)&&e.result&&typeof e.result=="object"){let s=e.result;if(s.task&&typeof s.task=="object"){let c=s.task;typeof c.taskId=="string"&&(o=!0,this._taskProgressTokens.set(c.taskId,n))}}if(o||this._progressHandlers.delete(n),as(e))r(e);else{let s=L.fromError(e.error.code,e.error.message,e.error.data);r(s)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,n,i){let{task:r}=i??{};if(!r){try{yield{type:"result",result:await this.request(e,n,i)}}catch(s){yield{type:"error",error:s instanceof L?s:new L(F.InternalError,String(s))}}return}let o;try{let s=await this.request(e,ni,i);if(s.task)o=s.task.taskId,yield{type:"taskCreated",task:s.task};else throw new L(F.InternalError,"Task creation did not return a task");for(;;){let c=await this.getTask({taskId:o},i);if(yield{type:"taskStatus",task:c},Rn(c.status)){c.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:o},n,i)}:c.status==="failed"?yield{type:"error",error:new L(F.InternalError,`Task ${o} failed`)}:c.status==="cancelled"&&(yield{type:"error",error:new L(F.InternalError,`Task ${o} was cancelled`)});return}if(c.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:o},n,i)};return}let u=c.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(d=>setTimeout(d,u)),i?.signal?.throwIfAborted()}}catch(s){yield{type:"error",error:s instanceof L?s:new L(F.InternalError,String(s))}}}request(e,n,i){let{relatedRequestId:r,resumptionToken:o,onresumptiontoken:s,task:c,relatedTask:u}=i??{};return new Promise((d,l)=>{let p=C=>{l(C)};if(!this._transport){p(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),c&&this.assertTaskCapability(e.method)}catch(C){p(C);return}i?.signal?.throwIfAborted();let m=this._requestMessageId++,f={...e,jsonrpc:"2.0",id:m};i?.onprogress&&(this._progressHandlers.set(m,i.onprogress),f.params={...e.params,_meta:{...e.params?._meta||{},progressToken:m}}),c&&(f.params={...f.params,task:c}),u&&(f.params={...f.params,_meta:{...f.params?._meta||{},[Sn]:u}});let h=C=>{this._responseHandlers.delete(m),this._progressHandlers.delete(m),this._cleanupTimeout(m),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:m,reason:String(C)}},{relatedRequestId:r,resumptionToken:o,onresumptiontoken:s}).catch(j=>this._onerror(new Error(`Failed to send cancellation: ${j}`)));let z=C instanceof L?C:new L(F.RequestTimeout,String(C));l(z)};this._responseHandlers.set(m,C=>{if(!i?.signal?.aborted){if(C instanceof Error)return l(C);try{let z=En(n,C.result);z.success?d(z.data):l(z.error)}catch(z){l(z)}}}),i?.signal?.addEventListener("abort",()=>{h(i?.signal?.reason)});let y=i?.timeout??kN,v=()=>h(L.fromError(F.RequestTimeout,"Request timed out",{timeout:y}));this._setupTimeout(m,y,i?.maxTotalTimeout,v,i?.resetTimeoutOnProgress??!1);let E=u?.taskId;if(E){let C=z=>{let j=this._responseHandlers.get(m);j?j(z):this._onerror(new Error(`Response handler missing for side-channeled request ${m}`))};this._requestResolvers.set(m,C),this._enqueueTaskMessage(E,{type:"request",message:f,timestamp:Date.now()}).catch(z=>{this._cleanupTimeout(m),l(z)})}else this._transport.send(f,{relatedRequestId:r,resumptionToken:o,onresumptiontoken:s}).catch(C=>{this._cleanupTimeout(m),l(C)})})}async getTask(e,n){return this.request({method:"tasks/get",params:e},bl,n)}async getTaskResult(e,n,i){return this.request({method:"tasks/result",params:e},n,i)}async listTasks(e,n){return this.request({method:"tasks/list",params:e},vl,n)}async cancelTask(e,n){return this.request({method:"tasks/cancel",params:e},Ox,n)}async notification(e,n){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(e.method);let i=n?.relatedTask?.taskId;if(i){let c={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[Sn]:n.relatedTask}}};await this._enqueueTaskMessage(i,{type:"notification",message:c,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!n?.relatedRequestId&&!n?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let c={...e,jsonrpc:"2.0"};n?.relatedTask&&(c={...c,params:{...c.params,_meta:{...c.params?._meta||{},[Sn]:n.relatedTask}}}),this._transport?.send(c,n).catch(u=>this._onerror(u))});return}let s={...e,jsonrpc:"2.0"};n?.relatedTask&&(s={...s,params:{...s.params,_meta:{...s.params?._meta||{},[Sn]:n.relatedTask}}}),await this._transport.send(s,n)}setRequestHandler(e,n){let i=rg(e);this.assertRequestHandlerCapability(i),this._requestHandlers.set(i,(r,o)=>{let s=ig(e,r);return Promise.resolve(n(s,o))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,n){let i=rg(e);this._notificationHandlers.set(i,r=>{let o=ig(e,r);return Promise.resolve(n(o))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){let n=this._taskProgressTokens.get(e);n!==void 0&&(this._progressHandlers.delete(n),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,n,i){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");let r=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,n,i,r)}async _clearTaskQueue(e,n){if(this._taskMessageQueue){let i=await this._taskMessageQueue.dequeueAll(e,n);for(let r of i)if(r.type==="request"&&Rh(r.message)){let o=r.message.id,s=this._requestResolvers.get(o);s?(s(new L(F.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(o)):this._onerror(new Error(`Resolver missing for request ${o} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,n){let i=this._options?.defaultTaskPollInterval??1e3;try{let r=await this._taskStore?.getTask(e);r?.pollInterval&&(i=r.pollInterval)}catch{}return new Promise((r,o)=>{if(n.aborted){o(new L(F.InvalidRequest,"Request cancelled"));return}let s=setTimeout(r,i);n.addEventListener("abort",()=>{clearTimeout(s),o(new L(F.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,n){let i=this._taskStore;if(!i)throw new Error("No task store configured");return{createTask:async r=>{if(!e)throw new Error("No request provided");return await i.createTask(r,e.id,{method:e.method,params:e.params},n)},getTask:async r=>{let o=await i.getTask(r,n);if(!o)throw new L(F.InvalidParams,"Failed to retrieve task: Task not found");return o},storeTaskResult:async(r,o,s)=>{await i.storeTaskResult(r,o,s,n);let c=await i.getTask(r,n);if(c){let u=ps.parse({method:"notifications/tasks/status",params:c});await this.notification(u),Rn(c.status)&&this._cleanupTaskProgressHandler(r)}},getTaskResult:r=>i.getTaskResult(r,n),updateTaskStatus:async(r,o,s)=>{let c=await i.getTask(r,n);if(!c)throw new L(F.InvalidParams,`Task "${r}" not found - it may have been cleaned up`);if(Rn(c.status))throw new L(F.InvalidParams,`Cannot update task "${r}" from terminal status "${c.status}" to "${o}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await i.updateTaskStatus(r,o,s,n);let u=await i.getTask(r,n);if(u){let d=ps.parse({method:"notifications/tasks/status",params:u});await this.notification(d),Rn(u.status)&&this._cleanupTaskProgressHandler(r)}},listTasks:r=>i.listTasks(r,n)}}};function wS(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function ES(t,e){let n={...t};for(let i in e){let r=i,o=e[r];if(o===void 0)continue;let s=n[r];wS(s)&&wS(o)?n[r]={...s,...o}:n[r]=o}return n}var _w=fy(qb(),1),yw=fy(bw(),1);function I1(){let t=new _w.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return(0,yw.default)(t),t}var Sd=class{constructor(e){this._ajv=e??I1()}getValidator(e){let n="$id"in e&&typeof e.$id=="string"?this._ajv.getSchema(e.$id)??this._ajv.compile(e):this._ajv.compile(e);return i=>n(i)?{valid:!0,data:i,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(n.errors)}}};var $d=class{constructor(e){this._server=e}requestStream(e,n,i){return this._server.requestStream(e,n,i)}createMessageStream(e,n){let i=this._server.getClientCapabilities();if((e.tools||e.toolChoice)&&!i?.sampling?.tools)throw new Error("Client does not support sampling tools capability.");if(e.messages.length>0){let r=e.messages[e.messages.length-1],o=Array.isArray(r.content)?r.content:[r.content],s=o.some(l=>l.type==="tool_result"),c=e.messages.length>1?e.messages[e.messages.length-2]:void 0,u=c?Array.isArray(c.content)?c.content:[c.content]:[],d=u.some(l=>l.type==="tool_use");if(s){if(o.some(l=>l.type!=="tool_result"))throw new Error("The last message must contain only tool_result content if any is present");if(!d)throw new Error("tool_result blocks are not matching any tool_use from the previous message")}if(d){let l=new Set(u.filter(m=>m.type==="tool_use").map(m=>m.id)),p=new Set(o.filter(m=>m.type==="tool_result").map(m=>m.toolUseId));if(l.size!==p.size||![...l].every(m=>p.has(m)))throw new Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return this.requestStream({method:"sampling/createMessage",params:e},hs,n)}elicitInputStream(e,n){let i=this._server.getClientCapabilities(),r=e.mode??"form";switch(r){case"url":{if(!i?.elicitation?.url)throw new Error("Client does not support url elicitation.");break}case"form":{if(!i?.elicitation?.form)throw new Error("Client does not support form elicitation.");break}}let o=r==="form"&&e.mode===void 0?{...e,mode:"form"}:e;return this.requestStream({method:"elicitation/create",params:o},oi,n)}async getTask(e,n){return this._server.getTask({taskId:e},n)}async getTaskResult(e,n,i){return this._server.getTaskResult({taskId:e},n,i)}async listTasks(e,n){return this._server.listTasks(e?{cursor:e}:void 0,n)}async cancelTask(e,n){return this._server.cancelTask({taskId:e},n)}};function vw(t,e,n){if(!t)throw new Error(`${n} does not support task creation (required for ${e})`);switch(e){case"tools/call":if(!t.tools?.call)throw new Error(`${n} does not support task creation for tools/call (required for ${e})`);break;default:break}}function kw(t,e,n){if(!t)throw new Error(`${n} does not support task creation (required for ${e})`);switch(e){case"sampling/createMessage":if(!t.sampling?.createMessage)throw new Error(`${n} does not support task creation for sampling/createMessage (required for ${e})`);break;case"elicitation/create":if(!t.elicitation?.create)throw new Error(`${n} does not support task creation for elicitation/create (required for ${e})`);break;default:break}}var Id=class extends Fl{constructor(e,n){super(n),this._serverInfo=e,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(fs.options.map((i,r)=>[i,r])),this.isMessageIgnored=(i,r)=>{let o=this._loggingLevels.get(r);return o?this.LOG_LEVEL_SEVERITY.get(i)<this.LOG_LEVEL_SEVERITY.get(o):!1},this._capabilities=n?.capabilities??{},this._instructions=n?.instructions,this._jsonSchemaValidator=n?.jsonSchemaValidator??new Sd,this.setRequestHandler(Ah,i=>this._oninitialize(i)),this.setNotificationHandler(Nh,()=>this.oninitialized?.()),this._capabilities.logging&&this.setRequestHandler(Lh,async(i,r)=>{let o=r.sessionId||r.requestInfo?.headers["mcp-session-id"]||void 0,{level:s}=i.params,c=fs.safeParse(s);return c.success&&this._loggingLevels.set(o,c.data),{}})}get experimental(){return this._experimental||(this._experimental={tasks:new $d(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=ES(this._capabilities,e)}setRequestHandler(e,n){let r=Tn(e)?.method;if(!r)throw new Error("Schema is missing a method literal");let o;if(vt(r)){let c=r;o=c._zod?.def?.value??c.value}else{let c=r;o=c._def?.value??c.value}if(typeof o!="string")throw new Error("Schema method literal must be a string");if(o==="tools/call"){let c=async(u,d)=>{let l=En(ii,u);if(!l.success){let h=l.error instanceof Error?l.error.message:String(l.error);throw new L(F.InvalidParams,`Invalid tools/call request: ${h}`)}let{params:p}=l.data,m=await Promise.resolve(n(u,d));if(p.task){let h=En(ni,m);if(!h.success){let y=h.error instanceof Error?h.error.message:String(h.error);throw new L(F.InvalidParams,`Invalid task creation result: ${y}`)}return h.data}let f=En(Tl,m);if(!f.success){let h=f.error instanceof Error?f.error.message:String(f.error);throw new L(F.InvalidParams,`Invalid tools/call result: ${h}`)}return f.data};return super.setRequestHandler(e,c)}return super.setRequestHandler(e,n)}assertCapabilityForMethod(e){switch(e){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw new Error(`Client does not support sampling (required for ${e})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw new Error(`Client does not support elicitation (required for ${e})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw new Error(`Client does not support listing roots (required for ${e})`);break;case"ping":break}}assertNotificationCapability(e){switch(e){case"notifications/message":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw new Error(`Server does not support notifying about resources (required for ${e})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new Error(`Server does not support notifying of tool list changes (required for ${e})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new Error(`Server does not support notifying of prompt list changes (required for ${e})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw new Error(`Client does not support URL elicitation (required for ${e})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case"completion/complete":if(!this._capabilities.completions)throw new Error(`Server does not support completions (required for ${e})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw new Error(`Server does not support resources (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new Error(`Server does not support tools (required for ${e})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Server does not support tasks capability (required for ${e})`);break;case"ping":case"initialize":break}}assertTaskCapability(e){kw(this._clientCapabilities?.tasks?.requests,e,"Client")}assertTaskHandlerCapability(e){this._capabilities&&vw(this._capabilities.tasks?.requests,e,"Server")}async _oninitialize(e){let n=e.params.protocolVersion;return this._clientCapabilities=e.params.capabilities,this._clientVersion=e.params.clientInfo,{protocolVersion:vx.includes(n)?n:Eh,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"},pl)}async createMessage(e,n){if((e.tools||e.toolChoice)&&!this._clientCapabilities?.sampling?.tools)throw new Error("Client does not support sampling tools capability.");if(e.messages.length>0){let i=e.messages[e.messages.length-1],r=Array.isArray(i.content)?i.content:[i.content],o=r.some(d=>d.type==="tool_result"),s=e.messages.length>1?e.messages[e.messages.length-2]:void 0,c=s?Array.isArray(s.content)?s.content:[s.content]:[],u=c.some(d=>d.type==="tool_use");if(o){if(r.some(d=>d.type!=="tool_result"))throw new Error("The last message must contain only tool_result content if any is present");if(!u)throw new Error("tool_result blocks are not matching any tool_use from the previous message")}if(u){let d=new Set(c.filter(p=>p.type==="tool_use").map(p=>p.id)),l=new Set(r.filter(p=>p.type==="tool_result").map(p=>p.toolUseId));if(d.size!==l.size||![...d].every(p=>l.has(p)))throw new Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return e.tools?this.request({method:"sampling/createMessage",params:e},Zh,n):this.request({method:"sampling/createMessage",params:e},hs,n)}async elicitInput(e,n){switch(e.mode??"form"){case"url":{if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support url elicitation.");let r=e;return this.request({method:"elicitation/create",params:r},oi,n)}case"form":{if(!this._clientCapabilities?.elicitation?.form)throw new Error("Client does not support form elicitation.");let r=e.mode==="form"?e:{...e,mode:"form"},o=await this.request({method:"elicitation/create",params:r},oi,n);if(o.action==="accept"&&o.content&&r.requestedSchema)try{let c=this._jsonSchemaValidator.getValidator(r.requestedSchema)(o.content);if(!c.valid)throw new L(F.InvalidParams,`Elicitation response content does not match requested schema: ${c.errorMessage}`)}catch(s){throw s instanceof L?s:new L(F.InternalError,`Error validating elicitation response: ${s instanceof Error?s.message:String(s)}`)}return o}}}createElicitationCompletionNotifier(e,n){if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support URL elicitation (required for notifications/elicitation/complete)");return()=>this.notification({method:"notifications/elicitation/complete",params:{elicitationId:e}},n)}async listRoots(e,n){return this.request({method:"roots/list",params:e},Fh,n)}async sendLoggingMessage(e,n){if(this._capabilities.logging&&!this.isMessageIgnored(e.level,n))return this.notification({method:"notifications/message",params:e})}async sendResourceUpdated(e){return this.notification({method:"notifications/resources/updated",params:e})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}};var Sw=Symbol.for("mcp.completable");function Xb(t){return!!t&&typeof t=="object"&&Sw in t}function $w(t){return t[Sw]?.complete}var xw;(function(t){t.Completable="McpCompletable"})(xw||(xw={}));var w1=/^[A-Za-z0-9._-]{1,128}$/;function E1(t){let e=[];if(t.length===0)return{isValid:!1,warnings:["Tool name cannot be empty"]};if(t.length>128)return{isValid:!1,warnings:[`Tool name exceeds maximum length of 128 characters (current: ${t.length})`]};if(t.includes(" ")&&e.push("Tool name contains spaces, which may cause parsing issues"),t.includes(",")&&e.push("Tool name contains commas, which may cause parsing issues"),(t.startsWith("-")||t.endsWith("-"))&&e.push("Tool name starts or ends with a dash, which may cause parsing issues in some contexts"),(t.startsWith(".")||t.endsWith("."))&&e.push("Tool name starts or ends with a dot, which may cause parsing issues in some contexts"),!w1.test(t)){let n=t.split("").filter(i=>!/[A-Za-z0-9._-]/.test(i)).filter((i,r,o)=>o.indexOf(i)===r);return e.push(`Tool name contains invalid characters: ${n.map(i=>`"${i}"`).join(", ")}`,"Allowed characters are: A-Z, a-z, 0-9, underscore (_), dash (-), and dot (.)"),{isValid:!1,warnings:e}}return{isValid:!0,warnings:e}}function T1(t,e){if(e.length>0){console.warn(`Tool name validation warning for "${t}":`);for(let n of e)console.warn(` - ${n}`);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 Qb(t){let e=E1(t);return T1(t,e.warnings),e.isValid}var wd=class{constructor(e){this._mcpServer=e}registerToolTask(e,n,i){let r={taskSupport:"required",...n.execution};if(r.taskSupport==="forbidden")throw new Error(`Cannot register task-based tool '${e}' with taskSupport 'forbidden'. Use registerTool() instead.`);return this._mcpServer._createRegisteredTool(e,n.title,n.description,n.inputSchema,n.outputSchema,n.annotations,r,n._meta,i)}};var Ed=class{constructor(e,n){this._registeredResources={},this._registeredResourceTemplates={},this._registeredTools={},this._registeredPrompts={},this._toolHandlersInitialized=!1,this._completionHandlerInitialized=!1,this._resourceHandlersInitialized=!1,this._promptHandlersInitialized=!1,this.server=new Id(e,n)}get experimental(){return this._experimental||(this._experimental={tasks:new wd(this)}),this._experimental}async connect(e){return await this.server.connect(e)}async close(){await this.server.close()}setToolRequestHandlers(){this._toolHandlersInitialized||(this.server.assertCanSetRequestHandler(Un(El)),this.server.assertCanSetRequestHandler(Un(ii)),this.server.registerCapabilities({tools:{listChanged:!0}}),this.server.setRequestHandler(El,()=>({tools:Object.entries(this._registeredTools).filter(([,e])=>e.enabled).map(([e,n])=>{let i={name:e,title:n.title,description:n.description,inputSchema:(()=>{let r=vi(n.inputSchema);return r?ng(r,{strictUnions:!0,pipeStrategy:"input"}):R1})(),annotations:n.annotations,execution:n.execution,_meta:n._meta};if(n.outputSchema){let r=vi(n.outputSchema);r&&(i.outputSchema=ng(r,{strictUnions:!0,pipeStrategy:"output"}))}return i})})),this.server.setRequestHandler(ii,async(e,n)=>{try{let i=this._registeredTools[e.params.name];if(!i)throw new L(F.InvalidParams,`Tool ${e.params.name} not found`);if(!i.enabled)throw new L(F.InvalidParams,`Tool ${e.params.name} disabled`);let r=!!e.params.task,o=i.execution?.taskSupport,s="createTask"in i.handler;if((o==="required"||o==="optional")&&!s)throw new L(F.InternalError,`Tool ${e.params.name} has taskSupport '${o}' but was not registered with registerToolTask`);if(o==="required"&&!r)throw new L(F.MethodNotFound,`Tool ${e.params.name} requires task augmentation (taskSupport: 'required')`);if(o==="optional"&&!r&&s)return await this.handleAutomaticTaskPolling(i,e,n);let c=await this.validateToolInput(i,e.params.arguments,e.params.name),u=await this.executeToolHandler(i,c,n);return r||await this.validateToolOutput(i,u,e.params.name),u}catch(i){if(i instanceof L&&i.code===F.UrlElicitationRequired)throw i;return this.createToolError(i instanceof Error?i.message:String(i))}}),this._toolHandlersInitialized=!0)}createToolError(e){return{content:[{type:"text",text:e}],isError:!0}}async validateToolInput(e,n,i){if(!e.inputSchema)return;let o=vi(e.inputSchema)??e.inputSchema,s=await zl(o,n);if(!s.success){let c="error"in s?s.error:"Unknown error",u=Dl(c);throw new L(F.InvalidParams,`Input validation error: Invalid arguments for tool ${i}: ${u}`)}return s.data}async validateToolOutput(e,n,i){if(!e.outputSchema||!("content"in n)||n.isError)return;if(!n.structuredContent)throw new L(F.InvalidParams,`Output validation error: Tool ${i} has an output schema but no structured content was provided`);let r=vi(e.outputSchema),o=await zl(r,n.structuredContent);if(!o.success){let s="error"in o?o.error:"Unknown error",c=Dl(s);throw new L(F.InvalidParams,`Output validation error: Invalid structured content for tool ${i}: ${c}`)}}async executeToolHandler(e,n,i){let r=e.handler;if("createTask"in r){if(!i.taskStore)throw new Error("No task store provided.");let s={...i,taskStore:i.taskStore};if(e.inputSchema){let c=r;return await Promise.resolve(c.createTask(n,s))}else{let c=r;return await Promise.resolve(c.createTask(s))}}if(e.inputSchema){let s=r;return await Promise.resolve(s(n,i))}else{let s=r;return await Promise.resolve(s(i))}}async handleAutomaticTaskPolling(e,n,i){if(!i.taskStore)throw new Error("No task store provided for task-capable tool.");let r=await this.validateToolInput(e,n.params.arguments,n.params.name),o=e.handler,s={...i,taskStore:i.taskStore},c=r?await Promise.resolve(o.createTask(r,s)):await Promise.resolve(o.createTask(s)),u=c.task.taskId,d=c.task,l=d.pollInterval??5e3;for(;d.status!=="completed"&&d.status!=="failed"&&d.status!=="cancelled";){await new Promise(m=>setTimeout(m,l));let p=await i.taskStore.getTask(u);if(!p)throw new L(F.InternalError,`Task ${u} not found during polling`);d=p}return await i.taskStore.getTaskResult(u)}setCompletionRequestHandler(){this._completionHandlerInitialized||(this.server.assertCanSetRequestHandler(Un(Rl)),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler(Rl,async e=>{switch(e.params.ref.type){case"ref/prompt":return Dx(e),this.handlePromptCompletion(e,e.params.ref);case"ref/resource":return jx(e),this.handleResourceCompletion(e,e.params.ref);default:throw new L(F.InvalidParams,`Invalid completion reference: ${e.params.ref}`)}}),this._completionHandlerInitialized=!0)}async handlePromptCompletion(e,n){let i=this._registeredPrompts[n.name];if(!i)throw new L(F.InvalidParams,`Prompt ${n.name} not found`);if(!i.enabled)throw new L(F.InvalidParams,`Prompt ${n.name} disabled`);if(!i.argsSchema)return ia;let o=Tn(i.argsSchema)?.[e.params.argument.name];if(!Xb(o))return ia;let s=$w(o);if(!s)return ia;let c=await s(e.params.argument.value,e.params.context);return ww(c)}async handleResourceCompletion(e,n){let i=Object.values(this._registeredResourceTemplates).find(s=>s.resourceTemplate.uriTemplate.toString()===n.uri);if(!i){if(this._registeredResources[n.uri])return ia;throw new L(F.InvalidParams,`Resource template ${e.params.ref.uri} not found`)}let r=i.resourceTemplate.completeCallback(e.params.argument.name);if(!r)return ia;let o=await r(e.params.argument.value,e.params.context);return ww(o)}setResourceRequestHandlers(){this._resourceHandlersInitialized||(this.server.assertCanSetRequestHandler(Un(xl)),this.server.assertCanSetRequestHandler(Un(Sl)),this.server.assertCanSetRequestHandler(Un($l)),this.server.registerCapabilities({resources:{listChanged:!0}}),this.server.setRequestHandler(xl,async(e,n)=>{let i=Object.entries(this._registeredResources).filter(([o,s])=>s.enabled).map(([o,s])=>({uri:o,name:s.name,...s.metadata})),r=[];for(let o of Object.values(this._registeredResourceTemplates)){if(!o.resourceTemplate.listCallback)continue;let s=await o.resourceTemplate.listCallback(n);for(let c of s.resources)r.push({...o.metadata,...c})}return{resources:[...i,...r]}}),this.server.setRequestHandler(Sl,async()=>({resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([n,i])=>({name:n,uriTemplate:i.resourceTemplate.uriTemplate.toString(),...i.metadata}))})),this.server.setRequestHandler($l,async(e,n)=>{let i=new URL(e.params.uri),r=this._registeredResources[i.toString()];if(r){if(!r.enabled)throw new L(F.InvalidParams,`Resource ${i} disabled`);return r.readCallback(i,n)}for(let o of Object.values(this._registeredResourceTemplates)){let s=o.resourceTemplate.uriTemplate.match(i.toString());if(s)return o.readCallback(i,s,n)}throw new L(F.InvalidParams,`Resource ${i} not found`)}),this._resourceHandlersInitialized=!0)}setPromptRequestHandlers(){this._promptHandlersInitialized||(this.server.assertCanSetRequestHandler(Un(Il)),this.server.assertCanSetRequestHandler(Un(wl)),this.server.registerCapabilities({prompts:{listChanged:!0}}),this.server.setRequestHandler(Il,()=>({prompts:Object.entries(this._registeredPrompts).filter(([,e])=>e.enabled).map(([e,n])=>({name:e,title:n.title,description:n.description,arguments:n.argsSchema?O1(n.argsSchema):void 0}))})),this.server.setRequestHandler(wl,async(e,n)=>{let i=this._registeredPrompts[e.params.name];if(!i)throw new L(F.InvalidParams,`Prompt ${e.params.name} not found`);if(!i.enabled)throw new L(F.InvalidParams,`Prompt ${e.params.name} disabled`);if(i.argsSchema){let r=vi(i.argsSchema),o=await zl(r,e.params.arguments);if(!o.success){let u="error"in o?o.error:"Unknown error",d=Dl(u);throw new L(F.InvalidParams,`Invalid arguments for prompt ${e.params.name}: ${d}`)}let s=o.data,c=i.callback;return await Promise.resolve(c(s,n))}else{let r=i.callback;return await Promise.resolve(r(n))}}),this._promptHandlersInitialized=!0)}resource(e,n,...i){let r;typeof i[0]=="object"&&(r=i.shift());let o=i[0];if(typeof n=="string"){if(this._registeredResources[n])throw new Error(`Resource ${n} is already registered`);let s=this._createRegisteredResource(e,void 0,n,r,o);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),s}else{if(this._registeredResourceTemplates[e])throw new Error(`Resource template ${e} is already registered`);let s=this._createRegisteredResourceTemplate(e,void 0,n,r,o);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),s}}registerResource(e,n,i,r){if(typeof n=="string"){if(this._registeredResources[n])throw new Error(`Resource ${n} is already registered`);let o=this._createRegisteredResource(e,i.title,n,i,r);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),o}else{if(this._registeredResourceTemplates[e])throw new Error(`Resource template ${e} is already registered`);let o=this._createRegisteredResourceTemplate(e,i.title,n,i,r);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),o}}_createRegisteredResource(e,n,i,r,o){let s={name:e,title:n,metadata:r,readCallback:o,enabled:!0,disable:()=>s.update({enabled:!1}),enable:()=>s.update({enabled:!0}),remove:()=>s.update({uri:null}),update:c=>{typeof c.uri<"u"&&c.uri!==i&&(delete this._registeredResources[i],c.uri&&(this._registeredResources[c.uri]=s)),typeof c.name<"u"&&(s.name=c.name),typeof c.title<"u"&&(s.title=c.title),typeof c.metadata<"u"&&(s.metadata=c.metadata),typeof c.callback<"u"&&(s.readCallback=c.callback),typeof c.enabled<"u"&&(s.enabled=c.enabled),this.sendResourceListChanged()}};return this._registeredResources[i]=s,s}_createRegisteredResourceTemplate(e,n,i,r,o){let s={resourceTemplate:i,title:n,metadata:r,readCallback:o,enabled:!0,disable:()=>s.update({enabled:!1}),enable:()=>s.update({enabled:!0}),remove:()=>s.update({name:null}),update:d=>{typeof d.name<"u"&&d.name!==e&&(delete this._registeredResourceTemplates[e],d.name&&(this._registeredResourceTemplates[d.name]=s)),typeof d.title<"u"&&(s.title=d.title),typeof d.template<"u"&&(s.resourceTemplate=d.template),typeof d.metadata<"u"&&(s.metadata=d.metadata),typeof d.callback<"u"&&(s.readCallback=d.callback),typeof d.enabled<"u"&&(s.enabled=d.enabled),this.sendResourceListChanged()}};this._registeredResourceTemplates[e]=s;let c=i.uriTemplate.variableNames;return Array.isArray(c)&&c.some(d=>!!i.completeCallback(d))&&this.setCompletionRequestHandler(),s}_createRegisteredPrompt(e,n,i,r,o){let s={title:n,description:i,argsSchema:r===void 0?void 0:rr(r),callback:o,enabled:!0,disable:()=>s.update({enabled:!1}),enable:()=>s.update({enabled:!0}),remove:()=>s.update({name:null}),update:c=>{typeof c.name<"u"&&c.name!==e&&(delete this._registeredPrompts[e],c.name&&(this._registeredPrompts[c.name]=s)),typeof c.title<"u"&&(s.title=c.title),typeof c.description<"u"&&(s.description=c.description),typeof c.argsSchema<"u"&&(s.argsSchema=rr(c.argsSchema)),typeof c.callback<"u"&&(s.callback=c.callback),typeof c.enabled<"u"&&(s.enabled=c.enabled),this.sendPromptListChanged()}};return this._registeredPrompts[e]=s,r&&Object.values(r).some(u=>{let d=u instanceof ei?u._def?.innerType:u;return Xb(d)})&&this.setCompletionRequestHandler(),s}_createRegisteredTool(e,n,i,r,o,s,c,u,d){Qb(e);let l={title:n,description:i,inputSchema:Iw(r),outputSchema:Iw(o),annotations:s,execution:c,_meta:u,handler:d,enabled:!0,disable:()=>l.update({enabled:!1}),enable:()=>l.update({enabled:!0}),remove:()=>l.update({name:null}),update:p=>{typeof p.name<"u"&&p.name!==e&&(typeof p.name=="string"&&Qb(p.name),delete this._registeredTools[e],p.name&&(this._registeredTools[p.name]=l)),typeof p.title<"u"&&(l.title=p.title),typeof p.description<"u"&&(l.description=p.description),typeof p.paramsSchema<"u"&&(l.inputSchema=rr(p.paramsSchema)),typeof p.outputSchema<"u"&&(l.outputSchema=rr(p.outputSchema)),typeof p.callback<"u"&&(l.handler=p.callback),typeof p.annotations<"u"&&(l.annotations=p.annotations),typeof p._meta<"u"&&(l._meta=p._meta),typeof p.enabled<"u"&&(l.enabled=p.enabled),this.sendToolListChanged()}};return this._registeredTools[e]=l,this.setToolRequestHandlers(),this.sendToolListChanged(),l}tool(e,...n){if(this._registeredTools[e])throw new Error(`Tool ${e} is already registered`);let i,r,o,s;if(typeof n[0]=="string"&&(i=n.shift()),n.length>1){let u=n[0];if(e_(u))r=n.shift(),n.length>1&&typeof n[0]=="object"&&n[0]!==null&&!e_(n[0])&&(s=n.shift());else if(typeof u=="object"&&u!==null){if(Object.values(u).some(d=>typeof d=="object"&&d!==null))throw new Error(`Tool ${e} expected a Zod schema or ToolAnnotations, but received an unrecognized object`);s=n.shift()}}let c=n[0];return this._createRegisteredTool(e,void 0,i,r,o,s,{taskSupport:"forbidden"},void 0,c)}registerTool(e,n,i){if(this._registeredTools[e])throw new Error(`Tool ${e} is already registered`);let{title:r,description:o,inputSchema:s,outputSchema:c,annotations:u,_meta:d}=n;return this._createRegisteredTool(e,r,o,s,c,u,{taskSupport:"forbidden"},d,i)}prompt(e,...n){if(this._registeredPrompts[e])throw new Error(`Prompt ${e} is already registered`);let i;typeof n[0]=="string"&&(i=n.shift());let r;n.length>1&&(r=n.shift());let o=n[0],s=this._createRegisteredPrompt(e,void 0,i,r,o);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),s}registerPrompt(e,n,i){if(this._registeredPrompts[e])throw new Error(`Prompt ${e} is already registered`);let{title:r,description:o,argsSchema:s}=n,c=this._createRegisteredPrompt(e,r,o,s,i);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),c}isConnected(){return this.server.transport!==void 0}async sendLoggingMessage(e,n){return this.server.sendLoggingMessage(e,n)}sendResourceListChanged(){this.isConnected()&&this.server.sendResourceListChanged()}sendToolListChanged(){this.isConnected()&&this.server.sendToolListChanged()}sendPromptListChanged(){this.isConnected()&&this.server.sendPromptListChanged()}};var R1={type:"object",properties:{}};function Ew(t){return t!==null&&typeof t=="object"&&"parse"in t&&typeof t.parse=="function"&&"safeParse"in t&&typeof t.safeParse=="function"}function Tw(t){return"_def"in t||"_zod"in t||Ew(t)}function e_(t){return typeof t!="object"||t===null||Tw(t)?!1:Object.keys(t).length===0?!0:Object.values(t).some(Ew)}function Iw(t){if(t){if(e_(t))return rr(t);if(!Tw(t))throw new Error("inputSchema must be a Zod schema or raw shape, received an unrecognized object");return t}}function O1(t){let e=Tn(t);return e?Object.entries(e).map(([n,i])=>{let r=Hx(i),o=Kx(i);return{name:n,description:r,required:!o}}):[]}function Un(t){let n=Tn(t)?.method;if(!n)throw new Error("Schema is missing a method literal");let i=jl(n);if(typeof i=="string")return i;throw new Error("Schema method literal must be a string")}function ww(t){return{completion:{values:t.slice(0,100),total:t.length,hasMore:t.length>100}}}var ia={completion:{values:[],hasMore:!1}};var oa=a.object({endpoint:a.string().min(1).max(256).optional(),apiKey:a.string().min(1).max(256).optional(),workspace:a.string().min(1).max(256).optional(),region:a.string().min(1).max(256).optional()}).strict(),Rw=a.enum(["SUM","COUNT","MAX","UNIQUE_COUNT","LATEST"]),t_=a.object({d:a.number().int().nonnegative(),w:a.number().int().positive(),c:a.number().nonnegative(),agg:Rw.default("COUNT").optional(),valueProperty:a.string().optional(),uniqueProperty:a.string().optional(),provenance:a.enum(["plan","manual","provider"]).optional(),warnAt:a.number().min(0).max(1).optional(),scope:oa.optional()}),P1=a.object({kind:a.literal("credential_validity")}),A1=a.object({kind:a.literal("track_only_bypass")}),N1=a.object({kind:a.literal("lifecycle_block"),blockOn:a.array(a.string()).default(["SUSPENDED","CANCELLED","INACTIVE"]),code:a.string().default("subscription_inactive")}),C1=a.object({kind:a.literal("scope"),requireExplicit:a.boolean().default(!0)}),z1=a.object({kind:a.literal("permission"),mode:a.enum(["grace","closed"]).optional()}),D1=a.object({kind:a.literal("geo_restriction"),allow:a.array(a.string().length(2).regex(/^[A-Z]{2}$/)).optional(),block:a.array(a.string().length(2).regex(/^[A-Z]{2}$/)).optional()}).refine(t=>t.allow!==void 0||t.block!==void 0,{message:"geo_restriction requires either `allow` or `block`"}),j1=a.enum(["fixed_window","sliding_window","token_bucket"]),U1=t_.extend({kind:a.literal("rate_limit"),m:a.enum(["e","t"]).default("e"),strategy:j1.default("fixed_window"),bucket_capacity:a.number().positive().optional(),refill_rate_per_second:a.number().positive().optional()}).superRefine((t,e)=>{t.strategy==="token_bucket"?(t.bucket_capacity===void 0&&e.addIssue({code:"custom",message:"token_bucket strategy requires `bucket_capacity` (positive number)",path:["bucket_capacity"]}),t.refill_rate_per_second===void 0&&e.addIssue({code:"custom",message:"token_bucket strategy requires `refill_rate_per_second` (positive number)",path:["refill_rate_per_second"]})):(t.bucket_capacity!==void 0&&e.addIssue({code:"custom",message:`bucket_capacity is only valid when strategy === 'token_bucket' (got '${t.strategy}')`,path:["bucket_capacity"]}),t.refill_rate_per_second!==void 0&&e.addIssue({code:"custom",message:`refill_rate_per_second is only valid when strategy === 'token_bucket' (got '${t.strategy}')`,path:["refill_rate_per_second"]}))}),M1=a.enum(["fixed_window","sliding_window"]),L1=t_.extend({kind:a.literal("quota"),ovr:a.enum(["BLOCK","ALLOW_AND_BILL"]),strategy:M1.default("fixed_window")}),Z1=t_.extend({kind:a.literal("credit_balance"),ovr:a.enum(["BLOCK","ALLOW_AND_BILL"])}),F1=a.object({kind:a.literal("concurrency"),dimension:a.string().min(1).max(120),limit:a.number().int().positive(),lease_ttl_seconds:a.number().int().positive().max(3600).default(60)}),B1=a.object({kind:a.literal("resource_limit"),resource:a.string().min(1).max(120),limit:a.number().int().nonnegative()}),q1=a.object({kind:a.literal("reservation"),dimension:a.string().min(1).max(120),max_outstanding:a.number().int().positive(),hold_seconds:a.number().int().positive().max(86400)}),V1=a.enum(["plan","manual","provider"]),n_=a.object({maxInputTokens:a.number().int().positive().optional(),maxOutputTokens:a.number().int().positive().optional(),maxContextTokens:a.number().int().positive().optional(),maxPayloadBytes:a.number().int().positive().optional(),enforcement:a.enum(["enforce","track"]).default("enforce"),failMode:a.enum(["open","closed"]).default("open"),tokenCountSource:a.enum(["declared","estimated"]).optional(),scope:oa.optional()}).refine(Ow,{message:"capacity requires at least one ceiling (maxInputTokens / maxOutputTokens / maxContextTokens / maxPayloadBytes)"});function Ow(t){return t.maxInputTokens!==void 0||t.maxOutputTokens!==void 0||t.maxContextTokens!==void 0||t.maxPayloadBytes!==void 0}var H1=a.object({kind:a.literal("capacity"),maxInputTokens:a.number().int().positive().optional(),maxOutputTokens:a.number().int().positive().optional(),maxContextTokens:a.number().int().positive().optional(),maxPayloadBytes:a.number().int().positive().optional(),enforcement:a.enum(["enforce","track"]).default("enforce"),failMode:a.enum(["open","closed"]).default("open"),tokenCountSource:a.enum(["declared","estimated"]).optional(),scope:oa.optional(),provenance:V1.optional()}).refine(Ow,{message:"capacity requires at least one ceiling (maxInputTokens / maxOutputTokens / maxContextTokens / maxPayloadBytes)"}),r_=a.discriminatedUnion("kind",[P1,A1,N1,C1,z1,D1,U1,L1,Z1,B1,F1,q1,H1]);var sa=["customer_operation","control_plane","admin_internal","background_job","webhook","healthcheck","unclassified"],oG=new Set(sa);var Td=a.object({trafficClass:a.enum(sa),policySource:a.enum(["declared","inherited","defaulted","inferred"]),limitParticipation:a.object({profile:a.enum(["customer_usage","business_capacity","control_plane","admin_internal","platform_abuse_only","healthcheck","none"]),pools:a.array(a.string().min(1)).optional(),scopes:a.array(a.object({endpoint:a.string().optional(),apiKey:a.string().optional(),workspace:a.string().optional(),region:a.string().optional()}).passthrough()).optional(),metrics:a.array(a.string().min(1)).optional()}).passthrough(),customerBillingPolicy:a.object({customerBillable:a.boolean(),meterKey:a.string().min(1).optional(),chargeableOutcomes:a.enum(["success_only","success_and_partial","attempted","trusted_actual_usage_only"]),invoiceBehavior:a.string().optional()}).passthrough(),providerCostPolicy:a.object({providerCostTracked:a.boolean(),declaredProviderHint:a.string().optional(),declaredModelHint:a.string().optional()}).passthrough()}).passthrough();var gG=a.object({keyId:a.string().min(1),orgId:a.string().min(1),principal:a.object({subjectKind:a.enum(["member","service"]),memberId:a.string().optional(),serviceAccountId:a.string().optional(),keyId:a.string()}),businessId:a.string().min(1),compiledPlanId:a.string().min(1),entitlementHash:a.string().optional(),subjectKey:a.string().min(1),subscriptionId:a.string().min(1),currentPeriodId:a.string().optional(),currentPeriodStartMs:a.number().optional(),subscriberId:a.string().min(1),apiKeyId:a.string().nullable(),entitlementVersion:a.number(),status:a.enum(["active","revoked"]),expiresAt:a.number().nullable().optional(),subscriberStatus:a.enum(["ONBOARDING","ACTIVE","SUSPENDED"]),subscriptionStatus:a.string().min(1),environment:a.enum(["production","sandbox"]).optional(),environmentId:a.string().optional(),scopes:a.array(a.string()).readonly().optional(),entitlement:a.record(a.string(),a.unknown()).nullable().optional()});var Pw=a.object({unit:a.enum(["requests","tokens","computeMs","dollars"]),window:a.enum(["second","minute","hour","day","week","month"]),capacity:a.number()}),K1=a.object({id:a.string().min(1),slug:a.string().optional(),transportMode:a.enum(["direct","tunnel"]),verificationRequired:a.boolean().optional(),originUrl:a.string().optional(),originHostname:a.string().optional(),accessCredentialRef:a.string().optional(),policyVersion:a.string().optional()}),bG=a.object({id:a.string().min(1),origin:a.string().min(1),sandboxOrigin:a.string().nullable().optional(),authHeader:a.string().optional(),pricing:a.object({requests:a.number().optional(),tokens:a.number().optional(),computeMs:a.number().optional(),per_request:a.number().optional()}).catchall(a.number().optional()).optional(),metering:a.object({tokens:a.object({}).optional(),computeMs:a.object({}).optional(),billOn4xx:a.boolean().optional()}).optional(),tenantLimits:a.array(Pw).readonly().optional(),userLimits:a.array(Pw).readonly().optional(),environmentId:a.string().optional(),contextTokenSecret:a.string().nullable().optional(),timeoutMs:a.number().positive().optional(),idleTimeoutMs:a.number().positive().optional(),backends:a.array(K1).optional(),defaultBackendId:a.string().optional(),verificationRequired:a.boolean().optional(),allowedOrigins:a.array(a.string()).optional(),hasPublicRoutes:a.boolean().optional(),publicRoutesCompiledPlanId:a.string().min(1).optional()});var G1=a.object({perRequestMinUnitsByDim:a.record(a.string(),a.number()).optional(),creditPoolMicros:a.number().optional(),perDimUnitCostMicros:a.record(a.string(),a.number()).optional()}),W1=a.object({source:a.enum(["fixed","provider_catalog"]),meterKey:a.string(),selector:a.string().optional(),measures:a.array(a.string()),catalog:a.string().optional(),pricePolicy:a.string().optional(),markupPercent:a.number().optional(),fixedRatesMicros:a.record(a.string(),a.record(a.string(),a.number())).optional()}),J1=a.object({key:a.string(),display:a.string(),unit:a.string().optional(),aggregation:a.enum(["SUM","COUNT","MAX","UNIQUE_COUNT","LATEST"]),window:a.enum(["minute","hour","day","month","billing_period"]),enforcementType:a.string()}),Y1=a.object({routeId:a.string().min(1),method:a.string(),path:a.string(),meters:a.array(a.string()).optional(),usagePolicy:Td.optional(),policyResolutionMode:a.literal("policy").optional()}),_G=a.object({v:a.number(),sub:a.string(),compiledPlanId:a.string().min(1),planType:a.string(),ts:a.number(),constraints:a.array(r_),cv:a.number(),policyResolutionMode:a.literal("policy").optional(),dm:a.record(a.string(),a.number()),dmv:a.number().optional(),floor:G1.nullable().optional(),displayDims:a.array(a.number()).optional(),meterSemantics:a.record(a.string(),J1).optional(),rp:a.record(a.string(),W1).optional(),fr:a.array(Y1).optional(),sig:a.string().min(1),sigKid:a.string().optional(),environmentId:a.string().optional()}).passthrough();var yG=a.object({subscriptionId:a.string().min(1),activePeriodId:a.string().optional(),activeCompiledPlanId:a.string().min(1),activeEntitlementHash:a.string().optional(),enforcementMode:a.enum(["STRICT","GRACE","TRACK_ONLY"]),postStreamLockouts:a.array(a.object({code:a.literal("post_stream_overspend"),reason:a.literal("usage_exhausted"),constraintKey:a.string().min(1),cycleId:a.string().min(1),dimension:a.string().min(1),currentCapacity:a.number().nonnegative(),observedUsage:a.number().nonnegative(),lockedAt:a.string().min(1),expiresAt:a.string().min(1)})).optional(),gracePeriodEndsAt:a.string().optional(),trialEndsAt:a.string().optional(),scheduledTransition:a.object({kind:a.string(),timing:a.string(),scheduledFor:a.string(),toCompiledPlanId:a.string().nullable()}).optional(),creditPool:a.object({periodStartMs:a.number(),periodEndMs:a.number(),grantedCents:a.number(),policy:a.enum(["block","allow"]),epoch:a.number()}).optional(),dedicatedShard:a.enum(["ACTIVE","DRAINING"]).optional(),memberAuthz:a.record(a.string(),a.object({permissions:a.array(a.string()),roles:a.array(a.string())})).optional(),memberAuthzComputedAt:a.number().optional(),generation:a.number(),updatedAt:a.string()});var X1=["DRAFT","ACTIVE"],xG=a.enum(X1),Q1=["ONBOARDING","ACTIVE","SUSPENDED"],Aw=a.enum(Q1),eM=["ACTIVE","REVOKED"],SG=a.enum(eM),tM=["BLOCK","ALLOW_AND_BILL"],Nw=a.enum(tM),nM=["ACTIVE","ARCHIVED"],$G=a.enum(nM),rM=["ACTIVE","PHASING_OUT","SUPERSEDED","ARCHIVED"],IG=a.enum(rM);var Cw=["input","output","total","cached_read_input","cache_creation_input","context","max_output","estimated_output","actual_output","streaming_output"],Rd=[{id:"requests",label:"API requests",description:"Count every call \u2014 the right default for most APIs.",meters:[{key:"requests",display:"Requests",unit:"request"}]},{id:"ai-tokens",label:"AI tokens",description:"LLM-style token metering alongside calls. The gateway can estimate tokens per request and settle actuals from @farthershore/backend reports.",meters:[{key:"requests",display:"Requests",unit:"request"},{key:"tokens_used",display:"Tokens Used",unit:"token"}]},{id:"credits",label:"Credits",description:"Price work in abstract credits (e.g. one image = 5 credits). Report each call's dynamic credit cost through @farthershore/backend.",meters:[{key:"requests",display:"Requests",unit:"request"},{key:"credits",display:"Credits",unit:"credit"}]},{id:"spend",label:"Metered spend",description:"Pass-through spend in cents (OpenRouter-style) reported through @farthershore/backend. Pairs with prepaid credit wallets.",meters:[{key:"requests",display:"Requests",unit:"request"},{key:"dollars",display:"Spend",unit:"cent"}]},{id:"compute",label:"Compute time",description:"Bill milliseconds of compute, settled from @farthershore/backend reports.",meters:[{key:"requests",display:"Requests",unit:"request"},{key:"compute_ms",display:"Compute Time",unit:"ms"}]}];function zw(t){let e=t.trim().toLowerCase();return Rd.find(n=>n.id===e)}function Dw(){return Rd.map(t=>t.id)}var iM="FS_RUNTIME_TOKEN";var oM={payload:"x-fs-metering",signature:"x-fs-metering-sig",token:"x-fs-metering-token"};var PG={environmentVariable:iM,presentation:oM.token,storage:"sha256-hash-only"};var jw={missingSignature:"missing_signature",malformedSignature:"malformed_signature",unknownKeyId:"unknown_key_id",jwksUnavailable:"jwks_unavailable",badSignature:"bad_signature",bodyHashMismatch:"body_hash_mismatch",routeMismatch:"route_mismatch",clockSkew:"clock_skew",expiredSignature:"expired_signature",replayedNonce:"replayed_nonce",bodyTooLarge:"body_too_large",environmentMismatch:"environment_mismatch",missingToken:"missing_token",invalidToken:"invalid_token",contextUnverified:"context_unverified",memberSubjectRequired:"member_subject_required",serviceSubjectRequired:"service_subject_required",surfaceNotAllowed:"surface_not_allowed"};var AG=10*1024*1024;var sM=["CHECKOUT_COMPLETED","PLAN_CHANGED","CANCELLED","RESTORED","UNSCHEDULED_CANCELLATION","PRICE_ROLLOVER","PAUSED","RESUMED","PLAN_CHANGE_SCHEDULED","PLAN_CHANGE_ABORTED","SCHEDULE_CREATED","SCHEDULE_UPDATED","SCHEDULE_RELEASED","SCHEDULE_COMPLETED","SCHEDULE_ABORTED","CANCEL_SCHEDULED","PAYMENT_FAILED","PAYMENT_RECOVERED","PAYMENT_RECOVERED_FROM_SUSPENDED","PAYMENT_ACTION_REQUIRED","RECURRING_PAYMENT","REFUND_PROCESSED","DISPUTE_OPENED","DISPUTE_FUNDS_WITHDRAWN","DISPUTE_CLOSED","DISPUTE_FUNDS_REINSTATED","DISPUTE_CREDIT_REVOKED","DISPUTE_CREDIT_REINSTATED","MIN_SPEND_TRUE_UP"],zG=a.enum(sM);var i_=["BRANCH_PREFIX","PULL_REQUEST","DISABLED"];var aM=a.object({d:a.number(),w:a.number(),capacity:a.number(),remaining:a.number(),windowStart:a.number(),windowEnd:a.number()}),cM=a.record(a.string(),aM),uM=a.object({allocations:a.array(a.number()),expiresAt:a.number()}),lM=a.record(a.string(),uM),dM=a.record(a.string(),a.bigint()),BG=a.object({subscriptionId:a.string(),handoffToken:a.string(),targetShardId:a.string(),policyVersion:a.number(),entitlementVersion:a.number().nullable(),windowStates:cM,activeLeases:lM,totalsByDimension:dM.optional(),billingCycleId:a.string().nullable().optional(),billingCycleStartMs:a.number().optional()});var Uw=new Set(["read","export","download"]);var Mw={org:["read","create","update","delete","manage_settings","manage_billing"],business:["read","create","update","delete","publish","archive"],plan:["read","create","update","delete","promote_version"],makertoken:["read","create","rotate","revoke"],webhook:["read","configure","rotate_secret"],persona:["read","issue","rotate","revoke"],migration:["create"],auth_provider_connection:["read","create","update","delete"],subscription:["read","cancel","restore","change_plan"],usage:["read","export"],invoice:["read","pay","download"],billing:["read","manage_subscription","refund","change_payment_method"],team:["read","invite","remove_member","change_role","manage_rbac","assign_product_role"],apikey:["read","create","rotate","revoke"],audit_log:["read","export"]},GG=Object.keys(Mw),WG=Object.fromEntries(Object.entries(Mw).map(([t,e])=>[t,{read:e.filter(n=>Uw.has(n)),write:e.filter(n=>!Uw.has(n))}]));var pM=new Set(["GET","HEAD","OPTIONS"]);function Lw(t,e){return pM.has(e.toUpperCase())?`${t}:read`:`${t}:write`}var mM={gatewayProjectRead:"gateway:project:read",gatewayResourceWrite:"gateway:resource:write",usageWrite:"usage:write",authzDeniedWrite:"authz-denied:write",reservationAuthorize:"reservation:authorize",reservationFinalize:"reservation:finalize",internalCronRun:"internal:cron:run",personaManage:"persona:manage"},eW=Object.values(mM);var fM=["managed_frontend","custom_frontend","embedded_sdk","public_api","cli","agent","webhook","admin","internal"],Fw=a.enum(fM),Zw=a.string().min(1).max(128),hM=a.object({d:a.number().int().nonnegative(),w:a.number().int().positive(),rem:a.number(),cap:a.number()}).strict(),Bw=a.object({v:a.literal(1),entV:a.number().int().nonnegative().optional(),entHash:Zw.optional(),featureGrant:a.boolean().optional(),gates:a.array(Zw).max(16).optional(),limits:a.array(hM).max(16).optional()}).strict();var cW=a.object({requestId:a.string(),eventId:a.string(),tenantId:a.string(),slug:a.string(),subscriptionId:a.string(),subscriberId:a.string(),apiKeyId:a.string().nullable(),compiledPlanId:a.string(),subscriberStatus:Aw,subscriptionStatus:a.string(),businessId:a.string(),statusCode:a.number(),path:a.string(),latencyMs:a.number(),rawDimsUnits:a.record(a.string(),a.number()),matchedRouteMeters:a.array(a.string().min(1)).optional(),servedRouteScopes:a.array(a.string().min(1)).optional(),meterSettlements:a.array(a.object({meterId:a.string(),meterType:a.enum(["exact_pre_request","estimated_then_settled","postpaid","strict_concurrency"]),reserved:a.number(),actual:a.number(),delta:a.number(),dimension:a.number().int().nonnegative(),leaseId:a.string()})).optional(),reportingAttested:a.boolean(),customerBillable:a.boolean(),platformBillable:a.boolean().optional(),postStreamPending:a.boolean().optional(),measureContext:a.record(a.string(),a.unknown()).optional(),creditUnitsConsumed:a.record(a.string(),a.number()).optional(),timestamp:a.number(),environmentId:a.string().nullable().optional(),orgId:a.string().optional(),principal:a.object({subjectKind:a.enum(["member","service"]),memberId:a.string().trim().min(1).optional(),serviceAccountId:a.string().trim().min(1).optional(),keyId:a.string().trim().min(1).optional()}).optional(),subjectKey:a.string().optional(),overageBehavior:Nw.optional(),environment:a.enum(["production","sandbox"]).optional(),surface:Fw.optional(),actionId:a.string().min(1).max(128).optional(),resourceMutationId:a.string().min(1).max(200).optional(),subjectType:a.string().min(1).max(128).optional(),subjectId:a.string().min(1).max(256).optional(),decision:Bw.optional(),decisionId:a.string().min(1).max(256).optional(),denyClass:a.enum(["quota","rate","concurrency","capacity","spend","adaptive"]).optional(),blockingConstraintId:a.string().min(1).max(256).optional(),providerSettlements:a.array(a.object({meterId:a.string(),providerReported:a.number(),reconciled:a.number()})).optional(),usagePolicyId:a.string().min(1).max(256).optional(),policySource:a.enum(["declared","inherited","defaulted","inferred"]).optional(),trafficClass:a.enum(sa).optional(),limitProfile:a.enum(["customer_usage","business_capacity","control_plane","admin_internal","platform_abuse_only","healthcheck","none"]).optional(),leaseId:a.string(),transactionId:a.string(),gatewayMetadata:a.object({shardId:a.string(),policyVersion:a.number().int().nonnegative().optional(),artifactVersion:a.number().int().nonnegative().default(0),artifactHash:a.string().regex(/^sha256_[a-f0-9]{64}$/).optional(),leaseTelemetry:a.object({consumeRequests:a.number().int().nonnegative(),localLeaseHits:a.number().int().nonnegative(),doAllocationAttempts:a.number().int().nonnegative(),doAllocationGrants:a.number().int().nonnegative(),doAllocationDenials:a.number().int().nonnegative(),doUnavailable:a.number().int().nonnegative(),doCircuitOpen:a.number().int().nonnegative(),leaseRefreshSingleflightJoins:a.number().int().nonnegative(),leaseRefreshSingleflightJoinRate:a.number().min(0).max(1),expiredLeasesReaped:a.number().int().nonnegative(),expiredLeaseReclaimedGrant:a.array(a.number().nonnegative()),reconcileRequests:a.number().int().nonnegative(),reconcilePositiveDeltas:a.number().int().nonnegative(),reconcileNoLocalLease:a.number().int().nonnegative(),doReconcileAttempts:a.number().int().nonnegative(),doReconcileFailures:a.number().int().nonnegative(),unspentLeaseRemainderReturns:a.number().int().nonnegative(),unspentLeaseRemainderReturnFailures:a.number().int().nonnegative(),unspentLeaseRemainderReturnedGrant:a.array(a.number().nonnegative()),maxObservedPositiveReconcileDelta:a.array(a.number().nonnegative()),requestToDoRatio:a.number().nonnegative(),localLeaseHitRate:a.number().min(0).max(1),localSpendRate:a.number().min(0).max(1),maxObservedActiveLeases:a.number().int().nonnegative(),maxObservedOutstandingGrant:a.array(a.number().nonnegative()),maxObservedOutstandingGrantRatio:a.number().nonnegative(),maxObservedEmergencyReserveGrant:a.array(a.number().nonnegative()),maxObservedEmergencyReserveGrantRatio:a.number().nonnegative(),maxObservedLeaseGrant:a.array(a.number().nonnegative()),maxObservedLeaseGrantRatio:a.number().nonnegative(),maxObservedLeaseTtlMs:a.number().int().nonnegative()}).optional(),artifactCacheTelemetry:a.object({reads:a.number().int().nonnegative(),l0FreshHits:a.number().int().nonnegative(),l0Misses:a.number().int().nonnegative(),l0StaleServes:a.number().int().nonnegative(),l0StaleIfErrorServes:a.number().int().nonnegative(),l0BlockingRefreshes:a.number().int().nonnegative(),l0SingleflightJoins:a.number().int().nonnegative(),l0EarlyRefreshes:a.number().int().nonnegative(),l1Hits:a.number().int().nonnegative(),l1Misses:a.number().int().nonnegative(),l1Rejected:a.number().int().nonnegative(),l1WriteFailures:a.number().int().nonnegative(),kvHits:a.number().int().nonnegative(),kvMisses:a.number().int().nonnegative(),kvTimeouts:a.number().int().nonnegative(),kvCircuitOpenReads:a.number().int().nonnegative(),resultHits:a.number().int().nonnegative(),resultMisses:a.number().int().nonnegative(),resultDenied:a.number().int().nonnegative(),resultUnavailable:a.number().int().nonnegative(),backgroundRefreshErrors:a.number().int().nonnegative(),l0HitRate:a.number().min(0).max(1),l0SingleflightJoinRate:a.number().min(0).max(1),l0EarlyRefreshRate:a.number().min(0).max(1),l1HitRate:a.number().min(0).max(1),kvHitRate:a.number().min(0).max(1),resultHitRate:a.number().min(0).max(1),staleServeRate:a.number().min(0).max(1)}).optional(),gatewayVersion:a.string()}).passthrough()}).passthrough();var gM=a.object({path:a.string(),code:a.string(),message:a.string()}),dW=a.object({reason:a.literal("schema_validation_failed"),receivedAt:a.string(),rawPayload:a.unknown(),issues:a.array(gM),consumerVersion:a.string().optional(),originalMessageId:a.string().optional()});var qw=[{name:"subscription.created",webhook:!0,description:"A subscriber subscription was created."},{name:"subscription.updated",webhook:!0,description:"A subscriber subscription changed (plan, status, trial)."},{name:"subscription.canceled",webhook:!0,description:"A subscriber subscription was canceled."},{name:"payment.succeeded",webhook:!0,description:"A Stripe payment succeeded for a subscription."},{name:"payment.failed",webhook:!0,description:"A Stripe payment failed for a subscription."},{name:"rate_limit.exceeded",webhook:!0,description:"The gateway denied a request for exceeding a rate limit."},{name:"entitlement.changed",webhook:!0,description:"A compiled entitlement/plan was (re)published."},{name:"usage.threshold_reached",webhook:!0,description:"A metered-usage threshold was crossed."},{name:"change_set.created",webhook:!1,description:"A governed Evolution ChangeSet was proposed (draft created)."},{name:"change_set.approved",webhook:!1,description:"A governed Evolution ChangeSet was approved."},{name:"change_set.applied",webhook:!1,description:"A governed Evolution ChangeSet was applied to live state."},{name:"change_set.rolled_back",webhook:!1,description:"A governed Evolution ChangeSet was rolled back."},{name:"change_set.cancelled",webhook:!1,description:"A governed Evolution ChangeSet was cancelled."},{name:"billing.event_recorded",webhook:!1,description:"A BillingEvent row was recorded; the fact references it by id (the authoritative billing row is unchanged \u2014 exact-accounting invariant)."},{name:"authz.decision",webhook:!1,description:"An authorization decision (ALLOW/DENY) mirrored from the audit log onto the spine; AuditLog stays authoritative."},{name:"repo.changed",webhook:!1,description:"A default-branch push to the business's repo touched paths at least one enabled automation rule watches (payload: branch, headSha, bounded changed-path list). Emitted pre-filtered \u2014 never on every push \u2014 so path-triggered automations (e.g. legal/** changed \u2192 notify subscribers) can fire deterministically."},{name:"automation.rule_fired",webhook:!1,description:"An enabled AutomationRule matched a spine fact (trigger + all conditions held) and its actions were scheduled."},{name:"automation.action_succeeded",webhook:!1,description:"An AutomationRule action ran to success."},{name:"automation.action_failed",webhook:!1,description:"An AutomationRule action failed (will retry per the queue)."},{name:"automation.action_denied",webhook:!1,description:"An AutomationRule action was DENIED \u2014 the automation actor lacked the action's native permission (automation is a first-class authz subject, never a bypass). Recorded + audited; the action did not run."},{name:"automation.notification",webhook:!1,description:"A notification recorded by an AutomationRule `create_notification` action \u2014 a spine fact other surfaces (portal/admin) read; no separate notification runtime."},{name:"access_request.created",webhook:!1,description:"A subscriber member requested a missing permission (AccessRequest row created). Internal \u2014 the Communication layer notifies the subscriber's admins (who can grant it)."},{name:"access_request.resolved",webhook:!1,description:"A pending AccessRequest was resolved (approved or denied) by an owner/admin. Internal \u2014 notifies the subscriber's admins."},{name:"build.failed",webhook:!1,description:"A build for the business (frontend/portal or Business-SDK) failed and did not go live. Internal \u2014 the Communication layer notifies the org's members (opt-out-able, category: deployments)."},{name:"product.published",webhook:!1,description:"A business went live for the first time (DRAFT\u2192ACTIVE first publish). Internal \u2014 notifies the org's members (category: deployments)."},{name:"workflow.failed",webhook:!1,description:"A platform workflow (config apply / Stripe sync / subscription transition) reached a terminal FAILED state. Internal \u2014 notifies the org's admins (category: deployments)."},{name:"pr.review_posted",webhook:!1,description:"The platform posted (or updated) its Business-as-Code impact report on a managed-repo pull request. Internal \u2014 emails the org's members the review synopsis + a link to the PR (category: deployments)."}],bM=qw.map(t=>t.name),Vw=qw.filter(t=>t.webhook).map(t=>t.name),fW=a.enum(bM);var Hw=["subscription.created","subscription.updated","subscription.canceled","payment.succeeded","payment.failed","rate_limit.exceeded","entitlement.changed","usage.threshold_reached"],o_=Hw;{let t=new Set(Vw),e=new Set(Hw),n=[...t].filter(r=>!e.has(r)),i=[...e].filter(r=>!t.has(r));if(n.length>0||i.length>0)throw new Error(`[webhooks/events] WEBHOOK_EVENT_NAMES drifted from the events catalog. Missing from order tuple: [${n.join(", ")}]; extra in order tuple: [${i.join(", ")}]. Reconcile ../events/catalog.ts (webhook: true entries) with WEBHOOK_EVENT_ORDER in this file.`)}var Mi=a.enum(o_);var Ut=a.enum(["immediate","period_end"]),Li=a.object({default:Ut.default("period_end"),when:a.object({price_increase:Ut.optional(),price_decrease:Ut.optional(),route_grant_added:Ut.optional(),route_grant_removed:Ut.optional(),limit_increased:Ut.optional(),limit_reduced:Ut.optional(),credit_increased:Ut.optional(),credit_reduced:Ut.optional(),rating_changed:Ut.optional()}).strict().default({price_increase:"period_end",price_decrease:"immediate",route_grant_added:"immediate",route_grant_removed:"period_end",limit_increased:"immediate",limit_reduced:"period_end",credit_increased:"immediate",credit_reduced:"period_end",rating_changed:"period_end"}),allowImmediatePriceIncrease:a.boolean().default(!1),allowImmediateEntitlementReduction:a.boolean().default(!1)}).strict().superRefine((t,e)=>{(t.when.price_increase??t.default)==="immediate"&&!t.allowImmediatePriceIncrease&&e.addIssue({code:"custom",path:["when","price_increase"],message:"price_increase cannot switch immediately without allowImmediatePriceIncrease: true"});for(let n of["route_grant_removed","limit_reduced","credit_reduced"])(t.when[n]??t.default)==="immediate"&&!t.allowImmediateEntitlementReduction&&e.addIssue({code:"custom",path:["when",n],message:`${n} cannot switch immediately without allowImmediateEntitlementReduction: true`})}),_M=Li.parse({});var yM=a.object({kind:a.literal("credit"),amount_cents:a.number().int().nonnegative(),recurs:a.boolean().optional(),expires_after_days:a.number().int().positive().optional(),label:a.string().min(1).max(120).optional()}),vM=a.object({kind:a.literal("top_up"),sku:a.string().min(1).max(120),label:a.string().min(1).max(200),price_cents:a.number().int().positive(),credit_cents:a.number().int().positive()}),Mn=a.discriminatedUnion("kind",[yM,vM]);function Kw(t){return t.kind==="credit"&&t.recurs===!0&&t.label===void 0}function Gw(t){return t.kind==="credit"&&t.recurs!==!0&&t.label===void 0}function Ww(t,e,n=["grants"]){if(!t)return;let i=0,r=0;for(let o of t)Kw(o)?i+=1:Gw(o)&&(r+=1);i>1&&e.addIssue({code:"custom",message:"At most one recurring `credit` grant (recurs:true, no label) is allowed \u2014 recurring credit is a single canonical entry.",path:n}),r>1&&e.addIssue({code:"custom",message:"At most one one-time `credit` grant (recurs:false, no label) is allowed \u2014 one-time credit is a single canonical entry.",path:n})}function Jw(t){return t.grants&&t.grants.length>0?[...t.grants]:[]}function s_(t){return Jw(t).find(Kw)?.amount_cents??0}function Od(t){return Jw(t).find(Gw)?.amount_cents??0}var kM=a.object({percent:a.number().int().min(0).max(100)}),xM=a.object({threshold_cents:a.number().int().nonnegative(),refill_cents:a.number().int().positive()}),Ln=a.object({rollover:kM.optional(),auto_recharge:xM.optional()});var Yw=a.enum(["linear","active_count","event_count"]);var SM=a.object({up_to:a.number().int().positive().nullable(),price_per_unit_micros:a.number().int().nonnegative()}),$M=a.object({strategy:a.enum(["graduated","volume"]),tiers:a.array(SM).min(1).max(20)}),Zn=a.object({dimension:a.string().min(1).max(64).regex(/^[a-z0-9_]+$/,"Meter dimension must be lowercase alphanumeric with underscores"),kind:Yw.default("linear"),price_per_unit_micros:a.number().int().nonnegative().default(0),tiered:$M.optional(),included_units:a.number().int().positive().optional()}).superRefine((t,e)=>{if(t.tiered&&t.price_per_unit_micros>0&&e.addIssue({code:"custom",message:"`tiered` is mutually exclusive with a non-zero `price_per_unit_micros` \u2014 drop one",path:["tiered"]}),t.included_units!==void 0&&t.tiered&&e.addIssue({code:"custom",message:"`included_units` is mutually exclusive with `tiered` \u2014 a tiered schedule already expresses the included allotment as a zero-priced first tier",path:["included_units"]}),t.tiered){let n=0,i=!1;for(let r=0;r<t.tiered.tiers.length;r++){let o=t.tiered.tiers[r];if(i){e.addIssue({code:"custom",message:"Open-ended tier (`up_to: null`) must be the final tier",path:["tiered","tiers",r,"up_to"]});break}if(o.up_to===null){i=!0;continue}o.up_to<=n&&e.addIssue({code:"custom",message:`Tier upper bounds must be strictly ascending (tier ${r} = ${o.up_to} <= previous ${n})`,path:["tiered","tiers",r,"up_to"]}),n=o.up_to}i||e.addIssue({code:"custom",message:"The final tier of a `tiered` schedule must be open-ended (`up_to: null`)",path:["tiered","tiers",t.tiered.tiers.length-1,"up_to"]})}}),Zi=a.enum(["month","year"]),IM=a.object({meters:a.array(Zn).default([]),recurring_fee_cents:a.number().int().nonnegative().default(0),billing_interval:Zi.default("month"),grants:a.array(Mn).max(40).default([]),creditPolicy:Ln.optional(),trial_days:a.number().int().nonnegative().default(0),max_monthly_spend_cents:a.number().int().nonnegative().optional()});var wM=a.string().min(1),EM=a.object({type:a.literal("named"),name:a.enum(["second","minute","hour","day","week","month"])}),TM=a.object({type:a.literal("custom"),seconds:a.number().int().positive(),label:a.string().optional()}),RM=a.discriminatedUnion("type",[EM,TM]),aa=a.object({dimension:wM,window:RM,capacity:a.number().nonnegative(),enforcement:a.enum(["enforce","track"]).optional(),warnAt:a.number().min(0).max(1).optional(),scope:oa.optional(),acknowledgeUnreachable:a.boolean().optional()}),PW=a.array(aa).max(20);function OM(t){let e=/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/.exec(t);if(!e)return!1;let n=Number(e[1]),i=Number(e[2]);return n>255||i>255||Number(e[3])>255||Number(e[4])>255?!1:n===0||n===127||n===10||n===172&&i>=16&&i<=31||n===192&&i===168||n===169&&i===254||n===100&&i>=64&&i<=127}function Xw(t){let e=t.trim().toLowerCase().replace(/^\[|\]$/g,"");return e.endsWith(".")&&(e=e.slice(0,-1)),e==="localhost"||e.endsWith(".localhost")||e.startsWith("::ffff:")||e==="::"||e==="::1"||e.includes(":")&&(e.startsWith("fc")||e.startsWith("fd")||e.startsWith("fe80"))?!0:OM(e)}var c_=["GET","HEAD","POST","PUT","PATCH","DELETE"],ca=1048576,eE=1048576;function tE(t){return new TextEncoder().encode(t).byteLength}function PM(t){try{let e=JSON.stringify(t);return typeof e=="string"?tE(e):null}catch{return null}}var u_=a.string().min(1).max(64).regex(/^[a-z][a-z0-9_-]*$/,"Integration id must be lowercase alphanumeric with hyphens/underscores"),l_=a.string().min(1).max(128).regex(/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,"Header name must be a valid HTTP token").refine(t=>t!=="*","Header wildcard is not allowed").transform(t=>t.toLowerCase()),nE=new Set(["connection","keep-alive","proxy-connection","te","trailer","transfer-encoding","upgrade","content-length","content-encoding"]),rE=l_.refine(t=>!nE.has(t)&&!["host","cookie","set-cookie","authorization","proxy-authorization"].includes(t),"Browser request header is not safe"),AM=l_.refine(t=>!nE.has(t)&&!["host","cookie","set-cookie"].includes(t),"Injection header is not safe"),NM=new Set(["cache-control","etag","last-modified","link","retry-after","x-request-id","x-ratelimit-limit","x-ratelimit-remaining","x-ratelimit-reset"]),CM=l_.refine(t=>NM.has(t),"Response header is not safe to project"),zM=a.string().max(16384).refine(t=>!/[\r\n]/.test(t),"Header values cannot contain CR/LF"),iE=a.string().min(3).max(128).regex(/^[a-z0-9!#$&^_.+-]+\/[a-z0-9!#$&^_.+-]+$/i,"Content type must be an exact media type").refine(t=>!t.includes("*"),"Content type wildcards are not allowed").transform(t=>t.toLowerCase());function oE(t){return[...new Set(t)].sort((e,n)=>e<n?-1:e>n?1:0)}function Fi(t,e,n=1,i=!1){return a.array(t).min(n).max(e).superRefine((r,o)=>{if(!i)return;let s=new Set;for(let[c,u]of r.entries())s.has(u)&&o.addIssue({code:"custom",path:[c],message:`duplicate value "${u}" is not allowed`}),s.add(u)}).transform(r=>oE(r))}var DM=Fi(rE,20,0,!0),sE=a.string().min(1).max(128).regex(/^[A-Za-z0-9_.~-]+$/,"Query parameter name is invalid"),jM=Fi(sE,30,0,!0);function UM(){return a.record(a.string(),a.string().max(16384)).superRefine((t,e)=>{let n=Object.keys(t);n.length>30&&e.addIssue({code:"custom",message:"Too many query parameters"});for(let i of n)sE.safeParse(i).success||e.addIssue({code:"custom",path:[i],message:"Browser query parameter is invalid"})})}function MM(){return a.record(a.string(),zM).superRefine((t,e)=>{Object.keys(t).length>20&&e.addIssue({code:"custom",message:"Too many request headers"});let i=new Set;for(let[r,o]of Object.entries(t)){let s=rE.safeParse(r);if(!s.success){e.addIssue({code:"custom",path:[r],message:"Browser request header is not safe"});continue}i.has(s.data)&&e.addIssue({code:"custom",path:[r],message:`duplicate request header "${r}" is not allowed`}),i.add(s.data),typeof o!="string"&&e.addIssue({code:"custom",path:[r],message:"Request header value must be a string"})}}).transform(t=>Object.fromEntries(Object.entries(t).map(([e,n])=>[e.toLowerCase(),n])))}function LM(t){return t.split("/").some(e=>{let n=e.replace(/%2e/gi,".");return n==="."||n===".."})}var d_=a.string().min(1).max(500).refine(t=>t.startsWith("/")&&!t.startsWith("//")&&!t.includes("?")&&!t.includes("#")&&!t.includes("\\")&&!t.includes("*")&&!LM(t),"Request path must be an exact relative path"),aE=a.string().max(2048).superRefine((t,e)=>{let n;try{n=new URL(t)}catch{e.addIssue({code:"custom",message:"Upstream must be a valid HTTPS origin"});return}n.protocol!=="https:"&&e.addIssue({code:"custom",message:"Upstream must use HTTPS"}),(n.username||n.password)&&e.addIssue({code:"custom",message:"Upstream cannot include userinfo"}),n.port&&n.port!=="443"&&e.addIssue({code:"custom",message:"Upstream must use the default HTTPS port"}),(n.pathname!=="/"||n.search||n.hash)&&e.addIssue({code:"custom",message:"Upstream must be an origin without a path, query, or fragment"}),n.hostname.includes("*")&&e.addIssue({code:"custom",message:"Upstream wildcard hosts are not allowed"}),Xw(n.hostname)&&e.addIssue({code:"custom",message:"Upstream host is private or loopback"})}).transform(t=>new URL(t).origin),ZM=a.discriminatedUnion("kind",[a.object({kind:a.literal("none")}).strict(),a.object({kind:a.literal("json"),maxBytes:a.number().int().positive().max(ca)}).strict(),a.object({kind:a.literal("text"),maxBytes:a.number().int().positive().max(ca),contentTypes:Fi(iE,10)}).strict()]),FM=a.string().min(1).max(500).regex(/^(?:\/(?:[^~/]|~[01])*)+$/,"Response field must be an RFC 6901 JSON pointer"),BM=a.object({kind:a.literal("json"),contentTypes:Fi(iE,10),maxBytes:a.number().int().positive().max(eE),jsonPointers:Fi(FM,100),responseHeaders:Fi(CM,20,0,!0).default([])}).strict(),Qw=a.string().min(1).max(128).regex(/^[A-Z][A-Z0-9_]*$/,"secretRef must be UPPER_SNAKE"),qM=a.discriminatedUnion("location",[a.object({secretRef:Qw,location:a.literal("header"),name:AM,template:a.enum(["{value}","Bearer {value}"])}).strict(),a.object({secretRef:Qw,location:a.literal("query"),name:a.string().min(1).max(128).regex(/^[A-Za-z0-9_.~-]+$/,"Query parameter name is invalid")}).strict()]),VM=a.object({method:a.enum(c_),path:d_,headers:DM.default([]),query:jM.default([]),body:ZM}).strict(),HM=a.array(VM).min(1).max(100).superRefine((t,e)=>{let n=new Set;for(let[i,r]of t.entries()){let o=`${r.method} ${r.path}`;n.has(o)&&e.addIssue({code:"custom",path:[i],message:`duplicate frontend integration operation "${o}"`}),n.add(o)}}).transform(t=>[...t].sort((e,n)=>{let i=`${e.method} ${e.path}`,r=`${n.method} ${n.path}`;return i<r?-1:i>r?1:0})),cE=a.object({id:u_,upstream:aE,request:a.object({operations:HM}).strict(),injection:qM,response:BM}).strict().superRefine((t,e)=>{if(t.injection.location==="header")for(let[n,i]of t.request.operations.entries())i.headers.includes(t.injection.name)&&e.addIssue({code:"custom",path:["request","operations",n,"headers"],message:`browser request header collides with injected header "${t.injection.name}"`})}),uE=cE;function lE(t){if(t&&typeof t=="object"&&!Object.isFrozen(t)){Object.freeze(t);for(let e of Object.values(t))lE(e)}return t}var KM=cE.transform(t=>lE(t)),p_=a.array(uE).max(200).superRefine((t,e)=>{let n=new Set;for(let[i,r]of t.entries())n.has(r.id)&&e.addIssue({code:"custom",path:[i,"id"],message:`duplicate frontend integration id "${r.id}"`}),n.add(r.id)}).transform(t=>[...t].sort((e,n)=>e.id<n.id?-1:e.id>n.id?1:0)),m_=a.array(u_).max(200).transform(t=>oE(t)).optional(),a_=a.lazy(()=>a.union([a.null(),a.boolean(),a.number().finite(),a.string().max(65536),a.array(a_).max(100),a.record(a.string().min(1).max(128),a_).superRefine((t,e)=>{Object.keys(t).length>100&&e.addIssue({code:"custom",message:"JSON object has too many keys"})})])),GM=a.discriminatedUnion("kind",[a.object({kind:a.literal("json"),value:a_}).strict(),a.object({kind:a.literal("text"),value:a.string().max(ca)}).strict()]).superRefine((t,e)=>{let n=t.kind==="json"?PM(t.value):tE(t.value);(n===null||n>ca)&&e.addIssue({code:"custom",message:"Request body exceeds the UTF-8 byte limit"})}),WM=a.object({integrationId:u_,path:d_,method:a.enum(c_),headers:MM().optional(),query:UM().optional(),body:GM.optional()}).strict();var JM={meters:a.array(Zn).default([]),recurring_fee_cents:a.number().int().nonnegative().default(0),billing_interval:Zi.default("month"),trial_days:a.number().int().nonnegative().default(0),max_monthly_spend_cents:a.number().int().nonnegative().optional(),min_monthly_spend_cents:a.number().int().nonnegative().optional(),grants:a.array(Mn).max(40).default([]),creditPolicy:Ln.optional()},dE=a.object({key:a.string().min(1).max(64).regex(/^[a-z0-9_-]+$/,"Plan key must be lowercase alphanumeric with hyphens/underscores"),name:a.string().min(1).max(100),description:a.string().max(500).optional(),details:a.array(a.string().max(200)).max(10).optional(),...JM,free:a.boolean().default(!1),limits:a.array(aa).max(20).default([]),routeGrants:a.array(a.string().min(1).max(500)).max(500).transform(t=>[...new Set(t)].sort()).optional(),frontendIntegrationGrants:m_,resource_limits:a.record(a.string().min(1).max(120),a.number().int().nonnegative()).default({}),overageBehavior:a.enum(["block","allow_and_bill"]).default("block"),selfServeEnabled:a.boolean().default(!0),capacity:n_.optional(),archive:a.object({at:a.string().datetime().optional(),transitionTo:a.string().optional(),strategy:a.enum(["auto","explicit","block"]).default("auto")}).optional()}).strict(),Pd=dE.superRefine((t,e)=>{Ww(t.grants,e)});var YM=/^\$\{[A-Z][A-Z0-9_]{0,127}\}$/,f_=a.string().min(3).max(200).refine(t=>YM.test(t),{message:"secret must use ${VAR} interpolation syntax (e.g. ${WEBHOOK_SECRET}); raw secrets in YAML are rejected. Define the env var in the per-product secret store and reference it here."}),h_=a.object({maxAttempts:a.number().int().min(1).max(20).default(5),backoff:a.enum(["exponential","fixed"]).default("exponential")}),g_=a.object({id:a.string().min(1).max(64).regex(/^[a-z0-9_-]+$/,"Webhook endpoint id must be lowercase alphanumeric with hyphens/underscores"),url:a.string().url("webhooks.endpoints[].url must be a valid URL"),secret:f_,events:a.array(Mi).min(1,"webhooks.endpoints[].events must subscribe to \u2265 1 event"),enabled:a.boolean().default(!0),retryPolicy:h_.default({maxAttempts:5,backoff:"exponential"})}),b_=a.object({endpoints:a.array(g_).max(50).default([])});var XM=a.object({meters:a.array(Zn).optional(),recurring_fee_cents:a.number().int().nonnegative().optional(),billing_interval:Zi.optional(),grants:a.array(Mn).max(40).optional(),creditPolicy:Ln.optional(),trial_days:a.number().int().nonnegative().optional(),max_monthly_spend_cents:a.number().int().nonnegative().optional(),limits:a.array(aa).max(20).optional(),overageBehavior:a.enum(["block","allow_and_bill"]).optional(),selfServeEnabled:a.boolean().optional()}).strict(),QM=a.object({url:a.string().url().optional(),secret:f_.optional(),events:a.array(Mi).optional(),enabled:a.boolean().optional(),retryPolicy:h_.partial().optional()}).strict(),eL=a.object({plans:a.record(a.string(),XM).optional(),webhooks:a.object({endpoints:a.record(a.string(),QM).optional()}).strict().optional()}).strict(),__=a.record(a.string().min(1).max(64),eL);var y_=a.enum(["query","mutation"]),v_=a.enum(["none","metadata","full"]),k_=a.object({type:a.string().min(1).max(64).regex(/^[a-zA-Z0-9_.:-]+$/),from:a.enum(["header","path_param"]),name:a.string().min(1).max(120)}),x_=a.object({resource:a.string().min(1).max(100).regex(/^[a-z0-9_.:-]+$/),effect:a.enum(["create","delete"])}),pE=a.object({id:a.string().min(1).max(160).regex(/^[a-z0-9_.:-]+$/),title:a.string().min(1).max(160).optional(),kind:y_,actorType:a.string().min(1).max(64).regex(/^[a-zA-Z0-9_.:-]+$/).optional(),subject:k_.optional(),inputSchemaRef:a.string().min(1).max(240).optional(),audit:v_.default("metadata"),resource:x_.optional()});var mE=a.enum(["subscription","subject"]),fE=a.enum(["reported","action_inferred"]),hE=a.string().min(1).max(100).regex(/^[a-z0-9_.:-]+$/),gE=a.object({name:hE,display:a.string().min(1).max(120).optional(),scope:mE.default("subscription"),subjectType:a.string().min(1).max(64).regex(/^[a-zA-Z0-9_.:-]+$/).optional(),countSource:fE.default("reported")}).superRefine((t,e)=>{t.scope==="subject"&&!t.subjectType&&e.addIssue({code:"custom",path:["subjectType"],message:"subjectType is required when resource scope is subject"}),t.scope==="subscription"&&t.subjectType&&e.addIssue({code:"custom",path:["subjectType"],message:"subjectType is only valid for subject-scoped counted resources"})}),S_=a.array(gE).max(100).default([]);var bE=/^[a-z0-9][a-z0-9_-]*$/,$_=a.string().min(1).max(64).regex(bE,"backend id must be a lowercase slug ([a-z0-9][a-z0-9_-]*)"),_E=a.enum(["direct","tunnel"]),yE=a.enum(["embedded","sidecar"]);var vE=a.object({mode:_E.default("direct"),runner:yE.optional()}).strict(),kE=a.object({required:a.boolean().default(!0)}).strict(),xE=a.object({name:a.string().min(1).max(120).optional(),slug:$_.optional(),transport:vE.default({mode:"direct"}),verification:kE.default({required:!0}),meters:a.array(a.string().min(1).max(64)).max(100).optional(),default:a.boolean().optional()}).strict(),I_=a.record($_,xE),Bi=$_,qi={unknownBackendInRoute:"UNKNOWN_BACKEND_IN_ROUTE",ambiguousDefaultBackend:"AMBIGUOUS_DEFAULT_BACKEND",routeMeterNotAllowedByBackend:"ROUTE_METER_NOT_ALLOWED_BY_BACKEND",unknownMeterInBackend:"UNKNOWN_METER_IN_BACKEND"};function w_(t){let e=Object.keys(t??{});if(e.length===0)return{defaultId:null,ambiguous:!1};if(e.length===1)return{defaultId:e[0],ambiguous:!1};let n=e.filter(i=>t[i]?.default===!0);return n.length===1?{defaultId:n[0],ambiguous:!1}:{defaultId:null,ambiguous:!0}}var $E=a.enum(["long","short","blocking"]).default("long");var IE=a.object({method:a.enum(["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"]),path:a.string().min(1).max(500).regex(/^\/[a-zA-Z0-9_/:.{}-]*$/,"path must be a concrete route starting with /; wildcard segments are reserved for meterRoutes selectors").refine(t=>!t.split("/").some(e=>["{__fs_rest}",":__fs_rest","[__fs_rest]"].includes(e)),"reserved greedy path parameters are only valid in non-granting meter selectors")});function tL(t){let e=t.trim();if(!e)return!1;let[n,i,r]=e.split("-");if(r!==void 0||!/^\d{3}$/.test(n??""))return!1;let o=Number(n),s=i===void 0?o:Number(i);return i!==void 0&&!/^\d{3}$/.test(i)?!1:o>=100&&o<=599&&s>=100&&s<=599&&o<=s}function wE(t){return t.split(",").every(tL)}var Ad=a.union([a.string().min(1).max(100).refine(wE,{message:"onStatusCodes must be comma-separated HTTP status codes or numeric ranges, e.g. 200-299,304"}),a.array(a.number().int().min(100).max(599)).min(1).max(100)]),EE=a.enum(["public","required"]),TE=a.enum(["network","5xx"]),RE=a.object({maxAttempts:a.number().int().min(1).max(3),retryOn:a.array(TE).min(1).max(2),backoff:a.object({base:a.number().int().min(0).max(6e4),max:a.number().int().min(0).max(6e4),jitter:a.number().min(0).max(1)}).strict().refine(t=>t.max>=t.base,{message:"retry.backoff.max must be >= retry.backoff.base"}),budgetRatio:a.number().min(0).max(1)}).strict(),OE=a.enum(["ui","api","agent","webhook","cli"]),SE=new Map(OE.options.map((t,e)=>[t,e])),nL=a.array(OE).min(1).refine(t=>t.every((e,n)=>n===0||(SE.get(e)??-1)>(SE.get(t[n-1])??-1)),{message:"surfaces must be a canonical set: unique and sorted by surface order (ui, api, agent, webhook, cli)"}),Nd=a.object({authMode:EE.optional(),timeoutMs:a.number().int().min(1).max(6e5).optional(),idleTimeoutMs:a.number().int().min(1).max(6e5).optional(),retry:RE.optional(),subject:a.enum(["member","service"]).optional(),surfaces:nL.optional(),hidden:a.boolean().optional()}).strict(),Cd=a.object({dimension:a.string().min(1).max(64).default("requests"),window:a.union([a.object({type:a.literal("named"),name:a.enum(["second","minute","hour","day","week","month"])}),a.object({type:a.literal("custom"),seconds:a.number().int().positive(),label:a.string().min(1).max(64).optional()})]),capacity:a.number().nonnegative(),enforcement:a.enum(["enforce","track"]).default("enforce")}).strict(),PE=a.object({match:IE,metering:a.object({defaults:a.record(a.string().min(1).max(64),a.number().finite().nonnegative()).optional(),reports:a.array(a.string().min(1).max(64)).max(20).optional(),onStatusCodes:Ad.optional(),postStreamBilling:a.boolean().optional()}).optional(),unmetered:a.boolean().optional(),inheritDefaultMeters:a.boolean().optional(),action:a.string().min(1).max(160).regex(/^[a-z0-9_.:-]+$/).optional(),backend:Bi.optional(),usagePolicy:Td.optional(),policy:Nd.optional(),limits:a.array(Cd).min(1).max(8).optional()}).strict(),AE=a.object({rollout_key:a.string().min(1).max(120).regex(/^[a-z0-9_-]+$/,"rollout_key must be lowercase alphanumeric with hyphens/underscores").optional(),required_flags:a.array(a.string().min(1).max(120).regex(/^[a-z0-9_-]+$/)).max(10).optional()}),E_=a.object({description:a.string().max(500).optional(),mutation_class:a.enum(["runtime","contractual"]).default("contractual"),cacheProfile:$E,routes:a.array(PE).min(1).max(50),runtime:AE.default({}),actions:a.array(pE).max(100).optional(),backend:Bi.optional()}).strict();var rL="{__fs_rest}";function iL(t){if(t.startsWith(":"))return t.slice(1);if(t.startsWith("{")&&t.endsWith("}")||t.startsWith("[")&&t.endsWith("]"))return t.slice(1,-1)}function T_(t,e){let n=e.split("/").map((i,r)=>r===0?i:i==="**"||i===rL?"**":i==="*"||iL(i)!==void 0?"*":i).join("/");return`${t.toUpperCase()} ${n}`}function hr(t){return t.actionId??T_(t.method,t.path)}function NE(t,e){t.usagePricing!==void 0&&e.addIssue({code:"custom",path:["usagePricing"],message:"usagePricing is not supported. Define usage.meters.<key>.rating instead."})}function CE(t,e){t.filter(i=>i.free).length>1&&e.addIssue({code:"custom",path:["plans"],message:"Only one free plan is allowed per product"}),t.forEach((i,r)=>{i.free&&(oL(i,r,e),sL(i,r,e))})}function oL(t,e,n){(LE(t)??0)!==0&&n.addIssue({code:"custom",path:["plans",e,"recurring_fee_cents"],message:"Free plans must have zero price"})}function sL(t,e,n){t.limits.some(r=>!r.enforcement||r.enforcement==="enforce")||n.addIssue({code:"custom",path:["plans",e,"limits"],message:"Free plans must include at least one hard enforced limit"})}function zE(t,e){let n=new Map;t.forEach((i,r)=>{if(i.free)return;let o=LE(i);if(o===void 0||o<=0)return;let s=lL(i,o),c=n.get(s);if(c){e.addIssue({code:"custom",path:["plans",r,"recurring_fee_cents"],message:`Paid plan price duplicates plan "${c}" (${s})`});return}n.set(s,i.key)})}function DE(t,e){let n=new Set((t.metering?.meters??[]).map(r=>r.key).filter(r=>typeof r=="string"&&r.length>0)),i=new Set(Object.keys(t.usage?.meters??{}));t.plans.forEach((r,o)=>{let s=r.meters;s&&s.forEach((c,u)=>{let d=c.dimension;typeof d!="string"||d.length===0||n.has(d)||i.has(d)||e.addIssue({code:"custom",path:["plans",o,"meters",u,"dimension"],message:`Plan "${r.key}" prices meter "${d}" but no metering.meters[] entry and no usage.meters[] entry declares it.`})})})}function jE(t,e){if(!t.routeCatalog)return;let n=new Set((t.metering?.meters??[]).map(r=>r.key).filter(r=>typeof r=="string"&&r.length>0)),i=!1;for(let[r,o]of Object.entries(t.routeCatalog))(o.routes??[]).forEach((c,u)=>{let d=R_(c);d.length!==0&&(i=!0,d.forEach((l,p)=>{n.has(l)||e.addIssue({code:"custom",path:["routeCatalog",r,"routes",u,"metering",p],message:`Route references unknown meter "${l}". Declare it in metering.meters[].`})}))});i&&n.size===0&&e.addIssue({code:"custom",path:["metering","meters"],message:"One or more routes declare metering keys but `metering.meters[]` is empty. Declare meters at the product level first."})}function aL(t,e){let n=new Map;for(let r of t.plans)n.set(r.key,new Set);if(!t.routeCatalog){for(let r of n.values())for(let o of e)r.add(o);return n}let i=Object.values(t.routeCatalog).flatMap(r=>r.routes??[]);for(let r of t.plans){let o=n.get(r.key),s=new Set(r.routeGrants??[]);for(let c of i){if(c.unmetered===!0||!c.path)continue;let u=hr({actionId:c.actionId,method:c.method,path:c.path});if(s.has(u))for(let d of R_(c))o.add(d)}}return n}function R_(t){let e=new Set;for(let n of Object.keys(t.metering?.defaults??{}))e.add(n);for(let n of t.metering?.reports??[])e.add(n);return[...e]}function cL(t){if(!t||typeof t!="object")return null;let e=t;return typeof e.dimension=="string"?e.dimension:null}var uL=new Set(["credits"]);function UE(t,e){if(!t.plans||t.plans.length===0)return;let n=new Set((t.metering?.meters??[]).map(o=>o.key).filter(o=>typeof o=="string"&&o.length>0)),i=new Set(Object.keys(t.usage?.meters??{})),r=aL(t,n);t.plans.forEach((o,s)=>{let c=o.limits??[],u=r.get(o.key)??new Set;c.forEach((d,l)=>{if(d&&typeof d=="object"?d.acknowledgeUnreachable===!0:!1)return;let m=cL(d);m&&(u.has(m)||i.has(m)||uL.has(m)||e.addIssue({code:"custom",path:["plans",s,"limits",l,"meter"],message:`Plan "${o.key}" limits meter "${m}" but no directly granted route emits this meter, and the meter is not declared under usage.meters either. Either add a matching routeGrants entry for a route that emits "${m}", declare the meter under metering.meters[] or usage.meters, or set acknowledgeUnreachable: true if the limit is intentional (e.g. soft budget).`}))})})}function ME(t,e){let n=t.backend;if(!n||Object.keys(n).length===0)return;let i=new Set(Object.keys(n)),r=new Set((t.metering?.meters??[]).map(u=>u.key).filter(u=>typeof u=="string"&&u.length>0));for(let[u,d]of Object.entries(n))(d.meters??[]).forEach((l,p)=>{r.has(l)||e.addIssue({code:"custom",path:["backend",u,"meters",p],message:`${qi.unknownMeterInBackend}: backend "${u}" allows meter "${l}" but no metering.meters[] entry declares it.`})});let{defaultId:o,ambiguous:s}=w_(n),c=!1;for(let u of Object.values(t.routeCatalog??{}))for(let d of u.routes??[])d.backend===void 0&&(c=!0);s&&c&&e.addIssue({code:"custom",path:["backend"],message:`${qi.ambiguousDefaultBackend}: product declares ${i.size} backends but no single default \u2014 mark exactly one backend \`default: true\` or bind every route explicitly.`});for(let[u,d]of Object.entries(t.routeCatalog??{}))(d.routes??[]).forEach((l,p)=>{let m=l.backend??o;if(l.backend!==void 0&&!i.has(l.backend)){e.addIssue({code:"custom",path:["routeCatalog",u,"routes",p,"backend"],message:`${qi.unknownBackendInRoute}: route binds backend "${l.backend}" which is not declared in the product \`backend\` block.`});return}if(!m)return;let h=n[m]?.meters;if(!h)return;let y=new Set(h);for(let v of R_(l))y.has(v)||e.addIssue({code:"custom",path:["routeCatalog",u,"routes",p,"metering"],message:`${qi.routeMeterNotAllowedByBackend}: route meters "${v}" but backend "${m}" does not allow it (backend.meters[] = [${h.join(", ")}]).`})})}function LE(t){return t.recurring_fee_cents}function lL(t,e){return`USD:month:${e}`}var dL=a.object({subdomain:a.string().min(1).max(63).regex(/^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/,"Subdomain must be lowercase alphanumeric with optional hyphens")}),ZE=a.enum(["exact_pre_request","estimated_then_settled","postpaid","strict_concurrency"]),pL=a.enum(Cw),O_=a.object({key:a.string().min(1).max(64).regex(/^[a-z0-9_]+$/,"Meter key must be lowercase alphanumeric with underscores"),display:a.string().min(1).max(100),unit:a.string().max(20).optional(),routeDefault:a.number().finite().nonnegative().optional(),enforcementType:ZE.default("estimated_then_settled"),aggregation:a.enum(["SUM","COUNT","MAX","UNIQUE_COUNT","LATEST"]).default("COUNT"),window:a.enum(["minute","hour","day","month","billing_period"]).default("billing_period"),valueProperty:a.string().optional(),uniqueProperty:a.string().optional(),groupBy:a.array(a.string()).optional(),eventCode:a.string().optional(),tokenCategory:pL.optional(),reserveStrategy:a.enum(["reserve_max","estimate","count_actual"]).optional(),reserveCeiling:a.number().int().positive().optional(),pairsWith:a.string().min(1).max(64).optional()}),FE=a.string().min(1).max(64).regex(/^[a-z0-9_]+$/,"Usage measure must be lowercase alphanumeric with underscores"),mL=a.enum(["pass_through","markup"]),fL=a.object({source:a.literal("fixed"),rates:a.record(a.string().min(1),a.record(FE,a.number().int().nonnegative()))}),hL=a.object({source:a.literal("provider_catalog"),catalog:a.string().min(1).max(100),pricePolicy:mL.default("pass_through"),markupPercent:a.number().nonnegative().max(1e4).optional(),marginMicros:a.number().int().nonnegative().optional()}),BE=a.discriminatedUnion("source",[fL,hL]),qE=a.object({selector:a.string().min(1).max(100).optional(),measures:a.array(FE).min(1).max(20),rating:BE.optional()}),VE=a.object({meters:a.record(a.string().min(1).max(64).regex(/^[a-z0-9_]+$/),qE)}),gL=a.object({defaults:a.record(a.string().min(1).max(64),a.number().finite().nonnegative()).optional(),reports:a.array(a.string().min(1).max(64)).max(20).optional(),onStatusCodes:Ad.optional(),postStreamBilling:a.boolean().optional()}),bL=a.object({kind:y_,title:a.string().min(1).max(160).optional(),actorType:a.string().min(1).max(64).regex(/^[a-zA-Z0-9_.:-]+$/).optional(),subject:k_.optional(),audit:v_,resource:x_.optional()}),HE=a.object({method:a.enum(["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"]),path:a.string().min(1).max(500).regex(/^\/[a-zA-Z0-9_/:.{}-]*$/,"path must be a concrete route starting with /; wildcard segments are reserved for meterRoutes selectors").refine(t=>!t.split("/").some(e=>["{__fs_rest}",":__fs_rest","[__fs_rest]"].includes(e)),"reserved greedy path parameters are only valid in non-granting meter selectors"),actionId:a.string().min(1).max(120).optional(),actionMeta:bL.optional(),unmetered:a.boolean().optional(),metering:gL.optional(),inheritDefaultMeters:a.boolean().optional(),backend:Bi.optional(),limits:a.array(Cd).min(1).max(8).optional(),policy:Nd.optional()}).strict(),P_=a.object({description:a.string().max(500).optional(),routes:a.array(HE).min(1).max(50)}),KE=a.record(a.string().min(1).max(100).regex(/^[a-z0-9_.:-]+$/),P_),GE=a.enum(["report","pull_request"]),WE=a.enum(["safe","non_blocking","economic_risk","blocking"]),JE=a.object({cleanup:a.object({enabled:a.boolean().default(!1),mode:GE.default("report")}).default({enabled:!1,mode:"report"}),change_approval:a.object({auto_merge_max_risk:a.enum(["none","safe","non_blocking"]).default("none"),require_human_for:a.array(WE).default(["economic_risk","blocking"])}).default({auto_merge_max_risk:"none",require_human_for:["economic_risk","blocking"]})}).default({cleanup:{enabled:!1,mode:"report"},change_approval:{auto_merge_max_risk:"none",require_human_for:["economic_risk","blocking"]}}),YE=a.enum(["clerk","test-personas"]),XE=a.object({context_tokens:a.object({enabled:a.boolean().default(!0)}).optional(),portal_auth:a.object({strategy:YE}).optional()}),gr=a.object({business:a.object({visibility:a.enum(["public","private"]).default("public"),rbac:a.boolean().optional()}),gateway:a.object({authHeader:a.string().min(1).max(100).default("x-api-key"),upstreamAuth:a.object({type:a.enum(["none","static_bearer"]),token:a.string().optional()}).default({type:"none"})}),metering:a.object({meters:a.array(O_).max(10).default([]),billOn4xx:a.boolean().default(!1)}).default({meters:[],billOn4xx:!1}),backend:I_.optional(),usage:VE.optional(),usagePricing:a.never({error:"usagePricing is not supported. Define usage.meters.<key>.rating instead."}).optional(),routeCatalog:KE.optional(),resources:S_,policies:JE,customer_context:XE.optional(),frontend:a.never({error:"frontend is not authorable in Business-as-Code. Define pages and navigation in the frontend application; use route policy surfaces for API/UI callability."}).optional(),billing:a.object({applyLimitUpgradesInstantly:a.boolean().optional(),subscriberChangePolicy:Li.default({default:"period_end",when:{price_increase:"period_end",price_decrease:"immediate",route_grant_added:"immediate",route_grant_removed:"period_end",limit_increased:"immediate",limit_reduced:"period_end",credit_increased:"immediate",credit_reduced:"period_end",rating_changed:"period_end"},allowImmediatePriceIncrease:!1,allowImmediateEntitlementReduction:!1})}).default({subscriberChangePolicy:{default:"period_end",when:{price_increase:"period_end",price_decrease:"immediate",route_grant_added:"immediate",route_grant_removed:"period_end",limit_increased:"immediate",limit_reduced:"period_end",credit_increased:"immediate",credit_reduced:"period_end",rating_changed:"period_end"},allowImmediatePriceIncrease:!1,allowImmediateEntitlementReduction:!1}}),plans:a.array(Pd).max(4).default([]),lifecycle:a.object({breaking_changes:a.object({require_deprecation_window_days:a.number().int().nonnegative().default(0),require_successor_route:a.boolean().default(!1)}).default({require_deprecation_window_days:0,require_successor_route:!1})}).default({breaking_changes:{require_deprecation_window_days:0,require_successor_route:!1}}),webhooks:b_.optional(),environments:__.optional(),ephemeral:a.object({defaultPlan:a.string().min(1).optional()}).optional()}).superRefine((t,e)=>{NE(t,e),CE(t.plans,e),zE(t.plans,e),DE(t,e),jE(t,e),UE(t,e),ME(t,e)}),_L=a.object({business:gr.shape.business}),yL=a.object({gateway:gr.shape.gateway}),vL=a.object({metering:gr.shape.metering}),kL=a.object({plans:gr.shape.plans});var QE=1,eT="business",xL=`${eT}/index.ts`,SL=a.object({irVersion:a.literal(QE),sdkVersion:a.string().min(1).max(64),business:gr,routes:a.array(E_).max(200).default([]),frontendIntegrations:p_.default([])}).strict().superRefine((t,e)=>{let n=new Map;for(let[i,r]of t.routes.entries())for(let[o,s]of r.routes.entries()){let c=hr({actionId:s.action,method:s.match.method,path:s.match.path}),u=T_(s.match.method,s.match.path),d=s.action?r.actions?.find(m=>m.id===s.action):void 0,l=tT({action:d,layer:{backend:r.backend,cacheProfile:r.cacheProfile,description:r.description,mutation_class:r.mutation_class,runtime:r.runtime},route:{backend:s.backend??r.backend,inheritDefaultMeters:s.inheritDefaultMeters,limits:s.limits,metering:s.metering,policy:s.policy,unmetered:s.unmetered,usagePolicy:s.usagePolicy}}),p=n.get(c);if(p&&p.endpoint!==u){e.addIssue({code:"custom",path:["routes",i,"routes",o,"action"],message:`route id collision for "${c}": maps to both ${p.endpoint} and ${u}`});continue}if(p&&p.behavior!==l){e.addIssue({code:"custom",path:["routes",i,"routes",o],message:`conflicting route definition for "${c}"`});continue}n.set(c,{endpoint:u,behavior:l})}for(let[i,r]of t.business.plans.entries()){for(let[o,s]of(r.routeGrants??[]).entries())n.has(s)||e.addIssue({code:"custom",path:["business","plans",i,"routeGrants",o],message:`unknown route grant "${s}" for plan "${r.key}"`});for(let[o,s]of(r.frontendIntegrationGrants??[]).entries())t.frontendIntegrations.some(c=>c.id===s)||e.addIssue({code:"custom",path:["business","plans",i,"frontendIntegrationGrants",o],message:`unknown frontend integration grant "${s}" for plan "${r.key}"`})}});function tT(t){return A_(JSON.parse(JSON.stringify(t)))}function A_(t){return Array.isArray(t)?`[${t.map(A_).join(",")}]`:t&&typeof t=="object"?`{${Object.entries(t).sort(([e],[n])=>e<n?-1:e>n?1:0).map(([e,n])=>`${JSON.stringify(e)}:${A_(n)}`).join(",")}}`:JSON.stringify(t)}var t3=a.object({subscriberChangePolicy:Li.optional()}),n3=a.object({code:a.string(),kind:a.enum(["percent_off","amount_off","free_months"]),amount:a.number().optional(),durationMonths:a.number(),applicablePlanIds:a.array(a.string()).optional(),maxRedemptions:a.number().optional(),activeFrom:a.string().optional(),activeUntil:a.string().optional(),status:a.enum(["ACTIVE","ARCHIVED"]).optional()}),r3=a.object({id:a.string(),actorUserId:a.string().optional(),action:a.string(),decision:a.string().optional(),timestamp:a.string(),details:a.unknown().optional()}),i3=a.object({name:a.string(),branch:a.string().optional(),isProduction:a.boolean().optional()}),o3=a.object({id:a.string(),name:a.string(),apiKeyId:a.string().optional()});var nT=a.object({id:a.string(),billingCycleId:a.string(),effectiveStart:a.string(),effectiveEnd:a.string(),compiledPlanId:a.string()}),rT=a.object({currentPeriod:nT,priorPeriod:nT.optional()});var $L=a.object({subjectKey:a.string(),subscriptionId:a.string(),subscriberId:a.string(),businessId:a.string(),organizationId:a.string(),compiledPlanId:a.string(),activeEntitlementHash:a.string().optional(),generation:a.number(),enforcementMode:a.enum(["STRICT","GRACE","TRACK_ONLY"]),dedicatedShard:a.enum(["ACTIVE","DRAINING"]).optional(),memberAuthz:a.record(a.string(),a.object({permissions:a.array(a.string()),roles:a.array(a.string())})).optional(),memberAuthzComputedAt:a.number().optional(),postStreamLockouts:a.array(a.object({code:a.literal("post_stream_overspend"),reason:a.literal("usage_exhausted"),constraintKey:a.string().min(1),cycleId:a.string().min(1),dimension:a.string().min(1),currentCapacity:a.number().nonnegative(),observedUsage:a.number().nonnegative(),lockedAt:a.string().min(1),expiresAt:a.string().min(1)})).optional(),subscriptionStatus:a.string(),subscriberStatus:a.string(),scopes:a.array(a.string()),periods:rT,expiresAt:a.number().optional(),trialEndsAt:a.string().optional()}),IL=a.discriminatedUnion("kind",[a.object({kind:a.literal("found"),state:$L,expiresAt:a.number(),ttlSeconds:a.number()}),a.object({kind:a.literal("not_found"),negativeCacheTtlSeconds:a.number().default(60)}),a.object({kind:a.literal("revoked"),negativeCacheTtlSeconds:a.number().default(300),reason:a.string().optional()}),a.object({kind:a.literal("rate_limited"),retryAfterSeconds:a.number().default(10)})]),g3=a.object({environmentId:a.string().nullable(),subjectKeys:a.array(a.string()).min(1).max(500)}),b3=a.object({results:a.array(a.object({subjectKey:a.string(),result:IL}))}),wL=a.object({keyId:a.string(),orgId:a.string(),businessId:a.string(),compiledPlanId:a.string(),entitlementHash:a.string().optional(),subscriptionId:a.string(),subscriberId:a.string(),apiKeyId:a.string().nullable(),subjectKey:a.string(),entitlementVersion:a.number().int(),status:a.enum(["active","revoked"]),subscriberStatus:a.enum(["ONBOARDING","ACTIVE","SUSPENDED"]),subscriptionStatus:a.string(),environment:a.enum(["production","sandbox"]).optional(),environmentId:a.string().optional(),scopes:a.array(a.string()).default([]),permissions:a.array(a.string()).optional(),roles:a.array(a.string()).optional(),entitlement:a.unknown().optional(),principal:a.object({subjectKind:a.enum(["member","service"]),memberId:a.string().optional(),serviceAccountId:a.string().optional(),keyId:a.string()}),currentPeriodId:a.string().optional(),currentPeriodStartMs:a.number().int().nonnegative().optional(),expiresAt:a.number().nullable().optional()}),_3=a.discriminatedUnion("kind",[a.object({kind:a.literal("found"),record:wL,expiresAt:a.number(),ttlSeconds:a.number()}),a.object({kind:a.literal("not_found"),negativeCacheTtlSeconds:a.number().default(60)}),a.object({kind:a.literal("revoked"),negativeCacheTtlSeconds:a.number().default(300),reason:a.string().optional()}),a.object({kind:a.literal("rate_limited"),retryAfterSeconds:a.number().default(10)})]),y3=a.discriminatedUnion("kind",[a.object({kind:a.literal("found"),entitlement:a.unknown(),expiresAt:a.number(),ttlSeconds:a.number()}),a.object({kind:a.literal("not_found"),negativeCacheTtlSeconds:a.number().default(60)}),a.object({kind:a.literal("rate_limited"),retryAfterSeconds:a.number().default(10)})]),EL=a.object({id:a.string().min(1),slug:a.string().optional(),transportMode:a.enum(["direct","tunnel"]),verificationRequired:a.boolean().optional(),originUrl:a.string().optional(),originHostname:a.string().optional(),accessCredentialRef:a.string().optional(),policyVersion:a.string().optional()}),TL=a.object({id:a.string(),origin:a.string(),sandboxOrigin:a.string().nullable().optional(),authHeader:a.string().optional(),pricing:a.record(a.string(),a.number()).optional(),metering:a.object({billOn4xx:a.boolean().optional()}).optional(),tenantLimits:a.array(a.object({unit:a.enum(["requests","tokens","computeMs","dollars"]),window:a.enum(["second","minute","hour","day","week","month"]),capacity:a.number()})).optional(),userLimits:a.array(a.object({unit:a.enum(["requests","tokens","computeMs","dollars"]),window:a.enum(["second","minute","hour","day","week","month"]),capacity:a.number()})).optional(),environmentId:a.string().optional(),contextTokenSecret:a.string().nullable().optional(),timeoutMs:a.number().positive().optional(),idleTimeoutMs:a.number().positive().optional(),backends:a.array(EL).optional(),defaultBackendId:a.string().optional(),verificationRequired:a.boolean().optional(),allowedOrigins:a.array(a.string()).optional(),hasPublicRoutes:a.boolean().optional(),publicRoutesCompiledPlanId:a.string().min(1).optional()}),v3=a.discriminatedUnion("kind",[a.object({kind:a.literal("found"),tenant:TL,expiresAt:a.number(),ttlSeconds:a.number()}),a.object({kind:a.literal("not_found"),negativeCacheTtlSeconds:a.number().default(60)}),a.object({kind:a.literal("rate_limited"),retryAfterSeconds:a.number().default(10)})]);var zd=["consumer_api_key","consumer_session_token","test_persona_session_token","builder_master_key","builder_session_token","maker_jwt","service_jwt","internal_service","context_token"],iT=a.enum(zd);var RL=a.object({fromIssuer:a.string().min(1),fromTokenId:a.string().min(1),intent:a.string().min(1)}),oT=a.object({issuer:a.string().min(1),issuedAt:a.number().int().nonnegative(),expiresAt:a.number().int().nonnegative().optional(),tokenId:a.string().min(1).optional(),delegationChain:a.array(RL)});var N_=["template","embedded","provisioned","agent"],OL=a.enum(N_),PL=["builder_user","builder_org","maker","consumer_subject","internal_service","service_jwt","agent_runtime"],AL=a.enum(PL),sT=a.object({kind:AL,id:a.string().min(1),label:a.string().optional()}),NL=["subscription","organization","platform"],CL=a.enum(NL),zL=a.object({kind:CL,id:a.string().min(1)}),DL=a.object({type:iT,id:a.string().min(1),hint:a.string().max(8).optional()}),jL=a.object({compiledPlanId:a.string().min(1),fromCache:a.boolean().optional()}),O3=a.object({requestId:a.string().min(1),surface:OL,builderOrgId:a.string().min(1),businessId:a.string().min(1).optional(),runtimeId:a.string().min(1).optional(),template:a.string().optional(),caller:sT,actor:sT,billingSubject:zL,credential:DL,operation:a.string().min(1),scopes:a.array(a.string()),entitlement:jL.optional(),trust:oT});var ue=["template","agent"],UL=["provisioned"],aT=[...N_],le=["builder_master_key","builder_session_token","maker_jwt"],Vi=["service_jwt","internal_service"],C_=["consumer_api_key","consumer_session_token","test_persona_session_token","context_token"],cT=[...zd],ua="subscriptions:write",ML=[{id:"businesses.create",operation:"Create a product",requiredScopes:["businesses:write"],allowedSurfaces:ue,allowedCredentialTypes:le,description:"Create a new product in the builder org"},{id:"businesses.update",operation:"Update a product",requiredScopes:["businesses:write"],allowedSurfaces:ue,allowedCredentialTypes:le,description:"Update product metadata or compiled config"},{id:"businesses.delete",operation:"Delete a product",requiredScopes:["businesses:write"],allowedSurfaces:ue,allowedCredentialTypes:le,description:"Delete a product (soft-archive if subscriptions exist)"},{id:"businesses.read",operation:"Read a product",requiredScopes:["businesses:read"],allowedSurfaces:ue,allowedCredentialTypes:le,description:"Read product metadata + compiled config"},{id:"businesses.publish",operation:"Publish a product",requiredScopes:["businesses:write"],allowedSurfaces:ue,allowedCredentialTypes:le,description:"Compile + publish the product to the gateway"},{id:"plans.create",operation:"Create a plan",requiredScopes:["plans:write"],allowedSurfaces:ue,allowedCredentialTypes:le,description:"Add a new plan to a product"},{id:"plans.update",operation:"Update a plan",requiredScopes:["plans:write"],allowedSurfaces:ue,allowedCredentialTypes:le,description:"Update plan pricing, limits, or features"},{id:"plans.delete",operation:"Delete a plan",requiredScopes:["plans:write"],allowedSurfaces:ue,allowedCredentialTypes:le,description:"Delete a plan (denied if subscriptions are attached)"},{id:"plans.publish",operation:"Publish a plan",requiredScopes:["plans:write"],allowedSurfaces:ue,allowedCredentialTypes:le,description:"Mark a plan as available for new subscriptions"},{id:"subscriptions.create",operation:"Create a subscription",requiredScopes:[ua],allowedSurfaces:ue,allowedCredentialTypes:[...le,...Vi],description:"Provision a new subscription for a subscriber"},{id:"subscriptions.update",operation:"Update a subscription",requiredScopes:[ua],allowedSurfaces:ue,allowedCredentialTypes:[...le,...Vi],description:"Change plan, enforcement mode, or schedule"},{id:"subscriptions.cancel",operation:"Cancel a subscription",requiredScopes:[ua],allowedSurfaces:ue,allowedCredentialTypes:[...le,...Vi],description:"Cancel a subscription (immediate or end-of-period)"},{id:"subscriptions.pause",operation:"Pause a subscription",requiredScopes:[ua],allowedSurfaces:ue,allowedCredentialTypes:[...le,...Vi],description:"Pause a subscription (no usage, no billing)"},{id:"subscriptions.resume",operation:"Resume a subscription",requiredScopes:[ua],allowedSurfaces:ue,allowedCredentialTypes:[...le,...Vi],description:"Resume a paused subscription"},{id:"subscriptions.read",operation:"Read a subscription",requiredScopes:["subscriptions:read"],allowedSurfaces:ue,allowedCredentialTypes:[...le,...Vi],description:"Read subscription state and usage"},{id:"webhooks.create",operation:"Create a webhook endpoint",requiredScopes:["webhooks:write"],allowedSurfaces:ue,allowedCredentialTypes:le,description:"Register a new webhook endpoint URL"},{id:"webhooks.update",operation:"Update a webhook endpoint",requiredScopes:["webhooks:write"],allowedSurfaces:ue,allowedCredentialTypes:le,description:"Update endpoint URL, secret, or subscribed events"},{id:"webhooks.delete",operation:"Delete a webhook endpoint",requiredScopes:["webhooks:write"],allowedSurfaces:ue,allowedCredentialTypes:le,description:"Remove a webhook endpoint"},{id:"webhooks.test",operation:"Send a test webhook payload",requiredScopes:["webhooks:write"],allowedSurfaces:ue,allowedCredentialTypes:le,description:"Trigger a synthetic payload to verify an endpoint"},{id:"api-keys.create",operation:"Create an API key",requiredScopes:["api-keys:write"],allowedSurfaces:ue,allowedCredentialTypes:le,description:"Mint a new consumer or master API key"},{id:"api-keys.revoke",operation:"Revoke an API key",requiredScopes:["api-keys:write"],allowedSurfaces:ue,allowedCredentialTypes:le,description:"Revoke an API key (immediate invalidation)"},{id:"api-keys.read",operation:"Read API key metadata",requiredScopes:["api-keys:read"],allowedSurfaces:ue,allowedCredentialTypes:le,description:"Read key id + hint + scopes (never the secret)"},{id:"organizations.create",operation:"Create an organization",requiredScopes:["orgs:write"],allowedSurfaces:["template"],allowedCredentialTypes:["builder_session_token"],description:"Create a builder org (top-level signup)"},{id:"organizations.update",operation:"Update an organization",requiredScopes:["orgs:write"],allowedSurfaces:ue,allowedCredentialTypes:le,description:"Update org metadata or billing email"},{id:"members.invite",operation:"Invite a member to an organization",requiredScopes:["members:write"],allowedSurfaces:ue,allowedCredentialTypes:le,description:"Send an invitation to join the org"},{id:"members.remove",operation:"Remove a member from an organization",requiredScopes:["members:write"],allowedSurfaces:ue,allowedCredentialTypes:le,description:"Revoke a member's access to the org"},{id:"projects.create",operation:"Create a project",requiredScopes:["projects:write"],allowedSurfaces:ue,allowedCredentialTypes:le,description:"Create a project (groups products + environments)"},{id:"environments.create",operation:"Create an environment",requiredScopes:["environments:write"],allowedSurfaces:ue,allowedCredentialTypes:le,description:"Add a deployment environment (stage / branch)"},{id:"environments.delete",operation:"Delete an environment",requiredScopes:["environments:write"],allowedSurfaces:ue,allowedCredentialTypes:le,description:"Remove a deployment environment"},{id:"billing.portal-redirect",operation:"Generate Stripe customer-portal redirect",requiredScopes:["billing:portal"],allowedSurfaces:ue,allowedCredentialTypes:[...le,...C_],description:"Mint a one-time Stripe portal-session redirect URL"},{id:"billing.read",operation:"Read billing state",requiredScopes:["billing:read"],allowedSurfaces:ue,allowedCredentialTypes:[...le,...C_],description:"Read invoices, balances, scheduled changes"},{id:"runtime-context.read",operation:"Read the caller's runtime context",requiredScopes:[],allowedSurfaces:aT,allowedCredentialTypes:cT,description:"Introspect the resolved RuntimeContext (minus secrets)"},{id:"operations.list",operation:"List registered operations",requiredScopes:[],allowedSurfaces:aT,allowedCredentialTypes:cT,description:"List all operations the registry knows about"},{id:"explain-denial.read",operation:"Explain a denial decision",requiredScopes:["audit:read"],allowedSurfaces:ue,allowedCredentialTypes:le,description:"Look up a decision id + return the full ctx + reason"},{id:"replay.execute",operation:"Replay a historical billing period",requiredScopes:["replay:execute"],allowedSurfaces:ue,allowedCredentialTypes:le,description:"Re-run billing for a past period; verify deltas"},{id:"rollback.execute",operation:"Execute a GitHub-driven product rollback",requiredScopes:["rollback:execute"],allowedSurfaces:ue,allowedCredentialTypes:le,description:"Revert business.ts to a previous commit (dry-run capable)"},{id:"api.invoke",operation:"Invoke a consumer-facing gateway route",requiredScopes:[],allowedSurfaces:UL,allowedCredentialTypes:C_,description:"Consumer-side traffic into a deployed product (catch-all). The EntitlementEngine + RuntimeLimitEngine handle the fine-grained gating; this operation is the umbrella entry-point."}],D3=Object.freeze(ML);var LL=["BusinessApplyWorkflow","RollbackWorkflow","StripeSyncWorkflow","WebhookDispatchWorkflow","SubscriptionTransitionWorkflow","CompiledPlanLifecycleWorkflow","ShardReshardWorkflow","MaintenanceJobWorkflow"],L3=a.enum(LL),ZL=["transient","permanent","rollback-required","human-intervention"],Z3=a.enum(ZL);var FL=["SAFE_AUTOMATIC","REQUIRES_APPROVAL","IRREVERSIBLE","BILLING_IMPACTING","EDGE_BREAKING"],F3=a.enum(FL);var G3=a.object({workflowExecutionId:a.string().min(1),eventType:a.string().min(1),phase:a.string().min(1).optional(),stepId:a.string().min(1).optional(),cohortKey:a.string().min(1).optional(),payload:a.record(a.string(),a.unknown()),occurredAt:a.string().min(1),correlationId:a.string().min(1).optional()}).transform(t=>({...t,workflowExecutionId:t.workflowExecutionId,stepId:t.stepId===void 0?void 0:t.stepId}));var BL=["GATEWAY","HOSTED_UI_PAGE","HOSTED_UI_PROXY"],qL=["platform_requests"],VL=a.object({requestId:a.string().optional(),businessId:a.string().optional(),route:a.string().optional(),usageEventId:a.string().optional()}).strict(),HL=a.object({organizationId:a.string().min(1),source:a.enum(BL),dimension:a.enum(qL),quantity:a.number().int().positive(),idempotencyKey:a.string().min(1).max(512),occurredAt:a.string().datetime(),metadata:VL.optional()}).strict(),p5=a.object({entries:a.array(HL).min(1).max(500)});var uT={contract:{label:"Managed as code",summary:"Declarative business state, canonical in the GitHub repo; the API returns 409 MANAGED_BY_CODE once published. Author via the manifest + push.",canonicalHome:"repo",mcpMayWrite:!1},operate:{label:"Runtime operation",summary:"Imperative action on the running platform; never in the repo. Tokens, usage, readiness, builds, publish triggers, runtime knobs, brand edits.",canonicalHome:"api",mcpMayWrite:!0},dual:{label:"Repo or API",summary:"Reconciles via either the repo or the API/MCP; both converge to the same state. Preview environments are the canonical example.",canonicalHome:"both",mcpMayWrite:!0}};function KL(t){return uT[t].mcpMayWrite}function GL(t){return uT[t].canonicalHome}function lT(t,e){return e==="write"&&!KL(t)?`An MCP tool that writes cannot have operationClass "${t}": ${t}-class state is managed as code in the business repo (canonical home: ${GL(t)}). Make the tool read-only, or author the change in the manifest and push instead.`:null}var Ne={VALIDATION_ERROR:"VALIDATION_ERROR",CONFLICT:"CONFLICT",NOT_FOUND:"NOT_FOUND",NOT_IMPLEMENTED:"NOT_IMPLEMENTED",NOT_CONFIGURED:"NOT_CONFIGURED",INTERNAL_ERROR:"INTERNAL_ERROR",SERVICE_UNAVAILABLE:"SERVICE_UNAVAILABLE",RATE_LIMIT_EXCEEDED:"RATE_LIMIT_EXCEEDED",DELETE_CONFIRMATION_REQUIRED:"DELETE_CONFIRMATION_REQUIRED",MISSING_HOST:"MISSING_HOST",MISSING_CONNECTIONS:"MISSING_CONNECTIONS",SECRET_NOT_CONFIGURED:"SECRET_NOT_CONFIGURED",UNAUTHORIZED:"UNAUTHORIZED",FORBIDDEN:"FORBIDDEN",INVALID_ACCESS_KEY:"INVALID_ACCESS_KEY",AUTO_KEY_CREATION_FAILED:"AUTO_KEY_CREATION_FAILED",PERSONA_NOT_FOUND:"PERSONA_NOT_FOUND",PERSONA_REVOKED:"PERSONA_REVOKED",PERSONA_SESSIONS_NOT_SUPPORTED:"PERSONA_SESSIONS_NOT_SUPPORTED",NOT_TEST_PERSONA_ENV:"NOT_TEST_PERSONA_ENV",PERSONA_AUTH_DISABLED_IN_PROD:"PERSONA_AUTH_DISABLED_IN_PROD",MAKER_TOKEN_NOT_FOUND:"MAKER_TOKEN_NOT_FOUND",MAKER_TOKEN_NOT_REVOKED:"MAKER_TOKEN_NOT_REVOKED",MAKER_TOKEN_NO_PRODUCT:"MAKER_TOKEN_NO_PRODUCT",MAKER_TOKEN_REVOKED:"MAKER_TOKEN_REVOKED",ORGANIZATION_NOT_FOUND:"ORGANIZATION_NOT_FOUND",ORG_HAS_ACTIVE_SUBSCRIPTIONS:"ORG_HAS_ACTIVE_SUBSCRIPTIONS",ORG_HAS_OUTSTANDING_BALANCE:"ORG_HAS_OUTSTANDING_BALANCE",PERSONAL_ORG_NOT_DELETABLE:"PERSONAL_ORG_NOT_DELETABLE",PERSONAL_OWNER_IMMUTABLE:"PERSONAL_OWNER_IMMUTABLE",PERSONAL_CO_OWNER_NOT_ALLOWED:"PERSONAL_CO_OWNER_NOT_ALLOWED",PRIMARY_OWNER_TRANSFER_REQUIRED:"PRIMARY_OWNER_TRANSFER_REQUIRED",MEMBER_NOT_FOUND:"MEMBER_NOT_FOUND",INVITATION_NOT_FOUND:"INVITATION_NOT_FOUND",RBAC_REQUIRES_TEAM_ORG:"RBAC_REQUIRES_TEAM_ORG",RBAC_NOT_ENABLED_BY_PRODUCT:"RBAC_NOT_ENABLED_BY_PRODUCT",UNKNOWN_PERMISSION:"UNKNOWN_PERMISSION",CUSTOMER_NOT_FOUND:"CUSTOMER_NOT_FOUND",PRODUCT_NOT_FOUND:"PRODUCT_NOT_FOUND",PRODUCT_DELETE_BLOCKED:"PRODUCT_DELETE_BLOCKED",PRODUCT_REPO_NOT_LINKED:"PRODUCT_REPO_NOT_LINKED",PRODUCT_SCOPE_MISMATCH:"PRODUCT_SCOPE_MISMATCH",YAML_PARSE_ERROR:"YAML_PARSE_ERROR",COMPILATION_NOT_FOUND:"COMPILATION_NOT_FOUND",PLAN_NOT_FOUND:"PLAN_NOT_FOUND",PLAN_HAS_ACTIVE_SUBSCRIPTIONS:"PLAN_HAS_ACTIVE_SUBSCRIPTIONS",PLAN_SLUG_CONFLICT:"PLAN_SLUG_CONFLICT",PLAN_REQUIRED:"PLAN_REQUIRED",PLAN_UPGRADE_REQUIRED:"PLAN_UPGRADE_REQUIRED",PLAN_OFFER_CHANGED:"PLAN_OFFER_CHANGED",SLUG_CONFLICT:"SLUG_CONFLICT",SLUG_BLOCKED:"SLUG_BLOCKED",SLUG_OFFENSIVE:"SLUG_OFFENSIVE",SLUG_RESERVED:"SLUG_RESERVED",SLUG_IMPERSONATION:"SLUG_IMPERSONATION",SLUG_INVALID_FORMAT:"SLUG_INVALID_FORMAT",SLUG_VALIDATOR_NOT_READY:"SLUG_VALIDATOR_NOT_READY",PRICING_PREVIEW_FAILED:"PRICING_PREVIEW_FAILED",PRICING_REPLAY_FAILED:"PRICING_REPLAY_FAILED",RESERVATION_NOT_FOUND:"RESERVATION_NOT_FOUND",PROMO_CODE_NOT_FOUND:"PROMO_CODE_NOT_FOUND",PROMO_CODE_INVALID:"PROMO_CODE_INVALID",BILLING_EVENT_NOT_FOUND:"BILLING_EVENT_NOT_FOUND",BILLING_NOT_CONFIGURED:"BILLING_NOT_CONFIGURED",SUBSCRIPTION_NOT_READY:"SUBSCRIPTION_NOT_READY",SUBSCRIPTION_FETCH_FAILED:"SUBSCRIPTION_FETCH_FAILED",INVALID_STATE:"INVALID_STATE",DUPLICATE_TRANSITION:"DUPLICATE_TRANSITION",ARCHIVED_TARGET:"ARCHIVED_TARGET",FREE_TO_PAID_VIA_CHECKOUT_ONLY:"FREE_TO_PAID_VIA_CHECKOUT_ONLY",RESOURCE_LIMIT_EXCEEDED:"RESOURCE_LIMIT_EXCEEDED",RESOURCE_LIMIT_CHECK_UNAVAILABLE:"RESOURCE_LIMIT_CHECK_UNAVAILABLE",STRIPE_NOT_CONFIGURED:"STRIPE_NOT_CONFIGURED",STRIPE_BALANCE_OUTSTANDING:"STRIPE_BALANCE_OUTSTANDING",STRIPE_OPERATION_FAILED:"STRIPE_OPERATION_FAILED",STRIPE_RESYNC_FAILED:"STRIPE_RESYNC_FAILED",CHECKOUT_SESSION_FAILED:"CHECKOUT_SESSION_FAILED",POLAR_PRODUCT_NOT_CONFIGURED:"POLAR_PRODUCT_NOT_CONFIGURED",BILLING_TAX_NOT_ENROLLED:"BILLING_TAX_NOT_ENROLLED",WEBHOOK_NOT_FOUND:"WEBHOOK_NOT_FOUND",WEBHOOK_DISPATCH_FAILED:"WEBHOOK_DISPATCH_FAILED",WEBHOOK_SECRET_NOT_CONFIGURED:"WEBHOOK_SECRET_NOT_CONFIGURED",INVALID_WEBHOOK_SIGNATURE:"INVALID_WEBHOOK_SIGNATURE",MISSING_RAW_BODY:"MISSING_RAW_BODY",WEBHOOK_REDIRECTED:"WEBHOOK_REDIRECTED",MANAGED_BY_CODE:"MANAGED_BY_CODE",GITHUB_CONNECTION_NOT_FOUND:"GITHUB_CONNECTION_NOT_FOUND",GITHUB_NOT_CONNECTED:"GITHUB_NOT_CONNECTED",GITHUB_SYNC_FAILED:"GITHUB_SYNC_FAILED",GITHUB_SYNC_UNAVAILABLE:"GITHUB_SYNC_UNAVAILABLE",GITHUB_TOKEN_FAILED:"GITHUB_TOKEN_FAILED",GIT_PROVIDER_NOT_CONFIGURED:"GIT_PROVIDER_NOT_CONFIGURED",ENVIRONMENT_NOT_FOUND:"ENVIRONMENT_NOT_FOUND",ENVIRONMENT_CLEANUP_FAILED:"ENVIRONMENT_CLEANUP_FAILED",DEPLOYMENT_RUN_NOT_FOUND:"DEPLOYMENT_RUN_NOT_FOUND",BRANCH_NO_MATCHING_ENV:"BRANCH_NO_MATCHING_ENV",APPLY_SPEC_FAILED:"APPLY_SPEC_FAILED",BOOTSTRAP_FAILED:"BOOTSTRAP_FAILED",JOB_ALREADY_RUNNING:"JOB_ALREADY_RUNNING",LOGO_DELETE_FAILED:"LOGO_DELETE_FAILED",LOGO_UPLOAD_FAILED:"LOGO_UPLOAD_FAILED",INVALID_LOGO_FORMAT:"INVALID_LOGO_FORMAT",CHANGE_SET_STALE:"CHANGE_SET_STALE",SIMULATION_STALE:"SIMULATION_STALE",IDEMPOTENCY_KEY_REUSED:"IDEMPOTENCY_KEY_REUSED",SELF_APPROVAL_FORBIDDEN:"SELF_APPROVAL_FORBIDDEN",HUMAN_APPROVAL_REQUIRED:"HUMAN_APPROVAL_REQUIRED",GOVERNED_BY_CHANGE_SET:"GOVERNED_BY_CHANGE_SET",COMPENSATION_REQUIRED:"COMPENSATION_REQUIRED",MIGRATION_TOO_LARGE:"MIGRATION_TOO_LARGE"};var b5={missing_token:Ne.UNAUTHORIZED,invalid_token:Ne.UNAUTHORIZED,context_unverified:Ne.UNAUTHORIZED,missing_signature:Ne.UNAUTHORIZED,malformed_signature:Ne.UNAUTHORIZED,unknown_key_id:Ne.UNAUTHORIZED,bad_signature:Ne.UNAUTHORIZED,expired_signature:Ne.UNAUTHORIZED,clock_skew:Ne.UNAUTHORIZED,replayed_nonce:Ne.UNAUTHORIZED,body_hash_mismatch:Ne.UNAUTHORIZED,route_mismatch:Ne.UNAUTHORIZED,environment_mismatch:Ne.UNAUTHORIZED,jwks_unavailable:Ne.SERVICE_UNAVAILABLE,body_too_large:Ne.VALIDATION_ERROR,member_subject_required:Ne.FORBIDDEN,service_subject_required:Ne.FORBIDDEN,surface_not_allowed:Ne.FORBIDDEN};var _5=Object.values(jw);var xe={BATCHER_ENUM:"batcher-enum",RUNTIME_INLINE:"runtime-inline",CONSTRAINT:"constraint",GATEWAY_ERROR:"gateway-error"};var dT={limit_allocator_unavailable:{statuses:[503],source:xe.BATCHER_ENUM,retryAfter:!0,verifiedAt:["engine/enforcement/runtime.ts:471"]},limit_exceeded:{statuses:[402],source:xe.BATCHER_ENUM,retryAfter:!0,verifiedAt:["engine/enforcement/batcher.ts:326","engine/enforcement/constraints/quota.ts:69"]},rate_limited:{statuses:[429],source:xe.BATCHER_ENUM,retryAfter:!0,verifiedAt:["engine/enforcement/batcher.ts:328","engine/enforcement/constraints/rate-limit.ts:74","engine/pipeline/rate-limit.ts:83"]},credit_exhausted:{statuses:[402],source:xe.BATCHER_ENUM,retryAfter:!0,verifiedAt:["engine/enforcement/batcher.ts:333"]},enforcement_denied:{statuses:[402],source:xe.BATCHER_ENUM,retryAfter:!0,verifiedAt:["engine/enforcement/batcher.ts:335"]},invalid_entitlement_shape:{statuses:[503],source:xe.RUNTIME_INLINE,retryAfter:!0,verifiedAt:["engine/enforcement/runtime.ts:144"]},unsupported_constraint_schema:{statuses:[503],source:xe.RUNTIME_INLINE,retryAfter:!1,verifiedAt:["engine/enforcement/runtime.ts:154"]},enforcement_error:{statuses:[500],source:xe.RUNTIME_INLINE,retryAfter:!1,verifiedAt:["engine/enforcement/runtime.ts:342"]},enforcement_dependency_unavailable:{statuses:[503],source:xe.RUNTIME_INLINE,retryAfter:!1,verifiedAt:["engine/enforcement/runtime.ts:427"]},concurrency_limit_exceeded:{statuses:[429],source:xe.CONSTRAINT,retryAfter:!0,verifiedAt:["engine/enforcement/constraints/concurrency.ts"]},concurrency_context_unavailable:{statuses:[503],source:xe.CONSTRAINT,retryAfter:!0,verifiedAt:["engine/enforcement/constraints/concurrency.ts:291"]},concurrency_coordinator_unavailable:{statuses:[503],source:xe.CONSTRAINT,retryAfter:!0,verifiedAt:["engine/enforcement/constraints/concurrency.ts:305"]},key_expired:{statuses:[401],source:xe.CONSTRAINT,retryAfter:!1,verifiedAt:["engine/enforcement/constraints/credential-validity.ts:33"]},permission_denied:{statuses:[403],source:xe.CONSTRAINT,retryAfter:!1,verifiedAt:["engine/enforcement/constraints/permission.ts:63"]},permission_unresolved:{statuses:[403],source:xe.CONSTRAINT,retryAfter:!1,verifiedAt:["engine/enforcement/constraints/permission.ts"]},route_not_enabled:{statuses:[403],source:xe.RUNTIME_INLINE,retryAfter:!1,verifiedAt:["engine/pipeline/pre-vec-costs.ts"]},geo_context_unavailable:{statuses:[503],source:xe.CONSTRAINT,retryAfter:!0,verifiedAt:["engine/enforcement/constraints/geo-restriction.ts:44"]},geo_blocked:{statuses:[403],source:xe.CONSTRAINT,retryAfter:!1,verifiedAt:["engine/enforcement/constraints/geo-restriction.ts:51"]},geo_not_allowed:{statuses:[403],source:xe.CONSTRAINT,retryAfter:!1,verifiedAt:["engine/enforcement/constraints/geo-restriction.ts:58"]},resource_count_limit_exceeded:{statuses:[402],source:xe.GATEWAY_ERROR,retryAfter:!1,verifiedAt:["apps/core:routes/internal/gateway-resources.ts:144"]},post_stream_overspend:{statuses:[402],source:xe.CONSTRAINT,retryAfter:!0,verifiedAt:["engine/enforcement/constraints/lifecycle-block.ts"]},request_too_large:{statuses:[413],source:xe.CONSTRAINT,retryAfter:!1,verifiedAt:["engine/enforcement/constraints/capacity.ts"]},resolver_rate_limited:{statuses:[503],source:xe.GATEWAY_ERROR,retryAfter:!0,verifiedAt:["engine/errors.ts:55"]},resolver_unavailable:{statuses:[503],source:xe.GATEWAY_ERROR,retryAfter:!0,verifiedAt:["engine/errors.ts:73"]},credential_resolver_miss_rate_limited:{statuses:[429],source:xe.GATEWAY_ERROR,retryAfter:!0,verifiedAt:["engine/errors.ts:89"]},provider_throttled:{statuses:[503],source:xe.GATEWAY_ERROR,retryAfter:!0,verifiedAt:["engine/pipeline/provider-adapter.ts"]}},WL=Object.keys(dT);var JL=new Set([429,503]),v5=new Set(WL.filter(t=>dT[t].statuses.every(e=>JL.has(e))));var YL=["quota","rate","concurrency","capacity","spend","adaptive"],x5=new Set(YL);var XL=[402,403,413,429],$5=new Set(XL);var QL=a.enum(["create","delete"]),e4=a.enum(["RESERVED","COMMITTED","RELEASED","DENIED"]),t4=a.object({mutationId:a.string().min(1).max(200),requestId:a.string().min(1).max(200),businessId:a.string().min(1).max(200),subscriptionId:a.string().min(1).max(200),compiledPlanId:a.string().min(1).max(200),actionId:a.string().min(1).max(160),environmentId:a.string().min(1).max(200).nullable(),subjectId:a.string().min(1).max(200).optional()}).strict();var U5=t4.extend({statusCode:a.number().int().min(100).max(599)}).strict(),M5=a.object({mutationId:a.string().min(1).max(200),resource:a.string().min(1).max(120),effect:QL,state:e4,count:a.number().int().nonnegative(),limit:a.number().int().nonnegative().nullable(),replayed:a.boolean()}).strict(),L5=a.object({error:a.object({code:a.literal("resource_count_limit_exceeded"),message:a.string(),limitCode:a.string(),dimension:a.string(),currentCapacity:a.number().int().nonnegative()}).strict()}).strict();var Dd=a.string().min(1).max(128).regex(/^[A-Za-z0-9._:-]+$/),pT=a.object({businessId:Dd,environmentId:Dd.nullable(),secretName:a.string().min(1).max(128).regex(/^[A-Z][A-Z0-9_]*$/)}).strict();var z_=a.object({scope:pT,mutationId:Dd,expectedGeneration:a.number().int().positive().nullable()}),n4=z_.extend({mutation:a.literal("publish"),generation:a.number().int().positive(),payloadHash:a.string().regex(/^[a-f0-9]{64}$/),sealedPayload:a.string().min(1).max(131072)}).strict(),r4=z_.extend({mutation:a.literal("rotate"),generation:a.number().int().positive(),payloadHash:a.string().regex(/^[a-f0-9]{64}$/),sealedPayload:a.string().min(1).max(131072)}).strict(),i4=z_.extend({mutation:a.enum(["revoke","delete"]),generation:a.number().int().positive(),payloadHash:a.string().regex(/^[a-f0-9]{64}$/)}).strict(),o4=a.discriminatedUnion("mutation",[n4,r4,i4]),B5=a.object({keyId:Dd,signature:a.string().regex(/^[a-f0-9]{64}$/),command:o4}).strict(),q5=a.discriminatedUnion("available",[a.object({available:a.literal(!0),scope:pT,generation:a.number().int().positive(),payloadHash:a.string().regex(/^[a-f0-9]{64}$/),sealedPayload:a.string().min(1).max(131072),status:a.literal("ACTIVE")}).strict(),a.object({available:a.literal(!1),generation:a.number().int().positive().nullable(),payloadHash:a.string().regex(/^[a-f0-9]{64}$/).nullable(),status:a.enum(["MISSING","PENDING","REVOKING","REVOKED","DELETED"])}).strict()]);import{existsSync as j_,mkdirSync as s4,readFileSync as gT,writeFileSync as c8}from"node:fs";import{homedir as a4}from"node:os";import{join as U_}from"node:path";var mT="https://core.farthershore.com";var M_=U_(a4(),".farthershore"),fT=U_(M_,"config.json"),hT=U_(M_,"credentials.json");function c4(t){j_(t)||s4(t,{recursive:!0,mode:448})}var D_={apiUrl:mT};function bT(){if(c4(M_),!j_(fT))return D_;try{let t=JSON.parse(gT(fT,"utf-8"));return{...D_,...t}}catch{return D_}}function _T(){if(!j_(hT))return null;try{return JSON.parse(gT(hT,"utf-8"))}catch{return null}}var N=class extends Error{constructor(n,i,r){super(n);this.status=i;this.name="CliError",this.code=r?.code,this.details=r?.details,this.param=r?.param}status;code;details;param};function yT(t){if(t)return t;let e=process.env.FARTHERSHORE_TOKEN;if(e)return e;let n=_T();if(n?.token)return n.token;throw new N("Not authenticated. Run `farthershore auth login` or set FARTHERSHORE_TOKEN environment variable.")}var Hi="x-fs-surface",Ki="cli",u4="management";function ft(t,e){let n=new URLSearchParams;for(let[r,o]of Object.entries(e))o&&n.set(r,o);let i=n.toString();return i?`${t}?${i}`:t}function vT(t){let e=t.includes("?")?"&":"?";return`${t}${e}dry_run=true`}var l4=new Set([429,500,502,503,504]),d4=3,p4=3e4,kT=200,m4=4e3,f4=t=>new Promise(e=>setTimeout(e,t));function xT(t,e){if(e){let i=Number(e);if(Number.isFinite(i)&&i>=0)return Math.min(i*1e3,1e4)}return Math.min(kT*2**(t-1),m4)+Math.floor(Math.random()*kT)}function ST(t,e){let n=t.toUpperCase();return n==="GET"||n==="HEAD"?!0:"Idempotency-Key"in e}function $T(t){let e=t.retry?.attempts??d4,n=t.retry?.sleep??f4;async function i(l,p,m){let f=m?e:1,h;for(let y=1;y<=f;y++){let v=new AbortController,E=setTimeout(()=>v.abort(),p4);try{let C=await fetch(l,{...p,signal:v.signal});if(m&&y<f&&l4.has(C.status)){let z=C.headers?.get?.("retry-after")??null;await n(xT(y,z));continue}return C}catch(C){if(h=C,m&&y<f){await n(xT(y,null));continue}throw C}finally{clearTimeout(E)}}throw h}let r=null;async function o(){let l=await fetch(`${t.apiUrl}/auth/cli/exchange`,{method:"POST",headers:{Authorization:`Bearer ${t.token}`,"Content-Type":"application/json",[Hi]:Ki}});if(!l.ok){let m=(await l.json().catch(()=>null))?.error,f=typeof m=="string"?{message:m}:m;throw new N(f?.message??l.statusText,l.status,{code:f?.code,details:f?.details})}return r=await l.json(),r}function s(l){return l.split("/",3)[1]===u4}async function c(l){if(!t.token.startsWith("mk_")||s(l))return t.token;let p=r?Date.parse(r.expiresAt):0;return(!r||p-Date.now()<6e4)&&await o(),r.accessToken}async function u(l,p,m,f){let h=await c(p),y=f?.dryRun?vT(p):p,v={Authorization:`Bearer ${h}`,"Content-Type":"application/json",[Hi]:Ki};f?.idempotencyKey&&(v["Idempotency-Key"]=f.idempotencyKey);let E=await i(`${t.apiUrl}${y}`,{method:l,headers:v,body:m?JSON.stringify(m):void 0},f?.retryOnTransient===!1?!1:ST(l,v));if(!E.ok){let z=(await E.json().catch(()=>null))?.error,j=typeof z=="string"?{message:z}:z;throw new N(j?.message??E.statusText,E.status,{code:j?.code,details:j?.details})}if(E.status!==204)return E.json()}async function d(l,p,m,f,h){let y=await c(p),v=h?.dryRun?vT(p):p,E={Authorization:`Bearer ${y}`,"Content-Type":f,[Hi]:Ki};h?.idempotencyKey&&(E["Idempotency-Key"]=h.idempotencyKey);let C=await i(`${t.apiUrl}${v}`,{method:l,headers:E,body:m},h?.retryOnTransient===!1?!1:ST(l,E));if(!C.ok){let j=(await C.json().catch(()=>null))?.error,D=typeof j=="string"?{message:j}:j;throw new N(D?.message??C.statusText,C.status,{code:D?.code,details:D?.details})}if(C.status!==204)return C.json()}return{exchangeCliToken:o,authWhoami:async()=>{if(t.token.startsWith("mk_")){let p=await u("GET","/management/whoami");return{kind:"maker",tokenId:p.tokenId,organizationId:p.organizationId,businessId:p.businessId,scopes:p.scopes}}return{kind:"builder",...await u("POST","/builder/context/bootstrap")}},bootstrap:()=>u("POST","/builder/context/bootstrap"),listBusinesses:()=>u("GET","/businesses"),initBusiness:(l,p)=>u("POST","/businesses/init",l,p),updateBusiness:(l,p,m,f)=>u("PATCH",ft(`/businesses/${l}`,{env:m?.env}),p,f),uploadBrandAsset:(l,p,m,f,h)=>d("PUT",`/businesses/${l}/${p}`,m,f,h),deleteBrandAsset:(l,p,m)=>u("DELETE",`/businesses/${l}/${p}`,void 0,m),publishBusiness:(l,p,m)=>u("POST",`/businesses/${l}/publish`,p&&Object.keys(p).length>0?p:void 0,m),migratePlan:(l,p,m,f)=>u("POST",`/businesses/${l}/plans/${encodeURIComponent(p)}/migration-batches`,m,f),getBusiness:(l,p)=>u("GET",ft(`/businesses/${l}`,{env:p?.env})),getDeployments:l=>u("GET",`/businesses/${l}/deployments`),listApplyTimeline:(l,p)=>u("GET",ft(`/businesses/${l}/apply-timeline`,{env:p?.env})),proposeConsumerChangeSet:(l,p,m,f,h)=>u("POST",ft(`/businesses/${l}/consumers/${encodeURIComponent(p)}/change-sets`,{env:f?.env}),m,h),listConsumerChangeSets:(l,p,m)=>u("GET",ft(`/businesses/${l}/consumers/${encodeURIComponent(p)}/change-sets`,{env:m?.env,status:m?.status,cursor:m?.cursor,limit:m?.limit!==void 0?String(m.limit):void 0})),getConsumerChangeSet:(l,p,m,f)=>u("GET",ft(`/businesses/${l}/consumers/${encodeURIComponent(p)}/change-sets/${encodeURIComponent(m)}`,{env:f?.env})),previewConsumerChangeSet:(l,p,m,f)=>u("POST",ft(`/businesses/${l}/consumers/${encodeURIComponent(p)}/change-sets/${encodeURIComponent(m)}/preview`,{env:f?.env})),compileManifest:(l,p,m)=>u("POST",`/businesses/${l}/manifest/compile`,{ir:p,...m?.env?{env:m.env}:{}}),listEnvironments:l=>u("GET",`/businesses/${l}/environments`),createEnvironment:(l,p,m)=>u("POST",`/businesses/${l}/environments`,p,m),deleteEnvironment:(l,p)=>u("DELETE",`/businesses/${l}/environments/${encodeURIComponent(p)}`),deleteBusiness:(l,p)=>u("DELETE",`/businesses/${l}`,p?.deleteGitHubRepo?{deleteGitHubRepo:!0}:void 0),builderListConsumers:(l,p)=>u("GET",ft(`/businesses/${l}/consumers`,{env:p?.env})),builderBlockConsumer:(l,p)=>u("POST",`/businesses/${l}/consumers/${encodeURIComponent(p)}/block`),builderRemoveConsumer:(l,p)=>u("POST",`/businesses/${l}/consumers/${encodeURIComponent(p)}/remove`),builderAssignConsumerMemberRoles:(l,p,m,f)=>u("POST",`/businesses/${l}/consumers/${encodeURIComponent(p)}/members/${encodeURIComponent(m)}/roles`,{roles:f}),listPromoCodes:l=>u("GET",`/businesses/${l}/promo-codes`),createPromoCode:(l,p)=>u("POST",`/businesses/${l}/promo-codes`,p),updatePromoCode:(l,p,m)=>u("PATCH",`/businesses/${l}/promo-codes/${p}`,m),managementListPlans:l=>u("GET",`/management/businesses/${l}/plans`),managementGetUsage:l=>u("GET",`/management/businesses/${l}/usage`),managementListMakerTokens:()=>u("GET","/maker-tokens"),managementCreateMakerToken:(l,p)=>u("POST","/maker-tokens",l,p),managementRevokeMakerToken:l=>u("DELETE",`/maker-tokens/${l}`),managementRotateMakerToken:(l,p,m)=>u("POST",`/maker-tokens/${l}/rotate`,p,m),managementHardDeleteMakerToken:l=>u("DELETE",`/maker-tokens/${l}/hard`),managementListWebhooks:(l,p)=>u("GET",ft(`/management/businesses/${l}/webhooks`,{limit:p?.limit})),managementCreateWebhook:(l,p,m)=>u("POST",`/management/businesses/${l}/webhooks`,p,m),managementUpdateWebhook:(l,p,m,f)=>u("PATCH",`/management/businesses/${l}/webhooks/${p}`,m,f),managementDeleteWebhook:(l,p)=>u("DELETE",`/management/businesses/${l}/webhooks/${p}`),managementTestWebhook:(l,p)=>u("POST",`/management/businesses/${l}/webhooks/${p}/test`),managementListWebhookDeliveries:(l,p,m)=>u("GET",ft(`/management/businesses/${l}/webhooks/${p}/deliveries`,{limit:m?.limit})),builderListBackends:l=>u("GET",`/businesses/${l}/backends`),builderCreateBackend:(l,p,m)=>u("POST",`/businesses/${l}/backends`,p,m),builderBindBackend:(l,p,m,f)=>u("PATCH",`/businesses/${l}/backends/${encodeURIComponent(p)}`,m,f),builderDeleteBackend:(l,p)=>u("DELETE",`/businesses/${l}/backends/${p}`),builderListRuntimeTokens:l=>u("GET",`/businesses/${l}/runtime-tokens`),builderCreateRuntimeToken:(l,p,m)=>u("POST",`/businesses/${l}/runtime-tokens`,p,m),builderRotateRuntimeToken:(l,p,m)=>u("POST",`/businesses/${l}/runtime-tokens/${p}/rotate`,void 0,m),builderRevokeRuntimeToken:(l,p)=>u("DELETE",`/businesses/${l}/runtime-tokens/${p}`),builderFrontendDeploy:(l,p,m)=>u("POST",`/businesses/${l}/frontend/deploy`,p,m),builderFrontendStatus:(l,p)=>u("GET",`/businesses/${l}/frontend/status${p?`?environmentId=${encodeURIComponent(p)}`:""}`),builderFrontendReleases:(l,p)=>u("GET",`/businesses/${l}/frontend/releases${p?`?environmentId=${encodeURIComponent(p)}`:""}`),builderFrontendRollback:(l,p,m)=>u("POST",`/businesses/${l}/frontend/rollback`,p,m),builderListBulletin:(l,p)=>u("GET",ft(`/businesses/${l}/bulletin`,{kind:p?.kind,status:p?.status,cursor:p?.cursor,limit:p?.limit})),builderGetBulletinPost:(l,p)=>u("GET",`/businesses/${l}/bulletin/${encodeURIComponent(p)}`),builderSetBulletinStatus:(l,p,m)=>u("PATCH",`/businesses/${l}/bulletin/${encodeURIComponent(p)}`,{status:m}),builderListAgents:l=>u("GET",`/businesses/${l}/agents`),builderAgentStatus:(l,p)=>u("GET",`/businesses/${l}/agents/${encodeURIComponent(p)}`),builderAgentRunDetail:(l,p,m)=>u("GET",`/businesses/${l}/agents/${encodeURIComponent(p)}/runs/${encodeURIComponent(m)}`),builderConfigureAgent:(l,p,m,f)=>u("PUT",`/businesses/${l}/agents/${encodeURIComponent(p)}`,m,f),builderBusinessVariables:async(l,p)=>(await u("GET",ft(`/businesses/${l}/variables`,{environmentId:p}))).variables,builderSetBusinessVariable:async(l,p,m,f)=>(await u("PUT",`/businesses/${l}/variables/${encodeURIComponent(p)}`,m,f)).operation,builderRevokeBusinessVariable:async(l,p,m,f)=>(await u("POST",`/businesses/${l}/variables/${encodeURIComponent(p)}/revoke`,{environmentId:m,confirmation:"REVOKE"},f)).operation,builderDeleteBusinessVariable:async(l,p,m,f)=>(await u("DELETE",`/businesses/${l}/variables/${encodeURIComponent(p)}`,{environmentId:m,confirmation:"DELETE"},f)).operation,builderGetBusinessVariableOperation:async(l,p)=>(await u("GET",`/businesses/${l}/variables/operations/${encodeURIComponent(p)}`)).operation,builderGitHubStatus:()=>u("GET","/builder/git/github/status"),businessStripeStatus:l=>u("GET",`/businesses/${l}/stripe/status`),issuePersonaBootstrapKey:async(l,p,m)=>{let f=await fetch(`${t.apiUrl}/portal/businesses/${l}/environments/${p}/test/bootstrap-key`,{method:"POST",headers:{Authorization:`Bearer ${t.token}`,"Content-Type":"application/json",[Hi]:Ki},body:JSON.stringify(m??{})});if(!f.ok){let y=(await f.json().catch(()=>null))?.error,v=typeof y=="string"?{message:y}:y;throw new N(v?.message??f.statusText,f.status,{code:v?.code,details:v?.details})}return f.json()},listPersonas:async(l,p)=>{let m=await fetch(`${t.apiUrl}/portal/businesses/${l}/environments/${p}/test/personas`,{method:"GET",headers:{Authorization:`Bearer ${t.token}`,[Hi]:Ki}});if(!m.ok){let h=(await m.json().catch(()=>null))?.error,y=typeof h=="string"?{message:h}:h;throw new N(y?.message??m.statusText,m.status,{code:y?.code,details:y?.details})}return m.json()},revokePersona:async(l,p,m)=>{let f=await fetch(`${t.apiUrl}/portal/businesses/${l}/environments/${p}/test/personas/${m}`,{method:"DELETE",headers:{Authorization:`Bearer ${t.token}`,[Hi]:Ki}});if(!f.ok){let y=(await f.json().catch(()=>null))?.error,v=typeof y=="string"?{message:y}:y;throw new N(v?.message??f.statusText,f.status,{code:v?.code,details:v?.details})}return f.json()},getBusinessConfig:(l,p)=>u("GET",ft(`/businesses/${l}/config`,{format:"json",env:p?.env,state:p?.state})),updateBusinessConfigDraft:(l,p,m)=>u("PATCH",`/businesses/${l}/config/draft`,{spec:p,env:m?.env,branch:m?.branch,source:m?.source,baseDraftHash:m?.baseDraftHash})}}var IT=(t=0)=>e=>`\x1B[${e+t}m`,wT=(t=0)=>e=>`\x1B[${38+t};5;${e}m`,ET=(t=0)=>(e,n,i)=>`\x1B[${38+t};2;${e};${n};${i}m`,we={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},y8=Object.keys(we.modifier),h4=Object.keys(we.color),g4=Object.keys(we.bgColor),v8=[...h4,...g4];function b4(){let t=new Map;for(let[e,n]of Object.entries(we)){for(let[i,r]of Object.entries(n))we[i]={open:`\x1B[${r[0]}m`,close:`\x1B[${r[1]}m`},n[i]=we[i],t.set(r[0],r[1]);Object.defineProperty(we,e,{value:n,enumerable:!1})}return Object.defineProperty(we,"codes",{value:t,enumerable:!1}),we.color.close="\x1B[39m",we.bgColor.close="\x1B[49m",we.color.ansi=IT(),we.color.ansi256=wT(),we.color.ansi16m=ET(),we.bgColor.ansi=IT(10),we.bgColor.ansi256=wT(10),we.bgColor.ansi16m=ET(10),Object.defineProperties(we,{rgbToAnsi256:{value(e,n,i){return e===n&&n===i?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(n/255*5)+Math.round(i/255*5)},enumerable:!1},hexToRgb:{value(e){let n=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!n)return[0,0,0];let[i]=n;i.length===3&&(i=[...i].map(o=>o+o).join(""));let r=Number.parseInt(i,16);return[r>>16&255,r>>8&255,r&255]},enumerable:!1},hexToAnsi256:{value:e=>we.rgbToAnsi256(...we.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return 90+(e-8);let n,i,r;if(e>=232)n=((e-232)*10+8)/255,i=n,r=n;else{e-=16;let c=e%36;n=Math.floor(e/36)/5,i=Math.floor(c/6)/5,r=c%6/5}let o=Math.max(n,i,r)*2;if(o===0)return 30;let s=30+(Math.round(r)<<2|Math.round(i)<<1|Math.round(n));return o===2&&(s+=60),s},enumerable:!1},rgbToAnsi:{value:(e,n,i)=>we.ansi256ToAnsi(we.rgbToAnsi256(e,n,i)),enumerable:!1},hexToAnsi:{value:e=>we.ansi256ToAnsi(we.hexToAnsi256(e)),enumerable:!1}}),we}var _4=b4(),Mt=_4;import L_ from"node:process";import y4 from"node:os";import TT from"node:tty";function It(t,e=globalThis.Deno?globalThis.Deno.args:L_.argv){let n=t.startsWith("-")?"":t.length===1?"-":"--",i=e.indexOf(n+t),r=e.indexOf("--");return i!==-1&&(r===-1||i<r)}var{env:Ee}=L_,jd;It("no-color")||It("no-colors")||It("color=false")||It("color=never")?jd=0:(It("color")||It("colors")||It("color=true")||It("color=always"))&&(jd=1);function v4(){if("FORCE_COLOR"in Ee)return Ee.FORCE_COLOR==="true"?1:Ee.FORCE_COLOR==="false"?0:Ee.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(Ee.FORCE_COLOR,10),3)}function k4(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function x4(t,{streamIsTTY:e,sniffFlags:n=!0}={}){let i=v4();i!==void 0&&(jd=i);let r=n?jd:i;if(r===0)return 0;if(n){if(It("color=16m")||It("color=full")||It("color=truecolor"))return 3;if(It("color=256"))return 2}if("TF_BUILD"in Ee&&"AGENT_NAME"in Ee)return 1;if(t&&!e&&r===void 0)return 0;let o=r||0;if(Ee.TERM==="dumb")return o;if(L_.platform==="win32"){let s=y4.release().split(".");return Number(s[0])>=10&&Number(s[2])>=10586?Number(s[2])>=14931?3:2:1}if("CI"in Ee)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(s=>s in Ee)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(s=>s in Ee)||Ee.CI_NAME==="codeship"?1:o;if("TEAMCITY_VERSION"in Ee)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Ee.TEAMCITY_VERSION)?1:0;if(Ee.COLORTERM==="truecolor"||Ee.TERM==="xterm-kitty"||Ee.TERM==="xterm-ghostty"||Ee.TERM==="wezterm")return 3;if("TERM_PROGRAM"in Ee){let s=Number.parseInt((Ee.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Ee.TERM_PROGRAM){case"iTerm.app":return s>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Ee.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Ee.TERM)||"COLORTERM"in Ee?1:o}function RT(t,e={}){let n=x4(t,{streamIsTTY:t&&t.isTTY,...e});return k4(n)}var S4={stdout:RT({isTTY:TT.isatty(1)}),stderr:RT({isTTY:TT.isatty(2)})},OT=S4;function PT(t,e,n){let i=t.indexOf(e);if(i===-1)return t;let r=e.length,o=0,s="";do s+=t.slice(o,i)+e+n,o=i+r,i=t.indexOf(e,o);while(i!==-1);return s+=t.slice(o),s}function AT(t,e,n,i){let r=0,o="";do{let s=t[i-1]==="\r";o+=t.slice(r,s?i-1:i)+e+(s?`\r
|
|
81
81
|
`:`
|
|
82
|
-
`)+n,r=
|
|
83
|
-
`,r)}while(
|
|
84
|
-
`);return i!==-1&&(e=UT(e,r,o,i)),o+e+r};Object.defineProperties(ps.prototype,Yo);var k4=ps(),w8=ps({level:MT?MT.level:0});var My=k4;var x4;function Vd(){return x4??S4(void 0)}function FT(){return Vd()==="json"}function VT(t){FT()||console.log(My.dim(t))}function qT(t){FT()||console.log(My.bold(t))}function Zy(){return process.stdout.isTTY===!0}function S4(t){if(t==="json"||t==="table")return t;if(t!==void 0)throw new O(`Unsupported --format "${t}". Use "json" or "table".`,400,{code:"INVALID_OUTPUT_FORMAT",param:"format"});return Zy()?"table":"json"}var $4={MANAGED_BY_CODE:"This business's contract is managed as code. Edit the Business SDK program in its GitHub repo (business/) and push \u2014 do NOT retry the API. (Branding stays editable via `farthershore business update`.)",UNAUTHORIZED:"Token is invalid or revoked. Run `farthershore auth login` to update it.",FORBIDDEN:"Your token doesn't have access to this resource. Check the org / product scope.",INVALID_ACCESS_KEY:"Token format is wrong. Generate a new one at https://farthershore.com/settings/tokens.",MAKER_TOKEN_REVOKED:"This maker token was revoked. Mint a new one in the product settings.",MAKER_TOKEN_NO_PRODUCT:"Maker token is not bound to a product. Re-create it from the product page.",AUTH_NO_TOKEN:"Pass --token <mk_...> or set FARTHERSHORE_TOKEN, or run interactively in a TTY.",AUTH_INVALID_TOKEN:"Token format is malformed. Maker tokens start with `mk_` and are 30+ characters.",DESTRUCTIVE_OP_REQUIRES_YES:"Destructive ops (delete) require an explicit `--yes` to proceed. This is intentional safety.",PRODUCT_UPDATE_NO_FIELDS:"Pass at least one field flag (--display-name, --origin, --description).",PLAN_UPDATE_NO_FIELDS:"Pass at least one of --name, --recurring-fee-cents, --grant, --trial-days, --max-monthly-spend-cents, or --meter.",ENV_NOT_FOUND:"Environment doesn't exist. Use `farthershore env list <product>` to see available envs, or create one with `farthershore env create`.",STRIPE_NOT_CONFIGURED:"Stripe isn't connected on this product. Connect it in the dashboard before running billing operations.",STRIPE_NOT_CONNECTED:"Publishing requires a connected Stripe account. Connect one on the dashboard Connections page, then re-run `farthershore business publish`.",STRIPE_NOT_VERIFIED:"Your Stripe account isn't fully verified yet. Finish Stripe onboarding, then re-run `farthershore business publish`.",BILLING_TAX_NOT_ENROLLED:"Stripe Tax isn't enrolled for this account. Enable it from the dashboard Connections page, then re-run `farthershore business publish`.",STRIPE_BALANCE_OUTSTANDING:"Customer has an outstanding balance. Resolve the invoice in Stripe before retrying.",CHECKOUT_SESSION_FAILED:"Stripe rejected the checkout request. Check that the plan exists and Stripe credentials are valid.",PRODUCT_NOT_FOUND:"Check the business slug. Run `farthershore` (no args) for a list of businesses you can see.",PRODUCT_REPO_NOT_LINKED:"Link a GitHub repo to this business before publishing or validating business manifests.",YAML_PARSE_ERROR:"Business manifest is not valid. Run `farthershore build` locally, fix business/ source, then push again for bot validation.",GITHUB_NOT_CONNECTED:"Connect GitHub on the org page before running `init` (it provisions the repo).",BRANCH_NO_MATCHING_ENV:"The current branch isn't mapped to an environment. Add a branch rule in business settings or pass --branch explicitly.",PLAN_NOT_FOUND:"Plan key doesn't exist on this business. Check the `plans` block in your local business manifest.",PLAN_HAS_ACTIVE_SUBSCRIPTIONS:"Plan has active subscribers and can't be deleted. Migrate them to another plan first.",PLAN_SLUG_CONFLICT:"Another plan already uses this key. Pick a unique plan key in your manifest.",SLUG_CONFLICT:"This business slug is taken. Pick a different name.",SLUG_BLOCKED:"This slug is reserved or blocked. Pick a different name.",SLUG_RESERVED:"This slug is reserved by Farther Shore. Pick a different name.",SLUG_INVALID_FORMAT:"Slug must be lowercase letters, digits, and hyphens (no leading/trailing hyphen).",DECISION_NOT_FOUND:"No DenialEvent recorded for that decisionId. Verify the id from the original deny response or audit log.",AUTH_UNAUTHORIZED:"Token is missing, expired, or lacks the audit:read scope required to read denial events.",RATE_LIMIT_EXCEEDED:"You've hit the rate limit. Wait a moment and retry.",VALIDATION_ERROR:"Request is malformed. The `details` field has the field-level errors.",CONFLICT:"The resource is in a state that conflicts with the request. Inspect `details` to learn more."};function BT(t){if(t)return $4[t]}function KT(t,e){return{schema_version:1,ok:!0,op:t,data:e}}function GT(t,e){let n=e.status??0;return{schema_version:1,ok:!1,op:t,error:{code:e.code??"INTERNAL_ERROR",message:e.message,status:n,param:e.param,retryable:w4(n,e.code),details:e.details,hint:BT(e.code)}}}var I4=new Set(["RATE_LIMIT_EXCEEDED","SERVICE_UNAVAILABLE"]);function w4(t,e){return t>=500||t===429||t===503?!0:e?I4.has(e):!1}var E4=/^(mk_[^.\s]+\.[^\s]+|fsrt_(test|live)_[^\s]+|fsk_[A-Za-z0-9_-]{8,}|sk_(test|live)_[A-Za-z0-9_-]{8,}|eyJ[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+)$/,T4=/^(secret|clientSecret|privateKey|password|plaintext|connectorToken|tunnelToken|accessToken|refreshToken|tokenHash)$/i;function WT(t){return t.length<=8?"***redacted***":`${t.slice(0,4)}\u2026${t.slice(-4)}`}function qd(t){if(typeof t=="string")return E4.test(t)?WT(t):t;if(Array.isArray(t))return t.map(e=>qd(e));if(t&&typeof t=="object"){let e={};for(let[n,o]of Object.entries(t))T4.test(n)&&typeof o=="string"?e[n]=WT(o):e[n]=qd(o);return e}return t}import{createInterface as P4}from"node:readline";import{readFile as O4}from"node:fs/promises";import{setTimeout as R4}from"node:timers/promises";import{extname as A4}from"node:path";var He={idempotencyKey:s.string().optional().describe("A UUID you generate; REUSE the same value when retrying so the retry replays the first result instead of double-provisioning.")};function JT(t){let e=t?.trim().toLowerCase();return e?e.split(".")[0]??null:null}async function ve(t,e){if(e){if(e.length===36)return e;let n=e.trim().toLowerCase(),r=(await t.listProducts()).find(i=>i.id===e||i.name.toLowerCase()===n||i.runtimeHostname?.toLowerCase()===n||i.portalHostname?.toLowerCase()===n||JT(i.runtimeHostname)===n||JT(i.portalHostname)===n);if(r)return r.id;throw new O(`Business "${e}" not found`,404,{code:"NOT_FOUND"})}throw new Error("No business selected. Pass a business id or slug, or run `farthershore business create` first.")}async function _n(t,e,n){let r=await t.listEnvironments(e),a=(Array.isArray(r.data)?r.data:Array.isArray(r.environments)?r.environments:[]).find(c=>c.name.toLowerCase()===n.toLowerCase()||c.id===n);if(!a)throw new Error(`Environment "${n}" not found on product ${e}.`);return a.id}var Bd=["frontend","api","docs","widget","dashboard","webhook","worker","agent"];function YT(t){let e=t.trim().toLowerCase();if(!Bd.includes(e))throw new O(`Unknown business surface "${t}". Available: ${Bd.join(", ")}.`,void 0,{code:"UNKNOWN_BUSINESS_SURFACE"});return e}function Vy(t){let e=(t.surface??[]).map(YT);if(e.length===0)return;if(new Set(e).size!==e.length)throw new O("Duplicate business surfaces in --surface flags.",void 0,{code:"INVALID_BUSINESS_SURFACES"});return e}function XT(t){let e={};return typeof t.bump=="string"&&(e.bump=t.bump),typeof t.version=="string"&&(e.version=t.version),t.acceptBreaking===!0&&(e.acceptBreaking=!0),e}async function C4(t){let e=P4({input:process.stdin,output:process.stderr,terminal:!0});return new Promise(n=>{e.question(`Cut release ${t}? [y/N] `,o=>{e.close(),n(/^y(es)?$/i.test(o.trim()))})})}function N4(t){return t.split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function z4(t){let[e="",n,o]=t.split(":");if(!/^[a-z0-9_]+$/.test(e))throw new O(`Invalid meter key in "--meter ${t}" \u2014 keys are lowercase letters, digits, and underscores (e.g. input_tokens).`,void 0,{code:"INVALID_METER_SPEC"});return{key:e,display:n?.trim()||N4(e),unit:o?.trim()||void 0}}function D4(t){let e=t.meter??[];if(e.length>0&&t.meters)throw new O("Pass either --meters <template> or repeated --meter entries, not both.",void 0,{code:"CONFLICTING_METER_FLAGS"});if(e.length>0){let n=e.map(z4);if(new Set(n.map(r=>r.key)).size!==n.length)throw new O("Duplicate meter keys in --meter flags.",void 0,{code:"INVALID_METER_SPEC"});return n}if(t.meters){let n=Ew(t.meters);if(!n)throw new O(`Unknown meter template "${t.meters}". Available: ${Tw().join(", ")}.`,void 0,{code:"UNKNOWN_METER_TEMPLATE"});return n.meters.map(o=>({...o}))}}var lr="<businessIdOrName>",j4={BRANCH_PREFIX:"branch-prefix",PULL_REQUEST:"pull-request",DISABLED:"disabled"},U4=Object.fromEntries(ay.map(t=>[j4[t],t])),L4=/^.{1,50}$/,M4={".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".webp":"image/webp"};function QT(t){return[sy(t,"GET"),sy(t,"*")]}function Z4(t){return!t||Object.keys(t).length===0?[{feature:"all",permissions:QT("all")}]:Object.entries(t).filter(([,e])=>Array.isArray(e?.routes)&&e.routes.length>0).map(([e,n])=>({feature:e,...n?.description?{title:n.description}:{},permissions:QT(e)})).sort((e,n)=>e.feature.localeCompare(n.feature))}function F4(t){return t===void 0||t===!1?{enabled:!1,capability:null}:t===!0?{enabled:!0,capability:null}:{enabled:!0,capability:t.capability}}function V4(t){let{product:e,...n}=t;return{...n,business:e}}function q4(t){let e=M4[A4(t).toLowerCase()];if(!e)throw new O(`Cannot infer image Content-Type for "${t}". Use a .png, .jpg, .jpeg, or .webp file.`,void 0,{code:"UNSUPPORTED_BRAND_ASSET_TYPE"});return e}function B4(t){return t.filter(e=>e!==void 0&&e!==!1).length}function e0(t,e){let n=e==="icon"?"icon":"logo",o=e==="icon"?"icon":"logo",r=e==="icon"?"clearIcon":"clearLogo";if(B4([t[`${o}Url`],t[`${o}File`],t[r]])>1)throw new O(`Choose only one ${n} operation: --${o}-url, --${o}-file, or --clear-${o}.`,void 0,{code:"CONFLICTING_BRAND_ASSET_FLAGS"})}function H4(t){let e=U4[t];if(!e)throw new O(`Invalid preview environment trigger "${t}". Use branch-prefix, pull-request, or disabled.`,void 0,{code:"INVALID_PREVIEW_ENV_TRIGGER"});return e}function K4(t){let e={};if(typeof t.trigger=="string"&&(e.previewEnvTrigger=H4(t.trigger)),t.clearBranchPrefix===!0)e.envBranchPrefix=null;else if(typeof t.branchPrefix=="string"){if(!L4.test(t.branchPrefix))throw new O("--branch-prefix must be 1-50 characters.",void 0,{code:"INVALID_ENV_BRANCH_PREFIX"});e.envBranchPrefix=t.branchPrefix}if(e.previewEnvTrigger===void 0&&e.envBranchPrefix===void 0)throw new O("Pass at least one preview environment setting: --trigger, --branch-prefix, or --clear-branch-prefix.",void 0,{code:"MISSING_PREVIEW_ENV_UPDATE"});return e}async function t0(t,e,n,o){let r=await O4(o);return t.uploadBrandAsset(e,n,r,q4(o))}function G4(t){if(t instanceof O||!(t instanceof Error))return!1;let e=t.cause,n=e&&typeof e=="object"&&"code"in e?String(e.code):"",o=`${t.name} ${t.message} ${n}`.toLowerCase();return o.includes("abort")||o.includes("timeout")||o.includes("econnreset")||o.includes("socket hang up")||o.includes("fetch failed")||o.includes("network")}async function W4(t,e){return(await t.listProducts()).find(o=>o.name===e)??null}async function J4(t){let{client:e,body:n,reqOpts:o}=t,r=5,i=[2e3,4e3,8e3,8e3];for(let a=1;a<=r;a+=1)try{return{result:await e.initProduct(n,{...o,retryOnTransient:!1}),recoveredFromTimeout:!1}}catch(c){if(G4(c)){let u=await W4(e,n.name);if(u)return{result:{product:u,repo:null,agent:{instructions:"",agentsMdUrl:null}},recoveredFromTimeout:!0}}if(c instanceof O&&c.status===409&&c.code==="IDEMPOTENCY_KEY_IN_FLIGHT"&&a<r){await R4(i[Math.min(a-1,i.length-1)]);continue}throw c}throw new O("Timed out waiting for the idempotent business create request to finish.",409,{code:"IDEMPOTENCY_KEY_IN_FLIGHT"})}var r0=[{opKey:"business.list",operationClass:"operate",scope:["products:read"],sideEffect:"read",cli:{group:"business",command:"list",summary:"List businesses in the current org",args:[],handler:async({client:t,emit:e})=>{let n=await t.listProducts();e({count:n.length,businesses:n.map(o=>({...o,displayName:o.displayName??null,status:o.status??null}))},`${n.length} business(es)`)}},mcp:{tool:"fs_business_list",title:"List businesses",description:"List every business in the authenticated FartherShore workspace (id, name, status). Read-only; use this to discover business ids for the other tools.",annotations:{readOnlyHint:!0,openWorldHint:!1},inputSchema:{},handler:async t=>{let e=await t.listProducts();return{count:e.length,businesses:e.map(n=>({id:n.id,name:n.name,status:n.status??null}))}}}},{opKey:"business.read",operationClass:"dual",scope:["products:read"],sideEffect:"read",cli:{group:"business",command:"show",summary:"Show a business",args:[{field:"productId",kind:"positional",token:lr,resolveProduct:!0},{field:"env",kind:"flag",token:"--env <env>",describe:"Environment scope (preview branch name)"}],handler:async({client:t,args:e,emit:n})=>{let o=e.productId,r=await t.getProduct(o,{env:e.env});n({business:r},`Business ${o}`)}},mcp:null},{opKey:"business.status",operationClass:"operate",scope:["products:read"],sideEffect:"read",cli:{group:"business",command:"status",summary:"Show a business's lifecycle/release/live state (status, latest release version, latest deployment, and a derived `live` boolean) \u2014 verify a business is serving after publish.",args:[{field:"productId",kind:"positional",token:lr,resolveProduct:!0}],handler:async({client:t,args:e,emit:n})=>{let o=e.productId,r=await t.getDeployments(o),i=r.data[0]??null,a={id:r.product.id,status:r.product.status,latestReleaseVersion:r.product.latestReleaseVersion,live:r.live,latestDeployment:i?{id:i.id,status:i.status,edgePublishStatus:i.edgePublishStatus,createdAt:i.createdAt}:null};n(a,`Business ${o}: ${r.product.status}${r.product.latestReleaseVersion?` @ ${r.product.latestReleaseVersion}`:""} (${r.live?"live":"not live"})`)}},mcp:{tool:"fs_business_status",title:"Business status",description:"Verify a business's lifecycle/release state by id or slug: its status (DRAFT|ACTIVE), latest release version, latest deployment run, and a derived `live` boolean (ACTIVE + a real non-bootstrap release applied + the edge serving the snapshot). Read-only; use this to confirm a business is live after publishing.",annotations:{readOnlyHint:!0,openWorldHint:!1},inputSchema:{productId:s.string().describe("The business id or slug to check.")},handler:async(t,e)=>{let n=await ve(t,e.productId),o=await t.getDeployments(n),r=o.data[0]??null;return{id:o.product.id,status:o.product.status,latestReleaseVersion:o.product.latestReleaseVersion,live:o.live,latestDeployment:r?{id:r.id,status:r.status,edgePublishStatus:r.edgePublishStatus,createdAt:r.createdAt}:null}}}},{opKey:"rbac.enable",operationClass:"contract",scope:["products:read"],sideEffect:"read",cli:{group:"business",command:"rbac",summary:"Show a business's Managed-RBAC contract state: the accepted spec's `rbac` flag and the derived grantable-permission catalog.",args:[{field:"productId",kind:"positional",token:lr,resolveProduct:!0},{field:"env",kind:"flag",token:"--env <env>",describe:"Environment scope (preview branch name)"}],handler:async({client:t,args:e,emit:n})=>{let o=e.productId,r=await t.getProductConfig(o,{state:"accepted",env:e.env}),i=r.config??{},a=F4(i.product?.rbac),c=Z4(i.features);n({productId:o,environment:r.environment??null,rbac:a,catalog:c},`Managed RBAC ${a.enabled?"enabled":"not enabled"}${a.capability?` (capability-gated: ${a.capability})`:""} \u2014 ${c.length} catalog feature(s)`)}},mcp:null},{opKey:"business.create",operationClass:"dual",scope:["products:create"],sideEffect:"write",cli:{group:"business",command:"create",summary:"Create a new business and provision the frontend starter repo",idempotent:!0,args:[{field:"name",kind:"flag",token:"--name <name>",describe:"Business slug (becomes the subdomain)",required:!0},{field:"displayName",kind:"flag",token:"--display-name <displayName>",describe:"Human-friendly business name"},{field:"description",kind:"flag",token:"--description <description>"},{field:"origin",kind:"flag",token:"--origin <url>",describe:"Optional business origin Farther Shore calls for customer-facing actions"},{field:"meters",kind:"flag",token:"--meters <template>",describe:`Meter template: ${Nd.map(t=>`${t.id} (${t.label})`).join(", ")}. Default: requests.`},{field:"meter",kind:"flag",token:"--meter <key[:display[:unit]]>",describe:"Custom meter, repeatable (e.g. --meter input_tokens:'Input Tokens':token). Overrides --meters.",parser:(t,e)=>[...e,t],defaultValue:[]},{field:"surface",kind:"flag",token:"--surface <surface>",describe:`Initial Business SDK surface, repeatable. Available: ${Bd.join(", ")}.`,parser:(t,e)=>[...e,t],defaultValue:[]},{field:"docs",kind:"flag",token:"--docs",describe:"Enable docs for this business (default when omitted)."},{field:"docs",kind:"flag",token:"--no-docs",describe:"Opt out of docs for this business."}],handler:async({client:t,args:e,reqOpts:n,emit:o,emitDryRunPreview:r})=>{let i=D4({meters:e.meters,meter:e.meter}),a=Vy({surface:e.surface}),c=e.docs===!0?!0:e.docs===!1?!1:void 0,u={name:e.name,...typeof e.origin=="string"?{origin:e.origin}:{},description:e.description,displayName:e.displayName,meters:i,surfaces:a,...c!==void 0?{docsEnabled:c}:{}},{result:d,recoveredFromTimeout:l}=await J4({client:t,body:u,reqOpts:n});r(d)||o({result:V4(d),...l?{recoveredFromTimeout:!0}:{}},`Business created: ${e.name}`)}},mcp:null},{opKey:"business.origin.update",operationClass:"operate",scope:["products:update"],sideEffect:"write",cli:{group:"business",command:"update",summary:"Update business presentation metadata and per-env origin",args:[{field:"productId",kind:"positional",token:lr,resolveProduct:!0},{field:"displayName",kind:"flag",token:"--display-name <displayName>"},{field:"description",kind:"flag",token:"--description <description>"},{field:"iconUrl",kind:"flag",token:"--icon-url <url>",describe:"Set the square icon/favicon URL"},{field:"iconFile",kind:"flag",token:"--icon-file <path>",describe:"Upload a local PNG, JPEG, or WEBP square icon"},{field:"clearIcon",kind:"flag",token:"--clear-icon",describe:"Remove the current icon asset"},{field:"logoUrl",kind:"flag",token:"--logo-url <url>",describe:"Set the wordmark/logo URL"},{field:"logoFile",kind:"flag",token:"--logo-file <path>",describe:"Upload a local PNG, JPEG, or WEBP wordmark/logo"},{field:"clearLogo",kind:"flag",token:"--clear-logo",describe:"Remove the current logo asset"},{field:"keyPrefix",kind:"flag",token:"--key-prefix <prefix>",describe:"White-label prefix for subscriber API keys (fsk_ \u2192 e.g. acme_). 2-12 lowercase letters/digits; fs/fsk/fsc/fsm reserved."},{field:"clearKeyPrefix",kind:"flag",token:"--clear-key-prefix",describe:"Reset the subscriber API key prefix to the default (fsk)."},{field:"origin",kind:"flag",token:"--origin <url>",describe:"Set the business upstream origin (the URL the gateway proxies to). With --env, sets that environment's override."},{field:"sandboxOrigin",kind:"flag",token:"--sandbox-origin <url>",describe:"Set the sandbox upstream origin. With --env, env-scoped."},{field:"env",kind:"flag",token:"--env <env>",describe:"Environment scope"}],handler:async({client:t,args:e,emit:n})=>{let o=e.productId;e0(e,"icon"),e0(e,"logo");let r={};e.displayName!==void 0&&(r.displayName=e.displayName),e.description!==void 0&&(r.description=e.description),e.iconUrl!==void 0&&(r.iconUrl=e.iconUrl),e.logoUrl!==void 0&&(r.logoUrl=e.logoUrl),e.clearKeyPrefix===!0?r.keyPrefix=null:e.keyPrefix!==void 0&&(r.keyPrefix=e.keyPrefix),e.origin!==void 0&&(r.origin=e.origin),e.sandboxOrigin!==void 0&&(r.sandboxOrigin=e.sandboxOrigin);let i=[];if(typeof e.iconFile=="string"&&i.push(()=>t0(t,o,"icon",e.iconFile)),typeof e.logoFile=="string"&&i.push(()=>t0(t,o,"logo",e.logoFile)),e.clearIcon===!0&&i.push(()=>t.deleteBrandAsset(o,"icon")),e.clearLogo===!0&&i.push(()=>t.deleteBrandAsset(o,"logo")),Object.keys(r).length===0&&i.length===0)throw new O("No fields to update. Pass presentation metadata flags such as --display-name, --description, --origin, --icon-file, --logo-file, or a clear flag.",void 0,{code:"BUSINESS_UPDATE_NO_FIELDS"});let a=Object.keys(r).length>0?await t.updateProduct(o,r,{env:e.env}):await t.getProduct(o,{env:e.env}),c=await Promise.all(i.map(u=>u()));n({business:a,assets:c},`Business ${o} updated`)}},mcp:{tool:"fs_brand_update",title:"Update business brand",description:"Update a business's brand/presentation and upstream origin \u2014 display name, description, icon, logo (wordmark), origin (the URL the gateway proxies to), sandboxOrigin. Pass env to write an environment-scoped origin override instead of the business default. Plans, pricing, and routes are managed as code in the business repo and are NOT editable here. Only the fields you pass are changed.",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!1},inputSchema:{productId:s.string().describe("The business id or slug to update."),displayName:s.string().optional().describe("Display name."),description:s.string().optional().describe("Short business description."),iconUrl:s.string().nullable().optional().describe("Square icon/favicon URL, or null to clear it."),logoUrl:s.string().nullable().optional().describe("Wordmark/logo URL, or null to clear it."),keyPrefix:s.string().nullable().optional().describe("White-label prefix for subscriber API keys (fsk_ \u2192 e.g. acme_). 2-12 lowercase letters/digits; fs/fsk/fsc/fsm reserved. Null clears to the default fsk."),origin:s.string().optional().describe("Business upstream origin (the URL the gateway proxies to)."),sandboxOrigin:s.string().optional().describe("Sandbox upstream origin."),env:s.string().optional().describe("Environment scope \u2014 when set, the origin override is written to that environment instead of the business default.")},handler:async(t,e)=>{let n=await ve(t,e.productId),o={};return e.displayName!==void 0&&(o.displayName=e.displayName),e.description!==void 0&&(o.description=e.description),e.iconUrl!==void 0&&(o.iconUrl=e.iconUrl),e.logoUrl!==void 0&&(o.logoUrl=e.logoUrl),e.keyPrefix!==void 0&&(o.keyPrefix=e.keyPrefix),e.origin!==void 0&&(o.origin=e.origin),e.sandboxOrigin!==void 0&&(o.sandboxOrigin=e.sandboxOrigin),t.updateProduct(n,o,{env:e.env})}}},{opKey:"business.publish",operationClass:"dual",scope:["products:publish"],sideEffect:"write",cli:{group:"business",command:"publish",summary:"Publish a draft business (make it live) and cut a versioned release with an auto-computed semver. Requires at least one plan, an origin, and a verified Stripe connection.",idempotent:!0,args:[{field:"productId",kind:"positional",token:lr,resolveProduct:!0},{field:"bump",kind:"flag",token:"--bump <bump>",describe:"Force the semver bump (major|minor|patch). Omit to auto-derive from the change."},{field:"version",kind:"flag",token:"--version <version>",describe:"Pin the exact next release tag (vX.Y.Z), skipping derivation."},{field:"acceptBreaking",kind:"flag",token:"--accept-breaking",describe:"Consent to publish a breaking (blocking-risk) change as a major release."}],helpTextAfter:`
|
|
82
|
+
`)+n,r=i+1,i=t.indexOf(`
|
|
83
|
+
`,r)}while(i!==-1);return o+=t.slice(r),o}var{stdout:NT,stderr:CT}=OT,Z_=Symbol("GENERATOR"),Gi=Symbol("STYLER"),la=Symbol("IS_EMPTY"),zT=["ansi","ansi","ansi256","ansi16m"],Wi=Object.create(null),$4=(t,e={})=>{if(e.level&&!(Number.isInteger(e.level)&&e.level>=0&&e.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let n=NT?NT.level:0;t.level=e.level===void 0?n:e.level};var I4=t=>{let e=(...n)=>n.join(" ");return $4(e,t),Object.setPrototypeOf(e,da.prototype),e};function da(t){return I4(t)}Object.setPrototypeOf(da.prototype,Function.prototype);for(let[t,e]of Object.entries(Mt))Wi[t]={get(){let n=Ud(this,B_(e.open,e.close,this[Gi]),this[la]);return Object.defineProperty(this,t,{value:n}),n}};Wi.visible={get(){let t=Ud(this,this[Gi],!0);return Object.defineProperty(this,"visible",{value:t}),t}};var F_=(t,e,n,...i)=>t==="rgb"?e==="ansi16m"?Mt[n].ansi16m(...i):e==="ansi256"?Mt[n].ansi256(Mt.rgbToAnsi256(...i)):Mt[n].ansi(Mt.rgbToAnsi(...i)):t==="hex"?F_("rgb",e,n,...Mt.hexToRgb(...i)):Mt[n][t](...i),w4=["rgb","hex","ansi256"];for(let t of w4){Wi[t]={get(){let{level:n}=this;return function(...i){let r=B_(F_(t,zT[n],"color",...i),Mt.color.close,this[Gi]);return Ud(this,r,this[la])}}};let e="bg"+t[0].toUpperCase()+t.slice(1);Wi[e]={get(){let{level:n}=this;return function(...i){let r=B_(F_(t,zT[n],"bgColor",...i),Mt.bgColor.close,this[Gi]);return Ud(this,r,this[la])}}}}var E4=Object.defineProperties(()=>{},{...Wi,level:{enumerable:!0,get(){return this[Z_].level},set(t){this[Z_].level=t}}}),B_=(t,e,n)=>{let i,r;return n===void 0?(i=t,r=e):(i=n.openAll+t,r=e+n.closeAll),{open:t,close:e,openAll:i,closeAll:r,parent:n}},Ud=(t,e,n)=>{let i=(...r)=>T4(i,r.length===1?""+r[0]:r.join(" "));return Object.setPrototypeOf(i,E4),i[Z_]=t,i[Gi]=e,i[la]=n,i},T4=(t,e)=>{if(t.level<=0||!e)return t[la]?"":e;let n=t[Gi];if(n===void 0)return e;let{openAll:i,closeAll:r}=n;if(e.includes("\x1B"))for(;n!==void 0;)e=PT(e,n.close,n.open),n=n.parent;let o=e.indexOf(`
|
|
84
|
+
`);return o!==-1&&(e=AT(e,r,i,o)),i+e+r};Object.defineProperties(da.prototype,Wi);var R4=da(),O8=da({level:CT?CT.level:0});var q_=R4;var O4;function Md(){return O4??P4(void 0)}function DT(){return Md()==="json"}function jT(t){DT()||console.log(q_.dim(t))}function UT(t){DT()||console.log(q_.bold(t))}function V_(){return process.stdout.isTTY===!0}function P4(t){if(t==="json"||t==="table")return t;if(t!==void 0)throw new N(`Unsupported --format "${t}". Use "json" or "table".`,400,{code:"INVALID_OUTPUT_FORMAT",param:"format"});return V_()?"table":"json"}var A4={MANAGED_BY_CODE:"This business's contract is managed as code. Edit the Business SDK program in its GitHub repo (business/) and push \u2014 do NOT retry the API. (Branding stays editable via `farthershore business update`.)",UNAUTHORIZED:"Token is invalid or revoked. Run `farthershore auth login` to update it.",FORBIDDEN:"Your token doesn't have access to this resource. Check the org / business scope.",INVALID_ACCESS_KEY:"Token format is wrong. Generate a new one at https://farthershore.com/settings/tokens.",MAKER_TOKEN_REVOKED:"This maker token was revoked. Mint a new one in the business settings.",MAKER_TOKEN_NO_BUSINESS:"Maker token is not bound to a business. Re-create it from the business page.",AUTH_NO_TOKEN:"Pass --token <mk_...> or set FARTHERSHORE_TOKEN, or run interactively in a TTY.",AUTH_INVALID_TOKEN:"Token format is malformed. Maker tokens start with `mk_` and are 30+ characters.",DESTRUCTIVE_OP_REQUIRES_YES:"Destructive ops (delete) require an explicit `--yes` to proceed. This is intentional safety.",BUSINESS_UPDATE_NO_FIELDS:"Pass at least one field flag (--display-name, --origin, --description).",PLAN_UPDATE_NO_FIELDS:"Pass at least one of --name, --recurring-fee-cents, --grant, --trial-days, --max-monthly-spend-cents, or --meter.",ENV_NOT_FOUND:"Environment doesn't exist. Use `farthershore env list <business>` to see available envs, or create one with `farthershore env create`.",STRIPE_NOT_CONFIGURED:"Stripe isn't connected on this business. Connect it in the dashboard before running billing operations.",STRIPE_NOT_CONNECTED:"Publishing requires a connected Stripe account. Connect one on the dashboard Connections page, then re-run `farthershore business publish`.",STRIPE_NOT_VERIFIED:"Your Stripe account isn't fully verified yet. Finish Stripe onboarding, then re-run `farthershore business publish`.",BILLING_TAX_NOT_ENROLLED:"Stripe Tax isn't enrolled for this account. Enable it from the dashboard Connections page, then re-run `farthershore business publish`.",STRIPE_BALANCE_OUTSTANDING:"Customer has an outstanding balance. Resolve the invoice in Stripe before retrying.",CHECKOUT_SESSION_FAILED:"Stripe rejected the checkout request. Check that the plan exists and Stripe credentials are valid.",BUSINESS_NOT_FOUND:"Check the business slug. Run `farthershore` (no args) for a list of businesses you can see.",BUSINESS_REPO_NOT_LINKED:"Link a GitHub repo to this business before publishing or validating business manifests.",YAML_PARSE_ERROR:"Business manifest is not valid. Run `farthershore build` locally, fix business/ source, then push again for bot validation.",GITHUB_NOT_CONNECTED:"Connect GitHub on the org page before running `init` (it provisions the repo).",BRANCH_NO_MATCHING_ENV:"The current branch isn't mapped to an environment. Add a branch rule in business settings or pass --branch explicitly.",PLAN_NOT_FOUND:"Plan key doesn't exist on this business. Check the `plans` block in your local business manifest.",PLAN_HAS_ACTIVE_SUBSCRIPTIONS:"Plan has active subscribers and can't be deleted. Migrate them to another plan first.",PLAN_SLUG_CONFLICT:"Another plan already uses this key. Pick a unique plan key in your manifest.",SLUG_CONFLICT:"This business slug is taken. Pick a different name.",SLUG_BLOCKED:"This slug is reserved or blocked. Pick a different name.",SLUG_RESERVED:"This slug is reserved by Farther Shore. Pick a different name.",SLUG_INVALID_FORMAT:"Slug must be lowercase letters, digits, and hyphens (no leading/trailing hyphen).",DECISION_NOT_FOUND:"No DenialEvent recorded for that decisionId. Verify the id from the original deny response or audit log.",AUTH_UNAUTHORIZED:"Token is missing, expired, or lacks the audit:read scope required to read denial events.",RATE_LIMIT_EXCEEDED:"You've hit the rate limit. Wait a moment and retry.",VALIDATION_ERROR:"Request is malformed. The `details` field has the field-level errors.",CONFLICT:"The resource is in a state that conflicts with the request. Inspect `details` to learn more."};function MT(t){if(t)return A4[t]}function ZT(t,e){return{schema_version:1,ok:!0,op:t,data:e}}function FT(t,e){let n=e.status??0;return{schema_version:1,ok:!1,op:t,error:{code:e.code??"INTERNAL_ERROR",message:e.message,status:n,param:e.param,retryable:C4(n,e.code),details:e.details,hint:MT(e.code)}}}var N4=new Set(["RATE_LIMIT_EXCEEDED","SERVICE_UNAVAILABLE"]);function C4(t,e){return t>=500||t===429||t===503?!0:e?N4.has(e):!1}var z4=/^(mk_[^.\s]+\.[^\s]+|fsrt_(test|live)_[^\s]+|fsk_[A-Za-z0-9_-]{8,}|sk_(test|live)_[A-Za-z0-9_-]{8,}|eyJ[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+)$/,D4=/^(secret|clientSecret|privateKey|password|plaintext|connectorToken|tunnelToken|accessToken|refreshToken|tokenHash)$/i;function BT(t){return t.length<=8?"***redacted***":`${t.slice(0,4)}\u2026${t.slice(-4)}`}function Ld(t){if(typeof t=="string")return z4.test(t)?BT(t):t;if(Array.isArray(t))return t.map(e=>Ld(e));if(t&&typeof t=="object"){let e={};for(let[n,i]of Object.entries(t))D4.test(n)&&typeof i=="string"?e[n]=BT(i):e[n]=Ld(i);return e}return t}import{createInterface as F4}from"node:readline";import{readFile as B4}from"node:fs/promises";import{setTimeout as q4}from"node:timers/promises";import{extname as V4}from"node:path";var j4=a.string().regex(/^\/[A-Za-z0-9_/:.{}*-]*$/,"non-canonical route path"),U4=a.enum(["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"]),qT=a.object({method:U4,path:j4}),M4=qT.extend({pending:a.boolean().optional()}),q8=a.object({lockVersion:a.number().int().nonnegative(),surfaceHash:a.string().startsWith("sha256:"),backends:a.record(a.string(),a.object({routes:a.array(M4).max(500)}))}),V8=a.object({backendId:a.string().min(1),lockVersion:a.number().int().nonnegative(),reflectedSurfaceHash:a.string().startsWith("sha256:"),routes:a.array(qT).max(500)}),H8=a.object({backendId:a.string().min(1),lockVersion:a.number().int().nonnegative(),servedRouteIds:a.array(a.string().min(1)).max(500)});var Pe={idempotencyKey:a.string().optional().describe("A UUID you generate; REUSE the same value when retrying so the retry replays the first result instead of double-provisioning.")};function VT(t){let e=t?.trim().toLowerCase();return e?e.split(".")[0]??null:null}async function ke(t,e){if(e){if(e.length===36)return e;let n=e.trim().toLowerCase(),r=(await t.listBusinesses()).find(o=>o.id===e||o.name.toLowerCase()===n||o.runtimeHostname?.toLowerCase()===n||o.portalHostname?.toLowerCase()===n||VT(o.runtimeHostname)===n||VT(o.portalHostname)===n);if(r)return r.id;throw new N(`Business "${e}" not found`,404,{code:"NOT_FOUND"})}throw new Error("No business selected. Pass a business id or slug, or run `farthershore business create` first.")}function HT(t){let e={};return typeof t.bump=="string"&&(e.bump=t.bump),typeof t.version=="string"&&(e.version=t.version),t.acceptBreaking===!0&&(e.acceptBreaking=!0),e}async function H4(t){let e=F4({input:process.stdin,output:process.stderr,terminal:!0});return new Promise(n=>{e.question(`Cut release ${t}? [y/N] `,i=>{e.close(),n(/^y(es)?$/i.test(i.trim()))})})}function K4(t){return t.split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function G4(t){let[e="",n,i]=t.split(":");if(!/^[a-z0-9_]+$/.test(e))throw new N(`Invalid meter key in "--meter ${t}" \u2014 keys are lowercase letters, digits, and underscores (e.g. input_tokens).`,void 0,{code:"INVALID_METER_SPEC"});return{key:e,display:n?.trim()||K4(e),unit:i?.trim()||void 0}}function W4(t){let e=t.meter??[];if(e.length>0&&t.meters)throw new N("Pass either --meters <template> or repeated --meter entries, not both.",void 0,{code:"CONFLICTING_METER_FLAGS"});if(e.length>0){let n=e.map(G4);if(new Set(n.map(r=>r.key)).size!==n.length)throw new N("Duplicate meter keys in --meter flags.",void 0,{code:"INVALID_METER_SPEC"});return n}if(t.meters){let n=zw(t.meters);if(!n)throw new N(`Unknown meter template "${t.meters}". Available: ${Dw().join(", ")}.`,void 0,{code:"UNKNOWN_METER_TEMPLATE"});return n.meters.map(i=>({...i}))}}var cn="<businessIdOrName>",J4={BRANCH_PREFIX:"branch-prefix",PULL_REQUEST:"pull-request",DISABLED:"disabled"},Y4=Object.fromEntries(i_.map(t=>[J4[t],t])),X4=/^.{1,50}$/,Q4={".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".webp":"image/webp"};function e6(t){let e=new Map;for(let n of Object.values(t??{}))for(let i of n?.routes??[]){if(typeof i.method!="string"||typeof i.path!="string")continue;let r=hr({actionId:i.actionId,method:i.method,path:i.path}),o=e.get(r)??new Set;o.add(Lw(r,i.method)),e.set(r,o)}return[...e.entries()].map(([n,i])=>({subject:n,title:n,permissions:[...i].sort()})).sort((n,i)=>n.subject.localeCompare(i.subject))}function t6(t){return{enabled:t===!0}}function n6(t){let{business:e,...n}=t;return{...n,business:e}}function r6(t){let e=Q4[V4(t).toLowerCase()];if(!e)throw new N(`Cannot infer image Content-Type for "${t}". Use a .png, .jpg, .jpeg, or .webp file.`,void 0,{code:"UNSUPPORTED_BRAND_ASSET_TYPE"});return e}function i6(t){return t.filter(e=>e!==void 0&&e!==!1).length}function KT(t,e){let n=e==="icon"?"icon":"logo",i=e==="icon"?"icon":"logo",r=e==="icon"?"clearIcon":"clearLogo";if(i6([t[`${i}Url`],t[`${i}File`],t[r]])>1)throw new N(`Choose only one ${n} operation: --${i}-url, --${i}-file, or --clear-${i}.`,void 0,{code:"CONFLICTING_BRAND_ASSET_FLAGS"})}function o6(t){let e=Y4[t];if(!e)throw new N(`Invalid preview environment trigger "${t}". Use branch-prefix, pull-request, or disabled.`,void 0,{code:"INVALID_PREVIEW_ENV_TRIGGER"});return e}function s6(t){let e={};if(typeof t.trigger=="string"&&(e.previewEnvTrigger=o6(t.trigger)),t.clearBranchPrefix===!0)e.envBranchPrefix=null;else if(typeof t.branchPrefix=="string"){if(!X4.test(t.branchPrefix))throw new N("--branch-prefix must be 1-50 characters.",void 0,{code:"INVALID_ENV_BRANCH_PREFIX"});e.envBranchPrefix=t.branchPrefix}if(e.previewEnvTrigger===void 0&&e.envBranchPrefix===void 0)throw new N("Pass at least one preview environment setting: --trigger, --branch-prefix, or --clear-branch-prefix.",void 0,{code:"MISSING_PREVIEW_ENV_UPDATE"});return e}async function GT(t,e,n,i){let r=await B4(i);return t.uploadBrandAsset(e,n,r,r6(i))}function a6(t){if(t instanceof N||!(t instanceof Error))return!1;let e=t.cause,n=e&&typeof e=="object"&&"code"in e?String(e.code):"",i=`${t.name} ${t.message} ${n}`.toLowerCase();return i.includes("abort")||i.includes("timeout")||i.includes("econnreset")||i.includes("socket hang up")||i.includes("fetch failed")||i.includes("network")}async function c6(t,e){return(await t.listBusinesses()).find(i=>i.name===e)??null}async function u6(t){let{client:e,body:n,reqOpts:i}=t,r=5,o=[2e3,4e3,8e3,8e3];for(let s=1;s<=r;s+=1)try{return{result:await e.initBusiness(n,{...i,retryOnTransient:!1}),recoveredFromTimeout:!1}}catch(c){if(a6(c)){let u=await c6(e,n.name);if(u)return{result:{business:u,repo:null,agent:{instructions:"",agentsMdUrl:null}},recoveredFromTimeout:!0}}if(c instanceof N&&c.status===409&&c.code==="IDEMPOTENCY_KEY_IN_FLIGHT"&&s<r){await q4(o[Math.min(s-1,o.length-1)]);continue}throw c}throw new N("Timed out waiting for the idempotent business create request to finish.",409,{code:"IDEMPOTENCY_KEY_IN_FLIGHT"})}var WT=[{opKey:"business.list",operationClass:"operate",scope:["businesses:read"],sideEffect:"read",cli:{group:"business",command:"list",summary:"List businesses in the current org",args:[],handler:async({client:t,emit:e})=>{let n=await t.listBusinesses();e({count:n.length,businesses:n.map(i=>({...i,displayName:i.displayName??null,status:i.status??null}))},`${n.length} business(es)`)}},mcp:{tool:"fs_business_list",title:"List businesses",description:"List every business in the authenticated FartherShore workspace (id, name, status). Read-only; use this to discover business ids for the other tools.",annotations:{readOnlyHint:!0,openWorldHint:!1},inputSchema:{},handler:async t=>{let e=await t.listBusinesses();return{count:e.length,businesses:e.map(n=>({id:n.id,name:n.name,status:n.status??null}))}}}},{opKey:"business.read",operationClass:"dual",scope:["businesses:read"],sideEffect:"read",cli:{group:"business",command:"show",summary:"Show a business",args:[{field:"businessId",kind:"positional",token:cn,resolveBusiness:!0},{field:"env",kind:"flag",token:"--env <env>",describe:"Environment scope (preview branch name)"}],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=await t.getBusiness(i,{env:e.env});n({business:r},`Business ${i}`)}},mcp:null},{opKey:"business.status",operationClass:"operate",scope:["businesses:read"],sideEffect:"read",cli:{group:"business",command:"status",summary:"Show a business's lifecycle/release/live state (status, latest release version, latest deployment, and a derived `live` boolean) \u2014 verify a business is serving after publish.",args:[{field:"businessId",kind:"positional",token:cn,resolveBusiness:!0}],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=await t.getDeployments(i),o=r.data[0]??null,s={id:r.business.id,status:r.business.status,latestReleaseVersion:r.business.latestReleaseVersion,live:r.live,latestDeployment:o?{id:o.id,status:o.status,edgePublishStatus:o.edgePublishStatus,createdAt:o.createdAt}:null};n(s,`Business ${i}: ${r.business.status}${r.business.latestReleaseVersion?` @ ${r.business.latestReleaseVersion}`:""} (${r.live?"live":"not live"})`)}},mcp:{tool:"fs_business_status",title:"Business status",description:"Verify a business's lifecycle/release state by id or slug: its status (DRAFT|ACTIVE), latest release version, latest deployment run, and a derived `live` boolean (ACTIVE + a real non-bootstrap release applied + the edge serving the snapshot). Read-only; use this to confirm a business is live after publishing.",annotations:{readOnlyHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe("The business id or slug to check.")},handler:async(t,e)=>{let n=await ke(t,e.businessId),i=await t.getDeployments(n),r=i.data[0]??null;return{id:i.business.id,status:i.business.status,latestReleaseVersion:i.business.latestReleaseVersion,live:i.live,latestDeployment:r?{id:r.id,status:r.status,edgePublishStatus:r.edgePublishStatus,createdAt:r.createdAt}:null}}}},{opKey:"rbac.enable",operationClass:"contract",scope:["businesses:read"],sideEffect:"read",cli:{group:"business",command:"rbac",summary:"Show a business's Managed-RBAC contract state: the accepted spec's `rbac` flag and the derived grantable-permission catalog.",args:[{field:"businessId",kind:"positional",token:cn,resolveBusiness:!0},{field:"env",kind:"flag",token:"--env <env>",describe:"Environment scope (preview branch name)"}],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=await t.getBusinessConfig(i,{state:"accepted",env:e.env}),o=r.config??{},s=t6(o.business?.rbac),c=e6(o.routeCatalog);n({businessId:i,environment:r.environment??null,rbac:s,catalog:c},`Managed RBAC ${s.enabled?"enabled":"not enabled"} \u2014 ${c.length} catalog group(s)`)}},mcp:null},{opKey:"business.create",operationClass:"dual",scope:["businesses:create"],sideEffect:"write",cli:{group:"business",command:"create",summary:"Create a new business and provision the frontend starter repo",idempotent:!0,args:[{field:"name",kind:"flag",token:"--name <name>",describe:"Business slug (becomes the subdomain)",required:!0},{field:"displayName",kind:"flag",token:"--display-name <displayName>",describe:"Human-friendly business name"},{field:"description",kind:"flag",token:"--description <description>"},{field:"origin",kind:"flag",token:"--origin <url>",describe:"Optional business origin Farther Shore calls for customer-facing actions"},{field:"meters",kind:"flag",token:"--meters <template>",describe:`Meter template: ${Rd.map(t=>`${t.id} (${t.label})`).join(", ")}. Default: requests.`},{field:"meter",kind:"flag",token:"--meter <key[:display[:unit]]>",describe:"Custom meter, repeatable (e.g. --meter input_tokens:'Input Tokens':token). Overrides --meters.",parser:(t,e)=>[...e,t],defaultValue:[]},{field:"docs",kind:"flag",token:"--docs",describe:"Enable docs for this business (default when omitted)."},{field:"docs",kind:"flag",token:"--no-docs",describe:"Opt out of docs for this business."}],handler:async({client:t,args:e,reqOpts:n,emit:i,emitDryRunPreview:r})=>{let o=W4({meters:e.meters,meter:e.meter}),s=e.docs===!0?!0:e.docs===!1?!1:void 0,c={name:e.name,...typeof e.origin=="string"?{origin:e.origin}:{},description:e.description,displayName:e.displayName,meters:o,...s!==void 0?{docsEnabled:s}:{}},{result:u,recoveredFromTimeout:d}=await u6({client:t,body:c,reqOpts:n});r(u)||i({result:n6(u),...d?{recoveredFromTimeout:!0}:{}},`Business created: ${e.name}`)}},mcp:null},{opKey:"business.origin.update",operationClass:"operate",scope:["businesses:update"],sideEffect:"write",cli:{group:"business",command:"update",summary:"Update business presentation metadata and per-env origin",args:[{field:"businessId",kind:"positional",token:cn,resolveBusiness:!0},{field:"displayName",kind:"flag",token:"--display-name <displayName>"},{field:"description",kind:"flag",token:"--description <description>"},{field:"iconUrl",kind:"flag",token:"--icon-url <url>",describe:"Set the square icon/favicon URL"},{field:"iconFile",kind:"flag",token:"--icon-file <path>",describe:"Upload a local PNG, JPEG, or WEBP square icon"},{field:"clearIcon",kind:"flag",token:"--clear-icon",describe:"Remove the current icon asset"},{field:"logoUrl",kind:"flag",token:"--logo-url <url>",describe:"Set the wordmark/logo URL"},{field:"logoFile",kind:"flag",token:"--logo-file <path>",describe:"Upload a local PNG, JPEG, or WEBP wordmark/logo"},{field:"clearLogo",kind:"flag",token:"--clear-logo",describe:"Remove the current logo asset"},{field:"keyPrefix",kind:"flag",token:"--key-prefix <prefix>",describe:"White-label prefix for subscriber API keys (fsk_ \u2192 e.g. acme_). 2-12 lowercase letters/digits; fs/fsk/fsc/fsm reserved."},{field:"clearKeyPrefix",kind:"flag",token:"--clear-key-prefix",describe:"Reset the subscriber API key prefix to the default (fsk)."},{field:"origin",kind:"flag",token:"--origin <url>",describe:"Set the business upstream origin (the URL the gateway proxies to). With --env, sets that environment's override."},{field:"sandboxOrigin",kind:"flag",token:"--sandbox-origin <url>",describe:"Set the sandbox upstream origin. With --env, env-scoped."},{field:"allowedOrigins",kind:"flag",token:"--allowed-origins <origins>",describe:"Comma-separated browser origins allowed to call the gateway cross-origin (custom frontend domains), e.g. https://app.example.com. The tenant's own portal origin is always allowed."},{field:"clearAllowedOrigins",kind:"flag",token:"--clear-allowed-origins",describe:"Remove all custom allowed origins."},{field:"env",kind:"flag",token:"--env <env>",describe:"Environment scope"}],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId;KT(e,"icon"),KT(e,"logo");let r={};e.displayName!==void 0&&(r.displayName=e.displayName),e.description!==void 0&&(r.description=e.description),e.iconUrl!==void 0&&(r.iconUrl=e.iconUrl),e.logoUrl!==void 0&&(r.logoUrl=e.logoUrl),e.clearKeyPrefix===!0?r.keyPrefix=null:e.keyPrefix!==void 0&&(r.keyPrefix=e.keyPrefix),e.origin!==void 0&&(r.origin=e.origin),e.sandboxOrigin!==void 0&&(r.sandboxOrigin=e.sandboxOrigin),e.clearAllowedOrigins===!0?r.allowedOrigins=[]:typeof e.allowedOrigins=="string"&&(r.allowedOrigins=e.allowedOrigins.split(",").map(u=>u.trim()).filter(Boolean));let o=[];if(typeof e.iconFile=="string"&&o.push(()=>GT(t,i,"icon",e.iconFile)),typeof e.logoFile=="string"&&o.push(()=>GT(t,i,"logo",e.logoFile)),e.clearIcon===!0&&o.push(()=>t.deleteBrandAsset(i,"icon")),e.clearLogo===!0&&o.push(()=>t.deleteBrandAsset(i,"logo")),Object.keys(r).length===0&&o.length===0)throw new N("No fields to update. Pass presentation metadata flags such as --display-name, --description, --origin, --icon-file, --logo-file, or a clear flag.",void 0,{code:"BUSINESS_UPDATE_NO_FIELDS"});let s=Object.keys(r).length>0?await t.updateBusiness(i,r,{env:e.env}):await t.getBusiness(i,{env:e.env}),c=await Promise.all(o.map(u=>u()));n({business:s,assets:c},`Business ${i} updated`)}},mcp:{tool:"fs_brand_update",title:"Update business brand",description:"Update a business's brand/presentation and upstream origin \u2014 display name, description, icon, logo (wordmark), origin (the URL the gateway proxies to), sandboxOrigin. Pass env to write an environment-scoped origin override instead of the business default. Plans, pricing, and routes are managed as code in the business repo and are NOT editable here. Only the fields you pass are changed.",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!1},inputSchema:{businessId:a.string().describe("The business id or slug to update."),displayName:a.string().optional().describe("Display name."),description:a.string().optional().describe("Short business description."),iconUrl:a.string().nullable().optional().describe("Square icon/favicon URL, or null to clear it."),logoUrl:a.string().nullable().optional().describe("Wordmark/logo URL, or null to clear it."),keyPrefix:a.string().nullable().optional().describe("White-label prefix for subscriber API keys (fsk_ \u2192 e.g. acme_). 2-12 lowercase letters/digits; fs/fsk/fsc/fsm reserved. Null clears to the default fsk."),origin:a.string().optional().describe("Business upstream origin (the URL the gateway proxies to)."),sandboxOrigin:a.string().optional().describe("Sandbox upstream origin."),env:a.string().optional().describe("Environment scope \u2014 when set, the origin override is written to that environment instead of the business default.")},handler:async(t,e)=>{let n=await ke(t,e.businessId),i={};return e.displayName!==void 0&&(i.displayName=e.displayName),e.description!==void 0&&(i.description=e.description),e.iconUrl!==void 0&&(i.iconUrl=e.iconUrl),e.logoUrl!==void 0&&(i.logoUrl=e.logoUrl),e.keyPrefix!==void 0&&(i.keyPrefix=e.keyPrefix),e.origin!==void 0&&(i.origin=e.origin),e.sandboxOrigin!==void 0&&(i.sandboxOrigin=e.sandboxOrigin),e.clearAllowedOrigins===!0?i.allowedOrigins=[]:typeof e.allowedOrigins=="string"&&(i.allowedOrigins=e.allowedOrigins.split(",").map(r=>r.trim()).filter(Boolean)),t.updateBusiness(n,i,{env:e.env})}}},{opKey:"business.publish",operationClass:"dual",scope:["businesses:publish"],sideEffect:"write",cli:{group:"business",command:"publish",summary:"Publish a draft business (make it live) and cut a versioned release with an auto-computed semver. Requires at least one plan, an origin, and a verified Stripe connection.",idempotent:!0,args:[{field:"businessId",kind:"positional",token:cn,resolveBusiness:!0},{field:"bump",kind:"flag",token:"--bump <bump>",describe:"Force the semver bump (major|minor|patch). Omit to auto-derive from the change."},{field:"version",kind:"flag",token:"--version <version>",describe:"Pin the exact next release tag (vX.Y.Z), skipping derivation."},{field:"acceptBreaking",kind:"flag",token:"--accept-breaking",describe:"Consent to publish a breaking (blocking-risk) change as a major release."}],helpTextAfter:`
|
|
85
85
|
Publish auto-derives the semver bump from the change and cuts a vX.Y.Z release.
|
|
86
86
|
Use --dry-run to preview the computed bump + reasons without cutting a tag.
|
|
87
|
-
A blocking-risk (breaking) change is refused unless --accept-breaking is passed.`,handler:async({client:t,args:e,opts:n,reqOpts:o,emit:r,emitDryRunPreview:i})=>{let a=e.productId,c=XT(n);if(o.dryRun){let d=await t.publishProduct(a,c,o);if(i(d))return}if(Zy()&&n.input!==!1){let l=(await t.publishProduct(a,c,{...o,dryRun:!0,idempotencyKey:void 0})).wouldHave?._release;if(l){qT(`Publishing ${a}: ${l.computedBump} \u2192 ${l.version}`+(l.previousVersion?` (from ${l.previousVersion})`:" (first release)"));for(let m of l.reasons)VT(` \u2022 ${m}`);if(!await C4(l.version)){r({cancelled:!0},"Publish cancelled.");return}}}let u=await t.publishProduct(a,c,o);r({business:u,_release:u._release??null},`Business ${a} published`)}},mcp:{tool:"fs_business_publish",title:"Publish a business",description:"Publish a business \u2014 deploy its current spec live and cut a versioned release with an auto-computed semver. Equivalent to a repo-driven deploy (operationClass=dual); both reconcile to the same published state.",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},inputSchema:{productId:s.string().describe("The business id to publish."),bump:s.enum(["major","minor","patch"]).optional().describe("Force the semver bump. Omit to auto-derive from the change."),version:s.string().optional().describe("Pin the exact next release tag (vX.Y.Z)."),acceptBreaking:s.boolean().optional().describe("Consent to publish a breaking (blocking-risk) change as major."),dryRun:s.boolean().optional().describe("Preview the change (computed semver + reasons) without cutting a release."),...He},handler:async(t,e)=>{let n=XT({bump:e.bump,version:e.version,acceptBreaking:e.acceptBreaking});return t.publishProduct(e.productId,n,{idempotencyKey:e.idempotencyKey,dryRun:e.dryRun})}}},{opKey:"business.delete",operationClass:"operate",scope:["products:update"],sideEffect:"write",cli:{group:"business",command:"delete",summary:"Permanently delete a business. Requires --yes.",destructive:!0,yesMessage:"Pass --yes to confirm business deletion.",args:[{field:"productId",kind:"positional",token:lr,resolveProduct:!0},{field:"deleteGithubRepo",kind:"flag",token:"--delete-github-repo",describe:"Also delete the connected GitHub repository. Requires the same builder-session authorization as dashboard deletion."}],handler:async({client:t,args:e,emit:n})=>{let o=e.productId;try{await t.deleteProduct(o,{deleteGitHubRepo:e.deleteGithubRepo===!0})}catch(r){throw r instanceof O&&(r.status===403||r.code==="FORBIDDEN")?new O("Deleting a whole business requires a builder/browser session \u2014 open the business in the dashboard to delete it. (Preview environments CAN be deleted via the CLI: `farthershore env delete`.)",r.status,{code:r.code??"FORBIDDEN"}):r}n({deleted:o},`Business ${o} deleted`)}},mcp:null},{opKey:"business.preview_env.set",operationClass:"operate",scope:["products:update"],sideEffect:"write",cli:{group:"business preview-env",command:"set",summary:"Configure automatic preview-environment creation for a business.",args:[{field:"productId",kind:"positional",token:lr,resolveProduct:!0},{field:"trigger",kind:"flag",token:"--trigger <branch-prefix|pull-request|disabled>",describe:"Auto-create previews from env branch prefixes, pull requests, or disable automatic creation."},{field:"branchPrefix",kind:"flag",token:"--branch-prefix <prefix>",describe:"Set the env branch prefix used by --trigger branch-prefix (1-50 characters)."},{field:"clearBranchPrefix",kind:"flag",token:"--clear-branch-prefix",describe:"Reset the env branch prefix to the platform default (env/)."}],handler:async({client:t,args:e,emit:n})=>{if(e.branchPrefix!==void 0&&e.clearBranchPrefix===!0)throw new O("Pass either --branch-prefix or --clear-branch-prefix, not both.",void 0,{code:"CONFLICTING_BRANCH_PREFIX_FLAGS"});let o=e.productId,r=K4(e),i=await t.updateProduct(o,r,{});n({business:i},`Preview environment policy updated for ${o}`)}},mcp:{tool:"fs_business_preview_env_set",title:"Set business preview environment policy",description:"Configure automatic preview environment creation for a business. Modes: BRANCH_PREFIX creates previews from matching env branches, PULL_REQUEST creates previews for PRs against the default branch, and DISABLED stops automatic creation while explicit `farthershore env create` continues to work. Pass envBranchPrefix to customize the branch-prefix mode, or null to reset to env/.",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!1},inputSchema:{productId:s.string().describe("The business id or slug to update."),previewEnvTrigger:s.enum(ay).optional().describe("Automatic preview mode: BRANCH_PREFIX, PULL_REQUEST, or DISABLED."),envBranchPrefix:s.string().min(1).max(50).nullable().optional().describe("Branch prefix for BRANCH_PREFIX mode, or null for env/.")},handler:async(t,e)=>{let n=await ve(t,e.productId),o={};if(e.previewEnvTrigger!==void 0&&(o.previewEnvTrigger=e.previewEnvTrigger),e.envBranchPrefix!==void 0&&(o.envBranchPrefix=e.envBranchPrefix),o.previewEnvTrigger===void 0&&o.envBranchPrefix===void 0)throw new O("Pass previewEnvTrigger, envBranchPrefix, or both.",void 0,{code:"MISSING_PREVIEW_ENV_UPDATE"});return t.updateProduct(n,o,{})}}},{opKey:"business.docs.enable",operationClass:"operate",scope:["products:update"],sideEffect:"write",cli:{group:"business docs",command:"enable",summary:"Enable docs for a business (publish/serve docs scaffold).",args:[{field:"productId",kind:"positional",token:lr,resolveProduct:!0}],handler:async({client:t,args:e,emit:n})=>{let o=e.productId,r=await t.updateProduct(o,{docsEnabled:!0},{});n({business:r},`Docs enabled for ${o}`)}},mcp:{tool:"fs_business_docs_enable",title:"Enable business docs",description:"Enable docs for a business \u2014 opens the publish/sync gate so docs are served from R2 and `boot.docsEnabled=true` is emitted to the portal. Idempotent if docs are already enabled.",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},inputSchema:{productId:s.string().describe("The business id or slug to enable docs on.")},handler:async(t,e)=>{let n=await ve(t,e.productId);return t.updateProduct(n,{docsEnabled:!0},{})}}},{opKey:"business.docs.disable",operationClass:"operate",scope:["products:update"],sideEffect:"write",cli:{group:"business docs",command:"disable",summary:"Disable docs for a business (stop publishing/serving docs; scaffold kept in the repo).",args:[{field:"productId",kind:"positional",token:lr,resolveProduct:!0}],handler:async({client:t,args:e,emit:n})=>{let o=e.productId,r=await t.updateProduct(o,{docsEnabled:!1},{});n({business:r},`Docs disabled for ${o}`)}},mcp:{tool:"fs_business_docs_disable",title:"Disable business docs",description:"Disable docs for a business \u2014 closes the publish/sync gate so docs are no longer served and `boot.docsEnabled=false` is emitted to the portal. The docs scaffold stays in the repo; re-enabling is a pure flag flip. Idempotent if docs are already disabled.",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},inputSchema:{productId:s.string().describe("The business id or slug to disable docs on.")},handler:async(t,e)=>{let n=await ve(t,e.productId);return t.updateProduct(n,{docsEnabled:!1},{})}}}];var Y4={kind:"free",label:"Free",description:"No recurring fee and no metered usage. Pure freemium tier.",pricing:{meters:[],recurring_fee_cents:0,billing_interval:"month",grants:[],trial_days:0}},X4={kind:"starter",label:"Starter \u2014 $20/mo + $20 included",description:"$20/month subscription with $20 of usage credit each period. Stripe-style minimum-spend; overage billed at $0.001/request by default.",pricing:{meters:[{dimension:"requests",kind:"linear",price_per_unit_micros:1e3}],recurring_fee_cents:2e3,billing_interval:"month",grants:[{kind:"credit",amount_cents:2e3,recurs:!0}],trial_days:0}},Q4={kind:"pro",label:"Pro \u2014 $100/mo + $200 included",description:"$100/month subscription with $200 of usage credit each period and a 14-day trial. Overage billed at $0.0005/request by default.",pricing:{meters:[{dimension:"requests",kind:"linear",price_per_unit_micros:500}],recurring_fee_cents:1e4,billing_interval:"month",grants:[{kind:"credit",amount_cents:2e4,recurs:!0}],trial_days:14}},e6={kind:"prepaid",label:"Prepaid \u2014 $50 sign-up credit, then PAYG",description:"$50 one-time credit at signup. Once depleted the subscriber pays-as-they-go at $0.001/request by default.",pricing:{meters:[{dimension:"requests",kind:"linear",price_per_unit_micros:1e3}],recurring_fee_cents:0,billing_interval:"month",grants:[{kind:"credit",amount_cents:5e3,recurs:!1}],trial_days:0}},t6={kind:"metered",label:"Metered (pay-as-you-go)",description:"No subscription fee. Pure usage billing at $0.001/request by default.",pricing:{meters:[{dimension:"requests",kind:"linear",price_per_unit_micros:1e3}],recurring_fee_cents:0,billing_interval:"month",grants:[],trial_days:0}},mX=Object.freeze({free:Y4,starter:X4,pro:Q4,prepaid:e6,metered:t6});var kX=s.object({recurring_fee_cents:s.number().int().nonnegative().optional(),grants:s.array(sr).max(40).optional(),creditPolicy:cr.optional(),min_monthly_spend_cents:s.number().int().nonnegative().optional(),max_monthly_spend_cents:s.number().int().nonnegative().optional(),meters:s.array(ur).optional(),notes:s.string().max(2e3).optional()});var Hd=["grandfather","next_renewal","immediate","by_date","opt_in"];function r6(t){if(!t||typeof t!="object")return[];let e=t;return Array.isArray(e.data)?e.data:Array.isArray(e.plans)?e.plans:Array.isArray(t)?t:[]}function n6(t){if(t.length===0)return"(no plans)";let e=["KEY","NAME","FREE","FEE\xA2","RECURRING\xA2","ONE_TIME\xA2","TRIAL_D","MAX_SPEND\xA2","STATUS"],n=c=>c===null?"\u2014":c.toLocaleString("en-US"),o=t.map(c=>[c.key,c.name,c.free?"Y":"N",n(c.recurring_fee_cents),n(c.recurring_grant_cents),n(c.one_time_grant_cents),n(c.trial_days),n(c.max_monthly_spend_cents),c.status]),r=e.map((c,u)=>Math.max(c.length,...o.map(d=>d[u]?.length??0))),i=c=>c.map((u,d)=>u.padEnd(r[d]??u.length)).join(" "),a=r.map(c=>"-".repeat(c)).join(" ");return[i(e),a,...o.map(i)].join(`
|
|
88
|
-
`)}var
|
|
87
|
+
A blocking-risk (breaking) change is refused unless --accept-breaking is passed.`,handler:async({client:t,args:e,opts:n,reqOpts:i,emit:r,emitDryRunPreview:o})=>{let s=e.businessId,c=HT(n);if(i.dryRun){let d=await t.publishBusiness(s,c,i);if(o(d))return}if(V_()&&n.input!==!1){let l=(await t.publishBusiness(s,c,{...i,dryRun:!0,idempotencyKey:void 0})).wouldHave?._release;if(l){UT(`Publishing ${s}: ${l.computedBump} \u2192 ${l.version}`+(l.previousVersion?` (from ${l.previousVersion})`:" (first release)"));for(let m of l.reasons)jT(` \u2022 ${m}`);if(!await H4(l.version)){r({cancelled:!0},"Publish cancelled.");return}}}let u=await t.publishBusiness(s,c,i);r({business:u,_release:u._release??null},`Business ${s} published`)}},mcp:{tool:"fs_business_publish",title:"Publish a business",description:"Publish a business \u2014 deploy its current spec live and cut a versioned release with an auto-computed semver. Equivalent to a repo-driven deploy (operationClass=dual); both reconcile to the same published state.",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe("The business id to publish."),bump:a.enum(["major","minor","patch"]).optional().describe("Force the semver bump. Omit to auto-derive from the change."),version:a.string().optional().describe("Pin the exact next release tag (vX.Y.Z)."),acceptBreaking:a.boolean().optional().describe("Consent to publish a breaking (blocking-risk) change as major."),dryRun:a.boolean().optional().describe("Preview the change (computed semver + reasons) without cutting a release."),...Pe},handler:async(t,e)=>{let n=HT({bump:e.bump,version:e.version,acceptBreaking:e.acceptBreaking});return t.publishBusiness(e.businessId,n,{idempotencyKey:e.idempotencyKey,dryRun:e.dryRun})}}},{opKey:"business.delete",operationClass:"operate",scope:["businesses:update"],sideEffect:"write",cli:{group:"business",command:"delete",summary:"Permanently delete a business. Requires --yes.",destructive:!0,yesMessage:"Pass --yes to confirm business deletion.",args:[{field:"businessId",kind:"positional",token:cn,resolveBusiness:!0},{field:"deleteGithubRepo",kind:"flag",token:"--delete-github-repo",describe:"Also delete the connected GitHub repository. Requires the same builder-session authorization as dashboard deletion."}],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId;try{await t.deleteBusiness(i,{deleteGitHubRepo:e.deleteGithubRepo===!0})}catch(r){throw r instanceof N&&(r.status===403||r.code==="FORBIDDEN")?new N("Deleting a whole business requires a builder/browser session \u2014 open the business in the dashboard to delete it. (Preview environments CAN be deleted via the CLI: `farthershore env delete`.)",r.status,{code:r.code??"FORBIDDEN"}):r}n({deleted:i},`Business ${i} deleted`)}},mcp:null},{opKey:"business.preview_env.set",operationClass:"operate",scope:["businesses:update"],sideEffect:"write",cli:{group:"business preview-env",command:"set",summary:"Configure automatic preview-environment creation for a business.",args:[{field:"businessId",kind:"positional",token:cn,resolveBusiness:!0},{field:"trigger",kind:"flag",token:"--trigger <branch-prefix|pull-request|disabled>",describe:"Auto-create previews from env branch prefixes, pull requests, or disable automatic creation."},{field:"branchPrefix",kind:"flag",token:"--branch-prefix <prefix>",describe:"Set the env branch prefix used by --trigger branch-prefix (1-50 characters)."},{field:"clearBranchPrefix",kind:"flag",token:"--clear-branch-prefix",describe:"Reset the env branch prefix to the platform default (env/)."}],handler:async({client:t,args:e,emit:n})=>{if(e.branchPrefix!==void 0&&e.clearBranchPrefix===!0)throw new N("Pass either --branch-prefix or --clear-branch-prefix, not both.",void 0,{code:"CONFLICTING_BRANCH_PREFIX_FLAGS"});let i=e.businessId,r=s6(e),o=await t.updateBusiness(i,r,{});n({business:o},`Preview environment policy updated for ${i}`)}},mcp:{tool:"fs_business_preview_env_set",title:"Set business preview environment policy",description:"Configure automatic preview environment creation for a business. Modes: BRANCH_PREFIX creates previews from matching env branches, PULL_REQUEST creates previews for PRs against the default branch, and DISABLED stops automatic creation while explicit `farthershore env create` continues to work. Pass envBranchPrefix to customize the branch-prefix mode, or null to reset to env/.",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!1},inputSchema:{businessId:a.string().describe("The business id or slug to update."),previewEnvTrigger:a.enum(i_).optional().describe("Automatic preview mode: BRANCH_PREFIX, PULL_REQUEST, or DISABLED."),envBranchPrefix:a.string().min(1).max(50).nullable().optional().describe("Branch prefix for BRANCH_PREFIX mode, or null for env/.")},handler:async(t,e)=>{let n=await ke(t,e.businessId),i={};if(e.previewEnvTrigger!==void 0&&(i.previewEnvTrigger=e.previewEnvTrigger),e.envBranchPrefix!==void 0&&(i.envBranchPrefix=e.envBranchPrefix),i.previewEnvTrigger===void 0&&i.envBranchPrefix===void 0)throw new N("Pass previewEnvTrigger, envBranchPrefix, or both.",void 0,{code:"MISSING_PREVIEW_ENV_UPDATE"});return t.updateBusiness(n,i,{})}}},{opKey:"business.docs.enable",operationClass:"operate",scope:["businesses:update"],sideEffect:"write",cli:{group:"business docs",command:"enable",summary:"Enable docs for a business (publish/serve docs scaffold).",args:[{field:"businessId",kind:"positional",token:cn,resolveBusiness:!0}],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=await t.updateBusiness(i,{docsEnabled:!0},{});n({business:r},`Docs enabled for ${i}`)}},mcp:{tool:"fs_business_docs_enable",title:"Enable business docs",description:"Enable docs for a business \u2014 opens the publish/sync gate so docs are served from R2 and `boot.docsEnabled=true` is emitted to the portal. Idempotent if docs are already enabled.",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe("The business id or slug to enable docs on.")},handler:async(t,e)=>{let n=await ke(t,e.businessId);return t.updateBusiness(n,{docsEnabled:!0},{})}}},{opKey:"business.docs.disable",operationClass:"operate",scope:["businesses:update"],sideEffect:"write",cli:{group:"business docs",command:"disable",summary:"Disable docs for a business (stop publishing/serving docs; scaffold kept in the repo).",args:[{field:"businessId",kind:"positional",token:cn,resolveBusiness:!0}],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=await t.updateBusiness(i,{docsEnabled:!1},{});n({business:r},`Docs disabled for ${i}`)}},mcp:{tool:"fs_business_docs_disable",title:"Disable business docs",description:"Disable docs for a business \u2014 closes the publish/sync gate so docs are no longer served and `boot.docsEnabled=false` is emitted to the portal. The docs scaffold stays in the repo; re-enabling is a pure flag flip. Idempotent if docs are already disabled.",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe("The business id or slug to disable docs on.")},handler:async(t,e)=>{let n=await ke(t,e.businessId);return t.updateBusiness(n,{docsEnabled:!1},{})}}}];var l6={kind:"free",label:"Free",description:"No recurring fee and no metered usage. Pure freemium tier.",pricing:{meters:[],recurring_fee_cents:0,billing_interval:"month",grants:[],trial_days:0}},d6={kind:"starter",label:"Starter \u2014 $20/mo + $20 included",description:"$20/month subscription with $20 of usage credit each period. Stripe-style minimum-spend; overage billed at $0.001/request by default.",pricing:{meters:[{dimension:"requests",kind:"linear",price_per_unit_micros:1e3}],recurring_fee_cents:2e3,billing_interval:"month",grants:[{kind:"credit",amount_cents:2e3,recurs:!0}],trial_days:0}},p6={kind:"pro",label:"Pro \u2014 $100/mo + $200 included",description:"$100/month subscription with $200 of usage credit each period and a 14-day trial. Overage billed at $0.0005/request by default.",pricing:{meters:[{dimension:"requests",kind:"linear",price_per_unit_micros:500}],recurring_fee_cents:1e4,billing_interval:"month",grants:[{kind:"credit",amount_cents:2e4,recurs:!0}],trial_days:14}},m6={kind:"prepaid",label:"Prepaid \u2014 $50 sign-up credit, then PAYG",description:"$50 one-time credit at signup. Once depleted the subscriber pays-as-they-go at $0.001/request by default.",pricing:{meters:[{dimension:"requests",kind:"linear",price_per_unit_micros:1e3}],recurring_fee_cents:0,billing_interval:"month",grants:[{kind:"credit",amount_cents:5e3,recurs:!1}],trial_days:0}},f6={kind:"metered",label:"Metered (pay-as-you-go)",description:"No subscription fee. Pure usage billing at $0.001/request by default.",pricing:{meters:[{dimension:"requests",kind:"linear",price_per_unit_micros:1e3}],recurring_fee_cents:0,billing_interval:"month",grants:[],trial_days:0}},DX=Object.freeze({free:l6,starter:d6,pro:p6,prepaid:m6,metered:f6});var YX=a.object({recurring_fee_cents:a.number().int().nonnegative().optional(),grants:a.array(Mn).max(40).optional(),creditPolicy:Ln.optional(),min_monthly_spend_cents:a.number().int().nonnegative().optional(),max_monthly_spend_cents:a.number().int().nonnegative().optional(),meters:a.array(Zn).optional(),notes:a.string().max(2e3).optional()});var Zd=["next_renewal","immediate","by_date","opt_in"];function h6(t){if(!t||typeof t!="object")return[];let e=t;return Array.isArray(e.data)?e.data:Array.isArray(e.plans)?e.plans:Array.isArray(t)?t:[]}function g6(t){if(t.length===0)return"(no plans)";let e=["KEY","NAME","FREE","FEE\xA2","RECURRING\xA2","ONE_TIME\xA2","TRIAL_D","MAX_SPEND\xA2","STATUS"],n=c=>c===null?"\u2014":c.toLocaleString("en-US"),i=t.map(c=>[c.key,c.name,c.free?"Y":"N",n(c.recurring_fee_cents),n(c.recurring_grant_cents),n(c.one_time_grant_cents),n(c.trial_days),n(c.max_monthly_spend_cents),c.status]),r=e.map((c,u)=>Math.max(c.length,...i.map(d=>d[u]?.length??0))),o=c=>c.map((u,d)=>u.padEnd(r[d]??u.length)).join(" "),s=r.map(c=>"-".repeat(c)).join(" ");return[o(e),s,...i.map(o)].join(`
|
|
88
|
+
`)}var b6=[{opKey:"plan.read",operationClass:"contract",scope:["businesses:read"],sideEffect:"read",cli:{group:"plan",command:"list",summary:"List plans for a business",args:[{field:"businessId",kind:"positional",token:"<businessIdOrName>",resolveBusiness:!0}],helpTextAfter:`
|
|
89
89
|
Output:
|
|
90
90
|
--format json \u2014 stable agent-friendly JSON envelope (default for non-TTY)
|
|
91
91
|
--format table \u2014 human-readable summary table (default for TTY)
|
|
92
|
-
`,handler:async({client:t,args:e,emit:n})=>{let
|
|
92
|
+
`,handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,o=h6(await t.managementListPlans(i)).map(s=>({id:s.id,key:s.planKey??s.key??"",name:s.name??"",version:s.version??null,free:s.free??!1,recurring_fee_cents:s.recurring_fee_cents??0,grants:s.grants??[],recurring_grant_cents:s_({grants:s.grants}),one_time_grant_cents:Od({grants:s.grants}),trial_days:s.trial_days??0,max_monthly_spend_cents:s.max_monthly_spend_cents??null,status:s.status??(s.isActive===!1?"INACTIVE":"ACTIVE")}));n({businessId:i,count:o.length,plans:o},`${o.length} plan(s) for business ${i}`),Md()!=="json"&&console.log(g6(o))}},mcp:{tool:"fs_plan_list",title:"List plans",description:"List a business's pricing plans (read-only). Plans are managed as code in the business's GitHub repo \u2014 to add/change/remove a plan, edit business/ and push; this tool only reads the current state. Pass the business id from fs_business_list.",annotations:{readOnlyHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe("The business id whose plans to list.")},handler:async(t,{businessId:e})=>t.managementListPlans(e)}},{opKey:"plan.migration_batch.create",operationClass:"operate",scope:["businesses:update"],sideEffect:"write",cli:{group:"plan",command:"migrate",summary:"Migrate subscribers between plan versions under a policy (owner-only)",idempotent:!0,args:[{field:"businessId",kind:"positional",token:"<businessIdOrName>",resolveBusiness:!0},{field:"planKey",kind:"positional",token:"<planKey>"},{field:"from",kind:"flag",token:"--from <version>",describe:"Source plan version to migrate FROM: an integer (e.g. 1) or head/latest.",required:!0},{field:"to",kind:"flag",token:"--to <version>",describe:"Target plan version to migrate TO: an integer (e.g. 2) or head/latest.",required:!0},{field:"policy",kind:"flag",token:"--policy <policy>",describe:`Migration policy: ${Zd.join(" | ")}.`,required:!0},{field:"proration",kind:"flag",token:"--proration <proration>",describe:"Optional proration: none | prorate | credit."},{field:"completeBy",kind:"flag",token:"--complete-by <iso8601>",describe:"Deadline (ISO 8601) \u2014 required by the by_date policy."}],helpTextAfter:`
|
|
93
93
|
Examples:
|
|
94
|
-
farthershore plan migrate my-
|
|
95
|
-
farthershore plan migrate my-
|
|
96
|
-
`,handler:async({client:t,args:e,reqOpts:n,emit:o,emitDryRunPreview:r})=>{let i=e.productId,a=e.planKey,c=e.policy;if(!Hd.includes(c))throw new O(`Invalid --policy "${c}". Supported: ${Hd.join(", ")}.`,void 0,{code:"INVALID_MIGRATION_POLICY"});let u=await t.migratePlan(i,a,{fromVersion:e.from,toVersion:e.to,policy:c,proration:e.proration,completeBy:e.completeBy},n);r(u)||o({productId:i,planKey:a,migration:u},`Migration scheduled for plan ${a}`)}},mcp:{tool:"fs_plan_migrate",title:"Migrate subscribers between plan versions",description:"Schedule a subscriber migration for a plan: move subscribers from one plan version to another under a policy. Pass the plan KEY plus fromVersion/toVersion (each an integer or 'head'/'latest') \u2014 the server resolves them to the right plan versions. Policies: grandfather (keep existing subs as-is), next_renewal (migrate at each sub's renewal), immediate (migrate now), by_date (migrate everyone by a deadline), opt_in (subs choose). This is an OPERATE action (it changes live subscriber state, not the product's code-managed definition).",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},inputSchema:{productId:s.string().describe("The product id whose subscribers to migrate."),planKey:s.string().describe("The stable plan key (e.g. 'pro') to migrate within."),fromVersion:s.union([s.string(),s.number().int().positive()]).describe("Source plan version: an integer or 'head'/'latest'."),toVersion:s.union([s.string(),s.number().int().positive()]).describe("Target plan version: an integer or 'head'/'latest'."),policy:s.enum(Hd).describe("Migration policy: grandfather | next_renewal | immediate | by_date | opt_in."),proration:s.enum(["none","prorate","credit"]).optional().describe("Optional proration behaviour."),completeBy:s.string().optional().describe("ISO 8601 deadline \u2014 required by the by_date policy."),...He},handler:async(t,e)=>t.migratePlan(e.productId,e.planKey,{fromVersion:e.fromVersion,toVersion:e.toVersion,policy:e.policy,proration:e.proration,completeBy:e.completeBy},{idempotencyKey:e.idempotencyKey})}}],n0=o6;function i6(t){if(!t||typeof t!="object")return[];let e=t;return Array.isArray(e.data)?e.data:Array.isArray(e.environments)?e.environments:[]}var o0=[{opKey:"environment.read",operationClass:"dual",scope:["products:read"],sideEffect:"read",cli:{group:"env",command:"list",summary:"List environments for a product",args:[{field:"productId",kind:"positional",token:"<productIdOrName>",resolveProduct:!0}],handler:async({client:t,args:e,emit:n})=>{let o=e.productId,r=i6(await t.listEnvironments(o));n({productId:o,count:r.length,environments:r.map(i=>({id:i.id,name:i.name,branch:i.branch??null,portalHostname:i.portalHostname??null,runtimeHostname:i.runtimeHostname??null,status:i.status??null}))},`${r.length} environment(s)`)}},mcp:{tool:"fs_env_list",title:"List environments",description:"List a product's preview environments (name, branch, hostnames). Read-only.",annotations:{readOnlyHint:!0,openWorldHint:!1},inputSchema:{productId:s.string().describe("The product id whose environments to list.")},handler:async(t,{productId:e})=>t.listEnvironments(e)}},{opKey:"environment.create",operationClass:"dual",scope:["products:update"],sideEffect:"write",cli:{group:"env",command:"create",summary:"Create a preview environment bound to a git branch",idempotent:!0,args:[{field:"productId",kind:"positional",token:"<productIdOrName>",resolveProduct:!0},{field:"name",kind:"flag",token:"--name <name>",describe:"Environment name (e.g. preview, staging)",required:!0},{field:"branch",kind:"flag",token:"--branch <branch>",describe:"Git branch to track (e.g. env/preview)",required:!0},{field:"cloneVariables",kind:"flag",token:"--no-clone-variables",describe:"Skip cloning Main variables into the new environment (variables are cloned by default).",defaultValue:!0}],handler:async({client:t,args:e,reqOpts:n,emit:o,emitDryRunPreview:r})=>{let i=e.productId,a=await t.createEnvironment(i,{name:e.name,branch:e.branch,cloneVariablesFromMain:e.cloneVariables!==!1},n);r(a)||o({productId:i,environment:a},`Environment ${e.name} created`)}},mcp:{tool:"fs_env_create",title:"Create preview environment",description:"Create a preview environment bound to a git branch. Equivalent to pushing the branch \u2014 both reconcile to the same environment (operationClass=dual). Provide a name and the git branch it tracks.",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!1},inputSchema:{productId:s.string().describe("The product id to create the environment in."),name:s.string().describe("Environment name (e.g. 'staging', 'preview-pr-42')."),branch:s.string().describe("The git branch this environment tracks."),cloneVariablesFromMain:s.boolean().optional().describe("Copy Main/production variables into the new environment. Default: true."),...He},handler:async(t,e)=>{let n=await t.createEnvironment(e.productId,{name:e.name,branch:e.branch,cloneVariablesFromMain:e.cloneVariablesFromMain??!0},{idempotencyKey:e.idempotencyKey});return{ok:!0,productId:e.productId,environment:n}}}},{opKey:"environment.delete",operationClass:"dual",scope:["products:update"],sideEffect:"write",cli:{group:"env",command:"delete",summary:"Delete an environment by name. Requires --yes.",destructive:!0,yesMessage:"Pass --yes to confirm environment deletion.",args:[{field:"productId",kind:"positional",token:"<productIdOrName>",resolveProduct:!0},{field:"envName",kind:"positional",token:"<envName>"}],handler:async({client:t,args:e,emit:n})=>{let o=e.productId,r=e.envName;await t.deleteEnvironment(o,r),n({productId:o,deleted:r},`Environment ${r} deleted`)}},mcp:null}];var qy=["gateway_verification","metering","health","tunnel"],a6="<productId>",ms="products:update",fs="The product id.",yn={field:"productId",kind:"positional",token:a6};function i0(t){if(!t||typeof t!="object")return[];let e=t;return Array.isArray(e.data)?e.data:Array.isArray(e.backends)?e.backends:Array.isArray(e.tokens)?e.tokens:Array.isArray(t)?t:[]}function s6(t){let e=t.status;if(typeof e=="string"&&e.length>0)return e;let n=typeof t.readinessState=="string"?t.readinessState:null,o=typeof t.provisionStatus=="string"?t.provisionStatus:null;return n??o??"unknown"}function c6(t){return{id:t.id,name:t.name,slug:t.slug,transport:t.transportMode,default:t.isDefault??!1,status:s6(t),originUrl:t.originUrl??null,lastSeenAt:t.lastSeenAt??null}}async function a0(t,e,n){if(!n)return null;try{return await _n(t,e,n)}catch(o){throw new O(o instanceof Error?o.message:`Environment "${n}" not found on product ${e}.`,void 0,{code:"ENV_NOT_FOUND"})}}var By=t=>typeof t=="string"&&t.length>0?t.split(",").map(e=>e.trim()).filter(e=>e.length>0):void 0,s0=[{opKey:"backend.read",operationClass:"operate",scope:["products:read"],sideEffect:"read",cli:{group:"backend",command:"list",summary:"List backends for a product (id, name, transport, status)",args:[yn],handler:async({client:t,args:e,emit:n})=>{let r=i0(await t.builderListBackends(e.productId)).map(c6);n({count:r.length,backends:r},`${r.length} backend(s)`)}},mcp:{tool:"fs_backend_list",title:"List backends",description:"List a product's backends (origins) \u2014 id, name, slug, transport (direct|tunnel), default flag, and derived status. Read-only.",annotations:{readOnlyHint:!0,openWorldHint:!1},inputSchema:{productId:s.string().describe("The product id whose backends to list.")},handler:async(t,{productId:e})=>t.builderListBackends(e)}},{opKey:"backend.create",operationClass:"operate",scope:[ms],sideEffect:"write",cli:{group:"backend",command:"create",summary:"Create a backend (default transport: direct)",idempotent:!0,args:[yn,{field:"name",kind:"flag",token:"--name <name>",describe:"Human-friendly backend name",required:!0},{field:"slug",kind:"flag",token:"--slug <slug>",describe:"Stable slug (defaults to a slugified name)"},{field:"env",kind:"flag",token:"--env <environment>",describe:"Scope backend to an environment name or id"},{field:"transport",kind:"flag",token:"--transport <mode>",describe:"Transport mode: direct | tunnel",defaultValue:"direct"},{field:"runner",kind:"flag",token:"--runner <runner>",describe:"embedded | sidecar"},{field:"runtime",kind:"flag",token:"--runtime <runtime>",describe:"Container/runtime descriptor"},{field:"originUrl",kind:"flag",token:"--origin-url <url>",describe:"Builder origin URL (direct)"},{field:"default",kind:"flag",token:"--default",describe:"Mark this backend the product default"}],handler:async({client:t,args:e,reqOpts:n,emit:o,emitDryRunPreview:r})=>{let i=e.productId,a=await a0(t,i,e.env),c=e.transport==="tunnel"?"tunnel":"direct",u=await t.builderCreateBackend(i,{name:e.name,slug:e.slug,environmentId:a,transportMode:c,runner:e.runner==="embedded"||e.runner==="sidecar"?e.runner:null,runtime:e.runtime??null,originUrl:e.originUrl??null,isDefault:e.default},n);r(u)||o({result:u},"Backend created")}},mcp:{tool:"fs_backend_create",title:"Create a backend",description:"Create a backend (origin) for a product. Pick a transport mode: direct (public HTTPS URL, secured by Ed25519 request signing) or tunnel (private outbound-only cloudflared, secure bring-your-own-backend). Mark it default to route traffic to it.",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!1},inputSchema:{productId:s.string().describe("The product id to create the backend in."),name:s.string().describe("Backend name (e.g. 'prod-origin')."),slug:s.string().optional().describe("URL-safe slug; derived from name if omitted."),transportMode:s.enum(["direct","tunnel"]).optional().describe("How the gateway reaches the origin; defaults to direct."),originUrl:s.string().optional().describe("The origin URL (for direct mode)."),isDefault:s.boolean().optional().describe("Route traffic to this backend by default."),...He},handler:async(t,e)=>t.builderCreateBackend(e.productId,{name:e.name,slug:e.slug,transportMode:e.transportMode,originUrl:e.originUrl,isDefault:e.isDefault},{idempotencyKey:e.idempotencyKey})}},{opKey:"backend.delete",operationClass:"operate",scope:[ms],sideEffect:"write",cli:{group:"backend",command:"delete",summary:"Delete a backend (revokes its runtime tokens). Requires --yes.",destructive:!0,yesMessage:"Pass --yes to confirm backend deletion.",args:[yn,{field:"backendId",kind:"positional",token:"<backendId>"}],handler:async({client:t,args:e,emit:n})=>{let o=e.productId,r=e.backendId;await t.builderDeleteBackend(o,r),n({productId:o,deleted:r},`Backend ${r} deleted`)}},mcp:{tool:"fs_backend_delete",title:"Delete a backend",description:"Delete a backend (origin). Traffic routed to it stops; re-create to restore.",annotations:{readOnlyHint:!1,destructiveHint:!0,idempotentHint:!0,openWorldHint:!1},inputSchema:{productId:s.string().describe(fs),backendId:s.string().describe("The backend id to delete.")},handler:async(t,{productId:e,backendId:n})=>t.builderDeleteBackend(e,n)}},{opKey:"runtime_token.read",operationClass:"operate",scope:["products:read"],sideEffect:"read",cli:{group:"backend tokens",command:"list",summary:"List runtime tokens for a product",args:[yn],handler:async({client:t,args:e,emit:n})=>{let o=i0(await t.builderListRuntimeTokens(e.productId));n({count:o.length,tokens:o},`${o.length} runtime token(s)`)}},mcp:{tool:"fs_runtime_token_list",title:"List runtime tokens",description:"List a product's runtime tokens (fsrt_) \u2014 id, last-four, capabilities, status. Read-only; secrets are never shown.",annotations:{readOnlyHint:!0,openWorldHint:!1},inputSchema:{productId:s.string().describe(fs)},handler:async(t,{productId:e})=>t.builderListRuntimeTokens(e)}},{opKey:"runtime_token.mint",operationClass:"operate",scope:[ms],sideEffect:"write",cli:{group:"backend tokens",command:"create",summary:"Create a runtime token (returns FS_RUNTIME_TOKEN once)",idempotent:!0,args:[yn,{field:"env",kind:"flag",token:"--env <environment>",describe:"Scope token to an environment name or id"},{field:"backend",kind:"flag",token:"--backend <backendId>",describe:"Bind token to a specific backend"},{field:"kind",kind:"flag",token:"--kind <kind>",describe:"live | test (defaults from env scope)"},{field:"capabilities",kind:"flag",token:"--capabilities <list>",describe:`Comma-separated capabilities: ${qy.join(" | ")}. Default: core's DEFAULT_CAPABILITIES. Use tunnel for tunnel backends.`},{field:"meters",kind:"flag",token:"--meters <list>",describe:"Comma-separated allowed meters (default: all product meters)"},{field:"routes",kind:"flag",token:"--routes <list>",describe:"Comma-separated allowed routes"}],handler:async({client:t,args:e,reqOpts:n,emit:o,emitDryRunPreview:r})=>{let i=e.productId,a=await a0(t,i,e.env),c=e.kind==="test"||e.kind==="live"?e.kind:void 0,u=By(e.capabilities);if(u){for(let l of u)if(!qy.includes(l))throw new O(`Unknown capability "${l}". Available: ${qy.join(", ")}.`,void 0,{code:"UNKNOWN_RUNTIME_TOKEN_CAPABILITY"})}let d=await t.builderCreateRuntimeToken(i,{environmentId:a,backendId:e.backend??null,kind:c,capabilities:u,allowedMeters:By(e.meters),allowedRoutes:By(e.routes)},n);r(d)||o({envVar:"FS_RUNTIME_TOKEN",result:d},"Runtime token created")}},mcp:{tool:"fs_runtime_token_mint",title:"Mint a runtime token",description:"Mint a new runtime token (fsrt_) for a backend. Returns the plaintext token ONCE \u2014 store it now (e.g. as FS_RUNTIME_TOKEN). Capabilities default to the backend's needs (gateway_verification, metering, health).",returnsOneTimeSecret:!0,annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!1},inputSchema:{productId:s.string().describe(fs),backendId:s.string().optional().describe("Bind the token to this backend."),environmentId:s.string().optional().describe("Scope to a preview environment (omit for production)."),kind:s.enum(["live","test"]).optional().describe("Token kind; defaults from the env scope."),capabilities:s.array(s.string()).optional().describe("Capabilities (gateway_verification, metering, health, tunnel)."),...He},handler:async(t,e)=>t.builderCreateRuntimeToken(e.productId,{backendId:e.backendId??null,environmentId:e.environmentId??null,kind:e.kind,capabilities:e.capabilities},{idempotencyKey:e.idempotencyKey})}},{opKey:"runtime_token.rotate",operationClass:"operate",scope:[ms],sideEffect:"write",cli:{group:"backend tokens",command:"rotate",summary:"Rotate a runtime token (returns a fresh FS_RUNTIME_TOKEN once)",args:[yn,{field:"tokenId",kind:"positional",token:"<tokenId>"}],handler:async({client:t,args:e,emit:n})=>{let o=e.productId,r=e.tokenId,i=await t.builderRotateRuntimeToken(o,r);n({envVar:"FS_RUNTIME_TOKEN",result:i},`Runtime token ${r} rotated`)}},mcp:{tool:"fs_runtime_token_rotate",title:"Rotate a runtime token",description:"Rotate a runtime token: mint a fresh secret carrying the same scope and revoke the old one. Returns the new plaintext token ONCE.",returnsOneTimeSecret:!0,annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!1},inputSchema:{productId:s.string().describe(fs),tokenId:s.string().describe("The runtime token id to rotate."),...He},handler:async(t,e)=>t.builderRotateRuntimeToken(e.productId,e.tokenId,{idempotencyKey:e.idempotencyKey})}},{opKey:"runtime_token.revoke",operationClass:"operate",scope:[ms],sideEffect:"write",cli:{group:"backend tokens",command:"revoke",summary:"Revoke a runtime token. Requires --yes.",destructive:!0,yesMessage:"Pass --yes to confirm runtime token revocation.",args:[yn,{field:"tokenId",kind:"positional",token:"<tokenId>"}],handler:async({client:t,args:e,emit:n})=>{let o=e.productId,r=e.tokenId;await t.builderRevokeRuntimeToken(o,r),n({productId:o,revoked:r},`Runtime token ${r} revoked`)}},mcp:{tool:"fs_runtime_token_revoke",title:"Revoke a runtime token",description:"Revoke a runtime token. The backend using it stops verifying.",annotations:{readOnlyHint:!1,destructiveHint:!0,idempotentHint:!0,openWorldHint:!1},inputSchema:{productId:s.string().describe(fs),tokenId:s.string().describe("The runtime token id to revoke.")},handler:async(t,{productId:e,tokenId:n})=>t.builderRevokeRuntimeToken(e,n)}}];var Kd="The business id or slug.",Hy="Scope to a preview environment (omit for production).",Ky={field:"productId",kind:"positional",token:"<businessIdOrSlug>",describe:Kd,resolveProduct:!0},Gy={field:"env",kind:"flag",token:"--env <environmentId>",describe:"Scope to a preview environment id (omit for production)."};async function Wy(t,e){return ve(t,e)}var c0=[{opKey:"frontend.deploy",operationClass:"operate",scope:["products:update"],sideEffect:"write",cli:{group:"frontend",command:"deploy",summary:"Trigger a frontend build (deploy) for a product's connected repo",idempotent:!0,args:[Ky,Gy,{field:"ref",kind:"flag",token:"--ref <ref>",describe:"Git ref to build (defaults to the env branch / repo default)."},{field:"buildCmd",kind:"flag",token:"--build-cmd <cmd>",describe:"Override the build command."}],handler:async({client:t,args:e,reqOpts:n,emit:o,emitDryRunPreview:r})=>{let i=await t.builderFrontendDeploy(e.productId,{ref:e.ref,buildCmd:e.buildCmd,environmentId:e.env},n);r(i)||o({result:i},"Frontend build triggered")}},mcp:{tool:"fs_frontend_deploy",title:"Deploy a product frontend",description:"Trigger a Managed Frontend Hosting build for the product's connected repo (production by default; pass environmentId for a preview env). Returns the enqueued build.",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},inputSchema:{productId:s.string().describe(Kd),ref:s.string().optional().describe("Git ref to build (defaults to the env branch / repo default)."),buildCmd:s.string().optional().describe("Override the build command."),environmentId:s.string().optional().describe(Hy),...He},handler:async(t,e)=>{let n=await Wy(t,e.productId);return t.builderFrontendDeploy(n,{ref:e.ref,buildCmd:e.buildCmd,environmentId:e.environmentId},{idempotencyKey:e.idempotencyKey})}}},{opKey:"frontend.status",operationClass:"operate",scope:["products:read"],sideEffect:"read",cli:{group:"frontend",command:"status",summary:"Show the current frontend release, recent releases, and recent builds (incl. failure reasons)",args:[Ky,Gy],handler:async({client:t,args:e,emit:n})=>{let o=await t.builderFrontendStatus(e.productId,e.env);n(o,"Frontend status")}},mcp:{tool:"fs_frontend_status",title:"Get frontend status",description:"Read a product's current frontend serve state (uiMode, active release hash + producing build, pin flag), the recent SUCCEEDED releases (rollback targets), and the recent builds \u2014 a FAILED build's `error` explains why a deploy didn't go live. Read-only.",annotations:{readOnlyHint:!0,openWorldHint:!1},inputSchema:{productId:s.string().describe(Kd),environmentId:s.string().optional().describe(Hy)},handler:async(t,e)=>{let n=await Wy(t,e.productId);return t.builderFrontendStatus(n,e.environmentId)}}},{opKey:"frontend.rollback",operationClass:"operate",scope:["products:update"],sideEffect:"write",cli:{group:"frontend",command:"rollback",summary:"Roll the product frontend back to a prior release (re-activate its releaseId)",idempotent:!0,args:[Ky,{field:"releaseId",kind:"flag",token:"--release-id <releaseId>",describe:"The prior release id (manifest hash) to re-activate \u2014 see `frontend status`.",required:!0},Gy],handler:async({client:t,args:e,reqOpts:n,emit:o,emitDryRunPreview:r})=>{let i=await t.builderFrontendRollback(e.productId,{releaseId:e.releaseId,environmentId:e.env},n);r(i)||o({result:i},"Frontend rolled back")}},mcp:{tool:"fs_frontend_rollback",title:"Roll back a product frontend",description:"Roll a product's frontend back to a prior release by its releaseId (manifest hash, from fs_frontend_status). Flips the live pointer back and pins it. The releaseId must belong to this target's build history.",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},inputSchema:{productId:s.string().describe(Kd),releaseId:s.string().describe("The prior release id (manifest hash) to re-activate."),environmentId:s.string().optional().describe(Hy),...He},handler:async(t,e)=>{let n=await Wy(t,e.productId);return t.builderFrontendRollback(n,{releaseId:e.releaseId,environmentId:e.environmentId},{idempotencyKey:e.idempotencyKey})}}}];var u0=[{opKey:"usage.read",operationClass:"operate",scope:["products:read"],sideEffect:"read",cli:{group:"usage",command:"summary",summary:"Show usage summary for the last 30 days",args:[{field:"productId",kind:"positional",token:"<productIdOrName>",resolveProduct:!0}],handler:async({client:t,args:e,emit:n})=>{let o=e.productId,r=await t.managementGetUsage(o);n({productId:o,summary:r},"Usage summary")}},mcp:{tool:"fs_usage_read",title:"Read usage summary",description:"Read a product's usage summary \u2014 metered request counts and tier utilization. Read-only.",annotations:{readOnlyHint:!0,openWorldHint:!1},inputSchema:{productId:s.string().describe("The product id whose usage to read.")},handler:async(t,{productId:e})=>t.managementGetUsage(e)}}];var l0=[{opKey:"persona.bootstrap",operationClass:"operate",scope:["products:read"],sideEffect:"write",cli:{group:"persona",command:"bootstrap",summary:"Issue a fresh fsk_test_ API key in a test environment",args:[{field:"productId",kind:"positional",token:"<productIdOrName>",resolveProduct:!0},{field:"env",kind:"flag",token:"--env <env>",describe:"Environment name (must be test-strategy)",required:!0},{field:"plan",kind:"flag",token:"--plan <planKey>",describe:"Plan key to assign (e.g. starter)"},{field:"displayName",kind:"flag",token:"--display-name <name>",describe:"Persona display name"}],handler:async({client:t,args:e,emit:n})=>{let o=e.productId,r=await Jy(t,o,e.env),i=await t.issuePersonaBootstrapKey(o,r,{planKey:e.plan,displayName:e.displayName});n({productId:o,environmentId:r,result:i},"Persona bootstrapped")}},mcp:{tool:"fs_persona_bootstrap",title:"Bootstrap a test persona",description:"Issue a one-time test bootstrap key for a product environment \u2014 use it to provision a test persona. Returns the key ONCE; store it now.",returnsOneTimeSecret:!0,annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!1},inputSchema:{productId:s.string().describe("The product id."),environmentId:s.string().describe("The environment id to scope the persona to.")},handler:async(t,{productId:e,environmentId:n})=>t.issuePersonaBootstrapKey(e,n)}},{opKey:"persona.read",operationClass:"operate",scope:["products:read"],sideEffect:"read",cli:{group:"persona",command:"list",summary:"List personas for a test environment",args:[{field:"productId",kind:"positional",token:"<productIdOrName>",resolveProduct:!0},{field:"env",kind:"flag",token:"--env <env>",describe:"Environment name",required:!0}],handler:async({client:t,args:e,emit:n})=>{let o=e.productId,r=await Jy(t,o,e.env),i=await t.listPersonas(o,r);n({productId:o,environmentId:r,result:i},"Personas")}},mcp:{tool:"fs_persona_list",title:"List personas",description:"List a product environment's test personas (id, label, status). Read-only.",annotations:{readOnlyHint:!0,openWorldHint:!1},inputSchema:{productId:s.string().describe("The product id."),environmentId:s.string().describe("The environment id whose personas to list.")},handler:async(t,{productId:e,environmentId:n})=>t.listPersonas(e,n)}},{opKey:"persona.revoke",operationClass:"operate",scope:["products:update"],sideEffect:"write",cli:{group:"persona",command:"revoke",summary:"Revoke a persona's API key",args:[{field:"productId",kind:"positional",token:"<productIdOrName>",resolveProduct:!0},{field:"personaId",kind:"positional",token:"<personaId>"},{field:"env",kind:"flag",token:"--env <env>",describe:"Environment name",required:!0}],handler:async({client:t,args:e,emit:n})=>{let o=e.productId,r=e.personaId,i=await Jy(t,o,e.env),a=await t.revokePersona(o,i,r);n({productId:o,environmentId:i,result:a},`Persona ${r} revoked`)}},mcp:{tool:"fs_persona_revoke",title:"Revoke a persona",description:"Revoke a test persona. Its credentials stop working.",annotations:{readOnlyHint:!1,destructiveHint:!0,idempotentHint:!0,openWorldHint:!1},inputSchema:{productId:s.string().describe("The product id."),environmentId:s.string().describe("The environment id."),personaId:s.string().describe("The persona id to revoke.")},handler:async(t,{productId:e,environmentId:n,personaId:o})=>t.revokePersona(e,n,o)}}];async function Jy(t,e,n){try{return await _n(t,e,n)}catch(o){throw new O(o instanceof Error?o.message:`Environment "${n}" not found on product ${e}.`,void 0,{code:"ENV_NOT_FOUND"})}}function u6(t){if(!t||typeof t!="object")return[];let e=t;return Array.isArray(e.data)?e.data:Array.isArray(e.tokens)?e.tokens:Array.isArray(t)?t:[]}var d0=[{opKey:"maker_token.read",operationClass:"operate",scope:[],sideEffect:"read",cli:{group:"token",command:"list",summary:"List maker tokens in the current org",args:[],handler:async({client:t,emit:e})=>{let n=u6(await t.managementListMakerTokens());e({count:n.length,tokens:n.map(o=>({id:o.id,name:o.name??null,scopes:o.scopes??[],productId:o.productId??null,lastFour:o.lastFour??null,createdAt:o.createdAt??null,revokedAt:o.revokedAt??null}))},`${n.length} token(s)`)}},mcp:{tool:"fs_maker_token_list",title:"List maker tokens",description:"List the workspace's maker tokens (mk_) \u2014 id, label, scopes, last-four, status. Read-only; secrets are never shown. Creating/revoking maker tokens is intentionally not exposed via MCP.",annotations:{readOnlyHint:!0,openWorldHint:!1},inputSchema:{},handler:async t=>t.managementListMakerTokens()}},{opKey:"maker_token.create",operationClass:"operate",scope:["products:update"],sideEffect:"write",cli:{group:"token",command:"create",summary:"Create a new maker token (returns the secret once)",args:[{field:"name",kind:"flag",token:"--name <name>",describe:"Human-friendly token name",required:!0},{field:"scope",kind:"flag",token:"--scope <scope...>",describe:"Scope(s) to attach (e.g. products:update products:publish)"},{field:"product",kind:"flag",token:"--product <productId>",describe:"Scope to a specific product"},{field:"restrict",kind:"flag",token:"--restrict <perm...>",describe:"Narrow the token's role bundle to these permissions (e.g. business:read plan:read). Must be within your own permissions."}],handler:async({client:t,args:e,emit:n})=>{let o=await t.managementCreateMakerToken({name:e.name,scopes:e.scope,productId:e.product,restrictedPermissions:e.restrict});n({result:o},"Token created")}},mcp:null},{opKey:"maker_token.revoke",operationClass:"operate",scope:["products:update"],sideEffect:"write",cli:{group:"token",command:"revoke",summary:"Revoke a maker token. Requires --yes.",destructive:!0,yesMessage:"Pass --yes to confirm token revocation.",args:[{field:"tokenId",kind:"positional",token:"<tokenId>"}],handler:async({client:t,args:e,emit:n})=>{let o=e.tokenId;await t.managementRevokeMakerToken(o),n({revoked:o},`Token ${o} revoked`)}},mcp:null},{opKey:"maker_token.rotate",operationClass:"operate",scope:["products:update"],sideEffect:"write",cli:{group:"token",command:"rotate",summary:"Rotate a maker token secret (returns the new secret once)",idempotent:!0,args:[{field:"tokenId",kind:"positional",token:"<tokenId>"},{field:"syncToGithub",kind:"flag",token:"--sync-to-github",describe:"Also update the connected GitHub repo FARTHERSHORE_TOKEN secret when this is a platform token"}],handler:async({client:t,args:e,reqOpts:n,emit:o})=>{let r=e.tokenId,i=await t.managementRotateMakerToken(r,{syncToGithub:e.syncToGithub===!0},n);o({result:i},`Token ${r} rotated`)}},mcp:null},{opKey:"maker_token.hard_delete",operationClass:"operate",scope:["products:update"],sideEffect:"write",cli:{group:"token",command:"delete",summary:"Permanently delete an already-revoked maker token. Requires --yes.",destructive:!0,yesMessage:"Pass --yes to permanently delete the revoked token row.",args:[{field:"tokenId",kind:"positional",token:"<tokenId>"}],handler:async({client:t,args:e,emit:n})=>{let o=e.tokenId;await t.managementHardDeleteMakerToken(o),n({deleted:o},`Token ${o} permanently deleted`)}},mcp:null}];var p0=[{opKey:"apply_timeline.list",operationClass:"operate",scope:["products:read"],sideEffect:"read",cli:{group:"apply-timeline",command:"list",summary:"List a business's Apply Timeline: repo-triggered manifest applies (PRs, pushes, releases), checks, semantic diffs, and apply phases.",args:[{field:"productId",kind:"positional",token:"<businessIdOrName>",resolveProduct:!0},{field:"env",kind:"flag",token:"--env <env>",describe:"Environment scope: production, all, or a preview environment name."}],handler:async({client:t,args:e,emit:n})=>{let o=e.productId,r=await t.listApplyTimeline(o,{env:e.env});n({productId:o,count:r.data.length,applyTimeline:r.data},`${r.data.length} apply timeline entr(ies)`)}},mcp:null},{opKey:"apply_timeline.read",operationClass:"operate",scope:["products:read"],sideEffect:"read",cli:{group:"apply-timeline",command:"inspect",summary:"Inspect one Apply Timeline entry by id, PR number, branch, or commit SHA.",args:[{field:"productId",kind:"positional",token:"<businessIdOrName>",resolveProduct:!0},{field:"selector",kind:"positional",token:"<id|pr|branch|sha>"},{field:"env",kind:"flag",token:"--env <env>",describe:"Environment scope: production, all, or a preview environment name."}],handler:async({client:t,args:e,emit:n})=>{let o=e.productId,r=String(e.selector),i=await t.listApplyTimeline(o,{env:e.env}),a=i.data.find(c=>c.id===r)??i.data.find(c=>c.prNumber!==null&&String(c.prNumber)===r)??i.data.find(c=>c.branch===r)??i.data.find(c=>c.commitSha.startsWith(r));if(!a)throw new O(`Apply timeline entry ${r} was not found.`,404,{code:"APPLY_TIMELINE_ENTRY_NOT_FOUND"});n({productId:o,applyTimelineEntry:a},`Apply timeline entry ${a.id}: ${a.status}`)}},mcp:null}];var hs="The business id or slug.",gs="The subscriber (client org) id \u2014 from `consumer list`.",Yy="The governed ChangeSet id.",Gd={field:"productId",kind:"positional",token:"<businessIdOrSlug>",describe:hs,resolveProduct:!0},Wd={field:"subscriberId",kind:"positional",token:"<subscriberId>",describe:gs},m0={field:"changeSetId",kind:"positional",token:"<changeSetId>",describe:Yy},Jd={field:"env",kind:"flag",token:"--env <env>",describe:"Environment name/id to scope the proposal to."};function l6(t){let e;try{e=JSON.parse(t)}catch{throw new O("--operations must be a JSON array of governed operations.",0,{code:"INVALID_OPERATIONS"})}if(!Array.isArray(e))throw new O("--operations must be a JSON array.",0,{code:"INVALID_OPERATIONS"});return e}async function Yd(t,e){return ve(t,e)}var f0=[{opKey:"change_set.propose",operationClass:"operate",scope:["products:update"],sideEffect:"write",cli:{group:"proposal",command:"create",summary:"Propose a governed ChangeSet against a subscriber (agent/builder proposer; a human approves + applies in the portal)",idempotent:!0,args:[Gd,Wd,{field:"intent",kind:"flag",token:"--intent <intent>",describe:"Human-readable description of the proposed change.",required:!0},{field:"operations",kind:"flag",token:"--operations <json>",describe:"JSON array of governed operations (e.g. update_role_permissions).",required:!0,parser:t=>l6(t)},Jd],handler:async({client:t,args:e,reqOpts:n,emit:o,emitDryRunPreview:r})=>{let i=e.productId,a=e.subscriberId,c=await t.proposeConsumerChangeSet(i,a,{intent:e.intent,operations:e.operations,...n.idempotencyKey?{idempotencyKey:n.idempotencyKey}:{}},{env:e.env},n);r(c)||o(c,"ChangeSet proposed")}},mcp:{tool:"fs_proposal_create",title:"Propose a governed ChangeSet",description:"Propose a governed ChangeSet against a subscriber's live RBAC state (Agent Proposal Flow). Creates a DRAFT proposal that a HUMAN in the subscriber org must preview, approve, and apply in the portal \u2014 an agent can propose but never self-approve or apply. Operate-class live-state action; does not edit repo-authored business behavior.",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!0},inputSchema:{productId:s.string().describe(hs),subscriberId:s.string().describe(gs),intent:s.string().describe("Human-readable description of the proposed change."),operations:s.array(s.record(s.string(),s.unknown())).describe("Governed operations, e.g. [{ type: 'update_role_permissions', schemaVersion: 1, target: { resourceType: 'subscriber_product_role', resourceId: '<roleKey>' }, payload: { permissions: [...] } }]."),env:s.string().optional().describe("Environment name/id to scope the proposal to."),idempotencyKey:s.string().optional().describe("Replay-safe idempotency key for the proposal.")},handler:async(t,e)=>{let n=await Yd(t,e.productId);return t.proposeConsumerChangeSet(n,e.subscriberId,{intent:e.intent,operations:e.operations,...e.idempotencyKey?{idempotencyKey:e.idempotencyKey}:{}},{env:e.env})}}},{opKey:"change_set.preview",operationClass:"operate",scope:["products:update"],sideEffect:"write",cli:{group:"proposal",command:"preview",summary:"Simulate + store a preview on a proposed ChangeSet (rides the propose authority)",args:[Gd,Wd,m0,Jd],handler:async({client:t,args:e,emit:n})=>{let o=e.productId,r=await t.previewConsumerChangeSet(o,e.subscriberId,e.changeSetId,{env:e.env});n(r,"ChangeSet preview stored")}},mcp:{tool:"fs_proposal_preview",title:"Preview a proposed ChangeSet",description:"Simulate the impact of a proposed ChangeSet and store the preview (Agent Proposal Flow). Enforced by the same authority as propose \u2014 there is no separate preview permission. Read-shaped but writes the stored simulation; does not apply the change.",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!0},inputSchema:{productId:s.string().describe(hs),subscriberId:s.string().describe(gs),changeSetId:s.string().describe(Yy),env:s.string().optional().describe("Environment name/id.")},handler:async(t,e)=>{let n=await Yd(t,e.productId);return t.previewConsumerChangeSet(n,e.subscriberId,e.changeSetId,{env:e.env})}}},{opKey:"change_set.proposal_list",operationClass:"operate",scope:["products:read"],sideEffect:"read",cli:{group:"proposal",command:"list",summary:"List governed ChangeSets proposed against a subscriber",args:[Gd,Wd,{field:"status",kind:"flag",token:"--status <status>",describe:"Filter by status (e.g. draft, approval_required)."},Jd],handler:async({client:t,args:e,emit:n})=>{let o=e.productId,r=await t.listConsumerChangeSets(o,e.subscriberId,{env:e.env,status:e.status});n(r,"Proposed ChangeSets")}},mcp:{tool:"fs_proposal_list",title:"List proposed ChangeSets",description:"List governed ChangeSets proposed against a subscriber (Agent Proposal Flow). Read-only; use it to discover proposal ids + their status before previewing.",annotations:{readOnlyHint:!0,openWorldHint:!0},inputSchema:{productId:s.string().describe(hs),subscriberId:s.string().describe(gs),status:s.string().optional().describe("Filter by status (e.g. draft, approval_required)."),env:s.string().optional().describe("Environment name/id.")},handler:async(t,e)=>{let n=await Yd(t,e.productId);return t.listConsumerChangeSets(n,e.subscriberId,{env:e.env,status:e.status})}}},{opKey:"change_set.proposal_read",operationClass:"operate",scope:["products:read"],sideEffect:"read",cli:{group:"proposal",command:"get",summary:"Read one governed ChangeSet proposed against a subscriber",args:[Gd,Wd,m0,Jd],handler:async({client:t,args:e,emit:n})=>{let o=e.productId,r=await t.getConsumerChangeSet(o,e.subscriberId,e.changeSetId,{env:e.env});n(r,"ChangeSet")}},mcp:{tool:"fs_proposal_get",title:"Read a proposed ChangeSet",description:"Read one governed ChangeSet proposed against a subscriber (Agent Proposal Flow) \u2014 its operations, risk, simulation, approvals, and status. Read-only.",annotations:{readOnlyHint:!0,openWorldHint:!0},inputSchema:{productId:s.string().describe(hs),subscriberId:s.string().describe(gs),changeSetId:s.string().describe(Yy),env:s.string().optional().describe("Environment name/id.")},handler:async(t,e)=>{let n=await Yd(t,e.productId);return t.getConsumerChangeSet(n,e.subscriberId,e.changeSetId,{env:e.env})}}}];var vn="The business id or slug.",_s="The webhook endpoint id.",Xo="billing:manage",Qo={field:"productId",kind:"positional",token:"<businessIdOrSlug>",describe:vn,resolveProduct:!0},Xd={field:"webhookId",kind:"positional",token:"<webhookId>",describe:_s},h0={field:"events",kind:"flag",token:"--events <events>",describe:"Comma-separated event names, e.g. subscription.created,payment.failed"},g0={field:"limit",kind:"flag",token:"--limit <n>",describe:"Max rows to return."};function _0(t){if(typeof t!="string")return;let e=t.split(",").map(n=>n.trim()).filter(n=>n.length>0);return e.length>0?e:void 0}function y0(t){if(!t||typeof t!="object")return[];let e=t;return Array.isArray(e.data)?e.data:[]}function v0(t,e){if(!t||typeof t!="object")return e;let n=t;return typeof n.total=="number"?n.total:typeof n.pagination?.total=="number"?n.pagination.total:e}function d6(t){let e=t.enable===!0,n=t.disable===!0;if(e&&n)throw new O("Pass either --enable or --disable, not both.",400,{code:"VALIDATION_ERROR",param:"enabled"});if(e)return!0;if(n)return!1}async function ei(t,e){return ve(t,e)}var b0=[{opKey:"webhook.read",operationClass:"operate",scope:[Xo],sideEffect:"read",cli:{group:"webhook",command:"list",summary:"List API-managed webhook endpoints",args:[Qo,g0],handler:async({client:t,args:e,emit:n})=>{let o=e.productId,r=await t.managementListWebhooks(o,{limit:e.limit}),i=y0(r);n({productId:o,count:i.length,total:v0(r,i.length),webhooks:i},`${i.length} webhook(s)`)}},mcp:{tool:"fs_webhook_list",title:"List webhook endpoints",description:"List API-managed outbound webhook endpoints for a business. Read-only; signing secrets are never returned.",annotations:{readOnlyHint:!0,openWorldHint:!1},inputSchema:{productId:s.string().describe(vn),limit:s.string().optional().describe("Max rows to return.")},handler:async(t,e)=>{let n=await ei(t,e.productId);return t.managementListWebhooks(n,{limit:e.limit})}}},{opKey:"webhook.create",operationClass:"operate",scope:[Xo],sideEffect:"write",cli:{group:"webhook",command:"create",summary:"Create an API-managed webhook endpoint",idempotent:!0,args:[Qo,{field:"url",kind:"flag",token:"--url <url>",describe:"HTTPS receiver URL.",required:!0},{...h0,required:!0}],handler:async({client:t,args:e,reqOpts:n,emit:o,emitDryRunPreview:r})=>{let i=_0(e.events);if(!i)throw new O("At least one webhook event is required.",400,{code:"VALIDATION_ERROR",param:"events"});let a=await t.managementCreateWebhook(e.productId,{url:e.url,events:i},n);r(a)||o({productId:e.productId,webhook:a.data},"Webhook endpoint created")}},mcp:{tool:"fs_webhook_create",title:"Create webhook endpoint",description:"Create an API-managed outbound webhook endpoint for a business. Returns the signing secret once. If webhooks are declared in business/business.ts, Core returns 409 MANAGED_BY_CODE and the repo must be edited instead.",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!0},returnsOneTimeSecret:!0,inputSchema:{productId:s.string().describe(vn),url:s.string().url().describe("HTTPS receiver URL."),events:s.array(s.string()).min(1).describe("Webhook event names to subscribe to."),...He},handler:async(t,e)=>{let n=await ei(t,e.productId);return t.managementCreateWebhook(n,{url:e.url,events:e.events},{idempotencyKey:e.idempotencyKey})}}},{opKey:"webhook.update",operationClass:"operate",scope:[Xo],sideEffect:"write",cli:{group:"webhook",command:"update",summary:"Update a webhook endpoint's events or enabled state",idempotent:!0,args:[Qo,Xd,h0,{field:"enable",kind:"flag",token:"--enable",describe:"Enable delivery for this endpoint."},{field:"disable",kind:"flag",token:"--disable",describe:"Disable delivery for this endpoint."}],handler:async({client:t,args:e,reqOpts:n,emit:o,emitDryRunPreview:r})=>{let i=_0(e.events),a=d6(e);if(!i&&a===void 0)throw new O("Pass --events, --enable, or --disable to update a webhook.",400,{code:"VALIDATION_ERROR"});let c=await t.managementUpdateWebhook(e.productId,e.webhookId,{...i?{events:i}:{},...a!==void 0?{enabled:a}:{}},n);r(c)||o({productId:e.productId,webhook:c.data},"Webhook endpoint updated")}},mcp:{tool:"fs_webhook_update",title:"Update webhook endpoint",description:"Update an API-managed webhook endpoint's event list and/or enabled state. URL and secret are immutable; create a new endpoint for those changes.",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},inputSchema:{productId:s.string().describe(vn),webhookId:s.string().describe(_s),events:s.array(s.string()).min(1).optional().describe("Replacement webhook event list."),enabled:s.boolean().optional().describe("Enable or disable delivery."),...He},handler:async(t,e)=>{let n=await ei(t,e.productId);return t.managementUpdateWebhook(n,e.webhookId,{events:e.events,enabled:e.enabled},{idempotencyKey:e.idempotencyKey})}}},{opKey:"webhook.delete",operationClass:"operate",scope:[Xo],sideEffect:"write",cli:{group:"webhook",command:"delete",summary:"Delete an API-managed webhook endpoint. Requires --yes.",destructive:!0,yesMessage:"Pass --yes to confirm webhook endpoint deletion.",args:[Qo,Xd],handler:async({client:t,args:e,emit:n})=>{await t.managementDeleteWebhook(e.productId,e.webhookId),n({productId:e.productId,deleted:e.webhookId},"Webhook endpoint deleted")}},mcp:{tool:"fs_webhook_delete",title:"Delete webhook endpoint",description:"Delete an API-managed outbound webhook endpoint. If webhooks are repo-managed, Core returns 409 MANAGED_BY_CODE.",annotations:{readOnlyHint:!1,destructiveHint:!0,openWorldHint:!1},inputSchema:{productId:s.string().describe(vn),webhookId:s.string().describe(_s)},handler:async(t,e)=>{let n=await ei(t,e.productId);return t.managementDeleteWebhook(n,e.webhookId)}}},{opKey:"webhook.test",operationClass:"operate",scope:[Xo],sideEffect:"write",cli:{group:"webhook",command:"test",summary:"Send a signed test event to a webhook endpoint",args:[Qo,Xd],handler:async({client:t,args:e,emit:n})=>{let o=await t.managementTestWebhook(e.productId,e.webhookId);n({productId:e.productId,result:o},"Webhook test sent")}},mcp:{tool:"fs_webhook_test",title:"Test webhook endpoint",description:"Send a signed test event to an API-managed webhook endpoint and persist the delivery result.",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!0},inputSchema:{productId:s.string().describe(vn),webhookId:s.string().describe(_s)},handler:async(t,e)=>{let n=await ei(t,e.productId);return t.managementTestWebhook(n,e.webhookId)}}},{opKey:"webhook.delivery.read",operationClass:"operate",scope:[Xo],sideEffect:"read",cli:{group:"webhook",command:"deliveries",summary:"List recent delivery attempts for a webhook endpoint",args:[Qo,Xd,g0],handler:async({client:t,args:e,emit:n})=>{let o=await t.managementListWebhookDeliveries(e.productId,e.webhookId,{limit:e.limit}),r=y0(o);n({productId:e.productId,webhookId:e.webhookId,count:r.length,total:v0(o,r.length),deliveries:r},`${r.length} delivery attempt(s)`)}},mcp:{tool:"fs_webhook_deliveries",title:"List webhook deliveries",description:"List recent delivery attempts for a webhook endpoint. Payload and response body are intentionally omitted by Core.",annotations:{readOnlyHint:!0,openWorldHint:!1},inputSchema:{productId:s.string().describe(vn),webhookId:s.string().describe(_s),limit:s.string().optional().describe("Max rows to return.")},handler:async(t,e)=>{let n=await ei(t,e.productId);return t.managementListWebhookDeliveries(n,e.webhookId,{limit:e.limit})}}}];var ti="The business id or slug.",Fr="operator",ys={field:"productId",kind:"positional",token:"<businessIdOrSlug>",describe:ti,resolveProduct:!0};async function vs(t,e){return ve(t,e)}var k0=[{opKey:"agents.list",operationClass:"operate",scope:["products:read"],sideEffect:"read",cli:{group:"agents",command:"list",summary:"List a business's operating agents + enableable roles",args:[ys],handler:async({client:t,args:e,emit:n})=>{let o=e.productId,r=await t.builderListAgents(o);n({productId:o,...r},`${r.agents.length} agent(s) \u2014 enableable roles: ${r.availableRoles.join(", ")}`)}},mcp:{tool:"fs_agents_list",title:"List operating agents",description:"The agent roster for a business: the enabled/disabled Operator plus any roles that can still be enabled. Read-only.",annotations:{readOnlyHint:!0,openWorldHint:!1},inputSchema:{productId:s.string().describe(ti)},handler:async(t,e)=>{let n=await vs(t,e.productId);return t.builderListAgents(n)}}},{opKey:"agents.status",operationClass:"operate",scope:["products:read"],sideEffect:"read",cli:{group:"agents",command:"status",summary:"The Operator's activation state, recent runs, and usage totals",args:[ys],handler:async({client:t,args:e,emit:n})=>{let o=e.productId,r=await t.builderAgentStatus(o,Fr);n({productId:o,...r},`operator: ${r.enabled?"ENABLED":"disabled"} \u2014 last run ${r.lastRunAt??"never"}; ${r.recentRuns.length} recent run(s); ${r.usage.tokensIn+r.usage.tokensOut} tokens, ${r.usage.actionsCount} action(s) lifetime`)}},mcp:{tool:"fs_agents_status",title:"Get the Operator's status",description:"The Operator's activation state, recent run history (newest-first), and lifetime usage totals (LLM tokens + actions). Read-only.",annotations:{readOnlyHint:!0,openWorldHint:!1},inputSchema:{productId:s.string().describe(ti)},handler:async(t,e)=>{let n=await vs(t,e.productId);return t.builderAgentStatus(n,Fr)}}},{opKey:"agents.runs.show",operationClass:"operate",scope:["products:read"],sideEffect:"read",cli:{group:"agents",command:"runs-show",summary:"One run's full paper trail: trace, launches, action receipts",args:[ys,{field:"runId",kind:"positional",token:"<runId>",describe:"The agent run id (from `agents status`)."}],handler:async({client:t,args:e,emit:n})=>{let o=e.productId,r=await t.builderAgentRunDetail(o,Fr,e.runId),i=r.launches?.length??0,a=r.actions?.length??0;n({productId:o,...r},`run ${r.run?.id}: ${i} launch(es), ${a} action receipt(s)`)}},mcp:{tool:"fs_agents_run_show",title:"Get one agent run's paper trail",description:"One run's full audit view: the orchestrator's trace summary (composed launches, verify flags, catalog changes), the per-launch performance ledger, and every platform-action receipt. Read-only.",annotations:{readOnlyHint:!0,openWorldHint:!1},inputSchema:{productId:s.string().describe(ti),runId:s.string().describe("The agent run id.")},handler:async(t,e)=>{let n=await vs(t,e.productId);return t.builderAgentRunDetail(n,Fr,e.runId)}}},{opKey:"agents.enable",operationClass:"operate",scope:["products:update"],sideEffect:"write",cli:{group:"agents",command:"enable",summary:"Turn the Operator on (creates it on first enable)",args:[ys],handler:async({client:t,args:e,emit:n})=>{let o=e.productId,r=await t.builderConfigureAgent(o,Fr,{enabled:!0});n({productId:o,agent:r},"operator ENABLED \u2014 it runs autonomously on its cadence and posts to the bulletin; usage bills while enabled")}},mcp:{tool:"fs_agents_enable",title:"Enable the Operator",description:"Turn the business's Operator agent on (created on first enable). It runs autonomously on its cadence; agent-work billing accrues while enabled.",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},inputSchema:{productId:s.string().describe(ti)},handler:async(t,e)=>{let n=await vs(t,e.productId);return t.builderConfigureAgent(n,Fr,{enabled:!0})}}},{opKey:"agents.disable",operationClass:"operate",scope:["products:update"],sideEffect:"write",cli:{group:"agents",command:"disable",summary:"Turn the Operator off (stops runs + billing)",args:[ys],handler:async({client:t,args:e,emit:n})=>{let o=e.productId,r=await t.builderConfigureAgent(o,Fr,{enabled:!1});n({productId:o,agent:r},"operator disabled \u2014 no further runs; billing stops accruing")}},mcp:{tool:"fs_agents_disable",title:"Disable the Operator",description:"Turn the Operator off: the dispatcher stops scheduling runs and agent-work billing stops accruing. Re-enable at any time.",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},inputSchema:{productId:s.string().describe(ti)},handler:async(t,e)=>{let n=await vs(t,e.productId);return t.builderConfigureAgent(n,Fr,{enabled:!1})}}}];var bs="The business id or slug.",tp="The bulletin post id.",Qd={field:"productId",kind:"positional",token:"<businessIdOrSlug>",describe:bs,resolveProduct:!0},Xy={field:"postId",kind:"positional",token:"<postId>",describe:tp};async function ep(t,e){return ve(t,e)}var x0=[{opKey:"bulletin.list",operationClass:"operate",scope:["products:read"],sideEffect:"read",cli:{group:"bulletin",command:"list",summary:"List the agents' bulletin feed (trends + change requests)",args:[Qd,{field:"kind",kind:"flag",token:"--kind <kind>",describe:"Filter: trend | insight | change_request"},{field:"status",kind:"flag",token:"--status <status>",describe:"Filter: open | acknowledged | resolved"},{field:"limit",kind:"flag",token:"--limit <n>",describe:"Max rows to return."}],handler:async({client:t,args:e,emit:n})=>{let o=e.productId,r=await t.builderListBulletin(o,{kind:e.kind,status:e.status,limit:e.limit});n({productId:o,...r},`${r.items.length} post(s)${r.nextCursor?" (more available)":""}`)}},mcp:{tool:"fs_bulletin_list",title:"List bulletin posts",description:"The agents' bulletin feed for a business: trend/insight posts (aggregated data + deltas) and change_request posts (the coding agent's backlog \u2014 filter --kind change_request --status open). Read-only.",annotations:{readOnlyHint:!0,openWorldHint:!1},inputSchema:{productId:s.string().describe(bs),kind:s.enum(["trend","insight","change_request"]).optional().describe("Filter by post kind."),status:s.enum(["open","acknowledged","resolved"]).optional().describe("Filter by post status."),limit:s.string().optional().describe("Max rows to return.")},handler:async(t,e)=>{let n=await ep(t,e.productId);return t.builderListBulletin(n,{kind:e.kind,status:e.status,limit:e.limit})}}},{opKey:"bulletin.read",operationClass:"operate",scope:["products:read"],sideEffect:"read",cli:{group:"bulletin",command:"show",summary:"Show one bulletin post (full body + data payload)",args:[Qd,Xy],handler:async({client:t,args:e,emit:n})=>{let o=e.productId,r=await t.builderGetBulletinPost(o,e.postId);n({productId:o,post:r},`[${r.kind}] ${r.title} \u2014 ${r.status}${r.changeSetId?` (changeSet ${r.changeSetId})`:""}`)}},mcp:{tool:"fs_bulletin_show",title:"Show a bulletin post",description:"One bulletin post in full: markdown body, the dataJson payload backing the claim, and for change requests the referenced ChangeSet id + proposal. Read-only.",annotations:{readOnlyHint:!0,openWorldHint:!1},inputSchema:{productId:s.string().describe(bs),postId:s.string().describe(tp)},handler:async(t,e)=>{let n=await ep(t,e.productId);return t.builderGetBulletinPost(n,e.postId)}}},{opKey:"bulletin.ack",operationClass:"operate",scope:["products:update"],sideEffect:"write",cli:{group:"bulletin",command:"ack",summary:"Acknowledge a post (the coding agent picked it up)",args:[Qd,Xy],handler:async({client:t,args:e,emit:n})=>{let o=e.productId,r=await t.builderSetBulletinStatus(o,e.postId,"acknowledged");n({productId:o,post:r},`Post acknowledged: ${r.title}`)}},mcp:{tool:"fs_bulletin_ack",title:"Acknowledge a bulletin post",description:"Mark a bulletin post acknowledged \u2014 the hand-off signal that the coding agent (or builder) has picked the item up. Forward-only; idempotent on an already-acknowledged post.",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},inputSchema:{productId:s.string().describe(bs),postId:s.string().describe(tp)},handler:async(t,e)=>{let n=await ep(t,e.productId);return t.builderSetBulletinStatus(n,e.postId,"acknowledged")}}},{opKey:"bulletin.resolve",operationClass:"operate",scope:["products:update"],sideEffect:"write",cli:{group:"bulletin",command:"resolve",summary:"Resolve a post (the work landed)",args:[Qd,Xy],handler:async({client:t,args:e,emit:n})=>{let o=e.productId,r=await t.builderSetBulletinStatus(o,e.postId,"resolved");n({productId:o,post:r},`Post resolved: ${r.title}`)}},mcp:{tool:"fs_bulletin_resolve",title:"Resolve a bulletin post",description:"Mark a bulletin post resolved \u2014 the referenced work landed (or the trend was addressed). Terminal state.",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},inputSchema:{productId:s.string().describe(bs),postId:s.string().describe(tp)},handler:async(t,e)=>{let n=await ep(t,e.productId);return t.builderSetBulletinStatus(n,e.postId,"resolved")}}}];var ri="The business id or slug.",np="The promo code id.",ev=["percent_off","amount_off","free_months"],ks="promo-code",xs={field:"productId",kind:"positional",token:"<businessIdOrSlug>",describe:ri,resolveProduct:!0},Qy={field:"promoCodeId",kind:"positional",token:"<promoCodeId>",describe:np},S0={field:"plan",kind:"flag",token:"--plan <planId>",describe:"Limit to a plan id. Repeatable. Omit for all launch plans; use --all-plans on update to clear scoped plans.",parser:(t,e)=>[...e,t],defaultValue:[]};function $0(t){if(typeof t!="string")return;let e=t.trim().toLowerCase();if(ev.includes(e))return e;throw new O(`Invalid promo code kind "${t}". Use percent_off, amount_off, or free_months.`,400,{code:"INVALID_PROMO_CODE_KIND",param:"kind"})}function ni(t,e){if(e===void 0)return;let n=typeof e=="number"?e:typeof e=="string"&&/^\d+$/.test(e.trim())?Number.parseInt(e,10):Number.NaN;if(!Number.isInteger(n)||n<=0)throw new O(`${t} must be a positive integer.`,400,{code:"INVALID_PROMO_CODE_FIELD",param:t});return n}function $s(t){return typeof t=="string"&&t.length>0?t:void 0}function I0(t,e){let n=ni("percent",t.percent),o=ni("amountCents",t.amountCents);if(n!==void 0&&o!==void 0)throw new O("Pass either --percent or --amount-cents, not both.",400,{code:"CONFLICTING_PROMO_AMOUNT_FLAGS",param:"amount"});if(e==="percent_off"){if(n===void 0)throw new O("percent_off promo codes require --percent.",400,{code:"INVALID_PROMO_CODE_FIELD",param:"percent"});if(n>100)throw new O("--percent must be between 1 and 100.",400,{code:"INVALID_PROMO_CODE_FIELD",param:"percent"});return n}if(e==="amount_off"){if(o===void 0)throw new O("amount_off promo codes require --amount-cents.",400,{code:"INVALID_PROMO_CODE_FIELD",param:"amountCents"});return o}if(e==="free_months"&&(n!==void 0||o!==void 0))throw new O("free_months promo codes do not accept --percent or --amount-cents.",400,{code:"INVALID_PROMO_CODE_FIELD",param:"amount"});return n??o}function w0(t){let e=t.plan??[];if(t.allPlans===!0&&e.length>0)throw new O("Pass either --plan or --all-plans, not both.",400,{code:"CONFLICTING_PROMO_PLAN_FLAGS",param:"plan"});return t.allPlans===!0?[]:e.length>0?e:void 0}function p6(t){let e=$0(t.kind);if(!e)throw new O("Promo code kind is required.",400,{code:"INVALID_PROMO_CODE_FIELD",param:"kind"});let n=ni("durationMonths",t.durationMonths);if(n===void 0)throw new O("--duration-months is required.",400,{code:"INVALID_PROMO_CODE_FIELD",param:"durationMonths"});let o=w0(t);return{code:String(t.code),kind:e,amount:I0(t,e),durationMonths:n,...o!==void 0?{applicablePlanIds:o}:{},maxRedemptions:ni("maxRedemptions",t.maxRedemptions),activeFrom:$s(t.activeFrom),activeUntil:$s(t.activeUntil)}}function m6(t){let e=$0(t.kind),n=ni("durationMonths",t.durationMonths),o=ni("maxRedemptions",t.maxRedemptions),r=w0(t);if(t.code!==void 0||e!==void 0||t.percent!==void 0||t.amountCents!==void 0||n!==void 0||o!==void 0||t.clearMaxRedemptions===!0||t.activeFrom!==void 0||t.activeUntil!==void 0||t.clearActiveFrom===!0||t.clearActiveUntil===!0||r!==void 0){if(e===void 0)throw new O("Promo-code spec updates rotate the Stripe coupon, so pass the complete spec: --kind plus --duration-months and the required amount flag for that kind.",400,{code:"PROMO_CODE_UPDATE_REQUIRES_FULL_SPEC",param:"kind"});if(n===void 0)throw new O("Promo-code spec updates require --duration-months.",400,{code:"PROMO_CODE_UPDATE_REQUIRES_FULL_SPEC",param:"durationMonths"})}let a={},c=$s(t.code);c!==void 0&&(a.code=c),e!==void 0&&(a.kind=e);let u=I0(t,e);if(u!==void 0&&(a.amount=u),n!==void 0&&(a.durationMonths=n),o!==void 0&&(a.maxRedemptions=o),t.clearMaxRedemptions===!0&&(a.maxRedemptions=null),r!==void 0&&(a.applicablePlanIds=r),t.activeFrom!==void 0&&(a.activeFrom=$s(t.activeFrom)??null),t.activeUntil!==void 0&&(a.activeUntil=$s(t.activeUntil)??null),t.clearActiveFrom===!0&&(a.activeFrom=null),t.clearActiveUntil===!0&&(a.activeUntil=null),Object.keys(a).length===0)throw new O("No promo-code fields to update. Pass --code, --kind, amount, duration, plan, status-window, or redemption flags.",400,{code:"PROMO_CODE_UPDATE_NO_FIELDS"});return a}async function Ss(t,e){return ve(t,e)}function rp(t){return{status:t}}var E0=[{opKey:"promo_code.read",operationClass:"operate",scope:["products:read"],sideEffect:"read",cli:{group:ks,command:"list",summary:"List API-managed promo codes for checkout",args:[xs],handler:async({client:t,args:e,emit:n})=>{let o=await t.listPromoCodes(e.productId);n({productId:e.productId,count:o.length,promoCodes:o},`${o.length} promo code(s)`)}},mcp:{tool:"fs_promo_code_list",title:"List promo codes",description:"List API-managed promo codes for a business. Promo codes are checkout operational state, not repo-authored Business SDK state.",annotations:{readOnlyHint:!0,openWorldHint:!1},inputSchema:{productId:s.string().describe(ri)},handler:async(t,e)=>{let n=await Ss(t,e.productId);return t.listPromoCodes(n)}}},{opKey:"promo_code.create",operationClass:"operate",scope:["products:update"],sideEffect:"write",cli:{group:ks,command:"create",summary:"Create an API-managed checkout promo code",args:[xs,{field:"code",kind:"flag",token:"--code <code>",describe:"Customer-entered promo code.",required:!0},{field:"kind",kind:"flag",token:"--kind <kind>",describe:"percent_off, amount_off, or free_months.",required:!0},{field:"percent",kind:"flag",token:"--percent <n>",describe:"Percent discount for percent_off promos."},{field:"amountCents",kind:"flag",token:"--amount-cents <cents>",describe:"Fixed discount in cents for amount_off promos."},{field:"durationMonths",kind:"flag",token:"--duration-months <n>",describe:"Discount duration in months.",required:!0},{field:"maxRedemptions",kind:"flag",token:"--max-redemptions <n>",describe:"Optional maximum redemption count."},{field:"activeFrom",kind:"flag",token:"--active-from <iso>",describe:"Optional ISO-8601 activation timestamp."},{field:"activeUntil",kind:"flag",token:"--active-until <iso>",describe:"Optional ISO-8601 expiration timestamp."},S0],handler:async({client:t,args:e,emit:n})=>{let o=await t.createPromoCode(e.productId,p6(e));n({productId:e.productId,promoCode:o},"Promo code created")}},mcp:{tool:"fs_promo_code_create",title:"Create promo code",description:"Create an API-managed checkout promo code. Use percent for percent_off, amountCents for amount_off, and no amount for free_months.",annotations:{readOnlyHint:!1,destructiveHint:!1,openWorldHint:!0},inputSchema:{productId:s.string().describe(ri),code:s.string().min(1).max(64),kind:s.enum(ev),percent:s.number().int().min(1).max(100).optional(),amountCents:s.number().int().positive().optional(),durationMonths:s.number().int().min(1).max(24),maxRedemptions:s.number().int().positive().optional(),activeFrom:s.string().datetime().optional(),activeUntil:s.string().datetime().optional(),applicablePlanIds:s.array(s.string()).optional()},handler:async(t,e)=>{let n=await Ss(t,e.productId);return t.createPromoCode(n,{code:e.code,kind:e.kind,amount:e.kind==="percent_off"?e.percent:e.kind==="amount_off"?e.amountCents:void 0,durationMonths:e.durationMonths,maxRedemptions:e.maxRedemptions,activeFrom:e.activeFrom,activeUntil:e.activeUntil,applicablePlanIds:e.applicablePlanIds})}}},{opKey:"promo_code.update",operationClass:"operate",scope:["products:update"],sideEffect:"write",cli:{group:ks,command:"update",summary:"Update an API-managed checkout promo code",args:[xs,Qy,{field:"code",kind:"flag",token:"--code <code>",describe:"Replacement customer-entered promo code."},{field:"kind",kind:"flag",token:"--kind <kind>",describe:"percent_off, amount_off, or free_months."},{field:"percent",kind:"flag",token:"--percent <n>",describe:"Percent discount for percent_off promos."},{field:"amountCents",kind:"flag",token:"--amount-cents <cents>",describe:"Fixed discount in cents for amount_off promos."},{field:"durationMonths",kind:"flag",token:"--duration-months <n>",describe:"Discount duration in months."},{field:"maxRedemptions",kind:"flag",token:"--max-redemptions <n>",describe:"Set maximum redemption count."},{field:"clearMaxRedemptions",kind:"flag",token:"--clear-max-redemptions",describe:"Clear the maximum redemption count."},{field:"activeFrom",kind:"flag",token:"--active-from <iso>",describe:"Set ISO-8601 activation timestamp."},{field:"clearActiveFrom",kind:"flag",token:"--clear-active-from",describe:"Clear activation timestamp."},{field:"activeUntil",kind:"flag",token:"--active-until <iso>",describe:"Set ISO-8601 expiration timestamp."},{field:"clearActiveUntil",kind:"flag",token:"--clear-active-until",describe:"Clear expiration timestamp."},S0,{field:"allPlans",kind:"flag",token:"--all-plans",describe:"Clear plan scoping so the promo applies to all launch plans."}],handler:async({client:t,args:e,emit:n})=>{let o=await t.updatePromoCode(e.productId,e.promoCodeId,m6(e));n({productId:e.productId,promoCode:o},"Promo code updated")}},mcp:{tool:"fs_promo_code_update",title:"Update promo code",description:"Update an API-managed checkout promo code. Spec changes rotate the Stripe coupon/promotion code behind the scenes.",annotations:{readOnlyHint:!1,destructiveHint:!1,openWorldHint:!0},inputSchema:{productId:s.string().describe(ri),promoCodeId:s.string().describe(np),code:s.string().min(1).max(64).optional(),kind:s.enum(ev).optional(),percent:s.number().int().min(1).max(100).optional(),amountCents:s.number().int().positive().optional(),durationMonths:s.number().int().min(1).max(24).optional(),maxRedemptions:s.number().int().positive().nullable().optional(),activeFrom:s.string().datetime().nullable().optional(),activeUntil:s.string().datetime().nullable().optional(),applicablePlanIds:s.array(s.string()).optional()},handler:async(t,e)=>{let n=await Ss(t,e.productId),o={code:e.code,kind:e.kind,amount:e.kind==="percent_off"?e.percent:e.kind==="amount_off"?e.amountCents:void 0,durationMonths:e.durationMonths,maxRedemptions:e.maxRedemptions,activeFrom:e.activeFrom,activeUntil:e.activeUntil,applicablePlanIds:e.applicablePlanIds};return t.updatePromoCode(n,e.promoCodeId,o)}}},{opKey:"promo_code.archive",operationClass:"operate",scope:["products:update"],sideEffect:"write",cli:{group:ks,command:"archive",summary:"Archive a checkout promo code",args:[xs,Qy],handler:async({client:t,args:e,emit:n})=>{let o=await t.updatePromoCode(e.productId,e.promoCodeId,rp("ARCHIVED"));n({productId:e.productId,promoCode:o},"Promo code archived")}},mcp:{tool:"fs_promo_code_archive",title:"Archive promo code",description:"Archive an API-managed checkout promo code.",annotations:{readOnlyHint:!1,destructiveHint:!0,openWorldHint:!1},inputSchema:{productId:s.string().describe(ri),promoCodeId:s.string().describe(np)},handler:async(t,e)=>{let n=await Ss(t,e.productId);return t.updatePromoCode(n,e.promoCodeId,rp("ARCHIVED"))}}},{opKey:"promo_code.reactivate",operationClass:"operate",scope:["products:update"],sideEffect:"write",cli:{group:ks,command:"reactivate",summary:"Reactivate an archived checkout promo code",args:[xs,Qy],handler:async({client:t,args:e,emit:n})=>{let o=await t.updatePromoCode(e.productId,e.promoCodeId,rp("ACTIVE"));n({productId:e.productId,promoCode:o},"Promo code reactivated")}},mcp:{tool:"fs_promo_code_reactivate",title:"Reactivate promo code",description:"Reactivate an archived API-managed checkout promo code.",annotations:{readOnlyHint:!1,destructiveHint:!1,openWorldHint:!1},inputSchema:{productId:s.string().describe(ri),promoCodeId:s.string().describe(np)},handler:async(t,e)=>{let n=await Ss(t,e.productId);return t.updatePromoCode(n,e.promoCodeId,rp("ACTIVE"))}}}];var Is="The business id or slug.",ap="The subscriber id from `consumer list`.",op={field:"productId",kind:"positional",token:"<businessIdOrSlug>",describe:Is,resolveProduct:!0},tv={field:"subscriberId",kind:"positional",token:"<subscriberId>",describe:ap},f6={field:"env",kind:"flag",token:"--env <env>",describe:"Environment name for preview-scoped consumers."},T0="The member's external identity id (Clerk userId) within the client org.",h6="Comma-separated product-role keys to set (replaces the current assignment; pass an empty string to clear).",g6={field:"userExternalId",kind:"positional",token:"<userExternalId>",describe:T0};function _6(t){return t.split(",").map(e=>e.trim()).filter(Boolean)}var y6={field:"roles",kind:"flag",token:"--roles <roles>",describe:h6,required:!0,parser:t=>_6(t)};async function ip(t,e){return ve(t,e)}function v6(t){return Array.isArray(t)?t:[]}var P0=[{opKey:"consumer.read",operationClass:"operate",scope:["products:read"],sideEffect:"read",cli:{group:"consumer",command:"list",summary:"List users/consumers for a business",args:[op,f6],handler:async({client:t,args:e,emit:n})=>{let o=e.productId,r=v6(await t.builderListConsumers(o,{env:e.env}));n({productId:o,count:r.length,consumers:r},`${r.length} consumer(s)`)}},mcp:{tool:"fs_consumer_list",title:"List business consumers",description:"List users/consumers for a business. Read-only; use this to discover subscriber ids before blocking or removing a user.",annotations:{readOnlyHint:!0,openWorldHint:!1},inputSchema:{productId:s.string().describe(Is),env:s.string().optional().describe("Environment name for preview-scoped consumers.")},handler:async(t,e)=>{let n=await ip(t,e.productId);return t.builderListConsumers(n,{env:e.env})}}},{opKey:"consumer.block",operationClass:"operate",scope:["products:update"],sideEffect:"write",cli:{group:"consumer",command:"block",summary:"Block a user and revoke their active API keys",destructive:!0,yesMessage:"Blocking a user revokes active API keys. Pass --yes to confirm.",args:[op,tv],handler:async({client:t,args:e,emit:n})=>{let o=e.productId,r=e.subscriberId,i=await t.builderBlockConsumer(o,r);n({productId:o,subscriberId:r,result:i},`Consumer blocked: ${r}`)}},mcp:{tool:"fs_consumer_block",title:"Block business consumer",description:"Block a user/consumer for a business and revoke their active API keys. Destructive live-state operation; it does not edit repo-authored business behavior.",annotations:{readOnlyHint:!1,destructiveHint:!0,idempotentHint:!0,openWorldHint:!0},inputSchema:{productId:s.string().describe(Is),subscriberId:s.string().describe(ap)},handler:async(t,e)=>{let n=await ip(t,e.productId);return t.builderBlockConsumer(n,e.subscriberId)}}},{opKey:"consumer.remove",operationClass:"operate",scope:["products:update"],sideEffect:"write",cli:{group:"consumer",command:"remove",summary:"Force-remove a user from a business",destructive:!0,yesMessage:"Removing a user tears down subscriptions, edge credentials, and related live state. Pass --yes to confirm.",args:[op,tv],handler:async({client:t,args:e,emit:n})=>{let o=e.productId,r=e.subscriberId,i=await t.builderRemoveConsumer(o,r);n({productId:o,subscriberId:r,result:i},`Consumer removed: ${r}`)}},mcp:{tool:"fs_consumer_remove",title:"Remove business consumer",description:"Force-remove a user/consumer from a business, tearing down subscriptions, edge credentials, and related live state. Destructive and irreversible; it does not edit repo-authored business behavior.",annotations:{readOnlyHint:!1,destructiveHint:!0,openWorldHint:!0},inputSchema:{productId:s.string().describe(Is),subscriberId:s.string().describe(ap)},handler:async(t,e)=>{let n=await ip(t,e.productId);return t.builderRemoveConsumer(n,e.subscriberId)}}},{opKey:"consumer.roles.assign",operationClass:"operate",scope:["products:update"],sideEffect:"write",cli:{group:"consumer rbac",command:"assign",summary:"Replace a client-org member's Managed-RBAC product roles (builder support override)",args:[op,tv,g6,y6],handler:async({client:t,args:e,emit:n})=>{let o=e.productId,r=e.subscriberId,i=e.userExternalId,a=e.roles,c=await t.builderAssignConsumerMemberRoles(o,r,i,a);n({productId:o,subscriberId:r,membership:c},`Product roles set for ${i}: ${c.productRoleKeys.length>0?c.productRoleKeys.join(", "):"(none)"}`)}},mcp:{tool:"fs_consumer_rbac_assign",title:"Assign consumer member product roles",description:"Support override: replace a client-org member's Managed-RBAC product-role assignment on a business (set-replace \u2014 the given list becomes the member's full assignment; an empty list clears it). Role keys must exist in the org's role set. Live-state operation; it does not edit repo-authored business behavior.",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!0},inputSchema:{productId:s.string().describe(Is),subscriberId:s.string().describe(ap),userExternalId:s.string().describe(T0),roles:s.array(s.string()).describe("Product-role keys to set (replaces the current assignment; [] clears it).")},handler:async(t,e)=>{let n=await ip(t,e.productId);return t.builderAssignConsumerMemberRoles(n,e.subscriberId,e.userExternalId,e.roles)}}}];var bn="The business id or slug.",ai="Scope to a branch environment by slug (omit for Main/production).",si="Variable name, e.g. STRIPE_SECRET_KEY.";async function b6(){if(process.stdin.isTTY)throw new O("Pipe the variable value via stdin (e.g. echo $VALUE | farthershore variables set \u2026). Never pass a value as a flag.",400,{code:"VARIABLE_STDIN_REQUIRED"});let t="";for await(let e of process.stdin)t+=Buffer.isBuffer(e)?e.toString("utf8"):String(e);return t.replace(/\r?\n$/,"")}var O0=b6;async function ws(t,e,n){if(n)return _n(t,e,n)}var oi={field:"productId",kind:"positional",token:"<businessIdOrSlug>",describe:bn,resolveProduct:!0},Es={field:"name",kind:"positional",token:"<name>",describe:si},ii={field:"env",kind:"flag",token:"--env <slug>",describe:ai},k6={field:"exposeToBrowser",kind:"flag",token:"--expose-to-browser",describe:"Make this variable available in the browser (publishable keys only). Default: off (server-only)."},x6={field:"allowedHost",kind:"flag",token:"--allowed-host <host>",describe:"Allow fs.fetch to send this variable to <host> (custom/unknown providers). Repeatable or comma-separated, e.g. --allowed-host api.example.com.",parser:(t,e)=>[...e,...t.split(",").map(n=>n.trim()).filter(Boolean)],defaultValue:[]},R0=[{opKey:"business_variable.read",operationClass:"operate",scope:["products:read"],sideEffect:"read",cli:{group:"variables",command:"list",summary:"List variable metadata for a business (names + flags, never values)",args:[oi,ii],handler:async({client:t,args:e,emit:n})=>{let o=e.productId,r=await ws(t,o,e.env),i=await t.builderBusinessVariables(o,r);n({productId:o,environmentId:r??null,count:i.length,variables:i.map(a=>({name:a.name,exposeToBrowser:a.exposeToBrowser,sealed:a.sealed,hasValue:!0,environmentId:a.environmentId}))},"Business variables (metadata only \u2014 values are never returned)")}},mcp:{tool:"fs_variable_list",title:"List business variables",description:"List masked variable metadata for a business \u2014 names, exposeToBrowser flag, sealed status. Values are never returned.",annotations:{readOnlyHint:!0,openWorldHint:!1},inputSchema:{productId:s.string().describe(bn),environmentId:s.string().optional().describe(ai)},handler:async(t,e)=>{let n=await ve(t,e.productId);return t.builderBusinessVariables(n,e.environmentId)}}},{opKey:"business_variable.set",operationClass:"operate",scope:["products:update"],sideEffect:"write",cli:{group:"variables",command:"set",summary:"Create or update a variable (value read from stdin \u2014 never echoed)",helpTextAfter:`
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
cat .env | farthershore variables set my-biz DATABASE_URL --env staging
|
|
100
|
-
farthershore variables set my-biz PK_LIVE --expose-to-browser # publishable key
|
|
101
|
-
echo $CUSTOM_KEY | farthershore variables set my-biz CUSTOM_API_KEY --allowed-host api.example.com # custom provider`,args:[oi,Es,ii,k6,x6],handler:async({client:t,args:e,emit:n})=>{let o=e.productId,r=await ws(t,o,e.env),i=await O0(),a=e.allowedHost,c=await t.builderSetBusinessVariable(o,e.name,{value:i,exposeToBrowser:e.exposeToBrowser===!0,environmentId:r,...a&&a.length>0?{allowedHosts:a}:{}});n({productId:o,variable:{name:c.name,exposeToBrowser:c.exposeToBrowser,sealed:c.sealed,environmentId:c.environmentId}},`Variable ${c.name} saved`)}},mcp:{tool:"fs_variable_set",title:"Set a business variable",description:"Create or update a business variable. The value is encrypted at rest and not returned after write. Pass exposeToBrowser:true for publishable keys only.",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},inputSchema:{productId:s.string().describe(bn),name:s.string().describe(si),value:s.string().describe("The variable value (encrypted at rest)."),exposeToBrowser:s.boolean().optional().describe("Expose to the browser (publishable keys only). Default: false."),environmentId:s.string().optional().describe(ai)},handler:async(t,e)=>{let n=await ve(t,e.productId);return t.builderSetBusinessVariable(n,e.name,{value:e.value,exposeToBrowser:e.exposeToBrowser??!1,environmentId:e.environmentId})}}},{opKey:"business_variable.set",operationClass:"operate",scope:["products:update"],sideEffect:"write",cli:{group:"variables",command:"rotate",summary:"Rotate (update) a variable value without changing its exposeToBrowser setting (value read from stdin)",helpTextAfter:`
|
|
102
|
-
Examples:
|
|
103
|
-
echo $NEW_STRIPE_SECRET | farthershore variables rotate my-biz STRIPE_SECRET_KEY
|
|
104
|
-
cat .env | farthershore variables rotate my-biz DATABASE_URL --env staging`,args:[oi,Es,ii],handler:async({client:t,args:e,emit:n})=>{let o=e.productId,r=await ws(t,o,e.env),i=await O0(),a=await t.builderSetBusinessVariable(o,e.name,{value:i,environmentId:r});n({productId:o,variable:{name:a.name,exposeToBrowser:a.exposeToBrowser,sealed:a.sealed,environmentId:a.environmentId}},`Variable ${a.name} rotated`)}},mcp:{tool:"fs_variable_rotate",title:"Rotate a business variable",description:"Update a business variable's value without changing its exposeToBrowser setting. Use this instead of set when you want to guarantee visibility is unchanged.",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},inputSchema:{productId:s.string().describe(bn),name:s.string().describe(si),value:s.string().describe("The new variable value (encrypted at rest)."),environmentId:s.string().optional().describe(ai)},handler:async(t,e)=>{let n=await ve(t,e.productId);return t.builderSetBusinessVariable(n,e.name,{value:e.value,environmentId:e.environmentId})}}},{opKey:"business_variable.reveal",operationClass:"operate",scope:["products:read"],sideEffect:"read",cli:{group:"variables",command:"reveal",summary:"Print the plaintext value of a variable (sealed variables return a 403)",args:[oi,Es,ii],handler:async({client:t,args:e,emit:n})=>{let o=e.productId,r=await ws(t,o,e.env),i;try{i=await t.builderRevealBusinessVariable(o,e.name,r)}catch(c){throw c instanceof Error&&"status"in c&&c.status===403?new O(`${e.name} is sealed \u2014 only rotation can change a sealed variable. To update, rotate it with a new value.`,403,{code:"VARIABLE_SEALED"}):c}let a=e.name;n({name:a,value:i.value},a)}},mcp:{tool:"fs_variable_reveal",title:"Reveal a business variable value",description:"Return the plaintext value of an unsealed variable. Returns a 403 for sealed variables (only rotation can change them).",annotations:{readOnlyHint:!0,openWorldHint:!1},returnsOneTimeSecret:!0,inputSchema:{productId:s.string().describe(bn),name:s.string().describe(si),environmentId:s.string().optional().describe(ai)},handler:async(t,e)=>{let n=await ve(t,e.productId);return t.builderRevealBusinessVariable(n,e.name,e.environmentId)}}},{opKey:"business_variable.seal",operationClass:"operate",scope:["products:update"],sideEffect:"write",cli:{group:"variables",command:"seal",summary:"Irreversibly seal a variable (value can never be revealed; only rotation can update it). Requires --yes.",destructive:!0,yesMessage:"Sealing is irreversible \u2014 the value can never be revealed again. Only `variables rotate` can update a sealed variable. Pass --yes to confirm.",args:[oi,Es,ii],handler:async({client:t,args:e,emit:n})=>{let o=e.productId,r=await ws(t,o,e.env),i=await t.builderSealBusinessVariable(o,e.name,r);n({productId:o,name:e.name,sealed:i.sealed},`Variable ${e.name} sealed \u2014 rotation is the only way to update it`)}},mcp:{tool:"fs_variable_seal",title:"Seal a business variable",description:"Irreversibly seal a variable \u2014 its value can never be revealed again. Only `variables rotate` / fs_variable_rotate can update the value after sealing. This action cannot be undone.",annotations:{readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1,openWorldHint:!1},inputSchema:{productId:s.string().describe(bn),name:s.string().describe(si),environmentId:s.string().optional().describe(ai)},handler:async(t,e)=>{let n=await ve(t,e.productId);return t.builderSealBusinessVariable(n,e.name,e.environmentId)}}},{opKey:"business_variable.delete",operationClass:"operate",scope:["products:update"],sideEffect:"write",cli:{group:"variables",command:"rm",summary:"Delete a variable from a branch environment (Main deletions must go through the dashboard)",destructive:!0,yesMessage:"Pass --yes to confirm variable deletion. Main/production variables must be deleted in the dashboard.",args:[oi,Es,ii],handler:async({client:t,args:e,emit:n})=>{let o=e.productId,r=e.env;if(!r)throw new O("delete production variables in the dashboard",403,{code:"VARIABLE_MAIN_DELETE_FORBIDDEN"});let i=await _n(t,o,r);await t.builderDeleteBusinessVariable(o,e.name,i),n({productId:o,name:e.name,environmentId:i},`Variable ${e.name} deleted`)}},mcp:{tool:"fs_variable_rm",title:"Delete a business variable",description:"Delete a variable from a branch environment. Main/production variables must be deleted in the dashboard \u2014 this operation requires environmentId to target a branch.",annotations:{readOnlyHint:!1,destructiveHint:!0,idempotentHint:!0,openWorldHint:!1},inputSchema:{productId:s.string().describe(bn),name:s.string().describe(si),environmentId:s.string().describe("The branch environment id. Main deletions are dashboard-only.")},handler:async(t,e)=>{let n=await ve(t,e.productId);return t.builderDeleteBusinessVariable(n,e.name,e.environmentId)}}}];var A0=[...r0,...p0,...f0,...n0,...o0,...s0,...c0,...b0,...k0,...x0,...E0,...P0,...R0,...u0,...l0,...d0];function C0(t){if(!t.mcp)throw new Error(`toMcpTool called on CLI-only operation "${t.opKey}" (mcp === null).`);let e={name:t.mcp.tool,title:t.mcp.title,description:t.mcp.description,operationClass:t.operationClass,scope:t.scope,sideEffect:t.sideEffect,annotations:t.mcp.annotations,inputSchema:t.mcp.inputSchema,handler:t.mcp.handler};return t.mcp.returnsOneTimeSecret&&(e.returnsOneTimeSecret=!0),e}var rv=A0.filter(t=>t.mcp).map(C0);function N0(){let t=ST(),e=IT(void 0),n=process.env.FARTHERSHORE_API_URL??t.apiUrl;return OT({apiUrl:n,token:e})}function S6(t){if(t&&typeof t=="object"){let e=t,n=typeof e.code=="string"?` [${e.code}]`:"",o=typeof e.status=="number"?` (HTTP ${e.status})`:"";if(typeof e.message=="string")return`${e.message}${n}${o}`}return String(t)}function $6(t,e,n){let o=async c=>{try{let u=await e.handler(n,c??{}),d=e.returnsOneTimeSecret?u:qd(u),l=KT(e.name,d);return{content:[{type:"text",text:JSON.stringify(l,null,2)}]}}catch(u){let d=u instanceof O?u:new O(S6(u),0),l=GT(e.name,d);return{content:[{type:"text",text:JSON.stringify(l,null,2)}],isError:!0}}},r=Object.keys(e.inputSchema).length>0,i={title:e.title,description:e.description,annotations:{title:e.title,...e.annotations},...r?{inputSchema:e.inputSchema}:{}},a=r?c=>o(c):()=>o({});t.registerTool(e.name,i,a)}function I6(t){for(let e of t){let n=_T(e.operationClass,e.sideEffect);if(n)throw new Error(`[mcp] tool "${e.name}" is misclassified: ${n}`)}}function z0(t){I6(rv);let e=new Rd({name:"farthershore-agent-business-builder",version:"0.2.0"});for(let n of rv)$6(e,n,t);return e}function nv(){return z0(N0())}async function w6(){let t=nv(),e=new zl;await t.connect(e)}import.meta.url===`file://${process.argv[1]}`&&w6();export{rv as ALL_TOOLS,z0 as buildServer,nv as createMcpServer,N0 as mcpClient};
|
|
94
|
+
farthershore plan migrate my-business pro --from 1 --to head --policy next_renewal
|
|
95
|
+
farthershore plan migrate my-business pro --from 1 --to 2 --policy immediate --proration prorate
|
|
96
|
+
`,handler:async({client:t,args:e,reqOpts:n,emit:i,emitDryRunPreview:r})=>{let o=e.businessId,s=e.planKey,c=e.policy;if(!Zd.includes(c))throw new N(`Invalid --policy "${c}". Supported: ${Zd.join(", ")}.`,void 0,{code:"INVALID_MIGRATION_POLICY"});let u=await t.migratePlan(o,s,{fromVersion:e.from,toVersion:e.to,policy:c,proration:e.proration,completeBy:e.completeBy},n);r(u)||i({businessId:o,planKey:s,migration:u},`Migration scheduled for plan ${s}`)}},mcp:{tool:"fs_plan_migrate",title:"Migrate subscribers between plan versions",description:"Schedule a subscriber migration for a plan: move subscribers from one plan version to another under a policy. Pass the plan KEY plus fromVersion/toVersion (each an integer or 'head'/'latest') \u2014 the server resolves them to the right plan versions. Policies: next_renewal (migrate at each subscriber's renewal), immediate (migrate now), by_date (migrate everyone by a deadline), or opt_in (subscribers choose). This is an OPERATE action (it changes live subscriber state, not the business's code-managed definition).",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe("The business id whose subscribers to migrate."),planKey:a.string().describe("The stable plan key (e.g. 'pro') to migrate within."),fromVersion:a.union([a.string(),a.number().int().positive()]).describe("Source plan version: an integer or 'head'/'latest'."),toVersion:a.union([a.string(),a.number().int().positive()]).describe("Target plan version: an integer or 'head'/'latest'."),policy:a.enum(Zd).describe("Migration policy: next_renewal | immediate | by_date | opt_in."),proration:a.enum(["none","prorate","credit"]).optional().describe("Optional proration behaviour."),completeBy:a.string().optional().describe("ISO 8601 deadline \u2014 required by the by_date policy."),...Pe},handler:async(t,e)=>t.migratePlan(e.businessId,e.planKey,{fromVersion:e.fromVersion,toVersion:e.toVersion,policy:e.policy,proration:e.proration,completeBy:e.completeBy},{idempotencyKey:e.idempotencyKey})}}],JT=b6;function _6(t){if(!t||typeof t!="object")return[];let e=t;return Array.isArray(e.data)?e.data:Array.isArray(e.environments)?e.environments:[]}var YT=[{opKey:"environment.read",operationClass:"dual",scope:["businesses:read"],sideEffect:"read",cli:{group:"env",command:"list",summary:"List environments for a business",args:[{field:"businessId",kind:"positional",token:"<businessIdOrName>",resolveBusiness:!0}],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=_6(await t.listEnvironments(i));n({businessId:i,count:r.length,environments:r.map(o=>({id:o.id,name:o.name,branch:o.branch??null,portalHostname:o.portalHostname??null,runtimeHostname:o.runtimeHostname??null,status:o.status??null}))},`${r.length} environment(s)`)}},mcp:{tool:"fs_env_list",title:"List environments",description:"List a business's preview environments (name, branch, hostnames). Read-only.",annotations:{readOnlyHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe("The business id whose environments to list.")},handler:async(t,{businessId:e})=>t.listEnvironments(e)}},{opKey:"environment.create",operationClass:"dual",scope:["businesses:update"],sideEffect:"write",cli:{group:"env",command:"create",summary:"Create a preview environment bound to a git branch",idempotent:!0,args:[{field:"businessId",kind:"positional",token:"<businessIdOrName>",resolveBusiness:!0},{field:"name",kind:"flag",token:"--name <name>",describe:"Environment name (e.g. preview, staging)",required:!0},{field:"branch",kind:"flag",token:"--branch <branch>",describe:"Git branch to track (e.g. env/preview)",required:!0}],handler:async({client:t,args:e,reqOpts:n,emit:i,emitDryRunPreview:r})=>{let o=e.businessId,s=await t.createEnvironment(o,{name:e.name,branch:e.branch},n);r(s)||i({businessId:o,environment:s},`Environment ${e.name} created`)}},mcp:{tool:"fs_env_create",title:"Create preview environment",description:"Create a preview environment bound to a git branch. Equivalent to pushing the branch \u2014 both reconcile to the same environment (operationClass=dual). Provide a name and the git branch it tracks.",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!1},inputSchema:{businessId:a.string().describe("The business id to create the environment in."),name:a.string().describe("Environment name (e.g. 'staging', 'preview-pr-42')."),branch:a.string().describe("The git branch this environment tracks."),...Pe},handler:async(t,e)=>{let n=await t.createEnvironment(e.businessId,{name:e.name,branch:e.branch},{idempotencyKey:e.idempotencyKey});return{ok:!0,businessId:e.businessId,environment:n}}}},{opKey:"environment.delete",operationClass:"dual",scope:["businesses:update"],sideEffect:"write",cli:{group:"env",command:"delete",summary:"Delete an environment by name. Requires --yes.",destructive:!0,yesMessage:"Pass --yes to confirm environment deletion.",args:[{field:"businessId",kind:"positional",token:"<businessIdOrName>",resolveBusiness:!0},{field:"envName",kind:"positional",token:"<envName>"}],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=e.envName;await t.deleteEnvironment(i,r),n({businessId:i,deleted:r},`Environment ${r} deleted`)}},mcp:null}];async function Ji(t,e,n){let r=await t.listEnvironments(e),s=(Array.isArray(r.data)?r.data:Array.isArray(r.environments)?r.environments:[]).find(c=>c.name.toLowerCase()===n.toLowerCase()||c.id===n);if(!s)throw new Error(`Environment "${n}" not found on business ${e}.`);return s.id}var K_=["gateway_verification","metering","health","tunnel"],y6="<businessId>",Yi="businesses:update",Xi="The business id.",Fn={field:"businessId",kind:"positional",token:y6};function XT(t){if(!t||typeof t!="object")return[];let e=t;return Array.isArray(e.data)?e.data:Array.isArray(e.backends)?e.backends:Array.isArray(e.tokens)?e.tokens:Array.isArray(t)?t:[]}function v6(t){let e=t.status;if(typeof e=="string"&&e.length>0)return e;let n=typeof t.readinessState=="string"?t.readinessState:null,i=typeof t.provisionStatus=="string"?t.provisionStatus:null;return n??i??"unknown"}function k6(t){return{id:t.id,environmentId:t.environmentId??null,name:t.name,slug:t.slug,transport:t.transportMode,default:t.isDefault??!1,status:v6(t),originUrl:t.originUrl??null,lastSeenAt:t.lastSeenAt??null}}async function G_(t,e,n){if(!n)return null;try{return await Ji(t,e,n)}catch(i){throw new N(i instanceof Error?i.message:`Environment "${n}" not found on business ${e}.`,void 0,{code:"ENV_NOT_FOUND"})}}var W_=t=>typeof t=="string"&&t.length>0?t.split(",").map(e=>e.trim()).filter(e=>e.length>0):void 0,QT=[{opKey:"backend.read",operationClass:"operate",scope:["businesses:read"],sideEffect:"read",cli:{group:"backend",command:"list",summary:"List backends for a business (id, name, transport, status)",args:[Fn],handler:async({client:t,args:e,emit:n})=>{let r=XT(await t.builderListBackends(e.businessId)).map(k6);n({count:r.length,backends:r},`${r.length} backend(s)`)}},mcp:{tool:"fs_backend_list",title:"List backends",description:"List a business's backends (origins) \u2014 id, name, slug, transport (direct|tunnel), default flag, and derived status. Read-only.",annotations:{readOnlyHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe("The business id whose backends to list.")},handler:async(t,{businessId:e})=>t.builderListBackends(e)}},{opKey:"backend.create",operationClass:"operate",scope:[Yi],sideEffect:"write",cli:{group:"backend",command:"create",summary:"Create a backend (default transport: direct)",idempotent:!0,args:[Fn,{field:"name",kind:"flag",token:"--name <name>",describe:"Human-friendly backend name",required:!0},{field:"slug",kind:"flag",token:"--slug <slug>",describe:"Stable slug (defaults to a slugified name)"},{field:"env",kind:"flag",token:"--env <environment>",describe:"Scope backend to an environment name or id"},{field:"transport",kind:"flag",token:"--transport <mode>",describe:"Transport mode: direct | tunnel",defaultValue:"direct"},{field:"runner",kind:"flag",token:"--runner <runner>",describe:"embedded | sidecar"},{field:"runtime",kind:"flag",token:"--runtime <runtime>",describe:"Container/runtime descriptor"},{field:"originUrl",kind:"flag",token:"--origin-url <url>",describe:"Builder origin URL (direct)"},{field:"default",kind:"flag",token:"--default",describe:"Mark this backend the business default"}],handler:async({client:t,args:e,reqOpts:n,emit:i,emitDryRunPreview:r})=>{let o=e.businessId,s=await G_(t,o,e.env),c=e.transport==="tunnel"?"tunnel":"direct",u=await t.builderCreateBackend(o,{name:e.name,slug:e.slug,environmentId:s,transportMode:c,runner:e.runner==="embedded"||e.runner==="sidecar"?e.runner:null,runtime:e.runtime??null,originUrl:e.originUrl??null,isDefault:e.default},n);r(u)||i({result:u},"Backend created")}},mcp:{tool:"fs_backend_create",title:"Create a backend",description:"Create a backend (origin) for a business. Pick a transport mode: direct (public HTTPS URL, secured by Ed25519 request signing) or tunnel (private outbound-only cloudflared, secure bring-your-own-backend). Mark it default to route traffic to it.",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!1},inputSchema:{businessId:a.string().describe("The business id to create the backend in."),name:a.string().describe("Backend name (e.g. 'prod-origin')."),slug:a.string().optional().describe("URL-safe slug; derived from name if omitted."),transportMode:a.enum(["direct","tunnel"]).optional().describe("How the gateway reaches the origin; defaults to direct."),originUrl:a.string().optional().describe("The origin URL (for direct mode)."),isDefault:a.boolean().optional().describe("Route traffic to this backend by default."),...Pe},handler:async(t,e)=>t.builderCreateBackend(e.businessId,{name:e.name,slug:e.slug,transportMode:e.transportMode,originUrl:e.originUrl,isDefault:e.isDefault},{idempotencyKey:e.idempotencyKey})}},{opKey:"backend.bind",operationClass:"operate",scope:[Yi],sideEffect:"write",cli:{group:"backend",command:"bind",summary:"Bind a logical backend to a direct upstream in one environment",idempotent:!0,args:[Fn,{field:"backend",kind:"positional",token:"<backend>"},{field:"env",kind:"flag",token:"--env <environment>",describe:"Environment name or id (omit for production)"},{field:"originUrl",kind:"flag",token:"--origin-url <url>",describe:"Concrete direct upstream URL for this environment",required:!0}],handler:async({client:t,args:e,reqOpts:n,emit:i,emitDryRunPreview:r})=>{let o=e.businessId,s=e.backend,c=await G_(t,o,e.env),u=await t.builderBindBackend(o,s,{environmentId:c,originUrl:e.originUrl},n);r(u)||i({result:u},`Backend ${s} bound in ${c??"production"}`)}},mcp:{tool:"fs_backend_bind",title:"Bind a backend upstream",description:"Bind a logical backend id to a concrete direct upstream URL in one environment. Omit environmentId for production.",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe(Xi),backend:a.string().describe("Logical backend slug."),environmentId:a.string().optional().describe("Preview environment id; omit for production."),originUrl:a.string().url().describe("Concrete direct upstream URL."),...Pe},handler:async(t,e)=>t.builderBindBackend(e.businessId,e.backend,{environmentId:e.environmentId??null,originUrl:e.originUrl},{idempotencyKey:e.idempotencyKey})}},{opKey:"backend.delete",operationClass:"operate",scope:[Yi],sideEffect:"write",cli:{group:"backend",command:"delete",summary:"Delete a backend (revokes its runtime tokens). Requires --yes.",destructive:!0,yesMessage:"Pass --yes to confirm backend deletion.",args:[Fn,{field:"backendId",kind:"positional",token:"<backendId>"}],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=e.backendId;await t.builderDeleteBackend(i,r),n({businessId:i,deleted:r},`Backend ${r} deleted`)}},mcp:{tool:"fs_backend_delete",title:"Delete a backend",description:"Delete a backend (origin). Traffic routed to it stops; re-create to restore.",annotations:{readOnlyHint:!1,destructiveHint:!0,idempotentHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe(Xi),backendId:a.string().describe("The backend id to delete.")},handler:async(t,{businessId:e,backendId:n})=>t.builderDeleteBackend(e,n)}},{opKey:"runtime_token.read",operationClass:"operate",scope:["businesses:read"],sideEffect:"read",cli:{group:"backend tokens",command:"list",summary:"List runtime tokens for a business",args:[Fn],handler:async({client:t,args:e,emit:n})=>{let i=XT(await t.builderListRuntimeTokens(e.businessId));n({count:i.length,tokens:i},`${i.length} runtime token(s)`)}},mcp:{tool:"fs_runtime_token_list",title:"List runtime tokens",description:"List a business's runtime tokens (fsrt_) \u2014 id, last-four, operations, status. Read-only; secrets are never shown.",annotations:{readOnlyHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe(Xi)},handler:async(t,{businessId:e})=>t.builderListRuntimeTokens(e)}},{opKey:"runtime_token.mint",operationClass:"operate",scope:[Yi],sideEffect:"write",cli:{group:"backend tokens",command:"create",summary:"Create a runtime token (returns FS_RUNTIME_TOKEN once)",idempotent:!0,args:[Fn,{field:"env",kind:"flag",token:"--env <environment>",describe:"Scope token to an environment name or id"},{field:"backend",kind:"flag",token:"--backend <backendId>",describe:"Bind token to a specific backend"},{field:"kind",kind:"flag",token:"--kind <kind>",describe:"live | test (defaults from env scope)"},{field:"operations",kind:"flag",token:"--operations <list>",describe:`Comma-separated operations: ${K_.join(" | ")}. Default: core's DEFAULT_OPERATIONS. Use tunnel for tunnel backends.`},{field:"meters",kind:"flag",token:"--meters <list>",describe:"Comma-separated allowed meters (default: all business meters)"},{field:"routes",kind:"flag",token:"--routes <list>",describe:"Comma-separated allowed routes"}],handler:async({client:t,args:e,reqOpts:n,emit:i,emitDryRunPreview:r})=>{let o=e.businessId,s=await G_(t,o,e.env),c=e.kind==="test"||e.kind==="live"?e.kind:void 0,u=W_(e.operations);if(u){for(let l of u)if(!K_.includes(l))throw new N(`Unknown operation "${l}". Available: ${K_.join(", ")}.`,void 0,{code:"UNKNOWN_RUNTIME_TOKEN_OPERATION"})}let d=await t.builderCreateRuntimeToken(o,{environmentId:s,backendId:e.backend??null,kind:c,operations:u,allowedMeters:W_(e.meters),allowedRoutes:W_(e.routes)},n);r(d)||i({envVar:"FS_RUNTIME_TOKEN",result:d},"Runtime token created")}},mcp:{tool:"fs_runtime_token_mint",title:"Mint a runtime token",description:"Mint a new runtime token (fsrt_) for a backend. Returns the plaintext token ONCE \u2014 store it now (e.g. as FS_RUNTIME_TOKEN). Operations default to the backend's needs (gateway_verification, metering, health).",returnsOneTimeSecret:!0,annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!1},inputSchema:{businessId:a.string().describe(Xi),backendId:a.string().optional().describe("Bind the token to this backend."),environmentId:a.string().optional().describe("Scope to a preview environment (omit for production)."),kind:a.enum(["live","test"]).optional().describe("Token kind; defaults from the env scope."),operations:a.array(a.string()).optional().describe("Operations (gateway_verification, metering, health, tunnel)."),...Pe},handler:async(t,e)=>t.builderCreateRuntimeToken(e.businessId,{backendId:e.backendId??null,environmentId:e.environmentId??null,kind:e.kind,operations:e.operations},{idempotencyKey:e.idempotencyKey})}},{opKey:"runtime_token.rotate",operationClass:"operate",scope:[Yi],sideEffect:"write",cli:{group:"backend tokens",command:"rotate",summary:"Rotate a runtime token (returns a fresh FS_RUNTIME_TOKEN once)",args:[Fn,{field:"tokenId",kind:"positional",token:"<tokenId>"}],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=e.tokenId,o=await t.builderRotateRuntimeToken(i,r);n({envVar:"FS_RUNTIME_TOKEN",result:o},`Runtime token ${r} rotated`)}},mcp:{tool:"fs_runtime_token_rotate",title:"Rotate a runtime token",description:"Rotate a runtime token: mint a fresh secret carrying the same scope and revoke the old one. Returns the new plaintext token ONCE.",returnsOneTimeSecret:!0,annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!1},inputSchema:{businessId:a.string().describe(Xi),tokenId:a.string().describe("The runtime token id to rotate."),...Pe},handler:async(t,e)=>t.builderRotateRuntimeToken(e.businessId,e.tokenId,{idempotencyKey:e.idempotencyKey})}},{opKey:"runtime_token.revoke",operationClass:"operate",scope:[Yi],sideEffect:"write",cli:{group:"backend tokens",command:"revoke",summary:"Revoke a runtime token. Requires --yes.",destructive:!0,yesMessage:"Pass --yes to confirm runtime token revocation.",args:[Fn,{field:"tokenId",kind:"positional",token:"<tokenId>"}],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=e.tokenId;await t.builderRevokeRuntimeToken(i,r),n({businessId:i,revoked:r},`Runtime token ${r} revoked`)}},mcp:{tool:"fs_runtime_token_revoke",title:"Revoke a runtime token",description:"Revoke a runtime token. The backend using it stops verifying.",annotations:{readOnlyHint:!1,destructiveHint:!0,idempotentHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe(Xi),tokenId:a.string().describe("The runtime token id to revoke.")},handler:async(t,{businessId:e,tokenId:n})=>t.builderRevokeRuntimeToken(e,n)}}];var Fd="The business id or slug.",J_="Scope to a preview environment (omit for production).",Y_={field:"businessId",kind:"positional",token:"<businessIdOrSlug>",describe:Fd,resolveBusiness:!0},X_={field:"env",kind:"flag",token:"--env <environmentId>",describe:"Scope to a preview environment id (omit for production)."};async function Q_(t,e){return ke(t,e)}var eR=[{opKey:"frontend.deploy",operationClass:"operate",scope:["businesses:update"],sideEffect:"write",cli:{group:"frontend",command:"deploy",summary:"Trigger a frontend build (deploy) for a business's connected repo",idempotent:!0,args:[Y_,X_,{field:"ref",kind:"flag",token:"--ref <ref>",describe:"Git ref to build (defaults to the env branch / repo default)."},{field:"buildCmd",kind:"flag",token:"--build-cmd <cmd>",describe:"Override the build command."}],handler:async({client:t,args:e,reqOpts:n,emit:i,emitDryRunPreview:r})=>{let o=await t.builderFrontendDeploy(e.businessId,{ref:e.ref,buildCmd:e.buildCmd,environmentId:e.env},n);r(o)||i({result:o},"Frontend build triggered")}},mcp:{tool:"fs_frontend_deploy",title:"Deploy a business frontend",description:"Trigger a Managed Frontend Hosting build for the business's connected repo (production by default; pass environmentId for a preview env). Returns the enqueued build.",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe(Fd),ref:a.string().optional().describe("Git ref to build (defaults to the env branch / repo default)."),buildCmd:a.string().optional().describe("Override the build command."),environmentId:a.string().optional().describe(J_),...Pe},handler:async(t,e)=>{let n=await Q_(t,e.businessId);return t.builderFrontendDeploy(n,{ref:e.ref,buildCmd:e.buildCmd,environmentId:e.environmentId},{idempotencyKey:e.idempotencyKey})}}},{opKey:"frontend.status",operationClass:"operate",scope:["businesses:read"],sideEffect:"read",cli:{group:"frontend",command:"status",summary:"Show the current frontend release, recent releases, and recent builds (incl. failure reasons)",args:[Y_,X_],handler:async({client:t,args:e,emit:n})=>{let i=await t.builderFrontendStatus(e.businessId,e.env);n(i,"Frontend status")}},mcp:{tool:"fs_frontend_status",title:"Get frontend status",description:"Read a business's current frontend serve state (uiMode, active release hash + producing build, pin flag), the recent SUCCEEDED releases (rollback targets), and the recent builds \u2014 a FAILED build's `error` explains why a deploy didn't go live. Read-only.",annotations:{readOnlyHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe(Fd),environmentId:a.string().optional().describe(J_)},handler:async(t,e)=>{let n=await Q_(t,e.businessId);return t.builderFrontendStatus(n,e.environmentId)}}},{opKey:"frontend.rollback",operationClass:"operate",scope:["businesses:update"],sideEffect:"write",cli:{group:"frontend",command:"rollback",summary:"Roll the business frontend back to a prior release (re-activate its releaseId)",idempotent:!0,args:[Y_,{field:"releaseId",kind:"flag",token:"--release-id <releaseId>",describe:"The prior release id (manifest hash) to re-activate \u2014 see `frontend status`.",required:!0},X_],handler:async({client:t,args:e,reqOpts:n,emit:i,emitDryRunPreview:r})=>{let o=await t.builderFrontendRollback(e.businessId,{releaseId:e.releaseId,environmentId:e.env},n);r(o)||i({result:o},"Frontend rolled back")}},mcp:{tool:"fs_frontend_rollback",title:"Roll back a business frontend",description:"Roll a business's frontend back to a prior release by its releaseId (manifest hash, from fs_frontend_status). Flips the live pointer back and pins it. The releaseId must belong to this target's build history.",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe(Fd),releaseId:a.string().describe("The prior release id (manifest hash) to re-activate."),environmentId:a.string().optional().describe(J_),...Pe},handler:async(t,e)=>{let n=await Q_(t,e.businessId);return t.builderFrontendRollback(n,{releaseId:e.releaseId,environmentId:e.environmentId},{idempotencyKey:e.idempotencyKey})}}}];var tR=[{opKey:"usage.read",operationClass:"operate",scope:["businesses:read"],sideEffect:"read",cli:{group:"usage",command:"summary",summary:"Show usage summary for the last 30 days",args:[{field:"businessId",kind:"positional",token:"<businessIdOrName>",resolveBusiness:!0}],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=await t.managementGetUsage(i);n({businessId:i,summary:r},"Usage summary")}},mcp:{tool:"fs_usage_read",title:"Read usage summary",description:"Read a business's usage summary \u2014 metered request counts and tier utilization. Read-only.",annotations:{readOnlyHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe("The business id whose usage to read.")},handler:async(t,{businessId:e})=>t.managementGetUsage(e)}}];var nR=[{opKey:"persona.bootstrap",operationClass:"operate",scope:["businesses:read"],sideEffect:"write",cli:{group:"persona",command:"bootstrap",summary:"Issue a fresh fsk_test_ API key in a test environment",args:[{field:"businessId",kind:"positional",token:"<businessIdOrName>",resolveBusiness:!0},{field:"env",kind:"flag",token:"--env <env>",describe:"Environment name (must be test-strategy)",required:!0},{field:"plan",kind:"flag",token:"--plan <planKey>",describe:"Plan key to assign (e.g. starter)"},{field:"displayName",kind:"flag",token:"--display-name <name>",describe:"Persona display name"}],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=await ey(t,i,e.env),o=await t.issuePersonaBootstrapKey(i,r,{planKey:e.plan,displayName:e.displayName});n({businessId:i,environmentId:r,result:o},"Persona bootstrapped")}},mcp:{tool:"fs_persona_bootstrap",title:"Bootstrap a test persona",description:"Issue a one-time test bootstrap key for a business environment \u2014 use it to provision a test persona. Returns the key ONCE; store it now.",returnsOneTimeSecret:!0,annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!1},inputSchema:{businessId:a.string().describe("The business id."),environmentId:a.string().describe("The environment id to scope the persona to.")},handler:async(t,{businessId:e,environmentId:n})=>t.issuePersonaBootstrapKey(e,n)}},{opKey:"persona.read",operationClass:"operate",scope:["businesses:read"],sideEffect:"read",cli:{group:"persona",command:"list",summary:"List personas for a test environment",args:[{field:"businessId",kind:"positional",token:"<businessIdOrName>",resolveBusiness:!0},{field:"env",kind:"flag",token:"--env <env>",describe:"Environment name",required:!0}],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=await ey(t,i,e.env),o=await t.listPersonas(i,r);n({businessId:i,environmentId:r,result:o},"Personas")}},mcp:{tool:"fs_persona_list",title:"List personas",description:"List a business environment's test personas (id, label, status). Read-only.",annotations:{readOnlyHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe("The business id."),environmentId:a.string().describe("The environment id whose personas to list.")},handler:async(t,{businessId:e,environmentId:n})=>t.listPersonas(e,n)}},{opKey:"persona.revoke",operationClass:"operate",scope:["businesses:update"],sideEffect:"write",cli:{group:"persona",command:"revoke",summary:"Revoke a persona's API key",args:[{field:"businessId",kind:"positional",token:"<businessIdOrName>",resolveBusiness:!0},{field:"personaId",kind:"positional",token:"<personaId>"},{field:"env",kind:"flag",token:"--env <env>",describe:"Environment name",required:!0}],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=e.personaId,o=await ey(t,i,e.env),s=await t.revokePersona(i,o,r);n({businessId:i,environmentId:o,result:s},`Persona ${r} revoked`)}},mcp:{tool:"fs_persona_revoke",title:"Revoke a persona",description:"Revoke a test persona. Its credentials stop working.",annotations:{readOnlyHint:!1,destructiveHint:!0,idempotentHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe("The business id."),environmentId:a.string().describe("The environment id."),personaId:a.string().describe("The persona id to revoke.")},handler:async(t,{businessId:e,environmentId:n,personaId:i})=>t.revokePersona(e,n,i)}}];async function ey(t,e,n){try{return await Ji(t,e,n)}catch(i){throw new N(i instanceof Error?i.message:`Environment "${n}" not found on business ${e}.`,void 0,{code:"ENV_NOT_FOUND"})}}function x6(t){if(!t||typeof t!="object")return[];let e=t;return Array.isArray(e.data)?e.data:Array.isArray(e.tokens)?e.tokens:Array.isArray(t)?t:[]}var rR=[{opKey:"maker_token.read",operationClass:"operate",scope:[],sideEffect:"read",cli:{group:"token",command:"list",summary:"List maker tokens in the current org",args:[],handler:async({client:t,emit:e})=>{let n=x6(await t.managementListMakerTokens());e({count:n.length,tokens:n.map(i=>({id:i.id,name:i.name??null,scopes:i.scopes??[],businessId:i.businessId??null,lastFour:i.lastFour??null,createdAt:i.createdAt??null,revokedAt:i.revokedAt??null}))},`${n.length} token(s)`)}},mcp:{tool:"fs_maker_token_list",title:"List maker tokens",description:"List the workspace's maker tokens (mk_) \u2014 id, label, scopes, last-four, status. Read-only; secrets are never shown. Creating/revoking maker tokens is intentionally not exposed via MCP.",annotations:{readOnlyHint:!0,openWorldHint:!1},inputSchema:{},handler:async t=>t.managementListMakerTokens()}},{opKey:"maker_token.create",operationClass:"operate",scope:["businesses:update"],sideEffect:"write",cli:{group:"token",command:"create",summary:"Create a new maker token (returns the secret once)",args:[{field:"name",kind:"flag",token:"--name <name>",describe:"Human-friendly token name",required:!0},{field:"scope",kind:"flag",token:"--scope <scope...>",describe:"Scope(s) to attach (e.g. businesses:update businesses:publish)"},{field:"business",kind:"flag",token:"--business <businessId>",describe:"Scope to a specific business"},{field:"restrict",kind:"flag",token:"--restrict <perm...>",describe:"Narrow the token's role bundle to these permissions (e.g. business:read plan:read). Must be within your own permissions."}],handler:async({client:t,args:e,emit:n})=>{let i=await t.managementCreateMakerToken({name:e.name,scopes:e.scope,businessId:e.business,restrictedPermissions:e.restrict});n({result:i},"Token created")}},mcp:null},{opKey:"maker_token.revoke",operationClass:"operate",scope:["businesses:update"],sideEffect:"write",cli:{group:"token",command:"revoke",summary:"Revoke a maker token. Requires --yes.",destructive:!0,yesMessage:"Pass --yes to confirm token revocation.",args:[{field:"tokenId",kind:"positional",token:"<tokenId>"}],handler:async({client:t,args:e,emit:n})=>{let i=e.tokenId;await t.managementRevokeMakerToken(i),n({revoked:i},`Token ${i} revoked`)}},mcp:null},{opKey:"maker_token.rotate",operationClass:"operate",scope:["businesses:update"],sideEffect:"write",cli:{group:"token",command:"rotate",summary:"Rotate a maker token secret (returns the new secret once)",idempotent:!0,args:[{field:"tokenId",kind:"positional",token:"<tokenId>"},{field:"syncToGithub",kind:"flag",token:"--sync-to-github",describe:"Also update the connected GitHub repo FARTHERSHORE_TOKEN secret when this is a platform token"}],handler:async({client:t,args:e,reqOpts:n,emit:i})=>{let r=e.tokenId,o=await t.managementRotateMakerToken(r,{syncToGithub:e.syncToGithub===!0},n);i({result:o},`Token ${r} rotated`)}},mcp:null},{opKey:"maker_token.hard_delete",operationClass:"operate",scope:["businesses:update"],sideEffect:"write",cli:{group:"token",command:"delete",summary:"Permanently delete an already-revoked maker token. Requires --yes.",destructive:!0,yesMessage:"Pass --yes to permanently delete the revoked token row.",args:[{field:"tokenId",kind:"positional",token:"<tokenId>"}],handler:async({client:t,args:e,emit:n})=>{let i=e.tokenId;await t.managementHardDeleteMakerToken(i),n({deleted:i},`Token ${i} permanently deleted`)}},mcp:null}];var iR=[{opKey:"apply_timeline.list",operationClass:"operate",scope:["businesses:read"],sideEffect:"read",cli:{group:"apply-timeline",command:"list",summary:"List a business's Apply Timeline: repo-triggered manifest applies (PRs, pushes, releases), checks, semantic diffs, and apply phases.",args:[{field:"businessId",kind:"positional",token:"<businessIdOrName>",resolveBusiness:!0},{field:"env",kind:"flag",token:"--env <env>",describe:"Environment scope: production, all, or a preview environment name."}],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=await t.listApplyTimeline(i,{env:e.env});n({businessId:i,count:r.data.length,applyTimeline:r.data},`${r.data.length} apply timeline entr(ies)`)}},mcp:null},{opKey:"apply_timeline.read",operationClass:"operate",scope:["businesses:read"],sideEffect:"read",cli:{group:"apply-timeline",command:"inspect",summary:"Inspect one Apply Timeline entry by id, PR number, branch, or commit SHA.",args:[{field:"businessId",kind:"positional",token:"<businessIdOrName>",resolveBusiness:!0},{field:"selector",kind:"positional",token:"<id|pr|branch|sha>"},{field:"env",kind:"flag",token:"--env <env>",describe:"Environment scope: production, all, or a preview environment name."}],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=String(e.selector),o=await t.listApplyTimeline(i,{env:e.env}),s=o.data.find(c=>c.id===r)??o.data.find(c=>c.prNumber!==null&&String(c.prNumber)===r)??o.data.find(c=>c.branch===r)??o.data.find(c=>c.commitSha.startsWith(r));if(!s)throw new N(`Apply timeline entry ${r} was not found.`,404,{code:"APPLY_TIMELINE_ENTRY_NOT_FOUND"});n({businessId:i,applyTimelineEntry:s},`Apply timeline entry ${s.id}: ${s.status}`)}},mcp:null}];var pa="The business id or slug.",ma="The subscriber (client org) id \u2014 from `consumer list`.",ty="The governed ChangeSet id.",Bd={field:"businessId",kind:"positional",token:"<businessIdOrSlug>",describe:pa,resolveBusiness:!0},qd={field:"subscriberId",kind:"positional",token:"<subscriberId>",describe:ma},oR={field:"changeSetId",kind:"positional",token:"<changeSetId>",describe:ty},Vd={field:"env",kind:"flag",token:"--env <env>",describe:"Environment name/id to scope the proposal to."};function S6(t){let e;try{e=JSON.parse(t)}catch{throw new N("--operations must be a JSON array of governed operations.",0,{code:"INVALID_OPERATIONS"})}if(!Array.isArray(e))throw new N("--operations must be a JSON array.",0,{code:"INVALID_OPERATIONS"});return e}async function Hd(t,e){return ke(t,e)}var sR=[{opKey:"change_set.propose",operationClass:"operate",scope:["businesses:update"],sideEffect:"write",cli:{group:"proposal",command:"create",summary:"Propose a governed ChangeSet against a subscriber (agent/builder proposer; a human approves + applies in the portal)",idempotent:!0,args:[Bd,qd,{field:"intent",kind:"flag",token:"--intent <intent>",describe:"Human-readable description of the proposed change.",required:!0},{field:"operations",kind:"flag",token:"--operations <json>",describe:"JSON array of governed operations (e.g. update_role_permissions).",required:!0,parser:t=>S6(t)},Vd],handler:async({client:t,args:e,reqOpts:n,emit:i,emitDryRunPreview:r})=>{let o=e.businessId,s=e.subscriberId,c=await t.proposeConsumerChangeSet(o,s,{intent:e.intent,operations:e.operations,...n.idempotencyKey?{idempotencyKey:n.idempotencyKey}:{}},{env:e.env},n);r(c)||i(c,"ChangeSet proposed")}},mcp:{tool:"fs_proposal_create",title:"Propose a governed ChangeSet",description:"Propose a governed ChangeSet against a subscriber's live RBAC state (Agent Proposal Flow). Creates a DRAFT proposal that a HUMAN in the subscriber org must preview, approve, and apply in the portal \u2014 an agent can propose but never self-approve or apply. Operate-class live-state action; does not edit repo-authored business behavior.",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!0},inputSchema:{businessId:a.string().describe(pa),subscriberId:a.string().describe(ma),intent:a.string().describe("Human-readable description of the proposed change."),operations:a.array(a.record(a.string(),a.unknown())).describe("Governed operations, e.g. [{ type: 'update_role_permissions', schemaVersion: 1, target: { resourceType: 'subscriber_business_role', resourceId: '<roleKey>' }, payload: { permissions: [...] } }]."),env:a.string().optional().describe("Environment name/id to scope the proposal to."),idempotencyKey:a.string().optional().describe("Replay-safe idempotency key for the proposal.")},handler:async(t,e)=>{let n=await Hd(t,e.businessId);return t.proposeConsumerChangeSet(n,e.subscriberId,{intent:e.intent,operations:e.operations,...e.idempotencyKey?{idempotencyKey:e.idempotencyKey}:{}},{env:e.env})}}},{opKey:"change_set.preview",operationClass:"operate",scope:["businesses:update"],sideEffect:"write",cli:{group:"proposal",command:"preview",summary:"Simulate + store a preview on a proposed ChangeSet (rides the propose authority)",args:[Bd,qd,oR,Vd],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=await t.previewConsumerChangeSet(i,e.subscriberId,e.changeSetId,{env:e.env});n(r,"ChangeSet preview stored")}},mcp:{tool:"fs_proposal_preview",title:"Preview a proposed ChangeSet",description:"Simulate the impact of a proposed ChangeSet and store the preview (Agent Proposal Flow). Enforced by the same authority as propose \u2014 there is no separate preview permission. Read-shaped but writes the stored simulation; does not apply the change.",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!0},inputSchema:{businessId:a.string().describe(pa),subscriberId:a.string().describe(ma),changeSetId:a.string().describe(ty),env:a.string().optional().describe("Environment name/id.")},handler:async(t,e)=>{let n=await Hd(t,e.businessId);return t.previewConsumerChangeSet(n,e.subscriberId,e.changeSetId,{env:e.env})}}},{opKey:"change_set.proposal_list",operationClass:"operate",scope:["businesses:read"],sideEffect:"read",cli:{group:"proposal",command:"list",summary:"List governed ChangeSets proposed against a subscriber",args:[Bd,qd,{field:"status",kind:"flag",token:"--status <status>",describe:"Filter by status (e.g. draft, approval_required)."},Vd],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=await t.listConsumerChangeSets(i,e.subscriberId,{env:e.env,status:e.status});n(r,"Proposed ChangeSets")}},mcp:{tool:"fs_proposal_list",title:"List proposed ChangeSets",description:"List governed ChangeSets proposed against a subscriber (Agent Proposal Flow). Read-only; use it to discover proposal ids + their status before previewing.",annotations:{readOnlyHint:!0,openWorldHint:!0},inputSchema:{businessId:a.string().describe(pa),subscriberId:a.string().describe(ma),status:a.string().optional().describe("Filter by status (e.g. draft, approval_required)."),env:a.string().optional().describe("Environment name/id.")},handler:async(t,e)=>{let n=await Hd(t,e.businessId);return t.listConsumerChangeSets(n,e.subscriberId,{env:e.env,status:e.status})}}},{opKey:"change_set.proposal_read",operationClass:"operate",scope:["businesses:read"],sideEffect:"read",cli:{group:"proposal",command:"get",summary:"Read one governed ChangeSet proposed against a subscriber",args:[Bd,qd,oR,Vd],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=await t.getConsumerChangeSet(i,e.subscriberId,e.changeSetId,{env:e.env});n(r,"ChangeSet")}},mcp:{tool:"fs_proposal_get",title:"Read a proposed ChangeSet",description:"Read one governed ChangeSet proposed against a subscriber (Agent Proposal Flow) \u2014 its operations, risk, simulation, approvals, and status. Read-only.",annotations:{readOnlyHint:!0,openWorldHint:!0},inputSchema:{businessId:a.string().describe(pa),subscriberId:a.string().describe(ma),changeSetId:a.string().describe(ty),env:a.string().optional().describe("Environment name/id.")},handler:async(t,e)=>{let n=await Hd(t,e.businessId);return t.getConsumerChangeSet(n,e.subscriberId,e.changeSetId,{env:e.env})}}}];var br="The business id or slug.",fa="The webhook endpoint id.",Qi="billing:manage",eo={field:"businessId",kind:"positional",token:"<businessIdOrSlug>",describe:br,resolveBusiness:!0},Kd={field:"webhookId",kind:"positional",token:"<webhookId>",describe:fa},aR={field:"events",kind:"flag",token:"--events <events>",describe:"Comma-separated event names, e.g. subscription.created,payment.failed"},cR={field:"limit",kind:"flag",token:"--limit <n>",describe:"Max rows to return."};function uR(t){if(typeof t!="string")return;let e=t.split(",").map(n=>n.trim()).filter(n=>n.length>0);return e.length>0?e:void 0}function lR(t){if(!t||typeof t!="object")return[];let e=t;return Array.isArray(e.data)?e.data:[]}function dR(t,e){if(!t||typeof t!="object")return e;let n=t;return typeof n.total=="number"?n.total:typeof n.pagination?.total=="number"?n.pagination.total:e}function $6(t){let e=t.enable===!0,n=t.disable===!0;if(e&&n)throw new N("Pass either --enable or --disable, not both.",400,{code:"VALIDATION_ERROR",param:"enabled"});if(e)return!0;if(n)return!1}async function to(t,e){return ke(t,e)}var pR=[{opKey:"webhook.read",operationClass:"operate",scope:[Qi],sideEffect:"read",cli:{group:"webhook",command:"list",summary:"List API-managed webhook endpoints",args:[eo,cR],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=await t.managementListWebhooks(i,{limit:e.limit}),o=lR(r);n({businessId:i,count:o.length,total:dR(r,o.length),webhooks:o},`${o.length} webhook(s)`)}},mcp:{tool:"fs_webhook_list",title:"List webhook endpoints",description:"List API-managed outbound webhook endpoints for a business. Read-only; signing secrets are never returned.",annotations:{readOnlyHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe(br),limit:a.string().optional().describe("Max rows to return.")},handler:async(t,e)=>{let n=await to(t,e.businessId);return t.managementListWebhooks(n,{limit:e.limit})}}},{opKey:"webhook.create",operationClass:"operate",scope:[Qi],sideEffect:"write",cli:{group:"webhook",command:"create",summary:"Create an API-managed webhook endpoint",idempotent:!0,args:[eo,{field:"url",kind:"flag",token:"--url <url>",describe:"HTTPS receiver URL.",required:!0},{...aR,required:!0}],handler:async({client:t,args:e,reqOpts:n,emit:i,emitDryRunPreview:r})=>{let o=uR(e.events);if(!o)throw new N("At least one webhook event is required.",400,{code:"VALIDATION_ERROR",param:"events"});let s=await t.managementCreateWebhook(e.businessId,{url:e.url,events:o},n);r(s)||i({businessId:e.businessId,webhook:s.data},"Webhook endpoint created")}},mcp:{tool:"fs_webhook_create",title:"Create webhook endpoint",description:"Create an API-managed outbound webhook endpoint for a business. Returns the signing secret once. If webhooks are declared in business/index.ts, Core returns 409 MANAGED_BY_CODE and the repo must be edited instead.",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!0},returnsOneTimeSecret:!0,inputSchema:{businessId:a.string().describe(br),url:a.string().url().describe("HTTPS receiver URL."),events:a.array(a.string()).min(1).describe("Webhook event names to subscribe to."),...Pe},handler:async(t,e)=>{let n=await to(t,e.businessId);return t.managementCreateWebhook(n,{url:e.url,events:e.events},{idempotencyKey:e.idempotencyKey})}}},{opKey:"webhook.update",operationClass:"operate",scope:[Qi],sideEffect:"write",cli:{group:"webhook",command:"update",summary:"Update a webhook endpoint's events or enabled state",idempotent:!0,args:[eo,Kd,aR,{field:"enable",kind:"flag",token:"--enable",describe:"Enable delivery for this endpoint."},{field:"disable",kind:"flag",token:"--disable",describe:"Disable delivery for this endpoint."}],handler:async({client:t,args:e,reqOpts:n,emit:i,emitDryRunPreview:r})=>{let o=uR(e.events),s=$6(e);if(!o&&s===void 0)throw new N("Pass --events, --enable, or --disable to update a webhook.",400,{code:"VALIDATION_ERROR"});let c=await t.managementUpdateWebhook(e.businessId,e.webhookId,{...o?{events:o}:{},...s!==void 0?{enabled:s}:{}},n);r(c)||i({businessId:e.businessId,webhook:c.data},"Webhook endpoint updated")}},mcp:{tool:"fs_webhook_update",title:"Update webhook endpoint",description:"Update an API-managed webhook endpoint's event list and/or enabled state. URL and secret are immutable; create a new endpoint for those changes.",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe(br),webhookId:a.string().describe(fa),events:a.array(a.string()).min(1).optional().describe("Replacement webhook event list."),enabled:a.boolean().optional().describe("Enable or disable delivery."),...Pe},handler:async(t,e)=>{let n=await to(t,e.businessId);return t.managementUpdateWebhook(n,e.webhookId,{events:e.events,enabled:e.enabled},{idempotencyKey:e.idempotencyKey})}}},{opKey:"webhook.delete",operationClass:"operate",scope:[Qi],sideEffect:"write",cli:{group:"webhook",command:"delete",summary:"Delete an API-managed webhook endpoint. Requires --yes.",destructive:!0,yesMessage:"Pass --yes to confirm webhook endpoint deletion.",args:[eo,Kd],handler:async({client:t,args:e,emit:n})=>{await t.managementDeleteWebhook(e.businessId,e.webhookId),n({businessId:e.businessId,deleted:e.webhookId},"Webhook endpoint deleted")}},mcp:{tool:"fs_webhook_delete",title:"Delete webhook endpoint",description:"Delete an API-managed outbound webhook endpoint. If webhooks are repo-managed, Core returns 409 MANAGED_BY_CODE.",annotations:{readOnlyHint:!1,destructiveHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe(br),webhookId:a.string().describe(fa)},handler:async(t,e)=>{let n=await to(t,e.businessId);return t.managementDeleteWebhook(n,e.webhookId)}}},{opKey:"webhook.test",operationClass:"operate",scope:[Qi],sideEffect:"write",cli:{group:"webhook",command:"test",summary:"Send a signed test event to a webhook endpoint",args:[eo,Kd],handler:async({client:t,args:e,emit:n})=>{let i=await t.managementTestWebhook(e.businessId,e.webhookId);n({businessId:e.businessId,result:i},"Webhook test sent")}},mcp:{tool:"fs_webhook_test",title:"Test webhook endpoint",description:"Send a signed test event to an API-managed webhook endpoint and persist the delivery result.",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!0},inputSchema:{businessId:a.string().describe(br),webhookId:a.string().describe(fa)},handler:async(t,e)=>{let n=await to(t,e.businessId);return t.managementTestWebhook(n,e.webhookId)}}},{opKey:"webhook.delivery.read",operationClass:"operate",scope:[Qi],sideEffect:"read",cli:{group:"webhook",command:"deliveries",summary:"List recent delivery attempts for a webhook endpoint",args:[eo,Kd,cR],handler:async({client:t,args:e,emit:n})=>{let i=await t.managementListWebhookDeliveries(e.businessId,e.webhookId,{limit:e.limit}),r=lR(i);n({businessId:e.businessId,webhookId:e.webhookId,count:r.length,total:dR(i,r.length),deliveries:r},`${r.length} delivery attempt(s)`)}},mcp:{tool:"fs_webhook_deliveries",title:"List webhook deliveries",description:"List recent delivery attempts for a webhook endpoint. Payload and response body are intentionally omitted by Core.",annotations:{readOnlyHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe(br),webhookId:a.string().describe(fa),limit:a.string().optional().describe("Max rows to return.")},handler:async(t,e)=>{let n=await to(t,e.businessId);return t.managementListWebhookDeliveries(n,e.webhookId,{limit:e.limit})}}}];var no="The business id or slug.",Bn="operator",ha={field:"businessId",kind:"positional",token:"<businessIdOrSlug>",describe:no,resolveBusiness:!0};async function ga(t,e){return ke(t,e)}var mR=[{opKey:"agents.list",operationClass:"operate",scope:["businesses:read"],sideEffect:"read",cli:{group:"agents",command:"list",summary:"List a business's operating agents + enableable roles",args:[ha],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=await t.builderListAgents(i);n({businessId:i,...r},`${r.agents.length} agent(s) \u2014 enableable roles: ${r.availableRoles.join(", ")}`)}},mcp:{tool:"fs_agents_list",title:"List operating agents",description:"The agent roster for a business: the enabled/disabled Operator plus any roles that can still be enabled. Read-only.",annotations:{readOnlyHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe(no)},handler:async(t,e)=>{let n=await ga(t,e.businessId);return t.builderListAgents(n)}}},{opKey:"agents.status",operationClass:"operate",scope:["businesses:read"],sideEffect:"read",cli:{group:"agents",command:"status",summary:"The Operator's activation state, recent runs, and usage totals",args:[ha],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=await t.builderAgentStatus(i,Bn);n({businessId:i,...r},`operator: ${r.enabled?"ENABLED":"disabled"} \u2014 last run ${r.lastRunAt??"never"}; ${r.recentRuns.length} recent run(s); ${r.usage.tokensIn+r.usage.tokensOut} tokens, ${r.usage.actionsCount} action(s) lifetime`)}},mcp:{tool:"fs_agents_status",title:"Get the Operator's status",description:"The Operator's activation state, recent run history (newest-first), and lifetime usage totals (LLM tokens + actions). Read-only.",annotations:{readOnlyHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe(no)},handler:async(t,e)=>{let n=await ga(t,e.businessId);return t.builderAgentStatus(n,Bn)}}},{opKey:"agents.runs.show",operationClass:"operate",scope:["businesses:read"],sideEffect:"read",cli:{group:"agents",command:"runs-show",summary:"One run's full paper trail: trace, launches, action receipts",args:[ha,{field:"runId",kind:"positional",token:"<runId>",describe:"The agent run id (from `agents status`)."}],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=await t.builderAgentRunDetail(i,Bn,e.runId),o=r.launches?.length??0,s=r.actions?.length??0;n({businessId:i,...r},`run ${r.run?.id}: ${o} launch(es), ${s} action receipt(s)`)}},mcp:{tool:"fs_agents_run_show",title:"Get one agent run's paper trail",description:"One run's full audit view: the orchestrator's trace summary (composed launches, verify flags, catalog changes), the per-launch performance ledger, and every platform-action receipt. Read-only.",annotations:{readOnlyHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe(no),runId:a.string().describe("The agent run id.")},handler:async(t,e)=>{let n=await ga(t,e.businessId);return t.builderAgentRunDetail(n,Bn,e.runId)}}},{opKey:"agents.enable",operationClass:"operate",scope:["businesses:update"],sideEffect:"write",cli:{group:"agents",command:"enable",summary:"Turn the Operator on (creates it on first enable)",args:[ha],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=await t.builderConfigureAgent(i,Bn,{enabled:!0});n({businessId:i,agent:r},"operator ENABLED \u2014 it runs autonomously on its cadence and posts to the bulletin; usage bills while enabled")}},mcp:{tool:"fs_agents_enable",title:"Enable the Operator",description:"Turn the business's Operator agent on (created on first enable). It runs autonomously on its cadence; agent-work billing accrues while enabled.",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe(no)},handler:async(t,e)=>{let n=await ga(t,e.businessId);return t.builderConfigureAgent(n,Bn,{enabled:!0})}}},{opKey:"agents.disable",operationClass:"operate",scope:["businesses:update"],sideEffect:"write",cli:{group:"agents",command:"disable",summary:"Turn the Operator off (stops runs + billing)",args:[ha],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=await t.builderConfigureAgent(i,Bn,{enabled:!1});n({businessId:i,agent:r},"operator disabled \u2014 no further runs; billing stops accruing")}},mcp:{tool:"fs_agents_disable",title:"Disable the Operator",description:"Turn the Operator off: the dispatcher stops scheduling runs and agent-work billing stops accruing. Re-enable at any time.",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe(no)},handler:async(t,e)=>{let n=await ga(t,e.businessId);return t.builderConfigureAgent(n,Bn,{enabled:!1})}}}];var ba="The business id or slug.",Jd="The bulletin post id.",Gd={field:"businessId",kind:"positional",token:"<businessIdOrSlug>",describe:ba,resolveBusiness:!0},ny={field:"postId",kind:"positional",token:"<postId>",describe:Jd};async function Wd(t,e){return ke(t,e)}var fR=[{opKey:"bulletin.list",operationClass:"operate",scope:["businesses:read"],sideEffect:"read",cli:{group:"bulletin",command:"list",summary:"List the agents' bulletin feed (trends + change requests)",args:[Gd,{field:"kind",kind:"flag",token:"--kind <kind>",describe:"Filter: trend | insight | change_request"},{field:"status",kind:"flag",token:"--status <status>",describe:"Filter: open | acknowledged | resolved"},{field:"limit",kind:"flag",token:"--limit <n>",describe:"Max rows to return."}],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=await t.builderListBulletin(i,{kind:e.kind,status:e.status,limit:e.limit});n({businessId:i,...r},`${r.items.length} post(s)${r.nextCursor?" (more available)":""}`)}},mcp:{tool:"fs_bulletin_list",title:"List bulletin posts",description:"The agents' bulletin feed for a business: trend/insight posts (aggregated data + deltas) and change_request posts (the coding agent's backlog \u2014 filter --kind change_request --status open). Read-only.",annotations:{readOnlyHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe(ba),kind:a.enum(["trend","insight","change_request"]).optional().describe("Filter by post kind."),status:a.enum(["open","acknowledged","resolved"]).optional().describe("Filter by post status."),limit:a.string().optional().describe("Max rows to return.")},handler:async(t,e)=>{let n=await Wd(t,e.businessId);return t.builderListBulletin(n,{kind:e.kind,status:e.status,limit:e.limit})}}},{opKey:"bulletin.read",operationClass:"operate",scope:["businesses:read"],sideEffect:"read",cli:{group:"bulletin",command:"show",summary:"Show one bulletin post (full body + data payload)",args:[Gd,ny],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=await t.builderGetBulletinPost(i,e.postId);n({businessId:i,post:r},`[${r.kind}] ${r.title} \u2014 ${r.status}${r.changeSetId?` (changeSet ${r.changeSetId})`:""}`)}},mcp:{tool:"fs_bulletin_show",title:"Show a bulletin post",description:"One bulletin post in full: markdown body, the dataJson payload backing the claim, and for change requests the referenced ChangeSet id + proposal. Read-only.",annotations:{readOnlyHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe(ba),postId:a.string().describe(Jd)},handler:async(t,e)=>{let n=await Wd(t,e.businessId);return t.builderGetBulletinPost(n,e.postId)}}},{opKey:"bulletin.ack",operationClass:"operate",scope:["businesses:update"],sideEffect:"write",cli:{group:"bulletin",command:"ack",summary:"Acknowledge a post (the coding agent picked it up)",args:[Gd,ny],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=await t.builderSetBulletinStatus(i,e.postId,"acknowledged");n({businessId:i,post:r},`Post acknowledged: ${r.title}`)}},mcp:{tool:"fs_bulletin_ack",title:"Acknowledge a bulletin post",description:"Mark a bulletin post acknowledged \u2014 the hand-off signal that the coding agent (or builder) has picked the item up. Forward-only; idempotent on an already-acknowledged post.",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe(ba),postId:a.string().describe(Jd)},handler:async(t,e)=>{let n=await Wd(t,e.businessId);return t.builderSetBulletinStatus(n,e.postId,"acknowledged")}}},{opKey:"bulletin.resolve",operationClass:"operate",scope:["businesses:update"],sideEffect:"write",cli:{group:"bulletin",command:"resolve",summary:"Resolve a post (the work landed)",args:[Gd,ny],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=await t.builderSetBulletinStatus(i,e.postId,"resolved");n({businessId:i,post:r},`Post resolved: ${r.title}`)}},mcp:{tool:"fs_bulletin_resolve",title:"Resolve a bulletin post",description:"Mark a bulletin post resolved \u2014 the referenced work landed (or the trend was addressed). Terminal state.",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe(ba),postId:a.string().describe(Jd)},handler:async(t,e)=>{let n=await Wd(t,e.businessId);return t.builderSetBulletinStatus(n,e.postId,"resolved")}}}];var ro="The business id or slug.",Xd="The promo code id.",iy=["percent_off","amount_off","free_months"],_a="promo-code",ya={field:"businessId",kind:"positional",token:"<businessIdOrSlug>",describe:ro,resolveBusiness:!0},ry={field:"promoCodeId",kind:"positional",token:"<promoCodeId>",describe:Xd},hR={field:"plan",kind:"flag",token:"--plan <planId>",describe:"Limit to a plan id. Repeatable. Omit for all launch plans; use --all-plans on update to clear scoped plans.",parser:(t,e)=>[...e,t],defaultValue:[]};function gR(t){if(typeof t!="string")return;let e=t.trim().toLowerCase();if(iy.includes(e))return e;throw new N(`Invalid promo code kind "${t}". Use percent_off, amount_off, or free_months.`,400,{code:"INVALID_PROMO_CODE_KIND",param:"kind"})}function io(t,e){if(e===void 0)return;let n=typeof e=="number"?e:typeof e=="string"&&/^\d+$/.test(e.trim())?Number.parseInt(e,10):Number.NaN;if(!Number.isInteger(n)||n<=0)throw new N(`${t} must be a positive integer.`,400,{code:"INVALID_PROMO_CODE_FIELD",param:t});return n}function ka(t){return typeof t=="string"&&t.length>0?t:void 0}function bR(t,e){let n=io("percent",t.percent),i=io("amountCents",t.amountCents);if(n!==void 0&&i!==void 0)throw new N("Pass either --percent or --amount-cents, not both.",400,{code:"CONFLICTING_PROMO_AMOUNT_FLAGS",param:"amount"});if(e==="percent_off"){if(n===void 0)throw new N("percent_off promo codes require --percent.",400,{code:"INVALID_PROMO_CODE_FIELD",param:"percent"});if(n>100)throw new N("--percent must be between 1 and 100.",400,{code:"INVALID_PROMO_CODE_FIELD",param:"percent"});return n}if(e==="amount_off"){if(i===void 0)throw new N("amount_off promo codes require --amount-cents.",400,{code:"INVALID_PROMO_CODE_FIELD",param:"amountCents"});return i}if(e==="free_months"&&(n!==void 0||i!==void 0))throw new N("free_months promo codes do not accept --percent or --amount-cents.",400,{code:"INVALID_PROMO_CODE_FIELD",param:"amount"});return n??i}function _R(t){let e=t.plan??[];if(t.allPlans===!0&&e.length>0)throw new N("Pass either --plan or --all-plans, not both.",400,{code:"CONFLICTING_PROMO_PLAN_FLAGS",param:"plan"});return t.allPlans===!0?[]:e.length>0?e:void 0}function I6(t){let e=gR(t.kind);if(!e)throw new N("Promo code kind is required.",400,{code:"INVALID_PROMO_CODE_FIELD",param:"kind"});let n=io("durationMonths",t.durationMonths);if(n===void 0)throw new N("--duration-months is required.",400,{code:"INVALID_PROMO_CODE_FIELD",param:"durationMonths"});let i=_R(t);return{code:String(t.code),kind:e,amount:bR(t,e),durationMonths:n,...i!==void 0?{applicablePlanIds:i}:{},maxRedemptions:io("maxRedemptions",t.maxRedemptions),activeFrom:ka(t.activeFrom),activeUntil:ka(t.activeUntil)}}function w6(t){let e=gR(t.kind),n=io("durationMonths",t.durationMonths),i=io("maxRedemptions",t.maxRedemptions),r=_R(t);if(t.code!==void 0||e!==void 0||t.percent!==void 0||t.amountCents!==void 0||n!==void 0||i!==void 0||t.clearMaxRedemptions===!0||t.activeFrom!==void 0||t.activeUntil!==void 0||t.clearActiveFrom===!0||t.clearActiveUntil===!0||r!==void 0){if(e===void 0)throw new N("Promo-code spec updates rotate the Stripe coupon, so pass the complete spec: --kind plus --duration-months and the required amount flag for that kind.",400,{code:"PROMO_CODE_UPDATE_REQUIRES_FULL_SPEC",param:"kind"});if(n===void 0)throw new N("Promo-code spec updates require --duration-months.",400,{code:"PROMO_CODE_UPDATE_REQUIRES_FULL_SPEC",param:"durationMonths"})}let s={},c=ka(t.code);c!==void 0&&(s.code=c),e!==void 0&&(s.kind=e);let u=bR(t,e);if(u!==void 0&&(s.amount=u),n!==void 0&&(s.durationMonths=n),i!==void 0&&(s.maxRedemptions=i),t.clearMaxRedemptions===!0&&(s.maxRedemptions=null),r!==void 0&&(s.applicablePlanIds=r),t.activeFrom!==void 0&&(s.activeFrom=ka(t.activeFrom)??null),t.activeUntil!==void 0&&(s.activeUntil=ka(t.activeUntil)??null),t.clearActiveFrom===!0&&(s.activeFrom=null),t.clearActiveUntil===!0&&(s.activeUntil=null),Object.keys(s).length===0)throw new N("No promo-code fields to update. Pass --code, --kind, amount, duration, plan, status-window, or redemption flags.",400,{code:"PROMO_CODE_UPDATE_NO_FIELDS"});return s}async function va(t,e){return ke(t,e)}function Yd(t){return{status:t}}var yR=[{opKey:"promo_code.read",operationClass:"operate",scope:["businesses:read"],sideEffect:"read",cli:{group:_a,command:"list",summary:"List API-managed promo codes for checkout",args:[ya],handler:async({client:t,args:e,emit:n})=>{let i=await t.listPromoCodes(e.businessId);n({businessId:e.businessId,count:i.length,promoCodes:i},`${i.length} promo code(s)`)}},mcp:{tool:"fs_promo_code_list",title:"List promo codes",description:"List API-managed promo codes for a business. Promo codes are checkout operational state, not repo-authored Business SDK state.",annotations:{readOnlyHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe(ro)},handler:async(t,e)=>{let n=await va(t,e.businessId);return t.listPromoCodes(n)}}},{opKey:"promo_code.create",operationClass:"operate",scope:["businesses:update"],sideEffect:"write",cli:{group:_a,command:"create",summary:"Create an API-managed checkout promo code",args:[ya,{field:"code",kind:"flag",token:"--code <code>",describe:"Customer-entered promo code.",required:!0},{field:"kind",kind:"flag",token:"--kind <kind>",describe:"percent_off, amount_off, or free_months.",required:!0},{field:"percent",kind:"flag",token:"--percent <n>",describe:"Percent discount for percent_off promos."},{field:"amountCents",kind:"flag",token:"--amount-cents <cents>",describe:"Fixed discount in cents for amount_off promos."},{field:"durationMonths",kind:"flag",token:"--duration-months <n>",describe:"Discount duration in months.",required:!0},{field:"maxRedemptions",kind:"flag",token:"--max-redemptions <n>",describe:"Optional maximum redemption count."},{field:"activeFrom",kind:"flag",token:"--active-from <iso>",describe:"Optional ISO-8601 activation timestamp."},{field:"activeUntil",kind:"flag",token:"--active-until <iso>",describe:"Optional ISO-8601 expiration timestamp."},hR],handler:async({client:t,args:e,emit:n})=>{let i=await t.createPromoCode(e.businessId,I6(e));n({businessId:e.businessId,promoCode:i},"Promo code created")}},mcp:{tool:"fs_promo_code_create",title:"Create promo code",description:"Create an API-managed checkout promo code. Use percent for percent_off, amountCents for amount_off, and no amount for free_months.",annotations:{readOnlyHint:!1,destructiveHint:!1,openWorldHint:!0},inputSchema:{businessId:a.string().describe(ro),code:a.string().min(1).max(64),kind:a.enum(iy),percent:a.number().int().min(1).max(100).optional(),amountCents:a.number().int().positive().optional(),durationMonths:a.number().int().min(1).max(24),maxRedemptions:a.number().int().positive().optional(),activeFrom:a.string().datetime().optional(),activeUntil:a.string().datetime().optional(),applicablePlanIds:a.array(a.string()).optional()},handler:async(t,e)=>{let n=await va(t,e.businessId);return t.createPromoCode(n,{code:e.code,kind:e.kind,amount:e.kind==="percent_off"?e.percent:e.kind==="amount_off"?e.amountCents:void 0,durationMonths:e.durationMonths,maxRedemptions:e.maxRedemptions,activeFrom:e.activeFrom,activeUntil:e.activeUntil,applicablePlanIds:e.applicablePlanIds})}}},{opKey:"promo_code.update",operationClass:"operate",scope:["businesses:update"],sideEffect:"write",cli:{group:_a,command:"update",summary:"Update an API-managed checkout promo code",args:[ya,ry,{field:"code",kind:"flag",token:"--code <code>",describe:"Replacement customer-entered promo code."},{field:"kind",kind:"flag",token:"--kind <kind>",describe:"percent_off, amount_off, or free_months."},{field:"percent",kind:"flag",token:"--percent <n>",describe:"Percent discount for percent_off promos."},{field:"amountCents",kind:"flag",token:"--amount-cents <cents>",describe:"Fixed discount in cents for amount_off promos."},{field:"durationMonths",kind:"flag",token:"--duration-months <n>",describe:"Discount duration in months."},{field:"maxRedemptions",kind:"flag",token:"--max-redemptions <n>",describe:"Set maximum redemption count."},{field:"clearMaxRedemptions",kind:"flag",token:"--clear-max-redemptions",describe:"Clear the maximum redemption count."},{field:"activeFrom",kind:"flag",token:"--active-from <iso>",describe:"Set ISO-8601 activation timestamp."},{field:"clearActiveFrom",kind:"flag",token:"--clear-active-from",describe:"Clear activation timestamp."},{field:"activeUntil",kind:"flag",token:"--active-until <iso>",describe:"Set ISO-8601 expiration timestamp."},{field:"clearActiveUntil",kind:"flag",token:"--clear-active-until",describe:"Clear expiration timestamp."},hR,{field:"allPlans",kind:"flag",token:"--all-plans",describe:"Clear plan scoping so the promo applies to all launch plans."}],handler:async({client:t,args:e,emit:n})=>{let i=await t.updatePromoCode(e.businessId,e.promoCodeId,w6(e));n({businessId:e.businessId,promoCode:i},"Promo code updated")}},mcp:{tool:"fs_promo_code_update",title:"Update promo code",description:"Update an API-managed checkout promo code. Spec changes rotate the Stripe coupon/promotion code behind the scenes.",annotations:{readOnlyHint:!1,destructiveHint:!1,openWorldHint:!0},inputSchema:{businessId:a.string().describe(ro),promoCodeId:a.string().describe(Xd),code:a.string().min(1).max(64).optional(),kind:a.enum(iy).optional(),percent:a.number().int().min(1).max(100).optional(),amountCents:a.number().int().positive().optional(),durationMonths:a.number().int().min(1).max(24).optional(),maxRedemptions:a.number().int().positive().nullable().optional(),activeFrom:a.string().datetime().nullable().optional(),activeUntil:a.string().datetime().nullable().optional(),applicablePlanIds:a.array(a.string()).optional()},handler:async(t,e)=>{let n=await va(t,e.businessId),i={code:e.code,kind:e.kind,amount:e.kind==="percent_off"?e.percent:e.kind==="amount_off"?e.amountCents:void 0,durationMonths:e.durationMonths,maxRedemptions:e.maxRedemptions,activeFrom:e.activeFrom,activeUntil:e.activeUntil,applicablePlanIds:e.applicablePlanIds};return t.updatePromoCode(n,e.promoCodeId,i)}}},{opKey:"promo_code.archive",operationClass:"operate",scope:["businesses:update"],sideEffect:"write",cli:{group:_a,command:"archive",summary:"Archive a checkout promo code",args:[ya,ry],handler:async({client:t,args:e,emit:n})=>{let i=await t.updatePromoCode(e.businessId,e.promoCodeId,Yd("ARCHIVED"));n({businessId:e.businessId,promoCode:i},"Promo code archived")}},mcp:{tool:"fs_promo_code_archive",title:"Archive promo code",description:"Archive an API-managed checkout promo code.",annotations:{readOnlyHint:!1,destructiveHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe(ro),promoCodeId:a.string().describe(Xd)},handler:async(t,e)=>{let n=await va(t,e.businessId);return t.updatePromoCode(n,e.promoCodeId,Yd("ARCHIVED"))}}},{opKey:"promo_code.reactivate",operationClass:"operate",scope:["businesses:update"],sideEffect:"write",cli:{group:_a,command:"reactivate",summary:"Reactivate an archived checkout promo code",args:[ya,ry],handler:async({client:t,args:e,emit:n})=>{let i=await t.updatePromoCode(e.businessId,e.promoCodeId,Yd("ACTIVE"));n({businessId:e.businessId,promoCode:i},"Promo code reactivated")}},mcp:{tool:"fs_promo_code_reactivate",title:"Reactivate promo code",description:"Reactivate an archived API-managed checkout promo code.",annotations:{readOnlyHint:!1,destructiveHint:!1,openWorldHint:!1},inputSchema:{businessId:a.string().describe(ro),promoCodeId:a.string().describe(Xd)},handler:async(t,e)=>{let n=await va(t,e.businessId);return t.updatePromoCode(n,e.promoCodeId,Yd("ACTIVE"))}}}];var xa="The business id or slug.",tp="The subscriber id from `consumer list`.",Qd={field:"businessId",kind:"positional",token:"<businessIdOrSlug>",describe:xa,resolveBusiness:!0},oy={field:"subscriberId",kind:"positional",token:"<subscriberId>",describe:tp},E6={field:"env",kind:"flag",token:"--env <env>",describe:"Environment name for preview-scoped consumers."},vR="The member's external identity id (Clerk userId) within the client org.",T6="Comma-separated business-role keys to set (replaces the current assignment; pass an empty string to clear).",R6={field:"userExternalId",kind:"positional",token:"<userExternalId>",describe:vR};function O6(t){return t.split(",").map(e=>e.trim()).filter(Boolean)}var P6={field:"roles",kind:"flag",token:"--roles <roles>",describe:T6,required:!0,parser:t=>O6(t)};async function ep(t,e){return ke(t,e)}function A6(t){return Array.isArray(t)?t:[]}var kR=[{opKey:"consumer.read",operationClass:"operate",scope:["businesses:read"],sideEffect:"read",cli:{group:"consumer",command:"list",summary:"List users/consumers for a business",args:[Qd,E6],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=A6(await t.builderListConsumers(i,{env:e.env}));n({businessId:i,count:r.length,consumers:r},`${r.length} consumer(s)`)}},mcp:{tool:"fs_consumer_list",title:"List business consumers",description:"List users/consumers for a business. Read-only; use this to discover subscriber ids before blocking or removing a user.",annotations:{readOnlyHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe(xa),env:a.string().optional().describe("Environment name for preview-scoped consumers.")},handler:async(t,e)=>{let n=await ep(t,e.businessId);return t.builderListConsumers(n,{env:e.env})}}},{opKey:"consumer.block",operationClass:"operate",scope:["businesses:update"],sideEffect:"write",cli:{group:"consumer",command:"block",summary:"Block a user and revoke their active API keys",destructive:!0,yesMessage:"Blocking a user revokes active API keys. Pass --yes to confirm.",args:[Qd,oy],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=e.subscriberId,o=await t.builderBlockConsumer(i,r);n({businessId:i,subscriberId:r,result:o},`Consumer blocked: ${r}`)}},mcp:{tool:"fs_consumer_block",title:"Block business consumer",description:"Block a user/consumer for a business and revoke their active API keys. Destructive live-state operation; it does not edit repo-authored business behavior.",annotations:{readOnlyHint:!1,destructiveHint:!0,idempotentHint:!0,openWorldHint:!0},inputSchema:{businessId:a.string().describe(xa),subscriberId:a.string().describe(tp)},handler:async(t,e)=>{let n=await ep(t,e.businessId);return t.builderBlockConsumer(n,e.subscriberId)}}},{opKey:"consumer.remove",operationClass:"operate",scope:["businesses:update"],sideEffect:"write",cli:{group:"consumer",command:"remove",summary:"Force-remove a user from a business",destructive:!0,yesMessage:"Removing a user tears down subscriptions, edge credentials, and related live state. Pass --yes to confirm.",args:[Qd,oy],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=e.subscriberId,o=await t.builderRemoveConsumer(i,r);n({businessId:i,subscriberId:r,result:o},`Consumer removed: ${r}`)}},mcp:{tool:"fs_consumer_remove",title:"Remove business consumer",description:"Force-remove a user/consumer from a business, tearing down subscriptions, edge credentials, and related live state. Destructive and irreversible; it does not edit repo-authored business behavior.",annotations:{readOnlyHint:!1,destructiveHint:!0,openWorldHint:!0},inputSchema:{businessId:a.string().describe(xa),subscriberId:a.string().describe(tp)},handler:async(t,e)=>{let n=await ep(t,e.businessId);return t.builderRemoveConsumer(n,e.subscriberId)}}},{opKey:"consumer.roles.assign",operationClass:"operate",scope:["businesses:update"],sideEffect:"write",cli:{group:"consumer rbac",command:"assign",summary:"Replace a client-org member's Managed-RBAC business roles (builder support override)",args:[Qd,oy,R6,P6],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=e.subscriberId,o=e.userExternalId,s=e.roles,c=await t.builderAssignConsumerMemberRoles(i,r,o,s);n({businessId:i,subscriberId:r,membership:c},`Business roles set for ${o}: ${c.businessRoleKeys.length>0?c.businessRoleKeys.join(", "):"(none)"}`)}},mcp:{tool:"fs_consumer_rbac_assign",title:"Assign consumer member business roles",description:"Support override: replace a client-org member's Managed-RBAC business-role assignment on a business (set-replace \u2014 the given list becomes the member's full assignment; an empty list clears it). Role keys must exist in the org's role set. Live-state operation; it does not edit repo-authored business behavior.",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!0},inputSchema:{businessId:a.string().describe(xa),subscriberId:a.string().describe(tp),userExternalId:a.string().describe(vR),roles:a.array(a.string()).describe("Business-role keys to set (replaces the current assignment; [] clears it).")},handler:async(t,e)=>{let n=await ep(t,e.businessId);return t.builderAssignConsumerMemberRoles(n,e.subscriberId,e.userExternalId,e.roles)}}}];var cy="The business id or slug.",uy="Preview environment slug or id (omit for Main).",SR="Write-only secret name, e.g. POSTHOG_TOKEN.",N6=a.enum(["BUILD","RUNTIME"]);async function C6(){if(process.stdin.isTTY)throw new N("Pipe the secret value via stdin. Never pass a secret as a command-line flag.",400,{code:"VARIABLE_STDIN_REQUIRED"});let t="";for await(let e of process.stdin)t+=Buffer.isBuffer(e)?e.toString("utf8"):String(e);return t.replace(/\r?\n$/,"")}var z6=C6;async function np(t,e,n){return n?Ji(t,e,n):void 0}var Sa={field:"businessId",kind:"positional",token:"<businessIdOrSlug>",describe:cy,resolveBusiness:!0},sy={field:"name",kind:"positional",token:"<name>",describe:SR},rp={field:"env",kind:"flag",token:"--env <slug>",describe:uy},D6={field:"delivery",kind:"flag",token:"--delivery <phase>",describe:"Private delivery boundary: build or runtime. Build values are leak-scanned from artifacts; runtime values are injected only by Gateway.",required:!0};function ay(t,e){return{businessId:t,operation:e}}function xR(t){return{opKey:t==="set"?"business_variable.create":"business_variable.rotate",operationClass:"operate",scope:["businesses:update"],sideEffect:"write",cli:{group:"variables",command:t,summary:t==="set"?"Create a write-only secret from stdin":"Rotate a write-only secret from stdin",helpTextAfter:`
|
|
97
|
+
Example:
|
|
98
|
+
printf %s "$VALUE" | farthershore variables ${t} my-biz POSTHOG_TOKEN`,idempotent:!0,args:[Sa,sy,D6,rp],handler:async({client:e,args:n,reqOpts:i,emit:r})=>{let o=n.businessId,s=await e.builderSetBusinessVariable(o,n.name,{value:await z6(),delivery:N6.parse(String(n.delivery).toUpperCase()),environmentId:await np(e,o,n.env)},i);r(ay(o,s),`Secret ${n.name} ${s.pending?"publication pending":"active"}`)}},mcp:{tool:t==="set"?"fs_variable_set":"fs_variable_rotate",title:t==="set"?"Create a write-only secret":"Rotate a write-only secret",description:"Creates an immutable secret generation. Plaintext is accepted once and never returned.",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe(cy),name:a.string().describe(SR),value:a.string().min(1).describe("The write-only value."),delivery:a.enum(["BUILD","RUNTIME"]).describe("Exclusive private delivery boundary."),environmentId:a.string().optional().describe(uy),...Pe},handler:async(e,n)=>e.builderSetBusinessVariable(await ke(e,n.businessId),n.name,{value:n.value,delivery:n.delivery,environmentId:n.environmentId},{idempotencyKey:n.idempotencyKey})}}}var $R=[{opKey:"business_variable.read",operationClass:"operate",scope:["businesses:read"],sideEffect:"read",cli:{group:"variables",command:"list",summary:"List secret lifecycle metadata (never values)",args:[Sa,rp],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId,r=await np(t,i,e.env);n({businessId:i,environmentId:r??null,variables:await t.builderBusinessVariables(i,r)},"Write-only secrets")}},mcp:{tool:"fs_variable_list",title:"List write-only secrets",description:"Lists lifecycle and generation metadata. Plaintext is never returned.",annotations:{readOnlyHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string().describe(cy),environmentId:a.string().optional().describe(uy)},handler:async(t,e)=>t.builderBusinessVariables(await ke(t,e.businessId),e.environmentId)}},xR("set"),xR("rotate"),{opKey:"business_variable.revoke",operationClass:"operate",scope:["businesses:update"],sideEffect:"write",cli:{group:"variables",command:"revoke",summary:"Revoke runtime access to a secret. Requires --yes.",destructive:!0,yesMessage:"Revocation removes runtime availability once acknowledged. Pass --yes to confirm.",idempotent:!0,args:[Sa,sy,rp],handler:async({client:t,args:e,reqOpts:n,emit:i})=>{let r=e.businessId,o=await t.builderRevokeBusinessVariable(r,e.name,await np(t,r,e.env),n);i(ay(r,o),"Secret revocation submitted")}},mcp:{tool:"fs_variable_revoke",title:"Revoke a write-only secret",description:"Revokes runtime access after explicit confirmation and returns a durable operation.",annotations:{readOnlyHint:!1,destructiveHint:!0,idempotentHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string(),name:a.string(),environmentId:a.string().optional(),confirmation:a.literal("REVOKE"),...Pe},handler:async(t,e)=>t.builderRevokeBusinessVariable(await ke(t,e.businessId),e.name,e.environmentId,{idempotencyKey:e.idempotencyKey})}},{opKey:"business_variable.delete",operationClass:"operate",scope:["businesses:update"],sideEffect:"write",cli:{group:"variables",command:"rm",summary:"Destroy a revoked secret in Main or preview. Requires --yes.",destructive:!0,yesMessage:"Deletion permanently destroys ciphertext and requires acknowledged revocation first. Pass --yes to confirm.",idempotent:!0,args:[Sa,sy,rp],handler:async({client:t,args:e,reqOpts:n,emit:i})=>{let r=e.businessId,o=await t.builderDeleteBusinessVariable(r,e.name,await np(t,r,e.env),n);i(ay(r,o),"Secret deletion submitted")}},mcp:{tool:"fs_variable_rm",title:"Destroy a revoked secret",description:"Permanently destroys ciphertext after acknowledged revocation. Main and preview use the same contract.",annotations:{readOnlyHint:!1,destructiveHint:!0,idempotentHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string(),name:a.string(),environmentId:a.string().optional(),confirmation:a.literal("DELETE"),...Pe},handler:async(t,e)=>t.builderDeleteBusinessVariable(await ke(t,e.businessId),e.name,e.environmentId,{idempotencyKey:e.idempotencyKey})}},{opKey:"business_variable.operation.read",operationClass:"operate",scope:["businesses:read"],sideEffect:"read",cli:{group:"variables",command:"status",summary:"Read a durable secret mutation operation",args:[Sa,{field:"operationId",kind:"positional",token:"<operationId>",describe:"Operation id returned by a mutation."}],handler:async({client:t,args:e,emit:n})=>{let i=e.businessId;n({businessId:i,operation:await t.builderGetBusinessVariableOperation(i,e.operationId)},"Secret mutation status")}},mcp:{tool:"fs_variable_operation_get",title:"Get secret mutation status",description:"Reads publication status and frozen impact metadata.",annotations:{readOnlyHint:!0,openWorldHint:!1},inputSchema:{businessId:a.string(),operationId:a.string()},handler:async(t,e)=>t.builderGetBusinessVariableOperation(await ke(t,e.businessId),e.operationId)}}];var IR=[...WT,...iR,...sR,...JT,...YT,...QT,...eR,...pR,...mR,...fR,...yR,...kR,...$R,...tR,...nR,...rR];function wR(t){if(!t.mcp)throw new Error(`toMcpTool called on CLI-only operation "${t.opKey}" (mcp === null).`);let e={name:t.mcp.tool,title:t.mcp.title,description:t.mcp.description,operationClass:t.operationClass,scope:t.scope,sideEffect:t.sideEffect,annotations:t.mcp.annotations,inputSchema:t.mcp.inputSchema,handler:t.mcp.handler};return t.mcp.returnsOneTimeSecret&&(e.returnsOneTimeSecret=!0),e}var ly=IR.filter(t=>t.mcp).map(wR);function ER(){let t=bT(),e=yT(void 0),n=process.env.FARTHERSHORE_API_URL??t.apiUrl;return $T({apiUrl:n,token:e})}function j6(t){if(t&&typeof t=="object"){let e=t,n=typeof e.code=="string"?` [${e.code}]`:"",i=typeof e.status=="number"?` (HTTP ${e.status})`:"";if(typeof e.message=="string")return`${e.message}${n}${i}`}return String(t)}function U6(t,e,n){let i=async c=>{try{let u=await e.handler(n,c??{}),d=e.returnsOneTimeSecret?u:Ld(u),l=ZT(e.name,d);return{content:[{type:"text",text:JSON.stringify(l,null,2)}]}}catch(u){let d=u instanceof N?u:new N(j6(u),0),l=FT(e.name,d);return{content:[{type:"text",text:JSON.stringify(l,null,2)}],isError:!0}}},r=Object.keys(e.inputSchema).length>0,o={title:e.title,description:e.description,annotations:{title:e.title,...e.annotations},...r?{inputSchema:e.inputSchema}:{}},s=r?c=>i(c):()=>i({});t.registerTool(e.name,o,s)}function M6(t){for(let e of t){let n=lT(e.operationClass,e.sideEffect);if(n)throw new Error(`[mcp] tool "${e.name}" is misclassified: ${n}`)}}function TR(t){M6(ly);let e=new Ed({name:"farthershore-agent-business-builder",version:"0.2.0"});for(let n of ly)U6(e,n,t);return e}function dy(){return TR(ER())}async function L6(){let t=dy(),e=new Pl;await t.connect(e)}import.meta.url===`file://${process.argv[1]}`&&L6();export{ly as ALL_TOOLS,TR as buildServer,dy as createMcpServer,ER as mcpClient};
|