UNPKG

npm-check-updates

Version:

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

37 lines 125 kB
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const B=require("node:process"),Sr=require("node:child_process"),Te=require("node:url"),x=require("node:path"),q=require("node:util"),ae=require("node:os"),U=require("./index.js"),S=require("node:fs"),It=require("node:constants"),Su=require("node:stream"),Nt=require("node:assert"),z=require("./index-B5lQw6vg.js"),xr=require("node:events"),Or=require("node:http"),Tt=require("./index-BnIU43YD.js");var we=typeof document<"u"?document.currentScript:null,re=It,Rr=process.cwd,qe=null,$r=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return qe||(qe=Rr.call(process)),qe};try{process.cwd()}catch{}if(typeof process.chdir=="function"){var Uu=process.chdir;process.chdir=function(e){qe=null,Uu.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,Uu)}var Ir=Nr;function Nr(e){re.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&u(e),e.lutimes||t(e),e.chown=D(e.chown),e.fchown=D(e.fchown),e.lchown=D(e.lchown),e.chmod=r(e.chmod),e.fchmod=r(e.fchmod),e.lchmod=r(e.lchmod),e.chownSync=o(e.chownSync),e.fchownSync=o(e.fchownSync),e.lchownSync=o(e.lchownSync),e.chmodSync=n(e.chmodSync),e.fchmodSync=n(e.fchmodSync),e.lchmodSync=n(e.lchmodSync),e.stat=s(e.stat),e.fstat=s(e.fstat),e.lstat=s(e.lstat),e.statSync=f(e.statSync),e.fstatSync=f(e.fstatSync),e.lstatSync=f(e.lstatSync),e.chmod&&!e.lchmod&&(e.lchmod=function(i,c,F){F&&process.nextTick(F)},e.lchmodSync=function(){}),e.chown&&!e.lchown&&(e.lchown=function(i,c,F,l){l&&process.nextTick(l)},e.lchownSync=function(){}),$r==="win32"&&(e.rename=typeof e.rename!="function"?e.rename:function(i){function c(F,l,h){var p=Date.now(),C=0;i(F,l,function m(N){if(N&&(N.code==="EACCES"||N.code==="EPERM"||N.code==="EBUSY")&&Date.now()-p<6e4){setTimeout(function(){e.stat(l,function($,j){$&&$.code==="ENOENT"?i(F,l,m):h(N)})},C),C<100&&(C+=10);return}h&&h(N)})}return Object.setPrototypeOf&&Object.setPrototypeOf(c,i),c}(e.rename)),e.read=typeof e.read!="function"?e.read:function(i){function c(F,l,h,p,C,m){var N;if(m&&typeof m=="function"){var $=0;N=function(j,ee,W){if(j&&j.code==="EAGAIN"&&$<10)return $++,i.call(e,F,l,h,p,C,N);m.apply(this,arguments)}}return i.call(e,F,l,h,p,C,N)}return Object.setPrototypeOf&&Object.setPrototypeOf(c,i),c}(e.read),e.readSync=typeof e.readSync!="function"?e.readSync:function(i){return function(c,F,l,h,p){for(var C=0;;)try{return i.call(e,c,F,l,h,p)}catch(m){if(m.code==="EAGAIN"&&C<10){C++;continue}throw m}}}(e.readSync);function u(i){i.lchmod=function(c,F,l){i.open(c,re.O_WRONLY|re.O_SYMLINK,F,function(h,p){if(h){l&&l(h);return}i.fchmod(p,F,function(C){i.close(p,function(m){l&&l(C||m)})})})},i.lchmodSync=function(c,F){var l=i.openSync(c,re.O_WRONLY|re.O_SYMLINK,F),h=!0,p;try{p=i.fchmodSync(l,F),h=!1}finally{if(h)try{i.closeSync(l)}catch{}else i.closeSync(l)}return p}}function t(i){re.hasOwnProperty("O_SYMLINK")&&i.futimes?(i.lutimes=function(c,F,l,h){i.open(c,re.O_SYMLINK,function(p,C){if(p){h&&h(p);return}i.futimes(C,F,l,function(m){i.close(C,function(N){h&&h(m||N)})})})},i.lutimesSync=function(c,F,l){var h=i.openSync(c,re.O_SYMLINK),p,C=!0;try{p=i.futimesSync(h,F,l),C=!1}finally{if(C)try{i.closeSync(h)}catch{}else i.closeSync(h)}return p}):i.futimes&&(i.lutimes=function(c,F,l,h){h&&process.nextTick(h)},i.lutimesSync=function(){})}function r(i){return i&&function(c,F,l){return i.call(e,c,F,function(h){a(h)&&(h=null),l&&l.apply(this,arguments)})}}function n(i){return i&&function(c,F){try{return i.call(e,c,F)}catch(l){if(!a(l))throw l}}}function D(i){return i&&function(c,F,l,h){return i.call(e,c,F,l,function(p){a(p)&&(p=null),h&&h.apply(this,arguments)})}}function o(i){return i&&function(c,F,l){try{return i.call(e,c,F,l)}catch(h){if(!a(h))throw h}}}function s(i){return i&&function(c,F,l){typeof F=="function"&&(l=F,F=null);function h(p,C){C&&(C.uid<0&&(C.uid+=4294967296),C.gid<0&&(C.gid+=4294967296)),l&&l.apply(this,arguments)}return F?i.call(e,c,F,h):i.call(e,c,h)}}function f(i){return i&&function(c,F){var l=F?i.call(e,c,F):i.call(e,c);return l&&(l.uid<0&&(l.uid+=4294967296),l.gid<0&&(l.gid+=4294967296)),l}}function a(i){if(!i||i.code==="ENOSYS")return!0;var c=!process.getuid||process.getuid()!==0;return!!(c&&(i.code==="EINVAL"||i.code==="EPERM"))}}var qu=Su.Stream,Tr=Pr;function Pr(e){return{ReadStream:u,WriteStream:t};function u(r,n){if(!(this instanceof u))return new u(r,n);qu.call(this);var D=this;this.path=r,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,n=n||{};for(var o=Object.keys(n),s=0,f=o.length;s<f;s++){var a=o[s];this[a]=n[a]}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(){D._read()});return}e.open(this.path,this.flags,this.mode,function(i,c){if(i){D.emit("error",i),D.readable=!1;return}D.fd=c,D.emit("open",c),D._read()})}function t(r,n){if(!(this instanceof t))return new t(r,n);qu.call(this),this.path=r,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,n=n||{};for(var D=Object.keys(n),o=0,s=D.length;o<s;o++){var f=D[o];this[f]=n[f]}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=e.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}var Lr=kr,jr=Object.getPrototypeOf||function(e){return e.__proto__};function kr(e){if(e===null||typeof e!="object")return e;if(e instanceof Object)var u={__proto__:jr(e)};else var u=Object.create(null);return Object.getOwnPropertyNames(e).forEach(function(t){Object.defineProperty(u,t,Object.getOwnPropertyDescriptor(e,t))}),u}var k=S,Mr=Ir,Ur=Tr,qr=Lr,Le=q,G,Je;typeof Symbol=="function"&&typeof Symbol.for=="function"?(G=Symbol.for("graceful-fs.queue"),Je=Symbol.for("graceful-fs.previous")):(G="___graceful-fs.queue",Je="___graceful-fs.previous");function Wr(){}function Pt(e,u){Object.defineProperty(e,G,{get:function(){return u}})}var Fe=Wr;Le.debuglog?Fe=Le.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(Fe=function(){var e=Le.format.apply(Le,arguments);e="GFS4: "+e.split(/\n/).join(` GFS4: `),console.error(e)});if(!k[G]){var Gr=U.commonjsGlobal[G]||[];Pt(k,Gr),k.close=function(e){function u(t,r){return e.call(k,t,function(n){n||Wu(),typeof r=="function"&&r.apply(this,arguments)})}return Object.defineProperty(u,Je,{value:e}),u}(k.close),k.closeSync=function(e){function u(t){e.apply(k,arguments),Wu()}return Object.defineProperty(u,Je,{value:e}),u}(k.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){Fe(k[G]),Nt.equal(k[G].length,0)})}U.commonjsGlobal[G]||Pt(U.commonjsGlobal,k[G]);var Lt=xu(qr(k));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!k.__patched&&(Lt=xu(k),k.__patched=!0);function xu(e){Mr(e),e.gracefulify=xu,e.createReadStream=ee,e.createWriteStream=W;var u=e.readFile;e.readFile=t;function t(d,E,g){return typeof E=="function"&&(g=E,E=null),b(d,E,g);function b(w,R,v,_){return u(w,R,function(y){y&&(y.code==="EMFILE"||y.code==="ENFILE")?ye([b,[w,R,v],y,_||Date.now(),Date.now()]):typeof v=="function"&&v.apply(this,arguments)})}}var r=e.writeFile;e.writeFile=n;function n(d,E,g,b){return typeof g=="function"&&(b=g,g=null),w(d,E,g,b);function w(R,v,_,y,I){return r(R,v,_,function(A){A&&(A.code==="EMFILE"||A.code==="ENFILE")?ye([w,[R,v,_,y],A,I||Date.now(),Date.now()]):typeof y=="function"&&y.apply(this,arguments)})}}var D=e.appendFile;D&&(e.appendFile=o);function o(d,E,g,b){return typeof g=="function"&&(b=g,g=null),w(d,E,g,b);function w(R,v,_,y,I){return D(R,v,_,function(A){A&&(A.code==="EMFILE"||A.code==="ENFILE")?ye([w,[R,v,_,y],A,I||Date.now(),Date.now()]):typeof y=="function"&&y.apply(this,arguments)})}}var s=e.copyFile;s&&(e.copyFile=f);function f(d,E,g,b){return typeof g=="function"&&(b=g,g=0),w(d,E,g,b);function w(R,v,_,y,I){return s(R,v,_,function(A){A&&(A.code==="EMFILE"||A.code==="ENFILE")?ye([w,[R,v,_,y],A,I||Date.now(),Date.now()]):typeof y=="function"&&y.apply(this,arguments)})}}var a=e.readdir;e.readdir=c;var i=/^v[0-5]\./;function c(d,E,g){typeof E=="function"&&(g=E,E=null);var b=i.test(process.version)?function(v,_,y,I){return a(v,w(v,_,y,I))}:function(v,_,y,I){return a(v,_,w(v,_,y,I))};return b(d,E,g);function w(R,v,_,y){return function(I,A){I&&(I.code==="EMFILE"||I.code==="ENFILE")?ye([b,[R,v,_],I,y||Date.now(),Date.now()]):(A&&A.sort&&A.sort(),typeof _=="function"&&_.call(this,I,A))}}}if(process.version.substr(0,4)==="v0.8"){var F=Ur(e);m=F.ReadStream,$=F.WriteStream}var l=e.ReadStream;l&&(m.prototype=Object.create(l.prototype),m.prototype.open=N);var h=e.WriteStream;h&&($.prototype=Object.create(h.prototype),$.prototype.open=j),Object.defineProperty(e,"ReadStream",{get:function(){return m},set:function(d){m=d},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return $},set:function(d){$=d},enumerable:!0,configurable:!0});var p=m;Object.defineProperty(e,"FileReadStream",{get:function(){return p},set:function(d){p=d},enumerable:!0,configurable:!0});var C=$;Object.defineProperty(e,"FileWriteStream",{get:function(){return C},set:function(d){C=d},enumerable:!0,configurable:!0});function m(d,E){return this instanceof m?(l.apply(this,arguments),this):m.apply(Object.create(m.prototype),arguments)}function N(){var d=this;T(d.path,d.flags,d.mode,function(E,g){E?(d.autoClose&&d.destroy(),d.emit("error",E)):(d.fd=g,d.emit("open",g),d.read())})}function $(d,E){return this instanceof $?(h.apply(this,arguments),this):$.apply(Object.create($.prototype),arguments)}function j(){var d=this;T(d.path,d.flags,d.mode,function(E,g){E?(d.destroy(),d.emit("error",E)):(d.fd=g,d.emit("open",g))})}function ee(d,E){return new e.ReadStream(d,E)}function W(d,E){return new e.WriteStream(d,E)}var O=e.open;e.open=T;function T(d,E,g,b){return typeof g=="function"&&(b=g,g=null),w(d,E,g,b);function w(R,v,_,y,I){return O(R,v,_,function(A,_r){A&&(A.code==="EMFILE"||A.code==="ENFILE")?ye([w,[R,v,_,y],A,I||Date.now(),Date.now()]):typeof y=="function"&&y.apply(this,arguments)})}}return e}function ye(e){Fe("ENQUEUE",e[0].name,e[1]),k[G].push(e),Ou()}var je;function Wu(){for(var e=Date.now(),u=0;u<k[G].length;++u)k[G][u].length>2&&(k[G][u][3]=e,k[G][u][4]=e);Ou()}function Ou(){if(clearTimeout(je),je=void 0,k[G].length!==0){var e=k[G].shift(),u=e[0],t=e[1],r=e[2],n=e[3],D=e[4];if(n===void 0)Fe("RETRY",u.name,t),u.apply(null,t);else if(Date.now()-n>=6e4){Fe("TIMEOUT",u.name,t);var o=t.pop();typeof o=="function"&&o.call(null,r)}else{var s=Date.now()-D,f=Math.max(D-n,1),a=Math.min(f*1.2,100);s>=a?(Fe("RETRY",u.name,t),u.apply(null,t.concat([n]))):k[G].push(e)}je===void 0&&(je=setTimeout(Ou,0))}}const Ke=U.getDefaultExportFromCjs(Lt),ce=ae.homedir(),{env:ge}=process,Gu=ge.XDG_DATA_HOME||(ce?x.join(ce,".local","share"):void 0),Xe=ge.XDG_CONFIG_HOME||(ce?x.join(ce,".config"):void 0);ge.XDG_STATE_HOME||ce&&x.join(ce,".local","state");ge.XDG_CACHE_HOME||ce&&x.join(ce,".cache");ge.XDG_RUNTIME_DIR;const Vr=(ge.XDG_DATA_DIRS||"/usr/local/share/:/usr/share/").split(":");Gu&&Vr.unshift(Gu);const Yr=(ge.XDG_CONFIG_DIRS||"/etc/xdg").split(":");Xe&&Yr.unshift(Xe);const ne=(e,u)=>function(...r){return e.apply(void 0,r).catch(u)},ue=(e,u)=>function(...r){try{return e.apply(void 0,r)}catch(n){return u(n)}},Hr=B.getuid?!B.getuid():!1,Jr=1e4,K=()=>{},L={isChangeErrorOk:e=>{if(!L.isNodeError(e))return!1;const{code:u}=e;return u==="ENOSYS"||!Hr&&(u==="EINVAL"||u==="EPERM")},isNodeError:e=>e instanceof Error,isRetriableError:e=>{if(!L.isNodeError(e))return!1;const{code:u}=e;return u==="EMFILE"||u==="ENFILE"||u==="EAGAIN"||u==="EBUSY"||u==="EACCESS"||u==="EACCES"||u==="EACCS"||u==="EPERM"},onChangeError:e=>{if(!L.isNodeError(e))throw e;if(!L.isChangeErrorOk(e))throw e}};class Kr{constructor(){this.interval=25,this.intervalId=void 0,this.limit=Jr,this.queueActive=new Set,this.queueWaiting=new Set,this.init=()=>{this.intervalId||(this.intervalId=setInterval(this.tick,this.interval))},this.reset=()=>{this.intervalId&&(clearInterval(this.intervalId),delete this.intervalId)},this.add=u=>{this.queueWaiting.add(u),this.queueActive.size<this.limit/2?this.tick():this.init()},this.remove=u=>{this.queueWaiting.delete(u),this.queueActive.delete(u)},this.schedule=()=>new Promise(u=>{const t=()=>this.remove(r),r=()=>u(t);this.add(r)}),this.tick=()=>{if(!(this.queueActive.size>=this.limit)){if(!this.queueWaiting.size)return this.reset();for(const u of this.queueWaiting){if(this.queueActive.size>=this.limit)break;this.queueWaiting.delete(u),this.queueActive.add(u),u()}}}}}const Xr=new Kr,De=(e,u)=>function(r){return function n(...D){return Xr.schedule().then(o=>{const s=a=>(o(),a),f=a=>{if(o(),Date.now()>=r)throw a;if(u(a)){const i=Math.round(100*Math.random());return new Promise(F=>setTimeout(F,i)).then(()=>n.apply(void 0,D))}throw a};return e.apply(void 0,D).then(s,f)})}},ie=(e,u)=>function(r){return function n(...D){try{return e.apply(void 0,D)}catch(o){if(Date.now()>r)throw o;if(u(o))return n.apply(void 0,D);throw o}}},Y={attempt:{chmod:ne(q.promisify(S.chmod),L.onChangeError),chown:ne(q.promisify(S.chown),L.onChangeError),close:ne(q.promisify(S.close),K),fsync:ne(q.promisify(S.fsync),K),mkdir:ne(q.promisify(S.mkdir),K),realpath:ne(q.promisify(S.realpath),K),stat:ne(q.promisify(S.stat),K),unlink:ne(q.promisify(S.unlink),K),chmodSync:ue(S.chmodSync,L.onChangeError),chownSync:ue(S.chownSync,L.onChangeError),closeSync:ue(S.closeSync,K),existsSync:ue(S.existsSync,K),fsyncSync:ue(S.fsync,K),mkdirSync:ue(S.mkdirSync,K),realpathSync:ue(S.realpathSync,K),statSync:ue(S.statSync,K),unlinkSync:ue(S.unlinkSync,K)},retry:{close:De(q.promisify(S.close),L.isRetriableError),fsync:De(q.promisify(S.fsync),L.isRetriableError),open:De(q.promisify(S.open),L.isRetriableError),readFile:De(q.promisify(S.readFile),L.isRetriableError),rename:De(q.promisify(S.rename),L.isRetriableError),stat:De(q.promisify(S.stat),L.isRetriableError),write:De(q.promisify(S.write),L.isRetriableError),writeFile:De(q.promisify(S.writeFile),L.isRetriableError),closeSync:ie(S.closeSync,L.isRetriableError),fsyncSync:ie(S.fsyncSync,L.isRetriableError),openSync:ie(S.openSync,L.isRetriableError),readFileSync:ie(S.readFileSync,L.isRetriableError),renameSync:ie(S.renameSync,L.isRetriableError),statSync:ie(S.statSync,L.isRetriableError),writeSync:ie(S.writeSync,L.isRetriableError),writeFileSync:ie(S.writeFileSync,L.isRetriableError)}},zr="utf8",Vu=438,Qr=511,Zr={},en=ae.userInfo().uid,un=ae.userInfo().gid,tn=1e3,rn=!!B.getuid;B.getuid&&B.getuid();const Yu=128,nn=e=>e instanceof Error&&"code"in e,Hu=e=>typeof e=="string",su=e=>e===void 0,Dn=B.platform==="linux",jt=B.platform==="win32",Ru=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];jt||Ru.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");Dn&&Ru.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED");class on{constructor(){this.callbacks=new Set,this.exited=!1,this.exit=u=>{if(!this.exited){this.exited=!0;for(const t of this.callbacks)t();u&&(jt&&u!=="SIGINT"&&u!=="SIGTERM"&&u!=="SIGKILL"?B.kill(B.pid,"SIGTERM"):B.kill(B.pid,u))}},this.hook=()=>{B.once("exit",()=>this.exit());for(const u of Ru)try{B.once(u,()=>this.exit(u))}catch{}},this.register=u=>(this.callbacks.add(u),()=>{this.callbacks.delete(u)}),this.hook()}}const sn=new on,an=sn.register,H={store:{},create:e=>{const u=`000000${Math.floor(Math.random()*16777215).toString(16)}`.slice(-6),n=`.tmp-${Date.now().toString().slice(-10)}${u}`;return`${e}${n}`},get:(e,u,t=!0)=>{const r=H.truncate(u(e));return r in H.store?H.get(e,u,t):(H.store[r]=t,[r,()=>delete H.store[r]])},purge:e=>{H.store[e]&&(delete H.store[e],Y.attempt.unlink(e))},purgeSync:e=>{H.store[e]&&(delete H.store[e],Y.attempt.unlinkSync(e))},purgeSyncAll:()=>{for(const e in H.store)H.purgeSync(e)},truncate:e=>{const u=x.basename(e);if(u.length<=Yu)return e;const t=/^(\.?)(.*?)((?:\.[^.]+)?(?:\.tmp-\d{10}[a-f0-9]{6})?)$/.exec(u);if(!t)return e;const r=u.length-Yu;return`${e.slice(0,-u.length)}${t[1]}${t[2].slice(0,-r)}${t[3]}`}};an(H.purgeSyncAll);function Bu(e,u,t=Zr){if(Hu(t))return Bu(e,u,{encoding:t});const r=Date.now()+((t.timeout??tn)||-1);let n=null,D=null,o=null;try{const s=Y.attempt.realpathSync(e),f=!!s;e=s||e,[D,n]=H.get(e,t.tmpCreate||H.create,t.tmpPurge!==!1);const a=rn&&su(t.chown),i=su(t.mode);if(f&&(a||i)){const c=Y.attempt.statSync(e);c&&(t={...t},a&&(t.chown={uid:c.uid,gid:c.gid}),i&&(t.mode=c.mode))}if(!f){const c=x.dirname(e);Y.attempt.mkdirSync(c,{mode:Qr,recursive:!0})}o=Y.retry.openSync(r)(D,"w",t.mode||Vu),t.tmpCreated&&t.tmpCreated(D),Hu(u)?Y.retry.writeSync(r)(o,u,0,t.encoding||zr):su(u)||Y.retry.writeSync(r)(o,u,0,u.length,0),t.fsync!==!1&&(t.fsyncWait!==!1?Y.retry.fsyncSync(r)(o):Y.attempt.fsync(o)),Y.retry.closeSync(r)(o),o=null,t.chown&&(t.chown.uid!==en||t.chown.gid!==un)&&Y.attempt.chownSync(D,t.chown.uid,t.chown.gid),t.mode&&t.mode!==Vu&&Y.attempt.chmodSync(D,t.mode);try{Y.retry.renameSync(r)(D,e)}catch(c){if(!nn(c)||c.code!=="ENAMETOOLONG")throw c;Y.retry.renameSync(r)(D,H.truncate(e))}n(),D=null}finally{o&&Y.attempt.closeSync(o),D&&H.purge(D)}}const de=e=>{const u=typeof e;return e!==null&&(u==="object"||u==="function")},au=new Set(["__proto__","prototype","constructor"]),cn=new Set("0123456789");function uu(e){const u=[];let t="",r="start",n=!1;for(const D of e)switch(D){case"\\":{if(r==="index")throw new Error("Invalid character in an index");if(r==="indexEnd")throw new Error("Invalid character after an index");n&&(t+=D),r="property",n=!n;break}case".":{if(r==="index")throw new Error("Invalid character in an index");if(r==="indexEnd"){r="property";break}if(n){n=!1,t+=D;break}if(au.has(t))return[];u.push(t),t="",r="property";break}case"[":{if(r==="index")throw new Error("Invalid character in an index");if(r==="indexEnd"){r="index";break}if(n){n=!1,t+=D;break}if(r==="property"){if(au.has(t))return[];u.push(t),t=""}r="index";break}case"]":{if(r==="index"){u.push(Number.parseInt(t,10)),t="",r="indexEnd";break}if(r==="indexEnd")throw new Error("Invalid character after an index")}default:{if(r==="index"&&!cn.has(D))throw new Error("Invalid character in an index");if(r==="indexEnd")throw new Error("Invalid character after an index");r==="start"&&(r="property"),n&&(n=!1,t+="\\"),t+=D}}switch(n&&(t+="\\"),r){case"property":{if(au.has(t))return[];u.push(t);break}case"index":throw new Error("Index was not closed");case"start":{u.push("");break}}return u}function $u(e,u){if(typeof u!="number"&&Array.isArray(e)){const t=Number.parseInt(u,10);return Number.isInteger(t)&&e[t]===e[u]}return!1}function kt(e,u){if($u(e,u))throw new Error("Cannot use string index")}function ln(e,u,t){if(!de(e)||typeof u!="string")return t===void 0?e:t;const r=uu(u);if(r.length===0)return t;for(let n=0;n<r.length;n++){const D=r[n];if($u(e,D)?e=n===r.length-1?void 0:null:e=e[D],e==null){if(n!==r.length-1)return t;break}}return e===void 0?t:e}function Ju(e,u,t){if(!de(e)||typeof u!="string")return e;const r=e,n=uu(u);for(let D=0;D<n.length;D++){const o=n[D];kt(e,o),D===n.length-1?e[o]=t:de(e[o])||(e[o]=typeof n[D+1]=="number"?[]:{}),e=e[o]}return r}function fn(e,u){if(!de(e)||typeof u!="string")return!1;const t=uu(u);for(let r=0;r<t.length;r++){const n=t[r];if(kt(e,n),r===t.length-1)return delete e[n],!0;if(e=e[n],!de(e))return!1}}function Fn(e,u){if(!de(e)||typeof u!="string")return!1;const t=uu(u);if(t.length===0)return!1;for(const r of t){if(!de(e)||!(r in e)||$u(e,r))return!1;e=e[r]}return!0}function hn(e,u){const t=u?x.join(e,"config.json"):x.join("configstore",`${e}.json`),r=Xe??Ke.mkdtempSync(Ke.realpathSync(ae.tmpdir())+x.sep);return x.join(r,t)}const Ku="You don't have access to this file.",dn={mode:448,recursive:!0},Xu={mode:384};class pn{constructor(u,t,r={}){this._path=r.configPath??hn(u,r.globalConfigPath),t&&(this.all={...t,...this.all})}get all(){try{return JSON.parse(Ke.readFileSync(this._path,"utf8"))}catch(u){if(u.code==="ENOENT")return{};if(u.code==="EACCES"&&(u.message=`${u.message} ${Ku} `),u.name==="SyntaxError")return Bu(this._path,"",Xu),{};throw u}}set all(u){try{Ke.mkdirSync(x.dirname(this._path),dn),Bu(this._path,JSON.stringify(u,void 0," "),Xu)}catch(t){throw t.code==="EACCES"&&(t.message=`${t.message} ${Ku} `),t}}get size(){return Object.keys(this.all||{}).length}get(u){return ln(this.all,u)}set(u,t){const r=this.all;if(arguments.length===1)for(const n of Object.keys(u))Ju(r,n,u[n]);else Ju(r,u,t);this.all=r}has(u){return Fn(this.all,u)}delete(u){const t=this.all;fn(t,u),this.all=t}clear(){this.all={}}get path(){return this._path}}class zu extends Error{constructor(u,t,r){const n=u.status||u.status===0?u.status:"",D=u.statusText||"",o=`${n} ${D}`.trim(),s=o?`status code ${o}`:"an unknown error";super(`Request failed with ${s}: ${t.method} ${t.url}`),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,"options",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name="HTTPError",this.response=u,this.request=t,this.options=r}}class Mt extends Error{constructor(u){super(`Request timed out: ${u.method} ${u.url}`),Object.defineProperty(this,"request",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name="TimeoutError",this.request=u}}const We=e=>e!==null&&typeof e=="object",ke=(...e)=>{for(const u of e)if((!We(u)||Array.isArray(u))&&u!==void 0)throw new TypeError("The `options` argument must be an object");return Iu({},...e)},Ut=(e={},u={})=>{const t=new globalThis.Headers(e),r=u instanceof globalThis.Headers,n=new globalThis.Headers(u);for(const[D,o]of n.entries())r&&o==="undefined"||o===void 0?t.delete(D):t.set(D,o);return t},Iu=(...e)=>{let u={},t={};for(const r of e)if(Array.isArray(r))Array.isArray(u)||(u=[]),u=[...u,...r];else if(We(r)){for(let[n,D]of Object.entries(r))We(D)&&n in u&&(D=Iu(u[n],D)),u={...u,[n]:D};We(r.headers)&&(t=Ut(t,r.headers),u.headers=t)}return u},En=(()=>{let e=!1,u=!1;const t=typeof globalThis.ReadableStream=="function",r=typeof globalThis.Request=="function";if(t&&r)try{u=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type")}catch(n){if(n instanceof Error&&n.message==="unsupported BodyInit type")return!1;throw n}return e&&!u})(),Cn=typeof globalThis.AbortController=="function",gn=typeof globalThis.ReadableStream=="function",mn=typeof globalThis.FormData=="function",qt=["get","post","put","patch","head","delete"],yn={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*"},cu=2147483647,Wt=Symbol("stop"),Bn={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,fetch:!0},An={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,dispatcher:!0,duplex:!0,priority:!0},vn=e=>qt.includes(e)?e.toUpperCase():e,bn=["get","put","head","delete","options","trace"],wn=[408,413,429,500,502,503,504],Gt=[413,429,503],Qu={limit:2,methods:bn,statusCodes:wn,afterStatusCodes:Gt,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:e=>.3*2**(e-1)*1e3},_n=(e={})=>{if(typeof e=="number")return{...Qu,limit:e};if(e.methods&&!Array.isArray(e.methods))throw new Error("retry.methods must be an array");if(e.statusCodes&&!Array.isArray(e.statusCodes))throw new Error("retry.statusCodes must be an array");return{...Qu,...e,afterStatusCodes:Gt}};async function Sn(e,u,t,r){return new Promise((n,D)=>{const o=setTimeout(()=>{t&&t.abort(),D(new Mt(e))},r.timeout);r.fetch(e,u).then(n).catch(D).then(()=>{clearTimeout(o)})})}async function xn(e,{signal:u}){return new Promise((t,r)=>{u&&(u.throwIfAborted(),u.addEventListener("abort",n,{once:!0}));function n(){clearTimeout(D),r(u.reason)}const D=setTimeout(()=>{u?.removeEventListener("abort",n),t()},e)})}const On=(e,u)=>{const t={};for(const r in u)!(r in An)&&!(r in Bn)&&!(r in e)&&(t[r]=u[r]);return t};class ze{static create(u,t){const r=new ze(u,t),n=async()=>{if(typeof r._options.timeout=="number"&&r._options.timeout>cu)throw new RangeError(`The \`timeout\` option cannot be greater than ${cu}`);await Promise.resolve();let s=await r._fetch();for(const f of r._options.hooks.afterResponse){const a=await f(r.request,r._options,r._decorateResponse(s.clone()));a instanceof globalThis.Response&&(s=a)}if(r._decorateResponse(s),!s.ok&&r._options.throwHttpErrors){let f=new zu(s,r.request,r._options);for(const a of r._options.hooks.beforeError)f=await a(f);throw f}if(r._options.onDownloadProgress){if(typeof r._options.onDownloadProgress!="function")throw new TypeError("The `onDownloadProgress` option must be a function");if(!gn)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");return r._stream(s.clone(),r._options.onDownloadProgress)}return s},o=r._options.retry.methods.includes(r.request.method.toLowerCase())?r._retry(n):n();for(const[s,f]of Object.entries(yn))o[s]=async()=>{r.request.headers.set("accept",r.request.headers.get("accept")||f);const i=(await o).clone();if(s==="json"){if(i.status===204||(await i.clone().arrayBuffer()).byteLength===0)return"";if(t.parseJson)return t.parseJson(await i.text())}return i[s]()};return o}constructor(u,t={}){Object.defineProperty(this,"request",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"abortController",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_retryCount",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_input",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_options",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._input=u;const r=this._input instanceof Request&&"credentials"in Request.prototype?this._input.credentials:void 0;if(this._options={...r&&{credentials:r},...t,headers:Ut(this._input.headers,t.headers),hooks:Iu({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},t.hooks),method:vn(t.method??this._input.method),prefixUrl:String(t.prefixUrl||""),retry:_n(t.retry),throwHttpErrors:t.throwHttpErrors!==!1,timeout:t.timeout??1e4,fetch:t.fetch??globalThis.fetch.bind(globalThis)},typeof this._input!="string"&&!(this._input instanceof URL||this._input instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(this._options.prefixUrl&&typeof this._input=="string"){if(this._input.startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");this._options.prefixUrl.endsWith("/")||(this._options.prefixUrl+="/"),this._input=this._options.prefixUrl+this._input}if(Cn){if(this.abortController=new globalThis.AbortController,this._options.signal){const n=this._options.signal;this._options.signal.addEventListener("abort",()=>{this.abortController.abort(n.reason)})}this._options.signal=this.abortController.signal}if(En&&(this._options.duplex="half"),this._options.json!==void 0&&(this._options.body=this._options.stringifyJson?.(this._options.json)??JSON.stringify(this._options.json),this._options.headers.set("content-type",this._options.headers.get("content-type")??"application/json")),this.request=new globalThis.Request(this._input,this._options),this._options.searchParams){const D="?"+(typeof this._options.searchParams=="string"?this._options.searchParams.replace(/^\?/,""):new URLSearchParams(this._options.searchParams).toString()),o=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,D);(mn&&this._options.body instanceof globalThis.FormData||this._options.body instanceof URLSearchParams)&&!(this._options.headers&&this._options.headers["content-type"])&&this.request.headers.delete("content-type"),this.request=new globalThis.Request(new globalThis.Request(o,{...this.request}),this._options)}}_calculateRetryDelay(u){if(this._retryCount++,this._retryCount<=this._options.retry.limit&&!(u instanceof Mt)){if(u instanceof zu){if(!this._options.retry.statusCodes.includes(u.response.status))return 0;const r=u.response.headers.get("Retry-After");if(r&&this._options.retry.afterStatusCodes.includes(u.response.status)){let n=Number(r)*1e3;Number.isNaN(n)&&(n=Date.parse(r)-Date.now());const D=this._options.retry.maxRetryAfter??n;return n<D?n:D}if(u.response.status===413)return 0}const t=this._options.retry.delay(this._retryCount);return Math.min(this._options.retry.backoffLimit,t)}return 0}_decorateResponse(u){return this._options.parseJson&&(u.json=async()=>this._options.parseJson(await u.text())),u}async _retry(u){try{return await u()}catch(t){const r=Math.min(this._calculateRetryDelay(t),cu);if(r!==0&&this._retryCount>0){await xn(r,{signal:this._options.signal});for(const n of this._options.hooks.beforeRetry)if(await n({request:this.request,options:this._options,error:t,retryCount:this._retryCount})===Wt)return;return this._retry(u)}throw t}}async _fetch(){for(const r of this._options.hooks.beforeRequest){const n=await r(this.request,this._options);if(n instanceof Request){this.request=n;break}if(n instanceof Response)return n}const u=On(this.request,this._options),t=this.request;return this.request=t.clone(),this._options.timeout===!1?this._options.fetch(t,u):Sn(t,u,this.abortController,this._options)}_stream(u,t){const r=Number(u.headers.get("content-length"))||0;let n=0;return u.status===204?(t&&t({percent:1,totalBytes:r,transferredBytes:n},new Uint8Array),new globalThis.Response(null,{status:u.status,statusText:u.statusText,headers:u.headers})):new globalThis.Response(new globalThis.ReadableStream({async start(D){const o=u.body.getReader();t&&t({percent:0,transferredBytes:0,totalBytes:r},new Uint8Array);async function s(){const{done:f,value:a}=await o.read();if(f){D.close();return}if(t){n+=a.byteLength;const i=r===0?0:n/r;t({percent:i,transferredBytes:n,totalBytes:r},a)}D.enqueue(a),await s()}await s()}}),{status:u.status,statusText:u.statusText,headers:u.headers})}}/*! MIT License © Sindre Sorhus */const Au=e=>{const u=(t,r)=>ze.create(t,ke(e,r));for(const t of qt)u[t]=(r,n)=>ze.create(r,ke(e,n,{method:t}));return u.create=t=>Au(ke(t)),u.extend=t=>Au(ke(e,t)),u.stop=Wt,u},Rn=Au();var _e={},pe={};pe.parse=pe.decode=$n;pe.stringify=pe.encode=Vt;pe.safe=ve;pe.unsafe=Ge;var lu=typeof process<"u"&&process.platform==="win32"?`\r `:` `;function Vt(e,u){var t=[],r="";typeof u=="string"?u={section:u,whitespace:!1}:(u=u||{},u.whitespace=u.whitespace===!0);var n=u.whitespace?" = ":"=";return Object.keys(e).forEach(function(D,o,s){var f=e[D];f&&Array.isArray(f)?f.forEach(function(a){r+=ve(D+"[]")+n+ve(a)+` `}):f&&typeof f=="object"?t.push(D):r+=ve(D)+n+ve(f)+lu}),u.section&&r.length&&(r="["+ve(u.section)+"]"+lu+r),t.forEach(function(D,o,s){var f=Yt(D).join("\\."),a=(u.section?u.section+".":"")+f,i=Vt(e[D],{section:a,whitespace:u.whitespace});r.length&&i.length&&(r+=lu),r+=i}),r}function Yt(e){return e.replace(/\1/g,"LITERAL\\1LITERAL").replace(/\\\./g,"").split(/\./).map(function(u){return u.replace(/\1/g,"\\.").replace(/\2LITERAL\\1LITERAL\2/g,"")})}function $n(e){var u={},t=u,r=null,n=/^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i,D=e.split(/[\r\n]+/g);return D.forEach(function(o,s,f){if(!(!o||o.match(/^\s*[;#]/))){var a=o.match(n);if(a){if(a[1]!==void 0){if(r=Ge(a[1]),r==="__proto__"){t={};return}t=u[r]=u[r]||{};return}var i=Ge(a[2]);if(i!=="__proto__"){var c=a[3]?Ge(a[4]):!0;switch(c){case"true":case"false":case"null":c=JSON.parse(c)}if(i.length>2&&i.slice(-2)==="[]"){if(i=i.substring(0,i.length-2),i==="__proto__")return;t[i]?Array.isArray(t[i])||(t[i]=[t[i]]):t[i]=[]}Array.isArray(t[i])?t[i].push(c):t[i]=c}}}}),Object.keys(u).filter(function(o,s,f){if(!u[o]||typeof u[o]!="object"||Array.isArray(u[o]))return!1;var a=Yt(o),i=u,c=a.pop(),F=c.replace(/\\\./g,".");return a.forEach(function(l,h,p){l!=="__proto__"&&((!i[l]||typeof i[l]!="object")&&(i[l]={}),i=i[l])}),i===u&&F===c?!1:(i[F]=u[o],!0)}).forEach(function(o,s,f){delete u[o]}),u}function Ht(e){return e.charAt(0)==='"'&&e.slice(-1)==='"'||e.charAt(0)==="'"&&e.slice(-1)==="'"}function ve(e){return typeof e!="string"||e.match(/[=\r\n]/)||e.match(/^\[/)||e.length>1&&Ht(e)||e!==e.trim()?JSON.stringify(e):e.replace(/;/g,"\\;").replace(/#/g,"\\#")}function Ge(e,u){if(e=(e||"").trim(),Ht(e)){e.charAt(0)==="'"&&(e=e.substr(1,e.length-2));try{e=JSON.parse(e)}catch{}}else{for(var t=!1,r="",n=0,D=e.length;n<D;n++){var o=e.charAt(n);if(t)"\\;#".indexOf(o)!==-1?r+=o:r+="\\"+o,t=!1;else{if(";#".indexOf(o)!==-1)break;o==="\\"?t=!0:r+=o}}return t&&(r+="\\"),r.trim()}return e}var fu=1,Zu=2;function In(){return""}function Nn(e,u,t){return e.slice(u,t).replace(/\S/g," ")}var Tn=function(e,u){u=u||{};for(var t,r,n=!1,D=!1,o=0,s="",f=u.whitespace===!1?In:Nn,a=0;a<e.length;a++){if(t=e[a],r=e[a+1],!D&&t==='"'){var i=e[a-1]==="\\"&&e[a-2]!=="\\";i||(n=!n)}if(!n){if(!D&&t+r==="//")s+=e.slice(o,a),o=a,D=fu,a++;else if(D===fu&&t+r===`\r `){a++,D=!1,s+=f(e,o,a),o=a;continue}else if(D===fu&&t===` `)D=!1,s+=f(e,o,a),o=a;else if(!D&&t+r==="/*"){s+=e.slice(o,a),o=a,D=Zu,a++;continue}else if(D===Zu&&t+r==="*/"){a++,D=!1,s+=f(e,o,a+1),o=a+1;continue}}}return s+(D?f(e.substr(o)):e.substr(o))},Jt=S,Pn=pe,Oe=x,Ln=Tn,jn=_e.parse=function(e){return/^\s*{/.test(e)?JSON.parse(Ln(e)):Pn.parse(e)},kn=_e.file=function(){var e=[].slice.call(arguments).filter(function(r){return r!=null});for(var u in e)if(typeof e[u]!="string")return;var t=Oe.join.apply(null,e);try{return Jt.readFileSync(t,"utf-8")}catch{return}};_e.json=function(){var e=kn.apply(null,arguments);return e?jn(e):null};_e.env=function(e,u){u=u||process.env;var t={},r=e.length;for(var n in u)if(n.toLowerCase().indexOf(e.toLowerCase())===0){for(var D=n.substring(r).split("__"),o;(o=D.indexOf(""))>-1;)D.splice(o,1);var s=t;D.forEach(function(a,i){!a||typeof s!="object"||(i===D.length-1&&(s[a]=u[n]),s[a]===void 0&&(s[a]={}),s=s[a])})}return t};_e.find=function(){var e=Oe.join.apply(null,[].slice.call(arguments));function u(t,r){var n=Oe.join(t,r);try{return Jt.statSync(n),n}catch{if(Oe.dirname(t)!==t)return u(Oe.dirname(t),r)}}return u(process.cwd(),e)};var Kt={exports:{}};/*! * @description Recursive object extending * @author Viacheslav Lotsmanov <lotsmanov89@gmail.com> * @license MIT * * The MIT License (MIT) * * Copyright (c) 2013-2018 Viacheslav Lotsmanov * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in * the Software without restriction, including without limitation the rights to * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * the Software, and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */function Xt(e){return e instanceof Buffer||e instanceof Date||e instanceof RegExp}function zt(e){if(e instanceof Buffer){var u=Buffer.alloc?Buffer.alloc(e.length):new Buffer(e.length);return e.copy(u),u}else{if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp)return new RegExp(e);throw new Error("Unexpected situation")}}function Qt(e){var u=[];return e.forEach(function(t,r){typeof t=="object"&&t!==null?Array.isArray(t)?u[r]=Qt(t):Xt(t)?u[r]=zt(t):u[r]=vu({},t):u[r]=t}),u}function et(e,u){return u==="__proto__"?void 0:e[u]}var vu=Kt.exports=function(){if(arguments.length<1||typeof arguments[0]!="object")return!1;if(arguments.length<2)return arguments[0];var e=arguments[0],u=Array.prototype.slice.call(arguments,1),t,r;return u.forEach(function(n){typeof n!="object"||n===null||Array.isArray(n)||Object.keys(n).forEach(function(D){if(r=et(e,D),t=et(n,D),t!==e)if(typeof t!="object"||t===null){e[D]=t;return}else if(Array.isArray(t)){e[D]=Qt(t);return}else if(Xt(t)){e[D]=zt(t);return}else if(typeof r!="object"||r===null||Array.isArray(r)){e[D]=vu({},t);return}else{e[D]=vu(r,t);return}})}),e},Mn=Kt.exports,Fu,ut;function Un(){if(ut)return Fu;ut=1;function e(r,n){var D=r;n.slice(0,-1).forEach(function(s){D=D[s]||{}});var o=n[n.length-1];return o in D}function u(r){return typeof r=="number"||/^0x[0-9a-f]+$/i.test(r)?!0:/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(r)}function t(r,n){return n==="constructor"&&typeof r[n]=="function"||n==="__proto__"}return Fu=function(r,n){n||(n={});var D={bools:{},strings:{},unknownFn:null};typeof n.unknown=="function"&&(D.unknownFn=n.unknown),typeof n.boolean=="boolean"&&n.boolean?D.allBools=!0:[].concat(n.boolean).filter(Boolean).forEach(function(O){D.bools[O]=!0});var o={};function s(O){return o[O].some(function(T){return D.bools[T]})}Object.keys(n.alias||{}).forEach(function(O){o[O]=[].concat(n.alias[O]),o[O].forEach(function(T){o[T]=[O].concat(o[O].filter(function(d){return T!==d}))})}),[].concat(n.string).filter(Boolean).forEach(function(O){D.strings[O]=!0,o[O]&&[].concat(o[O]).forEach(function(T){D.strings[T]=!0})});var f=n.default||{},a={_:[]};function i(O,T){return D.allBools&&/^--[^=]+$/.test(T)||D.strings[O]||D.bools[O]||o[O]}function c(O,T,d){for(var E=O,g=0;g<T.length-1;g++){var b=T[g];if(t(E,b))return;E[b]===void 0&&(E[b]={}),(E[b]===Object.prototype||E[b]===Number.prototype||E[b]===String.prototype)&&(E[b]={}),E[b]===Array.prototype&&(E[b]=[]),E=E[b]}var w=T[T.length-1];t(E,w)||((E===Object.prototype||E===Number.prototype||E===String.prototype)&&(E={}),E===Array.prototype&&(E=[]),E[w]===void 0||D.bools[w]||typeof E[w]=="boolean"?E[w]=d:Array.isArray(E[w])?E[w].push(d):E[w]=[E[w],d])}function F(O,T,d){if(!(d&&D.unknownFn&&!i(O,d)&&D.unknownFn(d)===!1)){var E=!D.strings[O]&&u(T)?Number(T):T;c(a,O.split("."),E),(o[O]||[]).forEach(function(g){c(a,g.split("."),E)})}}Object.keys(D.bools).forEach(function(O){F(O,f[O]===void 0?!1:f[O])});var l=[];r.indexOf("--")!==-1&&(l=r.slice(r.indexOf("--")+1),r=r.slice(0,r.indexOf("--")));for(var h=0;h<r.length;h++){var p=r[h],C,m;if(/^--.+=/.test(p)){var N=p.match(/^--([^=]+)=([\s\S]*)$/);C=N[1];var $=N[2];D.bools[C]&&($=$!=="false"),F(C,$,p)}else if(/^--no-.+/.test(p))C=p.match(/^--no-(.+)/)[1],F(C,!1,p);else if(/^--.+/.test(p))C=p.match(/^--(.+)/)[1],m=r[h+1],m!==void 0&&!/^(-|--)[^-]/.test(m)&&!D.bools[C]&&!D.allBools&&(!o[C]||!s(C))?(F(C,m,p),h+=1):/^(true|false)$/.test(m)?(F(C,m==="true",p),h+=1):F(C,D.strings[C]?"":!0,p);else if(/^-[^-]+/.test(p)){for(var j=p.slice(1,-1).split(""),ee=!1,W=0;W<j.length;W++){if(m=p.slice(W+2),m==="-"){F(j[W],m,p);continue}if(/[A-Za-z]/.test(j[W])&&m[0]==="="){F(j[W],m.slice(1),p),ee=!0;break}if(/[A-Za-z]/.test(j[W])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(m)){F(j[W],m,p),ee=!0;break}if(j[W+1]&&j[W+1].match(/\W/)){F(j[W],p.slice(W+2),p),ee=!0;break}else F(j[W],D.strings[j[W]]?"":!0,p)}C=p.slice(-1)[0],!ee&&C!=="-"&&(r[h+1]&&!/^(-|--)[^-]/.test(r[h+1])&&!D.bools[C]&&(!o[C]||!s(C))?(F(C,r[h+1],p),h+=1):r[h+1]&&/^(true|false)$/.test(r[h+1])?(F(C,r[h+1]==="true",p),h+=1):F(C,D.strings[C]?"":!0,p))}else if((!D.unknownFn||D.unknownFn(p)!==!1)&&a._.push(D.strings._||!u(p)?p:Number(p)),n.stopEarly){a._.push.apply(a._,r.slice(h+1));break}}return Object.keys(f).forEach(function(O){e(a,O.split("."))||(c(a,O.split("."),f[O]),(o[O]||[]).forEach(function(T){c(a,T.split("."),f[O])}))}),n["--"]?a["--"]=l.slice():l.forEach(function(O){a._.push(O)}),a},Fu}var Se=_e,Be=x.join,qn=Mn,tt="/etc",Zt=process.platform==="win32",xe=Zt?process.env.USERPROFILE:process.env.HOME,Wn=function(e,u,t,r){if(typeof e!="string")throw new Error("rc(name): name *must* be string");t||(t=Un()(process.argv.slice(2))),u=(typeof u=="string"?Se.json(u):u)||{},r=r||Se.parse;var n=Se.env(e+"_"),D=[u],o=[];function s(f){if(!(o.indexOf(f)>=0)){var a=Se.file(f);a&&(D.push(r(a)),o.push(f))}}return Zt||[Be(tt,e,"config"),Be(tt,e+"rc")].forEach(s),xe&&[Be(xe,".config",e,"config"),Be(xe,".config",e),Be(xe,"."+e,"config"),Be(xe,"."+e+"rc")].forEach(s),s(Se.find("."+e+"rc")),n.config&&s(n.config),t.config&&s(t.config),qn.apply(null,D.concat([n,t,o.length?{configs:o,config:o[o.length-1]}:void 0]))};const Gn=U.getDefaultExportFromCjs(Wn);function Vn(e){const u=Gn("npm",{registry:"https://registry.npmjs.org/"}),t=u[`${e}:registry`]||u.config_registry||u.registry;return t.slice(-1)==="/"?t:`${t}/`}var er={exports:{}},ur={},tu={},oe=It,Yn=process.cwd,Ve=null,Hn=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return Ve||(Ve=Yn.call(process)),Ve};try{process.cwd()}catch{}if(typeof process.chdir=="function"){var rt=process.chdir;process.chdir=function(e){Ve=null,rt.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,rt)}var Jn=Kn;function Kn(e){oe.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&u(e),e.lutimes||t(e),e.chown=D(e.chown),e.fchown=D(e.fchown),e.lchown=D(e.lchown),e.chmod=r(e.chmod),e.fchmod=r(e.fchmod),e.lchmod=r(e.lchmod),e.chownSync=o(e.chownSync),e.fchownSync=o(e.fchownSync),e.lchownSync=o(e.lchownSync),e.chmodSync=n(e.chmodSync),e.fchmodSync=n(e.fchmodSync),e.lchmodSync=n(e.lchmodSync),e.stat=s(e.stat),e.fstat=s(e.fstat),e.lstat=s(e.lstat),e.statSync=f(e.statSync),e.fstatSync=f(e.fstatSync),e.lstatSync=f(e.lstatSync),e.chmod&&!e.lchmod&&(e.lchmod=function(i,c,F){F&&process.nextTick(F)},e.lchmodSync=function(){}),e.chown&&!e.lchown&&(e.lchown=function(i,c,F,l){l&&process.nextTick(l)},e.lchownSync=function(){}),Hn==="win32"&&(e.rename=typeof e.rename!="function"?e.rename:function(i){function c(F,l,h){var p=Date.now(),C=0;i(F,l,function m(N){if(N&&(N.code==="EACCES"||N.code==="EPERM")&&Date.now()-p<6e4){setTimeout(function(){e.stat(l,function($,j){$&&$.code==="ENOENT"?i(F,l,m):h(N)})},C),C<100&&(C+=10);return}h&&h(N)})}return Object.setPrototypeOf&&Object.setPrototypeOf(c,i),c}(e.rename)),e.read=typeof e.read!="function"?e.read:function(i){function c(F,l,h,p,C,m){var N;if(m&&typeof m=="function"){var $=0;N=function(j,ee,W){if(j&&j.code==="EAGAIN"&&$<10)return $++,i.call(e,F,l,h,p,C,N);m.apply(this,arguments)}}return i.call(e,F,l,h,p,C,N)}return Object.setPrototypeOf&&Object.setPrototypeOf(c,i),c}(e.read),e.readSync=typeof e.readSync!="function"?e.readSync:function(i){return function(c,F,l,h,p){for(var C=0;;)try{return i.call(e,c,F,l,h,p)}catch(m){if(m.code==="EAGAIN"&&C<10){C++;continue}throw m}}}(e.readSync);function u(i){i.lchmod=function(c,F,l){i.open(c,oe.O_WRONLY|oe.O_SYMLINK,F,function(h,p){if(h){l&&l(h);return}i.fchmod(p,F,function(C){i.close(p,function(m){l&&l(C||m)})})})},i.lchmodSync=function(c,F){var l=i.openSync(c,oe.O_WRONLY|oe.O_SYMLINK,F),h=!0,p;try{p=i.fchmodSync(l,F),h=!1}finally{if(h)try{i.closeSync(l)}catch{}else i.closeSync(l)}return p}}function t(i){oe.hasOwnProperty("O_SYMLINK")&&i.futimes?(i.lutimes=function(c,F,l,h){i.open(c,oe.O_SYMLINK,function(p,C){if(p){h&&h(p);return}i.futimes(C,F,l,function(m){i.close(C,function(N){h&&h(m||N)})})})},i.lutimesSync=function(c,F,l){var h=i.openSync(c,oe.O_SYMLINK),p,C=!0;try{p=i.futimesSync(h,F,l),C=!1}finally{if(C)try{i.closeSync(h)}catch{}else i.closeSync(h)}return p}):i.futimes&&(i.lutimes=function(c,F,l,h){h&&process.nextTick(h)},i.lutimesSync=function(){})}function r(i){return i&&function(c,F,l){return i.call(e,c,F,function(h){a(h)&&(h=null),l&&l.apply(this,arguments)})}}function n(i){return i&&function(c,F){try{return i.call(e,c,F)}catch(l){if(!a(l))throw l}}}function D(i){return i&&function(c,F,l,h){return i.call(e,c,F,l,function(p){a(p)&&(p=null),h&&h.apply(this,arguments)})}}function o(i){return i&&function(c,F,l){try{return i.call(e,c,F,l)}catch(h){if(!a(h))throw h}}}function s(i){return i&&function(c,F,l){typeof F=="function"&&(l=F,F=null);function h(p,C){C&&(C.uid<0&&(C.uid+=4294967296),C.gid<0&&(C.gid+=4294967296)),l&&l.apply(this,arguments)}return F?i.call(e,c,F,h):i.call(e,c,h)}}function f(i){return i&&function(c,F){var l=F?i.call(e,c,F):i.call(e,c);return l&&(l.uid<0&&(l.uid+=4294967296),l.gid<0&&(l.gid+=4294967296)),l}}function a(i){if(!i||i.code==="ENOSYS")return!0;var c=!process.getuid||process.getuid()!==0;return!!(c&&(i.code==="EINVAL"||i.code==="EPERM"))}}var nt=Su.Stream,Xn=zn;function zn(e){return{ReadStream:u,WriteStream:t};function u(r,n){if(!(this instanceof u))return new u(r,n);nt.call(this);var D=this;this.path=r,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,n=n||{};for(var o=Object.keys(n),s=0,f=o.length;s<f;s++){var a=o[s];this[a]=n[a]}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(){D._read()});return}e.open(this.path,this.flags,this.mode,function(i,c){if(i){D.emit("error",i),D.readable=!1;return}D.fd=c,D.emit("open",c),D._read()})}function t(r,n){if(!(this instanceof t))return new t(r,n);nt.call(this),this.path=r,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,n=n||{};for(var D=Object.keys(n),o=0,s=D.length;o<s;o++){var f=D[o];this[f]=n[f]}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=e.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}var Qn=eD,Zn=Object.getPrototypeOf||function(e){return e.__proto__};function eD(e){if(e===null||typeof e!="object")return e;if(e instanceof Object)var u={__proto__:Zn(e)};else var u=Object.create(null);return Object.getOwnPropertyNames(e).forEach(function(t){Object.defineProperty(u,t,Object.getOwnPropertyDescriptor(e,t))}),u}var M=S,uD=Jn,tD=Xn,rD=Qn,Me=q,V,Qe;typeof Symbol=="function"&&typeof Symbol.for=="function"?(V=Symbol.for("graceful-fs.queue"),Qe=Symbol.for("graceful-fs.previous")):(V="___graceful-fs.queue",Qe="___graceful-fs.previous");function nD(){}function tr(e,u){Object.defineProperty(e,V,{get:function(){return u}})}var he=nD;Me.debuglog?he=Me.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(he=function(){var e=Me.format.apply(Me,arguments);e="GFS4: "+e.split(/\n/).join(` GFS4: `),console.error(e)});if(!M[V]){var DD=U.commonjsGlobal[V]||[];tr(M,DD),M.close=function(e){function u(t,r){return e.call(M,t,function(n){n||Dt(),typeof r=="function"&&r.apply(this,arguments)})}return Object.defineProperty(u,Qe,{value:e}),u}(M.close),M.closeSync=function(e){function u(t){e.apply(M,arguments),Dt()}return Object.defineProperty(u,Qe,{value:e}),u}(M.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){he(M[V]),Nt.equal(M[V].length,0)})}U.commonjsGlobal[V]||tr(U.commonjsGlobal,M[V]);var rr=Nu(rD(M));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!M.__patched&&(rr=Nu(M),M.__patched=!0);function Nu(e){uD(e),e.gracefulify=Nu,e.createReadStream=ee,e.createWriteStream=W;var u=e.readFile;e.readFile=t;function t(d,E,g){return typeof E=="function"&&(g=E,E=null),b(d,E,g);function b(w,R,v,_){return u(w,R,function(y){y&&(y.code==="EMFILE"||y.code==="ENFILE")?Ae([b,[w,R,v],y,_||Date.now(),Date.now()]):typeof v=="function"&&v.apply(this,arguments)})}}var r=e.writeFile;e.writeFile=n;function n(d,E,g,b){return typeof g=="function"&&(b=g,g=null),w(d,E,g,b);function w(R,v,_,y,I){return r(R,v,_,function(A){A&&(A.code==="EMFILE"||A.code==="ENFILE")?Ae([w,[R,v,_,y],A,I||Date.now(),Date.now()]):typeof y=="function"&&y.apply(this,arguments)})}}var D=e.appendFile;D&&(e.appendFile=o);function o(d,E,g,b){return typeof g=="function"&&(b=g,g=null),w(d,E,g,b);function w(R,v,_,y,I){return D(R,v,_,function(A){A&&(A.code==="EMFILE"||A.code==="ENFILE")?Ae([w,[R,v,_,y],A,I||Date.now(),Date.now()]):typeof y=="function"&&y.apply(this,arguments)})}}var s=e.copyFile;s&&(e.copyFile=f);function f(d,E,g,b){return typeof g=="function"&&(b=g,g=0),w(d,E,g,b);function w(R,v,_,y,I){return s(R,v,_,function(A){A&&(A.code==="EMFILE"||A.code==="ENFILE")?Ae([w,[R,v,_,y],A,I||Date.now(),Date.now()]):typeof y=="function"&&y.apply(this,arguments)})}}var a=e.readdir;e.readdir=c;var i=/^v[0-5]\./;function c(d,E,g){typeof E=="function"&&(g=E,E=null);var b=i.test(process.version)?function(v,_,y,I){return a(v,w(v,_,y,I))}:function(v,_,y,I){return a(v,_,w(v,_,y,I))};return b(d,E,g);function w(R,v,_,y){return function(I,A){I&&(I.code==="EMFILE"||I.code==="ENFILE")?Ae([b,[R,v,_],I,y||Date.now(),Date.now()]):(A&&A.sort&&A.sort(),typeof _=="function"&&_.call(this,I,A))}}}if(process.version.substr(0,4)==="v0.8"){var F=tD(e);m=F.ReadStream,$=F.WriteStream}var l=e.ReadStream;l&&(m.prototype=Object.create(l.prototype),m.prototype.open=N);var h=e.WriteStream;h&&($.prototype=Object.create(h.prototype),$.prototype.