@e2b/cli
Version:
CLI for managing e2b sandbox templates
17 lines • 2.67 MB
JavaScript
#!/usr/bin/env -S node --enable-source-maps
"use strict";var DK=Object.create;var $d=Object.defineProperty;var yK=Object.getOwnPropertyDescriptor;var AK=Object.getOwnPropertyNames;var RK=Object.getPrototypeOf,NK=Object.prototype.hasOwnProperty;var BA=(t,e)=>()=>(t&&(e=t(t=0)),e);var g=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Yg=(t,e)=>{for(var n in e)$d(t,n,{get:e[n],enumerable:!0})},UA=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of AK(e))!NK.call(t,i)&&i!==n&&$d(t,i,{get:()=>e[i],enumerable:!(r=yK(e,i))||r.enumerable});return t};var z=(t,e,n)=>(n=t!=null?DK(RK(t)):{},UA(e||!t||!t.__esModule?$d(n,"default",{value:t,enumerable:!0}):n,t)),GA=t=>UA($d({},"__esModule",{value:!0}),t);var u=BA(()=>{"use strict"});var sc=g((PDe,HA)=>{"use strict";u();var OK="2.0.0",vK=Number.MAX_SAFE_INTEGER||9007199254740991,IK=16,wK=250,LK=["major","premajor","minor","preminor","patch","prepatch","prerelease"];HA.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:IK,MAX_SAFE_BUILD_LENGTH:wK,MAX_SAFE_INTEGER:vK,RELEASE_TYPES:LK,SEMVER_SPEC_VERSION:OK,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var ac=g((kDe,YA)=>{"use strict";u();var MK=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};YA.exports=MK});var No=g((ui,qA)=>{"use strict";u();var{MAX_SAFE_COMPONENT_LENGTH:qg,MAX_SAFE_BUILD_LENGTH:PK,MAX_LENGTH:FK}=sc(),kK=ac();ui=qA.exports={};var BK=ui.re=[],UK=ui.safeRe=[],re=ui.src=[],GK=ui.safeSrc=[],ie=ui.t={},HK=0,Vg="[a-zA-Z0-9-]",YK=[["\\s",1],["\\d",FK],[Vg,PK]],qK=t=>{for(let[e,n]of YK)t=t.split(`${e}*`).join(`${e}{0,${n}}`).split(`${e}+`).join(`${e}{1,${n}}`);return t},ye=(t,e,n)=>{let r=qK(e),i=HK++;kK(t,i,e),ie[t]=i,re[i]=e,GK[i]=r,BK[i]=new RegExp(e,n?"g":void 0),UK[i]=new RegExp(r,n?"g":void 0)};ye("NUMERICIDENTIFIER","0|[1-9]\\d*");ye("NUMERICIDENTIFIERLOOSE","\\d+");ye("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${Vg}*`);ye("MAINVERSION",`(${re[ie.NUMERICIDENTIFIER]})\\.(${re[ie.NUMERICIDENTIFIER]})\\.(${re[ie.NUMERICIDENTIFIER]})`);ye("MAINVERSIONLOOSE",`(${re[ie.NUMERICIDENTIFIERLOOSE]})\\.(${re[ie.NUMERICIDENTIFIERLOOSE]})\\.(${re[ie.NUMERICIDENTIFIERLOOSE]})`);ye("PRERELEASEIDENTIFIER",`(?:${re[ie.NONNUMERICIDENTIFIER]}|${re[ie.NUMERICIDENTIFIER]})`);ye("PRERELEASEIDENTIFIERLOOSE",`(?:${re[ie.NONNUMERICIDENTIFIER]}|${re[ie.NUMERICIDENTIFIERLOOSE]})`);ye("PRERELEASE",`(?:-(${re[ie.PRERELEASEIDENTIFIER]}(?:\\.${re[ie.PRERELEASEIDENTIFIER]})*))`);ye("PRERELEASELOOSE",`(?:-?(${re[ie.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${re[ie.PRERELEASEIDENTIFIERLOOSE]})*))`);ye("BUILDIDENTIFIER",`${Vg}+`);ye("BUILD",`(?:\\+(${re[ie.BUILDIDENTIFIER]}(?:\\.${re[ie.BUILDIDENTIFIER]})*))`);ye("FULLPLAIN",`v?${re[ie.MAINVERSION]}${re[ie.PRERELEASE]}?${re[ie.BUILD]}?`);ye("FULL",`^${re[ie.FULLPLAIN]}$`);ye("LOOSEPLAIN",`[v=\\s]*${re[ie.MAINVERSIONLOOSE]}${re[ie.PRERELEASELOOSE]}?${re[ie.BUILD]}?`);ye("LOOSE",`^${re[ie.LOOSEPLAIN]}$`);ye("GTLT","((?:<|>)?=?)");ye("XRANGEIDENTIFIERLOOSE",`${re[ie.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);ye("XRANGEIDENTIFIER",`${re[ie.NUMERICIDENTIFIER]}|x|X|\\*`);ye("XRANGEPLAIN",`[v=\\s]*(${re[ie.XRANGEIDENTIFIER]})(?:\\.(${re[ie.XRANGEIDENTIFIER]})(?:\\.(${re[ie.XRANGEIDENTIFIER]})(?:${re[ie.PRERELEASE]})?${re[ie.BUILD]}?)?)?`);ye("XRANGEPLAINLOOSE",`[v=\\s]*(${re[ie.XRANGEIDENTIFIERLOOSE]})(?:\\.(${re[ie.XRANGEIDENTIFIERLOOSE]})(?:\\.(${re[ie.XRANGEIDENTIFIERLOOSE]})(?:${re[ie.PRERELEASELOOSE]})?${re[ie.BUILD]}?)?)?`);ye("XRANGE",`^${re[ie.GTLT]}\\s*${re[ie.XRANGEPLAIN]}$`);ye("XRANGELOOSE",`^${re[ie.GTLT]}\\s*${re[ie.XRANGEPLAINLOOSE]}$`);ye("COERCEPLAIN",`(^|[^\\d])(\\d{1,${qg}})(?:\\.(\\d{1,${qg}}))?(?:\\.(\\d{1,${qg}}))?`);ye("COERCE",`${re[ie.COERCEPLAIN]}(?:$|[^\\d])`);ye("COERCEFULL",re[ie.COERCEPLAIN]+`(?:${re[ie.PRERELEASE]})?(?:${re[ie.BUILD]})?(?:$|[^\\d])`);ye("COERCERTL",re[ie.COERCE],!0);ye("COERCERTLFULL",re[ie.COERCEFULL],!0);ye("LONETILDE","(?:~>?)");ye("TILDETRIM",`(\\s*)${re[ie.LONETILDE]}\\s+`,!0);ui.tildeTrimReplace="$1~";ye("TILDE",`^${re[ie.LONETILDE]}${re[ie.XRANGEPLAIN]}$`);ye("TILDELOOSE",`^${re[ie.LONETILDE]}${re[ie.XRANGEPLAINLOOSE]}$`);ye("LONECARET","(?:\\^)");ye("CARETTRIM",`(\\s*)${re[ie.LONECARET]}\\s+`,!0);ui.caretTrimReplace="$1^";ye("CARET",`^${re[ie.LONECARET]}${re[ie.XRANGEPLAIN]}$`);ye("CARETLOOSE",`^${re[ie.LONECARET]}${re[ie.XRANGEPLAINLOOSE]}$`);ye("COMPARATORLOOSE",`^${re[ie.GTLT]}\\s*(${re[ie.LOOSEPLAIN]})$|^$`);ye("COMPARATOR",`^${re[ie.GTLT]}\\s*(${re[ie.FULLPLAIN]})$|^$`);ye("COMPARATORTRIM",`(\\s*)${re[ie.GTLT]}\\s*(${re[ie.LOOSEPLAIN]}|${re[ie.XRANGEPLAIN]})`,!0);ui.comparatorTrimReplace="$1$2$3";ye("HYPHENRANGE",`^\\s*(${re[ie.XRANGEPLAIN]})\\s+-\\s+(${re[ie.XRANGEPLAIN]})\\s*$`);ye("HYPHENRANGELOOSE",`^\\s*(${re[ie.XRANGEPLAINLOOSE]})\\s+-\\s+(${re[ie.XRANGEPLAINLOOSE]})\\s*$`);ye("STAR","(<|>)?=?\\s*\\*");ye("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");ye("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var Wd=g((GDe,VA)=>{"use strict";u();var VK=Object.freeze({loose:!0}),$K=Object.freeze({}),WK=t=>t?typeof t!="object"?VK:t:$K;VA.exports=WK});var $g=g((YDe,KA)=>{"use strict";u();var $A=/^[0-9]+$/,WA=(t,e)=>{let n=$A.test(t),r=$A.test(e);return n&&r&&(t=+t,e=+e),t===e?0:n&&!r?-1:r&&!n?1:t<e?-1:1},KK=(t,e)=>WA(e,t);KA.exports={compareIdentifiers:WA,rcompareIdentifiers:KK}});var Rn=g((VDe,QA)=>{"use strict";u();var Kd=ac(),{MAX_LENGTH:zA,MAX_SAFE_INTEGER:zd}=sc(),{safeRe:Qd,t:jd}=No(),zK=Wd(),{compareIdentifiers:Oo}=$g(),Wg=class t{constructor(e,n){if(n=zK(n),e instanceof t){if(e.loose===!!n.loose&&e.includePrerelease===!!n.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>zA)throw new TypeError(`version is longer than ${zA} characters`);Kd("SemVer",e,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;let r=e.trim().match(n.loose?Qd[jd.LOOSE]:Qd[jd.FULL]);if(!r)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>zd||this.major<0)throw new TypeError("Invalid major version");if(this.minor>zd||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>zd||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){let s=+i;if(s>=0&&s<zd)return s}return i}):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(Kd("SemVer.compare",this.version,this.options,e),!(e instanceof t)){if(typeof e=="string"&&e===this.version)return 0;e=new t(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof t||(e=new t(e,this.options)),Oo(this.major,e.major)||Oo(this.minor,e.minor)||Oo(this.patch,e.patch)}comparePre(e){if(e instanceof t||(e=new t(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let n=0;do{let r=this.prerelease[n],i=e.prerelease[n];if(Kd("prerelease compare",n,r,i),r===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(r===void 0)return-1;if(r===i)continue;return Oo(r,i)}while(++n)}compareBuild(e){e instanceof t||(e=new t(e,this.options));let n=0;do{let r=this.build[n],i=e.build[n];if(Kd("build compare",n,r,i),r===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(r===void 0)return-1;if(r===i)continue;return Oo(r,i)}while(++n)}inc(e,n,r){if(e.startsWith("pre")){if(!n&&r===!1)throw new Error("invalid increment argument: identifier is empty");if(n){let i=`-${n}`.match(this.options.loose?Qd[jd.PRERELEASELOOSE]:Qd[jd.PRERELEASE]);if(!i||i[1]!==n)throw new Error(`invalid identifier: ${n}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",n,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",n,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",n,r),this.inc("pre",n,r);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",n,r),this.inc("pre",n,r);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let i=Number(r)?1:0;if(this.prerelease.length===0)this.prerelease=[i];else{let s=this.prerelease.length;for(;--s>=0;)typeof this.prerelease[s]=="number"&&(this.prerelease[s]++,s=-2);if(s===-1){if(n===this.prerelease.join(".")&&r===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(n){let s=[n,i];r===!1&&(s=[n]),Oo(this.prerelease[0],n)===0?isNaN(this.prerelease[1])&&(this.prerelease=s):this.prerelease=s}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};QA.exports=Wg});var Sa=g((WDe,XA)=>{"use strict";u();var jA=Rn(),QK=(t,e,n=!1)=>{if(t instanceof jA)return t;try{return new jA(t,e)}catch(r){if(!n)return null;throw r}};XA.exports=QK});var Xd=g((zDe,ZA)=>{"use strict";u();var jK=Sa(),XK=(t,e)=>{let n=jK(t,e);return n?n.version:null};ZA.exports=XK});var Zd=g((jDe,JA)=>{"use strict";u();var ZK=Sa(),JK=(t,e)=>{let n=ZK(t.trim().replace(/^[=v]+/,""),e);return n?n.version:null};JA.exports=JK});var nR=g((ZDe,tR)=>{"use strict";u();var eR=Rn(),ez=(t,e,n,r,i)=>{typeof n=="string"&&(i=r,r=n,n=void 0);try{return new eR(t instanceof eR?t.version:t,n).inc(e,r,i).version}catch{return null}};tR.exports=ez});var sR=g((eye,iR)=>{"use strict";u();var rR=Sa(),tz=(t,e)=>{let n=rR(t,null,!0),r=rR(e,null,!0),i=n.compare(r);if(i===0)return null;let s=i>0,a=s?n:r,o=s?r:n,l=!!a.prerelease.length;if(!!o.prerelease.length&&!l){if(!o.patch&&!o.minor)return"major";if(o.compareMain(a)===0)return o.minor&&!o.patch?"minor":"patch"}let p=l?"pre":"";return n.major!==r.major?p+"major":n.minor!==r.minor?p+"minor":n.patch!==r.patch?p+"patch":"prerelease"};iR.exports=tz});var oR=g((nye,aR)=>{"use strict";u();var nz=Rn(),rz=(t,e)=>new nz(t,e).major;aR.exports=rz});var cR=g((iye,lR)=>{"use strict";u();var iz=Rn(),sz=(t,e)=>new iz(t,e).minor;lR.exports=sz});var dR=g((aye,uR)=>{"use strict";u();var az=Rn(),oz=(t,e)=>new az(t,e).patch;uR.exports=oz});var mR=g((lye,pR)=>{"use strict";u();var lz=Sa(),cz=(t,e)=>{let n=lz(t,e);return n&&n.prerelease.length?n.prerelease:null};pR.exports=cz});var gr=g((uye,_R)=>{"use strict";u();var fR=Rn(),uz=(t,e,n)=>new fR(t,n).compare(new fR(e,n));_R.exports=uz});var gR=g((pye,hR)=>{"use strict";u();var dz=gr(),pz=(t,e,n)=>dz(e,t,n);hR.exports=pz});var SR=g((fye,ER)=>{"use strict";u();var mz=gr(),fz=(t,e)=>mz(t,e,!0);ER.exports=fz});var Jd=g((hye,TR)=>{"use strict";u();var bR=Rn(),_z=(t,e,n)=>{let r=new bR(t,n),i=new bR(e,n);return r.compare(i)||r.compareBuild(i)};TR.exports=_z});var CR=g((Eye,xR)=>{"use strict";u();var hz=Jd(),gz=(t,e)=>t.sort((n,r)=>hz(n,r,e));xR.exports=gz});var yR=g((bye,DR)=>{"use strict";u();var Ez=Jd(),Sz=(t,e)=>t.sort((n,r)=>Ez(r,n,e));DR.exports=Sz});var oc=g((xye,AR)=>{"use strict";u();var bz=gr(),Tz=(t,e,n)=>bz(t,e,n)>0;AR.exports=Tz});var ep=g((Dye,RR)=>{"use strict";u();var xz=gr(),Cz=(t,e,n)=>xz(t,e,n)<0;RR.exports=Cz});var Kg=g((Aye,NR)=>{"use strict";u();var Dz=gr(),yz=(t,e,n)=>Dz(t,e,n)===0;NR.exports=yz});var zg=g((Nye,OR)=>{"use strict";u();var Az=gr(),Rz=(t,e,n)=>Az(t,e,n)!==0;OR.exports=Rz});var tp=g((vye,vR)=>{"use strict";u();var Nz=gr(),Oz=(t,e,n)=>Nz(t,e,n)>=0;vR.exports=Oz});var np=g((wye,IR)=>{"use strict";u();var vz=gr(),Iz=(t,e,n)=>vz(t,e,n)<=0;IR.exports=Iz});var Qg=g((Mye,wR)=>{"use strict";u();var wz=Kg(),Lz=zg(),Mz=oc(),Pz=tp(),Fz=ep(),kz=np(),Bz=(t,e,n,r)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof n=="object"&&(n=n.version),t===n;case"!==":return typeof t=="object"&&(t=t.version),typeof n=="object"&&(n=n.version),t!==n;case"":case"=":case"==":return wz(t,n,r);case"!=":return Lz(t,n,r);case">":return Mz(t,n,r);case">=":return Pz(t,n,r);case"<":return Fz(t,n,r);case"<=":return kz(t,n,r);default:throw new TypeError(`Invalid operator: ${e}`)}};wR.exports=Bz});var MR=g((Fye,LR)=>{"use strict";u();var Uz=Rn(),Gz=Sa(),{safeRe:rp,t:ip}=No(),Hz=(t,e)=>{if(t instanceof Uz)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let n=null;if(!e.rtl)n=t.match(e.includePrerelease?rp[ip.COERCEFULL]:rp[ip.COERCE]);else{let l=e.includePrerelease?rp[ip.COERCERTLFULL]:rp[ip.COERCERTL],c;for(;(c=l.exec(t))&&(!n||n.index+n[0].length!==t.length);)(!n||c.index+c[0].length!==n.index+n[0].length)&&(n=c),l.lastIndex=c.index+c[1].length+c[2].length;l.lastIndex=-1}if(n===null)return null;let r=n[2],i=n[3]||"0",s=n[4]||"0",a=e.includePrerelease&&n[5]?`-${n[5]}`:"",o=e.includePrerelease&&n[6]?`+${n[6]}`:"";return Gz(`${r}.${i}.${s}${a}${o}`,e)};LR.exports=Hz});var FR=g((Bye,PR)=>{"use strict";u();var jg=class{constructor(){this.max=1e3,this.map=new Map}get(e){let n=this.map.get(e);if(n!==void 0)return this.map.delete(e),this.map.set(e,n),n}delete(e){return this.map.delete(e)}set(e,n){if(!this.delete(e)&&n!==void 0){if(this.map.size>=this.max){let i=this.map.keys().next().value;this.delete(i)}this.map.set(e,n)}return this}};PR.exports=jg});var Er=g((Gye,GR)=>{"use strict";u();var Yz=/\s+/g,Xg=class t{constructor(e,n){if(n=Vz(n),e instanceof t)return e.loose===!!n.loose&&e.includePrerelease===!!n.includePrerelease?e:new t(e.raw,n);if(e instanceof Zg)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease,this.raw=e.trim().replace(Yz," "),this.set=this.raw.split("||").map(r=>this.parseRange(r.trim())).filter(r=>r.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let r=this.set[0];if(this.set=this.set.filter(i=>!BR(i[0])),this.set.length===0)this.set=[r];else if(this.set.length>1){for(let i of this.set)if(i.length===1&&Xz(i[0])){this.set=[i];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");let n=this.set[e];for(let r=0;r<n.length;r++)r>0&&(this.formatted+=" "),this.formatted+=n[r].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let r=((this.options.includePrerelease&&Qz)|(this.options.loose&&jz))+":"+e,i=kR.get(r);if(i)return i;let s=this.options.loose,a=s?$n[Mn.HYPHENRANGELOOSE]:$n[Mn.HYPHENRANGE];e=e.replace(a,oQ(this.options.includePrerelease)),ht("hyphen replace",e),e=e.replace($n[Mn.COMPARATORTRIM],Wz),ht("comparator trim",e),e=e.replace($n[Mn.TILDETRIM],Kz),ht("tilde trim",e),e=e.replace($n[Mn.CARETTRIM],zz),ht("caret trim",e);let o=e.split(" ").map(d=>Zz(d,this.options)).join(" ").split(/\s+/).map(d=>aQ(d,this.options));s&&(o=o.filter(d=>(ht("loose invalid filter",d,this.options),!!d.match($n[Mn.COMPARATORLOOSE])))),ht("range list",o);let l=new Map,c=o.map(d=>new Zg(d,this.options));for(let d of c){if(BR(d))return[d];l.set(d.value,d)}l.size>1&&l.has("")&&l.delete("");let p=[...l.values()];return kR.set(r,p),p}intersects(e,n){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(r=>UR(r,n)&&e.set.some(i=>UR(i,n)&&r.every(s=>i.every(a=>s.intersects(a,n)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new $z(e,this.options)}catch{return!1}for(let n=0;n<this.set.length;n++)if(lQ(this.set[n],e,this.options))return!0;return!1}};GR.exports=Xg;var qz=FR(),kR=new qz,Vz=Wd(),Zg=lc(),ht=ac(),$z=Rn(),{safeRe:$n,t:Mn,comparatorTrimReplace:Wz,tildeTrimReplace:Kz,caretTrimReplace:zz}=No(),{FLAG_INCLUDE_PRERELEASE:Qz,FLAG_LOOSE:jz}=sc(),BR=t=>t.value==="<0.0.0-0",Xz=t=>t.value==="",UR=(t,e)=>{let n=!0,r=t.slice(),i=r.pop();for(;n&&r.length;)n=r.every(s=>i.intersects(s,e)),i=r.pop();return n},Zz=(t,e)=>(ht("comp",t,e),t=tQ(t,e),ht("caret",t),t=Jz(t,e),ht("tildes",t),t=rQ(t,e),ht("xrange",t),t=sQ(t,e),ht("stars",t),t),Pn=t=>!t||t.toLowerCase()==="x"||t==="*",Jz=(t,e)=>t.trim().split(/\s+/).map(n=>eQ(n,e)).join(" "),eQ=(t,e)=>{let n=e.loose?$n[Mn.TILDELOOSE]:$n[Mn.TILDE];return t.replace(n,(r,i,s,a,o)=>{ht("tilde",t,r,i,s,a,o);let l;return Pn(i)?l="":Pn(s)?l=`>=${i}.0.0 <${+i+1}.0.0-0`:Pn(a)?l=`>=${i}.${s}.0 <${i}.${+s+1}.0-0`:o?(ht("replaceTilde pr",o),l=`>=${i}.${s}.${a}-${o} <${i}.${+s+1}.0-0`):l=`>=${i}.${s}.${a} <${i}.${+s+1}.0-0`,ht("tilde return",l),l})},tQ=(t,e)=>t.trim().split(/\s+/).map(n=>nQ(n,e)).join(" "),nQ=(t,e)=>{ht("caret",t,e);let n=e.loose?$n[Mn.CARETLOOSE]:$n[Mn.CARET],r=e.includePrerelease?"-0":"";return t.replace(n,(i,s,a,o,l)=>{ht("caret",t,i,s,a,o,l);let c;return Pn(s)?c="":Pn(a)?c=`>=${s}.0.0${r} <${+s+1}.0.0-0`:Pn(o)?s==="0"?c=`>=${s}.${a}.0${r} <${s}.${+a+1}.0-0`:c=`>=${s}.${a}.0${r} <${+s+1}.0.0-0`:l?(ht("replaceCaret pr",l),s==="0"?a==="0"?c=`>=${s}.${a}.${o}-${l} <${s}.${a}.${+o+1}-0`:c=`>=${s}.${a}.${o}-${l} <${s}.${+a+1}.0-0`:c=`>=${s}.${a}.${o}-${l} <${+s+1}.0.0-0`):(ht("no pr"),s==="0"?a==="0"?c=`>=${s}.${a}.${o}${r} <${s}.${a}.${+o+1}-0`:c=`>=${s}.${a}.${o}${r} <${s}.${+a+1}.0-0`:c=`>=${s}.${a}.${o} <${+s+1}.0.0-0`),ht("caret return",c),c})},rQ=(t,e)=>(ht("replaceXRanges",t,e),t.split(/\s+/).map(n=>iQ(n,e)).join(" ")),iQ=(t,e)=>{t=t.trim();let n=e.loose?$n[Mn.XRANGELOOSE]:$n[Mn.XRANGE];return t.replace(n,(r,i,s,a,o,l)=>{ht("xRange",t,r,i,s,a,o,l);let c=Pn(s),p=c||Pn(a),d=p||Pn(o),m=d;return i==="="&&m&&(i=""),l=e.includePrerelease?"-0":"",c?i===">"||i==="<"?r="<0.0.0-0":r="*":i&&m?(p&&(a=0),o=0,i===">"?(i=">=",p?(s=+s+1,a=0,o=0):(a=+a+1,o=0)):i==="<="&&(i="<",p?s=+s+1:a=+a+1),i==="<"&&(l="-0"),r=`${i+s}.${a}.${o}${l}`):p?r=`>=${s}.0.0${l} <${+s+1}.0.0-0`:d&&(r=`>=${s}.${a}.0${l} <${s}.${+a+1}.0-0`),ht("xRange return",r),r})},sQ=(t,e)=>(ht("replaceStars",t,e),t.trim().replace($n[Mn.STAR],"")),aQ=(t,e)=>(ht("replaceGTE0",t,e),t.trim().replace($n[e.includePrerelease?Mn.GTE0PRE:Mn.GTE0],"")),oQ=t=>(e,n,r,i,s,a,o,l,c,p,d,m)=>(Pn(r)?n="":Pn(i)?n=`>=${r}.0.0${t?"-0":""}`:Pn(s)?n=`>=${r}.${i}.0${t?"-0":""}`:a?n=`>=${n}`:n=`>=${n}${t?"-0":""}`,Pn(c)?l="":Pn(p)?l=`<${+c+1}.0.0-0`:Pn(d)?l=`<${c}.${+p+1}.0-0`:m?l=`<=${c}.${p}.${d}-${m}`:t?l=`<${c}.${p}.${+d+1}-0`:l=`<=${l}`,`${n} ${l}`.trim()),lQ=(t,e,n)=>{for(let r=0;r<t.length;r++)if(!t[r].test(e))return!1;if(e.prerelease.length&&!n.includePrerelease){for(let r=0;r<t.length;r++)if(ht(t[r].semver),t[r].semver!==Zg.ANY&&t[r].semver.prerelease.length>0){let i=t[r].semver;if(i.major===e.major&&i.minor===e.minor&&i.patch===e.patch)return!0}return!1}return!0}});var lc=g((Yye,WR)=>{"use strict";u();var cc=Symbol("SemVer ANY"),t0=class t{static get ANY(){return cc}constructor(e,n){if(n=HR(n),e instanceof t){if(e.loose===!!n.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),e0("comparator",e,n),this.options=n,this.loose=!!n.loose,this.parse(e),this.semver===cc?this.value="":this.value=this.operator+this.semver.version,e0("comp",this)}parse(e){let n=this.options.loose?YR[qR.COMPARATORLOOSE]:YR[qR.COMPARATOR],r=e.match(n);if(!r)throw new TypeError(`Invalid comparator: ${e}`);this.operator=r[1]!==void 0?r[1]:"",this.operator==="="&&(this.operator=""),r[2]?this.semver=new VR(r[2],this.options.loose):this.semver=cc}toString(){return this.value}test(e){if(e0("Comparator.test",e,this.options.loose),this.semver===cc||e===cc)return!0;if(typeof e=="string")try{e=new VR(e,this.options)}catch{return!1}return Jg(e,this.operator,this.semver,this.options)}intersects(e,n){if(!(e instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new $R(e.value,n).test(this.value):e.operator===""?e.value===""?!0:new $R(this.value,n).test(e.semver):(n=HR(n),n.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!n.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||Jg(this.semver,"<",e.semver,n)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||Jg(this.semver,">",e.semver,n)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};WR.exports=t0;var HR=Wd(),{safeRe:YR,t:qR}=No(),Jg=Qg(),e0=ac(),VR=Rn(),$R=Er()});var uc=g((Vye,KR)=>{"use strict";u();var cQ=Er(),uQ=(t,e,n)=>{try{e=new cQ(e,n)}catch{return!1}return e.test(t)};KR.exports=uQ});var QR=g((Wye,zR)=>{"use strict";u();var dQ=Er(),pQ=(t,e)=>new dQ(t,e).set.map(n=>n.map(r=>r.value).join(" ").trim().split(" "));zR.exports=pQ});var XR=g((zye,jR)=>{"use strict";u();var mQ=Rn(),fQ=Er(),_Q=(t,e,n)=>{let r=null,i=null,s=null;try{s=new fQ(e,n)}catch{return null}return t.forEach(a=>{s.test(a)&&(!r||i.compare(a)===-1)&&(r=a,i=new mQ(r,n))}),r};jR.exports=_Q});var JR=g((jye,ZR)=>{"use strict";u();var hQ=Rn(),gQ=Er(),EQ=(t,e,n)=>{let r=null,i=null,s=null;try{s=new gQ(e,n)}catch{return null}return t.forEach(a=>{s.test(a)&&(!r||i.compare(a)===1)&&(r=a,i=new hQ(r,n))}),r};ZR.exports=EQ});var nN=g((Zye,tN)=>{"use strict";u();var n0=Rn(),SQ=Er(),eN=oc(),bQ=(t,e)=>{t=new SQ(t,e);let n=new n0("0.0.0");if(t.test(n)||(n=new n0("0.0.0-0"),t.test(n)))return n;n=null;for(let r=0;r<t.set.length;++r){let i=t.set[r],s=null;i.forEach(a=>{let o=new n0(a.semver.version);switch(a.operator){case">":o.prerelease.length===0?o.patch++:o.prerelease.push(0),o.raw=o.format();case"":case">=":(!s||eN(o,s))&&(s=o);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${a.operator}`)}}),s&&(!n||eN(n,s))&&(n=s)}return n&&t.test(n)?n:null};tN.exports=bQ});var iN=g((eAe,rN)=>{"use strict";u();var TQ=Er(),xQ=(t,e)=>{try{return new TQ(t,e).range||"*"}catch{return null}};rN.exports=xQ});var sp=g((nAe,lN)=>{"use strict";u();var CQ=Rn(),oN=lc(),{ANY:DQ}=oN,yQ=Er(),AQ=uc(),sN=oc(),aN=ep(),RQ=np(),NQ=tp(),OQ=(t,e,n,r)=>{t=new CQ(t,r),e=new yQ(e,r);let i,s,a,o,l;switch(n){case">":i=sN,s=RQ,a=aN,o=">",l=">=";break;case"<":i=aN,s=NQ,a=sN,o="<",l="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(AQ(t,e,r))return!1;for(let c=0;c<e.set.length;++c){let p=e.set[c],d=null,m=null;if(p.forEach(f=>{f.semver===DQ&&(f=new oN(">=0.0.0")),d=d||f,m=m||f,i(f.semver,d.semver,r)?d=f:a(f.semver,m.semver,r)&&(m=f)}),d.operator===o||d.operator===l||(!m.operator||m.operator===o)&&s(t,m.semver))return!1;if(m.operator===l&&a(t,m.semver))return!1}return!0};lN.exports=OQ});var uN=g((iAe,cN)=>{"use strict";u();var vQ=sp(),IQ=(t,e,n)=>vQ(t,e,">",n);cN.exports=IQ});var pN=g((aAe,dN)=>{"use strict";u();var wQ=sp(),LQ=(t,e,n)=>wQ(t,e,"<",n);dN.exports=LQ});var _N=g((lAe,fN)=>{"use strict";u();var mN=Er(),MQ=(t,e,n)=>(t=new mN(t,n),e=new mN(e,n),t.intersects(e,n));fN.exports=MQ});var gN=g((uAe,hN)=>{"use strict";u();var PQ=uc(),FQ=gr();hN.exports=(t,e,n)=>{let r=[],i=null,s=null,a=t.sort((p,d)=>FQ(p,d,n));for(let p of a)PQ(p,e,n)?(s=p,i||(i=p)):(s&&r.push([i,s]),s=null,i=null);i&&r.push([i,null]);let o=[];for(let[p,d]of r)p===d?o.push(p):!d&&p===a[0]?o.push("*"):d?p===a[0]?o.push(`<=${d}`):o.push(`${p} - ${d}`):o.push(`>=${p}`);let l=o.join(" || "),c=typeof e.raw=="string"?e.raw:String(e);return l.length<c.length?l:e}});var CN=g((pAe,xN)=>{"use strict";u();var EN=Er(),i0=lc(),{ANY:r0}=i0,dc=uc(),s0=gr(),kQ=(t,e,n={})=>{if(t===e)return!0;t=new EN(t,n),e=new EN(e,n);let r=!1;e:for(let i of t.set){for(let s of e.set){let a=UQ(i,s,n);if(r=r||a!==null,a)continue e}if(r)return!1}return!0},BQ=[new i0(">=0.0.0-0")],SN=[new i0(">=0.0.0")],UQ=(t,e,n)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===r0){if(e.length===1&&e[0].semver===r0)return!0;n.includePrerelease?t=BQ:t=SN}if(e.length===1&&e[0].semver===r0){if(n.includePrerelease)return!0;e=SN}let r=new Set,i,s;for(let f of t)f.operator===">"||f.operator===">="?i=bN(i,f,n):f.operator==="<"||f.operator==="<="?s=TN(s,f,n):r.add(f.semver);if(r.size>1)return null;let a;if(i&&s){if(a=s0(i.semver,s.semver,n),a>0)return null;if(a===0&&(i.operator!==">="||s.operator!=="<="))return null}for(let f of r){if(i&&!dc(f,String(i),n)||s&&!dc(f,String(s),n))return null;for(let _ of e)if(!dc(f,String(_),n))return!1;return!0}let o,l,c,p,d=s&&!n.includePrerelease&&s.semver.prerelease.length?s.semver:!1,m=i&&!n.includePrerelease&&i.semver.prerelease.length?i.semver:!1;d&&d.prerelease.length===1&&s.operator==="<"&&d.prerelease[0]===0&&(d=!1);for(let f of e){if(p=p||f.operator===">"||f.operator===">=",c=c||f.operator==="<"||f.operator==="<=",i){if(m&&f.semver.prerelease&&f.semver.prerelease.length&&f.semver.major===m.major&&f.semver.minor===m.minor&&f.semver.patch===m.patch&&(m=!1),f.operator===">"||f.operator===">="){if(o=bN(i,f,n),o===f&&o!==i)return!1}else if(i.operator===">="&&!dc(i.semver,String(f),n))return!1}if(s){if(d&&f.semver.prerelease&&f.semver.prerelease.length&&f.semver.major===d.major&&f.semver.minor===d.minor&&f.semver.patch===d.patch&&(d=!1),f.operator==="<"||f.operator==="<="){if(l=TN(s,f,n),l===f&&l!==s)return!1}else if(s.operator==="<="&&!dc(s.semver,String(f),n))return!1}if(!f.operator&&(s||i)&&a!==0)return!1}return!(i&&c&&!s&&a!==0||s&&p&&!i&&a!==0||m||d)},bN=(t,e,n)=>{if(!t)return e;let r=s0(t.semver,e.semver,n);return r>0?t:r<0||e.operator===">"&&t.operator===">="?e:t},TN=(t,e,n)=>{if(!t)return e;let r=s0(t.semver,e.semver,n);return r<0?t:r>0||e.operator==="<"&&t.operator==="<="?e:t};xN.exports=kQ});var ba=g((fAe,AN)=>{"use strict";u();var a0=No(),DN=sc(),GQ=Rn(),yN=$g(),HQ=Sa(),YQ=Xd(),qQ=Zd(),VQ=nR(),$Q=sR(),WQ=oR(),KQ=cR(),zQ=dR(),QQ=mR(),jQ=gr(),XQ=gR(),ZQ=SR(),JQ=Jd(),ej=CR(),tj=yR(),nj=oc(),rj=ep(),ij=Kg(),sj=zg(),aj=tp(),oj=np(),lj=Qg(),cj=MR(),uj=lc(),dj=Er(),pj=uc(),mj=QR(),fj=XR(),_j=JR(),hj=nN(),gj=iN(),Ej=sp(),Sj=uN(),bj=pN(),Tj=_N(),xj=gN(),Cj=CN();AN.exports={parse:HQ,valid:YQ,clean:qQ,inc:VQ,diff:$Q,major:WQ,minor:KQ,patch:zQ,prerelease:QQ,compare:jQ,rcompare:XQ,compareLoose:ZQ,compareBuild:JQ,sort:ej,rsort:tj,gt:nj,lt:rj,eq:ij,neq:sj,gte:aj,lte:oj,cmp:lj,coerce:cj,Comparator:uj,Range:dj,satisfies:pj,toComparators:mj,maxSatisfying:fj,minSatisfying:_j,minVersion:hj,validRange:gj,outside:Ej,gtr:Sj,ltr:bj,intersects:Tj,simplifyRange:xj,subset:Cj,SemVer:GQ,re:a0.re,src:a0.src,tokens:a0.t,SEMVER_SPEC_VERSION:DN.SEMVER_SPEC_VERSION,RELEASE_TYPES:DN.RELEASE_TYPES,compareIdentifiers:yN.compareIdentifiers,rcompareIdentifiers:yN.rcompareIdentifiers}});var wN=g((hAe,IN)=>{"use strict";u();var NN=require("process"),Dj=ba(),yj=require("os"),ON=require("path"),pc=require("fs"),Aj=require("https");function l0(t,e,n,r){function i(s){return s instanceof n?s:new n(function(a){a(s)})}return new(n||(n=Promise))(function(s,a){function o(p){try{c(r.next(p))}catch(d){a(d)}}function l(p){try{c(r.throw(p))}catch(d){a(d)}}function c(p){p.done?s(p.value):i(p.value).then(o,l)}c((r=r.apply(t,e||[])).next())})}function c0(t,e){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,i,s,a;return a={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function o(c){return function(p){return l([c,p])}}function l(c){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(n=0)),n;)try{if(r=1,i&&(s=c[0]&2?i.return:c[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,c[1])).done)return s;switch(i=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=c;break;case 4:return n.label++,{value:c[1],done:!1};case 5:n.label++,i=c[1],c=[0];continue;case 7:c=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){n.label=c[1];break}if(c[0]===6&&n.label<s[1]){n.label=s[1],s=c;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(c);break}s[2]&&n.ops.pop(),n.trys.pop();continue}c=e.call(t,n)}catch(p){c=[6,p],i=0}finally{r=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}var RN=NN.env.npm_package_json,ap=NN.env.npm_config_user_agent,Rj=!!(ap&&ap.startsWith("npm")),Nj=!!(RN&&RN.endsWith("package.json")),Oj=Rj||Nj,vj=!!(ap&&ap.startsWith("yarn")),Ij=Oj||vj,wj=yj.homedir(),o0=process.env.XDG_CONFIG_HOME||ON.join(wj,".config","simple-update-notifier"),vN=function(t){return ON.join(o0,"".concat(t.replace("@","").replace("/","__"),".json"))},Lj=function(){pc.existsSync(o0)||pc.mkdirSync(o0,{recursive:!0})},Mj=function(t){var e=vN(t);try{if(!pc.existsSync(e))return;var n=JSON.parse(pc.readFileSync(e,"utf8"));return n.lastUpdateCheck}catch{return}},Pj=function(t){var e=vN(t);pc.writeFileSync(e,JSON.stringify({lastUpdateCheck:new Date().getTime()}))},Fj=function(t,e){return l0(void 0,void 0,void 0,function(){var n;return c0(this,function(r){return n="https://registry.npmjs.org/-/package/".concat(t,"/dist-tags"),[2,new Promise(function(i,s){Aj.get(n,function(a){var o="";a.on("data",function(l){return o+=l}),a.on("end",function(){try{var l=JSON.parse(o),c=l[e];c||s(new Error("Error getting version")),i(c)}catch{s(new Error("Could not parse version response"))}})}).on("error",function(a){return s(a)})})]})})},kj=function(t){var e=t.pkg,n=t.updateCheckInterval,r=n===void 0?1e3*60*60*24:n,i=t.distTag,s=i===void 0?"latest":i,a=t.alwaysRun,o=t.debug;return l0(void 0,void 0,void 0,function(){var l,c;return c0(this,function(p){switch(p.label){case 0:return Lj(),l=Mj(e.name),a||!l||l<new Date().getTime()-r?[4,Fj(e.name,s)]:[3,2];case 1:return c=p.sent(),Pj(e.name),Dj.gt(c,e.version)?[2,c]:(o&&console.error("Latest version (".concat(c,") not newer than current version (").concat(e.version,")")),[3,3]);case 2:o&&console.error("Too recent to check for a new update. simpleUpdateNotifier() interval set to ".concat(r,"ms but only ").concat(new Date().getTime()-l,"ms since last check.")),p.label=3;case 3:return[2,!1]}})})},Bj=function(t){for(var e=t.split(`
`),n=Math.max.apply(Math,e.map(function(o){return o.length})),r=["\u250C".concat("\u2500".repeat(n+2),"\u2510")],i=0,s=e;i<s.length;i++){var a=s[i];r.push("\u2502 ".concat(a.padEnd(n)," \u2502"))}return r.push("\u2514".concat("\u2500".repeat(n+2),"\u2518")),r.join(`
`)},Uj=function(t){return l0(void 0,void 0,void 0,function(){var e,n;return c0(this,function(r){switch(r.label){case 0:if(!t.alwaysRun&&(!process.stdout.isTTY||Ij&&!t.shouldNotifyInNpmScript))return t.debug&&console.error("Opting out of running simpleUpdateNotifier()"),[2];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,kj(t)];case 2:return e=r.sent(),e&&console.error(Bj("New version of ".concat(t.pkg.name,` available!
Current Version: `).concat(t.pkg.version,`
Latest Version: `).concat(e))),[3,4];case 3:return n=r.sent(),t.debug&&n instanceof Error&&console.error("Unexpected error in simpleUpdateNotifier():",n),[3,4];case 4:return[2]}})})};IN.exports=Uj});var mc=g(d0=>{"use strict";u();var op=class extends Error{constructor(e,n,r){super(r),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=n,this.exitCode=e,this.nestedError=void 0}},u0=class extends op{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};d0.CommanderError=op;d0.InvalidArgumentError=u0});var lp=g(m0=>{"use strict";u();var{InvalidArgumentError:Gj}=mc(),p0=class{constructor(e,n){switch(this.description=n||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case"<":this.required=!0,this._name=e.slice(1,-1);break;case"[":this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}this._name.length>3&&this._name.slice(-3)==="..."&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_concatValue(e,n){return n===this.defaultValue||!Array.isArray(n)?[e]:n.concat(e)}default(e,n){return this.defaultValue=e,this.defaultValueDescription=n,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(n,r)=>{if(!this.argChoices.includes(n))throw new Gj(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(n,r):n},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function Hj(t){let e=t.name()+(t.variadic===!0?"...":"");return t.required?"<"+e+">":"["+e+"]"}m0.Argument=p0;m0.humanReadableArgName=Hj});var _0=g(LN=>{"use strict";u();var{humanReadableArgName:Yj}=lp(),f0=class{constructor(){this.helpWidth=void 0,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}visibleCommands(e){let n=e.commands.filter(r=>!r._hidden);if(e._hasImplicitHelpCommand()){let[,r,i]=e._helpCommandnameAndArgs.match(/([^ ]+) *(.*)/),s=e.createCommand(r).helpOption(!1);s.description(e._helpCommandDescription),i&&s.arguments(i),n.push(s)}return this.sortSubcommands&&n.sort((r,i)=>r.name().localeCompare(i.name())),n}compareOptions(e,n){let r=i=>i.short?i.short.replace(/^-/,""):i.long.replace(/^--/,"");return r(e).localeCompare(r(n))}visibleOptions(e){let n=e.options.filter(s=>!s.hidden),r=e._hasHelpOption&&e._helpShortFlag&&!e._findOption(e._helpShortFlag),i=e._hasHelpOption&&!e._findOption(e._helpLongFlag);if(r||i){let s;r?i?s=e.createOption(e._helpFlags,e._helpDescription):s=e.createOption(e._helpShortFlag,e._helpDescription):s=e.createOption(e._helpLongFlag,e._helpDescription),n.push(s)}return this.sortOptions&&n.sort(this.compareOptions),n}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let n=[];for(let r=e.parent;r;r=r.parent){let i=r.options.filter(s=>!s.hidden);n.push(...i)}return this.sortOptions&&n.sort(this.compareOptions),n}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(n=>{n.description=n.description||e._argsDescription[n.name()]||""}),e.registeredArguments.find(n=>n.description)?e.registeredArguments:[]}subcommandTerm(e){let n=e.registeredArguments.map(r=>Yj(r)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(n?" "+n:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,n){return n.visibleCommands(e).reduce((r,i)=>Math.max(r,n.subcommandTerm(i).length),0)}longestOptionTermLength(e,n){return n.visibleOptions(e).reduce((r,i)=>Math.max(r,n.optionTerm(i).length),0)}longestGlobalOptionTermLength(e,n){return n.visibleGlobalOptions(e).reduce((r,i)=>Math.max(r,n.optionTerm(i).length),0)}longestArgumentTermLength(e,n){return n.visibleArguments(e).reduce((r,i)=>Math.max(r,n.argumentTerm(i).length),0)}commandUsage(e){let n=e._name;e._aliases[0]&&(n=n+"|"+e._aliases[0]);let r="";for(let i=e.parent;i;i=i.parent)r=i.name()+" "+r;return r+n+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let n=[];return e.argChoices&&n.push(`choices: ${e.argChoices.map(r=>JSON.stringify(r)).join(", ")}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue=="boolean")&&n.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&n.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&n.push(`env: ${e.envVar}`),n.length>0?`${e.description} (${n.join(", ")})`:e.description}argumentDescription(e){let n=[];if(e.argChoices&&n.push(`choices: ${e.argChoices.map(r=>JSON.stringify(r)).join(", ")}`),e.defaultValue!==void 0&&n.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),n.length>0){let r=`(${n.join(", ")})`;return e.description?`${e.description} ${r}`:r}return e.description}formatHelp(e,n){let r=n.padWidth(e,n),i=n.helpWidth||80,s=2,a=2;function o(_,E){if(E){let b=`${_.padEnd(r+a)}${E}`;return n.wrap(b,i-s,r+a)}return _}function l(_){return _.join(`
`).replace(/^/gm," ".repeat(s))}let c=[`Usage: ${n.commandUsage(e)}`,""],p=n.commandDescription(e);p.length>0&&(c=c.concat([n.wrap(p,i,0),""]));let d=n.visibleArguments(e).map(_=>o(n.argumentTerm(_),n.argumentDescription(_)));d.length>0&&(c=c.concat(["Arguments:",l(d),""]));let m=n.visibleOptions(e).map(_=>o(n.optionTerm(_),n.optionDescription(_)));if(m.length>0&&(c=c.concat(["Options:",l(m),""])),this.showGlobalOptions){let _=n.visibleGlobalOptions(e).map(E=>o(n.optionTerm(E),n.optionDescription(E)));_.length>0&&(c=c.concat(["Global Options:",l(_),""]))}let f=n.visibleCommands(e).map(_=>o(n.subcommandTerm(_),n.subcommandDescription(_)));return f.length>0&&(c=c.concat(["Commands:",l(f),""])),c.join(`
`)}padWidth(e,n){return Math.max(n.longestOptionTermLength(e,n),n.longestGlobalOptionTermLength(e,n),n.longestSubcommandTermLength(e,n),n.longestArgumentTermLength(e,n))}wrap(e,n,r,i=40){let s=" \\f\\t\\v\xA0\u1680\u2000-\u200A\u202F\u205F\u3000\uFEFF",a=new RegExp(`[\\n][${s}]+`);if(e.match(a))return e;let o=n-r;if(o<i)return e;let l=e.slice(0,r),c=e.slice(r).replace(`\r
`,`
`),p=" ".repeat(r),m="\\s\u200B",f=new RegExp(`
|.{1,${o-1}}([${m}]|$)|[^${m}]+?([${m}]|$)`,"g"),_=c.match(f)||[];return l+_.map((E,b)=>E===`
`?"":(b>0?p:"")+E.trimEnd()).join(`
`)}};LN.Help=f0});var E0=g(cp=>{"use strict";u();var{InvalidArgumentError:qj}=mc(),h0=class{constructor(e,n){this.flags=e,this.description=n||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;let r=MN(e);this.short=r.shortFlag,this.long=r.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0}default(e,n){return this.defaultValue=e,this.defaultValueDescription=n,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let n=e;return typeof e=="string"&&(n={[e]:!0}),this.implied=Object.assign(this.implied||{},n),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_concatValue(e,n){return n===this.defaultValue||!Array.isArray(n)?[e]:n.concat(e)}choices(e){return this.argChoices=e.slice(),this.parseArg=(n,r)=>{if(!this.argChoices.includes(n))throw new qj(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(n,r):n},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return Vj(this.name().replace(/^no-/,""))}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},g0=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(n=>{n.negate?this.negativeOptions.set(n.attributeName(),n):this.positiveOptions.set(n.attributeName(),n)}),this.negativeOptions.forEach((n,r)=>{this.positiveOptions.has(r)&&this.dualOptions.add(r)})}valueFromOption(e,n){let r=n.attributeName();if(!this.dualOptions.has(r))return!0;let i=this.negativeOptions.get(r).presetArg,s=i!==void 0?i:!1;return n.negate===(s===e)}};function Vj(t){return t.split("-").reduce((e,n)=>e+n[0].toUpperCase()+n.slice(1))}function MN(t){let e,n,r=t.split(/[ |,]+/);return r.length>1&&!/^[[<]/.test(r[1])&&(e=r.shift()),n=r.shift(),!e&&/^-[^-]$/.test(n)&&(e=n,n=void 0),{shortFlag:e,longFlag:n}}cp.Option=h0;cp.splitOptionFlags=MN;cp.DualOptions=g0});var FN=g(PN=>{"use strict";u();function $j(t,e){if(Math.abs(t.length-e.length)>3)return Math.max(t.length,e.length);let n=[];for(let r=0;r<=t.length;r++)n[r]=[r];for(let r=0;r<=e.length;r++)n[0][r]=r;for(let r=1;r<=e.length;r++)for(let i=1;i<=t.length;i++){let s=1;t[i-1]===e[r-1]?s=0:s=1,n[i][r]=Math.min(n[i-1][r]+1,n[i][r-1]+1,n[i-1][r-1]+s),i>1&&r>1&&t[i-1]===e[r-2]&&t[i-2]===e[r-1]&&(n[i][r]=Math.min(n[i][r],n[i-2][r-2]+1))}return n[t.length][e.length]}function Wj(t,e){if(!e||e.length===0)return"";e=Array.from(new Set(e));let n=t.startsWith("--");n&&(t=t.slice(2),e=e.map(a=>a.slice(2)));let r=[],i=3,s=.4;return e.forEach(a=>{if(a.length<=1)return;let o=$j(t,a),l=Math.max(t.length,a.length);(l-o)/l>s&&(o<i?(i=o,r=[a]):o===i&&r.push(a))}),r.sort((a,o)=>a.localeCompare(o)),n&&(r=r.map(a=>`--${a}`)),r.length>1?`
(Did you mean one of ${r.join(", ")}?)`:r.length===1?`
(Did you mean ${r[0]}?)`:""}PN.suggestSimilar=Wj});var YN=g(HN=>{"use strict";u();var Kj=require("events").EventEmitter,S0=require("child_process"),Pi=require("path"),b0=require("fs"),Ct=require("process"),{Argument:zj,humanReadableArgName:Qj}=lp(),{CommanderError:T0}=mc(),{Help:jj}=_0(),{Option:kN,splitOptionFlags:Xj,DualOptions:Zj}=E0(),{suggestSimilar:BN}=FN(),x0=class t extends Kj{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!0,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._outputConfiguration={writeOut:n=>Ct.stdout.write(n),writeErr:n=>Ct.stderr.write(n),getOutHelpWidth:()=>Ct.stdout.isTTY?Ct.stdout.columns:void 0,getErrHelpWidth:()=>Ct.stderr.isTTY?Ct.stderr.columns:void 0,outputError:(n,r)=>r(n)},this._hidden=!1,this._hasHelpOption=!0,this._helpFlags="-h, --help",this._helpDescription="display help for command",this._helpShortFlag="-h",this._helpLongFlag="--help",this._addImplicitHelpCommand=void 0,this._helpCommandName="help",this._helpCommandnameAndArgs="help [command]",this._helpCommandDescription="display help for command",this._helpConfiguration={}}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._hasHelpOption=e._hasHelpOption,this._helpFlags=e._helpFlags,this._helpDescription=e._helpDescription,this._helpShortFlag=e._helpShortFlag,this._helpLongFlag=e._helpLongFlag,this._helpCommandName=e._helpCommandName,this._helpCommandnameAndArgs=e._helpCommandnameAndArgs,this._helpCommandDescription=e._helpCommandDescription,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}_getCommandAndAncestors(){let e=[];for(let n=this;n;n=n.parent)e.push(n);return e}command(e,n,r){let i=n,s=r;typeof i=="object"&&i!==null&&(s=i,i=null),s=s||{};let[,a,o]=e.match(/([^ ]+) *(.*)/),l=this.createCommand(a);return i&&(l.description(i),l._executableHandler=!0),s.isDefault&&(this._defaultCommandName=l._name),l._hidden=!!(s.noHelp||s.hidden),l._executableFile=s.executableFile||null,o&&l.arguments(o),this.commands.push(l),l.parent=this,l.copyInheritedSettings(this),i?this:l}createCommand(e){return new t(e)}createHelp(){return Object.assign(new jj,this.configureHelp())}configureHelp(e){return e===void 0?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return e===void 0?this._outputConfiguration:(Object.assign(this._outputConfiguration,e),this)}showHelpAfterError(e=!0){return typeof e!="string"&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,n){if(!e._name)throw new Error(`Command passed to .addCommand() must have a name
- specify the name in Command constructor or using .name()`);return n=n||{},n.isDefault&&(this._defaultCommandName=e._name),(n.noHelp||n.hidden)&&(e._hidden=!0),this.commands.push(e),e.parent=this,this}createArgument(e,n){return new zj(e,n)}argument(e,n,r,i){let s=this.createArgument(e,n);return typeof r=="function"?s.default(i).argParser(r):s.default(r),this.addArgument(s),this}arguments(e){return e.trim().split(/ +/).forEach(n=>{this.argument(n)}),this}addArgument(e){let n=this.registeredArguments.slice(-1)[0];if(n&&n.variadic)throw new Error(`only the last argument can be variadic '${n.name()}'`);if(e.required&&e.defaultValue!==void 0&&e.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${e.name()}'`);return this.registeredArguments.push(e),this}addHelpCommand(e,n){return e===!1?this._addImplicitHelpCommand=!1:(this._addImplicitHelpCommand=!0,typeof e=="string"&&(this._helpCommandName=e.split(" ")[0],this._helpCommandnameAndArgs=e),this._helpCommandDescription=n||this._helpCommandDescription),this}_hasImplicitHelpCommand(){return this._addImplicitHelpCommand===void 0?this.commands.length&&!this._actionHandler&&!this._findCommand("help"):this._addImplicitHelpCommand}hook(e,n){let r=["preSubcommand","preAction","postAction"];if(!r.includes(e))throw new Error(`Unexpected value for event passed to hook : '${e}'.
Expecting one of '${r.join("', '")}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(n):this._lifeCycleHooks[e]=[n],this}exitOverride(e){return e?this._exitCallback=e:this._exitCallback=n=>{if(n.code!=="commander.executeSubCommandAsync")throw n},this}_exit(e,n,r){this._exitCallback&&this._exitCallback(new T0(e,n,r)),Ct.exit(e)}action(e){let n=r=>{let i=this.registeredArguments.length,s=r.slice(0,i);return this._storeOptionsAsProperties?s[i]=this:s[i]=this.opts(),s.push(this),e.apply(this,s)};return this._actionHandler=n,this}createOption(e,n){return new kN(e,n)}_callParseArg(e,n,r,i){try{return e.parseArg(n,r)}catch(s){if(s.code==="commander.invalidArgument"){let a=`${i} ${s.message}`;this.error(a,{exitCode:s.exitCode,code:s.code})}throw s}}addOption(e){let n=e.name(),r=e.attributeName();if(e.negate){let s=e.long.replace(/^--no-/,"--");this._findOption(s)||this.setOptionValueWithSource(r,e.defaultValue===void 0?!0:e.defaultValue,"default")}else e.defaultValue!==void 0&&this.setOptionValueWithSource(r,e.defaultValue,"default");this.options.push(e);let i=(s,a,o)=>{s==null&&e.presetArg!==void 0&&(s=e.presetArg);let l=this.getOptionValue(r);s!==null&&e.parseArg?s=this._callParseArg(e,s,l,a):s!==null&&e.variadic&&(s=e._concatValue(s,l)),s==null&&(e.negate?s=!1:e.isBoolean()||e.optional?s=!0:s=""),this.setOptionValueWithSource(r,s,o)};return this.on("option:"+n,s=>{let a=`error: option '${e.flags}' argument '${s}' is invalid.`;i(s,a,"cli")}),e.envVar&&this.on("optionEnv:"+n,s=>{let a=`error: option '${e.flags}' value '${s}' from env '${e.envVar}' is invalid.`;i(s,a,"env")}),this}_optionEx(e,n,r,i,s){if(typeof n=="object"&&n instanceof kN)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let a=this.createOption(n,r);if(a.makeOptionMandatory(!!e.mandatory),typeof i=="function")a.default(s).argParser(i);else if(i instanceof RegExp){let o=i;i=(l,c)=>{let p=o.exec(l);return p?p[0]:c},a.default(s).argParser(i)}else a.default(i);return this.addOption(a)}option(e,n,r,i){return this._optionEx({},e,n,r,i)}requiredOption(e,n,r,i){return this._optionEx({mandatory:!0},e,n,r,i)}combineFlagAndOptionalValue(e=!0){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=!0){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=!0){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=!0){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=!0){if(this._passThroughOptions=!!e,this.parent&&e&&!this.parent._enablePositionalOptions)throw new Error("passThroughOptions can not be used without turning on enablePositionalOptions for parent command(s)");return this}storeOptionsAsProperties(e=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");return this._storeOptionsAsProperties=!!e,this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,n){return this.setOptionValueWithSource(e,n,void 0)}setOptionValueWithSource(e,n,r){return this._storeOptionsAsProperties?this[e]=n:this._optionValues[e]=n,this._optionValueSources[e]=r,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let n;return this._getCommandAndAncestors().forEach(r=>{r.getOptionValueSource(e)!==void 0&&(n=r.getOptionValueSource(e))}),n}_prepareUserArgs(e,n){if(e!==void 0&&!Array.isArray(e))throw new Error("first parameter to parse must be array or undefined");n=n||{},e===void 0&&(e=Ct.argv,Ct.versions&&Ct.versions.electron&&(n.from="electron")),this.rawArgs=e.slice();let r;switch(n.from){case void 0:case"node":this._scriptPath=e[1],r=e.slice(2);break;case"electron":Ct.defaultApp?(this._scriptPath=e[1],r=e.slice(2)):r=e.slice(1);break;case"user":r=e.slice(0);break;default:throw new Error(`unexpected parse option { from: '${n.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",r}parse(e,n){let r=this._prepareUserArgs(e,n);return this._par