@ymys/directus-extension-sso 2.0.8 → 2.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +1 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  import{createRequire as e}from"module";import"node:crypto";import r from"buffer";import t from"stream";import n from"util";import o from"crypto";var s={exports:{}};
2
- /*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */!function(e,t){var n=r,o=n.Buffer;function s(e,r){for(var t in e)r[t]=e[t]}function i(e,r,t){return o(e,r,t)}o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?e.exports=n:(s(n,t),t.Buffer=i),i.prototype=Object.create(o.prototype),s(o,i),i.from=function(e,r,t){if("number"==typeof e)throw new TypeError("Argument must not be a number");return o(e,r,t)},i.alloc=function(e,r,t){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=o(e);return void 0!==r?"string"==typeof t?n.fill(r,t):n.fill(r):n.fill(0),n},i.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return o(e)},i.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}}(s,s.exports);var i=s.exports,a=i.Buffer,c=t;function l(e){if(this.buffer=null,this.writable=!0,this.readable=!0,!e)return this.buffer=a.alloc(0),this;if("function"==typeof e.pipe)return this.buffer=a.alloc(0),e.pipe(this),this;if(e.length||"object"==typeof e)return this.buffer=e,this.writable=!1,process.nextTick(function(){this.emit("end",e),this.readable=!1,this.emit("close")}.bind(this)),this;throw new TypeError("Unexpected data type ("+typeof e+")")}n.inherits(l,c),l.prototype.write=function(e){this.buffer=a.concat([this.buffer,a.from(e)]),this.emit("data",e)},l.prototype.end=function(e){e&&this.write(e),this.emit("end",e),this.emit("close"),this.writable=!1,this.readable=!1};var u=l;function h(e){return(e/8|0)+(e%8==0?0:1)}var f={ES256:h(256),ES384:h(384),ES512:h(521)};var p=function(e){var r=f[e];if(r)return r;throw new Error('Unknown algorithm "'+e+'"')},E=i.Buffer,m=p,d=128;function v(e){if(E.isBuffer(e))return e;if("string"==typeof e)return E.from(e,"base64");throw new TypeError("ECDSA signature must be a Base64 string or a Buffer")}function g(e,r,t){for(var n=0;r+n<t&&0===e[r+n];)++n;return e[r+n]>=d&&--n,n}var y,$,S={derToJose:function(e,r){e=v(e);var t=m(r),n=t+1,o=e.length,s=0;if(48!==e[s++])throw new Error('Could not find expected "seq"');var i=e[s++];if(129===i&&(i=e[s++]),o-s<i)throw new Error('"seq" specified length of "'+i+'", only "'+(o-s)+'" remaining');if(2!==e[s++])throw new Error('Could not find expected "int" for "r"');var a=e[s++];if(o-s-2<a)throw new Error('"r" specified length of "'+a+'", only "'+(o-s-2)+'" available');if(n<a)throw new Error('"r" specified length of "'+a+'", max of "'+n+'" is acceptable');var c=s;if(s+=a,2!==e[s++])throw new Error('Could not find expected "int" for "s"');var l=e[s++];if(o-s!==l)throw new Error('"s" specified length of "'+l+'", expected "'+(o-s)+'"');if(n<l)throw new Error('"s" specified length of "'+l+'", max of "'+n+'" is acceptable');var u=s;if((s+=l)!==o)throw new Error('Expected to consume entire buffer, but "'+(o-s)+'" bytes remain');var h=t-a,f=t-l,p=E.allocUnsafe(h+a+f+l);for(s=0;s<h;++s)p[s]=0;e.copy(p,s,c+Math.max(-h,0),c+a);for(var d=s=t;s<d+f;++s)p[s]=0;return e.copy(p,s,u+Math.max(-f,0),u+l),p=(p=p.toString("base64")).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")},joseToDer:function(e,r){e=v(e);var t=m(r),n=e.length;if(n!==2*t)throw new TypeError('"'+r+'" signatures must be "'+2*t+'" bytes, saw "'+n+'"');var o=g(e,0,t),s=g(e,t,e.length),i=t-o,a=t-s,c=2+i+1+1+a,l=c<d,u=E.allocUnsafe((l?2:3)+c),h=0;return u[h++]=48,l?u[h++]=c:(u[h++]=129,u[h++]=255&c),u[h++]=2,u[h++]=i,o<0?(u[h++]=0,h+=e.copy(u,h,0,t)):h+=e.copy(u,h,o,t),u[h++]=2,u[h++]=a,s<0?(u[h++]=0,e.copy(u,h,t)):e.copy(u,h,t+s),u}};var R,I=i.Buffer,w=o,O=S,A=n,b="secret must be a string or buffer",L="key must be a string or a buffer",N="function"==typeof w.createPublicKey;function T(e){if(!I.isBuffer(e)&&"string"!=typeof e){if(!N)throw j(L);if("object"!=typeof e)throw j(L);if("string"!=typeof e.type)throw j(L);if("string"!=typeof e.asymmetricKeyType)throw j(L);if("function"!=typeof e.export)throw j(L)}}function P(e){if(!I.isBuffer(e)&&"string"!=typeof e&&"object"!=typeof e)throw j("key must be a string, a buffer or an object")}function _(e){return e.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function C(e){var r=4-(e=e.toString()).length%4;if(4!==r)for(var t=0;t<r;++t)e+="=";return e.replace(/\-/g,"+").replace(/_/g,"/")}function j(e){var r=[].slice.call(arguments,1),t=A.format.bind(A,e).apply(null,r);return new TypeError(t)}function k(e){var r;return r=e,I.isBuffer(r)||"string"==typeof r||(e=JSON.stringify(e)),e}function D(e){return function(r,t){!function(e){if(!I.isBuffer(e)){if("string"==typeof e)return e;if(!N)throw j(b);if("object"!=typeof e)throw j(b);if("secret"!==e.type)throw j(b);if("function"!=typeof e.export)throw j(b)}}(t),r=k(r);var n=w.createHmac("sha"+e,t);return _((n.update(r),n.digest("base64")))}}N&&(L+=" or a KeyObject",b+="or a KeyObject");var M="timingSafeEqual"in w?function(e,r){return e.byteLength===r.byteLength&&w.timingSafeEqual(e,r)}:function(e,t){return R||(R=function(){if($)return y;$=1;var e=r.Buffer,t=r.SlowBuffer;function n(r,t){if(!e.isBuffer(r)||!e.isBuffer(t))return!1;if(r.length!==t.length)return!1;for(var n=0,o=0;o<r.length;o++)n|=r[o]^t[o];return 0===n}y=n,n.install=function(){e.prototype.equal=t.prototype.equal=function(e){return n(this,e)}};var o=e.prototype.equal,s=t.prototype.equal;return n.restore=function(){e.prototype.equal=o,t.prototype.equal=s},y}()),R(e,t)};function G(e){return function(r,t,n){var o=D(e)(r,n);return M(I.from(t),I.from(o))}}function F(e){return function(r,t){P(t),r=k(r);var n=w.createSign("RSA-SHA"+e);return _((n.update(r),n.sign(t,"base64")))}}function x(e){return function(r,t,n){T(n),r=k(r),t=C(t);var o=w.createVerify("RSA-SHA"+e);return o.update(r),o.verify(n,t,"base64")}}function U(e){return function(r,t){P(t),r=k(r);var n=w.createSign("RSA-SHA"+e);return _((n.update(r),n.sign({key:t,padding:w.constants.RSA_PKCS1_PSS_PADDING,saltLength:w.constants.RSA_PSS_SALTLEN_DIGEST},"base64")))}}function B(e){return function(r,t,n){T(n),r=k(r),t=C(t);var o=w.createVerify("RSA-SHA"+e);return o.update(r),o.verify({key:n,padding:w.constants.RSA_PKCS1_PSS_PADDING,saltLength:w.constants.RSA_PSS_SALTLEN_DIGEST},t,"base64")}}function X(e){var r=F(e);return function(){var t=r.apply(null,arguments);return t=O.derToJose(t,"ES"+e)}}function H(e){var r=x(e);return function(t,n,o){return n=O.joseToDer(n,"ES"+e).toString("base64"),r(t,n,o)}}function q(){return function(){return""}}function K(){return function(e,r){return""===r}}var V=function(e){var r={hs:D,rs:F,ps:U,es:X,none:q},t={hs:G,rs:x,ps:B,es:H,none:K},n=e.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/);if(!n)throw j('"%s" is not a valid algorithm.\n Supported algorithms are:\n "HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".',e);var o=(n[1]||n[3]).toLowerCase(),s=n[2];return{sign:r[o](s),verify:t[o](s)}},z=r.Buffer,W=function(e){return"string"==typeof e?e:"number"==typeof e||z.isBuffer(e)?e.toString():JSON.stringify(e)},Y=i.Buffer,J=u,Z=V,Q=t,ee=W,re=n;function te(e,r){return Y.from(e,r).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function ne(e){var r=e.header,t=e.payload,n=e.secret||e.privateKey,o=e.encoding,s=Z(r.alg),i=function(e,r,t){t=t||"utf8";var n=te(ee(e),"binary"),o=te(ee(r),t);return re.format("%s.%s",n,o)}(r,t,o),a=s.sign(i,n);return re.format("%s.%s",i,a)}function oe(e){var r=e.secret;if(r=null==(r=null==r?e.privateKey:r)?e.key:r,!0===/^hs/i.test(e.header.alg)&&null==r)throw new TypeError("secret must be a string or buffer or a KeyObject");var t=new J(r);this.readable=!0,this.header=e.header,this.encoding=e.encoding,this.secret=this.privateKey=this.key=t,this.payload=new J(e.payload),this.secret.once("close",function(){!this.payload.writable&&this.readable&&this.sign()}.bind(this)),this.payload.once("close",function(){!this.secret.writable&&this.readable&&this.sign()}.bind(this))}re.inherits(oe,Q),oe.prototype.sign=function(){try{var e=ne({header:this.header,payload:this.payload.buffer,secret:this.secret.buffer,encoding:this.encoding});return this.emit("done",e),this.emit("data",e),this.emit("end"),this.readable=!1,e}catch(e){this.readable=!1,this.emit("error",e),this.emit("close")}},oe.sign=ne;var se=oe,ie=i.Buffer,ae=u,ce=V,le=t,ue=W,he=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function fe(e){if(function(e){return"[object Object]"===Object.prototype.toString.call(e)}(e))return e;try{return JSON.parse(e)}catch(e){return}}function pe(e){var r=e.split(".",1)[0];return fe(ie.from(r,"base64").toString("binary"))}function Ee(e){return e.split(".")[2]}function me(e){return he.test(e)&&!!pe(e)}function de(e,r,t){if(!r){var n=new Error("Missing algorithm parameter for jws.verify");throw n.code="MISSING_ALGORITHM",n}var o=Ee(e=ue(e)),s=function(e){return e.split(".",2).join(".")}(e);return ce(r).verify(s,o,t)}function ve(e,r){if(r=r||{},!me(e=ue(e)))return null;var t=pe(e);if(!t)return null;var n=function(e,r){r=r||"utf8";var t=e.split(".")[1];return ie.from(t,"base64").toString(r)}(e);return("JWT"===t.typ||r.json)&&(n=JSON.parse(n,r.encoding)),{header:t,payload:n,signature:Ee(e)}}function ge(e){var r=(e=e||{}).secret;if(r=null==(r=null==r?e.publicKey:r)?e.key:r,!0===/^hs/i.test(e.algorithm)&&null==r)throw new TypeError("secret must be a string or buffer or a KeyObject");var t=new ae(r);this.readable=!0,this.algorithm=e.algorithm,this.encoding=e.encoding,this.secret=this.publicKey=this.key=t,this.signature=new ae(e.signature),this.secret.once("close",function(){!this.signature.writable&&this.readable&&this.verify()}.bind(this)),this.signature.once("close",function(){!this.secret.writable&&this.readable&&this.verify()}.bind(this))}n.inherits(ge,le),ge.prototype.verify=function(){try{var e=de(this.signature.buffer,this.algorithm,this.key.buffer),r=ve(this.signature.buffer,this.encoding);return this.emit("done",e,r),this.emit("data",e),this.emit("end"),this.readable=!1,e}catch(e){this.readable=!1,this.emit("error",e),this.emit("close")}},ge.decode=ve,ge.isValid=me,ge.verify=de;var ye=ge;se.sign,ye.verify,ye.decode,ye.isValid;var $e=function(e,r){Error.call(this,e),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name="JsonWebTokenError",this.message=e,r&&(this.inner=r)};($e.prototype=Object.create(Error.prototype)).constructor=$e;var Se=$e,Re=Se,Ie=function(e,r){Re.call(this,e),this.name="NotBeforeError",this.date=r};(Ie.prototype=Object.create(Re.prototype)).constructor=Ie;var we=Se,Oe=function(e,r){we.call(this,e),this.name="TokenExpiredError",this.expiredAt=r};(Oe.prototype=Object.create(we.prototype)).constructor=Oe;var Ae={exports:{}};var be={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2};var Le="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};!function(e,r){const{MAX_SAFE_COMPONENT_LENGTH:t,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:o}=be,s=Le,i=(r=e.exports={}).re=[],a=r.safeRe=[],c=r.src=[],l=r.safeSrc=[],u=r.t={};let h=0;const f="[a-zA-Z0-9-]",p=[["\\s",1],["\\d",o],[f,n]],E=(e,r,t)=>{const n=(e=>{for(const[r,t]of p)e=e.split(`${r}*`).join(`${r}{0,${t}}`).split(`${r}+`).join(`${r}{1,${t}}`);return e})(r),o=h++;s(e,o,r),u[e]=o,c[o]=r,l[o]=n,i[o]=new RegExp(r,t?"g":void 0),a[o]=new RegExp(n,t?"g":void 0)};E("NUMERICIDENTIFIER","0|[1-9]\\d*"),E("NUMERICIDENTIFIERLOOSE","\\d+"),E("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${f}*`),E("MAINVERSION",`(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})`),E("MAINVERSIONLOOSE",`(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})`),E("PRERELEASEIDENTIFIER",`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIER]})`),E("PRERELEASEIDENTIFIERLOOSE",`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIERLOOSE]})`),E("PRERELEASE",`(?:-(${c[u.PRERELEASEIDENTIFIER]}(?:\\.${c[u.PRERELEASEIDENTIFIER]})*))`),E("PRERELEASELOOSE",`(?:-?(${c[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[u.PRERELEASEIDENTIFIERLOOSE]})*))`),E("BUILDIDENTIFIER",`${f}+`),E("BUILD",`(?:\\+(${c[u.BUILDIDENTIFIER]}(?:\\.${c[u.BUILDIDENTIFIER]})*))`),E("FULLPLAIN",`v?${c[u.MAINVERSION]}${c[u.PRERELEASE]}?${c[u.BUILD]}?`),E("FULL",`^${c[u.FULLPLAIN]}$`),E("LOOSEPLAIN",`[v=\\s]*${c[u.MAINVERSIONLOOSE]}${c[u.PRERELEASELOOSE]}?${c[u.BUILD]}?`),E("LOOSE",`^${c[u.LOOSEPLAIN]}$`),E("GTLT","((?:<|>)?=?)"),E("XRANGEIDENTIFIERLOOSE",`${c[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),E("XRANGEIDENTIFIER",`${c[u.NUMERICIDENTIFIER]}|x|X|\\*`),E("XRANGEPLAIN",`[v=\\s]*(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:${c[u.PRERELEASE]})?${c[u.BUILD]}?)?)?`),E("XRANGEPLAINLOOSE",`[v=\\s]*(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:${c[u.PRERELEASELOOSE]})?${c[u.BUILD]}?)?)?`),E("XRANGE",`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAIN]}$`),E("XRANGELOOSE",`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAINLOOSE]}$`),E("COERCEPLAIN",`(^|[^\\d])(\\d{1,${t}})(?:\\.(\\d{1,${t}}))?(?:\\.(\\d{1,${t}}))?`),E("COERCE",`${c[u.COERCEPLAIN]}(?:$|[^\\d])`),E("COERCEFULL",c[u.COERCEPLAIN]+`(?:${c[u.PRERELEASE]})?`+`(?:${c[u.BUILD]})?(?:$|[^\\d])`),E("COERCERTL",c[u.COERCE],!0),E("COERCERTLFULL",c[u.COERCEFULL],!0),E("LONETILDE","(?:~>?)"),E("TILDETRIM",`(\\s*)${c[u.LONETILDE]}\\s+`,!0),r.tildeTrimReplace="$1~",E("TILDE",`^${c[u.LONETILDE]}${c[u.XRANGEPLAIN]}$`),E("TILDELOOSE",`^${c[u.LONETILDE]}${c[u.XRANGEPLAINLOOSE]}$`),E("LONECARET","(?:\\^)"),E("CARETTRIM",`(\\s*)${c[u.LONECARET]}\\s+`,!0),r.caretTrimReplace="$1^",E("CARET",`^${c[u.LONECARET]}${c[u.XRANGEPLAIN]}$`),E("CARETLOOSE",`^${c[u.LONECARET]}${c[u.XRANGEPLAINLOOSE]}$`),E("COMPARATORLOOSE",`^${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]})$|^$`),E("COMPARATOR",`^${c[u.GTLT]}\\s*(${c[u.FULLPLAIN]})$|^$`),E("COMPARATORTRIM",`(\\s*)${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]}|${c[u.XRANGEPLAIN]})`,!0),r.comparatorTrimReplace="$1$2$3",E("HYPHENRANGE",`^\\s*(${c[u.XRANGEPLAIN]})\\s+-\\s+(${c[u.XRANGEPLAIN]})\\s*$`),E("HYPHENRANGELOOSE",`^\\s*(${c[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[u.XRANGEPLAINLOOSE]})\\s*$`),E("STAR","(<|>)?=?\\s*\\*"),E("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),E("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(Ae,Ae.exports);var Ne=Ae.exports;const Te=Object.freeze({loose:!0}),Pe=Object.freeze({});var _e=e=>e?"object"!=typeof e?Te:e:Pe;const Ce=/^[0-9]+$/,je=(e,r)=>{if("number"==typeof e&&"number"==typeof r)return e===r?0:e<r?-1:1;const t=Ce.test(e),n=Ce.test(r);return t&&n&&(e=+e,r=+r),e===r?0:t&&!n?-1:n&&!t?1:e<r?-1:1};var ke={compareIdentifiers:je,rcompareIdentifiers:(e,r)=>je(r,e)};const De=Le,{MAX_LENGTH:Me,MAX_SAFE_INTEGER:Ge}=be,{safeRe:Fe,t:xe}=Ne,Ue=_e,{compareIdentifiers:Be}=ke;var Xe=class e{constructor(r,t){if(t=Ue(t),r instanceof e){if(r.loose===!!t.loose&&r.includePrerelease===!!t.includePrerelease)return r;r=r.version}else if("string"!=typeof r)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof r}".`);if(r.length>Me)throw new TypeError(`version is longer than ${Me} characters`);De("SemVer",r,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;const n=r.trim().match(t.loose?Fe[xe.LOOSE]:Fe[xe.FULL]);if(!n)throw new TypeError(`Invalid Version: ${r}`);if(this.raw=r,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>Ge||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Ge||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Ge||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(e=>{if(/^[0-9]+$/.test(e)){const r=+e;if(r>=0&&r<Ge)return r}return e}):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(r){if(De("SemVer.compare",this.version,this.options,r),!(r instanceof e)){if("string"==typeof r&&r===this.version)return 0;r=new e(r,this.options)}return r.version===this.version?0:this.compareMain(r)||this.comparePre(r)}compareMain(r){return r instanceof e||(r=new e(r,this.options)),this.major<r.major?-1:this.major>r.major?1:this.minor<r.minor?-1:this.minor>r.minor?1:this.patch<r.patch?-1:this.patch>r.patch?1:0}comparePre(r){if(r instanceof e||(r=new e(r,this.options)),this.prerelease.length&&!r.prerelease.length)return-1;if(!this.prerelease.length&&r.prerelease.length)return 1;if(!this.prerelease.length&&!r.prerelease.length)return 0;let t=0;do{const e=this.prerelease[t],n=r.prerelease[t];if(De("prerelease compare",t,e,n),void 0===e&&void 0===n)return 0;if(void 0===n)return 1;if(void 0===e)return-1;if(e!==n)return Be(e,n)}while(++t)}compareBuild(r){r instanceof e||(r=new e(r,this.options));let t=0;do{const e=this.build[t],n=r.build[t];if(De("build compare",t,e,n),void 0===e&&void 0===n)return 0;if(void 0===n)return 1;if(void 0===e)return-1;if(e!==n)return Be(e,n)}while(++t)}inc(e,r,t){if(e.startsWith("pre")){if(!r&&!1===t)throw new Error("invalid increment argument: identifier is empty");if(r){const e=`-${r}`.match(this.options.loose?Fe[xe.PRERELEASELOOSE]:Fe[xe.PRERELEASE]);if(!e||e[1]!==r)throw new Error(`invalid identifier: ${r}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,t);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,t);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,t),this.inc("pre",r,t);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",r,t),this.inc("pre",r,t);break;case"release":if(0===this.prerelease.length)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{const e=Number(t)?1:0;if(0===this.prerelease.length)this.prerelease=[e];else{let n=this.prerelease.length;for(;--n>=0;)"number"==typeof this.prerelease[n]&&(this.prerelease[n]++,n=-2);if(-1===n){if(r===this.prerelease.join(".")&&!1===t)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(r){let n=[r,e];!1===t&&(n=[r]),0===Be(this.prerelease[0],r)?isNaN(this.prerelease[1])&&(this.prerelease=n):this.prerelease=n}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};const He=Xe;var qe=(e,r,t=!1)=>{if(e instanceof He)return e;try{return new He(e,r)}catch(e){if(!t)return null;throw e}};const Ke=qe;var Ve=(e,r)=>{const t=Ke(e,r);return t?t.version:null};const ze=qe;var We=(e,r)=>{const t=ze(e.trim().replace(/^[=v]+/,""),r);return t?t.version:null};const Ye=Xe;var Je=(e,r,t,n,o)=>{"string"==typeof t&&(o=n,n=t,t=void 0);try{return new Ye(e instanceof Ye?e.version:e,t).inc(r,n,o).version}catch(e){return null}};const Ze=qe;var Qe=(e,r)=>{const t=Ze(e,null,!0),n=Ze(r,null,!0),o=t.compare(n);if(0===o)return null;const s=o>0,i=s?t:n,a=s?n:t,c=!!i.prerelease.length;if(!!a.prerelease.length&&!c){if(!a.patch&&!a.minor)return"major";if(0===a.compareMain(i))return a.minor&&!a.patch?"minor":"patch"}const l=c?"pre":"";return t.major!==n.major?l+"major":t.minor!==n.minor?l+"minor":t.patch!==n.patch?l+"patch":"prerelease"};const er=Xe;var rr=(e,r)=>new er(e,r).major;const tr=Xe;var nr=(e,r)=>new tr(e,r).minor;const or=Xe;var sr=(e,r)=>new or(e,r).patch;const ir=qe;var ar=(e,r)=>{const t=ir(e,r);return t&&t.prerelease.length?t.prerelease:null};const cr=Xe;var lr=(e,r,t)=>new cr(e,t).compare(new cr(r,t));const ur=lr;var hr=(e,r,t)=>ur(r,e,t);const fr=lr;var pr=(e,r)=>fr(e,r,!0);const Er=Xe;var mr=(e,r,t)=>{const n=new Er(e,t),o=new Er(r,t);return n.compare(o)||n.compareBuild(o)};const dr=mr;var vr=(e,r)=>e.sort((e,t)=>dr(e,t,r));const gr=mr;var yr=(e,r)=>e.sort((e,t)=>gr(t,e,r));const $r=lr;var Sr=(e,r,t)=>$r(e,r,t)>0;const Rr=lr;var Ir=(e,r,t)=>Rr(e,r,t)<0;const wr=lr;var Or=(e,r,t)=>0===wr(e,r,t);const Ar=lr;var br=(e,r,t)=>0!==Ar(e,r,t);const Lr=lr;var Nr=(e,r,t)=>Lr(e,r,t)>=0;const Tr=lr;var Pr=(e,r,t)=>Tr(e,r,t)<=0;const _r=Or,Cr=br,jr=Sr,kr=Nr,Dr=Ir,Mr=Pr;var Gr=(e,r,t,n)=>{switch(r){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof t&&(t=t.version),e===t;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof t&&(t=t.version),e!==t;case"":case"=":case"==":return _r(e,t,n);case"!=":return Cr(e,t,n);case">":return jr(e,t,n);case">=":return kr(e,t,n);case"<":return Dr(e,t,n);case"<=":return Mr(e,t,n);default:throw new TypeError(`Invalid operator: ${r}`)}};const Fr=Xe,xr=qe,{safeRe:Ur,t:Br}=Ne;var Xr=(e,r)=>{if(e instanceof Fr)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let t=null;if((r=r||{}).rtl){const n=r.includePrerelease?Ur[Br.COERCERTLFULL]:Ur[Br.COERCERTL];let o;for(;(o=n.exec(e))&&(!t||t.index+t[0].length!==e.length);)t&&o.index+o[0].length===t.index+t[0].length||(t=o),n.lastIndex=o.index+o[1].length+o[2].length;n.lastIndex=-1}else t=e.match(r.includePrerelease?Ur[Br.COERCEFULL]:Ur[Br.COERCE]);if(null===t)return null;const n=t[2],o=t[3]||"0",s=t[4]||"0",i=r.includePrerelease&&t[5]?`-${t[5]}`:"",a=r.includePrerelease&&t[6]?`+${t[6]}`:"";return xr(`${n}.${o}.${s}${i}${a}`,r)};var Hr,qr,Kr,Vr,zr=class{constructor(){this.max=1e3,this.map=new Map}get(e){const r=this.map.get(e);return void 0===r?void 0:(this.map.delete(e),this.map.set(e,r),r)}delete(e){return this.map.delete(e)}set(e,r){if(!this.delete(e)&&void 0!==r){if(this.map.size>=this.max){const e=this.map.keys().next().value;this.delete(e)}this.map.set(e,r)}return this}};function Wr(){if(qr)return Hr;qr=1;const e=/\s+/g;class r{constructor(t,s){if(s=n(s),t instanceof r)return t.loose===!!s.loose&&t.includePrerelease===!!s.includePrerelease?t:new r(t.raw,s);if(t instanceof o)return this.raw=t.value,this.set=[[t]],this.formatted=void 0,this;if(this.options=s,this.loose=!!s.loose,this.includePrerelease=!!s.includePrerelease,this.raw=t.trim().replace(e," "),this.set=this.raw.split("||").map(e=>this.parseRange(e.trim())).filter(e=>e.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter(e=>!E(e[0])),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&m(e[0])){this.set=[e];break}}this.formatted=void 0}get range(){if(void 0===this.formatted){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");const r=this.set[e];for(let e=0;e<r.length;e++)e>0&&(this.formatted+=" "),this.formatted+=r[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){const r=((this.options.includePrerelease&&f)|(this.options.loose&&p))+":"+e,n=t.get(r);if(n)return n;const i=this.options.loose,m=i?a[c.HYPHENRANGELOOSE]:a[c.HYPHENRANGE];e=e.replace(m,b(this.options.includePrerelease)),s("hyphen replace",e),e=e.replace(a[c.COMPARATORTRIM],l),s("comparator trim",e),e=e.replace(a[c.TILDETRIM],u),s("tilde trim",e),e=e.replace(a[c.CARETTRIM],h),s("caret trim",e);let d=e.split(" ").map(e=>v(e,this.options)).join(" ").split(/\s+/).map(e=>A(e,this.options));i&&(d=d.filter(e=>(s("loose invalid filter",e,this.options),!!e.match(a[c.COMPARATORLOOSE])))),s("range list",d);const g=new Map,y=d.map(e=>new o(e,this.options));for(const e of y){if(E(e))return[e];g.set(e.value,e)}g.size>1&&g.has("")&&g.delete("");const $=[...g.values()];return t.set(r,$),$}intersects(e,t){if(!(e instanceof r))throw new TypeError("a Range is required");return this.set.some(r=>d(r,t)&&e.set.some(e=>d(e,t)&&r.every(r=>e.every(e=>r.intersects(e,t)))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new i(e,this.options)}catch(e){return!1}for(let r=0;r<this.set.length;r++)if(L(this.set[r],e,this.options))return!0;return!1}}Hr=r;const t=new zr,n=_e,o=Yr(),s=Le,i=Xe,{safeRe:a,t:c,comparatorTrimReplace:l,tildeTrimReplace:u,caretTrimReplace:h}=Ne,{FLAG_INCLUDE_PRERELEASE:f,FLAG_LOOSE:p}=be,E=e=>"<0.0.0-0"===e.value,m=e=>""===e.value,d=(e,r)=>{let t=!0;const n=e.slice();let o=n.pop();for(;t&&n.length;)t=n.every(e=>o.intersects(e,r)),o=n.pop();return t},v=(e,r)=>(e=e.replace(a[c.BUILD],""),s("comp",e,r),e=S(e,r),s("caret",e),e=y(e,r),s("tildes",e),e=I(e,r),s("xrange",e),e=O(e,r),s("stars",e),e),g=e=>!e||"x"===e.toLowerCase()||"*"===e,y=(e,r)=>e.trim().split(/\s+/).map(e=>$(e,r)).join(" "),$=(e,r)=>{const t=r.loose?a[c.TILDELOOSE]:a[c.TILDE];return e.replace(t,(r,t,n,o,i)=>{let a;return s("tilde",e,r,t,n,o,i),g(t)?a="":g(n)?a=`>=${t}.0.0 <${+t+1}.0.0-0`:g(o)?a=`>=${t}.${n}.0 <${t}.${+n+1}.0-0`:i?(s("replaceTilde pr",i),a=`>=${t}.${n}.${o}-${i} <${t}.${+n+1}.0-0`):a=`>=${t}.${n}.${o} <${t}.${+n+1}.0-0`,s("tilde return",a),a})},S=(e,r)=>e.trim().split(/\s+/).map(e=>R(e,r)).join(" "),R=(e,r)=>{s("caret",e,r);const t=r.loose?a[c.CARETLOOSE]:a[c.CARET],n=r.includePrerelease?"-0":"";return e.replace(t,(r,t,o,i,a)=>{let c;return s("caret",e,r,t,o,i,a),g(t)?c="":g(o)?c=`>=${t}.0.0${n} <${+t+1}.0.0-0`:g(i)?c="0"===t?`>=${t}.${o}.0${n} <${t}.${+o+1}.0-0`:`>=${t}.${o}.0${n} <${+t+1}.0.0-0`:a?(s("replaceCaret pr",a),c="0"===t?"0"===o?`>=${t}.${o}.${i}-${a} <${t}.${o}.${+i+1}-0`:`>=${t}.${o}.${i}-${a} <${t}.${+o+1}.0-0`:`>=${t}.${o}.${i}-${a} <${+t+1}.0.0-0`):(s("no pr"),c="0"===t?"0"===o?`>=${t}.${o}.${i}${n} <${t}.${o}.${+i+1}-0`:`>=${t}.${o}.${i}${n} <${t}.${+o+1}.0-0`:`>=${t}.${o}.${i} <${+t+1}.0.0-0`),s("caret return",c),c})},I=(e,r)=>(s("replaceXRanges",e,r),e.split(/\s+/).map(e=>w(e,r)).join(" ")),w=(e,r)=>{e=e.trim();const t=r.loose?a[c.XRANGELOOSE]:a[c.XRANGE];return e.replace(t,(t,n,o,i,a,c)=>{s("xRange",e,t,n,o,i,a,c);const l=g(o),u=l||g(i),h=u||g(a),f=h;return"="===n&&f&&(n=""),c=r.includePrerelease?"-0":"",l?t=">"===n||"<"===n?"<0.0.0-0":"*":n&&f?(u&&(i=0),a=0,">"===n?(n=">=",u?(o=+o+1,i=0,a=0):(i=+i+1,a=0)):"<="===n&&(n="<",u?o=+o+1:i=+i+1),"<"===n&&(c="-0"),t=`${n+o}.${i}.${a}${c}`):u?t=`>=${o}.0.0${c} <${+o+1}.0.0-0`:h&&(t=`>=${o}.${i}.0${c} <${o}.${+i+1}.0-0`),s("xRange return",t),t})},O=(e,r)=>(s("replaceStars",e,r),e.trim().replace(a[c.STAR],"")),A=(e,r)=>(s("replaceGTE0",e,r),e.trim().replace(a[r.includePrerelease?c.GTE0PRE:c.GTE0],"")),b=e=>(r,t,n,o,s,i,a,c,l,u,h,f)=>`${t=g(n)?"":g(o)?`>=${n}.0.0${e?"-0":""}`:g(s)?`>=${n}.${o}.0${e?"-0":""}`:i?`>=${t}`:`>=${t}${e?"-0":""}`} ${c=g(l)?"":g(u)?`<${+l+1}.0.0-0`:g(h)?`<${l}.${+u+1}.0-0`:f?`<=${l}.${u}.${h}-${f}`:e?`<${l}.${u}.${+h+1}-0`:`<=${c}`}`.trim(),L=(e,r,t)=>{for(let t=0;t<e.length;t++)if(!e[t].test(r))return!1;if(r.prerelease.length&&!t.includePrerelease){for(let t=0;t<e.length;t++)if(s(e[t].semver),e[t].semver!==o.ANY&&e[t].semver.prerelease.length>0){const n=e[t].semver;if(n.major===r.major&&n.minor===r.minor&&n.patch===r.patch)return!0}return!1}return!0};return Hr}function Yr(){if(Vr)return Kr;Vr=1;const e=Symbol("SemVer ANY");class r{static get ANY(){return e}constructor(n,o){if(o=t(o),n instanceof r){if(n.loose===!!o.loose)return n;n=n.value}n=n.trim().split(/\s+/).join(" "),i("comparator",n,o),this.options=o,this.loose=!!o.loose,this.parse(n),this.semver===e?this.value="":this.value=this.operator+this.semver.version,i("comp",this)}parse(r){const t=this.options.loose?n[o.COMPARATORLOOSE]:n[o.COMPARATOR],s=r.match(t);if(!s)throw new TypeError(`Invalid comparator: ${r}`);this.operator=void 0!==s[1]?s[1]:"","="===this.operator&&(this.operator=""),s[2]?this.semver=new a(s[2],this.options.loose):this.semver=e}toString(){return this.value}test(r){if(i("Comparator.test",r,this.options.loose),this.semver===e||r===e)return!0;if("string"==typeof r)try{r=new a(r,this.options)}catch(e){return!1}return s(r,this.operator,this.semver,this.options)}intersects(e,n){if(!(e instanceof r))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new c(e.value,n).test(this.value):""===e.operator?""===e.value||new c(this.value,n).test(e.semver):(!(n=t(n)).includePrerelease||"<0.0.0-0"!==this.value&&"<0.0.0-0"!==e.value)&&(!(!n.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0")))&&(!(!this.operator.startsWith(">")||!e.operator.startsWith(">"))||(!(!this.operator.startsWith("<")||!e.operator.startsWith("<"))||(!(this.semver.version!==e.semver.version||!this.operator.includes("=")||!e.operator.includes("="))||(!!(s(this.semver,"<",e.semver,n)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))||!!(s(this.semver,">",e.semver,n)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))))))}}Kr=r;const t=_e,{safeRe:n,t:o}=Ne,s=Gr,i=Le,a=Xe,c=Wr();return Kr}const Jr=Wr();var Zr=(e,r,t)=>{try{r=new Jr(r,t)}catch(e){return!1}return r.test(e)};const Qr=Wr();var et=(e,r)=>new Qr(e,r).set.map(e=>e.map(e=>e.value).join(" ").trim().split(" "));const rt=Xe,tt=Wr();var nt=(e,r,t)=>{let n=null,o=null,s=null;try{s=new tt(r,t)}catch(e){return null}return e.forEach(e=>{s.test(e)&&(n&&-1!==o.compare(e)||(n=e,o=new rt(n,t)))}),n};const ot=Xe,st=Wr();var it=(e,r,t)=>{let n=null,o=null,s=null;try{s=new st(r,t)}catch(e){return null}return e.forEach(e=>{s.test(e)&&(n&&1!==o.compare(e)||(n=e,o=new ot(n,t)))}),n};const at=Xe,ct=Wr(),lt=Sr;var ut=(e,r)=>{e=new ct(e,r);let t=new at("0.0.0");if(e.test(t))return t;if(t=new at("0.0.0-0"),e.test(t))return t;t=null;for(let r=0;r<e.set.length;++r){const n=e.set[r];let o=null;n.forEach(e=>{const r=new at(e.semver.version);switch(e.operator){case">":0===r.prerelease.length?r.patch++:r.prerelease.push(0),r.raw=r.format();case"":case">=":o&&!lt(r,o)||(o=r);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${e.operator}`)}}),!o||t&&!lt(t,o)||(t=o)}return t&&e.test(t)?t:null};const ht=Wr();var ft=(e,r)=>{try{return new ht(e,r).range||"*"}catch(e){return null}};const pt=Xe,Et=Yr(),{ANY:mt}=Et,dt=Wr(),vt=Zr,gt=Sr,yt=Ir,$t=Pr,St=Nr;var Rt=(e,r,t,n)=>{let o,s,i,a,c;switch(e=new pt(e,n),r=new dt(r,n),t){case">":o=gt,s=$t,i=yt,a=">",c=">=";break;case"<":o=yt,s=St,i=gt,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(vt(e,r,n))return!1;for(let t=0;t<r.set.length;++t){const l=r.set[t];let u=null,h=null;if(l.forEach(e=>{e.semver===mt&&(e=new Et(">=0.0.0")),u=u||e,h=h||e,o(e.semver,u.semver,n)?u=e:i(e.semver,h.semver,n)&&(h=e)}),u.operator===a||u.operator===c)return!1;if((!h.operator||h.operator===a)&&s(e,h.semver))return!1;if(h.operator===c&&i(e,h.semver))return!1}return!0};const It=Rt;var wt=(e,r,t)=>It(e,r,">",t);const Ot=Rt;var At=(e,r,t)=>Ot(e,r,"<",t);const bt=Wr();var Lt=(e,r,t)=>(e=new bt(e,t),r=new bt(r,t),e.intersects(r,t));const Nt=Zr,Tt=lr;const Pt=Wr(),_t=Yr(),{ANY:Ct}=_t,jt=Zr,kt=lr,Dt=[new _t(">=0.0.0-0")],Mt=[new _t(">=0.0.0")],Gt=(e,r,t)=>{if(e===r)return!0;if(1===e.length&&e[0].semver===Ct){if(1===r.length&&r[0].semver===Ct)return!0;e=t.includePrerelease?Dt:Mt}if(1===r.length&&r[0].semver===Ct){if(t.includePrerelease)return!0;r=Mt}const n=new Set;let o,s,i,a,c,l,u;for(const r of e)">"===r.operator||">="===r.operator?o=Ft(o,r,t):"<"===r.operator||"<="===r.operator?s=xt(s,r,t):n.add(r.semver);if(n.size>1)return null;if(o&&s){if(i=kt(o.semver,s.semver,t),i>0)return null;if(0===i&&(">="!==o.operator||"<="!==s.operator))return null}for(const e of n){if(o&&!jt(e,String(o),t))return null;if(s&&!jt(e,String(s),t))return null;for(const n of r)if(!jt(e,String(n),t))return!1;return!0}let h=!(!s||t.includePrerelease||!s.semver.prerelease.length)&&s.semver,f=!(!o||t.includePrerelease||!o.semver.prerelease.length)&&o.semver;h&&1===h.prerelease.length&&"<"===s.operator&&0===h.prerelease[0]&&(h=!1);for(const e of r){if(u=u||">"===e.operator||">="===e.operator,l=l||"<"===e.operator||"<="===e.operator,o)if(f&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===f.major&&e.semver.minor===f.minor&&e.semver.patch===f.patch&&(f=!1),">"===e.operator||">="===e.operator){if(a=Ft(o,e,t),a===e&&a!==o)return!1}else if(">="===o.operator&&!jt(o.semver,String(e),t))return!1;if(s)if(h&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===h.major&&e.semver.minor===h.minor&&e.semver.patch===h.patch&&(h=!1),"<"===e.operator||"<="===e.operator){if(c=xt(s,e,t),c===e&&c!==s)return!1}else if("<="===s.operator&&!jt(s.semver,String(e),t))return!1;if(!e.operator&&(s||o)&&0!==i)return!1}return!(o&&l&&!s&&0!==i)&&(!(s&&u&&!o&&0!==i)&&(!f&&!h))},Ft=(e,r,t)=>{if(!e)return r;const n=kt(e.semver,r.semver,t);return n>0?e:n<0||">"===r.operator&&">="===e.operator?r:e},xt=(e,r,t)=>{if(!e)return r;const n=kt(e.semver,r.semver,t);return n<0?e:n>0||"<"===r.operator&&"<="===e.operator?r:e};var Ut=(e,r,t={})=>{if(e===r)return!0;e=new Pt(e,t),r=new Pt(r,t);let n=!1;e:for(const o of e.set){for(const e of r.set){const r=Gt(o,e,t);if(n=n||null!==r,r)continue e}if(n)return!1}return!0};const Bt=Ne,Xt=be,Ht=Xe,qt=ke,Kt=(e,r,t)=>{const n=[];let o=null,s=null;const i=e.sort((e,r)=>Tt(e,r,t));for(const e of i){Nt(e,r,t)?(s=e,o||(o=e)):(s&&n.push([o,s]),s=null,o=null)}o&&n.push([o,null]);const a=[];for(const[e,r]of n)e===r?a.push(e):r||e!==i[0]?r?e===i[0]?a.push(`<=${r}`):a.push(`${e} - ${r}`):a.push(`>=${e}`):a.push("*");const c=a.join(" || "),l="string"==typeof r.raw?r.raw:String(r);return c.length<l.length?c:r};var Vt={parse:qe,valid:Ve,clean:We,inc:Je,diff:Qe,major:rr,minor:nr,patch:sr,prerelease:ar,compare:lr,rcompare:hr,compareLoose:pr,compareBuild:mr,sort:vr,rsort:yr,gt:Sr,lt:Ir,eq:Or,neq:br,gte:Nr,lte:Pr,cmp:Gr,coerce:Xr,Comparator:Yr(),Range:Wr(),satisfies:Zr,toComparators:et,maxSatisfying:nt,minSatisfying:it,minVersion:ut,validRange:ft,outside:Rt,gtr:wt,ltr:At,intersects:Lt,simplifyRange:Kt,subset:Ut,SemVer:Ht,re:Bt.re,src:Bt.src,tokens:Bt.t,SEMVER_SPEC_VERSION:Xt.SEMVER_SPEC_VERSION,RELEASE_TYPES:Xt.RELEASE_TYPES,compareIdentifiers:qt.compareIdentifiers,rcompareIdentifiers:qt.rcompareIdentifiers};Vt.satisfies(process.version,">=15.7.0");Vt.satisfies(process.version,">=16.9.0");var zt=Vt.satisfies(process.version,"^6.12.0 || >=8.0.0"),Wt=1/0,Yt=9007199254740991,Jt=17976931348623157e292,Zt=NaN,Qt="[object Arguments]",en="[object Function]",rn="[object GeneratorFunction]",tn="[object String]",nn="[object Symbol]",on=/^\s+|\s+$/g,sn=/^[-+]0x[0-9a-f]+$/i,an=/^0b[01]+$/i,cn=/^0o[0-7]+$/i,ln=/^(?:0|[1-9]\d*)$/,un=parseInt;function hn(e){return e!=e}function fn(e,r){return function(e,r){for(var t=-1,n=e?e.length:0,o=Array(n);++t<n;)o[t]=r(e[t],t,e);return o}(r,function(r){return e[r]})}var pn,En,mn=Object.prototype,dn=mn.hasOwnProperty,vn=mn.toString,gn=mn.propertyIsEnumerable,yn=(pn=Object.keys,En=Object,function(e){return pn(En(e))}),$n=Math.max;function Sn(e,r){var t=wn(e)||function(e){return function(e){return bn(e)&&On(e)}(e)&&dn.call(e,"callee")&&(!gn.call(e,"callee")||vn.call(e)==Qt)}(e)?function(e,r){for(var t=-1,n=Array(e);++t<e;)n[t]=r(t);return n}(e.length,String):[],n=t.length,o=!!n;for(var s in e)!r&&!dn.call(e,s)||o&&("length"==s||In(s,n))||t.push(s);return t}function Rn(e){if(t=(r=e)&&r.constructor,n="function"==typeof t&&t.prototype||mn,r!==n)return yn(e);var r,t,n,o=[];for(var s in Object(e))dn.call(e,s)&&"constructor"!=s&&o.push(s);return o}function In(e,r){return!!(r=null==r?Yt:r)&&("number"==typeof e||ln.test(e))&&e>-1&&e%1==0&&e<r}var wn=Array.isArray;function On(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=Yt}(e.length)&&!function(e){var r=An(e)?vn.call(e):"";return r==en||r==rn}(e)}function An(e){var r=typeof e;return!!e&&("object"==r||"function"==r)}function bn(e){return!!e&&"object"==typeof e}var Ln=function(e,r,t,n){var o;e=On(e)?e:(o=e)?fn(o,function(e){return On(e)?Sn(e):Rn(e)}(o)):[],t=t&&!n?function(e){var r=function(e){if(!e)return 0===e?e:0;if(e=function(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||bn(e)&&vn.call(e)==nn}(e))return Zt;if(An(e)){var r="function"==typeof e.valueOf?e.valueOf():e;e=An(r)?r+"":r}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(on,"");var t=an.test(e);return t||cn.test(e)?un(e.slice(2),t?2:8):sn.test(e)?Zt:+e}(e),e===Wt||e===-1/0){return(e<0?-1:1)*Jt}return e==e?e:0}(e),t=r%1;return r==r?t?r-t:r:0}(t):0;var s=e.length;return t<0&&(t=$n(s+t,0)),function(e){return"string"==typeof e||!wn(e)&&bn(e)&&vn.call(e)==tn}(e)?t<=s&&e.indexOf(r,t)>-1:!!s&&function(e,r,t){if(r!=r)return function(e,r,t,n){for(var o=e.length,s=t+(n?1:-1);n?s--:++s<o;)if(r(e[s],s,e))return s;return-1}(e,hn,t);for(var n=t-1,o=e.length;++n<o;)if(e[n]===r)return n;return-1}(e,r,t)>-1};Object.prototype.toString;parseInt,Object.prototype.toString;var Nn=Function.prototype,Tn=Object.prototype,Pn=Nn.toString;Tn.hasOwnProperty,Pn.call(Object),Tn.toString,Object.getPrototypeOf;Object.prototype.toString,Array.isArray;const _n=Ln,Cn=["RS256","RS384","RS512","ES256","ES384","ES512","HS256","HS384","HS512","none"];zt&&Cn.splice(3,0,"PS256","PS384","PS512"),_n.bind(null,Cn);const jn=e(import.meta.url),{version:kn}=jn("../package.json");var Dn={id:"sso",handler:(e,r)=>{const{env:t,logger:n,services:o,database:s,getSchema:i}=r,a=t.KEYCLOAK_URL||"http://keycloak:8080",c=t.KEYCLOAK_REALM||"testing",l=t.KEYCLOAK_ADMIN_USER||"admin",u=t.KEYCLOAK_ADMIN_PASSWORD||"admin",h=t.PUBLIC_URL||"http://localhost:8055",f=(t.MOBILE_APP_SCHEME||"finsnapp").split(",").map(e=>e.trim()),p=f[0],E=t.MOBILE_APP_CALLBACK_PATH||"/auth/callback",m=t.GOOGLE_CALLBACK_PATH||"/auth/callback/google",d=t.KEYCLOAK_CLIENT_ID||"admin-cli",v=t.COOKIE_DOMAIN||null,g="false"!==t.COOKIE_SECURE,y=t.COOKIE_SAME_SITE||"lax",$=t.SESSION_COOKIE_NAME||"directus_session_token",S=t.REFRESH_TOKEN_COOKIE_NAME||"directus_refresh_token";t.DEFAULT_ROLE_ID;const R="directus_session_token";function I(e){if("browser"===e.query.type)return!0;if("mobile"===e.query.type)return!1;if(e.query.app_scheme||e.query.app_path)return!1;const r=e.headers["user-agent"]||"";return/Mozilla|Chrome|Safari|Firefox|Edge|Opera/i.test(r)&&!/Mobile.*App|ReactNative|Expo/i.test(r)}async function w(e,r){const t=e.headers.cookie;if(!t)return null;const n=t.split(";").map(e=>e.trim()).filter(e=>e.startsWith(`${r}=`)).map(e=>e.substring(r.length+1));if(0===n.length)return null;for(let e=0;e<n.length;e++){const t=n[e];try{const e=await fetch(`${h}/users/me`,{headers:{Cookie:`${r}=${t}`}});if(e.ok){return{token:t,userData:(await e.json()).data}}}catch(e){}}return null}async function O(e){const r=e.headers.cookie;if(!r)return null;const t=r.split(";").map(e=>e.trim()).map(e=>{const r=e.split("=");return r.length>1?r[1]:null}).filter(e=>e&&e.startsWith("eyJ")&&e.length>50);if(0===t.length)return null;for(let e=0;e<t.length;e++){const r=t[e];try{const e=await fetch(`${h}/users/me`,{headers:{Authorization:`Bearer ${r}`}});if(e.ok){return{token:r,userData:(await e.json()).data}}}catch(e){}}return null}async function A(e){const r=e.cookies[S];if(!r)return null;try{const e=await fetch(`${h}/auth/refresh`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refresh_token:r})});if(e.ok){const r=(await e.json()).data.access_token,t=await fetch(`${h}/users/me`,{headers:{Authorization:`Bearer ${r}`}});if(t.ok){return{token:r,userData:(await t.json()).data}}}}catch(e){}return null}function b(e){const r=e.query.app_scheme;return r&&f.includes(r)?r:(r&&n.warn(`⚠️ Warning: App requested scheme '${r}', but it is not in .env. Falling back to '${p}'`),p)}n.info("🚀 Mobile Auth Proxy Extension loaded"),n.info("📱 Allowed Mobile App Schemes: "+f.join(", ")),n.info("🔵 Google OAuth enabled"),e.get("/health",(e,r)=>{r.json({status:"ok",service:"directus-extension-sso",version:kn,allowed_schemes:f})}),e.get("/mobile-callback",async(e,r)=>{const t=I(e);try{let n=null;if($!==R&&(n=await w(e,$)),n||(n=await w(e,R)),n||(n=await O(e)),n||(n=await A(e)),!n)return r.send("<html><body><h2>Authentication Failed</h2></body></html>");const{token:o,userData:s}=n,i=s.id,a=s.email,c=o;if(t){r.cookie($,o,{httpOnly:!0,secure:g,domain:v,sameSite:y,maxAge:6048e5,path:"/"}),$!==R&&r.cookie(R,"",{maxAge:0,path:"/"});let t=e.query.redirect_uri||e.query.redirect||"/";return r.redirect(t)}const l=b(e),u=`${l}://${(e.query.app_path||E).replace(/^\/+/,"")}?access_token=${c}&user_id=${i}&email=${encodeURIComponent(a||"")}`;return r.setHeader("Location",u),r.status(302).send(`<html><head><meta http-equiv="refresh" content="0;url=${u}"></head><body>Redirecting...</body></html>`)}catch(e){r.status(500).send(`<html><body><h2>Error</h2><p>${e.message}</p></body></html>`)}}),e.get("/google-callback",async(e,r)=>{const t=I(e);try{let o=null;if(e.query.access_token){o={token:e.query.access_token,refresh_token:e.query.refresh_token||null,expires:e.query.expires||null};try{const e=await fetch(`${h}/users/me`,{headers:{Authorization:`Bearer ${o.token}`}});if(e.ok){const r=await e.json();o.userData=r.data}else o=null}catch(e){o=null}}if(o||$===R||(o=await w(e,$)),o||(o=await w(e,R)),o||(o=await O(e)),o||(o=await A(e)),!o)return r.send("<html><body><h2>Authentication Failed</h2></body></html>");const{token:s,userData:i}=o,a=i.id,c=i.email,l=s;if(t){r.cookie($,s,{httpOnly:!0,secure:g,domain:v,sameSite:y,maxAge:6048e5,path:"/"}),$!==R&&r.cookie(R,"",{maxAge:0,path:"/"});let t=e.query.redirect_uri||e.query.redirect||"/";return r.send(`<html><head><meta http-equiv="refresh" content="2;url=${t}"></head><body>Login Successful!</body></html>`)}const u=b(e),f=e.query.app_path||m,p=new URL(`${u}://${f.replace(/^\/+/,"")}`);return p.searchParams.set("access_token",l),p.searchParams.set("user_id",a),p.searchParams.set("email",c||""),p.searchParams.set("provider","google"),n.info("🚀 Performing direct 302 redirect to app: "+p.toString()),r.redirect(302,p.toString())}catch(e){r.status(500).send(`<html><body><h2>Error</h2><p>${e.message}</p></body></html>`)}}),e.post("/mobile-logout",async(e,r)=>{try{const t=e.headers.authorization,o=t?.replace("Bearer ","");if(!o)return r.status(400).json({error:"No token provided"});let s=null;try{const e=await fetch(`${h}/users/me`,{headers:{Authorization:`Bearer ${o}`}});if(e.ok){s=(await e.json()).data.email}}catch(e){}try{await fetch(`${h}/auth/logout`,{method:"POST",headers:{Authorization:`Bearer ${o}`,"Content-Type":"application/json"},body:JSON.stringify({refresh_token:o})})}catch(e){}if(s)try{const e=await async function(){try{const e=await fetch(`${a}/realms/master/protocol/openid-connect/token`,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({grant_type:"password",client_id:d,username:l,password:u}).toString()});if(!e.ok)throw new Error("Failed to get admin token");return(await e.json()).access_token}catch(e){return n.error("Error getting admin token:",e),null}}();if(e){const r=await async function(e,r){try{const t=await fetch(`${a}/admin/realms/${c}/users?email=${encodeURIComponent(r)}`,{headers:{Authorization:`Bearer ${e}`}});if(!t.ok)throw new Error("Failed to get user");const n=await t.json();return n.length>0?n[0].id:null}catch(e){return n.error("Error getting user ID:",e),null}}(e,s);r&&await async function(e,r){try{const t=await fetch(`${a}/admin/realms/${c}/users/${r}/logout`,{method:"POST",headers:{Authorization:`Bearer ${e}`}});return t.ok||204===t.status}catch(e){return n.error("Error logging out user from Keycloak:",e),!1}}(e,r)}}catch(e){}r.json({success:!0,message:"Logged out successfully"})}catch(e){r.status(500).json({error:e.message})}}),e.post("/apple-token",async(e,r)=>{}),e.get("/bridge",async(e,r)=>{})}};export{Dn as default};
2
+ /*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */!function(e,t){var n=r,o=n.Buffer;function s(e,r){for(var t in e)r[t]=e[t]}function i(e,r,t){return o(e,r,t)}o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?e.exports=n:(s(n,t),t.Buffer=i),i.prototype=Object.create(o.prototype),s(o,i),i.from=function(e,r,t){if("number"==typeof e)throw new TypeError("Argument must not be a number");return o(e,r,t)},i.alloc=function(e,r,t){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=o(e);return void 0!==r?"string"==typeof t?n.fill(r,t):n.fill(r):n.fill(0),n},i.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return o(e)},i.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}}(s,s.exports);var i=s.exports,a=i.Buffer,c=t;function l(e){if(this.buffer=null,this.writable=!0,this.readable=!0,!e)return this.buffer=a.alloc(0),this;if("function"==typeof e.pipe)return this.buffer=a.alloc(0),e.pipe(this),this;if(e.length||"object"==typeof e)return this.buffer=e,this.writable=!1,process.nextTick(function(){this.emit("end",e),this.readable=!1,this.emit("close")}.bind(this)),this;throw new TypeError("Unexpected data type ("+typeof e+")")}n.inherits(l,c),l.prototype.write=function(e){this.buffer=a.concat([this.buffer,a.from(e)]),this.emit("data",e)},l.prototype.end=function(e){e&&this.write(e),this.emit("end",e),this.emit("close"),this.writable=!1,this.readable=!1};var u=l;function h(e){return(e/8|0)+(e%8==0?0:1)}var f={ES256:h(256),ES384:h(384),ES512:h(521)};var p=function(e){var r=f[e];if(r)return r;throw new Error('Unknown algorithm "'+e+'"')},E=i.Buffer,m=p,d=128;function v(e){if(E.isBuffer(e))return e;if("string"==typeof e)return E.from(e,"base64");throw new TypeError("ECDSA signature must be a Base64 string or a Buffer")}function g(e,r,t){for(var n=0;r+n<t&&0===e[r+n];)++n;return e[r+n]>=d&&--n,n}var y,$,S={derToJose:function(e,r){e=v(e);var t=m(r),n=t+1,o=e.length,s=0;if(48!==e[s++])throw new Error('Could not find expected "seq"');var i=e[s++];if(129===i&&(i=e[s++]),o-s<i)throw new Error('"seq" specified length of "'+i+'", only "'+(o-s)+'" remaining');if(2!==e[s++])throw new Error('Could not find expected "int" for "r"');var a=e[s++];if(o-s-2<a)throw new Error('"r" specified length of "'+a+'", only "'+(o-s-2)+'" available');if(n<a)throw new Error('"r" specified length of "'+a+'", max of "'+n+'" is acceptable');var c=s;if(s+=a,2!==e[s++])throw new Error('Could not find expected "int" for "s"');var l=e[s++];if(o-s!==l)throw new Error('"s" specified length of "'+l+'", expected "'+(o-s)+'"');if(n<l)throw new Error('"s" specified length of "'+l+'", max of "'+n+'" is acceptable');var u=s;if((s+=l)!==o)throw new Error('Expected to consume entire buffer, but "'+(o-s)+'" bytes remain');var h=t-a,f=t-l,p=E.allocUnsafe(h+a+f+l);for(s=0;s<h;++s)p[s]=0;e.copy(p,s,c+Math.max(-h,0),c+a);for(var d=s=t;s<d+f;++s)p[s]=0;return e.copy(p,s,u+Math.max(-f,0),u+l),p=(p=p.toString("base64")).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")},joseToDer:function(e,r){e=v(e);var t=m(r),n=e.length;if(n!==2*t)throw new TypeError('"'+r+'" signatures must be "'+2*t+'" bytes, saw "'+n+'"');var o=g(e,0,t),s=g(e,t,e.length),i=t-o,a=t-s,c=2+i+1+1+a,l=c<d,u=E.allocUnsafe((l?2:3)+c),h=0;return u[h++]=48,l?u[h++]=c:(u[h++]=129,u[h++]=255&c),u[h++]=2,u[h++]=i,o<0?(u[h++]=0,h+=e.copy(u,h,0,t)):h+=e.copy(u,h,o,t),u[h++]=2,u[h++]=a,s<0?(u[h++]=0,e.copy(u,h,t)):e.copy(u,h,t+s),u}};var R,I=i.Buffer,w=o,A=S,O=n,b="secret must be a string or buffer",L="key must be a string or a buffer",N="function"==typeof w.createPublicKey;function T(e){if(!I.isBuffer(e)&&"string"!=typeof e){if(!N)throw j(L);if("object"!=typeof e)throw j(L);if("string"!=typeof e.type)throw j(L);if("string"!=typeof e.asymmetricKeyType)throw j(L);if("function"!=typeof e.export)throw j(L)}}function P(e){if(!I.isBuffer(e)&&"string"!=typeof e&&"object"!=typeof e)throw j("key must be a string, a buffer or an object")}function _(e){return e.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function C(e){var r=4-(e=e.toString()).length%4;if(4!==r)for(var t=0;t<r;++t)e+="=";return e.replace(/\-/g,"+").replace(/_/g,"/")}function j(e){var r=[].slice.call(arguments,1),t=O.format.bind(O,e).apply(null,r);return new TypeError(t)}function k(e){var r;return r=e,I.isBuffer(r)||"string"==typeof r||(e=JSON.stringify(e)),e}function D(e){return function(r,t){!function(e){if(!I.isBuffer(e)){if("string"==typeof e)return e;if(!N)throw j(b);if("object"!=typeof e)throw j(b);if("secret"!==e.type)throw j(b);if("function"!=typeof e.export)throw j(b)}}(t),r=k(r);var n=w.createHmac("sha"+e,t);return _((n.update(r),n.digest("base64")))}}N&&(L+=" or a KeyObject",b+="or a KeyObject");var M="timingSafeEqual"in w?function(e,r){return e.byteLength===r.byteLength&&w.timingSafeEqual(e,r)}:function(e,t){return R||(R=function(){if($)return y;$=1;var e=r.Buffer,t=r.SlowBuffer;function n(r,t){if(!e.isBuffer(r)||!e.isBuffer(t))return!1;if(r.length!==t.length)return!1;for(var n=0,o=0;o<r.length;o++)n|=r[o]^t[o];return 0===n}y=n,n.install=function(){e.prototype.equal=t.prototype.equal=function(e){return n(this,e)}};var o=e.prototype.equal,s=t.prototype.equal;return n.restore=function(){e.prototype.equal=o,t.prototype.equal=s},y}()),R(e,t)};function G(e){return function(r,t,n){var o=D(e)(r,n);return M(I.from(t),I.from(o))}}function F(e){return function(r,t){P(t),r=k(r);var n=w.createSign("RSA-SHA"+e);return _((n.update(r),n.sign(t,"base64")))}}function x(e){return function(r,t,n){T(n),r=k(r),t=C(t);var o=w.createVerify("RSA-SHA"+e);return o.update(r),o.verify(n,t,"base64")}}function U(e){return function(r,t){P(t),r=k(r);var n=w.createSign("RSA-SHA"+e);return _((n.update(r),n.sign({key:t,padding:w.constants.RSA_PKCS1_PSS_PADDING,saltLength:w.constants.RSA_PSS_SALTLEN_DIGEST},"base64")))}}function B(e){return function(r,t,n){T(n),r=k(r),t=C(t);var o=w.createVerify("RSA-SHA"+e);return o.update(r),o.verify({key:n,padding:w.constants.RSA_PKCS1_PSS_PADDING,saltLength:w.constants.RSA_PSS_SALTLEN_DIGEST},t,"base64")}}function X(e){var r=F(e);return function(){var t=r.apply(null,arguments);return t=A.derToJose(t,"ES"+e)}}function H(e){var r=x(e);return function(t,n,o){return n=A.joseToDer(n,"ES"+e).toString("base64"),r(t,n,o)}}function q(){return function(){return""}}function K(){return function(e,r){return""===r}}var V=function(e){var r={hs:D,rs:F,ps:U,es:X,none:q},t={hs:G,rs:x,ps:B,es:H,none:K},n=e.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/);if(!n)throw j('"%s" is not a valid algorithm.\n Supported algorithms are:\n "HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".',e);var o=(n[1]||n[3]).toLowerCase(),s=n[2];return{sign:r[o](s),verify:t[o](s)}},z=r.Buffer,W=function(e){return"string"==typeof e?e:"number"==typeof e||z.isBuffer(e)?e.toString():JSON.stringify(e)},Y=i.Buffer,J=u,Z=V,Q=t,ee=W,re=n;function te(e,r){return Y.from(e,r).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function ne(e){var r=e.header,t=e.payload,n=e.secret||e.privateKey,o=e.encoding,s=Z(r.alg),i=function(e,r,t){t=t||"utf8";var n=te(ee(e),"binary"),o=te(ee(r),t);return re.format("%s.%s",n,o)}(r,t,o),a=s.sign(i,n);return re.format("%s.%s",i,a)}function oe(e){var r=e.secret;if(r=null==(r=null==r?e.privateKey:r)?e.key:r,!0===/^hs/i.test(e.header.alg)&&null==r)throw new TypeError("secret must be a string or buffer or a KeyObject");var t=new J(r);this.readable=!0,this.header=e.header,this.encoding=e.encoding,this.secret=this.privateKey=this.key=t,this.payload=new J(e.payload),this.secret.once("close",function(){!this.payload.writable&&this.readable&&this.sign()}.bind(this)),this.payload.once("close",function(){!this.secret.writable&&this.readable&&this.sign()}.bind(this))}re.inherits(oe,Q),oe.prototype.sign=function(){try{var e=ne({header:this.header,payload:this.payload.buffer,secret:this.secret.buffer,encoding:this.encoding});return this.emit("done",e),this.emit("data",e),this.emit("end"),this.readable=!1,e}catch(e){this.readable=!1,this.emit("error",e),this.emit("close")}},oe.sign=ne;var se=oe,ie=i.Buffer,ae=u,ce=V,le=t,ue=W,he=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function fe(e){if(function(e){return"[object Object]"===Object.prototype.toString.call(e)}(e))return e;try{return JSON.parse(e)}catch(e){return}}function pe(e){var r=e.split(".",1)[0];return fe(ie.from(r,"base64").toString("binary"))}function Ee(e){return e.split(".")[2]}function me(e){return he.test(e)&&!!pe(e)}function de(e,r,t){if(!r){var n=new Error("Missing algorithm parameter for jws.verify");throw n.code="MISSING_ALGORITHM",n}var o=Ee(e=ue(e)),s=function(e){return e.split(".",2).join(".")}(e);return ce(r).verify(s,o,t)}function ve(e,r){if(r=r||{},!me(e=ue(e)))return null;var t=pe(e);if(!t)return null;var n=function(e,r){r=r||"utf8";var t=e.split(".")[1];return ie.from(t,"base64").toString(r)}(e);return("JWT"===t.typ||r.json)&&(n=JSON.parse(n,r.encoding)),{header:t,payload:n,signature:Ee(e)}}function ge(e){var r=(e=e||{}).secret;if(r=null==(r=null==r?e.publicKey:r)?e.key:r,!0===/^hs/i.test(e.algorithm)&&null==r)throw new TypeError("secret must be a string or buffer or a KeyObject");var t=new ae(r);this.readable=!0,this.algorithm=e.algorithm,this.encoding=e.encoding,this.secret=this.publicKey=this.key=t,this.signature=new ae(e.signature),this.secret.once("close",function(){!this.signature.writable&&this.readable&&this.verify()}.bind(this)),this.signature.once("close",function(){!this.secret.writable&&this.readable&&this.verify()}.bind(this))}n.inherits(ge,le),ge.prototype.verify=function(){try{var e=de(this.signature.buffer,this.algorithm,this.key.buffer),r=ve(this.signature.buffer,this.encoding);return this.emit("done",e,r),this.emit("data",e),this.emit("end"),this.readable=!1,e}catch(e){this.readable=!1,this.emit("error",e),this.emit("close")}},ge.decode=ve,ge.isValid=me,ge.verify=de;var ye=ge;se.sign,ye.verify,ye.decode,ye.isValid;var $e=function(e,r){Error.call(this,e),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name="JsonWebTokenError",this.message=e,r&&(this.inner=r)};($e.prototype=Object.create(Error.prototype)).constructor=$e;var Se=$e,Re=Se,Ie=function(e,r){Re.call(this,e),this.name="NotBeforeError",this.date=r};(Ie.prototype=Object.create(Re.prototype)).constructor=Ie;var we=Se,Ae=function(e,r){we.call(this,e),this.name="TokenExpiredError",this.expiredAt=r};(Ae.prototype=Object.create(we.prototype)).constructor=Ae;var Oe={exports:{}};var be={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2};var Le="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};!function(e,r){const{MAX_SAFE_COMPONENT_LENGTH:t,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:o}=be,s=Le,i=(r=e.exports={}).re=[],a=r.safeRe=[],c=r.src=[],l=r.safeSrc=[],u=r.t={};let h=0;const f="[a-zA-Z0-9-]",p=[["\\s",1],["\\d",o],[f,n]],E=(e,r,t)=>{const n=(e=>{for(const[r,t]of p)e=e.split(`${r}*`).join(`${r}{0,${t}}`).split(`${r}+`).join(`${r}{1,${t}}`);return e})(r),o=h++;s(e,o,r),u[e]=o,c[o]=r,l[o]=n,i[o]=new RegExp(r,t?"g":void 0),a[o]=new RegExp(n,t?"g":void 0)};E("NUMERICIDENTIFIER","0|[1-9]\\d*"),E("NUMERICIDENTIFIERLOOSE","\\d+"),E("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${f}*`),E("MAINVERSION",`(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})`),E("MAINVERSIONLOOSE",`(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})`),E("PRERELEASEIDENTIFIER",`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIER]})`),E("PRERELEASEIDENTIFIERLOOSE",`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIERLOOSE]})`),E("PRERELEASE",`(?:-(${c[u.PRERELEASEIDENTIFIER]}(?:\\.${c[u.PRERELEASEIDENTIFIER]})*))`),E("PRERELEASELOOSE",`(?:-?(${c[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[u.PRERELEASEIDENTIFIERLOOSE]})*))`),E("BUILDIDENTIFIER",`${f}+`),E("BUILD",`(?:\\+(${c[u.BUILDIDENTIFIER]}(?:\\.${c[u.BUILDIDENTIFIER]})*))`),E("FULLPLAIN",`v?${c[u.MAINVERSION]}${c[u.PRERELEASE]}?${c[u.BUILD]}?`),E("FULL",`^${c[u.FULLPLAIN]}$`),E("LOOSEPLAIN",`[v=\\s]*${c[u.MAINVERSIONLOOSE]}${c[u.PRERELEASELOOSE]}?${c[u.BUILD]}?`),E("LOOSE",`^${c[u.LOOSEPLAIN]}$`),E("GTLT","((?:<|>)?=?)"),E("XRANGEIDENTIFIERLOOSE",`${c[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),E("XRANGEIDENTIFIER",`${c[u.NUMERICIDENTIFIER]}|x|X|\\*`),E("XRANGEPLAIN",`[v=\\s]*(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:${c[u.PRERELEASE]})?${c[u.BUILD]}?)?)?`),E("XRANGEPLAINLOOSE",`[v=\\s]*(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:${c[u.PRERELEASELOOSE]})?${c[u.BUILD]}?)?)?`),E("XRANGE",`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAIN]}$`),E("XRANGELOOSE",`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAINLOOSE]}$`),E("COERCEPLAIN",`(^|[^\\d])(\\d{1,${t}})(?:\\.(\\d{1,${t}}))?(?:\\.(\\d{1,${t}}))?`),E("COERCE",`${c[u.COERCEPLAIN]}(?:$|[^\\d])`),E("COERCEFULL",c[u.COERCEPLAIN]+`(?:${c[u.PRERELEASE]})?`+`(?:${c[u.BUILD]})?(?:$|[^\\d])`),E("COERCERTL",c[u.COERCE],!0),E("COERCERTLFULL",c[u.COERCEFULL],!0),E("LONETILDE","(?:~>?)"),E("TILDETRIM",`(\\s*)${c[u.LONETILDE]}\\s+`,!0),r.tildeTrimReplace="$1~",E("TILDE",`^${c[u.LONETILDE]}${c[u.XRANGEPLAIN]}$`),E("TILDELOOSE",`^${c[u.LONETILDE]}${c[u.XRANGEPLAINLOOSE]}$`),E("LONECARET","(?:\\^)"),E("CARETTRIM",`(\\s*)${c[u.LONECARET]}\\s+`,!0),r.caretTrimReplace="$1^",E("CARET",`^${c[u.LONECARET]}${c[u.XRANGEPLAIN]}$`),E("CARETLOOSE",`^${c[u.LONECARET]}${c[u.XRANGEPLAINLOOSE]}$`),E("COMPARATORLOOSE",`^${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]})$|^$`),E("COMPARATOR",`^${c[u.GTLT]}\\s*(${c[u.FULLPLAIN]})$|^$`),E("COMPARATORTRIM",`(\\s*)${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]}|${c[u.XRANGEPLAIN]})`,!0),r.comparatorTrimReplace="$1$2$3",E("HYPHENRANGE",`^\\s*(${c[u.XRANGEPLAIN]})\\s+-\\s+(${c[u.XRANGEPLAIN]})\\s*$`),E("HYPHENRANGELOOSE",`^\\s*(${c[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[u.XRANGEPLAINLOOSE]})\\s*$`),E("STAR","(<|>)?=?\\s*\\*"),E("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),E("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(Oe,Oe.exports);var Ne=Oe.exports;const Te=Object.freeze({loose:!0}),Pe=Object.freeze({});var _e=e=>e?"object"!=typeof e?Te:e:Pe;const Ce=/^[0-9]+$/,je=(e,r)=>{if("number"==typeof e&&"number"==typeof r)return e===r?0:e<r?-1:1;const t=Ce.test(e),n=Ce.test(r);return t&&n&&(e=+e,r=+r),e===r?0:t&&!n?-1:n&&!t?1:e<r?-1:1};var ke={compareIdentifiers:je,rcompareIdentifiers:(e,r)=>je(r,e)};const De=Le,{MAX_LENGTH:Me,MAX_SAFE_INTEGER:Ge}=be,{safeRe:Fe,t:xe}=Ne,Ue=_e,{compareIdentifiers:Be}=ke;var Xe=class e{constructor(r,t){if(t=Ue(t),r instanceof e){if(r.loose===!!t.loose&&r.includePrerelease===!!t.includePrerelease)return r;r=r.version}else if("string"!=typeof r)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof r}".`);if(r.length>Me)throw new TypeError(`version is longer than ${Me} characters`);De("SemVer",r,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;const n=r.trim().match(t.loose?Fe[xe.LOOSE]:Fe[xe.FULL]);if(!n)throw new TypeError(`Invalid Version: ${r}`);if(this.raw=r,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>Ge||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Ge||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Ge||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(e=>{if(/^[0-9]+$/.test(e)){const r=+e;if(r>=0&&r<Ge)return r}return e}):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(r){if(De("SemVer.compare",this.version,this.options,r),!(r instanceof e)){if("string"==typeof r&&r===this.version)return 0;r=new e(r,this.options)}return r.version===this.version?0:this.compareMain(r)||this.comparePre(r)}compareMain(r){return r instanceof e||(r=new e(r,this.options)),this.major<r.major?-1:this.major>r.major?1:this.minor<r.minor?-1:this.minor>r.minor?1:this.patch<r.patch?-1:this.patch>r.patch?1:0}comparePre(r){if(r instanceof e||(r=new e(r,this.options)),this.prerelease.length&&!r.prerelease.length)return-1;if(!this.prerelease.length&&r.prerelease.length)return 1;if(!this.prerelease.length&&!r.prerelease.length)return 0;let t=0;do{const e=this.prerelease[t],n=r.prerelease[t];if(De("prerelease compare",t,e,n),void 0===e&&void 0===n)return 0;if(void 0===n)return 1;if(void 0===e)return-1;if(e!==n)return Be(e,n)}while(++t)}compareBuild(r){r instanceof e||(r=new e(r,this.options));let t=0;do{const e=this.build[t],n=r.build[t];if(De("build compare",t,e,n),void 0===e&&void 0===n)return 0;if(void 0===n)return 1;if(void 0===e)return-1;if(e!==n)return Be(e,n)}while(++t)}inc(e,r,t){if(e.startsWith("pre")){if(!r&&!1===t)throw new Error("invalid increment argument: identifier is empty");if(r){const e=`-${r}`.match(this.options.loose?Fe[xe.PRERELEASELOOSE]:Fe[xe.PRERELEASE]);if(!e||e[1]!==r)throw new Error(`invalid identifier: ${r}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,t);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,t);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,t),this.inc("pre",r,t);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",r,t),this.inc("pre",r,t);break;case"release":if(0===this.prerelease.length)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{const e=Number(t)?1:0;if(0===this.prerelease.length)this.prerelease=[e];else{let n=this.prerelease.length;for(;--n>=0;)"number"==typeof this.prerelease[n]&&(this.prerelease[n]++,n=-2);if(-1===n){if(r===this.prerelease.join(".")&&!1===t)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(r){let n=[r,e];!1===t&&(n=[r]),0===Be(this.prerelease[0],r)?isNaN(this.prerelease[1])&&(this.prerelease=n):this.prerelease=n}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};const He=Xe;var qe=(e,r,t=!1)=>{if(e instanceof He)return e;try{return new He(e,r)}catch(e){if(!t)return null;throw e}};const Ke=qe;var Ve=(e,r)=>{const t=Ke(e,r);return t?t.version:null};const ze=qe;var We=(e,r)=>{const t=ze(e.trim().replace(/^[=v]+/,""),r);return t?t.version:null};const Ye=Xe;var Je=(e,r,t,n,o)=>{"string"==typeof t&&(o=n,n=t,t=void 0);try{return new Ye(e instanceof Ye?e.version:e,t).inc(r,n,o).version}catch(e){return null}};const Ze=qe;var Qe=(e,r)=>{const t=Ze(e,null,!0),n=Ze(r,null,!0),o=t.compare(n);if(0===o)return null;const s=o>0,i=s?t:n,a=s?n:t,c=!!i.prerelease.length;if(!!a.prerelease.length&&!c){if(!a.patch&&!a.minor)return"major";if(0===a.compareMain(i))return a.minor&&!a.patch?"minor":"patch"}const l=c?"pre":"";return t.major!==n.major?l+"major":t.minor!==n.minor?l+"minor":t.patch!==n.patch?l+"patch":"prerelease"};const er=Xe;var rr=(e,r)=>new er(e,r).major;const tr=Xe;var nr=(e,r)=>new tr(e,r).minor;const or=Xe;var sr=(e,r)=>new or(e,r).patch;const ir=qe;var ar=(e,r)=>{const t=ir(e,r);return t&&t.prerelease.length?t.prerelease:null};const cr=Xe;var lr=(e,r,t)=>new cr(e,t).compare(new cr(r,t));const ur=lr;var hr=(e,r,t)=>ur(r,e,t);const fr=lr;var pr=(e,r)=>fr(e,r,!0);const Er=Xe;var mr=(e,r,t)=>{const n=new Er(e,t),o=new Er(r,t);return n.compare(o)||n.compareBuild(o)};const dr=mr;var vr=(e,r)=>e.sort((e,t)=>dr(e,t,r));const gr=mr;var yr=(e,r)=>e.sort((e,t)=>gr(t,e,r));const $r=lr;var Sr=(e,r,t)=>$r(e,r,t)>0;const Rr=lr;var Ir=(e,r,t)=>Rr(e,r,t)<0;const wr=lr;var Ar=(e,r,t)=>0===wr(e,r,t);const Or=lr;var br=(e,r,t)=>0!==Or(e,r,t);const Lr=lr;var Nr=(e,r,t)=>Lr(e,r,t)>=0;const Tr=lr;var Pr=(e,r,t)=>Tr(e,r,t)<=0;const _r=Ar,Cr=br,jr=Sr,kr=Nr,Dr=Ir,Mr=Pr;var Gr=(e,r,t,n)=>{switch(r){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof t&&(t=t.version),e===t;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof t&&(t=t.version),e!==t;case"":case"=":case"==":return _r(e,t,n);case"!=":return Cr(e,t,n);case">":return jr(e,t,n);case">=":return kr(e,t,n);case"<":return Dr(e,t,n);case"<=":return Mr(e,t,n);default:throw new TypeError(`Invalid operator: ${r}`)}};const Fr=Xe,xr=qe,{safeRe:Ur,t:Br}=Ne;var Xr=(e,r)=>{if(e instanceof Fr)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let t=null;if((r=r||{}).rtl){const n=r.includePrerelease?Ur[Br.COERCERTLFULL]:Ur[Br.COERCERTL];let o;for(;(o=n.exec(e))&&(!t||t.index+t[0].length!==e.length);)t&&o.index+o[0].length===t.index+t[0].length||(t=o),n.lastIndex=o.index+o[1].length+o[2].length;n.lastIndex=-1}else t=e.match(r.includePrerelease?Ur[Br.COERCEFULL]:Ur[Br.COERCE]);if(null===t)return null;const n=t[2],o=t[3]||"0",s=t[4]||"0",i=r.includePrerelease&&t[5]?`-${t[5]}`:"",a=r.includePrerelease&&t[6]?`+${t[6]}`:"";return xr(`${n}.${o}.${s}${i}${a}`,r)};var Hr,qr,Kr,Vr,zr=class{constructor(){this.max=1e3,this.map=new Map}get(e){const r=this.map.get(e);return void 0===r?void 0:(this.map.delete(e),this.map.set(e,r),r)}delete(e){return this.map.delete(e)}set(e,r){if(!this.delete(e)&&void 0!==r){if(this.map.size>=this.max){const e=this.map.keys().next().value;this.delete(e)}this.map.set(e,r)}return this}};function Wr(){if(qr)return Hr;qr=1;const e=/\s+/g;class r{constructor(t,s){if(s=n(s),t instanceof r)return t.loose===!!s.loose&&t.includePrerelease===!!s.includePrerelease?t:new r(t.raw,s);if(t instanceof o)return this.raw=t.value,this.set=[[t]],this.formatted=void 0,this;if(this.options=s,this.loose=!!s.loose,this.includePrerelease=!!s.includePrerelease,this.raw=t.trim().replace(e," "),this.set=this.raw.split("||").map(e=>this.parseRange(e.trim())).filter(e=>e.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter(e=>!E(e[0])),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&m(e[0])){this.set=[e];break}}this.formatted=void 0}get range(){if(void 0===this.formatted){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");const r=this.set[e];for(let e=0;e<r.length;e++)e>0&&(this.formatted+=" "),this.formatted+=r[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){const r=((this.options.includePrerelease&&f)|(this.options.loose&&p))+":"+e,n=t.get(r);if(n)return n;const i=this.options.loose,m=i?a[c.HYPHENRANGELOOSE]:a[c.HYPHENRANGE];e=e.replace(m,b(this.options.includePrerelease)),s("hyphen replace",e),e=e.replace(a[c.COMPARATORTRIM],l),s("comparator trim",e),e=e.replace(a[c.TILDETRIM],u),s("tilde trim",e),e=e.replace(a[c.CARETTRIM],h),s("caret trim",e);let d=e.split(" ").map(e=>v(e,this.options)).join(" ").split(/\s+/).map(e=>O(e,this.options));i&&(d=d.filter(e=>(s("loose invalid filter",e,this.options),!!e.match(a[c.COMPARATORLOOSE])))),s("range list",d);const g=new Map,y=d.map(e=>new o(e,this.options));for(const e of y){if(E(e))return[e];g.set(e.value,e)}g.size>1&&g.has("")&&g.delete("");const $=[...g.values()];return t.set(r,$),$}intersects(e,t){if(!(e instanceof r))throw new TypeError("a Range is required");return this.set.some(r=>d(r,t)&&e.set.some(e=>d(e,t)&&r.every(r=>e.every(e=>r.intersects(e,t)))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new i(e,this.options)}catch(e){return!1}for(let r=0;r<this.set.length;r++)if(L(this.set[r],e,this.options))return!0;return!1}}Hr=r;const t=new zr,n=_e,o=Yr(),s=Le,i=Xe,{safeRe:a,t:c,comparatorTrimReplace:l,tildeTrimReplace:u,caretTrimReplace:h}=Ne,{FLAG_INCLUDE_PRERELEASE:f,FLAG_LOOSE:p}=be,E=e=>"<0.0.0-0"===e.value,m=e=>""===e.value,d=(e,r)=>{let t=!0;const n=e.slice();let o=n.pop();for(;t&&n.length;)t=n.every(e=>o.intersects(e,r)),o=n.pop();return t},v=(e,r)=>(e=e.replace(a[c.BUILD],""),s("comp",e,r),e=S(e,r),s("caret",e),e=y(e,r),s("tildes",e),e=I(e,r),s("xrange",e),e=A(e,r),s("stars",e),e),g=e=>!e||"x"===e.toLowerCase()||"*"===e,y=(e,r)=>e.trim().split(/\s+/).map(e=>$(e,r)).join(" "),$=(e,r)=>{const t=r.loose?a[c.TILDELOOSE]:a[c.TILDE];return e.replace(t,(r,t,n,o,i)=>{let a;return s("tilde",e,r,t,n,o,i),g(t)?a="":g(n)?a=`>=${t}.0.0 <${+t+1}.0.0-0`:g(o)?a=`>=${t}.${n}.0 <${t}.${+n+1}.0-0`:i?(s("replaceTilde pr",i),a=`>=${t}.${n}.${o}-${i} <${t}.${+n+1}.0-0`):a=`>=${t}.${n}.${o} <${t}.${+n+1}.0-0`,s("tilde return",a),a})},S=(e,r)=>e.trim().split(/\s+/).map(e=>R(e,r)).join(" "),R=(e,r)=>{s("caret",e,r);const t=r.loose?a[c.CARETLOOSE]:a[c.CARET],n=r.includePrerelease?"-0":"";return e.replace(t,(r,t,o,i,a)=>{let c;return s("caret",e,r,t,o,i,a),g(t)?c="":g(o)?c=`>=${t}.0.0${n} <${+t+1}.0.0-0`:g(i)?c="0"===t?`>=${t}.${o}.0${n} <${t}.${+o+1}.0-0`:`>=${t}.${o}.0${n} <${+t+1}.0.0-0`:a?(s("replaceCaret pr",a),c="0"===t?"0"===o?`>=${t}.${o}.${i}-${a} <${t}.${o}.${+i+1}-0`:`>=${t}.${o}.${i}-${a} <${t}.${+o+1}.0-0`:`>=${t}.${o}.${i}-${a} <${+t+1}.0.0-0`):(s("no pr"),c="0"===t?"0"===o?`>=${t}.${o}.${i}${n} <${t}.${o}.${+i+1}-0`:`>=${t}.${o}.${i}${n} <${t}.${+o+1}.0-0`:`>=${t}.${o}.${i} <${+t+1}.0.0-0`),s("caret return",c),c})},I=(e,r)=>(s("replaceXRanges",e,r),e.split(/\s+/).map(e=>w(e,r)).join(" ")),w=(e,r)=>{e=e.trim();const t=r.loose?a[c.XRANGELOOSE]:a[c.XRANGE];return e.replace(t,(t,n,o,i,a,c)=>{s("xRange",e,t,n,o,i,a,c);const l=g(o),u=l||g(i),h=u||g(a),f=h;return"="===n&&f&&(n=""),c=r.includePrerelease?"-0":"",l?t=">"===n||"<"===n?"<0.0.0-0":"*":n&&f?(u&&(i=0),a=0,">"===n?(n=">=",u?(o=+o+1,i=0,a=0):(i=+i+1,a=0)):"<="===n&&(n="<",u?o=+o+1:i=+i+1),"<"===n&&(c="-0"),t=`${n+o}.${i}.${a}${c}`):u?t=`>=${o}.0.0${c} <${+o+1}.0.0-0`:h&&(t=`>=${o}.${i}.0${c} <${o}.${+i+1}.0-0`),s("xRange return",t),t})},A=(e,r)=>(s("replaceStars",e,r),e.trim().replace(a[c.STAR],"")),O=(e,r)=>(s("replaceGTE0",e,r),e.trim().replace(a[r.includePrerelease?c.GTE0PRE:c.GTE0],"")),b=e=>(r,t,n,o,s,i,a,c,l,u,h,f)=>`${t=g(n)?"":g(o)?`>=${n}.0.0${e?"-0":""}`:g(s)?`>=${n}.${o}.0${e?"-0":""}`:i?`>=${t}`:`>=${t}${e?"-0":""}`} ${c=g(l)?"":g(u)?`<${+l+1}.0.0-0`:g(h)?`<${l}.${+u+1}.0-0`:f?`<=${l}.${u}.${h}-${f}`:e?`<${l}.${u}.${+h+1}-0`:`<=${c}`}`.trim(),L=(e,r,t)=>{for(let t=0;t<e.length;t++)if(!e[t].test(r))return!1;if(r.prerelease.length&&!t.includePrerelease){for(let t=0;t<e.length;t++)if(s(e[t].semver),e[t].semver!==o.ANY&&e[t].semver.prerelease.length>0){const n=e[t].semver;if(n.major===r.major&&n.minor===r.minor&&n.patch===r.patch)return!0}return!1}return!0};return Hr}function Yr(){if(Vr)return Kr;Vr=1;const e=Symbol("SemVer ANY");class r{static get ANY(){return e}constructor(n,o){if(o=t(o),n instanceof r){if(n.loose===!!o.loose)return n;n=n.value}n=n.trim().split(/\s+/).join(" "),i("comparator",n,o),this.options=o,this.loose=!!o.loose,this.parse(n),this.semver===e?this.value="":this.value=this.operator+this.semver.version,i("comp",this)}parse(r){const t=this.options.loose?n[o.COMPARATORLOOSE]:n[o.COMPARATOR],s=r.match(t);if(!s)throw new TypeError(`Invalid comparator: ${r}`);this.operator=void 0!==s[1]?s[1]:"","="===this.operator&&(this.operator=""),s[2]?this.semver=new a(s[2],this.options.loose):this.semver=e}toString(){return this.value}test(r){if(i("Comparator.test",r,this.options.loose),this.semver===e||r===e)return!0;if("string"==typeof r)try{r=new a(r,this.options)}catch(e){return!1}return s(r,this.operator,this.semver,this.options)}intersects(e,n){if(!(e instanceof r))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new c(e.value,n).test(this.value):""===e.operator?""===e.value||new c(this.value,n).test(e.semver):(!(n=t(n)).includePrerelease||"<0.0.0-0"!==this.value&&"<0.0.0-0"!==e.value)&&(!(!n.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0")))&&(!(!this.operator.startsWith(">")||!e.operator.startsWith(">"))||(!(!this.operator.startsWith("<")||!e.operator.startsWith("<"))||(!(this.semver.version!==e.semver.version||!this.operator.includes("=")||!e.operator.includes("="))||(!!(s(this.semver,"<",e.semver,n)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))||!!(s(this.semver,">",e.semver,n)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))))))}}Kr=r;const t=_e,{safeRe:n,t:o}=Ne,s=Gr,i=Le,a=Xe,c=Wr();return Kr}const Jr=Wr();var Zr=(e,r,t)=>{try{r=new Jr(r,t)}catch(e){return!1}return r.test(e)};const Qr=Wr();var et=(e,r)=>new Qr(e,r).set.map(e=>e.map(e=>e.value).join(" ").trim().split(" "));const rt=Xe,tt=Wr();var nt=(e,r,t)=>{let n=null,o=null,s=null;try{s=new tt(r,t)}catch(e){return null}return e.forEach(e=>{s.test(e)&&(n&&-1!==o.compare(e)||(n=e,o=new rt(n,t)))}),n};const ot=Xe,st=Wr();var it=(e,r,t)=>{let n=null,o=null,s=null;try{s=new st(r,t)}catch(e){return null}return e.forEach(e=>{s.test(e)&&(n&&1!==o.compare(e)||(n=e,o=new ot(n,t)))}),n};const at=Xe,ct=Wr(),lt=Sr;var ut=(e,r)=>{e=new ct(e,r);let t=new at("0.0.0");if(e.test(t))return t;if(t=new at("0.0.0-0"),e.test(t))return t;t=null;for(let r=0;r<e.set.length;++r){const n=e.set[r];let o=null;n.forEach(e=>{const r=new at(e.semver.version);switch(e.operator){case">":0===r.prerelease.length?r.patch++:r.prerelease.push(0),r.raw=r.format();case"":case">=":o&&!lt(r,o)||(o=r);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${e.operator}`)}}),!o||t&&!lt(t,o)||(t=o)}return t&&e.test(t)?t:null};const ht=Wr();var ft=(e,r)=>{try{return new ht(e,r).range||"*"}catch(e){return null}};const pt=Xe,Et=Yr(),{ANY:mt}=Et,dt=Wr(),vt=Zr,gt=Sr,yt=Ir,$t=Pr,St=Nr;var Rt=(e,r,t,n)=>{let o,s,i,a,c;switch(e=new pt(e,n),r=new dt(r,n),t){case">":o=gt,s=$t,i=yt,a=">",c=">=";break;case"<":o=yt,s=St,i=gt,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(vt(e,r,n))return!1;for(let t=0;t<r.set.length;++t){const l=r.set[t];let u=null,h=null;if(l.forEach(e=>{e.semver===mt&&(e=new Et(">=0.0.0")),u=u||e,h=h||e,o(e.semver,u.semver,n)?u=e:i(e.semver,h.semver,n)&&(h=e)}),u.operator===a||u.operator===c)return!1;if((!h.operator||h.operator===a)&&s(e,h.semver))return!1;if(h.operator===c&&i(e,h.semver))return!1}return!0};const It=Rt;var wt=(e,r,t)=>It(e,r,">",t);const At=Rt;var Ot=(e,r,t)=>At(e,r,"<",t);const bt=Wr();var Lt=(e,r,t)=>(e=new bt(e,t),r=new bt(r,t),e.intersects(r,t));const Nt=Zr,Tt=lr;const Pt=Wr(),_t=Yr(),{ANY:Ct}=_t,jt=Zr,kt=lr,Dt=[new _t(">=0.0.0-0")],Mt=[new _t(">=0.0.0")],Gt=(e,r,t)=>{if(e===r)return!0;if(1===e.length&&e[0].semver===Ct){if(1===r.length&&r[0].semver===Ct)return!0;e=t.includePrerelease?Dt:Mt}if(1===r.length&&r[0].semver===Ct){if(t.includePrerelease)return!0;r=Mt}const n=new Set;let o,s,i,a,c,l,u;for(const r of e)">"===r.operator||">="===r.operator?o=Ft(o,r,t):"<"===r.operator||"<="===r.operator?s=xt(s,r,t):n.add(r.semver);if(n.size>1)return null;if(o&&s){if(i=kt(o.semver,s.semver,t),i>0)return null;if(0===i&&(">="!==o.operator||"<="!==s.operator))return null}for(const e of n){if(o&&!jt(e,String(o),t))return null;if(s&&!jt(e,String(s),t))return null;for(const n of r)if(!jt(e,String(n),t))return!1;return!0}let h=!(!s||t.includePrerelease||!s.semver.prerelease.length)&&s.semver,f=!(!o||t.includePrerelease||!o.semver.prerelease.length)&&o.semver;h&&1===h.prerelease.length&&"<"===s.operator&&0===h.prerelease[0]&&(h=!1);for(const e of r){if(u=u||">"===e.operator||">="===e.operator,l=l||"<"===e.operator||"<="===e.operator,o)if(f&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===f.major&&e.semver.minor===f.minor&&e.semver.patch===f.patch&&(f=!1),">"===e.operator||">="===e.operator){if(a=Ft(o,e,t),a===e&&a!==o)return!1}else if(">="===o.operator&&!jt(o.semver,String(e),t))return!1;if(s)if(h&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===h.major&&e.semver.minor===h.minor&&e.semver.patch===h.patch&&(h=!1),"<"===e.operator||"<="===e.operator){if(c=xt(s,e,t),c===e&&c!==s)return!1}else if("<="===s.operator&&!jt(s.semver,String(e),t))return!1;if(!e.operator&&(s||o)&&0!==i)return!1}return!(o&&l&&!s&&0!==i)&&(!(s&&u&&!o&&0!==i)&&(!f&&!h))},Ft=(e,r,t)=>{if(!e)return r;const n=kt(e.semver,r.semver,t);return n>0?e:n<0||">"===r.operator&&">="===e.operator?r:e},xt=(e,r,t)=>{if(!e)return r;const n=kt(e.semver,r.semver,t);return n<0?e:n>0||"<"===r.operator&&"<="===e.operator?r:e};var Ut=(e,r,t={})=>{if(e===r)return!0;e=new Pt(e,t),r=new Pt(r,t);let n=!1;e:for(const o of e.set){for(const e of r.set){const r=Gt(o,e,t);if(n=n||null!==r,r)continue e}if(n)return!1}return!0};const Bt=Ne,Xt=be,Ht=Xe,qt=ke,Kt=(e,r,t)=>{const n=[];let o=null,s=null;const i=e.sort((e,r)=>Tt(e,r,t));for(const e of i){Nt(e,r,t)?(s=e,o||(o=e)):(s&&n.push([o,s]),s=null,o=null)}o&&n.push([o,null]);const a=[];for(const[e,r]of n)e===r?a.push(e):r||e!==i[0]?r?e===i[0]?a.push(`<=${r}`):a.push(`${e} - ${r}`):a.push(`>=${e}`):a.push("*");const c=a.join(" || "),l="string"==typeof r.raw?r.raw:String(r);return c.length<l.length?c:r};var Vt={parse:qe,valid:Ve,clean:We,inc:Je,diff:Qe,major:rr,minor:nr,patch:sr,prerelease:ar,compare:lr,rcompare:hr,compareLoose:pr,compareBuild:mr,sort:vr,rsort:yr,gt:Sr,lt:Ir,eq:Ar,neq:br,gte:Nr,lte:Pr,cmp:Gr,coerce:Xr,Comparator:Yr(),Range:Wr(),satisfies:Zr,toComparators:et,maxSatisfying:nt,minSatisfying:it,minVersion:ut,validRange:ft,outside:Rt,gtr:wt,ltr:Ot,intersects:Lt,simplifyRange:Kt,subset:Ut,SemVer:Ht,re:Bt.re,src:Bt.src,tokens:Bt.t,SEMVER_SPEC_VERSION:Xt.SEMVER_SPEC_VERSION,RELEASE_TYPES:Xt.RELEASE_TYPES,compareIdentifiers:qt.compareIdentifiers,rcompareIdentifiers:qt.rcompareIdentifiers};Vt.satisfies(process.version,">=15.7.0");Vt.satisfies(process.version,">=16.9.0");var zt=Vt.satisfies(process.version,"^6.12.0 || >=8.0.0"),Wt=1/0,Yt=9007199254740991,Jt=17976931348623157e292,Zt=NaN,Qt="[object Arguments]",en="[object Function]",rn="[object GeneratorFunction]",tn="[object String]",nn="[object Symbol]",on=/^\s+|\s+$/g,sn=/^[-+]0x[0-9a-f]+$/i,an=/^0b[01]+$/i,cn=/^0o[0-7]+$/i,ln=/^(?:0|[1-9]\d*)$/,un=parseInt;function hn(e){return e!=e}function fn(e,r){return function(e,r){for(var t=-1,n=e?e.length:0,o=Array(n);++t<n;)o[t]=r(e[t],t,e);return o}(r,function(r){return e[r]})}var pn,En,mn=Object.prototype,dn=mn.hasOwnProperty,vn=mn.toString,gn=mn.propertyIsEnumerable,yn=(pn=Object.keys,En=Object,function(e){return pn(En(e))}),$n=Math.max;function Sn(e,r){var t=wn(e)||function(e){return function(e){return bn(e)&&An(e)}(e)&&dn.call(e,"callee")&&(!gn.call(e,"callee")||vn.call(e)==Qt)}(e)?function(e,r){for(var t=-1,n=Array(e);++t<e;)n[t]=r(t);return n}(e.length,String):[],n=t.length,o=!!n;for(var s in e)!r&&!dn.call(e,s)||o&&("length"==s||In(s,n))||t.push(s);return t}function Rn(e){if(t=(r=e)&&r.constructor,n="function"==typeof t&&t.prototype||mn,r!==n)return yn(e);var r,t,n,o=[];for(var s in Object(e))dn.call(e,s)&&"constructor"!=s&&o.push(s);return o}function In(e,r){return!!(r=null==r?Yt:r)&&("number"==typeof e||ln.test(e))&&e>-1&&e%1==0&&e<r}var wn=Array.isArray;function An(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=Yt}(e.length)&&!function(e){var r=On(e)?vn.call(e):"";return r==en||r==rn}(e)}function On(e){var r=typeof e;return!!e&&("object"==r||"function"==r)}function bn(e){return!!e&&"object"==typeof e}var Ln=function(e,r,t,n){var o;e=An(e)?e:(o=e)?fn(o,function(e){return An(e)?Sn(e):Rn(e)}(o)):[],t=t&&!n?function(e){var r=function(e){if(!e)return 0===e?e:0;if(e=function(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||bn(e)&&vn.call(e)==nn}(e))return Zt;if(On(e)){var r="function"==typeof e.valueOf?e.valueOf():e;e=On(r)?r+"":r}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(on,"");var t=an.test(e);return t||cn.test(e)?un(e.slice(2),t?2:8):sn.test(e)?Zt:+e}(e),e===Wt||e===-1/0){return(e<0?-1:1)*Jt}return e==e?e:0}(e),t=r%1;return r==r?t?r-t:r:0}(t):0;var s=e.length;return t<0&&(t=$n(s+t,0)),function(e){return"string"==typeof e||!wn(e)&&bn(e)&&vn.call(e)==tn}(e)?t<=s&&e.indexOf(r,t)>-1:!!s&&function(e,r,t){if(r!=r)return function(e,r,t,n){for(var o=e.length,s=t+(n?1:-1);n?s--:++s<o;)if(r(e[s],s,e))return s;return-1}(e,hn,t);for(var n=t-1,o=e.length;++n<o;)if(e[n]===r)return n;return-1}(e,r,t)>-1};Object.prototype.toString;parseInt,Object.prototype.toString;var Nn=Function.prototype,Tn=Object.prototype,Pn=Nn.toString;Tn.hasOwnProperty,Pn.call(Object),Tn.toString,Object.getPrototypeOf;Object.prototype.toString,Array.isArray;const _n=Ln,Cn=["RS256","RS384","RS512","ES256","ES384","ES512","HS256","HS384","HS512","none"];zt&&Cn.splice(3,0,"PS256","PS384","PS512"),_n.bind(null,Cn);const jn=e(import.meta.url),{version:kn}=jn("../package.json");var Dn={id:"sso",handler:(e,r)=>{const{env:t,logger:n,services:o,database:s,getSchema:i}=r,a=t.KEYCLOAK_URL||"http://keycloak:8080",c=t.KEYCLOAK_REALM||"testing",l=t.KEYCLOAK_ADMIN_USER||"admin",u=t.KEYCLOAK_ADMIN_PASSWORD||"admin",h=t.PUBLIC_URL||"http://localhost:8055",f=t.MOBILE_APP_SCHEME||"finsnapp",p=Array.isArray(f)?f.map(e=>String(e).trim()):String(f).split(",").map(e=>e.trim()),E=p[0],m=t.MOBILE_APP_CALLBACK_PATH||"/auth/callback",d=t.GOOGLE_CALLBACK_PATH||"/auth/callback/google",v=t.KEYCLOAK_CLIENT_ID||"admin-cli",g=t.COOKIE_DOMAIN||null,y="false"!==t.COOKIE_SECURE,$=t.COOKIE_SAME_SITE||"lax",S=t.SESSION_COOKIE_NAME||"directus_session_token",R=t.REFRESH_TOKEN_COOKIE_NAME||"directus_refresh_token";t.DEFAULT_ROLE_ID;const I="directus_session_token";function w(e){if("browser"===e.query.type)return!0;if("mobile"===e.query.type)return!1;if(e.query.app_scheme||e.query.app_path)return!1;const r=e.headers["user-agent"]||"";return/Mozilla|Chrome|Safari|Firefox|Edge|Opera/i.test(r)&&!/Mobile.*App|ReactNative|Expo/i.test(r)}async function A(e,r){const t=e.headers.cookie;if(!t)return null;const n=t.split(";").map(e=>e.trim()).filter(e=>e.startsWith(`${r}=`)).map(e=>e.substring(r.length+1));if(0===n.length)return null;for(let e=0;e<n.length;e++){const t=n[e];try{const e=await fetch(`${h}/users/me`,{headers:{Cookie:`${r}=${t}`}});if(e.ok){return{token:t,userData:(await e.json()).data}}}catch(e){}}return null}async function O(e){const r=e.headers.cookie;if(!r)return null;const t=r.split(";").map(e=>e.trim()).map(e=>{const r=e.split("=");return r.length>1?r[1]:null}).filter(e=>e&&e.startsWith("eyJ")&&e.length>50);if(0===t.length)return null;for(let e=0;e<t.length;e++){const r=t[e];try{const e=await fetch(`${h}/users/me`,{headers:{Authorization:`Bearer ${r}`}});if(e.ok){return{token:r,userData:(await e.json()).data}}}catch(e){}}return null}async function b(e){const r=e.cookies[R];if(!r)return null;try{const e=await fetch(`${h}/auth/refresh`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refresh_token:r})});if(e.ok){const r=(await e.json()).data.access_token,t=await fetch(`${h}/users/me`,{headers:{Authorization:`Bearer ${r}`}});if(t.ok){return{token:r,userData:(await t.json()).data}}}}catch(e){}return null}function L(e){const r=e.query.app_scheme;return r&&p.includes(r)?r:(r&&n.warn(`⚠️ Warning: App requested scheme '${r}', but it is not in .env. Falling back to '${E}'`),E)}n.info("🚀 Mobile Auth Proxy Extension loaded"),n.info("📱 Allowed Mobile App Schemes: "+p.join(", ")),n.info("🔵 Google OAuth enabled"),e.get("/health",(e,r)=>{r.json({status:"ok",service:"directus-extension-sso",version:kn,allowed_schemes:p})}),e.get("/mobile-callback",async(e,r)=>{const t=w(e);try{let n=null;if(S!==I&&(n=await A(e,S)),n||(n=await A(e,I)),n||(n=await O(e)),n||(n=await b(e)),!n)return r.send("<html><body><h2>Authentication Failed</h2></body></html>");const{token:o,userData:s}=n,i=s.id,a=s.email,c=o;if(t){r.cookie(S,o,{httpOnly:!0,secure:y,domain:g,sameSite:$,maxAge:6048e5,path:"/"}),S!==I&&r.cookie(I,"",{maxAge:0,path:"/"});let t=e.query.redirect_uri||e.query.redirect||"/";return r.redirect(t)}const l=L(e),u=`${l}://${(e.query.app_path||m).replace(/^\/+/,"")}?access_token=${c}&user_id=${i}&email=${encodeURIComponent(a||"")}`;return r.setHeader("Location",u),r.status(302).send(`<html><head><meta http-equiv="refresh" content="0;url=${u}"></head><body>Redirecting...</body></html>`)}catch(e){r.status(500).send(`<html><body><h2>Error</h2><p>${e.message}</p></body></html>`)}}),e.get("/google-callback",async(e,r)=>{const t=w(e);try{let o=null;if(e.query.access_token){o={token:e.query.access_token,refresh_token:e.query.refresh_token||null,expires:e.query.expires||null};try{const e=await fetch(`${h}/users/me`,{headers:{Authorization:`Bearer ${o.token}`}});if(e.ok){const r=await e.json();o.userData=r.data}else o=null}catch(e){o=null}}if(o||S===I||(o=await A(e,S)),o||(o=await A(e,I)),o||(o=await O(e)),o||(o=await b(e)),!o)return r.send("<html><body><h2>Authentication Failed</h2></body></html>");const{token:s,userData:i}=o,a=i.id,c=i.email,l=s;if(t){r.cookie(S,s,{httpOnly:!0,secure:y,domain:g,sameSite:$,maxAge:6048e5,path:"/"}),S!==I&&r.cookie(I,"",{maxAge:0,path:"/"});let t=e.query.redirect_uri||e.query.redirect||"/";return r.send(`<html><head><meta http-equiv="refresh" content="2;url=${t}"></head><body>Login Successful!</body></html>`)}const u=L(e),f=e.query.app_path||d,p=new URL(`${u}://${f.replace(/^\/+/,"")}`);return p.searchParams.set("access_token",l),p.searchParams.set("user_id",a),p.searchParams.set("email",c||""),p.searchParams.set("provider","google"),n.info("🚀 Performing direct 302 redirect to app: "+p.toString()),r.redirect(302,p.toString())}catch(e){r.status(500).send(`<html><body><h2>Error</h2><p>${e.message}</p></body></html>`)}}),e.post("/mobile-logout",async(e,r)=>{try{const t=e.headers.authorization,o=t?.replace("Bearer ","");if(!o)return r.status(400).json({error:"No token provided"});let s=null;try{const e=await fetch(`${h}/users/me`,{headers:{Authorization:`Bearer ${o}`}});if(e.ok){s=(await e.json()).data.email}}catch(e){}try{await fetch(`${h}/auth/logout`,{method:"POST",headers:{Authorization:`Bearer ${o}`,"Content-Type":"application/json"},body:JSON.stringify({refresh_token:o})})}catch(e){}if(s)try{const e=await async function(){try{const e=await fetch(`${a}/realms/master/protocol/openid-connect/token`,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({grant_type:"password",client_id:v,username:l,password:u}).toString()});if(!e.ok)throw new Error("Failed to get admin token");return(await e.json()).access_token}catch(e){return n.error("Error getting admin token:",e),null}}();if(e){const r=await async function(e,r){try{const t=await fetch(`${a}/admin/realms/${c}/users?email=${encodeURIComponent(r)}`,{headers:{Authorization:`Bearer ${e}`}});if(!t.ok)throw new Error("Failed to get user");const n=await t.json();return n.length>0?n[0].id:null}catch(e){return n.error("Error getting user ID:",e),null}}(e,s);r&&await async function(e,r){try{const t=await fetch(`${a}/admin/realms/${c}/users/${r}/logout`,{method:"POST",headers:{Authorization:`Bearer ${e}`}});return t.ok||204===t.status}catch(e){return n.error("Error logging out user from Keycloak:",e),!1}}(e,r)}}catch(e){}r.json({success:!0,message:"Logged out successfully"})}catch(e){r.status(500).json({error:e.message})}}),e.post("/apple-token",async(e,r)=>{}),e.get("/bridge",async(e,r)=>{})}};export{Dn as default};
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@ymys/directus-extension-sso",
3
3
  "description": "Mobile OAuth proxy endpoints for Directus + Keycloak + Google",
4
4
  "icon": "smartphone",
5
- "version": "2.0.8",
5
+ "version": "2.0.9",
6
6
  "keywords": [
7
7
  "directus",
8
8
  "directus-extension",