-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhandler.js
More file actions
105 lines (92 loc) · 491 KB
/
Copy pathhandler.js
File metadata and controls
105 lines (92 loc) · 491 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
"use strict";var Wg=Object.create;var so=Object.defineProperty;var Xg=Object.getOwnPropertyDescriptor;var Qg=Object.getOwnPropertyNames;var eb=Object.getPrototypeOf,tb=Object.prototype.hasOwnProperty;var O=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},co=(e,t)=>{for(var r in t)so(e,r,{get:t[r],enumerable:!0})},Ql=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Qg(t))!tb.call(e,o)&&o!==r&&so(e,o,{get:()=>t[o],enumerable:!(n=Xg(t,o))||n.enumerable});return e};var Hr=(e,t,r)=>(r=e!=null?Wg(eb(e)):{},Ql(t||!e||!e.__esModule?so(r,"default",{value:e,enumerable:!0}):r,e)),rb=e=>Ql(so({},"__esModule",{value:!0}),e);var bn=O(H=>{"use strict";Object.defineProperty(H,"__esModule",{value:!0});H.regexpCode=H.getEsmExportName=H.getProperty=H.safeStringify=H.stringify=H.strConcat=H.addCodeArg=H.str=H._=H.nil=H._Code=H.Name=H.IDENTIFIER=H._CodeOrName=void 0;var yn=class{};H._CodeOrName=yn;H.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var Yt=class extends yn{constructor(t){if(super(),!H.IDENTIFIER.test(t))throw new Error("CodeGen: name must be a valid identifier");this.str=t}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};H.Name=Yt;var He=class extends yn{constructor(t){super(),this._items=typeof t=="string"?[t]:t}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let t=this._items[0];return t===""||t==='""'}get str(){var t;return(t=this._str)!==null&&t!==void 0?t:this._str=this._items.reduce((r,n)=>`${r}${n}`,"")}get names(){var t;return(t=this._names)!==null&&t!==void 0?t:this._names=this._items.reduce((r,n)=>(n instanceof Yt&&(r[n.str]=(r[n.str]||0)+1),r),{})}};H._Code=He;H.nil=new He("");function c_(e,...t){let r=[e[0]],n=0;for(;n<t.length;)Ls(r,t[n]),r.push(e[++n]);return new He(r)}H._=c_;var Fs=new He("+");function l_(e,...t){let r=[gn(e[0])],n=0;for(;n<t.length;)r.push(Fs),Ls(r,t[n]),r.push(Fs,gn(e[++n]));return tw(r),new He(r)}H.str=l_;function Ls(e,t){t instanceof He?e.push(...t._items):t instanceof Yt?e.push(t):e.push(ow(t))}H.addCodeArg=Ls;function tw(e){let t=1;for(;t<e.length-1;){if(e[t]===Fs){let r=rw(e[t-1],e[t+1]);if(r!==void 0){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}function rw(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string")return t instanceof Yt||e[e.length-1]!=='"'?void 0:typeof t!="string"?`${e.slice(0,-1)}${t}"`:t[0]==='"'?e.slice(0,-1)+t.slice(1):void 0;if(typeof t=="string"&&t[0]==='"'&&!(e instanceof Yt))return`"${e}${t.slice(1)}`}function nw(e,t){return t.emptyStr()?e:e.emptyStr()?t:l_`${e}${t}`}H.strConcat=nw;function ow(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:gn(Array.isArray(e)?e.join(","):e)}function iw(e){return new He(gn(e))}H.stringify=iw;function gn(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}H.safeStringify=gn;function aw(e){return typeof e=="string"&&H.IDENTIFIER.test(e)?new He(`.${e}`):c_`[${e}]`}H.getProperty=aw;function sw(e){if(typeof e=="string"&&H.IDENTIFIER.test(e))return new He(`${e}`);throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}H.getEsmExportName=sw;function cw(e){return new He(e.toString())}H.regexpCode=cw});var Ks=O(qe=>{"use strict";Object.defineProperty(qe,"__esModule",{value:!0});qe.ValueScope=qe.ValueScopeName=qe.Scope=qe.varKinds=qe.UsedValueState=void 0;var Ce=bn(),Hs=class extends Error{constructor(t){super(`CodeGen: "code" for ${t} not defined`),this.value=t.value}},li;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(li||(qe.UsedValueState=li={}));qe.varKinds={const:new Ce.Name("const"),let:new Ce.Name("let"),var:new Ce.Name("var")};var ui=class{constructor({prefixes:t,parent:r}={}){this._names={},this._prefixes=t,this._parent=r}toName(t){return t instanceof Ce.Name?t:this.name(t)}name(t){return new Ce.Name(this._newName(t))}_newName(t){let r=this._names[t]||this._nameGroup(t);return`${t}${r.index++}`}_nameGroup(t){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.has(t)||this._prefixes&&!this._prefixes.has(t))throw new Error(`CodeGen: prefix "${t}" is not allowed in this scope`);return this._names[t]={prefix:t,index:0}}};qe.Scope=ui;var di=class extends Ce.Name{constructor(t,r){super(r),this.prefix=t}setValue(t,{property:r,itemIndex:n}){this.value=t,this.scopePath=(0,Ce._)`.${new Ce.Name(r)}[${n}]`}};qe.ValueScopeName=di;var lw=(0,Ce._)`\n`,Ys=class extends ui{constructor(t){super(t),this._values={},this._scope=t.scope,this.opts={...t,_n:t.lines?lw:Ce.nil}}get(){return this._scope}name(t){return new di(t,this._newName(t))}value(t,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let o=this.toName(t),{prefix:i}=o,a=(n=r.key)!==null&&n!==void 0?n:r.ref,s=this._values[i];if(s){let u=s.get(a);if(u)return u}else s=this._values[i]=new Map;s.set(a,o);let c=this._scope[i]||(this._scope[i]=[]),l=c.length;return c[l]=r.ref,o.setValue(r,{property:i,itemIndex:l}),o}getValue(t,r){let n=this._values[t];if(n)return n.get(r)}scopeRefs(t,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,Ce._)`${t}${n.scopePath}`})}scopeCode(t=this._values,r,n){return this._reduceValues(t,o=>{if(o.value===void 0)throw new Error(`CodeGen: name "${o}" has no value`);return o.value.code},r,n)}_reduceValues(t,r,n={},o){let i=Ce.nil;for(let a in t){let s=t[a];if(!s)continue;let c=n[a]=n[a]||new Map;s.forEach(l=>{if(c.has(l))return;c.set(l,li.Started);let u=r(l);if(u){let d=this.opts.es5?qe.varKinds.var:qe.varKinds.const;i=(0,Ce._)`${i}${d} ${l} = ${u};${this.opts._n}`}else if(u=o?.(l))i=(0,Ce._)`${i}${u}${this.opts._n}`;else throw new Hs(l);c.set(l,li.Completed)})}return i}};qe.ValueScope=Ys});var I=O(M=>{"use strict";Object.defineProperty(M,"__esModule",{value:!0});M.or=M.and=M.not=M.CodeGen=M.operators=M.varKinds=M.ValueScopeName=M.ValueScope=M.Scope=M.Name=M.regexpCode=M.stringify=M.getProperty=M.nil=M.strConcat=M.str=M._=void 0;var U=bn(),Qe=Ks(),At=bn();Object.defineProperty(M,"_",{enumerable:!0,get:function(){return At._}});Object.defineProperty(M,"str",{enumerable:!0,get:function(){return At.str}});Object.defineProperty(M,"strConcat",{enumerable:!0,get:function(){return At.strConcat}});Object.defineProperty(M,"nil",{enumerable:!0,get:function(){return At.nil}});Object.defineProperty(M,"getProperty",{enumerable:!0,get:function(){return At.getProperty}});Object.defineProperty(M,"stringify",{enumerable:!0,get:function(){return At.stringify}});Object.defineProperty(M,"regexpCode",{enumerable:!0,get:function(){return At.regexpCode}});Object.defineProperty(M,"Name",{enumerable:!0,get:function(){return At.Name}});var _i=Ks();Object.defineProperty(M,"Scope",{enumerable:!0,get:function(){return _i.Scope}});Object.defineProperty(M,"ValueScope",{enumerable:!0,get:function(){return _i.ValueScope}});Object.defineProperty(M,"ValueScopeName",{enumerable:!0,get:function(){return _i.ValueScopeName}});Object.defineProperty(M,"varKinds",{enumerable:!0,get:function(){return _i.varKinds}});M.operators={GT:new U._Code(">"),GTE:new U._Code(">="),LT:new U._Code("<"),LTE:new U._Code("<="),EQ:new U._Code("==="),NEQ:new U._Code("!=="),NOT:new U._Code("!"),OR:new U._Code("||"),AND:new U._Code("&&"),ADD:new U._Code("+")};var ht=class{optimizeNodes(){return this}optimizeNames(t,r){return this}},Bs=class extends ht{constructor(t,r,n){super(),this.varKind=t,this.name=r,this.rhs=n}render({es5:t,_n:r}){let n=t?Qe.varKinds.var:this.varKind,o=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${o};`+r}optimizeNames(t,r){if(t[this.name.str])return this.rhs&&(this.rhs=Er(this.rhs,t,r)),this}get names(){return this.rhs instanceof U._CodeOrName?this.rhs.names:{}}},pi=class extends ht{constructor(t,r,n){super(),this.lhs=t,this.rhs=r,this.sideEffects=n}render({_n:t}){return`${this.lhs} = ${this.rhs};`+t}optimizeNames(t,r){if(!(this.lhs instanceof U.Name&&!t[this.lhs.str]&&!this.sideEffects))return this.rhs=Er(this.rhs,t,r),this}get names(){let t=this.lhs instanceof U.Name?{}:{...this.lhs.names};return fi(t,this.rhs)}},Gs=class extends pi{constructor(t,r,n,o){super(t,n,o),this.op=r}render({_n:t}){return`${this.lhs} ${this.op}= ${this.rhs};`+t}},Js=class extends ht{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return`${this.label}:`+t}},Vs=class extends ht{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return`break${this.label?` ${this.label}`:""};`+t}},Ws=class extends ht{constructor(t){super(),this.error=t}render({_n:t}){return`throw ${this.error};`+t}get names(){return this.error.names}},Xs=class extends ht{constructor(t){super(),this.code=t}render({_n:t}){return`${this.code};`+t}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(t,r){return this.code=Er(this.code,t,r),this}get names(){return this.code instanceof U._CodeOrName?this.code.names:{}}},vn=class extends ht{constructor(t=[]){super(),this.nodes=t}render(t){return this.nodes.reduce((r,n)=>r+n.render(t),"")}optimizeNodes(){let{nodes:t}=this,r=t.length;for(;r--;){let n=t[r].optimizeNodes();Array.isArray(n)?t.splice(r,1,...n):n?t[r]=n:t.splice(r,1)}return t.length>0?this:void 0}optimizeNames(t,r){let{nodes:n}=this,o=n.length;for(;o--;){let i=n[o];i.optimizeNames(t,r)||(uw(t,i.names),n.splice(o,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((t,r)=>Gt(t,r.names),{})}},yt=class extends vn{render(t){return"{"+t._n+super.render(t)+"}"+t._n}},Qs=class extends vn{},zr=class extends yt{};zr.kind="else";var Kt=class e extends yt{constructor(t,r){super(r),this.condition=t}render(t){let r=`if(${this.condition})`+super.render(t);return this.else&&(r+="else "+this.else.render(t)),r}optimizeNodes(){super.optimizeNodes();let t=this.condition;if(t===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new zr(n):n}if(r)return t===!1?r instanceof e?r:r.nodes:this.nodes.length?this:new e(u_(t),r instanceof e?[r]:r.nodes);if(!(t===!1||!this.nodes.length))return this}optimizeNames(t,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(t,r),!!(super.optimizeNames(t,r)||this.else))return this.condition=Er(this.condition,t,r),this}get names(){let t=super.names;return fi(t,this.condition),this.else&&Gt(t,this.else.names),t}};Kt.kind="if";var Bt=class extends yt{};Bt.kind="for";var ec=class extends Bt{constructor(t){super(),this.iteration=t}render(t){return`for(${this.iteration})`+super.render(t)}optimizeNames(t,r){if(super.optimizeNames(t,r))return this.iteration=Er(this.iteration,t,r),this}get names(){return Gt(super.names,this.iteration.names)}},tc=class extends Bt{constructor(t,r,n,o){super(),this.varKind=t,this.name=r,this.from=n,this.to=o}render(t){let r=t.es5?Qe.varKinds.var:this.varKind,{name:n,from:o,to:i}=this;return`for(${r} ${n}=${o}; ${n}<${i}; ${n}++)`+super.render(t)}get names(){let t=fi(super.names,this.from);return fi(t,this.to)}},mi=class extends Bt{constructor(t,r,n,o){super(),this.loop=t,this.varKind=r,this.name=n,this.iterable=o}render(t){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(t)}optimizeNames(t,r){if(super.optimizeNames(t,r))return this.iterable=Er(this.iterable,t,r),this}get names(){return Gt(super.names,this.iterable.names)}},xn=class extends yt{constructor(t,r,n){super(),this.name=t,this.args=r,this.async=n}render(t){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(t)}};xn.kind="func";var wn=class extends vn{render(t){return"return "+super.render(t)}};wn.kind="return";var rc=class extends yt{render(t){let r="try"+super.render(t);return this.catch&&(r+=this.catch.render(t)),this.finally&&(r+=this.finally.render(t)),r}optimizeNodes(){var t,r;return super.optimizeNodes(),(t=this.catch)===null||t===void 0||t.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(t,r){var n,o;return super.optimizeNames(t,r),(n=this.catch)===null||n===void 0||n.optimizeNames(t,r),(o=this.finally)===null||o===void 0||o.optimizeNames(t,r),this}get names(){let t=super.names;return this.catch&&Gt(t,this.catch.names),this.finally&&Gt(t,this.finally.names),t}},Sn=class extends yt{constructor(t){super(),this.error=t}render(t){return`catch(${this.error})`+super.render(t)}};Sn.kind="catch";var kn=class extends yt{render(t){return"finally"+super.render(t)}};kn.kind="finally";var nc=class{constructor(t,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
`:""},this._extScope=t,this._scope=new Qe.Scope({parent:t}),this._nodes=[new Qs]}toString(){return this._root.render(this.opts)}name(t){return this._scope.name(t)}scopeName(t){return this._extScope.name(t)}scopeValue(t,r){let n=this._extScope.value(t,r);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(t,r){return this._extScope.getValue(t,r)}scopeRefs(t){return this._extScope.scopeRefs(t,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(t,r,n,o){let i=this._scope.toName(r);return n!==void 0&&o&&(this._constants[i.str]=n),this._leafNode(new Bs(t,i,n)),i}const(t,r,n){return this._def(Qe.varKinds.const,t,r,n)}let(t,r,n){return this._def(Qe.varKinds.let,t,r,n)}var(t,r,n){return this._def(Qe.varKinds.var,t,r,n)}assign(t,r,n){return this._leafNode(new pi(t,r,n))}add(t,r){return this._leafNode(new Gs(t,M.operators.ADD,r))}code(t){return typeof t=="function"?t():t!==U.nil&&this._leafNode(new Xs(t)),this}object(...t){let r=["{"];for(let[n,o]of t)r.length>1&&r.push(","),r.push(n),(n!==o||this.opts.es5)&&(r.push(":"),(0,U.addCodeArg)(r,o));return r.push("}"),new U._Code(r)}if(t,r,n){if(this._blockNode(new Kt(t)),r&&n)this.code(r).else().code(n).endIf();else if(r)this.code(r).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(t){return this._elseNode(new Kt(t))}else(){return this._elseNode(new zr)}endIf(){return this._endBlockNode(Kt,zr)}_for(t,r){return this._blockNode(t),r&&this.code(r).endFor(),this}for(t,r){return this._for(new ec(t),r)}forRange(t,r,n,o,i=this.opts.es5?Qe.varKinds.var:Qe.varKinds.let){let a=this._scope.toName(t);return this._for(new tc(i,a,r,n),()=>o(a))}forOf(t,r,n,o=Qe.varKinds.const){let i=this._scope.toName(t);if(this.opts.es5){let a=r instanceof U.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,U._)`${a}.length`,s=>{this.var(i,(0,U._)`${a}[${s}]`),n(i)})}return this._for(new mi("of",o,i,r),()=>n(i))}forIn(t,r,n,o=this.opts.es5?Qe.varKinds.var:Qe.varKinds.const){if(this.opts.ownProperties)return this.forOf(t,(0,U._)`Object.keys(${r})`,n);let i=this._scope.toName(t);return this._for(new mi("in",o,i,r),()=>n(i))}endFor(){return this._endBlockNode(Bt)}label(t){return this._leafNode(new Js(t))}break(t){return this._leafNode(new Vs(t))}return(t){let r=new wn;if(this._blockNode(r),this.code(t),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(wn)}try(t,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let o=new rc;if(this._blockNode(o),this.code(t),r){let i=this.name("e");this._currNode=o.catch=new Sn(i),r(i)}return n&&(this._currNode=o.finally=new kn,this.code(n)),this._endBlockNode(Sn,kn)}throw(t){return this._leafNode(new Ws(t))}block(t,r){return this._blockStarts.push(this._nodes.length),t&&this.code(t).endBlock(r),this}endBlock(t){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-r;if(n<0||t!==void 0&&n!==t)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${t} expected`);return this._nodes.length=r,this}func(t,r=U.nil,n,o){return this._blockNode(new xn(t,r,n)),o&&this.code(o).endFunc(),this}endFunc(){return this._endBlockNode(xn)}optimize(t=1){for(;t-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(t){return this._currNode.nodes.push(t),this}_blockNode(t){this._currNode.nodes.push(t),this._nodes.push(t)}_endBlockNode(t,r){let n=this._currNode;if(n instanceof t||r&&n instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${t.kind}/${r.kind}`:t.kind}"`)}_elseNode(t){let r=this._currNode;if(!(r instanceof Kt))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=t,this}get _root(){return this._nodes[0]}get _currNode(){let t=this._nodes;return t[t.length-1]}set _currNode(t){let r=this._nodes;r[r.length-1]=t}};M.CodeGen=nc;function Gt(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function fi(e,t){return t instanceof U._CodeOrName?Gt(e,t.names):e}function Er(e,t,r){if(e instanceof U.Name)return n(e);if(!o(e))return e;return new U._Code(e._items.reduce((i,a)=>(a instanceof U.Name&&(a=n(a)),a instanceof U._Code?i.push(...a._items):i.push(a),i),[]));function n(i){let a=r[i.str];return a===void 0||t[i.str]!==1?i:(delete t[i.str],a)}function o(i){return i instanceof U._Code&&i._items.some(a=>a instanceof U.Name&&t[a.str]===1&&r[a.str]!==void 0)}}function uw(e,t){for(let r in t)e[r]=(e[r]||0)-(t[r]||0)}function u_(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:(0,U._)`!${oc(e)}`}M.not=u_;var dw=d_(M.operators.AND);function pw(...e){return e.reduce(dw)}M.and=pw;var mw=d_(M.operators.OR);function fw(...e){return e.reduce(mw)}M.or=fw;function d_(e){return(t,r)=>t===U.nil?r:r===U.nil?t:(0,U._)`${oc(t)} ${e} ${oc(r)}`}function oc(e){return e instanceof U.Name?e:(0,U._)`(${e})`}});var Y=O(j=>{"use strict";Object.defineProperty(j,"__esModule",{value:!0});j.checkStrictMode=j.getErrorPath=j.Type=j.useFunc=j.setEvaluated=j.evaluatedPropsToName=j.mergeEvaluated=j.eachItem=j.unescapeJsonPointer=j.escapeJsonPointer=j.escapeFragment=j.unescapeFragment=j.schemaRefOrVal=j.schemaHasRulesButRef=j.schemaHasRules=j.checkUnknownRules=j.alwaysValidSchema=j.toHash=void 0;var V=I(),_w=bn();function hw(e){let t={};for(let r of e)t[r]=!0;return t}j.toHash=hw;function yw(e,t){return typeof t=="boolean"?t:Object.keys(t).length===0?!0:(f_(e,t),!__(t,e.self.RULES.all))}j.alwaysValidSchema=yw;function f_(e,t=e.schema){let{opts:r,self:n}=e;if(!r.strictSchema||typeof t=="boolean")return;let o=n.RULES.keywords;for(let i in t)o[i]||g_(e,`unknown keyword: "${i}"`)}j.checkUnknownRules=f_;function __(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(t[r])return!0;return!1}j.schemaHasRules=__;function gw(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(r!=="$ref"&&t.all[r])return!0;return!1}j.schemaHasRulesButRef=gw;function bw({topSchemaRef:e,schemaPath:t},r,n,o){if(!o){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,V._)`${r}`}return(0,V._)`${e}${t}${(0,V.getProperty)(n)}`}j.schemaRefOrVal=bw;function vw(e){return h_(decodeURIComponent(e))}j.unescapeFragment=vw;function xw(e){return encodeURIComponent(ac(e))}j.escapeFragment=xw;function ac(e){return typeof e=="number"?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}j.escapeJsonPointer=ac;function h_(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}j.unescapeJsonPointer=h_;function ww(e,t){if(Array.isArray(e))for(let r of e)t(r);else t(e)}j.eachItem=ww;function p_({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:n}){return(o,i,a,s)=>{let c=a===void 0?i:a instanceof V.Name?(i instanceof V.Name?e(o,i,a):t(o,i,a),a):i instanceof V.Name?(t(o,a,i),i):r(i,a);return s===V.Name&&!(c instanceof V.Name)?n(o,c):c}}j.mergeEvaluated={props:p_({mergeNames:(e,t,r)=>e.if((0,V._)`${r} !== true && ${t} !== undefined`,()=>{e.if((0,V._)`${t} === true`,()=>e.assign(r,!0),()=>e.assign(r,(0,V._)`${r} || {}`).code((0,V._)`Object.assign(${r}, ${t})`))}),mergeToName:(e,t,r)=>e.if((0,V._)`${r} !== true`,()=>{t===!0?e.assign(r,!0):(e.assign(r,(0,V._)`${r} || {}`),sc(e,r,t))}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:y_}),items:p_({mergeNames:(e,t,r)=>e.if((0,V._)`${r} !== true && ${t} !== undefined`,()=>e.assign(r,(0,V._)`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),mergeToName:(e,t,r)=>e.if((0,V._)`${r} !== true`,()=>e.assign(r,t===!0?!0:(0,V._)`${r} > ${t} ? ${r} : ${t}`)),mergeValues:(e,t)=>e===!0?!0:Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})};function y_(e,t){if(t===!0)return e.var("props",!0);let r=e.var("props",(0,V._)`{}`);return t!==void 0&&sc(e,r,t),r}j.evaluatedPropsToName=y_;function sc(e,t,r){Object.keys(r).forEach(n=>e.assign((0,V._)`${t}${(0,V.getProperty)(n)}`,!0))}j.setEvaluated=sc;var m_={};function Sw(e,t){return e.scopeValue("func",{ref:t,code:m_[t.code]||(m_[t.code]=new _w._Code(t.code))})}j.useFunc=Sw;var ic;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(ic||(j.Type=ic={}));function kw(e,t,r){if(e instanceof V.Name){let n=t===ic.Num;return r?n?(0,V._)`"[" + ${e} + "]"`:(0,V._)`"['" + ${e} + "']"`:n?(0,V._)`"/" + ${e}`:(0,V._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,V.getProperty)(e).toString():"/"+ac(e)}j.getErrorPath=kw;function g_(e,t,r=e.opts.strictSchema){if(r){if(t=`strict mode: ${t}`,r===!0)throw new Error(t);e.self.logger.warn(t)}}j.checkStrictMode=g_});var gt=O(cc=>{"use strict";Object.defineProperty(cc,"__esModule",{value:!0});var Se=I(),$w={data:new Se.Name("data"),valCxt:new Se.Name("valCxt"),instancePath:new Se.Name("instancePath"),parentData:new Se.Name("parentData"),parentDataProperty:new Se.Name("parentDataProperty"),rootData:new Se.Name("rootData"),dynamicAnchors:new Se.Name("dynamicAnchors"),vErrors:new Se.Name("vErrors"),errors:new Se.Name("errors"),this:new Se.Name("this"),self:new Se.Name("self"),scope:new Se.Name("scope"),json:new Se.Name("json"),jsonPos:new Se.Name("jsonPos"),jsonLen:new Se.Name("jsonLen"),jsonPart:new Se.Name("jsonPart")};cc.default=$w});var $n=O(ke=>{"use strict";Object.defineProperty(ke,"__esModule",{value:!0});ke.extendErrors=ke.resetErrorsCount=ke.reportExtraError=ke.reportError=ke.keyword$DataError=ke.keywordError=void 0;var Z=I(),hi=Y(),Pe=gt();ke.keywordError={message:({keyword:e})=>(0,Z.str)`must pass "${e}" keyword validation`};ke.keyword$DataError={message:({keyword:e,schemaType:t})=>t?(0,Z.str)`"${e}" keyword must be ${t} ($data)`:(0,Z.str)`"${e}" keyword is invalid ($data)`};function Ow(e,t=ke.keywordError,r,n){let{it:o}=e,{gen:i,compositeRule:a,allErrors:s}=o,c=x_(e,t,r);n??(a||s)?b_(i,c):v_(o,(0,Z._)`[${c}]`)}ke.reportError=Ow;function Pw(e,t=ke.keywordError,r){let{it:n}=e,{gen:o,compositeRule:i,allErrors:a}=n,s=x_(e,t,r);b_(o,s),i||a||v_(n,Pe.default.vErrors)}ke.reportExtraError=Pw;function zw(e,t){e.assign(Pe.default.errors,t),e.if((0,Z._)`${Pe.default.vErrors} !== null`,()=>e.if(t,()=>e.assign((0,Z._)`${Pe.default.vErrors}.length`,t),()=>e.assign(Pe.default.vErrors,null)))}ke.resetErrorsCount=zw;function Ew({gen:e,keyword:t,schemaValue:r,data:n,errsCount:o,it:i}){if(o===void 0)throw new Error("ajv implementation error");let a=e.name("err");e.forRange("i",o,Pe.default.errors,s=>{e.const(a,(0,Z._)`${Pe.default.vErrors}[${s}]`),e.if((0,Z._)`${a}.instancePath === undefined`,()=>e.assign((0,Z._)`${a}.instancePath`,(0,Z.strConcat)(Pe.default.instancePath,i.errorPath))),e.assign((0,Z._)`${a}.schemaPath`,(0,Z.str)`${i.errSchemaPath}/${t}`),i.opts.verbose&&(e.assign((0,Z._)`${a}.schema`,r),e.assign((0,Z._)`${a}.data`,n))})}ke.extendErrors=Ew;function b_(e,t){let r=e.const("err",t);e.if((0,Z._)`${Pe.default.vErrors} === null`,()=>e.assign(Pe.default.vErrors,(0,Z._)`[${r}]`),(0,Z._)`${Pe.default.vErrors}.push(${r})`),e.code((0,Z._)`${Pe.default.errors}++`)}function v_(e,t){let{gen:r,validateName:n,schemaEnv:o}=e;o.$async?r.throw((0,Z._)`new ${e.ValidationError}(${t})`):(r.assign((0,Z._)`${n}.errors`,t),r.return(!1))}var Jt={keyword:new Z.Name("keyword"),schemaPath:new Z.Name("schemaPath"),params:new Z.Name("params"),propertyName:new Z.Name("propertyName"),message:new Z.Name("message"),schema:new Z.Name("schema"),parentSchema:new Z.Name("parentSchema")};function x_(e,t,r){let{createErrors:n}=e.it;return n===!1?(0,Z._)`{}`:Dw(e,t,r)}function Dw(e,t,r={}){let{gen:n,it:o}=e,i=[Aw(o,r),Cw(e,r)];return qw(e,t,i),n.object(...i)}function Aw({errorPath:e},{instancePath:t}){let r=t?(0,Z.str)`${e}${(0,hi.getErrorPath)(t,hi.Type.Str)}`:e;return[Pe.default.instancePath,(0,Z.strConcat)(Pe.default.instancePath,r)]}function Cw({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:n}){let o=n?t:(0,Z.str)`${t}/${e}`;return r&&(o=(0,Z.str)`${o}${(0,hi.getErrorPath)(r,hi.Type.Str)}`),[Jt.schemaPath,o]}function qw(e,{params:t,message:r},n){let{keyword:o,data:i,schemaValue:a,it:s}=e,{opts:c,propertyName:l,topSchemaRef:u,schemaPath:d}=s;n.push([Jt.keyword,o],[Jt.params,typeof t=="function"?t(e):t||(0,Z._)`{}`]),c.messages&&n.push([Jt.message,typeof r=="function"?r(e):r]),c.verbose&&n.push([Jt.schema,a],[Jt.parentSchema,(0,Z._)`${u}${d}`],[Pe.default.data,i]),l&&n.push([Jt.propertyName,l])}});var S_=O(Dr=>{"use strict";Object.defineProperty(Dr,"__esModule",{value:!0});Dr.boolOrEmptySchema=Dr.topBoolOrEmptySchema=void 0;var Nw=$n(),Rw=I(),Tw=gt(),Iw={message:"boolean schema is false"};function Mw(e){let{gen:t,schema:r,validateName:n}=e;r===!1?w_(e,!1):typeof r=="object"&&r.$async===!0?t.return(Tw.default.data):(t.assign((0,Rw._)`${n}.errors`,null),t.return(!0))}Dr.topBoolOrEmptySchema=Mw;function jw(e,t){let{gen:r,schema:n}=e;n===!1?(r.var(t,!1),w_(e)):r.var(t,!0)}Dr.boolOrEmptySchema=jw;function w_(e,t){let{gen:r,data:n}=e,o={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,Nw.reportError)(o,Iw,void 0,t)}});var lc=O(Ar=>{"use strict";Object.defineProperty(Ar,"__esModule",{value:!0});Ar.getRules=Ar.isJSONType=void 0;var Uw=["string","number","integer","boolean","null","object","array"],Zw=new Set(Uw);function Fw(e){return typeof e=="string"&&Zw.has(e)}Ar.isJSONType=Fw;function Lw(){let e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}Ar.getRules=Lw});var uc=O(Ct=>{"use strict";Object.defineProperty(Ct,"__esModule",{value:!0});Ct.shouldUseRule=Ct.shouldUseGroup=Ct.schemaHasRulesForType=void 0;function Hw({schema:e,self:t},r){let n=t.RULES.types[r];return n&&n!==!0&&k_(e,n)}Ct.schemaHasRulesForType=Hw;function k_(e,t){return t.rules.some(r=>$_(e,r))}Ct.shouldUseGroup=k_;function $_(e,t){var r;return e[t.keyword]!==void 0||((r=t.definition.implements)===null||r===void 0?void 0:r.some(n=>e[n]!==void 0))}Ct.shouldUseRule=$_});var On=O($e=>{"use strict";Object.defineProperty($e,"__esModule",{value:!0});$e.reportTypeError=$e.checkDataTypes=$e.checkDataType=$e.coerceAndCheckDataType=$e.getJSONTypes=$e.getSchemaTypes=$e.DataType=void 0;var Yw=lc(),Kw=uc(),Bw=$n(),T=I(),O_=Y(),Cr;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(Cr||($e.DataType=Cr={}));function Gw(e){let t=P_(e.type);if(t.includes("null")){if(e.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&e.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');e.nullable===!0&&t.push("null")}return t}$e.getSchemaTypes=Gw;function P_(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(Yw.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}$e.getJSONTypes=P_;function Jw(e,t){let{gen:r,data:n,opts:o}=e,i=Vw(t,o.coerceTypes),a=t.length>0&&!(i.length===0&&t.length===1&&(0,Kw.schemaHasRulesForType)(e,t[0]));if(a){let s=pc(t,n,o.strictNumbers,Cr.Wrong);r.if(s,()=>{i.length?Ww(e,t,i):mc(e)})}return a}$e.coerceAndCheckDataType=Jw;var z_=new Set(["string","number","integer","boolean","null"]);function Vw(e,t){return t?e.filter(r=>z_.has(r)||t==="array"&&r==="array"):[]}function Ww(e,t,r){let{gen:n,data:o,opts:i}=e,a=n.let("dataType",(0,T._)`typeof ${o}`),s=n.let("coerced",(0,T._)`undefined`);i.coerceTypes==="array"&&n.if((0,T._)`${a} == 'object' && Array.isArray(${o}) && ${o}.length == 1`,()=>n.assign(o,(0,T._)`${o}[0]`).assign(a,(0,T._)`typeof ${o}`).if(pc(t,o,i.strictNumbers),()=>n.assign(s,o))),n.if((0,T._)`${s} !== undefined`);for(let l of r)(z_.has(l)||l==="array"&&i.coerceTypes==="array")&&c(l);n.else(),mc(e),n.endIf(),n.if((0,T._)`${s} !== undefined`,()=>{n.assign(o,s),Xw(e,s)});function c(l){switch(l){case"string":n.elseIf((0,T._)`${a} == "number" || ${a} == "boolean"`).assign(s,(0,T._)`"" + ${o}`).elseIf((0,T._)`${o} === null`).assign(s,(0,T._)`""`);return;case"number":n.elseIf((0,T._)`${a} == "boolean" || ${o} === null
|| (${a} == "string" && ${o} && ${o} == +${o})`).assign(s,(0,T._)`+${o}`);return;case"integer":n.elseIf((0,T._)`${a} === "boolean" || ${o} === null
|| (${a} === "string" && ${o} && ${o} == +${o} && !(${o} % 1))`).assign(s,(0,T._)`+${o}`);return;case"boolean":n.elseIf((0,T._)`${o} === "false" || ${o} === 0 || ${o} === null`).assign(s,!1).elseIf((0,T._)`${o} === "true" || ${o} === 1`).assign(s,!0);return;case"null":n.elseIf((0,T._)`${o} === "" || ${o} === 0 || ${o} === false`),n.assign(s,null);return;case"array":n.elseIf((0,T._)`${a} === "string" || ${a} === "number"
|| ${a} === "boolean" || ${o} === null`).assign(s,(0,T._)`[${o}]`)}}}function Xw({gen:e,parentData:t,parentDataProperty:r},n){e.if((0,T._)`${t} !== undefined`,()=>e.assign((0,T._)`${t}[${r}]`,n))}function dc(e,t,r,n=Cr.Correct){let o=n===Cr.Correct?T.operators.EQ:T.operators.NEQ,i;switch(e){case"null":return(0,T._)`${t} ${o} null`;case"array":i=(0,T._)`Array.isArray(${t})`;break;case"object":i=(0,T._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":i=a((0,T._)`!(${t} % 1) && !isNaN(${t})`);break;case"number":i=a();break;default:return(0,T._)`typeof ${t} ${o} ${e}`}return n===Cr.Correct?i:(0,T.not)(i);function a(s=T.nil){return(0,T.and)((0,T._)`typeof ${t} == "number"`,s,r?(0,T._)`isFinite(${t})`:T.nil)}}$e.checkDataType=dc;function pc(e,t,r,n){if(e.length===1)return dc(e[0],t,r,n);let o,i=(0,O_.toHash)(e);if(i.array&&i.object){let a=(0,T._)`typeof ${t} != "object"`;o=i.null?a:(0,T._)`!${t} || ${a}`,delete i.null,delete i.array,delete i.object}else o=T.nil;i.number&&delete i.integer;for(let a in i)o=(0,T.and)(o,dc(a,t,r,n));return o}$e.checkDataTypes=pc;var Qw={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e=="string"?(0,T._)`{type: ${e}}`:(0,T._)`{type: ${t}}`};function mc(e){let t=eS(e);(0,Bw.reportError)(t,Qw)}$e.reportTypeError=mc;function eS(e){let{gen:t,data:r,schema:n}=e,o=(0,O_.schemaRefOrVal)(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:o,schemaValue:o,parentSchema:n,params:{},it:e}}});var D_=O(yi=>{"use strict";Object.defineProperty(yi,"__esModule",{value:!0});yi.assignDefaults=void 0;var qr=I(),tS=Y();function rS(e,t){let{properties:r,items:n}=e.schema;if(t==="object"&&r)for(let o in r)E_(e,o,r[o].default);else t==="array"&&Array.isArray(n)&&n.forEach((o,i)=>E_(e,i,o.default))}yi.assignDefaults=rS;function E_(e,t,r){let{gen:n,compositeRule:o,data:i,opts:a}=e;if(r===void 0)return;let s=(0,qr._)`${i}${(0,qr.getProperty)(t)}`;if(o){(0,tS.checkStrictMode)(e,`default is ignored for: ${s}`);return}let c=(0,qr._)`${s} === undefined`;a.useDefaults==="empty"&&(c=(0,qr._)`${c} || ${s} === null || ${s} === ""`),n.if(c,(0,qr._)`${s} = ${(0,qr.stringify)(r)}`)}});var Ye=O(B=>{"use strict";Object.defineProperty(B,"__esModule",{value:!0});B.validateUnion=B.validateArray=B.usePattern=B.callValidateCode=B.schemaProperties=B.allSchemaProperties=B.noPropertyInData=B.propertyInData=B.isOwnProperty=B.hasPropFunc=B.reportMissingProp=B.checkMissingProp=B.checkReportMissingProp=void 0;var te=I(),fc=Y(),qt=gt(),nS=Y();function oS(e,t){let{gen:r,data:n,it:o}=e;r.if(hc(r,n,t,o.opts.ownProperties),()=>{e.setParams({missingProperty:(0,te._)`${t}`},!0),e.error()})}B.checkReportMissingProp=oS;function iS({gen:e,data:t,it:{opts:r}},n,o){return(0,te.or)(...n.map(i=>(0,te.and)(hc(e,t,i,r.ownProperties),(0,te._)`${o} = ${i}`)))}B.checkMissingProp=iS;function aS(e,t){e.setParams({missingProperty:t},!0),e.error()}B.reportMissingProp=aS;function A_(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,te._)`Object.prototype.hasOwnProperty`})}B.hasPropFunc=A_;function _c(e,t,r){return(0,te._)`${A_(e)}.call(${t}, ${r})`}B.isOwnProperty=_c;function sS(e,t,r,n){let o=(0,te._)`${t}${(0,te.getProperty)(r)} !== undefined`;return n?(0,te._)`${o} && ${_c(e,t,r)}`:o}B.propertyInData=sS;function hc(e,t,r,n){let o=(0,te._)`${t}${(0,te.getProperty)(r)} === undefined`;return n?(0,te.or)(o,(0,te.not)(_c(e,t,r))):o}B.noPropertyInData=hc;function C_(e){return e?Object.keys(e).filter(t=>t!=="__proto__"):[]}B.allSchemaProperties=C_;function cS(e,t){return C_(t).filter(r=>!(0,fc.alwaysValidSchema)(e,t[r]))}B.schemaProperties=cS;function lS({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:o,errorPath:i},it:a},s,c,l){let u=l?(0,te._)`${e}, ${t}, ${n}${o}`:t,d=[[qt.default.instancePath,(0,te.strConcat)(qt.default.instancePath,i)],[qt.default.parentData,a.parentData],[qt.default.parentDataProperty,a.parentDataProperty],[qt.default.rootData,qt.default.rootData]];a.opts.dynamicRef&&d.push([qt.default.dynamicAnchors,qt.default.dynamicAnchors]);let m=(0,te._)`${u}, ${r.object(...d)}`;return c!==te.nil?(0,te._)`${s}.call(${c}, ${m})`:(0,te._)`${s}(${m})`}B.callValidateCode=lS;var uS=(0,te._)`new RegExp`;function dS({gen:e,it:{opts:t}},r){let n=t.unicodeRegExp?"u":"",{regExp:o}=t.code,i=o(r,n);return e.scopeValue("pattern",{key:i.toString(),ref:i,code:(0,te._)`${o.code==="new RegExp"?uS:(0,nS.useFunc)(e,o)}(${r}, ${n})`})}B.usePattern=dS;function pS(e){let{gen:t,data:r,keyword:n,it:o}=e,i=t.name("valid");if(o.allErrors){let s=t.let("valid",!0);return a(()=>t.assign(s,!1)),s}return t.var(i,!0),a(()=>t.break()),i;function a(s){let c=t.const("len",(0,te._)`${r}.length`);t.forRange("i",0,c,l=>{e.subschema({keyword:n,dataProp:l,dataPropType:fc.Type.Num},i),t.if((0,te.not)(i),s)})}}B.validateArray=pS;function mS(e){let{gen:t,schema:r,keyword:n,it:o}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(c=>(0,fc.alwaysValidSchema)(o,c))&&!o.opts.unevaluated)return;let a=t.let("valid",!1),s=t.name("_valid");t.block(()=>r.forEach((c,l)=>{let u=e.subschema({keyword:n,schemaProp:l,compositeRule:!0},s);t.assign(a,(0,te._)`${a} || ${s}`),e.mergeValidEvaluated(u,s)||t.if((0,te.not)(a))})),e.result(a,()=>e.reset(),()=>e.error(!0))}B.validateUnion=mS});var R_=O(ot=>{"use strict";Object.defineProperty(ot,"__esModule",{value:!0});ot.validateKeywordUsage=ot.validSchemaType=ot.funcKeywordCode=ot.macroKeywordCode=void 0;var ze=I(),Vt=gt(),fS=Ye(),_S=$n();function hS(e,t){let{gen:r,keyword:n,schema:o,parentSchema:i,it:a}=e,s=t.macro.call(a.self,o,i,a),c=N_(r,n,s);a.opts.validateSchema!==!1&&a.self.validateSchema(s,!0);let l=r.name("valid");e.subschema({schema:s,schemaPath:ze.nil,errSchemaPath:`${a.errSchemaPath}/${n}`,topSchemaRef:c,compositeRule:!0},l),e.pass(l,()=>e.error(!0))}ot.macroKeywordCode=hS;function yS(e,t){var r;let{gen:n,keyword:o,schema:i,parentSchema:a,$data:s,it:c}=e;bS(c,t);let l=!s&&t.compile?t.compile.call(c.self,i,a,c):t.validate,u=N_(n,o,l),d=n.let("valid");e.block$data(d,m),e.ok((r=t.valid)!==null&&r!==void 0?r:d);function m(){if(t.errors===!1)h(),t.modifying&&q_(e),y(()=>e.error());else{let v=t.async?p():f();t.modifying&&q_(e),y(()=>gS(e,v))}}function p(){let v=n.let("ruleErrs",null);return n.try(()=>h((0,ze._)`await `),w=>n.assign(d,!1).if((0,ze._)`${w} instanceof ${c.ValidationError}`,()=>n.assign(v,(0,ze._)`${w}.errors`),()=>n.throw(w))),v}function f(){let v=(0,ze._)`${u}.errors`;return n.assign(v,null),h(ze.nil),v}function h(v=t.async?(0,ze._)`await `:ze.nil){let w=c.opts.passContext?Vt.default.this:Vt.default.self,S=!("compile"in t&&!s||t.schema===!1);n.assign(d,(0,ze._)`${v}${(0,fS.callValidateCode)(e,u,w,S)}`,t.modifying)}function y(v){var w;n.if((0,ze.not)((w=t.valid)!==null&&w!==void 0?w:d),v)}}ot.funcKeywordCode=yS;function q_(e){let{gen:t,data:r,it:n}=e;t.if(n.parentData,()=>t.assign(r,(0,ze._)`${n.parentData}[${n.parentDataProperty}]`))}function gS(e,t){let{gen:r}=e;r.if((0,ze._)`Array.isArray(${t})`,()=>{r.assign(Vt.default.vErrors,(0,ze._)`${Vt.default.vErrors} === null ? ${t} : ${Vt.default.vErrors}.concat(${t})`).assign(Vt.default.errors,(0,ze._)`${Vt.default.vErrors}.length`),(0,_S.extendErrors)(e)},()=>e.error())}function bS({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}function N_(e,t,r){if(r===void 0)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,ze.stringify)(r)})}function vS(e,t,r=!1){return!t.length||t.some(n=>n==="array"?Array.isArray(e):n==="object"?e&&typeof e=="object"&&!Array.isArray(e):typeof e==n||r&&typeof e>"u")}ot.validSchemaType=vS;function xS({schema:e,opts:t,self:r,errSchemaPath:n},o,i){if(Array.isArray(o.keyword)?!o.keyword.includes(i):o.keyword!==i)throw new Error("ajv implementation error");let a=o.dependencies;if(a?.some(s=>!Object.prototype.hasOwnProperty.call(e,s)))throw new Error(`parent schema must have dependencies of ${i}: ${a.join(",")}`);if(o.validateSchema&&!o.validateSchema(e[i])){let c=`keyword "${i}" value is invalid at path "${n}": `+r.errorsText(o.validateSchema.errors);if(t.validateSchema==="log")r.logger.error(c);else throw new Error(c)}}ot.validateKeywordUsage=xS});var I_=O(Nt=>{"use strict";Object.defineProperty(Nt,"__esModule",{value:!0});Nt.extendSubschemaMode=Nt.extendSubschemaData=Nt.getSubschema=void 0;var it=I(),T_=Y();function wS(e,{keyword:t,schemaProp:r,schema:n,schemaPath:o,errSchemaPath:i,topSchemaRef:a}){if(t!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(t!==void 0){let s=e.schema[t];return r===void 0?{schema:s,schemaPath:(0,it._)`${e.schemaPath}${(0,it.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:s[r],schemaPath:(0,it._)`${e.schemaPath}${(0,it.getProperty)(t)}${(0,it.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,T_.escapeFragment)(r)}`}}if(n!==void 0){if(o===void 0||i===void 0||a===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:o,topSchemaRef:a,errSchemaPath:i}}throw new Error('either "keyword" or "schema" must be passed')}Nt.getSubschema=wS;function SS(e,t,{dataProp:r,dataPropType:n,data:o,dataTypes:i,propertyName:a}){if(o!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:s}=t;if(r!==void 0){let{errorPath:l,dataPathArr:u,opts:d}=t,m=s.let("data",(0,it._)`${t.data}${(0,it.getProperty)(r)}`,!0);c(m),e.errorPath=(0,it.str)`${l}${(0,T_.getErrorPath)(r,n,d.jsPropertySyntax)}`,e.parentDataProperty=(0,it._)`${r}`,e.dataPathArr=[...u,e.parentDataProperty]}if(o!==void 0){let l=o instanceof it.Name?o:s.let("data",o,!0);c(l),a!==void 0&&(e.propertyName=a)}i&&(e.dataTypes=i);function c(l){e.data=l,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,l]}}Nt.extendSubschemaData=SS;function kS(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:n,createErrors:o,allErrors:i}){n!==void 0&&(e.compositeRule=n),o!==void 0&&(e.createErrors=o),i!==void 0&&(e.allErrors=i),e.jtdDiscriminator=t,e.jtdMetadata=r}Nt.extendSubschemaMode=kS});var yc=O((KN,M_)=>{"use strict";M_.exports=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,o,i;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(o=n;o--!==0;)if(!e(t[o],r[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(i=Object.keys(t),n=i.length,n!==Object.keys(r).length)return!1;for(o=n;o--!==0;)if(!Object.prototype.hasOwnProperty.call(r,i[o]))return!1;for(o=n;o--!==0;){var a=i[o];if(!e(t[a],r[a]))return!1}return!0}return t!==t&&r!==r}});var U_=O((BN,j_)=>{"use strict";var Rt=j_.exports=function(e,t,r){typeof t=="function"&&(r=t,t={}),r=t.cb||r;var n=typeof r=="function"?r:r.pre||function(){},o=r.post||function(){};gi(t,n,o,e,"",e)};Rt.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Rt.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Rt.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Rt.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 gi(e,t,r,n,o,i,a,s,c,l){if(n&&typeof n=="object"&&!Array.isArray(n)){t(n,o,i,a,s,c,l);for(var u in n){var d=n[u];if(Array.isArray(d)){if(u in Rt.arrayKeywords)for(var m=0;m<d.length;m++)gi(e,t,r,d[m],o+"/"+u+"/"+m,i,o,u,n,m)}else if(u in Rt.propsKeywords){if(d&&typeof d=="object")for(var p in d)gi(e,t,r,d[p],o+"/"+u+"/"+$S(p),i,o,u,n,p)}else(u in Rt.keywords||e.allKeys&&!(u in Rt.skipKeywords))&&gi(e,t,r,d,o+"/"+u,i,o,u,n)}r(n,o,i,a,s,c,l)}}function $S(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}});var Pn=O(Ne=>{"use strict";Object.defineProperty(Ne,"__esModule",{value:!0});Ne.getSchemaRefs=Ne.resolveUrl=Ne.normalizeId=Ne._getFullPath=Ne.getFullPath=Ne.inlineRef=void 0;var OS=Y(),PS=yc(),zS=U_(),ES=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function DS(e,t=!0){return typeof e=="boolean"?!0:t===!0?!gc(e):t?Z_(e)<=t:!1}Ne.inlineRef=DS;var AS=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function gc(e){for(let t in e){if(AS.has(t))return!0;let r=e[t];if(Array.isArray(r)&&r.some(gc)||typeof r=="object"&&gc(r))return!0}return!1}function Z_(e){let t=0;for(let r in e){if(r==="$ref")return 1/0;if(t++,!ES.has(r)&&(typeof e[r]=="object"&&(0,OS.eachItem)(e[r],n=>t+=Z_(n)),t===1/0))return 1/0}return t}function F_(e,t="",r){r!==!1&&(t=Nr(t));let n=e.parse(t);return L_(e,n)}Ne.getFullPath=F_;function L_(e,t){return e.serialize(t).split("#")[0]+"#"}Ne._getFullPath=L_;var CS=/#\/?$/;function Nr(e){return e?e.replace(CS,""):""}Ne.normalizeId=Nr;function qS(e,t,r){return r=Nr(r),e.resolve(t,r)}Ne.resolveUrl=qS;var NS=/^[a-z_][-a-z0-9._]*$/i;function RS(e,t){if(typeof e=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,o=Nr(e[r]||t),i={"":o},a=F_(n,o,!1),s={},c=new Set;return zS(e,{allKeys:!0},(d,m,p,f)=>{if(f===void 0)return;let h=a+m,y=i[f];typeof d[r]=="string"&&(y=v.call(this,d[r])),w.call(this,d.$anchor),w.call(this,d.$dynamicAnchor),i[m]=y;function v(S){let q=this.opts.uriResolver.resolve;if(S=Nr(y?q(y,S):S),c.has(S))throw u(S);c.add(S);let b=this.refs[S];return typeof b=="string"&&(b=this.refs[b]),typeof b=="object"?l(d,b.schema,S):S!==Nr(h)&&(S[0]==="#"?(l(d,s[S],S),s[S]=d):this.refs[S]=h),S}function w(S){if(typeof S=="string"){if(!NS.test(S))throw new Error(`invalid anchor "${S}"`);v.call(this,`#${S}`)}}}),s;function l(d,m,p){if(m!==void 0&&!PS(d,m))throw u(p)}function u(d){return new Error(`reference "${d}" resolves to more than one schema`)}}Ne.getSchemaRefs=RS});var Dn=O(Tt=>{"use strict";Object.defineProperty(Tt,"__esModule",{value:!0});Tt.getData=Tt.KeywordCxt=Tt.validateFunctionCode=void 0;var G_=S_(),H_=On(),vc=uc(),bi=On(),TS=D_(),En=R_(),bc=I_(),z=I(),R=gt(),IS=Pn(),bt=Y(),zn=$n();function MS(e){if(W_(e)&&(X_(e),V_(e))){ZS(e);return}J_(e,()=>(0,G_.topBoolOrEmptySchema)(e))}Tt.validateFunctionCode=MS;function J_({gen:e,validateName:t,schema:r,schemaEnv:n,opts:o},i){o.code.es5?e.func(t,(0,z._)`${R.default.data}, ${R.default.valCxt}`,n.$async,()=>{e.code((0,z._)`"use strict"; ${Y_(r,o)}`),US(e,o),e.code(i)}):e.func(t,(0,z._)`${R.default.data}, ${jS(o)}`,n.$async,()=>e.code(Y_(r,o)).code(i))}function jS(e){return(0,z._)`{${R.default.instancePath}="", ${R.default.parentData}, ${R.default.parentDataProperty}, ${R.default.rootData}=${R.default.data}${e.dynamicRef?(0,z._)`, ${R.default.dynamicAnchors}={}`:z.nil}}={}`}function US(e,t){e.if(R.default.valCxt,()=>{e.var(R.default.instancePath,(0,z._)`${R.default.valCxt}.${R.default.instancePath}`),e.var(R.default.parentData,(0,z._)`${R.default.valCxt}.${R.default.parentData}`),e.var(R.default.parentDataProperty,(0,z._)`${R.default.valCxt}.${R.default.parentDataProperty}`),e.var(R.default.rootData,(0,z._)`${R.default.valCxt}.${R.default.rootData}`),t.dynamicRef&&e.var(R.default.dynamicAnchors,(0,z._)`${R.default.valCxt}.${R.default.dynamicAnchors}`)},()=>{e.var(R.default.instancePath,(0,z._)`""`),e.var(R.default.parentData,(0,z._)`undefined`),e.var(R.default.parentDataProperty,(0,z._)`undefined`),e.var(R.default.rootData,R.default.data),t.dynamicRef&&e.var(R.default.dynamicAnchors,(0,z._)`{}`)})}function ZS(e){let{schema:t,opts:r,gen:n}=e;J_(e,()=>{r.$comment&&t.$comment&&eh(e),KS(e),n.let(R.default.vErrors,null),n.let(R.default.errors,0),r.unevaluated&&FS(e),Q_(e),JS(e)})}function FS(e){let{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",(0,z._)`${r}.evaluated`),t.if((0,z._)`${e.evaluated}.dynamicProps`,()=>t.assign((0,z._)`${e.evaluated}.props`,(0,z._)`undefined`)),t.if((0,z._)`${e.evaluated}.dynamicItems`,()=>t.assign((0,z._)`${e.evaluated}.items`,(0,z._)`undefined`))}function Y_(e,t){let r=typeof e=="object"&&e[t.schemaId];return r&&(t.code.source||t.code.process)?(0,z._)`/*# sourceURL=${r} */`:z.nil}function LS(e,t){if(W_(e)&&(X_(e),V_(e))){HS(e,t);return}(0,G_.boolOrEmptySchema)(e,t)}function V_({schema:e,self:t}){if(typeof e=="boolean")return!e;for(let r in e)if(t.RULES.all[r])return!0;return!1}function W_(e){return typeof e.schema!="boolean"}function HS(e,t){let{schema:r,gen:n,opts:o}=e;o.$comment&&r.$comment&&eh(e),BS(e),GS(e);let i=n.const("_errs",R.default.errors);Q_(e,i),n.var(t,(0,z._)`${i} === ${R.default.errors}`)}function X_(e){(0,bt.checkUnknownRules)(e),YS(e)}function Q_(e,t){if(e.opts.jtd)return K_(e,[],!1,t);let r=(0,H_.getSchemaTypes)(e.schema),n=(0,H_.coerceAndCheckDataType)(e,r);K_(e,r,!n,t)}function YS(e){let{schema:t,errSchemaPath:r,opts:n,self:o}=e;t.$ref&&n.ignoreKeywordsWithRef&&(0,bt.schemaHasRulesButRef)(t,o.RULES)&&o.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function KS(e){let{schema:t,opts:r}=e;t.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,bt.checkStrictMode)(e,"default is ignored in the schema root")}function BS(e){let t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,IS.resolveUrl)(e.opts.uriResolver,e.baseId,t))}function GS(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}function eh({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:o}){let i=r.$comment;if(o.$comment===!0)e.code((0,z._)`${R.default.self}.logger.log(${i})`);else if(typeof o.$comment=="function"){let a=(0,z.str)`${n}/$comment`,s=e.scopeValue("root",{ref:t.root});e.code((0,z._)`${R.default.self}.opts.$comment(${i}, ${a}, ${s}.schema)`)}}function JS(e){let{gen:t,schemaEnv:r,validateName:n,ValidationError:o,opts:i}=e;r.$async?t.if((0,z._)`${R.default.errors} === 0`,()=>t.return(R.default.data),()=>t.throw((0,z._)`new ${o}(${R.default.vErrors})`)):(t.assign((0,z._)`${n}.errors`,R.default.vErrors),i.unevaluated&&VS(e),t.return((0,z._)`${R.default.errors} === 0`))}function VS({gen:e,evaluated:t,props:r,items:n}){r instanceof z.Name&&e.assign((0,z._)`${t}.props`,r),n instanceof z.Name&&e.assign((0,z._)`${t}.items`,n)}function K_(e,t,r,n){let{gen:o,schema:i,data:a,allErrors:s,opts:c,self:l}=e,{RULES:u}=l;if(i.$ref&&(c.ignoreKeywordsWithRef||!(0,bt.schemaHasRulesButRef)(i,u))){o.block(()=>rh(e,"$ref",u.all.$ref.definition));return}c.jtd||WS(e,t),o.block(()=>{for(let m of u.rules)d(m);d(u.post)});function d(m){(0,vc.shouldUseGroup)(i,m)&&(m.type?(o.if((0,bi.checkDataType)(m.type,a,c.strictNumbers)),B_(e,m),t.length===1&&t[0]===m.type&&r&&(o.else(),(0,bi.reportTypeError)(e)),o.endIf()):B_(e,m),s||o.if((0,z._)`${R.default.errors} === ${n||0}`))}}function B_(e,t){let{gen:r,schema:n,opts:{useDefaults:o}}=e;o&&(0,TS.assignDefaults)(e,t.type),r.block(()=>{for(let i of t.rules)(0,vc.shouldUseRule)(n,i)&&rh(e,i.keyword,i.definition,t.type)})}function WS(e,t){e.schemaEnv.meta||!e.opts.strictTypes||(XS(e,t),e.opts.allowUnionTypes||QS(e,t),ek(e,e.dataTypes))}function XS(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(r=>{th(e.dataTypes,r)||xc(e,`type "${r}" not allowed by context "${e.dataTypes.join(",")}"`)}),rk(e,t)}}function QS(e,t){t.length>1&&!(t.length===2&&t.includes("null"))&&xc(e,"use allowUnionTypes to allow union type keyword")}function ek(e,t){let r=e.self.RULES.all;for(let n in r){let o=r[n];if(typeof o=="object"&&(0,vc.shouldUseRule)(e.schema,o)){let{type:i}=o.definition;i.length&&!i.some(a=>tk(t,a))&&xc(e,`missing type "${i.join(",")}" for keyword "${n}"`)}}}function tk(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function th(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function rk(e,t){let r=[];for(let n of e.dataTypes)th(t,n)?r.push(n):t.includes("integer")&&n==="number"&&r.push("integer");e.dataTypes=r}function xc(e,t){let r=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${r}" (strictTypes)`,(0,bt.checkStrictMode)(e,t,e.opts.strictTypes)}var vi=class{constructor(t,r,n){if((0,En.validateKeywordUsage)(t,r,n),this.gen=t.gen,this.allErrors=t.allErrors,this.keyword=n,this.data=t.data,this.schema=t.schema[n],this.$data=r.$data&&t.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,bt.schemaRefOrVal)(t,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=t.schema,this.params={},this.it=t,this.def=r,this.$data)this.schemaCode=t.gen.const("vSchema",nh(this.$data,t));else if(this.schemaCode=this.schemaValue,!(0,En.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=t.gen.const("_errs",R.default.errors))}result(t,r,n){this.failResult((0,z.not)(t),r,n)}failResult(t,r,n){this.gen.if(t),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(t,r){this.failResult((0,z.not)(t),void 0,r)}fail(t){if(t===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(t),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(t){if(!this.$data)return this.fail(t);let{schemaCode:r}=this;this.fail((0,z._)`${r} !== undefined && (${(0,z.or)(this.invalid$data(),t)})`)}error(t,r,n){if(r){this.setParams(r),this._error(t,n),this.setParams({});return}this._error(t,n)}_error(t,r){(t?zn.reportExtraError:zn.reportError)(this,this.def.error,r)}$dataError(){(0,zn.reportError)(this,this.def.$dataError||zn.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,zn.resetErrorsCount)(this.gen,this.errsCount)}ok(t){this.allErrors||this.gen.if(t)}setParams(t,r){r?Object.assign(this.params,t):this.params=t}block$data(t,r,n=z.nil){this.gen.block(()=>{this.check$data(t,n),r()})}check$data(t=z.nil,r=z.nil){if(!this.$data)return;let{gen:n,schemaCode:o,schemaType:i,def:a}=this;n.if((0,z.or)((0,z._)`${o} === undefined`,r)),t!==z.nil&&n.assign(t,!0),(i.length||a.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),t!==z.nil&&n.assign(t,!1)),n.else()}invalid$data(){let{gen:t,schemaCode:r,schemaType:n,def:o,it:i}=this;return(0,z.or)(a(),s());function a(){if(n.length){if(!(r instanceof z.Name))throw new Error("ajv implementation error");let c=Array.isArray(n)?n:[n];return(0,z._)`${(0,bi.checkDataTypes)(c,r,i.opts.strictNumbers,bi.DataType.Wrong)}`}return z.nil}function s(){if(o.validateSchema){let c=t.scopeValue("validate$data",{ref:o.validateSchema});return(0,z._)`!${c}(${r})`}return z.nil}}subschema(t,r){let n=(0,bc.getSubschema)(this.it,t);(0,bc.extendSubschemaData)(n,this.it,t),(0,bc.extendSubschemaMode)(n,t);let o={...this.it,...n,items:void 0,props:void 0};return LS(o,r),o}mergeEvaluated(t,r){let{it:n,gen:o}=this;n.opts.unevaluated&&(n.props!==!0&&t.props!==void 0&&(n.props=bt.mergeEvaluated.props(o,t.props,n.props,r)),n.items!==!0&&t.items!==void 0&&(n.items=bt.mergeEvaluated.items(o,t.items,n.items,r)))}mergeValidEvaluated(t,r){let{it:n,gen:o}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return o.if(r,()=>this.mergeEvaluated(t,z.Name)),!0}};Tt.KeywordCxt=vi;function rh(e,t,r,n){let o=new vi(e,r,t);"code"in r?r.code(o,n):o.$data&&r.validate?(0,En.funcKeywordCode)(o,r):"macro"in r?(0,En.macroKeywordCode)(o,r):(r.compile||r.validate)&&(0,En.funcKeywordCode)(o,r)}var nk=/^\/(?:[^~]|~0|~1)*$/,ok=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function nh(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let o,i;if(e==="")return R.default.rootData;if(e[0]==="/"){if(!nk.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);o=e,i=R.default.rootData}else{let l=ok.exec(e);if(!l)throw new Error(`Invalid JSON-pointer: ${e}`);let u=+l[1];if(o=l[2],o==="#"){if(u>=t)throw new Error(c("property/index",u));return n[t-u]}if(u>t)throw new Error(c("data",u));if(i=r[t-u],!o)return i}let a=i,s=o.split("/");for(let l of s)l&&(i=(0,z._)`${i}${(0,z.getProperty)((0,bt.unescapeJsonPointer)(l))}`,a=(0,z._)`${a} && ${i}`);return a;function c(l,u){return`Cannot access ${l} ${u} levels up, current level is ${t}`}}Tt.getData=nh});var xi=O(Sc=>{"use strict";Object.defineProperty(Sc,"__esModule",{value:!0});var wc=class extends Error{constructor(t){super("validation failed"),this.errors=t,this.ajv=this.validation=!0}};Sc.default=wc});var An=O(Oc=>{"use strict";Object.defineProperty(Oc,"__esModule",{value:!0});var kc=Pn(),$c=class extends Error{constructor(t,r,n,o){super(o||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,kc.resolveUrl)(t,r,n),this.missingSchema=(0,kc.normalizeId)((0,kc.getFullPath)(t,this.missingRef))}};Oc.default=$c});var Si=O(Ke=>{"use strict";Object.defineProperty(Ke,"__esModule",{value:!0});Ke.resolveSchema=Ke.getCompilingSchema=Ke.resolveRef=Ke.compileSchema=Ke.SchemaEnv=void 0;var et=I(),ik=xi(),Wt=gt(),tt=Pn(),oh=Y(),ak=Dn(),Rr=class{constructor(t){var r;this.refs={},this.dynamicAnchors={};let n;typeof t.schema=="object"&&(n=t.schema),this.schema=t.schema,this.schemaId=t.schemaId,this.root=t.root||this,this.baseId=(r=t.baseId)!==null&&r!==void 0?r:(0,tt.normalizeId)(n?.[t.schemaId||"$id"]),this.schemaPath=t.schemaPath,this.localRefs=t.localRefs,this.meta=t.meta,this.$async=n?.$async,this.refs={}}};Ke.SchemaEnv=Rr;function zc(e){let t=ih.call(this,e);if(t)return t;let r=(0,tt.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:n,lines:o}=this.opts.code,{ownProperties:i}=this.opts,a=new et.CodeGen(this.scope,{es5:n,lines:o,ownProperties:i}),s;e.$async&&(s=a.scopeValue("Error",{ref:ik.default,code:(0,et._)`require("ajv/dist/runtime/validation_error").default`}));let c=a.scopeName("validate");e.validateName=c;let l={gen:a,allErrors:this.opts.allErrors,data:Wt.default.data,parentData:Wt.default.parentData,parentDataProperty:Wt.default.parentDataProperty,dataNames:[Wt.default.data],dataPathArr:[et.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:a.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:(0,et.stringify)(e.schema)}:{ref:e.schema}),validateName:c,ValidationError:s,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:et.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,et._)`""`,opts:this.opts,self:this},u;try{this._compilations.add(e),(0,ak.validateFunctionCode)(l),a.optimize(this.opts.code.optimize);let d=a.toString();u=`${a.scopeRefs(Wt.default.scope)}return ${d}`,this.opts.code.process&&(u=this.opts.code.process(u,e));let p=new Function(`${Wt.default.self}`,`${Wt.default.scope}`,u)(this,this.scope.get());if(this.scope.value(c,{ref:p}),p.errors=null,p.schema=e.schema,p.schemaEnv=e,e.$async&&(p.$async=!0),this.opts.code.source===!0&&(p.source={validateName:c,validateCode:d,scopeValues:a._values}),this.opts.unevaluated){let{props:f,items:h}=l;p.evaluated={props:f instanceof et.Name?void 0:f,items:h instanceof et.Name?void 0:h,dynamicProps:f instanceof et.Name,dynamicItems:h instanceof et.Name},p.source&&(p.source.evaluated=(0,et.stringify)(p.evaluated))}return e.validate=p,e}catch(d){throw delete e.validate,delete e.validateName,u&&this.logger.error("Error compiling schema, function code:",u),d}finally{this._compilations.delete(e)}}Ke.compileSchema=zc;function sk(e,t,r){var n;r=(0,tt.resolveUrl)(this.opts.uriResolver,t,r);let o=e.refs[r];if(o)return o;let i=uk.call(this,e,r);if(i===void 0){let a=(n=e.localRefs)===null||n===void 0?void 0:n[r],{schemaId:s}=this.opts;a&&(i=new Rr({schema:a,schemaId:s,root:e,baseId:t}))}if(i!==void 0)return e.refs[r]=ck.call(this,i)}Ke.resolveRef=sk;function ck(e){return(0,tt.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:zc.call(this,e)}function ih(e){for(let t of this._compilations)if(lk(t,e))return t}Ke.getCompilingSchema=ih;function lk(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function uk(e,t){let r;for(;typeof(r=this.refs[t])=="string";)t=r;return r||this.schemas[t]||wi.call(this,e,t)}function wi(e,t){let r=this.opts.uriResolver.parse(t),n=(0,tt._getFullPath)(this.opts.uriResolver,r),o=(0,tt.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===o)return Pc.call(this,r,e);let i=(0,tt.normalizeId)(n),a=this.refs[i]||this.schemas[i];if(typeof a=="string"){let s=wi.call(this,e,a);return typeof s?.schema!="object"?void 0:Pc.call(this,r,s)}if(typeof a?.schema=="object"){if(a.validate||zc.call(this,a),i===(0,tt.normalizeId)(t)){let{schema:s}=a,{schemaId:c}=this.opts,l=s[c];return l&&(o=(0,tt.resolveUrl)(this.opts.uriResolver,o,l)),new Rr({schema:s,schemaId:c,root:e,baseId:o})}return Pc.call(this,r,a)}}Ke.resolveSchema=wi;var dk=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Pc(e,{baseId:t,schema:r,root:n}){var o;if(((o=e.fragment)===null||o===void 0?void 0:o[0])!=="/")return;for(let s of e.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let c=r[(0,oh.unescapeFragment)(s)];if(c===void 0)return;r=c;let l=typeof r=="object"&&r[this.opts.schemaId];!dk.has(s)&&l&&(t=(0,tt.resolveUrl)(this.opts.uriResolver,t,l))}let i;if(typeof r!="boolean"&&r.$ref&&!(0,oh.schemaHasRulesButRef)(r,this.RULES)){let s=(0,tt.resolveUrl)(this.opts.uriResolver,t,r.$ref);i=wi.call(this,n,s)}let{schemaId:a}=this.opts;if(i=i||new Rr({schema:r,schemaId:a,root:n,baseId:t}),i.schema!==i.root.schema)return i}});var ah=O((QN,pk)=>{pk.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 Nc=O((eR,mh)=>{"use strict";var mk=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),Dc=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),fk=RegExp.prototype.test.bind(/^\d*$/u),Xt=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),Ac=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),ch=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/]$/u),Cc=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/?]$/u),_k=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:]$/u),Re=new Array(256);{let e="0123456789ABCDEF";for(let t=0;t<256;t++)Re[t]="%"+e[t>>4]+e[t&15]}function Oe(e){return e<2048?Re[192|e>>6]+Re[128|e&63]:e<65536?Re[224|e>>12]+Re[128|e>>6&63]+Re[128|e&63]:Re[240|e>>18]+Re[128|e>>12&63]+Re[128|e>>6&63]+Re[128|e&63]}function hk(e){let t="",r=0,n=0;for(n=0;n<e.length;n++)if(r=e[n].charCodeAt(0),r!==48){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[n];break}for(n+=1;n<e.length;n++){if(r=e[n].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[n]}return t}var yk=RegExp.prototype.test.bind(/^[\dA-Fa-f]{1,4}$/),gk=RegExp.prototype.test.bind(/^[vV][\dA-Fa-f]+\.[A-Za-z\d\-._~!$&'()*+,;=:]+$/),bk=RegExp.prototype.test.bind(/^[A-Za-z\d\-._~]$/),vk=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function xk(e){if(e.length===0)return!1;for(let t=0;t<e.length;t++)if(!bk(e[t])){if(e[t]==="%"&&t+2<e.length&&Xt(e.slice(t+1,t+3))){t+=2;continue}return!1}return!0}function sh(e){let t=-1,r=0,n=-1,o=0;for(let s=0;s<e.length;s++)e[s]==="0"?(n===-1&&(n=s),o++,o>r&&(r=o,t=n)):(n=-1,o=0);if(r<2)return e.join(":");let i=e.slice(0,t).join(":"),a=e.slice(t+r).join(":");return i+"::"+a}function wk(e){let t=e.indexOf("::");if(t!==-1&&e.indexOf("::",t+1)!==-1)return;let r=t===-1?e.split(":"):e.slice(0,t).split(":"),n=t===-1?[]:e.slice(t+2).split(":");t!==-1&&(r.length===1&&r[0]===""&&(r.length=0),n.length===1&&n[0]===""&&(n.length=0));let o=r.concat(n),i=0;for(let s=0;s<o.length;s++){let c=o[s];if(c==="")return;if(c.indexOf(".")!==-1){if(s!==o.length-1||t!==-1&&n.length===0||!Dc(c))return;i+=2;continue}if(!yk(c))return;o[s]=parseInt(c,16).toString(16),i++}if(t===-1)return i!==8?void 0:sh(o);if(i>=8)return;let a=o.slice(0,r.length);for(let s=i;s<8;s++)a.push("0");for(let s=r.length;s<o.length;s++)a.push(o[s]);return sh(a)}function Ec(e){let t=e[0]==="["&&e[e.length-1]==="]";if((e[0]==="["||e[e.length-1]==="]")&&!t)return{host:e,isIPV6:!1,error:!0};let n=t?e.slice(1,-1):e;if(t&&gk(n))return n=n.toLowerCase(),{host:`[${n}]`,escapedHost:n,isIPV6:!1,isIPVFuture:!0};if(Sk(n,":")<2)return{host:e,isIPV6:!1,error:t};let o="",i=n.indexOf("%");if(i!==-1){let s=n.slice(i,i+3).toLowerCase()==="%25"?3:1;if(o=n.slice(i+s),!xk(o))return{host:e,isIPV6:!1,error:!0};n=n.slice(0,i)}let a=wk(n);return a===void 0?{host:e,isIPV6:!1,error:!0}:{host:a+(o?"%"+o:""),escapedHost:a+(o?"%25"+o:""),isIPV6:!0}}function Sk(e,t){let r=0;for(let n=0;n<e.length;n++)e[n]===t&&r++;return r}function kk(e){let t=e,r=[],n=-1,o=0;for(;o=t.length;){if(o===1){if(t===".")break;if(t==="/"){r.push("/");break}else{r.push(t);break}}else if(o===2){if(t[0]==="."){if(t[1]===".")break;if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"&&(t[1]==="."||t[1]==="/")){r.push("/");break}}else if(o===3&&t==="/.."){r.length!==0&&r.pop(),r.push("/");break}if(t[0]==="."){if(t[1]==="."){if(t[2]==="/"){t=t.slice(3);continue}}else if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"&&t[1]==="."){if(t[2]==="/"){t=t.slice(2);continue}else if(t[2]==="."&&t[3]==="/"){t=t.slice(3),r.length!==0&&r.pop();continue}}if((n=t.indexOf("/",1))===-1){r.push(t);break}else r.push(t.slice(0,n)),t=t.slice(n)}return r.join("")}var $k={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},Ok=/[@/?#:]/g,Pk=/[@/?#]/g;function lh(e,t){let r=t?Pk:Ok;return r.lastIndex=0,e.replace(r,n=>$k[n])}function uh(e,t=!1){if(e.indexOf("%")===-1)return e;let r="";for(let n=0;n<e.length;n++){if(e[n]==="%"&&n+2<e.length){let o=e.slice(n+1,n+3);if(Xt(o)){let i=o.toUpperCase(),a=String.fromCharCode(parseInt(i,16));t&&Ac(a)?r+=a:r+="%"+i,n+=2;continue}}r+=e[n]}return r}function zk(e){let t="";for(let r=0;r<e.length;r++){let n=e[r];if(n==="%"&&r+2<e.length){let o=e.slice(r+1,r+3);if(Xt(o)){let i=o.toUpperCase(),a=String.fromCharCode(parseInt(i,16));a!=="."&&Ac(a)?t+=a:t+="%"+i,r+=2;continue}}if(ch(n))t+=n;else{let o=e.charCodeAt(r);if(o<128)t+=ph(o)?n:Re[o];else if(o<55296||o>57343)t+=Oe(o);else if(o<=56319&&r+1<e.length){let i=e.charCodeAt(r+1);i>=56320&&i<=57343?(t+=Oe(65536+(o-55296<<10)+(i-56320)),r++):t+=Oe(65533)}else t+=Oe(65533)}}return t}function Ek(e,t=!1){let r="",n=t&&e[0]!=="/";for(let o=0;o<e.length;o++){let i=e[o];if(i==="%"&&o+2<e.length){let a=e.slice(o+1,o+3);if(Xt(a)){r+="%"+a.toUpperCase(),o+=2;continue}}if(i==="/"&&(n=!1),ch(i)&&(i!==":"||!n))r+=i;else{let a=e.charCodeAt(o);if(a<128)r+=Re[a];else if(a<55296||a>57343)r+=Oe(a);else if(a<=56319&&o+1<e.length){let s=e.charCodeAt(o+1);s>=56320&&s<=57343?(r+=Oe(65536+(a-55296<<10)+(s-56320)),o++):r+=Oe(65533)}else r+=Oe(65533)}}return r}function qc(e,t){let r="";for(let n=0;n<e.length;n++){let o=e[n];if(o==="%"&&n+2<e.length){let i=e.slice(n+1,n+3);if(Xt(i)){r+="%"+i.toUpperCase(),n+=2;continue}}if(t(o))r+=o;else{let i=e.charCodeAt(n);if(i<128)r+=Re[i];else if(i<55296||i>57343)r+=Oe(i);else if(i<=56319&&n+1<e.length){let a=e.charCodeAt(n+1);a>=56320&&a<=57343?(r+=Oe(65536+(i-55296<<10)+(a-56320)),n++):r+=Oe(65533)}else r+=Oe(65533)}}return r}function dh(e){return qc(e,_k)}function Dk(e){return qc(e,Cc)}function Ak(e){return qc(e,Cc)}function ph(e){return e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122||e===42||e===43||e===45||e===46||e===47||e===64||e===95}function Ck(e){let t="";for(let r=0;r<e.length;r++){let n=e[r];if(n==="%"&&r+2<e.length){let o=e.slice(r+1,r+3);if(Xt(o)){let i=o.toUpperCase(),a=String.fromCharCode(parseInt(i,16));Ac(a)?t+=a:t+="%"+i,r+=2;continue}}if(Cc(n))t+=n;else{let o=e.charCodeAt(r);if(o<128)t+=ph(o)?n:Re[o];else if(o<55296||o>57343)t+=Oe(o);else if(o<=56319&&r+1<e.length){let i=e.charCodeAt(r+1);i>=56320&&i<=57343?(t+=Oe(65536+(o-55296<<10)+(i-56320)),r++):t+=Oe(65533)}else t+=Oe(65533)}}return t}function qk(e){let t="";for(let r=0;r<e.length;r++){if(e[r]==="%"&&r+2<e.length){let n=e.slice(r+1,r+3);if(Xt(n)){t+="%"+n.toUpperCase(),r+=2;continue}}t+=escape(e[r])}return t}function Nk(e){let t=[];if(e.userinfo!==void 0&&(t.push(dh(e.userinfo)),t.push("@")),e.host!==void 0){let r=e.host;if(!Dc(r)){let n=Ec(r);n.isIPV6!==!0&&n.isIPVFuture!==!0&&(r=uh(r,!0),n=Ec(r)),n.isIPV6===!0||n.isIPVFuture===!0?r=`[${n.escapedHost}]`:r=lh(r,!1)}t.push(r)}if(typeof e.port=="number"||typeof e.port=="string"){let r=String(e.port);if(!fk(r))throw new TypeError("URI port is malformed.");t.push(":"),t.push(r)}return t.length?t.join(""):void 0}mh.exports={nonSimpleDomain:vk,recomposeAuthority:Nk,reescapeHostDelimiters:lh,normalizePercentEncoding:uh,normalizePathEncoding:zk,serializePathEncoding:Ek,normalizeQueryFragmentEncoding:Ck,encodeUserinfo:dh,encodeQuery:Dk,encodeFragment:Ak,escapePreservingEscapes:qk,removeDotSegments:kk,isIPv4:Dc,isUUID:mk,normalizeIPv6:Ec,stringArrayToHexStripped:hk}});var gh=O((tR,yh)=>{"use strict";var{isUUID:Rk}=Nc(),Tk=/^([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-./:;=@]|%[\da-f]{2})+)$/iu,Ik=["http","https","ws","wss","urn","urn:uuid"];function Mk(e){return Ik.indexOf(e)!==-1}function Rc(e){return e.secure===!0?!0:e.secure===!1?!1:e.scheme?e.scheme.length===3&&(e.scheme[0]==="w"||e.scheme[0]==="W")&&(e.scheme[1]==="s"||e.scheme[1]==="S")&&(e.scheme[2]==="s"||e.scheme[2]==="S"):!1}function fh(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function _h(e){let t=String(e.scheme).toLowerCase()==="https";return(e.port===(t?443:80)||e.port==="")&&(e.port=void 0),e.path||(e.path="/"),e}function jk(e){return e.secure=Rc(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}function Uk(e){if((e.port===(Rc(e)?443:80)||e.port==="")&&(e.port=void 0),typeof e.secure=="boolean"&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){let t=e.resourceName.indexOf("?"),r=t===-1?e.resourceName:e.resourceName.slice(0,t);e.path=r&&r!=="/"?r:void 0,e.query=t===-1?void 0:e.resourceName.slice(t+1),e.resourceName=void 0}return e.fragment=void 0,e}function Zk(e,t){if(!e.path)return e.error="URN can not be parsed",e;let r=e.path.match(Tk);if(r&&r[0]===e.path){let n=t.scheme||e.scheme||"urn";e.nid=r[1].toLowerCase(),e.nss=r[2];let o=`${n}:${t.nid||e.nid}`,i=Tc(o);e.path=void 0,i&&(e=i.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e}function Fk(e,t){if(e.nid===void 0)throw new Error("URN without nid cannot be serialized");let r=t.scheme||e.scheme||"urn",n=e.nid.toLowerCase(),o=`${r}:${t.nid||n}`,i=Tc(o);i&&(e=i.serialize(e,t));let a=e,s=e.nss;return a.path=`${n||t.nid}:${s}`,t.skipEscape=!0,a}function Lk(e,t){let r=e;return r.uuid=r.nss,r.nss=void 0,!t.tolerant&&(!r.uuid||!Rk(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function Hk(e){let t=e;return t.nss=(e.uuid||"").toLowerCase(),t}var hh={scheme:"http",domainHost:!0,parse:fh,serialize:_h},Yk={scheme:"https",domainHost:hh.domainHost,parse:fh,serialize:_h},ki={scheme:"ws",domainHost:!0,parse:jk,serialize:Uk},Kk={scheme:"wss",domainHost:ki.domainHost,parse:ki.parse,serialize:ki.serialize},Bk={scheme:"urn",parse:Zk,serialize:Fk,skipNormalize:!0},Gk={scheme:"urn:uuid",parse:Lk,serialize:Hk,skipNormalize:!0},$i={http:hh,https:Yk,ws:ki,wss:Kk,urn:Bk,"urn:uuid":Gk};Object.setPrototypeOf($i,null);function Tc(e){return e&&($i[e]||$i[e.toLowerCase()])||void 0}yh.exports={wsIsSecure:Rc,SCHEMES:$i,isValidSchemeName:Mk,getSchemeHandler:Tc}});var Ch=O((rR,zi)=>{"use strict";var{normalizeIPv6:Sh,removeDotSegments:qn,recomposeAuthority:Jk,normalizePercentEncoding:kh,normalizePathEncoding:Vk,serializePathEncoding:bh,normalizeQueryFragmentEncoding:vh,encodeQuery:Wk,encodeFragment:Xk,reescapeHostDelimiters:Qk,isIPv4:$h,nonSimpleDomain:e$}=Nc(),{SCHEMES:Oh,getSchemeHandler:Ic}=gh(),Ph=/^[A-Za-z][A-Za-z0-9+.-]*$/u,zh="URI scheme is malformed.";function xh(e){let t=unescape(String(e));if(!Ph.test(t))throw new TypeError(zh);return t}function t$(e,t){return typeof e=="string"?e=l$(e,t):typeof e=="object"&&(e=Pi(Qt(e,t),t)),e}function r$(e,t,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},{parsed:o,malformedAuthorityOrPort:i,malformedPercentEncoding:a,malformedSchemeSpecific:s,malformedHost:c,malformedScheme:l}=Oi(e,n),{parsed:u,malformedAuthorityOrPort:d,malformedPercentEncoding:m,malformedSchemeSpecific:p,malformedHost:f,malformedScheme:h}=Oi(t,n);if(i||d||a||m||s||p||c||f||l||h)throw new Error(o.error||u.error||"URI is malformed.");let y=Eh(o,u,n,!0),v=Ic(r&&r.scheme||y.scheme),w=y.host,S=w!==void 0&&w!==""&&($h(w)||Sh(w).isIPV6);Dh(y,r||{},v,S);let q=w&&w.indexOf("%")!==-1&&!new RegExp("\\P{ASCII}","u").test(w);if(y.error&&!q)throw new Error(y.error);return n.skipEscape=!0,Qt(y,n)}function Eh(e,t,r,n){let o={};return n||(e=Pi(Qt(e,r),r),t=Pi(Qt(t,r),r)),r=r||{},!r.tolerant&&t.scheme?(o.scheme=t.scheme,o.userinfo=t.userinfo,o.host=t.host,o.port=t.port,o.path=qn(t.path||""),o.query=t.query):(t.userinfo!==void 0||t.host!==void 0||t.port!==void 0?(o.userinfo=t.userinfo,o.host=t.host,o.port=t.port,o.path=qn(t.path||""),o.query=t.query):(t.path?(t.path[0]==="/"?o.path=qn(t.path):((e.userinfo!==void 0||e.host!==void 0||e.port!==void 0)&&!e.path?o.path="/"+t.path:e.path?o.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:o.path=t.path,o.path=qn(o.path)),o.query=t.query):(o.path=e.path,t.query!==void 0?o.query=t.query:o.query=e.query),o.userinfo=e.userinfo,o.host=e.host,o.port=e.port),o.scheme=e.scheme),o.fragment=t.fragment,o}function n$(e,t,r){let n=wh(e,r),o=wh(t,r);return n!==void 0&&o!==void 0&&n===o}function Qt(e,t){let r={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},n=Object.assign({},t),o=[];r.scheme&&(r.scheme=xh(r.scheme));let i=Ic(n.scheme||r.scheme);i&&i.serialize&&i.serialize(r,n);let a=r.userinfo!==void 0||r.host!==void 0||r.port!==void 0,s=!n.skipEscape&&r.scheme===void 0&&!a;r.path!==void 0&&(n.skipEscape?r.path=kh(r.path):r.path=bh(r.path,s)),n.reference!=="suffix"&&r.scheme&&(r.scheme=xh(r.scheme),o.push(r.scheme,":"));let c=Jk(r);if(c!==void 0&&(n.reference!=="suffix"&&o.push("//"),o.push(c),r.path&&r.path[0]!=="/"&&o.push("/")),r.path!==void 0){let l=r.path;!n.absolutePath&&(!i||!i.absolutePath)&&(l=qn(l)),s&&(l=bh(l,!0)),c===void 0&&l[0]==="/"&&l[1]==="/"&&(l="/%2F"+l.slice(2)),o.push(l)}return r.query!==void 0&&o.push("?",Wk(r.query)),r.fragment!==void 0&&o.push("#",Xk(r.fragment)),o.join("")}var o$=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u,i$=/^(?:[^#/:?]+:)?\/\/([^/?#]*)/,a$=/^(?:[^#/:?]+:)?([/\\\t\n\r]*)/;function s$(e,t){if(t[2]!==void 0&&e.path&&e.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof e.port=="number"&&(e.port<0||e.port>65535))return"URI port is malformed."}function Cn(e){if(e===void 0)return!1;let t=e.indexOf("%");for(;t!==-1;){if(t+2>=e.length||!/^[\da-f]{2}$/iu.test(e.slice(t+1,t+3)))return!0;t=e.indexOf("%",t+3)}return!1}function Mc(e){return e[0]==="["&&e[e.length-1]==="]"}function c$(e){let t=e[4];return Cn(e[3])||t!==void 0&&!Mc(t)&&Cn(t)||Cn(e[6])||Cn(e[7])||Cn(e[8])}function Dh(e,t,r,n){if(!t.unicodeSupport&&(!r||!r.unicodeSupport)&&e.host&&!Mc(e.host)&&(t.domainHost||r&&r.domainHost)&&n===!1&&e$(e.host))try{e.host=new URL("http://"+e.host).hostname}catch(o){return e.error=e.error||"Host's domain name can not be converted to ASCII: "+o,!0}return!1}function Oi(e,t){let r=Object.assign({},t),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},o=!1,i=!1,a=!1,s=!1,c=!1,l=!1,u=!1;r.reference==="suffix"&&(r.scheme?e=r.scheme+":"+e:e="//"+e);let d=e.match(i$);d!==null&&d[1].indexOf("\\")!==-1&&(n.error="URI authority must not contain a literal backslash.",o=!0);let m=e.match(a$);if(m!==null){let f=m[1],h=f.replace(/[\t\n\r]/g,"");h.length>=2&&(h.slice(0,2)!=="//"?(n.error=n.error||"URI authority must not contain a literal backslash.",o=!0):f.length!==h.length&&(n.error=n.error||"URI authority introducer must not contain whitespace.",o=!0))}let p=e.match(o$);if(p){if(n.scheme=p[1],n.userinfo=p[3],n.host=p[4],n.port=parseInt(p[5],10),n.path=p[6]||"",n.query=p[7],n.fragment=p[8],n.scheme!==void 0){let y=unescape(n.scheme);Ph.test(y)?n.scheme=y.toLowerCase():(n.error=n.error||zh,l=!0)}i=c$(p),i&&(n.error=n.error||"URI contains malformed percent-encoding."),isNaN(n.port)&&(n.port=p[5]);let f=s$(n,p);if(f!==void 0&&(n.error=n.error||f,o=!0),n.host)if($h(n.host)===!1){let v=Mc(n.host),w=n.host.indexOf("[")!==-1||n.host.indexOf("]")!==-1,S=Sh(n.host);u=S.isIPV6||S.isIPVFuture===!0,c=w&&(!v||S.error===!0),n.host=u?S.host:S.host.toLowerCase(),c&&(n.error=n.error||"URI host is malformed.",o=!0)}else u=!0;n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path?n.reference="same-document":n.scheme===void 0?n.reference="relative":n.fragment===void 0?n.reference="absolute":n.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");let h=Ic(r.scheme||n.scheme);if(c||(s=Dh(n,r,h,u)),!h||h&&!h.skipNormalize){if(e.indexOf("%")!==-1&&n.host!==void 0&&!c){let y=u?n.host:kh(n.host,!0);n.host=Qk(y,u)}n.path&&(n.path=Vk(n.path)),n.query&&(n.query=vh(n.query)),n.fragment&&(n.fragment=vh(n.fragment))}h&&h.parse&&(h.parse(n,r),h===Oh.urn&&n.nid===void 0&&(a=!0))}else n.error=n.error||"URI can not be parsed.";return{parsed:n,malformedAuthorityOrPort:o,malformedPercentEncoding:i,malformedSchemeSpecific:a,malformedHost:s,malformedScheme:l}}function Pi(e,t){return Oi(e,t).parsed}function l$(e,t){return Ah(e,t).normalized}function Ah(e,t){let{parsed:r,malformedAuthorityOrPort:n,malformedPercentEncoding:o,malformedSchemeSpecific:i,malformedHost:a,malformedScheme:s}=Oi(e,t);return{normalized:n||o||i||a||s?e:Qt(r,t),malformedAuthorityOrPort:n,malformedPercentEncoding:o,malformedSchemeSpecific:i,malformedHost:a,malformedScheme:s}}function wh(e,t){if(typeof e!="string"&&typeof e!="object")return;let r;try{r=typeof e=="string"?e:Qt(e,t)}catch{return}let{normalized:n,malformedAuthorityOrPort:o,malformedPercentEncoding:i,malformedSchemeSpecific:a,malformedHost:s,malformedScheme:c}=Ah(r,t);return o||i||a||s||c?void 0:n}var jc={SCHEMES:Oh,normalize:t$,resolve:r$,resolveComponent:Eh,equal:n$,serialize:Qt,parse:Pi};zi.exports=jc;zi.exports.default=jc;zi.exports.fastUri=jc});var Nh=O(Uc=>{"use strict";Object.defineProperty(Uc,"__esModule",{value:!0});var qh=Ch();qh.code='require("ajv/dist/runtime/uri").default';Uc.default=qh});var Fh=O(ge=>{"use strict";Object.defineProperty(ge,"__esModule",{value:!0});ge.CodeGen=ge.Name=ge.nil=ge.stringify=ge.str=ge._=ge.KeywordCxt=void 0;var u$=Dn();Object.defineProperty(ge,"KeywordCxt",{enumerable:!0,get:function(){return u$.KeywordCxt}});var Tr=I();Object.defineProperty(ge,"_",{enumerable:!0,get:function(){return Tr._}});Object.defineProperty(ge,"str",{enumerable:!0,get:function(){return Tr.str}});Object.defineProperty(ge,"stringify",{enumerable:!0,get:function(){return Tr.stringify}});Object.defineProperty(ge,"nil",{enumerable:!0,get:function(){return Tr.nil}});Object.defineProperty(ge,"Name",{enumerable:!0,get:function(){return Tr.Name}});Object.defineProperty(ge,"CodeGen",{enumerable:!0,get:function(){return Tr.CodeGen}});var d$=xi(),jh=An(),p$=lc(),Nn=Si(),m$=I(),Rn=Pn(),Ei=On(),Fc=Y(),Rh=ah(),f$=Nh(),Uh=(e,t)=>new RegExp(e,t);Uh.code="new RegExp";var _$=["removeAdditional","useDefaults","coerceTypes"],h$=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),y$={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},g$={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},Th=200;function b$(e){var t,r,n,o,i,a,s,c,l,u,d,m,p,f,h,y,v,w,S,q,b,x,D,X,ne;let pe=e.strict,wt=(t=e.code)===null||t===void 0?void 0:t.optimize,cr=wt===!0||wt===void 0?1:wt||0,lr=(n=(r=e.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:Uh,St=(o=e.uriResolver)!==null&&o!==void 0?o:f$.default;return{strictSchema:(a=(i=e.strictSchema)!==null&&i!==void 0?i:pe)!==null&&a!==void 0?a:!0,strictNumbers:(c=(s=e.strictNumbers)!==null&&s!==void 0?s:pe)!==null&&c!==void 0?c:!0,strictTypes:(u=(l=e.strictTypes)!==null&&l!==void 0?l:pe)!==null&&u!==void 0?u:"log",strictTuples:(m=(d=e.strictTuples)!==null&&d!==void 0?d:pe)!==null&&m!==void 0?m:"log",strictRequired:(f=(p=e.strictRequired)!==null&&p!==void 0?p:pe)!==null&&f!==void 0?f:!1,code:e.code?{...e.code,optimize:cr,regExp:lr}:{optimize:cr,regExp:lr},loopRequired:(h=e.loopRequired)!==null&&h!==void 0?h:Th,loopEnum:(y=e.loopEnum)!==null&&y!==void 0?y:Th,meta:(v=e.meta)!==null&&v!==void 0?v:!0,messages:(w=e.messages)!==null&&w!==void 0?w:!0,inlineRefs:(S=e.inlineRefs)!==null&&S!==void 0?S:!0,schemaId:(q=e.schemaId)!==null&&q!==void 0?q:"$id",addUsedSchema:(b=e.addUsedSchema)!==null&&b!==void 0?b:!0,validateSchema:(x=e.validateSchema)!==null&&x!==void 0?x:!0,validateFormats:(D=e.validateFormats)!==null&&D!==void 0?D:!0,unicodeRegExp:(X=e.unicodeRegExp)!==null&&X!==void 0?X:!0,int32range:(ne=e.int32range)!==null&&ne!==void 0?ne:!0,uriResolver:St}}var Tn=class{constructor(t={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,t=this.opts={...t,...b$(t)};let{es5:r,lines:n}=this.opts.code;this.scope=new m$.ValueScope({scope:{},prefixes:h$,es5:r,lines:n}),this.logger=$$(t.logger);let o=t.validateFormats;t.validateFormats=!1,this.RULES=(0,p$.getRules)(),Ih.call(this,y$,t,"NOT SUPPORTED"),Ih.call(this,g$,t,"DEPRECATED","warn"),this._metaOpts=S$.call(this),t.formats&&x$.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),t.keywords&&w$.call(this,t.keywords),typeof t.meta=="object"&&this.addMetaSchema(t.meta),v$.call(this),t.validateFormats=o}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:t,meta:r,schemaId:n}=this.opts,o=Rh;n==="id"&&(o={...Rh},o.id=o.$id,delete o.$id),r&&t&&this.addMetaSchema(o,o[n],!1)}defaultMeta(){let{meta:t,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof t=="object"?t[r]||t:void 0}validate(t,r){let n;if(typeof t=="string"){if(n=this.getSchema(t),!n)throw new Error(`no schema with key or ref "${t}"`)}else n=this.compile(t);let o=n(r);return"$async"in n||(this.errors=n.errors),o}compile(t,r){let n=this._addSchema(t,r);return n.validate||this._compileSchemaEnv(n)}compileAsync(t,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return o.call(this,t,r);async function o(u,d){await i.call(this,u.$schema);let m=this._addSchema(u,d);return m.validate||a.call(this,m)}async function i(u){u&&!this.getSchema(u)&&await o.call(this,{$ref:u},!0)}async function a(u){try{return this._compileSchemaEnv(u)}catch(d){if(!(d instanceof jh.default))throw d;return s.call(this,d),await c.call(this,d.missingSchema),a.call(this,u)}}function s({missingSchema:u,missingRef:d}){if(this.refs[u])throw new Error(`AnySchema ${u} is loaded but ${d} cannot be resolved`)}async function c(u){let d=await l.call(this,u);this.refs[u]||await i.call(this,d.$schema),this.refs[u]||this.addSchema(d,u,r)}async function l(u){let d=this._loading[u];if(d)return d;try{return await(this._loading[u]=n(u))}finally{delete this._loading[u]}}}addSchema(t,r,n,o=this.opts.validateSchema){if(Array.isArray(t)){for(let a of t)this.addSchema(a,void 0,n,o);return this}let i;if(typeof t=="object"){let{schemaId:a}=this.opts;if(i=t[a],i!==void 0&&typeof i!="string")throw new Error(`schema ${a} must be string`)}return r=(0,Rn.normalizeId)(r||i),this._checkUnique(r),this.schemas[r]=this._addSchema(t,n,r,o,!0),this}addMetaSchema(t,r,n=this.opts.validateSchema){return this.addSchema(t,r,!0,n),this}validateSchema(t,r){if(typeof t=="boolean")return!0;let n;if(n=t.$schema,n!==void 0&&typeof n!="string")throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let o=this.validate(n,t);if(!o&&r){let i="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(i);else throw new Error(i)}return o}getSchema(t){let r;for(;typeof(r=Mh.call(this,t))=="string";)t=r;if(r===void 0){let{schemaId:n}=this.opts,o=new Nn.SchemaEnv({schema:{},schemaId:n});if(r=Nn.resolveSchema.call(this,o,t),!r)return;this.refs[t]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(t){if(t instanceof RegExp)return this._removeAllSchemas(this.schemas,t),this._removeAllSchemas(this.refs,t),this;switch(typeof t){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=Mh.call(this,t);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[t],delete this.refs[t],this}case"object":{let r=t;this._cache.delete(r);let n=t[this.opts.schemaId];return n&&(n=(0,Rn.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(t){for(let r of t)this.addKeyword(r);return this}addKeyword(t,r){let n;if(typeof t=="string")n=t,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=n);else if(typeof t=="object"&&r===void 0){if(r=t,n=r.keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(P$.call(this,n,r),!r)return(0,Fc.eachItem)(n,i=>Zc.call(this,i)),this;E$.call(this,r);let o={...r,type:(0,Ei.getJSONTypes)(r.type),schemaType:(0,Ei.getJSONTypes)(r.schemaType)};return(0,Fc.eachItem)(n,o.type.length===0?i=>Zc.call(this,i,o):i=>o.type.forEach(a=>Zc.call(this,i,o,a))),this}getKeyword(t){let r=this.RULES.all[t];return typeof r=="object"?r.definition:!!r}removeKeyword(t){let{RULES:r}=this;delete r.keywords[t],delete r.all[t];for(let n of r.rules){let o=n.rules.findIndex(i=>i.keyword===t);o>=0&&n.rules.splice(o,1)}return this}addFormat(t,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[t]=r,this}errorsText(t=this.errors,{separator:r=", ",dataVar:n="data"}={}){return!t||t.length===0?"No errors":t.map(o=>`${n}${o.instancePath} ${o.message}`).reduce((o,i)=>o+r+i)}$dataMetaSchema(t,r){let n=this.RULES.all;t=JSON.parse(JSON.stringify(t));for(let o of r){let i=o.split("/").slice(1),a=t;for(let s of i)a=a[s];for(let s in n){let c=n[s];if(typeof c!="object")continue;let{$data:l}=c.definition,u=a[s];l&&u&&(a[s]=Zh(u))}}return t}_removeAllSchemas(t,r){for(let n in t){let o=t[n];(!r||r.test(n))&&(typeof o=="string"?delete t[n]:o&&!o.meta&&(this._cache.delete(o.schema),delete t[n]))}}_addSchema(t,r,n,o=this.opts.validateSchema,i=this.opts.addUsedSchema){let a,{schemaId:s}=this.opts;if(typeof t=="object")a=t[s];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof t!="boolean")throw new Error("schema must be object or boolean")}let c=this._cache.get(t);if(c!==void 0)return c;n=(0,Rn.normalizeId)(a||n);let l=Rn.getSchemaRefs.call(this,t,n);return c=new Nn.SchemaEnv({schema:t,schemaId:s,meta:r,baseId:n,localRefs:l}),this._cache.set(c.schema,c),i&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=c),o&&this.validateSchema(t,!0),c}_checkUnique(t){if(this.schemas[t]||this.refs[t])throw new Error(`schema with key or id "${t}" already exists`)}_compileSchemaEnv(t){if(t.meta?this._compileMetaSchema(t):Nn.compileSchema.call(this,t),!t.validate)throw new Error("ajv implementation error");return t.validate}_compileMetaSchema(t){let r=this.opts;this.opts=this._metaOpts;try{Nn.compileSchema.call(this,t)}finally{this.opts=r}}};Tn.ValidationError=d$.default;Tn.MissingRefError=jh.default;ge.default=Tn;function Ih(e,t,r,n="error"){for(let o in e){let i=o;i in t&&this.logger[n](`${r}: option ${o}. ${e[i]}`)}}function Mh(e){return e=(0,Rn.normalizeId)(e),this.schemas[e]||this.refs[e]}function v$(){let e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(let t in e)this.addSchema(e[t],t)}function x$(){for(let e in this.opts.formats){let t=this.opts.formats[e];t&&this.addFormat(e,t)}}function w$(e){if(Array.isArray(e)){this.addVocabulary(e);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let t in e){let r=e[t];r.keyword||(r.keyword=t),this.addKeyword(r)}}function S$(){let e={...this.opts};for(let t of _$)delete e[t];return e}var k$={log(){},warn(){},error(){}};function $$(e){if(e===!1)return k$;if(e===void 0)return console;if(e.log&&e.warn&&e.error)return e;throw new Error("logger must implement log, warn and error methods")}var O$=/^[a-z_$][a-z0-9_$:-]*$/i;function P$(e,t){let{RULES:r}=this;if((0,Fc.eachItem)(e,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!O$.test(n))throw new Error(`Keyword ${n} has invalid name`)}),!!t&&t.$data&&!("code"in t||"validate"in t))throw new Error('$data keyword must have "code" or "validate" function')}function Zc(e,t,r){var n;let o=t?.post;if(r&&o)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:i}=this,a=o?i.post:i.rules.find(({type:c})=>c===r);if(a||(a={type:r,rules:[]},i.rules.push(a)),i.keywords[e]=!0,!t)return;let s={keyword:e,definition:{...t,type:(0,Ei.getJSONTypes)(t.type),schemaType:(0,Ei.getJSONTypes)(t.schemaType)}};t.before?z$.call(this,a,s,t.before):a.rules.push(s),i.all[e]=s,(n=t.implements)===null||n===void 0||n.forEach(c=>this.addKeyword(c))}function z$(e,t,r){let n=e.rules.findIndex(o=>o.keyword===r);n>=0?e.rules.splice(n,0,t):(e.rules.push(t),this.logger.warn(`rule ${r} is not defined`))}function E$(e){let{metaSchema:t}=e;t!==void 0&&(e.$data&&this.opts.$data&&(t=Zh(t)),e.validateSchema=this.compile(t,!0))}var D$={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function Zh(e){return{anyOf:[e,D$]}}});var Lh=O(Lc=>{"use strict";Object.defineProperty(Lc,"__esModule",{value:!0});var A$={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};Lc.default=A$});var Bh=O(er=>{"use strict";Object.defineProperty(er,"__esModule",{value:!0});er.callRef=er.getValidate=void 0;var C$=An(),Hh=Ye(),Te=I(),Ir=gt(),Yh=Si(),Di=Y(),q$={keyword:"$ref",schemaType:"string",code(e){let{gen:t,schema:r,it:n}=e,{baseId:o,schemaEnv:i,validateName:a,opts:s,self:c}=n,{root:l}=i;if((r==="#"||r==="#/")&&o===l.baseId)return d();let u=Yh.resolveRef.call(c,l,o,r);if(u===void 0)throw new C$.default(n.opts.uriResolver,o,r);if(u instanceof Yh.SchemaEnv)return m(u);return p(u);function d(){if(i===l)return Ai(e,a,i,i.$async);let f=t.scopeValue("root",{ref:l});return Ai(e,(0,Te._)`${f}.validate`,l,l.$async)}function m(f){let h=Kh(e,f);Ai(e,h,f,f.$async)}function p(f){let h=t.scopeValue("schema",s.code.source===!0?{ref:f,code:(0,Te.stringify)(f)}:{ref:f}),y=t.name("valid"),v=e.subschema({schema:f,dataTypes:[],schemaPath:Te.nil,topSchemaRef:h,errSchemaPath:r},y);e.mergeEvaluated(v),e.ok(y)}}};function Kh(e,t){let{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):(0,Te._)`${r.scopeValue("wrapper",{ref:t})}.validate`}er.getValidate=Kh;function Ai(e,t,r,n){let{gen:o,it:i}=e,{allErrors:a,schemaEnv:s,opts:c}=i,l=c.passContext?Ir.default.this:Te.nil;n?u():d();function u(){if(!s.$async)throw new Error("async schema referenced by sync schema");let f=o.let("valid");o.try(()=>{o.code((0,Te._)`await ${(0,Hh.callValidateCode)(e,t,l)}`),p(t),a||o.assign(f,!0)},h=>{o.if((0,Te._)`!(${h} instanceof ${i.ValidationError})`,()=>o.throw(h)),m(h),a||o.assign(f,!1)}),e.ok(f)}function d(){e.result((0,Hh.callValidateCode)(e,t,l),()=>p(t),()=>m(t))}function m(f){let h=(0,Te._)`${f}.errors`;o.assign(Ir.default.vErrors,(0,Te._)`${Ir.default.vErrors} === null ? ${h} : ${Ir.default.vErrors}.concat(${h})`),o.assign(Ir.default.errors,(0,Te._)`${Ir.default.vErrors}.length`)}function p(f){var h;if(!i.opts.unevaluated)return;let y=(h=r?.validate)===null||h===void 0?void 0:h.evaluated;if(i.props!==!0)if(y&&!y.dynamicProps)y.props!==void 0&&(i.props=Di.mergeEvaluated.props(o,y.props,i.props));else{let v=o.var("props",(0,Te._)`${f}.evaluated.props`);i.props=Di.mergeEvaluated.props(o,v,i.props,Te.Name)}if(i.items!==!0)if(y&&!y.dynamicItems)y.items!==void 0&&(i.items=Di.mergeEvaluated.items(o,y.items,i.items));else{let v=o.var("items",(0,Te._)`${f}.evaluated.items`);i.items=Di.mergeEvaluated.items(o,v,i.items,Te.Name)}}}er.callRef=Ai;er.default=q$});var Gh=O(Hc=>{"use strict";Object.defineProperty(Hc,"__esModule",{value:!0});var N$=Lh(),R$=Bh(),T$=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",N$.default,R$.default];Hc.default=T$});var Jh=O(Yc=>{"use strict";Object.defineProperty(Yc,"__esModule",{value:!0});var Ci=I(),It=Ci.operators,qi={maximum:{okStr:"<=",ok:It.LTE,fail:It.GT},minimum:{okStr:">=",ok:It.GTE,fail:It.LT},exclusiveMaximum:{okStr:"<",ok:It.LT,fail:It.GTE},exclusiveMinimum:{okStr:">",ok:It.GT,fail:It.LTE}},I$={message:({keyword:e,schemaCode:t})=>(0,Ci.str)`must be ${qi[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,Ci._)`{comparison: ${qi[e].okStr}, limit: ${t}}`},M$={keyword:Object.keys(qi),type:"number",schemaType:"number",$data:!0,error:I$,code(e){let{keyword:t,data:r,schemaCode:n}=e;e.fail$data((0,Ci._)`${r} ${qi[t].fail} ${n} || isNaN(${r})`)}};Yc.default=M$});var Vh=O(Kc=>{"use strict";Object.defineProperty(Kc,"__esModule",{value:!0});var In=I(),j$={message:({schemaCode:e})=>(0,In.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,In._)`{multipleOf: ${e}}`},U$={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:j$,code(e){let{gen:t,data:r,schemaCode:n,it:o}=e,i=o.opts.multipleOfPrecision,a=t.let("res"),s=i?(0,In._)`Math.abs(Math.round(${a}) - ${a}) > 1e-${i}`:(0,In._)`${a} !== parseInt(${a})`;e.fail$data((0,In._)`(${n} === 0 || (${a} = ${r}/${n}, ${s}))`)}};Kc.default=U$});var Xh=O(Bc=>{"use strict";Object.defineProperty(Bc,"__esModule",{value:!0});function Wh(e){let t=e.length,r=0,n=0,o;for(;n<t;)r++,o=e.charCodeAt(n++),o>=55296&&o<=56319&&n<t&&(o=e.charCodeAt(n),(o&64512)===56320&&n++);return r}Bc.default=Wh;Wh.code='require("ajv/dist/runtime/ucs2length").default'});var Qh=O(Gc=>{"use strict";Object.defineProperty(Gc,"__esModule",{value:!0});var tr=I(),Z$=Y(),F$=Xh(),L$={message({keyword:e,schemaCode:t}){let r=e==="maxLength"?"more":"fewer";return(0,tr.str)`must NOT have ${r} than ${t} characters`},params:({schemaCode:e})=>(0,tr._)`{limit: ${e}}`},H$={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:L$,code(e){let{keyword:t,data:r,schemaCode:n,it:o}=e,i=t==="maxLength"?tr.operators.GT:tr.operators.LT,a=o.opts.unicode===!1?(0,tr._)`${r}.length`:(0,tr._)`${(0,Z$.useFunc)(e.gen,F$.default)}(${r})`;e.fail$data((0,tr._)`${a} ${i} ${n}`)}};Gc.default=H$});var ey=O(Jc=>{"use strict";Object.defineProperty(Jc,"__esModule",{value:!0});var Y$=Ye(),Ni=I(),K$={message:({schemaCode:e})=>(0,Ni.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,Ni._)`{pattern: ${e}}`},B$={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:K$,code(e){let{data:t,$data:r,schema:n,schemaCode:o,it:i}=e,a=i.opts.unicodeRegExp?"u":"",s=r?(0,Ni._)`(new RegExp(${o}, ${a}))`:(0,Y$.usePattern)(e,n);e.fail$data((0,Ni._)`!${s}.test(${t})`)}};Jc.default=B$});var ty=O(Vc=>{"use strict";Object.defineProperty(Vc,"__esModule",{value:!0});var Mn=I(),G$={message({keyword:e,schemaCode:t}){let r=e==="maxProperties"?"more":"fewer";return(0,Mn.str)`must NOT have ${r} than ${t} properties`},params:({schemaCode:e})=>(0,Mn._)`{limit: ${e}}`},J$={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:G$,code(e){let{keyword:t,data:r,schemaCode:n}=e,o=t==="maxProperties"?Mn.operators.GT:Mn.operators.LT;e.fail$data((0,Mn._)`Object.keys(${r}).length ${o} ${n}`)}};Vc.default=J$});var ry=O(Wc=>{"use strict";Object.defineProperty(Wc,"__esModule",{value:!0});var jn=Ye(),Un=I(),V$=Y(),W$={message:({params:{missingProperty:e}})=>(0,Un.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,Un._)`{missingProperty: ${e}}`},X$={keyword:"required",type:"object",schemaType:"array",$data:!0,error:W$,code(e){let{gen:t,schema:r,schemaCode:n,data:o,$data:i,it:a}=e,{opts:s}=a;if(!i&&r.length===0)return;let c=r.length>=s.loopRequired;if(a.allErrors?l():u(),s.strictRequired){let p=e.parentSchema.properties,{definedProperties:f}=e.it;for(let h of r)if(p?.[h]===void 0&&!f.has(h)){let y=a.schemaEnv.baseId+a.errSchemaPath,v=`required property "${h}" is not defined at "${y}" (strictRequired)`;(0,V$.checkStrictMode)(a,v,a.opts.strictRequired)}}function l(){if(c||i)e.block$data(Un.nil,d);else for(let p of r)(0,jn.checkReportMissingProp)(e,p)}function u(){let p=t.let("missing");if(c||i){let f=t.let("valid",!0);e.block$data(f,()=>m(p,f)),e.ok(f)}else t.if((0,jn.checkMissingProp)(e,r,p)),(0,jn.reportMissingProp)(e,p),t.else()}function d(){t.forOf("prop",n,p=>{e.setParams({missingProperty:p}),t.if((0,jn.noPropertyInData)(t,o,p,s.ownProperties),()=>e.error())})}function m(p,f){e.setParams({missingProperty:p}),t.forOf(p,n,()=>{t.assign(f,(0,jn.propertyInData)(t,o,p,s.ownProperties)),t.if((0,Un.not)(f),()=>{e.error(),t.break()})},Un.nil)}}};Wc.default=X$});var ny=O(Xc=>{"use strict";Object.defineProperty(Xc,"__esModule",{value:!0});var Zn=I(),Q$={message({keyword:e,schemaCode:t}){let r=e==="maxItems"?"more":"fewer";return(0,Zn.str)`must NOT have ${r} than ${t} items`},params:({schemaCode:e})=>(0,Zn._)`{limit: ${e}}`},eO={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:Q$,code(e){let{keyword:t,data:r,schemaCode:n}=e,o=t==="maxItems"?Zn.operators.GT:Zn.operators.LT;e.fail$data((0,Zn._)`${r}.length ${o} ${n}`)}};Xc.default=eO});var Ri=O(Qc=>{"use strict";Object.defineProperty(Qc,"__esModule",{value:!0});var oy=yc();oy.code='require("ajv/dist/runtime/equal").default';Qc.default=oy});var iy=O(tl=>{"use strict";Object.defineProperty(tl,"__esModule",{value:!0});var el=On(),be=I(),tO=Y(),rO=Ri(),nO={message:({params:{i:e,j:t}})=>(0,be.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>(0,be._)`{i: ${e}, j: ${t}}`},oO={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:nO,code(e){let{gen:t,data:r,$data:n,schema:o,parentSchema:i,schemaCode:a,it:s}=e;if(!n&&!o)return;let c=t.let("valid"),l=i.items?(0,el.getSchemaTypes)(i.items):[];e.block$data(c,u,(0,be._)`${a} === false`),e.ok(c);function u(){let f=t.let("i",(0,be._)`${r}.length`),h=t.let("j");e.setParams({i:f,j:h}),t.assign(c,!0),t.if((0,be._)`${f} > 1`,()=>(d()?m:p)(f,h))}function d(){return l.length>0&&!l.some(f=>f==="object"||f==="array")}function m(f,h){let y=t.name("item"),v=(0,el.checkDataTypes)(l,y,s.opts.strictNumbers,el.DataType.Wrong),w=t.const("indices",(0,be._)`{}`);t.for((0,be._)`;${f}--;`,()=>{t.let(y,(0,be._)`${r}[${f}]`),t.if(v,(0,be._)`continue`),l.length>1&&t.if((0,be._)`typeof ${y} == "string"`,(0,be._)`${y} += "_"`),t.if((0,be._)`typeof ${w}[${y}] == "number"`,()=>{t.assign(h,(0,be._)`${w}[${y}]`),e.error(),t.assign(c,!1).break()}).code((0,be._)`${w}[${y}] = ${f}`)})}function p(f,h){let y=(0,tO.useFunc)(t,rO.default),v=t.name("outer");t.label(v).for((0,be._)`;${f}--;`,()=>t.for((0,be._)`${h} = ${f}; ${h}--;`,()=>t.if((0,be._)`${y}(${r}[${f}], ${r}[${h}])`,()=>{e.error(),t.assign(c,!1).break(v)})))}}};tl.default=oO});var ay=O(nl=>{"use strict";Object.defineProperty(nl,"__esModule",{value:!0});var rl=I(),iO=Y(),aO=Ri(),sO={message:"must be equal to constant",params:({schemaCode:e})=>(0,rl._)`{allowedValue: ${e}}`},cO={keyword:"const",$data:!0,error:sO,code(e){let{gen:t,data:r,$data:n,schemaCode:o,schema:i}=e;n||i&&typeof i=="object"?e.fail$data((0,rl._)`!${(0,iO.useFunc)(t,aO.default)}(${r}, ${o})`):e.fail((0,rl._)`${i} !== ${r}`)}};nl.default=cO});var sy=O(ol=>{"use strict";Object.defineProperty(ol,"__esModule",{value:!0});var Fn=I(),lO=Y(),uO=Ri(),dO={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>(0,Fn._)`{allowedValues: ${e}}`},pO={keyword:"enum",schemaType:"array",$data:!0,error:dO,code(e){let{gen:t,data:r,$data:n,schema:o,schemaCode:i,it:a}=e;if(!n&&o.length===0)throw new Error("enum must have non-empty array");let s=o.length>=a.opts.loopEnum,c,l=()=>c??(c=(0,lO.useFunc)(t,uO.default)),u;if(s||n)u=t.let("valid"),e.block$data(u,d);else{if(!Array.isArray(o))throw new Error("ajv implementation error");let p=t.const("vSchema",i);u=(0,Fn.or)(...o.map((f,h)=>m(p,h)))}e.pass(u);function d(){t.assign(u,!1),t.forOf("v",i,p=>t.if((0,Fn._)`${l()}(${r}, ${p})`,()=>t.assign(u,!0).break()))}function m(p,f){let h=o[f];return typeof h=="object"&&h!==null?(0,Fn._)`${l()}(${r}, ${p}[${f}])`:(0,Fn._)`${r} === ${h}`}}};ol.default=pO});var cy=O(il=>{"use strict";Object.defineProperty(il,"__esModule",{value:!0});var mO=Jh(),fO=Vh(),_O=Qh(),hO=ey(),yO=ty(),gO=ry(),bO=ny(),vO=iy(),xO=ay(),wO=sy(),SO=[mO.default,fO.default,_O.default,hO.default,yO.default,gO.default,bO.default,vO.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},xO.default,wO.default];il.default=SO});var sl=O(Ln=>{"use strict";Object.defineProperty(Ln,"__esModule",{value:!0});Ln.validateAdditionalItems=void 0;var rr=I(),al=Y(),kO={message:({params:{len:e}})=>(0,rr.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,rr._)`{limit: ${e}}`},$O={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:kO,code(e){let{parentSchema:t,it:r}=e,{items:n}=t;if(!Array.isArray(n)){(0,al.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}ly(e,n)}};function ly(e,t){let{gen:r,schema:n,data:o,keyword:i,it:a}=e;a.items=!0;let s=r.const("len",(0,rr._)`${o}.length`);if(n===!1)e.setParams({len:t.length}),e.pass((0,rr._)`${s} <= ${t.length}`);else if(typeof n=="object"&&!(0,al.alwaysValidSchema)(a,n)){let l=r.var("valid",(0,rr._)`${s} <= ${t.length}`);r.if((0,rr.not)(l),()=>c(l)),e.ok(l)}function c(l){r.forRange("i",t.length,s,u=>{e.subschema({keyword:i,dataProp:u,dataPropType:al.Type.Num},l),a.allErrors||r.if((0,rr.not)(l),()=>r.break())})}}Ln.validateAdditionalItems=ly;Ln.default=$O});var cl=O(Hn=>{"use strict";Object.defineProperty(Hn,"__esModule",{value:!0});Hn.validateTuple=void 0;var uy=I(),Ti=Y(),OO=Ye(),PO={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:r}=e;if(Array.isArray(t))return dy(e,"additionalItems",t);r.items=!0,!(0,Ti.alwaysValidSchema)(r,t)&&e.ok((0,OO.validateArray)(e))}};function dy(e,t,r=e.schema){let{gen:n,parentSchema:o,data:i,keyword:a,it:s}=e;u(o),s.opts.unevaluated&&r.length&&s.items!==!0&&(s.items=Ti.mergeEvaluated.items(n,r.length,s.items));let c=n.name("valid"),l=n.const("len",(0,uy._)`${i}.length`);r.forEach((d,m)=>{(0,Ti.alwaysValidSchema)(s,d)||(n.if((0,uy._)`${l} > ${m}`,()=>e.subschema({keyword:a,schemaProp:m,dataProp:m},c)),e.ok(c))});function u(d){let{opts:m,errSchemaPath:p}=s,f=r.length,h=f===d.minItems&&(f===d.maxItems||d[t]===!1);if(m.strictTuples&&!h){let y=`"${a}" is ${f}-tuple, but minItems or maxItems/${t} are not specified or different at path "${p}"`;(0,Ti.checkStrictMode)(s,y,m.strictTuples)}}}Hn.validateTuple=dy;Hn.default=PO});var py=O(ll=>{"use strict";Object.defineProperty(ll,"__esModule",{value:!0});var zO=cl(),EO={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,zO.validateTuple)(e,"items")};ll.default=EO});var fy=O(ul=>{"use strict";Object.defineProperty(ul,"__esModule",{value:!0});var my=I(),DO=Y(),AO=Ye(),CO=sl(),qO={message:({params:{len:e}})=>(0,my.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,my._)`{limit: ${e}}`},NO={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:qO,code(e){let{schema:t,parentSchema:r,it:n}=e,{prefixItems:o}=r;n.items=!0,!(0,DO.alwaysValidSchema)(n,t)&&(o?(0,CO.validateAdditionalItems)(e,o):e.ok((0,AO.validateArray)(e)))}};ul.default=NO});var _y=O(dl=>{"use strict";Object.defineProperty(dl,"__esModule",{value:!0});var Be=I(),Ii=Y(),RO={message:({params:{min:e,max:t}})=>t===void 0?(0,Be.str)`must contain at least ${e} valid item(s)`:(0,Be.str)`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>t===void 0?(0,Be._)`{minContains: ${e}}`:(0,Be._)`{minContains: ${e}, maxContains: ${t}}`},TO={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:RO,code(e){let{gen:t,schema:r,parentSchema:n,data:o,it:i}=e,a,s,{minContains:c,maxContains:l}=n;i.opts.next?(a=c===void 0?1:c,s=l):a=1;let u=t.const("len",(0,Be._)`${o}.length`);if(e.setParams({min:a,max:s}),s===void 0&&a===0){(0,Ii.checkStrictMode)(i,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(s!==void 0&&a>s){(0,Ii.checkStrictMode)(i,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,Ii.alwaysValidSchema)(i,r)){let h=(0,Be._)`${u} >= ${a}`;s!==void 0&&(h=(0,Be._)`${h} && ${u} <= ${s}`),e.pass(h);return}i.items=!0;let d=t.name("valid");s===void 0&&a===1?p(d,()=>t.if(d,()=>t.break())):a===0?(t.let(d,!0),s!==void 0&&t.if((0,Be._)`${o}.length > 0`,m)):(t.let(d,!1),m()),e.result(d,()=>e.reset());function m(){let h=t.name("_valid"),y=t.let("count",0);p(h,()=>t.if(h,()=>f(y)))}function p(h,y){t.forRange("i",0,u,v=>{e.subschema({keyword:"contains",dataProp:v,dataPropType:Ii.Type.Num,compositeRule:!0},h),y()})}function f(h){t.code((0,Be._)`${h}++`),s===void 0?t.if((0,Be._)`${h} >= ${a}`,()=>t.assign(d,!0).break()):(t.if((0,Be._)`${h} > ${s}`,()=>t.assign(d,!1).break()),a===1?t.assign(d,!0):t.if((0,Be._)`${h} >= ${a}`,()=>t.assign(d,!0)))}}};dl.default=TO});var gy=O(at=>{"use strict";Object.defineProperty(at,"__esModule",{value:!0});at.validateSchemaDeps=at.validatePropertyDeps=at.error=void 0;var pl=I(),IO=Y(),Yn=Ye();at.error={message:({params:{property:e,depsCount:t,deps:r}})=>{let n=t===1?"property":"properties";return(0,pl.str)`must have ${n} ${r} when property ${e} is present`},params:({params:{property:e,depsCount:t,deps:r,missingProperty:n}})=>(0,pl._)`{property: ${e},
missingProperty: ${n},
depsCount: ${t},
deps: ${r}}`};var MO={keyword:"dependencies",type:"object",schemaType:"object",error:at.error,code(e){let[t,r]=jO(e);hy(e,t),yy(e,r)}};function jO({schema:e}){let t={},r={};for(let n in e){if(n==="__proto__")continue;let o=Array.isArray(e[n])?t:r;o[n]=e[n]}return[t,r]}function hy(e,t=e.schema){let{gen:r,data:n,it:o}=e;if(Object.keys(t).length===0)return;let i=r.let("missing");for(let a in t){let s=t[a];if(s.length===0)continue;let c=(0,Yn.propertyInData)(r,n,a,o.opts.ownProperties);e.setParams({property:a,depsCount:s.length,deps:s.join(", ")}),o.allErrors?r.if(c,()=>{for(let l of s)(0,Yn.checkReportMissingProp)(e,l)}):(r.if((0,pl._)`${c} && (${(0,Yn.checkMissingProp)(e,s,i)})`),(0,Yn.reportMissingProp)(e,i),r.else())}}at.validatePropertyDeps=hy;function yy(e,t=e.schema){let{gen:r,data:n,keyword:o,it:i}=e,a=r.name("valid");for(let s in t)(0,IO.alwaysValidSchema)(i,t[s])||(r.if((0,Yn.propertyInData)(r,n,s,i.opts.ownProperties),()=>{let c=e.subschema({keyword:o,schemaProp:s},a);e.mergeValidEvaluated(c,a)},()=>r.var(a,!0)),e.ok(a))}at.validateSchemaDeps=yy;at.default=MO});var vy=O(ml=>{"use strict";Object.defineProperty(ml,"__esModule",{value:!0});var by=I(),UO=Y(),ZO={message:"property name must be valid",params:({params:e})=>(0,by._)`{propertyName: ${e.propertyName}}`},FO={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:ZO,code(e){let{gen:t,schema:r,data:n,it:o}=e;if((0,UO.alwaysValidSchema)(o,r))return;let i=t.name("valid");t.forIn("key",n,a=>{e.setParams({propertyName:a}),e.subschema({keyword:"propertyNames",data:a,dataTypes:["string"],propertyName:a,compositeRule:!0},i),t.if((0,by.not)(i),()=>{e.error(!0),o.allErrors||t.break()})}),e.ok(i)}};ml.default=FO});var _l=O(fl=>{"use strict";Object.defineProperty(fl,"__esModule",{value:!0});var Mi=Ye(),rt=I(),LO=gt(),ji=Y(),HO={message:"must NOT have additional properties",params:({params:e})=>(0,rt._)`{additionalProperty: ${e.additionalProperty}}`},YO={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:HO,code(e){let{gen:t,schema:r,parentSchema:n,data:o,errsCount:i,it:a}=e;if(!i)throw new Error("ajv implementation error");let{allErrors:s,opts:c}=a;if(a.props=!0,c.removeAdditional!=="all"&&(0,ji.alwaysValidSchema)(a,r))return;let l=(0,Mi.allSchemaProperties)(n.properties),u=(0,Mi.allSchemaProperties)(n.patternProperties);d(),e.ok((0,rt._)`${i} === ${LO.default.errors}`);function d(){t.forIn("key",o,y=>{!l.length&&!u.length?f(y):t.if(m(y),()=>f(y))})}function m(y){let v;if(l.length>8){let w=(0,ji.schemaRefOrVal)(a,n.properties,"properties");v=(0,Mi.isOwnProperty)(t,w,y)}else l.length?v=(0,rt.or)(...l.map(w=>(0,rt._)`${y} === ${w}`)):v=rt.nil;return u.length&&(v=(0,rt.or)(v,...u.map(w=>(0,rt._)`${(0,Mi.usePattern)(e,w)}.test(${y})`))),(0,rt.not)(v)}function p(y){t.code((0,rt._)`delete ${o}[${y}]`)}function f(y){if(c.removeAdditional==="all"||c.removeAdditional&&r===!1){p(y);return}if(r===!1){e.setParams({additionalProperty:y}),e.error(),s||t.break();return}if(typeof r=="object"&&!(0,ji.alwaysValidSchema)(a,r)){let v=t.name("valid");c.removeAdditional==="failing"?(h(y,v,!1),t.if((0,rt.not)(v),()=>{e.reset(),p(y)})):(h(y,v),s||t.if((0,rt.not)(v),()=>t.break()))}}function h(y,v,w){let S={keyword:"additionalProperties",dataProp:y,dataPropType:ji.Type.Str};w===!1&&Object.assign(S,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(S,v)}}};fl.default=YO});var Sy=O(yl=>{"use strict";Object.defineProperty(yl,"__esModule",{value:!0});var KO=Dn(),xy=Ye(),hl=Y(),wy=_l(),BO={keyword:"properties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,parentSchema:n,data:o,it:i}=e;i.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&wy.default.code(new KO.KeywordCxt(i,wy.default,"additionalProperties"));let a=(0,xy.allSchemaProperties)(r);for(let d of a)i.definedProperties.add(d);i.opts.unevaluated&&a.length&&i.props!==!0&&(i.props=hl.mergeEvaluated.props(t,(0,hl.toHash)(a),i.props));let s=a.filter(d=>!(0,hl.alwaysValidSchema)(i,r[d]));if(s.length===0)return;let c=t.name("valid");for(let d of s)l(d)?u(d):(t.if((0,xy.propertyInData)(t,o,d,i.opts.ownProperties)),u(d),i.allErrors||t.else().var(c,!0),t.endIf()),e.it.definedProperties.add(d),e.ok(c);function l(d){return i.opts.useDefaults&&!i.compositeRule&&r[d].default!==void 0}function u(d){e.subschema({keyword:"properties",schemaProp:d,dataProp:d},c)}}};yl.default=BO});var Py=O(gl=>{"use strict";Object.defineProperty(gl,"__esModule",{value:!0});var ky=Ye(),Ui=I(),$y=Y(),Oy=Y(),GO={keyword:"patternProperties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,data:n,parentSchema:o,it:i}=e,{opts:a}=i,s=(0,ky.allSchemaProperties)(r),c=s.filter(h=>(0,$y.alwaysValidSchema)(i,r[h]));if(s.length===0||c.length===s.length&&(!i.opts.unevaluated||i.props===!0))return;let l=a.strictSchema&&!a.allowMatchingProperties&&o.properties,u=t.name("valid");i.props!==!0&&!(i.props instanceof Ui.Name)&&(i.props=(0,Oy.evaluatedPropsToName)(t,i.props));let{props:d}=i;m();function m(){for(let h of s)l&&p(h),i.allErrors?f(h):(t.var(u,!0),f(h),t.if(u))}function p(h){for(let y in l)new RegExp(h).test(y)&&(0,$y.checkStrictMode)(i,`property ${y} matches pattern ${h} (use allowMatchingProperties)`)}function f(h){t.forIn("key",n,y=>{t.if((0,Ui._)`${(0,ky.usePattern)(e,h)}.test(${y})`,()=>{let v=c.includes(h);v||e.subschema({keyword:"patternProperties",schemaProp:h,dataProp:y,dataPropType:Oy.Type.Str},u),i.opts.unevaluated&&d!==!0?t.assign((0,Ui._)`${d}[${y}]`,!0):!v&&!i.allErrors&&t.if((0,Ui.not)(u),()=>t.break())})})}}};gl.default=GO});var zy=O(bl=>{"use strict";Object.defineProperty(bl,"__esModule",{value:!0});var JO=Y(),VO={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){let{gen:t,schema:r,it:n}=e;if((0,JO.alwaysValidSchema)(n,r)){e.fail();return}let o=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},o),e.failResult(o,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};bl.default=VO});var Ey=O(vl=>{"use strict";Object.defineProperty(vl,"__esModule",{value:!0});var WO=Ye(),XO={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:WO.validateUnion,error:{message:"must match a schema in anyOf"}};vl.default=XO});var Dy=O(xl=>{"use strict";Object.defineProperty(xl,"__esModule",{value:!0});var Zi=I(),QO=Y(),eP={message:"must match exactly one schema in oneOf",params:({params:e})=>(0,Zi._)`{passingSchemas: ${e.passing}}`},tP={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:eP,code(e){let{gen:t,schema:r,parentSchema:n,it:o}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(o.opts.discriminator&&n.discriminator)return;let i=r,a=t.let("valid",!1),s=t.let("passing",null),c=t.name("_valid");e.setParams({passing:s}),t.block(l),e.result(a,()=>e.reset(),()=>e.error(!0));function l(){i.forEach((u,d)=>{let m;(0,QO.alwaysValidSchema)(o,u)?t.var(c,!0):m=e.subschema({keyword:"oneOf",schemaProp:d,compositeRule:!0},c),d>0&&t.if((0,Zi._)`${c} && ${a}`).assign(a,!1).assign(s,(0,Zi._)`[${s}, ${d}]`).else(),t.if(c,()=>{t.assign(a,!0),t.assign(s,d),m&&e.mergeEvaluated(m,Zi.Name)})})}}};xl.default=tP});var Ay=O(wl=>{"use strict";Object.defineProperty(wl,"__esModule",{value:!0});var rP=Y(),nP={keyword:"allOf",schemaType:"array",code(e){let{gen:t,schema:r,it:n}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");let o=t.name("valid");r.forEach((i,a)=>{if((0,rP.alwaysValidSchema)(n,i))return;let s=e.subschema({keyword:"allOf",schemaProp:a},o);e.ok(o),e.mergeEvaluated(s)})}};wl.default=nP});var Ny=O(Sl=>{"use strict";Object.defineProperty(Sl,"__esModule",{value:!0});var Fi=I(),qy=Y(),oP={message:({params:e})=>(0,Fi.str)`must match "${e.ifClause}" schema`,params:({params:e})=>(0,Fi._)`{failingKeyword: ${e.ifClause}}`},iP={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:oP,code(e){let{gen:t,parentSchema:r,it:n}=e;r.then===void 0&&r.else===void 0&&(0,qy.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let o=Cy(n,"then"),i=Cy(n,"else");if(!o&&!i)return;let a=t.let("valid",!0),s=t.name("_valid");if(c(),e.reset(),o&&i){let u=t.let("ifClause");e.setParams({ifClause:u}),t.if(s,l("then",u),l("else",u))}else o?t.if(s,l("then")):t.if((0,Fi.not)(s),l("else"));e.pass(a,()=>e.error(!0));function c(){let u=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},s);e.mergeEvaluated(u)}function l(u,d){return()=>{let m=e.subschema({keyword:u},s);t.assign(a,s),e.mergeValidEvaluated(m,a),d?t.assign(d,(0,Fi._)`${u}`):e.setParams({ifClause:u})}}}};function Cy(e,t){let r=e.schema[t];return r!==void 0&&!(0,qy.alwaysValidSchema)(e,r)}Sl.default=iP});var Ry=O(kl=>{"use strict";Object.defineProperty(kl,"__esModule",{value:!0});var aP=Y(),sP={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){t.if===void 0&&(0,aP.checkStrictMode)(r,`"${e}" without "if" is ignored`)}};kl.default=sP});var Ty=O($l=>{"use strict";Object.defineProperty($l,"__esModule",{value:!0});var cP=sl(),lP=py(),uP=cl(),dP=fy(),pP=_y(),mP=gy(),fP=vy(),_P=_l(),hP=Sy(),yP=Py(),gP=zy(),bP=Ey(),vP=Dy(),xP=Ay(),wP=Ny(),SP=Ry();function kP(e=!1){let t=[gP.default,bP.default,vP.default,xP.default,wP.default,SP.default,fP.default,_P.default,mP.default,hP.default,yP.default];return e?t.push(lP.default,dP.default):t.push(cP.default,uP.default),t.push(pP.default),t}$l.default=kP});var Iy=O(Ol=>{"use strict";Object.defineProperty(Ol,"__esModule",{value:!0});var ce=I(),$P={message:({schemaCode:e})=>(0,ce.str)`must match format "${e}"`,params:({schemaCode:e})=>(0,ce._)`{format: ${e}}`},OP={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:$P,code(e,t){let{gen:r,data:n,$data:o,schema:i,schemaCode:a,it:s}=e,{opts:c,errSchemaPath:l,schemaEnv:u,self:d}=s;if(!c.validateFormats)return;o?m():p();function m(){let f=r.scopeValue("formats",{ref:d.formats,code:c.code.formats}),h=r.const("fDef",(0,ce._)`${f}[${a}]`),y=r.let("fType"),v=r.let("format");r.if((0,ce._)`typeof ${h} == "object" && !(${h} instanceof RegExp)`,()=>r.assign(y,(0,ce._)`${h}.type || "string"`).assign(v,(0,ce._)`${h}.validate`),()=>r.assign(y,(0,ce._)`"string"`).assign(v,h)),e.fail$data((0,ce.or)(w(),S()));function w(){return c.strictSchema===!1?ce.nil:(0,ce._)`${a} && !${v}`}function S(){let q=u.$async?(0,ce._)`(${h}.async ? await ${v}(${n}) : ${v}(${n}))`:(0,ce._)`${v}(${n})`,b=(0,ce._)`(typeof ${v} == "function" ? ${q} : ${v}.test(${n}))`;return(0,ce._)`${v} && ${v} !== true && ${y} === ${t} && !${b}`}}function p(){let f=d.formats[i];if(!f){w();return}if(f===!0)return;let[h,y,v]=S(f);h===t&&e.pass(q());function w(){if(c.strictSchema===!1){d.logger.warn(b());return}throw new Error(b());function b(){return`unknown format "${i}" ignored in schema at path "${l}"`}}function S(b){let x=b instanceof RegExp?(0,ce.regexpCode)(b):c.code.formats?(0,ce._)`${c.code.formats}${(0,ce.getProperty)(i)}`:void 0,D=r.scopeValue("formats",{key:i,ref:b,code:x});return typeof b=="object"&&!(b instanceof RegExp)?[b.type||"string",b.validate,(0,ce._)`${D}.validate`]:["string",b,D]}function q(){if(typeof f=="object"&&!(f instanceof RegExp)&&f.async){if(!u.$async)throw new Error("async format in sync schema");return(0,ce._)`await ${v}(${n})`}return typeof y=="function"?(0,ce._)`${v}(${n})`:(0,ce._)`${v}.test(${n})`}}}};Ol.default=OP});var My=O(Pl=>{"use strict";Object.defineProperty(Pl,"__esModule",{value:!0});var PP=Iy(),zP=[PP.default];Pl.default=zP});var jy=O(Mr=>{"use strict";Object.defineProperty(Mr,"__esModule",{value:!0});Mr.contentVocabulary=Mr.metadataVocabulary=void 0;Mr.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Mr.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var Zy=O(zl=>{"use strict";Object.defineProperty(zl,"__esModule",{value:!0});var EP=Gh(),DP=cy(),AP=Ty(),CP=My(),Uy=jy(),qP=[EP.default,DP.default,(0,AP.default)(),CP.default,Uy.metadataVocabulary,Uy.contentVocabulary];zl.default=qP});var Ly=O(Li=>{"use strict";Object.defineProperty(Li,"__esModule",{value:!0});Li.DiscrError=void 0;var Fy;(function(e){e.Tag="tag",e.Mapping="mapping"})(Fy||(Li.DiscrError=Fy={}))});var Yy=O(Dl=>{"use strict";Object.defineProperty(Dl,"__esModule",{value:!0});var jr=I(),El=Ly(),Hy=Si(),NP=An(),RP=Y(),TP={message:({params:{discrError:e,tagName:t}})=>e===El.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>(0,jr._)`{error: ${e}, tag: ${r}, tagValue: ${t}}`},IP={keyword:"discriminator",type:"object",schemaType:"object",error:TP,code(e){let{gen:t,data:r,schema:n,parentSchema:o,it:i}=e,{oneOf:a}=o;if(!i.opts.discriminator)throw new Error("discriminator: requires discriminator option");let s=n.propertyName;if(typeof s!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!a)throw new Error("discriminator: requires oneOf keyword");let c=t.let("valid",!1),l=t.const("tag",(0,jr._)`${r}${(0,jr.getProperty)(s)}`);t.if((0,jr._)`typeof ${l} == "string"`,()=>u(),()=>e.error(!1,{discrError:El.DiscrError.Tag,tag:l,tagName:s})),e.ok(c);function u(){let p=m();t.if(!1);for(let f in p)t.elseIf((0,jr._)`${l} === ${f}`),t.assign(c,d(p[f]));t.else(),e.error(!1,{discrError:El.DiscrError.Mapping,tag:l,tagName:s}),t.endIf()}function d(p){let f=t.name("valid"),h=e.subschema({keyword:"oneOf",schemaProp:p},f);return e.mergeEvaluated(h,jr.Name),f}function m(){var p;let f={},h=v(o),y=!0;for(let q=0;q<a.length;q++){let b=a[q];if(b?.$ref&&!(0,RP.schemaHasRulesButRef)(b,i.self.RULES)){let D=b.$ref;if(b=Hy.resolveRef.call(i.self,i.schemaEnv.root,i.baseId,D),b instanceof Hy.SchemaEnv&&(b=b.schema),b===void 0)throw new NP.default(i.opts.uriResolver,i.baseId,D)}let x=(p=b?.properties)===null||p===void 0?void 0:p[s];if(typeof x!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${s}"`);y=y&&(h||v(b)),w(x,q)}if(!y)throw new Error(`discriminator: "${s}" must be required`);return f;function v({required:q}){return Array.isArray(q)&&q.includes(s)}function w(q,b){if(q.const)S(q.const,b);else if(q.enum)for(let x of q.enum)S(x,b);else throw new Error(`discriminator: "properties/${s}" must have "const" or "enum"`)}function S(q,b){if(typeof q!="string"||q in f)throw new Error(`discriminator: "${s}" values must be unique strings`);f[q]=b}}}};Dl.default=IP});var Ky=O((HR,MP)=>{MP.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 Yi=O((re,Al)=>{"use strict";Object.defineProperty(re,"__esModule",{value:!0});re.MissingRefError=re.ValidationError=re.CodeGen=re.Name=re.nil=re.stringify=re.str=re._=re.KeywordCxt=re.Ajv=void 0;var jP=Fh(),UP=Zy(),ZP=Yy(),By=Ky(),FP=["/properties"],Hi="http://json-schema.org/draft-07/schema",Ur=class extends jP.default{_addVocabularies(){super._addVocabularies(),UP.default.forEach(t=>this.addVocabulary(t)),this.opts.discriminator&&this.addKeyword(ZP.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let t=this.opts.$data?this.$dataMetaSchema(By,FP):By;this.addMetaSchema(t,Hi,!1),this.refs["http://json-schema.org/schema"]=Hi}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(Hi)?Hi:void 0)}};re.Ajv=Ur;Al.exports=re=Ur;Al.exports.Ajv=Ur;Object.defineProperty(re,"__esModule",{value:!0});re.default=Ur;var LP=Dn();Object.defineProperty(re,"KeywordCxt",{enumerable:!0,get:function(){return LP.KeywordCxt}});var Zr=I();Object.defineProperty(re,"_",{enumerable:!0,get:function(){return Zr._}});Object.defineProperty(re,"str",{enumerable:!0,get:function(){return Zr.str}});Object.defineProperty(re,"stringify",{enumerable:!0,get:function(){return Zr.stringify}});Object.defineProperty(re,"nil",{enumerable:!0,get:function(){return Zr.nil}});Object.defineProperty(re,"Name",{enumerable:!0,get:function(){return Zr.Name}});Object.defineProperty(re,"CodeGen",{enumerable:!0,get:function(){return Zr.CodeGen}});var HP=xi();Object.defineProperty(re,"ValidationError",{enumerable:!0,get:function(){return HP.default}});var YP=An();Object.defineProperty(re,"MissingRefError",{enumerable:!0,get:function(){return YP.default}})});var tg=O(ct=>{"use strict";Object.defineProperty(ct,"__esModule",{value:!0});ct.formatNames=ct.fastFormats=ct.fullFormats=void 0;function st(e,t){return{validate:e,compare:t}}ct.fullFormats={date:st(Wy,Rl),time:st(ql(!0),Tl),"date-time":st(Gy(!0),Qy),"iso-time":st(ql(),Xy),"iso-date-time":st(Gy(),eg),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:WP,"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:oz,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:XP,int32:{type:"number",validate:tz},int64:{type:"number",validate:rz},float:{type:"number",validate:Vy},double:{type:"number",validate:Vy},password:!0,binary:!0};ct.fastFormats={...ct.fullFormats,date:st(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,Rl),time:st(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,Tl),"date-time":st(/^\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,Qy),"iso-time":st(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,Xy),"iso-date-time":st(/^\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,eg),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};ct.formatNames=Object.keys(ct.fullFormats);function KP(e){return e%4===0&&(e%100!==0||e%400===0)}var BP=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,GP=[0,31,28,31,30,31,30,31,31,30,31,30,31];function Wy(e){let t=BP.exec(e);if(!t)return!1;let r=+t[1],n=+t[2],o=+t[3];return n>=1&&n<=12&&o>=1&&o<=(n===2&&KP(r)?29:GP[n])}function Rl(e,t){if(e&&t)return e>t?1:e<t?-1:0}var Cl=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function ql(e){return function(r){let n=Cl.exec(r);if(!n)return!1;let o=+n[1],i=+n[2],a=+n[3],s=n[4],c=n[5]==="-"?-1:1,l=+(n[6]||0),u=+(n[7]||0);if(l>23||u>59||e&&!s)return!1;if(o<=23&&i<=59&&a<60)return!0;let d=i-u*c,m=o-l*c-(d<0?1:0);return(m===23||m===-1)&&(d===59||d===-1)&&a<61}}function Tl(e,t){if(!(e&&t))return;let r=new Date("2020-01-01T"+e).valueOf(),n=new Date("2020-01-01T"+t).valueOf();if(r&&n)return r-n}function Xy(e,t){if(!(e&&t))return;let r=Cl.exec(e),n=Cl.exec(t);if(r&&n)return e=r[1]+r[2]+r[3],t=n[1]+n[2]+n[3],e>t?1:e<t?-1:0}var Nl=/t|\s/i;function Gy(e){let t=ql(e);return function(n){let o=n.split(Nl);return o.length===2&&Wy(o[0])&&t(o[1])}}function Qy(e,t){if(!(e&&t))return;let r=new Date(e).valueOf(),n=new Date(t).valueOf();if(r&&n)return r-n}function eg(e,t){if(!(e&&t))return;let[r,n]=e.split(Nl),[o,i]=t.split(Nl),a=Rl(r,o);if(a!==void 0)return a||Tl(n,i)}var JP=/\/|:/,VP=/^(?:[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 WP(e){return JP.test(e)&&VP.test(e)}var Jy=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function XP(e){return Jy.lastIndex=0,Jy.test(e)}var QP=-(2**31),ez=2**31-1;function tz(e){return Number.isInteger(e)&&e<=ez&&e>=QP}function rz(e){return Number.isInteger(e)}function Vy(){return!0}var nz=/[^\\]\\Z/;function oz(e){if(nz.test(e))return!1;try{return new RegExp(e),!0}catch{return!1}}});var rg=O(Fr=>{"use strict";Object.defineProperty(Fr,"__esModule",{value:!0});Fr.formatLimitDefinition=void 0;var iz=Yi(),nt=I(),Mt=nt.operators,Ki={formatMaximum:{okStr:"<=",ok:Mt.LTE,fail:Mt.GT},formatMinimum:{okStr:">=",ok:Mt.GTE,fail:Mt.LT},formatExclusiveMaximum:{okStr:"<",ok:Mt.LT,fail:Mt.GTE},formatExclusiveMinimum:{okStr:">",ok:Mt.GT,fail:Mt.LTE}},az={message:({keyword:e,schemaCode:t})=>(0,nt.str)`should be ${Ki[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,nt._)`{comparison: ${Ki[e].okStr}, limit: ${t}}`};Fr.formatLimitDefinition={keyword:Object.keys(Ki),type:"string",schemaType:"string",$data:!0,error:az,code(e){let{gen:t,data:r,schemaCode:n,keyword:o,it:i}=e,{opts:a,self:s}=i;if(!a.validateFormats)return;let c=new iz.KeywordCxt(i,s.RULES.all.format.definition,"format");c.$data?l():u();function l(){let m=t.scopeValue("formats",{ref:s.formats,code:a.code.formats}),p=t.const("fmt",(0,nt._)`${m}[${c.schemaCode}]`);e.fail$data((0,nt.or)((0,nt._)`typeof ${p} != "object"`,(0,nt._)`${p} instanceof RegExp`,(0,nt._)`typeof ${p}.compare != "function"`,d(p)))}function u(){let m=c.schema,p=s.formats[m];if(!p||p===!0)return;if(typeof p!="object"||p instanceof RegExp||typeof p.compare!="function")throw new Error(`"${o}": format "${m}" does not define "compare" function`);let f=t.scopeValue("formats",{key:m,ref:p,code:a.code.formats?(0,nt._)`${a.code.formats}${(0,nt.getProperty)(m)}`:void 0});e.fail$data(d(f))}function d(m){return(0,nt._)`${m}.compare(${r}, ${n}) ${Ki[o].fail} 0`}},dependencies:["format"]};var sz=e=>(e.addKeyword(Fr.formatLimitDefinition),e);Fr.default=sz});var ag=O((Kn,ig)=>{"use strict";Object.defineProperty(Kn,"__esModule",{value:!0});var Lr=tg(),cz=rg(),Il=I(),ng=new Il.Name("fullFormats"),lz=new Il.Name("fastFormats"),Ml=(e,t={keywords:!0})=>{if(Array.isArray(t))return og(e,t,Lr.fullFormats,ng),e;let[r,n]=t.mode==="fast"?[Lr.fastFormats,lz]:[Lr.fullFormats,ng],o=t.formats||Lr.formatNames;return og(e,o,r,n),t.keywords&&(0,cz.default)(e),e};Ml.get=(e,t="full")=>{let n=(t==="fast"?Lr.fastFormats:Lr.fullFormats)[e];if(!n)throw new Error(`Unknown format "${e}"`);return n};function og(e,t,r,n){var o,i;(o=(i=e.opts.code).formats)!==null&&o!==void 0||(i.formats=(0,Il._)`require("ajv-formats/dist/formats").${n}`);for(let a of t)e.addFormat(a,r[a])}ig.exports=Kn=Ml;Object.defineProperty(Kn,"__esModule",{value:!0});Kn.default=Ml});var fg=O(jl=>{"use strict";var dg=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,pz=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,pg=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,mz=/\\([\u000b\u0020-\u00ff])/g,fz=/([\\"])/g,mg=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;jl.format=_z;jl.parse=hz;function _z(e){if(!e||typeof e!="object")throw new TypeError("argument obj is required");var t=e.parameters,r=e.type;if(!r||!mg.test(r))throw new TypeError("invalid type");var n=r;if(t&&typeof t=="object")for(var o,i=Object.keys(t).sort(),a=0;a<i.length;a++){if(o=i[a],!pg.test(o))throw new TypeError("invalid parameter name");n+="; "+o+"="+gz(t[o])}return n}function hz(e){if(!e)throw new TypeError("argument string is required");var t=typeof e=="object"?yz(e):e;if(typeof t!="string")throw new TypeError("argument string is required to be a string");var r=t.indexOf(";"),n=r!==-1?t.slice(0,r).trim():t.trim();if(!mg.test(n))throw new TypeError("invalid media type");var o=new bz(n.toLowerCase());if(r!==-1){var i,a,s;for(dg.lastIndex=r;a=dg.exec(t);){if(a.index!==r)throw new TypeError("invalid parameter format");r+=a[0].length,i=a[1].toLowerCase(),s=a[2],s.charCodeAt(0)===34&&(s=s.slice(1,-1),s.indexOf("\\")!==-1&&(s=s.replace(mz,"$1"))),o.parameters[i]=s}if(r!==t.length)throw new TypeError("invalid parameter format")}return o}function yz(e){var t;if(typeof e.getHeader=="function"?t=e.getHeader("content-type"):typeof e.headers=="object"&&(t=e.headers&&e.headers["content-type"]),typeof t!="string")throw new TypeError("content-type header is missing from object");return t}function gz(e){var t=String(e);if(pg.test(t))return t;if(t.length>0&&!pz.test(t))throw new TypeError("invalid parameter value");return'"'+t.replace(fz,"\\$1")+'"'}function bz(e){this.parameters=Object.create(null),this.type=e}});var r1={};co(r1,{parameters:()=>Vg,runtime:()=>t1});module.exports=rb(r1);var C={};co(C,{BIGINT_FORMAT_RANGES:()=>mo,CONSTANT_CATCH:()=>pu,Class:()=>aa,NUMBER_FORMAT_RANGES:()=>Kr,aborted:()=>Ge,allowsEval:()=>da,assert:()=>sb,assertEqual:()=>nb,assertIs:()=>ib,assertNever:()=>ab,assertNotEqual:()=>ob,assignProp:()=>Ie,attachSchema:()=>_o,base64ToUint8Array:()=>uu,base64urlToUint8Array:()=>Ob,cached:()=>mr,captureStackTrace:()=>uo,cleanEnum:()=>$b,cleanRegex:()=>Yr,clone:()=>Ze,cloneDef:()=>ub,codePointLength:()=>Br,constantCatch:()=>mu,createTransparentProxy:()=>hb,defineLazy:()=>nu,defineLazyInternal:()=>F,derived:()=>Db,esc:()=>la,escapeRegex:()=>dt,explicitlyAborted:()=>fa,extend:()=>bb,finalizeIssue:()=>Je,floatSafeRemainder:()=>ca,getElementAtPath:()=>db,getEnumValues:()=>dr,getLengthableOrigin:()=>Gr,getParsedType:()=>_b,getSizableOrigin:()=>lu,hexToUint8Array:()=>zb,hide:()=>ya,installLazyProp:()=>qb,isObject:()=>Zt,isPlainObject:()=>Ot,issue:()=>_r,joinValues:()=>lo,jsonStringifyReplacer:()=>pr,members:()=>ha,merge:()=>xb,mergeDefs:()=>ut,normalizeParams:()=>E,nullish:()=>sa,numKeys:()=>fb,objectClone:()=>cb,omit:()=>gb,optionalKeys:()=>ma,own:()=>$t,parsedType:()=>_a,partial:()=>wb,pick:()=>yb,prefixIssues:()=>pt,primitiveTypes:()=>su,promiseAllObject:()=>pb,propertyKeyTypes:()=>pa,randomString:()=>mb,rawShape:()=>fr,required:()=>Sb,safeExtend:()=>vb,shallowClone:()=>au,slugify:()=>ua,stringifyPrimitive:()=>po,toZod:()=>ru,uint8ArrayToBase64:()=>du,uint8ArrayToBase64url:()=>Pb,uint8ArrayToHex:()=>Eb,unwrapMessage:()=>ur});function nb(e){return e}function ob(e){return e}function ru(){return e=>e}function ib(e){}function ab(e){throw new Error("Unexpected value in exhaustive check")}function sb(e){}function dr(e){let t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,o])=>t.indexOf(+n)===-1).map(([n,o])=>o)}function lo(e,t="|"){return e.map(r=>po(r)).join(t)}function pr(e,t){return typeof t=="bigint"?t.toString():t}var ia=class{constructor(t){this._getter=t,this._value=void 0}get value(){let t=this._getter;return t!==void 0&&(this._value=t(),this._getter=void 0),this._value}};function mr(e){return new ia(e)}function sa(e){return e==null}function Yr(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function ca(e,t){let r=e/t,n=Math.round(r),o=4*Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-n)<o?0:r-n}var eu=Symbol("evaluating");function nu(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==eu)return n===void 0&&(n=eu,n=r()),n},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function cb(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Ie(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function fr(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function lt(e){return fr(e._zod.def)??e._zod.def.shape}function ou(e,t,r){Object.defineProperty(e,t,{get(){let n=r();return Ie(this,t,n),n},enumerable:!0,configurable:!0})}function iu(e,t,r){t in e?Ie(e,t,r):e[t]=r}function Ut(e,t,r,n){let o=lt(t);for(let i of r){let a=Object.getOwnPropertyDescriptor(o,i);a.enumerable&&(a.get?ou(e,i,()=>{let s=t._zod.def.shape[i];return n?n(s,i):s}):iu(e,i,n?n(a.value,i):a.value))}}function lb(e,t){for(let r of Reflect.ownKeys(t)){let n=Object.getOwnPropertyDescriptor(t,r);n.enumerable&&(n.get?ou(e,r,()=>t[r]):iu(e,r,n.value))}}function ut(...e){let t={};for(let r of e){let n=Object.getOwnPropertyDescriptors(r);Object.assign(t,n)}return Object.defineProperties({},t)}function ub(e){return ut(e._zod.def)}function db(e,t){return t?t.reduce((r,n)=>r?.[n],e):e}function pb(e){let t=Object.keys(e),r=t.map(n=>e[n]);return Promise.all(r).then(n=>{let o={};for(let i=0;i<t.length;i++)o[t[i]]=n[i];return o})}function mb(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let n=0;n<e;n++)r+=t[Math.floor(Math.random()*t.length)];return r}function la(e){return JSON.stringify(e)}function ua(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var uo="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Zt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var da=mr(()=>{if(Ee.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Ot(e){if(Zt(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(Zt(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function au(e){return Ot(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function fb(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}var _b=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},pa=new Set(["string","number","symbol"]),su=new Set(["string","number","bigint","boolean","symbol","undefined"]);function dt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ze(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}function E(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function hb(e){let t;return new Proxy({},{get(r,n,o){return t??(t=e()),Reflect.get(t,n,o)},set(r,n,o,i){return t??(t=e()),Reflect.set(t,n,o,i)},has(r,n){return t??(t=e()),Reflect.has(t,n)},deleteProperty(r,n){return t??(t=e()),Reflect.deleteProperty(t,n)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,n){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,n)},defineProperty(r,n,o){return t??(t=e()),Reflect.defineProperty(t,n,o)}})}function po(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function ma(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}var Kr={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]},mo={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function yb(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let i={};return Ut(i,e,fo(e,t)),Ze(e,ut(r,{shape:i,checks:[]}))}function fo(e,t){let r=lt(e),n=[];for(let o of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(r,o)?.enumerable)throw new Error(`Unrecognized key: "${String(o)}"`);t[o]&&n.push(o)}return n}function gb(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let i=new Set(fo(e,t)),a={};return Ut(a,e,Reflect.ownKeys(lt(e)).filter(s=>!i.has(s))),Ze(e,ut(r,{shape:a,checks:[]}))}function bb(e,t){if(!Ot(t))throw new Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let o=lt(e);for(let i of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(o,i)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return Ze(e,ut(e._zod.def,{shape:cu(e,t)}))}function cu(e,t){let r={};return Ut(r,e,Reflect.ownKeys(lt(e))),lb(r,t),r}function vb(e,t){if(!Ot(t))throw new Error("Invalid input to safeExtend: expected a plain object");return Ze(e,ut(e._zod.def,{shape:cu(e,t)}))}function xb(e,t){if(!t?._zod?.def)throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r={};Ut(r,e,Reflect.ownKeys(lt(e))),Ut(r,t,Reflect.ownKeys(lt(t)));let n=ut(e._zod.def,{shape:r,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return Ze(e,n)}function wb(e,t,r,n="partial"){let i=t._zod.def.checks;if(i&&i.length>0)throw new Error(`.${n}() cannot be used on object schemas containing refinements`);let s=r?new Set(fo(t,r)):void 0,c={};return Ut(c,t,Reflect.ownKeys(lt(t)),e&&((l,u)=>s&&!s.has(u)?l:new e({type:"optional",innerType:l}))),Ze(t,ut(t._zod.def,{shape:c,checks:[]}))}function Sb(e,t,r){let n=r?new Set(fo(t,r)):void 0,o={};return Ut(o,t,Reflect.ownKeys(lt(t)),(i,a)=>n&&!n.has(a)?i:new e({type:"nonoptional",innerType:i})),Ze(t,ut(t._zod.def,{shape:o}))}function Ge(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function fa(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function pt(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function ur(e){return typeof e=="string"?e:e?.message}function _o(e,t,r){var n;for(let o=t;o<e.length;o++)(n=e[o]).schema??(n.schema=r)}function Je(e,t,r){var n;let o=e.inst?._zod?.traits;o?.has("$ZodType")&&(o.has("$ZodCheck")?(n=e).schema??(n.schema=e.inst):e.schema=e.inst);let i=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,a=e.message?e.message:ur(e.inst?._zod.def?.error?.(e))??ur(i?.(e))??ur(t?.error?.(e))??ur(r.customError?.(e))??ur(r.localeError?.(e))??"Invalid input",s={};for(let c of Object.keys(e))c==="inst"||c==="schema"||c==="continue"||c==="input"||c==="__proto__"||(s[c]=e[c]);return s.path??(s.path=[]),s.message=a,t?.reportInput&&(s.input=e.input),s}function lu(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}var kb=/[\uD800-\uDBFF]/;function Br(e){let t=e.length;if(!kb.test(e))return t;let r=t;for(let n=0;n<t-1;n++)(e.charCodeAt(n)&64512)===55296&&(e.charCodeAt(n+1)&64512)===56320&&(r--,n++);return r}function Gr(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function _a(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function _r(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}function $b(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function uu(e){let t=atob(e),r=new Uint8Array(t.length);for(let n=0;n<t.length;n++)r[n]=t.charCodeAt(n);return r}function du(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function Ob(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return uu(t+r)}function Pb(e){return du(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function zb(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(t.length/2);for(let n=0;n<t.length;n+=2)r[n/2]=Number.parseInt(t.slice(n,n+2),16);return r}function Eb(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var aa=class{constructor(...t){}};function ha(e,t){for(let r in t){let n=Object.getOwnPropertyDescriptor(t,r);n.get?Object.defineProperty(e,r,{...n,enumerable:!1}):tu(e,r,n.value)}for(let r of Object.getOwnPropertySymbols(t))tu(e,r,t[r])}function $t(e,t,r,n=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:n,value:r}),r}function ya(e,t,r){return $t(e,t,r,!1)}function Db(e,t){for(let r in e){let n=e[r];Object.defineProperty(t,r,{configurable:!0,enumerable:!0,get(){return $t(this,r,n(this))},set(o){$t(this,r,o)}})}return t}function tu(e,t,r){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?r:$t(this,t,r.bind(this))},set(n){$t(this,t,n)}})}function Ab(e,t){let r=Object.getPrototypeOf(e);return t in r?void 0:r}var oa,kt=!1,Cb={configurable:!0,get(){kt=!0}};function F(e,t,r){let n=Object.getPrototypeOf(e._zod);if(t in n&&oa!==e._zod){oa=void 0;return}oa=e._zod,Object.defineProperty(n,t,{configurable:!0,get(){Object.defineProperty(this,t,Cb);let o=kt;kt=!1;try{let i=r(this);return kt?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:i}),kt=kt||o,i}catch(i){throw delete this[t],kt=kt||o,i}},set(o){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:o})}})}function qb(e,t,r,n){let o=Ab(e,t);o&&Object.defineProperty(o,t,{configurable:!0,get(){let i={configurable:!0,writable:!0,enumerable:n,value:void 0};return Object.defineProperty(this,t,i),i.value=r(this),Object.defineProperty(this,t,i),i.value},set(i){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:n,value:i})}})}var pu="~constantCatch";function mu(e){let t=()=>e;return t[pu]=!0,t}var fu,ba=Object.freeze({status:"aborted"}),ga={value:void 0,enumerable:!1},_u="captureStackTrace"in Error?Error:null;function Nb(e){let t=_u;if(t){let r=t.stackTraceLimit;if(typeof r=="number"){try{t.stackTraceLimit=0}catch{return _u=null,new e}try{return new e}finally{t.stackTraceLimit=r}}}return new e}function g(e,t,r,n){let o={};function i(m){this.def=m,this.constr=d,this.traits=new Set}i.prototype=o;let a=r,s=a&&new WeakSet;function c(m,p){if(!m._zod){ga.value=new i(p);try{Object.defineProperty(m,"_zod",ga)}finally{ga.value=void 0}}if(m._zod.traits.has(e))return;if(m._zod.traits.add(e),t(m,p),s){let h=Object.getPrototypeOf(m),y=m._zod.constr.prototype,v=h;for(;v&&v!==y;)v=Object.getPrototypeOf(v);let w=v??h;s.has(w)||(s.add(w),ha(w,a))}let f=d.prototype;for(let h in f)Object.prototype.hasOwnProperty.call(f,h)&&(h in m||(m[h]=f[h].bind(m)))}let l=n?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function d(m){let p=n?.Parent?Nb(u):this;c(p,m);let f=p._zod.deferred;if(f){for(let y of f)y();p._zod.deferred=void 0}let h=globalThis.__zod_globalConfig?.postProcessor;return h&&h(p),p}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:m=>n?.Parent&&m instanceof n.Parent?!0:m?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var Ve=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},hr=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(fu=globalThis).__zod_globalConfig??(fu.__zod_globalConfig={});var Ee=globalThis.__zod_globalConfig;function De(e){return e&&Object.assign(Ee,e),Ee}function Rb(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,pr,2)),e.message}function Tb(e){this._zod.message=e}var Ib={get:Rb,set:Tb,enumerable:!0,configurable:!0},xa={value:void 0,enumerable:!1},hu=new WeakSet([Object.prototype,Error.prototype]),yu=(e,t)=>{e.name="$ZodError",xa.value=t,Object.defineProperty(e,"issues",xa),xa.value=void 0,Object.defineProperty(e,"message",Ib);let r=Object.getPrototypeOf(e);hu.has(r)||(hu.add(r),Object.defineProperty(r,"toString",{configurable:!0,enumerable:!1,get(){let n=()=>this.message;return Object.defineProperty(this,"toString",{value:n,configurable:!0,writable:!0}),n},set(n){Object.defineProperty(this,"toString",{value:n,configurable:!0,writable:!0})}}))},gu=g("$ZodError",yu),bu=g("$ZodError",yu,void 0,{Parent:Error});function Mb(e,t,r){return Object.prototype.hasOwnProperty.call(e,t)||(t==="__proto__"?Object.defineProperty(e,t,{value:r(),writable:!0,enumerable:!0,configurable:!0}):e[t]=r()),e[t]}function wa(e,t=r=>r.message){let r={},n=[];for(let o of e.issues)o.path.length>0?Mb(r,o.path[0],()=>[]).push(t(o)):n.push(t(o));return{formErrors:n,fieldErrors:r}}function Sa(e,t=r=>r.message){let r={_errors:[]},n=(o,i=[])=>{for(let a of o.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(s=>n({issues:s},[...i,...a.path]));else if(a.code==="invalid_key")n({issues:a.issues},[...i,...a.path]);else if(a.code==="invalid_element")n({issues:a.issues},[...i,...a.path]);else{let s=[...i,...a.path];if(s.length===0)r._errors.push(t(a));else{let c=r,l=0;for(;l<s.length;){let u=s[l],d=l===s.length-1;if(u==="_errors"){d&&c._errors.push(t(a)),l++;continue}Object.prototype.hasOwnProperty.call(c,u)||Object.defineProperty(c,u,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let m=c[u];d&&m._errors.push(t(a)),c=m,l++}}}};return n(e),r}function ho(e,t){return{callee:t?.callee??e,Err:t?.Err}}var yo=e=>{let t=(r,n,o,i)=>{let a=o?{...o,async:!1}:{async:!1},s=r._zod.run({value:n,issues:[]},a);if(s instanceof Promise)throw new Ve;if(s.issues.length){let c=new(i?.Err??e)(s.issues.map(l=>Je(l,a,De())));throw uo(c,i?.callee??t),c}return s.value};return t};var go=e=>{let t=async(r,n,o,i)=>{let a=o?{...o,async:!0}:{async:!0},s=r._zod.run({value:n,issues:[]},a);if(s instanceof Promise&&(s=await s),s.issues.length){let c=new(i?.Err??e)(s.issues.map(l=>Je(l,a,De())));throw uo(c,i?.callee??t),c}return s.value};return t};var Jr=e=>(t,r,n)=>{let o=n?{...n,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},o);if(i instanceof Promise)throw new Ve;return i.issues.length?vu(e,i.issues,o):{success:!0,data:i.value}},ka=Jr(bu);function vu(e,t,r){let n;return{success:!1,get error(){return n||(n=new e(t.map(o=>Je(o,r,De()))),t=void 0,r=void 0),n},set error(o){n=o,t=void 0,r=void 0}}}var bo=e=>async(t,r,n)=>{let o=n?{...n,async:!0}:{async:!0},i=t._zod.run({value:r,issues:[]},o);return i instanceof Promise&&(i=await i),i.issues.length?vu(e,i.issues,o):{success:!0,data:i.value}};var Ub=Symbol.for("zod.compile.invalid"),Zb=Symbol.for("zod.compile.fallback"),vo=((e,t,r)=>{let n=e._zod.bag.validator;if(n!==void 0){if(n(t)!==Ub)return!0;if(n.definite===!0&&r===void 0)return!1}return Fb(e,t,r)});function Fb(e,t,r){let n=r?{...r,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},o=e._zod.bag.fallbackRun,i;if(o?(n[Zb]=!0,i=o({value:t,issues:[]},n)):i=e._zod.run({value:t,issues:[]},n),i instanceof Promise)throw new Ve;return i.issues.length===0}var xo=async(e,t,r)=>{let n=r?{...r,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},o=e._zod.run({value:t,issues:[]},n);return o instanceof Promise&&(o=await o),o.issues.length===0},xu=e=>{let t=yo(e),r=(n,o,i,a)=>{let s=i?{...i,direction:"backward"}:{direction:"backward"};return t(n,o,s,ho(r,a))};return r};var wu=e=>{let t=yo(e),r=(n,o,i,a)=>t(n,o,i,ho(r,a));return r};var Su=e=>{let t=go(e),r=async(n,o,i,a)=>{let s=i?{...i,direction:"backward"}:{direction:"backward"};return await t(n,o,s,ho(r,a))};return r};var ku=e=>{let t=go(e),r=async(n,o,i,a)=>await t(n,o,i,ho(r,a));return r};var $u=e=>(t,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return Jr(e)(t,r,o)};var Ou=e=>(t,r,n)=>Jr(e)(t,r,n);var Pu=e=>async(t,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return bo(e)(t,r,o)};var zu=e=>async(t,r,n)=>bo(e)(t,r,n);var Eu=/^[cC][0-9a-z]{6,}$/,Du=/^[0-9a-z]+$/,Au=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,Cu=/^[0-9a-vA-V]{20}$/,qu=/^[A-Za-z0-9]{27}$/,Nu=/^[a-zA-Z0-9_-]{21}$/;function Ru(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var Tu=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var Iu=/^([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})$/,Oa=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;var Mu=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var Lb="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function ju(){return new RegExp(Lb,"u")}var Uu=/^(?:(?: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])$/,Zu=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/;var Fu=/^((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])$/,Lu=/^(([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}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Hu=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Yu=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/;var Ku=/^https?$/,Bu=/^\+[1-9]\d{6,14}$/;var Gu="(?:(?:\\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])))";function Hb(e){return new RegExp(`^${e}$`)}var Ju=Hb(Gu);function $a(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Vu(e){return new RegExp(`^${$a(e)}$`)}function Wu(e){let t=["Z"];e.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${$a({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,n=e.local?`${r}|${$a({precision:e.precision})}`:r;return new RegExp(`^${Gu}T(?:${n})$`)}var Xu=/^[\s\S]{0,}$/;var Qu=/^-?\d+n?$/,Pa=/^-?\d+$/,Vr=/^-?\d+(?:\.\d+)?$/,ed=/^(?:true|false)$/i,td=/^null$/i;var rd=/^[^A-Z]*$/,nd=/^[^a-z]*$/;var me=g("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])});var za=e=>{let t=e.value;return!sa(t)&&t.length!==void 0},wo={number:"number",bigint:"bigint",object:"date"},Ea=g("$ZodCheckLessThan",(e,t)=>{me.init(e,t);let r=wo[typeof t.value];e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:wo[typeof n.value]??r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Da=g("$ZodCheckGreaterThan",(e,t)=>{me.init(e,t);let r=wo[typeof t.value];e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:wo[typeof n.value]??r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),od=g("$ZodCheckMultipleOf",(e,t)=>{me.init(e,t),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?t.value!==BigInt(0)&&r.value%t.value===BigInt(0):ca(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),id=g("$ZodCheckNumberFormat",(e,t)=>{me.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[o,i]=Kr[t.format];e._zod.check=a=>{let s=a.value;if(r){if(!Number.isInteger(s)){a.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?a.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}):a.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});return}}s<o&&a.issues.push({origin:"number",input:s,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),s>i&&a.issues.push({origin:"number",input:s,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}});var ad=g("$ZodCheckMaxLength",(e,t)=>{var r;me.init(e,t),(r=e._zod.def).when??(r.when=za),e._zod.check=n=>{let o=n.value,i=o.length;if((typeof o=="string"&&i>t.maximum?Br(o):i)<=t.maximum)return;let s=Gr(o);n.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),sd=g("$ZodCheckMinLength",(e,t)=>{var r;me.init(e,t),(r=e._zod.def).when??(r.when=za),e._zod.check=n=>{let o=n.value,i=o.length;if((typeof o=="string"&&i>=t.minimum&&i<t.minimum*2?Br(o):i)>=t.minimum)return;let s=Gr(o);n.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),cd=g("$ZodCheckLengthEquals",(e,t)=>{var r;me.init(e,t),(r=e._zod.def).when??(r.when=za),e._zod.check=n=>{let o=n.value,i=o.length,a=typeof o=="string"&&i>=t.length&&i<=t.length*2?Br(o):i;if(a===t.length)return;let s=Gr(o),c=a>t.length;n.issues.push({origin:s,...c?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Wr=g("$ZodCheckStringFormat",(e,t)=>{var r,n;me.init(e,t),t.pattern?(r=e._zod).check??(r.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),ld=g("$ZodCheckRegex",(e,t)=>{Wr.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),ud=g("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=rd),Wr.init(e,t)}),dd=g("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=nd),Wr.init(e,t)}),pd=g("$ZodCheckIncludes",(e,t)=>{me.init(e,t);let r=dt(t.includes),n=new RegExp(typeof t.position=="number"?`^.{${t.position},}${r}`:r);t.pattern=n,e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),md=g("$ZodCheckStartsWith",(e,t)=>{me.init(e,t);let r=new RegExp(`^${dt(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),fd=g("$ZodCheckEndsWith",(e,t)=>{me.init(e,t);let r=new RegExp(`.*${dt(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}});var _d=g("$ZodCheckOverwrite",(e,t)=>{me.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});var So=class{constructor(t=[],r={}){this.content=[],this.indent=0,this.args=t,this.closed=r}indented(t){this.indent+=1;try{t(this)}finally{this.indent-=1}}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let n=t.split(`
`).filter(a=>a),o=Math.min(...n.map(a=>a.length-a.trimStart().length)),i=n.map(a=>a.slice(o)).map(a=>" ".repeat(this.indent*2)+a);for(let a of i)this.content.push(a)}compile(){let t=Function,r=this?.content??[""];return new t(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
${r.join(`
`)}
};`)(...Object.values(this.closed))}};var yd={major:4,minor:6,patch:1};var K=g("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=yd;let n=e._zod.def.checks,o=e._zod.traits.has("$ZodCheck")?[e,...n??[]]:n?.length?[...n]:[];for(let i of o)for(let a of i._zod.onattach)a(e);if(o.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let i=(s,c,l)=>{if(s.memo)return s;let u=Ge(s),d;for(let m of c){if(m._zod.def.when){if(fa(s)||!m._zod.def.when(s))continue}else if(u)continue;let p=s.issues.length,f=m._zod.check(s);if(f instanceof Promise&&l?.async===!1)throw new Ve;if(d||f instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await f,s.issues.length!==p&&(_o(s.issues,p,e),u||(u=Ge(s,p)))});else{if(s.issues.length===p)continue;_o(s.issues,p,e),u||(u=Ge(s,p))}}return d?d.then(()=>s):s},a=(s,c,l)=>{if(Ge(s))return s.aborted=!0,s;let u=i(c,o,l);if(u instanceof Promise){if(l.async===!1)throw new Ve;return u.then(d=>e._zod.parse(d,l))}return e._zod.parse(u,l)};e._zod.run=(s,c)=>{if(c.skipChecks)return e._zod.parse(s,c);if(c.direction==="backward"){let u=e._zod.parse({value:s.value,issues:[]},{...c,skipChecks:!0});return u instanceof Promise?u.then(d=>a(d,s,c)):a(u,s,c)}let l=e._zod.parse(s,c);if(l instanceof Promise){if(c.async===!1)throw new Ve;return l.then(u=>i(u,o,c))}return i(l,o,c)}}},{get"~standard"(){return ya(this,"~standard",Ca(this))},set"~standard"(e){$t(this,"~standard",e)}}),Pd=(e,t)=>e.issues.length?{issues:e.issues.map(r=>Je(r,t,De()))}:{value:e.value};async function Yb(e,t){let r={async:!0};return Pd(await e._zod.run({value:t,issues:[]},r),r)}function Ca(e){return{validate:t=>{let r={async:!1};try{let n=e._zod.run({value:t,issues:[]},r);if(!(n instanceof Promise))return Pd(n,r)}catch{}return Yb(e,t)},vendor:"zod",version:1}}var Oo=g("$ZodString",(e,t)=>{K.init(e,t),e._zod.pattern=t.pattern??Xu,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),Q=g("$ZodStringFormat",(e,t)=>{Wr.init(e,t),Oo.init(e,t)}),zd=g("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Iu),Q.init(e,t)}),Ed=g("$ZodUUID",(e,t)=>{if(t.version){let n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(n===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Oa(n))}else t.pattern??(t.pattern=Oa());Q.init(e,t)}),Dd=g("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Mu),Q.init(e,t)}),Ad=1,Cd=2;function Kb(e,t){if(!t.normalize&&t.protocol?.source===Ku.source&&!/^https?:\/\//i.test(e))return Ad;try{return new URL(e)}catch{return Cd}}var Bb=/[\t\n\r]/g;function Gb(e){return e.replace(Bb,"")}function Jb(e,t){return t.lastIndex=0,t.test(e.hostname)}function Vb(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(":")?e.protocol.slice(0,-1):e.protocol)}var qd=g("$ZodURL",(e,t)=>{Q.init(e,t),e._zod.check=r=>{try{let n=r.value.trim(),o=Kb(n,t);if(o===Ad){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});return}if(o===Cd){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort});return}t.hostname&&!Jb(o,t.hostname)&&r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort}),t.protocol&&!Vb(o,t.protocol)&&r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort}),r.value=t.normalize?o.href:Gb(n);return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),Nd=g("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=ju()),Q.init(e,t)}),Rd=g("$ZodNanoID",(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw new Error(`Invalid nanoid length: ${t.length}`);t.pattern??(t.pattern=t.length===void 0?Nu:Ru(t.length)),Q.init(e,t)}),Td=g("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Eu),Q.init(e,t)}),Id=g("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Du),Q.init(e,t)}),Md=g("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Au),Q.init(e,t)}),jd=g("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Cu),Q.init(e,t)}),Ud=g("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=qu),Q.init(e,t)}),Zd=g("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Wu(t)),Q.init(e,t)}),Fd=g("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Ju),Q.init(e,t)}),Ld=g("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Vu(t)),Q.init(e,t)}),Hd=g("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Tu),Q.init(e,t)}),Yd=g("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Uu),Q.init(e,t)}),Wb=/^[0-9a-fA-F:.]+$/;function Kd(e){if(!Wb.test(e))return!1;try{return new URL(`http://[${e}]`),!0}catch{return!1}}var Bd=g("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Zu),Q.init(e,t),e._zod.check=r=>{Kd(r.value)||r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}});var Gd=g("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Fu),Q.init(e,t)});function Xb(e){let t=e.split("/");if(t.length!==2)return!1;let[r,n]=t;if(!n)return!1;let o=Number(n);return`${o}`!==n||o<0||o>128?!1:Kd(r)}var Jd=g("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Lu),Q.init(e,t),e._zod.check=r=>{Xb(r.value)||r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}});function Vd(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var qa=/^[0-9a-zA-Z+/]*={0,2}$/,Wd=g("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=qa),Q.init(e,t),e._zod.check=r=>{Vd(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}}),Po=/^[A-Za-z0-9_-]*$/;function Qb(e){if(!Po.test(e))return!1;let t=e.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return Vd(r)}var Xd=g("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Po),Q.init(e,t),e._zod.check=r=>{Qb(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),Qd=g("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Bu),Q.init(e,t)});function ev(e,t=null){try{let r=e.split(".");if(r.length!==3)return!1;let[n]=r;if(!n)return!1;let o=JSON.parse(atob(n));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}}var ep=g("$ZodJWT",(e,t)=>{Q.init(e,t),e._zod.check=r=>{ev(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}});var Na=g("$ZodNumber",(e,t)=>{K.init(e,t),e._zod.pattern=Vr,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let o=r.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;let i=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:String(o):void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...i?{received:i}:{}}),r}}),tp=g("$ZodNumberFormat",(e,t)=>{id.init(e,t),Na.init(e,t)}),rp=g("$ZodBoolean",(e,t)=>{K.init(e,t),e._zod.pattern=ed,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch{}let o=r.value;return typeof o=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),r}}),np=g("$ZodBigInt",(e,t)=>{K.init(e,t),e._zod.pattern=Qu,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r}});var op=g("$ZodNull",(e,t)=>{K.init(e,t),e._zod.pattern=td,e._zod.values=new Set([null]),e._zod.parse=(r,n)=>{let o=r.value;return o===null||r.issues.push({expected:"null",code:"invalid_type",input:o,inst:e}),r}}),ip=g("$ZodAny",(e,t)=>{K.init(e,t),e._zod.parse=r=>r}),ap=g("$ZodUnknown",(e,t)=>{K.init(e,t),e._zod.parse=r=>r}),sp=g("$ZodNever",(e,t)=>{K.init(e,t),e._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});var cp=g("$ZodDate",(e,t)=>{K.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let o=r.value,i=o instanceof Date;return i&&!Number.isNaN(o.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:o,...i?{received:"Invalid Date"}:{},inst:e}),r}});function gd(e,t,r){e.issues.length&&t.issues.push(...pt(r,e.issues)),t.value[r]=e.value}var lp=g("$ZodArray",(e,t)=>{K.init(e,t);let r=Ee.memoizer;r?.attach(e),e._zod.parse=(n,o)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),n;n.value=r?r.alloc(e,n,Array(i.length),o):Array(i.length);let a=[],s=o?.abortEarly;for(let c=0;c<i.length;c++){let l=i[c],u=t.element._zod.run({value:l,issues:[]},o);if(u instanceof Promise)a.push(u.then(d=>gd(d,n,c)));else if(gd(u,n,c),s&&u.issues.length!==0&&Ge(u))break}return a.length?Promise.all(a).then(()=>n):n}});function $o(e,t,r,n,o,i){let a=r in n,s=i==="optional";if(!(!a&&s&&o==="optional")){if(e.issues.length){if(o!==void 0&&s&&!a)return;t.issues.push(...pt(r,e.issues))}if(!a&&o===void 0){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}e.value===void 0?a&&(t.value[r]=void 0):t.value[r]=e.value}}var tv=[];function up(e){let t=Object.keys(e.shape),r=Object.getOwnPropertySymbols(e.shape),n=r.length?r:tv,o=n.length?[...t,...n]:t;for(let a of o)if(!e.shape?.[a]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${String(a)}": expected a Zod schema`);let i=ma(e.shape);return{...e,allKeys:o,symbolKeys:n,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(i)}}function dp(e,t,r,n,o,i,a){let s=[],c=o.keySet,l=o.catchall._zod,u=l.def.type,d=l.optin,m=l.optout,p=0;for(let f in t){if(a&&r.issues.length!==p){if(Ge(r,p))break;p=r.issues.length}if(c.has(f))continue;if(f==="__proto__"){u==="never"&&s.push(f);continue}if(u==="never"){s.push(f);continue}let h=l.run({value:t[f],issues:[]},n);h instanceof Promise?e.push(h.then(y=>$o(y,r,f,t,d,m))):$o(h,r,f,t,d,m)}return s.length&&r.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:i,continue:!0}),e.length?Promise.all(e).then(()=>r):r}var rv=g("$ZodObject",(e,t)=>{K.init(e,t);let r=Object.getOwnPropertyDescriptor(t,"shape"),n=r?.get?r.get.raw:t.shape??{};if(n){let l=()=>{let u={...n};return Object.defineProperty(t,"shape",{value:u}),l.raw=u,u};l.raw=n,Object.defineProperty(t,"shape",{get:l})}let o=mr(()=>up(t));F(e,"propValues",l=>{let u=l.def.shape,d={};for(let m in u){let p=u[m]._zod;if(p.values){Object.prototype.hasOwnProperty.call(d,m)||Ie(d,m,new Set);for(let f of p.values)d[m].add(f);p.optin!==void 0&&d[m].add(void 0)}}return d});let i=Zt,a=t.catchall,s,c=Ee.memoizer;c?.attach(e),e._zod.parse=(l,u)=>{s??(s=o.value);let d=l.value;if(!i(d))return l.issues.push({expected:"object",code:"invalid_type",input:d,inst:e}),l;l.value=c?c.alloc(e,l,{},u):{};let m=[],p=s.shape,f=u?.abortEarly,h=l.issues.length;for(let y of s.allKeys){if(f&&l.issues.length!==h){if(Ge(l,h))break;h=l.issues.length}if(y==="__proto__")continue;let v=p[y],w=v._zod.optin,S=v._zod.optout,q=v._zod.run({value:d[y],issues:[]},u);q instanceof Promise?m.push(q.then(b=>$o(b,l,y,d,w,S))):$o(q,l,y,d,w,S)}return a?dp(m,d,l,u,o.value,e,f===!0):m.length?Promise.all(m).then(()=>l):l}}),pp=g("$ZodObjectJIT",(e,t)=>{rv.init(e,t);let r=e._zod.parse,n=mr(()=>up(t)),o=Ee.memoizer,i=p=>{let f=n.value,h=f.symbolKeys,y=new So(["payload","ctx"],{shape:p,inst:e,memo:o,syms:h}),v=b=>`shape[${b}]._zod.run({ value: input[${b}], issues: [] }, ctx)`,w=(b,x)=>`
let ${b}_ab = false;
for (let i = 0; i < ${b}.issues.length; i++) {
const iss = ${b}.issues[i];
iss.path = iss.path ? [${x}, ...iss.path] : [${x}];
payload.issues.push(iss);
if (iss.continue !== true) ${b}_ab = true;
}
if (${b}_ab && ctx && ctx.abortEarly) {
payload.value = newResult;
return payload;
}`;y.write("const input = payload.value;");let S=Object.create(null),q=0;for(let b of f.allKeys)S[b]=`key_${q++}`;y.write(o?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};");for(let b of f.allKeys){if(b==="__proto__")continue;let x=S[b],D=typeof b=="symbol"?`syms[${h.indexOf(b)}]`:la(b),X=`${D} in input`,ne=p[b],pe=ne?._zod?.optin,wt=pe!==void 0,cr=ne?._zod?.optout==="optional";if(y.write(`const ${x} = ${v(D)};`),wt&&cr){let lr=pe==="optional"?`${x}_present`:`${x}.value !== undefined || ${x}_present`;y.write(`
const ${x}_present = ${X};
if (!${x}.issues.length || ${x}_present) {
if (${x}.issues.length) {${w(x,D)}
}
if (${lr}) {
newResult[${D}] = ${x}.value;
}
}
`)}else wt?y.write(`
if (${x}.issues.length) {${w(x,D)}
}
if (${x}.value === undefined) {
if (${X}) {
newResult[${D}] = undefined;
}
} else {
newResult[${D}] = ${x}.value;
}
`):y.write(`
const ${x}_present = ${X};
if (${x}.issues.length) {${w(x,D)}
}
if (!${x}_present && !${x}.issues.length) {
payload.issues.push({
code: "invalid_type",
expected: "nonoptional",
input: undefined,
path: [${D}]
});
if (ctx && ctx.abortEarly) {
payload.value = newResult;
return payload;
}
}
if (${x}_present) {
newResult[${D}] = ${x}.value;
}
`)}return y.write("payload.value = newResult;"),y.write("return payload;"),y.compile()},a,s=Zt,c=!Ee.jitless,u=c&&da.value,d=t.catchall,m;e._zod.parse=(p,f)=>{m??(m=n.value);let h=p.value;return s(h)?c&&u&&f?.async===!1&&f.jitless!==!0?(a||(a=i(t.shape)),p=a(p,f),d?dp([],h,p,f,m,e,f?.abortEarly===!0):p):r(p,f):(p.issues.push({expected:"object",code:"invalid_type",input:h,inst:e}),p)}});function bd(e,t,r,n){for(let i of e)if(i.issues.length===0)return t.value=i.value,t;let o=e.filter(i=>!Ge(i));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(i=>i.issues.map(a=>Je(a,n,De())))}),t)}var Ra=g("$ZodUnion",(e,t)=>{K.init(e,t),F(e,"optin",n=>n.def.options.some(o=>o._zod.optin==="defaulted")?"defaulted":n.def.options.some(o=>o._zod.optin!==void 0)?"optional":void 0),F(e,"optout",n=>n.def.options.some(o=>o._zod.optout==="optional")?"optional":void 0),F(e,"values",n=>{if(n.def.options.every(o=>o._zod.values))return new Set(n.def.options.flatMap(o=>Array.from(o._zod.values)))}),F(e,"pattern",n=>{if(n.def.options.every(o=>o._zod.pattern)){let o=n.def.options.map(i=>i._zod.pattern);return new RegExp(`^(${o.map(i=>Yr(i.source)).join("|")})$`)}});let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(n,o)=>{if(r)return r(n,o);let i=!1,a=[];for(let s of t.options){let c=s._zod.run({value:n.value,issues:[]},o);if(c instanceof Promise)a.push(c),i=!0;else{if(c.issues.length===0)return c;a.push(c)}}return i?Promise.all(a).then(s=>bd(s,n,e,o)):bd(a,n,e,o)}});function nv(e){let t=new Map;for(let r of e.options){let n=r._zod.propValues?.[e.discriminator];if(!n||n.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(r)}"`);for(let o of n)if(t.has(o)){if(o!==void 0)throw new Error(`Duplicate discriminator value "${String(o)}"`);t.set(o,null)}else t.set(o,r)}return t}var mp=g("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Ra.init(e,t);let r=e._zod.parse;F(e,"propValues",o=>{let i={},a=0;for(let s of o.def.options){let c=s._zod.propValues;if(!c||Object.keys(c).length===0)throw new Error(`Invalid discriminated union option at index "${o.def.options.indexOf(s)}"`);c[o.def.discriminator]?.has(void 0)&&a++;for(let[l,u]of Object.entries(c)){Object.prototype.hasOwnProperty.call(i,l)||Ie(i,l,new Set);for(let d of u)i[l].add(d)}}return!o.def.unionFallback&&a>1&&i[o.def.discriminator]?.delete(void 0),i}),t.options.forEach((o,i)=>{let a=fr(o._zod.def);if(a&&!Object.prototype.hasOwnProperty.call(a,t.discriminator))throw new Error(`Invalid discriminated union option at index "${i}"`)});let n=mr(()=>nv(t));e._zod.parse=(o,i)=>{let a=o.value;if(!Zt(a))return o.issues.push({code:"invalid_type",expected:"object",input:a,inst:e}),o;let s=a?.[t.discriminator],c=n.value.get(s);return c&&(s!==void 0||i.direction!=="backward")?c._zod.run(o,i):t.unionFallback||i.direction==="backward"?r(o,i):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(n.value.keys()).filter(l=>n.value.get(l)!==null),input:a,path:[t.discriminator],inst:e}),o)}}),fp=g("$ZodIntersection",(e,t)=>{K.init(e,t),e._zod.parse=(r,n)=>{let o=r.value,i=t.left._zod.run({value:o,issues:[]},n),a=t.right._zod.run({value:o,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([c,l])=>vd(r,c,l)):vd(r,i,a)}});function Aa(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Ot(e)&&Ot(t)){let r=Object.keys(t),n=Object.keys(e).filter(i=>r.indexOf(i)!==-1),o={...e,...t};Object.prototype.hasOwnProperty.call(o,"__proto__")&&delete o.__proto__;for(let i of n){if(i==="__proto__")continue;let a=Aa(e[i],t[i]);if(!a.valid)return{valid:!1,mergeErrorPath:[i,...a.mergeErrorPath]};o[i]=a.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let n=0;n<e.length;n++){let o=e[n],i=t[n],a=Aa(o,i);if(!a.valid)return{valid:!1,mergeErrorPath:[n,...a.mergeErrorPath]};r.push(a.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function vd(e,t,r){let n=new Map,o,i=new Map,a=(l,u)=>{let d;if(l.code==="unrecognized_keys"&&!l.path?.length)o??(o=l),d=l.keys;else if(l.code==="invalid_key"&&l.origin==="record"&&l.path?.length===1){let m=String(l.path[0]);i.has(m)||i.set(m,l),d=[m]}else return!1;for(let m of d)n.has(m)||n.set(m,{}),n.get(m)[u]=!0;return!0};for(let l of t.issues)a(l,"l")||e.issues.push(l);for(let l of r.issues)a(l,"r")||e.issues.push(l);let s=[...n].filter(([,l])=>l.l&&l.r).map(([l])=>l);if(s.length){let l=o?s.filter(u=>o.keys.includes(u)):[];l.length&&e.issues.push({...o,keys:l});for(let u of s)!l.includes(u)&&i.has(u)&&e.issues.push(i.get(u))}let c=Aa(t.value,r.value);if(!c.valid){if(Ge(e))return e;throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}var _p=g("$ZodRecord",(e,t)=>{K.init(e,t);let r=Ee.memoizer;r?.attach(e),e._zod.parse=(n,o)=>{let i=n.value;if(!Ot(i))return n.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),n;let a=[],s=t.keyType._zod.values;if(s&&!t.partial){n.value=r?r.alloc(e,n,{},o):{};let c=new Set;for(let u of s)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){if(c.add(typeof u=="number"?u.toString():u),u==="__proto__")continue;let d=t.keyType._zod.run({value:u,issues:[]},o);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(d.issues.length){n.issues.push({code:"invalid_key",origin:"record",issues:d.issues.map(f=>Je(f,o,De())),input:u,path:[u],inst:e});continue}let m=d.value;if(m==="__proto__")continue;let p=t.valueType._zod.run({value:i[u],issues:[]},o);p instanceof Promise?a.push(p.then(f=>{f.issues.length&&n.issues.push(...pt(u,f.issues)),n.value[m]=f.value})):(p.issues.length&&n.issues.push(...pt(u,p.issues)),n.value[m]=p.value)}let l;for(let u in i)if(!c.has(u))if(t.mode==="loose"){if(u==="__proto__")continue;n.value[u]=i[u]}else l=l??[],l.push(u);l&&l.length>0&&n.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:l,continue:!0})}else{n.value=r?r.alloc(e,n,{},o):{};let c;for(let l of Reflect.ownKeys(i)){if(l==="__proto__"||!Object.prototype.propertyIsEnumerable.call(i,l))continue;let u=t.keyType._zod.run({value:l,issues:[]},o);if(u instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof l=="string"&&Vr.test(l)&&u.issues.length){let f=t.keyType._zod.run({value:Number(l),issues:[]},o);if(f instanceof Promise)throw new Error("Async schemas not supported in object keys currently");f.issues.length===0&&(u=f)}if(u.issues.length){t.mode==="loose"?n.value[l]=i[l]:s?(c=c??[],c.push(l)):n.issues.push({code:"invalid_key",origin:"record",issues:u.issues.map(f=>Je(f,o,De())),input:l,path:[l],inst:e});continue}let m=u.value;if(m==="__proto__")continue;let p=t.valueType._zod.run({value:i[l],issues:[]},o);p instanceof Promise?a.push(p.then(f=>{f.issues.length&&n.issues.push(...pt(l,f.issues)),n.value[m]=f.value})):(p.issues.length&&n.issues.push(...pt(l,p.issues)),n.value[m]=p.value)}c&&c.length>0&&n.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:c,continue:!0})}return a.length?Promise.all(a).then(()=>n):n}});var hp=g("$ZodEnum",(e,t)=>{K.init(e,t);let r=dr(t.entries),n=new Set(r);e._zod.values=n,F(e,"pattern",o=>{let i=dr(o.def.entries).filter(a=>pa.has(typeof a));return new RegExp(i.length?`^(${i.map(a=>dt(a.toString())).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(o,i)=>{let a=o.value;return n.has(a)||o.issues.push({code:"invalid_value",values:r,input:a,inst:e}),o}}),yp=g("$ZodLiteral",(e,t)=>{K.init(e,t);let r=new Set(t.values);e._zod.values=r,F(e,"pattern",n=>{let o=n.def.values;return new RegExp(o.length?`^(${o.map(i=>typeof i=="string"?dt(i):i?dt(i.toString()):String(i)).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(n,o)=>{let i=n.value;return r.has(i)||n.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),n}});var gp=g("$ZodTransform",(e,t)=>{K.init(e,t),e._zod.optin="optional",Ee.memoizer?.guard(e),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new hr(e.constructor.name);let o=t.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then(a=>(r.value=a,r));if(o instanceof Promise)throw new Ve;return r.value=o,r}});function xd(e,t){return e.value=t.issues.length?void 0:t.value,e}var Ta=g("$ZodOptional",(e,t)=>{K.init(e,t),F(e,"optin",r=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),e._zod.optout="optional",F(e,"values",r=>{let n=r.def.innerType._zod.values;return n?new Set([...n,void 0]):void 0}),F(e,"pattern",r=>{let n=r.def.innerType._zod.pattern;return n?new RegExp(`^(${Yr(n.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(r.value===void 0){if(t.innerType._zod.optin!=="defaulted")return r;let o=t.innerType._zod.run({value:r.value,issues:[]},n);return o instanceof Promise?o.then(i=>xd(r,i)):xd(r,o)}return t.innerType._zod.run(r,n)}}),bp=g("$ZodExactOptional",(e,t)=>{Ta.init(e,t),F(e,"values",r=>r.def.innerType._zod.values),F(e,"pattern",r=>r.def.innerType._zod.pattern),e._zod.parse=(r,n)=>t.innerType._zod.run(r,n)}),vp=g("$ZodNullable",(e,t)=>{K.init(e,t),F(e,"optin",r=>r.def.innerType._zod.optin),F(e,"optout",r=>r.def.innerType._zod.optout),F(e,"pattern",r=>{let n=r.def.innerType._zod.pattern;return n?new RegExp(`^(${Yr(n.source)}|null)$`):void 0}),F(e,"values",r=>r.def.innerType._zod.values?new Set([...r.def.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)}),xp=g("$ZodDefault",(e,t)=>{K.init(e,t),e._zod.optin="defaulted",F(e,"values",r=>r.def.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);if(r.value===void 0)return r.value=t.defaultValue,r;let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(i=>wd(i,t)):wd(o,t)}});function wd(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var wp=g("$ZodPrefault",(e,t)=>{K.init(e,t),e._zod.optin="defaulted",F(e,"values",r=>r.def.innerType._zod.values),e._zod.parse=(r,n)=>(n.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,n))}),Sp=g("$ZodNonOptional",(e,t)=>{K.init(e,t),F(e,"values",r=>{let n=r.def.innerType._zod.values;return n?new Set([...n].filter(o=>o!==void 0)):void 0}),e._zod.parse=(r,n)=>{let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(i=>Sd(i,e)):Sd(o,e)}});function Sd(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}function kd(e,t,r,n){return t.issues.length?(e.value=r.catchValue({...t,value:e.value,error:{issues:t.issues.map(o=>Je(o,n,De()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}var kp=g("$ZodCatch",(e,t)=>{K.init(e,t),F(e,"optin",r=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),F(e,"optout",r=>r.def.innerType._zod.optout),F(e,"values",r=>r.def.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);let o=t.innerType._zod.run({value:r.value,issues:[]},n);return o instanceof Promise?o.then(i=>kd(r,i,t,n)):kd(r,o,t,n)}});var Ia=g("$ZodPipe",(e,t)=>{K.init(e,t),F(e,"values",r=>r.def.in._zod.values),F(e,"optin",r=>r.def.in._zod.optin),F(e,"optout",r=>r.def.out._zod.optout),F(e,"propValues",r=>r.def.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){let i=t.out._zod.run(r,n);return i instanceof Promise?i.then(a=>ko(a,t.in,n)):ko(i,t.in,n)}let o=t.in._zod.run(r,n);return o instanceof Promise?o.then(i=>ko(i,t.out,n)):ko(o,t.out,n)}});function ko(e,t,r){return e.issues.some(n=>n.code!=="unrecognized_keys")?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}var $p=g("$ZodPreprocess",(e,t)=>{Ia.init(e,t)}),Op=g("$ZodReadonly",(e,t)=>{K.init(e,t),F(e,"propValues",r=>r.def.innerType._zod.propValues),F(e,"values",r=>r.def.innerType._zod.values),F(e,"optin",r=>r.def.innerType?._zod?.optin),F(e,"optout",r=>r.def.innerType?._zod?.optout),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then($d):$d(o)}});function $d(e){return e.memo||(e.value=Object.freeze(e.value)),e}var Pp=g("$ZodCustom",(e,t)=>{me.init(e,t),K.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{let n=r.value,o=t.fn(n);if(o instanceof Promise)return o.then(i=>Od(i,r,n,e));Od(o,r,n,e)}});function Od(e,t,r,n){if(!e){let o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(o.params=n._zod.def.params),t.issues.push(_r(o))}}var ja=class extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}},Ua="~memo",zp=[];function Ep(e){return e!==null&&(typeof e=="object"||typeof e=="function")}function Ma(e){return e.map(t=>t.path?{...t,path:t.path.slice()}:{...t})}var Dp=new WeakMap,Xr=0,Do=1,Qr=2;function Ao(e,t,r){let n=Dp.get(e);if(n!==void 0)return n?Qr:Xr;if(t.has(e))return Qr;t.add(e);let o=Xr,i=u=>{if(o!==Qr&&u?._zod){let d=Ao(u,t,r);d>o&&(o=d)}},a=(u,d)=>{let m=Xr;for(let p of Reflect.ownKeys(u)){let f=Object.getOwnPropertyDescriptor(u,p);if(d&&!f.enumerable)continue;let h=f.get?Do:f.value?._zod?Ao(f.value,t,r):Xr;h>m&&(m=h)}return m},s=u=>{u>o&&(o=u)},c=e._zod.def,l=c.type;switch(l){case"object":{let u=fr(c);s(u?a(u,!0):Do),i(c.catchall);break}case"properties":s(a(c.shape,!1));break;case"array":i(c.element);break;case"tuple":for(let u of c.items)i(u);i(c.rest);break;case"record":case"map":i(c.keyType),i(c.valueType);break;case"set":i(c.valueType);break;case"union":for(let u of c.options)i(u);break;case"intersection":i(c.left),i(c.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":i(c.innerType);break;case"pipe":i(c.in),i(c.out);break;case"function":i(c.input),i(c.output);break;case"lazy":{let u=c._cachedInner??(r?e._zod.innerType:void 0);s(u?Ao(u,t,!1):Do);break}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(let u in c){let d=Object.getOwnPropertyDescriptor(c,u);if(!d||d.get)continue;let m=d.value;if(!(!m||typeof m!="object")){if(m._zod)i(m);else if(Array.isArray(m))for(let p of m)i(p)}}}return t.delete(e),ov(e,o)}function ov(e,t){return t!==Do&&Dp.set(e,t===Qr),t}function iv(e,t){let r=e.buckets.get(t);return r||(r=new WeakMap,e.buckets.set(t,r)),r}var zo,Eo=[],av={alloc(e,t,r){let n=zo;if(!n)return r;zo=void 0;let o={value:r,issues:null};return n.set(t.value,o),Eo.push(o),r},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let r=e._zod.parse,n=(o,i)=>{if(i.direction!=="backward"&&sv(i,o.value))throw new ja;return r(o,i)};e._zod.parse=n,e._zod.run===r&&(e._zod.run=n)})},attach(e){var t;let r,n=!1,o,i;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let a=e._zod.parse,s=(c,l)=>{if(r===void 0){let v=Ao(e,new Set,!1);if(v===Xr)return e._zod.parse=a,e._zod.run===s&&(e._zod.run=a),a(c,l);v===Qr||n?r=!0:n=!0}let u=c.value;if(!Ep(u))return a(c,l);let d=l[Ua];d||(d={buckets:new WeakMap,backEdges:void 0},l[Ua]=d);let m;o===l?m=i:(m=iv(d,e),o=l,i=m);let p=m.get(u);if(p)return c.value=p.value,p.issues?p.issues.length&&c.issues.push(...Ma(p.issues)):(c.memo=!0,d.backEdges??(d.backEdges=new WeakSet),d.backEdges.add(p.value)),c;zo=m;let f=Eo.length,h=a(c,l);zo=void 0;let y=Eo.length>f?Eo.pop():void 0;return h instanceof Promise?h.then(v=>(y&&(y.issues=v.issues.length?Ma(v.issues):zp),v)):(y&&(y.issues=h.issues.length?Ma(h.issues):zp),h)};e._zod.parse=s,e._zod.run===a&&(e._zod.run=s)})}};function Za(){return av}function sv(e,t){let r=e[Ua]?.backEdges;return r!==void 0&&Ep(t)&&r.has(t)}var cv=()=>{let e={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 t(i){return e[i]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",credit_card:"credit card number",iban:"IBAN",jwt:"JWT",template_literal:"input"},n={nan:"NaN"};function o(i,a){return i==="number"&&typeof a=="number"&&!Number.isFinite(a)?String(a):n[i]??i}return i=>{switch(i.code){case"invalid_type":{let a=o(i.expected),s=_a(i.input),c=o(s,i.input);return`Invalid input: expected ${a}, received ${c}`}case"invalid_value":return i.values.length===1?`Invalid input: expected ${po(i.values[0])}`:`Invalid option: expected one of ${lo(i.values,"|")}`;case"too_big":{let a=i.exact?"exactly ":i.inclusive?"<=":"<",s=t(i.origin);return s?`Too big: expected ${i.origin??"value"} to have ${a}${i.maximum.toString()} ${s.unit??"elements"}`:`Too big: expected ${i.origin??"value"} to be ${a}${i.maximum.toString()}`}case"too_small":{let a=i.exact?"exactly ":i.inclusive?">=":">",s=t(i.origin);return s?`Too small: expected ${i.origin} to have ${a}${i.minimum.toString()} ${s.unit}`:`Too small: expected ${i.origin} to be ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Invalid string: must start with "${a.prefix}"`:a.format==="ends_with"?`Invalid string: must end with "${a.suffix}"`:a.format==="includes"?`Invalid string: must include "${a.includes}"`:a.format==="regex"?`Invalid string: must match pattern ${a.pattern}`:`Invalid ${r[a.format]??i.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${i.divisor}`;case"unrecognized_keys":return`Unrecognized key${i.keys.length>1?"s":""}: ${lo(i.keys,", ")}`;case"invalid_key":return`Invalid key in ${i.origin}`;case"invalid_union":return i.options&&Array.isArray(i.options)&&i.options.length>0?`Invalid discriminator value. Expected ${i.options.map(s=>`'${s}'`).join(" | ")}`:i.inclusive===!1?"Invalid input: more than one option matched":"Invalid input";case"invalid_element":return`Invalid value in ${i.origin}`;default:return"Invalid input"}}};function Ap(){return{localeError:cv()}}var Cp;var Fa=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let n=r[0];return this._map.set(t,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let n={...this.get(r)??{}};delete n.id;let o={...n,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function qp(){return new Fa}(Cp=globalThis).__zod_globalRegistry??(Cp.__zod_globalRegistry=qp());var Pt=globalThis.__zod_globalRegistry;function Np(e,t){return new e({type:"string",...E(t)})}function Rp(e,t){return new e({type:"string",coerce:!0,...E(t)})}function Tp(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...E(t)})}function Ip(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...E(t)})}function Mp(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...E(t)})}function jp(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...E(t)})}function Up(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...E(t)})}function Zp(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...E(t)})}function La(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...E(t)})}function Fp(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...E(t)})}function Lp(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...E(t)})}function Hp(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...E(t)})}function Yp(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...E(t)})}function Kp(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...E(t)})}function Bp(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...E(t)})}function Gp(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...E(t)})}function Jp(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...E(t)})}function Vp(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...E(t)})}function Wp(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...E(t)})}function Xp(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...E(t)})}function Qp(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...E(t)})}function em(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...E(t)})}function tm(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...E(t)})}function rm(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...E(t)})}function Co(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...E(t)})}function qo(e,t){return new e({type:"string",format:"date",check:"string_format",...E(t)})}function No(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...E(t)})}function Ro(e,t){return new e({type:"string",format:"duration",check:"string_format",...E(t)})}function nm(e,t){return new e({type:"number",checks:[],...E(t)})}function om(e,t){return new e({type:"number",coerce:!0,checks:[],...E(t)})}function im(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...E(t)})}function am(e,t){return new e({type:"boolean",...E(t)})}function sm(e,t){return new e({type:"boolean",coerce:!0,...E(t)})}function cm(e,t){return new e({type:"bigint",coerce:!0,...E(t)})}function lm(e,t){return new e({type:"null",...E(t)})}function um(e){return new e({type:"any"})}function dm(e){return new e({type:"unknown"})}function pm(e,t){return new e({type:"never",...E(t)})}function mm(e,t){return new e({type:"date",coerce:!0,...E(t)})}function gr(e,t){return new Ea({check:"less_than",...E(t),value:e,inclusive:!1})}function mt(e,t){return new Ea({check:"less_than",...E(t),value:e,inclusive:!0})}function br(e,t){return new Da({check:"greater_than",...E(t),value:e,inclusive:!1})}function ft(e,t){return new Da({check:"greater_than",...E(t),value:e,inclusive:!0})}function en(e,t){return new od({check:"multiple_of",...E(t),value:e})}function To(e,t){return new ad({check:"max_length",...E(t),maximum:e})}function vr(e,t){return new sd({check:"min_length",...E(t),minimum:e})}function Io(e,t){return new cd({check:"length_equals",...E(t),length:e})}function Ha(e,t){return new ld({check:"string_format",format:"regex",...E(t),pattern:e})}function Ya(e){return new ud({check:"string_format",format:"lowercase",...E(e)})}function Ka(e){return new dd({check:"string_format",format:"uppercase",...E(e)})}function Ba(e,t){return new pd({check:"string_format",format:"includes",...E(t),includes:e})}function Ga(e,t){return new md({check:"string_format",format:"starts_with",...E(t),prefix:e})}function Ja(e,t){return new fd({check:"string_format",format:"ends_with",...E(t),suffix:e})}function zt(e){return new _d({check:"overwrite",tx:e})}function Va(e){return zt(t=>t.normalize(e))}function Wa(){return zt(e=>e.trim())}function Xa(){return zt(e=>e.toLowerCase())}function Qa(){return zt(e=>e.toUpperCase())}function es(){return zt(e=>ua(e))}function fm(e,t,r){return new e({type:"array",element:t,...E(r)})}function _m(e,t,r){let n=E(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}function hm(e,t,r){return new e({type:"custom",check:"custom",fn:t,...E(r)})}function ym(e,t){let r=lv(n=>(n.addIssue=o=>{if(typeof o=="string")n.issues.push(_r(o,n.value,r._zod.def));else{let i=o;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),"input"in i||(i.input=n.value),i.inst??(i.inst=r),i.continue??(i.continue=!r._zod.def.abort),n.issues.push(_r(i))}},e(n.value,n)),t);return r}function lv(e,t){let r=new me({check:"custom",...E(t)});return r._zod.check=e,r}function tn(e,...t){for(let r of t)for(let n of Reflect.ownKeys(r))Object.prototype.propertyIsEnumerable.call(r,n)&&Ie(e,n,r[n]);return e}function rs(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Pt,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??"ref",reused:e?.reused??"inline",intersections:[],deferred:[],external:e?.external??void 0}}function We(e,t,r,n,o){let i=typeof t.unrepresentable=="function"?t.unrepresentable({zodSchema:e,path:n.path,message:o}):t.unrepresentable;if(i==="any")return!1;if(i===void 0||i==="throw")throw new Error(o);return Object.assign(r,i),!0}function se(e,t,r={path:[],schemaPath:[]}){var n;let o=e._zod.def,i=t.seen.get(e);if(i)return i.count++,r.schemaPath.includes(e)&&(i.cycle=r.path),i.schema;let a={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,a),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let s=e._zod.toJSONSchema?.();if(s)a.schema=s;else{let u={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,a.schema,u);else{let m=a.schema,p=t.processors[o.type];if(!p)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);p(e,t,m,u)}let d=e._zod.parent;d&&(a.ref||(a.ref=d),se(d,t,u),t.seen.get(d).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&tn(a.schema,c),t.io==="input"&&we(e)&&(delete a.schema.examples,delete a.schema.default),t.io==="input"&&"_prefault"in a.schema&&((n=a.schema).default??(n.default=a.schema._prefault)),delete a.schema._prefault,t.seen.get(e).schema}function gm(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function ns(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");if(e.external&&e.sharedDefsExtractedFor===e.external)return;let n=new Map;for(let a of e.seen.entries()){let s=e.metadataRegistry.get(a[0])?.id;if(s){let c=n.get(s);if(c&&c!==a[0])throw new Error(`Duplicate schema id "${s}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(s,a[0])}}let o=a=>{let s=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let d=e.external.registry.get(a[0])?.id,m=e.external.uri??(f=>f);if(d)return{ref:m(d)};let p=a[1].defId??a[1].schema.id??`schema${e.counter++}`;return a[1].defId=p,{defId:p,ref:`${m("__shared")}#/${s}/${gm(p)}`}}let c="#",l=`${c}/${s}/`;if(a[1]===r&&!a[1].schema.id)return{ref:c};let u=a[1].schema.id??`__schema${e.counter++}`;return{defId:u,ref:l+gm(u)}},i=a=>{if(a[1].schema.$ref)return;let s=a[1],{ref:c,defId:l}=o(a);s.def={...s.schema},l&&(s.defId=l);let u=s.schema;for(let d in u)delete u[d];u.$ref=c};if(e.cycles==="throw")for(let a of e.seen.entries()){let s=a[1];if(s.cycle)throw new Error(`Cycle detected: #/${s.cycle?.join("/")}/<root>
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let a of e.seen.entries()){let s=a[1];if(t===a[0]){i(a);continue}if(e.external){let l=e.external.registry.get(a[0])?.id;if(t!==a[0]&&l){i(a);continue}}if(e.metadataRegistry.get(a[0])?.id){i(a);continue}if(s.cycle){i(a);continue}s.count>1&&e.reused==="ref"&&i(a)}e.external&&(e.sharedDefsExtractedFor=e.external)}function xm(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let r=[];for(let n of t){if(!n||typeof n!="object")return;xm(n);let o=Object.keys(n);if(o.length!==1||o[0]!=="type")return;let i=n.type;for(let a of Array.isArray(i)?i:[i]){if(typeof a!="string")return;r.includes(a)||r.push(a)}}delete e.anyOf,e.type=r.length===1?r[0]:r}var wm=new Set(["type","properties","required","additionalProperties"]),bm=["oneOf","anyOf"];function vm(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!="object"||t===null?null:Object.keys(t).length?t:null}function ts(e){let t=[];for(let i of e){if(typeof i!="object"||i.type!=="object")return null;for(let a in i)if(!wm.has(a))return null;t.push(i)}let r={},n=new Set;for(let i of t){for(let a in i.properties){if(Object.prototype.hasOwnProperty.call(r,a))continue;let s=[];for(let l of t){let u=l.properties?.[a]??vm(l);u!=null&&(s.some(d=>JSON.stringify(d)===JSON.stringify(u))||s.push(u))}let c=s.length===1?s[0]:ts(s)??{allOf:s};Ie(r,a,c)}for(let a of i.required??[])n.add(a)}let o={type:"object",properties:r};if(n.size&&(o.required=[...n]),t.every(i=>i.additionalProperties===!1))o.additionalProperties=!1;else{let i=[];for(let a of t){let s=vm(a);s&&!i.some(c=>JSON.stringify(c)===JSON.stringify(s))&&i.push(s)}i.length===1?o.additionalProperties=i[0]:i.length>1&&(o.additionalProperties={allOf:i})}return o}function uv(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let o of wm)if(o in e)return;let r=t.filter(o=>bm.some(i=>Array.isArray(o[i]))),n=null;if(!r.length)n=ts(t);else{let o=r[0],i=bm.find(c=>Array.isArray(o[c]));if(Object.keys(o).length!==1)return;let a=t.filter(c=>c!==o),s=o[i].map(c=>ts([...a,c]));if(s.some(c=>!c))return;n={[i]:s}}n&&(delete e.allOf,tn(e,n))}function os(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let n=s=>{let c=e.seen.get(s);if(c.ref===null)return;let l=c.def??c.schema,u={...l},d=c.ref;if(c.ref=null,d){n(d);let p=e.seen.get(d),f=p.schema;if(f.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(l.allOf=l.allOf??[],l.allOf.push(f)):tn(l,f),tn(l,u),s._zod.parent===d)for(let y in l)y==="$ref"||y==="allOf"||y in u||delete l[y];if(f.$ref&&p.def)for(let y in l)y==="$ref"||y==="allOf"||y in p.def&&JSON.stringify(l[y])===JSON.stringify(p.def[y])&&delete l[y]}let m=s._zod.parent;if(m&&m!==d){n(m);let p=e.seen.get(m);if(p?.schema.$ref&&(l.$ref=p.schema.$ref,p.def))for(let f in l)f==="$ref"||f==="allOf"||f in p.def&&JSON.stringify(l[f])===JSON.stringify(p.def[f])&&delete l[f]}e.override({zodSchema:s,jsonSchema:l,path:c.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let s of[...e.seen.entries()].reverse())n(s[0]);if(e.target!=="openapi-3.0")for(let s of e.seen.entries())xm(s[1].def??s[1].schema);for(let s of e.deferred)s();if(e.intersections.length){let s=new Map;for(let c of e.seen.values())for(let l of[c.schema,c.def]){let u=l?.allOf;if(!Array.isArray(u))continue;let d=s.get(u);d?d.push(l):s.set(u,[l])}for(let c of e.intersections)for(let l of s.get(c)??[])uv(l)}}let o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let s=e.external.registry.get(t)?.id;if(!s)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(s)}tn(o,r.defId?r.schema:r.def??r.schema);let i=e.metadataRegistry.get(t)?.id;i!==void 0&&o.id===i&&delete o.id;let a=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let s of e.seen.entries()){let c=s[1];c.def&&c.defId&&(c.def.id===c.defId&&delete c.def.id,Ie(a,c.defId,c.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(a).length>0&&(e.target==="draft-2020-12"?o.$defs=a:o.definitions=a);try{let s=JSON.parse(JSON.stringify(o));return Object.defineProperty(s,"~standard",{value:{...t["~standard"],jsonSchema:{input:rn(t,"input",e.processors),output:rn(t,"output",e.processors)}},enumerable:!1,writable:!1}),s}catch{throw new Error("Error converting schema to JSON.")}}function we(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let n=e._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return we(n.element,r);if(n.type==="set")return we(n.valueType,r);if(n.type==="lazy")return we(n.getter(),r);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault"||n.type==="catch")return we(n.innerType,r);if(n.type==="intersection")return we(n.left,r)||we(n.right,r);if(n.type==="record"||n.type==="map")return we(n.keyType,r)||we(n.valueType,r);if(n.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:we(n.in,r)||we(n.out,r);if(n.type==="object"){for(let o in n.shape)if(we(n.shape[o],r))return!0;return!1}if(n.type==="union"){for(let o of n.options)if(we(o,r))return!0;return!1}if(n.type==="tuple"){for(let o of n.items)if(we(o,r))return!0;return!!(n.rest&&we(n.rest,r))}return!1}var Sm=(e,t={})=>r=>{let n=rs({...r,processors:t});return se(e,n),ns(n,e),os(n,e)},rn=(e,t,r={})=>n=>{let{libraryOptions:o,target:i}=n??{},a=rs({...o??{},target:i,io:t,processors:r});return se(e,a),ns(a,e),os(a,e)};var xr=(e,t,r)=>{(e[t]===void 0||r>e[t])&&(e[t]=r)},wr=(e,t,r)=>{(e[t]===void 0||r<e[t])&&(e[t]=r)},km=(e,t)=>{xr(e,"minimum",t),wr(e,"maximum",t)},zm=(e,t)=>{e.multipleOf??(e.multipleOf=[]),e.multipleOf.includes(t)||e.multipleOf.push(t)},Em=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t)},Dm=(e,t)=>{e.mime=e.mime?e.mime.filter(r=>t.includes(r)):[...t]},Am=(e,t)=>{e.format=t,t.includes("int")&&(e.isInt=!0)},$m=(e,t)=>xr(e,"minimum",t.minimum),Om=(e,t)=>wr(e,"maximum",t.maximum),Pm=e=>(t,r)=>{Am(t,r.format);let[n,o]=e[r.format];xr(t,"minimum",n),wr(t,"maximum",o)},dv={greater_than:(e,t)=>xr(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),less_than:(e,t)=>wr(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),multiple_of:(e,t)=>zm(e,t.value),number_format:Pm(Kr),bigint_format:Pm(mo),min_length:$m,max_length:Om,length_equals:(e,t)=>km(e,t.length),min_size:$m,max_size:Om,size_equals:(e,t)=>km(e,t.size),string_format:(e,t)=>{Am(e,t.format),t.pattern&&Em(e,t.pattern),(t.format==="base64"||t.format==="base64url")&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>Dm(e,t.mime)};function fe(e){let t={},r=e._zod.def,n=e._zod.traits.has("$ZodCheck")?[e,...r.checks??[]]:r.checks??[];for(let i of n)dv[i._zod.def.check]?.(t,i._zod.def);let o=e._zod.bag;o.minimum!==void 0&&xr(t,"minimum",o.minimum),o.exclusiveMinimum!==void 0&&xr(t,"exclusiveMinimum",o.exclusiveMinimum),o.maximum!==void 0&&wr(t,"maximum",o.maximum),o.exclusiveMaximum!==void 0&&wr(t,"exclusiveMaximum",o.exclusiveMaximum),o.multipleOf!==void 0&&zm(t,o.multipleOf),o.format!==void 0&&(t.format??(t.format=o.format),o.format.includes("int")&&(t.isInt=!0)),o.mime&&Dm(t,o.mime);for(let i of o.patterns??[])Em(t,i);return t}var pv={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},mv=new Map([[qa,Hu],[Po,Yu]]),Cm=e=>mv.get(e)??e,qm=(e,t,r,n)=>{let o=r;o.type="string";let{minimum:i,maximum:a,format:s,patterns:c,contentEncoding:l,laxFormat:u}=fe(e);if(typeof i=="number"&&(o.minLength=i),typeof a=="number"&&(o.maxLength=a),s&&(o.format=pv[s]??s,o.format===""&&delete o.format,(s==="time"||u)&&delete o.format),l&&(o.contentEncoding=l),c&&c.size>0){let d=[...c].map(Cm);d.length===1?o.pattern=d[0].source:d.length>1&&(o.allOf=[...d.map(m=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:m.source}))])}},Nm=(e,t,r,n)=>{let o=r,{minimum:i,maximum:a,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=fe(e);o.type=u?"integer":"number";let d=typeof l=="number"&&l>=(i??Number.NEGATIVE_INFINITY),m=typeof c=="number"&&c<=(a??Number.POSITIVE_INFINITY),p=t.target==="draft-04"||t.target==="openapi-3.0";if(d?p?(o.minimum=l,o.exclusiveMinimum=!0):o.exclusiveMinimum=l:typeof i=="number"&&(o.minimum=i),m?p?(o.maximum=c,o.exclusiveMaximum=!0):o.exclusiveMaximum=c:typeof a=="number"&&(o.maximum=a),s){let f=new Set;for(let v of s)Number.isFinite(v)&&v!==0?f.add(Math.abs(v)):We(e,t,o,n,`A multipleOf divisor of ${v} cannot be represented in JSON Schema`);let[h,...y]=f;h!==void 0&&(o.multipleOf=h),y.length&&(o.allOf=[...o.allOf??[],...y.map(v=>({multipleOf:v}))])}},Rm=(e,t,r,n)=>{r.type="boolean"},Tm=(e,t,r,n)=>{We(e,t,r,n,"BigInt cannot be represented in JSON Schema")};var Im=(e,t,r,n)=>{t.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"};var Mm=(e,t,r,n)=>{r.not={}},jm=(e,t,r,n)=>{},Um=(e,t,r,n)=>{},Zm=(e,t,r,n)=>{We(e,t,r,n,"Date cannot be represented in JSON Schema")},Fm=(e,t,r,n)=>{let o=e._zod.def,i=dr(o.entries);if(i.length===0){r.not={};return}i.every(a=>typeof a=="number")&&(r.type="number"),i.every(a=>typeof a=="string")&&(r.type="string"),r.enum=i},Lm=(e,t,r,n)=>{let o=e._zod.def;if(o.values.length===0){r.not={};return}let i=[];for(let a of o.values)if(a===void 0){if(We(e,t,r,n,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof a=="bigint"){if(We(e,t,r,n,"BigInt literals cannot be represented in JSON Schema"))return;i.push(Number(a))}else i.push(a);if(i.length!==0)if(i.length===1){let a=i[0];r.type=a===null?"null":typeof a,t.target==="draft-04"||t.target==="openapi-3.0"?r.enum=[a]:r.const=a}else i.every(a=>typeof a=="number")&&(r.type="number"),i.every(a=>typeof a=="string")&&(r.type="string"),i.every(a=>typeof a=="boolean")&&(r.type="boolean"),i.every(a=>a===null)&&(r.type="null"),r.enum=i};var Hm=(e,t,r,n)=>{We(e,t,r,n,"Custom types cannot be represented in JSON Schema")};var Ym=(e,t,r,n)=>{We(e,t,r,n,"Transforms cannot be represented in JSON Schema")};var Km=(e,t,r,n)=>{let o=r,i=e._zod.def,{minimum:a,maximum:s}=fe(e);typeof a=="number"&&(o.minItems=a),typeof s=="number"&&(o.maxItems=s),o.type="array",o.items=se(i.element,t,{...n,path:[...n.path,"items"]})};function Mo(e){let t=e._zod.def;return t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform")?Mo(t.out):t.type==="catch"?Mo(t.innerType):e._zod.optin}var Bm=(e,t,r,n)=>{let o=r,i=e._zod.def,a=i.shape;if(Object.getOwnPropertySymbols(a).length&&We(e,t,o,n,"Symbol keys cannot be represented in JSON Schema"))return;o.type="object",o.properties={};for(let u in a)Ie(o.properties,u,se(a[u],t,{...n,path:[...n.path,"properties",u]}));let c=new Set(Object.keys(a)),l=new Set([...c].filter(u=>{let d=i.shape[u];return t.io==="input"?Mo(d)===void 0:d._zod.optout===void 0}));l.size>0&&(o.required=Array.from(l)),i.catchall?._zod.def.type==="never"?o.additionalProperties=!1:i.catchall?i.catchall&&(o.additionalProperties=se(i.catchall,t,{...n,path:[...n.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=!1)};var Gm=(e,t,r,n)=>{let o=e._zod.def,i=o.inclusive===!1,a=o.options.map((s,c)=>se(s,t,{...n,path:[...n.path,i?"oneOf":"anyOf",c]}));i?r.oneOf=a:r.anyOf=a},Jm=(e,t,r,n)=>{let o=e._zod.def,i=se(o.left,t,{...n,path:[...n.path,"allOf",0]}),a=se(o.right,t,{...n,path:[...n.path,"allOf",1]}),s=l=>"allOf"in l&&Object.keys(l).length===1,c=[...s(i)?i.allOf:[i],...s(a)?a.allOf:[a]];r.allOf=c,t.intersections.push(c)};function is(e,t,r){if(t.$ref){if(r.has(t))return t;r.add(t);let f=e.get(t)?.def;if(!f)return t;let h=is(e,f,r);return h===f?t:h}for(let f of["anyOf","oneOf"]){let h=t[f];if(!Array.isArray(h))continue;let y=h.map(v=>is(e,v,r));y.some((v,w)=>v!==h[w])&&(t={...t,[f]:y})}let n=Array.isArray(t.type)?t.type:[t.type],o=!n.includes("string")&&n.some(f=>f==="number"||f==="integer"),i=t.enum??(t.const!==void 0?[t.const]:void 0);if(!o&&!i?.some(f=>typeof f=="number"))return t;let{minimum:a,maximum:s,exclusiveMinimum:c,exclusiveMaximum:l,multipleOf:u,format:d,id:m,...p}=t;return p.enum?p.enum=p.enum.map(f=>typeof f=="number"?String(f):f):typeof p.const=="number"&&(p.const=String(p.const)),o&&(p.type="string",i||(p.pattern=(n.includes("number")?Vr:Pa).source)),p}var as=new WeakMap;function fv(e){let t=new Map;for(let n of e.seen.values())n.def&&!t.has(n.schema)&&t.set(n.schema,n);let r=new Map;for(let n of as.get(e)??[]){let o=e.seen.get(n),i=(o?.def??o?.schema)?.propertyNames;if(!i||i===!0||r.has(i))continue;let a=is(t,i,new Set);a!==i&&r.set(i,a)}if(r.size)for(let n of e.seen.values())for(let o of[n.schema,n.def]){let i=o&&r.get(o.propertyNames);i&&(o.propertyNames=i)}}var Vm=(e,t,r,n)=>{let o=r,i=e._zod.def;o.type="object";let a=i.keyType,s=fe(a).patterns;if(i.mode==="loose"&&s&&s.size>0){let u=se(i.valueType,t,{...n,path:[...n.path,"patternProperties","*"]});o.patternProperties={};for(let d of s)Ie(o.patternProperties,Cm(d).source,u)}else{if(t.target==="draft-07"||t.target==="draft-2020-12"){o.propertyNames=se(i.keyType,t,{...n,path:[...n.path,"propertyNames"]});let u=as.get(t);u||(u=[],as.set(t,u),t.deferred.push(()=>fv(t))),u.push(e)}o.additionalProperties=se(i.valueType,t,{...n,path:[...n.path,"additionalProperties"]})}let c=a._zod.values,l=t.io==="input"&&Mo(i.valueType)!==void 0;if(c&&!i.partial&&!l){let u=[...c].filter(d=>typeof d=="string"||typeof d=="number");u.length>0&&(o.required=u.map(String))}},Wm=(e,t,r,n)=>{let o=e._zod.def,i=se(o.innerType,t,n),a=t.seen.get(e);t.target==="openapi-3.0"?(a.ref=o.innerType,r.nullable=!0):r.anyOf=[i,{type:"null"}]},Xm=(e,t,r,n)=>{let o=e._zod.def;se(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType},ss=Symbol();function Qm(e,t,r,n,o){let i=!1,a=JSON.stringify(e,(s,c)=>typeof c!="bigint"?c:(i=!0,null));return i?(We(t,r,n,o,"BigInt defaults cannot be represented in JSON Schema"),ss):JSON.parse(a)}var ef=(e,t,r,n)=>{let o=e._zod.def;se(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType;let a=Qm(o.defaultValue,e,t,r,n);a!==ss&&(r.default=a)},tf=(e,t,r,n)=>{let o=e._zod.def;se(o.innerType,t,n);let i=t.seen.get(e);if(i.ref=o.innerType,t.io!=="input")return;let a=Qm(o.defaultValue,e,t,r,n);a!==ss&&(r._prefault=a)},rf=(e,t,r,n)=>{let o=e._zod.def;se(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType;let a;try{a=o.catchValue(void 0)}catch{We(e,t,r,n,"Dynamic catch values are not supported in JSON Schema");return}r.default=a},nf=(e,t,r,n)=>{let o=e._zod.def,i=o.in._zod.traits.has("$ZodTransform"),a=t.io==="input"?i?o.out:o.in:o.out;se(a,t,n);let s=t.seen.get(e);s.ref=a},of=(e,t,r,n)=>{let o=e._zod.def;se(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType,r.readOnly=!0};var cs=(e,t,r,n)=>{let o=e._zod.def;se(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType};function jo(e){return!!e._zod}function Xe(e,t){return jo(e)?ka(e,t):e.safeParse(t)}function Uo(e){if(!e)return;let t;if(jo(e)?t=e._zod?.def?.shape:t=e.shape,!!t){if(typeof t=="function")try{return t()}catch{return}return t}}function Zo(e){if(jo(e)){let i=e._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 r=e._def;if(r){if(r.value!==void 0)return r.value;if(Array.isArray(r.values)&&r.values.length>0)return r.values[0]}let n=e.value;if(n!==void 0)return n}var af=new WeakSet([Object.prototype,Error.prototype]);function Fo(e,t,r){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let n=r(this);return Object.defineProperty(this,t,{value:n,configurable:!0,writable:!0}),n},set(n){Object.defineProperty(this,t,{value:n,configurable:!0,writable:!0})}})}var Sv=(e,t)=>{gu.init(e,t),e.name="ZodError";let r=Object.getPrototypeOf(e);af.has(r)||(af.add(r),Fo(r,"format",n=>o=>Sa(n,o)),Fo(r,"flatten",n=>o=>wa(n,o)),Fo(r,"addIssue",n=>o=>{n.issues.push(o),n.message=JSON.stringify(n.issues,pr,2)}),Fo(r,"addIssues",n=>o=>{n.issues.push(...o),n.message=JSON.stringify(n.issues,pr,2)}),Object.defineProperty(r,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))};var Me=g("ZodError",Sv,void 0,{Parent:Error});var sf=yo(Me),cf=go(Me),lf=Jr(Me),uf=bo(Me),df=xu(Me),pf=wu(Me),mf=Su(Me),ff=ku(Me),_f=$u(Me),hf=Ou(Me),yf=Pu(Me),gf=zu(Me);function $v(){Ee.localeError||De(Ap())}function Ho(){Ee.memoizer||De({memoizer:Za()})}var G=g("ZodType",(e,t)=>($v(),K.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(C.mergeDefs(t,{checks:[...t.checks??[],...e.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return Ze(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(p0(e,t))},superRefine(e,t){return this.check(m0(e,t))},overwrite(e){return this.check(zt(e))},optional(){return ie(this)},exactOptional(){return e0(this)},nullable(){return xf(this)},nullish(){return ie(xf(this))},nonoptional(e){return a0(this,e)},array(){return k(this)},or(e){return ee([this,e])},and(e){return Ko(this,e)},transform(e){return wf(this,Cf(e))},default(e){return n0(this,e)},prefault(e){return i0(this,e)},catch(e){return c0(this,e)},pipe(e){return wf(this,e)},readonly(){return d0(this)},describe(e){let t=this.clone();return Pt.add(t,{description:e}),t},meta(...e){if(e.length===0)return Pt.get(this);let t=this.clone();return Pt.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return C.hide(this,"~standard",{...Ca(this),jsonSchema:{input:rn(this,"input"),output:rn(this,"output")}})},set"~standard"(e){C.own(this,"~standard",e)},parse:function e(t,r){return sf(this,t,r,{callee:e})},parseAsync:async function e(t,r){return await cf(this,t,r,{callee:e})},safeParse(e,t){return lf(this,e,t)},async safeParseAsync(e,t){return uf(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){C.own(this,"spa",e)},validate(e,t){return vo(this,e,t)},validateAsync(e,t){return xo(this,e,t)},encode:function e(t,r){return df(this,t,r,{callee:e})},decode:function e(t,r){return pf(this,t,r,{callee:e})},encodeAsync:async function e(t,r){return await mf(this,t,r,{callee:e})},decodeAsync:async function e(t,r){return await ff(this,t,r,{callee:e})},safeEncode(e,t){return _f(this,e,t)},safeDecode(e,t){return hf(this,e,t)},async safeEncodeAsync(e,t){return yf(this,e,t)},async safeDecodeAsync(e,t){return gf(this,e,t)},toJSONSchema(e){return Sm(this,{})(e)},get description(){return Pt.get(this)?.description},get _def(){return this._zod.def}}),Sf=g("_ZodString",(e,t)=>{Oo.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,n,o)=>qm(e,r,n,o)},C.derived({format:e=>fe(e).format??null,minLength:e=>fe(e).minimum??null,maxLength:e=>fe(e).maximum??null},{regex(...e){return this.check(Ha(...e))},includes(...e){return this.check(Ba(...e))},startsWith(...e){return this.check(Ga(...e))},endsWith(...e){return this.check(Ja(...e))},min(...e){return this.check(vr(...e))},max(...e){return this.check(To(...e))},length(...e){return this.check(Io(...e))},nonempty(...e){return this.check(vr(1,...e))},lowercase(e){return this.check(Ya(e))},uppercase(e){return this.check(Ka(e))},trim(){return this.check(Wa())},normalize(...e){return this.check(Va(...e))},toLowerCase(){return this.check(Xa())},toUpperCase(){return this.check(Qa())},slugify(){return this.check(es())}})),us=g("ZodString",(e,t)=>{Oo.init(e,t),Sf.init(e,t)},{email(e){return this.check(Tp(Ov,e))},url(e){return this.check(La(kf,e))},jwt(e){return this.check(rm(Fv,e))},emoji(e){return this.check(Fp(zv,e))},guid(e){return this.check(Ip(Pv,e))},uuid(e){return this.check(Mp(Lo,e))},uuidv4(e){return this.check(jp(Lo,e))},uuidv6(e){return this.check(Up(Lo,e))},uuidv7(e){return this.check(Zp(Lo,e))},nanoid(e){return this.check(Lp(Ev,e))},cuid(e){return this.check(Hp(Dv,e))},cuid2(e){return this.check(Yp(Av,e))},ulid(e){return this.check(Kp(Cv,e))},base64(e){return this.check(Qp(jv,e))},base64url(e){return this.check(em(Uv,e))},xid(e){return this.check(Bp(qv,e))},ksuid(e){return this.check(Gp(Nv,e))},ipv4(e){return this.check(Jp(Rv,e))},ipv6(e){return this.check(Vp(Tv,e))},cidrv4(e){return this.check(Wp(Iv,e))},cidrv6(e){return this.check(Xp(Mv,e))},e164(e){return this.check(tm(Zv,e))},datetime(e){return this.check(Co(nn,e))},date(e){return this.check(qo(on,e))},time(e){return this.check(No(an,e))},duration(e){return this.check(Ro(sn,e))}});function _(e){return Np(us,e)}var ae=g("ZodStringFormat",(e,t)=>{Q.init(e,t),Sf.init(e,t)}),nn=g("ZodISODateTime",(e,t)=>{Zd.init(e,t),ae.init(e,t)}),on=g("ZodISODate",(e,t)=>{Fd.init(e,t),ae.init(e,t)}),an=g("ZodISOTime",(e,t)=>{Ld.init(e,t),ae.init(e,t)}),sn=g("ZodISODuration",(e,t)=>{Hd.init(e,t),ae.init(e,t)}),Ov=g("ZodEmail",(e,t)=>{Dd.init(e,t),ae.init(e,t)});var Pv=g("ZodGUID",(e,t)=>{zd.init(e,t),ae.init(e,t)});var Lo=g("ZodUUID",(e,t)=>{Ed.init(e,t),ae.init(e,t)});var kf=g("ZodURL",(e,t)=>{qd.init(e,t),ae.init(e,t)});function $f(e){return La(kf,e)}var zv=g("ZodEmoji",(e,t)=>{Nd.init(e,t),ae.init(e,t)});var Ev=g("ZodNanoID",(e,t)=>{Rd.init(e,t),ae.init(e,t)});var Dv=g("ZodCUID",(e,t)=>{Td.init(e,t),ae.init(e,t)});var Av=g("ZodCUID2",(e,t)=>{Id.init(e,t),ae.init(e,t)});var Cv=g("ZodULID",(e,t)=>{Md.init(e,t),ae.init(e,t)});var qv=g("ZodXID",(e,t)=>{jd.init(e,t),ae.init(e,t)});var Nv=g("ZodKSUID",(e,t)=>{Ud.init(e,t),ae.init(e,t)});var Rv=g("ZodIPv4",(e,t)=>{Yd.init(e,t),ae.init(e,t)});var Tv=g("ZodIPv6",(e,t)=>{Bd.init(e,t),ae.init(e,t)});var Iv=g("ZodCIDRv4",(e,t)=>{Gd.init(e,t),ae.init(e,t)});var Mv=g("ZodCIDRv6",(e,t)=>{Jd.init(e,t),ae.init(e,t)});var jv=g("ZodBase64",(e,t)=>{Wd.init(e,t),ae.init(e,t)});var Uv=g("ZodBase64URL",(e,t)=>{Xd.init(e,t),ae.init(e,t)});var Zv=g("ZodE164",(e,t)=>{Qd.init(e,t),ae.init(e,t)});var Fv=g("ZodJWT",(e,t)=>{ep.init(e,t),ae.init(e,t)});var Yo=g("ZodNumber",(e,t)=>{Na.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Nm(e,r,n,o),e.isFinite=!0},C.derived({minValue:e=>{let{minimum:t,exclusiveMinimum:r}=fe(e);return Math.max(t??Number.NEGATIVE_INFINITY,r??Number.NEGATIVE_INFINITY)},maxValue:e=>{let{maximum:t,exclusiveMaximum:r}=fe(e);return Math.min(t??Number.POSITIVE_INFINITY,r??Number.POSITIVE_INFINITY)},isInt:e=>{let{isInt:t,multipleOf:r}=fe(e);return!!t||!!r?.some(Number.isSafeInteger)},format:e=>fe(e).format??null},{gt(e,t){return this.check(br(e,t))},gte(e,t){return this.check(ft(e,t))},min(e,t){return this.check(ft(e,t))},lt(e,t){return this.check(gr(e,t))},lte(e,t){return this.check(mt(e,t))},max(e,t){return this.check(mt(e,t))},int(e){return this.check(bf(e))},safe(e){return this.check(bf(e))},positive(e){return this.check(br(0,e))},nonnegative(e){return this.check(ft(0,e))},negative(e){return this.check(gr(0,e))},nonpositive(e){return this.check(mt(0,e))},multipleOf(e,t){return this.check(en(e,t))},step(e,t){return this.check(en(e,t))},finite(){return this}}));function L(e){return nm(Yo,e)}var Lv=g("ZodNumberFormat",(e,t)=>{tp.init(e,t),Yo.init(e,t)});function bf(e){return im(Lv,e)}var ds=g("ZodBoolean",(e,t)=>{rp.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Rm(e,r,n,o)});function J(e){return am(ds,e)}var Of=g("ZodBigInt",(e,t)=>{np.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Tm(e,r,n,o)},C.derived({minValue:e=>fe(e).minimum??null,maxValue:e=>fe(e).maximum??null,format:e=>fe(e).format??null},{gte(e,t){return this.check(ft(e,t))},min(e,t){return this.check(ft(e,t))},gt(e,t){return this.check(br(e,t))},lt(e,t){return this.check(gr(e,t))},lte(e,t){return this.check(mt(e,t))},max(e,t){return this.check(mt(e,t))},positive(e){return this.check(br(BigInt(0),e))},negative(e){return this.check(gr(BigInt(0),e))},nonpositive(e){return this.check(mt(BigInt(0),e))},nonnegative(e){return this.check(ft(BigInt(0),e))},multipleOf(e,t){return this.check(en(e,t))}}));var Hv=g("ZodNull",(e,t)=>{op.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Im(e,r,n,o)});function Pf(e){return lm(Hv,e)}var Yv=g("ZodAny",(e,t)=>{ip.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,n,o)=>jm(e,r,n,o)});function zf(){return um(Yv)}var Kv=g("ZodUnknown",(e,t)=>{ap.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Um(e,r,n,o)});function oe(){return dm(Kv)}var Bv=g("ZodNever",(e,t)=>{sp.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Mm(e,r,n,o)});function Gv(e){return pm(Bv,e)}var Ef=g("ZodDate",(e,t)=>{cp.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Zm(e,r,n,o),e.min=(r,n)=>e.check(ft(r,n)),e.max=(r,n)=>e.check(mt(r,n))},C.derived({minDate:e=>{let{minimum:t}=fe(e);return t?new Date(t):null},maxDate:e=>{let{maximum:t}=fe(e);return t?new Date(t):null}},{}));var Jv=g("ZodArray",(e,t)=>{Ho(),lp.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Km(e,r,n,o),e.element=t.element},{min(e,t){return this.check(vr(e,t))},nonempty(e){return this.check(vr(1,e))},max(e,t){return this.check(To(e,t))},length(e,t){return this.check(Io(e,t))},unwrap(){return this.element}});function k(e,t){return fm(Jv,e,t)}var Df=g("ZodObject",(e,t)=>{Ho(),pp.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Bm(e,r,n,o),C.installLazyProp(e,"shape",r=>r._zod.def.shape,!1)},{keyof(){return Ae(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(C.mergeDefs(this._zod.def,{catchall:e}))},passthrough(){return this.clone(C.mergeDefs(this._zod.def,{catchall:oe()}))},loose(){return this.clone(C.mergeDefs(this._zod.def,{catchall:oe()}))},strict(){return this.clone(C.mergeDefs(this._zod.def,{catchall:Gv()}))},strip(){return this.clone(C.mergeDefs(this._zod.def,{catchall:void 0}))},extend(e){return C.extend(this,e)},safeExtend(e){return C.safeExtend(this,e)},merge(e){return C.merge(this,e)},pick(e){return C.pick(this,e)},omit(e){return C.omit(this,e)},partial(...e){return C.partial(qf,this,e[0])},exactPartial(...e){return C.partial(Nf,this,e[0],"exactPartial")},required(...e){return C.required(Rf,this,e[0])}});function $(e,t){let r={type:"object",shape:e??{},...C.normalizeParams(t)};return new Df(r)}function ue(e,t){return new Df({type:"object",shape:e,catchall:oe(),...C.normalizeParams(t)})}var Af=g("ZodUnion",(e,t)=>{Ra.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Gm(e,r,n,o),e.options=t.options});function ee(e,t){return new Af({type:"union",options:e,...C.normalizeParams(t)})}var Vv=g("ZodDiscriminatedUnion",(e,t)=>{Af.init(e,t),mp.init(e,t)});function ps(e,t,r){return new Vv({type:"union",options:t,discriminator:e,...C.normalizeParams(r)})}var Wv=g("ZodIntersection",(e,t)=>{fp.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Jm(e,r,n,o)});function Ko(e,t){return new Wv({type:"intersection",left:e,right:t})}var vf=g("ZodRecord",(e,t)=>{Ho(),_p.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Vm(e,r,n,o),e.keyType=t.keyType,e.valueType=t.valueType});function W(e,t,r){return!t||!t._zod?new vf({type:"record",keyType:_(),valueType:e,...C.normalizeParams(t)}):new vf({type:"record",keyType:e,valueType:t,...C.normalizeParams(r)})}var ls=g("ZodEnum",(e,t)=>{hp.init(e,t),G.init(e,t),e._zod.processJSONSchema=(n,o,i)=>Fm(e,n,o,i),e.enum=t.entries,e.options=[...e._zod.values];let r=new Set(Object.keys(t.entries));e.extract=(n,o)=>{let i={};for(let a of n)if(r.has(a))i[a]=t.entries[a];else throw new Error(`Key ${a} not found in enum`);return new ls({...t,checks:[],...C.normalizeParams(o),entries:i})},e.exclude=(n,o)=>{let i={...t.entries};for(let a of n)if(r.has(a))delete i[a];else throw new Error(`Key ${a} not found in enum`);return new ls({...t,checks:[],...C.normalizeParams(o),entries:i})}});function Ae(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new ls({type:"enum",entries:r,...C.normalizeParams(t)})}var Xv=g("ZodLiteral",(e,t)=>{yp.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Lm(e,r,n,o),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function P(e,t){return new Xv({type:"literal",values:Array.isArray(e)?e:[e],...C.normalizeParams(t)})}var Qv=g("ZodTransform",(e,t)=>{Ho(),gp.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ym(e,r,n,o),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new hr(e.constructor.name);r.addIssue=i=>{if(typeof i=="string")r.issues.push(C.issue(i,r.value,t));else{let a=i;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),"input"in a||(a.input=r.value),a.inst??(a.inst=e),r.issues.push(C.issue(a))}};let o=t.transform(r.value,r);return o instanceof Promise?o.then(i=>(r.value=i,r)):(r.value=o,r)}});function Cf(e){return new Qv({type:"transform",transform:e})}var qf=g("ZodOptional",(e,t)=>{Ta.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,n,o)=>cs(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function ie(e){return new qf({type:"optional",innerType:e})}var Nf=g("ZodExactOptional",(e,t)=>{bp.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,n,o)=>cs(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function e0(e){return new Nf({type:"optional",innerType:e})}var t0=g("ZodNullable",(e,t)=>{vp.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Wm(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function xf(e){return new t0({type:"nullable",innerType:e})}var r0=g("ZodDefault",(e,t)=>{xp.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ef(e,r,n,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function n0(e,t){return new r0({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():C.shallowClone(t)}})}var o0=g("ZodPrefault",(e,t)=>{wp.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,n,o)=>tf(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function i0(e,t){return new o0({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():C.shallowClone(t)}})}var Rf=g("ZodNonOptional",(e,t)=>{Sp.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Xm(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function a0(e,t){return new Rf({type:"nonoptional",innerType:e,...C.normalizeParams(t)})}var s0=g("ZodCatch",(e,t)=>{kp.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,n,o)=>rf(e,r,n,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function c0(e,t){return new s0({type:"catch",innerType:e,catchValue:typeof t=="function"?t:C.constantCatch(t)})}var Tf=g("ZodPipe",(e,t)=>{Ia.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,n,o)=>nf(e,r,n,o),e.in=t.in,e.out=t.out});function wf(e,t){return new Tf({type:"pipe",in:e,out:t})}var l0=g("ZodPreprocess",(e,t)=>{Tf.init(e,t),$p.init(e,t)}),u0=g("ZodReadonly",(e,t)=>{Op.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,n,o)=>of(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function d0(e){return new u0({type:"readonly",innerType:e})}var If=g("ZodCustom",(e,t)=>{Pp.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Hm(e,r,n,o)});function Mf(e,t){return _m(If,e??(()=>!0),t)}function p0(e,t={}){return hm(If,e,t)}function m0(e,t){return ym(e,t)}function ms(e,t){return new l0({type:"pipe",in:Cf(e),out:t})}var Uf={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"};var jf;jf||(jf={});var Bo={};co(Bo,{ZodISODate:()=>on,ZodISODateTime:()=>nn,ZodISODuration:()=>sn,ZodISOTime:()=>an,date:()=>h0,datetime:()=>_0,duration:()=>g0,time:()=>y0});function _0(e){return Co(nn,e)}function h0(e){return qo(on,e)}function y0(e){return No(an,e)}function g0(e){return Ro(sn,e)}var Go={};co(Go,{bigint:()=>w0,boolean:()=>x0,date:()=>S0,number:()=>v0,string:()=>b0});function b0(e){return Rp(us,e)}function v0(e){return om(Yo,e)}function x0(e){return sm(ds,e)}function w0(e){return cm(Of,e)}function S0(e){return mm(Ef,e)}var $r="2025-11-25";var Zf=[$r,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],Et="io.modelcontextprotocol/related-task",Vo="2.0",de=Mf(e=>e!==null&&(typeof e=="object"||typeof e=="function")),Ff=ee([_(),L().int()]),Lf=_(),YD=ue({ttl:L().optional(),pollInterval:L().optional()}),$0=$({ttl:L().optional()}),O0=$({taskId:_()}),_s=ue({progressToken:Ff.optional(),[Et]:O0.optional()}),je=$({_meta:_s.optional()}),cn=je.extend({task:$0.optional()}),Hf=e=>cn.safeParse(e).success,_e=$({method:_(),params:je.loose().optional()}),Fe=$({_meta:_s.optional()}),Le=$({method:_(),params:Fe.loose().optional()}),he=ue({_meta:_s.optional()}),Wo=ee([_(),L().int()]),Yf=$({jsonrpc:P(Vo),id:Wo,..._e.shape}).strict(),ln=e=>Yf.safeParse(e).success,Kf=$({jsonrpc:P(Vo),...Le.shape}).strict(),Bf=e=>Kf.safeParse(e).success,hs=$({jsonrpc:P(Vo),id:Wo,result:he}).strict(),Ft=e=>hs.safeParse(e).success;var N;(function(e){e[e.ConnectionClosed=-32e3]="ConnectionClosed",e[e.RequestTimeout=-32001]="RequestTimeout",e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError",e[e.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(N||(N={}));var ys=$({jsonrpc:P(Vo),id:Wo.optional(),error:$({code:L().int(),message:_(),data:oe().optional()})}).strict();var Gf=e=>ys.safeParse(e).success;var Xo=ee([Yf,Kf,hs,ys]),KD=ee([hs,ys]),Lt=he.strict(),P0=Fe.extend({requestId:Wo.optional(),reason:_().optional()}),Qo=Le.extend({method:P("notifications/cancelled"),params:P0}),z0=$({src:_(),mimeType:_().optional(),sizes:k(_()).optional(),theme:Ae(["light","dark"]).optional()}),un=$({icons:k(z0).optional()}),kr=$({name:_(),title:_().optional()}),Jf=kr.extend({...kr.shape,...un.shape,version:_(),websiteUrl:_().optional(),description:_().optional()}),E0=Ko($({applyDefaults:J().optional()}),W(_(),oe())),D0=ms(e=>e&&typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,Ko($({form:E0.optional(),url:de.optional()}),W(_(),oe()).optional())),A0=ue({list:de.optional(),cancel:de.optional(),requests:ue({sampling:ue({createMessage:de.optional()}).optional(),elicitation:ue({create:de.optional()}).optional()}).optional()}),C0=ue({list:de.optional(),cancel:de.optional(),requests:ue({tools:ue({call:de.optional()}).optional()}).optional()}),q0=$({experimental:W(_(),de).optional(),sampling:$({context:de.optional(),tools:de.optional()}).optional(),elicitation:D0.optional(),roots:$({listChanged:J().optional()}).optional(),tasks:A0.optional(),extensions:W(_(),de).optional()}),N0=je.extend({protocolVersion:_(),capabilities:q0,clientInfo:Jf}),R0=_e.extend({method:P("initialize"),params:N0});var T0=$({experimental:W(_(),de).optional(),logging:de.optional(),completions:de.optional(),prompts:$({listChanged:J().optional()}).optional(),resources:$({subscribe:J().optional(),listChanged:J().optional()}).optional(),tools:$({listChanged:J().optional()}).optional(),tasks:C0.optional(),extensions:W(_(),de).optional()}),gs=he.extend({protocolVersion:_(),capabilities:T0,serverInfo:Jf,instructions:_().optional()}),Vf=Le.extend({method:P("notifications/initialized"),params:Fe.optional()}),Wf=e=>Vf.safeParse(e).success,ei=_e.extend({method:P("ping"),params:je.optional()}),I0=$({progress:L(),total:ie(L()),message:ie(_())}),M0=$({...Fe.shape,...I0.shape,progressToken:Ff}),ti=Le.extend({method:P("notifications/progress"),params:M0}),j0=je.extend({cursor:Lf.optional()}),dn=_e.extend({params:j0.optional()}),pn=he.extend({nextCursor:Lf.optional()}),U0=Ae(["working","input_required","completed","failed","cancelled"]),mn=$({taskId:_(),status:U0,ttl:ee([L(),Pf()]),createdAt:_(),lastUpdatedAt:_(),pollInterval:ie(L()),statusMessage:ie(_())}),Ht=he.extend({task:mn}),Z0=Fe.merge(mn),fn=Le.extend({method:P("notifications/tasks/status"),params:Z0}),ri=_e.extend({method:P("tasks/get"),params:je.extend({taskId:_()})}),ni=he.merge(mn),oi=_e.extend({method:P("tasks/result"),params:je.extend({taskId:_()})}),BD=he.loose(),ii=dn.extend({method:P("tasks/list")}),ai=pn.extend({tasks:k(mn)}),si=_e.extend({method:P("tasks/cancel"),params:je.extend({taskId:_()})}),Xf=he.merge(mn),Qf=$({uri:_(),mimeType:ie(_()),_meta:W(_(),oe()).optional()}),e_=Qf.extend({text:_()}),bs=_().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),t_=Qf.extend({blob:bs}),_n=Ae(["user","assistant"]),Or=$({audience:k(_n).optional(),priority:L().min(0).max(1).optional(),lastModified:Bo.datetime({offset:!0}).optional()}),r_=$({...kr.shape,...un.shape,uri:_(),description:ie(_()),mimeType:ie(_()),size:ie(L()),annotations:Or.optional(),_meta:ie(ue({}))}),F0=$({...kr.shape,...un.shape,uriTemplate:_(),description:ie(_()),mimeType:ie(_()),annotations:Or.optional(),_meta:ie(ue({}))}),L0=dn.extend({method:P("resources/list")}),vs=pn.extend({resources:k(r_)}),H0=dn.extend({method:P("resources/templates/list")}),xs=pn.extend({resourceTemplates:k(F0)}),ws=je.extend({uri:_()}),Y0=ws,K0=_e.extend({method:P("resources/read"),params:Y0}),Ss=he.extend({contents:k(ee([e_,t_]))}),ks=Le.extend({method:P("notifications/resources/list_changed"),params:Fe.optional()}),B0=ws,G0=_e.extend({method:P("resources/subscribe"),params:B0}),J0=ws,V0=_e.extend({method:P("resources/unsubscribe"),params:J0}),W0=Fe.extend({uri:_()}),X0=Le.extend({method:P("notifications/resources/updated"),params:W0}),Q0=$({name:_(),description:ie(_()),required:ie(J())}),ex=$({...kr.shape,...un.shape,description:ie(_()),arguments:ie(k(Q0)),_meta:ie(ue({}))}),tx=dn.extend({method:P("prompts/list")}),$s=pn.extend({prompts:k(ex)}),rx=je.extend({name:_(),arguments:W(_(),_()).optional()}),nx=_e.extend({method:P("prompts/get"),params:rx}),Os=$({type:P("text"),text:_(),annotations:Or.optional(),_meta:W(_(),oe()).optional()}),Ps=$({type:P("image"),data:bs,mimeType:_(),annotations:Or.optional(),_meta:W(_(),oe()).optional()}),zs=$({type:P("audio"),data:bs,mimeType:_(),annotations:Or.optional(),_meta:W(_(),oe()).optional()}),ox=$({type:P("tool_use"),name:_(),id:_(),input:W(_(),oe()),_meta:W(_(),oe()).optional()}),ix=$({type:P("resource"),resource:ee([e_,t_]),annotations:Or.optional(),_meta:W(_(),oe()).optional()}),ax=r_.extend({type:P("resource_link")}),Es=ee([Os,Ps,zs,ax,ix]),sx=$({role:_n,content:Es}),Ds=he.extend({description:_().optional(),messages:k(sx)}),As=Le.extend({method:P("notifications/prompts/list_changed"),params:Fe.optional()}),cx=$({title:_().optional(),readOnlyHint:J().optional(),destructiveHint:J().optional(),idempotentHint:J().optional(),openWorldHint:J().optional()}),lx=$({taskSupport:Ae(["required","optional","forbidden"]).optional()}),n_=$({...kr.shape,...un.shape,description:_().optional(),inputSchema:$({type:P("object"),properties:W(_(),de).optional(),required:k(_()).optional()}).catchall(oe()),outputSchema:$({type:P("object"),properties:W(_(),de).optional(),required:k(_()).optional()}).catchall(oe()).optional(),annotations:cx.optional(),execution:lx.optional(),_meta:W(_(),oe()).optional()}),ux=dn.extend({method:P("tools/list")}),Cs=pn.extend({tools:k(n_)}),Pr=he.extend({content:k(Es).default([]),structuredContent:W(_(),oe()).optional(),isError:J().optional()}),GD=Pr.or(he.extend({toolResult:oe()})),dx=cn.extend({name:_(),arguments:W(_(),oe()).optional()}),px=_e.extend({method:P("tools/call"),params:dx}),qs=Le.extend({method:P("notifications/tools/list_changed"),params:Fe.optional()}),o_=$({autoRefresh:J().default(!0),debounceMs:L().int().nonnegative().default(300)}),i_=Ae(["debug","info","notice","warning","error","critical","alert","emergency"]),mx=je.extend({level:i_}),fx=_e.extend({method:P("logging/setLevel"),params:mx}),_x=Fe.extend({level:i_,logger:_().optional(),data:oe()}),hx=Le.extend({method:P("notifications/message"),params:_x}),yx=$({name:_().optional()}),gx=$({hints:k(yx).optional(),costPriority:L().min(0).max(1).optional(),speedPriority:L().min(0).max(1).optional(),intelligencePriority:L().min(0).max(1).optional()}),bx=$({mode:Ae(["auto","required","none"]).optional()}),vx=$({type:P("tool_result"),toolUseId:_().describe("The unique identifier for the corresponding tool call."),content:k(Es).default([]),structuredContent:$({}).loose().optional(),isError:J().optional(),_meta:W(_(),oe()).optional()}),xx=ps("type",[Os,Ps,zs]),Jo=ps("type",[Os,Ps,zs,ox,vx]),wx=$({role:_n,content:ee([Jo,k(Jo)]),_meta:W(_(),oe()).optional()}),Sx=cn.extend({messages:k(wx),modelPreferences:gx.optional(),systemPrompt:_().optional(),includeContext:Ae(["none","thisServer","allServers"]).optional(),temperature:L().optional(),maxTokens:L().int(),stopSequences:k(_()).optional(),metadata:de.optional(),tools:k(n_).optional(),toolChoice:bx.optional()}),Ns=_e.extend({method:P("sampling/createMessage"),params:Sx}),Rs=he.extend({model:_(),stopReason:ie(Ae(["endTurn","stopSequence","maxTokens"]).or(_())),role:_n,content:xx}),Ts=he.extend({model:_(),stopReason:ie(Ae(["endTurn","stopSequence","maxTokens","toolUse"]).or(_())),role:_n,content:ee([Jo,k(Jo)])}),kx=$({type:P("boolean"),title:_().optional(),description:_().optional(),default:J().optional()}),$x=$({type:P("string"),title:_().optional(),description:_().optional(),minLength:L().optional(),maxLength:L().optional(),format:Ae(["email","uri","date","date-time"]).optional(),default:_().optional()}),Ox=$({type:Ae(["number","integer"]),title:_().optional(),description:_().optional(),minimum:L().optional(),maximum:L().optional(),default:L().optional()}),Px=$({type:P("string"),title:_().optional(),description:_().optional(),enum:k(_()),default:_().optional()}),zx=$({type:P("string"),title:_().optional(),description:_().optional(),oneOf:k($({const:_(),title:_()})),default:_().optional()}),Ex=$({type:P("string"),title:_().optional(),description:_().optional(),enum:k(_()),enumNames:k(_()).optional(),default:_().optional()}),Dx=ee([Px,zx]),Ax=$({type:P("array"),title:_().optional(),description:_().optional(),minItems:L().optional(),maxItems:L().optional(),items:$({type:P("string"),enum:k(_())}),default:k(_()).optional()}),Cx=$({type:P("array"),title:_().optional(),description:_().optional(),minItems:L().optional(),maxItems:L().optional(),items:$({anyOf:k($({const:_(),title:_()}))}),default:k(_()).optional()}),qx=ee([Ax,Cx]),Nx=ee([Ex,Dx,qx]),Rx=ee([Nx,kx,$x,Ox]),Tx=cn.extend({mode:P("form").optional(),message:_(),requestedSchema:$({type:P("object"),properties:W(_(),Rx),required:k(_()).optional()})}),Ix=cn.extend({mode:P("url"),message:_(),elicitationId:_(),url:_().url()}),Mx=ee([Tx,Ix]),Is=_e.extend({method:P("elicitation/create"),params:Mx}),jx=Fe.extend({elicitationId:_()}),Ux=Le.extend({method:P("notifications/elicitation/complete"),params:jx}),Ms=he.extend({action:Ae(["accept","decline","cancel"]),content:ms(e=>e===null?void 0:e,W(_(),ee([_(),L(),J(),k(_())])).optional())}),Zx=$({type:P("ref/resource"),uri:_()});var Fx=$({type:P("ref/prompt"),name:_()}),Lx=je.extend({ref:ee([Fx,Zx]),argument:$({name:_(),value:_()}),context:$({arguments:W(_(),_()).optional()}).optional()}),Hx=_e.extend({method:P("completion/complete"),params:Lx});var js=he.extend({completion:ue({values:k(_()).max(100),total:ie(L().int()),hasMore:ie(J())})}),Yx=$({uri:_().startsWith("file://"),name:_().optional(),_meta:W(_(),oe()).optional()}),Kx=_e.extend({method:P("roots/list"),params:je.optional()}),Bx=he.extend({roots:k(Yx)}),Gx=Le.extend({method:P("notifications/roots/list_changed"),params:Fe.optional()}),JD=ee([ei,R0,Hx,fx,nx,tx,L0,H0,K0,G0,V0,px,ux,ri,oi,ii,si]),VD=ee([Qo,ti,Vf,Gx,fn]),WD=ee([Lt,Rs,Ts,Ms,Bx,ni,ai,Ht]),XD=ee([ei,Ns,Is,Kx,ri,oi,ii,si]),QD=ee([Qo,ti,hx,X0,ks,qs,As,fn,Ux]),eA=ee([Lt,gs,js,Ds,$s,vs,xs,Ss,Pr,Cs,ni,ai,Ht]),A=class e extends Error{constructor(t,r,n){super(`MCP error ${t}: ${r}`),this.code=t,this.data=n,this.name="McpError"}static fromError(t,r,n){if(t===N.UrlElicitationRequired&&n){let o=n;if(o.elicitations)return new fs(o.elicitations,r)}return new e(t,r,n)}},fs=class extends A{constructor(t,r=`URL elicitation${t.length>1?"s":""} required`){super(N.UrlElicitationRequired,r,{elicitations:t})}get elicitations(){return this.data?.elicitations??[]}};function Dt(e){return e==="completed"||e==="failed"||e==="cancelled"}var qA=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function Us(e){let r=Uo(e)?.method;if(!r)throw new Error("Schema is missing a method literal");let n=Zo(r);if(typeof n!="string")throw new Error("Schema method literal must be a string");return n}function Zs(e,t){let r=Xe(e,t);if(!r.success)throw r.error;return r.data}var ew=6e4,ci=class{constructor(t){this._options=t,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(Qo,r=>{this._oncancel(r)}),this.setNotificationHandler(ti,r=>{this._onprogress(r)}),this.setRequestHandler(ei,r=>({})),this._taskStore=t?.taskStore,this._taskMessageQueue=t?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(ri,async(r,n)=>{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new A(N.InvalidParams,"Failed to retrieve task: Task not found");return{...o}}),this.setRequestHandler(oi,async(r,n)=>{let o=async()=>{let i=r.params.taskId;if(this._taskMessageQueue){let s;for(;s=await this._taskMessageQueue.dequeue(i,n.sessionId);){if(s.type==="response"||s.type==="error"){let c=s.message,l=c.id,u=this._requestResolvers.get(l);if(u)if(this._requestResolvers.delete(l),s.type==="response")u(c);else{let d=c,m=new A(d.error.code,d.error.message,d.error.data);u(m)}else{let d=s.type==="response"?"Response":"Error";this._onerror(new Error(`${d} handler missing for request ${l}`))}continue}await this._transport?.send(s.message,{relatedRequestId:n.requestId})}}let a=await this._taskStore.getTask(i,n.sessionId);if(!a)throw new A(N.InvalidParams,`Task not found: ${i}`);if(!Dt(a.status))return await this._waitForTaskUpdate(i,n.signal),await o();if(Dt(a.status)){let s=await this._taskStore.getTaskResult(i,n.sessionId);return this._clearTaskQueue(i),{...s,_meta:{...s._meta,[Et]:{taskId:i}}}}return await o()};return await o()}),this.setRequestHandler(ii,async(r,n)=>{try{let{tasks:o,nextCursor:i}=await this._taskStore.listTasks(r.params?.cursor,n.sessionId);return{tasks:o,nextCursor:i,_meta:{}}}catch(o){throw new A(N.InvalidParams,`Failed to list tasks: ${o instanceof Error?o.message:String(o)}`)}}),this.setRequestHandler(si,async(r,n)=>{try{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new A(N.InvalidParams,`Task not found: ${r.params.taskId}`);if(Dt(o.status))throw new A(N.InvalidParams,`Cannot cancel task in terminal status: ${o.status}`);await this._taskStore.updateTaskStatus(r.params.taskId,"cancelled","Client cancelled task execution.",n.sessionId),this._clearTaskQueue(r.params.taskId);let i=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!i)throw new A(N.InvalidParams,`Task not found after cancellation: ${r.params.taskId}`);return{_meta:{},...i}}catch(o){throw o instanceof A?o:new A(N.InvalidRequest,`Failed to cancel task: ${o instanceof Error?o.message:String(o)}`)}}))}async _oncancel(t){if(!t.params.requestId)return;this._requestHandlerAbortControllers.get(t.params.requestId)?.abort(t.params.reason)}_setupTimeout(t,r,n,o,i=!1){this._timeoutInfo.set(t,{timeoutId:setTimeout(o,r),startTime:Date.now(),timeout:r,maxTotalTimeout:n,resetTimeoutOnProgress:i,onTimeout:o})}_resetTimeout(t){let r=this._timeoutInfo.get(t);if(!r)return!1;let n=Date.now()-r.startTime;if(r.maxTotalTimeout&&n>=r.maxTotalTimeout)throw this._timeoutInfo.delete(t),A.fromError(N.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:r.maxTotalTimeout,totalElapsed:n});return clearTimeout(r.timeoutId),r.timeoutId=setTimeout(r.onTimeout,r.timeout),!0}_cleanupTimeout(t){let r=this._timeoutInfo.get(t);r&&(clearTimeout(r.timeoutId),this._timeoutInfo.delete(t))}async connect(t){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=t;let r=this.transport?.onclose;this._transport.onclose=()=>{r?.(),this._onclose()};let n=this.transport?.onerror;this._transport.onerror=i=>{n?.(i),this._onerror(i)};let o=this._transport?.onmessage;this._transport.onmessage=(i,a)=>{o?.(i,a),Ft(i)||Gf(i)?this._onresponse(i):ln(i)?this._onrequest(i,a):Bf(i)?this._onnotification(i):this._onerror(new Error(`Unknown message type: ${JSON.stringify(i)}`))},await this._transport.start()}_onclose(){let t=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(let n of this._timeoutInfo.values())clearTimeout(n.timeoutId);this._timeoutInfo.clear();for(let n of this._requestHandlerAbortControllers.values())n.abort();this._requestHandlerAbortControllers.clear();let r=A.fromError(N.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(let n of t.values())n(r)}_onerror(t){this.onerror?.(t)}_onnotification(t){let r=this._notificationHandlers.get(t.method)??this.fallbackNotificationHandler;r!==void 0&&Promise.resolve().then(()=>r(t)).catch(n=>this._onerror(new Error(`Uncaught error in notification handler: ${n}`)))}_onrequest(t,r){let n=this._requestHandlers.get(t.method)??this.fallbackRequestHandler,o=this._transport,i=t.params?._meta?.[Et]?.taskId;if(n===void 0){let u={jsonrpc:"2.0",id:t.id,error:{code:N.MethodNotFound,message:"Method not found"}};i&&this._taskMessageQueue?this._enqueueTaskMessage(i,{type:"error",message:u,timestamp:Date.now()},o?.sessionId).catch(d=>this._onerror(new Error(`Failed to enqueue error response: ${d}`))):o?.send(u).catch(d=>this._onerror(new Error(`Failed to send an error response: ${d}`)));return}let a=new AbortController;this._requestHandlerAbortControllers.set(t.id,a);let s=Hf(t.params)?t.params.task:void 0,c=this._taskStore?this.requestTaskStore(t,o?.sessionId):void 0,l={signal:a.signal,sessionId:o?.sessionId,_meta:t.params?._meta,sendNotification:async u=>{if(a.signal.aborted)return;let d={relatedRequestId:t.id};i&&(d.relatedTask={taskId:i}),await this.notification(u,d)},sendRequest:async(u,d,m)=>{if(a.signal.aborted)throw new A(N.ConnectionClosed,"Request was cancelled");let p={...m,relatedRequestId:t.id};i&&!p.relatedTask&&(p.relatedTask={taskId:i});let f=p.relatedTask?.taskId??i;return f&&c&&await c.updateTaskStatus(f,"input_required"),await this.request(u,d,p)},authInfo:r?.authInfo,requestId:t.id,requestInfo:r?.requestInfo,taskId:i,taskStore:c,taskRequestedTtl:s?.ttl,closeSSEStream:r?.closeSSEStream,closeStandaloneSSEStream:r?.closeStandaloneSSEStream};Promise.resolve().then(()=>{s&&this.assertTaskHandlerCapability(t.method)}).then(()=>n(t,l)).then(async u=>{if(a.signal.aborted)return;let d={result:u,jsonrpc:"2.0",id:t.id};i&&this._taskMessageQueue?await this._enqueueTaskMessage(i,{type:"response",message:d,timestamp:Date.now()},o?.sessionId):await o?.send(d)},async u=>{if(a.signal.aborted)return;let d={jsonrpc:"2.0",id:t.id,error:{code:Number.isSafeInteger(u.code)?u.code:N.InternalError,message:u.message??"Internal error",...u.data!==void 0&&{data:u.data}}};i&&this._taskMessageQueue?await this._enqueueTaskMessage(i,{type:"error",message:d,timestamp:Date.now()},o?.sessionId):await o?.send(d)}).catch(u=>this._onerror(new Error(`Failed to send response: ${u}`))).finally(()=>{this._requestHandlerAbortControllers.get(t.id)===a&&this._requestHandlerAbortControllers.delete(t.id)})}_onprogress(t){let{progressToken:r,...n}=t.params,o=Number(r),i=this._progressHandlers.get(o);if(!i){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(t)}`));return}let a=this._responseHandlers.get(o),s=this._timeoutInfo.get(o);if(s&&a&&s.resetTimeoutOnProgress)try{this._resetTimeout(o)}catch(c){this._responseHandlers.delete(o),this._progressHandlers.delete(o),this._cleanupTimeout(o),a(c);return}i(n)}_onresponse(t){let r=Number(t.id),n=this._requestResolvers.get(r);if(n){if(this._requestResolvers.delete(r),Ft(t))n(t);else{let a=new A(t.error.code,t.error.message,t.error.data);n(a)}return}let o=this._responseHandlers.get(r);if(o===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(t)}`));return}this._responseHandlers.delete(r),this._cleanupTimeout(r);let i=!1;if(Ft(t)&&t.result&&typeof t.result=="object"){let a=t.result;if(a.task&&typeof a.task=="object"){let s=a.task;typeof s.taskId=="string"&&(i=!0,this._taskProgressTokens.set(s.taskId,r))}}if(i||this._progressHandlers.delete(r),Ft(t))o(t);else{let a=A.fromError(t.error.code,t.error.message,t.error.data);o(a)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(t,r,n){let{task:o}=n??{};if(!o){try{yield{type:"result",result:await this.request(t,r,n)}}catch(a){yield{type:"error",error:a instanceof A?a:new A(N.InternalError,String(a))}}return}let i;try{let a=await this.request(t,Ht,n);if(a.task)i=a.task.taskId,yield{type:"taskCreated",task:a.task};else throw new A(N.InternalError,"Task creation did not return a task");for(;;){let s=await this.getTask({taskId:i},n);if(yield{type:"taskStatus",task:s},Dt(s.status)){s.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:i},r,n)}:s.status==="failed"?yield{type:"error",error:new A(N.InternalError,`Task ${i} failed`)}:s.status==="cancelled"&&(yield{type:"error",error:new A(N.InternalError,`Task ${i} was cancelled`)});return}if(s.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:i},r,n)};return}let c=s.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(l=>setTimeout(l,c)),n?.signal?.throwIfAborted()}}catch(a){yield{type:"error",error:a instanceof A?a:new A(N.InternalError,String(a))}}}request(t,r,n){let{relatedRequestId:o,resumptionToken:i,onresumptiontoken:a,task:s,relatedTask:c}=n??{};return new Promise((l,u)=>{let d=w=>{u(w)};if(!this._transport){d(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(t.method),s&&this.assertTaskCapability(t.method)}catch(w){d(w);return}n?.signal?.throwIfAborted();let m=this._requestMessageId++,p={...t,jsonrpc:"2.0",id:m};n?.onprogress&&(this._progressHandlers.set(m,n.onprogress),p.params={...t.params,_meta:{...t.params?._meta||{},progressToken:m}}),s&&(p.params={...p.params,task:s}),c&&(p.params={...p.params,_meta:{...p.params?._meta||{},[Et]:c}});let f=w=>{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(w)}},{relatedRequestId:o,resumptionToken:i,onresumptiontoken:a}).catch(q=>this._onerror(new Error(`Failed to send cancellation: ${q}`)));let S=w instanceof A?w:new A(N.RequestTimeout,String(w));u(S)};this._responseHandlers.set(m,w=>{if(!n?.signal?.aborted){if(w instanceof Error)return u(w);try{let S=Xe(r,w.result);S.success?l(S.data):u(S.error)}catch(S){u(S)}}}),n?.signal?.addEventListener("abort",()=>{f(n?.signal?.reason)});let h=n?.timeout??ew,y=()=>f(A.fromError(N.RequestTimeout,"Request timed out",{timeout:h}));this._setupTimeout(m,h,n?.maxTotalTimeout,y,n?.resetTimeoutOnProgress??!1);let v=c?.taskId;if(v){let w=S=>{let q=this._responseHandlers.get(m);q?q(S):this._onerror(new Error(`Response handler missing for side-channeled request ${m}`))};this._requestResolvers.set(m,w),this._enqueueTaskMessage(v,{type:"request",message:p,timestamp:Date.now()}).catch(S=>{this._cleanupTimeout(m),u(S)})}else this._transport.send(p,{relatedRequestId:o,resumptionToken:i,onresumptiontoken:a}).catch(w=>{this._cleanupTimeout(m),u(w)})})}async getTask(t,r){return this.request({method:"tasks/get",params:t},ni,r)}async getTaskResult(t,r,n){return this.request({method:"tasks/result",params:t},r,n)}async listTasks(t,r){return this.request({method:"tasks/list",params:t},ai,r)}async cancelTask(t,r){return this.request({method:"tasks/cancel",params:t},Xf,r)}async notification(t,r){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(t.method);let n=r?.relatedTask?.taskId;if(n){let s={...t,jsonrpc:"2.0",params:{...t.params,_meta:{...t.params?._meta||{},[Et]:r.relatedTask}}};await this._enqueueTaskMessage(n,{type:"notification",message:s,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(t.method)&&!t.params&&!r?.relatedRequestId&&!r?.relatedTask){if(this._pendingDebouncedNotifications.has(t.method))return;this._pendingDebouncedNotifications.add(t.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(t.method),!this._transport)return;let s={...t,jsonrpc:"2.0"};r?.relatedTask&&(s={...s,params:{...s.params,_meta:{...s.params?._meta||{},[Et]:r.relatedTask}}}),this._transport?.send(s,r).catch(c=>this._onerror(c))});return}let a={...t,jsonrpc:"2.0"};r?.relatedTask&&(a={...a,params:{...a.params,_meta:{...a.params?._meta||{},[Et]:r.relatedTask}}}),await this._transport.send(a,r)}setRequestHandler(t,r){let n=Us(t);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(o,i)=>{let a=Zs(t,o);return Promise.resolve(r(a,i))})}removeRequestHandler(t){this._requestHandlers.delete(t)}assertCanSetRequestHandler(t){if(this._requestHandlers.has(t))throw new Error(`A request handler for ${t} already exists, which would be overridden`)}setNotificationHandler(t,r){let n=Us(t);this._notificationHandlers.set(n,o=>{let i=Zs(t,o);return Promise.resolve(r(i))})}removeNotificationHandler(t){this._notificationHandlers.delete(t)}_cleanupTaskProgressHandler(t){let r=this._taskProgressTokens.get(t);r!==void 0&&(this._progressHandlers.delete(r),this._taskProgressTokens.delete(t))}async _enqueueTaskMessage(t,r,n){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");let o=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(t,r,n,o)}async _clearTaskQueue(t,r){if(this._taskMessageQueue){let n=await this._taskMessageQueue.dequeueAll(t,r);for(let o of n)if(o.type==="request"&&ln(o.message)){let i=o.message.id,a=this._requestResolvers.get(i);a?(a(new A(N.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(i)):this._onerror(new Error(`Resolver missing for request ${i} during task ${t} cleanup`))}}}async _waitForTaskUpdate(t,r){let n=this._options?.defaultTaskPollInterval??1e3;try{let o=await this._taskStore?.getTask(t);o?.pollInterval&&(n=o.pollInterval)}catch{}return new Promise((o,i)=>{if(r.aborted){i(new A(N.InvalidRequest,"Request cancelled"));return}let a=setTimeout(o,n);r.addEventListener("abort",()=>{clearTimeout(a),i(new A(N.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(t,r){let n=this._taskStore;if(!n)throw new Error("No task store configured");return{createTask:async o=>{if(!t)throw new Error("No request provided");return await n.createTask(o,t.id,{method:t.method,params:t.params},r)},getTask:async o=>{let i=await n.getTask(o,r);if(!i)throw new A(N.InvalidParams,"Failed to retrieve task: Task not found");return i},storeTaskResult:async(o,i,a)=>{await n.storeTaskResult(o,i,a,r);let s=await n.getTask(o,r);if(s){let c=fn.parse({method:"notifications/tasks/status",params:s});await this.notification(c),Dt(s.status)&&this._cleanupTaskProgressHandler(o)}},getTaskResult:o=>n.getTaskResult(o,r),updateTaskStatus:async(o,i,a)=>{let s=await n.getTask(o,r);if(!s)throw new A(N.InvalidParams,`Task "${o}" not found - it may have been cleaned up`);if(Dt(s.status))throw new A(N.InvalidParams,`Cannot update task "${o}" from terminal status "${s.status}" to "${i}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await n.updateTaskStatus(o,i,a,r);let c=await n.getTask(o,r);if(c){let l=fn.parse({method:"notifications/tasks/status",params:c});await this.notification(l),Dt(c.status)&&this._cleanupTaskProgressHandler(o)}},listTasks:o=>n.listTasks(o,r)}}};function a_(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function s_(e,t){let r={...e};for(let n in t){let o=n,i=t[o];if(i===void 0)continue;let a=r[o];a_(a)&&a_(i)?r[o]={...a,...i}:r[o]=i}return r}var sg=Hr(Yi(),1),cg=Hr(ag(),1);function uz(){let e=new sg.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return(0,cg.default)(e),e}var Bi=class{constructor(t){this._ajv=t??uz()}getValidator(t){let r="$id"in t&&typeof t.$id=="string"?this._ajv.getSchema(t.$id)??this._ajv.compile(t):this._ajv.compile(t);return n=>r(n)?{valid:!0,data:n,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(r.errors)}}};var Gi=class{constructor(t){this._client=t}async*callToolStream(t,r=Pr,n){let o=this._client,i={...n,task:n?.task??(o.isToolTask(t.name)?{}:void 0)},a=o.requestStream({method:"tools/call",params:t},r,i),s=o.getToolOutputValidator(t.name);for await(let c of a){if(c.type==="result"&&s){let l=c.result;if(!l.structuredContent&&!l.isError){yield{type:"error",error:new A(N.InvalidRequest,`Tool ${t.name} has an output schema but did not return structured content`)};return}if(l.structuredContent)try{let u=s(l.structuredContent);if(!u.valid){yield{type:"error",error:new A(N.InvalidParams,`Structured content does not match the tool's output schema: ${u.errorMessage}`)};return}}catch(u){if(u instanceof A){yield{type:"error",error:u};return}yield{type:"error",error:new A(N.InvalidParams,`Failed to validate structured content: ${u instanceof Error?u.message:String(u)}`)};return}}yield c}}async getTask(t,r){return this._client.getTask({taskId:t},r)}async getTaskResult(t,r,n){return this._client.getTaskResult({taskId:t},r,n)}async listTasks(t,r){return this._client.listTasks(t?{cursor:t}:void 0,r)}async cancelTask(t,r){return this._client.cancelTask({taskId:t},r)}requestStream(t,r,n){return this._client.requestStream(t,r,n)}};function lg(e,t,r){if(!e)throw new Error(`${r} does not support task creation (required for ${t})`);switch(t){case"tools/call":if(!e.tools?.call)throw new Error(`${r} does not support task creation for tools/call (required for ${t})`);break;default:break}}function ug(e,t,r){if(!e)throw new Error(`${r} does not support task creation (required for ${t})`);switch(t){case"sampling/createMessage":if(!e.sampling?.createMessage)throw new Error(`${r} does not support task creation for sampling/createMessage (required for ${t})`);break;case"elicitation/create":if(!e.elicitation?.create)throw new Error(`${r} does not support task creation for elicitation/create (required for ${t})`);break;default:break}}function Ji(e,t){if(!(!e||t===null||typeof t!="object")){if(e.type==="object"&&e.properties&&typeof e.properties=="object"){let r=t,n=e.properties;for(let o of Object.keys(n)){let i=n[o];r[o]===void 0&&Object.prototype.hasOwnProperty.call(i,"default")&&(r[o]=i.default),r[o]!==void 0&&Ji(i,r[o])}}if(Array.isArray(e.anyOf))for(let r of e.anyOf)typeof r!="boolean"&&Ji(r,t);if(Array.isArray(e.oneOf))for(let r of e.oneOf)typeof r!="boolean"&&Ji(r,t)}}function dz(e){if(!e)return{supportsFormMode:!1,supportsUrlMode:!1};let t=e.form!==void 0,r=e.url!==void 0;return{supportsFormMode:t||!t&&!r,supportsUrlMode:r}}var Vi=class extends ci{constructor(t,r){super(r),this._clientInfo=t,this._cachedToolOutputValidators=new Map,this._cachedKnownTaskTools=new Set,this._cachedRequiredTaskTools=new Set,this._listChangedDebounceTimers=new Map,this._capabilities=r?.capabilities??{},this._jsonSchemaValidator=r?.jsonSchemaValidator??new Bi,r?.listChanged&&(this._pendingListChangedConfig=r.listChanged)}_setupListChangedHandlers(t){t.tools&&this._serverCapabilities?.tools?.listChanged&&this._setupListChangedHandler("tools",qs,t.tools,async()=>(await this.listTools()).tools),t.prompts&&this._serverCapabilities?.prompts?.listChanged&&this._setupListChangedHandler("prompts",As,t.prompts,async()=>(await this.listPrompts()).prompts),t.resources&&this._serverCapabilities?.resources?.listChanged&&this._setupListChangedHandler("resources",ks,t.resources,async()=>(await this.listResources()).resources)}get experimental(){return this._experimental||(this._experimental={tasks:new Gi(this)}),this._experimental}registerCapabilities(t){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=s_(this._capabilities,t)}setRequestHandler(t,r){let o=Uo(t)?.method;if(!o)throw new Error("Schema is missing a method literal");let i=Zo(o);if(typeof i!="string")throw new Error("Schema method literal must be a string");let a=i;if(a==="elicitation/create"){let s=async(c,l)=>{let u=Xe(Is,c);if(!u.success){let w=u.error instanceof Error?u.error.message:String(u.error);throw new A(N.InvalidParams,`Invalid elicitation request: ${w}`)}let{params:d}=u.data;d.mode=d.mode??"form";let{supportsFormMode:m,supportsUrlMode:p}=dz(this._capabilities.elicitation);if(d.mode==="form"&&!m)throw new A(N.InvalidParams,"Client does not support form-mode elicitation requests");if(d.mode==="url"&&!p)throw new A(N.InvalidParams,"Client does not support URL-mode elicitation requests");let f=await Promise.resolve(r(c,l));if(d.task){let w=Xe(Ht,f);if(!w.success){let S=w.error instanceof Error?w.error.message:String(w.error);throw new A(N.InvalidParams,`Invalid task creation result: ${S}`)}return w.data}let h=Xe(Ms,f);if(!h.success){let w=h.error instanceof Error?h.error.message:String(h.error);throw new A(N.InvalidParams,`Invalid elicitation result: ${w}`)}let y=h.data,v=d.mode==="form"?d.requestedSchema:void 0;if(d.mode==="form"&&y.action==="accept"&&y.content&&v&&this._capabilities.elicitation?.form?.applyDefaults)try{Ji(v,y.content)}catch{}return y};return super.setRequestHandler(t,s)}if(a==="sampling/createMessage"){let s=async(c,l)=>{let u=Xe(Ns,c);if(!u.success){let y=u.error instanceof Error?u.error.message:String(u.error);throw new A(N.InvalidParams,`Invalid sampling request: ${y}`)}let{params:d}=u.data,m=await Promise.resolve(r(c,l));if(d.task){let y=Xe(Ht,m);if(!y.success){let v=y.error instanceof Error?y.error.message:String(y.error);throw new A(N.InvalidParams,`Invalid task creation result: ${v}`)}return y.data}let f=d.tools||d.toolChoice?Ts:Rs,h=Xe(f,m);if(!h.success){let y=h.error instanceof Error?h.error.message:String(h.error);throw new A(N.InvalidParams,`Invalid sampling result: ${y}`)}return h.data};return super.setRequestHandler(t,s)}return super.setRequestHandler(t,r)}assertCapability(t,r){if(!this._serverCapabilities?.[t])throw new Error(`Server does not support ${t} (required for ${r})`)}async connect(t,r){if(await super.connect(t),t.sessionId===void 0)try{let n=await this.request({method:"initialize",params:{protocolVersion:$r,capabilities:this._capabilities,clientInfo:this._clientInfo}},gs,r);if(n===void 0)throw new Error(`Server sent invalid initialize result: ${n}`);if(!Zf.includes(n.protocolVersion))throw new Error(`Server's protocol version is not supported: ${n.protocolVersion}`);this._serverCapabilities=n.capabilities,this._serverVersion=n.serverInfo,t.setProtocolVersion&&t.setProtocolVersion(n.protocolVersion),this._instructions=n.instructions,await this.notification({method:"notifications/initialized"}),this._pendingListChangedConfig&&(this._setupListChangedHandlers(this._pendingListChangedConfig),this._pendingListChangedConfig=void 0)}catch(n){throw this.close(),n}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}getInstructions(){return this._instructions}assertCapabilityForMethod(t){switch(t){case"logging/setLevel":if(!this._serverCapabilities?.logging)throw new Error(`Server does not support logging (required for ${t})`);break;case"prompts/get":case"prompts/list":if(!this._serverCapabilities?.prompts)throw new Error(`Server does not support prompts (required for ${t})`);break;case"resources/list":case"resources/templates/list":case"resources/read":case"resources/subscribe":case"resources/unsubscribe":if(!this._serverCapabilities?.resources)throw new Error(`Server does not support resources (required for ${t})`);if(t==="resources/subscribe"&&!this._serverCapabilities.resources.subscribe)throw new Error(`Server does not support resource subscriptions (required for ${t})`);break;case"tools/call":case"tools/list":if(!this._serverCapabilities?.tools)throw new Error(`Server does not support tools (required for ${t})`);break;case"completion/complete":if(!this._serverCapabilities?.completions)throw new Error(`Server does not support completions (required for ${t})`);break;case"initialize":break;case"ping":break}}assertNotificationCapability(t){switch(t){case"notifications/roots/list_changed":if(!this._capabilities.roots?.listChanged)throw new Error(`Client does not support roots list changed notifications (required for ${t})`);break;case"notifications/initialized":break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(t){if(this._capabilities)switch(t){case"sampling/createMessage":if(!this._capabilities.sampling)throw new Error(`Client does not support sampling capability (required for ${t})`);break;case"elicitation/create":if(!this._capabilities.elicitation)throw new Error(`Client does not support elicitation capability (required for ${t})`);break;case"roots/list":if(!this._capabilities.roots)throw new Error(`Client does not support roots capability (required for ${t})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Client does not support tasks capability (required for ${t})`);break;case"ping":break}}assertTaskCapability(t){lg(this._serverCapabilities?.tasks?.requests,t,"Server")}assertTaskHandlerCapability(t){this._capabilities&&ug(this._capabilities.tasks?.requests,t,"Client")}async ping(t){return this.request({method:"ping"},Lt,t)}async complete(t,r){return this.request({method:"completion/complete",params:t},js,r)}async setLoggingLevel(t,r){return this.request({method:"logging/setLevel",params:{level:t}},Lt,r)}async getPrompt(t,r){return this.request({method:"prompts/get",params:t},Ds,r)}async listPrompts(t,r){return this.request({method:"prompts/list",params:t},$s,r)}async listResources(t,r){return this.request({method:"resources/list",params:t},vs,r)}async listResourceTemplates(t,r){return this.request({method:"resources/templates/list",params:t},xs,r)}async readResource(t,r){return this.request({method:"resources/read",params:t},Ss,r)}async subscribeResource(t,r){return this.request({method:"resources/subscribe",params:t},Lt,r)}async unsubscribeResource(t,r){return this.request({method:"resources/unsubscribe",params:t},Lt,r)}async callTool(t,r=Pr,n){if(this.isToolTaskRequired(t.name))throw new A(N.InvalidRequest,`Tool "${t.name}" requires task-based execution. Use client.experimental.tasks.callToolStream() instead.`);let o=await this.request({method:"tools/call",params:t},r,n),i=this.getToolOutputValidator(t.name);if(i){if(!o.structuredContent&&!o.isError)throw new A(N.InvalidRequest,`Tool ${t.name} has an output schema but did not return structured content`);if(o.structuredContent)try{let a=i(o.structuredContent);if(!a.valid)throw new A(N.InvalidParams,`Structured content does not match the tool's output schema: ${a.errorMessage}`)}catch(a){throw a instanceof A?a:new A(N.InvalidParams,`Failed to validate structured content: ${a instanceof Error?a.message:String(a)}`)}}return o}isToolTask(t){return this._serverCapabilities?.tasks?.requests?.tools?.call?this._cachedKnownTaskTools.has(t):!1}isToolTaskRequired(t){return this._cachedRequiredTaskTools.has(t)}cacheToolMetadata(t){this._cachedToolOutputValidators.clear(),this._cachedKnownTaskTools.clear(),this._cachedRequiredTaskTools.clear();for(let r of t){if(r.outputSchema){let o=this._jsonSchemaValidator.getValidator(r.outputSchema);this._cachedToolOutputValidators.set(r.name,o)}let n=r.execution?.taskSupport;(n==="required"||n==="optional")&&this._cachedKnownTaskTools.add(r.name),n==="required"&&this._cachedRequiredTaskTools.add(r.name)}}getToolOutputValidator(t){return this._cachedToolOutputValidators.get(t)}async listTools(t,r){let n=await this.request({method:"tools/list",params:t},Cs,r);return this.cacheToolMetadata(n.tools),n}_setupListChangedHandler(t,r,n,o){let i=o_.safeParse(n);if(!i.success)throw new Error(`Invalid ${t} listChanged options: ${i.error.message}`);if(typeof n.onChanged!="function")throw new Error(`Invalid ${t} listChanged options: onChanged must be a function`);let{autoRefresh:a,debounceMs:s}=i.data,{onChanged:c}=n,l=async()=>{if(!a){c(null,null);return}try{let d=await o();c(null,d)}catch(d){let m=d instanceof Error?d:new Error(String(d));c(m,null)}},u=()=>{if(s){let d=this._listChangedDebounceTimers.get(t);d&&clearTimeout(d);let m=setTimeout(l,s);this._listChangedDebounceTimers.set(t,m)}else l()};this.setNotificationHandler(r,u)}async sendRootsListChanged(){return this.notification({method:"notifications/roots/list_changed"})}};var _g=Hr(fg(),1);function hg(e){if(e)try{return _g.default.parse(e).type}catch{let t=(e.split(";",1)[0]??"").trim().toLowerCase();return t===""||e.slice(t.length).includes(",")?void 0:t}}function Wi(e){return e?e instanceof Headers?Object.fromEntries(e.entries()):Array.isArray(e)?Object.fromEntries(e):{...e}:{}}function yg(e=fetch,t){return t?async(r,n)=>{let o={...t,...n,headers:n?.headers?{...Wi(t.headers),...Wi(n.headers)}:t.headers};return e(r,o)}:e}var Ul;Ul=globalThis.crypto?.webcrypto??globalThis.crypto??import("node:crypto").then(e=>e.webcrypto);async function vz(e){return(await Ul).getRandomValues(new Uint8Array(e))}async function xz(e){let t="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~",r=Math.pow(2,8)-Math.pow(2,8)%t.length,n="";for(;n.length<e;){let o=await vz(e-n.length);for(let i of o)i<r&&(n+=t[i%t.length])}return n}async function wz(e){return await xz(e)}async function Sz(e){let t=await(await Ul).subtle.digest("SHA-256",new TextEncoder().encode(e));return btoa(String.fromCharCode(...new Uint8Array(t))).replace(/\//g,"_").replace(/\+/g,"-").replace(/=/g,"")}async function Zl(e){if(e||(e=43),e<43||e>128)throw`Expected a length between 43 and 128. Received ${e}.`;let t=await wz(e),r=await Sz(t);return{code_verifier:t,code_challenge:r}}var ve=$f().superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:Uf.custom,message:"URL must be parseable",fatal:!0}),ba}).refine(e=>{let t=new URL(e);return t.protocol!=="javascript:"&&t.protocol!=="data:"&&t.protocol!=="vbscript:"},{message:"URL cannot use javascript:, data:, or vbscript: scheme"}),bg=ue({resource:_().url(),authorization_servers:k(ve).optional(),jwks_uri:_().url().optional(),scopes_supported:k(_()).optional(),bearer_methods_supported:k(_()).optional(),resource_signing_alg_values_supported:k(_()).optional(),resource_name:_().optional(),resource_documentation:_().optional(),resource_policy_uri:_().url().optional(),resource_tos_uri:_().url().optional(),tls_client_certificate_bound_access_tokens:J().optional(),authorization_details_types_supported:k(_()).optional(),dpop_signing_alg_values_supported:k(_()).optional(),dpop_bound_access_tokens_required:J().optional()}),Fl=ue({issuer:_(),authorization_endpoint:ve,token_endpoint:ve,registration_endpoint:ve.optional(),scopes_supported:k(_()).optional(),response_types_supported:k(_()),response_modes_supported:k(_()).optional(),grant_types_supported:k(_()).optional(),token_endpoint_auth_methods_supported:k(_()).optional(),token_endpoint_auth_signing_alg_values_supported:k(_()).optional(),service_documentation:ve.optional(),revocation_endpoint:ve.optional(),revocation_endpoint_auth_methods_supported:k(_()).optional(),revocation_endpoint_auth_signing_alg_values_supported:k(_()).optional(),introspection_endpoint:_().optional(),introspection_endpoint_auth_methods_supported:k(_()).optional(),introspection_endpoint_auth_signing_alg_values_supported:k(_()).optional(),code_challenge_methods_supported:k(_()).optional(),client_id_metadata_document_supported:J().optional()}),kz=ue({issuer:_(),authorization_endpoint:ve,token_endpoint:ve,userinfo_endpoint:ve.optional(),jwks_uri:ve,registration_endpoint:ve.optional(),scopes_supported:k(_()).optional(),response_types_supported:k(_()),response_modes_supported:k(_()).optional(),grant_types_supported:k(_()).optional(),acr_values_supported:k(_()).optional(),subject_types_supported:k(_()),id_token_signing_alg_values_supported:k(_()),id_token_encryption_alg_values_supported:k(_()).optional(),id_token_encryption_enc_values_supported:k(_()).optional(),userinfo_signing_alg_values_supported:k(_()).optional(),userinfo_encryption_alg_values_supported:k(_()).optional(),userinfo_encryption_enc_values_supported:k(_()).optional(),request_object_signing_alg_values_supported:k(_()).optional(),request_object_encryption_alg_values_supported:k(_()).optional(),request_object_encryption_enc_values_supported:k(_()).optional(),token_endpoint_auth_methods_supported:k(_()).optional(),token_endpoint_auth_signing_alg_values_supported:k(_()).optional(),display_values_supported:k(_()).optional(),claim_types_supported:k(_()).optional(),claims_supported:k(_()).optional(),service_documentation:_().optional(),claims_locales_supported:k(_()).optional(),ui_locales_supported:k(_()).optional(),claims_parameter_supported:J().optional(),request_parameter_supported:J().optional(),request_uri_parameter_supported:J().optional(),require_request_uri_registration:J().optional(),op_policy_uri:ve.optional(),op_tos_uri:ve.optional(),client_id_metadata_document_supported:J().optional()}),vg=$({...kz.shape,...Fl.pick({code_challenge_methods_supported:!0}).shape}),xg=$({access_token:_(),id_token:_().optional(),token_type:_(),expires_in:Go.number().optional(),scope:_().optional(),refresh_token:_().optional()}).strip(),wg=$({error:_(),error_description:_().optional(),error_uri:_().optional()}),gg=ve.optional().or(P("").transform(()=>{})),$z=$({redirect_uris:k(ve),token_endpoint_auth_method:_().optional(),grant_types:k(_()).optional(),response_types:k(_()).optional(),client_name:_().optional(),client_uri:ve.optional(),logo_uri:gg,scope:_().optional(),contacts:k(_()).optional(),tos_uri:gg,policy_uri:_().optional(),jwks_uri:ve.optional(),jwks:zf().optional(),software_id:_().optional(),software_version:_().optional(),software_statement:_().optional()}).strip(),Oz=$({client_id:_(),client_secret:_().optional(),client_id_issued_at:L().optional(),client_secret_expires_at:L().optional()}).strip(),Sg=$z.merge(Oz),cT=$({error:_(),error_description:_().optional()}).strip(),lT=$({token:_(),token_type_hint:_().optional()}).strip();function kg(e){let t=typeof e=="string"?new URL(e):new URL(e.href);return t.hash="",t}function $g({requestedResource:e,configuredResource:t}){let r=typeof e=="string"?new URL(e):new URL(e.href),n=typeof t=="string"?new URL(t):new URL(t.href);if(r.origin!==n.origin||r.pathname.length<n.pathname.length)return!1;let o=r.pathname.endsWith("/")?r.pathname:r.pathname+"/",i=n.pathname.endsWith("/")?n.pathname:n.pathname+"/";return o.startsWith(i)}var le=class extends Error{constructor(t,r){super(t),this.errorUri=r,this.name=this.constructor.name}toResponseObject(){let t={error:this.errorCode,error_description:this.message};return this.errorUri&&(t.error_uri=this.errorUri),t}get errorCode(){return this.constructor.errorCode}},Bn=class extends le{};Bn.errorCode="invalid_request";var nr=class extends le{};nr.errorCode="invalid_client";var or=class extends le{};or.errorCode="invalid_grant";var ir=class extends le{};ir.errorCode="unauthorized_client";var Gn=class extends le{};Gn.errorCode="unsupported_grant_type";var Jn=class extends le{};Jn.errorCode="invalid_scope";var Vn=class extends le{};Vn.errorCode="access_denied";var vt=class extends le{};vt.errorCode="server_error";var Wn=class extends le{};Wn.errorCode="temporarily_unavailable";var Xn=class extends le{};Xn.errorCode="unsupported_response_type";var Qn=class extends le{};Qn.errorCode="unsupported_token_type";var eo=class extends le{};eo.errorCode="invalid_token";var to=class extends le{};to.errorCode="method_not_allowed";var ro=class extends le{};ro.errorCode="too_many_requests";var ar=class extends le{};ar.errorCode="invalid_client_metadata";var no=class extends le{};no.errorCode="insufficient_scope";var oo=class extends le{};oo.errorCode="invalid_target";var Og={[Bn.errorCode]:Bn,[nr.errorCode]:nr,[or.errorCode]:or,[ir.errorCode]:ir,[Gn.errorCode]:Gn,[Jn.errorCode]:Jn,[Vn.errorCode]:Vn,[vt.errorCode]:vt,[Wn.errorCode]:Wn,[Xn.errorCode]:Xn,[Qn.errorCode]:Qn,[eo.errorCode]:eo,[to.errorCode]:to,[ro.errorCode]:ro,[ar.errorCode]:ar,[no.errorCode]:no,[oo.errorCode]:oo};var xt=class extends Error{constructor(t){super(t??"Unauthorized")}};function Pz(e){return["client_secret_basic","client_secret_post","none"].includes(e)}var Ll="code",Hl="S256";function zz(e,t){let r=e.client_secret!==void 0;return"token_endpoint_auth_method"in e&&e.token_endpoint_auth_method&&Pz(e.token_endpoint_auth_method)&&(t.length===0||t.includes(e.token_endpoint_auth_method))?e.token_endpoint_auth_method:t.length===0?r?"client_secret_basic":"none":r&&t.includes("client_secret_basic")?"client_secret_basic":r&&t.includes("client_secret_post")?"client_secret_post":t.includes("none")?"none":r?"client_secret_post":"none"}function Ez(e,t,r,n){let{client_id:o,client_secret:i}=t;switch(e){case"client_secret_basic":Dz(o,i,r);return;case"client_secret_post":Az(o,i,n);return;case"none":Cz(o,n);return;default:throw new Error(`Unsupported client authentication method: ${e}`)}}function Dz(e,t,r){if(!t)throw new Error("client_secret_basic authentication requires a client_secret");let n=btoa(`${e}:${t}`);r.set("Authorization",`Basic ${n}`)}function Az(e,t,r){r.set("client_id",e),t&&r.set("client_secret",t)}function Cz(e,t){t.set("client_id",e)}async function zg(e){let t=e instanceof Response?e.status:void 0,r=e instanceof Response?await e.text():e;try{let n=wg.parse(JSON.parse(r)),{error:o,error_description:i,error_uri:a}=n,s=Og[o]||vt;return new s(i||"",a)}catch(n){let o=`${t?`HTTP ${t}: `:""}Invalid OAuth error response: ${n}. Raw body: ${r}`;return new vt(o)}}async function io(e,t){try{return await Yl(e,t)}catch(r){if(r instanceof nr||r instanceof ir)return await e.invalidateCredentials?.("all"),await Yl(e,t);if(r instanceof or)return await e.invalidateCredentials?.("tokens"),await Yl(e,t);throw r}}async function Yl(e,{serverUrl:t,authorizationCode:r,scope:n,resourceMetadataUrl:o,fetchFn:i}){let a=await e.discoveryState?.(),s,c,l,u=o;if(!u&&a?.resourceMetadataUrl&&(u=new URL(a.resourceMetadataUrl)),a?.authorizationServerUrl){if(c=a.authorizationServerUrl,s=a.resourceMetadata,l=a.authorizationServerMetadata??await Dg(c,{fetchFn:i}),!s)try{s=await Eg(t,{resourceMetadataUrl:u},i)}catch{}(l!==a.authorizationServerMetadata||s!==a.resourceMetadata)&&await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:u?.toString(),resourceMetadata:s,authorizationServerMetadata:l})}else{let S=await jz(t,{resourceMetadataUrl:u,fetchFn:i});c=S.authorizationServerUrl,l=S.authorizationServerMetadata,s=S.resourceMetadata,await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:u?.toString(),resourceMetadata:s,authorizationServerMetadata:l})}let d=await Nz(t,e,s),m=n||s?.scopes_supported?.join(" ")||e.clientMetadata.scope,p=await Promise.resolve(e.clientInformation());if(!p){if(r!==void 0)throw new Error("Existing OAuth client information is required when exchanging an authorization code");let S=l?.client_id_metadata_document_supported===!0,q=e.clientMetadataUrl;if(q&&!qz(q))throw new ar(`clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${q}`);if(S&&q)p={client_id:q},await e.saveClientInformation?.(p);else{if(!e.saveClientInformation)throw new Error("OAuth client information must be saveable for dynamic registration");let x=await Hz(c,{metadata:l,clientMetadata:e.clientMetadata,scope:m,fetchFn:i});await e.saveClientInformation(x),p=x}}let f=!e.redirectUrl;if(r!==void 0||f){let S=await Lz(e,c,{metadata:l,resource:d,authorizationCode:r,fetchFn:i});return await e.saveTokens(S),"AUTHORIZED"}let h=await e.tokens();if(h?.refresh_token)try{let S=await Fz(c,{metadata:l,clientInformation:p,refreshToken:h.refresh_token,resource:d,addClientAuthentication:e.addClientAuthentication,fetchFn:i});return await e.saveTokens(S),"AUTHORIZED"}catch(S){if(!(!(S instanceof le)||S instanceof vt))throw S}let y=e.state?await e.state():void 0,{authorizationUrl:v,codeVerifier:w}=await Uz(c,{metadata:l,clientInformation:p,state:y,redirectUrl:e.redirectUrl,scope:m,resource:d});return await e.saveCodeVerifier(w),await e.redirectToAuthorization(v),"REDIRECT"}function qz(e){if(!e)return!1;try{let t=new URL(e);return t.protocol==="https:"&&t.pathname!=="/"}catch{return!1}}async function Nz(e,t,r){let n=kg(e);if(t.validateResourceURL)return await t.validateResourceURL(n,r?.resource);if(r){if(!$g({requestedResource:n,configuredResource:r.resource}))throw new Error(`Protected resource ${r.resource} does not match expected ${n} (or origin)`);return new URL(r.resource)}}function Bl(e){let t=e.headers.get("WWW-Authenticate");if(!t)return{};let[r,n]=t.split(" ");if(r.toLowerCase()!=="bearer"||!n)return{};let o=Kl(e,"resource_metadata")||void 0,i;if(o)try{i=new URL(o)}catch{}let a=Kl(e,"scope")||void 0,s=Kl(e,"error")||void 0;return{resourceMetadataUrl:i,scope:a,error:s}}function Kl(e,t){let r=e.headers.get("WWW-Authenticate");if(!r)return null;let n=new RegExp(`${t}=(?:"([^"]+)"|([^\\s,]+))`),o=r.match(n);return o?o[1]||o[2]:null}async function Eg(e,t,r=fetch){let n=await Iz(e,"oauth-protected-resource",r,{protocolVersion:t?.protocolVersion,metadataUrl:t?.resourceMetadataUrl});if(!n||n.status===404)throw await n?.body?.cancel(),new Error("Resource server does not implement OAuth 2.0 Protected Resource Metadata.");if(!n.ok)throw await n.body?.cancel(),new Error(`HTTP ${n.status} trying to load well-known OAuth protected resource metadata.`);return bg.parse(await n.json())}async function Gl(e,t,r=fetch){try{return await r(e,{headers:t})}catch(n){if(n instanceof TypeError)return t?Gl(e,void 0,r):void 0;throw n}}function Rz(e,t="",r={}){return t.endsWith("/")&&(t=t.slice(0,-1)),r.prependPathname?`${t}/.well-known/${e}`:`/.well-known/${e}${t}`}async function Pg(e,t,r=fetch){return await Gl(e,{"MCP-Protocol-Version":t},r)}function Tz(e,t){return!e||e.status>=400&&e.status<500&&t!=="/"}async function Iz(e,t,r,n){let o=new URL(e),i=n?.protocolVersion??$r,a;if(n?.metadataUrl)a=new URL(n.metadataUrl);else{let c=Rz(t,o.pathname);a=new URL(c,n?.metadataServerUrl??o),a.search=o.search}let s=await Pg(a,i,r);if(!n?.metadataUrl&&Tz(s,o.pathname)){let c=new URL(`/.well-known/${t}`,o);s=await Pg(c,i,r)}return s}function Mz(e){let t=typeof e=="string"?new URL(e):e,r=t.pathname!=="/",n=[];if(!r)return n.push({url:new URL("/.well-known/oauth-authorization-server",t.origin),type:"oauth"}),n.push({url:new URL("/.well-known/openid-configuration",t.origin),type:"oidc"}),n;let o=t.pathname;return o.endsWith("/")&&(o=o.slice(0,-1)),n.push({url:new URL(`/.well-known/oauth-authorization-server${o}`,t.origin),type:"oauth"}),n.push({url:new URL(`/.well-known/openid-configuration${o}`,t.origin),type:"oidc"}),n.push({url:new URL(`${o}/.well-known/openid-configuration`,t.origin),type:"oidc"}),n}async function Dg(e,{fetchFn:t=fetch,protocolVersion:r=$r}={}){let n={"MCP-Protocol-Version":r,Accept:"application/json"},o=Mz(e);for(let{url:i,type:a}of o){let s=await Gl(i,n,t);if(s){if(!s.ok){if(await s.body?.cancel(),s.status>=400&&s.status<500)continue;throw new Error(`HTTP ${s.status} trying to load ${a==="oauth"?"OAuth":"OpenID provider"} metadata from ${i}`)}return a==="oauth"?Fl.parse(await s.json()):vg.parse(await s.json())}}}async function jz(e,t){let r,n;try{r=await Eg(e,{resourceMetadataUrl:t?.resourceMetadataUrl},t?.fetchFn),r.authorization_servers&&r.authorization_servers.length>0&&(n=r.authorization_servers[0])}catch{}n||(n=String(new URL("/",e)));let o=await Dg(n,{fetchFn:t?.fetchFn});return{authorizationServerUrl:n,authorizationServerMetadata:o,resourceMetadata:r}}async function Uz(e,{metadata:t,clientInformation:r,redirectUrl:n,scope:o,state:i,resource:a}){let s;if(t){if(s=new URL(t.authorization_endpoint),!t.response_types_supported.includes(Ll))throw new Error(`Incompatible auth server: does not support response type ${Ll}`);if(t.code_challenge_methods_supported&&!t.code_challenge_methods_supported.includes(Hl))throw new Error(`Incompatible auth server: does not support code challenge method ${Hl}`)}else s=new URL("/authorize",e);let c=await Zl(),l=c.code_verifier,u=c.code_challenge;return s.searchParams.set("response_type",Ll),s.searchParams.set("client_id",r.client_id),s.searchParams.set("code_challenge",u),s.searchParams.set("code_challenge_method",Hl),s.searchParams.set("redirect_uri",String(n)),i&&s.searchParams.set("state",i),o&&s.searchParams.set("scope",o),o?.includes("offline_access")&&s.searchParams.append("prompt","consent"),a&&s.searchParams.set("resource",a.href),{authorizationUrl:s,codeVerifier:l}}function Zz(e,t,r){return new URLSearchParams({grant_type:"authorization_code",code:e,code_verifier:t,redirect_uri:String(r)})}async function Ag(e,{metadata:t,tokenRequestParams:r,clientInformation:n,addClientAuthentication:o,resource:i,fetchFn:a}){let s=t?.token_endpoint?new URL(t.token_endpoint):new URL("/token",e),c=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"});if(i&&r.set("resource",i.href),o)await o(c,r,s,t);else if(n){let u=t?.token_endpoint_auth_methods_supported??[],d=zz(n,u);Ez(d,n,c,r)}let l=await(a??fetch)(s,{method:"POST",headers:c,body:r});if(!l.ok)throw await zg(l);return xg.parse(await l.json())}async function Fz(e,{metadata:t,clientInformation:r,refreshToken:n,resource:o,addClientAuthentication:i,fetchFn:a}){let s=new URLSearchParams({grant_type:"refresh_token",refresh_token:n}),c=await Ag(e,{metadata:t,tokenRequestParams:s,clientInformation:r,addClientAuthentication:i,resource:o,fetchFn:a});return{refresh_token:n,...c}}async function Lz(e,t,{metadata:r,resource:n,authorizationCode:o,fetchFn:i}={}){let a=e.clientMetadata.scope,s;if(e.prepareTokenRequest&&(s=await e.prepareTokenRequest(a)),!s){if(!o)throw new Error("Either provider.prepareTokenRequest() or authorizationCode is required");if(!e.redirectUrl)throw new Error("redirectUrl is required for authorization_code flow");let l=await e.codeVerifier();s=Zz(o,l,e.redirectUrl)}let c=await e.clientInformation();return Ag(t,{metadata:r,tokenRequestParams:s,clientInformation:c??void 0,addClientAuthentication:e.addClientAuthentication,resource:n,fetchFn:i})}async function Hz(e,{metadata:t,clientMetadata:r,scope:n,fetchFn:o}){let i;if(t){if(!t.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");i=new URL(t.registration_endpoint)}else i=new URL("/register",e);let a=await(o??fetch)(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...r,...n!==void 0?{scope:n}:{}})});if(!a.ok)throw await zg(a);return Sg.parse(await a.json())}var ao=class extends Error{constructor(t,r){super(t),this.name="ParseError",this.type=r.type,this.field=r.field,this.value=r.value,this.line=r.line}},Cg=10,Yz=13,sr=32;function Jl(e){}function Rg(e){if(typeof e=="function")throw new TypeError("`config` must be an object, got a function instead. Did you mean `createParser({onEvent: fn})`?");let{onEvent:t=Jl,onError:r=Jl,onRetry:n=Jl,onComment:o,maxBufferSize:i}=e,a=[],s=0,c=!0,l,u="",d=0,m,p=!1;function f(b){if(p)throw new Error("Cannot feed parser: it was terminated after exceeding the configured max buffer size. Call `reset()` to resume parsing.");if(c&&(c=!1,b.charCodeAt(0)===239&&b.charCodeAt(1)===187&&b.charCodeAt(2)===191&&(b=b.slice(3))),a.length===0){let X=y(b);X!==""&&(a.push(X),s=X.length),h();return}if(b.indexOf(`
`)===-1&&b.indexOf("\r")===-1){a.push(b),s+=b.length,h();return}a.push(b);let x=a.join("");a.length=0,s=0;let D=y(x);D!==""&&(a.push(D),s=D.length),h()}function h(){i!==void 0&&(s+u.length<=i||(p=!0,a.length=0,s=0,l=void 0,u="",d=0,m=void 0,r(new ao(`Buffered data exceeded max buffer size of ${i} characters`,{type:"max-buffer-size-exceeded"}))))}function y(b){let x=0;if(b.indexOf("\r")===-1){let D=b.indexOf(`
`,x);for(;D!==-1;){if(x===D){d>0&&t({id:l,event:m,data:u}),l=void 0,u="",d=0,m=void 0,x=D+1,D=b.indexOf(`
`,x);continue}let X=b.charCodeAt(x);if(qg(b,x,X)){let ne=b.charCodeAt(x+5)===sr?x+6:x+5,pe=b.slice(ne,D);if(d===0&&b.charCodeAt(D+1)===Cg){t({id:l,event:m,data:pe}),l=void 0,u="",m=void 0,x=D+2,D=b.indexOf(`
`,x);continue}u=d===0?pe:`${u}
${pe}`,d++}else Ng(b,x,X)?m=b.slice(b.charCodeAt(x+6)===sr?x+7:x+6,D)||void 0:v(b,x,D);x=D+1,D=b.indexOf(`
`,x)}return b.slice(x)}for(;x<b.length;){let D=b.indexOf("\r",x),X=b.indexOf(`
`,x),ne=-1;if(D!==-1&&X!==-1?ne=D<X?D:X:D!==-1?D===b.length-1?ne=-1:ne=D:X!==-1&&(ne=X),ne===-1)break;v(b,x,ne),x=ne+1,b.charCodeAt(x-1)===Yz&&b.charCodeAt(x)===Cg&&x++}return b.slice(x)}function v(b,x,D){if(x===D){S();return}let X=b.charCodeAt(x);if(qg(b,x,X)){let St=b.charCodeAt(x+5)===sr?x+6:x+5,Xl=b.slice(St,D);u=d===0?Xl:`${u}
${Xl}`,d++;return}if(Ng(b,x,X)){m=b.slice(b.charCodeAt(x+6)===sr?x+7:x+6,D)||void 0;return}if(X===105&&b.charCodeAt(x+1)===100&&b.charCodeAt(x+2)===58){let St=b.slice(b.charCodeAt(x+3)===sr?x+4:x+3,D);St.includes("\0")||(l=St);return}if(X===58){if(o){let St=b.slice(x,D);o(St.slice(b.charCodeAt(x+1)===sr?2:1))}return}let ne=b.slice(x,D),pe=ne.indexOf(":");if(pe===-1){w(ne,"",ne);return}let wt=ne.slice(0,pe),cr=ne.charCodeAt(pe+1)===sr?2:1,lr=ne.slice(pe+cr);w(wt,lr,ne)}function w(b,x,D){switch(b){case"event":m=x||void 0;break;case"data":u=d===0?x:`${u}
${x}`,d++;break;case"id":x.includes("\0")||(l=x);break;case"retry":/^\d+$/.test(x)?n(parseInt(x,10)):r(new ao(`Invalid \`retry\` value: "${x}"`,{type:"invalid-retry",value:x,line:D}));break;default:r(new ao(`Unknown field "${b.length>20?`${b.slice(0,20)}\u2026`:b}"`,{type:"unknown-field",field:b,value:x,line:D}));break}}function S(){d>0&&t({id:l,event:m,data:u}),l=void 0,u="",d=0,m=void 0}function q(b={}){if(b.consume&&a.length>0){let x=a.join("");v(x,0,x.length)}c=!0,l=void 0,u="",d=0,m=void 0,a.length=0,s=0,p=!1}return{feed:f,reset:q}}function qg(e,t,r){return r===100&&e.charCodeAt(t+1)===97&&e.charCodeAt(t+2)===116&&e.charCodeAt(t+3)===97&&e.charCodeAt(t+4)===58}function Ng(e,t,r){return r===101&&e.charCodeAt(t+1)===118&&e.charCodeAt(t+2)===101&&e.charCodeAt(t+3)===110&&e.charCodeAt(t+4)===116&&e.charCodeAt(t+5)===58}var Xi=class extends TransformStream{constructor({onError:t,onRetry:r,onComment:n,maxBufferSize:o}={}){let i;super({start(a){i=Rg({onEvent:s=>{a.enqueue(s)},onError(s){typeof t=="function"&&t(s),(t==="terminate"||s.type==="max-buffer-size-exceeded")&&a.error(s)},onRetry:r,onComment:n,maxBufferSize:o})},transform(a){i.feed(a)}})}};var Kz={initialReconnectionDelay:1e3,maxReconnectionDelay:3e4,reconnectionDelayGrowFactor:1.5,maxRetries:2},jt=class extends Error{constructor(t,r){super(`Streamable HTTP error: ${r}`),this.code=t}},Qi=class{constructor(t,r){this._hasCompletedAuthFlow=!1,this._url=t,this._resourceMetadataUrl=void 0,this._scope=void 0,this._requestInit=r?.requestInit,this._authProvider=r?.authProvider,this._fetch=r?.fetch,this._fetchWithInit=yg(r?.fetch,r?.requestInit),this._sessionId=r?.sessionId,this._reconnectionOptions=r?.reconnectionOptions??Kz}async _authThenStart(){if(!this._authProvider)throw new xt("No auth provider");let t;try{t=await io(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})}catch(r){throw this.onerror?.(r),r}if(t!=="AUTHORIZED")throw new xt;return await this._startOrAuthSse({resumptionToken:void 0})}async _commonHeaders(){let t={};if(this._authProvider){let n=await this._authProvider.tokens();n&&(t.Authorization=`Bearer ${n.access_token}`)}this._sessionId&&(t["mcp-session-id"]=this._sessionId),this._protocolVersion&&(t["mcp-protocol-version"]=this._protocolVersion);let r=Wi(this._requestInit?.headers);return new Headers({...t,...r})}async _startOrAuthSse(t){let{resumptionToken:r}=t;try{let n=await this._commonHeaders();n.set("Accept","text/event-stream"),r&&n.set("last-event-id",r);let o=await(this._fetch??fetch)(this._url,{method:"GET",headers:n,signal:this._abortController?.signal});if(!o.ok){if(await o.body?.cancel(),o.status===401&&this._authProvider)return await this._authThenStart();if(o.status===405)return;throw new jt(o.status,`Failed to open SSE stream: ${o.statusText}`)}this._handleSseStream(o.body,t,!0)}catch(n){throw this.onerror?.(n),n}}_getNextReconnectionDelay(t){if(this._serverRetryMs!==void 0)return this._serverRetryMs;let r=this._reconnectionOptions.initialReconnectionDelay,n=this._reconnectionOptions.reconnectionDelayGrowFactor,o=this._reconnectionOptions.maxReconnectionDelay;return Math.min(r*Math.pow(n,t),o)}_scheduleReconnection(t,r=0){let n=this._reconnectionOptions.maxRetries;if(r>=n){this.onerror?.(new Error(`Maximum reconnection attempts (${n}) exceeded.`));return}let o=this._getNextReconnectionDelay(r);this._reconnectionTimeout=setTimeout(()=>{this._startOrAuthSse(t).catch(i=>{this.onerror?.(new Error(`Failed to reconnect SSE stream: ${i instanceof Error?i.message:String(i)}`)),this._scheduleReconnection(t,r+1)})},o)}_handleSseStream(t,r,n){if(!t)return;let{onresumptiontoken:o,replayMessageId:i}=r,a,s=!1,c=!1;(async()=>{try{let u=t.pipeThrough(new TextDecoderStream).pipeThrough(new Xi({onRetry:p=>{this._serverRetryMs=p}})).getReader();for(;;){let{value:p,done:f}=await u.read();if(f)break;if(p.id&&(a=p.id,s=!0,o?.(p.id)),!!p.data&&(!p.event||p.event==="message"))try{let h=Xo.parse(JSON.parse(p.data));Ft(h)&&(c=!0,i!==void 0&&(h.id=i)),this.onmessage?.(h)}catch(h){this.onerror?.(h)}}(n||s)&&!c&&this._abortController&&!this._abortController.signal.aborted&&this._scheduleReconnection({resumptionToken:a,onresumptiontoken:o,replayMessageId:i},0)}catch(u){if(this.onerror?.(new Error(`SSE stream disconnected: ${u}`)),(n||s)&&!c&&this._abortController&&!this._abortController.signal.aborted)try{this._scheduleReconnection({resumptionToken:a,onresumptiontoken:o,replayMessageId:i},0)}catch(p){this.onerror?.(new Error(`Failed to reconnect: ${p instanceof Error?p.message:String(p)}`))}}})()}async start(){if(this._abortController)throw new Error("StreamableHTTPClientTransport already started! If using Client class, note that connect() calls start() automatically.");this._abortController=new AbortController}async finishAuth(t){if(!this._authProvider)throw new xt("No auth provider");if(await io(this._authProvider,{serverUrl:this._url,authorizationCode:t,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new xt("Failed to authorize")}async close(){this._reconnectionTimeout&&(clearTimeout(this._reconnectionTimeout),this._reconnectionTimeout=void 0),this._abortController?.abort(),this.onclose?.()}async send(t,r){try{let{resumptionToken:n,onresumptiontoken:o}=r||{};if(n){this._startOrAuthSse({resumptionToken:n,replayMessageId:ln(t)?t.id:void 0}).catch(p=>this.onerror?.(p));return}let i=await this._commonHeaders();i.set("content-type","application/json"),i.set("accept","application/json, text/event-stream");let a={...this._requestInit,method:"POST",headers:i,body:JSON.stringify(t),signal:this._abortController?.signal},s=await(this._fetch??fetch)(this._url,a),c=s.headers.get("mcp-session-id");if(c&&(this._sessionId=c),!s.ok){let p=await s.text().catch(()=>null);if(s.status===401&&this._authProvider){if(this._hasCompletedAuthFlow)throw new jt(401,"Server returned 401 after successful authentication");let{resourceMetadataUrl:f,scope:h}=Bl(s);if(this._resourceMetadataUrl=f,this._scope=h,await io(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new xt;return this._hasCompletedAuthFlow=!0,this.send(t)}if(s.status===403&&this._authProvider){let{resourceMetadataUrl:f,scope:h,error:y}=Bl(s);if(y==="insufficient_scope"){let v=s.headers.get("WWW-Authenticate");if(this._lastUpscopingHeader===v)throw new jt(403,"Server returned 403 after trying upscoping");if(h&&(this._scope=h),f&&(this._resourceMetadataUrl=f),this._lastUpscopingHeader=v??void 0,await io(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetch})!=="AUTHORIZED")throw new xt;return this.send(t)}}throw new jt(s.status,`Error POSTing to endpoint: ${p}`)}if(this._hasCompletedAuthFlow=!1,this._lastUpscopingHeader=void 0,s.status===202){await s.body?.cancel(),Wf(t)&&this._startOrAuthSse({resumptionToken:void 0}).catch(p=>this.onerror?.(p));return}let u=(Array.isArray(t)?t:[t]).filter(p=>"method"in p&&"id"in p&&p.id!==void 0).length>0,d=s.headers.get("content-type"),m=hg(d);if(u)if(m==="text/event-stream")this._handleSseStream(s.body,{onresumptiontoken:o},!1);else if(m==="application/json"){let p=await s.json(),f=Array.isArray(p)?p.map(h=>Xo.parse(h)):[Xo.parse(p)];for(let h of f)this.onmessage?.(h)}else throw await s.body?.cancel(),new jt(-1,`Unexpected content type: ${d}`);else await s.body?.cancel()}catch(n){throw this.onerror?.(n),n}}get sessionId(){return this._sessionId}async terminateSession(){if(this._sessionId)try{let t=await this._commonHeaders(),r={...this._requestInit,method:"DELETE",headers:t,signal:this._abortController?.signal},n=await(this._fetch??fetch)(this._url,r);if(await n.body?.cancel(),!n.ok&&n.status!==405)throw new jt(n.status,`Failed to terminate session: ${n.statusText}`);this._sessionId=void 0}catch(t){throw this.onerror?.(t),t}}setProtocolVersion(t){this._protocolVersion=t}get protocolVersion(){return this._protocolVersion}async resumeStream(t,r){await this._startOrAuthSse({resumptionToken:t,onresumptiontoken:r?.onresumptiontoken})}};var jg=Hr(Yi());var Tg=[{name:"health",path:"/v1/health",method:"GET",description:"Ping the API",input_schema:{type:"object",properties:{},required:[],additionalProperties:!1},parameters:[]},{name:"ping",path:"/v1/ping",method:"GET",description:"Ping the API",input_schema:{type:"object",properties:{},required:[],additionalProperties:!1},parameters:[]},{name:"forex",path:"/v1/forex/{base}/{quote}",method:"GET",description:"Get FX spot rates",input_schema:{type:"object",properties:{base:{type:"string",description:"Required path parameter. Base currency code Allowed values: AUD, BRL, CAD, CHF, CNH, CNY, DKK, EUR, GBP, ILS, JPY, NGN, NOK, NZD, PEN, SEK, THB, USD.",examples:["AUD"],title:"Base",example:"AUD"},quote:{type:"string",description:"Required path parameter. Quote currency code Allowed values: AUD, BRL, CAD, CHF, CNH, CNY, DKK, EUR, GBP, ILS, JPY, NGN, NOK, NZD, PEN, SEK, THB, USD.",examples:["USD"],title:"Quote",example:"AUD"},start_date:{type:"string",description:"Optional query parameter. Start date YYYY-MM-DD",examples:["2026-01-01"],title:"Start Date"},end_date:{type:"string",description:"Optional query parameter. End date YYYY-MM-DD",examples:["2026-03-01"],title:"End Date"},limit:{type:"integer",maximum:100,minimum:1,description:"Optional query parameter. Maximum rows to return. Defaults to 20. Maximum 100.",examples:[20],default:20,title:"Limit"},offset:{type:"integer",minimum:0,description:"Optional query parameter. Number of rows to skip after most-recent-first ordering.",examples:[0],default:0,title:"Offset"},page:{anyOf:[{type:"integer",minimum:1},{type:"null"}],description:"Optional query parameter. One-based page number. When supplied, it takes precedence over offset.",examples:[1],title:"Page"},indicators:{type:"string",description:"Optional query parameter. Comma-separated technical indicators to compute (e.g. sma_20,rsi_14,macd,bollinger_bands). Use 'all' to request every supported indicator.",examples:["sma_20,rsi_14,macd"],title:"Indicators"}},required:["base","quote"],additionalProperties:!1},parameters:[{name:"base",in:"path",required:!0,schema:{type:"string",description:"Required path parameter. Base currency code Allowed values: AUD, BRL, CAD, CHF, CNH, CNY, DKK, EUR, GBP, ILS, JPY, NGN, NOK, NZD, PEN, SEK, THB, USD.",examples:["AUD"],title:"Base",example:"AUD"}},{name:"quote",in:"path",required:!0,schema:{type:"string",description:"Required path parameter. Quote currency code Allowed values: AUD, BRL, CAD, CHF, CNH, CNY, DKK, EUR, GBP, ILS, JPY, NGN, NOK, NZD, PEN, SEK, THB, USD.",examples:["USD"],title:"Quote",example:"AUD"}},{name:"start_date",in:"query",required:!1,schema:{type:"string",description:"Optional query parameter. Start date YYYY-MM-DD",examples:["2026-01-01"],title:"Start Date"}},{name:"end_date",in:"query",required:!1,schema:{type:"string",description:"Optional query parameter. End date YYYY-MM-DD",examples:["2026-03-01"],title:"End Date"}},{name:"limit",in:"query",required:!1,schema:{type:"integer",maximum:100,minimum:1,description:"Optional query parameter. Maximum rows to return. Defaults to 20. Maximum 100.",examples:[20],default:20,title:"Limit"}},{name:"offset",in:"query",required:!1,schema:{type:"integer",minimum:0,description:"Optional query parameter. Number of rows to skip after most-recent-first ordering.",examples:[0],default:0,title:"Offset"}},{name:"page",in:"query",required:!1,schema:{anyOf:[{type:"integer",minimum:1},{type:"null"}],description:"Optional query parameter. One-based page number. When supplied, it takes precedence over offset.",examples:[1],title:"Page"}},{name:"indicators",in:"query",required:!1,schema:{type:"string",description:"Optional query parameter. Comma-separated technical indicators to compute (e.g. sma_20,rsi_14,macd,bollinger_bands). Use 'all' to request every supported indicator.",examples:["sma_20,rsi_14,macd"],title:"Indicators"}}]},{name:"intraday_reference_rates",path:"/v1/fx/intraday-reference-rates/{base}/{quote}",method:"GET",description:"Get subscriber intraday FX reference rates",input_schema:{type:"object",properties:{base:{type:"string",description:"Required path parameter. Base currency code",examples:["EUR"],title:"Base"},quote:{type:"string",description:"Required path parameter. Quote currency code",examples:["USD"],title:"Quote"},start_time:{anyOf:[{type:"string",format:"date-time"},{type:"null"}],description:"Optional query parameter. Inclusive RFC 3339 timestamp. Defaults to 24 hours before end_time.",examples:["2026-07-13T00:00:00Z"],title:"Start Time"},end_time:{anyOf:[{type:"string",format:"date-time"},{type:"null"}],description:"Optional query parameter. Inclusive RFC 3339 source timestamp. Defaults to the current time.",examples:["2026-07-14T00:00:00Z"],title:"End Time"}},required:["base","quote"],additionalProperties:!1},parameters:[{name:"base",in:"path",required:!0,schema:{type:"string",description:"Required path parameter. Base currency code",examples:["EUR"],title:"Base"}},{name:"quote",in:"path",required:!0,schema:{type:"string",description:"Required path parameter. Quote currency code",examples:["USD"],title:"Quote"}},{name:"start_time",in:"query",required:!1,schema:{anyOf:[{type:"string",format:"date-time"},{type:"null"}],description:"Optional query parameter. Inclusive RFC 3339 timestamp. Defaults to 24 hours before end_time.",examples:["2026-07-13T00:00:00Z"],title:"Start Time"}},{name:"end_time",in:"query",required:!1,schema:{anyOf:[{type:"string",format:"date-time"},{type:"null"}],description:"Optional query parameter. Inclusive RFC 3339 source timestamp. Defaults to the current time.",examples:["2026-07-14T00:00:00Z"],title:"End Time"}}]},{name:"fx_sources",path:"/v1/fx/sources",method:"GET",description:"List public FX reference-rate sources",input_schema:{type:"object",properties:{},required:[],additionalProperties:!1},parameters:[]},{name:"fx_source_universe",path:"/v1/fx/source-universe",method:"GET",description:"List public FX reference-rate pair universe",input_schema:{type:"object",properties:{currency:{type:"string",description:"Optional query parameter. Optional currency filter, for example USD.",examples:["USD"],title:"Currency"},source:{type:"string",description:"Optional query parameter. Optional source id filter, for example ecb_eurofxref_daily.",title:"Source"}},required:[],additionalProperties:!1},parameters:[{name:"currency",in:"query",required:!1,schema:{type:"string",description:"Optional query parameter. Optional currency filter, for example USD.",examples:["USD"],title:"Currency"}},{name:"source",in:"query",required:!1,schema:{type:"string",description:"Optional query parameter. Optional source id filter, for example ecb_eurofxref_daily.",title:"Source"}}]},{name:"data_catalogue",path:"/v1/data_catalogue/{currency}",method:"GET",description:"Get Currently Available Macroeconomic Indicators",input_schema:{type:"object",properties:{currency:{type:"string",description:"Required path parameter. The 3-letter currency code (e.g., USD, AUD, EUR, GBP, CHF) Allowed values: AUD, BRL, CAD, CHF, CNH, CNY, DKK, EUR, GBP, ILS, JPY, NGN, NOK, NZD, PEN, SEK, THB, USD.",examples:["USD"],title:"Currency",example:"AUD"},include_capabilities:{type:"boolean",description:"Optional query parameter. Include currency-scoped endpoint/auth metadata that replaces the deprecated /v1/capabilities response.",default:!1,title:"Include Capabilities"},include_coverage:{type:"boolean",description:"Optional query parameter. Also include the legacy currency-scoped coverage list that replaces the deprecated /v1/coverage_matrix response. Per-indicator coverage is included in catalogue entries by default.",default:!1,title:"Include Coverage"},indicator:{anyOf:[{type:"string"},{type:"null"}],description:"Optional query parameter. Optional indicator filter when include_coverage=true. Allowed values: average_hourly_earnings, average_hourly_earnings_mom, balance_on_goods, balance_on_services, bgcr, breakeven_inflation_rate, broad_money, building_approvals, building_permits, business_confidence, capital_account_balance, cb_assets, commodity_price_energy, commodity_price_ex_energy, commodity_price_index, commodity_prices, consumer_confidence, core_inflation, core_inflation_median, core_inflation_mom, core_inflation_trim, core_pce, core_pce_mom, credit_growth, crude_oil_inventories, current_account_balance, dairy_exports, deposit_rates, durable_goods_orders, effr, employment, exports, financial_account_balance, foreign_reserves, full_time_employment, fx_reserves, gdp, gdp_growth_q4_yoy, gold_reserves, gov_bond_10y, gov_bond_15y, gov_bond_1_5m, gov_bond_1m, gov_bond_1y, gov_bond_20y, gov_bond_25y, gov_bond_2m, gov_bond_2y, gov_bond_30y, gov_bond_3m, gov_bond_3y, gov_bond_40y, gov_bond_4m, gov_bond_4y, gov_bond_5y, gov_bond_6m, gov_bond_6y, gov_bond_7y, gov_bond_8y, gov_bond_9y, government_debt, house_price_index, house_prices, household_credit, household_spending, housing_starts, imports, inflation, inflation_linked_bond, inflation_mom, initial_jobless_claims, international_assets, international_liabilities, job_openings, m1, m2, m3, nairu, natural_gas_storage, net_foreign_asset_position, non_farm_payrolls, non_farm_payrolls_change, obfr, part_time_employment, participation_rate, pce, pce_mom, policy_rate, policy_rate_midpoint, policy_rate_mlf, policy_rate_mro, policy_rate_target_lower, ppi, primary_income_balance, real_yield_20y, real_yield_30y, real_yield_5y, real_yield_7y, retail_sales, retail_sales_control_group, retail_sales_ex_autos, retail_sales_ex_autos_and_gas, risk_free_rate, secondary_income_balance, sight_deposits, snb_balance_sheet, sofr_average_180d, sofr_average_30d, sofr_average_90d, sofr_index, terms_of_trade, tgcr, trade_balance, trade_weighted_index, trimmed_mean_inflation, unemployment, wage_price_index, wages.",examples:["inflation"],title:"Indicator",example:"average_hourly_earnings"}},required:["currency"],additionalProperties:!1},parameters:[{name:"currency",in:"path",required:!0,schema:{type:"string",description:"Required path parameter. The 3-letter currency code (e.g., USD, AUD, EUR, GBP, CHF) Allowed values: AUD, BRL, CAD, CHF, CNH, CNY, DKK, EUR, GBP, ILS, JPY, NGN, NOK, NZD, PEN, SEK, THB, USD.",examples:["USD"],title:"Currency",example:"AUD"}},{name:"include_capabilities",in:"query",required:!1,schema:{type:"boolean",description:"Optional query parameter. Include currency-scoped endpoint/auth metadata that replaces the deprecated /v1/capabilities response.",default:!1,title:"Include Capabilities"}},{name:"include_coverage",in:"query",required:!1,schema:{type:"boolean",description:"Optional query parameter. Also include the legacy currency-scoped coverage list that replaces the deprecated /v1/coverage_matrix response. Per-indicator coverage is included in catalogue entries by default.",default:!1,title:"Include Coverage"}},{name:"indicator",in:"query",required:!1,schema:{anyOf:[{type:"string"},{type:"null"}],description:"Optional query parameter. Optional indicator filter when include_coverage=true. Allowed values: average_hourly_earnings, average_hourly_earnings_mom, balance_on_goods, balance_on_services, bgcr, breakeven_inflation_rate, broad_money, building_approvals, building_permits, business_confidence, capital_account_balance, cb_assets, commodity_price_energy, commodity_price_ex_energy, commodity_price_index, commodity_prices, consumer_confidence, core_inflation, core_inflation_median, core_inflation_mom, core_inflation_trim, core_pce, core_pce_mom, credit_growth, crude_oil_inventories, current_account_balance, dairy_exports, deposit_rates, durable_goods_orders, effr, employment, exports, financial_account_balance, foreign_reserves, full_time_employment, fx_reserves, gdp, gdp_growth_q4_yoy, gold_reserves, gov_bond_10y, gov_bond_15y, gov_bond_1_5m, gov_bond_1m, gov_bond_1y, gov_bond_20y, gov_bond_25y, gov_bond_2m, gov_bond_2y, gov_bond_30y, gov_bond_3m, gov_bond_3y, gov_bond_40y, gov_bond_4m, gov_bond_4y, gov_bond_5y, gov_bond_6m, gov_bond_6y, gov_bond_7y, gov_bond_8y, gov_bond_9y, government_debt, house_price_index, house_prices, household_credit, household_spending, housing_starts, imports, inflation, inflation_linked_bond, inflation_mom, initial_jobless_claims, international_assets, international_liabilities, job_openings, m1, m2, m3, nairu, natural_gas_storage, net_foreign_asset_position, non_farm_payrolls, non_farm_payrolls_change, obfr, part_time_employment, participation_rate, pce, pce_mom, policy_rate, policy_rate_midpoint, policy_rate_mlf, policy_rate_mro, policy_rate_target_lower, ppi, primary_income_balance, real_yield_20y, real_yield_30y, real_yield_5y, real_yield_7y, retail_sales, retail_sales_control_group, retail_sales_ex_autos, retail_sales_ex_autos_and_gas, risk_free_rate, secondary_income_balance, sight_deposits, snb_balance_sheet, sofr_average_180d, sofr_average_30d, sofr_average_90d, sofr_index, terms_of_trade, tgcr, trade_balance, trade_weighted_index, trimmed_mean_inflation, unemployment, wage_price_index, wages.",examples:["inflation"],title:"Indicator",example:"average_hourly_earnings"}}]},{name:"release_calendar",path:"/v1/calendar/{currency}",method:"GET",description:"Get upcoming economic data release dates",input_schema:{type:"object",properties:{currency:{type:"string",title:"Currency",example:"AUD",description:"Required path parameter. Allowed values: AUD, BRL, CAD, CHF, CNH, CNY, COMM, DKK, EUR, GBP, ILS, JPY, NGN, NOK, NZD, PEN, SEK, THB, USD."},indicator:{type:"string",description:"Optional query parameter. Filter by indicator name (e.g., gdp, inflation, unemployment) Allowed values: average_hourly_earnings, average_hourly_earnings_mom, balance_on_goods, balance_on_services, bgcr, breakeven_inflation_rate, broad_money, building_approvals, building_permits, business_confidence, capital_account_balance, cb_assets, commodity_price_energy, commodity_price_ex_energy, commodity_price_index, commodity_prices, consumer_confidence, core_inflation, core_inflation_median, core_inflation_mom, core_inflation_trim, core_pce, core_pce_mom, credit_growth, crude_oil_inventories, current_account_balance, dairy_exports, deposit_rates, durable_goods_orders, effr, employment, exports, financial_account_balance, foreign_reserves, full_time_employment, fx_reserves, gdp, gdp_growth_q4_yoy, gold_reserves, gov_bond_10y, gov_bond_15y, gov_bond_1_5m, gov_bond_1m, gov_bond_1y, gov_bond_20y, gov_bond_25y, gov_bond_2m, gov_bond_2y, gov_bond_30y, gov_bond_3m, gov_bond_3y, gov_bond_40y, gov_bond_4m, gov_bond_4y, gov_bond_5y, gov_bond_6m, gov_bond_6y, gov_bond_7y, gov_bond_8y, gov_bond_9y, government_debt, house_price_index, house_prices, household_credit, household_spending, housing_starts, imports, inflation, inflation_linked_bond, inflation_mom, initial_jobless_claims, international_assets, international_liabilities, job_openings, m1, m2, m3, nairu, natural_gas_storage, net_foreign_asset_position, non_farm_payrolls, non_farm_payrolls_change, obfr, part_time_employment, participation_rate, pce, pce_mom, policy_rate, policy_rate_midpoint, policy_rate_mlf, policy_rate_mro, policy_rate_target_lower, ppi, primary_income_balance, real_yield_20y, real_yield_30y, real_yield_5y, real_yield_7y, retail_sales, retail_sales_control_group, retail_sales_ex_autos, retail_sales_ex_autos_and_gas, risk_free_rate, secondary_income_balance, sight_deposits, snb_balance_sheet, sofr_average_180d, sofr_average_30d, sofr_average_90d, sofr_index, terms_of_trade, tgcr, trade_balance, trade_weighted_index, trimmed_mean_inflation, unemployment, wage_price_index, wages.",examples:["inflation"],title:"Indicator",example:"average_hourly_earnings"},start_date:{type:"string",description:"Optional query parameter. Optional inclusive lower bound in YYYY-MM-DD format.",examples:["2026-06-01"],title:"Start Date"},end_date:{type:"string",description:"Optional query parameter. Optional inclusive upper bound in YYYY-MM-DD format.",examples:["2026-06-30"],title:"End Date"},timezone:{type:"string",description:"Optional query parameter. Optional IANA timezone for an additional converted timestamp field, for example America/Sao_Paulo.",examples:["America/Sao_Paulo"],title:"Timezone"}},required:["currency"],additionalProperties:!1},parameters:[{name:"currency",in:"path",required:!0,schema:{type:"string",title:"Currency",example:"AUD",description:"Required path parameter. Allowed values: AUD, BRL, CAD, CHF, CNH, CNY, COMM, DKK, EUR, GBP, ILS, JPY, NGN, NOK, NZD, PEN, SEK, THB, USD."}},{name:"indicator",in:"query",required:!1,schema:{type:"string",description:"Optional query parameter. Filter by indicator name (e.g., gdp, inflation, unemployment) Allowed values: average_hourly_earnings, average_hourly_earnings_mom, balance_on_goods, balance_on_services, bgcr, breakeven_inflation_rate, broad_money, building_approvals, building_permits, business_confidence, capital_account_balance, cb_assets, commodity_price_energy, commodity_price_ex_energy, commodity_price_index, commodity_prices, consumer_confidence, core_inflation, core_inflation_median, core_inflation_mom, core_inflation_trim, core_pce, core_pce_mom, credit_growth, crude_oil_inventories, current_account_balance, dairy_exports, deposit_rates, durable_goods_orders, effr, employment, exports, financial_account_balance, foreign_reserves, full_time_employment, fx_reserves, gdp, gdp_growth_q4_yoy, gold_reserves, gov_bond_10y, gov_bond_15y, gov_bond_1_5m, gov_bond_1m, gov_bond_1y, gov_bond_20y, gov_bond_25y, gov_bond_2m, gov_bond_2y, gov_bond_30y, gov_bond_3m, gov_bond_3y, gov_bond_40y, gov_bond_4m, gov_bond_4y, gov_bond_5y, gov_bond_6m, gov_bond_6y, gov_bond_7y, gov_bond_8y, gov_bond_9y, government_debt, house_price_index, house_prices, household_credit, household_spending, housing_starts, imports, inflation, inflation_linked_bond, inflation_mom, initial_jobless_claims, international_assets, international_liabilities, job_openings, m1, m2, m3, nairu, natural_gas_storage, net_foreign_asset_position, non_farm_payrolls, non_farm_payrolls_change, obfr, part_time_employment, participation_rate, pce, pce_mom, policy_rate, policy_rate_midpoint, policy_rate_mlf, policy_rate_mro, policy_rate_target_lower, ppi, primary_income_balance, real_yield_20y, real_yield_30y, real_yield_5y, real_yield_7y, retail_sales, retail_sales_control_group, retail_sales_ex_autos, retail_sales_ex_autos_and_gas, risk_free_rate, secondary_income_balance, sight_deposits, snb_balance_sheet, sofr_average_180d, sofr_average_30d, sofr_average_90d, sofr_index, terms_of_trade, tgcr, trade_balance, trade_weighted_index, trimmed_mean_inflation, unemployment, wage_price_index, wages.",examples:["inflation"],title:"Indicator",example:"average_hourly_earnings"}},{name:"start_date",in:"query",required:!1,schema:{type:"string",description:"Optional query parameter. Optional inclusive lower bound in YYYY-MM-DD format.",examples:["2026-06-01"],title:"Start Date"}},{name:"end_date",in:"query",required:!1,schema:{type:"string",description:"Optional query parameter. Optional inclusive upper bound in YYYY-MM-DD format.",examples:["2026-06-30"],title:"End Date"}},{name:"timezone",in:"query",required:!1,schema:{type:"string",description:"Optional query parameter. Optional IANA timezone for an additional converted timestamp field, for example America/Sao_Paulo.",examples:["America/Sao_Paulo"],title:"Timezone"}}]},{name:"market_sessions",path:"/v1/market_sessions",method:"GET",description:"FX market session timetable",input_schema:{type:"object",properties:{at:{type:"string",description:"Optional query parameter. Optional ISO-8601 UTC timestamp (e.g. 2026-03-05T12:00:00Z)",examples:["2026-03-05T12:00:00Z"],title:"At"}},required:[],additionalProperties:!1},parameters:[{name:"at",in:"query",required:!1,schema:{type:"string",description:"Optional query parameter. Optional ISO-8601 UTC timestamp (e.g. 2026-03-05T12:00:00Z)",examples:["2026-03-05T12:00:00Z"],title:"At"}}]},{name:"rate_differentials",path:"/v1/rate_differentials/{base}/{quote}",method:"GET",description:"Get pair rate differentials",input_schema:{type:"object",properties:{base:{type:"string",description:"Required path parameter. Base currency code Allowed values: AUD, BRL, CAD, CHF, CNH, CNY, DKK, EUR, GBP, ILS, JPY, NGN, NOK, NZD, PEN, SEK, THB, USD.",examples:["AUD"],title:"Base",example:"AUD"},quote:{type:"string",description:"Required path parameter. Quote currency code Allowed values: AUD, BRL, CAD, CHF, CNH, CNY, DKK, EUR, GBP, ILS, JPY, NGN, NOK, NZD, PEN, SEK, THB, USD.",examples:["USD"],title:"Quote",example:"AUD"},measure:{type:"string",description:"Optional query parameter. Shared rate measure to compare across the pair. Allowed values: auto, risk_free_rate, gov_bond_2y, gov_bond_10y, policy_rate.",examples:["auto","risk_free_rate","gov_bond_2y"],default:"auto",title:"Measure",enum:["auto","risk_free_rate","gov_bond_2y","gov_bond_10y","policy_rate"],example:"auto"},rate_type:{type:"string",description:"Optional query parameter. Differential type: spot for shared stored rate measures, forward for derived curve segments. Allowed values: spot, forward.",examples:["spot","forward"],default:"spot",title:"Rate Type",enum:["spot","forward"],example:"spot"},curve_family:{type:"string",description:"Optional query parameter. Curve family used when rate_type=forward. Allowed values: government_nominal.",examples:["government_nominal"],default:"government_nominal",title:"Curve Family",enum:["government_nominal"],example:"government_nominal"},start_tenor_years:{type:"number",description:"Optional query parameter. Start tenor in years when rate_type=forward.",examples:[2],default:2,title:"Start Tenor Years"},end_tenor_years:{type:"number",description:"Optional query parameter. End tenor in years when rate_type=forward.",examples:[5],default:5,title:"End Tenor Years"},start_date:{type:"string",description:"Optional query parameter. Inclusive start date YYYY-MM-DD. Defaults to 365 days ago.",examples:["2026-01-01"],title:"Start Date"},end_date:{type:"string",description:"Optional query parameter. Inclusive end date YYYY-MM-DD. Defaults to today.",examples:["2026-06-01"],title:"End Date"},limit:{type:"integer",maximum:100,minimum:1,description:"Optional query parameter. Maximum rows to return. Defaults to 20. Maximum 100.",default:20,title:"Limit"},offset:{type:"integer",minimum:0,description:"Optional query parameter. Number of rows to skip after most-recent-first ordering.",default:0,title:"Offset"}},required:["base","quote"],additionalProperties:!1},parameters:[{name:"base",in:"path",required:!0,schema:{type:"string",description:"Required path parameter. Base currency code Allowed values: AUD, BRL, CAD, CHF, CNH, CNY, DKK, EUR, GBP, ILS, JPY, NGN, NOK, NZD, PEN, SEK, THB, USD.",examples:["AUD"],title:"Base",example:"AUD"}},{name:"quote",in:"path",required:!0,schema:{type:"string",description:"Required path parameter. Quote currency code Allowed values: AUD, BRL, CAD, CHF, CNH, CNY, DKK, EUR, GBP, ILS, JPY, NGN, NOK, NZD, PEN, SEK, THB, USD.",examples:["USD"],title:"Quote",example:"AUD"}},{name:"measure",in:"query",required:!1,schema:{type:"string",description:"Optional query parameter. Shared rate measure to compare across the pair. Allowed values: auto, risk_free_rate, gov_bond_2y, gov_bond_10y, policy_rate.",examples:["auto","risk_free_rate","gov_bond_2y"],default:"auto",title:"Measure",enum:["auto","risk_free_rate","gov_bond_2y","gov_bond_10y","policy_rate"],example:"auto"}},{name:"rate_type",in:"query",required:!1,schema:{type:"string",description:"Optional query parameter. Differential type: spot for shared stored rate measures, forward for derived curve segments. Allowed values: spot, forward.",examples:["spot","forward"],default:"spot",title:"Rate Type",enum:["spot","forward"],example:"spot"}},{name:"curve_family",in:"query",required:!1,schema:{type:"string",description:"Optional query parameter. Curve family used when rate_type=forward. Allowed values: government_nominal.",examples:["government_nominal"],default:"government_nominal",title:"Curve Family",enum:["government_nominal"],example:"government_nominal"}},{name:"start_tenor_years",in:"query",required:!1,schema:{type:"number",description:"Optional query parameter. Start tenor in years when rate_type=forward.",examples:[2],default:2,title:"Start Tenor Years"}},{name:"end_tenor_years",in:"query",required:!1,schema:{type:"number",description:"Optional query parameter. End tenor in years when rate_type=forward.",examples:[5],default:5,title:"End Tenor Years"}},{name:"start_date",in:"query",required:!1,schema:{type:"string",description:"Optional query parameter. Inclusive start date YYYY-MM-DD. Defaults to 365 days ago.",examples:["2026-01-01"],title:"Start Date"}},{name:"end_date",in:"query",required:!1,schema:{type:"string",description:"Optional query parameter. Inclusive end date YYYY-MM-DD. Defaults to today.",examples:["2026-06-01"],title:"End Date"}},{name:"limit",in:"query",required:!1,schema:{type:"integer",maximum:100,minimum:1,description:"Optional query parameter. Maximum rows to return. Defaults to 20. Maximum 100.",default:20,title:"Limit"}},{name:"offset",in:"query",required:!1,schema:{type:"integer",minimum:0,description:"Optional query parameter. Number of rows to skip after most-recent-first ordering.",default:0,title:"Offset"}}]},{name:"curves",path:"/v1/curves/{currency}",method:"GET",description:"Get curve analytics by currency",input_schema:{type:"object",properties:{currency:{type:"string",description:"Required path parameter. Currency code Allowed values: AUD, CAD, CHF, CNH, CNY, DKK, EUR, GBP, ILS, JPY, NOK, NZD, PEN, SEK, THB, USD.",examples:["GBP"],title:"Currency",example:"AUD"},curve_family:{type:"string",description:"Optional query parameter. Official curve family to return. Allowed values: government_nominal.",examples:["government_nominal"],default:"government_nominal",title:"Curve Family",enum:["government_nominal"],example:"government_nominal"},metric:{type:"string",description:"Optional query parameter. Curve metric to return. Allowed values: spot.",examples:["spot"],default:"spot",title:"Metric",enum:["spot"],example:"spot"},view:{type:"string",description:"Optional query parameter. Curve view to return: nodes, slopes, or forwards. Allowed values: nodes, slopes, forwards.",examples:["nodes","slopes","forwards"],default:"nodes",title:"View",enum:["nodes","slopes","forwards"],example:"nodes"},method:{type:"string",description:"Optional query parameter. Forward derivation method used when view=forwards. Allowed values: derived_from_spot_nodes.",examples:["derived_from_spot_nodes"],default:"derived_from_spot_nodes",title:"Method",enum:["derived_from_spot_nodes"],example:"derived_from_spot_nodes"},date:{type:"string",description:"Optional query parameter. Optional target date YYYY-MM-DD. The endpoint returns the latest stored node per maturity up to this date, using a recent lookback window.",examples:["2026-06-01"],title:"Date"}},required:["currency"],additionalProperties:!1},parameters:[{name:"currency",in:"path",required:!0,schema:{type:"string",description:"Required path parameter. Currency code Allowed values: AUD, CAD, CHF, CNH, CNY, DKK, EUR, GBP, ILS, JPY, NOK, NZD, PEN, SEK, THB, USD.",examples:["GBP"],title:"Currency",example:"AUD"}},{name:"curve_family",in:"query",required:!1,schema:{type:"string",description:"Optional query parameter. Official curve family to return. Allowed values: government_nominal.",examples:["government_nominal"],default:"government_nominal",title:"Curve Family",enum:["government_nominal"],example:"government_nominal"}},{name:"metric",in:"query",required:!1,schema:{type:"string",description:"Optional query parameter. Curve metric to return. Allowed values: spot.",examples:["spot"],default:"spot",title:"Metric",enum:["spot"],example:"spot"}},{name:"view",in:"query",required:!1,schema:{type:"string",description:"Optional query parameter. Curve view to return: nodes, slopes, or forwards. Allowed values: nodes, slopes, forwards.",examples:["nodes","slopes","forwards"],default:"nodes",title:"View",enum:["nodes","slopes","forwards"],example:"nodes"}},{name:"method",in:"query",required:!1,schema:{type:"string",description:"Optional query parameter. Forward derivation method used when view=forwards. Allowed values: derived_from_spot_nodes.",examples:["derived_from_spot_nodes"],default:"derived_from_spot_nodes",title:"Method",enum:["derived_from_spot_nodes"],example:"derived_from_spot_nodes"}},{name:"date",in:"query",required:!1,schema:{type:"string",description:"Optional query parameter. Optional target date YYYY-MM-DD. The endpoint returns the latest stored node per maturity up to this date, using a recent lookback window.",examples:["2026-06-01"],title:"Date"}}]},{name:"financial_prices",path:"/v1/financial_prices/{currency}",method:"GET",description:"Official financial prices and yield curves",input_schema:{type:"object",properties:{currency:{type:"string",title:"Currency",description:"Required path parameter."},source:{anyOf:[{type:"string",maxLength:80},{type:"null"}],title:"Source",description:"Optional query parameter."},start_date:{anyOf:[{type:"string",format:"date"},{type:"null"}],title:"Start Date",description:"Optional query parameter."},end_date:{anyOf:[{type:"string",format:"date"},{type:"null"}],title:"End Date",description:"Optional query parameter."},measure:{anyOf:[{type:"string",maxLength:60},{type:"null"}],title:"Measure",description:"Optional query parameter."},instrument_id:{anyOf:[{type:"string",maxLength:240},{type:"null"}],title:"Instrument Id",description:"Optional query parameter."},issuer:{anyOf:[{type:"string",maxLength:240},{type:"null"}],title:"Issuer",description:"Optional query parameter."},limit:{type:"integer",maximum:100,minimum:1,default:100,title:"Limit",description:"Optional query parameter."},offset:{type:"integer",minimum:0,default:0,title:"Offset",description:"Optional query parameter."}},required:["currency"],additionalProperties:!1},parameters:[{name:"currency",in:"path",required:!0,schema:{type:"string",title:"Currency",description:"Required path parameter."}},{name:"source",in:"query",required:!1,schema:{anyOf:[{type:"string",maxLength:80},{type:"null"}],title:"Source",description:"Optional query parameter."}},{name:"start_date",in:"query",required:!1,schema:{anyOf:[{type:"string",format:"date"},{type:"null"}],title:"Start Date",description:"Optional query parameter."}},{name:"end_date",in:"query",required:!1,schema:{anyOf:[{type:"string",format:"date"},{type:"null"}],title:"End Date",description:"Optional query parameter."}},{name:"measure",in:"query",required:!1,schema:{anyOf:[{type:"string",maxLength:60},{type:"null"}],title:"Measure",description:"Optional query parameter."}},{name:"instrument_id",in:"query",required:!1,schema:{anyOf:[{type:"string",maxLength:240},{type:"null"}],title:"Instrument Id",description:"Optional query parameter."}},{name:"issuer",in:"query",required:!1,schema:{anyOf:[{type:"string",maxLength:240},{type:"null"}],title:"Issuer",description:"Optional query parameter."}},{name:"limit",in:"query",required:!1,schema:{type:"integer",maximum:100,minimum:1,default:100,title:"Limit",description:"Optional query parameter."}},{name:"offset",in:"query",required:!1,schema:{type:"integer",minimum:0,default:0,title:"Offset",description:"Optional query parameter."}}]},{name:"press_releases",path:"/v1/press-releases/{currency}",method:"GET",description:"Recent central bank press releases",input_schema:{type:"object",properties:{currency:{type:"string",title:"Currency",example:"AUD",description:"Required path parameter. Allowed values: AUD, BRL, CAD, CHF, CZK, DKK, EUR, GBP, HKD, INR, JPY, NOK, NZD, PEN, PLN, SEK, USD, ZAR."},limit:{type:"integer",maximum:50,minimum:1,description:"Optional query parameter. Maximum number of press releases to return",examples:[10],default:20,title:"Limit"},offset:{type:"integer",minimum:0,description:"Optional query parameter. Zero-based offset into the full press-release feed before pagination.",default:0,title:"Offset"}},required:["currency"],additionalProperties:!1},parameters:[{name:"currency",in:"path",required:!0,schema:{type:"string",title:"Currency",example:"AUD",description:"Required path parameter. Allowed values: AUD, BRL, CAD, CHF, CZK, DKK, EUR, GBP, HKD, INR, JPY, NOK, NZD, PEN, PLN, SEK, USD, ZAR."}},{name:"limit",in:"query",required:!1,schema:{type:"integer",maximum:50,minimum:1,description:"Optional query parameter. Maximum number of press releases to return",examples:[10],default:20,title:"Limit"}},{name:"offset",in:"query",required:!1,schema:{type:"integer",minimum:0,description:"Optional query parameter. Zero-based offset into the full press-release feed before pagination.",default:0,title:"Offset"}}]},{name:"risk_sentiment",path:"/v1/risk_sentiment",method:"GET",description:"Global risk-on / risk-off indicator",input_schema:{type:"object",properties:{start_date:{type:"string",description:"Optional query parameter. Start date YYYY-MM-DD",examples:["2025-12-01"],title:"Start Date"},end_date:{type:"string",description:"Optional query parameter. End date YYYY-MM-DD",examples:["2026-03-01"],title:"End Date"},limit:{type:"integer",maximum:100,minimum:1,description:"Optional query parameter. Maximum rows to return. Defaults to 20. Maximum 100.",default:20,title:"Limit"},offset:{type:"integer",minimum:0,description:"Optional query parameter. Number of rows to skip after most-recent-first ordering.",default:0,title:"Offset"}},required:[],additionalProperties:!1},parameters:[{name:"start_date",in:"query",required:!1,schema:{type:"string",description:"Optional query parameter. Start date YYYY-MM-DD",examples:["2025-12-01"],title:"Start Date"}},{name:"end_date",in:"query",required:!1,schema:{type:"string",description:"Optional query parameter. End date YYYY-MM-DD",examples:["2026-03-01"],title:"End Date"}},{name:"limit",in:"query",required:!1,schema:{type:"integer",maximum:100,minimum:1,description:"Optional query parameter. Maximum rows to return. Defaults to 20. Maximum 100.",default:20,title:"Limit"}},{name:"offset",in:"query",required:!1,schema:{type:"integer",minimum:0,description:"Optional query parameter. Number of rows to skip after most-recent-first ordering.",default:0,title:"Offset"}}]},{name:"factors",path:"/v1/factors/{currency}/{factor}",method:"GET",description:"Get a precomputed FX factor for one currency",input_schema:{type:"object",properties:{currency:{type:"string",title:"Currency",example:"AUD",description:"Required path parameter. Allowed values: AUD, CAD, CHF, EUR, GBP, JPY, NZD, USD."},factor:{type:"string",description:"Required path parameter. Factor slug, for example monetary_stance. Allowed values: monetary_stance.",examples:["monetary_stance"],title:"Factor",enum:["monetary_stance"],example:"monetary_stance"},start_date:{type:"string",description:"Optional query parameter. Inclusive start date YYYY-MM-DD. With no dates, returns latest only.",examples:["2026-01-01"],title:"Start Date"},end_date:{type:"string",description:"Optional query parameter. Inclusive end date YYYY-MM-DD. Defaults to today when start_date is supplied.",examples:["2026-07-19"],title:"End Date"},include_components:{type:"boolean",description:"Optional query parameter. Include stored component scores and source observations.",default:!1,title:"Include Components"},include_sources:{type:"boolean",description:"Optional query parameter. Include stored FXMacroData source endpoint URLs.",default:!1,title:"Include Sources"},limit:{type:"integer",maximum:100,minimum:1,description:"Optional query parameter. Maximum rows to return. Defaults to 20. Maximum 100.",default:20,title:"Limit"},offset:{type:"integer",minimum:0,description:"Optional query parameter. Number of rows to skip after most-recent-first ordering.",default:0,title:"Offset"}},required:["currency","factor"],additionalProperties:!1},parameters:[{name:"currency",in:"path",required:!0,schema:{type:"string",title:"Currency",example:"AUD",description:"Required path parameter. Allowed values: AUD, CAD, CHF, EUR, GBP, JPY, NZD, USD."}},{name:"factor",in:"path",required:!0,schema:{type:"string",description:"Required path parameter. Factor slug, for example monetary_stance. Allowed values: monetary_stance.",examples:["monetary_stance"],title:"Factor",enum:["monetary_stance"],example:"monetary_stance"}},{name:"start_date",in:"query",required:!1,schema:{type:"string",description:"Optional query parameter. Inclusive start date YYYY-MM-DD. With no dates, returns latest only.",examples:["2026-01-01"],title:"Start Date"}},{name:"end_date",in:"query",required:!1,schema:{type:"string",description:"Optional query parameter. Inclusive end date YYYY-MM-DD. Defaults to today when start_date is supplied.",examples:["2026-07-19"],title:"End Date"}},{name:"include_components",in:"query",required:!1,schema:{type:"boolean",description:"Optional query parameter. Include stored component scores and source observations.",default:!1,title:"Include Components"}},{name:"include_sources",in:"query",required:!1,schema:{type:"boolean",description:"Optional query parameter. Include stored FXMacroData source endpoint URLs.",default:!1,title:"Include Sources"}},{name:"limit",in:"query",required:!1,schema:{type:"integer",maximum:100,minimum:1,description:"Optional query parameter. Maximum rows to return. Defaults to 20. Maximum 100.",default:20,title:"Limit"}},{name:"offset",in:"query",required:!1,schema:{type:"integer",minimum:0,description:"Optional query parameter. Number of rows to skip after most-recent-first ordering.",default:0,title:"Offset"}}]},{name:"event_predictions",path:"/v1/predictions/{currency}/{indicator}",method:"GET",description:"List predictions for one indicator of a currency",input_schema:{type:"object",properties:{currency:{type:"string",title:"Currency",example:"AUD",description:"Required path parameter. Allowed values: AUD, BRL, CAD, CHF, CNH, CNY, DKK, EUR, GBP, ILS, JPY, NGN, NOK, NZD, PEN, SEK, THB, USD."},indicator:{type:"string",description:"Required path parameter. Indicator slug Allowed values: average_hourly_earnings, average_hourly_earnings_mom, balance_on_goods, balance_on_services, bgcr, breakeven_inflation_rate, broad_money, building_approvals, building_permits, business_confidence, capital_account_balance, cb_assets, commodity_price_energy, commodity_price_ex_energy, commodity_price_index, commodity_prices, consumer_confidence, core_inflation, core_inflation_median, core_inflation_mom, core_inflation_trim, core_pce, core_pce_mom, credit_growth, crude_oil_inventories, current_account_balance, dairy_exports, deposit_rates, durable_goods_orders, effr, employment, exports, financial_account_balance, foreign_reserves, full_time_employment, fx_reserves, gdp, gdp_growth_q4_yoy, gold_reserves, gov_bond_10y, gov_bond_15y, gov_bond_1_5m, gov_bond_1m, gov_bond_1y, gov_bond_20y, gov_bond_25y, gov_bond_2m, gov_bond_2y, gov_bond_30y, gov_bond_3m, gov_bond_3y, gov_bond_40y, gov_bond_4m, gov_bond_4y, gov_bond_5y, gov_bond_6m, gov_bond_6y, gov_bond_7y, gov_bond_8y, gov_bond_9y, government_debt, house_price_index, house_prices, household_credit, household_spending, housing_starts, imports, inflation, inflation_linked_bond, inflation_mom, initial_jobless_claims, international_assets, international_liabilities, job_openings, m1, m2, m3, nairu, natural_gas_storage, net_foreign_asset_position, non_farm_payrolls, non_farm_payrolls_change, obfr, part_time_employment, participation_rate, pce, pce_mom, policy_rate, policy_rate_midpoint, policy_rate_mlf, policy_rate_mro, policy_rate_target_lower, ppi, primary_income_balance, real_yield_20y, real_yield_30y, real_yield_5y, real_yield_7y, retail_sales, retail_sales_control_group, retail_sales_ex_autos, retail_sales_ex_autos_and_gas, risk_free_rate, secondary_income_balance, sight_deposits, snb_balance_sheet, sofr_average_180d, sofr_average_30d, sofr_average_90d, sofr_index, terms_of_trade, tgcr, trade_balance, trade_weighted_index, trimmed_mean_inflation, unemployment, wage_price_index, wages.",examples:["inflation"],title:"Indicator",example:"average_hourly_earnings"},prediction_class:{anyOf:[{enum:["compiled_consensus","forecaster_survey","market_implied","model_nowcast","central_bank_projection","institutional_projection","fxmacrodata"],type:"string"},{type:"null"}],description:"Optional query parameter. Filter by how the forecast was produced. Prefer this over `prediction_type`: one class can span several legacy types, which is how `forecaster_survey` returns both the ECB and Philadelphia Fed Surveys of Professional Forecasters.",title:"Prediction Class"},prediction_type:{anyOf:[{enum:["market_consensus","market_prediction","model_nowcast","survey","central_bank_forecast","central_bank_projection","imf_weo","oecd_eo","fxmacrodata"],type:"string"},{type:"null"}],description:"Optional query parameter. Optional legacy prediction-type filter, retained unchanged for existing clients. Superseded by `prediction_class`.",title:"Prediction Type"},prediction_source:{anyOf:[{type:"string"},{type:"null"}],description:"Optional query parameter. Optional source identifier filter.",title:"Prediction Source"},official_limit:{type:"integer",maximum:2e3,minimum:0,description:"Optional query parameter. Maximum rows in ``official_forecasts`` (native-period official forecasts and surveys). 0 omits them.",default:500,title:"Official Limit"},pre_release_only:{type:"boolean",description:"Optional query parameter. Return only forecasts with `generated_at` strictly before the linked `announcement_datetime` (default: true). The prediction store only persists pre-release rows \u2014 the write path rejects any forecast generated at or after the announcement \u2014 so this flag is informational: post-event records do not exist and setting it to false does not return additional rows.",default:!0,title:"Pre Release Only"},seasonality:{anyOf:[{type:"string"},{type:"null"}],description:"Optional query parameter. Optional seasonal adjustment selector, matching /v1/announcements. Allowed values: sa, nsa.",title:"Seasonality",enum:["sa","nsa"],example:"sa"},frequency:{anyOf:[{type:"string"},{type:"null"}],description:"Optional query parameter. Optional returned change basis selector, matching /v1/announcements. Allowed values: level, yoy, qoq, mom.",title:"Frequency",enum:["level","yoy","qoq","mom"],example:"level"},annualization:{anyOf:[{type:"string"},{type:"null"}],description:"Optional query parameter. Optional annualization selector, matching /v1/announcements. Allowed values: not_annualized, saar.",title:"Annualization",enum:["not_annualized","saar"],example:"not_annualized"},period_aggregation:{anyOf:[{type:"string"},{type:"null"}],description:"Optional query parameter. Optional period aggregation selector, matching /v1/announcements. Allowed values: monthly, quarterly_average.",title:"Period Aggregation",enum:["monthly","quarterly_average"],example:"monthly"},basis:{anyOf:[{type:"string"},{type:"null"}],description:"Optional query parameter. Optional real/nominal selector, matching /v1/announcements. Allowed values: real, nominal.",title:"Basis",enum:["real","nominal"],example:"real"},start_date:{anyOf:[{type:"string"},{type:"null"}],description:"Optional query parameter. Start date YYYY-MM-DD (period date). Defaults to 180 days before today when omitted.",title:"Start Date"},end_date:{anyOf:[{type:"string"},{type:"null"}],description:"Optional query parameter. End date YYYY-MM-DD (period date). Defaults to 90 days ahead when omitted.",title:"End Date"},limit:{type:"integer",maximum:100,minimum:1,description:"Optional query parameter. Maximum number of prediction groups to return in `data[]`. Use with `offset` to page through long histories. Defaults to 20. Maximum 100.",examples:[20],default:20,title:"Limit"},offset:{type:"integer",minimum:0,description:"Optional query parameter. Number of prediction groups to skip from the start of `data[]`. Use with `limit` for pagination. Defaults to 0.",examples:[0],default:0,title:"Offset"},page:{anyOf:[{type:"integer",minimum:1},{type:"null"}],description:"Optional query parameter. One-based page number. When supplied, it takes precedence over offset.",examples:[1],title:"Page"},before_date:{anyOf:[{type:"string"},{type:"null"}],description:"Optional query parameter. Return groups strictly before this YYYY-MM-DD period date. Use the previous response's `next_cursor` for bounded pagination.",title:"Before Date"}},required:["currency","indicator"],additionalProperties:!1},parameters:[{name:"currency",in:"path",required:!0,schema:{type:"string",title:"Currency",example:"AUD",description:"Required path parameter. Allowed values: AUD, BRL, CAD, CHF, CNH, CNY, DKK, EUR, GBP, ILS, JPY, NGN, NOK, NZD, PEN, SEK, THB, USD."}},{name:"indicator",in:"path",required:!0,schema:{type:"string",description:"Required path parameter. Indicator slug Allowed values: average_hourly_earnings, average_hourly_earnings_mom, balance_on_goods, balance_on_services, bgcr, breakeven_inflation_rate, broad_money, building_approvals, building_permits, business_confidence, capital_account_balance, cb_assets, commodity_price_energy, commodity_price_ex_energy, commodity_price_index, commodity_prices, consumer_confidence, core_inflation, core_inflation_median, core_inflation_mom, core_inflation_trim, core_pce, core_pce_mom, credit_growth, crude_oil_inventories, current_account_balance, dairy_exports, deposit_rates, durable_goods_orders, effr, employment, exports, financial_account_balance, foreign_reserves, full_time_employment, fx_reserves, gdp, gdp_growth_q4_yoy, gold_reserves, gov_bond_10y, gov_bond_15y, gov_bond_1_5m, gov_bond_1m, gov_bond_1y, gov_bond_20y, gov_bond_25y, gov_bond_2m, gov_bond_2y, gov_bond_30y, gov_bond_3m, gov_bond_3y, gov_bond_40y, gov_bond_4m, gov_bond_4y, gov_bond_5y, gov_bond_6m, gov_bond_6y, gov_bond_7y, gov_bond_8y, gov_bond_9y, government_debt, house_price_index, house_prices, household_credit, household_spending, housing_starts, imports, inflation, inflation_linked_bond, inflation_mom, initial_jobless_claims, international_assets, international_liabilities, job_openings, m1, m2, m3, nairu, natural_gas_storage, net_foreign_asset_position, non_farm_payrolls, non_farm_payrolls_change, obfr, part_time_employment, participation_rate, pce, pce_mom, policy_rate, policy_rate_midpoint, policy_rate_mlf, policy_rate_mro, policy_rate_target_lower, ppi, primary_income_balance, real_yield_20y, real_yield_30y, real_yield_5y, real_yield_7y, retail_sales, retail_sales_control_group, retail_sales_ex_autos, retail_sales_ex_autos_and_gas, risk_free_rate, secondary_income_balance, sight_deposits, snb_balance_sheet, sofr_average_180d, sofr_average_30d, sofr_average_90d, sofr_index, terms_of_trade, tgcr, trade_balance, trade_weighted_index, trimmed_mean_inflation, unemployment, wage_price_index, wages.",examples:["inflation"],title:"Indicator",example:"average_hourly_earnings"}},{name:"prediction_class",in:"query",required:!1,schema:{anyOf:[{enum:["compiled_consensus","forecaster_survey","market_implied","model_nowcast","central_bank_projection","institutional_projection","fxmacrodata"],type:"string"},{type:"null"}],description:"Optional query parameter. Filter by how the forecast was produced. Prefer this over `prediction_type`: one class can span several legacy types, which is how `forecaster_survey` returns both the ECB and Philadelphia Fed Surveys of Professional Forecasters.",title:"Prediction Class"}},{name:"prediction_type",in:"query",required:!1,schema:{anyOf:[{enum:["market_consensus","market_prediction","model_nowcast","survey","central_bank_forecast","central_bank_projection","imf_weo","oecd_eo","fxmacrodata"],type:"string"},{type:"null"}],description:"Optional query parameter. Optional legacy prediction-type filter, retained unchanged for existing clients. Superseded by `prediction_class`.",title:"Prediction Type"}},{name:"prediction_source",in:"query",required:!1,schema:{anyOf:[{type:"string"},{type:"null"}],description:"Optional query parameter. Optional source identifier filter.",title:"Prediction Source"}},{name:"official_limit",in:"query",required:!1,schema:{type:"integer",maximum:2e3,minimum:0,description:"Optional query parameter. Maximum rows in ``official_forecasts`` (native-period official forecasts and surveys). 0 omits them.",default:500,title:"Official Limit"}},{name:"pre_release_only",in:"query",required:!1,schema:{type:"boolean",description:"Optional query parameter. Return only forecasts with `generated_at` strictly before the linked `announcement_datetime` (default: true). The prediction store only persists pre-release rows \u2014 the write path rejects any forecast generated at or after the announcement \u2014 so this flag is informational: post-event records do not exist and setting it to false does not return additional rows.",default:!0,title:"Pre Release Only"}},{name:"seasonality",in:"query",required:!1,schema:{anyOf:[{type:"string"},{type:"null"}],description:"Optional query parameter. Optional seasonal adjustment selector, matching /v1/announcements. Allowed values: sa, nsa.",title:"Seasonality",enum:["sa","nsa"],example:"sa"}},{name:"frequency",in:"query",required:!1,schema:{anyOf:[{type:"string"},{type:"null"}],description:"Optional query parameter. Optional returned change basis selector, matching /v1/announcements. Allowed values: level, yoy, qoq, mom.",title:"Frequency",enum:["level","yoy","qoq","mom"],example:"level"}},{name:"annualization",in:"query",required:!1,schema:{anyOf:[{type:"string"},{type:"null"}],description:"Optional query parameter. Optional annualization selector, matching /v1/announcements. Allowed values: not_annualized, saar.",title:"Annualization",enum:["not_annualized","saar"],example:"not_annualized"}},{name:"period_aggregation",in:"query",required:!1,schema:{anyOf:[{type:"string"},{type:"null"}],description:"Optional query parameter. Optional period aggregation selector, matching /v1/announcements. Allowed values: monthly, quarterly_average.",title:"Period Aggregation",enum:["monthly","quarterly_average"],example:"monthly"}},{name:"basis",in:"query",required:!1,schema:{anyOf:[{type:"string"},{type:"null"}],description:"Optional query parameter. Optional real/nominal selector, matching /v1/announcements. Allowed values: real, nominal.",title:"Basis",enum:["real","nominal"],example:"real"}},{name:"start_date",in:"query",required:!1,schema:{anyOf:[{type:"string"},{type:"null"}],description:"Optional query parameter. Start date YYYY-MM-DD (period date). Defaults to 180 days before today when omitted.",title:"Start Date"}},{name:"end_date",in:"query",required:!1,schema:{anyOf:[{type:"string"},{type:"null"}],description:"Optional query parameter. End date YYYY-MM-DD (period date). Defaults to 90 days ahead when omitted.",title:"End Date"}},{name:"limit",in:"query",required:!1,schema:{type:"integer",maximum:100,minimum:1,description:"Optional query parameter. Maximum number of prediction groups to return in `data[]`. Use with `offset` to page through long histories. Defaults to 20. Maximum 100.",examples:[20],default:20,title:"Limit"}},{name:"offset",in:"query",required:!1,schema:{type:"integer",minimum:0,description:"Optional query parameter. Number of prediction groups to skip from the start of `data[]`. Use with `limit` for pagination. Defaults to 0.",examples:[0],default:0,title:"Offset"}},{name:"page",in:"query",required:!1,schema:{anyOf:[{type:"integer",minimum:1},{type:"null"}],description:"Optional query parameter. One-based page number. When supplied, it takes precedence over offset.",examples:[1],title:"Page"}},{name:"before_date",in:"query",required:!1,schema:{anyOf:[{type:"string"},{type:"null"}],description:"Optional query parameter. Return groups strictly before this YYYY-MM-DD period date. Use the previous response's `next_cursor` for bounded pagination.",title:"Before Date"}}]},{name:"latest_announcements",path:"/v1/announcements/{currency}/latest",method:"GET",description:"Get latest stored values for all indicators in a currency",input_schema:{type:"object",properties:{currency:{type:"string",title:"Currency",example:"AUD",description:"Required path parameter. Allowed values: AUD, BRL, CAD, CHF, CNH, CNY, DKK, EUR, GBP, ILS, JPY, NGN, NOK, NZD, PEN, SEK, THB, USD."}},required:["currency"],additionalProperties:!1},parameters:[{name:"currency",in:"path",required:!0,schema:{type:"string",title:"Currency",example:"AUD",description:"Required path parameter. Allowed values: AUD, BRL, CAD, CHF, CNH, CNY, DKK, EUR, GBP, ILS, JPY, NGN, NOK, NZD, PEN, SEK, THB, USD."}}]},{name:"indicator_history",path:"/v1/announcements/{currency}/{indicator}",method:"GET",description:"Get macroeconomic indicator data",input_schema:{type:"object",properties:{currency:{type:"string",title:"Currency",example:"AUD",description:"Required path parameter. Allowed values: AUD, BRL, CAD, CHF, CNH, CNY, DKK, EUR, GBP, ILS, JPY, NGN, NOK, NZD, PEN, SEK, THB, USD."},indicator:{type:"string",title:"Indicator",example:"average_hourly_earnings",description:"Required path parameter. Allowed values: average_hourly_earnings, average_hourly_earnings_mom, balance_on_goods, balance_on_services, bgcr, breakeven_inflation_rate, broad_money, building_approvals, building_permits, business_confidence, capital_account_balance, cb_assets, commodity_price_energy, commodity_price_ex_energy, commodity_price_index, commodity_prices, consumer_confidence, core_inflation, core_inflation_median, core_inflation_mom, core_inflation_trim, core_pce, core_pce_mom, credit_growth, crude_oil_inventories, current_account_balance, dairy_exports, deposit_rates, durable_goods_orders, effr, employment, exports, financial_account_balance, foreign_reserves, full_time_employment, fx_reserves, gdp, gdp_growth_q4_yoy, gold_reserves, gov_bond_10y, gov_bond_15y, gov_bond_1_5m, gov_bond_1m, gov_bond_1y, gov_bond_20y, gov_bond_25y, gov_bond_2m, gov_bond_2y, gov_bond_30y, gov_bond_3m, gov_bond_3y, gov_bond_40y, gov_bond_4m, gov_bond_4y, gov_bond_5y, gov_bond_6m, gov_bond_6y, gov_bond_7y, gov_bond_8y, gov_bond_9y, government_debt, house_price_index, house_prices, household_credit, household_spending, housing_starts, imports, inflation, inflation_linked_bond, inflation_mom, initial_jobless_claims, international_assets, international_liabilities, job_openings, m1, m2, m3, nairu, natural_gas_storage, net_foreign_asset_position, non_farm_payrolls, non_farm_payrolls_change, obfr, part_time_employment, participation_rate, pce, pce_mom, policy_rate, policy_rate_midpoint, policy_rate_mlf, policy_rate_mro, policy_rate_target_lower, ppi, primary_income_balance, real_yield_20y, real_yield_30y, real_yield_5y, real_yield_7y, retail_sales, retail_sales_control_group, retail_sales_ex_autos, retail_sales_ex_autos_and_gas, risk_free_rate, secondary_income_balance, sight_deposits, snb_balance_sheet, sofr_average_180d, sofr_average_30d, sofr_average_90d, sofr_index, terms_of_trade, tgcr, trade_balance, trade_weighted_index, trimmed_mean_inflation, unemployment, wage_price_index, wages."},start_date:{type:"string",description:"Optional query parameter. Start date YYYY-MM-DD",examples:["2025-01-01"],title:"Start Date"},end_date:{type:"string",description:"Optional query parameter. End date YYYY-MM-DD",examples:["2026-03-01"],title:"End Date"},series_mode:{type:"string",pattern:"^(raw|canonical)$",description:"Optional query parameter. Optional series rendering mode. `canonical` applies configured remap rules (for continuity across methodology transitions). `raw` returns the direct indicator series without remapping.",examples:["raw"],default:"raw",title:"Series Mode"},limit:{type:"integer",maximum:100,minimum:1,description:"Optional query parameter. Maximum number of rows to return in `data[]`. Rows are ordered most-recent-first, so `limit=10` returns the 10 most recent observations within the requested window. Use together with `offset` to page through long histories. Defaults to 20. Maximum 100.",examples:[20],default:20,title:"Limit"},offset:{type:"integer",minimum:0,description:"Optional query parameter. Number of rows to skip from the start of `data[]` (after most-recent-first ordering). Use with `limit` for pagination. Defaults to 0.",examples:[0],default:0,title:"Offset"},page:{anyOf:[{type:"integer",minimum:1},{type:"null"}],description:"Optional query parameter. One-based page number for callers that prefer page-based pagination. When supplied, `offset` is derived as `(page - 1) * limit`.",examples:[1],title:"Page"},seasonality:{anyOf:[{type:"string"},{type:"null"}],description:"Optional query parameter. Optional seasonal adjustment selector. Supported public values are `sa` and `nsa`; check `supported_options.seasonality` in the response/catalogue for values available on this endpoint. Allowed values: sa, nsa.",examples:["sa"],title:"Seasonality",enum:["sa","nsa"],example:"sa"},frequency:{anyOf:[{type:"string"},{type:"null"}],description:"Optional query parameter. Optional returned change basis. Supported public values are `level`, `yoy`, `qoq`, and `mom`; check `supported_options.frequency` for values available on this endpoint. Allowed values: level, yoy, qoq, mom.",examples:["yoy"],title:"Frequency",enum:["level","yoy","qoq","mom"],example:"level"},annualization:{anyOf:[{type:"string"},{type:"null"}],description:"Optional query parameter. Optional annualization selector. Supported public values are `not_annualized` and `saar`; check `supported_options.annualization` for values available on this endpoint. Allowed values: not_annualized, saar.",examples:["saar"],title:"Annualization",enum:["not_annualized","saar"],example:"not_annualized"},period_aggregation:{anyOf:[{type:"string"},{type:"null"}],description:"Optional query parameter. Optional period-aggregation selector. Supported public values are `monthly` and `quarterly_average`; check `supported_options.period_aggregation` for values available on this endpoint. Allowed values: monthly, quarterly_average.",examples:["quarterly_average"],title:"Period Aggregation",enum:["monthly","quarterly_average"],example:"monthly"},revisions:{anyOf:[{type:"string"},{type:"null"}],description:"Optional query parameter. Optional revision view. Supported public values are `latest`, `first`, `final`, and `all`; unsupported views return `unsupported_series_option` with supported values. Allowed values: latest, first, final, all.",examples:["latest"],default:"latest",title:"Revisions",enum:["latest","first","final","all"],example:"latest"},basis:{anyOf:[{type:"string"},{type:"null"}],description:"Optional query parameter. Optional real/nominal selector. Supported public values are `real` and `nominal`; only endpoints with known basis metadata accept it. Allowed values: real, nominal.",examples:["real"],title:"Basis",enum:["real","nominal"],example:"real"},official_only:{type:"boolean",description:"Optional query parameter. When true, return only official-source rows and remove explicit fallback observations. Prohibited private aggregator rows are always removed regardless of this setting.",examples:[!0],default:!0,title:"Official Only"}},required:["currency","indicator"],additionalProperties:!1},parameters:[{name:"currency",in:"path",required:!0,schema:{type:"string",title:"Currency",example:"AUD",description:"Required path parameter. Allowed values: AUD, BRL, CAD, CHF, CNH, CNY, DKK, EUR, GBP, ILS, JPY, NGN, NOK, NZD, PEN, SEK, THB, USD."}},{name:"indicator",in:"path",required:!0,schema:{type:"string",title:"Indicator",example:"average_hourly_earnings",description:"Required path parameter. Allowed values: average_hourly_earnings, average_hourly_earnings_mom, balance_on_goods, balance_on_services, bgcr, breakeven_inflation_rate, broad_money, building_approvals, building_permits, business_confidence, capital_account_balance, cb_assets, commodity_price_energy, commodity_price_ex_energy, commodity_price_index, commodity_prices, consumer_confidence, core_inflation, core_inflation_median, core_inflation_mom, core_inflation_trim, core_pce, core_pce_mom, credit_growth, crude_oil_inventories, current_account_balance, dairy_exports, deposit_rates, durable_goods_orders, effr, employment, exports, financial_account_balance, foreign_reserves, full_time_employment, fx_reserves, gdp, gdp_growth_q4_yoy, gold_reserves, gov_bond_10y, gov_bond_15y, gov_bond_1_5m, gov_bond_1m, gov_bond_1y, gov_bond_20y, gov_bond_25y, gov_bond_2m, gov_bond_2y, gov_bond_30y, gov_bond_3m, gov_bond_3y, gov_bond_40y, gov_bond_4m, gov_bond_4y, gov_bond_5y, gov_bond_6m, gov_bond_6y, gov_bond_7y, gov_bond_8y, gov_bond_9y, government_debt, house_price_index, house_prices, household_credit, household_spending, housing_starts, imports, inflation, inflation_linked_bond, inflation_mom, initial_jobless_claims, international_assets, international_liabilities, job_openings, m1, m2, m3, nairu, natural_gas_storage, net_foreign_asset_position, non_farm_payrolls, non_farm_payrolls_change, obfr, part_time_employment, participation_rate, pce, pce_mom, policy_rate, policy_rate_midpoint, policy_rate_mlf, policy_rate_mro, policy_rate_target_lower, ppi, primary_income_balance, real_yield_20y, real_yield_30y, real_yield_5y, real_yield_7y, retail_sales, retail_sales_control_group, retail_sales_ex_autos, retail_sales_ex_autos_and_gas, risk_free_rate, secondary_income_balance, sight_deposits, snb_balance_sheet, sofr_average_180d, sofr_average_30d, sofr_average_90d, sofr_index, terms_of_trade, tgcr, trade_balance, trade_weighted_index, trimmed_mean_inflation, unemployment, wage_price_index, wages."}},{name:"start_date",in:"query",required:!1,schema:{type:"string",description:"Optional query parameter. Start date YYYY-MM-DD",examples:["2025-01-01"],title:"Start Date"}},{name:"end_date",in:"query",required:!1,schema:{type:"string",description:"Optional query parameter. End date YYYY-MM-DD",examples:["2026-03-01"],title:"End Date"}},{name:"series_mode",in:"query",required:!1,schema:{type:"string",pattern:"^(raw|canonical)$",description:"Optional query parameter. Optional series rendering mode. `canonical` applies configured remap rules (for continuity across methodology transitions). `raw` returns the direct indicator series without remapping.",examples:["raw"],default:"raw",title:"Series Mode"}},{name:"limit",in:"query",required:!1,schema:{type:"integer",maximum:100,minimum:1,description:"Optional query parameter. Maximum number of rows to return in `data[]`. Rows are ordered most-recent-first, so `limit=10` returns the 10 most recent observations within the requested window. Use together with `offset` to page through long histories. Defaults to 20. Maximum 100.",examples:[20],default:20,title:"Limit"}},{name:"offset",in:"query",required:!1,schema:{type:"integer",minimum:0,description:"Optional query parameter. Number of rows to skip from the start of `data[]` (after most-recent-first ordering). Use with `limit` for pagination. Defaults to 0.",examples:[0],default:0,title:"Offset"}},{name:"page",in:"query",required:!1,schema:{anyOf:[{type:"integer",minimum:1},{type:"null"}],description:"Optional query parameter. One-based page number for callers that prefer page-based pagination. When supplied, `offset` is derived as `(page - 1) * limit`.",examples:[1],title:"Page"}},{name:"seasonality",in:"query",required:!1,schema:{anyOf:[{type:"string"},{type:"null"}],description:"Optional query parameter. Optional seasonal adjustment selector. Supported public values are `sa` and `nsa`; check `supported_options.seasonality` in the response/catalogue for values available on this endpoint. Allowed values: sa, nsa.",examples:["sa"],title:"Seasonality",enum:["sa","nsa"],example:"sa"}},{name:"frequency",in:"query",required:!1,schema:{anyOf:[{type:"string"},{type:"null"}],description:"Optional query parameter. Optional returned change basis. Supported public values are `level`, `yoy`, `qoq`, and `mom`; check `supported_options.frequency` for values available on this endpoint. Allowed values: level, yoy, qoq, mom.",examples:["yoy"],title:"Frequency",enum:["level","yoy","qoq","mom"],example:"level"}},{name:"annualization",in:"query",required:!1,schema:{anyOf:[{type:"string"},{type:"null"}],description:"Optional query parameter. Optional annualization selector. Supported public values are `not_annualized` and `saar`; check `supported_options.annualization` for values available on this endpoint. Allowed values: not_annualized, saar.",examples:["saar"],title:"Annualization",enum:["not_annualized","saar"],example:"not_annualized"}},{name:"period_aggregation",in:"query",required:!1,schema:{anyOf:[{type:"string"},{type:"null"}],description:"Optional query parameter. Optional period-aggregation selector. Supported public values are `monthly` and `quarterly_average`; check `supported_options.period_aggregation` for values available on this endpoint. Allowed values: monthly, quarterly_average.",examples:["quarterly_average"],title:"Period Aggregation",enum:["monthly","quarterly_average"],example:"monthly"}},{name:"revisions",in:"query",required:!1,schema:{anyOf:[{type:"string"},{type:"null"}],description:"Optional query parameter. Optional revision view. Supported public values are `latest`, `first`, `final`, and `all`; unsupported views return `unsupported_series_option` with supported values. Allowed values: latest, first, final, all.",examples:["latest"],default:"latest",title:"Revisions",enum:["latest","first","final","all"],example:"latest"}},{name:"basis",in:"query",required:!1,schema:{anyOf:[{type:"string"},{type:"null"}],description:"Optional query parameter. Optional real/nominal selector. Supported public values are `real` and `nominal`; only endpoints with known basis metadata accept it. Allowed values: real, nominal.",examples:["real"],title:"Basis",enum:["real","nominal"],example:"real"}},{name:"official_only",in:"query",required:!1,schema:{type:"boolean",description:"Optional query parameter. When true, return only official-source rows and remove explicit fallback observations. Prohibited private aggregator rows are always removed regardless of this setting.",examples:[!0],default:!0,title:"Official Only"}}]},{name:"cot",path:"/v1/cot/{currency}",method:"GET",description:"Get CFTC Commitment of Traders (COT) data",input_schema:{type:"object",properties:{currency:{type:"string",title:"Currency",example:"AUD",description:"Required path parameter. Allowed values: AUD, CAD, CHF, EUR, GBP, JPY, MXN, NZD, USD, XAU."},start_date:{type:"string",description:"Optional query parameter. Start date YYYY-MM-DD",examples:["2025-09-01"],title:"Start Date"},end_date:{type:"string",description:"Optional query parameter. End date YYYY-MM-DD",examples:["2026-03-01"],title:"End Date"},limit:{type:"integer",maximum:100,minimum:1,description:"Optional query parameter. Maximum rows to return. Defaults to 20. Maximum 100.",examples:[20],default:20,title:"Limit"},offset:{type:"integer",minimum:0,description:"Optional query parameter. Number of rows to skip after most-recent-first ordering.",examples:[0],default:0,title:"Offset"},page:{anyOf:[{type:"integer",minimum:1},{type:"null"}],description:"Optional query parameter. One-based page number. When supplied, it takes precedence over offset.",examples:[1],title:"Page"}},required:["currency"],additionalProperties:!1},parameters:[{name:"currency",in:"path",required:!0,schema:{type:"string",title:"Currency",example:"AUD",description:"Required path parameter. Allowed values: AUD, CAD, CHF, EUR, GBP, JPY, MXN, NZD, USD, XAU."}},{name:"start_date",in:"query",required:!1,schema:{type:"string",description:"Optional query parameter. Start date YYYY-MM-DD",examples:["2025-09-01"],title:"Start Date"}},{name:"end_date",in:"query",required:!1,schema:{type:"string",description:"Optional query parameter. End date YYYY-MM-DD",examples:["2026-03-01"],title:"End Date"}},{name:"limit",in:"query",required:!1,schema:{type:"integer",maximum:100,minimum:1,description:"Optional query parameter. Maximum rows to return. Defaults to 20. Maximum 100.",examples:[20],default:20,title:"Limit"}},{name:"offset",in:"query",required:!1,schema:{type:"integer",minimum:0,description:"Optional query parameter. Number of rows to skip after most-recent-first ordering.",examples:[0],default:0,title:"Offset"}},{name:"page",in:"query",required:!1,schema:{anyOf:[{type:"integer",minimum:1},{type:"null"}],description:"Optional query parameter. One-based page number. When supplied, it takes precedence over offset.",examples:[1],title:"Page"}}]},{name:"latest_commodities",path:"/v1/commodities/latest",method:"GET",description:"Get latest stored values for all commodity indicators",input_schema:{type:"object",properties:{},required:[],additionalProperties:!1},parameters:[]},{name:"commodities",path:"/v1/commodities/{indicator}",method:"GET",description:"Get commodity indicator data",input_schema:{type:"object",properties:{indicator:{type:"string",description:"Required path parameter. Commodity indicator slug Allowed values: crude_oil_inventories, gold, natural_gas, natural_gas_storage, oil_brent, oil_wti, platinum, silver.",examples:["oil_wti"],title:"Indicator",example:"crude_oil_inventories"},start_date:{type:"string",description:"Optional query parameter. Start date YYYY-MM-DD",examples:["2025-01-01"],title:"Start Date"},end_date:{type:"string",description:"Optional query parameter. End date YYYY-MM-DD",examples:["2026-03-01"],title:"End Date"},limit:{type:"integer",maximum:100,minimum:1,description:"Optional query parameter. Maximum rows to return. Defaults to 20. Maximum 100.",examples:[20],default:20,title:"Limit"},offset:{type:"integer",minimum:0,description:"Optional query parameter. Number of rows to skip after most-recent-first ordering.",examples:[0],default:0,title:"Offset"},page:{anyOf:[{type:"integer",minimum:1},{type:"null"}],description:"Optional query parameter. One-based page number. When supplied, it takes precedence over offset.",examples:[1],title:"Page"}},required:["indicator"],additionalProperties:!1},parameters:[{name:"indicator",in:"path",required:!0,schema:{type:"string",description:"Required path parameter. Commodity indicator slug Allowed values: crude_oil_inventories, gold, natural_gas, natural_gas_storage, oil_brent, oil_wti, platinum, silver.",examples:["oil_wti"],title:"Indicator",example:"crude_oil_inventories"}},{name:"start_date",in:"query",required:!1,schema:{type:"string",description:"Optional query parameter. Start date YYYY-MM-DD",examples:["2025-01-01"],title:"Start Date"}},{name:"end_date",in:"query",required:!1,schema:{type:"string",description:"Optional query parameter. End date YYYY-MM-DD",examples:["2026-03-01"],title:"End Date"}},{name:"limit",in:"query",required:!1,schema:{type:"integer",maximum:100,minimum:1,description:"Optional query parameter. Maximum rows to return. Defaults to 20. Maximum 100.",examples:[20],default:20,title:"Limit"}},{name:"offset",in:"query",required:!1,schema:{type:"integer",minimum:0,description:"Optional query parameter. Number of rows to skip after most-recent-first ordering.",examples:[0],default:0,title:"Offset"}},{name:"page",in:"query",required:!1,schema:{anyOf:[{type:"integer",minimum:1},{type:"null"}],description:"Optional query parameter. One-based page number. When supplied, it takes precedence over offset.",examples:[1],title:"Page"}}]},{name:"announcement_changes",path:"/v1/announcements/changes",method:"GET",description:"Poll recent live announcement release changes",input_schema:{type:"object",properties:{currencies:{anyOf:[{type:"string"},{type:"null"}],description:"Optional query parameter. Comma-separated currency codes, `g10`, or `all`. Without a paid API key the result is restricted to USD.",examples:["g10"],title:"Currencies"},indicators:{anyOf:[{type:"string"},{type:"null"}],description:"Optional query parameter. Optional comma-separated announcement indicator slugs. Allowed values: average_hourly_earnings, average_hourly_earnings_mom, balance_on_goods, balance_on_services, bgcr, breakeven_inflation_rate, broad_money, building_approvals, building_permits, business_confidence, capital_account_balance, cb_assets, commodity_price_energy, commodity_price_ex_energy, commodity_price_index, commodity_prices, consumer_confidence, core_inflation, core_inflation_median, core_inflation_mom, core_inflation_trim, core_pce, core_pce_mom, credit_growth, crude_oil_inventories, current_account_balance, dairy_exports, deposit_rates, durable_goods_orders, effr, employment, exports, financial_account_balance, foreign_reserves, full_time_employment, fx_reserves, gdp, gdp_growth_q4_yoy, gold_reserves, gov_bond_10y, gov_bond_15y, gov_bond_1_5m, gov_bond_1m, gov_bond_1y, gov_bond_20y, gov_bond_25y, gov_bond_2m, gov_bond_2y, gov_bond_30y, gov_bond_3m, gov_bond_3y, gov_bond_40y, gov_bond_4m, gov_bond_4y, gov_bond_5y, gov_bond_6m, gov_bond_6y, gov_bond_7y, gov_bond_8y, gov_bond_9y, government_debt, house_price_index, house_prices, household_credit, household_spending, housing_starts, imports, inflation, inflation_linked_bond, inflation_mom, initial_jobless_claims, international_assets, international_liabilities, job_openings, m1, m2, m3, nairu, natural_gas_storage, net_foreign_asset_position, non_farm_payrolls, non_farm_payrolls_change, obfr, part_time_employment, participation_rate, pce, pce_mom, policy_rate, policy_rate_midpoint, policy_rate_mlf, policy_rate_mro, policy_rate_target_lower, ppi, primary_income_balance, real_yield_20y, real_yield_30y, real_yield_5y, real_yield_7y, retail_sales, retail_sales_control_group, retail_sales_ex_autos, retail_sales_ex_autos_and_gas, risk_free_rate, secondary_income_balance, sight_deposits, snb_balance_sheet, sofr_average_180d, sofr_average_30d, sofr_average_90d, sofr_index, terms_of_trade, tgcr, trade_balance, trade_weighted_index, trimmed_mean_inflation, unemployment, wage_price_index, wages.",examples:["inflation,unemployment"],title:"Indicators",example:"average_hourly_earnings"},since:{anyOf:[{type:"string"},{type:"null"}],description:"Optional query parameter. Cursor returned as `next_cursor` by the previous response. ISO 8601 timestamps and Unix epoch seconds are also accepted.",title:"Since"},limit:{type:"integer",maximum:500,minimum:1,description:"Optional query parameter. Maximum number of matching change events to return.",default:100,title:"Limit"},payload:{anyOf:[{type:"string"},{type:"null"}],description:"Optional query parameter. Use `compact` for trigger payloads or `full` for row fields. Allowed values: compact, full.",default:"compact",title:"Payload",enum:["compact","full"],example:"compact"}},required:[],additionalProperties:!1},parameters:[{name:"currencies",in:"query",required:!1,schema:{anyOf:[{type:"string"},{type:"null"}],description:"Optional query parameter. Comma-separated currency codes, `g10`, or `all`. Without a paid API key the result is restricted to USD.",examples:["g10"],title:"Currencies"}},{name:"indicators",in:"query",required:!1,schema:{anyOf:[{type:"string"},{type:"null"}],description:"Optional query parameter. Optional comma-separated announcement indicator slugs. Allowed values: average_hourly_earnings, average_hourly_earnings_mom, balance_on_goods, balance_on_services, bgcr, breakeven_inflation_rate, broad_money, building_approvals, building_permits, business_confidence, capital_account_balance, cb_assets, commodity_price_energy, commodity_price_ex_energy, commodity_price_index, commodity_prices, consumer_confidence, core_inflation, core_inflation_median, core_inflation_mom, core_inflation_trim, core_pce, core_pce_mom, credit_growth, crude_oil_inventories, current_account_balance, dairy_exports, deposit_rates, durable_goods_orders, effr, employment, exports, financial_account_balance, foreign_reserves, full_time_employment, fx_reserves, gdp, gdp_growth_q4_yoy, gold_reserves, gov_bond_10y, gov_bond_15y, gov_bond_1_5m, gov_bond_1m, gov_bond_1y, gov_bond_20y, gov_bond_25y, gov_bond_2m, gov_bond_2y, gov_bond_30y, gov_bond_3m, gov_bond_3y, gov_bond_40y, gov_bond_4m, gov_bond_4y, gov_bond_5y, gov_bond_6m, gov_bond_6y, gov_bond_7y, gov_bond_8y, gov_bond_9y, government_debt, house_price_index, house_prices, household_credit, household_spending, housing_starts, imports, inflation, inflation_linked_bond, inflation_mom, initial_jobless_claims, international_assets, international_liabilities, job_openings, m1, m2, m3, nairu, natural_gas_storage, net_foreign_asset_position, non_farm_payrolls, non_farm_payrolls_change, obfr, part_time_employment, participation_rate, pce, pce_mom, policy_rate, policy_rate_midpoint, policy_rate_mlf, policy_rate_mro, policy_rate_target_lower, ppi, primary_income_balance, real_yield_20y, real_yield_30y, real_yield_5y, real_yield_7y, retail_sales, retail_sales_control_group, retail_sales_ex_autos, retail_sales_ex_autos_and_gas, risk_free_rate, secondary_income_balance, sight_deposits, snb_balance_sheet, sofr_average_180d, sofr_average_30d, sofr_average_90d, sofr_index, terms_of_trade, tgcr, trade_balance, trade_weighted_index, trimmed_mean_inflation, unemployment, wage_price_index, wages.",examples:["inflation,unemployment"],title:"Indicators",example:"average_hourly_earnings"}},{name:"since",in:"query",required:!1,schema:{anyOf:[{type:"string"},{type:"null"}],description:"Optional query parameter. Cursor returned as `next_cursor` by the previous response. ISO 8601 timestamps and Unix epoch seconds are also accepted.",title:"Since"}},{name:"limit",in:"query",required:!1,schema:{type:"integer",maximum:500,minimum:1,description:"Optional query parameter. Maximum number of matching change events to return.",default:100,title:"Limit"}},{name:"payload",in:"query",required:!1,schema:{anyOf:[{type:"string"},{type:"null"}],description:"Optional query parameter. Use `compact` for trigger payloads or `full` for row fields. Allowed values: compact, full.",default:"compact",title:"Payload",enum:["compact","full"],example:"compact"}}]},{name:"stream_events",path:"/v1/stream/events",method:"GET",description:"Subscribe to real-time announcement events (SSE)",input_schema:{type:"object",properties:{currencies:{anyOf:[{type:"string"},{type:"null"}],description:"Optional query parameter. Comma-separated currency codes to subscribe to, e.g. ``usd,eur``. Omit to receive all live events included in your subscription.",title:"Currencies"},indicators:{anyOf:[{type:"string"},{type:"null"}],description:"Optional query parameter. Comma-separated indicator slugs, e.g. ``inflation,gdp``. Omit to receive all indicators. Allowed values: average_hourly_earnings, average_hourly_earnings_mom, balance_on_goods, balance_on_services, bgcr, breakeven_inflation_rate, broad_money, building_approvals, building_permits, business_confidence, capital_account_balance, cb_assets, commodity_price_energy, commodity_price_ex_energy, commodity_price_index, commodity_prices, consumer_confidence, core_inflation, core_inflation_median, core_inflation_mom, core_inflation_trim, core_pce, core_pce_mom, credit_growth, crude_oil_inventories, current_account_balance, dairy_exports, deposit_rates, durable_goods_orders, effr, employment, exports, financial_account_balance, foreign_reserves, full_time_employment, fx_reserves, gdp, gdp_growth_q4_yoy, gold_reserves, gov_bond_10y, gov_bond_15y, gov_bond_1_5m, gov_bond_1m, gov_bond_1y, gov_bond_20y, gov_bond_25y, gov_bond_2m, gov_bond_2y, gov_bond_30y, gov_bond_3m, gov_bond_3y, gov_bond_40y, gov_bond_4m, gov_bond_4y, gov_bond_5y, gov_bond_6m, gov_bond_6y, gov_bond_7y, gov_bond_8y, gov_bond_9y, government_debt, house_price_index, house_prices, household_credit, household_spending, housing_starts, imports, inflation, inflation_linked_bond, inflation_mom, initial_jobless_claims, international_assets, international_liabilities, job_openings, m1, m2, m3, nairu, natural_gas_storage, net_foreign_asset_position, non_farm_payrolls, non_farm_payrolls_change, obfr, part_time_employment, participation_rate, pce, pce_mom, policy_rate, policy_rate_midpoint, policy_rate_mlf, policy_rate_mro, policy_rate_target_lower, ppi, primary_income_balance, real_yield_20y, real_yield_30y, real_yield_5y, real_yield_7y, retail_sales, retail_sales_control_group, retail_sales_ex_autos, retail_sales_ex_autos_and_gas, risk_free_rate, secondary_income_balance, sight_deposits, snb_balance_sheet, sofr_average_180d, sofr_average_30d, sofr_average_90d, sofr_index, terms_of_trade, tgcr, trade_balance, trade_weighted_index, trimmed_mean_inflation, unemployment, wage_price_index, wages.",title:"Indicators",example:"average_hourly_earnings"},payload:{anyOf:[{type:"string"},{type:"null"}],description:"Optional query parameter. Event payload shape. Use `compact` for the stable trigger payload or `full` to flatten the latest announcement row into each event. Allowed values: compact, full.",default:"compact",title:"Payload",enum:["compact","full"],example:"compact"},live_only:{type:"boolean",default:!1,title:"Live Only",description:"Optional query parameter."},max_age_ms:{anyOf:[{type:"integer"},{type:"null"}],title:"Max Age Ms",description:"Optional query parameter."},"Last-Event-ID":{anyOf:[{type:"string"},{type:"null"}],title:"Last-Event-Id"},max_events:{type:"integer",minimum:1,maximum:100,default:10,description:"Client-side bound on the number of events to collect."},max_seconds:{type:"number",minimum:1,maximum:60,default:10,description:"Client-side deadline for this finite stream capture."}},required:[],additionalProperties:!1},parameters:[{name:"currencies",in:"query",required:!1,schema:{anyOf:[{type:"string"},{type:"null"}],description:"Optional query parameter. Comma-separated currency codes to subscribe to, e.g. ``usd,eur``. Omit to receive all live events included in your subscription.",title:"Currencies"}},{name:"indicators",in:"query",required:!1,schema:{anyOf:[{type:"string"},{type:"null"}],description:"Optional query parameter. Comma-separated indicator slugs, e.g. ``inflation,gdp``. Omit to receive all indicators. Allowed values: average_hourly_earnings, average_hourly_earnings_mom, balance_on_goods, balance_on_services, bgcr, breakeven_inflation_rate, broad_money, building_approvals, building_permits, business_confidence, capital_account_balance, cb_assets, commodity_price_energy, commodity_price_ex_energy, commodity_price_index, commodity_prices, consumer_confidence, core_inflation, core_inflation_median, core_inflation_mom, core_inflation_trim, core_pce, core_pce_mom, credit_growth, crude_oil_inventories, current_account_balance, dairy_exports, deposit_rates, durable_goods_orders, effr, employment, exports, financial_account_balance, foreign_reserves, full_time_employment, fx_reserves, gdp, gdp_growth_q4_yoy, gold_reserves, gov_bond_10y, gov_bond_15y, gov_bond_1_5m, gov_bond_1m, gov_bond_1y, gov_bond_20y, gov_bond_25y, gov_bond_2m, gov_bond_2y, gov_bond_30y, gov_bond_3m, gov_bond_3y, gov_bond_40y, gov_bond_4m, gov_bond_4y, gov_bond_5y, gov_bond_6m, gov_bond_6y, gov_bond_7y, gov_bond_8y, gov_bond_9y, government_debt, house_price_index, house_prices, household_credit, household_spending, housing_starts, imports, inflation, inflation_linked_bond, inflation_mom, initial_jobless_claims, international_assets, international_liabilities, job_openings, m1, m2, m3, nairu, natural_gas_storage, net_foreign_asset_position, non_farm_payrolls, non_farm_payrolls_change, obfr, part_time_employment, participation_rate, pce, pce_mom, policy_rate, policy_rate_midpoint, policy_rate_mlf, policy_rate_mro, policy_rate_target_lower, ppi, primary_income_balance, real_yield_20y, real_yield_30y, real_yield_5y, real_yield_7y, retail_sales, retail_sales_control_group, retail_sales_ex_autos, retail_sales_ex_autos_and_gas, risk_free_rate, secondary_income_balance, sight_deposits, snb_balance_sheet, sofr_average_180d, sofr_average_30d, sofr_average_90d, sofr_index, terms_of_trade, tgcr, trade_balance, trade_weighted_index, trimmed_mean_inflation, unemployment, wage_price_index, wages.",title:"Indicators",example:"average_hourly_earnings"}},{name:"payload",in:"query",required:!1,schema:{anyOf:[{type:"string"},{type:"null"}],description:"Optional query parameter. Event payload shape. Use `compact` for the stable trigger payload or `full` to flatten the latest announcement row into each event. Allowed values: compact, full.",default:"compact",title:"Payload",enum:["compact","full"],example:"compact"}},{name:"live_only",in:"query",required:!1,schema:{type:"boolean",default:!1,title:"Live Only",description:"Optional query parameter."}},{name:"max_age_ms",in:"query",required:!1,schema:{anyOf:[{type:"integer"},{type:"null"}],title:"Max Age Ms",description:"Optional query parameter."}},{name:"Last-Event-ID",in:"header",required:!1,schema:{anyOf:[{type:"string"},{type:"null"}],title:"Last-Event-Id"}}]}];var Ig=[{name:"ping",description:"Quick health check that confirms the FXMacroData API and MCP server are reachable. Use this only if other tools fail unexpectedly \u2014 it is not needed before normal calls.",inputSchema:{properties:{},title:"pingArguments",type:"object"},annotations:{readOnlyHint:!0,destructiveHint:!1,openWorldHint:!0}},{name:"mcp_capabilities",description:"Explain what the FXMacroData MCP server can do, which tools render MCP Apps, which tools return plain rows, what is public versus subscriber-only, and how to choose tools across ChatGPT, Claude, Cursor, Codex, and plain MCP clients. Use this when a user asks what is available, why visuals are not showing, or how to get the same result in a different interface.",inputSchema:{properties:{},title:"mcp_capabilitiesArguments",type:"object"},annotations:{readOnlyHint:!0,destructiveHint:!1,openWorldHint:!0}},{name:"mcp_auth_guide",description:"Explain which authentication mode to use for FXMacroData MCP across major clients and platforms. Use this when the user asks whether to use OAuth, an API key, a bearer token, ChatGPT/OpenAI Apps, Claude/Anthropic, Microsoft/VS Code/Copilot-style clients, AstrBot, Cursor, Codex, local scripts, or CI.",inputSchema:{properties:{},title:"mcp_auth_guideArguments",type:"object"},annotations:{readOnlyHint:!0,destructiveHint:!1,openWorldHint:!0}},{name:"subscribe_for_mcp_access",description:"Open subscription options when a user needs to unlock MCP app visuals, charts, and advanced analytical tools. Returns a direct checkout path.",inputSchema:{properties:{},title:"subscribe_for_mcp_accessArguments",type:"object"},annotations:{readOnlyHint:!0,destructiveHint:!1,openWorldHint:!0}},{name:"data_catalogue",description:"List every macroeconomic indicator FXMacroData publishes for a currency, with units, frequency, and coverage/freshness metadata. ALWAYS call this first when the user asks about a country's macro data \u2014 it returns the exact `indicator` slug strings to pass to indicator_query, release_calendar, and indicator_visual_artifact. Check `coverage` before calling indicator_query; stale, partial, or unavailable rows are not suitable for real-time carry or inflation analysis. Supported currencies (lowercase 3-letter codes): AUD, BRL, CAD, CHF, CNH, CNY, DKK, EUR, GBP, ILS, JPY, NGN, NOK, NZD, PEN, SEK, THB, USD. Access: USD is available without an API key; every other currency returns subscription_required with a subscribe link.",inputSchema:{properties:{currency:{description:"3-letter ISO currency code (case-insensitive). Supported: AUD, BRL, CAD, CHF, CNH, CNY, DKK, EUR, GBP, ILS, JPY, NGN, NOK, NZD, PEN, SEK, THB, USD.",examples:["usd","eur","gbp","jpy"],type:"string"},include_coverage:{default:!0,description:"Include coverage/freshness rows with latest_available_date, coverage_quality, has_recent_data, and recent_observation_count. Leave true when deciding whether an indicator is usable before calling indicator_query.",examples:[!0],type:"boolean"},include_capabilities:{default:!1,description:"Include machine-readable indicator capabilities when the API supports them, such as supported transformations, history availability, and release-calendar linkage.",examples:[!1],type:"boolean"},indicator:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Optional indicator slug to limit coverage calculation, for example `core_inflation`. Use this when you already know the candidate series.",examples:["core_inflation"]}},required:["currency"],title:"data_catalogueArguments",type:"object"},annotations:{readOnlyHint:!0,destructiveHint:!1,openWorldHint:!0}},{name:"risk_sentiment",description:"Return the global risk-on/risk-off sentiment series used for FX regime analysis. The result includes a derived composite score, regime label, component contributions, pagination, and data_quality metadata. Use this for cross-asset regime context before classifying high-beta, safe-haven, commodity, or USD-defensive FX conditions. Access: requires an FXMacroData API key; an anonymous call returns subscription_required with a subscribe link.",inputSchema:{properties:{start_date:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Optional inclusive start date in YYYY-MM-DD format.",examples:["2026-06-01"]},end_date:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Optional inclusive end date in YYYY-MM-DD format.",examples:["2026-06-30"]}},title:"risk_sentimentArguments",type:"object"},annotations:{readOnlyHint:!0,destructiveHint:!1,openWorldHint:!0}},{name:"macro_news",description:"Return recent official central-bank news and press-release headlines for a currency. Use this when a report needs headline context for central-bank policy, inflation, employment, GDP, trade, fiscal, energy, or commodity narratives. The tool returns official-source headline rows and lightweight keyword-derived affected_indicators and sentiment fields when a headline is classifiable. Supported currencies: AUD, BRL, CAD, CHF, CZK, DKK, EUR, GBP, HKD, INR, JPY, NOK, NZD, PEN, PLN, SEK, USD, ZAR. Access: USD is available without an API key; every other currency returns subscription_required with a subscribe link.",inputSchema:{properties:{currency:{description:"3-letter ISO currency code (case-insensitive). Supported: AUD, BRL, CAD, CHF, CZK, DKK, EUR, GBP, HKD, INR, JPY, NOK, NZD, PEN, PLN, SEK, USD, ZAR.",examples:["usd","eur","gbp","jpy"],type:"string"},lookback_days:{default:7,description:"Maximum age of returned headlines in calendar days when headline timestamps are available.",examples:[7,30],maximum:90,minimum:1,type:"integer"},limit:{default:20,description:"Maximum number of headline rows to request.",examples:[10,20],maximum:50,minimum:1,type:"integer"},offset:{default:0,description:"Zero-based headline offset.",examples:[0],minimum:0,type:"integer"}},required:["currency"],title:"macro_newsArguments",type:"object"},annotations:{readOnlyHint:!0,destructiveHint:!1,openWorldHint:!0}},{name:"release_calendar",description:"Get upcoming scheduled macroeconomic release timestamps for a currency. Use this when the user asks 'when is the next CPI/GDP/payrolls/policy decision', or to plan a trade around a known release. Returns ISO-8601 announcement_datetime values in UTC plus market-local timestamps. Pass `timezone` for an additional `announcement_datetime_requested_timezone` field. Each row has a `release` string with the indicator name and a `currency` code. Unbounded calls return future releases only; do not show stale past rows unless the user explicitly asks for historical/past calendar data. Consumer-facing clients should present the returned markdown agenda or render the Release Calendar App resource; do not summarize this tool as only a row count. Pass an optional `indicator` filter to narrow to a single series. Pass optional `start_date` and `end_date` bounds when the user mentions a month, week, day, or explicit date range. Supported currencies: AUD, BRL, CAD, CHF, CNH, CNY, COMM, DKK, EUR, GBP, ILS, JPY, NGN, NOK, NZD, PEN, SEK, THB, USD. Call data_catalogue(currency) for the exact indicator slugs; the `indicator` parameter below also lists them. Access: USD is available without an API key; every other currency returns subscription_required with a subscribe link.",inputSchema:{properties:{currency:{description:"3-letter ISO currency code (case-insensitive). Supported: AUD, BRL, CAD, CHF, CNH, CNY, COMM, DKK, EUR, GBP, ILS, JPY, NGN, NOK, NZD, PEN, SEK, THB, USD.",examples:["usd","eur","gbp","jpy"],type:"string"},indicator:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Optional indicator slug to narrow results. Supported: average_hourly_earnings, average_hourly_earnings_mom, balance_on_goods, balance_on_services, bgcr, breakeven_inflation_rate, broad_money, building_approvals, building_permits, business_confidence, capital_account_balance, cb_assets, commodity_price_energy, commodity_price_ex_energy, commodity_price_index, commodity_prices, consumer_confidence, core_inflation, core_inflation_median, core_inflation_mom, core_inflation_trim, core_pce, core_pce_mom, credit_growth, crude_oil_inventories, current_account_balance, dairy_exports, deposit_rates, durable_goods_orders, effr, employment, exports, financial_account_balance, foreign_reserves, full_time_employment, fx_reserves, gdp, gdp_growth_q4_yoy, gold_reserves, gov_bond_10y, gov_bond_15y, gov_bond_1_5m, gov_bond_1m, gov_bond_1y, gov_bond_20y, gov_bond_25y, gov_bond_2m, gov_bond_2y, gov_bond_30y, gov_bond_3m, gov_bond_3y, gov_bond_40y, gov_bond_4m, gov_bond_4y, gov_bond_5y, gov_bond_6m, gov_bond_6y, gov_bond_7y, gov_bond_8y, gov_bond_9y, government_debt, house_price_index, house_prices, household_credit, household_spending, housing_starts, imports, inflation, inflation_linked_bond, inflation_mom, initial_jobless_claims, international_assets, international_liabilities, job_openings, m1, m2, m3, nairu, natural_gas_storage, net_foreign_asset_position, non_farm_payrolls, non_farm_payrolls_change, obfr, part_time_employment, participation_rate, pce, pce_mom, policy_rate, policy_rate_midpoint, policy_rate_mlf, policy_rate_mro, policy_rate_target_lower, ppi, primary_income_balance, real_yield_20y, real_yield_30y, real_yield_5y, real_yield_7y, retail_sales, retail_sales_control_group, retail_sales_ex_autos, retail_sales_ex_autos_and_gas, risk_free_rate, secondary_income_balance, sight_deposits, snb_balance_sheet, sofr_average_180d, sofr_average_30d, sofr_average_90d, sofr_index, terms_of_trade, tgcr, trade_balance, trade_weighted_index, trimmed_mean_inflation, unemployment, wage_price_index, wages.",examples:["policy_rate","inflation","unemployment","gdp"]},start_date:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Optional inclusive lower bound, YYYY-MM-DD.",examples:["2020-01-01","2024-06-30"]},end_date:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Optional inclusive upper bound, YYYY-MM-DD.",examples:["2020-01-01","2024-06-30"]},timezone:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Optional IANA timezone for an additional converted timestamp, for example America/Sao_Paulo.",examples:["America/Sao_Paulo","Australia/Sydney"]}},required:["currency"],title:"release_calendarArguments",type:"object"},annotations:{readOnlyHint:!0,destructiveHint:!1,openWorldHint:!0}},{name:"release_calendar_visual_artifact",description:"Same payload as release_calendar, but named as an explicit visual artifact tool so compatible MCP Apps clients render the interactive Release Calendar App inline. Prefer this by default when the user asks to show, display, visualize, or render a macro release calendar, especially for prompts like 'show me the AUD release calendar'. Only prefer plain release_calendar when the user explicitly asks for a raw table, JSON, exact rows, or text-only output. Pass optional `indicator`, `start_date`, and `end_date` filters when the user names a specific series, month, week, day, or date range. Pass `timezone` when the user asks for local times in a specific city or region. Supported currencies: AUD, BRL, CAD, CHF, CNH, CNY, COMM, DKK, EUR, GBP, ILS, JPY, NGN, NOK, NZD, PEN, SEK, THB, USD. Call data_catalogue(currency) for the exact indicator slugs; the `indicator` parameter below also lists them. Access: USD is available without an API key; every other currency returns subscription_required with a subscribe link.",inputSchema:{properties:{currency:{description:"3-letter ISO currency code (case-insensitive). Supported: AUD, BRL, CAD, CHF, CNH, CNY, COMM, DKK, EUR, GBP, ILS, JPY, NGN, NOK, NZD, PEN, SEK, THB, USD.",examples:["usd","eur","gbp","jpy"],type:"string"},indicator:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Optional indicator slug to narrow results. Supported: average_hourly_earnings, average_hourly_earnings_mom, balance_on_goods, balance_on_services, bgcr, breakeven_inflation_rate, broad_money, building_approvals, building_permits, business_confidence, capital_account_balance, cb_assets, commodity_price_energy, commodity_price_ex_energy, commodity_price_index, commodity_prices, consumer_confidence, core_inflation, core_inflation_median, core_inflation_mom, core_inflation_trim, core_pce, core_pce_mom, credit_growth, crude_oil_inventories, current_account_balance, dairy_exports, deposit_rates, durable_goods_orders, effr, employment, exports, financial_account_balance, foreign_reserves, full_time_employment, fx_reserves, gdp, gdp_growth_q4_yoy, gold_reserves, gov_bond_10y, gov_bond_15y, gov_bond_1_5m, gov_bond_1m, gov_bond_1y, gov_bond_20y, gov_bond_25y, gov_bond_2m, gov_bond_2y, gov_bond_30y, gov_bond_3m, gov_bond_3y, gov_bond_40y, gov_bond_4m, gov_bond_4y, gov_bond_5y, gov_bond_6m, gov_bond_6y, gov_bond_7y, gov_bond_8y, gov_bond_9y, government_debt, house_price_index, house_prices, household_credit, household_spending, housing_starts, imports, inflation, inflation_linked_bond, inflation_mom, initial_jobless_claims, international_assets, international_liabilities, job_openings, m1, m2, m3, nairu, natural_gas_storage, net_foreign_asset_position, non_farm_payrolls, non_farm_payrolls_change, obfr, part_time_employment, participation_rate, pce, pce_mom, policy_rate, policy_rate_midpoint, policy_rate_mlf, policy_rate_mro, policy_rate_target_lower, ppi, primary_income_balance, real_yield_20y, real_yield_30y, real_yield_5y, real_yield_7y, retail_sales, retail_sales_control_group, retail_sales_ex_autos, retail_sales_ex_autos_and_gas, risk_free_rate, secondary_income_balance, sight_deposits, snb_balance_sheet, sofr_average_180d, sofr_average_30d, sofr_average_90d, sofr_index, terms_of_trade, tgcr, trade_balance, trade_weighted_index, trimmed_mean_inflation, unemployment, wage_price_index, wages.",examples:["policy_rate","inflation","unemployment","gdp"]},start_date:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Optional inclusive lower bound, YYYY-MM-DD.",examples:["2020-01-01","2024-06-30"]},end_date:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Optional inclusive upper bound, YYYY-MM-DD.",examples:["2020-01-01","2024-06-30"]},timezone:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Optional IANA timezone for an additional converted timestamp, for example America/Sao_Paulo.",examples:["America/Sao_Paulo","Australia/Sydney"]}},required:["currency"],title:"release_calendar_visual_artifactArguments",type:"object"},annotations:{readOnlyHint:!0,destructiveHint:!1,openWorldHint:!0}},{name:"event_predictions",description:"Return stored forecasts, consensus-style predictions, central-bank projections, survey forecasts, IMF forecasts, nowcasts, or FXMacroData blended predictions for macro announcements. Use this with release_calendar and indicator_query when a report needs actual-vs-consensus, prior-vs-forecast, or event-surprise context. Rows are keyed by announcement_id/date/indicator and include prediction source metadata. Supported currencies: AUD, BRL, CAD, CHF, CNH, CNY, DKK, EUR, GBP, ILS, JPY, NGN, NOK, NZD, PEN, SEK, THB, USD. Call data_catalogue(currency) for the exact indicator slugs; the `indicator` parameter below also lists them. Access: requires an FXMacroData API key; an anonymous call returns subscription_required with a subscribe link.",inputSchema:{properties:{currency:{description:"3-letter ISO currency code (case-insensitive). Supported: AUD, BRL, CAD, CHF, CNH, CNY, DKK, EUR, GBP, ILS, JPY, NGN, NOK, NZD, PEN, SEK, THB, USD.",examples:["usd","eur","gbp","jpy"],type:"string"},indicator:{description:"Required indicator slug. Currency-wide prediction reads are not supported. Supported: average_hourly_earnings, average_hourly_earnings_mom, balance_on_goods, balance_on_services, bgcr, breakeven_inflation_rate, broad_money, building_approvals, building_permits, business_confidence, capital_account_balance, cb_assets, commodity_price_energy, commodity_price_ex_energy, commodity_price_index, commodity_prices, consumer_confidence, core_inflation, core_inflation_median, core_inflation_mom, core_inflation_trim, core_pce, core_pce_mom, credit_growth, crude_oil_inventories, current_account_balance, dairy_exports, deposit_rates, durable_goods_orders, effr, employment, exports, financial_account_balance, foreign_reserves, full_time_employment, fx_reserves, gdp, gdp_growth_q4_yoy, gold_reserves, gov_bond_10y, gov_bond_15y, gov_bond_1_5m, gov_bond_1m, gov_bond_1y, gov_bond_20y, gov_bond_25y, gov_bond_2m, gov_bond_2y, gov_bond_30y, gov_bond_3m, gov_bond_3y, gov_bond_40y, gov_bond_4m, gov_bond_4y, gov_bond_5y, gov_bond_6m, gov_bond_6y, gov_bond_7y, gov_bond_8y, gov_bond_9y, government_debt, house_price_index, house_prices, household_credit, household_spending, housing_starts, imports, inflation, inflation_linked_bond, inflation_mom, initial_jobless_claims, international_assets, international_liabilities, job_openings, m1, m2, m3, nairu, natural_gas_storage, net_foreign_asset_position, non_farm_payrolls, non_farm_payrolls_change, obfr, part_time_employment, participation_rate, pce, pce_mom, policy_rate, policy_rate_midpoint, policy_rate_mlf, policy_rate_mro, policy_rate_target_lower, ppi, primary_income_balance, real_yield_20y, real_yield_30y, real_yield_5y, real_yield_7y, retail_sales, retail_sales_control_group, retail_sales_ex_autos, retail_sales_ex_autos_and_gas, risk_free_rate, secondary_income_balance, sight_deposits, snb_balance_sheet, sofr_average_180d, sofr_average_30d, sofr_average_90d, sofr_index, terms_of_trade, tgcr, trade_balance, trade_weighted_index, trimmed_mean_inflation, unemployment, wage_price_index, wages.",examples:["policy_rate","inflation","unemployment","gdp"],type:"string"},prediction_type:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Optional legacy forecast-type filter, kept for existing clients. Prefer prediction_class: compiled_consensus, forecaster_survey, market_implied, model_nowcast, central_bank_projection, institutional_projection or fxmacrodata.",examples:["fxmacrodata"]},prediction_source:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Optional source slug filter, for example ecb_spf or philly_fed_spf.",examples:["ecb_spf","philly_fed_spf"]},start_date:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Optional inclusive lower bound by reference-period date, YYYY-MM-DD.",examples:["2020-01-01","2024-06-30"]},end_date:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Optional inclusive upper bound by reference-period date, YYYY-MM-DD.",examples:["2020-01-01","2024-06-30"]},limit:{default:20,description:"Maximum prediction groups to return. Defaults to 20; maximum 100.",examples:[20],maximum:100,minimum:1,type:"integer"},offset:{default:0,description:"Zero-based prediction-group offset.",examples:[0,20],minimum:0,type:"integer"},page:{anyOf:[{minimum:1,type:"integer"},{type:"null"}],default:null,description:"One-based page number. When supplied, overrides offset.",examples:[1]}},required:["currency","indicator"],title:"event_predictionsArguments",type:"object"},annotations:{readOnlyHint:!0,destructiveHint:!1,openWorldHint:!0}},{name:"latest_announcements",description:"Return the latest stored macroeconomic value for every available indicator in one currency. Use this for a compact current macro snapshot after data_catalogue has confirmed the currency coverage. Access: USD is available without an API key; every other currency returns subscription_required with a subscribe link.",inputSchema:{properties:{currency:{description:"3-letter ISO currency code (case-insensitive).",examples:["usd","eur","gbp","jpy"],type:"string"}},required:["currency"],title:"latest_announcementsArguments",type:"object"},annotations:{readOnlyHint:!0,destructiveHint:!1,openWorldHint:!0}},{name:"announcement_changes",description:"Poll recently ingested macro announcement changes with a resumable cursor. This is the bounded MCP-safe companion to the release-event stream: use the returned next_cursor as since on a later call instead of holding an unbounded streaming tool invocation open. Access: requires an FXMacroData API key; an anonymous call returns subscription_required with a subscribe link.",inputSchema:{properties:{currencies:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Optional comma-separated currency codes, `g10`, or `all`. Without subscriber access, results are limited to the public scope.",examples:["usd,eur","g10"]},indicators:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Optional comma-separated announcement indicator slugs.",examples:["inflation,policy_rate"]},since:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Optional previous next_cursor, ISO 8601 timestamp, or Unix epoch seconds.",examples:["2026-07-21T00:00:00Z"]},limit:{default:100,description:"Maximum matching change events to return.",examples:[50,100],maximum:500,minimum:1,type:"integer"},payload:{default:"compact",description:"Event payload shape: compact trigger rows or full announcement rows.",examples:["compact","full"],type:"string"}},title:"announcement_changesArguments",type:"object"},annotations:{readOnlyHint:!0,destructiveHint:!1,openWorldHint:!0}},{name:"press_releases",description:"Return the public central-bank press-release archive for a currency without adding derived sentiment or indicator classifications. Use macro_news when a headline summary is useful; use this tool when the original official release rows matter. Access: USD is available without an API key; every other currency returns subscription_required with a subscribe link.",inputSchema:{properties:{currency:{description:"3-letter ISO currency code (case-insensitive).",examples:["usd","eur","gbp","jpy"],type:"string"},limit:{default:20,description:"Maximum rows to return.",maximum:50,minimum:1,type:"integer"},offset:{default:0,description:"Zero-based row offset.",minimum:0,type:"integer"}},required:["currency"],title:"press_releasesArguments",type:"object"},annotations:{readOnlyHint:!0,destructiveHint:!1,openWorldHint:!0}},{name:"macro_factor",description:"Return a precomputed macro factor for one currency, with optional stored component scores and source references. Use this for a documented factor value, not as a substitute for inspecting its underlying macro releases. Access: USD is available without an API key; every other currency returns subscription_required with a subscribe link.",inputSchema:{properties:{currency:{description:"3-letter ISO currency code (case-insensitive).",examples:["usd","eur","gbp","jpy"],type:"string"},factor:{description:"Factor slug, for example monetary_stance.",examples:["monetary_stance"],type:"string"},start_date:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Optional inclusive start date, YYYY-MM-DD."},end_date:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Optional inclusive end date, YYYY-MM-DD."},include_components:{default:!1,description:"Include stored component scores when available.",type:"boolean"},include_sources:{default:!1,description:"Include public source endpoint references when available.",type:"boolean"},limit:{default:20,description:"Maximum rows to return.",maximum:100,minimum:1,type:"integer"},offset:{default:0,description:"Zero-based row offset.",minimum:0,type:"integer"}},required:["currency","factor"],title:"macro_factorArguments",type:"object"},annotations:{readOnlyHint:!0,destructiveHint:!1,openWorldHint:!0}},{name:"fx_reference_sources",description:"List public official FX reference-rate sources and their source policy before requesting a pair-specific intraday reference-rate series. Access: requires an FXMacroData API key; an anonymous call returns subscription_required with a subscribe link.",inputSchema:{properties:{},title:"fx_reference_sourcesArguments",type:"object"},annotations:{readOnlyHint:!0,destructiveHint:!1,openWorldHint:!0}},{name:"fx_reference_universe",description:"List the public FX reference-rate pair universe, optionally filtered by currency or source id. Call this before requesting an intraday reference-rate series. Access: requires an FXMacroData API key; an anonymous call returns subscription_required with a subscribe link.",inputSchema:{properties:{currency:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Optional 3-letter currency filter.",examples:["usd"]},source:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Optional official source id filter.",examples:["ecb_eurofxref_daily"]}},title:"fx_reference_universeArguments",type:"object"},annotations:{readOnlyHint:!0,destructiveHint:!1,openWorldHint:!0}},{name:"fx_intraday_reference_rates",description:"Return subscriber intraday official FX reference-rate observations for one pair. Call fx_reference_universe first to verify pair and source availability. Access: requires an FXMacroData API key; an anonymous call returns subscription_required with a subscribe link.",inputSchema:{properties:{base:{description:"Base currency code.",examples:["eur"],type:"string"},quote:{description:"Quote currency code.",examples:["usd"],type:"string"},start_time:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Optional inclusive RFC 3339 source timestamp.",examples:["2026-07-20T00:00:00Z"]},end_time:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Optional inclusive RFC 3339 source timestamp.",examples:["2026-07-21T00:00:00Z"]}},required:["base","quote"],title:"fx_intraday_reference_ratesArguments",type:"object"},annotations:{readOnlyHint:!0,destructiveHint:!1,openWorldHint:!0}},{name:"rate_curve",description:"Return official government-nominal curve nodes, slopes, or derived forward segments for one currency. This is a subscriber data tool and preserves the endpoint's requested view and method metadata. Access: requires an FXMacroData API key; an anonymous call returns subscription_required with a subscribe link.",inputSchema:{properties:{currency:{description:"3-letter currency code.",examples:["usd","eur","gbp","jpy"],type:"string"},curve_family:{default:"government_nominal",description:"Official curve family.",type:"string"},metric:{default:"spot",description:"Curve metric.",type:"string"},view:{default:"nodes",description:"Curve view: nodes, slopes, or forwards.",examples:["nodes","slopes","forwards"],type:"string"},method:{default:"derived_from_spot_nodes",description:"Forward derivation method when view is forwards.",type:"string"},date:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Optional target date, YYYY-MM-DD."}},required:["currency"],title:"rate_curveArguments",type:"object"},annotations:{readOnlyHint:!0,destructiveHint:!1,openWorldHint:!0}},{name:"rate_differentials",description:"Return the stored or derived rate differential for one FX pair. Use the returned measure, rate type, curve family, and tenor metadata when explaining the result. Access: requires an FXMacroData API key; an anonymous call returns subscription_required with a subscribe link.",inputSchema:{properties:{base:{description:"Base currency code.",examples:["aud"],type:"string"},quote:{description:"Quote currency code.",examples:["usd"],type:"string"},measure:{default:"auto",description:"Shared rate measure to compare across the pair.",examples:["auto","policy_rate","gov_bond_10y"],type:"string"},rate_type:{default:"spot",description:"Differential type: spot or forward.",examples:["spot","forward"],type:"string"},curve_family:{default:"government_nominal",description:"Curve family when rate_type is forward.",type:"string"},start_tenor_years:{default:2,description:"Start tenor in years for forward differentials.",type:"number"},end_tenor_years:{default:5,description:"End tenor in years for forward differentials.",type:"number"},start_date:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Optional inclusive start date, YYYY-MM-DD."},end_date:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Optional inclusive end date, YYYY-MM-DD."},limit:{default:20,description:"Maximum rows to return.",maximum:100,minimum:1,type:"integer"},offset:{default:0,description:"Zero-based row offset.",minimum:0,type:"integer"}},required:["base","quote"],title:"rate_differentialsArguments",type:"object"},annotations:{readOnlyHint:!0,destructiveHint:!1,openWorldHint:!0}},{name:"latest_commodities",description:"Return the latest stored value for every available commodity indicator in one response. This subscriber tool is the batch counterpart to commodities. Access: requires an FXMacroData API key; an anonymous call returns subscription_required with a subscribe link.",inputSchema:{properties:{},title:"latest_commoditiesArguments",type:"object"},annotations:{readOnlyHint:!0,destructiveHint:!1,openWorldHint:!0}},{name:"forex",description:"Get raw historical FX spot-rate rows for a currency pair (e.g. EUR/USD, USD/JPY). Prefer this tool when the user explicitly wants a plain-text table, raw rows, exact values, JSON-like data, or technical-indicator series (SMA, EMA, RSI, MACD, Bollinger Bands, etc.) computed from spot without a chart. If the user asks more generally to show/tell/explain the last few weeks or months of a pair, prefer forex_visual_artifact instead so the client can render a chart. Daily granularity from official central-bank reference rates with full multi-year history. Supported currencies (use lowercase 3-letter codes): AUD, BRL, CAD, CHF, CNH, CNY, DKK, EUR, GBP, ILS, JPY, NGN, NOK, NZD, PEN, SEK, THB, USD. Optional `indicators` parameter accepts a comma-separated list of technical indicator slugs to attach to each row. Supported indicator values: adx_14, atr_14, bollinger_bands, cci_20, donchian_20, ema_12, ema_20, ema_200, ema_26, ema_50, macd, macd_histogram, macd_signal, rsi_14, sma_20, sma_200, sma_50, stochastic_14_3, williams_r_14, all. Access: requires an FXMacroData API key; an anonymous call returns subscription_required with a subscribe link.",inputSchema:{properties:{base:{description:"Base currency, 3-letter ISO code (case-insensitive). Supported: AUD, BRL, CAD, CHF, CNH, CNY, DKK, EUR, GBP, ILS, JPY, NGN, NOK, NZD, PEN, SEK, THB, USD.",examples:["eur","gbp","aud","usd"],type:"string"},quote:{description:"Quote currency, 3-letter ISO code (case-insensitive). Supported: AUD, BRL, CAD, CHF, CNH, CNY, DKK, EUR, GBP, ILS, JPY, NGN, NOK, NZD, PEN, SEK, THB, USD.",examples:["usd","jpy","chf"],type:"string"},start_date:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Inclusive lower bound, YYYY-MM-DD. Defaults to ~5 years ago.",examples:["2020-01-01","2024-06-30"]},end_date:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Inclusive upper bound, YYYY-MM-DD. Defaults to today.",examples:["2020-01-01","2024-06-30"]},indicators:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Comma-separated technical-indicator slugs to attach to each row. Supported: adx_14, atr_14, bollinger_bands, cci_20, donchian_20, ema_12, ema_20, ema_200, ema_26, ema_50, macd, macd_histogram, macd_signal, rsi_14, sma_20, sma_200, sma_50, stochastic_14_3, williams_r_14, all.",examples:["sma_50,sma_200","rsi_14","ema_20,atr_14"]}},required:["base","quote"],title:"forexArguments",type:"object"},annotations:{readOnlyHint:!0,destructiveHint:!1,openWorldHint:!0}},{name:"seasonality",description:"Get monthly return seasonality for an FX pair or XAU/USD. Use this when the user asks for seasonal patterns, month-of-year tendency, historical monthly win rate, or XAUUSD/gold seasonality. Returns monthly average return, median return, win rate, sample size, dispersion, and per-year monthly returns from stored FX or gold series.",inputSchema:{properties:{instrument:{description:"Six-letter pair such as EURUSD, AUDUSD, USDJPY, or XAUUSD. Slashes and separators are accepted by the REST endpoint only when passed as a single string.",examples:["XAUUSD","EURUSD","AUDUSD"],type:"string"},lookback_years:{anyOf:[{type:"integer"},{type:"null"}],default:10,description:"Number of years to include, 2-30. Defaults to 10.",examples:[10]},month:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Optional month filter, 1-12 or name such as July.",examples:["July"]},end_date:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Inclusive upper bound, YYYY-MM-DD. Defaults to today.",examples:["2020-01-01","2024-06-30"]}},required:["instrument"],title:"seasonalityArguments",type:"object"},annotations:{readOnlyHint:!0,destructiveHint:!1,openWorldHint:!0}},{name:"indicator_query",description:"Get a paginated historical time series of a single macroeconomic indicator for a currency, sourced directly from the official central bank or statistical agency. Use this for CPI/inflation, GDP, unemployment, policy rates, bond yields, payrolls, retail sales, PCE, PPI, trade balance, current account, money supply, and similar series. Each row returns `date` (value-as-of), `val` (numeric), and `announcement_datetime` (when the value was first published \u2014 useful for backtest point-in-time integrity). This plain tool returns raw rows for data workflows. Use `indicator_visual_artifact` when the host should render an MCP App chart. Use `limit`, `offset`, or `page` to page through broad histories; check `pagination.next_offset` and `pagination.page_includes_latest_available` in the result. Responses default to official-source rows only; prohibited private aggregator rows are always removed. Always call data_catalogue(currency) first to get the exact indicator slug. USD indicators are free; non-USD requires API key. Supported currencies: AUD, BRL, CAD, CHF, CNH, CNY, DKK, EUR, GBP, ILS, JPY, NGN, NOK, NZD, PEN, SEK, THB, USD. Call data_catalogue(currency) for the exact indicator slugs; the `indicator` parameter below also lists them. Access: USD is available without an API key; every other currency returns subscription_required with a subscribe link.",inputSchema:{properties:{currency:{anyOf:[{type:"string"},{type:"null"}],default:null,description:'3-letter ISO currency code (case-insensitive). Optional if `slug` is provided as a `"usd:cpi"`-style compound. Supported: AUD, BRL, CAD, CHF, CNH, CNY, DKK, EUR, GBP, ILS, JPY, NGN, NOK, NZD, PEN, SEK, THB, USD.',examples:["usd","eur","gbp","jpy"]},indicator:{anyOf:[{type:"string"},{type:"null"}],default:null,description:'Indicator slug for the given currency. Optional if `slug` is provided as a `"usd:cpi"`-style compound. Supported: average_hourly_earnings, average_hourly_earnings_mom, balance_on_goods, balance_on_services, bgcr, breakeven_inflation_rate, broad_money, building_approvals, building_permits, business_confidence, capital_account_balance, cb_assets, commodity_price_energy, commodity_price_ex_energy, commodity_price_index, commodity_prices, consumer_confidence, core_inflation, core_inflation_median, core_inflation_mom, core_inflation_trim, core_pce, core_pce_mom, credit_growth, crude_oil_inventories, current_account_balance, dairy_exports, deposit_rates, durable_goods_orders, effr, employment, exports, financial_account_balance, foreign_reserves, full_time_employment, fx_reserves, gdp, gdp_growth_q4_yoy, gold_reserves, gov_bond_10y, gov_bond_15y, gov_bond_1_5m, gov_bond_1m, gov_bond_1y, gov_bond_20y, gov_bond_25y, gov_bond_2m, gov_bond_2y, gov_bond_30y, gov_bond_3m, gov_bond_3y, gov_bond_40y, gov_bond_4m, gov_bond_4y, gov_bond_5y, gov_bond_6m, gov_bond_6y, gov_bond_7y, gov_bond_8y, gov_bond_9y, government_debt, house_price_index, house_prices, household_credit, household_spending, housing_starts, imports, inflation, inflation_linked_bond, inflation_mom, initial_jobless_claims, international_assets, international_liabilities, job_openings, m1, m2, m3, nairu, natural_gas_storage, net_foreign_asset_position, non_farm_payrolls, non_farm_payrolls_change, obfr, part_time_employment, participation_rate, pce, pce_mom, policy_rate, policy_rate_midpoint, policy_rate_mlf, policy_rate_mro, policy_rate_target_lower, ppi, primary_income_balance, real_yield_20y, real_yield_30y, real_yield_5y, real_yield_7y, retail_sales, retail_sales_control_group, retail_sales_ex_autos, retail_sales_ex_autos_and_gas, risk_free_rate, secondary_income_balance, sight_deposits, snb_balance_sheet, sofr_average_180d, sofr_average_30d, sofr_average_90d, sofr_index, terms_of_trade, tgcr, trade_balance, trade_weighted_index, trimmed_mean_inflation, unemployment, wage_price_index, wages.',examples:["policy_rate","inflation","unemployment","gdp"]},start_date:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Inclusive lower bound, YYYY-MM-DD.",examples:["2020-01-01","2024-06-30"]},end_date:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Inclusive upper bound, YYYY-MM-DD.",examples:["2020-01-01","2024-06-30"]},limit:{default:20,description:"Maximum rows to return from the existing REST pagination path. Defaults to 20; maximum 100.",examples:[20,100],maximum:100,minimum:1,type:"integer"},offset:{default:0,description:"Zero-based row offset after most-recent-first ordering.",examples:[0,20],minimum:0,type:"integer"},page:{anyOf:[{minimum:1,type:"integer"},{type:"null"}],default:null,description:"One-based page number. When supplied, the REST endpoint derives offset as `(page - 1) * limit`.",examples:[1,2]},slug:{anyOf:[{type:"string"},{type:"null"}],default:null,description:'Optional compound `"<currency>:<indicator>"` slug (e.g. `"usd:cpi"`, `"jpy:policy_rate"`). Many small / open tool-calling models concatenate the two parts anyway. When supplied, overrides `currency` and `indicator`.',examples:["usd:cpi","jpy:policy_rate","eur:gdp"]},official_only:{default:!0,description:"When true, return only official-source rows and remove explicit fallback observations. Prohibited private aggregator rows are always removed.",examples:[!0],type:"boolean"}},title:"indicator_queryArguments",type:"object"},annotations:{readOnlyHint:!0,destructiveHint:!1,openWorldHint:!0}},{name:"plot_visual_artifact",description:"Build a generic MCP Apps chart from one or more FXMacroData endpoint families. Use this for arbitrary plot requests, multi-series charts, and actual-vs-consensus views that need to combine announcements with event_predictions. Supported series sources are announcements, predictions, forex, commodities, and cot. For example, plot USD policy-rate midpoint actuals against market consensus by passing one announcements series for `usd/policy_rate_midpoint` and one predictions series for `usd/policy_rate_midpoint` with `prediction_class=forecaster_survey`. This tool never fetches arbitrary URLs or runs custom chart code; it only composes approved FXMacroData API surfaces into the comparison chart app. Access: USD is available without an API key; every other currency returns subscription_required with a subscribe link.",inputSchema:{properties:{query:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Optional natural-language request to preserve in the payload title/context.",examples:["plot USD policy-rate midpoint actual vs market consensus","compare AUD and USD inflation"]},series:{anyOf:[{items:{additionalProperties:!0,type:"object"},type:"array"},{type:"null"}],default:null,description:"Optional list of series specs. Each spec supports `source` (announcements, predictions, forex, commodities, cot), `currency`, `indicator`, `base`, `quote`, `label`, `y_key`, `metric`, `prediction_class`, `prediction_source`, `start_date`, `end_date`, `limit`, `offset`, and `page`.",examples:[[{currency:"usd",indicator:"policy_rate_midpoint",label:"USD policy midpoint actual",source:"announcements"},{currency:"usd",indicator:"policy_rate_midpoint",label:"Dealer survey median",prediction_class:"forecaster_survey",source:"predictions"}]]},source:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Single-series source when `series` is omitted. Supported values: announcements, predictions, forex, commodities, cot.",examples:["announcements","predictions","forex"]},currency:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Single-series currency for announcements, predictions, or COT. Supported macro currencies: AUD, BRL, CAD, CHF, CNH, CNY, DKK, EUR, GBP, ILS, JPY, NGN, NOK, NZD, PEN, SEK, THB, USD. Supported COT currencies: AUD, CAD, CHF, EUR, GBP, JPY, MXN, NZD, USD, XAU.",examples:["usd","eur","gbp","jpy"]},indicator:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Single-series indicator for announcements, predictions, or commodities. Supported macro indicators: average_hourly_earnings, average_hourly_earnings_mom, balance_on_goods, balance_on_services, bgcr, breakeven_inflation_rate, broad_money, building_approvals, building_permits, business_confidence, capital_account_balance, cb_assets, commodity_price_energy, commodity_price_ex_energy, commodity_price_index, commodity_prices, consumer_confidence, core_inflation, core_inflation_median, core_inflation_mom, core_inflation_trim, core_pce, core_pce_mom, credit_growth, crude_oil_inventories, current_account_balance, dairy_exports, deposit_rates, durable_goods_orders, effr, employment, exports, financial_account_balance, foreign_reserves, full_time_employment, fx_reserves, gdp, gdp_growth_q4_yoy, gold_reserves, gov_bond_10y, gov_bond_15y, gov_bond_1_5m, gov_bond_1m, gov_bond_1y, gov_bond_20y, gov_bond_25y, gov_bond_2m, gov_bond_2y, gov_bond_30y, gov_bond_3m, gov_bond_3y, gov_bond_40y, gov_bond_4m, gov_bond_4y, gov_bond_5y, gov_bond_6m, gov_bond_6y, gov_bond_7y, gov_bond_8y, gov_bond_9y, government_debt, house_price_index, house_prices, household_credit, household_spending, housing_starts, imports, inflation, inflation_linked_bond, inflation_mom, initial_jobless_claims, international_assets, international_liabilities, job_openings, m1, m2, m3, nairu, natural_gas_storage, net_foreign_asset_position, non_farm_payrolls, non_farm_payrolls_change, obfr, part_time_employment, participation_rate, pce, pce_mom, policy_rate, policy_rate_midpoint, policy_rate_mlf, policy_rate_mro, policy_rate_target_lower, ppi, primary_income_balance, real_yield_20y, real_yield_30y, real_yield_5y, real_yield_7y, retail_sales, retail_sales_control_group, retail_sales_ex_autos, retail_sales_ex_autos_and_gas, risk_free_rate, secondary_income_balance, sight_deposits, snb_balance_sheet, sofr_average_180d, sofr_average_30d, sofr_average_90d, sofr_index, terms_of_trade, tgcr, trade_balance, trade_weighted_index, trimmed_mean_inflation, unemployment, wage_price_index, wages. Supported commodity indicators: crude_oil_inventories, gold, natural_gas, natural_gas_storage, oil_brent, oil_wti, platinum, silver.",examples:["policy_rate","inflation","unemployment","gdp"]},base:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Base currency for single-series forex plots. Supported: AUD, BRL, CAD, CHF, CNH, CNY, DKK, EUR, GBP, ILS, JPY, NGN, NOK, NZD, PEN, SEK, THB, USD.",examples:["eur","aud","usd"]},quote:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Quote currency for single-series forex plots. Supported: AUD, BRL, CAD, CHF, CNH, CNY, DKK, EUR, GBP, ILS, JPY, NGN, NOK, NZD, PEN, SEK, THB, USD.",examples:["usd","jpy","chf"]},prediction_type:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Optional legacy prediction-type filter for prediction series. Prefer prediction_class.",examples:["fxmacrodata"]},prediction_source:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Optional prediction source filter for prediction series.",examples:["ny_fed_sme","philly_fed_spf"]},x_axis:{default:"date",description:"Field to use as the shared x-axis. Supported: date, announcement_datetime, announcement_datetime_local, generated_at, observation_datetime.",examples:["date","announcement_datetime"],type:"string"},y_key:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Single-series metric field. Defaults by source: val for announcements and commodities, predicted_value for predictions, rate for forex, noncommercial_net for COT.",examples:["val","predicted_value","rate"]},y_label:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Optional y-axis label for the chart.",examples:["Policy Rate Midpoint","Value"]},title:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Optional chart title. Defaults to query or an auto-generated title.",examples:["USD policy-rate actual vs consensus"]},chart_kind:{default:"line",description:"Initial chart view. Supported: line, area, bar, dot, step.",examples:["line","step"],type:"string"},start_date:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Inclusive lower bound, YYYY-MM-DD.",examples:["2020-01-01","2024-06-30"]},end_date:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Inclusive upper bound, YYYY-MM-DD.",examples:["2020-01-01","2024-06-30"]},limit:{default:20,description:"Maximum rows per source. Defaults to 20; maximum 100.",examples:[20,100],maximum:100,minimum:1,type:"integer"},offset:{default:0,description:"Zero-based row offset per source.",examples:[0,20],minimum:0,type:"integer"},page:{anyOf:[{minimum:1,type:"integer"},{type:"null"}],default:null,description:"One-based page number per source.",examples:[1]}},title:"plot_visual_artifactArguments",type:"object"},annotations:{readOnlyHint:!0,destructiveHint:!1,openWorldHint:!0}},{name:"indicator_visual_artifact",description:"Same payload as indicator_query, but also returns MCP Apps metadata so compatible clients (Claude Desktop, ChatGPT, Codex, etc.) render an interactive line chart instead of a JSON dump. Prefer this by default for indicator time-series requests, especially when the user asks to show, tell, explain, compare, inspect a trend, or review a recent window. For broad histories, use the existing `limit`, `offset`, or `page` controls and inspect `pagination.next_offset` rather than retrying with arbitrary shorter windows. Only fall back to indicator_query when the user explicitly wants a raw table, plain text list, JSON, exact rows, or minimal structured data. Supported currencies: AUD, BRL, CAD, CHF, CNH, CNY, DKK, EUR, GBP, ILS, JPY, NGN, NOK, NZD, PEN, SEK, THB, USD. Call data_catalogue(currency) for the exact indicator slugs; the `indicator` parameter below also lists them. Access: USD is available without an API key; every other currency returns subscription_required with a subscribe link.",inputSchema:{properties:{currency:{description:"3-letter ISO currency code (case-insensitive). Supported: AUD, BRL, CAD, CHF, CNH, CNY, DKK, EUR, GBP, ILS, JPY, NGN, NOK, NZD, PEN, SEK, THB, USD.",examples:["usd","eur","gbp","jpy"],type:"string"},indicator:{description:"Indicator slug. Supported: average_hourly_earnings, average_hourly_earnings_mom, balance_on_goods, balance_on_services, bgcr, breakeven_inflation_rate, broad_money, building_approvals, building_permits, business_confidence, capital_account_balance, cb_assets, commodity_price_energy, commodity_price_ex_energy, commodity_price_index, commodity_prices, consumer_confidence, core_inflation, core_inflation_median, core_inflation_mom, core_inflation_trim, core_pce, core_pce_mom, credit_growth, crude_oil_inventories, current_account_balance, dairy_exports, deposit_rates, durable_goods_orders, effr, employment, exports, financial_account_balance, foreign_reserves, full_time_employment, fx_reserves, gdp, gdp_growth_q4_yoy, gold_reserves, gov_bond_10y, gov_bond_15y, gov_bond_1_5m, gov_bond_1m, gov_bond_1y, gov_bond_20y, gov_bond_25y, gov_bond_2m, gov_bond_2y, gov_bond_30y, gov_bond_3m, gov_bond_3y, gov_bond_40y, gov_bond_4m, gov_bond_4y, gov_bond_5y, gov_bond_6m, gov_bond_6y, gov_bond_7y, gov_bond_8y, gov_bond_9y, government_debt, house_price_index, house_prices, household_credit, household_spending, housing_starts, imports, inflation, inflation_linked_bond, inflation_mom, initial_jobless_claims, international_assets, international_liabilities, job_openings, m1, m2, m3, nairu, natural_gas_storage, net_foreign_asset_position, non_farm_payrolls, non_farm_payrolls_change, obfr, part_time_employment, participation_rate, pce, pce_mom, policy_rate, policy_rate_midpoint, policy_rate_mlf, policy_rate_mro, policy_rate_target_lower, ppi, primary_income_balance, real_yield_20y, real_yield_30y, real_yield_5y, real_yield_7y, retail_sales, retail_sales_control_group, retail_sales_ex_autos, retail_sales_ex_autos_and_gas, risk_free_rate, secondary_income_balance, sight_deposits, snb_balance_sheet, sofr_average_180d, sofr_average_30d, sofr_average_90d, sofr_index, terms_of_trade, tgcr, trade_balance, trade_weighted_index, trimmed_mean_inflation, unemployment, wage_price_index, wages.",examples:["policy_rate","inflation","unemployment","gdp"],type:"string"},start_date:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Inclusive lower bound, YYYY-MM-DD.",examples:["2020-01-01","2024-06-30"]},end_date:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Inclusive upper bound, YYYY-MM-DD.",examples:["2020-01-01","2024-06-30"]},limit:{default:20,description:"Maximum rows to render from the existing REST pagination path. Defaults to 20; maximum 100.",examples:[20,100],maximum:100,minimum:1,type:"integer"},offset:{default:0,description:"Zero-based row offset after most-recent-first ordering.",examples:[0,20],minimum:0,type:"integer"},page:{anyOf:[{minimum:1,type:"integer"},{type:"null"}],default:null,description:"One-based page number. When supplied, the REST endpoint derives offset as `(page - 1) * limit`.",examples:[1,2]}},required:["currency","indicator"],title:"indicator_visual_artifactArguments",type:"object"},annotations:{readOnlyHint:!0,destructiveHint:!1,openWorldHint:!0}},{name:"forex_visual_artifact",description:"Same payload as forex, but packaged with MCP Apps chart metadata so compatible clients render an interactive spot-rate chart inline. Prefer this by default for FX pair time-series requests, especially for prompts like 'show me AUD/USD', 'tell me the last 30 days', 'how has EUR/USD moved recently', or any request where a trend view is more useful than raw rows. Only prefer plain forex when the user explicitly asks for a table, raw values, JSON, CSV-style output, or exact row-by-row data. Access: requires an FXMacroData API key; an anonymous call returns subscription_required with a subscribe link.",inputSchema:{properties:{base:{description:"Base currency, 3-letter ISO code (case-insensitive). Supported: AUD, BRL, CAD, CHF, CNH, CNY, DKK, EUR, GBP, ILS, JPY, NGN, NOK, NZD, PEN, SEK, THB, USD.",examples:["eur","gbp","aud","usd"],type:"string"},quote:{description:"Quote currency, 3-letter ISO code (case-insensitive). Supported: AUD, BRL, CAD, CHF, CNH, CNY, DKK, EUR, GBP, ILS, JPY, NGN, NOK, NZD, PEN, SEK, THB, USD.",examples:["usd","jpy","chf"],type:"string"},start_date:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Inclusive lower bound, YYYY-MM-DD.",examples:["2020-01-01","2024-06-30"]},end_date:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Inclusive upper bound, YYYY-MM-DD.",examples:["2020-01-01","2024-06-30"]},indicators:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Optional technical indicators to include in the raw payload. Supported: adx_14, atr_14, bollinger_bands, cci_20, donchian_20, ema_12, ema_20, ema_200, ema_26, ema_50, macd, macd_histogram, macd_signal, rsi_14, sma_20, sma_200, sma_50, stochastic_14_3, williams_r_14, all.",examples:["sma_50,sma_200","rsi_14","ema_20,atr_14"]}},required:["base","quote"],title:"forex_visual_artifactArguments",type:"object"},annotations:{readOnlyHint:!0,destructiveHint:!1,openWorldHint:!0}},{name:"commodities_visual_artifact",description:"Same payload as commodities, but packaged with MCP Apps chart metadata so compatible clients render an interactive commodity chart inline. Access: requires an FXMacroData API key; an anonymous call returns subscription_required with a subscribe link.",inputSchema:{properties:{indicator:{description:"Commodity indicator slug. Supported: crude_oil_inventories, gold, natural_gas, natural_gas_storage, oil_brent, oil_wti, platinum, silver.",examples:["crude_oil_inventories","gold","natural_gas","natural_gas_storage","oil_brent","oil_wti"],type:"string"},start_date:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Inclusive lower bound, YYYY-MM-DD.",examples:["2020-01-01","2024-06-30"]},end_date:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Inclusive upper bound, YYYY-MM-DD.",examples:["2020-01-01","2024-06-30"]}},required:["indicator"],title:"commodities_visual_artifactArguments",type:"object"},annotations:{readOnlyHint:!0,destructiveHint:!1,openWorldHint:!0}},{name:"cot_visual_artifact",description:"Same payload as cot_data, but with MCP Apps chart metadata. By default it charts noncommercial net positioning; pass `metric` to chart another COT field. Access: requires an FXMacroData API key; an anonymous call returns subscription_required with a subscribe link.",inputSchema:{properties:{currency:{description:"3-letter ISO currency code for the FX futures contract (case-insensitive). Supported: AUD, CAD, CHF, EUR, GBP, JPY, MXN, NZD, USD, XAU.",examples:["eur","jpy","gbp","aud"],type:"string"},start_date:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Inclusive lower bound, YYYY-MM-DD.",examples:["2020-01-01","2024-06-30"]},end_date:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Inclusive upper bound, YYYY-MM-DD.",examples:["2020-01-01","2024-06-30"]},metric:{anyOf:[{type:"string"},{type:"null"}],default:"noncommercial_net",description:"Field to plot from each COT row. Typical values: noncommercial_net, noncommercial_net_zscore, noncommercial_long, noncommercial_short, open_interest.",examples:["noncommercial_net","noncommercial_net_zscore","noncommercial_long","open_interest"]}},required:["currency"],title:"cot_visual_artifactArguments",type:"object"},annotations:{readOnlyHint:!0,destructiveHint:!1,openWorldHint:!0}},{name:"policy_rate_differential_visual_artifact",description:"Build a two-series chart comparing base and quote policy-rate history to visualize the rate differential setup for an FX pair. Access: requires an FXMacroData API key; an anonymous call returns subscription_required with a subscribe link.",inputSchema:{properties:{base:{description:"Base currency, 3-letter ISO code (case-insensitive). Supported: AUD, BRL, CAD, CHF, CNH, CNY, DKK, EUR, GBP, ILS, JPY, NGN, NOK, NZD, PEN, SEK, THB, USD.",examples:["eur","gbp","aud","usd"],type:"string"},quote:{description:"Quote currency, 3-letter ISO code (case-insensitive). Supported: AUD, BRL, CAD, CHF, CNH, CNY, DKK, EUR, GBP, ILS, JPY, NGN, NOK, NZD, PEN, SEK, THB, USD.",examples:["usd","jpy","chf"],type:"string"},start_date:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Inclusive lower bound, YYYY-MM-DD.",examples:["2020-01-01","2024-06-30"]},end_date:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Inclusive upper bound, YYYY-MM-DD.",examples:["2020-01-01","2024-06-30"]}},required:["base","quote"],title:"policy_rate_differential_visual_artifactArguments",type:"object"},annotations:{readOnlyHint:!0,destructiveHint:!1,openWorldHint:!0}},{name:"macro_briefing_task",description:"Build a compact macro briefing for a currency by combining catalogue, key macro series, release-calendar, prediction, news, risk-sentiment, COT, seasonality, and FX technical context. Supports MCP Tasks for async execution when clients send a task-augmented request. Access: requires an FXMacroData API key; an anonymous call returns subscription_required with a subscribe link.",inputSchema:{properties:{currency:{description:"3-letter ISO currency code (case-insensitive). Supported: AUD, BRL, CAD, CHF, CNH, CNY, DKK, EUR, GBP, ILS, JPY, NGN, NOK, NZD, PEN, SEK, THB, USD.",examples:["usd","eur","gbp","jpy"],type:"string"}},required:["currency"],title:"macro_briefing_taskArguments",type:"object"},annotations:{readOnlyHint:!0,destructiveHint:!1,openWorldHint:!0}},{name:"indicator_intel_task",description:"Build an intelligence pack for one indicator by combining chart-ready series data, derived analytics, and nearest release timing context. Supports MCP Tasks for async execution when clients send task-augmented requests. Access: USD is available without an API key; every other currency returns subscription_required with a subscribe link.",inputSchema:{properties:{currency:{description:"3-letter ISO currency code (case-insensitive). Supported: AUD, BRL, CAD, CHF, CNH, CNY, DKK, EUR, GBP, ILS, JPY, NGN, NOK, NZD, PEN, SEK, THB, USD.",examples:["usd","eur","gbp","jpy"],type:"string"},indicator:{description:"Indicator slug for the given currency. Supported: average_hourly_earnings, average_hourly_earnings_mom, balance_on_goods, balance_on_services, bgcr, breakeven_inflation_rate, broad_money, building_approvals, building_permits, business_confidence, capital_account_balance, cb_assets, commodity_price_energy, commodity_price_ex_energy, commodity_price_index, commodity_prices, consumer_confidence, core_inflation, core_inflation_median, core_inflation_mom, core_inflation_trim, core_pce, core_pce_mom, credit_growth, crude_oil_inventories, current_account_balance, dairy_exports, deposit_rates, durable_goods_orders, effr, employment, exports, financial_account_balance, foreign_reserves, full_time_employment, fx_reserves, gdp, gdp_growth_q4_yoy, gold_reserves, gov_bond_10y, gov_bond_15y, gov_bond_1_5m, gov_bond_1m, gov_bond_1y, gov_bond_20y, gov_bond_25y, gov_bond_2m, gov_bond_2y, gov_bond_30y, gov_bond_3m, gov_bond_3y, gov_bond_40y, gov_bond_4m, gov_bond_4y, gov_bond_5y, gov_bond_6m, gov_bond_6y, gov_bond_7y, gov_bond_8y, gov_bond_9y, government_debt, house_price_index, house_prices, household_credit, household_spending, housing_starts, imports, inflation, inflation_linked_bond, inflation_mom, initial_jobless_claims, international_assets, international_liabilities, job_openings, m1, m2, m3, nairu, natural_gas_storage, net_foreign_asset_position, non_farm_payrolls, non_farm_payrolls_change, obfr, part_time_employment, participation_rate, pce, pce_mom, policy_rate, policy_rate_midpoint, policy_rate_mlf, policy_rate_mro, policy_rate_target_lower, ppi, primary_income_balance, real_yield_20y, real_yield_30y, real_yield_5y, real_yield_7y, retail_sales, retail_sales_control_group, retail_sales_ex_autos, retail_sales_ex_autos_and_gas, risk_free_rate, secondary_income_balance, sight_deposits, snb_balance_sheet, sofr_average_180d, sofr_average_30d, sofr_average_90d, sofr_index, terms_of_trade, tgcr, trade_balance, trade_weighted_index, trimmed_mean_inflation, unemployment, wage_price_index, wages.",examples:["policy_rate","inflation","unemployment","gdp"],type:"string"},start_date:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Inclusive lower bound, YYYY-MM-DD.",examples:["2020-01-01","2024-06-30"]},end_date:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Inclusive upper bound, YYYY-MM-DD.",examples:["2020-01-01","2024-06-30"]}},required:["currency","indicator"],title:"indicator_intel_taskArguments",type:"object"},annotations:{readOnlyHint:!0,destructiveHint:!1,openWorldHint:!0}},{name:"pair_intel_task",description:"Build an intelligence pack for an FX pair by combining policy-rate spread context, spot-rate context, and release-timing metadata. Supports MCP Tasks for async execution when clients send task-augmented requests. Access: requires an FXMacroData API key; an anonymous call returns subscription_required with a subscribe link.",inputSchema:{properties:{base:{description:"Base currency, 3-letter ISO code (case-insensitive). Supported: AUD, BRL, CAD, CHF, CNH, CNY, DKK, EUR, GBP, ILS, JPY, NGN, NOK, NZD, PEN, SEK, THB, USD.",examples:["eur","gbp","aud","usd"],type:"string"},quote:{description:"Quote currency, 3-letter ISO code (case-insensitive). Supported: AUD, BRL, CAD, CHF, CNH, CNY, DKK, EUR, GBP, ILS, JPY, NGN, NOK, NZD, PEN, SEK, THB, USD.",examples:["usd","jpy","chf"],type:"string"},start_date:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Inclusive lower bound, YYYY-MM-DD.",examples:["2020-01-01","2024-06-30"]},end_date:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Inclusive upper bound, YYYY-MM-DD.",examples:["2020-01-01","2024-06-30"]}},required:["base","quote"],title:"pair_intel_taskArguments",type:"object"},annotations:{readOnlyHint:!0,destructiveHint:!1,openWorldHint:!0}},{name:"macro_heatmap_task",description:"Build a cross-currency macro heatmap from indicator time series and return a matrix with latest values, recent changes, and z-scores. Supports MCP Tasks for async execution when clients send task-augmented requests.",inputSchema:{properties:{currencies:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Comma-separated 3-letter currency codes (lowercase preferred). Supported values include: AUD, BRL, CAD, CHF, CNH, CNY, DKK, EUR, GBP, ILS, JPY, NGN, NOK, NZD, PEN, SEK, THB, USD.",examples:["usd,eur,gbp,jpy","aud,cad,chf,nzd","usd,sek,nok,pln"]},indicators:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Comma-separated indicator slugs to include in the matrix. Supported values include: average_hourly_earnings, average_hourly_earnings_mom, balance_on_goods, balance_on_services, bgcr, breakeven_inflation_rate, broad_money, building_approvals, building_permits, business_confidence, capital_account_balance, cb_assets, commodity_price_energy, commodity_price_ex_energy, commodity_price_index, commodity_prices, consumer_confidence, core_inflation, core_inflation_median, core_inflation_mom, core_inflation_trim, core_pce, core_pce_mom, credit_growth, crude_oil_inventories, current_account_balance, dairy_exports, deposit_rates, durable_goods_orders, effr, employment, exports, financial_account_balance, foreign_reserves, full_time_employment, fx_reserves, gdp, gdp_growth_q4_yoy, gold_reserves, gov_bond_10y, gov_bond_15y, gov_bond_1_5m, gov_bond_1m, gov_bond_1y, gov_bond_20y, gov_bond_25y, gov_bond_2m, gov_bond_2y, gov_bond_30y, gov_bond_3m, gov_bond_3y, gov_bond_40y, gov_bond_4m, gov_bond_4y, gov_bond_5y, gov_bond_6m, gov_bond_6y, gov_bond_7y, gov_bond_8y, gov_bond_9y, government_debt, house_price_index, house_prices, household_credit, household_spending, housing_starts, imports, inflation, inflation_linked_bond, inflation_mom, initial_jobless_claims, international_assets, international_liabilities, job_openings, m1, m2, m3, nairu, natural_gas_storage, net_foreign_asset_position, non_farm_payrolls, non_farm_payrolls_change, obfr, part_time_employment, participation_rate, pce, pce_mom, policy_rate, policy_rate_midpoint, policy_rate_mlf, policy_rate_mro, policy_rate_target_lower, ppi, primary_income_balance, real_yield_20y, real_yield_30y, real_yield_5y, real_yield_7y, retail_sales, retail_sales_control_group, retail_sales_ex_autos, retail_sales_ex_autos_and_gas, risk_free_rate, secondary_income_balance, sight_deposits, snb_balance_sheet, sofr_average_180d, sofr_average_30d, sofr_average_90d, sofr_index, terms_of_trade, tgcr, trade_balance, trade_weighted_index, trimmed_mean_inflation, unemployment, wage_price_index, wages.",examples:["policy_rate,inflation,gdp","inflation,unemployment,retail_sales"]},start_date:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Optional inclusive lower bound, YYYY-MM-DD.",examples:["2020-01-01","2024-06-30"]},end_date:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Optional inclusive upper bound, YYYY-MM-DD.",examples:["2020-01-01","2024-06-30"]}},title:"macro_heatmap_taskArguments",type:"object"},annotations:{readOnlyHint:!0,destructiveHint:!1,openWorldHint:!0}},{name:"policy_scenario_modeler_task",description:"Run a policy-rate spread what-if scenario for an FX pair and estimate directional spot impact using an explicit heuristic elasticity assumption. Supports MCP Tasks for async execution when clients send task-augmented requests. Access: requires an FXMacroData API key; an anonymous call returns subscription_required with a subscribe link.",inputSchema:{properties:{base:{description:"Base currency, 3-letter ISO code (case-insensitive). Supported: AUD, BRL, CAD, CHF, CNH, CNY, DKK, EUR, GBP, ILS, JPY, NGN, NOK, NZD, PEN, SEK, THB, USD.",examples:["eur","gbp","aud","usd"],type:"string"},quote:{description:"Quote currency, 3-letter ISO code (case-insensitive). Supported: AUD, BRL, CAD, CHF, CNH, CNY, DKK, EUR, GBP, ILS, JPY, NGN, NOK, NZD, PEN, SEK, THB, USD.",examples:["usd","jpy","chf"],type:"string"},shock_leg:{anyOf:[{type:"string"},{type:"null"}],default:"base",description:"Which leg receives the policy shock: base or quote.",examples:["base","quote"]},shock_bps:{anyOf:[{type:"number"},{type:"null"}],default:25,description:"Policy shock size in basis points (100 bps = 1.00 percentage point).",examples:[25,50,-25]},policy_shock_bps:{anyOf:[{type:"number"},{type:"null"}],default:null,description:"Optional alias for shock_bps for compatibility with host-side app payloads.",examples:[25,50]},elasticity_per_100bps:{anyOf:[{type:"number"},{type:"null"}],default:.8,description:"Heuristic percent change in FX spot for a 100 bps spread change. Used as a scenario assumption, not a forecast guarantee.",examples:[.5,.8,1.2]},start_date:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Optional inclusive lower bound, YYYY-MM-DD.",examples:["2020-01-01","2024-06-30"]},end_date:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Optional inclusive upper bound, YYYY-MM-DD.",examples:["2020-01-01","2024-06-30"]}},required:["base","quote"],title:"policy_scenario_modeler_taskArguments",type:"object"},annotations:{readOnlyHint:!0,destructiveHint:!1,openWorldHint:!0}},{name:"macro_war_room_task",description:"Build a multi-panel macro market cockpit that combines FX sessions, upcoming release queue, pair context, and generated risk alerts. Supports MCP Tasks for async execution when clients send task-augmented requests. Access: USD is available without an API key; every other currency returns subscription_required with a subscribe link.",inputSchema:{properties:{base:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Base currency for pair context, 3-letter ISO code (case-insensitive). Defaults to the release currency when omitted. Supported: AUD, BRL, CAD, CHF, CNH, CNY, DKK, EUR, GBP, ILS, JPY, NGN, NOK, NZD, PEN, SEK, THB, USD.",examples:["eur","gbp","aud","usd"]},quote:{anyOf:[{type:"string"},{type:"null"}],default:"usd",description:"Quote currency for pair context, 3-letter ISO code (case-insensitive). Supported: AUD, BRL, CAD, CHF, CNH, CNY, DKK, EUR, GBP, ILS, JPY, NGN, NOK, NZD, PEN, SEK, THB, USD.",examples:["usd","jpy","chf"]},currency:{anyOf:[{type:"string"},{type:"null"}],default:"usd",description:"Release currency used for queue and spotlight indicator. Supported: AUD, BRL, CAD, CHF, CNH, CNY, DKK, EUR, GBP, ILS, JPY, NGN, NOK, NZD, PEN, SEK, THB, USD.",examples:["usd","eur","gbp"]},indicator:{anyOf:[{type:"string"},{type:"null"}],default:"inflation",description:"Spotlight indicator slug for release context. Supported examples: average_hourly_earnings, average_hourly_earnings_mom, balance_on_goods, balance_on_services, bgcr, breakeven_inflation_rate, broad_money, building_approvals, building_permits, business_confidence, capital_account_balance, cb_assets, commodity_price_energy, commodity_price_ex_energy, commodity_price_index, commodity_prices, consumer_confidence, core_inflation, core_inflation_median, core_inflation_mom, core_inflation_trim, core_pce, core_pce_mom, credit_growth, crude_oil_inventories, current_account_balance, dairy_exports, deposit_rates, durable_goods_orders, effr, employment, exports, financial_account_balance, foreign_reserves, full_time_employment, fx_reserves, gdp, gdp_growth_q4_yoy, gold_reserves, gov_bond_10y, gov_bond_15y, gov_bond_1_5m, gov_bond_1m, gov_bond_1y, gov_bond_20y, gov_bond_25y, gov_bond_2m, gov_bond_2y, gov_bond_30y, gov_bond_3m, gov_bond_3y, gov_bond_40y, gov_bond_4m, gov_bond_4y, gov_bond_5y, gov_bond_6m, gov_bond_6y, gov_bond_7y, gov_bond_8y, gov_bond_9y, government_debt, house_price_index, house_prices, household_credit, household_spending, housing_starts, imports, inflation, inflation_linked_bond, inflation_mom, initial_jobless_claims, international_assets, international_liabilities, job_openings, m1, m2, m3, nairu, natural_gas_storage, net_foreign_asset_position, non_farm_payrolls, non_farm_payrolls_change, obfr, part_time_employment, participation_rate, pce, pce_mom, policy_rate, policy_rate_midpoint, policy_rate_mlf, policy_rate_mro, policy_rate_target_lower, ppi, primary_income_balance, real_yield_20y, real_yield_30y, real_yield_5y, real_yield_7y, retail_sales, retail_sales_control_group, retail_sales_ex_autos, retail_sales_ex_autos_and_gas, risk_free_rate, secondary_income_balance, sight_deposits, snb_balance_sheet, sofr_average_180d, sofr_average_30d, sofr_average_90d, sofr_index, terms_of_trade, tgcr, trade_balance, trade_weighted_index, trimmed_mean_inflation, unemployment, wage_price_index, wages.",examples:["inflation","policy_rate","gdp"]},start_date:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Optional inclusive lower bound, YYYY-MM-DD.",examples:["2020-01-01","2024-06-30"]},end_date:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Optional inclusive upper bound, YYYY-MM-DD.",examples:["2020-01-01","2024-06-30"]}},title:"macro_war_room_taskArguments",type:"object"},annotations:{readOnlyHint:!0,destructiveHint:!1,openWorldHint:!0}},{name:"event_impact_replay_task",description:"Create a point-in-time replay timeline mapping macro announcements to FX context and heuristic impact markers. Supports MCP Tasks for async execution when clients send task-augmented requests. Access: USD is available without an API key; every other currency returns subscription_required with a subscribe link.",inputSchema:{properties:{currency:{description:"Currency for macro event series, 3-letter ISO code (case-insensitive). Supported: AUD, BRL, CAD, CHF, CNH, CNY, DKK, EUR, GBP, ILS, JPY, NGN, NOK, NZD, PEN, SEK, THB, USD.",examples:["usd","eur","gbp"],type:"string"},indicator:{description:"Indicator slug for event replay. Supported examples: average_hourly_earnings, average_hourly_earnings_mom, balance_on_goods, balance_on_services, bgcr, breakeven_inflation_rate, broad_money, building_approvals, building_permits, business_confidence, capital_account_balance, cb_assets, commodity_price_energy, commodity_price_ex_energy, commodity_price_index, commodity_prices, consumer_confidence, core_inflation, core_inflation_median, core_inflation_mom, core_inflation_trim, core_pce, core_pce_mom, credit_growth, crude_oil_inventories, current_account_balance, dairy_exports, deposit_rates, durable_goods_orders, effr, employment, exports, financial_account_balance, foreign_reserves, full_time_employment, fx_reserves, gdp, gdp_growth_q4_yoy, gold_reserves, gov_bond_10y, gov_bond_15y, gov_bond_1_5m, gov_bond_1m, gov_bond_1y, gov_bond_20y, gov_bond_25y, gov_bond_2m, gov_bond_2y, gov_bond_30y, gov_bond_3m, gov_bond_3y, gov_bond_40y, gov_bond_4m, gov_bond_4y, gov_bond_5y, gov_bond_6m, gov_bond_6y, gov_bond_7y, gov_bond_8y, gov_bond_9y, government_debt, house_price_index, house_prices, household_credit, household_spending, housing_starts, imports, inflation, inflation_linked_bond, inflation_mom, initial_jobless_claims, international_assets, international_liabilities, job_openings, m1, m2, m3, nairu, natural_gas_storage, net_foreign_asset_position, non_farm_payrolls, non_farm_payrolls_change, obfr, part_time_employment, participation_rate, pce, pce_mom, policy_rate, policy_rate_midpoint, policy_rate_mlf, policy_rate_mro, policy_rate_target_lower, ppi, primary_income_balance, real_yield_20y, real_yield_30y, real_yield_5y, real_yield_7y, retail_sales, retail_sales_control_group, retail_sales_ex_autos, retail_sales_ex_autos_and_gas, risk_free_rate, secondary_income_balance, sight_deposits, snb_balance_sheet, sofr_average_180d, sofr_average_30d, sofr_average_90d, sofr_index, terms_of_trade, tgcr, trade_balance, trade_weighted_index, trimmed_mean_inflation, unemployment, wage_price_index, wages.",examples:["inflation","policy_rate","gdp"],type:"string"},base:{anyOf:[{type:"string"},{type:"null"}],default:"eur",description:"FX base currency for market context, 3-letter ISO code (case-insensitive). Supported: AUD, BRL, CAD, CHF, CNH, CNY, DKK, EUR, GBP, ILS, JPY, NGN, NOK, NZD, PEN, SEK, THB, USD.",examples:["eur","gbp","aud","usd"]},quote:{anyOf:[{type:"string"},{type:"null"}],default:"usd",description:"FX quote currency for market context, 3-letter ISO code (case-insensitive). Supported: AUD, BRL, CAD, CHF, CNH, CNY, DKK, EUR, GBP, ILS, JPY, NGN, NOK, NZD, PEN, SEK, THB, USD.",examples:["usd","jpy","chf"]},lookback_events:{anyOf:[{type:"integer"},{type:"null"}],default:12,description:"Maximum number of recent events to include in replay.",examples:[6,12,24]},start_date:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Optional inclusive lower bound, YYYY-MM-DD.",examples:["2020-01-01","2024-06-30"]},end_date:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Optional inclusive upper bound, YYYY-MM-DD.",examples:["2020-01-01","2024-06-30"]}},required:["currency","indicator"],title:"event_impact_replay_taskArguments",type:"object"},annotations:{readOnlyHint:!0,destructiveHint:!1,openWorldHint:!0}},{name:"quant_scenario_lab_task",description:"Run an expanded quant-style policy scenario for an FX pair with deterministic projection, stress percentiles, and horizon assumptions. Supports MCP Tasks for async execution when clients send task-augmented requests.",inputSchema:{properties:{base:{description:"Base currency, 3-letter ISO code (case-insensitive). Supported: AUD, BRL, CAD, CHF, CNH, CNY, DKK, EUR, GBP, ILS, JPY, NGN, NOK, NZD, PEN, SEK, THB, USD.",examples:["eur","gbp","aud","usd"],type:"string"},quote:{description:"Quote currency, 3-letter ISO code (case-insensitive). Supported: AUD, BRL, CAD, CHF, CNH, CNY, DKK, EUR, GBP, ILS, JPY, NGN, NOK, NZD, PEN, SEK, THB, USD.",examples:["usd","jpy","chf"],type:"string"},shock_leg:{anyOf:[{type:"string"},{type:"null"}],default:"base",description:"Which leg receives the policy shock: base or quote.",examples:["base","quote"]},shock_bps:{anyOf:[{type:"number"},{type:"null"}],default:50,description:"Policy shock size in basis points (100 bps = 1.00 percentage point).",examples:[25,50,-25]},elasticity_per_100bps:{anyOf:[{type:"number"},{type:"null"}],default:.8,description:"Heuristic percent FX move per 100 bps spread change.",examples:[.5,.8,1.2]},annualized_volatility_pct:{anyOf:[{type:"number"},{type:"null"}],default:8,description:"Annualized volatility assumption (percent) for stress-band construction.",examples:[6,8,12]},horizon_days:{anyOf:[{type:"integer"},{type:"null"}],default:30,description:"Scenario horizon in calendar days.",examples:[7,30,90]},start_date:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Optional inclusive lower bound, YYYY-MM-DD.",examples:["2020-01-01","2024-06-30"]},end_date:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Optional inclusive upper bound, YYYY-MM-DD.",examples:["2020-01-01","2024-06-30"]}},required:["base","quote"],title:"quant_scenario_lab_taskArguments",type:"object"},annotations:{readOnlyHint:!0,destructiveHint:!1,openWorldHint:!0}},{name:"known_at_time_task",description:"Return the slice of a macro series that would have been known at a specific timestamp, using announcement_datetime as the point-in-time integrity boundary. Supports MCP Tasks for async execution when clients send task-augmented requests. Access: USD is available without an API key; every other currency returns subscription_required with a subscribe link.",inputSchema:{properties:{currency:{description:"3-letter ISO currency code (case-insensitive). Supported: AUD, BRL, CAD, CHF, CNH, CNY, DKK, EUR, GBP, ILS, JPY, NGN, NOK, NZD, PEN, SEK, THB, USD.",examples:["usd","eur","gbp","jpy"],type:"string"},indicator:{description:"Indicator slug for the given currency. Supported: average_hourly_earnings, average_hourly_earnings_mom, balance_on_goods, balance_on_services, bgcr, breakeven_inflation_rate, broad_money, building_approvals, building_permits, business_confidence, capital_account_balance, cb_assets, commodity_price_energy, commodity_price_ex_energy, commodity_price_index, commodity_prices, consumer_confidence, core_inflation, core_inflation_median, core_inflation_mom, core_inflation_trim, core_pce, core_pce_mom, credit_growth, crude_oil_inventories, current_account_balance, dairy_exports, deposit_rates, durable_goods_orders, effr, employment, exports, financial_account_balance, foreign_reserves, full_time_employment, fx_reserves, gdp, gdp_growth_q4_yoy, gold_reserves, gov_bond_10y, gov_bond_15y, gov_bond_1_5m, gov_bond_1m, gov_bond_1y, gov_bond_20y, gov_bond_25y, gov_bond_2m, gov_bond_2y, gov_bond_30y, gov_bond_3m, gov_bond_3y, gov_bond_40y, gov_bond_4m, gov_bond_4y, gov_bond_5y, gov_bond_6m, gov_bond_6y, gov_bond_7y, gov_bond_8y, gov_bond_9y, government_debt, house_price_index, house_prices, household_credit, household_spending, housing_starts, imports, inflation, inflation_linked_bond, inflation_mom, initial_jobless_claims, international_assets, international_liabilities, job_openings, m1, m2, m3, nairu, natural_gas_storage, net_foreign_asset_position, non_farm_payrolls, non_farm_payrolls_change, obfr, part_time_employment, participation_rate, pce, pce_mom, policy_rate, policy_rate_midpoint, policy_rate_mlf, policy_rate_mro, policy_rate_target_lower, ppi, primary_income_balance, real_yield_20y, real_yield_30y, real_yield_5y, real_yield_7y, retail_sales, retail_sales_control_group, retail_sales_ex_autos, retail_sales_ex_autos_and_gas, risk_free_rate, secondary_income_balance, sight_deposits, snb_balance_sheet, sofr_average_180d, sofr_average_30d, sofr_average_90d, sofr_index, terms_of_trade, tgcr, trade_balance, trade_weighted_index, trimmed_mean_inflation, unemployment, wage_price_index, wages.",examples:["policy_rate","inflation","unemployment","gdp"],type:"string"},as_of:{description:"UTC ISO-8601 timestamp or YYYY-MM-DD cutoff. Only rows with announcement_datetime <= this moment are returned.",examples:["2025-01-31T13:30:00Z","2025-01-31"],type:"string"},start_date:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Optional inclusive lower bound, YYYY-MM-DD.",examples:["2020-01-01","2024-06-30"]},end_date:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Optional inclusive upper bound, YYYY-MM-DD.",examples:["2020-01-01","2024-06-30"]}},required:["currency","indicator","as_of"],title:"known_at_time_taskArguments",type:"object"},annotations:{readOnlyHint:!0,destructiveHint:!1,openWorldHint:!0}},{name:"macro_regime_classifier_task",description:"Classify a currency's macro regime using policy rate, inflation, GDP, and unemployment context, with explicit assumptions and confidence notes. Supports MCP Tasks for async execution when clients send task-augmented requests. Access: USD is available without an API key; every other currency returns subscription_required with a subscribe link.",inputSchema:{properties:{currency:{description:"3-letter ISO currency code (case-insensitive). Supported: AUD, BRL, CAD, CHF, CNH, CNY, DKK, EUR, GBP, ILS, JPY, NGN, NOK, NZD, PEN, SEK, THB, USD.",examples:["usd","eur","gbp","jpy"],type:"string"},start_date:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Optional inclusive lower bound, YYYY-MM-DD.",examples:["2020-01-01","2024-06-30"]},end_date:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Optional inclusive upper bound, YYYY-MM-DD.",examples:["2020-01-01","2024-06-30"]}},required:["currency"],title:"macro_regime_classifier_taskArguments",type:"object"},annotations:{readOnlyHint:!0,destructiveHint:!1,openWorldHint:!0}},{name:"release_risk_score_task",description:"Score upcoming releases for a currency pair using release-calendar proximity and indicator-level heuristics. Supports MCP Tasks for async execution when clients send task-augmented requests.",inputSchema:{properties:{base:{description:"Base currency, 3-letter ISO code. Supported: AUD, BRL, CAD, CHF, CNH, CNY, DKK, EUR, GBP, ILS, JPY, NGN, NOK, NZD, PEN, SEK, THB, USD.",examples:["eur","gbp","usd"],type:"string"},quote:{description:"Quote currency, 3-letter ISO code. Supported: AUD, BRL, CAD, CHF, CNH, CNY, DKK, EUR, GBP, ILS, JPY, NGN, NOK, NZD, PEN, SEK, THB, USD.",examples:["usd","jpy","chf"],type:"string"},horizon_events:{anyOf:[{type:"integer"},{type:"null"}],default:6,description:"Maximum release events per currency to score.",examples:[4,6,10]}},required:["base","quote"],title:"release_risk_score_taskArguments",type:"object"},annotations:{readOnlyHint:!0,destructiveHint:!1,openWorldHint:!0}},{name:"portfolio_risk_engine_task",description:"Analyze a multi-position FX book for concentration, stress exposure, and event-driven catalyst risk. Supports MCP Tasks for async execution when clients send task-augmented requests.",inputSchema:{properties:{positions_json:{description:'JSON array of FX positions. Each item should include base, quote, side (long/short), and notional. Example: [{"base":"eur","quote":"usd","side":"long","notional":100000}]',examples:['[{"base":"eur","quote":"usd","side":"long","notional":100000},{"base":"gbp","quote":"usd","side":"short","notional":80000}]'],type:"string"},stress_shock_pct:{anyOf:[{type:"number"},{type:"null"}],default:1,description:"Stress shock in percent applied to each pair.",examples:[.5,1,2]},horizon_events:{anyOf:[{type:"integer"},{type:"null"}],default:4,description:"Maximum release events to consider per currency leg.",examples:[3,4,8]}},required:["positions_json"],title:"portfolio_risk_engine_taskArguments",type:"object"},annotations:{readOnlyHint:!0,destructiveHint:!1,openWorldHint:!0}},{name:"fx_trade_setup_task",description:"Build a trader-oriented FX pair setup using spot context, macro differentials, upcoming catalyst risk, and optional COT positioning. Supports MCP Tasks for async execution when clients send task-augmented requests.",inputSchema:{properties:{base:{description:"Base currency, 3-letter ISO code. Supported: AUD, BRL, CAD, CHF, CNH, CNY, DKK, EUR, GBP, ILS, JPY, NGN, NOK, NZD, PEN, SEK, THB, USD.",examples:["eur","gbp","aud"],type:"string"},quote:{description:"Quote currency, 3-letter ISO code. Supported: AUD, BRL, CAD, CHF, CNH, CNY, DKK, EUR, GBP, ILS, JPY, NGN, NOK, NZD, PEN, SEK, THB, USD.",examples:["usd","jpy","chf"],type:"string"},horizon_events:{anyOf:[{type:"integer"},{type:"null"}],default:4,description:"Maximum upcoming catalysts per leg to rank.",examples:[3,4,6]},include_cot:{anyOf:[{type:"boolean"},{type:"null"}],default:!1,description:"When true, attempt to include COT positioning context for both legs.",examples:[!0,!1]}},required:["base","quote"],title:"fx_trade_setup_taskArguments",type:"object"},annotations:{readOnlyHint:!0,destructiveHint:!1,openWorldHint:!0}},{name:"fx_backtest_task",description:"Run a transparent rule-based FX backtest on historical spot data using carry and/or momentum signals. Supports MCP Tasks for async execution when clients send task-augmented requests.",inputSchema:{properties:{base:{description:"Base currency, 3-letter ISO code. Supported: AUD, BRL, CAD, CHF, CNH, CNY, DKK, EUR, GBP, ILS, JPY, NGN, NOK, NZD, PEN, SEK, THB, USD.",examples:["eur","gbp","aud"],type:"string"},quote:{description:"Quote currency, 3-letter ISO code. Supported: AUD, BRL, CAD, CHF, CNH, CNY, DKK, EUR, GBP, ILS, JPY, NGN, NOK, NZD, PEN, SEK, THB, USD.",examples:["usd","jpy","chf"],type:"string"},start_date:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Inclusive lower bound, YYYY-MM-DD.",examples:["2020-01-01","2024-06-30"]},end_date:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Inclusive upper bound, YYYY-MM-DD.",examples:["2020-01-01","2024-06-30"]},strategy:{anyOf:[{type:"string"},{type:"null"}],default:"carry_momentum",description:"Signal mode: carry, momentum, or carry_momentum.",examples:["carry_momentum","carry","momentum"]},momentum_lookback:{anyOf:[{type:"integer"},{type:"null"}],default:5,description:"Momentum lookback in observations for the momentum signal.",examples:[5,10,20]},transaction_cost_bps:{anyOf:[{type:"number"},{type:"null"}],default:2,description:"Per-side transaction cost in basis points applied on position changes.",examples:[1,2,5]},initial_capital:{anyOf:[{type:"number"},{type:"null"}],default:1e5,description:"Starting capital for equity-curve calculations.",examples:[1e4,1e5]},event_gated:{anyOf:[{type:"boolean"},{type:"null"}],default:!1,description:"When true, only allow positions during release-event windows derived from announcement_datetime on base and quote calendars.",examples:[!0,!1]},event_window_days:{anyOf:[{type:"integer"},{type:"null"}],default:1,description:"Event gate window in days around each release date (0 means release-date only).",examples:[0,1,2]}},required:["base","quote"],title:"fx_backtest_taskArguments",type:"object"},annotations:{readOnlyHint:!0,destructiveHint:!1,openWorldHint:!0}},{name:"macro_research_pack_task",description:"Bundle catalogue, indicator history, next release timing, and optional FX pair context into one persistent-host-friendly research payload. Supports MCP Tasks for async execution when clients send task-augmented requests. Access: USD is available without an API key; every other currency returns subscription_required with a subscribe link.",inputSchema:{properties:{currency:{description:"3-letter ISO currency code. Supported: AUD, BRL, CAD, CHF, CNH, CNY, DKK, EUR, GBP, ILS, JPY, NGN, NOK, NZD, PEN, SEK, THB, USD.",examples:["usd","eur","gbp","jpy"],type:"string"},indicator:{description:"Indicator slug. Supported: average_hourly_earnings, average_hourly_earnings_mom, balance_on_goods, balance_on_services, bgcr, breakeven_inflation_rate, broad_money, building_approvals, building_permits, business_confidence, capital_account_balance, cb_assets, commodity_price_energy, commodity_price_ex_energy, commodity_price_index, commodity_prices, consumer_confidence, core_inflation, core_inflation_median, core_inflation_mom, core_inflation_trim, core_pce, core_pce_mom, credit_growth, crude_oil_inventories, current_account_balance, dairy_exports, deposit_rates, durable_goods_orders, effr, employment, exports, financial_account_balance, foreign_reserves, full_time_employment, fx_reserves, gdp, gdp_growth_q4_yoy, gold_reserves, gov_bond_10y, gov_bond_15y, gov_bond_1_5m, gov_bond_1m, gov_bond_1y, gov_bond_20y, gov_bond_25y, gov_bond_2m, gov_bond_2y, gov_bond_30y, gov_bond_3m, gov_bond_3y, gov_bond_40y, gov_bond_4m, gov_bond_4y, gov_bond_5y, gov_bond_6m, gov_bond_6y, gov_bond_7y, gov_bond_8y, gov_bond_9y, government_debt, house_price_index, house_prices, household_credit, household_spending, housing_starts, imports, inflation, inflation_linked_bond, inflation_mom, initial_jobless_claims, international_assets, international_liabilities, job_openings, m1, m2, m3, nairu, natural_gas_storage, net_foreign_asset_position, non_farm_payrolls, non_farm_payrolls_change, obfr, part_time_employment, participation_rate, pce, pce_mom, policy_rate, policy_rate_midpoint, policy_rate_mlf, policy_rate_mro, policy_rate_target_lower, ppi, primary_income_balance, real_yield_20y, real_yield_30y, real_yield_5y, real_yield_7y, retail_sales, retail_sales_control_group, retail_sales_ex_autos, retail_sales_ex_autos_and_gas, risk_free_rate, secondary_income_balance, sight_deposits, snb_balance_sheet, sofr_average_180d, sofr_average_30d, sofr_average_90d, sofr_index, terms_of_trade, tgcr, trade_balance, trade_weighted_index, trimmed_mean_inflation, unemployment, wage_price_index, wages.",examples:["policy_rate","inflation","unemployment","gdp"],type:"string"},base:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Optional FX base currency for pair context.",examples:["eur","usd"]},quote:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Optional FX quote currency for pair context.",examples:["usd","jpy"]},start_date:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Optional inclusive lower bound, YYYY-MM-DD.",examples:["2020-01-01","2024-06-30"]},end_date:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Optional inclusive upper bound, YYYY-MM-DD.",examples:["2020-01-01","2024-06-30"]}},required:["currency","indicator"],title:"macro_research_pack_taskArguments",type:"object"},annotations:{readOnlyHint:!0,destructiveHint:!1,openWorldHint:!0}},{name:"market_sessions",description:"Tell the user which FX trading sessions are currently open (Sydney, Tokyo, London, New York) and when the next session opens/closes. Use this when the user asks 'is the market open?', 'when does London open?', or 'which sessions overlap right now?'. Pass an ISO-8601 UTC timestamp via `at` to get the snapshot for a specific moment instead of now. Accounts for weekends and major banking holidays.",inputSchema:{properties:{at:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Optional ISO-8601 UTC timestamp; defaults to now. Use to snapshot session state at a specific moment.",examples:["2025-06-15T13:30:00Z","2025-12-25T00:00:00Z"]}},title:"market_sessionsArguments",type:"object"},annotations:{readOnlyHint:!0,destructiveHint:!1,openWorldHint:!0}},{name:"cot_data",description:"Get weekly CFTC Commitment of Traders (COT) positioning data for a currency's FX futures contract on the CME. Use this when the user asks about speculator positioning, non-commercial longs vs shorts, hedge-fund FX positioning, or wants to gauge sentiment extremes. Returns weekly snapshots with long/short open interest by trader category. Updated every Friday at 15:30 ET reflecting the Tuesday cutoff. Requires an API key. Supported currencies: AUD, CAD, CHF, EUR, GBP, JPY, MXN, NZD, USD, XAU. Access: requires an FXMacroData API key; an anonymous call returns subscription_required with a subscribe link.",inputSchema:{properties:{currency:{description:"3-letter ISO currency code for the FX futures contract (case-insensitive). Supported: AUD, CAD, CHF, EUR, GBP, JPY, MXN, NZD, USD, XAU.",examples:["eur","jpy","gbp","aud"],type:"string"},start_date:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Inclusive lower bound, YYYY-MM-DD.",examples:["2020-01-01","2024-06-30"]},end_date:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Inclusive upper bound, YYYY-MM-DD.",examples:["2020-01-01","2024-06-30"]}},required:["currency"],title:"cot_dataArguments",type:"object"},annotations:{readOnlyHint:!0,destructiveHint:!1,openWorldHint:!0}},{name:"commodities",description:"Get historical price series for supported commodity indicators using the exact slugs advertised by this schema. Requires an API key. Supported indicators: crude_oil_inventories, gold, natural_gas, natural_gas_storage, oil_brent, oil_wti, platinum, silver. Access: requires an FXMacroData API key; an anonymous call returns subscription_required with a subscribe link.",inputSchema:{properties:{indicator:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Commodity indicator slug. Supported: crude_oil_inventories, gold, natural_gas, natural_gas_storage, oil_brent, oil_wti, platinum, silver.",examples:["crude_oil_inventories","gold","natural_gas","natural_gas_storage","oil_brent","oil_wti"]},symbol:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Backward-compatible alias for `indicator`. Prefer `indicator` in new calls.",examples:["crude_oil_inventories","gold","natural_gas","natural_gas_storage","oil_brent","oil_wti"]},start_date:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Inclusive lower bound, YYYY-MM-DD.",examples:["2020-01-01","2024-06-30"]},end_date:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Inclusive upper bound, YYYY-MM-DD.",examples:["2020-01-01","2024-06-30"]}},title:"commoditiesArguments",type:"object"},annotations:{readOnlyHint:!0,destructiveHint:!1,openWorldHint:!0}},{name:"financial_prices",description:"Read persisted official financial price observations: government yield curves, individual securities, overnight benchmarks and reference prices. Preserves issuer, instrument, maturity, curve type and source precision. Requires an API key; an empty result means no stored observations for the selection. Access: USD is available without an API key; every other currency returns subscription_required with a subscribe link.",inputSchema:{properties:{currency:{type:"string"},source:{anyOf:[{type:"string"},{type:"null"}],default:null},start_date:{anyOf:[{type:"string"},{type:"null"}],default:null},end_date:{anyOf:[{type:"string"},{type:"null"}],default:null},measure:{anyOf:[{type:"string"},{type:"null"}],default:null},instrument_id:{anyOf:[{type:"string"},{type:"null"}],default:null},issuer:{anyOf:[{type:"string"},{type:"null"}],default:null},limit:{default:100,type:"integer"},offset:{default:0,type:"integer"}},required:["currency"],title:"financial_pricesArguments",type:"object"},annotations:{readOnlyHint:!0,destructiveHint:!1,openWorldHint:!0}},{name:"official_dataset_family",description:"Get metadata-first official dataset payloads grouped by API endpoint type. Use endpoint_type to pick the API taxonomy group and dataset to choose the specific series family. Supported endpoint types: monetary_policy, fiscal_policy, international_trade, statistics_releases. Supported datasets: auction_metrics, bop, capital_flows, cb_liquidity, credit_conditions, external_debt, fx_intervention, iip, services_trade, treasury_cash, wage_settlements. Access: USD is available without an API key; every other currency returns subscription_required with a subscribe link.",inputSchema:{properties:{endpoint_type:{description:"Endpoint taxonomy group from the API structure. Supported: monetary_policy, fiscal_policy, international_trade, statistics_releases.",examples:["monetary_policy","fiscal_policy","international_trade","statistics_releases"],type:"string"},dataset:{description:"Dataset slug within the selected endpoint_type. Supported: auction_metrics, bop, capital_flows, cb_liquidity, credit_conditions, external_debt, fx_intervention, iip, services_trade, treasury_cash, wage_settlements.",examples:["cb_liquidity","treasury_cash","bop","credit_conditions"],type:"string"},currency:{description:"3-letter ISO currency code (case-insensitive).",examples:["usd","eur","gbp","jpy"],type:"string"},component:{anyOf:[{type:"string"},{type:"null"}],default:null,description:"Required only when dataset='bop'. Supported bop components: goods_balance, services_balance, primary_income, secondary_income, current_account, capital_account, financial_account.",examples:["current_account","services_balance","financial_account"]}},required:["endpoint_type","dataset","currency"],title:"official_dataset_familyArguments",type:"object"},annotations:{readOnlyHint:!0,destructiveHint:!1,openWorldHint:!0}}];var Vl=Tg,Ug=Ig,Jz=new jg.default({strict:!1,validateFormats:!1,useDefaults:!0}),Mg=new Map;function ea(e,t){if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Provide named parameters.");let r=structuredClone(t);if(Object.keys(r).some(i=>/^(api[_-]?key|authorization|token|password)$/i.test(i)))throw new Error("Credentials must be configured in the connection settings.");let n=JSON.stringify(e),o=Mg.get(n);if(o||(o=Jz.compile({...e,additionalProperties:!1}),Mg.set(n,o)),!o(r))throw new Error("Parameters do not match this operation. Check required fields, types and limits.");return r}function Zg(e){let t=Vl.find(r=>r.name===e);if(!t)throw new Error("Unknown FXMacroData operation.");return t}var Fg=/^(?:api[_-]?key|access[_-]?token|authorization|proxy[_-]?authorization|password|client[_-]?secret|secret|token)$/i;function Vz(e,t,r,n){let o=[...e.matchAll(/"(?:\\.|[^"\\])*"|[{}\[\]:,]|-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?|true|false|null/g)],i=[],a=0,s=(d,m)=>{m!==d[0]&&i.push({start:d.index,end:d.index+d[0].length,value:m})},c=(d,m=!0)=>{if(d>64)throw new Error("FXMacroData response exceeds the supported nesting depth.");let p=o[a++];if(p[0]==="{"){for(;o[a][0]!=="}";){let h=o[a++],y=JSON.parse(h[0]);a++;let v=o[a].index,w=m&&Fg.test(y),S=c(d+1,m&&!w);w&&i.push({start:v,end:S,value:'"[redacted]"'}),m&&s(h,JSON.stringify(r(y))),o[a][0]===","&&a++}a++}else if(p[0]==="["){for(;o[a][0]!=="]";)c(d+1,m),o[a][0]===","&&a++;a++}else if(m&&p[0].startsWith('"')){let h=JSON.parse(p[0]),y=t(h,d+1);y!==h&&s(p,JSON.stringify(y))}let f=o[a-1];return f.index+f[0].length};c(n);let l=[],u=0;for(let d of i.sort((m,p)=>m.start-p.start))l.push(e.slice(u,d.start),d.value),u=d.end;return l.push(e.slice(u)),l.join("")}function Ue(e,t){let r=t?[...new Set([t,encodeURIComponent(t),new URLSearchParams({key:t}).toString().slice(4),JSON.stringify(t).slice(1,-1),JSON.stringify(t).slice(1,-1).replace(/[\u007f-\uffff]/g,a=>"\\u"+a.charCodeAt(0).toString(16).padStart(4,"0")),...[!1,!0].map(a=>t.split("").map(s=>{let c=s.charCodeAt(0).toString(16).padStart(4,"0");return"\\u"+(a?c.toUpperCase():c)}).join(""))])].flatMap(a=>[a,a.replace(/%[0-9A-F]{2}/g,s=>s.toLowerCase())]).sort((a,s)=>s.length-a.length):[],n=a=>{for(let s of r)a=a.split(s).join("[redacted]");return a.replace(/((?:proxy[_-]?)?authorization["']?\s*[:=]\s*["']?)(?:Bearer|Basic)\s+[^\s"'&<>]+/gi,"$1[redacted]").replace(/((?:api[_-]?key|access[_-]?token|authorization|password|client[_-]?secret|token)["']?\s*[:=]\s*["']?)[^\s"'&<>]+/gi,"$1[redacted]")},o=new WeakMap,i=(a,s=0)=>{if(s>64)throw new Error("FXMacroData response exceeds the supported nesting depth.");if(typeof a=="string"){let l;try{l=JSON.parse(a)}catch(u){if(u instanceof RangeError)throw new Error("FXMacroData response exceeds the supported nesting depth.");return n(a)}return l===null||typeof l!="object"&&typeof l!="string"?n(a):Vz(a,i,n,s+1)}if(!a||typeof a!="object")return a;if(o.has(a))return o.get(a);if(a instanceof Date)return new Date(a.getTime());let c=Array.isArray(a)?[]:Object.create(Object.getPrototypeOf(a));o.set(a,c);for(let l of Reflect.ownKeys(a)){if(Array.isArray(a)&&l==="length")continue;let u=Object.getOwnPropertyDescriptor(a,l);if(!("value"in u))continue;let d=typeof l=="string"?n(l):l;Object.defineProperty(c,d,{...u,value:typeof l=="string"&&Fg.test(l)?"[redacted]":i(u.value,s+1)})}return c};return i(e)}function Wz(e,t){let r=e.split(/\r\n|\n|\r/),n=r.filter(a=>a.startsWith("data:")).map(a=>a.slice(5).replace(/^ /,"")).join(`
`);if(!n)return Ue(e,t);let o;try{o=JSON.stringify(Ue(JSON.parse(n),t))}catch{o=Ue(n,t)}return[...r.filter(a=>!a.startsWith("data:")).map(a=>Ue(a,t)),...o.split(`
`).map(a=>`data: ${a}`)].join(`
`)}async function Lg(e,t){if(!e.body||e.status===202||e.status===204)return e;let r=new Headers(e.headers);r.delete("content-length"),r.delete("content-encoding");let n={status:e.status,statusText:e.statusText,headers:r};if(r.get("content-type")?.includes("text/event-stream")){let s=new TextDecoder,c=new TextEncoder,l="",u=e.body.pipeThrough(new TransformStream({transform(d,m){if(l+=s.decode(d,{stream:!0}),l.length>10485760)throw new Error("FXMacroData response exceeded its size limit.");let p;for(;p=/\r\n\r\n|\n\n|\r\r/.exec(l);){let f=l.slice(0,p.index);l=l.slice(p.index+p[0].length),m.enqueue(c.encode(Wz(f,t)+`
`))}},flush(){}}));return new Response(u,n)}let o=e.body.getReader(),i=[],a=0;try{for(;;){let{done:d,value:m}=await o.read();if(d)break;if(a+=m.byteLength,a>10485760)throw new Error("FXMacroData response exceeded its size limit.");i.push(m)}let s=new Uint8Array(a),c=0;for(let d of i)s.set(d,c),c+=d.byteLength;let l=new TextDecoder().decode(s),u;try{u=JSON.stringify(Ue(JSON.parse(l),t))}catch{u=Ue(l,t)}return new Response(u,n)}finally{await o.cancel().catch(()=>{}),o.releaseLock()}}var Hg="https://api.fxmacrodata.com",ta="https://mcp.fxmacrodata.com/mcp",xe=class extends Error{};function Wl(e,t=fetch){return async(r,n)=>{let o=new URL(typeof r=="string"?r:r instanceof URL?r.href:r.url);if(![Hg,new URL(ta).origin].includes(o.origin)||o.username||o.password)throw new xe("Unsupported connection destination.");let i=new Headers(n?.headers);e&&o.searchParams.set("api_key",e);try{let a=await t(o,{...n,headers:i,redirect:"error"});if(!a.ok)throw new xe(a.status===401||a.status===403?"This request requires FXMacroData access. Check the configured API key.":a.status===429?"FXMacroData request limit reached. Retry later.":"FXMacroData could not complete the request.");return o.origin===new URL(ta).origin?await Lg(a,e):a}catch(a){throw a instanceof xe?a:new xe("FXMacroData connection interrupted or unavailable.")}}}async function Yg(e,t={},r={}){let n=Zg(e),o=ea(n.input_schema,t),i=n.path,a=new Headers({Accept:e==="stream_events"?"text/event-stream":"application/json"}),s=new URL(i,Hg);for(let d of n.parameters){let m=o[d.name];m!=null&&(d.in==="path"?i=i.replace(`{${d.name}}`,encodeURIComponent(String(m))):d.in==="header"?a.set(d.name,String(m)):d.in==="query"&&s.searchParams.set(d.name,String(m)))}s.pathname=i;let c=new AbortController,l=setTimeout(()=>c.abort(),e==="stream_events"?Number(o.max_seconds??10)*1e3:3e4),u=()=>c.abort();r.signal?.addEventListener("abort",u,{once:!0}),r.signal?.aborted&&c.abort();try{let d=await Wl(r.apiKey,r.request)(s,{headers:a,signal:c.signal});if(e==="stream_events")return Ue(await Xz(d,Number(o.max_events??10),c.signal),r.apiKey);try{return Ue(await d.json(),r.apiKey)}catch{throw new xe("FXMacroData returned an unreadable response.")}}finally{clearTimeout(l),r.signal?.removeEventListener("abort",u)}}async function Xz(e,t,r){let n=e.body?.getReader();if(!n)return{events:[],bounded:!0};let o=new TextDecoder,i=[],a="",s=()=>{n.cancel().catch(()=>{})};r.addEventListener("abort",s,{once:!0});try{for(;i.length<t&&!r.aborted;){let c=await n.read();if(c.done)break;if(a+=o.decode(c.value,{stream:!0}).replace(/\r\n/g,`
`),a.length>2e6)throw new xe("Event exceeds the supported size.");let l;for(;(l=a.indexOf(`
`))>=0&&i.length<t;){let u=a.slice(0,l);a=a.slice(l+2);let d=u.split(`
`),m=d.filter(f=>f.startsWith("data:")).map(f=>f.slice(5).trimStart()).join(`
`);if(!m)continue;let p=m;try{p=JSON.parse(m)}catch{}i.push({id:d.find(f=>f.startsWith("id:"))?.slice(3).trim(),event:d.find(f=>f.startsWith("event:"))?.slice(6).trim()??"message",data:p})}}return{events:i,bounded:!0}}catch{if(r.aborted)return{events:i,bounded:!0};throw new xe("FXMacroData event stream could not be read.")}finally{r.removeEventListener("abort",s),await n.cancel().catch(()=>{}),n.releaseLock()}}var na=Object.freeze([...Vl.map(e=>({id:`rest_${e.name}`,transport:"rest",name:e.name,description:e.description,schema:e.input_schema})),...Ug.map(e=>({id:`mcp_${e.name}`,transport:"mcp",name:e.name,description:e.description??e.name,schema:e.inputSchema}))]);function Qz(e){let t=[],r=(n,o,i)=>{if(!(i>6||t.length>=6||!n||typeof n!="object")){if(Array.isArray(n)){if(!n.length)return;let a=n.filter(s=>s&&typeof s=="object"&&!Array.isArray(s));if(a.length===n.length){let s=[...new Set(a.slice(0,50).flatMap(c=>Object.keys(c)))].slice(0,16);t.push({path:o,columns:s,rows:a.slice(0,50).map(c=>s.map(l=>c[l]??null)),displayed:Math.min(50,a.length),total:a.length})}else t.push({path:o,columns:["value"],rows:n.slice(0,50).map(s=>[s]),displayed:Math.min(50,n.length),total:n.length});return}for(let[a,s]of Object.entries(n))r(s,`${o}.${a}`,i+1)}};return r(e,"$",0),t}function Bg(e,t=0){if(t>20)throw new xe("Parameters exceed the supported nesting depth.");if(!(!e||typeof e!="object"))for(let[r,n]of Object.entries(e)){if(/^(?:api[_-]?key|authorization|proxy[_-]?authorization|token|access[_-]?token|password|client[_-]?secret|secret)$/i.test(r))throw new xe("Credentials belong in the host secret settings, not tool parameters.");Bg(n,t+1)}}function Gg(e){let t=na.find(r=>r.id===e);if(!t)throw new xe("Unknown FXMacroData operation.");return t}function e1(e,t){return Bg(t),ea(Gg(e).schema,t)}var ra=class{#e;#t;#r;constructor(t){this.#e=t.apiKey?.trim()||void 0,this.#t=t.request??fetch,this.#r=t.slug}get source(){return`https://fxmacrodata.com/?utm_source=${this.#r}&utm_medium=integration&utm_campaign=open_source_integrations&utm_content=app`}get documentation(){return"https://fxmacrodata.com/documentation/reference"}async execute(t,r={},n){let o=Gg(t),i=e1(t,r),a;try{a=o.transport==="rest"?await Yg(o.name,i,{apiKey:this.#e,request:this.#t,signal:n}):await this.#n(o.name,i,n)}catch(l){throw l instanceof xe?new xe(Ue(l.message,this.#e)):new xe("FXMacroData could not complete this request. Check parameters, connectivity, and optional API access.")}let s=Ue(a,this.#e),c=s===null||typeof s=="object"&&s!==null&&"isError"in s&&s.isError===!0;return{operation:t,status:c?"unavailable":"ok",retrievedAt:new Date().toISOString(),source:this.source,documentation:this.documentation,payload:s,tables:Qz(s)}}async#n(t,r,n){let o=new AbortController,i=setTimeout(()=>o.abort(),45e3),a=()=>o.abort();n?.addEventListener("abort",a,{once:!0}),n?.aborted&&o.abort();let s=Wl(this.#e,this.#t),c=new Qi(new URL(ta),{fetch:(u,d)=>s(u,{...d,signal:o.signal})}),l=new Vi({name:`fxmacrodata-${this.#r}`,version:"0.1.0"});l.onerror=()=>{};try{await l.connect(c);let u=await l.callTool({name:t,arguments:r},void 0,{signal:o.signal,timeout:45e3});return Ue(u,this.#e)}catch{throw new xe("FXMacroData tool unavailable. Check parameters and optional API access.")}finally{clearTimeout(i),n?.removeEventListener("abort",a),await l.close().catch(()=>{})}}async briefing(t="usd",r){return Promise.all([this.execute("rest_latest_announcements",{currency:t},r),this.execute("mcp_release_calendar",{currency:t},r),this.execute("rest_market_sessions",{},r)])}},Kg=e=>String(typeof e=="object"?JSON.stringify(e):e??"").replace(/\|/g,"\\|").replace(/[\r\n]+/g," ").replace(/[<>]/g,t=>t==="<"?"<":">").slice(0,280);function Jg(e){let t=[`FXMacroData \xB7 ${e.operation}`,`Retrieved: ${e.retrievedAt}`,""];e.status==="unavailable"&&t.push("This request returned unavailable data.");for(let r of e.tables)t.push(`Data: ${r.path}`,`| ${r.columns.map(Kg).join(" | ")} |`,`| ${r.columns.map(()=>"---").join(" | ")} |`,...r.rows.map(n=>`| ${n.map(Kg).join(" | ")} |`)),r.total>r.displayed&&t.push(`Showing ${r.displayed} of ${r.total} rows. The complete data remains in the structured result.`),t.push("");return e.tables.length||t.push("```json",JSON.stringify(e.payload,null,2).slice(0,24e3),"```"),t.push(`[FXMacroData](${e.source}) \xB7 [API documentation](${e.documentation})`),t.join(`
`)}var Vg={type:"object",additionalProperties:!1,properties:{operation:{type:"string",enum:["daily_briefing",...na.map(e=>e.id)],description:"FXMacroData operation. daily_briefing fetches current USD indicators, releases, and sessions together. Prefixes select the REST or MCP contract."},arguments:{type:"object",description:"Named parameters for the selected operation. Omit for the default USD daily briefing.",anyOf:[{type:"object",properties:{currency:{type:"string",default:"usd"}},additionalProperties:!1},...na.map(e=>({...e.schema,title:e.id,description:`Arguments for ${e.id}: ${e.description}`,additionalProperties:!1}))]}}},t1={parameters:Vg,async handler(e={}){if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Provide an object with operation and its named arguments.");let t=e.operation??"daily_briefing";if(Object.keys(e).some(c=>!["operation","arguments"].includes(c)))throw new Error("Use only operation and its named arguments.");if(typeof t!="string"||e.operation!==void 0&&e.operation===null)throw new Error("Operation must be a name from the FXMacroData operation list.");if(e.arguments!==void 0&&(!e.arguments||typeof e.arguments!="object"||Array.isArray(e.arguments)))throw new Error("Arguments must be an object of named operation parameters.");let r=this.runtimeArgs?.authentication??"public";if(!["public","environment"].includes(r))throw new Error("Choose public or environment authentication in the Skill settings.");let n=r==="environment"?process.env.FXMD_API_KEY:void 0;if(r==="environment"&&!n)throw new Error("Configure FXMD_API_KEY in the host secret environment, or select public access.");let o=new ra({apiKey:n,slug:"anythingllm"}),i=e.arguments??{},a;if(t==="daily_briefing"){if(Object.keys(i).some(c=>c!=="currency")||i.currency!==void 0&&typeof i.currency!="string")throw new Error("Daily briefing accepts only an optional currency code.");a=await o.briefing(i.currency??"usd")}else a=[await o.execute(t,i)];return`${a.map(Jg).join(`
---
`)}
Structured FXMacroData results:
${JSON.stringify(a)}`}};0&&(module.exports={parameters,runtime});
/*! Bundled license information:
content-type/index.js:
(*!
* content-type
* Copyright(c) 2015 Douglas Christopher Wilson
* MIT Licensed
*)
*/