@liflig/cdk-cloudfront-auth 1.10.18 → 1.10.19

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.
@@ -1,13 +1,13 @@
1
- var Al=Object.create;var{getPrototypeOf:Rl,defineProperty:De,getOwnPropertyNames:ai,getOwnPropertyDescriptor:Il}=Object,Sr=Object.prototype.hasOwnProperty;function ci(e){return this[e]}var Cl,xl,ge=(e,t,r)=>{var n=e!=null&&typeof e==="object";if(n){var i=t?Cl??=new WeakMap:xl??=new WeakMap,s=i.get(e);if(s)return s}r=e!=null?Al(Rl(e)):{};let o=t||!e||!e.__esModule||!Sr.call(e,"default")?De(r,"default",{value:e,enumerable:!0}):r;if(e&&typeof e==="object"||typeof e==="function"){for(let c of ai(e))if(!Sr.call(o,c))De(o,c,{get:ci.bind(e,c),enumerable:!0})}if(n)i.set(e,o);return o},ui=(e)=>{var t=(oi??=new WeakMap).get(e),r;if(t)return t;if(t=De({},"__esModule",{value:!0}),e&&typeof e==="object"||typeof e==="function"){for(var n of ai(e))if(!Sr.call(t,n))De(t,n,{get:ci.bind(e,n),enumerable:!(r=Il(e,n))||r.enumerable})}return oi.set(e,t),t},oi,d=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var _l=(e)=>e;function Ol(e,t){this[e]=_l.bind(null,t)}var li=(e,t)=>{for(var r in t)De(e,r,{get:t[r],enumerable:!0,configurable:!0,set:Ol.bind(t,r)})};var O=(e,t,r)=>()=>{if(e)try{t=e(e=0)}catch(n){r=[n]}if(r)throw r[0];return t};var ye=d(function(Ar,Si){/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var ot=require("buffer"),X=ot.Buffer;function Ei(e,t){for(var r in e)t[r]=e[r]}if(X.from&&X.alloc&&X.allocUnsafe&&X.allocUnsafeSlow)Si.exports=ot;else Ei(ot,Ar),Ar.Buffer=ce;function ce(e,t,r){return X(e,t,r)}ce.prototype=Object.create(X.prototype);Ei(X,ce);ce.from=function(e,t,r){if(typeof e==="number")throw TypeError("Argument must not be a number");return X(e,t,r)};ce.alloc=function(e,t,r){if(typeof e!=="number")throw TypeError("Argument must be a number");var n=X(e);if(t!==void 0)if(typeof r==="string")n.fill(t,r);else n.fill(t);else n.fill(0);return n};ce.allocUnsafe=function(e){if(typeof e!=="number")throw TypeError("Argument must be a number");return X(e)};ce.allocUnsafeSlow=function(e){if(typeof e!=="number")throw TypeError("Argument must be a number");return ot.SlowBuffer(e)}});var Rr=d(function(kS,wi){var at=ye().Buffer,Dl=require("stream"),Bl=require("util");function ct(e){if(this.buffer=null,this.writable=!0,this.readable=!0,!e)return this.buffer=at.alloc(0),this;if(typeof e.pipe==="function")return this.buffer=at.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 TypeError("Unexpected data type ("+typeof e+")")}Bl.inherits(ct,Dl);ct.prototype.write=function(t){this.buffer=at.concat([this.buffer,at.from(t)]),this.emit("data",t)};ct.prototype.end=function(t){if(t)this.write(t);this.emit("end",t),this.emit("close"),this.writable=!1,this.readable=!1};wi.exports=ct});var vi=d(function($S,bi){function Ir(e){var t=(e/8|0)+(e%8===0?0:1);return t}var Ul={ES256:Ir(256),ES384:Ir(384),ES512:Ir(521)};function Gl(e){var t=Ul[e];if(t)return t;throw Error('Unknown algorithm "'+e+'"')}bi.exports=Gl});var _i=d(function(LS,xi){var ut=ye().Buffer,Ai=vi(),lt=128,Ri=0,Jl=32,Ml=16,Wl=2,Ii=Ml|Jl|Ri<<6,ft=Wl|Ri<<6;function Hl(e){return e.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function Ci(e){if(ut.isBuffer(e))return e;else if(typeof e==="string")return ut.from(e,"base64");throw TypeError("ECDSA signature must be a Base64 string or a Buffer")}function zl(e,t){e=Ci(e);var r=Ai(t),n=r+1,i=e.length,s=0;if(e[s++]!==Ii)throw Error('Could not find expected "seq"');var o=e[s++];if(o===(lt|1))o=e[s++];if(i-s<o)throw Error('"seq" specified length of "'+o+'", only "'+(i-s)+'" remaining');if(e[s++]!==ft)throw Error('Could not find expected "int" for "r"');var c=e[s++];if(i-s-2<c)throw Error('"r" specified length of "'+c+'", only "'+(i-s-2)+'" available');if(n<c)throw Error('"r" specified length of "'+c+'", max of "'+n+'" is acceptable');var u=s;if(s+=c,e[s++]!==ft)throw Error('Could not find expected "int" for "s"');var a=e[s++];if(i-s!==a)throw Error('"s" specified length of "'+a+'", expected "'+(i-s)+'"');if(n<a)throw Error('"s" specified length of "'+a+'", max of "'+n+'" is acceptable');var l=s;if(s+=a,s!==i)throw Error('Expected to consume entire buffer, but "'+(i-s)+'" bytes remain');var f=r-c,g=r-a,h=ut.allocUnsafe(f+c+g+a);for(s=0;s<f;++s)h[s]=0;e.copy(h,s,u+Math.max(-f,0),u+c),s=r;for(var m=s;s<m+g;++s)h[s]=0;return e.copy(h,s,l+Math.max(-g,0),l+a),h=h.toString("base64"),h=Hl(h),h}function Ti(e,t,r){var n=0;while(t+n<r&&e[t+n]===0)++n;var i=e[t+n]>=lt;if(i)--n;return n}function Vl(e,t){e=Ci(e);var r=Ai(t),n=e.length;if(n!==r*2)throw TypeError('"'+t+'" signatures must be "'+r*2+'" bytes, saw "'+n+'"');var i=Ti(e,0,r),s=Ti(e,r,e.length),o=r-i,c=r-s,u=2+o+1+1+c,a=u<lt,l=ut.allocUnsafe((a?2:3)+u),f=0;if(l[f++]=Ii,a)l[f++]=u;else l[f++]=lt|1,l[f++]=u&255;if(l[f++]=ft,l[f++]=o,i<0)l[f++]=0,f+=e.copy(l,f,0,r);else f+=e.copy(l,f,i,r);if(l[f++]=ft,l[f++]=c,s<0)l[f++]=0,e.copy(l,f,r);else e.copy(l,f,r+s);return l}xi.exports={derToJose:zl,joseToDer:Vl}});var ki=d(function(PS,Oi){var Be=require("buffer").Buffer,Cr=require("buffer").SlowBuffer;Oi.exports=ht;function ht(e,t){if(!Be.isBuffer(e)||!Be.isBuffer(t))return!1;if(e.length!==t.length)return!1;var r=0;for(var n=0;n<e.length;n++)r|=e[n]^t[n];return r===0}ht.install=function(){Be.prototype.equal=Cr.prototype.equal=function(t){return ht(this,t)}};var Xl=Be.prototype.equal,Yl=Cr.prototype.equal;ht.restore=function(){Be.prototype.equal=Xl,Cr.prototype.equal=Yl}});var kr=d(function(NS,Di){var Se=ye().Buffer,D=require("crypto"),Li=_i(),$i=require("util"),Zl=`"%s" is not a valid algorithm.
1
+ var ql=Object.create;var{getPrototypeOf:jl,defineProperty:Be,getOwnPropertyNames:li,getOwnPropertyDescriptor:Fl}=Object,Ar=Object.prototype.hasOwnProperty;function fi(e){return this[e]}var Kl,Dl,Ir=(e,t,r)=>{var n=e!=null&&typeof e==="object";if(n){var i=t?Kl??=new WeakMap:Dl??=new WeakMap,s=i.get(e);if(s)return s}r=e!=null?ql(jl(e)):{};let o=t||!e||!e.__esModule||!Ar.call(e,"default")?Be(r,"default",{value:e,enumerable:!0}):r;if(e&&typeof e==="object"||typeof e==="function"){for(let c of li(e))if(!Ar.call(o,c))Be(o,c,{get:fi.bind(e,c),enumerable:!0})}if(n)i.set(e,o);return o},Ul=(e)=>{var t=(ui??=new WeakMap).get(e),r;if(t)return t;if(t=Be({},"__esModule",{value:!0}),e&&typeof e==="object"||typeof e==="function"){for(var n of li(e))if(!Ar.call(t,n))Be(t,n,{get:fi.bind(e,n),enumerable:!(r=Fl(e,n))||r.enumerable})}return ui.set(e,t),t},ui,p=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Bl=(e)=>e;function Jl(e,t){this[e]=Bl.bind(null,t)}var Gl=(e,t)=>{for(var r in t)Be(e,r,{get:t[r],enumerable:!0,configurable:!0,set:Jl.bind(t,r)})};var q=(e,t,r)=>()=>{if(e)try{t=e(e=0)}catch(n){r=[n]}if(r)throw r[0];return t};var we=p(function(Or,Si){var lt=require("buffer"),Y=lt.Buffer;function wi(e,t){for(var r in e)t[r]=e[r]}if(Y.from&&Y.alloc&&Y.allocUnsafe&&Y.allocUnsafeSlow)Si.exports=lt;else wi(lt,Or),Or.Buffer=Ee;function Ee(e,t,r){return Y(e,t,r)}wi(Y,Ee);Ee.from=function(e,t,r){if(typeof e==="number")throw TypeError("Argument must not be a number");return Y(e,t,r)};Ee.alloc=function(e,t,r){if(typeof e!=="number")throw TypeError("Argument must be a number");var n=Y(e);if(t!==void 0)if(typeof r==="string")n.fill(t,r);else n.fill(t);else n.fill(0);return n};Ee.allocUnsafe=function(e){if(typeof e!=="number")throw TypeError("Argument must be a number");return Y(e)};Ee.allocUnsafeSlow=function(e){if(typeof e!=="number")throw TypeError("Argument must be a number");return lt.SlowBuffer(e)}});var kr=p(function(Iw,bi){var ft=we().Buffer,ef=require("stream"),tf=require("util");function ht(e){if(this.buffer=null,this.writable=!0,this.readable=!0,!e)return this.buffer=ft.alloc(0),this;if(typeof e.pipe==="function")return this.buffer=ft.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 TypeError("Unexpected data type ("+typeof e+")")}tf.inherits(ht,ef);ht.prototype.write=function(t){this.buffer=ft.concat([this.buffer,ft.from(t)]),this.emit("data",t)};ht.prototype.end=function(t){if(t)this.write(t);this.emit("end",t),this.emit("close"),this.writable=!1,this.readable=!1};bi.exports=ht});var Ti=p(function(Cw,vi){function $r(e){var t=(e/8|0)+(e%8===0?0:1);return t}var rf={ES256:$r(256),ES384:$r(384),ES512:$r(521)};function nf(e){var t=rf[e];if(t)return t;throw Error('Unknown algorithm "'+e+'"')}vi.exports=nf});var Oi=p(function(Rw,_i){var pt=we().Buffer,Ii=Ti(),dt=128,Ci=0,sf=32,of=16,af=2,Ri=of|sf|Ci<<6,gt=af|Ci<<6;function cf(e){return e.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function xi(e){if(pt.isBuffer(e))return e;else if(typeof e==="string")return pt.from(e,"base64");throw TypeError("ECDSA signature must be a Base64 string or a Buffer")}function uf(e,t){e=xi(e);var r=Ii(t),n=r+1,i=e.length,s=0;if(e[s++]!==Ri)throw Error('Could not find expected "seq"');var o=e[s++];if(o===(dt|1))o=e[s++];if(i-s<o)throw Error('"seq" specified length of "'+o+'", only "'+(i-s)+'" remaining');if(e[s++]!==gt)throw Error('Could not find expected "int" for "r"');var c=e[s++];if(i-s-2<c)throw Error('"r" specified length of "'+c+'", only "'+(i-s-2)+'" available');if(n<c)throw Error('"r" specified length of "'+c+'", max of "'+n+'" is acceptable');var u=s;if(s+=c,e[s++]!==gt)throw Error('Could not find expected "int" for "s"');var a=e[s++];if(i-s!==a)throw Error('"s" specified length of "'+a+'", expected "'+(i-s)+'"');if(n<a)throw Error('"s" specified length of "'+a+'", max of "'+n+'" is acceptable');var l=s;if(s+=a,s!==i)throw Error('Expected to consume entire buffer, but "'+(i-s)+'" bytes remain');var f=r-c,g=r-a,h=pt.allocUnsafe(f+c+g+a);for(s=0;s<f;++s)h[s]=0;e.copy(h,s,u+Math.max(-f,0),u+c),s=r;for(var m=s;s<m+g;++s)h[s]=0;return e.copy(h,s,l+Math.max(-g,0),l+a),h=h.toString("base64"),h=cf(h),h}function Ai(e,t,r){var n=0;while(t+n<r&&e[t+n]===0)++n;var i=e[t+n]>=dt;if(i)--n;return n}function lf(e,t){e=xi(e);var r=Ii(t),n=e.length;if(n!==r*2)throw TypeError('"'+t+'" signatures must be "'+r*2+'" bytes, saw "'+n+'"');var i=Ai(e,0,r),s=Ai(e,r,e.length),o=r-i,c=r-s,u=2+o+1+1+c,a=u<dt,l=pt.allocUnsafe((a?2:3)+u),f=0;if(l[f++]=Ri,a)l[f++]=u;else l[f++]=dt|1,l[f++]=u&255;if(l[f++]=gt,l[f++]=o,i<0)l[f++]=0,f+=e.copy(l,f,0,r);else f+=e.copy(l,f,i,r);if(l[f++]=gt,l[f++]=c,s<0)l[f++]=0,e.copy(l,f,r);else e.copy(l,f,r+s);return l}_i.exports={derToJose:uf,joseToDer:lf}});var $i=p(function(xw,ki){var Je=require("buffer").Buffer,Lr=require("buffer").SlowBuffer;ki.exports=mt;function mt(e,t){if(!Je.isBuffer(e)||!Je.isBuffer(t))return!1;if(e.length!==t.length)return!1;var r=0;for(var n=0;n<e.length;n++)r|=e[n]^t[n];return r===0}mt.install=function(){Je.prototype.equal=Lr.prototype.equal=function(t){return mt(this,t)}};var ff=Je.prototype.equal,hf=Lr.prototype.equal;mt.restore=function(){Je.prototype.equal=ff,Lr.prototype.equal=hf}});var jr=p(function(_w,Ui){var be=we().Buffer,D=require("crypto"),Pi=Oi(),Li=require("util"),pf=`"%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".`,Ue="secret must be a string or buffer",Ee="key must be a string or a buffer",Ql="key must be a string, a buffer or an object",_r=typeof D.createPublicKey==="function";if(_r)Ee+=" or a KeyObject",Ue+="or a KeyObject";function Pi(e){if(Se.isBuffer(e))return;if(typeof e==="string")return;if(!_r)throw W(Ee);if(typeof e!=="object")throw W(Ee);if(typeof e.type!=="string")throw W(Ee);if(typeof e.asymmetricKeyType!=="string")throw W(Ee);if(typeof e.export!=="function")throw W(Ee)}function Ni(e){if(Se.isBuffer(e))return;if(typeof e==="string")return;if(typeof e==="object")return;throw W(Ql)}function ef(e){if(Se.isBuffer(e))return;if(typeof e==="string")return e;if(!_r)throw W(Ue);if(typeof e!=="object")throw W(Ue);if(e.type!=="secret")throw W(Ue);if(typeof e.export!=="function")throw W(Ue)}function Or(e){return e.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function qi(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 W(e){var t=[].slice.call(arguments,1),r=$i.format.bind($i,e).apply(null,t);return TypeError(r)}function tf(e){return Se.isBuffer(e)||typeof e==="string"}function Ge(e){if(!tf(e))e=JSON.stringify(e);return e}function ji(e){return function(r,n){ef(n),r=Ge(r);var i=D.createHmac("sha"+e,n),s=(i.update(r),i.digest("base64"));return Or(s)}}var xr,rf="timingSafeEqual"in D?function(t,r){if(t.byteLength!==r.byteLength)return!1;return D.timingSafeEqual(t,r)}:function(t,r){if(!xr)xr=ki();return xr(t,r)};function nf(e){return function(r,n,i){var s=ji(e)(r,i);return rf(Se.from(n),Se.from(s))}}function Fi(e){return function(r,n){Ni(n),r=Ge(r);var i=D.createSign("RSA-SHA"+e),s=(i.update(r),i.sign(n,"base64"));return Or(s)}}function Ki(e){return function(r,n,i){Pi(i),r=Ge(r),n=qi(n);var s=D.createVerify("RSA-SHA"+e);return s.update(r),s.verify(i,n,"base64")}}function sf(e){return function(r,n){Ni(n),r=Ge(r);var i=D.createSign("RSA-SHA"+e),s=(i.update(r),i.sign({key:n,padding:D.constants.RSA_PKCS1_PSS_PADDING,saltLength:D.constants.RSA_PSS_SALTLEN_DIGEST},"base64"));return Or(s)}}function of(e){return function(r,n,i){Pi(i),r=Ge(r),n=qi(n);var s=D.createVerify("RSA-SHA"+e);return s.update(r),s.verify({key:i,padding:D.constants.RSA_PKCS1_PSS_PADDING,saltLength:D.constants.RSA_PSS_SALTLEN_DIGEST},n,"base64")}}function af(e){var t=Fi(e);return function(){var n=t.apply(null,arguments);return n=Li.derToJose(n,"ES"+e),n}}function cf(e){var t=Ki(e);return function(n,i,s){i=Li.joseToDer(i,"ES"+e).toString("base64");var o=t(n,i,s);return o}}function uf(){return function(){return""}}function lf(){return function(t,r){return r===""}}Di.exports=function(t){var r={hs:ji,rs:Fi,ps:sf,es:af,none:uf},n={hs:nf,rs:Ki,ps:of,es:cf,none:lf},i=t.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/);if(!i)throw W(Zl,t);var s=(i[1]||i[3]).toLowerCase(),o=i[2];return{sign:r[s](o),verify:n[s](o)}}});var $r=d(function(qS,Bi){var ff=require("buffer").Buffer;Bi.exports=function(t){if(typeof t==="string")return t;if(typeof t==="number"||ff.isBuffer(t))return t.toString();return JSON.stringify(t)}});var Hi=d(function(jS,Wi){var hf=ye().Buffer,Ui=Rr(),df=kr(),pf=require("stream"),Gi=$r(),Lr=require("util");function Ji(e,t){return hf.from(e,t).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function gf(e,t,r){r=r||"utf8";var n=Ji(Gi(e),"binary"),i=Ji(Gi(t),r);return Lr.format("%s.%s",n,i)}function Mi(e){var{header:t,payload:r}=e,n=e.secret||e.privateKey,i=e.encoding,s=df(t.alg),o=gf(t,r,i),c=s.sign(o,n);return Lr.format("%s.%s",o,c)}function dt(e){var t=e.secret;if(t=t==null?e.privateKey:t,t=t==null?e.key:t,/^hs/i.test(e.header.alg)===!0&&t==null)throw TypeError("secret must be a string or buffer or a KeyObject");var r=new Ui(t);this.readable=!0,this.header=e.header,this.encoding=e.encoding,this.secret=this.privateKey=this.key=r,this.payload=new Ui(e.payload),this.secret.once("close",function(){if(!this.payload.writable&&this.readable)this.sign()}.bind(this)),this.payload.once("close",function(){if(!this.secret.writable&&this.readable)this.sign()}.bind(this))}Lr.inherits(dt,pf);dt.prototype.sign=function(){try{var t=Mi({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")}};dt.sign=Mi;Wi.exports=dt});var ns=d(function(FS,rs){var Vi=ye().Buffer,zi=Rr(),mf=kr(),yf=require("stream"),Xi=$r(),Ef=require("util"),Sf=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function wf(e){return Object.prototype.toString.call(e)==="[object Object]"}function bf(e){if(wf(e))return e;try{return JSON.parse(e)}catch(t){return}}function Yi(e){var t=e.split(".",1)[0];return bf(Vi.from(t,"base64").toString("binary"))}function vf(e){return e.split(".",2).join(".")}function Zi(e){return e.split(".")[2]}function Tf(e,t){t=t||"utf8";var r=e.split(".")[1];return Vi.from(r,"base64").toString(t)}function Qi(e){return Sf.test(e)&&!!Yi(e)}function es(e,t,r){if(!t){var n=Error("Missing algorithm parameter for jws.verify");throw n.code="MISSING_ALGORITHM",n}e=Xi(e);var i=Zi(e),s=vf(e),o=mf(t);return o.verify(s,i,r)}function ts(e,t){if(t=t||{},e=Xi(e),!Qi(e))return null;var r=Yi(e);if(!r)return null;var n=Tf(e);if(r.typ==="JWT"||t.json)n=JSON.parse(n,t.encoding);return{header:r,payload:n,signature:Zi(e)}}function we(e){e=e||{};var t=e.secret;if(t=t==null?e.publicKey:t,t=t==null?e.key:t,/^hs/i.test(e.algorithm)===!0&&t==null)throw TypeError("secret must be a string or buffer or a KeyObject");var r=new zi(t);this.readable=!0,this.algorithm=e.algorithm,this.encoding=e.encoding,this.secret=this.publicKey=this.key=r,this.signature=new zi(e.signature),this.secret.once("close",function(){if(!this.signature.writable&&this.readable)this.verify()}.bind(this)),this.signature.once("close",function(){if(!this.secret.writable&&this.readable)this.verify()}.bind(this))}Ef.inherits(we,yf);we.prototype.verify=function(){try{var t=es(this.signature.buffer,this.algorithm,this.key.buffer),r=ts(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")}};we.decode=ts;we.isValid=Qi;we.verify=es;rs.exports=we});var gt=d(function(re){var is=Hi(),pt=ns(),Af=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"];re.ALGORITHMS=Af;re.sign=is.sign;re.verify=pt.verify;re.decode=pt.decode;re.isValid=pt.isValid;re.createSign=function(t){return new is(t)};re.createVerify=function(t){return new pt(t)}});var Pr=d(function(DS,ss){var Rf=gt();ss.exports=function(e,t){t=t||{};var r=Rf.decode(e,t);if(!r)return null;var n=r.payload;if(typeof n==="string")try{var i=JSON.parse(n);if(i!==null&&typeof i==="object")n=i}catch(s){}if(t.complete===!0)return{header:r.header,payload:n,signature:r.signature};return n}});var Je=d(function(BS,os){var mt=function(e,t){if(Error.call(this,e),Error.captureStackTrace)Error.captureStackTrace(this,this.constructor);if(this.name="JsonWebTokenError",this.message=e,t)this.inner=t};mt.prototype=Object.create(Error.prototype);mt.prototype.constructor=mt;os.exports=mt});var Nr=d(function(US,cs){var as=Je(),yt=function(e,t){as.call(this,e),this.name="NotBeforeError",this.date=t};yt.prototype=Object.create(as.prototype);yt.prototype.constructor=yt;cs.exports=yt});var qr=d(function(GS,ls){var us=Je(),Et=function(e,t){us.call(this,e),this.name="TokenExpiredError",this.expiredAt=t};Et.prototype=Object.create(us.prototype);Et.prototype.constructor=Et;ls.exports=Et});var jr=d(function(JS,fs){var be=1000,ve=be*60,Te=ve*60,ue=Te*24,If=ue*7,Cf=ue*365.25;fs.exports=function(e,t){t=t||{};var r=typeof e;if(r==="string"&&e.length>0)return xf(e);else if(r==="number"&&isFinite(e))return t.long?Of(e):_f(e);throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function xf(e){if(e=String(e),e.length>100)return;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)return;var r=parseFloat(t[1]),n=(t[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*Cf;case"weeks":case"week":case"w":return r*If;case"days":case"day":case"d":return r*ue;case"hours":case"hour":case"hrs":case"hr":case"h":return r*Te;case"minutes":case"minute":case"mins":case"min":case"m":return r*ve;case"seconds":case"second":case"secs":case"sec":case"s":return r*be;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}function _f(e){var t=Math.abs(e);if(t>=ue)return Math.round(e/ue)+"d";if(t>=Te)return Math.round(e/Te)+"h";if(t>=ve)return Math.round(e/ve)+"m";if(t>=be)return Math.round(e/be)+"s";return e+"ms"}function Of(e){var t=Math.abs(e);if(t>=ue)return St(e,t,ue,"day");if(t>=Te)return St(e,t,Te,"hour");if(t>=ve)return St(e,t,ve,"minute");if(t>=be)return St(e,t,be,"second");return e+" ms"}function St(e,t,r,n){var i=t>=r*1.5;return Math.round(e/r)+" "+n+(i?"s":"")}});var Fr=d(function(MS,hs){var kf=jr();hs.exports=function(e,t){var r=t||Math.floor(Date.now()/1000);if(typeof e==="string"){var n=kf(e);if(typeof n>"u")return;return Math.floor(r+n/1000)}else if(typeof e==="number")return r+e;else return}});var Ae=d(function(WS,ds){var $f=Number.MAX_SAFE_INTEGER||9007199254740991,Lf=["major","premajor","minor","preminor","patch","prepatch","prerelease"];ds.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:$f,RELEASE_TYPES:Lf,SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var Me=d(function(HS,ps){var Pf=typeof process==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};ps.exports=Pf});var Re=d(function(Y,gs){var{MAX_SAFE_COMPONENT_LENGTH:Kr,MAX_SAFE_BUILD_LENGTH:Nf,MAX_LENGTH:qf}=Ae(),jf=Me();Y=gs.exports={};var Ff=Y.re=[],Kf=Y.safeRe=[],y=Y.src=[],Df=Y.safeSrc=[],E=Y.t={},Bf=0,Dr="[a-zA-Z0-9-]",Uf=[["\\s",1],["\\d",qf],[Dr,Nf]],Gf=(e)=>{for(let[t,r]of Uf)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e},v=(e,t,r)=>{let n=Gf(t),i=Bf++;jf(e,i,t),E[e]=i,y[i]=t,Df[i]=n,Ff[i]=new RegExp(t,r?"g":void 0),Kf[i]=new RegExp(n,r?"g":void 0)};v("NUMERICIDENTIFIER","0|[1-9]\\d*");v("NUMERICIDENTIFIERLOOSE","\\d+");v("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${Dr}*`);v("MAINVERSION",`(${y[E.NUMERICIDENTIFIER]})\\.(${y[E.NUMERICIDENTIFIER]})\\.(${y[E.NUMERICIDENTIFIER]})`);v("MAINVERSIONLOOSE",`(${y[E.NUMERICIDENTIFIERLOOSE]})\\.(${y[E.NUMERICIDENTIFIERLOOSE]})\\.(${y[E.NUMERICIDENTIFIERLOOSE]})`);v("PRERELEASEIDENTIFIER",`(?:${y[E.NONNUMERICIDENTIFIER]}|${y[E.NUMERICIDENTIFIER]})`);v("PRERELEASEIDENTIFIERLOOSE",`(?:${y[E.NONNUMERICIDENTIFIER]}|${y[E.NUMERICIDENTIFIERLOOSE]})`);v("PRERELEASE",`(?:-(${y[E.PRERELEASEIDENTIFIER]}(?:\\.${y[E.PRERELEASEIDENTIFIER]})*))`);v("PRERELEASELOOSE",`(?:-?(${y[E.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${y[E.PRERELEASEIDENTIFIERLOOSE]})*))`);v("BUILDIDENTIFIER",`${Dr}+`);v("BUILD",`(?:\\+(${y[E.BUILDIDENTIFIER]}(?:\\.${y[E.BUILDIDENTIFIER]})*))`);v("FULLPLAIN",`v?${y[E.MAINVERSION]}${y[E.PRERELEASE]}?${y[E.BUILD]}?`);v("FULL",`^${y[E.FULLPLAIN]}$`);v("LOOSEPLAIN",`[v=\\s]*${y[E.MAINVERSIONLOOSE]}${y[E.PRERELEASELOOSE]}?${y[E.BUILD]}?`);v("LOOSE",`^${y[E.LOOSEPLAIN]}$`);v("GTLT","((?:<|>)?=?)");v("XRANGEIDENTIFIERLOOSE",`${y[E.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);v("XRANGEIDENTIFIER",`${y[E.NUMERICIDENTIFIER]}|x|X|\\*`);v("XRANGEPLAIN",`[v=\\s]*(${y[E.XRANGEIDENTIFIER]})(?:\\.(${y[E.XRANGEIDENTIFIER]})(?:\\.(${y[E.XRANGEIDENTIFIER]})(?:${y[E.PRERELEASE]})?${y[E.BUILD]}?)?)?`);v("XRANGEPLAINLOOSE",`[v=\\s]*(${y[E.XRANGEIDENTIFIERLOOSE]})(?:\\.(${y[E.XRANGEIDENTIFIERLOOSE]})(?:\\.(${y[E.XRANGEIDENTIFIERLOOSE]})(?:${y[E.PRERELEASELOOSE]})?${y[E.BUILD]}?)?)?`);v("XRANGE",`^${y[E.GTLT]}\\s*${y[E.XRANGEPLAIN]}$`);v("XRANGELOOSE",`^${y[E.GTLT]}\\s*${y[E.XRANGEPLAINLOOSE]}$`);v("COERCEPLAIN",`(^|[^\\d])(\\d{1,${Kr}})(?:\\.(\\d{1,${Kr}}))?(?:\\.(\\d{1,${Kr}}))?`);v("COERCE",`${y[E.COERCEPLAIN]}(?:$|[^\\d])`);v("COERCEFULL",y[E.COERCEPLAIN]+`(?:${y[E.PRERELEASE]})?(?:${y[E.BUILD]})?(?:$|[^\\d])`);v("COERCERTL",y[E.COERCE],!0);v("COERCERTLFULL",y[E.COERCEFULL],!0);v("LONETILDE","(?:~>?)");v("TILDETRIM",`(\\s*)${y[E.LONETILDE]}\\s+`,!0);Y.tildeTrimReplace="$1~";v("TILDE",`^${y[E.LONETILDE]}${y[E.XRANGEPLAIN]}$`);v("TILDELOOSE",`^${y[E.LONETILDE]}${y[E.XRANGEPLAINLOOSE]}$`);v("LONECARET","(?:\\^)");v("CARETTRIM",`(\\s*)${y[E.LONECARET]}\\s+`,!0);Y.caretTrimReplace="$1^";v("CARET",`^${y[E.LONECARET]}${y[E.XRANGEPLAIN]}$`);v("CARETLOOSE",`^${y[E.LONECARET]}${y[E.XRANGEPLAINLOOSE]}$`);v("COMPARATORLOOSE",`^${y[E.GTLT]}\\s*(${y[E.LOOSEPLAIN]})$|^$`);v("COMPARATOR",`^${y[E.GTLT]}\\s*(${y[E.FULLPLAIN]})$|^$`);v("COMPARATORTRIM",`(\\s*)${y[E.GTLT]}\\s*(${y[E.LOOSEPLAIN]}|${y[E.XRANGEPLAIN]})`,!0);Y.comparatorTrimReplace="$1$2$3";v("HYPHENRANGE",`^\\s*(${y[E.XRANGEPLAIN]})\\s+-\\s+(${y[E.XRANGEPLAIN]})\\s*$`);v("HYPHENRANGELOOSE",`^\\s*(${y[E.XRANGEPLAINLOOSE]})\\s+-\\s+(${y[E.XRANGEPLAINLOOSE]})\\s*$`);v("STAR","(<|>)?=?\\s*\\*");v("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");v("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var wt=d(function(zS,ms){var Jf=Object.freeze({loose:!0}),Mf=Object.freeze({}),Wf=(e)=>{if(!e)return Mf;if(typeof e!=="object")return Jf;return e};ms.exports=Wf});var Br=d(function(VS,Ss){var ys=/^[0-9]+$/,Es=(e,t)=>{if(typeof e==="number"&&typeof t==="number")return e===t?0:e<t?-1:1;let r=ys.test(e),n=ys.test(t);if(r&&n)e=+e,t=+t;return e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1},Hf=(e,t)=>Es(t,e);Ss.exports={compareIdentifiers:Es,rcompareIdentifiers:Hf}});var N=d(function(XS,bs){var bt=Me(),{MAX_LENGTH:ws,MAX_SAFE_INTEGER:vt}=Ae(),{safeRe:Tt,t:At}=Re(),zf=wt(),{compareIdentifiers:Ur}=Br(),Vf=(e,t)=>{let r=t.split(".");if(r.length>e.length)return!1;for(let n=0;n<r.length;n++)if(Ur(e[n],r[n])!==0)return!1;return!0};class H{constructor(e,t){if(t=zf(t),e instanceof H)if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;else e=e.version;else if(typeof e!=="string")throw TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>ws)throw TypeError(`version is longer than ${ws} characters`);bt("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let r=e.trim().match(t.loose?Tt[At.LOOSE]:Tt[At.FULL]);if(!r)throw TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>vt||this.major<0)throw TypeError("Invalid major version");if(this.minor>vt||this.minor<0)throw TypeError("Invalid minor version");if(this.patch>vt||this.patch<0)throw TypeError("Invalid patch version");if(!r[4])this.prerelease=[];else this.prerelease=r[4].split(".").map((n)=>{if(/^[0-9]+$/.test(n)){let i=+n;if(i>=0&&i<vt)return i}return n});this.build=r[5]?r[5].split("."):[],this.format()}format(){if(this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length)this.version+=`-${this.prerelease.join(".")}`;return this.version}toString(){return this.version}compare(e){if(bt("SemVer.compare",this.version,this.options,e),!(e instanceof H)){if(typeof e==="string"&&e===this.version)return 0;e=new H(e,this.options)}if(e.version===this.version)return 0;return this.compareMain(e)||this.comparePre(e)}compareMain(e){if(!(e instanceof H))e=new H(e,this.options);if(this.major<e.major)return-1;if(this.major>e.major)return 1;if(this.minor<e.minor)return-1;if(this.minor>e.minor)return 1;if(this.patch<e.patch)return-1;if(this.patch>e.patch)return 1;return 0}comparePre(e){if(!(e instanceof H))e=new H(e,this.options);if(this.prerelease.length&&!e.prerelease.length)return-1;else if(!this.prerelease.length&&e.prerelease.length)return 1;else if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{let r=this.prerelease[t],n=e.prerelease[t];if(bt("prerelease compare",t,r,n),r===void 0&&n===void 0)return 0;else if(n===void 0)return 1;else if(r===void 0)return-1;else if(r===n)continue;else return Ur(r,n)}while(++t)}compareBuild(e){if(!(e instanceof H))e=new H(e,this.options);let t=0;do{let r=this.build[t],n=e.build[t];if(bt("build compare",t,r,n),r===void 0&&n===void 0)return 0;else if(n===void 0)return 1;else if(r===void 0)return-1;else if(r===n)continue;else return Ur(r,n)}while(++t)}inc(e,t,r){if(e.startsWith("pre")){if(!t&&r===!1)throw Error("invalid increment argument: identifier is empty");if(t){let n=`-${t}`.match(this.options.loose?Tt[At.PRERELEASELOOSE]:Tt[At.PRERELEASE]);if(!n||n[1]!==t)throw Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,r),this.inc("pre",t,r);break;case"prerelease":if(this.prerelease.length===0)this.inc("patch",t,r);this.inc("pre",t,r);break;case"release":if(this.prerelease.length===0)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":if(this.minor!==0||this.patch!==0||this.prerelease.length===0)this.major++;this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":if(this.patch!==0||this.prerelease.length===0)this.minor++;this.patch=0,this.prerelease=[];break;case"patch":if(this.prerelease.length===0)this.patch++;this.prerelease=[];break;case"pre":{let n=Number(r)?1:0;if(this.prerelease.length===0)this.prerelease=[n];else{let i=this.prerelease.length;while(--i>=0)if(typeof this.prerelease[i]==="number")this.prerelease[i]++,i=-2;if(i===-1){if(t===this.prerelease.join(".")&&r===!1)throw Error("invalid increment argument: identifier already exists");this.prerelease.push(n)}}if(t){let i=[t,n];if(r===!1)i=[t];if(Vf(this.prerelease,t)){let s=this.prerelease[t.split(".").length];if(isNaN(s))this.prerelease=i}else this.prerelease=i}break}default:throw Error(`invalid increment argument: ${e}`)}if(this.raw=this.format(),this.build.length)this.raw+=`+${this.build.join(".")}`;return this}}bs.exports=H});var ne=d(function(YS,Ts){var vs=N(),Xf=(e,t,r=!1)=>{if(e instanceof vs)return e;try{return new vs(e,t)}catch(n){if(!r)return null;throw n}};Ts.exports=Xf});var Rs=d(function(ZS,As){var Yf=ne(),Zf=(e,t)=>{let r=Yf(e,t);return r?r.version:null};As.exports=Zf});var Cs=d(function(QS,Is){var Qf=ne(),eh=(e,t)=>{let r=Qf(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};Is.exports=eh});var Os=d(function(ew,_s){var xs=N(),th=(e,t,r,n,i)=>{if(typeof r==="string")i=n,n=r,r=void 0;try{return new xs(e instanceof xs?e.version:e,r).inc(t,n,i).version}catch(s){return null}};_s.exports=th});var Ls=d(function(tw,$s){var ks=ne(),rh=(e,t)=>{let r=ks(e,null,!0),n=ks(t,null,!0),i=r.compare(n);if(i===0)return null;let s=i>0,o=s?r:n,c=s?n:r,u=!!o.prerelease.length;if(!!c.prerelease.length&&!u){if(!c.patch&&!c.minor)return"major";if(c.compareMain(o)===0){if(c.minor&&!c.patch)return"minor";return"patch"}}let l=u?"pre":"";if(r.major!==n.major)return l+"major";if(r.minor!==n.minor)return l+"minor";if(r.patch!==n.patch)return l+"patch";return"prerelease"};$s.exports=rh});var Ns=d(function(rw,Ps){var nh=N(),ih=(e,t)=>new nh(e,t).major;Ps.exports=ih});var js=d(function(nw,qs){var sh=N(),oh=(e,t)=>new sh(e,t).minor;qs.exports=oh});var Ks=d(function(iw,Fs){var ah=N(),ch=(e,t)=>new ah(e,t).patch;Fs.exports=ch});var Bs=d(function(sw,Ds){var uh=ne(),lh=(e,t)=>{let r=uh(e,t);return r&&r.prerelease.length?r.prerelease:null};Ds.exports=lh});var B=d(function(ow,Gs){var Us=N(),fh=(e,t,r)=>new Us(e,r).compare(new Us(t,r));Gs.exports=fh});var Ms=d(function(aw,Js){var hh=B(),dh=(e,t,r)=>hh(t,e,r);Js.exports=dh});var Hs=d(function(cw,Ws){var ph=B(),gh=(e,t)=>ph(e,t,!0);Ws.exports=gh});var Rt=d(function(uw,Vs){var zs=N(),mh=(e,t,r)=>{let n=new zs(e,r),i=new zs(t,r);return n.compare(i)||n.compareBuild(i)};Vs.exports=mh});var Ys=d(function(lw,Xs){var yh=Rt(),Eh=(e,t)=>e.sort((r,n)=>yh(r,n,t));Xs.exports=Eh});var Qs=d(function(fw,Zs){var Sh=Rt(),wh=(e,t)=>e.sort((r,n)=>Sh(n,r,t));Zs.exports=wh});var We=d(function(hw,eo){var bh=B(),vh=(e,t,r)=>bh(e,t,r)>0;eo.exports=vh});var It=d(function(dw,to){var Th=B(),Ah=(e,t,r)=>Th(e,t,r)<0;to.exports=Ah});var Gr=d(function(pw,ro){var Rh=B(),Ih=(e,t,r)=>Rh(e,t,r)===0;ro.exports=Ih});var Jr=d(function(gw,no){var Ch=B(),xh=(e,t,r)=>Ch(e,t,r)!==0;no.exports=xh});var Ct=d(function(mw,io){var _h=B(),Oh=(e,t,r)=>_h(e,t,r)>=0;io.exports=Oh});var xt=d(function(yw,so){var kh=B(),$h=(e,t,r)=>kh(e,t,r)<=0;so.exports=$h});var Mr=d(function(Ew,oo){var Lh=Gr(),Ph=Jr(),Nh=We(),qh=Ct(),jh=It(),Fh=xt(),Kh=(e,t,r,n)=>{switch(t){case"===":if(typeof e==="object")e=e.version;if(typeof r==="object")r=r.version;return e===r;case"!==":if(typeof e==="object")e=e.version;if(typeof r==="object")r=r.version;return e!==r;case"":case"=":case"==":return Lh(e,r,n);case"!=":return Ph(e,r,n);case">":return Nh(e,r,n);case">=":return qh(e,r,n);case"<":return jh(e,r,n);case"<=":return Fh(e,r,n);default:throw TypeError(`Invalid operator: ${t}`)}};oo.exports=Kh});var co=d(function(Sw,ao){var Dh=N(),Bh=ne(),{safeRe:_t,t:Ot}=Re(),Uh=(e,t)=>{if(e instanceof Dh)return e;if(typeof e==="number")e=String(e);if(typeof e!=="string")return null;t=t||{};let r=null;if(!t.rtl)r=e.match(t.includePrerelease?_t[Ot.COERCEFULL]:_t[Ot.COERCE]);else{let u=t.includePrerelease?_t[Ot.COERCERTLFULL]:_t[Ot.COERCERTL],a;while((a=u.exec(e))&&(!r||r.index+r[0].length!==e.length)){if(!r||a.index+a[0].length!==r.index+r[0].length)r=a;u.lastIndex=a.index+a[1].length+a[2].length}u.lastIndex=-1}if(r===null)return null;let n=r[2],i=r[3]||"0",s=r[4]||"0",o=t.includePrerelease&&r[5]?`-${r[5]}`:"",c=t.includePrerelease&&r[6]?`+${r[6]}`:"";return Bh(`${n}.${i}.${s}${o}${c}`,t)};ao.exports=Uh});var lo=d(function(ww,uo){var Gh=ne(),Jh=Ae(),Mh=N(),Wh=(e,t,r)=>{if(!Jh.RELEASE_TYPES.includes(t))return null;let n=Hh(e,r);return n&&zh(n,t)},Hh=(e,t)=>{let r=e instanceof Mh?e.version:e;return Gh(r,t)},zh=(e,t)=>{if(Vh(t))return e.version;switch(e.prerelease=[],t){case"major":e.minor=0,e.patch=0;break;case"minor":e.patch=0;break}return e.format()},Vh=(e)=>e.startsWith("pre");uo.exports=Wh});var po=d(function(bw,ho){class fo{constructor(){this.max=1000,this.map=new Map}get(e){let t=this.map.get(e);if(t===void 0)return;else return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&t!==void 0){if(this.map.size>=this.max){let n=this.map.keys().next().value;this.delete(n)}this.map.set(e,t)}return this}}ho.exports=fo});var U=d(function(vw,Eo){var Xh=/\s+/g;class He{constructor(e,t){if(t=Zh(t),e instanceof He)if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;else return new He(e.raw,t);if(e instanceof Wr)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(Xh," "),this.set=this.raw.split("||").map((r)=>this.parseRange(r.trim())).filter((r)=>r.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let r=this.set[0];if(this.set=this.set.filter((n)=>!mo(n[0])),this.set.length===0)this.set=[r];else if(this.set.length>1){for(let n of this.set)if(n.length===1&&ad(n[0])){this.set=[n];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){if(e>0)this.formatted+="||";let t=this.set[e];for(let r=0;r<t.length;r++){if(r>0)this.formatted+=" ";this.formatted+=t[r].toString().trim()}}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){e=e.replace(od,"");let r=((this.options.includePrerelease&&id)|(this.options.loose&&sd))+":"+e,n=go.get(r);if(n)return n;let i=this.options.loose,s=i?j[q.HYPHENRANGELOOSE]:j[q.HYPHENRANGE];e=e.replace(s,Ed(this.options.includePrerelease)),x("hyphen replace",e),e=e.replace(j[q.COMPARATORTRIM],td),x("comparator trim",e),e=e.replace(j[q.TILDETRIM],rd),x("tilde trim",e),e=e.replace(j[q.CARETTRIM],nd),x("caret trim",e);let o=e.split(" ").map((l)=>cd(l,this.options)).join(" ").split(/\s+/).map((l)=>yd(l,this.options));if(i)o=o.filter((l)=>(x("loose invalid filter",l,this.options),!!l.match(j[q.COMPARATORLOOSE])));x("range list",o);let c=new Map,u=o.map((l)=>new Wr(l,this.options));for(let l of u){if(mo(l))return[l];c.set(l.value,l)}if(c.size>1&&c.has(""))c.delete("");let a=[...c.values()];return go.set(r,a),a}intersects(e,t){if(!(e instanceof He))throw TypeError("a Range is required");return this.set.some((r)=>yo(r,t)&&e.set.some((n)=>yo(n,t)&&r.every((i)=>n.every((s)=>i.intersects(s,t)))))}test(e){if(!e)return!1;if(typeof e==="string")try{e=new Qh(e,this.options)}catch(t){return!1}for(let t=0;t<this.set.length;t++)if(Sd(this.set[t],e,this.options))return!0;return!1}}Eo.exports=He;var Yh=po(),go=new Yh,Zh=wt(),Wr=ze(),x=Me(),Qh=N(),{safeRe:j,src:ed,t:q,comparatorTrimReplace:td,tildeTrimReplace:rd,caretTrimReplace:nd}=Re(),{FLAG_INCLUDE_PRERELEASE:id,FLAG_LOOSE:sd}=Ae(),od=new RegExp(ed[q.BUILD],"g"),mo=(e)=>e.value==="<0.0.0-0",ad=(e)=>e.value==="",yo=(e,t)=>{let r=!0,n=e.slice(),i=n.pop();while(r&&n.length)r=n.every((s)=>i.intersects(s,t)),i=n.pop();return r},cd=(e,t)=>(e=e.replace(j[q.BUILD],""),x("comp",e,t),e=hd(e,t),x("caret",e),e=ld(e,t),x("tildes",e),e=pd(e,t),x("xrange",e),e=md(e,t),x("stars",e),e),L=(e)=>!e||e.toLowerCase()==="x"||e==="*",ud=(e,t,r)=>L(e)&&!L(t)||L(t)&&r&&!L(r),ld=(e,t)=>e.trim().split(/\s+/).map((r)=>fd(r,t)).join(" "),fd=(e,t)=>{let r=t.loose?j[q.TILDELOOSE]:j[q.TILDE],n=t.includePrerelease?"-0":"";return e.replace(r,(i,s,o,c,u)=>{x("tilde",e,i,s,o,c,u);let a;if(L(s))a="";else if(L(o))a=`>=${s}.0.0${n} <${+s+1}.0.0-0`;else if(L(c))a=`>=${s}.${o}.0${n} <${s}.${+o+1}.0-0`;else if(u)x("replaceTilde pr",u),a=`>=${s}.${o}.${c}-${u} <${s}.${+o+1}.0-0`;else a=`>=${s}.${o}.${c} <${s}.${+o+1}.0-0`;return x("tilde return",a),a})},hd=(e,t)=>e.trim().split(/\s+/).map((r)=>dd(r,t)).join(" "),dd=(e,t)=>{x("caret",e,t);let r=t.loose?j[q.CARETLOOSE]:j[q.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,(i,s,o,c,u)=>{x("caret",e,i,s,o,c,u);let a;if(L(s))a="";else if(L(o))a=`>=${s}.0.0${n} <${+s+1}.0.0-0`;else if(L(c))if(s==="0")a=`>=${s}.${o}.0${n} <${s}.${+o+1}.0-0`;else a=`>=${s}.${o}.0${n} <${+s+1}.0.0-0`;else if(u)if(x("replaceCaret pr",u),s==="0")if(o==="0")a=`>=${s}.${o}.${c}-${u} <${s}.${o}.${+c+1}-0`;else a=`>=${s}.${o}.${c}-${u} <${s}.${+o+1}.0-0`;else a=`>=${s}.${o}.${c}-${u} <${+s+1}.0.0-0`;else if(x("no pr"),s==="0")if(o==="0")a=`>=${s}.${o}.${c} <${s}.${o}.${+c+1}-0`;else a=`>=${s}.${o}.${c} <${s}.${+o+1}.0-0`;else a=`>=${s}.${o}.${c} <${+s+1}.0.0-0`;return x("caret return",a),a})},pd=(e,t)=>(x("replaceXRanges",e,t),e.split(/\s+/).map((r)=>gd(r,t)).join(" ")),gd=(e,t)=>{e=e.trim();let r=t.loose?j[q.XRANGELOOSE]:j[q.XRANGE];return e.replace(r,(n,i,s,o,c,u)=>{if(x("xRange",e,n,i,s,o,c,u),ud(s,o,c))return e;let a=L(s),l=a||L(o),f=l||L(c),g=f;if(i==="="&&g)i="";if(u=t.includePrerelease?"-0":"",a)if(i===">"||i==="<")n="<0.0.0-0";else n="*";else if(i&&g){if(l)o=0;if(c=0,i===">")if(i=">=",l)s=+s+1,o=0,c=0;else o=+o+1,c=0;else if(i==="<=")if(i="<",l)s=+s+1;else o=+o+1;if(i==="<")u="-0";n=`${i+s}.${o}.${c}${u}`}else if(l)n=`>=${s}.0.0${u} <${+s+1}.0.0-0`;else if(f)n=`>=${s}.${o}.0${u} <${s}.${+o+1}.0-0`;return x("xRange return",n),n})},md=(e,t)=>(x("replaceStars",e,t),e.trim().replace(j[q.STAR],"")),yd=(e,t)=>(x("replaceGTE0",e,t),e.trim().replace(j[t.includePrerelease?q.GTE0PRE:q.GTE0],"")),Ed=(e)=>(t,r,n,i,s,o,c,u,a,l,f,g)=>{if(L(n))r="";else if(L(i))r=`>=${n}.0.0${e?"-0":""}`;else if(L(s))r=`>=${n}.${i}.0${e?"-0":""}`;else if(o)r=`>=${r}`;else r=`>=${r}${e?"-0":""}`;if(L(a))u="";else if(L(l))u=`<${+a+1}.0.0-0`;else if(L(f))u=`<${a}.${+l+1}.0-0`;else if(g)u=`<=${a}.${l}.${f}-${g}`;else if(e)u=`<${a}.${l}.${+f+1}-0`;else u=`<=${u}`;return`${r} ${u}`.trim()},Sd=(e,t,r)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let n=0;n<e.length;n++){if(x(e[n].semver),e[n].semver===Wr.ANY)continue;if(e[n].semver.prerelease.length>0){let i=e[n].semver;if(i.major===t.major&&i.minor===t.minor&&i.patch===t.patch)return!0}}return!1}return!0}});var ze=d(function(Tw,Ao){var Ve=Symbol("SemVer ANY");class kt{static get ANY(){return Ve}constructor(e,t){if(t=So(t),e instanceof kt)if(e.loose===!!t.loose)return e;else e=e.value;if(e=e.trim().split(/\s+/).join(" "),zr("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===Ve)this.value="";else this.value=this.operator+this.semver.version;zr("comp",this)}parse(e){let t=this.options.loose?wo[bo.COMPARATORLOOSE]:wo[bo.COMPARATOR],r=e.match(t);if(!r)throw TypeError(`Invalid comparator: ${e}`);if(this.operator=r[1]!==void 0?r[1]:"",this.operator==="=")this.operator="";if(!r[2])this.semver=Ve;else this.semver=new vo(r[2],this.options.loose)}toString(){return this.value}test(e){if(zr("Comparator.test",e,this.options.loose),this.semver===Ve||e===Ve)return!0;if(typeof e==="string")try{e=new vo(e,this.options)}catch(t){return!1}return Hr(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof kt))throw TypeError("a Comparator is required");if(this.operator===""){if(this.value==="")return!0;return new To(e.value,t).test(this.value)}else if(e.operator===""){if(e.value==="")return!0;return new To(this.value,t).test(e.semver)}if(t=So(t),t.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0"))return!1;if(!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0")))return!1;if(this.operator.startsWith(">")&&e.operator.startsWith(">"))return!0;if(this.operator.startsWith("<")&&e.operator.startsWith("<"))return!0;if(this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("="))return!0;if(Hr(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))return!0;if(Hr(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">"))return!0;return!1}}Ao.exports=kt;var So=wt(),{safeRe:wo,t:bo}=Re(),Hr=Mr(),zr=Me(),vo=N(),To=U()});var Xe=d(function(Aw,Ro){var wd=U(),bd=(e,t,r)=>{try{t=new wd(t,r)}catch(n){return!1}return t.test(e)};Ro.exports=bd});var Co=d(function(Rw,Io){var vd=U(),Td=(e,t)=>new vd(e,t).set.map((r)=>r.map((n)=>n.value).join(" ").trim().split(" "));Io.exports=Td});var _o=d(function(Iw,xo){var Ad=N(),Rd=U(),Id=(e,t,r)=>{let n=null,i=null,s=null;try{s=new Rd(t,r)}catch(o){return null}return e.forEach((o)=>{if(s.test(o)){if(!n||i.compare(o)===-1)n=o,i=new Ad(n,r)}}),n};xo.exports=Id});var ko=d(function(Cw,Oo){var Cd=N(),xd=U(),_d=(e,t,r)=>{let n=null,i=null,s=null;try{s=new xd(t,r)}catch(o){return null}return e.forEach((o)=>{if(s.test(o)){if(!n||i.compare(o)===1)n=o,i=new Cd(n,r)}}),n};Oo.exports=_d});var Po=d(function(xw,Lo){var Vr=N(),Od=U(),$o=We(),kd=(e,t)=>{e=new Od(e,t);let r=new Vr("0.0.0");if(e.test(r))return r;if(r=new Vr("0.0.0-0"),e.test(r))return r;r=null;for(let n=0;n<e.set.length;++n){let i=e.set[n],s=null;if(i.forEach((o)=>{let c=new Vr(o.semver.version);switch(o.operator){case">":if(c.prerelease.length===0)c.patch++;else c.prerelease.push(0);c.raw=c.format();case"":case">=":if(!s||$o(c,s))s=c;break;case"<":case"<=":break;default:throw Error(`Unexpected operation: ${o.operator}`)}}),s&&(!r||$o(r,s)))r=s}if(r&&e.test(r))return r;return null};Lo.exports=kd});var qo=d(function(_w,No){var $d=U(),Ld=(e,t)=>{try{return new $d(e,t).range||"*"}catch(r){return null}};No.exports=Ld});var $t=d(function(Ow,Do){var Pd=N(),Ko=ze(),{ANY:Nd}=Ko,qd=U(),jd=Xe(),jo=We(),Fo=It(),Fd=xt(),Kd=Ct(),Dd=(e,t,r,n)=>{e=new Pd(e,n),t=new qd(t,n);let i,s,o,c,u;switch(r){case">":i=jo,s=Fd,o=Fo,c=">",u=">=";break;case"<":i=Fo,s=Kd,o=jo,c="<",u="<=";break;default:throw TypeError('Must provide a hilo val of "<" or ">"')}if(jd(e,t,n))return!1;for(let a=0;a<t.set.length;++a){let l=t.set[a],f=null,g=null;if(l.forEach((h)=>{if(h.semver===Nd)h=new Ko(">=0.0.0");if(f=f||h,g=g||h,i(h.semver,f.semver,n))f=h;else if(o(h.semver,g.semver,n))g=h}),f.operator===c||f.operator===u)return!1;if((!g.operator||g.operator===c)&&s(e,g.semver))return!1;else if(g.operator===u&&o(e,g.semver))return!1}return!0};Do.exports=Dd});var Uo=d(function(kw,Bo){var Bd=$t(),Ud=(e,t,r)=>Bd(e,t,">",r);Bo.exports=Ud});var Jo=d(function($w,Go){var Gd=$t(),Jd=(e,t,r)=>Gd(e,t,"<",r);Go.exports=Jd});var Ho=d(function(Lw,Wo){var Mo=U(),Md=(e,t,r)=>(e=new Mo(e,r),t=new Mo(t,r),e.intersects(t,r));Wo.exports=Md});var Vo=d(function(Pw,zo){var Wd=Xe(),Hd=B();zo.exports=(e,t,r)=>{let n=[],i=null,s=null,o=e.sort((l,f)=>Hd(l,f,r));for(let l of o)if(Wd(l,t,r)){if(s=l,!i)i=l}else{if(s)n.push([i,s]);s=null,i=null}if(i)n.push([i,null]);let c=[];for(let[l,f]of n)if(l===f)c.push(l);else if(!f&&l===o[0])c.push("*");else if(!f)c.push(`>=${l}`);else if(l===o[0])c.push(`<=${f}`);else c.push(`${l} - ${f}`);let u=c.join(" || "),a=typeof t.raw==="string"?t.raw:String(t);return u.length<a.length?u:t}});var ta=d(function(Nw,ea){var Xo=U(),Zr=ze(),{ANY:Xr}=Zr,Yr=Xe(),Qr=B(),zd=(e,t,r={})=>{if(e===t)return!0;e=new Xo(e,r),t=new Xo(t,r);let n=!1;e:for(let i of e.set){for(let s of t.set){let o=Xd(i,s,r);if(n=n||o!==null,o)continue e}if(n)return!1}return!0},Vd=[new Zr(">=0.0.0-0")],Yo=[new Zr(">=0.0.0")],Xd=(e,t,r)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===Xr)if(t.length===1&&t[0].semver===Xr)return!0;else if(r.includePrerelease)e=Vd;else e=Yo;if(t.length===1&&t[0].semver===Xr)if(r.includePrerelease)return!0;else t=Yo;let n=new Set,i,s;for(let h of e)if(h.operator===">"||h.operator===">=")i=Zo(i,h,r);else if(h.operator==="<"||h.operator==="<=")s=Qo(s,h,r);else n.add(h.semver);if(n.size>1)return null;let o;if(i&&s){if(o=Qr(i.semver,s.semver,r),o>0)return null;else if(o===0&&(i.operator!==">="||s.operator!=="<="))return null}for(let h of n){if(i&&!Yr(h,String(i),r))return null;if(s&&!Yr(h,String(s),r))return null;for(let m of t)if(!Yr(h,String(m),r))return!1;return!0}let c,u,a,l,f=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1,g=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1;if(f&&f.prerelease.length===1&&s.operator==="<"&&f.prerelease[0]===0)f=!1;for(let h of t){if(l=l||h.operator===">"||h.operator===">=",a=a||h.operator==="<"||h.operator==="<=",i){if(g){if(h.semver.prerelease&&h.semver.prerelease.length&&h.semver.major===g.major&&h.semver.minor===g.minor&&h.semver.patch===g.patch)g=!1}if(h.operator===">"||h.operator===">="){if(c=Zo(i,h,r),c===h&&c!==i)return!1}else if(i.operator===">="&&!h.test(i.semver))return!1}if(s){if(f){if(h.semver.prerelease&&h.semver.prerelease.length&&h.semver.major===f.major&&h.semver.minor===f.minor&&h.semver.patch===f.patch)f=!1}if(h.operator==="<"||h.operator==="<="){if(u=Qo(s,h,r),u===h&&u!==s)return!1}else if(s.operator==="<="&&!h.test(s.semver))return!1}if(!h.operator&&(s||i)&&o!==0)return!1}if(i&&a&&!s&&o!==0)return!1;if(s&&l&&!i&&o!==0)return!1;if(g||f)return!1;return!0},Zo=(e,t,r)=>{if(!e)return t;let n=Qr(e.semver,t.semver,r);return n>0?e:n<0?t:t.operator===">"&&e.operator===">="?t:e},Qo=(e,t,r)=>{if(!e)return t;let n=Qr(e.semver,t.semver,r);return n<0?e:n>0?t:t.operator==="<"&&e.operator==="<="?t:e};ea.exports=zd});var Lt=d(function(qw,ia){var en=Re(),ra=Ae(),Yd=N(),na=Br(),Zd=ne(),Qd=Rs(),ep=Cs(),tp=Os(),rp=Ls(),np=Ns(),ip=js(),sp=Ks(),op=Bs(),ap=B(),cp=Ms(),up=Hs(),lp=Rt(),fp=Ys(),hp=Qs(),dp=We(),pp=It(),gp=Gr(),mp=Jr(),yp=Ct(),Ep=xt(),Sp=Mr(),wp=co(),bp=lo(),vp=ze(),Tp=U(),Ap=Xe(),Rp=Co(),Ip=_o(),Cp=ko(),xp=Po(),_p=qo(),Op=$t(),kp=Uo(),$p=Jo(),Lp=Ho(),Pp=Vo(),Np=ta();ia.exports={parse:Zd,valid:Qd,clean:ep,inc:tp,diff:rp,major:np,minor:ip,patch:sp,prerelease:op,compare:ap,rcompare:cp,compareLoose:up,compareBuild:lp,sort:fp,rsort:hp,gt:dp,lt:pp,eq:gp,neq:mp,gte:yp,lte:Ep,cmp:Sp,coerce:wp,truncate:bp,Comparator:vp,Range:Tp,satisfies:Ap,toComparators:Rp,maxSatisfying:Ip,minSatisfying:Cp,minVersion:xp,validRange:_p,outside:Op,gtr:kp,ltr:$p,intersects:Lp,simplifyRange:Pp,subset:Np,SemVer:Yd,re:en.re,src:en.src,tokens:en.t,SEMVER_SPEC_VERSION:ra.SEMVER_SPEC_VERSION,RELEASE_TYPES:ra.RELEASE_TYPES,compareIdentifiers:na.compareIdentifiers,rcompareIdentifiers:na.rcompareIdentifiers}});var oa=d(function(jw,sa){var qp=Lt();sa.exports=qp.satisfies(process.version,">=15.7.0")});var ca=d(function(Fw,aa){var jp=Lt();aa.exports=jp.satisfies(process.version,">=16.9.0")});var tn=d(function(Kw,ua){var Fp=oa(),Kp=ca(),Dp={ec:["ES256","ES384","ES512"],rsa:["RS256","PS256","RS384","PS384","RS512","PS512"],"rsa-pss":["PS256","PS384","PS512"]},Bp={ES256:"prime256v1",ES384:"secp384r1",ES512:"secp521r1"};ua.exports=function(e,t){if(!e||!t)return;let r=t.asymmetricKeyType;if(!r)return;let n=Dp[r];if(!n)throw Error(`Unknown key type "${r}".`);if(!n.includes(e))throw Error(`"alg" parameter for "${r}" key type must be one of: ${n.join(", ")}.`);if(Fp)switch(r){case"ec":let i=t.asymmetricKeyDetails.namedCurve,s=Bp[e];if(i!==s)throw Error(`"alg" parameter "${e}" requires curve "${s}".`);break;case"rsa-pss":if(Kp){let o=parseInt(e.slice(-3),10),{hashAlgorithm:c,mgf1HashAlgorithm:u,saltLength:a}=t.asymmetricKeyDetails;if(c!==`sha${o}`||u!==c)throw Error(`Invalid key for this operation, its RSA-PSS parameters do not meet the requirements of "alg" ${e}.`);if(a!==void 0&&a>o>>3)throw Error(`Invalid key for this operation, its RSA-PSS parameter saltLength does not meet the requirements of "alg" ${e}.`)}break}}});var rn=d(function(Dw,la){var Up=Lt();la.exports=Up.satisfies(process.version,"^6.12.0 || >=8.0.0")});var da=d(function(Bw,ha){var R=Je(),Gp=Nr(),fa=qr(),Jp=Pr(),Mp=Fr(),Wp=tn(),Hp=rn(),zp=gt(),{KeyObject:Vp,createSecretKey:Xp,createPublicKey:Yp}=require("crypto"),nn=["RS256","RS384","RS512"],Zp=["ES256","ES384","ES512"],sn=["RS256","RS384","RS512"],Qp=["HS256","HS384","HS512"];if(Hp)nn.splice(nn.length,0,"PS256","PS384","PS512"),sn.splice(sn.length,0,"PS256","PS384","PS512");ha.exports=function(e,t,r,n){if(typeof r==="function"&&!n)n=r,r={};if(!r)r={};r=Object.assign({},r);let i;if(n)i=n;else i=function(l,f){if(l)throw l;return f};if(r.clockTimestamp&&typeof r.clockTimestamp!=="number")return i(new R("clockTimestamp must be a number"));if(r.nonce!==void 0&&(typeof r.nonce!=="string"||r.nonce.trim()===""))return i(new R("nonce must be a non-empty string"));if(r.allowInvalidAsymmetricKeyTypes!==void 0&&typeof r.allowInvalidAsymmetricKeyTypes!=="boolean")return i(new R("allowInvalidAsymmetricKeyTypes must be a boolean"));let s=r.clockTimestamp||Math.floor(Date.now()/1000);if(!e)return i(new R("jwt must be provided"));if(typeof e!=="string")return i(new R("jwt must be a string"));let o=e.split(".");if(o.length!==3)return i(new R("jwt malformed"));let c;try{c=Jp(e,{complete:!0})}catch(l){return i(l)}if(!c)return i(new R("invalid token"));let u=c.header,a;if(typeof t==="function"){if(!n)return i(new R("verify must be called asynchronous if secret or public key is provided as a callback"));a=t}else a=function(l,f){return f(null,t)};return a(u,function(l,f){if(l)return i(new R("error in secret or public key callback: "+l.message));let g=o[2].trim()!=="";if(!g&&f)return i(new R("jwt signature is required"));if(g&&!f)return i(new R("secret or public key must be provided"));if(!g&&!r.algorithms)return i(new R('please specify "none" in "algorithms" to verify unsigned tokens'));if(f!=null&&!(f instanceof Vp))try{f=Yp(f)}catch(p){try{f=Xp(typeof f==="string"?Buffer.from(f):f)}catch(b){return i(new R("secretOrPublicKey is not valid key material"))}}if(!r.algorithms)if(f.type==="secret")r.algorithms=Qp;else if(["rsa","rsa-pss"].includes(f.asymmetricKeyType))r.algorithms=sn;else if(f.asymmetricKeyType==="ec")r.algorithms=Zp;else r.algorithms=nn;if(r.algorithms.indexOf(c.header.alg)===-1)return i(new R("invalid algorithm"));if(u.alg.startsWith("HS")&&f.type!=="secret")return i(new R(`secretOrPublicKey must be a symmetric key when using ${u.alg}`));else if(/^(?:RS|PS|ES)/.test(u.alg)&&f.type!=="public")return i(new R(`secretOrPublicKey must be an asymmetric key when using ${u.alg}`));if(!r.allowInvalidAsymmetricKeyTypes)try{Wp(u.alg,f)}catch(p){return i(p)}let h;try{h=zp.verify(e,c.header.alg,f)}catch(p){return i(p)}if(!h)return i(new R("invalid signature"));let m=c.payload;if(typeof m.nbf<"u"&&!r.ignoreNotBefore){if(typeof m.nbf!=="number")return i(new R("invalid nbf value"));if(m.nbf>s+(r.clockTolerance||0))return i(new Gp("jwt not active",new Date(m.nbf*1000)))}if(typeof m.exp<"u"&&!r.ignoreExpiration){if(typeof m.exp!=="number")return i(new R("invalid exp value"));if(s>=m.exp+(r.clockTolerance||0))return i(new fa("jwt expired",new Date(m.exp*1000)))}if(r.audience){let p=Array.isArray(r.audience)?r.audience:[r.audience];if(!(Array.isArray(m.aud)?m.aud:[m.aud]).some(function(w){return p.some(function(A){return A instanceof RegExp?A.test(w):A===w})}))return i(new R("jwt audience invalid. expected: "+p.join(" or ")))}if(r.issuer){if(typeof r.issuer==="string"&&m.iss!==r.issuer||Array.isArray(r.issuer)&&r.issuer.indexOf(m.iss)===-1)return i(new R("jwt issuer invalid. expected: "+r.issuer))}if(r.subject){if(m.sub!==r.subject)return i(new R("jwt subject invalid. expected: "+r.subject))}if(r.jwtid){if(m.jti!==r.jwtid)return i(new R("jwt jwtid invalid. expected: "+r.jwtid))}if(r.nonce){if(m.nonce!==r.nonce)return i(new R("jwt nonce invalid. expected: "+r.nonce))}if(r.maxAge){if(typeof m.iat!=="number")return i(new R("iat required when maxAge is specified"));let p=Mp(r.maxAge,m.iat);if(typeof p>"u")return i(new R('"maxAge" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'));if(s>=p+(r.clockTolerance||0))return i(new fa("maxAge exceeded",new Date(p*1000)))}if(r.complete===!0){let p=c.signature;return i(null,{header:u,payload:m,signature:p})}return i(null,m)})}});var Sa=d(function(Uw,Ea){var pa=1/0,ma=9007199254740991,eg=179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000,ga=NaN,tg="[object Arguments]",rg="[object Function]",ng="[object GeneratorFunction]",ig="[object String]",sg="[object Symbol]",og=/^\s+|\s+$/g,ag=/^[-+]0x[0-9a-f]+$/i,cg=/^0b[01]+$/i,ug=/^0o[0-7]+$/i,lg=/^(?:0|[1-9]\d*)$/,fg=parseInt;function hg(e,t){var r=-1,n=e?e.length:0,i=Array(n);while(++r<n)i[r]=t(e[r],r,e);return i}function dg(e,t,r,n){var i=e.length,s=r+(n?1:-1);while(n?s--:++s<i)if(t(e[s],s,e))return s;return-1}function pg(e,t,r){if(t!==t)return dg(e,gg,r);var n=r-1,i=e.length;while(++n<i)if(e[n]===t)return n;return-1}function gg(e){return e!==e}function mg(e,t){var r=-1,n=Array(e);while(++r<e)n[r]=t(r);return n}function yg(e,t){return hg(t,function(r){return e[r]})}function Eg(e,t){return function(r){return e(t(r))}}var Pt=Object.prototype,{hasOwnProperty:an,toString:Nt,propertyIsEnumerable:Sg}=Pt,wg=Eg(Object.keys,Object),bg=Math.max;function vg(e,t){var r=ya(e)||Cg(e)?mg(e.length,String):[],n=r.length,i=!!n;for(var s in e)if((t||an.call(e,s))&&!(i&&(s=="length"||Ag(s,n))))r.push(s);return r}function Tg(e){if(!Rg(e))return wg(e);var t=[];for(var r in Object(e))if(an.call(e,r)&&r!="constructor")t.push(r);return t}function Ag(e,t){return t=t==null?ma:t,!!t&&(typeof e=="number"||lg.test(e))&&(e>-1&&e%1==0&&e<t)}function Rg(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||Pt;return e===r}function Ig(e,t,r,n){e=cn(e)?e:jg(e),r=r&&!n?Pg(r):0;var i=e.length;if(r<0)r=bg(i+r,0);return kg(e)?r<=i&&e.indexOf(t,r)>-1:!!i&&pg(e,t,r)>-1}function Cg(e){return xg(e)&&an.call(e,"callee")&&(!Sg.call(e,"callee")||Nt.call(e)==tg)}var ya=Array.isArray;function cn(e){return e!=null&&Og(e.length)&&!_g(e)}function xg(e){return un(e)&&cn(e)}function _g(e){var t=on(e)?Nt.call(e):"";return t==rg||t==ng}function Og(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=ma}function on(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function un(e){return!!e&&typeof e=="object"}function kg(e){return typeof e=="string"||!ya(e)&&un(e)&&Nt.call(e)==ig}function $g(e){return typeof e=="symbol"||un(e)&&Nt.call(e)==sg}function Lg(e){if(!e)return e===0?e:0;if(e=Ng(e),e===pa||e===-pa){var t=e<0?-1:1;return t*eg}return e===e?e:0}function Pg(e){var t=Lg(e),r=t%1;return t===t?r?t-r:t:0}function Ng(e){if(typeof e=="number")return e;if($g(e))return ga;if(on(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=on(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(og,"");var r=cg.test(e);return r||ug.test(e)?fg(e.slice(2),r?2:8):ag.test(e)?ga:+e}function qg(e){return cn(e)?vg(e):Tg(e)}function jg(e){return e?yg(e,qg(e)):[]}Ea.exports=Ig});var ba=d(function(Gw,wa){var Fg="[object Boolean]",Kg=Object.prototype,Dg=Kg.toString;function Bg(e){return e===!0||e===!1||Ug(e)&&Dg.call(e)==Fg}function Ug(e){return!!e&&typeof e=="object"}wa.exports=Bg});var Ia=d(function(Jw,Ra){var va=1/0,Gg=179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000,Ta=NaN,Jg="[object Symbol]",Mg=/^\s+|\s+$/g,Wg=/^[-+]0x[0-9a-f]+$/i,Hg=/^0b[01]+$/i,zg=/^0o[0-7]+$/i,Vg=parseInt,Xg=Object.prototype,Yg=Xg.toString;function Zg(e){return typeof e=="number"&&e==rm(e)}function Aa(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function Qg(e){return!!e&&typeof e=="object"}function em(e){return typeof e=="symbol"||Qg(e)&&Yg.call(e)==Jg}function tm(e){if(!e)return e===0?e:0;if(e=nm(e),e===va||e===-va){var t=e<0?-1:1;return t*Gg}return e===e?e:0}function rm(e){var t=tm(e),r=t%1;return t===t?r?t-r:t:0}function nm(e){if(typeof e=="number")return e;if(em(e))return Ta;if(Aa(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Aa(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(Mg,"");var r=Hg.test(e);return r||zg.test(e)?Vg(e.slice(2),r?2:8):Wg.test(e)?Ta:+e}Ra.exports=Zg});var xa=d(function(Mw,Ca){var im="[object Number]",sm=Object.prototype,om=sm.toString;function am(e){return!!e&&typeof e=="object"}function cm(e){return typeof e=="number"||am(e)&&om.call(e)==im}Ca.exports=cm});var $a=d(function(Ww,ka){var um="[object Object]";function lm(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch(r){}return t}function fm(e,t){return function(r){return e(t(r))}}var hm=Function.prototype,_a=Object.prototype,Oa=hm.toString,dm=_a.hasOwnProperty,pm=Oa.call(Object),gm=_a.toString,mm=fm(Object.getPrototypeOf,Object);function ym(e){return!!e&&typeof e=="object"}function Em(e){if(!ym(e)||gm.call(e)!=um||lm(e))return!1;var t=mm(e);if(t===null)return!0;var r=dm.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&Oa.call(r)==pm}ka.exports=Em});var Pa=d(function(Hw,La){var Sm="[object String]",wm=Object.prototype,bm=wm.toString,vm=Array.isArray;function Tm(e){return!!e&&typeof e=="object"}function Am(e){return typeof e=="string"||!vm(e)&&Tm(e)&&bm.call(e)==Sm}La.exports=Am});var Ka=d(function(zw,Fa){var Rm="Expected a function",Na=1/0,Im=179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000,qa=NaN,Cm="[object Symbol]",xm=/^\s+|\s+$/g,_m=/^[-+]0x[0-9a-f]+$/i,Om=/^0b[01]+$/i,km=/^0o[0-7]+$/i,$m=parseInt,Lm=Object.prototype,Pm=Lm.toString;function Nm(e,t){var r;if(typeof t!="function")throw TypeError(Rm);return e=Dm(e),function(){if(--e>0)r=t.apply(this,arguments);if(e<=1)t=void 0;return r}}function qm(e){return Nm(2,e)}function ja(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function jm(e){return!!e&&typeof e=="object"}function Fm(e){return typeof e=="symbol"||jm(e)&&Pm.call(e)==Cm}function Km(e){if(!e)return e===0?e:0;if(e=Bm(e),e===Na||e===-Na){var t=e<0?-1:1;return t*Im}return e===e?e:0}function Dm(e){var t=Km(e),r=t%1;return t===t?r?t-r:t:0}function Bm(e){if(typeof e=="number")return e;if(Fm(e))return qa;if(ja(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=ja(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(xm,"");var r=Om.test(e);return r||km.test(e)?$m(e.slice(2),r?2:8):_m.test(e)?qa:+e}Fa.exports=qm});var za=d(function(Vw,Ha){var Da=Fr(),Um=rn(),Gm=tn(),Ga=gt(),Jm=Sa(),qt=ba(),Ba=Ia(),ln=xa(),Ja=$a(),ie=Pa(),Mm=Ka(),{KeyObject:Wm,createSecretKey:Hm,createPrivateKey:zm}=require("crypto"),Ma=["RS256","RS384","RS512","ES256","ES384","ES512","HS256","HS384","HS512","none"];if(Um)Ma.splice(3,0,"PS256","PS384","PS512");var Vm={expiresIn:{isValid:function(e){return Ba(e)||ie(e)&&e},message:'"expiresIn" should be a number of seconds or string representing a timespan'},notBefore:{isValid:function(e){return Ba(e)||ie(e)&&e},message:'"notBefore" should be a number of seconds or string representing a timespan'},audience:{isValid:function(e){return ie(e)||Array.isArray(e)},message:'"audience" must be a string or array'},algorithm:{isValid:Jm.bind(null,Ma),message:'"algorithm" must be a valid string enum value'},header:{isValid:Ja,message:'"header" must be an object'},encoding:{isValid:ie,message:'"encoding" must be a string'},issuer:{isValid:ie,message:'"issuer" must be a string'},subject:{isValid:ie,message:'"subject" must be a string'},jwtid:{isValid:ie,message:'"jwtid" must be a string'},noTimestamp:{isValid:qt,message:'"noTimestamp" must be a boolean'},keyid:{isValid:ie,message:'"keyid" must be a string'},mutatePayload:{isValid:qt,message:'"mutatePayload" must be a boolean'},allowInsecureKeySizes:{isValid:qt,message:'"allowInsecureKeySizes" must be a boolean'},allowInvalidAsymmetricKeyTypes:{isValid:qt,message:'"allowInvalidAsymmetricKeyTypes" must be a boolean'}},Xm={iat:{isValid:ln,message:'"iat" should be a number of seconds'},exp:{isValid:ln,message:'"exp" should be a number of seconds'},nbf:{isValid:ln,message:'"nbf" should be a number of seconds'}};function Wa(e,t,r,n){if(!Ja(r))throw Error('Expected "'+n+'" to be a plain object.');Object.keys(r).forEach(function(i){let s=e[i];if(!s){if(!t)throw Error('"'+i+'" is not allowed in "'+n+'"');return}if(!s.isValid(r[i]))throw Error(s.message)})}function Ym(e){return Wa(Vm,!1,e,"options")}function Zm(e){return Wa(Xm,!0,e,"payload")}var Ua={audience:"aud",issuer:"iss",subject:"sub",jwtid:"jti"},Qm=["expiresIn","notBefore","noTimestamp","audience","issuer","subject","jwtid"];Ha.exports=function(e,t,r,n){if(typeof r==="function")n=r,r={};else r=r||{};let i=typeof e==="object"&&!Buffer.isBuffer(e),s=Object.assign({alg:r.algorithm||"HS256",typ:i?"JWT":void 0,kid:r.keyid},r.header);function o(a){if(n)return n(a);throw a}if(!t&&r.algorithm!=="none")return o(Error("secretOrPrivateKey must have a value"));if(t!=null&&!(t instanceof Wm))try{t=zm(t)}catch(a){try{t=Hm(typeof t==="string"?Buffer.from(t):t)}catch(l){return o(Error("secretOrPrivateKey is not valid key material"))}}if(s.alg.startsWith("HS")&&t.type!=="secret")return o(Error(`secretOrPrivateKey must be a symmetric key when using ${s.alg}`));else if(/^(?:RS|PS|ES)/.test(s.alg)){if(t.type!=="private")return o(Error(`secretOrPrivateKey must be an asymmetric key when using ${s.alg}`));if(!r.allowInsecureKeySizes&&!s.alg.startsWith("ES")&&t.asymmetricKeyDetails!==void 0&&t.asymmetricKeyDetails.modulusLength<2048)return o(Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${s.alg}`))}if(typeof e>"u")return o(Error("payload is required"));else if(i){try{Zm(e)}catch(a){return o(a)}if(!r.mutatePayload)e=Object.assign({},e)}else{let a=Qm.filter(function(l){return typeof r[l]<"u"});if(a.length>0)return o(Error("invalid "+a.join(",")+" option for "+typeof e+" payload"))}if(typeof e.exp<"u"&&typeof r.expiresIn<"u")return o(Error('Bad "options.expiresIn" option the payload already has an "exp" property.'));if(typeof e.nbf<"u"&&typeof r.notBefore<"u")return o(Error('Bad "options.notBefore" option the payload already has an "nbf" property.'));try{Ym(r)}catch(a){return o(a)}if(!r.allowInvalidAsymmetricKeyTypes)try{Gm(s.alg,t)}catch(a){return o(a)}let c=e.iat||Math.floor(Date.now()/1000);if(r.noTimestamp)delete e.iat;else if(i)e.iat=c;if(typeof r.notBefore<"u"){try{e.nbf=Da(r.notBefore,c)}catch(a){return o(a)}if(typeof e.nbf>"u")return o(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=Da(r.expiresIn,c)}catch(a){return o(a)}if(typeof e.exp>"u")return o(Error('"expiresIn" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}Object.keys(Ua).forEach(function(a){let l=Ua[a];if(typeof r[a]<"u"){if(typeof e[l]<"u")return o(Error('Bad "options.'+a+'" option. The payload already has an "'+l+'" property.'));e[l]=r[a]}});let u=r.encoding||"utf8";if(typeof n==="function")n=n&&Mm(n),Ga.createSign({header:s,privateKey:t,payload:e,encoding:u}).once("error",n).once("done",function(a){if(!r.allowInsecureKeySizes&&/^(?:RS|PS)/.test(s.alg)&&a.length<256)return n(Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${s.alg}`));n(null,a)});else{let a=Ga.sign({header:s,payload:e,secret:t,encoding:u});if(!r.allowInsecureKeySizes&&/^(?:RS|PS)/.test(s.alg)&&a.length<256)throw Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${s.alg}`);return a}}});var Xa=d(function(Xw,Va){Va.exports={decode:Pr(),verify:da(),sign:za(),JsonWebTokenError:Je(),NotBeforeError:Nr(),TokenExpiredError:qr()}});var fn=d(function(Yw,Ya){function ey(e){r.debug=r,r.default=r,r.coerce=u,r.disable=o,r.enable=i,r.enabled=c,r.humanize=jr(),r.destroy=a,Object.keys(e).forEach((l)=>{r[l]=e[l]}),r.names=[],r.skips=[],r.formatters={};function t(l){let f=0;for(let g=0;g<l.length;g++)f=(f<<5)-f+l.charCodeAt(g),f|=0;return r.colors[Math.abs(f)%r.colors.length]}r.selectColor=t;function r(l){let f,g=null,h,m;function p(...b){if(!p.enabled)return;let S=p,w=Number(new Date),A=w-(f||w);if(S.diff=A,S.prev=f,S.curr=w,f=w,b[0]=r.coerce(b[0]),typeof b[0]!=="string")b.unshift("%O");let T=0;b[0]=b[0].replace(/%([a-zA-Z%])/g,(K,M)=>{if(K==="%%")return"%";T++;let z=r.formatters[M];if(typeof z==="function"){let V=b[T];K=z.call(S,V),b.splice(T,1),T--}return K}),r.formatArgs.call(S,b),(S.log||r.log).apply(S,b)}if(p.namespace=l,p.useColors=r.useColors(),p.color=r.selectColor(l),p.extend=n,p.destroy=r.destroy,Object.defineProperty(p,"enabled",{enumerable:!0,configurable:!1,get:()=>{if(g!==null)return g;if(h!==r.namespaces)h=r.namespaces,m=r.enabled(l);return m},set:(b)=>{g=b}}),typeof r.init==="function")r.init(p);return p}function n(l,f){let g=r(this.namespace+(typeof f>"u"?":":f)+l);return g.log=this.log,g}function i(l){r.save(l),r.namespaces=l,r.names=[],r.skips=[];let f=(typeof l==="string"?l:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let g of f)if(g[0]==="-")r.skips.push(g.slice(1));else r.names.push(g)}function s(l,f){let g=0,h=0,m=-1,p=0;while(g<l.length)if(h<f.length&&(f[h]===l[g]||f[h]==="*"))if(f[h]==="*")m=h,p=g,h++;else g++,h++;else if(m!==-1)h=m+1,p++,g=p;else return!1;while(h<f.length&&f[h]==="*")h++;return h===f.length}function o(){let l=[...r.names,...r.skips.map((f)=>"-"+f)].join(",");return r.enable(""),l}function c(l){for(let f of r.skips)if(s(l,f))return!1;for(let f of r.names)if(s(l,f))return!0;return!1}function u(l){if(l instanceof Error)return l.stack||l.message;return l}function a(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}Ya.exports=ey});var Za=d(function(F,jt){F.formatArgs=ry;F.save=ny;F.load=iy;F.useColors=ty;F.storage=sy();F.destroy=(()=>{let e=!1;return()=>{if(!e)e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}})();F.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function ty(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function ry(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+jt.exports.humanize(this.diff),!this.useColors)return;let t="color: "+this.color;e.splice(1,0,t,"color: inherit");let r=0,n=0;e[0].replace(/%[a-zA-Z%]/g,(i)=>{if(i==="%%")return;if(r++,i==="%c")n=r}),e.splice(n,0,t)}F.log=console.debug||console.log||(()=>{});function ny(e){try{if(e)F.storage.setItem("debug",e);else F.storage.removeItem("debug")}catch(t){}}function iy(){let e;try{e=F.storage.getItem("debug")||F.storage.getItem("DEBUG")}catch(t){}if(!e&&typeof process<"u"&&"env"in process)e=process.env.DEBUG;return e}function sy(){try{return localStorage}catch(e){}}jt.exports=fn()(F);var{formatters:oy}=jt.exports;oy.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}});var ec={};li(ec,{createSupportsColor:()=>dn,default:()=>fy});function G(e,t=globalThis.Deno?globalThis.Deno.args:Kt.default.argv){let r=e.startsWith("-")?"":e.length===1?"-":"--",n=t.indexOf(r+e),i=t.indexOf("--");return n!==-1&&(i===-1||n<i)}function ay(){if(!("FORCE_COLOR"in _))return;if(_.FORCE_COLOR==="true")return 1;if(_.FORCE_COLOR==="false")return 0;if(_.FORCE_COLOR.length===0)return 1;let e=Math.min(Number.parseInt(_.FORCE_COLOR,10),3);if(![0,1,2,3].includes(e))return;return e}function cy(e){if(e===0)return!1;return{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function uy(e,{streamIsTTY:t,sniffFlags:r=!0}={}){let n=ay();if(n!==void 0)Ft=n;let i=r?Ft:n;if(i===0)return 0;if(r){if(G("color=16m")||G("color=full")||G("color=truecolor"))return 3;if(G("color=256"))return 2}if("TF_BUILD"in _&&"AGENT_NAME"in _)return 1;if(e&&!t&&i===void 0)return 0;let s=i||0;if(_.TERM==="dumb")return s;if(Kt.default.platform==="win32"){let o=Qa.default.release().split(".");if(Number(o[0])>=10&&Number(o[2])>=10586)return Number(o[2])>=14931?3:2;return 1}if("CI"in _){if(["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some((o)=>(o in _)))return 3;if(["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some((o)=>(o in _))||_.CI_NAME==="codeship")return 1;return s}if("TEAMCITY_VERSION"in _)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(_.TEAMCITY_VERSION)?1:0;if(_.COLORTERM==="truecolor")return 3;if(_.TERM==="xterm-kitty")return 3;if(_.TERM==="xterm-ghostty")return 3;if(_.TERM==="wezterm")return 3;if("TERM_PROGRAM"in _){let o=Number.parseInt((_.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(_.TERM_PROGRAM){case"iTerm.app":return o>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(_.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(_.TERM))return 1;if("COLORTERM"in _)return 1;return s}function dn(e,t={}){let r=uy(e,{streamIsTTY:e&&e.isTTY,...t});return cy(r)}var Kt,Qa,hn,_,Ft,ly,fy;var tc=O(()=>{Kt=ge(require("node:process"),1),Qa=ge(require("node:os"),1),hn=ge(require("node:tty"),1);({env:_}=Kt.default);if(G("no-color")||G("no-colors")||G("color=false")||G("color=never"))Ft=0;else if(G("color")||G("colors")||G("color=true")||G("color=always"))Ft=1;ly={stdout:dn({isTTY:hn.default.isatty(1)}),stderr:dn({isTTY:hn.default.isatty(2)})},fy=ly});var nc=d(function(P,Bt){var hy=require("tty"),Dt=require("util");P.init=Sy;P.log=my;P.formatArgs=py;P.save=yy;P.load=Ey;P.useColors=dy;P.destroy=Dt.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");P.colors=[6,2,3,4,5,1];try{let e=(tc(),ui(ec));if(e&&(e.stderr||e).level>=2)P.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221]}catch(e){}P.inspectOpts=Object.keys(process.env).filter((e)=>/^debug_/i.test(e)).reduce((e,t)=>{let r=t.substring(6).toLowerCase().replace(/_([a-z])/g,(i,s)=>s.toUpperCase()),n=process.env[t];if(/^(yes|on|true|enabled)$/i.test(n))n=!0;else if(/^(no|off|false|disabled)$/i.test(n))n=!1;else if(n==="null")n=null;else n=Number(n);return e[r]=n,e},{});function dy(){return"colors"in P.inspectOpts?Boolean(P.inspectOpts.colors):hy.isatty(process.stderr.fd)}function py(e){let{namespace:t,useColors:r}=this;if(r){let n=this.color,i="\x1B[3"+(n<8?n:"8;5;"+n),s=` ${i};1m${t} \x1B[0m`;e[0]=s+e[0].split(`
3
+ "HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".`,Ge="secret must be a string or buffer",Se="key must be a string or a buffer",df="key must be a string, a buffer or an object",Nr=typeof D.createPublicKey==="function";if(Nr)Se+=" or a KeyObject",Ge+="or a KeyObject";function Ni(e){if(be.isBuffer(e))return;if(typeof e==="string")return;if(!Nr)throw M(Se);if(typeof e!=="object")throw M(Se);if(typeof e.type!=="string")throw M(Se);if(typeof e.asymmetricKeyType!=="string")throw M(Se);if(typeof e.export!=="function")throw M(Se)}function qi(e){if(be.isBuffer(e))return;if(typeof e==="string")return;if(typeof e==="object")return;throw M(df)}function gf(e){if(be.isBuffer(e))return;if(typeof e==="string")return e;if(!Nr)throw M(Ge);if(typeof e!=="object")throw M(Ge);if(e.type!=="secret")throw M(Ge);if(typeof e.export!=="function")throw M(Ge)}function qr(e){return e.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function ji(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 M(e){var t=[].slice.call(arguments,1),r=Li.format.bind(Li,e).apply(null,t);return TypeError(r)}function mf(e){return be.isBuffer(e)||typeof e==="string"}function We(e){if(!mf(e))e=JSON.stringify(e);return e}function Fi(e){return function(r,n){gf(n),r=We(r);var i=D.createHmac("sha"+e,n),s=(i.update(r),i.digest("base64"));return qr(s)}}var Pr,yf="timingSafeEqual"in D?function(t,r){if(t.byteLength!==r.byteLength)return!1;return D.timingSafeEqual(t,r)}:function(t,r){if(!Pr)Pr=$i();return Pr(t,r)};function Ef(e){return function(r,n,i){var s=Fi(e)(r,i);return yf(be.from(n),be.from(s))}}function Ki(e){return function(r,n){qi(n),r=We(r);var i=D.createSign("RSA-SHA"+e),s=(i.update(r),i.sign(n,"base64"));return qr(s)}}function Di(e){return function(r,n,i){Ni(i),r=We(r),n=ji(n);var s=D.createVerify("RSA-SHA"+e);return s.update(r),s.verify(i,n,"base64")}}function wf(e){return function(r,n){qi(n),r=We(r);var i=D.createSign("RSA-SHA"+e),s=(i.update(r),i.sign({key:n,padding:D.constants.RSA_PKCS1_PSS_PADDING,saltLength:D.constants.RSA_PSS_SALTLEN_DIGEST},"base64"));return qr(s)}}function Sf(e){return function(r,n,i){Ni(i),r=We(r),n=ji(n);var s=D.createVerify("RSA-SHA"+e);return s.update(r),s.verify({key:i,padding:D.constants.RSA_PKCS1_PSS_PADDING,saltLength:D.constants.RSA_PSS_SALTLEN_DIGEST},n,"base64")}}function bf(e){var t=Ki(e);return function(){var n=t.apply(null,arguments);return n=Pi.derToJose(n,"ES"+e),n}}function vf(e){var t=Di(e);return function(n,i,s){i=Pi.joseToDer(i,"ES"+e).toString("base64");var o=t(n,i,s);return o}}function Tf(){return function(){return""}}function Af(){return function(t,r){return r===""}}Ui.exports=function(t){var r={hs:Fi,rs:Ki,ps:wf,es:bf,none:Tf},n={hs:Ef,rs:Di,ps:Sf,es:vf,none:Af},i=t.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/);if(!i)throw M(pf,t);var s=(i[1]||i[3]).toLowerCase(),o=i[2];return{sign:r[s](o),verify:n[s](o)}}});var Fr=p(function(Ow,Bi){var If=require("buffer").Buffer;Bi.exports=function(t){if(typeof t==="string")return t;if(typeof t==="number"||If.isBuffer(t))return t.toString();return JSON.stringify(t)}});var zi=p(function(kw,Hi){var Cf=we().Buffer,Ji=kr(),Rf=jr(),xf=require("stream"),Gi=Fr(),Kr=require("util");function Wi(e,t){return Cf.from(e,t).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function _f(e,t,r){r=r||"utf8";var n=Wi(Gi(e),"binary"),i=Wi(Gi(t),r);return Kr.format("%s.%s",n,i)}function Mi(e){var{header:t,payload:r}=e,n=e.secret||e.privateKey,i=e.encoding,s=Rf(t.alg),o=_f(t,r,i),c=s.sign(o,n);return Kr.format("%s.%s",o,c)}function yt(e){var t=e.secret;if(t=t==null?e.privateKey:t,t=t==null?e.key:t,/^hs/i.test(e.header.alg)===!0&&t==null)throw TypeError("secret must be a string or buffer or a KeyObject");var r=new Ji(t);this.readable=!0,this.header=e.header,this.encoding=e.encoding,this.secret=this.privateKey=this.key=r,this.payload=new Ji(e.payload),this.secret.once("close",function(){if(!this.payload.writable&&this.readable)this.sign()}.bind(this)),this.payload.once("close",function(){if(!this.secret.writable&&this.readable)this.sign()}.bind(this))}Kr.inherits(yt,xf);yt.prototype.sign=function(){try{var t=Mi({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")}};yt.sign=Mi;Hi.exports=yt});var is=p(function($w,ns){var Xi=we().Buffer,Vi=kr(),Of=jr(),kf=require("stream"),Yi=Fr(),$f=require("util"),Lf=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function Pf(e){return Object.prototype.toString.call(e)==="[object Object]"}function Nf(e){if(Pf(e))return e;try{return JSON.parse(e)}catch(t){return}}function Zi(e){var t=e.split(".",1)[0];return Nf(Xi.from(t,"base64").toString("binary"))}function qf(e){return e.split(".",2).join(".")}function Qi(e){return e.split(".")[2]}function jf(e,t){t=t||"utf8";var r=e.split(".")[1];return Xi.from(r,"base64").toString(t)}function es(e){return Lf.test(e)&&!!Zi(e)}function ts(e,t,r){if(!t){var n=Error("Missing algorithm parameter for jws.verify");throw n.code="MISSING_ALGORITHM",n}e=Yi(e);var i=Qi(e),s=qf(e),o=Of(t);return o.verify(s,i,r)}function rs(e,t){if(t=t||{},e=Yi(e),!es(e))return null;var r=Zi(e);if(!r)return null;var n=jf(e);if(r.typ==="JWT"||t.json)n=JSON.parse(n,t.encoding);return{header:r,payload:n,signature:Qi(e)}}function ve(e){e=e||{};var t=e.secret;if(t=t==null?e.publicKey:t,t=t==null?e.key:t,/^hs/i.test(e.algorithm)===!0&&t==null)throw TypeError("secret must be a string or buffer or a KeyObject");var r=new Vi(t);this.readable=!0,this.algorithm=e.algorithm,this.encoding=e.encoding,this.secret=this.publicKey=this.key=r,this.signature=new Vi(e.signature),this.secret.once("close",function(){if(!this.signature.writable&&this.readable)this.verify()}.bind(this)),this.signature.once("close",function(){if(!this.secret.writable&&this.readable)this.verify()}.bind(this))}$f.inherits(ve,kf);ve.prototype.verify=function(){try{var t=ts(this.signature.buffer,this.algorithm,this.key.buffer),r=rs(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")}};ve.decode=rs;ve.isValid=es;ve.verify=ts;ns.exports=ve});var wt=p(function(re){var ss=zi(),Et=is(),Ff=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"];re.ALGORITHMS=Ff;re.sign=ss.sign;re.verify=Et.verify;re.decode=Et.decode;re.isValid=Et.isValid;re.createSign=function(t){return new ss(t)};re.createVerify=function(t){return new Et(t)}});var Dr=p(function(Pw,os){var Kf=wt();os.exports=function(e,t){t=t||{};var r=Kf.decode(e,t);if(!r)return null;var n=r.payload;if(typeof n==="string")try{var i=JSON.parse(n);if(i!==null&&typeof i==="object")n=i}catch(s){}if(t.complete===!0)return{header:r.header,payload:n,signature:r.signature};return n}});var Me=p(function(Nw,as){var St=function(e,t){if(Error.call(this,e),Error.captureStackTrace)Error.captureStackTrace(this,this.constructor);if(this.name="JsonWebTokenError",this.message=e,t)this.inner=t};St.prototype=Object.create(Error.prototype);St.prototype.constructor=St;as.exports=St});var Ur=p(function(qw,us){var cs=Me(),bt=function(e,t){cs.call(this,e),this.name="NotBeforeError",this.date=t};bt.prototype=Object.create(cs.prototype);bt.prototype.constructor=bt;us.exports=bt});var Br=p(function(jw,fs){var ls=Me(),vt=function(e,t){ls.call(this,e),this.name="TokenExpiredError",this.expiredAt=t};vt.prototype=Object.create(ls.prototype);vt.prototype.constructor=vt;fs.exports=vt});var Jr=p(function(Fw,hs){var Te=1000,Ae=Te*60,Ie=Ae*60,fe=Ie*24,Df=fe*7,Uf=fe*365.25;hs.exports=function(e,t){t=t||{};var r=typeof e;if(r==="string"&&e.length>0)return Bf(e);else if(r==="number"&&isFinite(e))return t.long?Gf(e):Jf(e);throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function Bf(e){if(e=String(e),e.length>100)return;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)return;var r=parseFloat(t[1]),n=(t[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*Uf;case"weeks":case"week":case"w":return r*Df;case"days":case"day":case"d":return r*fe;case"hours":case"hour":case"hrs":case"hr":case"h":return r*Ie;case"minutes":case"minute":case"mins":case"min":case"m":return r*Ae;case"seconds":case"second":case"secs":case"sec":case"s":return r*Te;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}function Jf(e){var t=Math.abs(e);if(t>=fe)return Math.round(e/fe)+"d";if(t>=Ie)return Math.round(e/Ie)+"h";if(t>=Ae)return Math.round(e/Ae)+"m";if(t>=Te)return Math.round(e/Te)+"s";return e+"ms"}function Gf(e){var t=Math.abs(e);if(t>=fe)return Tt(e,t,fe,"day");if(t>=Ie)return Tt(e,t,Ie,"hour");if(t>=Ae)return Tt(e,t,Ae,"minute");if(t>=Te)return Tt(e,t,Te,"second");return e+" ms"}function Tt(e,t,r,n){var i=t>=r*1.5;return Math.round(e/r)+" "+n+(i?"s":"")}});var Gr=p(function(Kw,ps){var Wf=Jr();ps.exports=function(e,t){var r=t||Math.floor(Date.now()/1000);if(typeof e==="string"){var n=Wf(e);if(typeof n>"u")return;return Math.floor(r+n/1000)}else if(typeof e==="number")return r+e;else return}});var Ce=p(function(Dw,ds){var Mf=Number.MAX_SAFE_INTEGER||9007199254740991,Hf=["major","premajor","minor","preminor","patch","prepatch","prerelease"];ds.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:Mf,RELEASE_TYPES:Hf,SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var He=p(function(Uw,gs){var zf=typeof process==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};gs.exports=zf});var Re=p(function(X,ms){var{MAX_SAFE_COMPONENT_LENGTH:Wr,MAX_SAFE_BUILD_LENGTH:Vf,MAX_LENGTH:Xf}=Ce(),Yf=He();X=ms.exports={};var Zf=X.re=[],Qf=X.safeRe=[],y=X.src=[],eh=X.safeSrc=[],E=X.t={},th=0,Mr="[a-zA-Z0-9-]",rh=[["\\s",1],["\\d",Xf],[Mr,Vf]],nh=(e)=>{for(let[t,r]of rh)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e},v=(e,t,r)=>{let n=nh(t),i=th++;Yf(e,i,t),E[e]=i,y[i]=t,eh[i]=n,Zf[i]=new RegExp(t,r?"g":void 0),Qf[i]=new RegExp(n,r?"g":void 0)};v("NUMERICIDENTIFIER","0|[1-9]\\d*");v("NUMERICIDENTIFIERLOOSE","\\d+");v("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${Mr}*`);v("MAINVERSION",`(${y[E.NUMERICIDENTIFIER]})\\.(${y[E.NUMERICIDENTIFIER]})\\.(${y[E.NUMERICIDENTIFIER]})`);v("MAINVERSIONLOOSE",`(${y[E.NUMERICIDENTIFIERLOOSE]})\\.(${y[E.NUMERICIDENTIFIERLOOSE]})\\.(${y[E.NUMERICIDENTIFIERLOOSE]})`);v("PRERELEASEIDENTIFIER",`(?:${y[E.NONNUMERICIDENTIFIER]}|${y[E.NUMERICIDENTIFIER]})`);v("PRERELEASEIDENTIFIERLOOSE",`(?:${y[E.NONNUMERICIDENTIFIER]}|${y[E.NUMERICIDENTIFIERLOOSE]})`);v("PRERELEASE",`(?:-(${y[E.PRERELEASEIDENTIFIER]}(?:\\.${y[E.PRERELEASEIDENTIFIER]})*))`);v("PRERELEASELOOSE",`(?:-?(${y[E.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${y[E.PRERELEASEIDENTIFIERLOOSE]})*))`);v("BUILDIDENTIFIER",`${Mr}+`);v("BUILD",`(?:\\+(${y[E.BUILDIDENTIFIER]}(?:\\.${y[E.BUILDIDENTIFIER]})*))`);v("FULLPLAIN",`v?${y[E.MAINVERSION]}${y[E.PRERELEASE]}?${y[E.BUILD]}?`);v("FULL",`^${y[E.FULLPLAIN]}$`);v("LOOSEPLAIN",`[v=\\s]*${y[E.MAINVERSIONLOOSE]}${y[E.PRERELEASELOOSE]}?${y[E.BUILD]}?`);v("LOOSE",`^${y[E.LOOSEPLAIN]}$`);v("GTLT","((?:<|>)?=?)");v("XRANGEIDENTIFIERLOOSE",`${y[E.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);v("XRANGEIDENTIFIER",`${y[E.NUMERICIDENTIFIER]}|x|X|\\*`);v("XRANGEPLAIN",`[v=\\s]*(${y[E.XRANGEIDENTIFIER]})(?:\\.(${y[E.XRANGEIDENTIFIER]})(?:\\.(${y[E.XRANGEIDENTIFIER]})(?:${y[E.PRERELEASE]})?${y[E.BUILD]}?)?)?`);v("XRANGEPLAINLOOSE",`[v=\\s]*(${y[E.XRANGEIDENTIFIERLOOSE]})(?:\\.(${y[E.XRANGEIDENTIFIERLOOSE]})(?:\\.(${y[E.XRANGEIDENTIFIERLOOSE]})(?:${y[E.PRERELEASELOOSE]})?${y[E.BUILD]}?)?)?`);v("XRANGE",`^${y[E.GTLT]}\\s*${y[E.XRANGEPLAIN]}$`);v("XRANGELOOSE",`^${y[E.GTLT]}\\s*${y[E.XRANGEPLAINLOOSE]}$`);v("COERCEPLAIN",`(^|[^\\d])(\\d{1,${Wr}})(?:\\.(\\d{1,${Wr}}))?(?:\\.(\\d{1,${Wr}}))?`);v("COERCE",`${y[E.COERCEPLAIN]}(?:$|[^\\d])`);v("COERCEFULL",y[E.COERCEPLAIN]+`(?:${y[E.PRERELEASE]})?(?:${y[E.BUILD]})?(?:$|[^\\d])`);v("COERCERTL",y[E.COERCE],!0);v("COERCERTLFULL",y[E.COERCEFULL],!0);v("LONETILDE","(?:~>?)");v("TILDETRIM",`(\\s*)${y[E.LONETILDE]}\\s+`,!0);X.tildeTrimReplace="$1~";v("TILDE",`^${y[E.LONETILDE]}${y[E.XRANGEPLAIN]}$`);v("TILDELOOSE",`^${y[E.LONETILDE]}${y[E.XRANGEPLAINLOOSE]}$`);v("LONECARET","(?:\\^)");v("CARETTRIM",`(\\s*)${y[E.LONECARET]}\\s+`,!0);X.caretTrimReplace="$1^";v("CARET",`^${y[E.LONECARET]}${y[E.XRANGEPLAIN]}$`);v("CARETLOOSE",`^${y[E.LONECARET]}${y[E.XRANGEPLAINLOOSE]}$`);v("COMPARATORLOOSE",`^${y[E.GTLT]}\\s*(${y[E.LOOSEPLAIN]})$|^$`);v("COMPARATOR",`^${y[E.GTLT]}\\s*(${y[E.FULLPLAIN]})$|^$`);v("COMPARATORTRIM",`(\\s*)${y[E.GTLT]}\\s*(${y[E.LOOSEPLAIN]}|${y[E.XRANGEPLAIN]})`,!0);X.comparatorTrimReplace="$1$2$3";v("HYPHENRANGE",`^\\s*(${y[E.XRANGEPLAIN]})\\s+-\\s+(${y[E.XRANGEPLAIN]})\\s*$`);v("HYPHENRANGELOOSE",`^\\s*(${y[E.XRANGEPLAINLOOSE]})\\s+-\\s+(${y[E.XRANGEPLAINLOOSE]})\\s*$`);v("STAR","(<|>)?=?\\s*\\*");v("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");v("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var At=p(function(Bw,ys){var ih=Object.freeze({loose:!0}),sh=Object.freeze({}),oh=(e)=>{if(!e)return sh;if(typeof e!=="object")return ih;return e};ys.exports=oh});var Hr=p(function(Jw,Ss){var Es=/^[0-9]+$/,ws=(e,t)=>{if(typeof e==="number"&&typeof t==="number")return e===t?0:e<t?-1:1;let r=Es.test(e),n=Es.test(t);if(r&&n)e=+e,t=+t;return e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1},ah=(e,t)=>ws(t,e);Ss.exports={compareIdentifiers:ws,rcompareIdentifiers:ah}});var P=p(function(Gw,vs){var It=He(),{MAX_LENGTH:bs,MAX_SAFE_INTEGER:Ct}=Ce(),{safeRe:Rt,t:xt}=Re(),ch=At(),{compareIdentifiers:zr}=Hr(),uh=(e,t)=>{let r=t.split(".");if(r.length>e.length)return!1;for(let n=0;n<r.length;n++)if(zr(e[n],r[n])!==0)return!1;return!0};class H{constructor(e,t){if(t=ch(t),e instanceof H)if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;else e=e.version;else if(typeof e!=="string")throw TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>bs)throw TypeError(`version is longer than ${bs} characters`);It("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let r=e.trim().match(t.loose?Rt[xt.LOOSE]:Rt[xt.FULL]);if(!r)throw TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>Ct||this.major<0)throw TypeError("Invalid major version");if(this.minor>Ct||this.minor<0)throw TypeError("Invalid minor version");if(this.patch>Ct||this.patch<0)throw TypeError("Invalid patch version");if(!r[4])this.prerelease=[];else this.prerelease=r[4].split(".").map((n)=>{if(/^[0-9]+$/.test(n)){let i=+n;if(i>=0&&i<Ct)return i}return n});this.build=r[5]?r[5].split("."):[],this.format()}format(){if(this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length)this.version+=`-${this.prerelease.join(".")}`;return this.version}toString(){return this.version}compare(e){if(It("SemVer.compare",this.version,this.options,e),!(e instanceof H)){if(typeof e==="string"&&e===this.version)return 0;e=new H(e,this.options)}if(e.version===this.version)return 0;return this.compareMain(e)||this.comparePre(e)}compareMain(e){if(!(e instanceof H))e=new H(e,this.options);if(this.major<e.major)return-1;if(this.major>e.major)return 1;if(this.minor<e.minor)return-1;if(this.minor>e.minor)return 1;if(this.patch<e.patch)return-1;if(this.patch>e.patch)return 1;return 0}comparePre(e){if(!(e instanceof H))e=new H(e,this.options);if(this.prerelease.length&&!e.prerelease.length)return-1;else if(!this.prerelease.length&&e.prerelease.length)return 1;else if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{let r=this.prerelease[t],n=e.prerelease[t];if(It("prerelease compare",t,r,n),r===void 0&&n===void 0)return 0;else if(n===void 0)return 1;else if(r===void 0)return-1;else if(r===n)continue;else return zr(r,n)}while(++t)}compareBuild(e){if(!(e instanceof H))e=new H(e,this.options);let t=0;do{let r=this.build[t],n=e.build[t];if(It("build compare",t,r,n),r===void 0&&n===void 0)return 0;else if(n===void 0)return 1;else if(r===void 0)return-1;else if(r===n)continue;else return zr(r,n)}while(++t)}inc(e,t,r){if(e.startsWith("pre")){if(!t&&r===!1)throw Error("invalid increment argument: identifier is empty");if(t){let n=`-${t}`.match(this.options.loose?Rt[xt.PRERELEASELOOSE]:Rt[xt.PRERELEASE]);if(!n||n[1]!==t)throw Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,r),this.inc("pre",t,r);break;case"prerelease":if(this.prerelease.length===0)this.inc("patch",t,r);this.inc("pre",t,r);break;case"release":if(this.prerelease.length===0)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":if(this.minor!==0||this.patch!==0||this.prerelease.length===0)this.major++;this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":if(this.patch!==0||this.prerelease.length===0)this.minor++;this.patch=0,this.prerelease=[];break;case"patch":if(this.prerelease.length===0)this.patch++;this.prerelease=[];break;case"pre":{let n=Number(r)?1:0;if(this.prerelease.length===0)this.prerelease=[n];else{let i=this.prerelease.length;while(--i>=0)if(typeof this.prerelease[i]==="number")this.prerelease[i]++,i=-2;if(i===-1){if(t===this.prerelease.join(".")&&r===!1)throw Error("invalid increment argument: identifier already exists");this.prerelease.push(n)}}if(t){let i=[t,n];if(r===!1)i=[t];if(uh(this.prerelease,t)){let s=this.prerelease[t.split(".").length];if(isNaN(s))this.prerelease=i}else this.prerelease=i}break}default:throw Error(`invalid increment argument: ${e}`)}if(this.raw=this.format(),this.build.length)this.raw+=`+${this.build.join(".")}`;return this}}vs.exports=H});var ne=p(function(Ww,As){var Ts=P(),lh=(e,t,r=!1)=>{if(e instanceof Ts)return e;try{return new Ts(e,t)}catch(n){if(!r)return null;throw n}};As.exports=lh});var Cs=p(function(Mw,Is){var fh=ne(),hh=(e,t)=>{let r=fh(e,t);return r?r.version:null};Is.exports=hh});var xs=p(function(Hw,Rs){var ph=ne(),dh=(e,t)=>{let r=ph(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};Rs.exports=dh});var ks=p(function(zw,Os){var _s=P(),gh=(e,t,r,n,i)=>{if(typeof r==="string")i=n,n=r,r=void 0;try{return new _s(e instanceof _s?e.version:e,r).inc(t,n,i).version}catch(s){return null}};Os.exports=gh});var Ps=p(function(Vw,Ls){var $s=ne(),mh=(e,t)=>{let r=$s(e,null,!0),n=$s(t,null,!0),i=r.compare(n);if(i===0)return null;let s=i>0,o=s?r:n,c=s?n:r,u=!!o.prerelease.length;if(!!c.prerelease.length&&!u){if(!c.patch&&!c.minor)return"major";if(c.compareMain(o)===0){if(c.minor&&!c.patch)return"minor";return"patch"}}let l=u?"pre":"";if(r.major!==n.major)return l+"major";if(r.minor!==n.minor)return l+"minor";if(r.patch!==n.patch)return l+"patch";return"prerelease"};Ls.exports=mh});var qs=p(function(Xw,Ns){var yh=P(),Eh=(e,t)=>new yh(e,t).major;Ns.exports=Eh});var Fs=p(function(Yw,js){var wh=P(),Sh=(e,t)=>new wh(e,t).minor;js.exports=Sh});var Ds=p(function(Zw,Ks){var bh=P(),vh=(e,t)=>new bh(e,t).patch;Ks.exports=vh});var Bs=p(function(Qw,Us){var Th=ne(),Ah=(e,t)=>{let r=Th(e,t);return r&&r.prerelease.length?r.prerelease:null};Us.exports=Ah});var U=p(function(eS,Gs){var Js=P(),Ih=(e,t,r)=>new Js(e,r).compare(new Js(t,r));Gs.exports=Ih});var Ms=p(function(tS,Ws){var Ch=U(),Rh=(e,t,r)=>Ch(t,e,r);Ws.exports=Rh});var zs=p(function(rS,Hs){var xh=U(),_h=(e,t)=>xh(e,t,!0);Hs.exports=_h});var _t=p(function(nS,Xs){var Vs=P(),Oh=(e,t,r)=>{let n=new Vs(e,r),i=new Vs(t,r);return n.compare(i)||n.compareBuild(i)};Xs.exports=Oh});var Zs=p(function(iS,Ys){var kh=_t(),$h=(e,t)=>e.sort((r,n)=>kh(r,n,t));Ys.exports=$h});var eo=p(function(sS,Qs){var Lh=_t(),Ph=(e,t)=>e.sort((r,n)=>Lh(n,r,t));Qs.exports=Ph});var ze=p(function(oS,to){var Nh=U(),qh=(e,t,r)=>Nh(e,t,r)>0;to.exports=qh});var Ot=p(function(aS,ro){var jh=U(),Fh=(e,t,r)=>jh(e,t,r)<0;ro.exports=Fh});var Vr=p(function(cS,no){var Kh=U(),Dh=(e,t,r)=>Kh(e,t,r)===0;no.exports=Dh});var Xr=p(function(uS,io){var Uh=U(),Bh=(e,t,r)=>Uh(e,t,r)!==0;io.exports=Bh});var kt=p(function(lS,so){var Jh=U(),Gh=(e,t,r)=>Jh(e,t,r)>=0;so.exports=Gh});var $t=p(function(fS,oo){var Wh=U(),Mh=(e,t,r)=>Wh(e,t,r)<=0;oo.exports=Mh});var Yr=p(function(hS,ao){var Hh=Vr(),zh=Xr(),Vh=ze(),Xh=kt(),Yh=Ot(),Zh=$t(),Qh=(e,t,r,n)=>{switch(t){case"===":if(typeof e==="object")e=e.version;if(typeof r==="object")r=r.version;return e===r;case"!==":if(typeof e==="object")e=e.version;if(typeof r==="object")r=r.version;return e!==r;case"":case"=":case"==":return Hh(e,r,n);case"!=":return zh(e,r,n);case">":return Vh(e,r,n);case">=":return Xh(e,r,n);case"<":return Yh(e,r,n);case"<=":return Zh(e,r,n);default:throw TypeError(`Invalid operator: ${t}`)}};ao.exports=Qh});var uo=p(function(pS,co){var ep=P(),tp=ne(),{safeRe:Lt,t:Pt}=Re(),rp=(e,t)=>{if(e instanceof ep)return e;if(typeof e==="number")e=String(e);if(typeof e!=="string")return null;t=t||{};let r=null;if(!t.rtl)r=e.match(t.includePrerelease?Lt[Pt.COERCEFULL]:Lt[Pt.COERCE]);else{let u=t.includePrerelease?Lt[Pt.COERCERTLFULL]:Lt[Pt.COERCERTL],a;while((a=u.exec(e))&&(!r||r.index+r[0].length!==e.length)){if(!r||a.index+a[0].length!==r.index+r[0].length)r=a;u.lastIndex=a.index+a[1].length+a[2].length}u.lastIndex=-1}if(r===null)return null;let n=r[2],i=r[3]||"0",s=r[4]||"0",o=t.includePrerelease&&r[5]?`-${r[5]}`:"",c=t.includePrerelease&&r[6]?`+${r[6]}`:"";return tp(`${n}.${i}.${s}${o}${c}`,t)};co.exports=rp});var ho=p(function(dS,fo){var np=ne(),lo=Ce(),ip=P(),sp=(e,t,r)=>{if(!lo.RELEASE_TYPES.includes(t))return null;let n=op(e,r);return n&&ap(n,t)},op=(e,t)=>{let r=e instanceof ip?e.version:e;return np(r,t)},ap=(e,t)=>{if(cp(t))return e.version;switch(e.prerelease=[],t){case"major":e.minor=0,e.patch=0;break;case"minor":e.patch=0;break}return e.format()},cp=(e)=>e.startsWith("pre");fo.exports=sp});var mo=p(function(gS,go){class po{constructor(){this.max=1000,this.map=new Map}get(e){let t=this.map.get(e);if(t===void 0)return;else return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&t!==void 0){if(this.map.size>=this.max){let n=this.map.keys().next().value;this.delete(n)}this.map.set(e,t)}return this}}go.exports=po});var B=p(function(mS,So){var up=/\s+/g;class Ve{constructor(e,t){if(t=fp(t),e instanceof Ve)if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;else return new Ve(e.raw,t);if(e instanceof Nt)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(up," "),this.set=this.raw.split("||").map((r)=>this.parseRange(r.trim())).filter((r)=>r.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let r=this.set[0];if(this.set=this.set.filter((n)=>!Eo(n[0])),this.set.length===0)this.set=[r];else if(this.set.length>1){for(let n of this.set)if(n.length===1&&Sp(n[0])){this.set=[n];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){if(e>0)this.formatted+="||";let t=this.set[e];for(let r=0;r<t.length;r++){if(r>0)this.formatted+=" ";this.formatted+=t[r].toString().trim()}}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){e=e.replace(wp,"");let r=((this.options.includePrerelease&&yp)|(this.options.loose&&Ep))+":"+e,n=yo.get(r);if(n)return n;let i=this.options.loose,s=i?j[N.HYPHENRANGELOOSE]:j[N.HYPHENRANGE];e=e.replace(s,kp(this.options.includePrerelease)),x("hyphen replace",e),e=e.replace(j[N.COMPARATORTRIM],dp),x("comparator trim",e),e=e.replace(j[N.TILDETRIM],gp),x("tilde trim",e),e=e.replace(j[N.CARETTRIM],mp),x("caret trim",e);let o=e.split(" ").map((l)=>bp(l,this.options)).join(" ").split(/\s+/).map((l)=>Op(l,this.options));if(i)o=o.filter((l)=>(x("loose invalid filter",l,this.options),!!l.match(j[N.COMPARATORLOOSE])));x("range list",o);let c=new Map,u=o.map((l)=>new Nt(l,this.options));for(let l of u){if(Eo(l))return[l];c.set(l.value,l)}if(c.size>1&&c.has(""))c.delete("");let a=[...c.values()];return yo.set(r,a),a}intersects(e,t){if(!(e instanceof Ve))throw TypeError("a Range is required");return this.set.some((r)=>wo(r,t)&&e.set.some((n)=>wo(n,t)&&r.every((i)=>n.every((s)=>i.intersects(s,t)))))}test(e){if(!e)return!1;if(typeof e==="string")try{e=new hp(e,this.options)}catch(t){return!1}for(let t=0;t<this.set.length;t++)if($p(this.set[t],e,this.options))return!0;return!1}}So.exports=Ve;var lp=mo(),yo=new lp,fp=At(),Nt=Xe(),x=He(),hp=P(),{safeRe:j,src:pp,t:N,comparatorTrimReplace:dp,tildeTrimReplace:gp,caretTrimReplace:mp}=Re(),{FLAG_INCLUDE_PRERELEASE:yp,FLAG_LOOSE:Ep}=Ce(),wp=new RegExp(pp[N.BUILD],"g"),Eo=(e)=>e.value==="<0.0.0-0",Sp=(e)=>e.value==="",wo=(e,t)=>{let r=!0,n=e.slice(),i=n.pop();while(r&&n.length)r=n.every((s)=>i.intersects(s,t)),i=n.pop();return r},bp=(e,t)=>(e=e.replace(j[N.BUILD],""),x("comp",e,t),e=Ip(e,t),x("caret",e),e=Tp(e,t),x("tildes",e),e=Rp(e,t),x("xrange",e),e=_p(e,t),x("stars",e),e),O=(e)=>!e||e.toLowerCase()==="x"||e==="*",vp=(e,t,r)=>O(e)&&!O(t)||O(t)&&r&&!O(r),Tp=(e,t)=>e.trim().split(/\s+/).map((r)=>Ap(r,t)).join(" "),Ap=(e,t)=>{let r=t.loose?j[N.TILDELOOSE]:j[N.TILDE],n=t.includePrerelease?"-0":"";return e.replace(r,(i,s,o,c,u)=>{x("tilde",e,i,s,o,c,u);let a;if(O(s))a="";else if(O(o))a=`>=${s}.0.0${n} <${+s+1}.0.0-0`;else if(O(c))a=`>=${s}.${o}.0${n} <${s}.${+o+1}.0-0`;else if(u)x("replaceTilde pr",u),a=`>=${s}.${o}.${c}-${u} <${s}.${+o+1}.0-0`;else a=`>=${s}.${o}.${c} <${s}.${+o+1}.0-0`;return x("tilde return",a),a})},Ip=(e,t)=>e.trim().split(/\s+/).map((r)=>Cp(r,t)).join(" "),Cp=(e,t)=>{x("caret",e,t);let r=t.loose?j[N.CARETLOOSE]:j[N.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,(i,s,o,c,u)=>{x("caret",e,i,s,o,c,u);let a;if(O(s))a="";else if(O(o))a=`>=${s}.0.0${n} <${+s+1}.0.0-0`;else if(O(c))if(s==="0")a=`>=${s}.${o}.0${n} <${s}.${+o+1}.0-0`;else a=`>=${s}.${o}.0${n} <${+s+1}.0.0-0`;else if(u)if(x("replaceCaret pr",u),s==="0")if(o==="0")a=`>=${s}.${o}.${c}-${u} <${s}.${o}.${+c+1}-0`;else a=`>=${s}.${o}.${c}-${u} <${s}.${+o+1}.0-0`;else a=`>=${s}.${o}.${c}-${u} <${+s+1}.0.0-0`;else if(x("no pr"),s==="0")if(o==="0")a=`>=${s}.${o}.${c} <${s}.${o}.${+c+1}-0`;else a=`>=${s}.${o}.${c} <${s}.${+o+1}.0-0`;else a=`>=${s}.${o}.${c} <${+s+1}.0.0-0`;return x("caret return",a),a})},Rp=(e,t)=>(x("replaceXRanges",e,t),e.split(/\s+/).map((r)=>xp(r,t)).join(" ")),xp=(e,t)=>{e=e.trim();let r=t.loose?j[N.XRANGELOOSE]:j[N.XRANGE];return e.replace(r,(n,i,s,o,c,u)=>{if(x("xRange",e,n,i,s,o,c,u),vp(s,o,c))return e;let a=O(s),l=a||O(o),f=l||O(c),g=f;if(i==="="&&g)i="";if(u=t.includePrerelease?"-0":"",a)if(i===">"||i==="<")n="<0.0.0-0";else n="*";else if(i&&g){if(l)o=0;if(c=0,i===">")if(i=">=",l)s=+s+1,o=0,c=0;else o=+o+1,c=0;else if(i==="<=")if(i="<",l)s=+s+1;else o=+o+1;if(i==="<")u="-0";n=`${i+s}.${o}.${c}${u}`}else if(l)n=`>=${s}.0.0${u} <${+s+1}.0.0-0`;else if(f)n=`>=${s}.${o}.0${u} <${s}.${+o+1}.0-0`;return x("xRange return",n),n})},_p=(e,t)=>(x("replaceStars",e,t),e.trim().replace(j[N.STAR],"")),Op=(e,t)=>(x("replaceGTE0",e,t),e.trim().replace(j[t.includePrerelease?N.GTE0PRE:N.GTE0],"")),kp=(e)=>(t,r,n,i,s,o,c,u,a,l,f,g)=>{if(O(n))r="";else if(O(i))r=`>=${n}.0.0${e?"-0":""}`;else if(O(s))r=`>=${n}.${i}.0${e?"-0":""}`;else if(o)r=`>=${r}`;else r=`>=${r}${e?"-0":""}`;if(O(a))u="";else if(O(l))u=`<${+a+1}.0.0-0`;else if(O(f))u=`<${a}.${+l+1}.0-0`;else if(g)u=`<=${a}.${l}.${f}-${g}`;else if(e)u=`<${a}.${l}.${+f+1}-0`;else u=`<=${u}`;return`${r} ${u}`.trim()},$p=(e,t,r)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let n=0;n<e.length;n++){if(x(e[n].semver),e[n].semver===Nt.ANY)continue;if(e[n].semver.prerelease.length>0){let i=e[n].semver;if(i.major===t.major&&i.minor===t.minor&&i.patch===t.patch)return!0}}return!1}return!0}});var Xe=p(function(yS,Co){var Ye=Symbol("SemVer ANY");class qt{static get ANY(){return Ye}constructor(e,t){if(t=bo(t),e instanceof qt)if(e.loose===!!t.loose)return e;else e=e.value;if(e=e.trim().split(/\s+/).join(" "),Qr("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===Ye)this.value="";else this.value=this.operator+this.semver.version;Qr("comp",this)}parse(e){let t=this.options.loose?vo[To.COMPARATORLOOSE]:vo[To.COMPARATOR],r=e.match(t);if(!r)throw TypeError(`Invalid comparator: ${e}`);if(this.operator=r[1]!==void 0?r[1]:"",this.operator==="=")this.operator="";if(!r[2])this.semver=Ye;else this.semver=new Ao(r[2],this.options.loose)}toString(){return this.value}test(e){if(Qr("Comparator.test",e,this.options.loose),this.semver===Ye||e===Ye)return!0;if(typeof e==="string")try{e=new Ao(e,this.options)}catch(t){return!1}return Zr(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof qt))throw TypeError("a Comparator is required");if(this.operator===""){if(this.value==="")return!0;return new Io(e.value,t).test(this.value)}else if(e.operator===""){if(e.value==="")return!0;return new Io(this.value,t).test(e.semver)}if(t=bo(t),t.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0"))return!1;if(!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0")))return!1;if(this.operator.startsWith(">")&&e.operator.startsWith(">"))return!0;if(this.operator.startsWith("<")&&e.operator.startsWith("<"))return!0;if(this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("="))return!0;if(Zr(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))return!0;if(Zr(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">"))return!0;return!1}}Co.exports=qt;var bo=At(),{safeRe:vo,t:To}=Re(),Zr=Yr(),Qr=He(),Ao=P(),Io=B()});var Ze=p(function(ES,Ro){var Lp=B(),Pp=(e,t,r)=>{try{t=new Lp(t,r)}catch(n){return!1}return t.test(e)};Ro.exports=Pp});var _o=p(function(wS,xo){var Np=B(),qp=(e,t)=>new Np(e,t).set.map((r)=>r.map((n)=>n.value).join(" ").trim().split(" "));xo.exports=qp});var ko=p(function(SS,Oo){var jp=P(),Fp=B(),Kp=(e,t,r)=>{let n=null,i=null,s=null;try{s=new Fp(t,r)}catch(o){return null}return e.forEach((o)=>{if(s.test(o)){if(!n||i.compare(o)===-1)n=o,i=new jp(n,r)}}),n};Oo.exports=Kp});var Lo=p(function(bS,$o){var Dp=P(),Up=B(),Bp=(e,t,r)=>{let n=null,i=null,s=null;try{s=new Up(t,r)}catch(o){return null}return e.forEach((o)=>{if(s.test(o)){if(!n||i.compare(o)===1)n=o,i=new Dp(n,r)}}),n};$o.exports=Bp});var qo=p(function(vS,No){var en=P(),Jp=B(),Po=ze(),Gp=(e,t)=>{e=new Jp(e,t);let r=new en("0.0.0");if(e.test(r))return r;if(r=new en("0.0.0-0"),e.test(r))return r;r=null;for(let n=0;n<e.set.length;++n){let i=e.set[n],s=null;if(i.forEach((o)=>{let c=new en(o.semver.version);switch(o.operator){case">":if(c.prerelease.length===0)c.patch++;else c.prerelease.push(0);c.raw=c.format();case"":case">=":if(!s||Po(c,s))s=c;break;case"<":case"<=":break;default:throw Error(`Unexpected operation: ${o.operator}`)}}),s&&(!r||Po(r,s)))r=s}if(r&&e.test(r))return r;return null};No.exports=Gp});var Fo=p(function(TS,jo){var Wp=B(),Mp=(e,t)=>{try{return new Wp(e,t).range||"*"}catch(r){return null}};jo.exports=Mp});var jt=p(function(AS,Bo){var Hp=P(),Uo=Xe(),{ANY:zp}=Uo,Vp=B(),Xp=Ze(),Ko=ze(),Do=Ot(),Yp=$t(),Zp=kt(),Qp=(e,t,r,n)=>{e=new Hp(e,n),t=new Vp(t,n);let i,s,o,c,u;switch(r){case">":i=Ko,s=Yp,o=Do,c=">",u=">=";break;case"<":i=Do,s=Zp,o=Ko,c="<",u="<=";break;default:throw TypeError('Must provide a hilo val of "<" or ">"')}if(Xp(e,t,n))return!1;for(let a=0;a<t.set.length;++a){let l=t.set[a],f=null,g=null;if(l.forEach((h)=>{if(h.semver===zp)h=new Uo(">=0.0.0");if(f=f||h,g=g||h,i(h.semver,f.semver,n))f=h;else if(o(h.semver,g.semver,n))g=h}),f.operator===c||f.operator===u)return!1;if((!g.operator||g.operator===c)&&s(e,g.semver))return!1;else if(g.operator===u&&o(e,g.semver))return!1}return!0};Bo.exports=Qp});var Go=p(function(IS,Jo){var ed=jt(),td=(e,t,r)=>ed(e,t,">",r);Jo.exports=td});var Mo=p(function(CS,Wo){var rd=jt(),nd=(e,t,r)=>rd(e,t,"<",r);Wo.exports=nd});var Vo=p(function(RS,zo){var Ho=B(),id=(e,t,r)=>(e=new Ho(e,r),t=new Ho(t,r),e.intersects(t,r));zo.exports=id});var Yo=p(function(xS,Xo){var sd=Ze(),od=U();Xo.exports=(e,t,r)=>{let n=[],i=null,s=null,o=e.sort((l,f)=>od(l,f,r));for(let l of o)if(sd(l,t,r)){if(s=l,!i)i=l}else{if(s)n.push([i,s]);s=null,i=null}if(i)n.push([i,null]);let c=[];for(let[l,f]of n)if(l===f)c.push(l);else if(!f&&l===o[0])c.push("*");else if(!f)c.push(`>=${l}`);else if(l===o[0])c.push(`<=${f}`);else c.push(`${l} - ${f}`);let u=c.join(" || "),a=typeof t.raw==="string"?t.raw:String(t);return u.length<a.length?u:t}});var na=p(function(_S,ra){var Zo=B(),nn=Xe(),{ANY:tn}=nn,rn=Ze(),sn=U(),ad=(e,t,r={})=>{if(e===t)return!0;e=new Zo(e,r),t=new Zo(t,r);let n=!1;e:for(let i of e.set){for(let s of t.set){let o=ud(i,s,r);if(n=n||o!==null,o)continue e}if(n)return!1}return!0},cd=[new nn(">=0.0.0-0")],Qo=[new nn(">=0.0.0")],ud=(e,t,r)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===tn)if(t.length===1&&t[0].semver===tn)return!0;else if(r.includePrerelease)e=cd;else e=Qo;if(t.length===1&&t[0].semver===tn)if(r.includePrerelease)return!0;else t=Qo;let n=new Set,i,s;for(let h of e)if(h.operator===">"||h.operator===">=")i=ea(i,h,r);else if(h.operator==="<"||h.operator==="<=")s=ta(s,h,r);else n.add(h.semver);if(n.size>1)return null;let o;if(i&&s){if(o=sn(i.semver,s.semver,r),o>0)return null;else if(o===0&&(i.operator!==">="||s.operator!=="<="))return null}for(let h of n){if(i&&!rn(h,String(i),r))return null;if(s&&!rn(h,String(s),r))return null;for(let m of t)if(!rn(h,String(m),r))return!1;return!0}let c,u,a,l,f=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1,g=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1;if(f&&f.prerelease.length===1&&s.operator==="<"&&f.prerelease[0]===0)f=!1;for(let h of t){if(l=l||h.operator===">"||h.operator===">=",a=a||h.operator==="<"||h.operator==="<=",i){if(g){if(h.semver.prerelease&&h.semver.prerelease.length&&h.semver.major===g.major&&h.semver.minor===g.minor&&h.semver.patch===g.patch)g=!1}if(h.operator===">"||h.operator===">="){if(c=ea(i,h,r),c===h&&c!==i)return!1}else if(i.operator===">="&&!h.test(i.semver))return!1}if(s){if(f){if(h.semver.prerelease&&h.semver.prerelease.length&&h.semver.major===f.major&&h.semver.minor===f.minor&&h.semver.patch===f.patch)f=!1}if(h.operator==="<"||h.operator==="<="){if(u=ta(s,h,r),u===h&&u!==s)return!1}else if(s.operator==="<="&&!h.test(s.semver))return!1}if(!h.operator&&(s||i)&&o!==0)return!1}if(i&&a&&!s&&o!==0)return!1;if(s&&l&&!i&&o!==0)return!1;if(g||f)return!1;return!0},ea=(e,t,r)=>{if(!e)return t;let n=sn(e.semver,t.semver,r);return n>0?e:n<0?t:t.operator===">"&&e.operator===">="?t:e},ta=(e,t,r)=>{if(!e)return t;let n=sn(e.semver,t.semver,r);return n<0?e:n>0?t:t.operator==="<"&&e.operator==="<="?t:e};ra.exports=ad});var Dt=p(function(OS,ia){var xe=Re(),Ft=Ce(),ld=P(),Kt=Hr(),fd=ne(),hd=Cs(),pd=xs(),dd=ks(),gd=Ps(),md=qs(),yd=Fs(),Ed=Ds(),wd=Bs(),Sd=U(),bd=Ms(),vd=zs(),Td=_t(),Ad=Zs(),Id=eo(),Cd=ze(),Rd=Ot(),xd=Vr(),_d=Xr(),Od=kt(),kd=$t(),$d=Yr(),Ld=uo(),Pd=ho(),Nd=Xe(),qd=B(),jd=Ze(),Fd=_o(),Kd=ko(),Dd=Lo(),Ud=qo(),Bd=Fo(),Jd=jt(),Gd=Go(),Wd=Mo(),Md=Vo(),Hd=Yo(),zd=na();ia.exports={parse:fd,valid:hd,clean:pd,inc:dd,diff:gd,major:md,minor:yd,patch:Ed,prerelease:wd,compare:Sd,rcompare:bd,compareLoose:vd,compareBuild:Td,sort:Ad,rsort:Id,gt:Cd,lt:Rd,eq:xd,neq:_d,gte:Od,lte:kd,cmp:$d,coerce:Ld,truncate:Pd,Comparator:Nd,Range:qd,satisfies:jd,toComparators:Fd,maxSatisfying:Kd,minSatisfying:Dd,minVersion:Ud,validRange:Bd,outside:Jd,gtr:Gd,ltr:Wd,intersects:Md,simplifyRange:Hd,subset:zd,SemVer:ld,re:xe.re,src:xe.src,tokens:xe.t,SEMVER_SPEC_VERSION:Ft.SEMVER_SPEC_VERSION,RELEASE_TYPES:Ft.RELEASE_TYPES,compareIdentifiers:Kt.compareIdentifiers,rcompareIdentifiers:Kt.rcompareIdentifiers}});var aa=p(function(kS,oa){var sa=Dt();oa.exports=sa.satisfies(process.version,">=15.7.0")});var la=p(function($S,ua){var ca=Dt();ua.exports=ca.satisfies(process.version,">=16.9.0")});var on=p(function(LS,fa){var Vd=aa(),Xd=la(),Yd={ec:["ES256","ES384","ES512"],rsa:["RS256","PS256","RS384","PS384","RS512","PS512"],"rsa-pss":["PS256","PS384","PS512"]},Zd={ES256:"prime256v1",ES384:"secp384r1",ES512:"secp521r1"};fa.exports=function(e,t){if(!e||!t)return;let r=t.asymmetricKeyType;if(!r)return;let n=Yd[r];if(!n)throw Error(`Unknown key type "${r}".`);if(!n.includes(e))throw Error(`"alg" parameter for "${r}" key type must be one of: ${n.join(", ")}.`);if(Vd)switch(r){case"ec":let i=t.asymmetricKeyDetails.namedCurve,s=Zd[e];if(i!==s)throw Error(`"alg" parameter "${e}" requires curve "${s}".`);break;case"rsa-pss":if(Xd){let o=parseInt(e.slice(-3),10),{hashAlgorithm:c,mgf1HashAlgorithm:u,saltLength:a}=t.asymmetricKeyDetails;if(c!==`sha${o}`||u!==c)throw Error(`Invalid key for this operation, its RSA-PSS parameters do not meet the requirements of "alg" ${e}.`);if(a!==void 0&&a>o>>3)throw Error(`Invalid key for this operation, its RSA-PSS parameter saltLength does not meet the requirements of "alg" ${e}.`)}break}}});var an=p(function(PS,ha){var Qd=Dt();ha.exports=Qd.satisfies(process.version,"^6.12.0 || >=8.0.0")});var ma=p(function(NS,ga){var I=Me(),eg=Ur(),pa=Br(),tg=Dr(),rg=Gr(),ng=on(),ig=an(),da=wt(),{KeyObject:sg,createSecretKey:og,createPublicKey:ag}=require("crypto"),cn=["RS256","RS384","RS512"],cg=["ES256","ES384","ES512"],un=["RS256","RS384","RS512"],ug=["HS256","HS384","HS512"];if(ig)cn.splice(cn.length,0,"PS256","PS384","PS512"),un.splice(un.length,0,"PS256","PS384","PS512");ga.exports=function(e,t,r,n){if(typeof r==="function"&&!n)n=r,r={};if(!r)r={};r=Object.assign({},r);let i;if(n)i=n;else i=function(l,f){if(l)throw l;return f};if(r.clockTimestamp&&typeof r.clockTimestamp!=="number")return i(new I("clockTimestamp must be a number"));if(r.nonce!==void 0&&(typeof r.nonce!=="string"||r.nonce.trim()===""))return i(new I("nonce must be a non-empty string"));if(r.allowInvalidAsymmetricKeyTypes!==void 0&&typeof r.allowInvalidAsymmetricKeyTypes!=="boolean")return i(new I("allowInvalidAsymmetricKeyTypes must be a boolean"));let s=r.clockTimestamp||Math.floor(Date.now()/1000);if(!e)return i(new I("jwt must be provided"));if(typeof e!=="string")return i(new I("jwt must be a string"));let o=e.split(".");if(o.length!==3)return i(new I("jwt malformed"));let c;try{c=tg(e,{complete:!0})}catch(l){return i(l)}if(!c)return i(new I("invalid token"));let u=c.header,a;if(typeof t==="function"){if(!n)return i(new I("verify must be called asynchronous if secret or public key is provided as a callback"));a=t}else a=function(l,f){return f(null,t)};return a(u,function(l,f){if(l)return i(new I("error in secret or public key callback: "+l.message));let g=o[2].trim()!=="";if(!g&&f)return i(new I("jwt signature is required"));if(g&&!f)return i(new I("secret or public key must be provided"));if(!g&&!r.algorithms)return i(new I('please specify "none" in "algorithms" to verify unsigned tokens'));if(f!=null&&!(f instanceof sg))try{f=ag(f)}catch(d){try{f=og(typeof f==="string"?Buffer.from(f):f)}catch(b){return i(new I("secretOrPublicKey is not valid key material"))}}if(!r.algorithms)if(f.type==="secret")r.algorithms=ug;else if(["rsa","rsa-pss"].includes(f.asymmetricKeyType))r.algorithms=un;else if(f.asymmetricKeyType==="ec")r.algorithms=cg;else r.algorithms=cn;if(r.algorithms.indexOf(c.header.alg)===-1)return i(new I("invalid algorithm"));if(u.alg.startsWith("HS")&&f.type!=="secret")return i(new I(`secretOrPublicKey must be a symmetric key when using ${u.alg}`));else if(/^(?:RS|PS|ES)/.test(u.alg)&&f.type!=="public")return i(new I(`secretOrPublicKey must be an asymmetric key when using ${u.alg}`));if(!r.allowInvalidAsymmetricKeyTypes)try{ng(u.alg,f)}catch(d){return i(d)}let h;try{h=da.verify(e,c.header.alg,f)}catch(d){return i(d)}if(!h)return i(new I("invalid signature"));let m=c.payload;if(typeof m.nbf<"u"&&!r.ignoreNotBefore){if(typeof m.nbf!=="number")return i(new I("invalid nbf value"));if(m.nbf>s+(r.clockTolerance||0))return i(new eg("jwt not active",new Date(m.nbf*1000)))}if(typeof m.exp<"u"&&!r.ignoreExpiration){if(typeof m.exp!=="number")return i(new I("invalid exp value"));if(s>=m.exp+(r.clockTolerance||0))return i(new pa("jwt expired",new Date(m.exp*1000)))}if(r.audience){let d=Array.isArray(r.audience)?r.audience:[r.audience];if(!(Array.isArray(m.aud)?m.aud:[m.aud]).some(function(S){return d.some(function(A){return A instanceof RegExp?A.test(S):A===S})}))return i(new I("jwt audience invalid. expected: "+d.join(" or ")))}if(r.issuer){if(typeof r.issuer==="string"&&m.iss!==r.issuer||Array.isArray(r.issuer)&&r.issuer.indexOf(m.iss)===-1)return i(new I("jwt issuer invalid. expected: "+r.issuer))}if(r.subject){if(m.sub!==r.subject)return i(new I("jwt subject invalid. expected: "+r.subject))}if(r.jwtid){if(m.jti!==r.jwtid)return i(new I("jwt jwtid invalid. expected: "+r.jwtid))}if(r.nonce){if(m.nonce!==r.nonce)return i(new I("jwt nonce invalid. expected: "+r.nonce))}if(r.maxAge){if(typeof m.iat!=="number")return i(new I("iat required when maxAge is specified"));let d=rg(r.maxAge,m.iat);if(typeof d>"u")return i(new I('"maxAge" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'));if(s>=d+(r.clockTolerance||0))return i(new pa("maxAge exceeded",new Date(d*1000)))}if(r.complete===!0){let d=c.signature;return i(null,{header:u,payload:m,signature:d})}return i(null,m)})}});var va=p(function(qS,ba){var ya=1/0,wa=9007199254740991,lg=179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000,Ea=NaN,fg="[object Arguments]",hg="[object Function]",pg="[object GeneratorFunction]",dg="[object String]",gg="[object Symbol]",mg=/^\s+|\s+$/g,yg=/^[-+]0x[0-9a-f]+$/i,Eg=/^0b[01]+$/i,wg=/^0o[0-7]+$/i,Sg=/^(?:0|[1-9]\d*)$/,bg=parseInt;function vg(e,t){var r=-1,n=e?e.length:0,i=Array(n);while(++r<n)i[r]=t(e[r],r,e);return i}function Tg(e,t,r,n){var i=e.length,s=r+(n?1:-1);while(n?s--:++s<i)if(t(e[s],s,e))return s;return-1}function Ag(e,t,r){if(t!==t)return Tg(e,Ig,r);var n=r-1,i=e.length;while(++n<i)if(e[n]===t)return n;return-1}function Ig(e){return e!==e}function Cg(e,t){var r=-1,n=Array(e);while(++r<e)n[r]=t(r);return n}function Rg(e,t){return vg(t,function(r){return e[r]})}function xg(e,t){return function(r){return e(t(r))}}var Ut=Object.prototype,{hasOwnProperty:fn,toString:Bt,propertyIsEnumerable:_g}=Ut,Og=xg(Object.keys,Object),kg=Math.max;function $g(e,t){var r=Sa(e)||jg(e)?Cg(e.length,String):[],n=r.length,i=!!n;for(var s in e)if((t||fn.call(e,s))&&!(i&&(s=="length"||Pg(s,n))))r.push(s);return r}function Lg(e){if(!Ng(e))return Og(e);var t=[];for(var r in Object(e))if(fn.call(e,r)&&r!="constructor")t.push(r);return t}function Pg(e,t){return t=t==null?wa:t,!!t&&(typeof e=="number"||Sg.test(e))&&(e>-1&&e%1==0&&e<t)}function Ng(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||Ut;return e===r}function qg(e,t,r,n){e=hn(e)?e:Hg(e),r=r&&!n?Gg(r):0;var i=e.length;if(r<0)r=kg(i+r,0);return Ug(e)?r<=i&&e.indexOf(t,r)>-1:!!i&&Ag(e,t,r)>-1}function jg(e){return Fg(e)&&fn.call(e,"callee")&&(!_g.call(e,"callee")||Bt.call(e)==fg)}var Sa=Array.isArray;function hn(e){return e!=null&&Dg(e.length)&&!Kg(e)}function Fg(e){return pn(e)&&hn(e)}function Kg(e){var t=ln(e)?Bt.call(e):"";return t==hg||t==pg}function Dg(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=wa}function ln(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function pn(e){return!!e&&typeof e=="object"}function Ug(e){return typeof e=="string"||!Sa(e)&&pn(e)&&Bt.call(e)==dg}function Bg(e){return typeof e=="symbol"||pn(e)&&Bt.call(e)==gg}function Jg(e){if(!e)return e===0?e:0;if(e=Wg(e),e===ya||e===-ya){var t=e<0?-1:1;return t*lg}return e===e?e:0}function Gg(e){var t=Jg(e),r=t%1;return t===t?r?t-r:t:0}function Wg(e){if(typeof e=="number")return e;if(Bg(e))return Ea;if(ln(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=ln(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(mg,"");var r=Eg.test(e);return r||wg.test(e)?bg(e.slice(2),r?2:8):yg.test(e)?Ea:+e}function Mg(e){return hn(e)?$g(e):Lg(e)}function Hg(e){return e?Rg(e,Mg(e)):[]}ba.exports=qg});var Aa=p(function(jS,Ta){var zg="[object Boolean]",Vg=Object.prototype,Xg=Vg.toString;function Yg(e){return e===!0||e===!1||Zg(e)&&Xg.call(e)==zg}function Zg(e){return!!e&&typeof e=="object"}Ta.exports=Yg});var _a=p(function(FS,xa){var Ia=1/0,Qg=179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000,Ca=NaN,em="[object Symbol]",tm=/^\s+|\s+$/g,rm=/^[-+]0x[0-9a-f]+$/i,nm=/^0b[01]+$/i,im=/^0o[0-7]+$/i,sm=parseInt,om=Object.prototype,am=om.toString;function cm(e){return typeof e=="number"&&e==hm(e)}function Ra(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function um(e){return!!e&&typeof e=="object"}function lm(e){return typeof e=="symbol"||um(e)&&am.call(e)==em}function fm(e){if(!e)return e===0?e:0;if(e=pm(e),e===Ia||e===-Ia){var t=e<0?-1:1;return t*Qg}return e===e?e:0}function hm(e){var t=fm(e),r=t%1;return t===t?r?t-r:t:0}function pm(e){if(typeof e=="number")return e;if(lm(e))return Ca;if(Ra(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Ra(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(tm,"");var r=nm.test(e);return r||im.test(e)?sm(e.slice(2),r?2:8):rm.test(e)?Ca:+e}xa.exports=cm});var ka=p(function(KS,Oa){var dm="[object Number]",gm=Object.prototype,mm=gm.toString;function ym(e){return!!e&&typeof e=="object"}function Em(e){return typeof e=="number"||ym(e)&&mm.call(e)==dm}Oa.exports=Em});var Na=p(function(DS,Pa){var wm="[object Object]";function Sm(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch(r){}return t}function bm(e,t){return function(r){return e(t(r))}}var vm=Function.prototype,$a=Object.prototype,La=vm.toString,Tm=$a.hasOwnProperty,Am=La.call(Object),Im=$a.toString,Cm=bm(Object.getPrototypeOf,Object);function Rm(e){return!!e&&typeof e=="object"}function xm(e){if(!Rm(e)||Im.call(e)!=wm||Sm(e))return!1;var t=Cm(e);if(t===null)return!0;var r=Tm.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&La.call(r)==Am}Pa.exports=xm});var ja=p(function(US,qa){var _m="[object String]",Om=Object.prototype,km=Om.toString,$m=Array.isArray;function Lm(e){return!!e&&typeof e=="object"}function Pm(e){return typeof e=="string"||!$m(e)&&Lm(e)&&km.call(e)==_m}qa.exports=Pm});var Ba=p(function(BS,Ua){var Nm="Expected a function",Fa=1/0,qm=179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000,Ka=NaN,jm="[object Symbol]",Fm=/^\s+|\s+$/g,Km=/^[-+]0x[0-9a-f]+$/i,Dm=/^0b[01]+$/i,Um=/^0o[0-7]+$/i,Bm=parseInt,Jm=Object.prototype,Gm=Jm.toString;function Wm(e,t){var r;if(typeof t!="function")throw TypeError(Nm);return e=Xm(e),function(){if(--e>0)r=t.apply(this,arguments);if(e<=1)t=void 0;return r}}function Mm(e){return Wm(2,e)}function Da(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function Hm(e){return!!e&&typeof e=="object"}function zm(e){return typeof e=="symbol"||Hm(e)&&Gm.call(e)==jm}function Vm(e){if(!e)return e===0?e:0;if(e=Ym(e),e===Fa||e===-Fa){var t=e<0?-1:1;return t*qm}return e===e?e:0}function Xm(e){var t=Vm(e),r=t%1;return t===t?r?t-r:t:0}function Ym(e){if(typeof e=="number")return e;if(zm(e))return Ka;if(Da(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Da(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(Fm,"");var r=Dm.test(e);return r||Um.test(e)?Bm(e.slice(2),r?2:8):Km.test(e)?Ka:+e}Ua.exports=Mm});var Ya=p(function(JS,Xa){var Ja=Gr(),Zm=an(),Qm=on(),Gt=wt(),Ma=va(),Jt=Aa(),Ga=_a(),dn=ka(),Ha=Na(),ie=ja(),ey=Ba(),{KeyObject:ty,createSecretKey:ry,createPrivateKey:ny}=require("crypto"),za=["RS256","RS384","RS512","ES256","ES384","ES512","HS256","HS384","HS512","none"];if(Zm)za.splice(3,0,"PS256","PS384","PS512");var iy={expiresIn:{isValid:function(e){return Ga(e)||ie(e)&&e},message:'"expiresIn" should be a number of seconds or string representing a timespan'},notBefore:{isValid:function(e){return Ga(e)||ie(e)&&e},message:'"notBefore" should be a number of seconds or string representing a timespan'},audience:{isValid:function(e){return ie(e)||Array.isArray(e)},message:'"audience" must be a string or array'},algorithm:{isValid:Ma.bind(null,za),message:'"algorithm" must be a valid string enum value'},header:{isValid:Ha,message:'"header" must be an object'},encoding:{isValid:ie,message:'"encoding" must be a string'},issuer:{isValid:ie,message:'"issuer" must be a string'},subject:{isValid:ie,message:'"subject" must be a string'},jwtid:{isValid:ie,message:'"jwtid" must be a string'},noTimestamp:{isValid:Jt,message:'"noTimestamp" must be a boolean'},keyid:{isValid:ie,message:'"keyid" must be a string'},mutatePayload:{isValid:Jt,message:'"mutatePayload" must be a boolean'},allowInsecureKeySizes:{isValid:Jt,message:'"allowInsecureKeySizes" must be a boolean'},allowInvalidAsymmetricKeyTypes:{isValid:Jt,message:'"allowInvalidAsymmetricKeyTypes" must be a boolean'}},sy={iat:{isValid:dn,message:'"iat" should be a number of seconds'},exp:{isValid:dn,message:'"exp" should be a number of seconds'},nbf:{isValid:dn,message:'"nbf" should be a number of seconds'}};function Va(e,t,r,n){if(!Ha(r))throw Error('Expected "'+n+'" to be a plain object.');Object.keys(r).forEach(function(i){let s=e[i];if(!s){if(!t)throw Error('"'+i+'" is not allowed in "'+n+'"');return}if(!s.isValid(r[i]))throw Error(s.message)})}function oy(e){return Va(iy,!1,e,"options")}function ay(e){return Va(sy,!0,e,"payload")}var Wa={audience:"aud",issuer:"iss",subject:"sub",jwtid:"jti"},cy=["expiresIn","notBefore","noTimestamp","audience","issuer","subject","jwtid"];Xa.exports=function(e,t,r,n){if(typeof r==="function")n=r,r={};else r=r||{};let i=typeof e==="object"&&!Buffer.isBuffer(e),s=Object.assign({alg:r.algorithm||"HS256",typ:i?"JWT":void 0,kid:r.keyid},r.header);function o(a){if(n)return n(a);throw a}if(!t&&r.algorithm!=="none")return o(Error("secretOrPrivateKey must have a value"));if(t!=null&&!(t instanceof ty))try{t=ny(t)}catch(a){try{t=ry(typeof t==="string"?Buffer.from(t):t)}catch(l){return o(Error("secretOrPrivateKey is not valid key material"))}}if(s.alg.startsWith("HS")&&t.type!=="secret")return o(Error(`secretOrPrivateKey must be a symmetric key when using ${s.alg}`));else if(/^(?:RS|PS|ES)/.test(s.alg)){if(t.type!=="private")return o(Error(`secretOrPrivateKey must be an asymmetric key when using ${s.alg}`));if(!r.allowInsecureKeySizes&&!s.alg.startsWith("ES")&&t.asymmetricKeyDetails!==void 0&&t.asymmetricKeyDetails.modulusLength<2048)return o(Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${s.alg}`))}if(typeof e>"u")return o(Error("payload is required"));else if(i){try{ay(e)}catch(a){return o(a)}if(!r.mutatePayload)e=Object.assign({},e)}else{let a=cy.filter(function(l){return typeof r[l]<"u"});if(a.length>0)return o(Error("invalid "+a.join(",")+" option for "+typeof e+" payload"))}if(typeof e.exp<"u"&&typeof r.expiresIn<"u")return o(Error('Bad "options.expiresIn" option the payload already has an "exp" property.'));if(typeof e.nbf<"u"&&typeof r.notBefore<"u")return o(Error('Bad "options.notBefore" option the payload already has an "nbf" property.'));try{oy(r)}catch(a){return o(a)}if(!r.allowInvalidAsymmetricKeyTypes)try{Qm(s.alg,t)}catch(a){return o(a)}let c=e.iat||Math.floor(Date.now()/1000);if(r.noTimestamp)delete e.iat;else if(i)e.iat=c;if(typeof r.notBefore<"u"){try{e.nbf=Ja(r.notBefore,c)}catch(a){return o(a)}if(typeof e.nbf>"u")return o(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=Ja(r.expiresIn,c)}catch(a){return o(a)}if(typeof e.exp>"u")return o(Error('"expiresIn" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}Object.keys(Wa).forEach(function(a){let l=Wa[a];if(typeof r[a]<"u"){if(typeof e[l]<"u")return o(Error('Bad "options.'+a+'" option. The payload already has an "'+l+'" property.'));e[l]=r[a]}});let u=r.encoding||"utf8";if(typeof n==="function")n=n&&ey(n),Gt.createSign({header:s,privateKey:t,payload:e,encoding:u}).once("error",n).once("done",function(a){if(!r.allowInsecureKeySizes&&/^(?:RS|PS)/.test(s.alg)&&a.length<256)return n(Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${s.alg}`));n(null,a)});else{let a=Gt.sign({header:s,payload:e,secret:t,encoding:u});if(!r.allowInsecureKeySizes&&/^(?:RS|PS)/.test(s.alg)&&a.length<256)throw Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${s.alg}`);return a}}});var Qa=p(function(GS,Za){Za.exports={decode:Dr(),verify:ma(),sign:Ya(),JsonWebTokenError:Me(),NotBeforeError:Ur(),TokenExpiredError:Br()}});var gn=p(function(WS,ec){function uy(e){r.debug=r,r.default=r,r.coerce=u,r.disable=o,r.enable=i,r.enabled=c,r.humanize=Jr(),r.destroy=a,Object.keys(e).forEach((l)=>{r[l]=e[l]}),r.names=[],r.skips=[],r.formatters={};function t(l){let f=0;for(let g=0;g<l.length;g++)f=(f<<5)-f+l.charCodeAt(g),f|=0;return r.colors[Math.abs(f)%r.colors.length]}r.selectColor=t;function r(l){let f,g=null,h,m;function d(...b){if(!d.enabled)return;let w=d,S=Number(new Date),A=S-(f||S);if(w.diff=A,w.prev=f,w.curr=S,f=S,b[0]=r.coerce(b[0]),typeof b[0]!=="string")b.unshift("%O");let T=0;b[0]=b[0].replace(/%([a-zA-Z%])/g,(K,W)=>{if(K==="%%")return"%";T++;let z=r.formatters[W];if(typeof z==="function"){let V=b[T];K=z.call(w,V),b.splice(T,1),T--}return K}),r.formatArgs.call(w,b),(w.log||r.log).apply(w,b)}if(d.namespace=l,d.useColors=r.useColors(),d.color=r.selectColor(l),d.extend=n,d.destroy=r.destroy,Object.defineProperty(d,"enabled",{enumerable:!0,configurable:!1,get:()=>{if(g!==null)return g;if(h!==r.namespaces)h=r.namespaces,m=r.enabled(l);return m},set:(b)=>{g=b}}),typeof r.init==="function")r.init(d);return d}function n(l,f){let g=r(this.namespace+(typeof f>"u"?":":f)+l);return g.log=this.log,g}function i(l){r.save(l),r.namespaces=l,r.names=[],r.skips=[];let f=(typeof l==="string"?l:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let g of f)if(g[0]==="-")r.skips.push(g.slice(1));else r.names.push(g)}function s(l,f){let g=0,h=0,m=-1,d=0;while(g<l.length)if(h<f.length&&(f[h]===l[g]||f[h]==="*"))if(f[h]==="*")m=h,d=g,h++;else g++,h++;else if(m!==-1)h=m+1,d++,g=d;else return!1;while(h<f.length&&f[h]==="*")h++;return h===f.length}function o(){let l=[...r.names,...r.skips.map((f)=>"-"+f)].join(",");return r.enable(""),l}function c(l){for(let f of r.skips)if(s(l,f))return!1;for(let f of r.names)if(s(l,f))return!0;return!1}function u(l){if(l instanceof Error)return l.stack||l.message;return l}function a(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}ec.exports=uy});var tc=p(function(F,Wt){F.formatArgs=fy;F.save=hy;F.load=py;F.useColors=ly;F.storage=dy();F.destroy=(()=>{let e=!1;return()=>{if(!e)e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}})();F.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function ly(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function fy(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+Wt.exports.humanize(this.diff),!this.useColors)return;let t="color: "+this.color;e.splice(1,0,t,"color: inherit");let r=0,n=0;e[0].replace(/%[a-zA-Z%]/g,(i)=>{if(i==="%%")return;if(r++,i==="%c")n=r}),e.splice(n,0,t)}F.log=console.debug||console.log||(()=>{});function hy(e){try{if(e)F.storage.setItem("debug",e);else F.storage.removeItem("debug")}catch(t){}}function py(){let e;try{e=F.storage.getItem("debug")||F.storage.getItem("DEBUG")}catch(t){}if(!e&&typeof process<"u"&&"env"in process)e=process.env.DEBUG;return e}function dy(){try{return localStorage}catch(e){}}Wt.exports=gn()(F);var{formatters:gy}=Wt.exports;gy.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}});var nc=p(function(MS,rc){rc.exports=(e,t=process.argv)=>{let r=e.startsWith("-")?"":e.length===1?"-":"--",n=t.indexOf(r+e),i=t.indexOf("--");return n!==-1&&(i===-1||n<i)}});var oc=p(function(HS,sc){var ic=require("os"),Mt=require("tty"),J=nc(),{env:k}=process,se;if(J("no-color")||J("no-colors")||J("color=false")||J("color=never"))se=0;else if(J("color")||J("colors")||J("color=true")||J("color=always"))se=1;if("FORCE_COLOR"in k)if(k.FORCE_COLOR==="true")se=1;else if(k.FORCE_COLOR==="false")se=0;else se=k.FORCE_COLOR.length===0?1:Math.min(parseInt(k.FORCE_COLOR,10),3);function mn(e){if(e===0)return!1;return{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function yn(e,t){if(se===0)return 0;if(J("color=16m")||J("color=full")||J("color=truecolor"))return 3;if(J("color=256"))return 2;if(e&&!t&&se===void 0)return 0;let r=se||0;if(k.TERM==="dumb")return r;if(process.platform==="win32"){let n=ic.release().split(".");if(Number(n[0])>=10&&Number(n[2])>=10586)return Number(n[2])>=14931?3:2;return 1}if("CI"in k){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some((n)=>(n in k))||k.CI_NAME==="codeship")return 1;return r}if("TEAMCITY_VERSION"in k)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(k.TEAMCITY_VERSION)?1:0;if(k.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in k){let n=parseInt((k.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(k.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(k.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(k.TERM))return 1;if("COLORTERM"in k)return 1;return r}function my(e){let t=yn(e,e&&e.isTTY);return mn(t)}sc.exports={supportsColor:my,stdout:mn(yn(!0,Mt.isatty(1))),stderr:mn(yn(!0,Mt.isatty(2)))}});var uc=p(function(L,Ht){var ac=require("tty"),oe=require("util");L.init=Ty;L.log=Sy;L.formatArgs=Ey;L.save=by;L.load=vy;L.useColors=yy;L.destroy=oe.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");L.colors=[6,2,3,4,5,1];try{let e=oc();if(e&&(e.stderr||e).level>=2)L.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221]}catch(e){}L.inspectOpts=Object.keys(process.env).filter((e)=>/^debug_/i.test(e)).reduce((e,t)=>{let r=t.substring(6).toLowerCase().replace(/_([a-z])/g,(i,s)=>s.toUpperCase()),n=process.env[t];if(/^(yes|on|true|enabled)$/i.test(n))n=!0;else if(/^(no|off|false|disabled)$/i.test(n))n=!1;else if(n==="null")n=null;else n=Number(n);return e[r]=n,e},{});function yy(){return"colors"in L.inspectOpts?Boolean(L.inspectOpts.colors):ac.isatty(process.stderr.fd)}function Ey(e){let{namespace:t,useColors:r}=this;if(r){let n=this.color,i="\x1B[3"+(n<8?n:"8;5;"+n),s=` ${i};1m${t} \x1B[0m`;e[0]=s+e[0].split(`
4
4
  `).join(`
5
- `+s),e.push(i+"m+"+Bt.exports.humanize(this.diff)+"\x1B[0m")}else e[0]=gy()+t+" "+e[0]}function gy(){if(P.inspectOpts.hideDate)return"";return new Date().toISOString()+" "}function my(...e){return process.stderr.write(Dt.formatWithOptions(P.inspectOpts,...e)+`
6
- `)}function yy(e){if(e)process.env.DEBUG=e;else delete process.env.DEBUG}function Ey(){return process.env.DEBUG}function Sy(e){e.inspectOpts={};let t=Object.keys(P.inspectOpts);for(let r=0;r<t.length;r++)e.inspectOpts[t[r]]=P.inspectOpts[t[r]]}Bt.exports=fn()(P);var{formatters:rc}=Bt.exports;rc.o=function(e){return this.inspectOpts.colors=this.useColors,Dt.inspect(e,this.inspectOpts).split(`
7
- `).map((t)=>t.trim()).join(" ")};rc.O=function(e){return this.inspectOpts.colors=this.useColors,Dt.inspect(e,this.inspectOpts)}});var Ut=d(function(Zw,pn){if(typeof process>"u"||process.type==="renderer"||!1||process.__nwjs)pn.exports=Za();else pn.exports=nc()});var gn,Gt;var Jt=O(()=>{gn=new TextDecoder,Gt=new TextDecoder("utf-8",{fatal:!0})});function wy(e,t,...r){if(r.length>2){let n=r.pop();e+=`one of type ${r.join(", ")}, or ${n}.`}else r.length===2?e+=`one of type ${r[0]} or ${r[1]}.`:e+=`of type ${r[0]}.`;return t==null?e+=` Received ${t}`:typeof t=="function"&&t.name?e+=` Received function ${t.name}`:typeof t=="object"&&t!=null&&t.constructor?.name&&(e+=` Received an instance of ${t.constructor.name}`),e}var ic=(e,...t)=>wy("Key must be ",e,...t);var sc=()=>{};var mn,Z,Q;var Ie=O(()=>{mn=class mn extends Error{static code="ERR_JOSE_GENERIC";code="ERR_JOSE_GENERIC";constructor(e,t){super(e,t),this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}};Z=class Z extends mn{static code="ERR_JOSE_NOT_SUPPORTED";code="ERR_JOSE_NOT_SUPPORTED"};Q=class Q extends mn{static code="ERR_JWT_INVALID";code="ERR_JWT_INVALID"}});var oc=(e)=>{if(e?.[Symbol.toStringTag]==="CryptoKey")return!0;try{return e instanceof CryptoKey}catch{return!1}},ac=(e)=>e?.[Symbol.toStringTag]==="KeyObject";var cc=()=>{};function yn(e){if(Uint8Array.prototype.toBase64)return e.toBase64();let t=32768,r=[];for(let n=0;n<e.length;n+=t)r.push(String.fromCharCode.apply(null,e.subarray(n,n+t)));return btoa(r.join(""))}function En(e){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(e);let t=atob(e),r=new Uint8Array(t.length);for(let n=0;n<t.length;n++)r[n]=t.charCodeAt(n);return r}var Sn=()=>{};function Ce(e){if(Uint8Array.fromBase64)try{return Uint8Array.fromBase64(typeof e=="string"?e:gn.decode(e),{alphabet:"base64url"})}catch(r){throw TypeError(wn,{cause:r})}let t=e;if(t instanceof Uint8Array&&(t=gn.decode(t)),t.includes("+")||t.includes("/"))throw TypeError(wn);t=t.replace(/-/g,"+").replace(/_/g,"/");try{return En(t)}catch{throw TypeError(wn)}}var wn="The input to be decoded is not correctly encoded.";var Mt=O(()=>{Jt();Sn()});function xe(e){if(typeof e!="object"||e===null||Object.prototype.toString.call(e)!=="[object Object]")return!1;let t=Object.getPrototypeOf(e);return t===null||Object.getPrototypeOf(t)===null}var Wt=()=>{};function uc(e,t,r){let n;try{n=JSON.parse(Gt.decode(Ce(e)))}catch{throw new t(r)}if(!xe(n))throw new t(r);return n}var lc=O(()=>{Mt();Jt();Wt()});async function bn(e,t){if(!e.kty.includes(t.kty))throw new Z('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');let r=e.resolve?.({kty:t.kty,crv:t.crv})??e.subtle,n=!!(t.d||t.priv),i={...t};return i.kty!=="AKP"&&delete i.alg,delete i.use,crypto.subtle.importKey("jwk",i,r,t.ext??!n,t.key_ops??e.usages[n?1:0])}var fc=O(()=>{Ie()});function by(e){return{__proto__:null,...e}}function hc(e){let t=by(e);if(t.ext!==void 0&&typeof t.ext!="boolean")throw TypeError('"ext" (Extractable) Parameter must be a boolean');if(t.key_ops!==void 0){let r=t.key_ops,n=Array.isArray(r)?[...r]:void 0;if(!n||n.some((i)=>typeof i!="string")||new Set(n).size!==n.length)throw TypeError('"key_ops" (Key Operations) Parameter must be an array of unique strings');t.key_ops=n}return t}var dc=()=>{};function Ye(e){let t={__proto__:null};for(let r in e)t[r]={...e[r],alg:r};return t}var vn=()=>{};function Ht(e){return{kty:["RSA"],mode:"key-encryption",subtle:{name:"RSA-OAEP",hash:`SHA-${e}`},usages:vy,ops:["wrapKey","unwrapKey"]}}function zt(e){return{kty:["EC","OKP"],mode:e,subtle:{name:"ECDH"},resolve:({kty:t,crv:r,asymmetricKeyType:n})=>{if(r==="X25519"||n==="x25519")return{name:"X25519"};if(t==="OKP")throw new Z('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');return{name:"ECDH",namedCurve:r}},usages:Ty,ops:[void 0,"deriveBits"]}}function _e(e,t=!1){return{kty:["oct"],mode:"key-wrapping",secret:!0,subtle:{name:t?"AES-GCM":"AES-KW",length:e},usages:Vt,ops:t?["encrypt","decrypt"]:["wrapKey","unwrapKey"]}}function Tn(){return{kty:["oct"],mode:"key-wrapping",secret:!0,subtle:{name:"PBKDF2"},usages:Vt,ops:["deriveBits","deriveBits"]}}function Oe(e,t=!1){return{kty:["oct"],secret:!0,subtle:{name:t?"AES-CBC":"AES-GCM",length:e},usages:Vt,ops:Ay,cekBits:e,ivBits:t?128:96,cbc:t}}var vy,Ty,Vt,pc,Ay,wb;var gc=O(()=>{Ie();vn();vy=[["encrypt","wrapKey"],["decrypt","unwrapKey"]],Ty=[[],["deriveBits"]],Vt=[[],[]];pc=Ye({dir:{kty:["oct"],mode:"direct-encryption",secret:!0,subtle:{name:"AES-GCM"},usages:Vt,ops:["encrypt","decrypt"]},"RSA-OAEP":Ht(1),"RSA-OAEP-256":Ht(256),"RSA-OAEP-384":Ht(384),"RSA-OAEP-512":Ht(512),"ECDH-ES":zt("direct-key-agreement"),"ECDH-ES+A128KW":zt("key-agreement-with-key-wrapping"),"ECDH-ES+A192KW":zt("key-agreement-with-key-wrapping"),"ECDH-ES+A256KW":zt("key-agreement-with-key-wrapping"),A128KW:_e(128),A192KW:_e(192),A256KW:_e(256),A128GCMKW:_e(128,!0),A192GCMKW:_e(192,!0),A256GCMKW:_e(256,!0),"PBES2-HS256+A128KW":Tn(),"PBES2-HS384+A192KW":Tn(),"PBES2-HS512+A256KW":Tn()}),Ay=["encrypt","decrypt"];wb=Ye({A128GCM:Oe(128),A192GCM:Oe(192),A256GCM:Oe(256),"A128CBC-HS256":Oe(256,!0),"A192CBC-HS384":Oe(384,!0),"A256CBC-HS512":Oe(512,!0)})});function An(e){let t={name:"HMAC",hash:`SHA-${e}`};return{kty:["oct"],secret:!0,subtle:t,signing:t,usages:Ze}}function ke(e,t){let r={name:t?"RSA-PSS":"RSASSA-PKCS1-v1_5",hash:`SHA-${e}`};return{kty:["RSA"],subtle:r,signing:t?{...r,saltLength:t}:r,usages:Ze,minRsaBits:2048}}function Rn(e,t){return{kty:["EC"],crv:e,subtle:{name:"ECDSA",namedCurve:e},signing:{name:"ECDSA",hash:`SHA-${t}`},usages:Ze}}function mc(){let e={name:"Ed25519"};return{kty:["OKP"],crv:"Ed25519",subtle:e,signing:e,usages:Ze}}function In(e){let t={name:`ML-DSA-${e}`};return{kty:["AKP"],subtle:t,signing:t,usages:Ze}}var Ze,yc;var Ec=O(()=>{vn();Ze=[["verify"],["sign"]];yc=Ye({HS256:An(256),HS384:An(384),HS512:An(512),RS256:ke(256),RS384:ke(384),RS512:ke(512),PS256:ke(256,32),PS384:ke(384,48),PS512:ke(512,64),ES256:Rn("P-256",256),ES384:Rn("P-384",384),ES512:Rn("P-521",512),EdDSA:mc(),Ed25519:mc(),"ML-DSA-44":In(44),"ML-DSA-65":In(65),"ML-DSA-87":In(87)})});function Ry(e='JWK "alg" (Algorithm) Parameter'){throw new Z(`Invalid or unsupported ${e} value`)}function Cn(e,t){return(typeof e=="string"?yc[e]??pc[e]:void 0)??Ry(t)}var Sc=O(()=>{Ie();Ec();gc()});function wc(e){if(e!==void 0&&typeof e!="boolean")throw TypeError('"extractable" option must be a boolean');return e}var bc=()=>{};var Iy=(e,t)=>{let r=(e.match(/.{1,64}/g)||[]).join(`
5
+ `+s),e.push(i+"m+"+Ht.exports.humanize(this.diff)+"\x1B[0m")}else e[0]=wy()+t+" "+e[0]}function wy(){if(L.inspectOpts.hideDate)return"";return new Date().toISOString()+" "}function Sy(...e){return process.stderr.write(oe.formatWithOptions(L.inspectOpts,...e)+`
6
+ `)}function by(e){if(e)process.env.DEBUG=e;else delete process.env.DEBUG}function vy(){return process.env.DEBUG}function Ty(e){e.inspectOpts={};let t=Object.keys(L.inspectOpts);for(let r=0;r<t.length;r++)e.inspectOpts[t[r]]=L.inspectOpts[t[r]]}Ht.exports=gn()(L);var{formatters:cc}=Ht.exports;cc.o=function(e){return this.inspectOpts.colors=this.useColors,oe.inspect(e,this.inspectOpts).split(`
7
+ `).map((t)=>t.trim()).join(" ")};cc.O=function(e){return this.inspectOpts.colors=this.useColors,oe.inspect(e,this.inspectOpts)}});var zt=p(function(zS,En){if(typeof process>"u"||process.type==="renderer"||!1||process.__nwjs)En.exports=tc();else En.exports=uc()});function wn(e,t=!1){if(Uint8Array.prototype.toBase64)return e.toBase64({alphabet:t?"base64url":"base64",omitPadding:t});let r=32768,n=[];for(let s=0;s<e.length;s+=r)n.push(String.fromCharCode.apply(null,e.subarray(s,s+r)));let i=btoa(n.join(""));return t?i.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_"):i}function Sn(e,t=!1){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(e,{alphabet:t?"base64url":"base64"});if(t){if(e.includes("+")||e.includes("/"))throw TypeError("Invalid base64url");e=e.replace(/-/g,"+").replace(/_/g,"/")}let r=atob(e),n=new Uint8Array(r.length);for(let i=0;i<r.length;i++)n[i]=r.charCodeAt(i);return n}var lc,Vt;var Qe=q(()=>{lc=new TextDecoder,Vt=new TextDecoder("utf-8",{fatal:!0})});var bn,Z,Q;var _e=q(()=>{bn=class bn extends Error{static code="ERR_JOSE_GENERIC";code="ERR_JOSE_GENERIC";constructor(e,t){super(e,t),this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}};Z=class Z extends bn{static code="ERR_JOSE_NOT_SUPPORTED";code="ERR_JOSE_NOT_SUPPORTED"};Q=class Q extends bn{static code="ERR_JWT_INVALID";code="ERR_JWT_INVALID"}});function Oe(e){try{return Sn(typeof e=="string"?e:lc.decode(e),!0)}catch(t){throw TypeError(Ay,{cause:t})}}var Ay="The input to be decoded is not correctly encoded.";var Xt=q(()=>{Qe()});function et(e){if(typeof e!="object"||e===null||Object.prototype.toString.call(e)!=="[object Object]")return!1;let t=Object.getPrototypeOf(e);return t===null||Object.getPrototypeOf(t)===null}function fc(e,t,r){let n;try{n=JSON.parse(Vt.decode(Oe(e)))}catch(i){throw new t(r,{cause:i})}if(!et(n))throw new t(r);return n}var Yt=q(()=>{Xt();Qe()});function Iy(e,t,...r){if(r.length>2){let n=r.pop();e+=`one of type ${r.join(", ")}, or ${n}.`}else r.length===2?e+=`one of type ${r[0]} or ${r[1]}.`:e+=`of type ${r[0]}.`;return t==null?e+=` Received ${t}`:typeof t=="function"&&t.name?e+=` Received function ${t.name}`:typeof t=="object"&&t!=null&&t.constructor?.name&&(e+=` Received an instance of ${t.constructor.name}`),e}function Cy(e){return{__proto__:null,...e}}function gc(e){let t=Cy(e);if(t.ext!==void 0&&typeof t.ext!="boolean")throw TypeError('"ext" (Extractable) Parameter must be a boolean');if(t.key_ops!==void 0){let r=t.key_ops,n=Array.isArray(r)?[...r]:void 0;if(!n||n.some((i)=>typeof i!="string")||new Set(n).size!==n.length)throw TypeError('"key_ops" (Key Operations) Parameter must be an array of unique strings');t.key_ops=n}return t}function vn(e){if(e!==void 0&&typeof e!="boolean")throw TypeError('"extractable" option must be a boolean');return e}async function Tn(e,t,r){if(!e.kty.includes(t.kty))throw new Z('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');let n=e.resolve?.({kty:t.kty,crv:t.crv})??e.subtle,i=!!(t.d||t.priv),s={...t,ext:r??t.ext};return s.kty!=="AKP"&&delete s.alg,delete s.use,crypto.subtle.importKey("jwk",s,n,s.ext??!i,t.key_ops??e.usages[i?1:0])}var hc=(e)=>{if(e?.[Symbol.toStringTag]==="CryptoKey")return!0;try{return e instanceof CryptoKey}catch{return!1}},pc=(e)=>e?.[Symbol.toStringTag]==="KeyObject",dc=(e,...t)=>Iy("Key must be ",e,...t);var An=q(()=>{_e()});function tt(e){let t={__proto__:null};for(let r in e)t[r]={...e[r],alg:r};return t}var In=()=>{};function Zt(e){return{kty:["RSA"],mode:"key-encryption",subtle:{name:"RSA-OAEP",hash:`SHA-${e}`},usages:Ry,ops:["wrapKey","unwrapKey"]}}function Qt(e){return{kty:["EC","OKP"],mode:e,subtle:{name:"ECDH"},resolve:({kty:t,crv:r,asymmetricKeyType:n})=>{if(r==="X25519"||n==="x25519")return{name:"X25519"};if(t==="OKP")throw new Z('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');return{name:"ECDH",namedCurve:r}},usages:xy,ops:[void 0,"deriveBits"]}}function ke(e,t=!1){return{kty:["oct"],mode:"key-wrapping",secret:!0,subtle:{name:t?"AES-GCM":"AES-KW",length:e},usages:er,ops:t?["encrypt","decrypt"]:["wrapKey","unwrapKey"]}}function Cn(){return{kty:["oct"],mode:"key-wrapping",secret:!0,subtle:{name:"PBKDF2"},usages:er,ops:["deriveBits","deriveBits"]}}function $e(e,t=!1){return{kty:["oct"],secret:!0,subtle:{name:t?"AES-CBC":"AES-GCM",length:e},usages:er,ops:_y,cekBits:e,ivBits:t?128:96,cbc:t}}var Ry,xy,er,mc,_y,ub;var yc=q(()=>{_e();In();Ry=[["encrypt","wrapKey"],["decrypt","unwrapKey"]],xy=[[],["deriveBits"]],er=[[],[]];mc=tt({dir:{kty:["oct"],mode:"direct-encryption",secret:!0,subtle:{name:"AES-GCM"},usages:er,ops:["encrypt","decrypt"]},"RSA-OAEP":Zt(1),"RSA-OAEP-256":Zt(256),"RSA-OAEP-384":Zt(384),"RSA-OAEP-512":Zt(512),"ECDH-ES":Qt("direct-key-agreement"),"ECDH-ES+A128KW":Qt("key-agreement-with-key-wrapping"),"ECDH-ES+A192KW":Qt("key-agreement-with-key-wrapping"),"ECDH-ES+A256KW":Qt("key-agreement-with-key-wrapping"),A128KW:ke(128),A192KW:ke(192),A256KW:ke(256),A128GCMKW:ke(128,!0),A192GCMKW:ke(192,!0),A256GCMKW:ke(256,!0),"PBES2-HS256+A128KW":Cn(),"PBES2-HS384+A192KW":Cn(),"PBES2-HS512+A256KW":Cn()}),_y=["encrypt","decrypt"];ub=tt({A128GCM:$e(128),A192GCM:$e(192),A256GCM:$e(256),"A128CBC-HS256":$e(256,!0),"A192CBC-HS384":$e(384,!0),"A256CBC-HS512":$e(512,!0)})});function Rn(e){let t={name:"HMAC",hash:`SHA-${e}`};return{kty:["oct"],secret:!0,subtle:t,signing:t,usages:rt}}function Le(e,t){let r={name:t?"RSA-PSS":"RSASSA-PKCS1-v1_5",hash:`SHA-${e}`};return{kty:["RSA"],subtle:r,signing:t?{...r,saltLength:t}:r,usages:rt,minRsaBits:2048}}function xn(e,t){return{kty:["EC"],crv:e,subtle:{name:"ECDSA",namedCurve:e},signing:{name:"ECDSA",hash:`SHA-${t}`},usages:rt}}function Ec(){let e={name:"Ed25519"};return{kty:["OKP"],crv:"Ed25519",subtle:e,signing:e,usages:rt}}function _n(e){let t={name:`ML-DSA-${e}`};return{kty:["AKP"],subtle:t,signing:t,usages:rt}}var rt,wc;var Sc=q(()=>{In();rt=[["verify"],["sign"]];wc=tt({HS256:Rn(256),HS384:Rn(384),HS512:Rn(512),RS256:Le(256),RS384:Le(384),RS512:Le(512),PS256:Le(256,32),PS384:Le(384,48),PS512:Le(512,64),ES256:xn("P-256",256),ES384:xn("P-384",384),ES512:xn("P-521",512),EdDSA:Ec(),Ed25519:Ec(),"ML-DSA-44":_n(44),"ML-DSA-65":_n(65),"ML-DSA-87":_n(87)})});function Oy(e='JWK "alg" (Algorithm) Parameter'){throw new Z(`Invalid or unsupported ${e} value`)}function On(e,t){return(typeof e=="string"?wc[e]??mc[e]:void 0)??Oy(t)}var bc=q(()=>{_e();Sc();yc()});var ky=(e,t)=>{let r=(e.match(/.{1,64}/g)||[]).join(`
8
8
  `);return`-----BEGIN ${t}-----
9
9
  ${r}
10
- -----END ${t}-----`},Cy=async(e,t,r)=>{if(ac(r)){if(r.type!==e)throw TypeError(`key is not a ${e} key`);return r.export({format:"pem",type:t})}if(!oc(r))throw TypeError(ic(r,"CryptoKey","KeyObject"));if(!r.extractable)throw TypeError("CryptoKey is not extractable");if(r.type!==e)throw TypeError(`key is not a ${e} key`);return Iy(yn(new Uint8Array(await crypto.subtle.exportKey(t,r))),`${e.toUpperCase()} KEY`)},vc=(e)=>Cy("public","spki",e);var Tc=O(()=>{sc();Sn();cc()});function Ac(e){return vc(e)}var Rc=O(()=>{Tc()});async function Ic(e,t,r){if(!xe(e))throw TypeError("JWK must be an object");let n=hc(e),i=wc(r?.extractable),{alg:s}=n;t??=s;let o=i??n.ext;if(n.kty!=="oct"&&!t)throw TypeError('"alg" argument is required when "jwk.alg" is not present');switch(n.kty){case"oct":if(typeof n.k!="string")throw TypeError('missing "k" (Key Value) Parameter value');return Ce(n.k);case"AKP":{if(typeof s!="string"||!s)throw TypeError('missing "alg" (Algorithm) Parameter value');if(t!==s)throw TypeError("JWK alg and alg option value mismatch");return bn(Cn(t),{...n,ext:o})}case"RSA":case"EC":case"OKP":return bn(Cn(t),{...n,alg:t,ext:o});default:throw new Z('Unsupported "kty" (Key Type) Parameter value')}}var Cc=O(()=>{Mt();fc();Sc();Ie();Wt();bc();dc()});function xc(e){let t;if(typeof e=="string"){let n=e.split(".");(n.length===3||n.length===5)&&([t]=n)}else if(typeof e=="object"&&e)if("protected"in e)t=e.protected;else throw TypeError("Token does not contain a Protected Header");let r="Invalid Token or Protected Header formatting";if(typeof t!="string"||!t)throw TypeError(r);return uc(t,TypeError,r)}var _c=O(()=>{lc()});function Oc(e){if(typeof e!="string")throw new Q("JWTs must use Compact JWS serialization, JWT must be a string");let{1:t,length:r}=e.split(".");if(r===5)throw new Q("Only JWTs using Compact JWS serialization can be decoded");if(r!==3)throw new Q("Invalid JWT");if(!t)throw new Q("JWTs must contain a payload");let n;try{n=Ce(t)}catch{throw new Q("Failed to base64url decode the payload")}let i;try{i=JSON.parse(Gt.decode(n))}catch{throw new Q("Failed to parse the decoded payload as JSON")}if(!xe(i))throw new Q("Invalid JWT Claims Set");return i}var kc=O(()=>{Mt();Jt();Wt();Ie()});var xn=O(()=>{Rc();Cc();_c();kc()});var Yt=d(function(av,$c){function Xt(e){Error.call(this,e),Error.captureStackTrace(this,this.constructor),this.name="JwksError",this.message=e}Xt.prototype=Object.create(Error.prototype);Xt.prototype.constructor=Xt;$c.exports=Xt});var _n=d(function(uv,Lc){var cv=(xn(),{}),xy=Yt();function _y(e){if(e.alg)return e.alg;if(e.kty==="RSA")return"RS256";if(e.kty==="EC")switch(e.crv){case"P-256":return"ES256";case"P-384":return"ES384";case"P-521":return"ES512"}if(e.kty==="OKP")switch(e.crv){case"Ed25519":case"Ed448":return"EdDSA"}throw new xy("Unsupported JWK")}async function Oy(e){let t=[];e=e.filter(({use:r})=>r==="sig"||r===void 0).filter(({kty:r})=>r==="RSA"||r==="EC"||r==="OKP");for(let r of e)try{let n=await Ic({...r,ext:!0},_y(r));if(n.type!=="public")continue;let i;switch(n[Symbol.toStringTag]){case"CryptoKey":{let s=await Ac(n);i=()=>s;break}case"KeyObject":default:i=()=>n.export({format:"pem",type:"spki"})}t.push({get publicKey(){return i()},get rsaPublicKey(){return i()},getPublicKey(){return i()},...typeof r.kid==="string"&&r.kid?{kid:r.kid}:void 0,...typeof r.alg==="string"&&r.alg?{alg:r.alg}:void 0})}catch(n){continue}return t}Lc.exports={retrieveSigningKeys:Oy}});var On=d(function(lv,Pc){function Zt(e){Error.call(this,e),Error.captureStackTrace(this,this.constructor),this.name="ArgumentError",this.message=e}Zt.prototype=Object.create(Error.prototype);Zt.prototype.constructor=Zt;Pc.exports=Zt});var qc=d(function(fv,Nc){var ky=require("http"),$y=require("https"),Ly=On();Nc.exports.default=(e)=>{if(e.fetcher)return e.fetcher(e.uri);return new Promise((t,r)=>{let n;try{n=new URL(e.uri)}catch(h){throw new Ly("Invalid JWKS URI: The provided URI is not a valid URL.")}let{hostname:i,port:s,protocol:o,pathname:c,search:u}=n,a=c+u,l={hostname:i,path:a,port:s,method:"GET",...e.headers&&{headers:{...e.headers}},...e.timeout&&{timeout:e.timeout},...e.agent&&{agent:e.agent}},g=(o==="https:"?$y:ky).request(l,(h)=>{let m="";h.setEncoding("utf8"),h.on("data",(p)=>{m+=p}),h.on("end",()=>{if(h.statusCode<200||h.statusCode>=300){let p=h.body&&(h.body.message||h.body)||h.statusMessage||`Http Error ${h.statusCode}`;r({errorMsg:p})}else try{t(m&&JSON.parse(m))}catch(p){r(p)}})});g.on("timeout",()=>g.destroy()).on("error",(h)=>r(h)).end()})}});var tr=d(function(er){var Fc=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Py=Fc((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.tracing=e.metrics=void 0;var t=require("node:diagnostics_channel");e.metrics=(0,t.channel)("lru-cache:metrics"),e.tracing=(0,t.tracingChannel)("lru-cache")}),Ny=Fc((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.defaultPerf=void 0,e.defaultPerf=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date});Object.defineProperty(er,"__esModule",{value:!0});er.LRUCache=void 0;var k=Py(),qy=Ny(),kn=()=>k.metrics.hasSubscribers||k.tracing.hasSubscribers,Kc=new Set,jc=typeof process=="object"&&process?process:{},jy=(e,t,r,n)=>{typeof jc.emitWarning=="function"?jc.emitWarning(e,t,r,n):console.error(`[${r}] ${t}: ${e}`)},Fy=(e)=>!Kc.has(e),se=(e)=>!!e&&e===Math.floor(e)&&e>0&&isFinite(e),Dc=(e)=>se(e)?e<=Math.pow(2,8)?Uint8Array:e<=Math.pow(2,16)?Uint16Array:e<=Math.pow(2,32)?Uint32Array:e<=Number.MAX_SAFE_INTEGER?Qt:null:null,Qt=class extends Array{constructor(e){super(e),this.fill(0)}},Ky=class e{heap;length;static#a=!1;static create(t){let r=Dc(t);if(!r)return[];e.#a=!0;let n=new e(t,r);return e.#a=!1,n}constructor(t,r){if(!e.#a)throw TypeError("instantiate Stack using Stack.create(n)");this.heap=new r(t),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}},Dy=class e{#a;#f;#m;#_;#y;#N;#q;#E;get perf(){return this.#E}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;backgroundFetchSize;#i;#S;#n;#r;#e;#u;#h;#c;#s;#w;#o;#b;#v;#d;#p;#T;#j;#l;#O;static unsafeExposeInternals(t){return{starts:t.#v,ttls:t.#d,autopurgeTimers:t.#p,sizes:t.#b,keyMap:t.#n,keyList:t.#r,valList:t.#e,next:t.#u,prev:t.#h,get head(){return t.#c},get tail(){return t.#s},free:t.#w,isBackgroundFetch:(r)=>t.#t(r),backgroundFetch:(r,n,i,s)=>t.#D(r,n,i,s),moveToTail:(r)=>t.#P(r),indexes:(r)=>t.#A(r),rindexes:(r)=>t.#R(r),isStale:(r)=>t.#g(r)}}get max(){return this.#a}get maxSize(){return this.#f}get calculatedSize(){return this.#S}get size(){return this.#i}get fetchMethod(){return this.#N}get memoMethod(){return this.#q}get dispose(){return this.#m}get onInsert(){return this.#_}get disposeAfter(){return this.#y}constructor(t){let{max:r=0,ttl:n,ttlResolution:i=1,ttlAutopurge:s,updateAgeOnGet:o,updateAgeOnHas:c,allowStale:u,dispose:a,onInsert:l,disposeAfter:f,noDisposeOnSet:g,noUpdateTTL:h,maxSize:m=0,maxEntrySize:p=0,sizeCalculation:b,fetchMethod:S,memoMethod:w,noDeleteOnFetchRejection:A,noDeleteOnStaleGet:T,allowStaleOnFetchRejection:C,allowStaleOnFetchAbort:K,ignoreFetchAbort:M,backgroundFetchSize:z=1,perf:V}=t;if(this.backgroundFetchSize=z,V!==void 0&&typeof V?.now!="function")throw TypeError("perf option must have a now() method if specified");if(this.#E=V??qy.defaultPerf,r!==0&&!se(r))throw TypeError("max option must be a nonnegative integer");let ae=r?Dc(r):Array;if(!ae)throw Error("invalid max value: "+r);if(this.#a=r,this.#f=m,this.maxEntrySize=p||this.#f,this.sizeCalculation=b,this.sizeCalculation){if(!this.#f&&!this.maxEntrySize)throw TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw TypeError("sizeCalculation set to non-function")}if(w!==void 0&&typeof w!="function")throw TypeError("memoMethod must be a function if defined");if(this.#q=w,S!==void 0&&typeof S!="function")throw TypeError("fetchMethod must be a function if specified");if(this.#N=S,this.#j=!!S,this.#n=new Map,this.#r=Array.from({length:r}).fill(void 0),this.#e=Array.from({length:r}).fill(void 0),this.#u=new ae(r),this.#h=new ae(r),this.#c=0,this.#s=0,this.#w=Ky.create(r),this.#i=0,this.#S=0,typeof a=="function"&&(this.#m=a),typeof l=="function"&&(this.#_=l),typeof f=="function"?(this.#y=f,this.#o=[]):(this.#y=void 0,this.#o=void 0),this.#T=!!this.#m,this.#O=!!this.#_,this.#l=!!this.#y,this.noDisposeOnSet=!!g,this.noUpdateTTL=!!h,this.noDeleteOnFetchRejection=!!A,this.allowStaleOnFetchRejection=!!C,this.allowStaleOnFetchAbort=!!K,this.ignoreFetchAbort=!!M,this.maxEntrySize!==0){if(this.#f!==0&&!se(this.#f))throw TypeError("maxSize must be a positive integer if specified");if(!se(this.maxEntrySize))throw TypeError("maxEntrySize must be a positive integer if specified");this.#z()}if(this.allowStale=!!u,this.noDeleteOnStaleGet=!!T,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!c,this.ttlResolution=se(i)||i===0?i:1,this.ttlAutopurge=!!s,this.ttl=n||0,this.ttl){if(!se(this.ttl))throw TypeError("ttl must be a positive integer if specified");this.#B()}if(this.#a===0&&this.ttl===0&&this.#f===0)throw TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#a&&!this.#f){let nt="LRU_CACHE_UNBOUNDED";Fy(nt)&&(Kc.add(nt),jy("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",nt,e))}}getRemainingTTL(t){return this.#n.has(t)?1/0:0}#B(){let t=new Qt(this.#a),r=new Qt(this.#a);this.#d=t,this.#v=r;let n=this.ttlAutopurge?Array.from({length:this.#a}):void 0;this.#p=n,this.#U=(u,a,l=this.#E.now())=>{r[u]=a!==0?l:0,t[u]=a,i(u,a)},this.#k=(u)=>{r[u]=t[u]!==0?this.#E.now():0,i(u,t[u])};let i=this.ttlAutopurge?(u,a)=>{if(n?.[u]&&(clearTimeout(n[u]),n[u]=void 0),a&&a!==0&&n){let l=setTimeout(()=>{this.#g(u)?(this.#I(this.#r[u],"expire"),n[u]=void 0):i(u,c(u))},a+1);l.unref&&l.unref(),n[u]=l}}:()=>{};this.#C=(u,a)=>{if(t[a]){let l=t[a],f=r[a];if(!l||!f)return;u.ttl=l,u.start=f,u.now=s||o();let g=u.now-f;u.remainingTTL=l-g}};let s=0,o=()=>{let u=this.#E.now();if(this.ttlResolution>0){s=u;let a=setTimeout(()=>s=0,this.ttlResolution);a.unref&&a.unref()}return u};this.getRemainingTTL=(u)=>{let a=this.#n.get(u);return a===void 0?0:c(a)};let c=(u)=>{let a=t[u],l=r[u];if(!a||!l)return 1/0;let f=(s||o())-l;return a-f};this.#g=(u)=>{let a=r[u],l=t[u];return!!l&&!!a&&(s||o())-a>l}}#k=()=>{};#C=()=>{};#U=()=>{};#g=()=>!1;#z(){let t=new Qt(this.#a);this.#S=0,this.#b=t,this.#$=(r)=>{this.#S-=t[r],t[r]=0},this.#G=(r,n,i,s)=>{if(!se(i)){if(this.#t(n))return this.backgroundFetchSize;if(s){if(typeof s!="function")throw TypeError("sizeCalculation must be a function");if(i=s(n,r),!se(i))throw TypeError("sizeCalculation return invalid (expect positive integer)")}else throw TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.")}return i},this.#F=(r,n,i)=>{if(t[r]=n,this.#f){let s=this.#f-t[r];for(;this.#S>s;)this.#K(!0)}this.#S+=t[r],i&&(i.entrySize=n,i.totalCalculatedSize=this.#S)}}#$=(t)=>{};#F=(t,r,n)=>{};#G=(t,r,n,i)=>{if(n||i)throw TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#A({allowStale:t=this.allowStale}={}){if(this.#i)for(let r=this.#s;this.#J(r)&&((t||!this.#g(r))&&(yield r),r!==this.#c);)r=this.#h[r]}*#R({allowStale:t=this.allowStale}={}){if(this.#i)for(let r=this.#c;this.#J(r)&&((t||!this.#g(r))&&(yield r),r!==this.#s);)r=this.#u[r]}#J(t){return t!==void 0&&this.#n.get(this.#r[t])===t}*entries(){for(let t of this.#A())this.#e[t]!==void 0&&this.#r[t]!==void 0&&!this.#t(this.#e[t])&&(yield[this.#r[t],this.#e[t]])}*rentries(){for(let t of this.#R())this.#e[t]!==void 0&&this.#r[t]!==void 0&&!this.#t(this.#e[t])&&(yield[this.#r[t],this.#e[t]])}*keys(){for(let t of this.#A()){let r=this.#r[t];r!==void 0&&!this.#t(this.#e[t])&&(yield r)}}*rkeys(){for(let t of this.#R()){let r=this.#r[t];r!==void 0&&!this.#t(this.#e[t])&&(yield r)}}*values(){for(let t of this.#A())this.#e[t]!==void 0&&!this.#t(this.#e[t])&&(yield this.#e[t])}*rvalues(){for(let t of this.#R())this.#e[t]!==void 0&&!this.#t(this.#e[t])&&(yield this.#e[t])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(t,r={}){for(let n of this.#A()){let i=this.#e[n],s=this.#t(i)?i.__staleWhileFetching:i;if(s!==void 0&&t(s,this.#r[n],this))return this.#L(this.#r[n],r)}}forEach(t,r=this){for(let n of this.#A()){let i=this.#e[n],s=this.#t(i)?i.__staleWhileFetching:i;s!==void 0&&t.call(r,s,this.#r[n],this)}}rforEach(t,r=this){for(let n of this.#R()){let i=this.#e[n],s=this.#t(i)?i.__staleWhileFetching:i;s!==void 0&&t.call(r,s,this.#r[n],this)}}purgeStale(){let t=!1;for(let r of this.#R({allowStale:!0}))this.#g(r)&&(this.#I(this.#r[r],"expire"),t=!0);return t}info(t){let r=this.#n.get(t);if(r===void 0)return;let n=this.#e[r],i=this.#t(n)?n.__staleWhileFetching:n;if(i===void 0)return;let s={value:i};if(this.#d&&this.#v){let o=this.#d[r],c=this.#v[r];if(o&&c){let u=o-(this.#E.now()-c);s.ttl=u,s.start=Date.now()}}return this.#b&&(s.size=this.#b[r]),s}dump(){let t=[];for(let r of this.#A({allowStale:!0})){let n=this.#r[r],i=this.#e[r],s=this.#t(i)?i.__staleWhileFetching:i;if(s===void 0||n===void 0)continue;let o={value:s};if(this.#d&&this.#v){o.ttl=this.#d[r];let c=this.#E.now()-this.#v[r];o.start=Math.floor(Date.now()-c)}this.#b&&(o.size=this.#b[r]),t.unshift([n,o])}return t}load(t){this.clear();for(let[r,n]of t){if(n.start){let i=Date.now()-n.start;n.start=this.#E.now()-i}this.#x(r,n.value,n)}}set(t,r,n={}){let{status:i=k.metrics.hasSubscribers?{}:void 0}=n;n.status=i,i&&(i.op="set",i.key=t,r!==void 0&&(i.value=r),i.cache=this);let s=this.#x(t,r,n);return i&&k.metrics.hasSubscribers&&k.metrics.publish(i),s}#x(t,r,n,i){let{ttl:s=this.ttl,start:o,noDisposeOnSet:c=this.noDisposeOnSet,sizeCalculation:u=this.sizeCalculation,status:a}=n,l=this.#t(r);if(r===void 0)return a&&(a.set="deleted"),this.delete(t),this;let{noUpdateTTL:f=this.noUpdateTTL}=n;a&&!l&&(a.value=r);let g=this.#G(t,r,n.size||0,u,a);if(this.maxEntrySize&&g>this.maxEntrySize)return this.#I(t,"set"),a&&(a.set="miss",a.maxEntrySizeExceeded=!0),this;let h=this.#i===0?void 0:this.#n.get(t);if(h===void 0)h=this.#i===0?this.#s:this.#w.length!==0?this.#w.pop():this.#i===this.#a?this.#K(!1):this.#i,this.#r[h]=t,this.#e[h]=r,this.#n.set(t,h),this.#u[this.#s]=h,this.#h[h]=this.#s,this.#s=h,this.#i++,this.#F(h,g,a),a&&(a.set="add"),f=!1,this.#O&&!l&&this.#_?.(r,t,"add");else{this.#P(h);let m=this.#e[h];if(r!==m){if(!c)if(this.#t(m)){m!==i&&m.__abortController.abort(Error("replaced"));let{__staleWhileFetching:p}=m;p!==void 0&&p!==r&&(this.#T&&this.#m?.(p,t,"set"),this.#l&&this.#o?.push([p,t,"set"]))}else this.#T&&this.#m?.(m,t,"set"),this.#l&&this.#o?.push([m,t,"set"]);if(this.#$(h),this.#F(h,g,a),this.#e[h]=r,!l){let p=m&&this.#t(m)?m.__staleWhileFetching:m,b=p===void 0?"add":r!==p?"replace":"update";a&&(a.set=b,p!==void 0&&(a.oldValue=p)),this.#O&&this.onInsert?.(r,t,b)}}else l||(a&&(a.set="update"),this.#O&&this.onInsert?.(r,t,"update"))}if(s!==0&&!this.#d&&this.#B(),this.#d&&(f||this.#U(h,s,o),a&&this.#C(a,h)),!c&&this.#l&&this.#o){let m=this.#o,p;for(;p=m?.shift();)this.#y?.(...p)}return this}pop(){try{for(;this.#i;){let t=this.#e[this.#c];if(this.#K(!0),this.#t(t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(t!==void 0)return t}}finally{if(this.#l&&this.#o){let t=this.#o,r;for(;r=t?.shift();)this.#y?.(...r)}}}#K(t){let r=this.#c,n=this.#r[r],i=this.#e[r],s=this.#t(i);s&&i.__abortController.abort(Error("evicted"));let o=s?i.__staleWhileFetching:i;return(this.#T||this.#l)&&o!==void 0&&(this.#T&&this.#m?.(o,n,"evict"),this.#l&&this.#o?.push([o,n,"evict"])),this.#$(r),this.#p?.[r]&&(clearTimeout(this.#p[r]),this.#p[r]=void 0),t&&(this.#r[r]=void 0,this.#e[r]=void 0,this.#w.push(r)),this.#i===1?(this.#c=this.#s=0,this.#w.length=0):this.#c=this.#u[r],this.#n.delete(n),this.#i--,r}has(t,r={}){let{status:n=k.metrics.hasSubscribers?{}:void 0}=r;r.status=n,n&&(n.op="has",n.key=t,n.cache=this);let i=this.#V(t,r);return k.metrics.hasSubscribers&&k.metrics.publish(n),i}#V(t,r={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:i}=r,s=this.#n.get(t);if(s!==void 0){let o=this.#e[s];if(this.#t(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#g(s))i&&(i.has="stale",this.#C(i,s));else return n&&this.#k(s),i&&(i.has="hit",this.#C(i,s)),!0}else i&&(i.has="miss");return!1}peek(t,r={}){let{status:n=kn()?{}:void 0}=r;n&&(n.op="peek",n.key=t,n.cache=this),r.status=n;let i=this.#X(t,r);return k.metrics.hasSubscribers&&k.metrics.publish(n),i}#X(t,r){let{status:n,allowStale:i=this.allowStale}=r,s=this.#n.get(t);if(s===void 0||!i&&this.#g(s)){n&&(n.peek=s===void 0?"miss":"stale");return}let o=this.#e[s],c=this.#t(o)?o.__staleWhileFetching:o;return n&&(c!==void 0?(n.peek="hit",n.value=c):n.peek="miss"),c}#D(t,r,n,i){let s=r===void 0?void 0:this.#e[r];if(this.#t(s))return s;let o=new AbortController,{signal:c}=n;c?.addEventListener("abort",()=>o.abort(c.reason),{signal:o.signal});let u={signal:o.signal,options:n,context:i},a=(p,b=!1)=>{let{aborted:S}=o.signal,w=n.ignoreFetchAbort&&p!==void 0,A=n.ignoreFetchAbort||!!(n.allowStaleOnFetchAbort&&p!==void 0);if(n.status&&(S&&!b?(n.status.fetchAborted=!0,n.status.fetchError=o.signal.reason,w&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),S&&!w&&!b)return f(o.signal.reason,A);let T=h,C=this.#e[r];return(C===h||C===void 0&&w&&b)&&(p===void 0?T.__staleWhileFetching!==void 0?this.#e[r]=T.__staleWhileFetching:this.#I(t,"fetch"):(n.status&&(n.status.fetchUpdated=!0),this.#x(t,p,u.options,T))),p},l=(p)=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=p),f(p,!1)),f=(p,b)=>{let{aborted:S}=o.signal,w=S&&n.allowStaleOnFetchAbort,A=w||n.allowStaleOnFetchRejection,T=A||n.noDeleteOnFetchRejection,C=h;if(this.#e[r]===h&&(!T||!b&&C.__staleWhileFetching===void 0?this.#I(t,"fetch"):w||(this.#e[r]=C.__staleWhileFetching)),A)return n.status&&C.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),C.__staleWhileFetching;if(C.__returned===C)throw p},g=(p,b)=>{let S=this.#N?.(t,s,u);o.signal.addEventListener("abort",()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(p(void 0),n.allowStaleOnFetchAbort&&(p=(w)=>a(w,!0)))}),S&&S instanceof Promise?S.then((w)=>p(w===void 0?void 0:w),b):S!==void 0&&p(S)};n.status&&(n.status.fetchDispatched=!0);let h=new Promise(g).then(a,l),m=Object.assign(h,{__abortController:o,__staleWhileFetching:s,__returned:void 0});return r===void 0?(this.#x(t,m,{...u.options,status:void 0}),r=this.#n.get(t)):this.#e[r]=m,m}#t(t){if(!this.#j)return!1;let r=t;return!!r&&r instanceof Promise&&r.hasOwnProperty("__staleWhileFetching")&&r.__abortController instanceof AbortController}fetch(t,r={}){let n=k.tracing.hasSubscribers,{status:i=kn()?{}:void 0}=r;r.status=i,i&&r.context&&(i.context=r.context);let s=this.#M(t,r);return i&&n&&(i.trace=!0,k.tracing.tracePromise(()=>s,i).catch(()=>{})),s}async#M(t,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:c=this.noDisposeOnSet,size:u=0,sizeCalculation:a=this.sizeCalculation,noUpdateTTL:l=this.noUpdateTTL,noDeleteOnFetchRejection:f=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:g=this.allowStaleOnFetchRejection,ignoreFetchAbort:h=this.ignoreFetchAbort,allowStaleOnFetchAbort:m=this.allowStaleOnFetchAbort,context:p,forceRefresh:b=!1,status:S,signal:w}=r;if(S&&(S.op="fetch",S.key=t,b&&(S.forceRefresh=!0),S.cache=this),!this.#j)return S&&(S.fetch="get"),this.#L(t,{allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:s,status:S});let A={allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:s,ttl:o,noDisposeOnSet:c,size:u,sizeCalculation:a,noUpdateTTL:l,noDeleteOnFetchRejection:f,allowStaleOnFetchRejection:g,allowStaleOnFetchAbort:m,ignoreFetchAbort:h,status:S,signal:w},T=this.#n.get(t);if(T===void 0){S&&(S.fetch="miss");let C=this.#D(t,T,A,p);return C.__returned=C}else{let C=this.#e[T];if(this.#t(C)){let V=n&&C.__staleWhileFetching!==void 0;return S&&(S.fetch="inflight",V&&(S.returnedStale=!0)),V?C.__staleWhileFetching:C.__returned=C}let K=this.#g(T);if(!b&&!K)return S&&(S.fetch="hit"),this.#P(T),i&&this.#k(T),S&&this.#C(S,T),C;let M=this.#D(t,T,A,p),z=M.__staleWhileFetching!==void 0&&n;return S&&(S.fetch=K?"stale":"refresh",z&&K&&(S.returnedStale=!0)),z?M.__staleWhileFetching:M.__returned=M}}forceFetch(t,r={}){let n=k.tracing.hasSubscribers,{status:i=kn()?{}:void 0}=r;r.status=i,i&&r.context&&(i.context=r.context);let s=this.#Y(t,r);return i&&n&&(i.trace=!0,k.tracing.tracePromise(()=>s,i).catch(()=>{})),s}async#Y(t,r={}){let n=await this.#M(t,r);if(n===void 0)throw Error("fetch() returned undefined");return n}memo(t,r={}){let{status:n=k.metrics.hasSubscribers?{}:void 0}=r;r.status=n,n&&(n.op="memo",n.key=t,r.context&&(n.context=r.context),n.cache=this);let i=this.#Z(t,r);return n&&(n.value=i),k.metrics.hasSubscribers&&k.metrics.publish(n),i}#Z(t,r={}){let n=this.#q;if(!n)throw Error("no memoMethod provided to constructor");let{context:i,status:s,forceRefresh:o,...c}=r;s&&o&&(s.forceRefresh=!0);let u=this.#L(t,c),a=o||u===void 0;if(s&&(s.memo=a?"miss":"hit",a||(s.value=u)),!a)return u;let l=n(t,u,{options:c,context:i});return s&&(s.value=l),this.#x(t,l,c),l}get(t,r={}){let{status:n=k.metrics.hasSubscribers?{}:void 0}=r;r.status=n,n&&(n.op="get",n.key=t,n.cache=this);let i=this.#L(t,r);return n&&(i!==void 0&&(n.value=i),k.metrics.hasSubscribers&&k.metrics.publish(n)),i}#L(t,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,status:o}=r,c=this.#n.get(t);if(c===void 0){o&&(o.get="miss");return}let u=this.#e[c],a=this.#t(u);return o&&this.#C(o,c),this.#g(c)?a?(o&&(o.get="stale-fetching"),n&&u.__staleWhileFetching!==void 0?(o&&(o.returnedStale=!0),u.__staleWhileFetching):void 0):(s||this.#I(t,"expire"),o&&(o.get="stale"),n?(o&&(o.returnedStale=!0),u):void 0):(o&&(o.get=a?"fetching":"hit"),this.#P(c),i&&this.#k(c),a?u.__staleWhileFetching:u)}#W(t,r){this.#h[r]=t,this.#u[t]=r}#P(t){t!==this.#s&&(t===this.#c?this.#c=this.#u[t]:this.#W(this.#h[t],this.#u[t]),this.#W(this.#s,t),this.#s=t)}delete(t){return this.#I(t,"delete")}#I(t,r){k.metrics.hasSubscribers&&k.metrics.publish({op:"delete",delete:r,key:t,cache:this});let n=!1;if(this.#i!==0){let i=this.#n.get(t);if(i!==void 0)if(this.#p?.[i]&&(clearTimeout(this.#p[i]),this.#p[i]=void 0),n=!0,this.#i===1)this.#H(r);else{this.#$(i);let s=this.#e[i];if(this.#t(s)?s.__abortController.abort(Error("deleted")):(this.#T||this.#l)&&(this.#T&&this.#m?.(s,t,r),this.#l&&this.#o?.push([s,t,r])),this.#n.delete(t),this.#r[i]=void 0,this.#e[i]=void 0,i===this.#s)this.#s=this.#h[i];else if(i===this.#c)this.#c=this.#u[i];else{let o=this.#h[i];this.#u[o]=this.#u[i];let c=this.#u[i];this.#h[c]=this.#h[i]}this.#i--,this.#w.push(i)}}if(this.#l&&this.#o?.length){let i=this.#o,s;for(;s=i?.shift();)this.#y?.(...s)}return n}clear(){return this.#H("delete")}#H(t){for(let r of this.#R({allowStale:!0})){let n=this.#e[r];if(this.#t(n))n.__abortController.abort(Error("deleted"));else{let i=this.#r[r];this.#T&&this.#m?.(n,i,t),this.#l&&this.#o?.push([n,i,t])}}if(this.#n.clear(),this.#e.fill(void 0),this.#r.fill(void 0),this.#d&&this.#v){this.#d.fill(0),this.#v.fill(0);for(let r of this.#p??[])r!==void 0&&clearTimeout(r);this.#p?.fill(void 0)}if(this.#b&&this.#b.fill(0),this.#c=0,this.#s=0,this.#w.length=0,this.#S=0,this.#i=0,this.#l&&this.#o){let r=this.#o,n;for(;n=r?.shift();)this.#y?.(...n)}}};er.LRUCache=Dy});var Wn=d(function(Qe,$e){var By=200,Zc="__lodash_hash_undefined__",Qc=9007199254740991,Kn="[object Arguments]",Uy="[object Array]",eu="[object Boolean]",tu="[object Date]",Gy="[object Error]",Dn="[object Function]",ru="[object GeneratorFunction]",rr="[object Map]",nu="[object Number]",Bn="[object Object]",Bc="[object Promise]",iu="[object RegExp]",nr="[object Set]",su="[object String]",ou="[object Symbol]",Ln="[object WeakMap]",au="[object ArrayBuffer]",ir="[object DataView]",cu="[object Float32Array]",uu="[object Float64Array]",lu="[object Int8Array]",fu="[object Int16Array]",hu="[object Int32Array]",du="[object Uint8Array]",pu="[object Uint8ClampedArray]",gu="[object Uint16Array]",mu="[object Uint32Array]",Jy=/[\\^$.*+?()[\]{}|]/g,My=/\w*$/,Wy=/^\[object .+?Constructor\]$/,Hy=/^(?:0|[1-9]\d*)$/,I={};I[Kn]=I[Uy]=I[au]=I[ir]=I[eu]=I[tu]=I[cu]=I[uu]=I[lu]=I[fu]=I[hu]=I[rr]=I[nu]=I[Bn]=I[iu]=I[nr]=I[su]=I[ou]=I[du]=I[pu]=I[gu]=I[mu]=!0;I[Gy]=I[Dn]=I[Ln]=!1;var zy=typeof global=="object"&&global&&global.Object===Object&&global,Vy=typeof self=="object"&&self&&self.Object===Object&&self,ee=zy||Vy||Function("return this")(),yu=typeof Qe=="object"&&Qe&&!Qe.nodeType&&Qe,Uc=yu&&typeof $e=="object"&&$e&&!$e.nodeType&&$e,Xy=Uc&&Uc.exports===yu;function Yy(e,t){return e.set(t[0],t[1]),e}function Zy(e,t){return e.add(t),e}function Qy(e,t){var r=-1,n=e?e.length:0;while(++r<n)if(t(e[r],r,e)===!1)break;return e}function eE(e,t){var r=-1,n=t.length,i=e.length;while(++r<n)e[i+r]=t[r];return e}function Eu(e,t,r,n){var i=-1,s=e?e.length:0;if(n&&s)r=e[++i];while(++i<s)r=t(r,e[i],i,e);return r}function tE(e,t){var r=-1,n=Array(e);while(++r<e)n[r]=t(r);return n}function rE(e,t){return e==null?void 0:e[t]}function Su(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch(r){}return t}function Gc(e){var t=-1,r=Array(e.size);return e.forEach(function(n,i){r[++t]=[i,n]}),r}function Un(e,t){return function(r){return e(t(r))}}function Jc(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var nE=Array.prototype,iE=Function.prototype,sr=Object.prototype,$n=ee["__core-js_shared__"],Mc=function(){var e=/[^.]+$/.exec($n&&$n.keys&&$n.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),wu=iE.toString,{hasOwnProperty:oe,toString:or}=sr,sE=RegExp("^"+wu.call(oe).replace(Jy,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Wc=Xy?ee.Buffer:void 0,{Symbol:Hc,Uint8Array:zc}=ee,oE=Un(Object.getPrototypeOf,Object),aE=Object.create,cE=sr.propertyIsEnumerable,uE=nE.splice,Vc=Object.getOwnPropertySymbols,lE=Wc?Wc.isBuffer:void 0,fE=Un(Object.keys,Object),Pn=Ne(ee,"DataView"),et=Ne(ee,"Map"),Nn=Ne(ee,"Promise"),qn=Ne(ee,"Set"),jn=Ne(ee,"WeakMap"),tt=Ne(Object,"create"),hE=he(Pn),dE=he(et),pE=he(Nn),gE=he(qn),mE=he(jn),Xc=Hc?Hc.prototype:void 0,Yc=Xc?Xc.valueOf:void 0;function fe(e){var t=-1,r=e?e.length:0;this.clear();while(++t<r){var n=e[t];this.set(n[0],n[1])}}function yE(){this.__data__=tt?tt(null):{}}function EE(e){return this.has(e)&&delete this.__data__[e]}function SE(e){var t=this.__data__;if(tt){var r=t[e];return r===Zc?void 0:r}return oe.call(t,e)?t[e]:void 0}function wE(e){var t=this.__data__;return tt?t[e]!==void 0:oe.call(t,e)}function bE(e,t){var r=this.__data__;return r[e]=tt&&t===void 0?Zc:t,this}fe.prototype.clear=yE;fe.prototype.delete=EE;fe.prototype.get=SE;fe.prototype.has=wE;fe.prototype.set=bE;function te(e){var t=-1,r=e?e.length:0;this.clear();while(++t<r){var n=e[t];this.set(n[0],n[1])}}function vE(){this.__data__=[]}function TE(e){var t=this.__data__,r=ar(t,e);if(r<0)return!1;var n=t.length-1;if(r==n)t.pop();else uE.call(t,r,1);return!0}function AE(e){var t=this.__data__,r=ar(t,e);return r<0?void 0:t[r][1]}function RE(e){return ar(this.__data__,e)>-1}function IE(e,t){var r=this.__data__,n=ar(r,e);if(n<0)r.push([e,t]);else r[n][1]=t;return this}te.prototype.clear=vE;te.prototype.delete=TE;te.prototype.get=AE;te.prototype.has=RE;te.prototype.set=IE;function Le(e){var t=-1,r=e?e.length:0;this.clear();while(++t<r){var n=e[t];this.set(n[0],n[1])}}function CE(){this.__data__={hash:new fe,map:new(et||te),string:new fe}}function xE(e){return cr(this,e).delete(e)}function _E(e){return cr(this,e).get(e)}function OE(e){return cr(this,e).has(e)}function kE(e,t){return cr(this,e).set(e,t),this}Le.prototype.clear=CE;Le.prototype.delete=xE;Le.prototype.get=_E;Le.prototype.has=OE;Le.prototype.set=kE;function Pe(e){this.__data__=new te(e)}function $E(){this.__data__=new te}function LE(e){return this.__data__.delete(e)}function PE(e){return this.__data__.get(e)}function NE(e){return this.__data__.has(e)}function qE(e,t){var r=this.__data__;if(r instanceof te){var n=r.__data__;if(!et||n.length<By-1)return n.push([e,t]),this;r=this.__data__=new Le(n)}return r.set(e,t),this}Pe.prototype.clear=$E;Pe.prototype.delete=LE;Pe.prototype.get=PE;Pe.prototype.has=NE;Pe.prototype.set=qE;function jE(e,t){var r=Jn(e)||a0(e)?tE(e.length,String):[],n=r.length,i=!!n;for(var s in e)if((t||oe.call(e,s))&&!(i&&(s=="length"||n0(s,n))))r.push(s);return r}function bu(e,t,r){var n=e[t];if(!(oe.call(e,t)&&Ru(n,r))||r===void 0&&!(t in e))e[t]=r}function ar(e,t){var r=e.length;while(r--)if(Ru(e[r][0],t))return r;return-1}function FE(e,t){return e&&vu(t,Mn(t),e)}function Fn(e,t,r,n,i,s,o){var c;if(n)c=s?n(e,i,s,o):n(e);if(c!==void 0)return c;if(!ur(e))return e;var u=Jn(e);if(u){if(c=e0(e),!t)return YE(e,c)}else{var a=le(e),l=a==Dn||a==ru;if(u0(e))return JE(e,t);if(a==Bn||a==Kn||l&&!s){if(Su(e))return s?e:{};if(c=t0(l?{}:e),!t)return ZE(e,FE(c,e))}else{if(!I[a])return s?e:{};c=r0(e,a,Fn,t)}}o||(o=new Pe);var f=o.get(e);if(f)return f;if(o.set(e,c),!u)var g=r?QE(e):Mn(e);return Qy(g||e,function(h,m){if(g)m=h,h=e[m];bu(c,m,Fn(h,t,r,n,m,e,o))}),c}function KE(e){return ur(e)?aE(e):{}}function DE(e,t,r){var n=t(e);return Jn(e)?n:eE(n,r(e))}function BE(e){return or.call(e)}function UE(e){if(!ur(e)||s0(e))return!1;var t=Cu(e)||Su(e)?sE:Wy;return t.test(he(e))}function GE(e){if(!Au(e))return fE(e);var t=[];for(var r in Object(e))if(oe.call(e,r)&&r!="constructor")t.push(r);return t}function JE(e,t){if(t)return e.slice();var r=new e.constructor(e.length);return e.copy(r),r}function Gn(e){var t=new e.constructor(e.byteLength);return new zc(t).set(new zc(e)),t}function ME(e,t){var r=t?Gn(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}function WE(e,t,r){var n=t?r(Gc(e),!0):Gc(e);return Eu(n,Yy,new e.constructor)}function HE(e){var t=new e.constructor(e.source,My.exec(e));return t.lastIndex=e.lastIndex,t}function zE(e,t,r){var n=t?r(Jc(e),!0):Jc(e);return Eu(n,Zy,new e.constructor)}function VE(e){return Yc?Object(Yc.call(e)):{}}function XE(e,t){var r=t?Gn(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function YE(e,t){var r=-1,n=e.length;t||(t=Array(n));while(++r<n)t[r]=e[r];return t}function vu(e,t,r,n){r||(r={});var i=-1,s=t.length;while(++i<s){var o=t[i],c=n?n(r[o],e[o],o,r,e):void 0;bu(r,o,c===void 0?e[o]:c)}return r}function ZE(e,t){return vu(e,Tu(e),t)}function QE(e){return DE(e,Mn,Tu)}function cr(e,t){var r=e.__data__;return i0(t)?r[typeof t=="string"?"string":"hash"]:r.map}function Ne(e,t){var r=rE(e,t);return UE(r)?r:void 0}var Tu=Vc?Un(Vc,Object):h0,le=BE;if(Pn&&le(new Pn(new ArrayBuffer(1)))!=ir||et&&le(new et)!=rr||Nn&&le(Nn.resolve())!=Bc||qn&&le(new qn)!=nr||jn&&le(new jn)!=Ln)le=function(e){var t=or.call(e),r=t==Bn?e.constructor:void 0,n=r?he(r):void 0;if(n)switch(n){case hE:return ir;case dE:return rr;case pE:return Bc;case gE:return nr;case mE:return Ln}return t};function e0(e){var t=e.length,r=e.constructor(t);if(t&&typeof e[0]=="string"&&oe.call(e,"index"))r.index=e.index,r.input=e.input;return r}function t0(e){return typeof e.constructor=="function"&&!Au(e)?KE(oE(e)):{}}function r0(e,t,r,n){var i=e.constructor;switch(t){case au:return Gn(e);case eu:case tu:return new i(+e);case ir:return ME(e,n);case cu:case uu:case lu:case fu:case hu:case du:case pu:case gu:case mu:return XE(e,n);case rr:return WE(e,n,r);case nu:case su:return new i(e);case iu:return HE(e);case nr:return zE(e,n,r);case ou:return VE(e)}}function n0(e,t){return t=t==null?Qc:t,!!t&&(typeof e=="number"||Hy.test(e))&&(e>-1&&e%1==0&&e<t)}function i0(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function s0(e){return!!Mc&&Mc in e}function Au(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||sr;return e===r}function he(e){if(e!=null){try{return wu.call(e)}catch(t){}try{return e+""}catch(t){}}return""}function o0(e){return Fn(e,!0,!0)}function Ru(e,t){return e===t||e!==e&&t!==t}function a0(e){return c0(e)&&oe.call(e,"callee")&&(!cE.call(e,"callee")||or.call(e)==Kn)}var Jn=Array.isArray;function Iu(e){return e!=null&&l0(e.length)&&!Cu(e)}function c0(e){return f0(e)&&Iu(e)}var u0=lE||d0;function Cu(e){var t=ur(e)?or.call(e):"";return t==Dn||t==ru}function l0(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Qc}function ur(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function f0(e){return!!e&&typeof e=="object"}function Mn(e){return Iu(e)?jE(e):GE(e)}function h0(){return[]}function d0(){return!1}$e.exports=o0});var Hn=d(function(lr){Object.defineProperty(lr,"__esModule",{value:!0});lr.deepFreeze=void 0;function xu(e){if(e)Object.freeze(e),Object.getOwnPropertyNames(e).forEach(function(t){if(e.hasOwnProperty(t)&&e[t]!==null&&(typeof e[t]==="object"||typeof e[t]==="function")&&e[t].constructor!==Buffer&&!Object.isFrozen(e[t]))xu(e[t])});return e}lr.deepFreeze=xu});var ku=d(function(qe){var p0=qe&&qe.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(qe,"__esModule",{value:!0});qe.syncMemoizer=void 0;var g0=tr(),m0=require("events"),_u=p0(Wn()),Ou=Hn();function y0(e){let t=new g0.LRUCache(e),{load:r,hash:n,bypass:i,itemTTL:s,freeze:o,clone:c}=e,u=new m0.EventEmitter,a=Object.assign({del:l,reset:()=>t.clear(),keys:()=>[...t.keys()],on:u.on.bind(u),once:u.once.bind(u)},e);if(e.disable)return Object.assign(r,a);function l(){let p=n(...arguments);t.delete(p)}function f(p,...b){u.emit(p,...b)}function g(p){return p&&p.then&&typeof p.then==="function"}function h(p){let b=p;if(c)if(g(b))b=b.then(_u.default);else b=(0,_u.default)(b);if(o)if(g(b))b=b.then(Ou.deepFreeze);else Ou.deepFreeze(b);return b}return Object.assign(function(...p){if(i&&i(...p))return f("miss",...p),r(...p);var b=n(...p),S=t.get(b);if(S)return f("hit",...p),h(S);f("miss",...p);let w=r(...p);if(s)t.set(b,w,{ttl:s(...p.concat([w]))});else t.set(b,w);return h(w)},a)}qe.syncMemoizer=y0});var Lu=d(function(je){var E0=je&&je.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(je,"__esModule",{value:!0});je.asyncMemoizer=void 0;var S0=tr(),w0=require("events"),b0=E0(Wn()),v0=Hn(),T0=ku();function $u(e){let t=new S0.LRUCache(e),{load:r,hash:n,bypass:i,itemTTL:s,freeze:o,clone:c}=e,u=e.queueTTL||1000,a=new Map,l=new w0.EventEmitter,f=Object.assign({del:g,reset:()=>t.clear(),keys:()=>[...t.keys()],on:l.on.bind(l),once:l.once.bind(l)},e);if(e.disable)return Object.assign(r,f);function g(...S){let w=n(...S);t.delete(w)}function h(S,w,A){if(o)A.forEach(v0.deepFreeze);if(s)t.set(S,A,{ttl:s(...w.concat(A))});else t.set(S,A)}function m(S,w){for(let A of S)if(c)setImmediate(A,...w.map(b0.default));else setImmediate(A,...w)}function p(S,...w){l.emit(S,...w)}function b(...S){let w=S.slice(0,-1),A=S.slice(-1).pop(),T;if(i&&i(...w))return p("miss",...w),r(...S);if(w.length===0&&!n)T="_";else T=n(...w);let C=t.get(T);if(C)return p("hit",...w),m([A],[null].concat(C));let K=a.get(T);if(K&&K.expiresAt>Date.now()){K.queue.push(A),p("queue",...w);return}p("miss",...w);let M=Date.now(),z=[A];a.set(T,{queue:z,expiresAt:M+u});let V=(...ae)=>{if(!ae[0])h(T,w,ae.slice(1));a.delete(T),p("loaded",Date.now()-M,...w),m(z,ae)};r(...w,V)}return Object.assign(b,f)}je.asyncMemoizer=$u;$u.sync=T0.syncMemoizer});var Nu=d(function(yv,Pu){var A0=Lu();Pu.exports=A0.asyncMemoizer});var Fu=d(function(Ev,ju){var zn=Ut()("jwks"),R0=Nu(),{LRUCache:I0}=tr(),{promisify:C0,callbackify:qu}=require("util");function x0(e,{cacheMaxEntries:t=5,cacheMaxAge:r=600000,cacheMaxAgeFallback:n,onStaleCacheFallback:i}){zn(`Configured caching of signing keys. Max: ${t} / Age: ${r}${n?` / Fallback: ${n}`:""}`);let s;if(n){let o=new I0({max:t}),c=e.getSigningKey.bind(e);s=qu(async(u)=>{try{let a=await c(u);return o.set(u,{key:a,fetchedAt:Date.now()}),a}catch(a){if(a.isEndpointUnavailable){let l=o.get(u);if(l&&Date.now()-l.fetchedAt<r+n){if(zn(`JWKS endpoint unavailable, serving stale signing key for '${u}': ${a.message}`),i)i(a,u,l.key);return l.key}zn(`JWKS endpoint unavailable and no valid stale entry for '${u}', fallback window expired or key never fetched`)}throw a}})}else s=qu(e.getSigningKey.bind(e));return C0(R0({hash:(o)=>o,load:s,ttl:r,max:t}))}ju.exports.default=x0});var Vn=d(function(Sv,Du){var Ku=function(e,t,r,n){if(this.bucketSize=e,this.tokensPerInterval=t,typeof r==="string")switch(r){case"sec":case"second":this.interval=1000;break;case"min":case"minute":this.interval=60000;break;case"hr":case"hour":this.interval=3600000;break;case"day":this.interval=86400000;break;default:throw Error("Invaid interval "+r)}else this.interval=r;this.parentBucket=n,this.content=0,this.lastDrip=+new Date};Ku.prototype={bucketSize:1,tokensPerInterval:1,interval:1000,parentBucket:null,content:0,lastDrip:0,removeTokens:function(e,t){var r=this;if(!this.bucketSize)return process.nextTick(t.bind(null,null,e,Number.POSITIVE_INFINITY)),!0;if(e>this.bucketSize)return process.nextTick(t.bind(null,"Requested tokens "+e+" exceeds bucket size "+this.bucketSize,null)),!1;if(this.drip(),e>this.content)return n();if(this.parentBucket)return this.parentBucket.removeTokens(e,function(i,s){if(i)return t(i,null);if(e>r.content)return n();r.content-=e,t(null,Math.min(s,r.content))});else return this.content-=e,process.nextTick(t.bind(null,null,this.content)),!0;function n(){var i=Math.ceil((e-r.content)*(r.interval/r.tokensPerInterval));return setTimeout(function(){r.removeTokens(e,t)},i),!1}},tryRemoveTokens:function(e){if(!this.bucketSize)return!0;if(e>this.bucketSize)return!1;if(this.drip(),e>this.content)return!1;if(this.parentBucket&&!this.parentBucket.tryRemoveTokens(e))return!1;return this.content-=e,!0},drip:function(){if(!this.tokensPerInterval){this.content=this.bucketSize;return}var e=+new Date,t=Math.max(e-this.lastDrip,0);this.lastDrip=e;var r=t*(this.tokensPerInterval/this.interval);this.content=Math.min(this.content+r,this.bucketSize)}};Du.exports=Ku});var Uu=d(function(wv,Bu){var _0=function(){if(typeof process<"u"&&process.hrtime){var e=process.hrtime(),t=e[0],r=e[1];return t*1000+Math.floor(r/1e6)}return new Date().getTime()};Bu.exports=_0});var Mu=d(function(bv,Ju){var O0=Vn(),Xn=Uu(),Gu=function(e,t,r){this.tokenBucket=new O0(e,e,t,null),this.tokenBucket.content=e,this.curIntervalStart=Xn(),this.tokensThisInterval=0,this.fireImmediately=r};Gu.prototype={tokenBucket:null,curIntervalStart:0,tokensThisInterval:0,fireImmediately:!1,removeTokens:function(e,t){if(e>this.tokenBucket.bucketSize)return process.nextTick(t.bind(null,"Requested tokens "+e+" exceeds maximum tokens per interval "+this.tokenBucket.bucketSize,null)),!1;var r=this,n=Xn();if(n<this.curIntervalStart||n-this.curIntervalStart>=this.tokenBucket.interval)this.curIntervalStart=n,this.tokensThisInterval=0;if(e>this.tokenBucket.tokensPerInterval-this.tokensThisInterval){if(this.fireImmediately)process.nextTick(t.bind(null,null,-1));else{var i=Math.ceil(this.curIntervalStart+this.tokenBucket.interval-n);setTimeout(function(){r.tokenBucket.removeTokens(e,s)},i)}return!1}return this.tokenBucket.removeTokens(e,s);function s(o,c){if(o)return t(o,null);r.tokensThisInterval+=e,t(null,c)}},tryRemoveTokens:function(e){if(e>this.tokenBucket.bucketSize)return!1;var t=Xn();if(t<this.curIntervalStart||t-this.curIntervalStart>=this.tokenBucket.interval)this.curIntervalStart=t,this.tokensThisInterval=0;if(e>this.tokenBucket.tokensPerInterval-this.tokensThisInterval)return!1;var r=this.tokenBucket.tryRemoveTokens(e);if(r)this.tokensThisInterval+=e;return r},getTokensRemaining:function(){return this.tokenBucket.drip(),this.tokenBucket.content}};Ju.exports=Gu});var Wu=d(function(Yn){Yn.RateLimiter=Mu();Yn.TokenBucket=Vn()});var Zn=d(function(Tv,Hu){function fr(e){Error.call(this,e),Error.captureStackTrace(this,this.constructor),this.name="JwksRateLimitError",this.message=e}fr.prototype=Object.create(Error.prototype);fr.prototype.constructor=fr;Hu.exports=fr});var Vu=d(function(Av,zu){var Qn=Ut()("jwks"),{RateLimiter:k0}=Wu(),$0=Zn();function L0(e,{jwksRequestsPerMinute:t=10}){let r=e.getSigningKey.bind(e),n=new k0(t,"minute",!0);return Qn(`Configured rate limiting to JWKS endpoint at ${t}/minute`),async(i)=>await new Promise((s,o)=>{n.removeTokens(1,async(c,u)=>{if(c)o(c);if(Qn("Requests to the JWKS endpoint available for the next minute:",u),u<0)Qn("Too many requests to the JWKS endpoint"),o(new $0("Too many requests to the JWKS endpoint"));else try{let a=await r(i);s(a)}catch(a){o(a)}})})}zu.exports.default=L0});var Yu=d(function(Rv,Xu){var P0=_n().retrieveSigningKeys;function N0(e,{getKeysInterceptor:t}){let r=e.getSigningKey.bind(e);return async(n)=>{let i=await t(),s;if(i&&i.length)s=await P0(i);if(s&&s.length){let o=s.find((c)=>!n||c.kid===n);if(o)return o}return r(n)}}Xu.exports.default=N0});var Qu=d(function(Iv,Zu){var{callbackify:q0}=require("util"),j0=(e)=>{let t=e.getSigningKey.bind(e);return(r,n)=>{if(n)return q0(t)(r,n);return t(r)}};Zu.exports.default=j0});var tl=d(function(Cv,el){el.exports={request:qc().default,cacheSigningKey:Fu().default,rateLimitSigningKey:Vu().default,getKeysInterceptor:Yu().default,callbackSupport:Qu().default}});var ei=d(function(xv,rl){function hr(e){Error.call(this,e),Error.captureStackTrace(this,this.constructor),this.name="SigningKeyNotFoundError",this.message=e}hr.prototype=Object.create(Error.prototype);hr.prototype.constructor=hr;rl.exports=hr});var Fe=d(function(_v,sl){var de=Ut()("jwks"),{retrieveSigningKeys:F0}=_n(),{request:K0,cacheSigningKey:D0,rateLimitSigningKey:B0,getKeysInterceptor:U0,callbackSupport:G0}=tl(),ti=Yt(),nl=ei();class il{constructor(e){if(this.options={rateLimit:!1,cache:!0,timeout:30000,...e},this.options.getKeysInterceptor)this.getSigningKey=U0(this,e);if(this.options.rateLimit)this.getSigningKey=B0(this,e);if(this.options.cache)this.getSigningKey=D0(this,e);this.getSigningKey=G0(this,e)}async getKeys(){de(`Fetching keys from '${this.options.jwksUri}'`);try{let e=await K0({uri:this.options.jwksUri,headers:this.options.requestHeaders,agent:this.options.requestAgent,timeout:this.options.timeout,fetcher:this.options.fetcher});return de("Keys:",e.keys),e.keys}catch(e){let{errorMsg:t}=e;de("Failure:",t||e);let r=t?new ti(t):e;throw r.isEndpointUnavailable=!0,r}}async getSigningKeys(){let e=await this.getKeys();if(!e||!e.length)throw new ti("The JWKS endpoint did not contain any keys");let t=await F0(e);if(!t.length)throw new ti("The JWKS endpoint did not contain any signing keys");return de("Signing Keys:",t),t}async getSigningKey(e){de(`Fetching signing key for '${e}'`);let t=await this.getSigningKeys(),r=e!==void 0&&e!==null;if(!r&&t.length>1)throw de("No KID specified and JWKS endpoint returned more than 1 key"),new nl("No KID specified and JWKS endpoint returned more than 1 key");let n=t.find((i)=>!r||i.kid===e);if(n)return n;else throw de(`Unable to find a signing key that matches '${e}'`),new nl(`Unable to find a signing key that matches '${e}'`)}}sl.exports={JwksClient:il}});var Ke=d(function(Ov,ol){ol.exports={ArgumentError:On(),JwksError:Yt(),JwksRateLimitError:Zn(),SigningKeyNotFoundError:ei()}});var rt=d(function(kv,al){var J0=["RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512","EdDSA"];al.exports=J0});var cl=d(function($v,dr){var{ArgumentError:M0}=Ke(),{JwksClient:W0}=Fe(),H0=rt(),z0=(e,t)=>{if(e&&e.name==="SigningKeyNotFoundError")return t(e,null,null);if(e)return t(e,null,null)};dr.exports.hapiJwt2KeyAsync=(e)=>{let t=dr.exports.hapiJwt2Key(e);return function(r){return new Promise((n,i)=>{t(r,(o,c)=>{!c||o?i(o):n({key:c})})})}};dr.exports.hapiJwt2Key=function(e){if(e===null||e===void 0)throw new M0("An options object must be provided when initializing hapiJwt2Key");let t=new W0(e),r=e.handleSigningKeyError||z0;return function(i,s){if(!i||!i.header)return s(Error("Cannot find a signing certificate if there is no header"),null,null);if(!H0.includes(i.header.alg))return s(Error("Unsupported algorithm "+i.header.alg+" supplied."),null,null);t.getSigningKey(i.header.kid).then((o)=>s(null,o.publicKey||o.rsaPublicKey,o)).catch((o)=>r(o,(c)=>s(c,null,null)))}}});var ll=d(function(Lv,ul){var{ArgumentError:V0}=Ke(),{JwksClient:X0}=Fe(),Y0=rt(),Z0=(e,t)=>{if(e&&e.name==="SigningKeyNotFoundError")return t(null);if(e)return t(e)};ul.exports.expressJwtSecret=function(e){if(e===null||e===void 0)throw new V0("An options object must be provided when initializing expressJwtSecret");let t=new X0(e),r=e.handleSigningKeyError||Z0,n=async(i,s)=>{if(!s)return;let o=s.header;if(!o||!Y0.includes(o.alg))return;try{let c=await t.getSigningKey(o.kid);return c.publicKey||c.rsaPublicKey}catch(c){return new Promise((u,a)=>{r(c,(l)=>{if(!l)return u();a(l)})})}};return function(s,o,c,u){if(arguments.length===4){n(s,{header:o}).then((a)=>{setImmediate(u,null,a)}).catch((a)=>{setImmediate(u,a)});return}return n(s,arguments[1])}}});var hl=d(function(Pv,fl){var{ArgumentError:Q0}=Ke(),{JwksClient:eS}=Fe(),tS=rt();fl.exports.koaJwtSecret=function(e={}){if(!e.jwksUri)throw new Q0("No JWKS provided. Please provide a jwksUri");let t=new eS(e);return function({alg:n,kid:i}={}){return new Promise((s,o)=>{if(!tS.includes(n))return o(Error("Missing / invalid token algorithm"));t.getSigningKey(i).then((c)=>{s(c.publicKey||c.rsaPublicKey)}).catch((c)=>{if(e.handleSigningKeyError)return e.handleSigningKeyError(c).then(o);return o(c)})})}}});var gl=d(function(qv,pl){var Nv=(xn(),{}),{ArgumentError:dl}=Ke(),{JwksClient:rS}=Fe(),nS=rt(),iS=(e,t)=>{if(e&&e.name==="SigningKeyNotFoundError")return t(null);if(e)return t(e)};pl.exports.passportJwtSecret=function(e){if(e===null||e===void 0)throw new dl("An options object must be provided when initializing passportJwtSecret");if(!e.jwksUri)throw new dl("No JWKS provided. Please provide a jwksUri");let t=new rS(e),r=e.handleSigningKeyError||iS;return function(i,s,o){let c;try{c={payload:Oc(s),header:xc(s)}}catch(u){c=null}if(!c||!nS.includes(c.header.alg))return o(null,null);t.getSigningKey(c.header.kid).then((u)=>{o(null,u.publicKey||u.rsaPublicKey)}).catch((u)=>{r(u,(a)=>o(a,null))})}}});var yl=d(function(jv,J){var{JwksClient:ml}=Fe(),pr=Ke(),{hapiJwt2Key:sS,hapiJwt2KeyAsync:oS}=cl(),{expressJwtSecret:aS}=ll(),{koaJwtSecret:cS}=hl(),{passportJwtSecret:uS}=gl();J.exports=(e)=>new ml(e);J.exports.JwksClient=ml;J.exports.ArgumentError=pr.ArgumentError;J.exports.JwksError=pr.JwksError;J.exports.JwksRateLimitError=pr.JwksRateLimitError;J.exports.SigningKeyNotFoundError=pr.SigningKeyNotFoundError;J.exports.expressJwtSecret=aS;J.exports.hapiJwt2Key=sS;J.exports.hapiJwt2KeyAsync=oS;J.exports.koaJwtSecret=cS;J.exports.passportJwtSecret=uS});var yS={};li(yS,{handler:()=>pS,isAuthorized:()=>Tl});module.exports=ui(yS);var Er=require("node:crypto");function wr(e){return e.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function SS(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");return Buffer.from(t,"base64").toString()}var fi=`<!DOCTYPE html>
10
+ -----END ${t}-----`},$y=async(e,t,r)=>{if(pc(r)){if(r.type!==e)throw TypeError(`key is not a ${e} key`);return r.export({format:"pem",type:t})}if(!hc(r))throw TypeError(dc(r,"CryptoKey","KeyObject"));if(!r.extractable)throw TypeError("CryptoKey is not extractable");if(r.type!==e)throw TypeError(`key is not a ${e} key`);return ky(wn(new Uint8Array(await crypto.subtle.exportKey(t,r))),`${e.toUpperCase()} KEY`)},vc=(e)=>$y("public","spki",e);var Tc=q(()=>{An();Qe()});function Ac(e){return vc(e)}var Ic=q(()=>{Tc()});async function Cc(e,t,r){if(!et(e))throw TypeError("JWK must be an object");let n=gc(e),i=vn(r?.extractable),{alg:s}=n;if(t??=s,n.kty!=="oct"&&!t)throw TypeError('"alg" argument is required when "jwk.alg" is not present');switch(n.kty){case"oct":if(typeof n.k!="string")throw TypeError('missing "k" (Key Value) Parameter value');return Oe(n.k);case"AKP":{if(typeof s!="string"||!s)throw TypeError('missing "alg" (Algorithm) Parameter value');if(t!==s)throw TypeError("JWK alg and alg option value mismatch");return Tn(On(t),n,i)}case"RSA":case"EC":case"OKP":return Tn(On(t),n,i);default:throw new Z('Unsupported "kty" (Key Type) Parameter value')}}var Rc=q(()=>{Xt();An();bc();_e();Yt()});function xc(e){let t;if(typeof e=="string"){let n=e.split(".");(n.length===3||n.length===5)&&([t]=n)}else if(typeof e=="object"&&e)if("protected"in e)t=e.protected;else throw TypeError("Token does not contain a Protected Header");let r="Invalid Token or Protected Header formatting";if(typeof t!="string"||!t)throw TypeError(r);return fc(t,TypeError,r)}var _c=q(()=>{Yt()});function Oc(e){if(typeof e!="string")throw new Q("JWTs must use Compact JWS serialization, JWT must be a string");let{1:t,length:r}=e.split(".");if(r===5)throw new Q("Only JWTs using Compact JWS serialization can be decoded");if(r!==3)throw new Q("Invalid JWT");if(!t)throw new Q("JWTs must contain a payload");let n;try{n=Oe(t)}catch(s){throw new Q("Failed to base64url decode the payload",{cause:s})}let i;try{i=JSON.parse(Vt.decode(n))}catch(s){throw new Q("Failed to parse the decoded payload as JSON",{cause:s})}if(!et(i))throw new Q("Invalid JWT Claims Set");return i}var kc=q(()=>{Xt();Qe();Yt();_e()});var kn=q(()=>{Ic();Rc();_c();kc()});var rr=p(function(Mb,$c){function tr(e){Error.call(this,e),Error.captureStackTrace(this,this.constructor),this.name="JwksError",this.message=e}tr.prototype=Object.create(Error.prototype);tr.prototype.constructor=tr;$c.exports=tr});var $n=p(function(Hb,Pc){var Lc=(kn(),{}),Ly=rr();function Py(e){if(e.alg)return e.alg;if(e.kty==="RSA")return"RS256";if(e.kty==="EC")switch(e.crv){case"P-256":return"ES256";case"P-384":return"ES384";case"P-521":return"ES512"}if(e.kty==="OKP")switch(e.crv){case"Ed25519":case"Ed448":return"EdDSA"}throw new Ly("Unsupported JWK")}async function Ny(e){let t=[];e=e.filter(({use:r})=>r==="sig"||r===void 0).filter(({kty:r})=>r==="RSA"||r==="EC"||r==="OKP");for(let r of e)try{let n=await Cc({...r,ext:!0},Py(r));if(n.type!=="public")continue;let i;switch(n[Symbol.toStringTag]){case"CryptoKey":{let s=await Ac(n);i=()=>s;break}case"KeyObject":default:i=()=>n.export({format:"pem",type:"spki"})}t.push({get publicKey(){return i()},get rsaPublicKey(){return i()},getPublicKey(){return i()},...typeof r.kid==="string"&&r.kid?{kid:r.kid}:void 0,...typeof r.alg==="string"&&r.alg?{alg:r.alg}:void 0})}catch(n){continue}return t}Pc.exports={retrieveSigningKeys:Ny}});var Ln=p(function(zb,Nc){function nr(e){Error.call(this,e),Error.captureStackTrace(this,this.constructor),this.name="ArgumentError",this.message=e}nr.prototype=Object.create(Error.prototype);nr.prototype.constructor=nr;Nc.exports=nr});var jc=p(function(Vb,qc){var qy=require("http"),jy=require("https"),Fy=Ln();qc.exports.default=(e)=>{if(e.fetcher)return e.fetcher(e.uri);return new Promise((t,r)=>{let n;try{n=new URL(e.uri)}catch(h){throw new Fy("Invalid JWKS URI: The provided URI is not a valid URL.")}let{hostname:i,port:s,protocol:o,pathname:c,search:u}=n,a=c+u,l={hostname:i,path:a,port:s,method:"GET",...e.headers&&{headers:{...e.headers}},...e.timeout&&{timeout:e.timeout},...e.agent&&{agent:e.agent}},g=(o==="https:"?jy:qy).request(l,(h)=>{let m="";h.setEncoding("utf8"),h.on("data",(d)=>{m+=d}),h.on("end",()=>{if(h.statusCode<200||h.statusCode>=300){let d=h.body&&(h.body.message||h.body)||h.statusMessage||`Http Error ${h.statusCode}`;r({errorMsg:d})}else try{t(m&&JSON.parse(m))}catch(d){r(d)}})});g.on("timeout",()=>g.destroy()).on("error",(h)=>r(h)).end()})}});var or=p(function(sr){var Kc=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Ky=Kc((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.tracing=e.metrics=void 0;var t=require("node:diagnostics_channel");e.metrics=(0,t.channel)("lru-cache:metrics"),e.tracing=(0,t.tracingChannel)("lru-cache")}),Dy=Kc((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.defaultPerf=void 0,e.defaultPerf=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date});Object.defineProperty(sr,"__esModule",{value:!0});sr.LRUCache=void 0;var _=Ky(),Uy=Dy(),Pn=()=>_.metrics.hasSubscribers||_.tracing.hasSubscribers,Dc=new Set,Fc=typeof process=="object"&&process?process:{},By=(e,t,r,n)=>{typeof Fc.emitWarning=="function"?Fc.emitWarning(e,t,r,n):console.error(`[${r}] ${t}: ${e}`)},Jy=(e)=>!Dc.has(e),ae=(e)=>!!e&&e===Math.floor(e)&&e>0&&isFinite(e),Uc=(e)=>ae(e)?e<=Math.pow(2,8)?Uint8Array:e<=Math.pow(2,16)?Uint16Array:e<=Math.pow(2,32)?Uint32Array:e<=Number.MAX_SAFE_INTEGER?ir:null:null,ir=class extends Array{constructor(e){super(e),this.fill(0)}},Gy=class e{heap;length;static#a=!1;static create(t){let r=Uc(t);if(!r)return[];e.#a=!0;let n=new e(t,r);return e.#a=!1,n}constructor(t,r){if(!e.#a)throw TypeError("instantiate Stack using Stack.create(n)");this.heap=new r(t),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}},Wy=class e{#a;#f;#m;#_;#y;#N;#q;#E;get perf(){return this.#E}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;backgroundFetchSize;#i;#w;#n;#r;#e;#u;#h;#c;#s;#S;#o;#b;#v;#p;#d;#T;#j;#l;#O;static unsafeExposeInternals(t){return{starts:t.#v,ttls:t.#p,autopurgeTimers:t.#d,sizes:t.#b,keyMap:t.#n,keyList:t.#r,valList:t.#e,next:t.#u,prev:t.#h,get head(){return t.#c},get tail(){return t.#s},free:t.#S,isBackgroundFetch:(r)=>t.#t(r),backgroundFetch:(r,n,i,s)=>t.#D(r,n,i,s),moveToTail:(r)=>t.#P(r),indexes:(r)=>t.#A(r),rindexes:(r)=>t.#I(r),isStale:(r)=>t.#g(r)}}get max(){return this.#a}get maxSize(){return this.#f}get calculatedSize(){return this.#w}get size(){return this.#i}get fetchMethod(){return this.#N}get memoMethod(){return this.#q}get dispose(){return this.#m}get onInsert(){return this.#_}get disposeAfter(){return this.#y}constructor(t){let{max:r=0,ttl:n,ttlResolution:i=1,ttlAutopurge:s,updateAgeOnGet:o,updateAgeOnHas:c,allowStale:u,dispose:a,onInsert:l,disposeAfter:f,noDisposeOnSet:g,noUpdateTTL:h,maxSize:m=0,maxEntrySize:d=0,sizeCalculation:b,fetchMethod:w,memoMethod:S,noDeleteOnFetchRejection:A,noDeleteOnStaleGet:T,allowStaleOnFetchRejection:R,allowStaleOnFetchAbort:K,ignoreFetchAbort:W,backgroundFetchSize:z=1,perf:V}=t;if(this.backgroundFetchSize=z,V!==void 0&&typeof V?.now!="function")throw TypeError("perf option must have a now() method if specified");if(this.#E=V??Uy.defaultPerf,r!==0&&!ae(r))throw TypeError("max option must be a nonnegative integer");let le=r?Uc(r):Array;if(!le)throw Error("invalid max value: "+r);if(this.#a=r,this.#f=m,this.maxEntrySize=d||this.#f,this.sizeCalculation=b,this.sizeCalculation){if(!this.#f&&!this.maxEntrySize)throw TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw TypeError("sizeCalculation set to non-function")}if(S!==void 0&&typeof S!="function")throw TypeError("memoMethod must be a function if defined");if(this.#q=S,w!==void 0&&typeof w!="function")throw TypeError("fetchMethod must be a function if specified");if(this.#N=w,this.#j=!!w,this.#n=new Map,this.#r=Array.from({length:r}).fill(void 0),this.#e=Array.from({length:r}).fill(void 0),this.#u=new le(r),this.#h=new le(r),this.#c=0,this.#s=0,this.#S=Gy.create(r),this.#i=0,this.#w=0,typeof a=="function"&&(this.#m=a),typeof l=="function"&&(this.#_=l),typeof f=="function"?(this.#y=f,this.#o=[]):(this.#y=void 0,this.#o=void 0),this.#T=!!this.#m,this.#O=!!this.#_,this.#l=!!this.#y,this.noDisposeOnSet=!!g,this.noUpdateTTL=!!h,this.noDeleteOnFetchRejection=!!A,this.allowStaleOnFetchRejection=!!R,this.allowStaleOnFetchAbort=!!K,this.ignoreFetchAbort=!!W,this.maxEntrySize!==0){if(this.#f!==0&&!ae(this.#f))throw TypeError("maxSize must be a positive integer if specified");if(!ae(this.maxEntrySize))throw TypeError("maxEntrySize must be a positive integer if specified");this.#z()}if(this.allowStale=!!u,this.noDeleteOnStaleGet=!!T,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!c,this.ttlResolution=ae(i)||i===0?i:1,this.ttlAutopurge=!!s,this.ttl=n||0,this.ttl){if(!ae(this.ttl))throw TypeError("ttl must be a positive integer if specified");this.#U()}if(this.#a===0&&this.ttl===0&&this.#f===0)throw TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#a&&!this.#f){let at="LRU_CACHE_UNBOUNDED";Jy(at)&&(Dc.add(at),By("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",at,e))}}getRemainingTTL(t){return this.#n.has(t)?1/0:0}#U(){let t=new ir(this.#a),r=new ir(this.#a);this.#p=t,this.#v=r;let n=this.ttlAutopurge?Array.from({length:this.#a}):void 0;this.#d=n,this.#B=(u,a,l=this.#E.now())=>{r[u]=a!==0?l:0,t[u]=a,i(u,a)},this.#k=(u)=>{r[u]=t[u]!==0?this.#E.now():0,i(u,t[u])};let i=this.ttlAutopurge?(u,a)=>{if(n?.[u]&&(clearTimeout(n[u]),n[u]=void 0),a&&a!==0&&n){let l=setTimeout(()=>{this.#g(u)?(this.#C(this.#r[u],"expire"),n[u]=void 0):i(u,c(u))},a+1);l.unref&&l.unref(),n[u]=l}}:()=>{};this.#R=(u,a)=>{if(t[a]){let l=t[a],f=r[a];if(!l||!f)return;u.ttl=l,u.start=f,u.now=s||o();let g=u.now-f;u.remainingTTL=l-g}};let s=0,o=()=>{let u=this.#E.now();if(this.ttlResolution>0){s=u;let a=setTimeout(()=>s=0,this.ttlResolution);a.unref&&a.unref()}return u};this.getRemainingTTL=(u)=>{let a=this.#n.get(u);return a===void 0?0:c(a)};let c=(u)=>{let a=t[u],l=r[u];if(!a||!l)return 1/0;let f=(s||o())-l;return a-f};this.#g=(u)=>{let a=r[u],l=t[u];return!!l&&!!a&&(s||o())-a>l}}#k=()=>{};#R=()=>{};#B=()=>{};#g=()=>!1;#z(){let t=new ir(this.#a);this.#w=0,this.#b=t,this.#$=(r)=>{this.#w-=t[r],t[r]=0},this.#J=(r,n,i,s)=>{if(!ae(i)){if(this.#t(n))return this.backgroundFetchSize;if(s){if(typeof s!="function")throw TypeError("sizeCalculation must be a function");if(i=s(n,r),!ae(i))throw TypeError("sizeCalculation return invalid (expect positive integer)")}else throw TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.")}return i},this.#F=(r,n,i)=>{if(t[r]=n,this.#f){let s=this.#f-t[r];for(;this.#w>s;)this.#K(!0)}this.#w+=t[r],i&&(i.entrySize=n,i.totalCalculatedSize=this.#w)}}#$=(t)=>{};#F=(t,r,n)=>{};#J=(t,r,n,i)=>{if(n||i)throw TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#A({allowStale:t=this.allowStale}={}){if(this.#i)for(let r=this.#s;this.#G(r)&&((t||!this.#g(r))&&(yield r),r!==this.#c);)r=this.#h[r]}*#I({allowStale:t=this.allowStale}={}){if(this.#i)for(let r=this.#c;this.#G(r)&&((t||!this.#g(r))&&(yield r),r!==this.#s);)r=this.#u[r]}#G(t){return t!==void 0&&this.#n.get(this.#r[t])===t}*entries(){for(let t of this.#A())this.#e[t]!==void 0&&this.#r[t]!==void 0&&!this.#t(this.#e[t])&&(yield[this.#r[t],this.#e[t]])}*rentries(){for(let t of this.#I())this.#e[t]!==void 0&&this.#r[t]!==void 0&&!this.#t(this.#e[t])&&(yield[this.#r[t],this.#e[t]])}*keys(){for(let t of this.#A()){let r=this.#r[t];r!==void 0&&!this.#t(this.#e[t])&&(yield r)}}*rkeys(){for(let t of this.#I()){let r=this.#r[t];r!==void 0&&!this.#t(this.#e[t])&&(yield r)}}*values(){for(let t of this.#A())this.#e[t]!==void 0&&!this.#t(this.#e[t])&&(yield this.#e[t])}*rvalues(){for(let t of this.#I())this.#e[t]!==void 0&&!this.#t(this.#e[t])&&(yield this.#e[t])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(t,r={}){for(let n of this.#A()){let i=this.#e[n],s=this.#t(i)?i.__staleWhileFetching:i;if(s!==void 0&&t(s,this.#r[n],this))return this.#L(this.#r[n],r)}}forEach(t,r=this){for(let n of this.#A()){let i=this.#e[n],s=this.#t(i)?i.__staleWhileFetching:i;s!==void 0&&t.call(r,s,this.#r[n],this)}}rforEach(t,r=this){for(let n of this.#I()){let i=this.#e[n],s=this.#t(i)?i.__staleWhileFetching:i;s!==void 0&&t.call(r,s,this.#r[n],this)}}purgeStale(){let t=!1;for(let r of this.#I({allowStale:!0}))this.#g(r)&&(this.#C(this.#r[r],"expire"),t=!0);return t}info(t){let r=this.#n.get(t);if(r===void 0)return;let n=this.#e[r],i=this.#t(n)?n.__staleWhileFetching:n;if(i===void 0)return;let s={value:i};if(this.#p&&this.#v){let o=this.#p[r],c=this.#v[r];if(o&&c){let u=o-(this.#E.now()-c);s.ttl=u,s.start=Date.now()}}return this.#b&&(s.size=this.#b[r]),s}dump(){let t=[];for(let r of this.#A({allowStale:!0})){let n=this.#r[r],i=this.#e[r],s=this.#t(i)?i.__staleWhileFetching:i;if(s===void 0||n===void 0)continue;let o={value:s};if(this.#p&&this.#v){o.ttl=this.#p[r];let c=this.#E.now()-this.#v[r];o.start=Math.floor(Date.now()-c)}this.#b&&(o.size=this.#b[r]),t.unshift([n,o])}return t}load(t){this.clear();for(let[r,n]of t){if(n.start){let i=Date.now()-n.start;n.start=this.#E.now()-i}this.#x(r,n.value,n)}}set(t,r,n={}){let{status:i=_.metrics.hasSubscribers?{}:void 0}=n;n.status=i,i&&(i.op="set",i.key=t,r!==void 0&&(i.value=r),i.cache=this);let s=this.#x(t,r,n);return i&&_.metrics.hasSubscribers&&_.metrics.publish(i),s}#x(t,r,n,i){let{ttl:s=this.ttl,start:o,noDisposeOnSet:c=this.noDisposeOnSet,sizeCalculation:u=this.sizeCalculation,status:a}=n,l=this.#t(r);if(r===void 0)return a&&(a.set="deleted"),this.delete(t),this;let{noUpdateTTL:f=this.noUpdateTTL}=n;a&&!l&&(a.value=r);let g=this.#J(t,r,n.size||0,u,a);if(this.maxEntrySize&&g>this.maxEntrySize)return this.#C(t,"set"),a&&(a.set="miss",a.maxEntrySizeExceeded=!0),this;let h=this.#i===0?void 0:this.#n.get(t);if(h===void 0)h=this.#i===0?this.#s:this.#S.length!==0?this.#S.pop():this.#i===this.#a?this.#K(!1):this.#i,this.#r[h]=t,this.#e[h]=r,this.#n.set(t,h),this.#u[this.#s]=h,this.#h[h]=this.#s,this.#s=h,this.#i++,this.#F(h,g,a),a&&(a.set="add"),f=!1,this.#O&&!l&&this.#_?.(r,t,"add");else{this.#P(h);let m=this.#e[h];if(r!==m){if(!c)if(this.#t(m)){m!==i&&m.__abortController.abort(Error("replaced"));let{__staleWhileFetching:d}=m;d!==void 0&&d!==r&&(this.#T&&this.#m?.(d,t,"set"),this.#l&&this.#o?.push([d,t,"set"]))}else this.#T&&this.#m?.(m,t,"set"),this.#l&&this.#o?.push([m,t,"set"]);if(this.#$(h),this.#F(h,g,a),this.#e[h]=r,!l){let d=m&&this.#t(m)?m.__staleWhileFetching:m,b=d===void 0?"add":r!==d?"replace":"update";a&&(a.set=b,d!==void 0&&(a.oldValue=d)),this.#O&&this.onInsert?.(r,t,b)}}else l||(a&&(a.set="update"),this.#O&&this.onInsert?.(r,t,"update"))}if(s!==0&&!this.#p&&this.#U(),this.#p&&(f||this.#B(h,s,o),a&&this.#R(a,h)),!c&&this.#l&&this.#o){let m=this.#o,d;for(;d=m?.shift();)this.#y?.(...d)}return this}pop(){try{for(;this.#i;){let t=this.#e[this.#c];if(this.#K(!0),this.#t(t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(t!==void 0)return t}}finally{if(this.#l&&this.#o){let t=this.#o,r;for(;r=t?.shift();)this.#y?.(...r)}}}#K(t){let r=this.#c,n=this.#r[r],i=this.#e[r],s=this.#t(i);s&&i.__abortController.abort(Error("evicted"));let o=s?i.__staleWhileFetching:i;return(this.#T||this.#l)&&o!==void 0&&(this.#T&&this.#m?.(o,n,"evict"),this.#l&&this.#o?.push([o,n,"evict"])),this.#$(r),this.#d?.[r]&&(clearTimeout(this.#d[r]),this.#d[r]=void 0),t&&(this.#r[r]=void 0,this.#e[r]=void 0,this.#S.push(r)),this.#i===1?(this.#c=this.#s=0,this.#S.length=0):this.#c=this.#u[r],this.#n.delete(n),this.#i--,r}has(t,r={}){let{status:n=_.metrics.hasSubscribers?{}:void 0}=r;r.status=n,n&&(n.op="has",n.key=t,n.cache=this);let i=this.#V(t,r);return _.metrics.hasSubscribers&&_.metrics.publish(n),i}#V(t,r={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:i}=r,s=this.#n.get(t);if(s!==void 0){let o=this.#e[s];if(this.#t(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#g(s))i&&(i.has="stale",this.#R(i,s));else return n&&this.#k(s),i&&(i.has="hit",this.#R(i,s)),!0}else i&&(i.has="miss");return!1}peek(t,r={}){let{status:n=Pn()?{}:void 0}=r;n&&(n.op="peek",n.key=t,n.cache=this),r.status=n;let i=this.#X(t,r);return _.metrics.hasSubscribers&&_.metrics.publish(n),i}#X(t,r){let{status:n,allowStale:i=this.allowStale}=r,s=this.#n.get(t);if(s===void 0||!i&&this.#g(s)){n&&(n.peek=s===void 0?"miss":"stale");return}let o=this.#e[s],c=this.#t(o)?o.__staleWhileFetching:o;return n&&(c!==void 0?(n.peek="hit",n.value=c):n.peek="miss"),c}#D(t,r,n,i){let s=r===void 0?void 0:this.#e[r];if(this.#t(s))return s;let o=new AbortController,{signal:c}=n;c?.addEventListener("abort",()=>o.abort(c.reason),{signal:o.signal});let u={signal:o.signal,options:n,context:i},a=(d,b=!1)=>{let{aborted:w}=o.signal,S=n.ignoreFetchAbort&&d!==void 0,A=n.ignoreFetchAbort||!!(n.allowStaleOnFetchAbort&&d!==void 0);if(n.status&&(w&&!b?(n.status.fetchAborted=!0,n.status.fetchError=o.signal.reason,S&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),w&&!S&&!b)return f(o.signal.reason,A);let T=h,R=this.#e[r];return(R===h||R===void 0&&S&&b)&&(d===void 0?T.__staleWhileFetching!==void 0?this.#e[r]=T.__staleWhileFetching:this.#C(t,"fetch"):(n.status&&(n.status.fetchUpdated=!0),this.#x(t,d,u.options,T))),d},l=(d)=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=d),f(d,!1)),f=(d,b)=>{let{aborted:w}=o.signal,S=w&&n.allowStaleOnFetchAbort,A=S||n.allowStaleOnFetchRejection,T=A||n.noDeleteOnFetchRejection,R=h;if(this.#e[r]===h&&(!T||!b&&R.__staleWhileFetching===void 0?this.#C(t,"fetch"):S||(this.#e[r]=R.__staleWhileFetching)),A)return n.status&&R.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),R.__staleWhileFetching;if(R.__returned===R)throw d},g=(d,b)=>{let w=this.#N?.(t,s,u);o.signal.addEventListener("abort",()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(d(void 0),n.allowStaleOnFetchAbort&&(d=(S)=>a(S,!0)))}),w&&w instanceof Promise?w.then((S)=>d(S===void 0?void 0:S),b):w!==void 0&&d(w)};n.status&&(n.status.fetchDispatched=!0);let h=new Promise(g).then(a,l),m=Object.assign(h,{__abortController:o,__staleWhileFetching:s,__returned:void 0});return r===void 0?(this.#x(t,m,{...u.options,status:void 0}),r=this.#n.get(t)):this.#e[r]=m,m}#t(t){if(!this.#j)return!1;let r=t;return!!r&&r instanceof Promise&&r.hasOwnProperty("__staleWhileFetching")&&r.__abortController instanceof AbortController}fetch(t,r={}){let n=_.tracing.hasSubscribers,{status:i=Pn()?{}:void 0}=r;r.status=i,i&&r.context&&(i.context=r.context);let s=this.#W(t,r);return i&&n&&(i.trace=!0,_.tracing.tracePromise(()=>s,i).catch(()=>{})),s}async#W(t,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:c=this.noDisposeOnSet,size:u=0,sizeCalculation:a=this.sizeCalculation,noUpdateTTL:l=this.noUpdateTTL,noDeleteOnFetchRejection:f=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:g=this.allowStaleOnFetchRejection,ignoreFetchAbort:h=this.ignoreFetchAbort,allowStaleOnFetchAbort:m=this.allowStaleOnFetchAbort,context:d,forceRefresh:b=!1,status:w,signal:S}=r;if(w&&(w.op="fetch",w.key=t,b&&(w.forceRefresh=!0),w.cache=this),!this.#j)return w&&(w.fetch="get"),this.#L(t,{allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:s,status:w});let A={allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:s,ttl:o,noDisposeOnSet:c,size:u,sizeCalculation:a,noUpdateTTL:l,noDeleteOnFetchRejection:f,allowStaleOnFetchRejection:g,allowStaleOnFetchAbort:m,ignoreFetchAbort:h,status:w,signal:S},T=this.#n.get(t);if(T===void 0){w&&(w.fetch="miss");let R=this.#D(t,T,A,d);return R.__returned=R}else{let R=this.#e[T];if(this.#t(R)){let V=n&&R.__staleWhileFetching!==void 0;return w&&(w.fetch="inflight",V&&(w.returnedStale=!0)),V?R.__staleWhileFetching:R.__returned=R}let K=this.#g(T);if(!b&&!K)return w&&(w.fetch="hit"),this.#P(T),i&&this.#k(T),w&&this.#R(w,T),R;let W=this.#D(t,T,A,d),z=W.__staleWhileFetching!==void 0&&n;return w&&(w.fetch=K?"stale":"refresh",z&&K&&(w.returnedStale=!0)),z?W.__staleWhileFetching:W.__returned=W}}forceFetch(t,r={}){let n=_.tracing.hasSubscribers,{status:i=Pn()?{}:void 0}=r;r.status=i,i&&r.context&&(i.context=r.context);let s=this.#Y(t,r);return i&&n&&(i.trace=!0,_.tracing.tracePromise(()=>s,i).catch(()=>{})),s}async#Y(t,r={}){let n=await this.#W(t,r);if(n===void 0)throw Error("fetch() returned undefined");return n}memo(t,r={}){let{status:n=_.metrics.hasSubscribers?{}:void 0}=r;r.status=n,n&&(n.op="memo",n.key=t,r.context&&(n.context=r.context),n.cache=this);let i=this.#Z(t,r);return n&&(n.value=i),_.metrics.hasSubscribers&&_.metrics.publish(n),i}#Z(t,r={}){let n=this.#q;if(!n)throw Error("no memoMethod provided to constructor");let{context:i,status:s,forceRefresh:o,...c}=r;s&&o&&(s.forceRefresh=!0);let u=this.#L(t,c),a=o||u===void 0;if(s&&(s.memo=a?"miss":"hit",a||(s.value=u)),!a)return u;let l=n(t,u,{options:c,context:i});return s&&(s.value=l),this.#x(t,l,c),l}get(t,r={}){let{status:n=_.metrics.hasSubscribers?{}:void 0}=r;r.status=n,n&&(n.op="get",n.key=t,n.cache=this);let i=this.#L(t,r);return n&&(i!==void 0&&(n.value=i),_.metrics.hasSubscribers&&_.metrics.publish(n)),i}#L(t,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,status:o}=r,c=this.#n.get(t);if(c===void 0){o&&(o.get="miss");return}let u=this.#e[c],a=this.#t(u);return o&&this.#R(o,c),this.#g(c)?a?(o&&(o.get="stale-fetching"),n&&u.__staleWhileFetching!==void 0?(o&&(o.returnedStale=!0),u.__staleWhileFetching):void 0):(s||this.#C(t,"expire"),o&&(o.get="stale"),n?(o&&(o.returnedStale=!0),u):void 0):(o&&(o.get=a?"fetching":"hit"),this.#P(c),i&&this.#k(c),a?u.__staleWhileFetching:u)}#M(t,r){this.#h[r]=t,this.#u[t]=r}#P(t){t!==this.#s&&(t===this.#c?this.#c=this.#u[t]:this.#M(this.#h[t],this.#u[t]),this.#M(this.#s,t),this.#s=t)}delete(t){return this.#C(t,"delete")}#C(t,r){_.metrics.hasSubscribers&&_.metrics.publish({op:"delete",delete:r,key:t,cache:this});let n=!1;if(this.#i!==0){let i=this.#n.get(t);if(i!==void 0)if(this.#d?.[i]&&(clearTimeout(this.#d[i]),this.#d[i]=void 0),n=!0,this.#i===1)this.#H(r);else{this.#$(i);let s=this.#e[i];if(this.#t(s)?s.__abortController.abort(Error("deleted")):(this.#T||this.#l)&&(this.#T&&this.#m?.(s,t,r),this.#l&&this.#o?.push([s,t,r])),this.#n.delete(t),this.#r[i]=void 0,this.#e[i]=void 0,i===this.#s)this.#s=this.#h[i];else if(i===this.#c)this.#c=this.#u[i];else{let o=this.#h[i];this.#u[o]=this.#u[i];let c=this.#u[i];this.#h[c]=this.#h[i]}this.#i--,this.#S.push(i)}}if(this.#l&&this.#o?.length){let i=this.#o,s;for(;s=i?.shift();)this.#y?.(...s)}return n}clear(){return this.#H("delete")}#H(t){for(let r of this.#I({allowStale:!0})){let n=this.#e[r];if(this.#t(n))n.__abortController.abort(Error("deleted"));else{let i=this.#r[r];this.#T&&this.#m?.(n,i,t),this.#l&&this.#o?.push([n,i,t])}}if(this.#n.clear(),this.#e.fill(void 0),this.#r.fill(void 0),this.#p&&this.#v){this.#p.fill(0),this.#v.fill(0);for(let r of this.#d??[])r!==void 0&&clearTimeout(r);this.#d?.fill(void 0)}if(this.#b&&this.#b.fill(0),this.#c=0,this.#s=0,this.#S.length=0,this.#w=0,this.#i=0,this.#l&&this.#o){let r=this.#o,n;for(;n=r?.shift();)this.#y?.(...n)}}};sr.LRUCache=Wy});var Vn=p(function(nt,Pe){var My=200,Qc="__lodash_hash_undefined__",eu=9007199254740991,Bn="[object Arguments]",Hy="[object Array]",tu="[object Boolean]",ru="[object Date]",zy="[object Error]",Jn="[object Function]",nu="[object GeneratorFunction]",ar="[object Map]",iu="[object Number]",Gn="[object Object]",Bc="[object Promise]",su="[object RegExp]",cr="[object Set]",ou="[object String]",au="[object Symbol]",qn="[object WeakMap]",cu="[object ArrayBuffer]",ur="[object DataView]",uu="[object Float32Array]",lu="[object Float64Array]",fu="[object Int8Array]",hu="[object Int16Array]",pu="[object Int32Array]",du="[object Uint8Array]",gu="[object Uint8ClampedArray]",mu="[object Uint16Array]",yu="[object Uint32Array]",Vy=/[\\^$.*+?()[\]{}|]/g,Xy=/\w*$/,Yy=/^\[object .+?Constructor\]$/,Zy=/^(?:0|[1-9]\d*)$/,C={};C[Bn]=C[Hy]=C[cu]=C[ur]=C[tu]=C[ru]=C[uu]=C[lu]=C[fu]=C[hu]=C[pu]=C[ar]=C[iu]=C[Gn]=C[su]=C[cr]=C[ou]=C[au]=C[du]=C[gu]=C[mu]=C[yu]=!0;C[zy]=C[Jn]=C[qn]=!1;var Qy=typeof global=="object"&&global&&global.Object===Object&&global,eE=typeof self=="object"&&self&&self.Object===Object&&self,ee=Qy||eE||Function("return this")(),Eu=typeof nt=="object"&&nt&&!nt.nodeType&&nt,Jc=Eu&&typeof Pe=="object"&&Pe&&!Pe.nodeType&&Pe,tE=Jc&&Jc.exports===Eu;function rE(e,t){return e.set(t[0],t[1]),e}function nE(e,t){return e.add(t),e}function iE(e,t){var r=-1,n=e?e.length:0;while(++r<n)if(t(e[r],r,e)===!1)break;return e}function sE(e,t){var r=-1,n=t.length,i=e.length;while(++r<n)e[i+r]=t[r];return e}function wu(e,t,r,n){var i=-1,s=e?e.length:0;if(n&&s)r=e[++i];while(++i<s)r=t(r,e[i],i,e);return r}function oE(e,t){var r=-1,n=Array(e);while(++r<e)n[r]=t(r);return n}function aE(e,t){return e==null?void 0:e[t]}function Su(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch(r){}return t}function Gc(e){var t=-1,r=Array(e.size);return e.forEach(function(n,i){r[++t]=[i,n]}),r}function Wn(e,t){return function(r){return e(t(r))}}function Wc(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var cE=Array.prototype,uE=Function.prototype,lr=Object.prototype,Nn=ee["__core-js_shared__"],Mc=function(){var e=/[^.]+$/.exec(Nn&&Nn.keys&&Nn.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),bu=uE.toString,{hasOwnProperty:ce,toString:fr}=lr,lE=RegExp("^"+bu.call(ce).replace(Vy,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Hc=tE?ee.Buffer:void 0,{Symbol:zc,Uint8Array:Vc}=ee,fE=Wn(Object.getPrototypeOf,Object),hE=Object.create,pE=lr.propertyIsEnumerable,dE=cE.splice,Xc=Object.getOwnPropertySymbols,gE=Hc?Hc.isBuffer:void 0,mE=Wn(Object.keys,Object),jn=je(ee,"DataView"),it=je(ee,"Map"),Fn=je(ee,"Promise"),Kn=je(ee,"Set"),Dn=je(ee,"WeakMap"),st=je(Object,"create"),yE=de(jn),EE=de(it),wE=de(Fn),SE=de(Kn),bE=de(Dn),Yc=zc?zc.prototype:void 0,Zc=Yc?Yc.valueOf:void 0;function pe(e){var t=-1,r=e?e.length:0;this.clear();while(++t<r){var n=e[t];this.set(n[0],n[1])}}function vE(){this.__data__=st?st(null):{}}function TE(e){return this.has(e)&&delete this.__data__[e]}function AE(e){var t=this.__data__;if(st){var r=t[e];return r===Qc?void 0:r}return ce.call(t,e)?t[e]:void 0}function IE(e){var t=this.__data__;return st?t[e]!==void 0:ce.call(t,e)}function CE(e,t){var r=this.__data__;return r[e]=st&&t===void 0?Qc:t,this}pe.prototype.clear=vE;pe.prototype.delete=TE;pe.prototype.get=AE;pe.prototype.has=IE;pe.prototype.set=CE;function te(e){var t=-1,r=e?e.length:0;this.clear();while(++t<r){var n=e[t];this.set(n[0],n[1])}}function RE(){this.__data__=[]}function xE(e){var t=this.__data__,r=hr(t,e);if(r<0)return!1;var n=t.length-1;if(r==n)t.pop();else dE.call(t,r,1);return!0}function _E(e){var t=this.__data__,r=hr(t,e);return r<0?void 0:t[r][1]}function OE(e){return hr(this.__data__,e)>-1}function kE(e,t){var r=this.__data__,n=hr(r,e);if(n<0)r.push([e,t]);else r[n][1]=t;return this}te.prototype.clear=RE;te.prototype.delete=xE;te.prototype.get=_E;te.prototype.has=OE;te.prototype.set=kE;function Ne(e){var t=-1,r=e?e.length:0;this.clear();while(++t<r){var n=e[t];this.set(n[0],n[1])}}function $E(){this.__data__={hash:new pe,map:new(it||te),string:new pe}}function LE(e){return pr(this,e).delete(e)}function PE(e){return pr(this,e).get(e)}function NE(e){return pr(this,e).has(e)}function qE(e,t){return pr(this,e).set(e,t),this}Ne.prototype.clear=$E;Ne.prototype.delete=LE;Ne.prototype.get=PE;Ne.prototype.has=NE;Ne.prototype.set=qE;function qe(e){this.__data__=new te(e)}function jE(){this.__data__=new te}function FE(e){return this.__data__.delete(e)}function KE(e){return this.__data__.get(e)}function DE(e){return this.__data__.has(e)}function UE(e,t){var r=this.__data__;if(r instanceof te){var n=r.__data__;if(!it||n.length<My-1)return n.push([e,t]),this;r=this.__data__=new Ne(n)}return r.set(e,t),this}qe.prototype.clear=jE;qe.prototype.delete=FE;qe.prototype.get=KE;qe.prototype.has=DE;qe.prototype.set=UE;function BE(e,t){var r=Hn(e)||h0(e)?oE(e.length,String):[],n=r.length,i=!!n;for(var s in e)if((t||ce.call(e,s))&&!(i&&(s=="length"||c0(s,n))))r.push(s);return r}function vu(e,t,r){var n=e[t];if(!(ce.call(e,t)&&Cu(n,r))||r===void 0&&!(t in e))e[t]=r}function hr(e,t){var r=e.length;while(r--)if(Cu(e[r][0],t))return r;return-1}function JE(e,t){return e&&Tu(t,zn(t),e)}function Un(e,t,r,n,i,s,o){var c;if(n)c=s?n(e,i,s,o):n(e);if(c!==void 0)return c;if(!dr(e))return e;var u=Hn(e);if(u){if(c=s0(e),!t)return r0(e,c)}else{var a=he(e),l=a==Jn||a==nu;if(d0(e))return VE(e,t);if(a==Gn||a==Bn||l&&!s){if(Su(e))return s?e:{};if(c=o0(l?{}:e),!t)return n0(e,JE(c,e))}else{if(!C[a])return s?e:{};c=a0(e,a,Un,t)}}o||(o=new qe);var f=o.get(e);if(f)return f;if(o.set(e,c),!u)var g=r?i0(e):zn(e);return iE(g||e,function(h,m){if(g)m=h,h=e[m];vu(c,m,Un(h,t,r,n,m,e,o))}),c}function GE(e){return dr(e)?hE(e):{}}function WE(e,t,r){var n=t(e);return Hn(e)?n:sE(n,r(e))}function ME(e){return fr.call(e)}function HE(e){if(!dr(e)||l0(e))return!1;var t=xu(e)||Su(e)?lE:Yy;return t.test(de(e))}function zE(e){if(!Iu(e))return mE(e);var t=[];for(var r in Object(e))if(ce.call(e,r)&&r!="constructor")t.push(r);return t}function VE(e,t){if(t)return e.slice();var r=new e.constructor(e.length);return e.copy(r),r}function Mn(e){var t=new e.constructor(e.byteLength);return new Vc(t).set(new Vc(e)),t}function XE(e,t){var r=t?Mn(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}function YE(e,t,r){var n=t?r(Gc(e),!0):Gc(e);return wu(n,rE,new e.constructor)}function ZE(e){var t=new e.constructor(e.source,Xy.exec(e));return t.lastIndex=e.lastIndex,t}function QE(e,t,r){var n=t?r(Wc(e),!0):Wc(e);return wu(n,nE,new e.constructor)}function e0(e){return Zc?Object(Zc.call(e)):{}}function t0(e,t){var r=t?Mn(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function r0(e,t){var r=-1,n=e.length;t||(t=Array(n));while(++r<n)t[r]=e[r];return t}function Tu(e,t,r,n){r||(r={});var i=-1,s=t.length;while(++i<s){var o=t[i],c=n?n(r[o],e[o],o,r,e):void 0;vu(r,o,c===void 0?e[o]:c)}return r}function n0(e,t){return Tu(e,Au(e),t)}function i0(e){return WE(e,zn,Au)}function pr(e,t){var r=e.__data__;return u0(t)?r[typeof t=="string"?"string":"hash"]:r.map}function je(e,t){var r=aE(e,t);return HE(r)?r:void 0}var Au=Xc?Wn(Xc,Object):y0,he=ME;if(jn&&he(new jn(new ArrayBuffer(1)))!=ur||it&&he(new it)!=ar||Fn&&he(Fn.resolve())!=Bc||Kn&&he(new Kn)!=cr||Dn&&he(new Dn)!=qn)he=function(e){var t=fr.call(e),r=t==Gn?e.constructor:void 0,n=r?de(r):void 0;if(n)switch(n){case yE:return ur;case EE:return ar;case wE:return Bc;case SE:return cr;case bE:return qn}return t};function s0(e){var t=e.length,r=e.constructor(t);if(t&&typeof e[0]=="string"&&ce.call(e,"index"))r.index=e.index,r.input=e.input;return r}function o0(e){return typeof e.constructor=="function"&&!Iu(e)?GE(fE(e)):{}}function a0(e,t,r,n){var i=e.constructor;switch(t){case cu:return Mn(e);case tu:case ru:return new i(+e);case ur:return XE(e,n);case uu:case lu:case fu:case hu:case pu:case du:case gu:case mu:case yu:return t0(e,n);case ar:return YE(e,n,r);case iu:case ou:return new i(e);case su:return ZE(e);case cr:return QE(e,n,r);case au:return e0(e)}}function c0(e,t){return t=t==null?eu:t,!!t&&(typeof e=="number"||Zy.test(e))&&(e>-1&&e%1==0&&e<t)}function u0(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function l0(e){return!!Mc&&Mc in e}function Iu(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||lr;return e===r}function de(e){if(e!=null){try{return bu.call(e)}catch(t){}try{return e+""}catch(t){}}return""}function f0(e){return Un(e,!0,!0)}function Cu(e,t){return e===t||e!==e&&t!==t}function h0(e){return p0(e)&&ce.call(e,"callee")&&(!pE.call(e,"callee")||fr.call(e)==Bn)}var Hn=Array.isArray;function Ru(e){return e!=null&&g0(e.length)&&!xu(e)}function p0(e){return m0(e)&&Ru(e)}var d0=gE||E0;function xu(e){var t=dr(e)?fr.call(e):"";return t==Jn||t==nu}function g0(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=eu}function dr(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function m0(e){return!!e&&typeof e=="object"}function zn(e){return Ru(e)?BE(e):zE(e)}function y0(){return[]}function E0(){return!1}Pe.exports=f0});var Xn=p(function(gr){Object.defineProperty(gr,"__esModule",{value:!0});gr.deepFreeze=void 0;function _u(e){if(e)Object.freeze(e),Object.getOwnPropertyNames(e).forEach(function(t){if(e.hasOwnProperty(t)&&e[t]!==null&&(typeof e[t]==="object"||typeof e[t]==="function")&&e[t].constructor!==Buffer&&!Object.isFrozen(e[t]))_u(e[t])});return e}gr.deepFreeze=_u});var Lu=p(function(Fe){var w0=Fe&&Fe.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Fe,"__esModule",{value:!0});Fe.syncMemoizer=void 0;var ku=or(),$u=require("events"),Ou=w0(Vn()),mr=Xn();function S0(e){let t=new ku.LRUCache(e),{load:r,hash:n,bypass:i,itemTTL:s,freeze:o,clone:c}=e,u=new $u.EventEmitter,a=Object.assign({del:l,reset:()=>t.clear(),keys:()=>[...t.keys()],on:u.on.bind(u),once:u.once.bind(u)},e);if(e.disable)return Object.assign(r,a);function l(){let d=n(...arguments);t.delete(d)}function f(d,...b){u.emit(d,...b)}function g(d){return d&&d.then&&typeof d.then==="function"}function h(d){let b=d;if(c)if(g(b))b=b.then(Ou.default);else b=(0,Ou.default)(b);if(o)if(g(b))b=b.then(mr.deepFreeze);else mr.deepFreeze(b);return b}return Object.assign(function(...d){if(i&&i(...d))return f("miss",...d),r(...d);var b=n(...d),w=t.get(b);if(w)return f("hit",...d),h(w);f("miss",...d);let S=r(...d);if(s)t.set(b,S,{ttl:s(...d.concat([S]))});else t.set(b,S);return h(S)},a)}Fe.syncMemoizer=S0});var Ku=p(function(Ke){var b0=Ke&&Ke.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ke,"__esModule",{value:!0});Ke.asyncMemoizer=void 0;var Pu=or(),Nu=require("events"),v0=b0(Vn()),qu=Xn(),ju=Lu();function Fu(e){let t=new Pu.LRUCache(e),{load:r,hash:n,bypass:i,itemTTL:s,freeze:o,clone:c}=e,u=e.queueTTL||1000,a=new Map,l=new Nu.EventEmitter,f=Object.assign({del:g,reset:()=>t.clear(),keys:()=>[...t.keys()],on:l.on.bind(l),once:l.once.bind(l)},e);if(e.disable)return Object.assign(r,f);function g(...w){let S=n(...w);t.delete(S)}function h(w,S,A){if(o)A.forEach(qu.deepFreeze);if(s)t.set(w,A,{ttl:s(...S.concat(A))});else t.set(w,A)}function m(w,S){for(let A of w)if(c)setImmediate(A,...S.map(v0.default));else setImmediate(A,...S)}function d(w,...S){l.emit(w,...S)}function b(...w){let S=w.slice(0,-1),A=w.slice(-1).pop(),T;if(i&&i(...S))return d("miss",...S),r(...w);if(S.length===0&&!n)T="_";else T=n(...S);let R=t.get(T);if(R)return d("hit",...S),m([A],[null].concat(R));let K=a.get(T);if(K&&K.expiresAt>Date.now()){K.queue.push(A),d("queue",...S);return}d("miss",...S);let W=Date.now(),z=[A];a.set(T,{queue:z,expiresAt:W+u});let V=(...le)=>{if(!le[0])h(T,S,le.slice(1));a.delete(T),d("loaded",Date.now()-W,...S),m(z,le)};r(...S,V)}return Object.assign(b,f)}Ke.asyncMemoizer=Fu;Fu.sync=ju.syncMemoizer});var Bu=p(function(tv,Uu){var Du=Ku();Uu.exports=Du.asyncMemoizer});var Wu=p(function(rv,Gu){var Yn=zt()("jwks"),T0=Bu(),{LRUCache:A0}=or(),{promisify:I0,callbackify:Ju}=require("util");function C0(e,{cacheMaxEntries:t=5,cacheMaxAge:r=600000,cacheMaxAgeFallback:n,onStaleCacheFallback:i}){Yn(`Configured caching of signing keys. Max: ${t} / Age: ${r}${n?` / Fallback: ${n}`:""}`);let s;if(n){let o=new A0({max:t}),c=e.getSigningKey.bind(e);s=Ju(async(u)=>{try{let a=await c(u);return o.set(u,{key:a,fetchedAt:Date.now()}),a}catch(a){if(a.isEndpointUnavailable){let l=o.get(u);if(l&&Date.now()-l.fetchedAt<r+n){if(Yn(`JWKS endpoint unavailable, serving stale signing key for '${u}': ${a.message}`),i)i(a,u,l.key);return l.key}Yn(`JWKS endpoint unavailable and no valid stale entry for '${u}', fallback window expired or key never fetched`)}throw a}})}else s=Ju(e.getSigningKey.bind(e));return I0(T0({hash:(o)=>o,load:s,ttl:r,max:t}))}Gu.exports.default=C0});var Zn=p(function(nv,Hu){var Mu=function(e,t,r,n){if(this.bucketSize=e,this.tokensPerInterval=t,typeof r==="string")switch(r){case"sec":case"second":this.interval=1000;break;case"min":case"minute":this.interval=60000;break;case"hr":case"hour":this.interval=3600000;break;case"day":this.interval=86400000;break;default:throw Error("Invaid interval "+r)}else this.interval=r;this.parentBucket=n,this.content=0,this.lastDrip=+new Date};Mu.prototype={bucketSize:1,tokensPerInterval:1,interval:1000,parentBucket:null,content:0,lastDrip:0,removeTokens:function(e,t){var r=this;if(!this.bucketSize)return process.nextTick(t.bind(null,null,e,Number.POSITIVE_INFINITY)),!0;if(e>this.bucketSize)return process.nextTick(t.bind(null,"Requested tokens "+e+" exceeds bucket size "+this.bucketSize,null)),!1;if(this.drip(),e>this.content)return n();if(this.parentBucket)return this.parentBucket.removeTokens(e,function(i,s){if(i)return t(i,null);if(e>r.content)return n();r.content-=e,t(null,Math.min(s,r.content))});else return this.content-=e,process.nextTick(t.bind(null,null,this.content)),!0;function n(){var i=Math.ceil((e-r.content)*(r.interval/r.tokensPerInterval));return setTimeout(function(){r.removeTokens(e,t)},i),!1}},tryRemoveTokens:function(e){if(!this.bucketSize)return!0;if(e>this.bucketSize)return!1;if(this.drip(),e>this.content)return!1;if(this.parentBucket&&!this.parentBucket.tryRemoveTokens(e))return!1;return this.content-=e,!0},drip:function(){if(!this.tokensPerInterval){this.content=this.bucketSize;return}var e=+new Date,t=Math.max(e-this.lastDrip,0);this.lastDrip=e;var r=t*(this.tokensPerInterval/this.interval);this.content=Math.min(this.content+r,this.bucketSize)}};Hu.exports=Mu});var Vu=p(function(iv,zu){var R0=function(){if(typeof process<"u"&&process.hrtime){var e=process.hrtime(),t=e[0],r=e[1];return t*1000+Math.floor(r/1e6)}return new Date().getTime()};zu.exports=R0});var Zu=p(function(sv,Yu){var x0=Zn(),Qn=Vu(),Xu=function(e,t,r){this.tokenBucket=new x0(e,e,t,null),this.tokenBucket.content=e,this.curIntervalStart=Qn(),this.tokensThisInterval=0,this.fireImmediately=r};Xu.prototype={tokenBucket:null,curIntervalStart:0,tokensThisInterval:0,fireImmediately:!1,removeTokens:function(e,t){if(e>this.tokenBucket.bucketSize)return process.nextTick(t.bind(null,"Requested tokens "+e+" exceeds maximum tokens per interval "+this.tokenBucket.bucketSize,null)),!1;var r=this,n=Qn();if(n<this.curIntervalStart||n-this.curIntervalStart>=this.tokenBucket.interval)this.curIntervalStart=n,this.tokensThisInterval=0;if(e>this.tokenBucket.tokensPerInterval-this.tokensThisInterval){if(this.fireImmediately)process.nextTick(t.bind(null,null,-1));else{var i=Math.ceil(this.curIntervalStart+this.tokenBucket.interval-n);setTimeout(function(){r.tokenBucket.removeTokens(e,s)},i)}return!1}return this.tokenBucket.removeTokens(e,s);function s(o,c){if(o)return t(o,null);r.tokensThisInterval+=e,t(null,c)}},tryRemoveTokens:function(e){if(e>this.tokenBucket.bucketSize)return!1;var t=Qn();if(t<this.curIntervalStart||t-this.curIntervalStart>=this.tokenBucket.interval)this.curIntervalStart=t,this.tokensThisInterval=0;if(e>this.tokenBucket.tokensPerInterval-this.tokensThisInterval)return!1;var r=this.tokenBucket.tryRemoveTokens(e);if(r)this.tokensThisInterval+=e;return r},getTokensRemaining:function(){return this.tokenBucket.drip(),this.tokenBucket.content}};Yu.exports=Xu});var Qu=p(function(ei){ei.RateLimiter=Zu();ei.TokenBucket=Zn()});var ti=p(function(av,el){function yr(e){Error.call(this,e),Error.captureStackTrace(this,this.constructor),this.name="JwksRateLimitError",this.message=e}yr.prototype=Object.create(Error.prototype);yr.prototype.constructor=yr;el.exports=yr});var rl=p(function(cv,tl){var ri=zt()("jwks"),{RateLimiter:_0}=Qu(),O0=ti();function k0(e,{jwksRequestsPerMinute:t=10}){let r=e.getSigningKey.bind(e),n=new _0(t,"minute",!0);return ri(`Configured rate limiting to JWKS endpoint at ${t}/minute`),async(i)=>await new Promise((s,o)=>{n.removeTokens(1,async(c,u)=>{if(c)o(c);if(ri("Requests to the JWKS endpoint available for the next minute:",u),u<0)ri("Too many requests to the JWKS endpoint"),o(new O0("Too many requests to the JWKS endpoint"));else try{let a=await r(i);s(a)}catch(a){o(a)}})})}tl.exports.default=k0});var il=p(function(uv,nl){var $0=$n().retrieveSigningKeys;function L0(e,{getKeysInterceptor:t}){let r=e.getSigningKey.bind(e);return async(n)=>{let i=await t(),s;if(i&&i.length)s=await $0(i);if(s&&s.length){let o=s.find((c)=>!n||c.kid===n);if(o)return o}return r(n)}}nl.exports.default=L0});var ol=p(function(lv,sl){var{callbackify:P0}=require("util"),N0=(e)=>{let t=e.getSigningKey.bind(e);return(r,n)=>{if(n)return P0(t)(r,n);return t(r)}};sl.exports.default=N0});var cl=p(function(fv,al){al.exports={request:jc().default,cacheSigningKey:Wu().default,rateLimitSigningKey:rl().default,getKeysInterceptor:il().default,callbackSupport:ol().default}});var ni=p(function(hv,ul){function Er(e){Error.call(this,e),Error.captureStackTrace(this,this.constructor),this.name="SigningKeyNotFoundError",this.message=e}Er.prototype=Object.create(Error.prototype);Er.prototype.constructor=Er;ul.exports=Er});var De=p(function(pv,hl){var ge=zt()("jwks"),{retrieveSigningKeys:q0}=$n(),{request:j0,cacheSigningKey:F0,rateLimitSigningKey:K0,getKeysInterceptor:D0,callbackSupport:U0}=cl(),ii=rr(),ll=ni();class fl{constructor(e){if(this.options={rateLimit:!1,cache:!0,timeout:30000,...e},this.options.getKeysInterceptor)this.getSigningKey=D0(this,e);if(this.options.rateLimit)this.getSigningKey=K0(this,e);if(this.options.cache)this.getSigningKey=F0(this,e);this.getSigningKey=U0(this,e)}async getKeys(){ge(`Fetching keys from '${this.options.jwksUri}'`);try{let e=await j0({uri:this.options.jwksUri,headers:this.options.requestHeaders,agent:this.options.requestAgent,timeout:this.options.timeout,fetcher:this.options.fetcher});return ge("Keys:",e.keys),e.keys}catch(e){let{errorMsg:t}=e;ge("Failure:",t||e);let r=t?new ii(t):e;throw r.isEndpointUnavailable=!0,r}}async getSigningKeys(){let e=await this.getKeys();if(!e||!e.length)throw new ii("The JWKS endpoint did not contain any keys");let t=await q0(e);if(!t.length)throw new ii("The JWKS endpoint did not contain any signing keys");return ge("Signing Keys:",t),t}async getSigningKey(e){ge(`Fetching signing key for '${e}'`);let t=await this.getSigningKeys(),r=e!==void 0&&e!==null;if(!r&&t.length>1)throw ge("No KID specified and JWKS endpoint returned more than 1 key"),new ll("No KID specified and JWKS endpoint returned more than 1 key");let n=t.find((i)=>!r||i.kid===e);if(n)return n;else throw ge(`Unable to find a signing key that matches '${e}'`),new ll(`Unable to find a signing key that matches '${e}'`)}}hl.exports={JwksClient:fl}});var Ue=p(function(dv,pl){pl.exports={ArgumentError:Ln(),JwksError:rr(),JwksRateLimitError:ti(),SigningKeyNotFoundError:ni()}});var ot=p(function(gv,dl){var B0=["RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512","EdDSA"];dl.exports=B0});var ml=p(function(mv,wr){var{ArgumentError:J0}=Ue(),{JwksClient:G0}=De(),gl=ot(),W0=(e,t)=>{if(e&&e.name==="SigningKeyNotFoundError")return t(e,null,null);if(e)return t(e,null,null)};wr.exports.hapiJwt2KeyAsync=(e)=>{let t=wr.exports.hapiJwt2Key(e);return function(r){return new Promise((n,i)=>{t(r,(o,c)=>{!c||o?i(o):n({key:c})})})}};wr.exports.hapiJwt2Key=function(e){if(e===null||e===void 0)throw new J0("An options object must be provided when initializing hapiJwt2Key");let t=new G0(e),r=e.handleSigningKeyError||W0;return function(i,s){if(!i||!i.header)return s(Error("Cannot find a signing certificate if there is no header"),null,null);if(!gl.includes(i.header.alg))return s(Error("Unsupported algorithm "+i.header.alg+" supplied."),null,null);t.getSigningKey(i.header.kid).then((o)=>s(null,o.publicKey||o.rsaPublicKey,o)).catch((o)=>r(o,(c)=>s(c,null,null)))}}});var wl=p(function(yv,El){var{ArgumentError:M0}=Ue(),{JwksClient:H0}=De(),yl=ot(),z0=(e,t)=>{if(e&&e.name==="SigningKeyNotFoundError")return t(null);if(e)return t(e)};El.exports.expressJwtSecret=function(e){if(e===null||e===void 0)throw new M0("An options object must be provided when initializing expressJwtSecret");let t=new H0(e),r=e.handleSigningKeyError||z0,n=async(i,s)=>{if(!s)return;let o=s.header;if(!o||!yl.includes(o.alg))return;try{let c=await t.getSigningKey(o.kid);return c.publicKey||c.rsaPublicKey}catch(c){return new Promise((u,a)=>{r(c,(l)=>{if(!l)return u();a(l)})})}};return function(s,o,c,u){if(arguments.length===4){n(s,{header:o}).then((a)=>{setImmediate(u,null,a)}).catch((a)=>{setImmediate(u,a)});return}return n(s,arguments[1])}}});var vl=p(function(Ev,bl){var{ArgumentError:V0}=Ue(),{JwksClient:X0}=De(),Sl=ot();bl.exports.koaJwtSecret=function(e={}){if(!e.jwksUri)throw new V0("No JWKS provided. Please provide a jwksUri");let t=new X0(e);return function({alg:n,kid:i}={}){return new Promise((s,o)=>{if(!Sl.includes(n))return o(Error("Missing / invalid token algorithm"));t.getSigningKey(i).then((c)=>{s(c.publicKey||c.rsaPublicKey)}).catch((c)=>{if(e.handleSigningKeyError)return e.handleSigningKeyError(c).then(o);return o(c)})})}}});var Rl=p(function(wv,Cl){var Tl=(kn(),{}),{ArgumentError:Al}=Ue(),{JwksClient:Y0}=De(),Il=ot(),Z0=(e,t)=>{if(e&&e.name==="SigningKeyNotFoundError")return t(null);if(e)return t(e)};Cl.exports.passportJwtSecret=function(e){if(e===null||e===void 0)throw new Al("An options object must be provided when initializing passportJwtSecret");if(!e.jwksUri)throw new Al("No JWKS provided. Please provide a jwksUri");let t=new Y0(e),r=e.handleSigningKeyError||Z0;return function(i,s,o){let c;try{c={payload:Oc(s),header:xc(s)}}catch(u){c=null}if(!c||!Il.includes(c.header.alg))return o(null,null);t.getSigningKey(c.header.kid).then((u)=>{o(null,u.publicKey||u.rsaPublicKey)}).catch((u)=>{r(u,(a)=>o(a,null))})}}});var _l=p(function(Sv,G){var{JwksClient:xl}=De(),ue=Ue(),{hapiJwt2Key:Q0,hapiJwt2KeyAsync:ew}=ml(),{expressJwtSecret:tw}=wl(),{koaJwtSecret:rw}=vl(),{passportJwtSecret:nw}=Rl();G.exports=(e)=>new xl(e);G.exports.JwksClient=xl;G.exports.ArgumentError=ue.ArgumentError;G.exports.JwksError=ue.JwksError;G.exports.JwksRateLimitError=ue.JwksRateLimitError;G.exports.SigningKeyNotFoundError=ue.SigningKeyNotFoundError;G.exports.expressJwtSecret=tw;G.exports.hapiJwt2Key=Q0;G.exports.hapiJwt2KeyAsync=ew;G.exports.koaJwtSecret=rw;G.exports.passportJwtSecret=nw});var fw={};Gl(fw,{handler:()=>cw,isAuthorized:()=>Nl});module.exports=Ul(fw);var Tr=require("node:crypto");function Cr(e){return e.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function pw(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");return Buffer.from(t,"base64").toString()}var hi=`<!DOCTYPE html>
11
11
  <html lang="en">
12
12
  <head>
13
13
  <meta charset="utf-8" />
@@ -27,4 +27,4 @@ ${r}
27
27
  </p>
28
28
  </body>
29
29
  </html>
30
- `;var di=require("node:fs"),st=ge(require("node:path"),1),pi=require("node:url");var $l=(()=>{let e=function(){};return e.prototype=Object.create(null),e})();function it(e,t){let r=new $l,n=e.length;if(n<2)return r;let i=t?.decode||Nl,s=0;do{let o=Pl(e,s,n);if(o===n)break;let c=Ll(e,s,n);if(o>c){s=e.lastIndexOf(";",o-1)+1;continue}let u=hi(e,s,o);if(r[u]===void 0)r[u]=i(hi(e,o+1,c));s=c+1}while(s<n);return r}function Ll(e,t,r){let n=e.indexOf(";",t);return n===-1?r:n}function Pl(e,t,r){let n=e.indexOf("=",t);return n===-1?r:n}function hi(e,t,r){if(t===r)return"";let n=t,i=r;do{let s=e.charCodeAt(n);if(s!==32&&s!==9)break}while(++n<i);while(i>n){let s=e.charCodeAt(i-1);if(s!==32&&s!==9)break;i--}return e.slice(n,i)}function Nl(e){if(e.indexOf("%")===-1)return e;try{return decodeURIComponent(e)}catch(t){return e}}var me={none:0,error:10,warn:20,info:30,debug:40};class br{logLevel;constructor(e){this.logLevel=e}jsonify(e){return e.map((t)=>{if(typeof t==="object")try{return JSON.stringify(t)}catch{return t}return t})}info(...e){if(this.logLevel>=me.info)console.log(...this.jsonify(e))}warn(...e){if(this.logLevel>=me.warn)console.warn(...this.jsonify(e))}error(...e){if(this.logLevel>=me.error)console.error(...this.jsonify(e))}debug(...e){if(this.logLevel>=me.debug)console.trace(...this.jsonify(e))}}var ql=pi.fileURLToPath("file:///home/runner/work/cdk-cloudfront-auth/cdk-cloudfront-auth/src/handlers/util/config.ts"),jl=st.dirname(ql);function vr(){let t=process.env.LAMBDA_TASK_ROOT||jl,r=st.join(t,"config.json");console.log("Loading config from",r);let n=JSON.parse(di.readFileSync(r,"utf-8")),s=`https://cognito-idp.${/^(\S+?)_\S+$/.exec(n.userPoolId)[1]}.amazonaws.com/${n.userPoolId}`,o=`${s}/.well-known/jwks.json`;return{nonceMaxAge:Number.parseInt(it(n.cookieSettings.nonce.toLowerCase())["max-age"]??"",10)||86400,...n,tokenIssuer:s,tokenJwksUri:o,logger:new br(me[n.logLevel])}}function Fl(e){return Object.entries(e).reduce((t,[r,n])=>Object.assign(t,{[r.toLowerCase()]:[{key:r,value:n}]}),{})}function Tr(e,t){let r=t?.cookies?{"set-cookie":t.cookies.map((n)=>({key:"set-cookie",value:n}))}:{};return{status:"307",statusDescription:"Temporary Redirect",headers:{location:[{key:"location",value:e}],...r}}}function gi(e){return{body:Kl(e),status:e.statusCode??"500",headers:{"content-type":[{key:"Content-Type",value:"text/html; charset=UTF-8"}]}}}function Kl(e){let t={...e,region:process.env.AWS_REGION};return fi.replace(/\${([^}]*)}/g,(r,n)=>t[n]||"")}function mi(e,t){if(!t)throw Error("Expected response value");return{...t,headers:{...t.headers??{},...Fl(e.httpHeaders)}}}function yi(e){let t;return async(r)=>{if(!t)t=vr();t.logger.debug("Handling event:",r);let n=mi(t,await e(t,r));return t.logger.debug("Returning response:",n),n}}function _S(e){let t;return async(r)=>{if(!t)t=vr();t.logger.debug("Handling event:",r);let n=mi(t,await e(t,r));return t.logger.debug("Returning response:",n),n}}var ni=ge(Xa(),1),El=ge(yl(),1),ri;function lS(e){return"rsaPublicKey"in e}async function fS(e,t){if(!ri)ri=El.default({cache:!0,rateLimit:!0,jwksUri:e});let r=await ri.getSigningKey(t);return lS(r)?r.rsaPublicKey:r.publicKey}async function Sl(e,t,r,n){let i=ni.default.decode(e,{complete:!0});if(!i||typeof i==="string")return{validationError:Error("Cannot parse JWT token")};let s=i.header.kid;if(!s)return{validationError:Error("JWT header is missing 'kid' claim")};let o=await fS(t,s);if(o instanceof Error)return{validationError:o};let c={audience:n,issuer:r,ignoreExpiration:!1};return new Promise((u)=>ni.default.verify(e,o,c,(a)=>a?u({validationError:a}):u(void 0)))}function gr(e){let r=e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/");return JSON.parse(Buffer.from(r,"base64").toString())}function hS(e){if(!e.cookie)return{};return e.cookie.reduce((r,n)=>({...r,...it(n.value)}),{})}function pe(e,t){if(t.toLowerCase().indexOf("domain")===-1)return`${t}; Domain=.${e}`;return t}function wl(e,t){let r=hS(e);if(!r)return{};let n=`CognitoIdentityServiceProvider.${t}`,i=r[`${n}.LastAuthUser`];return{tokenUserName:i,idToken:r[`${n}.${i??""}.idToken`],accessToken:r[`${n}.${i??""}.accessToken`],refreshToken:r[`${n}.${i??""}.refreshToken`],scopes:r[`${n}.${i??""}.tokenScopesString`],nonce:r["spa-auth-edge-nonce"],nonceHmac:r["spa-auth-edge-nonce-hmac"],pkce:r["spa-auth-edge-pkce"]}}function Bv(e){let t=gr(e.tokens.idToken),r=t["cognito:username"],n=`CognitoIdentityServiceProvider.${e.clientId}`,i=`${n}.${r}.idToken`,s=`${n}.${r}.accessToken`,o=`${n}.${r}.refreshToken`,c=`${n}.LastAuthUser`,u=`${n}.${r}.tokenScopesString`,a=e.oauthScopes.join(" "),l=`${n}.${r}.userData`,f=JSON.stringify({UserAttributes:[{Name:"sub",Value:t.sub},{Name:"email",Value:t.email}],Username:r}),g={[i]:`${e.tokens.idToken}; ${pe(e.domainName,e.cookieSettings.idToken)}`,[s]:`${e.tokens.accessToken}; ${pe(e.domainName,e.cookieSettings.accessToken)}`,[o]:`${e.tokens.refreshToken}; ${pe(e.domainName,e.cookieSettings.refreshToken)}`,[c]:`${r}; ${pe(e.domainName,e.cookieSettings.idToken)}`,[u]:`${a}; ${pe(e.domainName,e.cookieSettings.accessToken)}`,[l]:`${encodeURIComponent(f)}; ${pe(e.domainName,e.cookieSettings.idToken)}`,"amplify-signin-with-hostedUI":`true; ${pe(e.domainName,e.cookieSettings.accessToken)}`};if(e.event==="signOut")Object.keys(g).forEach((h)=>g[h]=ii(g[h]));else if(e.event==="refreshFailed")g[o]=ii(g[o]);return["spa-auth-edge-nonce","spa-auth-edge-nonce-hmac","spa-auth-edge-pkce"].forEach((h)=>{g[h]=ii(g[h])}),Object.entries(g).map(([h,m])=>`${h}=${m}`)}function ii(e=""){let t=e.split(";").map((n)=>n.trim()).filter((n)=>!n.toLowerCase().startsWith("max-age")).filter((n)=>!n.toLowerCase().startsWith("expires")),r=`Expires=${new Date(0).toUTCString()}`;return["",...t.slice(1),r].join("; ")}var mr=require("node:crypto");function dS(e,t){let r=Number.parseInt(e.slice(0,e.indexOf("T")),10);if(Number.isNaN(r))return{clientError:"Invalid nonce"};if(bl()-r>t)return{clientError:`Nonce is too old (nonce is from ${new Date(r*1000).toISOString()})`}}function Gv(e,t,r){let n=dS(e,r.nonceMaxAge);if(n)return n;let i=yr(e,r);if(i!==t)return{clientError:`Nonce signature mismatch! Expected ${i} but got ${t}`}}function si(){let e=mr.randomBytes(16).toString("hex");return`${bl()}T${e}`}function yr(e,t){return mr.createHmac("sha256",t.nonceSigningSecret).update(e).digest("hex")}function bl(){return Date.now()/1000|0}var pS=yi(async(e,t)=>{let r=t.Records[0].cf.request,n=r.headers.host[0].value,i=`${r.uri}${r.querystring?`?${r.querystring}`:""}`,{idToken:s,refreshToken:o,nonce:c,nonceHmac:u}=wl(r.headers,e.clientId);if(e.logger.debug("Extracted cookies:",{idToken:s,refreshToken:o,nonce:c,nonceHmac:u}),!s)return vl({config:e,domainName:n,requestedUri:i});let a=gr(s),{exp:l}=a;if(e.logger.debug("ID token exp:",l,new Date(l*1000).toISOString()),Date.now()/1000>l-600&&o)return gS({config:e,domainName:n,requestedUri:i});e.logger.info("Validating JWT");let f=await Sl(s,e.tokenJwksUri,e.tokenIssuer,e.clientId);if(f!==void 0)return e.logger.debug("ID token not valid:",f.validationError),vl({config:e,domainName:n,requestedUri:i});if(e.logger.info("JWT is valid"),!Tl(e,a))return gi({title:"Not authorized",statusCode:"403",message:"You are not authorized for this resource.",details:"Your sign in was successful, but your user is not allowed to access this resource.",linkHref:`https://${n}${e.signOutPath}`,linkText:"Sign out"});return r});function Tl(e,t){if(e.requireGroupAnyOf){let r=t["cognito:groups"]||[];if(!e.requireGroupAnyOf.some((n)=>r.includes(n)))return!1}return!0}function gS({config:e,domainName:t,requestedUri:r}){e.logger.info("Redirecting to refresh endpoint");let n=si(),i=new URLSearchParams({requestedUri:r,nonce:n}).toString();return Tr(`https://${t}${e.refreshAuthPath}?${i}`,{cookies:[`spa-auth-edge-nonce=${encodeURIComponent(n)}; ${e.cookieSettings.nonce}`,`spa-auth-edge-nonce-hmac=${encodeURIComponent(yr(n,e))}; ${e.cookieSettings.nonce}`]})}function vl({config:e,domainName:t,requestedUri:r}){let n=si(),i={nonce:n,nonceHmac:yr(n,e),...mS(e)};e.logger.debug("Using new state:",i);let s=new URLSearchParams({redirect_uri:`https://${t}${e.callbackPath}`,response_type:"code",client_id:e.clientId,state:wr(Buffer.from(JSON.stringify({nonce:i.nonce,requestedUri:r})).toString("base64")),scope:e.oauthScopes.join(" "),code_challenge_method:"S256",code_challenge:i.pkceHash}).toString();return Tr(`https://${e.cognitoAuthDomain}/oauth2/authorize?${s}`,{cookies:[`spa-auth-edge-nonce=${encodeURIComponent(i.nonce)}; ${e.cookieSettings.nonce}`,`spa-auth-edge-nonce-hmac=${encodeURIComponent(i.nonceHmac)}; ${e.cookieSettings.nonce}`,`spa-auth-edge-pkce=${encodeURIComponent(i.pkce)}; ${e.cookieSettings.nonce}`]})}function mS(e){let t=Er.randomBytes(26).toString("hex"),r={pkce:t,pkceHash:wr(Er.createHash("sha256").update(t,"utf8").digest("base64"))};return e.logger.debug("Generated PKCE verifier:",r),r}
30
+ `;var di=require("node:fs"),ut=Ir(require("node:path"),1),gi=require("node:url");var Ml=(()=>{let e=function(){};return e.prototype=Object.create(null),e})();function ct(e,t){let r=new Ml,n=e.length;if(n<2)return r;let i=t?.decode||Vl,s=0;do{let o=zl(e,s,n);if(o===n)break;let c=Hl(e,s,n);if(o>c){s=e.lastIndexOf(";",o-1)+1;continue}let u=pi(e,s,o);if(r[u]===void 0)r[u]=i(pi(e,o+1,c));s=c+1}while(s<n);return r}function Hl(e,t,r){let n=e.indexOf(";",t);return n===-1?r:n}function zl(e,t,r){let n=e.indexOf("=",t);return n===-1?r:n}function pi(e,t,r){if(t===r)return"";let n=t,i=r;do{let s=e.charCodeAt(n);if(s!==32&&s!==9)break}while(++n<i);while(i>n){let s=e.charCodeAt(i-1);if(s!==32&&s!==9)break;i--}return e.slice(n,i)}function Vl(e){if(e.indexOf("%")===-1)return e;try{return decodeURIComponent(e)}catch(t){return e}}var ye={none:0,error:10,warn:20,info:30,debug:40};class Rr{logLevel;constructor(e){this.logLevel=e}jsonify(e){return e.map((t)=>{if(typeof t==="object")try{return JSON.stringify(t)}catch{return t}return t})}info(...e){if(this.logLevel>=ye.info)console.log(...this.jsonify(e))}warn(...e){if(this.logLevel>=ye.warn)console.warn(...this.jsonify(e))}error(...e){if(this.logLevel>=ye.error)console.error(...this.jsonify(e))}debug(...e){if(this.logLevel>=ye.debug)console.trace(...this.jsonify(e))}}var Xl=gi.fileURLToPath("file:///home/runner/work/cdk-cloudfront-auth/cdk-cloudfront-auth/src/handlers/util/config.ts"),Yl=ut.dirname(Xl);function xr(){let t=process.env.LAMBDA_TASK_ROOT||Yl,r=ut.join(t,"config.json");console.log("Loading config from",r);let n=JSON.parse(di.readFileSync(r,"utf-8")),s=`https://cognito-idp.${/^(\S+?)_\S+$/.exec(n.userPoolId)[1]}.amazonaws.com/${n.userPoolId}`,o=`${s}/.well-known/jwks.json`;return{nonceMaxAge:Number.parseInt(ct(n.cookieSettings.nonce.toLowerCase())["max-age"]??"",10)||86400,...n,tokenIssuer:s,tokenJwksUri:o,logger:new Rr(ye[n.logLevel])}}function Zl(e){return Object.entries(e).reduce((t,[r,n])=>Object.assign(t,{[r.toLowerCase()]:[{key:r,value:n}]}),{})}function _r(e,t){let r=t?.cookies?{"set-cookie":t.cookies.map((n)=>({key:"set-cookie",value:n}))}:{};return{status:"307",statusDescription:"Temporary Redirect",headers:{location:[{key:"location",value:e}],...r}}}function mi(e){return{body:Ql(e),status:e.statusCode??"500",headers:{"content-type":[{key:"Content-Type",value:"text/html; charset=UTF-8"}]}}}function Ql(e){let t={...e,region:process.env.AWS_REGION};return hi.replace(/\${([^}]*)}/g,(r,n)=>t[n]||"")}function yi(e,t){if(!t)throw Error("Expected response value");return{...t,headers:{...t.headers??{},...Zl(e.httpHeaders)}}}function Ei(e){let t;return async(r)=>{if(!t)t=xr();t.logger.debug("Handling event:",r);let n=yi(t,await e(t,r));return t.logger.debug("Returning response:",n),n}}function Tw(e){let t;return async(r)=>{if(!t)t=xr();t.logger.debug("Handling event:",r);let n=yi(t,await e(t,r));return t.logger.debug("Returning response:",n),n}}var oi=Ir(Qa(),1),Ol=Ir(_l(),1),si;function iw(e){return"rsaPublicKey"in e}async function sw(e,t){if(!si)si=Ol.default({cache:!0,rateLimit:!0,jwksUri:e});let r=await si.getSigningKey(t);return iw(r)?r.rsaPublicKey:r.publicKey}async function kl(e,t,r,n){let i=oi.default.decode(e,{complete:!0});if(!i||typeof i==="string")return{validationError:Error("Cannot parse JWT token")};let s=i.header.kid;if(!s)return{validationError:Error("JWT header is missing 'kid' claim")};let o=await sw(t,s);if(o instanceof Error)return{validationError:o};let c={audience:n,issuer:r,ignoreExpiration:!1};return new Promise((u)=>oi.default.verify(e,o,c,(a)=>a?u({validationError:a}):u(void 0)))}function Sr(e){let r=e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/");return JSON.parse(Buffer.from(r,"base64").toString())}function ow(e){if(!e.cookie)return{};return e.cookie.reduce((r,n)=>({...r,...ct(n.value)}),{})}function me(e,t){if(t.toLowerCase().indexOf("domain")===-1)return`${t}; Domain=.${e}`;return t}function $l(e,t){let r=ow(e);if(!r)return{};let n=`CognitoIdentityServiceProvider.${t}`,i=r[`${n}.LastAuthUser`];return{tokenUserName:i,idToken:r[`${n}.${i??""}.idToken`],accessToken:r[`${n}.${i??""}.accessToken`],refreshToken:r[`${n}.${i??""}.refreshToken`],scopes:r[`${n}.${i??""}.tokenScopesString`],nonce:r["spa-auth-edge-nonce"],nonceHmac:r["spa-auth-edge-nonce-hmac"],pkce:r["spa-auth-edge-pkce"]}}function Av(e){let t=Sr(e.tokens.idToken),r=t["cognito:username"],n=`CognitoIdentityServiceProvider.${e.clientId}`,i=`${n}.${r}.idToken`,s=`${n}.${r}.accessToken`,o=`${n}.${r}.refreshToken`,c=`${n}.LastAuthUser`,u=`${n}.${r}.tokenScopesString`,a=e.oauthScopes.join(" "),l=`${n}.${r}.userData`,f=JSON.stringify({UserAttributes:[{Name:"sub",Value:t.sub},{Name:"email",Value:t.email}],Username:r}),g={[i]:`${e.tokens.idToken}; ${me(e.domainName,e.cookieSettings.idToken)}`,[s]:`${e.tokens.accessToken}; ${me(e.domainName,e.cookieSettings.accessToken)}`,[o]:`${e.tokens.refreshToken}; ${me(e.domainName,e.cookieSettings.refreshToken)}`,[c]:`${r}; ${me(e.domainName,e.cookieSettings.idToken)}`,[u]:`${a}; ${me(e.domainName,e.cookieSettings.accessToken)}`,[l]:`${encodeURIComponent(f)}; ${me(e.domainName,e.cookieSettings.idToken)}`,"amplify-signin-with-hostedUI":`true; ${me(e.domainName,e.cookieSettings.accessToken)}`};if(e.event==="signOut")Object.keys(g).forEach((h)=>g[h]=ai(g[h]));else if(e.event==="refreshFailed")g[o]=ai(g[o]);return["spa-auth-edge-nonce","spa-auth-edge-nonce-hmac","spa-auth-edge-pkce"].forEach((h)=>{g[h]=ai(g[h])}),Object.entries(g).map(([h,m])=>`${h}=${m}`)}function ai(e=""){let t=e.split(";").map((n)=>n.trim()).filter((n)=>!n.toLowerCase().startsWith("max-age")).filter((n)=>!n.toLowerCase().startsWith("expires")),r=`Expires=${new Date(0).toUTCString()}`;return["",...t.slice(1),r].join("; ")}var br=require("node:crypto");function aw(e,t){let r=Number.parseInt(e.slice(0,e.indexOf("T")),10);if(Number.isNaN(r))return{clientError:"Invalid nonce"};if(Ll()-r>t)return{clientError:`Nonce is too old (nonce is from ${new Date(r*1000).toISOString()})`}}function Cv(e,t,r){let n=aw(e,r.nonceMaxAge);if(n)return n;let i=vr(e,r);if(i!==t)return{clientError:`Nonce signature mismatch! Expected ${i} but got ${t}`}}function ci(){let e=br.randomBytes(16).toString("hex");return`${Ll()}T${e}`}function vr(e,t){return br.createHmac("sha256",t.nonceSigningSecret).update(e).digest("hex")}function Ll(){return Date.now()/1000|0}var cw=Ei(async(e,t)=>{let r=t.Records[0].cf.request,n=r.headers.host[0].value,i=`${r.uri}${r.querystring?`?${r.querystring}`:""}`,{idToken:s,refreshToken:o,nonce:c,nonceHmac:u}=$l(r.headers,e.clientId);if(e.logger.debug("Extracted cookies:",{idToken:s,refreshToken:o,nonce:c,nonceHmac:u}),!s)return Pl({config:e,domainName:n,requestedUri:i});let a=Sr(s),{exp:l}=a;if(e.logger.debug("ID token exp:",l,new Date(l*1000).toISOString()),Date.now()/1000>l-600&&o)return uw({config:e,domainName:n,requestedUri:i});e.logger.info("Validating JWT");let f=await kl(s,e.tokenJwksUri,e.tokenIssuer,e.clientId);if(f!==void 0)return e.logger.debug("ID token not valid:",f.validationError),Pl({config:e,domainName:n,requestedUri:i});if(e.logger.info("JWT is valid"),!Nl(e,a))return mi({title:"Not authorized",statusCode:"403",message:"You are not authorized for this resource.",details:"Your sign in was successful, but your user is not allowed to access this resource.",linkHref:`https://${n}${e.signOutPath}`,linkText:"Sign out"});return r});function Nl(e,t){if(e.requireGroupAnyOf){let r=t["cognito:groups"]||[];if(!e.requireGroupAnyOf.some((n)=>r.includes(n)))return!1}return!0}function uw({config:e,domainName:t,requestedUri:r}){e.logger.info("Redirecting to refresh endpoint");let n=ci(),i=new URLSearchParams({requestedUri:r,nonce:n}).toString();return _r(`https://${t}${e.refreshAuthPath}?${i}`,{cookies:[`spa-auth-edge-nonce=${encodeURIComponent(n)}; ${e.cookieSettings.nonce}`,`spa-auth-edge-nonce-hmac=${encodeURIComponent(vr(n,e))}; ${e.cookieSettings.nonce}`]})}function Pl({config:e,domainName:t,requestedUri:r}){let n=ci(),i={nonce:n,nonceHmac:vr(n,e),...lw(e)};e.logger.debug("Using new state:",i);let s=new URLSearchParams({redirect_uri:`https://${t}${e.callbackPath}`,response_type:"code",client_id:e.clientId,state:Cr(Buffer.from(JSON.stringify({nonce:i.nonce,requestedUri:r})).toString("base64")),scope:e.oauthScopes.join(" "),code_challenge_method:"S256",code_challenge:i.pkceHash}).toString();return _r(`https://${e.cognitoAuthDomain}/oauth2/authorize?${s}`,{cookies:[`spa-auth-edge-nonce=${encodeURIComponent(i.nonce)}; ${e.cookieSettings.nonce}`,`spa-auth-edge-nonce-hmac=${encodeURIComponent(i.nonceHmac)}; ${e.cookieSettings.nonce}`,`spa-auth-edge-pkce=${encodeURIComponent(i.pkce)}; ${e.cookieSettings.nonce}`]})}function lw(e){let t=Tr.randomBytes(26).toString("hex"),r={pkce:t,pkceHash:Cr(Tr.createHash("sha256").update(t,"utf8").digest("base64"))};return e.logger.debug("Generated PKCE verifier:",r),r}