UNPKG

npm-check-updates

Version:

Find newer versions of dependencies than what your package.json allows

10 lines 230 kB
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const V=require("node:process"),fi=require("node:child_process"),K=require("node:url"),J=require("node:path"),te=require("node:util"),mt=require("node:os"),R=require("./index.js"),he=require("node:fs"),Uu=require("node:constants"),ae=require("node:stream"),Zt=require("node:assert"),Re=require("node:events"),er=require("node:crypto"),oe=require("./index-BmUFwMVL.js"),fe=require("node:http"),yt=require("node:https"),ht=require("node:buffer"),hi=require("node:zlib"),qu=require("node:net"),Ft=require("node:tls"),We=require("node:dns"),Mr=require("node:http2"),Hu=require("./index-BnIU43YD.js");var cn=typeof document<"u"?document.currentScript:null,de=Uu,di=process.cwd,Ut=null,pi=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return Ut||(Ut=di.call(process)),Ut};try{process.cwd()}catch{}if(typeof process.chdir=="function"){var Dn=process.chdir;process.chdir=function(t){Ut=null,Dn.call(process,t)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,Dn)}var mi=yi;function yi(t){de.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&e(t),t.lutimes||r(t),t.chown=i(t.chown),t.fchown=i(t.fchown),t.lchown=i(t.lchown),t.chmod=n(t.chmod),t.fchmod=n(t.fchmod),t.lchmod=n(t.lchmod),t.chownSync=u(t.chownSync),t.fchownSync=u(t.fchownSync),t.lchownSync=u(t.lchownSync),t.chmodSync=s(t.chmodSync),t.fchmodSync=s(t.fchmodSync),t.lchmodSync=s(t.lchmodSync),t.stat=o(t.stat),t.fstat=o(t.fstat),t.lstat=o(t.lstat),t.statSync=c(t.statSync),t.fstatSync=c(t.fstatSync),t.lstatSync=c(t.lstatSync),t.chmod&&!t.lchmod&&(t.lchmod=function(D,d,h){h&&process.nextTick(h)},t.lchmodSync=function(){}),t.chown&&!t.lchown&&(t.lchown=function(D,d,h,p){p&&process.nextTick(p)},t.lchownSync=function(){}),pi==="win32"&&(t.rename=typeof t.rename!="function"?t.rename:function(D){function d(h,p,m){var f=Date.now(),F=0;D(h,p,function y(x){if(x&&(x.code==="EACCES"||x.code==="EPERM"||x.code==="EBUSY")&&Date.now()-f<6e4){setTimeout(function(){t.stat(p,function(C,A){C&&C.code==="ENOENT"?D(h,p,y):m(x)})},F),F<100&&(F+=10);return}m&&m(x)})}return Object.setPrototypeOf&&Object.setPrototypeOf(d,D),d}(t.rename)),t.read=typeof t.read!="function"?t.read:function(D){function d(h,p,m,f,F,y){var x;if(y&&typeof y=="function"){var C=0;x=function(A,N,k){if(A&&A.code==="EAGAIN"&&C<10)return C++,D.call(t,h,p,m,f,F,x);y.apply(this,arguments)}}return D.call(t,h,p,m,f,F,x)}return Object.setPrototypeOf&&Object.setPrototypeOf(d,D),d}(t.read),t.readSync=typeof t.readSync!="function"?t.readSync:function(D){return function(d,h,p,m,f){for(var F=0;;)try{return D.call(t,d,h,p,m,f)}catch(y){if(y.code==="EAGAIN"&&F<10){F++;continue}throw y}}}(t.readSync);function e(D){D.lchmod=function(d,h,p){D.open(d,de.O_WRONLY|de.O_SYMLINK,h,function(m,f){if(m){p&&p(m);return}D.fchmod(f,h,function(F){D.close(f,function(y){p&&p(F||y)})})})},D.lchmodSync=function(d,h){var p=D.openSync(d,de.O_WRONLY|de.O_SYMLINK,h),m=!0,f;try{f=D.fchmodSync(p,h),m=!1}finally{if(m)try{D.closeSync(p)}catch{}else D.closeSync(p)}return f}}function r(D){de.hasOwnProperty("O_SYMLINK")&&D.futimes?(D.lutimes=function(d,h,p,m){D.open(d,de.O_SYMLINK,function(f,F){if(f){m&&m(f);return}D.futimes(F,h,p,function(y){D.close(F,function(x){m&&m(y||x)})})})},D.lutimesSync=function(d,h,p){var m=D.openSync(d,de.O_SYMLINK),f,F=!0;try{f=D.futimesSync(m,h,p),F=!1}finally{if(F)try{D.closeSync(m)}catch{}else D.closeSync(m)}return f}):D.futimes&&(D.lutimes=function(d,h,p,m){m&&process.nextTick(m)},D.lutimesSync=function(){})}function n(D){return D&&function(d,h,p){return D.call(t,d,h,function(m){l(m)&&(m=null),p&&p.apply(this,arguments)})}}function s(D){return D&&function(d,h){try{return D.call(t,d,h)}catch(p){if(!l(p))throw p}}}function i(D){return D&&function(d,h,p,m){return D.call(t,d,h,p,function(f){l(f)&&(f=null),m&&m.apply(this,arguments)})}}function u(D){return D&&function(d,h,p){try{return D.call(t,d,h,p)}catch(m){if(!l(m))throw m}}}function o(D){return D&&function(d,h,p){typeof h=="function"&&(p=h,h=null);function m(f,F){F&&(F.uid<0&&(F.uid+=4294967296),F.gid<0&&(F.gid+=4294967296)),p&&p.apply(this,arguments)}return h?D.call(t,d,h,m):D.call(t,d,m)}}function c(D){return D&&function(d,h){var p=h?D.call(t,d,h):D.call(t,d);return p&&(p.uid<0&&(p.uid+=4294967296),p.gid<0&&(p.gid+=4294967296)),p}}function l(D){if(!D||D.code==="ENOSYS")return!0;var d=!process.getuid||process.getuid()!==0;return!!(d&&(D.code==="EINVAL"||D.code==="EPERM"))}}var ln=ae.Stream,Fi=gi;function gi(t){return{ReadStream:e,WriteStream:r};function e(n,s){if(!(this instanceof e))return new e(n,s);ln.call(this);var i=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,s=s||{};for(var u=Object.keys(s),o=0,c=u.length;o<c;o++){var l=u[o];this[l]=s[l]}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){i._read()});return}t.open(this.path,this.flags,this.mode,function(D,d){if(D){i.emit("error",D),i.readable=!1;return}i.fd=d,i.emit("open",d),i._read()})}function r(n,s){if(!(this instanceof r))return new r(n,s);ln.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,s=s||{};for(var i=Object.keys(s),u=0,o=i.length;u<o;u++){var c=i[u];this[c]=s[c]}if(this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=t.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}var Ei=bi,Ci=Object.getPrototypeOf||function(t){return t.__proto__};function bi(t){if(t===null||typeof t!="object")return t;if(t instanceof Object)var e={__proto__:Ci(t)};else var e=Object.create(null);return Object.getOwnPropertyNames(t).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}var G=he,wi=mi,_i=Fi,xi=Ei,wt=te,Z,Gt;typeof Symbol=="function"&&typeof Symbol.for=="function"?(Z=Symbol.for("graceful-fs.queue"),Gt=Symbol.for("graceful-fs.previous")):(Z="___graceful-fs.queue",Gt="___graceful-fs.previous");function Ai(){}function Mu(t,e){Object.defineProperty(t,Z,{get:function(){return e}})}var Be=Ai;wt.debuglog?Be=wt.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(Be=function(){var t=wt.format.apply(wt,arguments);t="GFS4: "+t.split(/\n/).join(` GFS4: `),console.error(t)});if(!G[Z]){var Bi=R.commonjsGlobal[Z]||[];Mu(G,Bi),G.close=function(t){function e(r,n){return t.call(G,r,function(s){s||fn(),typeof n=="function"&&n.apply(this,arguments)})}return Object.defineProperty(e,Gt,{value:t}),e}(G.close),G.closeSync=function(t){function e(r){t.apply(G,arguments),fn()}return Object.defineProperty(e,Gt,{value:t}),e}(G.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){Be(G[Z]),Zt.equal(G[Z].length,0)})}R.commonjsGlobal[Z]||Mu(R.commonjsGlobal,G[Z]);var zu=zr(xi(G));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!G.__patched&&(zu=zr(G),G.__patched=!0);function zr(t){wi(t),t.gracefulify=zr,t.createReadStream=N,t.createWriteStream=k;var e=t.readFile;t.readFile=r;function r(g,b,_){return typeof b=="function"&&(_=b,b=null),P(g,b,_);function P(T,j,O,$){return e(T,j,function(B){B&&(B.code==="EMFILE"||B.code==="ENFILE")?je([P,[T,j,O],B,$||Date.now(),Date.now()]):typeof O=="function"&&O.apply(this,arguments)})}}var n=t.writeFile;t.writeFile=s;function s(g,b,_,P){return typeof _=="function"&&(P=_,_=null),T(g,b,_,P);function T(j,O,$,B,L){return n(j,O,$,function(v){v&&(v.code==="EMFILE"||v.code==="ENFILE")?je([T,[j,O,$,B],v,L||Date.now(),Date.now()]):typeof B=="function"&&B.apply(this,arguments)})}}var i=t.appendFile;i&&(t.appendFile=u);function u(g,b,_,P){return typeof _=="function"&&(P=_,_=null),T(g,b,_,P);function T(j,O,$,B,L){return i(j,O,$,function(v){v&&(v.code==="EMFILE"||v.code==="ENFILE")?je([T,[j,O,$,B],v,L||Date.now(),Date.now()]):typeof B=="function"&&B.apply(this,arguments)})}}var o=t.copyFile;o&&(t.copyFile=c);function c(g,b,_,P){return typeof _=="function"&&(P=_,_=0),T(g,b,_,P);function T(j,O,$,B,L){return o(j,O,$,function(v){v&&(v.code==="EMFILE"||v.code==="ENFILE")?je([T,[j,O,$,B],v,L||Date.now(),Date.now()]):typeof B=="function"&&B.apply(this,arguments)})}}var l=t.readdir;t.readdir=d;var D=/^v[0-5]\./;function d(g,b,_){typeof b=="function"&&(_=b,b=null);var P=D.test(process.version)?function(O,$,B,L){return l(O,T(O,$,B,L))}:function(O,$,B,L){return l(O,$,T(O,$,B,L))};return P(g,b,_);function T(j,O,$,B){return function(L,v){L&&(L.code==="EMFILE"||L.code==="ENFILE")?je([P,[j,O,$],L,B||Date.now(),Date.now()]):(v&&v.sort&&v.sort(),typeof $=="function"&&$.call(this,L,v))}}}if(process.version.substr(0,4)==="v0.8"){var h=_i(t);y=h.ReadStream,C=h.WriteStream}var p=t.ReadStream;p&&(y.prototype=Object.create(p.prototype),y.prototype.open=x);var m=t.WriteStream;m&&(C.prototype=Object.create(m.prototype),C.prototype.open=A),Object.defineProperty(t,"ReadStream",{get:function(){return y},set:function(g){y=g},enumerable:!0,configurable:!0}),Object.defineProperty(t,"WriteStream",{get:function(){return C},set:function(g){C=g},enumerable:!0,configurable:!0});var f=y;Object.defineProperty(t,"FileReadStream",{get:function(){return f},set:function(g){f=g},enumerable:!0,configurable:!0});var F=C;Object.defineProperty(t,"FileWriteStream",{get:function(){return F},set:function(g){F=g},enumerable:!0,configurable:!0});function y(g,b){return this instanceof y?(p.apply(this,arguments),this):y.apply(Object.create(y.prototype),arguments)}function x(){var g=this;I(g.path,g.flags,g.mode,function(b,_){b?(g.autoClose&&g.destroy(),g.emit("error",b)):(g.fd=_,g.emit("open",_),g.read())})}function C(g,b){return this instanceof C?(m.apply(this,arguments),this):C.apply(Object.create(C.prototype),arguments)}function A(){var g=this;I(g.path,g.flags,g.mode,function(b,_){b?(g.destroy(),g.emit("error",b)):(g.fd=_,g.emit("open",_))})}function N(g,b){return new t.ReadStream(g,b)}function k(g,b){return new t.WriteStream(g,b)}var S=t.open;t.open=I;function I(g,b,_,P){return typeof _=="function"&&(P=_,_=null),T(g,b,_,P);function T(j,O,$,B,L){return S(j,O,$,function(v,li){v&&(v.code==="EMFILE"||v.code==="ENFILE")?je([T,[j,O,$,B],v,L||Date.now(),Date.now()]):typeof B=="function"&&B.apply(this,arguments)})}}return t}function je(t){Be("ENQUEUE",t[0].name,t[1]),G[Z].push(t),Gr()}var _t;function fn(){for(var t=Date.now(),e=0;e<G[Z].length;++e)G[Z][e].length>2&&(G[Z][e][3]=t,G[Z][e][4]=t);Gr()}function Gr(){if(clearTimeout(_t),_t=void 0,G[Z].length!==0){var t=G[Z].shift(),e=t[0],r=t[1],n=t[2],s=t[3],i=t[4];if(s===void 0)Be("RETRY",e.name,r),e.apply(null,r);else if(Date.now()-s>=6e4){Be("TIMEOUT",e.name,r);var u=r.pop();typeof u=="function"&&u.call(null,n)}else{var o=Date.now()-i,c=Math.max(i-s,1),l=Math.min(c*1.2,100);o>=l?(Be("RETRY",e.name,r),e.apply(null,r.concat([s]))):G[Z].push(t)}_t===void 0&&(_t=setTimeout(Gr,0))}}const hn=R.getDefaultExportFromCjs(zu),Ee=mt.homedir(),{env:Te}=process,dn=Te.XDG_DATA_HOME||(Ee?J.join(Ee,".local","share"):void 0),Wt=Te.XDG_CONFIG_HOME||(Ee?J.join(Ee,".config"):void 0);Te.XDG_STATE_HOME||Ee&&J.join(Ee,".local","state");Te.XDG_CACHE_HOME||Ee&&J.join(Ee,".cache");Te.XDG_RUNTIME_DIR;const Si=(Te.XDG_DATA_DIRS||"/usr/local/share/:/usr/share/").split(":");dn&&Si.unshift(dn);const vi=(Te.XDG_CONFIG_DIRS||"/etc/xdg").split(":");Wt&&vi.unshift(Wt);var gt={exports:{}},He={exports:{}},Dr={exports:{}},pn;function Oi(){return pn||(pn=1,function(t){t.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"],process.platform!=="win32"&&t.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT"),process.platform==="linux"&&t.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")}(Dr)),Dr.exports}var H=R.commonjsGlobal.process;const Ce=function(t){return t&&typeof t=="object"&&typeof t.removeListener=="function"&&typeof t.emit=="function"&&typeof t.reallyExit=="function"&&typeof t.listeners=="function"&&typeof t.kill=="function"&&typeof t.pid=="number"&&typeof t.on=="function"};if(!Ce(H))He.exports=function(){return function(){}};else{var Pi=Zt,Ye=Oi(),Ri=/^win/i.test(H.platform),xt=Re;typeof xt!="function"&&(xt=xt.EventEmitter);var Q;H.__signal_exit_emitter__?Q=H.__signal_exit_emitter__:(Q=H.__signal_exit_emitter__=new xt,Q.count=0,Q.emitted={}),Q.infinite||(Q.setMaxListeners(1/0),Q.infinite=!0),He.exports=function(t,e){if(!Ce(R.commonjsGlobal.process))return function(){};Pi.equal(typeof t,"function","a callback must be provided for exit handler"),Qe===!1&&mn();var r="exit";e&&e.alwaysLast&&(r="afterexit");var n=function(){Q.removeListener(r,t),Q.listeners("exit").length===0&&Q.listeners("afterexit").length===0&&lr()};return Q.on(r,t),n};var lr=function(){!Qe||!Ce(R.commonjsGlobal.process)||(Qe=!1,Ye.forEach(function(e){try{H.removeListener(e,fr[e])}catch{}}),H.emit=hr,H.reallyExit=yn,Q.count-=1)};He.exports.unload=lr;var ke=function(e,r,n){Q.emitted[e]||(Q.emitted[e]=!0,Q.emit(e,r,n))},fr={};Ye.forEach(function(t){fr[t]=function(){if(Ce(R.commonjsGlobal.process)){var r=H.listeners(t);r.length===Q.count&&(lr(),ke("exit",null,t),ke("afterexit",null,t),Ri&&t==="SIGHUP"&&(t="SIGINT"),H.kill(H.pid,t))}}}),He.exports.signals=function(){return Ye};var Qe=!1,mn=function(){Qe||!Ce(R.commonjsGlobal.process)||(Qe=!0,Q.count+=1,Ye=Ye.filter(function(e){try{return H.on(e,fr[e]),!0}catch{return!1}}),H.emit=$i,H.reallyExit=Ti)};He.exports.load=mn;var yn=H.reallyExit,Ti=function(e){Ce(R.commonjsGlobal.process)&&(H.exitCode=e||0,ke("exit",H.exitCode,null),ke("afterexit",H.exitCode,null),yn.call(H,H.exitCode))},hr=H.emit,$i=function(e,r){if(e==="exit"&&Ce(R.commonjsGlobal.process)){r!==void 0&&(H.exitCode=r);var n=hr.apply(this,arguments);return ke("exit",H.exitCode,null),ke("afterexit",H.exitCode,null),n}else return hr.apply(this,arguments)}}var ji=He.exports,Gu=Wr;Wr.strict=Wu;Wr.loose=Vu;var ki=Object.prototype.toString,Li={"[object Int8Array]":!0,"[object Int16Array]":!0,"[object Int32Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Uint16Array]":!0,"[object Uint32Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0};function Wr(t){return Wu(t)||Vu(t)}function Wu(t){return t instanceof Int8Array||t instanceof Int16Array||t instanceof Int32Array||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Uint16Array||t instanceof Uint32Array||t instanceof Float32Array||t instanceof Float64Array}function Vu(t){return Li[ki.call(t)]}var Ni=Gu.strict,Ii=function(e){if(Ni(e)){var r=Buffer.from(e.buffer);return e.byteLength!==e.buffer.byteLength&&(r=r.slice(e.byteOffset,e.byteOffset+e.byteLength)),r}else return Buffer.from(e)};gt.exports=Wi;gt.exports.sync=Vi;gt.exports._getTmpname=Vr;gt.exports._cleanupOnExit=Jr;const z=he,Ui=R.imurmurhashExports,Ju=ji,qi=J,Ku=Gu,Yu=Ii,{promisify:ce}=te,ge={},Hi=function(){try{return require("worker_threads").threadId}catch{return 0}}();let Mi=0;function Vr(t){return t+"."+Ui(__filename).hash(String(process.pid)).hash(String(Hi)).hash(String(++Mi)).result()}function Jr(t){return()=>{try{z.unlinkSync(typeof t=="function"?t():t)}catch{}}}function zi(t){return new Promise(e=>{ge[t]||(ge[t]=[]),ge[t].push(e),ge[t].length===1&&e()})}function Vt(t){return t.code==="ENOSYS"||(!process.getuid||process.getuid()!==0)&&(t.code==="EINVAL"||t.code==="EPERM")}async function Gi(t,e,r={}){typeof r=="string"&&(r={encoding:r});let n,s;const i=Ju(Jr(()=>s)),u=qi.resolve(t);try{await zi(u);const o=await ce(z.realpath)(t).catch(()=>t);if(s=Vr(o),!r.mode||!r.chown){const c=await ce(z.stat)(o).catch(()=>{});c&&(r.mode==null&&(r.mode=c.mode),r.chown==null&&process.getuid&&(r.chown={uid:c.uid,gid:c.gid}))}n=await ce(z.open)(s,"w",r.mode),r.tmpfileCreated&&await r.tmpfileCreated(s),Ku(e)&&(e=Yu(e)),Buffer.isBuffer(e)?await ce(z.write)(n,e,0,e.length,0):e!=null&&await ce(z.write)(n,String(e),0,String(r.encoding||"utf8")),r.fsync!==!1&&await ce(z.fsync)(n),await ce(z.close)(n),n=null,r.chown&&await ce(z.chown)(s,r.chown.uid,r.chown.gid).catch(c=>{if(!Vt(c))throw c}),r.mode&&await ce(z.chmod)(s,r.mode).catch(c=>{if(!Vt(c))throw c}),await ce(z.rename)(s,o)}finally{n&&await ce(z.close)(n).catch(()=>{}),i(),await ce(z.unlink)(s).catch(()=>{}),ge[u].shift(),ge[u].length>0?ge[u][0]():delete ge[u]}}function Wi(t,e,r,n){r instanceof Function&&(n=r,r={});const s=Gi(t,e,r);return n&&s.then(n,n),s}function Vi(t,e,r){typeof r=="string"?r={encoding:r}:r||(r={});try{t=z.realpathSync(t)}catch{}const n=Vr(t);if(!r.mode||!r.chown)try{const c=z.statSync(t);r=Object.assign({},r),r.mode||(r.mode=c.mode),!r.chown&&process.getuid&&(r.chown={uid:c.uid,gid:c.gid})}catch{}let s;const i=Jr(n),u=Ju(i);let o=!0;try{if(s=z.openSync(n,"w",r.mode||438),r.tmpfileCreated&&r.tmpfileCreated(n),Ku(e)&&(e=Yu(e)),Buffer.isBuffer(e)?z.writeSync(s,e,0,e.length,0):e!=null&&z.writeSync(s,String(e),0,String(r.encoding||"utf8")),r.fsync!==!1&&z.fsyncSync(s),z.closeSync(s),s=null,r.chown)try{z.chownSync(n,r.chown.uid,r.chown.gid)}catch(c){if(!Vt(c))throw c}if(r.mode)try{z.chmodSync(n,r.mode)}catch(c){if(!Vt(c))throw c}z.renameSync(n,t),o=!1}finally{if(s)try{z.closeSync(s)}catch{}u(),o&&i()}}var Ji=gt.exports;const Fn=R.getDefaultExportFromCjs(Ji);var Ki=t=>{const e=typeof t;return t!==null&&(e==="object"||e==="function")};const be=Ki,Yi=new Set(["__proto__","prototype","constructor"]),Qi=t=>!t.some(e=>Yi.has(e));function At(t){const e=t.split("."),r=[];for(let n=0;n<e.length;n++){let s=e[n];for(;s[s.length-1]==="\\"&&e[n+1]!==void 0;)s=s.slice(0,-1)+".",s+=e[++n];r.push(s)}return Qi(r)?r:[]}var Xi={get(t,e,r){if(!be(t)||typeof e!="string")return r===void 0?t:r;const n=At(e);if(n.length!==0){for(let s=0;s<n.length;s++)if(t=t[n[s]],t==null){if(s!==n.length-1)return r;break}return t===void 0?r:t}},set(t,e,r){if(!be(t)||typeof e!="string")return t;const n=t,s=At(e);for(let i=0;i<s.length;i++){const u=s[i];be(t[u])||(t[u]={}),i===s.length-1&&(t[u]=r),t=t[u]}return n},delete(t,e){if(!be(t)||typeof e!="string")return!1;const r=At(e);for(let n=0;n<r.length;n++){const s=r[n];if(n===r.length-1)return delete t[s],!0;if(t=t[s],!be(t))return!1}},has(t,e){if(!be(t)||typeof e!="string")return!1;const r=At(e);if(r.length===0)return!1;for(let n=0;n<r.length;n++)if(be(t)){if(!(r[n]in t))return!1;t=t[r[n]]}else return!1;return!0}};const Xe=R.getDefaultExportFromCjs(Xi),Qu=te.promisify(er.randomBytes),Zi="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~".split(""),eo="0123456789".split(""),to="CDEHKMPRTUWXY012458".split(""),ro="!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~".split(""),no="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),uo=(t,e)=>{const r=e.length,n=Math.floor(65536/r)*r-1,s=2*Math.ceil(1.1*t);let i="",u=0;for(;u<t;){const o=er.randomBytes(s);let c=0;for(;c<s&&u<t;){const l=o.readUInt16LE(c);c+=2,!(l>n)&&(i+=e[l%r],u++)}}return i},so=async(t,e)=>{const r=e.length,n=Math.floor(65536/r)*r-1,s=2*Math.ceil(1.1*t);let i="",u=0;for(;u<t;){const o=await Qu(s);let c=0;for(;c<s&&u<t;){const l=o.readUInt16LE(c);c+=2,!(l>n)&&(i+=e[l%r],u++)}}return i},io=(t,e,r)=>er.randomBytes(t).toString(e).slice(0,r),oo=async(t,e,r)=>(await Qu(t)).toString(e).slice(0,r),ao=new Set([void 0,"hex","base64","url-safe","numeric","distinguishable","ascii-printable","alphanumeric"]),Xu=(t,e)=>({length:r,type:n,characters:s})=>{if(!(r>=0&&Number.isFinite(r)))throw new TypeError("Expected a `length` to be a non-negative finite number");if(n!==void 0&&s!==void 0)throw new TypeError("Expected either `type` or `characters`");if(s!==void 0&&typeof s!="string")throw new TypeError("Expected `characters` to be string");if(!ao.has(n))throw new TypeError(`Unknown type: ${n}`);if(n===void 0&&s===void 0&&(n="hex"),n==="hex"||n===void 0&&s===void 0)return e(Math.ceil(r*.5),"hex",r);if(n==="base64")return e(Math.ceil(r*.75),"base64",r);if(n==="url-safe")return t(r,Zi);if(n==="numeric")return t(r,eo);if(n==="distinguishable")return t(r,to);if(n==="ascii-printable")return t(r,ro);if(n==="alphanumeric")return t(r,no);if(s.length===0)throw new TypeError("Expected `characters` string length to be greater than or equal to 1");if(s.length>65536)throw new TypeError("Expected `characters` string length to be less or equal to 65536");return t(r,s.split(""))},Zu=Xu(uo,io);Zu.async=Xu(so,oo);function co(){return Zu({length:32})}const Do=Wt||J.join(mt.tmpdir(),co()),gn="You don't have access to this file.",lo={mode:448,recursive:!0},En={mode:384};class fo{constructor(e,r,n={}){const s=n.globalConfigPath?J.join(e,"config.json"):J.join("configstore",`${e}.json`);this._path=n.configPath||J.join(Do,s),r&&(this.all={...r,...this.all})}get all(){try{return JSON.parse(hn.readFileSync(this._path,"utf8"))}catch(e){if(e.code==="ENOENT")return{};if(e.code==="EACCES"&&(e.message=`${e.message} ${gn} `),e.name==="SyntaxError")return Fn.sync(this._path,"",En),{};throw e}}set all(e){try{hn.mkdirSync(J.dirname(this._path),lo),Fn.sync(this._path,JSON.stringify(e,void 0," "),En)}catch(r){throw r.code==="EACCES"&&(r.message=`${r.message} ${gn} `),r}}get size(){return Object.keys(this.all||{}).length}get(e){return Xe.get(this.all,e)}set(e,r){const n=this.all;if(arguments.length===1)for(const s of Object.keys(e))Xe.set(n,s,e[s]);else Xe.set(n,e,r);this.all=n}has(e){return Xe.has(this.all,e)}delete(e){const r=this.all;Xe.delete(r,e),this.all=r}clear(){this.all={}}get path(){return this._path}}function ho(t,e){if(t=R.semver.parse(t),e=R.semver.parse(e),!(R.semver.compareBuild(t,e)>=0))return R.semver.diff(t,e)||"build"}const es=["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"];function po(t){return es.includes(t)}const mo=["Function","Generator","AsyncGenerator","GeneratorFunction","AsyncGeneratorFunction","AsyncFunction","Observable","Array","Buffer","Blob","Object","RegExp","Date","Error","Map","Set","WeakMap","WeakSet","WeakRef","ArrayBuffer","SharedArrayBuffer","DataView","Promise","URL","FormData","URLSearchParams","HTMLElement","NaN",...es];function yo(t){return mo.includes(t)}const Fo=["null","undefined","string","number","bigint","boolean","symbol"];function go(t){return Fo.includes(t)}function Ve(t){return e=>typeof e===t}const{toString:Eo}=Object.prototype,Et=t=>{const e=Eo.call(t).slice(8,-1);if(/HTML\w+Element/.test(e)&&a.domElement(t))return"HTMLElement";if(yo(e))return e},U=t=>e=>Et(e)===t;function a(t){if(t===null)return"null";switch(typeof t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(t)?"NaN":"number";case"boolean":return"boolean";case"function":return"Function";case"bigint":return"bigint";case"symbol":return"symbol"}if(a.observable(t))return"Observable";if(a.array(t))return"Array";if(a.buffer(t))return"Buffer";const e=Et(t);if(e)return e;if(t instanceof String||t instanceof Boolean||t instanceof Number)throw new TypeError("Please don't use object wrappers for primitive types");return"Object"}a.undefined=Ve("undefined");a.string=Ve("string");const Co=Ve("number");a.number=t=>Co(t)&&!a.nan(t);a.positiveNumber=t=>a.number(t)&&t>0;a.negativeNumber=t=>a.number(t)&&t<0;a.bigint=Ve("bigint");a.function_=Ve("function");a.null_=t=>t===null;a.class_=t=>a.function_(t)&&t.toString().startsWith("class ");a.boolean=t=>t===!0||t===!1;a.symbol=Ve("symbol");a.numericString=t=>a.string(t)&&!a.emptyStringOrWhitespace(t)&&!Number.isNaN(Number(t));a.array=(t,e)=>Array.isArray(t)?a.function_(e)?t.every(r=>e(r)):!0:!1;a.buffer=t=>t?.constructor?.isBuffer?.(t)??!1;a.blob=t=>U("Blob")(t);a.nullOrUndefined=t=>a.null_(t)||a.undefined(t);a.object=t=>!a.null_(t)&&(typeof t=="object"||a.function_(t));a.iterable=t=>a.function_(t?.[Symbol.iterator]);a.asyncIterable=t=>a.function_(t?.[Symbol.asyncIterator]);a.generator=t=>a.iterable(t)&&a.function_(t?.next)&&a.function_(t?.throw);a.asyncGenerator=t=>a.asyncIterable(t)&&a.function_(t.next)&&a.function_(t.throw);a.nativePromise=t=>U("Promise")(t);const bo=t=>a.function_(t?.then)&&a.function_(t?.catch);a.promise=t=>a.nativePromise(t)||bo(t);a.generatorFunction=U("GeneratorFunction");a.asyncGeneratorFunction=t=>Et(t)==="AsyncGeneratorFunction";a.asyncFunction=t=>Et(t)==="AsyncFunction";a.boundFunction=t=>a.function_(t)&&!t.hasOwnProperty("prototype");a.regExp=U("RegExp");a.date=U("Date");a.error=U("Error");a.map=t=>U("Map")(t);a.set=t=>U("Set")(t);a.weakMap=t=>U("WeakMap")(t);a.weakSet=t=>U("WeakSet")(t);a.weakRef=t=>U("WeakRef")(t);a.int8Array=U("Int8Array");a.uint8Array=U("Uint8Array");a.uint8ClampedArray=U("Uint8ClampedArray");a.int16Array=U("Int16Array");a.uint16Array=U("Uint16Array");a.int32Array=U("Int32Array");a.uint32Array=U("Uint32Array");a.float32Array=U("Float32Array");a.float64Array=U("Float64Array");a.bigInt64Array=U("BigInt64Array");a.bigUint64Array=U("BigUint64Array");a.arrayBuffer=U("ArrayBuffer");a.sharedArrayBuffer=U("SharedArrayBuffer");a.dataView=U("DataView");a.enumCase=(t,e)=>Object.values(e).includes(t);a.directInstanceOf=(t,e)=>Object.getPrototypeOf(t)===e.prototype;a.urlInstance=t=>U("URL")(t);a.urlString=t=>{if(!a.string(t))return!1;try{return new URL(t),!0}catch{return!1}};a.truthy=t=>!!t;a.falsy=t=>!t;a.nan=t=>Number.isNaN(t);a.primitive=t=>a.null_(t)||go(typeof t);a.integer=t=>Number.isInteger(t);a.safeInteger=t=>Number.isSafeInteger(t);a.plainObject=t=>{if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)};a.typedArray=t=>po(Et(t));const wo=t=>a.safeInteger(t)&&t>=0;a.arrayLike=t=>!a.nullOrUndefined(t)&&!a.function_(t)&&wo(t.length);a.tupleLike=(t,e)=>a.array(e)&&a.array(t)&&e.length===t.length?e.every((r,n)=>r(t[n])):!1;a.inRange=(t,e)=>{if(a.number(e))return t>=Math.min(0,e)&&t<=Math.max(e,0);if(a.array(e)&&e.length===2)return t>=Math.min(...e)&&t<=Math.max(...e);throw new TypeError(`Invalid range: ${JSON.stringify(e)}`)};const _o=1,xo=["innerHTML","ownerDocument","style","attributes","nodeValue"];a.domElement=t=>a.object(t)&&t.nodeType===_o&&a.string(t.nodeName)&&!a.plainObject(t)&&xo.every(e=>e in t);a.observable=t=>t?t===t[Symbol.observable]?.()||t===t["@@observable"]?.():!1;a.nodeStream=t=>a.object(t)&&a.function_(t.pipe)&&!a.observable(t);a.infinite=t=>t===Number.POSITIVE_INFINITY||t===Number.NEGATIVE_INFINITY;const ts=t=>e=>a.integer(e)&&Math.abs(e%2)===t;a.evenInteger=ts(0);a.oddInteger=ts(1);a.emptyArray=t=>a.array(t)&&t.length===0;a.nonEmptyArray=t=>a.array(t)&&t.length>0;a.emptyString=t=>a.string(t)&&t.length===0;const Ao=t=>a.string(t)&&!/\S/.test(t);a.emptyStringOrWhitespace=t=>a.emptyString(t)||Ao(t);a.nonEmptyString=t=>a.string(t)&&t.length>0;a.nonEmptyStringAndNotWhitespace=t=>a.string(t)&&!a.emptyStringOrWhitespace(t);a.emptyObject=t=>a.object(t)&&!a.map(t)&&!a.set(t)&&Object.keys(t).length===0;a.nonEmptyObject=t=>a.object(t)&&!a.map(t)&&!a.set(t)&&Object.keys(t).length>0;a.emptySet=t=>a.set(t)&&t.size===0;a.nonEmptySet=t=>a.set(t)&&t.size>0;a.emptyMap=t=>a.map(t)&&t.size===0;a.nonEmptyMap=t=>a.map(t)&&t.size>0;a.propertyKey=t=>a.any([a.string,a.number,a.symbol],t);a.formData=t=>U("FormData")(t);a.urlSearchParams=t=>U("URLSearchParams")(t);const rs=(t,e,r)=>{if(!a.function_(e))throw new TypeError(`Invalid predicate: ${JSON.stringify(e)}`);if(r.length===0)throw new TypeError("Invalid number of values");return t.call(r,e)};a.any=(t,...e)=>(a.array(t)?t:[t]).some(n=>rs(Array.prototype.some,n,e));a.all=(t,...e)=>rs(Array.prototype.every,t,e);const w=(t,e,r,n={})=>{if(!t){const{multipleValues:s}=n,i=s?`received values of types ${[...new Set(r.map(u=>`\`${a(u)}\``))].join(", ")}`:`received value of type \`${a(r)}\``;throw new TypeError(`Expected value which is \`${e}\`, ${i}.`)}},E={undefined:t=>w(a.undefined(t),"undefined",t),string:t=>w(a.string(t),"string",t),number:t=>w(a.number(t),"number",t),positiveNumber:t=>w(a.positiveNumber(t),"positive number",t),negativeNumber:t=>w(a.negativeNumber(t),"negative number",t),bigint:t=>w(a.bigint(t),"bigint",t),function_:t=>w(a.function_(t),"Function",t),null_:t=>w(a.null_(t),"null",t),class_:t=>w(a.class_(t),"Class",t),boolean:t=>w(a.boolean(t),"boolean",t),symbol:t=>w(a.symbol(t),"symbol",t),numericString:t=>w(a.numericString(t),"string with a number",t),array:(t,e)=>{w(a.array(t),"Array",t),e&&t.forEach(e)},buffer:t=>w(a.buffer(t),"Buffer",t),blob:t=>w(a.blob(t),"Blob",t),nullOrUndefined:t=>w(a.nullOrUndefined(t),"null or undefined",t),object:t=>w(a.object(t),"Object",t),iterable:t=>w(a.iterable(t),"Iterable",t),asyncIterable:t=>w(a.asyncIterable(t),"AsyncIterable",t),generator:t=>w(a.generator(t),"Generator",t),asyncGenerator:t=>w(a.asyncGenerator(t),"AsyncGenerator",t),nativePromise:t=>w(a.nativePromise(t),"native Promise",t),promise:t=>w(a.promise(t),"Promise",t),generatorFunction:t=>w(a.generatorFunction(t),"GeneratorFunction",t),asyncGeneratorFunction:t=>w(a.asyncGeneratorFunction(t),"AsyncGeneratorFunction",t),asyncFunction:t=>w(a.asyncFunction(t),"AsyncFunction",t),boundFunction:t=>w(a.boundFunction(t),"Function",t),regExp:t=>w(a.regExp(t),"RegExp",t),date:t=>w(a.date(t),"Date",t),error:t=>w(a.error(t),"Error",t),map:t=>w(a.map(t),"Map",t),set:t=>w(a.set(t),"Set",t),weakMap:t=>w(a.weakMap(t),"WeakMap",t),weakSet:t=>w(a.weakSet(t),"WeakSet",t),weakRef:t=>w(a.weakRef(t),"WeakRef",t),int8Array:t=>w(a.int8Array(t),"Int8Array",t),uint8Array:t=>w(a.uint8Array(t),"Uint8Array",t),uint8ClampedArray:t=>w(a.uint8ClampedArray(t),"Uint8ClampedArray",t),int16Array:t=>w(a.int16Array(t),"Int16Array",t),uint16Array:t=>w(a.uint16Array(t),"Uint16Array",t),int32Array:t=>w(a.int32Array(t),"Int32Array",t),uint32Array:t=>w(a.uint32Array(t),"Uint32Array",t),float32Array:t=>w(a.float32Array(t),"Float32Array",t),float64Array:t=>w(a.float64Array(t),"Float64Array",t),bigInt64Array:t=>w(a.bigInt64Array(t),"BigInt64Array",t),bigUint64Array:t=>w(a.bigUint64Array(t),"BigUint64Array",t),arrayBuffer:t=>w(a.arrayBuffer(t),"ArrayBuffer",t),sharedArrayBuffer:t=>w(a.sharedArrayBuffer(t),"SharedArrayBuffer",t),dataView:t=>w(a.dataView(t),"DataView",t),enumCase:(t,e)=>w(a.enumCase(t,e),"EnumCase",t),urlInstance:t=>w(a.urlInstance(t),"URL",t),urlString:t=>w(a.urlString(t),"string with a URL",t),truthy:t=>w(a.truthy(t),"truthy",t),falsy:t=>w(a.falsy(t),"falsy",t),nan:t=>w(a.nan(t),"NaN",t),primitive:t=>w(a.primitive(t),"primitive",t),integer:t=>w(a.integer(t),"integer",t),safeInteger:t=>w(a.safeInteger(t),"integer",t),plainObject:t=>w(a.plainObject(t),"plain object",t),typedArray:t=>w(a.typedArray(t),"TypedArray",t),arrayLike:t=>w(a.arrayLike(t),"array-like",t),tupleLike:(t,e)=>w(a.tupleLike(t,e),"tuple-like",t),domElement:t=>w(a.domElement(t),"HTMLElement",t),observable:t=>w(a.observable(t),"Observable",t),nodeStream:t=>w(a.nodeStream(t),"Node.js Stream",t),infinite:t=>w(a.infinite(t),"infinite number",t),emptyArray:t=>w(a.emptyArray(t),"empty array",t),nonEmptyArray:t=>w(a.nonEmptyArray(t),"non-empty array",t),emptyString:t=>w(a.emptyString(t),"empty string",t),emptyStringOrWhitespace:t=>w(a.emptyStringOrWhitespace(t),"empty string or whitespace",t),nonEmptyString:t=>w(a.nonEmptyString(t),"non-empty string",t),nonEmptyStringAndNotWhitespace:t=>w(a.nonEmptyStringAndNotWhitespace(t),"non-empty string and not whitespace",t),emptyObject:t=>w(a.emptyObject(t),"empty object",t),nonEmptyObject:t=>w(a.nonEmptyObject(t),"non-empty object",t),emptySet:t=>w(a.emptySet(t),"empty set",t),nonEmptySet:t=>w(a.nonEmptySet(t),"non-empty set",t),emptyMap:t=>w(a.emptyMap(t),"empty map",t),nonEmptyMap:t=>w(a.nonEmptyMap(t),"non-empty map",t),propertyKey:t=>w(a.propertyKey(t),"PropertyKey",t),formData:t=>w(a.formData(t),"FormData",t),urlSearchParams:t=>w(a.urlSearchParams(t),"URLSearchParams",t),evenInteger:t=>w(a.evenInteger(t),"even integer",t),oddInteger:t=>w(a.oddInteger(t),"odd integer",t),directInstanceOf:(t,e)=>w(a.directInstanceOf(t,e),"T",t),inRange:(t,e)=>w(a.inRange(t,e),"in range",t),any:(t,...e)=>w(a.any(t,...e),"predicate returns truthy for any value",e,{multipleValues:!0}),all:(t,...e)=>w(a.all(t,...e),"predicate returns truthy for all values",e,{multipleValues:!0})};Object.defineProperties(a,{class:{value:a.class_},function:{value:a.function_},null:{value:a.null_}});Object.defineProperties(E,{class:{value:E.class_},function:{value:E.function_},null:{value:E.null_}});let Bo=class extends Error{constructor(e){super(e||"Promise was canceled"),this.name="CancelError"}get isCanceled(){return!0}};class tr{static fn(e){return(...r)=>new tr((n,s,i)=>{r.push(i),e(...r).then(n,s)})}constructor(e){this._cancelHandlers=[],this._isPending=!0,this._isCanceled=!1,this._rejectOnCancel=!0,this._promise=new Promise((r,n)=>{this._reject=n;const s=o=>{(!this._isCanceled||!u.shouldReject)&&(this._isPending=!1,r(o))},i=o=>{this._isPending=!1,n(o)},u=o=>{if(!this._isPending)throw new Error("The `onCancel` handler was attached after the promise settled.");this._cancelHandlers.push(o)};Object.defineProperties(u,{shouldReject:{get:()=>this._rejectOnCancel,set:o=>{this._rejectOnCancel=o}}}),e(s,i,u)})}then(e,r){return this._promise.then(e,r)}catch(e){return this._promise.catch(e)}finally(e){return this._promise.finally(e)}cancel(e){if(!(!this._isPending||this._isCanceled)){if(this._isCanceled=!0,this._cancelHandlers.length>0)try{for(const r of this._cancelHandlers)r()}catch(r){this._reject(r);return}this._rejectOnCancel&&this._reject(new Bo(e))}}get isCanceled(){return this._isCanceled}}Object.setPrototypeOf(tr.prototype,Promise.prototype);function So(t){return a.object(t)&&"_onResponse"in t}let Y=class extends Error{constructor(e,r,n){if(super(e),Object.defineProperty(this,"input",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"stack",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"response",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"request",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"timings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Error.captureStackTrace(this,this.constructor),this.name="RequestError",this.code=r.code??"ERR_GOT_REQUEST_ERROR",this.input=r.input,So(n)?(Object.defineProperty(this,"request",{enumerable:!1,value:n}),Object.defineProperty(this,"response",{enumerable:!1,value:n.response}),this.options=n.options):this.options=n,this.timings=this.request?.timings,a.string(r.stack)&&a.string(this.stack)){const s=this.stack.indexOf(this.message)+this.message.length,i=this.stack.slice(s).split(` `).reverse(),u=r.stack.slice(r.stack.indexOf(r.message)+r.message.length).split(` `).reverse();for(;u.length>0&&u[0]===i[0];)i.shift();this.stack=`${this.stack.slice(0,s)}${i.reverse().join(` `)}${u.reverse().join(` `)}`}}};class vo extends Y{constructor(e){super(`Redirected ${e.options.maxRedirects} times. Aborting.`,{},e),this.name="MaxRedirectsError",this.code="ERR_TOO_MANY_REDIRECTS"}}class Jt extends Y{constructor(e){super(`Response code ${e.statusCode} (${e.statusMessage})`,{},e.request),this.name="HTTPError",this.code="ERR_NON_2XX_3XX_RESPONSE"}}let Oo=class extends Y{constructor(e,r){super(e.message,e,r),this.name="CacheError",this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_CACHE_ACCESS":this.code}};class Cn extends Y{constructor(e,r){super(e.message,e,r),this.name="UploadError",this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_UPLOAD":this.code}}let Po=class extends Y{constructor(e,r,n){super(e.message,e,n),Object.defineProperty(this,"timings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"event",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name="TimeoutError",this.event=e.event,this.timings=r}};class bn extends Y{constructor(e,r){super(e.message,e,r),this.name="ReadError",this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_READING_RESPONSE_STREAM":this.code}}class Ro extends Y{constructor(e){super("Retrying",{},e),this.name="RetryError",this.code="ERR_RETRYING"}}class To extends Y{constructor(e){super("This operation was aborted.",{},e),this.code="ERR_ABORTED",this.name="AbortError"}}var Lr={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});function r(s){return s.encrypted}const n=(s,i)=>{let u;typeof i=="function"?u={connect:i}:u=i;const o=typeof u.connect=="function",c=typeof u.secureConnect=="function",l=typeof u.close=="function",D=()=>{o&&u.connect(),r(s)&&c&&(s.authorized?u.secureConnect():s.authorizationError||s.once("secureConnect",u.secureConnect)),l&&s.once("close",u.close)};s.writable&&!s.connecting?D():s.connecting?s.once("connect",D):s.destroyed&&l&&u.close(s._hadError)};e.default=n,t.exports=n,t.exports.default=n})(Lr,Lr.exports);var $o=Lr.exports;const jo=R.getDefaultExportFromCjs($o),ko=t=>{if(t.timings)return t.timings;const e={start:Date.now(),socket:void 0,lookup:void 0,connect:void 0,secureConnect:void 0,upload:void 0,response:void 0,end:void 0,error:void 0,abort:void 0,phases:{wait:void 0,dns:void 0,tcp:void 0,tls:void 0,request:void 0,firstByte:void 0,download:void 0,total:void 0}};t.timings=e;const r=u=>{u.once(Re.errorMonitor,()=>{e.error=Date.now(),e.phases.total=e.error-e.start})};r(t);const n=()=>{e.abort=Date.now(),e.phases.total=e.abort-e.start};t.prependOnceListener("abort",n);const s=u=>{if(e.socket=Date.now(),e.phases.wait=e.socket-e.start,te.types.isProxy(u))return;const o=()=>{e.lookup=Date.now(),e.phases.dns=e.lookup-e.socket};u.prependOnceListener("lookup",o),jo(u,{connect:()=>{e.connect=Date.now(),e.lookup===void 0&&(u.removeListener("lookup",o),e.lookup=e.connect,e.phases.dns=e.lookup-e.socket),e.phases.tcp=e.connect-e.lookup},secureConnect:()=>{e.secureConnect=Date.now(),e.phases.tls=e.secureConnect-e.connect}})};t.socket?s(t.socket):t.prependOnceListener("socket",s);const i=()=>{e.upload=Date.now(),e.phases.request=e.upload-(e.secureConnect??e.connect)};return t.writableFinished?i():t.prependOnceListener("finish",i),t.prependOnceListener("response",u=>{e.response=Date.now(),e.phases.firstByte=e.response-e.upload,u.timings=e,r(u),u.prependOnceListener("end",()=>{t.off("abort",n),u.off("aborted",n),!e.phases.total&&(e.end=Date.now(),e.phases.download=e.end-e.response,e.phases.total=e.end-e.start)}),u.prependOnceListener("aborted",n)}),e},Lo="text/plain",No="us-ascii",dr=(t,e)=>e.some(r=>r instanceof RegExp?r.test(t):r===t),Io=new Set(["https:","http:","file:"]),Uo=t=>{try{const{protocol:e}=new URL(t);return e.endsWith(":")&&!e.includes(".")&&!Io.has(e)}catch{return!1}},qo=(t,{stripHash:e})=>{const r=/^data:(?<type>[^,]*?),(?<data>[^#]*?)(?:#(?<hash>.*))?$/.exec(t);if(!r)throw new Error(`Invalid URL: ${t}`);let{type:n,data:s,hash:i}=r.groups;const u=n.split(";");i=e?"":i;let o=!1;u[u.length-1]==="base64"&&(u.pop(),o=!0);const c=u.shift()?.toLowerCase()??"",D=[...u.map(d=>{let[h,p=""]=d.split("=").map(m=>m.trim());return h==="charset"&&(p=p.toLowerCase(),p===No)?"":`${h}${p?`=${p}`:""}`}).filter(Boolean)];return o&&D.push("base64"),(D.length>0||c&&c!==Lo)&&D.unshift(c),`data:${D.join(";")},${o?s.trim():s}${i?`#${i}`:""}`};function Ho(t,e){if(e={defaultProtocol:"http",normalizeProtocol:!0,forceHttp:!1,forceHttps:!1,stripAuthentication:!0,stripHash:!1,stripTextFragment:!0,stripWWW:!0,removeQueryParameters:[/^utm_\w+/i],removeTrailingSlash:!0,removeSingleSlash:!0,removeDirectoryIndex:!1,removeExplicitPort:!1,sortQueryParameters:!0,...e},typeof e.defaultProtocol=="string"&&!e.defaultProtocol.endsWith(":")&&(e.defaultProtocol=`${e.defaultProtocol}:`),t=t.trim(),/^data:/i.test(t))return qo(t,e);if(Uo(t))return t;const r=t.startsWith("//");!r&&/^\.*\//.test(t)||(t=t.replace(/^(?!(?:\w+:)?\/\/)|^\/\//,e.defaultProtocol));const s=new URL(t);if(e.forceHttp&&e.forceHttps)throw new Error("The `forceHttp` and `forceHttps` options cannot be used together");if(e.forceHttp&&s.protocol==="https:"&&(s.protocol="http:"),e.forceHttps&&s.protocol==="http:"&&(s.protocol="https:"),e.stripAuthentication&&(s.username="",s.password=""),e.stripHash?s.hash="":e.stripTextFragment&&(s.hash=s.hash.replace(/#?:~:text.*?$/i,"")),s.pathname){const u=/\b[a-z][a-z\d+\-.]{1,50}:\/\//g;let o=0,c="";for(;;){const D=u.exec(s.pathname);if(!D)break;const d=D[0],h=D.index,p=s.pathname.slice(o,h);c+=p.replace(/\/{2,}/g,"/"),c+=d,o=h+d.length}const l=s.pathname.slice(o,s.pathname.length);c+=l.replace(/\/{2,}/g,"/"),s.pathname=c}if(s.pathname)try{s.pathname=decodeURI(s.pathname)}catch{}if(e.removeDirectoryIndex===!0&&(e.removeDirectoryIndex=[/^index\.[a-z]+$/]),Array.isArray(e.removeDirectoryIndex)&&e.removeDirectoryIndex.length>0){let u=s.pathname.split("/");const o=u[u.length-1];dr(o,e.removeDirectoryIndex)&&(u=u.slice(0,-1),s.pathname=u.slice(1).join("/")+"/")}if(s.hostname&&(s.hostname=s.hostname.replace(/\.$/,""),e.stripWWW&&/^www\.(?!www\.)[a-z\-\d]{1,63}\.[a-z.\-\d]{2,63}$/.test(s.hostname)&&(s.hostname=s.hostname.replace(/^www\./,""))),Array.isArray(e.removeQueryParameters))for(const u of[...s.searchParams.keys()])dr(u,e.removeQueryParameters)&&s.searchParams.delete(u);if(!Array.isArray(e.keepQueryParameters)&&e.removeQueryParameters===!0&&(s.search=""),Array.isArray(e.keepQueryParameters)&&e.keepQueryParameters.length>0)for(const u of[...s.searchParams.keys()])dr(u,e.keepQueryParameters)||s.searchParams.delete(u);if(e.sortQueryParameters){s.searchParams.sort();try{s.search=decodeURIComponent(s.search)}catch{}}e.removeTrailingSlash&&(s.pathname=s.pathname.replace(/\/$/,"")),e.removeExplicitPort&&s.port&&(s.port="");const i=t;return t=s.toString(),!e.removeSingleSlash&&s.pathname==="/"&&!i.endsWith("/")&&s.hash===""&&(t=t.replace(/\/$/,"")),(e.removeTrailingSlash||s.pathname==="/")&&s.hash===""&&e.removeSingleSlash&&(t=t.replace(/\/$/,"")),r&&!e.normalizeProtocol&&(t=t.replace(/^http:\/\//,"//")),e.stripProtocol&&(t=t.replace(/^(?:https?:)?\/\//,"")),t}var Ct={exports:{}};const{PassThrough:Mo}=ae;var zo=t=>{t={...t};const{array:e}=t;let{encoding:r}=t;const n=r==="buffer";let s=!1;e?s=!(r||n):r=r||"utf8",n&&(r=null);const i=new Mo({objectMode:s});r&&i.setEncoding(r);let u=0;const o=[];return i.on("data",c=>{o.push(c),s?u=o.length:u+=c.length}),i.getBufferedValue=()=>e?o:n?Buffer.concat(o,u):o.join(""),i.getBufferedLength=()=>u,i};const{constants:Go}=ht,Wo=ae,{promisify:Vo}=te,Jo=zo,Ko=Vo(Wo.pipeline);class ns extends Error{constructor(){super("maxBuffer exceeded"),this.name="MaxBufferError"}}async function Kr(t,e){if(!t)throw new Error("Expected a stream");e={maxBuffer:1/0,...e};const{maxBuffer:r}=e,n=Jo(e);return await new Promise((s,i)=>{const u=o=>{o&&n.getBufferedLength()<=Go.MAX_LENGTH&&(o.bufferedData=n.getBufferedValue()),i(o)};(async()=>{try{await Ko(t,n),s()}catch(o){u(o)}})(),n.on("data",()=>{n.getBufferedLength()>r&&u(new ns)})}),n.getBufferedValue()}Ct.exports=Kr;Ct.exports.buffer=(t,e)=>Kr(t,{...e,encoding:"buffer"});Ct.exports.array=(t,e)=>Kr(t,{...e,array:!0});Ct.exports.MaxBufferError=ns;var Yo=Ct.exports;const us=R.getDefaultExportFromCjs(Yo);function Nr(t){return Object.fromEntries(Object.entries(t).map(([e,r])=>[e.toLowerCase(),r]))}class wn extends ae.Readable{statusCode;headers;body;url;constructor({statusCode:e,headers:r,body:n,url:s}){if(typeof e!="number")throw new TypeError("Argument `statusCode` should be a number");if(typeof r!="object")throw new TypeError("Argument `headers` should be an object");if(!(n instanceof Uint8Array))throw new TypeError("Argument `body` should be a buffer");if(typeof s!="string")throw new TypeError("Argument `url` should be a string");super({read(){this.push(n),this.push(null)}}),this.statusCode=e,this.headers=Nr(r),this.body=n,this.url=s}}var Yr={};Yr.stringify=function t(e){if(typeof e>"u")return e;if(e&&Buffer.isBuffer(e))return JSON.stringify(":base64:"+e.toString("base64"));if(e&&e.toJSON&&(e=e.toJSON()),e&&typeof e=="object"){var r="",n=Array.isArray(e);r=n?"[":"{";var s=!0;for(var i in e){var u=typeof e[i]=="function"||!n&&typeof e[i]>"u";Object.hasOwnProperty.call(e,i)&&!u&&(s||(r+=","),s=!1,n?e[i]==null?r+="null":r+=t(e[i]):e[i]!==void 0&&(r+=t(i)+":"+t(e[i])))}return r+=n?"]":"}",r}else return typeof e=="string"?JSON.stringify(/^:/.test(e)?":"+e:e):typeof e>"u"?"null":JSON.stringify(e)};Yr.parse=function(t){return JSON.parse(t,function(e,r){return typeof r=="string"?/^:base64:/.test(r)?Buffer.from(r.substring(8),"base64"):/^:/.test(r)?r.substring(1):r:r})};const Qo=Re,_n=Yr,Xo=t=>{const e={redis:"@keyv/redis",rediss:"@keyv/redis",mongodb:"@keyv/mongo",mongo:"@keyv/mongo",sqlite:"@keyv/sqlite",postgresql:"@keyv/postgres",postgres:"@keyv/postgres",mysql:"@keyv/mysql",etcd:"@keyv/etcd",offline:"@keyv/offline",tiered:"@keyv/tiered"};if(t.adapter||t.uri){const r=t.adapter||/^[^:+]*/.exec(t.uri)[0];return new(R.commonjsRequire(e[r]))(t)}return new Map},xn=["sqlite","postgres","mysql","mongo","redis","tiered"];class Zo extends Qo{constructor(e,{emitErrors:r=!0,...n}={}){if(super(),this.opts={namespace:"keyv",serialize:_n.stringify,deserialize:_n.parse,...typeof e=="string"?{uri:e}:e,...n},!this.opts.store){const i={...this.opts};this.opts.store=Xo(i)}if(this.opts.compression){const i=this.opts.compression;this.opts.serialize=i.serialize.bind(i),this.opts.deserialize=i.deserialize.bind(i)}typeof this.opts.store.on=="function"&&r&&this.opts.store.on("error",i=>this.emit("error",i)),this.opts.store.namespace=this.opts.namespace;const s=i=>async function*(){for await(const[u,o]of typeof i=="function"?i(this.opts.store.namespace):i){const c=await this.opts.deserialize(o);if(!(this.opts.store.namespace&&!u.includes(this.opts.store.namespace))){if(typeof c.expires=="number"&&Date.now()>c.expires){this.delete(u);continue}yield[this._getKeyUnprefix(u),c.value]}}};typeof this.opts.store[Symbol.iterator]=="function"&&this.opts.store instanceof Map?this.iterator=s(this.opts.store):typeof this.opts.store.iterator=="function"&&this.opts.store.opts&&this._checkIterableAdaptar()&&(this.iterator=s(this.opts.store.iterator.bind(this.opts.store)))}_checkIterableAdaptar(){return xn.includes(this.opts.store.opts.dialect)||xn.findIndex(e=>this.opts.store.opts.url.includes(e))>=0}_getKeyPrefix(e){return`${this.opts.namespace}:${e}`}_getKeyPrefixArray(e){return e.map(r=>`${this.opts.namespace}:${r}`)}_getKeyUnprefix(e){return e.split(":").splice(1).join(":")}get(e,r){const{store:n}=this.opts,s=Array.isArray(e),i=s?this._getKeyPrefixArray(e):this._getKeyPrefix(e);if(s&&n.getMany===void 0){const u=[];for(const o of i)u.push(Promise.resolve().then(()=>n.get(o)).then(c=>typeof c=="string"?this.opts.deserialize(c):this.opts.compression?this.opts.deserialize(c):c).then(c=>{if(c!=null)return typeof c.expires=="number"&&Date.now()>c.expires?this.delete(o).then(()=>{}):r&&r.raw?c:c.value}));return Promise.allSettled(u).then(o=>{const c=[];for(const l of o)c.push(l.value);return c})}return Promise.resolve().then(()=>s?n.getMany(i):n.get(i)).then(u=>typeof u=="string"?this.opts.deserialize(u):this.opts.compression?this.opts.deserialize(u):u).then(u=>{if(u!=null)return s?u.map((o,c)=>{if(typeof o=="string"&&(o=this.opts.deserialize(o)),o!=null){if(typeof o.expires=="number"&&Date.now()>o.expires){this.delete(e[c]).then(()=>{});return}return r&&r.raw?o:o.value}}):typeof u.expires=="number"&&Date.now()>u.expires?this.delete(e).then(()=>{}):r&&r.raw?u:u.value})}set(e,r,n){const s=this._getKeyPrefix(e);typeof n>"u"&&(n=this.opts.ttl),n===0&&(n=void 0);const{store:i}=this.opts;return Promise.resolve().then(()=>{const u=typeof n=="number"?Date.now()+n:null;return typeof r=="symbol"&&this.emit("error","symbol cannot be serialized"),r={value:r,expires:u},this.opts.serialize(r)}).then(u=>i.set(s,u,n)).then(()=>!0)}delete(e){const{store:r}=this.opts;if(Array.isArray(e)){const s=this._getKeyPrefixArray(e);if(r.deleteMany===void 0){const i=[];for(const u of s)i.push(r.delete(u));return Promise.allSettled(i).then(u=>u.every(o=>o.value===!0))}return Promise.resolve().then(()=>r.deleteMany(s))}const n=this._getKeyPrefix(e);return Promise.resolve().then(()=>r.delete(n))}clear(){const{store:e}=this.opts;return Promise.resolve().then(()=>e.clear())}has(e){const r=this._getKeyPrefix(e),{store:n}=this.opts;return Promise.resolve().then(async()=>typeof n.has=="function"?n.has(r):await n.get(r)!==void 0)}disconnect(){const{store:e}=this.opts;if(typeof e.disconnect=="function")return e.disconnect()}}var ea=Zo;const Bt=R.getDefaultExportFromCjs(ea),ta=["aborted","complete","headers","httpVersion","httpVersionMinor","httpVersionMajor","method","rawHeaders","rawTrailers","setTimeout","socket","statusCode","statusMessage","trailers","url"];function ra(t,e){if(e._readableState.autoDestroy)throw new Error("The second stream must have the `autoDestroy` option set to `false`");const r=new Set([...Object.keys(t),...ta]),n={};for(const s of r)s in e||(n[s]={get(){const i=t[s];return typeof i=="function"?i.bind(t):i},set(i){t[s]=i},enumerable:!0,configurable:!1});return Object.defineProperties(e,n),t.once("aborted",()=>{e.destroy(),e.emit("aborted")}),t.once("close",()=>{t.complete&&e.readable?e.once("end",()=>{e.emit("close")}):e.emit("close")}),e}class na extends Error{constructor(e){super(e.message),Object.assign(this,e)}}class Dt extends Error{constructor(e){super(e.message),Object.assign(this,e)}}class ua{constructor(e,r){this.hooks=new Map,this.request=()=>(n,s)=>{let i;if(typeof n=="string")i=pr(K.parse(n)),n={};else if(n instanceof K.URL)i=pr(K.parse(n