xmcp 1.1.1 → 1.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/dist/runtime/http.js +2 -2
- package/dist/runtime/vercel.js +959 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("zod/v3"));else if("function"==typeof define&&define.amd)define(["zod/v3"],t);else{var r="object"==typeof exports?t(require("zod/v3")):t(e["zod/v3"]);for(var o in r)("object"==typeof exports?exports:e)[o]=r[o]}}(this,e=>(()=>{var t,r,o={9454(e,t,r){"use strict";var o=r(181).Buffer,a=r(181).SlowBuffer;function i(e,t){if(!o.isBuffer(e)||!o.isBuffer(t)||e.length!==t.length)return!1;for(var r=0,a=0;a<e.length;a++)r|=e[a]^t[a];return 0===r}e.exports=i,i.install=function(){o.prototype.equal=a.prototype.equal=function(e){return i(this,e)}};var s=o.prototype.equal,n=a.prototype.equal;i.restore=function(){o.prototype.equal=s,a.prototype.equal=n}},6507(e,t,r){"use strict";let o=r(5317),a=r(8388),i=r(442);function s(e,t,r){let s=a(e,t,r),n=o.spawn(s.command,s.args,s.options);return i.hookChildProcess(n,s),n}e.exports=s,e.exports.spawn=s,e.exports.sync=function(e,t,r){let s=a(e,t,r),n=o.spawnSync(s.command,s.args,s.options);return n.error=n.error||i.verifyENOENTSync(n.status,s),n},e.exports._parse=a,e.exports._enoent=i},442(e){"use strict";let t="win32"===process.platform;function r(e,t){return Object.assign(Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function o(e,o){return t&&1===e&&!o.file?r(o.original,"spawn"):null}e.exports={hookChildProcess:function(e,r){if(!t)return;let a=e.emit;e.emit=function(t,i){if("exit"===t){let t=o(i,r);if(t)return a.call(e,"error",t)}return a.apply(e,arguments)}},verifyENOENT:o,verifyENOENTSync:function(e,o){return t&&1===e&&!o.file?r(o.original,"spawnSync"):null},notFoundError:r}},8388(e,t,r){"use strict";let o=r(6928),a=r(3803),i=r(2077),s=r(1880),n="win32"===process.platform,l=/\.(?:com|exe)$/i,c=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;e.exports=function(e,t,r){t&&!Array.isArray(t)&&(r=t,t=null);let u={command:e,args:t=t?t.slice(0):[],options:r=Object.assign({},r),file:void 0,original:{command:e,args:t}};return r.shell?u:function(e){let t;if(!n)return e;let r=(e.file=a(e),(t=e.file&&s(e.file))?(e.args.unshift(e.file),e.command=t,a(e)):e.file),u=!l.test(r);if(e.options.forceShell||u){let t=c.test(r);e.command=o.normalize(e.command),e.command=i.command(e.command),e.args=e.args.map(e=>i.argument(e,t));let a=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${a}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}(u)}},2077(e){"use strict";let t=/([()\][%!^"`<>&|;, *?])/g;e.exports.command=function(e){return e.replace(t,"^$1")},e.exports.argument=function(e,r){return e=(e=(e=`${e}`).replace(/(?=(\\+?)?)\1"/g,'$1$1\\"')).replace(/(?=(\\+?)?)\1$/,"$1$1"),e=(e=`"${e}"`).replace(t,"^$1"),r&&(e=e.replace(t,"^$1")),e}},1880(e,t,r){"use strict";let o=r(9896),a=r(600);e.exports=function(e){let t,r=Buffer.alloc(150);try{t=o.openSync(e,"r"),o.readSync(t,r,0,150,0),o.closeSync(t)}catch(e){}return a(r.toString())}},3803(e,t,r){"use strict";let o=r(6928),a=r(1905),i=r(9695);function s(e,t){let r,s=e.options.env||process.env,n=process.cwd(),l=null!=e.options.cwd,c=l&&void 0!==process.chdir&&!process.chdir.disabled;if(c)try{process.chdir(e.options.cwd)}catch(e){}try{r=a.sync(e.command,{path:s[i({env:s})],pathExt:t?o.delimiter:void 0})}catch(e){}finally{c&&process.chdir(n)}return r&&(r=o.resolve(l?e.options.cwd:"",r)),r}e.exports=function(e){return s(e)||s(e,!0)}},8583(e,t,r){let o=r(9896),a=r(6928),i=r(857),s=r(6982),n=r(4519).version,l=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function c(e){console.log(`[dotenv@${n}][DEBUG] ${e}`)}function u(e){console.log(`[dotenv@${n}] ${e}`)}function d(e){return e&&e.DOTENV_KEY&&e.DOTENV_KEY.length>0?e.DOTENV_KEY:process.env.DOTENV_KEY&&process.env.DOTENV_KEY.length>0?process.env.DOTENV_KEY:""}function p(e){let t=null;if(e&&e.path&&e.path.length>0)if(Array.isArray(e.path))for(let r of e.path)o.existsSync(r)&&(t=r.endsWith(".vault")?r:`${r}.vault`);else t=e.path.endsWith(".vault")?e.path:`${e.path}.vault`;else t=a.resolve(process.cwd(),".env.vault");return o.existsSync(t)?t:null}function h(e){return"~"===e[0]?a.join(i.homedir(),e.slice(1)):e}let f={configDotenv:function(e){let t,r=a.resolve(process.cwd(),".env"),i="utf8",s=!!(e&&e.debug),n=!e||!("quiet"in e)||e.quiet;e&&e.encoding?i=e.encoding:s&&c("No encoding is specified. UTF-8 is used by default");let l=[r];if(e&&e.path)if(Array.isArray(e.path))for(let t of(l=[],e.path))l.push(h(t));else l=[h(e.path)];let d={};for(let r of l)try{let t=f.parse(o.readFileSync(r,{encoding:i}));f.populate(d,t,e)}catch(e){s&&c(`Failed to load ${r} ${e.message}`),t=e}let p=process.env;if(e&&null!=e.processEnv&&(p=e.processEnv),f.populate(p,d,e),s||!n){let e=Object.keys(d).length,r=[];for(let e of l)try{let t=a.relative(process.cwd(),e);r.push(t)}catch(r){s&&c(`Failed to load ${e} ${r.message}`),t=r}u(`injecting env (${e}) from ${r.join(",")}`)}return t?{parsed:d,error:t}:{parsed:d}},_configVault:function(e){let t=!!(e&&e.debug),r=!e||!("quiet"in e)||e.quiet;(t||!r)&&u("Loading env from encrypted .env.vault");let o=f._parseVault(e),a=process.env;return e&&null!=e.processEnv&&(a=e.processEnv),f.populate(a,o,e),{parsed:o}},_parseVault:function(e){let t,r=p(e=e||{});e.path=r;let o=f.configDotenv(e);if(!o.parsed){let e=Error(`MISSING_DATA: Cannot parse ${r} for an unknown reason`);throw e.code="MISSING_DATA",e}let a=d(e).split(","),i=a.length;for(let e=0;e<i;e++)try{let r=a[e].trim(),i=function(e,t){let r;try{r=new URL(t)}catch(e){if("ERR_INVALID_URL"===e.code){let e=Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");throw e.code="INVALID_DOTENV_KEY",e}throw e}let o=r.password;if(!o){let e=Error("INVALID_DOTENV_KEY: Missing key part");throw e.code="INVALID_DOTENV_KEY",e}let a=r.searchParams.get("environment");if(!a){let e=Error("INVALID_DOTENV_KEY: Missing environment part");throw e.code="INVALID_DOTENV_KEY",e}let i=`DOTENV_VAULT_${a.toUpperCase()}`,s=e.parsed[i];if(!s){let e=Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${i} in your .env.vault file.`);throw e.code="NOT_FOUND_DOTENV_ENVIRONMENT",e}return{ciphertext:s,key:o}}(o,r);t=f.decrypt(i.ciphertext,i.key);break}catch(t){if(e+1>=i)throw t}return f.parse(t)},config:function(e){if(0===d(e).length)return f.configDotenv(e);let t=p(e);if(!t){var r;return r=`You set DOTENV_KEY but you are missing a .env.vault file at ${t}. Did you forget to build it?`,console.log(`[dotenv@${n}][WARN] ${r}`),f.configDotenv(e)}return f._configVault(e)},decrypt:function(e,t){let r=Buffer.from(t.slice(-64),"hex"),o=Buffer.from(e,"base64"),a=o.subarray(0,12),i=o.subarray(-16);o=o.subarray(12,-16);try{let e=s.createDecipheriv("aes-256-gcm",r,a);return e.setAuthTag(i),`${e.update(o)}${e.final()}`}catch(o){let e=o instanceof RangeError,t="Invalid key length"===o.message,r="Unsupported state or unable to authenticate data"===o.message;if(e||t){let e=Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");throw e.code="INVALID_DOTENV_KEY",e}if(r){let e=Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");throw e.code="DECRYPTION_FAILED",e}throw o}},parse:function(e){let t,r={},o=e.toString();for(o=o.replace(/\r\n?/mg,"\n");null!=(t=l.exec(o));){let e=t[1],o=t[2]||"",a=(o=o.trim())[0];o=o.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"),'"'===a&&(o=(o=o.replace(/\\n/g,"\n")).replace(/\\r/g,"\r")),r[e]=o}return r},populate:function(e,t,r={}){let o=!!(r&&r.debug),a=!!(r&&r.override);if("object"!=typeof t){let e=Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");throw e.code="OBJECT_REQUIRED",e}for(let r of Object.keys(t))Object.prototype.hasOwnProperty.call(e,r)?(!0===a&&(e[r]=t[r]),o&&(!0===a?c(`"${r}" is already defined and WAS overwritten`):c(`"${r}" is already defined and was NOT overwritten`))):e[r]=t[r]}};e.exports.configDotenv=f.configDotenv,e.exports._configVault=f._configVault,e.exports._parseVault=f._parseVault,e.exports.config=f.config,e.exports.decrypt=f.decrypt,e.exports.parse=f.parse,e.exports.populate=f.populate,e.exports=f},9053(e,t,r){"use strict";var o=r(6608).Buffer,a=r(2188);function i(e){if(o.isBuffer(e))return e;if("string"==typeof e)return o.from(e,"base64");throw TypeError("ECDSA signature must be a Base64 string or a Buffer")}function s(e,t,r){for(var o=0;t+o<r&&0===e[t+o];)++o;return e[t+o]>=128&&--o,o}e.exports={derToJose:function(e,t){e=i(e);var r=a(t),s=r+1,n=e.length,l=0;if(48!==e[l++])throw Error('Could not find expected "seq"');var c=e[l++];if(129===c&&(c=e[l++]),n-l<c)throw Error('"seq" specified length of "'+c+'", only "'+(n-l)+'" remaining');if(2!==e[l++])throw Error('Could not find expected "int" for "r"');var u=e[l++];if(n-l-2<u)throw Error('"r" specified length of "'+u+'", only "'+(n-l-2)+'" available');if(s<u)throw Error('"r" specified length of "'+u+'", max of "'+s+'" is acceptable');var d=l;if(l+=u,2!==e[l++])throw Error('Could not find expected "int" for "s"');var p=e[l++];if(n-l!==p)throw Error('"s" specified length of "'+p+'", expected "'+(n-l)+'"');if(s<p)throw Error('"s" specified length of "'+p+'", max of "'+s+'" is acceptable');var h=l;if((l+=p)!==n)throw Error('Expected to consume entire buffer, but "'+(n-l)+'" bytes remain');var f=r-u,m=r-p,y=o.allocUnsafe(f+u+m+p);for(l=0;l<f;++l)y[l]=0;e.copy(y,l,d+Math.max(-f,0),d+u),l=r;for(var g=l;l<g+m;++l)y[l]=0;return e.copy(y,l,h+Math.max(-m,0),h+p),y=(y=y.toString("base64")).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")},joseToDer:function(e,t){e=i(e);var r=a(t),n=e.length;if(n!==2*r)throw TypeError('"'+t+'" signatures must be "'+2*r+'" bytes, saw "'+n+'"');var l=s(e,0,r),c=s(e,r,e.length),u=r-l,d=r-c,p=2+u+1+1+d,h=p<128,f=o.allocUnsafe((h?2:3)+p),m=0;return f[m++]=48,h?f[m++]=p:(f[m++]=129,f[m++]=255&p),f[m++]=2,f[m++]=u,l<0?(f[m++]=0,m+=e.copy(f,m,0,r)):m+=e.copy(f,m,l,r),f[m++]=2,f[m++]=d,c<0?(f[m++]=0,e.copy(f,m,r)):e.copy(f,m,r+c),f}}},2188(e){"use strict";function t(e){return(e/8|0)+ +(e%8!=0)}var r={ES256:t(256),ES384:t(384),ES512:t(521)};e.exports=function(e){var t=r[e];if(t)return t;throw Error('Unknown algorithm "'+e+'"')}},9344(e,t,r){var o;function a(e,t,r){if("function"==typeof t&&(r=t,t={}),!r){if("function"!=typeof Promise)throw TypeError("callback not provided");return new Promise(function(r,o){a(e,t||{},function(e,t){e?o(e):r(t)})})}o(e,t||{},function(e,o){e&&("EACCES"===e.code||t&&t.ignoreErrors)&&(e=null,o=!1),r(e,o)})}r(9896),o="win32"===process.platform||global.TESTING_WINDOWS?r(8541):r(709),e.exports=a,a.sync=function(e,t){try{return o.sync(e,t||{})}catch(e){if(t&&t.ignoreErrors||"EACCES"===e.code)return!1;throw e}}},709(e,t,r){e.exports=a,a.sync=function(e,t){return i(o.statSync(e),t)};var o=r(9896);function a(e,t,r){o.stat(e,function(e,o){r(e,!e&&i(o,t))})}function i(e,t){var r,o,a,i,s,n,l,c,u;return e.isFile()&&(r=e,o=t,a=r.mode,i=r.uid,s=r.gid,n=void 0!==o.uid?o.uid:process.getuid&&process.getuid(),l=void 0!==o.gid?o.gid:process.getgid&&process.getgid(),c=parseInt("100",8),u=parseInt("010",8),a&parseInt("001",8)||a&u&&s===l||a&c&&i===n||a&(c|u)&&0===n)}},8541(e,t,r){e.exports=i,i.sync=function(e,t){return a(o.statSync(e),e,t)};var o=r(9896);function a(e,t,r){if(!e.isSymbolicLink()&&!e.isFile())return!1;var o=void 0!==r.pathExt?r.pathExt:process.env.PATHEXT;if(!o||-1!==(o=o.split(";")).indexOf(""))return!0;for(var a=0;a<o.length;a++){var i=o[a].toLowerCase();if(i&&t.substr(-i.length).toLowerCase()===i)return!0}return!1}function i(e,t,r){o.stat(e,function(o,i){r(o,!o&&a(i,e,t))})}},2548(e,t,r){var o=r(3263);e.exports=function(e,t){t=t||{};var r=o.decode(e,t);if(!r)return null;var a=r.payload;if("string"==typeof a)try{var i=JSON.parse(a);null!==i&&"object"==typeof i&&(a=i)}catch(e){}return!0===t.complete?{header:r.header,payload:a,signature:r.signature}:a}},8400(e,t,r){e.exports={decode:r(2548),verify:r(6467),sign:r(9147),JsonWebTokenError:r(1957),NotBeforeError:r(4470),TokenExpiredError:r(7788)}},1957(e){var t=function(e,t){Error.call(this,e),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name="JsonWebTokenError",this.message=e,t&&(this.inner=t)};t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,e.exports=t},4470(e,t,r){var o=r(1957),a=function(e,t){o.call(this,e),this.name="NotBeforeError",this.date=t};a.prototype=Object.create(o.prototype),a.prototype.constructor=a,e.exports=a},7788(e,t,r){var o=r(1957),a=function(e,t){o.call(this,e),this.name="TokenExpiredError",this.expiredAt=t};a.prototype=Object.create(o.prototype),a.prototype.constructor=a,e.exports=a},5841(e,t,r){e.exports=r(3895).satisfies(process.version,">=15.7.0")},953(e,t,r){e.exports=r(3895).satisfies(process.version,"^6.12.0 || >=8.0.0")},455(e,t,r){e.exports=r(3895).satisfies(process.version,">=16.9.0")},4559(e,t,r){var o=r(3866);e.exports=function(e,t){var r=t||Math.floor(Date.now()/1e3);if("string"==typeof e){var a=o(e);if(void 0===a)return;return Math.floor(r+a/1e3)}if("number"==typeof e)return r+e}},723(e,t,r){let o=r(5841),a=r(455),i={ec:["ES256","ES384","ES512"],rsa:["RS256","PS256","RS384","PS384","RS512","PS512"],"rsa-pss":["PS256","PS384","PS512"]},s={ES256:"prime256v1",ES384:"secp384r1",ES512:"secp521r1"};e.exports=function(e,t){if(!e||!t)return;let r=t.asymmetricKeyType;if(!r)return;let n=i[r];if(!n)throw Error(`Unknown key type "${r}".`);if(!n.includes(e))throw Error(`"alg" parameter for "${r}" key type must be one of: ${n.join(", ")}.`);if(o)switch(r){case"ec":let l=t.asymmetricKeyDetails.namedCurve,c=s[e];if(l!==c)throw Error(`"alg" parameter "${e}" requires curve "${c}".`);break;case"rsa-pss":if(a){let r=parseInt(e.slice(-3),10),{hashAlgorithm:o,mgf1HashAlgorithm:a,saltLength:i}=t.asymmetricKeyDetails;if(o!==`sha${r}`||a!==o)throw Error(`Invalid key for this operation, its RSA-PSS parameters do not meet the requirements of "alg" ${e}.`);if(void 0!==i&&i>r>>3)throw Error(`Invalid key for this operation, its RSA-PSS parameter saltLength does not meet the requirements of "alg" ${e}.`)}}}},9147(e,t,r){let o=r(4559),a=r(953),i=r(723),s=r(3263),n=r(5357),l=r(6782),c=r(5250),u=r(8094),d=r(6052),p=r(1251),h=r(8430),{KeyObject:f,createSecretKey:m,createPrivateKey:y}=r(6982),g=["RS256","RS384","RS512","ES256","ES384","ES512","HS256","HS384","HS512","none"];a&&g.splice(3,0,"PS256","PS384","PS512");let v={expiresIn:{isValid:function(e){return c(e)||p(e)&&e},message:'"expiresIn" should be a number of seconds or string representing a timespan'},notBefore:{isValid:function(e){return c(e)||p(e)&&e},message:'"notBefore" should be a number of seconds or string representing a timespan'},audience:{isValid:function(e){return p(e)||Array.isArray(e)},message:'"audience" must be a string or array'},algorithm:{isValid:n.bind(null,g),message:'"algorithm" must be a valid string enum value'},header:{isValid:d,message:'"header" must be an object'},encoding:{isValid:p,message:'"encoding" must be a string'},issuer:{isValid:p,message:'"issuer" must be a string'},subject:{isValid:p,message:'"subject" must be a string'},jwtid:{isValid:p,message:'"jwtid" must be a string'},noTimestamp:{isValid:l,message:'"noTimestamp" must be a boolean'},keyid:{isValid:p,message:'"keyid" must be a string'},mutatePayload:{isValid:l,message:'"mutatePayload" must be a boolean'},allowInsecureKeySizes:{isValid:l,message:'"allowInsecureKeySizes" must be a boolean'},allowInvalidAsymmetricKeyTypes:{isValid:l,message:'"allowInvalidAsymmetricKeyTypes" must be a boolean'}},b={iat:{isValid:u,message:'"iat" should be a number of seconds'},exp:{isValid:u,message:'"exp" should be a number of seconds'},nbf:{isValid:u,message:'"nbf" should be a number of seconds'}};function _(e,t,r,o){if(!d(r))throw Error('Expected "'+o+'" to be a plain object.');Object.keys(r).forEach(function(a){let i=e[a];if(!i){if(!t)throw Error('"'+a+'" is not allowed in "'+o+'"');return}if(!i.isValid(r[a]))throw Error(i.message)})}let S={audience:"aud",issuer:"iss",subject:"sub",jwtid:"jti"},$=["expiresIn","notBefore","noTimestamp","audience","issuer","subject","jwtid"];e.exports=function(e,t,r,a){var n,l;"function"==typeof r?(a=r,r={}):r=r||{};let c="object"==typeof e&&!Buffer.isBuffer(e),u=Object.assign({alg:r.algorithm||"HS256",typ:c?"JWT":void 0,kid:r.keyid},r.header);function d(e){if(a)return a(e);throw e}if(!t&&"none"!==r.algorithm)return d(Error("secretOrPrivateKey must have a value"));if(null!=t&&!(t instanceof f))try{t=y(t)}catch(e){try{t=m("string"==typeof t?Buffer.from(t):t)}catch(e){return d(Error("secretOrPrivateKey is not valid key material"))}}if(u.alg.startsWith("HS")&&"secret"!==t.type)return d(Error(`secretOrPrivateKey must be a symmetric key when using ${u.alg}`));if(/^(?:RS|PS|ES)/.test(u.alg)){if("private"!==t.type)return d(Error(`secretOrPrivateKey must be an asymmetric key when using ${u.alg}`));if(!r.allowInsecureKeySizes&&!u.alg.startsWith("ES")&&void 0!==t.asymmetricKeyDetails&&t.asymmetricKeyDetails.modulusLength<2048)return d(Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${u.alg}`))}if(void 0===e)return d(Error("payload is required"));if(c){try{n=e,_(b,!0,n,"payload")}catch(e){return d(e)}r.mutatePayload||(e=Object.assign({},e))}else{let t=$.filter(function(e){return void 0!==r[e]});if(t.length>0)return d(Error("invalid "+t.join(",")+" option for "+typeof e+" payload"))}if(void 0!==e.exp&&void 0!==r.expiresIn)return d(Error('Bad "options.expiresIn" option the payload already has an "exp" property.'));if(void 0!==e.nbf&&void 0!==r.notBefore)return d(Error('Bad "options.notBefore" option the payload already has an "nbf" property.'));try{l=r,_(v,!1,l,"options")}catch(e){return d(e)}if(!r.allowInvalidAsymmetricKeyTypes)try{i(u.alg,t)}catch(e){return d(e)}let p=e.iat||Math.floor(Date.now()/1e3);if(r.noTimestamp?delete e.iat:c&&(e.iat=p),void 0!==r.notBefore){try{e.nbf=o(r.notBefore,p)}catch(e){return d(e)}if(void 0===e.nbf)return d(Error('"notBefore" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}if(void 0!==r.expiresIn&&"object"==typeof e){try{e.exp=o(r.expiresIn,p)}catch(e){return d(e)}if(void 0===e.exp)return d(Error('"expiresIn" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}Object.keys(S).forEach(function(t){let o=S[t];if(void 0!==r[t]){if(void 0!==e[o])return d(Error('Bad "options.'+t+'" option. The payload already has an "'+o+'" property.'));e[o]=r[t]}});let g=r.encoding||"utf8";if("function"==typeof a)a=a&&h(a),s.createSign({header:u,privateKey:t,payload:e,encoding:g}).once("error",a).once("done",function(e){if(!r.allowInsecureKeySizes&&/^(?:RS|PS)/.test(u.alg)&&e.length<256)return a(Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${u.alg}`));a(null,e)});else{let o=s.sign({header:u,payload:e,secret:t,encoding:g});if(!r.allowInsecureKeySizes&&/^(?:RS|PS)/.test(u.alg)&&o.length<256)throw Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${u.alg}`);return o}}},6467(e,t,r){let o=r(1957),a=r(4470),i=r(7788),s=r(2548),n=r(4559),l=r(723),c=r(953),u=r(3263),{KeyObject:d,createSecretKey:p,createPublicKey:h}=r(6982),f=["RS256","RS384","RS512"],m=["ES256","ES384","ES512"],y=["RS256","RS384","RS512"],g=["HS256","HS384","HS512"];c&&(f.splice(f.length,0,"PS256","PS384","PS512"),y.splice(y.length,0,"PS256","PS384","PS512")),e.exports=function(e,t,r,c){let v,b,_;if("function"!=typeof r||c||(c=r,r={}),r||(r={}),r=Object.assign({},r),v=c||function(e,t){if(e)throw e;return t},r.clockTimestamp&&"number"!=typeof r.clockTimestamp)return v(new o("clockTimestamp must be a number"));if(void 0!==r.nonce&&("string"!=typeof r.nonce||""===r.nonce.trim()))return v(new o("nonce must be a non-empty string"));if(void 0!==r.allowInvalidAsymmetricKeyTypes&&"boolean"!=typeof r.allowInvalidAsymmetricKeyTypes)return v(new o("allowInvalidAsymmetricKeyTypes must be a boolean"));let S=r.clockTimestamp||Math.floor(Date.now()/1e3);if(!e)return v(new o("jwt must be provided"));if("string"!=typeof e)return v(new o("jwt must be a string"));let $=e.split(".");if(3!==$.length)return v(new o("jwt malformed"));try{b=s(e,{complete:!0})}catch(e){return v(e)}if(!b)return v(new o("invalid token"));let w=b.header;if("function"==typeof t){if(!c)return v(new o("verify must be called asynchronous if secret or public key is provided as a callback"));_=t}else _=function(e,r){return r(null,t)};return _(w,function(t,s){let c;if(t)return v(new o("error in secret or public key callback: "+t.message));let _=""!==$[2].trim();if(!_&&s)return v(new o("jwt signature is required"));if(_&&!s)return v(new o("secret or public key must be provided"));if(!_&&!r.algorithms)return v(new o('please specify "none" in "algorithms" to verify unsigned tokens'));if(null!=s&&!(s instanceof d))try{s=h(s)}catch(e){try{s=p("string"==typeof s?Buffer.from(s):s)}catch(e){return v(new o("secretOrPublicKey is not valid key material"))}}if(r.algorithms||("secret"===s.type?r.algorithms=g:["rsa","rsa-pss"].includes(s.asymmetricKeyType)?r.algorithms=y:"ec"===s.asymmetricKeyType?r.algorithms=m:r.algorithms=f),-1===r.algorithms.indexOf(b.header.alg))return v(new o("invalid algorithm"));if(w.alg.startsWith("HS")&&"secret"!==s.type)return v(new o(`secretOrPublicKey must be a symmetric key when using ${w.alg}`));if(/^(?:RS|PS|ES)/.test(w.alg)&&"public"!==s.type)return v(new o(`secretOrPublicKey must be an asymmetric key when using ${w.alg}`));if(!r.allowInvalidAsymmetricKeyTypes)try{l(w.alg,s)}catch(e){return v(e)}try{c=u.verify(e,b.header.alg,s)}catch(e){return v(e)}if(!c)return v(new o("invalid signature"));let E=b.payload;if(void 0!==E.nbf&&!r.ignoreNotBefore){if("number"!=typeof E.nbf)return v(new o("invalid nbf value"));if(E.nbf>S+(r.clockTolerance||0))return v(new a("jwt not active",new Date(1e3*E.nbf)))}if(void 0!==E.exp&&!r.ignoreExpiration){if("number"!=typeof E.exp)return v(new o("invalid exp value"));if(S>=E.exp+(r.clockTolerance||0))return v(new i("jwt expired",new Date(1e3*E.exp)))}if(r.audience){let e=Array.isArray(r.audience)?r.audience:[r.audience];if(!(Array.isArray(E.aud)?E.aud:[E.aud]).some(function(t){return e.some(function(e){return e instanceof RegExp?e.test(t):e===t})}))return v(new o("jwt audience invalid. expected: "+e.join(" or ")))}if(r.issuer&&("string"==typeof r.issuer&&E.iss!==r.issuer||Array.isArray(r.issuer)&&-1===r.issuer.indexOf(E.iss)))return v(new o("jwt issuer invalid. expected: "+r.issuer));if(r.subject&&E.sub!==r.subject)return v(new o("jwt subject invalid. expected: "+r.subject));if(r.jwtid&&E.jti!==r.jwtid)return v(new o("jwt jwtid invalid. expected: "+r.jwtid));if(r.nonce&&E.nonce!==r.nonce)return v(new o("jwt nonce invalid. expected: "+r.nonce));if(r.maxAge){if("number"!=typeof E.iat)return v(new o("iat required when maxAge is specified"));let e=n(r.maxAge,E.iat);if(void 0===e)return v(new o('"maxAge" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'));if(S>=e+(r.clockTolerance||0))return v(new i("maxAge exceeded",new Date(1e3*e)))}return!0===r.complete?v(null,{header:w,payload:E,signature:b.signature}):v(null,E)})}},2357(e,t,r){var o,a=r(6608).Buffer,i=r(6982),s=r(9053),n=r(9023),l="secret must be a string or buffer",c="key must be a string or a buffer",u="function"==typeof i.createPublicKey;function d(e){if(!a.isBuffer(e)&&"string"!=typeof e&&(!u||"object"!=typeof e||"string"!=typeof e.type||"string"!=typeof e.asymmetricKeyType||"function"!=typeof e.export))throw m(c)}function p(e){if(!a.isBuffer(e)&&"string"!=typeof e&&"object"!=typeof e)throw m("key must be a string, a buffer or an object")}function h(e){return e.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function f(e){var t=4-(e=e.toString()).length%4;if(4!==t)for(var r=0;r<t;++r)e+="=";return e.replace(/\-/g,"+").replace(/_/g,"/")}function m(e){var t=[].slice.call(arguments,1);return TypeError(n.format.bind(n,e).apply(null,t))}function y(e){var t;return t=e,a.isBuffer(t)||"string"==typeof t||(e=JSON.stringify(e)),e}function g(e){return function(t,r){!function(e){if(!a.isBuffer(e)){if("string"!=typeof e){if(!u||"object"!=typeof e||"secret"!==e.type||"function"!=typeof e.export)throw m(l)}}}(r),t=y(t);var o=i.createHmac("sha"+e,r);return h((o.update(t),o.digest("base64")))}}u&&(c+=" or a KeyObject",l+="or a KeyObject");var v="timingSafeEqual"in i?function(e,t){return e.byteLength===t.byteLength&&i.timingSafeEqual(e,t)}:function(e,t){return o||(o=r(9454)),o(e,t)};function b(e){return function(t,r,o){var i=g(e)(t,o);return v(a.from(r),a.from(i))}}function _(e){return function(t,r){p(r),t=y(t);var o=i.createSign("RSA-SHA"+e);return h((o.update(t),o.sign(r,"base64")))}}function S(e){return function(t,r,o){d(o),t=y(t),r=f(r);var a=i.createVerify("RSA-SHA"+e);return a.update(t),a.verify(o,r,"base64")}}function $(e){return function(t,r){p(r),t=y(t);var o=i.createSign("RSA-SHA"+e);return h((o.update(t),o.sign({key:r,padding:i.constants.RSA_PKCS1_PSS_PADDING,saltLength:i.constants.RSA_PSS_SALTLEN_DIGEST},"base64")))}}function w(e){return function(t,r,o){d(o),t=y(t),r=f(r);var a=i.createVerify("RSA-SHA"+e);return a.update(t),a.verify({key:o,padding:i.constants.RSA_PKCS1_PSS_PADDING,saltLength:i.constants.RSA_PSS_SALTLEN_DIGEST},r,"base64")}}function E(e){var t=_(e);return function(){var r=t.apply(null,arguments);return s.derToJose(r,"ES"+e)}}function R(e){var t=S(e);return function(r,o,a){return t(r,o=s.joseToDer(o,"ES"+e).toString("base64"),a)}}function P(){return function(){return""}}function k(){return function(e,t){return""===t}}e.exports=function(e){var t=e.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/);if(!t)throw m('"%s" is not a valid algorithm.\n Supported algorithms are:\n "HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".',e);var r=(t[1]||t[3]).toLowerCase(),o=t[2];return{sign:({hs:g,rs:_,ps:$,es:E,none:P})[r](o),verify:({hs:b,rs:S,ps:w,es:R,none:k})[r](o)}}},3263(e,t,r){var o=r(9615),a=r(6747);t.ALGORITHMS=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"],t.sign=o.sign,t.verify=a.verify,t.decode=a.decode,t.isValid=a.isValid,t.createSign=function(e){return new o(e)},t.createVerify=function(e){return new a(e)}},6360(e,t,r){var o=r(6608).Buffer,a=r(2203);function i(e){if(this.buffer=null,this.writable=!0,this.readable=!0,!e)return this.buffer=o.alloc(0),this;if("function"==typeof e.pipe)return this.buffer=o.alloc(0),e.pipe(this),this;if(e.length||"object"==typeof e)return this.buffer=e,this.writable=!1,process.nextTick((function(){this.emit("end",e),this.readable=!1,this.emit("close")}).bind(this)),this;throw TypeError("Unexpected data type ("+typeof e+")")}r(9023).inherits(i,a),i.prototype.write=function(e){this.buffer=o.concat([this.buffer,o.from(e)]),this.emit("data",e)},i.prototype.end=function(e){e&&this.write(e),this.emit("end",e),this.emit("close"),this.writable=!1,this.readable=!1},e.exports=i},9615(e,t,r){var o=r(6608).Buffer,a=r(6360),i=r(2357),s=r(2203),n=r(5911),l=r(9023);function c(e,t){return o.from(e,t).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function u(e){var t,r,o,a=e.header,s=e.payload,u=e.secret||e.privateKey,d=e.encoding,p=i(a.alg),h=(t=(t=d)||"utf8",r=c(n(a),"binary"),o=c(n(s),t),l.format("%s.%s",r,o)),f=p.sign(h,u);return l.format("%s.%s",h,f)}function d(e){var t=e.secret;if(t=null==(t=null==t?e.privateKey:t)?e.key:t,!0===/^hs/i.test(e.header.alg)&&null==t)throw TypeError("secret must be a string or buffer or a KeyObject");var r=new a(t);this.readable=!0,this.header=e.header,this.encoding=e.encoding,this.secret=this.privateKey=this.key=r,this.payload=new a(e.payload),this.secret.once("close",(function(){!this.payload.writable&&this.readable&&this.sign()}).bind(this)),this.payload.once("close",(function(){!this.secret.writable&&this.readable&&this.sign()}).bind(this))}l.inherits(d,s),d.prototype.sign=function(){try{var e=u({header:this.header,payload:this.payload.buffer,secret:this.secret.buffer,encoding:this.encoding});return this.emit("done",e),this.emit("data",e),this.emit("end"),this.readable=!1,e}catch(e){this.readable=!1,this.emit("error",e),this.emit("close")}},d.sign=u,e.exports=d},5911(e,t,r){var o=r(181).Buffer;e.exports=function(e){return"string"==typeof e?e:"number"==typeof e||o.isBuffer(e)?e.toString():JSON.stringify(e)}},6747(e,t,r){var o=r(6608).Buffer,a=r(6360),i=r(2357),s=r(2203),n=r(5911),l=r(9023),c=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function u(e){var t=e.split(".",1)[0],r=o.from(t,"base64").toString("binary");if("[object Object]"===Object.prototype.toString.call(r))return r;try{return JSON.parse(r)}catch(e){return}}function d(e){return e.split(".")[2]}function p(e){return c.test(e)&&!!u(e)}function h(e,t,r){if(!t){var o=Error("Missing algorithm parameter for jws.verify");throw o.code="MISSING_ALGORITHM",o}var a=d(e=n(e)),s=e.split(".",2).join(".");return i(t).verify(s,a,r)}function f(e,t){if(t=t||{},!p(e=n(e)))return null;var r,a,i=u(e);if(!i)return null;var s=(r=r||"utf8",a=e.split(".")[1],o.from(a,"base64").toString(r));return("JWT"===i.typ||t.json)&&(s=JSON.parse(s,t.encoding)),{header:i,payload:s,signature:d(e)}}function m(e){var t=(e=e||{}).secret;if(t=null==(t=null==t?e.publicKey:t)?e.key:t,!0===/^hs/i.test(e.algorithm)&&null==t)throw TypeError("secret must be a string or buffer or a KeyObject");var r=new a(t);this.readable=!0,this.algorithm=e.algorithm,this.encoding=e.encoding,this.secret=this.publicKey=this.key=r,this.signature=new a(e.signature),this.secret.once("close",(function(){!this.signature.writable&&this.readable&&this.verify()}).bind(this)),this.signature.once("close",(function(){!this.secret.writable&&this.readable&&this.verify()}).bind(this))}l.inherits(m,s),m.prototype.verify=function(){try{var e=h(this.signature.buffer,this.algorithm,this.key.buffer),t=f(this.signature.buffer,this.encoding);return this.emit("done",e,t),this.emit("data",e),this.emit("end"),this.readable=!1,e}catch(e){this.readable=!1,this.emit("error",e),this.emit("close")}},m.decode=f,m.isValid=p,m.verify=h,e.exports=m},5357(e){var t,r,o=1/0,a=0/0,i=/^\s+|\s+$/g,s=/^[-+]0x[0-9a-f]+$/i,n=/^0b[01]+$/i,l=/^0o[0-7]+$/i,c=/^(?:0|[1-9]\d*)$/,u=parseInt;function d(e){return e!=e}var p=Object.prototype,h=p.hasOwnProperty,f=p.toString,m=p.propertyIsEnumerable,y=(t=Object.keys,r=Object,function(e){return t(r(e))}),g=Math.max,v=Array.isArray;function b(e){var t,r,o;return null!=e&&"number"==typeof(t=e.length)&&t>-1&&t%1==0&&t<=0x1fffffffffffff&&"[object Function]"!=(o=_(r=e)?f.call(r):"")&&"[object GeneratorFunction]"!=o}function _(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function S(e){return!!e&&"object"==typeof e}e.exports=function(e,t,r,$){e=b(e)?e:function(e){return e?function(e,t){for(var r=-1,o=e?e.length:0,a=Array(o);++r<o;)a[r]=t(e[r],r,e);return a}(b(e)?function(e,t){var r,o,a,i,s=v(e)||S(o=r=e)&&b(o)&&h.call(r,"callee")&&(!m.call(r,"callee")||"[object Arguments]"==f.call(r))?function(e,t){for(var r=-1,o=Array(e);++r<e;)o[r]=t(r);return o}(e.length,String):[],n=s.length,l=!!n;for(var u in e){h.call(e,u)&&!(l&&("length"==u||(a=u,(i=null==(i=n)?0x1fffffffffffff:i)&&("number"==typeof a||c.test(a))&&a>-1&&a%1==0&&a<i)))&&s.push(u)}return s}(e):function(e){if(r=(t=e)&&t.constructor,t!==("function"==typeof r&&r.prototype||p))return y(e);var t,r,o=[];for(var a in Object(e))h.call(e,a)&&"constructor"!=a&&o.push(a);return o}(e),function(t){return e[t]}):[]}(e),r=r&&!$?(R=(E=(w=r)?(w=function(e){if("number"==typeof e)return e;if("symbol"==typeof(t=e)||S(t)&&"[object Symbol]"==f.call(t))return a;if(_(e)){var t,r="function"==typeof e.valueOf?e.valueOf():e;e=_(r)?r+"":r}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(i,"");var o=n.test(e);return o||l.test(e)?u(e.slice(2),o?2:8):s.test(e)?a:+e}(w))===o||w===-o?(w<0?-1:1)*17976931348623157e292:w==w?w:0:0===w?w:0)%1,E==E?R?E-R:E:0):0;var w,E,R,P,k=e.length;return r<0&&(r=g(k+r,0)),"string"==typeof(P=e)||!v(P)&&S(P)&&"[object String]"==f.call(P)?r<=k&&e.indexOf(t,r)>-1:!!k&&function(e,t,r){if(t!=t){for(var o=e.length,a=r+-1;++a<o;)if(d(e[a],a,e))return a;return -1}for(var i=r-1,s=e.length;++i<s;)if(e[i]===t)return i;return -1}(e,t,r)>-1}},6782(e){var t=Object.prototype.toString;e.exports=function(e){var r;return!0===e||!1===e||!!(r=e)&&"object"==typeof r&&"[object Boolean]"==t.call(e)}},5250(e){var t=1/0,r=0/0,o=/^\s+|\s+$/g,a=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,s=/^0o[0-7]+$/i,n=parseInt,l=Object.prototype.toString;function c(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}e.exports=function(e){var u,d,p;return"number"==typeof e&&e==(p=(d=(u=e)?(u=function(e){if("number"==typeof e)return e;if("symbol"==typeof(t=e)||t&&"object"==typeof t&&"[object Symbol]"==l.call(t))return r;if(c(e)){var t,u="function"==typeof e.valueOf?e.valueOf():e;e=c(u)?u+"":u}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(o,"");var d=i.test(e);return d||s.test(e)?n(e.slice(2),d?2:8):a.test(e)?r:+e}(u))===t||u===-t?(u<0?-1:1)*17976931348623157e292:u==u?u:0:0===u?u:0)%1,d==d?p?d-p:d:0)}},8094(e){var t=Object.prototype.toString;e.exports=function(e){return"number"==typeof e||!!e&&"object"==typeof e&&"[object Number]"==t.call(e)}},6052(e){var t,r,o=Object.prototype,a=Function.prototype.toString,i=o.hasOwnProperty,s=a.call(Object),n=o.toString,l=(t=Object.getPrototypeOf,r=Object,function(e){return t(r(e))});e.exports=function(e){if(!(e&&"object"==typeof e)||"[object Object]"!=n.call(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e))return!1;var t=l(e);if(null===t)return!0;var r=i.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&a.call(r)==s}},1251(e){var t=Object.prototype.toString,r=Array.isArray;e.exports=function(e){var o;return"string"==typeof e||!r(e)&&!!(o=e)&&"object"==typeof o&&"[object String]"==t.call(e)}},8430(e){var t=1/0,r=0/0,o=/^\s+|\s+$/g,a=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,s=/^0o[0-7]+$/i,n=parseInt,l=Object.prototype.toString;function c(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}e.exports=function(e){var u,d,p,h,f=2,m=e;if("function"!=typeof m)throw TypeError("Expected a function");return p=(d=(u=f)?(u=function(e){if("number"==typeof e)return e;if("symbol"==typeof(t=e)||t&&"object"==typeof t&&"[object Symbol]"==l.call(t))return r;if(c(e)){var t,u="function"==typeof e.valueOf?e.valueOf():e;e=c(u)?u+"":u}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(o,"");var d=i.test(e);return d||s.test(e)?n(e.slice(2),d?2:8):a.test(e)?r:+e}(u))===t||u===-t?(u<0?-1:1)*17976931348623157e292:u==u?u:0:0===u?u:0)%1,f=d==d?p?d-p:d:0,function(){return--f>0&&(h=m.apply(this,arguments)),f<=1&&(m=void 0),h}}},3866(e){function t(e,t,r,o){return Math.round(e/r)+" "+o+(t>=1.5*r?"s":"")}e.exports=function(e,r){r=r||{};var o,a,i,s,n=typeof e;if("string"===n&&e.length>0){var l=e;if(!((l=String(l)).length>100)){var c=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(l);if(c){var u=parseFloat(c[1]);switch((c[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*u;case"weeks":case"week":case"w":return 6048e5*u;case"days":case"day":case"d":return 864e5*u;case"hours":case"hour":case"hrs":case"hr":case"h":return 36e5*u;case"minutes":case"minute":case"mins":case"min":case"m":return 6e4*u;case"seconds":case"second":case"secs":case"sec":case"s":return 1e3*u;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return u;default:break}}}return}if("number"===n&&isFinite(e)){return r.long?(a=Math.abs(o=e))>=864e5?t(o,a,864e5,"day"):a>=36e5?t(o,a,36e5,"hour"):a>=6e4?t(o,a,6e4,"minute"):a>=1e3?t(o,a,1e3,"second"):o+" ms":(s=Math.abs(i=e))>=864e5?Math.round(i/864e5)+"d":s>=36e5?Math.round(i/36e5)+"h":s>=6e4?Math.round(i/6e4)+"m":s>=1e3?Math.round(i/1e3)+"s":i+"ms"}throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},9695(e){"use strict";let t=(e={})=>{let t=e.env||process.env;return"win32"!==(e.platform||process.platform)?"PATH":Object.keys(t).reverse().find(e=>"PATH"===e.toUpperCase())||"Path"};e.exports=t,e.exports.default=t},6608(e,t,r){var o=r(181),a=o.Buffer;function i(e,t){for(var r in e)t[r]=e[r]}function s(e,t,r){return a(e,t,r)}a.from&&a.alloc&&a.allocUnsafe&&a.allocUnsafeSlow?e.exports=o:(i(o,t),t.Buffer=s),s.prototype=Object.create(a.prototype),i(a,s),s.from=function(e,t,r){if("number"==typeof e)throw TypeError("Argument must not be a number");return a(e,t,r)},s.alloc=function(e,t,r){if("number"!=typeof e)throw TypeError("Argument must be a number");var o=a(e);return void 0!==t?"string"==typeof r?o.fill(t,r):o.fill(t):o.fill(0),o},s.allocUnsafe=function(e){if("number"!=typeof e)throw TypeError("Argument must be a number");return a(e)},s.allocUnsafeSlow=function(e){if("number"!=typeof e)throw TypeError("Argument must be a number");return o.SlowBuffer(e)}},8610(e,t,r){"use strict";let o=Symbol("SemVer ANY");class a{static get ANY(){return o}constructor(e,t){if(t=i(t),e instanceof a)if(!!t.loose===e.loose)return e;else e=e.value;c("comparator",e=e.trim().split(/\s+/).join(" "),t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===o?this.value="":this.value=this.operator+this.semver.version,c("comp",this)}parse(e){let t=this.options.loose?s[n.COMPARATORLOOSE]:s[n.COMPARATOR],r=e.match(t);if(!r)throw TypeError(`Invalid comparator: ${e}`);this.operator=void 0!==r[1]?r[1]:"","="===this.operator&&(this.operator=""),r[2]?this.semver=new u(r[2],this.options.loose):this.semver=o}toString(){return this.value}test(e){if(c("Comparator.test",e,this.options.loose),this.semver===o||e===o)return!0;if("string"==typeof e)try{e=new u(e,this.options)}catch(e){return!1}return l(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof a))throw TypeError("a Comparator is required");return""===this.operator?""===this.value||new d(e.value,t).test(this.value):""===e.operator?""===e.value||new d(this.value,t).test(e.semver):!((t=i(t)).includePrerelease&&("<0.0.0-0"===this.value||"<0.0.0-0"===e.value)||!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0")))&&!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||l(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||l(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">"))}}e.exports=a;let i=r(4621),{safeRe:s,t:n}=r(152),l=r(5461),c=r(674),u=r(2398),d=r(2069)},2069(e,t,r){"use strict";let o=/\s+/g;class a{constructor(e,t){if(t=s(t),e instanceof a)if(!!t.loose===e.loose&&!!t.includePrerelease===e.includePrerelease)return e;else return new a(e.raw,t);if(e instanceof n)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(o," "),this.set=this.raw.split("||").map(e=>this.parseRange(e.trim())).filter(e=>e.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter(e=>!g(e[0])),0===this.set.length)this.set=[e];else if(this.set.length>1){for(const e of this.set)if(1===e.length&&v(e[0])){this.set=[e];break}}}this.formatted=void 0}get range(){if(void 0===this.formatted){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");let t=this.set[e];for(let e=0;e<t.length;e++)e>0&&(this.formatted+=" "),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let t=((this.options.includePrerelease&&m)|(this.options.loose&&y))+":"+e,r=i.get(t);if(r)return r;let o=this.options.loose,a=o?u[d.HYPHENRANGELOOSE]:u[d.HYPHENRANGE];l("hyphen replace",e=e.replace(a,x(this.options.includePrerelease))),l("comparator trim",e=e.replace(u[d.COMPARATORTRIM],p)),l("tilde trim",e=e.replace(u[d.TILDETRIM],h)),l("caret trim",e=e.replace(u[d.CARETTRIM],f));let s=e.split(" ").map(e=>_(e,this.options)).join(" ").split(/\s+/).map(e=>O(e,this.options));o&&(s=s.filter(e=>(l("loose invalid filter",e,this.options),!!e.match(u[d.COMPARATORLOOSE])))),l("range list",s);let c=new Map;for(let e of s.map(e=>new n(e,this.options))){if(g(e))return[e];c.set(e.value,e)}c.size>1&&c.has("")&&c.delete("");let v=[...c.values()];return i.set(t,v),v}intersects(e,t){if(!(e instanceof a))throw TypeError("a Range is required");return this.set.some(r=>b(r,t)&&e.set.some(e=>b(e,t)&&r.every(r=>e.every(e=>r.intersects(e,t)))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new c(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if(j(this.set[t],e,this.options))return!0;return!1}}e.exports=a;let i=new(r(2044)),s=r(4621),n=r(8610),l=r(674),c=r(2398),{safeRe:u,t:d,comparatorTrimReplace:p,tildeTrimReplace:h,caretTrimReplace:f}=r(152),{FLAG_INCLUDE_PRERELEASE:m,FLAG_LOOSE:y}=r(5076),g=e=>"<0.0.0-0"===e.value,v=e=>""===e.value,b=(e,t)=>{let r=!0,o=e.slice(),a=o.pop();for(;r&&o.length;)r=o.every(e=>a.intersects(e,t)),a=o.pop();return r},_=(e,t)=>(l("comp",e=e.replace(u[d.BUILD],""),t),l("caret",e=E(e,t)),l("tildes",e=$(e,t)),l("xrange",e=P(e,t)),l("stars",e=T(e,t)),e),S=e=>!e||"x"===e.toLowerCase()||"*"===e,$=(e,t)=>e.trim().split(/\s+/).map(e=>w(e,t)).join(" "),w=(e,t)=>{let r=t.loose?u[d.TILDELOOSE]:u[d.TILDE];return e.replace(r,(t,r,o,a,i)=>{let s;return l("tilde",e,t,r,o,a,i),S(r)?s="":S(o)?s=`>=${r}.0.0 <${+r+1}.0.0-0`:S(a)?s=`>=${r}.${o}.0 <${r}.${+o+1}.0-0`:i?(l("replaceTilde pr",i),s=`>=${r}.${o}.${a}-${i} <${r}.${+o+1}.0-0`):s=`>=${r}.${o}.${a} <${r}.${+o+1}.0-0`,l("tilde return",s),s})},E=(e,t)=>e.trim().split(/\s+/).map(e=>R(e,t)).join(" "),R=(e,t)=>{l("caret",e,t);let r=t.loose?u[d.CARETLOOSE]:u[d.CARET],o=t.includePrerelease?"-0":"";return e.replace(r,(t,r,a,i,s)=>{let n;return l("caret",e,t,r,a,i,s),S(r)?n="":S(a)?n=`>=${r}.0.0${o} <${+r+1}.0.0-0`:S(i)?n="0"===r?`>=${r}.${a}.0${o} <${r}.${+a+1}.0-0`:`>=${r}.${a}.0${o} <${+r+1}.0.0-0`:s?(l("replaceCaret pr",s),n="0"===r?"0"===a?`>=${r}.${a}.${i}-${s} <${r}.${a}.${+i+1}-0`:`>=${r}.${a}.${i}-${s} <${r}.${+a+1}.0-0`:`>=${r}.${a}.${i}-${s} <${+r+1}.0.0-0`):(l("no pr"),n="0"===r?"0"===a?`>=${r}.${a}.${i}${o} <${r}.${a}.${+i+1}-0`:`>=${r}.${a}.${i}${o} <${r}.${+a+1}.0-0`:`>=${r}.${a}.${i} <${+r+1}.0.0-0`),l("caret return",n),n})},P=(e,t)=>(l("replaceXRanges",e,t),e.split(/\s+/).map(e=>k(e,t)).join(" ")),k=(e,t)=>{e=e.trim();let r=t.loose?u[d.XRANGELOOSE]:u[d.XRANGE];return e.replace(r,(r,o,a,i,s,n)=>{l("xRange",e,r,o,a,i,s,n);let c=S(a),u=c||S(i),d=u||S(s);return"="===o&&d&&(o=""),n=t.includePrerelease?"-0":"",c?r=">"===o||"<"===o?"<0.0.0-0":"*":o&&d?(u&&(i=0),s=0,">"===o?(o=">=",u?(a=+a+1,i=0):i=+i+1,s=0):"<="===o&&(o="<",u?a=+a+1:i=+i+1),"<"===o&&(n="-0"),r=`${o+a}.${i}.${s}${n}`):u?r=`>=${a}.0.0${n} <${+a+1}.0.0-0`:d&&(r=`>=${a}.${i}.0${n} <${a}.${+i+1}.0-0`),l("xRange return",r),r})},T=(e,t)=>(l("replaceStars",e,t),e.trim().replace(u[d.STAR],"")),O=(e,t)=>(l("replaceGTE0",e,t),e.trim().replace(u[t.includePrerelease?d.GTE0PRE:d.GTE0],"")),x=e=>(t,r,o,a,i,s,n,l,c,u,d,p)=>(r=S(o)?"":S(a)?`>=${o}.0.0${e?"-0":""}`:S(i)?`>=${o}.${a}.0${e?"-0":""}`:s?`>=${r}`:`>=${r}${e?"-0":""}`,l=S(c)?"":S(u)?`<${+c+1}.0.0-0`:S(d)?`<${c}.${+u+1}.0-0`:p?`<=${c}.${u}.${d}-${p}`:e?`<${c}.${u}.${+d+1}-0`:`<=${l}`,`${r} ${l}`.trim()),j=(e,t,r)=>{for(let r=0;r<e.length;r++)if(!e[r].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let r=0;r<e.length;r++)if(l(e[r].semver),e[r].semver!==n.ANY&&e[r].semver.prerelease.length>0){let o=e[r].semver;if(o.major===t.major&&o.minor===t.minor&&o.patch===t.patch)return!0}return!1}return!0}},2398(e,t,r){"use strict";let o=r(674),{MAX_LENGTH:a,MAX_SAFE_INTEGER:i}=r(5076),{safeRe:s,t:n}=r(152),l=r(4621),{compareIdentifiers:c}=r(9101);class u{constructor(e,t){if(t=l(t),e instanceof u)if(!!t.loose===e.loose&&!!t.includePrerelease===e.includePrerelease)return e;else e=e.version;else if("string"!=typeof e)throw TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>a)throw TypeError(`version is longer than ${a} characters`);o("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;const r=e.trim().match(t.loose?s[n.LOOSE]:s[n.FULL]);if(!r)throw TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>i||this.major<0)throw TypeError("Invalid major version");if(this.minor>i||this.minor<0)throw TypeError("Invalid minor version");if(this.patch>i||this.patch<0)throw TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(e=>{if(/^[0-9]+$/.test(e)){let t=+e;if(t>=0&&t<i)return t}return e}):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(o("SemVer.compare",this.version,this.options,e),!(e instanceof u)){if("string"==typeof e&&e===this.version)return 0;e=new u(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return(e instanceof u||(e=new u(e,this.options)),this.major<e.major)?-1:this.major>e.major?1:this.minor<e.minor?-1:this.minor>e.minor?1:this.patch<e.patch?-1:+(this.patch>e.patch)}comparePre(e){if(e instanceof u||(e=new u(e,this.options)),this.prerelease.length&&!e.prerelease.length)return -1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{let r=this.prerelease[t],a=e.prerelease[t];if(o("prerelease compare",t,r,a),void 0===r&&void 0===a)return 0;if(void 0===a)return 1;if(void 0===r)return -1;else if(r===a)continue;else return c(r,a)}while(++t)}compareBuild(e){e instanceof u||(e=new u(e,this.options));let t=0;do{let r=this.build[t],a=e.build[t];if(o("build compare",t,r,a),void 0===r&&void 0===a)return 0;if(void 0===a)return 1;if(void 0===r)return -1;else if(r===a)continue;else return c(r,a)}while(++t)}inc(e,t,r){if(e.startsWith("pre")){if(!t&&!1===r)throw Error("invalid increment argument: identifier is empty");if(t){let e=`-${t}`.match(this.options.loose?s[n.PRERELEASELOOSE]:s[n.PRERELEASE]);if(!e||e[1]!==t)throw Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,r),this.inc("pre",t,r);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t,r),this.inc("pre",t,r);break;case"release":if(0===this.prerelease.length)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(0!==this.minor||0!==this.patch||0===this.prerelease.length)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(0!==this.patch||0===this.prerelease.length)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{let e=+!!Number(r);if(0===this.prerelease.length)this.prerelease=[e];else{let o=this.prerelease.length;for(;--o>=0;)"number"==typeof this.prerelease[o]&&(this.prerelease[o]++,o=-2);if(-1===o){if(t===this.prerelease.join(".")&&!1===r)throw Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let o=[t,e];!1===r&&(o=[t]),0===c(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=o):this.prerelease=o}break}default:throw Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}e.exports=u},5608(e,t,r){"use strict";let o=r(6802);e.exports=(e,t)=>{let r=o(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null}},5461(e,t,r){"use strict";let o=r(8271),a=r(733),i=r(1686),s=r(6479),n=r(7257),l=r(5850);e.exports=(e,t,r,c)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e===r;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e!==r;case"":case"=":case"==":return o(e,r,c);case"!=":return a(e,r,c);case">":return i(e,r,c);case">=":return s(e,r,c);case"<":return n(e,r,c);case"<=":return l(e,r,c);default:throw TypeError(`Invalid operator: ${t}`)}}},7771(e,t,r){"use strict";let o=r(2398),a=r(6802),{safeRe:i,t:s}=r(152);e.exports=(e,t)=>{if(e instanceof o)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let r=null;if((t=t||{}).rtl){let o,a=t.includePrerelease?i[s.COERCERTLFULL]:i[s.COERCERTL];for(;(o=a.exec(e))&&(!r||r.index+r[0].length!==e.length);)r&&o.index+o[0].length===r.index+r[0].length||(r=o),a.lastIndex=o.index+o[1].length+o[2].length;a.lastIndex=-1}else r=e.match(t.includePrerelease?i[s.COERCEFULL]:i[s.COERCE]);if(null===r)return null;let n=r[2],l=r[3]||"0",c=r[4]||"0",u=t.includePrerelease&&r[5]?`-${r[5]}`:"",d=t.includePrerelease&&r[6]?`+${r[6]}`:"";return a(`${n}.${l}.${c}${u}${d}`,t)}},8767(e,t,r){"use strict";let o=r(2398);e.exports=(e,t,r)=>{let a=new o(e,r),i=new o(t,r);return a.compare(i)||a.compareBuild(i)}},6293(e,t,r){"use strict";let o=r(6958);e.exports=(e,t)=>o(e,t,!0)},6958(e,t,r){"use strict";let o=r(2398);e.exports=(e,t,r)=>new o(e,r).compare(new o(t,r))},3086(e,t,r){"use strict";let o=r(6802);e.exports=(e,t)=>{let r=o(e,null,!0),a=o(t,null,!0),i=r.compare(a);if(0===i)return null;let s=i>0,n=s?r:a,l=s?a:r,c=!!n.prerelease.length;if(l.prerelease.length&&!c){if(!l.patch&&!l.minor)return"major";if(0===l.compareMain(n))return l.minor&&!l.patch?"minor":"patch"}let u=c?"pre":"";return r.major!==a.major?u+"major":r.minor!==a.minor?u+"minor":r.patch!==a.patch?u+"patch":"prerelease"}},8271(e,t,r){"use strict";let o=r(6958);e.exports=(e,t,r)=>0===o(e,t,r)},1686(e,t,r){"use strict";let o=r(6958);e.exports=(e,t,r)=>o(e,t,r)>0},6479(e,t,r){"use strict";let o=r(6958);e.exports=(e,t,r)=>o(e,t,r)>=0},3625(e,t,r){"use strict";let o=r(2398);e.exports=(e,t,r,a,i)=>{"string"==typeof r&&(i=a,a=r,r=void 0);try{return new o(e instanceof o?e.version:e,r).inc(t,a,i).version}catch(e){return null}}},7257(e,t,r){"use strict";let o=r(6958);e.exports=(e,t,r)=>0>o(e,t,r)},5850(e,t,r){"use strict";let o=r(6958);e.exports=(e,t,r)=>0>=o(e,t,r)},7744(e,t,r){"use strict";let o=r(2398);e.exports=(e,t)=>new o(e,t).major},4812(e,t,r){"use strict";let o=r(2398);e.exports=(e,t)=>new o(e,t).minor},733(e,t,r){"use strict";let o=r(6958);e.exports=(e,t,r)=>0!==o(e,t,r)},6802(e,t,r){"use strict";let o=r(2398);e.exports=(e,t,r=!1)=>{if(e instanceof o)return e;try{return new o(e,t)}catch(e){if(!r)return null;throw e}}},8643(e,t,r){"use strict";let o=r(2398);e.exports=(e,t)=>new o(e,t).patch},9283(e,t,r){"use strict";let o=r(6802);e.exports=(e,t)=>{let r=o(e,t);return r&&r.prerelease.length?r.prerelease:null}},7032(e,t,r){"use strict";let o=r(6958);e.exports=(e,t,r)=>o(t,e,r)},9839(e,t,r){"use strict";let o=r(8767);e.exports=(e,t)=>e.sort((e,r)=>o(r,e,t))},4056(e,t,r){"use strict";let o=r(2069);e.exports=(e,t,r)=>{try{t=new o(t,r)}catch(e){return!1}return t.test(e)}},7697(e,t,r){"use strict";let o=r(8767);e.exports=(e,t)=>e.sort((e,r)=>o(e,r,t))},6807(e,t,r){"use strict";let o=r(6802);e.exports=(e,t)=>{let r=o(e,t);return r?r.version:null}},3895(e,t,r){"use strict";let o=r(152),a=r(5076),i=r(2398),s=r(9101),n=r(6802),l=r(6807),c=r(5608),u=r(3625),d=r(3086),p=r(7744),h=r(4812),f=r(8643),m=r(9283),y=r(6958),g=r(7032),v=r(6293),b=r(8767),_=r(7697),S=r(9839),$=r(1686),w=r(7257),E=r(8271),R=r(733),P=r(6479),k=r(5850),T=r(5461),O=r(7771),x=r(8610),j=r(2069),C=r(4056),N=r(6613),I=r(7114),A=r(1008),M=r(203),q=r(5372),z=r(4713),L=r(4497),D=r(9272),U=r(3490);e.exports={parse:n,valid:l,clean:c,inc:u,diff:d,major:p,minor:h,patch:f,prerelease:m,compare:y,rcompare:g,compareLoose:v,compareBuild:b,sort:_,rsort:S,gt:$,lt:w,eq:E,neq:R,gte:P,lte:k,cmp:T,coerce:O,Comparator:x,Range:j,satisfies:C,toComparators:N,maxSatisfying:I,minSatisfying:A,minVersion:M,validRange:q,outside:z,gtr:L,ltr:D,intersects:U,simplifyRange:r(4039),subset:r(22),SemVer:i,re:o.re,src:o.src,tokens:o.t,SEMVER_SPEC_VERSION:a.SEMVER_SPEC_VERSION,RELEASE_TYPES:a.RELEASE_TYPES,compareIdentifiers:s.compareIdentifiers,rcompareIdentifiers:s.rcompareIdentifiers}},5076(e){"use strict";e.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||0x1fffffffffffff,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}},674(e){"use strict";e.exports="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{}},9101(e){"use strict";let t=/^[0-9]+$/,r=(e,r)=>{if("number"==typeof e&&"number"==typeof r)return e===r?0:e<r?-1:1;let o=t.test(e),a=t.test(r);return o&&a&&(e*=1,r*=1),e===r?0:o&&!a?-1:a&&!o?1:e<r?-1:1};e.exports={compareIdentifiers:r,rcompareIdentifiers:(e,t)=>r(t,e)}},2044(e){"use strict";e.exports=class{constructor(){this.max=1e3,this.map=new Map}get(e){let t=this.map.get(e);if(void 0!==t)return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&void 0!==t){if(this.map.size>=this.max){let e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}}},4621(e){"use strict";let t=Object.freeze({loose:!0}),r=Object.freeze({});e.exports=e=>e?"object"!=typeof e?t:e:r},152(e,t,r){"use strict";let{MAX_SAFE_COMPONENT_LENGTH:o,MAX_SAFE_BUILD_LENGTH:a,MAX_LENGTH:i}=r(5076),s=r(674),n=(t=e.exports={}).re=[],l=t.safeRe=[],c=t.src=[],u=t.safeSrc=[],d=t.t={},p=0,h="[a-zA-Z0-9-]",f=[["\\s",1],["\\d",i],[h,a]],m=(e,t,r)=>{let o=(e=>{for(let[t,r]of f)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e})(t),a=p++;s(e,a,t),d[e]=a,c[a]=t,u[a]=o,n[a]=new RegExp(t,r?"g":void 0),l[a]=new RegExp(o,r?"g":void 0)};m("NUMERICIDENTIFIER","0|[1-9]\\d*"),m("NUMERICIDENTIFIERLOOSE","\\d+"),m("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${h}*`),m("MAINVERSION",`(${c[d.NUMERICIDENTIFIER]})\\.(${c[d.NUMERICIDENTIFIER]})\\.(${c[d.NUMERICIDENTIFIER]})`),m("MAINVERSIONLOOSE",`(${c[d.NUMERICIDENTIFIERLOOSE]})\\.(${c[d.NUMERICIDENTIFIERLOOSE]})\\.(${c[d.NUMERICIDENTIFIERLOOSE]})`),m("PRERELEASEIDENTIFIER",`(?:${c[d.NONNUMERICIDENTIFIER]}|${c[d.NUMERICIDENTIFIER]})`),m("PRERELEASEIDENTIFIERLOOSE",`(?:${c[d.NONNUMERICIDENTIFIER]}|${c[d.NUMERICIDENTIFIERLOOSE]})`),m("PRERELEASE",`(?:-(${c[d.PRERELEASEIDENTIFIER]}(?:\\.${c[d.PRERELEASEIDENTIFIER]})*))`),m("PRERELEASELOOSE",`(?:-?(${c[d.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[d.PRERELEASEIDENTIFIERLOOSE]})*))`),m("BUILDIDENTIFIER",`${h}+`),m("BUILD",`(?:\\+(${c[d.BUILDIDENTIFIER]}(?:\\.${c[d.BUILDIDENTIFIER]})*))`),m("FULLPLAIN",`v?${c[d.MAINVERSION]}${c[d.PRERELEASE]}?${c[d.BUILD]}?`),m("FULL",`^${c[d.FULLPLAIN]}$`),m("LOOSEPLAIN",`[v=\\s]*${c[d.MAINVERSIONLOOSE]}${c[d.PRERELEASELOOSE]}?${c[d.BUILD]}?`),m("LOOSE",`^${c[d.LOOSEPLAIN]}$`),m("GTLT","((?:<|>)?=?)"),m("XRANGEIDENTIFIERLOOSE",`${c[d.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),m("XRANGEIDENTIFIER",`${c[d.NUMERICIDENTIFIER]}|x|X|\\*`),m("XRANGEPLAIN",`[v=\\s]*(${c[d.XRANGEIDENTIFIER]})(?:\\.(${c[d.XRANGEIDENTIFIER]})(?:\\.(${c[d.XRANGEIDENTIFIER]})(?:${c[d.PRERELEASE]})?${c[d.BUILD]}?)?)?`),m("XRANGEPLAINLOOSE",`[v=\\s]*(${c[d.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[d.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[d.XRANGEIDENTIFIERLOOSE]})(?:${c[d.PRERELEASELOOSE]})?${c[d.BUILD]}?)?)?`),m("XRANGE",`^${c[d.GTLT]}\\s*${c[d.XRANGEPLAIN]}$`),m("XRANGELOOSE",`^${c[d.GTLT]}\\s*${c[d.XRANGEPLAINLOOSE]}$`),m("COERCEPLAIN",`(^|[^\\d])(\\d{1,${o}})(?:\\.(\\d{1,${o}}))?(?:\\.(\\d{1,${o}}))?`),m("COERCE",`${c[d.COERCEPLAIN]}(?:$|[^\\d])`),m("COERCEFULL",c[d.COERCEPLAIN]+`(?:${c[d.PRERELEASE]})?`+`(?:${c[d.BUILD]})?`+"(?:$|[^\\d])"),m("COERCERTL",c[d.COERCE],!0),m("COERCERTLFULL",c[d.COERCEFULL],!0),m("LONETILDE","(?:~>?)"),m("TILDETRIM",`(\\s*)${c[d.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",m("TILDE",`^${c[d.LONETILDE]}${c[d.XRANGEPLAIN]}$`),m("TILDELOOSE",`^${c[d.LONETILDE]}${c[d.XRANGEPLAINLOOSE]}$`),m("LONECARET","(?:\\^)"),m("CARETTRIM",`(\\s*)${c[d.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",m("CARET",`^${c[d.LONECARET]}${c[d.XRANGEPLAIN]}$`),m("CARETLOOSE",`^${c[d.LONECARET]}${c[d.XRANGEPLAINLOOSE]}$`),m("COMPARATORLOOSE",`^${c[d.GTLT]}\\s*(${c[d.LOOSEPLAIN]})$|^$`),m("COMPARATOR",`^${c[d.GTLT]}\\s*(${c[d.FULLPLAIN]})$|^$`),m("COMPARATORTRIM",`(\\s*)${c[d.GTLT]}\\s*(${c[d.LOOSEPLAIN]}|${c[d.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",m("HYPHENRANGE",`^\\s*(${c[d.XRANGEPLAIN]})\\s+-\\s+(${c[d.XRANGEPLAIN]})\\s*$`),m("HYPHENRANGELOOSE",`^\\s*(${c[d.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[d.XRANGEPLAINLOOSE]})\\s*$`),m("STAR","(<|>)?=?\\s*\\*"),m("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),m("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")},4497(e,t,r){"use strict";let o=r(4713);e.exports=(e,t,r)=>o(e,t,">",r)},3490(e,t,r){"use strict";let o=r(2069);e.exports=(e,t,r)=>(e=new o(e,r),t=new o(t,r),e.intersects(t,r))},9272(e,t,r){"use strict";let o=r(4713);e.exports=(e,t,r)=>o(e,t,"<",r)},7114(e,t,r){"use strict";let o=r(2398),a=r(2069);e.exports=(e,t,r)=>{let i=null,s=null,n=null;try{n=new a(t,r)}catch(e){return null}return e.forEach(e=>{n.test(e)&&(!i||-1===s.compare(e))&&(s=new o(i=e,r))}),i}},1008(e,t,r){"use strict";let o=r(2398),a=r(2069);e.exports=(e,t,r)=>{let i=null,s=null,n=null;try{n=new a(t,r)}catch(e){return null}return e.forEach(e=>{n.test(e)&&(!i||1===s.compare(e))&&(s=new o(i=e,r))}),i}},203(e,t,r){"use strict";let o=r(2398),a=r(2069),i=r(1686);e.exports=(e,t)=>{e=new a(e,t);let r=new o("0.0.0");if(e.test(r)||(r=new o("0.0.0-0"),e.test(r)))return r;r=null;for(let t=0;t<e.set.length;++t){let a=e.set[t],s=null;a.forEach(e=>{let t=new o(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":(!s||i(t,s))&&(s=t);break;case"<":case"<=":break;default:throw Error(`Unexpected operation: ${e.operator}`)}}),s&&(!r||i(r,s))&&(r=s)}return r&&e.test(r)?r:null}},4713(e,t,r){"use strict";let o=r(2398),a=r(8610),{ANY:i}=a,s=r(2069),n=r(4056),l=r(1686),c=r(7257),u=r(5850),d=r(6479);e.exports=(e,t,r,p)=>{let h,f,m,y,g;switch(e=new o(e,p),t=new s(t,p),r){case">":h=l,f=u,m=c,y=">",g=">=";break;case"<":h=c,f=d,m=l,y="<",g="<=";break;default:throw TypeError('Must provide a hilo val of "<" or ">"')}if(n(e,t,p))return!1;for(let r=0;r<t.set.length;++r){let o=t.set[r],s=null,n=null;if(o.forEach(e=>{e.semver===i&&(e=new a(">=0.0.0")),s=s||e,n=n||e,h(e.semver,s.semver,p)?s=e:m(e.semver,n.semver,p)&&(n=e)}),s.operator===y||s.operator===g||(!n.operator||n.operator===y)&&f(e,n.semver)||n.operator===g&&m(e,n.semver))return!1}return!0}},4039(e,t,r){"use strict";let o=r(4056),a=r(6958);e.exports=(e,t,r)=>{let i=[],s=null,n=null,l=e.sort((e,t)=>a(e,t,r));for(let e of l)o(e,t,r)?(n=e,s||(s=e)):(n&&i.push([s,n]),n=null,s=null);s&&i.push([s,null]);let c=[];for(let[e,t]of i)e===t?c.push(e):t||e!==l[0]?t?e===l[0]?c.push(`<=${t}`):c.push(`${e} - ${t}`):c.push(`>=${e}`):c.push("*");let u=c.join(" || "),d="string"==typeof t.raw?t.raw:String(t);return u.length<d.length?u:t}},22(e,t,r){"use strict";let o=r(2069),a=r(8610),{ANY:i}=a,s=r(4056),n=r(6958),l=[new a(">=0.0.0-0")],c=[new a(">=0.0.0")],u=(e,t,r)=>{let o,a,u,h,f,m,y;if(e===t)return!0;if(1===e.length&&e[0].semver===i)if(1===t.length&&t[0].semver===i)return!0;else e=r.includePrerelease?l:c;if(1===t.length&&t[0].semver===i)if(r.includePrerelease)return!0;else t=c;let g=new Set;for(let t of e)">"===t.operator||">="===t.operator?o=d(o,t,r):"<"===t.operator||"<="===t.operator?a=p(a,t,r):g.add(t.semver);if(g.size>1)return null;if(o&&a&&((u=n(o.semver,a.semver,r))>0||0===u&&(">="!==o.operator||"<="!==a.operator)))return null;for(let e of g){if(o&&!s(e,String(o),r)||a&&!s(e,String(a),r))return null;for(let o of t)if(!s(e,String(o),r))return!1;return!0}let v=!!a&&!r.includePrerelease&&!!a.semver.prerelease.length&&a.semver,b=!!o&&!r.includePrerelease&&!!o.semver.prerelease.length&&o.semver;for(let e of(v&&1===v.prerelease.length&&"<"===a.operator&&0===v.prerelease[0]&&(v=!1),t)){if(y=y||">"===e.operator||">="===e.operator,m=m||"<"===e.operator||"<="===e.operator,o){if(b&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===b.major&&e.semver.minor===b.minor&&e.semver.patch===b.patch&&(b=!1),">"===e.operator||">="===e.operator){if((h=d(o,e,r))===e&&h!==o)return!1}else if(">="===o.operator&&!s(o.semver,String(e),r))return!1}if(a){if(v&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===v.major&&e.semver.minor===v.minor&&e.semver.patch===v.patch&&(v=!1),"<"===e.operator||"<="===e.operator){if((f=p(a,e,r))===e&&f!==a)return!1}else if("<="===a.operator&&!s(a.semver,String(e),r))return!1}if(!e.operator&&(a||o)&&0!==u)return!1}return(!o||!m||!!a||0===u)&&(!a||!y||!!o||0===u)&&!b&&!v&&!0},d=(e,t,r)=>{if(!e)return t;let o=n(e.semver,t.semver,r);return o>0?e:o<0||">"===t.operator&&">="===e.operator?t:e},p=(e,t,r)=>{if(!e)return t;let o=n(e.semver,t.semver,r);return o<0?e:o>0||"<"===t.operator&&"<="===e.operator?t:e};e.exports=(e,t,r={})=>{if(e===t)return!0;e=new o(e,r),t=new o(t,r);let a=!1;e:for(let o of e.set){for(let e of t.set){let t=u(o,e,r);if(a=a||null!==t,t)continue e}if(a)return!1}return!0}},6613(e,t,r){"use strict";let o=r(2069);e.exports=(e,t)=>new o(e,t).set.map(e=>e.map(e=>e.value).join(" ").trim().split(" "))},5372(e,t,r){"use strict";let o=r(2069);e.exports=(e,t)=>{try{return new o(e,t).range||"*"}catch(e){return null}}},600(e,t,r){"use strict";let o=r(9638);e.exports=(e="")=>{let t=e.match(o);if(!t)return null;let[r,a]=t[0].replace(/#! ?/,"").split(" "),i=r.split("/").pop();return"env"===i?a:a?`${i} ${a}`:i}},9638(e){"use strict";e.exports=/^#!(.*)/},1905(e,t,r){let o="win32"===process.platform||"cygwin"===process.env.OSTYPE||"msys"===process.env.OSTYPE,a=r(6928),i=o?";":":",s=r(9344),n=e=>Object.assign(Error(`not found: ${e}`),{code:"ENOENT"}),l=(e,t)=>{let r=t.colon||i,a=e.match(/\//)||o&&e.match(/\\/)?[""]:[...o?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(r)],s=o?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",n=o?s.split(r):[""];return o&&-1!==e.indexOf(".")&&""!==n[0]&&n.unshift(""),{pathEnv:a,pathExt:n,pathExtExe:s}},c=(e,t,r)=>{"function"==typeof t&&(r=t,t={}),t||(t={});let{pathEnv:o,pathExt:i,pathExtExe:c}=l(e,t),u=[],d=r=>new Promise((i,s)=>{if(r===o.length)return t.all&&u.length?i(u):s(n(e));let l=o[r],c=/^".*"$/.test(l)?l.slice(1,-1):l,d=a.join(c,e);i(p(!c&&/^\.[\\\/]/.test(e)?e.slice(0,2)+d:d,r,0))}),p=(e,r,o)=>new Promise((a,n)=>{if(o===i.length)return a(d(r+1));let l=i[o];s(e+l,{pathExt:c},(i,s)=>{if(!i&&s)if(!t.all)return a(e+l);else u.push(e+l);return a(p(e,r,o+1))})});return r?d(0).then(e=>r(null,e),r):d(0)};e.exports=c,c.sync=(e,t)=>{let{pathEnv:r,pathExt:o,pathExtExe:i}=l(e,t=t||{}),c=[];for(let n=0;n<r.length;n++){let l=r[n],u=/^".*"$/.test(l)?l.slice(1,-1):l,d=a.join(u,e),p=!u&&/^\.[\\\/]/.test(e)?e.slice(0,2)+d:d;for(let e=0;e<o.length;e++){let r=p+o[e];try{if(s.sync(r,{pathExt:i}))if(!t.all)return r;else c.push(r)}catch(e){}}}if(t.all&&c.length)return c;if(t.nothrow)return null;throw n(e)}},181(e){"use strict";e.exports=require("buffer")},5317(e){"use strict";e.exports=require("child_process")},6982(e){"use strict";e.exports=require("crypto")},9896(e){"use strict";e.exports=require("fs")},7598(e){"use strict";e.exports=require("node:crypto")},857(e){"use strict";e.exports=require("os")},6928(e){"use strict";e.exports=require("path")},2203(e){"use strict";e.exports=require("stream")},9023(e){"use strict";e.exports=require("util")},4953(t){"use strict";t.exports=e},4891(e,t,r){"use strict";let o;r.d(t,{importJWK:()=>G,importPKCS8:()=>B,SignJWT:()=>U});let a=new TextEncoder,i=new TextDecoder;function s(e){let t=new Uint8Array(e.length);for(let r=0;r<e.length;r++){let o=e.charCodeAt(r);if(o>127)throw TypeError("non-ASCII string encountered in encode()");t[r]=o}return t}function n(e){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(e);let t=atob(e),r=new Uint8Array(t.length);for(let e=0;e<t.length;e++)r[e]=t.charCodeAt(e);return r}function l(e){if(Uint8Array.fromBase64)return Uint8Array.fromBase64("string"==typeof e?e:i.decode(e),{alphabet:"base64url"});let t=e;t instanceof Uint8Array&&(t=i.decode(t)),t=t.replace(/-/g,"+").replace(/_/g,"/");try{return n(t)}catch{throw TypeError("The input to be decoded is not correctly encoded.")}}function c(e){let t=e;return("string"==typeof t&&(t=a.encode(t)),Uint8Array.prototype.toBase64)?t.toBase64({alphabet:"base64url",omitPadding:!0}):(function(e){if(Uint8Array.prototype.toBase64)return e.toBase64();let t=[];for(let r=0;r<e.length;r+=32768)t.push(String.fromCharCode.apply(null,e.subarray(r,r+32768)));return btoa(t.join(""))})(t).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}class u extends Error{static code="ERR_JOSE_GENERIC";code="ERR_JOSE_GENERIC";constructor(e,t){super(e,t),this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}}class d extends u{static code="ERR_JOSE_NOT_SUPPORTED";code="ERR_JOSE_NOT_SUPPORTED"}class p extends u{static code="ERR_JWS_INVALID";code="ERR_JWS_INVALID"}class h extends u{static code="ERR_JWT_INVALID";code="ERR_JWT_INVALID"}class f extends u{[Symbol.asyncIterator];static code="ERR_JWKS_MULTIPLE_MATCHING_KEYS";code="ERR_JWKS_MULTIPLE_MATCHING_KEYS";constructor(e="multiple matching keys found in the JSON Web Key Set",t){super(e,t)}}let m=(e,t="algorithm.name")=>TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`);function y(e,t){if(parseInt(e.hash.name.slice(4),10)!==t)throw m(`SHA-${t}`,"algorithm.hash")}function g(e,t,...r){if((r=r.filter(Boolean)).length>2){let t=r.pop();e+=`one of type ${r.join(", ")}, or ${t}.`}else 2===r.length?e+=`one of type ${r[0]} or ${r[1]}.`:e+=`of type ${r[0]}.`;return null==t?e+=` Received ${t}`:"function"==typeof t&&t.name?e+=` Received function ${t.name}`:"object"==typeof t&&null!=t&&t.constructor?.name&&(e+=` Received an instance of ${t.constructor.name}`),e}let v=(e,t,...r)=>g(`Key for the ${e} algorithm must be `,t,...r);async function b(e,t,r){if(t instanceof Uint8Array){if(!e.startsWith("HS"))throw TypeError(((e,...t)=>g("Key must be ",e,...t))(t,"CryptoKey","KeyObject","JSON Web Key"));return crypto.subtle.importKey("raw",t,{hash:`SHA-${e.slice(-3)}`,name:"HMAC"},!1,[r])}return!function(e,t,r){switch(t){case"HS256":case"HS384":case"HS512":if("HMAC"!==e.algorithm.name)throw m("HMAC");y(e.algorithm,parseInt(t.slice(2),10));break;case"RS256":case"RS384":case"RS512":if("RSASSA-PKCS1-v1_5"!==e.algorithm.name)throw m("RSASSA-PKCS1-v1_5");y(e.algorithm,parseInt(t.slice(2),10));break;case"PS256":case"PS384":case"PS512":if("RSA-PSS"!==e.algorithm.name)throw m("RSA-PSS");y(e.algorithm,parseInt(t.slice(2),10));break;case"Ed25519":case"EdDSA":if("Ed25519"!==e.algorithm.name)throw m("Ed25519");break;case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":let o;if(o=e.algorithm,o.name!==t)throw m(t);break;case"ES256":case"ES384":case"ES512":{if("ECDSA"!==e.algorithm.name)throw m("ECDSA");let r=function(e){switch(e){case"ES256":return"P-256";case"ES384":return"P-384";case"ES512":return"P-521";default:throw Error("unreachable")}}(t);if(e.algorithm.namedCurve!==r)throw m(r,"algorithm.namedCurve");break}default:throw TypeError("CryptoKey does not support this operation")}if(r&&!e.usages.includes(r))throw TypeError(`CryptoKey does not support this operation, its usages must include ${r}.`)}(t,e,r),t}async function _(e,t,r){let o=await b(e,t,"sign");return!function(e,t){if(e.startsWith("RS")||e.startsWith("PS")){let{modulusLength:r}=t.algorithm;if("number"!=typeof r||r<2048)throw TypeError(`${e} requires key modulusLength to be 2048 bits or larger`)}}(e,o),new Uint8Array(await crypto.subtle.sign(function(e,t){let r=`SHA-${e.slice(-3)}`;switch(e){case"HS256":case"HS384":case"HS512":return{hash:r,name:"HMAC"};case"PS256":case"PS384":case"PS512":return{hash:r,name:"RSA-PSS",saltLength:parseInt(e.slice(-3),10)>>3};case"RS256":case"RS384":case"RS512":return{hash:r,name:"RSASSA-PKCS1-v1_5"};case"ES256":case"ES384":case"ES512":return{hash:r,name:"ECDSA",namedCurve:t.namedCurve};case"Ed25519":case"EdDSA":return{name:"Ed25519"};case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":return{name:e};default:throw new d(`alg ${e} is not supported either by JOSE or your javascript runtime`)}}(e,o.algorithm),o,r))}function S(e){if("object"!=typeof e||null===e||"[object Object]"!==Object.prototype.toString.call(e))return!1;if(null===Object.getPrototypeOf(e))return!0;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}let $=e=>S(e)&&"string"==typeof e.kty,w=e=>{if(e?.[Symbol.toStringTag]==="CryptoKey")return!0;try{return e instanceof CryptoKey}catch{return!1}},E=e=>e?.[Symbol.toStringTag]==="KeyObject",R=e=>w(e)||E(e),P=e=>e?.[Symbol.toStringTag],k=(e,t,r)=>{if(void 0!==t.use){let e;switch(r){case"sign":case"verify":e="sig";break;case"encrypt":case"decrypt":e="enc"}if(t.use!==e)throw TypeError(`Invalid key for this operation, its "use" must be "${e}" when present`)}if(void 0!==t.alg&&t.alg!==e)throw TypeError(`Invalid key for this operation, its "alg" must be "${e}" when present`);if(Array.isArray(t.key_ops)){let o;switch(!0){case"sign"===r||"verify"===r:case"dir"===e:case e.includes("CBC-HS"):o=r;break;case e.startsWith("PBES2"):o="deriveBits";break;case/^A\d{3}(?:GCM)?(?:KW)?$/.test(e):o=!e.includes("GCM")&&e.endsWith("KW")?"encrypt"===r?"wrapKey":"unwrapKey":r;break;case"encrypt"===r&&e.startsWith("RSA"):o="wrapKey";break;case"decrypt"===r:o=e.startsWith("RSA")?"unwrapKey":"deriveBits"}if(o&&t.key_ops?.includes?.(o)===!1)throw TypeError(`Invalid key for this operation, its "key_ops" must include "${o}" when present`)}return!0},T='Invalid or unsupported JWK "alg" (Algorithm) Parameter value';async function O(e){if(!e.alg)throw TypeError('"alg" argument is required when "jwk.alg" is not present');let{algorithm:t,keyUsages:r}=function(e){let t,r;switch(e.kty){case"AKP":switch(e.alg){case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":t={name:e.alg},r=e.priv?["sign"]:["verify"];break;default:throw new d(T)}break;case"RSA":switch(e.alg){case"PS256":case"PS384":case"PS512":t={name:"RSA-PSS",hash:`SHA-${e.alg.slice(-3)}`},r=e.d?["sign"]:["verify"];break;case"RS256":case"RS384":case"RS512":t={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${e.alg.slice(-3)}`},r=e.d?["sign"]:["verify"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":t={name:"RSA-OAEP",hash:`SHA-${parseInt(e.alg.slice(-3),10)||1}`},r=e.d?["decrypt","unwrapKey"]:["encrypt","wrapKey"];break;default:throw new d(T)}break;case"EC":switch(e.alg){case"ES256":case"ES384":case"ES512":t={name:"ECDSA",namedCurve:({ES256:"P-256",ES384:"P-384",ES512:"P-521"})[e.alg]},r=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":t={name:"ECDH",namedCurve:e.crv},r=e.d?["deriveBits"]:[];break;default:throw new d(T)}break;case"OKP":switch(e.alg){case"Ed25519":case"EdDSA":t={name:"Ed25519"},r=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":t={name:e.crv},r=e.d?["deriveBits"]:[];break;default:throw new d(T)}break;default:throw new d('Invalid or unsupported JWK "kty" (Key Type) Parameter value')}return{algorithm:t,keyUsages:r}}(e),o={...e};return"AKP"!==o.kty&&delete o.alg,delete o.use,crypto.subtle.importKey("jwk",o,t,e.ext??(!e.d&&!e.priv),e.key_ops??r)}let x="given KeyObject instance cannot be used for this algorithm",j=async(e,t,r,a=!1)=>{let i=(o||=new WeakMap).get(e);if(i?.[r])return i[r];let s=await O({...t,alg:r});return a&&Object.freeze(e),i?i[r]=s:o.set(e,{[r]:s}),s};async function C(e,t){if(e instanceof Uint8Array||w(e))return e;if(E(e)){if("secret"===e.type)return e.export();if("toCryptoKey"in e&&"function"==typeof e.toCryptoKey)try{return((e,t)=>{let r,a=(o||=new WeakMap).get(e);if(a?.[t])return a[t];let i="public"===e.type,s=!!i;if("x25519"===e.asymmetricKeyType){switch(t){case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":break;default:throw TypeError(x)}r=e.toCryptoKey(e.asymmetricKeyType,s,i?[]:["deriveBits"])}if("ed25519"===e.asymmetricKeyType){if("EdDSA"!==t&&"Ed25519"!==t)throw TypeError(x);r=e.toCryptoKey(e.asymmetricKeyType,s,[i?"verify":"sign"])}switch(e.asymmetricKeyType){case"ml-dsa-44":case"ml-dsa-65":case"ml-dsa-87":if(t!==e.asymmetricKeyType.toUpperCase())throw TypeError(x);r=e.toCryptoKey(e.asymmetricKeyType,s,[i?"verify":"sign"])}if("rsa"===e.asymmetricKeyType){let o;switch(t){case"RSA-OAEP":o="SHA-1";break;case"RS256":case"PS256":case"RSA-OAEP-256":o="SHA-256";break;case"RS384":case"PS384":case"RSA-OAEP-384":o="SHA-384";break;case"RS512":case"PS512":case"RSA-OAEP-512":o="SHA-512";break;default:throw TypeError(x)}if(t.startsWith("RSA-OAEP"))return e.toCryptoKey({name:"RSA-OAEP",hash:o},s,i?["encrypt"]:["decrypt"]);r=e.toCryptoKey({name:t.startsWith("PS")?"RSA-PSS":"RSASSA-PKCS1-v1_5",hash:o},s,[i?"verify":"sign"])}if("ec"===e.asymmetricKeyType){let o=new Map([["prime256v1","P-256"],["secp384r1","P-384"],["secp521r1","P-521"]]).get(e.asymmetricKeyDetails?.namedCurve);if(!o)throw TypeError(x);let a={ES256:"P-256",ES384:"P-384",ES512:"P-521"};a[t]&&o===a[t]&&(r=e.toCryptoKey({name:"ECDSA",namedCurve:o},s,[i?"verify":"sign"])),t.startsWith("ECDH-ES")&&(r=e.toCryptoKey({name:"ECDH",namedCurve:o},s,i?[]:["deriveBits"]))}if(!r)throw TypeError(x);return a?a[t]=r:o.set(e,{[t]:r}),r})(e,t)}catch(e){if(e instanceof TypeError)throw e}let r=e.export({format:"jwk"});return j(e,r,t)}if($(e))return e.k?l(e.k):j(e,e,t,!0);throw Error("unreachable")}function N(e,t){if(e)throw TypeError(`${t} can only be called once`)}Symbol();class I{#e;#t;#r;constructor(e){if(!(e instanceof Uint8Array))throw TypeError("payload must be an instance of Uint8Array");this.#e=e}setProtectedHeader(e){return N(this.#t,"setProtectedHeader"),this.#t=e,this}setUnprotectedHeader(e){return N(this.#r,"setUnprotectedHeader"),this.#r=e,this}async sign(e,t){let r,o,a,i;if(!this.#t&&!this.#r)throw new p("either setProtectedHeader or setUnprotectedHeader must be called before #sign()");if(!function(...e){let t,r=e.filter(Boolean);if(0===r.length||1===r.length)return!0;for(let e of r){let r=Object.keys(e);if(!t||0===t.size){t=new Set(r);continue}for(let e of r){if(t.has(e))return!1;t.add(e)}}return!0}(this.#t,this.#r))throw new p("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");let n={...this.#t,...this.#r},l=function(e,t,r,o,a){let i;if(void 0!==a.crit&&o?.crit===void 0)throw new e('"crit" (Critical) Header Parameter MUST be integrity protected');if(!o||void 0===o.crit)return new Set;if(!Array.isArray(o.crit)||0===o.crit.length||o.crit.some(e=>"string"!=typeof e||0===e.length))throw new e('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');for(let s of(i=void 0!==r?new Map([...Object.entries(r),...t.entries()]):t,o.crit)){if(!i.has(s))throw new d(`Extension Header Parameter "${s}" is not recognized`);if(void 0===a[s])throw new e(`Extension Header Parameter "${s}" is missing`);if(i.get(s)&&void 0===o[s])throw new e(`Extension Header Parameter "${s}" MUST be integrity protected`)}return new Set(o.crit)}(p,new Map([["b64",!0]]),t?.crit,this.#t,n),u=!0;if(l.has("b64")&&"boolean"!=typeof(u=this.#t.b64))throw new p('The "b64" (base64url-encode payload) Header Parameter must be a boolean');let{alg:h}=n;if("string"!=typeof h||!h)throw new p('JWS "alg" (Algorithm) Header Parameter missing or invalid');var f="sign";switch(h.substring(0,2)){case"A1":case"A2":case"di":case"HS":case"PB":((e,t,r)=>{if(!(t instanceof Uint8Array)){if($(t)){if("oct"===t.kty&&"string"==typeof t.k&&k(e,t,r))return;throw TypeError('JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present')}if(!R(t))throw TypeError(v(e,t,"CryptoKey","KeyObject","JSON Web Key","Uint8Array"));if("secret"!==t.type)throw TypeError(`${P(t)} instances for symmetric algorithms must be of type "secret"`)}})(h,e,f);break;default:((e,t,r)=>{if($(t))switch(r){case"decrypt":case"sign":if("oct"!==t.kty&&("AKP"===t.kty&&"string"==typeof t.priv||"string"==typeof t.d)&&k(e,t,r))return;throw TypeError("JSON Web Key for this operation must be a private JWK");case"encrypt":case"verify":if("oct"!==t.kty&&void 0===t.d&&void 0===t.priv&&k(e,t,r))return;throw TypeError("JSON Web Key for this operation must be a public JWK")}if(!R(t))throw TypeError(v(e,t,"CryptoKey","KeyObject","JSON Web Key"));if("secret"===t.type)throw TypeError(`${P(t)} instances for asymmetric algorithms must not be of type "secret"`);if("public"===t.type)switch(r){case"sign":throw TypeError(`${P(t)} instances for asymmetric algorithm signing must be of type "private"`);case"decrypt":throw TypeError(`${P(t)} instances for asymmetric algorithm decryption must be of type "private"`)}if("private"===t.type)switch(r){case"verify":throw TypeError(`${P(t)} instances for asymmetric algorithm verifying must be of type "public"`);case"encrypt":throw TypeError(`${P(t)} instances for asymmetric algorithm encryption must be of type "public"`)}})(h,e,f)}u?o=s(r=c(this.#e)):(o=this.#e,r=""),this.#t?i=s(a=c(JSON.stringify(this.#t))):(a="",i=new Uint8Array);let m=function(...e){let t=new Uint8Array(e.reduce((e,{length:t})=>e+t,0)),r=0;for(let o of e)t.set(o,r),r+=o.length;return t}(i,s("."),o),y=await C(e,h),g={signature:c(await _(h,y,m)),payload:r};return this.#r&&(g.header=this.#r),this.#t&&(g.protected=a),g}}class A{#o;constructor(e){this.#o=new I(e)}setProtectedHeader(e){return this.#o.setProtectedHeader(e),this}async sign(e,t){let r=await this.#o.sign(e,t);if(void 0===r.payload)throw TypeError("use the flattened module for creating JWS with b64: false");return`${r.protected}.${r.payload}.${r.signature}`}}let M=e=>Math.floor(e.getTime()/1e3),q=/^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i;function z(e){let t,r=q.exec(e);if(!r||r[4]&&r[1])throw TypeError("Invalid time period format");let o=parseFloat(r[2]);switch(r[3].toLowerCase()){case"sec":case"secs":case"second":case"seconds":case"s":t=Math.round(o);break;case"minute":case"minutes":case"min":case"mins":case"m":t=Math.round(60*o);break;case"hour":case"hours":case"hr":case"hrs":case"h":t=Math.round(3600*o);break;case"day":case"days":case"d":t=Math.round(86400*o);break;case"week":case"weeks":case"w":t=Math.round(604800*o);break;default:t=Math.round(0x1e187e0*o)}return"-"===r[1]||"ago"===r[4]?-t:t}function L(e,t){if(!Number.isFinite(t))throw TypeError(`Invalid ${e} input`);return t}class D{#e;constructor(e){if(!S(e))throw TypeError("JWT Claims Set MUST be an object");this.#e=structuredClone(e)}data(){return a.encode(JSON.stringify(this.#e))}get iss(){return this.#e.iss}set iss(e){this.#e.iss=e}get sub(){return this.#e.sub}set sub(e){this.#e.sub=e}get aud(){return this.#e.aud}set aud(e){this.#e.aud=e}set jti(e){this.#e.jti=e}set nbf(e){"number"==typeof e?this.#e.nbf=L("setNotBefore",e):e instanceof Date?this.#e.nbf=L("setNotBefore",M(e)):this.#e.nbf=M(new Date)+z(e)}set exp(e){"number"==typeof e?this.#e.exp=L("setExpirationTime",e):e instanceof Date?this.#e.exp=L("setExpirationTime",M(e)):this.#e.exp=M(new Date)+z(e)}set iat(e){void 0===e?this.#e.iat=M(new Date):e instanceof Date?this.#e.iat=L("setIssuedAt",M(e)):"string"==typeof e?this.#e.iat=L("setIssuedAt",M(new Date)+z(e)):this.#e.iat=L("setIssuedAt",e)}}class U{#t;#a;constructor(e={}){this.#a=new D(e)}setIssuer(e){return this.#a.iss=e,this}setSubject(e){return this.#a.sub=e,this}setAudience(e){return this.#a.aud=e,this}setJti(e){return this.#a.jti=e,this}setNotBefore(e){return this.#a.nbf=e,this}setExpirationTime(e){return this.#a.exp=e,this}setIssuedAt(e){return this.#a.iat=e,this}setProtectedHeader(e){return this.#t=e,this}async sign(e,t){let r=new A(this.#a.data());if(r.setProtectedHeader(this.#t),Array.isArray(this.#t?.crit)&&this.#t.crit.includes("b64")&&!1===this.#t.b64)throw new h("JWTs MUST NOT use unencoded payload");return r.sign(e,t)}}let V=(e,t)=>{if(e.byteLength!==t.length)return!1;for(let r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0},F=e=>{let t=e.data[e.pos++];if(128&t){let r=127&t,o=0;for(let t=0;t<r;t++)o=o<<8|e.data[e.pos++];return o}return t},H=(e,t,r)=>{if(e.data[e.pos++]!==t)throw Error(r)},K=(e,t)=>{let r=e.data.subarray(e.pos,e.pos+t);return e.pos+=t,r},J=async(e,t,r,o)=>{let a,i,s="spki"===e,n=()=>s?["verify"]:["sign"];switch(r){case"PS256":case"PS384":case"PS512":a={name:"RSA-PSS",hash:`SHA-${r.slice(-3)}`},i=n();break;case"RS256":case"RS384":case"RS512":a={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${r.slice(-3)}`},i=n();break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":a={name:"RSA-OAEP",hash:`SHA-${parseInt(r.slice(-3),10)||1}`},i=s?["encrypt","wrapKey"]:["decrypt","unwrapKey"];break;case"ES256":case"ES384":case"ES512":a={name:"ECDSA",namedCurve:({ES256:"P-256",ES384:"P-384",ES512:"P-521"})[r]},i=n();break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":try{let e=o.getNamedCurve(t);a="X25519"===e?{name:"X25519"}:{name:"ECDH",namedCurve:e}}catch(e){throw new d("Invalid or unsupported key format")}i=s?[]:["deriveBits"];break;case"Ed25519":case"EdDSA":a={name:"Ed25519"},i=n();break;case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":a={name:r},i=n();break;default:throw new d('Invalid or unsupported "alg" (Algorithm) value')}return crypto.subtle.importKey(e,t,a,o?.extractable??!!s,i)};async function B(e,t,r){let o,a,i;if("string"!=typeof e||0!==e.indexOf("-----BEGIN PRIVATE KEY-----"))throw TypeError('"pkcs8" must be PKCS#8 formatted string');return o=/(?:-----(?:BEGIN|END) PRIVATE KEY-----|\s)/g,a=n(e.replace(o,"")),i=r,t?.startsWith?.("ECDH-ES")&&((i||={}).getNamedCurve=e=>{let t,r={data:e,pos:0};return H(r,48,"Invalid PKCS#8 structure"),F(r),H(r,2,"Expected version field"),t=F(r),r.pos+=t,H(r,48,"Expected algorithm identifier"),F(r),r.pos,(e=>{let t,r=(H(e,6,"Expected algorithm OID"),t=F(e),K(e,t));if(V(r,[43,101,110]))return"X25519";if(!V(r,[42,134,72,206,61,2,1]))throw Error("Unsupported key algorithm");H(e,6,"Expected curve OID");let o=F(e),a=K(e,o);for(let{name:e,oid:t}of[{name:"P-256",oid:[42,134,72,206,61,3,1,7]},{name:"P-384",oid:[43,129,4,0,34]},{name:"P-521",oid:[43,129,4,0,35]}])if(V(a,t))return e;throw Error("Unsupported named curve")})(r)}),J("pkcs8",a,t,i)}async function G(e,t,r){let o;if(!S(e))throw TypeError("JWK must be an object");switch(t??=e.alg,o??=r?.extractable??e.ext,e.kty){case"oct":if("string"!=typeof e.k||!e.k)throw TypeError('missing "k" (Key Value) Parameter value');return l(e.k);case"RSA":if("oth"in e&&void 0!==e.oth)throw new d('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');return O({...e,alg:t,ext:o});case"AKP":if("string"!=typeof e.alg||!e.alg)throw TypeError('missing "alg" (Algorithm) Parameter value');if(void 0!==t&&t!==e.alg)throw TypeError("JWK alg and alg option value mismatch");return O({...e,ext:o});case"EC":case"OKP":return O({...e,alg:t,ext:o});default:throw new d('Unsupported "kty" (Key Type) Parameter value')}}},4519(e){"use strict";e.exports=JSON.parse('{"name":"dotenv","version":"16.6.1","description":"Loads environment variables from .env file","main":"lib/main.js","types":"lib/main.d.ts","exports":{".":{"types":"./lib/main.d.ts","require":"./lib/main.js","default":"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},"scripts":{"dts-check":"tsc --project tests/types/tsconfig.json","lint":"standard","pretest":"npm run lint && npm run dts-check","test":"tap run --allow-empty-coverage --disable-coverage --timeout=60000","test:coverage":"tap run --show-full-coverage --timeout=60000 --coverage-report=text --coverage-report=lcov","prerelease":"npm test","release":"standard-version"},"repository":{"type":"git","url":"git://github.com/motdotla/dotenv.git"},"homepage":"https://github.com/motdotla/dotenv#readme","funding":"https://dotenvx.com","keywords":["dotenv","env",".env","environment","variables","config","settings"],"readmeFilename":"README.md","license":"BSD-2-Clause","devDependencies":{"@types/node":"^18.11.3","decache":"^4.6.2","sinon":"^14.0.1","standard":"^17.0.0","standard-version":"^9.5.0","tap":"^19.2.0","typescript":"^4.8.4"},"engines":{"node":">=12"},"browser":{"fs":false}}')},8330(e){"use strict";e.exports=JSON.parse('{"name":"xmcp","description":"The MCP framework","version":"1.1.1","author":{"name":"xmcp","email":"support@xmcp.dev","url":"https://xmcp.dev"},"contributors":[{"name":"Valentina Bearzotti","email":"valebearzotti1@gmail.com","url":"https://github.com/valebearzotti"},{"name":"Jose Rago","email":"jose@basement.studio","url":"https://github.com/ragojose"}],"license":"MIT","keywords":["mcp","modelcontextprotocol","http","stdio"],"repository":{"type":"git","url":"https://github.com/basementstudio/xmcp"},"homepage":"https://xmcp.dev","type":"commonjs","main":"./dist/index.js","types":"./dist/index.d.ts","bin":{"xmcp":"dist/cli.js"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.js","default":"./dist/index.js"},"./host-bridge":{"types":"./dist/host-bridge.d.ts","import":"./dist/host-bridge.js","require":"./dist/host-bridge.js","default":"./dist/host-bridge.js"},"./headers":{"types":"./dist/runtime/headers.d.ts","require":"./dist/runtime/headers.js","default":"./dist/runtime/headers.js"},"./cloudflare":{"types":"./dist/cloudflare.d.ts","import":"./dist/cloudflare.js","require":"./dist/cloudflare.js","default":"./dist/cloudflare.js"},"./config":{"types":"./dist/config/index.d.ts","import":"./dist/config.js","require":"./dist/config.js","default":"./dist/config.js"},"./package.json":"./package.json"},"typesVersions":{"*":{"host-bridge":["dist/host-bridge.d.ts"],"headers":["dist/runtime/headers.d.ts"],"cloudflare":["dist/cloudflare.d.ts"],"config":["dist/config/index.d.ts"]}},"files":["dist"],"scripts":{"dev":"cross-env NODE_ENV=development tsx --watch --tsconfig ./bundler.tsconfig.json ./bundler/index.ts","build":"cross-env NODE_ENV=production tsx --tsconfig ./bundler.tsconfig.json ./bundler/index.ts","analyze":"cross-env GENERATE_STATS=true pnpm build && pnpm tsx scripts/analyze-rspack-stats.ts","bench":"tsx bench/run.mts","test:config":"pnpm --dir ../compiler test:config","test:adapters":"node --import tsx --test src/runtime/adapters/fastify/__tests__/*.test.ts","test:runtime":"node --import tsx --test src/runtime/utils/__tests__/*.test.ts src/runtime/utils/ui/__tests__/*.test.ts"},"dependencies":{},"devDependencies":{"@modelcontextprotocol/client":"^2.0.0","@modelcontextprotocol/node":"^2.0.0","@modelcontextprotocol/server":"^2.0.0","@nestjs/common":"^11.1.12","@rspack/core":"^1.6.7","@types/async-retry":"^1.4.9","@types/content-type":"^1.1.9","@types/express":"^5.0.6","@types/fs-extra":"^11.0.4","@types/jsonwebtoken":"^9.0.10","@types/node":"^22.19.2","@types/react":"^19.2.7","@types/react-dom":"^19.2.3","async-retry":"^1.3.3","chalk":"^5.6.2","chokidar":"^3.6.0","ci-info":"^4.3.1","commander":"^11.1.0","content-type":"^1.0.5","cross-env":"^7.0.3","del":"^7.1.0","dotenv":"^16.6.1","express":"^4.22.1","fastify":"^5.0.0","fs-extra":"^11.3.2","glob":"^11.1.0","is-docker":"^4.0.0","is-wsl":"^3.1.0","jose":"^6.1.3","json5":"^2.2.3","jsonwebtoken":"^9.0.3","memfs":"^4.51.1","postcss-loader":"^8.2.0","raw-body":"^3.0.2","reflect-metadata":"^0.2.2","rxjs":"^7.8.2","ts-checker-rspack-plugin":"^1.2.1","tsx":"^4.21.0","typescript":"^5.9.3","zod-to-json-schema":"^3.25.0"},"peerDependencies":{"@modelcontextprotocol/client":"^2.0.0","@modelcontextprotocol/server":"^2.0.0","jose":"^6.1.3","react":">=19.0.0","react-dom":">=19.0.0","zod":"^3.25.76 || ^4.0.0"},"peerDependenciesMeta":{"@modelcontextprotocol/client":{"optional":true},"@modelcontextprotocol/server":{"optional":true},"jose":{"optional":true},"react":{"optional":true},"react-dom":{"optional":true}}}')}},a={};function i(e){var t=a[e];if(void 0!==t)return t.exports;var r=a[e]={exports:{}};return o[e](r,r.exports,i),r.exports}i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,i.t=function(e,o){if(1&o&&(e=this(e)),8&o||"object"==typeof e&&e&&(4&o&&e.__esModule||16&o&&"function"==typeof e.then))return e;var a=Object.create(null);i.r(a);var s={};t=t||[null,r({}),r([]),r(r)];for(var n=2&o&&e;("object"==typeof n||"function"==typeof n)&&!~t.indexOf(n);n=r(n))Object.getOwnPropertyNames(n).forEach(t=>{s[t]=()=>e[t]});return s.default=()=>e,i.d(a,s),a},i.d=(e,t)=>{for(var r in t)i.o(t,r)&&!i.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var s={};return(()=>{"use strict";let e,t,r,o,a,n,l,c,u;i.r(s),i.d(s,{HOST_CONTEXT_CHANGED_METHOD:()=>fH,isEnvHeader:()=>fE,createSTDIOClient:()=>fx,INITIALIZE_METHOD:()=>fM,LOG_MESSAGE_METHOD:()=>fV,OPEN_LINK_METHOD:()=>fL,REQUEST_DISPLAY_MODE_METHOD:()=>fz,inputResponse:()=>n1,disconnectSTDIOClient:()=>fN,isInputRequiredResult:()=>nU,callSTDIOClientTool:()=>fC,headersToRecord:()=>fR,MCP_APPS_PROTOCOL_VERSION:()=>fA,extractToolNamesFromRequest:()=>fI,UI_MESSAGE_METHOD:()=>fU,completable:()=>cL,acceptedContent:()=>n0,listSTDIOClientTools:()=>fj,UPDATE_MODEL_CONTEXT_METHOD:()=>fD,UrlElicitationRequiredError:()=>nA,createRequestStateCodec:()=>cV,createMcpHostBridge:()=>fG,SIZE_CHANGED_METHOD:()=>fK,INITIALIZED_METHOD:()=>fq,inputRequired:()=>nQ,RESOURCES_READ_METHOD:()=>fF,createContext:()=>N,jwtAuthMiddleware:()=>O,createHTTPClient:()=>fO,apiKeyAuthMiddleware:()=>P});var d,p,h,f,m,y,g,v,b,_,S=i(8583),$=i.n(S),w=i(4953);let E=w.z.object({apiKey:w.z.string().optional(),headerName:w.z.string().optional(),validateApiKey:w.z.function().args(w.z.string()).returns(w.z.promise(w.z.boolean())).optional()}).strict().refine(e=>void 0!==e.apiKey||void 0!==e.validateApiKey,{message:"Either 'apiKey' or 'validateApiKey' must be provided"}).refine(e=>void 0===e.apiKey||void 0===e.validateApiKey,{message:"'apiKey' and 'validateApiKey' are mutually exclusive - provide only one"}),R="Unauthorized: Missing or invalid API key";function P(e){let t=E.safeParse(e);if(!t.success){let r="apiKey"in e,o="validateApiKey"in e;if(r&&o)throw Error("'apiKey' and 'validateApiKey' are mutually exclusive - provide only one");if(r||o)throw Error(`Invalid configuration: ${t.error.message}`);throw Error("Either 'apiKey' or 'validateApiKey' must be provided")}let r=e.headerName??"x-api-key",o="apiKey"in e?e.apiKey:void 0,a="validateApiKey"in e?e.validateApiKey:void 0;return async(t,i,s)=>{let n=t.header(r);!n||"apiKey"in e&&n!==o||a&&!await a(n)?i.status(401).json({error:R}):s()}}var k=i(8400),T=i.n(k);function O(e){return(t,r,o)=>{let a=t.header("Authorization");if(!a||!a.startsWith("Bearer "))return void r.status(401).json({error:"Unauthorized: Missing or malformed Authorization header"});let i=a.slice(7).trim();if(!i)return void r.status(401).json({error:"Unauthorized: Missing access token"});try{let{secret:r,...a}=e;t.user=T().verify(i,r,a),o()}catch(e){r.status(401).json({error:"Unauthorized: Invalid or expired token"})}}}let x=require("async_hooks"),j=(e,t)=>{globalThis[e]=t},C=e=>globalThis[e];function N({name:e}){let t=Symbol.for(`xmcp-context-${e}`),r=Symbol.for(`xmcp-context-${e}-fallback-store`);if(C(t))return C(t);let o=new x.AsyncLocalStorage,a=globalThis[r]??{current:null};j(r,a);let i={provider:(e,t)=>(a.current=e,o.run(e,t)),getContext:()=>{let t=o.getStore();if(t)return t;if(a.current)return a.current;throw Error(`getContext() can only be used within the ${e} context.`)},setContext:t=>{let r=o.getStore()??a.current;if(!r)throw Error(`setContext() can only be used within the ${e} context.`);Object.assign(r,t)}};return j(t,i),i}var I=Object.create,A=Object.defineProperty,M=Object.getOwnPropertyDescriptor,q=Object.getOwnPropertyNames,z=Object.getPrototypeOf,L=Object.prototype.hasOwnProperty,D=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);let U=new Set(["https://json-schema.org/draft/2020-12/schema","http://json-schema.org/draft/2020-12/schema"]),V=new Set(["https://json-schema.org/draft/2019-09/schema","http://json-schema.org/draft/2019-09/schema"]),F=new Set(["https://json-schema.org/draft-07/schema","http://json-schema.org/draft-07/schema"]),H=new Set(["https://json-schema.org/draft-06/schema","http://json-schema.org/draft-06/schema"]),K=Object.freeze({status:"aborted"});function J(e,t,r){function o(r,o){if(r._zod||Object.defineProperty(r,"_zod",{value:{def:o,constr:s,traits:new Set},enumerable:!1}),r._zod.traits.has(e))return;r._zod.traits.add(e),t(r,o);let a=s.prototype,i=Object.keys(a);for(let e=0;e<i.length;e++){let t=i[e];t in r||(r[t]=a[t].bind(r))}}let a=r?.Parent??Object;class i extends a{}function s(e){var t;let a=r?.Parent?new i:this;for(let r of(o(a,e),(t=a._zod).deferred??(t.deferred=[]),a._zod.deferred))r();return a}return Object.defineProperty(i,"name",{value:e}),Object.defineProperty(s,"init",{value:o}),Object.defineProperty(s,Symbol.hasInstance,{value:t=>!!r?.Parent&&t instanceof r.Parent||t?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}Symbol("zod_brand");class B extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class G extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}(v=globalThis).__zod_globalConfig??(v.__zod_globalConfig={});let Z=globalThis.__zod_globalConfig;function W(e){return e&&Object.assign(Z,e),Z}let X=/^[cC][0-9a-z]{6,}$/,Y=/^[0-9a-z]+$/,Q=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,ee=/^[0-9a-vA-V]{20}$/,et=/^[A-Za-z0-9]{27}$/,er=/^[a-zA-Z0-9_-]{21}$/,eo=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,ea=/^([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})$/,ei=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,es=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,en=/^(?:(?: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])$/,el=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,ec=/^((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])$/,eu=/^(([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])$/,ed=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,ep=/^[A-Za-z0-9_-]*$/,eh=/^https?$/,ef=/^\+[1-9]\d{6,14}$/,em="(?:(?:\\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])))",ey=RegExp(`^${em}$`);function eg(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}let ev=/^-?\d+$/,eb=/^-?\d+(?:\.\d+)?$/,e_=/^(?:true|false)$/i,eS=/^null$/i,e$=/^[^A-Z]*$/,ew=/^[^a-z]*$/;function eE(e){let t=Object.values(e).filter(e=>"number"==typeof e);return Object.entries(e).filter(([e,r])=>-1===t.indexOf(+e)).map(([e,t])=>t)}function eR(e,t){return"bigint"==typeof t?t.toString():t}function eP(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function ek(e){let t=+!!e.startsWith("^"),r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}let eT=Symbol("evaluating");function eO(e,t,r){let o;Object.defineProperty(e,t,{get(){if(o!==eT)return void 0===o&&(o=eT,o=r()),o},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function ex(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function ej(...e){let t={};for(let r of e)Object.assign(t,Object.getOwnPropertyDescriptors(r));return Object.defineProperties({},t)}function eC(e){return JSON.stringify(e)}let eN="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function eI(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}let eA=eP(()=>{if(Z.jitless||"undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return Function(""),!0}catch(e){return!1}});function eM(e){if(!1===eI(e))return!1;let t=e.constructor;if(void 0===t||"function"!=typeof t)return!0;let r=t.prototype;return!1!==eI(r)&&!1!==Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")}function eq(e){return eM(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}let ez=new Set(["string","number","symbol"]);function eL(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function eD(e,t,r){let o=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(o._zod.parent=e),o}function eU(e){if(!e)return{};if("string"==typeof e)return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");e.error=e.message}return(delete e.message,"string"==typeof e.error)?{...e,error:()=>e.error}:e}let eV={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-0x80000000,0x7fffffff],uint32:[0,0xffffffff],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function eF(e,t=0){if(!0===e.aborted)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function eH(e,t){return t.map(t=>(t.path??(t.path=[]),t.path.unshift(e),t))}function eK(e){return"string"==typeof e?e:e?.message}function eJ(e,t,r){let o=e.message?e.message:eK(e.inst?._zod.def?.error?.(e))??eK(t?.error?.(e))??eK(r.customError?.(e))??eK(r.localeError?.(e))??"Invalid input",{inst:a,continue:i,input:s,...n}=e;return n.path??(n.path=[]),n.message=o,t?.reportInput&&(n.input=s),n}function eB(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function eG(...e){let[t,r,o]=e;return"string"==typeof t?{message:t,code:"custom",input:r,inst:o}:{...t}}let eZ=J("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),eW={number:"number",bigint:"bigint",object:"date"},eX=J("$ZodCheckLessThan",(e,t)=>{eZ.init(e,t);let r=eW[typeof t.value];e._zod.onattach.push(e=>{let r=e._zod.bag,o=(t.inclusive?r.maximum:r.exclusiveMaximum)??1/0;t.value<o&&(t.inclusive?r.maximum=t.value:r.exclusiveMaximum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value<=t.value:o.value<t.value)||o.issues.push({origin:r,code:"too_big",maximum:"object"==typeof t.value?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),eY=J("$ZodCheckGreaterThan",(e,t)=>{eZ.init(e,t);let r=eW[typeof t.value];e._zod.onattach.push(e=>{let r=e._zod.bag,o=(t.inclusive?r.minimum:r.exclusiveMinimum)??-1/0;t.value>o&&(t.inclusive?r.minimum=t.value:r.exclusiveMinimum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value>=t.value:o.value>t.value)||o.issues.push({origin:r,code:"too_small",minimum:"object"==typeof t.value?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),eQ=J("$ZodCheckMultipleOf",(e,t)=>{eZ.init(e,t),e._zod.onattach.push(e=>{var r;(r=e._zod.bag).multipleOf??(r.multipleOf=t.value)}),e._zod.check=r=>{let o,a,i;if(typeof r.value!=typeof t.value)throw Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof r.value?r.value%t.value===BigInt(0):0==(a=Math.round(o=r.value/t.value),i=Number.EPSILON*Math.max(Math.abs(o),1),Math.abs(o-a)<i?0:o-a))||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),e0=J("$ZodCheckNumberFormat",(e,t)=>{eZ.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),o=r?"int":"number",[a,i]=eV[t.format];e._zod.onattach.push(e=>{let o=e._zod.bag;o.format=t.format,o.minimum=a,o.maximum=i,r&&(o.pattern=ev)}),e._zod.check=s=>{let n=s.value;if(r){if(!Number.isInteger(n))return void s.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:n,inst:e});if(!Number.isSafeInteger(n))return void(n>0?s.issues.push({input:n,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort}):s.issues.push({input:n,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort}))}n<a&&s.issues.push({origin:"number",input:n,code:"too_small",minimum:a,inclusive:!0,inst:e,continue:!t.abort}),n>i&&s.issues.push({origin:"number",input:n,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),e1=J("$ZodCheckMaxLength",(e,t)=>{var r;eZ.init(e,t),(r=e._zod.def).when??(r.when=e=>{let t=e.value;return null!=t&&void 0!==t.length}),e._zod.onattach.push(e=>{let r=e._zod.bag.maximum??1/0;t.maximum<r&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{let o=r.value;if(o.length<=t.maximum)return;let a=eB(o);r.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),e2=J("$ZodCheckMinLength",(e,t)=>{var r;eZ.init(e,t),(r=e._zod.def).when??(r.when=e=>{let t=e.value;return null!=t&&void 0!==t.length}),e._zod.onattach.push(e=>{let r=e._zod.bag.minimum??-1/0;t.minimum>r&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{let o=r.value;if(o.length>=t.minimum)return;let a=eB(o);r.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),e9=J("$ZodCheckLengthEquals",(e,t)=>{var r;eZ.init(e,t),(r=e._zod.def).when??(r.when=e=>{let t=e.value;return null!=t&&void 0!==t.length}),e._zod.onattach.push(e=>{let r=e._zod.bag;r.minimum=t.length,r.maximum=t.length,r.length=t.length}),e._zod.check=r=>{let o=r.value,a=o.length;if(a===t.length)return;let i=eB(o),s=a>t.length;r.issues.push({origin:i,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),e4=J("$ZodCheckStringFormat",(e,t)=>{var r,o;eZ.init(e,t),e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,t.pattern&&(r.patterns??(r.patterns=new Set),r.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=r=>{t.pattern.lastIndex=0,t.pattern.test(r.value)||r.issues.push({origin:"string",code:"invalid_format",format:t.format,input:r.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(o=e._zod).check??(o.check=()=>{})}),e5=J("$ZodCheckRegex",(e,t)=>{e4.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,t.pattern.test(r.value)||r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),e3=J("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=e$),e4.init(e,t)}),e6=J("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=ew),e4.init(e,t)}),e8=J("$ZodCheckIncludes",(e,t)=>{eZ.init(e,t);let r=eL(t.includes),o=new RegExp("number"==typeof t.position?`^.{${t.position}}${r}`:r);t.pattern=o,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(o)}),e._zod.check=r=>{r.value.includes(t.includes,t.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:r.value,inst:e,continue:!t.abort})}}),e7=J("$ZodCheckStartsWith",(e,t)=>{eZ.init(e,t);let r=RegExp(`^${eL(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),te=J("$ZodCheckEndsWith",(e,t)=>{eZ.init(e,t);let r=RegExp(`.*${eL(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),tt=J("$ZodCheckOverwrite",(e,t)=>{eZ.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});class tr{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if("function"==typeof e){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let t=e.split("\n").filter(e=>e),r=Math.min(...t.map(e=>e.length-e.trimStart().length));for(let e of t.map(e=>e.slice(r)).map(e=>" ".repeat(2*this.indent)+e))this.content.push(e)}compile(){return Function(...this?.args,[...(this?.content??[""]).map(e=>` ${e}`)].join("\n"))}}let to=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,eR,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},ta=J("$ZodError",to),ti=J("$ZodError",to,{Parent:Error}),ts=e=>(t,r,o,a)=>{let i=o?{...o,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},i);if(s instanceof Promise)throw new B;if(s.issues.length){let t=new(a?.Err??e)(s.issues.map(e=>eJ(e,i,W())));throw eN(t,a?.callee),t}return s.value},tn=e=>async(t,r,o,a)=>{let i=o?{...o,async:!0}:{async:!0},s=t._zod.run({value:r,issues:[]},i);if(s instanceof Promise&&(s=await s),s.issues.length){let t=new(a?.Err??e)(s.issues.map(e=>eJ(e,i,W())));throw eN(t,a?.callee),t}return s.value},tl=e=>(t,r,o)=>{let a=o?{...o,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},a);if(i instanceof Promise)throw new B;return i.issues.length?{success:!1,error:new(e??ta)(i.issues.map(e=>eJ(e,a,W())))}:{success:!0,data:i.value}},tc=tl(ti),tu=e=>async(t,r,o)=>{let a=o?{...o,async:!0}:{async:!0},i=t._zod.run({value:r,issues:[]},a);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(e=>eJ(e,a,W())))}:{success:!0,data:i.value}},td=tu(ti),tp={major:4,minor:4,patch:3},th=J("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=tp;let o=[...e._zod.def.checks??[]];for(let t of(e._zod.traits.has("$ZodCheck")&&o.unshift(e),o))for(let r of t._zod.onattach)r(e);if(0===o.length)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,r)=>{let o,a=eF(e);for(let i of t){if(i._zod.def.when){if(function(e,t=0){if(!0===e.aborted)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}(e)||!i._zod.def.when(e))continue}else if(a)continue;let t=e.issues.length,s=i._zod.check(e);if(s instanceof Promise&&r?.async===!1)throw new B;if(o||s instanceof Promise)o=(o??Promise.resolve()).then(async()=>{await s,e.issues.length!==t&&(a||(a=eF(e,t)))});else{if(e.issues.length===t)continue;a||(a=eF(e,t))}}return o?o.then(()=>e):e},r=(r,a,i)=>{if(eF(r))return r.aborted=!0,r;let s=t(a,o,i);if(s instanceof Promise){if(!1===i.async)throw new B;return s.then(t=>e._zod.parse(t,i))}return e._zod.parse(s,i)};e._zod.run=(a,i)=>{if(i.skipChecks)return e._zod.parse(a,i);if("backward"===i.direction){let t=e._zod.parse({value:a.value,issues:[]},{...i,skipChecks:!0});return t instanceof Promise?t.then(e=>r(e,a,i)):r(t,a,i)}let s=e._zod.parse(a,i);if(s instanceof Promise){if(!1===i.async)throw new B;return s.then(e=>t(e,o,i))}return t(s,o,i)}}eO(e,"~standard",()=>({validate:t=>{try{let r=tc(e,t);return r.success?{value:r.data}:{issues:r.error?.issues}}catch(r){return td(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1}))}),tf=J("$ZodString",(e,t)=>{var r;let o;th.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??(o=(r=e._zod.bag)?`[\\s\\S]{${r?.minimum??0},${r?.maximum??""}}`:"[\\s\\S]*",RegExp(`^${o}$`)),e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=String(r.value)}catch(e){}return"string"==typeof r.value||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),tm=J("$ZodStringFormat",(e,t)=>{e4.init(e,t),tf.init(e,t)}),ty=J("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=ea),tm.init(e,t)}),tg=J("$ZodUUID",(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=ei(e))}else t.pattern??(t.pattern=ei());tm.init(e,t)}),tv=J("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=es),tm.init(e,t)}),tb=J("$ZodURL",(e,t)=>{tm.init(e,t),e._zod.check=r=>{try{let o=r.value.trim();if(!t.normalize&&t.protocol?.source===eh.source&&!/^https?:\/\//i.test(o))return void r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});let a=new URL(o);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(a.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(a.protocol.endsWith(":")?a.protocol.slice(0,-1):a.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=a.href:r.value=o;return}catch(o){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),t_=J("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),tm.init(e,t)}),tS=J("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=er),tm.init(e,t)}),t$=J("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=X),tm.init(e,t)}),tw=J("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Y),tm.init(e,t)}),tE=J("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Q),tm.init(e,t)}),tR=J("$ZodXID",(e,t)=>{t.pattern??(t.pattern=ee),tm.init(e,t)}),tP=J("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=et),tm.init(e,t)}),tk=J("$ZodISODateTime",(e,t)=>{let r,o,a;t.pattern??(r=eg({precision:t.precision}),o=["Z"],t.local&&o.push(""),t.offset&&o.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)"),a=`${r}(?:${o.join("|")})`,t.pattern=RegExp(`^${em}T(?:${a})$`)),tm.init(e,t)}),tT=J("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=ey),tm.init(e,t)}),tO=J("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=RegExp(`^${eg(t)}$`)),tm.init(e,t)}),tx=J("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=eo),tm.init(e,t)}),tj=J("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=en),tm.init(e,t),e._zod.bag.format="ipv4"}),tC=J("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=el),tm.init(e,t),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),tN=J("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=ec),tm.init(e,t)}),tI=J("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=eu),tm.init(e,t),e._zod.check=r=>{let o=r.value.split("/");try{if(2!==o.length)throw Error();let[e,t]=o;if(!t)throw Error();let r=Number(t);if(`${r}`!==t||r<0||r>128)throw Error();new URL(`http://[${e}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function tA(e){if(""===e)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}let tM=J("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=ed),tm.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{tA(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}}),tq=J("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=ep),tm.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{!function(e){if(!ep.test(e))return!1;let t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return tA(t.padEnd(4*Math.ceil(t.length/4),"="))}(r.value)&&r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),tz=J("$ZodE164",(e,t)=>{t.pattern??(t.pattern=ef),tm.init(e,t)}),tL=J("$ZodJWT",(e,t)=>{tm.init(e,t),e._zod.check=r=>{!function(e,t=null){try{let r=e.split(".");if(3!==r.length)return!1;let[o]=r;if(!o)return!1;let a=JSON.parse(atob(o));if("typ"in a&&a?.typ!=="JWT"||!a.alg||t&&(!("alg"in a)||a.alg!==t))return!1;return!0}catch{return!1}}(r.value,t.alg)&&r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),tD=J("$ZodNumber",(e,t)=>{th.init(e,t),e._zod.pattern=e._zod.bag.pattern??eb,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=Number(r.value)}catch(e){}let a=r.value;if("number"==typeof a&&!Number.isNaN(a)&&Number.isFinite(a))return r;let i="number"==typeof a?Number.isNaN(a)?"NaN":Number.isFinite(a)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:a,inst:e,...i?{received:i}:{}}),r}}),tU=J("$ZodNumberFormat",(e,t)=>{e0.init(e,t),tD.init(e,t)}),tV=J("$ZodBoolean",(e,t)=>{th.init(e,t),e._zod.pattern=e_,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=!!r.value}catch(e){}let a=r.value;return"boolean"==typeof a||r.issues.push({expected:"boolean",code:"invalid_type",input:a,inst:e}),r}}),tF=J("$ZodNull",(e,t)=>{th.init(e,t),e._zod.pattern=eS,e._zod.values=new Set([null]),e._zod.parse=(t,r)=>{let o=t.value;return null===o||t.issues.push({expected:"null",code:"invalid_type",input:o,inst:e}),t}}),tH=J("$ZodAny",(e,t)=>{th.init(e,t),e._zod.parse=e=>e}),tK=J("$ZodUnknown",(e,t)=>{th.init(e,t),e._zod.parse=e=>e}),tJ=J("$ZodNever",(e,t)=>{th.init(e,t),e._zod.parse=(t,r)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)});function tB(e,t,r){e.issues.length&&t.issues.push(...eH(r,e.issues)),t.value[r]=e.value}let tG=J("$ZodArray",(e,t)=>{th.init(e,t),e._zod.parse=(r,o)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({expected:"array",code:"invalid_type",input:a,inst:e}),r;r.value=Array(a.length);let i=[];for(let e=0;e<a.length;e++){let s=a[e],n=t.element._zod.run({value:s,issues:[]},o);n instanceof Promise?i.push(n.then(t=>tB(t,r,e))):tB(n,r,e)}return i.length?Promise.all(i).then(()=>r):r}});function tZ(e,t,r,o,a,i){let s=r in o;if(e.issues.length){if(a&&i&&!s)return;t.issues.push(...eH(r,e.issues))}if(!s&&!a){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}void 0===e.value?s&&(t.value[r]=void 0):t.value[r]=e.value}function tW(e){var t;let r=Object.keys(e.shape);for(let t of r)if(!e.shape?.[t]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${t}": expected a Zod schema`);let o=Object.keys(t=e.shape).filter(e=>"optional"===t[e]._zod.optin&&"optional"===t[e]._zod.optout);return{...e,keys:r,keySet:new Set(r),numKeys:r.length,optionalKeys:new Set(o)}}function tX(e,t,r,o,a,i){let s=[],n=a.keySet,l=a.catchall._zod,c=l.def.type,u="optional"===l.optin,d="optional"===l.optout;for(let a in t){if("__proto__"===a||n.has(a))continue;if("never"===c){s.push(a);continue}let i=l.run({value:t[a],issues:[]},o);i instanceof Promise?e.push(i.then(e=>tZ(e,r,a,t,u,d))):tZ(i,r,a,t,u,d)}return(s.length&&r.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:i}),e.length)?Promise.all(e).then(()=>r):r}let tY=J("$ZodObject",(e,t)=>{let r;th.init(e,t);let o=Object.getOwnPropertyDescriptor(t,"shape");if(!o?.get){let e=t.shape;Object.defineProperty(t,"shape",{get:()=>{let r={...e};return Object.defineProperty(t,"shape",{value:r}),r}})}let a=eP(()=>tW(t));eO(e._zod,"propValues",()=>{let e=t.shape,r={};for(let t in e){let o=e[t]._zod;if(o.values)for(let e of(r[t]??(r[t]=new Set),o.values))r[t].add(e)}return r});let i=t.catchall;e._zod.parse=(t,o)=>{r??(r=a.value);let s=t.value;if(!eI(s))return t.issues.push({expected:"object",code:"invalid_type",input:s,inst:e}),t;t.value={};let n=[],l=r.shape;for(let e of r.keys){let r=l[e],a="optional"===r._zod.optin,i="optional"===r._zod.optout,c=r._zod.run({value:s[e],issues:[]},o);c instanceof Promise?n.push(c.then(r=>tZ(r,t,e,s,a,i))):tZ(c,t,e,s,a,i)}return i?tX(n,s,t,o,a.value,e):n.length?Promise.all(n).then(()=>t):t}}),tQ=J("$ZodObjectJIT",(e,t)=>{let r,o;tY.init(e,t);let a=e._zod.parse,i=eP(()=>tW(t)),s=!Z.jitless,n=s&&eA.value,l=t.catchall;e._zod.parse=(c,u)=>{o??(o=i.value);let d=c.value;return eI(d)?s&&n&&u?.async===!1&&!0!==u.jitless?(r||(r=(e=>{let t=new tr(["shape","payload","ctx"]),r=i.value,o=e=>{let t=eC(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");let a=Object.create(null),s=0;for(let e of r.keys)a[e]=`key_${s++}`;for(let i of(t.write("const newResult = {};"),r.keys)){let r=a[i],s=eC(i),n=e[i],l=n?._zod?.optin==="optional",c=n?._zod?.optout==="optional";t.write(`const ${r} = ${o(i)};`),l&&c?t.write(`
|
|
1
|
+
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("zod/v3"));else if("function"==typeof define&&define.amd)define(["zod/v3"],t);else{var r="object"==typeof exports?t(require("zod/v3")):t(e["zod/v3"]);for(var o in r)("object"==typeof exports?exports:e)[o]=r[o]}}(this,e=>(()=>{var t,r,o={9454(e,t,r){"use strict";var o=r(181).Buffer,a=r(181).SlowBuffer;function i(e,t){if(!o.isBuffer(e)||!o.isBuffer(t)||e.length!==t.length)return!1;for(var r=0,a=0;a<e.length;a++)r|=e[a]^t[a];return 0===r}e.exports=i,i.install=function(){o.prototype.equal=a.prototype.equal=function(e){return i(this,e)}};var s=o.prototype.equal,n=a.prototype.equal;i.restore=function(){o.prototype.equal=s,a.prototype.equal=n}},6507(e,t,r){"use strict";let o=r(5317),a=r(8388),i=r(442);function s(e,t,r){let s=a(e,t,r),n=o.spawn(s.command,s.args,s.options);return i.hookChildProcess(n,s),n}e.exports=s,e.exports.spawn=s,e.exports.sync=function(e,t,r){let s=a(e,t,r),n=o.spawnSync(s.command,s.args,s.options);return n.error=n.error||i.verifyENOENTSync(n.status,s),n},e.exports._parse=a,e.exports._enoent=i},442(e){"use strict";let t="win32"===process.platform;function r(e,t){return Object.assign(Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function o(e,o){return t&&1===e&&!o.file?r(o.original,"spawn"):null}e.exports={hookChildProcess:function(e,r){if(!t)return;let a=e.emit;e.emit=function(t,i){if("exit"===t){let t=o(i,r);if(t)return a.call(e,"error",t)}return a.apply(e,arguments)}},verifyENOENT:o,verifyENOENTSync:function(e,o){return t&&1===e&&!o.file?r(o.original,"spawnSync"):null},notFoundError:r}},8388(e,t,r){"use strict";let o=r(6928),a=r(3803),i=r(2077),s=r(1880),n="win32"===process.platform,l=/\.(?:com|exe)$/i,c=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;e.exports=function(e,t,r){t&&!Array.isArray(t)&&(r=t,t=null);let u={command:e,args:t=t?t.slice(0):[],options:r=Object.assign({},r),file:void 0,original:{command:e,args:t}};return r.shell?u:function(e){let t;if(!n)return e;let r=(e.file=a(e),(t=e.file&&s(e.file))?(e.args.unshift(e.file),e.command=t,a(e)):e.file),u=!l.test(r);if(e.options.forceShell||u){let t=c.test(r);e.command=o.normalize(e.command),e.command=i.command(e.command),e.args=e.args.map(e=>i.argument(e,t));let a=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${a}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}(u)}},2077(e){"use strict";let t=/([()\][%!^"`<>&|;, *?])/g;e.exports.command=function(e){return e.replace(t,"^$1")},e.exports.argument=function(e,r){return e=(e=(e=`${e}`).replace(/(?=(\\+?)?)\1"/g,'$1$1\\"')).replace(/(?=(\\+?)?)\1$/,"$1$1"),e=(e=`"${e}"`).replace(t,"^$1"),r&&(e=e.replace(t,"^$1")),e}},1880(e,t,r){"use strict";let o=r(9896),a=r(600);e.exports=function(e){let t,r=Buffer.alloc(150);try{t=o.openSync(e,"r"),o.readSync(t,r,0,150,0),o.closeSync(t)}catch(e){}return a(r.toString())}},3803(e,t,r){"use strict";let o=r(6928),a=r(1905),i=r(9695);function s(e,t){let r,s=e.options.env||process.env,n=process.cwd(),l=null!=e.options.cwd,c=l&&void 0!==process.chdir&&!process.chdir.disabled;if(c)try{process.chdir(e.options.cwd)}catch(e){}try{r=a.sync(e.command,{path:s[i({env:s})],pathExt:t?o.delimiter:void 0})}catch(e){}finally{c&&process.chdir(n)}return r&&(r=o.resolve(l?e.options.cwd:"",r)),r}e.exports=function(e){return s(e)||s(e,!0)}},8583(e,t,r){let o=r(9896),a=r(6928),i=r(857),s=r(6982),n=r(4519).version,l=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function c(e){console.log(`[dotenv@${n}][DEBUG] ${e}`)}function u(e){console.log(`[dotenv@${n}] ${e}`)}function d(e){return e&&e.DOTENV_KEY&&e.DOTENV_KEY.length>0?e.DOTENV_KEY:process.env.DOTENV_KEY&&process.env.DOTENV_KEY.length>0?process.env.DOTENV_KEY:""}function p(e){let t=null;if(e&&e.path&&e.path.length>0)if(Array.isArray(e.path))for(let r of e.path)o.existsSync(r)&&(t=r.endsWith(".vault")?r:`${r}.vault`);else t=e.path.endsWith(".vault")?e.path:`${e.path}.vault`;else t=a.resolve(process.cwd(),".env.vault");return o.existsSync(t)?t:null}function h(e){return"~"===e[0]?a.join(i.homedir(),e.slice(1)):e}let f={configDotenv:function(e){let t,r=a.resolve(process.cwd(),".env"),i="utf8",s=!!(e&&e.debug),n=!e||!("quiet"in e)||e.quiet;e&&e.encoding?i=e.encoding:s&&c("No encoding is specified. UTF-8 is used by default");let l=[r];if(e&&e.path)if(Array.isArray(e.path))for(let t of(l=[],e.path))l.push(h(t));else l=[h(e.path)];let d={};for(let r of l)try{let t=f.parse(o.readFileSync(r,{encoding:i}));f.populate(d,t,e)}catch(e){s&&c(`Failed to load ${r} ${e.message}`),t=e}let p=process.env;if(e&&null!=e.processEnv&&(p=e.processEnv),f.populate(p,d,e),s||!n){let e=Object.keys(d).length,r=[];for(let e of l)try{let t=a.relative(process.cwd(),e);r.push(t)}catch(r){s&&c(`Failed to load ${e} ${r.message}`),t=r}u(`injecting env (${e}) from ${r.join(",")}`)}return t?{parsed:d,error:t}:{parsed:d}},_configVault:function(e){let t=!!(e&&e.debug),r=!e||!("quiet"in e)||e.quiet;(t||!r)&&u("Loading env from encrypted .env.vault");let o=f._parseVault(e),a=process.env;return e&&null!=e.processEnv&&(a=e.processEnv),f.populate(a,o,e),{parsed:o}},_parseVault:function(e){let t,r=p(e=e||{});e.path=r;let o=f.configDotenv(e);if(!o.parsed){let e=Error(`MISSING_DATA: Cannot parse ${r} for an unknown reason`);throw e.code="MISSING_DATA",e}let a=d(e).split(","),i=a.length;for(let e=0;e<i;e++)try{let r=a[e].trim(),i=function(e,t){let r;try{r=new URL(t)}catch(e){if("ERR_INVALID_URL"===e.code){let e=Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");throw e.code="INVALID_DOTENV_KEY",e}throw e}let o=r.password;if(!o){let e=Error("INVALID_DOTENV_KEY: Missing key part");throw e.code="INVALID_DOTENV_KEY",e}let a=r.searchParams.get("environment");if(!a){let e=Error("INVALID_DOTENV_KEY: Missing environment part");throw e.code="INVALID_DOTENV_KEY",e}let i=`DOTENV_VAULT_${a.toUpperCase()}`,s=e.parsed[i];if(!s){let e=Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${i} in your .env.vault file.`);throw e.code="NOT_FOUND_DOTENV_ENVIRONMENT",e}return{ciphertext:s,key:o}}(o,r);t=f.decrypt(i.ciphertext,i.key);break}catch(t){if(e+1>=i)throw t}return f.parse(t)},config:function(e){if(0===d(e).length)return f.configDotenv(e);let t=p(e);if(!t){var r;return r=`You set DOTENV_KEY but you are missing a .env.vault file at ${t}. Did you forget to build it?`,console.log(`[dotenv@${n}][WARN] ${r}`),f.configDotenv(e)}return f._configVault(e)},decrypt:function(e,t){let r=Buffer.from(t.slice(-64),"hex"),o=Buffer.from(e,"base64"),a=o.subarray(0,12),i=o.subarray(-16);o=o.subarray(12,-16);try{let e=s.createDecipheriv("aes-256-gcm",r,a);return e.setAuthTag(i),`${e.update(o)}${e.final()}`}catch(o){let e=o instanceof RangeError,t="Invalid key length"===o.message,r="Unsupported state or unable to authenticate data"===o.message;if(e||t){let e=Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");throw e.code="INVALID_DOTENV_KEY",e}if(r){let e=Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");throw e.code="DECRYPTION_FAILED",e}throw o}},parse:function(e){let t,r={},o=e.toString();for(o=o.replace(/\r\n?/mg,"\n");null!=(t=l.exec(o));){let e=t[1],o=t[2]||"",a=(o=o.trim())[0];o=o.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"),'"'===a&&(o=(o=o.replace(/\\n/g,"\n")).replace(/\\r/g,"\r")),r[e]=o}return r},populate:function(e,t,r={}){let o=!!(r&&r.debug),a=!!(r&&r.override);if("object"!=typeof t){let e=Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");throw e.code="OBJECT_REQUIRED",e}for(let r of Object.keys(t))Object.prototype.hasOwnProperty.call(e,r)?(!0===a&&(e[r]=t[r]),o&&(!0===a?c(`"${r}" is already defined and WAS overwritten`):c(`"${r}" is already defined and was NOT overwritten`))):e[r]=t[r]}};e.exports.configDotenv=f.configDotenv,e.exports._configVault=f._configVault,e.exports._parseVault=f._parseVault,e.exports.config=f.config,e.exports.decrypt=f.decrypt,e.exports.parse=f.parse,e.exports.populate=f.populate,e.exports=f},9053(e,t,r){"use strict";var o=r(6608).Buffer,a=r(2188);function i(e){if(o.isBuffer(e))return e;if("string"==typeof e)return o.from(e,"base64");throw TypeError("ECDSA signature must be a Base64 string or a Buffer")}function s(e,t,r){for(var o=0;t+o<r&&0===e[t+o];)++o;return e[t+o]>=128&&--o,o}e.exports={derToJose:function(e,t){e=i(e);var r=a(t),s=r+1,n=e.length,l=0;if(48!==e[l++])throw Error('Could not find expected "seq"');var c=e[l++];if(129===c&&(c=e[l++]),n-l<c)throw Error('"seq" specified length of "'+c+'", only "'+(n-l)+'" remaining');if(2!==e[l++])throw Error('Could not find expected "int" for "r"');var u=e[l++];if(n-l-2<u)throw Error('"r" specified length of "'+u+'", only "'+(n-l-2)+'" available');if(s<u)throw Error('"r" specified length of "'+u+'", max of "'+s+'" is acceptable');var d=l;if(l+=u,2!==e[l++])throw Error('Could not find expected "int" for "s"');var p=e[l++];if(n-l!==p)throw Error('"s" specified length of "'+p+'", expected "'+(n-l)+'"');if(s<p)throw Error('"s" specified length of "'+p+'", max of "'+s+'" is acceptable');var h=l;if((l+=p)!==n)throw Error('Expected to consume entire buffer, but "'+(n-l)+'" bytes remain');var f=r-u,m=r-p,y=o.allocUnsafe(f+u+m+p);for(l=0;l<f;++l)y[l]=0;e.copy(y,l,d+Math.max(-f,0),d+u),l=r;for(var g=l;l<g+m;++l)y[l]=0;return e.copy(y,l,h+Math.max(-m,0),h+p),y=(y=y.toString("base64")).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")},joseToDer:function(e,t){e=i(e);var r=a(t),n=e.length;if(n!==2*r)throw TypeError('"'+t+'" signatures must be "'+2*r+'" bytes, saw "'+n+'"');var l=s(e,0,r),c=s(e,r,e.length),u=r-l,d=r-c,p=2+u+1+1+d,h=p<128,f=o.allocUnsafe((h?2:3)+p),m=0;return f[m++]=48,h?f[m++]=p:(f[m++]=129,f[m++]=255&p),f[m++]=2,f[m++]=u,l<0?(f[m++]=0,m+=e.copy(f,m,0,r)):m+=e.copy(f,m,l,r),f[m++]=2,f[m++]=d,c<0?(f[m++]=0,e.copy(f,m,r)):e.copy(f,m,r+c),f}}},2188(e){"use strict";function t(e){return(e/8|0)+ +(e%8!=0)}var r={ES256:t(256),ES384:t(384),ES512:t(521)};e.exports=function(e){var t=r[e];if(t)return t;throw Error('Unknown algorithm "'+e+'"')}},9344(e,t,r){var o;function a(e,t,r){if("function"==typeof t&&(r=t,t={}),!r){if("function"!=typeof Promise)throw TypeError("callback not provided");return new Promise(function(r,o){a(e,t||{},function(e,t){e?o(e):r(t)})})}o(e,t||{},function(e,o){e&&("EACCES"===e.code||t&&t.ignoreErrors)&&(e=null,o=!1),r(e,o)})}r(9896),o="win32"===process.platform||global.TESTING_WINDOWS?r(8541):r(709),e.exports=a,a.sync=function(e,t){try{return o.sync(e,t||{})}catch(e){if(t&&t.ignoreErrors||"EACCES"===e.code)return!1;throw e}}},709(e,t,r){e.exports=a,a.sync=function(e,t){return i(o.statSync(e),t)};var o=r(9896);function a(e,t,r){o.stat(e,function(e,o){r(e,!e&&i(o,t))})}function i(e,t){var r,o,a,i,s,n,l,c,u;return e.isFile()&&(r=e,o=t,a=r.mode,i=r.uid,s=r.gid,n=void 0!==o.uid?o.uid:process.getuid&&process.getuid(),l=void 0!==o.gid?o.gid:process.getgid&&process.getgid(),c=parseInt("100",8),u=parseInt("010",8),a&parseInt("001",8)||a&u&&s===l||a&c&&i===n||a&(c|u)&&0===n)}},8541(e,t,r){e.exports=i,i.sync=function(e,t){return a(o.statSync(e),e,t)};var o=r(9896);function a(e,t,r){if(!e.isSymbolicLink()&&!e.isFile())return!1;var o=void 0!==r.pathExt?r.pathExt:process.env.PATHEXT;if(!o||-1!==(o=o.split(";")).indexOf(""))return!0;for(var a=0;a<o.length;a++){var i=o[a].toLowerCase();if(i&&t.substr(-i.length).toLowerCase()===i)return!0}return!1}function i(e,t,r){o.stat(e,function(o,i){r(o,!o&&a(i,e,t))})}},2548(e,t,r){var o=r(3263);e.exports=function(e,t){t=t||{};var r=o.decode(e,t);if(!r)return null;var a=r.payload;if("string"==typeof a)try{var i=JSON.parse(a);null!==i&&"object"==typeof i&&(a=i)}catch(e){}return!0===t.complete?{header:r.header,payload:a,signature:r.signature}:a}},8400(e,t,r){e.exports={decode:r(2548),verify:r(6467),sign:r(9147),JsonWebTokenError:r(1957),NotBeforeError:r(4470),TokenExpiredError:r(7788)}},1957(e){var t=function(e,t){Error.call(this,e),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name="JsonWebTokenError",this.message=e,t&&(this.inner=t)};t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,e.exports=t},4470(e,t,r){var o=r(1957),a=function(e,t){o.call(this,e),this.name="NotBeforeError",this.date=t};a.prototype=Object.create(o.prototype),a.prototype.constructor=a,e.exports=a},7788(e,t,r){var o=r(1957),a=function(e,t){o.call(this,e),this.name="TokenExpiredError",this.expiredAt=t};a.prototype=Object.create(o.prototype),a.prototype.constructor=a,e.exports=a},5841(e,t,r){e.exports=r(3895).satisfies(process.version,">=15.7.0")},953(e,t,r){e.exports=r(3895).satisfies(process.version,"^6.12.0 || >=8.0.0")},455(e,t,r){e.exports=r(3895).satisfies(process.version,">=16.9.0")},4559(e,t,r){var o=r(3866);e.exports=function(e,t){var r=t||Math.floor(Date.now()/1e3);if("string"==typeof e){var a=o(e);if(void 0===a)return;return Math.floor(r+a/1e3)}if("number"==typeof e)return r+e}},723(e,t,r){let o=r(5841),a=r(455),i={ec:["ES256","ES384","ES512"],rsa:["RS256","PS256","RS384","PS384","RS512","PS512"],"rsa-pss":["PS256","PS384","PS512"]},s={ES256:"prime256v1",ES384:"secp384r1",ES512:"secp521r1"};e.exports=function(e,t){if(!e||!t)return;let r=t.asymmetricKeyType;if(!r)return;let n=i[r];if(!n)throw Error(`Unknown key type "${r}".`);if(!n.includes(e))throw Error(`"alg" parameter for "${r}" key type must be one of: ${n.join(", ")}.`);if(o)switch(r){case"ec":let l=t.asymmetricKeyDetails.namedCurve,c=s[e];if(l!==c)throw Error(`"alg" parameter "${e}" requires curve "${c}".`);break;case"rsa-pss":if(a){let r=parseInt(e.slice(-3),10),{hashAlgorithm:o,mgf1HashAlgorithm:a,saltLength:i}=t.asymmetricKeyDetails;if(o!==`sha${r}`||a!==o)throw Error(`Invalid key for this operation, its RSA-PSS parameters do not meet the requirements of "alg" ${e}.`);if(void 0!==i&&i>r>>3)throw Error(`Invalid key for this operation, its RSA-PSS parameter saltLength does not meet the requirements of "alg" ${e}.`)}}}},9147(e,t,r){let o=r(4559),a=r(953),i=r(723),s=r(3263),n=r(5357),l=r(6782),c=r(5250),u=r(8094),d=r(6052),p=r(1251),h=r(8430),{KeyObject:f,createSecretKey:m,createPrivateKey:y}=r(6982),g=["RS256","RS384","RS512","ES256","ES384","ES512","HS256","HS384","HS512","none"];a&&g.splice(3,0,"PS256","PS384","PS512");let v={expiresIn:{isValid:function(e){return c(e)||p(e)&&e},message:'"expiresIn" should be a number of seconds or string representing a timespan'},notBefore:{isValid:function(e){return c(e)||p(e)&&e},message:'"notBefore" should be a number of seconds or string representing a timespan'},audience:{isValid:function(e){return p(e)||Array.isArray(e)},message:'"audience" must be a string or array'},algorithm:{isValid:n.bind(null,g),message:'"algorithm" must be a valid string enum value'},header:{isValid:d,message:'"header" must be an object'},encoding:{isValid:p,message:'"encoding" must be a string'},issuer:{isValid:p,message:'"issuer" must be a string'},subject:{isValid:p,message:'"subject" must be a string'},jwtid:{isValid:p,message:'"jwtid" must be a string'},noTimestamp:{isValid:l,message:'"noTimestamp" must be a boolean'},keyid:{isValid:p,message:'"keyid" must be a string'},mutatePayload:{isValid:l,message:'"mutatePayload" must be a boolean'},allowInsecureKeySizes:{isValid:l,message:'"allowInsecureKeySizes" must be a boolean'},allowInvalidAsymmetricKeyTypes:{isValid:l,message:'"allowInvalidAsymmetricKeyTypes" must be a boolean'}},b={iat:{isValid:u,message:'"iat" should be a number of seconds'},exp:{isValid:u,message:'"exp" should be a number of seconds'},nbf:{isValid:u,message:'"nbf" should be a number of seconds'}};function _(e,t,r,o){if(!d(r))throw Error('Expected "'+o+'" to be a plain object.');Object.keys(r).forEach(function(a){let i=e[a];if(!i){if(!t)throw Error('"'+a+'" is not allowed in "'+o+'"');return}if(!i.isValid(r[a]))throw Error(i.message)})}let S={audience:"aud",issuer:"iss",subject:"sub",jwtid:"jti"},$=["expiresIn","notBefore","noTimestamp","audience","issuer","subject","jwtid"];e.exports=function(e,t,r,a){var n,l;"function"==typeof r?(a=r,r={}):r=r||{};let c="object"==typeof e&&!Buffer.isBuffer(e),u=Object.assign({alg:r.algorithm||"HS256",typ:c?"JWT":void 0,kid:r.keyid},r.header);function d(e){if(a)return a(e);throw e}if(!t&&"none"!==r.algorithm)return d(Error("secretOrPrivateKey must have a value"));if(null!=t&&!(t instanceof f))try{t=y(t)}catch(e){try{t=m("string"==typeof t?Buffer.from(t):t)}catch(e){return d(Error("secretOrPrivateKey is not valid key material"))}}if(u.alg.startsWith("HS")&&"secret"!==t.type)return d(Error(`secretOrPrivateKey must be a symmetric key when using ${u.alg}`));if(/^(?:RS|PS|ES)/.test(u.alg)){if("private"!==t.type)return d(Error(`secretOrPrivateKey must be an asymmetric key when using ${u.alg}`));if(!r.allowInsecureKeySizes&&!u.alg.startsWith("ES")&&void 0!==t.asymmetricKeyDetails&&t.asymmetricKeyDetails.modulusLength<2048)return d(Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${u.alg}`))}if(void 0===e)return d(Error("payload is required"));if(c){try{n=e,_(b,!0,n,"payload")}catch(e){return d(e)}r.mutatePayload||(e=Object.assign({},e))}else{let t=$.filter(function(e){return void 0!==r[e]});if(t.length>0)return d(Error("invalid "+t.join(",")+" option for "+typeof e+" payload"))}if(void 0!==e.exp&&void 0!==r.expiresIn)return d(Error('Bad "options.expiresIn" option the payload already has an "exp" property.'));if(void 0!==e.nbf&&void 0!==r.notBefore)return d(Error('Bad "options.notBefore" option the payload already has an "nbf" property.'));try{l=r,_(v,!1,l,"options")}catch(e){return d(e)}if(!r.allowInvalidAsymmetricKeyTypes)try{i(u.alg,t)}catch(e){return d(e)}let p=e.iat||Math.floor(Date.now()/1e3);if(r.noTimestamp?delete e.iat:c&&(e.iat=p),void 0!==r.notBefore){try{e.nbf=o(r.notBefore,p)}catch(e){return d(e)}if(void 0===e.nbf)return d(Error('"notBefore" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}if(void 0!==r.expiresIn&&"object"==typeof e){try{e.exp=o(r.expiresIn,p)}catch(e){return d(e)}if(void 0===e.exp)return d(Error('"expiresIn" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}Object.keys(S).forEach(function(t){let o=S[t];if(void 0!==r[t]){if(void 0!==e[o])return d(Error('Bad "options.'+t+'" option. The payload already has an "'+o+'" property.'));e[o]=r[t]}});let g=r.encoding||"utf8";if("function"==typeof a)a=a&&h(a),s.createSign({header:u,privateKey:t,payload:e,encoding:g}).once("error",a).once("done",function(e){if(!r.allowInsecureKeySizes&&/^(?:RS|PS)/.test(u.alg)&&e.length<256)return a(Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${u.alg}`));a(null,e)});else{let o=s.sign({header:u,payload:e,secret:t,encoding:g});if(!r.allowInsecureKeySizes&&/^(?:RS|PS)/.test(u.alg)&&o.length<256)throw Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${u.alg}`);return o}}},6467(e,t,r){let o=r(1957),a=r(4470),i=r(7788),s=r(2548),n=r(4559),l=r(723),c=r(953),u=r(3263),{KeyObject:d,createSecretKey:p,createPublicKey:h}=r(6982),f=["RS256","RS384","RS512"],m=["ES256","ES384","ES512"],y=["RS256","RS384","RS512"],g=["HS256","HS384","HS512"];c&&(f.splice(f.length,0,"PS256","PS384","PS512"),y.splice(y.length,0,"PS256","PS384","PS512")),e.exports=function(e,t,r,c){let v,b,_;if("function"!=typeof r||c||(c=r,r={}),r||(r={}),r=Object.assign({},r),v=c||function(e,t){if(e)throw e;return t},r.clockTimestamp&&"number"!=typeof r.clockTimestamp)return v(new o("clockTimestamp must be a number"));if(void 0!==r.nonce&&("string"!=typeof r.nonce||""===r.nonce.trim()))return v(new o("nonce must be a non-empty string"));if(void 0!==r.allowInvalidAsymmetricKeyTypes&&"boolean"!=typeof r.allowInvalidAsymmetricKeyTypes)return v(new o("allowInvalidAsymmetricKeyTypes must be a boolean"));let S=r.clockTimestamp||Math.floor(Date.now()/1e3);if(!e)return v(new o("jwt must be provided"));if("string"!=typeof e)return v(new o("jwt must be a string"));let $=e.split(".");if(3!==$.length)return v(new o("jwt malformed"));try{b=s(e,{complete:!0})}catch(e){return v(e)}if(!b)return v(new o("invalid token"));let w=b.header;if("function"==typeof t){if(!c)return v(new o("verify must be called asynchronous if secret or public key is provided as a callback"));_=t}else _=function(e,r){return r(null,t)};return _(w,function(t,s){let c;if(t)return v(new o("error in secret or public key callback: "+t.message));let _=""!==$[2].trim();if(!_&&s)return v(new o("jwt signature is required"));if(_&&!s)return v(new o("secret or public key must be provided"));if(!_&&!r.algorithms)return v(new o('please specify "none" in "algorithms" to verify unsigned tokens'));if(null!=s&&!(s instanceof d))try{s=h(s)}catch(e){try{s=p("string"==typeof s?Buffer.from(s):s)}catch(e){return v(new o("secretOrPublicKey is not valid key material"))}}if(r.algorithms||("secret"===s.type?r.algorithms=g:["rsa","rsa-pss"].includes(s.asymmetricKeyType)?r.algorithms=y:"ec"===s.asymmetricKeyType?r.algorithms=m:r.algorithms=f),-1===r.algorithms.indexOf(b.header.alg))return v(new o("invalid algorithm"));if(w.alg.startsWith("HS")&&"secret"!==s.type)return v(new o(`secretOrPublicKey must be a symmetric key when using ${w.alg}`));if(/^(?:RS|PS|ES)/.test(w.alg)&&"public"!==s.type)return v(new o(`secretOrPublicKey must be an asymmetric key when using ${w.alg}`));if(!r.allowInvalidAsymmetricKeyTypes)try{l(w.alg,s)}catch(e){return v(e)}try{c=u.verify(e,b.header.alg,s)}catch(e){return v(e)}if(!c)return v(new o("invalid signature"));let E=b.payload;if(void 0!==E.nbf&&!r.ignoreNotBefore){if("number"!=typeof E.nbf)return v(new o("invalid nbf value"));if(E.nbf>S+(r.clockTolerance||0))return v(new a("jwt not active",new Date(1e3*E.nbf)))}if(void 0!==E.exp&&!r.ignoreExpiration){if("number"!=typeof E.exp)return v(new o("invalid exp value"));if(S>=E.exp+(r.clockTolerance||0))return v(new i("jwt expired",new Date(1e3*E.exp)))}if(r.audience){let e=Array.isArray(r.audience)?r.audience:[r.audience];if(!(Array.isArray(E.aud)?E.aud:[E.aud]).some(function(t){return e.some(function(e){return e instanceof RegExp?e.test(t):e===t})}))return v(new o("jwt audience invalid. expected: "+e.join(" or ")))}if(r.issuer&&("string"==typeof r.issuer&&E.iss!==r.issuer||Array.isArray(r.issuer)&&-1===r.issuer.indexOf(E.iss)))return v(new o("jwt issuer invalid. expected: "+r.issuer));if(r.subject&&E.sub!==r.subject)return v(new o("jwt subject invalid. expected: "+r.subject));if(r.jwtid&&E.jti!==r.jwtid)return v(new o("jwt jwtid invalid. expected: "+r.jwtid));if(r.nonce&&E.nonce!==r.nonce)return v(new o("jwt nonce invalid. expected: "+r.nonce));if(r.maxAge){if("number"!=typeof E.iat)return v(new o("iat required when maxAge is specified"));let e=n(r.maxAge,E.iat);if(void 0===e)return v(new o('"maxAge" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'));if(S>=e+(r.clockTolerance||0))return v(new i("maxAge exceeded",new Date(1e3*e)))}return!0===r.complete?v(null,{header:w,payload:E,signature:b.signature}):v(null,E)})}},2357(e,t,r){var o,a=r(6608).Buffer,i=r(6982),s=r(9053),n=r(9023),l="secret must be a string or buffer",c="key must be a string or a buffer",u="function"==typeof i.createPublicKey;function d(e){if(!a.isBuffer(e)&&"string"!=typeof e&&(!u||"object"!=typeof e||"string"!=typeof e.type||"string"!=typeof e.asymmetricKeyType||"function"!=typeof e.export))throw m(c)}function p(e){if(!a.isBuffer(e)&&"string"!=typeof e&&"object"!=typeof e)throw m("key must be a string, a buffer or an object")}function h(e){return e.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function f(e){var t=4-(e=e.toString()).length%4;if(4!==t)for(var r=0;r<t;++r)e+="=";return e.replace(/\-/g,"+").replace(/_/g,"/")}function m(e){var t=[].slice.call(arguments,1);return TypeError(n.format.bind(n,e).apply(null,t))}function y(e){var t;return t=e,a.isBuffer(t)||"string"==typeof t||(e=JSON.stringify(e)),e}function g(e){return function(t,r){!function(e){if(!a.isBuffer(e)){if("string"!=typeof e){if(!u||"object"!=typeof e||"secret"!==e.type||"function"!=typeof e.export)throw m(l)}}}(r),t=y(t);var o=i.createHmac("sha"+e,r);return h((o.update(t),o.digest("base64")))}}u&&(c+=" or a KeyObject",l+="or a KeyObject");var v="timingSafeEqual"in i?function(e,t){return e.byteLength===t.byteLength&&i.timingSafeEqual(e,t)}:function(e,t){return o||(o=r(9454)),o(e,t)};function b(e){return function(t,r,o){var i=g(e)(t,o);return v(a.from(r),a.from(i))}}function _(e){return function(t,r){p(r),t=y(t);var o=i.createSign("RSA-SHA"+e);return h((o.update(t),o.sign(r,"base64")))}}function S(e){return function(t,r,o){d(o),t=y(t),r=f(r);var a=i.createVerify("RSA-SHA"+e);return a.update(t),a.verify(o,r,"base64")}}function $(e){return function(t,r){p(r),t=y(t);var o=i.createSign("RSA-SHA"+e);return h((o.update(t),o.sign({key:r,padding:i.constants.RSA_PKCS1_PSS_PADDING,saltLength:i.constants.RSA_PSS_SALTLEN_DIGEST},"base64")))}}function w(e){return function(t,r,o){d(o),t=y(t),r=f(r);var a=i.createVerify("RSA-SHA"+e);return a.update(t),a.verify({key:o,padding:i.constants.RSA_PKCS1_PSS_PADDING,saltLength:i.constants.RSA_PSS_SALTLEN_DIGEST},r,"base64")}}function E(e){var t=_(e);return function(){var r=t.apply(null,arguments);return s.derToJose(r,"ES"+e)}}function R(e){var t=S(e);return function(r,o,a){return t(r,o=s.joseToDer(o,"ES"+e).toString("base64"),a)}}function P(){return function(){return""}}function k(){return function(e,t){return""===t}}e.exports=function(e){var t=e.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/);if(!t)throw m('"%s" is not a valid algorithm.\n Supported algorithms are:\n "HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".',e);var r=(t[1]||t[3]).toLowerCase(),o=t[2];return{sign:({hs:g,rs:_,ps:$,es:E,none:P})[r](o),verify:({hs:b,rs:S,ps:w,es:R,none:k})[r](o)}}},3263(e,t,r){var o=r(9615),a=r(6747);t.ALGORITHMS=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"],t.sign=o.sign,t.verify=a.verify,t.decode=a.decode,t.isValid=a.isValid,t.createSign=function(e){return new o(e)},t.createVerify=function(e){return new a(e)}},6360(e,t,r){var o=r(6608).Buffer,a=r(2203);function i(e){if(this.buffer=null,this.writable=!0,this.readable=!0,!e)return this.buffer=o.alloc(0),this;if("function"==typeof e.pipe)return this.buffer=o.alloc(0),e.pipe(this),this;if(e.length||"object"==typeof e)return this.buffer=e,this.writable=!1,process.nextTick((function(){this.emit("end",e),this.readable=!1,this.emit("close")}).bind(this)),this;throw TypeError("Unexpected data type ("+typeof e+")")}r(9023).inherits(i,a),i.prototype.write=function(e){this.buffer=o.concat([this.buffer,o.from(e)]),this.emit("data",e)},i.prototype.end=function(e){e&&this.write(e),this.emit("end",e),this.emit("close"),this.writable=!1,this.readable=!1},e.exports=i},9615(e,t,r){var o=r(6608).Buffer,a=r(6360),i=r(2357),s=r(2203),n=r(5911),l=r(9023);function c(e,t){return o.from(e,t).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function u(e){var t,r,o,a=e.header,s=e.payload,u=e.secret||e.privateKey,d=e.encoding,p=i(a.alg),h=(t=(t=d)||"utf8",r=c(n(a),"binary"),o=c(n(s),t),l.format("%s.%s",r,o)),f=p.sign(h,u);return l.format("%s.%s",h,f)}function d(e){var t=e.secret;if(t=null==(t=null==t?e.privateKey:t)?e.key:t,!0===/^hs/i.test(e.header.alg)&&null==t)throw TypeError("secret must be a string or buffer or a KeyObject");var r=new a(t);this.readable=!0,this.header=e.header,this.encoding=e.encoding,this.secret=this.privateKey=this.key=r,this.payload=new a(e.payload),this.secret.once("close",(function(){!this.payload.writable&&this.readable&&this.sign()}).bind(this)),this.payload.once("close",(function(){!this.secret.writable&&this.readable&&this.sign()}).bind(this))}l.inherits(d,s),d.prototype.sign=function(){try{var e=u({header:this.header,payload:this.payload.buffer,secret:this.secret.buffer,encoding:this.encoding});return this.emit("done",e),this.emit("data",e),this.emit("end"),this.readable=!1,e}catch(e){this.readable=!1,this.emit("error",e),this.emit("close")}},d.sign=u,e.exports=d},5911(e,t,r){var o=r(181).Buffer;e.exports=function(e){return"string"==typeof e?e:"number"==typeof e||o.isBuffer(e)?e.toString():JSON.stringify(e)}},6747(e,t,r){var o=r(6608).Buffer,a=r(6360),i=r(2357),s=r(2203),n=r(5911),l=r(9023),c=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function u(e){var t=e.split(".",1)[0],r=o.from(t,"base64").toString("binary");if("[object Object]"===Object.prototype.toString.call(r))return r;try{return JSON.parse(r)}catch(e){return}}function d(e){return e.split(".")[2]}function p(e){return c.test(e)&&!!u(e)}function h(e,t,r){if(!t){var o=Error("Missing algorithm parameter for jws.verify");throw o.code="MISSING_ALGORITHM",o}var a=d(e=n(e)),s=e.split(".",2).join(".");return i(t).verify(s,a,r)}function f(e,t){if(t=t||{},!p(e=n(e)))return null;var r,a,i=u(e);if(!i)return null;var s=(r=r||"utf8",a=e.split(".")[1],o.from(a,"base64").toString(r));return("JWT"===i.typ||t.json)&&(s=JSON.parse(s,t.encoding)),{header:i,payload:s,signature:d(e)}}function m(e){var t=(e=e||{}).secret;if(t=null==(t=null==t?e.publicKey:t)?e.key:t,!0===/^hs/i.test(e.algorithm)&&null==t)throw TypeError("secret must be a string or buffer or a KeyObject");var r=new a(t);this.readable=!0,this.algorithm=e.algorithm,this.encoding=e.encoding,this.secret=this.publicKey=this.key=r,this.signature=new a(e.signature),this.secret.once("close",(function(){!this.signature.writable&&this.readable&&this.verify()}).bind(this)),this.signature.once("close",(function(){!this.secret.writable&&this.readable&&this.verify()}).bind(this))}l.inherits(m,s),m.prototype.verify=function(){try{var e=h(this.signature.buffer,this.algorithm,this.key.buffer),t=f(this.signature.buffer,this.encoding);return this.emit("done",e,t),this.emit("data",e),this.emit("end"),this.readable=!1,e}catch(e){this.readable=!1,this.emit("error",e),this.emit("close")}},m.decode=f,m.isValid=p,m.verify=h,e.exports=m},5357(e){var t,r,o=1/0,a=0/0,i=/^\s+|\s+$/g,s=/^[-+]0x[0-9a-f]+$/i,n=/^0b[01]+$/i,l=/^0o[0-7]+$/i,c=/^(?:0|[1-9]\d*)$/,u=parseInt;function d(e){return e!=e}var p=Object.prototype,h=p.hasOwnProperty,f=p.toString,m=p.propertyIsEnumerable,y=(t=Object.keys,r=Object,function(e){return t(r(e))}),g=Math.max,v=Array.isArray;function b(e){var t,r,o;return null!=e&&"number"==typeof(t=e.length)&&t>-1&&t%1==0&&t<=0x1fffffffffffff&&"[object Function]"!=(o=_(r=e)?f.call(r):"")&&"[object GeneratorFunction]"!=o}function _(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function S(e){return!!e&&"object"==typeof e}e.exports=function(e,t,r,$){e=b(e)?e:function(e){return e?function(e,t){for(var r=-1,o=e?e.length:0,a=Array(o);++r<o;)a[r]=t(e[r],r,e);return a}(b(e)?function(e,t){var r,o,a,i,s=v(e)||S(o=r=e)&&b(o)&&h.call(r,"callee")&&(!m.call(r,"callee")||"[object Arguments]"==f.call(r))?function(e,t){for(var r=-1,o=Array(e);++r<e;)o[r]=t(r);return o}(e.length,String):[],n=s.length,l=!!n;for(var u in e){h.call(e,u)&&!(l&&("length"==u||(a=u,(i=null==(i=n)?0x1fffffffffffff:i)&&("number"==typeof a||c.test(a))&&a>-1&&a%1==0&&a<i)))&&s.push(u)}return s}(e):function(e){if(r=(t=e)&&t.constructor,t!==("function"==typeof r&&r.prototype||p))return y(e);var t,r,o=[];for(var a in Object(e))h.call(e,a)&&"constructor"!=a&&o.push(a);return o}(e),function(t){return e[t]}):[]}(e),r=r&&!$?(R=(E=(w=r)?(w=function(e){if("number"==typeof e)return e;if("symbol"==typeof(t=e)||S(t)&&"[object Symbol]"==f.call(t))return a;if(_(e)){var t,r="function"==typeof e.valueOf?e.valueOf():e;e=_(r)?r+"":r}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(i,"");var o=n.test(e);return o||l.test(e)?u(e.slice(2),o?2:8):s.test(e)?a:+e}(w))===o||w===-o?(w<0?-1:1)*17976931348623157e292:w==w?w:0:0===w?w:0)%1,E==E?R?E-R:E:0):0;var w,E,R,P,k=e.length;return r<0&&(r=g(k+r,0)),"string"==typeof(P=e)||!v(P)&&S(P)&&"[object String]"==f.call(P)?r<=k&&e.indexOf(t,r)>-1:!!k&&function(e,t,r){if(t!=t){for(var o=e.length,a=r+-1;++a<o;)if(d(e[a],a,e))return a;return -1}for(var i=r-1,s=e.length;++i<s;)if(e[i]===t)return i;return -1}(e,t,r)>-1}},6782(e){var t=Object.prototype.toString;e.exports=function(e){var r;return!0===e||!1===e||!!(r=e)&&"object"==typeof r&&"[object Boolean]"==t.call(e)}},5250(e){var t=1/0,r=0/0,o=/^\s+|\s+$/g,a=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,s=/^0o[0-7]+$/i,n=parseInt,l=Object.prototype.toString;function c(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}e.exports=function(e){var u,d,p;return"number"==typeof e&&e==(p=(d=(u=e)?(u=function(e){if("number"==typeof e)return e;if("symbol"==typeof(t=e)||t&&"object"==typeof t&&"[object Symbol]"==l.call(t))return r;if(c(e)){var t,u="function"==typeof e.valueOf?e.valueOf():e;e=c(u)?u+"":u}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(o,"");var d=i.test(e);return d||s.test(e)?n(e.slice(2),d?2:8):a.test(e)?r:+e}(u))===t||u===-t?(u<0?-1:1)*17976931348623157e292:u==u?u:0:0===u?u:0)%1,d==d?p?d-p:d:0)}},8094(e){var t=Object.prototype.toString;e.exports=function(e){return"number"==typeof e||!!e&&"object"==typeof e&&"[object Number]"==t.call(e)}},6052(e){var t,r,o=Object.prototype,a=Function.prototype.toString,i=o.hasOwnProperty,s=a.call(Object),n=o.toString,l=(t=Object.getPrototypeOf,r=Object,function(e){return t(r(e))});e.exports=function(e){if(!(e&&"object"==typeof e)||"[object Object]"!=n.call(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e))return!1;var t=l(e);if(null===t)return!0;var r=i.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&a.call(r)==s}},1251(e){var t=Object.prototype.toString,r=Array.isArray;e.exports=function(e){var o;return"string"==typeof e||!r(e)&&!!(o=e)&&"object"==typeof o&&"[object String]"==t.call(e)}},8430(e){var t=1/0,r=0/0,o=/^\s+|\s+$/g,a=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,s=/^0o[0-7]+$/i,n=parseInt,l=Object.prototype.toString;function c(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}e.exports=function(e){var u,d,p,h,f=2,m=e;if("function"!=typeof m)throw TypeError("Expected a function");return p=(d=(u=f)?(u=function(e){if("number"==typeof e)return e;if("symbol"==typeof(t=e)||t&&"object"==typeof t&&"[object Symbol]"==l.call(t))return r;if(c(e)){var t,u="function"==typeof e.valueOf?e.valueOf():e;e=c(u)?u+"":u}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(o,"");var d=i.test(e);return d||s.test(e)?n(e.slice(2),d?2:8):a.test(e)?r:+e}(u))===t||u===-t?(u<0?-1:1)*17976931348623157e292:u==u?u:0:0===u?u:0)%1,f=d==d?p?d-p:d:0,function(){return--f>0&&(h=m.apply(this,arguments)),f<=1&&(m=void 0),h}}},3866(e){function t(e,t,r,o){return Math.round(e/r)+" "+o+(t>=1.5*r?"s":"")}e.exports=function(e,r){r=r||{};var o,a,i,s,n=typeof e;if("string"===n&&e.length>0){var l=e;if(!((l=String(l)).length>100)){var c=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(l);if(c){var u=parseFloat(c[1]);switch((c[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*u;case"weeks":case"week":case"w":return 6048e5*u;case"days":case"day":case"d":return 864e5*u;case"hours":case"hour":case"hrs":case"hr":case"h":return 36e5*u;case"minutes":case"minute":case"mins":case"min":case"m":return 6e4*u;case"seconds":case"second":case"secs":case"sec":case"s":return 1e3*u;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return u;default:break}}}return}if("number"===n&&isFinite(e)){return r.long?(a=Math.abs(o=e))>=864e5?t(o,a,864e5,"day"):a>=36e5?t(o,a,36e5,"hour"):a>=6e4?t(o,a,6e4,"minute"):a>=1e3?t(o,a,1e3,"second"):o+" ms":(s=Math.abs(i=e))>=864e5?Math.round(i/864e5)+"d":s>=36e5?Math.round(i/36e5)+"h":s>=6e4?Math.round(i/6e4)+"m":s>=1e3?Math.round(i/1e3)+"s":i+"ms"}throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},9695(e){"use strict";let t=(e={})=>{let t=e.env||process.env;return"win32"!==(e.platform||process.platform)?"PATH":Object.keys(t).reverse().find(e=>"PATH"===e.toUpperCase())||"Path"};e.exports=t,e.exports.default=t},6608(e,t,r){var o=r(181),a=o.Buffer;function i(e,t){for(var r in e)t[r]=e[r]}function s(e,t,r){return a(e,t,r)}a.from&&a.alloc&&a.allocUnsafe&&a.allocUnsafeSlow?e.exports=o:(i(o,t),t.Buffer=s),s.prototype=Object.create(a.prototype),i(a,s),s.from=function(e,t,r){if("number"==typeof e)throw TypeError("Argument must not be a number");return a(e,t,r)},s.alloc=function(e,t,r){if("number"!=typeof e)throw TypeError("Argument must be a number");var o=a(e);return void 0!==t?"string"==typeof r?o.fill(t,r):o.fill(t):o.fill(0),o},s.allocUnsafe=function(e){if("number"!=typeof e)throw TypeError("Argument must be a number");return a(e)},s.allocUnsafeSlow=function(e){if("number"!=typeof e)throw TypeError("Argument must be a number");return o.SlowBuffer(e)}},8610(e,t,r){"use strict";let o=Symbol("SemVer ANY");class a{static get ANY(){return o}constructor(e,t){if(t=i(t),e instanceof a)if(!!t.loose===e.loose)return e;else e=e.value;c("comparator",e=e.trim().split(/\s+/).join(" "),t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===o?this.value="":this.value=this.operator+this.semver.version,c("comp",this)}parse(e){let t=this.options.loose?s[n.COMPARATORLOOSE]:s[n.COMPARATOR],r=e.match(t);if(!r)throw TypeError(`Invalid comparator: ${e}`);this.operator=void 0!==r[1]?r[1]:"","="===this.operator&&(this.operator=""),r[2]?this.semver=new u(r[2],this.options.loose):this.semver=o}toString(){return this.value}test(e){if(c("Comparator.test",e,this.options.loose),this.semver===o||e===o)return!0;if("string"==typeof e)try{e=new u(e,this.options)}catch(e){return!1}return l(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof a))throw TypeError("a Comparator is required");return""===this.operator?""===this.value||new d(e.value,t).test(this.value):""===e.operator?""===e.value||new d(this.value,t).test(e.semver):!((t=i(t)).includePrerelease&&("<0.0.0-0"===this.value||"<0.0.0-0"===e.value)||!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0")))&&!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||l(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||l(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">"))}}e.exports=a;let i=r(4621),{safeRe:s,t:n}=r(152),l=r(5461),c=r(674),u=r(2398),d=r(2069)},2069(e,t,r){"use strict";let o=/\s+/g;class a{constructor(e,t){if(t=s(t),e instanceof a)if(!!t.loose===e.loose&&!!t.includePrerelease===e.includePrerelease)return e;else return new a(e.raw,t);if(e instanceof n)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(o," "),this.set=this.raw.split("||").map(e=>this.parseRange(e.trim())).filter(e=>e.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter(e=>!g(e[0])),0===this.set.length)this.set=[e];else if(this.set.length>1){for(const e of this.set)if(1===e.length&&v(e[0])){this.set=[e];break}}}this.formatted=void 0}get range(){if(void 0===this.formatted){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");let t=this.set[e];for(let e=0;e<t.length;e++)e>0&&(this.formatted+=" "),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let t=((this.options.includePrerelease&&m)|(this.options.loose&&y))+":"+e,r=i.get(t);if(r)return r;let o=this.options.loose,a=o?u[d.HYPHENRANGELOOSE]:u[d.HYPHENRANGE];l("hyphen replace",e=e.replace(a,x(this.options.includePrerelease))),l("comparator trim",e=e.replace(u[d.COMPARATORTRIM],p)),l("tilde trim",e=e.replace(u[d.TILDETRIM],h)),l("caret trim",e=e.replace(u[d.CARETTRIM],f));let s=e.split(" ").map(e=>_(e,this.options)).join(" ").split(/\s+/).map(e=>O(e,this.options));o&&(s=s.filter(e=>(l("loose invalid filter",e,this.options),!!e.match(u[d.COMPARATORLOOSE])))),l("range list",s);let c=new Map;for(let e of s.map(e=>new n(e,this.options))){if(g(e))return[e];c.set(e.value,e)}c.size>1&&c.has("")&&c.delete("");let v=[...c.values()];return i.set(t,v),v}intersects(e,t){if(!(e instanceof a))throw TypeError("a Range is required");return this.set.some(r=>b(r,t)&&e.set.some(e=>b(e,t)&&r.every(r=>e.every(e=>r.intersects(e,t)))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new c(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if(j(this.set[t],e,this.options))return!0;return!1}}e.exports=a;let i=new(r(2044)),s=r(4621),n=r(8610),l=r(674),c=r(2398),{safeRe:u,t:d,comparatorTrimReplace:p,tildeTrimReplace:h,caretTrimReplace:f}=r(152),{FLAG_INCLUDE_PRERELEASE:m,FLAG_LOOSE:y}=r(5076),g=e=>"<0.0.0-0"===e.value,v=e=>""===e.value,b=(e,t)=>{let r=!0,o=e.slice(),a=o.pop();for(;r&&o.length;)r=o.every(e=>a.intersects(e,t)),a=o.pop();return r},_=(e,t)=>(l("comp",e=e.replace(u[d.BUILD],""),t),l("caret",e=E(e,t)),l("tildes",e=$(e,t)),l("xrange",e=P(e,t)),l("stars",e=T(e,t)),e),S=e=>!e||"x"===e.toLowerCase()||"*"===e,$=(e,t)=>e.trim().split(/\s+/).map(e=>w(e,t)).join(" "),w=(e,t)=>{let r=t.loose?u[d.TILDELOOSE]:u[d.TILDE];return e.replace(r,(t,r,o,a,i)=>{let s;return l("tilde",e,t,r,o,a,i),S(r)?s="":S(o)?s=`>=${r}.0.0 <${+r+1}.0.0-0`:S(a)?s=`>=${r}.${o}.0 <${r}.${+o+1}.0-0`:i?(l("replaceTilde pr",i),s=`>=${r}.${o}.${a}-${i} <${r}.${+o+1}.0-0`):s=`>=${r}.${o}.${a} <${r}.${+o+1}.0-0`,l("tilde return",s),s})},E=(e,t)=>e.trim().split(/\s+/).map(e=>R(e,t)).join(" "),R=(e,t)=>{l("caret",e,t);let r=t.loose?u[d.CARETLOOSE]:u[d.CARET],o=t.includePrerelease?"-0":"";return e.replace(r,(t,r,a,i,s)=>{let n;return l("caret",e,t,r,a,i,s),S(r)?n="":S(a)?n=`>=${r}.0.0${o} <${+r+1}.0.0-0`:S(i)?n="0"===r?`>=${r}.${a}.0${o} <${r}.${+a+1}.0-0`:`>=${r}.${a}.0${o} <${+r+1}.0.0-0`:s?(l("replaceCaret pr",s),n="0"===r?"0"===a?`>=${r}.${a}.${i}-${s} <${r}.${a}.${+i+1}-0`:`>=${r}.${a}.${i}-${s} <${r}.${+a+1}.0-0`:`>=${r}.${a}.${i}-${s} <${+r+1}.0.0-0`):(l("no pr"),n="0"===r?"0"===a?`>=${r}.${a}.${i}${o} <${r}.${a}.${+i+1}-0`:`>=${r}.${a}.${i}${o} <${r}.${+a+1}.0-0`:`>=${r}.${a}.${i} <${+r+1}.0.0-0`),l("caret return",n),n})},P=(e,t)=>(l("replaceXRanges",e,t),e.split(/\s+/).map(e=>k(e,t)).join(" ")),k=(e,t)=>{e=e.trim();let r=t.loose?u[d.XRANGELOOSE]:u[d.XRANGE];return e.replace(r,(r,o,a,i,s,n)=>{l("xRange",e,r,o,a,i,s,n);let c=S(a),u=c||S(i),d=u||S(s);return"="===o&&d&&(o=""),n=t.includePrerelease?"-0":"",c?r=">"===o||"<"===o?"<0.0.0-0":"*":o&&d?(u&&(i=0),s=0,">"===o?(o=">=",u?(a=+a+1,i=0):i=+i+1,s=0):"<="===o&&(o="<",u?a=+a+1:i=+i+1),"<"===o&&(n="-0"),r=`${o+a}.${i}.${s}${n}`):u?r=`>=${a}.0.0${n} <${+a+1}.0.0-0`:d&&(r=`>=${a}.${i}.0${n} <${a}.${+i+1}.0-0`),l("xRange return",r),r})},T=(e,t)=>(l("replaceStars",e,t),e.trim().replace(u[d.STAR],"")),O=(e,t)=>(l("replaceGTE0",e,t),e.trim().replace(u[t.includePrerelease?d.GTE0PRE:d.GTE0],"")),x=e=>(t,r,o,a,i,s,n,l,c,u,d,p)=>(r=S(o)?"":S(a)?`>=${o}.0.0${e?"-0":""}`:S(i)?`>=${o}.${a}.0${e?"-0":""}`:s?`>=${r}`:`>=${r}${e?"-0":""}`,l=S(c)?"":S(u)?`<${+c+1}.0.0-0`:S(d)?`<${c}.${+u+1}.0-0`:p?`<=${c}.${u}.${d}-${p}`:e?`<${c}.${u}.${+d+1}-0`:`<=${l}`,`${r} ${l}`.trim()),j=(e,t,r)=>{for(let r=0;r<e.length;r++)if(!e[r].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let r=0;r<e.length;r++)if(l(e[r].semver),e[r].semver!==n.ANY&&e[r].semver.prerelease.length>0){let o=e[r].semver;if(o.major===t.major&&o.minor===t.minor&&o.patch===t.patch)return!0}return!1}return!0}},2398(e,t,r){"use strict";let o=r(674),{MAX_LENGTH:a,MAX_SAFE_INTEGER:i}=r(5076),{safeRe:s,t:n}=r(152),l=r(4621),{compareIdentifiers:c}=r(9101);class u{constructor(e,t){if(t=l(t),e instanceof u)if(!!t.loose===e.loose&&!!t.includePrerelease===e.includePrerelease)return e;else e=e.version;else if("string"!=typeof e)throw TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>a)throw TypeError(`version is longer than ${a} characters`);o("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;const r=e.trim().match(t.loose?s[n.LOOSE]:s[n.FULL]);if(!r)throw TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>i||this.major<0)throw TypeError("Invalid major version");if(this.minor>i||this.minor<0)throw TypeError("Invalid minor version");if(this.patch>i||this.patch<0)throw TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(e=>{if(/^[0-9]+$/.test(e)){let t=+e;if(t>=0&&t<i)return t}return e}):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(o("SemVer.compare",this.version,this.options,e),!(e instanceof u)){if("string"==typeof e&&e===this.version)return 0;e=new u(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return(e instanceof u||(e=new u(e,this.options)),this.major<e.major)?-1:this.major>e.major?1:this.minor<e.minor?-1:this.minor>e.minor?1:this.patch<e.patch?-1:+(this.patch>e.patch)}comparePre(e){if(e instanceof u||(e=new u(e,this.options)),this.prerelease.length&&!e.prerelease.length)return -1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{let r=this.prerelease[t],a=e.prerelease[t];if(o("prerelease compare",t,r,a),void 0===r&&void 0===a)return 0;if(void 0===a)return 1;if(void 0===r)return -1;else if(r===a)continue;else return c(r,a)}while(++t)}compareBuild(e){e instanceof u||(e=new u(e,this.options));let t=0;do{let r=this.build[t],a=e.build[t];if(o("build compare",t,r,a),void 0===r&&void 0===a)return 0;if(void 0===a)return 1;if(void 0===r)return -1;else if(r===a)continue;else return c(r,a)}while(++t)}inc(e,t,r){if(e.startsWith("pre")){if(!t&&!1===r)throw Error("invalid increment argument: identifier is empty");if(t){let e=`-${t}`.match(this.options.loose?s[n.PRERELEASELOOSE]:s[n.PRERELEASE]);if(!e||e[1]!==t)throw Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,r),this.inc("pre",t,r);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t,r),this.inc("pre",t,r);break;case"release":if(0===this.prerelease.length)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(0!==this.minor||0!==this.patch||0===this.prerelease.length)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(0!==this.patch||0===this.prerelease.length)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{let e=+!!Number(r);if(0===this.prerelease.length)this.prerelease=[e];else{let o=this.prerelease.length;for(;--o>=0;)"number"==typeof this.prerelease[o]&&(this.prerelease[o]++,o=-2);if(-1===o){if(t===this.prerelease.join(".")&&!1===r)throw Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let o=[t,e];!1===r&&(o=[t]),0===c(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=o):this.prerelease=o}break}default:throw Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}e.exports=u},5608(e,t,r){"use strict";let o=r(6802);e.exports=(e,t)=>{let r=o(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null}},5461(e,t,r){"use strict";let o=r(8271),a=r(733),i=r(1686),s=r(6479),n=r(7257),l=r(5850);e.exports=(e,t,r,c)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e===r;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e!==r;case"":case"=":case"==":return o(e,r,c);case"!=":return a(e,r,c);case">":return i(e,r,c);case">=":return s(e,r,c);case"<":return n(e,r,c);case"<=":return l(e,r,c);default:throw TypeError(`Invalid operator: ${t}`)}}},7771(e,t,r){"use strict";let o=r(2398),a=r(6802),{safeRe:i,t:s}=r(152);e.exports=(e,t)=>{if(e instanceof o)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let r=null;if((t=t||{}).rtl){let o,a=t.includePrerelease?i[s.COERCERTLFULL]:i[s.COERCERTL];for(;(o=a.exec(e))&&(!r||r.index+r[0].length!==e.length);)r&&o.index+o[0].length===r.index+r[0].length||(r=o),a.lastIndex=o.index+o[1].length+o[2].length;a.lastIndex=-1}else r=e.match(t.includePrerelease?i[s.COERCEFULL]:i[s.COERCE]);if(null===r)return null;let n=r[2],l=r[3]||"0",c=r[4]||"0",u=t.includePrerelease&&r[5]?`-${r[5]}`:"",d=t.includePrerelease&&r[6]?`+${r[6]}`:"";return a(`${n}.${l}.${c}${u}${d}`,t)}},8767(e,t,r){"use strict";let o=r(2398);e.exports=(e,t,r)=>{let a=new o(e,r),i=new o(t,r);return a.compare(i)||a.compareBuild(i)}},6293(e,t,r){"use strict";let o=r(6958);e.exports=(e,t)=>o(e,t,!0)},6958(e,t,r){"use strict";let o=r(2398);e.exports=(e,t,r)=>new o(e,r).compare(new o(t,r))},3086(e,t,r){"use strict";let o=r(6802);e.exports=(e,t)=>{let r=o(e,null,!0),a=o(t,null,!0),i=r.compare(a);if(0===i)return null;let s=i>0,n=s?r:a,l=s?a:r,c=!!n.prerelease.length;if(l.prerelease.length&&!c){if(!l.patch&&!l.minor)return"major";if(0===l.compareMain(n))return l.minor&&!l.patch?"minor":"patch"}let u=c?"pre":"";return r.major!==a.major?u+"major":r.minor!==a.minor?u+"minor":r.patch!==a.patch?u+"patch":"prerelease"}},8271(e,t,r){"use strict";let o=r(6958);e.exports=(e,t,r)=>0===o(e,t,r)},1686(e,t,r){"use strict";let o=r(6958);e.exports=(e,t,r)=>o(e,t,r)>0},6479(e,t,r){"use strict";let o=r(6958);e.exports=(e,t,r)=>o(e,t,r)>=0},3625(e,t,r){"use strict";let o=r(2398);e.exports=(e,t,r,a,i)=>{"string"==typeof r&&(i=a,a=r,r=void 0);try{return new o(e instanceof o?e.version:e,r).inc(t,a,i).version}catch(e){return null}}},7257(e,t,r){"use strict";let o=r(6958);e.exports=(e,t,r)=>0>o(e,t,r)},5850(e,t,r){"use strict";let o=r(6958);e.exports=(e,t,r)=>0>=o(e,t,r)},7744(e,t,r){"use strict";let o=r(2398);e.exports=(e,t)=>new o(e,t).major},4812(e,t,r){"use strict";let o=r(2398);e.exports=(e,t)=>new o(e,t).minor},733(e,t,r){"use strict";let o=r(6958);e.exports=(e,t,r)=>0!==o(e,t,r)},6802(e,t,r){"use strict";let o=r(2398);e.exports=(e,t,r=!1)=>{if(e instanceof o)return e;try{return new o(e,t)}catch(e){if(!r)return null;throw e}}},8643(e,t,r){"use strict";let o=r(2398);e.exports=(e,t)=>new o(e,t).patch},9283(e,t,r){"use strict";let o=r(6802);e.exports=(e,t)=>{let r=o(e,t);return r&&r.prerelease.length?r.prerelease:null}},7032(e,t,r){"use strict";let o=r(6958);e.exports=(e,t,r)=>o(t,e,r)},9839(e,t,r){"use strict";let o=r(8767);e.exports=(e,t)=>e.sort((e,r)=>o(r,e,t))},4056(e,t,r){"use strict";let o=r(2069);e.exports=(e,t,r)=>{try{t=new o(t,r)}catch(e){return!1}return t.test(e)}},7697(e,t,r){"use strict";let o=r(8767);e.exports=(e,t)=>e.sort((e,r)=>o(e,r,t))},6807(e,t,r){"use strict";let o=r(6802);e.exports=(e,t)=>{let r=o(e,t);return r?r.version:null}},3895(e,t,r){"use strict";let o=r(152),a=r(5076),i=r(2398),s=r(9101),n=r(6802),l=r(6807),c=r(5608),u=r(3625),d=r(3086),p=r(7744),h=r(4812),f=r(8643),m=r(9283),y=r(6958),g=r(7032),v=r(6293),b=r(8767),_=r(7697),S=r(9839),$=r(1686),w=r(7257),E=r(8271),R=r(733),P=r(6479),k=r(5850),T=r(5461),O=r(7771),x=r(8610),j=r(2069),C=r(4056),N=r(6613),I=r(7114),A=r(1008),M=r(203),q=r(5372),z=r(4713),L=r(4497),D=r(9272),U=r(3490);e.exports={parse:n,valid:l,clean:c,inc:u,diff:d,major:p,minor:h,patch:f,prerelease:m,compare:y,rcompare:g,compareLoose:v,compareBuild:b,sort:_,rsort:S,gt:$,lt:w,eq:E,neq:R,gte:P,lte:k,cmp:T,coerce:O,Comparator:x,Range:j,satisfies:C,toComparators:N,maxSatisfying:I,minSatisfying:A,minVersion:M,validRange:q,outside:z,gtr:L,ltr:D,intersects:U,simplifyRange:r(4039),subset:r(22),SemVer:i,re:o.re,src:o.src,tokens:o.t,SEMVER_SPEC_VERSION:a.SEMVER_SPEC_VERSION,RELEASE_TYPES:a.RELEASE_TYPES,compareIdentifiers:s.compareIdentifiers,rcompareIdentifiers:s.rcompareIdentifiers}},5076(e){"use strict";e.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||0x1fffffffffffff,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}},674(e){"use strict";e.exports="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{}},9101(e){"use strict";let t=/^[0-9]+$/,r=(e,r)=>{if("number"==typeof e&&"number"==typeof r)return e===r?0:e<r?-1:1;let o=t.test(e),a=t.test(r);return o&&a&&(e*=1,r*=1),e===r?0:o&&!a?-1:a&&!o?1:e<r?-1:1};e.exports={compareIdentifiers:r,rcompareIdentifiers:(e,t)=>r(t,e)}},2044(e){"use strict";e.exports=class{constructor(){this.max=1e3,this.map=new Map}get(e){let t=this.map.get(e);if(void 0!==t)return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&void 0!==t){if(this.map.size>=this.max){let e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}}},4621(e){"use strict";let t=Object.freeze({loose:!0}),r=Object.freeze({});e.exports=e=>e?"object"!=typeof e?t:e:r},152(e,t,r){"use strict";let{MAX_SAFE_COMPONENT_LENGTH:o,MAX_SAFE_BUILD_LENGTH:a,MAX_LENGTH:i}=r(5076),s=r(674),n=(t=e.exports={}).re=[],l=t.safeRe=[],c=t.src=[],u=t.safeSrc=[],d=t.t={},p=0,h="[a-zA-Z0-9-]",f=[["\\s",1],["\\d",i],[h,a]],m=(e,t,r)=>{let o=(e=>{for(let[t,r]of f)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e})(t),a=p++;s(e,a,t),d[e]=a,c[a]=t,u[a]=o,n[a]=new RegExp(t,r?"g":void 0),l[a]=new RegExp(o,r?"g":void 0)};m("NUMERICIDENTIFIER","0|[1-9]\\d*"),m("NUMERICIDENTIFIERLOOSE","\\d+"),m("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${h}*`),m("MAINVERSION",`(${c[d.NUMERICIDENTIFIER]})\\.(${c[d.NUMERICIDENTIFIER]})\\.(${c[d.NUMERICIDENTIFIER]})`),m("MAINVERSIONLOOSE",`(${c[d.NUMERICIDENTIFIERLOOSE]})\\.(${c[d.NUMERICIDENTIFIERLOOSE]})\\.(${c[d.NUMERICIDENTIFIERLOOSE]})`),m("PRERELEASEIDENTIFIER",`(?:${c[d.NONNUMERICIDENTIFIER]}|${c[d.NUMERICIDENTIFIER]})`),m("PRERELEASEIDENTIFIERLOOSE",`(?:${c[d.NONNUMERICIDENTIFIER]}|${c[d.NUMERICIDENTIFIERLOOSE]})`),m("PRERELEASE",`(?:-(${c[d.PRERELEASEIDENTIFIER]}(?:\\.${c[d.PRERELEASEIDENTIFIER]})*))`),m("PRERELEASELOOSE",`(?:-?(${c[d.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[d.PRERELEASEIDENTIFIERLOOSE]})*))`),m("BUILDIDENTIFIER",`${h}+`),m("BUILD",`(?:\\+(${c[d.BUILDIDENTIFIER]}(?:\\.${c[d.BUILDIDENTIFIER]})*))`),m("FULLPLAIN",`v?${c[d.MAINVERSION]}${c[d.PRERELEASE]}?${c[d.BUILD]}?`),m("FULL",`^${c[d.FULLPLAIN]}$`),m("LOOSEPLAIN",`[v=\\s]*${c[d.MAINVERSIONLOOSE]}${c[d.PRERELEASELOOSE]}?${c[d.BUILD]}?`),m("LOOSE",`^${c[d.LOOSEPLAIN]}$`),m("GTLT","((?:<|>)?=?)"),m("XRANGEIDENTIFIERLOOSE",`${c[d.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),m("XRANGEIDENTIFIER",`${c[d.NUMERICIDENTIFIER]}|x|X|\\*`),m("XRANGEPLAIN",`[v=\\s]*(${c[d.XRANGEIDENTIFIER]})(?:\\.(${c[d.XRANGEIDENTIFIER]})(?:\\.(${c[d.XRANGEIDENTIFIER]})(?:${c[d.PRERELEASE]})?${c[d.BUILD]}?)?)?`),m("XRANGEPLAINLOOSE",`[v=\\s]*(${c[d.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[d.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[d.XRANGEIDENTIFIERLOOSE]})(?:${c[d.PRERELEASELOOSE]})?${c[d.BUILD]}?)?)?`),m("XRANGE",`^${c[d.GTLT]}\\s*${c[d.XRANGEPLAIN]}$`),m("XRANGELOOSE",`^${c[d.GTLT]}\\s*${c[d.XRANGEPLAINLOOSE]}$`),m("COERCEPLAIN",`(^|[^\\d])(\\d{1,${o}})(?:\\.(\\d{1,${o}}))?(?:\\.(\\d{1,${o}}))?`),m("COERCE",`${c[d.COERCEPLAIN]}(?:$|[^\\d])`),m("COERCEFULL",c[d.COERCEPLAIN]+`(?:${c[d.PRERELEASE]})?`+`(?:${c[d.BUILD]})?`+"(?:$|[^\\d])"),m("COERCERTL",c[d.COERCE],!0),m("COERCERTLFULL",c[d.COERCEFULL],!0),m("LONETILDE","(?:~>?)"),m("TILDETRIM",`(\\s*)${c[d.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",m("TILDE",`^${c[d.LONETILDE]}${c[d.XRANGEPLAIN]}$`),m("TILDELOOSE",`^${c[d.LONETILDE]}${c[d.XRANGEPLAINLOOSE]}$`),m("LONECARET","(?:\\^)"),m("CARETTRIM",`(\\s*)${c[d.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",m("CARET",`^${c[d.LONECARET]}${c[d.XRANGEPLAIN]}$`),m("CARETLOOSE",`^${c[d.LONECARET]}${c[d.XRANGEPLAINLOOSE]}$`),m("COMPARATORLOOSE",`^${c[d.GTLT]}\\s*(${c[d.LOOSEPLAIN]})$|^$`),m("COMPARATOR",`^${c[d.GTLT]}\\s*(${c[d.FULLPLAIN]})$|^$`),m("COMPARATORTRIM",`(\\s*)${c[d.GTLT]}\\s*(${c[d.LOOSEPLAIN]}|${c[d.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",m("HYPHENRANGE",`^\\s*(${c[d.XRANGEPLAIN]})\\s+-\\s+(${c[d.XRANGEPLAIN]})\\s*$`),m("HYPHENRANGELOOSE",`^\\s*(${c[d.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[d.XRANGEPLAINLOOSE]})\\s*$`),m("STAR","(<|>)?=?\\s*\\*"),m("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),m("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")},4497(e,t,r){"use strict";let o=r(4713);e.exports=(e,t,r)=>o(e,t,">",r)},3490(e,t,r){"use strict";let o=r(2069);e.exports=(e,t,r)=>(e=new o(e,r),t=new o(t,r),e.intersects(t,r))},9272(e,t,r){"use strict";let o=r(4713);e.exports=(e,t,r)=>o(e,t,"<",r)},7114(e,t,r){"use strict";let o=r(2398),a=r(2069);e.exports=(e,t,r)=>{let i=null,s=null,n=null;try{n=new a(t,r)}catch(e){return null}return e.forEach(e=>{n.test(e)&&(!i||-1===s.compare(e))&&(s=new o(i=e,r))}),i}},1008(e,t,r){"use strict";let o=r(2398),a=r(2069);e.exports=(e,t,r)=>{let i=null,s=null,n=null;try{n=new a(t,r)}catch(e){return null}return e.forEach(e=>{n.test(e)&&(!i||1===s.compare(e))&&(s=new o(i=e,r))}),i}},203(e,t,r){"use strict";let o=r(2398),a=r(2069),i=r(1686);e.exports=(e,t)=>{e=new a(e,t);let r=new o("0.0.0");if(e.test(r)||(r=new o("0.0.0-0"),e.test(r)))return r;r=null;for(let t=0;t<e.set.length;++t){let a=e.set[t],s=null;a.forEach(e=>{let t=new o(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":(!s||i(t,s))&&(s=t);break;case"<":case"<=":break;default:throw Error(`Unexpected operation: ${e.operator}`)}}),s&&(!r||i(r,s))&&(r=s)}return r&&e.test(r)?r:null}},4713(e,t,r){"use strict";let o=r(2398),a=r(8610),{ANY:i}=a,s=r(2069),n=r(4056),l=r(1686),c=r(7257),u=r(5850),d=r(6479);e.exports=(e,t,r,p)=>{let h,f,m,y,g;switch(e=new o(e,p),t=new s(t,p),r){case">":h=l,f=u,m=c,y=">",g=">=";break;case"<":h=c,f=d,m=l,y="<",g="<=";break;default:throw TypeError('Must provide a hilo val of "<" or ">"')}if(n(e,t,p))return!1;for(let r=0;r<t.set.length;++r){let o=t.set[r],s=null,n=null;if(o.forEach(e=>{e.semver===i&&(e=new a(">=0.0.0")),s=s||e,n=n||e,h(e.semver,s.semver,p)?s=e:m(e.semver,n.semver,p)&&(n=e)}),s.operator===y||s.operator===g||(!n.operator||n.operator===y)&&f(e,n.semver)||n.operator===g&&m(e,n.semver))return!1}return!0}},4039(e,t,r){"use strict";let o=r(4056),a=r(6958);e.exports=(e,t,r)=>{let i=[],s=null,n=null,l=e.sort((e,t)=>a(e,t,r));for(let e of l)o(e,t,r)?(n=e,s||(s=e)):(n&&i.push([s,n]),n=null,s=null);s&&i.push([s,null]);let c=[];for(let[e,t]of i)e===t?c.push(e):t||e!==l[0]?t?e===l[0]?c.push(`<=${t}`):c.push(`${e} - ${t}`):c.push(`>=${e}`):c.push("*");let u=c.join(" || "),d="string"==typeof t.raw?t.raw:String(t);return u.length<d.length?u:t}},22(e,t,r){"use strict";let o=r(2069),a=r(8610),{ANY:i}=a,s=r(4056),n=r(6958),l=[new a(">=0.0.0-0")],c=[new a(">=0.0.0")],u=(e,t,r)=>{let o,a,u,h,f,m,y;if(e===t)return!0;if(1===e.length&&e[0].semver===i)if(1===t.length&&t[0].semver===i)return!0;else e=r.includePrerelease?l:c;if(1===t.length&&t[0].semver===i)if(r.includePrerelease)return!0;else t=c;let g=new Set;for(let t of e)">"===t.operator||">="===t.operator?o=d(o,t,r):"<"===t.operator||"<="===t.operator?a=p(a,t,r):g.add(t.semver);if(g.size>1)return null;if(o&&a&&((u=n(o.semver,a.semver,r))>0||0===u&&(">="!==o.operator||"<="!==a.operator)))return null;for(let e of g){if(o&&!s(e,String(o),r)||a&&!s(e,String(a),r))return null;for(let o of t)if(!s(e,String(o),r))return!1;return!0}let v=!!a&&!r.includePrerelease&&!!a.semver.prerelease.length&&a.semver,b=!!o&&!r.includePrerelease&&!!o.semver.prerelease.length&&o.semver;for(let e of(v&&1===v.prerelease.length&&"<"===a.operator&&0===v.prerelease[0]&&(v=!1),t)){if(y=y||">"===e.operator||">="===e.operator,m=m||"<"===e.operator||"<="===e.operator,o){if(b&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===b.major&&e.semver.minor===b.minor&&e.semver.patch===b.patch&&(b=!1),">"===e.operator||">="===e.operator){if((h=d(o,e,r))===e&&h!==o)return!1}else if(">="===o.operator&&!s(o.semver,String(e),r))return!1}if(a){if(v&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===v.major&&e.semver.minor===v.minor&&e.semver.patch===v.patch&&(v=!1),"<"===e.operator||"<="===e.operator){if((f=p(a,e,r))===e&&f!==a)return!1}else if("<="===a.operator&&!s(a.semver,String(e),r))return!1}if(!e.operator&&(a||o)&&0!==u)return!1}return(!o||!m||!!a||0===u)&&(!a||!y||!!o||0===u)&&!b&&!v&&!0},d=(e,t,r)=>{if(!e)return t;let o=n(e.semver,t.semver,r);return o>0?e:o<0||">"===t.operator&&">="===e.operator?t:e},p=(e,t,r)=>{if(!e)return t;let o=n(e.semver,t.semver,r);return o<0?e:o>0||"<"===t.operator&&"<="===e.operator?t:e};e.exports=(e,t,r={})=>{if(e===t)return!0;e=new o(e,r),t=new o(t,r);let a=!1;e:for(let o of e.set){for(let e of t.set){let t=u(o,e,r);if(a=a||null!==t,t)continue e}if(a)return!1}return!0}},6613(e,t,r){"use strict";let o=r(2069);e.exports=(e,t)=>new o(e,t).set.map(e=>e.map(e=>e.value).join(" ").trim().split(" "))},5372(e,t,r){"use strict";let o=r(2069);e.exports=(e,t)=>{try{return new o(e,t).range||"*"}catch(e){return null}}},600(e,t,r){"use strict";let o=r(9638);e.exports=(e="")=>{let t=e.match(o);if(!t)return null;let[r,a]=t[0].replace(/#! ?/,"").split(" "),i=r.split("/").pop();return"env"===i?a:a?`${i} ${a}`:i}},9638(e){"use strict";e.exports=/^#!(.*)/},1905(e,t,r){let o="win32"===process.platform||"cygwin"===process.env.OSTYPE||"msys"===process.env.OSTYPE,a=r(6928),i=o?";":":",s=r(9344),n=e=>Object.assign(Error(`not found: ${e}`),{code:"ENOENT"}),l=(e,t)=>{let r=t.colon||i,a=e.match(/\//)||o&&e.match(/\\/)?[""]:[...o?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(r)],s=o?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",n=o?s.split(r):[""];return o&&-1!==e.indexOf(".")&&""!==n[0]&&n.unshift(""),{pathEnv:a,pathExt:n,pathExtExe:s}},c=(e,t,r)=>{"function"==typeof t&&(r=t,t={}),t||(t={});let{pathEnv:o,pathExt:i,pathExtExe:c}=l(e,t),u=[],d=r=>new Promise((i,s)=>{if(r===o.length)return t.all&&u.length?i(u):s(n(e));let l=o[r],c=/^".*"$/.test(l)?l.slice(1,-1):l,d=a.join(c,e);i(p(!c&&/^\.[\\\/]/.test(e)?e.slice(0,2)+d:d,r,0))}),p=(e,r,o)=>new Promise((a,n)=>{if(o===i.length)return a(d(r+1));let l=i[o];s(e+l,{pathExt:c},(i,s)=>{if(!i&&s)if(!t.all)return a(e+l);else u.push(e+l);return a(p(e,r,o+1))})});return r?d(0).then(e=>r(null,e),r):d(0)};e.exports=c,c.sync=(e,t)=>{let{pathEnv:r,pathExt:o,pathExtExe:i}=l(e,t=t||{}),c=[];for(let n=0;n<r.length;n++){let l=r[n],u=/^".*"$/.test(l)?l.slice(1,-1):l,d=a.join(u,e),p=!u&&/^\.[\\\/]/.test(e)?e.slice(0,2)+d:d;for(let e=0;e<o.length;e++){let r=p+o[e];try{if(s.sync(r,{pathExt:i}))if(!t.all)return r;else c.push(r)}catch(e){}}}if(t.all&&c.length)return c;if(t.nothrow)return null;throw n(e)}},181(e){"use strict";e.exports=require("buffer")},5317(e){"use strict";e.exports=require("child_process")},6982(e){"use strict";e.exports=require("crypto")},9896(e){"use strict";e.exports=require("fs")},7598(e){"use strict";e.exports=require("node:crypto")},857(e){"use strict";e.exports=require("os")},6928(e){"use strict";e.exports=require("path")},2203(e){"use strict";e.exports=require("stream")},9023(e){"use strict";e.exports=require("util")},4953(t){"use strict";t.exports=e},4891(e,t,r){"use strict";let o;r.d(t,{importJWK:()=>G,importPKCS8:()=>B,SignJWT:()=>U});let a=new TextEncoder,i=new TextDecoder;function s(e){let t=new Uint8Array(e.length);for(let r=0;r<e.length;r++){let o=e.charCodeAt(r);if(o>127)throw TypeError("non-ASCII string encountered in encode()");t[r]=o}return t}function n(e){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(e);let t=atob(e),r=new Uint8Array(t.length);for(let e=0;e<t.length;e++)r[e]=t.charCodeAt(e);return r}function l(e){if(Uint8Array.fromBase64)return Uint8Array.fromBase64("string"==typeof e?e:i.decode(e),{alphabet:"base64url"});let t=e;t instanceof Uint8Array&&(t=i.decode(t)),t=t.replace(/-/g,"+").replace(/_/g,"/");try{return n(t)}catch{throw TypeError("The input to be decoded is not correctly encoded.")}}function c(e){let t=e;return("string"==typeof t&&(t=a.encode(t)),Uint8Array.prototype.toBase64)?t.toBase64({alphabet:"base64url",omitPadding:!0}):(function(e){if(Uint8Array.prototype.toBase64)return e.toBase64();let t=[];for(let r=0;r<e.length;r+=32768)t.push(String.fromCharCode.apply(null,e.subarray(r,r+32768)));return btoa(t.join(""))})(t).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}class u extends Error{static code="ERR_JOSE_GENERIC";code="ERR_JOSE_GENERIC";constructor(e,t){super(e,t),this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}}class d extends u{static code="ERR_JOSE_NOT_SUPPORTED";code="ERR_JOSE_NOT_SUPPORTED"}class p extends u{static code="ERR_JWS_INVALID";code="ERR_JWS_INVALID"}class h extends u{static code="ERR_JWT_INVALID";code="ERR_JWT_INVALID"}class f extends u{[Symbol.asyncIterator];static code="ERR_JWKS_MULTIPLE_MATCHING_KEYS";code="ERR_JWKS_MULTIPLE_MATCHING_KEYS";constructor(e="multiple matching keys found in the JSON Web Key Set",t){super(e,t)}}let m=(e,t="algorithm.name")=>TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`);function y(e,t){if(parseInt(e.hash.name.slice(4),10)!==t)throw m(`SHA-${t}`,"algorithm.hash")}function g(e,t,...r){if((r=r.filter(Boolean)).length>2){let t=r.pop();e+=`one of type ${r.join(", ")}, or ${t}.`}else 2===r.length?e+=`one of type ${r[0]} or ${r[1]}.`:e+=`of type ${r[0]}.`;return null==t?e+=` Received ${t}`:"function"==typeof t&&t.name?e+=` Received function ${t.name}`:"object"==typeof t&&null!=t&&t.constructor?.name&&(e+=` Received an instance of ${t.constructor.name}`),e}let v=(e,t,...r)=>g(`Key for the ${e} algorithm must be `,t,...r);async function b(e,t,r){if(t instanceof Uint8Array){if(!e.startsWith("HS"))throw TypeError(((e,...t)=>g("Key must be ",e,...t))(t,"CryptoKey","KeyObject","JSON Web Key"));return crypto.subtle.importKey("raw",t,{hash:`SHA-${e.slice(-3)}`,name:"HMAC"},!1,[r])}return!function(e,t,r){switch(t){case"HS256":case"HS384":case"HS512":if("HMAC"!==e.algorithm.name)throw m("HMAC");y(e.algorithm,parseInt(t.slice(2),10));break;case"RS256":case"RS384":case"RS512":if("RSASSA-PKCS1-v1_5"!==e.algorithm.name)throw m("RSASSA-PKCS1-v1_5");y(e.algorithm,parseInt(t.slice(2),10));break;case"PS256":case"PS384":case"PS512":if("RSA-PSS"!==e.algorithm.name)throw m("RSA-PSS");y(e.algorithm,parseInt(t.slice(2),10));break;case"Ed25519":case"EdDSA":if("Ed25519"!==e.algorithm.name)throw m("Ed25519");break;case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":let o;if(o=e.algorithm,o.name!==t)throw m(t);break;case"ES256":case"ES384":case"ES512":{if("ECDSA"!==e.algorithm.name)throw m("ECDSA");let r=function(e){switch(e){case"ES256":return"P-256";case"ES384":return"P-384";case"ES512":return"P-521";default:throw Error("unreachable")}}(t);if(e.algorithm.namedCurve!==r)throw m(r,"algorithm.namedCurve");break}default:throw TypeError("CryptoKey does not support this operation")}if(r&&!e.usages.includes(r))throw TypeError(`CryptoKey does not support this operation, its usages must include ${r}.`)}(t,e,r),t}async function _(e,t,r){let o=await b(e,t,"sign");return!function(e,t){if(e.startsWith("RS")||e.startsWith("PS")){let{modulusLength:r}=t.algorithm;if("number"!=typeof r||r<2048)throw TypeError(`${e} requires key modulusLength to be 2048 bits or larger`)}}(e,o),new Uint8Array(await crypto.subtle.sign(function(e,t){let r=`SHA-${e.slice(-3)}`;switch(e){case"HS256":case"HS384":case"HS512":return{hash:r,name:"HMAC"};case"PS256":case"PS384":case"PS512":return{hash:r,name:"RSA-PSS",saltLength:parseInt(e.slice(-3),10)>>3};case"RS256":case"RS384":case"RS512":return{hash:r,name:"RSASSA-PKCS1-v1_5"};case"ES256":case"ES384":case"ES512":return{hash:r,name:"ECDSA",namedCurve:t.namedCurve};case"Ed25519":case"EdDSA":return{name:"Ed25519"};case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":return{name:e};default:throw new d(`alg ${e} is not supported either by JOSE or your javascript runtime`)}}(e,o.algorithm),o,r))}function S(e){if("object"!=typeof e||null===e||"[object Object]"!==Object.prototype.toString.call(e))return!1;if(null===Object.getPrototypeOf(e))return!0;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}let $=e=>S(e)&&"string"==typeof e.kty,w=e=>{if(e?.[Symbol.toStringTag]==="CryptoKey")return!0;try{return e instanceof CryptoKey}catch{return!1}},E=e=>e?.[Symbol.toStringTag]==="KeyObject",R=e=>w(e)||E(e),P=e=>e?.[Symbol.toStringTag],k=(e,t,r)=>{if(void 0!==t.use){let e;switch(r){case"sign":case"verify":e="sig";break;case"encrypt":case"decrypt":e="enc"}if(t.use!==e)throw TypeError(`Invalid key for this operation, its "use" must be "${e}" when present`)}if(void 0!==t.alg&&t.alg!==e)throw TypeError(`Invalid key for this operation, its "alg" must be "${e}" when present`);if(Array.isArray(t.key_ops)){let o;switch(!0){case"sign"===r||"verify"===r:case"dir"===e:case e.includes("CBC-HS"):o=r;break;case e.startsWith("PBES2"):o="deriveBits";break;case/^A\d{3}(?:GCM)?(?:KW)?$/.test(e):o=!e.includes("GCM")&&e.endsWith("KW")?"encrypt"===r?"wrapKey":"unwrapKey":r;break;case"encrypt"===r&&e.startsWith("RSA"):o="wrapKey";break;case"decrypt"===r:o=e.startsWith("RSA")?"unwrapKey":"deriveBits"}if(o&&t.key_ops?.includes?.(o)===!1)throw TypeError(`Invalid key for this operation, its "key_ops" must include "${o}" when present`)}return!0},T='Invalid or unsupported JWK "alg" (Algorithm) Parameter value';async function O(e){if(!e.alg)throw TypeError('"alg" argument is required when "jwk.alg" is not present');let{algorithm:t,keyUsages:r}=function(e){let t,r;switch(e.kty){case"AKP":switch(e.alg){case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":t={name:e.alg},r=e.priv?["sign"]:["verify"];break;default:throw new d(T)}break;case"RSA":switch(e.alg){case"PS256":case"PS384":case"PS512":t={name:"RSA-PSS",hash:`SHA-${e.alg.slice(-3)}`},r=e.d?["sign"]:["verify"];break;case"RS256":case"RS384":case"RS512":t={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${e.alg.slice(-3)}`},r=e.d?["sign"]:["verify"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":t={name:"RSA-OAEP",hash:`SHA-${parseInt(e.alg.slice(-3),10)||1}`},r=e.d?["decrypt","unwrapKey"]:["encrypt","wrapKey"];break;default:throw new d(T)}break;case"EC":switch(e.alg){case"ES256":case"ES384":case"ES512":t={name:"ECDSA",namedCurve:({ES256:"P-256",ES384:"P-384",ES512:"P-521"})[e.alg]},r=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":t={name:"ECDH",namedCurve:e.crv},r=e.d?["deriveBits"]:[];break;default:throw new d(T)}break;case"OKP":switch(e.alg){case"Ed25519":case"EdDSA":t={name:"Ed25519"},r=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":t={name:e.crv},r=e.d?["deriveBits"]:[];break;default:throw new d(T)}break;default:throw new d('Invalid or unsupported JWK "kty" (Key Type) Parameter value')}return{algorithm:t,keyUsages:r}}(e),o={...e};return"AKP"!==o.kty&&delete o.alg,delete o.use,crypto.subtle.importKey("jwk",o,t,e.ext??(!e.d&&!e.priv),e.key_ops??r)}let x="given KeyObject instance cannot be used for this algorithm",j=async(e,t,r,a=!1)=>{let i=(o||=new WeakMap).get(e);if(i?.[r])return i[r];let s=await O({...t,alg:r});return a&&Object.freeze(e),i?i[r]=s:o.set(e,{[r]:s}),s};async function C(e,t){if(e instanceof Uint8Array||w(e))return e;if(E(e)){if("secret"===e.type)return e.export();if("toCryptoKey"in e&&"function"==typeof e.toCryptoKey)try{return((e,t)=>{let r,a=(o||=new WeakMap).get(e);if(a?.[t])return a[t];let i="public"===e.type,s=!!i;if("x25519"===e.asymmetricKeyType){switch(t){case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":break;default:throw TypeError(x)}r=e.toCryptoKey(e.asymmetricKeyType,s,i?[]:["deriveBits"])}if("ed25519"===e.asymmetricKeyType){if("EdDSA"!==t&&"Ed25519"!==t)throw TypeError(x);r=e.toCryptoKey(e.asymmetricKeyType,s,[i?"verify":"sign"])}switch(e.asymmetricKeyType){case"ml-dsa-44":case"ml-dsa-65":case"ml-dsa-87":if(t!==e.asymmetricKeyType.toUpperCase())throw TypeError(x);r=e.toCryptoKey(e.asymmetricKeyType,s,[i?"verify":"sign"])}if("rsa"===e.asymmetricKeyType){let o;switch(t){case"RSA-OAEP":o="SHA-1";break;case"RS256":case"PS256":case"RSA-OAEP-256":o="SHA-256";break;case"RS384":case"PS384":case"RSA-OAEP-384":o="SHA-384";break;case"RS512":case"PS512":case"RSA-OAEP-512":o="SHA-512";break;default:throw TypeError(x)}if(t.startsWith("RSA-OAEP"))return e.toCryptoKey({name:"RSA-OAEP",hash:o},s,i?["encrypt"]:["decrypt"]);r=e.toCryptoKey({name:t.startsWith("PS")?"RSA-PSS":"RSASSA-PKCS1-v1_5",hash:o},s,[i?"verify":"sign"])}if("ec"===e.asymmetricKeyType){let o=new Map([["prime256v1","P-256"],["secp384r1","P-384"],["secp521r1","P-521"]]).get(e.asymmetricKeyDetails?.namedCurve);if(!o)throw TypeError(x);let a={ES256:"P-256",ES384:"P-384",ES512:"P-521"};a[t]&&o===a[t]&&(r=e.toCryptoKey({name:"ECDSA",namedCurve:o},s,[i?"verify":"sign"])),t.startsWith("ECDH-ES")&&(r=e.toCryptoKey({name:"ECDH",namedCurve:o},s,i?[]:["deriveBits"]))}if(!r)throw TypeError(x);return a?a[t]=r:o.set(e,{[t]:r}),r})(e,t)}catch(e){if(e instanceof TypeError)throw e}let r=e.export({format:"jwk"});return j(e,r,t)}if($(e))return e.k?l(e.k):j(e,e,t,!0);throw Error("unreachable")}function N(e,t){if(e)throw TypeError(`${t} can only be called once`)}Symbol();class I{#e;#t;#r;constructor(e){if(!(e instanceof Uint8Array))throw TypeError("payload must be an instance of Uint8Array");this.#e=e}setProtectedHeader(e){return N(this.#t,"setProtectedHeader"),this.#t=e,this}setUnprotectedHeader(e){return N(this.#r,"setUnprotectedHeader"),this.#r=e,this}async sign(e,t){let r,o,a,i;if(!this.#t&&!this.#r)throw new p("either setProtectedHeader or setUnprotectedHeader must be called before #sign()");if(!function(...e){let t,r=e.filter(Boolean);if(0===r.length||1===r.length)return!0;for(let e of r){let r=Object.keys(e);if(!t||0===t.size){t=new Set(r);continue}for(let e of r){if(t.has(e))return!1;t.add(e)}}return!0}(this.#t,this.#r))throw new p("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");let n={...this.#t,...this.#r},l=function(e,t,r,o,a){let i;if(void 0!==a.crit&&o?.crit===void 0)throw new e('"crit" (Critical) Header Parameter MUST be integrity protected');if(!o||void 0===o.crit)return new Set;if(!Array.isArray(o.crit)||0===o.crit.length||o.crit.some(e=>"string"!=typeof e||0===e.length))throw new e('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');for(let s of(i=void 0!==r?new Map([...Object.entries(r),...t.entries()]):t,o.crit)){if(!i.has(s))throw new d(`Extension Header Parameter "${s}" is not recognized`);if(void 0===a[s])throw new e(`Extension Header Parameter "${s}" is missing`);if(i.get(s)&&void 0===o[s])throw new e(`Extension Header Parameter "${s}" MUST be integrity protected`)}return new Set(o.crit)}(p,new Map([["b64",!0]]),t?.crit,this.#t,n),u=!0;if(l.has("b64")&&"boolean"!=typeof(u=this.#t.b64))throw new p('The "b64" (base64url-encode payload) Header Parameter must be a boolean');let{alg:h}=n;if("string"!=typeof h||!h)throw new p('JWS "alg" (Algorithm) Header Parameter missing or invalid');var f="sign";switch(h.substring(0,2)){case"A1":case"A2":case"di":case"HS":case"PB":((e,t,r)=>{if(!(t instanceof Uint8Array)){if($(t)){if("oct"===t.kty&&"string"==typeof t.k&&k(e,t,r))return;throw TypeError('JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present')}if(!R(t))throw TypeError(v(e,t,"CryptoKey","KeyObject","JSON Web Key","Uint8Array"));if("secret"!==t.type)throw TypeError(`${P(t)} instances for symmetric algorithms must be of type "secret"`)}})(h,e,f);break;default:((e,t,r)=>{if($(t))switch(r){case"decrypt":case"sign":if("oct"!==t.kty&&("AKP"===t.kty&&"string"==typeof t.priv||"string"==typeof t.d)&&k(e,t,r))return;throw TypeError("JSON Web Key for this operation must be a private JWK");case"encrypt":case"verify":if("oct"!==t.kty&&void 0===t.d&&void 0===t.priv&&k(e,t,r))return;throw TypeError("JSON Web Key for this operation must be a public JWK")}if(!R(t))throw TypeError(v(e,t,"CryptoKey","KeyObject","JSON Web Key"));if("secret"===t.type)throw TypeError(`${P(t)} instances for asymmetric algorithms must not be of type "secret"`);if("public"===t.type)switch(r){case"sign":throw TypeError(`${P(t)} instances for asymmetric algorithm signing must be of type "private"`);case"decrypt":throw TypeError(`${P(t)} instances for asymmetric algorithm decryption must be of type "private"`)}if("private"===t.type)switch(r){case"verify":throw TypeError(`${P(t)} instances for asymmetric algorithm verifying must be of type "public"`);case"encrypt":throw TypeError(`${P(t)} instances for asymmetric algorithm encryption must be of type "public"`)}})(h,e,f)}u?o=s(r=c(this.#e)):(o=this.#e,r=""),this.#t?i=s(a=c(JSON.stringify(this.#t))):(a="",i=new Uint8Array);let m=function(...e){let t=new Uint8Array(e.reduce((e,{length:t})=>e+t,0)),r=0;for(let o of e)t.set(o,r),r+=o.length;return t}(i,s("."),o),y=await C(e,h),g={signature:c(await _(h,y,m)),payload:r};return this.#r&&(g.header=this.#r),this.#t&&(g.protected=a),g}}class A{#o;constructor(e){this.#o=new I(e)}setProtectedHeader(e){return this.#o.setProtectedHeader(e),this}async sign(e,t){let r=await this.#o.sign(e,t);if(void 0===r.payload)throw TypeError("use the flattened module for creating JWS with b64: false");return`${r.protected}.${r.payload}.${r.signature}`}}let M=e=>Math.floor(e.getTime()/1e3),q=/^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i;function z(e){let t,r=q.exec(e);if(!r||r[4]&&r[1])throw TypeError("Invalid time period format");let o=parseFloat(r[2]);switch(r[3].toLowerCase()){case"sec":case"secs":case"second":case"seconds":case"s":t=Math.round(o);break;case"minute":case"minutes":case"min":case"mins":case"m":t=Math.round(60*o);break;case"hour":case"hours":case"hr":case"hrs":case"h":t=Math.round(3600*o);break;case"day":case"days":case"d":t=Math.round(86400*o);break;case"week":case"weeks":case"w":t=Math.round(604800*o);break;default:t=Math.round(0x1e187e0*o)}return"-"===r[1]||"ago"===r[4]?-t:t}function L(e,t){if(!Number.isFinite(t))throw TypeError(`Invalid ${e} input`);return t}class D{#e;constructor(e){if(!S(e))throw TypeError("JWT Claims Set MUST be an object");this.#e=structuredClone(e)}data(){return a.encode(JSON.stringify(this.#e))}get iss(){return this.#e.iss}set iss(e){this.#e.iss=e}get sub(){return this.#e.sub}set sub(e){this.#e.sub=e}get aud(){return this.#e.aud}set aud(e){this.#e.aud=e}set jti(e){this.#e.jti=e}set nbf(e){"number"==typeof e?this.#e.nbf=L("setNotBefore",e):e instanceof Date?this.#e.nbf=L("setNotBefore",M(e)):this.#e.nbf=M(new Date)+z(e)}set exp(e){"number"==typeof e?this.#e.exp=L("setExpirationTime",e):e instanceof Date?this.#e.exp=L("setExpirationTime",M(e)):this.#e.exp=M(new Date)+z(e)}set iat(e){void 0===e?this.#e.iat=M(new Date):e instanceof Date?this.#e.iat=L("setIssuedAt",M(e)):"string"==typeof e?this.#e.iat=L("setIssuedAt",M(new Date)+z(e)):this.#e.iat=L("setIssuedAt",e)}}class U{#t;#a;constructor(e={}){this.#a=new D(e)}setIssuer(e){return this.#a.iss=e,this}setSubject(e){return this.#a.sub=e,this}setAudience(e){return this.#a.aud=e,this}setJti(e){return this.#a.jti=e,this}setNotBefore(e){return this.#a.nbf=e,this}setExpirationTime(e){return this.#a.exp=e,this}setIssuedAt(e){return this.#a.iat=e,this}setProtectedHeader(e){return this.#t=e,this}async sign(e,t){let r=new A(this.#a.data());if(r.setProtectedHeader(this.#t),Array.isArray(this.#t?.crit)&&this.#t.crit.includes("b64")&&!1===this.#t.b64)throw new h("JWTs MUST NOT use unencoded payload");return r.sign(e,t)}}let V=(e,t)=>{if(e.byteLength!==t.length)return!1;for(let r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0},F=e=>{let t=e.data[e.pos++];if(128&t){let r=127&t,o=0;for(let t=0;t<r;t++)o=o<<8|e.data[e.pos++];return o}return t},H=(e,t,r)=>{if(e.data[e.pos++]!==t)throw Error(r)},K=(e,t)=>{let r=e.data.subarray(e.pos,e.pos+t);return e.pos+=t,r},J=async(e,t,r,o)=>{let a,i,s="spki"===e,n=()=>s?["verify"]:["sign"];switch(r){case"PS256":case"PS384":case"PS512":a={name:"RSA-PSS",hash:`SHA-${r.slice(-3)}`},i=n();break;case"RS256":case"RS384":case"RS512":a={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${r.slice(-3)}`},i=n();break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":a={name:"RSA-OAEP",hash:`SHA-${parseInt(r.slice(-3),10)||1}`},i=s?["encrypt","wrapKey"]:["decrypt","unwrapKey"];break;case"ES256":case"ES384":case"ES512":a={name:"ECDSA",namedCurve:({ES256:"P-256",ES384:"P-384",ES512:"P-521"})[r]},i=n();break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":try{let e=o.getNamedCurve(t);a="X25519"===e?{name:"X25519"}:{name:"ECDH",namedCurve:e}}catch(e){throw new d("Invalid or unsupported key format")}i=s?[]:["deriveBits"];break;case"Ed25519":case"EdDSA":a={name:"Ed25519"},i=n();break;case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":a={name:r},i=n();break;default:throw new d('Invalid or unsupported "alg" (Algorithm) value')}return crypto.subtle.importKey(e,t,a,o?.extractable??!!s,i)};async function B(e,t,r){let o,a,i;if("string"!=typeof e||0!==e.indexOf("-----BEGIN PRIVATE KEY-----"))throw TypeError('"pkcs8" must be PKCS#8 formatted string');return o=/(?:-----(?:BEGIN|END) PRIVATE KEY-----|\s)/g,a=n(e.replace(o,"")),i=r,t?.startsWith?.("ECDH-ES")&&((i||={}).getNamedCurve=e=>{let t,r={data:e,pos:0};return H(r,48,"Invalid PKCS#8 structure"),F(r),H(r,2,"Expected version field"),t=F(r),r.pos+=t,H(r,48,"Expected algorithm identifier"),F(r),r.pos,(e=>{let t,r=(H(e,6,"Expected algorithm OID"),t=F(e),K(e,t));if(V(r,[43,101,110]))return"X25519";if(!V(r,[42,134,72,206,61,2,1]))throw Error("Unsupported key algorithm");H(e,6,"Expected curve OID");let o=F(e),a=K(e,o);for(let{name:e,oid:t}of[{name:"P-256",oid:[42,134,72,206,61,3,1,7]},{name:"P-384",oid:[43,129,4,0,34]},{name:"P-521",oid:[43,129,4,0,35]}])if(V(a,t))return e;throw Error("Unsupported named curve")})(r)}),J("pkcs8",a,t,i)}async function G(e,t,r){let o;if(!S(e))throw TypeError("JWK must be an object");switch(t??=e.alg,o??=r?.extractable??e.ext,e.kty){case"oct":if("string"!=typeof e.k||!e.k)throw TypeError('missing "k" (Key Value) Parameter value');return l(e.k);case"RSA":if("oth"in e&&void 0!==e.oth)throw new d('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');return O({...e,alg:t,ext:o});case"AKP":if("string"!=typeof e.alg||!e.alg)throw TypeError('missing "alg" (Algorithm) Parameter value');if(void 0!==t&&t!==e.alg)throw TypeError("JWK alg and alg option value mismatch");return O({...e,ext:o});case"EC":case"OKP":return O({...e,alg:t,ext:o});default:throw new d('Unsupported "kty" (Key Type) Parameter value')}}},4519(e){"use strict";e.exports=JSON.parse('{"name":"dotenv","version":"16.6.1","description":"Loads environment variables from .env file","main":"lib/main.js","types":"lib/main.d.ts","exports":{".":{"types":"./lib/main.d.ts","require":"./lib/main.js","default":"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},"scripts":{"dts-check":"tsc --project tests/types/tsconfig.json","lint":"standard","pretest":"npm run lint && npm run dts-check","test":"tap run --allow-empty-coverage --disable-coverage --timeout=60000","test:coverage":"tap run --show-full-coverage --timeout=60000 --coverage-report=text --coverage-report=lcov","prerelease":"npm test","release":"standard-version"},"repository":{"type":"git","url":"git://github.com/motdotla/dotenv.git"},"homepage":"https://github.com/motdotla/dotenv#readme","funding":"https://dotenvx.com","keywords":["dotenv","env",".env","environment","variables","config","settings"],"readmeFilename":"README.md","license":"BSD-2-Clause","devDependencies":{"@types/node":"^18.11.3","decache":"^4.6.2","sinon":"^14.0.1","standard":"^17.0.0","standard-version":"^9.5.0","tap":"^19.2.0","typescript":"^4.8.4"},"engines":{"node":">=12"},"browser":{"fs":false}}')},8330(e){"use strict";e.exports=JSON.parse('{"name":"xmcp","description":"The MCP framework","version":"1.1.3","author":{"name":"xmcp","email":"support@xmcp.dev","url":"https://xmcp.dev"},"contributors":[{"name":"Valentina Bearzotti","email":"valebearzotti1@gmail.com","url":"https://github.com/valebearzotti"},{"name":"Jose Rago","email":"jose@basement.studio","url":"https://github.com/ragojose"}],"license":"MIT","keywords":["mcp","modelcontextprotocol","http","stdio"],"repository":{"type":"git","url":"https://github.com/basementstudio/xmcp"},"homepage":"https://xmcp.dev","type":"commonjs","main":"./dist/index.js","types":"./dist/index.d.ts","bin":{"xmcp":"dist/cli.js"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.js","default":"./dist/index.js"},"./host-bridge":{"types":"./dist/host-bridge.d.ts","import":"./dist/host-bridge.js","require":"./dist/host-bridge.js","default":"./dist/host-bridge.js"},"./headers":{"types":"./dist/runtime/headers.d.ts","require":"./dist/runtime/headers.js","default":"./dist/runtime/headers.js"},"./cloudflare":{"types":"./dist/cloudflare.d.ts","import":"./dist/cloudflare.js","require":"./dist/cloudflare.js","default":"./dist/cloudflare.js"},"./config":{"types":"./dist/config/index.d.ts","import":"./dist/config.js","require":"./dist/config.js","default":"./dist/config.js"},"./package.json":"./package.json"},"typesVersions":{"*":{"host-bridge":["dist/host-bridge.d.ts"],"headers":["dist/runtime/headers.d.ts"],"cloudflare":["dist/cloudflare.d.ts"],"config":["dist/config/index.d.ts"]}},"files":["dist"],"scripts":{"dev":"cross-env NODE_ENV=development tsx --watch --tsconfig ./bundler.tsconfig.json ./bundler/index.ts","build":"cross-env NODE_ENV=production tsx --tsconfig ./bundler.tsconfig.json ./bundler/index.ts","analyze":"cross-env GENERATE_STATS=true pnpm build && pnpm tsx scripts/analyze-rspack-stats.ts","bench":"tsx bench/run.mts","test:config":"pnpm --dir ../compiler test:config","test:adapters":"node --import tsx --test src/runtime/adapters/fastify/__tests__/*.test.ts","test:runtime":"node --import tsx --test src/runtime/utils/__tests__/*.test.ts src/runtime/utils/ui/__tests__/*.test.ts"},"dependencies":{},"devDependencies":{"@modelcontextprotocol/client":"^2.0.0","@modelcontextprotocol/node":"^2.0.0","@modelcontextprotocol/server":"^2.0.0","@nestjs/common":"^11.1.12","@rspack/core":"^1.6.7","@types/async-retry":"^1.4.9","@types/content-type":"^1.1.9","@types/express":"^5.0.6","@types/fs-extra":"^11.0.4","@types/jsonwebtoken":"^9.0.10","@types/node":"^22.19.2","@types/react":"^19.2.7","@types/react-dom":"^19.2.3","async-retry":"^1.3.3","chalk":"^5.6.2","chokidar":"^3.6.0","ci-info":"^4.3.1","commander":"^11.1.0","content-type":"^1.0.5","cross-env":"^7.0.3","del":"^7.1.0","dotenv":"^16.6.1","express":"^4.22.1","fastify":"^5.0.0","fs-extra":"^11.3.2","glob":"^11.1.0","is-docker":"^4.0.0","is-wsl":"^3.1.0","jose":"^6.1.3","json5":"^2.2.3","jsonwebtoken":"^9.0.3","memfs":"^4.51.1","postcss-loader":"^8.2.0","raw-body":"^3.0.2","reflect-metadata":"^0.2.2","rxjs":"^7.8.2","ts-checker-rspack-plugin":"^1.2.1","tsx":"^4.21.0","typescript":"^5.9.3","zod-to-json-schema":"^3.25.0"},"peerDependencies":{"@modelcontextprotocol/client":"^2.0.0","@modelcontextprotocol/server":"^2.0.0","jose":"^6.1.3","react":">=19.0.0","react-dom":">=19.0.0","zod":"^3.25.76 || ^4.0.0"},"peerDependenciesMeta":{"@modelcontextprotocol/client":{"optional":true},"@modelcontextprotocol/server":{"optional":true},"jose":{"optional":true},"react":{"optional":true},"react-dom":{"optional":true}}}')}},a={};function i(e){var t=a[e];if(void 0!==t)return t.exports;var r=a[e]={exports:{}};return o[e](r,r.exports,i),r.exports}i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,i.t=function(e,o){if(1&o&&(e=this(e)),8&o||"object"==typeof e&&e&&(4&o&&e.__esModule||16&o&&"function"==typeof e.then))return e;var a=Object.create(null);i.r(a);var s={};t=t||[null,r({}),r([]),r(r)];for(var n=2&o&&e;("object"==typeof n||"function"==typeof n)&&!~t.indexOf(n);n=r(n))Object.getOwnPropertyNames(n).forEach(t=>{s[t]=()=>e[t]});return s.default=()=>e,i.d(a,s),a},i.d=(e,t)=>{for(var r in t)i.o(t,r)&&!i.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var s={};return(()=>{"use strict";let e,t,r,o,a,n,l,c,u;i.r(s),i.d(s,{HOST_CONTEXT_CHANGED_METHOD:()=>fH,isEnvHeader:()=>fE,createSTDIOClient:()=>fx,INITIALIZE_METHOD:()=>fM,LOG_MESSAGE_METHOD:()=>fV,OPEN_LINK_METHOD:()=>fL,REQUEST_DISPLAY_MODE_METHOD:()=>fz,inputResponse:()=>n1,disconnectSTDIOClient:()=>fN,isInputRequiredResult:()=>nU,callSTDIOClientTool:()=>fC,headersToRecord:()=>fR,MCP_APPS_PROTOCOL_VERSION:()=>fA,extractToolNamesFromRequest:()=>fI,UI_MESSAGE_METHOD:()=>fU,completable:()=>cL,acceptedContent:()=>n0,listSTDIOClientTools:()=>fj,UPDATE_MODEL_CONTEXT_METHOD:()=>fD,UrlElicitationRequiredError:()=>nA,createRequestStateCodec:()=>cV,createMcpHostBridge:()=>fG,SIZE_CHANGED_METHOD:()=>fK,INITIALIZED_METHOD:()=>fq,inputRequired:()=>nQ,RESOURCES_READ_METHOD:()=>fF,createContext:()=>N,jwtAuthMiddleware:()=>O,createHTTPClient:()=>fO,apiKeyAuthMiddleware:()=>P});var d,p,h,f,m,y,g,v,b,_,S=i(8583),$=i.n(S),w=i(4953);let E=w.z.object({apiKey:w.z.string().optional(),headerName:w.z.string().optional(),validateApiKey:w.z.function().args(w.z.string()).returns(w.z.promise(w.z.boolean())).optional()}).strict().refine(e=>void 0!==e.apiKey||void 0!==e.validateApiKey,{message:"Either 'apiKey' or 'validateApiKey' must be provided"}).refine(e=>void 0===e.apiKey||void 0===e.validateApiKey,{message:"'apiKey' and 'validateApiKey' are mutually exclusive - provide only one"}),R="Unauthorized: Missing or invalid API key";function P(e){let t=E.safeParse(e);if(!t.success){let r="apiKey"in e,o="validateApiKey"in e;if(r&&o)throw Error("'apiKey' and 'validateApiKey' are mutually exclusive - provide only one");if(r||o)throw Error(`Invalid configuration: ${t.error.message}`);throw Error("Either 'apiKey' or 'validateApiKey' must be provided")}let r=e.headerName??"x-api-key",o="apiKey"in e?e.apiKey:void 0,a="validateApiKey"in e?e.validateApiKey:void 0;return async(t,i,s)=>{let n=t.header(r);!n||"apiKey"in e&&n!==o||a&&!await a(n)?i.status(401).json({error:R}):s()}}var k=i(8400),T=i.n(k);function O(e){return(t,r,o)=>{let a=t.header("Authorization");if(!a||!a.startsWith("Bearer "))return void r.status(401).json({error:"Unauthorized: Missing or malformed Authorization header"});let i=a.slice(7).trim();if(!i)return void r.status(401).json({error:"Unauthorized: Missing access token"});try{let{secret:r,...a}=e;t.user=T().verify(i,r,a),o()}catch(e){r.status(401).json({error:"Unauthorized: Invalid or expired token"})}}}let x=require("async_hooks"),j=(e,t)=>{globalThis[e]=t},C=e=>globalThis[e];function N({name:e}){let t=Symbol.for(`xmcp-context-${e}`),r=Symbol.for(`xmcp-context-${e}-fallback-store`);if(C(t))return C(t);let o=new x.AsyncLocalStorage,a=globalThis[r]??{current:null};j(r,a);let i={provider:(e,t)=>(a.current=e,o.run(e,t)),getContext:()=>{let t=o.getStore();if(t)return t;if(a.current)return a.current;throw Error(`getContext() can only be used within the ${e} context.`)},setContext:t=>{let r=o.getStore()??a.current;if(!r)throw Error(`setContext() can only be used within the ${e} context.`);Object.assign(r,t)}};return j(t,i),i}var I=Object.create,A=Object.defineProperty,M=Object.getOwnPropertyDescriptor,q=Object.getOwnPropertyNames,z=Object.getPrototypeOf,L=Object.prototype.hasOwnProperty,D=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);let U=new Set(["https://json-schema.org/draft/2020-12/schema","http://json-schema.org/draft/2020-12/schema"]),V=new Set(["https://json-schema.org/draft/2019-09/schema","http://json-schema.org/draft/2019-09/schema"]),F=new Set(["https://json-schema.org/draft-07/schema","http://json-schema.org/draft-07/schema"]),H=new Set(["https://json-schema.org/draft-06/schema","http://json-schema.org/draft-06/schema"]),K=Object.freeze({status:"aborted"});function J(e,t,r){function o(r,o){if(r._zod||Object.defineProperty(r,"_zod",{value:{def:o,constr:s,traits:new Set},enumerable:!1}),r._zod.traits.has(e))return;r._zod.traits.add(e),t(r,o);let a=s.prototype,i=Object.keys(a);for(let e=0;e<i.length;e++){let t=i[e];t in r||(r[t]=a[t].bind(r))}}let a=r?.Parent??Object;class i extends a{}function s(e){var t;let a=r?.Parent?new i:this;for(let r of(o(a,e),(t=a._zod).deferred??(t.deferred=[]),a._zod.deferred))r();return a}return Object.defineProperty(i,"name",{value:e}),Object.defineProperty(s,"init",{value:o}),Object.defineProperty(s,Symbol.hasInstance,{value:t=>!!r?.Parent&&t instanceof r.Parent||t?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}Symbol("zod_brand");class B extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class G extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}(v=globalThis).__zod_globalConfig??(v.__zod_globalConfig={});let Z=globalThis.__zod_globalConfig;function W(e){return e&&Object.assign(Z,e),Z}let X=/^[cC][0-9a-z]{6,}$/,Y=/^[0-9a-z]+$/,Q=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,ee=/^[0-9a-vA-V]{20}$/,et=/^[A-Za-z0-9]{27}$/,er=/^[a-zA-Z0-9_-]{21}$/,eo=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,ea=/^([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})$/,ei=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,es=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,en=/^(?:(?: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])$/,el=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,ec=/^((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])$/,eu=/^(([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])$/,ed=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,ep=/^[A-Za-z0-9_-]*$/,eh=/^https?$/,ef=/^\+[1-9]\d{6,14}$/,em="(?:(?:\\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])))",ey=RegExp(`^${em}$`);function eg(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}let ev=/^-?\d+$/,eb=/^-?\d+(?:\.\d+)?$/,e_=/^(?:true|false)$/i,eS=/^null$/i,e$=/^[^A-Z]*$/,ew=/^[^a-z]*$/;function eE(e){let t=Object.values(e).filter(e=>"number"==typeof e);return Object.entries(e).filter(([e,r])=>-1===t.indexOf(+e)).map(([e,t])=>t)}function eR(e,t){return"bigint"==typeof t?t.toString():t}function eP(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function ek(e){let t=+!!e.startsWith("^"),r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}let eT=Symbol("evaluating");function eO(e,t,r){let o;Object.defineProperty(e,t,{get(){if(o!==eT)return void 0===o&&(o=eT,o=r()),o},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function ex(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function ej(...e){let t={};for(let r of e)Object.assign(t,Object.getOwnPropertyDescriptors(r));return Object.defineProperties({},t)}function eC(e){return JSON.stringify(e)}let eN="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function eI(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}let eA=eP(()=>{if(Z.jitless||"undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return Function(""),!0}catch(e){return!1}});function eM(e){if(!1===eI(e))return!1;let t=e.constructor;if(void 0===t||"function"!=typeof t)return!0;let r=t.prototype;return!1!==eI(r)&&!1!==Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")}function eq(e){return eM(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}let ez=new Set(["string","number","symbol"]);function eL(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function eD(e,t,r){let o=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(o._zod.parent=e),o}function eU(e){if(!e)return{};if("string"==typeof e)return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");e.error=e.message}return(delete e.message,"string"==typeof e.error)?{...e,error:()=>e.error}:e}let eV={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-0x80000000,0x7fffffff],uint32:[0,0xffffffff],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function eF(e,t=0){if(!0===e.aborted)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function eH(e,t){return t.map(t=>(t.path??(t.path=[]),t.path.unshift(e),t))}function eK(e){return"string"==typeof e?e:e?.message}function eJ(e,t,r){let o=e.message?e.message:eK(e.inst?._zod.def?.error?.(e))??eK(t?.error?.(e))??eK(r.customError?.(e))??eK(r.localeError?.(e))??"Invalid input",{inst:a,continue:i,input:s,...n}=e;return n.path??(n.path=[]),n.message=o,t?.reportInput&&(n.input=s),n}function eB(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function eG(...e){let[t,r,o]=e;return"string"==typeof t?{message:t,code:"custom",input:r,inst:o}:{...t}}let eZ=J("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),eW={number:"number",bigint:"bigint",object:"date"},eX=J("$ZodCheckLessThan",(e,t)=>{eZ.init(e,t);let r=eW[typeof t.value];e._zod.onattach.push(e=>{let r=e._zod.bag,o=(t.inclusive?r.maximum:r.exclusiveMaximum)??1/0;t.value<o&&(t.inclusive?r.maximum=t.value:r.exclusiveMaximum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value<=t.value:o.value<t.value)||o.issues.push({origin:r,code:"too_big",maximum:"object"==typeof t.value?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),eY=J("$ZodCheckGreaterThan",(e,t)=>{eZ.init(e,t);let r=eW[typeof t.value];e._zod.onattach.push(e=>{let r=e._zod.bag,o=(t.inclusive?r.minimum:r.exclusiveMinimum)??-1/0;t.value>o&&(t.inclusive?r.minimum=t.value:r.exclusiveMinimum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value>=t.value:o.value>t.value)||o.issues.push({origin:r,code:"too_small",minimum:"object"==typeof t.value?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),eQ=J("$ZodCheckMultipleOf",(e,t)=>{eZ.init(e,t),e._zod.onattach.push(e=>{var r;(r=e._zod.bag).multipleOf??(r.multipleOf=t.value)}),e._zod.check=r=>{let o,a,i;if(typeof r.value!=typeof t.value)throw Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof r.value?r.value%t.value===BigInt(0):0==(a=Math.round(o=r.value/t.value),i=Number.EPSILON*Math.max(Math.abs(o),1),Math.abs(o-a)<i?0:o-a))||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),e0=J("$ZodCheckNumberFormat",(e,t)=>{eZ.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),o=r?"int":"number",[a,i]=eV[t.format];e._zod.onattach.push(e=>{let o=e._zod.bag;o.format=t.format,o.minimum=a,o.maximum=i,r&&(o.pattern=ev)}),e._zod.check=s=>{let n=s.value;if(r){if(!Number.isInteger(n))return void s.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:n,inst:e});if(!Number.isSafeInteger(n))return void(n>0?s.issues.push({input:n,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort}):s.issues.push({input:n,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort}))}n<a&&s.issues.push({origin:"number",input:n,code:"too_small",minimum:a,inclusive:!0,inst:e,continue:!t.abort}),n>i&&s.issues.push({origin:"number",input:n,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),e1=J("$ZodCheckMaxLength",(e,t)=>{var r;eZ.init(e,t),(r=e._zod.def).when??(r.when=e=>{let t=e.value;return null!=t&&void 0!==t.length}),e._zod.onattach.push(e=>{let r=e._zod.bag.maximum??1/0;t.maximum<r&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{let o=r.value;if(o.length<=t.maximum)return;let a=eB(o);r.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),e2=J("$ZodCheckMinLength",(e,t)=>{var r;eZ.init(e,t),(r=e._zod.def).when??(r.when=e=>{let t=e.value;return null!=t&&void 0!==t.length}),e._zod.onattach.push(e=>{let r=e._zod.bag.minimum??-1/0;t.minimum>r&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{let o=r.value;if(o.length>=t.minimum)return;let a=eB(o);r.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),e9=J("$ZodCheckLengthEquals",(e,t)=>{var r;eZ.init(e,t),(r=e._zod.def).when??(r.when=e=>{let t=e.value;return null!=t&&void 0!==t.length}),e._zod.onattach.push(e=>{let r=e._zod.bag;r.minimum=t.length,r.maximum=t.length,r.length=t.length}),e._zod.check=r=>{let o=r.value,a=o.length;if(a===t.length)return;let i=eB(o),s=a>t.length;r.issues.push({origin:i,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),e4=J("$ZodCheckStringFormat",(e,t)=>{var r,o;eZ.init(e,t),e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,t.pattern&&(r.patterns??(r.patterns=new Set),r.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=r=>{t.pattern.lastIndex=0,t.pattern.test(r.value)||r.issues.push({origin:"string",code:"invalid_format",format:t.format,input:r.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(o=e._zod).check??(o.check=()=>{})}),e5=J("$ZodCheckRegex",(e,t)=>{e4.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,t.pattern.test(r.value)||r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),e3=J("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=e$),e4.init(e,t)}),e6=J("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=ew),e4.init(e,t)}),e8=J("$ZodCheckIncludes",(e,t)=>{eZ.init(e,t);let r=eL(t.includes),o=new RegExp("number"==typeof t.position?`^.{${t.position}}${r}`:r);t.pattern=o,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(o)}),e._zod.check=r=>{r.value.includes(t.includes,t.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:r.value,inst:e,continue:!t.abort})}}),e7=J("$ZodCheckStartsWith",(e,t)=>{eZ.init(e,t);let r=RegExp(`^${eL(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),te=J("$ZodCheckEndsWith",(e,t)=>{eZ.init(e,t);let r=RegExp(`.*${eL(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),tt=J("$ZodCheckOverwrite",(e,t)=>{eZ.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});class tr{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if("function"==typeof e){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let t=e.split("\n").filter(e=>e),r=Math.min(...t.map(e=>e.length-e.trimStart().length));for(let e of t.map(e=>e.slice(r)).map(e=>" ".repeat(2*this.indent)+e))this.content.push(e)}compile(){return Function(...this?.args,[...(this?.content??[""]).map(e=>` ${e}`)].join("\n"))}}let to=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,eR,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},ta=J("$ZodError",to),ti=J("$ZodError",to,{Parent:Error}),ts=e=>(t,r,o,a)=>{let i=o?{...o,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},i);if(s instanceof Promise)throw new B;if(s.issues.length){let t=new(a?.Err??e)(s.issues.map(e=>eJ(e,i,W())));throw eN(t,a?.callee),t}return s.value},tn=e=>async(t,r,o,a)=>{let i=o?{...o,async:!0}:{async:!0},s=t._zod.run({value:r,issues:[]},i);if(s instanceof Promise&&(s=await s),s.issues.length){let t=new(a?.Err??e)(s.issues.map(e=>eJ(e,i,W())));throw eN(t,a?.callee),t}return s.value},tl=e=>(t,r,o)=>{let a=o?{...o,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},a);if(i instanceof Promise)throw new B;return i.issues.length?{success:!1,error:new(e??ta)(i.issues.map(e=>eJ(e,a,W())))}:{success:!0,data:i.value}},tc=tl(ti),tu=e=>async(t,r,o)=>{let a=o?{...o,async:!0}:{async:!0},i=t._zod.run({value:r,issues:[]},a);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(e=>eJ(e,a,W())))}:{success:!0,data:i.value}},td=tu(ti),tp={major:4,minor:4,patch:3},th=J("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=tp;let o=[...e._zod.def.checks??[]];for(let t of(e._zod.traits.has("$ZodCheck")&&o.unshift(e),o))for(let r of t._zod.onattach)r(e);if(0===o.length)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,r)=>{let o,a=eF(e);for(let i of t){if(i._zod.def.when){if(function(e,t=0){if(!0===e.aborted)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}(e)||!i._zod.def.when(e))continue}else if(a)continue;let t=e.issues.length,s=i._zod.check(e);if(s instanceof Promise&&r?.async===!1)throw new B;if(o||s instanceof Promise)o=(o??Promise.resolve()).then(async()=>{await s,e.issues.length!==t&&(a||(a=eF(e,t)))});else{if(e.issues.length===t)continue;a||(a=eF(e,t))}}return o?o.then(()=>e):e},r=(r,a,i)=>{if(eF(r))return r.aborted=!0,r;let s=t(a,o,i);if(s instanceof Promise){if(!1===i.async)throw new B;return s.then(t=>e._zod.parse(t,i))}return e._zod.parse(s,i)};e._zod.run=(a,i)=>{if(i.skipChecks)return e._zod.parse(a,i);if("backward"===i.direction){let t=e._zod.parse({value:a.value,issues:[]},{...i,skipChecks:!0});return t instanceof Promise?t.then(e=>r(e,a,i)):r(t,a,i)}let s=e._zod.parse(a,i);if(s instanceof Promise){if(!1===i.async)throw new B;return s.then(e=>t(e,o,i))}return t(s,o,i)}}eO(e,"~standard",()=>({validate:t=>{try{let r=tc(e,t);return r.success?{value:r.data}:{issues:r.error?.issues}}catch(r){return td(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1}))}),tf=J("$ZodString",(e,t)=>{var r;let o;th.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??(o=(r=e._zod.bag)?`[\\s\\S]{${r?.minimum??0},${r?.maximum??""}}`:"[\\s\\S]*",RegExp(`^${o}$`)),e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=String(r.value)}catch(e){}return"string"==typeof r.value||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),tm=J("$ZodStringFormat",(e,t)=>{e4.init(e,t),tf.init(e,t)}),ty=J("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=ea),tm.init(e,t)}),tg=J("$ZodUUID",(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=ei(e))}else t.pattern??(t.pattern=ei());tm.init(e,t)}),tv=J("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=es),tm.init(e,t)}),tb=J("$ZodURL",(e,t)=>{tm.init(e,t),e._zod.check=r=>{try{let o=r.value.trim();if(!t.normalize&&t.protocol?.source===eh.source&&!/^https?:\/\//i.test(o))return void r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});let a=new URL(o);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(a.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(a.protocol.endsWith(":")?a.protocol.slice(0,-1):a.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=a.href:r.value=o;return}catch(o){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),t_=J("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),tm.init(e,t)}),tS=J("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=er),tm.init(e,t)}),t$=J("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=X),tm.init(e,t)}),tw=J("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Y),tm.init(e,t)}),tE=J("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Q),tm.init(e,t)}),tR=J("$ZodXID",(e,t)=>{t.pattern??(t.pattern=ee),tm.init(e,t)}),tP=J("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=et),tm.init(e,t)}),tk=J("$ZodISODateTime",(e,t)=>{let r,o,a;t.pattern??(r=eg({precision:t.precision}),o=["Z"],t.local&&o.push(""),t.offset&&o.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)"),a=`${r}(?:${o.join("|")})`,t.pattern=RegExp(`^${em}T(?:${a})$`)),tm.init(e,t)}),tT=J("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=ey),tm.init(e,t)}),tO=J("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=RegExp(`^${eg(t)}$`)),tm.init(e,t)}),tx=J("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=eo),tm.init(e,t)}),tj=J("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=en),tm.init(e,t),e._zod.bag.format="ipv4"}),tC=J("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=el),tm.init(e,t),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),tN=J("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=ec),tm.init(e,t)}),tI=J("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=eu),tm.init(e,t),e._zod.check=r=>{let o=r.value.split("/");try{if(2!==o.length)throw Error();let[e,t]=o;if(!t)throw Error();let r=Number(t);if(`${r}`!==t||r<0||r>128)throw Error();new URL(`http://[${e}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function tA(e){if(""===e)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}let tM=J("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=ed),tm.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{tA(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}}),tq=J("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=ep),tm.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{!function(e){if(!ep.test(e))return!1;let t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return tA(t.padEnd(4*Math.ceil(t.length/4),"="))}(r.value)&&r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),tz=J("$ZodE164",(e,t)=>{t.pattern??(t.pattern=ef),tm.init(e,t)}),tL=J("$ZodJWT",(e,t)=>{tm.init(e,t),e._zod.check=r=>{!function(e,t=null){try{let r=e.split(".");if(3!==r.length)return!1;let[o]=r;if(!o)return!1;let a=JSON.parse(atob(o));if("typ"in a&&a?.typ!=="JWT"||!a.alg||t&&(!("alg"in a)||a.alg!==t))return!1;return!0}catch{return!1}}(r.value,t.alg)&&r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),tD=J("$ZodNumber",(e,t)=>{th.init(e,t),e._zod.pattern=e._zod.bag.pattern??eb,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=Number(r.value)}catch(e){}let a=r.value;if("number"==typeof a&&!Number.isNaN(a)&&Number.isFinite(a))return r;let i="number"==typeof a?Number.isNaN(a)?"NaN":Number.isFinite(a)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:a,inst:e,...i?{received:i}:{}}),r}}),tU=J("$ZodNumberFormat",(e,t)=>{e0.init(e,t),tD.init(e,t)}),tV=J("$ZodBoolean",(e,t)=>{th.init(e,t),e._zod.pattern=e_,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=!!r.value}catch(e){}let a=r.value;return"boolean"==typeof a||r.issues.push({expected:"boolean",code:"invalid_type",input:a,inst:e}),r}}),tF=J("$ZodNull",(e,t)=>{th.init(e,t),e._zod.pattern=eS,e._zod.values=new Set([null]),e._zod.parse=(t,r)=>{let o=t.value;return null===o||t.issues.push({expected:"null",code:"invalid_type",input:o,inst:e}),t}}),tH=J("$ZodAny",(e,t)=>{th.init(e,t),e._zod.parse=e=>e}),tK=J("$ZodUnknown",(e,t)=>{th.init(e,t),e._zod.parse=e=>e}),tJ=J("$ZodNever",(e,t)=>{th.init(e,t),e._zod.parse=(t,r)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)});function tB(e,t,r){e.issues.length&&t.issues.push(...eH(r,e.issues)),t.value[r]=e.value}let tG=J("$ZodArray",(e,t)=>{th.init(e,t),e._zod.parse=(r,o)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({expected:"array",code:"invalid_type",input:a,inst:e}),r;r.value=Array(a.length);let i=[];for(let e=0;e<a.length;e++){let s=a[e],n=t.element._zod.run({value:s,issues:[]},o);n instanceof Promise?i.push(n.then(t=>tB(t,r,e))):tB(n,r,e)}return i.length?Promise.all(i).then(()=>r):r}});function tZ(e,t,r,o,a,i){let s=r in o;if(e.issues.length){if(a&&i&&!s)return;t.issues.push(...eH(r,e.issues))}if(!s&&!a){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}void 0===e.value?s&&(t.value[r]=void 0):t.value[r]=e.value}function tW(e){var t;let r=Object.keys(e.shape);for(let t of r)if(!e.shape?.[t]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${t}": expected a Zod schema`);let o=Object.keys(t=e.shape).filter(e=>"optional"===t[e]._zod.optin&&"optional"===t[e]._zod.optout);return{...e,keys:r,keySet:new Set(r),numKeys:r.length,optionalKeys:new Set(o)}}function tX(e,t,r,o,a,i){let s=[],n=a.keySet,l=a.catchall._zod,c=l.def.type,u="optional"===l.optin,d="optional"===l.optout;for(let a in t){if("__proto__"===a||n.has(a))continue;if("never"===c){s.push(a);continue}let i=l.run({value:t[a],issues:[]},o);i instanceof Promise?e.push(i.then(e=>tZ(e,r,a,t,u,d))):tZ(i,r,a,t,u,d)}return(s.length&&r.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:i}),e.length)?Promise.all(e).then(()=>r):r}let tY=J("$ZodObject",(e,t)=>{let r;th.init(e,t);let o=Object.getOwnPropertyDescriptor(t,"shape");if(!o?.get){let e=t.shape;Object.defineProperty(t,"shape",{get:()=>{let r={...e};return Object.defineProperty(t,"shape",{value:r}),r}})}let a=eP(()=>tW(t));eO(e._zod,"propValues",()=>{let e=t.shape,r={};for(let t in e){let o=e[t]._zod;if(o.values)for(let e of(r[t]??(r[t]=new Set),o.values))r[t].add(e)}return r});let i=t.catchall;e._zod.parse=(t,o)=>{r??(r=a.value);let s=t.value;if(!eI(s))return t.issues.push({expected:"object",code:"invalid_type",input:s,inst:e}),t;t.value={};let n=[],l=r.shape;for(let e of r.keys){let r=l[e],a="optional"===r._zod.optin,i="optional"===r._zod.optout,c=r._zod.run({value:s[e],issues:[]},o);c instanceof Promise?n.push(c.then(r=>tZ(r,t,e,s,a,i))):tZ(c,t,e,s,a,i)}return i?tX(n,s,t,o,a.value,e):n.length?Promise.all(n).then(()=>t):t}}),tQ=J("$ZodObjectJIT",(e,t)=>{let r,o;tY.init(e,t);let a=e._zod.parse,i=eP(()=>tW(t)),s=!Z.jitless,n=s&&eA.value,l=t.catchall;e._zod.parse=(c,u)=>{o??(o=i.value);let d=c.value;return eI(d)?s&&n&&u?.async===!1&&!0!==u.jitless?(r||(r=(e=>{let t=new tr(["shape","payload","ctx"]),r=i.value,o=e=>{let t=eC(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");let a=Object.create(null),s=0;for(let e of r.keys)a[e]=`key_${s++}`;for(let i of(t.write("const newResult = {};"),r.keys)){let r=a[i],s=eC(i),n=e[i],l=n?._zod?.optin==="optional",c=n?._zod?.optout==="optional";t.write(`const ${r} = ${o(i)};`),l&&c?t.write(`
|
|
2
2
|
if (${r}.issues.length) {
|
|
3
3
|
if (${s} in input) {
|
|
4
4
|
payload.issues = payload.issues.concat(${r}.issues.map(iss => ({
|