@sap-ux/fiori-mcp-server 0.3.2 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +2 -2
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -1367,7 +1367,7 @@ ${r.comment}`:r.comment}this.doc.range[2]=r.offset;break}default:this.errors.pus
|
|
|
1367
1367
|
${n.message}`:d,E=[v,e,t].filter(Boolean).join(`
|
|
1368
1368
|
`);return m?(n.originalMessage=n.message,n.message=E):n=new Error(E),n.shortMessage=v,n.command=o,n.exitCode=a,n.signal=i,n.signalDescription=p,n.stdout=t,n.stderr=e,r!==void 0&&(n.all=r),"bufferedData"in n&&delete n.bufferedData,n.failed=!0,n.timedOut=!!s,n.isCanceled=c,n.killed=u&&!s,n};D8t.exports=P3n});var I8t=y((bMi,uwe)=>{"use strict";var vJ=["stdin","stdout","stderr"],D3n=t=>vJ.some(e=>t[e]!==void 0),N8t=t=>{if(!t)return;let{stdio:e}=t;if(e===void 0)return vJ.map(n=>t[n]);if(D3n(t))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${vJ.map(n=>`\`${n}\``).join(", ")}`);if(typeof e=="string")return e;if(!Array.isArray(e))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof e}\``);let r=Math.max(e.length,vJ.length);return Array.from({length:r},(n,i)=>e[i])};uwe.exports=N8t;uwe.exports.node=t=>{let e=N8t(t);return e==="ipc"?"ipc":e===void 0||typeof e=="string"?[e,e,e,"ipc"]:e.includes("ipc")?e:[...e,"ipc"]}});var R8t=y((EMi,bJ)=>{bJ.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];process.platform!=="win32"&&bJ.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&bJ.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var F8t=y((_Mi,Cw)=>{var zi=global.process,zS=function(t){return t&&typeof t=="object"&&typeof t.removeListener=="function"&&typeof t.emit=="function"&&typeof t.reallyExit=="function"&&typeof t.listeners=="function"&&typeof t.kill=="function"&&typeof t.pid=="number"&&typeof t.on=="function"};zS(zi)?(L8t=require("assert"),Ow=R8t(),k8t=/^win/i.test(zi.platform),uj=require("events"),typeof uj!="function"&&(uj=uj.EventEmitter),zi.__signal_exit_emitter__?Xo=zi.__signal_exit_emitter__:(Xo=zi.__signal_exit_emitter__=new uj,Xo.count=0,Xo.emitted={}),Xo.infinite||(Xo.setMaxListeners(1/0),Xo.infinite=!0),Cw.exports=function(t,e){if(!zS(global.process))return function(){};L8t.equal(typeof t,"function","a callback must be provided for exit handler"),Sw===!1&&lwe();var r="exit";e&&e.alwaysLast&&(r="afterexit");var n=function(){Xo.removeListener(r,t),Xo.listeners("exit").length===0&&Xo.listeners("afterexit").length===0&&EJ()};return Xo.on(r,t),n},EJ=function(){!Sw||!zS(global.process)||(Sw=!1,Ow.forEach(function(e){try{zi.removeListener(e,_J[e])}catch{}}),zi.emit=TJ,zi.reallyExit=pwe,Xo.count-=1)},Cw.exports.unload=EJ,KS=function(e,r,n){Xo.emitted[e]||(Xo.emitted[e]=!0,Xo.emit(e,r,n))},_J={},Ow.forEach(function(t){_J[t]=function(){if(zS(global.process)){var r=zi.listeners(t);r.length===Xo.count&&(EJ(),KS("exit",null,t),KS("afterexit",null,t),k8t&&t==="SIGHUP"&&(t="SIGINT"),zi.kill(zi.pid,t))}}}),Cw.exports.signals=function(){return Ow},Sw=!1,lwe=function(){Sw||!zS(global.process)||(Sw=!0,Xo.count+=1,Ow=Ow.filter(function(e){try{return zi.on(e,_J[e]),!0}catch{return!1}}),zi.emit=$8t,zi.reallyExit=M8t)},Cw.exports.load=lwe,pwe=zi.reallyExit,M8t=function(e){zS(global.process)&&(zi.exitCode=e||0,KS("exit",zi.exitCode,null),KS("afterexit",zi.exitCode,null),pwe.call(zi,zi.exitCode))},TJ=zi.emit,$8t=function(e,r){if(e==="exit"&&zS(global.process)){r!==void 0&&(zi.exitCode=r);var n=TJ.apply(this,arguments);return KS("exit",zi.exitCode,null),KS("afterexit",zi.exitCode,null),n}else return TJ.apply(this,arguments)}):Cw.exports=function(){return function(){}};var L8t,Ow,k8t,uj,Xo,EJ,KS,_J,Sw,lwe,pwe,M8t,TJ,$8t});var j8t=y((TMi,V8t)=>{"use strict";var w3n=require("os"),N3n=F8t(),I3n=1e3*5,R3n=(t,e="SIGTERM",r={})=>{let n=t(e);return L3n(t,e,r,n),n},L3n=(t,e,r,n)=>{if(!k3n(e,r,n))return;let i=$3n(r),a=setTimeout(()=>{t("SIGKILL")},i);a.unref&&a.unref()},k3n=(t,{forceKillAfterTimeout:e},r)=>M3n(t)&&e!==!1&&r,M3n=t=>t===w3n.constants.signals.SIGTERM||typeof t=="string"&&t.toUpperCase()==="SIGTERM",$3n=({forceKillAfterTimeout:t=!0})=>{if(t===!0)return I3n;if(!Number.isFinite(t)||t<0)throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${t}\` (${typeof t})`);return t},F3n=(t,e)=>{t.kill()&&(e.isCanceled=!0)},V3n=(t,e,r)=>{t.kill(e),r(Object.assign(new Error("Timed out"),{timedOut:!0,signal:e}))},j3n=(t,{timeout:e,killSignal:r="SIGTERM"},n)=>{if(e===0||e===void 0)return n;if(!Number.isFinite(e)||e<0)throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);let i,a=new Promise((s,c)=>{i=setTimeout(()=>{V3n(t,r,c)},e)}),o=n.finally(()=>{clearTimeout(i)});return Promise.race([a,o])},q3n=async(t,{cleanup:e,detached:r},n)=>{if(!e||r)return n;let i=N3n(()=>{t.kill()});return n.finally(()=>{i()})};V8t.exports={spawnedKill:R3n,spawnedCancel:F3n,setupTimeout:j3n,setExitHandler:q3n}});var B8t=y((OMi,U8t)=>{U8t.exports=q8t;function q8t(t,e){if(t&&e)return q8t(t)(e);if(typeof t!="function")throw new TypeError("need wrapper function");return Object.keys(t).forEach(function(n){r[n]=t[n]}),r;function r(){for(var n=new Array(arguments.length),i=0;i<n.length;i++)n[i]=arguments[i];var a=t.apply(this,n),o=n[n.length-1];return typeof a=="function"&&a!==o&&Object.keys(o).forEach(function(s){a[s]=o[s]}),a}}});var dwe=y((SMi,fwe)=>{var H8t=B8t();fwe.exports=H8t(OJ);fwe.exports.strict=H8t(G8t);OJ.proto=OJ(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return OJ(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return G8t(this)},configurable:!0})});function OJ(t){var e=function(){return e.called?e.value:(e.called=!0,e.value=t.apply(this,arguments))};return e.called=!1,e}function G8t(t){var e=function(){if(e.called)throw new Error(e.onceError);return e.called=!0,e.value=t.apply(this,arguments)},r=t.name||"Function wrapped with `once`";return e.onceError=r+" shouldn't be called more than once",e.called=!1,e}});var Y8t=y((CMi,K8t)=>{var U3n=dwe(),B3n=function(){},H3n=function(t){return t.setHeader&&typeof t.abort=="function"},G3n=function(t){return t.stdio&&Array.isArray(t.stdio)&&t.stdio.length===3},z8t=function(t,e,r){if(typeof e=="function")return z8t(t,null,e);e||(e={}),r=U3n(r||B3n);var n=t._writableState,i=t._readableState,a=e.readable||e.readable!==!1&&t.readable,o=e.writable||e.writable!==!1&&t.writable,s=!1,c=function(){t.writable||u()},u=function(){o=!1,a||r.call(t)},l=function(){a=!1,o||r.call(t)},p=function(v){r.call(t,v?new Error("exited with error code: "+v):null)},h=function(v){r.call(t,v)},f=function(){process.nextTick(d)},d=function(){if(!s){if(a&&!(i&&i.ended&&!i.destroyed))return r.call(t,new Error("premature close"));if(o&&!(n&&n.ended&&!n.destroyed))return r.call(t,new Error("premature close"))}},m=function(){t.req.on("finish",u)};return H3n(t)?(t.on("complete",u),t.on("abort",f),t.req?m():t.on("request",m)):o&&!n&&(t.on("end",c),t.on("close",c)),G3n(t)&&t.on("exit",p),t.on("end",l),t.on("finish",u),e.error!==!1&&t.on("error",h),t.on("close",f),function(){s=!0,t.removeListener("complete",u),t.removeListener("abort",f),t.removeListener("request",m),t.req&&t.req.removeListener("finish",u),t.removeListener("end",c),t.removeListener("close",c),t.removeListener("finish",u),t.removeListener("exit",p),t.removeListener("end",l),t.removeListener("error",h),t.removeListener("close",f)}};K8t.exports=z8t});var J8t=y((AMi,X8t)=>{var z3n=dwe(),K3n=Y8t(),hwe=require("fs"),lj=function(){},Y3n=/^v?\.0/.test(process.version),SJ=function(t){return typeof t=="function"},W3n=function(t){return!Y3n||!hwe?!1:(t instanceof(hwe.ReadStream||lj)||t instanceof(hwe.WriteStream||lj))&&SJ(t.close)},X3n=function(t){return t.setHeader&&SJ(t.abort)},J3n=function(t,e,r,n){n=z3n(n);var i=!1;t.on("close",function(){i=!0}),K3n(t,{readable:e,writable:r},function(o){if(o)return n(o);i=!0,n()});var a=!1;return function(o){if(!i&&!a){if(a=!0,W3n(t))return t.close(lj);if(X3n(t))return t.abort();if(SJ(t.destroy))return t.destroy();n(o||new Error("stream was destroyed"))}}},W8t=function(t){t()},Q3n=function(t,e){return t.pipe(e)},Z3n=function(){var t=Array.prototype.slice.call(arguments),e=SJ(t[t.length-1]||lj)&&t.pop()||lj;if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new Error("pump requires two streams per minimum");var r,n=t.map(function(i,a){var o=a<t.length-1,s=a>0;return J3n(i,o,s,function(c){r||(r=c),c&&n.forEach(W8t),!o&&(n.forEach(W8t),e(r))})});return t.reduce(Q3n)};X8t.exports=Z3n});var Z8t=y((xMi,Q8t)=>{"use strict";var{PassThrough:eHn}=require("stream");Q8t.exports=t=>{t={...t};let{array:e}=t,{encoding:r}=t,n=r==="buffer",i=!1;e?i=!(r||n):r=r||"utf8",n&&(r=null);let a=new eHn({objectMode:i});r&&a.setEncoding(r);let o=0,s=[];return a.on("data",c=>{s.push(c),i?o=s.length:o+=c.length}),a.getBufferedValue=()=>e?s:n?Buffer.concat(s,o):s.join(""),a.getBufferedLength=()=>o,a}});var eKt=y((PMi,Aw)=>{"use strict";var{constants:tHn}=require("buffer"),rHn=J8t(),nHn=Z8t(),CJ=class extends Error{constructor(){super("maxBuffer exceeded"),this.name="MaxBufferError"}};async function AJ(t,e){if(!t)return Promise.reject(new Error("Expected a stream"));e={maxBuffer:1/0,...e};let{maxBuffer:r}=e,n;return await new Promise((i,a)=>{let o=s=>{s&&n.getBufferedLength()<=tHn.MAX_LENGTH&&(s.bufferedData=n.getBufferedValue()),a(s)};n=rHn(t,nHn(e),s=>{if(s){o(s);return}i()}),n.on("data",()=>{n.getBufferedLength()>r&&o(new CJ)})}),n.getBufferedValue()}Aw.exports=AJ;Aw.exports.default=AJ;Aw.exports.buffer=(t,e)=>AJ(t,{...e,encoding:"buffer"});Aw.exports.array=(t,e)=>AJ(t,{...e,array:!0});Aw.exports.MaxBufferError=CJ});var rKt=y((DMi,tKt)=>{"use strict";var{PassThrough:iHn}=require("stream");tKt.exports=function(){var t=[],e=new iHn({objectMode:!0});return e.setMaxListeners(0),e.add=r,e.isEmpty=n,e.on("unpipe",i),Array.prototype.slice.call(arguments).forEach(r),e;function r(a){return Array.isArray(a)?(a.forEach(r),this):(t.push(a),a.once("end",i.bind(null,a)),a.once("error",e.emit.bind(e,"error")),a.pipe(e,{end:!1}),this)}function n(){return t.length==0}function i(a){t=t.filter(function(o){return o!==a}),!t.length&&e.readable&&e.end()}}});var oKt=y((wMi,aKt)=>{"use strict";var iKt=w4(),nKt=eKt(),aHn=rKt(),oHn=(t,e)=>{e===void 0||t.stdin===void 0||(iKt(e)?e.pipe(t.stdin):t.stdin.end(e))},sHn=(t,{all:e})=>{if(!e||!t.stdout&&!t.stderr)return;let r=aHn();return t.stdout&&r.add(t.stdout),t.stderr&&r.add(t.stderr),r},mwe=async(t,e)=>{if(t){t.destroy();try{return await e}catch(r){return r.bufferedData}}},gwe=(t,{encoding:e,buffer:r,maxBuffer:n})=>{if(!(!t||!r))return e?nKt(t,{encoding:e,maxBuffer:n}):nKt.buffer(t,{maxBuffer:n})},cHn=async({stdout:t,stderr:e,all:r},{encoding:n,buffer:i,maxBuffer:a},o)=>{let s=gwe(t,{encoding:n,buffer:i,maxBuffer:a}),c=gwe(e,{encoding:n,buffer:i,maxBuffer:a}),u=gwe(r,{encoding:n,buffer:i,maxBuffer:a*2});try{return await Promise.all([o,s,c,u])}catch(l){return Promise.all([{error:l,signal:l.signal,timedOut:l.timedOut},mwe(t,s),mwe(e,c),mwe(r,u)])}},uHn=({input:t})=>{if(iKt(t))throw new TypeError("The `input` option cannot be a stream in sync mode")};aKt.exports={handleInput:oHn,makeAllStream:sHn,getSpawnedResult:cHn,validateInputSync:uHn}});var cKt=y((NMi,sKt)=>{"use strict";var lHn=(async()=>{})().constructor.prototype,pHn=["then","catch","finally"].map(t=>[t,Reflect.getOwnPropertyDescriptor(lHn,t)]),fHn=(t,e)=>{for(let[r,n]of pHn){let i=typeof e=="function"?(...a)=>Reflect.apply(n.value,e(),a):n.value.bind(e);Reflect.defineProperty(t,r,{...n,value:i})}return t},dHn=t=>new Promise((e,r)=>{t.on("exit",(n,i)=>{e({exitCode:n,signal:i})}),t.on("error",n=>{r(n)}),t.stdin&&t.stdin.on("error",n=>{r(n)})});sKt.exports={mergePromise:fHn,getSpawnedPromise:dHn}});var lKt=y((IMi,uKt)=>{"use strict";var hHn=/ +/g,mHn=(t,e=[])=>Array.isArray(e)?[t,...e].join(" "):t,gHn=t=>{let e=[];for(let r of t.trim().split(hHn)){let n=e[e.length-1];n&&n.endsWith("\\")?e[e.length-1]=`${n.slice(0,-1)} ${r}`:e.push(r)}return e};uKt.exports={joinCommand:mHn,parseCommand:gHn}});var yKt=y((RMi,xw)=>{"use strict";var yHn=require("path"),ywe=require("child_process"),fKt=d8t(),vHn=m8t(),bHn=v8t(),EHn=T8t(),xJ=w8t(),dKt=I8t(),{spawnedKill:_Hn,spawnedCancel:THn,setupTimeout:OHn,setExitHandler:SHn}=j8t(),{handleInput:CHn,getSpawnedResult:AHn,makeAllStream:xHn,validateInputSync:PHn}=oKt(),{mergePromise:pKt,getSpawnedPromise:DHn}=cKt(),{joinCommand:hKt,parseCommand:mKt}=lKt(),wHn=1e3*1e3*100,NHn=({env:t,extendEnv:e,preferLocal:r,localDir:n,execPath:i})=>{let a=e?{...process.env,...t}:t;return r?bHn.env({env:a,cwd:n,execPath:i}):a},gKt=(t,e,r={})=>{let n=fKt._parse(t,e,r);return t=n.command,e=n.args,r=n.options,r={maxBuffer:wHn,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:r.cwd||process.cwd(),execPath:process.execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,...r},r.env=NHn(r),r.stdio=dKt(r),process.platform==="win32"&&yHn.basename(t,".exe")==="cmd"&&e.unshift("/q"),{file:t,args:e,options:r,parsed:n}},pj=(t,e,r)=>typeof e!="string"&&!Buffer.isBuffer(e)?r===void 0?void 0:"":t.stripFinalNewline?vHn(e):e,PJ=(t,e,r)=>{let n=gKt(t,e,r),i=hKt(t,e),a;try{a=ywe.spawn(n.file,n.args,n.options)}catch(h){let f=new ywe.ChildProcess,d=Promise.reject(xJ({error:h,stdout:"",stderr:"",all:"",command:i,parsed:n,timedOut:!1,isCanceled:!1,killed:!1}));return pKt(f,d)}let o=DHn(a),s=OHn(a,n.options,o),c=SHn(a,n.options,s),u={isCanceled:!1};a.kill=_Hn.bind(null,a.kill.bind(a)),a.cancel=THn.bind(null,a,u);let p=EHn(async()=>{let[{error:h,exitCode:f,signal:d,timedOut:m},v,E,_]=await AHn(a,n.options,c),O=pj(n.options,v),S=pj(n.options,E),C=pj(n.options,_);if(h||f!==0||d!==null){let x=xJ({error:h,exitCode:f,signal:d,stdout:O,stderr:S,all:C,command:i,parsed:n,timedOut:m,isCanceled:u.isCanceled,killed:a.killed});if(!n.options.reject)return x;throw x}return{command:i,exitCode:0,stdout:O,stderr:S,all:C,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}});return fKt._enoent.hookChildProcess(a,n.parsed),CHn(a,n.options.input),a.all=xHn(a,n.options),pKt(a,p)};xw.exports=PJ;xw.exports.sync=(t,e,r)=>{let n=gKt(t,e,r),i=hKt(t,e);PHn(n.options);let a;try{a=ywe.spawnSync(n.file,n.args,n.options)}catch(c){throw xJ({error:c,stdout:"",stderr:"",all:"",command:i,parsed:n,timedOut:!1,isCanceled:!1,killed:!1})}let o=pj(n.options,a.stdout,a.error),s=pj(n.options,a.stderr,a.error);if(a.error||a.status!==0||a.signal!==null){let c=xJ({stdout:o,stderr:s,error:a.error,signal:a.signal,exitCode:a.status,command:i,parsed:n,timedOut:a.error&&a.error.code==="ETIMEDOUT",isCanceled:!1,killed:a.signal!==null});if(!n.options.reject)return c;throw c}return{command:i,exitCode:0,stdout:o,stderr:s,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}};xw.exports.command=(t,e)=>{let[r,...n]=mKt(t);return PJ(r,n,e)};xw.exports.commandSync=(t,e)=>{let[r,...n]=mKt(t);return PJ.sync(r,n,e)};xw.exports.node=(t,e,r={})=>{e&&!Array.isArray(e)&&typeof e=="object"&&(r=e,e=[]);let n=dKt.node(r),i=process.execArgv.filter(s=>!s.startsWith("--inspect")),{nodePath:a=process.execPath,nodeOptions:o=i}=r;return PJ(a,[...o,t,...Array.isArray(e)?e:[]],{...r,stdin:void 0,stdout:void 0,stderr:void 0,stdio:n,shell:!1})}});var _Kt=y((LMi,EKt)=>{"use strict";var vKt=require("os"),bKt=yKt(),IHn=new Map([["10.0","10"],["6.3","8.1"],["6.2","8"],["6.1","7"],["6.0","Vista"],["5.2","Server 2003"],["5.1","XP"],["5.0","2000"],["4.9","ME"],["4.1","98"],["4.0","95"]]),RHn=t=>{let e=/\d+\.\d/.exec(t||vKt.release());if(t&&!e)throw new Error("`release` argument doesn't match `n.n`");let r=(e||[])[0];if((!t||t===vKt.release())&&["6.1","6.2","6.3","10.0"].includes(r)){let n;try{n=bKt.sync("wmic",["os","get","Caption"]).stdout||""}catch{n=bKt.sync("powershell",["(Get-CimInstance -ClassName Win32_OperatingSystem).caption"]).stdout||""}let i=(n.match(/2008|2012|2016|2019/)||[])[0];if(i)return`Server ${i}`}return IHn.get(r)};EKt.exports=RHn});var OKt=y((kMi,TKt)=>{"use strict";var YS=require("os"),LHn=Xzt(),kHn=_Kt(),MHn=(t,e)=>{if(!t&&e)throw new Error("You can't specify a `release` without specifying `platform`");t=t||YS.platform();let r;if(t==="darwin"){!e&&YS.platform()==="darwin"&&(e=YS.release());let n=e?Number(e.split(".")[0])>15?"macOS":"OS X":"macOS";try{r=e?LHn(e).name:""}catch{}return n+(r?" "+r:"")}return t==="linux"?(!e&&YS.platform()==="linux"&&(e=YS.release()),r=e?e.replace(/^(\d+\.\d+).*/,"$1"):"","Linux"+(r?" "+r:"")):t==="win32"?(!e&&YS.platform()==="win32"&&(e=YS.release()),r=e?kHn(e):"","Windows"+(r?" "+r:"")):t};TKt.exports=MHn});var Jr;(function(t){t.assertEqual=i=>i;function e(i){}t.assertIs=e;function r(i){throw new Error}t.assertNever=r,t.arrayToEnum=i=>{let a={};for(let o of i)a[o]=o;return a},t.getValidEnumValues=i=>{let a=t.objectKeys(i).filter(s=>typeof i[i[s]]!="number"),o={};for(let s of a)o[s]=i[s];return t.objectValues(o)},t.objectValues=i=>t.objectKeys(i).map(function(a){return i[a]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let a=[];for(let o in i)Object.prototype.hasOwnProperty.call(i,o)&&a.push(o);return a},t.find=(i,a)=>{for(let o of i)if(a(o))return o},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function n(i,a=" | "){return i.map(o=>typeof o=="string"?`'${o}'`:o).join(a)}t.joinValues=n,t.jsonStringifyReplacer=(i,a)=>typeof a=="bigint"?a.toString():a})(Jr||(Jr={}));var jQ;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(jQ||(jQ={}));var We=Jr.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),xv=t=>{switch(typeof t){case"undefined":return We.undefined;case"string":return We.string;case"number":return isNaN(t)?We.nan:We.number;case"boolean":return We.boolean;case"function":return We.function;case"bigint":return We.bigint;case"symbol":return We.symbol;case"object":return Array.isArray(t)?We.array:t===null?We.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?We.promise:typeof Map<"u"&&t instanceof Map?We.map:typeof Set<"u"&&t instanceof Set?We.set:typeof Date<"u"&&t instanceof Date?We.date:We.object;default:return We.unknown}},we=Jr.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),bJt=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),sl=class t extends Error{constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){let r=e||function(a){return a.message},n={_errors:[]},i=a=>{for(let o of a.issues)if(o.code==="invalid_union")o.unionErrors.map(i);else if(o.code==="invalid_return_type")i(o.returnTypeError);else if(o.code==="invalid_arguments")i(o.argumentsError);else if(o.path.length===0)n._errors.push(r(o));else{let s=n,c=0;for(;c<o.path.length;){let u=o.path[c];c===o.path.length-1?(s[u]=s[u]||{_errors:[]},s[u]._errors.push(r(o))):s[u]=s[u]||{_errors:[]},s=s[u],c++}}};return i(this),n}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Jr.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},n=[];for(let i of this.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(e(i))):n.push(e(i));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};sl.create=t=>new sl(t);var fC=(t,e)=>{let r;switch(t.code){case we.invalid_type:t.received===We.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case we.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,Jr.jsonStringifyReplacer)}`;break;case we.unrecognized_keys:r=`Unrecognized key(s) in object: ${Jr.joinValues(t.keys,", ")}`;break;case we.invalid_union:r="Invalid input";break;case we.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Jr.joinValues(t.options)}`;break;case we.invalid_enum_value:r=`Invalid enum value. Expected ${Jr.joinValues(t.options)}, received '${t.received}'`;break;case we.invalid_arguments:r="Invalid function arguments";break;case we.invalid_return_type:r="Invalid function return type";break;case we.invalid_date:r="Invalid date";break;case we.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:Jr.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case we.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case we.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case we.custom:r="Invalid input";break;case we.invalid_intersection_types:r="Intersection results could not be merged";break;case we.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case we.not_finite:r="Number must be finite";break;default:r=e.defaultError,Jr.assertNever(t)}return{message:r}},LIe=fC;function EJt(t){LIe=t}function oq(){return LIe}var sq=t=>{let{data:e,path:r,errorMaps:n,issueData:i}=t,a=[...r,...i.path||[]],o={...i,path:a};if(i.message!==void 0)return{...i,path:a,message:i.message};let s="",c=n.filter(u=>!!u).slice().reverse();for(let u of c)s=u(o,{data:e,defaultError:s}).message;return{...i,path:a,message:s}},_Jt=[];function je(t,e){let r=oq(),n=sq({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===fC?void 0:fC].filter(i=>!!i)});t.common.issues.push(n)}var Ds=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let n=[];for(let i of r){if(i.status==="aborted")return jt;i.status==="dirty"&&e.dirty(),n.push(i.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){let n=[];for(let i of r){let a=await i.key,o=await i.value;n.push({key:a,value:o})}return t.mergeObjectSync(e,n)}static mergeObjectSync(e,r){let n={};for(let i of r){let{key:a,value:o}=i;if(a.status==="aborted"||o.status==="aborted")return jt;a.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof o.value<"u"||i.alwaysSet)&&(n[a.value]=o.value)}return{status:e.value,value:n}}},jt=Object.freeze({status:"aborted"}),pC=t=>({status:"dirty",value:t}),Ec=t=>({status:"valid",value:t}),qQ=t=>t.status==="aborted",UQ=t=>t.status==="dirty",eN=t=>t.status==="valid",tN=t=>typeof Promise<"u"&&t instanceof Promise;function cq(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)}function kIe(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r}var bt;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(bt||(bt={}));var Qw,Zw,rp=class{constructor(e,r,n,i){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},IIe=(t,e)=>{if(eN(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new sl(t.common.issues);return this._error=r,this._error}}};function pr(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:n,description:i}=t;if(e&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(o,s)=>{var c,u;let{message:l}=t;return o.code==="invalid_enum_value"?{message:l??s.defaultError}:typeof s.data>"u"?{message:(c=l??n)!==null&&c!==void 0?c:s.defaultError}:o.code!=="invalid_type"?{message:s.defaultError}:{message:(u=l??r)!==null&&u!==void 0?u:s.defaultError}},description:i}}var fr=class{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return xv(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:xv(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Ds,ctx:{common:e.parent.common,data:e.data,parsedType:xv(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(tN(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){var n;let i={common:{issues:[],async:(n=r?.async)!==null&&n!==void 0?n:!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:xv(e)},a=this._parseSync({data:e,path:i.path,parent:i});return IIe(i,a)}async parseAsync(e,r){let n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:xv(e)},i=this._parse({data:e,path:n.path,parent:n}),a=await(tN(i)?i:Promise.resolve(i));return IIe(n,a)}refine(e,r){let n=i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r;return this._refinement((i,a)=>{let o=e(i),s=()=>a.addIssue({code:we.custom,...n(i)});return typeof Promise<"u"&&o instanceof Promise?o.then(c=>c?!0:(s(),!1)):o?!0:(s(),!1)})}refinement(e,r){return this._refinement((n,i)=>e(n)?!0:(i.addIssue(typeof r=="function"?r(n,i):r),!1))}_refinement(e){return new cl({schema:this,typeName:Vt.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return tp.create(this,this._def)}nullable(){return Bd.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return lg.create(this,this._def)}promise(){return wv.create(this,this._def)}or(e){return J_.create([this,e],this._def)}and(e){return Q_.create(this,e,this._def)}transform(e){return new cl({...pr(this._def),schema:this,typeName:Vt.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new nT({...pr(this._def),innerType:this,defaultValue:r,typeName:Vt.ZodDefault})}brand(){return new rN({typeName:Vt.ZodBranded,type:this,...pr(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new iT({...pr(this._def),innerType:this,catchValue:r,typeName:Vt.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return nN.create(this,e)}readonly(){return aT.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},TJt=/^c[^\s-]{8,}$/i,OJt=/^[0-9a-z]+$/,SJt=/^[0-9A-HJKMNP-TV-Z]{26}$/,CJt=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,AJt=/^[a-z0-9_-]{21}$/i,xJt=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,PJt=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,DJt="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",VQ,wJt=/^(?:(?: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])$/,NJt=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,IJt=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,MIe="((\\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])))",RJt=new RegExp(`^${MIe}$`);function $Ie(t){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`),e}function LJt(t){return new RegExp(`^${$Ie(t)}$`)}function FIe(t){let e=`${MIe}T${$Ie(t)}`,r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function kJt(t,e){return!!((e==="v4"||!e)&&wJt.test(t)||(e==="v6"||!e)&&NJt.test(t))}var Pv=class t extends fr{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==We.string){let a=this._getOrReturnCtx(e);return je(a,{code:we.invalid_type,expected:We.string,received:a.parsedType}),jt}let n=new Ds,i;for(let a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(i=this._getOrReturnCtx(e,i),je(i,{code:we.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="max")e.data.length>a.value&&(i=this._getOrReturnCtx(e,i),je(i,{code:we.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="length"){let o=e.data.length>a.value,s=e.data.length<a.value;(o||s)&&(i=this._getOrReturnCtx(e,i),o?je(i,{code:we.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):s&&je(i,{code:we.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),n.dirty())}else if(a.kind==="email")PJt.test(e.data)||(i=this._getOrReturnCtx(e,i),je(i,{validation:"email",code:we.invalid_string,message:a.message}),n.dirty());else if(a.kind==="emoji")VQ||(VQ=new RegExp(DJt,"u")),VQ.test(e.data)||(i=this._getOrReturnCtx(e,i),je(i,{validation:"emoji",code:we.invalid_string,message:a.message}),n.dirty());else if(a.kind==="uuid")CJt.test(e.data)||(i=this._getOrReturnCtx(e,i),je(i,{validation:"uuid",code:we.invalid_string,message:a.message}),n.dirty());else if(a.kind==="nanoid")AJt.test(e.data)||(i=this._getOrReturnCtx(e,i),je(i,{validation:"nanoid",code:we.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid")TJt.test(e.data)||(i=this._getOrReturnCtx(e,i),je(i,{validation:"cuid",code:we.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid2")OJt.test(e.data)||(i=this._getOrReturnCtx(e,i),je(i,{validation:"cuid2",code:we.invalid_string,message:a.message}),n.dirty());else if(a.kind==="ulid")SJt.test(e.data)||(i=this._getOrReturnCtx(e,i),je(i,{validation:"ulid",code:we.invalid_string,message:a.message}),n.dirty());else if(a.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),je(i,{validation:"url",code:we.invalid_string,message:a.message}),n.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),je(i,{validation:"regex",code:we.invalid_string,message:a.message}),n.dirty())):a.kind==="trim"?e.data=e.data.trim():a.kind==="includes"?e.data.includes(a.value,a.position)||(i=this._getOrReturnCtx(e,i),je(i,{code:we.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),n.dirty()):a.kind==="toLowerCase"?e.data=e.data.toLowerCase():a.kind==="toUpperCase"?e.data=e.data.toUpperCase():a.kind==="startsWith"?e.data.startsWith(a.value)||(i=this._getOrReturnCtx(e,i),je(i,{code:we.invalid_string,validation:{startsWith:a.value},message:a.message}),n.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(i=this._getOrReturnCtx(e,i),je(i,{code:we.invalid_string,validation:{endsWith:a.value},message:a.message}),n.dirty()):a.kind==="datetime"?FIe(a).test(e.data)||(i=this._getOrReturnCtx(e,i),je(i,{code:we.invalid_string,validation:"datetime",message:a.message}),n.dirty()):a.kind==="date"?RJt.test(e.data)||(i=this._getOrReturnCtx(e,i),je(i,{code:we.invalid_string,validation:"date",message:a.message}),n.dirty()):a.kind==="time"?LJt(a).test(e.data)||(i=this._getOrReturnCtx(e,i),je(i,{code:we.invalid_string,validation:"time",message:a.message}),n.dirty()):a.kind==="duration"?xJt.test(e.data)||(i=this._getOrReturnCtx(e,i),je(i,{validation:"duration",code:we.invalid_string,message:a.message}),n.dirty()):a.kind==="ip"?kJt(e.data,a.version)||(i=this._getOrReturnCtx(e,i),je(i,{validation:"ip",code:we.invalid_string,message:a.message}),n.dirty()):a.kind==="base64"?IJt.test(e.data)||(i=this._getOrReturnCtx(e,i),je(i,{validation:"base64",code:we.invalid_string,message:a.message}),n.dirty()):Jr.assertNever(a);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(i=>e.test(i),{validation:r,code:we.invalid_string,...bt.errToObj(n)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...bt.errToObj(e)})}url(e){return this._addCheck({kind:"url",...bt.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...bt.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...bt.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...bt.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...bt.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...bt.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...bt.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...bt.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...bt.errToObj(e)})}datetime(e){var r,n;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:(r=e?.offset)!==null&&r!==void 0?r:!1,local:(n=e?.local)!==null&&n!==void 0?n:!1,...bt.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...bt.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...bt.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...bt.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...bt.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...bt.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...bt.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...bt.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...bt.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...bt.errToObj(r)})}nonempty(e){return this.min(1,bt.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};Pv.create=t=>{var e;return new Pv({checks:[],typeName:Vt.ZodString,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...pr(t)})};function MJt(t,e){let r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,i=r>n?r:n,a=parseInt(t.toFixed(i).replace(".","")),o=parseInt(e.toFixed(i).replace(".",""));return a%o/Math.pow(10,i)}var G_=class t extends fr{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==We.number){let a=this._getOrReturnCtx(e);return je(a,{code:we.invalid_type,expected:We.number,received:a.parsedType}),jt}let n,i=new Ds;for(let a of this._def.checks)a.kind==="int"?Jr.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),je(n,{code:we.invalid_type,expected:"integer",received:"float",message:a.message}),i.dirty()):a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(n=this._getOrReturnCtx(e,n),je(n,{code:we.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(n=this._getOrReturnCtx(e,n),je(n,{code:we.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="multipleOf"?MJt(e.data,a.value)!==0&&(n=this._getOrReturnCtx(e,n),je(n,{code:we.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),je(n,{code:we.not_finite,message:a.message}),i.dirty()):Jr.assertNever(a);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,bt.toString(r))}gt(e,r){return this.setLimit("min",e,!1,bt.toString(r))}lte(e,r){return this.setLimit("max",e,!0,bt.toString(r))}lt(e,r){return this.setLimit("max",e,!1,bt.toString(r))}setLimit(e,r,n,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:bt.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:bt.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:bt.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:bt.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:bt.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:bt.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:bt.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:bt.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:bt.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:bt.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Jr.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(r)&&Number.isFinite(e)}};G_.create=t=>new G_({checks:[],typeName:Vt.ZodNumber,coerce:t?.coerce||!1,...pr(t)});var z_=class t extends fr{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==We.bigint){let a=this._getOrReturnCtx(e);return je(a,{code:we.invalid_type,expected:We.bigint,received:a.parsedType}),jt}let n,i=new Ds;for(let a of this._def.checks)a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(n=this._getOrReturnCtx(e,n),je(n,{code:we.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),i.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(n=this._getOrReturnCtx(e,n),je(n,{code:we.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),i.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),je(n,{code:we.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):Jr.assertNever(a);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,bt.toString(r))}gt(e,r){return this.setLimit("min",e,!1,bt.toString(r))}lte(e,r){return this.setLimit("max",e,!0,bt.toString(r))}lt(e,r){return this.setLimit("max",e,!1,bt.toString(r))}setLimit(e,r,n,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:bt.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:bt.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:bt.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:bt.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:bt.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:bt.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};z_.create=t=>{var e;return new z_({checks:[],typeName:Vt.ZodBigInt,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...pr(t)})};var K_=class extends fr{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==We.boolean){let n=this._getOrReturnCtx(e);return je(n,{code:we.invalid_type,expected:We.boolean,received:n.parsedType}),jt}return Ec(e.data)}};K_.create=t=>new K_({typeName:Vt.ZodBoolean,coerce:t?.coerce||!1,...pr(t)});var Y_=class t extends fr{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==We.date){let a=this._getOrReturnCtx(e);return je(a,{code:we.invalid_type,expected:We.date,received:a.parsedType}),jt}if(isNaN(e.data.getTime())){let a=this._getOrReturnCtx(e);return je(a,{code:we.invalid_date}),jt}let n=new Ds,i;for(let a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(i=this._getOrReturnCtx(e,i),je(i,{code:we.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),n.dirty()):a.kind==="max"?e.data.getTime()>a.value&&(i=this._getOrReturnCtx(e,i),je(i,{code:we.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),n.dirty()):Jr.assertNever(a);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:bt.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:bt.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};Y_.create=t=>new Y_({checks:[],coerce:t?.coerce||!1,typeName:Vt.ZodDate,...pr(t)});var dC=class extends fr{_parse(e){if(this._getType(e)!==We.symbol){let n=this._getOrReturnCtx(e);return je(n,{code:we.invalid_type,expected:We.symbol,received:n.parsedType}),jt}return Ec(e.data)}};dC.create=t=>new dC({typeName:Vt.ZodSymbol,...pr(t)});var W_=class extends fr{_parse(e){if(this._getType(e)!==We.undefined){let n=this._getOrReturnCtx(e);return je(n,{code:we.invalid_type,expected:We.undefined,received:n.parsedType}),jt}return Ec(e.data)}};W_.create=t=>new W_({typeName:Vt.ZodUndefined,...pr(t)});var X_=class extends fr{_parse(e){if(this._getType(e)!==We.null){let n=this._getOrReturnCtx(e);return je(n,{code:we.invalid_type,expected:We.null,received:n.parsedType}),jt}return Ec(e.data)}};X_.create=t=>new X_({typeName:Vt.ZodNull,...pr(t)});var Dv=class extends fr{constructor(){super(...arguments),this._any=!0}_parse(e){return Ec(e.data)}};Dv.create=t=>new Dv({typeName:Vt.ZodAny,...pr(t)});var ug=class extends fr{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Ec(e.data)}};ug.create=t=>new ug({typeName:Vt.ZodUnknown,...pr(t)});var Nf=class extends fr{_parse(e){let r=this._getOrReturnCtx(e);return je(r,{code:we.invalid_type,expected:We.never,received:r.parsedType}),jt}};Nf.create=t=>new Nf({typeName:Vt.ZodNever,...pr(t)});var hC=class extends fr{_parse(e){if(this._getType(e)!==We.undefined){let n=this._getOrReturnCtx(e);return je(n,{code:we.invalid_type,expected:We.void,received:n.parsedType}),jt}return Ec(e.data)}};hC.create=t=>new hC({typeName:Vt.ZodVoid,...pr(t)});var lg=class t extends fr{_parse(e){let{ctx:r,status:n}=this._processInputParams(e),i=this._def;if(r.parsedType!==We.array)return je(r,{code:we.invalid_type,expected:We.array,received:r.parsedType}),jt;if(i.exactLength!==null){let o=r.data.length>i.exactLength.value,s=r.data.length<i.exactLength.value;(o||s)&&(je(r,{code:o?we.too_big:we.too_small,minimum:s?i.exactLength.value:void 0,maximum:o?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),n.dirty())}if(i.minLength!==null&&r.data.length<i.minLength.value&&(je(r,{code:we.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),n.dirty()),i.maxLength!==null&&r.data.length>i.maxLength.value&&(je(r,{code:we.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((o,s)=>i.type._parseAsync(new rp(r,o,r.path,s)))).then(o=>Ds.mergeArray(n,o));let a=[...r.data].map((o,s)=>i.type._parseSync(new rp(r,o,r.path,s)));return Ds.mergeArray(n,a)}get element(){return this._def.type}min(e,r){return new t({...this._def,minLength:{value:e,message:bt.toString(r)}})}max(e,r){return new t({...this._def,maxLength:{value:e,message:bt.toString(r)}})}length(e,r){return new t({...this._def,exactLength:{value:e,message:bt.toString(r)}})}nonempty(e){return this.min(1,e)}};lg.create=(t,e)=>new lg({type:t,minLength:null,maxLength:null,exactLength:null,typeName:Vt.ZodArray,...pr(e)});function lC(t){if(t instanceof au){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=tp.create(lC(n))}return new au({...t._def,shape:()=>e})}else return t instanceof lg?new lg({...t._def,type:lC(t.element)}):t instanceof tp?tp.create(lC(t.unwrap())):t instanceof Bd?Bd.create(lC(t.unwrap())):t instanceof Ud?Ud.create(t.items.map(e=>lC(e))):t}var au=class t extends fr{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=Jr.objectKeys(e);return this._cached={shape:e,keys:r}}_parse(e){if(this._getType(e)!==We.object){let u=this._getOrReturnCtx(e);return je(u,{code:we.invalid_type,expected:We.object,received:u.parsedType}),jt}let{status:n,ctx:i}=this._processInputParams(e),{shape:a,keys:o}=this._getCached(),s=[];if(!(this._def.catchall instanceof Nf&&this._def.unknownKeys==="strip"))for(let u in i.data)o.includes(u)||s.push(u);let c=[];for(let u of o){let l=a[u],p=i.data[u];c.push({key:{status:"valid",value:u},value:l._parse(new rp(i,p,i.path,u)),alwaysSet:u in i.data})}if(this._def.catchall instanceof Nf){let u=this._def.unknownKeys;if(u==="passthrough")for(let l of s)c.push({key:{status:"valid",value:l},value:{status:"valid",value:i.data[l]}});else if(u==="strict")s.length>0&&(je(i,{code:we.unrecognized_keys,keys:s}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let u=this._def.catchall;for(let l of s){let p=i.data[l];c.push({key:{status:"valid",value:l},value:u._parse(new rp(i,p,i.path,l)),alwaysSet:l in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let u=[];for(let l of c){let p=await l.key,h=await l.value;u.push({key:p,value:h,alwaysSet:l.alwaysSet})}return u}).then(u=>Ds.mergeObjectSync(n,u)):Ds.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(e){return bt.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{var i,a,o,s;let c=(o=(a=(i=this._def).errorMap)===null||a===void 0?void 0:a.call(i,r,n).message)!==null&&o!==void 0?o:n.defaultError;return r.code==="unrecognized_keys"?{message:(s=bt.errToObj(e).message)!==null&&s!==void 0?s:c}:{message:c}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Vt.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let r={};return Jr.objectKeys(e).forEach(n=>{e[n]&&this.shape[n]&&(r[n]=this.shape[n])}),new t({...this._def,shape:()=>r})}omit(e){let r={};return Jr.objectKeys(this.shape).forEach(n=>{e[n]||(r[n]=this.shape[n])}),new t({...this._def,shape:()=>r})}deepPartial(){return lC(this)}partial(e){let r={};return Jr.objectKeys(this.shape).forEach(n=>{let i=this.shape[n];e&&!e[n]?r[n]=i:r[n]=i.optional()}),new t({...this._def,shape:()=>r})}required(e){let r={};return Jr.objectKeys(this.shape).forEach(n=>{if(e&&!e[n])r[n]=this.shape[n];else{let a=this.shape[n];for(;a instanceof tp;)a=a._def.innerType;r[n]=a}}),new t({...this._def,shape:()=>r})}keyof(){return VIe(Jr.objectKeys(this.shape))}};au.create=(t,e)=>new au({shape:()=>t,unknownKeys:"strip",catchall:Nf.create(),typeName:Vt.ZodObject,...pr(e)});au.strictCreate=(t,e)=>new au({shape:()=>t,unknownKeys:"strict",catchall:Nf.create(),typeName:Vt.ZodObject,...pr(e)});au.lazycreate=(t,e)=>new au({shape:t,unknownKeys:"strip",catchall:Nf.create(),typeName:Vt.ZodObject,...pr(e)});var J_=class extends fr{_parse(e){let{ctx:r}=this._processInputParams(e),n=this._def.options;function i(a){for(let s of a)if(s.result.status==="valid")return s.result;for(let s of a)if(s.result.status==="dirty")return r.common.issues.push(...s.ctx.common.issues),s.result;let o=a.map(s=>new sl(s.ctx.common.issues));return je(r,{code:we.invalid_union,unionErrors:o}),jt}if(r.common.async)return Promise.all(n.map(async a=>{let o={...r,common:{...r.common,issues:[]},parent:null};return{result:await a._parseAsync({data:r.data,path:r.path,parent:o}),ctx:o}})).then(i);{let a,o=[];for(let c of n){let u={...r,common:{...r.common,issues:[]},parent:null},l=c._parseSync({data:r.data,path:r.path,parent:u});if(l.status==="valid")return l;l.status==="dirty"&&!a&&(a={result:l,ctx:u}),u.common.issues.length&&o.push(u.common.issues)}if(a)return r.common.issues.push(...a.ctx.common.issues),a.result;let s=o.map(c=>new sl(c));return je(r,{code:we.invalid_union,unionErrors:s}),jt}}get options(){return this._def.options}};J_.create=(t,e)=>new J_({options:t,typeName:Vt.ZodUnion,...pr(e)});var cg=t=>t instanceof Z_?cg(t.schema):t instanceof cl?cg(t.innerType()):t instanceof eT?[t.value]:t instanceof tT?t.options:t instanceof rT?Jr.objectValues(t.enum):t instanceof nT?cg(t._def.innerType):t instanceof W_?[void 0]:t instanceof X_?[null]:t instanceof tp?[void 0,...cg(t.unwrap())]:t instanceof Bd?[null,...cg(t.unwrap())]:t instanceof rN||t instanceof aT?cg(t.unwrap()):t instanceof iT?cg(t._def.innerType):[],uq=class t extends fr{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==We.object)return je(r,{code:we.invalid_type,expected:We.object,received:r.parsedType}),jt;let n=this.discriminator,i=r.data[n],a=this.optionsMap.get(i);return a?r.common.async?a._parseAsync({data:r.data,path:r.path,parent:r}):a._parseSync({data:r.data,path:r.path,parent:r}):(je(r,{code:we.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),jt)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,n){let i=new Map;for(let a of r){let o=cg(a.shape[e]);if(!o.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let s of o){if(i.has(s))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(s)}`);i.set(s,a)}}return new t({typeName:Vt.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:i,...pr(n)})}};function BQ(t,e){let r=xv(t),n=xv(e);if(t===e)return{valid:!0,data:t};if(r===We.object&&n===We.object){let i=Jr.objectKeys(e),a=Jr.objectKeys(t).filter(s=>i.indexOf(s)!==-1),o={...t,...e};for(let s of a){let c=BQ(t[s],e[s]);if(!c.valid)return{valid:!1};o[s]=c.data}return{valid:!0,data:o}}else if(r===We.array&&n===We.array){if(t.length!==e.length)return{valid:!1};let i=[];for(let a=0;a<t.length;a++){let o=t[a],s=e[a],c=BQ(o,s);if(!c.valid)return{valid:!1};i.push(c.data)}return{valid:!0,data:i}}else return r===We.date&&n===We.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var Q_=class extends fr{_parse(e){let{status:r,ctx:n}=this._processInputParams(e),i=(a,o)=>{if(qQ(a)||qQ(o))return jt;let s=BQ(a.value,o.value);return s.valid?((UQ(a)||UQ(o))&&r.dirty(),{status:r.value,value:s.data}):(je(n,{code:we.invalid_intersection_types}),jt)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([a,o])=>i(a,o)):i(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};Q_.create=(t,e,r)=>new Q_({left:t,right:e,typeName:Vt.ZodIntersection,...pr(r)});var Ud=class t extends fr{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==We.array)return je(n,{code:we.invalid_type,expected:We.array,received:n.parsedType}),jt;if(n.data.length<this._def.items.length)return je(n,{code:we.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),jt;!this._def.rest&&n.data.length>this._def.items.length&&(je(n,{code:we.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let a=[...n.data].map((o,s)=>{let c=this._def.items[s]||this._def.rest;return c?c._parse(new rp(n,o,n.path,s)):null}).filter(o=>!!o);return n.common.async?Promise.all(a).then(o=>Ds.mergeArray(r,o)):Ds.mergeArray(r,a)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};Ud.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ud({items:t,typeName:Vt.ZodTuple,rest:null,...pr(e)})};var lq=class t extends fr{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==We.object)return je(n,{code:we.invalid_type,expected:We.object,received:n.parsedType}),jt;let i=[],a=this._def.keyType,o=this._def.valueType;for(let s in n.data)i.push({key:a._parse(new rp(n,s,n.path,s)),value:o._parse(new rp(n,n.data[s],n.path,s)),alwaysSet:s in n.data});return n.common.async?Ds.mergeObjectAsync(r,i):Ds.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof fr?new t({keyType:e,valueType:r,typeName:Vt.ZodRecord,...pr(n)}):new t({keyType:Pv.create(),valueType:e,typeName:Vt.ZodRecord,...pr(r)})}},mC=class extends fr{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==We.map)return je(n,{code:we.invalid_type,expected:We.map,received:n.parsedType}),jt;let i=this._def.keyType,a=this._def.valueType,o=[...n.data.entries()].map(([s,c],u)=>({key:i._parse(new rp(n,s,n.path,[u,"key"])),value:a._parse(new rp(n,c,n.path,[u,"value"]))}));if(n.common.async){let s=new Map;return Promise.resolve().then(async()=>{for(let c of o){let u=await c.key,l=await c.value;if(u.status==="aborted"||l.status==="aborted")return jt;(u.status==="dirty"||l.status==="dirty")&&r.dirty(),s.set(u.value,l.value)}return{status:r.value,value:s}})}else{let s=new Map;for(let c of o){let u=c.key,l=c.value;if(u.status==="aborted"||l.status==="aborted")return jt;(u.status==="dirty"||l.status==="dirty")&&r.dirty(),s.set(u.value,l.value)}return{status:r.value,value:s}}}};mC.create=(t,e,r)=>new mC({valueType:e,keyType:t,typeName:Vt.ZodMap,...pr(r)});var gC=class t extends fr{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==We.set)return je(n,{code:we.invalid_type,expected:We.set,received:n.parsedType}),jt;let i=this._def;i.minSize!==null&&n.data.size<i.minSize.value&&(je(n,{code:we.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),r.dirty()),i.maxSize!==null&&n.data.size>i.maxSize.value&&(je(n,{code:we.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());let a=this._def.valueType;function o(c){let u=new Set;for(let l of c){if(l.status==="aborted")return jt;l.status==="dirty"&&r.dirty(),u.add(l.value)}return{status:r.value,value:u}}let s=[...n.data.values()].map((c,u)=>a._parse(new rp(n,c,n.path,u)));return n.common.async?Promise.all(s).then(c=>o(c)):o(s)}min(e,r){return new t({...this._def,minSize:{value:e,message:bt.toString(r)}})}max(e,r){return new t({...this._def,maxSize:{value:e,message:bt.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};gC.create=(t,e)=>new gC({valueType:t,minSize:null,maxSize:null,typeName:Vt.ZodSet,...pr(e)});var pq=class t extends fr{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==We.function)return je(r,{code:we.invalid_type,expected:We.function,received:r.parsedType}),jt;function n(s,c){return sq({data:s,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,oq(),fC].filter(u=>!!u),issueData:{code:we.invalid_arguments,argumentsError:c}})}function i(s,c){return sq({data:s,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,oq(),fC].filter(u=>!!u),issueData:{code:we.invalid_return_type,returnTypeError:c}})}let a={errorMap:r.common.contextualErrorMap},o=r.data;if(this._def.returns instanceof wv){let s=this;return Ec(async function(...c){let u=new sl([]),l=await s._def.args.parseAsync(c,a).catch(f=>{throw u.addIssue(n(c,f)),u}),p=await Reflect.apply(o,this,l);return await s._def.returns._def.type.parseAsync(p,a).catch(f=>{throw u.addIssue(i(p,f)),u})})}else{let s=this;return Ec(function(...c){let u=s._def.args.safeParse(c,a);if(!u.success)throw new sl([n(c,u.error)]);let l=Reflect.apply(o,this,u.data),p=s._def.returns.safeParse(l,a);if(!p.success)throw new sl([i(l,p.error)]);return p.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:Ud.create(e).rest(ug.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,n){return new t({args:e||Ud.create([]).rest(ug.create()),returns:r||ug.create(),typeName:Vt.ZodFunction,...pr(n)})}},Z_=class extends fr{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};Z_.create=(t,e)=>new Z_({getter:t,typeName:Vt.ZodLazy,...pr(e)});var eT=class extends fr{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return je(r,{received:r.data,code:we.invalid_literal,expected:this._def.value}),jt}return{status:"valid",value:e.data}}get value(){return this._def.value}};eT.create=(t,e)=>new eT({value:t,typeName:Vt.ZodLiteral,...pr(e)});function VIe(t,e){return new tT({values:t,typeName:Vt.ZodEnum,...pr(e)})}var tT=class t extends fr{constructor(){super(...arguments),Qw.set(this,void 0)}_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),n=this._def.values;return je(r,{expected:Jr.joinValues(n),received:r.parsedType,code:we.invalid_type}),jt}if(cq(this,Qw,"f")||kIe(this,Qw,new Set(this._def.values),"f"),!cq(this,Qw,"f").has(e.data)){let r=this._getOrReturnCtx(e),n=this._def.values;return je(r,{received:r.data,code:we.invalid_enum_value,options:n}),jt}return Ec(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return t.create(e,{...this._def,...r})}exclude(e,r=this._def){return t.create(this.options.filter(n=>!e.includes(n)),{...this._def,...r})}};Qw=new WeakMap;tT.create=VIe;var rT=class extends fr{constructor(){super(...arguments),Zw.set(this,void 0)}_parse(e){let r=Jr.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==We.string&&n.parsedType!==We.number){let i=Jr.objectValues(r);return je(n,{expected:Jr.joinValues(i),received:n.parsedType,code:we.invalid_type}),jt}if(cq(this,Zw,"f")||kIe(this,Zw,new Set(Jr.getValidEnumValues(this._def.values)),"f"),!cq(this,Zw,"f").has(e.data)){let i=Jr.objectValues(r);return je(n,{received:n.data,code:we.invalid_enum_value,options:i}),jt}return Ec(e.data)}get enum(){return this._def.values}};Zw=new WeakMap;rT.create=(t,e)=>new rT({values:t,typeName:Vt.ZodNativeEnum,...pr(e)});var wv=class extends fr{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==We.promise&&r.common.async===!1)return je(r,{code:we.invalid_type,expected:We.promise,received:r.parsedType}),jt;let n=r.parsedType===We.promise?r.data:Promise.resolve(r.data);return Ec(n.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}};wv.create=(t,e)=>new wv({type:t,typeName:Vt.ZodPromise,...pr(e)});var cl=class extends fr{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Vt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),i=this._def.effect||null,a={addIssue:o=>{je(n,o),o.fatal?r.abort():r.dirty()},get path(){return n.path}};if(a.addIssue=a.addIssue.bind(a),i.type==="preprocess"){let o=i.transform(n.data,a);if(n.common.async)return Promise.resolve(o).then(async s=>{if(r.value==="aborted")return jt;let c=await this._def.schema._parseAsync({data:s,path:n.path,parent:n});return c.status==="aborted"?jt:c.status==="dirty"||r.value==="dirty"?pC(c.value):c});{if(r.value==="aborted")return jt;let s=this._def.schema._parseSync({data:o,path:n.path,parent:n});return s.status==="aborted"?jt:s.status==="dirty"||r.value==="dirty"?pC(s.value):s}}if(i.type==="refinement"){let o=s=>{let c=i.refinement(s,a);if(n.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(n.common.async===!1){let s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?jt:(s.status==="dirty"&&r.dirty(),o(s.value),{status:r.value,value:s.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(s=>s.status==="aborted"?jt:(s.status==="dirty"&&r.dirty(),o(s.value).then(()=>({status:r.value,value:s.value}))))}if(i.type==="transform")if(n.common.async===!1){let o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!eN(o))return o;let s=i.transform(o.value,a);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:s}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>eN(o)?Promise.resolve(i.transform(o.value,a)).then(s=>({status:r.value,value:s})):o);Jr.assertNever(i)}};cl.create=(t,e,r)=>new cl({schema:t,typeName:Vt.ZodEffects,effect:e,...pr(r)});cl.createWithPreprocess=(t,e,r)=>new cl({schema:e,effect:{type:"preprocess",transform:t},typeName:Vt.ZodEffects,...pr(r)});var tp=class extends fr{_parse(e){return this._getType(e)===We.undefined?Ec(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};tp.create=(t,e)=>new tp({innerType:t,typeName:Vt.ZodOptional,...pr(e)});var Bd=class extends fr{_parse(e){return this._getType(e)===We.null?Ec(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Bd.create=(t,e)=>new Bd({innerType:t,typeName:Vt.ZodNullable,...pr(e)});var nT=class extends fr{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return r.parsedType===We.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};nT.create=(t,e)=>new nT({innerType:t,typeName:Vt.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...pr(e)});var iT=class extends fr{_parse(e){let{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return tN(i)?i.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new sl(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new sl(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};iT.create=(t,e)=>new iT({innerType:t,typeName:Vt.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...pr(e)});var yC=class extends fr{_parse(e){if(this._getType(e)!==We.nan){let n=this._getOrReturnCtx(e);return je(n,{code:we.invalid_type,expected:We.nan,received:n.parsedType}),jt}return{status:"valid",value:e.data}}};yC.create=t=>new yC({typeName:Vt.ZodNaN,...pr(t)});var $Jt=Symbol("zod_brand"),rN=class extends fr{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},nN=class t extends fr{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let a=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?jt:a.status==="dirty"?(r.dirty(),pC(a.value)):this._def.out._parseAsync({data:a.value,path:n.path,parent:n})})();{let i=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?jt:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(e,r){return new t({in:e,out:r,typeName:Vt.ZodPipeline})}},aT=class extends fr{_parse(e){let r=this._def.innerType._parse(e),n=i=>(eN(i)&&(i.value=Object.freeze(i.value)),i);return tN(r)?r.then(i=>n(i)):n(r)}unwrap(){return this._def.innerType}};aT.create=(t,e)=>new aT({innerType:t,typeName:Vt.ZodReadonly,...pr(e)});function jIe(t,e={},r){return t?Dv.create().superRefine((n,i)=>{var a,o;if(!t(n)){let s=typeof e=="function"?e(n):typeof e=="string"?{message:e}:e,c=(o=(a=s.fatal)!==null&&a!==void 0?a:r)!==null&&o!==void 0?o:!0,u=typeof s=="string"?{message:s}:s;i.addIssue({code:"custom",...u,fatal:c})}}):Dv.create()}var FJt={object:au.lazycreate},Vt;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(Vt||(Vt={}));var VJt=(t,e={message:`Input not instance of ${t.name}`})=>jIe(r=>r instanceof t,e),qIe=Pv.create,UIe=G_.create,jJt=yC.create,qJt=z_.create,BIe=K_.create,UJt=Y_.create,BJt=dC.create,HJt=W_.create,GJt=X_.create,zJt=Dv.create,KJt=ug.create,YJt=Nf.create,WJt=hC.create,XJt=lg.create,JJt=au.create,QJt=au.strictCreate,ZJt=J_.create,eQt=uq.create,tQt=Q_.create,rQt=Ud.create,nQt=lq.create,iQt=mC.create,aQt=gC.create,oQt=pq.create,sQt=Z_.create,cQt=eT.create,uQt=tT.create,lQt=rT.create,pQt=wv.create,RIe=cl.create,fQt=tp.create,dQt=Bd.create,hQt=cl.createWithPreprocess,mQt=nN.create,gQt=()=>qIe().optional(),yQt=()=>UIe().optional(),vQt=()=>BIe().optional(),bQt={string:t=>Pv.create({...t,coerce:!0}),number:t=>G_.create({...t,coerce:!0}),boolean:t=>K_.create({...t,coerce:!0}),bigint:t=>z_.create({...t,coerce:!0}),date:t=>Y_.create({...t,coerce:!0})},EQt=jt,w=Object.freeze({__proto__:null,defaultErrorMap:fC,setErrorMap:EJt,getErrorMap:oq,makeIssue:sq,EMPTY_PATH:_Jt,addIssueToContext:je,ParseStatus:Ds,INVALID:jt,DIRTY:pC,OK:Ec,isAborted:qQ,isDirty:UQ,isValid:eN,isAsync:tN,get util(){return Jr},get objectUtil(){return jQ},ZodParsedType:We,getParsedType:xv,ZodType:fr,datetimeRegex:FIe,ZodString:Pv,ZodNumber:G_,ZodBigInt:z_,ZodBoolean:K_,ZodDate:Y_,ZodSymbol:dC,ZodUndefined:W_,ZodNull:X_,ZodAny:Dv,ZodUnknown:ug,ZodNever:Nf,ZodVoid:hC,ZodArray:lg,ZodObject:au,ZodUnion:J_,ZodDiscriminatedUnion:uq,ZodIntersection:Q_,ZodTuple:Ud,ZodRecord:lq,ZodMap:mC,ZodSet:gC,ZodFunction:pq,ZodLazy:Z_,ZodLiteral:eT,ZodEnum:tT,ZodNativeEnum:rT,ZodPromise:wv,ZodEffects:cl,ZodTransformer:cl,ZodOptional:tp,ZodNullable:Bd,ZodDefault:nT,ZodCatch:iT,ZodNaN:yC,BRAND:$Jt,ZodBranded:rN,ZodPipeline:nN,ZodReadonly:aT,custom:jIe,Schema:fr,ZodSchema:fr,late:FJt,get ZodFirstPartyTypeKind(){return Vt},coerce:bQt,any:zJt,array:XJt,bigint:qJt,boolean:BIe,date:UJt,discriminatedUnion:eQt,effect:RIe,enum:uQt,function:oQt,instanceof:VJt,intersection:tQt,lazy:sQt,literal:cQt,map:iQt,nan:jJt,nativeEnum:lQt,never:YJt,null:GJt,nullable:dQt,number:UIe,object:JJt,oboolean:vQt,onumber:yQt,optional:fQt,ostring:gQt,pipeline:mQt,preprocess:hQt,promise:pQt,record:nQt,set:aQt,strictObject:QJt,string:qIe,symbol:BJt,transformer:RIe,tuple:rQt,undefined:HJt,union:ZJt,unknown:KJt,void:WJt,NEVER:EQt,ZodIssueCode:we,quotelessJson:bJt,ZodError:sl});var HQ="2025-06-18";var HIe=[HQ,"2025-03-26","2024-11-05","2024-10-07"],fq="2.0",GIe=w.union([w.string(),w.number().int()]),zIe=w.string(),_Qt=w.object({progressToken:w.optional(GIe)}).passthrough(),np=w.object({_meta:w.optional(_Qt)}).passthrough(),ou=w.object({method:w.string(),params:w.optional(np)}),iN=w.object({_meta:w.optional(w.object({}).passthrough())}).passthrough(),Hd=w.object({method:w.string(),params:w.optional(iN)}),ip=w.object({_meta:w.optional(w.object({}).passthrough())}).passthrough(),dq=w.union([w.string(),w.number().int()]),KIe=w.object({jsonrpc:w.literal(fq),id:dq}).merge(ou).strict(),YIe=t=>KIe.safeParse(t).success,WIe=w.object({jsonrpc:w.literal(fq)}).merge(Hd).strict(),XIe=t=>WIe.safeParse(t).success,JIe=w.object({jsonrpc:w.literal(fq),id:dq,result:ip}).strict(),GQ=t=>JIe.safeParse(t).success,If;(function(t){t[t.ConnectionClosed=-32e3]="ConnectionClosed",t[t.RequestTimeout=-32001]="RequestTimeout",t[t.ParseError=-32700]="ParseError",t[t.InvalidRequest=-32600]="InvalidRequest",t[t.MethodNotFound=-32601]="MethodNotFound",t[t.InvalidParams=-32602]="InvalidParams",t[t.InternalError=-32603]="InternalError"})(If||(If={}));var QIe=w.object({jsonrpc:w.literal(fq),id:dq,error:w.object({code:w.number().int(),message:w.string(),data:w.optional(w.unknown())})}).strict(),ZIe=t=>QIe.safeParse(t).success,eRe=w.union([KIe,WIe,JIe,QIe]),hq=ip.strict(),mq=Hd.extend({method:w.literal("notifications/cancelled"),params:iN.extend({requestId:dq,reason:w.string().optional()})}),aN=w.object({name:w.string(),title:w.optional(w.string())}).passthrough(),tRe=aN.extend({version:w.string()}),TQt=w.object({experimental:w.optional(w.object({}).passthrough()),sampling:w.optional(w.object({}).passthrough()),elicitation:w.optional(w.object({}).passthrough()),roots:w.optional(w.object({listChanged:w.optional(w.boolean())}).passthrough())}).passthrough(),zQ=ou.extend({method:w.literal("initialize"),params:np.extend({protocolVersion:w.string(),capabilities:TQt,clientInfo:tRe})});var OQt=w.object({experimental:w.optional(w.object({}).passthrough()),logging:w.optional(w.object({}).passthrough()),completions:w.optional(w.object({}).passthrough()),prompts:w.optional(w.object({listChanged:w.optional(w.boolean())}).passthrough()),resources:w.optional(w.object({subscribe:w.optional(w.boolean()),listChanged:w.optional(w.boolean())}).passthrough()),tools:w.optional(w.object({listChanged:w.optional(w.boolean())}).passthrough())}).passthrough(),SQt=ip.extend({protocolVersion:w.string(),capabilities:OQt,serverInfo:tRe,instructions:w.optional(w.string())}),KQ=Hd.extend({method:w.literal("notifications/initialized")});var gq=ou.extend({method:w.literal("ping")}),CQt=w.object({progress:w.number(),total:w.optional(w.number()),message:w.optional(w.string())}).passthrough(),yq=Hd.extend({method:w.literal("notifications/progress"),params:iN.merge(CQt).extend({progressToken:GIe})}),vq=ou.extend({params:np.extend({cursor:w.optional(zIe)}).optional()}),bq=ip.extend({nextCursor:w.optional(zIe)}),rRe=w.object({uri:w.string(),mimeType:w.optional(w.string()),_meta:w.optional(w.object({}).passthrough())}).passthrough(),nRe=rRe.extend({text:w.string()}),YQ=w.string().refine(t=>{try{return atob(t),!0}catch{return!1}},{message:"Invalid Base64 string"}),iRe=rRe.extend({blob:YQ}),aRe=aN.extend({uri:w.string(),description:w.optional(w.string()),mimeType:w.optional(w.string()),_meta:w.optional(w.object({}).passthrough())}),AQt=aN.extend({uriTemplate:w.string(),description:w.optional(w.string()),mimeType:w.optional(w.string()),_meta:w.optional(w.object({}).passthrough())}),xQt=vq.extend({method:w.literal("resources/list")}),PQt=bq.extend({resources:w.array(aRe)}),DQt=vq.extend({method:w.literal("resources/templates/list")}),wQt=bq.extend({resourceTemplates:w.array(AQt)}),NQt=ou.extend({method:w.literal("resources/read"),params:np.extend({uri:w.string()})}),IQt=ip.extend({contents:w.array(w.union([nRe,iRe]))}),RQt=Hd.extend({method:w.literal("notifications/resources/list_changed")}),LQt=ou.extend({method:w.literal("resources/subscribe"),params:np.extend({uri:w.string()})}),kQt=ou.extend({method:w.literal("resources/unsubscribe"),params:np.extend({uri:w.string()})}),MQt=Hd.extend({method:w.literal("notifications/resources/updated"),params:iN.extend({uri:w.string()})}),$Qt=w.object({name:w.string(),description:w.optional(w.string()),required:w.optional(w.boolean())}).passthrough(),FQt=aN.extend({description:w.optional(w.string()),arguments:w.optional(w.array($Qt)),_meta:w.optional(w.object({}).passthrough())}),VQt=vq.extend({method:w.literal("prompts/list")}),jQt=bq.extend({prompts:w.array(FQt)}),qQt=ou.extend({method:w.literal("prompts/get"),params:np.extend({name:w.string(),arguments:w.optional(w.record(w.string()))})}),WQ=w.object({type:w.literal("text"),text:w.string(),_meta:w.optional(w.object({}).passthrough())}).passthrough(),XQ=w.object({type:w.literal("image"),data:YQ,mimeType:w.string(),_meta:w.optional(w.object({}).passthrough())}).passthrough(),JQ=w.object({type:w.literal("audio"),data:YQ,mimeType:w.string(),_meta:w.optional(w.object({}).passthrough())}).passthrough(),UQt=w.object({type:w.literal("resource"),resource:w.union([nRe,iRe]),_meta:w.optional(w.object({}).passthrough())}).passthrough(),BQt=aRe.extend({type:w.literal("resource_link")}),oRe=w.union([WQ,XQ,JQ,BQt,UQt]),HQt=w.object({role:w.enum(["user","assistant"]),content:oRe}).passthrough(),GQt=ip.extend({description:w.optional(w.string()),messages:w.array(HQt)}),zQt=Hd.extend({method:w.literal("notifications/prompts/list_changed")}),KQt=w.object({title:w.optional(w.string()),readOnlyHint:w.optional(w.boolean()),destructiveHint:w.optional(w.boolean()),idempotentHint:w.optional(w.boolean()),openWorldHint:w.optional(w.boolean())}).passthrough(),YQt=aN.extend({description:w.optional(w.string()),inputSchema:w.object({type:w.literal("object"),properties:w.optional(w.object({}).passthrough()),required:w.optional(w.array(w.string()))}).passthrough(),outputSchema:w.optional(w.object({type:w.literal("object"),properties:w.optional(w.object({}).passthrough()),required:w.optional(w.array(w.string()))}).passthrough()),annotations:w.optional(KQt),_meta:w.optional(w.object({}).passthrough())}),QQ=vq.extend({method:w.literal("tools/list")}),WQt=bq.extend({tools:w.array(YQt)}),sRe=ip.extend({content:w.array(oRe).default([]),structuredContent:w.object({}).passthrough().optional(),isError:w.optional(w.boolean())}),UHn=sRe.or(ip.extend({toolResult:w.unknown()})),ZQ=ou.extend({method:w.literal("tools/call"),params:np.extend({name:w.string(),arguments:w.optional(w.record(w.unknown()))})}),XQt=Hd.extend({method:w.literal("notifications/tools/list_changed")}),oN=w.enum(["debug","info","notice","warning","error","critical","alert","emergency"]),eZ=ou.extend({method:w.literal("logging/setLevel"),params:np.extend({level:oN})}),JQt=Hd.extend({method:w.literal("notifications/message"),params:iN.extend({level:oN,logger:w.optional(w.string()),data:w.unknown()})}),QQt=w.object({name:w.string().optional()}).passthrough(),ZQt=w.object({hints:w.optional(w.array(QQt)),costPriority:w.optional(w.number().min(0).max(1)),speedPriority:w.optional(w.number().min(0).max(1)),intelligencePriority:w.optional(w.number().min(0).max(1))}).passthrough(),eZt=w.object({role:w.enum(["user","assistant"]),content:w.union([WQ,XQ,JQ])}).passthrough(),tZt=ou.extend({method:w.literal("sampling/createMessage"),params:np.extend({messages:w.array(eZt),systemPrompt:w.optional(w.string()),includeContext:w.optional(w.enum(["none","thisServer","allServers"])),temperature:w.optional(w.number()),maxTokens:w.number().int(),stopSequences:w.optional(w.array(w.string())),metadata:w.optional(w.object({}).passthrough()),modelPreferences:w.optional(ZQt)})}),tZ=ip.extend({model:w.string(),stopReason:w.optional(w.enum(["endTurn","stopSequence","maxTokens"]).or(w.string())),role:w.enum(["user","assistant"]),content:w.discriminatedUnion("type",[WQ,XQ,JQ])}),rZt=w.object({type:w.literal("boolean"),title:w.optional(w.string()),description:w.optional(w.string()),default:w.optional(w.boolean())}).passthrough(),nZt=w.object({type:w.literal("string"),title:w.optional(w.string()),description:w.optional(w.string()),minLength:w.optional(w.number()),maxLength:w.optional(w.number()),format:w.optional(w.enum(["email","uri","date","date-time"]))}).passthrough(),iZt=w.object({type:w.enum(["number","integer"]),title:w.optional(w.string()),description:w.optional(w.string()),minimum:w.optional(w.number()),maximum:w.optional(w.number())}).passthrough(),aZt=w.object({type:w.literal("string"),title:w.optional(w.string()),description:w.optional(w.string()),enum:w.array(w.string()),enumNames:w.optional(w.array(w.string()))}).passthrough(),oZt=w.union([rZt,nZt,iZt,aZt]),sZt=ou.extend({method:w.literal("elicitation/create"),params:np.extend({message:w.string(),requestedSchema:w.object({type:w.literal("object"),properties:w.record(w.string(),oZt),required:w.optional(w.array(w.string()))}).passthrough()})}),rZ=ip.extend({action:w.enum(["accept","decline","cancel"]),content:w.optional(w.record(w.string(),w.unknown()))}),cZt=w.object({type:w.literal("ref/resource"),uri:w.string()}).passthrough();var uZt=w.object({type:w.literal("ref/prompt"),name:w.string()}).passthrough(),lZt=ou.extend({method:w.literal("completion/complete"),params:np.extend({ref:w.union([uZt,cZt]),argument:w.object({name:w.string(),value:w.string()}).passthrough(),context:w.optional(w.object({arguments:w.optional(w.record(w.string(),w.string()))}))})}),pZt=ip.extend({completion:w.object({values:w.array(w.string()).max(100),total:w.optional(w.number().int()),hasMore:w.optional(w.boolean())}).passthrough()}),fZt=w.object({uri:w.string().startsWith("file://"),name:w.optional(w.string()),_meta:w.optional(w.object({}).passthrough())}).passthrough(),dZt=ou.extend({method:w.literal("roots/list")}),nZ=ip.extend({roots:w.array(fZt)}),hZt=Hd.extend({method:w.literal("notifications/roots/list_changed")}),BHn=w.union([gq,zQ,lZt,eZ,qQt,VQt,xQt,DQt,NQt,LQt,kQt,ZQ,QQ]),HHn=w.union([mq,yq,KQ,hZt]),GHn=w.union([hq,tZ,rZ,nZ]),zHn=w.union([gq,tZt,sZt,dZt]),KHn=w.union([mq,yq,JQt,MQt,RQt,XQt,zQt]),YHn=w.union([hq,SQt,pZt,GQt,jQt,PQt,wQt,IQt,sRe,WQt]),Rf=class extends Error{constructor(e,r,n){super(`MCP error ${e}: ${r}`),this.code=e,this.data=n,this.name="McpError"}};var mZt=6e4,Eq=class{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this.setNotificationHandler(mq,r=>{let n=this._requestHandlerAbortControllers.get(r.params.requestId);n?.abort(r.params.reason)}),this.setNotificationHandler(yq,r=>{this._onprogress(r)}),this.setRequestHandler(gq,r=>({}))}_setupTimeout(e,r,n,i,a=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(i,r),startTime:Date.now(),timeout:r,maxTotalTimeout:n,resetTimeoutOnProgress:a,onTimeout:i})}_resetTimeout(e){let r=this._timeoutInfo.get(e);if(!r)return!1;let n=Date.now()-r.startTime;if(r.maxTotalTimeout&&n>=r.maxTotalTimeout)throw this._timeoutInfo.delete(e),new Rf(If.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:r.maxTotalTimeout,totalElapsed:n});return clearTimeout(r.timeoutId),r.timeoutId=setTimeout(r.onTimeout,r.timeout),!0}_cleanupTimeout(e){let r=this._timeoutInfo.get(e);r&&(clearTimeout(r.timeoutId),this._timeoutInfo.delete(e))}async connect(e){var r,n,i;this._transport=e;let a=(r=this.transport)===null||r===void 0?void 0:r.onclose;this._transport.onclose=()=>{a?.(),this._onclose()};let o=(n=this.transport)===null||n===void 0?void 0:n.onerror;this._transport.onerror=c=>{o?.(c),this._onerror(c)};let s=(i=this._transport)===null||i===void 0?void 0:i.onmessage;this._transport.onmessage=(c,u)=>{s?.(c,u),GQ(c)||ZIe(c)?this._onresponse(c):YIe(c)?this._onrequest(c,u):XIe(c)?this._onnotification(c):this._onerror(new Error(`Unknown message type: ${JSON.stringify(c)}`))},await this._transport.start()}_onclose(){var e;let r=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._pendingDebouncedNotifications.clear(),this._transport=void 0,(e=this.onclose)===null||e===void 0||e.call(this);let n=new Rf(If.ConnectionClosed,"Connection closed");for(let i of r.values())i(n)}_onerror(e){var r;(r=this.onerror)===null||r===void 0||r.call(this,e)}_onnotification(e){var r;let n=(r=this._notificationHandlers.get(e.method))!==null&&r!==void 0?r:this.fallbackNotificationHandler;n!==void 0&&Promise.resolve().then(()=>n(e)).catch(i=>this._onerror(new Error(`Uncaught error in notification handler: ${i}`)))}_onrequest(e,r){var n,i;let a=(n=this._requestHandlers.get(e.method))!==null&&n!==void 0?n:this.fallbackRequestHandler,o=this._transport;if(a===void 0){o?.send({jsonrpc:"2.0",id:e.id,error:{code:If.MethodNotFound,message:"Method not found"}}).catch(u=>this._onerror(new Error(`Failed to send an error response: ${u}`)));return}let s=new AbortController;this._requestHandlerAbortControllers.set(e.id,s);let c={signal:s.signal,sessionId:o?.sessionId,_meta:(i=e.params)===null||i===void 0?void 0:i._meta,sendNotification:u=>this.notification(u,{relatedRequestId:e.id}),sendRequest:(u,l,p)=>this.request(u,l,{...p,relatedRequestId:e.id}),authInfo:r?.authInfo,requestId:e.id,requestInfo:r?.requestInfo};Promise.resolve().then(()=>a(e,c)).then(u=>{if(!s.signal.aborted)return o?.send({result:u,jsonrpc:"2.0",id:e.id})},u=>{var l;if(!s.signal.aborted)return o?.send({jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(u.code)?u.code:If.InternalError,message:(l=u.message)!==null&&l!==void 0?l:"Internal error"}})}).catch(u=>this._onerror(new Error(`Failed to send response: ${u}`))).finally(()=>{this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){let{progressToken:r,...n}=e.params,i=Number(r),a=this._progressHandlers.get(i);if(!a){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let o=this._responseHandlers.get(i),s=this._timeoutInfo.get(i);if(s&&o&&s.resetTimeoutOnProgress)try{this._resetTimeout(i)}catch(c){o(c);return}a(n)}_onresponse(e){let r=Number(e.id),n=this._responseHandlers.get(r);if(n===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}if(this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),GQ(e))n(e);else{let i=new Rf(e.error.code,e.error.message,e.error.data);n(i)}}get transport(){return this._transport}async close(){var e;await((e=this._transport)===null||e===void 0?void 0:e.close())}request(e,r,n){let{relatedRequestId:i,resumptionToken:a,onresumptiontoken:o}=n??{};return new Promise((s,c)=>{var u,l,p,h,f,d;if(!this._transport){c(new Error("Not connected"));return}((u=this._options)===null||u===void 0?void 0:u.enforceStrictCapabilities)===!0&&this.assertCapabilityForMethod(e.method),(l=n?.signal)===null||l===void 0||l.throwIfAborted();let m=this._requestMessageId++,v={...e,jsonrpc:"2.0",id:m};n?.onprogress&&(this._progressHandlers.set(m,n.onprogress),v.params={...e.params,_meta:{...((p=e.params)===null||p===void 0?void 0:p._meta)||{},progressToken:m}});let E=S=>{var C;this._responseHandlers.delete(m),this._progressHandlers.delete(m),this._cleanupTimeout(m),(C=this._transport)===null||C===void 0||C.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:m,reason:String(S)}},{relatedRequestId:i,resumptionToken:a,onresumptiontoken:o}).catch(x=>this._onerror(new Error(`Failed to send cancellation: ${x}`))),c(S)};this._responseHandlers.set(m,S=>{var C;if(!(!((C=n?.signal)===null||C===void 0)&&C.aborted)){if(S instanceof Error)return c(S);try{let x=r.parse(S.result);s(x)}catch(x){c(x)}}}),(h=n?.signal)===null||h===void 0||h.addEventListener("abort",()=>{var S;E((S=n?.signal)===null||S===void 0?void 0:S.reason)});let _=(f=n?.timeout)!==null&&f!==void 0?f:mZt,O=()=>E(new Rf(If.RequestTimeout,"Request timed out",{timeout:_}));this._setupTimeout(m,_,n?.maxTotalTimeout,O,(d=n?.resetTimeoutOnProgress)!==null&&d!==void 0?d:!1),this._transport.send(v,{relatedRequestId:i,resumptionToken:a,onresumptiontoken:o}).catch(S=>{this._cleanupTimeout(m),c(S)})})}async notification(e,r){var n,i;if(!this._transport)throw new Error("Not connected");if(this.assertNotificationCapability(e.method),((i=(n=this._options)===null||n===void 0?void 0:n.debouncedNotificationMethods)!==null&&i!==void 0?i:[]).includes(e.method)&&!e.params&&!r?.relatedRequestId){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{var c;if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let u={...e,jsonrpc:"2.0"};(c=this._transport)===null||c===void 0||c.send(u,r).catch(l=>this._onerror(l))});return}let s={...e,jsonrpc:"2.0"};await this._transport.send(s,r)}setRequestHandler(e,r){let n=e.shape.method.value;this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(i,a)=>Promise.resolve(r(e.parse(i),a)))}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,r){this._notificationHandlers.set(e.shape.method.value,n=>Promise.resolve(r(e.parse(n))))}removeNotificationHandler(e){this._notificationHandlers.delete(e)}};function cRe(t,e){return Object.entries(e).reduce((r,[n,i])=>(i&&typeof i=="object"?r[n]=r[n]?{...r[n],...i}:i:r[n]=i,r),{...t})}var lke=ot(uke(),1),Fq=class extends Eq{constructor(e,r){var n;super(r),this._serverInfo=e,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(oN.options.map((i,a)=>[i,a])),this.isMessageIgnored=(i,a)=>{let o=this._loggingLevels.get(a);return o?this.LOG_LEVEL_SEVERITY.get(i)<this.LOG_LEVEL_SEVERITY.get(o):!1},this._capabilities=(n=r?.capabilities)!==null&&n!==void 0?n:{},this._instructions=r?.instructions,this.setRequestHandler(zQ,i=>this._oninitialize(i)),this.setNotificationHandler(KQ,()=>{var i;return(i=this.oninitialized)===null||i===void 0?void 0:i.call(this)}),this._capabilities.logging&&this.setRequestHandler(eZ,async(i,a)=>{var o;let s=a.sessionId||((o=a.requestInfo)===null||o===void 0?void 0:o.headers["mcp-session-id"])||void 0,{level:c}=i.params,u=oN.safeParse(c);return s&&u.success&&this._loggingLevels.set(s,u.data),{}})}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=cRe(this._capabilities,e)}assertCapabilityForMethod(e){var r,n,i;switch(e){case"sampling/createMessage":if(!(!((r=this._clientCapabilities)===null||r===void 0)&&r.sampling))throw new Error(`Client does not support sampling (required for ${e})`);break;case"elicitation/create":if(!(!((n=this._clientCapabilities)===null||n===void 0)&&n.elicitation))throw new Error(`Client does not support elicitation (required for ${e})`);break;case"roots/list":if(!(!((i=this._clientCapabilities)===null||i===void 0)&&i.roots))throw new Error(`Client does not support listing roots (required for ${e})`);break;case"ping":break}}assertNotificationCapability(e){switch(e){case"notifications/message":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw new Error(`Server does not support notifying about resources (required for ${e})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new Error(`Server does not support notifying of tool list changes (required for ${e})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new Error(`Server does not support notifying of prompt list changes (required for ${e})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(e){switch(e){case"sampling/createMessage":if(!this._capabilities.sampling)throw new Error(`Server does not support sampling (required for ${e})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw new Error(`Server does not support resources (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new Error(`Server does not support tools (required for ${e})`);break;case"ping":case"initialize":break}}async _oninitialize(e){let r=e.params.protocolVersion;return this._clientCapabilities=e.params.capabilities,this._clientVersion=e.params.clientInfo,{protocolVersion:HIe.includes(r)?r:HQ,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getCapabilities(){return this._capabilities}async ping(){return this.request({method:"ping"},hq)}async createMessage(e,r){return this.request({method:"sampling/createMessage",params:e},tZ,r)}async elicitInput(e,r){let n=await this.request({method:"elicitation/create",params:e},rZ,r);if(n.action==="accept"&&n.content)try{let i=new lke.default,a=i.compile(e.requestedSchema);if(!a(n.content))throw new Rf(If.InvalidParams,`Elicitation response content does not match requested schema: ${i.errorsText(a.errors)}`)}catch(i){throw i instanceof Rf?i:new Rf(If.InternalError,`Error validating elicitation response: ${i}`)}return n}async listRoots(e,r){return this.request({method:"roots/list",params:e},nZ,r)}async sendLoggingMessage(e,r){if(this._capabilities.logging&&(!r||!this.isMessageIgnored(e.level,r)))return this.notification({method:"notifications/message",params:e})}async sendResourceUpdated(e){return this.notification({method:"notifications/resources/updated",params:e})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}};var PZ=ot(require("node:process"),1);var Vq=class{append(e){this._buffer=this._buffer?Buffer.concat([this._buffer,e]):e}readMessage(){if(!this._buffer)return null;let e=this._buffer.indexOf(`
|
|
1369
1369
|
`);if(e===-1)return null;let r=this._buffer.toString("utf8",0,e).replace(/\r$/,"");return this._buffer=this._buffer.subarray(e+1),Yer(r)}clear(){this._buffer=void 0}};function Yer(t){return eRe.parse(JSON.parse(t))}function pke(t){return JSON.stringify(t)+`
|
|
1370
|
-
`}var jq=class{constructor(e=PZ.default.stdin,r=PZ.default.stdout){this._stdin=e,this._stdout=r,this._readBuffer=new Vq,this._started=!1,this._ondata=n=>{this._readBuffer.append(n),this.processReadBuffer()},this._onerror=n=>{var i;(i=this.onerror)===null||i===void 0||i.call(this,n)}}async start(){if(this._started)throw new Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.");this._started=!0,this._stdin.on("data",this._ondata),this._stdin.on("error",this._onerror)}processReadBuffer(){for(var e,r;;)try{let n=this._readBuffer.readMessage();if(n===null)break;(e=this.onmessage)===null||e===void 0||e.call(this,n)}catch(n){(r=this.onerror)===null||r===void 0||r.call(this,n)}}async close(){var e;this._stdin.off("data",this._ondata),this._stdin.off("error",this._onerror),this._stdin.listenerCount("data")===0&&this._stdin.pause(),this._readBuffer.clear(),(e=this.onclose)===null||e===void 0||e.call(this)}send(e){return new Promise(r=>{let n=pke(e);this._stdout.write(n)?r():this._stdout.once("drain",r)})}};var dke="0.3.2";var cN={name:"@sap-ux/fiori-mcp-server",description:"SAP Fiori - Model Context Protocol (MCP) server",version:dke,keywords:["SAP Fiori tools","SAP Fiori elements","SAP Fiori freestyle","MCP","AI"],repository:{type:"git",url:"https://github.com/SAP/open-ux-tools.git",directory:"packages/fiori-mcp-server"},bugs:{url:"https://github.com/SAP/open-ux-tools/issues?q=is%3Aopen+is%3Aissue+label%3Abug+label%3Afiori-mcp-server"},license:"Apache-2.0",main:"dist/index.js",scripts:{"build-esbuild-base":"esbuild --bundle --platform=node --target=node20 --outdir=dist --external:vscode --external:@lancedb/lancedb --external:@xenova/transformers --external:@sap-ux/fiori-docs-embeddings --main-fields=module,main src/index.ts","build-dev":"pnpm run build-esbuild-base --sourcemap=inline","build-compile":"tsc --noEmit","build-bundle":"pnpm run build-esbuild-base --minify",build:"npm-run-all build-compile build-bundle",watch:"tsc --watch",bundle:"npm-run-all build tgz:package tgz:rename","tgz:package":"pnpm pack","tgz:rename":"node -e \"const fs=require('fs'), p=require('./package.json'), d=new Date().toISOString().split('T')[0], oldName=p.name.startsWith('@') ? `${p.name.replace('@', '').replace('/', '-')}-${p.version}.tgz` : `${p.name}-${p.version}.tgz`; fs.renameSync(oldName, `${oldName.replace('.tgz','')}-${d}.tgz`)\"",clean:"rimraf --glob dist test/test-output *.tsbuildinfo",format:"prettier --write '**/*.{js,json,ts,yaml,yml}' --ignore-path ../../.prettierignore",lint:"eslint . --ext .ts","lint:fix":"eslint . --ext .ts --fix",test:"jest --ci --forceExit --detectOpenHandles --colors",inspector:"npx @modelcontextprotocol/inspector node dist/index.js"},files:["LICENSE","dist","!dist/**/*.map"],bin:{"fiori-mcp":"./dist/index.js"},devDependencies:{"npm-run-all2":"8.0.4",esbuild:"0.25.6","@modelcontextprotocol/sdk":"1.17.5","@sap/ux-specification":"1.136.6","@sap-ux/project-access":"workspace:*","@sap-ux/fiori-annotation-api":"workspace:*","@sap-ux/annotation-converter":"0.10.3","@sap-ux/fiori-docs-embeddings":"workspace:*","@sap-ux/i18n":"workspace:*","@sap-ux/logger":"workspace:*","@sap-ux/odata-annotation-core-types":"workspace:*","@sap-ux/odata-entity-model":"workspace:*","@sap-ux/text-document-utils":"workspace:*","@types/json-schema":"7.0.5","@types/mem-fs":"1.1.2","@types/mem-fs-editor":"7.0.1","@sap-ux/btp-utils":"workspace:*","@sap-ux/feature-toggle":"workspace:*","@sap-ux/nodejs-utils":"workspace:*","@sap-ux/telemetry":"workspace:*",i18next:"25.3.0","os-name":"4.0.1",zod:"4.1.5"},dependencies:{"@sap-ux/fiori-docs-embeddings":"*","@xenova/transformers":"2.17.2","@lancedb/lancedb":"0.22.0","mem-fs":"2.1.0","mem-fs-editor":"9.4.0"},engines:{node:">=20.x"}};var Wer=Object.freeze({status:"aborted"});function he(t,e,r){function n(s,c){var u;Object.defineProperty(s,"_zod",{value:s._zod??{},enumerable:!1}),(u=s._zod).traits??(u.traits=new Set),s._zod.traits.add(t),e(s,c);for(let l in o.prototype)l in s||Object.defineProperty(s,l,{value:o.prototype[l].bind(s)});s._zod.constr=o,s._zod.def=c}let i=r?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:t});function o(s){var c;let u=r?.Parent?new a:this;n(u,s),(c=u._zod).deferred??(c.deferred=[]);for(let l of u._zod.deferred)l();return u}return Object.defineProperty(o,"init",{value:n}),Object.defineProperty(o,Symbol.hasInstance,{value:s=>r?.Parent&&s instanceof r.Parent?!0:s?._zod?.traits?.has(t)}),Object.defineProperty(o,"name",{value:t}),o}var Xer=Symbol("zod_brand"),Gd=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},bC=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}},qq={};function ul(t){return t&&Object.assign(qq,t),qq}var nn={};mo(nn,{BIGINT_FORMAT_RANGES:()=>yke,Class:()=>wZ,NUMBER_FORMAT_RANGES:()=>kZ,aborted:()=>$v,allowsEval:()=>IZ,assert:()=>ttr,assertEqual:()=>Jer,assertIs:()=>Zer,assertNever:()=>etr,assertNotEqual:()=>Qer,assignProp:()=>Lv,base64ToUint8Array:()=>bke,base64urlToUint8Array:()=>vtr,cached:()=>pN,captureStackTrace:()=>Hq,cleanEnum:()=>ytr,cleanRegex:()=>dN,clone:()=>ap,cloneDef:()=>ntr,createTransparentProxy:()=>utr,defineLazy:()=>Wn,esc:()=>Bq,escapeRegex:()=>pg,extend:()=>ftr,finalizeIssue:()=>Lf,floatSafeRemainder:()=>NZ,getElementAtPath:()=>itr,getEnumValues:()=>lN,getLengthableOrigin:()=>hN,getParsedType:()=>ctr,getSizableOrigin:()=>vke,hexToUint8Array:()=>Etr,isObject:()=>EC,isPlainObject:()=>Mv,issue:()=>TC,joinValues:()=>Uq,jsonStringifyReplacer:()=>_C,merge:()=>htr,mergeDefs:()=>kv,normalizeParams:()=>kt,nullish:()=>fN,numKeys:()=>str,objectClone:()=>rtr,omit:()=>ptr,optionalKeys:()=>LZ,partial:()=>mtr,pick:()=>ltr,prefixIssues:()=>fg,primitiveTypes:()=>gke,promiseAllObject:()=>atr,propertyKeyTypes:()=>RZ,randomString:()=>otr,required:()=>gtr,safeExtend:()=>dtr,shallowClone:()=>mke,stringifyPrimitive:()=>Gq,uint8ArrayToBase64:()=>Eke,uint8ArrayToBase64url:()=>btr,uint8ArrayToHex:()=>_tr,unwrapMessage:()=>uN});function Jer(t){return t}function Qer(t){return t}function Zer(t){}function etr(t){throw new Error}function ttr(t){}function lN(t){let e=Object.values(t).filter(n=>typeof n=="number");return Object.entries(t).filter(([n,i])=>e.indexOf(+n)===-1).map(([n,i])=>i)}function Uq(t,e="|"){return t.map(r=>Gq(r)).join(e)}function _C(t,e){return typeof e=="bigint"?e.toString():e}function pN(t){return{get value(){{let r=t();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function fN(t){return t==null}function dN(t){let e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}function NZ(t,e){let r=(t.toString().split(".")[1]||"").length,n=e.toString(),i=(n.split(".")[1]||"").length;if(i===0&&/\d?e-\d?/.test(n)){let c=n.match(/\d?e-(\d?)/);c?.[1]&&(i=Number.parseInt(c[1]))}let a=r>i?r:i,o=Number.parseInt(t.toFixed(a).replace(".","")),s=Number.parseInt(e.toFixed(a).replace(".",""));return o%s/10**a}var hke=Symbol("evaluating");function Wn(t,e,r){let n;Object.defineProperty(t,e,{get(){if(n!==hke)return n===void 0&&(n=hke,n=r()),n},set(i){Object.defineProperty(t,e,{value:i})},configurable:!0})}function rtr(t){return Object.create(Object.getPrototypeOf(t),Object.getOwnPropertyDescriptors(t))}function Lv(t,e,r){Object.defineProperty(t,e,{value:r,writable:!0,enumerable:!0,configurable:!0})}function kv(...t){let e={};for(let r of t){let n=Object.getOwnPropertyDescriptors(r);Object.assign(e,n)}return Object.defineProperties({},e)}function ntr(t){return kv(t._zod.def)}function itr(t,e){return e?e.reduce((r,n)=>r?.[n],t):t}function atr(t){let e=Object.keys(t),r=e.map(n=>t[n]);return Promise.all(r).then(n=>{let i={};for(let a=0;a<e.length;a++)i[e[a]]=n[a];return i})}function otr(t=10){let e="abcdefghijklmnopqrstuvwxyz",r="";for(let n=0;n<t;n++)r+=e[Math.floor(Math.random()*e.length)];return r}function Bq(t){return JSON.stringify(t)}var Hq="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function EC(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}var IZ=pN(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let t=Function;return new t(""),!0}catch{return!1}});function Mv(t){if(EC(t)===!1)return!1;let e=t.constructor;if(e===void 0)return!0;let r=e.prototype;return!(EC(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function mke(t){return Mv(t)?{...t}:t}function str(t){let e=0;for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&e++;return e}var ctr=t=>{let e=typeof t;switch(e){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(t)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(t)?"array":t===null?"null":t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?"promise":typeof Map<"u"&&t instanceof Map?"map":typeof Set<"u"&&t instanceof Set?"set":typeof Date<"u"&&t instanceof Date?"date":typeof File<"u"&&t instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${e}`)}},RZ=new Set(["string","number","symbol"]),gke=new Set(["string","number","bigint","boolean","symbol","undefined"]);function pg(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ap(t,e,r){let n=new t._zod.constr(e??t._zod.def);return(!e||r?.parent)&&(n._zod.parent=t),n}function kt(t){let e=t;if(!e)return{};if(typeof e=="string")return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:()=>e.error}:e}function utr(t){let e;return new Proxy({},{get(r,n,i){return e??(e=t()),Reflect.get(e,n,i)},set(r,n,i,a){return e??(e=t()),Reflect.set(e,n,i,a)},has(r,n){return e??(e=t()),Reflect.has(e,n)},deleteProperty(r,n){return e??(e=t()),Reflect.deleteProperty(e,n)},ownKeys(r){return e??(e=t()),Reflect.ownKeys(e)},getOwnPropertyDescriptor(r,n){return e??(e=t()),Reflect.getOwnPropertyDescriptor(e,n)},defineProperty(r,n,i){return e??(e=t()),Reflect.defineProperty(e,n,i)}})}function Gq(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}function LZ(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}var kZ={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]},yke={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function ltr(t,e){let r=t._zod.def,n=kv(t._zod.def,{get shape(){let i={};for(let a in e){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);e[a]&&(i[a]=r.shape[a])}return Lv(this,"shape",i),i},checks:[]});return ap(t,n)}function ptr(t,e){let r=t._zod.def,n=kv(t._zod.def,{get shape(){let i={...t._zod.def.shape};for(let a in e){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);e[a]&&delete i[a]}return Lv(this,"shape",i),i},checks:[]});return ap(t,n)}function ftr(t,e){if(!Mv(e))throw new Error("Invalid input to extend: expected a plain object");let r=t._zod.def.checks;if(r&&r.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");let i=kv(t._zod.def,{get shape(){let a={...t._zod.def.shape,...e};return Lv(this,"shape",a),a},checks:[]});return ap(t,i)}function dtr(t,e){if(!Mv(e))throw new Error("Invalid input to safeExtend: expected a plain object");let r={...t._zod.def,get shape(){let n={...t._zod.def.shape,...e};return Lv(this,"shape",n),n},checks:t._zod.def.checks};return ap(t,r)}function htr(t,e){let r=kv(t._zod.def,{get shape(){let n={...t._zod.def.shape,...e._zod.def.shape};return Lv(this,"shape",n),n},get catchall(){return e._zod.def.catchall},checks:[]});return ap(t,r)}function mtr(t,e,r){let n=kv(e._zod.def,{get shape(){let i=e._zod.def.shape,a={...i};if(r)for(let o in r){if(!(o in i))throw new Error(`Unrecognized key: "${o}"`);r[o]&&(a[o]=t?new t({type:"optional",innerType:i[o]}):i[o])}else for(let o in i)a[o]=t?new t({type:"optional",innerType:i[o]}):i[o];return Lv(this,"shape",a),a},checks:[]});return ap(e,n)}function gtr(t,e,r){let n=kv(e._zod.def,{get shape(){let i=e._zod.def.shape,a={...i};if(r)for(let o in r){if(!(o in a))throw new Error(`Unrecognized key: "${o}"`);r[o]&&(a[o]=new t({type:"nonoptional",innerType:i[o]}))}else for(let o in i)a[o]=new t({type:"nonoptional",innerType:i[o]});return Lv(this,"shape",a),a},checks:[]});return ap(e,n)}function $v(t,e=0){if(t.aborted===!0)return!0;for(let r=e;r<t.issues.length;r++)if(t.issues[r]?.continue!==!0)return!0;return!1}function fg(t,e){return e.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(t),r})}function uN(t){return typeof t=="string"?t:t?.message}function Lf(t,e,r){let n={...t,path:t.path??[]};if(!t.message){let i=uN(t.inst?._zod.def?.error?.(t))??uN(e?.error?.(t))??uN(r.customError?.(t))??uN(r.localeError?.(t))??"Invalid input";n.message=i}return delete n.inst,delete n.continue,e?.reportInput||delete n.input,n}function vke(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}function hN(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function TC(...t){let[e,r,n]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:n}:{...e}}function ytr(t){return Object.entries(t).filter(([e,r])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function bke(t){let e=atob(t),r=new Uint8Array(e.length);for(let n=0;n<e.length;n++)r[n]=e.charCodeAt(n);return r}function Eke(t){let e="";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return btoa(e)}function vtr(t){let e=t.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-e.length%4)%4);return bke(e+r)}function btr(t){return Eke(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Etr(t){let e=t.replace(/^0x/,"");if(e.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(e.length/2);for(let n=0;n<e.length;n+=2)r[n/2]=Number.parseInt(e.slice(n,n+2),16);return r}function _tr(t){return Array.from(t).map(e=>e.toString(16).padStart(2,"0")).join("")}var wZ=class{constructor(...e){}};var _ke=(t,e)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:!1}),Object.defineProperty(t,"issues",{value:e,enumerable:!1}),t.message=JSON.stringify(e,_C,2),Object.defineProperty(t,"toString",{value:()=>t.message,enumerable:!1})},zq=he("$ZodError",_ke),MZ=he("$ZodError",_ke,{Parent:Error});function $Z(t,e=r=>r.message){let r={},n=[];for(let i of t.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(e(i))):n.push(e(i));return{formErrors:n,fieldErrors:r}}function FZ(t,e){let r=e||function(a){return a.message},n={_errors:[]},i=a=>{for(let o of a.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(s=>i({issues:s}));else if(o.code==="invalid_key")i({issues:o.issues});else if(o.code==="invalid_element")i({issues:o.issues});else if(o.path.length===0)n._errors.push(r(o));else{let s=n,c=0;for(;c<o.path.length;){let u=o.path[c];c===o.path.length-1?(s[u]=s[u]||{_errors:[]},s[u]._errors.push(r(o))):s[u]=s[u]||{_errors:[]},s=s[u],c++}}};return i(t),n}var Kq=t=>(e,r,n,i)=>{let a=n?Object.assign(n,{async:!1}):{async:!1},o=e._zod.run({value:r,issues:[]},a);if(o instanceof Promise)throw new Gd;if(o.issues.length){let s=new(i?.Err??t)(o.issues.map(c=>Lf(c,a,ul())));throw Hq(s,i?.callee),s}return o.value};var Yq=t=>async(e,r,n,i)=>{let a=n?Object.assign(n,{async:!0}):{async:!0},o=e._zod.run({value:r,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let s=new(i?.Err??t)(o.issues.map(c=>Lf(c,a,ul())));throw Hq(s,i?.callee),s}return o.value};var mN=t=>(e,r,n)=>{let i=n?{...n,async:!1}:{async:!1},a=e._zod.run({value:r,issues:[]},i);if(a instanceof Promise)throw new Gd;return a.issues.length?{success:!1,error:new(t??zq)(a.issues.map(o=>Lf(o,i,ul())))}:{success:!0,data:a.value}},Tke=mN(MZ),gN=t=>async(e,r,n)=>{let i=n?Object.assign(n,{async:!0}):{async:!0},a=e._zod.run({value:r,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new t(a.issues.map(o=>Lf(o,i,ul())))}:{success:!0,data:a.value}},Oke=gN(MZ),Ske=t=>(e,r,n)=>{let i=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Kq(t)(e,r,i)};var Cke=t=>(e,r,n)=>Kq(t)(e,r,n);var Ake=t=>async(e,r,n)=>{let i=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Yq(t)(e,r,i)};var xke=t=>async(e,r,n)=>Yq(t)(e,r,n);var Pke=t=>(e,r,n)=>{let i=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return mN(t)(e,r,i)};var Dke=t=>(e,r,n)=>mN(t)(e,r,n);var wke=t=>async(e,r,n)=>{let i=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return gN(t)(e,r,i)};var Nke=t=>async(e,r,n)=>gN(t)(e,r,n);var Ike=/^[cC][^\s-]{8,}$/,Rke=/^[0-9a-z]+$/,Lke=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,kke=/^[0-9a-vA-V]{20}$/,Mke=/^[A-Za-z0-9]{27}$/,$ke=/^[a-zA-Z0-9_-]{21}$/,Fke=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var Vke=/^([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})$/,VZ=t=>t?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;var jke=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var Otr="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function qke(){return new RegExp(Otr,"u")}var Uke=/^(?:(?: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])$/,Bke=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,Hke=/^((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])$/,Gke=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,zke=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,jZ=/^[A-Za-z0-9_-]*$/,Kke=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/;var Yke=/^\+(?:[0-9]){6,14}[0-9]$/,Wke="(?:(?:\\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])))",Xke=new RegExp(`^${Wke}$`);function Jke(t){let e="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof t.precision=="number"?t.precision===-1?`${e}`:t.precision===0?`${e}:[0-5]\\d`:`${e}:[0-5]\\d\\.\\d{${t.precision}}`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Qke(t){return new RegExp(`^${Jke(t)}$`)}function Zke(t){let e=Jke({precision:t.precision}),r=["Z"];t.local&&r.push(""),t.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let n=`${e}(?:${r.join("|")})`;return new RegExp(`^${Wke}T(?:${n})$`)}var eMe=t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)};var tMe=/^\d+$/,rMe=/^-?\d+(?:\.\d+)?/i,nMe=/true|false/i;var iMe=/^[^A-Z]*$/,aMe=/^[^a-z]*$/;var ts=he("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])}),oMe={number:"number",bigint:"bigint",object:"date"},qZ=he("$ZodCheckLessThan",(t,e)=>{ts.init(t,e);let r=oMe[typeof e.value];t._zod.onattach.push(n=>{let i=n._zod.bag,a=(e.inclusive?i.maximum:i.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value<a&&(e.inclusive?i.maximum=e.value:i.exclusiveMaximum=e.value)}),t._zod.check=n=>{(e.inclusive?n.value<=e.value:n.value<e.value)||n.issues.push({origin:r,code:"too_big",maximum:e.value,input:n.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),UZ=he("$ZodCheckGreaterThan",(t,e)=>{ts.init(t,e);let r=oMe[typeof e.value];t._zod.onattach.push(n=>{let i=n._zod.bag,a=(e.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>a&&(e.inclusive?i.minimum=e.value:i.exclusiveMinimum=e.value)}),t._zod.check=n=>{(e.inclusive?n.value>=e.value:n.value>e.value)||n.issues.push({origin:r,code:"too_small",minimum:e.value,input:n.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),sMe=he("$ZodCheckMultipleOf",(t,e)=>{ts.init(t,e),t._zod.onattach.push(r=>{var n;(n=r._zod.bag).multipleOf??(n.multipleOf=e.value)}),t._zod.check=r=>{if(typeof r.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%e.value===BigInt(0):NZ(r.value,e.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:e.value,input:r.value,inst:t,continue:!e.abort})}}),cMe=he("$ZodCheckNumberFormat",(t,e)=>{ts.init(t,e),e.format=e.format||"float64";let r=e.format?.includes("int"),n=r?"int":"number",[i,a]=kZ[e.format];t._zod.onattach.push(o=>{let s=o._zod.bag;s.format=e.format,s.minimum=i,s.maximum=a,r&&(s.pattern=tMe)}),t._zod.check=o=>{let s=o.value;if(r){if(!Number.isInteger(s)){o.issues.push({expected:n,format:e.format,code:"invalid_type",continue:!1,input:s,inst:t});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:n,continue:!e.abort}):o.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:n,continue:!e.abort});return}}s<i&&o.issues.push({origin:"number",input:s,code:"too_small",minimum:i,inclusive:!0,inst:t,continue:!e.abort}),s>a&&o.issues.push({origin:"number",input:s,code:"too_big",maximum:a,inst:t})}});var uMe=he("$ZodCheckMaxLength",(t,e)=>{var r;ts.init(t,e),(r=t._zod.def).when??(r.when=n=>{let i=n.value;return!fN(i)&&i.length!==void 0}),t._zod.onattach.push(n=>{let i=n._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<i&&(n._zod.bag.maximum=e.maximum)}),t._zod.check=n=>{let i=n.value;if(i.length<=e.maximum)return;let o=hN(i);n.issues.push({origin:o,code:"too_big",maximum:e.maximum,inclusive:!0,input:i,inst:t,continue:!e.abort})}}),lMe=he("$ZodCheckMinLength",(t,e)=>{var r;ts.init(t,e),(r=t._zod.def).when??(r.when=n=>{let i=n.value;return!fN(i)&&i.length!==void 0}),t._zod.onattach.push(n=>{let i=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>i&&(n._zod.bag.minimum=e.minimum)}),t._zod.check=n=>{let i=n.value;if(i.length>=e.minimum)return;let o=hN(i);n.issues.push({origin:o,code:"too_small",minimum:e.minimum,inclusive:!0,input:i,inst:t,continue:!e.abort})}}),pMe=he("$ZodCheckLengthEquals",(t,e)=>{var r;ts.init(t,e),(r=t._zod.def).when??(r.when=n=>{let i=n.value;return!fN(i)&&i.length!==void 0}),t._zod.onattach.push(n=>{let i=n._zod.bag;i.minimum=e.length,i.maximum=e.length,i.length=e.length}),t._zod.check=n=>{let i=n.value,a=i.length;if(a===e.length)return;let o=hN(i),s=a>e.length;n.issues.push({origin:o,...s?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:n.value,inst:t,continue:!e.abort})}}),vN=he("$ZodCheckStringFormat",(t,e)=>{var r,n;ts.init(t,e),t._zod.onattach.push(i=>{let a=i._zod.bag;a.format=e.format,e.pattern&&(a.patterns??(a.patterns=new Set),a.patterns.add(e.pattern))}),e.pattern?(r=t._zod).check??(r.check=i=>{e.pattern.lastIndex=0,!e.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:e.format,input:i.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})}):(n=t._zod).check??(n.check=()=>{})}),fMe=he("$ZodCheckRegex",(t,e)=>{vN.init(t,e),t._zod.check=r=>{e.pattern.lastIndex=0,!e.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:e.pattern.toString(),inst:t,continue:!e.abort})}}),dMe=he("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=iMe),vN.init(t,e)}),hMe=he("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=aMe),vN.init(t,e)}),mMe=he("$ZodCheckIncludes",(t,e)=>{ts.init(t,e);let r=pg(e.includes),n=new RegExp(typeof e.position=="number"?`^.{${e.position}}${r}`:r);e.pattern=n,t._zod.onattach.push(i=>{let a=i._zod.bag;a.patterns??(a.patterns=new Set),a.patterns.add(n)}),t._zod.check=i=>{i.value.includes(e.includes,e.position)||i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:i.value,inst:t,continue:!e.abort})}}),gMe=he("$ZodCheckStartsWith",(t,e)=>{ts.init(t,e);let r=new RegExp(`^${pg(e.prefix)}.*`);e.pattern??(e.pattern=r),t._zod.onattach.push(n=>{let i=n._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(r)}),t._zod.check=n=>{n.value.startsWith(e.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:n.value,inst:t,continue:!e.abort})}}),yMe=he("$ZodCheckEndsWith",(t,e)=>{ts.init(t,e);let r=new RegExp(`.*${pg(e.suffix)}$`);e.pattern??(e.pattern=r),t._zod.onattach.push(n=>{let i=n._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(r)}),t._zod.check=n=>{n.value.endsWith(e.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:n.value,inst:t,continue:!e.abort})}});var vMe=he("$ZodCheckOverwrite",(t,e)=>{ts.init(t,e),t._zod.check=r=>{r.value=e.tx(r.value)}});var Wq=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let n=e.split(`
|
|
1370
|
+
`}var jq=class{constructor(e=PZ.default.stdin,r=PZ.default.stdout){this._stdin=e,this._stdout=r,this._readBuffer=new Vq,this._started=!1,this._ondata=n=>{this._readBuffer.append(n),this.processReadBuffer()},this._onerror=n=>{var i;(i=this.onerror)===null||i===void 0||i.call(this,n)}}async start(){if(this._started)throw new Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.");this._started=!0,this._stdin.on("data",this._ondata),this._stdin.on("error",this._onerror)}processReadBuffer(){for(var e,r;;)try{let n=this._readBuffer.readMessage();if(n===null)break;(e=this.onmessage)===null||e===void 0||e.call(this,n)}catch(n){(r=this.onerror)===null||r===void 0||r.call(this,n)}}async close(){var e;this._stdin.off("data",this._ondata),this._stdin.off("error",this._onerror),this._stdin.listenerCount("data")===0&&this._stdin.pause(),this._readBuffer.clear(),(e=this.onclose)===null||e===void 0||e.call(this)}send(e){return new Promise(r=>{let n=pke(e);this._stdout.write(n)?r():this._stdout.once("drain",r)})}};var dke="0.3.3";var cN={name:"@sap-ux/fiori-mcp-server",description:"SAP Fiori - Model Context Protocol (MCP) server",version:dke,keywords:["SAP Fiori tools","SAP Fiori elements","SAP Fiori freestyle","MCP","AI"],repository:{type:"git",url:"https://github.com/SAP/open-ux-tools.git",directory:"packages/fiori-mcp-server"},bugs:{url:"https://github.com/SAP/open-ux-tools/issues?q=is%3Aopen+is%3Aissue+label%3Abug+label%3Afiori-mcp-server"},license:"Apache-2.0",main:"dist/index.js",scripts:{"build-esbuild-base":"esbuild --bundle --platform=node --target=node20 --outdir=dist --external:vscode --external:@lancedb/lancedb --external:@xenova/transformers --external:@sap-ux/fiori-docs-embeddings --main-fields=module,main src/index.ts","build-dev":"pnpm run build-esbuild-base --sourcemap=inline","build-compile":"tsc --noEmit","build-bundle":"pnpm run build-esbuild-base --minify",build:"npm-run-all build-compile build-bundle",watch:"tsc --watch",bundle:"npm-run-all build tgz:package tgz:rename","tgz:package":"pnpm pack","tgz:rename":"node -e \"const fs=require('fs'), p=require('./package.json'), d=new Date().toISOString().split('T')[0], oldName=p.name.startsWith('@') ? `${p.name.replace('@', '').replace('/', '-')}-${p.version}.tgz` : `${p.name}-${p.version}.tgz`; fs.renameSync(oldName, `${oldName.replace('.tgz','')}-${d}.tgz`)\"",clean:"rimraf --glob dist test/test-output *.tsbuildinfo",format:"prettier --write '**/*.{js,json,ts,yaml,yml}' --ignore-path ../../.prettierignore",lint:"eslint . --ext .ts","lint:fix":"eslint . --ext .ts --fix",test:"jest --ci --forceExit --detectOpenHandles --colors",inspector:"npx @modelcontextprotocol/inspector node dist/index.js"},files:["LICENSE","dist","!dist/**/*.map"],bin:{"fiori-mcp":"./dist/index.js"},devDependencies:{"npm-run-all2":"8.0.4",esbuild:"0.25.6","@modelcontextprotocol/sdk":"1.17.5","@sap/ux-specification":"1.136.6","@sap-ux/project-access":"workspace:*","@sap-ux/fiori-annotation-api":"workspace:*","@sap-ux/annotation-converter":"0.10.3","@sap-ux/fiori-docs-embeddings":"workspace:*","@sap-ux/i18n":"workspace:*","@sap-ux/logger":"workspace:*","@sap-ux/odata-annotation-core-types":"workspace:*","@sap-ux/odata-entity-model":"workspace:*","@sap-ux/text-document-utils":"workspace:*","@types/json-schema":"7.0.5","@types/mem-fs":"1.1.2","@types/mem-fs-editor":"7.0.1","@sap-ux/btp-utils":"workspace:*","@sap-ux/feature-toggle":"workspace:*","@sap-ux/nodejs-utils":"workspace:*","@sap-ux/telemetry":"workspace:*",i18next:"25.3.0","os-name":"4.0.1",zod:"4.1.5"},dependencies:{"@sap-ux/fiori-docs-embeddings":"*","@xenova/transformers":"2.17.2","@lancedb/lancedb":"0.22.0","mem-fs":"2.1.0","mem-fs-editor":"9.4.0"},engines:{node:">=20.x"}};var Wer=Object.freeze({status:"aborted"});function he(t,e,r){function n(s,c){var u;Object.defineProperty(s,"_zod",{value:s._zod??{},enumerable:!1}),(u=s._zod).traits??(u.traits=new Set),s._zod.traits.add(t),e(s,c);for(let l in o.prototype)l in s||Object.defineProperty(s,l,{value:o.prototype[l].bind(s)});s._zod.constr=o,s._zod.def=c}let i=r?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:t});function o(s){var c;let u=r?.Parent?new a:this;n(u,s),(c=u._zod).deferred??(c.deferred=[]);for(let l of u._zod.deferred)l();return u}return Object.defineProperty(o,"init",{value:n}),Object.defineProperty(o,Symbol.hasInstance,{value:s=>r?.Parent&&s instanceof r.Parent?!0:s?._zod?.traits?.has(t)}),Object.defineProperty(o,"name",{value:t}),o}var Xer=Symbol("zod_brand"),Gd=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},bC=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}},qq={};function ul(t){return t&&Object.assign(qq,t),qq}var nn={};mo(nn,{BIGINT_FORMAT_RANGES:()=>yke,Class:()=>wZ,NUMBER_FORMAT_RANGES:()=>kZ,aborted:()=>$v,allowsEval:()=>IZ,assert:()=>ttr,assertEqual:()=>Jer,assertIs:()=>Zer,assertNever:()=>etr,assertNotEqual:()=>Qer,assignProp:()=>Lv,base64ToUint8Array:()=>bke,base64urlToUint8Array:()=>vtr,cached:()=>pN,captureStackTrace:()=>Hq,cleanEnum:()=>ytr,cleanRegex:()=>dN,clone:()=>ap,cloneDef:()=>ntr,createTransparentProxy:()=>utr,defineLazy:()=>Wn,esc:()=>Bq,escapeRegex:()=>pg,extend:()=>ftr,finalizeIssue:()=>Lf,floatSafeRemainder:()=>NZ,getElementAtPath:()=>itr,getEnumValues:()=>lN,getLengthableOrigin:()=>hN,getParsedType:()=>ctr,getSizableOrigin:()=>vke,hexToUint8Array:()=>Etr,isObject:()=>EC,isPlainObject:()=>Mv,issue:()=>TC,joinValues:()=>Uq,jsonStringifyReplacer:()=>_C,merge:()=>htr,mergeDefs:()=>kv,normalizeParams:()=>kt,nullish:()=>fN,numKeys:()=>str,objectClone:()=>rtr,omit:()=>ptr,optionalKeys:()=>LZ,partial:()=>mtr,pick:()=>ltr,prefixIssues:()=>fg,primitiveTypes:()=>gke,promiseAllObject:()=>atr,propertyKeyTypes:()=>RZ,randomString:()=>otr,required:()=>gtr,safeExtend:()=>dtr,shallowClone:()=>mke,stringifyPrimitive:()=>Gq,uint8ArrayToBase64:()=>Eke,uint8ArrayToBase64url:()=>btr,uint8ArrayToHex:()=>_tr,unwrapMessage:()=>uN});function Jer(t){return t}function Qer(t){return t}function Zer(t){}function etr(t){throw new Error}function ttr(t){}function lN(t){let e=Object.values(t).filter(n=>typeof n=="number");return Object.entries(t).filter(([n,i])=>e.indexOf(+n)===-1).map(([n,i])=>i)}function Uq(t,e="|"){return t.map(r=>Gq(r)).join(e)}function _C(t,e){return typeof e=="bigint"?e.toString():e}function pN(t){return{get value(){{let r=t();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function fN(t){return t==null}function dN(t){let e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}function NZ(t,e){let r=(t.toString().split(".")[1]||"").length,n=e.toString(),i=(n.split(".")[1]||"").length;if(i===0&&/\d?e-\d?/.test(n)){let c=n.match(/\d?e-(\d?)/);c?.[1]&&(i=Number.parseInt(c[1]))}let a=r>i?r:i,o=Number.parseInt(t.toFixed(a).replace(".","")),s=Number.parseInt(e.toFixed(a).replace(".",""));return o%s/10**a}var hke=Symbol("evaluating");function Wn(t,e,r){let n;Object.defineProperty(t,e,{get(){if(n!==hke)return n===void 0&&(n=hke,n=r()),n},set(i){Object.defineProperty(t,e,{value:i})},configurable:!0})}function rtr(t){return Object.create(Object.getPrototypeOf(t),Object.getOwnPropertyDescriptors(t))}function Lv(t,e,r){Object.defineProperty(t,e,{value:r,writable:!0,enumerable:!0,configurable:!0})}function kv(...t){let e={};for(let r of t){let n=Object.getOwnPropertyDescriptors(r);Object.assign(e,n)}return Object.defineProperties({},e)}function ntr(t){return kv(t._zod.def)}function itr(t,e){return e?e.reduce((r,n)=>r?.[n],t):t}function atr(t){let e=Object.keys(t),r=e.map(n=>t[n]);return Promise.all(r).then(n=>{let i={};for(let a=0;a<e.length;a++)i[e[a]]=n[a];return i})}function otr(t=10){let e="abcdefghijklmnopqrstuvwxyz",r="";for(let n=0;n<t;n++)r+=e[Math.floor(Math.random()*e.length)];return r}function Bq(t){return JSON.stringify(t)}var Hq="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function EC(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}var IZ=pN(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let t=Function;return new t(""),!0}catch{return!1}});function Mv(t){if(EC(t)===!1)return!1;let e=t.constructor;if(e===void 0)return!0;let r=e.prototype;return!(EC(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function mke(t){return Mv(t)?{...t}:t}function str(t){let e=0;for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&e++;return e}var ctr=t=>{let e=typeof t;switch(e){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(t)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(t)?"array":t===null?"null":t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?"promise":typeof Map<"u"&&t instanceof Map?"map":typeof Set<"u"&&t instanceof Set?"set":typeof Date<"u"&&t instanceof Date?"date":typeof File<"u"&&t instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${e}`)}},RZ=new Set(["string","number","symbol"]),gke=new Set(["string","number","bigint","boolean","symbol","undefined"]);function pg(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ap(t,e,r){let n=new t._zod.constr(e??t._zod.def);return(!e||r?.parent)&&(n._zod.parent=t),n}function kt(t){let e=t;if(!e)return{};if(typeof e=="string")return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:()=>e.error}:e}function utr(t){let e;return new Proxy({},{get(r,n,i){return e??(e=t()),Reflect.get(e,n,i)},set(r,n,i,a){return e??(e=t()),Reflect.set(e,n,i,a)},has(r,n){return e??(e=t()),Reflect.has(e,n)},deleteProperty(r,n){return e??(e=t()),Reflect.deleteProperty(e,n)},ownKeys(r){return e??(e=t()),Reflect.ownKeys(e)},getOwnPropertyDescriptor(r,n){return e??(e=t()),Reflect.getOwnPropertyDescriptor(e,n)},defineProperty(r,n,i){return e??(e=t()),Reflect.defineProperty(e,n,i)}})}function Gq(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}function LZ(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}var kZ={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]},yke={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function ltr(t,e){let r=t._zod.def,n=kv(t._zod.def,{get shape(){let i={};for(let a in e){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);e[a]&&(i[a]=r.shape[a])}return Lv(this,"shape",i),i},checks:[]});return ap(t,n)}function ptr(t,e){let r=t._zod.def,n=kv(t._zod.def,{get shape(){let i={...t._zod.def.shape};for(let a in e){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);e[a]&&delete i[a]}return Lv(this,"shape",i),i},checks:[]});return ap(t,n)}function ftr(t,e){if(!Mv(e))throw new Error("Invalid input to extend: expected a plain object");let r=t._zod.def.checks;if(r&&r.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");let i=kv(t._zod.def,{get shape(){let a={...t._zod.def.shape,...e};return Lv(this,"shape",a),a},checks:[]});return ap(t,i)}function dtr(t,e){if(!Mv(e))throw new Error("Invalid input to safeExtend: expected a plain object");let r={...t._zod.def,get shape(){let n={...t._zod.def.shape,...e};return Lv(this,"shape",n),n},checks:t._zod.def.checks};return ap(t,r)}function htr(t,e){let r=kv(t._zod.def,{get shape(){let n={...t._zod.def.shape,...e._zod.def.shape};return Lv(this,"shape",n),n},get catchall(){return e._zod.def.catchall},checks:[]});return ap(t,r)}function mtr(t,e,r){let n=kv(e._zod.def,{get shape(){let i=e._zod.def.shape,a={...i};if(r)for(let o in r){if(!(o in i))throw new Error(`Unrecognized key: "${o}"`);r[o]&&(a[o]=t?new t({type:"optional",innerType:i[o]}):i[o])}else for(let o in i)a[o]=t?new t({type:"optional",innerType:i[o]}):i[o];return Lv(this,"shape",a),a},checks:[]});return ap(e,n)}function gtr(t,e,r){let n=kv(e._zod.def,{get shape(){let i=e._zod.def.shape,a={...i};if(r)for(let o in r){if(!(o in a))throw new Error(`Unrecognized key: "${o}"`);r[o]&&(a[o]=new t({type:"nonoptional",innerType:i[o]}))}else for(let o in i)a[o]=new t({type:"nonoptional",innerType:i[o]});return Lv(this,"shape",a),a},checks:[]});return ap(e,n)}function $v(t,e=0){if(t.aborted===!0)return!0;for(let r=e;r<t.issues.length;r++)if(t.issues[r]?.continue!==!0)return!0;return!1}function fg(t,e){return e.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(t),r})}function uN(t){return typeof t=="string"?t:t?.message}function Lf(t,e,r){let n={...t,path:t.path??[]};if(!t.message){let i=uN(t.inst?._zod.def?.error?.(t))??uN(e?.error?.(t))??uN(r.customError?.(t))??uN(r.localeError?.(t))??"Invalid input";n.message=i}return delete n.inst,delete n.continue,e?.reportInput||delete n.input,n}function vke(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}function hN(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function TC(...t){let[e,r,n]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:n}:{...e}}function ytr(t){return Object.entries(t).filter(([e,r])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function bke(t){let e=atob(t),r=new Uint8Array(e.length);for(let n=0;n<e.length;n++)r[n]=e.charCodeAt(n);return r}function Eke(t){let e="";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return btoa(e)}function vtr(t){let e=t.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-e.length%4)%4);return bke(e+r)}function btr(t){return Eke(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Etr(t){let e=t.replace(/^0x/,"");if(e.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(e.length/2);for(let n=0;n<e.length;n+=2)r[n/2]=Number.parseInt(e.slice(n,n+2),16);return r}function _tr(t){return Array.from(t).map(e=>e.toString(16).padStart(2,"0")).join("")}var wZ=class{constructor(...e){}};var _ke=(t,e)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:!1}),Object.defineProperty(t,"issues",{value:e,enumerable:!1}),t.message=JSON.stringify(e,_C,2),Object.defineProperty(t,"toString",{value:()=>t.message,enumerable:!1})},zq=he("$ZodError",_ke),MZ=he("$ZodError",_ke,{Parent:Error});function $Z(t,e=r=>r.message){let r={},n=[];for(let i of t.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(e(i))):n.push(e(i));return{formErrors:n,fieldErrors:r}}function FZ(t,e){let r=e||function(a){return a.message},n={_errors:[]},i=a=>{for(let o of a.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(s=>i({issues:s}));else if(o.code==="invalid_key")i({issues:o.issues});else if(o.code==="invalid_element")i({issues:o.issues});else if(o.path.length===0)n._errors.push(r(o));else{let s=n,c=0;for(;c<o.path.length;){let u=o.path[c];c===o.path.length-1?(s[u]=s[u]||{_errors:[]},s[u]._errors.push(r(o))):s[u]=s[u]||{_errors:[]},s=s[u],c++}}};return i(t),n}var Kq=t=>(e,r,n,i)=>{let a=n?Object.assign(n,{async:!1}):{async:!1},o=e._zod.run({value:r,issues:[]},a);if(o instanceof Promise)throw new Gd;if(o.issues.length){let s=new(i?.Err??t)(o.issues.map(c=>Lf(c,a,ul())));throw Hq(s,i?.callee),s}return o.value};var Yq=t=>async(e,r,n,i)=>{let a=n?Object.assign(n,{async:!0}):{async:!0},o=e._zod.run({value:r,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let s=new(i?.Err??t)(o.issues.map(c=>Lf(c,a,ul())));throw Hq(s,i?.callee),s}return o.value};var mN=t=>(e,r,n)=>{let i=n?{...n,async:!1}:{async:!1},a=e._zod.run({value:r,issues:[]},i);if(a instanceof Promise)throw new Gd;return a.issues.length?{success:!1,error:new(t??zq)(a.issues.map(o=>Lf(o,i,ul())))}:{success:!0,data:a.value}},Tke=mN(MZ),gN=t=>async(e,r,n)=>{let i=n?Object.assign(n,{async:!0}):{async:!0},a=e._zod.run({value:r,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new t(a.issues.map(o=>Lf(o,i,ul())))}:{success:!0,data:a.value}},Oke=gN(MZ),Ske=t=>(e,r,n)=>{let i=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Kq(t)(e,r,i)};var Cke=t=>(e,r,n)=>Kq(t)(e,r,n);var Ake=t=>async(e,r,n)=>{let i=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Yq(t)(e,r,i)};var xke=t=>async(e,r,n)=>Yq(t)(e,r,n);var Pke=t=>(e,r,n)=>{let i=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return mN(t)(e,r,i)};var Dke=t=>(e,r,n)=>mN(t)(e,r,n);var wke=t=>async(e,r,n)=>{let i=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return gN(t)(e,r,i)};var Nke=t=>async(e,r,n)=>gN(t)(e,r,n);var Ike=/^[cC][^\s-]{8,}$/,Rke=/^[0-9a-z]+$/,Lke=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,kke=/^[0-9a-vA-V]{20}$/,Mke=/^[A-Za-z0-9]{27}$/,$ke=/^[a-zA-Z0-9_-]{21}$/,Fke=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var Vke=/^([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})$/,VZ=t=>t?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;var jke=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var Otr="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function qke(){return new RegExp(Otr,"u")}var Uke=/^(?:(?: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])$/,Bke=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,Hke=/^((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])$/,Gke=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,zke=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,jZ=/^[A-Za-z0-9_-]*$/,Kke=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/;var Yke=/^\+(?:[0-9]){6,14}[0-9]$/,Wke="(?:(?:\\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])))",Xke=new RegExp(`^${Wke}$`);function Jke(t){let e="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof t.precision=="number"?t.precision===-1?`${e}`:t.precision===0?`${e}:[0-5]\\d`:`${e}:[0-5]\\d\\.\\d{${t.precision}}`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Qke(t){return new RegExp(`^${Jke(t)}$`)}function Zke(t){let e=Jke({precision:t.precision}),r=["Z"];t.local&&r.push(""),t.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let n=`${e}(?:${r.join("|")})`;return new RegExp(`^${Wke}T(?:${n})$`)}var eMe=t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)};var tMe=/^\d+$/,rMe=/^-?\d+(?:\.\d+)?/i,nMe=/true|false/i;var iMe=/^[^A-Z]*$/,aMe=/^[^a-z]*$/;var ts=he("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])}),oMe={number:"number",bigint:"bigint",object:"date"},qZ=he("$ZodCheckLessThan",(t,e)=>{ts.init(t,e);let r=oMe[typeof e.value];t._zod.onattach.push(n=>{let i=n._zod.bag,a=(e.inclusive?i.maximum:i.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value<a&&(e.inclusive?i.maximum=e.value:i.exclusiveMaximum=e.value)}),t._zod.check=n=>{(e.inclusive?n.value<=e.value:n.value<e.value)||n.issues.push({origin:r,code:"too_big",maximum:e.value,input:n.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),UZ=he("$ZodCheckGreaterThan",(t,e)=>{ts.init(t,e);let r=oMe[typeof e.value];t._zod.onattach.push(n=>{let i=n._zod.bag,a=(e.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>a&&(e.inclusive?i.minimum=e.value:i.exclusiveMinimum=e.value)}),t._zod.check=n=>{(e.inclusive?n.value>=e.value:n.value>e.value)||n.issues.push({origin:r,code:"too_small",minimum:e.value,input:n.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),sMe=he("$ZodCheckMultipleOf",(t,e)=>{ts.init(t,e),t._zod.onattach.push(r=>{var n;(n=r._zod.bag).multipleOf??(n.multipleOf=e.value)}),t._zod.check=r=>{if(typeof r.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%e.value===BigInt(0):NZ(r.value,e.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:e.value,input:r.value,inst:t,continue:!e.abort})}}),cMe=he("$ZodCheckNumberFormat",(t,e)=>{ts.init(t,e),e.format=e.format||"float64";let r=e.format?.includes("int"),n=r?"int":"number",[i,a]=kZ[e.format];t._zod.onattach.push(o=>{let s=o._zod.bag;s.format=e.format,s.minimum=i,s.maximum=a,r&&(s.pattern=tMe)}),t._zod.check=o=>{let s=o.value;if(r){if(!Number.isInteger(s)){o.issues.push({expected:n,format:e.format,code:"invalid_type",continue:!1,input:s,inst:t});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:n,continue:!e.abort}):o.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:n,continue:!e.abort});return}}s<i&&o.issues.push({origin:"number",input:s,code:"too_small",minimum:i,inclusive:!0,inst:t,continue:!e.abort}),s>a&&o.issues.push({origin:"number",input:s,code:"too_big",maximum:a,inst:t})}});var uMe=he("$ZodCheckMaxLength",(t,e)=>{var r;ts.init(t,e),(r=t._zod.def).when??(r.when=n=>{let i=n.value;return!fN(i)&&i.length!==void 0}),t._zod.onattach.push(n=>{let i=n._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<i&&(n._zod.bag.maximum=e.maximum)}),t._zod.check=n=>{let i=n.value;if(i.length<=e.maximum)return;let o=hN(i);n.issues.push({origin:o,code:"too_big",maximum:e.maximum,inclusive:!0,input:i,inst:t,continue:!e.abort})}}),lMe=he("$ZodCheckMinLength",(t,e)=>{var r;ts.init(t,e),(r=t._zod.def).when??(r.when=n=>{let i=n.value;return!fN(i)&&i.length!==void 0}),t._zod.onattach.push(n=>{let i=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>i&&(n._zod.bag.minimum=e.minimum)}),t._zod.check=n=>{let i=n.value;if(i.length>=e.minimum)return;let o=hN(i);n.issues.push({origin:o,code:"too_small",minimum:e.minimum,inclusive:!0,input:i,inst:t,continue:!e.abort})}}),pMe=he("$ZodCheckLengthEquals",(t,e)=>{var r;ts.init(t,e),(r=t._zod.def).when??(r.when=n=>{let i=n.value;return!fN(i)&&i.length!==void 0}),t._zod.onattach.push(n=>{let i=n._zod.bag;i.minimum=e.length,i.maximum=e.length,i.length=e.length}),t._zod.check=n=>{let i=n.value,a=i.length;if(a===e.length)return;let o=hN(i),s=a>e.length;n.issues.push({origin:o,...s?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:n.value,inst:t,continue:!e.abort})}}),vN=he("$ZodCheckStringFormat",(t,e)=>{var r,n;ts.init(t,e),t._zod.onattach.push(i=>{let a=i._zod.bag;a.format=e.format,e.pattern&&(a.patterns??(a.patterns=new Set),a.patterns.add(e.pattern))}),e.pattern?(r=t._zod).check??(r.check=i=>{e.pattern.lastIndex=0,!e.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:e.format,input:i.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})}):(n=t._zod).check??(n.check=()=>{})}),fMe=he("$ZodCheckRegex",(t,e)=>{vN.init(t,e),t._zod.check=r=>{e.pattern.lastIndex=0,!e.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:e.pattern.toString(),inst:t,continue:!e.abort})}}),dMe=he("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=iMe),vN.init(t,e)}),hMe=he("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=aMe),vN.init(t,e)}),mMe=he("$ZodCheckIncludes",(t,e)=>{ts.init(t,e);let r=pg(e.includes),n=new RegExp(typeof e.position=="number"?`^.{${e.position}}${r}`:r);e.pattern=n,t._zod.onattach.push(i=>{let a=i._zod.bag;a.patterns??(a.patterns=new Set),a.patterns.add(n)}),t._zod.check=i=>{i.value.includes(e.includes,e.position)||i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:i.value,inst:t,continue:!e.abort})}}),gMe=he("$ZodCheckStartsWith",(t,e)=>{ts.init(t,e);let r=new RegExp(`^${pg(e.prefix)}.*`);e.pattern??(e.pattern=r),t._zod.onattach.push(n=>{let i=n._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(r)}),t._zod.check=n=>{n.value.startsWith(e.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:n.value,inst:t,continue:!e.abort})}}),yMe=he("$ZodCheckEndsWith",(t,e)=>{ts.init(t,e);let r=new RegExp(`.*${pg(e.suffix)}$`);e.pattern??(e.pattern=r),t._zod.onattach.push(n=>{let i=n._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(r)}),t._zod.check=n=>{n.value.endsWith(e.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:n.value,inst:t,continue:!e.abort})}});var vMe=he("$ZodCheckOverwrite",(t,e)=>{ts.init(t,e),t._zod.check=r=>{r.value=e.tx(r.value)}});var Wq=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let n=e.split(`
|
|
1371
1371
|
`).filter(o=>o),i=Math.min(...n.map(o=>o.length-o.trimStart().length)),a=n.map(o=>o.slice(i)).map(o=>" ".repeat(this.indent*2)+o);for(let o of a)this.content.push(o)}compile(){let e=Function,r=this?.args,i=[...(this?.content??[""]).map(a=>` ${a}`)];return new e(...r,i.join(`
|
|
1372
1372
|
`))}};var EMe={major:4,minor:1,patch:5};var yi=he("$ZodType",(t,e)=>{var r;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=EMe;let n=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&n.unshift(t);for(let i of n)for(let a of i._zod.onattach)a(t);if(n.length===0)(r=t._zod).deferred??(r.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{let i=(o,s,c)=>{let u=$v(o),l;for(let p of s){if(p._zod.def.when){if(!p._zod.def.when(o))continue}else if(u)continue;let h=o.issues.length,f=p._zod.check(o);if(f instanceof Promise&&c?.async===!1)throw new Gd;if(l||f instanceof Promise)l=(l??Promise.resolve()).then(async()=>{await f,o.issues.length!==h&&(u||(u=$v(o,h)))});else{if(o.issues.length===h)continue;u||(u=$v(o,h))}}return l?l.then(()=>o):o},a=(o,s,c)=>{if($v(o))return o.aborted=!0,o;let u=i(s,n,c);if(u instanceof Promise){if(c.async===!1)throw new Gd;return u.then(l=>t._zod.parse(l,c))}return t._zod.parse(u,c)};t._zod.run=(o,s)=>{if(s.skipChecks)return t._zod.parse(o,s);if(s.direction==="backward"){let u=t._zod.parse({value:o.value,issues:[]},{...s,skipChecks:!0});return u instanceof Promise?u.then(l=>a(l,o,s)):a(u,o,s)}let c=t._zod.parse(o,s);if(c instanceof Promise){if(s.async===!1)throw new Gd;return c.then(u=>i(u,n,s))}return i(c,n,s)}}t["~standard"]={validate:i=>{try{let a=Tke(t,i);return a.success?{value:a.data}:{issues:a.error?.issues}}catch{return Oke(t,i).then(o=>o.success?{value:o.data}:{issues:o.error?.issues})}},vendor:"zod",version:1}}),Qq=he("$ZodString",(t,e)=>{yi.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??eMe(t._zod.bag),t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:t}),r}}),vi=he("$ZodStringFormat",(t,e)=>{vN.init(t,e),Qq.init(t,e)}),DMe=he("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=Vke),vi.init(t,e)}),wMe=he("$ZodUUID",(t,e)=>{if(e.version){let n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(n===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=VZ(n))}else e.pattern??(e.pattern=VZ());vi.init(t,e)}),NMe=he("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=jke),vi.init(t,e)}),IMe=he("$ZodURL",(t,e)=>{vi.init(t,e),t._zod.check=r=>{try{let n=r.value.trim(),i=new URL(n);e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(i.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:Kke.source,input:r.value,inst:t,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:r.value,inst:t,continue:!e.abort})),e.normalize?r.value=i.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:t,continue:!e.abort})}}}),RMe=he("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=qke()),vi.init(t,e)}),LMe=he("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=$ke),vi.init(t,e)}),kMe=he("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=Ike),vi.init(t,e)}),MMe=he("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=Rke),vi.init(t,e)}),$Me=he("$ZodULID",(t,e)=>{e.pattern??(e.pattern=Lke),vi.init(t,e)}),FMe=he("$ZodXID",(t,e)=>{e.pattern??(e.pattern=kke),vi.init(t,e)}),VMe=he("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=Mke),vi.init(t,e)}),jMe=he("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=Zke(e)),vi.init(t,e)}),qMe=he("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=Xke),vi.init(t,e)}),UMe=he("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=Qke(e)),vi.init(t,e)}),BMe=he("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=Fke),vi.init(t,e)}),HMe=he("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=Uke),vi.init(t,e),t._zod.onattach.push(r=>{let n=r._zod.bag;n.format="ipv4"})}),GMe=he("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=Bke),vi.init(t,e),t._zod.onattach.push(r=>{let n=r._zod.bag;n.format="ipv6"}),t._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:t,continue:!e.abort})}}}),zMe=he("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=Hke),vi.init(t,e)}),KMe=he("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=Gke),vi.init(t,e),t._zod.check=r=>{let[n,i]=r.value.split("/");try{if(!i)throw new Error;let a=Number(i);if(`${a}`!==i)throw new Error;if(a<0||a>128)throw new Error;new URL(`http://[${n}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:t,continue:!e.abort})}}});function YMe(t){if(t==="")return!0;if(t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}var WMe=he("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=zke),vi.init(t,e),t._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64"}),t._zod.check=r=>{YMe(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:t,continue:!e.abort})}});function Str(t){if(!jZ.test(t))return!1;let e=t.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=e.padEnd(Math.ceil(e.length/4)*4,"=");return YMe(r)}var XMe=he("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=jZ),vi.init(t,e),t._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64url"}),t._zod.check=r=>{Str(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:t,continue:!e.abort})}}),JMe=he("$ZodE164",(t,e)=>{e.pattern??(e.pattern=Yke),vi.init(t,e)});function Ctr(t,e=null){try{let r=t.split(".");if(r.length!==3)return!1;let[n]=r;if(!n)return!1;let i=JSON.parse(atob(n));return!("typ"in i&&i?.typ!=="JWT"||!i.alg||e&&(!("alg"in i)||i.alg!==e))}catch{return!1}}var QMe=he("$ZodJWT",(t,e)=>{vi.init(t,e),t._zod.check=r=>{Ctr(r.value,e.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:t,continue:!e.abort})}});var HZ=he("$ZodNumber",(t,e)=>{yi.init(t,e),t._zod.pattern=t._zod.bag.pattern??rMe,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=Number(r.value)}catch{}let i=r.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return r;let a=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:i,inst:t,...a?{received:a}:{}}),r}}),ZMe=he("$ZodNumber",(t,e)=>{cMe.init(t,e),HZ.init(t,e)}),e$e=he("$ZodBoolean",(t,e)=>{yi.init(t,e),t._zod.pattern=nMe,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=!!r.value}catch{}let i=r.value;return typeof i=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:t}),r}});var t$e=he("$ZodAny",(t,e)=>{yi.init(t,e),t._zod.parse=r=>r}),r$e=he("$ZodUnknown",(t,e)=>{yi.init(t,e),t._zod.parse=r=>r}),n$e=he("$ZodNever",(t,e)=>{yi.init(t,e),t._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:t}),r)});function _Me(t,e,r){t.issues.length&&e.issues.push(...fg(r,t.issues)),e.value[r]=t.value}var i$e=he("$ZodArray",(t,e)=>{yi.init(t,e),t._zod.parse=(r,n)=>{let i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:t}),r;r.value=Array(i.length);let a=[];for(let o=0;o<i.length;o++){let s=i[o],c=e.element._zod.run({value:s,issues:[]},n);c instanceof Promise?a.push(c.then(u=>_Me(u,r,o))):_Me(c,r,o)}return a.length?Promise.all(a).then(()=>r):r}});function Jq(t,e,r,n){t.issues.length&&e.issues.push(...fg(r,t.issues)),t.value===void 0?r in n&&(e.value[r]=void 0):e.value[r]=t.value}function a$e(t){let e=Object.keys(t.shape);for(let n of e)if(!t.shape[n]._zod.traits.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);let r=LZ(t.shape);return{...t,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(r)}}function o$e(t,e,r,n,i,a){let o=[],s=i.keySet,c=i.catchall._zod,u=c.def.type;for(let l of Object.keys(e)){if(s.has(l))continue;if(u==="never"){o.push(l);continue}let p=c.run({value:e[l],issues:[]},n);p instanceof Promise?t.push(p.then(h=>Jq(h,r,l,e))):Jq(p,r,l,e)}return o.length&&r.issues.push({code:"unrecognized_keys",keys:o,input:e,inst:a}),t.length?Promise.all(t).then(()=>r):r}var Atr=he("$ZodObject",(t,e)=>{yi.init(t,e);let r=pN(()=>a$e(e));Wn(t._zod,"propValues",()=>{let o=e.shape,s={};for(let c in o){let u=o[c]._zod;if(u.values){s[c]??(s[c]=new Set);for(let l of u.values)s[c].add(l)}}return s});let n=EC,i=e.catchall,a;t._zod.parse=(o,s)=>{a??(a=r.value);let c=o.value;if(!n(c))return o.issues.push({expected:"object",code:"invalid_type",input:c,inst:t}),o;o.value={};let u=[],l=a.shape;for(let p of a.keys){let f=l[p]._zod.run({value:c[p],issues:[]},s);f instanceof Promise?u.push(f.then(d=>Jq(d,o,p,c))):Jq(f,o,p,c)}return i?o$e(u,c,o,s,r.value,t):u.length?Promise.all(u).then(()=>o):o}}),s$e=he("$ZodObjectJIT",(t,e)=>{Atr.init(t,e);let r=t._zod.parse,n=pN(()=>a$e(e)),i=h=>{let f=new Wq(["shape","payload","ctx"]),d=n.value,m=O=>{let S=Bq(O);return`shape[${S}]._zod.run({ value: input[${S}], issues: [] }, ctx)`};f.write("const input = payload.value;");let v=Object.create(null),E=0;for(let O of d.keys)v[O]=`key_${E++}`;f.write("const newResult = {}");for(let O of d.keys){let S=v[O],C=Bq(O);f.write(`const ${S} = ${m(O)};`),f.write(`
|
|
1373
1373
|
if (${S}.issues.length) {
|
|
@@ -1412,7 +1412,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
1412
1412
|
The output of this tool is required for the final step 'execute_functionality' (Step 3).`,inputSchema:Ka(qFe),outputSchema:Ka(GFe)},{name:"execute_functionality",description:`**(Step 3 of 3)**
|
|
1413
1413
|
Executes a specific functionality to create a new or modify an existing SAP Fiori application with provided parameters.
|
|
1414
1414
|
This is the **final step** of the workflow and performs the actual creation or modification.
|
|
1415
|
-
You MUST provide the exact parameter information obtained from get_functionality_details (Step 2).`,inputSchema:Ka(UFe),outputSchema:Ka(zFe)}];var Md=ot(Gzt()),CKt=ot(Yzt()),AKt=ot(w$()),xKt=ot(OKt());var SKt="@sap-ux/fiori-mcp-server",PKt="unknown-tool",$Hn="
|
|
1415
|
+
You MUST provide the exact parameter information obtained from get_functionality_details (Step 2).`,inputSchema:Ka(UFe),outputSchema:Ka(zFe)}];var Md=ot(Gzt()),CKt=ot(Yzt()),AKt=ot(w$()),xKt=ot(OKt());var SKt="@sap-ux/fiori-mcp-server",PKt="unknown-tool",$Hn="0a65e45d-6bf4-421d-b845-61e888c50e9e",WS=class{static _telemetryData;static _previousEventTimestamp;static get telemetryData(){return this._telemetryData}static async initTelemetrySettings(e){let r={consumerModule:{name:SKt,version:dke},watchTelemetrySettingStore:!1,internalFeature:(0,CKt.isInternalFeaturesSettingEnabled)(),resourceId:$Hn,...e};try{await(0,Md.initTelemetrySettings)(r)}catch(n){$t.error(`Error initializing telemetry settings: ${n}`)}}static createTelemetryData(e,r=!1){let n=new Date().getTime();if(this._previousEventTimestamp||(r=!1,this._previousEventTimestamp=n),!this._telemetryData){let i=ut.t("telemetry.unknownOs");try{i=(0,xKt.default)()}catch{}this._telemetryData={Platform:(0,AKt.isAppStudio)()?"SBAS":"VSCode",OperatingSystem:i}}if(r){let i={...this._telemetryData,...e};if(Math.abs(this._previousEventTimestamp-n)<1e3&&JSON.stringify(i)===JSON.stringify(this._telemetryData))return}return this._previousEventTimestamp=n,this._telemetryData=Object.assign(this._telemetryData,e),this._telemetryData}static prepareTelemetryEvent(e,r){this.markToolsEndTime();let n=r.markName?Md.PerformanceMeasurementAPI.getMeasurementDuration(r.markName):void 0;return{eventName:e,properties:r,measurements:n?{RequestTime:n}:{}}}static markToolStartTime(){this.createTelemetryData({markName:Md.PerformanceMeasurementAPI.startMark("MCP_LOADING_TIME")})}static markToolsEndTime(){this._telemetryData?.markName&&(Md.PerformanceMeasurementAPI.endMark(this._telemetryData.markName),Md.PerformanceMeasurementAPI.measure(this._telemetryData.markName))}static async sendTelemetry(e,r,n){let i=this.prepareTelemetryEvent(e,r);await Md.ClientFactory.getTelemetryClient().reportEvent(i,Md.SampleRate.NoSampling,n?{appPath:n}:void 0)}static getTelemetryName(){return SKt}};var DJ=class{server;constructor(){this.server=new Fq({name:"fiori-mcp",version:cN.version},{capabilities:{tools:{}}}),this.setupToolHandlers(),this.setupErrorHandling()}setupErrorHandling(){this.server.onerror=e=>$t.error(`[MCP Error] ${e}`),process.on("SIGINT",async()=>{await this.server.close(),process.exit(0)})}async setupTelemetry(){await WS.initTelemetrySettings()}setupToolHandlers(){this.server.setRequestHandler(QQ,async()=>({tools:aRt})),this.server.setRequestHandler(ZQ,async e=>{let{name:r,arguments:n}=e.params;try{let i;WS.markToolStartTime();let a={tool:r,functionalityId:n?.functionalityId};switch(r){case"search_docs":i=await ude(n,!0);break;case"list_fiori_apps":i=await lde(n);break;case"list_functionality":i=await GOe(n);break;case"get_functionality_details":i=await Y$(n);break;case"execute_functionality":i=await YOe(n);break;default:throw await WS.sendTelemetry(PKt,a,n?.appPath),new Error(`Unknown tool: ${r}. Try one of: list_fiori_apps, list_functionality, get_functionality_details, execute_functionality.`)}return await WS.sendTelemetry(r,a,n?.appPath),this.convertResultToCallToolResult(i)}catch(i){return{content:[{type:"text",text:`Error: ${i instanceof Error?i.message:"Unknown error occurred"}`}]}}})}convertResultToCallToolResult(e){if(typeof e=="string"||e instanceof String)return{content:[{type:"text",text:e.toString()}]};let r={content:[{type:"text",text:JSON.stringify(e)}]};return Array.isArray(e)||(r.structuredContent=e),r}async run(){let e=new jq;await this.server.connect(e),await this.setupTelemetry(),$t.info("Fiori Functionality MCP Server running on stdio")}};var FHn=new DJ;FHn.run().catch(t=>$t.error(`Server error: ${t}`));
|
|
1416
1416
|
/*! Bundled license information:
|
|
1417
1417
|
|
|
1418
1418
|
uri-js/dist/es5/uri.all.js:
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sap-ux/fiori-mcp-server",
|
|
3
3
|
"description": "SAP Fiori - Model Context Protocol (MCP) server",
|
|
4
|
-
"version": "0.3.
|
|
4
|
+
"version": "0.3.3",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"SAP Fiori tools",
|
|
7
7
|
"SAP Fiori elements",
|
|
@@ -44,13 +44,13 @@
|
|
|
44
44
|
"@sap-ux/fiori-docs-embeddings": "0.4.2",
|
|
45
45
|
"@sap-ux/i18n": "0.3.5",
|
|
46
46
|
"@sap-ux/logger": "0.7.1",
|
|
47
|
-
"@sap-ux/odata-annotation-core-types": "0.5.1",
|
|
48
47
|
"@sap-ux/odata-entity-model": "0.3.2",
|
|
48
|
+
"@sap-ux/odata-annotation-core-types": "0.5.1",
|
|
49
49
|
"@sap-ux/text-document-utils": "0.3.2",
|
|
50
50
|
"@sap-ux/btp-utils": "1.1.5",
|
|
51
51
|
"@sap-ux/feature-toggle": "0.3.4",
|
|
52
|
-
"@sap-ux/
|
|
53
|
-
"@sap-ux/
|
|
52
|
+
"@sap-ux/telemetry": "0.6.37",
|
|
53
|
+
"@sap-ux/nodejs-utils": "0.2.8"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
56
|
"@sap-ux/fiori-docs-embeddings": "*",
|