pangea-helpers 1.0.14 → 1.0.16
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.cjs.js +1 -1
- package/dist/index.es.js +1 -1
- package/dist/{token-44758d63.cjs → token-3d1b3c32.cjs} +2 -2
- package/dist/{token-07a81ae5.js → token-3f22e6d2.js} +98 -97
- package/dist/token.cjs.js +1 -1
- package/dist/token.es.js +1 -1
- package/dist/types/helpers/token.d.ts +3 -2
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./animation-6901ffc4.cjs"),r=require("./coin-fe1122f0.cjs"),t=require("./datetime-9d947e21.cjs"),n=require("./number-48ed1448.cjs"),o=require("./object-d8cc8ea7.cjs"),i=require("./token-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./animation-6901ffc4.cjs"),r=require("./coin-fe1122f0.cjs"),t=require("./datetime-9d947e21.cjs"),n=require("./number-48ed1448.cjs"),o=require("./object-d8cc8ea7.cjs"),i=require("./token-3d1b3c32.cjs"),s=require("./url-4fb04989.cjs");exports.animationHelpers=e.animation;exports.coinHelpers=r.coin;exports.datetimeHelpers=t.datetime;exports.numberHelpers=n.number;exports.objectHelpers=o.object;exports.tokenHelpers=i.token;exports.urlHelpers=s.url;
|
package/dist/index.es.js
CHANGED
|
@@ -3,7 +3,7 @@ import { c as s } from "./coin-251f810c.js";
|
|
|
3
3
|
import { d as a } from "./datetime-dbf7ffd9.js";
|
|
4
4
|
import { n as l } from "./number-355de26b.js";
|
|
5
5
|
import { o as x } from "./object-7a404c78.js";
|
|
6
|
-
import { t as n } from "./token-
|
|
6
|
+
import { t as n } from "./token-3f22e6d2.js";
|
|
7
7
|
import { u as c } from "./url-9802dbc9.js";
|
|
8
8
|
export {
|
|
9
9
|
o as animationHelpers,
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";var Kt=Object.defineProperty;var qt=(e,t,r)=>t in e?Kt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var
|
|
1
|
+
"use strict";var Kt=Object.defineProperty;var qt=(e,t,r)=>t in e?Kt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Ne=(e,t,r)=>(qt(e,typeof t!="symbol"?t+"":t,r),r);function Wt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Jt(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var r=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var s=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,s.get?s:{enumerable:!0,get:function(){return e[n]}})}),r}var F={},Be={exports:{}};const Yt={},zt=Object.freeze(Object.defineProperty({__proto__:null,default:Yt},Symbol.toStringTag,{value:"Module"})),j=Jt(zt);/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */(function(e,t){var r=j,n=r.Buffer;function s(c,l){for(var a in c)l[a]=c[a]}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=r:(s(r,t),t.Buffer=i);function i(c,l,a){return n(c,l,a)}i.prototype=Object.create(n.prototype),s(n,i),i.from=function(c,l,a){if(typeof c=="number")throw new TypeError("Argument must not be a number");return n(c,l,a)},i.alloc=function(c,l,a){if(typeof c!="number")throw new TypeError("Argument must be a number");var o=n(c);return l!==void 0?typeof a=="string"?o.fill(l,a):o.fill(l):o.fill(0),o},i.allocUnsafe=function(c){if(typeof c!="number")throw new TypeError("Argument must be a number");return n(c)},i.allocUnsafeSlow=function(c){if(typeof c!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(c)}})(Be,Be.exports);var re=Be.exports,ue=re.Buffer,Zt=j,Qt=j;function ye(e){if(this.buffer=null,this.writable=!0,this.readable=!0,!e)return this.buffer=ue.alloc(0),this;if(typeof e.pipe=="function")return this.buffer=ue.alloc(0),e.pipe(this),this;if(e.length||typeof e=="object")return this.buffer=e,this.writable=!1,process.nextTick((function(){this.emit("end",e),this.readable=!1,this.emit("close")}).bind(this)),this;throw new TypeError("Unexpected data type ("+typeof e+")")}Qt.inherits(ye,Zt);ye.prototype.write=function(t){this.buffer=ue.concat([this.buffer,ue.from(t)]),this.emit("data",t)};ye.prototype.end=function(t){t&&this.write(t),this.emit("end",t),this.emit("close"),this.writable=!1,this.readable=!1};var Xr=ye,ee=j.Buffer,Ue=j.SlowBuffer,en=le;function le(e,t){if(!ee.isBuffer(e)||!ee.isBuffer(t)||e.length!==t.length)return!1;for(var r=0,n=0;n<e.length;n++)r|=e[n]^t[n];return r===0}le.install=function(){ee.prototype.equal=Ue.prototype.equal=function(t){return le(this,t)}};var rn=ee.prototype.equal,tn=Ue.prototype.equal;le.restore=function(){ee.prototype.equal=rn,Ue.prototype.equal=tn};function Le(e){var t=(e/8|0)+(e%8===0?0:1);return t}var nn={ES256:Le(256),ES384:Le(384),ES512:Le(521)};function sn(e){var t=nn[e];if(t)return t;throw new Error('Unknown algorithm "'+e+'"')}var on=sn,he=re.Buffer,Kr=on,pe=128,qr=0,an=32,cn=16,fn=2,Wr=cn|an|qr<<6,me=fn|qr<<6;function un(e){return e.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function Jr(e){if(he.isBuffer(e))return e;if(typeof e=="string")return he.from(e,"base64");throw new TypeError("ECDSA signature must be a Base64 string or a Buffer")}function ln(e,t){e=Jr(e);var r=Kr(t),n=r+1,s=e.length,i=0;if(e[i++]!==Wr)throw new Error('Could not find expected "seq"');var c=e[i++];if(c===(pe|1)&&(c=e[i++]),s-i<c)throw new Error('"seq" specified length of "'+c+'", only "'+(s-i)+'" remaining');if(e[i++]!==me)throw new Error('Could not find expected "int" for "r"');var l=e[i++];if(s-i-2<l)throw new Error('"r" specified length of "'+l+'", only "'+(s-i-2)+'" available');if(n<l)throw new Error('"r" specified length of "'+l+'", max of "'+n+'" is acceptable');var a=i;if(i+=l,e[i++]!==me)throw new Error('Could not find expected "int" for "s"');var o=e[i++];if(s-i!==o)throw new Error('"s" specified length of "'+o+'", expected "'+(s-i)+'"');if(n<o)throw new Error('"s" specified length of "'+o+'", max of "'+n+'" is acceptable');var f=i;if(i+=o,i!==s)throw new Error('Expected to consume entire buffer, but "'+(s-i)+'" bytes remain');var u=r-l,w=r-o,m=he.allocUnsafe(u+l+w+o);for(i=0;i<u;++i)m[i]=0;e.copy(m,i,a+Math.max(-u,0),a+l),i=r;for(var h=i;i<h+w;++i)m[i]=0;return e.copy(m,i,f+Math.max(-w,0),f+o),m=m.toString("base64"),m=un(m),m}function sr(e,t,r){for(var n=0;t+n<r&&e[t+n]===0;)++n;var s=e[t+n]>=pe;return s&&--n,n}function hn(e,t){e=Jr(e);var r=Kr(t),n=e.length;if(n!==r*2)throw new TypeError('"'+t+'" signatures must be "'+r*2+'" bytes, saw "'+n+'"');var s=sr(e,0,r),i=sr(e,r,e.length),c=r-s,l=r-i,a=1+1+c+1+1+l,o=a<pe,f=he.allocUnsafe((o?2:3)+a),u=0;return f[u++]=Wr,o?f[u++]=a:(f[u++]=pe|1,f[u++]=a&255),f[u++]=me,f[u++]=c,s<0?(f[u++]=0,u+=e.copy(f,u,0,r)):u+=e.copy(f,u,s,r),f[u++]=me,f[u++]=l,i<0?(f[u++]=0,e.copy(f,u,r)):e.copy(f,u,r+i),f}var pn={derToJose:ln,joseToDer:hn},mn=en,X=re.Buffer,G=j,Yr=pn,ir=j,dn=`"%s" is not a valid algorithm.
|
|
2
2
|
Supported algorithms are:
|
|
3
|
-
"HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".`,Q="secret must be a string or buffer",M="key must be a string or a buffer",En="key must be a string, a buffer or an object",Ue=typeof G.createPublicKey=="function";Ue&&(M+=" or a KeyObject",Q+="or a KeyObject");function zr(e){if(!X.isBuffer(e)&&typeof e!="string"&&(!Ue||typeof e!="object"||typeof e.type!="string"||typeof e.asymmetricKeyType!="string"||typeof e.export!="function"))throw x(M)}function Zr(e){if(!X.isBuffer(e)&&typeof e!="string"&&typeof e!="object")throw x(En)}function $n(e){if(!X.isBuffer(e)){if(typeof e=="string")return e;if(!Ue||typeof e!="object"||e.type!=="secret"||typeof e.export!="function")throw x(Q)}}function He(e){return e.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function Qr(e){e=e.toString();var t=4-e.length%4;if(t!==4)for(var r=0;r<t;++r)e+="=";return e.replace(/\-/g,"+").replace(/_/g,"/")}function x(e){var t=[].slice.call(arguments,1),r=ir.format.bind(ir,e).apply(null,t);return new TypeError(r)}function yn(e){return X.isBuffer(e)||typeof e=="string"}function te(e){return yn(e)||(e=JSON.stringify(e)),e}function et(e){return function(r,n){$n(n),r=te(r);var s=G.createHmac("sha"+e,n),i=(s.update(r),s.digest("base64"));return He(i)}}function gn(e){return function(r,n,s){var i=et(e)(r,s);return mn(X.from(n),X.from(i))}}function rt(e){return function(r,n){Zr(n),r=te(r);var s=G.createSign("RSA-SHA"+e),i=(s.update(r),s.sign(n,"base64"));return He(i)}}function tt(e){return function(r,n,s){zr(s),r=te(r),n=Qr(n);var i=G.createVerify("RSA-SHA"+e);return i.update(r),i.verify(s,n,"base64")}}function Sn(e){return function(r,n){Zr(n),r=te(r);var s=G.createSign("RSA-SHA"+e),i=(s.update(r),s.sign({key:n,padding:G.constants.RSA_PKCS1_PSS_PADDING,saltLength:G.constants.RSA_PSS_SALTLEN_DIGEST},"base64"));return He(i)}}function vn(e){return function(r,n,s){zr(s),r=te(r),n=Qr(n);var i=G.createVerify("RSA-SHA"+e);return i.update(r),i.verify({key:s,padding:G.constants.RSA_PKCS1_PSS_PADDING,saltLength:G.constants.RSA_PSS_SALTLEN_DIGEST},n,"base64")}}function wn(e){var t=rt(e);return function(){var n=t.apply(null,arguments);return n=Yr.derToJose(n,"ES"+e),n}}function bn(e){var t=tt(e);return function(n,s,i){s=Yr.joseToDer(s,"ES"+e).toString("base64");var c=t(n,s,i);return c}}function In(){return function(){return""}}function Rn(){return function(t,r){return r===""}}var nt=function(t){var r={hs:et,rs:rt,ps:Sn,es:wn,none:In},n={hs:gn,rs:tt,ps:vn,es:bn,none:Rn},s=t.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/i);if(!s)throw x(dn,t);var i=(s[1]||s[3]).toLowerCase(),c=s[2];return{sign:r[i](c),verify:n[i](c)}},Tn=j.Buffer,st=function(t){return typeof t=="string"?t:typeof t=="number"||Tn.isBuffer(t)?t.toString():JSON.stringify(t)},An=re.Buffer,or=Xr,On=nt,Nn=j,ar=st,Me=j;function cr(e,t){return An.from(e,t).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function Ln(e,t,r){r=r||"utf8";var n=cr(ar(e),"binary"),s=cr(ar(t),r);return Me.format("%s.%s",n,s)}function it(e){var t=e.header,r=e.payload,n=e.secret||e.privateKey,s=e.encoding,i=On(t.alg),c=Ln(t,r,s),l=i.sign(c,n);return Me.format("%s.%s",c,l)}function ge(e){var t=e.secret||e.privateKey||e.key,r=new or(t);this.readable=!0,this.header=e.header,this.encoding=e.encoding,this.secret=this.privateKey=this.key=r,this.payload=new or(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))}Me.inherits(ge,Nn);ge.prototype.sign=function(){try{var t=it({header:this.header,payload:this.payload.buffer,secret:this.secret.buffer,encoding:this.encoding});return this.emit("done",t),this.emit("data",t),this.emit("end"),this.readable=!1,t}catch(r){this.readable=!1,this.emit("error",r),this.emit("close")}};ge.sign=it;var jn=ge,ot=re.Buffer,fr=Xr,Pn=nt,_n=j,at=st,xn=j,Dn=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function Cn(e){return Object.prototype.toString.call(e)==="[object Object]"}function Bn(e){if(Cn(e))return e;try{return JSON.parse(e)}catch{return}}function ct(e){var t=e.split(".",1)[0];return Bn(ot.from(t,"base64").toString("binary"))}function Gn(e){return e.split(".",2).join(".")}function ft(e){return e.split(".")[2]}function Fn(e,t){t=t||"utf8";var r=e.split(".")[1];return ot.from(r,"base64").toString(t)}function ut(e){return Dn.test(e)&&!!ct(e)}function lt(e,t,r){if(!t){var n=new Error("Missing algorithm parameter for jws.verify");throw n.code="MISSING_ALGORITHM",n}e=at(e);var s=ft(e),i=Gn(e),c=Pn(t);return c.verify(i,s,r)}function ht(e,t){if(t=t||{},e=at(e),!ut(e))return null;var r=ct(e);if(!r)return null;var n=Fn(e);return(r.typ==="JWT"||t.json)&&(n=JSON.parse(n,t.encoding)),{header:r,payload:n,signature:ft(e)}}function J(e){e=e||{};var t=e.secret||e.publicKey||e.key,r=new fr(t);this.readable=!0,this.algorithm=e.algorithm,this.encoding=e.encoding,this.secret=this.publicKey=this.key=r,this.signature=new fr(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))}xn.inherits(J,_n);J.prototype.verify=function(){try{var t=lt(this.signature.buffer,this.algorithm,this.key.buffer),r=ht(this.signature.buffer,this.encoding);return this.emit("done",t,r),this.emit("data",t),this.emit("end"),this.readable=!1,t}catch(n){this.readable=!1,this.emit("error",n),this.emit("close")}};J.decode=ht;J.isValid=ut;J.verify=lt;var Vn=J,pt=jn,Se=Vn,kn=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"];F.ALGORITHMS=kn;F.sign=pt.sign;F.verify=Se.verify;F.decode=Se.decode;F.isValid=Se.isValid;F.createSign=function(t){return new pt(t)};F.createVerify=function(t){return new Se(t)};var Un=F,mt=function(e,t){t=t||{};var r=Un.decode(e,t);if(!r)return null;var n=r.payload;if(typeof n=="string")try{var s=JSON.parse(n);s!==null&&typeof s=="object"&&(n=s)}catch{}return t.complete===!0?{header:r.header,payload:n,signature:r.signature}:n},de=function(e,t){Error.call(this,e),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name="JsonWebTokenError",this.message=e,t&&(this.inner=t)};de.prototype=Object.create(Error.prototype);de.prototype.constructor=de;var ve=de,dt=ve,Ee=function(e,t){dt.call(this,e),this.name="NotBeforeError",this.date=t};Ee.prototype=Object.create(dt.prototype);Ee.prototype.constructor=Ee;var Et=Ee,$t=ve,$e=function(e,t){$t.call(this,e),this.name="TokenExpiredError",this.expiredAt=t};$e.prototype=Object.create($t.prototype);$e.prototype.constructor=$e;var yt=$e,K=1e3,q=K*60,W=q*60,U=W*24,Hn=U*7,Mn=U*365.25,Xn=function(e,t){t=t||{};var r=typeof e;if(r==="string"&&e.length>0)return Kn(e);if(r==="number"&&isFinite(e))return t.long?Wn(e):qn(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function Kn(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var r=parseFloat(t[1]),n=(t[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*Mn;case"weeks":case"week":case"w":return r*Hn;case"days":case"day":case"d":return r*U;case"hours":case"hour":case"hrs":case"hr":case"h":return r*W;case"minutes":case"minute":case"mins":case"min":case"m":return r*q;case"seconds":case"second":case"secs":case"sec":case"s":return r*K;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function qn(e){var t=Math.abs(e);return t>=U?Math.round(e/U)+"d":t>=W?Math.round(e/W)+"h":t>=q?Math.round(e/q)+"m":t>=K?Math.round(e/K)+"s":e+"ms"}function Wn(e){var t=Math.abs(e);return t>=U?se(e,t,U,"day"):t>=W?se(e,t,W,"hour"):t>=q?se(e,t,q,"minute"):t>=K?se(e,t,K,"second"):e+" ms"}function se(e,t,r,n){var s=t>=r*1.5;return Math.round(e/r)+" "+n+(s?"s":"")}var Jn=Xn,gt=function(e,t){var r=t||Math.floor(Date.now()/1e3);if(typeof e=="string"){var n=Jn(e);return typeof n>"u"?void 0:Math.floor(r+n/1e3)}else return typeof e=="number"?r+e:void 0},Be={exports:{}};const Yn="2.0.0",St=256,zn=Number.MAX_SAFE_INTEGER||9007199254740991,Zn=16,Qn=St-6,es=["major","premajor","minor","preminor","patch","prepatch","prerelease"];var we={MAX_LENGTH:St,MAX_SAFE_COMPONENT_LENGTH:Zn,MAX_SAFE_BUILD_LENGTH:Qn,MAX_SAFE_INTEGER:zn,RELEASE_TYPES:es,SEMVER_SPEC_VERSION:Yn,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2};const rs=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};var be=rs;(function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:s}=we,i=be;t=e.exports={};const c=t.re=[],l=t.safeRe=[],a=t.src=[],o=t.t={};let f=0;const u="[a-zA-Z0-9-]",w=[["\\s",1],["\\d",s],[u,n]],m=R=>{for(const[L,V]of w)R=R.split(`${L}*`).join(`${L}{0,${V}}`).split(`${L}+`).join(`${L}{1,${V}}`);return R},h=(R,L,V)=>{const A=m(L),_=f++;i(R,_,L),o[R]=_,a[_]=L,c[_]=new RegExp(L,V?"g":void 0),l[_]=new RegExp(A,V?"g":void 0)};h("NUMERICIDENTIFIER","0|[1-9]\\d*"),h("NUMERICIDENTIFIERLOOSE","\\d+"),h("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${u}*`),h("MAINVERSION",`(${a[o.NUMERICIDENTIFIER]})\\.(${a[o.NUMERICIDENTIFIER]})\\.(${a[o.NUMERICIDENTIFIER]})`),h("MAINVERSIONLOOSE",`(${a[o.NUMERICIDENTIFIERLOOSE]})\\.(${a[o.NUMERICIDENTIFIERLOOSE]})\\.(${a[o.NUMERICIDENTIFIERLOOSE]})`),h("PRERELEASEIDENTIFIER",`(?:${a[o.NUMERICIDENTIFIER]}|${a[o.NONNUMERICIDENTIFIER]})`),h("PRERELEASEIDENTIFIERLOOSE",`(?:${a[o.NUMERICIDENTIFIERLOOSE]}|${a[o.NONNUMERICIDENTIFIER]})`),h("PRERELEASE",`(?:-(${a[o.PRERELEASEIDENTIFIER]}(?:\\.${a[o.PRERELEASEIDENTIFIER]})*))`),h("PRERELEASELOOSE",`(?:-?(${a[o.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${a[o.PRERELEASEIDENTIFIERLOOSE]})*))`),h("BUILDIDENTIFIER",`${u}+`),h("BUILD",`(?:\\+(${a[o.BUILDIDENTIFIER]}(?:\\.${a[o.BUILDIDENTIFIER]})*))`),h("FULLPLAIN",`v?${a[o.MAINVERSION]}${a[o.PRERELEASE]}?${a[o.BUILD]}?`),h("FULL",`^${a[o.FULLPLAIN]}$`),h("LOOSEPLAIN",`[v=\\s]*${a[o.MAINVERSIONLOOSE]}${a[o.PRERELEASELOOSE]}?${a[o.BUILD]}?`),h("LOOSE",`^${a[o.LOOSEPLAIN]}$`),h("GTLT","((?:<|>)?=?)"),h("XRANGEIDENTIFIERLOOSE",`${a[o.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),h("XRANGEIDENTIFIER",`${a[o.NUMERICIDENTIFIER]}|x|X|\\*`),h("XRANGEPLAIN",`[v=\\s]*(${a[o.XRANGEIDENTIFIER]})(?:\\.(${a[o.XRANGEIDENTIFIER]})(?:\\.(${a[o.XRANGEIDENTIFIER]})(?:${a[o.PRERELEASE]})?${a[o.BUILD]}?)?)?`),h("XRANGEPLAINLOOSE",`[v=\\s]*(${a[o.XRANGEIDENTIFIERLOOSE]})(?:\\.(${a[o.XRANGEIDENTIFIERLOOSE]})(?:\\.(${a[o.XRANGEIDENTIFIERLOOSE]})(?:${a[o.PRERELEASELOOSE]})?${a[o.BUILD]}?)?)?`),h("XRANGE",`^${a[o.GTLT]}\\s*${a[o.XRANGEPLAIN]}$`),h("XRANGELOOSE",`^${a[o.GTLT]}\\s*${a[o.XRANGEPLAINLOOSE]}$`),h("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),h("COERCE",`${a[o.COERCEPLAIN]}(?:$|[^\\d])`),h("COERCEFULL",a[o.COERCEPLAIN]+`(?:${a[o.PRERELEASE]})?(?:${a[o.BUILD]})?(?:$|[^\\d])`),h("COERCERTL",a[o.COERCE],!0),h("COERCERTLFULL",a[o.COERCEFULL],!0),h("LONETILDE","(?:~>?)"),h("TILDETRIM",`(\\s*)${a[o.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",h("TILDE",`^${a[o.LONETILDE]}${a[o.XRANGEPLAIN]}$`),h("TILDELOOSE",`^${a[o.LONETILDE]}${a[o.XRANGEPLAINLOOSE]}$`),h("LONECARET","(?:\\^)"),h("CARETTRIM",`(\\s*)${a[o.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",h("CARET",`^${a[o.LONECARET]}${a[o.XRANGEPLAIN]}$`),h("CARETLOOSE",`^${a[o.LONECARET]}${a[o.XRANGEPLAINLOOSE]}$`),h("COMPARATORLOOSE",`^${a[o.GTLT]}\\s*(${a[o.LOOSEPLAIN]})$|^$`),h("COMPARATOR",`^${a[o.GTLT]}\\s*(${a[o.FULLPLAIN]})$|^$`),h("COMPARATORTRIM",`(\\s*)${a[o.GTLT]}\\s*(${a[o.LOOSEPLAIN]}|${a[o.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",h("HYPHENRANGE",`^\\s*(${a[o.XRANGEPLAIN]})\\s+-\\s+(${a[o.XRANGEPLAIN]})\\s*$`),h("HYPHENRANGELOOSE",`^\\s*(${a[o.XRANGEPLAINLOOSE]})\\s+-\\s+(${a[o.XRANGEPLAINLOOSE]})\\s*$`),h("STAR","(<|>)?=?\\s*\\*"),h("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),h("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(Be,Be.exports);var ne=Be.exports;const ts=Object.freeze({loose:!0}),ns=Object.freeze({}),ss=e=>e?typeof e!="object"?ts:e:ns;var Xe=ss;const ur=/^[0-9]+$/,vt=(e,t)=>{const r=ur.test(e),n=ur.test(t);return r&&n&&(e=+e,t=+t),e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1},is=(e,t)=>vt(t,e);var wt={compareIdentifiers:vt,rcompareIdentifiers:is};const ie=be,{MAX_LENGTH:lr,MAX_SAFE_INTEGER:oe}=we,{safeRe:hr,t:pr}=ne,os=Xe,{compareIdentifiers:H}=wt;let as=class B{constructor(t,r){if(r=os(r),t instanceof B){if(t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease)return t;t=t.version}else if(typeof t!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>lr)throw new TypeError(`version is longer than ${lr} characters`);ie("SemVer",t,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;const n=t.trim().match(r.loose?hr[pr.LOOSE]:hr[pr.FULL]);if(!n)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>oe||this.major<0)throw new TypeError("Invalid major version");if(this.minor>oe||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>oe||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(s=>{if(/^[0-9]+$/.test(s)){const i=+s;if(i>=0&&i<oe)return i}return s}):this.prerelease=[],this.build=n[5]?n[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(t){if(ie("SemVer.compare",this.version,this.options,t),!(t instanceof B)){if(typeof t=="string"&&t===this.version)return 0;t=new B(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof B||(t=new B(t,this.options)),H(this.major,t.major)||H(this.minor,t.minor)||H(this.patch,t.patch)}comparePre(t){if(t instanceof B||(t=new B(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{const n=this.prerelease[r],s=t.prerelease[r];if(ie("prerelease compare",r,n,s),n===void 0&&s===void 0)return 0;if(s===void 0)return 1;if(n===void 0)return-1;if(n===s)continue;return H(n,s)}while(++r)}compareBuild(t){t instanceof B||(t=new B(t,this.options));let r=0;do{const n=this.build[r],s=t.build[r];if(ie("build compare",r,n,s),n===void 0&&s===void 0)return 0;if(s===void 0)return 1;if(n===void 0)return-1;if(n===s)continue;return H(n,s)}while(++r)}inc(t,r,n){switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,n),this.inc("pre",r,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,n),this.inc("pre",r,n);break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const s=Number(n)?1:0;if(!r&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(this.prerelease.length===0)this.prerelease=[s];else{let i=this.prerelease.length;for(;--i>=0;)typeof this.prerelease[i]=="number"&&(this.prerelease[i]++,i=-2);if(i===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(s)}}if(r){let i=[r,s];n===!1&&(i=[r]),H(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=i):this.prerelease=i}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};var N=as;const mr=N,cs=(e,t,r=!1)=>{if(e instanceof mr)return e;try{return new mr(e,t)}catch(n){if(!r)return null;throw n}};var Y=cs;const fs=Y,us=(e,t)=>{const r=fs(e,t);return r?r.version:null};var ls=us;const hs=Y,ps=(e,t)=>{const r=hs(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};var ms=ps;const dr=N,ds=(e,t,r,n,s)=>{typeof r=="string"&&(s=n,n=r,r=void 0);try{return new dr(e instanceof dr?e.version:e,r).inc(t,n,s).version}catch{return null}};var Es=ds;const Er=Y,$s=(e,t)=>{const r=Er(e,null,!0),n=Er(t,null,!0),s=r.compare(n);if(s===0)return null;const i=s>0,c=i?r:n,l=i?n:r,a=!!c.prerelease.length;if(!!l.prerelease.length&&!a)return!l.patch&&!l.minor?"major":c.patch?"patch":c.minor?"minor":"major";const f=a?"pre":"";return r.major!==n.major?f+"major":r.minor!==n.minor?f+"minor":r.patch!==n.patch?f+"patch":"prerelease"};var ys=$s;const gs=N,Ss=(e,t)=>new gs(e,t).major;var vs=Ss;const ws=N,bs=(e,t)=>new ws(e,t).minor;var Is=bs;const Rs=N,Ts=(e,t)=>new Rs(e,t).patch;var As=Ts;const Os=Y,Ns=(e,t)=>{const r=Os(e,t);return r&&r.prerelease.length?r.prerelease:null};var Ls=Ns;const $r=N,js=(e,t,r)=>new $r(e,r).compare(new $r(t,r));var D=js;const Ps=D,_s=(e,t,r)=>Ps(t,e,r);var xs=_s;const Ds=D,Cs=(e,t)=>Ds(e,t,!0);var Bs=Cs;const yr=N,Gs=(e,t,r)=>{const n=new yr(e,r),s=new yr(t,r);return n.compare(s)||n.compareBuild(s)};var Ke=Gs;const Fs=Ke,Vs=(e,t)=>e.sort((r,n)=>Fs(r,n,t));var ks=Vs;const Us=Ke,Hs=(e,t)=>e.sort((r,n)=>Us(n,r,t));var Ms=Hs;const Xs=D,Ks=(e,t,r)=>Xs(e,t,r)>0;var Ie=Ks;const qs=D,Ws=(e,t,r)=>qs(e,t,r)<0;var qe=Ws;const Js=D,Ys=(e,t,r)=>Js(e,t,r)===0;var bt=Ys;const zs=D,Zs=(e,t,r)=>zs(e,t,r)!==0;var It=Zs;const Qs=D,ei=(e,t,r)=>Qs(e,t,r)>=0;var We=ei;const ri=D,ti=(e,t,r)=>ri(e,t,r)<=0;var Je=ti;const ni=bt,si=It,ii=Ie,oi=We,ai=qe,ci=Je,fi=(e,t,r,n)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e===r;case"!==":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e!==r;case"":case"=":case"==":return ni(e,r,n);case"!=":return si(e,r,n);case">":return ii(e,r,n);case">=":return oi(e,r,n);case"<":return ai(e,r,n);case"<=":return ci(e,r,n);default:throw new TypeError(`Invalid operator: ${t}`)}};var Rt=fi;const ui=N,li=Y,{safeRe:ae,t:ce}=ne,hi=(e,t)=>{if(e instanceof ui)return e;if(typeof e=="number"&&(e=String(e)),typeof e!="string")return null;t=t||{};let r=null;if(!t.rtl)r=e.match(t.includePrerelease?ae[ce.COERCEFULL]:ae[ce.COERCE]);else{const a=t.includePrerelease?ae[ce.COERCERTLFULL]:ae[ce.COERCERTL];let o;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}if(r===null)return null;const n=r[2],s=r[3]||"0",i=r[4]||"0",c=t.includePrerelease&&r[5]?`-${r[5]}`:"",l=t.includePrerelease&&r[6]?`+${r[6]}`:"";return li(`${n}.${s}.${i}${c}${l}`,t)};var pi=hi;class mi{constructor(){this.max=1e3,this.map=new Map}get(t){const r=this.map.get(t);if(r!==void 0)return this.map.delete(t),this.map.set(t,r),r}delete(t){return this.map.delete(t)}set(t,r){if(!this.delete(t)&&r!==void 0){if(this.map.size>=this.max){const s=this.map.keys().next().value;this.delete(s)}this.map.set(t,r)}return this}}var di=mi,Le,gr;function C(){if(gr)return Le;gr=1;class e{constructor(p,g){if(g=n(g),p instanceof e)return p.loose===!!g.loose&&p.includePrerelease===!!g.includePrerelease?p:new e(p.raw,g);if(p instanceof s)return this.raw=p.value,this.set=[[p]],this.format(),this;if(this.options=g,this.loose=!!g.loose,this.includePrerelease=!!g.includePrerelease,this.raw=p.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map($=>this.parseRange($.trim())).filter($=>$.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const $=this.set[0];if(this.set=this.set.filter(y=>!h(y[0])),this.set.length===0)this.set=[$];else if(this.set.length>1){for(const y of this.set)if(y.length===1&&R(y[0])){this.set=[y];break}}}this.format()}format(){return this.range=this.set.map(p=>p.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(p){const $=((this.options.includePrerelease&&w)|(this.options.loose&&m))+":"+p,y=r.get($);if(y)return y;const E=this.options.loose,S=E?l[a.HYPHENRANGELOOSE]:l[a.HYPHENRANGE];p=p.replace(S,Mt(this.options.includePrerelease)),i("hyphen replace",p),p=p.replace(l[a.COMPARATORTRIM],o),i("comparator trim",p),p=p.replace(l[a.TILDETRIM],f),i("tilde trim",p),p=p.replace(l[a.CARETTRIM],u),i("caret trim",p);let b=p.split(" ").map(O=>V(O,this.options)).join(" ").split(/\s+/).map(O=>Ht(O,this.options));E&&(b=b.filter(O=>(i("loose invalid filter",O,this.options),!!O.match(l[a.COMPARATORLOOSE])))),i("range list",b);const v=new Map,T=b.map(O=>new s(O,this.options));for(const O of T){if(h(O))return[O];v.set(O.value,O)}v.size>1&&v.has("")&&v.delete("");const P=[...v.values()];return r.set($,P),P}intersects(p,g){if(!(p instanceof e))throw new TypeError("a Range is required");return this.set.some($=>L($,g)&&p.set.some(y=>L(y,g)&&$.every(E=>y.every(S=>E.intersects(S,g)))))}test(p){if(!p)return!1;if(typeof p=="string")try{p=new c(p,this.options)}catch{return!1}for(let g=0;g<this.set.length;g++)if(Xt(this.set[g],p,this.options))return!0;return!1}}Le=e;const t=di,r=new t,n=Xe,s=Re(),i=be,c=N,{safeRe:l,t:a,comparatorTrimReplace:o,tildeTrimReplace:f,caretTrimReplace:u}=ne,{FLAG_INCLUDE_PRERELEASE:w,FLAG_LOOSE:m}=we,h=d=>d.value==="<0.0.0-0",R=d=>d.value==="",L=(d,p)=>{let g=!0;const $=d.slice();let y=$.pop();for(;g&&$.length;)g=$.every(E=>y.intersects(E,p)),y=$.pop();return g},V=(d,p)=>(i("comp",d,p),d=Gt(d,p),i("caret",d),d=_(d,p),i("tildes",d),d=Vt(d,p),i("xrange",d),d=Ut(d,p),i("stars",d),d),A=d=>!d||d.toLowerCase()==="x"||d==="*",_=(d,p)=>d.trim().split(/\s+/).map(g=>Bt(g,p)).join(" "),Bt=(d,p)=>{const g=p.loose?l[a.TILDELOOSE]:l[a.TILDE];return d.replace(g,($,y,E,S,b)=>{i("tilde",d,$,y,E,S,b);let v;return A(y)?v="":A(E)?v=`>=${y}.0.0 <${+y+1}.0.0-0`:A(S)?v=`>=${y}.${E}.0 <${y}.${+E+1}.0-0`:b?(i("replaceTilde pr",b),v=`>=${y}.${E}.${S}-${b} <${y}.${+E+1}.0-0`):v=`>=${y}.${E}.${S} <${y}.${+E+1}.0-0`,i("tilde return",v),v})},Gt=(d,p)=>d.trim().split(/\s+/).map(g=>Ft(g,p)).join(" "),Ft=(d,p)=>{i("caret",d,p);const g=p.loose?l[a.CARETLOOSE]:l[a.CARET],$=p.includePrerelease?"-0":"";return d.replace(g,(y,E,S,b,v)=>{i("caret",d,y,E,S,b,v);let T;return A(E)?T="":A(S)?T=`>=${E}.0.0${$} <${+E+1}.0.0-0`:A(b)?E==="0"?T=`>=${E}.${S}.0${$} <${E}.${+S+1}.0-0`:T=`>=${E}.${S}.0${$} <${+E+1}.0.0-0`:v?(i("replaceCaret pr",v),E==="0"?S==="0"?T=`>=${E}.${S}.${b}-${v} <${E}.${S}.${+b+1}-0`:T=`>=${E}.${S}.${b}-${v} <${E}.${+S+1}.0-0`:T=`>=${E}.${S}.${b}-${v} <${+E+1}.0.0-0`):(i("no pr"),E==="0"?S==="0"?T=`>=${E}.${S}.${b}${$} <${E}.${S}.${+b+1}-0`:T=`>=${E}.${S}.${b}${$} <${E}.${+S+1}.0-0`:T=`>=${E}.${S}.${b} <${+E+1}.0.0-0`),i("caret return",T),T})},Vt=(d,p)=>(i("replaceXRanges",d,p),d.split(/\s+/).map(g=>kt(g,p)).join(" ")),kt=(d,p)=>{d=d.trim();const g=p.loose?l[a.XRANGELOOSE]:l[a.XRANGE];return d.replace(g,($,y,E,S,b,v)=>{i("xRange",d,$,y,E,S,b,v);const T=A(E),P=T||A(S),O=P||A(b),z=O;return y==="="&&z&&(y=""),v=p.includePrerelease?"-0":"",T?y===">"||y==="<"?$="<0.0.0-0":$="*":y&&z?(P&&(S=0),b=0,y===">"?(y=">=",P?(E=+E+1,S=0,b=0):(S=+S+1,b=0)):y==="<="&&(y="<",P?E=+E+1:S=+S+1),y==="<"&&(v="-0"),$=`${y+E}.${S}.${b}${v}`):P?$=`>=${E}.0.0${v} <${+E+1}.0.0-0`:O&&($=`>=${E}.${S}.0${v} <${E}.${+S+1}.0-0`),i("xRange return",$),$})},Ut=(d,p)=>(i("replaceStars",d,p),d.trim().replace(l[a.STAR],"")),Ht=(d,p)=>(i("replaceGTE0",d,p),d.trim().replace(l[p.includePrerelease?a.GTE0PRE:a.GTE0],"")),Mt=d=>(p,g,$,y,E,S,b,v,T,P,O,z)=>(A($)?g="":A(y)?g=`>=${$}.0.0${d?"-0":""}`:A(E)?g=`>=${$}.${y}.0${d?"-0":""}`:S?g=`>=${g}`:g=`>=${g}${d?"-0":""}`,A(T)?v="":A(P)?v=`<${+T+1}.0.0-0`:A(O)?v=`<${T}.${+P+1}.0-0`:z?v=`<=${T}.${P}.${O}-${z}`:d?v=`<${T}.${P}.${+O+1}-0`:v=`<=${v}`,`${g} ${v}`.trim()),Xt=(d,p,g)=>{for(let $=0;$<d.length;$++)if(!d[$].test(p))return!1;if(p.prerelease.length&&!g.includePrerelease){for(let $=0;$<d.length;$++)if(i(d[$].semver),d[$].semver!==s.ANY&&d[$].semver.prerelease.length>0){const y=d[$].semver;if(y.major===p.major&&y.minor===p.minor&&y.patch===p.patch)return!0}return!1}return!0};return Le}var je,Sr;function Re(){if(Sr)return je;Sr=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(f,u){if(u=r(u),f instanceof t){if(f.loose===!!u.loose)return f;f=f.value}f=f.trim().split(/\s+/).join(" "),c("comparator",f,u),this.options=u,this.loose=!!u.loose,this.parse(f),this.semver===e?this.value="":this.value=this.operator+this.semver.version,c("comp",this)}parse(f){const u=this.options.loose?n[s.COMPARATORLOOSE]:n[s.COMPARATOR],w=f.match(u);if(!w)throw new TypeError(`Invalid comparator: ${f}`);this.operator=w[1]!==void 0?w[1]:"",this.operator==="="&&(this.operator=""),w[2]?this.semver=new l(w[2],this.options.loose):this.semver=e}toString(){return this.value}test(f){if(c("Comparator.test",f,this.options.loose),this.semver===e||f===e)return!0;if(typeof f=="string")try{f=new l(f,this.options)}catch{return!1}return i(f,this.operator,this.semver,this.options)}intersects(f,u){if(!(f instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new a(f.value,u).test(this.value):f.operator===""?f.value===""?!0:new a(this.value,u).test(f.semver):(u=r(u),u.includePrerelease&&(this.value==="<0.0.0-0"||f.value==="<0.0.0-0")||!u.includePrerelease&&(this.value.startsWith("<0.0.0")||f.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&f.operator.startsWith(">")||this.operator.startsWith("<")&&f.operator.startsWith("<")||this.semver.version===f.semver.version&&this.operator.includes("=")&&f.operator.includes("=")||i(this.semver,"<",f.semver,u)&&this.operator.startsWith(">")&&f.operator.startsWith("<")||i(this.semver,">",f.semver,u)&&this.operator.startsWith("<")&&f.operator.startsWith(">")))}}je=t;const r=Xe,{safeRe:n,t:s}=ne,i=Rt,c=be,l=N,a=C();return je}const Ei=C(),$i=(e,t,r)=>{try{t=new Ei(t,r)}catch{return!1}return t.test(e)};var Te=$i;const yi=C(),gi=(e,t)=>new yi(e,t).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));var Si=gi;const vi=N,wi=C(),bi=(e,t,r)=>{let n=null,s=null,i=null;try{i=new wi(t,r)}catch{return null}return e.forEach(c=>{i.test(c)&&(!n||s.compare(c)===-1)&&(n=c,s=new vi(n,r))}),n};var Ii=bi;const Ri=N,Ti=C(),Ai=(e,t,r)=>{let n=null,s=null,i=null;try{i=new Ti(t,r)}catch{return null}return e.forEach(c=>{i.test(c)&&(!n||s.compare(c)===1)&&(n=c,s=new Ri(n,r))}),n};var Oi=Ai;const Pe=N,Ni=C(),vr=Ie,Li=(e,t)=>{e=new Ni(e,t);let r=new Pe("0.0.0");if(e.test(r)||(r=new Pe("0.0.0-0"),e.test(r)))return r;r=null;for(let n=0;n<e.set.length;++n){const s=e.set[n];let i=null;s.forEach(c=>{const l=new Pe(c.semver.version);switch(c.operator){case">":l.prerelease.length===0?l.patch++:l.prerelease.push(0),l.raw=l.format();case"":case">=":(!i||vr(l,i))&&(i=l);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${c.operator}`)}}),i&&(!r||vr(r,i))&&(r=i)}return r&&e.test(r)?r:null};var ji=Li;const Pi=C(),_i=(e,t)=>{try{return new Pi(e,t).range||"*"}catch{return null}};var xi=_i;const Di=N,Tt=Re(),{ANY:Ci}=Tt,Bi=C(),Gi=Te,wr=Ie,br=qe,Fi=Je,Vi=We,ki=(e,t,r,n)=>{e=new Di(e,n),t=new Bi(t,n);let s,i,c,l,a;switch(r){case">":s=wr,i=Fi,c=br,l=">",a=">=";break;case"<":s=br,i=Vi,c=wr,l="<",a="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Gi(e,t,n))return!1;for(let o=0;o<t.set.length;++o){const f=t.set[o];let u=null,w=null;if(f.forEach(m=>{m.semver===Ci&&(m=new Tt(">=0.0.0")),u=u||m,w=w||m,s(m.semver,u.semver,n)?u=m:c(m.semver,w.semver,n)&&(w=m)}),u.operator===l||u.operator===a||(!w.operator||w.operator===l)&&i(e,w.semver))return!1;if(w.operator===a&&c(e,w.semver))return!1}return!0};var Ye=ki;const Ui=Ye,Hi=(e,t,r)=>Ui(e,t,">",r);var Mi=Hi;const Xi=Ye,Ki=(e,t,r)=>Xi(e,t,"<",r);var qi=Ki;const Ir=C(),Wi=(e,t,r)=>(e=new Ir(e,r),t=new Ir(t,r),e.intersects(t,r));var Ji=Wi;const Yi=Te,zi=D;var Zi=(e,t,r)=>{const n=[];let s=null,i=null;const c=e.sort((f,u)=>zi(f,u,r));for(const f of c)Yi(f,t,r)?(i=f,s||(s=f)):(i&&n.push([s,i]),i=null,s=null);s&&n.push([s,null]);const l=[];for(const[f,u]of n)f===u?l.push(f):!u&&f===c[0]?l.push("*"):u?f===c[0]?l.push(`<=${u}`):l.push(`${f} - ${u}`):l.push(`>=${f}`);const a=l.join(" || "),o=typeof t.raw=="string"?t.raw:String(t);return a.length<o.length?a:t};const Rr=C(),ze=Re(),{ANY:_e}=ze,Z=Te,Ze=D,Qi=(e,t,r={})=>{if(e===t)return!0;e=new Rr(e,r),t=new Rr(t,r);let n=!1;e:for(const s of e.set){for(const i of t.set){const c=ro(s,i,r);if(n=n||c!==null,c)continue e}if(n)return!1}return!0},eo=[new ze(">=0.0.0-0")],Tr=[new ze(">=0.0.0")],ro=(e,t,r)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===_e){if(t.length===1&&t[0].semver===_e)return!0;r.includePrerelease?e=eo:e=Tr}if(t.length===1&&t[0].semver===_e){if(r.includePrerelease)return!0;t=Tr}const n=new Set;let s,i;for(const m of e)m.operator===">"||m.operator===">="?s=Ar(s,m,r):m.operator==="<"||m.operator==="<="?i=Or(i,m,r):n.add(m.semver);if(n.size>1)return null;let c;if(s&&i){if(c=Ze(s.semver,i.semver,r),c>0)return null;if(c===0&&(s.operator!==">="||i.operator!=="<="))return null}for(const m of n){if(s&&!Z(m,String(s),r)||i&&!Z(m,String(i),r))return null;for(const h of t)if(!Z(m,String(h),r))return!1;return!0}let l,a,o,f,u=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1,w=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1;u&&u.prerelease.length===1&&i.operator==="<"&&u.prerelease[0]===0&&(u=!1);for(const m of t){if(f=f||m.operator===">"||m.operator===">=",o=o||m.operator==="<"||m.operator==="<=",s){if(w&&m.semver.prerelease&&m.semver.prerelease.length&&m.semver.major===w.major&&m.semver.minor===w.minor&&m.semver.patch===w.patch&&(w=!1),m.operator===">"||m.operator===">="){if(l=Ar(s,m,r),l===m&&l!==s)return!1}else if(s.operator===">="&&!Z(s.semver,String(m),r))return!1}if(i){if(u&&m.semver.prerelease&&m.semver.prerelease.length&&m.semver.major===u.major&&m.semver.minor===u.minor&&m.semver.patch===u.patch&&(u=!1),m.operator==="<"||m.operator==="<="){if(a=Or(i,m,r),a===m&&a!==i)return!1}else if(i.operator==="<="&&!Z(i.semver,String(m),r))return!1}if(!m.operator&&(i||s)&&c!==0)return!1}return!(s&&o&&!i&&c!==0||i&&f&&!s&&c!==0||w||u)},Ar=(e,t,r)=>{if(!e)return t;const n=Ze(e.semver,t.semver,r);return n>0?e:n<0||t.operator===">"&&e.operator===">="?t:e},Or=(e,t,r)=>{if(!e)return t;const n=Ze(e.semver,t.semver,r);return n<0?e:n>0||t.operator==="<"&&e.operator==="<="?t:e};var to=Qi;const xe=ne,Nr=we,no=N,Lr=wt,so=Y,io=ls,oo=ms,ao=Es,co=ys,fo=vs,uo=Is,lo=As,ho=Ls,po=D,mo=xs,Eo=Bs,$o=Ke,yo=ks,go=Ms,So=Ie,vo=qe,wo=bt,bo=It,Io=We,Ro=Je,To=Rt,Ao=pi,Oo=Re(),No=C(),Lo=Te,jo=Si,Po=Ii,_o=Oi,xo=ji,Do=xi,Co=Ye,Bo=Mi,Go=qi,Fo=Ji,Vo=Zi,ko=to;var Qe={parse:so,valid:io,clean:oo,inc:ao,diff:co,major:fo,minor:uo,patch:lo,prerelease:ho,compare:po,rcompare:mo,compareLoose:Eo,compareBuild:$o,sort:yo,rsort:go,gt:So,lt:vo,eq:wo,neq:bo,gte:Io,lte:Ro,cmp:To,coerce:Ao,Comparator:Oo,Range:No,satisfies:Lo,toComparators:jo,maxSatisfying:Po,minSatisfying:_o,minVersion:xo,validRange:Do,outside:Co,gtr:Bo,ltr:Go,intersects:Fo,simplifyRange:Vo,subset:ko,SemVer:no,re:xe.re,src:xe.src,tokens:xe.t,SEMVER_SPEC_VERSION:Nr.SEMVER_SPEC_VERSION,RELEASE_TYPES:Nr.RELEASE_TYPES,compareIdentifiers:Lr.compareIdentifiers,rcompareIdentifiers:Lr.rcompareIdentifiers};const Uo=Qe;var Ho=Uo.satisfies(process.version,">=15.7.0");const Mo=Qe;var Xo=Mo.satisfies(process.version,">=16.9.0");const Ko=Ho,qo=Xo,Wo={ec:["ES256","ES384","ES512"],rsa:["RS256","PS256","RS384","PS384","RS512","PS512"],"rsa-pss":["PS256","PS384","PS512"]},Jo={ES256:"prime256v1",ES384:"secp384r1",ES512:"secp521r1"};var At=function(e,t){if(!e||!t)return;const r=t.asymmetricKeyType;if(!r)return;const n=Wo[r];if(!n)throw new Error(`Unknown key type "${r}".`);if(!n.includes(e))throw new Error(`"alg" parameter for "${r}" key type must be one of: ${n.join(", ")}.`);if(Ko)switch(r){case"ec":const s=t.asymmetricKeyDetails.namedCurve,i=Jo[e];if(s!==i)throw new Error(`"alg" parameter "${e}" requires curve "${i}".`);break;case"rsa-pss":if(qo){const c=parseInt(e.slice(-3),10),{hashAlgorithm:l,mgf1HashAlgorithm:a,saltLength:o}=t.asymmetricKeyDetails;if(l!==`sha${c}`||a!==l)throw new Error(`Invalid key for this operation, its RSA-PSS parameters do not meet the requirements of "alg" ${e}.`);if(o!==void 0&&o>c>>3)throw new Error(`Invalid key for this operation, its RSA-PSS parameter saltLength does not meet the requirements of "alg" ${e}.`)}break}},Yo=Qe,Ot=Yo.satisfies(process.version,"^6.12.0 || >=8.0.0");const I=ve,zo=Et,jr=yt,Zo=mt,Qo=gt,ea=At,ra=Ot,ta=F,{KeyObject:na,createSecretKey:sa,createPublicKey:ia}=j,Ge=["RS256","RS384","RS512"],oa=["ES256","ES384","ES512"],Fe=["RS256","RS384","RS512"],aa=["HS256","HS384","HS512"];ra&&(Ge.splice(Ge.length,0,"PS256","PS384","PS512"),Fe.splice(Fe.length,0,"PS256","PS384","PS512"));var ca=function(e,t,r,n){typeof r=="function"&&!n&&(n=r,r={}),r||(r={}),r=Object.assign({},r);let s;if(n?s=n:s=function(f,u){if(f)throw f;return u},r.clockTimestamp&&typeof r.clockTimestamp!="number")return s(new I("clockTimestamp must be a number"));if(r.nonce!==void 0&&(typeof r.nonce!="string"||r.nonce.trim()===""))return s(new I("nonce must be a non-empty string"));if(r.allowInvalidAsymmetricKeyTypes!==void 0&&typeof r.allowInvalidAsymmetricKeyTypes!="boolean")return s(new I("allowInvalidAsymmetricKeyTypes must be a boolean"));const i=r.clockTimestamp||Math.floor(Date.now()/1e3);if(!e)return s(new I("jwt must be provided"));if(typeof e!="string")return s(new I("jwt must be a string"));const c=e.split(".");if(c.length!==3)return s(new I("jwt malformed"));let l;try{l=Zo(e,{complete:!0})}catch(f){return s(f)}if(!l)return s(new I("invalid token"));const a=l.header;let o;if(typeof t=="function"){if(!n)return s(new I("verify must be called asynchronous if secret or public key is provided as a callback"));o=t}else o=function(f,u){return u(null,t)};return o(a,function(f,u){if(f)return s(new I("error in secret or public key callback: "+f.message));const w=c[2].trim()!=="";if(!w&&u)return s(new I("jwt signature is required"));if(w&&!u)return s(new I("secret or public key must be provided"));if(!w&&!r.algorithms)return s(new I('please specify "none" in "algorithms" to verify unsigned tokens'));if(u!=null&&!(u instanceof na))try{u=ia(u)}catch{try{u=sa(typeof u=="string"?Buffer.from(u):u)}catch{return s(new I("secretOrPublicKey is not valid key material"))}}if(r.algorithms||(u.type==="secret"?r.algorithms=aa:["rsa","rsa-pss"].includes(u.asymmetricKeyType)?r.algorithms=Fe:u.asymmetricKeyType==="ec"?r.algorithms=oa:r.algorithms=Ge),r.algorithms.indexOf(l.header.alg)===-1)return s(new I("invalid algorithm"));if(a.alg.startsWith("HS")&&u.type!=="secret")return s(new I(`secretOrPublicKey must be a symmetric key when using ${a.alg}`));if(/^(?:RS|PS|ES)/.test(a.alg)&&u.type!=="public")return s(new I(`secretOrPublicKey must be an asymmetric key when using ${a.alg}`));if(!r.allowInvalidAsymmetricKeyTypes)try{ea(a.alg,u)}catch(R){return s(R)}let m;try{m=ta.verify(e,l.header.alg,u)}catch(R){return s(R)}if(!m)return s(new I("invalid signature"));const h=l.payload;if(typeof h.nbf<"u"&&!r.ignoreNotBefore){if(typeof h.nbf!="number")return s(new I("invalid nbf value"));if(h.nbf>i+(r.clockTolerance||0))return s(new zo("jwt not active",new Date(h.nbf*1e3)))}if(typeof h.exp<"u"&&!r.ignoreExpiration){if(typeof h.exp!="number")return s(new I("invalid exp value"));if(i>=h.exp+(r.clockTolerance||0))return s(new jr("jwt expired",new Date(h.exp*1e3)))}if(r.audience){const R=Array.isArray(r.audience)?r.audience:[r.audience];if(!(Array.isArray(h.aud)?h.aud:[h.aud]).some(function(A){return R.some(function(_){return _ instanceof RegExp?_.test(A):_===A})}))return s(new I("jwt audience invalid. expected: "+R.join(" or ")))}if(r.issuer&&(typeof r.issuer=="string"&&h.iss!==r.issuer||Array.isArray(r.issuer)&&r.issuer.indexOf(h.iss)===-1))return s(new I("jwt issuer invalid. expected: "+r.issuer));if(r.subject&&h.sub!==r.subject)return s(new I("jwt subject invalid. expected: "+r.subject));if(r.jwtid&&h.jti!==r.jwtid)return s(new I("jwt jwtid invalid. expected: "+r.jwtid));if(r.nonce&&h.nonce!==r.nonce)return s(new I("jwt nonce invalid. expected: "+r.nonce));if(r.maxAge){if(typeof h.iat!="number")return s(new I("iat required when maxAge is specified"));const R=Qo(r.maxAge,h.iat);if(typeof R>"u")return s(new I('"maxAge" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'));if(i>=R+(r.clockTolerance||0))return s(new jr("maxAge exceeded",new Date(R*1e3)))}if(r.complete===!0){const R=l.signature;return s(null,{header:a,payload:h,signature:R})}return s(null,h)})},Pr=1/0,Nt=9007199254740991,fa=17976931348623157e292,_r=0/0,ua="[object Arguments]",la="[object Function]",ha="[object GeneratorFunction]",pa="[object String]",ma="[object Symbol]",da=/^\s+|\s+$/g,Ea=/^[-+]0x[0-9a-f]+$/i,$a=/^0b[01]+$/i,ya=/^0o[0-7]+$/i,ga=/^(?:0|[1-9]\d*)$/,Sa=parseInt;function va(e,t){for(var r=-1,n=e?e.length:0,s=Array(n);++r<n;)s[r]=t(e[r],r,e);return s}function wa(e,t,r,n){for(var s=e.length,i=r+(n?1:-1);n?i--:++i<s;)if(t(e[i],i,e))return i;return-1}function ba(e,t,r){if(t!==t)return wa(e,Ia,r);for(var n=r-1,s=e.length;++n<s;)if(e[n]===t)return n;return-1}function Ia(e){return e!==e}function Ra(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}function Ta(e,t){return va(t,function(r){return e[r]})}function Aa(e,t){return function(r){return e(t(r))}}var Ae=Object.prototype,er=Ae.hasOwnProperty,Oe=Ae.toString,Oa=Ae.propertyIsEnumerable,Na=Aa(Object.keys,Object),La=Math.max;function ja(e,t){var r=Lt(e)||Ca(e)?Ra(e.length,String):[],n=r.length,s=!!n;for(var i in e)(t||er.call(e,i))&&!(s&&(i=="length"||_a(i,n)))&&r.push(i);return r}function Pa(e){if(!xa(e))return Na(e);var t=[];for(var r in Object(e))er.call(e,r)&&r!="constructor"&&t.push(r);return t}function _a(e,t){return t=t??Nt,!!t&&(typeof e=="number"||ga.test(e))&&e>-1&&e%1==0&&e<t}function xa(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||Ae;return e===r}function Da(e,t,r,n){e=rr(e)?e:Ka(e),r=r&&!n?Ha(r):0;var s=e.length;return r<0&&(r=La(s+r,0)),Va(e)?r<=s&&e.indexOf(t,r)>-1:!!s&&ba(e,t,r)>-1}function Ca(e){return Ba(e)&&er.call(e,"callee")&&(!Oa.call(e,"callee")||Oe.call(e)==ua)}var Lt=Array.isArray;function rr(e){return e!=null&&Fa(e.length)&&!Ga(e)}function Ba(e){return tr(e)&&rr(e)}function Ga(e){var t=Ve(e)?Oe.call(e):"";return t==la||t==ha}function Fa(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Nt}function Ve(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function tr(e){return!!e&&typeof e=="object"}function Va(e){return typeof e=="string"||!Lt(e)&&tr(e)&&Oe.call(e)==pa}function ka(e){return typeof e=="symbol"||tr(e)&&Oe.call(e)==ma}function Ua(e){if(!e)return e===0?e:0;if(e=Ma(e),e===Pr||e===-Pr){var t=e<0?-1:1;return t*fa}return e===e?e:0}function Ha(e){var t=Ua(e),r=t%1;return t===t?r?t-r:t:0}function Ma(e){if(typeof e=="number")return e;if(ka(e))return _r;if(Ve(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Ve(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(da,"");var r=$a.test(e);return r||ya.test(e)?Sa(e.slice(2),r?2:8):Ea.test(e)?_r:+e}function Xa(e){return rr(e)?ja(e):Pa(e)}function Ka(e){return e?Ta(e,Xa(e)):[]}var qa=Da,Wa="[object Boolean]",Ja=Object.prototype,Ya=Ja.toString;function za(e){return e===!0||e===!1||Za(e)&&Ya.call(e)==Wa}function Za(e){return!!e&&typeof e=="object"}var Qa=za,xr=1/0,ec=17976931348623157e292,Dr=0/0,rc="[object Symbol]",tc=/^\s+|\s+$/g,nc=/^[-+]0x[0-9a-f]+$/i,sc=/^0b[01]+$/i,ic=/^0o[0-7]+$/i,oc=parseInt,ac=Object.prototype,cc=ac.toString;function fc(e){return typeof e=="number"&&e==pc(e)}function Cr(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function uc(e){return!!e&&typeof e=="object"}function lc(e){return typeof e=="symbol"||uc(e)&&cc.call(e)==rc}function hc(e){if(!e)return e===0?e:0;if(e=mc(e),e===xr||e===-xr){var t=e<0?-1:1;return t*ec}return e===e?e:0}function pc(e){var t=hc(e),r=t%1;return t===t?r?t-r:t:0}function mc(e){if(typeof e=="number")return e;if(lc(e))return Dr;if(Cr(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Cr(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(tc,"");var r=sc.test(e);return r||ic.test(e)?oc(e.slice(2),r?2:8):nc.test(e)?Dr:+e}var dc=fc,Ec="[object Number]",$c=Object.prototype,yc=$c.toString;function gc(e){return!!e&&typeof e=="object"}function Sc(e){return typeof e=="number"||gc(e)&&yc.call(e)==Ec}var vc=Sc,wc="[object Object]";function bc(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch{}return t}function Ic(e,t){return function(r){return e(t(r))}}var Rc=Function.prototype,jt=Object.prototype,Pt=Rc.toString,Tc=jt.hasOwnProperty,Ac=Pt.call(Object),Oc=jt.toString,Nc=Ic(Object.getPrototypeOf,Object);function Lc(e){return!!e&&typeof e=="object"}function jc(e){if(!Lc(e)||Oc.call(e)!=wc||bc(e))return!1;var t=Nc(e);if(t===null)return!0;var r=Tc.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&Pt.call(r)==Ac}var Pc=jc,_c="[object String]",xc=Object.prototype,Dc=xc.toString,Cc=Array.isArray;function Bc(e){return!!e&&typeof e=="object"}function Gc(e){return typeof e=="string"||!Cc(e)&&Bc(e)&&Dc.call(e)==_c}var Fc=Gc,Vc="Expected a function",Br=1/0,kc=17976931348623157e292,Gr=0/0,Uc="[object Symbol]",Hc=/^\s+|\s+$/g,Mc=/^[-+]0x[0-9a-f]+$/i,Xc=/^0b[01]+$/i,Kc=/^0o[0-7]+$/i,qc=parseInt,Wc=Object.prototype,Jc=Wc.toString;function Yc(e,t){var r;if(typeof t!="function")throw new TypeError(Vc);return e=rf(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=void 0),r}}function zc(e){return Yc(2,e)}function Fr(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function Zc(e){return!!e&&typeof e=="object"}function Qc(e){return typeof e=="symbol"||Zc(e)&&Jc.call(e)==Uc}function ef(e){if(!e)return e===0?e:0;if(e=tf(e),e===Br||e===-Br){var t=e<0?-1:1;return t*kc}return e===e?e:0}function rf(e){var t=ef(e),r=t%1;return t===t?r?t-r:t:0}function tf(e){if(typeof e=="number")return e;if(Qc(e))return Gr;if(Fr(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Fr(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(Hc,"");var r=Xc.test(e);return r||Kc.test(e)?qc(e.slice(2),r?2:8):Mc.test(e)?Gr:+e}var nf=zc;const Vr=gt,sf=Ot,of=At,kr=F,af=qa,fe=Qa,Ur=dc,De=vc,_t=Pc,k=Fc,cf=nf,{KeyObject:ff,createSecretKey:uf,createPrivateKey:lf}=j,xt=["RS256","RS384","RS512","ES256","ES384","ES512","HS256","HS384","HS512","none"];sf&&xt.splice(3,0,"PS256","PS384","PS512");const hf={expiresIn:{isValid:function(e){return Ur(e)||k(e)&&e},message:'"expiresIn" should be a number of seconds or string representing a timespan'},notBefore:{isValid:function(e){return Ur(e)||k(e)&&e},message:'"notBefore" should be a number of seconds or string representing a timespan'},audience:{isValid:function(e){return k(e)||Array.isArray(e)},message:'"audience" must be a string or array'},algorithm:{isValid:af.bind(null,xt),message:'"algorithm" must be a valid string enum value'},header:{isValid:_t,message:'"header" must be an object'},encoding:{isValid:k,message:'"encoding" must be a string'},issuer:{isValid:k,message:'"issuer" must be a string'},subject:{isValid:k,message:'"subject" must be a string'},jwtid:{isValid:k,message:'"jwtid" must be a string'},noTimestamp:{isValid:fe,message:'"noTimestamp" must be a boolean'},keyid:{isValid:k,message:'"keyid" must be a string'},mutatePayload:{isValid:fe,message:'"mutatePayload" must be a boolean'},allowInsecureKeySizes:{isValid:fe,message:'"allowInsecureKeySizes" must be a boolean'},allowInvalidAsymmetricKeyTypes:{isValid:fe,message:'"allowInvalidAsymmetricKeyTypes" must be a boolean'}},pf={iat:{isValid:De,message:'"iat" should be a number of seconds'},exp:{isValid:De,message:'"exp" should be a number of seconds'},nbf:{isValid:De,message:'"nbf" should be a number of seconds'}};function Dt(e,t,r,n){if(!_t(r))throw new Error('Expected "'+n+'" to be a plain object.');Object.keys(r).forEach(function(s){const i=e[s];if(!i){if(!t)throw new Error('"'+s+'" is not allowed in "'+n+'"');return}if(!i.isValid(r[s]))throw new Error(i.message)})}function mf(e){return Dt(hf,!1,e,"options")}function df(e){return Dt(pf,!0,e,"payload")}const Hr={audience:"aud",issuer:"iss",subject:"sub",jwtid:"jti"},Ef=["expiresIn","notBefore","noTimestamp","audience","issuer","subject","jwtid"];var $f=function(e,t,r,n){typeof r=="function"?(n=r,r={}):r=r||{};const s=typeof e=="object"&&!Buffer.isBuffer(e),i=Object.assign({alg:r.algorithm||"HS256",typ:s?"JWT":void 0,kid:r.keyid},r.header);function c(o){if(n)return n(o);throw o}if(!t&&r.algorithm!=="none")return c(new Error("secretOrPrivateKey must have a value"));if(t!=null&&!(t instanceof ff))try{t=lf(t)}catch{try{t=uf(typeof t=="string"?Buffer.from(t):t)}catch{return c(new Error("secretOrPrivateKey is not valid key material"))}}if(i.alg.startsWith("HS")&&t.type!=="secret")return c(new Error(`secretOrPrivateKey must be a symmetric key when using ${i.alg}`));if(/^(?:RS|PS|ES)/.test(i.alg)){if(t.type!=="private")return c(new Error(`secretOrPrivateKey must be an asymmetric key when using ${i.alg}`));if(!r.allowInsecureKeySizes&&!i.alg.startsWith("ES")&&t.asymmetricKeyDetails!==void 0&&t.asymmetricKeyDetails.modulusLength<2048)return c(new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${i.alg}`))}if(typeof e>"u")return c(new Error("payload is required"));if(s){try{df(e)}catch(o){return c(o)}r.mutatePayload||(e=Object.assign({},e))}else{const o=Ef.filter(function(f){return typeof r[f]<"u"});if(o.length>0)return c(new Error("invalid "+o.join(",")+" option for "+typeof e+" payload"))}if(typeof e.exp<"u"&&typeof r.expiresIn<"u")return c(new Error('Bad "options.expiresIn" option the payload already has an "exp" property.'));if(typeof e.nbf<"u"&&typeof r.notBefore<"u")return c(new Error('Bad "options.notBefore" option the payload already has an "nbf" property.'));try{mf(r)}catch(o){return c(o)}if(!r.allowInvalidAsymmetricKeyTypes)try{of(i.alg,t)}catch(o){return c(o)}const l=e.iat||Math.floor(Date.now()/1e3);if(r.noTimestamp?delete e.iat:s&&(e.iat=l),typeof r.notBefore<"u"){try{e.nbf=Vr(r.notBefore,l)}catch(o){return c(o)}if(typeof e.nbf>"u")return c(new Error('"notBefore" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}if(typeof r.expiresIn<"u"&&typeof e=="object"){try{e.exp=Vr(r.expiresIn,l)}catch(o){return c(o)}if(typeof e.exp>"u")return c(new Error('"expiresIn" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}Object.keys(Hr).forEach(function(o){const f=Hr[o];if(typeof r[o]<"u"){if(typeof e[f]<"u")return c(new Error('Bad "options.'+o+'" option. The payload already has an "'+f+'" property.'));e[f]=r[o]}});const a=r.encoding||"utf8";if(typeof n=="function")n=n&&cf(n),kr.createSign({header:i,privateKey:t,payload:e,encoding:a}).once("error",n).once("done",function(o){if(!r.allowInsecureKeySizes&&/^(?:RS|PS)/.test(i.alg)&&o.length<256)return n(new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${i.alg}`));n(null,o)});else{let o=kr.sign({header:i,payload:e,secret:t,encoding:a});if(!r.allowInsecureKeySizes&&/^(?:RS|PS)/.test(i.alg)&&o.length<256)throw new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${i.alg}`);return o}},yf={decode:mt,verify:ca,sign:$f,JsonWebTokenError:ve,NotBeforeError:Et,TokenExpiredError:yt};const Mr=Wt(yf);class Ct{constructor(t){nr(this,"secretPrivateKey","secretPrivateKey");this.secretPrivateKey=t}createAccessToken(t,r,n=30){return Mr.sign({[t]:r},this.secretPrivateKey,{expiresIn:60*60*24*n})}verifyAccessToken(t){return Mr.verify(t,this.secretPrivateKey)}}const gf=Object.freeze(Object.defineProperty({__proto__:null,Token:Ct},Symbol.toStringTag,{value:"Module"}));exports.Token=Ct;exports.token=gf;
|
|
3
|
+
"HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".`,Q="secret must be a string or buffer",M="key must be a string or a buffer",En="key must be a string, a buffer or an object",He=typeof G.createPublicKey=="function";He&&(M+=" or a KeyObject",Q+="or a KeyObject");function zr(e){if(!X.isBuffer(e)&&typeof e!="string"&&(!He||typeof e!="object"||typeof e.type!="string"||typeof e.asymmetricKeyType!="string"||typeof e.export!="function"))throw x(M)}function Zr(e){if(!X.isBuffer(e)&&typeof e!="string"&&typeof e!="object")throw x(En)}function $n(e){if(!X.isBuffer(e)){if(typeof e=="string")return e;if(!He||typeof e!="object"||e.type!=="secret"||typeof e.export!="function")throw x(Q)}}function Me(e){return e.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function Qr(e){e=e.toString();var t=4-e.length%4;if(t!==4)for(var r=0;r<t;++r)e+="=";return e.replace(/\-/g,"+").replace(/_/g,"/")}function x(e){var t=[].slice.call(arguments,1),r=ir.format.bind(ir,e).apply(null,t);return new TypeError(r)}function yn(e){return X.isBuffer(e)||typeof e=="string"}function te(e){return yn(e)||(e=JSON.stringify(e)),e}function et(e){return function(r,n){$n(n),r=te(r);var s=G.createHmac("sha"+e,n),i=(s.update(r),s.digest("base64"));return Me(i)}}function gn(e){return function(r,n,s){var i=et(e)(r,s);return mn(X.from(n),X.from(i))}}function rt(e){return function(r,n){Zr(n),r=te(r);var s=G.createSign("RSA-SHA"+e),i=(s.update(r),s.sign(n,"base64"));return Me(i)}}function tt(e){return function(r,n,s){zr(s),r=te(r),n=Qr(n);var i=G.createVerify("RSA-SHA"+e);return i.update(r),i.verify(s,n,"base64")}}function Sn(e){return function(r,n){Zr(n),r=te(r);var s=G.createSign("RSA-SHA"+e),i=(s.update(r),s.sign({key:n,padding:G.constants.RSA_PKCS1_PSS_PADDING,saltLength:G.constants.RSA_PSS_SALTLEN_DIGEST},"base64"));return Me(i)}}function vn(e){return function(r,n,s){zr(s),r=te(r),n=Qr(n);var i=G.createVerify("RSA-SHA"+e);return i.update(r),i.verify({key:s,padding:G.constants.RSA_PKCS1_PSS_PADDING,saltLength:G.constants.RSA_PSS_SALTLEN_DIGEST},n,"base64")}}function wn(e){var t=rt(e);return function(){var n=t.apply(null,arguments);return n=Yr.derToJose(n,"ES"+e),n}}function bn(e){var t=tt(e);return function(n,s,i){s=Yr.joseToDer(s,"ES"+e).toString("base64");var c=t(n,s,i);return c}}function In(){return function(){return""}}function Rn(){return function(t,r){return r===""}}var nt=function(t){var r={hs:et,rs:rt,ps:Sn,es:wn,none:In},n={hs:gn,rs:tt,ps:vn,es:bn,none:Rn},s=t.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/i);if(!s)throw x(dn,t);var i=(s[1]||s[3]).toLowerCase(),c=s[2];return{sign:r[i](c),verify:n[i](c)}},Tn=j.Buffer,st=function(t){return typeof t=="string"?t:typeof t=="number"||Tn.isBuffer(t)?t.toString():JSON.stringify(t)},An=re.Buffer,or=Xr,On=nt,Nn=j,ar=st,Xe=j;function cr(e,t){return An.from(e,t).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function Ln(e,t,r){r=r||"utf8";var n=cr(ar(e),"binary"),s=cr(ar(t),r);return Xe.format("%s.%s",n,s)}function it(e){var t=e.header,r=e.payload,n=e.secret||e.privateKey,s=e.encoding,i=On(t.alg),c=Ln(t,r,s),l=i.sign(c,n);return Xe.format("%s.%s",c,l)}function ge(e){var t=e.secret||e.privateKey||e.key,r=new or(t);this.readable=!0,this.header=e.header,this.encoding=e.encoding,this.secret=this.privateKey=this.key=r,this.payload=new or(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))}Xe.inherits(ge,Nn);ge.prototype.sign=function(){try{var t=it({header:this.header,payload:this.payload.buffer,secret:this.secret.buffer,encoding:this.encoding});return this.emit("done",t),this.emit("data",t),this.emit("end"),this.readable=!1,t}catch(r){this.readable=!1,this.emit("error",r),this.emit("close")}};ge.sign=it;var jn=ge,ot=re.Buffer,fr=Xr,Pn=nt,_n=j,at=st,xn=j,Dn=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function Cn(e){return Object.prototype.toString.call(e)==="[object Object]"}function Bn(e){if(Cn(e))return e;try{return JSON.parse(e)}catch{return}}function ct(e){var t=e.split(".",1)[0];return Bn(ot.from(t,"base64").toString("binary"))}function Gn(e){return e.split(".",2).join(".")}function ft(e){return e.split(".")[2]}function Fn(e,t){t=t||"utf8";var r=e.split(".")[1];return ot.from(r,"base64").toString(t)}function ut(e){return Dn.test(e)&&!!ct(e)}function lt(e,t,r){if(!t){var n=new Error("Missing algorithm parameter for jws.verify");throw n.code="MISSING_ALGORITHM",n}e=at(e);var s=ft(e),i=Gn(e),c=Pn(t);return c.verify(i,s,r)}function ht(e,t){if(t=t||{},e=at(e),!ut(e))return null;var r=ct(e);if(!r)return null;var n=Fn(e);return(r.typ==="JWT"||t.json)&&(n=JSON.parse(n,t.encoding)),{header:r,payload:n,signature:ft(e)}}function J(e){e=e||{};var t=e.secret||e.publicKey||e.key,r=new fr(t);this.readable=!0,this.algorithm=e.algorithm,this.encoding=e.encoding,this.secret=this.publicKey=this.key=r,this.signature=new fr(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))}xn.inherits(J,_n);J.prototype.verify=function(){try{var t=lt(this.signature.buffer,this.algorithm,this.key.buffer),r=ht(this.signature.buffer,this.encoding);return this.emit("done",t,r),this.emit("data",t),this.emit("end"),this.readable=!1,t}catch(n){this.readable=!1,this.emit("error",n),this.emit("close")}};J.decode=ht;J.isValid=ut;J.verify=lt;var Vn=J,pt=jn,Se=Vn,kn=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"];F.ALGORITHMS=kn;F.sign=pt.sign;F.verify=Se.verify;F.decode=Se.decode;F.isValid=Se.isValid;F.createSign=function(t){return new pt(t)};F.createVerify=function(t){return new Se(t)};var Un=F,mt=function(e,t){t=t||{};var r=Un.decode(e,t);if(!r)return null;var n=r.payload;if(typeof n=="string")try{var s=JSON.parse(n);s!==null&&typeof s=="object"&&(n=s)}catch{}return t.complete===!0?{header:r.header,payload:n,signature:r.signature}:n},de=function(e,t){Error.call(this,e),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name="JsonWebTokenError",this.message=e,t&&(this.inner=t)};de.prototype=Object.create(Error.prototype);de.prototype.constructor=de;var ve=de,dt=ve,Ee=function(e,t){dt.call(this,e),this.name="NotBeforeError",this.date=t};Ee.prototype=Object.create(dt.prototype);Ee.prototype.constructor=Ee;var Et=Ee,$t=ve,$e=function(e,t){$t.call(this,e),this.name="TokenExpiredError",this.expiredAt=t};$e.prototype=Object.create($t.prototype);$e.prototype.constructor=$e;var yt=$e,K=1e3,q=K*60,W=q*60,U=W*24,Hn=U*7,Mn=U*365.25,Xn=function(e,t){t=t||{};var r=typeof e;if(r==="string"&&e.length>0)return Kn(e);if(r==="number"&&isFinite(e))return t.long?Wn(e):qn(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function Kn(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var r=parseFloat(t[1]),n=(t[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*Mn;case"weeks":case"week":case"w":return r*Hn;case"days":case"day":case"d":return r*U;case"hours":case"hour":case"hrs":case"hr":case"h":return r*W;case"minutes":case"minute":case"mins":case"min":case"m":return r*q;case"seconds":case"second":case"secs":case"sec":case"s":return r*K;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function qn(e){var t=Math.abs(e);return t>=U?Math.round(e/U)+"d":t>=W?Math.round(e/W)+"h":t>=q?Math.round(e/q)+"m":t>=K?Math.round(e/K)+"s":e+"ms"}function Wn(e){var t=Math.abs(e);return t>=U?se(e,t,U,"day"):t>=W?se(e,t,W,"hour"):t>=q?se(e,t,q,"minute"):t>=K?se(e,t,K,"second"):e+" ms"}function se(e,t,r,n){var s=t>=r*1.5;return Math.round(e/r)+" "+n+(s?"s":"")}var Jn=Xn,gt=function(e,t){var r=t||Math.floor(Date.now()/1e3);if(typeof e=="string"){var n=Jn(e);return typeof n>"u"?void 0:Math.floor(r+n/1e3)}else return typeof e=="number"?r+e:void 0},Ge={exports:{}};const Yn="2.0.0",St=256,zn=Number.MAX_SAFE_INTEGER||9007199254740991,Zn=16,Qn=St-6,es=["major","premajor","minor","preminor","patch","prepatch","prerelease"];var we={MAX_LENGTH:St,MAX_SAFE_COMPONENT_LENGTH:Zn,MAX_SAFE_BUILD_LENGTH:Qn,MAX_SAFE_INTEGER:zn,RELEASE_TYPES:es,SEMVER_SPEC_VERSION:Yn,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2};const rs=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};var be=rs;(function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:s}=we,i=be;t=e.exports={};const c=t.re=[],l=t.safeRe=[],a=t.src=[],o=t.t={};let f=0;const u="[a-zA-Z0-9-]",w=[["\\s",1],["\\d",s],[u,n]],m=R=>{for(const[L,V]of w)R=R.split(`${L}*`).join(`${L}{0,${V}}`).split(`${L}+`).join(`${L}{1,${V}}`);return R},h=(R,L,V)=>{const A=m(L),_=f++;i(R,_,L),o[R]=_,a[_]=L,c[_]=new RegExp(L,V?"g":void 0),l[_]=new RegExp(A,V?"g":void 0)};h("NUMERICIDENTIFIER","0|[1-9]\\d*"),h("NUMERICIDENTIFIERLOOSE","\\d+"),h("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${u}*`),h("MAINVERSION",`(${a[o.NUMERICIDENTIFIER]})\\.(${a[o.NUMERICIDENTIFIER]})\\.(${a[o.NUMERICIDENTIFIER]})`),h("MAINVERSIONLOOSE",`(${a[o.NUMERICIDENTIFIERLOOSE]})\\.(${a[o.NUMERICIDENTIFIERLOOSE]})\\.(${a[o.NUMERICIDENTIFIERLOOSE]})`),h("PRERELEASEIDENTIFIER",`(?:${a[o.NUMERICIDENTIFIER]}|${a[o.NONNUMERICIDENTIFIER]})`),h("PRERELEASEIDENTIFIERLOOSE",`(?:${a[o.NUMERICIDENTIFIERLOOSE]}|${a[o.NONNUMERICIDENTIFIER]})`),h("PRERELEASE",`(?:-(${a[o.PRERELEASEIDENTIFIER]}(?:\\.${a[o.PRERELEASEIDENTIFIER]})*))`),h("PRERELEASELOOSE",`(?:-?(${a[o.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${a[o.PRERELEASEIDENTIFIERLOOSE]})*))`),h("BUILDIDENTIFIER",`${u}+`),h("BUILD",`(?:\\+(${a[o.BUILDIDENTIFIER]}(?:\\.${a[o.BUILDIDENTIFIER]})*))`),h("FULLPLAIN",`v?${a[o.MAINVERSION]}${a[o.PRERELEASE]}?${a[o.BUILD]}?`),h("FULL",`^${a[o.FULLPLAIN]}$`),h("LOOSEPLAIN",`[v=\\s]*${a[o.MAINVERSIONLOOSE]}${a[o.PRERELEASELOOSE]}?${a[o.BUILD]}?`),h("LOOSE",`^${a[o.LOOSEPLAIN]}$`),h("GTLT","((?:<|>)?=?)"),h("XRANGEIDENTIFIERLOOSE",`${a[o.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),h("XRANGEIDENTIFIER",`${a[o.NUMERICIDENTIFIER]}|x|X|\\*`),h("XRANGEPLAIN",`[v=\\s]*(${a[o.XRANGEIDENTIFIER]})(?:\\.(${a[o.XRANGEIDENTIFIER]})(?:\\.(${a[o.XRANGEIDENTIFIER]})(?:${a[o.PRERELEASE]})?${a[o.BUILD]}?)?)?`),h("XRANGEPLAINLOOSE",`[v=\\s]*(${a[o.XRANGEIDENTIFIERLOOSE]})(?:\\.(${a[o.XRANGEIDENTIFIERLOOSE]})(?:\\.(${a[o.XRANGEIDENTIFIERLOOSE]})(?:${a[o.PRERELEASELOOSE]})?${a[o.BUILD]}?)?)?`),h("XRANGE",`^${a[o.GTLT]}\\s*${a[o.XRANGEPLAIN]}$`),h("XRANGELOOSE",`^${a[o.GTLT]}\\s*${a[o.XRANGEPLAINLOOSE]}$`),h("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),h("COERCE",`${a[o.COERCEPLAIN]}(?:$|[^\\d])`),h("COERCEFULL",a[o.COERCEPLAIN]+`(?:${a[o.PRERELEASE]})?(?:${a[o.BUILD]})?(?:$|[^\\d])`),h("COERCERTL",a[o.COERCE],!0),h("COERCERTLFULL",a[o.COERCEFULL],!0),h("LONETILDE","(?:~>?)"),h("TILDETRIM",`(\\s*)${a[o.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",h("TILDE",`^${a[o.LONETILDE]}${a[o.XRANGEPLAIN]}$`),h("TILDELOOSE",`^${a[o.LONETILDE]}${a[o.XRANGEPLAINLOOSE]}$`),h("LONECARET","(?:\\^)"),h("CARETTRIM",`(\\s*)${a[o.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",h("CARET",`^${a[o.LONECARET]}${a[o.XRANGEPLAIN]}$`),h("CARETLOOSE",`^${a[o.LONECARET]}${a[o.XRANGEPLAINLOOSE]}$`),h("COMPARATORLOOSE",`^${a[o.GTLT]}\\s*(${a[o.LOOSEPLAIN]})$|^$`),h("COMPARATOR",`^${a[o.GTLT]}\\s*(${a[o.FULLPLAIN]})$|^$`),h("COMPARATORTRIM",`(\\s*)${a[o.GTLT]}\\s*(${a[o.LOOSEPLAIN]}|${a[o.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",h("HYPHENRANGE",`^\\s*(${a[o.XRANGEPLAIN]})\\s+-\\s+(${a[o.XRANGEPLAIN]})\\s*$`),h("HYPHENRANGELOOSE",`^\\s*(${a[o.XRANGEPLAINLOOSE]})\\s+-\\s+(${a[o.XRANGEPLAINLOOSE]})\\s*$`),h("STAR","(<|>)?=?\\s*\\*"),h("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),h("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(Ge,Ge.exports);var ne=Ge.exports;const ts=Object.freeze({loose:!0}),ns=Object.freeze({}),ss=e=>e?typeof e!="object"?ts:e:ns;var Ke=ss;const ur=/^[0-9]+$/,vt=(e,t)=>{const r=ur.test(e),n=ur.test(t);return r&&n&&(e=+e,t=+t),e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1},is=(e,t)=>vt(t,e);var wt={compareIdentifiers:vt,rcompareIdentifiers:is};const ie=be,{MAX_LENGTH:lr,MAX_SAFE_INTEGER:oe}=we,{safeRe:hr,t:pr}=ne,os=Ke,{compareIdentifiers:H}=wt;let as=class B{constructor(t,r){if(r=os(r),t instanceof B){if(t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease)return t;t=t.version}else if(typeof t!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>lr)throw new TypeError(`version is longer than ${lr} characters`);ie("SemVer",t,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;const n=t.trim().match(r.loose?hr[pr.LOOSE]:hr[pr.FULL]);if(!n)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>oe||this.major<0)throw new TypeError("Invalid major version");if(this.minor>oe||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>oe||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(s=>{if(/^[0-9]+$/.test(s)){const i=+s;if(i>=0&&i<oe)return i}return s}):this.prerelease=[],this.build=n[5]?n[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(t){if(ie("SemVer.compare",this.version,this.options,t),!(t instanceof B)){if(typeof t=="string"&&t===this.version)return 0;t=new B(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof B||(t=new B(t,this.options)),H(this.major,t.major)||H(this.minor,t.minor)||H(this.patch,t.patch)}comparePre(t){if(t instanceof B||(t=new B(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{const n=this.prerelease[r],s=t.prerelease[r];if(ie("prerelease compare",r,n,s),n===void 0&&s===void 0)return 0;if(s===void 0)return 1;if(n===void 0)return-1;if(n===s)continue;return H(n,s)}while(++r)}compareBuild(t){t instanceof B||(t=new B(t,this.options));let r=0;do{const n=this.build[r],s=t.build[r];if(ie("build compare",r,n,s),n===void 0&&s===void 0)return 0;if(s===void 0)return 1;if(n===void 0)return-1;if(n===s)continue;return H(n,s)}while(++r)}inc(t,r,n){switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,n),this.inc("pre",r,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,n),this.inc("pre",r,n);break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const s=Number(n)?1:0;if(!r&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(this.prerelease.length===0)this.prerelease=[s];else{let i=this.prerelease.length;for(;--i>=0;)typeof this.prerelease[i]=="number"&&(this.prerelease[i]++,i=-2);if(i===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(s)}}if(r){let i=[r,s];n===!1&&(i=[r]),H(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=i):this.prerelease=i}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};var N=as;const mr=N,cs=(e,t,r=!1)=>{if(e instanceof mr)return e;try{return new mr(e,t)}catch(n){if(!r)return null;throw n}};var Y=cs;const fs=Y,us=(e,t)=>{const r=fs(e,t);return r?r.version:null};var ls=us;const hs=Y,ps=(e,t)=>{const r=hs(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};var ms=ps;const dr=N,ds=(e,t,r,n,s)=>{typeof r=="string"&&(s=n,n=r,r=void 0);try{return new dr(e instanceof dr?e.version:e,r).inc(t,n,s).version}catch{return null}};var Es=ds;const Er=Y,$s=(e,t)=>{const r=Er(e,null,!0),n=Er(t,null,!0),s=r.compare(n);if(s===0)return null;const i=s>0,c=i?r:n,l=i?n:r,a=!!c.prerelease.length;if(!!l.prerelease.length&&!a)return!l.patch&&!l.minor?"major":c.patch?"patch":c.minor?"minor":"major";const f=a?"pre":"";return r.major!==n.major?f+"major":r.minor!==n.minor?f+"minor":r.patch!==n.patch?f+"patch":"prerelease"};var ys=$s;const gs=N,Ss=(e,t)=>new gs(e,t).major;var vs=Ss;const ws=N,bs=(e,t)=>new ws(e,t).minor;var Is=bs;const Rs=N,Ts=(e,t)=>new Rs(e,t).patch;var As=Ts;const Os=Y,Ns=(e,t)=>{const r=Os(e,t);return r&&r.prerelease.length?r.prerelease:null};var Ls=Ns;const $r=N,js=(e,t,r)=>new $r(e,r).compare(new $r(t,r));var D=js;const Ps=D,_s=(e,t,r)=>Ps(t,e,r);var xs=_s;const Ds=D,Cs=(e,t)=>Ds(e,t,!0);var Bs=Cs;const yr=N,Gs=(e,t,r)=>{const n=new yr(e,r),s=new yr(t,r);return n.compare(s)||n.compareBuild(s)};var qe=Gs;const Fs=qe,Vs=(e,t)=>e.sort((r,n)=>Fs(r,n,t));var ks=Vs;const Us=qe,Hs=(e,t)=>e.sort((r,n)=>Us(n,r,t));var Ms=Hs;const Xs=D,Ks=(e,t,r)=>Xs(e,t,r)>0;var Ie=Ks;const qs=D,Ws=(e,t,r)=>qs(e,t,r)<0;var We=Ws;const Js=D,Ys=(e,t,r)=>Js(e,t,r)===0;var bt=Ys;const zs=D,Zs=(e,t,r)=>zs(e,t,r)!==0;var It=Zs;const Qs=D,ei=(e,t,r)=>Qs(e,t,r)>=0;var Je=ei;const ri=D,ti=(e,t,r)=>ri(e,t,r)<=0;var Ye=ti;const ni=bt,si=It,ii=Ie,oi=Je,ai=We,ci=Ye,fi=(e,t,r,n)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e===r;case"!==":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e!==r;case"":case"=":case"==":return ni(e,r,n);case"!=":return si(e,r,n);case">":return ii(e,r,n);case">=":return oi(e,r,n);case"<":return ai(e,r,n);case"<=":return ci(e,r,n);default:throw new TypeError(`Invalid operator: ${t}`)}};var Rt=fi;const ui=N,li=Y,{safeRe:ae,t:ce}=ne,hi=(e,t)=>{if(e instanceof ui)return e;if(typeof e=="number"&&(e=String(e)),typeof e!="string")return null;t=t||{};let r=null;if(!t.rtl)r=e.match(t.includePrerelease?ae[ce.COERCEFULL]:ae[ce.COERCE]);else{const a=t.includePrerelease?ae[ce.COERCERTLFULL]:ae[ce.COERCERTL];let o;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}if(r===null)return null;const n=r[2],s=r[3]||"0",i=r[4]||"0",c=t.includePrerelease&&r[5]?`-${r[5]}`:"",l=t.includePrerelease&&r[6]?`+${r[6]}`:"";return li(`${n}.${s}.${i}${c}${l}`,t)};var pi=hi;class mi{constructor(){this.max=1e3,this.map=new Map}get(t){const r=this.map.get(t);if(r!==void 0)return this.map.delete(t),this.map.set(t,r),r}delete(t){return this.map.delete(t)}set(t,r){if(!this.delete(t)&&r!==void 0){if(this.map.size>=this.max){const s=this.map.keys().next().value;this.delete(s)}this.map.set(t,r)}return this}}var di=mi,je,gr;function C(){if(gr)return je;gr=1;class e{constructor(p,g){if(g=n(g),p instanceof e)return p.loose===!!g.loose&&p.includePrerelease===!!g.includePrerelease?p:new e(p.raw,g);if(p instanceof s)return this.raw=p.value,this.set=[[p]],this.format(),this;if(this.options=g,this.loose=!!g.loose,this.includePrerelease=!!g.includePrerelease,this.raw=p.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map($=>this.parseRange($.trim())).filter($=>$.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const $=this.set[0];if(this.set=this.set.filter(y=>!h(y[0])),this.set.length===0)this.set=[$];else if(this.set.length>1){for(const y of this.set)if(y.length===1&&R(y[0])){this.set=[y];break}}}this.format()}format(){return this.range=this.set.map(p=>p.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(p){const $=((this.options.includePrerelease&&w)|(this.options.loose&&m))+":"+p,y=r.get($);if(y)return y;const E=this.options.loose,S=E?l[a.HYPHENRANGELOOSE]:l[a.HYPHENRANGE];p=p.replace(S,Mt(this.options.includePrerelease)),i("hyphen replace",p),p=p.replace(l[a.COMPARATORTRIM],o),i("comparator trim",p),p=p.replace(l[a.TILDETRIM],f),i("tilde trim",p),p=p.replace(l[a.CARETTRIM],u),i("caret trim",p);let b=p.split(" ").map(O=>V(O,this.options)).join(" ").split(/\s+/).map(O=>Ht(O,this.options));E&&(b=b.filter(O=>(i("loose invalid filter",O,this.options),!!O.match(l[a.COMPARATORLOOSE])))),i("range list",b);const v=new Map,T=b.map(O=>new s(O,this.options));for(const O of T){if(h(O))return[O];v.set(O.value,O)}v.size>1&&v.has("")&&v.delete("");const P=[...v.values()];return r.set($,P),P}intersects(p,g){if(!(p instanceof e))throw new TypeError("a Range is required");return this.set.some($=>L($,g)&&p.set.some(y=>L(y,g)&&$.every(E=>y.every(S=>E.intersects(S,g)))))}test(p){if(!p)return!1;if(typeof p=="string")try{p=new c(p,this.options)}catch{return!1}for(let g=0;g<this.set.length;g++)if(Xt(this.set[g],p,this.options))return!0;return!1}}je=e;const t=di,r=new t,n=Ke,s=Re(),i=be,c=N,{safeRe:l,t:a,comparatorTrimReplace:o,tildeTrimReplace:f,caretTrimReplace:u}=ne,{FLAG_INCLUDE_PRERELEASE:w,FLAG_LOOSE:m}=we,h=d=>d.value==="<0.0.0-0",R=d=>d.value==="",L=(d,p)=>{let g=!0;const $=d.slice();let y=$.pop();for(;g&&$.length;)g=$.every(E=>y.intersects(E,p)),y=$.pop();return g},V=(d,p)=>(i("comp",d,p),d=Gt(d,p),i("caret",d),d=_(d,p),i("tildes",d),d=Vt(d,p),i("xrange",d),d=Ut(d,p),i("stars",d),d),A=d=>!d||d.toLowerCase()==="x"||d==="*",_=(d,p)=>d.trim().split(/\s+/).map(g=>Bt(g,p)).join(" "),Bt=(d,p)=>{const g=p.loose?l[a.TILDELOOSE]:l[a.TILDE];return d.replace(g,($,y,E,S,b)=>{i("tilde",d,$,y,E,S,b);let v;return A(y)?v="":A(E)?v=`>=${y}.0.0 <${+y+1}.0.0-0`:A(S)?v=`>=${y}.${E}.0 <${y}.${+E+1}.0-0`:b?(i("replaceTilde pr",b),v=`>=${y}.${E}.${S}-${b} <${y}.${+E+1}.0-0`):v=`>=${y}.${E}.${S} <${y}.${+E+1}.0-0`,i("tilde return",v),v})},Gt=(d,p)=>d.trim().split(/\s+/).map(g=>Ft(g,p)).join(" "),Ft=(d,p)=>{i("caret",d,p);const g=p.loose?l[a.CARETLOOSE]:l[a.CARET],$=p.includePrerelease?"-0":"";return d.replace(g,(y,E,S,b,v)=>{i("caret",d,y,E,S,b,v);let T;return A(E)?T="":A(S)?T=`>=${E}.0.0${$} <${+E+1}.0.0-0`:A(b)?E==="0"?T=`>=${E}.${S}.0${$} <${E}.${+S+1}.0-0`:T=`>=${E}.${S}.0${$} <${+E+1}.0.0-0`:v?(i("replaceCaret pr",v),E==="0"?S==="0"?T=`>=${E}.${S}.${b}-${v} <${E}.${S}.${+b+1}-0`:T=`>=${E}.${S}.${b}-${v} <${E}.${+S+1}.0-0`:T=`>=${E}.${S}.${b}-${v} <${+E+1}.0.0-0`):(i("no pr"),E==="0"?S==="0"?T=`>=${E}.${S}.${b}${$} <${E}.${S}.${+b+1}-0`:T=`>=${E}.${S}.${b}${$} <${E}.${+S+1}.0-0`:T=`>=${E}.${S}.${b} <${+E+1}.0.0-0`),i("caret return",T),T})},Vt=(d,p)=>(i("replaceXRanges",d,p),d.split(/\s+/).map(g=>kt(g,p)).join(" ")),kt=(d,p)=>{d=d.trim();const g=p.loose?l[a.XRANGELOOSE]:l[a.XRANGE];return d.replace(g,($,y,E,S,b,v)=>{i("xRange",d,$,y,E,S,b,v);const T=A(E),P=T||A(S),O=P||A(b),z=O;return y==="="&&z&&(y=""),v=p.includePrerelease?"-0":"",T?y===">"||y==="<"?$="<0.0.0-0":$="*":y&&z?(P&&(S=0),b=0,y===">"?(y=">=",P?(E=+E+1,S=0,b=0):(S=+S+1,b=0)):y==="<="&&(y="<",P?E=+E+1:S=+S+1),y==="<"&&(v="-0"),$=`${y+E}.${S}.${b}${v}`):P?$=`>=${E}.0.0${v} <${+E+1}.0.0-0`:O&&($=`>=${E}.${S}.0${v} <${E}.${+S+1}.0-0`),i("xRange return",$),$})},Ut=(d,p)=>(i("replaceStars",d,p),d.trim().replace(l[a.STAR],"")),Ht=(d,p)=>(i("replaceGTE0",d,p),d.trim().replace(l[p.includePrerelease?a.GTE0PRE:a.GTE0],"")),Mt=d=>(p,g,$,y,E,S,b,v,T,P,O,z)=>(A($)?g="":A(y)?g=`>=${$}.0.0${d?"-0":""}`:A(E)?g=`>=${$}.${y}.0${d?"-0":""}`:S?g=`>=${g}`:g=`>=${g}${d?"-0":""}`,A(T)?v="":A(P)?v=`<${+T+1}.0.0-0`:A(O)?v=`<${T}.${+P+1}.0-0`:z?v=`<=${T}.${P}.${O}-${z}`:d?v=`<${T}.${P}.${+O+1}-0`:v=`<=${v}`,`${g} ${v}`.trim()),Xt=(d,p,g)=>{for(let $=0;$<d.length;$++)if(!d[$].test(p))return!1;if(p.prerelease.length&&!g.includePrerelease){for(let $=0;$<d.length;$++)if(i(d[$].semver),d[$].semver!==s.ANY&&d[$].semver.prerelease.length>0){const y=d[$].semver;if(y.major===p.major&&y.minor===p.minor&&y.patch===p.patch)return!0}return!1}return!0};return je}var Pe,Sr;function Re(){if(Sr)return Pe;Sr=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(f,u){if(u=r(u),f instanceof t){if(f.loose===!!u.loose)return f;f=f.value}f=f.trim().split(/\s+/).join(" "),c("comparator",f,u),this.options=u,this.loose=!!u.loose,this.parse(f),this.semver===e?this.value="":this.value=this.operator+this.semver.version,c("comp",this)}parse(f){const u=this.options.loose?n[s.COMPARATORLOOSE]:n[s.COMPARATOR],w=f.match(u);if(!w)throw new TypeError(`Invalid comparator: ${f}`);this.operator=w[1]!==void 0?w[1]:"",this.operator==="="&&(this.operator=""),w[2]?this.semver=new l(w[2],this.options.loose):this.semver=e}toString(){return this.value}test(f){if(c("Comparator.test",f,this.options.loose),this.semver===e||f===e)return!0;if(typeof f=="string")try{f=new l(f,this.options)}catch{return!1}return i(f,this.operator,this.semver,this.options)}intersects(f,u){if(!(f instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new a(f.value,u).test(this.value):f.operator===""?f.value===""?!0:new a(this.value,u).test(f.semver):(u=r(u),u.includePrerelease&&(this.value==="<0.0.0-0"||f.value==="<0.0.0-0")||!u.includePrerelease&&(this.value.startsWith("<0.0.0")||f.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&f.operator.startsWith(">")||this.operator.startsWith("<")&&f.operator.startsWith("<")||this.semver.version===f.semver.version&&this.operator.includes("=")&&f.operator.includes("=")||i(this.semver,"<",f.semver,u)&&this.operator.startsWith(">")&&f.operator.startsWith("<")||i(this.semver,">",f.semver,u)&&this.operator.startsWith("<")&&f.operator.startsWith(">")))}}Pe=t;const r=Ke,{safeRe:n,t:s}=ne,i=Rt,c=be,l=N,a=C();return Pe}const Ei=C(),$i=(e,t,r)=>{try{t=new Ei(t,r)}catch{return!1}return t.test(e)};var Te=$i;const yi=C(),gi=(e,t)=>new yi(e,t).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));var Si=gi;const vi=N,wi=C(),bi=(e,t,r)=>{let n=null,s=null,i=null;try{i=new wi(t,r)}catch{return null}return e.forEach(c=>{i.test(c)&&(!n||s.compare(c)===-1)&&(n=c,s=new vi(n,r))}),n};var Ii=bi;const Ri=N,Ti=C(),Ai=(e,t,r)=>{let n=null,s=null,i=null;try{i=new Ti(t,r)}catch{return null}return e.forEach(c=>{i.test(c)&&(!n||s.compare(c)===1)&&(n=c,s=new Ri(n,r))}),n};var Oi=Ai;const _e=N,Ni=C(),vr=Ie,Li=(e,t)=>{e=new Ni(e,t);let r=new _e("0.0.0");if(e.test(r)||(r=new _e("0.0.0-0"),e.test(r)))return r;r=null;for(let n=0;n<e.set.length;++n){const s=e.set[n];let i=null;s.forEach(c=>{const l=new _e(c.semver.version);switch(c.operator){case">":l.prerelease.length===0?l.patch++:l.prerelease.push(0),l.raw=l.format();case"":case">=":(!i||vr(l,i))&&(i=l);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${c.operator}`)}}),i&&(!r||vr(r,i))&&(r=i)}return r&&e.test(r)?r:null};var ji=Li;const Pi=C(),_i=(e,t)=>{try{return new Pi(e,t).range||"*"}catch{return null}};var xi=_i;const Di=N,Tt=Re(),{ANY:Ci}=Tt,Bi=C(),Gi=Te,wr=Ie,br=We,Fi=Ye,Vi=Je,ki=(e,t,r,n)=>{e=new Di(e,n),t=new Bi(t,n);let s,i,c,l,a;switch(r){case">":s=wr,i=Fi,c=br,l=">",a=">=";break;case"<":s=br,i=Vi,c=wr,l="<",a="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Gi(e,t,n))return!1;for(let o=0;o<t.set.length;++o){const f=t.set[o];let u=null,w=null;if(f.forEach(m=>{m.semver===Ci&&(m=new Tt(">=0.0.0")),u=u||m,w=w||m,s(m.semver,u.semver,n)?u=m:c(m.semver,w.semver,n)&&(w=m)}),u.operator===l||u.operator===a||(!w.operator||w.operator===l)&&i(e,w.semver))return!1;if(w.operator===a&&c(e,w.semver))return!1}return!0};var ze=ki;const Ui=ze,Hi=(e,t,r)=>Ui(e,t,">",r);var Mi=Hi;const Xi=ze,Ki=(e,t,r)=>Xi(e,t,"<",r);var qi=Ki;const Ir=C(),Wi=(e,t,r)=>(e=new Ir(e,r),t=new Ir(t,r),e.intersects(t,r));var Ji=Wi;const Yi=Te,zi=D;var Zi=(e,t,r)=>{const n=[];let s=null,i=null;const c=e.sort((f,u)=>zi(f,u,r));for(const f of c)Yi(f,t,r)?(i=f,s||(s=f)):(i&&n.push([s,i]),i=null,s=null);s&&n.push([s,null]);const l=[];for(const[f,u]of n)f===u?l.push(f):!u&&f===c[0]?l.push("*"):u?f===c[0]?l.push(`<=${u}`):l.push(`${f} - ${u}`):l.push(`>=${f}`);const a=l.join(" || "),o=typeof t.raw=="string"?t.raw:String(t);return a.length<o.length?a:t};const Rr=C(),Ze=Re(),{ANY:xe}=Ze,Z=Te,Qe=D,Qi=(e,t,r={})=>{if(e===t)return!0;e=new Rr(e,r),t=new Rr(t,r);let n=!1;e:for(const s of e.set){for(const i of t.set){const c=ro(s,i,r);if(n=n||c!==null,c)continue e}if(n)return!1}return!0},eo=[new Ze(">=0.0.0-0")],Tr=[new Ze(">=0.0.0")],ro=(e,t,r)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===xe){if(t.length===1&&t[0].semver===xe)return!0;r.includePrerelease?e=eo:e=Tr}if(t.length===1&&t[0].semver===xe){if(r.includePrerelease)return!0;t=Tr}const n=new Set;let s,i;for(const m of e)m.operator===">"||m.operator===">="?s=Ar(s,m,r):m.operator==="<"||m.operator==="<="?i=Or(i,m,r):n.add(m.semver);if(n.size>1)return null;let c;if(s&&i){if(c=Qe(s.semver,i.semver,r),c>0)return null;if(c===0&&(s.operator!==">="||i.operator!=="<="))return null}for(const m of n){if(s&&!Z(m,String(s),r)||i&&!Z(m,String(i),r))return null;for(const h of t)if(!Z(m,String(h),r))return!1;return!0}let l,a,o,f,u=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1,w=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1;u&&u.prerelease.length===1&&i.operator==="<"&&u.prerelease[0]===0&&(u=!1);for(const m of t){if(f=f||m.operator===">"||m.operator===">=",o=o||m.operator==="<"||m.operator==="<=",s){if(w&&m.semver.prerelease&&m.semver.prerelease.length&&m.semver.major===w.major&&m.semver.minor===w.minor&&m.semver.patch===w.patch&&(w=!1),m.operator===">"||m.operator===">="){if(l=Ar(s,m,r),l===m&&l!==s)return!1}else if(s.operator===">="&&!Z(s.semver,String(m),r))return!1}if(i){if(u&&m.semver.prerelease&&m.semver.prerelease.length&&m.semver.major===u.major&&m.semver.minor===u.minor&&m.semver.patch===u.patch&&(u=!1),m.operator==="<"||m.operator==="<="){if(a=Or(i,m,r),a===m&&a!==i)return!1}else if(i.operator==="<="&&!Z(i.semver,String(m),r))return!1}if(!m.operator&&(i||s)&&c!==0)return!1}return!(s&&o&&!i&&c!==0||i&&f&&!s&&c!==0||w||u)},Ar=(e,t,r)=>{if(!e)return t;const n=Qe(e.semver,t.semver,r);return n>0?e:n<0||t.operator===">"&&e.operator===">="?t:e},Or=(e,t,r)=>{if(!e)return t;const n=Qe(e.semver,t.semver,r);return n<0?e:n>0||t.operator==="<"&&e.operator==="<="?t:e};var to=Qi;const De=ne,Nr=we,no=N,Lr=wt,so=Y,io=ls,oo=ms,ao=Es,co=ys,fo=vs,uo=Is,lo=As,ho=Ls,po=D,mo=xs,Eo=Bs,$o=qe,yo=ks,go=Ms,So=Ie,vo=We,wo=bt,bo=It,Io=Je,Ro=Ye,To=Rt,Ao=pi,Oo=Re(),No=C(),Lo=Te,jo=Si,Po=Ii,_o=Oi,xo=ji,Do=xi,Co=ze,Bo=Mi,Go=qi,Fo=Ji,Vo=Zi,ko=to;var er={parse:so,valid:io,clean:oo,inc:ao,diff:co,major:fo,minor:uo,patch:lo,prerelease:ho,compare:po,rcompare:mo,compareLoose:Eo,compareBuild:$o,sort:yo,rsort:go,gt:So,lt:vo,eq:wo,neq:bo,gte:Io,lte:Ro,cmp:To,coerce:Ao,Comparator:Oo,Range:No,satisfies:Lo,toComparators:jo,maxSatisfying:Po,minSatisfying:_o,minVersion:xo,validRange:Do,outside:Co,gtr:Bo,ltr:Go,intersects:Fo,simplifyRange:Vo,subset:ko,SemVer:no,re:De.re,src:De.src,tokens:De.t,SEMVER_SPEC_VERSION:Nr.SEMVER_SPEC_VERSION,RELEASE_TYPES:Nr.RELEASE_TYPES,compareIdentifiers:Lr.compareIdentifiers,rcompareIdentifiers:Lr.rcompareIdentifiers};const Uo=er;var Ho=Uo.satisfies(process.version,">=15.7.0");const Mo=er;var Xo=Mo.satisfies(process.version,">=16.9.0");const Ko=Ho,qo=Xo,Wo={ec:["ES256","ES384","ES512"],rsa:["RS256","PS256","RS384","PS384","RS512","PS512"],"rsa-pss":["PS256","PS384","PS512"]},Jo={ES256:"prime256v1",ES384:"secp384r1",ES512:"secp521r1"};var At=function(e,t){if(!e||!t)return;const r=t.asymmetricKeyType;if(!r)return;const n=Wo[r];if(!n)throw new Error(`Unknown key type "${r}".`);if(!n.includes(e))throw new Error(`"alg" parameter for "${r}" key type must be one of: ${n.join(", ")}.`);if(Ko)switch(r){case"ec":const s=t.asymmetricKeyDetails.namedCurve,i=Jo[e];if(s!==i)throw new Error(`"alg" parameter "${e}" requires curve "${i}".`);break;case"rsa-pss":if(qo){const c=parseInt(e.slice(-3),10),{hashAlgorithm:l,mgf1HashAlgorithm:a,saltLength:o}=t.asymmetricKeyDetails;if(l!==`sha${c}`||a!==l)throw new Error(`Invalid key for this operation, its RSA-PSS parameters do not meet the requirements of "alg" ${e}.`);if(o!==void 0&&o>c>>3)throw new Error(`Invalid key for this operation, its RSA-PSS parameter saltLength does not meet the requirements of "alg" ${e}.`)}break}},Yo=er,Ot=Yo.satisfies(process.version,"^6.12.0 || >=8.0.0");const I=ve,zo=Et,jr=yt,Zo=mt,Qo=gt,ea=At,ra=Ot,ta=F,{KeyObject:na,createSecretKey:sa,createPublicKey:ia}=j,Fe=["RS256","RS384","RS512"],oa=["ES256","ES384","ES512"],Ve=["RS256","RS384","RS512"],aa=["HS256","HS384","HS512"];ra&&(Fe.splice(Fe.length,0,"PS256","PS384","PS512"),Ve.splice(Ve.length,0,"PS256","PS384","PS512"));var ca=function(e,t,r,n){typeof r=="function"&&!n&&(n=r,r={}),r||(r={}),r=Object.assign({},r);let s;if(n?s=n:s=function(f,u){if(f)throw f;return u},r.clockTimestamp&&typeof r.clockTimestamp!="number")return s(new I("clockTimestamp must be a number"));if(r.nonce!==void 0&&(typeof r.nonce!="string"||r.nonce.trim()===""))return s(new I("nonce must be a non-empty string"));if(r.allowInvalidAsymmetricKeyTypes!==void 0&&typeof r.allowInvalidAsymmetricKeyTypes!="boolean")return s(new I("allowInvalidAsymmetricKeyTypes must be a boolean"));const i=r.clockTimestamp||Math.floor(Date.now()/1e3);if(!e)return s(new I("jwt must be provided"));if(typeof e!="string")return s(new I("jwt must be a string"));const c=e.split(".");if(c.length!==3)return s(new I("jwt malformed"));let l;try{l=Zo(e,{complete:!0})}catch(f){return s(f)}if(!l)return s(new I("invalid token"));const a=l.header;let o;if(typeof t=="function"){if(!n)return s(new I("verify must be called asynchronous if secret or public key is provided as a callback"));o=t}else o=function(f,u){return u(null,t)};return o(a,function(f,u){if(f)return s(new I("error in secret or public key callback: "+f.message));const w=c[2].trim()!=="";if(!w&&u)return s(new I("jwt signature is required"));if(w&&!u)return s(new I("secret or public key must be provided"));if(!w&&!r.algorithms)return s(new I('please specify "none" in "algorithms" to verify unsigned tokens'));if(u!=null&&!(u instanceof na))try{u=ia(u)}catch{try{u=sa(typeof u=="string"?Buffer.from(u):u)}catch{return s(new I("secretOrPublicKey is not valid key material"))}}if(r.algorithms||(u.type==="secret"?r.algorithms=aa:["rsa","rsa-pss"].includes(u.asymmetricKeyType)?r.algorithms=Ve:u.asymmetricKeyType==="ec"?r.algorithms=oa:r.algorithms=Fe),r.algorithms.indexOf(l.header.alg)===-1)return s(new I("invalid algorithm"));if(a.alg.startsWith("HS")&&u.type!=="secret")return s(new I(`secretOrPublicKey must be a symmetric key when using ${a.alg}`));if(/^(?:RS|PS|ES)/.test(a.alg)&&u.type!=="public")return s(new I(`secretOrPublicKey must be an asymmetric key when using ${a.alg}`));if(!r.allowInvalidAsymmetricKeyTypes)try{ea(a.alg,u)}catch(R){return s(R)}let m;try{m=ta.verify(e,l.header.alg,u)}catch(R){return s(R)}if(!m)return s(new I("invalid signature"));const h=l.payload;if(typeof h.nbf<"u"&&!r.ignoreNotBefore){if(typeof h.nbf!="number")return s(new I("invalid nbf value"));if(h.nbf>i+(r.clockTolerance||0))return s(new zo("jwt not active",new Date(h.nbf*1e3)))}if(typeof h.exp<"u"&&!r.ignoreExpiration){if(typeof h.exp!="number")return s(new I("invalid exp value"));if(i>=h.exp+(r.clockTolerance||0))return s(new jr("jwt expired",new Date(h.exp*1e3)))}if(r.audience){const R=Array.isArray(r.audience)?r.audience:[r.audience];if(!(Array.isArray(h.aud)?h.aud:[h.aud]).some(function(A){return R.some(function(_){return _ instanceof RegExp?_.test(A):_===A})}))return s(new I("jwt audience invalid. expected: "+R.join(" or ")))}if(r.issuer&&(typeof r.issuer=="string"&&h.iss!==r.issuer||Array.isArray(r.issuer)&&r.issuer.indexOf(h.iss)===-1))return s(new I("jwt issuer invalid. expected: "+r.issuer));if(r.subject&&h.sub!==r.subject)return s(new I("jwt subject invalid. expected: "+r.subject));if(r.jwtid&&h.jti!==r.jwtid)return s(new I("jwt jwtid invalid. expected: "+r.jwtid));if(r.nonce&&h.nonce!==r.nonce)return s(new I("jwt nonce invalid. expected: "+r.nonce));if(r.maxAge){if(typeof h.iat!="number")return s(new I("iat required when maxAge is specified"));const R=Qo(r.maxAge,h.iat);if(typeof R>"u")return s(new I('"maxAge" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'));if(i>=R+(r.clockTolerance||0))return s(new jr("maxAge exceeded",new Date(R*1e3)))}if(r.complete===!0){const R=l.signature;return s(null,{header:a,payload:h,signature:R})}return s(null,h)})},Pr=1/0,Nt=9007199254740991,fa=17976931348623157e292,_r=0/0,ua="[object Arguments]",la="[object Function]",ha="[object GeneratorFunction]",pa="[object String]",ma="[object Symbol]",da=/^\s+|\s+$/g,Ea=/^[-+]0x[0-9a-f]+$/i,$a=/^0b[01]+$/i,ya=/^0o[0-7]+$/i,ga=/^(?:0|[1-9]\d*)$/,Sa=parseInt;function va(e,t){for(var r=-1,n=e?e.length:0,s=Array(n);++r<n;)s[r]=t(e[r],r,e);return s}function wa(e,t,r,n){for(var s=e.length,i=r+(n?1:-1);n?i--:++i<s;)if(t(e[i],i,e))return i;return-1}function ba(e,t,r){if(t!==t)return wa(e,Ia,r);for(var n=r-1,s=e.length;++n<s;)if(e[n]===t)return n;return-1}function Ia(e){return e!==e}function Ra(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}function Ta(e,t){return va(t,function(r){return e[r]})}function Aa(e,t){return function(r){return e(t(r))}}var Ae=Object.prototype,rr=Ae.hasOwnProperty,Oe=Ae.toString,Oa=Ae.propertyIsEnumerable,Na=Aa(Object.keys,Object),La=Math.max;function ja(e,t){var r=Lt(e)||Ca(e)?Ra(e.length,String):[],n=r.length,s=!!n;for(var i in e)(t||rr.call(e,i))&&!(s&&(i=="length"||_a(i,n)))&&r.push(i);return r}function Pa(e){if(!xa(e))return Na(e);var t=[];for(var r in Object(e))rr.call(e,r)&&r!="constructor"&&t.push(r);return t}function _a(e,t){return t=t??Nt,!!t&&(typeof e=="number"||ga.test(e))&&e>-1&&e%1==0&&e<t}function xa(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||Ae;return e===r}function Da(e,t,r,n){e=tr(e)?e:Ka(e),r=r&&!n?Ha(r):0;var s=e.length;return r<0&&(r=La(s+r,0)),Va(e)?r<=s&&e.indexOf(t,r)>-1:!!s&&ba(e,t,r)>-1}function Ca(e){return Ba(e)&&rr.call(e,"callee")&&(!Oa.call(e,"callee")||Oe.call(e)==ua)}var Lt=Array.isArray;function tr(e){return e!=null&&Fa(e.length)&&!Ga(e)}function Ba(e){return nr(e)&&tr(e)}function Ga(e){var t=ke(e)?Oe.call(e):"";return t==la||t==ha}function Fa(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Nt}function ke(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function nr(e){return!!e&&typeof e=="object"}function Va(e){return typeof e=="string"||!Lt(e)&&nr(e)&&Oe.call(e)==pa}function ka(e){return typeof e=="symbol"||nr(e)&&Oe.call(e)==ma}function Ua(e){if(!e)return e===0?e:0;if(e=Ma(e),e===Pr||e===-Pr){var t=e<0?-1:1;return t*fa}return e===e?e:0}function Ha(e){var t=Ua(e),r=t%1;return t===t?r?t-r:t:0}function Ma(e){if(typeof e=="number")return e;if(ka(e))return _r;if(ke(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=ke(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(da,"");var r=$a.test(e);return r||ya.test(e)?Sa(e.slice(2),r?2:8):Ea.test(e)?_r:+e}function Xa(e){return tr(e)?ja(e):Pa(e)}function Ka(e){return e?Ta(e,Xa(e)):[]}var qa=Da,Wa="[object Boolean]",Ja=Object.prototype,Ya=Ja.toString;function za(e){return e===!0||e===!1||Za(e)&&Ya.call(e)==Wa}function Za(e){return!!e&&typeof e=="object"}var Qa=za,xr=1/0,ec=17976931348623157e292,Dr=0/0,rc="[object Symbol]",tc=/^\s+|\s+$/g,nc=/^[-+]0x[0-9a-f]+$/i,sc=/^0b[01]+$/i,ic=/^0o[0-7]+$/i,oc=parseInt,ac=Object.prototype,cc=ac.toString;function fc(e){return typeof e=="number"&&e==pc(e)}function Cr(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function uc(e){return!!e&&typeof e=="object"}function lc(e){return typeof e=="symbol"||uc(e)&&cc.call(e)==rc}function hc(e){if(!e)return e===0?e:0;if(e=mc(e),e===xr||e===-xr){var t=e<0?-1:1;return t*ec}return e===e?e:0}function pc(e){var t=hc(e),r=t%1;return t===t?r?t-r:t:0}function mc(e){if(typeof e=="number")return e;if(lc(e))return Dr;if(Cr(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Cr(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(tc,"");var r=sc.test(e);return r||ic.test(e)?oc(e.slice(2),r?2:8):nc.test(e)?Dr:+e}var dc=fc,Ec="[object Number]",$c=Object.prototype,yc=$c.toString;function gc(e){return!!e&&typeof e=="object"}function Sc(e){return typeof e=="number"||gc(e)&&yc.call(e)==Ec}var vc=Sc,wc="[object Object]";function bc(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch{}return t}function Ic(e,t){return function(r){return e(t(r))}}var Rc=Function.prototype,jt=Object.prototype,Pt=Rc.toString,Tc=jt.hasOwnProperty,Ac=Pt.call(Object),Oc=jt.toString,Nc=Ic(Object.getPrototypeOf,Object);function Lc(e){return!!e&&typeof e=="object"}function jc(e){if(!Lc(e)||Oc.call(e)!=wc||bc(e))return!1;var t=Nc(e);if(t===null)return!0;var r=Tc.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&Pt.call(r)==Ac}var Pc=jc,_c="[object String]",xc=Object.prototype,Dc=xc.toString,Cc=Array.isArray;function Bc(e){return!!e&&typeof e=="object"}function Gc(e){return typeof e=="string"||!Cc(e)&&Bc(e)&&Dc.call(e)==_c}var Fc=Gc,Vc="Expected a function",Br=1/0,kc=17976931348623157e292,Gr=0/0,Uc="[object Symbol]",Hc=/^\s+|\s+$/g,Mc=/^[-+]0x[0-9a-f]+$/i,Xc=/^0b[01]+$/i,Kc=/^0o[0-7]+$/i,qc=parseInt,Wc=Object.prototype,Jc=Wc.toString;function Yc(e,t){var r;if(typeof t!="function")throw new TypeError(Vc);return e=rf(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=void 0),r}}function zc(e){return Yc(2,e)}function Fr(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function Zc(e){return!!e&&typeof e=="object"}function Qc(e){return typeof e=="symbol"||Zc(e)&&Jc.call(e)==Uc}function ef(e){if(!e)return e===0?e:0;if(e=tf(e),e===Br||e===-Br){var t=e<0?-1:1;return t*kc}return e===e?e:0}function rf(e){var t=ef(e),r=t%1;return t===t?r?t-r:t:0}function tf(e){if(typeof e=="number")return e;if(Qc(e))return Gr;if(Fr(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Fr(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(Hc,"");var r=Xc.test(e);return r||Kc.test(e)?qc(e.slice(2),r?2:8):Mc.test(e)?Gr:+e}var nf=zc;const Vr=gt,sf=Ot,of=At,kr=F,af=qa,fe=Qa,Ur=dc,Ce=vc,_t=Pc,k=Fc,cf=nf,{KeyObject:ff,createSecretKey:uf,createPrivateKey:lf}=j,xt=["RS256","RS384","RS512","ES256","ES384","ES512","HS256","HS384","HS512","none"];sf&&xt.splice(3,0,"PS256","PS384","PS512");const hf={expiresIn:{isValid:function(e){return Ur(e)||k(e)&&e},message:'"expiresIn" should be a number of seconds or string representing a timespan'},notBefore:{isValid:function(e){return Ur(e)||k(e)&&e},message:'"notBefore" should be a number of seconds or string representing a timespan'},audience:{isValid:function(e){return k(e)||Array.isArray(e)},message:'"audience" must be a string or array'},algorithm:{isValid:af.bind(null,xt),message:'"algorithm" must be a valid string enum value'},header:{isValid:_t,message:'"header" must be an object'},encoding:{isValid:k,message:'"encoding" must be a string'},issuer:{isValid:k,message:'"issuer" must be a string'},subject:{isValid:k,message:'"subject" must be a string'},jwtid:{isValid:k,message:'"jwtid" must be a string'},noTimestamp:{isValid:fe,message:'"noTimestamp" must be a boolean'},keyid:{isValid:k,message:'"keyid" must be a string'},mutatePayload:{isValid:fe,message:'"mutatePayload" must be a boolean'},allowInsecureKeySizes:{isValid:fe,message:'"allowInsecureKeySizes" must be a boolean'},allowInvalidAsymmetricKeyTypes:{isValid:fe,message:'"allowInvalidAsymmetricKeyTypes" must be a boolean'}},pf={iat:{isValid:Ce,message:'"iat" should be a number of seconds'},exp:{isValid:Ce,message:'"exp" should be a number of seconds'},nbf:{isValid:Ce,message:'"nbf" should be a number of seconds'}};function Dt(e,t,r,n){if(!_t(r))throw new Error('Expected "'+n+'" to be a plain object.');Object.keys(r).forEach(function(s){const i=e[s];if(!i){if(!t)throw new Error('"'+s+'" is not allowed in "'+n+'"');return}if(!i.isValid(r[s]))throw new Error(i.message)})}function mf(e){return Dt(hf,!1,e,"options")}function df(e){return Dt(pf,!0,e,"payload")}const Hr={audience:"aud",issuer:"iss",subject:"sub",jwtid:"jti"},Ef=["expiresIn","notBefore","noTimestamp","audience","issuer","subject","jwtid"];var $f=function(e,t,r,n){typeof r=="function"?(n=r,r={}):r=r||{};const s=typeof e=="object"&&!Buffer.isBuffer(e),i=Object.assign({alg:r.algorithm||"HS256",typ:s?"JWT":void 0,kid:r.keyid},r.header);function c(o){if(n)return n(o);throw o}if(!t&&r.algorithm!=="none")return c(new Error("secretOrPrivateKey must have a value"));if(t!=null&&!(t instanceof ff))try{t=lf(t)}catch{try{t=uf(typeof t=="string"?Buffer.from(t):t)}catch{return c(new Error("secretOrPrivateKey is not valid key material"))}}if(i.alg.startsWith("HS")&&t.type!=="secret")return c(new Error(`secretOrPrivateKey must be a symmetric key when using ${i.alg}`));if(/^(?:RS|PS|ES)/.test(i.alg)){if(t.type!=="private")return c(new Error(`secretOrPrivateKey must be an asymmetric key when using ${i.alg}`));if(!r.allowInsecureKeySizes&&!i.alg.startsWith("ES")&&t.asymmetricKeyDetails!==void 0&&t.asymmetricKeyDetails.modulusLength<2048)return c(new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${i.alg}`))}if(typeof e>"u")return c(new Error("payload is required"));if(s){try{df(e)}catch(o){return c(o)}r.mutatePayload||(e=Object.assign({},e))}else{const o=Ef.filter(function(f){return typeof r[f]<"u"});if(o.length>0)return c(new Error("invalid "+o.join(",")+" option for "+typeof e+" payload"))}if(typeof e.exp<"u"&&typeof r.expiresIn<"u")return c(new Error('Bad "options.expiresIn" option the payload already has an "exp" property.'));if(typeof e.nbf<"u"&&typeof r.notBefore<"u")return c(new Error('Bad "options.notBefore" option the payload already has an "nbf" property.'));try{mf(r)}catch(o){return c(o)}if(!r.allowInvalidAsymmetricKeyTypes)try{of(i.alg,t)}catch(o){return c(o)}const l=e.iat||Math.floor(Date.now()/1e3);if(r.noTimestamp?delete e.iat:s&&(e.iat=l),typeof r.notBefore<"u"){try{e.nbf=Vr(r.notBefore,l)}catch(o){return c(o)}if(typeof e.nbf>"u")return c(new Error('"notBefore" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}if(typeof r.expiresIn<"u"&&typeof e=="object"){try{e.exp=Vr(r.expiresIn,l)}catch(o){return c(o)}if(typeof e.exp>"u")return c(new Error('"expiresIn" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}Object.keys(Hr).forEach(function(o){const f=Hr[o];if(typeof r[o]<"u"){if(typeof e[f]<"u")return c(new Error('Bad "options.'+o+'" option. The payload already has an "'+f+'" property.'));e[f]=r[o]}});const a=r.encoding||"utf8";if(typeof n=="function")n=n&&cf(n),kr.createSign({header:i,privateKey:t,payload:e,encoding:a}).once("error",n).once("done",function(o){if(!r.allowInsecureKeySizes&&/^(?:RS|PS)/.test(i.alg)&&o.length<256)return n(new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${i.alg}`));n(null,o)});else{let o=kr.sign({header:i,payload:e,secret:t,encoding:a});if(!r.allowInsecureKeySizes&&/^(?:RS|PS)/.test(i.alg)&&o.length<256)throw new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${i.alg}`);return o}},yf={decode:mt,verify:ca,sign:$f,JsonWebTokenError:ve,NotBeforeError:Et,TokenExpiredError:yt};const Mr=Wt(yf);class Ct{constructor(t,r){Ne(this,"secretPrivateKey","secretPrivateKey");Ne(this,"daysToExpire",30);this.secretPrivateKey=t,this.daysToExpire=r}createAccessToken(t,r){return Mr.sign({[t]:r},this.secretPrivateKey,{expiresIn:60*60*24*this.daysToExpire})}verifyAccessToken(t){return Mr.verify(t,this.secretPrivateKey)}}const gf=Object.freeze(Object.defineProperty({__proto__:null,Token:Ct},Symbol.toStringTag,{value:"Module"}));exports.Token=Ct;exports.token=gf;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var Xt = Object.defineProperty;
|
|
2
2
|
var Kt = (e, t, r) => t in e ? Xt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
|
-
var
|
|
3
|
+
var Ne = (e, t, r) => (Kt(e, typeof t != "symbol" ? t + "" : t, r), r);
|
|
4
4
|
function qt(e) {
|
|
5
5
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
6
6
|
}
|
|
@@ -25,7 +25,7 @@ function Wt(e) {
|
|
|
25
25
|
});
|
|
26
26
|
}), r;
|
|
27
27
|
}
|
|
28
|
-
var F = {},
|
|
28
|
+
var F = {}, Be = { exports: {} };
|
|
29
29
|
const Jt = {}, Yt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
30
30
|
__proto__: null,
|
|
31
31
|
default: Jt
|
|
@@ -59,8 +59,8 @@ const Jt = {}, Yt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
|
|
|
59
59
|
throw new TypeError("Argument must be a number");
|
|
60
60
|
return r.SlowBuffer(c);
|
|
61
61
|
};
|
|
62
|
-
})(
|
|
63
|
-
var re =
|
|
62
|
+
})(Be, Be.exports);
|
|
63
|
+
var re = Be.exports, ue = re.Buffer, zt = j, Zt = j;
|
|
64
64
|
function ye(e) {
|
|
65
65
|
if (this.buffer = null, this.writable = !0, this.readable = !0, !e)
|
|
66
66
|
return this.buffer = ue.alloc(0), this;
|
|
@@ -79,7 +79,7 @@ ye.prototype.write = function(t) {
|
|
|
79
79
|
ye.prototype.end = function(t) {
|
|
80
80
|
t && this.write(t), this.emit("end", t), this.emit("close"), this.writable = !1, this.readable = !1;
|
|
81
81
|
};
|
|
82
|
-
var Xr = ye, ee = j.Buffer,
|
|
82
|
+
var Xr = ye, ee = j.Buffer, Ue = j.SlowBuffer, Qt = le;
|
|
83
83
|
function le(e, t) {
|
|
84
84
|
if (!ee.isBuffer(e) || !ee.isBuffer(t) || e.length !== t.length)
|
|
85
85
|
return !1;
|
|
@@ -88,22 +88,22 @@ function le(e, t) {
|
|
|
88
88
|
return r === 0;
|
|
89
89
|
}
|
|
90
90
|
le.install = function() {
|
|
91
|
-
ee.prototype.equal =
|
|
91
|
+
ee.prototype.equal = Ue.prototype.equal = function(t) {
|
|
92
92
|
return le(this, t);
|
|
93
93
|
};
|
|
94
94
|
};
|
|
95
|
-
var en = ee.prototype.equal, rn =
|
|
95
|
+
var en = ee.prototype.equal, rn = Ue.prototype.equal;
|
|
96
96
|
le.restore = function() {
|
|
97
|
-
ee.prototype.equal = en,
|
|
97
|
+
ee.prototype.equal = en, Ue.prototype.equal = rn;
|
|
98
98
|
};
|
|
99
|
-
function
|
|
99
|
+
function Le(e) {
|
|
100
100
|
var t = (e / 8 | 0) + (e % 8 === 0 ? 0 : 1);
|
|
101
101
|
return t;
|
|
102
102
|
}
|
|
103
103
|
var tn = {
|
|
104
|
-
ES256:
|
|
105
|
-
ES384:
|
|
106
|
-
ES512:
|
|
104
|
+
ES256: Le(256),
|
|
105
|
+
ES384: Le(384),
|
|
106
|
+
ES512: Le(521)
|
|
107
107
|
};
|
|
108
108
|
function nn(e) {
|
|
109
109
|
var t = tn[e];
|
|
@@ -175,10 +175,10 @@ var hn = {
|
|
|
175
175
|
joseToDer: ln
|
|
176
176
|
}, pn = Qt, X = re.Buffer, G = j, Yr = hn, ir = j, mn = `"%s" is not a valid algorithm.
|
|
177
177
|
Supported algorithms are:
|
|
178
|
-
"HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".`, Q = "secret must be a string or buffer", M = "key must be a string or a buffer", dn = "key must be a string, a buffer or an object",
|
|
179
|
-
|
|
178
|
+
"HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".`, Q = "secret must be a string or buffer", M = "key must be a string or a buffer", dn = "key must be a string, a buffer or an object", He = typeof G.createPublicKey == "function";
|
|
179
|
+
He && (M += " or a KeyObject", Q += "or a KeyObject");
|
|
180
180
|
function zr(e) {
|
|
181
|
-
if (!X.isBuffer(e) && typeof e != "string" && (!
|
|
181
|
+
if (!X.isBuffer(e) && typeof e != "string" && (!He || typeof e != "object" || typeof e.type != "string" || typeof e.asymmetricKeyType != "string" || typeof e.export != "function"))
|
|
182
182
|
throw x(M);
|
|
183
183
|
}
|
|
184
184
|
function Zr(e) {
|
|
@@ -189,11 +189,11 @@ function En(e) {
|
|
|
189
189
|
if (!X.isBuffer(e)) {
|
|
190
190
|
if (typeof e == "string")
|
|
191
191
|
return e;
|
|
192
|
-
if (!
|
|
192
|
+
if (!He || typeof e != "object" || e.type !== "secret" || typeof e.export != "function")
|
|
193
193
|
throw x(Q);
|
|
194
194
|
}
|
|
195
195
|
}
|
|
196
|
-
function
|
|
196
|
+
function Me(e) {
|
|
197
197
|
return e.replace(/=/g, "").replace(/\+/g, "-").replace(/\//g, "_");
|
|
198
198
|
}
|
|
199
199
|
function Qr(e) {
|
|
@@ -218,7 +218,7 @@ function et(e) {
|
|
|
218
218
|
return function(r, n) {
|
|
219
219
|
En(n), r = te(r);
|
|
220
220
|
var s = G.createHmac("sha" + e, n), i = (s.update(r), s.digest("base64"));
|
|
221
|
-
return
|
|
221
|
+
return Me(i);
|
|
222
222
|
};
|
|
223
223
|
}
|
|
224
224
|
function yn(e) {
|
|
@@ -231,7 +231,7 @@ function rt(e) {
|
|
|
231
231
|
return function(r, n) {
|
|
232
232
|
Zr(n), r = te(r);
|
|
233
233
|
var s = G.createSign("RSA-SHA" + e), i = (s.update(r), s.sign(n, "base64"));
|
|
234
|
-
return
|
|
234
|
+
return Me(i);
|
|
235
235
|
};
|
|
236
236
|
}
|
|
237
237
|
function tt(e) {
|
|
@@ -249,7 +249,7 @@ function gn(e) {
|
|
|
249
249
|
padding: G.constants.RSA_PKCS1_PSS_PADDING,
|
|
250
250
|
saltLength: G.constants.RSA_PSS_SALTLEN_DIGEST
|
|
251
251
|
}, "base64"));
|
|
252
|
-
return
|
|
252
|
+
return Me(i);
|
|
253
253
|
};
|
|
254
254
|
}
|
|
255
255
|
function Sn(e) {
|
|
@@ -311,18 +311,18 @@ var nt = function(t) {
|
|
|
311
311
|
};
|
|
312
312
|
}, Rn = j.Buffer, st = function(t) {
|
|
313
313
|
return typeof t == "string" ? t : typeof t == "number" || Rn.isBuffer(t) ? t.toString() : JSON.stringify(t);
|
|
314
|
-
}, Tn = re.Buffer, or = Xr, An = nt, On = j, ar = st,
|
|
314
|
+
}, Tn = re.Buffer, or = Xr, An = nt, On = j, ar = st, Xe = j;
|
|
315
315
|
function cr(e, t) {
|
|
316
316
|
return Tn.from(e, t).toString("base64").replace(/=/g, "").replace(/\+/g, "-").replace(/\//g, "_");
|
|
317
317
|
}
|
|
318
318
|
function Nn(e, t, r) {
|
|
319
319
|
r = r || "utf8";
|
|
320
320
|
var n = cr(ar(e), "binary"), s = cr(ar(t), r);
|
|
321
|
-
return
|
|
321
|
+
return Xe.format("%s.%s", n, s);
|
|
322
322
|
}
|
|
323
323
|
function it(e) {
|
|
324
324
|
var t = e.header, r = e.payload, n = e.secret || e.privateKey, s = e.encoding, i = An(t.alg), c = Nn(t, r, s), l = i.sign(c, n);
|
|
325
|
-
return
|
|
325
|
+
return Xe.format("%s.%s", c, l);
|
|
326
326
|
}
|
|
327
327
|
function ge(e) {
|
|
328
328
|
var t = e.secret || e.privateKey || e.key, r = new or(t);
|
|
@@ -332,7 +332,7 @@ function ge(e) {
|
|
|
332
332
|
!this.secret.writable && this.readable && this.sign();
|
|
333
333
|
}).bind(this));
|
|
334
334
|
}
|
|
335
|
-
|
|
335
|
+
Xe.inherits(ge, On);
|
|
336
336
|
ge.prototype.sign = function() {
|
|
337
337
|
try {
|
|
338
338
|
var t = it({
|
|
@@ -560,7 +560,7 @@ var Wn = Mn, gt = function(e, t) {
|
|
|
560
560
|
return typeof n > "u" ? void 0 : Math.floor(r + n / 1e3);
|
|
561
561
|
} else
|
|
562
562
|
return typeof e == "number" ? r + e : void 0;
|
|
563
|
-
},
|
|
563
|
+
}, Ge = { exports: {} };
|
|
564
564
|
const Jn = "2.0.0", St = 256, Yn = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
|
|
565
565
|
9007199254740991, zn = 16, Zn = St - 6, Qn = [
|
|
566
566
|
"major",
|
|
@@ -606,10 +606,10 @@ var be = es;
|
|
|
606
606
|
i(R, _, L), o[R] = _, a[_] = L, c[_] = new RegExp(L, V ? "g" : void 0), l[_] = new RegExp(A, V ? "g" : void 0);
|
|
607
607
|
};
|
|
608
608
|
h("NUMERICIDENTIFIER", "0|[1-9]\\d*"), h("NUMERICIDENTIFIERLOOSE", "\\d+"), h("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${u}*`), h("MAINVERSION", `(${a[o.NUMERICIDENTIFIER]})\\.(${a[o.NUMERICIDENTIFIER]})\\.(${a[o.NUMERICIDENTIFIER]})`), h("MAINVERSIONLOOSE", `(${a[o.NUMERICIDENTIFIERLOOSE]})\\.(${a[o.NUMERICIDENTIFIERLOOSE]})\\.(${a[o.NUMERICIDENTIFIERLOOSE]})`), h("PRERELEASEIDENTIFIER", `(?:${a[o.NUMERICIDENTIFIER]}|${a[o.NONNUMERICIDENTIFIER]})`), h("PRERELEASEIDENTIFIERLOOSE", `(?:${a[o.NUMERICIDENTIFIERLOOSE]}|${a[o.NONNUMERICIDENTIFIER]})`), h("PRERELEASE", `(?:-(${a[o.PRERELEASEIDENTIFIER]}(?:\\.${a[o.PRERELEASEIDENTIFIER]})*))`), h("PRERELEASELOOSE", `(?:-?(${a[o.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${a[o.PRERELEASEIDENTIFIERLOOSE]})*))`), h("BUILDIDENTIFIER", `${u}+`), h("BUILD", `(?:\\+(${a[o.BUILDIDENTIFIER]}(?:\\.${a[o.BUILDIDENTIFIER]})*))`), h("FULLPLAIN", `v?${a[o.MAINVERSION]}${a[o.PRERELEASE]}?${a[o.BUILD]}?`), h("FULL", `^${a[o.FULLPLAIN]}$`), h("LOOSEPLAIN", `[v=\\s]*${a[o.MAINVERSIONLOOSE]}${a[o.PRERELEASELOOSE]}?${a[o.BUILD]}?`), h("LOOSE", `^${a[o.LOOSEPLAIN]}$`), h("GTLT", "((?:<|>)?=?)"), h("XRANGEIDENTIFIERLOOSE", `${a[o.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`), h("XRANGEIDENTIFIER", `${a[o.NUMERICIDENTIFIER]}|x|X|\\*`), h("XRANGEPLAIN", `[v=\\s]*(${a[o.XRANGEIDENTIFIER]})(?:\\.(${a[o.XRANGEIDENTIFIER]})(?:\\.(${a[o.XRANGEIDENTIFIER]})(?:${a[o.PRERELEASE]})?${a[o.BUILD]}?)?)?`), h("XRANGEPLAINLOOSE", `[v=\\s]*(${a[o.XRANGEIDENTIFIERLOOSE]})(?:\\.(${a[o.XRANGEIDENTIFIERLOOSE]})(?:\\.(${a[o.XRANGEIDENTIFIERLOOSE]})(?:${a[o.PRERELEASELOOSE]})?${a[o.BUILD]}?)?)?`), h("XRANGE", `^${a[o.GTLT]}\\s*${a[o.XRANGEPLAIN]}$`), h("XRANGELOOSE", `^${a[o.GTLT]}\\s*${a[o.XRANGEPLAINLOOSE]}$`), h("COERCEPLAIN", `(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`), h("COERCE", `${a[o.COERCEPLAIN]}(?:$|[^\\d])`), h("COERCEFULL", a[o.COERCEPLAIN] + `(?:${a[o.PRERELEASE]})?(?:${a[o.BUILD]})?(?:$|[^\\d])`), h("COERCERTL", a[o.COERCE], !0), h("COERCERTLFULL", a[o.COERCEFULL], !0), h("LONETILDE", "(?:~>?)"), h("TILDETRIM", `(\\s*)${a[o.LONETILDE]}\\s+`, !0), t.tildeTrimReplace = "$1~", h("TILDE", `^${a[o.LONETILDE]}${a[o.XRANGEPLAIN]}$`), h("TILDELOOSE", `^${a[o.LONETILDE]}${a[o.XRANGEPLAINLOOSE]}$`), h("LONECARET", "(?:\\^)"), h("CARETTRIM", `(\\s*)${a[o.LONECARET]}\\s+`, !0), t.caretTrimReplace = "$1^", h("CARET", `^${a[o.LONECARET]}${a[o.XRANGEPLAIN]}$`), h("CARETLOOSE", `^${a[o.LONECARET]}${a[o.XRANGEPLAINLOOSE]}$`), h("COMPARATORLOOSE", `^${a[o.GTLT]}\\s*(${a[o.LOOSEPLAIN]})$|^$`), h("COMPARATOR", `^${a[o.GTLT]}\\s*(${a[o.FULLPLAIN]})$|^$`), h("COMPARATORTRIM", `(\\s*)${a[o.GTLT]}\\s*(${a[o.LOOSEPLAIN]}|${a[o.XRANGEPLAIN]})`, !0), t.comparatorTrimReplace = "$1$2$3", h("HYPHENRANGE", `^\\s*(${a[o.XRANGEPLAIN]})\\s+-\\s+(${a[o.XRANGEPLAIN]})\\s*$`), h("HYPHENRANGELOOSE", `^\\s*(${a[o.XRANGEPLAINLOOSE]})\\s+-\\s+(${a[o.XRANGEPLAINLOOSE]})\\s*$`), h("STAR", "(<|>)?=?\\s*\\*"), h("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$"), h("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
|
|
609
|
-
})(
|
|
610
|
-
var ne =
|
|
609
|
+
})(Ge, Ge.exports);
|
|
610
|
+
var ne = Ge.exports;
|
|
611
611
|
const rs = Object.freeze({ loose: !0 }), ts = Object.freeze({}), ns = (e) => e ? typeof e != "object" ? rs : e : ts;
|
|
612
|
-
var
|
|
612
|
+
var Ke = ns;
|
|
613
613
|
const ur = /^[0-9]+$/, vt = (e, t) => {
|
|
614
614
|
const r = ur.test(e), n = ur.test(t);
|
|
615
615
|
return r && n && (e = +e, t = +t), e === t ? 0 : r && !n ? -1 : n && !r ? 1 : e < t ? -1 : 1;
|
|
@@ -618,7 +618,7 @@ var wt = {
|
|
|
618
618
|
compareIdentifiers: vt,
|
|
619
619
|
rcompareIdentifiers: ss
|
|
620
620
|
};
|
|
621
|
-
const ie = be, { MAX_LENGTH: lr, MAX_SAFE_INTEGER: oe } = we, { safeRe: hr, t: pr } = ne, is =
|
|
621
|
+
const ie = be, { MAX_LENGTH: lr, MAX_SAFE_INTEGER: oe } = we, { safeRe: hr, t: pr } = ne, is = Ke, { compareIdentifiers: H } = wt;
|
|
622
622
|
let os = class B {
|
|
623
623
|
constructor(t, r) {
|
|
624
624
|
if (r = is(r), t instanceof B) {
|
|
@@ -824,24 +824,24 @@ const yr = N, Bs = (e, t, r) => {
|
|
|
824
824
|
const n = new yr(e, r), s = new yr(t, r);
|
|
825
825
|
return n.compare(s) || n.compareBuild(s);
|
|
826
826
|
};
|
|
827
|
-
var
|
|
828
|
-
const Gs =
|
|
827
|
+
var qe = Bs;
|
|
828
|
+
const Gs = qe, Fs = (e, t) => e.sort((r, n) => Gs(r, n, t));
|
|
829
829
|
var Vs = Fs;
|
|
830
|
-
const ks =
|
|
830
|
+
const ks = qe, Us = (e, t) => e.sort((r, n) => ks(n, r, t));
|
|
831
831
|
var Hs = Us;
|
|
832
832
|
const Ms = D, Xs = (e, t, r) => Ms(e, t, r) > 0;
|
|
833
833
|
var Ie = Xs;
|
|
834
834
|
const Ks = D, qs = (e, t, r) => Ks(e, t, r) < 0;
|
|
835
|
-
var
|
|
835
|
+
var We = qs;
|
|
836
836
|
const Ws = D, Js = (e, t, r) => Ws(e, t, r) === 0;
|
|
837
837
|
var bt = Js;
|
|
838
838
|
const Ys = D, zs = (e, t, r) => Ys(e, t, r) !== 0;
|
|
839
839
|
var It = zs;
|
|
840
840
|
const Zs = D, Qs = (e, t, r) => Zs(e, t, r) >= 0;
|
|
841
|
-
var
|
|
841
|
+
var Je = Qs;
|
|
842
842
|
const ei = D, ri = (e, t, r) => ei(e, t, r) <= 0;
|
|
843
|
-
var
|
|
844
|
-
const ti = bt, ni = It, si = Ie, ii =
|
|
843
|
+
var Ye = ri;
|
|
844
|
+
const ti = bt, ni = It, si = Ie, ii = Je, oi = We, ai = Ye, ci = (e, t, r, n) => {
|
|
845
845
|
switch (t) {
|
|
846
846
|
case "===":
|
|
847
847
|
return typeof e == "object" && (e = e.version), typeof r == "object" && (r = r.version), e === r;
|
|
@@ -911,10 +911,10 @@ class pi {
|
|
|
911
911
|
return this;
|
|
912
912
|
}
|
|
913
913
|
}
|
|
914
|
-
var mi = pi,
|
|
914
|
+
var mi = pi, je, gr;
|
|
915
915
|
function C() {
|
|
916
916
|
if (gr)
|
|
917
|
-
return
|
|
917
|
+
return je;
|
|
918
918
|
gr = 1;
|
|
919
919
|
class e {
|
|
920
920
|
constructor(p, g) {
|
|
@@ -983,8 +983,8 @@ function C() {
|
|
|
983
983
|
return !1;
|
|
984
984
|
}
|
|
985
985
|
}
|
|
986
|
-
|
|
987
|
-
const t = mi, r = new t(), n =
|
|
986
|
+
je = e;
|
|
987
|
+
const t = mi, r = new t(), n = Ke, s = Re(), i = be, c = N, {
|
|
988
988
|
safeRe: l,
|
|
989
989
|
t: a,
|
|
990
990
|
comparatorTrimReplace: o,
|
|
@@ -1035,12 +1035,12 @@ function C() {
|
|
|
1035
1035
|
}
|
|
1036
1036
|
return !0;
|
|
1037
1037
|
};
|
|
1038
|
-
return
|
|
1038
|
+
return je;
|
|
1039
1039
|
}
|
|
1040
|
-
var
|
|
1040
|
+
var Pe, Sr;
|
|
1041
1041
|
function Re() {
|
|
1042
1042
|
if (Sr)
|
|
1043
|
-
return
|
|
1043
|
+
return Pe;
|
|
1044
1044
|
Sr = 1;
|
|
1045
1045
|
const e = Symbol("SemVer ANY");
|
|
1046
1046
|
class t {
|
|
@@ -1081,9 +1081,9 @@ function Re() {
|
|
|
1081
1081
|
return this.operator === "" ? this.value === "" ? !0 : new a(f.value, u).test(this.value) : f.operator === "" ? f.value === "" ? !0 : new a(this.value, u).test(f.semver) : (u = r(u), u.includePrerelease && (this.value === "<0.0.0-0" || f.value === "<0.0.0-0") || !u.includePrerelease && (this.value.startsWith("<0.0.0") || f.value.startsWith("<0.0.0")) ? !1 : !!(this.operator.startsWith(">") && f.operator.startsWith(">") || this.operator.startsWith("<") && f.operator.startsWith("<") || this.semver.version === f.semver.version && this.operator.includes("=") && f.operator.includes("=") || i(this.semver, "<", f.semver, u) && this.operator.startsWith(">") && f.operator.startsWith("<") || i(this.semver, ">", f.semver, u) && this.operator.startsWith("<") && f.operator.startsWith(">")));
|
|
1082
1082
|
}
|
|
1083
1083
|
}
|
|
1084
|
-
|
|
1085
|
-
const r =
|
|
1086
|
-
return
|
|
1084
|
+
Pe = t;
|
|
1085
|
+
const r = Ke, { safeRe: n, t: s } = ne, i = Rt, c = be, l = N, a = C();
|
|
1086
|
+
return Pe;
|
|
1087
1087
|
}
|
|
1088
1088
|
const di = C(), Ei = (e, t, r) => {
|
|
1089
1089
|
try {
|
|
@@ -1120,17 +1120,17 @@ const Ii = N, Ri = C(), Ti = (e, t, r) => {
|
|
|
1120
1120
|
}), n;
|
|
1121
1121
|
};
|
|
1122
1122
|
var Ai = Ti;
|
|
1123
|
-
const
|
|
1123
|
+
const _e = N, Oi = C(), vr = Ie, Ni = (e, t) => {
|
|
1124
1124
|
e = new Oi(e, t);
|
|
1125
|
-
let r = new
|
|
1126
|
-
if (e.test(r) || (r = new
|
|
1125
|
+
let r = new _e("0.0.0");
|
|
1126
|
+
if (e.test(r) || (r = new _e("0.0.0-0"), e.test(r)))
|
|
1127
1127
|
return r;
|
|
1128
1128
|
r = null;
|
|
1129
1129
|
for (let n = 0; n < e.set.length; ++n) {
|
|
1130
1130
|
const s = e.set[n];
|
|
1131
1131
|
let i = null;
|
|
1132
1132
|
s.forEach((c) => {
|
|
1133
|
-
const l = new
|
|
1133
|
+
const l = new _e(c.semver.version);
|
|
1134
1134
|
switch (c.operator) {
|
|
1135
1135
|
case ">":
|
|
1136
1136
|
l.prerelease.length === 0 ? l.patch++ : l.prerelease.push(0), l.raw = l.format();
|
|
@@ -1157,7 +1157,7 @@ const ji = C(), Pi = (e, t) => {
|
|
|
1157
1157
|
}
|
|
1158
1158
|
};
|
|
1159
1159
|
var _i = Pi;
|
|
1160
|
-
const xi = N, Tt = Re(), { ANY: Di } = Tt, Ci = C(), Bi = Te, wr = Ie, br =
|
|
1160
|
+
const xi = N, Tt = Re(), { ANY: Di } = Tt, Ci = C(), Bi = Te, wr = Ie, br = We, Gi = Ye, Fi = Je, Vi = (e, t, r, n) => {
|
|
1161
1161
|
e = new xi(e, n), t = new Ci(t, n);
|
|
1162
1162
|
let s, i, c, l, a;
|
|
1163
1163
|
switch (r) {
|
|
@@ -1184,10 +1184,10 @@ const xi = N, Tt = Re(), { ANY: Di } = Tt, Ci = C(), Bi = Te, wr = Ie, br = qe,
|
|
|
1184
1184
|
}
|
|
1185
1185
|
return !0;
|
|
1186
1186
|
};
|
|
1187
|
-
var
|
|
1188
|
-
const ki =
|
|
1187
|
+
var ze = Vi;
|
|
1188
|
+
const ki = ze, Ui = (e, t, r) => ki(e, t, ">", r);
|
|
1189
1189
|
var Hi = Ui;
|
|
1190
|
-
const Mi =
|
|
1190
|
+
const Mi = ze, Xi = (e, t, r) => Mi(e, t, "<", r);
|
|
1191
1191
|
var Ki = Xi;
|
|
1192
1192
|
const Ir = C(), qi = (e, t, r) => (e = new Ir(e, r), t = new Ir(t, r), e.intersects(t, r));
|
|
1193
1193
|
var Wi = qi;
|
|
@@ -1205,7 +1205,7 @@ var zi = (e, t, r) => {
|
|
|
1205
1205
|
const a = l.join(" || "), o = typeof t.raw == "string" ? t.raw : String(t);
|
|
1206
1206
|
return a.length < o.length ? a : t;
|
|
1207
1207
|
};
|
|
1208
|
-
const Rr = C(),
|
|
1208
|
+
const Rr = C(), Ze = Re(), { ANY: xe } = Ze, Z = Te, Qe = D, Zi = (e, t, r = {}) => {
|
|
1209
1209
|
if (e === t)
|
|
1210
1210
|
return !0;
|
|
1211
1211
|
e = new Rr(e, r), t = new Rr(t, r);
|
|
@@ -1221,15 +1221,15 @@ const Rr = C(), ze = Re(), { ANY: _e } = ze, Z = Te, Ze = D, Zi = (e, t, r = {})
|
|
|
1221
1221
|
return !1;
|
|
1222
1222
|
}
|
|
1223
1223
|
return !0;
|
|
1224
|
-
}, Qi = [new
|
|
1224
|
+
}, Qi = [new Ze(">=0.0.0-0")], Tr = [new Ze(">=0.0.0")], eo = (e, t, r) => {
|
|
1225
1225
|
if (e === t)
|
|
1226
1226
|
return !0;
|
|
1227
|
-
if (e.length === 1 && e[0].semver ===
|
|
1228
|
-
if (t.length === 1 && t[0].semver ===
|
|
1227
|
+
if (e.length === 1 && e[0].semver === xe) {
|
|
1228
|
+
if (t.length === 1 && t[0].semver === xe)
|
|
1229
1229
|
return !0;
|
|
1230
1230
|
r.includePrerelease ? e = Qi : e = Tr;
|
|
1231
1231
|
}
|
|
1232
|
-
if (t.length === 1 && t[0].semver ===
|
|
1232
|
+
if (t.length === 1 && t[0].semver === xe) {
|
|
1233
1233
|
if (r.includePrerelease)
|
|
1234
1234
|
return !0;
|
|
1235
1235
|
t = Tr;
|
|
@@ -1242,7 +1242,7 @@ const Rr = C(), ze = Re(), { ANY: _e } = ze, Z = Te, Ze = D, Zi = (e, t, r = {})
|
|
|
1242
1242
|
return null;
|
|
1243
1243
|
let c;
|
|
1244
1244
|
if (s && i) {
|
|
1245
|
-
if (c =
|
|
1245
|
+
if (c = Qe(s.semver, i.semver, r), c > 0)
|
|
1246
1246
|
return null;
|
|
1247
1247
|
if (c === 0 && (s.operator !== ">=" || i.operator !== "<="))
|
|
1248
1248
|
return null;
|
|
@@ -1279,17 +1279,17 @@ const Rr = C(), ze = Re(), { ANY: _e } = ze, Z = Te, Ze = D, Zi = (e, t, r = {})
|
|
|
1279
1279
|
}, Ar = (e, t, r) => {
|
|
1280
1280
|
if (!e)
|
|
1281
1281
|
return t;
|
|
1282
|
-
const n =
|
|
1282
|
+
const n = Qe(e.semver, t.semver, r);
|
|
1283
1283
|
return n > 0 ? e : n < 0 || t.operator === ">" && e.operator === ">=" ? t : e;
|
|
1284
1284
|
}, Or = (e, t, r) => {
|
|
1285
1285
|
if (!e)
|
|
1286
1286
|
return t;
|
|
1287
|
-
const n =
|
|
1287
|
+
const n = Qe(e.semver, t.semver, r);
|
|
1288
1288
|
return n < 0 ? e : n > 0 || t.operator === "<" && e.operator === "<=" ? t : e;
|
|
1289
1289
|
};
|
|
1290
1290
|
var ro = Zi;
|
|
1291
|
-
const
|
|
1292
|
-
var
|
|
1291
|
+
const De = ne, Nr = we, to = N, Lr = wt, no = Y, so = us, io = ps, oo = ds, ao = $s, co = Ss, fo = bs, uo = Ts, lo = Ns, ho = D, po = _s, mo = Cs, Eo = qe, $o = Vs, yo = Hs, go = Ie, So = We, vo = bt, wo = It, bo = Je, Io = Ye, Ro = Rt, To = hi, Ao = Re(), Oo = C(), No = Te, Lo = gi, jo = bi, Po = Ai, _o = Li, xo = _i, Do = ze, Co = Hi, Bo = Ki, Go = Wi, Fo = zi, Vo = ro;
|
|
1292
|
+
var er = {
|
|
1293
1293
|
parse: no,
|
|
1294
1294
|
valid: so,
|
|
1295
1295
|
clean: io,
|
|
@@ -1328,17 +1328,17 @@ var Qe = {
|
|
|
1328
1328
|
simplifyRange: Fo,
|
|
1329
1329
|
subset: Vo,
|
|
1330
1330
|
SemVer: to,
|
|
1331
|
-
re:
|
|
1332
|
-
src:
|
|
1333
|
-
tokens:
|
|
1331
|
+
re: De.re,
|
|
1332
|
+
src: De.src,
|
|
1333
|
+
tokens: De.t,
|
|
1334
1334
|
SEMVER_SPEC_VERSION: Nr.SEMVER_SPEC_VERSION,
|
|
1335
1335
|
RELEASE_TYPES: Nr.RELEASE_TYPES,
|
|
1336
1336
|
compareIdentifiers: Lr.compareIdentifiers,
|
|
1337
1337
|
rcompareIdentifiers: Lr.rcompareIdentifiers
|
|
1338
1338
|
};
|
|
1339
|
-
const ko =
|
|
1339
|
+
const ko = er;
|
|
1340
1340
|
var Uo = ko.satisfies(process.version, ">=15.7.0");
|
|
1341
|
-
const Ho =
|
|
1341
|
+
const Ho = er;
|
|
1342
1342
|
var Mo = Ho.satisfies(process.version, ">=16.9.0");
|
|
1343
1343
|
const Xo = Uo, Ko = Mo, qo = {
|
|
1344
1344
|
ec: ["ES256", "ES384", "ES512"],
|
|
@@ -1377,9 +1377,9 @@ var At = function(e, t) {
|
|
|
1377
1377
|
}
|
|
1378
1378
|
break;
|
|
1379
1379
|
}
|
|
1380
|
-
}, Jo =
|
|
1381
|
-
const I = ve, Yo = Et, jr = yt, zo = mt, Zo = gt, Qo = At, ea = Ot, ra = F, { KeyObject: ta, createSecretKey: na, createPublicKey: sa } = j,
|
|
1382
|
-
ea && (
|
|
1380
|
+
}, Jo = er, Ot = Jo.satisfies(process.version, "^6.12.0 || >=8.0.0");
|
|
1381
|
+
const I = ve, Yo = Et, jr = yt, zo = mt, Zo = gt, Qo = At, ea = Ot, ra = F, { KeyObject: ta, createSecretKey: na, createPublicKey: sa } = j, Fe = ["RS256", "RS384", "RS512"], ia = ["ES256", "ES384", "ES512"], Ve = ["RS256", "RS384", "RS512"], oa = ["HS256", "HS384", "HS512"];
|
|
1382
|
+
ea && (Fe.splice(Fe.length, 0, "PS256", "PS384", "PS512"), Ve.splice(Ve.length, 0, "PS256", "PS384", "PS512"));
|
|
1383
1383
|
var aa = function(e, t, r, n) {
|
|
1384
1384
|
typeof r == "function" && !n && (n = r, r = {}), r || (r = {}), r = Object.assign({}, r);
|
|
1385
1385
|
let s;
|
|
@@ -1439,7 +1439,7 @@ var aa = function(e, t, r, n) {
|
|
|
1439
1439
|
return s(new I("secretOrPublicKey is not valid key material"));
|
|
1440
1440
|
}
|
|
1441
1441
|
}
|
|
1442
|
-
if (r.algorithms || (u.type === "secret" ? r.algorithms = oa : ["rsa", "rsa-pss"].includes(u.asymmetricKeyType) ? r.algorithms =
|
|
1442
|
+
if (r.algorithms || (u.type === "secret" ? r.algorithms = oa : ["rsa", "rsa-pss"].includes(u.asymmetricKeyType) ? r.algorithms = Ve : u.asymmetricKeyType === "ec" ? r.algorithms = ia : r.algorithms = Fe), r.algorithms.indexOf(l.header.alg) === -1)
|
|
1443
1443
|
return s(new I("invalid algorithm"));
|
|
1444
1444
|
if (a.alg.startsWith("HS") && u.type !== "secret")
|
|
1445
1445
|
return s(new I(`secretOrPublicKey must be a symmetric key when using ${a.alg}`));
|
|
@@ -1546,11 +1546,11 @@ function Ta(e, t) {
|
|
|
1546
1546
|
return e(t(r));
|
|
1547
1547
|
};
|
|
1548
1548
|
}
|
|
1549
|
-
var Ae = Object.prototype,
|
|
1549
|
+
var Ae = Object.prototype, rr = Ae.hasOwnProperty, Oe = Ae.toString, Aa = Ae.propertyIsEnumerable, Oa = Ta(Object.keys, Object), Na = Math.max;
|
|
1550
1550
|
function La(e, t) {
|
|
1551
1551
|
var r = Lt(e) || Da(e) ? Ia(e.length, String) : [], n = r.length, s = !!n;
|
|
1552
1552
|
for (var i in e)
|
|
1553
|
-
(t ||
|
|
1553
|
+
(t || rr.call(e, i)) && !(s && (i == "length" || Pa(i, n))) && r.push(i);
|
|
1554
1554
|
return r;
|
|
1555
1555
|
}
|
|
1556
1556
|
function ja(e) {
|
|
@@ -1558,7 +1558,7 @@ function ja(e) {
|
|
|
1558
1558
|
return Oa(e);
|
|
1559
1559
|
var t = [];
|
|
1560
1560
|
for (var r in Object(e))
|
|
1561
|
-
|
|
1561
|
+
rr.call(e, r) && r != "constructor" && t.push(r);
|
|
1562
1562
|
return t;
|
|
1563
1563
|
}
|
|
1564
1564
|
function Pa(e, t) {
|
|
@@ -1569,39 +1569,39 @@ function _a(e) {
|
|
|
1569
1569
|
return e === r;
|
|
1570
1570
|
}
|
|
1571
1571
|
function xa(e, t, r, n) {
|
|
1572
|
-
e =
|
|
1572
|
+
e = tr(e) ? e : Xa(e), r = r && !n ? Ua(r) : 0;
|
|
1573
1573
|
var s = e.length;
|
|
1574
1574
|
return r < 0 && (r = Na(s + r, 0)), Fa(e) ? r <= s && e.indexOf(t, r) > -1 : !!s && wa(e, t, r) > -1;
|
|
1575
1575
|
}
|
|
1576
1576
|
function Da(e) {
|
|
1577
|
-
return Ca(e) &&
|
|
1577
|
+
return Ca(e) && rr.call(e, "callee") && (!Aa.call(e, "callee") || Oe.call(e) == fa);
|
|
1578
1578
|
}
|
|
1579
1579
|
var Lt = Array.isArray;
|
|
1580
|
-
function
|
|
1580
|
+
function tr(e) {
|
|
1581
1581
|
return e != null && Ga(e.length) && !Ba(e);
|
|
1582
1582
|
}
|
|
1583
1583
|
function Ca(e) {
|
|
1584
|
-
return
|
|
1584
|
+
return nr(e) && tr(e);
|
|
1585
1585
|
}
|
|
1586
1586
|
function Ba(e) {
|
|
1587
|
-
var t =
|
|
1587
|
+
var t = ke(e) ? Oe.call(e) : "";
|
|
1588
1588
|
return t == ua || t == la;
|
|
1589
1589
|
}
|
|
1590
1590
|
function Ga(e) {
|
|
1591
1591
|
return typeof e == "number" && e > -1 && e % 1 == 0 && e <= Nt;
|
|
1592
1592
|
}
|
|
1593
|
-
function
|
|
1593
|
+
function ke(e) {
|
|
1594
1594
|
var t = typeof e;
|
|
1595
1595
|
return !!e && (t == "object" || t == "function");
|
|
1596
1596
|
}
|
|
1597
|
-
function
|
|
1597
|
+
function nr(e) {
|
|
1598
1598
|
return !!e && typeof e == "object";
|
|
1599
1599
|
}
|
|
1600
1600
|
function Fa(e) {
|
|
1601
|
-
return typeof e == "string" || !Lt(e) &&
|
|
1601
|
+
return typeof e == "string" || !Lt(e) && nr(e) && Oe.call(e) == ha;
|
|
1602
1602
|
}
|
|
1603
1603
|
function Va(e) {
|
|
1604
|
-
return typeof e == "symbol" ||
|
|
1604
|
+
return typeof e == "symbol" || nr(e) && Oe.call(e) == pa;
|
|
1605
1605
|
}
|
|
1606
1606
|
function ka(e) {
|
|
1607
1607
|
if (!e)
|
|
@@ -1621,9 +1621,9 @@ function Ha(e) {
|
|
|
1621
1621
|
return e;
|
|
1622
1622
|
if (Va(e))
|
|
1623
1623
|
return _r;
|
|
1624
|
-
if (
|
|
1624
|
+
if (ke(e)) {
|
|
1625
1625
|
var t = typeof e.valueOf == "function" ? e.valueOf() : e;
|
|
1626
|
-
e =
|
|
1626
|
+
e = ke(t) ? t + "" : t;
|
|
1627
1627
|
}
|
|
1628
1628
|
if (typeof e != "string")
|
|
1629
1629
|
return e === 0 ? e : +e;
|
|
@@ -1632,7 +1632,7 @@ function Ha(e) {
|
|
|
1632
1632
|
return r || $a.test(e) ? ga(e.slice(2), r ? 2 : 8) : da.test(e) ? _r : +e;
|
|
1633
1633
|
}
|
|
1634
1634
|
function Ma(e) {
|
|
1635
|
-
return
|
|
1635
|
+
return tr(e) ? La(e) : ja(e);
|
|
1636
1636
|
}
|
|
1637
1637
|
function Xa(e) {
|
|
1638
1638
|
return e ? Ra(e, Ma(e)) : [];
|
|
@@ -1779,7 +1779,7 @@ function rf(e) {
|
|
|
1779
1779
|
return r || Xc.test(e) ? Kc(e.slice(2), r ? 2 : 8) : Hc.test(e) ? Gr : +e;
|
|
1780
1780
|
}
|
|
1781
1781
|
var tf = Yc;
|
|
1782
|
-
const Vr = gt, nf = Ot, sf = At, kr = F, of = Ka, fe = Za, Ur = mc,
|
|
1782
|
+
const Vr = gt, nf = Ot, sf = At, kr = F, of = Ka, fe = Za, Ur = mc, Ce = Sc, _t = jc, k = Gc, af = tf, { KeyObject: cf, createSecretKey: ff, createPrivateKey: uf } = j, xt = ["RS256", "RS384", "RS512", "ES256", "ES384", "ES512", "HS256", "HS384", "HS512", "none"];
|
|
1783
1783
|
nf && xt.splice(3, 0, "PS256", "PS384", "PS512");
|
|
1784
1784
|
const lf = {
|
|
1785
1785
|
expiresIn: { isValid: function(e) {
|
|
@@ -1803,9 +1803,9 @@ const lf = {
|
|
|
1803
1803
|
allowInsecureKeySizes: { isValid: fe, message: '"allowInsecureKeySizes" must be a boolean' },
|
|
1804
1804
|
allowInvalidAsymmetricKeyTypes: { isValid: fe, message: '"allowInvalidAsymmetricKeyTypes" must be a boolean' }
|
|
1805
1805
|
}, hf = {
|
|
1806
|
-
iat: { isValid:
|
|
1807
|
-
exp: { isValid:
|
|
1808
|
-
nbf: { isValid:
|
|
1806
|
+
iat: { isValid: Ce, message: '"iat" should be a number of seconds' },
|
|
1807
|
+
exp: { isValid: Ce, message: '"exp" should be a number of seconds' },
|
|
1808
|
+
nbf: { isValid: Ce, message: '"nbf" should be a number of seconds' }
|
|
1809
1809
|
};
|
|
1810
1810
|
function Dt(e, t, r, n) {
|
|
1811
1811
|
if (!_t(r))
|
|
@@ -1960,13 +1960,14 @@ var Ef = function(e, t, r, n) {
|
|
|
1960
1960
|
};
|
|
1961
1961
|
const Mr = /* @__PURE__ */ qt($f);
|
|
1962
1962
|
class yf {
|
|
1963
|
-
constructor(t) {
|
|
1964
|
-
|
|
1965
|
-
this
|
|
1963
|
+
constructor(t, r) {
|
|
1964
|
+
Ne(this, "secretPrivateKey", "secretPrivateKey");
|
|
1965
|
+
Ne(this, "daysToExpire", 30);
|
|
1966
|
+
this.secretPrivateKey = t, this.daysToExpire = r;
|
|
1966
1967
|
}
|
|
1967
|
-
createAccessToken(t, r
|
|
1968
|
+
createAccessToken(t, r) {
|
|
1968
1969
|
return Mr.sign({ [t]: r }, this.secretPrivateKey, {
|
|
1969
|
-
expiresIn: 60 * 60 * 24 *
|
|
1970
|
+
expiresIn: 60 * 60 * 24 * this.daysToExpire
|
|
1970
1971
|
});
|
|
1971
1972
|
}
|
|
1972
1973
|
verifyAccessToken(t) {
|
package/dist/token.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./token-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./token-3d1b3c32.cjs");exports.Token=e.Token;
|
package/dist/token.es.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export declare class Token {
|
|
2
2
|
secretPrivateKey: string;
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
daysToExpire: number;
|
|
4
|
+
constructor(secretPrivateKey: string, daysToExpire?: number);
|
|
5
|
+
createAccessToken(key: string, value: string): any;
|
|
5
6
|
verifyAccessToken(token: string): any;
|
|
6
7
|
}
|