@sap-ux/fiori-mcp-server 0.4.4 → 0.4.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +1 -1
  2. package/package.json +6 -6
package/dist/index.js CHANGED
@@ -1575,7 +1575,7 @@ ${r.comment}`:r.comment}this.doc.range[2]=r.offset;break}default:this.errors.pus
1575
1575
  ${n.message}`:h,_=[v,e,t].filter(Boolean).join(`
1576
1576
  `);return m?(n.originalMessage=n.message,n.message=_):n=new Error(_),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};lrr.exports=Jii});var drr=y((CXi,W2e)=>{"use strict";var ere=["stdin","stdout","stderr"],Qii=t=>ere.some(e=>t[e]!==void 0),frr=t=>{if(!t)return;let{stdio:e}=t;if(e===void 0)return ere.map(n=>t[n]);if(Qii(t))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${ere.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,ere.length);return Array.from({length:r},(n,i)=>e[i])};W2e.exports=frr;W2e.exports.node=t=>{let e=frr(t);return e==="ipc"?"ipc":e===void 0||typeof e=="string"?[e,e,e,"ipc"]:e.includes("ipc")?e:[...e,"ipc"]}});var hrr=y((xXi,tre)=>{tre.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];process.platform!=="win32"&&tre.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&tre.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var brr=y((PXi,YI)=>{var ia=global.process,DC=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"};DC(ia)?(mrr=require("assert"),zI=hrr(),grr=/^win/i.test(ia.platform),Eq=require("events"),typeof Eq!="function"&&(Eq=Eq.EventEmitter),ia.__signal_exit_emitter__?gs=ia.__signal_exit_emitter__:(gs=ia.__signal_exit_emitter__=new Eq,gs.count=0,gs.emitted={}),gs.infinite||(gs.setMaxListeners(1/0),gs.infinite=!0),YI.exports=function(t,e){if(!DC(global.process))return function(){};mrr.equal(typeof t,"function","a callback must be provided for exit handler"),KI===!1&&X2e();var r="exit";e&&e.alwaysLast&&(r="afterexit");var n=function(){gs.removeListener(r,t),gs.listeners("exit").length===0&&gs.listeners("afterexit").length===0&&rre()};return gs.on(r,t),n},rre=function(){!KI||!DC(global.process)||(KI=!1,zI.forEach(function(e){try{ia.removeListener(e,nre[e])}catch{}}),ia.emit=ire,ia.reallyExit=J2e,gs.count-=1)},YI.exports.unload=rre,wC=function(e,r,n){gs.emitted[e]||(gs.emitted[e]=!0,gs.emit(e,r,n))},nre={},zI.forEach(function(t){nre[t]=function(){if(DC(global.process)){var r=ia.listeners(t);r.length===gs.count&&(rre(),wC("exit",null,t),wC("afterexit",null,t),grr&&t==="SIGHUP"&&(t="SIGINT"),ia.kill(ia.pid,t))}}}),YI.exports.signals=function(){return zI},KI=!1,X2e=function(){KI||!DC(global.process)||(KI=!0,gs.count+=1,zI=zI.filter(function(e){try{return ia.on(e,nre[e]),!0}catch{return!1}}),ia.emit=vrr,ia.reallyExit=yrr)},YI.exports.load=X2e,J2e=ia.reallyExit,yrr=function(e){DC(global.process)&&(ia.exitCode=e||0,wC("exit",ia.exitCode,null),wC("afterexit",ia.exitCode,null),J2e.call(ia,ia.exitCode))},ire=ia.emit,vrr=function(e,r){if(e==="exit"&&DC(global.process)){r!==void 0&&(ia.exitCode=r);var n=ire.apply(this,arguments);return wC("exit",ia.exitCode,null),wC("afterexit",ia.exitCode,null),n}else return ire.apply(this,arguments)}):YI.exports=function(){return function(){}};var mrr,zI,grr,Eq,gs,rre,wC,nre,KI,X2e,J2e,yrr,ire,vrr});var _rr=y((DXi,Err)=>{"use strict";var Zii=require("os"),eai=brr(),tai=1e3*5,rai=(t,e="SIGTERM",r={})=>{let n=t(e);return nai(t,e,r,n),n},nai=(t,e,r,n)=>{if(!iai(e,r,n))return;let i=oai(r),a=setTimeout(()=>{t("SIGKILL")},i);a.unref&&a.unref()},iai=(t,{forceKillAfterTimeout:e},r)=>aai(t)&&e!==!1&&r,aai=t=>t===Zii.constants.signals.SIGTERM||typeof t=="string"&&t.toUpperCase()==="SIGTERM",oai=({forceKillAfterTimeout:t=!0})=>{if(t===!0)return tai;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},sai=(t,e)=>{t.kill()&&(e.isCanceled=!0)},cai=(t,e,r)=>{t.kill(e),r(Object.assign(new Error("Timed out"),{timedOut:!0,signal:e}))},uai=(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(()=>{cai(t,r,c)},e)}),o=n.finally(()=>{clearTimeout(i)});return Promise.race([a,o])},lai=async(t,{cleanup:e,detached:r},n)=>{if(!e||r)return n;let i=eai(()=>{t.kill()});return n.finally(()=>{i()})};Err.exports={spawnedKill:rai,spawnedCancel:sai,setupTimeout:uai,setExitHandler:lai}});var Srr=y((wXi,Orr)=>{Orr.exports=Trr;function Trr(t,e){if(t&&e)return Trr(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 Z2e=y((NXi,Q2e)=>{var Arr=Srr();Q2e.exports=Arr(are);Q2e.exports.strict=Arr(Crr);are.proto=are(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return are(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return Crr(this)},configurable:!0})});function are(t){var e=function(){return e.called?e.value:(e.called=!0,e.value=t.apply(this,arguments))};return e.called=!1,e}function Crr(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 Drr=y((IXi,Prr)=>{var pai=Z2e(),fai=function(){},dai=function(t){return t.setHeader&&typeof t.abort=="function"},hai=function(t){return t.stdio&&Array.isArray(t.stdio)&&t.stdio.length===3},xrr=function(t,e,r){if(typeof e=="function")return xrr(t,null,e);e||(e={}),r=pai(r||fai);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)},d=function(v){r.call(t,v)},f=function(){process.nextTick(h)},h=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 dai(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)),hai(t)&&t.on("exit",p),t.on("end",l),t.on("finish",u),e.error!==!1&&t.on("error",d),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",d),t.removeListener("close",f)}};Prr.exports=xrr});var Irr=y((RXi,Nrr)=>{var mai=Z2e(),gai=Drr(),eje=require("fs"),_q=function(){},yai=/^v?\.0/.test(process.version),ore=function(t){return typeof t=="function"},vai=function(t){return!yai||!eje?!1:(t instanceof(eje.ReadStream||_q)||t instanceof(eje.WriteStream||_q))&&ore(t.close)},bai=function(t){return t.setHeader&&ore(t.abort)},Eai=function(t,e,r,n){n=mai(n);var i=!1;t.on("close",function(){i=!0}),gai(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,vai(t))return t.close(_q);if(bai(t))return t.abort();if(ore(t.destroy))return t.destroy();n(o||new Error("stream was destroyed"))}}},wrr=function(t){t()},_ai=function(t,e){return t.pipe(e)},Tai=function(){var t=Array.prototype.slice.call(arguments),e=ore(t[t.length-1]||_q)&&t.pop()||_q;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 Eai(i,o,s,function(c){r||(r=c),c&&n.forEach(wrr),!o&&(n.forEach(wrr),e(r))})});return t.reduce(_ai)};Nrr.exports=Tai});var Lrr=y((LXi,Rrr)=>{"use strict";var{PassThrough:Oai}=require("stream");Rrr.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 Oai({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 krr=y((kXi,WI)=>{"use strict";var{constants:Sai}=require("buffer"),Aai=Irr(),Cai=Lrr(),sre=class extends Error{constructor(){super("maxBuffer exceeded"),this.name="MaxBufferError"}};async function cre(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()<=Sai.MAX_LENGTH&&(s.bufferedData=n.getBufferedValue()),a(s)};n=Aai(t,Cai(e),s=>{if(s){o(s);return}i()}),n.on("data",()=>{n.getBufferedLength()>r&&o(new sre)})}),n.getBufferedValue()}WI.exports=cre;WI.exports.default=cre;WI.exports.buffer=(t,e)=>cre(t,{...e,encoding:"buffer"});WI.exports.array=(t,e)=>cre(t,{...e,array:!0});WI.exports.MaxBufferError=sre});var Mrr=y(($Xi,$rr)=>{"use strict";var{PassThrough:xai}=require("stream");$rr.exports=function(){var t=[],e=new xai({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 Urr=y((MXi,Vrr)=>{"use strict";var jrr=h5(),Frr=krr(),Pai=Mrr(),Dai=(t,e)=>{e===void 0||t.stdin===void 0||(jrr(e)?e.pipe(t.stdin):t.stdin.end(e))},wai=(t,{all:e})=>{if(!e||!t.stdout&&!t.stderr)return;let r=Pai();return t.stdout&&r.add(t.stdout),t.stderr&&r.add(t.stderr),r},tje=async(t,e)=>{if(t){t.destroy();try{return await e}catch(r){return r.bufferedData}}},rje=(t,{encoding:e,buffer:r,maxBuffer:n})=>{if(!(!t||!r))return e?Frr(t,{encoding:e,maxBuffer:n}):Frr.buffer(t,{maxBuffer:n})},Nai=async({stdout:t,stderr:e,all:r},{encoding:n,buffer:i,maxBuffer:a},o)=>{let s=rje(t,{encoding:n,buffer:i,maxBuffer:a}),c=rje(e,{encoding:n,buffer:i,maxBuffer:a}),u=rje(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},tje(t,s),tje(e,c),tje(r,u)])}},Iai=({input:t})=>{if(jrr(t))throw new TypeError("The `input` option cannot be a stream in sync mode")};Vrr.exports={handleInput:Dai,makeAllStream:wai,getSpawnedResult:Nai,validateInputSync:Iai}});var Brr=y((FXi,qrr)=>{"use strict";var Rai=(async()=>{})().constructor.prototype,Lai=["then","catch","finally"].map(t=>[t,Reflect.getOwnPropertyDescriptor(Rai,t)]),kai=(t,e)=>{for(let[r,n]of Lai){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},$ai=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)})});qrr.exports={mergePromise:kai,getSpawnedPromise:$ai}});var Grr=y((jXi,Hrr)=>{"use strict";var Mai=/ +/g,Fai=(t,e=[])=>Array.isArray(e)?[t,...e].join(" "):t,jai=t=>{let e=[];for(let r of t.trim().split(Mai)){let n=e[e.length-1];n&&n.endsWith("\\")?e[e.length-1]=`${n.slice(0,-1)} ${r}`:e.push(r)}return e};Hrr.exports={joinCommand:Fai,parseCommand:jai}});var Qrr=y((VXi,XI)=>{"use strict";var Vai=require("path"),nje=require("child_process"),Krr=Ytr(),Uai=Xtr(),qai=Ztr(),Bai=nrr(),ure=prr(),Yrr=drr(),{spawnedKill:Hai,spawnedCancel:Gai,setupTimeout:zai,setExitHandler:Kai}=_rr(),{handleInput:Yai,getSpawnedResult:Wai,makeAllStream:Xai,validateInputSync:Jai}=Urr(),{mergePromise:zrr,getSpawnedPromise:Qai}=Brr(),{joinCommand:Wrr,parseCommand:Xrr}=Grr(),Zai=1e3*1e3*100,eoi=({env:t,extendEnv:e,preferLocal:r,localDir:n,execPath:i})=>{let a=e?{...process.env,...t}:t;return r?qai.env({env:a,cwd:n,execPath:i}):a},Jrr=(t,e,r={})=>{let n=Krr._parse(t,e,r);return t=n.command,e=n.args,r=n.options,r={maxBuffer:Zai,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=eoi(r),r.stdio=Yrr(r),process.platform==="win32"&&Vai.basename(t,".exe")==="cmd"&&e.unshift("/q"),{file:t,args:e,options:r,parsed:n}},Tq=(t,e,r)=>typeof e!="string"&&!Buffer.isBuffer(e)?r===void 0?void 0:"":t.stripFinalNewline?Uai(e):e,lre=(t,e,r)=>{let n=Jrr(t,e,r),i=Wrr(t,e),a;try{a=nje.spawn(n.file,n.args,n.options)}catch(d){let f=new nje.ChildProcess,h=Promise.reject(ure({error:d,stdout:"",stderr:"",all:"",command:i,parsed:n,timedOut:!1,isCanceled:!1,killed:!1}));return zrr(f,h)}let o=Qai(a),s=zai(a,n.options,o),c=Kai(a,n.options,s),u={isCanceled:!1};a.kill=Hai.bind(null,a.kill.bind(a)),a.cancel=Gai.bind(null,a,u);let p=Bai(async()=>{let[{error:d,exitCode:f,signal:h,timedOut:m},v,_,T]=await Wai(a,n.options,c),O=Tq(n.options,v),A=Tq(n.options,_),C=Tq(n.options,T);if(d||f!==0||h!==null){let P=ure({error:d,exitCode:f,signal:h,stdout:O,stderr:A,all:C,command:i,parsed:n,timedOut:m,isCanceled:u.isCanceled,killed:a.killed});if(!n.options.reject)return P;throw P}return{command:i,exitCode:0,stdout:O,stderr:A,all:C,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}});return Krr._enoent.hookChildProcess(a,n.parsed),Yai(a,n.options.input),a.all=Xai(a,n.options),zrr(a,p)};XI.exports=lre;XI.exports.sync=(t,e,r)=>{let n=Jrr(t,e,r),i=Wrr(t,e);Jai(n.options);let a;try{a=nje.spawnSync(n.file,n.args,n.options)}catch(c){throw ure({error:c,stdout:"",stderr:"",all:"",command:i,parsed:n,timedOut:!1,isCanceled:!1,killed:!1})}let o=Tq(n.options,a.stdout,a.error),s=Tq(n.options,a.stderr,a.error);if(a.error||a.status!==0||a.signal!==null){let c=ure({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}};XI.exports.command=(t,e)=>{let[r,...n]=Xrr(t);return lre(r,n,e)};XI.exports.commandSync=(t,e)=>{let[r,...n]=Xrr(t);return lre.sync(r,n,e)};XI.exports.node=(t,e,r={})=>{e&&!Array.isArray(e)&&typeof e=="object"&&(r=e,e=[]);let n=Yrr.node(r),i=process.execArgv.filter(s=>!s.startsWith("--inspect")),{nodePath:a=process.execPath,nodeOptions:o=i}=r;return lre(a,[...o,t,...Array.isArray(e)?e:[]],{...r,stdin:void 0,stdout:void 0,stderr:void 0,stdio:n,shell:!1})}});var rnr=y((UXi,tnr)=>{"use strict";var Zrr=require("os"),enr=Qrr(),toi=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"]]),roi=t=>{let e=/\d+\.\d/.exec(t||Zrr.release());if(t&&!e)throw new Error("`release` argument doesn't match `n.n`");let r=(e||[])[0];if((!t||t===Zrr.release())&&["6.1","6.2","6.3","10.0"].includes(r)){let n;try{n=enr.sync("wmic",["os","get","Caption"]).stdout||""}catch{n=enr.sync("powershell",["(Get-CimInstance -ClassName Win32_OperatingSystem).caption"]).stdout||""}let i=(n.match(/2008|2012|2016|2019/)||[])[0];if(i)return`Server ${i}`}return toi.get(r)};tnr.exports=roi});var inr=y((qXi,nnr)=>{"use strict";var NC=require("os"),noi=Ntr(),ioi=rnr(),aoi=(t,e)=>{if(!t&&e)throw new Error("You can't specify a `release` without specifying `platform`");t=t||NC.platform();let r;if(t==="darwin"){!e&&NC.platform()==="darwin"&&(e=NC.release());let n=e?Number(e.split(".")[0])>15?"macOS":"OS X":"macOS";try{r=e?noi(e).name:""}catch{}return n+(r?" "+r:"")}return t==="linux"?(!e&&NC.platform()==="linux"&&(e=NC.release()),r=e?e.replace(/^(\d+\.\d+).*/,"$1"):"","Linux"+(r?" "+r:"")):t==="win32"?(!e&&NC.platform()==="win32"&&(e=NC.release()),r=e?ioi(e):"","Windows"+(r?" "+r:"")):t};nnr.exports=aoi});var gn;(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})(gn||(gn={}));var Tne;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(Tne||(Tne={}));var ut=gn.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),wb=t=>{switch(typeof t){case"undefined":return ut.undefined;case"string":return ut.string;case"number":return isNaN(t)?ut.nan:ut.number;case"boolean":return ut.boolean;case"function":return ut.function;case"bigint":return ut.bigint;case"symbol":return ut.symbol;case"object":return Array.isArray(t)?ut.array:t===null?ut.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?ut.promise:typeof Map<"u"&&t instanceof Map?ut.map:typeof Set<"u"&&t instanceof Set?ut.set:typeof Date<"u"&&t instanceof Date?ut.date:ut.object;default:return ut.unknown}},Me=gn.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"]),rlr=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),ql=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,gn.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()}};ql.create=t=>new ql(t);var YC=(t,e)=>{let r;switch(t.code){case Me.invalid_type:t.received===ut.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case Me.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,gn.jsonStringifyReplacer)}`;break;case Me.unrecognized_keys:r=`Unrecognized key(s) in object: ${gn.joinValues(t.keys,", ")}`;break;case Me.invalid_union:r="Invalid input";break;case Me.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${gn.joinValues(t.options)}`;break;case Me.invalid_enum_value:r=`Invalid enum value. Expected ${gn.joinValues(t.options)}, received '${t.received}'`;break;case Me.invalid_arguments:r="Invalid function arguments";break;case Me.invalid_return_type:r="Invalid function return type";break;case Me.invalid_date:r="Invalid date";break;case Me.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}"`:gn.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case Me.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 Me.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 Me.custom:r="Invalid input";break;case Me.invalid_intersection_types:r="Intersection results could not be merged";break;case Me.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case Me.not_finite:r="Number must be finite";break;default:r=e.defaultError,gn.assertNever(t)}return{message:r}},EUe=YC;function nlr(t){EUe=t}function hB(){return EUe}var mB=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}},ilr=[];function tt(t,e){let r=hB(),n=mB({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===YC?void 0:YC].filter(i=>!!i)});t.common.issues.push(n)}var zs=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 Wt;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 Wt;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}}},Wt=Object.freeze({status:"aborted"}),KC=t=>({status:"dirty",value:t}),jc=t=>({status:"valid",value:t}),One=t=>t.status==="aborted",Sne=t=>t.status==="dirty",yR=t=>t.status==="valid",vR=t=>typeof Promise<"u"&&t instanceof Promise;function gB(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 _Ue(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 Nt;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(Nt||(Nt={}));var mR,gR,Fp=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}},vUe=(t,e)=>{if(yR(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 ql(t.common.issues);return this._error=r,this._error}}};function Tr(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 Or=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 wb(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:wb(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new zs,ctx:{common:e.parent.common,data:e.data,parsedType:wb(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(vR(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:wb(e)},a=this._parseSync({data:e,path:i.path,parent:i});return vUe(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:wb(e)},i=this._parse({data:e,path:n.path,parent:n}),a=await(vR(i)?i:Promise.resolve(i));return vUe(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:Me.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 Bl({schema:this,typeName:Yt.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Mp.create(this,this._def)}nullable(){return Ph.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Zg.create(this,this._def)}promise(){return Rb.create(this,this._def)}or(e){return uT.create([this,e],this._def)}and(e){return lT.create(this,e,this._def)}transform(e){return new Bl({...Tr(this._def),schema:this,typeName:Yt.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new mT({...Tr(this._def),innerType:this,defaultValue:r,typeName:Yt.ZodDefault})}brand(){return new bR({typeName:Yt.ZodBranded,type:this,...Tr(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new gT({...Tr(this._def),innerType:this,catchValue:r,typeName:Yt.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return ER.create(this,e)}readonly(){return yT.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},alr=/^c[^\s-]{8,}$/i,olr=/^[0-9a-z]+$/,slr=/^[0-9A-HJKMNP-TV-Z]{26}$/,clr=/^[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,ulr=/^[a-z0-9_-]{21}$/i,llr=/^[-+]?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)?)??$/,plr=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,flr="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",_ne,dlr=/^(?:(?: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])$/,hlr=/^(([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})))$/,mlr=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,TUe="((\\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])))",glr=new RegExp(`^${TUe}$`);function OUe(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 ylr(t){return new RegExp(`^${OUe(t)}$`)}function SUe(t){let e=`${TUe}T${OUe(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 vlr(t,e){return!!((e==="v4"||!e)&&dlr.test(t)||(e==="v6"||!e)&&hlr.test(t))}var Nb=class t extends Or{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==ut.string){let a=this._getOrReturnCtx(e);return tt(a,{code:Me.invalid_type,expected:ut.string,received:a.parsedType}),Wt}let n=new zs,i;for(let a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(i=this._getOrReturnCtx(e,i),tt(i,{code:Me.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),tt(i,{code:Me.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?tt(i,{code:Me.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):s&&tt(i,{code:Me.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),n.dirty())}else if(a.kind==="email")plr.test(e.data)||(i=this._getOrReturnCtx(e,i),tt(i,{validation:"email",code:Me.invalid_string,message:a.message}),n.dirty());else if(a.kind==="emoji")_ne||(_ne=new RegExp(flr,"u")),_ne.test(e.data)||(i=this._getOrReturnCtx(e,i),tt(i,{validation:"emoji",code:Me.invalid_string,message:a.message}),n.dirty());else if(a.kind==="uuid")clr.test(e.data)||(i=this._getOrReturnCtx(e,i),tt(i,{validation:"uuid",code:Me.invalid_string,message:a.message}),n.dirty());else if(a.kind==="nanoid")ulr.test(e.data)||(i=this._getOrReturnCtx(e,i),tt(i,{validation:"nanoid",code:Me.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid")alr.test(e.data)||(i=this._getOrReturnCtx(e,i),tt(i,{validation:"cuid",code:Me.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid2")olr.test(e.data)||(i=this._getOrReturnCtx(e,i),tt(i,{validation:"cuid2",code:Me.invalid_string,message:a.message}),n.dirty());else if(a.kind==="ulid")slr.test(e.data)||(i=this._getOrReturnCtx(e,i),tt(i,{validation:"ulid",code:Me.invalid_string,message:a.message}),n.dirty());else if(a.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),tt(i,{validation:"url",code:Me.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),tt(i,{validation:"regex",code:Me.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),tt(i,{code:Me.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),tt(i,{code:Me.invalid_string,validation:{startsWith:a.value},message:a.message}),n.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(i=this._getOrReturnCtx(e,i),tt(i,{code:Me.invalid_string,validation:{endsWith:a.value},message:a.message}),n.dirty()):a.kind==="datetime"?SUe(a).test(e.data)||(i=this._getOrReturnCtx(e,i),tt(i,{code:Me.invalid_string,validation:"datetime",message:a.message}),n.dirty()):a.kind==="date"?glr.test(e.data)||(i=this._getOrReturnCtx(e,i),tt(i,{code:Me.invalid_string,validation:"date",message:a.message}),n.dirty()):a.kind==="time"?ylr(a).test(e.data)||(i=this._getOrReturnCtx(e,i),tt(i,{code:Me.invalid_string,validation:"time",message:a.message}),n.dirty()):a.kind==="duration"?llr.test(e.data)||(i=this._getOrReturnCtx(e,i),tt(i,{validation:"duration",code:Me.invalid_string,message:a.message}),n.dirty()):a.kind==="ip"?vlr(e.data,a.version)||(i=this._getOrReturnCtx(e,i),tt(i,{validation:"ip",code:Me.invalid_string,message:a.message}),n.dirty()):a.kind==="base64"?mlr.test(e.data)||(i=this._getOrReturnCtx(e,i),tt(i,{validation:"base64",code:Me.invalid_string,message:a.message}),n.dirty()):gn.assertNever(a);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(i=>e.test(i),{validation:r,code:Me.invalid_string,...Nt.errToObj(n)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Nt.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Nt.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Nt.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Nt.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Nt.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Nt.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Nt.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Nt.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Nt.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Nt.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,...Nt.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,...Nt.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...Nt.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...Nt.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...Nt.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...Nt.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...Nt.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...Nt.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...Nt.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...Nt.errToObj(r)})}nonempty(e){return this.min(1,Nt.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}};Nb.create=t=>{var e;return new Nb({checks:[],typeName:Yt.ZodString,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...Tr(t)})};function blr(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 nT=class t extends Or{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)!==ut.number){let a=this._getOrReturnCtx(e);return tt(a,{code:Me.invalid_type,expected:ut.number,received:a.parsedType}),Wt}let n,i=new zs;for(let a of this._def.checks)a.kind==="int"?gn.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),tt(n,{code:Me.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),tt(n,{code:Me.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),tt(n,{code:Me.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="multipleOf"?blr(e.data,a.value)!==0&&(n=this._getOrReturnCtx(e,n),tt(n,{code:Me.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),tt(n,{code:Me.not_finite,message:a.message}),i.dirty()):gn.assertNever(a);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,Nt.toString(r))}gt(e,r){return this.setLimit("min",e,!1,Nt.toString(r))}lte(e,r){return this.setLimit("max",e,!0,Nt.toString(r))}lt(e,r){return this.setLimit("max",e,!1,Nt.toString(r))}setLimit(e,r,n,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:Nt.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Nt.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Nt.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Nt.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Nt.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Nt.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:Nt.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:Nt.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Nt.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Nt.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"&&gn.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)}};nT.create=t=>new nT({checks:[],typeName:Yt.ZodNumber,coerce:t?.coerce||!1,...Tr(t)});var iT=class t extends Or{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)!==ut.bigint){let a=this._getOrReturnCtx(e);return tt(a,{code:Me.invalid_type,expected:ut.bigint,received:a.parsedType}),Wt}let n,i=new zs;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),tt(n,{code:Me.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),tt(n,{code:Me.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),tt(n,{code:Me.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):gn.assertNever(a);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,Nt.toString(r))}gt(e,r){return this.setLimit("min",e,!1,Nt.toString(r))}lte(e,r){return this.setLimit("max",e,!0,Nt.toString(r))}lt(e,r){return this.setLimit("max",e,!1,Nt.toString(r))}setLimit(e,r,n,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:Nt.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:Nt.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Nt.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Nt.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Nt.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:Nt.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}};iT.create=t=>{var e;return new iT({checks:[],typeName:Yt.ZodBigInt,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...Tr(t)})};var aT=class extends Or{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==ut.boolean){let n=this._getOrReturnCtx(e);return tt(n,{code:Me.invalid_type,expected:ut.boolean,received:n.parsedType}),Wt}return jc(e.data)}};aT.create=t=>new aT({typeName:Yt.ZodBoolean,coerce:t?.coerce||!1,...Tr(t)});var oT=class t extends Or{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==ut.date){let a=this._getOrReturnCtx(e);return tt(a,{code:Me.invalid_type,expected:ut.date,received:a.parsedType}),Wt}if(isNaN(e.data.getTime())){let a=this._getOrReturnCtx(e);return tt(a,{code:Me.invalid_date}),Wt}let n=new zs,i;for(let a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(i=this._getOrReturnCtx(e,i),tt(i,{code:Me.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),tt(i,{code:Me.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),n.dirty()):gn.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:Nt.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:Nt.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}};oT.create=t=>new oT({checks:[],coerce:t?.coerce||!1,typeName:Yt.ZodDate,...Tr(t)});var WC=class extends Or{_parse(e){if(this._getType(e)!==ut.symbol){let n=this._getOrReturnCtx(e);return tt(n,{code:Me.invalid_type,expected:ut.symbol,received:n.parsedType}),Wt}return jc(e.data)}};WC.create=t=>new WC({typeName:Yt.ZodSymbol,...Tr(t)});var sT=class extends Or{_parse(e){if(this._getType(e)!==ut.undefined){let n=this._getOrReturnCtx(e);return tt(n,{code:Me.invalid_type,expected:ut.undefined,received:n.parsedType}),Wt}return jc(e.data)}};sT.create=t=>new sT({typeName:Yt.ZodUndefined,...Tr(t)});var cT=class extends Or{_parse(e){if(this._getType(e)!==ut.null){let n=this._getOrReturnCtx(e);return tt(n,{code:Me.invalid_type,expected:ut.null,received:n.parsedType}),Wt}return jc(e.data)}};cT.create=t=>new cT({typeName:Yt.ZodNull,...Tr(t)});var Ib=class extends Or{constructor(){super(...arguments),this._any=!0}_parse(e){return jc(e.data)}};Ib.create=t=>new Ib({typeName:Yt.ZodAny,...Tr(t)});var Qg=class extends Or{constructor(){super(...arguments),this._unknown=!0}_parse(e){return jc(e.data)}};Qg.create=t=>new Qg({typeName:Yt.ZodUnknown,...Tr(t)});var gd=class extends Or{_parse(e){let r=this._getOrReturnCtx(e);return tt(r,{code:Me.invalid_type,expected:ut.never,received:r.parsedType}),Wt}};gd.create=t=>new gd({typeName:Yt.ZodNever,...Tr(t)});var XC=class extends Or{_parse(e){if(this._getType(e)!==ut.undefined){let n=this._getOrReturnCtx(e);return tt(n,{code:Me.invalid_type,expected:ut.void,received:n.parsedType}),Wt}return jc(e.data)}};XC.create=t=>new XC({typeName:Yt.ZodVoid,...Tr(t)});var Zg=class t extends Or{_parse(e){let{ctx:r,status:n}=this._processInputParams(e),i=this._def;if(r.parsedType!==ut.array)return tt(r,{code:Me.invalid_type,expected:ut.array,received:r.parsedType}),Wt;if(i.exactLength!==null){let o=r.data.length>i.exactLength.value,s=r.data.length<i.exactLength.value;(o||s)&&(tt(r,{code:o?Me.too_big:Me.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&&(tt(r,{code:Me.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&&(tt(r,{code:Me.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 Fp(r,o,r.path,s)))).then(o=>zs.mergeArray(n,o));let a=[...r.data].map((o,s)=>i.type._parseSync(new Fp(r,o,r.path,s)));return zs.mergeArray(n,a)}get element(){return this._def.type}min(e,r){return new t({...this._def,minLength:{value:e,message:Nt.toString(r)}})}max(e,r){return new t({...this._def,maxLength:{value:e,message:Nt.toString(r)}})}length(e,r){return new t({...this._def,exactLength:{value:e,message:Nt.toString(r)}})}nonempty(e){return this.min(1,e)}};Zg.create=(t,e)=>new Zg({type:t,minLength:null,maxLength:null,exactLength:null,typeName:Yt.ZodArray,...Tr(e)});function zC(t){if(t instanceof Pu){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=Mp.create(zC(n))}return new Pu({...t._def,shape:()=>e})}else return t instanceof Zg?new Zg({...t._def,type:zC(t.element)}):t instanceof Mp?Mp.create(zC(t.unwrap())):t instanceof Ph?Ph.create(zC(t.unwrap())):t instanceof xh?xh.create(t.items.map(e=>zC(e))):t}var Pu=class t extends Or{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=gn.objectKeys(e);return this._cached={shape:e,keys:r}}_parse(e){if(this._getType(e)!==ut.object){let u=this._getOrReturnCtx(e);return tt(u,{code:Me.invalid_type,expected:ut.object,received:u.parsedType}),Wt}let{status:n,ctx:i}=this._processInputParams(e),{shape:a,keys:o}=this._getCached(),s=[];if(!(this._def.catchall instanceof gd&&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 Fp(i,p,i.path,u)),alwaysSet:u in i.data})}if(this._def.catchall instanceof gd){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&&(tt(i,{code:Me.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 Fp(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,d=await l.value;u.push({key:p,value:d,alwaysSet:l.alwaysSet})}return u}).then(u=>zs.mergeObjectSync(n,u)):zs.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(e){return Nt.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=Nt.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:Yt.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let r={};return gn.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 gn.objectKeys(this.shape).forEach(n=>{e[n]||(r[n]=this.shape[n])}),new t({...this._def,shape:()=>r})}deepPartial(){return zC(this)}partial(e){let r={};return gn.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 gn.objectKeys(this.shape).forEach(n=>{if(e&&!e[n])r[n]=this.shape[n];else{let a=this.shape[n];for(;a instanceof Mp;)a=a._def.innerType;r[n]=a}}),new t({...this._def,shape:()=>r})}keyof(){return AUe(gn.objectKeys(this.shape))}};Pu.create=(t,e)=>new Pu({shape:()=>t,unknownKeys:"strip",catchall:gd.create(),typeName:Yt.ZodObject,...Tr(e)});Pu.strictCreate=(t,e)=>new Pu({shape:()=>t,unknownKeys:"strict",catchall:gd.create(),typeName:Yt.ZodObject,...Tr(e)});Pu.lazycreate=(t,e)=>new Pu({shape:t,unknownKeys:"strip",catchall:gd.create(),typeName:Yt.ZodObject,...Tr(e)});var uT=class extends Or{_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 ql(s.ctx.common.issues));return tt(r,{code:Me.invalid_union,unionErrors:o}),Wt}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 ql(c));return tt(r,{code:Me.invalid_union,unionErrors:s}),Wt}}get options(){return this._def.options}};uT.create=(t,e)=>new uT({options:t,typeName:Yt.ZodUnion,...Tr(e)});var Jg=t=>t instanceof pT?Jg(t.schema):t instanceof Bl?Jg(t.innerType()):t instanceof fT?[t.value]:t instanceof dT?t.options:t instanceof hT?gn.objectValues(t.enum):t instanceof mT?Jg(t._def.innerType):t instanceof sT?[void 0]:t instanceof cT?[null]:t instanceof Mp?[void 0,...Jg(t.unwrap())]:t instanceof Ph?[null,...Jg(t.unwrap())]:t instanceof bR||t instanceof yT?Jg(t.unwrap()):t instanceof gT?Jg(t._def.innerType):[],yB=class t extends Or{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==ut.object)return tt(r,{code:Me.invalid_type,expected:ut.object,received:r.parsedType}),Wt;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}):(tt(r,{code:Me.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),Wt)}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=Jg(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:Yt.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:i,...Tr(n)})}};function Ane(t,e){let r=wb(t),n=wb(e);if(t===e)return{valid:!0,data:t};if(r===ut.object&&n===ut.object){let i=gn.objectKeys(e),a=gn.objectKeys(t).filter(s=>i.indexOf(s)!==-1),o={...t,...e};for(let s of a){let c=Ane(t[s],e[s]);if(!c.valid)return{valid:!1};o[s]=c.data}return{valid:!0,data:o}}else if(r===ut.array&&n===ut.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=Ane(o,s);if(!c.valid)return{valid:!1};i.push(c.data)}return{valid:!0,data:i}}else return r===ut.date&&n===ut.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var lT=class extends Or{_parse(e){let{status:r,ctx:n}=this._processInputParams(e),i=(a,o)=>{if(One(a)||One(o))return Wt;let s=Ane(a.value,o.value);return s.valid?((Sne(a)||Sne(o))&&r.dirty(),{status:r.value,value:s.data}):(tt(n,{code:Me.invalid_intersection_types}),Wt)};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}))}};lT.create=(t,e,r)=>new lT({left:t,right:e,typeName:Yt.ZodIntersection,...Tr(r)});var xh=class t extends Or{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==ut.array)return tt(n,{code:Me.invalid_type,expected:ut.array,received:n.parsedType}),Wt;if(n.data.length<this._def.items.length)return tt(n,{code:Me.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Wt;!this._def.rest&&n.data.length>this._def.items.length&&(tt(n,{code:Me.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 Fp(n,o,n.path,s)):null}).filter(o=>!!o);return n.common.async?Promise.all(a).then(o=>zs.mergeArray(r,o)):zs.mergeArray(r,a)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};xh.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new xh({items:t,typeName:Yt.ZodTuple,rest:null,...Tr(e)})};var vB=class t extends Or{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!==ut.object)return tt(n,{code:Me.invalid_type,expected:ut.object,received:n.parsedType}),Wt;let i=[],a=this._def.keyType,o=this._def.valueType;for(let s in n.data)i.push({key:a._parse(new Fp(n,s,n.path,s)),value:o._parse(new Fp(n,n.data[s],n.path,s)),alwaysSet:s in n.data});return n.common.async?zs.mergeObjectAsync(r,i):zs.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof Or?new t({keyType:e,valueType:r,typeName:Yt.ZodRecord,...Tr(n)}):new t({keyType:Nb.create(),valueType:e,typeName:Yt.ZodRecord,...Tr(r)})}},JC=class extends Or{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!==ut.map)return tt(n,{code:Me.invalid_type,expected:ut.map,received:n.parsedType}),Wt;let i=this._def.keyType,a=this._def.valueType,o=[...n.data.entries()].map(([s,c],u)=>({key:i._parse(new Fp(n,s,n.path,[u,"key"])),value:a._parse(new Fp(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 Wt;(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 Wt;(u.status==="dirty"||l.status==="dirty")&&r.dirty(),s.set(u.value,l.value)}return{status:r.value,value:s}}}};JC.create=(t,e,r)=>new JC({valueType:e,keyType:t,typeName:Yt.ZodMap,...Tr(r)});var QC=class t extends Or{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==ut.set)return tt(n,{code:Me.invalid_type,expected:ut.set,received:n.parsedType}),Wt;let i=this._def;i.minSize!==null&&n.data.size<i.minSize.value&&(tt(n,{code:Me.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&&(tt(n,{code:Me.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 Wt;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 Fp(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:Nt.toString(r)}})}max(e,r){return new t({...this._def,maxSize:{value:e,message:Nt.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};QC.create=(t,e)=>new QC({valueType:t,minSize:null,maxSize:null,typeName:Yt.ZodSet,...Tr(e)});var bB=class t extends Or{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==ut.function)return tt(r,{code:Me.invalid_type,expected:ut.function,received:r.parsedType}),Wt;function n(s,c){return mB({data:s,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,hB(),YC].filter(u=>!!u),issueData:{code:Me.invalid_arguments,argumentsError:c}})}function i(s,c){return mB({data:s,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,hB(),YC].filter(u=>!!u),issueData:{code:Me.invalid_return_type,returnTypeError:c}})}let a={errorMap:r.common.contextualErrorMap},o=r.data;if(this._def.returns instanceof Rb){let s=this;return jc(async function(...c){let u=new ql([]),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 jc(function(...c){let u=s._def.args.safeParse(c,a);if(!u.success)throw new ql([n(c,u.error)]);let l=Reflect.apply(o,this,u.data),p=s._def.returns.safeParse(l,a);if(!p.success)throw new ql([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:xh.create(e).rest(Qg.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||xh.create([]).rest(Qg.create()),returns:r||Qg.create(),typeName:Yt.ZodFunction,...Tr(n)})}},pT=class extends Or{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})}};pT.create=(t,e)=>new pT({getter:t,typeName:Yt.ZodLazy,...Tr(e)});var fT=class extends Or{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return tt(r,{received:r.data,code:Me.invalid_literal,expected:this._def.value}),Wt}return{status:"valid",value:e.data}}get value(){return this._def.value}};fT.create=(t,e)=>new fT({value:t,typeName:Yt.ZodLiteral,...Tr(e)});function AUe(t,e){return new dT({values:t,typeName:Yt.ZodEnum,...Tr(e)})}var dT=class t extends Or{constructor(){super(...arguments),mR.set(this,void 0)}_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),n=this._def.values;return tt(r,{expected:gn.joinValues(n),received:r.parsedType,code:Me.invalid_type}),Wt}if(gB(this,mR,"f")||_Ue(this,mR,new Set(this._def.values),"f"),!gB(this,mR,"f").has(e.data)){let r=this._getOrReturnCtx(e),n=this._def.values;return tt(r,{received:r.data,code:Me.invalid_enum_value,options:n}),Wt}return jc(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})}};mR=new WeakMap;dT.create=AUe;var hT=class extends Or{constructor(){super(...arguments),gR.set(this,void 0)}_parse(e){let r=gn.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==ut.string&&n.parsedType!==ut.number){let i=gn.objectValues(r);return tt(n,{expected:gn.joinValues(i),received:n.parsedType,code:Me.invalid_type}),Wt}if(gB(this,gR,"f")||_Ue(this,gR,new Set(gn.getValidEnumValues(this._def.values)),"f"),!gB(this,gR,"f").has(e.data)){let i=gn.objectValues(r);return tt(n,{received:n.data,code:Me.invalid_enum_value,options:i}),Wt}return jc(e.data)}get enum(){return this._def.values}};gR=new WeakMap;hT.create=(t,e)=>new hT({values:t,typeName:Yt.ZodNativeEnum,...Tr(e)});var Rb=class extends Or{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==ut.promise&&r.common.async===!1)return tt(r,{code:Me.invalid_type,expected:ut.promise,received:r.parsedType}),Wt;let n=r.parsedType===ut.promise?r.data:Promise.resolve(r.data);return jc(n.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}};Rb.create=(t,e)=>new Rb({type:t,typeName:Yt.ZodPromise,...Tr(e)});var Bl=class extends Or{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Yt.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=>{tt(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 Wt;let c=await this._def.schema._parseAsync({data:s,path:n.path,parent:n});return c.status==="aborted"?Wt:c.status==="dirty"||r.value==="dirty"?KC(c.value):c});{if(r.value==="aborted")return Wt;let s=this._def.schema._parseSync({data:o,path:n.path,parent:n});return s.status==="aborted"?Wt:s.status==="dirty"||r.value==="dirty"?KC(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"?Wt:(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"?Wt:(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(!yR(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=>yR(o)?Promise.resolve(i.transform(o.value,a)).then(s=>({status:r.value,value:s})):o);gn.assertNever(i)}};Bl.create=(t,e,r)=>new Bl({schema:t,typeName:Yt.ZodEffects,effect:e,...Tr(r)});Bl.createWithPreprocess=(t,e,r)=>new Bl({schema:e,effect:{type:"preprocess",transform:t},typeName:Yt.ZodEffects,...Tr(r)});var Mp=class extends Or{_parse(e){return this._getType(e)===ut.undefined?jc(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Mp.create=(t,e)=>new Mp({innerType:t,typeName:Yt.ZodOptional,...Tr(e)});var Ph=class extends Or{_parse(e){return this._getType(e)===ut.null?jc(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Ph.create=(t,e)=>new Ph({innerType:t,typeName:Yt.ZodNullable,...Tr(e)});var mT=class extends Or{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return r.parsedType===ut.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};mT.create=(t,e)=>new mT({innerType:t,typeName:Yt.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Tr(e)});var gT=class extends Or{_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 vR(i)?i.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new ql(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new ql(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};gT.create=(t,e)=>new gT({innerType:t,typeName:Yt.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Tr(e)});var ZC=class extends Or{_parse(e){if(this._getType(e)!==ut.nan){let n=this._getOrReturnCtx(e);return tt(n,{code:Me.invalid_type,expected:ut.nan,received:n.parsedType}),Wt}return{status:"valid",value:e.data}}};ZC.create=t=>new ZC({typeName:Yt.ZodNaN,...Tr(t)});var Elr=Symbol("zod_brand"),bR=class extends Or{_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}},ER=class t extends Or{_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"?Wt:a.status==="dirty"?(r.dirty(),KC(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"?Wt: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:Yt.ZodPipeline})}},yT=class extends Or{_parse(e){let r=this._def.innerType._parse(e),n=i=>(yR(i)&&(i.value=Object.freeze(i.value)),i);return vR(r)?r.then(i=>n(i)):n(r)}unwrap(){return this._def.innerType}};yT.create=(t,e)=>new yT({innerType:t,typeName:Yt.ZodReadonly,...Tr(e)});function CUe(t,e={},r){return t?Ib.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})}}):Ib.create()}var _lr={object:Pu.lazycreate},Yt;(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"})(Yt||(Yt={}));var Tlr=(t,e={message:`Input not instance of ${t.name}`})=>CUe(r=>r instanceof t,e),xUe=Nb.create,PUe=nT.create,Olr=ZC.create,Slr=iT.create,DUe=aT.create,Alr=oT.create,Clr=WC.create,xlr=sT.create,Plr=cT.create,Dlr=Ib.create,wlr=Qg.create,Nlr=gd.create,Ilr=XC.create,Rlr=Zg.create,Llr=Pu.create,klr=Pu.strictCreate,$lr=uT.create,Mlr=yB.create,Flr=lT.create,jlr=xh.create,Vlr=vB.create,Ulr=JC.create,qlr=QC.create,Blr=bB.create,Hlr=pT.create,Glr=fT.create,zlr=dT.create,Klr=hT.create,Ylr=Rb.create,bUe=Bl.create,Wlr=Mp.create,Xlr=Ph.create,Jlr=Bl.createWithPreprocess,Qlr=ER.create,Zlr=()=>xUe().optional(),epr=()=>PUe().optional(),tpr=()=>DUe().optional(),rpr={string:t=>Nb.create({...t,coerce:!0}),number:t=>nT.create({...t,coerce:!0}),boolean:t=>aT.create({...t,coerce:!0}),bigint:t=>iT.create({...t,coerce:!0}),date:t=>oT.create({...t,coerce:!0})},npr=Wt,k=Object.freeze({__proto__:null,defaultErrorMap:YC,setErrorMap:nlr,getErrorMap:hB,makeIssue:mB,EMPTY_PATH:ilr,addIssueToContext:tt,ParseStatus:zs,INVALID:Wt,DIRTY:KC,OK:jc,isAborted:One,isDirty:Sne,isValid:yR,isAsync:vR,get util(){return gn},get objectUtil(){return Tne},ZodParsedType:ut,getParsedType:wb,ZodType:Or,datetimeRegex:SUe,ZodString:Nb,ZodNumber:nT,ZodBigInt:iT,ZodBoolean:aT,ZodDate:oT,ZodSymbol:WC,ZodUndefined:sT,ZodNull:cT,ZodAny:Ib,ZodUnknown:Qg,ZodNever:gd,ZodVoid:XC,ZodArray:Zg,ZodObject:Pu,ZodUnion:uT,ZodDiscriminatedUnion:yB,ZodIntersection:lT,ZodTuple:xh,ZodRecord:vB,ZodMap:JC,ZodSet:QC,ZodFunction:bB,ZodLazy:pT,ZodLiteral:fT,ZodEnum:dT,ZodNativeEnum:hT,ZodPromise:Rb,ZodEffects:Bl,ZodTransformer:Bl,ZodOptional:Mp,ZodNullable:Ph,ZodDefault:mT,ZodCatch:gT,ZodNaN:ZC,BRAND:Elr,ZodBranded:bR,ZodPipeline:ER,ZodReadonly:yT,custom:CUe,Schema:Or,ZodSchema:Or,late:_lr,get ZodFirstPartyTypeKind(){return Yt},coerce:rpr,any:Dlr,array:Rlr,bigint:Slr,boolean:DUe,date:Alr,discriminatedUnion:Mlr,effect:bUe,enum:zlr,function:Blr,instanceof:Tlr,intersection:Flr,lazy:Hlr,literal:Glr,map:Ulr,nan:Olr,nativeEnum:Klr,never:Nlr,null:Plr,nullable:Xlr,number:PUe,object:Llr,oboolean:tpr,onumber:epr,optional:Wlr,ostring:Zlr,pipeline:Qlr,preprocess:Jlr,promise:Ylr,record:Vlr,set:qlr,strictObject:klr,string:xUe,symbol:Clr,transformer:bUe,tuple:jlr,undefined:xlr,union:$lr,unknown:wlr,void:Ilr,NEVER:npr,ZodIssueCode:Me,quotelessJson:rlr,ZodError:ql});var Cne="2025-06-18";var wUe=[Cne,"2025-03-26","2024-11-05","2024-10-07"],EB="2.0",NUe=k.union([k.string(),k.number().int()]),IUe=k.string(),ipr=k.object({progressToken:k.optional(NUe)}).passthrough(),jp=k.object({_meta:k.optional(ipr)}).passthrough(),Du=k.object({method:k.string(),params:k.optional(jp)}),_R=k.object({_meta:k.optional(k.object({}).passthrough())}).passthrough(),Dh=k.object({method:k.string(),params:k.optional(_R)}),Vp=k.object({_meta:k.optional(k.object({}).passthrough())}).passthrough(),_B=k.union([k.string(),k.number().int()]),RUe=k.object({jsonrpc:k.literal(EB),id:_B}).merge(Du).strict(),LUe=t=>RUe.safeParse(t).success,kUe=k.object({jsonrpc:k.literal(EB)}).merge(Dh).strict(),$Ue=t=>kUe.safeParse(t).success,MUe=k.object({jsonrpc:k.literal(EB),id:_B,result:Vp}).strict(),xne=t=>MUe.safeParse(t).success,yd;(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"})(yd||(yd={}));var FUe=k.object({jsonrpc:k.literal(EB),id:_B,error:k.object({code:k.number().int(),message:k.string(),data:k.optional(k.unknown())})}).strict(),jUe=t=>FUe.safeParse(t).success,VUe=k.union([RUe,kUe,MUe,FUe]),TB=Vp.strict(),OB=Dh.extend({method:k.literal("notifications/cancelled"),params:_R.extend({requestId:_B,reason:k.string().optional()})}),TR=k.object({name:k.string(),title:k.optional(k.string())}).passthrough(),UUe=TR.extend({version:k.string()}),apr=k.object({experimental:k.optional(k.object({}).passthrough()),sampling:k.optional(k.object({}).passthrough()),elicitation:k.optional(k.object({}).passthrough()),roots:k.optional(k.object({listChanged:k.optional(k.boolean())}).passthrough())}).passthrough(),Pne=Du.extend({method:k.literal("initialize"),params:jp.extend({protocolVersion:k.string(),capabilities:apr,clientInfo:UUe})});var opr=k.object({experimental:k.optional(k.object({}).passthrough()),logging:k.optional(k.object({}).passthrough()),completions:k.optional(k.object({}).passthrough()),prompts:k.optional(k.object({listChanged:k.optional(k.boolean())}).passthrough()),resources:k.optional(k.object({subscribe:k.optional(k.boolean()),listChanged:k.optional(k.boolean())}).passthrough()),tools:k.optional(k.object({listChanged:k.optional(k.boolean())}).passthrough())}).passthrough(),spr=Vp.extend({protocolVersion:k.string(),capabilities:opr,serverInfo:UUe,instructions:k.optional(k.string())}),Dne=Dh.extend({method:k.literal("notifications/initialized")});var SB=Du.extend({method:k.literal("ping")}),cpr=k.object({progress:k.number(),total:k.optional(k.number()),message:k.optional(k.string())}).passthrough(),AB=Dh.extend({method:k.literal("notifications/progress"),params:_R.merge(cpr).extend({progressToken:NUe})}),CB=Du.extend({params:jp.extend({cursor:k.optional(IUe)}).optional()}),xB=Vp.extend({nextCursor:k.optional(IUe)}),qUe=k.object({uri:k.string(),mimeType:k.optional(k.string()),_meta:k.optional(k.object({}).passthrough())}).passthrough(),BUe=qUe.extend({text:k.string()}),wne=k.string().refine(t=>{try{return atob(t),!0}catch{return!1}},{message:"Invalid Base64 string"}),HUe=qUe.extend({blob:wne}),GUe=TR.extend({uri:k.string(),description:k.optional(k.string()),mimeType:k.optional(k.string()),_meta:k.optional(k.object({}).passthrough())}),upr=TR.extend({uriTemplate:k.string(),description:k.optional(k.string()),mimeType:k.optional(k.string()),_meta:k.optional(k.object({}).passthrough())}),lpr=CB.extend({method:k.literal("resources/list")}),ppr=xB.extend({resources:k.array(GUe)}),fpr=CB.extend({method:k.literal("resources/templates/list")}),dpr=xB.extend({resourceTemplates:k.array(upr)}),hpr=Du.extend({method:k.literal("resources/read"),params:jp.extend({uri:k.string()})}),mpr=Vp.extend({contents:k.array(k.union([BUe,HUe]))}),gpr=Dh.extend({method:k.literal("notifications/resources/list_changed")}),ypr=Du.extend({method:k.literal("resources/subscribe"),params:jp.extend({uri:k.string()})}),vpr=Du.extend({method:k.literal("resources/unsubscribe"),params:jp.extend({uri:k.string()})}),bpr=Dh.extend({method:k.literal("notifications/resources/updated"),params:_R.extend({uri:k.string()})}),Epr=k.object({name:k.string(),description:k.optional(k.string()),required:k.optional(k.boolean())}).passthrough(),_pr=TR.extend({description:k.optional(k.string()),arguments:k.optional(k.array(Epr)),_meta:k.optional(k.object({}).passthrough())}),Tpr=CB.extend({method:k.literal("prompts/list")}),Opr=xB.extend({prompts:k.array(_pr)}),Spr=Du.extend({method:k.literal("prompts/get"),params:jp.extend({name:k.string(),arguments:k.optional(k.record(k.string()))})}),Nne=k.object({type:k.literal("text"),text:k.string(),_meta:k.optional(k.object({}).passthrough())}).passthrough(),Ine=k.object({type:k.literal("image"),data:wne,mimeType:k.string(),_meta:k.optional(k.object({}).passthrough())}).passthrough(),Rne=k.object({type:k.literal("audio"),data:wne,mimeType:k.string(),_meta:k.optional(k.object({}).passthrough())}).passthrough(),Apr=k.object({type:k.literal("resource"),resource:k.union([BUe,HUe]),_meta:k.optional(k.object({}).passthrough())}).passthrough(),Cpr=GUe.extend({type:k.literal("resource_link")}),zUe=k.union([Nne,Ine,Rne,Cpr,Apr]),xpr=k.object({role:k.enum(["user","assistant"]),content:zUe}).passthrough(),Ppr=Vp.extend({description:k.optional(k.string()),messages:k.array(xpr)}),Dpr=Dh.extend({method:k.literal("notifications/prompts/list_changed")}),wpr=k.object({title:k.optional(k.string()),readOnlyHint:k.optional(k.boolean()),destructiveHint:k.optional(k.boolean()),idempotentHint:k.optional(k.boolean()),openWorldHint:k.optional(k.boolean())}).passthrough(),Npr=TR.extend({description:k.optional(k.string()),inputSchema:k.object({type:k.literal("object"),properties:k.optional(k.object({}).passthrough()),required:k.optional(k.array(k.string()))}).passthrough(),outputSchema:k.optional(k.object({type:k.literal("object"),properties:k.optional(k.object({}).passthrough()),required:k.optional(k.array(k.string()))}).passthrough()),annotations:k.optional(wpr),_meta:k.optional(k.object({}).passthrough())}),Lne=CB.extend({method:k.literal("tools/list")}),Ipr=xB.extend({tools:k.array(Npr)}),KUe=Vp.extend({content:k.array(zUe).default([]),structuredContent:k.object({}).passthrough().optional(),isError:k.optional(k.boolean())}),poi=KUe.or(Vp.extend({toolResult:k.unknown()})),kne=Du.extend({method:k.literal("tools/call"),params:jp.extend({name:k.string(),arguments:k.optional(k.record(k.unknown()))})}),Rpr=Dh.extend({method:k.literal("notifications/tools/list_changed")}),OR=k.enum(["debug","info","notice","warning","error","critical","alert","emergency"]),$ne=Du.extend({method:k.literal("logging/setLevel"),params:jp.extend({level:OR})}),Lpr=Dh.extend({method:k.literal("notifications/message"),params:_R.extend({level:OR,logger:k.optional(k.string()),data:k.unknown()})}),kpr=k.object({name:k.string().optional()}).passthrough(),$pr=k.object({hints:k.optional(k.array(kpr)),costPriority:k.optional(k.number().min(0).max(1)),speedPriority:k.optional(k.number().min(0).max(1)),intelligencePriority:k.optional(k.number().min(0).max(1))}).passthrough(),Mpr=k.object({role:k.enum(["user","assistant"]),content:k.union([Nne,Ine,Rne])}).passthrough(),Fpr=Du.extend({method:k.literal("sampling/createMessage"),params:jp.extend({messages:k.array(Mpr),systemPrompt:k.optional(k.string()),includeContext:k.optional(k.enum(["none","thisServer","allServers"])),temperature:k.optional(k.number()),maxTokens:k.number().int(),stopSequences:k.optional(k.array(k.string())),metadata:k.optional(k.object({}).passthrough()),modelPreferences:k.optional($pr)})}),Mne=Vp.extend({model:k.string(),stopReason:k.optional(k.enum(["endTurn","stopSequence","maxTokens"]).or(k.string())),role:k.enum(["user","assistant"]),content:k.discriminatedUnion("type",[Nne,Ine,Rne])}),jpr=k.object({type:k.literal("boolean"),title:k.optional(k.string()),description:k.optional(k.string()),default:k.optional(k.boolean())}).passthrough(),Vpr=k.object({type:k.literal("string"),title:k.optional(k.string()),description:k.optional(k.string()),minLength:k.optional(k.number()),maxLength:k.optional(k.number()),format:k.optional(k.enum(["email","uri","date","date-time"]))}).passthrough(),Upr=k.object({type:k.enum(["number","integer"]),title:k.optional(k.string()),description:k.optional(k.string()),minimum:k.optional(k.number()),maximum:k.optional(k.number())}).passthrough(),qpr=k.object({type:k.literal("string"),title:k.optional(k.string()),description:k.optional(k.string()),enum:k.array(k.string()),enumNames:k.optional(k.array(k.string()))}).passthrough(),Bpr=k.union([jpr,Vpr,Upr,qpr]),Hpr=Du.extend({method:k.literal("elicitation/create"),params:jp.extend({message:k.string(),requestedSchema:k.object({type:k.literal("object"),properties:k.record(k.string(),Bpr),required:k.optional(k.array(k.string()))}).passthrough()})}),Fne=Vp.extend({action:k.enum(["accept","decline","cancel"]),content:k.optional(k.record(k.string(),k.unknown()))}),Gpr=k.object({type:k.literal("ref/resource"),uri:k.string()}).passthrough();var zpr=k.object({type:k.literal("ref/prompt"),name:k.string()}).passthrough(),Kpr=Du.extend({method:k.literal("completion/complete"),params:jp.extend({ref:k.union([zpr,Gpr]),argument:k.object({name:k.string(),value:k.string()}).passthrough(),context:k.optional(k.object({arguments:k.optional(k.record(k.string(),k.string()))}))})}),Ypr=Vp.extend({completion:k.object({values:k.array(k.string()).max(100),total:k.optional(k.number().int()),hasMore:k.optional(k.boolean())}).passthrough()}),Wpr=k.object({uri:k.string().startsWith("file://"),name:k.optional(k.string()),_meta:k.optional(k.object({}).passthrough())}).passthrough(),Xpr=Du.extend({method:k.literal("roots/list")}),jne=Vp.extend({roots:k.array(Wpr)}),Jpr=Dh.extend({method:k.literal("notifications/roots/list_changed")}),foi=k.union([SB,Pne,Kpr,$ne,Spr,Tpr,lpr,fpr,hpr,ypr,vpr,kne,Lne]),doi=k.union([OB,AB,Dne,Jpr]),hoi=k.union([TB,Mne,Fne,jne]),moi=k.union([SB,Fpr,Hpr,Xpr]),goi=k.union([OB,AB,Lpr,bpr,gpr,Rpr,Dpr]),yoi=k.union([TB,spr,Ypr,Ppr,Opr,ppr,dpr,mpr,KUe,Ipr]),vd=class extends Error{constructor(e,r,n){super(`MCP error ${e}: ${r}`),this.code=e,this.data=n,this.name="McpError"}};var Qpr=6e4,PB=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(OB,r=>{let n=this._requestHandlerAbortControllers.get(r.params.requestId);n?.abort(r.params.reason)}),this.setNotificationHandler(AB,r=>{this._onprogress(r)}),this.setRequestHandler(SB,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 vd(yd.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),xne(c)||jUe(c)?this._onresponse(c):LUe(c)?this._onrequest(c,u):$Ue(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 vd(yd.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:yd.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:yd.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),xne(e))n(e);else{let i=new vd(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,d,f,h;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 _=A=>{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(A)}},{relatedRequestId:i,resumptionToken:a,onresumptiontoken:o}).catch(P=>this._onerror(new Error(`Failed to send cancellation: ${P}`))),c(A)};this._responseHandlers.set(m,A=>{var C;if(!(!((C=n?.signal)===null||C===void 0)&&C.aborted)){if(A instanceof Error)return c(A);try{let P=r.parse(A.result);s(P)}catch(P){c(P)}}}),(d=n?.signal)===null||d===void 0||d.addEventListener("abort",()=>{var A;_((A=n?.signal)===null||A===void 0?void 0:A.reason)});let T=(f=n?.timeout)!==null&&f!==void 0?f:Qpr,O=()=>_(new vd(yd.RequestTimeout,"Request timed out",{timeout:T}));this._setupTimeout(m,T,n?.maxTotalTimeout,O,(h=n?.resetTimeoutOnProgress)!==null&&h!==void 0?h:!1),this._transport.send(v,{relatedRequestId:i,resumptionToken:a,onresumptiontoken:o}).catch(A=>{this._cleanupTimeout(m),c(A)})})}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 YUe(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 XBe=Tt(WBe(),1),zB=class extends PB{constructor(e,r){var n;super(r),this._serverInfo=e,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(OR.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(Pne,i=>this._oninitialize(i)),this.setNotificationHandler(Dne,()=>{var i;return(i=this.oninitialized)===null||i===void 0?void 0:i.call(this)}),this._capabilities.logging&&this.setRequestHandler($ne,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=OR.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=YUe(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:wUe.includes(r)?r:Cne,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"},TB)}async createMessage(e,r){return this.request({method:"sampling/createMessage",params:e},Mne,r)}async elicitInput(e,r){let n=await this.request({method:"elicitation/create",params:e},Fne,r);if(n.action==="accept"&&n.content)try{let i=new XBe.default,a=i.compile(e.requestedSchema);if(!a(n.content))throw new vd(yd.InvalidParams,`Elicitation response content does not match requested schema: ${i.errorsText(a.errors)}`)}catch(i){throw i instanceof vd?i:new vd(yd.InternalError,`Error validating elicitation response: ${i}`)}return n}async listRoots(e,r){return this.request({method:"roots/list",params:e},jne,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 lie=Tt(require("node:process"),1);var KB=class{append(e){this._buffer=this._buffer?Buffer.concat([this._buffer,e]):e}readMessage(){if(!this._buffer)return null;let e=this._buffer.indexOf(`
1577
1577
  `);if(e===-1)return null;let r=this._buffer.toString("utf8",0,e).replace(/\r$/,"");return this._buffer=this._buffer.subarray(e+1),Ndr(r)}clear(){this._buffer=void 0}};function Ndr(t){return VUe.parse(JSON.parse(t))}function JBe(t){return JSON.stringify(t)+`
1578
- `}var YB=class{constructor(e=lie.default.stdin,r=lie.default.stdout){this._stdin=e,this._stdout=r,this._readBuffer=new KB,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=JBe(e);this._stdout.write(n)?r():this._stdout.once("drain",r)})}};var ZBe="0.4.4";var AR={name:"@sap-ux/fiori-mcp-server",description:"SAP Fiori - Model Context Protocol (MCP) server",version:ZBe,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 --external:@sap-ux/store --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",start:'npx -y supergateway --port 9881 --sessionTimeout 300000 --stdio "node ./dist/index.js"',"view:integration":"promptfoo view -y","test:integration:once":"promptfoo eval --config test/integration/scenarios/promptfooconfig.yaml --max-concurrency 1 --repeat 1 --output reports/integration.txt","test:integration:dev":"promptfoo eval --config test/integration/scenarios/test-dev.yaml --max-concurrency 1 --repeat 1 --output reports/integration.txt","test:integration:multiple":"npm run test:promptfoo -- --repeat 5"},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/axios-extension":"workspace:*","@sap/ux-specification":"1.136.6","@sap-ux/project-access":"workspace:*","@sap-ux/fiori-annotation-api":"workspace:*","@sap-ux/annotation-converter":"0.10.8","@sap-ux/fiori-docs-embeddings":"workspace:*","@sap-ux/i18n":"workspace:*","@sap-ux/logger":"workspace:*","@sap-ux/store":"workspace:*","@sap-ux/odata-annotation-core-types":"workspace:*","@sap-ux/odata-entity-model":"workspace:*","@sap-ux/text-document-utils":"workspace:*","@types/diff":"5.0.9","@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","@sap-ai-sdk/foundation-models":"2.0.0","@sap-ai-sdk/langchain":"2.0.0",promptfoo:"0.118.6","@langchain/mcp-adapters":"0.6.0","@langchain/core":"0.3.75"},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 yx={};Ri(yx,{$brand:()=>fie,$input:()=>Doe,$output:()=>Poe,NEVER:()=>pie,TimePrecision:()=>Ioe,ZodAny:()=>T4e,ZodArray:()=>C4e,ZodBase64:()=>Wse,ZodBase64URL:()=>Xse,ZodBigInt:()=>uL,ZodBigIntFormat:()=>Zse,ZodBoolean:()=>cL,ZodCIDRv4:()=>Kse,ZodCIDRv6:()=>Yse,ZodCUID:()=>Vse,ZodCUID2:()=>Use,ZodCatch:()=>H4e,ZodCodec:()=>sce,ZodCustom:()=>e4,ZodCustomStringFormat:()=>oL,ZodDate:()=>Q3,ZodDefault:()=>F4e,ZodDiscriminatedUnion:()=>x4e,ZodE164:()=>Jse,ZodEmail:()=>$se,ZodEmoji:()=>Fse,ZodEnum:()=>iL,ZodError:()=>_se,ZodFile:()=>k4e,ZodFirstPartyTypeKind:()=>cce,ZodFunction:()=>Z4e,ZodGUID:()=>z3,ZodIPv4:()=>Gse,ZodIPv6:()=>zse,ZodISODate:()=>q3,ZodISODateTime:()=>U3,ZodISODuration:()=>H3,ZodISOTime:()=>B3,ZodIntersection:()=>P4e,ZodIssueCode:()=>syr,ZodJWT:()=>Qse,ZodKSUID:()=>Hse,ZodLazy:()=>X4e,ZodLiteral:()=>L4e,ZodMap:()=>I4e,ZodNaN:()=>z4e,ZodNanoID:()=>jse,ZodNever:()=>S4e,ZodNonOptional:()=>ace,ZodNull:()=>E4e,ZodNullable:()=>M4e,ZodNumber:()=>sL,ZodNumberFormat:()=>hx,ZodObject:()=>Z3,ZodOptional:()=>ice,ZodPipe:()=>oce,ZodPrefault:()=>V4e,ZodPromise:()=>Q4e,ZodReadonly:()=>K4e,ZodRealError:()=>Iu,ZodRecord:()=>rce,ZodSet:()=>R4e,ZodString:()=>aL,ZodStringFormat:()=>vi,ZodSuccess:()=>B4e,ZodSymbol:()=>v4e,ZodTemplateLiteral:()=>W4e,ZodTransform:()=>$4e,ZodTuple:()=>w4e,ZodType:()=>Nr,ZodULID:()=>qse,ZodURL:()=>W3,ZodUUID:()=>iy,ZodUndefined:()=>b4e,ZodUnion:()=>tce,ZodUnknown:()=>O4e,ZodVoid:()=>A4e,ZodXID:()=>Bse,_ZodString:()=>kse,_default:()=>j4e,_function:()=>eyr,any:()=>J3,array:()=>Uc,base64:()=>Egr,base64url:()=>_gr,bigint:()=>Igr,boolean:()=>AT,catch:()=>G4e,check:()=>tyr,cidrv4:()=>vgr,cidrv6:()=>bgr,clone:()=>Vc,codec:()=>Jgr,coerce:()=>uce,config:()=>ro,core:()=>ny,cuid:()=>pgr,cuid2:()=>fgr,custom:()=>ryr,date:()=>Fgr,decode:()=>xse,decodeAsync:()=>Dse,discriminatedUnion:()=>qgr,e164:()=>Tgr,email:()=>rgr,emoji:()=>ugr,encode:()=>Cse,encodeAsync:()=>Pse,endsWith:()=>XR,enum:()=>qc,file:()=>Kgr,flattenError:()=>LR,float32:()=>Pgr,float64:()=>Dgr,formatError:()=>kR,function:()=>eyr,getErrorMap:()=>uyr,globalRegistry:()=>Nh,gt:()=>ty,gte:()=>Nu,guid:()=>ngr,hash:()=>xgr,hex:()=>Cgr,hostname:()=>Agr,httpUrl:()=>cgr,includes:()=>YR,instanceof:()=>nyr,int:()=>Lse,int32:()=>wgr,int64:()=>Rgr,intersection:()=>D4e,ipv4:()=>ggr,ipv6:()=>ygr,iso:()=>G3,json:()=>ayr,jwt:()=>Ogr,keyof:()=>jgr,ksuid:()=>mgr,lazy:()=>J4e,length:()=>fx,literal:()=>gx,locales:()=>UR,looseObject:()=>Ugr,lowercase:()=>zR,lt:()=>ey,lte:()=>qp,map:()=>Hgr,maxLength:()=>px,maxSize:()=>lx,mime:()=>JR,minLength:()=>Bb,minSize:()=>ST,multipleOf:()=>OT,nan:()=>Xgr,nanoid:()=>lgr,nativeEnum:()=>zgr,negative:()=>sse,never:()=>ece,nonnegative:()=>use,nonoptional:()=>q4e,nonpositive:()=>cse,normalize:()=>QR,null:()=>_4e,nullable:()=>K3,nullish:()=>Ygr,number:()=>X3,object:()=>Xn,optional:()=>ay,overwrite:()=>ry,parse:()=>Tse,parseAsync:()=>Ose,partialRecord:()=>Bgr,pipe:()=>Y3,positive:()=>ose,prefault:()=>U4e,preprocess:()=>oyr,prettifyError:()=>Oie,promise:()=>Zgr,property:()=>lse,readonly:()=>Y4e,record:()=>mx,refine:()=>e5e,regex:()=>GR,regexes:()=>Up,registry:()=>E3,safeDecode:()=>Nse,safeDecodeAsync:()=>Rse,safeEncode:()=>wse,safeEncodeAsync:()=>Ise,safeParse:()=>Sse,safeParseAsync:()=>Ase,set:()=>Ggr,setErrorMap:()=>cyr,size:()=>HR,startsWith:()=>WR,strictObject:()=>Vgr,string:()=>qt,stringFormat:()=>Sgr,stringbool:()=>iyr,success:()=>Wgr,superRefine:()=>t5e,symbol:()=>kgr,templateLiteral:()=>Qgr,toJSONSchema:()=>nL,toLowerCase:()=>eL,toUpperCase:()=>tL,transform:()=>nce,treeifyError:()=>Tie,trim:()=>ZR,tuple:()=>N4e,uint32:()=>Ngr,uint64:()=>Lgr,ulid:()=>dgr,undefined:()=>$gr,union:()=>Rh,unknown:()=>Ih,uppercase:()=>KR,url:()=>Mse,util:()=>Fe,uuid:()=>igr,uuidv4:()=>agr,uuidv6:()=>ogr,uuidv7:()=>sgr,void:()=>Mgr,xid:()=>hgr});var ny={};Ri(ny,{$ZodAny:()=>Jae,$ZodArray:()=>roe,$ZodAsyncError:()=>bd,$ZodBase64:()=>Uae,$ZodBase64URL:()=>qae,$ZodBigInt:()=>g3,$ZodBigIntFormat:()=>Kae,$ZodBoolean:()=>jR,$ZodCIDRv4:()=>Fae,$ZodCIDRv6:()=>jae,$ZodCUID:()=>xae,$ZodCUID2:()=>Pae,$ZodCatch:()=>boe,$ZodCheck:()=>Li,$ZodCheckBigIntFormat:()=>nae,$ZodCheckEndsWith:()=>mae,$ZodCheckGreaterThan:()=>u3,$ZodCheckIncludes:()=>dae,$ZodCheckLengthEquals:()=>uae,$ZodCheckLessThan:()=>c3,$ZodCheckLowerCase:()=>pae,$ZodCheckMaxLength:()=>sae,$ZodCheckMaxSize:()=>iae,$ZodCheckMimeType:()=>yae,$ZodCheckMinLength:()=>cae,$ZodCheckMinSize:()=>aae,$ZodCheckMultipleOf:()=>tae,$ZodCheckNumberFormat:()=>rae,$ZodCheckOverwrite:()=>vae,$ZodCheckProperty:()=>gae,$ZodCheckRegex:()=>lae,$ZodCheckSizeEquals:()=>oae,$ZodCheckStartsWith:()=>hae,$ZodCheckStringFormat:()=>cx,$ZodCheckUpperCase:()=>fae,$ZodCodec:()=>VR,$ZodCustom:()=>xoe,$ZodCustomStringFormat:()=>Gae,$ZodDate:()=>toe,$ZodDefault:()=>moe,$ZodDiscriminatedUnion:()=>ioe,$ZodE164:()=>Bae,$ZodEmail:()=>Oae,$ZodEmoji:()=>Aae,$ZodEncodeError:()=>Mb,$ZodEnum:()=>uoe,$ZodError:()=>RR,$ZodFile:()=>poe,$ZodFunction:()=>Soe,$ZodGUID:()=>_ae,$ZodIPv4:()=>$ae,$ZodIPv6:()=>Mae,$ZodISODate:()=>Rae,$ZodISODateTime:()=>Iae,$ZodISODuration:()=>kae,$ZodISOTime:()=>Lae,$ZodIntersection:()=>aoe,$ZodJWT:()=>Hae,$ZodKSUID:()=>Nae,$ZodLazy:()=>Coe,$ZodLiteral:()=>loe,$ZodMap:()=>soe,$ZodNaN:()=>Eoe,$ZodNanoID:()=>Cae,$ZodNever:()=>Zae,$ZodNonOptional:()=>yoe,$ZodNull:()=>Xae,$ZodNullable:()=>hoe,$ZodNumber:()=>m3,$ZodNumberFormat:()=>zae,$ZodObject:()=>S3e,$ZodObjectJIT:()=>noe,$ZodOptional:()=>doe,$ZodPipe:()=>_oe,$ZodPrefault:()=>goe,$ZodPromise:()=>Aoe,$ZodReadonly:()=>Toe,$ZodRealError:()=>wu,$ZodRecord:()=>ooe,$ZodRegistry:()=>ux,$ZodSet:()=>coe,$ZodString:()=>TT,$ZodStringFormat:()=>li,$ZodSuccess:()=>voe,$ZodSymbol:()=>Yae,$ZodTemplateLiteral:()=>Ooe,$ZodTransform:()=>foe,$ZodTuple:()=>v3,$ZodType:()=>ir,$ZodULID:()=>Dae,$ZodURL:()=>Sae,$ZodUUID:()=>Tae,$ZodUndefined:()=>Wae,$ZodUnion:()=>y3,$ZodUnknown:()=>Qae,$ZodVoid:()=>eoe,$ZodXID:()=>wae,$brand:()=>fie,$constructor:()=>ue,$input:()=>Doe,$output:()=>Poe,Doc:()=>FR,JSONSchema:()=>m4e,JSONSchemaGenerator:()=>rL,NEVER:()=>pie,TimePrecision:()=>Ioe,_any:()=>Zoe,_array:()=>pse,_base64:()=>M3,_base64url:()=>F3,_bigint:()=>zoe,_boolean:()=>Hoe,_catch:()=>Ymr,_check:()=>h4e,_cidrv4:()=>k3,_cidrv6:()=>$3,_coercedBigint:()=>Koe,_coercedBoolean:()=>Goe,_coercedDate:()=>ise,_coercedNumber:()=>Foe,_coercedString:()=>Noe,_cuid:()=>P3,_cuid2:()=>D3,_custom:()=>dse,_date:()=>nse,_decode:()=>e3,_decodeAsync:()=>r3,_default:()=>Gmr,_discriminatedUnion:()=>Rmr,_e164:()=>j3,_email:()=>_3,_emoji:()=>C3,_encode:()=>ZB,_encodeAsync:()=>t3,_endsWith:()=>XR,_enum:()=>jmr,_file:()=>fse,_float32:()=>Voe,_float64:()=>Uoe,_gt:()=>ty,_gte:()=>Nu,_guid:()=>qR,_includes:()=>YR,_int:()=>joe,_int32:()=>qoe,_int64:()=>Yoe,_intersection:()=>Lmr,_ipv4:()=>R3,_ipv6:()=>L3,_isoDate:()=>Loe,_isoDateTime:()=>Roe,_isoDuration:()=>$oe,_isoTime:()=>koe,_jwt:()=>V3,_ksuid:()=>I3,_lazy:()=>Qmr,_length:()=>fx,_literal:()=>Umr,_lowercase:()=>zR,_lt:()=>ey,_lte:()=>qp,_map:()=>Mmr,_max:()=>qp,_maxLength:()=>px,_maxSize:()=>lx,_mime:()=>JR,_min:()=>Nu,_minLength:()=>Bb,_minSize:()=>ST,_multipleOf:()=>OT,_nan:()=>ase,_nanoid:()=>x3,_nativeEnum:()=>Vmr,_negative:()=>sse,_never:()=>tse,_nonnegative:()=>use,_nonoptional:()=>zmr,_nonpositive:()=>cse,_normalize:()=>QR,_null:()=>Qoe,_nullable:()=>Hmr,_number:()=>Moe,_optional:()=>Bmr,_overwrite:()=>ry,_parse:()=>ix,_parseAsync:()=>ax,_pipe:()=>Wmr,_positive:()=>ose,_promise:()=>Zmr,_property:()=>lse,_readonly:()=>Xmr,_record:()=>$mr,_refine:()=>hse,_regex:()=>GR,_safeDecode:()=>i3,_safeDecodeAsync:()=>o3,_safeEncode:()=>n3,_safeEncodeAsync:()=>a3,_safeParse:()=>ox,_safeParseAsync:()=>sx,_set:()=>Fmr,_size:()=>HR,_startsWith:()=>WR,_string:()=>woe,_stringFormat:()=>dx,_stringbool:()=>gse,_success:()=>Kmr,_superRefine:()=>mse,_symbol:()=>Xoe,_templateLiteral:()=>Jmr,_toLowerCase:()=>eL,_toUpperCase:()=>tL,_transform:()=>qmr,_trim:()=>ZR,_tuple:()=>kmr,_uint32:()=>Boe,_uint64:()=>Woe,_ulid:()=>w3,_undefined:()=>Joe,_union:()=>Imr,_unknown:()=>ese,_uppercase:()=>KR,_url:()=>BR,_uuid:()=>T3,_uuidv4:()=>O3,_uuidv6:()=>S3,_uuidv7:()=>A3,_void:()=>rse,_xid:()=>N3,clone:()=>Vc,config:()=>ro,decode:()=>ahr,decodeAsync:()=>shr,encode:()=>ihr,encodeAsync:()=>ohr,flattenError:()=>LR,formatError:()=>kR,globalConfig:()=>CR,globalRegistry:()=>Nh,isValidBase64:()=>Vae,isValidBase64URL:()=>E3e,isValidJWT:()=>_3e,locales:()=>UR,parse:()=>JB,parseAsync:()=>QB,prettifyError:()=>Oie,regexes:()=>Up,registry:()=>E3,safeDecode:()=>uhr,safeDecodeAsync:()=>phr,safeEncode:()=>chr,safeEncodeAsync:()=>lhr,safeParse:()=>Sie,safeParseAsync:()=>Aie,toDotPath:()=>i3e,toJSONSchema:()=>nL,treeifyError:()=>Tie,util:()=>Fe,version:()=>bae});var pie=Object.freeze({status:"aborted"});function ue(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 fie=Symbol("zod_brand"),bd=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Mb=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}},CR={};function ro(t){return t&&Object.assign(CR,t),CR}var Fe={};Ri(Fe,{BIGINT_FORMAT_RANGES:()=>_ie,Class:()=>hie,NUMBER_FORMAT_RANGES:()=>Eie,aborted:()=>qb,allowsEval:()=>gie,assert:()=>$dr,assertEqual:()=>Idr,assertIs:()=>Ldr,assertNever:()=>kdr,assertNotEqual:()=>Rdr,assignProp:()=>jb,base64ToUint8Array:()=>t3e,base64urlToUint8Array:()=>Zdr,cached:()=>rx,captureStackTrace:()=>XB,cleanEnum:()=>Qdr,cleanRegex:()=>DR,clone:()=>Vc,cloneDef:()=>Fdr,createTransparentProxy:()=>Hdr,defineLazy:()=>Yr,esc:()=>WB,escapeRegex:()=>wh,extend:()=>Kdr,finalizeIssue:()=>Gl,floatSafeRemainder:()=>mie,getElementAtPath:()=>jdr,getEnumValues:()=>PR,getLengthableOrigin:()=>IR,getParsedType:()=>Bdr,getSizableOrigin:()=>NR,hexToUint8Array:()=>thr,isObject:()=>ET,isPlainObject:()=>Ub,issue:()=>nx,joinValues:()=>_e,jsonStringifyReplacer:()=>tx,merge:()=>Wdr,mergeDefs:()=>Vb,normalizeParams:()=>Be,nullish:()=>Fb,numKeys:()=>qdr,objectClone:()=>Mdr,omit:()=>zdr,optionalKeys:()=>bie,partial:()=>Xdr,pick:()=>Gdr,prefixIssues:()=>Hl,primitiveTypes:()=>vie,promiseAllObject:()=>Vdr,propertyKeyTypes:()=>wR,randomString:()=>Udr,required:()=>Jdr,safeExtend:()=>Ydr,shallowClone:()=>yie,stringifyPrimitive:()=>ze,uint8ArrayToBase64:()=>r3e,uint8ArrayToBase64url:()=>ehr,uint8ArrayToHex:()=>rhr,unwrapMessage:()=>xR});function Idr(t){return t}function Rdr(t){return t}function Ldr(t){}function kdr(t){throw new Error}function $dr(t){}function PR(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 _e(t,e="|"){return t.map(r=>ze(r)).join(e)}function tx(t,e){return typeof e=="bigint"?e.toString():e}function rx(t){return{get value(){{let r=t();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function Fb(t){return t==null}function DR(t){let e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}function mie(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 e3e=Symbol("evaluating");function Yr(t,e,r){let n;Object.defineProperty(t,e,{get(){if(n!==e3e)return n===void 0&&(n=e3e,n=r()),n},set(i){Object.defineProperty(t,e,{value:i})},configurable:!0})}function Mdr(t){return Object.create(Object.getPrototypeOf(t),Object.getOwnPropertyDescriptors(t))}function jb(t,e,r){Object.defineProperty(t,e,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Vb(...t){let e={};for(let r of t){let n=Object.getOwnPropertyDescriptors(r);Object.assign(e,n)}return Object.defineProperties({},e)}function Fdr(t){return Vb(t._zod.def)}function jdr(t,e){return e?e.reduce((r,n)=>r?.[n],t):t}function Vdr(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 Udr(t=10){let e="abcdefghijklmnopqrstuvwxyz",r="";for(let n=0;n<t;n++)r+=e[Math.floor(Math.random()*e.length)];return r}function WB(t){return JSON.stringify(t)}var XB="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function ET(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}var gie=rx(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let t=Function;return new t(""),!0}catch{return!1}});function Ub(t){if(ET(t)===!1)return!1;let e=t.constructor;if(e===void 0)return!0;let r=e.prototype;return!(ET(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function yie(t){return Ub(t)?{...t}:t}function qdr(t){let e=0;for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&e++;return e}var Bdr=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}`)}},wR=new Set(["string","number","symbol"]),vie=new Set(["string","number","bigint","boolean","symbol","undefined"]);function wh(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Vc(t,e,r){let n=new t._zod.constr(e??t._zod.def);return(!e||r?.parent)&&(n._zod.parent=t),n}function Be(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 Hdr(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 ze(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}function bie(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}var Eie={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]},_ie={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Gdr(t,e){let r=t._zod.def,n=Vb(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 jb(this,"shape",i),i},checks:[]});return Vc(t,n)}function zdr(t,e){let r=t._zod.def,n=Vb(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 jb(this,"shape",i),i},checks:[]});return Vc(t,n)}function Kdr(t,e){if(!Ub(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=Vb(t._zod.def,{get shape(){let a={...t._zod.def.shape,...e};return jb(this,"shape",a),a},checks:[]});return Vc(t,i)}function Ydr(t,e){if(!Ub(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 jb(this,"shape",n),n},checks:t._zod.def.checks};return Vc(t,r)}function Wdr(t,e){let r=Vb(t._zod.def,{get shape(){let n={...t._zod.def.shape,...e._zod.def.shape};return jb(this,"shape",n),n},get catchall(){return e._zod.def.catchall},checks:[]});return Vc(t,r)}function Xdr(t,e,r){let n=Vb(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 jb(this,"shape",a),a},checks:[]});return Vc(e,n)}function Jdr(t,e,r){let n=Vb(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 jb(this,"shape",a),a},checks:[]});return Vc(e,n)}function qb(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 Hl(t,e){return e.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(t),r})}function xR(t){return typeof t=="string"?t:t?.message}function Gl(t,e,r){let n={...t,path:t.path??[]};if(!t.message){let i=xR(t.inst?._zod.def?.error?.(t))??xR(e?.error?.(t))??xR(r.customError?.(t))??xR(r.localeError?.(t))??"Invalid input";n.message=i}return delete n.inst,delete n.continue,e?.reportInput||delete n.input,n}function NR(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}function IR(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function nx(...t){let[e,r,n]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:n}:{...e}}function Qdr(t){return Object.entries(t).filter(([e,r])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function t3e(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 r3e(t){let e="";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return btoa(e)}function Zdr(t){let e=t.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-e.length%4)%4);return t3e(e+r)}function ehr(t){return r3e(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function thr(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 rhr(t){return Array.from(t).map(e=>e.toString(16).padStart(2,"0")).join("")}var hie=class{constructor(...e){}};var n3e=(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,tx,2),Object.defineProperty(t,"toString",{value:()=>t.message,enumerable:!1})},RR=ue("$ZodError",n3e),wu=ue("$ZodError",n3e,{Parent:Error});function LR(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 kR(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}function Tie(t,e){let r=e||function(a){return a.message},n={errors:[]},i=(a,o=[])=>{var s,c;for(let u of a.issues)if(u.code==="invalid_union"&&u.errors.length)u.errors.map(l=>i({issues:l},u.path));else if(u.code==="invalid_key")i({issues:u.issues},u.path);else if(u.code==="invalid_element")i({issues:u.issues},u.path);else{let l=[...o,...u.path];if(l.length===0){n.errors.push(r(u));continue}let p=n,d=0;for(;d<l.length;){let f=l[d],h=d===l.length-1;typeof f=="string"?(p.properties??(p.properties={}),(s=p.properties)[f]??(s[f]={errors:[]}),p=p.properties[f]):(p.items??(p.items=[]),(c=p.items)[f]??(c[f]={errors:[]}),p=p.items[f]),h&&p.errors.push(r(u)),d++}}};return i(t),n}function i3e(t){let e=[],r=t.map(n=>typeof n=="object"?n.key:n);for(let n of r)typeof n=="number"?e.push(`[${n}]`):typeof n=="symbol"?e.push(`[${JSON.stringify(String(n))}]`):/[^\w$]/.test(n)?e.push(`[${JSON.stringify(n)}]`):(e.length&&e.push("."),e.push(n));return e.join("")}function Oie(t){let e=[],r=[...t.issues].sort((n,i)=>(n.path??[]).length-(i.path??[]).length);for(let n of r)e.push(`\u2716 ${n.message}`),n.path?.length&&e.push(` \u2192 at ${i3e(n.path)}`);return e.join(`
1578
+ `}var YB=class{constructor(e=lie.default.stdin,r=lie.default.stdout){this._stdin=e,this._stdout=r,this._readBuffer=new KB,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=JBe(e);this._stdout.write(n)?r():this._stdout.once("drain",r)})}};var ZBe="0.4.5";var AR={name:"@sap-ux/fiori-mcp-server",description:"SAP Fiori - Model Context Protocol (MCP) server",version:ZBe,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 --external:@sap-ux/store --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",start:'npx -y supergateway --port 9881 --sessionTimeout 300000 --stdio "node ./dist/index.js"',"view:integration":"promptfoo view -y","test:integration:once":"promptfoo eval --config test/integration/scenarios/promptfooconfig.yaml --max-concurrency 1 --repeat 1 --output reports/integration.txt","test:integration:dev":"promptfoo eval --config test/integration/scenarios/test-dev.yaml --max-concurrency 1 --repeat 1 --output reports/integration.txt","test:integration:multiple":"npm run test:promptfoo -- --repeat 5"},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/axios-extension":"workspace:*","@sap/ux-specification":"1.136.6","@sap-ux/project-access":"workspace:*","@sap-ux/fiori-annotation-api":"workspace:*","@sap-ux/annotation-converter":"0.10.8","@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/diff":"5.0.9","@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","@sap-ai-sdk/foundation-models":"2.0.0","@sap-ai-sdk/langchain":"2.0.0",promptfoo:"0.118.6","@langchain/mcp-adapters":"0.6.0","@langchain/core":"0.3.75"},dependencies:{"@sap-ux/fiori-docs-embeddings":"*","@sap-ux/store":"workspace:*","@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 yx={};Ri(yx,{$brand:()=>fie,$input:()=>Doe,$output:()=>Poe,NEVER:()=>pie,TimePrecision:()=>Ioe,ZodAny:()=>T4e,ZodArray:()=>C4e,ZodBase64:()=>Wse,ZodBase64URL:()=>Xse,ZodBigInt:()=>uL,ZodBigIntFormat:()=>Zse,ZodBoolean:()=>cL,ZodCIDRv4:()=>Kse,ZodCIDRv6:()=>Yse,ZodCUID:()=>Vse,ZodCUID2:()=>Use,ZodCatch:()=>H4e,ZodCodec:()=>sce,ZodCustom:()=>e4,ZodCustomStringFormat:()=>oL,ZodDate:()=>Q3,ZodDefault:()=>F4e,ZodDiscriminatedUnion:()=>x4e,ZodE164:()=>Jse,ZodEmail:()=>$se,ZodEmoji:()=>Fse,ZodEnum:()=>iL,ZodError:()=>_se,ZodFile:()=>k4e,ZodFirstPartyTypeKind:()=>cce,ZodFunction:()=>Z4e,ZodGUID:()=>z3,ZodIPv4:()=>Gse,ZodIPv6:()=>zse,ZodISODate:()=>q3,ZodISODateTime:()=>U3,ZodISODuration:()=>H3,ZodISOTime:()=>B3,ZodIntersection:()=>P4e,ZodIssueCode:()=>syr,ZodJWT:()=>Qse,ZodKSUID:()=>Hse,ZodLazy:()=>X4e,ZodLiteral:()=>L4e,ZodMap:()=>I4e,ZodNaN:()=>z4e,ZodNanoID:()=>jse,ZodNever:()=>S4e,ZodNonOptional:()=>ace,ZodNull:()=>E4e,ZodNullable:()=>M4e,ZodNumber:()=>sL,ZodNumberFormat:()=>hx,ZodObject:()=>Z3,ZodOptional:()=>ice,ZodPipe:()=>oce,ZodPrefault:()=>V4e,ZodPromise:()=>Q4e,ZodReadonly:()=>K4e,ZodRealError:()=>Iu,ZodRecord:()=>rce,ZodSet:()=>R4e,ZodString:()=>aL,ZodStringFormat:()=>vi,ZodSuccess:()=>B4e,ZodSymbol:()=>v4e,ZodTemplateLiteral:()=>W4e,ZodTransform:()=>$4e,ZodTuple:()=>w4e,ZodType:()=>Nr,ZodULID:()=>qse,ZodURL:()=>W3,ZodUUID:()=>iy,ZodUndefined:()=>b4e,ZodUnion:()=>tce,ZodUnknown:()=>O4e,ZodVoid:()=>A4e,ZodXID:()=>Bse,_ZodString:()=>kse,_default:()=>j4e,_function:()=>eyr,any:()=>J3,array:()=>Uc,base64:()=>Egr,base64url:()=>_gr,bigint:()=>Igr,boolean:()=>AT,catch:()=>G4e,check:()=>tyr,cidrv4:()=>vgr,cidrv6:()=>bgr,clone:()=>Vc,codec:()=>Jgr,coerce:()=>uce,config:()=>ro,core:()=>ny,cuid:()=>pgr,cuid2:()=>fgr,custom:()=>ryr,date:()=>Fgr,decode:()=>xse,decodeAsync:()=>Dse,discriminatedUnion:()=>qgr,e164:()=>Tgr,email:()=>rgr,emoji:()=>ugr,encode:()=>Cse,encodeAsync:()=>Pse,endsWith:()=>XR,enum:()=>qc,file:()=>Kgr,flattenError:()=>LR,float32:()=>Pgr,float64:()=>Dgr,formatError:()=>kR,function:()=>eyr,getErrorMap:()=>uyr,globalRegistry:()=>Nh,gt:()=>ty,gte:()=>Nu,guid:()=>ngr,hash:()=>xgr,hex:()=>Cgr,hostname:()=>Agr,httpUrl:()=>cgr,includes:()=>YR,instanceof:()=>nyr,int:()=>Lse,int32:()=>wgr,int64:()=>Rgr,intersection:()=>D4e,ipv4:()=>ggr,ipv6:()=>ygr,iso:()=>G3,json:()=>ayr,jwt:()=>Ogr,keyof:()=>jgr,ksuid:()=>mgr,lazy:()=>J4e,length:()=>fx,literal:()=>gx,locales:()=>UR,looseObject:()=>Ugr,lowercase:()=>zR,lt:()=>ey,lte:()=>qp,map:()=>Hgr,maxLength:()=>px,maxSize:()=>lx,mime:()=>JR,minLength:()=>Bb,minSize:()=>ST,multipleOf:()=>OT,nan:()=>Xgr,nanoid:()=>lgr,nativeEnum:()=>zgr,negative:()=>sse,never:()=>ece,nonnegative:()=>use,nonoptional:()=>q4e,nonpositive:()=>cse,normalize:()=>QR,null:()=>_4e,nullable:()=>K3,nullish:()=>Ygr,number:()=>X3,object:()=>Xn,optional:()=>ay,overwrite:()=>ry,parse:()=>Tse,parseAsync:()=>Ose,partialRecord:()=>Bgr,pipe:()=>Y3,positive:()=>ose,prefault:()=>U4e,preprocess:()=>oyr,prettifyError:()=>Oie,promise:()=>Zgr,property:()=>lse,readonly:()=>Y4e,record:()=>mx,refine:()=>e5e,regex:()=>GR,regexes:()=>Up,registry:()=>E3,safeDecode:()=>Nse,safeDecodeAsync:()=>Rse,safeEncode:()=>wse,safeEncodeAsync:()=>Ise,safeParse:()=>Sse,safeParseAsync:()=>Ase,set:()=>Ggr,setErrorMap:()=>cyr,size:()=>HR,startsWith:()=>WR,strictObject:()=>Vgr,string:()=>qt,stringFormat:()=>Sgr,stringbool:()=>iyr,success:()=>Wgr,superRefine:()=>t5e,symbol:()=>kgr,templateLiteral:()=>Qgr,toJSONSchema:()=>nL,toLowerCase:()=>eL,toUpperCase:()=>tL,transform:()=>nce,treeifyError:()=>Tie,trim:()=>ZR,tuple:()=>N4e,uint32:()=>Ngr,uint64:()=>Lgr,ulid:()=>dgr,undefined:()=>$gr,union:()=>Rh,unknown:()=>Ih,uppercase:()=>KR,url:()=>Mse,util:()=>Fe,uuid:()=>igr,uuidv4:()=>agr,uuidv6:()=>ogr,uuidv7:()=>sgr,void:()=>Mgr,xid:()=>hgr});var ny={};Ri(ny,{$ZodAny:()=>Jae,$ZodArray:()=>roe,$ZodAsyncError:()=>bd,$ZodBase64:()=>Uae,$ZodBase64URL:()=>qae,$ZodBigInt:()=>g3,$ZodBigIntFormat:()=>Kae,$ZodBoolean:()=>jR,$ZodCIDRv4:()=>Fae,$ZodCIDRv6:()=>jae,$ZodCUID:()=>xae,$ZodCUID2:()=>Pae,$ZodCatch:()=>boe,$ZodCheck:()=>Li,$ZodCheckBigIntFormat:()=>nae,$ZodCheckEndsWith:()=>mae,$ZodCheckGreaterThan:()=>u3,$ZodCheckIncludes:()=>dae,$ZodCheckLengthEquals:()=>uae,$ZodCheckLessThan:()=>c3,$ZodCheckLowerCase:()=>pae,$ZodCheckMaxLength:()=>sae,$ZodCheckMaxSize:()=>iae,$ZodCheckMimeType:()=>yae,$ZodCheckMinLength:()=>cae,$ZodCheckMinSize:()=>aae,$ZodCheckMultipleOf:()=>tae,$ZodCheckNumberFormat:()=>rae,$ZodCheckOverwrite:()=>vae,$ZodCheckProperty:()=>gae,$ZodCheckRegex:()=>lae,$ZodCheckSizeEquals:()=>oae,$ZodCheckStartsWith:()=>hae,$ZodCheckStringFormat:()=>cx,$ZodCheckUpperCase:()=>fae,$ZodCodec:()=>VR,$ZodCustom:()=>xoe,$ZodCustomStringFormat:()=>Gae,$ZodDate:()=>toe,$ZodDefault:()=>moe,$ZodDiscriminatedUnion:()=>ioe,$ZodE164:()=>Bae,$ZodEmail:()=>Oae,$ZodEmoji:()=>Aae,$ZodEncodeError:()=>Mb,$ZodEnum:()=>uoe,$ZodError:()=>RR,$ZodFile:()=>poe,$ZodFunction:()=>Soe,$ZodGUID:()=>_ae,$ZodIPv4:()=>$ae,$ZodIPv6:()=>Mae,$ZodISODate:()=>Rae,$ZodISODateTime:()=>Iae,$ZodISODuration:()=>kae,$ZodISOTime:()=>Lae,$ZodIntersection:()=>aoe,$ZodJWT:()=>Hae,$ZodKSUID:()=>Nae,$ZodLazy:()=>Coe,$ZodLiteral:()=>loe,$ZodMap:()=>soe,$ZodNaN:()=>Eoe,$ZodNanoID:()=>Cae,$ZodNever:()=>Zae,$ZodNonOptional:()=>yoe,$ZodNull:()=>Xae,$ZodNullable:()=>hoe,$ZodNumber:()=>m3,$ZodNumberFormat:()=>zae,$ZodObject:()=>S3e,$ZodObjectJIT:()=>noe,$ZodOptional:()=>doe,$ZodPipe:()=>_oe,$ZodPrefault:()=>goe,$ZodPromise:()=>Aoe,$ZodReadonly:()=>Toe,$ZodRealError:()=>wu,$ZodRecord:()=>ooe,$ZodRegistry:()=>ux,$ZodSet:()=>coe,$ZodString:()=>TT,$ZodStringFormat:()=>li,$ZodSuccess:()=>voe,$ZodSymbol:()=>Yae,$ZodTemplateLiteral:()=>Ooe,$ZodTransform:()=>foe,$ZodTuple:()=>v3,$ZodType:()=>ir,$ZodULID:()=>Dae,$ZodURL:()=>Sae,$ZodUUID:()=>Tae,$ZodUndefined:()=>Wae,$ZodUnion:()=>y3,$ZodUnknown:()=>Qae,$ZodVoid:()=>eoe,$ZodXID:()=>wae,$brand:()=>fie,$constructor:()=>ue,$input:()=>Doe,$output:()=>Poe,Doc:()=>FR,JSONSchema:()=>m4e,JSONSchemaGenerator:()=>rL,NEVER:()=>pie,TimePrecision:()=>Ioe,_any:()=>Zoe,_array:()=>pse,_base64:()=>M3,_base64url:()=>F3,_bigint:()=>zoe,_boolean:()=>Hoe,_catch:()=>Ymr,_check:()=>h4e,_cidrv4:()=>k3,_cidrv6:()=>$3,_coercedBigint:()=>Koe,_coercedBoolean:()=>Goe,_coercedDate:()=>ise,_coercedNumber:()=>Foe,_coercedString:()=>Noe,_cuid:()=>P3,_cuid2:()=>D3,_custom:()=>dse,_date:()=>nse,_decode:()=>e3,_decodeAsync:()=>r3,_default:()=>Gmr,_discriminatedUnion:()=>Rmr,_e164:()=>j3,_email:()=>_3,_emoji:()=>C3,_encode:()=>ZB,_encodeAsync:()=>t3,_endsWith:()=>XR,_enum:()=>jmr,_file:()=>fse,_float32:()=>Voe,_float64:()=>Uoe,_gt:()=>ty,_gte:()=>Nu,_guid:()=>qR,_includes:()=>YR,_int:()=>joe,_int32:()=>qoe,_int64:()=>Yoe,_intersection:()=>Lmr,_ipv4:()=>R3,_ipv6:()=>L3,_isoDate:()=>Loe,_isoDateTime:()=>Roe,_isoDuration:()=>$oe,_isoTime:()=>koe,_jwt:()=>V3,_ksuid:()=>I3,_lazy:()=>Qmr,_length:()=>fx,_literal:()=>Umr,_lowercase:()=>zR,_lt:()=>ey,_lte:()=>qp,_map:()=>Mmr,_max:()=>qp,_maxLength:()=>px,_maxSize:()=>lx,_mime:()=>JR,_min:()=>Nu,_minLength:()=>Bb,_minSize:()=>ST,_multipleOf:()=>OT,_nan:()=>ase,_nanoid:()=>x3,_nativeEnum:()=>Vmr,_negative:()=>sse,_never:()=>tse,_nonnegative:()=>use,_nonoptional:()=>zmr,_nonpositive:()=>cse,_normalize:()=>QR,_null:()=>Qoe,_nullable:()=>Hmr,_number:()=>Moe,_optional:()=>Bmr,_overwrite:()=>ry,_parse:()=>ix,_parseAsync:()=>ax,_pipe:()=>Wmr,_positive:()=>ose,_promise:()=>Zmr,_property:()=>lse,_readonly:()=>Xmr,_record:()=>$mr,_refine:()=>hse,_regex:()=>GR,_safeDecode:()=>i3,_safeDecodeAsync:()=>o3,_safeEncode:()=>n3,_safeEncodeAsync:()=>a3,_safeParse:()=>ox,_safeParseAsync:()=>sx,_set:()=>Fmr,_size:()=>HR,_startsWith:()=>WR,_string:()=>woe,_stringFormat:()=>dx,_stringbool:()=>gse,_success:()=>Kmr,_superRefine:()=>mse,_symbol:()=>Xoe,_templateLiteral:()=>Jmr,_toLowerCase:()=>eL,_toUpperCase:()=>tL,_transform:()=>qmr,_trim:()=>ZR,_tuple:()=>kmr,_uint32:()=>Boe,_uint64:()=>Woe,_ulid:()=>w3,_undefined:()=>Joe,_union:()=>Imr,_unknown:()=>ese,_uppercase:()=>KR,_url:()=>BR,_uuid:()=>T3,_uuidv4:()=>O3,_uuidv6:()=>S3,_uuidv7:()=>A3,_void:()=>rse,_xid:()=>N3,clone:()=>Vc,config:()=>ro,decode:()=>ahr,decodeAsync:()=>shr,encode:()=>ihr,encodeAsync:()=>ohr,flattenError:()=>LR,formatError:()=>kR,globalConfig:()=>CR,globalRegistry:()=>Nh,isValidBase64:()=>Vae,isValidBase64URL:()=>E3e,isValidJWT:()=>_3e,locales:()=>UR,parse:()=>JB,parseAsync:()=>QB,prettifyError:()=>Oie,regexes:()=>Up,registry:()=>E3,safeDecode:()=>uhr,safeDecodeAsync:()=>phr,safeEncode:()=>chr,safeEncodeAsync:()=>lhr,safeParse:()=>Sie,safeParseAsync:()=>Aie,toDotPath:()=>i3e,toJSONSchema:()=>nL,treeifyError:()=>Tie,util:()=>Fe,version:()=>bae});var pie=Object.freeze({status:"aborted"});function ue(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 fie=Symbol("zod_brand"),bd=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Mb=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}},CR={};function ro(t){return t&&Object.assign(CR,t),CR}var Fe={};Ri(Fe,{BIGINT_FORMAT_RANGES:()=>_ie,Class:()=>hie,NUMBER_FORMAT_RANGES:()=>Eie,aborted:()=>qb,allowsEval:()=>gie,assert:()=>$dr,assertEqual:()=>Idr,assertIs:()=>Ldr,assertNever:()=>kdr,assertNotEqual:()=>Rdr,assignProp:()=>jb,base64ToUint8Array:()=>t3e,base64urlToUint8Array:()=>Zdr,cached:()=>rx,captureStackTrace:()=>XB,cleanEnum:()=>Qdr,cleanRegex:()=>DR,clone:()=>Vc,cloneDef:()=>Fdr,createTransparentProxy:()=>Hdr,defineLazy:()=>Yr,esc:()=>WB,escapeRegex:()=>wh,extend:()=>Kdr,finalizeIssue:()=>Gl,floatSafeRemainder:()=>mie,getElementAtPath:()=>jdr,getEnumValues:()=>PR,getLengthableOrigin:()=>IR,getParsedType:()=>Bdr,getSizableOrigin:()=>NR,hexToUint8Array:()=>thr,isObject:()=>ET,isPlainObject:()=>Ub,issue:()=>nx,joinValues:()=>_e,jsonStringifyReplacer:()=>tx,merge:()=>Wdr,mergeDefs:()=>Vb,normalizeParams:()=>Be,nullish:()=>Fb,numKeys:()=>qdr,objectClone:()=>Mdr,omit:()=>zdr,optionalKeys:()=>bie,partial:()=>Xdr,pick:()=>Gdr,prefixIssues:()=>Hl,primitiveTypes:()=>vie,promiseAllObject:()=>Vdr,propertyKeyTypes:()=>wR,randomString:()=>Udr,required:()=>Jdr,safeExtend:()=>Ydr,shallowClone:()=>yie,stringifyPrimitive:()=>ze,uint8ArrayToBase64:()=>r3e,uint8ArrayToBase64url:()=>ehr,uint8ArrayToHex:()=>rhr,unwrapMessage:()=>xR});function Idr(t){return t}function Rdr(t){return t}function Ldr(t){}function kdr(t){throw new Error}function $dr(t){}function PR(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 _e(t,e="|"){return t.map(r=>ze(r)).join(e)}function tx(t,e){return typeof e=="bigint"?e.toString():e}function rx(t){return{get value(){{let r=t();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function Fb(t){return t==null}function DR(t){let e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}function mie(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 e3e=Symbol("evaluating");function Yr(t,e,r){let n;Object.defineProperty(t,e,{get(){if(n!==e3e)return n===void 0&&(n=e3e,n=r()),n},set(i){Object.defineProperty(t,e,{value:i})},configurable:!0})}function Mdr(t){return Object.create(Object.getPrototypeOf(t),Object.getOwnPropertyDescriptors(t))}function jb(t,e,r){Object.defineProperty(t,e,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Vb(...t){let e={};for(let r of t){let n=Object.getOwnPropertyDescriptors(r);Object.assign(e,n)}return Object.defineProperties({},e)}function Fdr(t){return Vb(t._zod.def)}function jdr(t,e){return e?e.reduce((r,n)=>r?.[n],t):t}function Vdr(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 Udr(t=10){let e="abcdefghijklmnopqrstuvwxyz",r="";for(let n=0;n<t;n++)r+=e[Math.floor(Math.random()*e.length)];return r}function WB(t){return JSON.stringify(t)}var XB="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function ET(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}var gie=rx(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let t=Function;return new t(""),!0}catch{return!1}});function Ub(t){if(ET(t)===!1)return!1;let e=t.constructor;if(e===void 0)return!0;let r=e.prototype;return!(ET(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function yie(t){return Ub(t)?{...t}:t}function qdr(t){let e=0;for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&e++;return e}var Bdr=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}`)}},wR=new Set(["string","number","symbol"]),vie=new Set(["string","number","bigint","boolean","symbol","undefined"]);function wh(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Vc(t,e,r){let n=new t._zod.constr(e??t._zod.def);return(!e||r?.parent)&&(n._zod.parent=t),n}function Be(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 Hdr(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 ze(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}function bie(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}var Eie={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]},_ie={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Gdr(t,e){let r=t._zod.def,n=Vb(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 jb(this,"shape",i),i},checks:[]});return Vc(t,n)}function zdr(t,e){let r=t._zod.def,n=Vb(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 jb(this,"shape",i),i},checks:[]});return Vc(t,n)}function Kdr(t,e){if(!Ub(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=Vb(t._zod.def,{get shape(){let a={...t._zod.def.shape,...e};return jb(this,"shape",a),a},checks:[]});return Vc(t,i)}function Ydr(t,e){if(!Ub(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 jb(this,"shape",n),n},checks:t._zod.def.checks};return Vc(t,r)}function Wdr(t,e){let r=Vb(t._zod.def,{get shape(){let n={...t._zod.def.shape,...e._zod.def.shape};return jb(this,"shape",n),n},get catchall(){return e._zod.def.catchall},checks:[]});return Vc(t,r)}function Xdr(t,e,r){let n=Vb(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 jb(this,"shape",a),a},checks:[]});return Vc(e,n)}function Jdr(t,e,r){let n=Vb(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 jb(this,"shape",a),a},checks:[]});return Vc(e,n)}function qb(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 Hl(t,e){return e.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(t),r})}function xR(t){return typeof t=="string"?t:t?.message}function Gl(t,e,r){let n={...t,path:t.path??[]};if(!t.message){let i=xR(t.inst?._zod.def?.error?.(t))??xR(e?.error?.(t))??xR(r.customError?.(t))??xR(r.localeError?.(t))??"Invalid input";n.message=i}return delete n.inst,delete n.continue,e?.reportInput||delete n.input,n}function NR(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}function IR(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function nx(...t){let[e,r,n]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:n}:{...e}}function Qdr(t){return Object.entries(t).filter(([e,r])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function t3e(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 r3e(t){let e="";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return btoa(e)}function Zdr(t){let e=t.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-e.length%4)%4);return t3e(e+r)}function ehr(t){return r3e(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function thr(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 rhr(t){return Array.from(t).map(e=>e.toString(16).padStart(2,"0")).join("")}var hie=class{constructor(...e){}};var n3e=(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,tx,2),Object.defineProperty(t,"toString",{value:()=>t.message,enumerable:!1})},RR=ue("$ZodError",n3e),wu=ue("$ZodError",n3e,{Parent:Error});function LR(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 kR(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}function Tie(t,e){let r=e||function(a){return a.message},n={errors:[]},i=(a,o=[])=>{var s,c;for(let u of a.issues)if(u.code==="invalid_union"&&u.errors.length)u.errors.map(l=>i({issues:l},u.path));else if(u.code==="invalid_key")i({issues:u.issues},u.path);else if(u.code==="invalid_element")i({issues:u.issues},u.path);else{let l=[...o,...u.path];if(l.length===0){n.errors.push(r(u));continue}let p=n,d=0;for(;d<l.length;){let f=l[d],h=d===l.length-1;typeof f=="string"?(p.properties??(p.properties={}),(s=p.properties)[f]??(s[f]={errors:[]}),p=p.properties[f]):(p.items??(p.items=[]),(c=p.items)[f]??(c[f]={errors:[]}),p=p.items[f]),h&&p.errors.push(r(u)),d++}}};return i(t),n}function i3e(t){let e=[],r=t.map(n=>typeof n=="object"?n.key:n);for(let n of r)typeof n=="number"?e.push(`[${n}]`):typeof n=="symbol"?e.push(`[${JSON.stringify(String(n))}]`):/[^\w$]/.test(n)?e.push(`[${JSON.stringify(n)}]`):(e.length&&e.push("."),e.push(n));return e.join("")}function Oie(t){let e=[],r=[...t.issues].sort((n,i)=>(n.path??[]).length-(i.path??[]).length);for(let n of r)e.push(`\u2716 ${n.message}`),n.path?.length&&e.push(` \u2192 at ${i3e(n.path)}`);return e.join(`
1579
1579
  `)}var ix=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 bd;if(o.issues.length){let s=new(i?.Err??t)(o.issues.map(c=>Gl(c,a,ro())));throw XB(s,i?.callee),s}return o.value},JB=ix(wu),ax=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=>Gl(c,a,ro())));throw XB(s,i?.callee),s}return o.value},QB=ax(wu),ox=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 bd;return a.issues.length?{success:!1,error:new(t??RR)(a.issues.map(o=>Gl(o,i,ro())))}:{success:!0,data:a.value}},Sie=ox(wu),sx=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=>Gl(o,i,ro())))}:{success:!0,data:a.value}},Aie=sx(wu),ZB=t=>(e,r,n)=>{let i=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return ix(t)(e,r,i)},ihr=ZB(wu),e3=t=>(e,r,n)=>ix(t)(e,r,n),ahr=e3(wu),t3=t=>async(e,r,n)=>{let i=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return ax(t)(e,r,i)},ohr=t3(wu),r3=t=>async(e,r,n)=>ax(t)(e,r,n),shr=r3(wu),n3=t=>(e,r,n)=>{let i=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return ox(t)(e,r,i)},chr=n3(wu),i3=t=>(e,r,n)=>ox(t)(e,r,n),uhr=i3(wu),a3=t=>async(e,r,n)=>{let i=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return sx(t)(e,r,i)},lhr=a3(wu),o3=t=>async(e,r,n)=>sx(t)(e,r,n),phr=o3(wu);var Up={};Ri(Up,{base64:()=>Vie,base64url:()=>s3,bigint:()=>Kie,boolean:()=>Xie,browserEmail:()=>Ehr,cidrv4:()=>Fie,cidrv6:()=>jie,cuid:()=>Cie,cuid2:()=>xie,date:()=>Bie,datetime:()=>Gie,domain:()=>Thr,duration:()=>Iie,e164:()=>qie,email:()=>Lie,emoji:()=>kie,extendedDuration:()=>fhr,guid:()=>Rie,hex:()=>Ohr,hostname:()=>Uie,html5Email:()=>ghr,idnEmail:()=>bhr,integer:()=>Yie,ipv4:()=>$ie,ipv6:()=>Mie,ksuid:()=>wie,lowercase:()=>Zie,md5_base64:()=>Ahr,md5_base64url:()=>Chr,md5_hex:()=>Shr,nanoid:()=>Nie,null:()=>Jie,number:()=>Wie,rfc5322Email:()=>yhr,sha1_base64:()=>Phr,sha1_base64url:()=>Dhr,sha1_hex:()=>xhr,sha256_base64:()=>Nhr,sha256_base64url:()=>Ihr,sha256_hex:()=>whr,sha384_base64:()=>Lhr,sha384_base64url:()=>khr,sha384_hex:()=>Rhr,sha512_base64:()=>Mhr,sha512_base64url:()=>Fhr,sha512_hex:()=>$hr,string:()=>zie,time:()=>Hie,ulid:()=>Pie,undefined:()=>Qie,unicodeEmail:()=>vhr,uppercase:()=>eae,uuid:()=>_T,uuid4:()=>dhr,uuid6:()=>hhr,uuid7:()=>mhr,xid:()=>Die});var Cie=/^[cC][^\s-]{8,}$/,xie=/^[0-9a-z]+$/,Pie=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Die=/^[0-9a-vA-V]{20}$/,wie=/^[A-Za-z0-9]{27}$/,Nie=/^[a-zA-Z0-9_-]{21}$/,Iie=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,fhr=/^[-+]?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)?)??$/,Rie=/^([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})$/,_T=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)$/,dhr=_T(4),hhr=_T(6),mhr=_T(7),Lie=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,ghr=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,yhr=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,vhr=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,bhr=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,Ehr=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,_hr="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function kie(){return new RegExp(_hr,"u")}var $ie=/^(?:(?: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])$/,Mie=/^(([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})$/,Fie=/^((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])$/,jie=/^(([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])$/,Vie=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,s3=/^[A-Za-z0-9_-]*$/,Uie=/^(?=.{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])?)*\.?$/,Thr=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,qie=/^\+(?:[0-9]){6,14}[0-9]$/,a3e="(?:(?:\\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])))",Bie=new RegExp(`^${a3e}$`);function o3e(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 Hie(t){return new RegExp(`^${o3e(t)}$`)}function Gie(t){let e=o3e({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(`^${a3e}T(?:${n})$`)}var zie=t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},Kie=/^\d+n?$/,Yie=/^\d+$/,Wie=/^-?\d+(?:\.\d+)?/i,Xie=/true|false/i,Jie=/null/i;var Qie=/undefined/i;var Zie=/^[^A-Z]*$/,eae=/^[^a-z]*$/,Ohr=/^[0-9a-fA-F]*$/;function $R(t,e){return new RegExp(`^[A-Za-z0-9+/]{${t}}${e}$`)}function MR(t){return new RegExp(`^[A-Za-z0-9-_]{${t}}$`)}var Shr=/^[0-9a-fA-F]{32}$/,Ahr=$R(22,"=="),Chr=MR(22),xhr=/^[0-9a-fA-F]{40}$/,Phr=$R(27,"="),Dhr=MR(27),whr=/^[0-9a-fA-F]{64}$/,Nhr=$R(43,"="),Ihr=MR(43),Rhr=/^[0-9a-fA-F]{96}$/,Lhr=$R(64,""),khr=MR(64),$hr=/^[0-9a-fA-F]{128}$/,Mhr=$R(86,"=="),Fhr=MR(86);var Li=ue("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])}),c3e={number:"number",bigint:"bigint",object:"date"},c3=ue("$ZodCheckLessThan",(t,e)=>{Li.init(t,e);let r=c3e[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})}}),u3=ue("$ZodCheckGreaterThan",(t,e)=>{Li.init(t,e);let r=c3e[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})}}),tae=ue("$ZodCheckMultipleOf",(t,e)=>{Li.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):mie(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})}}),rae=ue("$ZodCheckNumberFormat",(t,e)=>{Li.init(t,e),e.format=e.format||"float64";let r=e.format?.includes("int"),n=r?"int":"number",[i,a]=Eie[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=Yie)}),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})}}),nae=ue("$ZodCheckBigIntFormat",(t,e)=>{Li.init(t,e);let[r,n]=_ie[e.format];t._zod.onattach.push(i=>{let a=i._zod.bag;a.format=e.format,a.minimum=r,a.maximum=n}),t._zod.check=i=>{let a=i.value;a<r&&i.issues.push({origin:"bigint",input:a,code:"too_small",minimum:r,inclusive:!0,inst:t,continue:!e.abort}),a>n&&i.issues.push({origin:"bigint",input:a,code:"too_big",maximum:n,inst:t})}}),iae=ue("$ZodCheckMaxSize",(t,e)=>{var r;Li.init(t,e),(r=t._zod.def).when??(r.when=n=>{let i=n.value;return!Fb(i)&&i.size!==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;i.size<=e.maximum||n.issues.push({origin:NR(i),code:"too_big",maximum:e.maximum,inclusive:!0,input:i,inst:t,continue:!e.abort})}}),aae=ue("$ZodCheckMinSize",(t,e)=>{var r;Li.init(t,e),(r=t._zod.def).when??(r.when=n=>{let i=n.value;return!Fb(i)&&i.size!==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;i.size>=e.minimum||n.issues.push({origin:NR(i),code:"too_small",minimum:e.minimum,inclusive:!0,input:i,inst:t,continue:!e.abort})}}),oae=ue("$ZodCheckSizeEquals",(t,e)=>{var r;Li.init(t,e),(r=t._zod.def).when??(r.when=n=>{let i=n.value;return!Fb(i)&&i.size!==void 0}),t._zod.onattach.push(n=>{let i=n._zod.bag;i.minimum=e.size,i.maximum=e.size,i.size=e.size}),t._zod.check=n=>{let i=n.value,a=i.size;if(a===e.size)return;let o=a>e.size;n.issues.push({origin:NR(i),...o?{code:"too_big",maximum:e.size}:{code:"too_small",minimum:e.size},inclusive:!0,exact:!0,input:n.value,inst:t,continue:!e.abort})}}),sae=ue("$ZodCheckMaxLength",(t,e)=>{var r;Li.init(t,e),(r=t._zod.def).when??(r.when=n=>{let i=n.value;return!Fb(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=IR(i);n.issues.push({origin:o,code:"too_big",maximum:e.maximum,inclusive:!0,input:i,inst:t,continue:!e.abort})}}),cae=ue("$ZodCheckMinLength",(t,e)=>{var r;Li.init(t,e),(r=t._zod.def).when??(r.when=n=>{let i=n.value;return!Fb(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=IR(i);n.issues.push({origin:o,code:"too_small",minimum:e.minimum,inclusive:!0,input:i,inst:t,continue:!e.abort})}}),uae=ue("$ZodCheckLengthEquals",(t,e)=>{var r;Li.init(t,e),(r=t._zod.def).when??(r.when=n=>{let i=n.value;return!Fb(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=IR(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})}}),cx=ue("$ZodCheckStringFormat",(t,e)=>{var r,n;Li.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=()=>{})}),lae=ue("$ZodCheckRegex",(t,e)=>{cx.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})}}),pae=ue("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=Zie),cx.init(t,e)}),fae=ue("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=eae),cx.init(t,e)}),dae=ue("$ZodCheckIncludes",(t,e)=>{Li.init(t,e);let r=wh(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})}}),hae=ue("$ZodCheckStartsWith",(t,e)=>{Li.init(t,e);let r=new RegExp(`^${wh(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})}}),mae=ue("$ZodCheckEndsWith",(t,e)=>{Li.init(t,e);let r=new RegExp(`.*${wh(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})}});function s3e(t,e,r){t.issues.length&&e.issues.push(...Hl(r,t.issues))}var gae=ue("$ZodCheckProperty",(t,e)=>{Li.init(t,e),t._zod.check=r=>{let n=e.schema._zod.run({value:r.value[e.property],issues:[]},{});if(n instanceof Promise)return n.then(i=>s3e(i,r,e.property));s3e(n,r,e.property)}}),yae=ue("$ZodCheckMimeType",(t,e)=>{Li.init(t,e);let r=new Set(e.mime);t._zod.onattach.push(n=>{n._zod.bag.mime=e.mime}),t._zod.check=n=>{r.has(n.value.type)||n.issues.push({code:"invalid_value",values:e.mime,input:n.value.type,inst:t,continue:!e.abort})}}),vae=ue("$ZodCheckOverwrite",(t,e)=>{Li.init(t,e),t._zod.check=r=>{r.value=e.tx(r.value)}});var FR=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(`
1580
1580
  `).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(`
1581
1581
  `))}};var bae={major:4,minor:1,patch:5};var ir=ue("$ZodType",(t,e)=>{var r;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=bae;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=qb(o),l;for(let p of s){if(p._zod.def.when){if(!p._zod.def.when(o))continue}else if(u)continue;let d=o.issues.length,f=p._zod.check(o);if(f instanceof Promise&&c?.async===!1)throw new bd;if(l||f instanceof Promise)l=(l??Promise.resolve()).then(async()=>{await f,o.issues.length!==d&&(u||(u=qb(o,d)))});else{if(o.issues.length===d)continue;u||(u=qb(o,d))}}return l?l.then(()=>o):o},a=(o,s,c)=>{if(qb(o))return o.aborted=!0,o;let u=i(s,n,c);if(u instanceof Promise){if(c.async===!1)throw new bd;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 bd;return c.then(u=>i(u,n,s))}return i(c,n,s)}}t["~standard"]={validate:i=>{try{let a=Sie(t,i);return a.success?{value:a.data}:{issues:a.error?.issues}}catch{return Aie(t,i).then(o=>o.success?{value:o.data}:{issues:o.error?.issues})}},vendor:"zod",version:1}}),TT=ue("$ZodString",(t,e)=>{ir.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??zie(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}}),li=ue("$ZodStringFormat",(t,e)=>{cx.init(t,e),TT.init(t,e)}),_ae=ue("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=Rie),li.init(t,e)}),Tae=ue("$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=_T(n))}else e.pattern??(e.pattern=_T());li.init(t,e)}),Oae=ue("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=Lie),li.init(t,e)}),Sae=ue("$ZodURL",(t,e)=>{li.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:Uie.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})}}}),Aae=ue("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=kie()),li.init(t,e)}),Cae=ue("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=Nie),li.init(t,e)}),xae=ue("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=Cie),li.init(t,e)}),Pae=ue("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=xie),li.init(t,e)}),Dae=ue("$ZodULID",(t,e)=>{e.pattern??(e.pattern=Pie),li.init(t,e)}),wae=ue("$ZodXID",(t,e)=>{e.pattern??(e.pattern=Die),li.init(t,e)}),Nae=ue("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=wie),li.init(t,e)}),Iae=ue("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=Gie(e)),li.init(t,e)}),Rae=ue("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=Bie),li.init(t,e)}),Lae=ue("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=Hie(e)),li.init(t,e)}),kae=ue("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=Iie),li.init(t,e)}),$ae=ue("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=$ie),li.init(t,e),t._zod.onattach.push(r=>{let n=r._zod.bag;n.format="ipv4"})}),Mae=ue("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=Mie),li.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})}}}),Fae=ue("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=Fie),li.init(t,e)}),jae=ue("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=jie),li.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 Vae(t){if(t==="")return!0;if(t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}var Uae=ue("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=Vie),li.init(t,e),t._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64"}),t._zod.check=r=>{Vae(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:t,continue:!e.abort})}});function E3e(t){if(!s3.test(t))return!1;let e=t.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=e.padEnd(Math.ceil(e.length/4)*4,"=");return Vae(r)}var qae=ue("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=s3),li.init(t,e),t._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64url"}),t._zod.check=r=>{E3e(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:t,continue:!e.abort})}}),Bae=ue("$ZodE164",(t,e)=>{e.pattern??(e.pattern=qie),li.init(t,e)});function _3e(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 Hae=ue("$ZodJWT",(t,e)=>{li.init(t,e),t._zod.check=r=>{_3e(r.value,e.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:t,continue:!e.abort})}}),Gae=ue("$ZodCustomStringFormat",(t,e)=>{li.init(t,e),t._zod.check=r=>{e.fn(r.value)||r.issues.push({code:"invalid_format",format:e.format,input:r.value,inst:t,continue:!e.abort})}}),m3=ue("$ZodNumber",(t,e)=>{ir.init(t,e),t._zod.pattern=t._zod.bag.pattern??Wie,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}}),zae=ue("$ZodNumber",(t,e)=>{rae.init(t,e),m3.init(t,e)}),jR=ue("$ZodBoolean",(t,e)=>{ir.init(t,e),t._zod.pattern=Xie,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}}),g3=ue("$ZodBigInt",(t,e)=>{ir.init(t,e),t._zod.pattern=Kie,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:t}),r}}),Kae=ue("$ZodBigInt",(t,e)=>{nae.init(t,e),g3.init(t,e)}),Yae=ue("$ZodSymbol",(t,e)=>{ir.init(t,e),t._zod.parse=(r,n)=>{let i=r.value;return typeof i=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:i,inst:t}),r}}),Wae=ue("$ZodUndefined",(t,e)=>{ir.init(t,e),t._zod.pattern=Qie,t._zod.values=new Set([void 0]),t._zod.optin="optional",t._zod.optout="optional",t._zod.parse=(r,n)=>{let i=r.value;return typeof i>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:i,inst:t}),r}}),Xae=ue("$ZodNull",(t,e)=>{ir.init(t,e),t._zod.pattern=Jie,t._zod.values=new Set([null]),t._zod.parse=(r,n)=>{let i=r.value;return i===null||r.issues.push({expected:"null",code:"invalid_type",input:i,inst:t}),r}}),Jae=ue("$ZodAny",(t,e)=>{ir.init(t,e),t._zod.parse=r=>r}),Qae=ue("$ZodUnknown",(t,e)=>{ir.init(t,e),t._zod.parse=r=>r}),Zae=ue("$ZodNever",(t,e)=>{ir.init(t,e),t._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:t}),r)}),eoe=ue("$ZodVoid",(t,e)=>{ir.init(t,e),t._zod.parse=(r,n)=>{let i=r.value;return typeof i>"u"||r.issues.push({expected:"void",code:"invalid_type",input:i,inst:t}),r}}),toe=ue("$ZodDate",(t,e)=>{ir.init(t,e),t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=new Date(r.value)}catch{}let i=r.value,a=i instanceof Date;return a&&!Number.isNaN(i.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:i,...a?{received:"Invalid Date"}:{},inst:t}),r}});function l3e(t,e,r){t.issues.length&&e.issues.push(...Hl(r,t.issues)),e.value[r]=t.value}var roe=ue("$ZodArray",(t,e)=>{ir.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=>l3e(u,r,o))):l3e(c,r,o)}return a.length?Promise.all(a).then(()=>r):r}});function h3(t,e,r,n){t.issues.length&&e.issues.push(...Hl(r,t.issues)),t.value===void 0?r in n&&(e.value[r]=void 0):e.value[r]=t.value}function T3e(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=bie(t.shape);return{...t,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(r)}}function O3e(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(d=>h3(d,r,l,e))):h3(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 S3e=ue("$ZodObject",(t,e)=>{ir.init(t,e);let r=rx(()=>T3e(e));Yr(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=ET,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(h=>h3(h,o,p,c))):h3(f,o,p,c)}return i?O3e(u,c,o,s,r.value,t):u.length?Promise.all(u).then(()=>o):o}}),noe=ue("$ZodObjectJIT",(t,e)=>{S3e.init(t,e);let r=t._zod.parse,n=rx(()=>T3e(e)),i=d=>{let f=new FR(["shape","payload","ctx"]),h=n.value,m=O=>{let A=WB(O);return`shape[${A}]._zod.run({ value: input[${A}], issues: [] }, ctx)`};f.write("const input = payload.value;");let v=Object.create(null),_=0;for(let O of h.keys)v[O]=`key_${_++}`;f.write("const newResult = {}");for(let O of h.keys){let A=v[O],C=WB(O);f.write(`const ${A} = ${m(O)};`),f.write(`
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.4.4",
4
+ "version": "0.4.5",
5
5
  "keywords": [
6
6
  "SAP Fiori tools",
7
7
  "SAP Fiori elements",
@@ -48,24 +48,24 @@
48
48
  "@sap-ux/axios-extension": "1.24.3",
49
49
  "@sap-ux/project-access": "1.32.11",
50
50
  "@sap-ux/fiori-annotation-api": "0.7.16",
51
+ "@sap-ux/fiori-docs-embeddings": "0.4.4",
51
52
  "@sap-ux/i18n": "0.3.5",
52
53
  "@sap-ux/logger": "0.7.1",
53
- "@sap-ux/fiori-docs-embeddings": "0.4.4",
54
- "@sap-ux/store": "1.3.3",
55
54
  "@sap-ux/odata-annotation-core-types": "0.5.1",
56
55
  "@sap-ux/text-document-utils": "0.3.2",
57
56
  "@sap-ux/odata-entity-model": "0.3.2",
58
57
  "@sap-ux/btp-utils": "1.1.5",
59
- "@sap-ux/feature-toggle": "0.3.4",
60
58
  "@sap-ux/telemetry": "0.6.41",
61
- "@sap-ux/nodejs-utils": "0.2.8"
59
+ "@sap-ux/nodejs-utils": "0.2.8",
60
+ "@sap-ux/feature-toggle": "0.3.4"
62
61
  },
63
62
  "dependencies": {
64
63
  "@sap-ux/fiori-docs-embeddings": "*",
65
64
  "@xenova/transformers": "2.17.2",
66
65
  "@lancedb/lancedb": "0.22.0",
67
66
  "mem-fs": "2.1.0",
68
- "mem-fs-editor": "9.4.0"
67
+ "mem-fs-editor": "9.4.0",
68
+ "@sap-ux/store": "1.3.3"
69
69
  },
70
70
  "engines": {
71
71
  "node": ">=20.x"