let redirect_uri = window.location.href.split("?")[0];
let redirect_uri = window.location.href.split("?")[0];
let url = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appid}&redirect_uri=${redirect_uri}&response_type=code&scope=${scope}&state=STATE#wechat_redirect`;
let url = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appid}&redirect_uri=${redirect_uri}&response_type=code&scope=${scope}&state=STATE#wechat_redirect`;
"use strict";function_interopDefault(e){returne&&"object"==typeofe&&"default"ine?e.default:e}varbuffer=_interopDefault(require("buffer")),stream=_interopDefault(require("stream")),util=_interopDefault(require("util")),crypto=_interopDefault(require("crypto"));functioncreateCommonjsModule(e,r){returne(r={exports:{}},r.exports),r.exports}varsafeBuffer=createCommonjsModule((function(e,r){vart=buffer.Buffer;functionn(e,r){for(vartine)r[t]=e[t]}functiono(e,r,n){returnt(e,r,n)}t.from&&t.alloc&&t.allocUnsafe&&t.allocUnsafeSlow?e.exports=buffer:(n(buffer,r),r.Buffer=o),o.prototype=Object.create(t.prototype),n(t,o),o.from=function(e,r,n){if("number"==typeofe)thrownewTypeError("Argument must not be a number");returnt(e,r,n)},o.alloc=function(e,r,n){if("number"!=typeofe)thrownewTypeError("Argument must be a number");varo=t(e);returnvoid0!==r?"string"==typeofn?o.fill(r,n):o.fill(r):o.fill(0),o},o.allocUnsafe=function(e){if("number"!=typeofe)thrownewTypeError("Argument must be a number");returnt(e)},o.allocUnsafeSlow=function(e){if("number"!=typeofe)thrownewTypeError("Argument must be a number");returnbuffer.SlowBuffer(e)}})),safeBuffer_1=safeBuffer.Buffer,Buffer$1=safeBuffer.Buffer;functionDataStream(e){if(this.buffer=null,this.writable=!0,this.readable=!0,!e)returnthis.buffer=Buffer$1.alloc(0),this;if("function"==typeofe.pipe)returnthis.buffer=Buffer$1.alloc(0),e.pipe(this),this;if(e.length||"object"==typeofe)returnthis.buffer=e,this.writable=!1,process.nextTick(function(){this.emit("end",e),this.readable=!1,this.emit("close")}.bind(this)),this;thrownewTypeError("Unexpected data type ("+typeofe+")")}util.inherits(DataStream,stream),DataStream.prototype.write=function(e){this.buffer=Buffer$1.concat([this.buffer,Buffer$1.from(e)]),this.emit("data",e)},DataStream.prototype.end=function(e){e&&this.write(e),this.emit("end",e),this.emit("close"),this.writable=!1,this.readable=!1};vardataStream=DataStream,Buffer$2=buffer.Buffer,SlowBuffer=buffer.SlowBuffer,bufferEqualConstantTime=bufferEq;functionbufferEq(e,r){if(!Buffer$2.isBuffer(e)||!Buffer$2.isBuffer(r))return!1;if(e.length!==r.length)return!1;for(vart=0,n=0;n<e.length;n++)t|=e[n]^r[n];return0===t}bufferEq.install=function(){Buffer$2.prototype.equal=SlowBuffer.prototype.equal=function(e){returnbufferEq(this,e)}};varorigBufEqual=Buffer$2.prototype.equal,origSlowBufEqual=SlowBuffer.prototype.equal;functiongetParamSize(e){return(e/8|0)+(e%8==0?0:1)}bufferEq.restore=function(){Buffer$2.prototype.equal=origBufEqual,SlowBuffer.prototype.equal=origSlowBufEqual};varparamBytesForAlg={ES256:getParamSize(256),ES384:getParamSize(384),ES512:getParamSize(521)};functiongetParamBytesForAlg(e){varr=paramBytesForAlg[e];if(r)returnr;thrownewError('Unknown algorithm "'+e+'"')}varparamBytesForAlg_1=getParamBytesForAlg,Buffer$3=safeBuffer.Buffer,MAX_OCTET=128,CLASS_UNIVERSAL=0,PRIMITIVE_BIT=32,TAG_SEQ=16,TAG_INT=2,ENCODED_TAG_SEQ=TAG_SEQ|PRIMITIVE_BIT|CLASS_UNIVERSAL<<6,ENCODED_TAG_INT=TAG_INT|CLASS_UNIVERSAL<<6;functionbase64Url(e){returne.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}functionsignatureAsBuffer(e){if(Buffer$3.isBuffer(e))returne;if("string"==typeofe)returnBuffer$3.from(e,"base64");thrownewTypeError("ECDSA signature must be a Base64 string or a Buffer")}functionderToJose(e,r){e=signatureAsBuffer(e);vart=paramBytesForAlg_1(r),n=t+1,o=e.length,i=0;if(e[i++]!==ENCODED_TAG_SEQ)thrownewError('Could not find expected "seq"');vars=e[i++];if(s===(1|MAX_OCTET)&&(s=e[i++]),o-i<s)thrownewError('"seq" specified length of "'+s+'", only "'+(o-i)+'" remaining');if(e[i++]!==ENCODED_TAG_INT)thrownewError('Could not find expected "int" for "r"');vara=e[i++];if(o-i-2<a)thrownewError('"r" specified length of "'+a+'", only "'+(o-i-2)+'" available');if(n<a)thrownewError('"r" specified length of "'+a+'", max of "'+n+'" is acceptable');varu=i;if(i+=a,e[i++]!==ENCODED_TAG_INT)thrownewError('Could not find expected "int" for "s"');varc=e[i++];if(o-i!==c)thrownewError('"s" specified length of "'+c+'", expected "'+(o-i)+'"');if(n<c)thrownewError('"s" specified length of "'+c+'", max of "'+n+'" is acceptable');varf=i;if((i+=c)!==o)thrownewError('Expected to consume entire buffer, but "'+(o-i)+'" bytes remain');varl=t-a,p=t-c,m=Buffer$3.allocUnsafe(l+a+p+c);for(i=0;i<l;++i)m[i]=0;e.copy(m,i,u+Math.max(-l,0),u+a);for(varh=i=t;i<h+p;++i)m[i]=0;returne.copy(m,i,f+Math.max(-p,0),f+c),m=base64Url(m=m.toString("base64"))}functioncountPadding(e,r,t){for(varn=0;r+n<t&&0===e[r+n];)++n;returne[r+n]>=MAX_OCTET&&--n,n}functionjoseToDer(e,r){e=signatureAsBuffer(e);vart=paramBytesForAlg_1(r),n=e.length;if(n!==2*t)thrownewTypeError('"'+r+'" signatures must be "'+2*t+'" bytes, saw "'+n+'"');varo=countPadding(e,0,t),i=countPadding(e,t,e.length),s=t-o,a=t-i,u=2+s+1+1+a,c=u<MAX_OCTET,f=Buffer$3.allocUnsafe((c?2:3)+u),l=0;returnf[l++]=ENCODED_TAG_SEQ,c?f[l++]=u:(f[l++]=1|MAX_OCTET,f[l++]=255&u),f[l++]=ENCODED_TAG_INT,f[l++]=s,o<0?(f[l++]=0,l+=e.copy(f,l,0,t)):l+=e.copy(f,l,o,t),f[l++]=ENCODED_TAG_INT,f[l++]=a,i<0?(f[l++]=0,e.copy(f,l,t)):e.copy(f,l,t+i),f}varecdsaSigFormatter={derToJose:derToJose,joseToDer:joseToDer},Buffer$4=safeBuffer.Buffer,MSG_INVALID_ALGORITHM='"%s" is not a valid algorithm.\n Supported algorithms are:\n "HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".',MSG_INVALID_SECRET="secret must be a string or buffer",MSG_INVALID_VERIFIER_KEY="key must be a string or a buffer",MSG_INVALID_SIGNER_KEY="key must be a string, a buffer or an object",supportsKeyObjects="function"==typeofcrypto.createPublicKey;functioncheckIsPublicKey(e){if(!Buffer$4.isBuffer(e)&&"string"!=typeofe){if(!supportsKeyObjects)throwtypeError(MSG_INVALID_VERIFIER_KEY);if("object"!=typeofe)throwtypeError(MSG_INVALID_VERIFIER_KEY);if("string"!=typeofe.type)throwtypeError(MSG_INVALID_VERIFIER_KEY);if("string"!=typeofe.asymmetricKeyType)throwtypeError(MSG_INVALID_VERIFIER_KEY);if("function"!=typeofe.export)throwtypeError(MSG_INVALID_VERIFIER_KEY)}}functioncheckIsPrivateKey(e){if(!Buffer$4.isBuffer(e)&&"string"!=typeofe&&"object"!=typeofe)throwtypeError(MSG_INVALID_SIGNER_KEY)}functioncheckIsSecretKey(e){if(!Buffer$4.isBuffer(e)){if("string"==typeofe)returne;if(!supportsKeyObjects)throwtypeError(MSG_INVALID_SECRET);if("object"!=typeofe)throwtypeError(MSG_INVALID_SECRET);if("secret"!==e.type)throwtypeError(MSG_INVALID_SECRET);if("function"!=typeofe.export)throwtypeError(MSG_INVALID_SECRET)}}functionfromBase64(e){returne.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}functiontoBase64(e){varr=4-(e=e.toString()).length%4;if(4!==r)for(vart=0;t<r;++t)e+="=";returne.replace(/\-/g,"+").replace(/_/g,"/")}functiontypeError(e){varr=[].slice.call(arguments,1),t=util.format.bind(util,e).apply(null,r);returnnewTypeError(t)}functionbufferOrString(e){returnBuffer$4.isBuffer(e)||"string"==typeofe}functionnormalizeInput(e){returnbufferOrString(e)||(e=JSON.stringify(e)),e}functioncreateHmacSigner(e){returnfunction(r,t){checkIsSecretKey(t),r=normalizeInput(r);varn=crypto.createHmac("sha"+e,t);returnfromBase64((n.update(r),n.digest("base64")))}}functioncreateHmacVerifier(e){returnfunction(r,t,n){varo=createHmacSigner(e)(r,n);returnbufferEqualConstantTime(Buffer$4.from(t),Buffer$4.from(o))}}functioncreateKeySigner(e){returnfunction(r,t){checkIsPrivateKey(t),r=normalizeInput(r);varn=crypto.createSign("RSA-SHA"+e);returnfromBase64((n.update(r),n.sign(t,"base64")))}}functioncreateKeyVerifier(e){returnfunction(r,t,n){checkIsPublicKey(n),r=normalizeInput(r),t=toBase64(t);varo=crypto.createVerify("RSA-SHA"+e);returno.update(r),o.verify(n,t,"base64")}}functioncreatePSSKeySigner(e){returnfunction(r,t){checkIsPrivateKey(t),r=normalizeInput(r);varn=crypto.createSign("RSA-SHA"+e);returnfromBase64((n.update(r),n.sign({key:t,padding:crypto.constants.RSA_PKCS1_PSS_PADDING,saltLength:crypto.constants.RSA_PSS_SALTLEN_DIGEST},"base64")))}}functioncreatePSSKeyVerifier(e){returnfunction(r,t,n){checkIsPublicKey(n),r=normalizeInput(r),t=toBase64(t);varo=crypto.createVerify("RSA-SHA"+e);returno.update(r),o.verify({key:n,padding:crypto.constants.RSA_PKCS1_PSS_PADDING,saltLength:crypto.constants.RSA_PSS_SALTLEN_DIGEST},t,"base64")}}functioncreateECDSASigner(e){varr=createKeySigner(e);returnfunction(){vart=r.apply(null,arguments);returnt=ecdsaSigFormatter.derToJose(t,"ES"+e)}}functioncreateECDSAVerifer(e){varr=createKeyVerifier(e);returnfunction(t,n,o){returnn=ecdsaSigFormatter.joseToDer(n,"ES"+e).toString("base64"),r(t,n,o)}}functioncreateNoneSigner(){returnfunction(){return""}}functioncreateNoneVerifier(){returnfunction(e,r){return""===r}}supportsKeyObjects&&(MSG_INVALID_VERIFIER_KEY+=" or a KeyObject",MSG_INVALID_SECRET+="or a KeyObject");varjwa=function(e){varr={hs:createHmacSigner,rs:createKeySigner,ps:createPSSKeySigner,es:createECDSASigner,none:createNoneSigner},t={hs:createHmacVerifier,rs:createKeyVerifier,ps:createPSSKeyVerifier,es:createECDSAVerifer,none:createNoneVerifier},n=e.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/i);if(!n)throwtypeError(MSG_INVALID_ALGORITHM,e);varo=(n[1]||n[3]).toLowerCase(),i=n[2];return{sign:r[o](i),verify:t[o](i)}},Buffer$5=buffer.Buffer,tostring=function(e){return"string"==typeofe?e:"number"==typeofe||Buffer$5.isBuffer(e)?e.toString():JSON.stringify(e)},Buffer$6=safeBuffer.Buffer;functionbase64url(e,r){returnBuffer$6.from(e,r).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}functionjwsSecuredInput(e,r,t){t=t||"utf8";varn=base64url(tostring(e),"binary"),o=base64url(tostring(r),t);returnutil.format("%s.%s",n,o)}functionjwsSign(e){varr=e.header,t=e.payload,n=e.secret||e.privateKey,o=e.encoding,i=jwa(r.alg),s=jwsSecuredInput(r,t,o),a=i.sign(s,n);returnutil.format("%s.%s",s,a)}functionSignStream(e){varr=e.secret||e.privateKey||e.key,t=newdataStream(r);this.readable=!0,this.header=e.header,this.encoding=e.encoding,this.secret=this.privateKey=this.key=t,this.payload=newdataStream(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))}util.inherits(SignStream,stream),SignStream.prototype.sign=function(){try{vare=jwsSign({header:this.header,payload:this.payload.buffer,secret:this.secret.buffer,encoding:this.encoding});returnthis.emit("done",e),this.emit("data",e),this.emit("end"),this.readable=!1,e}catch(e){this.readable=!1,this.emit("error",e),this.emit("close")}},SignStream.sign=jwsSign;varsignStream=SignStream,Buffer$7=safeBuffer.Buffer,JWS_REGEX=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;functionisObject(e){return"[object Object]"===Object.prototype.toString.call(e)}functionsafeJsonParse(e){if(isObject(e))returne;try{returnJSON.parse(e)}catch(e){return}}functionheaderFromJWS(e){varr=e.split(".",1)[0];returnsafeJsonParse(Buffer$7.from(r,"base64").toString("binary"))}functionsecuredInputFromJWS(e){returne.split(".",2).join(".")}functionsignatureFromJWS(e){returne.split(".")[2]}functionpayloadFromJWS(e,r){r=r||"utf8";vart=e.split(".")[1];returnBuffer$7.from(t,"base64").toString(r)}functionisValidJws(e){returnJWS_REGEX.test(e)&&!!headerFromJWS(e)}functionjwsVerify(e,r,t){if(!r){varn=newError("Missing algorithm parameter for jws.verify");thrown.code="MISSING_ALGORITHM",n}varo=signatureFromJWS(e=tostring(e)),i=securedInputFromJWS(e);returnjwa(r).verify(i,o,t)}functionjwsDecode(e,r){if(r=r||{},!isValidJws(e=tostring(e)))returnnull;vart=headerFromJWS(e);if(!t)returnnull;varn=payloadFromJWS(e);return("JWT"===t.typ||r.json)&&(n=JSON.parse(n,r.encoding)),{header:t,payload:n,signature:signatureFromJWS(e)}}functionVerifyStream(e){varr=(e=e||{}).secret||e.publicKey||e.key,t=newdataStream(r);this.readable=!0,this.algorithm=e.algorithm,this.encoding=e.encoding,this.secret=this.publicKey=this.key=t,this.signature=newdataStream(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))}util.inherits(VerifyStream,stream),VerifyStream.prototype.verify=function(){try{vare=jwsVerify(this.signature.buffer,this.algorithm,this.key.buffer),r=jwsDecode(this.signature.buffer,this.encoding);returnthis.emit("done",e,r),this.emit("data",e),this.emit("end"),this.readable=!1,e}catch(e){this.readable=!1,this.emit("error",e),this.emit("close")}},VerifyStream.decode=jwsDecode,VerifyStream.isValid=isValidJws,VerifyStream.verify=jwsVerify;varverifyStream=VerifyStream,ALGORITHMS=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"],ALGORITHMS_1=ALGORITHMS,sign=signStream.sign,verify=verifyStream.verify,decode=verifyStream.decode,isValid=verifyStream.isValid,createSign=function(e){returnnewsignStream(e)},createVerify=function(e){returnnewverifyStream(e)},jws={ALGORITHMS:ALGORITHMS_1,sign:sign,verify:verify,decode:decode,isValid:isValid,createSign:createSign,createVerify:createVerify},decode$1=function(e,r){r=r||{};vart=jws.decode(e,r);if(!t)returnnull;varn=t.payload;if("string"==typeofn)try{varo=JSON.parse(n);null!==o&&"object"==typeofo&&(n=o)}catch(e){}return!0===r.complete?{header:t.header,payload:n,signature:t.signature}:n},JsonWebTokenError=function(e,r){Error.call(this,e),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name="JsonWebTokenError",this.message=e,r&&(this.inner=r)};JsonWebTokenError.prototype=Object.create(Error.prototype),JsonWebTokenError.prototype.constructor=JsonWebTokenError;varJsonWebTokenError_1=JsonWebTokenError,NotBeforeError=function(e,r){JsonWebTokenError_1.call(this,e),this.name="NotBeforeError",this.date=r};NotBeforeError.prototype=Object.create(JsonWebTokenError_1.prototype),NotBeforeError.prototype.constructor=NotBeforeError;varNotBeforeError_1=NotBeforeError,TokenExpiredError=function(e,r){JsonWebTokenError_1.call(this,e),this.name="TokenExpiredError",this.expiredAt=r};TokenExpiredError.prototype=Object.create(JsonWebTokenError_1.prototype),TokenExpiredError.prototype.constructor=TokenExpiredError;varTokenExpiredError_1=TokenExpiredError,s=1e3,m=60*s,h=60*m,d=24*h,w=7*d,y=365.25*d,ms=function(e,r){r=r||{};vart=typeofe;if("string"===t&&e.length>0)returnparse(e);if("number"===t&&isFinite(e))returnr.long?fmtLong(e):fmtShort(e);thrownewError("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};functionparse(e){if(!((e=String(e)).length>100)){varr=/^(-?(?:\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(r){vart=parseFloat(r[1]);switch((r[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":returnt*y;case"weeks":case"week":case"w":returnt*w;case"days":case"day":case"d":returnt*d;case"hours":case"hour":case"hrs":case"hr":case"h":returnt*h;case"minutes":case"minute":case"mins":case"min":case"m":returnt*m;case"seconds":case"second":case"secs":case"sec":case"s":returnt*s;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":returnt;default:return}}}}functionfmtShort(e){varr=Math.abs(e);returnr>=d?Math.round(e/d)+"d":r>=h?Math.round(e/h)+"h":r>=m?Math.round(e/m)+"m":r>=s?Math.round(e/s)+"s":e+"ms"}functionfmtLong(e){varr=Math.abs(e);returnr>=d?plural(e,r,d,"day"):r>=h?plural(e,r,h,"hour"):r>=m?plural(e,r,m,"minute"):r>=s?plural(e,r,s,"second"):e+" ms"}functionplural(e,r,t,n){varo=r>=1.5*t;returnMath.round(e/t)+""+n+(o?"s":"")}vartimespan=function(e,r){vart=r||Math.floor(Date.now()/1e3);if("string"==typeofe){varn=ms(e);if(void0===n)return;returnMath.floor(t+n/1e3)}return"number"==typeofe?t+e:void0},semver=createCommonjsModule((function(e,r){vart;r=e.exports=Y,t="object"==typeofprocess&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?function(){vare=Array.prototype.slice.call(arguments,0);e.unshift("SEMVER"),console.log.apply(console,e)}:function(){},r.SEMVER_SPEC_VERSION="2.0.0";varn=Number.MAX_SAFE_INTEGER||9007199254740991,o=r.re=[],i=r.safeRe=[],s=r.src=[],a=0,u=[["\\s",1],["\\d",256],["[a-zA-Z0-9-]",250]];functionc(e){for(varr=0;r<u.length;r++){vart=u[r][0],n=u[r][1];e=e.split(t+"*").join(t+"{0,"+n+"}").split(t+"+").join(t+"{1,"+n+"}")}returne}varf=a++;s[f]="0|[1-9]\\d*";varl=a++;s[l]="\\d+";varp=a++;s[p]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";varm=a++;s[m]="("+s[f]+")\\.("+s[f]+")\\.("+s[f]+")";varh=a++;s[h]="("+s[l]+")\\.("+s[l]+")\\.("+s[l]+")";vard=a++;s[d]="(?:"+s[f]+"|"+s[p]+")";varv=a++;s[v]="(?:"+s[l]+"|"+s[p]+")";varg=a++;s[g]="(?:-("+s[d]+"(?:\\."+s[d]+")*))";vary=a++;s[y]="(?:-?("+s[v]+"(?:\\."+s[v]+")*))";varb=a++;s[b]="[a-zA-Z0-9-]+";varS=a++;s[S]="(?:\\+("+s[b]+"(?:\\."+s[b]+")*))";varE=a++,w="v?"+s[m]+s[g]+"?"+s[S]+"?";s[E]="^"+w+"$";var_="[v=\\s]*"+s[h]+s[y]+"?"+s[S]+"?",j=a++;s[j]="^"+_+"$";varT=a++;s[T]="((?:<|>)?=?)";varI=a++;s[I]=s[l]+"|x|X|\\*";var$=a++;s[$]=s[f]+"|x|X|\\*";varA=a++;s[A]="[v=\\s]*("+s[$]+")(?:\\.("+s[$]+")(?:\\.("+s[$]+")(?:"+s[g]+")?"+s[S]+"?)?)?";varN=a++;s[N]="[v=\\s]*("+s[I]+")(?:\\.("+s[I]+")(?:\\.("+s[I]+")(?:"+s[y]+")?"+s[S]+"?)?)?";varB=a++;s[B]="^"+s[T]+"\\s*"+s[A]+"$";varO=a++;s[O]="^"+s[T]+"\\s*"+s[N]+"$";vark=a++;s[k]="(?:^|[^\\d])(\\d{1,16})(?:\\.(\\d{1,16}))?(?:\\.(\\d{1,16}))?(?:$|[^\\d])";varP=a++;s[P]="(?:~>?)";varR=a++;s[R]="(\\s*)"+s[P]+"\\s+",o[R]=newRegExp(s[R],"g"),i[R]=newRegExp(c(s[R]),"g");varx=a++;s[x]="^"+s[P]+s[A]+"$";varV=a++;s[V]="^"+s[P]+s[N]+"$";varL=a++;s[L]="(?:\\^)";varD=a++;s[D]="(\\s*)"+s[L]+"\\s+",o[D]=newRegExp(s[D],"g"),i[D]=newRegExp(c(s[D]),"g");varG=a++;s[G]="^"+s[L]+s[A]+"$";varM=a++;s[M]="^"+s[L]+s[N]+"$";varJ=a++;s[J]="^"+s[T]+"\\s*("+_+")$|^$";varF=a++;s[F]="^"+s[T]+"\\s*("+w+")$|^$";varK=a++;s[K]="(\\s*)"+s[T]+"\\s*("+_+"|"+s[A]+")",o[K]=newRegExp(s[K],"g"),i[K]=newRegExp(c(s[K]),"g");varC=a++;s[C]="^\\s*("+s[A]+")\\s+-\\s+("+s[A]+")\\s*$";varW=a++;s[W]="^\\s*("+s[N]+")\\s+-\\s+("+s[N]+")\\s*$";varH=a++;s[H]="(<|>)?=?\\s*\\*";for(varq=0;q<35;q++)t(q,s[q]),o[q]||(o[q]=newRegExp(s[q]),i[q]=newRegExp(c(s[q])));functionU(e,r){if(r&&"object"==typeofr||(r={loose:!!r,includePrerelease:!1}),einstanceofY)returne;if("string"!=typeofe)returnnull;if(e.length>256)returnnull;if(!(r.loose?i[j]:i[E]).test(e))returnnull;try{returnnewY(e,r)}catch(e){returnnull}}functionY(e,r){if(r&&"object"==typeofr||(r={loose:!!r,includePrerelease:!1}),einstanceofY){if(e.loose===r.loose)returne;e=e.version}elseif("string"!=typeofe)thrownewTypeError("Invalid Version: "+e);if(e.length>256)thrownewTypeError("version is longer than 256 characters");if(!(thisinstanceofY))returnnewY(e,r);t("SemVer",e,r),this.options=r,this.loose=!!r.loose;varo=e.trim().match(r.loose?i[j]:i[E]);if(!o)thrownewTypeError("Invalid Version: "+e);if(this.raw=e,this.major=+o[1],this.minor=+o[2],this.patch=+o[3],this.major>n||this.major<0)thrownewTypeError("Invalid major version");if(this.minor>n||this.minor<0)thrownewTypeError("Invalid minor version");if(this.patch>n||this.patch<0)thrownewTypeError("Invalid patch version");o[4]?this.prerelease=o[4].split(".").map((function(e){if(/^[0-9]+$/.test(e)){varr=+e;if(r>=0&&r<n)returnr}returne})):this.prerelease=[],this.build=o[5]?o[5].split("."):[],this.format()}r.parse=U,r.valid=function(e,r){vart=U(e,r);returnt?t.version:null},r.clean=function(e,r){vart=U(e.trim().replace(/^[=v]+/,""),r);returnt?t.version:null},r.SemVer=Y,Y.prototype.format=function(){returnthis.version=this.major+"."+this.minor+"."+this.patch,this.prerelease.length&&(this.version+="-"+this.prerelease.join(".")),this.version},Y.prototype.toString=function(){returnthis.version},Y.prototype.compare=function(e){returnt("SemVer.compare",this.version,this.options,e),einstanceofY||(e=newY(e,this.options)),this.compareMain(e)||this.comparePre(e)},Y.prototype.compareMain=function(e){returneinstanceofY||(e=newY(e,this.options)),z(this.major,e.major)||z(this.minor,e.minor)||z(this.patch,e.patch)},Y.prototype.comparePre=function(e){if(einstanceofY||(e=newY(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return1;if(!this.prerelease.length&&!e.prerelease.length)return0;varr=0;do{varn=this.prerelease[r],o=e.prerelease[r];if(t("prerelease compare",r,n,o),void0===n&&void0===o)return0;if(void0===o)return1;if(void0===n)return-1;if(n!==o)returnz(n,o)}while(++r)},Y.prototype.inc=function(e,r){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r),this.inc("pre",r);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",r),this.inc("pre",r);break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":if(0===this.prerelease.length)this.prerelease=[0];else{for(vart=this.prerelease.length;--t>=0;)"number"==typeofthis.prerelease[t]&&(this.prerelease[t]++,t=-2);-1===t&&this.prerelease.push(0)}r&&(this.prerelease[0]===r?isNaN(this.prerelease[1])&&(this.prerelease=[r,0]):this.prerelease=[r,0]);break;default:thrownewError("invalid increment argument: "+e)}returnthis.format(),this.raw=this.version,this},r.inc=function(e,r,t,n){"string"==typeoft&&(n=t,t=void0);try{returnnewY(e,t).inc(r,n).version}catch(e){returnnull}},r.diff=function(e,r){if(re(e,r))returnnull;vart=U(e),n=U(r),o="";if(t.prerelease.length||n.prerelease.length){o="pre";vari="prerelease"}for(varsint)if(("major"===s||"minor"===s||"patch"===s)&&t[s]!==n[s])returno+s;returni},r.compareIdentifiers=z;varX=/^[0-9]+$/;functionz(e,r){vart=X.test(e),n=X.test(r);returnt&&n&&(e=+e,r=+r),e===r?0:t&&!n?-1:n&&!t?1:e<r?-1:1}functionZ(e,r,t){returnnewY(e,t).compare(newY(r,t))}functionQ(e,r,t){returnZ(e,r,t)>0}functionee(e,r,t){returnZ(e,r,t)<0}functionre(e,r,t){return0===Z(e,r,t)}functionte(e,r,t){return0!==Z(e,r,t)}functionne(e,r,t){returnZ(e,r,t)>=0}functionoe(e,r,t){returnZ(e,r,t)<=0}functionie(e,r,t,n){switch(r){case"===":return"object"==typeofe&&(e=e.version),"object"==typeoft&&(t=t.version),e===t;case"!==":return"object"==typeofe&&(e=e.version),"object"==typeoft&&(t=t.version),e!==t;case"":case"=":case"==":returnre(e,t,n);case"!=":returnte(e,t,n);case">":returnQ(e,t,n);case">=":returnne(e,t,n);case"<":returnee(e,t,n);case"<=":returnoe(e,t,n);default:thrownewTypeError("Invalid operator: "+r)}}functionse(e,r){if(r&&"object"==typeofr||(r={loose:!!r,includePrerelease:!1}),einstanceofse){if(e.loose===!!r.loose)returne;e=e.value}if(!(thisinstanceofse))returnnewse(e,r);e=e.trim().split(/\s+/).join(""),t("comparator",e,r),this.options=r,this.loose=!!r.loose,this.parse(e),this.semver===ae?this.value="":this.value=this.operator+this.semver.version,t("comp",this)}r.rcompareIdentifiers=function(e,r){returnz(r,e)},r.major=function(e,r){returnnewY(e,r).major},r.minor=function(e,r){returnnewY(e,r).minor},r.patch=function(e,r){returnnewY(e,r).patch},r.compare=Z,r.compareLoose=function(e,r){returnZ(e,r,!0)},r.rcompare=function(e,r,t){returnZ(r,e,t)},r.sort=function(e,t){returne.sort((function(e,n){returnr.compare(e,n,t)}))},r.rsort=function(e,t){returne.sort((function(e,n){returnr.rcompare(e,n,t)}))},r.gt=Q,r.lt=ee,r.eq=re,r.neq=te,r.gte=ne,r.lte=oe,r.cmp=ie,r.Comparator=se;varae={};functionue(e,r){if(r&&"object"==typeofr||(r={loose:!!r,includePrerelease:!1}),einstanceofue)returne.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:newue(e.raw,r);if(einstanceofse)returnnewue(e.value,r);if(!(thisinstanceofue))returnnewue(e,r);if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=e.trim().split(/\s+/).join(""),this.set=this.raw.split("||").map((function(e){returnthis.parseRange(e.trim())}),this).filter((function(e){returne.length})),!this.set.length)thrownewTypeError("Invalid SemVer Range: "+this.raw);this.format()}functionce(e){return!e||"x"===e.toLowerCase()||"*"===e}functionfe(e,r,t,n,o,i,s,a,u,c,f,l,p){return((r=ce(t)?"":ce(n)?">="+t+".0.0":ce(o)?">="+t+"."+n+".0":">="+r)+""+(a=ce(u)?"":ce(c)?"<"+(+u+1)+".0.0":ce(f)?"<"+u+"."+(+c+1)+".0":l?"<="+u+"."+c+"."+f+"-"+l:"<="+a)).trim()}functionle(e,r,n){for(varo=0;o<e.length;o++)if(!e[o].test(r))return!1;if(r.prerelease.length&&!n.includePrerelease){for(o=0;o<e.length;o++)if(t(e[o].semver),e[o].semver!==ae&&e[o].semver.prerelease.length>0){vari=e[o].semver;if(i.major===r.major&&i.minor===r.minor&&i.patch===r.patch)return!0}return!1}return!0}functionpe(e,r,t){try{r=newue(r,t)}catch(e){return!1}returnr.test(e)}functionme(e,r,t,n){varo,i,s,a,u;switch(e=newY(e,n),r=newue(r,n),t){case">":o=Q,i=oe,s=ee,a=">",u=">=";break;case"<":o=ee,i=ne,s=Q,a="<",u="<=";break;default:thrownewTypeError('Must provide a hilo val of "<" or ">"')}if(pe(e,r,n))return!1;for(varc=0;c<r.set.length;++c){varf=r.set[c],l=null,p=null;if(f.forEach((function(e){e.semver===ae&&(e=newse(">=0.0.0")),l=l||e,p=p||e,o(e.semver,l.semver,n)?l=e:s(e.semver,p.semver,n)&&(p=e)})),l.operator===a||l.operator===u)return!1;if((!p.operator||p.operator===a)&&i(e,p.semver))return!1;if(p.operator===u&&s(e,p.semver))return!1}return!0}se.prototype.parse=function(e){varr=this.options.loose?i[J]:i[F],t=e.match(r);if(!t)thrownewTypeError("Invalid comparator: "+e);this.operator=t[1],"="===this.operator&&(this.operator=""),t[2]?this.semver=newY(t[2],this.options.loose):this.semver=ae},se.prototype.toString=function(){returnthis.value},se.prototype.test=function(e){returnt("Comparator.test",e,this.options.loose),this.semver===ae||("string"==typeofe&&(e=newY(e,this.options)),ie(e,this.operator,this.semver,this.options))},se.prototype.intersects=function(e,r){if(!(einstanceofse))thrownewTypeError("a Comparator is required");vart;if(r&&"object"==typeofr||(r={loose:!!r,includePrerelease:!1}),""===this.operator)returnt=newue(e.value,r),pe(this.value,t,r);if(""===e.operator)returnt=newue(this.value,r),pe(e.semver,t,r);varn=!(">="!==this.operator&&">"!==this.operator||">="!==e.operator&&">"!==e.operator),o=!("<="!==this.operator&&"<"!==this.operator||"<="!==e.operator&&"<"!==e.operator),i=this.semver.version===e.semver.version,s=!(">="!==this.operator&&"<="!==this.operator||">="!==e.operator&&"<="!==e.operator),a=ie(this.semver,"<",e.semver,r)&&(">="===this.operator||">"===this.operator)&&("<="===e.operator||"<"===e.operator),u=ie(this.semver,">",e.semver,r)&&("<="===this.operator||"<"===this.operator)&&(">="===e.operator||">"===e.operator);returnn||o||i&&s||a||u},r.Range=ue,ue.prototype.format=function(){returnthis.range=this.set.map((function(e){returne.join("").trim()})).join("||").trim(),this.range},ue.prototype.toString=function(){returnthis.range},ue.prototype.parseRange=function(e){varr=this.options.loose,n=r?i[W]:i[C];e=e.replace(n,fe),t("hyphen replace",e),e=e.replace(i[K],"$1$2$3"),t("comparator trim",e,i[K]),e=(e=e.replace(i[R],"$1~")).replace(i[D],"$1^");varo=r?i[J]:i[F],s=e.split("").map((function(e){returnfunction(e,r){returnt("comp",e,r),e=function(e,r){returne.trim().split(/\s+/).map((function(e){returnfunction(e,r){t("caret",e,r);varn=r.loose?i[M]:i[G];returne.replace(n,(function(r,n,o,i,s){vara;returnt("caret",e,r,n,o,i,s),ce(n)?a="":ce(o)?a=">="+n+".0.0 <"+(+n+1)+".0.0":ce(i)?a="0"===n?">="+n+"."+o+".0 <"+n+"."+(+o+1)+".0":">="+n+"."+o+".0 <"+(+n+1)+".0.0":s?(t("replaceCaret pr",s),a="0"===n?"0"===o?">="+n+"."+o+"."+i+"-"+s+" <"+n+"."+o+"."+(+i+1):">="+n+"."+o+"."+i+"-"+s+" <"+n+"."+(+o+1)+".0":">="+n+"."+o+"."+i+"-"+s+" <"+(+n+1)+".0.0"):(t("no pr"),a="0"===n?"0"===o?">="+n+"."+o+"."+i+" <"+n+"."+o+"."+(+i+1):">="+n+"."+o+"."+i+" <"+n+"."+(+o+1)+".0":">="+n+"."+o+"."+i+" <"+(+n+1)+".0.0"),t("caret return",a),a}))}(e,r)})).join("")}(e,r),t("caret",e),e=function(e,r){returne.trim().split(/\s+/).map((function(e){returnfunction(e,r){varn=r.loose?i[V]:i[x];returne.replace(n,(function(r,n,o,i,s){vara;returnt("tilde",e,r,n,o,i,s),ce(n)?a="":ce(o)?a=">="+n+".0.0 <"+(+n+1)+".0.0":ce(i)?a=">="+n+"."+o+".0 <"+n+"."+(+o+1)+".0":s?(t("replaceTilde pr",s),a=">="+n+"."+o+"."+i+"-"+s+" <"+n+"."+(+o+1)+".0"):a=">="+n+"."+o+"."+i+" <"+n+"."+(+o+1)+".0",t("tilde return",a),a}))}(e,r)})).join("")}(e,r),t("tildes",e),e=function(e,r){returnt("replaceXRanges",e,r),e.split(/\s+/).map((function(e){returnfunction(e,r){e=e.trim();varn=r.loose?i[O]:i[B];returne.replace(n,(function(r,n,o,i,s,a){t("xRange",e,r,n,o,i,s,a);varu=ce(o),c=u||ce(i),f=c||ce(s);return"="===n&&f&&(n=""),u?r=">"===n||"<"===n?"<0.0.0":"*":n&&f?(c&&(i=0),s=0,">"===n?(n=">=",c?(o=+o+1,i=0,s=0):(i=+i+1,s=0)):"<="===n&&(n="<",c?o=+o+1:i=+i+1),r=n+o+"."+i+"."+s):c?r=">="+o+".0.0 <"+(+o+1)+".0.0":f&&(r=">="+o+"."+i+".0 <"+o+"."+(+i+1)+".0"),t("xRange return",r),r}))}(e,r)})).join("")}(e,r),t("xrange",e),e=function(e,r){returnt("replaceStars",e,r),e.trim().replace(i[H],"")}(e,r),t("stars",e),e}(e,this.options)}),this).join("").split(/\s+/);returnthis.options.loose&&(s=s.filter((function(e){return!!e.match(o)}))),s=s.map((function(e){returnnewse(e,this.options)}),this)},ue.prototype.intersects=function(e,r){if(!(einstanceofue))thrownewTypeError("a Range is required");returnthis.set.some((function(t){returnt.every((function(t){returne.set.some((function(e){returne.every((function(e){returnt.intersects(e,r)}))}))}))}))},r.toComparators=function(e,r){returnnewue(e,r).set.map((function(e){returne.map((function(e){returne.value})).join("").trim().split("")}))},ue.prototype.test=function(e){if(!e)return!1;"string"==typeofe&&(e=newY(e,this.options));for(varr=0;r<this.set.length;r++)if(le(this.set[r],e,this.options))return!0;return!1},r.satisfies=pe,r.maxSatisfying=function(e,r,t){varn=null,o=null;try{vari=newue(r,t)}catch(e){returnnull}returne.forEach((function(e){i.test(e)&&(n&&-1!==o.compare(e)||(o=newY(n=e,t)))})),n},r.minSatisfying=function(e,r,t){varn=null,o=null;try{vari=newue(r,t)}catch(e){returnnull}returne.forEach((function(e){i.test(e)&&(n&&1!==o.compare(e)||(o=newY(n=e,t)))})),n},r.minVersion=function(e,r){e=newue(e,r);vart=newY("0.0.0");if(e.test(t))returnt;if(t=newY("0.0.0-0"),e.test(t))returnt;t=null;for(varn=0;n<e.set.length;++n){e.set[n].forEach((function(e){varr=newY(e.semver.version);switch(e.operator){case">":0===r.prerelease.length?r.patch++:r.prerelease.push(0),r.raw=r.format();case"":case">=":t&&!Q(t,r)||(t=r);break;case"<":case"<=":break;default:thrownewError("Unexpected operation: "+e.operator)}}))}if(t&&e.test(t))returnt;returnnull},r.validRange=function(e,r){try{returnnewue(e,r).range||"*"}catch(e){returnnull}},r.ltr=function(e,r,t){returnme(e,r,"<",t)},r.gtr=function(e,r,t){returnme(e,r,">",t)},r.outside=me,r.prerelease=function(e,r){vart=U(e,r);returnt&&t.prerelease.length?t.prerelease:null},r.intersects=function(e,r,t){returne=newue(e,t),r=newue(r,t),e.intersects(r)},r.coerce=function(e){if(einstanceofY)returne;if("string"!=typeofe)returnnull;varr=e.match(i[k]);if(null==r)returnnull;returnU(r[1]+"."+(r[2]||"0")+"."+(r[3]||"0"))}})),semver_1=semver.SEMVER_SPEC_VERSION,semver_2=semver.re,semver_3=semver.safeRe,semver_4=semver.src,semver_5=semver.parse,semver_6=semver.valid,semver_7=semver.clean,semver_8=semver.SemVer,semver_9=semver.inc,semver_10=semver.diff,semver_11=semver.compareIdentifiers,semver_12=semver.rcompareIdentifiers,semver_13=semver.major,semver_14=semver.minor,semver_15=semver.patch,semver_16=semver.compare,semver_17=semver.compareLoose,semver_18=semver.rcompare,semver_19=semver.sort,semver_20=semver.rsort,semver_21=semver.gt,semver_22=semver.lt,semver_23=semver.eq,semver_24=semver.neq,semver_25=semver.gte,semver_26=semver.lte,semver_27=semver.cmp,semver_28=semver.Comparator,semver_29=semver.Range,semver_30=semver.toComparators,semver_31=semver.satisfies,semver_32=semver.maxSatisfying,semver_33=semver.minSatisfying,semver_34=semver.minVersion,semver_35=semver.validRange,semver_36=semver.ltr,semver_37=semver.gtr,semver_38=semver.outside,semver_39=semver.prerelease,semver_40=semver.intersects,semver_41=semver.coerce,psSupported=semver.satisfies(process.version,"^6.12.0 || >=8.0.0"),PUB_KEY_ALGS=["RS256","RS384","RS512","ES256","ES384","ES512"],RSA_KEY_ALGS=["RS256","RS384","RS512"],HS_ALGS=["HS256","HS384","HS512"];psSupported&&(PUB_KEY_ALGS.splice(3,0,"PS256","PS384","PS512"),RSA_KEY_ALGS.splice(3,0,"PS256","PS384","PS512"));varverify$1=function(e,r,t,n){varo;if("function"!=typeoft||n||(n=t,t={}),t||(t={}),t=Object.assign({},t),o=n||function(e,r){if(e)throwe;returnr},t.clockTimestamp&&"number"!=typeoft.clockTimestamp)returno(newJsonWebTokenError_1("clockTimestamp must be a number"));if(void0!==t.nonce&&("string"!=typeoft.nonce||""===t.nonce.trim()))returno(newJsonWebTokenError_1("nonce must be a non-empty string"));vari=t.clockTimestamp||Math.floor(Date.now()/1e3);if(!e)returno(newJsonWebTokenError_1("jwt must be provided"));if("string"!=typeofe)returno(newJsonWebTokenError_1("jwt must be a string"));vars,a=e.split(".");if(3!==a.length)returno(newJsonWebTokenError_1("jwt malformed"));try{s=decode$1(e,{complete:!0})}catch(e){returno(e)}if(!s)returno(newJsonWebTokenError_1("invalid token"));varu,c=s.header;if("function"==typeofr){if(!n)returno(newJsonWebTokenError_1("verify must be called asynchronous if secret or public key is provided as a callback"));u=r}elseu=function(e,t){returnt(null,r)};returnu(c,(function(r,n){if(r)returno(newJsonWebTokenError_1("error in secret or public key callback: "+r.message));varu,f=""!==a[2].trim();if(!f&&n)returno(newJsonWebTokenError_1("jwt signature is required"));if(f&&!n)returno(newJsonWebTokenError_1("secret or public key must be provided"));if(f||t.algorithms||(t.algorithms=["none"]),t.algorithms||(t.algorithms=~n.toString().indexOf("BEGIN CERTIFICATE")||~n.toString().indexOf("BEGIN PUBLIC KEY")?PUB_KEY_ALGS:~n.toString().indexOf("BEGIN RSA PUBLIC KEY")?RSA_KEY_ALGS:HS_ALGS),!~t.algorithms.indexOf(s.header.alg))returno(newJsonWebTokenError_1("invalid algorithm"));try{u=jws.verify(e,s.header.alg,n)}catch(e){returno(e)}if(!u)returno(newJsonWebTokenError_1("invalid signature"));varl=s.payload;if(void0!==l.nbf&&!t.ignoreNotBefore){if("number"!=typeofl.nbf)returno(newJsonWebTokenError_1("invalid nbf value"));if(l.nbf>i+(t.clockTolerance||0))returno(newNotBeforeError_1("jwt not active",newDate(1e3*l.nbf)))}if(void0!==l.exp&&!t.ignoreExpiration){if("number"!=typeofl.exp)returno(newJsonWebTokenError_1("invalid exp value"));if(i>=l.exp+(t.clockTolerance||0))returno(newTokenExpiredError_1("jwt expired",newDate(1e3*l.exp)))}if(t.audience){varp=Array.isArray(t.audience)?t.audience:[t.audience];if(!(Array.isArray(l.aud)?l.aud:[l.aud]).some((function(e){returnp.some((function(r){returnrinstanceofRegExp?r.test(e):r===e}))})))returno(newJsonWebTokenError_1("jwt audience invalid. expected: "+p.join(" or ")))}if(t.issuer&&("string"==typeoft.issuer&&l.iss!==t.issuer||Array.isArray(t.issuer)&&-1===t.issuer.indexOf(l.iss)))returno(newJsonWebTokenError_1("jwt issuer invalid. expected: "+t.issuer));if(t.subject&&l.sub!==t.subject)returno(newJsonWebTokenError_1("jwt subject invalid. expected: "+t.subject));if(t.jwtid&&l.jti!==t.jwtid)returno(newJsonWebTokenError_1("jwt jwtid invalid. expected: "+t.jwtid));if(t.nonce&&l.nonce!==t.nonce)returno(newJsonWebTokenError_1("jwt nonce invalid. expected: "+t.nonce));if(t.maxAge){if("number"!=typeofl.iat)returno(newJsonWebTokenError_1("iat required when maxAge is specified"));varm=timespan(t.maxAge,l.iat);if(void0===m)returno(newJsonWebTokenError_1('"maxAge" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'));if(i>=m+(t.clockTolerance||0))returno(newTokenExpiredError_1("maxAge exceeded",newDate(1e3*m)))}if(!0===t.complete){varh=s.signature;returno(null,{header:c,payload:l,signature:h})}returno(null,l)}))},INFINITY=1/0,MAX_SAFE_INTEGER=9007199254740991,MAX_INTEGER=17976931348623157e292,NAN=NaN,argsTag="[object Arguments]",funcTag="[object Function]",genTag="[object GeneratorFunction]",stringTag="[object String]",symbolTag="[object Symbol]",reTrim=/^\s+|\s+$/g,reIsBadHex=/^[-+]0x[0-9a-f]+$/i,reIsBinary=/^0b[01]+$/i,reIsOctal=/^0o[0-7]+$/i,reIsUint=/^(?:0|[1-9]\d*)$/,freeParseInt=parseInt;functionarrayMap(e,r){for(vart=-1,n=e?e.length:0,o=Array(n);++t<n;)o[t]=r(e[t],t,e);returno}functionbaseFindIndex(e,r,t,n){for(varo=e.length,i=t+(n?1:-1);n?i--:++i<o;)if(r(e[i],i,e))returni;return-1}functionbaseIndexOf(e,r,t){if(r!=r)returnbaseFindIndex(e,baseIsNaN,t);for(varn=t-1,o=e.length;++n<o;)if(e[n]===r)returnn;return-1}functionbaseIsNaN(e){returne!=e}functionbaseTimes(e,r){for(vart=-1,n=Array(e);++t<e;)n[t]=r(t);returnn}functionbaseValues(e,r){returnarrayMap(r,(function(r){returne[r]}))}functionoverArg(e,r){returnfunction(t){returne(r(t))}}varobjectProto=Object.prototype,hasOwnProperty=objectProto.hasOwnProperty,objectToString=objectProto.toString,propertyIsEnumerable=objectProto.propertyIsEnumerable,nativeKeys=overArg(Object.keys,Object),nativeMax=Math.max;functionarrayLikeKeys(e,r){vart=isArray(e)||isArguments(e)?baseTimes(e.length,String):[],n=t.length,o=!!n;for(variine)!r&&!hasOwnProperty.call(e,i)||o&&("length"==i||isIndex(i,n))||t.push(i);returnt}functionbaseKeys(e){if(!isPrototype(e))returnnativeKeys(e);varr=[];for(vartinObject(e))hasOwnProperty.call(e,t)&&"constructor"!=t&&r.push(t);returnr}functionisIndex(e,r){return!!(r=null==r?MAX_SAFE_INTEGER:r)&&("number"==typeofe||reIsUint.test(e))&&e>-1&&e%1==0&&e<r}functionisPrototype(e){varr=e&&e.constructor;returne===("function"==typeofr&&r.prototype||objectProto)}functionincludes(e,r,t,n){e=isArrayLike(e)?e:values(e),t=t&&!n?toInteger(t):0;varo=e.length;returnt<0&&(t=nativeMax(o+t,0)),isString(e)?t<=o&&e.indexOf(r,t)>-1:!!o&&baseIndexOf(e,r,t)>-1}functionisArguments(e){returnisArrayLikeObject(e)&&hasOwnProperty.call(e,"callee")&&(!propertyIsEnumerable.call(e,"callee")||objectToString.call(e)==argsTag)}varisArray=Array.isArray;functionisArrayLike(e){returnnull!=e&&isLength(e.length)&&!isFunction(e)}functionisArrayLikeObject(e){returnisObjectLike(e)&&isArrayLike(e)}functionisFunction(e){varr=isObject$1(e)?objectToString.call(e):"";returnr==funcTag||r==genTag}functionisLength(e){return"number"==typeofe&&e>-1&&e%1==0&&e<=MAX_SAFE_INTEGER}functionisObject$1(e){varr=typeofe;return!!e&&("object"==r||"function"==r)}functionisObjectLike(e){return!!e&&"object"==typeofe}functionisString(e){return"string"==typeofe||!isArray(e)&&isObjectLike(e)&&objectToString.call(e)==stringTag}functionisSymbol(e){return"symbol"==typeofe||isObjectLike(e)&&objectToString.call(e)==symbolTag}functiontoFinite(e){returne?(e=toNumber(e))===INFINITY||e===-INFINITY?(e<0?-1:1)*MAX_INTEGER:e==e?e:0:0===e?e:0}functiontoInteger(e){varr=toFinite(e),t=r%1;returnr==r?t?r-t:r:0}functiontoNumber(e){if("number"==typeofe)returne;if(isSymbol(e))returnNAN;if(isObject$1(e)){varr="function"==typeofe.valueOf?e.valueOf():e;e=isObject$1(r)?r+"":r}if("string"!=typeofe)return0===e?e:+e;e=e.replace(reTrim,"");vart=reIsBinary.test(e);returnt||reIsOctal.test(e)?freeParseInt(e.slice(2),t?2:8):reIsBadHex.test(e)?NAN:+e}functionkeys(e){returnisArrayLike(e)?arrayLikeKeys(e):baseKeys(e)}functionvalues(e){returne?baseValues(e,keys(e)):[]}varlodash_includes=includes,boolTag="[object Boolean]",objectProto$1=Object.prototype,objectToString$1=objectProto$1.toString;functionisBoolean(e){return!0===e||!1===e||isObjectLike$1(e)&&objectToString$1.call(e)==boolTag}functionisObjectLike$1(e){return!!e&&"object"==typeofe}varlodash_isboolean=isBoolean,INFINITY$1=1/0,MAX_INTEGER$1=17976931348623157e292,NAN$1=NaN,symbolTag$1="[object Symbol]",reTrim$1=/^\s+|\s+$/g,reIsBadHex$1=/^[-+]0x[0-9a-f]+$/i,reIsBinary$1=/^0b[01]+$/i,reIsOctal$1=/^0o[0-7]+$/i,freeParseInt$1=parseInt,objectProto$2=Object.prototype,objectToString$2=objectProto$2.toString;functionisInteger(e){return"number"==typeofe&&e==toInteger$1(e)}functionisObject$2(e){varr=typeofe;return!!e&&("object"==r||"function"==r)}functionisObjectLike$2(e){return!!e&&"object"==typeofe}functionisSymbol$1(e){return"symbol"==typeofe||isObjectLike$2(e)&&objectToString$2.call(e)==symbolTag$1}functiontoFinite$1(e){returne?(e=toNumber$1(e))===INFINITY$1||e===-INFINITY$1?(e<0?-1:1)*MAX_INTEGER$1:e==e?e:0:0===e?e:0}functiontoInteger$1(e){varr=toFinite$1(e),t=r%1;returnr==r?t?r-t:r:0}functiontoNumber$1(e){if("number"==typeofe)returne;if(isSymbol$1(e))returnNAN$1;if(isObject$2(e)){varr="function"==typeofe.valueOf?e.valueOf():e;e=isObject$2(r)?r+"":r}if("string"!=typeofe)return0===e?e:+e;e=e.replace(reTrim$1,"");vart=reIsBinary$1.test(e);returnt||reIsOctal$1.test(e)?freeParseInt$1(e.slice(2),t?2:8):reIsBadHex$1.test(e)?NAN$1:+e}varlodash_isinteger=isInteger,numberTag="[object Number]",objectProto$3=Object.prototype,objectToString$3=objectProto$3.toString;functionisObjectLike$3(e){return!!e&&"object"==typeofe}functionisNumber(e){return"number"==typeofe||isObjectLike$3(e)&&objectToString$3.call(e)==numberTag}varlodash_isnumber=isNumber,objectTag="[object Object]";functionisHostObject(e){varr=!1;if(null!=e&&"function"!=typeofe.toString)try{r=!!(e+"")}catch(e){}returnr}functionoverArg$1(e,r){returnfunction(t){returne(r(t))}}varfuncProto=Function.prototype,objectProto$4=Object.prototype,funcToString=funcProto.toString,hasOwnProperty$1=objectProto$4.hasOwnProperty,objectCtorString=funcToString.call(Object),objectToString$4=objectProto$4.toString,getPrototype=overArg$1(Object.getPrototypeOf,Object);functionisObjectLike$4(e){return!!e&&"object"==typeofe}functionisPlainObject(e){if(!isObjectLike$4(e)||objectToString$4.call(e)!=objectTag||isHostObject(e))return!1;varr=getPrototype(e);if(null===r)return!0;vart=hasOwnProperty$1.call(r,"constructor")&&r.constructor;return"function"==typeoft&&tinstanceoft&&funcToString.call(t)==objectCtorString}varlodash_isplainobject=isPlainObject,stringTag$1="[object String]",objectProto$5=Object.prototype,objectToString$5=objectProto$5.toString,isArray$1=Array.isArray;functionisObjectLike$5(e){return!!e&&"object"==typeofe}functionisString$1(e){return"string"==typeofe||!isArray$1(e)&&isObjectLike$5(e)&&objectToString$5.call(e)==stringTag$1}varlodash_isstring=isString$1,FUNC_ERROR_TEXT="Expected a function",INFINITY$2=1/0,MAX_INTEGER$2=17976931348623157e292,NAN$2=NaN,symbolTag$2="[object Symbol]",reTrim$2=/^\s+|\s+$/g,reIsBadHex$2=/^[-+]0x[0-9a-f]+$/i,reIsBinary$2=/^0b[01]+$/i,reIsOctal$2=/^0o[0-7]+$/i,freeParseInt$2=parseInt,objectProto$6=Object.prototype,objectToString$6=objectProto$6.toString;functionbefore(e,r){vart;if("function"!=typeofr)thrownewTypeError(FUNC_ERROR_TEXT);returne=toInteger$2(e),function(){return--e>0&&(t=r.apply(this,arguments)),e<=1&&(r=void0),t}}functiononce(e){returnbefore(2,e)}functionisObject$3(e){varr=typeofe;return!!e&&("object"==r||"function"==r)}functionisObjectLike$6(e){return!!e&&"object"==typeofe}functionisSymbol$2(e){return"symbol"==typeofe||isObjectLike$6(e)&&objectToString$6.call(e)==symbolTag$2}functiontoFinite$2(e){returne?(e=toNumber$2(e))===INFINITY$2||e===-INFINITY$2?(e<0?-1:1)*MAX_INTEGER$2:e==e?e:0:0===e?e:0}functiontoInteger$2(e){varr=toFinite$2(e),t=r%1;returnr==r?t?r-t:r:0}functiontoNumber$2(e){if("number"==typeofe)returne;if(isSymbol$2(e))returnNAN$2;if(isObject$3(e)){varr="function"==typeofe.valueOf?e.valueOf():e;e=isObject$3(r)?r+"":r}if("string"!=typeofe)return0===e?e:+e;e=e.replace(reTrim$2,"");vart=reIsBinary$2.test(e);returnt||reIsOctal$2.test(e)?freeParseInt$2(e.slice(2),t?2:8):reIsBadHex$2.test(e)?NAN$2:+e}varlodash_once=once,SUPPORTED_ALGS=["RS256","RS384","RS512","ES256","ES384","ES512","HS256","HS384","HS512","none"];psSupported&&SUPPORTED_ALGS.splice(3,0,"PS256","PS384","PS512");varsign_options_schema={expiresIn:{isValid:function(e){returnlodash_isinteger(e)||lodash_isstring(e)&&e},message:'"expiresIn" should be a number of seconds or string representing a timespan'},notBefore:{isValid:function(e){returnlodash_isinteger(e)||lodash_isstring(e)&&e},message:'"notBefore" should be a number of seconds or string representing a timespan'},audience:{isValid:function(e){returnlodash_isstring(e)||Array.isArray(e)},message:'"audience" must be a string or array'},algorithm:{isValid:lodash_includes.bind(null,SUPPORTED_ALGS),message:'"algorithm" must be a valid string enum value'},header:{isValid:lodash_isplainobject,message:'"header" must be an object'},encoding:{isValid:lodash_isstring,message:'"encoding" must be a string'},issuer:{isValid:lodash_isstring,message:'"issuer" must be a string'},subject:{isValid:lodash_isstring,message:'"subject" must be a string'},jwtid:{isValid:lodash_isstring,message:'"jwtid" must be a string'},noTimestamp:{isValid:lodash_isboolean,message:'"noTimestamp" must be a boolean'},keyid:{isValid:lodash_isstring,message:'"keyid" must be a string'},mutatePayload:{isValid:lodash_isboolean,message:'"mutatePayload" must be a boolean'}},registered_claims_schema={iat:{isValid:lodash_isnumber,message:'"iat" should be a number of seconds'},exp:{isValid:lodash_isnumber,message:'"exp" should be a number of seconds'},nbf:{isValid:lodash_isnumber,message:'"nbf" should be a number of seconds'}};functionvalidate(e,r,t,n){if(!lodash_isplainobject(t))thrownewError('Expected "'+n+'" to be a plain object.');Object.keys(t).forEach((function(o){vari=e[o];if(i){if(!i.isValid(t[o]))thrownewError(i.message)}elseif(!r)thrownewError('"'+o+'" is not allowed in "'+n+'"')}))}functionvalidateOptions(e){returnvalidate(sign_options_schema,!1,e,"options")}functionvalidatePayload(e){returnvalidate(registered_claims_schema,!0,e,"payload")}varoptions_to_payload={audience:"aud",issuer:"iss",subject:"sub",jwtid:"jti"},options_for_objects=["expiresIn","notBefore","noTimestamp","audience","issuer","subject","jwtid"],sign$1=function(e,r,t,n){"function"==typeoft?(n=t,t={}):t=t||{};varo="object"==typeofe&&!Buffer.isBuffer(e),i=Object.assign({alg:t.algorithm||"HS256",typ:o?"JWT":void0,kid:t.keyid},t.header);functions(e){if(n)returnn(e);throwe}if(!r&&"none"!==t.algorithm)returns(newError("secretOrPrivateKey must have a value"));if(void0===e)returns(newError("payload is required"));if(o){try{validatePayload(e)}catch(e){returns(e)}t.mutatePayload||(e=Object.assign({},e))}else{vara=options_for_objects.filter((function(e){returnvoid0!==t[e]}));if(a.length>0)returns(newError("invalid "+a.join(",")+" option for "+typeofe+" payload"))}if(void0!==e.exp&&void0!==t.expiresIn)returns(newError('Bad "options.expiresIn" option the payload already has an "exp" property.'));if(void0!==e.nbf&&void0!==t.notBefore)returns(newError('Bad "options.notBefore" option the payload already has an "nbf" property.'));try{validateOptions(t)}catch(e){returns(e)}varu=e.iat||Math.floor(Date.now()/1e3);if(t.noTimestamp?deletee.iat:o&&(e.iat=u),void0!==t.notBefore){try{e.nbf=timespan(t.notBefore,u)}catch(e){returns(e)}if(void0===e.nbf)returns(newError('"notBefore" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}if(void0!==t.expiresIn&&"object"==typeofe){try{e.exp=timespan(t.expiresIn,u)}catch(e){returns(e)}if(void0===e.exp)returns(newError('"expiresIn" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}Object.keys(options_to_payload).forEach((function(r){varn=options_to_payload[r];if(void0!==t[r]){if(void0!==e[n])returns(newError('Bad "options.'+r+'" option. The payload already has an "'+n+'" property.'));e[n]=t[r]}}));varc=t.encoding||"utf8";if("function"!=typeofn)returnjws.sign({header:i,payload:e,secret:r,encoding:c});n=n&&lodash_once(n),jws.createSign({header:i,privateKey:r,payload:e,encoding:c}).once("error",n).once("done",(function(e){n(null,e)}))},jsonwebtoken={decode:decode$1,verify:verify$1,sign:sign$1,JsonWebTokenError:JsonWebTokenError_1,NotBeforeError:NotBeforeError_1,TokenExpiredError:TokenExpiredError_1},src=jsonwebtoken;module.exports=src;