@nice-move/cli 0.11.34 → 0.12.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/cli.mjs +1 -1
- package/dist/cmd/git.mjs +1 -1
- package/dist/cmd/lint.mjs +1 -1
- package/dist/dist-DZo1mBt4.mjs +139 -0
- package/dist/git-hooks-ukr62xCA.mjs +63 -0
- package/dist/{lib-AxbapuXb.mjs → lib-B9YSDxfE.mjs} +1 -1
- package/dist/lib-PLIKbC88.mjs +51 -0
- package/dist/lint-CIBWRpM4.mjs +1 -0
- package/dist/{lint-C7EDXsqp.mjs → lint-CvrvpJvb.mjs} +3 -3
- package/dist/rolldown-runtime-Dn1JIVgp.mjs +1 -0
- package/package.json +5 -5
- package/dist/cli-truncate-4k7jYIb9.mjs +0 -1
- package/dist/git-hooks-DsMD_-Lz.mjs +0 -38
- package/dist/lib-Db0sKVZ0.mjs +0 -88
- package/dist/lint-HaCS3r7M.mjs +0 -1
- package/dist/log-update-BbF5DdCa.mjs +0 -5
- package/dist/mjs-C5yiOROY.mjs +0 -23
- package/dist/rolldown-runtime-CwYF3Rm8.mjs +0 -1
- package/dist/string-width-CZYiOUJm.mjs +0 -1
- package/dist/wrap-ansi-B8_-Mypk.mjs +0 -8
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{i as e,t}from"./rolldown-runtime-
|
|
2
|
-
/* istanbul ignore next */9007199254740991,RELEASE_TYPES:[`major`,`premajor`,`minor`,`preminor`,`patch`,`prepatch`,`prerelease`],SEMVER_SPEC_VERSION:`2.0.0`,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}})),i=/* @__PURE__ */ t(((e,t)=>{t.exports=typeof process==`object`&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error(`SEMVER`,...e):()=>{}})),a=/* @__PURE__ */ t(((e,t)=>{let{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:a,MAX_LENGTH:o}=r(),s=i();e=t.exports={};let c=e.re=[],l=e.safeRe=[],u=e.src=[],d=e.safeSrc=[],f=e.t={},p=0,m=`[a-zA-Z0-9-]`,h=[[`\\s`,1],[`\\d`,o],[m,a]],g=e=>{for(let[t,n]of h)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e},_=(e,t,n)=>{let r=g(t),i=p++;s(e,i,t),f[e]=i,u[i]=t,d[i]=r,c[i]=new RegExp(t,n?`g`:void 0),l[i]=new RegExp(r,n?`g`:void 0)};_(`NUMERICIDENTIFIER`,`0|[1-9]\\d*`),_(`NUMERICIDENTIFIERLOOSE`,`\\d+`),_(`NONNUMERICIDENTIFIER`,`\\d*[a-zA-Z-]${m}*`),_(`MAINVERSION`,`(${u[f.NUMERICIDENTIFIER]})\\.(${u[f.NUMERICIDENTIFIER]})\\.(${u[f.NUMERICIDENTIFIER]})`),_(`MAINVERSIONLOOSE`,`(${u[f.NUMERICIDENTIFIERLOOSE]})\\.(${u[f.NUMERICIDENTIFIERLOOSE]})\\.(${u[f.NUMERICIDENTIFIERLOOSE]})`),_(`PRERELEASEIDENTIFIER`,`(?:${u[f.NONNUMERICIDENTIFIER]}|${u[f.NUMERICIDENTIFIER]})`),_(`PRERELEASEIDENTIFIERLOOSE`,`(?:${u[f.NONNUMERICIDENTIFIER]}|${u[f.NUMERICIDENTIFIERLOOSE]})`),_(`PRERELEASE`,`(?:-(${u[f.PRERELEASEIDENTIFIER]}(?:\\.${u[f.PRERELEASEIDENTIFIER]})*))`),_(`PRERELEASELOOSE`,`(?:-?(${u[f.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${u[f.PRERELEASEIDENTIFIERLOOSE]})*))`),_(`BUILDIDENTIFIER`,`${m}+`),_(`BUILD`,`(?:\\+(${u[f.BUILDIDENTIFIER]}(?:\\.${u[f.BUILDIDENTIFIER]})*))`),_(`FULLPLAIN`,`v?${u[f.MAINVERSION]}${u[f.PRERELEASE]}?${u[f.BUILD]}?`),_(`FULL`,`^${u[f.FULLPLAIN]}$`),_(`LOOSEPLAIN`,`[v=\\s]*${u[f.MAINVERSIONLOOSE]}${u[f.PRERELEASELOOSE]}?${u[f.BUILD]}?`),_(`LOOSE`,`^${u[f.LOOSEPLAIN]}$`),_(`GTLT`,`((?:<|>)?=?)`),_(`XRANGEIDENTIFIERLOOSE`,`${u[f.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),_(`XRANGEIDENTIFIER`,`${u[f.NUMERICIDENTIFIER]}|x|X|\\*`),_(`XRANGEPLAIN`,`[v=\\s]*(${u[f.XRANGEIDENTIFIER]})(?:\\.(${u[f.XRANGEIDENTIFIER]})(?:\\.(${u[f.XRANGEIDENTIFIER]})(?:${u[f.PRERELEASE]})?${u[f.BUILD]}?)?)?`),_(`XRANGEPLAINLOOSE`,`[v=\\s]*(${u[f.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[f.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[f.XRANGEIDENTIFIERLOOSE]})(?:${u[f.PRERELEASELOOSE]})?${u[f.BUILD]}?)?)?`),_(`XRANGE`,`^${u[f.GTLT]}\\s*${u[f.XRANGEPLAIN]}$`),_(`XRANGELOOSE`,`^${u[f.GTLT]}\\s*${u[f.XRANGEPLAINLOOSE]}$`),_(`COERCEPLAIN`,`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),_(`COERCE`,`${u[f.COERCEPLAIN]}(?:$|[^\\d])`),_(`COERCEFULL`,u[f.COERCEPLAIN]+`(?:${u[f.PRERELEASE]})?(?:${u[f.BUILD]})?(?:$|[^\\d])`),_(`COERCERTL`,u[f.COERCE],!0),_(`COERCERTLFULL`,u[f.COERCEFULL],!0),_(`LONETILDE`,`(?:~>?)`),_(`TILDETRIM`,`(\\s*)${u[f.LONETILDE]}\\s+`,!0),e.tildeTrimReplace=`$1~`,_(`TILDE`,`^${u[f.LONETILDE]}${u[f.XRANGEPLAIN]}$`),_(`TILDELOOSE`,`^${u[f.LONETILDE]}${u[f.XRANGEPLAINLOOSE]}$`),_(`LONECARET`,`(?:\\^)`),_(`CARETTRIM`,`(\\s*)${u[f.LONECARET]}\\s+`,!0),e.caretTrimReplace=`$1^`,_(`CARET`,`^${u[f.LONECARET]}${u[f.XRANGEPLAIN]}$`),_(`CARETLOOSE`,`^${u[f.LONECARET]}${u[f.XRANGEPLAINLOOSE]}$`),_(`COMPARATORLOOSE`,`^${u[f.GTLT]}\\s*(${u[f.LOOSEPLAIN]})$|^$`),_(`COMPARATOR`,`^${u[f.GTLT]}\\s*(${u[f.FULLPLAIN]})$|^$`),_(`COMPARATORTRIM`,`(\\s*)${u[f.GTLT]}\\s*(${u[f.LOOSEPLAIN]}|${u[f.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace=`$1$2$3`,_(`HYPHENRANGE`,`^\\s*(${u[f.XRANGEPLAIN]})\\s+-\\s+(${u[f.XRANGEPLAIN]})\\s*$`),_(`HYPHENRANGELOOSE`,`^\\s*(${u[f.XRANGEPLAINLOOSE]})\\s+-\\s+(${u[f.XRANGEPLAINLOOSE]})\\s*$`),_(`STAR`,`(<|>)?=?\\s*\\*`),_(`GTE0`,`^\\s*>=\\s*0\\.0\\.0\\s*$`),_(`GTE0PRE`,`^\\s*>=\\s*0\\.0\\.0-0\\s*$`)})),o=/* @__PURE__ */ t(((e,t)=>{let n=Object.freeze({loose:!0}),r=Object.freeze({});t.exports=e=>e?typeof e==`object`?e:n:r})),s=/* @__PURE__ */ t(((e,t)=>{let n=/^[0-9]+$/,r=(e,t)=>{if(typeof e==`number`&&typeof t==`number`)return e===t?0:e<t?-1:1;let r=n.test(e),i=n.test(t);return r&&i&&(e=+e,t=+t),e===t?0:r&&!i?-1:i&&!r?1:e<t?-1:1};t.exports={compareIdentifiers:r,rcompareIdentifiers:(e,t)=>r(t,e)}})),c=/* @__PURE__ */ t(((e,t)=>{let n=i(),{MAX_LENGTH:c,MAX_SAFE_INTEGER:l}=r(),{safeRe:u,t:d}=a(),f=o(),{compareIdentifiers:p}=s(),m=(e,t)=>{let n=t.split(`.`);if(n.length>e.length)return!1;for(let t=0;t<n.length;t++)if(p(e[t],n[t])!==0)return!1;return!0};t.exports=class e{constructor(t,r){if(r=f(r),t instanceof e){if(t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease)return t;t=t.version}else if(typeof t!=`string`)throw TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>c)throw TypeError(`version is longer than ${c} characters`);n(`SemVer`,t,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let i=t.trim().match(r.loose?u[d.LOOSE]:u[d.FULL]);if(!i)throw TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+i[1],this.minor=+i[2],this.patch=+i[3],this.major>l||this.major<0)throw TypeError(`Invalid major version`);if(this.minor>l||this.minor<0)throw TypeError(`Invalid minor version`);if(this.patch>l||this.patch<0)throw TypeError(`Invalid patch version`);this.prerelease=i[4]?i[4].split(`.`).map(e=>{if(/^[0-9]+$/.test(e)){let t=+e;if(t>=0&&t<l)return t}return e}):[],this.build=i[5]?i[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(t){if(n(`SemVer.compare`,this.version,this.options,t),!(t instanceof e)){if(typeof t==`string`&&t===this.version)return 0;t=new e(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof e||(t=new e(t,this.options)),this.major<t.major?-1:this.major>t.major?1:this.minor<t.minor?-1:this.minor>t.minor?1:this.patch<t.patch?-1:+(this.patch>t.patch)}comparePre(t){if(t instanceof e||(t=new e(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{let e=this.prerelease[r],i=t.prerelease[r];if(n(`prerelease compare`,r,e,i),e===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(e===void 0)return-1;if(e!==i)return p(e,i)}while(++r)}compareBuild(t){t instanceof e||(t=new e(t,this.options));let r=0;do{let e=this.build[r],i=t.build[r];if(n(`build compare`,r,e,i),e===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(e===void 0)return-1;if(e!==i)return p(e,i)}while(++r)}inc(e,t,n){if(e.startsWith(`pre`)){if(!t&&n===!1)throw Error(`invalid increment argument: identifier is empty`);if(t){let e=`-${t}`.match(this.options.loose?u[d.PRERELEASELOOSE]:u[d.PRERELEASE]);if(!e||e[1]!==t)throw Error(`invalid identifier: ${t}`)}}switch(e){case`premajor`:this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc(`pre`,t,n);break;case`preminor`:this.prerelease.length=0,this.patch=0,this.minor++,this.inc(`pre`,t,n);break;case`prepatch`:this.prerelease.length=0,this.inc(`patch`,t,n),this.inc(`pre`,t,n);break;case`prerelease`:this.prerelease.length===0&&this.inc(`patch`,t,n),this.inc(`pre`,t,n);break;case`release`:if(this.prerelease.length===0)throw 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 e=+!!Number(n);if(this.prerelease.length===0)this.prerelease=[e];else{let r=this.prerelease.length;for(;--r>=0;)typeof this.prerelease[r]==`number`&&(this.prerelease[r]++,r=-2);if(r===-1){if(t===this.prerelease.join(`.`)&&n===!1)throw Error(`invalid increment argument: identifier already exists`);this.prerelease.push(e)}}if(t){let r=[t,e];if(n===!1&&(r=[t]),m(this.prerelease,t)){let e=this.prerelease[t.split(`.`).length];isNaN(e)&&(this.prerelease=r)}else this.prerelease=r}break}default:throw Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(`.`)}`),this}}})),l=/* @__PURE__ */ t(((e,t)=>{let n=c();t.exports=(e,t,r=!1)=>{if(e instanceof n)return e;try{return new n(e,t)}catch(e){if(!r)return null;throw e}}})),u=/* @__PURE__ */ t(((e,t)=>{let n=l();t.exports=(e,t)=>{let r=n(e,t);return r?r.version:null}})),d=/* @__PURE__ */ t(((e,t)=>{let n=l();t.exports=(e,t)=>{let r=n(e.trim().replace(/^[=v]+/,``),t);return r?r.version:null}})),f=/* @__PURE__ */ t(((e,t)=>{let n=c();t.exports=(e,t,r,i,a)=>{typeof r==`string`&&(a=i,i=r,r=void 0);try{return new n(e instanceof n?e.version:e,r).inc(t,i,a).version}catch{return null}}})),p=/* @__PURE__ */ t(((e,t)=>{let n=l();t.exports=(e,t)=>{let r=n(e,null,!0),i=n(t,null,!0),a=r.compare(i);if(a===0)return null;let o=a>0,s=o?r:i,c=o?i:r,l=!!s.prerelease.length;if(c.prerelease.length&&!l){if(!c.patch&&!c.minor)return`major`;if(c.compareMain(s)===0)return c.minor&&!c.patch?`minor`:`patch`}let u=l?`pre`:``;return r.major===i.major?r.minor===i.minor?r.patch===i.patch?`prerelease`:u+`patch`:u+`minor`:u+`major`}})),m=/* @__PURE__ */ t(((e,t)=>{let n=c();t.exports=(e,t)=>new n(e,t).major})),h=/* @__PURE__ */ t(((e,t)=>{let n=c();t.exports=(e,t)=>new n(e,t).minor})),g=/* @__PURE__ */ t(((e,t)=>{let n=c();t.exports=(e,t)=>new n(e,t).patch})),_=/* @__PURE__ */ t(((e,t)=>{let n=l();t.exports=(e,t)=>{let r=n(e,t);return r&&r.prerelease.length?r.prerelease:null}})),v=/* @__PURE__ */ t(((e,t)=>{let n=c();t.exports=(e,t,r)=>new n(e,r).compare(new n(t,r))})),y=/* @__PURE__ */ t(((e,t)=>{let n=v();t.exports=(e,t,r)=>n(t,e,r)})),ee=/* @__PURE__ */ t(((e,t)=>{let n=v();t.exports=(e,t)=>n(e,t,!0)})),b=/* @__PURE__ */ t(((e,t)=>{let n=c();t.exports=(e,t,r)=>{let i=new n(e,r),a=new n(t,r);return i.compare(a)||i.compareBuild(a)}})),te=/* @__PURE__ */ t(((e,t)=>{let n=b();t.exports=(e,t)=>e.sort((e,r)=>n(e,r,t))})),ne=/* @__PURE__ */ t(((e,t)=>{let n=b();t.exports=(e,t)=>e.sort((e,r)=>n(r,e,t))})),x=/* @__PURE__ */ t(((e,t)=>{let n=v();t.exports=(e,t,r)=>n(e,t,r)>0})),S=/* @__PURE__ */ t(((e,t)=>{let n=v();t.exports=(e,t,r)=>n(e,t,r)<0})),C=/* @__PURE__ */ t(((e,t)=>{let n=v();t.exports=(e,t,r)=>n(e,t,r)===0})),re=/* @__PURE__ */ t(((e,t)=>{let n=v();t.exports=(e,t,r)=>n(e,t,r)!==0})),w=/* @__PURE__ */ t(((e,t)=>{let n=v();t.exports=(e,t,r)=>n(e,t,r)>=0})),T=/* @__PURE__ */ t(((e,t)=>{let n=v();t.exports=(e,t,r)=>n(e,t,r)<=0})),ie=/* @__PURE__ */ t(((e,t)=>{let n=C(),r=re(),i=x(),a=w(),o=S(),s=T();t.exports=(e,t,c,l)=>{switch(t){case`===`:return typeof e==`object`&&(e=e.version),typeof c==`object`&&(c=c.version),e===c;case`!==`:return typeof e==`object`&&(e=e.version),typeof c==`object`&&(c=c.version),e!==c;case``:case`=`:case`==`:return n(e,c,l);case`!=`:return r(e,c,l);case`>`:return i(e,c,l);case`>=`:return a(e,c,l);case`<`:return o(e,c,l);case`<=`:return s(e,c,l);default:throw TypeError(`Invalid operator: ${t}`)}}})),ae=/* @__PURE__ */ t(((e,t)=>{let n=c(),r=l(),{safeRe:i,t:o}=a();t.exports=(e,t)=>{if(e instanceof n)return e;if(typeof e==`number`&&(e=String(e)),typeof e!=`string`)return null;t||={};let a=null;if(!t.rtl)a=e.match(t.includePrerelease?i[o.COERCEFULL]:i[o.COERCE]);else{let n=t.includePrerelease?i[o.COERCERTLFULL]:i[o.COERCERTL],r;for(;(r=n.exec(e))&&(!a||a.index+a[0].length!==e.length);)(!a||r.index+r[0].length!==a.index+a[0].length)&&(a=r),n.lastIndex=r.index+r[1].length+r[2].length;n.lastIndex=-1}if(a===null)return null;let s=a[2],c=a[3]||`0`,l=a[4]||`0`,u=t.includePrerelease&&a[5]?`-${a[5]}`:``,d=t.includePrerelease&&a[6]?`+${a[6]}`:``;return r(`${s}.${c}.${l}${u}${d}`,t)}})),oe=/* @__PURE__ */ t(((e,t)=>{let n=l(),i=r(),a=c(),o=(e,t,n)=>{if(!i.RELEASE_TYPES.includes(t))return null;let r=s(e,n);return r&&u(r,t)},s=(e,t)=>{let r=e instanceof a?e.version:e;return n(r,t)},u=(e,t)=>{if(d(t))return e.version;switch(e.prerelease=[],t){case`major`:e.minor=0,e.patch=0;break;case`minor`:e.patch=0}return e.format()},d=e=>e.startsWith(`pre`);t.exports=o})),se=/* @__PURE__ */ t(((e,t)=>{t.exports=class{constructor(){this.max=1e3,this.map=/* @__PURE__ */ new Map}get(e){let t=this.map.get(e);if(t!==void 0)return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&t!==void 0){if(this.map.size>=this.max){let e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}}})),E=/* @__PURE__ */ t(((e,t)=>{let n=/\s+/g;t.exports=class e{constructor(t,r){if(r=l(r),t instanceof e)return t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease?t:new e(t.raw,r);if(t instanceof u)return this.raw=t.value,this.set=[[t]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=t.trim().replace(n,` `),this.set=this.raw.split(`||`).map(e=>this.parseRange(e.trim())).filter(e=>e.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let e=this.set[0];if(this.set=this.set.filter(e=>!te(e[0])),this.set.length===0)this.set=[e];else if(this.set.length>1){for(let e of this.set)if(e.length===1&&ne(e[0])){this.set=[e];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 t=this.set[e];for(let e=0;e<t.length;e++)e>0&&(this.formatted+=` `),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){e=e.replace(b,``);let t=((this.options.includePrerelease&&y)|(this.options.loose&&ee))+`:`+e,n=s.get(t);if(n)return n;let r=this.options.loose,i=r?p[h.HYPHENRANGELOOSE]:p[h.HYPHENRANGE];e=e.replace(i,le(this.options.includePrerelease)),d(`hyphen replace`,e),e=e.replace(p[h.COMPARATORTRIM],g),d(`comparator trim`,e),e=e.replace(p[h.TILDETRIM],_),d(`tilde trim`,e),e=e.replace(p[h.CARETTRIM],v),d(`caret trim`,e);let a=e.split(` `).map(e=>S(e,this.options)).join(` `).split(/\s+/).map(e=>ce(e,this.options));r&&(a=a.filter(e=>(d(`loose invalid filter`,e,this.options),!!e.match(p[h.COMPARATORLOOSE])))),d(`range list`,a);let o=/* @__PURE__ */ new Map,c=a.map(e=>new u(e,this.options));for(let e of c){if(te(e))return[e];o.set(e.value,e)}o.size>1&&o.has(``)&&o.delete(``);let l=[...o.values()];return s.set(t,l),l}intersects(t,n){if(!(t instanceof e))throw TypeError(`a Range is required`);return this.set.some(e=>x(e,n)&&t.set.some(t=>x(t,n)&&e.every(e=>t.every(t=>e.intersects(t,n)))))}test(e){if(!e)return!1;if(typeof e==`string`)try{e=new f(e,this.options)}catch{return!1}for(let t=0;t<this.set.length;t++)if(ue(this.set[t],e,this.options))return!0;return!1}};let s=new(se()),l=o(),u=D(),d=i(),f=c(),{safeRe:p,src:m,t:h,comparatorTrimReplace:g,tildeTrimReplace:_,caretTrimReplace:v}=a(),{FLAG_INCLUDE_PRERELEASE:y,FLAG_LOOSE:ee}=r(),b=new RegExp(m[h.BUILD],`g`),te=e=>e.value===`<0.0.0-0`,ne=e=>e.value===``,x=(e,t)=>{let n=!0,r=e.slice(),i=r.pop();for(;n&&r.length;)n=r.every(e=>i.intersects(e,t)),i=r.pop();return n},S=(e,t)=>(e=e.replace(p[h.BUILD],``),d(`comp`,e,t),e=ie(e,t),d(`caret`,e),e=w(e,t),d(`tildes`,e),e=oe(e,t),d(`xrange`,e),e=O(e,t),d(`stars`,e),e),C=e=>!e||e.toLowerCase()===`x`||e===`*`,re=(e,t,n)=>C(e)&&!C(t)||C(t)&&n&&!C(n),w=(e,t)=>e.trim().split(/\s+/).map(e=>T(e,t)).join(` `),T=(e,t)=>{let n=t.loose?p[h.TILDELOOSE]:p[h.TILDE],r=t.includePrerelease?`-0`:``;return e.replace(n,(t,n,i,a,o)=>{d(`tilde`,e,t,n,i,a,o);let s;return C(n)?s=``:C(i)?s=`>=${n}.0.0${r} <${+n+1}.0.0-0`:C(a)?s=`>=${n}.${i}.0${r} <${n}.${+i+1}.0-0`:o?(d(`replaceTilde pr`,o),s=`>=${n}.${i}.${a}-${o} <${n}.${+i+1}.0-0`):s=`>=${n}.${i}.${a} <${n}.${+i+1}.0-0`,d(`tilde return`,s),s})},ie=(e,t)=>e.trim().split(/\s+/).map(e=>ae(e,t)).join(` `),ae=(e,t)=>{d(`caret`,e,t);let n=t.loose?p[h.CARETLOOSE]:p[h.CARET],r=t.includePrerelease?`-0`:``;return e.replace(n,(t,n,i,a,o)=>{d(`caret`,e,t,n,i,a,o);let s;return C(n)?s=``:C(i)?s=`>=${n}.0.0${r} <${+n+1}.0.0-0`:C(a)?s=n===`0`?`>=${n}.${i}.0${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.0${r} <${+n+1}.0.0-0`:o?(d(`replaceCaret pr`,o),s=n===`0`?i===`0`?`>=${n}.${i}.${a}-${o} <${n}.${i}.${+a+1}-0`:`>=${n}.${i}.${a}-${o} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${a}-${o} <${+n+1}.0.0-0`):(d(`no pr`),s=n===`0`?i===`0`?`>=${n}.${i}.${a} <${n}.${i}.${+a+1}-0`:`>=${n}.${i}.${a} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${a} <${+n+1}.0.0-0`),d(`caret return`,s),s})},oe=(e,t)=>(d(`replaceXRanges`,e,t),e.split(/\s+/).map(e=>E(e,t)).join(` `)),E=(e,t)=>{e=e.trim();let n=t.loose?p[h.XRANGELOOSE]:p[h.XRANGE];return e.replace(n,(n,r,i,a,o,s)=>{if(d(`xRange`,e,n,r,i,a,o,s),re(i,a,o))return e;let c=C(i),l=c||C(a),u=l||C(o),f=u;return r===`=`&&f&&(r=``),s=t.includePrerelease?`-0`:``,c?n=r===`>`||r===`<`?`<0.0.0-0`:`*`:r&&f?(l&&(a=0),o=0,r===`>`?(r=`>=`,l?(i=+i+1,a=0,o=0):(a=+a+1,o=0)):r===`<=`&&(r=`<`,l?i=+i+1:a=+a+1),r===`<`&&(s=`-0`),n=`${r+i}.${a}.${o}${s}`):l?n=`>=${i}.0.0${s} <${+i+1}.0.0-0`:u&&(n=`>=${i}.${a}.0${s} <${i}.${+a+1}.0-0`),d(`xRange return`,n),n})},O=(e,t)=>(d(`replaceStars`,e,t),e.trim().replace(p[h.STAR],``)),ce=(e,t)=>(d(`replaceGTE0`,e,t),e.trim().replace(p[t.includePrerelease?h.GTE0PRE:h.GTE0],``)),le=e=>(t,n,r,i,a,o,s,c,l,u,d,f)=>(n=C(r)?``:C(i)?`>=${r}.0.0${e?`-0`:``}`:C(a)?`>=${r}.${i}.0${e?`-0`:``}`:o?`>=${n}`:`>=${n}${e?`-0`:``}`,c=C(l)?``:C(u)?`<${+l+1}.0.0-0`:C(d)?`<${l}.${+u+1}.0-0`:f?`<=${l}.${u}.${d}-${f}`:e?`<${l}.${u}.${+d+1}-0`:`<=${c}`,`${n} ${c}`.trim()),ue=(e,t,n)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let n=0;n<e.length;n++)if(d(e[n].semver),e[n].semver!==u.ANY&&e[n].semver.prerelease.length>0){let r=e[n].semver;if(r.major===t.major&&r.minor===t.minor&&r.patch===t.patch)return!0}return!1}return!0}})),D=/* @__PURE__ */ t(((e,t)=>{let n=Symbol(`SemVer ANY`);t.exports=class e{static get ANY(){return n}constructor(t,i){if(i=r(i),t instanceof e){if(t.loose===!!i.loose)return t;t=t.value}t=t.trim().split(/\s+/).join(` `),d(`comparator`,t,i),this.options=i,this.loose=!!i.loose,this.parse(t),this.value=this.semver===n?``:this.operator+this.semver.version,d(`comp`,this)}parse(e){let t=this.options.loose?s[l.COMPARATORLOOSE]:s[l.COMPARATOR],r=e.match(t);if(!r)throw TypeError(`Invalid comparator: ${e}`);this.operator=r[1]===void 0?``:r[1],this.operator===`=`&&(this.operator=``),this.semver=r[2]?new f(r[2],this.options.loose):n}toString(){return this.value}test(e){if(d(`Comparator.test`,e,this.options.loose),this.semver===n||e===n)return!0;if(typeof e==`string`)try{e=new f(e,this.options)}catch{return!1}return u(e,this.operator,this.semver,this.options)}intersects(t,n){if(!(t instanceof e))throw TypeError(`a Comparator is required`);return this.operator===``?this.value===``||new p(t.value,n).test(this.value):t.operator===``?t.value===``||new p(this.value,n).test(t.semver):(n=r(n),n.includePrerelease&&(this.value===`<0.0.0-0`||t.value===`<0.0.0-0`)||!n.includePrerelease&&(this.value.startsWith(`<0.0.0`)||t.value.startsWith(`<0.0.0`))?!1:!!(this.operator.startsWith(`>`)&&t.operator.startsWith(`>`)||this.operator.startsWith(`<`)&&t.operator.startsWith(`<`)||this.semver.version===t.semver.version&&this.operator.includes(`=`)&&t.operator.includes(`=`)||u(this.semver,`<`,t.semver,n)&&this.operator.startsWith(`>`)&&t.operator.startsWith(`<`)||u(this.semver,`>`,t.semver,n)&&this.operator.startsWith(`<`)&&t.operator.startsWith(`>`)))}};let r=o(),{safeRe:s,t:l}=a(),u=ie(),d=i(),f=c(),p=E()})),O=/* @__PURE__ */ t(((e,t)=>{let n=E();t.exports=(e,t,r)=>{try{t=new n(t,r)}catch{return!1}return t.test(e)}})),ce=/* @__PURE__ */ t(((e,t)=>{let n=E();t.exports=(e,t)=>new n(e,t).set.map(e=>e.map(e=>e.value).join(` `).trim().split(` `))})),le=/* @__PURE__ */ t(((e,t)=>{let n=c(),r=E();t.exports=(e,t,i)=>{let a=null,o=null,s=null;try{s=new r(t,i)}catch{return null}return e.forEach(e=>{s.test(e)&&(!a||o.compare(e)===-1)&&(a=e,o=new n(a,i))}),a}})),ue=/* @__PURE__ */ t(((e,t)=>{let n=c(),r=E();t.exports=(e,t,i)=>{let a=null,o=null,s=null;try{s=new r(t,i)}catch{return null}return e.forEach(e=>{s.test(e)&&(!a||o.compare(e)===1)&&(a=e,o=new n(a,i))}),a}})),de=/* @__PURE__ */ t(((e,t)=>{let n=c(),r=E(),i=x();t.exports=(e,t)=>{e=new r(e,t);let a=new n(`0.0.0`);if(e.test(a)||(a=new n(`0.0.0-0`),e.test(a)))return a;a=null;for(let t=0;t<e.set.length;++t){let r=e.set[t],o=null;r.forEach(e=>{let t=new n(e.semver.version);switch(e.operator){case`>`:t.prerelease.length===0?t.patch++:t.prerelease.push(0),t.raw=t.format();case``:case`>=`:(!o||i(t,o))&&(o=t);break;case`<`:case`<=`:break;
|
|
1
|
+
import{i as e,t}from"./rolldown-runtime-Dn1JIVgp.mjs";import n from"node:util";var r=/* @__PURE__ */ t(((e,t)=>{t.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:2**53-1||
|
|
2
|
+
/* istanbul ignore next */9007199254740991,RELEASE_TYPES:[`major`,`premajor`,`minor`,`preminor`,`patch`,`prepatch`,`prerelease`],SEMVER_SPEC_VERSION:`2.0.0`,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}})),i=/* @__PURE__ */ t(((e,t)=>{t.exports=typeof process==`object`&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error(`SEMVER`,...e):()=>{}})),a=/* @__PURE__ */ t(((e,t)=>{let{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:a,MAX_LENGTH:o}=r(),s=i();e=t.exports={};let c=e.re=[],l=e.safeRe=[],u=e.src=[],d=e.safeSrc=[],f=e.t={},p=0,m=`[a-zA-Z0-9-]`,h=[[`\\s`,1],[`\\d`,o],[m,a]],g=e=>{for(let[t,n]of h)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e},_=(e,t,n)=>{let r=g(t),i=p++;s(e,i,t),f[e]=i,u[i]=t,d[i]=r,c[i]=new RegExp(t,n?`g`:void 0),l[i]=new RegExp(r,n?`g`:void 0)};_(`NUMERICIDENTIFIER`,`0|[1-9]\\d*`),_(`NUMERICIDENTIFIERLOOSE`,`\\d+`),_(`NONNUMERICIDENTIFIER`,`\\d*[a-zA-Z-]${m}*`),_(`MAINVERSION`,`(${u[f.NUMERICIDENTIFIER]})\\.(${u[f.NUMERICIDENTIFIER]})\\.(${u[f.NUMERICIDENTIFIER]})`),_(`MAINVERSIONLOOSE`,`(${u[f.NUMERICIDENTIFIERLOOSE]})\\.(${u[f.NUMERICIDENTIFIERLOOSE]})\\.(${u[f.NUMERICIDENTIFIERLOOSE]})`),_(`PRERELEASEIDENTIFIER`,`(?:${u[f.NONNUMERICIDENTIFIER]}|${u[f.NUMERICIDENTIFIER]})`),_(`PRERELEASEIDENTIFIERLOOSE`,`(?:${u[f.NONNUMERICIDENTIFIER]}|${u[f.NUMERICIDENTIFIERLOOSE]})`),_(`PRERELEASE`,`(?:-(${u[f.PRERELEASEIDENTIFIER]}(?:\\.${u[f.PRERELEASEIDENTIFIER]})*))`),_(`PRERELEASELOOSE`,`(?:-?(${u[f.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${u[f.PRERELEASEIDENTIFIERLOOSE]})*))`),_(`BUILDIDENTIFIER`,`${m}+`),_(`BUILD`,`(?:\\+(${u[f.BUILDIDENTIFIER]}(?:\\.${u[f.BUILDIDENTIFIER]})*))`),_(`FULLPLAIN`,`v?${u[f.MAINVERSION]}${u[f.PRERELEASE]}?${u[f.BUILD]}?`),_(`FULL`,`^${u[f.FULLPLAIN]}$`),_(`LOOSEPLAIN`,`[v=\\s]*${u[f.MAINVERSIONLOOSE]}${u[f.PRERELEASELOOSE]}?${u[f.BUILD]}?`),_(`LOOSE`,`^${u[f.LOOSEPLAIN]}$`),_(`GTLT`,`((?:<|>)?=?)`),_(`XRANGEIDENTIFIERLOOSE`,`${u[f.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),_(`XRANGEIDENTIFIER`,`${u[f.NUMERICIDENTIFIER]}|x|X|\\*`),_(`XRANGEPLAIN`,`[v=\\s]*(${u[f.XRANGEIDENTIFIER]})(?:\\.(${u[f.XRANGEIDENTIFIER]})(?:\\.(${u[f.XRANGEIDENTIFIER]})(?:${u[f.PRERELEASE]})?${u[f.BUILD]}?)?)?`),_(`XRANGEPLAINLOOSE`,`[v=\\s]*(${u[f.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[f.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[f.XRANGEIDENTIFIERLOOSE]})(?:${u[f.PRERELEASELOOSE]})?${u[f.BUILD]}?)?)?`),_(`XRANGE`,`^${u[f.GTLT]}\\s*${u[f.XRANGEPLAIN]}$`),_(`XRANGELOOSE`,`^${u[f.GTLT]}\\s*${u[f.XRANGEPLAINLOOSE]}$`),_(`COERCEPLAIN`,`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),_(`COERCE`,`${u[f.COERCEPLAIN]}(?:$|[^\\d])`),_(`COERCEFULL`,u[f.COERCEPLAIN]+`(?:${u[f.PRERELEASE]})?(?:${u[f.BUILD]})?(?:$|[^\\d])`),_(`COERCERTL`,u[f.COERCE],!0),_(`COERCERTLFULL`,u[f.COERCEFULL],!0),_(`LONETILDE`,`(?:~>?)`),_(`TILDETRIM`,`(\\s*)${u[f.LONETILDE]}\\s+`,!0),e.tildeTrimReplace=`$1~`,_(`TILDE`,`^${u[f.LONETILDE]}${u[f.XRANGEPLAIN]}$`),_(`TILDELOOSE`,`^${u[f.LONETILDE]}${u[f.XRANGEPLAINLOOSE]}$`),_(`LONECARET`,`(?:\\^)`),_(`CARETTRIM`,`(\\s*)${u[f.LONECARET]}\\s+`,!0),e.caretTrimReplace=`$1^`,_(`CARET`,`^${u[f.LONECARET]}${u[f.XRANGEPLAIN]}$`),_(`CARETLOOSE`,`^${u[f.LONECARET]}${u[f.XRANGEPLAINLOOSE]}$`),_(`COMPARATORLOOSE`,`^${u[f.GTLT]}\\s*(${u[f.LOOSEPLAIN]})$|^$`),_(`COMPARATOR`,`^${u[f.GTLT]}\\s*(${u[f.FULLPLAIN]})$|^$`),_(`COMPARATORTRIM`,`(\\s*)${u[f.GTLT]}\\s*(${u[f.LOOSEPLAIN]}|${u[f.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace=`$1$2$3`,_(`HYPHENRANGE`,`^\\s*(${u[f.XRANGEPLAIN]})\\s+-\\s+(${u[f.XRANGEPLAIN]})\\s*$`),_(`HYPHENRANGELOOSE`,`^\\s*(${u[f.XRANGEPLAINLOOSE]})\\s+-\\s+(${u[f.XRANGEPLAINLOOSE]})\\s*$`),_(`STAR`,`(<|>)?=?\\s*\\*`),_(`GTE0`,`^\\s*>=\\s*0\\.0\\.0\\s*$`),_(`GTE0PRE`,`^\\s*>=\\s*0\\.0\\.0-0\\s*$`)})),o=/* @__PURE__ */ t(((e,t)=>{let n=Object.freeze({loose:!0}),r=Object.freeze({});t.exports=e=>e?typeof e==`object`?e:n:r})),s=/* @__PURE__ */ t(((e,t)=>{let n=/^[0-9]+$/,r=(e,t)=>{if(typeof e==`number`&&typeof t==`number`)return e===t?0:e<t?-1:1;let r=n.test(e),i=n.test(t);return r&&i&&(e=+e,t=+t),e===t?0:r&&!i?-1:i&&!r?1:e<t?-1:1};t.exports={compareIdentifiers:r,rcompareIdentifiers:(e,t)=>r(t,e)}})),c=/* @__PURE__ */ t(((e,t)=>{let n=i(),{MAX_LENGTH:c,MAX_SAFE_INTEGER:l}=r(),{safeRe:u,t:d}=a(),f=o(),{compareIdentifiers:p}=s(),m=(e,t)=>{let n=t.split(`.`);if(n.length>e.length)return!1;for(let t=0;t<n.length;t++)if(p(e[t],n[t])!==0)return!1;return!0};t.exports=class e{constructor(t,r){if(r=f(r),t instanceof e){if(t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease)return t;t=t.version}else if(typeof t!=`string`)throw TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>c)throw TypeError(`version is longer than ${c} characters`);n(`SemVer`,t,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let i=t.trim().match(r.loose?u[d.LOOSE]:u[d.FULL]);if(!i)throw TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+i[1],this.minor=+i[2],this.patch=+i[3],this.major>l||this.major<0)throw TypeError(`Invalid major version`);if(this.minor>l||this.minor<0)throw TypeError(`Invalid minor version`);if(this.patch>l||this.patch<0)throw TypeError(`Invalid patch version`);this.prerelease=i[4]?i[4].split(`.`).map(e=>{if(/^[0-9]+$/.test(e)){let t=+e;if(t>=0&&t<l)return t}return e}):[],this.build=i[5]?i[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(t){if(n(`SemVer.compare`,this.version,this.options,t),!(t instanceof e)){if(typeof t==`string`&&t===this.version)return 0;t=new e(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof e||(t=new e(t,this.options)),this.major<t.major?-1:this.major>t.major?1:this.minor<t.minor?-1:this.minor>t.minor?1:this.patch<t.patch?-1:+(this.patch>t.patch)}comparePre(t){if(t instanceof e||(t=new e(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{let e=this.prerelease[r],i=t.prerelease[r];if(n(`prerelease compare`,r,e,i),e===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(e===void 0)return-1;if(e!==i)return p(e,i)}while(++r)}compareBuild(t){t instanceof e||(t=new e(t,this.options));let r=0;do{let e=this.build[r],i=t.build[r];if(n(`build compare`,r,e,i),e===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(e===void 0)return-1;if(e!==i)return p(e,i)}while(++r)}inc(e,t,n){if(e.startsWith(`pre`)){if(!t&&n===!1)throw Error(`invalid increment argument: identifier is empty`);if(t){let e=`-${t}`.match(this.options.loose?u[d.PRERELEASELOOSE]:u[d.PRERELEASE]);if(!e||e[1]!==t)throw Error(`invalid identifier: ${t}`)}}switch(e){case`premajor`:this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc(`pre`,t,n);break;case`preminor`:this.prerelease.length=0,this.patch=0,this.minor++,this.inc(`pre`,t,n);break;case`prepatch`:this.prerelease.length=0,this.inc(`patch`,t,n),this.inc(`pre`,t,n);break;case`prerelease`:this.prerelease.length===0&&this.inc(`patch`,t,n),this.inc(`pre`,t,n);break;case`release`:if(this.prerelease.length===0)throw 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 e=+!!Number(n);if(this.prerelease.length===0)this.prerelease=[e];else{let r=this.prerelease.length;for(;--r>=0;)typeof this.prerelease[r]==`number`&&(this.prerelease[r]++,r=-2);if(r===-1){if(t===this.prerelease.join(`.`)&&n===!1)throw Error(`invalid increment argument: identifier already exists`);this.prerelease.push(e)}}if(t){let r=[t,e];if(n===!1&&(r=[t]),m(this.prerelease,t)){let e=this.prerelease[t.split(`.`).length];isNaN(e)&&(this.prerelease=r)}else this.prerelease=r}break}default:throw Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(`.`)}`),this}}})),l=/* @__PURE__ */ t(((e,t)=>{let n=c();t.exports=(e,t,r=!1)=>{if(e instanceof n)return e;try{return new n(e,t)}catch(e){if(!r)return null;throw e}}})),u=/* @__PURE__ */ t(((e,t)=>{let n=l();t.exports=(e,t)=>{let r=n(e,t);return r?r.version:null}})),d=/* @__PURE__ */ t(((e,t)=>{let n=l();t.exports=(e,t)=>{let r=n(e.trim().replace(/^[=v]+/,``),t);return r?r.version:null}})),f=/* @__PURE__ */ t(((e,t)=>{let n=c();t.exports=(e,t,r,i,a)=>{typeof r==`string`&&(a=i,i=r,r=void 0);try{return new n(e instanceof n?e.version:e,r).inc(t,i,a).version}catch{return null}}})),p=/* @__PURE__ */ t(((e,t)=>{let n=l();t.exports=(e,t)=>{let r=n(e,null,!0),i=n(t,null,!0),a=r.compare(i);if(a===0)return null;let o=a>0,s=o?r:i,c=o?i:r,l=!!s.prerelease.length;if(c.prerelease.length&&!l){if(!c.patch&&!c.minor)return`major`;if(c.compareMain(s)===0)return c.minor&&!c.patch?`minor`:`patch`}let u=l?`pre`:``;return r.major===i.major?r.minor===i.minor?r.patch===i.patch?`prerelease`:u+`patch`:u+`minor`:u+`major`}})),m=/* @__PURE__ */ t(((e,t)=>{let n=c();t.exports=(e,t)=>new n(e,t).major})),h=/* @__PURE__ */ t(((e,t)=>{let n=c();t.exports=(e,t)=>new n(e,t).minor})),g=/* @__PURE__ */ t(((e,t)=>{let n=c();t.exports=(e,t)=>new n(e,t).patch})),_=/* @__PURE__ */ t(((e,t)=>{let n=l();t.exports=(e,t)=>{let r=n(e,t);return r&&r.prerelease.length?r.prerelease:null}})),v=/* @__PURE__ */ t(((e,t)=>{let n=c();t.exports=(e,t,r)=>new n(e,r).compare(new n(t,r))})),y=/* @__PURE__ */ t(((e,t)=>{let n=v();t.exports=(e,t,r)=>n(t,e,r)})),ee=/* @__PURE__ */ t(((e,t)=>{let n=v();t.exports=(e,t)=>n(e,t,!0)})),b=/* @__PURE__ */ t(((e,t)=>{let n=c();t.exports=(e,t,r)=>{let i=new n(e,r),a=new n(t,r);return i.compare(a)||i.compareBuild(a)}})),te=/* @__PURE__ */ t(((e,t)=>{let n=b();t.exports=(e,t)=>e.sort((e,r)=>n(e,r,t))})),ne=/* @__PURE__ */ t(((e,t)=>{let n=b();t.exports=(e,t)=>e.sort((e,r)=>n(r,e,t))})),x=/* @__PURE__ */ t(((e,t)=>{let n=v();t.exports=(e,t,r)=>n(e,t,r)>0})),S=/* @__PURE__ */ t(((e,t)=>{let n=v();t.exports=(e,t,r)=>n(e,t,r)<0})),C=/* @__PURE__ */ t(((e,t)=>{let n=v();t.exports=(e,t,r)=>n(e,t,r)===0})),re=/* @__PURE__ */ t(((e,t)=>{let n=v();t.exports=(e,t,r)=>n(e,t,r)!==0})),w=/* @__PURE__ */ t(((e,t)=>{let n=v();t.exports=(e,t,r)=>n(e,t,r)>=0})),T=/* @__PURE__ */ t(((e,t)=>{let n=v();t.exports=(e,t,r)=>n(e,t,r)<=0})),ie=/* @__PURE__ */ t(((e,t)=>{let n=C(),r=re(),i=x(),a=w(),o=S(),s=T();t.exports=(e,t,c,l)=>{switch(t){case`===`:return typeof e==`object`&&(e=e.version),typeof c==`object`&&(c=c.version),e===c;case`!==`:return typeof e==`object`&&(e=e.version),typeof c==`object`&&(c=c.version),e!==c;case``:case`=`:case`==`:return n(e,c,l);case`!=`:return r(e,c,l);case`>`:return i(e,c,l);case`>=`:return a(e,c,l);case`<`:return o(e,c,l);case`<=`:return s(e,c,l);default:throw TypeError(`Invalid operator: ${t}`)}}})),ae=/* @__PURE__ */ t(((e,t)=>{let n=c(),r=l(),{safeRe:i,t:o}=a();t.exports=(e,t)=>{if(e instanceof n)return e;if(typeof e==`number`&&(e=String(e)),typeof e!=`string`)return null;t||={};let a=null;if(!t.rtl)a=e.match(t.includePrerelease?i[o.COERCEFULL]:i[o.COERCE]);else{let n=t.includePrerelease?i[o.COERCERTLFULL]:i[o.COERCERTL],r;for(;(r=n.exec(e))&&(!a||a.index+a[0].length!==e.length);)a&&r.index+r[0].length===a.index+a[0].length||(a=r),n.lastIndex=r.index+r[1].length+r[2].length;n.lastIndex=-1}if(a===null)return null;let s=a[2],c=a[3]||`0`,l=a[4]||`0`,u=t.includePrerelease&&a[5]?`-${a[5]}`:``,d=t.includePrerelease&&a[6]?`+${a[6]}`:``;return r(`${s}.${c}.${l}${u}${d}`,t)}})),oe=/* @__PURE__ */ t(((e,t)=>{let n=l(),i=r(),a=c(),o=(e,t,n)=>{if(!i.RELEASE_TYPES.includes(t))return null;let r=s(e,n);return r&&u(r,t)},s=(e,t)=>{let r=e instanceof a?e.version:e;return n(r,t)},u=(e,t)=>{if(d(t))return e.version;switch(e.prerelease=[],t){case`major`:e.minor=0,e.patch=0;break;case`minor`:e.patch=0}return e.format()},d=e=>e.startsWith(`pre`);t.exports=o})),se=/* @__PURE__ */ t(((e,t)=>{t.exports=class{constructor(){this.max=1e3,this.map=/* @__PURE__ */ new Map}get(e){let t=this.map.get(e);if(t!==void 0)return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&t!==void 0){if(this.map.size>=this.max){let e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}}})),E=/* @__PURE__ */ t(((e,t)=>{let n=/\s+/g;t.exports=class e{constructor(t,r){if(r=l(r),t instanceof e)return t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease?t:new e(t.raw,r);if(t instanceof u)return this.raw=t.value,this.set=[[t]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=t.trim().replace(n,` `),this.set=this.raw.split(`||`).map(e=>this.parseRange(e.trim())).filter(e=>e.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let e=this.set[0];if(this.set=this.set.filter(e=>!te(e[0])),this.set.length===0)this.set=[e];else if(this.set.length>1){for(let e of this.set)if(e.length===1&&ne(e[0])){this.set=[e];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 t=this.set[e];for(let e=0;e<t.length;e++)e>0&&(this.formatted+=` `),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){e=e.replace(b,``);let t=((this.options.includePrerelease&&y)|(this.options.loose&&ee))+`:`+e,n=s.get(t);if(n)return n;let r=this.options.loose,i=r?p[h.HYPHENRANGELOOSE]:p[h.HYPHENRANGE];e=e.replace(i,le(this.options.includePrerelease)),d(`hyphen replace`,e),e=e.replace(p[h.COMPARATORTRIM],g),d(`comparator trim`,e),e=e.replace(p[h.TILDETRIM],_),d(`tilde trim`,e),e=e.replace(p[h.CARETTRIM],v),d(`caret trim`,e);let a=e.split(` `).map(e=>S(e,this.options)).join(` `).split(/\s+/).map(e=>ce(e,this.options));r&&(a=a.filter(e=>(d(`loose invalid filter`,e,this.options),!!e.match(p[h.COMPARATORLOOSE])))),d(`range list`,a);let o=/* @__PURE__ */ new Map,c=a.map(e=>new u(e,this.options));for(let e of c){if(te(e))return[e];o.set(e.value,e)}o.size>1&&o.has(``)&&o.delete(``);let l=[...o.values()];return s.set(t,l),l}intersects(t,n){if(!(t instanceof e))throw TypeError(`a Range is required`);return this.set.some(e=>x(e,n)&&t.set.some(t=>x(t,n)&&e.every(e=>t.every(t=>e.intersects(t,n)))))}test(e){if(!e)return!1;if(typeof e==`string`)try{e=new f(e,this.options)}catch{return!1}for(let t=0;t<this.set.length;t++)if(ue(this.set[t],e,this.options))return!0;return!1}};let s=new(se()),l=o(),u=D(),d=i(),f=c(),{safeRe:p,src:m,t:h,comparatorTrimReplace:g,tildeTrimReplace:_,caretTrimReplace:v}=a(),{FLAG_INCLUDE_PRERELEASE:y,FLAG_LOOSE:ee}=r(),b=new RegExp(m[h.BUILD],`g`),te=e=>e.value===`<0.0.0-0`,ne=e=>e.value===``,x=(e,t)=>{let n=!0,r=e.slice(),i=r.pop();for(;n&&r.length;)n=r.every(e=>i.intersects(e,t)),i=r.pop();return n},S=(e,t)=>(e=e.replace(p[h.BUILD],``),d(`comp`,e,t),e=ie(e,t),d(`caret`,e),e=w(e,t),d(`tildes`,e),e=oe(e,t),d(`xrange`,e),e=O(e,t),d(`stars`,e),e),C=e=>!e||e.toLowerCase()===`x`||e===`*`,re=(e,t,n)=>C(e)&&!C(t)||C(t)&&n&&!C(n),w=(e,t)=>e.trim().split(/\s+/).map(e=>T(e,t)).join(` `),T=(e,t)=>{let n=t.loose?p[h.TILDELOOSE]:p[h.TILDE],r=t.includePrerelease?`-0`:``;return e.replace(n,(t,n,i,a,o)=>{d(`tilde`,e,t,n,i,a,o);let s;return C(n)?s=``:C(i)?s=`>=${n}.0.0${r} <${+n+1}.0.0-0`:C(a)?s=`>=${n}.${i}.0${r} <${n}.${+i+1}.0-0`:o?(d(`replaceTilde pr`,o),s=`>=${n}.${i}.${a}-${o} <${n}.${+i+1}.0-0`):s=`>=${n}.${i}.${a} <${n}.${+i+1}.0-0`,d(`tilde return`,s),s})},ie=(e,t)=>e.trim().split(/\s+/).map(e=>ae(e,t)).join(` `),ae=(e,t)=>{d(`caret`,e,t);let n=t.loose?p[h.CARETLOOSE]:p[h.CARET],r=t.includePrerelease?`-0`:``;return e.replace(n,(t,n,i,a,o)=>{d(`caret`,e,t,n,i,a,o);let s;return C(n)?s=``:C(i)?s=`>=${n}.0.0${r} <${+n+1}.0.0-0`:C(a)?s=n===`0`?`>=${n}.${i}.0${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.0${r} <${+n+1}.0.0-0`:o?(d(`replaceCaret pr`,o),s=n===`0`?i===`0`?`>=${n}.${i}.${a}-${o} <${n}.${i}.${+a+1}-0`:`>=${n}.${i}.${a}-${o} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${a}-${o} <${+n+1}.0.0-0`):(d(`no pr`),s=n===`0`?i===`0`?`>=${n}.${i}.${a} <${n}.${i}.${+a+1}-0`:`>=${n}.${i}.${a} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${a} <${+n+1}.0.0-0`),d(`caret return`,s),s})},oe=(e,t)=>(d(`replaceXRanges`,e,t),e.split(/\s+/).map(e=>E(e,t)).join(` `)),E=(e,t)=>{e=e.trim();let n=t.loose?p[h.XRANGELOOSE]:p[h.XRANGE];return e.replace(n,(n,r,i,a,o,s)=>{if(d(`xRange`,e,n,r,i,a,o,s),re(i,a,o))return e;let c=C(i),l=c||C(a),u=l||C(o),f=u;return r===`=`&&f&&(r=``),s=t.includePrerelease?`-0`:``,c?n=r===`>`||r===`<`?`<0.0.0-0`:`*`:r&&f?(l&&(a=0),o=0,r===`>`?(r=`>=`,l?(i=+i+1,a=0,o=0):(a=+a+1,o=0)):r===`<=`&&(r=`<`,l?i=+i+1:a=+a+1),r===`<`&&(s=`-0`),n=`${r+i}.${a}.${o}${s}`):l?n=`>=${i}.0.0${s} <${+i+1}.0.0-0`:u&&(n=`>=${i}.${a}.0${s} <${i}.${+a+1}.0-0`),d(`xRange return`,n),n})},O=(e,t)=>(d(`replaceStars`,e,t),e.trim().replace(p[h.STAR],``)),ce=(e,t)=>(d(`replaceGTE0`,e,t),e.trim().replace(p[t.includePrerelease?h.GTE0PRE:h.GTE0],``)),le=e=>(t,n,r,i,a,o,s,c,l,u,d,f)=>(n=C(r)?``:C(i)?`>=${r}.0.0${e?`-0`:``}`:C(a)?`>=${r}.${i}.0${e?`-0`:``}`:o?`>=${n}`:`>=${n}${e?`-0`:``}`,c=C(l)?``:C(u)?`<${+l+1}.0.0-0`:C(d)?`<${l}.${+u+1}.0-0`:f?`<=${l}.${u}.${d}-${f}`:e?`<${l}.${u}.${+d+1}-0`:`<=${c}`,`${n} ${c}`.trim()),ue=(e,t,n)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let n=0;n<e.length;n++)if(d(e[n].semver),e[n].semver!==u.ANY&&e[n].semver.prerelease.length>0){let r=e[n].semver;if(r.major===t.major&&r.minor===t.minor&&r.patch===t.patch)return!0}return!1}return!0}})),D=/* @__PURE__ */ t(((e,t)=>{let n=Symbol(`SemVer ANY`);t.exports=class e{static get ANY(){return n}constructor(t,i){if(i=r(i),t instanceof e){if(t.loose===!!i.loose)return t;t=t.value}t=t.trim().split(/\s+/).join(` `),d(`comparator`,t,i),this.options=i,this.loose=!!i.loose,this.parse(t),this.value=this.semver===n?``:this.operator+this.semver.version,d(`comp`,this)}parse(e){let t=this.options.loose?s[l.COMPARATORLOOSE]:s[l.COMPARATOR],r=e.match(t);if(!r)throw TypeError(`Invalid comparator: ${e}`);this.operator=r[1]===void 0?``:r[1],this.operator===`=`&&(this.operator=``),this.semver=r[2]?new f(r[2],this.options.loose):n}toString(){return this.value}test(e){if(d(`Comparator.test`,e,this.options.loose),this.semver===n||e===n)return!0;if(typeof e==`string`)try{e=new f(e,this.options)}catch{return!1}return u(e,this.operator,this.semver,this.options)}intersects(t,n){if(!(t instanceof e))throw TypeError(`a Comparator is required`);return this.operator===``?this.value===``||new p(t.value,n).test(this.value):t.operator===``?t.value===``||new p(this.value,n).test(t.semver):(n=r(n),n.includePrerelease&&(this.value===`<0.0.0-0`||t.value===`<0.0.0-0`)||!n.includePrerelease&&(this.value.startsWith(`<0.0.0`)||t.value.startsWith(`<0.0.0`))?!1:!!(this.operator.startsWith(`>`)&&t.operator.startsWith(`>`)||this.operator.startsWith(`<`)&&t.operator.startsWith(`<`)||this.semver.version===t.semver.version&&this.operator.includes(`=`)&&t.operator.includes(`=`)||u(this.semver,`<`,t.semver,n)&&this.operator.startsWith(`>`)&&t.operator.startsWith(`<`)||u(this.semver,`>`,t.semver,n)&&this.operator.startsWith(`<`)&&t.operator.startsWith(`>`)))}};let r=o(),{safeRe:s,t:l}=a(),u=ie(),d=i(),f=c(),p=E()})),O=/* @__PURE__ */ t(((e,t)=>{let n=E();t.exports=(e,t,r)=>{try{t=new n(t,r)}catch{return!1}return t.test(e)}})),ce=/* @__PURE__ */ t(((e,t)=>{let n=E();t.exports=(e,t)=>new n(e,t).set.map(e=>e.map(e=>e.value).join(` `).trim().split(` `))})),le=/* @__PURE__ */ t(((e,t)=>{let n=c(),r=E();t.exports=(e,t,i)=>{let a=null,o=null,s=null;try{s=new r(t,i)}catch{return null}return e.forEach(e=>{s.test(e)&&(a&&o.compare(e)!==-1||(a=e,o=new n(a,i)))}),a}})),ue=/* @__PURE__ */ t(((e,t)=>{let n=c(),r=E();t.exports=(e,t,i)=>{let a=null,o=null,s=null;try{s=new r(t,i)}catch{return null}return e.forEach(e=>{s.test(e)&&(a&&o.compare(e)!==1||(a=e,o=new n(a,i)))}),a}})),de=/* @__PURE__ */ t(((e,t)=>{let n=c(),r=E(),i=x();t.exports=(e,t)=>{e=new r(e,t);let a=new n(`0.0.0`);if(e.test(a)||(a=new n(`0.0.0-0`),e.test(a)))return a;a=null;for(let t=0;t<e.set.length;++t){let r=e.set[t],o=null;r.forEach(e=>{let t=new n(e.semver.version);switch(e.operator){case`>`:t.prerelease.length===0?t.patch++:t.prerelease.push(0),t.raw=t.format();case``:case`>=`:(!o||i(t,o))&&(o=t);break;case`<`:case`<=`:break;
|
|
3
3
|
/* istanbul ignore next */
|
|
4
4
|
default:throw Error(`Unexpected operation: ${e.operator}`)}}),o&&(!a||i(a,o))&&(a=o)}return a&&e.test(a)?a:null}})),fe=/* @__PURE__ */ t(((e,t)=>{let n=E();t.exports=(e,t)=>{try{return new n(e,t).range||`*`}catch{return null}}})),pe=/* @__PURE__ */ t(((e,t)=>{let n=c(),r=D(),{ANY:i}=r,a=E(),o=O(),s=x(),l=S(),u=T(),d=w();t.exports=(e,t,c,f)=>{e=new n(e,f),t=new a(t,f);let p,m,h,g,_;switch(c){case`>`:p=s,m=u,h=l,g=`>`,_=`>=`;break;case`<`:p=l,m=d,h=s,g=`<`,_=`<=`;break;default:throw TypeError(`Must provide a hilo val of "<" or ">"`)}if(o(e,t,f))return!1;for(let n=0;n<t.set.length;++n){let a=t.set[n],o=null,s=null;if(a.forEach(e=>{e.semver===i&&(e=new r(`>=0.0.0`)),o||=e,s||=e,p(e.semver,o.semver,f)?o=e:h(e.semver,s.semver,f)&&(s=e)}),o.operator===g||o.operator===_||(!s.operator||s.operator===g)&&m(e,s.semver)||s.operator===_&&h(e,s.semver))return!1}return!0}})),me=/* @__PURE__ */ t(((e,t)=>{let n=pe();t.exports=(e,t,r)=>n(e,t,`>`,r)})),he=/* @__PURE__ */ t(((e,t)=>{let n=pe();t.exports=(e,t,r)=>n(e,t,`<`,r)})),ge=/* @__PURE__ */ t(((e,t)=>{let n=E();t.exports=(e,t,r)=>(e=new n(e,r),t=new n(t,r),e.intersects(t,r))})),_e=/* @__PURE__ */ t(((e,t)=>{let n=O(),r=v();t.exports=(e,t,i)=>{let a=[],o=null,s=null,c=e.sort((e,t)=>r(e,t,i));for(let e of c)n(e,t,i)?(s=e,o||=e):(s&&a.push([o,s]),s=null,o=null);o&&a.push([o,null]);let l=[];for(let[e,t]of a)e===t?l.push(e):!t&&e===c[0]?l.push(`*`):t?e===c[0]?l.push(`<=${t}`):l.push(`${e} - ${t}`):l.push(`>=${e}`);let u=l.join(` || `),d=typeof t.raw==`string`?t.raw:String(t);return u.length<d.length?u:t}})),ve=/* @__PURE__ */ t(((e,t)=>{let n=E(),r=D(),{ANY:i}=r,a=O(),o=v(),s=(e,t,r={})=>{if(e===t)return!0;e=new n(e,r),t=new n(t,r);let i=!1;OUTER:for(let n of e.set){for(let e of t.set){let t=u(n,e,r);if(i||=t!==null,t)continue OUTER}if(i)return!1}return!0},c=[new r(`>=0.0.0-0`)],l=[new r(`>=0.0.0`)],u=(e,t,n)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===i){if(t.length===1&&t[0].semver===i)return!0;e=n.includePrerelease?c:l}if(t.length===1&&t[0].semver===i){if(n.includePrerelease)return!0;t=l}let r=/* @__PURE__ */ new Set,s,u;for(let t of e)t.operator===`>`||t.operator===`>=`?s=d(s,t,n):t.operator===`<`||t.operator===`<=`?u=f(u,t,n):r.add(t.semver);if(r.size>1)return null;let p;if(s&&u&&(p=o(s.semver,u.semver,n),p>0||p===0&&(s.operator!==`>=`||u.operator!==`<=`)))return null;for(let e of r){if(s&&!a(e,String(s),n)||u&&!a(e,String(u),n))return null;for(let r of t)if(!a(e,String(r),n))return!1;return!0}let m,h,g,_,v=u&&!n.includePrerelease&&u.semver.prerelease.length?u.semver:!1,y=s&&!n.includePrerelease&&s.semver.prerelease.length?s.semver:!1;v&&v.prerelease.length===1&&u.operator===`<`&&v.prerelease[0]===0&&(v=!1);for(let e of t){if(_=_||e.operator===`>`||e.operator===`>=`,g=g||e.operator===`<`||e.operator===`<=`,s){if(y&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===y.major&&e.semver.minor===y.minor&&e.semver.patch===y.patch&&(y=!1),e.operator===`>`||e.operator===`>=`){if(m=d(s,e,n),m===e&&m!==s)return!1}else if(s.operator===`>=`&&!e.test(s.semver))return!1}if(u){if(v&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===v.major&&e.semver.minor===v.minor&&e.semver.patch===v.patch&&(v=!1),e.operator===`<`||e.operator===`<=`){if(h=f(u,e,n),h===e&&h!==u)return!1}else if(u.operator===`<=`&&!e.test(u.semver))return!1}if(!e.operator&&(u||s)&&p!==0)return!1}return!(s&&g&&!u&&p!==0||u&&_&&!s&&p!==0||y||v)},d=(e,t,n)=>{if(!e)return t;let r=o(e.semver,t.semver,n);return r>0?e:r<0||t.operator===`>`&&e.operator===`>=`?t:e},f=(e,t,n)=>{if(!e)return t;let r=o(e.semver,t.semver,n);return r<0?e:r>0||t.operator===`<`&&e.operator===`<=`?t:e};t.exports=s})),ye=/* @__PURE__ */ e((/* @__PURE__ */ t(((e,t)=>{let n=a(),i=r(),o=c(),se=s();t.exports={parse:l(),valid:u(),clean:d(),inc:f(),diff:p(),major:m(),minor:h(),patch:g(),prerelease:_(),compare:v(),rcompare:y(),compareLoose:ee(),compareBuild:b(),sort:te(),rsort:ne(),gt:x(),lt:S(),eq:C(),neq:re(),gte:w(),lte:T(),cmp:ie(),coerce:ae(),truncate:oe(),Comparator:D(),Range:E(),satisfies:O(),toComparators:ce(),maxSatisfying:le(),minSatisfying:ue(),minVersion:de(),validRange:fe(),outside:pe(),gtr:me(),ltr:he(),intersects:ge(),simplifyRange:_e(),subset:ve(),SemVer:o,re:n.re,src:n.src,tokens:n.t,SEMVER_SPEC_VERSION:i.SEMVER_SPEC_VERSION,RELEASE_TYPES:i.RELEASE_TYPES,compareIdentifiers:se.compareIdentifiers,rcompareIdentifiers:se.rcompareIdentifiers}})))(),1);const be=e=>{let t=e.split(`
|
|
5
5
|
`).shift();if(typeof t!=`string`)return!1;let n=t.replace(/^chore(\([^)]+\))?:/,``).replace(/\[(skip|ci)(-|\s)(ci|skip)\]/i,``).replace(/\((skip|ci)(-|\s)(ci|skip)\)/i,``).trim();return ye.default.valid(n)!==null},k=e=>e.test.bind(e),xe=[k(/^((Merge pull request)|(Merge (.*?) into (.*?)|(Merge branch (.*?)))(?:\r?\n)*$)/m),k(/^(Merge tag (.*?))(?:\r?\n)*$/m),k(/^(R|r)evert (.*)/),k(/^(R|r)eapply (.*)/),k(/^(amend|fixup|squash)!/),be,k(/^(Merged (.*?)(in|into) (.*)|Merged PR (.*): (.*))/),k(/^Merge remote-tracking branch(\s*)(.*)/),k(/^Automatic merge(.*)/),k(/^Auto-merged (.*?) into (.*)/)];function Se(e=``,t={}){let n=t.ignores===void 0?[]:t.ignores;if(!Array.isArray(n))throw Error(`ignores must be of type array, received ${n} of type ${typeof n}`);let r=n.filter(e=>typeof e!=`function`);if(r.length>0)throw Error(`ignores must be array of type function, received items of type: ${r.map(e=>typeof e).join(`, `)}`);return[...t.defaults===!1?[]:xe,...n].some(t=>t(e))}const Ce=/(?!.*)/;function we(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function A(e){return e.map(e=>typeof e==`string`?we(e.trim()):e.source).filter(Boolean).join(`|`)}function Te(e,t){if(!e)return Ce;let n=A(e);return t?t(n):RegExp(`^(?:\\*\\s+)?(${n}):\\s*(.*)`,`i`)}function Ee(e,t){if(!e)return Ce;let n=t?`g`:`gi`;return RegExp(`(?:.*?)??\\s*([\\w-\\.\\/]*?)??(${A(e)})([\\w-]+)(?=\\s|$|[,;.)\\]])`,n)}function De(e){if(!e)return/()(.+)/gi;let t=A(e);return RegExp(`(${t})(?:\\s+(.*?))(?=(?:${t})|$)`,`gi`)}function Oe(e){let t=e?`|\\s+(?:${A(e)})`:``;return RegExp(`^(?:BREAKING CHANGE|[\\w-]+)(?::\\s+${t}).+`,`i`)}function ke(e={}){return{notes:Te(e.noteKeywords,e.notesPattern),referenceParts:Ee(e.issuePrefixes,e.issuePrefixesCaseSensitive),references:De(e.referenceActions),footerToken:Oe(e.issuePrefixes),mentions:/@([\w-]+)/g,url:/\b(?:https?):\/\/(?:www\.)?([-a-zA-Z0-9@:%_+.~#?&//=])+\b/}}function j(e){let t=e.match(/[^\r\n]/);if(typeof t?.index!=`number`)return``;let n=t.index,r=e.length-1;for(;e[r]===`\r`||e[r]===`
|
|
6
|
-
`;)r--;return e.substring(n,r+1)}function M(e,t){return e?`${e}\n${t||``}`:t||``}function Ae(e){return e?t=>!t.startsWith(e):()=>!0}function je(e,t){let n=e.indexOf(`${t} ------------------------ >8 ------------------------`);return n===-1?e:e.slice(0,n)}function Me(e){return!e.match(/^\s*gpg:/)}function Ne(e,t,n){let{groups:r}=t;for(let i=0,a=n.length,o;i<a;i++)o=n[i],e[o]=(r?r[o]:t[i+1])||null;return e}const Pe={noteKeywords:[`BREAKING CHANGE`,`BREAKING-CHANGE`],issuePrefixes:[`#`],referenceActions:[`close`,`closes`,`closed`,`fix`,`fixes`,`fixed`,`resolve`,`resolves`,`resolved`],headerPattern:/^(\w*)(?:\(([\w$@.\-*/ ]*)\))?: (.*)$/,headerCorrespondence:[`type`,`scope`,`subject`],revertPattern:/^Revert\s"([\s\S]*)"\s*This reverts commit (\w*)\.?/,revertCorrespondence:[`header`,`hash`],fieldPattern:/^-(?=.*\w)(.*?)-$/};function Fe(e={}){return{merge:null,revert:null,header:null,body:null,footer:null,notes:[],mentions:[],references:[],...e}}var Ie=class{options;regexes;lines=[];lineIndex=0;commit=Fe();constructor(e={}){this.options={...Pe,...e},this.regexes=ke(this.options)}currentLine(){return this.lines[this.lineIndex]}nextLine(){return this.lines[this.lineIndex++]}isLineAvailable(){return this.lineIndex<this.lines.length}parseReference(e,t){let{regexes:n}=this;if(n.url.test(e))return null;let r=n.referenceParts.exec(e);if(!r)return null;let[i,a=null,o,s]=r,c=null;if(a){let e=a.indexOf(`/`);e!==-1&&(c=a.slice(0,e),a=a.slice(e+1))}return{raw:i,action:t,owner:c,repository:a,prefix:o,issue:s}}parseReferences(e){let{regexes:t}=this,n=e.match(t.references)?t.references:/()(.+)/gi,r=[],i,a,o,s;for(;i=n.exec(e),i;)for(a=i[1]||null,o=i[2]||``;s=this.parseReference(o,a),s;)r.push(s);return r}skipEmptyLines(){let e=this.currentLine();for(;e!==void 0&&!e.trim();)this.nextLine(),e=this.currentLine()}parseMerge(){let{commit:e,options:t}=this,n=t.mergeCorrespondence||[],r=this.currentLine(),i=r&&t.mergePattern?r.match(t.mergePattern):null;return i?(this.nextLine(),e.merge=i[0]||null,Ne(e,i,n),!0):!1}parseHeader(e){e&&this.skipEmptyLines();let{commit:t,options:n}=this,r=n.headerCorrespondence||[],i=t.header??this.nextLine(),a=null;i&&(n.breakingHeaderPattern&&(a=i.match(n.breakingHeaderPattern)),!a&&n.headerPattern&&(a=i.match(n.headerPattern))),i&&(t.header=i),a&&Ne(t,a,r)}parseMeta(){let{options:e,commit:t}=this;if(!e.fieldPattern||!this.isLineAvailable())return!1;let n,r=null,i=!1;for(;this.isLineAvailable();)
|
|
6
|
+
`;)r--;return e.substring(n,r+1)}function M(e,t){return e?`${e}\n${t||``}`:t||``}function Ae(e){return e?t=>!t.startsWith(e):()=>!0}function je(e,t){let n=e.indexOf(`${t} ------------------------ >8 ------------------------`);return n===-1?e:e.slice(0,n)}function Me(e){return!e.match(/^\s*gpg:/)}function Ne(e,t,n){let{groups:r}=t;for(let i=0,a=n.length,o;i<a;i++)o=n[i],e[o]=(r?r[o]:t[i+1])||null;return e}const Pe={noteKeywords:[`BREAKING CHANGE`,`BREAKING-CHANGE`],issuePrefixes:[`#`],referenceActions:[`close`,`closes`,`closed`,`fix`,`fixes`,`fixed`,`resolve`,`resolves`,`resolved`],headerPattern:/^(\w*)(?:\(([\w$@.\-*/ ]*)\))?: (.*)$/,headerCorrespondence:[`type`,`scope`,`subject`],revertPattern:/^Revert\s"([\s\S]*)"\s*This reverts commit (\w*)\.?/,revertCorrespondence:[`header`,`hash`],fieldPattern:/^-(?=.*\w)(.*?)-$/};function Fe(e={}){return{merge:null,revert:null,header:null,body:null,footer:null,notes:[],mentions:[],references:[],...e}}var Ie=class{options;regexes;lines=[];lineIndex=0;commit=Fe();constructor(e={}){this.options={...Pe,...e},this.regexes=ke(this.options)}currentLine(){return this.lines[this.lineIndex]}nextLine(){return this.lines[this.lineIndex++]}isLineAvailable(){return this.lineIndex<this.lines.length}parseReference(e,t){let{regexes:n}=this;if(n.url.test(e))return null;let r=n.referenceParts.exec(e);if(!r)return null;let[i,a=null,o,s]=r,c=null;if(a){let e=a.indexOf(`/`);e!==-1&&(c=a.slice(0,e),a=a.slice(e+1))}return{raw:i,action:t,owner:c,repository:a,prefix:o,issue:s}}parseReferences(e){let{regexes:t}=this,n=e.match(t.references)?t.references:/()(.+)/gi,r=[],i,a,o,s;for(;i=n.exec(e),i;)for(a=i[1]||null,o=i[2]||``;s=this.parseReference(o,a),s;)r.push(s);return r}skipEmptyLines(){let e=this.currentLine();for(;e!==void 0&&!e.trim();)this.nextLine(),e=this.currentLine()}parseMerge(){let{commit:e,options:t}=this,n=t.mergeCorrespondence||[],r=this.currentLine(),i=r&&t.mergePattern?r.match(t.mergePattern):null;return i?(this.nextLine(),e.merge=i[0]||null,Ne(e,i,n),!0):!1}parseHeader(e){e&&this.skipEmptyLines();let{commit:t,options:n}=this,r=n.headerCorrespondence||[],i=t.header??this.nextLine(),a=null;i&&(n.breakingHeaderPattern&&(a=i.match(n.breakingHeaderPattern)),!a&&n.headerPattern&&(a=i.match(n.headerPattern))),i&&(t.header=i),a&&Ne(t,a,r)}parseMeta(){let{options:e,commit:t}=this;if(!e.fieldPattern||!this.isLineAvailable())return!1;let n,r=null,i=!1;for(;this.isLineAvailable();)if(n=this.currentLine().match(e.fieldPattern),n)r=n[1]||null,this.nextLine();else if(r)i=!0,t[r]=M(t[r],this.currentLine()),this.nextLine();else break;return i}parseNotes(){let{regexes:e,commit:t}=this;if(!this.isLineAvailable())return!1;let n=this.currentLine().match(e.notes),r;if(n){let i={title:n[1],text:n[2]};for(t.notes.push(i),t.footer=M(t.footer,this.currentLine()),this.nextLine();this.isLineAvailable();){if(this.parseMeta()||this.parseNotes())return!0;if(r=e.footerToken.test(this.currentLine()),t.references.push(...this.parseReferences(this.currentLine())),r||(i.text=M(i.text,this.currentLine())),t.footer=M(t.footer,this.currentLine()),this.nextLine(),r)break}return!0}return!1}parseBodyAndFooter(e){let{commit:t,regexes:n}=this;if(!this.isLineAvailable())return e;let r=!n.footerToken.test(this.currentLine())&&e;return t.references.push(...this.parseReferences(this.currentLine())),r?t.body=M(t.body,this.currentLine()):t.footer=M(t.footer,this.currentLine()),this.nextLine(),r}parseBreakingHeader(){let{commit:e,options:t}=this;if(!t.breakingHeaderPattern||e.notes.length||!e.header)return;let n=e.header.match(t.breakingHeaderPattern);n&&e.notes.push({title:`BREAKING CHANGE`,text:n[3]})}parseMentions(e){let{commit:t,regexes:n}=this,r;for(;r=n.mentions.exec(e),r;)t.mentions.push(r[1])}parseRevert(e){let{commit:t,options:n}=this,r=n.revertCorrespondence||[],i=n.revertPattern?e.match(n.revertPattern):null;i&&(t.revert=Ne({},i,r))}cleanupCommit(){let{commit:e}=this;e.body&&=j(e.body),e.footer&&=j(e.footer),e.notes.forEach(e=>{e.text=j(e.text)});let t=/* @__PURE__ */ new Set;e.references=e.references.filter(e=>{let n=`${e.action} ${e.raw}`.toLocaleLowerCase(),r=!t.has(n);return r&&t.add(n),r})}parse(e){if(!e.trim())throw TypeError(`Expected a raw commit`);let{commentChar:t}=this.options,n=Ae(t),r=j(e).split(/\r?\n/),i=t?je(r,t).filter(e=>n(e)&&Me(e)):r.filter(e=>Me(e)),a=Fe();this.lines=i,this.lineIndex=0,this.commit=a;let o=this.parseMerge();this.parseHeader(o),a.header&&(a.references=this.parseReferences(a.header));let s=!0;for(;this.isLineAvailable();)this.parseMeta(),this.parseNotes()&&(s=!1),this.parseBodyAndFooter(s)||(s=!1);return this.parseBreakingHeader(),this.parseMentions(e),this.parseRevert(e),this.cleanupCommit(),a}};function Le(){return{headerPattern:/^(\w*)(?:\((.*)\))?: (.*)$/,headerCorrespondence:[`type`,`scope`,`subject`],noteKeywords:[`BREAKING CHANGE`],revertPattern:/^(?:Revert|revert:)\s"?([\s\S]+?)"?\s*This reverts commit (\w{7,40})\b/i,revertCorrespondence:[`header`,`hash`]}}function Re(e){return typeof e==`number`||e?String(e):``}function N(e,t,n=F()){return e?e.reduce((e,r)=>{let i=Re(t(r)).trim();return`${e}${e&&i?n:``}${i}`},``):``}function ze(e,t){return`${`#`.repeat(e)} ${t}`}function P(e,t){return`[${e}](${t})`}function Be(e,t){return N(e,e=>{let n=Re(t(e)).trim(),r=n.split(/\r?\n/).map((e,t)=>t>0&&e?` ${e}`:e).join(`
|
|
7
7
|
`);return n?`* ${r}`:``})}function Ve(e){return`**${e}**`}function F(e=1){return`
|
|
8
8
|
`.repeat(e)}function He(...e){return N(e,e=>e,``)}function Ue(...e){return N(e,e=>e,F(2))}function We(...e){return N(e,e=>e,` `)}function I(...e){return e.reduce((e,t)=>{if(typeof t!=`number`&&!t)return e;let n=String(t).replace(/^\/+|\/+$/g,``);return e?`${e}/${n}`:n},``)}const Ge=[/\[(?:[^[\]]|\[[^[\]]*])*]\((?:[^()\n]|\([^()\n]*\))*\)/,/\[[^\]]*]\[[^\]]*]/,/^[ \t]*(?=(?<fence>`{3,}|~{3,}))\k<fence>[\s\S]*?^[ \t]*\k<fence>[ \t]*\r?$/,/(?=(?<code>`+))\k<code>[^\n]*?\k<code>/,/https?:\/\/(?:[^\s()]|\([^\s()]*\))+/],Ke=/\B@(?<user>[a-z0-9](?:-?[a-z0-9/]){0,38})/,qe=/[a-z0-9]+/;function Je(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Ye(e=[],t=qe){let n=e.map(e=>typeof e==`string`?Je(e):e.source).join(`|`),r=[...Ge.map(e=>e.source),n&&`(?<prefix>${n})(?<issue>${t.source})`,Ke.source];return new RegExp(r.filter(Boolean).join(`|`),`gm`)}function Xe(e){let t=Ye(e.issuePrefixes,e.issuePattern);return(n,r,i)=>n.replace(t,(t,...n)=>{let{prefix:a,issue:o,user:s}=n.at(-1);if(o){let n=e.formatIssueUrl(r,{prefix:a,issue:o});return n?(i?.push(t),P(t,n)):t}if(s){if(s.includes(`/`))return t;let n=e.formatUserUrl(r,s);return n?P(t,n):t}return t})}function Ze(e){return e.repository?I(e.host,e.owner,e.repository):e.repoUrl||``}function Qe(e,t){return e.repository?t.repository?I(e.host,t.owner,t.repository):I(e.host,e.owner,e.repository):e.repoUrl||``}function $e(e){let t=encodeURIComponent(e.previousTag||``),n=encodeURIComponent(e.currentTag||``);return I(Ze(e),e.compare||`compare`,`${t}...${n}`)}const et=[`BREAKING CHANGE`,`BREAKING-CHANGE`],tt=`BREAKING CHANGES`;function nt(e){let t=e.toUpperCase();return et.includes(t)?tt:t}function rt(e){return nt(e.title)===tt}function it(e){return He(e.owner&&`${e.owner}/`,e.repository,e.issue&&`${e.prefix||`#`}${e.issue}`)}function at(e){return{mainTemplate:`{{[${e} requires conventional-changelog-writer@9 or newer (conventional-changelog@8 or newer). Your changelog tooling loaded an older writer which cannot render this preset. Update the tooling or use an older major version of the preset.] true}}`}}function ot(e){let{isPatch:t,linkCompare:n,version:r,title:i,date:a}=e,o=n?P(r,$e(e)):r;return ze(!!t+1,We(o,i&&`"${i}"`,a&&`(${a})`))}function st(e){return He(e.preamble)}function ct(e,t){let{linkReferences:n,issue:r,commit:i}=e,{scope:a,subject:o,header:s,shortHash:c,hash:l,references:u}=t,d=l?n?`(${P(c,I(Ze(e),i,l))})`:c:``,f=N(u,t=>n?P(it(t),I(Qe(e,t),r,t.issue)):it(t),` `);return He(We(a&&Ve(`${a}:`),o||s||``,d),f&&`, closes ${f}`)}function lt({noteGroups:e}){return N(e,e=>Ue(ze(3,e.title),Be(e.notes,e=>We(e.commit.scope&&Ve(`${e.commit.scope}:`),e.text))),F(2))}function ut(e){let{headerPartial:t,preamblePartial:n,commitPartial:r,footerPartial:i,commitGroups:a}=e;return Ue(t(e),n(e),N(a,t=>Ue(t.title&&ze(3,t.title),Be(t.commits,t=>r(e,t))),F(2)),i(e))}const dt=Xe({issuePrefixes:[`#`],issuePattern:/[0-9]+/,formatIssueUrl:(e,t)=>{let n=Qe(e,t);return n?I(n,e.issue||`issues`,t.issue):``},formatUserUrl:(e,t)=>e.host?I(e.host,t):``});function ft(e,t){return(e.title||``).localeCompare(t.title||``)||(e.text||``).localeCompare(t.text||``)}function pt(){return{...at(`conventional-changelog-angular`),template:ut,headerPartial:ot,preamblePartial:st,commitPartial:ct,footerPartial:lt,transform:(e,t)=>{let n=!0,r=e.notes.map(e=>(n=!1,{...e,title:nt(e.title),text:dt(e.text,t)})),{type:i}=e;if(e.type===`feat`)i=`Features`;else if(e.type===`fix`)i=`Bug Fixes`;else if(e.type===`perf`)i=`Performance Improvements`;else if(e.type===`revert`||e.revert)i=`Reverts`;else if(n)return;else e.type===`docs`?i=`Documentation`:e.type===`style`?i=`Styles`:e.type===`refactor`?i=`Code Refactoring`:e.type===`test`?i=`Tests`:e.type===`build`?i=`Build System`:e.type===`ci`&&(i=`Continuous Integration`);let a=e.scope===`*`?``:e.scope,o=typeof e.hash==`string`?e.hash.substring(0,7):e.shortHash,s=[],{subject:c}=e;typeof c==`string`&&(c=dt(c,t,s));let l=e.references.filter(e=>!s.includes(e.prefix+e.issue));return{notes:r,type:i,scope:a,shortHash:o,subject:c,references:l}},groupBy:`type`,commitGroupsSort:`title`,commitsSort:[`scope`,`subject`],noteGroupsSort:`title`,notesSort:ft}}function mt(e){let t=2,n=0,r=0;return e.forEach(e=>{let i=e.notes.filter(rt);i.length>0?(n+=i.length,t=0):e.type===`feat`&&(r+=1,t===2&&(t=1))}),{level:t,reason:n===1?`There is ${n} BREAKING CHANGE and ${r} features`:`There are ${n} BREAKING CHANGES and ${r} features`}}function ht(e){return{commits:{ignore:e?.ignoreCommits,merges:!1},parser:Le(),writer:pt(),whatBump:mt}}const gt=(e,t)=>{if(e==null)throw TypeError(`Expected a raw commit`);let n=new Ie(t).parse(e);return n.scope=n.scope??null,n.subject=n.subject??null,n.type=n.type??null,n};async function _t(e,t=gt,n){let r=await ht(),i=r.parser||r.parserOpts,a=n?.parser||n||{},o=t(e,{...i,fieldPattern:null,...a});return o.raw=e,o}function L(e=[]){return e.filter(Boolean).join(` `)}const vt=(e,t=`always`)=>{let n=e.header,r=e.footer;if(!n&&!r)return[!0];let i=!!n&&/^(\w*)(?:\((.*)\))?!: (.*)$/.test(n),a=!!r&&/^BREAKING[ -]CHANGE:/m.test(r),o=t===`never`,s=i===a;return[o?!s:s,L([`breaking changes`,o?`must not`:`must`,`have both an exclamation mark in the header`,`and BREAKING CHANGE in the footer`,`to identify a breaking change`])]};function yt(e){return typeof e==`symbol`||e instanceof Symbol}function R(e){return e==null?``:bt(e)}function bt(e){if(typeof e==`string`)return e;if(Array.isArray(e))return e.map(bt).join(`,`);if(yt(e))return e.toString();let t=e+``;return t===`0`&&Object.is(Number(e),-0)?`-0`:t}function xt(e){return e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}const St=/* @__PURE__ */ new Map([[`Æ`,`Ae`],[`Ð`,`D`],[`Ø`,`O`],[`Þ`,`Th`],[`ß`,`ss`],[`æ`,`ae`],[`ð`,`d`],[`ø`,`o`],[`þ`,`th`],[`Đ`,`D`],[`đ`,`d`],[`Ħ`,`H`],[`ħ`,`h`],[`ı`,`i`],[`IJ`,`IJ`],[`ij`,`ij`],[`ĸ`,`k`],[`Ŀ`,`L`],[`ŀ`,`l`],[`Ł`,`L`],[`ł`,`l`],[`ʼn`,`'n`],[`Ŋ`,`N`],[`ŋ`,`n`],[`Œ`,`Oe`],[`œ`,`oe`],[`Ŧ`,`T`],[`ŧ`,`t`],[`ſ`,`s`]]);function Ct(e){e=e.normalize(`NFD`);let t=``;for(let n=0;n<e.length;n++){let r=e[n];r>=`̀`&&r<=`ͯ`||r>=`⃐`&&r<=``||r>=`︠`&&r<=`︯`||(t+=St.get(r)??r)}return t}function z(e){return Ct(R(e))}const B=`\\p{Lu}`,wt=`\\p{Ll}`,Tt=`(?:[\\p{Lm}\\p{Lo}]\\p{M}*)`,Et=`(?:['’](?:d|ll|m|re|s|t|ve))?`,Dt=`(?:['’](?:D|LL|M|RE|S|T|VE))?`,Ot=`[\\p{Z}\\p{P}\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\xd7\\xf7]`,kt=`(?:${B}|${Tt})`,At=`(?:${wt}|${Tt})`;let jt;function Mt(){return jt??=RegExp([`${B}?${wt}+${Et}(?=${Ot}|${B}|$)`,`${kt}+${Dt}(?=${Ot}|${B}${At}|$)`,`${B}?${At}+${Et}`,`${B}+${Dt}`,`\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])`,`\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])`,`\\d+`,`\\p{Emoji_Presentation}`,`\\p{Extended_Pictographic}`].join(`|`),`gu`),jt}function V(e,t,n){let r=R(e);return(n||t===void 0)&&(t=Mt()),typeof t==`number`&&(t=t.toString()),Array.from(r.match(t)??[]).filter(e=>e!==``)}function H(e){return typeof e!=`string`&&(e=R(e)),e.replace(/['\u2019]/g,``)}function Nt(e){let t=V(H(z(e)));if(t.length===0)return``;let[n,...r]=t;return`${n.toLowerCase()}${r.map(e=>xt(e)).join(``)}`}function Pt(e){return V(H(z(e))).map(e=>e.toLowerCase()).join(`-`)}function Ft(e){return V(H(z(e))).map(e=>e.toLowerCase()).join(`_`)}function It(e){let t=V(H(z(e)).trim()),n=``;for(let e=0;e<t.length;e++){let r=t[e];n&&(n+=` `),r===r.toUpperCase()?n+=r:n+=r[0].toUpperCase()+r.slice(1).toLowerCase()}return n}function Lt(e){return e.substring(0,1).toUpperCase()+e.substring(1)}function Rt(e){return Lt(R(e))}function zt(e,t){switch(t){case`camel-case`:return Nt(e);case`kebab-case`:return Pt(e);case`snake-case`:return Ft(e);case`pascal-case`:return Rt(Nt(e));case`start-case`:return It(e);case`upper-case`:case`uppercase`:return e.toUpperCase();case`sentence-case`:case`sentencecase`:return Rt(e);case`lower-case`:case`lowercase`:case`lowerCase`:return e.toLowerCase();default:throw TypeError(`to-case: Unknown target case "${t}"`)}}var U=Bt;function Bt(e=``,t=`lowercase`){let n=String(e).replace(/`.*?`|".*?"|'.*?'/g,``).trim(),r=zt(n,t);return r===``||r.match(/^\d/)?!0:r===n}var Vt=(e,t=[])=>e===void 0||!Array.isArray(t)?!1:t.indexOf(e)>-1,W=(e,t)=>typeof e==`string`&&e.length<=t;const Ht=/\bhttps?:\/\/\S+/;var Ut=(e,t)=>typeof e==`string`&&e.split(/\r?\n/).every(e=>Ht.test(e)||W(e,t)),G=(e,t)=>typeof e==`string`&&e.length>=t,K=e=>typeof e==`string`&&e.length>0;const q=e=>e===`never`,Wt=(e,t=`always`,n=[])=>{let{body:r}=e;if(!r)return[!0];let i=(Array.isArray(n)?n:[n]).map(e=>typeof e==`string`?{when:`always`,case:e}:e),a=i.filter(e=>{let t=U(r,e.case);return q(e.when)?!t:t}),o=a.length>0,s=(q(t)&&o?a:i).map(e=>e.case).join(`, `);return[q(t)?!o:o,L([`body must`,q(t)?`not`:null,`be ${s}`])]},Gt=(e,t=`always`)=>{let n=t===`never`,r=K(e.body||``);return[n?r:!r,L([`body`,n?`may not`:`must`,`be empty`])]},Kt=(e,t=`always`,n=`.`)=>{let r=e.body;if(!r)return[!0];let i=t===`never`,a=r[r.length-1]===n;return[i?!a:a,L([`body`,i?`may not`:`must`,`end with full stop`])]};function J(e){return typeof e==`string`?e.split(/(?:\r?\n)/):[]}const qt=(e,t)=>{if(!e.body)return[!0];let n=t===`never`,[r]=J(e.raw).slice(1),i=r===``;return[n?!i:i,L([`body`,n?`may not`:`must`,`have leading blank line`])]},Jt=(e,t=void 0,n=0)=>{let r=e.body;return r?[W(r,n),`body must not be longer than ${n} characters`]:[!0]},Yt=(e,t=void 0,n=0)=>{let r=e.body;return r?[Ut(r,n),`body's lines must not be longer than ${n} characters`]:[!0]},Xt=(e,t=void 0,n=0)=>e.body?[G(e.body,n),`body must not be shorter than ${n} characters`]:[!0],Zt=(e,t=`always`)=>{let n=t===`never`,r=K(e.footer||``);return[n?r:!r,L([`footer`,n?`may not`:`must`,`be empty`])]},Qt=(e,t=`always`)=>{if(!e.footer)return[!0];let n=t===`never`,r=J(e.raw),i=J(e.footer),a=r.indexOf(i[0]),[o]=r.slice(a-1),s=o===``;return[n?!s:s,L([`footer`,n?`may not`:`must`,`have leading blank line`])]},$t=(e,t=void 0,n=0)=>{let r=e.footer;return r?[W(r,n),`footer must not be longer than ${n} characters`]:[!0]},en=(e,t=void 0,n=0)=>{let r=e.footer;return r?[Ut(r,n),`footer's lines must not be longer than ${n} characters`]:[!0]},tn=(e,t=void 0,n=0)=>e.footer?[G(e.footer,n),`footer must not be shorter than ${n} characters`]:[!0],Y=e=>e===`never`,nn=(e,t=`always`,n=[])=>{let{header:r}=e;if(typeof r!=`string`||!r.match(/^[a-z]/i))return[!0];let i=(Array.isArray(n)?n:[n]).map(e=>typeof e==`string`?{when:`always`,case:e}:e),a=i.filter(e=>{let t=U(r,e.case);return Y(e.when)?!t:t}),o=a.length>0,s=(Y(t)&&o?a:i).map(e=>e.case).join(`, `);return[Y(t)?!o:o,L([`header must`,Y(t)?`not`:null,`be ${s}`])]},rn=(e,t=`always`,n=`.`)=>{let{header:r}=e,i=t===`never`,a=r?.[r.length-1]===n;return[i?!a:a,L([`header`,i?`may not`:`must`,`end with full stop`])]},an=(e,t=void 0,n=0)=>[W(e.header,n),`header must not be longer than ${n} characters, current length is ${e.header?.length}`],on=(e,t=void 0,n=0)=>[G(e.header,n),`header must not be shorter than ${n} characters, current length is ${e.header?.length}`],sn=e=>{let{header:t}=e;if(!t)return[!0];let n=t.length>t.trimStart().length,r=t.length>t.trimEnd().length;return n&&r?[!1,L([`header`,`must not be surrounded by whitespace`])]:n?[!1,L([`header`,`must not start with whitespace`])]:r?[!1,L([`header`,`must not end with whitespace`])]:[!0]},cn=(e,t=`never`)=>{let n=t===`always`,r=e.references.length>0;return[n?!r:r,L([`references`,n?`must`:`may not`,`be empty`])]},X=e=>e===`never`,ln=(e,t=`always`,n=[])=>{let{scope:r}=e;if(!r)return[!0];let i=!Array.isArray(n)&&typeof n!=`string`,a=(i?n.cases:Array.isArray(n)?n:[n]).map(e=>typeof e==`string`?{when:`always`,case:e}:e),o=(i&&n.delimiters?.length?n.delimiters:[`/`,`\\`,`,`]).map(e=>e===`,`?`, ?`:e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)),s=new RegExp(o.join(`|`)),c=r.split(s),l=a.filter(e=>{let t=c.every(t=>s.test(t)||U(t,e.case));return X(e.when)?!t:t}),u=l.length>0,d=(X(t)&&u?l:a).map(e=>e.case).join(`, `);return[X(t)?!u:u,L([`scope must`,X(t)?`not`:null,`be ${d}`])]},un=({scope:e},t=`always`,n=[])=>{if(!e)return[!0];let r=n.length?n:[`/`,`\\`,`,`],i=e.match(/[^A-Za-z0-9-_]+/g)??[],a=[...new Set(i.map(e=>e.trim()===`,`?`,`:e))].every(e=>Vt(e,r)),o=t===`never`;return[o?!a:a,L([`scope delimiters must ${o?`not `:``}be one of [${r.join(`, `)}]`])]},dn=(e,t=`never`)=>{let n=t===`always`,r=K(e.scope||``);return[n?!r:r,L([`scope`,n?`must`:`may not`,`be empty`])]},fn=({scope:e},t=`always`,n=[])=>{let r=Array.isArray(n)?n:n.scopes;if(!e||!r.length)return[!0,``];let i=(Array.isArray(n)||!n.delimiters?.length?[`/`,`\\`,`,`]:n.delimiters).map(e=>e===`,`?`, ?`:e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)),a=e.split(new RegExp(i.join(`|`))),o=[`scope must`,`be one of [${r.join(`, `)}]`],s=e=>Vt(e,r),c;return t===`never`?(c=!a.some(s)&&!s(e),o.splice(1,0,`not`)):c=a.every(s)||s(e),[c,L(o)]},pn=(e,t=void 0,n=0)=>{let r=e.scope;return r?[W(r,n),`scope must not be longer than ${n} characters`]:[!0]},mn=(e,t=void 0,n=0)=>{let r=e.scope;return r?[G(r,n),`scope must not be shorter than ${n} characters`]:[!0]},hn=/^\(cherry picked from commit [0-9a-f]{7,64}\)$/i,gn=(e,t=`always`,n=``)=>{let r=J(e.raw).filter(e=>!e.startsWith(`#`)&&!hn.test(e.trim())&&!!e),i=r[r.length-1],a=t===`never`,o=i?i.startsWith(n):!1;return[a?!o:o,L([`message`,a?`must not`:`must`,`be signed off`])]},_n=/^[\p{Ll}\p{Lu}\p{Lt}]/iu,Z=e=>e===`never`,vn=(e,t=`always`,n=[])=>{let{subject:r}=e;if(typeof r!=`string`||!r.match(_n))return[!0];let i=(Array.isArray(n)?n:[n]).map(e=>typeof e==`string`?{when:`always`,case:e}:e),a=i.filter(e=>{let t=U(r,e.case);return Z(e.when)?!t:t}),o=a.length>0,s=(Z(t)&&o?a:i).map(e=>e.case).join(`, `);return[Z(t)?!o:o,L([`subject must`,Z(t)?`not`:null,`be ${s}`])]},yn=(e,t=`always`)=>{let n=t===`never`,r=K(e.subject||``);return[n?r:!r,L([`subject`,n?`may not`:`must`,`be empty`])]},bn=(e,t=`always`,n=`.`)=>{let r=e.header?.indexOf(`:`)||0;if(r>0&&r===e.header.length-1)return[!0];let i=e.header,a=t===`never`,o=i?.[i.length-1]===n;return i?.slice(-3)===`...`&&(o=!1),[a?!o:o,L([`subject`,a?`may not`:`must`,`end with full stop`])]},xn=(e,t=void 0,n=0)=>{let r=e.subject;return r?[W(r,n),`subject must not be longer than ${n} characters`]:[!0]},Sn=(e,t=void 0,n=0)=>{let r=e.subject;return r?[G(r,n),`subject must not be shorter than ${n} characters`]:[!0]},Cn=(e,t=`always`)=>{let n=e.header;if(!n)return[!0,``];let r=t===`never`,i=/^(\w*)(?:\((.*)\))?!: (.*)$/.test(n);return[r?!i:i,L([`subject`,r?`must not`:`must`,`have an exclamation mark in the subject to identify a breaking change`])]},Q=e=>e===`never`;var wn={"body-case":Wt,"body-empty":Gt,"body-full-stop":Kt,"body-leading-blank":qt,"body-max-length":Jt,"body-max-line-length":Yt,"body-min-length":Xt,"breaking-change-exclamation-mark":vt,"footer-empty":Zt,"footer-leading-blank":Qt,"footer-max-length":$t,"footer-max-line-length":en,"footer-min-length":tn,"header-case":nn,"header-full-stop":rn,"header-max-length":an,"header-min-length":on,"header-trim":sn,"references-empty":cn,"scope-case":ln,"scope-delimiter-style":un,"scope-empty":dn,"scope-enum":fn,"scope-max-length":pn,"scope-min-length":mn,"signed-off-by":gn,"subject-case":vn,"subject-empty":yn,"subject-exclamation-mark":Cn,"subject-full-stop":bn,"subject-max-length":xn,"subject-min-length":Sn,"type-case":(e,t=`always`,n=[])=>{let{type:r}=e;if(!r)return[!0];let i=(Array.isArray(n)?n:[n]).map(e=>typeof e==`string`?{when:`always`,case:e}:e),a=i.filter(e=>{let t=U(r,e.case);return Q(e.when)?!t:t}),o=a.length>0,s=(Q(t)&&o?a:i).map(e=>e.case).join(`, `);return[Q(t)?!o:o,L([`type must`,Q(t)?`not`:null,`be ${s}`])]},"type-empty":(e,t=`always`)=>{let n=t===`never`,r=K(e.type||``);return[n?r:!r,L([`type`,n?`may not`:`must`,`be empty`])]},"type-enum":(e,t=`always`,n=[])=>{let{type:r}=e;if(!r)return[!0];let i=t===`never`,a=Vt(r,n);return[i?!a:a,L([`type must`,i?`not`:null,`be one of [${n.join(`, `)}]`])]},"type-max-length":(e,t=void 0,n=0)=>{let r=e.type;return r?[W(r,n),`type must not be longer than ${n} characters`]:[!0]},"type-min-length":(e,t=void 0,n=0)=>{let r=e.type;return r?[G(r,n),`type must not be shorter than ${n} characters`]:[!0]}},$;(function(e){e[e.Disabled=0]=`Disabled`,e[e.Warning=1]=`Warning`,e[e.Error=2]=`Error`})($||={});var Tn;(function(e){e[e.User=0]=`User`,e[e.Qualified=1]=`Qualified`})(Tn||={});const En=({header:e,body:t,footer:n})=>{let r=e;return r=t?`${r}\n\n${t}`:r,r=n?`${r}\n\n${n}`:r,r||``};async function Dn(e,t,r){let i=r||{defaultIgnores:void 0,ignores:void 0},a=t||{};if(Se(e?.trimEnd(),{defaults:i.defaultIgnores,ignores:i.ignores}))return{valid:!0,errors:[],warnings:[],input:e};let o=e===``?{header:null,body:null,footer:null}:await _t(e,i.parser,i.parserOpts);if(o.header===null&&o.body===null&&o.footer===null)return{valid:!0,errors:[],warnings:[],input:e};let s=new Map(Object.entries(wn));i.plugins&&Object.values(i.plugins).forEach(e=>{e.rules&&Object.keys(e.rules).forEach(t=>s.set(t,e.rules[t]))});let c=Object.keys(a).filter(e=>typeof s.get(e)!=`function`);if(c.length>0){let e=[...s.keys()];throw RangeError([`Found rules without implementation: ${c.join(`, `)}.`,`Supported rules are: ${e.join(`, `)}.`].join(`
|
|
9
9
|
`))}let l=Object.entries(a).map(([e,t])=>{if(!Array.isArray(t))return/* @__PURE__ */ Error(`config for rule ${e} must be array, received ${n.inspect(t)} of type ${typeof t}`);let[r]=t;if(r===$.Disabled&&t.length===1)return null;let[,i]=t;return typeof r!=`number`||isNaN(r)?/* @__PURE__ */ Error(`level for rule ${e} must be number, received ${n.inspect(r)} of type ${typeof r}`):t.length<2||t.length>3?/* @__PURE__ */ Error(`config for rule ${e} must be 2 or 3 items long, received ${n.inspect(t)} of length ${t.length}`):r<0||r>2?/* @__PURE__ */ RangeError(`level for rule ${e} must be between 0 and 2, received ${n.inspect(r)}`):typeof i==`string`?i!==`never`&&i!==`always`?/* @__PURE__ */ Error(`condition for rule ${e} must be "always" or "never", received ${n.inspect(i)}`):null:/* @__PURE__ */ Error(`condition for rule ${e} must be string, received ${n.inspect(i)} of type ${typeof i}`)}).filter(e=>e instanceof Error);if(l.length>0)throw Error(l.map(e=>e.message).join(`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createRequire as e}from"node:module";var t=Object.create,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.getPrototypeOf,o=Object.prototype.hasOwnProperty,s=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t,t.exports),e=null),t.exports),c=(e,t)=>{let r=Object.setPrototypeOf({},null);for(var i in e)n(r,i,{get:e[i],enumerable:!0});return t&1||n(r,Symbol.toStringTag,{value:`Module`}),t&2?r:Object.preventExtensions(r)},l=(e,t,a,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var c=i(t),l=0,u=c.length,d;l<u;l++)d=c[l],!o.call(e,d)&&d!==a&&n(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(s=r(t,d))||s.enumerable});return e},u=(e,r,i)=>(i=e==null?{}:t(a(e)),l(r||!e||!e.__esModule||!o.call(e,`default`)?n(i,`default`,{value:e,enumerable:!0}):i,e)),d=/* @__PURE__ */ e(import.meta.url);export{u as i,c as n,d as r,s as t};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nice-move/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.2",
|
|
4
4
|
"description": "Frontend develop helper for frontend development",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -41,13 +41,13 @@
|
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@commitlint/format": "^21.2.3",
|
|
44
|
-
"@commitlint/lint": "^21.2.
|
|
45
|
-
"execa": "^10.
|
|
46
|
-
"lint-staged": "^
|
|
44
|
+
"@commitlint/lint": "^21.2.4",
|
|
45
|
+
"execa": "^10.2.1",
|
|
46
|
+
"lint-staged": "^17.6.0",
|
|
47
47
|
"settingz": "^0.2.0"
|
|
48
48
|
},
|
|
49
49
|
"engines": {
|
|
50
|
-
"node": "^24.0.0"
|
|
50
|
+
"node": "^24.15.0 || ^26.0.0"
|
|
51
51
|
},
|
|
52
52
|
"publishConfig": {
|
|
53
53
|
"access": "public",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,t}from"./string-width-CZYiOUJm.mjs";function n(e){return Number.isInteger(e)?e>=4352&&(e<=4447||e===9001||e===9002||11904<=e&&e<=12871&&e!==12351||12880<=e&&e<=19903||19968<=e&&e<=42182||43360<=e&&e<=43388||44032<=e&&e<=55203||63744<=e&&e<=64255||65040<=e&&e<=65049||65072<=e&&e<=65131||65281<=e&&e<=65376||65504<=e&&e<=65510||110592<=e&&e<=110593||127488<=e&&e<=127569||131072<=e&&e<=262141):!1}const r=/^[\uD800-\uDBFF][\uDC00-\uDFFF]$/,i=[`\x1B`,``],a=e=>`${i[0]}[${e}m`,o=(t,n,r)=>{let i=[];t=[...t];for(let r of t){let o=r;r.includes(`;`)&&(r=r.split(`;`)[0][0]+`0`);let s=e.codes.get(Number.parseInt(r,10));if(s){let e=t.indexOf(s.toString());e===-1?i.push(a(n?s:o)):t.splice(e,1)}else if(n){i.push(a(0));break}else i.push(a(o))}if(n&&(i=i.filter((e,t)=>i.indexOf(e)===t),r!==void 0)){let t=a(e.codes.get(Number.parseInt(r,10)));i=i.reduce((e,n)=>n===t?[n,...e]:[...e,n],[])}return i.join(``)};function s(e,t,a){let s=[...e],c=[],l=typeof a==`number`?a:s.length,u=!1,d,f=0,p=``;for(let[m,h]of s.entries()){let s=!1;if(i.includes(h)){let t=/\d[^m]*/.exec(e.slice(m,m+18));d=t&&t.length>0?t[0]:void 0,f<l&&(u=!0,d!==void 0&&c.push(d))}else u&&h===`m`&&(u=!1,s=!0);if(!u&&!s&&f++,!r.test(h)&&n(h.codePointAt())&&(f++,typeof a!=`number`&&l++),f>t&&f<=l)p+=h;else if(f===t&&!u&&d!==void 0)p=o(c);else if(f>=l){p+=o(c,!0,d);break}}return p}function c(e,t,n){if(e.charAt(t)===` `)return t;let r=n?1:-1;for(let n=0;n<=3;n++){let i=t+n*r;if(e.charAt(i)===` `)return i}return t}function l(e,n,r={}){let{position:i=`end`,space:a=!1,preferTruncationOnSpace:o=!1}=r,{truncationCharacter:l=`…`}=r;if(typeof e!=`string`)throw TypeError(`Expected \`input\` to be a string, got ${typeof e}`);if(typeof n!=`number`)throw TypeError(`Expected \`columns\` to be a number, got ${typeof n}`);if(n<1)return``;if(n===1)return l;let u=t(e);if(u<=n)return e;if(i===`start`){if(o){let t=c(e,u-n+1,!0);return l+s(e,t,u).trim()}return a===!0&&(l+=` `),l+s(e,u-n+t(l),u)}if(i===`middle`){a===!0&&(l=` ${l} `);let r=Math.floor(n/2);if(o){let t=c(e,r),i=c(e,u-(n-r)+1,!0);return s(e,0,t)+l+s(e,i,u).trim()}return s(e,0,r)+l+s(e,u-(n-r)+t(l),u)}if(i===`end`)return o?s(e,0,c(e,n-1))+l:(a===!0&&(l=` ${l}`),s(e,0,n-t(l))+l);throw Error(`Expected \`options.position\` to be either \`start\`, \`middle\` or \`end\`, got ${i}`)}export{l as default};
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-CwYF3Rm8.mjs";import{n as t,t as n}from"./mjs-C5yiOROY.mjs";import{fileURLToPath as r}from"node:url";import{ChildProcess as i,execFile as a,spawn as o,spawnSync as s}from"node:child_process";import{StringDecoder as c}from"node:string_decoder";import{aborted as l,callbackify as u,debuglog as d,inspect as f,promisify as p,stripVTControlCharacters as m}from"node:util";import h,{execArgv as g,execPath as _,hrtime as v,platform as y}from"node:process";import b from"node:tty";import x from"node:path";import{scheduler as S,setImmediate as ee,setTimeout as C}from"node:timers/promises";import{constants as w}from"node:os";import{EventEmitter as te,addAbortListener as T,on as ne,once as E,setMaxListeners as re}from"node:events";import{serialize as ie}from"node:v8";import ae,{appendFileSync as oe,closeSync as se,createReadStream as ce,createWriteStream as le,openSync as ue,readFileSync as de,readSync as fe,statSync as pe,writeFileSync as me}from"node:fs";import{Buffer as he}from"node:buffer";import"node:fs/promises";import{finished as D}from"node:stream/promises";import{Duplex as ge,PassThrough as _e,Readable as O,Transform as ve,Writable as ye,getDefaultHighWaterMark as be}from"node:stream";import xe from"node:path/win32";function k(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}const Se=(e,t)=>{let n=Te(Ce(e));if(typeof n!=`string`)throw TypeError(`${t} must be a string or a file URL: ${n}.`);return n},Ce=e=>we(e)?e.toString():e,we=e=>typeof e!=`string`&&e&&Object.getPrototypeOf(e)===String.prototype,Te=e=>e instanceof URL?r(e):e,Ee=(e,t=[],n={})=>{let r=Se(e,`First argument`),[i,a]=k(t)?[[],t]:[t,n];if(!Array.isArray(i))throw TypeError(`Second argument must be either an array of arguments or an options object: ${i}`);if(i.some(e=>typeof e==`object`&&!!e))throw TypeError(`Second argument must be an array of strings: ${i}`);let o=i.map(String),s=o.find(e=>e.includes(`\0`));if(s!==void 0)throw TypeError(`Arguments cannot contain null bytes ("\\0"): ${s}`);if(!k(a))throw TypeError(`Last argument must be an options object: ${a}`);return[r,o,{__proto__:null,...a}]},{toString:De}=Object.prototype,Oe=e=>De.call(e)===`[object ArrayBuffer]`,A=e=>De.call(e)===`[object Uint8Array]`,j=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),ke=new TextEncoder,Ae=e=>ke.encode(e),je=new TextDecoder,Me=e=>je.decode(e),Ne=(e,t)=>Pe(e,t).join(``),Pe=(e,t)=>{if(t===`utf8`&&e.every(e=>typeof e==`string`))return e;let n=new c(t),r=e.map(e=>typeof e==`string`?Ae(e):e).map(e=>n.write(e)),i=n.end();return i===``?r:[...r,i]},Fe=e=>e.length===1&&A(e[0])?e[0]:Le(Ie(e)),Ie=e=>e.map(e=>typeof e==`string`?Ae(e):e),Le=e=>{let t=new Uint8Array(Re(e)),n=0;for(let r of e)t.set(r,n),n+=r.length;return t},Re=e=>{let t=0;for(let n of e)t+=n.length;return t},ze=e=>Array.isArray(e)&&Array.isArray(e.raw),Be=(e,t)=>{let n=[];for(let[r,i]of e.entries())n=Ve({templates:e,expressions:t,tokens:n,index:r,template:i});if(n.length===0)throw TypeError(`Template script must not be empty`);let[r,...i]=n;return[r,i,{}]},Ve=({templates:e,expressions:t,tokens:n,index:r,template:i})=>{if(i===void 0)throw TypeError(`Invalid backslash sequence: ${e.raw[r]}`);let{nextTokens:a,leadingWhitespaces:o,trailingWhitespaces:s}=He(i,e.raw[r]),c=Ge(n,a,o);if(r===t.length)return c;let l=t[r],u=Array.isArray(l)?l.map(e=>Ke(e)):[Ke(l)];return Ge(c,u,s)},He=(e,t)=>{if(t.length===0)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};let n=[],r=0,i=Ue.has(t[0]);for(let i=0,a=0;i<e.length;i+=1,a+=1){let o=t[a];if(Ue.has(o))r!==i&&n.push(e.slice(r,i)),r=i+1;else if(o===`\\`){let e=t[a+1];e===`
|
|
2
|
-
`?(--i,a+=1):e===`u`&&t[a+2]===`{`?a=t.indexOf(`}`,a+3):a+=We[e]??1}}let a=r===e.length;return a||n.push(e.slice(r)),{nextTokens:n,leadingWhitespaces:i,trailingWhitespaces:a}},Ue=/* @__PURE__ */ new Set([` `,` `,`\r`,`
|
|
3
|
-
`]),We={x:3,u:5},Ge=(e,t,n)=>n||e.length===0||t.length===0?[...e,...t]:[...e.slice(0,-1),`${e.at(-1)}${t[0]}`,...t.slice(1)],Ke=e=>{let t=typeof e;if(t===`string`)return e;if(t===`number`)return String(e);if(k(e)&&(`stdout`in e||`isMaxBuffer`in e))return qe(e);throw e instanceof i||Object.prototype.toString.call(e)===`[object Promise]`?TypeError("Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}."):TypeError(`Unexpected "${t}" in template expression`)},qe=({stdout:e})=>{if(typeof e==`string`)return e;if(A(e))return Me(e);throw TypeError(e===void 0?`Missing result.stdout in template expression. This is probably due to the previous subprocess' "stdout" option.`:`Unexpected "${typeof e}" stdout in template expression`)},M=e=>Je.includes(e),Je=[h.stdin,h.stdout,h.stderr],N=[`stdin`,`stdout`,`stderr`],Ye=e=>N[e]??`stdio[${e}]`,Xe=e=>{let t={...e};for(let n of ct)t[n]=Ze(e,n);return t},Ze=(e,t)=>{let n=Qe(e),r=Array.from({length:n+1}),i=$e(e[t],r,t,n);return ot(i,t)},Qe=({stdio:e})=>Array.isArray(e)?Math.max(e.length,N.length):N.length,$e=(e,t,n,r)=>k(e)?et(e,t,n,r):t.fill(e),et=(e,t,n,r)=>{for(let i of Object.keys(e).sort(tt))for(let a of rt(i,n,r))t[a]=e[i];return t},tt=(e,t)=>nt(e)<nt(t)?1:-1,nt=e=>e===`stdout`||e===`stderr`?0:e===`all`?2:1,rt=(e,t,n)=>{if(e===`ipc`)return[n];let r=it(e);if(r===void 0||r===0)throw TypeError(`"${t}.${e}" is invalid.
|
|
4
|
-
It must be "${t}.stdout", "${t}.stderr", "${t}.all", "${t}.ipc", or "${t}.fd3", "${t}.fd4" (and so on).`);if(r!==`all`&&r>=n)throw TypeError(`"${t}.${e}" is invalid: that file descriptor does not exist.
|
|
5
|
-
Please set the "stdio" option to ensure that file descriptor exists.`);return r===`all`?[1,2]:[r]},it=e=>{if(e===`all`)return e;if(N.includes(e))return N.indexOf(e);let t=at.exec(e);if(t!==null)return Number(t.groups.fdNumber)},at=/^fd(?<fdNumber>\d+)$/,ot=(e,t)=>e.map(e=>e===void 0?st[t]:e),st={lines:!1,buffer:!0,maxBuffer:1e8,verbose:d(`execa`).enabled?`full`:`none`,stripFinalNewline:!0},ct=[`lines`,`buffer`,`maxBuffer`,`verbose`,`stripFinalNewline`],P=(e,t)=>t===`ipc`?e.at(-1):e[t],lt=({verbose:e},t)=>ft(e,t)!==`none`,ut=({verbose:e},t)=>![`none`,`short`].includes(ft(e,t)),dt=({verbose:e},t)=>{let n=ft(e,t);return mt(n)?n:void 0},ft=(e,t)=>t===void 0?pt(e):P(e,t),pt=e=>e.find(e=>mt(e))??ht.findLast(t=>e.includes(t)),mt=e=>typeof e==`function`,ht=[`none`,`short`,`full`],gt=(e,t)=>{let n=[e,...t];return{command:n.join(` `),escapedCommand:n.map(e=>Ct(vt(e))).join(` `)}},_t=e=>m(e).split(`
|
|
6
|
-
`).map(e=>vt(e)).join(`
|
|
7
|
-
`),vt=e=>e.replaceAll(bt,e=>yt(e)),yt=e=>{let t=xt[e];if(t!==void 0)return t;let n=e.codePointAt(0),r=n.toString(16);return n<=St?`\\u${r.padStart(4,`0`)}`:`\\U${r}`},bt=(()=>{try{return/* @__PURE__ */ RegExp(`\\p{Separator}|\\p{Other}`,`gu`)}catch{return/[\s\u0000-\u001F\u007F-\u009F\u00AD]/g}})(),xt={" ":` `,"\b":`\\b`,"\f":`\\f`,"\n":`\\n`,"\r":`\\r`," ":`\\t`},St=65535,Ct=e=>wt.test(e)?e:y===`win32`?`"${e.replaceAll(`"`,`""`)}"`:`'${e.replaceAll(`'`,`'\\''`)}'`,wt=/^[\w\-./]+$/;function Tt(){let{env:e}=h,{TERM:t,TERM_PROGRAM:n}=e;return h.platform===`win32`?!!e.WT_SESSION||!!e.TERMINUS_SUBLIME||e.ConEmuTask===`{cmd::Cmder}`||n===`Terminus-Sublime`||n===`vscode`||t===`xterm-256color`||t===`alacritty`||t===`rxvt-unicode`||t===`rxvt-unicode-256color`||e.TERMINAL_EMULATOR===`JetBrains-JediTerm`:t!==`linux`}const Et={circleQuestionMark:`(?)`,questionMarkPrefix:`(?)`,square:`█`,squareDarkShade:`▓`,squareMediumShade:`▒`,squareLightShade:`░`,squareTop:`▀`,squareBottom:`▄`,squareLeft:`▌`,squareRight:`▐`,squareCenter:`■`,bullet:`●`,dot:`․`,ellipsis:`…`,pointerSmall:`›`,triangleUp:`▲`,triangleUpSmall:`▴`,triangleDown:`▼`,triangleDownSmall:`▾`,triangleLeftSmall:`◂`,triangleRightSmall:`▸`,home:`⌂`,heart:`♥`,musicNote:`♪`,musicNoteBeamed:`♫`,arrowUp:`↑`,arrowDown:`↓`,arrowLeft:`←`,arrowRight:`→`,arrowLeftRight:`↔`,arrowUpDown:`↕`,almostEqual:`≈`,notEqual:`≠`,lessOrEqual:`≤`,greaterOrEqual:`≥`,identical:`≡`,infinity:`∞`,subscriptZero:`₀`,subscriptOne:`₁`,subscriptTwo:`₂`,subscriptThree:`₃`,subscriptFour:`₄`,subscriptFive:`₅`,subscriptSix:`₆`,subscriptSeven:`₇`,subscriptEight:`₈`,subscriptNine:`₉`,oneHalf:`½`,oneThird:`⅓`,oneQuarter:`¼`,oneFifth:`⅕`,oneSixth:`⅙`,oneEighth:`⅛`,twoThirds:`⅔`,twoFifths:`⅖`,threeQuarters:`¾`,threeFifths:`⅗`,threeEighths:`⅜`,fourFifths:`⅘`,fiveSixths:`⅚`,fiveEighths:`⅝`,sevenEighths:`⅞`,line:`─`,lineBold:`━`,lineDouble:`═`,lineDashed0:`┄`,lineDashed1:`┅`,lineDashed2:`┈`,lineDashed3:`┉`,lineDashed4:`╌`,lineDashed5:`╍`,lineDashed6:`╴`,lineDashed7:`╶`,lineDashed8:`╸`,lineDashed9:`╺`,lineDashed10:`╼`,lineDashed11:`╾`,lineDashed12:`−`,lineDashed13:`–`,lineDashed14:`‐`,lineDashed15:`⁃`,lineVertical:`│`,lineVerticalBold:`┃`,lineVerticalDouble:`║`,lineVerticalDashed0:`┆`,lineVerticalDashed1:`┇`,lineVerticalDashed2:`┊`,lineVerticalDashed3:`┋`,lineVerticalDashed4:`╎`,lineVerticalDashed5:`╏`,lineVerticalDashed6:`╵`,lineVerticalDashed7:`╷`,lineVerticalDashed8:`╹`,lineVerticalDashed9:`╻`,lineVerticalDashed10:`╽`,lineVerticalDashed11:`╿`,lineDownLeft:`┐`,lineDownLeftArc:`╮`,lineDownBoldLeftBold:`┓`,lineDownBoldLeft:`┒`,lineDownLeftBold:`┑`,lineDownDoubleLeftDouble:`╗`,lineDownDoubleLeft:`╖`,lineDownLeftDouble:`╕`,lineDownRight:`┌`,lineDownRightArc:`╭`,lineDownBoldRightBold:`┏`,lineDownBoldRight:`┎`,lineDownRightBold:`┍`,lineDownDoubleRightDouble:`╔`,lineDownDoubleRight:`╓`,lineDownRightDouble:`╒`,lineUpLeft:`┘`,lineUpLeftArc:`╯`,lineUpBoldLeftBold:`┛`,lineUpBoldLeft:`┚`,lineUpLeftBold:`┙`,lineUpDoubleLeftDouble:`╝`,lineUpDoubleLeft:`╜`,lineUpLeftDouble:`╛`,lineUpRight:`└`,lineUpRightArc:`╰`,lineUpBoldRightBold:`┗`,lineUpBoldRight:`┖`,lineUpRightBold:`┕`,lineUpDoubleRightDouble:`╚`,lineUpDoubleRight:`╙`,lineUpRightDouble:`╘`,lineUpDownLeft:`┤`,lineUpBoldDownBoldLeftBold:`┫`,lineUpBoldDownBoldLeft:`┨`,lineUpDownLeftBold:`┥`,lineUpBoldDownLeftBold:`┩`,lineUpDownBoldLeftBold:`┪`,lineUpDownBoldLeft:`┧`,lineUpBoldDownLeft:`┦`,lineUpDoubleDownDoubleLeftDouble:`╣`,lineUpDoubleDownDoubleLeft:`╢`,lineUpDownLeftDouble:`╡`,lineUpDownRight:`├`,lineUpBoldDownBoldRightBold:`┣`,lineUpBoldDownBoldRight:`┠`,lineUpDownRightBold:`┝`,lineUpBoldDownRightBold:`┡`,lineUpDownBoldRightBold:`┢`,lineUpDownBoldRight:`┟`,lineUpBoldDownRight:`┞`,lineUpDoubleDownDoubleRightDouble:`╠`,lineUpDoubleDownDoubleRight:`╟`,lineUpDownRightDouble:`╞`,lineDownLeftRight:`┬`,lineDownBoldLeftBoldRightBold:`┳`,lineDownLeftBoldRightBold:`┯`,lineDownBoldLeftRight:`┰`,lineDownBoldLeftBoldRight:`┱`,lineDownBoldLeftRightBold:`┲`,lineDownLeftRightBold:`┮`,lineDownLeftBoldRight:`┭`,lineDownDoubleLeftDoubleRightDouble:`╦`,lineDownDoubleLeftRight:`╥`,lineDownLeftDoubleRightDouble:`╤`,lineUpLeftRight:`┴`,lineUpBoldLeftBoldRightBold:`┻`,lineUpLeftBoldRightBold:`┷`,lineUpBoldLeftRight:`┸`,lineUpBoldLeftBoldRight:`┹`,lineUpBoldLeftRightBold:`┺`,lineUpLeftRightBold:`┶`,lineUpLeftBoldRight:`┵`,lineUpDoubleLeftDoubleRightDouble:`╩`,lineUpDoubleLeftRight:`╨`,lineUpLeftDoubleRightDouble:`╧`,lineUpDownLeftRight:`┼`,lineUpBoldDownBoldLeftBoldRightBold:`╋`,lineUpDownBoldLeftBoldRightBold:`╈`,lineUpBoldDownLeftBoldRightBold:`╇`,lineUpBoldDownBoldLeftRightBold:`╊`,lineUpBoldDownBoldLeftBoldRight:`╉`,lineUpBoldDownLeftRight:`╀`,lineUpDownBoldLeftRight:`╁`,lineUpDownLeftBoldRight:`┽`,lineUpDownLeftRightBold:`┾`,lineUpBoldDownBoldLeftRight:`╂`,lineUpDownLeftBoldRightBold:`┿`,lineUpBoldDownLeftBoldRight:`╃`,lineUpBoldDownLeftRightBold:`╄`,lineUpDownBoldLeftBoldRight:`╅`,lineUpDownBoldLeftRightBold:`╆`,lineUpDoubleDownDoubleLeftDoubleRightDouble:`╬`,lineUpDoubleDownDoubleLeftRight:`╫`,lineUpDownLeftDoubleRightDouble:`╪`,lineCross:`╳`,lineBackslash:`╲`,lineSlash:`╱`},Dt={tick:`✔`,info:`ℹ`,warning:`⚠`,cross:`✘`,squareSmall:`◻`,squareSmallFilled:`◼`,circle:`◯`,circleFilled:`◉`,circleDotted:`◌`,circleDouble:`◎`,circleCircle:`ⓞ`,circleCross:`ⓧ`,circlePipe:`Ⓘ`,radioOn:`◉`,radioOff:`◯`,checkboxOn:`☒`,checkboxOff:`☐`,checkboxCircleOn:`ⓧ`,checkboxCircleOff:`Ⓘ`,pointer:`❯`,triangleUpOutline:`△`,triangleLeft:`◀`,triangleRight:`▶`,lozenge:`◆`,lozengeOutline:`◇`,hamburger:`☰`,smiley:`㋡`,mustache:`෴`,star:`★`,play:`▶`,nodejs:`⬢`,oneSeventh:`⅐`,oneNinth:`⅑`,oneTenth:`⅒`},Ot={tick:`√`,info:`i`,warning:`‼`,cross:`×`,squareSmall:`□`,squareSmallFilled:`■`,circle:`( )`,circleFilled:`(*)`,circleDotted:`( )`,circleDouble:`( )`,circleCircle:`(○)`,circleCross:`(×)`,circlePipe:`(│)`,radioOn:`(*)`,radioOff:`( )`,checkboxOn:`[×]`,checkboxOff:`[ ]`,checkboxCircleOn:`(×)`,checkboxCircleOff:`( )`,pointer:`>`,triangleUpOutline:`∆`,triangleLeft:`◄`,triangleRight:`►`,lozenge:`♦`,lozengeOutline:`◊`,hamburger:`≡`,smiley:`☺`,mustache:`┌─┐`,star:`✶`,play:`►`,nodejs:`♦`,oneSeventh:`1/7`,oneNinth:`1/9`,oneTenth:`1/10`},kt={...Et,...Dt},At={...Et,...Ot},jt=Tt()?kt:At;Object.entries(Dt);const Mt=b?.WriteStream?.prototype?.hasColors?.()??!1,F=(e,t)=>{if(!Mt)return e=>e;let n=`\u001B[${e}m`,r=`\u001B[${t}m`;return e=>{let i=e+``,a=i.indexOf(r);if(a===-1)return n+i+r;let o=n,s=0,c=(t===22?r:``)+n;for(;a!==-1;)o+=i.slice(s,a)+c,s=a+r.length,a=i.indexOf(r,s);return o+=i.slice(s)+r,o}};F(0,0);const Nt=F(1,22);F(2,22),F(3,23),F(4,24),F(`4:2`,24),F(`4:3`,24),F(`4:4`,24),F(`4:5`,24),F(53,55),F(7,27),F(8,28),F(9,29),F(30,39),F(31,39),F(32,39),F(33,39),F(34,39),F(35,39),F(36,39),F(37,39);const Pt=F(90,39);F(40,49),F(41,49),F(42,49),F(43,49),F(44,49),F(45,49),F(46,49),F(47,49),F(100,49);const Ft=F(91,39);F(92,39);const It=F(93,39);F(94,39),F(95,39),F(96,39),F(97,39),F(101,49),F(102,49),F(103,49),F(104,49),F(105,49),F(106,49),F(107,49),F(`58;5;0`,59),F(`58;5;1`,59),F(`58;5;2`,59),F(`58;5;3`,59),F(`58;5;4`,59),F(`58;5;5`,59),F(`58;5;6`,59),F(`58;5;7`,59),F(`58;5;8`,59),F(`58;5;9`,59),F(`58;5;10`,59),F(`58;5;11`,59),F(`58;5;12`,59),F(`58;5;13`,59),F(`58;5;14`,59),F(`58;5;15`,59);const Lt=({type:e,message:t,timestamp:n,piped:r,commandId:i,result:{failed:a=!1}={},options:{reject:o=!0}})=>{let s=Rt(n),c=Vt[e]({failed:a,reject:o,piped:r}),l=Ut[e]({reject:o});return`${Pt(`[${s}]`)} ${Pt(`[${i}]`)} ${l(c)} ${l(t)}`},Rt=e=>`${zt(e.getHours(),2)}:${zt(e.getMinutes(),2)}:${zt(e.getSeconds(),2)}.${zt(e.getMilliseconds(),3)}`,zt=(e,t)=>String(e).padStart(t,`0`),Bt=({failed:e,reject:t})=>e?t?jt.cross:jt.warning:jt.tick,Vt={command:({piped:e})=>e?`|`:`$`,output:()=>` `,ipc:()=>`*`,error:Bt,duration:Bt},Ht=e=>e,Ut={command:()=>Nt,output:()=>Ht,ipc:()=>Ht,error:({reject:e})=>e?Ft:It,duration:()=>Pt},Wt=(e,t,n)=>{let r=dt(t,n);return e.map(({verboseLine:e,verboseObject:t})=>Gt(e,t,r)).filter(e=>e!==void 0).map(e=>Kt(e)).join(``)},Gt=(e,t,n)=>{if(n===void 0)return e;let r=n(e,t);if(typeof r==`string`)return r},Kt=e=>e.endsWith(`
|
|
8
|
-
`)?e:`${e}\n`,I=({type:e,verboseMessage:t,fdNumber:n,verboseInfo:r,result:i})=>{let a=qt({type:e,result:i,verboseInfo:r}),o=Jt(t,a),s=Wt(o,r,n);s!==``&&console.warn(s.slice(0,-1))},qt=({type:e,result:t,verboseInfo:n})=>{let{escapedCommand:r,commandId:i,rawOptions:a}=n,{piped:o=!1,...s}=a;return{type:e,escapedCommand:r,commandId:`${i}`,timestamp:/* @__PURE__ */ new Date,piped:o,result:t,options:s}},Jt=(e,t)=>e.split(`
|
|
9
|
-
`).map(e=>Yt({...t,message:e})),Yt=e=>({verboseLine:Lt(e),verboseObject:e}),Xt=e=>{let t=typeof e==`string`?e:f(e);return _t(t).replaceAll(` `,()=>` `.repeat(Zt))},Zt=2,Qt=(e,t)=>{lt(t)&&I({type:`command`,verboseMessage:e,verboseInfo:t})},$t=(e,t,n)=>(nn(e),{verbose:e,escapedCommand:t,commandId:en(e),rawOptions:n}),en=e=>lt({verbose:e})?tn++:void 0;let tn=0n;const nn=e=>{for(let t of e){if(t===!1)throw TypeError(`The "verbose: false" option was renamed to "verbose: 'none'".`);if(t===!0)throw TypeError(`The "verbose: true" option was renamed to "verbose: 'short'".`);if(!ht.includes(t)&&!mt(t)){let e=ht.map(e=>`'${e}'`).join(`, `);throw TypeError(`The "verbose" option must not be ${t}. Allowed values are: ${e} or a function.`)}}},rn=()=>v.bigint(),an=e=>Number(v.bigint()-e)/1e6,on=(e,t,n)=>{let r=rn(),{command:i,escapedCommand:a}=gt(e,t),o=Ze(n,`verbose`),s=$t(o,a,{...n});return Qt(a,s),{command:i,escapedCommand:a,startTime:r,verboseInfo:s}};p(a);function sn(e){return e instanceof URL?r(e):e}function cn(e){return{*[Symbol.iterator](){let t=x.resolve(sn(e)),n;for(;n!==t;)yield t,n=t,t=x.resolve(t,`..`)}}}const ln=({cwd:e=h.cwd(),path:n=h.env[t()],preferLocal:r=!0,execPath:i=h.execPath,addExecPath:a=!0}={})=>{let o=x.resolve(sn(e)),s=[],c=n.split(x.delimiter);return r&&un(s,c,o),a&&dn(s,c,i,o),n===``||n===x.delimiter?`${s.join(x.delimiter)}${n}`:[...s,n].join(x.delimiter)},un=(e,t,n)=>{for(let r of cn(n)){let n=x.join(r,`node_modules/.bin`);t.includes(n)||e.push(n)}},dn=(e,t,n,r)=>{let i=x.resolve(r,sn(n),`..`);t.includes(i)||e.push(i)},fn=({env:e=h.env,...n}={})=>{e={...e};let r=t({env:e});return n.path=e[r],e[r]=ln(n),e},pn=(e,t,n)=>new(n?yn:vn)(t,e instanceof L?{}:{cause:e});var L=class extends Error{};const mn=(e,t)=>{Object.defineProperties(e.prototype,{name:{value:t,writable:!0,enumerable:!1,configurable:!0},[gn]:{value:!0,writable:!1,enumerable:!1,configurable:!1}})},hn=e=>_n(e)&&gn in e,gn=Symbol(`isExecaError`),_n=e=>Object.prototype.toString.call(e)===`[object Error]`;var vn=class extends Error{};mn(vn,vn.name);var yn=class extends Error{};mn(yn,yn.name);const bn=()=>{let e=64-Sn+1;return Array.from({length:e},xn)},xn=(e,t)=>({name:`SIGRT${t+1}`,number:Sn+t,action:`terminate`,description:`Application-specific signal (realtime)`,standard:`posix`}),Sn=34,Cn=[{name:`SIGHUP`,number:1,action:`terminate`,description:`Terminal closed`,standard:`posix`},{name:`SIGINT`,number:2,action:`terminate`,description:`User interruption with CTRL-C`,standard:`ansi`},{name:`SIGQUIT`,number:3,action:`core`,description:`User interruption with CTRL-\\`,standard:`posix`},{name:`SIGILL`,number:4,action:`core`,description:`Invalid machine instruction`,standard:`ansi`},{name:`SIGTRAP`,number:5,action:`core`,description:`Debugger breakpoint`,standard:`posix`},{name:`SIGABRT`,number:6,action:`core`,description:`Aborted`,standard:`ansi`},{name:`SIGIOT`,number:6,action:`core`,description:`Aborted`,standard:`bsd`},{name:`SIGBUS`,number:7,action:`core`,description:`Bus error due to misaligned, non-existing address or paging error`,standard:`bsd`},{name:`SIGEMT`,number:7,action:`terminate`,description:`Command should be emulated but is not implemented`,standard:`other`},{name:`SIGFPE`,number:8,action:`core`,description:`Floating point arithmetic error`,standard:`ansi`},{name:`SIGKILL`,number:9,action:`terminate`,description:`Forced termination`,standard:`posix`,forced:!0},{name:`SIGUSR1`,number:10,action:`terminate`,description:`Application-specific signal`,standard:`posix`},{name:`SIGSEGV`,number:11,action:`core`,description:`Segmentation fault`,standard:`ansi`},{name:`SIGUSR2`,number:12,action:`terminate`,description:`Application-specific signal`,standard:`posix`},{name:`SIGPIPE`,number:13,action:`terminate`,description:`Broken pipe or socket`,standard:`posix`},{name:`SIGALRM`,number:14,action:`terminate`,description:`Timeout or timer`,standard:`posix`},{name:`SIGTERM`,number:15,action:`terminate`,description:`Termination`,standard:`ansi`},{name:`SIGSTKFLT`,number:16,action:`terminate`,description:`Stack is empty or overflowed`,standard:`other`},{name:`SIGCHLD`,number:17,action:`ignore`,description:`Child process terminated, paused or unpaused`,standard:`posix`},{name:`SIGCLD`,number:17,action:`ignore`,description:`Child process terminated, paused or unpaused`,standard:`other`},{name:`SIGCONT`,number:18,action:`unpause`,description:`Unpaused`,standard:`posix`,forced:!0},{name:`SIGSTOP`,number:19,action:`pause`,description:`Paused`,standard:`posix`,forced:!0},{name:`SIGTSTP`,number:20,action:`pause`,description:`Paused using CTRL-Z or "suspend"`,standard:`posix`},{name:`SIGTTIN`,number:21,action:`pause`,description:`Background process cannot read terminal input`,standard:`posix`},{name:`SIGBREAK`,number:21,action:`terminate`,description:`User interruption with CTRL-BREAK`,standard:`other`},{name:`SIGTTOU`,number:22,action:`pause`,description:`Background process cannot write to terminal output`,standard:`posix`},{name:`SIGURG`,number:23,action:`ignore`,description:`Socket received out-of-band data`,standard:`bsd`},{name:`SIGXCPU`,number:24,action:`core`,description:`Process timed out`,standard:`bsd`},{name:`SIGXFSZ`,number:25,action:`core`,description:`File too big`,standard:`bsd`},{name:`SIGVTALRM`,number:26,action:`terminate`,description:`Timeout or timer`,standard:`bsd`},{name:`SIGPROF`,number:27,action:`terminate`,description:`Timeout or timer`,standard:`bsd`},{name:`SIGWINCH`,number:28,action:`ignore`,description:`Terminal window size changed`,standard:`bsd`},{name:`SIGIO`,number:29,action:`terminate`,description:`I/O is available`,standard:`other`},{name:`SIGPOLL`,number:29,action:`terminate`,description:`Watched event`,standard:`other`},{name:`SIGINFO`,number:29,action:`ignore`,description:`Request for process information`,standard:`other`},{name:`SIGPWR`,number:30,action:`terminate`,description:`Device running out of power`,standard:`systemv`},{name:`SIGSYS`,number:31,action:`core`,description:`Invalid system call`,standard:`other`},{name:`SIGUNUSED`,number:31,action:`terminate`,description:`Invalid system call`,standard:`other`}],wn=()=>{let e=bn();return[...Cn,...e].map(Tn)},Tn=({name:e,number:t,description:n,action:r,forced:i=!1,standard:a})=>{let{signals:{[e]:o}}=w,s=o!==void 0;return{name:e,number:s?o:t,description:n,supported:s,action:r,forced:i,standard:a}},En=()=>{let e=wn();return Object.fromEntries(e.map(Dn))},Dn=({name:e,number:t,description:n,supported:r,action:i,forced:a,standard:o})=>[e,{name:e,number:t,description:n,supported:r,action:i,forced:a,standard:o}],On=En(),kn=()=>{let e=wn(),t=Array.from({length:65},(t,n)=>An(n,e));return Object.assign({},...t)},An=(e,t)=>{let n=jn(e,t);if(n===void 0)return{};let{name:r,description:i,supported:a,action:o,forced:s,standard:c}=n;return{[e]:{name:r,number:e,description:i,supported:a,action:o,forced:s,standard:c}}},jn=(e,t)=>{let n=t.find(({name:t})=>w.signals[t]===e);return n===void 0?t.find(t=>t.number===e):n};kn();const Mn=e=>{let t="option `killSignal`";if(e===0)throw TypeError(`Invalid ${t}: 0 cannot be used.`);return Pn(e,t)},Nn=e=>e===0?e:Pn(e,"`subprocess.kill()`'s argument"),Pn=(e,t)=>{if(Number.isInteger(e))return Fn(e,t);if(typeof e==`string`)return Ln(e,t);throw TypeError(`Invalid ${t} ${String(e)}: it must be a string or an integer.\n${Rn()}`)},Fn=(e,t)=>{if(In.has(e))return In.get(e);throw TypeError(`Invalid ${t} ${e}: this signal integer does not exist.\n${Rn()}`)},In=new Map(Object.entries(w.signals).reverse().map(([e,t])=>[t,e])),Ln=(e,t)=>{if(e in w.signals)return e;throw e.toUpperCase()in w.signals?TypeError(`Invalid ${t} '${e}': please rename it to '${e.toUpperCase()}'.`):TypeError(`Invalid ${t} '${e}': this signal name does not exist.\n${Rn()}`)},Rn=()=>`Available signal names: ${zn()}.
|
|
10
|
-
Available signal numbers: ${Bn()}.`,zn=()=>Object.keys(w.signals).sort().map(e=>`'${e}'`).join(`, `),Bn=()=>[...new Set(Object.values(w.signals).sort((e,t)=>e-t))].join(`, `),Vn=e=>On[e].description,Hn=e=>{if(e===!1)return e;if(e===!0)return Un;if(!Number.isFinite(e)||e<0)throw TypeError(`Expected the \`forceKillAfterDelay\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);return e},Un=5e3,Wn=({kill:e,options:{forceKillAfterDelay:t,killSignal:n},onInternalError:r,context:i,controller:a},o,s)=>{let{signal:c,error:l}=Gn(o,s,n);Kn(l,r);let u=e(c);return qn({kill:e,signal:c,forceKillAfterDelay:t,killSignal:n,killResult:u,context:i,controller:a}),u},Gn=(e,t,n)=>{let[r=n,i]=_n(e)?[void 0,e]:[e,t];if(typeof r!=`string`&&!Number.isInteger(r))throw TypeError(`The first argument must be an error instance or a signal name string/integer: ${String(r)}`);if(i!==void 0&&!_n(i))throw TypeError(`The second argument is optional. If specified, it must be an error instance: ${i}`);return{signal:Nn(r),error:i}},Kn=(e,t)=>{e!==void 0&&t.reject(e)},qn=async({kill:e,signal:t,forceKillAfterDelay:n,killSignal:r,killResult:i,context:a,controller:o})=>{t===r&&i&&Jn({kill:e,forceKillAfterDelay:n,context:a,controllerSignal:o.signal})},Jn=async({kill:e,forceKillAfterDelay:t,context:n,controllerSignal:r})=>{if(t!==!1)try{await C(t,void 0,{signal:r}),e(`SIGKILL`)&&(n.isForcefullyTerminated??=!0)}catch{}},Yn=async(e,t)=>{e.aborted||await E(e,`abort`,{signal:t})},Xn=({cancelSignal:e})=>{if(e!==void 0&&Object.prototype.toString.call(e)!==`[object AbortSignal]`)throw Error(`The \`cancelSignal\` option must be an AbortSignal: ${String(e)}`)},Zn=({kill:e,cancelSignal:t,gracefulCancel:n,context:r,controller:i})=>t===void 0||n?[]:[Qn(e,t,r,i)],Qn=async(e,t,n,{signal:r})=>{throw await Yn(t,r),n.terminationReason??=`cancel`,e(),t.reason},$n=({methodName:e,isSubprocess:t,ipc:n,isConnected:r})=>{er(e,t,n),tr(e,t,r)},er=(e,t,n)=>{if(!n)throw Error(`${R(e,t)} can only be used if the \`ipc\` option is \`true\`.`)},tr=(e,t,n)=>{if(!n)throw Error(`${R(e,t)} cannot be used: the ${z(t)} has already exited or disconnected.`)},nr=e=>{throw Error(`${R(`getOneMessage`,e)} could not complete: the ${z(e)} exited or disconnected.`)},rr=e=>{throw Error(`${R(`sendMessage`,e)} failed: the ${z(e)} is sending a message too, instead of listening to incoming messages.
|
|
11
|
-
This can be fixed by both sending a message and listening to incoming messages at the same time:
|
|
12
|
-
|
|
13
|
-
const [receivedMessage] = await Promise.all([
|
|
14
|
-
${R(`getOneMessage`,e)},
|
|
15
|
-
${R(`sendMessage`,e,`message, {strict: true}`)},
|
|
16
|
-
]);`)},ir=(e,t)=>Error(`${R(`sendMessage`,t)} failed when sending an acknowledgment response to the ${z(t)}.`,{cause:e}),ar=e=>{throw Error(`${R(`sendMessage`,e)} failed: the ${z(e)} is not listening to incoming messages.`)},or=e=>{throw Error(`${R(`sendMessage`,e)} failed: the ${z(e)} exited without listening to incoming messages.`)},sr=()=>/* @__PURE__ */ Error(`\`cancelSignal\` aborted: the ${z(!0)} disconnected.`),cr=()=>{throw Error("`getCancelSignal()` cannot be used without setting the `cancelSignal` subprocess option.")},lr=({error:e,methodName:t,isSubprocess:n})=>{if(e.code===`EPIPE`)throw Error(`${R(t,n)} cannot be used: the ${z(n)} is disconnecting.`,{cause:e})},ur=({error:e,methodName:t,isSubprocess:n,message:r})=>{if(dr(e))throw Error(`${R(t,n)}'s argument type is invalid: the message cannot be serialized: ${String(r)}.`,{cause:e})},dr=({code:e,message:t})=>fr.has(e)||pr.some(e=>t.includes(e)),fr=/* @__PURE__ */ new Set([`ERR_MISSING_ARGS`,`ERR_INVALID_ARG_TYPE`]),pr=[`could not be cloned`,`circular structure`,`call stack size exceeded`],R=(e,t,n=``)=>e===`cancelSignal`?"`cancelSignal`'s `controller.abort()`":`${mr(t)}${e}(${n})`,mr=e=>e?``:`subprocess.`,z=e=>e?`parent process`:`subprocess`,hr=e=>{e.connected&&e.disconnect()},B=()=>{let e={},t=new Promise((t,n)=>{Object.assign(e,{resolve:t,reject:n})});return Object.assign(t,e)},gr=(e,t,n)=>{let r=e.getMaxListeners();r!==0&&r!==1/0&&(e.setMaxListeners(r+t),T(n,()=>{e.setMaxListeners(e.getMaxListeners()-t)}))},_r=(e,t)=>{t&&vr(e)},vr=e=>{e.refCounted()},yr=(e,t)=>{t&&br(e)},br=e=>{e.unrefCounted()},xr=(e,t)=>{t&&(br(e),br(e))},Sr=(e,t)=>{t&&(vr(e),vr(e))},Cr=async({anyProcess:e,channel:t,isSubprocess:n,ipcEmitter:r},i)=>{if(Pr(i)||ri(i))return;Tr.has(e)||Tr.set(e,[]);let a=Tr.get(e);if(a.push(i),!(a.length>1))for(;a.length>0;){await Hr(e,r,i),await S.yield();let o=await Nr({wrappedMessage:a[0],anyProcess:e,channel:t,isSubprocess:n,ipcEmitter:r});a.shift(),r.emit(`message`,o),r.emit(`message:done`)}},wr=async({anyProcess:e,channel:t,isSubprocess:n,ipcEmitter:r,boundOnMessage:i})=>{ai();let a=Tr.get(e);for(;a?.length>0;)await E(r,`message:done`);e.removeListener(`message`,i),Sr(t,n),r.connected=!1,r.emit(`disconnect`)},Tr=/* @__PURE__ */ new WeakMap,Er=(e,t,n)=>{if(Dr.has(e))return Dr.get(e);let r=new te;return r.connected=!0,Dr.set(e,r),Or({ipcEmitter:r,anyProcess:e,channel:t,isSubprocess:n}),r},Dr=/* @__PURE__ */ new WeakMap,Or=({ipcEmitter:e,anyProcess:t,channel:n,isSubprocess:r})=>{let i=Cr.bind(void 0,{anyProcess:t,channel:n,isSubprocess:r,ipcEmitter:e});t.on(`message`,i),t.once(`disconnect`,wr.bind(void 0,{anyProcess:t,channel:n,isSubprocess:r,ipcEmitter:e,boundOnMessage:i})),xr(n,r)},kr=e=>{let t=Dr.get(e);return t===void 0?e.channel!==void 0&&e.channel!==null:t.connected},Ar=({anyProcess:e,channel:t,isSubprocess:n,message:r,strict:i})=>{if(!i)return r;let a=Er(e,t,n),o=Gr(e,a);return{id:jr++,type:Rr,message:r,hasListeners:o}};let jr=0n;const Mr=(e,t)=>{if(!(t?.type!==Rr||t.hasListeners))for(let{id:t}of e)t!==void 0&&Ir[t].resolve({isDeadlock:!0,hasListeners:!1})},Nr=async({wrappedMessage:e,anyProcess:t,channel:n,isSubprocess:r,ipcEmitter:i})=>{if(e?.type!==Rr||!t.connected)return e;let{id:a,message:o}=e,s={id:a,type:zr,message:Gr(t,i)};try{await Jr({anyProcess:t,channel:n,isSubprocess:r,ipc:!0},s)}catch(e){i.emit(`strict:error`,e)}return o},Pr=e=>{if(e?.type!==zr)return!1;let{id:t,message:n}=e;return Ir[t]?.resolve({isDeadlock:!1,hasListeners:n}),!0},Fr=async(e,t,n)=>{if(e?.type!==Rr)return;let r=B();Ir[e.id]=r;let i=new AbortController;try{let{isDeadlock:e,hasListeners:a}=await Promise.race([r,Lr(t,n,i)]);e&&rr(n),a||ar(n)}finally{i.abort(),delete Ir[e.id]}},Ir={},Lr=async(e,t,{signal:n})=>{gr(e,1,n),await E(e,`disconnect`,{signal:n}),or(t)},Rr=`execa:ipc:request`,zr=`execa:ipc:response`,Br=(e,t,n)=>{V.has(e)||V.set(e,/* @__PURE__ */ new Set);let r=V.get(e),i={onMessageSent:B(),id:n?t.id:void 0};return r.add(i),{outgoingMessages:r,outgoingMessage:i}},Vr=({outgoingMessages:e,outgoingMessage:t})=>{e.delete(t),t.onMessageSent.resolve()},Hr=async(e,t,n)=>{for(;!Gr(e,t)&&V.get(e)?.size>0;){let t=[...V.get(e)];Mr(t,n),await Promise.all(t.map(({onMessageSent:e})=>e))}},V=/* @__PURE__ */ new WeakMap,Ur=/* @__PURE__ */ new WeakMap,Wr=(e,t)=>{Ur.set(e,t)},Gr=(e,t)=>t.listenerCount(`message`)>Kr(e),Kr=e=>+(qr(e)!==void 0&&!P(qr(e).buffer,`ipc`)),qr=e=>Ur.get(e),Jr=({anyProcess:e,channel:t,isSubprocess:n,ipc:r},i,{strict:a=!1}={})=>{let o=`sendMessage`;return $n({methodName:o,isSubprocess:n,ipc:r,isConnected:e.connected}),Yr({anyProcess:e,channel:t,methodName:o,isSubprocess:n,message:i,strict:a})},Yr=async({anyProcess:e,channel:t,methodName:n,isSubprocess:r,message:i,strict:a})=>{let o=Ar({anyProcess:e,channel:t,isSubprocess:r,message:i,strict:a}),s=Br(e,o,a);try{await Xr({anyProcess:e,methodName:n,isSubprocess:r,wrappedMessage:o,message:i})}catch(t){throw hr(e),t}finally{Vr(s)}},Xr=async({anyProcess:e,methodName:t,isSubprocess:n,wrappedMessage:r,message:i})=>{let a=Zr(e);try{await Promise.all([Fr(r,e,n),a(r)])}catch(e){throw lr({error:e,methodName:t,isSubprocess:n}),ur({error:e,methodName:t,isSubprocess:n,message:i}),e}},Zr=e=>{if(Qr.has(e))return Qr.get(e);let t=p(e.send.bind(e));return Qr.set(e,t),t},Qr=/* @__PURE__ */ new WeakMap,$r=(e,t)=>{let n=`cancelSignal`;return tr(n,!1,e.connected),Xr({anyProcess:e,methodName:n,isSubprocess:!1,wrappedMessage:{type:ii,message:t},message:t})},ei=async({anyProcess:e,channel:t,isSubprocess:n,ipc:r})=>(await ti({anyProcess:e,channel:t,isSubprocess:n,ipc:r}),oi.signal),ti=async({anyProcess:e,channel:t,isSubprocess:n,ipc:r})=>{if(!ni){if(ni=!0,!r){cr();return}if(t===null){ai();return}Er(e,t,n),await S.yield()}};let ni=!1;const ri=e=>e?.type===ii&&(oi.abort(e.message),!0),ii=`execa:ipc:cancel`,ai=()=>{oi.abort(sr())},oi=new AbortController,si=({gracefulCancel:e,cancelSignal:t,ipc:n,serialization:r})=>{if(e){if(t===void 0)throw Error("The `cancelSignal` option must be defined when setting the `gracefulCancel` option.");if(!n)throw Error("The `ipc` option cannot be false when setting the `gracefulCancel` option.");if(r===`json`)throw Error("The `serialization` option cannot be 'json' when setting the `gracefulCancel` option.")}},ci=({subprocess:e,kill:t,cancelSignal:n,gracefulCancel:r,forceKillAfterDelay:i,context:a,controller:o})=>r?[li({subprocess:e,kill:t,cancelSignal:n,forceKillAfterDelay:i,context:a,controller:o})]:[],li=async({subprocess:e,kill:t,cancelSignal:n,forceKillAfterDelay:r,context:i,controller:{signal:a}})=>{await Yn(n,a);let o=ui(n);throw await $r(e,o),Jn({kill:t,forceKillAfterDelay:r,context:i,controllerSignal:a}),i.terminationReason??=`gracefulCancel`,n.reason},ui=({reason:e})=>{if(!(e instanceof DOMException))return e;let t=Error(e.message);return Object.defineProperty(t,"stack",{value:e.stack,enumerable:!1,configurable:!0,writable:!0}),t},di=({timeout:e})=>{if(e!==void 0&&(!Number.isFinite(e)||e<0))throw TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`)},fi=(e,t,n,r)=>t===0||t===void 0?[]:[pi(e,t,n,r)],pi=async(e,t,n,{signal:r})=>{throw await C(t,void 0,{signal:r}),n.terminationReason??=`timeout`,e(),new L},mi=({options:e})=>{if(e.node===!1)throw TypeError('The "node" option cannot be false with `execaNode()`.');return{options:{...e,node:!0}}},hi=(e,t,{node:n=!1,nodePath:r=_,nodeOptions:i=g.filter(e=>!e.startsWith(`--inspect`)),cwd:a,execPath:o,...s})=>{if(o!==void 0)throw TypeError(`The "execPath" option has been removed. Please use the "nodePath" option instead.`);let c=Se(r,`The "nodePath" option`),l=x.resolve(a,c),u={__proto__:null,shell:!1,...s,nodePath:l,node:n,cwd:a};if(!n)return[e,t,u];if(x.basename(e,`.exe`)===`node`)throw TypeError(`When the "node" option is true, the first argument does not need to be "node".`);return[l,[...i,e,...t],{__proto__:null,ipc:!0,...u,shell:!1}]},gi=({ipcInput:e,ipc:t,serialization:n})=>{if(e!==void 0){if(!t)throw Error("The `ipcInput` option cannot be set unless the `ipc` option is `true`.");_i[n](e)}},_i={advanced:e=>{try{ie(e)}catch(e){throw Error("The `ipcInput` option is not serializable with a structured clone.",{cause:e})}},json:e=>{try{JSON.stringify(e)}catch(e){throw Error("The `ipcInput` option is not serializable with JSON.",{cause:e})}}},vi=async(e,t,n)=>{t!==void 0&&await Jr({anyProcess:e,channel:e.channel,isSubprocess:!1,ipc:n},t)},yi=({encoding:e})=>{if(xi.has(e))return;let t=Si(e);if(t!==void 0)throw TypeError(`Invalid option \`encoding: ${wi(e)}\`.
|
|
17
|
-
Please rename it to ${wi(t)}.`);let n=[...xi].map(e=>wi(e)).join(`, `);throw TypeError(`Invalid option \`encoding: ${wi(e)}\`.
|
|
18
|
-
Please rename it to one of: ${n}.`)},bi=/* @__PURE__ */ new Set([`utf8`,`utf16le`]),H=/* @__PURE__ */ new Set([`buffer`,`hex`,`base64`,`base64url`,`latin1`,`ascii`]),xi=bi.union(H),Si=e=>{if(e===null)return`buffer`;if(typeof e!=`string`)return;let t=e.toLowerCase();if(t in Ci)return Ci[t];if(xi.has(t))return t},Ci={"utf-8":`utf8`,"utf-16le":`utf16le`,"ucs-2":`utf16le`,ucs2:`utf16le`,binary:`latin1`},wi=e=>typeof e==`string`?`"${e}"`:String(e),U=h.platform===`win32`,Ti=U?/[\/\\]/v:/\//v;function Ei(e,t){if(typeof e!=`string`||e.length===0)throw TypeError(`Expected a non-empty string.`);let{cwd:n=h.cwd(),path:r=h.env.PATH??(U?h.env.Path:void 0)??``,pathExt:i=h.env.PATHEXT||`.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC`}=t;return{cwd:n,searchPath:r,pathExt:i}}function Di(e,t){let n=t.split(x.delimiter).filter(Boolean),r=x.extname(e).toLowerCase();return r!==``&&n.some(e=>e.toLowerCase()===r)?[``,...n]:n}function*Oi(e,{cwd:t,searchPath:n,pathExt:r}){let i=U?Di(e,r):[``];if(Ti.test(e)){let n=x.resolve(t,e);for(let e of i)yield n+e;return}let a=[...U?[t]:[],...n.split(x.delimiter)];for(let n of a){let r=U&&n.length>1&&n.startsWith(`"`)&&n.endsWith(`"`)?n.slice(1,-1):n;if(r===``)continue;let a=x.resolve(t,r,e);for(let e of i)yield a+e}}function ki(e){let t;try{t=ae.statSync(e)}catch(e){return U&&e.code===`EACCES`}if(!t.isFile())return!1;if(U)return!0;try{return ae.accessSync(e,ae.constants.X_OK),!0}catch{return!1}}function Ai(e,t={}){let n=Ei(e,t);for(let t of Oi(e,n))if(ki(t))return t}const ji=(e,t,n)=>{let r={file:e,commandArguments:[...t],options:n};return n.shell||h.platform!==`win32`?r:Pi(r)},Mi=/\.(?:com|exe)$/i,Ni=/\.(?:bat|cmd)$/i,Pi=e=>{let t=Fi(e);if(t!==void 0&&Mi.test(t))return e.options.argv0===void 0&&(e.options.argv0=e.file),e.file=t,e;for(let t of[e.file,...e.commandArguments])Wi(t);let n=t!==void 0&&Ni.test(t),r=`"${[Ki(x.normalize(t??e.file)),...e.commandArguments.map(e=>Ji(e,n))].join(` `)}"`;return e.options.windowsVerbatimArguments=!0,{file:h.env.comspec||`cmd.exe`,commandArguments:[`/d`,`/s`,`/c`,r],options:e.options}},Fi=e=>{let t=Ii(e),n=t!==void 0&&Bi(t);return n?(e.commandArguments.unshift(t),e.file=n,Ii(e)):t},Ii=e=>{let t=e.options.env||h.env,n=e.options.cwd??h.cwd(),r=W(t,`PATHEXT`),i=x.extname(e.file),a=i===``?r:`${i}${x.delimiter}${r??``}`;if(Li(e.file))return Ai(x.resolve(n,e.file),{cwd:n,pathExt:a});let o={cwd:n,path:W(t,`PATH`)??W(h.env,`PATH`)??``,pathExt:a};return Ri(t)?Ai(e.file,o):zi(e.file,o)},Li=e=>e.includes(`/`)||e.includes(`\\`)||e.includes(`:`),Ri=e=>W(h.env,`NODEFAULTCURRENTDIRECTORYINEXEPATH`)===void 0&&W(e,`NODEFAULTCURRENTDIRECTORYINEXEPATH`)===void 0,zi=(e,{cwd:t,path:n,pathExt:r})=>{for(let i of n.split(x.delimiter)){let n=i.length>1&&i.startsWith(`"`)&&i.endsWith(`"`)?i.slice(1,-1):i;if(n===``)continue;let a=Ai(x.resolve(t,n,e),{cwd:t,pathExt:r});if(a!==void 0)return a}},W=(e,t)=>{let n=Object.keys(e).sort().find(e=>e.toUpperCase()===t);return n===void 0?void 0:e[n]},Bi=e=>{let t=he.alloc(150);try{let n=ue(e,`r`);try{fe(n,t,0,150,0)}finally{se(n)}}catch{return}return Hi(t.toString())},Vi=/^#!(?<line>.*)/,Hi=e=>{let t=e.match(Vi)?.groups.line.trim();if(!t)return;let[n,r]=t.split(` `),i=n.split(`/`).at(-1);return i===`env`?r:r?`${i} ${r}`:i},Ui=/[\n\r]/,Wi=e=>{if(Ui.test(e))throw TypeError(`The command and its arguments cannot contain a line break on Windows without a shell.\nThis would allow a command injection with \`cmd.exe\`.\nInvalid value: ${JSON.stringify(`${e}`)}`)},Gi=/[()\][%!^"`<>&|;, *?]/g,Ki=e=>e.replaceAll(Gi,`^$&`),qi=/\\+/g,Ji=(e,t)=>{let n=`${e}`.replaceAll(qi,(e,t,n)=>{let r=n[t+e.length];return r===`"`||r===void 0?e.repeat(2):e}).replaceAll(`"`,`\\"`),r=Ki(`"${n}"`);return t?Ki(r):r},Yi=(e=Xi())=>{let t=Se(e,`The "cwd" option`);return x.resolve(t)},Xi=()=>{try{return h.cwd()}catch(e){throw e.message=`The current directory does not exist.\n${e.message}`,e}},Zi=(e,t)=>{if(t===Xi())return e;let n;try{n=pe(t)}catch(n){return`The "cwd" option is invalid: ${t}.\n${n.message}\n${e}`}return n.isDirectory()?e:`The "cwd" option is not a directory: ${t}.\n${e}`},Qi=/^cmd(?:\.exe)?$/i,$i=(e,t,n)=>{let r={__proto__:null,...n};r.cwd=Yi(r.cwd);let[i,a,o]=hi(e,t,r),s=Xe(o),c=ea(s);c.env=ta(c);let{file:l,commandArguments:u}=ji(i,a,c);return di(c),yi(c),gi(c),Xn(c),si(c),c.shell=Te(c.shell),c.killSignal=Mn(c.killSignal),c.forceKillAfterDelay=Hn(c.forceKillAfterDelay),c.lines=c.lines.map((e,t)=>e&&!H.has(c.encoding)&&c.buffer[t]),h.platform===`win32`&&Qi.test(x.basename(l))&&u.unshift(`/q`),{file:l,commandArguments:u,options:c}},ea=({extendEnv:e=!0,preferLocal:t=!1,cwd:n,localDir:r=n,encoding:i=`utf8`,reject:a=!0,cleanup:o=!0,killDescendants:s=!1,all:c=!1,windowsHide:l=!0,killSignal:u=`SIGTERM`,forceKillAfterDelay:d=!0,gracefulCancel:f=!1,ipcInput:p,ipc:m=p!==void 0||f,serialization:h=`advanced`,...g})=>({__proto__:null,...g,extendEnv:e,preferLocal:t,cwd:n,localDirectory:r,encoding:i,reject:a,cleanup:o,killDescendants:s,all:c,windowsHide:l,killSignal:u,forceKillAfterDelay:d,gracefulCancel:f,ipcInput:p,ipc:m,serialization:h}),ta=({env:e,extendEnv:t,preferLocal:n,node:r,localDirectory:i,nodePath:a})=>{let o=t?{...h.env,...e}:e;return n||r?fn({env:o,cwd:i,execPath:a,preferLocal:n,addExecPath:r}):o},na=(e,t,n)=>n.shell&&t.length>0?[[e,...t].join(` `),[],n]:[e,t,n];function ra(e){if(typeof e==`string`)return ia(e);if(!(ArrayBuffer.isView(e)&&e.BYTES_PER_ELEMENT===1))throw Error(`Input must be a string or a Uint8Array`);return aa(e)}const ia=e=>e.at(-1)===oa?e.slice(0,e.at(-2)===ca?-2:-1):e,aa=e=>e.at(-1)===sa?e.subarray(0,e.at(-2)===la?-2:-1):e,oa=`
|
|
19
|
-
`,sa=`
|
|
20
|
-
`.codePointAt(0),ca=`\r`,la=`\r`.codePointAt(0);function G(e,{checkOpen:t=!0}={}){return typeof e==`object`&&!!e&&(e.writable||e.readable||!t||e.writable===void 0&&e.readable===void 0)&&typeof e.pipe==`function`}function ua(e,{checkOpen:t=!0}={}){return G(e,{checkOpen:t})&&(e.writable||!t)&&typeof e.write==`function`&&typeof e.end==`function`&&typeof e.writable==`boolean`&&typeof e.writableObjectMode==`boolean`&&typeof e.destroy==`function`&&typeof e.destroyed==`boolean`}function da(e,{checkOpen:t=!0}={}){return G(e,{checkOpen:t})&&(e.readable||!t)&&typeof e.read==`function`&&typeof e.readable==`boolean`&&typeof e.readableObjectMode==`boolean`&&typeof e.destroy==`function`&&typeof e.destroyed==`boolean`}function fa(e,t){return ua(e,t)&&da(e,t)}const pa=Object.getPrototypeOf(Object.getPrototypeOf(
|
|
21
|
-
/* istanbul ignore next */
|
|
22
|
-
async function*(){}).prototype);var ma=class{#e;#t;#n=!1;#r=void 0;constructor(e,t){this.#e=e,this.#t=t}next(){let e=()=>this.#i();return this.#r=this.#r?this.#r.then(e,e):e(),this.#r}return(e){let t=()=>this.#a(e);return this.#r?this.#r.then(t,t):t()}async#i(){if(this.#n)return{done:!0,value:void 0};let e;try{e=await this.#e.read()}catch(e){throw this.#r=void 0,this.#n=!0,this.#e.releaseLock(),e}return e.done&&(this.#r=void 0,this.#n=!0,this.#e.releaseLock()),e}async#a(e){if(this.#n)return{done:!0,value:e};if(this.#n=!0,!this.#t){let t=this.#e.cancel(e);return this.#e.releaseLock(),await t,{done:!0,value:e}}return this.#e.releaseLock(),{done:!0,value:e}}};const ha=Symbol();function ga(){return this[ha].next()}Object.defineProperty(ga,"name",{value:`next`});function _a(e){return this[ha].return(e)}Object.defineProperty(_a,"name",{value:`return`});const va=Object.create(pa,{next:{enumerable:!0,configurable:!0,writable:!0,value:ga},return:{enumerable:!0,configurable:!0,writable:!0,value:_a}});function ya({preventCancel:e=!1}={}){let t=new ma(this.getReader(),e),n=Object.create(va);return n[ha]=t,n}const ba=e=>{if(da(e,{checkOpen:!1})&&wa.on!==void 0)return Sa(e);if(typeof e?.[Symbol.asyncIterator]==`function`)return e;if(xa.call(e)===`[object ReadableStream]`)return ya.call(e);throw TypeError(`The first argument must be a Readable, a ReadableStream, or an async iterable.`)},{toString:xa}=Object.prototype,Sa=async function*(e){let t=new AbortController,n={};Ca(e,t,n);try{for await(let[n]of wa.on(e,`data`,{signal:t.signal}))yield n}catch(e){if(n.error!==void 0)throw n.error;if(!t.signal.aborted)throw e}finally{e.destroy()}},Ca=async(e,t,n)=>{try{await wa.finished(e,{cleanup:!0,readable:!0,writable:!1,error:!1})}catch(e){n.error=e}finally{t.abort()}},wa={},Ta=async(e,{init:t,convertChunk:n,getSize:r,truncateChunk:i,addChunk:a,getFinalChunk:o,finalize:s},{maxBuffer:c=1/0}={})=>{let l=ba(e),u=t();u.length=0;try{for await(let e of l){let t=n[ka(e)](e,u);Da({convertedChunk:t,state:u,getSize:r,truncateChunk:i,addChunk:a,maxBuffer:c})}return Ea({state:u,convertChunk:n,getSize:r,truncateChunk:i,addChunk:a,getFinalChunk:o,maxBuffer:c}),s(u)}catch(e){let t=typeof e==`object`&&e?e:Error(e);throw t.bufferedData=s(u),t}},Ea=({state:e,getSize:t,truncateChunk:n,addChunk:r,getFinalChunk:i,maxBuffer:a})=>{let o=i(e);o!==void 0&&Da({convertedChunk:o,state:e,getSize:t,truncateChunk:n,addChunk:r,maxBuffer:a})},Da=({convertedChunk:e,state:t,getSize:n,truncateChunk:r,addChunk:i,maxBuffer:a})=>{let o=n(e),s=t.length+o;if(s<=a){Oa(e,t,i,s);return}let c=r(e,a-t.length);throw c!==void 0&&Oa(c,t,i,a),new ja},Oa=(e,t,n,r)=>{t.contents=n(e,t,r),t.length=r},ka=e=>{let t=typeof e;if(t===`string`)return`string`;if(t!==`object`||e===null)return`others`;if(globalThis.Buffer?.isBuffer(e))return`buffer`;let n=Aa.call(e);return n===`[object ArrayBuffer]`?`arrayBuffer`:n===`[object DataView]`?`dataView`:Number.isInteger(e.byteLength)&&Number.isInteger(e.byteOffset)&&Aa.call(e.buffer)===`[object ArrayBuffer]`?`typedArray`:`others`},{toString:Aa}=Object.prototype;var ja=class extends Error{name=`MaxBufferError`;constructor(){super(`maxBuffer exceeded`)}};const K=e=>e,Ma=()=>void 0,Na=({contents:e})=>e,Pa=e=>{throw Error(`Streams in object mode are not supported: ${String(e)}`)},Fa=e=>e.length;async function Ia(e,t){return Ta(e,La,t)}const La={init:()=>({contents:[]}),convertChunk:{string:K,buffer:K,arrayBuffer:K,dataView:K,typedArray:K,others:K},getSize:()=>1,truncateChunk:Ma,addChunk:(e,{contents:t})=>(t.push(e),t),getFinalChunk:Ma,finalize:Na};async function Ra(e,t){return Ta(e,Qa,t)}const za=()=>({contents:/* @__PURE__ */ new ArrayBuffer(0)}),Ba=e=>Va.encode(e),Va=new TextEncoder,Ha=e=>new Uint8Array(e),Ua=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),Wa=(e,t)=>e.slice(0,t),Ga=(e,{contents:t,length:n},r)=>{let i=Za()?qa(t,r):Ka(t,r);return new Uint8Array(i).set(e,n),i},Ka=(e,t)=>{if(t<=e.byteLength)return e;let n=new ArrayBuffer(Ja(t));return new Uint8Array(n).set(new Uint8Array(e),0),n},qa=(e,t)=>{if(t<=e.maxByteLength)return e.resize(t),e;let n=new ArrayBuffer(t,{maxByteLength:Ja(t)});return new Uint8Array(n).set(new Uint8Array(e),0),n},Ja=e=>Ya**Math.ceil(Math.log(e)/Math.log(Ya)),Ya=2,Xa=({contents:e,length:t})=>Za()?e:e.slice(0,t),Za=()=>`resize`in ArrayBuffer.prototype,Qa={init:za,convertChunk:{string:Ba,buffer:Ha,arrayBuffer:Ha,dataView:Ua,typedArray:Ua,others:Pa},getSize:Fa,truncateChunk:Wa,addChunk:Ga,getFinalChunk:Ma,finalize:Xa};async function $a(e,t){return Ta(e,no,t)}const eo=()=>({contents:``,textDecoder:new TextDecoder}),to=(e,{textDecoder:t})=>t.decode(e,{stream:!0}),no={init:eo,convertChunk:{string:K,buffer:to,arrayBuffer:to,dataView:to,typedArray:to,others:Pa},getSize:Fa,truncateChunk:(e,t)=>e.slice(0,t),addChunk:(e,{contents:t})=>t+e,getFinalChunk:({textDecoder:e})=>{let t=e.decode();return t===``?void 0:t},finalize:Na},ro=({error:e,stream:t,readableObjectMode:n,lines:r,encoding:i,fdNumber:a})=>{if(!(e instanceof ja))throw e;if(a===`all`)return e;throw e.maxBufferInfo={fdNumber:a,unit:io(n,r,i)},t.destroy(),e},io=(e,t,n)=>e?`objects`:t?`lines`:n===`buffer`?`bytes`:`characters`,ao=(e,t,n)=>{if(t.length!==n)return;let r=new ja;throw r.maxBufferInfo={fdNumber:`ipc`},r},oo=(e,t)=>{let{streamName:n,threshold:r,unit:i}=so(e,t);return`Command's ${n} was larger than ${r} ${i}`},so=(e,t)=>{if(e?.maxBufferInfo===void 0)return{streamName:`output`,threshold:t[1],unit:`bytes`};let{maxBufferInfo:{fdNumber:n,unit:r}}=e;delete e.maxBufferInfo;let i=P(t,n);return n===`ipc`?{streamName:`IPC output`,threshold:i,unit:`messages`}:{streamName:Ye(n),threshold:i,unit:r}},co=(e,t,n)=>e?.code===`ENOBUFS`&&t!==null&&t.some(e=>e!==null&&e.length>uo(n)),lo=(e,t,n)=>{if(!t)return e;let r=uo(n);return e.length>r?e.slice(0,r):e},uo=([,e])=>e,fo=({stdio:e,all:t,ipcOutput:n,originalError:r,signal:i,signalDescription:a,exitCode:o,escapedCommand:s,timedOut:c,isCanceled:l,isGracefullyCanceled:u,isMaxBuffer:d,isForcefullyTerminated:f,forceKillAfterDelay:p,killSignal:m,maxBuffer:h,timeout:g,cwd:_})=>{let v=r?.code,y=po({originalError:r,timedOut:c,timeout:g,isMaxBuffer:d,maxBuffer:h,errorCode:v,signal:i,signalDescription:a,exitCode:o,isCanceled:l,isGracefullyCanceled:u,isForcefullyTerminated:f,forceKillAfterDelay:p,killSignal:m}),b=ho(r,_),x=`${y}: ${s}${b===void 0?``:`\n${b}`}`;return{originalMessage:b,shortMessage:x,message:[x,...t===void 0?[e[2],e[1]]:[t],...e.slice(3),n.map(e=>go(e)).join(`
|
|
23
|
-
`)].map(e=>_t(ra(_o(e)))).filter(Boolean).join(`
|
|
24
|
-
|
|
25
|
-
`)}},po=({originalError:e,timedOut:t,timeout:n,isMaxBuffer:r,maxBuffer:i,errorCode:a,signal:o,signalDescription:s,exitCode:c,isCanceled:l,isGracefullyCanceled:u,isForcefullyTerminated:d,forceKillAfterDelay:f,killSignal:p})=>{let m=mo(d,f);return t?`Command timed out after ${n} milliseconds${m}`:u?o===void 0?`Command was gracefully canceled with exit code ${c}`:d?`Command was gracefully canceled${m}`:`Command was gracefully canceled with ${o} (${s})`:l?`Command was canceled${m}`:r?`${oo(e,i)}${m}`:a===void 0?d?`Command was killed with ${p} (${Vn(p)})${m}`:o===void 0?c===void 0?`Command failed`:`Command failed with exit code ${c}`:`Command was killed with ${o} (${s})`:`Command failed with ${a}${m}`},mo=(e,t)=>e?` and was forcefully terminated after ${t} milliseconds`:``,ho=(e,t)=>{if(e instanceof L)return;let n=hn(e)?e.originalMessage:String(e?.message??e),r=_t(Zi(n,t));return r===``?void 0:r},go=e=>typeof e==`string`?e:f(e),_o=e=>Array.isArray(e)?e.map(e=>ra(vo(e))).filter(Boolean).join(`
|
|
26
|
-
`):vo(e),vo=e=>typeof e==`string`?e:A(e)?Me(e):``,yo=({command:e,escapedCommand:t,stdio:n,all:r,ipcOutput:i,options:{cwd:a},startTime:o})=>Co({command:e,escapedCommand:t,cwd:a,durationMs:an(o),failed:!1,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isTerminated:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,exitCode:0,stdout:n[1],stderr:n[2],all:r,stdio:n,ipcOutput:i,pipedFrom:[]}),bo=({error:e,command:t,escapedCommand:n,fileDescriptors:r,options:i,startTime:a,isSync:o})=>xo({error:e,command:t,escapedCommand:n,startTime:a,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,stdio:Array.from({length:r.length}),ipcOutput:[],options:i,isSync:o}),xo=({error:e,command:t,escapedCommand:n,startTime:r,timedOut:i,isCanceled:a,isGracefullyCanceled:o,isMaxBuffer:s,isForcefullyTerminated:c,exitCode:l,signal:u,stdio:d,all:f,ipcOutput:p,options:{timeoutDuration:m,timeout:h=m,forceKillAfterDelay:g,killSignal:_,cwd:v,maxBuffer:y},isSync:b})=>{let{exitCode:x,signal:S,signalDescription:ee}=wo(l,u),{originalMessage:C,shortMessage:w,message:te}=fo({stdio:d,all:f,ipcOutput:p,originalError:e,signal:S,signalDescription:ee,exitCode:x,escapedCommand:n,timedOut:i,isCanceled:a,isGracefullyCanceled:o,isMaxBuffer:s,isForcefullyTerminated:c,forceKillAfterDelay:g,killSignal:_,maxBuffer:y,timeout:h,cwd:v}),T=pn(e,te,b);return Object.assign(T,So({error:T,command:t,escapedCommand:n,startTime:r,timedOut:i,isCanceled:a,isGracefullyCanceled:o,isMaxBuffer:s,isForcefullyTerminated:c,exitCode:x,signal:S,signalDescription:ee,stdio:d,all:f,ipcOutput:p,cwd:v,originalMessage:C,shortMessage:w})),T},So=({error:e,command:t,escapedCommand:n,startTime:r,timedOut:i,isCanceled:a,isGracefullyCanceled:o,isMaxBuffer:s,isForcefullyTerminated:c,exitCode:l,signal:u,signalDescription:d,stdio:f,all:p,ipcOutput:m,cwd:h,originalMessage:g,shortMessage:_})=>Co({shortMessage:_,originalMessage:g,command:t,escapedCommand:n,cwd:h,durationMs:an(r),failed:!0,timedOut:i,isCanceled:a,isGracefullyCanceled:o,isTerminated:u!==void 0,isMaxBuffer:s,isForcefullyTerminated:c,exitCode:l,signal:u,signalDescription:d,code:e.cause?.code,stdout:f[1],stderr:f[2],all:p,stdio:f,ipcOutput:m,pipedFrom:[]}),Co=e=>Object.fromEntries(Object.entries(e).filter(([,e])=>e!==void 0)),wo=(e,t)=>{let n=e===null?void 0:e,r=t===null?void 0:t;return{exitCode:n,signal:r,signalDescription:r===void 0?void 0:Vn(t)}},To=e=>Number.isFinite(e)?e:0;function Eo(e){return{days:Math.trunc(e/864e5),hours:Math.trunc(e/36e5%24),minutes:Math.trunc(e/6e4%60),seconds:Math.trunc(e/1e3%60),milliseconds:Math.trunc(e%1e3),microseconds:Math.trunc(To(e*1e3)%1e3),nanoseconds:Math.trunc(To(e*1e6)%1e3)}}function Do(e){return{days:e/86400000n,hours:e/3600000n%24n,minutes:e/60000n%60n,seconds:e/1000n%60n,milliseconds:e%1000n,microseconds:0n,nanoseconds:0n}}function Oo(e){switch(typeof e){case`number`:if(Number.isFinite(e))return Eo(e);break;case`bigint`:return Do(e)}throw TypeError(`Expected a finite number or bigint`)}const ko=e=>e===0||e===0n,Ao=(e,t)=>t===1||t===1n?e:`${e}s`,jo=24n*60n*60n*1000n;function Mo(e,t){let n=typeof e==`bigint`;if(!n&&!Number.isFinite(e))throw TypeError(`Expected a finite number or bigint`);t={...t};let r=e<0?`-`:``;e=e<0?-e:e,t.colonNotation&&(t.compact=!1,t.formatSubMilliseconds=!1,t.separateMilliseconds=!1,t.verbose=!1),t.compact&&(t.unitCount=1,t.secondsDecimalDigits=0,t.millisecondsDecimalDigits=0);let i=[],a=(e,t)=>{let n=Math.floor(e*10**t+1e-7);return(Math.round(n)/10**t).toFixed(t)},o=(e,n,r,a)=>{if(i.length!==0&&t.colonNotation||!ko(e)||t.colonNotation&&r===`m`){if(a??=String(e),t.colonNotation){let e=a.includes(`.`)?a.split(`.`)[0].length:a.length,t=i.length>0?2:1;a=`0`.repeat(Math.max(0,t-e))+a}else a+=t.verbose?` `+Ao(n,e):r;i.push(a)}},s=Oo(e),c=BigInt(s.days);if(t.hideYearAndDays?o(BigInt(c)*24n+BigInt(s.hours),`hour`,`h`):(t.hideYear?o(c,`day`,`d`):(o(c/365n,`year`,`y`),o(c%365n,`day`,`d`)),o(Number(s.hours),`hour`,`h`)),o(Number(s.minutes),`minute`,`m`),!t.hideSeconds){if(t.separateMilliseconds||t.formatSubMilliseconds||!t.colonNotation&&e<1e3&&!t.subSecondsAsDecimals){let e=Number(s.seconds),n=Number(s.milliseconds),r=Number(s.microseconds),i=Number(s.nanoseconds);if(o(e,`second`,`s`),t.formatSubMilliseconds)o(n,`millisecond`,`ms`),o(r,`microsecond`,`µs`),o(i,`nanosecond`,`ns`);else{let e=n+r/1e3+i/1e6,a=typeof t.millisecondsDecimalDigits==`number`?t.millisecondsDecimalDigits:0,s=a?e.toFixed(a):e>=1?Math.round(e):Math.ceil(e);o(Number.parseFloat(s),`millisecond`,`ms`,s)}}else{let r=a((n?Number(e%jo):e)/1e3%60,typeof t.secondsDecimalDigits==`number`?t.secondsDecimalDigits:1),i=t.keepDecimalsOnWholeSeconds?r:r.replace(/\.0+$/,``);o(Number.parseFloat(i),`second`,`s`,i)}}if(i.length===0)return r+`0`+(t.verbose?` milliseconds`:`ms`);let l=t.colonNotation?`:`:` `;return typeof t.unitCount==`number`&&(i=i.slice(0,Math.max(t.unitCount,1))),r+i.join(l)}const No=(e,t)=>{e.failed&&I({type:`error`,verboseMessage:e.shortMessage,verboseInfo:t,result:e})},Po=(e,t)=>{lt(t)&&(No(e,t),Fo(e,t))},Fo=(e,t)=>{let n=`(done in ${Mo(e.durationMs)})`;I({type:`duration`,verboseMessage:n,verboseInfo:t,result:e})},Io=(e,t,{reject:n})=>{if(Po(e,t),e.failed&&n)throw e;return e},Lo=(e,t)=>q(e)?`asyncGenerator`:Ko(e)?`generator`:Jo(e)?`fileUrl`:Xo(e)?`filePath`:as(e)?`webStream`:G(e,{checkOpen:!1})?`native`:A(e)?`uint8Array`:ss(e)?`asyncIterable`:cs(e)?`iterable`:os(e)?Bo({transform:e},t):qo(e)?Ro(e,t):`native`,Ro=(e,t)=>fa(e.transform,{checkOpen:!1})?zo(e,t):os(e.transform)?Bo(e,t):Uo(e,t),zo=(e,t)=>(Vo(e,t,`Duplex stream`),`duplex`),Bo=(e,t)=>(Vo(e,t,`web TransformStream`),`webTransform`),Vo=({final:e,binary:t,objectMode:n},r,i)=>{Ho(e,`${r}.final`,i),Ho(t,`${r}.binary`,i),Wo(n,`${r}.objectMode`)},Ho=(e,t,n)=>{if(e!==void 0)throw TypeError(`The \`${t}\` option can only be defined when using a generator, not a ${n}.`)},Uo=({transform:e,final:t,binary:n,objectMode:r},i)=>{if(e!==void 0&&!Go(e))throw TypeError(`The \`${i}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(fa(t,{checkOpen:!1}))throw TypeError(`The \`${i}.final\` option must not be a Duplex stream.`);if(os(t))throw TypeError(`The \`${i}.final\` option must not be a web TransformStream.`);if(t!==void 0&&!Go(t))throw TypeError(`The \`${i}.final\` option must be a generator.`);return Wo(n,`${i}.binary`),Wo(r,`${i}.objectMode`),q(e)||q(t)?`asyncGenerator`:`generator`},Wo=(e,t)=>{if(e!==void 0&&typeof e!=`boolean`)throw TypeError(`The \`${t}\` option must use a boolean.`)},Go=e=>q(e)||Ko(e),q=e=>Object.prototype.toString.call(e)===`[object AsyncGeneratorFunction]`,Ko=e=>Object.prototype.toString.call(e)===`[object GeneratorFunction]`,qo=e=>k(e)&&(e.transform!==void 0||e.final!==void 0),Jo=e=>Object.prototype.toString.call(e)===`[object URL]`,Yo=e=>Jo(e)&&e.protocol!==`file:`,Xo=e=>k(e)&&Object.keys(e).length>0&&Object.keys(e).every(e=>Zo.has(e))&&Qo(e.file),Zo=/* @__PURE__ */ new Set([`file`,`append`]),Qo=e=>typeof e==`string`,$o=e=>k(e)&&Object.keys(e).length>0&&Object.keys(e).every(e=>es.has(e))&&`value`in e,es=/* @__PURE__ */ new Set([`value`,`input`]),ts=(e,t)=>e===`native`&&typeof t==`string`&&!ns.has(t),ns=/* @__PURE__ */ new Set([`ipc`,`ignore`,`inherit`,`overlapped`,`pipe`]),rs=e=>Object.prototype.toString.call(e)===`[object ReadableStream]`,is=e=>Object.prototype.toString.call(e)===`[object WritableStream]`,as=e=>rs(e)||is(e),os=e=>rs(e?.readable)&&is(e?.writable),ss=e=>ls(e)&&typeof e[Symbol.asyncIterator]==`function`,cs=e=>ls(e)&&typeof e[Symbol.iterator]==`function`,ls=e=>typeof e==`object`&&!!e,J=/* @__PURE__ */ new Set([`generator`,`asyncGenerator`,`duplex`,`webTransform`]),us=/* @__PURE__ */ new Set([`fileUrl`,`filePath`,`fileNumber`]),ds=/* @__PURE__ */ new Set([`fileUrl`,`filePath`]),fs=/* @__PURE__ */ new Set([...ds,`webStream`,`nodeStream`]),ps=/* @__PURE__ */ new Set([`webTransform`,`duplex`]),ms={generator:`a generator`,asyncGenerator:`an async generator`,fileUrl:`a file URL`,filePath:`a file path string`,fileNumber:`a file descriptor number`,webStream:`a web stream`,nodeStream:`a Node.js stream`,webTransform:`a web TransformStream`,duplex:`a Duplex stream`,native:`any value`,iterable:`an iterable`,asyncIterable:`an async iterable`,string:`a string`,uint8Array:`a Uint8Array`},hs=(e,t,n,r)=>r===`output`?gs(e,t,n):_s(e,t,n),gs=(e,t,n)=>{let r=t!==0&&n[t-1].value.readableObjectMode;return{writableObjectMode:r,readableObjectMode:e??r}},_s=(e,t,n)=>{let r=t===0?e===!0:n[t-1].value.readableObjectMode;return{writableObjectMode:r,readableObjectMode:t!==n.length-1&&(e??r)}},vs=(e,t)=>{let n=e.findLast(({type:e})=>J.has(e));return n===void 0?!1:t===`input`?n.value.writableObjectMode:n.value.readableObjectMode},ys=(e,t,n,r)=>[...e.filter(({type:e})=>!J.has(e)),...bs(e,t,n,r)],bs=(e,t,n,{encoding:r})=>{let i=e.filter(({type:e})=>J.has(e)),a=Array.from({length:i.length});for(let[e,o]of Object.entries(i))a[e]=xs({stdioItem:o,index:Number(e),newTransforms:a,optionName:t,direction:n,encoding:r});return Ts(a,n)},xs=({stdioItem:e,stdioItem:{type:t},index:n,newTransforms:r,optionName:i,direction:a,encoding:o})=>t===`duplex`?Ss({stdioItem:e,optionName:i}):t===`webTransform`?Cs({stdioItem:e,index:n,newTransforms:r,direction:a}):ws({stdioItem:e,index:n,newTransforms:r,direction:a,encoding:o}),Ss=({stdioItem:e,optionName:t})=>{let{value:n}=e,{transform:r}=n,{writableObjectMode:i,readableObjectMode:a}=r,{objectMode:o=a}=n;if(o&&!a)throw TypeError(`The \`${t}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`);if(!o&&a)throw TypeError(`The \`${t}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`);return{...e,value:{transform:r,writableObjectMode:i,readableObjectMode:a}}},Cs=({stdioItem:e,stdioItem:{value:t},index:n,newTransforms:r,direction:i})=>{let{transform:a,objectMode:o}=k(t)?t:{transform:t},{writableObjectMode:s,readableObjectMode:c}=hs(o,n,r,i);return{...e,value:{transform:a,writableObjectMode:s,readableObjectMode:c}}},ws=({stdioItem:e,stdioItem:{value:t},index:n,newTransforms:r,direction:i,encoding:a})=>{let{transform:o,final:s,binary:c=!1,preserveNewlines:l=!1,objectMode:u}=k(t)?t:{transform:t},d=c||H.has(a),{writableObjectMode:f,readableObjectMode:p}=hs(u,n,r,i);return{...e,value:{transform:o,final:s,binary:d,preserveNewlines:l,writableObjectMode:f,readableObjectMode:p}}},Ts=(e,t)=>t===`input`?e.reverse():e,Es=(e,t,n)=>{let r=e.map(e=>Ds(e,t));if(r.includes(`input`)&&r.includes(`output`))throw TypeError(`The \`${n}\` option must not be an array of both readable and writable values.`);return r.find(Boolean)??Ns},Ds=(e,t)=>ks[t]??Os(e),Os=({type:e,value:t,direction:n,optionName:r})=>{let i=js[e](t);if(n===`input`&&i===`output`)throw TypeError(`The \`${r}\` option is invalid: \`input: true\` cannot be used with a writable value, which is always an output.`);return n??i},ks=[`input`,`output`,`output`],Y=()=>void 0,As=()=>`input`,js={generator:Y,asyncGenerator:Y,fileUrl:Y,filePath:Y,iterable:As,asyncIterable:As,uint8Array:As,webStream:e=>is(e)?`output`:`input`,nodeStream(e){return da(e,{checkOpen:!1})?ua(e,{checkOpen:!1})?void 0:`input`:`output`},webTransform:Y,duplex:Y,native(e){let t=Ms(e);if(t!==void 0)return t;if(G(e,{checkOpen:!1}))return js.nodeStream(e)}},Ms=e=>{if([0,h.stdin].includes(e))return`input`;if([1,2,h.stdout,h.stderr].includes(e))return`output`},Ns=`output`,Ps=(e,t)=>t?[...e,`ipc`]:e,Fs=({stdio:e,ipc:t,buffer:n,...r},i,a)=>{let o=zs(e,r).map((e,t)=>Vs(e,t));return Is(o),a?Hs(o,n,i):Ps(o,t)},Is=e=>{if(e.some(e=>Ls(e)))throw Error("The `ipc: true` option must be used instead of `stdio: 'ipc'`.")},Ls=e=>Array.isArray(e)?e.some(e=>Rs(e)):Rs(e),Rs=e=>$o(e)?e.value===`ipc`:e===`ipc`,zs=(e,t)=>{if(e===void 0)return N.map(e=>t[e]);if(Bs(t))throw Error(`It's not possible to provide \`stdio\` in combination with one of ${N.map(e=>`\`${e}\``).join(`, `)}`);if(typeof e==`string`)return[e,e,e];if(!Array.isArray(e))throw TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof e}\``);let n=Math.max(e.length,N.length);return Array.from({length:n},(t,n)=>e[n])},Bs=e=>N.some(t=>e[t]!==void 0),Vs=(e,t)=>Array.isArray(e)?e.map(e=>Vs(e,t)):e??(t>=N.length?`ignore`:`pipe`),Hs=(e,t,n)=>e.map((e,r)=>!t[r]&&r!==0&&!ut(n,r)&&Us(e,r)?`ignore`:e),Us=(e,t)=>Ws(e,t)||Array.isArray(e)&&e.every(e=>Ws(e,t)),Ws=(e,t)=>e===`pipe`||Gs(e,t),Gs=(e,t)=>$o(e)&&e.value===`pipe`&&(e.input===void 0||e.input===!1||Ks(t,e.input)),Ks=(e,t)=>t===!0&&(e===1||e===2),qs=(e,t=`stdin`)=>{let{options:n,fileDescriptors:r}=X.get(e),i=Ys(r,t,!0),a=e.stdio[i];if(a===null)throw TypeError(Qs(i,t,n,!0));return a},Js=(e,t=`stdout`)=>{let{options:n,fileDescriptors:r}=X.get(e),i=Ys(r,t,!1),a=i===`all`?e.all:e.stdio[i];if(a==null)throw TypeError(Qs(i,t,n,!1));return a},X=/* @__PURE__ */ new WeakMap,Ys=(e,t,n)=>{let r=Xs(t,n);return Zs(r,t,n,e),r},Xs=(e,t)=>{let n=it(e);if(n!==void 0)return n;let{validOptions:r,defaultValue:i}=t?{validOptions:`"stdin"`,defaultValue:`stdin`}:{validOptions:`"stdout", "stderr", "all"`,defaultValue:`stdout`};throw TypeError(`"${Z(t)}" must not be "${e}".
|
|
27
|
-
It must be ${r} or "fd3", "fd4" (and so on).
|
|
28
|
-
It is optional and defaults to "${i}".`)},Zs=(e,t,n,r)=>{let i=r[ec(e)];if(i===void 0)throw TypeError(`"${Z(n)}" must not be ${t}. That file descriptor does not exist.
|
|
29
|
-
Please set the "stdio" option to ensure that file descriptor exists.`);if(i.direction===`input`&&!n)throw TypeError(`"${Z(n)}" must not be ${t}. It must be a readable stream, not writable.`);if(i.direction!==`input`&&n)throw TypeError(`"${Z(n)}" must not be ${t}. It must be a writable stream, not readable.
|
|
30
|
-
If you meant to use it as input, please set its "stdio" option to \`{value: 'pipe', input: true}\`.`)},Qs=(e,t,n,r)=>{if(e===`all`&&!n.all)return`The "all" option must be true to use "from: 'all'".`;let{optionName:i,optionValue:a}=$s(e,n);return`The "${i}: ${tc(a)}" option is incompatible with using "${Z(r)}: ${tc(t)}".
|
|
31
|
-
Please set this option with "pipe" instead.`},$s=(e,{stdin:t,stdout:n,stderr:r,stdio:i})=>{let a=ec(e);return a===0&&t!==void 0?{optionName:`stdin`,optionValue:t}:a===1&&n!==void 0?{optionName:`stdout`,optionValue:n}:a===2&&r!==void 0?{optionName:`stderr`,optionValue:r}:{optionName:`stdio[${a}]`,optionValue:i[a]}},ec=e=>e===`all`?1:e,Z=e=>e?`to`:`from`,tc=e=>typeof e==`string`?`'${e}'`:typeof e==`number`?`${e}`:`Stream`,nc=({stdioItem:e,stdioItem:{type:t},isStdioArray:n,fdNumber:r,direction:i,isSync:a})=>!n||t!==`native`?e:a?rc({stdioItem:e,fdNumber:r,direction:i}):oc({stdioItem:e,fdNumber:r}),rc=({stdioItem:e,stdioItem:{value:t,optionName:n},fdNumber:r,direction:i})=>{let a=ic({value:t,optionName:n,fdNumber:r,direction:i});if(a!==void 0)return a;if(G(t,{checkOpen:!1}))throw TypeError(`The \`${n}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return e},ic=({value:e,optionName:t,fdNumber:n,direction:r})=>{let i=ac(e,n);if(i!==void 0){if(r===`output`)return{type:`fileNumber`,value:i,optionName:t};if(b.isatty(i))throw TypeError(`The \`${t}: ${tc(e)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:`uint8Array`,value:j(de(i)),optionName:t}}},ac=(e,t)=>{if(e===`inherit`)return t;if(typeof e==`number`)return e;let n=Je.indexOf(e);if(n!==-1)return n},oc=({stdioItem:e,stdioItem:{value:t,optionName:n},fdNumber:r})=>t===`inherit`?{type:`nodeStream`,value:sc(r,t,n),optionName:n}:typeof t==`number`?{type:`nodeStream`,value:sc(t,t,n),optionName:n}:G(t,{checkOpen:!1})?{type:`nodeStream`,value:t,optionName:n}:e,sc=(e,t,n)=>{let r=Je[e];if(r===void 0)throw TypeError(`The \`${n}: ${t}\` option is invalid: no such standard stream.`);return r},cc=({input:e,inputFile:t},n)=>n===0?[...lc(e),...dc(t)]:[],lc=e=>e===void 0?[]:[{type:uc(e),value:e,optionName:`input`}],uc=e=>{if(da(e,{checkOpen:!1}))return`nodeStream`;if(typeof e==`string`)return`string`;if(A(e))return`uint8Array`;throw Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},dc=e=>e===void 0?[]:[{...fc(e),optionName:`inputFile`}],fc=e=>{if(Jo(e))return{type:`fileUrl`,value:e};if(Qo(e))return{type:`filePath`,value:{file:e}};throw Error("The `inputFile` option must be a file path string or a file URL.")},pc=e=>e.filter((t,n)=>e.every((e,r)=>!mc(t,e)||n>=r||t.type===`generator`||t.type===`asyncGenerator`)),mc=(e,t)=>e.value===t.value&&e.direction===t.direction,hc=({stdioItem:{type:e,value:t,optionName:n},direction:r,fileDescriptors:i,isSync:a})=>{let o=gc(i,e);if(o.length!==0){if(a){_c({otherStdioItems:o,type:e,value:t,optionName:n,direction:r});return}if(fs.has(e))return vc({otherStdioItems:o,type:e,value:t,optionName:n,direction:r});ps.has(e)&&bc({otherStdioItems:o,type:e,value:t,optionName:n})}},gc=(e,t)=>e.flatMap(({direction:e,stdioItems:n})=>n.filter(e=>e.type===t).map((t=>({...t,direction:e})))),_c=({otherStdioItems:e,type:t,value:n,optionName:r,direction:i})=>{ds.has(t)&&vc({otherStdioItems:e,type:t,value:n,optionName:r,direction:i})},vc=({otherStdioItems:e,type:t,value:n,optionName:r,direction:i})=>{let a=e.filter(e=>yc(e,n));if(a.length===0)return;let o=a.find(e=>e.direction!==i);return xc(o,r,t),i===`output`?a[0].stream:void 0},yc=({type:e,value:t},n)=>e===`filePath`?t.file===n.file:e===`fileUrl`?t.href===n.href:t===n,bc=({otherStdioItems:e,type:t,value:n,optionName:r})=>{let i=e.find(({value:{transform:e}})=>e===n.transform);xc(i,r,t)},xc=(e,t,n)=>{if(e!==void 0)throw TypeError(`The \`${e.optionName}\` and \`${t}\` options must not target ${ms[n]} that is the same.`)},Sc=(e,t,n,r)=>{let i=Fs(t,n,r).map((e,n)=>Cc({stdioOption:e,fdNumber:n,options:t,isSync:r})),a=Pc({initialFileDescriptors:i,addProperties:e,options:t,isSync:r});return t.stdio=a.map(({stdioItems:e})=>Rc(e)),a},Cc=({stdioOption:e,fdNumber:t,options:n,isSync:r})=>{let i=Ye(t),{stdioItems:a,isStdioArray:o}=wc({stdioOption:e,fdNumber:t,options:n,optionName:i}),s=Es(a,t,i),c=a.map(e=>nc({stdioItem:e,isStdioArray:o,fdNumber:t,direction:s,isSync:r})),l=ys(c,i,s,n),u=vs(l,s);return Nc(l,u),{direction:s,objectMode:u,stdioItems:l}},wc=({stdioOption:e,fdNumber:t,options:n,optionName:r})=>{let i=Array.isArray(e)?e:[e],a=cc(n,t),o=[...Tc(i.map(e=>Dc(e,r)),a),...a],s=pc(o),c=s.length>1;return kc(s,c,r),jc(s),{stdioItems:s,isStdioArray:c}},Tc=(e,t)=>t.length>0&&Ec(e)?[]:e,Ec=e=>e.length===1&&e[0].type===`native`&&e[0].value===`inherit`,Dc=(e,t)=>$o(e)?Oc(e,t):{type:Lo(e,t),value:e,optionName:t},Oc=({value:e,input:t},n)=>(Wo(t,`${n}.input`),{type:Lo(e,n),value:e,direction:t?`input`:void 0,optionName:n}),kc=(e,t,n)=>{if(e.length===0)throw TypeError(`The \`${n}\` option must not be an empty array.`);if(t){for(let{value:t,optionName:n}of e)if(Ac.has(t))throw Error(`The \`${n}\` option must not include \`${t}\`.`)}},Ac=/* @__PURE__ */ new Set([`ignore`]),jc=e=>{for(let t of e)Mc(t)},Mc=({type:e,value:t,optionName:n})=>{if(Yo(t))throw TypeError(`The \`${n}: URL\` option must use the \`file:\` scheme.
|
|
32
|
-
For example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`);if(ts(e,t))throw TypeError(`The \`${n}: { file: '...' }\` option must be used instead of \`${n}: '...'\`.`)},Nc=(e,t)=>{if(!t)return;let n=e.find(({type:e})=>us.has(e));if(n!==void 0)throw TypeError(`The \`${n.optionName}\` option cannot use both files and transforms in objectMode.`)},Pc=({initialFileDescriptors:e,addProperties:t,options:n,isSync:r})=>{let i=[];try{for(let a of e)i.push(Fc({fileDescriptor:a,fileDescriptors:i,addProperties:t,options:n,isSync:r}));return i}catch(e){throw Lc(i),e}},Fc=({fileDescriptor:{direction:e,objectMode:t,stdioItems:n},fileDescriptors:r,addProperties:i,options:a,isSync:o})=>({direction:e,objectMode:t,stdioItems:n.map(t=>Ic({stdioItem:t,addProperties:i,direction:e,options:a,fileDescriptors:r,isSync:o}))}),Ic=({stdioItem:e,addProperties:t,direction:n,options:r,fileDescriptors:i,isSync:a})=>{let o=hc({stdioItem:e,direction:n,fileDescriptors:i,isSync:a});return o===void 0?{...e,...t[n][e.type](e,r)}:{...e,stream:o}},Lc=e=>{for(let{stdioItems:t}of e)for(let{stream:e}of t)e!==void 0&&!M(e)&&e.destroy()},Rc=e=>{if(e.length>1)return e.some(({value:e})=>e===`overlapped`)?`overlapped`:`pipe`;let[{type:t,value:n}]=e;return t===`native`?n:`pipe`},zc=(e,t)=>Sc(Wc,e,t,!0),Q=({type:e,optionName:t})=>{Hc(t,ms[e])},Bc=({optionName:e,value:t})=>(t===`overlapped`&&Hc(e,`"${t}"`),{}),Vc=e=>{let{optionName:t,value:n}=e;if(n===`pipe`&&t!==`stdin`)throw TypeError(`Only the \`stdin\` option, not \`${t}\`, can be an input pipe with synchronous methods.`);return Bc(e)},Hc=(e,t)=>{throw TypeError(`The \`${e}\` option cannot be ${t} with synchronous methods.`)},Uc={generator(){},asyncGenerator:Q,webStream:Q,nodeStream:Q,webTransform:Q,duplex:Q,asyncIterable:Q,native:Bc},Wc={input:{...Uc,native:Vc,fileUrl:({value:e})=>({contents:[j(de(e))]}),filePath:({value:{file:e}})=>({contents:[j(de(e))]}),fileNumber:Q,iterable:({value:e})=>({contents:[...e]}),string:({value:e})=>({contents:[e]}),uint8Array:({value:e})=>({contents:[e]})},output:{...Uc,fileUrl:({value:e})=>({path:e}),filePath:({value:{file:e,append:t}})=>({path:e,append:t}),fileNumber:({value:e})=>({path:e}),iterable:Q,string:Q,uint8Array:Q}},$=(e,{stripFinalNewline:t},n)=>Gc(t,n)&&e!==void 0&&!Array.isArray(e)?ra(e):e,Gc=(e,t)=>t===`all`?e[1]||e[2]:e[t],Kc=(e,t,n,r)=>e||n?void 0:Yc(t,r),qc=(e,t,n)=>n?e.flatMap(e=>Jc(e,t)):Jc(e,t),Jc=(e,t)=>{let{transform:n,final:r}=Yc(t,{});return[...n(e),...r()]},Yc=(e,t)=>(t.previousChunks=``,{transform:Xc.bind(void 0,t,e),final:Qc.bind(void 0,t)}),Xc=function*(e,t,n){if(typeof n!=`string`){yield n;return}let{previousChunks:r}=e,i=-1;for(let a=0;a<n.length;a+=1){if(n[a]!==`
|
|
33
|
-
`)continue;let o=Zc(n,a,t,e),s=n.slice(i+1,a+1-o);r.length>0&&(s=tl(r,s),r=``),yield s,i=a}i!==n.length-1&&(r=tl(r,n.slice(i+1))),e.previousChunks=r},Zc=(e,t,n,r)=>n?0:(r.isWindowsNewline=t!==0&&e[t-1]===`\r`,r.isWindowsNewline?2:1),Qc=function*({previousChunks:e}){e.length>0&&(yield e)},$c=({binary:e,preserveNewlines:t,readableObjectMode:n,state:r})=>e||t||n?void 0:{transform:el.bind(void 0,r)},el=function*({isWindowsNewline:e=!1},t){let{unixNewline:n,windowsNewline:r,LF:i,concatBytes:a}=typeof t==`string`?nl:rl;if(t.at(-1)===i){yield t;return}yield a(t,e?r:n)},tl=(e,t)=>`${e}${t}`,nl={windowsNewline:`\r
|
|
34
|
-
`,unixNewline:`
|
|
35
|
-
`,LF:`
|
|
36
|
-
`,concatBytes:tl},rl={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:(e,t)=>{let n=new Uint8Array(e.length+t.length);return n.set(e,0),n.set(t,e.length),n}},il=(e,t)=>e?void 0:al.bind(void 0,t),al=function*(e,t){if(typeof t!=`string`&&!A(t)&&!he.isBuffer(t))throw TypeError(`The \`${e}\` option's transform must use "objectMode: true" to receive as input: ${typeof t}.`);yield t},ol=(e,t)=>e?sl.bind(void 0,t):cl.bind(void 0,t),sl=function*(e,t){ll(e,t),yield t},cl=function*(e,t){if(ll(e,t),typeof t!=`string`&&!A(t))throw TypeError(`The \`${e}\` option's function must yield a string or an Uint8Array, not ${typeof t}.`);yield t},ll=(e,t)=>{if(t==null)throw TypeError(`The \`${e}\` option's function must not call \`yield ${t}\`.
|
|
37
|
-
Instead, \`yield\` should either be called with a value, or not be called at all. For example:
|
|
38
|
-
if (condition) { yield value; }`)},ul=(e,t,n)=>{if(n)return;if(e)return{transform:dl.bind(void 0,new TextEncoder)};let r=new c(t);return{transform:fl.bind(void 0,r),final:pl.bind(void 0,r)}},dl=function*(e,t){he.isBuffer(t)?yield j(t):typeof t==`string`?yield e.encode(t):yield t},fl=function*(e,t){yield A(t)?e.write(t):t},pl=function*(e){let t=e.end();t!==``&&(yield t)},ml=u(async(e,t,n,r)=>{t.currentIterable=e(...n);try{for await(let e of t.currentIterable)r.push(e)}finally{delete t.currentIterable}}),hl=async function*(e,t,n){if(n===t.length){yield e;return}let{transform:r=yl}=t[n];for await(let i of r(e))yield*hl(i,t,n+1)},gl=async function*(e){for(let[t,{final:n}]of Object.entries(e))yield*_l(n,Number(t),e)},_l=async function*(e,t,n){if(e!==void 0)for await(let r of e())yield*hl(r,n,t+1)},vl=u(async({currentIterable:e},t)=>{if(e!==void 0){await(t?e.throw(t):e.return());return}if(t)throw t}),yl=function*(e){yield e},bl=(e,t,n,r)=>{try{for(let r of e(...t))n.push(r);r()}catch(e){r(e)}},xl=(e,t)=>[...t.flatMap(t=>[...Sl(t,e,0)]),...Cl(e)],Sl=function*(e,t,n){if(n===t.length){yield e;return}let{transform:r=Tl}=t[n];for(let i of r(e))yield*Sl(i,t,n+1)},Cl=function*(e){for(let[t,{final:n}]of Object.entries(e))yield*wl(n,Number(t),e)},wl=function*(e,t,n){if(e!==void 0)for(let r of e())yield*Sl(r,n,t+1)},Tl=function*(e){yield e},El=({value:e,value:{transform:t,final:n,writableObjectMode:r,readableObjectMode:i},optionName:a},{encoding:o})=>{let s={},c=Ol(e,o,a),l=q(t),u=q(n),d=l?ml.bind(void 0,hl,s):bl.bind(void 0,Sl),f=l||u?ml.bind(void 0,gl,s):bl.bind(void 0,Cl),p=l||u?vl.bind(void 0,s):void 0;return{stream:new ve({writableObjectMode:r,writableHighWaterMark:be(r),readableObjectMode:i,readableHighWaterMark:be(i),transform(e,t,n){d([e,c,0],this,n)},flush(e){f([c],this,e)},destroy:p})}},Dl=(e,t,n,r)=>{let i=t.filter(({type:e})=>e===`generator`),a=r?i.reverse():i;for(let{value:t,optionName:r}of a){let i=Ol(t,n,r);e=xl(i,e)}return e},Ol=({transform:e,final:t,binary:n,writableObjectMode:r,readableObjectMode:i,preserveNewlines:a},o,s)=>{let c={};return[{transform:il(r,s)},ul(n,o,r),Kc(n,a,r,c),{transform:e,final:t},{transform:ol(i,s)},$c({binary:n,preserveNewlines:a,readableObjectMode:i,state:c})].filter(Boolean)},kl=(e,t)=>{for(let n of Al(e))jl(e,n,t)},Al=e=>new Set(Object.entries(e).filter(([,{direction:e}])=>e===`input`).map(([e])=>Number(e))),jl=(e,t,n)=>{let{stdioItems:r}=e[t],i=r.filter(({contents:e})=>e!==void 0);if(i.length===0)return;if(t!==0){let[{type:e,optionName:t}]=i;throw TypeError(`Only the \`stdin\` option, not \`${t}\`, can be ${ms[e]} with synchronous methods.`)}let a=i.map(({contents:e})=>e).map(e=>Ml(e,r));n.input=Fe(a)},Ml=(e,t)=>{let n=Dl(e,t,`utf8`,!0);return Nl(n),Fe(n)},Nl=e=>{let t=e.find(e=>typeof e!=`string`&&!A(e));if(t!==void 0)throw TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${t}.`)},Pl=({stdioItems:e,encoding:t,verboseInfo:n,fdNumber:r})=>r!==`all`&&ut(n,r)&&!H.has(t)&&Fl(r)&&(e.some(({type:e,value:t})=>e===`native`&&Il.has(t))||e.every(({type:e})=>J.has(e))),Fl=e=>e===1||e===2,Il=/* @__PURE__ */ new Set([`pipe`,`overlapped`]),Ll=async(e,t,n,r)=>{for await(let i of e)zl(t)||Bl(i,n,r)},Rl=(e,t,n)=>{for(let r of e)Bl(r,t,n)},zl=e=>e._readableState.pipes.length>0,Bl=(e,t,n)=>{let r=Xt(e);I({type:`output`,verboseMessage:r,fdNumber:t,verboseInfo:n})},Vl=({fileDescriptors:e,syncResult:{output:t},options:n,isMaxBuffer:r,verboseInfo:i})=>{if(t===null)return{output:Array.from({length:3})};let a={},o=/* @__PURE__ */ new Set;return{output:t.map((t,s)=>Hl({result:t,fileDescriptors:e,fdNumber:s,state:a,outputFiles:o,isMaxBuffer:r,verboseInfo:i},n)),...a}},Hl=({result:e,fileDescriptors:t,fdNumber:n,state:r,outputFiles:i,isMaxBuffer:a,verboseInfo:o},{buffer:s,encoding:c,lines:l,stripFinalNewline:u,maxBuffer:d})=>{if(e===null)return;let f=lo(e,a,d),p=j(f),{stdioItems:m,objectMode:h}=t[n],g=Ul([p],m,c,r),{serializedResult:_,finalResult:v=_}=Wl({chunks:g,objectMode:h,encoding:c,lines:l,stripFinalNewline:u,fdNumber:n});Gl({serializedResult:_,fdNumber:n,state:r,verboseInfo:o,encoding:c,stdioItems:m,objectMode:h});let y=s[n]?v:void 0;try{return r.error===void 0&&Kl(_,m,i),y}catch(e){return r.error=e,y}},Ul=(e,t,n,r)=>{try{return Dl(e,t,n,!1)}catch(t){return r.error=t,e}},Wl=({chunks:e,objectMode:t,encoding:n,lines:r,stripFinalNewline:i,fdNumber:a})=>{if(t)return{serializedResult:e};if(n===`buffer`)return{serializedResult:Fe(e)};let o=Ne(e,n);return r[a]?{serializedResult:o,finalResult:qc(o,!i[a],t)}:{serializedResult:o}},Gl=({serializedResult:e,fdNumber:t,state:n,verboseInfo:r,encoding:i,stdioItems:a,objectMode:o})=>{if(!Pl({stdioItems:a,encoding:i,verboseInfo:r,fdNumber:t}))return;let s=qc(e,!1,o);try{Rl(s,t,r)}catch(e){n.error??=e}},Kl=(e,t,n)=>{let r=t.filter(({type:e})=>us.has(e));for(let{path:t,append:i}of r){let r=typeof t==`string`?t:t.toString();i||n.has(r)?oe(t,e):(n.add(r),me(t,e))}},ql=([,e,t],n)=>{if(n.all)return e===void 0?t:t===void 0?e:Array.isArray(e)?Array.isArray(t)?[...e,...t]:[...e,$(t,n,`all`)]:Array.isArray(t)?[$(e,n,`all`),...t]:A(e)&&A(t)?Le([e,t]):`${e}${t}`},Jl=async(e,t)=>{let[n,r]=await Yl(e);return t.isForcefullyTerminated??=!1,[n,r]},Yl=async e=>{let[t,n]=await Promise.allSettled([E(e,`spawn`),E(e,`exit`)]);return t.status===`rejected`?[]:n.status===`rejected`?Xl(e):n.value},Xl=async e=>{try{return await E(e,`exit`)}catch{return Xl(e)}},Zl=async e=>{let[t,n]=await e;if(!Ql(t,n)&&$l(t,n))throw new L;return[t,n]},Ql=(e,t)=>e===void 0&&t===void 0,$l=(e,t)=>e!==0||t!==null,eu=({error:e,status:t,signal:n,output:r},{maxBuffer:i})=>{let a=tu(e,t,n);return{resultError:a,exitCode:t,signal:n,timedOut:a?.code===`ETIMEDOUT`,isMaxBuffer:co(a,r,i)}},tu=(e,t,n)=>e===void 0?$l(t,n)?new L:void 0:e,nu=(e,t,n)=>{let{file:r,commandArguments:i,command:a,escapedCommand:o,startTime:s,verboseInfo:c,options:l,fileDescriptors:u}=ru(e,t,n),d=su({file:r,commandArguments:i,options:l,command:a,escapedCommand:o,verboseInfo:c,fileDescriptors:u,startTime:s});return Io(d,c,l)},ru=(e,t,n)=>{let{command:r,escapedCommand:i,startTime:a,verboseInfo:o}=on(e,t,n),s=iu(n),{file:c,commandArguments:l,options:u}=$i(e,t,s);return au(u),{file:c,commandArguments:l,command:r,escapedCommand:i,startTime:a,verboseInfo:o,options:u,fileDescriptors:zc(u,o)}},iu=e=>e.node&&!e.ipc?{...e,ipc:!1}:e,au=({ipc:e,ipcInput:t,detached:n,cancelSignal:r,killDescendants:i})=>{t&&ou(`ipcInput`),e&&ou(`ipc: true`),n&&ou(`detached: true`),i&&ou(`killDescendants: true`),r&&ou(`cancelSignal`)},ou=e=>{throw TypeError(`The "${e}" option cannot be used with synchronous methods.`)},su=({file:e,commandArguments:t,options:n,command:r,escapedCommand:i,verboseInfo:a,fileDescriptors:o,startTime:s})=>{let c=cu({file:e,commandArguments:t,options:n,command:r,escapedCommand:i,fileDescriptors:o,startTime:s});if(c.failed)return c;let{resultError:l,exitCode:u,signal:d,timedOut:f,isMaxBuffer:p}=eu(c,n),{output:m,error:h=l}=Vl({fileDescriptors:o,syncResult:c,options:n,isMaxBuffer:p,verboseInfo:a}),g=m.map((e,t)=>$(e,n,t)),_=$(ql(m,n),n,`all`);return uu({error:h,exitCode:u,signal:d,timedOut:f,isMaxBuffer:p,stdio:g,all:_,options:n,command:r,escapedCommand:i,startTime:s})},cu=({file:e,commandArguments:t,options:n,command:r,escapedCommand:i,fileDescriptors:a,startTime:o})=>{try{kl(a,n);let r=lu(n);return s(...na(e,t,r))}catch(e){return bo({error:e,command:r,escapedCommand:i,fileDescriptors:a,options:n,startTime:o,isSync:!0})}},lu=({encoding:e,maxBuffer:t,...n})=>({...n,encoding:`buffer`,maxBuffer:uo(t)}),uu=({error:e,exitCode:t,signal:n,timedOut:r,isMaxBuffer:i,stdio:a,all:o,options:s,command:c,escapedCommand:l,startTime:u})=>e===void 0?yo({command:c,escapedCommand:l,stdio:a,all:o,ipcOutput:[],options:s,startTime:u}):xo({error:e,command:c,escapedCommand:l,timedOut:r,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:i,isForcefullyTerminated:!1,exitCode:t,signal:n,stdio:a,all:o,ipcOutput:[],options:s,startTime:u,isSync:!0}),du=Symbol(`internalGetOneMessageOptions`),fu=({anyProcess:e,channel:t,isSubprocess:n,ipc:r},i={})=>{let{reference:a=!0,filter:o}=i,{signal:s}=i[du]??{};return $n({methodName:`getOneMessage`,isSubprocess:n,ipc:r,isConnected:kr(e)}),pu({anyProcess:e,channel:t,isSubprocess:n,filter:o,reference:a,signal:s})},pu=async({anyProcess:e,channel:t,isSubprocess:n,filter:r,reference:i,signal:a})=>{_r(t,i);let o=Er(e,t,n),s=new AbortController;mu(a,s);try{return await Promise.race([hu(o,r,s),gu(o,n,s),_u(o,n,s)])}catch(t){throw hr(e),t}finally{s.abort(),yr(t,i)}},mu=(e,t)=>{if(e!==void 0){if(e.aborted){t.abort();return}e.addEventListener(`abort`,()=>{t.abort()},{once:!0,signal:t.signal})}},hu=async(e,t,{signal:n})=>{if(t===void 0){let[t]=await E(e,`message`,{signal:n});return t}for await(let[r]of ne(e,`message`,{signal:n}))if(t(r))return r},gu=async(e,t,{signal:n})=>{await E(e,`disconnect`,{signal:n}),nr(t)},_u=async(e,t,{signal:n})=>{let[r]=await E(e,`strict:error`,{signal:n});throw ir(r,t)},vu=Symbol(`internalGetEachMessageOptions`),yu=(e,t={})=>{let{reference:n=!0}=t,{signal:r,shouldAwait:i=!e.isSubprocess}=t[vu]??{};return bu({...e,shouldAwait:i,reference:n,signal:r})},bu=({anyProcess:e,waitProcess:t=e,channel:n,isSubprocess:r,ipc:i,shouldAwait:a,reference:o,signal:s})=>{$n({methodName:`getEachMessage`,isSubprocess:r,ipc:i,isConnected:kr(e)}),_r(n,o);let c=Er(e,n,r),l=new AbortController,u={};return xu(s,l),Su(e,c,l),Cu({ipcEmitter:c,isSubprocess:r,controller:l,state:u}),wu({anyProcess:e,waitProcess:t,channel:n,ipcEmitter:c,isSubprocess:r,shouldAwait:a,controller:l,state:u,reference:o})},xu=(e,t)=>{if(e!==void 0){if(e.aborted){t.abort();return}e.addEventListener(`abort`,()=>{t.abort()},{once:!0,signal:t.signal})}},Su=async(e,t,n)=>{try{await E(t,`disconnect`,{signal:n.signal}),n.abort()}catch{}},Cu=async({ipcEmitter:e,isSubprocess:t,controller:n,state:r})=>{try{let[i]=await E(e,`strict:error`,{signal:n.signal});r.error=ir(i,t),n.abort()}catch{}},wu=async function*({anyProcess:e,waitProcess:t,channel:n,ipcEmitter:r,isSubprocess:i,shouldAwait:a,controller:o,state:s,reference:c}){try{for await(let[e]of ne(r,`message`,{signal:o.signal}))Tu(s),yield e}catch{Tu(s)}finally{o.abort(),yr(n,c),i||hr(e),a&&await t}},Tu=({error:e})=>{if(e)throw e},Eu=(e,t,{ipc:n})=>{Object.assign(e,Ou(t,!1,n,e))},Du=()=>{let e=h,t=h.channel!==void 0;return{...Ou(e,!0,t),getCancelSignal:ei.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:!0,ipc:t})}},Ou=(e,t,n,r=e)=>({sendMessage:Jr.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:n}),getOneMessage:fu.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:n}),getEachMessage:yu.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:n,waitProcess:r})}),ku=({error:e,command:t,escapedCommand:n,fileDescriptors:r,options:a,startTime:o,verboseInfo:s})=>{Lc(r);let c=new i,l=Au(c,r),u=bo({error:e,command:t,escapedCommand:n,fileDescriptors:r,options:a,startTime:o,isSync:!1});return{subprocess:c,promise:zu(u,s,a),all:a.all?l:void 0,convertedStreams:{readable:Mu,writable:Nu,duplex:Pu,readableStream:Fu,writableStream:Iu,transformStream:Lu,iterable:Ru,[Symbol.asyncIterator]:Ru}}},Au=(e,t)=>{let n=ju(),r=ju(),i=ju(),a=Array.from({length:t.length-3},ju),o=ju(),s=[n,r,i,...a];return Object.assign(e,{stdin:n,stdout:r,stderr:i,stdio:s}),o},ju=()=>{let e=new _e;return e.end(),e},Mu=()=>new O({read(){}}),Nu=()=>new ye({write(){}}),Pu=()=>new ge({read(){},write(){}}),Fu=()=>O.toWeb(Mu()),Iu=()=>ye.toWeb(Nu()),Lu=()=>ge.toWeb(Pu()),Ru=async function*(){},zu=async(e,t,n)=>Io(e,t,n),Bu=(e,t)=>Sc(Uu,e,t,!1),Vu=({type:e,optionName:t})=>{throw TypeError(`The \`${t}\` option cannot be ${ms[e]}.`)},Hu={fileNumber:Vu,generator:El,asyncGenerator:El,nodeStream:({value:e})=>({stream:e}),webTransform({value:{transform:e,writableObjectMode:t,readableObjectMode:n}}){let r=t||n;return{stream:ge.fromWeb(e,{objectMode:r})}},duplex:({value:{transform:e}})=>({stream:e}),native(){}},Uu={input:{...Hu,fileUrl:({value:e})=>({stream:ce(e)}),filePath:({value:{file:e}})=>({stream:ce(e)}),webStream:({value:e})=>({stream:O.fromWeb(e)}),iterable:({value:e})=>({stream:O.from(e)}),asyncIterable:({value:e})=>({stream:O.from(e)}),string:({value:e})=>({stream:O.from(e)}),uint8Array:({value:e})=>({stream:O.from(he.from(e))})},output:{...Hu,fileUrl:({value:e})=>({stream:le(e)}),filePath:({value:{file:e,append:t}})=>({stream:le(e,t?{flags:`a`}:{})}),webStream:({value:e})=>({stream:ye.fromWeb(e)}),iterable:Vu,asyncIterable:Vu,string:Vu,uint8Array:Vu}};function Wu(e){if(!Array.isArray(e))throw TypeError(`Expected an array, got \`${typeof e}\`.`);for(let t of e)Xu(t);let t=e.some(({readableObjectMode:e})=>e),n=Gu(e,t),r=new Ku({objectMode:t,writableHighWaterMark:n,readableHighWaterMark:n});for(let t of e)r.add(t);return r}const Gu=(e,t)=>{if(e.length===0)return be(t);let n=e.filter(({readableObjectMode:e})=>e===t).map(({readableHighWaterMark:e})=>e);return Math.max(...n)};var Ku=class extends _e{#e=/* @__PURE__ */ new Set([]);#t=/* @__PURE__ */ new Set([]);#n=/* @__PURE__ */ new Set([]);#r;#i=Symbol(`unpipe`);#a=/* @__PURE__ */ new WeakMap;add(e){if(Xu(e),this.#e.has(e))return;this.#e.add(e),this.#r??=qu(this,this.#e,this.#i);let t=Zu({passThroughStream:this,stream:e,streams:this.#e,ended:this.#t,aborted:this.#n,onFinished:this.#r,unpipeEvent:this.#i});this.#a.set(e,t),e.pipe(this,{end:!1})}async remove(e){if(Xu(e),!this.#e.has(e))return!1;let t=this.#a.get(e);return t!==void 0&&(this.#a.delete(e),e.unpipe(this),await t,!0)}};const qu=async(e,t,n)=>{sd(e,cd);let r=new AbortController;try{await Promise.race([Ju(e,r),Yu(e,t,n,r)])}finally{r.abort(),sd(e,-cd)}},Ju=async(e,{signal:t})=>{try{await D(e,{signal:t,cleanup:!0})}catch(t){throw nd(e,t),t}},Yu=async(e,t,n,{signal:r})=>{for await(let[i]of ne(e,`unpipe`,{signal:r}))t.has(i)&&i.emit(n)},Xu=e=>{if(typeof e?.pipe!=`function`)throw TypeError(`Expected a readable stream, got: \`${typeof e}\`.`)},Zu=async({passThroughStream:e,stream:t,streams:n,ended:r,aborted:i,onFinished:a,unpipeEvent:o})=>{sd(e,ld);let s=new AbortController;try{await Promise.race([Qu(a,t,s),$u({passThroughStream:e,stream:t,streams:n,ended:r,aborted:i,controller:s}),ed({stream:t,streams:n,ended:r,aborted:i,unpipeEvent:o,controller:s})])}finally{s.abort(),sd(e,-ld)}n.size>0&&n.size===r.size+i.size&&(r.size===0&&i.size>0?id(e):td(e))},Qu=async(e,t,{signal:n})=>{try{await e,n.aborted||id(t)}catch(e){n.aborted||nd(t,e)}},$u=async({passThroughStream:e,stream:t,streams:n,ended:r,aborted:i,controller:{signal:a}})=>{try{await D(t,{signal:a,cleanup:!0,readable:!0,writable:!1}),n.has(t)&&r.add(t)}catch(r){if(a.aborted||!n.has(t))return;rd(r)?i.add(t):ad(e,r)}},ed=async({stream:e,streams:t,ended:n,aborted:r,unpipeEvent:i,controller:{signal:a}})=>{if(await E(e,i,{signal:a}),!e.readable)return E(a,`abort`,{signal:a});t.delete(e),n.delete(e),r.delete(e)},td=e=>{e.writable&&e.end()},nd=(e,t)=>{rd(t)?id(e):ad(e,t)},rd=e=>e?.code===`ERR_STREAM_PREMATURE_CLOSE`,id=e=>{(e.readable||e.writable)&&e.destroy()},ad=(e,t)=>{e.destroyed||(e.once(`error`,od),e.destroy(t))},od=()=>{},sd=(e,t)=>{let n=e.getMaxListeners();n!==0&&n!==1/0&&e.setMaxListeners(n+t)},cd=2,ld=1,ud=(e,t)=>{e.pipe(t),dd(e,t),pd(e,t)},dd=async(e,t)=>{if(!(M(e)||M(t))){try{await D(e,{cleanup:!0,readable:!0,writable:!1})}catch{}fd(t)}},fd=e=>{e.writable&&e.end()},pd=async(e,t)=>{if(!(M(e)||M(t))){try{await D(t,{cleanup:!0,readable:!1,writable:!0})}catch{}md(e)}},md=e=>{e.readable&&e.destroy()},hd=(e,t,n)=>{let r=/* @__PURE__ */ new Map;for(let[i,{stdioItems:a,direction:o}]of Object.entries(t)){let t=a.filter(({type:e})=>J.has(e));for(let{stream:n}of t)gd(e,n,o,i);let s=a.filter(({type:e})=>!J.has(e));for(let{stream:t}of s)vd({subprocess:e,stream:t,direction:o,fdNumber:i,pipeGroups:r,controller:n})}for(let[e,t]of r){let n=t.length===1?t[0]:Wu(t);ud(n,e)}},gd=(e,t,n,r)=>{n===`output`?ud(e.stdio[r],t):ud(t,e.stdio[r]);let i=_d[r];i!==void 0&&(e[i]=t),e.stdio[r]=t},_d=[`stdin`,`stdout`,`stderr`],vd=({subprocess:e,stream:t,direction:n,fdNumber:r,pipeGroups:i,controller:a})=>{if(t===void 0)return;yd(t,a);let[o,s]=n===`output`?[t,e.stdio[r]]:[e.stdio[r],t],c=i.get(o)??[];i.set(o,[...c,s])},yd=(e,{signal:t})=>{M(e)&&gr(e,bd,t)},bd=2,xd=h.platform===`win32`,Sd=e=>e.killDescendants&&!xd?{...e,detached:!0}:e,Cd=(e,{killDescendants:t})=>t?(xd?Td:wd).bind(void 0,e):e.kill.bind(e),wd=(e,t)=>{if(e.pid===void 0)return!1;try{return h.kill(-e.pid,t)}catch{return e.kill(t)}},Td=(e,t)=>{if(e.pid===void 0)return!1;let n=Ed();return n===void 0?e.kill(t):(a(n,[`/pid`,`${e.pid}`,`/T`,`/F`],n=>{n&&e.kill(t)}),!0)},Ed=()=>{let e=[h.env.SystemRoot,h.env.windir].find(e=>e&&Dd(e));return e===void 0?void 0:xe.join(e,`System32`,`taskkill.exe`)},Dd=e=>{let{root:t}=xe.parse(e);return/^[a-z]:[/\\]/i.test(t)},Od=(e,{cleanup:t,detached:r},{signal:i})=>{if(!t||r)return;let a=n(()=>{e()});T(i,()=>{a()})},kd=()=>({readableDestroy:/* @__PURE__ */ new WeakMap,writableFinal:/* @__PURE__ */ new WeakMap,writableDestroy:/* @__PURE__ */ new WeakMap}),Ad=(e,t,n)=>{let r=e[n];r.has(t)||r.set(t,[]);let i=r.get(t),a=B();return i.push(a),{resolve:a.resolve.bind(a),promises:i}},jd=async({resolve:e,promises:t},n)=>{e();let[r]=await Promise.race([Promise.allSettled([!0,n]),Promise.all([!1,...t])]);return!r},Md=({subprocessStdout:e,subprocess:t,binary:n,shouldEncode:r,encoding:i,preserveNewlines:a})=>{let o=new AbortController;return Nd(t,o),Id({stream:e,controller:o,binary:n,shouldEncode:!e.readableObjectMode&&r,encoding:i,shouldSplit:!e.readableObjectMode,preserveNewlines:a})},Nd=async(e,t)=>{try{await e}catch{}finally{t.abort()}},Pd=({stream:e,onStreamEnd:t,lines:n,encoding:r,stripFinalNewline:i,allMixed:a})=>{let o=new AbortController;Fd(t,o,e);let s=e.readableObjectMode&&!a;return Id({stream:e,controller:o,binary:r===`buffer`,shouldEncode:!s,encoding:r,shouldSplit:!s&&n,preserveNewlines:!i})},Fd=async(e,t,n)=>{try{await e}catch{n.destroy()}finally{t.abort()}},Id=({stream:e,controller:t,binary:n,shouldEncode:r,encoding:i,shouldSplit:a,preserveNewlines:o})=>{let s=ne(e,`data`,{signal:t.signal,highWaterMark:Rd,highWatermark:Rd});return zd({onStdoutChunk:s,controller:t,binary:n,shouldEncode:r,encoding:i,shouldSplit:a,preserveNewlines:o})},Ld=be(!0),Rd=Ld,zd=async function*({onStdoutChunk:e,controller:t,binary:n,shouldEncode:r,encoding:i,shouldSplit:a,preserveNewlines:o}){let s=Bd({binary:n,shouldEncode:r,encoding:i,shouldSplit:a,preserveNewlines:o});try{for await(let[t]of e)yield*Sl(t,s,0)}catch(e){if(!t.signal.aborted)throw e}finally{yield*Cl(s)}},Bd=({binary:e,shouldEncode:t,encoding:n,shouldSplit:r,preserveNewlines:i})=>[ul(e,n,!t),Kc(e,i,!r,{})].filter(Boolean),Vd=(e,t,{from:n,binary:r=!1,preserveNewlines:i=!1}={})=>{let a=r||H.has(t),o=Js(e,n),s=Md({subprocessStdout:o,subprocess:e,binary:a,shouldEncode:!0,encoding:t,preserveNewlines:i});return Hd(s,o,e)},Hd=async function*(e,t,n){try{yield*e}finally{t.readable&&t.destroy(),await n}},Ud=async(e,t,n,{isSameDirection:r,stopOnExit:i=!1}={})=>{let a=Wd(e,n),o=new AbortController;try{await Promise.race([...i?[n.exitPromise]:[],D(e,{cleanup:!0,signal:o.signal})])}catch(e){a.stdinCleanedUp||qd(e,t,n,r)}finally{o.abort()}},Wd=(e,{originalStreams:t,subprocess:n})=>{let[r]=t,i={stdinCleanedUp:!1};return e===r&&Gd(e,n,i),i},Gd=(e,t,n)=>{let{_destroy:r}=e;e._destroy=(...i)=>{Kd(t,n),r.call(e,...i)}},Kd=({exitCode:e,signalCode:t},n)=>{(e!==null||t!==null)&&(n.stdinCleanedUp=!0)},qd=(e,t,n,r)=>{if(!Jd(e,t,n,r))throw e},Jd=(e,t,n,r=!0)=>n.propagating?Zd(e)||Xd(e):(n.propagating=!0,Yd(n,t)===r?Zd(e):Xd(e)),Yd=({fileDescriptors:e},t)=>t!==`all`&&e[t].direction===`input`,Xd=e=>e?.code===`ERR_STREAM_PREMATURE_CLOSE`,Zd=e=>e?.code===`EPIPE`,Qd=async e=>{if(e!==void 0)try{await ef(e)}catch{}},$d=async e=>{if(e!==void 0)try{await tf(e)}catch{}},ef=async e=>{await D(e,{cleanup:!0,readable:!1,writable:!0})},tf=async e=>{await D(e,{cleanup:!0,readable:!0,writable:!1})},nf=async(e,t)=>{if(await e,t)throw t},rf=(e,t,n)=>{n&&!Xd(n)?e.destroy(n):t&&e.destroy()},af=({subprocess:e,concurrentStreams:t,encoding:n},{from:r,binary:i=!0,preserveNewlines:a=!0}={})=>{let o=i||H.has(n),{subprocessStdout:s,waitReadableDestroy:c}=of(e,r,t),{readableEncoding:l,readableObjectMode:d,readableHighWaterMark:f}=sf(s,o),{read:p,onStdoutDataDone:m}=cf({subprocessStdout:s,subprocess:e,binary:o,encoding:n,preserveNewlines:a}),h=new O({read:p,destroy:u(ff.bind(void 0,{subprocessStdout:s,subprocess:e,waitReadableDestroy:c})),highWaterMark:f,objectMode:d,encoding:l});return uf({subprocessStdout:s,onStdoutDataDone:m,readable:h,subprocess:e}),h},of=(e,t,n)=>{let r=Js(e,t);return{subprocessStdout:r,waitReadableDestroy:Ad(n,r,`readableDestroy`)}},sf=({readableEncoding:e,readableObjectMode:t,readableHighWaterMark:n},r)=>r?{readableEncoding:e,readableObjectMode:t,readableHighWaterMark:n}:{readableEncoding:e,readableObjectMode:!0,readableHighWaterMark:Ld},cf=({subprocessStdout:e,subprocess:t,binary:n,encoding:r,preserveNewlines:i})=>{let a=B(),o=Md({subprocessStdout:e,subprocess:t,binary:n,shouldEncode:!n,encoding:r,preserveNewlines:i});return{read(){lf(this,o,a)},onStdoutDataDone:a}},lf=async(e,t,n)=>{try{let{value:r,done:i}=await t.next();i?n.resolve():e.push(r)}catch{}},uf=async({subprocessStdout:e,onStdoutDataDone:t,readable:n,subprocess:r,subprocessStdin:i})=>{try{await tf(e),await r,await Qd(i),await t,n.readable&&n.push(null)}catch(e){await Qd(i),pf(n,await df(r,e))}},df=async(e,t)=>{if(t.code!==`ERR_STREAM_PREMATURE_CLOSE`)return t;try{await e}catch(e){return e}return t},ff=async({subprocessStdout:e,subprocess:t,waitReadableDestroy:n},r)=>{await jd(n,t)&&(pf(e,r),await nf(t,r))},pf=(e,t)=>{rf(e,e.readable,t)},mf=(e,t)=>O.toWeb(e.readable(t)),hf=(e,t)=>ye.toWeb(e.writable(t)),gf=(e,t)=>ge.toWeb(e.duplex(t)),_f=({source:e,sourcePromise:t,boundOptions:n,createNested:r},...i)=>{let a=rn(),{destination:o,destinationStream:s,destinationError:c,from:l,unpipeSignal:u}=vf(n,r,i),{sourceStream:d,sourceError:f}=xf(e,l),{options:p,fileDescriptors:m}=X.get(e);return{sourcePromise:t,sourceStream:d,sourceOptions:p,sourceError:f,destination:o,destinationStream:s,destinationError:c,unpipeSignal:u,fileDescriptors:m,startTime:a}},vf=(e,t,n)=>{try{let{destination:r,pipeOptions:{from:i,to:a,unpipeSignal:o}={}}=yf(e,t,...n);return{destination:r,destinationStream:qs(r,a),from:i,unpipeSignal:o}}catch(e){return{destinationError:e}}},yf=(e,t,n,...r)=>{if(Array.isArray(n))return{destination:t(bf,e)(n,...r),pipeOptions:e};if(typeof n==`string`||n instanceof URL||we(n)){if(Object.keys(e).length>0)throw TypeError(`Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).`);let[i,a,o]=Ee(n,...r);return{destination:t(bf)(i,a,o),pipeOptions:o}}if(X.has(n)){if(Object.keys(e).length>0)throw TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:n,pipeOptions:r[0]}}throw TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${n}`)},bf=({options:e})=>({options:{...e,stdin:`pipe`,piped:!0}}),xf=(e,t)=>{try{return{sourceStream:Js(e,t)}}catch(e){return{sourceError:e}}},Sf=({sourceStream:e,sourceError:t,destinationStream:n,destinationError:r,fileDescriptors:i,sourceOptions:a,startTime:o})=>{let s=Cf({sourceStream:e,sourceError:t,destinationStream:n,destinationError:r});if(s!==void 0)throw wf({error:s,fileDescriptors:i,sourceOptions:a,startTime:o})},Cf=({sourceStream:e,sourceError:t,destinationStream:n,destinationError:r})=>{if(t!==void 0&&r!==void 0)return r;if(r!==void 0)return md(e),r;if(t!==void 0)return fd(n),t},wf=({error:e,fileDescriptors:t,sourceOptions:n,startTime:r})=>bo({error:e,command:Tf,escapedCommand:Tf,fileDescriptors:t,options:n,startTime:r,isSync:!1}),Tf=`source.pipe(destination)`,Ef=async e=>{let[{status:t,reason:n,value:r=n},{status:i,reason:a,value:o=a}]=await e;if(o.pipedFrom.includes(r)||o.pipedFrom.push(r),i===`rejected`)throw o;if(t===`rejected`)throw r;return o},Df=(e,t,n)=>{let r=jf.has(t)?kf(e,t):Of(e,t);return gr(e,Mf,n.signal),gr(t,Nf,n.signal),Af(t),r},Of=(e,t)=>{let n=Wu([e]);return ud(n,t),jf.set(t,n),n},kf=(e,t)=>{let n=jf.get(t);return n.add(e),n},Af=async e=>{try{await D(e,{cleanup:!0,readable:!1,writable:!0})}catch{}jf.delete(e)},jf=/* @__PURE__ */ new WeakMap,Mf=2,Nf=1,Pf=(e,t)=>e===void 0?[]:[Ff(e,t)],Ff=async(e,{sourceStream:t,mergedStream:n,fileDescriptors:r,sourceOptions:i,startTime:a})=>{throw await l(e,t),await n.remove(t),wf({error:/* @__PURE__ */ Error("Pipe canceled by `unpipeSignal` option."),fileDescriptors:r,sourceOptions:i,startTime:a})},If=(e,...t)=>{if(k(t[0]))return If.bind(void 0,{...e,boundOptions:{...e.boundOptions,...t[0]}});let{destination:n,...r}=_f(e,...t),i=new AbortController,a=Zf({...r,destination:n,pipeFailureController:i});return a.pipe=If.bind(void 0,{...e,source:n,sourcePromise:a,boundOptions:{}}),Lf(a,n,i.signal),a},Lf=(e,t,n)=>{t!==void 0&&(Rf(e,t),Uf(e,t,n))},Rf=(e,t)=>{let n=X.get(t);X.set(e,n),e.stdio=t.stdio,e.all=t.all;let{options:{encoding:r}}=n,i=kd();e[Symbol.asyncIterator]=Vd.bind(void 0,e,r,{}),e.iterable=Vd.bind(void 0,e,r),e.readable=Vf.bind(void 0,e,{subprocess:e,concurrentStreams:i,encoding:r}),e.readableStream=mf.bind(void 0,e),zf(e,t)},zf=(e,t)=>{if(t.all===void 0){e.all=void 0;return}Object.defineProperty(e,"all",{get(){Bf(e,t.all);let n=e.readable({from:`all`});return Bf(e,n),n},enumerable:!0,configurable:!0})},Bf=(e,t)=>{Object.defineProperty(e,"all",{value:t,writable:!0,enumerable:!0,configurable:!0})},Vf=(e,t,...n)=>{let r=af(t,...n);return Hf(e,r),r},Hf=async(e,t)=>{try{await e}catch(e){t.destroy(e)}},Uf=(e,t,n)=>{e.sendMessage=t.sendMessage,e.getOneMessage=Wf.bind(void 0,t,n),e.getEachMessage=qf.bind(void 0,e,t,n)},Wf=(e,t,...n)=>{let r=new AbortController,i=e.getOneMessage(...Yf(n,r.signal,du));return Gf(t,i,r)},Gf=async(e,t,n)=>{try{return await Promise.race([t,Kf(e,n.signal)])}finally{n.abort()}},Kf=(e,t)=>new Promise((n,r)=>{if(e.aborted){r(e.reason);return}e.addEventListener(`abort`,()=>{r(e.reason)},{once:!0,signal:t})}),qf=(e,t,n,...r)=>{let i=new AbortController,a=t.getEachMessage(...Yf(r,i.signal,vu));return Xf(n,i),Jf(e,a,i)},Jf=async function*(e,t,n){try{yield*t}finally{n.abort(),await e}},Yf=(e,t,n)=>{if(e[0]===null)return e;let[r]=e;return[{...r,[n]:{signal:t,shouldAwait:!1}}]},Xf=(e,t)=>{if(e.aborted){t.abort();return}e.addEventListener(`abort`,()=>{t.abort()},{once:!0,signal:t.signal})},Zf=async({sourcePromise:e,sourceStream:t,sourceOptions:n,sourceError:r,destination:i,destinationStream:a,destinationError:o,unpipeSignal:s,fileDescriptors:c,startTime:l,pipeFailureController:u})=>{let d=new AbortController;try{let u=Qf(e,i);Sf({sourceStream:t,sourceError:r,destinationStream:a,destinationError:o,fileDescriptors:c,sourceOptions:n,startTime:l});let f=Df(t,a,d);return await Promise.race([Ef(u),...Pf(s,{sourceStream:t,mergedStream:f,sourceOptions:n,fileDescriptors:c,startTime:l})])}catch(e){throw u.abort(e),e}finally{d.abort()}},Qf=(e,t)=>Promise.allSettled([e,t]),$f=async({stream:e,onStreamEnd:t,fdNumber:n,encoding:r,buffer:i,maxBuffer:a,lines:o,allMixed:s,stripFinalNewline:c,verboseInfo:l,streamInfo:u})=>{let d=ep({stream:e,onStreamEnd:t,fdNumber:n,encoding:r,allMixed:s,verboseInfo:l,streamInfo:u});if(!i){await Promise.all([tp(e),d]);return}let f=Gc(c,n),p=Pd({stream:e,onStreamEnd:t,lines:o,encoding:r,stripFinalNewline:f,allMixed:s}),[m]=await Promise.all([np({stream:e,iterable:p,fdNumber:n,encoding:r,maxBuffer:a,lines:o}),d]);return m},ep=async({stream:e,onStreamEnd:t,fdNumber:n,encoding:r,allMixed:i,verboseInfo:a,streamInfo:{fileDescriptors:o}})=>{if(!Pl({stdioItems:o[n]?.stdioItems,encoding:r,verboseInfo:a,fdNumber:n}))return;let s=Pd({stream:e,onStreamEnd:t,lines:!0,encoding:r,stripFinalNewline:!0,allMixed:i});await Ll(s,e,n,a)},tp=async e=>{await ee(),e.readableFlowing===null&&e.resume()},np=async({stream:e,stream:{readableObjectMode:t},iterable:n,fdNumber:r,encoding:i,maxBuffer:a,lines:o})=>{try{return t||o?await Ia(n,{maxBuffer:a}):i===`buffer`?new Uint8Array(await Ra(n,{maxBuffer:a})):await $a(n,{maxBuffer:a})}catch(n){return ip(ro({error:n,stream:e,readableObjectMode:t,lines:o,encoding:i,fdNumber:r}))}},rp=async e=>{try{return await e}catch(e){return ip(e)}},ip=({bufferedData:e})=>Oe(e)?new Uint8Array(e):e,ap=({subprocess:e,encoding:t,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:a,verboseInfo:o,streamInfo:s})=>e.stdio.map((e,c)=>op({stream:e,fdNumber:c,encoding:t,buffer:n[c],maxBuffer:r[c],lines:i[c],allMixed:!1,stripFinalNewline:a,verboseInfo:o,streamInfo:s})),op=async({stream:e,fdNumber:t,encoding:n,buffer:r,maxBuffer:i,lines:a,allMixed:o,stripFinalNewline:s,verboseInfo:c,streamInfo:l})=>{if(!e)return;let u=Ud(e,t,l);if(Yd(l,t)){await u;return}let[d]=await Promise.all([$f({stream:e,onStreamEnd:u,fdNumber:t,encoding:n,buffer:r,maxBuffer:i,lines:a,allMixed:o,stripFinalNewline:s,verboseInfo:c,streamInfo:l}),u]);return d},sp=({stdout:e,stderr:t},{all:n})=>n&&(e||t)?Wu([e,t].filter(Boolean)):void 0,cp=({subprocess:e,all:t,encoding:n,buffer:r,maxBuffer:i,lines:a,stripFinalNewline:o,verboseInfo:s,streamInfo:c})=>op({...lp(e,t,r),fdNumber:`all`,encoding:n,maxBuffer:i[1]+i[2],lines:a[1]||a[2],allMixed:up(e,t),stripFinalNewline:o,verboseInfo:s,streamInfo:c}),lp=({stdout:e,stderr:t},n,[,r,i])=>{let a=r||i;return a?r?i?{stream:n,buffer:a}:{stream:e,buffer:a}:{stream:t,buffer:a}:{stream:n,buffer:a}},up=({stdout:e,stderr:t},n)=>n&&e&&t&&e.readableObjectMode!==t.readableObjectMode,dp=e=>ut(e,`ipc`),fp=(e,t)=>{let n=Xt(e);I({type:`ipc`,verboseMessage:n,fdNumber:`ipc`,verboseInfo:t})},pp=async({subprocess:e,buffer:t,maxBuffer:n,ipc:r,ipcOutput:i,verboseInfo:a})=>{if(!r)return i;let o=dp(a),s=P(t,`ipc`),c=P(n,`ipc`);for await(let t of bu({anyProcess:e,channel:e.channel,isSubprocess:!1,ipc:r,shouldAwait:!1,reference:!0}))s&&(ao(e,i,c),i.push(t)),o&&fp(t,a);return i},mp=async(e,t)=>(await Promise.allSettled([e]),t),hp=async({subprocess:e,kill:t,all:n,options:{encoding:r,buffer:i,maxBuffer:a,lines:o,timeoutDuration:s,cancelSignal:c,gracefulCancel:l,forceKillAfterDelay:u,stripFinalNewline:d,ipc:f,ipcInput:p},context:m,verboseInfo:h,fileDescriptors:g,originalStreams:_,onInternalError:v,controller:y})=>{let b=Jl(e,m),x={originalStreams:_,fileDescriptors:g,subprocess:e,exitPromise:b,propagating:!1},S=ap({subprocess:e,encoding:r,buffer:i,maxBuffer:a,lines:o,stripFinalNewline:d,verboseInfo:h,streamInfo:x}),ee=cp({subprocess:e,all:n,encoding:r,buffer:i,maxBuffer:a,lines:o,stripFinalNewline:d,verboseInfo:h,streamInfo:x}),C=[],w=pp({subprocess:e,buffer:i,maxBuffer:a,ipc:f,ipcOutput:C,verboseInfo:h}),te=gp(_,e,x),T=_p(g,x);try{return await Promise.race([Promise.all([{},Zl(b),Promise.all(S),ee,w,vi(e,p,f),...te,...T]),v,vp(e,y),...fi(t,s,m,y),...Zn({kill:t,cancelSignal:c,gracefulCancel:l,context:m,controller:y}),...ci({subprocess:e,kill:t,cancelSignal:c,gracefulCancel:l,forceKillAfterDelay:u,context:m,controller:y})])}catch(e){return m.terminationReason??=`other`,Promise.all([{error:e},b,Promise.all(S.map(e=>rp(e))),rp(ee),mp(w,C),Promise.allSettled(te),Promise.allSettled(T)])}},gp=(e,t,n)=>e.map((e,r)=>e===t.stdio[r]?void 0:Ud(e,r,n)),_p=(e,t)=>e.flatMap(({stdioItems:e},n)=>e.filter(({value:e,stream:t=e})=>G(t,{checkOpen:!1})&&!M(t)).map(({type:e,value:r,stream:i=r})=>Ud(i,n,t,{isSameDirection:J.has(e),stopOnExit:e===`native`}))),vp=async(e,{signal:t})=>{let[n]=await E(e,`error`,{signal:t});throw n},yp=({subprocess:e,concurrentStreams:t},{to:n}={})=>{let{subprocessStdin:r,waitWritableFinal:i,waitWritableDestroy:a}=bp(e,n,t),o=new ye({...xp(r,e,i),destroy:u(Dp.bind(void 0,{subprocessStdin:r,subprocess:e,waitWritableFinal:i,waitWritableDestroy:a})),highWaterMark:r.writableHighWaterMark,objectMode:r.writableObjectMode});return wp(r,o,void 0,e),o},bp=(e,t,n)=>{let r=qs(e,t);return{subprocessStdin:r,waitWritableFinal:Ad(n,r,`writableFinal`),waitWritableDestroy:Ad(n,r,`writableDestroy`)}},xp=(e,t,n)=>({write:Sp.bind(void 0,e),final:u(Cp.bind(void 0,e,t,n))}),Sp=(e,t,n,r)=>{e.write(t,n)?r():e.once(`drain`,r)},Cp=async(e,t,n)=>{await jd(n,t)&&(e.writable&&e.end(),await t)},wp=async(e,t,n,r)=>{try{await ef(e),await r,t.writable&&t.end()}catch(e){await $d(n),Op(t,await Tp(r,e))}},Tp=async(e,t)=>{if(!Ep(t))return t;try{await e}catch(e){return e}return t},Ep=e=>e===void 0||Xd(e),Dp=async({subprocessStdin:e,subprocess:t,waitWritableFinal:n,waitWritableDestroy:r},i)=>{await jd(n,t),await jd(r,t)&&(Op(e,i),await nf(t,i))},Op=(e,t)=>{rf(e,e.writable,t)},kp=({subprocess:e,concurrentStreams:t,encoding:n},{from:r,to:i,binary:a=!0,preserveNewlines:o=!0}={})=>{let s=a||H.has(n),{subprocessStdout:c,waitReadableDestroy:l}=of(e,r,t),{subprocessStdin:d,waitWritableFinal:f,waitWritableDestroy:p}=bp(e,i,t),{readableEncoding:m,readableObjectMode:h,readableHighWaterMark:g}=sf(c,s),{read:_,onStdoutDataDone:v}=cf({subprocessStdout:c,subprocess:e,binary:s,encoding:n,preserveNewlines:o}),y=new ge({read:_,...xp(d,e,f),destroy:u(Ap.bind(void 0,{subprocessStdout:c,subprocessStdin:d,subprocess:e,waitReadableDestroy:l,waitWritableFinal:f,waitWritableDestroy:p})),readableHighWaterMark:g,writableHighWaterMark:d.writableHighWaterMark,readableObjectMode:h,writableObjectMode:d.writableObjectMode,encoding:m});return uf({subprocessStdout:c,onStdoutDataDone:v,readable:y,subprocess:e,subprocessStdin:d}),wp(d,y,c,e),y},Ap=async({subprocessStdout:e,subprocessStdin:t,subprocess:n,waitReadableDestroy:r,waitWritableFinal:i,waitWritableDestroy:a},o)=>{await Promise.all([ff({subprocessStdout:e,subprocess:n,waitReadableDestroy:r},o),Dp({subprocessStdin:t,subprocess:n,waitWritableFinal:i,waitWritableDestroy:a},o)])},jp=(e,{encoding:t})=>{let n=kd();e.readable=af.bind(void 0,{subprocess:e,concurrentStreams:n,encoding:t}),e.writable=yp.bind(void 0,{subprocess:e,concurrentStreams:n}),e.duplex=kp.bind(void 0,{subprocess:e,concurrentStreams:n,encoding:t}),e.readableStream=mf.bind(void 0,e),e.writableStream=hf.bind(void 0,e),e.transformStream=gf.bind(void 0,e),e.iterable=Vd.bind(void 0,e,t),e[Symbol.asyncIterator]=Vd.bind(void 0,e,t,{})},Mp=(e,t)=>Object.assign(e,t),Np=(e,t,n,r)=>{let{file:i,commandArguments:a,command:o,escapedCommand:s,startTime:c,verboseInfo:l,options:u,fileDescriptors:d}=Pp(e,t,n),{subprocess:f,promise:p,kill:m,all:h,convertedStreams:g}=Ip({file:i,commandArguments:a,options:u,startTime:c,verboseInfo:l,command:o,escapedCommand:s,fileDescriptors:d}),_=Lp({promise:p,nodeChildProcess:f,kill:m,all:h,convertedStreams:g,options:u});return _.pipe=If.bind(void 0,{source:_,sourcePromise:p,boundOptions:{},createNested:r}),X.set(_,{options:u,fileDescriptors:d}),_},Pp=(e,t,n)=>{let{command:r,escapedCommand:i,startTime:a,verboseInfo:o}=on(e,t,n),{file:s,commandArguments:c,options:l}=$i(e,t,n),u=Fp(l);return{file:s,commandArguments:c,command:r,escapedCommand:i,startTime:a,verboseInfo:o,options:u,fileDescriptors:Bu(u,o)}},Fp=({timeout:e,signal:t,...n})=>{if(t!==void 0)throw TypeError(`The "signal" option has been renamed to "cancelSignal" instead.`);return{...n,timeoutDuration:e}},Ip=({file:e,commandArguments:t,options:n,startTime:r,verboseInfo:i,command:a,escapedCommand:s,fileDescriptors:c})=>{let l;try{l=o(...na(e,t,Sd(n)))}catch(e){return ku({error:e,command:a,escapedCommand:s,fileDescriptors:c,options:n,startTime:r,verboseInfo:i})}let u=new AbortController;re(1/0,u.signal);let d=[...l.stdio];hd(l,c,u),Wr(l,n);let f={},p=B(),m=Wn.bind(void 0,{kill:Cd(l,n),options:n,onInternalError:p,context:f,controller:u});Od(m,n,u);let h=sp(l,n),g=zp({subprocess:l,kill:m,all:h,options:n,startTime:r,verboseInfo:i,fileDescriptors:c,originalStreams:d,command:a,escapedCommand:s,context:f,onInternalError:p,controller:u});return{subprocess:l,promise:g,kill:m,all:h}},Lp=({promise:e,nodeChildProcess:t,kill:n,all:r,convertedStreams:i,options:a})=>{let o=Mp(e,Rp(t,r));return o.kill=n??o.kill,i===void 0?jp(o,a):Object.assign(o,i),Eu(o,t,a),o},Rp=(e,t)=>({nodeChildProcess:e,pid:e.pid,stdin:e.stdin,stdout:e.stdout,stderr:e.stderr,stdio:e.stdio,all:t,kill:e.kill.bind(e)}),zp=async({subprocess:e,kill:t,all:n,options:r,startTime:i,verboseInfo:a,fileDescriptors:o,originalStreams:s,command:c,escapedCommand:l,context:u,onInternalError:d,controller:f})=>{let[p,[m,h],g,_,v]=await hp({subprocess:e,kill:t,all:n,options:r,context:u,verboseInfo:a,fileDescriptors:o,originalStreams:s,onInternalError:d,controller:f});f.abort(),d.resolve();let y=g.map((e,t)=>$(e,r,t)),b=$(_,r,`all`),x=Bp({errorInfo:p,exitCode:m,signal:h,stdio:y,all:b,ipcOutput:v,context:u,options:r,command:c,escapedCommand:l,startTime:i});return Io(x,a,r)},Bp=({errorInfo:e,exitCode:t,signal:n,stdio:r,all:i,ipcOutput:a,context:o,options:s,command:c,escapedCommand:l,startTime:u})=>`error`in e?xo({error:e.error,command:c,escapedCommand:l,timedOut:o.terminationReason===`timeout`,isCanceled:o.terminationReason===`cancel`||o.terminationReason===`gracefulCancel`,isGracefullyCanceled:o.terminationReason===`gracefulCancel`,isMaxBuffer:e.error instanceof ja,isForcefullyTerminated:o.isForcefullyTerminated,exitCode:t,signal:n,stdio:r,all:i,ipcOutput:a,options:s,startTime:u,isSync:!1}):yo({command:c,escapedCommand:l,stdio:r,all:i,ipcOutput:a,options:s,startTime:u}),Vp=(e,t)=>{let n={__proto__:null,...e},r=Object.fromEntries(Object.entries(t).map(([e,t])=>[e,Hp(e,n[e],t)]));return{...n,...r}},Hp=(e,t,n)=>Up.has(e)&&k(t)&&k(n)?{...t,...n}:n,Up=/* @__PURE__ */ new Set([`env`,...ct]),Wp=(e,t,n,r)=>{let i=(e,t,r)=>Wp(e,t,n,r),a=(...a)=>Gp({mapArguments:e,deepOptions:n,boundOptions:t,setBoundExeca:r,createNested:i},...a);return r!==void 0&&r(a,i,t),a},Gp=({mapArguments:e,deepOptions:t={},boundOptions:n={},setBoundExeca:r,createNested:i},a,...o)=>{if(k(a))return i(e,Vp(n,a),r);let{file:s,commandArguments:c,options:l,isSync:u}=Kp({mapArguments:e,firstArgument:a,nextArguments:o,deepOptions:t,boundOptions:n});return u?nu(s,c,l):Np(s,c,l,i)},Kp=({mapArguments:e,firstArgument:t,nextArguments:n,deepOptions:r,boundOptions:i})=>{let a=ze(t)?Be(t,n):[t,...n],[o,s,c]=Ee(...a),l=Vp(Vp(r,i),c),{options:u=l,isSync:d=!1}=e({options:l});return{file:o,commandArguments:s,options:u,isSync:d}},qp=(e,t,n)=>{e.sync=t(Yp,n),e.s=e.sync},Jp=({options:e})=>Xp(e),Yp=({options:e})=>({...Xp(e),isSync:!0}),Xp=e=>({options:{...Zp(e),...e}}),Zp=({input:e,inputFile:t,stdio:n})=>e===void 0&&t===void 0&&n===void 0?{stdin:`inherit`}:{},Qp={preferLocal:!0},$p=Wp(()=>({})),em=Wp(()=>({isSync:!0}));Wp(mi),Wp(Jp,{},Qp,qp);const{sendMessage:tm,getOneMessage:nm,getEachMessage:rm,getCancelSignal:im}=Du();var am=/* @__PURE__ */ e({builder:()=>pm,command:()=>`git`,description:()=>``});const om=`git`,sm=``,cm=process.cwd();function lm(){try{return!!em(`git`,[`--version`],{cwd:cm}).stdout}catch{throw Error(`git is not installed`)}}function um(){try{return em(`git`,[`rev-parse`,`--is-inside-work-tree`],{cwd:cm}).stdout===`true`}catch{throw Error(`not a git repository`)}}function dm(){return $p(`git`,[`config`,`core.hooksPath`,`.githooks`],{cwd:cm})}function fm(){try{return lm()&&um()}catch(e){return console.error(`Fail:`,e.message),!1}}function pm(e){e.command(`hooks`,`Set .githooks as git.hooksPath`,{},()=>{fm()&&dm().then(()=>{console.log(`Done: set .githooks`)}).catch(()=>{console.error(`Fail:`,`setting hooks failed`),process.exitCode=1})}),e.demandCommand(1,"Typing `hooks`")}export{$p as a,am as i,om as n,sm as r,pm as t};
|