diff --git a/.gitignore b/.gitignore index c0a716b6c4fa..67da9c8f2f9f 100644 --- a/.gitignore +++ b/.gitignore @@ -91,3 +91,5 @@ packages/babel-standalone/babel.min.js.map .module-type *.tsbuildinfo + +deno.json diff --git a/Gulpfile.mjs b/Gulpfile.mjs index cb727ef9fc5e..86d550744b01 100644 --- a/Gulpfile.mjs +++ b/Gulpfile.mjs @@ -67,10 +67,12 @@ function bool(value) { * @returns {string} */ function mapSrcToLib(srcPath) { - const parts = srcPath - .replace(/(? { ); }); +gulp.task("copy-dts-to-lib", async () => { + const files = new Glob(`${defaultPackagesGlob}/src/**/*.d.ts`, { + posix: true, + }); + for await (const file of files) { + fs.cpSync(file, mapSrcToLib(file), {}); + } +}); + gulp.task( "build", gulp.series( diff --git a/Makefile b/Makefile index a5571144882f..b832e6e1a216 100644 --- a/Makefile +++ b/Makefile @@ -100,6 +100,9 @@ prepublish-prepare-dts: prepublish-build: $(MAKEJS) prepublish-build +prepublish-ts-build: + $(MAKEJS) prepublish-ts-build + prepublish: $(MAKEJS) prepublish diff --git a/Makefile.js b/Makefile.js index f6e2138c7c99..3b1fcc9026e8 100644 --- a/Makefile.js +++ b/Makefile.js @@ -1,4 +1,4 @@ -// source hash: 3736094404add1f3f1554d0b49c427d6e05d83f5 +// source hash: f13b6d71d3d65d1eb59db6178db9cf6c493fdc27 /* eslint-disable */ // prettier-ignore -"use strict";var e=require("os"),t=require("fs"),r=require("path"),n=require("events"),o=require("assert"),i=require("util"),s=require("child_process"),a=require("node:url"),c=require("node:child_process"),l=require("node:string_decoder"),u=require("node:util"),f=require("node:process"),p=require("node:fs"),d=require("node:tty"),h=require("node:path"),m=require("node:timers/promises"),g=require("node:os"),y=require("node:events"),b=require("node:v8"),v=require("node:stream"),w=require("node:buffer"),E=require("node:stream/promises"),S="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function O(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var I=function(e){return e&&e.Math===Math&&e},T=I("object"==typeof globalThis&&globalThis)||I("object"==typeof window&&window)||I("object"==typeof self&&self)||I("object"==typeof S&&S)||I("object"==typeof S&&S)||function(){return this}()||Function("return this")(),x={},j=function(e){try{return!!e()}catch(e){return!0}},R=!j((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})),A=!j((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})),D=A,N=Function.prototype.call,L=D?N.bind(N):function(){return N.apply(N,arguments)},k={},C={}.propertyIsEnumerable,P=Object.getOwnPropertyDescriptor,M=P&&!C.call({1:2},1);k.f=M?function(e){var t=P(this,e);return!!t&&t.enumerable}:C;var _,F,B=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},$=A,U=Function.prototype,G=U.call,W=$&&U.bind.bind(G,G),z=$?W:function(e){return function(){return G.apply(e,arguments)}},q=z,V=q({}.toString),H=q("".slice),X=function(e){return H(V(e),8,-1)},K=j,Y=X,Q=Object,J=z("".split),Z=K((function(){return!Q("z").propertyIsEnumerable(0)}))?function(e){return"String"===Y(e)?J(e,""):Q(e)}:Q,ee=function(e){return null==e},te=ee,re=TypeError,ne=function(e){if(te(e))throw new re("Can't call method on "+e);return e},oe=Z,ie=ne,se=function(e){return oe(ie(e))},ae="object"==typeof document&&document.all,ce=void 0===ae&&void 0!==ae?function(e){return"function"==typeof e||e===ae}:function(e){return"function"==typeof e},le=ce,ue=function(e){return"object"==typeof e?null!==e:le(e)},fe=T,pe=ce,de=function(e,t){return arguments.length<2?(r=fe[e],pe(r)?r:void 0):fe[e]&&fe[e][t];var r},he=z({}.isPrototypeOf),me=T,ge="undefined"!=typeof navigator&&String(navigator.userAgent)||"",ye=me.process,be=me.Deno,ve=ye&&ye.versions||be&&be.version,we=ve&&ve.v8;we&&(F=(_=we.split("."))[0]>0&&_[0]<4?1:+(_[0]+_[1])),!F&&ge&&(!(_=ge.match(/Edge\/(\d+)/))||_[1]>=74)&&(_=ge.match(/Chrome\/(\d+)/))&&(F=+_[1]);var Ee=F,Se=Ee,Oe=j,Ie=T.String,Te=!!Object.getOwnPropertySymbols&&!Oe((function(){var e=Symbol("symbol detection");return!Ie(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Se&&Se<41})),xe=Te&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,je=de,Re=ce,Ae=he,De=Object,Ne=xe?function(e){return"symbol"==typeof e}:function(e){var t=je("Symbol");return Re(t)&&Ae(t.prototype,De(e))},Le=String,ke=function(e){try{return Le(e)}catch(e){return"Object"}},Ce=ce,Pe=ke,Me=TypeError,_e=function(e){if(Ce(e))return e;throw new Me(Pe(e)+" is not a function")},Fe=_e,Be=ee,$e=function(e,t){var r=e[t];return Be(r)?void 0:Fe(r)},Ue=L,Ge=ce,We=ue,ze=TypeError,qe={exports:{}},Ve=T,He=Object.defineProperty,Xe=function(e,t){try{He(Ve,e,{value:t,configurable:!0,writable:!0})}catch(r){Ve[e]=t}return t},Ke=T,Ye=Xe,Qe="__core-js_shared__",Je=qe.exports=Ke[Qe]||Ye(Qe,{});(Je.versions||(Je.versions=[])).push({version:"3.36.1",mode:"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.36.1/LICENSE",source:"https://github.com/zloirock/core-js"});var Ze=qe.exports,et=Ze,tt=function(e,t){return et[e]||(et[e]=t||{})},rt=ne,nt=Object,ot=function(e){return nt(rt(e))},it=ot,st=z({}.hasOwnProperty),at=Object.hasOwn||function(e,t){return st(it(e),t)},ct=z,lt=0,ut=Math.random(),ft=ct(1..toString),pt=function(e){return"Symbol("+(void 0===e?"":e)+")_"+ft(++lt+ut,36)},dt=tt,ht=at,mt=pt,gt=Te,yt=xe,bt=T.Symbol,vt=dt("wks"),wt=yt?bt.for||bt:bt&&bt.withoutSetter||mt,Et=function(e){return ht(vt,e)||(vt[e]=gt&&ht(bt,e)?bt[e]:wt("Symbol."+e)),vt[e]},St=L,Ot=ue,It=Ne,Tt=$e,xt=function(e,t){var r,n;if("string"===t&&Ge(r=e.toString)&&!We(n=Ue(r,e)))return n;if(Ge(r=e.valueOf)&&!We(n=Ue(r,e)))return n;if("string"!==t&&Ge(r=e.toString)&&!We(n=Ue(r,e)))return n;throw new ze("Can't convert object to primitive value")},jt=TypeError,Rt=Et("toPrimitive"),At=function(e,t){if(!Ot(e)||It(e))return e;var r,n=Tt(e,Rt);if(n){if(void 0===t&&(t="default"),r=St(n,e,t),!Ot(r)||It(r))return r;throw new jt("Can't convert object to primitive value")}return void 0===t&&(t="number"),xt(e,t)},Dt=At,Nt=Ne,Lt=function(e){var t=Dt(e,"string");return Nt(t)?t:t+""},kt=ue,Ct=T.document,Pt=kt(Ct)&&kt(Ct.createElement),Mt=function(e){return Pt?Ct.createElement(e):{}},_t=Mt,Ft=!R&&!j((function(){return 7!==Object.defineProperty(_t("div"),"a",{get:function(){return 7}}).a})),Bt=R,$t=L,Ut=k,Gt=B,Wt=se,zt=Lt,qt=at,Vt=Ft,Ht=Object.getOwnPropertyDescriptor;x.f=Bt?Ht:function(e,t){if(e=Wt(e),t=zt(t),Vt)try{return Ht(e,t)}catch(e){}if(qt(e,t))return Gt(!$t(Ut.f,e,t),e[t])};var Xt={},Kt=R&&j((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),Yt=ue,Qt=String,Jt=TypeError,Zt=function(e){if(Yt(e))return e;throw new Jt(Qt(e)+" is not an object")},er=R,tr=Ft,rr=Kt,nr=Zt,or=Lt,ir=TypeError,sr=Object.defineProperty,ar=Object.getOwnPropertyDescriptor,cr="enumerable",lr="configurable",ur="writable";Xt.f=er?rr?function(e,t,r){if(nr(e),t=or(t),nr(r),"function"==typeof e&&"prototype"===t&&"value"in r&&ur in r&&!r[ur]){var n=ar(e,t);n&&n[ur]&&(e[t]=r.value,r={configurable:lr in r?r[lr]:n[lr],enumerable:cr in r?r[cr]:n[cr],writable:!1})}return sr(e,t,r)}:sr:function(e,t,r){if(nr(e),t=or(t),nr(r),tr)try{return sr(e,t,r)}catch(e){}if("get"in r||"set"in r)throw new ir("Accessors not supported");return"value"in r&&(e[t]=r.value),e};var fr=Xt,pr=B,dr=R?function(e,t,r){return fr.f(e,t,pr(1,r))}:function(e,t,r){return e[t]=r,e},hr={exports:{}},mr=R,gr=at,yr=Function.prototype,br=mr&&Object.getOwnPropertyDescriptor,vr=gr(yr,"name"),wr={EXISTS:vr,PROPER:vr&&"something"===function(){}.name,CONFIGURABLE:vr&&(!mr||mr&&br(yr,"name").configurable)},Er=ce,Sr=Ze,Or=z(Function.toString);Er(Sr.inspectSource)||(Sr.inspectSource=function(e){return Or(e)});var Ir,Tr,xr,jr=Sr.inspectSource,Rr=ce,Ar=T.WeakMap,Dr=Rr(Ar)&&/native code/.test(String(Ar)),Nr=pt,Lr=tt("keys"),kr=function(e){return Lr[e]||(Lr[e]=Nr(e))},Cr={},Pr=Dr,Mr=T,_r=ue,Fr=dr,Br=at,$r=Ze,Ur=kr,Gr=Cr,Wr="Object already initialized",zr=Mr.TypeError,qr=Mr.WeakMap;if(Pr||$r.state){var Vr=$r.state||($r.state=new qr);Vr.get=Vr.get,Vr.has=Vr.has,Vr.set=Vr.set,Ir=function(e,t){if(Vr.has(e))throw new zr(Wr);return t.facade=e,Vr.set(e,t),t},Tr=function(e){return Vr.get(e)||{}},xr=function(e){return Vr.has(e)}}else{var Hr=Ur("state");Gr[Hr]=!0,Ir=function(e,t){if(Br(e,Hr))throw new zr(Wr);return t.facade=e,Fr(e,Hr,t),t},Tr=function(e){return Br(e,Hr)?e[Hr]:{}},xr=function(e){return Br(e,Hr)}}var Xr={set:Ir,get:Tr,has:xr,enforce:function(e){return xr(e)?Tr(e):Ir(e,{})},getterFor:function(e){return function(t){var r;if(!_r(t)||(r=Tr(t)).type!==e)throw new zr("Incompatible receiver, "+e+" required");return r}}},Kr=z,Yr=j,Qr=ce,Jr=at,Zr=R,en=wr.CONFIGURABLE,tn=jr,rn=Xr.enforce,nn=Xr.get,on=String,sn=Object.defineProperty,an=Kr("".slice),cn=Kr("".replace),ln=Kr([].join),un=Zr&&!Yr((function(){return 8!==sn((function(){}),"length",{value:8}).length})),fn=String(String).split("String"),pn=hr.exports=function(e,t,r){"Symbol("===an(on(t),0,7)&&(t="["+cn(on(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),r&&r.getter&&(t="get "+t),r&&r.setter&&(t="set "+t),(!Jr(e,"name")||en&&e.name!==t)&&(Zr?sn(e,"name",{value:t,configurable:!0}):e.name=t),un&&r&&Jr(r,"arity")&&e.length!==r.arity&&sn(e,"length",{value:r.arity});try{r&&Jr(r,"constructor")&&r.constructor?Zr&&sn(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var n=rn(e);return Jr(n,"source")||(n.source=ln(fn,"string"==typeof t?t:"")),e};Function.prototype.toString=pn((function(){return Qr(this)&&nn(this).source||tn(this)}),"toString");var dn=hr.exports,hn=ce,mn=Xt,gn=dn,yn=Xe,bn=function(e,t,r,n){n||(n={});var o=n.enumerable,i=void 0!==n.name?n.name:t;if(hn(r)&&gn(r,i,n),n.global)o?e[t]=r:yn(t,r);else{try{n.unsafe?e[t]&&(o=!0):delete e[t]}catch(e){}o?e[t]=r:mn.f(e,t,{value:r,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return e},vn={},wn=Math.ceil,En=Math.floor,Sn=Math.trunc||function(e){var t=+e;return(t>0?En:wn)(t)},On=Sn,In=function(e){var t=+e;return t!=t||0===t?0:On(t)},Tn=In,xn=Math.max,jn=Math.min,Rn=In,An=Math.min,Dn=function(e){var t=Rn(e);return t>0?An(t,9007199254740991):0},Nn=Dn,Ln=function(e){return Nn(e.length)},kn=se,Cn=function(e,t){var r=Tn(e);return r<0?xn(r+t,0):jn(r,t)},Pn=Ln,Mn=function(e){return function(t,r,n){var o=kn(t),i=Pn(o);if(0===i)return!e&&-1;var s,a=Cn(n,i);if(e&&r!=r){for(;i>a;)if((s=o[a++])!=s)return!0}else for(;i>a;a++)if((e||a in o)&&o[a]===r)return e||a||0;return!e&&-1}},_n={includes:Mn(!0),indexOf:Mn(!1)},Fn=at,Bn=se,$n=_n.indexOf,Un=Cr,Gn=z([].push),Wn=function(e,t){var r,n=Bn(e),o=0,i=[];for(r in n)!Fn(Un,r)&&Fn(n,r)&&Gn(i,r);for(;t.length>o;)Fn(n,r=t[o++])&&(~$n(i,r)||Gn(i,r));return i},zn=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],qn=Wn,Vn=zn.concat("length","prototype");vn.f=Object.getOwnPropertyNames||function(e){return qn(e,Vn)};var Hn={};Hn.f=Object.getOwnPropertySymbols;var Xn=de,Kn=vn,Yn=Hn,Qn=Zt,Jn=z([].concat),Zn=Xn("Reflect","ownKeys")||function(e){var t=Kn.f(Qn(e)),r=Yn.f;return r?Jn(t,r(e)):t},eo=at,to=Zn,ro=x,no=Xt,oo=j,io=ce,so=/#|\.prototype\./,ao=function(e,t){var r=lo[co(e)];return r===fo||r!==uo&&(io(t)?oo(t):!!t)},co=ao.normalize=function(e){return String(e).replace(so,".").toLowerCase()},lo=ao.data={},uo=ao.NATIVE="N",fo=ao.POLYFILL="P",po=ao,ho=T,mo=x.f,go=dr,yo=bn,bo=Xe,vo=function(e,t,r){for(var n=to(t),o=no.f,i=ro.f,s=0;s9007199254740991)throw Ro("Maximum allowed index exceeded");return e};Eo({target:"Array",proto:!0,arity:1,forced:j((function(){return 4294967297!==[].push.call({length:4294967296},1)}))||!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(e){return e instanceof TypeError}}()},{push:function(e){var t=Ao(this),r=Do(t),n=arguments.length;Lo(r+n);for(var o=0;os;)ri.f(e,r=o[s++],n[r]);return e};var si,ai=de("document","documentElement"),ci=Zt,li=Yo,ui=zn,fi=Cr,pi=ai,di=Mt,hi="prototype",mi="script",gi=kr("IE_PROTO"),yi=function(){},bi=function(e){return"<"+mi+">"+e+""},vi=function(e){e.write(bi("")),e.close();var t=e.parentWindow.Object;return e=null,t},wi=function(){try{si=new ActiveXObject("htmlfile")}catch(e){}var e,t,r;wi="undefined"!=typeof document?document.domain&&si?vi(si):(t=di("iframe"),r="java"+mi+":",t.style.display="none",pi.appendChild(t),t.src=String(r),(e=t.contentWindow.document).open(),e.write(bi("document.F=Object")),e.close(),e.F):vi(si);for(var n=ui.length;n--;)delete wi[hi][ui[n]];return wi()};fi[gi]=!0;var Ei,Si,Oi,Ii=Object.create||function(e,t){var r;return null!==e?(yi[hi]=ci(e),r=new yi,yi[hi]=null,r[gi]=e):r=wi(),void 0===t?r:li.f(r,t)},Ti=j,xi=ce,ji=ue,Ri=Wo,Ai=bn,Di=Et("iterator"),Ni=!1;[].keys&&("next"in(Oi=[].keys())?(Si=Ri(Ri(Oi)))!==Object.prototype&&(Ei=Si):Ni=!0);var Li=!ji(Ei)||Ti((function(){var e={};return Ei[Di].call(e)!==e}));Li&&(Ei={}),xi(Ei[Di])||Ai(Ei,Di,(function(){return this}));var ki={IteratorPrototype:Ei,BUGGY_SAFARI_ITERATORS:Ni},Ci=Eo,Pi=T,Mi=function(e,t){if(ko(t,e))return e;throw new Co("Incorrect invocation")},_i=Zt,Fi=ce,Bi=Wo,$i=Vo,Ui=function(e,t,r){Ho?Xo.f(e,t,Ko(0,r)):e[t]=r},Gi=j,Wi=at,zi=ki.IteratorPrototype,qi=R,Vi="constructor",Hi="Iterator",Xi=Et("toStringTag"),Ki=TypeError,Yi=Pi[Hi],Qi=!Fi(Yi)||Yi.prototype!==zi||!Gi((function(){Yi({})})),Ji=function(){if(Mi(this,zi),Bi(this)===zi)throw new Ki("Abstract class Iterator not directly constructable")},Zi=function(e,t){qi?$i(zi,e,{configurable:!0,get:function(){return t},set:function(t){if(_i(this),this===zi)throw new Ki("You can't redefine this property");Wi(this,e)?this[e]=t:Ui(this,e,t)}}):zi[e]=t};Wi(zi,Xi)||Zi(Xi,Hi),!Qi&&Wi(zi,Vi)&&zi[Vi]!==Object||Zi(Vi,Ji),Ji.prototype=zi,Ci({global:!0,constructor:!0,forced:Qi},{Iterator:Ji});var es=function(e){return{iterator:e,next:e.next,done:!1}},ts=bn,rs=L,ns=Zt,os=$e,is=function(e,t,r){var n,o;ns(e);try{if(!(n=os(e,"return"))){if("throw"===t)throw r;return r}n=rs(n,e)}catch(e){o=!0,n=e}if("throw"===t)throw r;if(o)throw n;return ns(n),r},ss=L,as=Ii,cs=dr,ls=function(e,t,r){for(var n in t)ts(e,n,t[n],r);return e},us=Xr,fs=$e,ps=ki.IteratorPrototype,ds=function(e,t){return{value:e,done:t}},hs=is,ms=Et("toStringTag"),gs="IteratorHelper",ys="WrapForValidIterator",bs=us.set,vs=function(e){var t=us.getterFor(e?ys:gs);return ls(as(ps),{next:function(){var r=t(this);if(e)return r.nextHandler();try{var n=r.done?void 0:r.nextHandler();return ds(n,r.done)}catch(e){throw r.done=!0,e}},return:function(){var r=t(this),n=r.iterator;if(r.done=!0,e){var o=fs(n,"return");return o?ss(o,n):ds(void 0,!0)}if(r.inner)try{hs(r.inner.iterator,"normal")}catch(e){return hs(n,"throw",e)}return hs(n,"normal"),ds(void 0,!0)}})},ws=vs(!0),Es=vs(!1);cs(Es,ms,"Iterator Helper");var Ss=function(e,t){var r=function(r,n){n?(n.iterator=r.iterator,n.next=r.next):n=r,n.type=t?ys:gs,n.nextHandler=e,n.counter=0,n.done=!1,bs(this,n)};return r.prototype=t?ws:Es,r},Os=Zt,Is=is,Ts=function(e,t,r,n){try{return n?t(Os(r)[0],r[1]):t(r)}catch(t){Is(e,"throw",t)}},xs=Eo,js=L,Rs=_e,As=Zt,Ds=es,Ns=Ts,Ls=Ss((function(){for(var e,t,r=this.iterator,n=this.predicate,o=this.next;;){if(e=As(js(o,r)),this.done=!!e.done)return;if(t=e.value,Ns(r,n,[t,this.counter++],!0))return t}}));xs({target:"Iterator",proto:!0,real:!0,forced:false},{filter:function(e){return As(this),Rs(e),new Ls(Ds(this),{predicate:e})}});var ks=X,Cs=z,Ps=function(e){if("Function"===ks(e))return Cs(e)},Ms=_e,_s=A,Fs=Ps(Ps.bind),Bs={},$s=Bs,Us=Et("iterator"),Gs=Array.prototype,Ws={};Ws[Et("toStringTag")]="z";var zs="[object z]"===String(Ws),qs=ce,Vs=X,Hs=Et("toStringTag"),Xs=Object,Ks="Arguments"===Vs(function(){return arguments}()),Ys=zs?Vs:function(e){var t,r,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=function(e,t){try{return e[t]}catch(e){}}(t=Xs(e),Hs))?r:Ks?Vs(t):"Object"===(n=Vs(t))&&qs(t.callee)?"Arguments":n},Qs=Ys,Js=$e,Zs=ee,ea=Bs,ta=Et("iterator"),ra=function(e){if(!Zs(e))return Js(e,ta)||Js(e,"@@iterator")||ea[Qs(e)]},na=L,oa=_e,ia=Zt,sa=ke,aa=ra,ca=TypeError,la=function(e,t){return Ms(e),void 0===t?e:_s?Fs(e,t):function(){return e.apply(t,arguments)}},ua=L,fa=Zt,pa=ke,da=function(e){return void 0!==e&&($s.Array===e||Gs[Us]===e)},ha=Ln,ma=he,ga=function(e,t){var r=arguments.length<2?aa(e):t;if(oa(r))return ia(na(r,e));throw new ca(sa(e)+" is not iterable")},ya=ra,ba=is,va=TypeError,wa=function(e,t){this.stopped=e,this.result=t},Ea=wa.prototype,Sa=function(e,t,r){var n,o,i,s,a,c,l,u=r&&r.that,f=!(!r||!r.AS_ENTRIES),p=!(!r||!r.IS_RECORD),d=!(!r||!r.IS_ITERATOR),h=!(!r||!r.INTERRUPTED),m=la(t,u),g=function(e){return n&&ba(n,"normal",e),new wa(!0,e)},y=function(e){return f?(fa(e),h?m(e[0],e[1],g):m(e[0],e[1])):h?m(e,g):m(e)};if(p)n=e.iterator;else if(d)n=e;else{if(!(o=ya(e)))throw new va(pa(e)+" is not iterable");if(da(o)){for(i=0,s=ha(e);s>i;i++)if((a=y(e[i]))&&ma(Ea,a))return a;return new wa(!1)}n=ga(e,o)}for(c=p?e.next:n.next;!(l=ua(c,n)).done;){try{a=y(l.value)}catch(e){ba(n,"throw",e)}if("object"==typeof a&&a&&ma(Ea,a))return a}return new wa(!1)},Oa=Sa,Ia=_e,Ta=Zt,xa=es;Eo({target:"Iterator",proto:!0,real:!0},{forEach:function(e){Ta(this),Ia(e);var t=xa(this),r=0;Oa(t,(function(t){e(t,r++)}),{IS_RECORD:!0})}});var ja=L,Ra=_e,Aa=Zt,Da=es,Na=Ts,La=Ss((function(){var e=this.iterator,t=Aa(ja(this.next,e));if(!(this.done=!!t.done))return Na(e,this.mapper,[t.value,this.counter++],!0)}));Eo({target:"Iterator",proto:!0,real:!0,forced:false},{map:function(e){return Aa(this),Ra(e),new La(Da(this),{mapper:e})}});var ka=Sa,Ca=_e,Pa=Zt,Ma=es,_a=TypeError;Eo({target:"Iterator",proto:!0,real:!0},{reduce:function(e){Pa(this),Ca(e);var t=Ma(this),r=arguments.length<2,n=r?void 0:arguments[1],o=0;if(ka(t,(function(t){r?(r=!1,n=t):n=e(n,t,o),o++}),{IS_RECORD:!0}),r)throw new _a("Reduce of empty iterator with no initial value");return n}});var Fa,Ba,$a,Ua={},Ga={};function Wa(){if(Fa)return Ga;Fa=1;var e=r,n="win32"===process.platform,o=t,i=process.env.NODE_DEBUG&&/fs/.test(process.env.NODE_DEBUG);function s(e){return"function"==typeof e?e:function(){var e;if(i){var t=new Error;e=function(e){e&&(t.message=e.message,r(e=t))}}else e=r;return e;function r(e){if(e){if(process.throwDeprecation)throw e;if(!process.noDeprecation){var t="fs: missing callback "+(e.stack||e.message);process.traceDeprecation?console.trace(t):console.error(t)}}}}()}if(e.normalize,n)var a=/(.*?)(?:[\/\\]+|$)/g;else a=/(.*?)(?:[\/]+|$)/g;if(n)var c=/^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/;else c=/^[\/]*/;return Ga.realpathSync=function(t,r){if(t=e.resolve(t),r&&Object.prototype.hasOwnProperty.call(r,t))return r[t];var i,s,l,u,f=t,p={},d={};function h(){var e=c.exec(t);i=e[0].length,s=e[0],l=e[0],u="",n&&!d[l]&&(o.lstatSync(l),d[l]=!0)}for(h();i=t.length)return r&&(r[d]=t),i(null,t);a.lastIndex=l;var e=a.exec(t);return p=u,u+=e[0],f=p+e[1],l=a.lastIndex,m[f]||r&&r[f]===f?process.nextTick(y):r&&Object.prototype.hasOwnProperty.call(r,f)?w(r[f]):o.lstat(f,b)}function b(e,t){if(e)return i(e);if(!t.isSymbolicLink())return m[f]=!0,r&&(r[f]=f),process.nextTick(y);if(!n){var s=t.dev.toString(32)+":"+t.ino.toString(32);if(h.hasOwnProperty(s))return v(null,h[s],f)}o.stat(f,(function(e){if(e)return i(e);o.readlink(f,(function(e,t){n||(h[s]=t),v(e,t)}))}))}function v(t,n,o){if(t)return i(t);var s=e.resolve(p,n);r&&(r[o]=s),w(s)}function w(r){t=e.resolve(r,t.slice(l)),g()}g()},Ga}function za(){if($a)return Ba;$a=1,Ba=c,c.realpath=c,c.sync=l,c.realpathSync=l,c.monkeypatch=function(){e.realpath=c,e.realpathSync=l},c.unmonkeypatch=function(){e.realpath=r,e.realpathSync=n};var e=t,r=e.realpath,n=e.realpathSync,o=process.version,i=/^v[0-5]\./.test(o),s=Wa();function a(e){return e&&"realpath"===e.syscall&&("ELOOP"===e.code||"ENOMEM"===e.code||"ENAMETOOLONG"===e.code)}function c(e,t,n){if(i)return r(e,t,n);"function"==typeof t&&(n=t,t=null),r(e,t,(function(r,o){a(r)?s.realpath(e,t,n):n(r,o)}))}function l(e,t){if(i)return n(e,t);try{return n(e,t)}catch(r){if(a(r))return s.realpathSync(e,t);throw r}}return Ba}var qa,Va,Ha,Xa,Ka,Ya,Qa,Ja,Za=Sa,ec=_e,tc=Zt,rc=es;function nc(){if(Va)return qa;Va=1,qa=function(t,r){for(var n=[],o=0;o=0&&l>0){for(n=[],i=r.length;u>=0&&!a;)u==c?(n.push(u),c=r.indexOf(e,u+1)):1==n.length?a=[n.pop(),l]:((o=n.pop())=0?c:l;n.length&&(a=[i,s])}return a}return Xa=1,Ha=e,e.range=r,Ha}();Ka=function(e){if(!e)return[];"{}"===e.substr(0,2)&&(e="\\{\\}"+e.substr(2));return h(function(e){return e.split("\\\\").join(r).split("\\{").join(n).split("\\}").join(o).split("\\,").join(i).split("\\.").join(s)}(e),!0).map(c)};var r="\0SLASH"+Math.random()+"\0",n="\0OPEN"+Math.random()+"\0",o="\0CLOSE"+Math.random()+"\0",i="\0COMMA"+Math.random()+"\0",s="\0PERIOD"+Math.random()+"\0";function a(e){return parseInt(e,10)==e?parseInt(e,10):e.charCodeAt(0)}function c(e){return e.split(r).join("\\").split(n).join("{").split(o).join("}").split(i).join(",").split(s).join(".")}function l(e){if(!e)return[""];var r=[],n=t("{","}",e);if(!n)return e.split(",");var o=n.pre,i=n.body,s=n.post,a=o.split(",");a[a.length-1]+="{"+i+"}";var c=l(s);return s.length&&(a[a.length-1]+=c.shift(),a.push.apply(a,c)),r.push.apply(r,a),r}function u(e){return"{"+e+"}"}function f(e){return/^-?0\d/.test(e)}function p(e,t){return e<=t}function d(e,t){return e>=t}function h(r,n){var i=[],s=t("{","}",r);if(!s||/\$$/.test(s.pre))return[r];var c,m=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(s.body),g=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(s.body),y=m||g,b=s.body.indexOf(",")>=0;if(!y&&!b)return s.post.match(/,.*\}/)?h(r=s.pre+"{"+s.body+o+s.post):[r];if(y)c=s.body.split(/\.\./);else if(1===(c=l(s.body)).length&&1===(c=h(c[0],!1).map(u)).length)return(E=s.post.length?h(s.post,!1):[""]).map((function(e){return s.pre+c[0]+e}));var v,w=s.pre,E=s.post.length?h(s.post,!1):[""];if(y){var S=a(c[0]),O=a(c[1]),I=Math.max(c[0].length,c[1].length),T=3==c.length?Math.abs(a(c[2])):1,x=p;O0){var N=new Array(D+1).join("0");A=R<0?"-"+N+A.slice(1):N+A}}v.push(A)}}else v=e(c,(function(e){return h(e,!1)}));for(var L=0;L65536)throw new TypeError("pattern is too long")};u.prototype.parse=function(e,r){p(e);var a=this.options;if("**"===e){if(!a.noglobstar)return t;e="*"}if(""===e)return"";var c,l="",u=!!a.nocase,f=!1,h=[],m=[],g=!1,y=-1,b=-1,v="."===e.charAt(0)?"":a.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",w=this;function E(){if(c){switch(c){case"*":l+=i,u=!0;break;case"?":l+=o,u=!0;break;default:l+="\\"+c}w.debug("clearStateChar %j %j",c,l),c=!1}}for(var S,O=0,I=e.length;O-1;N--){var L=m[N],k=l.slice(0,L.reStart),C=l.slice(L.reStart,L.reEnd-8),P=l.slice(L.reEnd-8,L.reEnd),M=l.slice(L.reEnd);P+=M;var _=k.split("(").length-1,F=M;for(O=0;O<_;O++)F=F.replace(/\)[+*?]?/,"");var B="";""===(M=F)&&r!==d&&(B="$"),l=k+C+M+B+P}""!==l&&u&&(l="(?=.)"+l);D&&(l=v+l);if(r===d)return[l,u];if(!u)return function(e){return e.replace(/\\(.)/g,"$1")}(e);var $=a.nocase?"i":"";try{var U=new RegExp("^"+l+"$",$)}catch(e){return new RegExp("$.")}return U._glob=e,U._src=l,U};var d={};return l.makeRe=function(e,t){return new u(e,t||{}).makeRe()},u.prototype.makeRe=function(){if(this.regexp||!1===this.regexp)return this.regexp;var e=this.set;if(!e.length)return this.regexp=!1,this.regexp;var r=this.options,n=r.noglobstar?i:r.dot?"(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?":"(?:(?!(?:\\/|^)\\.).)*?",o=r.nocase?"i":"",s=e.map((function(e){return e.map((function(e){return e===t?n:"string"==typeof e?function(e){return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}(e):e._src})).join("\\/")})).join("|");s="^(?:"+s+")$",this.negate&&(s="^(?!"+s+").*$");try{this.regexp=new RegExp(s,o)}catch(e){this.regexp=!1}return this.regexp},l.match=function(e,t,r){var n=new u(t,r=r||{});return e=e.filter((function(e){return n.match(e)})),n.options.nonull&&!e.length&&e.push(t),e},u.prototype.match=function(t,r){if(void 0===r&&(r=this.partial),this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return""===t;if("/"===t&&r)return!0;var n=this.options;"/"!==e.sep&&(t=t.split(e.sep).join("/")),t=t.split(a),this.debug(this.pattern,"split",t);var o,i,s=this.set;for(this.debug(this.pattern,"set",s),i=t.length-1;i>=0&&!(o=t[i]);i--);for(i=0;i>> no match, partial?",e,p,r,d),p!==a))}if("string"==typeof u?(l=f===u,this.debug("string match",u,f,l)):(l=f.match(u),this.debug("pattern match",u,f,l)),!l)return!1}if(i===a&&s===c)return!0;if(i===a)return n;if(s===c)return i===a-1&&""===e[i];throw new Error("wtf?")},Qa}Eo({target:"Iterator",proto:!0,real:!0},{some:function(e){tc(this),ec(e);var t=rc(this),r=0;return Za(t,(function(t,n){if(e(t,r++))return n()}),{IS_RECORD:!0,INTERRUPTED:!0}).stopped}});var sc,ac,cc={exports:{}},lc={exports:{}};function uc(){if(ac)return cc.exports;ac=1;try{var e=require("util");if("function"!=typeof e.inherits)throw"";cc.exports=e.inherits}catch(e){cc.exports=(sc||(sc=1,"function"==typeof Object.create?lc.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:lc.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}),lc.exports)}return cc.exports}var fc,pc={exports:{}};function dc(){if(fc)return pc.exports;function e(e){return"/"===e.charAt(0)}function t(e){var t=/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/.exec(e),r=t[1]||"",n=Boolean(r&&":"!==r.charAt(1));return Boolean(t[2]||n)}return fc=1,pc.exports="win32"===process.platform?t:e,pc.exports.posix=e,pc.exports.win32=t,pc.exports}var hc,mc,gc,yc,bc,vc={};function wc(){if(hc)return vc;function e(e,t){return Object.prototype.hasOwnProperty.call(e,t)}hc=1,vc.setopts=function(t,r,i){i||(i={});if(i.matchBase&&-1===r.indexOf("/")){if(i.noglobstar)throw new Error("base matching requires globstar");r="**/"+r}t.silent=!!i.silent,t.pattern=r,t.strict=!1!==i.strict,t.realpath=!!i.realpath,t.realpathCache=i.realpathCache||Object.create(null),t.follow=!!i.follow,t.dot=!!i.dot,t.mark=!!i.mark,t.nodir=!!i.nodir,t.nodir&&(t.mark=!0);t.sync=!!i.sync,t.nounique=!!i.nounique,t.nonull=!!i.nonull,t.nosort=!!i.nosort,t.nocase=!!i.nocase,t.stat=!!i.stat,t.noprocess=!!i.noprocess,t.absolute=!!i.absolute,t.fs=i.fs||n,t.maxLength=i.maxLength||1/0,t.cache=i.cache||Object.create(null),t.statCache=i.statCache||Object.create(null),t.symlinks=i.symlinks||Object.create(null),function(e,t){e.ignore=t.ignore||[],Array.isArray(e.ignore)||(e.ignore=[e.ignore]);e.ignore.length&&(e.ignore=e.ignore.map(l))}(t,i),t.changedCwd=!1;var c=process.cwd();e(i,"cwd")?(t.cwd=o.resolve(i.cwd),t.changedCwd=t.cwd!==c):t.cwd=c;t.root=i.root||o.resolve(t.cwd,"/"),t.root=o.resolve(t.root),"win32"===process.platform&&(t.root=t.root.replace(/\\/g,"/"));t.cwdAbs=s(t.cwd)?t.cwd:u(t,t.cwd),"win32"===process.platform&&(t.cwdAbs=t.cwdAbs.replace(/\\/g,"/"));t.nomount=!!i.nomount,i.nonegate=!0,i.nocomment=!0,i.allowWindowsEscape=!1,t.minimatch=new a(r,i),t.options=t.minimatch.options},vc.ownProp=e,vc.makeAbs=u,vc.finish=function(e){for(var t=e.nounique,r=t?[]:Object.create(null),n=0,o=e.matches.length;no?(n.splice(0,o),process.nextTick((function(){r.apply(null,i)}))):delete t[e]}}))}(e))})),Oc}function Bc(){if(xc)return Tc;xc=1,Tc=b;var e=za(),t=ic();t.Minimatch;var i=uc(),s=n.EventEmitter,a=r,c=o,l=dc(),u=function(){if(gc)return mc;gc=1,mc=p,p.GlobSync=d;var e=za(),t=ic();t.Minimatch,Bc().Glob;var n=r,i=o,s=dc(),a=wc(),c=a.setopts,l=a.ownProp,u=a.childrenIgnored,f=a.isIgnored;function p(e,t){if("function"==typeof t||3===arguments.length)throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167");return new d(e,t).found}function d(e,t){if(!e)throw new Error("must provide pattern");if("function"==typeof t||3===arguments.length)throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167");if(!(this instanceof d))return new d(e,t);if(c(this,e,t),this.noprocess)return this;var r=this.minimatch.set.length;this.matches=new Array(r);for(var n=0;nthis.maxLength)return!1;if(!this.stat&&l(this.cache,t)){var n=this.cache[t];if(Array.isArray(n)&&(n="DIR"),!r||"DIR"===n)return n;if(r&&"FILE"===n)return!1}var o=this.statCache[t];if(!o){var i;try{i=this.fs.lstatSync(t)}catch(e){if(e&&("ENOENT"===e.code||"ENOTDIR"===e.code))return this.statCache[t]=!1,!1}if(i&&i.isSymbolicLink())try{o=this.fs.statSync(t)}catch(e){o=i}else o=i}return this.statCache[t]=o,n=!0,o&&(n=o.isDirectory()?"DIR":"FILE"),this.cache[t]=this.cache[t]||n,(!r||"FILE"!==n)&&n},d.prototype._mark=function(e){return a.mark(this,e)},d.prototype._makeAbs=function(e){return a.makeAbs(this,e)},mc}(),f=wc(),p=f.setopts,d=f.ownProp,h=Fc(),m=f.childrenIgnored,g=f.isIgnored,y=_c();function b(e,t,r){if("function"==typeof t&&(r=t,t={}),t||(t={}),t.sync){if(r)throw new TypeError("callback provided to sync glob");return u(e,t)}return new w(e,t,r)}b.sync=u;var v=b.GlobSync=u.GlobSync;function w(e,t,r){if("function"==typeof t&&(r=t,t=null),t&&t.sync){if(r)throw new TypeError("callback provided to sync glob");return new v(e,t)}if(!(this instanceof w))return new w(e,t,r);p(this,e,t),this._didRealPath=!1;var n=this.minimatch.set.length;this.matches=new Array(n),"function"==typeof r&&(r=y(r),this.on("error",r),this.on("end",(function(e){r(null,e)})));var o=this;if(this._processing=0,this._emitQueue=[],this._processQueue=[],this.paused=!1,this.noprocess)return this;if(0===n)return a();for(var i=!0,s=0;s1)return!0;for(var o=0;othis.maxLength)return t();if(!this.stat&&d(this.cache,r)){var o=this.cache[r];if(Array.isArray(o)&&(o="DIR"),!n||"DIR"===o)return t(null,o);if(n&&"FILE"===o)return t()}var i=this.statCache[r];if(void 0!==i){if(!1===i)return t(null,i);var s=i.isDirectory()?"DIR":"FILE";return n&&"FILE"===s?t():t(null,s,i)}var a=this,c=h("stat\0"+r,(function(n,o){if(o&&o.isSymbolicLink())return a.fs.stat(r,(function(n,i){n?a._stat2(e,r,null,o,t):a._stat2(e,r,n,i,t)}));a._stat2(e,r,n,o,t)}));c&&a.fs.lstat(r,c)},w.prototype._stat2=function(e,t,r,n,o){if(r&&("ENOENT"===r.code||"ENOTDIR"===r.code))return this.statCache[t]=!1,o();var i="/"===e.slice(-1);if(this.statCache[t]=n,"/"===t.slice(-1)&&n&&!n.isDirectory())return o(null,!1,n);var s=!0;return n&&(s=n.isDirectory()?"DIR":"FILE"),this.cache[t]=this.cache[t]||s,i&&"FILE"===s?o():o(null,s,n)},Tc}function $c(){if(jc)return Ua;jc=1;var r=e,n=t,o=Bc(),i=Tu(),s=Object.create(i);Ua.extend=Object.assign;var a=Boolean(process.versions.electron),c={fatal:!1,globOptions:{},maxdepth:255,noglob:!1,silent:!1,verbose:!1,execPath:null,bufLength:65536},l={reset:function(){Object.assign(this,c),a||(this.execPath=process.execPath)},resetForTesting:function(){this.reset(),this.silent=!0}};l.reset(),Ua.config=l;var u={error:null,errorCode:0,currentCmd:"shell.js"};function f(e){return"object"==typeof e&&null!==e}function p(){l.silent||console.error.apply(console,arguments)}function d(e){if("string"!=typeof e)throw new TypeError("input must be a string");return e.replace(/\\/g,"/")}function h(e,t,r){if("string"!=typeof e)throw new Error("msg must be a string");var n={continue:!1,code:1,prefix:u.currentCmd+": ",silent:!1};"number"==typeof t&&f(r)?r.code=t:f(t)?r=t:"number"==typeof t?r={code:t}:"number"!=typeof t&&(r={}),r=Object.assign({},n,r),u.errorCode||(u.errorCode=r.code);var o=d(r.prefix+e);if(u.error=u.error?u.error+"\n":"",u.error+=o,l.fatal)throw new Error(o);if(e.length>0&&!r.silent&&p(o),!r.continue)throw{msg:"earlyExit",retValue:new m("",u.error,u.errorCode)}}function m(e,t,r){var n;return e instanceof Array?((n=e).stdout=e.join("\n"),e.length>0&&(n.stdout+="\n")):(n=new String(e)).stdout=e,n.stderr=t,n.code=r,E.forEach((function(e){n[e]=s[e].bind(n)})),n}function g(e,t,r){if("string"!=typeof e&&!f(e))throw new Error("options must be strings or key-value pairs");if(!f(t))throw new Error("parseOptions() internal error: map must be an object");if(r&&!f(r))throw new Error("parseOptions() internal error: errorOptions must be object");if("--"===e)return{};var n={};if(Object.keys(t).forEach((function(e){var r=t[e];"!"!==r[0]&&(n[r]=!1)})),""===e)return n;if("string"==typeof e){if("-"!==e[0])throw new Error("Options string must start with a '-'");e.slice(1).split("").forEach((function(e){if(e in t){var o=t[e];"!"===o[0]?n[o.slice(1)]=!1:n[o]=!0}else h("option not recognized: "+e,r||{})}))}else Object.keys(e).forEach((function(o){var i=o[1];if(i in t){var s=t[i];n[s]=e[o]}else h("option not recognized: "+i,r||{})}));return n}function y(e){if(!Array.isArray(e))throw new TypeError("must be an array");var t=[];return e.forEach((function(e){if("string"!=typeof e)t.push(e);else{var r;try{r=(r=o.sync(e,l.globOptions)).length>0?r:[e]}catch(t){r=[e]}t=t.concat(r)}})),t}Ua.state=u,delete process.env.OLDPWD,Ua.isObject=f,Ua.log=p,Ua.convertErrorOutput=d,Ua.error=h,Ua.ShellString=m,Ua.parseOptions=g,Ua.expand=y;var b="function"==typeof Buffer.alloc?function(e){return Buffer.alloc(e||l.bufLength)}:function(e){return new Buffer(e||l.bufLength)};function v(e,t,n){return n=n||{},function(){var o=null;u.currentCmd=e,u.error=null,u.errorCode=0;try{var i=[].slice.call(arguments,0);if(l.verbose&&console.error.apply(console,[e].concat(i)),u.pipedValue=this&&"string"==typeof this.stdout?this.stdout:"",!1===n.unix)o=t.apply(this,i);else{f(i[0])&&"Object"===i[0].constructor.name||(0===i.length||"string"!=typeof i[0]||i[0].length<=1||"-"!==i[0][0])&&i.unshift(""),i=(i=i.reduce((function(e,t){return Array.isArray(t)?e.concat(t):(e.push(t),e)}),[])).map((function(e){return f(e)&&"String"===e.constructor.name?e.toString():e}));var s=r.homedir();i=i.map((function(e){return"string"==typeof e&&"~/"===e.slice(0,2)||"~"===e?e.replace(/^~/,s):e})),l.noglob||!0!==n.allowGlobbing||(i=i.slice(0,n.globStart).concat(y(i.slice(n.globStart))));try{f(n.cmdOptions)&&(i[0]=g(i[0],n.cmdOptions)),o=t.apply(this,i)}catch(e){if("earlyExit"!==e.msg)throw e;o=e.retValue}}}catch(e){if(!u.error)throw e.name="ShellJSInternalError",e;if(l.fatal)throw e}return n.wrapOutput&&("string"==typeof o||Array.isArray(o))&&(o=new m(o,u.error,u.errorCode)),u.currentCmd="shell.js",o}}Ua.buffer=b,Ua.unlinkSync=function(e){try{n.unlinkSync(e)}catch(t){if("EPERM"!==t.code)throw t;n.chmodSync(e,"0666"),n.unlinkSync(e)}},Ua.statFollowLinks=function(){return n.statSync.apply(n,arguments)},Ua.statNoFollowLinks=function(){return n.lstatSync.apply(n,arguments)},Ua.randomFileName=function(){return"shelljs_"+function e(t){if(1===t)return parseInt(16*Math.random(),10).toString(16);for(var r="",n=0;n0&&"-"===e.charAt(0)?[].unshift.call(arguments,""):n.error("You must specify a file.")),e=n.parseOptions(e,{R:"recursive",c:"changes",v:"verbose"}),r=[].slice.call(arguments,2),e.recursive?(a=[],r.forEach((function e(t){var r=n.statNoFollowLinks(t);r.isSymbolicLink()||(a.push(t),r.isDirectory()&&o.readdirSync(t).forEach((function(r){e(t+"/"+r)})))}))):a=r,a.forEach((function(r){if(r=i.resolve(r),o.existsSync(r)||n.error("File not found: "+r),!e.recursive||!n.statNoFollowLinks(r).isSymbolicLink()){var a=n.statFollowLinks(r),c=a.isDirectory(),l=a.mode,u=l&s.TYPE_MASK,f=l;isNaN(parseInt(t,8))?t.split(",").forEach((function(t){var i=/([ugoa]*)([=\+-])([rwxXst]*)/i.exec(t);if(i){var a=i[1],p=i[2],d=i[3],h=-1!==a.indexOf("u")||"a"===a||""===a,m=-1!==a.indexOf("g")||"a"===a||""===a,g=-1!==a.indexOf("o")||"a"===a||""===a,y=-1!==d.indexOf("r"),b=-1!==d.indexOf("w"),v=-1!==d.indexOf("x"),w=-1!==d.indexOf("X"),E=-1!==d.indexOf("t"),S=-1!==d.indexOf("s");w&&c&&(v=!0);var O=0;switch(h&&(O|=(y?s.OWNER_READ:0)+(b?s.OWNER_WRITE:0)+(v?s.OWNER_EXEC:0)+(S?s.SETUID:0)),m&&(O|=(y?s.GROUP_READ:0)+(b?s.GROUP_WRITE:0)+(v?s.GROUP_EXEC:0)+(S?s.SETGID:0)),g&&(O|=(y?s.OTHER_READ:0)+(b?s.OTHER_WRITE:0)+(v?s.OTHER_EXEC:0)),E&&(O|=s.STICKY),p){case"+":f|=O;break;case"-":f&=~O;break;case"=":f=u+O,n.statFollowLinks(r).isDirectory()&&(f|=s.SETUID+s.SETGID&l);break;default:n.error("Could not recognize operator: `"+p+"`")}e.verbose&&console.log(r+" -> "+f.toString(8)),l!==f&&(!e.verbose&&e.changes&&console.log(r+" -> "+f.toString(8)),o.chmodSync(r,f),l=f)}else n.error("Invalid symbolic mode change: "+t)})):(f=u+parseInt(t,8),n.statFollowLinks(r).isDirectory()&&(f|=s.SETUID+s.SETGID&l),o.chmodSync(r,f))}})),""}return n.register("chmod",a,{}),Lc=a}function zc(){if(Pc)return Cc;Pc=1;var e=t,n=r,o=$c();function i(t,r,n){e.existsSync(t)||o.error("copyFileSync: no such file or directory: "+t);var i="win32"===process.platform;try{if(n.update&&o.statFollowLinks(t).mtime=o.config.maxdepth)){n++;var l="win32"===process.platform;try{e.mkdirSync(r)}catch(e){if("EEXIST"!==e.code)throw e}for(var u=e.readdirSync(t),f=0;f and/or "):(r=[].slice.call(arguments,1,arguments.length-1),a=arguments[arguments.length-1]);var c=e.existsSync(a),l=c&&o.statFollowLinks(a);return c&&l.isDirectory()||!(r.length>1)||o.error("dest is not a directory (too many sources)"),c&&l.isFile()&&t.no_force?new o.ShellString("","",0):(r.forEach((function(c,u){if(!e.existsSync(c))return""===c&&(c="''"),void o.error("no such file or directory: "+c,{continue:!0});var f=o.statFollowLinks(c);if(!t.noFollowsymlink&&f.isDirectory())if(t.recursive){var p=l&&l.isDirectory()?n.join(a,n.basename(c)):a;try{o.statFollowLinks(n.dirname(a)),s(c,p,0,{no_force:t.no_force,followsymlink:t.followsymlink})}catch(e){o.error("cannot create directory '"+a+"': No such file or directory")}}else o.error("omitting directory '"+c+"'",{continue:!0});else{var d=a;l&&l.isDirectory()&&(d=n.normalize(a+"/"+n.basename(c)));var h=e.existsSync(d);if(h&&function(e,t){var r=e[t];return e.slice(0,t).some((function(e){return n.basename(e)===n.basename(r)}))}(r,u))return void(t.no_force||o.error("will not overwrite just-created '"+d+"' with '"+c+"'",{continue:!0}));if(h&&t.no_force)return;if(""===n.relative(c,d))return void o.error("'"+d+"' and '"+c+"' are the same file",{continue:!0});i(c,d,t)}})),new o.ShellString("",o.state.error,o.state.errorCode))}return o.register("cp",c,{cmdOptions:{f:"!no_force",n:"no_force",u:"update",R:"recursive",r:"recursive",L:"followsymlink",P:"noFollowsymlink"},wrapOutput:!1}),Cc=c}var qc,Vc,Hc,Xc,Kc,Yc={};function Qc(){if(qc)return Yc;qc=1;var e=$c(),t=Gc(),n=r;e.register("dirs",u,{wrapOutput:!1}),e.register("pushd",c,{wrapOutput:!1}),e.register("popd",l,{wrapOutput:!1});var o=[];function i(e){return/^[\-+]\d+$/.test(e)}function s(t){if(i(t)){if(Math.abs(t)1))return e.error("no other directory");l=l.splice(1,1).concat(l)}return r["no-cd"]?l=l.slice(1):(c=n.resolve(l.shift()),t("",c)),o=l,u(r.quiet?"-q":"")}function l(r,a){if(i(r)&&(a=r,r=""),r=e.parseOptions(r,{n:"no-cd",q:"quiet"}),!o.length)return e.error("directory stack empty");if(a=s(a||"+0"),r["no-cd"]||a>0||o.length+a===0)a=a>0?a-1:a,o.splice(a,1);else{var c=n.resolve(o.shift());t("",c)}return u(r.quiet?"-q":"")}function u(t,r){if(i(t)&&(r=t,t=""),(t=e.parseOptions(t,{c:"clear",q:"quiet"})).clear)return o=[];var n=a();return r?((r=s(r))<0&&(r=n.length+r),t.quiet||e.log(n[r]),n[r]):(t.quiet||e.log(n.join(" ")),n)}return Yc.pushd=c,Yc.popd=l,Yc.dirs=u,Yc}function Jc(){if(Hc)return Vc;Hc=1;var e=i.format,t=$c();function r(r){var n=[].slice.call(arguments,r?0:1),o={};try{o=t.parseOptions(n[0],{e:"escapes",n:"no_newline"},{silent:!0}),n[0]&&n.shift()}catch(e){t.state.error=null}var i=e.apply(null,n);return o.no_newline||(i+="\n"),process.stdout.write(i),i}return t.register("echo",r,{allowGlobbing:!1}),Vc=r}function Zc(){if(Kc)return Xc;Kc=1;var e=$c();return Xc=function(){return e.state.error}}var el,tl={exports:{}};function rl(){return el||(el=1,function(e){if(require.main!==e)throw new Error("This file should not be required");var r=s,n=t,o=process.argv[2],i=n.readFileSync(o,"utf8"),a=JSON.parse(i),c=a.command,l=a.execOptions,u=a.pipe,f=a.stdoutFile,p=a.stderrFile,d=r.exec(c,l,(function(e){e?void 0===e.code?process.exitCode=1:process.exitCode=e.code:process.exitCode=0})),h=n.createWriteStream(f),m=n.createWriteStream(p);d.stdout.pipe(h),d.stderr.pipe(m),d.stdout.pipe(process.stdout),d.stderr.pipe(process.stderr),u&&d.stdin.end(u)}(tl)),tl.exports}tl.exports;var nl,ol,il,sl,al,cl,ll,ul,fl,pl,dl,hl,ml,gl,yl,bl,vl,wl,El,Sl,Ol,Il={};function Tl(){if(nl)return Il;nl=1;var r,n=$c(),o=e,i=t;function s(e){if(!e||!i.existsSync(e))return!1;if(!n.statFollowLinks(e).isDirectory())return!1;var t=e+"/"+n.randomFileName();try{return i.writeFileSync(t," "),n.unlinkSync(t),e}catch(e){return!1}}function a(){return r||(r=s(o.tmpdir())||s(process.env.TMPDIR)||s(process.env.TEMP)||s(process.env.TMP)||s(process.env.Wimp$ScrapDir)||s("C:\\TEMP")||s("C:\\TMP")||s("\\TEMP")||s("\\TMP")||s("/tmp")||s("/var/tmp")||s("/usr/tmp")||s("."))}return n.register("tempdir",a,{allowGlobbing:!1,wrapOutput:!1}),Il.tempDir=a,Il.isCached=function(){return r},Il.clearCache=function(){r=void 0},Il}function xl(){if(il)return ol;il=1;var e=r;function t(){return e.resolve(process.cwd())}return $c().register("pwd",t,{allowGlobbing:!1}),ol=t}function jl(){if(al)return sl;al=1;var e=$c(),n=Tl().tempDir,o=xl(),i=r,a=t,c=s,l=20971520,u=1;function f(t,r,s){r=r||{},t||e.error("must specify command");var f=e.readFromPipe();return"function"==typeof r&&(s=r,r={async:!0}),"object"==typeof r&&"function"==typeof s&&(r.async=!0),(r=e.extend({silent:e.config.silent,async:!1},r)).async?function(t,r,n,i){r=e.extend({silent:e.config.silent,cwd:o().toString(),env:process.env,maxBuffer:l,encoding:"utf8"},r);var s=c.exec(t,r,(function(e,t,r){i&&(e?void 0===e.code?i(1,t,r):i(e.code,t,r):i(0,t,r))}));return n&&s.stdin.end(n),r.silent||(s.stdout.pipe(process.stdout),s.stderr.pipe(process.stderr)),s}(t,r,f,s):function(t,r,s){e.config.execPath||e.error("Unable to find a path to the node binary. Please manually set config.execPath");var f=n(),p=i.resolve(f+"/"+e.randomFileName()),d=i.resolve(f+"/"+e.randomFileName()),h=i.resolve(f+"/"+e.randomFileName());r=e.extend({silent:e.config.silent,cwd:o().toString(),env:process.env,maxBuffer:l,encoding:"utf8"},r),a.existsSync(p)&&e.unlinkSync(p),a.existsSync(d)&&e.unlinkSync(d),a.existsSync(h)&&e.unlinkSync(h),r.cwd=i.resolve(r.cwd);var m={command:t,execOptions:r,pipe:s,stdoutFile:h,stderrFile:d};function g(e,t){a.writeFileSync(e,t,{encoding:"utf8",mode:parseInt("600",8)})}g(h,""),g(d,""),g(p,JSON.stringify(m));var y=[i.join(__dirname,"exec-child.js"),p];r.silent?r.stdio="ignore":r.stdio=[0,1,2];var b=0;try{delete r.shell,c.execFileSync(e.config.execPath,y,r)}catch(e){b=e.status||u}var v="",w="";"buffer"===r.encoding?(v=a.readFileSync(h),w=a.readFileSync(d)):(v=a.readFileSync(h,r.encoding),w=a.readFileSync(d,r.encoding));try{e.unlinkSync(p)}catch(e){}try{e.unlinkSync(d)}catch(e){}try{e.unlinkSync(h)}catch(e){}return 0!==b&&e.error(w,b,{continue:!0,silent:!0}),e.ShellString(v,w,b)}(t,r,f)}return e.register("exec",f,{unix:!1,canReceivePipe:!0,wrapOutput:!1}),sl=f}function Rl(){if(ll)return cl;ll=1;var e=r,n=t,o=$c(),i=Bc(),s=e.sep+"**";function a(t,r){t.all_deprecated&&(o.log("ls: Option -a is deprecated. Use -A instead"),t.all=!0),r=r?[].slice.call(arguments,1):["."];var a=[];function c(e,r,n){var i,s;"win32"===process.platform&&(r=r.replace(/\\/g,"/")),t.long?(n=n||(t.link?o.statFollowLinks(e):o.statNoFollowLinks(e)),a.push((i=r,(s=n).name=i,s.toString=function(){return[this.mode,this.nlink,this.uid,this.gid,this.size,this.mtime,this.name].join(" ")},s))):a.push(r)}return r.forEach((function(r){var a;try{if((a=t.link?o.statFollowLinks(r):o.statNoFollowLinks(r)).isSymbolicLink())try{var l=o.statFollowLinks(r);l.isDirectory()&&(a=l)}catch(e){}}catch(e){return void o.error("no such file or directory: "+r,2,{continue:!0})}a.isDirectory()&&!t.directory?t.recursive?i.sync(r+s,{dot:t.all,follow:t.link}).forEach((function(t){e.relative(r,t)&&c(t,e.relative(r,t))})):t.all?n.readdirSync(r).forEach((function(t){c(e.join(r,t),t)})):n.readdirSync(r).forEach((function(t){"."!==t[0]&&c(e.join(r,t),t)})):c(r,r,a)})),a}return o.register("ls",a,{cmdOptions:{R:"recursive",A:"all",L:"link",a:"all_deprecated",d:"directory",l:"long"}}),cl=a}function Al(){if(fl)return ul;fl=1;var e=r,t=$c(),n=Rl();function o(r,o){o?"string"==typeof o&&(o=[].slice.call(arguments,1)):t.error("no path specified");var i=[];function s(e){"win32"===process.platform&&(e=e.replace(/\\/g,"/")),i.push(e)}return o.forEach((function(r){var o;try{o=t.statFollowLinks(r)}catch(e){t.error("no such file or directory: "+r)}s(r),o.isDirectory()&&n({recursive:!0,all:!0},r).forEach((function(t){s(e.join(r,t))}))})),i}return t.register("find",o,{}),ul=o}function Dl(){if(dl)return pl;dl=1;var e=$c(),r=t;function n(t,n,o){var i=e.readFromPipe();o||i||e.error("no paths given",2),o=[].slice.call(arguments,2),i&&o.unshift("-");var s=[];return t.ignoreCase&&(n=new RegExp(n,"i")),o.forEach((function(o){if(r.existsSync(o)||"-"===o){var a="-"===o?i:r.readFileSync(o,"utf8");if(t.nameOnly)a.match(n)&&s.push(o);else a.split("\n").forEach((function(e){var r=e.match(n);(t.inverse&&!r||!t.inverse&&r)&&s.push(e)}))}else e.error("no such file or directory: "+o,2,{continue:!0})})),s.join("\n")+"\n"}return e.register("grep",n,{globStart:2,canReceivePipe:!0,cmdOptions:{v:"inverse",l:"nameOnly",i:"ignoreCase"}}),pl=n}function Nl(){if(ml)return hl;ml=1;var e=$c(),r=t;function n(t,n){var o=[],i=e.readFromPipe();n||i||e.error("no paths given");var s=1;!0===t.numLines?(s=2,t.numLines=Number(arguments[1])):!1===t.numLines&&(t.numLines=10),n=[].slice.call(arguments,s),i&&n.unshift("-");var a=!1;return n.forEach((function(n){if("-"!==n){if(!r.existsSync(n))return void e.error("no such file or directory: "+n,{continue:!0});if(e.statFollowLinks(n).isDirectory())return void e.error("error reading '"+n+"': Is a directory",{continue:!0})}var s;s="-"===n?i:t.numLines<0?r.readFileSync(n,"utf8"):function(t,n){for(var o=e.buffer(),i=o.length,s=i,a=0,c=r.openSync(t,"r"),l=0,u="";s===i&&l and/or "),r=String(r);var s=n.normalize(r).replace(RegExp(n.sep+"$"),""),a=n.resolve(r)===s;if(i=n.resolve(process.cwd(),String(i)),e.existsSync(i)&&(t.force||o.error("Destination file exists",{continue:!0}),e.unlinkSync(i)),t.symlink){var c="win32"===process.platform,l=c?"file":null,u=a?s:n.resolve(process.cwd(),n.dirname(i),r);e.existsSync(u)?c&&o.statFollowLinks(u).isDirectory()&&(l="junction"):o.error("Source file does not exist",{continue:!0});try{e.symlinkSync("junction"===l?u:r,i,l)}catch(e){o.error(e.message)}}else{e.existsSync(r)||o.error("Source file does not exist",{continue:!0});try{e.linkSync(r,i)}catch(e){o.error(e.message)}}return""}return o.register("ln",i,{cmdOptions:{s:"symlink",f:"force"}}),gl=i}function kl(){if(vl)return bl;vl=1;var e=$c(),n=t,o=r;function i(t){var r=o.dirname(t);r===t&&e.error("dirname() failed: ["+t+"]"),n.existsSync(r)||i(r),n.mkdirSync(t,parseInt("0777",8))}function s(t,r){return r||e.error("no paths given"),"string"==typeof r&&(r=[].slice.call(arguments,1)),r.forEach((function(r){try{var s=e.statNoFollowLinks(r);return void(t.fullpath?s.isFile()&&e.error("cannot create directory "+r+": File exists",{continue:!0}):e.error("path already exists: "+r,{continue:!0}))}catch(e){}var a=o.dirname(r);if(n.existsSync(a)||t.fullpath)try{t.fullpath?i(o.resolve(r)):n.mkdirSync(r,parseInt("0777",8))}catch(t){var c;if("EACCES"===t.code)c="Permission denied";else{if("ENOTDIR"!==t.code&&"ENOENT"!==t.code)throw t;c="Not a directory"}e.error("cannot create directory "+r+": "+c,{continue:!0})}else e.error("no such file or directory: "+a,{continue:!0})})),""}return e.register("mkdir",s,{cmdOptions:{p:"fullpath"}}),bl=s}function Cl(){if(El)return wl;El=1;var e=$c(),r=t;function n(t,i,s){var a;a=r.readdirSync(t);for(var c=0;c1e3)throw e}}catch(r){e.error("could not remove directory (code "+r.code+"): "+t,{continue:!0})}return u}}function o(e){var t=!0;try{var n=r.openSync(e,"a");r.closeSync(n)}catch(e){t=!1}return t}function i(t,r){return r||e.error("no paths given"),(r=[].slice.call(arguments,1)).forEach((function(r){var i;try{var s="/"===r[r.length-1]?r.slice(0,-1):r;i=e.statNoFollowLinks(s)}catch(n){return void(t.force||e.error("no such file or directory: "+r,{continue:!0}))}i.isFile()?function(t,r){r.force||o(t)?e.unlinkSync(t):e.error("permission denied: "+t,{continue:!0})}(r,t):i.isDirectory()?function(t,r){r.recursive?n(t,r.force):e.error("path is a directory",{continue:!0})}(r,t):i.isSymbolicLink()?function(t,r){var o;try{o=e.statFollowLinks(t)}catch(r){return void e.unlinkSync(t)}o.isFile()?e.unlinkSync(t):o.isDirectory()&&("/"===t[t.length-1]?r.recursive?n(t,r.force,!0):e.error("path is a directory",{continue:!0}):e.unlinkSync(t))}(r,t):i.isFIFO()&&function(t){e.unlinkSync(t)}(r)})),""}return e.register("rm",i,{cmdOptions:{f:"force",r:"recursive",R:"recursive"}}),wl=i}function Pl(){if(Ol)return Sl;Ol=1;var e=t,n=r,o=$c(),i=zc(),s=Cl();function a(t,r,a){arguments.length<3?o.error("missing and/or "):arguments.length>3?(r=[].slice.call(arguments,1,arguments.length-1),a=arguments[arguments.length-1]):"string"==typeof r?r=[r]:o.error("invalid arguments");var c=e.existsSync(a),l=c&&o.statFollowLinks(a);return c&&l.isDirectory()||!(r.length>1)||o.error("dest is not a directory (too many sources)"),c&&l.isFile()&&t.no_force&&o.error("dest file already exists: "+a),r.forEach((function(c,l){if(e.existsSync(c)){var u=a;if(e.existsSync(a)&&o.statFollowLinks(a).isDirectory()&&(u=n.normalize(a+"/"+n.basename(c))),e.existsSync(u)&&function(e,t){var r=e[t];return e.slice(0,t).some((function(e){return n.basename(e)===n.basename(r)}))}(r,l))t.no_force||o.error("will not overwrite just-created '"+u+"' with '"+c+"'",{continue:!0});else if(e.existsSync(u)&&t.no_force)o.error("dest file already exists: "+u,{continue:!0});else if(n.resolve(c)!==n.dirname(n.resolve(u)))try{e.renameSync(c,u)}catch(e){"EXDEV"===e.code&&(i("-r",c,u),s("-rf",c))}else o.error("cannot move to self: "+c,{continue:!0})}else o.error("no such file or directory: "+c,{continue:!0})})),""}return o.register("mv",a,{cmdOptions:{f:"!no_force",n:"no_force"}}),Sl=a}var Ml,_l={};function Fl(){return Ml||(Ml=1),_l}var Bl,$l,Ul,Gl,Wl,zl,ql,Vl,Hl,Xl,Kl,Yl,Ql,Jl,Zl,eu,tu,ru,nu,ou,iu,su,au={};function cu(){return Bl||(Bl=1),au}function lu(){if(Ul)return $l;Ul=1;var e=$c(),r=t;function n(t,n,o,i){var s=e.readFromPipe();"string"!=typeof o&&"function"!=typeof o&&("number"==typeof o?o=o.toString():e.error("invalid replacement string")),"string"==typeof n&&(n=RegExp(n)),i||s||e.error("no files given"),i=[].slice.call(arguments,3),s&&i.unshift("-");var a=[];return i.forEach((function(i){if(r.existsSync(i)||"-"===i){var c=("-"===i?s:r.readFileSync(i,"utf8")).split("\n").map((function(e){return e.replace(n,o)})).join("\n");a.push(c),t.inplace&&r.writeFileSync(i,c,"utf8")}else e.error("no such file or directory: "+i,2,{continue:!0})})),a.join("\n")}return e.register("sed",n,{globStart:3,canReceivePipe:!0,cmdOptions:{i:"inplace"}}),$l=n}function uu(){if(Wl)return Gl;Wl=1;var e=$c();function t(t){if(!t){var r=[].slice.call(arguments,0);r.length<2&&e.error("must provide an argument"),t=r[1]}var n="+"===t[0];n&&(t="-"+t.slice(1)),t=e.parseOptions(t,{e:"fatal",v:"verbose",f:"noglob"}),n&&Object.keys(t).forEach((function(e){t[e]=!t[e]})),Object.keys(t).forEach((function(r){n!==t[r]&&(e.config[r]=t[r])}))}return e.register("set",t,{allowGlobbing:!1,wrapOutput:!1}),Gl=t}function fu(){if(ql)return zl;ql=1;var e=$c(),r=t;function n(e){var t=e.match(/^\s*(\d*)\s*(.*)$/);return{num:Number(t[1]),value:t[2]}}function o(e,t){var r=e.toLowerCase(),n=t.toLowerCase();return r===n?-1*e.localeCompare(t):r.localeCompare(n)}function i(e,t){var r=n(e),i=n(t);return r.hasOwnProperty("num")&&i.hasOwnProperty("num")&&r.num!==i.num?r.num-i.num:o(r.value,i.value)}function s(t,n){var s=e.readFromPipe();n||s||e.error("no files given"),n=[].slice.call(arguments,1),s&&n.unshift("-");var a=n.reduce((function(t,n){if("-"!==n){if(!r.existsSync(n))return e.error("no such file or directory: "+n,{continue:!0}),t;if(e.statFollowLinks(n).isDirectory())return e.error("read failed: "+n+": Is a directory",{continue:!0}),t}var o="-"===n?s:r.readFileSync(n,"utf8");return t.concat(o.trimRight().split("\n"))}),[]).sort(t.numerical?i:o);return t.reverse&&(a=a.reverse()),a.join("\n")+"\n"}return e.register("sort",s,{canReceivePipe:!0,cmdOptions:{r:"reverse",n:"numerical"}}),zl=s}function pu(){if(Hl)return Vl;Hl=1;var e=$c(),r=t;function n(t,n){var o=[],i=e.readFromPipe();n||i||e.error("no paths given");var s=1;!0===t.numLines?(s=2,t.numLines=Number(arguments[1])):!1===t.numLines&&(t.numLines=10),t.numLines=-1*Math.abs(t.numLines),n=[].slice.call(arguments,s),i&&n.unshift("-");var a=!1;return n.forEach((function(n){if("-"!==n){if(!r.existsSync(n))return void e.error("no such file or directory: "+n,{continue:!0});if(e.statFollowLinks(n).isDirectory())return void e.error("error reading '"+n+"': Is a directory",{continue:!0})}var s=("-"===n?i:r.readFileSync(n,"utf8")).split("\n");""===s[s.length-1]?(s.pop(),a=!0):a=!1,o=o.concat(s.slice(t.numLines))})),a&&o.push(""),o.join("\n")}return e.register("tail",n,{canReceivePipe:!0,cmdOptions:{n:"numLines"}}),Vl=n}function du(){if(Kl)return Xl;Kl=1;var e=$c(),r=t;function n(t,n){n||e.error("no path given");var o=!1;if(Object.keys(t).forEach((function(e){!0===t[e]&&(o=!0)})),o||e.error("could not interpret expression"),t.link)try{return e.statNoFollowLinks(n).isSymbolicLink()}catch(e){return!1}if(!r.existsSync(n))return!1;if(t.exists)return!0;var i=e.statFollowLinks(n);return t.block?i.isBlockDevice():t.character?i.isCharacterDevice():t.directory?i.isDirectory():t.file?i.isFile():t.pipe?i.isFIFO():!!t.socket&&i.isSocket()}return e.register("test",n,{cmdOptions:{b:"block",c:"character",d:"directory",e:"exists",f:"file",L:"link",p:"pipe",S:"socket"},wrapOutput:!1,allowGlobbing:!1}),Xl=n}function hu(){if(Ql)return Yl;Ql=1;var e=$c(),n=t,o=r;function i(t,r){r||e.error("wrong arguments"),n.existsSync(o.dirname(r))||e.error("no such file or directory: "+o.dirname(r));try{return n.writeFileSync(r,this.stdout||this.toString(),"utf8"),this}catch(t){e.error("could not write to file (code "+t.code+"): "+r,{continue:!0})}}return e.register("to",i,{pipeOnly:!0,wrapOutput:!1}),Yl=i}function mu(){if(Zl)return Jl;Zl=1;var e=$c(),n=t,o=r;function i(t,r){r||e.error("wrong arguments"),n.existsSync(o.dirname(r))||e.error("no such file or directory: "+o.dirname(r));try{return n.appendFileSync(r,this.stdout||this.toString(),"utf8"),this}catch(t){e.error("could not append to file (code "+t.code+"): "+r,{continue:!0})}}return e.register("toEnd",i,{pipeOnly:!0,wrapOutput:!1}),Jl=i}function gu(){if(tu)return eu;tu=1;var e=$c(),r=t;function n(t,n){return n?"string"==typeof n?n=[].slice.call(arguments,1):e.error("file arg should be a string file path or an Array of string file paths"):e.error("no files given"),n.forEach((function(n){!function(t,n){var i=o(n);if(i&&i.isDirectory())return;if(!i&&t.no_create)return;r.closeSync(r.openSync(n,"a"));var s=new Date,a=t.date||s,c=t.date||s;if(t.reference){var l=o(t.reference);l||e.error("failed to get attributess of "+t.reference),a=l.mtime,c=l.atime}else t.date&&(a=t.date,c=t.date);t.atime_only&&t.mtime_only||(t.atime_only?a=i.mtime:t.mtime_only&&(c=i.atime));r.utimesSync(n,c,a)}(t,n)})),""}function o(t){try{return e.statFollowLinks(t)}catch(e){return null}}return e.register("touch",n,{cmdOptions:{a:"atime_only",c:"no_create",d:"date",m:"mtime_only",r:"reference"}}),eu=n}function yu(){if(nu)return ru;nu=1;var e=$c(),r=t;function n(t,n,o){var i=e.readFromPipe();i||(n||e.error("no input given"),r.existsSync(n)?e.statFollowLinks(n).isDirectory()&&e.error("error reading '"+n+"'"):e.error(n+": No such file or directory")),o&&r.existsSync(o)&&e.statFollowLinks(o).isDirectory()&&e.error(o+": Is a directory");var s=(n?r.readFileSync(n,"utf8"):i).trimRight().split("\n"),a=s.reduceRight((function(e,r){return 0===e.length?[{count:1,ln:r}]:0===function(e,r){return t.ignoreCase?e.toLocaleLowerCase().localeCompare(r.toLocaleLowerCase()):e.localeCompare(r)}(e[0].ln,r)?[{count:e[0].count+1,ln:r}].concat(e.slice(1)):[{count:1,ln:r}].concat(e)}),[]).filter((function(e){return!t.duplicates||e.count>1})).map((function(e){return(t.count?function(e,t){var r=""+t;return r.length0)||t.all);p++){var d=o.resolve(s[p],r);n&&(d=d.toUpperCase());var h=d.match(/\.[^<>:"/\|?*.]+$/);if(h&&f.indexOf(h[0])>=0){if(l(d)){u.push(d);break}}else for(var m=0;m0?t.all?u:u[0]:t.all?[]:null}return ou=u}function vu(){return su||(su={"/node_modules/shelljs/src/cat.js":Uc,"/node_modules/shelljs/src/cd.js":Gc,"/node_modules/shelljs/src/chmod.js":Wc,"/node_modules/shelljs/src/common.js":$c,"/node_modules/shelljs/src/cp.js":zc,"/node_modules/shelljs/src/dirs.js":Qc,"/node_modules/shelljs/src/echo.js":Jc,"/node_modules/shelljs/src/error.js":Zc,"/node_modules/shelljs/src/exec-child.js":rl,"/node_modules/shelljs/src/exec.js":jl,"/node_modules/shelljs/src/find.js":Al,"/node_modules/shelljs/src/grep.js":Dl,"/node_modules/shelljs/src/head.js":Nl,"/node_modules/shelljs/src/ln.js":Ll,"/node_modules/shelljs/src/ls.js":Rl,"/node_modules/shelljs/src/mkdir.js":kl,"/node_modules/shelljs/src/mv.js":Pl,"/node_modules/shelljs/src/popd.js":Fl,"/node_modules/shelljs/src/pushd.js":cu,"/node_modules/shelljs/src/pwd.js":xl,"/node_modules/shelljs/src/rm.js":Cl,"/node_modules/shelljs/src/sed.js":lu,"/node_modules/shelljs/src/set.js":uu,"/node_modules/shelljs/src/sort.js":fu,"/node_modules/shelljs/src/tail.js":pu,"/node_modules/shelljs/src/tempdir.js":Tl,"/node_modules/shelljs/src/test.js":du,"/node_modules/shelljs/src/to.js":hu,"/node_modules/shelljs/src/toEnd.js":mu,"/node_modules/shelljs/src/touch.js":gu,"/node_modules/shelljs/src/uniq.js":yu,"/node_modules/shelljs/src/which.js":bu})}function wu(e,t){var r,n=function(e){var t=e[0];if("/"===t||"\\"===t)return!1;var r=e[1],n=e[2];return!(!("."!==t||r&&"/"!==r&&"\\"!==r)||!("."!==t||"."!==r||n&&"/"!==n&&"\\"!==n))&&(":"!==r||"/"!==n&&"\\"!==n)}(e);"/"===(e=Eu(e))[0]&&(t="");for(var o=vu(),i=["",".js",".json"];!(r=Eu(n?t+"/node_modules/"+e:t+"/"+e)).endsWith("/..");){for(var s=0;s0&&".."!==t[n-1]&&"."!==t[n-1]&&(t.splice(--n,2),n--);return e=t.join("/"),r&&"/"!==e[0]?e="/"+e:0===e.length&&(e="."),e}var Su,Ou={},Iu=["cat","cd","chmod","cp","dirs","echo","exec","find","grep","head","ln","ls","mkdir","mv","pwd","rm","sed","set","sort","tail","tempdir","test","to","toEnd","touch","uniq","which"];function Tu(){if(Su)return Ou;Su=1;var e=$c();return Iu.forEach((function(e){!function(e){function t(t){var r=wu(t,e);if(null!==r)return vu()[r]();throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}return t.resolve=function(t){var r=wu(t,e);return null!==r?r:require.resolve(t)},t}("/node_modules/shelljs")("./src/"+e)})),Ou.exit=process.exit,Ou.error=Zc(),Ou.ShellString=e.ShellString,Ou.env=process.env,Ou.config=e.config,Ou}O(Iu);var xu=Tu(),ju=$c();Object.keys(xu).forEach((function(e){S[e]=xu[e]}));var Ru=hu();String.prototype.to=ju.wrap("to",Ru);var Au=mu();String.prototype.toEnd=ju.wrap("toEnd",Au),S.config.fatal=!0,S.target={};var Du,Nu=process.argv.slice(2),Lu=Nu.indexOf("--");Lu>-1&&(Du=Nu.slice(Lu+1,Nu.length),Nu=Nu.slice(0,Lu)),setTimeout((function(){var e;if(1!==Nu.length||"--help"!==Nu[0]){for(e in S.target)!function(e,t){S.target[e]=function(){return t.done||(t.done=!0,t.result=t.apply(t,arguments)),t.result}}(e,S.target[e]);Nu.length>0?Nu.forEach((function(e){e in S.target?S.target[e](Du):console.log("no such target: "+e)})):"all"in S.target&&S.target.all(Du)}else for(e in console.log("Available targets:"),S.target)console.log(" "+e)}),0);var ku=Sa,Cu=_e,Pu=Zt,Mu=es;Eo({target:"Iterator",proto:!0,real:!0},{every:function(e){Pu(this),Cu(e);var t=Mu(this),r=0;return!ku(t,(function(t,n){if(!e(t,r++))return n()}),{IS_RECORD:!0,INTERRUPTED:!0}).stopped}});var _u={exports:{}};!function(e,t){var r;t=_u.exports=y,r="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?function(){var e=Array.prototype.slice.call(arguments,0);e.unshift("SEMVER"),console.log.apply(console,e)}:function(){},t.SEMVER_SPEC_VERSION="2.0.0";var n=256,o=Number.MAX_SAFE_INTEGER||9007199254740991,i=n-6,s=t.re=[],a=t.safeRe=[],c=t.src=[],l=t.tokens={},u=0;function f(e){l[e]=u++}var p="[a-zA-Z0-9-]",d=[["\\s",1],["\\d",n],[p,i]];function h(e){for(var t=0;t)?=?)",f("XRANGEIDENTIFIERLOOSE"),c[l.XRANGEIDENTIFIERLOOSE]=c[l.NUMERICIDENTIFIERLOOSE]+"|x|X|\\*",f("XRANGEIDENTIFIER"),c[l.XRANGEIDENTIFIER]=c[l.NUMERICIDENTIFIER]+"|x|X|\\*",f("XRANGEPLAIN"),c[l.XRANGEPLAIN]="[v=\\s]*("+c[l.XRANGEIDENTIFIER]+")(?:\\.("+c[l.XRANGEIDENTIFIER]+")(?:\\.("+c[l.XRANGEIDENTIFIER]+")(?:"+c[l.PRERELEASE]+")?"+c[l.BUILD]+"?)?)?",f("XRANGEPLAINLOOSE"),c[l.XRANGEPLAINLOOSE]="[v=\\s]*("+c[l.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+c[l.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+c[l.XRANGEIDENTIFIERLOOSE]+")(?:"+c[l.PRERELEASELOOSE]+")?"+c[l.BUILD]+"?)?)?",f("XRANGE"),c[l.XRANGE]="^"+c[l.GTLT]+"\\s*"+c[l.XRANGEPLAIN]+"$",f("XRANGELOOSE"),c[l.XRANGELOOSE]="^"+c[l.GTLT]+"\\s*"+c[l.XRANGEPLAINLOOSE]+"$",f("COERCE"),c[l.COERCE]="(^|[^\\d])(\\d{1,16})(?:\\.(\\d{1,16}))?(?:\\.(\\d{1,16}))?(?:$|[^\\d])",f("COERCERTL"),s[l.COERCERTL]=new RegExp(c[l.COERCE],"g"),a[l.COERCERTL]=new RegExp(h(c[l.COERCE]),"g"),f("LONETILDE"),c[l.LONETILDE]="(?:~>?)",f("TILDETRIM"),c[l.TILDETRIM]="(\\s*)"+c[l.LONETILDE]+"\\s+",s[l.TILDETRIM]=new RegExp(c[l.TILDETRIM],"g"),a[l.TILDETRIM]=new RegExp(h(c[l.TILDETRIM]),"g");f("TILDE"),c[l.TILDE]="^"+c[l.LONETILDE]+c[l.XRANGEPLAIN]+"$",f("TILDELOOSE"),c[l.TILDELOOSE]="^"+c[l.LONETILDE]+c[l.XRANGEPLAINLOOSE]+"$",f("LONECARET"),c[l.LONECARET]="(?:\\^)",f("CARETTRIM"),c[l.CARETTRIM]="(\\s*)"+c[l.LONECARET]+"\\s+",s[l.CARETTRIM]=new RegExp(c[l.CARETTRIM],"g"),a[l.CARETTRIM]=new RegExp(h(c[l.CARETTRIM]),"g");f("CARET"),c[l.CARET]="^"+c[l.LONECARET]+c[l.XRANGEPLAIN]+"$",f("CARETLOOSE"),c[l.CARETLOOSE]="^"+c[l.LONECARET]+c[l.XRANGEPLAINLOOSE]+"$",f("COMPARATORLOOSE"),c[l.COMPARATORLOOSE]="^"+c[l.GTLT]+"\\s*("+c[l.LOOSEPLAIN]+")$|^$",f("COMPARATOR"),c[l.COMPARATOR]="^"+c[l.GTLT]+"\\s*("+c[l.FULLPLAIN]+")$|^$",f("COMPARATORTRIM"),c[l.COMPARATORTRIM]="(\\s*)"+c[l.GTLT]+"\\s*("+c[l.LOOSEPLAIN]+"|"+c[l.XRANGEPLAIN]+")",s[l.COMPARATORTRIM]=new RegExp(c[l.COMPARATORTRIM],"g"),a[l.COMPARATORTRIM]=new RegExp(h(c[l.COMPARATORTRIM]),"g");f("HYPHENRANGE"),c[l.HYPHENRANGE]="^\\s*("+c[l.XRANGEPLAIN]+")\\s+-\\s+("+c[l.XRANGEPLAIN]+")\\s*$",f("HYPHENRANGELOOSE"),c[l.HYPHENRANGELOOSE]="^\\s*("+c[l.XRANGEPLAINLOOSE]+")\\s+-\\s+("+c[l.XRANGEPLAINLOOSE]+")\\s*$",f("STAR"),c[l.STAR]="(<|>)?=?\\s*\\*";for(var m=0;mn)return null;if(!(t.loose?a[l.LOOSE]:a[l.FULL]).test(e))return null;try{return new y(e,t)}catch(e){return null}}function y(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof y){if(e.loose===t.loose)return e;e=e.version}else if("string"!=typeof e)throw new TypeError("Invalid Version: "+e);if(e.length>n)throw new TypeError("version is longer than "+n+" characters");if(!(this instanceof y))return new y(e,t);r("SemVer",e,t),this.options=t,this.loose=!!t.loose;var i=e.trim().match(t.loose?a[l.LOOSE]:a[l.FULL]);if(!i)throw new TypeError("Invalid Version: "+e);if(this.raw=e,this.major=+i[1],this.minor=+i[2],this.patch=+i[3],this.major>o||this.major<0)throw new TypeError("Invalid major version");if(this.minor>o||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>o||this.patch<0)throw new TypeError("Invalid patch version");i[4]?this.prerelease=i[4].split(".").map((function(e){if(/^[0-9]+$/.test(e)){var t=+e;if(t>=0&&t=0;)"number"==typeof this.prerelease[r]&&(this.prerelease[r]++,r=-2);-1===r&&this.prerelease.push(0)}t&&(this.prerelease[0]===t?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error("invalid increment argument: "+e)}return this.format(),this.raw=this.version,this},t.inc=function(e,t,r,n){"string"==typeof r&&(n=r,r=void 0);try{return new y(e,r).inc(t,n).version}catch(e){return null}},t.diff=function(e,t){if(O(e,t))return null;var r=g(e),n=g(t),o="";if(r.prerelease.length||n.prerelease.length){o="pre";var i="prerelease"}for(var s in r)if(("major"===s||"minor"===s||"patch"===s)&&r[s]!==n[s])return o+s;return i},t.compareIdentifiers=v;var b=/^[0-9]+$/;function v(e,t){var r=b.test(e),n=b.test(t);return r&&n&&(e=+e,t=+t),e===t?0:r&&!n?-1:n&&!r?1:e0}function S(e,t,r){return w(e,t,r)<0}function O(e,t,r){return 0===w(e,t,r)}function I(e,t,r){return 0!==w(e,t,r)}function T(e,t,r){return w(e,t,r)>=0}function x(e,t,r){return w(e,t,r)<=0}function j(e,t,r,n){switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e===r;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e!==r;case"":case"=":case"==":return O(e,r,n);case"!=":return I(e,r,n);case">":return E(e,r,n);case">=":return T(e,r,n);case"<":return S(e,r,n);case"<=":return x(e,r,n);default:throw new TypeError("Invalid operator: "+t)}}function R(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof R){if(e.loose===!!t.loose)return e;e=e.value}if(!(this instanceof R))return new R(e,t);e=e.trim().split(/\s+/).join(" "),r("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===A?this.value="":this.value=this.operator+this.semver.version,r("comp",this)}t.rcompareIdentifiers=function(e,t){return v(t,e)},t.major=function(e,t){return new y(e,t).major},t.minor=function(e,t){return new y(e,t).minor},t.patch=function(e,t){return new y(e,t).patch},t.compare=w,t.compareLoose=function(e,t){return w(e,t,!0)},t.compareBuild=function(e,t,r){var n=new y(e,r),o=new y(t,r);return n.compare(o)||n.compareBuild(o)},t.rcompare=function(e,t,r){return w(t,e,r)},t.sort=function(e,r){return e.sort((function(e,n){return t.compareBuild(e,n,r)}))},t.rsort=function(e,r){return e.sort((function(e,n){return t.compareBuild(n,e,r)}))},t.gt=E,t.lt=S,t.eq=O,t.neq=I,t.gte=T,t.lte=x,t.cmp=j,t.Comparator=R;var A={};function D(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof D)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new D(e.raw,t);if(e instanceof R)return new D(e.value,t);if(!(this instanceof D))return new D(e,t);if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map((function(e){return this.parseRange(e.trim())}),this).filter((function(e){return e.length})),!this.set.length)throw new TypeError("Invalid SemVer Range: "+this.raw);this.format()}function N(e,t){for(var r=!0,n=e.slice(),o=n.pop();r&&n.length;)r=n.every((function(e){return o.intersects(e,t)})),o=n.pop();return r}function L(e){return!e||"x"===e.toLowerCase()||"*"===e}function k(e,t,r,n,o,i,s,a,c,l,u,f,p){return((t=L(r)?"":L(n)?">="+r+".0.0":L(o)?">="+r+"."+n+".0":">="+t)+" "+(a=L(c)?"":L(l)?"<"+(+c+1)+".0.0":L(u)?"<"+c+"."+(+l+1)+".0":f?"<="+c+"."+l+"."+u+"-"+f:"<="+a)).trim()}function C(e,t,n){for(var o=0;o0){var i=e[o].semver;if(i.major===t.major&&i.minor===t.minor&&i.patch===t.patch)return!0}return!1}return!0}function P(e,t,r){try{t=new D(t,r)}catch(e){return!1}return t.test(e)}function M(e,t,r,n){var o,i,s,a,c;switch(e=new y(e,n),t=new D(t,n),r){case">":o=E,i=x,s=S,a=">",c=">=";break;case"<":o=S,i=T,s=E,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(P(e,t,n))return!1;for(var l=0;l=0.0.0")),f=f||e,p=p||e,o(e.semver,f.semver,n)?f=e:s(e.semver,p.semver,n)&&(p=e)})),f.operator===a||f.operator===c)return!1;if((!p.operator||p.operator===a)&&i(e,p.semver))return!1;if(p.operator===c&&s(e,p.semver))return!1}return!0}R.prototype.parse=function(e){var t=this.options.loose?a[l.COMPARATORLOOSE]:a[l.COMPARATOR],r=e.match(t);if(!r)throw new TypeError("Invalid comparator: "+e);this.operator=void 0!==r[1]?r[1]:"","="===this.operator&&(this.operator=""),r[2]?this.semver=new y(r[2],this.options.loose):this.semver=A},R.prototype.toString=function(){return this.value},R.prototype.test=function(e){if(r("Comparator.test",e,this.options.loose),this.semver===A||e===A)return!0;if("string"==typeof e)try{e=new y(e,this.options)}catch(e){return!1}return j(e,this.operator,this.semver,this.options)},R.prototype.intersects=function(e,t){if(!(e instanceof R))throw new TypeError("a Comparator is required");var r;if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),""===this.operator)return""===this.value||(r=new D(e.value,t),P(this.value,r,t));if(""===e.operator)return""===e.value||(r=new D(this.value,t),P(e.semver,r,t));var n=!(">="!==this.operator&&">"!==this.operator||">="!==e.operator&&">"!==e.operator),o=!("<="!==this.operator&&"<"!==this.operator||"<="!==e.operator&&"<"!==e.operator),i=this.semver.version===e.semver.version,s=!(">="!==this.operator&&"<="!==this.operator||">="!==e.operator&&"<="!==e.operator),a=j(this.semver,"<",e.semver,t)&&(">="===this.operator||">"===this.operator)&&("<="===e.operator||"<"===e.operator),c=j(this.semver,">",e.semver,t)&&("<="===this.operator||"<"===this.operator)&&(">="===e.operator||">"===e.operator);return n||o||i&&s||a||c},t.Range=D,D.prototype.format=function(){return this.range=this.set.map((function(e){return e.join(" ").trim()})).join("||").trim(),this.range},D.prototype.toString=function(){return this.range},D.prototype.parseRange=function(e){var t=this.options.loose,n=t?a[l.HYPHENRANGELOOSE]:a[l.HYPHENRANGE];e=e.replace(n,k),r("hyphen replace",e),e=e.replace(a[l.COMPARATORTRIM],"$1$2$3"),r("comparator trim",e,a[l.COMPARATORTRIM]),e=(e=(e=e.replace(a[l.TILDETRIM],"$1~")).replace(a[l.CARETTRIM],"$1^")).split(/\s+/).join(" ");var o=t?a[l.COMPARATORLOOSE]:a[l.COMPARATOR],i=e.split(" ").map((function(e){return function(e,t){return r("comp",e,t),e=function(e,t){return e.trim().split(/\s+/).map((function(e){return function(e,t){r("caret",e,t);var n=t.loose?a[l.CARETLOOSE]:a[l.CARET];return e.replace(n,(function(t,n,o,i,s){var a;return r("caret",e,t,n,o,i,s),L(n)?a="":L(o)?a=">="+n+".0.0 <"+(+n+1)+".0.0":L(i)?a="0"===n?">="+n+"."+o+".0 <"+n+"."+(+o+1)+".0":">="+n+"."+o+".0 <"+(+n+1)+".0.0":s?(r("replaceCaret pr",s),a="0"===n?"0"===o?">="+n+"."+o+"."+i+"-"+s+" <"+n+"."+o+"."+(+i+1):">="+n+"."+o+"."+i+"-"+s+" <"+n+"."+(+o+1)+".0":">="+n+"."+o+"."+i+"-"+s+" <"+(+n+1)+".0.0"):(r("no pr"),a="0"===n?"0"===o?">="+n+"."+o+"."+i+" <"+n+"."+o+"."+(+i+1):">="+n+"."+o+"."+i+" <"+n+"."+(+o+1)+".0":">="+n+"."+o+"."+i+" <"+(+n+1)+".0.0"),r("caret return",a),a}))}(e,t)})).join(" ")}(e,t),r("caret",e),e=function(e,t){return e.trim().split(/\s+/).map((function(e){return function(e,t){var n=t.loose?a[l.TILDELOOSE]:a[l.TILDE];return e.replace(n,(function(t,n,o,i,s){var a;return r("tilde",e,t,n,o,i,s),L(n)?a="":L(o)?a=">="+n+".0.0 <"+(+n+1)+".0.0":L(i)?a=">="+n+"."+o+".0 <"+n+"."+(+o+1)+".0":s?(r("replaceTilde pr",s),a=">="+n+"."+o+"."+i+"-"+s+" <"+n+"."+(+o+1)+".0"):a=">="+n+"."+o+"."+i+" <"+n+"."+(+o+1)+".0",r("tilde return",a),a}))}(e,t)})).join(" ")}(e,t),r("tildes",e),e=function(e,t){return r("replaceXRanges",e,t),e.split(/\s+/).map((function(e){return function(e,t){e=e.trim();var n=t.loose?a[l.XRANGELOOSE]:a[l.XRANGE];return e.replace(n,(function(n,o,i,s,a,c){r("xRange",e,n,o,i,s,a,c);var l=L(i),u=l||L(s),f=u||L(a),p=f;return"="===o&&p&&(o=""),c=t.includePrerelease?"-0":"",l?n=">"===o||"<"===o?"<0.0.0-0":"*":o&&p?(u&&(s=0),a=0,">"===o?(o=">=",u?(i=+i+1,s=0,a=0):(s=+s+1,a=0)):"<="===o&&(o="<",u?i=+i+1:s=+s+1),n=o+i+"."+s+"."+a+c):u?n=">="+i+".0.0"+c+" <"+(+i+1)+".0.0"+c:f&&(n=">="+i+"."+s+".0"+c+" <"+i+"."+(+s+1)+".0"+c),r("xRange return",n),n}))}(e,t)})).join(" ")}(e,t),r("xrange",e),e=function(e,t){return r("replaceStars",e,t),e.trim().replace(a[l.STAR],"")}(e,t),r("stars",e),e}(e,this.options)}),this).join(" ").split(/\s+/);return this.options.loose&&(i=i.filter((function(e){return!!e.match(o)}))),i=i.map((function(e){return new R(e,this.options)}),this)},D.prototype.intersects=function(e,t){if(!(e instanceof D))throw new TypeError("a Range is required");return this.set.some((function(r){return N(r,t)&&e.set.some((function(e){return N(e,t)&&r.every((function(r){return e.every((function(e){return r.intersects(e,t)}))}))}))}))},t.toComparators=function(e,t){return new D(e,t).set.map((function(e){return e.map((function(e){return e.value})).join(" ").trim().split(" ")}))},D.prototype.test=function(e){if(!e)return!1;if("string"==typeof e)try{e=new y(e,this.options)}catch(e){return!1}for(var t=0;t":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":r&&!E(r,t)||(r=t);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+e.operator)}}))}if(r&&e.test(r))return r;return null},t.validRange=function(e,t){try{return new D(e,t).range||"*"}catch(e){return null}},t.ltr=function(e,t,r){return M(e,t,"<",r)},t.gtr=function(e,t,r){return M(e,t,">",r)},t.outside=M,t.prerelease=function(e,t){var r=g(e,t);return r&&r.prerelease.length?r.prerelease:null},t.intersects=function(e,t,r){return e=new D(e,r),t=new D(t,r),e.intersects(t)},t.coerce=function(e,t){if(e instanceof y)return e;"number"==typeof e&&(e=String(e));if("string"!=typeof e)return null;var r=null;if((t=t||{}).rtl){for(var n;(n=a[l.COERCERTL].exec(e))&&(!r||r.index+r[0].length!==e.length);)r&&n.index+n[0].length===r.index+r[0].length||(r=n),a[l.COERCERTL].lastIndex=n.index+n[1].length+n[2].length;a[l.COERCERTL].lastIndex=-1}else r=e.match(a[l.COERCE]);if(null===r)return null;return g(r[2]+"."+(r[3]||"0")+"."+(r[4]||"0"),t)}}(0,_u.exports);var Fu=O(_u.exports);function Bu(e){if("object"!=typeof e||null===e)return!1;const t=Object.getPrototypeOf(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)}var $u=Sa,Uu=_e,Gu=Zt,Wu=es;Eo({target:"Iterator",proto:!0,real:!0},{find:function(e){Gu(this),Uu(e);var t=Wu(this),r=0;return $u(t,(function(t,n){if(e(t,r++))return n(t)}),{IS_RECORD:!0,INTERRUPTED:!0}).result}});var zu=Ys,qu=String,Vu=function(e){if("Symbol"===zu(e))throw new TypeError("Cannot convert a Symbol value to a string");return qu(e)},Hu=TypeError,Xu=function(e,t){if(e{const r=Sf(e);if("string"!=typeof r)throw new TypeError(`${t} must be a string or a file URL: ${r}.`);return r},Sf=e=>e instanceof URL?a.fileURLToPath(e):e,Of=(e,t=[],r={})=>{const n=Ef(e,"First argument"),[o,i]=Bu(t)?[[],t]:[t,r];if(!Array.isArray(o))throw new TypeError(`Second argument must be either an array of arguments or an options object: ${o}`);if(o.some((e=>"object"==typeof e&&null!==e)))throw new TypeError(`Second argument must be an array of strings: ${o}`);const s=o.map(String),a=s.find((e=>e.includes("\0")));if(void 0!==a)throw new TypeError(`Arguments cannot contain null bytes ("\\0"): ${a}`);if(!Bu(i))throw new TypeError(`Last argument must be an options object: ${i}`);return[n,s,i]};var If=z,Tf=Set.prototype,xf={Set:Set,add:If(Tf.add),has:If(Tf.has),remove:If(Tf.delete),proto:Tf},jf=xf.has,Rf=function(e){return jf(e),e},Af=L,Df=function(e,t,r){for(var n,o,i=r?e:e.iterator,s=e.next;!(n=Af(s,i)).done;)if(void 0!==(o=t(n.value)))return o},Nf=z,Lf=Df,kf=xf.Set,Cf=xf.proto,Pf=Nf(Cf.forEach),Mf=Nf(Cf.keys),_f=Mf(new kf).next,Ff=function(e,t,r){return r?Lf({iterator:Mf(e),next:_f},t):Pf(e,t)},Bf=Ff,$f=xf.Set,Uf=xf.add,Gf=function(e){var t=new $f;return Bf(e,(function(e){Uf(t,e)})),t},Wf=z,zf=_e,qf=function(e,t,r){try{return Wf(zf(Object.getOwnPropertyDescriptor(e,t)[r]))}catch(e){}},Vf=qf(xf.proto,"size","get")||function(e){return e.size},Hf=_e,Xf=Zt,Kf=L,Yf=In,Qf=es,Jf="Invalid size",Zf=RangeError,ep=TypeError,tp=Math.max,rp=function(e,t){this.set=e,this.size=tp(t,0),this.has=Hf(e.has),this.keys=Hf(e.keys)};rp.prototype={getIterator:function(){return Qf(Xf(Kf(this.keys,this.set)))},includes:function(e){return Kf(this.has,this.set,e)}};var np=function(e){Xf(e);var t=+e.size;if(t!=t)throw new ep(Jf);var r=Yf(t);if(r<0)throw new Zf(Jf);return new rp(e,r)},op=Rf,ip=Gf,sp=Vf,ap=np,cp=Ff,lp=Df,up=xf.has,fp=xf.remove,pp=de,dp=function(e){return{size:e,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}},hp=function(e){var t=pp("Set");try{(new t)[e](dp(0));try{return(new t)[e](dp(-1)),!1}catch(e){return!0}}catch(e){return!1}},mp=function(e){var t=op(this),r=ap(e),n=ip(t);return sp(t)<=r.size?cp(t,(function(e){r.includes(e)&&fp(n,e)})):lp(r.getIterator(),(function(e){up(t,e)&&fp(n,e)})),n};Eo({target:"Set",proto:!0,real:!0,forced:!hp("difference")},{difference:mp});var gp=Rf,yp=Vf,bp=np,vp=Ff,wp=Df,Ep=xf.Set,Sp=xf.add,Op=xf.has,Ip=j,Tp=function(e){var t=gp(this),r=bp(e),n=new Ep;return yp(t)>r.size?wp(r.getIterator(),(function(e){Op(t,e)&&Sp(n,e)})):vp(t,(function(e){r.includes(e)&&Sp(n,e)})),n};Eo({target:"Set",proto:!0,real:!0,forced:!hp("intersection")||Ip((function(){return"3,2"!==String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))}))},{intersection:Tp});var xp=Rf,jp=xf.has,Rp=Vf,Ap=np,Dp=Ff,Np=Df,Lp=is,kp=function(e){var t=xp(this),r=Ap(e);if(Rp(t)<=r.size)return!1!==Dp(t,(function(e){if(r.includes(e))return!1}),!0);var n=r.getIterator();return!1!==Np(n,(function(e){if(jp(t,e))return Lp(n,"normal",!1)}))};Eo({target:"Set",proto:!0,real:!0,forced:!hp("isDisjointFrom")},{isDisjointFrom:kp});var Cp=Rf,Pp=Vf,Mp=Ff,_p=np,Fp=function(e){var t=Cp(this),r=_p(e);return!(Pp(t)>r.size)&&!1!==Mp(t,(function(e){if(!r.includes(e))return!1}),!0)};Eo({target:"Set",proto:!0,real:!0,forced:!hp("isSubsetOf")},{isSubsetOf:Fp});var Bp=Rf,$p=xf.has,Up=Vf,Gp=np,Wp=Df,zp=is,qp=function(e){var t=Bp(this),r=Gp(e);if(Up(t)92||Nd&&Rd>94||Ad&&Rd>97)return!1;var e=new ArrayBuffer(8),t=Ld(e,{transfer:[e]});return 0!==e.byteLength||8!==t.byteLength})),Cd=T,Pd=function(e){try{if(Id)return Function('return require("'+e+'")')()}catch(e){}},Md=kd,_d=Cd.structuredClone,Fd=Cd.ArrayBuffer,Bd=Cd.MessageChannel,$d=!1;if(Md)$d=function(e){_d(e,{transfer:[e]})};else if(Fd)try{Bd||(gd=Pd("worker_threads"))&&(Bd=gd.MessageChannel),Bd&&(yd=new Bd,bd=new Fd(2),vd=function(e){yd.port1.postMessage(null,[e])},2===bd.byteLength&&(vd(bd),0===bd.byteLength&&($d=vd)))}catch(e){}var Ud=T,Gd=z,Wd=qf,zd=function(e){if(void 0===e)return 0;var t=wd(e),r=Ed(t);if(t!==r)throw new Sd("Wrong length or index");return r},qd=fd,Vd=cd,Hd=$d,Xd=kd,Kd=Ud.structuredClone,Yd=Ud.ArrayBuffer,Qd=Ud.DataView,Jd=Ud.TypeError,Zd=Math.min,eh=Yd.prototype,th=Qd.prototype,rh=Gd(eh.slice),nh=Wd(eh,"resizable","get"),oh=Wd(eh,"maxByteLength","get"),ih=Gd(th.getInt8),sh=Gd(th.setInt8),ah=(Xd||Hd)&&function(e,t,r){var n,o=Vd(e),i=void 0===t?o:zd(t),s=!nh||!nh(e);if(qd(e))throw new Jd("ArrayBuffer is detached");if(Xd&&(e=Kd(e,{transfer:[e]}),o===i&&(r||s)))return e;if(o>=i&&(!r||s))n=rh(e,0,i);else{var a=r&&!s&&oh?{maxByteLength:oh(e)}:void 0;n=new Yd(i,a);for(var c=new Qd(e),l=new Qd(n),u=Zd(i,o),f=0;f2?r:lm(t),i=new e(o);o>n;)i[n]=t[n++];return i},pm=im.aTypedArray,dm=im.getTypedArrayConstructor,hm=im.exportTypedArrayMethod,mm=z(im.TypedArrayPrototype.sort);hm("toSorted",(function(e){void 0!==e&&um(e);var t=pm(this),r=fm(dm(t),t);return mm(r,e)}));var gm=Ln,ym=In,bm=RangeError,vm=Ys,wm=At,Em=TypeError,Sm=function(e,t,r,n){var o=gm(e),i=ym(r),s=i<0?o+i:i;if(s>=o||s<0)throw new bm("Incorrect index");for(var a=new t(o),c=0;c"[object Uint8Array]"===Dm.call(e),Lm=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),km=new TextEncoder,Cm=e=>km.encode(e),Pm=new TextDecoder,Mm=e=>Pm.decode(e),_m=(e,t)=>{if("utf8"===t&&e.every((e=>"string"==typeof e)))return e;const r=new l.StringDecoder(t),n=e.map((e=>"string"==typeof e?Cm(e):e)).map((e=>r.write(e))),o=r.end();return""===o?n:[...n,o]},Fm=e=>1===e.length&&Nm(e[0])?e[0]:$m(Bm(e)),Bm=e=>e.map((e=>"string"==typeof e?Cm(e):e)),$m=e=>{const t=new Uint8Array(Um(e));let r=0;for(const n of e)t.set(n,r),r+=n.length;return t},Um=e=>{let t=0;for(const r of e)t+=r.length;return t},Gm=({templates:e,expressions:t,tokens:r,index:n,template:o})=>{if(void 0===o)throw new TypeError(`Invalid backslash sequence: ${e.raw[n]}`);const{nextTokens:i,leadingWhitespaces:s,trailingWhitespaces:a}=Wm(o,e.raw[n]),c=Vm(r,i,s);if(n===t.length)return c;const l=t[n],u=Array.isArray(l)?l.map((e=>Hm(e))):[Hm(l)];return Vm(c,u,a)},Wm=(e,t)=>{if(0===t.length)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};const r=[];let n=0;const o=zm.has(t[0]);for(let o=0,i=0;or||0===e.length||0===t.length?[...e,...t]:[...e.slice(0,-1),`${e.at(-1)}${t[0]}`,...t.slice(1)],Hm=e=>{const t=typeof e;if("string"===t)return e;if("number"===t)return String(e);if(Bu(e)&&("stdout"in e||"isMaxBuffer"in e))return Xm(e);if(e instanceof c.ChildProcess||"[object Promise]"===Object.prototype.toString.call(e))throw new TypeError("Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}.");throw new TypeError(`Unexpected "${t}" in template expression`)},Xm=({stdout:e})=>{if("string"==typeof e)return e;if(Nm(e))return Mm(e);if(void 0===e)throw new TypeError('Missing result.stdout in template expression. This is probably due to the previous subprocess\' "stdout" option.');throw new TypeError(`Unexpected "${typeof e}" stdout in template expression`)};function Km(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;nQm.includes(e),Qm=[f.stdin,f.stdout,f.stderr],Jm=["stdin","stdout","stderr"],Zm=e=>Jm[e]??`stdio[${e}]`,eg=(e,t)=>{const r=Array.from({length:tg(e)+1}),n=rg(e[t],r,t);return lg(n,t)},tg=({stdio:e})=>Array.isArray(e)?Math.max(e.length,Jm.length):Jm.length,rg=(e,t,r)=>Bu(e)?ng(e,t,r):t.fill(e),ng=(e,t,r)=>{for(const n of Object.keys(e).sort(og))for(const o of sg(n,r,t))t[o]=e[n];return t},og=(e,t)=>ig(e)"stdout"===e||"stderr"===e?0:"all"===e?2:1,sg=(e,t,r)=>{if("ipc"===e)return[r.length-1];const n=ag(e);if(void 0===n||0===n)throw new TypeError(`"${t}.${e}" is invalid.\nIt must be "${t}.stdout", "${t}.stderr", "${t}.all", "${t}.ipc", or "${t}.fd3", "${t}.fd4" (and so on).`);if(n>=r.length)throw new TypeError(`"${t}.${e}" is invalid: that file descriptor does not exist.\nPlease set the "stdio" option to ensure that file descriptor exists.`);return"all"===n?[1,2]:[n]},ag=e=>{if("all"===e)return e;if(Jm.includes(e))return Jm.indexOf(e);const t=cg.exec(e);return null!==t?Number(t[1]):void 0},cg=/^fd(\d+)$/,lg=(e,t)=>e.map((e=>void 0===e?ug[t]:e)),ug={lines:!1,buffer:!0,maxBuffer:1e8,verbose:u.debuglog("execa").enabled?"full":"none",stripFinalNewline:!0},fg=["lines","buffer","maxBuffer","verbose","stripFinalNewline"],pg=(e,t)=>"ipc"===t?e.at(-1):e[t],dg=({verbose:e},t)=>"none"!==mg(e,t),hg=({verbose:e},t)=>!["none","short"].includes(mg(e,t)),mg=(e,t)=>void 0===t?gg(e):pg(e,t),gg=e=>e.find((e=>yg(e)))??bg.findLast((t=>e.includes(t))),yg=e=>"function"==typeof e,bg=["none","short","full"],vg=e=>u.stripVTControlCharacters(e).split("\n").map((e=>wg(e))).join("\n"),wg=e=>e.replaceAll(Sg,(e=>Eg(e))),Eg=e=>{const t=Og[e];if(void 0!==t)return t;const r=e.codePointAt(0),n=r.toString(16);return r<=Ig?`\\u${n.padStart(4,"0")}`:`\\U${n}`},Sg=/\p{Separator}|\p{Other}/gu,Og={" ":" ","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t"},Ig=65535,Tg=e=>xg.test(e)?e:"win32"===f.platform?`"${e.replaceAll('"','""')}"`:`'${e.replaceAll("'","'\\''")}'`,xg=/^[\w./-]+$/;const jg={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:"╱"},Rg={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:"⅒"},Ag=Object.assign(Object.assign({},jg),Rg),Dg=Object.assign(Object.assign({},jg),{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"}),Ng=("win32"!==f.platform?"linux"!==f.env.TERM:Boolean(f.env.WT_SESSION)||Boolean(f.env.TERMINUS_SUBLIME)||"{cmd::Cmder}"===f.env.ConEmuTask||"Terminus-Sublime"===f.env.TERM_PROGRAM||"vscode"===f.env.TERM_PROGRAM||"xterm-256color"===f.env.TERM||"alacritty"===f.env.TERM||"JetBrains-JediTerm"===f.env.TERMINAL_EMULATOR)?Ag:Dg;Object.entries(Rg);const Lg=d?.WriteStream?.prototype?.hasColors?.()??!1,kg=(e,t)=>{if(!Lg)return e=>e;const r=`[${e}m`,n=`[${t}m`;return e=>{const t=e+"";let o=t.indexOf(n);if(-1===o)return r+t+n;let i=r,s=0;for(;-1!==o;)i+=t.slice(s,o)+r,s=o+n.length,o=t.indexOf(n,s);return i+=t.slice(s)+n,i}},Cg=kg(1,22),Pg=kg(90,39),Mg=kg(91,39),_g=kg(93,39),Fg=e=>`${Bg(e.getHours(),2)}:${Bg(e.getMinutes(),2)}:${Bg(e.getSeconds(),2)}.${Bg(e.getMilliseconds(),3)}`,Bg=(e,t)=>String(e).padStart(t,"0"),$g=({failed:e,reject:t})=>e?t?Ng.cross:Ng.warning:Ng.tick,Ug={command:({piped:e})=>e?"|":"$",output:()=>" ",ipc:()=>"*",error:$g,duration:$g},Gg=e=>e,Wg={command:()=>Cg,output:()=>Gg,ipc:()=>Gg,error:({reject:e})=>e?Mg:_g,duration:()=>Pg},zg=(e,t,r)=>{const n=(({verbose:e},t)=>{const r=mg(e,t);return yg(r)?r:void 0})(t,r);return e.map((({verboseLine:e,verboseObject:t})=>qg(e,t,n))).filter((e=>void 0!==e)).map((e=>Vg(e))).join("")},qg=(e,t,r)=>{if(void 0===r)return e;const n=r(e,t);return"string"==typeof n?n:void 0},Vg=e=>e.endsWith("\n")?e:`${e}\n`,Hg=["piped"],Xg=({type:e,verboseMessage:t,fdNumber:r,verboseInfo:n,result:o})=>{const i=Kg({type:e,result:o,verboseInfo:n}),s=Yg(t,i),a=zg(s,n,r);p.writeFileSync(Jg,a)},Kg=e=>{let{type:t,result:r,verboseInfo:{escapedCommand:n,commandId:o,rawOptions:{piped:i=!1}}}=e,s=Km(e.verboseInfo.rawOptions,Hg);return{type:t,escapedCommand:n,commandId:`${o}`,timestamp:new Date,piped:i,result:r,options:s}},Yg=(e,t)=>e.split("\n").map((e=>Qg(Object.assign(Object.assign({},t),{},{message:e})))),Qg=e=>({verboseLine:(({type:e,message:t,timestamp:r,piped:n,commandId:o,result:{failed:i=!1}={},options:{reject:s=!0}})=>{const a=Fg(r),c=Ug[e]({failed:i,reject:s,piped:n}),l=Wg[e]({reject:s});return`${Pg(`[${a}]`)} ${Pg(`[${o}]`)} ${l(c)} ${l(t)}`})(e),verboseObject:e}),Jg=2,Zg=e=>{const t="string"==typeof e?e:u.inspect(e);return vg(t).replaceAll("\t"," ".repeat(ey))},ey=2,ty=e=>dg({verbose:e})?ry++:void 0;let ry=0n;const ny=e=>{for(const t of e){if(!1===t)throw new TypeError('The "verbose: false" option was renamed to "verbose: \'none\'".');if(!0===t)throw new TypeError('The "verbose: true" option was renamed to "verbose: \'short\'".');if(!bg.includes(t)&&!yg(t)){const e=bg.map((e=>`'${e}'`)).join(", ");throw new TypeError(`The "verbose" option must not be ${t}. Allowed values are: ${e} or a function.`)}}},oy=()=>f.hrtime.bigint(),iy=e=>Number(f.hrtime.bigint()-e)/1e6,sy=(e,t,r)=>{const n=oy(),{command:o,escapedCommand:i}=((e,t)=>{const r=[e,...t];return{command:r.join(" "),escapedCommand:r.map((e=>Tg(wg(e)))).join(" ")}})(e,t),s=((e,t,r)=>(ny(e),{verbose:e,escapedCommand:t,commandId:ty(e),rawOptions:r}))(eg(r,"verbose"),i,Object.assign({},r));return((e,t)=>{dg(t)&&Xg({type:"command",verboseMessage:e,verboseInfo:t})})(i,s),{command:o,escapedCommand:i,startTime:n,verboseInfo:s}};var ay,cy,ly,uy,fy,py={exports:{}};fy="win32"===process.platform||S.TESTING_WINDOWS?function(){if(cy)return ay;cy=1,ay=n,n.sync=function(t,n){return r(e.statSync(t),t,n)};var e=t;function r(e,t,r){return!(!e.isSymbolicLink()&&!e.isFile())&&function(e,t){var r=void 0!==t.pathExt?t.pathExt:process.env.PATHEXT;if(!r)return!0;if(-1!==(r=r.split(";")).indexOf(""))return!0;for(var n=0;nObject.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),wy=(e,t)=>{const r=t.colon||yy,n=e.match(/\//)||my&&e.match(/\\/)?[""]:[...my?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(r)],o=my?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",i=my?o.split(r):[""];return my&&-1!==e.indexOf(".")&&""!==i[0]&&i.unshift(""),{pathEnv:n,pathExt:i,pathExtExe:o}},Ey=(e,t,r)=>{"function"==typeof t&&(r=t,t={}),t||(t={});const{pathEnv:n,pathExt:o,pathExtExe:i}=wy(e,t),s=[],a=r=>new Promise(((o,i)=>{if(r===n.length)return t.all&&s.length?o(s):i(vy(e));const a=n[r],l=/^".*"$/.test(a)?a.slice(1,-1):a,u=gy.join(l,e),f=!l&&/^\.[\\\/]/.test(e)?e.slice(0,2)+u:u;o(c(f,r,0))})),c=(e,r,n)=>new Promise(((l,u)=>{if(n===o.length)return l(a(r+1));const f=o[n];by(e+f,{pathExt:i},((o,i)=>{if(!o&&i){if(!t.all)return l(e+f);s.push(e+f)}return l(c(e,r,n+1))}))}));return r?a(0).then((e=>r(null,e)),r):a(0)};var Sy=Ey;Ey.sync=(e,t)=>{t=t||{};const{pathEnv:r,pathExt:n,pathExtExe:o}=wy(e,t),i=[];for(let s=0;s{const t=e.env||process.env;return"win32"!==(e.platform||process.platform)?"PATH":Object.keys(t).reverse().find((e=>"PATH"===e.toUpperCase()))||"Path"};Oy.exports=Iy,Oy.exports.default=Iy;var Ty=Oy.exports;O(Ty);const xy=r,jy=Sy,Ry=Ty;function Ay(e,t){const r=e.options.env||process.env,n=process.cwd(),o=null!=e.options.cwd,i=o&&void 0!==process.chdir&&!process.chdir.disabled;if(i)try{process.chdir(e.options.cwd)}catch(e){}let s;try{s=jy.sync(e.command,{path:r[Ry({env:r})],pathExt:t?xy.delimiter:void 0})}catch(e){}finally{i&&process.chdir(n)}return s&&(s=xy.resolve(o?e.options.cwd:"",s)),s}var Dy=function(e){return Ay(e)||Ay(e,!0)};O(Dy);var Ny={};const Ly=/([()\][%!^"`<>&|;, *?])/g;Ny.command=function(e){return e=e.replace(Ly,"^$1")},Ny.argument=function(e,t){return e=(e=`"${e=(e=(e=`${e}`).replace(/(\\*)"/g,'$1$1\\"')).replace(/(\\*)$/,"$1$1")}"`).replace(Ly,"^$1"),t&&(e=e.replace(Ly,"^$1")),e};var ky=/^#!(.*)/;O(ky);const Cy=ky;var Py=(e="")=>{const t=e.match(Cy);if(!t)return null;const[r,n]=t[0].replace(/#! ?/,"").split(" "),o=r.split("/").pop();return"env"===o?n:n?`${o} ${n}`:o};O(Py);const My=t,_y=Py;var Fy=function(e){const t=Buffer.alloc(150);let r;try{r=My.openSync(e,"r"),My.readSync(r,t,0,150,0),My.closeSync(r)}catch(e){}return _y(t.toString())};O(Fy);const By=r,$y=Dy,Uy=Ny,Gy=Fy,Wy="win32"===process.platform,zy=/\.(?:com|exe)$/i,qy=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function Vy(e){if(!Wy)return e;const t=function(e){e.file=$y(e);const t=e.file&&Gy(e.file);return t?(e.args.unshift(e.file),e.command=t,$y(e)):e.file}(e),r=!zy.test(t);if(e.options.forceShell||r){const r=qy.test(t);e.command=By.normalize(e.command),e.command=Uy.command(e.command),e.args=e.args.map((e=>Uy.argument(e,r)));const n=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${n}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}var Hy=function(e,t,r){t&&!Array.isArray(t)&&(r=t,t=null);const n={command:e,args:t=t?t.slice(0):[],options:r=Object.assign({},r),file:void 0,original:{command:e,args:t}};return r.shell?n:Vy(n)};O(Hy);const Xy="win32"===process.platform;function Ky(e,t){return Object.assign(new Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function Yy(e,t){return Xy&&1===e&&!t.file?Ky(t.original,"spawn"):null}var Qy={hookChildProcess:function(e,t){if(!Xy)return;const r=e.emit;e.emit=function(n,o){if("exit"===n){const n=Yy(o,t);if(n)return r.call(e,"error",n)}return r.apply(e,arguments)}},verifyENOENT:Yy,verifyENOENTSync:function(e,t){return Xy&&1===e&&!t.file?Ky(t.original,"spawnSync"):null},notFoundError:Ky};O(Qy);const Jy=s,Zy=Hy,eb=Qy;function tb(e,t,r){const n=Zy(e,t,r),o=Jy.spawn(n.command,n.args,n.options);return eb.hookChildProcess(o,n),o}py.exports=tb,py.exports.spawn=tb,py.exports.sync=function(e,t,r){const n=Zy(e,t,r),o=Jy.spawnSync(n.command,n.args,n.options);return o.error=o.error||eb.verifyENOENTSync(o.status,n),o},py.exports._parse=Zy,py.exports._enoent=eb;var rb=O(py.exports);function nb(e={}){const{env:t=process.env,platform:r=process.platform}=e;return"win32"!==r?"PATH":Object.keys(t).reverse().find((e=>"PATH"===e.toUpperCase()))||"Path"}const ob=["env"],ib=(e,t)=>{let r;for(;r!==t;)e.push(h.join(t,"node_modules/.bin")),r=t,t=h.resolve(t,"..")},sb=(e,t,r)=>{const n=t instanceof URL?a.fileURLToPath(t):t;e.push(h.resolve(r,n,".."))},ab=(e={})=>{let{env:t=f.env}=e,r=Km(e,ob);t=Object.assign({},t);const n=nb({env:t});return r.path=t[n],t[n]=(({cwd:e=f.cwd(),path:t=f.env[nb()],preferLocal:r=!0,execPath:n=f.execPath,addExecPath:o=!0}={})=>{const i=e instanceof URL?a.fileURLToPath(e):e,s=h.resolve(i),c=[];return r&&ib(c,s),o&&sb(c,n,s),[...c,t].join(h.delimiter)})(r),t};class cb extends Error{}const lb=(e,t)=>{Object.defineProperty(e.prototype,"name",{value:t,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,ub,{value:!0,writable:!1,enumerable:!1,configurable:!1})},ub=Symbol("isExecaError"),fb=e=>"[object Error]"===Object.prototype.toString.call(e);class pb extends Error{}lb(pb,pb.name);class db extends Error{}lb(db,db.name);const hb=(e,t)=>({name:`SIGRT${t+1}`,number:mb+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),mb=34,gb=64,yb=[{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"}],bb=()=>{const e=(()=>{const e=gb-mb+1;return Array.from({length:e},hb)})();return[...yb,...e].map(vb)},vb=({name:e,number:t,description:r,action:n,forced:o=!1,standard:i})=>{const{signals:{[e]:s}}=g.constants,a=void 0!==s;return{name:e,number:a?s:t,description:r,supported:a,action:n,forced:o,standard:i}},wb=({name:e,number:t,description:r,supported:n,action:o,forced:i,standard:s})=>[e,{name:e,number:t,description:r,supported:n,action:o,forced:i,standard:s}],Eb=(()=>{const e=bb();return Object.fromEntries(e.map(wb))})(),Sb=(e,t)=>{const r=Ob(e,t);if(void 0===r)return{};const{name:n,description:o,supported:i,action:s,forced:a,standard:c}=r;return{[e]:{name:n,number:e,description:o,supported:i,action:s,forced:a,standard:c}}},Ob=(e,t)=>{const r=t.find((({name:t})=>g.constants.signals[t]===e));return void 0!==r?r:t.find((t=>t.number===e))};(()=>{const e=bb(),t=gb+1,r=Array.from({length:t},((t,r)=>Sb(r,e)));Object.assign({},...r)})();const Ib=e=>0===e?e:Tb(e,"`subprocess.kill()`'s argument"),Tb=(e,t)=>{if(Number.isInteger(e))return xb(e,t);if("string"==typeof e)return Rb(e,t);throw new TypeError(`Invalid ${t} ${String(e)}: it must be a string or an integer.\n${Ab()}`)},xb=(e,t)=>{if(jb.has(e))return jb.get(e);throw new TypeError(`Invalid ${t} ${e}: this signal integer does not exist.\n${Ab()}`)},jb=new Map(Object.entries(g.constants.signals).reverse().map((([e,t])=>[t,e]))),Rb=(e,t)=>{if(e in g.constants.signals)return e;if(e.toUpperCase()in g.constants.signals)throw new TypeError(`Invalid ${t} '${e}': please rename it to '${e.toUpperCase()}'.`);throw new TypeError(`Invalid ${t} '${e}': this signal name does not exist.\n${Ab()}`)},Ab=()=>`Available signal names: ${Db()}.\nAvailable signal numbers: ${Nb()}.`,Db=()=>Object.keys(g.constants.signals).sort().map((e=>`'${e}'`)).join(", "),Nb=()=>[...new Set(Object.values(g.constants.signals).sort(((e,t)=>e-t)))].join(", "),Lb=e=>Eb[e].description,kb=5e3,Cb=({kill:e,options:{forceKillAfterDelay:t,killSignal:r},onInternalError:n,context:o,controller:i},s,a)=>{const{signal:c,error:l}=Pb(s,a,r);Mb(l,n);const u=e(c);return _b({kill:e,signal:c,forceKillAfterDelay:t,killSignal:r,killResult:u,context:o,controller:i}),u},Pb=(e,t,r)=>{const[n=r,o]=fb(e)?[void 0,e]:[e,t];if("string"!=typeof n&&!Number.isInteger(n))throw new TypeError(`The first argument must be an error instance or a signal name string/integer: ${String(n)}`);if(void 0!==o&&!fb(o))throw new TypeError(`The second argument is optional. If specified, it must be an error instance: ${o}`);return{signal:Ib(n),error:o}},Mb=(e,t)=>{void 0!==e&&t.reject(e)},_b=async({kill:e,signal:t,forceKillAfterDelay:r,killSignal:n,killResult:o,context:i,controller:s})=>{t===n&&o&&Fb({kill:e,forceKillAfterDelay:r,context:i,controllerSignal:s.signal})},Fb=async({kill:e,forceKillAfterDelay:t,context:r,controllerSignal:n})=>{if(!1!==t)try{await m.setTimeout(t,void 0,{signal:n}),e("SIGKILL")&&(r.isForcefullyTerminated??=!0)}catch{}},Bb=async(e,t)=>{e.aborted||await y.once(e,"abort",{signal:t})},$b=({subprocess:e,cancelSignal:t,gracefulCancel:r,context:n,controller:o})=>void 0===t||r?[]:[Ub(e,t,n,o)],Ub=async(e,t,r,{signal:n})=>{throw await Bb(t,n),r.terminationReason??="cancel",e.kill(),t.reason},Gb=({methodName:e,isSubprocess:t,ipc:r,isConnected:n})=>{Wb(e,t,r),zb(e,t,n)},Wb=(e,t,r)=>{if(!r)throw new Error(`${Kb(e,t)} can only be used if the \`ipc\` option is \`true\`.`)},zb=(e,t,r)=>{if(!r)throw new Error(`${Kb(e,t)} cannot be used: the ${Qb(t)} has already exited or disconnected.`)},qb=(e,t)=>new Error(`${Kb("sendMessage",t)} failed when sending an acknowledgment response to the ${Qb(t)}.`,{cause:e}),Vb=({code:e,message:t})=>Hb.has(e)||Xb.some((e=>t.includes(e))),Hb=new Set(["ERR_MISSING_ARGS","ERR_INVALID_ARG_TYPE"]),Xb=["could not be cloned","circular structure","call stack size exceeded"],Kb=(e,t,r="")=>"cancelSignal"===e?"`cancelSignal`'s `controller.abort()`":`${Yb(t)}${e}(${r})`,Yb=e=>e?"":"subprocess.",Qb=e=>e?"parent process":"subprocess",Jb=e=>{e.connected&&e.disconnect()},Zb=()=>{const e={},t=new Promise(((t,r)=>{Object.assign(e,{resolve:t,reject:r})}));return Object.assign(t,e)},ev=(e,t="stdin")=>{const{options:r,fileDescriptors:n}=rv.get(e),o=nv(n,t,true),i=e.stdio[o];if(null===i)throw new TypeError(sv(o,t,r,true));return i},tv=(e,t="stdout")=>{const{options:r,fileDescriptors:n}=rv.get(e),o=nv(n,t,false),i="all"===o?e.all:e.stdio[o];if(null==i)throw new TypeError(sv(o,t,r,false));return i},rv=new WeakMap,nv=(e,t,r)=>{const n=ov(t,r);return iv(n,t,r,e),n},ov=(e,t)=>{const r=ag(e);if(void 0!==r)return r;const{validOptions:n,defaultValue:o}=t?{validOptions:'"stdin"',defaultValue:"stdin"}:{validOptions:'"stdout", "stderr", "all"',defaultValue:"stdout"};throw new TypeError(`"${lv(t)}" must not be "${e}".\nIt must be ${n} or "fd3", "fd4" (and so on).\nIt is optional and defaults to "${o}".`)},iv=(e,t,r,n)=>{const o=n[cv(e)];if(void 0===o)throw new TypeError(`"${lv(r)}" must not be ${t}. That file descriptor does not exist.\nPlease set the "stdio" option to ensure that file descriptor exists.`);if("input"===o.direction&&!r)throw new TypeError(`"${lv(r)}" must not be ${t}. It must be a readable stream, not writable.`);if("input"!==o.direction&&r)throw new TypeError(`"${lv(r)}" must not be ${t}. It must be a writable stream, not readable.`)},sv=(e,t,r,n)=>{if("all"===e&&!r.all)return'The "all" option must be true to use "from: \'all\'".';const{optionName:o,optionValue:i}=av(e,r);return`The "${o}: ${uv(i)}" option is incompatible with using "${lv(n)}: ${uv(t)}".\nPlease set this option with "pipe" instead.`},av=(e,{stdin:t,stdout:r,stderr:n,stdio:o})=>{const i=cv(e);return 0===i&&void 0!==t?{optionName:"stdin",optionValue:t}:1===i&&void 0!==r?{optionName:"stdout",optionValue:r}:2===i&&void 0!==n?{optionName:"stderr",optionValue:n}:{optionName:`stdio[${i}]`,optionValue:o[i]}},cv=e=>"all"===e?1:e,lv=e=>e?"to":"from",uv=e=>"string"==typeof e?`'${e}'`:"number"==typeof e?`${e}`:"Stream",fv=(e,t,r)=>{const n=e.getMaxListeners();0!==n&&n!==Number.POSITIVE_INFINITY&&(e.setMaxListeners(n+t),y.addAbortListener(r,(()=>{e.setMaxListeners(e.getMaxListeners()-t)})))},pv=(e,t)=>{t&&dv(e)},dv=e=>{e.refCounted()},hv=(e,t)=>{t&&mv(e)},mv=e=>{e.unrefCounted()},gv=async({anyProcess:e,channel:t,isSubprocess:r,ipcEmitter:n},o)=>{if(xv(o)||zv(o))return;bv.has(e)||bv.set(e,[]);const i=bv.get(e);if(i.push(o),!(i.length>1))for(;i.length>0;){await Lv(e,n,o),await m.scheduler.yield();const s=await Tv({wrappedMessage:i[0],anyProcess:e,channel:t,isSubprocess:r,ipcEmitter:n});i.shift(),n.emit("message",s),n.emit("message:done")}},yv=async({anyProcess:e,channel:t,isSubprocess:r,ipcEmitter:n,boundOnMessage:o})=>{Vv();const i=bv.get(e);for(;i?.length>0;)await y.once(n,"message:done");e.removeListener("message",o),((e,t)=>{t&&(dv(e),dv(e))})(t,r),n.connected=!1,n.emit("disconnect")},bv=new WeakMap,vv=(e,t,r)=>{if(wv.has(e))return wv.get(e);const n=new y.EventEmitter;return n.connected=!0,wv.set(e,n),Ev({ipcEmitter:n,anyProcess:e,channel:t,isSubprocess:r}),n},wv=new WeakMap,Ev=({ipcEmitter:e,anyProcess:t,channel:r,isSubprocess:n})=>{const o=gv.bind(void 0,{anyProcess:t,channel:r,isSubprocess:n,ipcEmitter:e});t.on("message",o),t.once("disconnect",yv.bind(void 0,{anyProcess:t,channel:r,isSubprocess:n,ipcEmitter:e,boundOnMessage:o})),((e,t)=>{t&&(mv(e),mv(e))})(r,n)},Sv=e=>{const t=wv.get(e);return void 0===t?null!==e.channel:t.connected};let Ov=0n;const Iv=(e,t)=>{if(t?.type===Dv&&!t.hasListeners)for(const{id:t}of e)void 0!==t&&Rv[t].resolve({isDeadlock:!0,hasListeners:!1})},Tv=async({wrappedMessage:e,anyProcess:t,channel:r,isSubprocess:n,ipcEmitter:o})=>{if(e?.type!==Dv||!t.connected)return e;const{id:i,message:s}=e,a={id:i,type:Nv,message:Cv(t,o)};try{await Mv({anyProcess:t,channel:r,isSubprocess:n,ipc:!0},a)}catch(e){o.emit("strict:error",e)}return s},xv=e=>{if(e?.type!==Nv)return!1;const{id:t,message:r}=e;return Rv[t]?.resolve({isDeadlock:!1,hasListeners:r}),!0},jv=async(e,t,r)=>{if(e?.type!==Dv)return;const n=Zb();Rv[e.id]=n;const o=new AbortController;try{const{isDeadlock:e,hasListeners:i}=await Promise.race([n,Av(t,r,o)]);e&&(e=>{throw new Error(`${Kb("sendMessage",e)} failed: the ${Qb(e)} is sending a message too, instead of listening to incoming messages.\nThis can be fixed by both sending a message and listening to incoming messages at the same time:\n\nconst [receivedMessage] = await Promise.all([\n\t${Kb("getOneMessage",e)},\n\t${Kb("sendMessage",e,"message, {strict: true}")},\n]);`)})(r),i||(e=>{throw new Error(`${Kb("sendMessage",e)} failed: the ${Qb(e)} is not listening to incoming messages.`)})(r)}finally{o.abort(),delete Rv[e.id]}},Rv={},Av=async(e,t,{signal:r})=>{fv(e,1,r),await y.once(e,"disconnect",{signal:r}),(e=>{throw new Error(`${Kb("sendMessage",e)} failed: the ${Qb(e)} exited without listening to incoming messages.`)})(t)},Dv="execa:ipc:request",Nv="execa:ipc:response",Lv=async(e,t,r)=>{for(;!Cv(e,t)&&kv.get(e)?.size>0;){const t=[...kv.get(e)];Iv(t,r),await Promise.all(t.map((({onMessageSent:e})=>e)))}},kv=new WeakMap,Cv=(e,t)=>t.listenerCount("message")>Pv(e),Pv=e=>rv.has(e)&&!pg(rv.get(e).options.buffer,"ipc")?1:0,Mv=({anyProcess:e,channel:t,isSubprocess:r,ipc:n},o,{strict:i=!1}={})=>{const s="sendMessage";return Gb({methodName:s,isSubprocess:r,ipc:n,isConnected:e.connected}),_v({anyProcess:e,channel:t,methodName:s,isSubprocess:r,message:o,strict:i})},_v=async({anyProcess:e,channel:t,methodName:r,isSubprocess:n,message:o,strict:i})=>{const s=(({anyProcess:e,channel:t,isSubprocess:r,message:n,strict:o})=>{if(!o)return n;const i=vv(e,t,r),s=Cv(e,i);return{id:Ov++,type:Dv,message:n,hasListeners:s}})({anyProcess:e,channel:t,isSubprocess:n,message:o,strict:i}),a=((e,t,r)=>{kv.has(e)||kv.set(e,new Set);const n=kv.get(e),o={onMessageSent:Zb(),id:r?t.id:void 0};return n.add(o),{outgoingMessages:n,outgoingMessage:o}})(e,s,i);try{await Fv({anyProcess:e,methodName:r,isSubprocess:n,wrappedMessage:s,message:o})}catch(t){throw Jb(e),t}finally{(({outgoingMessages:e,outgoingMessage:t})=>{e.delete(t),t.onMessageSent.resolve()})(a)}},Fv=async({anyProcess:e,methodName:t,isSubprocess:r,wrappedMessage:n,message:o})=>{const i=Bv(e);try{await Promise.all([jv(n,e,r),i(n)])}catch(e){throw(({error:e,methodName:t,isSubprocess:r})=>{if("EPIPE"===e.code)throw new Error(`${Kb(t,r)} cannot be used: the ${Qb(r)} is disconnecting.`,{cause:e})})({error:e,methodName:t,isSubprocess:r}),(({error:e,methodName:t,isSubprocess:r,message:n})=>{if(Vb(e))throw new Error(`${Kb(t,r)}'s argument type is invalid: the message cannot be serialized: ${String(n)}.`,{cause:e})})({error:e,methodName:t,isSubprocess:r,message:o}),e}},Bv=e=>{if($v.has(e))return $v.get(e);const t=u.promisify(e.send.bind(e));return $v.set(e,t),t},$v=new WeakMap,Uv=async({anyProcess:e,channel:t,isSubprocess:r,ipc:n})=>(await Gv({anyProcess:e,channel:t,isSubprocess:r,ipc:n}),Hv.signal),Gv=async({anyProcess:e,channel:t,isSubprocess:r,ipc:n})=>{Wv||(Wv=!0,n?null!==t?(vv(e,t,r),await m.scheduler.yield()):Vv():(()=>{throw new Error("`getCancelSignal()` cannot be used without setting the `cancelSignal` subprocess option.")})())};let Wv=!1;const zv=e=>e?.type===qv&&(Hv.abort(e.message),!0),qv="execa:ipc:cancel",Vv=()=>{Hv.abort(new Error(`\`cancelSignal\` aborted: the ${Qb(!0)} disconnected.`))},Hv=new AbortController,Xv=({subprocess:e,cancelSignal:t,gracefulCancel:r,forceKillAfterDelay:n,context:o,controller:i})=>r?[Kv({subprocess:e,cancelSignal:t,forceKillAfterDelay:n,context:o,controller:i})]:[],Kv=async({subprocess:e,cancelSignal:t,forceKillAfterDelay:r,context:n,controller:{signal:o}})=>{await Bb(t,o);const i=Yv(t);throw await((e,t)=>{const r="cancelSignal";return zb(r,!1,e.connected),Fv({anyProcess:e,methodName:r,isSubprocess:!1,wrappedMessage:{type:qv,message:t},message:t})})(e,i),Fb({kill:e.kill,forceKillAfterDelay:r,context:n,controllerSignal:o}),n.terminationReason??="gracefulCancel",t.reason},Yv=({reason:e})=>{if(!(e instanceof DOMException))return e;const t=new Error(e.message);return Object.defineProperty(t,"stack",{value:e.stack,enumerable:!1,configurable:!0,writable:!0}),t},Qv=(e,t,r,n)=>0===t||void 0===t?[]:[Jv(e,t,r,n)],Jv=async(e,t,r,{signal:n})=>{throw await m.setTimeout(t,void 0,{signal:n}),r.terminationReason??="timeout",e.kill(),new cb},Zv=["node","nodePath","nodeOptions","cwd","execPath"],ew={advanced:e=>{try{b.serialize(e)}catch(e){throw new Error("The `ipcInput` option is not serializable with a structured clone.",{cause:e})}},json:e=>{try{JSON.stringify(e)}catch(e){throw new Error("The `ipcInput` option is not serializable with JSON.",{cause:e})}}},tw=async(e,t)=>{void 0!==t&&await e.sendMessage(t)},rw=new Set(["utf8","utf16le"]),nw=new Set(["buffer","hex","base64","base64url","latin1","ascii"]),ow=new Set([...rw,...nw]),iw=e=>{if(null===e)return"buffer";if("string"!=typeof e)return;const t=e.toLowerCase();return t in sw?sw[t]:ow.has(t)?t:void 0},sw={"utf-8":"utf8","utf-16le":"utf16le","ucs-2":"utf16le",ucs2:"utf16le",binary:"latin1"},aw=e=>"string"==typeof e?`"${e}"`:String(e),cw=()=>{try{return f.cwd()}catch(e){throw e.message=`The current directory does not exist.\n${e.message}`,e}},lw=["extendEnv","preferLocal","cwd","localDir","encoding","reject","cleanup","all","windowsHide","killSignal","forceKillAfterDelay","gracefulCancel","ipcInput","ipc","serialization"],uw=(e,t,r)=>{r.cwd=((e=cw())=>{const t=Ef(e,'The "cwd" option');return h.resolve(t)})(r.cwd);const[n,o,i]=((e,t,r)=>{let{node:n=!1,nodePath:o=f.execPath,nodeOptions:i=f.execArgv.filter((e=>!e.startsWith("--inspect"))),cwd:s,execPath:a}=r,c=Km(r,Zv);if(void 0!==a)throw new TypeError('The "execPath" option has been removed. Please use the "nodePath" option instead.');const l=Ef(o,'The "nodePath" option'),u=h.resolve(s,l),p=Object.assign(Object.assign({},c),{},{nodePath:u,node:n,cwd:s});if(!n)return[e,t,p];if("node"===h.basename(e,".exe"))throw new TypeError('When the "node" option is true, the first argument does not need to be "node".');return[u,[...i,e,...t],Object.assign(Object.assign({ipc:!0},p),{},{shell:!1})]})(e,t,r),{command:s,args:a,options:c}=rb._parse(n,o,i),l=(e=>{const t=Object.assign({},e);for(const r of fg)t[r]=eg(e,r);return t})(c),u=fw(l);return(({timeout:e})=>{if(void 0!==e&&(!Number.isFinite(e)||e<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`)})(u),(({encoding:e})=>{if(ow.has(e))return;const t=iw(e);if(void 0!==t)throw new TypeError(`Invalid option \`encoding: ${aw(e)}\`.\nPlease rename it to ${aw(t)}.`);const r=[...ow].map((e=>aw(e))).join(", ");throw new TypeError(`Invalid option \`encoding: ${aw(e)}\`.\nPlease rename it to one of: ${r}.`)})(u),(({ipcInput:e,ipc:t,serialization:r})=>{if(void 0!==e){if(!t)throw new Error("The `ipcInput` option cannot be set unless the `ipc` option is `true`.");ew[r](e)}})(u),(({cancelSignal:e})=>{if(void 0!==e&&"[object AbortSignal]"!==Object.prototype.toString.call(e))throw new Error(`The \`cancelSignal\` option must be an AbortSignal: ${String(e)}`)})(u),(({gracefulCancel:e,cancelSignal:t,ipc:r,serialization:n})=>{if(e){if(void 0===t)throw new Error("The `cancelSignal` option must be defined when setting the `gracefulCancel` option.");if(!r)throw new Error("The `ipc` option cannot be false when setting the `gracefulCancel` option.");if("json"===n)throw new Error("The `serialization` option cannot be 'json' when setting the `gracefulCancel` option.")}})(u),u.shell=Sf(u.shell),u.env=pw(u),u.killSignal=(e=>{const t="option `killSignal`";if(0===e)throw new TypeError(`Invalid ${t}: 0 cannot be used.`);return Tb(e,t)})(u.killSignal),u.forceKillAfterDelay=(e=>{if(!1===e)return e;if(!0===e)return kb;if(!Number.isFinite(e)||e<0)throw new TypeError(`Expected the \`forceKillAfterDelay\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);return e})(u.forceKillAfterDelay),u.lines=u.lines.map(((e,t)=>e&&!nw.has(u.encoding)&&u.buffer[t])),"win32"===f.platform&&"cmd"===h.basename(s,".exe")&&a.unshift("/q"),{file:s,commandArguments:a,options:u}},fw=e=>{let{extendEnv:t=!0,preferLocal:r=!1,cwd:n,localDir:o=n,encoding:i="utf8",reject:s=!0,cleanup:a=!0,all:c=!1,windowsHide:l=!0,killSignal:u="SIGTERM",forceKillAfterDelay:f=!0,gracefulCancel:p=!1,ipcInput:d,ipc:h=void 0!==d||p,serialization:m="advanced"}=e,g=Km(e,lw);return Object.assign(Object.assign({},g),{},{extendEnv:t,preferLocal:r,cwd:n,localDirectory:o,encoding:i,reject:s,cleanup:a,all:c,windowsHide:l,killSignal:u,forceKillAfterDelay:f,gracefulCancel:p,ipcInput:d,ipc:h,serialization:m})},pw=({env:e,extendEnv:t,preferLocal:r,node:n,localDirectory:o,nodePath:i})=>{const s=t?Object.assign(Object.assign({},f.env),e):e;return r||n?ab({env:s,cwd:o,execPath:i,preferLocal:r,addExecPath:n}):s};function dw(e){if("string"==typeof e)return hw(e);if(!ArrayBuffer.isView(e)||1!==e.BYTES_PER_ELEMENT)throw new Error("Input must be a string or a Uint8Array");return mw(e)}const hw=e=>e.at(-1)===gw?e.slice(0,e.at(-2)===bw?-2:-1):e,mw=e=>e.at(-1)===yw?e.subarray(0,e.at(-2)===vw?-2:-1):e,gw="\n",yw=gw.codePointAt(0),bw="\r",vw=bw.codePointAt(0);function ww(e,{checkOpen:t=!0}={}){return null!==e&&"object"==typeof e&&(e.writable||e.readable||!t||void 0===e.writable&&void 0===e.readable)&&"function"==typeof e.pipe}function Ew(e,{checkOpen:t=!0}={}){return ww(e,{checkOpen:t})&&(e.writable||!t)&&"function"==typeof e.write&&"function"==typeof e.end&&"boolean"==typeof e.writable&&"boolean"==typeof e.writableObjectMode&&"function"==typeof e.destroy&&"boolean"==typeof e.destroyed}function Sw(e,{checkOpen:t=!0}={}){return ww(e,{checkOpen:t})&&(e.readable||!t)&&"function"==typeof e.read&&"boolean"==typeof e.readable&&"boolean"==typeof e.readableObjectMode&&"function"==typeof e.destroy&&"boolean"==typeof e.destroyed}function Ow(e,t){return Ew(e,t)&&Sw(e,t)}const Iw=Object.getPrototypeOf(Object.getPrototypeOf((async function*(){})).prototype);class Tw{#e;#t;#r=!1;#n=void 0;constructor(e,t){this.#e=e,this.#t=t}next(){const e=()=>this.#o();return this.#n=this.#n?this.#n.then(e,e):e(),this.#n}return(e){const t=()=>this.#i(e);return this.#n?this.#n.then(t,t):t()}async#o(){if(this.#r)return{done:!0,value:void 0};let e;try{e=await this.#e.read()}catch(e){throw this.#n=void 0,this.#r=!0,this.#e.releaseLock(),e}return e.done&&(this.#n=void 0,this.#r=!0,this.#e.releaseLock()),e}async#i(e){if(this.#r)return{done:!0,value:e};if(this.#r=!0,!this.#t){const t=this.#e.cancel(e);return this.#e.releaseLock(),await t,{done:!0,value:e}}return this.#e.releaseLock(),{done:!0,value:e}}}const xw=Symbol();function jw(){return this[xw].next()}function Rw(e){return this[xw].return(e)}Object.defineProperty(jw,"name",{value:"next"}),Object.defineProperty(Rw,"name",{value:"return"});const Aw=Object.create(Iw,{next:{enumerable:!0,configurable:!0,writable:!0,value:jw},return:{enumerable:!0,configurable:!0,writable:!0,value:Rw}});function Dw({preventCancel:e=!1}={}){const t=this.getReader(),r=new Tw(t,e),n=Object.create(Aw);return n[xw]=r,n}const Nw=e=>{if(Sw(e,{checkOpen:!1})&&void 0!==Pw.on)return kw(e);if("function"==typeof e?.[Symbol.asyncIterator])return e;if("[object ReadableStream]"===Lw.call(e))return Dw.call(e);throw new TypeError("The first argument must be a Readable, a ReadableStream, or an async iterable.")},{toString:Lw}=Object.prototype,kw=async function*(e){const t=new AbortController,r={};Cw(e,t,r);try{for await(const[r]of Pw.on(e,"data",{signal:t.signal}))yield r}catch(e){if(void 0!==r.error)throw r.error;if(!t.signal.aborted)throw e}finally{e.destroy()}},Cw=async(e,t,r)=>{try{await Pw.finished(e,{cleanup:!0,readable:!0,writable:!1,error:!1})}catch(e){r.error=e}finally{t.abort()}},Pw={},Mw=async(e,{init:t,convertChunk:r,getSize:n,truncateChunk:o,addChunk:i,getFinalChunk:s,finalize:a},{maxBuffer:c=Number.POSITIVE_INFINITY}={})=>{const l=Nw(e),u=t();u.length=0;try{for await(const e of l){const t=r[$w(e)](e,u);Fw({convertedChunk:t,state:u,getSize:n,truncateChunk:o,addChunk:i,maxBuffer:c})}return _w({state:u,convertChunk:r,getSize:n,truncateChunk:o,addChunk:i,getFinalChunk:s,maxBuffer:c}),a(u)}catch(e){const t="object"==typeof e&&null!==e?e:new Error(e);throw t.bufferedData=a(u),t}},_w=({state:e,getSize:t,truncateChunk:r,addChunk:n,getFinalChunk:o,maxBuffer:i})=>{const s=o(e);void 0!==s&&Fw({convertedChunk:s,state:e,getSize:t,truncateChunk:r,addChunk:n,maxBuffer:i})},Fw=({convertedChunk:e,state:t,getSize:r,truncateChunk:n,addChunk:o,maxBuffer:i})=>{const s=r(e),a=t.length+s;if(a<=i)return void Bw(e,t,o,a);const c=n(e,i-t.length);throw void 0!==c&&Bw(c,t,o,i),new Gw},Bw=(e,t,r,n)=>{t.contents=r(e,t,n),t.length=n},$w=e=>{const t=typeof e;if("string"===t)return"string";if("object"!==t||null===e)return"others";if(globalThis.Buffer?.isBuffer(e))return"buffer";const r=Uw.call(e);return"[object ArrayBuffer]"===r?"arrayBuffer":"[object DataView]"===r?"dataView":Number.isInteger(e.byteLength)&&Number.isInteger(e.byteOffset)&&"[object ArrayBuffer]"===Uw.call(e.buffer)?"typedArray":"others"},{toString:Uw}=Object.prototype;class Gw extends Error{name="MaxBufferError";constructor(){super("maxBuffer exceeded")}}const Ww=e=>e,zw=()=>{},qw=({contents:e})=>e,Vw=e=>{throw new Error(`Streams in object mode are not supported: ${String(e)}`)},Hw=e=>e.length;const Xw={init:()=>({contents:[]}),convertChunk:{string:Ww,buffer:Ww,arrayBuffer:Ww,dataView:Ww,typedArray:Ww,others:Ww},getSize:()=>1,truncateChunk:zw,addChunk:(e,{contents:t})=>(t.push(e),t),getFinalChunk:zw,finalize:qw};const Kw=new TextEncoder,Yw=e=>new Uint8Array(e),Qw=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),Jw=(e,t)=>{if(t<=e.byteLength)return e;const r=new ArrayBuffer(eE(t));return new Uint8Array(r).set(new Uint8Array(e),0),r},Zw=(e,t)=>{if(t<=e.maxByteLength)return e.resize(t),e;const r=new ArrayBuffer(t,{maxByteLength:eE(t)});return new Uint8Array(r).set(new Uint8Array(e),0),r},eE=e=>tE**Math.ceil(Math.log(e)/Math.log(tE)),tE=2,rE=()=>"resize"in ArrayBuffer.prototype,nE={init:()=>({contents:new ArrayBuffer(0)}),convertChunk:{string:e=>Kw.encode(e),buffer:Yw,arrayBuffer:Yw,dataView:Qw,typedArray:Qw,others:Vw},getSize:Hw,truncateChunk:(e,t)=>e.slice(0,t),addChunk:(e,{contents:t,length:r},n)=>{const o=rE()?Zw(t,n):Jw(t,n);return new Uint8Array(o).set(e,r),o},getFinalChunk:zw,finalize:({contents:e,length:t})=>rE()?e:e.slice(0,t)};const oE=(e,{textDecoder:t})=>t.decode(e,{stream:!0}),iE={init:()=>({contents:"",textDecoder:new TextDecoder}),convertChunk:{string:Ww,buffer:oE,arrayBuffer:oE,dataView:oE,typedArray:oE,others:Vw},getSize:Hw,truncateChunk:(e,t)=>e.slice(0,t),addChunk:(e,{contents:t})=>t+e,getFinalChunk:({textDecoder:e})=>{const t=e.decode();return""===t?void 0:t},finalize:qw},sE=(e,t,r)=>e?"objects":t?"lines":"buffer"===r?"bytes":"characters",aE=(e,t,r)=>{if(t.length!==r)return;const n=new Gw;throw n.maxBufferInfo={fdNumber:"ipc"},n},cE=(e,t)=>{if(void 0===e?.maxBufferInfo)return{streamName:"output",threshold:t[1],unit:"bytes"};const{maxBufferInfo:{fdNumber:r,unit:n}}=e;delete e.maxBufferInfo;const o=pg(t,r);return"ipc"===r?{streamName:"IPC output",threshold:o,unit:"messages"}:{streamName:Zm(r),threshold:o,unit:n}},lE=([,e])=>e,uE=({originalError:e,timedOut:t,timeout:r,isMaxBuffer:n,maxBuffer:o,errorCode:i,signal:s,signalDescription:a,exitCode:c,isCanceled:l,isGracefullyCanceled:u,isForcefullyTerminated:f,forceKillAfterDelay:p,killSignal:d})=>{const h=fE(f,p);return t?`Command timed out after ${r} milliseconds${h}`:u?void 0===s?`Command was gracefully canceled with exit code ${c}`:f?`Command was gracefully canceled${h}`:`Command was gracefully canceled with ${s} (${a})`:l?`Command was canceled${h}`:n?`${((e,t)=>{const{streamName:r,threshold:n,unit:o}=cE(e,t);return`Command's ${r} was larger than ${n} ${o}`})(e,o)}${h}`:void 0!==i?`Command failed with ${i}${h}`:f?`Command was killed with ${d} (${Lb(d)})${h}`:void 0!==s?`Command was killed with ${s} (${a})`:void 0!==c?`Command failed with exit code ${c}`:"Command failed"},fE=(e,t)=>e?` and was forcefully terminated after ${t} milliseconds`:"",pE=(e,t)=>{if(e instanceof cb)return;const r=fb(n=e)&&ub in n?e.originalMessage:String(e?.message??e);var n;const o=vg(((e,t)=>{if(t===cw())return e;let r;try{r=p.statSync(t)}catch(r){return`The "cwd" option is invalid: ${t}.\n${r.message}\n${e}`}return r.isDirectory()?e:`The "cwd" option is not a directory: ${t}.\n${e}`})(r,t));return""===o?void 0:o},dE=e=>"string"==typeof e?e:u.inspect(e),hE=e=>Array.isArray(e)?e.map((e=>dw(mE(e)))).filter(Boolean).join("\n"):mE(e),mE=e=>"string"==typeof e?e:Nm(e)?Mm(e):"",gE=({command:e,escapedCommand:t,stdio:r,all:n,ipcOutput:o,options:{cwd:i},startTime:s})=>wE({command:e,escapedCommand:t,cwd:i,durationMs:iy(s),failed:!1,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isTerminated:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,exitCode:0,stdout:r[1],stderr:r[2],all:n,stdio:r,ipcOutput:o,pipedFrom:[]}),yE=({error:e,command:t,escapedCommand:r,fileDescriptors:n,options:o,startTime:i,isSync:s})=>bE({error:e,command:t,escapedCommand:r,startTime:i,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,stdio:Array.from({length:n.length}),ipcOutput:[],options:o,isSync:s}),bE=({error:e,command:t,escapedCommand:r,startTime:n,timedOut:o,isCanceled:i,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:l,signal:u,stdio:f,all:p,ipcOutput:d,options:{timeoutDuration:h,timeout:m=h,forceKillAfterDelay:g,killSignal:y,cwd:b,maxBuffer:v},isSync:w})=>{const{exitCode:E,signal:S,signalDescription:O}=EE(l,u),{originalMessage:I,shortMessage:T,message:x}=(({stdio:e,all:t,ipcOutput:r,originalError:n,signal:o,signalDescription:i,exitCode:s,escapedCommand:a,timedOut:c,isCanceled:l,isGracefullyCanceled:u,isMaxBuffer:f,isForcefullyTerminated:p,forceKillAfterDelay:d,killSignal:h,maxBuffer:m,timeout:g,cwd:y})=>{const b=n?.code,v=uE({originalError:n,timedOut:c,timeout:g,isMaxBuffer:f,maxBuffer:m,errorCode:b,signal:o,signalDescription:i,exitCode:s,isCanceled:l,isGracefullyCanceled:u,isForcefullyTerminated:p,forceKillAfterDelay:d,killSignal:h}),w=pE(n,y),E=`${v}: ${a}${void 0===w?"":`\n${w}`}`,S=[E,...void 0===t?[e[2],e[1]]:[t],...e.slice(3),r.map((e=>dE(e))).join("\n")].map((e=>vg(dw(hE(e))))).filter(Boolean).join("\n\n");return{originalMessage:w,shortMessage:E,message:S}})({stdio:f,all:p,ipcOutput:d,originalError:e,signal:S,signalDescription:O,exitCode:E,escapedCommand:r,timedOut:o,isCanceled:i,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,forceKillAfterDelay:g,killSignal:y,maxBuffer:v,timeout:m,cwd:b}),j=((e,t,r)=>new(r?db:pb)(t,e instanceof cb?{}:{cause:e}))(e,x,w);return Object.assign(j,vE({error:j,command:t,escapedCommand:r,startTime:n,timedOut:o,isCanceled:i,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:E,signal:S,signalDescription:O,stdio:f,all:p,ipcOutput:d,cwd:b,originalMessage:I,shortMessage:T})),j},vE=({error:e,command:t,escapedCommand:r,startTime:n,timedOut:o,isCanceled:i,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:l,signal:u,signalDescription:f,stdio:p,all:d,ipcOutput:h,cwd:m,originalMessage:g,shortMessage:y})=>wE({shortMessage:y,originalMessage:g,command:t,escapedCommand:r,cwd:m,durationMs:iy(n),failed:!0,timedOut:o,isCanceled:i,isGracefullyCanceled:s,isTerminated:void 0!==u,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:l,signal:u,signalDescription:f,code:e.cause?.code,stdout:p[1],stderr:p[2],all:d,stdio:p,ipcOutput:h,pipedFrom:[]}),wE=e=>Object.fromEntries(Object.entries(e).filter((([,e])=>void 0!==e))),EE=(e,t)=>{const r=null===t?void 0:t;return{exitCode:null===e?void 0:e,signal:r,signalDescription:void 0===r?void 0:Lb(t)}},SE=e=>Number.isFinite(e)?e:0;function OE(e){switch(typeof e){case"number":if(Number.isFinite(e))return function(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(SE(1e3*e)%1e3),nanoseconds:Math.trunc(SE(1e6*e)%1e3)}}(e);break;case"bigint":return function(e){return{days:e/86400000n,hours:e/3600000n%24n,minutes:e/60000n%60n,seconds:e/1000n%60n,milliseconds:e%1000n,microseconds:0n,nanoseconds:0n}}(e)}throw new TypeError("Expected a finite number or bigint")}const IE=24n*60n*60n*1000n;function TE(e,t){const r="bigint"==typeof e;if(!r&&!Number.isFinite(e))throw new TypeError("Expected a finite number or bigint");(t=Object.assign({},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 n=[];const o=(e,r,o,i)=>{if(0!==n.length&&t.colonNotation||!(e=>0===e||0n===e)(e)||t.colonNotation&&"m"===o){if(i=i??String(e),t.colonNotation){const e=i.includes(".")?i.split(".")[0].length:i.length,t=n.length>0?2:1;i="0".repeat(Math.max(0,t-e))+i}else i+=t.verbose?" "+((e,t)=>1===t||1n===t?e:`${e}s`)(r,e):o;n.push(i)}},i=OE(e),s=BigInt(i.days);if(o(s/365n,"year","y"),o(s%365n,"day","d"),o(Number(i.hours),"hour","h"),o(Number(i.minutes),"minute","m"),t.separateMilliseconds||t.formatSubMilliseconds||!t.colonNotation&&e<1e3){const e=Number(i.seconds),r=Number(i.milliseconds),n=Number(i.microseconds),s=Number(i.nanoseconds);if(o(e,"second","s"),t.formatSubMilliseconds)o(r,"millisecond","ms"),o(n,"microsecond","µs"),o(s,"nanosecond","ns");else{const e=r+n/1e3+s/1e6,i="number"==typeof t.millisecondsDecimalDigits?t.millisecondsDecimalDigits:0,a=e>=1?Math.round(e):Math.ceil(e),c=i?e.toFixed(i):a;o(Number.parseFloat(c),"millisecond","ms",c)}}else{const n=((e,t)=>{const r=Math.floor(e*10**t+1e-7);return(Math.round(r)/10**t).toFixed(t)})((r?Number(e%IE):e)/1e3%60,"number"==typeof t.secondsDecimalDigits?t.secondsDecimalDigits:1),i=t.keepDecimalsOnWholeSeconds?n:n.replace(/\.0+$/,"");o(Number.parseFloat(i),"second","s",i)}if(0===n.length)return"0"+(t.verbose?" milliseconds":"ms");const a=t.colonNotation?":":" ";return"number"==typeof t.unitCount&&(n=n.slice(0,Math.max(t.unitCount,1))),n.join(a)}const xE=(e,t)=>{dg(t)&&(((e,t)=>{e.failed&&Xg({type:"error",verboseMessage:e.shortMessage,verboseInfo:t,result:e})})(e,t),jE(e,t))},jE=(e,t)=>{const r=`(done in ${TE(e.durationMs)})`;Xg({type:"duration",verboseMessage:r,verboseInfo:t,result:e})},RE=(e,t,{reject:r})=>{if(xE(e,t),e.failed&&r)throw e;return e},AE=(e,t)=>FE(e)?"asyncGenerator":BE(e)?"generator":UE(e)?"fileUrl":GE(e)?"filePath":HE(e)?"webStream":ww(e,{checkOpen:!1})?"native":Nm(e)?"uint8Array":KE(e)?"asyncIterable":YE(e)?"iterable":XE(e)?LE({transform:e},t):$E(e)?DE(e,t):"native",DE=(e,t)=>Ow(e.transform,{checkOpen:!1})?NE(e,t):XE(e.transform)?LE(e,t):PE(e,t),NE=(e,t)=>(kE(e,t,"Duplex stream"),"duplex"),LE=(e,t)=>(kE(e,t,"web TransformStream"),"webTransform"),kE=({final:e,binary:t,objectMode:r},n,o)=>{CE(e,`${n}.final`,o),CE(t,`${n}.binary`,o),ME(r,`${n}.objectMode`)},CE=(e,t,r)=>{if(void 0!==e)throw new TypeError(`The \`${t}\` option can only be defined when using a generator, not a ${r}.`)},PE=({transform:e,final:t,binary:r,objectMode:n},o)=>{if(void 0!==e&&!_E(e))throw new TypeError(`The \`${o}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(Ow(t,{checkOpen:!1}))throw new TypeError(`The \`${o}.final\` option must not be a Duplex stream.`);if(XE(t))throw new TypeError(`The \`${o}.final\` option must not be a web TransformStream.`);if(void 0!==t&&!_E(t))throw new TypeError(`The \`${o}.final\` option must be a generator.`);return ME(r,`${o}.binary`),ME(n,`${o}.objectMode`),FE(e)||FE(t)?"asyncGenerator":"generator"},ME=(e,t)=>{if(void 0!==e&&"boolean"!=typeof e)throw new TypeError(`The \`${t}\` option must use a boolean.`)},_E=e=>FE(e)||BE(e),FE=e=>"[object AsyncGeneratorFunction]"===Object.prototype.toString.call(e),BE=e=>"[object GeneratorFunction]"===Object.prototype.toString.call(e),$E=e=>Bu(e)&&(void 0!==e.transform||void 0!==e.final),UE=e=>"[object URL]"===Object.prototype.toString.call(e),GE=e=>Bu(e)&&1===Object.keys(e).length&&WE(e.file),WE=e=>"string"==typeof e,zE=new Set(["ipc","ignore","inherit","overlapped","pipe"]),qE=e=>"[object ReadableStream]"===Object.prototype.toString.call(e),VE=e=>"[object WritableStream]"===Object.prototype.toString.call(e),HE=e=>qE(e)||VE(e),XE=e=>qE(e?.readable)&&VE(e?.writable),KE=e=>QE(e)&&"function"==typeof e[Symbol.asyncIterator],YE=e=>QE(e)&&"function"==typeof e[Symbol.iterator],QE=e=>"object"==typeof e&&null!==e,JE=new Set(["generator","asyncGenerator","duplex","webTransform"]),ZE=new Set(["fileUrl","filePath","fileNumber"]),eS=new Set(["fileUrl","filePath"]),tS=new Set([...eS,"webStream","nodeStream"]),rS=new Set(["webTransform","duplex"]),nS={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"},oS=(e,t,r,n)=>"output"===n?iS(e,t,r):sS(e,t,r),iS=(e,t,r)=>{const n=0!==t&&r[t-1].value.readableObjectMode;return{writableObjectMode:n,readableObjectMode:e??n}},sS=(e,t,r)=>{const n=0===t?!0===e:r[t-1].value.readableObjectMode;return{writableObjectMode:n,readableObjectMode:t!==r.length-1&&(e??n)}},aS=(e,t,r,{encoding:n})=>{const o=e.filter((({type:e})=>JE.has(e))),i=Array.from({length:o.length});for(const[e,s]of Object.entries(o))i[e]=cS({stdioItem:s,index:Number(e),newTransforms:i,optionName:t,direction:r,encoding:n});return pS(i,r)},cS=({stdioItem:e,stdioItem:{type:t},index:r,newTransforms:n,optionName:o,direction:i,encoding:s})=>"duplex"===t?lS({stdioItem:e,optionName:o}):"webTransform"===t?uS({stdioItem:e,index:r,newTransforms:n,direction:i}):fS({stdioItem:e,index:r,newTransforms:n,direction:i,encoding:s}),lS=({stdioItem:e,stdioItem:{value:{transform:t,transform:{writableObjectMode:r,readableObjectMode:n},objectMode:o=n}},optionName:i})=>{if(o&&!n)throw new TypeError(`The \`${i}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`);if(!o&&n)throw new TypeError(`The \`${i}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`);return Object.assign(Object.assign({},e),{},{value:{transform:t,writableObjectMode:r,readableObjectMode:n}})},uS=({stdioItem:e,stdioItem:{value:t},index:r,newTransforms:n,direction:o})=>{const{transform:i,objectMode:s}=Bu(t)?t:{transform:t},{writableObjectMode:a,readableObjectMode:c}=oS(s,r,n,o);return Object.assign(Object.assign({},e),{},{value:{transform:i,writableObjectMode:a,readableObjectMode:c}})},fS=({stdioItem:e,stdioItem:{value:t},index:r,newTransforms:n,direction:o,encoding:i})=>{const{transform:s,final:a,binary:c=!1,preserveNewlines:l=!1,objectMode:u}=Bu(t)?t:{transform:t},f=c||nw.has(i),{writableObjectMode:p,readableObjectMode:d}=oS(u,r,n,o);return Object.assign(Object.assign({},e),{},{value:{transform:s,final:a,binary:f,preserveNewlines:l,writableObjectMode:p,readableObjectMode:d}})},pS=(e,t)=>"input"===t?e.reverse():e,dS=({type:e,value:t},r)=>hS[r]??yS[e](t),hS=["input","output","output"],mS=()=>{},gS=()=>"input",yS={generator:mS,asyncGenerator:mS,fileUrl:mS,filePath:mS,iterable:gS,asyncIterable:gS,uint8Array:gS,webStream:e=>VE(e)?"output":"input",nodeStream:e=>Sw(e,{checkOpen:!1})?Ew(e,{checkOpen:!1})?void 0:"input":"output",webTransform:mS,duplex:mS,native(e){const t=bS(e);return void 0!==t?t:ww(e,{checkOpen:!1})?yS.nodeStream(e):void 0}},bS=e=>[0,f.stdin].includes(e)?"input":[1,2,f.stdout,f.stderr].includes(e)?"output":void 0,vS="output",wS=["stdio","ipc","buffer"],ES=(e,t)=>{if(void 0===e)return Jm.map((e=>t[e]));if(SS(t))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${Jm.map((e=>`\`${e}\``)).join(", ")}`);if("string"==typeof e)return[e,e,e];if(!Array.isArray(e))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof e}\``);const r=Math.max(e.length,Jm.length);return Array.from({length:r},((t,r)=>e[r]))},SS=e=>Jm.some((t=>void 0!==e[t])),OS=(e,t)=>Array.isArray(e)?e.map((e=>OS(e,t))):null==e?t>=Jm.length?"ignore":"pipe":e,IS=(e,t,r)=>e.map(((e,n)=>t[n]||0===n||hg(r,n)||!TS(e)?e:"ignore")),TS=e=>"pipe"===e||Array.isArray(e)&&e.every((e=>"pipe"===e)),xS=({stdioItem:e,stdioItem:{value:t,optionName:r},fdNumber:n,direction:o})=>{const i=jS({value:t,optionName:r,fdNumber:n,direction:o});if(void 0!==i)return i;if(ww(t,{checkOpen:!1}))throw new TypeError(`The \`${r}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return e},jS=({value:e,optionName:t,fdNumber:r,direction:n})=>{const o=RS(e,r);if(void 0!==o){if("output"===n)return{type:"fileNumber",value:o,optionName:t};if(d.isatty(o))throw new TypeError(`The \`${t}: ${uv(e)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:"uint8Array",value:Lm(p.readFileSync(o)),optionName:t}}},RS=(e,t)=>{if("inherit"===e)return t;if("number"==typeof e)return e;const r=Qm.indexOf(e);return-1!==r?r:void 0},AS=({stdioItem:e,stdioItem:{value:t,optionName:r},fdNumber:n})=>"inherit"===t?{type:"nodeStream",value:DS(n,t,r),optionName:r}:"number"==typeof t?{type:"nodeStream",value:DS(t,t,r),optionName:r}:ww(t,{checkOpen:!1})?{type:"nodeStream",value:t,optionName:r}:e,DS=(e,t,r)=>{const n=Qm[e];if(void 0===n)throw new TypeError(`The \`${r}: ${t}\` option is invalid: no such standard stream.`);return n},NS=({input:e,inputFile:t},r)=>0===r?[...LS(e),...CS(t)]:[],LS=e=>void 0===e?[]:[{type:kS(e),value:e,optionName:"input"}],kS=e=>{if(Sw(e,{checkOpen:!1}))return"nodeStream";if("string"==typeof e)return"string";if(Nm(e))return"uint8Array";throw new Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},CS=e=>void 0===e?[]:[Object.assign(Object.assign({},PS(e)),{},{optionName:"inputFile"})],PS=e=>{if(UE(e))return{type:"fileUrl",value:e};if(WE(e))return{type:"filePath",value:{file:e}};throw new Error("The `inputFile` option must be a file path string or a file URL.")};var MS=L,_S=Zt,FS=es,BS=ra,$S=Eo,US=L,GS=_e,WS=Zt,zS=es,qS=function(e,t){t&&"string"==typeof e||_S(e);var r=BS(e);return FS(_S(void 0!==r?MS(r,e):e))},VS=is,HS=Ss((function(){for(var e,t,r=this.iterator,n=this.mapper;;){if(t=this.inner)try{if(!(e=WS(US(t.next,t.iterator))).done)return e.value;this.inner=null}catch(e){VS(r,"throw",e)}if(e=WS(US(this.next,r)),this.done=!!e.done)return;try{this.inner=qS(n(e.value,this.counter++),!1)}catch(e){VS(r,"throw",e)}}}));$S({target:"Iterator",proto:!0,real:!0,forced:false},{flatMap:function(e){return WS(this),GS(e),new HS(zS(this),{mapper:e,inner:null})}});const XS=(e,t)=>e.flatMap((({direction:e,stdioItems:r})=>r.filter((e=>e.type===t)).map((t=>Object.assign(Object.assign({},t),{},{direction:e}))))),KS=({otherStdioItems:e,type:t,value:r,optionName:n,direction:o})=>{eS.has(t)&&YS({otherStdioItems:e,type:t,value:r,optionName:n,direction:o})},YS=({otherStdioItems:e,type:t,value:r,optionName:n,direction:o})=>{const i=e.filter((e=>QS(e,r)));if(0===i.length)return;const s=i.find((e=>e.direction!==o));return ZS(s,n,t),"output"===o?i[0].stream:void 0},QS=({type:e,value:t},r)=>"filePath"===e?t.file===r.file:"fileUrl"===e?t.href===r.href:t===r,JS=({otherStdioItems:e,type:t,value:r,optionName:n})=>{const o=e.find((({value:{transform:e}})=>e===r.transform));ZS(o,n,t)},ZS=(e,t,r)=>{if(void 0!==e)throw new TypeError(`The \`${e.optionName}\` and \`${t}\` options must not target ${nS[r]} that is the same.`)},eO=(e,t,r,n)=>{const o=((e,t,r)=>{let{stdio:n,ipc:o,buffer:i}=e,s=Km(e,wS);const a=ES(n,s).map(((e,t)=>OS(e,t)));return r?IS(a,i,t):((e,t)=>t&&!e.includes("ipc")?[...e,"ipc"]:e)(a,o)})(t,r,n),i=o.map(((e,r)=>tO({stdioOption:e,fdNumber:r,options:t,isSync:n}))),s=lO({initialFileDescriptors:i,addProperties:e,options:t,isSync:n});return t.stdio=s.map((({stdioItems:e})=>dO(e))),s},tO=({stdioOption:e,fdNumber:t,options:r,isSync:n})=>{const o=Zm(t),{stdioItems:i,isStdioArray:s}=rO({stdioOption:e,fdNumber:t,options:r,optionName:o}),a=((e,t,r)=>{const n=e.map((e=>dS(e,t)));if(n.includes("input")&&n.includes("output"))throw new TypeError(`The \`${r}\` option must not be an array of both readable and writable values.`);return n.find(Boolean)??vS})(i,t,o),c=i.map((e=>(({stdioItem:e,stdioItem:{type:t},isStdioArray:r,fdNumber:n,direction:o,isSync:i})=>r&&"native"===t?i?xS({stdioItem:e,fdNumber:n,direction:o}):AS({stdioItem:e,fdNumber:n}):e)({stdioItem:e,isStdioArray:s,fdNumber:t,direction:a,isSync:n}))),l=((e,t,r,n)=>[...e.filter((({type:e})=>!JE.has(e))),...aS(e,t,r,n)])(c,o,a,r),u=((e,t)=>{const r=e.findLast((({type:e})=>JE.has(e)));return void 0!==r&&("input"===t?r.value.writableObjectMode:r.value.readableObjectMode)})(l,a);return cO(l,u),{direction:a,objectMode:u,stdioItems:l}},rO=({stdioOption:e,fdNumber:t,options:r,optionName:n})=>{const o=(e=>e.filter(((t,r)=>e.every(((e,n)=>t.value!==e.value||r>=n||"generator"===t.type||"asyncGenerator"===t.type)))))([...(Array.isArray(e)?e:[e]).map((e=>nO(e,n))),...NS(r,t)]),i=o.length>1;return oO(o,i,n),sO(o),{stdioItems:o,isStdioArray:i}},nO=(e,t)=>({type:AE(e,t),value:e,optionName:t}),oO=(e,t,r)=>{if(0===e.length)throw new TypeError(`The \`${r}\` option must not be an empty array.`);if(t)for(const{value:t,optionName:r}of e)if(iO.has(t))throw new Error(`The \`${r}\` option must not include \`${t}\`.`)},iO=new Set(["ignore","ipc"]),sO=e=>{for(const t of e)aO(t)},aO=({type:e,value:t,optionName:r})=>{if((e=>UE(e)&&"file:"!==e.protocol)(t))throw new TypeError(`The \`${r}: URL\` option must use the \`file:\` scheme.\nFor example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`);if(((e,t)=>"native"===e&&"string"==typeof t&&!zE.has(t))(e,t))throw new TypeError(`The \`${r}: { file: '...' }\` option must be used instead of \`${r}: '...'\`.`)},cO=(e,t)=>{if(!t)return;const r=e.find((({type:e})=>ZE.has(e)));if(void 0!==r)throw new TypeError(`The \`${r.optionName}\` option cannot use both files and transforms in objectMode.`)},lO=({initialFileDescriptors:e,addProperties:t,options:r,isSync:n})=>{const o=[];try{for(const i of e)o.push(uO({fileDescriptor:i,fileDescriptors:o,addProperties:t,options:r,isSync:n}));return o}catch(e){throw pO(o),e}},uO=({fileDescriptor:{direction:e,objectMode:t,stdioItems:r},fileDescriptors:n,addProperties:o,options:i,isSync:s})=>{const a=r.map((t=>fO({stdioItem:t,addProperties:o,direction:e,options:i,fileDescriptors:n,isSync:s})));return{direction:e,objectMode:t,stdioItems:a}},fO=({stdioItem:e,addProperties:t,direction:r,options:n,fileDescriptors:o,isSync:i})=>{const s=(({stdioItem:{type:e,value:t,optionName:r},direction:n,fileDescriptors:o,isSync:i})=>{const s=XS(o,e);if(0!==s.length){if(!i)return tS.has(e)?YS({otherStdioItems:s,type:e,value:t,optionName:r,direction:n}):void(rS.has(e)&&JS({otherStdioItems:s,type:e,value:t,optionName:r}));KS({otherStdioItems:s,type:e,value:t,optionName:r,direction:n})}})({stdioItem:e,direction:r,fileDescriptors:o,isSync:i});return void 0!==s?Object.assign(Object.assign({},e),{},{stream:s}):Object.assign(Object.assign({},e),t[r][e.type](e,n))},pO=e=>{for(const{stdioItems:t}of e)for(const{stream:e}of t)void 0===e||Ym(e)||e.destroy()},dO=e=>{if(e.length>1)return e.some((({value:e})=>"overlapped"===e))?"overlapped":"pipe";const[{type:t,value:r}]=e;return"native"===t?r:"pipe"},hO=({type:e,optionName:t})=>{mO(t,nS[e])},mO=(e,t)=>{throw new TypeError(`The \`${e}\` option cannot be ${t} with synchronous methods.`)},gO={generator(){},asyncGenerator:hO,webStream:hO,nodeStream:hO,webTransform:hO,duplex:hO,asyncIterable:hO,native:({optionName:e,value:t})=>("ipc"!==t&&"overlapped"!==t||mO(e,`"${t}"`),{})},yO={input:Object.assign(Object.assign({},gO),{},{fileUrl:({value:e})=>({contents:[Lm(p.readFileSync(e))]}),filePath:({value:{file:e}})=>({contents:[Lm(p.readFileSync(e))]}),fileNumber:hO,iterable:({value:e})=>({contents:[...e]}),string:({value:e})=>({contents:[e]}),uint8Array:({value:e})=>({contents:[e]})}),output:Object.assign(Object.assign({},gO),{},{fileUrl:({value:e})=>({path:e}),filePath:({value:{file:e}})=>({path:e}),fileNumber:({value:e})=>({path:e}),iterable:hO,string:hO,uint8Array:hO})},bO=(e,{stripFinalNewline:t},r)=>vO(t,r)&&void 0!==e&&!Array.isArray(e)?dw(e):e,vO=(e,t)=>"all"===t?e[1]||e[2]:e[t],wO=(e,t,r,n)=>e||r?void 0:OO(t,n),EO=(e,t,r)=>r?e.flatMap((e=>SO(e,t))):SO(e,t),SO=(e,t)=>{const{transform:r,final:n}=OO(t,{});return[...r(e),...n()]},OO=(e,t)=>(t.previousChunks="",{transform:IO.bind(void 0,t,e),final:xO.bind(void 0,t)}),IO=function*(e,t,r){if("string"!=typeof r)return void(yield r);let{previousChunks:n}=e,o=-1;for(let i=0;i0&&(a=AO(n,a),n=""),yield a,o=i}o!==r.length-1&&(n=AO(n,r.slice(o+1))),e.previousChunks=n},TO=(e,t,r,n)=>r?0:(n.isWindowsNewline=0!==t&&"\r"===e[t-1],n.isWindowsNewline?2:1),xO=function*({previousChunks:e}){e.length>0&&(yield e)},jO=({binary:e,preserveNewlines:t,readableObjectMode:r,state:n})=>e||t||r?void 0:{transform:RO.bind(void 0,n)},RO=function*({isWindowsNewline:e=!1},t){const{unixNewline:r,windowsNewline:n,LF:o,concatBytes:i}="string"==typeof t?DO:NO;if(t.at(-1)===o)return void(yield t);const s=e?n:r;yield i(t,s)},AO=(e,t)=>`${e}${t}`,DO={windowsNewline:"\r\n",unixNewline:"\n",LF:"\n",concatBytes:AO},NO={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:(e,t)=>{const r=new Uint8Array(e.length+t.length);return r.set(e,0),r.set(t,e.length),r}},LO=(e,t)=>e?void 0:kO.bind(void 0,t),kO=function*(e,t){if("string"!=typeof t&&!Nm(t)&&!w.Buffer.isBuffer(t))throw new TypeError(`The \`${e}\` option's transform must use "objectMode: true" to receive as input: ${typeof t}.`);yield t},CO=(e,t)=>e?PO.bind(void 0,t):MO.bind(void 0,t),PO=function*(e,t){_O(e,t),yield t},MO=function*(e,t){if(_O(e,t),"string"!=typeof t&&!Nm(t))throw new TypeError(`The \`${e}\` option's function must yield a string or an Uint8Array, not ${typeof t}.`);yield t},_O=(e,t)=>{if(null==t)throw new TypeError(`The \`${e}\` option's function must not call \`yield ${t}\`.\nInstead, \`yield\` should either be called with a value, or not be called at all. For example:\n if (condition) { yield value; }`)},FO=(e,t,r)=>{if(r)return;if(e)return{transform:BO.bind(void 0,new TextEncoder)};const n=new l.StringDecoder(t);return{transform:$O.bind(void 0,n),final:UO.bind(void 0,n)}},BO=function*(e,t){w.Buffer.isBuffer(t)?yield Lm(t):"string"==typeof t?yield e.encode(t):yield t},$O=function*(e,t){yield Nm(t)?e.write(t):t},UO=function*(e){const t=e.end();""!==t&&(yield t)},GO=u.callbackify((async(e,t,r,n)=>{t.currentIterable=e(...r);try{for await(const e of t.currentIterable)n.push(e)}finally{delete t.currentIterable}})),WO=async function*(e,t,r){if(r===t.length)return void(yield e);const{transform:n=HO}=t[r];for await(const o of n(e))yield*WO(o,t,r+1)},zO=async function*(e){for(const[t,{final:r}]of Object.entries(e))yield*qO(r,Number(t),e)},qO=async function*(e,t,r){if(void 0!==e)for await(const n of e())yield*WO(n,r,t+1)},VO=u.callbackify((async({currentIterable:e},t)=>{if(void 0===e){if(t)throw t}else await(t?e.throw(t):e.return())})),HO=function*(e){yield e},XO=(e,t,r,n)=>{try{for(const n of e(...t))r.push(n);n()}catch(e){n(e)}},KO=(e,t)=>[...t.flatMap((t=>[...YO(t,e,0)])),...QO(e)],YO=function*(e,t,r){if(r===t.length)return void(yield e);const{transform:n=ZO}=t[r];for(const o of n(e))yield*YO(o,t,r+1)},QO=function*(e){for(const[t,{final:r}]of Object.entries(e))yield*JO(r,Number(t),e)},JO=function*(e,t,r){if(void 0!==e)for(const n of e())yield*YO(n,r,t+1)},ZO=function*(e){yield e},eI=({value:e,value:{transform:t,final:r,writableObjectMode:n,readableObjectMode:o},optionName:i},{encoding:s})=>{const a={},c=rI(e,s,i),l=FE(t),u=FE(r),f=l?GO.bind(void 0,WO,a):XO.bind(void 0,YO),p=l||u?GO.bind(void 0,zO,a):XO.bind(void 0,QO),d=l||u?VO.bind(void 0,a):void 0;return{stream:new v.Transform({writableObjectMode:n,writableHighWaterMark:v.getDefaultHighWaterMark(n),readableObjectMode:o,readableHighWaterMark:v.getDefaultHighWaterMark(o),transform(e,t,r){f([e,c,0],this,r)},flush(e){p([c],this,e)},destroy:d})}},tI=(e,t,r,n)=>{const o=t.filter((({type:e})=>"generator"===e)),i=n?o.reverse():o;for(const{value:t,optionName:n}of i){const o=rI(t,r,n);e=KO(o,e)}return e},rI=({transform:e,final:t,binary:r,writableObjectMode:n,readableObjectMode:o,preserveNewlines:i},s,a)=>{const c={};return[{transform:LO(n,a)},FO(r,s,n),wO(r,i,n,c),{transform:e,final:t},{transform:CO(o,a)},jO({binary:r,preserveNewlines:i,readableObjectMode:o,state:c})].filter(Boolean)},nI=e=>new Set(Object.entries(e).filter((([,{direction:e}])=>"input"===e)).map((([e])=>Number(e)))),oI=(e,t,r)=>{const{stdioItems:n}=e[t],o=n.filter((({contents:e})=>void 0!==e));if(0===o.length)return;if(0!==t){const[{type:e,optionName:t}]=o;throw new TypeError(`Only the \`stdin\` option, not \`${t}\`, can be ${nS[e]} with synchronous methods.`)}const i=o.map((({contents:e})=>e)).map((e=>iI(e,n)));r.input=Fm(i)},iI=(e,t)=>{const r=tI(e,t,"utf8",!0);return sI(r),Fm(r)},sI=e=>{const t=e.find((e=>"string"!=typeof e&&!Nm(e)));if(void 0!==t)throw new TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${t}.`)},aI=({stdioItems:e,encoding:t,verboseInfo:r,fdNumber:n})=>"all"!==n&&hg(r,n)&&!nw.has(t)&&cI(n)&&(e.some((({type:e,value:t})=>"native"===e&&lI.has(t)))||e.every((({type:e})=>JE.has(e)))),cI=e=>1===e||2===e,lI=new Set(["pipe","overlapped"]),uI=e=>e._readableState.pipes.length>0,fI=(e,t,r)=>{const n=Zg(e);Xg({type:"output",verboseMessage:n,fdNumber:t,verboseInfo:r})},pI=({result:e,fileDescriptors:t,fdNumber:r,state:n,outputFiles:o,isMaxBuffer:i,verboseInfo:s},{buffer:a,encoding:c,lines:l,stripFinalNewline:u,maxBuffer:f})=>{if(null===e)return;const p=((e,t,r)=>{if(!t)return e;const n=lE(r);return e.length>n?e.slice(0,n):e})(e,i,f),d=Lm(p),{stdioItems:h,objectMode:m}=t[r],g=dI([d],h,c,n),{serializedResult:y,finalResult:b=y}=hI({chunks:g,objectMode:m,encoding:c,lines:l,stripFinalNewline:u,fdNumber:r});mI({serializedResult:y,fdNumber:r,state:n,verboseInfo:s,encoding:c,stdioItems:h,objectMode:m});const v=a[r]?b:void 0;try{return void 0===n.error&&gI(y,h,o),v}catch(e){return n.error=e,v}},dI=(e,t,r,n)=>{try{return tI(e,t,r,!1)}catch(t){return n.error=t,e}},hI=({chunks:e,objectMode:t,encoding:r,lines:n,stripFinalNewline:o,fdNumber:i})=>{if(t)return{serializedResult:e};if("buffer"===r)return{serializedResult:Fm(e)};const s=((e,t)=>_m(e,t).join(""))(e,r);return n[i]?{serializedResult:s,finalResult:EO(s,!o[i],t)}:{serializedResult:s}},mI=({serializedResult:e,fdNumber:t,state:r,verboseInfo:n,encoding:o,stdioItems:i,objectMode:s})=>{if(!aI({stdioItems:i,encoding:o,verboseInfo:n,fdNumber:t}))return;const a=EO(e,!1,s);try{((e,t,r)=>{for(const n of e)fI(n,t,r)})(a,t,n)}catch(e){r.error??=e}},gI=(e,t,r)=>{for(const{path:n}of t.filter((({type:e})=>ZE.has(e)))){const t="string"==typeof n?n:n.toString();r.has(t)?p.appendFileSync(n,e):(r.add(t),p.writeFileSync(n,e))}},yI=async e=>{const[t,r]=await Promise.allSettled([y.once(e,"spawn"),y.once(e,"exit")]);return"rejected"===t.status?[]:"rejected"===r.status?bI(e):r.value},bI=async e=>{try{return await y.once(e,"exit")}catch{return bI(e)}},vI=async e=>{const[t,r]=await e;if(!wI(t,r)&&EI(t,r))throw new cb;return[t,r]},wI=(e,t)=>void 0===e&&void 0===t,EI=(e,t)=>0!==e||null!==t,SI=({error:e,status:t,signal:r,output:n},{maxBuffer:o})=>{const i=OI(e,t,r),s="ETIMEDOUT"===i?.code,a=((e,t,r)=>"ENOBUFS"===e?.code&&null!==t&&t.some((e=>null!==e&&e.length>lE(r))))(i,n,o);return{resultError:i,exitCode:t,signal:r,timedOut:s,isMaxBuffer:a}},OI=(e,t,r)=>void 0!==e?e:EI(t,r)?new cb:void 0,II=["encoding","maxBuffer"],TI=(e,t,r)=>{const{command:n,escapedCommand:o,startTime:i,verboseInfo:s}=sy(e,t,r),a=xI(r),{file:c,commandArguments:l,options:u}=uw(e,t,a);jI(u);const f=((e,t)=>eO(yO,e,t,!0))(u,s);return{file:c,commandArguments:l,command:n,escapedCommand:o,startTime:i,verboseInfo:s,options:u,fileDescriptors:f}},xI=e=>e.node&&!e.ipc?Object.assign(Object.assign({},e),{},{ipc:!1}):e,jI=({ipc:e,ipcInput:t,detached:r,cancelSignal:n})=>{t&&RI("ipcInput"),e&&RI("ipc: true"),r&&RI("detached: true"),n&&RI("cancelSignal")},RI=e=>{throw new TypeError(`The "${e}" option cannot be used with synchronous methods.`)},AI=({file:e,commandArguments:t,options:r,command:n,escapedCommand:o,verboseInfo:i,fileDescriptors:s,startTime:a})=>{const c=DI({file:e,commandArguments:t,options:r,command:n,escapedCommand:o,fileDescriptors:s,startTime:a});if(c.failed)return c;const{resultError:l,exitCode:u,signal:f,timedOut:p,isMaxBuffer:d}=SI(c,r),{output:h,error:m=l}=(({fileDescriptors:e,syncResult:{output:t},options:r,isMaxBuffer:n,verboseInfo:o})=>{if(null===t)return{output:Array.from({length:3})};const i={},s=new Set([]),a=t.map(((t,a)=>pI({result:t,fileDescriptors:e,fdNumber:a,state:i,outputFiles:s,isMaxBuffer:n,verboseInfo:o},r)));return Object.assign({output:a},i)})({fileDescriptors:s,syncResult:c,options:r,isMaxBuffer:d,verboseInfo:i}),g=h.map(((e,t)=>bO(e,r,t))),y=bO((([,e,t],r)=>{if(r.all)return void 0===e?t:void 0===t?e:Array.isArray(e)?Array.isArray(t)?[...e,...t]:[...e,bO(t,r,"all")]:Array.isArray(t)?[bO(e,r,"all"),...t]:Nm(e)&&Nm(t)?$m([e,t]):`${e}${t}`})(h,r),r,"all");return LI({error:m,exitCode:u,signal:f,timedOut:p,isMaxBuffer:d,stdio:g,all:y,options:r,command:n,escapedCommand:o,startTime:a})},DI=({file:e,commandArguments:t,options:r,command:n,escapedCommand:o,fileDescriptors:i,startTime:s})=>{try{((e,t)=>{for(const r of nI(e))oI(e,r,t)})(i,r);const n=NI(r);return c.spawnSync(e,t,n)}catch(e){return yE({error:e,command:n,escapedCommand:o,fileDescriptors:i,options:r,startTime:s,isSync:!0})}},NI=e=>{let{encoding:t,maxBuffer:r}=e,n=Km(e,II);return Object.assign(Object.assign({},n),{},{encoding:"buffer",maxBuffer:lE(r)})},LI=({error:e,exitCode:t,signal:r,timedOut:n,isMaxBuffer:o,stdio:i,all:s,options:a,command:c,escapedCommand:l,startTime:u})=>void 0===e?gE({command:c,escapedCommand:l,stdio:i,all:s,ipcOutput:[],options:a,startTime:u}):bE({error:e,command:c,escapedCommand:l,timedOut:n,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:o,isForcefullyTerminated:!1,exitCode:t,signal:r,stdio:i,all:s,ipcOutput:[],options:a,startTime:u,isSync:!0}),kI=({anyProcess:e,channel:t,isSubprocess:r,ipc:n},{reference:o=!0,filter:i}={})=>(Gb({methodName:"getOneMessage",isSubprocess:r,ipc:n,isConnected:Sv(e)}),CI({anyProcess:e,channel:t,isSubprocess:r,filter:i,reference:o})),CI=async({anyProcess:e,channel:t,isSubprocess:r,filter:n,reference:o})=>{pv(t,o);const i=vv(e,t,r),s=new AbortController;try{return await Promise.race([PI(i,n,s),MI(i,r,s),_I(i,r,s)])}catch(t){throw Jb(e),t}finally{s.abort(),hv(t,o)}},PI=async(e,t,{signal:r})=>{if(void 0===t){const[t]=await y.once(e,"message",{signal:r});return t}for await(const[n]of y.on(e,"message",{signal:r}))if(t(n))return n},MI=async(e,t,{signal:r})=>{await y.once(e,"disconnect",{signal:r}),(e=>{throw new Error(`${Kb("getOneMessage",e)} could not complete: the ${Qb(e)} exited or disconnected.`)})(t)},_I=async(e,t,{signal:r})=>{const[n]=await y.once(e,"strict:error",{signal:r});throw qb(n,t)},FI=({anyProcess:e,channel:t,isSubprocess:r,ipc:n},{reference:o=!0}={})=>BI({anyProcess:e,channel:t,isSubprocess:r,ipc:n,shouldAwait:!r,reference:o}),BI=({anyProcess:e,channel:t,isSubprocess:r,ipc:n,shouldAwait:o,reference:i})=>{Gb({methodName:"getEachMessage",isSubprocess:r,ipc:n,isConnected:Sv(e)}),pv(t,i);const s=vv(e,t,r),a=new AbortController,c={};return $I(e,s,a),UI({ipcEmitter:s,isSubprocess:r,controller:a,state:c}),GI({anyProcess:e,channel:t,ipcEmitter:s,isSubprocess:r,shouldAwait:o,controller:a,state:c,reference:i})},$I=async(e,t,r)=>{try{await y.once(t,"disconnect",{signal:r.signal}),r.abort()}catch{}},UI=async({ipcEmitter:e,isSubprocess:t,controller:r,state:n})=>{try{const[o]=await y.once(e,"strict:error",{signal:r.signal});n.error=qb(o,t),r.abort()}catch{}},GI=async function*({anyProcess:e,channel:t,ipcEmitter:r,isSubprocess:n,shouldAwait:o,controller:i,state:s,reference:a}){try{for await(const[e]of y.on(r,"message",{signal:i.signal}))WI(s),yield e}catch{WI(s)}finally{i.abort(),hv(t,a),n||Jb(e),o&&await e}},WI=({error:e})=>{if(e)throw e},zI=(e,t,r)=>({sendMessage:Mv.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:r}),getOneMessage:kI.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:r}),getEachMessage:FI.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:r})}),qI=(e,t)=>{const r=VI(),n=VI(),o=VI(),i=Array.from({length:t.length-3},VI),s=VI(),a=[r,n,o,...i];Object.assign(e,{stdin:r,stdout:n,stderr:o,all:s,stdio:a})},VI=()=>{const e=new v.PassThrough;return e.end(),e},HI=()=>new v.Readable({read(){}}),XI=()=>new v.Writable({write(){}}),KI=()=>new v.Duplex({read(){},write(){}}),YI=async(e,t,r)=>RE(e,t,r),QI=({type:e,optionName:t})=>{throw new TypeError(`The \`${t}\` option cannot be ${nS[e]}.`)},JI={fileNumber:QI,generator:eI,asyncGenerator:eI,nodeStream:({value:e})=>({stream:e}),webTransform({value:{transform:e,writableObjectMode:t,readableObjectMode:r}}){const n=t||r;return{stream:v.Duplex.fromWeb(e,{objectMode:n})}},duplex:({value:{transform:e}})=>({stream:e}),native(){}},ZI={input:Object.assign(Object.assign({},JI),{},{fileUrl:({value:e})=>({stream:p.createReadStream(e)}),filePath:({value:{file:e}})=>({stream:p.createReadStream(e)}),webStream:({value:e})=>({stream:v.Readable.fromWeb(e)}),iterable:({value:e})=>({stream:v.Readable.from(e)}),asyncIterable:({value:e})=>({stream:v.Readable.from(e)}),string:({value:e})=>({stream:v.Readable.from(e)}),uint8Array:({value:e})=>({stream:v.Readable.from(w.Buffer.from(e))})}),output:Object.assign(Object.assign({},JI),{},{fileUrl:({value:e})=>({stream:p.createWriteStream(e)}),filePath:({value:{file:e}})=>({stream:p.createWriteStream(e)}),webStream:({value:e})=>({stream:v.Writable.fromWeb(e)}),iterable:QI,asyncIterable:QI,string:QI,uint8Array:QI})};function eT(e){if(!Array.isArray(e))throw new TypeError(`Expected an array, got \`${typeof e}\`.`);for(const t of e)sT(t);const t=e.some((({readableObjectMode:e})=>e)),r=tT(e,t),n=new rT({objectMode:t,writableHighWaterMark:r,readableHighWaterMark:r});for(const t of e)n.add(t);return n}const tT=(e,t)=>{if(0===e.length)return v.getDefaultHighWaterMark(t);const r=e.filter((({readableObjectMode:e})=>e===t)).map((({readableHighWaterMark:e})=>e));return Math.max(...r)};class rT extends v.PassThrough{#s=new Set([]);#a=new Set([]);#c=new Set([]);#l;#u=Symbol("unpipe");#f=new WeakMap;add(e){if(sT(e),this.#s.has(e))return;this.#s.add(e),this.#l??=nT(this,this.#s,this.#u);const t=aT({passThroughStream:this,stream:e,streams:this.#s,ended:this.#a,aborted:this.#c,onFinished:this.#l,unpipeEvent:this.#u});this.#f.set(e,t),e.pipe(this,{end:!1})}async remove(e){if(sT(e),!this.#s.has(e))return!1;const t=this.#f.get(e);return void 0!==t&&(this.#f.delete(e),e.unpipe(this),await t,!0)}}const nT=async(e,t,r)=>{yT(e,bT);const n=new AbortController;try{await Promise.race([oT(e,n),iT(e,t,r,n)])}finally{n.abort(),yT(e,-bT)}},oT=async(e,{signal:t})=>{try{await E.finished(e,{signal:t,cleanup:!0})}catch(t){throw pT(e,t),t}},iT=async(e,t,r,{signal:n})=>{for await(const[o]of y.on(e,"unpipe",{signal:n}))t.has(o)&&o.emit(r)},sT=e=>{if("function"!=typeof e?.pipe)throw new TypeError(`Expected a readable stream, got: \`${typeof e}\`.`)},aT=async({passThroughStream:e,stream:t,streams:r,ended:n,aborted:o,onFinished:i,unpipeEvent:s})=>{yT(e,vT);const a=new AbortController;try{await Promise.race([cT(i,t,a),lT({passThroughStream:e,stream:t,streams:r,ended:n,aborted:o,controller:a}),uT({stream:t,streams:r,ended:n,aborted:o,unpipeEvent:s,controller:a})])}finally{a.abort(),yT(e,-vT)}r.size>0&&r.size===n.size+o.size&&(0===n.size&&o.size>0?hT(e):fT(e))},cT=async(e,t,{signal:r})=>{try{await e,r.aborted||hT(t)}catch(e){r.aborted||pT(t,e)}},lT=async({passThroughStream:e,stream:t,streams:r,ended:n,aborted:o,controller:{signal:i}})=>{try{await E.finished(t,{signal:i,cleanup:!0,readable:!0,writable:!1}),r.has(t)&&n.add(t)}catch(n){if(i.aborted||!r.has(t))return;dT(n)?o.add(t):mT(e,n)}},uT=async({stream:e,streams:t,ended:r,aborted:n,unpipeEvent:o,controller:{signal:i}})=>{if(await y.once(e,o,{signal:i}),!e.readable)return y.once(i,"abort",{signal:i});t.delete(e),r.delete(e),n.delete(e)},fT=e=>{e.writable&&e.end()},pT=(e,t)=>{dT(t)?hT(e):mT(e,t)},dT=e=>"ERR_STREAM_PREMATURE_CLOSE"===e?.code,hT=e=>{(e.readable||e.writable)&&e.destroy()},mT=(e,t)=>{e.destroyed||(e.once("error",gT),e.destroy(t))},gT=()=>{},yT=(e,t)=>{const r=e.getMaxListeners();0!==r&&r!==Number.POSITIVE_INFINITY&&e.setMaxListeners(r+t)},bT=2,vT=1,wT=(e,t)=>{e.pipe(t),ET(e,t),OT(e,t)},ET=async(e,t)=>{if(!Ym(e)&&!Ym(t)){try{await E.finished(e,{cleanup:!0,readable:!0,writable:!1})}catch{}ST(t)}},ST=e=>{e.writable&&e.end()},OT=async(e,t)=>{if(!Ym(e)&&!Ym(t)){try{await E.finished(t,{cleanup:!0,readable:!1,writable:!0})}catch{}IT(e)}},IT=e=>{e.readable&&e.destroy()},TT=(e,t,r,n)=>{"output"===r?wT(e.stdio[n],t):wT(t,e.stdio[n]);const o=xT[n];void 0!==o&&(e[o]=t),e.stdio[n]=t},xT=["stdin","stdout","stderr"],jT=({subprocess:e,stream:t,direction:r,fdNumber:n,pipeGroups:o,controller:i})=>{if(void 0===t)return;RT(t,i);const[s,a]="output"===r?[t,e.stdio[n]]:[e.stdio[n],t],c=o.get(s)??[];o.set(s,[...c,a])},RT=(e,{signal:t})=>{Ym(e)&&fv(e,AT,t)},AT=2,DT=[];DT.push("SIGHUP","SIGINT","SIGTERM"),"win32"!==process.platform&&DT.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT"),"linux"===process.platform&&DT.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");const NT=e=>!!e&&"object"==typeof e&&"function"==typeof e.removeListener&&"function"==typeof e.emit&&"function"==typeof e.reallyExit&&"function"==typeof e.listeners&&"function"==typeof e.kill&&"number"==typeof e.pid&&"function"==typeof e.on,LT=Symbol.for("signal-exit emitter"),kT=globalThis,CT=Object.defineProperty.bind(Object);class PT{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(kT[LT])return kT[LT];CT(kT,LT,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,t){this.listeners[e].push(t)}removeListener(e,t){const r=this.listeners[e],n=r.indexOf(t);-1!==n&&(0===n&&1===r.length?r.length=0:r.splice(n,1))}emit(e,t,r){if(this.emitted[e])return!1;this.emitted[e]=!0;let n=!1;for(const o of this.listeners[e])n=!0===o(t,r)||n;return"exit"===e&&(n=this.emit("afterExit",t,r)||n),n}}class MT{}const _T=globalThis.process,{onExit:FT,load:BT,unload:$T}=(UT=NT(_T)?new class extends MT{#p="win32"===_T.platform?"SIGINT":"SIGHUP";#d=new PT;#h;#m;#g;#y={};#b=!1;constructor(e){super(),this.#h=e,this.#y={};for(const t of DT)this.#y[t]=()=>{const r=this.#h.listeners(t);let{count:n}=this.#d;const o=e;if("object"==typeof o.__signal_exit_emitter__&&"number"==typeof o.__signal_exit_emitter__.count&&(n+=o.__signal_exit_emitter__.count),r.length===n){this.unload();const r=this.#d.emit("exit",null,t),n="SIGHUP"===t?this.#p:t;r||e.kill(e.pid,n)}};this.#g=e.reallyExit,this.#m=e.emit}onExit(e,t){if(!NT(this.#h))return()=>{};!1===this.#b&&this.load();const r=t?.alwaysLast?"afterExit":"exit";return this.#d.on(r,e),()=>{this.#d.removeListener(r,e),0===this.#d.listeners.exit.length&&0===this.#d.listeners.afterExit.length&&this.unload()}}load(){if(!this.#b){this.#b=!0,this.#d.count+=1;for(const e of DT)try{const t=this.#y[e];t&&this.#h.on(e,t)}catch(e){}this.#h.emit=(e,...t)=>this.#v(e,...t),this.#h.reallyExit=e=>this.#w(e)}}unload(){this.#b&&(this.#b=!1,DT.forEach((e=>{const t=this.#y[e];if(!t)throw new Error("Listener not defined for signal: "+e);try{this.#h.removeListener(e,t)}catch(e){}})),this.#h.emit=this.#m,this.#h.reallyExit=this.#g,this.#d.count-=1)}#w(e){return NT(this.#h)?(this.#h.exitCode=e||0,this.#d.emit("exit",this.#h.exitCode,null),this.#g.call(this.#h,this.#h.exitCode)):0}#v(e,...t){const r=this.#m;if("exit"===e&&NT(this.#h)){"number"==typeof t[0]&&(this.#h.exitCode=t[0]);const n=r.call(this.#h,e,...t);return this.#d.emit("exit",this.#h.exitCode,null),n}return r.call(this.#h,e,...t)}}(_T):new class extends MT{onExit(){return()=>{}}load(){}unload(){}},{onExit:(e,t)=>UT.onExit(e,t),load:()=>UT.load(),unload:()=>UT.unload()});var UT;const GT=(e,t,r)=>{try{const{destination:n,pipeOptions:{from:o,to:i,unpipeSignal:s}={}}=WT(e,t,...r);return{destination:n,destinationStream:ev(n,i),from:o,unpipeSignal:s}}catch(e){return{destinationError:e}}},WT=(e,t,r,...n)=>{if(Array.isArray(r)){return{destination:t(zT,e)(r,...n),pipeOptions:e}}if("string"==typeof r||r instanceof URL){if(Object.keys(e).length>0)throw new TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).');const[o,i,s]=Of(r,...n);return{destination:t(zT)(o,i,s),pipeOptions:s}}if(rv.has(r)){if(Object.keys(e).length>0)throw new TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:r,pipeOptions:n[0]}}throw new TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${r}`)},zT=({options:e})=>({options:Object.assign(Object.assign({},e),{},{stdin:"pipe",piped:!0})}),qT=(e,t)=>{try{return{sourceStream:tv(e,t)}}catch(e){return{sourceError:e}}},VT=({sourceStream:e,sourceError:t,destinationStream:r,destinationError:n})=>void 0!==t&&void 0!==n?n:void 0!==n?(IT(e),n):void 0!==t?(ST(r),t):void 0,HT=({error:e,fileDescriptors:t,sourceOptions:r,startTime:n})=>yE({error:e,command:XT,escapedCommand:XT,fileDescriptors:t,options:r,startTime:n,isSync:!1}),XT="source.pipe(destination)",KT=async e=>{const[{status:t,reason:r,value:n=r},{status:o,reason:i,value:s=i}]=await e;if(s.pipedFrom.includes(n)||s.pipedFrom.push(n),"rejected"===o)throw s;if("rejected"===t)throw n;return s},YT=(e,t)=>{const r=eT([e]);return wT(r,t),ZT.set(t,r),r},QT=(e,t)=>{const r=ZT.get(t);return r.add(e),r},JT=async e=>{try{await E.finished(e,{cleanup:!0,readable:!1,writable:!0})}catch{}ZT.delete(e)},ZT=new WeakMap,ex=2,tx=1,rx=(e,t)=>void 0===e?[]:[nx(e,t)],nx=async(e,{sourceStream:t,mergedStream:r,fileDescriptors:n,sourceOptions:o,startTime:i})=>{await u.aborted(e,t),await r.remove(t);const s=new Error("Pipe canceled by `unpipeSignal` option.");throw HT({error:s,fileDescriptors:n,sourceOptions:o,startTime:i})},ox=["destination"],ix=(e,...t)=>{if(Bu(t[0]))return ix.bind(void 0,Object.assign(Object.assign({},e),{},{boundOptions:Object.assign(Object.assign({},e.boundOptions),t[0])}));const r=(({source:e,sourcePromise:t,boundOptions:r,createNested:n},...o)=>{const i=oy(),{destination:s,destinationStream:a,destinationError:c,from:l,unpipeSignal:u}=GT(r,n,o),{sourceStream:f,sourceError:p}=qT(e,l),{options:d,fileDescriptors:h}=rv.get(e);return{sourcePromise:t,sourceStream:f,sourceOptions:d,sourceError:p,destination:s,destinationStream:a,destinationError:c,unpipeSignal:u,fileDescriptors:h,startTime:i}})(e,...t),{destination:n}=r,o=Km(r,ox),i=sx(Object.assign(Object.assign({},o),{},{destination:n}));return i.pipe=ix.bind(void 0,Object.assign(Object.assign({},e),{},{source:n,sourcePromise:i,boundOptions:{}})),i},sx=async({sourcePromise:e,sourceStream:t,sourceOptions:r,sourceError:n,destination:o,destinationStream:i,destinationError:s,unpipeSignal:a,fileDescriptors:c,startTime:l})=>{const u=ax(e,o);(({sourceStream:e,sourceError:t,destinationStream:r,destinationError:n,fileDescriptors:o,sourceOptions:i,startTime:s})=>{const a=VT({sourceStream:e,sourceError:t,destinationStream:r,destinationError:n});if(void 0!==a)throw HT({error:a,fileDescriptors:o,sourceOptions:i,startTime:s})})({sourceStream:t,sourceError:n,destinationStream:i,destinationError:s,fileDescriptors:c,sourceOptions:r,startTime:l});const f=new AbortController;try{const e=((e,t,r)=>{const n=ZT.has(t)?QT(e,t):YT(e,t);return fv(e,ex,r.signal),fv(t,tx,r.signal),JT(t),n})(t,i,f);return await Promise.race([KT(u),...rx(a,{sourceStream:t,mergedStream:e,sourceOptions:r,fileDescriptors:c,startTime:l})])}finally{f.abort()}},ax=(e,t)=>Promise.allSettled([e,t]),cx=({subprocessStdout:e,subprocess:t,binary:r,shouldEncode:n,encoding:o,preserveNewlines:i})=>{const s=new AbortController;return lx(t,s),px({stream:e,controller:s,binary:r,shouldEncode:!e.readableObjectMode&&n,encoding:o,shouldSplit:!e.readableObjectMode,preserveNewlines:i})},lx=async(e,t)=>{try{await e}catch{}finally{t.abort()}},ux=({stream:e,onStreamEnd:t,lines:r,encoding:n,stripFinalNewline:o,allMixed:i})=>{const s=new AbortController;fx(t,s,e);const a=e.readableObjectMode&&!i;return px({stream:e,controller:s,binary:"buffer"===n,shouldEncode:!a,encoding:n,shouldSplit:!a&&r,preserveNewlines:!o})},fx=async(e,t,r)=>{try{await e}catch{r.destroy()}finally{t.abort()}},px=({stream:e,controller:t,binary:r,shouldEncode:n,encoding:o,shouldSplit:i,preserveNewlines:s})=>{const a=y.on(e,"data",{signal:t.signal,highWaterMark:hx,highWatermark:hx});return mx({onStdoutChunk:a,controller:t,binary:r,shouldEncode:n,encoding:o,shouldSplit:i,preserveNewlines:s})},dx=v.getDefaultHighWaterMark(!0),hx=dx,mx=async function*({onStdoutChunk:e,controller:t,binary:r,shouldEncode:n,encoding:o,shouldSplit:i,preserveNewlines:s}){const a=gx({binary:r,shouldEncode:n,encoding:o,shouldSplit:i,preserveNewlines:s});try{for await(const[t]of e)yield*YO(t,a,0)}catch(e){if(!t.signal.aborted)throw e}finally{yield*QO(a)}},gx=({binary:e,shouldEncode:t,encoding:r,shouldSplit:n,preserveNewlines:o})=>[FO(e,r,!t),wO(e,o,!n,{})].filter(Boolean),yx=async({stream:e,onStreamEnd:t,fdNumber:r,encoding:n,buffer:o,maxBuffer:i,lines:s,allMixed:a,stripFinalNewline:c,verboseInfo:l,streamInfo:u})=>{const f=bx({stream:e,onStreamEnd:t,fdNumber:r,encoding:n,allMixed:a,verboseInfo:l,streamInfo:u});if(!o)return void await Promise.all([vx(e),f]);const p=vO(c,r),d=ux({stream:e,onStreamEnd:t,lines:s,encoding:n,stripFinalNewline:p,allMixed:a}),[h]=await Promise.all([wx({stream:e,iterable:d,fdNumber:r,encoding:n,maxBuffer:i,lines:s}),f]);return h},bx=async({stream:e,onStreamEnd:t,fdNumber:r,encoding:n,allMixed:o,verboseInfo:i,streamInfo:{fileDescriptors:s}})=>{if(!aI({stdioItems:s[r]?.stdioItems,encoding:n,verboseInfo:i,fdNumber:r}))return;const a=ux({stream:e,onStreamEnd:t,lines:!0,encoding:n,stripFinalNewline:!0,allMixed:o});await(async(e,t,r,n)=>{for await(const o of e)uI(t)||fI(o,r,n)})(a,e,r,i)},vx=async e=>{await m.setImmediate(),null===e.readableFlowing&&e.resume()},wx=async({stream:e,stream:{readableObjectMode:t},iterable:r,fdNumber:n,encoding:o,maxBuffer:i,lines:s})=>{try{return t||s?await async function(e,t){return Mw(e,Xw,t)}(r,{maxBuffer:i}):"buffer"===o?new Uint8Array(await async function(e,t){return Mw(e,nE,t)}(r,{maxBuffer:i})):await async function(e,t){return Mw(e,iE,t)}(r,{maxBuffer:i})}catch(r){return Sx((({error:e,stream:t,readableObjectMode:r,lines:n,encoding:o,fdNumber:i})=>{if(!(e instanceof Gw))throw e;if("all"===i)return e;const s=sE(r,n,o);throw e.maxBufferInfo={fdNumber:i,unit:s},t.destroy(),e})({error:r,stream:e,readableObjectMode:t,lines:s,encoding:o,fdNumber:n}))}},Ex=async e=>{try{return await e}catch(e){return Sx(e)}},Sx=({bufferedData:e})=>{return t=e,"[object ArrayBuffer]"===Dm.call(t)?new Uint8Array(e):e;var t},Ox=async(e,t,r,{isSameDirection:n,stopOnExit:o=!1}={})=>{const i=Ix(e,r),s=new AbortController;try{await Promise.race([...o?[r.exitPromise]:[],E.finished(e,{cleanup:!0,signal:s.signal})])}catch(e){i.stdinCleanedUp||jx(e,t,r,n)}finally{s.abort()}},Ix=(e,{originalStreams:[t],subprocess:r})=>{const n={stdinCleanedUp:!1};return e===t&&Tx(e,r,n),n},Tx=(e,t,r)=>{const{_destroy:n}=e;e._destroy=(...o)=>{xx(t,r),n.call(e,...o)}},xx=({exitCode:e,signalCode:t},r)=>{null===e&&null===t||(r.stdinCleanedUp=!0)},jx=(e,t,r,n)=>{if(!Rx(e,t,r,n))throw e},Rx=(e,t,r,n=!0)=>r.propagating?Nx(e)||Dx(e):(r.propagating=!0,Ax(r,t)===n?Nx(e):Dx(e)),Ax=({fileDescriptors:e},t)=>"all"!==t&&"input"===e[t].direction,Dx=e=>"ERR_STREAM_PREMATURE_CLOSE"===e?.code,Nx=e=>"EPIPE"===e?.code,Lx=async({stream:e,fdNumber:t,encoding:r,buffer:n,maxBuffer:o,lines:i,allMixed:s,stripFinalNewline:a,verboseInfo:c,streamInfo:l})=>{if(!e)return;const u=Ox(e,t,l);if(Ax(l,t))return void await u;const[f]=await Promise.all([yx({stream:e,onStreamEnd:u,fdNumber:t,encoding:r,buffer:n,maxBuffer:o,lines:i,allMixed:s,stripFinalNewline:a,verboseInfo:c,streamInfo:l}),u]);return f},kx=({stdout:e,stderr:t,all:r},[,n,o])=>{const i=n||o;return i?n?o?{stream:r,buffer:i}:{stream:e,buffer:i}:{stream:t,buffer:i}:{stream:r,buffer:i}},Cx=({all:e,stdout:t,stderr:r})=>e&&t&&r&&t.readableObjectMode!==r.readableObjectMode,Px=(e,t)=>{const r=Zg(e);Xg({type:"ipc",verboseMessage:r,fdNumber:"ipc",verboseInfo:t})},Mx=async({subprocess:e,buffer:t,maxBuffer:r,ipc:n,ipcOutput:o,verboseInfo:i})=>{if(!n)return o;const s=(e=>hg(e,"ipc"))(i),a=pg(t,"ipc"),c=pg(r,"ipc");for await(const t of BI({anyProcess:e,channel:e.channel,isSubprocess:!1,ipc:n,shouldAwait:!1,reference:!0}))a&&(aE(0,o,c),o.push(t)),s&&Px(t,i);return o},_x=async(e,t)=>(await Promise.allSettled([e]),t),Fx=async({subprocess:e,options:{encoding:t,buffer:r,maxBuffer:n,lines:o,timeoutDuration:i,cancelSignal:s,gracefulCancel:a,forceKillAfterDelay:c,stripFinalNewline:l,ipc:u,ipcInput:f},context:p,verboseInfo:d,fileDescriptors:h,originalStreams:m,onInternalError:g,controller:y})=>{const b=(async(e,t)=>{const[r,n]=await yI(e);return t.isForcefullyTerminated??=!1,[r,n]})(e,p),v={originalStreams:m,fileDescriptors:h,subprocess:e,exitPromise:b,propagating:!1},w=(({subprocess:e,encoding:t,buffer:r,maxBuffer:n,lines:o,stripFinalNewline:i,verboseInfo:s,streamInfo:a})=>e.stdio.map(((e,c)=>Lx({stream:e,fdNumber:c,encoding:t,buffer:r[c],maxBuffer:n[c],lines:o[c],allMixed:!1,stripFinalNewline:i,verboseInfo:s,streamInfo:a}))))({subprocess:e,encoding:t,buffer:r,maxBuffer:n,lines:o,stripFinalNewline:l,verboseInfo:d,streamInfo:v}),E=(({subprocess:e,encoding:t,buffer:r,maxBuffer:n,lines:o,stripFinalNewline:i,verboseInfo:s,streamInfo:a})=>Lx(Object.assign(Object.assign({},kx(e,r)),{},{fdNumber:"all",encoding:t,maxBuffer:n[1]+n[2],lines:o[1]||o[2],allMixed:Cx(e),stripFinalNewline:i,verboseInfo:s,streamInfo:a})))({subprocess:e,encoding:t,buffer:r,maxBuffer:n,lines:o,stripFinalNewline:l,verboseInfo:d,streamInfo:v}),S=[],O=Mx({subprocess:e,buffer:r,maxBuffer:n,ipc:u,ipcOutput:S,verboseInfo:d}),I=Bx(m,e,v),T=$x(h,v);try{return await Promise.race([Promise.all([{},vI(b),Promise.all(w),E,O,tw(e,f),...I,...T]),g,Ux(e,y),...Qv(e,i,p,y),...$b({subprocess:e,cancelSignal:s,gracefulCancel:a,context:p,controller:y}),...Xv({subprocess:e,cancelSignal:s,gracefulCancel:a,forceKillAfterDelay:c,context:p,controller:y})])}catch(e){return p.terminationReason??="other",Promise.all([{error:e},b,Promise.all(w.map((e=>Ex(e)))),Ex(E),_x(O,S),Promise.allSettled(I),Promise.allSettled(T)])}},Bx=(e,t,r)=>e.map(((e,n)=>e===t.stdio[n]?void 0:Ox(e,n,r))),$x=(e,t)=>e.flatMap((({stdioItems:e},r)=>e.filter((({value:e,stream:t=e})=>ww(t,{checkOpen:!1})&&!Ym(t))).map((({type:e,value:n,stream:o=n})=>Ox(o,r,t,{isSameDirection:JE.has(e),stopOnExit:"native"===e}))))),Ux=async(e,{signal:t})=>{const[r]=await y.once(e,"error",{signal:t});throw r},Gx=(e,t,r)=>{const n=e[r];n.has(t)||n.set(t,[]);const o=n.get(t),i=Zb();o.push(i);return{resolve:i.resolve.bind(i),promises:o}},Wx=async({resolve:e,promises:t},r)=>{e();const[n]=await Promise.race([Promise.allSettled([!0,r]),Promise.all([!1,...t])]);return!n},zx=async e=>{if(void 0!==e)try{await qx(e)}catch{}},qx=async e=>{await E.finished(e,{cleanup:!0,readable:!1,writable:!0})},Vx=async e=>{await E.finished(e,{cleanup:!0,readable:!0,writable:!1})},Hx=async(e,t)=>{if(await e,t)throw t},Xx=(e,t,r)=>{r&&!Dx(r)?e.destroy(r):t&&e.destroy()},Kx=({subprocess:e,concurrentStreams:t,encoding:r},{from:n,binary:o=!0,preserveNewlines:i=!0}={})=>{const s=o||nw.has(r),{subprocessStdout:a,waitReadableDestroy:c}=Yx(e,n,t),{readableEncoding:l,readableObjectMode:f,readableHighWaterMark:p}=Qx(a,s),{read:d,onStdoutDataDone:h}=Jx({subprocessStdout:a,subprocess:e,binary:s,encoding:r,preserveNewlines:i}),m=new v.Readable({read:d,destroy:u.callbackify(tj.bind(void 0,{subprocessStdout:a,subprocess:e,waitReadableDestroy:c})),highWaterMark:p,objectMode:f,encoding:l});return ej({subprocessStdout:a,onStdoutDataDone:h,readable:m,subprocess:e}),m},Yx=(e,t,r)=>{const n=tv(e,t);return{subprocessStdout:n,waitReadableDestroy:Gx(r,n,"readableDestroy")}},Qx=({readableEncoding:e,readableObjectMode:t,readableHighWaterMark:r},n)=>n?{readableEncoding:e,readableObjectMode:t,readableHighWaterMark:r}:{readableEncoding:e,readableObjectMode:!0,readableHighWaterMark:dx},Jx=({subprocessStdout:e,subprocess:t,binary:r,encoding:n,preserveNewlines:o})=>{const i=Zb(),s=cx({subprocessStdout:e,subprocess:t,binary:r,shouldEncode:!r,encoding:n,preserveNewlines:o});return{read(){Zx(this,s,i)},onStdoutDataDone:i}},Zx=async(e,t,r)=>{try{const{value:n,done:o}=await t.next();o?r.resolve():e.push(n)}catch{}},ej=async({subprocessStdout:e,onStdoutDataDone:t,readable:r,subprocess:n,subprocessStdin:o})=>{try{await Vx(e),await n,await zx(o),await t,r.readable&&r.push(null)}catch(e){await zx(o),rj(r,e)}},tj=async({subprocessStdout:e,subprocess:t,waitReadableDestroy:r},n)=>{await Wx(r,t)&&(rj(e,n),await Hx(t,n))},rj=(e,t)=>{Xx(e,e.readable,t)},nj=({subprocess:e,concurrentStreams:t},{to:r}={})=>{const{subprocessStdin:n,waitWritableFinal:o,waitWritableDestroy:i}=oj(e,r,t),s=new v.Writable(Object.assign(Object.assign({},ij(n,e,o)),{},{destroy:u.callbackify(lj.bind(void 0,{subprocessStdin:n,subprocess:e,waitWritableFinal:o,waitWritableDestroy:i})),highWaterMark:n.writableHighWaterMark,objectMode:n.writableObjectMode}));return cj(n,s),s},oj=(e,t,r)=>{const n=ev(e,t);return{subprocessStdin:n,waitWritableFinal:Gx(r,n,"writableFinal"),waitWritableDestroy:Gx(r,n,"writableDestroy")}},ij=(e,t,r)=>({write:sj.bind(void 0,e),final:u.callbackify(aj.bind(void 0,e,t,r))}),sj=(e,t,r,n)=>{e.write(t,r)?n():e.once("drain",n)},aj=async(e,t,r)=>{await Wx(r,t)&&(e.writable&&e.end(),await t)},cj=async(e,t,r)=>{try{await qx(e),t.writable&&t.end()}catch(e){await(async e=>{if(void 0!==e)try{await Vx(e)}catch{}})(r),uj(t,e)}},lj=async({subprocessStdin:e,subprocess:t,waitWritableFinal:r,waitWritableDestroy:n},o)=>{await Wx(r,t),await Wx(n,t)&&(uj(e,o),await Hx(t,o))},uj=(e,t)=>{Xx(e,e.writable,t)},fj=({subprocess:e,concurrentStreams:t,encoding:r},{from:n,to:o,binary:i=!0,preserveNewlines:s=!0}={})=>{const a=i||nw.has(r),{subprocessStdout:c,waitReadableDestroy:l}=Yx(e,n,t),{subprocessStdin:f,waitWritableFinal:p,waitWritableDestroy:d}=oj(e,o,t),{readableEncoding:h,readableObjectMode:m,readableHighWaterMark:g}=Qx(c,a),{read:y,onStdoutDataDone:b}=Jx({subprocessStdout:c,subprocess:e,binary:a,encoding:r,preserveNewlines:s}),w=new v.Duplex(Object.assign(Object.assign({read:y},ij(f,e,p)),{},{destroy:u.callbackify(pj.bind(void 0,{subprocessStdout:c,subprocessStdin:f,subprocess:e,waitReadableDestroy:l,waitWritableFinal:p,waitWritableDestroy:d})),readableHighWaterMark:g,writableHighWaterMark:f.writableHighWaterMark,readableObjectMode:m,writableObjectMode:f.writableObjectMode,encoding:h}));return ej({subprocessStdout:c,onStdoutDataDone:b,readable:w,subprocess:e,subprocessStdin:f}),cj(f,w,c),w},pj=async({subprocessStdout:e,subprocessStdin:t,subprocess:r,waitReadableDestroy:n,waitWritableFinal:o,waitWritableDestroy:i},s)=>{await Promise.all([tj({subprocessStdout:e,subprocess:r,waitReadableDestroy:n},s),lj({subprocessStdin:t,subprocess:r,waitWritableFinal:o,waitWritableDestroy:i},s)])},dj=(e,t,{from:r,binary:n=!1,preserveNewlines:o=!1}={})=>{const i=n||nw.has(t),s=tv(e,r),a=cx({subprocessStdout:s,subprocess:e,binary:i,shouldEncode:!0,encoding:t,preserveNewlines:o});return hj(a,s,e)},hj=async function*(e,t,r){try{yield*e}finally{t.readable&&t.destroy(),await r}},mj=(e,{encoding:t})=>{const r={readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap};e.readable=Kx.bind(void 0,{subprocess:e,concurrentStreams:r,encoding:t}),e.writable=nj.bind(void 0,{subprocess:e,concurrentStreams:r}),e.duplex=fj.bind(void 0,{subprocess:e,concurrentStreams:r,encoding:t}),e.iterable=dj.bind(void 0,e,t),e[Symbol.asyncIterator]=dj.bind(void 0,e,t,{})},gj=(async()=>{})().constructor.prototype,yj=["then","catch","finally"].map((e=>[e,Reflect.getOwnPropertyDescriptor(gj,e)])),bj=["timeout","signal"],vj=(e,t,r,n)=>{const{file:o,commandArguments:i,command:s,escapedCommand:a,startTime:c,verboseInfo:l,options:u,fileDescriptors:f}=wj(e,t,r),{subprocess:p,promise:d}=Sj({file:o,commandArguments:i,options:u,startTime:c,verboseInfo:l,command:s,escapedCommand:a,fileDescriptors:f});return p.pipe=ix.bind(void 0,{source:p,sourcePromise:d,boundOptions:{},createNested:n}),((e,t)=>{for(const[r,n]of yj){const o=n.value.bind(t);Reflect.defineProperty(e,r,Object.assign(Object.assign({},n),{},{value:o}))}})(p,d),rv.set(p,{options:u,fileDescriptors:f}),p},wj=(e,t,r)=>{const{command:n,escapedCommand:o,startTime:i,verboseInfo:s}=sy(e,t,r),{file:a,commandArguments:c,options:l}=uw(e,t,r),u=Ej(l),f=((e,t)=>eO(ZI,e,t,!1))(u,s);return{file:a,commandArguments:c,command:n,escapedCommand:o,startTime:i,verboseInfo:s,options:u,fileDescriptors:f}},Ej=e=>{let{timeout:t,signal:r}=e,n=Km(e,bj);if(void 0!==r)throw new TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return Object.assign(Object.assign({},n),{},{timeoutDuration:t})},Sj=({file:e,commandArguments:t,options:r,startTime:n,verboseInfo:o,command:i,escapedCommand:s,fileDescriptors:a})=>{let l;try{l=c.spawn(e,t,r)}catch(e){return(({error:e,command:t,escapedCommand:r,fileDescriptors:n,options:o,startTime:i,verboseInfo:s})=>{pO(n);const a=new c.ChildProcess;qI(a,n),Object.assign(a,{readable:HI,writable:XI,duplex:KI});const l=yE({error:e,command:t,escapedCommand:r,fileDescriptors:n,options:o,startTime:i,isSync:!1});return{subprocess:a,promise:YI(l,s,o)}})({error:e,command:i,escapedCommand:s,fileDescriptors:a,options:r,startTime:n,verboseInfo:o})}const u=new AbortController;y.setMaxListeners(Number.POSITIVE_INFINITY,u.signal);const f=[...l.stdio];((e,t,r)=>{const n=new Map;for(const[o,{stdioItems:i,direction:s}]of Object.entries(t)){for(const{stream:t}of i.filter((({type:e})=>JE.has(e))))TT(e,t,s,o);for(const{stream:t}of i.filter((({type:e})=>!JE.has(e))))jT({subprocess:e,stream:t,direction:s,fdNumber:o,pipeGroups:n,controller:r})}for(const[e,t]of n.entries()){const r=1===t.length?t[0]:eT(t);wT(r,e)}})(l,a,u),((e,{cleanup:t,detached:r},{signal:n})=>{if(!t||r)return;const o=FT((()=>{e.kill()}));y.addAbortListener(n,(()=>{o()}))})(l,r,u);const p={},d=Zb();l.kill=Cb.bind(void 0,{kill:l.kill.bind(l),options:r,onInternalError:d,context:p,controller:u}),l.all=(({stdout:e,stderr:t},{all:r})=>r&&(e||t)?eT([e,t].filter(Boolean)):void 0)(l,r),mj(l,r),((e,{ipc:t})=>{Object.assign(e,zI(e,!1,t))})(l,r);return{subprocess:l,promise:Oj({subprocess:l,options:r,startTime:n,verboseInfo:o,fileDescriptors:a,originalStreams:f,command:i,escapedCommand:s,context:p,onInternalError:d,controller:u})}},Oj=async({subprocess:e,options:t,startTime:r,verboseInfo:n,fileDescriptors:o,originalStreams:i,command:s,escapedCommand:a,context:c,onInternalError:l,controller:u})=>{const[f,[p,d],h,m,g]=await Fx({subprocess:e,options:t,context:c,verboseInfo:n,fileDescriptors:o,originalStreams:i,onInternalError:l,controller:u});u.abort(),l.resolve();const y=h.map(((e,r)=>bO(e,t,r))),b=bO(m,t,"all"),v=Ij({errorInfo:f,exitCode:p,signal:d,stdio:y,all:b,ipcOutput:g,context:c,options:t,command:s,escapedCommand:a,startTime:r});return RE(v,n,t)},Ij=({errorInfo:e,exitCode:t,signal:r,stdio:n,all:o,ipcOutput:i,context:s,options:a,command:c,escapedCommand:l,startTime:u})=>"error"in e?bE({error:e.error,command:c,escapedCommand:l,timedOut:"timeout"===s.terminationReason,isCanceled:"cancel"===s.terminationReason||"gracefulCancel"===s.terminationReason,isGracefullyCanceled:"gracefulCancel"===s.terminationReason,isMaxBuffer:e.error instanceof Gw,isForcefullyTerminated:s.isForcefullyTerminated,exitCode:t,signal:r,stdio:n,all:o,ipcOutput:i,options:a,startTime:u,isSync:!1}):gE({command:c,escapedCommand:l,stdio:n,all:o,ipcOutput:i,options:a,startTime:u}),Tj=(e,t)=>{const r=Object.fromEntries(Object.entries(t).map((([t,r])=>[t,xj(t,e[t],r)])));return Object.assign(Object.assign({},e),r)},xj=(e,t,r)=>jj.has(e)&&Bu(t)&&Bu(r)?Object.assign(Object.assign({},t),r):r,jj=new Set(["env",...fg]),Rj=(e,t,r,n)=>{const o=(e,t,n)=>Rj(e,t,r,n),i=(...i)=>Aj({mapArguments:e,deepOptions:r,boundOptions:t,setBoundExeca:n,createNested:o},...i);return void 0!==n&&n(i,o,t),i},Aj=({mapArguments:e,deepOptions:t={},boundOptions:r={},setBoundExeca:n,createNested:o},i,...s)=>{if(Bu(i))return o(e,Tj(r,i),n);const{file:a,commandArguments:c,options:l,isSync:u}=Dj({mapArguments:e,firstArgument:i,nextArguments:s,deepOptions:t,boundOptions:r});return u?((e,t,r)=>{const{file:n,commandArguments:o,command:i,escapedCommand:s,startTime:a,verboseInfo:c,options:l,fileDescriptors:u}=TI(e,t,r),f=AI({file:n,commandArguments:o,options:l,command:i,escapedCommand:s,verboseInfo:c,fileDescriptors:u,startTime:a});return RE(f,c,l)})(a,c,l):vj(a,c,l,o)},Dj=({mapArguments:e,firstArgument:t,nextArguments:r,deepOptions:n,boundOptions:o})=>{const i=(s=t,Array.isArray(s)&&Array.isArray(s.raw)?((e,t)=>{let r=[];for(const[n,o]of e.entries())r=Gm({templates:e,expressions:t,tokens:r,index:n,template:o});if(0===r.length)throw new TypeError("Template script must not be empty");const[n,...o]=r;return[n,o,{}]})(t,r):[t,...r]);var s;const[a,c,l]=Of(...i),u=Tj(Tj(n,o),l),{file:f=a,commandArguments:p=c,options:d=u,isSync:h=!1}=e({file:a,commandArguments:c,options:u});return{file:f,commandArguments:p,options:d,isSync:h}},Nj=(e,t)=>{if(t.length>0)throw new TypeError(`The command and its arguments must be passed as a single string: ${e} ${t}.`);const[r,...n]=Lj(e);return{file:r,commandArguments:n}},Lj=e=>{if("string"!=typeof e)throw new TypeError(`The command must be a string: ${String(e)}.`);const t=e.trim();if(""===t)return[];const r=[];for(const e of t.split(kj)){const t=r.at(-1);t&&t.endsWith("\\")?r[r.length-1]=`${t.slice(0,-1)} ${e}`:r.push(e)}return r},kj=/ +/g,Cj=({options:e})=>Object.assign(Object.assign({},Pj(e)),{},{isSync:!0}),Pj=e=>({options:Object.assign(Object.assign({},Mj(e)),e)}),Mj=({input:e,inputFile:t,stdio:r})=>void 0===e&&void 0===t&&void 0===r?{stdin:"inherit"}:{};Rj((()=>({})));const _j=Rj((()=>({isSync:!0})));Rj((({file:e,commandArguments:t})=>Nj(e,t))),Rj((({file:e,commandArguments:t})=>Object.assign(Object.assign({},Nj(e,t)),{},{isSync:!0}))),Rj((({options:e})=>{if(!1===e.node)throw new TypeError('The "node" option cannot be false with `execaNode()`.');return{options:Object.assign(Object.assign({},e),{},{node:!0})}})),Rj((({options:e})=>Pj(e)),{},{preferLocal:!0},((e,t,r)=>{e.sync=t(Cj,r),e.s=e.sync})),(()=>{const e=f,t=void 0!==f.channel;Object.assign(Object.assign({},zI(e,true,t)),{},{getCancelSignal:Uv.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:true,ipc:t})})})();const Fj=global,Bj=new Proxy(global.target,{set:function(e,t,r){return Reflect.set(...arguments)},get:function(e,t,r){return Wj(`make ${t}`),Reflect.get(...arguments)}}),$j=["packages","codemods","eslint"],Uj=Fj.which("yarn").stdout,Gj=process.execPath;function Wj(...e){console.log.apply(console,e)}function zj(e,t,n,o=!0,i=!1){Wj(`${e.replaceAll(Uj,"yarn").replaceAll(Gj,"node")} ${t.join(" ")}`);try{return _j(e,t,{stdio:o?"inherit":void 0,cwd:n&&r.resolve(n),env:process.env}).stdout}catch(r){throw o&&0!==r.exitCode&&(console.error(new Error(`\ncommand: ${e} ${t.join(" ")}\ncode: ${r.exitCode}`)),i||process.exit(r.exitCode)),r}}function qj(e,t,r,n){return zj(Uj,e,t,r,n)}function Vj(e,t,r){return zj(Gj,e,t,r)}function Hj(e,t){const r=process.env;process.env=Object.assign(Object.assign({},r),t),e(),process.env=r}function Xj(...e){const r=["--format","codeframe",...e.filter(Boolean)],n=t.readdirSync("packages").filter((e=>t.existsSync(`packages/${e}/package.json`))),o=[];for(let e=0,t=40;eqj(["eslint","packages",...i,...r])),{BABEL_ENV:"test",NODE_OPTIONS:"--max-old-space-size=16384"});else{let e=null;for(const t of o)try{Hj((()=>qj(["eslint",...t,...r],void 0,void 0,!0)),{BABEL_ENV:"test"})}catch(t){e=t}e&&process.exit(e.exitCode)}}function Kj(e,r,n){const o="./build/"+e.toLowerCase();Fj.rm("-rf",o),Wj("mkdir -p build"),t.mkdirSync("build",{recursive:!0}),zj("git",["clone","--filter=blob:none","--sparse","--single-branch","--shallow-since='2 years ago'",r,o]),zj("git",["sparse-checkout","set",...n],o),zj("git",["checkout","-q",function(e){const r=t.readFileSync("./Makefile","utf8").match(new RegExp(`${e}_COMMIT = (\\w{40})`))[1];if(!r)throw new Error(`Could not find ${e}_COMMIT in Makefile`);return r}(e)],o)}function Yj(){const e=JSON.parse(t.readFileSync("./package.json","utf8")).version_babel8;return $j.forEach((r=>{t.readdirSync(r).forEach((n=>{const o=`${r}/${n}/package.json`;if(t.existsSync(o)){const r=JSON.parse(t.readFileSync(o,"utf8"));r.peerDependencies?.["@babel/core"]&&(r.peerDependencies["@babel/core"]=`^${e}`);const i=r.conditions?.BABEL_8_BREAKING[0];i?.peerDependencies?.["@babel/core"]&&(i.peerDependencies["@babel/core"]=`^${e}`),"babel-eslint-plugin"===n&&(i.peerDependencies["@babel/eslint-parser"]=`^${e}`),t.writeFileSync(o,JSON.stringify(r,null,2)+"\n")}}))})),Hj((()=>qj(["install"])),{YARN_ENABLE_IMMUTABLE_INSTALLS:!1}),e}Fj.config.verbose=!0,Bj["clean-all"]=function(){Fj.rm("-rf",["package-lock.json",".changelog"]),$j.forEach((e=>{Fj.rm("-rf",`${e}/*/test/tmp`),Fj.rm("-rf",`${e}/*/package-lock.json`)})),Bj.clean(),Bj["clean-lib"](),Bj["clean-node-modules"]()},Bj["clean-node-modules"]=function(){Fj.rm("-rf","node_modules"),$j.forEach((e=>{Fj.rm("-rf",`${e}/*/node_modules`)}))},Bj.clean=function(){Bj["test-clean"](),Fj.rm("-rf",[".npmrc","coverage","packages/*/npm-debug*","node_modules/.cache"])},Bj["test-clean"]=function(){$j.forEach((e=>{Fj.rm("-rf",`${e}/*/test/tmp`),Fj.rm("-rf",`${e}/*/test-fixtures.json`)}))},Bj["clean-lib"]=function(){Fj.rm("-rf",$j.map((e=>`${e}/*/lib`))),Vj(["scripts/set-module-type.js"])},Bj["clean-runtime-helpers"]=function(){Fj.rm("-rf",["packages/babel-runtime/helpers/**/*.js","packages/babel-runtime-corejs2/helpers/**/*.js","packages/babel-runtime-corejs3/helpers/**/*.js","packages/babel-runtime/helpers/**/*.mjs","packages/babel-runtime-corejs2/helpers/**/*.mjs","packages/babel-runtime-corejs3/helpers/**/*.mjs","packages/babel-runtime-corejs2/core-js","packages/babel-runtime-corejs3/core-js","packages/babel-runtime-corejs3/core-js-stable"])},Bj["use-cjs"]=function(){Vj(["scripts/set-module-type.js","commonjs"]),Bj.bootstrap()},Bj["use-esm"]=function(){Vj(["scripts/set-module-type.js","module"]),Bj.bootstrap()},Bj["bootstrap-only"]=function(){Bj["clean-all"](),qj(["install"])},Bj.bootstrap=function(){Bj["bootstrap-only"](),Bj["generate-tsconfig"](),Bj.build()},Bj.build=function(){Bj["build-no-bundle"](),"true"!==process.env.BABEL_COVERAGE&&Bj["build-standalone"]()},Bj["build-standalone"]=function(){qj(["gulp","build-babel-standalone"])},Bj["build-bundle"]=function(){Bj.clean(),Bj["clean-lib"](),Vj(["scripts/set-module-type.js"]),qj(["gulp","build"]),Bj["build-dist"]()},Bj["build-no-bundle"]=function(){Bj.clean(),Bj["clean-lib"](),Vj(["scripts/set-module-type.js"]),Hj((()=>{qj(["gulp","build-dev"])}),{BABEL_ENV:"development"}),Bj["build-dist"]()},Bj["build-flow-typings"]=function(){t.writeFileSync("packages/babel-types/lib/index.js.flow",Vj(["packages/babel-types/scripts/generators/flow.js"],void 0,!1))},Bj["build-dist"]=function(){Bj["build-plugin-transform-runtime-dist"]()},Bj["build-plugin-transform-runtime-dist"]=function(){Vj(["scripts/build-dist.js"],"packages/babel-plugin-transform-runtime")},Bj.prepublish=function(){process.env.BABEL_8_BREAKING?Vj(["scripts/set-module-type.js","module"]):Vj(["scripts/set-module-type.js","commonjs"]),Bj["bootstrap-only"](),Hj((()=>{Bj["prepublish-build"](),Bj.test()}),{IS_PUBLISH:"true"}),Vj(["scripts/set-module-type.js","clean"])},Bj["prepublish-build"]=function(){Bj["clean-lib"](),Bj["clean-runtime-helpers"](),Vj(["scripts/generators/npm-ignore.js"]),Hj((()=>{Bj["build-bundle"]()}),{NODE_ENV:"production",BABEL_ENV:"production",STRIP_BABEL_8_FLAG:"true"}),Hj((()=>{Bj["prepublish-build-standalone"](),Bj["clone-license"](),Bj["prepublish-prepare-dts"](),Bj["build-flow-typings"]()}),{NODE_ENV:"production",STRIP_BABEL_8_FLAG:"true"})},Bj["prepublish-build-standalone"]=function(){Hj((()=>{Bj["build-standalone"]()}),{BABEL_ENV:"production",IS_PUBLISH:"true"})},Bj["prepublish-prepare-dts"]=function(){Bj["clean-ts"](),Bj.tscheck(),Bj["prepublish-prepare-dts-no-clean"]()},Bj["prepublish-prepare-dts-no-clean"]=function(){qj(["gulp","bundle-dts"]),Bj["build-typescript-legacy-typings"](),qj(["tsc","-p","tsconfig.dts-bundles.json"])},Bj.tscheck=function(){Bj["generate-tsconfig"](),Vj(["scripts/parallel-tsc/tsc.js","."]),Bj["tscheck-helpers"]()},Bj["tscheck-helpers"]=function(){qj(["tsc","-p","./packages/babel-helpers/src/helpers/tsconfig.json"])},Bj["clean-ts"]=function(){Fj.rm("-rf","tsconfig.tsbuildinfo"),Fj.rm("-rf","*/*/tsconfig.tsbuildinfo"),Fj.rm("-rf","dts")},Bj["generate-tsconfig"]=function(){Vj(["scripts/generators/tsconfig.js"]),Vj(["scripts/generators/archived-libs-typings.js"])},Bj["generate-type-helpers"]=function(){qj(["gulp","generate-type-helpers"])},Bj["build-typescript-legacy-typings"]=function(){t.writeFileSync("packages/babel-types/lib/index-legacy.d.ts",Vj(["packages/babel-types/scripts/generators/typescript-legacy.js"],void 0,!1))},Bj["clone-license"]=function(){Vj(["scripts/clone-license.js"])},Bj.lint=function(){Hj((()=>Bj.tscheck()),{TSCHECK_SILENT:"true"}),Xj(),Bj["lint-prettier"]()},Bj["lint-ci"]=function(){Bj.tscheck(),Xj(),Bj["lint-prettier"](),Bj["prepublish-prepare-dts-no-clean"]()},Bj["lint-prettier"]=function(){qj(["prettier",".","--check"])},Bj.fix=function(){Bj["fix-js"](),Bj["fix-prettier"]()},Bj["fix-js"]=function(){Hj((()=>Bj.tscheck()),{TSCHECK_SILENT:"true"}),Xj("--fix")},Bj["fix-prettier"]=function(){qj(["prettier",".","--write"])},Bj.watch=function(){Bj["build-no-bundle"](),Hj((()=>{qj(["gulp","watch"])}),{BABEL_ENV:"development",WATCH_SKIP_BUILD:"true"})},Bj.test=function(){Bj.lint(),Bj["test-only"]()},Bj["test-only"]=function(e=[]){qj(["jest",...e])},Bj["test-cov"]=function(){Bj.build(),Hj((()=>{qj(["c8","jest"])}),{BABEL_ENV:"test",BABEL_COVERAGE:"true"})},Bj["bootstrap-test262"]=function(){Kj("TEST262","https://github.com/tc39/test262.git",["test","harness"])},Bj["bootstrap-typescript"]=function(){Kj("TYPESCRIPT","https://github.com/microsoft/TypeScript.git",["tests"])},Bj["bootstrap-flow"]=function(){Kj("FLOW","https://github.com/facebook/flow.git",["src/parser/test/flow"])},Bj["new-version-checklist"]=function(){},Bj["new-version"]=function(){Bj["new-version-checklist"](),zj("git",["pull","--rebase"]),qj(["release-tool","version","-f","@babel/standalone"])},Bj["new-babel-8-version"]=function(){zj("git",["pull","--rebase"]);const e=JSON.parse(t.readFileSync("./package.json","utf8")),r=Fu.inc(e.version_babel8,"prerelease");return e.version_babel8=r,t.writeFileSync("./package.json",JSON.stringify(e,null,2)+"\n"),zj("git",["add","./package.json"]),zj("git",["commit","-m","Bump Babel 8 version to "+r]),zj("git",["tag",`v${r}`,"-m",`v${r}`]),r},Bj["new-babel-8-version-create-commit-ci"]=function(){qj(["release-tool","version",Yj(),"--all","--tag-version-prefix","tmp.v","--yes"])},Bj["new-babel-8-version-create-commit"]=function(){const e=Yj();zj("git",["checkout","-b",`release/temp/v${e}`]),qj(["release-tool","version",e,"--all","--tag-version-prefix","tmp.v"]),console.log("Run `BABEL_8_BREAKING=true make publish` to finish publishing")}; +"use strict";var e=require("os"),t=require("fs"),r=require("path"),n=require("events"),o=require("assert"),i=require("util"),s=require("child_process"),a=require("node:url"),c=require("node:child_process"),l=require("node:string_decoder"),u=require("node:util"),f=require("node:process"),p=require("node:fs"),d=require("node:tty"),h=require("node:path"),m=require("node:timers/promises"),g=require("node:os"),y=require("node:events"),b=require("node:v8"),v=require("node:stream"),w=require("node:buffer"),E=require("node:stream/promises"),S="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function O(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var I=function(e){return e&&e.Math===Math&&e},T=I("object"==typeof globalThis&&globalThis)||I("object"==typeof window&&window)||I("object"==typeof self&&self)||I("object"==typeof S&&S)||I("object"==typeof S&&S)||function(){return this}()||Function("return this")(),j={},x=function(e){try{return!!e()}catch(e){return!0}},R=!x((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})),A=!x((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})),D=A,N=Function.prototype.call,L=D?N.bind(N):function(){return N.apply(N,arguments)},k={},C={}.propertyIsEnumerable,P=Object.getOwnPropertyDescriptor,M=P&&!C.call({1:2},1);k.f=M?function(e){var t=P(this,e);return!!t&&t.enumerable}:C;var _,F,B=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},$=A,U=Function.prototype,G=U.call,W=$&&U.bind.bind(G,G),z=$?W:function(e){return function(){return G.apply(e,arguments)}},V=z,q=V({}.toString),H=V("".slice),X=function(e){return H(q(e),8,-1)},K=x,Y=X,Q=Object,J=z("".split),Z=K((function(){return!Q("z").propertyIsEnumerable(0)}))?function(e){return"String"===Y(e)?J(e,""):Q(e)}:Q,ee=function(e){return null==e},te=ee,re=TypeError,ne=function(e){if(te(e))throw new re("Can't call method on "+e);return e},oe=Z,ie=ne,se=function(e){return oe(ie(e))},ae="object"==typeof document&&document.all,ce=void 0===ae&&void 0!==ae?function(e){return"function"==typeof e||e===ae}:function(e){return"function"==typeof e},le=ce,ue=function(e){return"object"==typeof e?null!==e:le(e)},fe=T,pe=ce,de=function(e,t){return arguments.length<2?(r=fe[e],pe(r)?r:void 0):fe[e]&&fe[e][t];var r},he=z({}.isPrototypeOf),me=T,ge="undefined"!=typeof navigator&&String(navigator.userAgent)||"",ye=me.process,be=me.Deno,ve=ye&&ye.versions||be&&be.version,we=ve&&ve.v8;we&&(F=(_=we.split("."))[0]>0&&_[0]<4?1:+(_[0]+_[1])),!F&&ge&&(!(_=ge.match(/Edge\/(\d+)/))||_[1]>=74)&&(_=ge.match(/Chrome\/(\d+)/))&&(F=+_[1]);var Ee=F,Se=Ee,Oe=x,Ie=T.String,Te=!!Object.getOwnPropertySymbols&&!Oe((function(){var e=Symbol("symbol detection");return!Ie(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Se&&Se<41})),je=Te&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,xe=de,Re=ce,Ae=he,De=Object,Ne=je?function(e){return"symbol"==typeof e}:function(e){var t=xe("Symbol");return Re(t)&&Ae(t.prototype,De(e))},Le=String,ke=function(e){try{return Le(e)}catch(e){return"Object"}},Ce=ce,Pe=ke,Me=TypeError,_e=function(e){if(Ce(e))return e;throw new Me(Pe(e)+" is not a function")},Fe=_e,Be=ee,$e=function(e,t){var r=e[t];return Be(r)?void 0:Fe(r)},Ue=L,Ge=ce,We=ue,ze=TypeError,Ve={exports:{}},qe=T,He=Object.defineProperty,Xe=function(e,t){try{He(qe,e,{value:t,configurable:!0,writable:!0})}catch(r){qe[e]=t}return t},Ke=T,Ye=Xe,Qe="__core-js_shared__",Je=Ve.exports=Ke[Qe]||Ye(Qe,{});(Je.versions||(Je.versions=[])).push({version:"3.36.1",mode:"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.36.1/LICENSE",source:"https://github.com/zloirock/core-js"});var Ze=Ve.exports,et=Ze,tt=function(e,t){return et[e]||(et[e]=t||{})},rt=ne,nt=Object,ot=function(e){return nt(rt(e))},it=ot,st=z({}.hasOwnProperty),at=Object.hasOwn||function(e,t){return st(it(e),t)},ct=z,lt=0,ut=Math.random(),ft=ct(1..toString),pt=function(e){return"Symbol("+(void 0===e?"":e)+")_"+ft(++lt+ut,36)},dt=tt,ht=at,mt=pt,gt=Te,yt=je,bt=T.Symbol,vt=dt("wks"),wt=yt?bt.for||bt:bt&&bt.withoutSetter||mt,Et=function(e){return ht(vt,e)||(vt[e]=gt&&ht(bt,e)?bt[e]:wt("Symbol."+e)),vt[e]},St=L,Ot=ue,It=Ne,Tt=$e,jt=function(e,t){var r,n;if("string"===t&&Ge(r=e.toString)&&!We(n=Ue(r,e)))return n;if(Ge(r=e.valueOf)&&!We(n=Ue(r,e)))return n;if("string"!==t&&Ge(r=e.toString)&&!We(n=Ue(r,e)))return n;throw new ze("Can't convert object to primitive value")},xt=TypeError,Rt=Et("toPrimitive"),At=function(e,t){if(!Ot(e)||It(e))return e;var r,n=Tt(e,Rt);if(n){if(void 0===t&&(t="default"),r=St(n,e,t),!Ot(r)||It(r))return r;throw new xt("Can't convert object to primitive value")}return void 0===t&&(t="number"),jt(e,t)},Dt=At,Nt=Ne,Lt=function(e){var t=Dt(e,"string");return Nt(t)?t:t+""},kt=ue,Ct=T.document,Pt=kt(Ct)&&kt(Ct.createElement),Mt=function(e){return Pt?Ct.createElement(e):{}},_t=Mt,Ft=!R&&!x((function(){return 7!==Object.defineProperty(_t("div"),"a",{get:function(){return 7}}).a})),Bt=R,$t=L,Ut=k,Gt=B,Wt=se,zt=Lt,Vt=at,qt=Ft,Ht=Object.getOwnPropertyDescriptor;j.f=Bt?Ht:function(e,t){if(e=Wt(e),t=zt(t),qt)try{return Ht(e,t)}catch(e){}if(Vt(e,t))return Gt(!$t(Ut.f,e,t),e[t])};var Xt={},Kt=R&&x((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),Yt=ue,Qt=String,Jt=TypeError,Zt=function(e){if(Yt(e))return e;throw new Jt(Qt(e)+" is not an object")},er=R,tr=Ft,rr=Kt,nr=Zt,or=Lt,ir=TypeError,sr=Object.defineProperty,ar=Object.getOwnPropertyDescriptor,cr="enumerable",lr="configurable",ur="writable";Xt.f=er?rr?function(e,t,r){if(nr(e),t=or(t),nr(r),"function"==typeof e&&"prototype"===t&&"value"in r&&ur in r&&!r[ur]){var n=ar(e,t);n&&n[ur]&&(e[t]=r.value,r={configurable:lr in r?r[lr]:n[lr],enumerable:cr in r?r[cr]:n[cr],writable:!1})}return sr(e,t,r)}:sr:function(e,t,r){if(nr(e),t=or(t),nr(r),tr)try{return sr(e,t,r)}catch(e){}if("get"in r||"set"in r)throw new ir("Accessors not supported");return"value"in r&&(e[t]=r.value),e};var fr=Xt,pr=B,dr=R?function(e,t,r){return fr.f(e,t,pr(1,r))}:function(e,t,r){return e[t]=r,e},hr={exports:{}},mr=R,gr=at,yr=Function.prototype,br=mr&&Object.getOwnPropertyDescriptor,vr=gr(yr,"name"),wr={EXISTS:vr,PROPER:vr&&"something"===function(){}.name,CONFIGURABLE:vr&&(!mr||mr&&br(yr,"name").configurable)},Er=ce,Sr=Ze,Or=z(Function.toString);Er(Sr.inspectSource)||(Sr.inspectSource=function(e){return Or(e)});var Ir,Tr,jr,xr=Sr.inspectSource,Rr=ce,Ar=T.WeakMap,Dr=Rr(Ar)&&/native code/.test(String(Ar)),Nr=pt,Lr=tt("keys"),kr=function(e){return Lr[e]||(Lr[e]=Nr(e))},Cr={},Pr=Dr,Mr=T,_r=ue,Fr=dr,Br=at,$r=Ze,Ur=kr,Gr=Cr,Wr="Object already initialized",zr=Mr.TypeError,Vr=Mr.WeakMap;if(Pr||$r.state){var qr=$r.state||($r.state=new Vr);qr.get=qr.get,qr.has=qr.has,qr.set=qr.set,Ir=function(e,t){if(qr.has(e))throw new zr(Wr);return t.facade=e,qr.set(e,t),t},Tr=function(e){return qr.get(e)||{}},jr=function(e){return qr.has(e)}}else{var Hr=Ur("state");Gr[Hr]=!0,Ir=function(e,t){if(Br(e,Hr))throw new zr(Wr);return t.facade=e,Fr(e,Hr,t),t},Tr=function(e){return Br(e,Hr)?e[Hr]:{}},jr=function(e){return Br(e,Hr)}}var Xr={set:Ir,get:Tr,has:jr,enforce:function(e){return jr(e)?Tr(e):Ir(e,{})},getterFor:function(e){return function(t){var r;if(!_r(t)||(r=Tr(t)).type!==e)throw new zr("Incompatible receiver, "+e+" required");return r}}},Kr=z,Yr=x,Qr=ce,Jr=at,Zr=R,en=wr.CONFIGURABLE,tn=xr,rn=Xr.enforce,nn=Xr.get,on=String,sn=Object.defineProperty,an=Kr("".slice),cn=Kr("".replace),ln=Kr([].join),un=Zr&&!Yr((function(){return 8!==sn((function(){}),"length",{value:8}).length})),fn=String(String).split("String"),pn=hr.exports=function(e,t,r){"Symbol("===an(on(t),0,7)&&(t="["+cn(on(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),r&&r.getter&&(t="get "+t),r&&r.setter&&(t="set "+t),(!Jr(e,"name")||en&&e.name!==t)&&(Zr?sn(e,"name",{value:t,configurable:!0}):e.name=t),un&&r&&Jr(r,"arity")&&e.length!==r.arity&&sn(e,"length",{value:r.arity});try{r&&Jr(r,"constructor")&&r.constructor?Zr&&sn(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var n=rn(e);return Jr(n,"source")||(n.source=ln(fn,"string"==typeof t?t:"")),e};Function.prototype.toString=pn((function(){return Qr(this)&&nn(this).source||tn(this)}),"toString");var dn=hr.exports,hn=ce,mn=Xt,gn=dn,yn=Xe,bn=function(e,t,r,n){n||(n={});var o=n.enumerable,i=void 0!==n.name?n.name:t;if(hn(r)&&gn(r,i,n),n.global)o?e[t]=r:yn(t,r);else{try{n.unsafe?e[t]&&(o=!0):delete e[t]}catch(e){}o?e[t]=r:mn.f(e,t,{value:r,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return e},vn={},wn=Math.ceil,En=Math.floor,Sn=Math.trunc||function(e){var t=+e;return(t>0?En:wn)(t)},On=Sn,In=function(e){var t=+e;return t!=t||0===t?0:On(t)},Tn=In,jn=Math.max,xn=Math.min,Rn=In,An=Math.min,Dn=function(e){var t=Rn(e);return t>0?An(t,9007199254740991):0},Nn=Dn,Ln=function(e){return Nn(e.length)},kn=se,Cn=function(e,t){var r=Tn(e);return r<0?jn(r+t,0):xn(r,t)},Pn=Ln,Mn=function(e){return function(t,r,n){var o=kn(t),i=Pn(o);if(0===i)return!e&&-1;var s,a=Cn(n,i);if(e&&r!=r){for(;i>a;)if((s=o[a++])!=s)return!0}else for(;i>a;a++)if((e||a in o)&&o[a]===r)return e||a||0;return!e&&-1}},_n={includes:Mn(!0),indexOf:Mn(!1)},Fn=at,Bn=se,$n=_n.indexOf,Un=Cr,Gn=z([].push),Wn=function(e,t){var r,n=Bn(e),o=0,i=[];for(r in n)!Fn(Un,r)&&Fn(n,r)&&Gn(i,r);for(;t.length>o;)Fn(n,r=t[o++])&&(~$n(i,r)||Gn(i,r));return i},zn=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Vn=Wn,qn=zn.concat("length","prototype");vn.f=Object.getOwnPropertyNames||function(e){return Vn(e,qn)};var Hn={};Hn.f=Object.getOwnPropertySymbols;var Xn=de,Kn=vn,Yn=Hn,Qn=Zt,Jn=z([].concat),Zn=Xn("Reflect","ownKeys")||function(e){var t=Kn.f(Qn(e)),r=Yn.f;return r?Jn(t,r(e)):t},eo=at,to=Zn,ro=j,no=Xt,oo=x,io=ce,so=/#|\.prototype\./,ao=function(e,t){var r=lo[co(e)];return r===fo||r!==uo&&(io(t)?oo(t):!!t)},co=ao.normalize=function(e){return String(e).replace(so,".").toLowerCase()},lo=ao.data={},uo=ao.NATIVE="N",fo=ao.POLYFILL="P",po=ao,ho=T,mo=j.f,go=dr,yo=bn,bo=Xe,vo=function(e,t,r){for(var n=to(t),o=no.f,i=ro.f,s=0;s9007199254740991)throw Ro("Maximum allowed index exceeded");return e};Eo({target:"Array",proto:!0,arity:1,forced:x((function(){return 4294967297!==[].push.call({length:4294967296},1)}))||!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(e){return e instanceof TypeError}}()},{push:function(e){var t=Ao(this),r=Do(t),n=arguments.length;Lo(r+n);for(var o=0;os;)ri.f(e,r=o[s++],n[r]);return e};var si,ai=de("document","documentElement"),ci=Zt,li=Yo,ui=zn,fi=Cr,pi=ai,di=Mt,hi="prototype",mi="script",gi=kr("IE_PROTO"),yi=function(){},bi=function(e){return"<"+mi+">"+e+""},vi=function(e){e.write(bi("")),e.close();var t=e.parentWindow.Object;return e=null,t},wi=function(){try{si=new ActiveXObject("htmlfile")}catch(e){}var e,t,r;wi="undefined"!=typeof document?document.domain&&si?vi(si):(t=di("iframe"),r="java"+mi+":",t.style.display="none",pi.appendChild(t),t.src=String(r),(e=t.contentWindow.document).open(),e.write(bi("document.F=Object")),e.close(),e.F):vi(si);for(var n=ui.length;n--;)delete wi[hi][ui[n]];return wi()};fi[gi]=!0;var Ei,Si,Oi,Ii=Object.create||function(e,t){var r;return null!==e?(yi[hi]=ci(e),r=new yi,yi[hi]=null,r[gi]=e):r=wi(),void 0===t?r:li.f(r,t)},Ti=x,ji=ce,xi=ue,Ri=Wo,Ai=bn,Di=Et("iterator"),Ni=!1;[].keys&&("next"in(Oi=[].keys())?(Si=Ri(Ri(Oi)))!==Object.prototype&&(Ei=Si):Ni=!0);var Li=!xi(Ei)||Ti((function(){var e={};return Ei[Di].call(e)!==e}));Li&&(Ei={}),ji(Ei[Di])||Ai(Ei,Di,(function(){return this}));var ki={IteratorPrototype:Ei,BUGGY_SAFARI_ITERATORS:Ni},Ci=Eo,Pi=T,Mi=function(e,t){if(ko(t,e))return e;throw new Co("Incorrect invocation")},_i=Zt,Fi=ce,Bi=Wo,$i=qo,Ui=function(e,t,r){Ho?Xo.f(e,t,Ko(0,r)):e[t]=r},Gi=x,Wi=at,zi=ki.IteratorPrototype,Vi=R,qi="constructor",Hi="Iterator",Xi=Et("toStringTag"),Ki=TypeError,Yi=Pi[Hi],Qi=!Fi(Yi)||Yi.prototype!==zi||!Gi((function(){Yi({})})),Ji=function(){if(Mi(this,zi),Bi(this)===zi)throw new Ki("Abstract class Iterator not directly constructable")},Zi=function(e,t){Vi?$i(zi,e,{configurable:!0,get:function(){return t},set:function(t){if(_i(this),this===zi)throw new Ki("You can't redefine this property");Wi(this,e)?this[e]=t:Ui(this,e,t)}}):zi[e]=t};Wi(zi,Xi)||Zi(Xi,Hi),!Qi&&Wi(zi,qi)&&zi[qi]!==Object||Zi(qi,Ji),Ji.prototype=zi,Ci({global:!0,constructor:!0,forced:Qi},{Iterator:Ji});var es=function(e){return{iterator:e,next:e.next,done:!1}},ts=bn,rs=L,ns=Zt,os=$e,is=function(e,t,r){var n,o;ns(e);try{if(!(n=os(e,"return"))){if("throw"===t)throw r;return r}n=rs(n,e)}catch(e){o=!0,n=e}if("throw"===t)throw r;if(o)throw n;return ns(n),r},ss=L,as=Ii,cs=dr,ls=function(e,t,r){for(var n in t)ts(e,n,t[n],r);return e},us=Xr,fs=$e,ps=ki.IteratorPrototype,ds=function(e,t){return{value:e,done:t}},hs=is,ms=Et("toStringTag"),gs="IteratorHelper",ys="WrapForValidIterator",bs=us.set,vs=function(e){var t=us.getterFor(e?ys:gs);return ls(as(ps),{next:function(){var r=t(this);if(e)return r.nextHandler();try{var n=r.done?void 0:r.nextHandler();return ds(n,r.done)}catch(e){throw r.done=!0,e}},return:function(){var r=t(this),n=r.iterator;if(r.done=!0,e){var o=fs(n,"return");return o?ss(o,n):ds(void 0,!0)}if(r.inner)try{hs(r.inner.iterator,"normal")}catch(e){return hs(n,"throw",e)}return hs(n,"normal"),ds(void 0,!0)}})},ws=vs(!0),Es=vs(!1);cs(Es,ms,"Iterator Helper");var Ss=function(e,t){var r=function(r,n){n?(n.iterator=r.iterator,n.next=r.next):n=r,n.type=t?ys:gs,n.nextHandler=e,n.counter=0,n.done=!1,bs(this,n)};return r.prototype=t?ws:Es,r},Os=Zt,Is=is,Ts=function(e,t,r,n){try{return n?t(Os(r)[0],r[1]):t(r)}catch(t){Is(e,"throw",t)}},js=Eo,xs=L,Rs=_e,As=Zt,Ds=es,Ns=Ts,Ls=Ss((function(){for(var e,t,r=this.iterator,n=this.predicate,o=this.next;;){if(e=As(xs(o,r)),this.done=!!e.done)return;if(t=e.value,Ns(r,n,[t,this.counter++],!0))return t}}));js({target:"Iterator",proto:!0,real:!0,forced:false},{filter:function(e){return As(this),Rs(e),new Ls(Ds(this),{predicate:e})}});var ks=X,Cs=z,Ps=function(e){if("Function"===ks(e))return Cs(e)},Ms=_e,_s=A,Fs=Ps(Ps.bind),Bs={},$s=Bs,Us=Et("iterator"),Gs=Array.prototype,Ws={};Ws[Et("toStringTag")]="z";var zs="[object z]"===String(Ws),Vs=ce,qs=X,Hs=Et("toStringTag"),Xs=Object,Ks="Arguments"===qs(function(){return arguments}()),Ys=zs?qs:function(e){var t,r,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=function(e,t){try{return e[t]}catch(e){}}(t=Xs(e),Hs))?r:Ks?qs(t):"Object"===(n=qs(t))&&Vs(t.callee)?"Arguments":n},Qs=Ys,Js=$e,Zs=ee,ea=Bs,ta=Et("iterator"),ra=function(e){if(!Zs(e))return Js(e,ta)||Js(e,"@@iterator")||ea[Qs(e)]},na=L,oa=_e,ia=Zt,sa=ke,aa=ra,ca=TypeError,la=function(e,t){return Ms(e),void 0===t?e:_s?Fs(e,t):function(){return e.apply(t,arguments)}},ua=L,fa=Zt,pa=ke,da=function(e){return void 0!==e&&($s.Array===e||Gs[Us]===e)},ha=Ln,ma=he,ga=function(e,t){var r=arguments.length<2?aa(e):t;if(oa(r))return ia(na(r,e));throw new ca(sa(e)+" is not iterable")},ya=ra,ba=is,va=TypeError,wa=function(e,t){this.stopped=e,this.result=t},Ea=wa.prototype,Sa=function(e,t,r){var n,o,i,s,a,c,l,u=r&&r.that,f=!(!r||!r.AS_ENTRIES),p=!(!r||!r.IS_RECORD),d=!(!r||!r.IS_ITERATOR),h=!(!r||!r.INTERRUPTED),m=la(t,u),g=function(e){return n&&ba(n,"normal",e),new wa(!0,e)},y=function(e){return f?(fa(e),h?m(e[0],e[1],g):m(e[0],e[1])):h?m(e,g):m(e)};if(p)n=e.iterator;else if(d)n=e;else{if(!(o=ya(e)))throw new va(pa(e)+" is not iterable");if(da(o)){for(i=0,s=ha(e);s>i;i++)if((a=y(e[i]))&&ma(Ea,a))return a;return new wa(!1)}n=ga(e,o)}for(c=p?e.next:n.next;!(l=ua(c,n)).done;){try{a=y(l.value)}catch(e){ba(n,"throw",e)}if("object"==typeof a&&a&&ma(Ea,a))return a}return new wa(!1)},Oa=Sa,Ia=_e,Ta=Zt,ja=es;Eo({target:"Iterator",proto:!0,real:!0},{forEach:function(e){Ta(this),Ia(e);var t=ja(this),r=0;Oa(t,(function(t){e(t,r++)}),{IS_RECORD:!0})}});var xa=L,Ra=_e,Aa=Zt,Da=es,Na=Ts,La=Ss((function(){var e=this.iterator,t=Aa(xa(this.next,e));if(!(this.done=!!t.done))return Na(e,this.mapper,[t.value,this.counter++],!0)}));Eo({target:"Iterator",proto:!0,real:!0,forced:false},{map:function(e){return Aa(this),Ra(e),new La(Da(this),{mapper:e})}});var ka=Sa,Ca=_e,Pa=Zt,Ma=es,_a=TypeError;Eo({target:"Iterator",proto:!0,real:!0},{reduce:function(e){Pa(this),Ca(e);var t=Ma(this),r=arguments.length<2,n=r?void 0:arguments[1],o=0;if(ka(t,(function(t){r?(r=!1,n=t):n=e(n,t,o),o++}),{IS_RECORD:!0}),r)throw new _a("Reduce of empty iterator with no initial value");return n}});var Fa,Ba,$a,Ua={},Ga={};function Wa(){if(Fa)return Ga;Fa=1;var e=r,n="win32"===process.platform,o=t,i=process.env.NODE_DEBUG&&/fs/.test(process.env.NODE_DEBUG);function s(e){return"function"==typeof e?e:function(){var e;if(i){var t=new Error;e=function(e){e&&(t.message=e.message,r(e=t))}}else e=r;return e;function r(e){if(e){if(process.throwDeprecation)throw e;if(!process.noDeprecation){var t="fs: missing callback "+(e.stack||e.message);process.traceDeprecation?console.trace(t):console.error(t)}}}}()}if(e.normalize,n)var a=/(.*?)(?:[\/\\]+|$)/g;else a=/(.*?)(?:[\/]+|$)/g;if(n)var c=/^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/;else c=/^[\/]*/;return Ga.realpathSync=function(t,r){if(t=e.resolve(t),r&&Object.prototype.hasOwnProperty.call(r,t))return r[t];var i,s,l,u,f=t,p={},d={};function h(){var e=c.exec(t);i=e[0].length,s=e[0],l=e[0],u="",n&&!d[l]&&(o.lstatSync(l),d[l]=!0)}for(h();i=t.length)return r&&(r[d]=t),i(null,t);a.lastIndex=l;var e=a.exec(t);return p=u,u+=e[0],f=p+e[1],l=a.lastIndex,m[f]||r&&r[f]===f?process.nextTick(y):r&&Object.prototype.hasOwnProperty.call(r,f)?w(r[f]):o.lstat(f,b)}function b(e,t){if(e)return i(e);if(!t.isSymbolicLink())return m[f]=!0,r&&(r[f]=f),process.nextTick(y);if(!n){var s=t.dev.toString(32)+":"+t.ino.toString(32);if(h.hasOwnProperty(s))return v(null,h[s],f)}o.stat(f,(function(e){if(e)return i(e);o.readlink(f,(function(e,t){n||(h[s]=t),v(e,t)}))}))}function v(t,n,o){if(t)return i(t);var s=e.resolve(p,n);r&&(r[o]=s),w(s)}function w(r){t=e.resolve(r,t.slice(l)),g()}g()},Ga}function za(){if($a)return Ba;$a=1,Ba=c,c.realpath=c,c.sync=l,c.realpathSync=l,c.monkeypatch=function(){e.realpath=c,e.realpathSync=l},c.unmonkeypatch=function(){e.realpath=r,e.realpathSync=n};var e=t,r=e.realpath,n=e.realpathSync,o=process.version,i=/^v[0-5]\./.test(o),s=Wa();function a(e){return e&&"realpath"===e.syscall&&("ELOOP"===e.code||"ENOMEM"===e.code||"ENAMETOOLONG"===e.code)}function c(e,t,n){if(i)return r(e,t,n);"function"==typeof t&&(n=t,t=null),r(e,t,(function(r,o){a(r)?s.realpath(e,t,n):n(r,o)}))}function l(e,t){if(i)return n(e,t);try{return n(e,t)}catch(r){if(a(r))return s.realpathSync(e,t);throw r}}return Ba}var Va,qa,Ha,Xa,Ka,Ya,Qa,Ja,Za=Sa,ec=_e,tc=Zt,rc=es;function nc(){if(qa)return Va;qa=1,Va=function(t,r){for(var n=[],o=0;o=0&&l>0){for(n=[],i=r.length;u>=0&&!a;)u==c?(n.push(u),c=r.indexOf(e,u+1)):1==n.length?a=[n.pop(),l]:((o=n.pop())=0?c:l;n.length&&(a=[i,s])}return a}return Xa=1,Ha=e,e.range=r,Ha}();Ka=function(e){if(!e)return[];"{}"===e.substr(0,2)&&(e="\\{\\}"+e.substr(2));return h(function(e){return e.split("\\\\").join(r).split("\\{").join(n).split("\\}").join(o).split("\\,").join(i).split("\\.").join(s)}(e),!0).map(c)};var r="\0SLASH"+Math.random()+"\0",n="\0OPEN"+Math.random()+"\0",o="\0CLOSE"+Math.random()+"\0",i="\0COMMA"+Math.random()+"\0",s="\0PERIOD"+Math.random()+"\0";function a(e){return parseInt(e,10)==e?parseInt(e,10):e.charCodeAt(0)}function c(e){return e.split(r).join("\\").split(n).join("{").split(o).join("}").split(i).join(",").split(s).join(".")}function l(e){if(!e)return[""];var r=[],n=t("{","}",e);if(!n)return e.split(",");var o=n.pre,i=n.body,s=n.post,a=o.split(",");a[a.length-1]+="{"+i+"}";var c=l(s);return s.length&&(a[a.length-1]+=c.shift(),a.push.apply(a,c)),r.push.apply(r,a),r}function u(e){return"{"+e+"}"}function f(e){return/^-?0\d/.test(e)}function p(e,t){return e<=t}function d(e,t){return e>=t}function h(r,n){var i=[],s=t("{","}",r);if(!s||/\$$/.test(s.pre))return[r];var c,m=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(s.body),g=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(s.body),y=m||g,b=s.body.indexOf(",")>=0;if(!y&&!b)return s.post.match(/,.*\}/)?h(r=s.pre+"{"+s.body+o+s.post):[r];if(y)c=s.body.split(/\.\./);else if(1===(c=l(s.body)).length&&1===(c=h(c[0],!1).map(u)).length)return(E=s.post.length?h(s.post,!1):[""]).map((function(e){return s.pre+c[0]+e}));var v,w=s.pre,E=s.post.length?h(s.post,!1):[""];if(y){var S=a(c[0]),O=a(c[1]),I=Math.max(c[0].length,c[1].length),T=3==c.length?Math.abs(a(c[2])):1,j=p;O0){var N=new Array(D+1).join("0");A=R<0?"-"+N+A.slice(1):N+A}}v.push(A)}}else v=e(c,(function(e){return h(e,!1)}));for(var L=0;L65536)throw new TypeError("pattern is too long")};u.prototype.parse=function(e,r){p(e);var a=this.options;if("**"===e){if(!a.noglobstar)return t;e="*"}if(""===e)return"";var c,l="",u=!!a.nocase,f=!1,h=[],m=[],g=!1,y=-1,b=-1,v="."===e.charAt(0)?"":a.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",w=this;function E(){if(c){switch(c){case"*":l+=i,u=!0;break;case"?":l+=o,u=!0;break;default:l+="\\"+c}w.debug("clearStateChar %j %j",c,l),c=!1}}for(var S,O=0,I=e.length;O-1;N--){var L=m[N],k=l.slice(0,L.reStart),C=l.slice(L.reStart,L.reEnd-8),P=l.slice(L.reEnd-8,L.reEnd),M=l.slice(L.reEnd);P+=M;var _=k.split("(").length-1,F=M;for(O=0;O<_;O++)F=F.replace(/\)[+*?]?/,"");var B="";""===(M=F)&&r!==d&&(B="$"),l=k+C+M+B+P}""!==l&&u&&(l="(?=.)"+l);D&&(l=v+l);if(r===d)return[l,u];if(!u)return function(e){return e.replace(/\\(.)/g,"$1")}(e);var $=a.nocase?"i":"";try{var U=new RegExp("^"+l+"$",$)}catch(e){return new RegExp("$.")}return U._glob=e,U._src=l,U};var d={};return l.makeRe=function(e,t){return new u(e,t||{}).makeRe()},u.prototype.makeRe=function(){if(this.regexp||!1===this.regexp)return this.regexp;var e=this.set;if(!e.length)return this.regexp=!1,this.regexp;var r=this.options,n=r.noglobstar?i:r.dot?"(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?":"(?:(?!(?:\\/|^)\\.).)*?",o=r.nocase?"i":"",s=e.map((function(e){return e.map((function(e){return e===t?n:"string"==typeof e?function(e){return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}(e):e._src})).join("\\/")})).join("|");s="^(?:"+s+")$",this.negate&&(s="^(?!"+s+").*$");try{this.regexp=new RegExp(s,o)}catch(e){this.regexp=!1}return this.regexp},l.match=function(e,t,r){var n=new u(t,r=r||{});return e=e.filter((function(e){return n.match(e)})),n.options.nonull&&!e.length&&e.push(t),e},u.prototype.match=function(t,r){if(void 0===r&&(r=this.partial),this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return""===t;if("/"===t&&r)return!0;var n=this.options;"/"!==e.sep&&(t=t.split(e.sep).join("/")),t=t.split(a),this.debug(this.pattern,"split",t);var o,i,s=this.set;for(this.debug(this.pattern,"set",s),i=t.length-1;i>=0&&!(o=t[i]);i--);for(i=0;i>> no match, partial?",e,p,r,d),p!==a))}if("string"==typeof u?(l=f===u,this.debug("string match",u,f,l)):(l=f.match(u),this.debug("pattern match",u,f,l)),!l)return!1}if(i===a&&s===c)return!0;if(i===a)return n;if(s===c)return i===a-1&&""===e[i];throw new Error("wtf?")},Qa}Eo({target:"Iterator",proto:!0,real:!0},{some:function(e){tc(this),ec(e);var t=rc(this),r=0;return Za(t,(function(t,n){if(e(t,r++))return n()}),{IS_RECORD:!0,INTERRUPTED:!0}).stopped}});var sc,ac,cc={exports:{}},lc={exports:{}};function uc(){if(ac)return cc.exports;ac=1;try{var e=require("util");if("function"!=typeof e.inherits)throw"";cc.exports=e.inherits}catch(e){cc.exports=(sc||(sc=1,"function"==typeof Object.create?lc.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:lc.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}),lc.exports)}return cc.exports}var fc,pc={exports:{}};function dc(){if(fc)return pc.exports;function e(e){return"/"===e.charAt(0)}function t(e){var t=/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/.exec(e),r=t[1]||"",n=Boolean(r&&":"!==r.charAt(1));return Boolean(t[2]||n)}return fc=1,pc.exports="win32"===process.platform?t:e,pc.exports.posix=e,pc.exports.win32=t,pc.exports}var hc,mc,gc,yc,bc,vc={};function wc(){if(hc)return vc;function e(e,t){return Object.prototype.hasOwnProperty.call(e,t)}hc=1,vc.setopts=function(t,r,i){i||(i={});if(i.matchBase&&-1===r.indexOf("/")){if(i.noglobstar)throw new Error("base matching requires globstar");r="**/"+r}t.silent=!!i.silent,t.pattern=r,t.strict=!1!==i.strict,t.realpath=!!i.realpath,t.realpathCache=i.realpathCache||Object.create(null),t.follow=!!i.follow,t.dot=!!i.dot,t.mark=!!i.mark,t.nodir=!!i.nodir,t.nodir&&(t.mark=!0);t.sync=!!i.sync,t.nounique=!!i.nounique,t.nonull=!!i.nonull,t.nosort=!!i.nosort,t.nocase=!!i.nocase,t.stat=!!i.stat,t.noprocess=!!i.noprocess,t.absolute=!!i.absolute,t.fs=i.fs||n,t.maxLength=i.maxLength||1/0,t.cache=i.cache||Object.create(null),t.statCache=i.statCache||Object.create(null),t.symlinks=i.symlinks||Object.create(null),function(e,t){e.ignore=t.ignore||[],Array.isArray(e.ignore)||(e.ignore=[e.ignore]);e.ignore.length&&(e.ignore=e.ignore.map(l))}(t,i),t.changedCwd=!1;var c=process.cwd();e(i,"cwd")?(t.cwd=o.resolve(i.cwd),t.changedCwd=t.cwd!==c):t.cwd=c;t.root=i.root||o.resolve(t.cwd,"/"),t.root=o.resolve(t.root),"win32"===process.platform&&(t.root=t.root.replace(/\\/g,"/"));t.cwdAbs=s(t.cwd)?t.cwd:u(t,t.cwd),"win32"===process.platform&&(t.cwdAbs=t.cwdAbs.replace(/\\/g,"/"));t.nomount=!!i.nomount,i.nonegate=!0,i.nocomment=!0,i.allowWindowsEscape=!1,t.minimatch=new a(r,i),t.options=t.minimatch.options},vc.ownProp=e,vc.makeAbs=u,vc.finish=function(e){for(var t=e.nounique,r=t?[]:Object.create(null),n=0,o=e.matches.length;no?(n.splice(0,o),process.nextTick((function(){r.apply(null,i)}))):delete t[e]}}))}(e))})),Oc}function Bc(){if(jc)return Tc;jc=1,Tc=b;var e=za(),t=ic();t.Minimatch;var i=uc(),s=n.EventEmitter,a=r,c=o,l=dc(),u=function(){if(gc)return mc;gc=1,mc=p,p.GlobSync=d;var e=za(),t=ic();t.Minimatch,Bc().Glob;var n=r,i=o,s=dc(),a=wc(),c=a.setopts,l=a.ownProp,u=a.childrenIgnored,f=a.isIgnored;function p(e,t){if("function"==typeof t||3===arguments.length)throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167");return new d(e,t).found}function d(e,t){if(!e)throw new Error("must provide pattern");if("function"==typeof t||3===arguments.length)throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167");if(!(this instanceof d))return new d(e,t);if(c(this,e,t),this.noprocess)return this;var r=this.minimatch.set.length;this.matches=new Array(r);for(var n=0;nthis.maxLength)return!1;if(!this.stat&&l(this.cache,t)){var n=this.cache[t];if(Array.isArray(n)&&(n="DIR"),!r||"DIR"===n)return n;if(r&&"FILE"===n)return!1}var o=this.statCache[t];if(!o){var i;try{i=this.fs.lstatSync(t)}catch(e){if(e&&("ENOENT"===e.code||"ENOTDIR"===e.code))return this.statCache[t]=!1,!1}if(i&&i.isSymbolicLink())try{o=this.fs.statSync(t)}catch(e){o=i}else o=i}return this.statCache[t]=o,n=!0,o&&(n=o.isDirectory()?"DIR":"FILE"),this.cache[t]=this.cache[t]||n,(!r||"FILE"!==n)&&n},d.prototype._mark=function(e){return a.mark(this,e)},d.prototype._makeAbs=function(e){return a.makeAbs(this,e)},mc}(),f=wc(),p=f.setopts,d=f.ownProp,h=Fc(),m=f.childrenIgnored,g=f.isIgnored,y=_c();function b(e,t,r){if("function"==typeof t&&(r=t,t={}),t||(t={}),t.sync){if(r)throw new TypeError("callback provided to sync glob");return u(e,t)}return new w(e,t,r)}b.sync=u;var v=b.GlobSync=u.GlobSync;function w(e,t,r){if("function"==typeof t&&(r=t,t=null),t&&t.sync){if(r)throw new TypeError("callback provided to sync glob");return new v(e,t)}if(!(this instanceof w))return new w(e,t,r);p(this,e,t),this._didRealPath=!1;var n=this.minimatch.set.length;this.matches=new Array(n),"function"==typeof r&&(r=y(r),this.on("error",r),this.on("end",(function(e){r(null,e)})));var o=this;if(this._processing=0,this._emitQueue=[],this._processQueue=[],this.paused=!1,this.noprocess)return this;if(0===n)return a();for(var i=!0,s=0;s1)return!0;for(var o=0;othis.maxLength)return t();if(!this.stat&&d(this.cache,r)){var o=this.cache[r];if(Array.isArray(o)&&(o="DIR"),!n||"DIR"===o)return t(null,o);if(n&&"FILE"===o)return t()}var i=this.statCache[r];if(void 0!==i){if(!1===i)return t(null,i);var s=i.isDirectory()?"DIR":"FILE";return n&&"FILE"===s?t():t(null,s,i)}var a=this,c=h("stat\0"+r,(function(n,o){if(o&&o.isSymbolicLink())return a.fs.stat(r,(function(n,i){n?a._stat2(e,r,null,o,t):a._stat2(e,r,n,i,t)}));a._stat2(e,r,n,o,t)}));c&&a.fs.lstat(r,c)},w.prototype._stat2=function(e,t,r,n,o){if(r&&("ENOENT"===r.code||"ENOTDIR"===r.code))return this.statCache[t]=!1,o();var i="/"===e.slice(-1);if(this.statCache[t]=n,"/"===t.slice(-1)&&n&&!n.isDirectory())return o(null,!1,n);var s=!0;return n&&(s=n.isDirectory()?"DIR":"FILE"),this.cache[t]=this.cache[t]||s,i&&"FILE"===s?o():o(null,s,n)},Tc}function $c(){if(xc)return Ua;xc=1;var r=e,n=t,o=Bc(),i=Tu(),s=Object.create(i);Ua.extend=Object.assign;var a=Boolean(process.versions.electron),c={fatal:!1,globOptions:{},maxdepth:255,noglob:!1,silent:!1,verbose:!1,execPath:null,bufLength:65536},l={reset:function(){Object.assign(this,c),a||(this.execPath=process.execPath)},resetForTesting:function(){this.reset(),this.silent=!0}};l.reset(),Ua.config=l;var u={error:null,errorCode:0,currentCmd:"shell.js"};function f(e){return"object"==typeof e&&null!==e}function p(){l.silent||console.error.apply(console,arguments)}function d(e){if("string"!=typeof e)throw new TypeError("input must be a string");return e.replace(/\\/g,"/")}function h(e,t,r){if("string"!=typeof e)throw new Error("msg must be a string");var n={continue:!1,code:1,prefix:u.currentCmd+": ",silent:!1};"number"==typeof t&&f(r)?r.code=t:f(t)?r=t:"number"==typeof t?r={code:t}:"number"!=typeof t&&(r={}),r=Object.assign({},n,r),u.errorCode||(u.errorCode=r.code);var o=d(r.prefix+e);if(u.error=u.error?u.error+"\n":"",u.error+=o,l.fatal)throw new Error(o);if(e.length>0&&!r.silent&&p(o),!r.continue)throw{msg:"earlyExit",retValue:new m("",u.error,u.errorCode)}}function m(e,t,r){var n;return e instanceof Array?((n=e).stdout=e.join("\n"),e.length>0&&(n.stdout+="\n")):(n=new String(e)).stdout=e,n.stderr=t,n.code=r,E.forEach((function(e){n[e]=s[e].bind(n)})),n}function g(e,t,r){if("string"!=typeof e&&!f(e))throw new Error("options must be strings or key-value pairs");if(!f(t))throw new Error("parseOptions() internal error: map must be an object");if(r&&!f(r))throw new Error("parseOptions() internal error: errorOptions must be object");if("--"===e)return{};var n={};if(Object.keys(t).forEach((function(e){var r=t[e];"!"!==r[0]&&(n[r]=!1)})),""===e)return n;if("string"==typeof e){if("-"!==e[0])throw new Error("Options string must start with a '-'");e.slice(1).split("").forEach((function(e){if(e in t){var o=t[e];"!"===o[0]?n[o.slice(1)]=!1:n[o]=!0}else h("option not recognized: "+e,r||{})}))}else Object.keys(e).forEach((function(o){var i=o[1];if(i in t){var s=t[i];n[s]=e[o]}else h("option not recognized: "+i,r||{})}));return n}function y(e){if(!Array.isArray(e))throw new TypeError("must be an array");var t=[];return e.forEach((function(e){if("string"!=typeof e)t.push(e);else{var r;try{r=(r=o.sync(e,l.globOptions)).length>0?r:[e]}catch(t){r=[e]}t=t.concat(r)}})),t}Ua.state=u,delete process.env.OLDPWD,Ua.isObject=f,Ua.log=p,Ua.convertErrorOutput=d,Ua.error=h,Ua.ShellString=m,Ua.parseOptions=g,Ua.expand=y;var b="function"==typeof Buffer.alloc?function(e){return Buffer.alloc(e||l.bufLength)}:function(e){return new Buffer(e||l.bufLength)};function v(e,t,n){return n=n||{},function(){var o=null;u.currentCmd=e,u.error=null,u.errorCode=0;try{var i=[].slice.call(arguments,0);if(l.verbose&&console.error.apply(console,[e].concat(i)),u.pipedValue=this&&"string"==typeof this.stdout?this.stdout:"",!1===n.unix)o=t.apply(this,i);else{f(i[0])&&"Object"===i[0].constructor.name||(0===i.length||"string"!=typeof i[0]||i[0].length<=1||"-"!==i[0][0])&&i.unshift(""),i=(i=i.reduce((function(e,t){return Array.isArray(t)?e.concat(t):(e.push(t),e)}),[])).map((function(e){return f(e)&&"String"===e.constructor.name?e.toString():e}));var s=r.homedir();i=i.map((function(e){return"string"==typeof e&&"~/"===e.slice(0,2)||"~"===e?e.replace(/^~/,s):e})),l.noglob||!0!==n.allowGlobbing||(i=i.slice(0,n.globStart).concat(y(i.slice(n.globStart))));try{f(n.cmdOptions)&&(i[0]=g(i[0],n.cmdOptions)),o=t.apply(this,i)}catch(e){if("earlyExit"!==e.msg)throw e;o=e.retValue}}}catch(e){if(!u.error)throw e.name="ShellJSInternalError",e;if(l.fatal)throw e}return n.wrapOutput&&("string"==typeof o||Array.isArray(o))&&(o=new m(o,u.error,u.errorCode)),u.currentCmd="shell.js",o}}Ua.buffer=b,Ua.unlinkSync=function(e){try{n.unlinkSync(e)}catch(t){if("EPERM"!==t.code)throw t;n.chmodSync(e,"0666"),n.unlinkSync(e)}},Ua.statFollowLinks=function(){return n.statSync.apply(n,arguments)},Ua.statNoFollowLinks=function(){return n.lstatSync.apply(n,arguments)},Ua.randomFileName=function(){return"shelljs_"+function e(t){if(1===t)return parseInt(16*Math.random(),10).toString(16);for(var r="",n=0;n0&&"-"===e.charAt(0)?[].unshift.call(arguments,""):n.error("You must specify a file.")),e=n.parseOptions(e,{R:"recursive",c:"changes",v:"verbose"}),r=[].slice.call(arguments,2),e.recursive?(a=[],r.forEach((function e(t){var r=n.statNoFollowLinks(t);r.isSymbolicLink()||(a.push(t),r.isDirectory()&&o.readdirSync(t).forEach((function(r){e(t+"/"+r)})))}))):a=r,a.forEach((function(r){if(r=i.resolve(r),o.existsSync(r)||n.error("File not found: "+r),!e.recursive||!n.statNoFollowLinks(r).isSymbolicLink()){var a=n.statFollowLinks(r),c=a.isDirectory(),l=a.mode,u=l&s.TYPE_MASK,f=l;isNaN(parseInt(t,8))?t.split(",").forEach((function(t){var i=/([ugoa]*)([=\+-])([rwxXst]*)/i.exec(t);if(i){var a=i[1],p=i[2],d=i[3],h=-1!==a.indexOf("u")||"a"===a||""===a,m=-1!==a.indexOf("g")||"a"===a||""===a,g=-1!==a.indexOf("o")||"a"===a||""===a,y=-1!==d.indexOf("r"),b=-1!==d.indexOf("w"),v=-1!==d.indexOf("x"),w=-1!==d.indexOf("X"),E=-1!==d.indexOf("t"),S=-1!==d.indexOf("s");w&&c&&(v=!0);var O=0;switch(h&&(O|=(y?s.OWNER_READ:0)+(b?s.OWNER_WRITE:0)+(v?s.OWNER_EXEC:0)+(S?s.SETUID:0)),m&&(O|=(y?s.GROUP_READ:0)+(b?s.GROUP_WRITE:0)+(v?s.GROUP_EXEC:0)+(S?s.SETGID:0)),g&&(O|=(y?s.OTHER_READ:0)+(b?s.OTHER_WRITE:0)+(v?s.OTHER_EXEC:0)),E&&(O|=s.STICKY),p){case"+":f|=O;break;case"-":f&=~O;break;case"=":f=u+O,n.statFollowLinks(r).isDirectory()&&(f|=s.SETUID+s.SETGID&l);break;default:n.error("Could not recognize operator: `"+p+"`")}e.verbose&&console.log(r+" -> "+f.toString(8)),l!==f&&(!e.verbose&&e.changes&&console.log(r+" -> "+f.toString(8)),o.chmodSync(r,f),l=f)}else n.error("Invalid symbolic mode change: "+t)})):(f=u+parseInt(t,8),n.statFollowLinks(r).isDirectory()&&(f|=s.SETUID+s.SETGID&l),o.chmodSync(r,f))}})),""}return n.register("chmod",a,{}),Lc=a}function zc(){if(Pc)return Cc;Pc=1;var e=t,n=r,o=$c();function i(t,r,n){e.existsSync(t)||o.error("copyFileSync: no such file or directory: "+t);var i="win32"===process.platform;try{if(n.update&&o.statFollowLinks(t).mtime=o.config.maxdepth)){n++;var l="win32"===process.platform;try{e.mkdirSync(r)}catch(e){if("EEXIST"!==e.code)throw e}for(var u=e.readdirSync(t),f=0;f and/or "):(r=[].slice.call(arguments,1,arguments.length-1),a=arguments[arguments.length-1]);var c=e.existsSync(a),l=c&&o.statFollowLinks(a);return c&&l.isDirectory()||!(r.length>1)||o.error("dest is not a directory (too many sources)"),c&&l.isFile()&&t.no_force?new o.ShellString("","",0):(r.forEach((function(c,u){if(!e.existsSync(c))return""===c&&(c="''"),void o.error("no such file or directory: "+c,{continue:!0});var f=o.statFollowLinks(c);if(!t.noFollowsymlink&&f.isDirectory())if(t.recursive){var p=l&&l.isDirectory()?n.join(a,n.basename(c)):a;try{o.statFollowLinks(n.dirname(a)),s(c,p,0,{no_force:t.no_force,followsymlink:t.followsymlink})}catch(e){o.error("cannot create directory '"+a+"': No such file or directory")}}else o.error("omitting directory '"+c+"'",{continue:!0});else{var d=a;l&&l.isDirectory()&&(d=n.normalize(a+"/"+n.basename(c)));var h=e.existsSync(d);if(h&&function(e,t){var r=e[t];return e.slice(0,t).some((function(e){return n.basename(e)===n.basename(r)}))}(r,u))return void(t.no_force||o.error("will not overwrite just-created '"+d+"' with '"+c+"'",{continue:!0}));if(h&&t.no_force)return;if(""===n.relative(c,d))return void o.error("'"+d+"' and '"+c+"' are the same file",{continue:!0});i(c,d,t)}})),new o.ShellString("",o.state.error,o.state.errorCode))}return o.register("cp",c,{cmdOptions:{f:"!no_force",n:"no_force",u:"update",R:"recursive",r:"recursive",L:"followsymlink",P:"noFollowsymlink"},wrapOutput:!1}),Cc=c}var Vc,qc,Hc,Xc,Kc,Yc={};function Qc(){if(Vc)return Yc;Vc=1;var e=$c(),t=Gc(),n=r;e.register("dirs",u,{wrapOutput:!1}),e.register("pushd",c,{wrapOutput:!1}),e.register("popd",l,{wrapOutput:!1});var o=[];function i(e){return/^[\-+]\d+$/.test(e)}function s(t){if(i(t)){if(Math.abs(t)1))return e.error("no other directory");l=l.splice(1,1).concat(l)}return r["no-cd"]?l=l.slice(1):(c=n.resolve(l.shift()),t("",c)),o=l,u(r.quiet?"-q":"")}function l(r,a){if(i(r)&&(a=r,r=""),r=e.parseOptions(r,{n:"no-cd",q:"quiet"}),!o.length)return e.error("directory stack empty");if(a=s(a||"+0"),r["no-cd"]||a>0||o.length+a===0)a=a>0?a-1:a,o.splice(a,1);else{var c=n.resolve(o.shift());t("",c)}return u(r.quiet?"-q":"")}function u(t,r){if(i(t)&&(r=t,t=""),(t=e.parseOptions(t,{c:"clear",q:"quiet"})).clear)return o=[];var n=a();return r?((r=s(r))<0&&(r=n.length+r),t.quiet||e.log(n[r]),n[r]):(t.quiet||e.log(n.join(" ")),n)}return Yc.pushd=c,Yc.popd=l,Yc.dirs=u,Yc}function Jc(){if(Hc)return qc;Hc=1;var e=i.format,t=$c();function r(r){var n=[].slice.call(arguments,r?0:1),o={};try{o=t.parseOptions(n[0],{e:"escapes",n:"no_newline"},{silent:!0}),n[0]&&n.shift()}catch(e){t.state.error=null}var i=e.apply(null,n);return o.no_newline||(i+="\n"),process.stdout.write(i),i}return t.register("echo",r,{allowGlobbing:!1}),qc=r}function Zc(){if(Kc)return Xc;Kc=1;var e=$c();return Xc=function(){return e.state.error}}var el,tl={exports:{}};function rl(){return el||(el=1,function(e){if(require.main!==e)throw new Error("This file should not be required");var r=s,n=t,o=process.argv[2],i=n.readFileSync(o,"utf8"),a=JSON.parse(i),c=a.command,l=a.execOptions,u=a.pipe,f=a.stdoutFile,p=a.stderrFile,d=r.exec(c,l,(function(e){e?void 0===e.code?process.exitCode=1:process.exitCode=e.code:process.exitCode=0})),h=n.createWriteStream(f),m=n.createWriteStream(p);d.stdout.pipe(h),d.stderr.pipe(m),d.stdout.pipe(process.stdout),d.stderr.pipe(process.stderr),u&&d.stdin.end(u)}(tl)),tl.exports}tl.exports;var nl,ol,il,sl,al,cl,ll,ul,fl,pl,dl,hl,ml,gl,yl,bl,vl,wl,El,Sl,Ol,Il={};function Tl(){if(nl)return Il;nl=1;var r,n=$c(),o=e,i=t;function s(e){if(!e||!i.existsSync(e))return!1;if(!n.statFollowLinks(e).isDirectory())return!1;var t=e+"/"+n.randomFileName();try{return i.writeFileSync(t," "),n.unlinkSync(t),e}catch(e){return!1}}function a(){return r||(r=s(o.tmpdir())||s(process.env.TMPDIR)||s(process.env.TEMP)||s(process.env.TMP)||s(process.env.Wimp$ScrapDir)||s("C:\\TEMP")||s("C:\\TMP")||s("\\TEMP")||s("\\TMP")||s("/tmp")||s("/var/tmp")||s("/usr/tmp")||s("."))}return n.register("tempdir",a,{allowGlobbing:!1,wrapOutput:!1}),Il.tempDir=a,Il.isCached=function(){return r},Il.clearCache=function(){r=void 0},Il}function jl(){if(il)return ol;il=1;var e=r;function t(){return e.resolve(process.cwd())}return $c().register("pwd",t,{allowGlobbing:!1}),ol=t}function xl(){if(al)return sl;al=1;var e=$c(),n=Tl().tempDir,o=jl(),i=r,a=t,c=s,l=20971520,u=1;function f(t,r,s){r=r||{},t||e.error("must specify command");var f=e.readFromPipe();return"function"==typeof r&&(s=r,r={async:!0}),"object"==typeof r&&"function"==typeof s&&(r.async=!0),(r=e.extend({silent:e.config.silent,async:!1},r)).async?function(t,r,n,i){r=e.extend({silent:e.config.silent,cwd:o().toString(),env:process.env,maxBuffer:l,encoding:"utf8"},r);var s=c.exec(t,r,(function(e,t,r){i&&(e?void 0===e.code?i(1,t,r):i(e.code,t,r):i(0,t,r))}));return n&&s.stdin.end(n),r.silent||(s.stdout.pipe(process.stdout),s.stderr.pipe(process.stderr)),s}(t,r,f,s):function(t,r,s){e.config.execPath||e.error("Unable to find a path to the node binary. Please manually set config.execPath");var f=n(),p=i.resolve(f+"/"+e.randomFileName()),d=i.resolve(f+"/"+e.randomFileName()),h=i.resolve(f+"/"+e.randomFileName());r=e.extend({silent:e.config.silent,cwd:o().toString(),env:process.env,maxBuffer:l,encoding:"utf8"},r),a.existsSync(p)&&e.unlinkSync(p),a.existsSync(d)&&e.unlinkSync(d),a.existsSync(h)&&e.unlinkSync(h),r.cwd=i.resolve(r.cwd);var m={command:t,execOptions:r,pipe:s,stdoutFile:h,stderrFile:d};function g(e,t){a.writeFileSync(e,t,{encoding:"utf8",mode:parseInt("600",8)})}g(h,""),g(d,""),g(p,JSON.stringify(m));var y=[i.join(__dirname,"exec-child.js"),p];r.silent?r.stdio="ignore":r.stdio=[0,1,2];var b=0;try{delete r.shell,c.execFileSync(e.config.execPath,y,r)}catch(e){b=e.status||u}var v="",w="";"buffer"===r.encoding?(v=a.readFileSync(h),w=a.readFileSync(d)):(v=a.readFileSync(h,r.encoding),w=a.readFileSync(d,r.encoding));try{e.unlinkSync(p)}catch(e){}try{e.unlinkSync(d)}catch(e){}try{e.unlinkSync(h)}catch(e){}return 0!==b&&e.error(w,b,{continue:!0,silent:!0}),e.ShellString(v,w,b)}(t,r,f)}return e.register("exec",f,{unix:!1,canReceivePipe:!0,wrapOutput:!1}),sl=f}function Rl(){if(ll)return cl;ll=1;var e=r,n=t,o=$c(),i=Bc(),s=e.sep+"**";function a(t,r){t.all_deprecated&&(o.log("ls: Option -a is deprecated. Use -A instead"),t.all=!0),r=r?[].slice.call(arguments,1):["."];var a=[];function c(e,r,n){var i,s;"win32"===process.platform&&(r=r.replace(/\\/g,"/")),t.long?(n=n||(t.link?o.statFollowLinks(e):o.statNoFollowLinks(e)),a.push((i=r,(s=n).name=i,s.toString=function(){return[this.mode,this.nlink,this.uid,this.gid,this.size,this.mtime,this.name].join(" ")},s))):a.push(r)}return r.forEach((function(r){var a;try{if((a=t.link?o.statFollowLinks(r):o.statNoFollowLinks(r)).isSymbolicLink())try{var l=o.statFollowLinks(r);l.isDirectory()&&(a=l)}catch(e){}}catch(e){return void o.error("no such file or directory: "+r,2,{continue:!0})}a.isDirectory()&&!t.directory?t.recursive?i.sync(r+s,{dot:t.all,follow:t.link}).forEach((function(t){e.relative(r,t)&&c(t,e.relative(r,t))})):t.all?n.readdirSync(r).forEach((function(t){c(e.join(r,t),t)})):n.readdirSync(r).forEach((function(t){"."!==t[0]&&c(e.join(r,t),t)})):c(r,r,a)})),a}return o.register("ls",a,{cmdOptions:{R:"recursive",A:"all",L:"link",a:"all_deprecated",d:"directory",l:"long"}}),cl=a}function Al(){if(fl)return ul;fl=1;var e=r,t=$c(),n=Rl();function o(r,o){o?"string"==typeof o&&(o=[].slice.call(arguments,1)):t.error("no path specified");var i=[];function s(e){"win32"===process.platform&&(e=e.replace(/\\/g,"/")),i.push(e)}return o.forEach((function(r){var o;try{o=t.statFollowLinks(r)}catch(e){t.error("no such file or directory: "+r)}s(r),o.isDirectory()&&n({recursive:!0,all:!0},r).forEach((function(t){s(e.join(r,t))}))})),i}return t.register("find",o,{}),ul=o}function Dl(){if(dl)return pl;dl=1;var e=$c(),r=t;function n(t,n,o){var i=e.readFromPipe();o||i||e.error("no paths given",2),o=[].slice.call(arguments,2),i&&o.unshift("-");var s=[];return t.ignoreCase&&(n=new RegExp(n,"i")),o.forEach((function(o){if(r.existsSync(o)||"-"===o){var a="-"===o?i:r.readFileSync(o,"utf8");if(t.nameOnly)a.match(n)&&s.push(o);else a.split("\n").forEach((function(e){var r=e.match(n);(t.inverse&&!r||!t.inverse&&r)&&s.push(e)}))}else e.error("no such file or directory: "+o,2,{continue:!0})})),s.join("\n")+"\n"}return e.register("grep",n,{globStart:2,canReceivePipe:!0,cmdOptions:{v:"inverse",l:"nameOnly",i:"ignoreCase"}}),pl=n}function Nl(){if(ml)return hl;ml=1;var e=$c(),r=t;function n(t,n){var o=[],i=e.readFromPipe();n||i||e.error("no paths given");var s=1;!0===t.numLines?(s=2,t.numLines=Number(arguments[1])):!1===t.numLines&&(t.numLines=10),n=[].slice.call(arguments,s),i&&n.unshift("-");var a=!1;return n.forEach((function(n){if("-"!==n){if(!r.existsSync(n))return void e.error("no such file or directory: "+n,{continue:!0});if(e.statFollowLinks(n).isDirectory())return void e.error("error reading '"+n+"': Is a directory",{continue:!0})}var s;s="-"===n?i:t.numLines<0?r.readFileSync(n,"utf8"):function(t,n){for(var o=e.buffer(),i=o.length,s=i,a=0,c=r.openSync(t,"r"),l=0,u="";s===i&&l and/or "),r=String(r);var s=n.normalize(r).replace(RegExp(n.sep+"$"),""),a=n.resolve(r)===s;if(i=n.resolve(process.cwd(),String(i)),e.existsSync(i)&&(t.force||o.error("Destination file exists",{continue:!0}),e.unlinkSync(i)),t.symlink){var c="win32"===process.platform,l=c?"file":null,u=a?s:n.resolve(process.cwd(),n.dirname(i),r);e.existsSync(u)?c&&o.statFollowLinks(u).isDirectory()&&(l="junction"):o.error("Source file does not exist",{continue:!0});try{e.symlinkSync("junction"===l?u:r,i,l)}catch(e){o.error(e.message)}}else{e.existsSync(r)||o.error("Source file does not exist",{continue:!0});try{e.linkSync(r,i)}catch(e){o.error(e.message)}}return""}return o.register("ln",i,{cmdOptions:{s:"symlink",f:"force"}}),gl=i}function kl(){if(vl)return bl;vl=1;var e=$c(),n=t,o=r;function i(t){var r=o.dirname(t);r===t&&e.error("dirname() failed: ["+t+"]"),n.existsSync(r)||i(r),n.mkdirSync(t,parseInt("0777",8))}function s(t,r){return r||e.error("no paths given"),"string"==typeof r&&(r=[].slice.call(arguments,1)),r.forEach((function(r){try{var s=e.statNoFollowLinks(r);return void(t.fullpath?s.isFile()&&e.error("cannot create directory "+r+": File exists",{continue:!0}):e.error("path already exists: "+r,{continue:!0}))}catch(e){}var a=o.dirname(r);if(n.existsSync(a)||t.fullpath)try{t.fullpath?i(o.resolve(r)):n.mkdirSync(r,parseInt("0777",8))}catch(t){var c;if("EACCES"===t.code)c="Permission denied";else{if("ENOTDIR"!==t.code&&"ENOENT"!==t.code)throw t;c="Not a directory"}e.error("cannot create directory "+r+": "+c,{continue:!0})}else e.error("no such file or directory: "+a,{continue:!0})})),""}return e.register("mkdir",s,{cmdOptions:{p:"fullpath"}}),bl=s}function Cl(){if(El)return wl;El=1;var e=$c(),r=t;function n(t,i,s){var a;a=r.readdirSync(t);for(var c=0;c1e3)throw e}}catch(r){e.error("could not remove directory (code "+r.code+"): "+t,{continue:!0})}return u}}function o(e){var t=!0;try{var n=r.openSync(e,"a");r.closeSync(n)}catch(e){t=!1}return t}function i(t,r){return r||e.error("no paths given"),(r=[].slice.call(arguments,1)).forEach((function(r){var i;try{var s="/"===r[r.length-1]?r.slice(0,-1):r;i=e.statNoFollowLinks(s)}catch(n){return void(t.force||e.error("no such file or directory: "+r,{continue:!0}))}i.isFile()?function(t,r){r.force||o(t)?e.unlinkSync(t):e.error("permission denied: "+t,{continue:!0})}(r,t):i.isDirectory()?function(t,r){r.recursive?n(t,r.force):e.error("path is a directory",{continue:!0})}(r,t):i.isSymbolicLink()?function(t,r){var o;try{o=e.statFollowLinks(t)}catch(r){return void e.unlinkSync(t)}o.isFile()?e.unlinkSync(t):o.isDirectory()&&("/"===t[t.length-1]?r.recursive?n(t,r.force,!0):e.error("path is a directory",{continue:!0}):e.unlinkSync(t))}(r,t):i.isFIFO()&&function(t){e.unlinkSync(t)}(r)})),""}return e.register("rm",i,{cmdOptions:{f:"force",r:"recursive",R:"recursive"}}),wl=i}function Pl(){if(Ol)return Sl;Ol=1;var e=t,n=r,o=$c(),i=zc(),s=Cl();function a(t,r,a){arguments.length<3?o.error("missing and/or "):arguments.length>3?(r=[].slice.call(arguments,1,arguments.length-1),a=arguments[arguments.length-1]):"string"==typeof r?r=[r]:o.error("invalid arguments");var c=e.existsSync(a),l=c&&o.statFollowLinks(a);return c&&l.isDirectory()||!(r.length>1)||o.error("dest is not a directory (too many sources)"),c&&l.isFile()&&t.no_force&&o.error("dest file already exists: "+a),r.forEach((function(c,l){if(e.existsSync(c)){var u=a;if(e.existsSync(a)&&o.statFollowLinks(a).isDirectory()&&(u=n.normalize(a+"/"+n.basename(c))),e.existsSync(u)&&function(e,t){var r=e[t];return e.slice(0,t).some((function(e){return n.basename(e)===n.basename(r)}))}(r,l))t.no_force||o.error("will not overwrite just-created '"+u+"' with '"+c+"'",{continue:!0});else if(e.existsSync(u)&&t.no_force)o.error("dest file already exists: "+u,{continue:!0});else if(n.resolve(c)!==n.dirname(n.resolve(u)))try{e.renameSync(c,u)}catch(e){"EXDEV"===e.code&&(i("-r",c,u),s("-rf",c))}else o.error("cannot move to self: "+c,{continue:!0})}else o.error("no such file or directory: "+c,{continue:!0})})),""}return o.register("mv",a,{cmdOptions:{f:"!no_force",n:"no_force"}}),Sl=a}var Ml,_l={};function Fl(){return Ml||(Ml=1),_l}var Bl,$l,Ul,Gl,Wl,zl,Vl,ql,Hl,Xl,Kl,Yl,Ql,Jl,Zl,eu,tu,ru,nu,ou,iu,su,au={};function cu(){return Bl||(Bl=1),au}function lu(){if(Ul)return $l;Ul=1;var e=$c(),r=t;function n(t,n,o,i){var s=e.readFromPipe();"string"!=typeof o&&"function"!=typeof o&&("number"==typeof o?o=o.toString():e.error("invalid replacement string")),"string"==typeof n&&(n=RegExp(n)),i||s||e.error("no files given"),i=[].slice.call(arguments,3),s&&i.unshift("-");var a=[];return i.forEach((function(i){if(r.existsSync(i)||"-"===i){var c=("-"===i?s:r.readFileSync(i,"utf8")).split("\n").map((function(e){return e.replace(n,o)})).join("\n");a.push(c),t.inplace&&r.writeFileSync(i,c,"utf8")}else e.error("no such file or directory: "+i,2,{continue:!0})})),a.join("\n")}return e.register("sed",n,{globStart:3,canReceivePipe:!0,cmdOptions:{i:"inplace"}}),$l=n}function uu(){if(Wl)return Gl;Wl=1;var e=$c();function t(t){if(!t){var r=[].slice.call(arguments,0);r.length<2&&e.error("must provide an argument"),t=r[1]}var n="+"===t[0];n&&(t="-"+t.slice(1)),t=e.parseOptions(t,{e:"fatal",v:"verbose",f:"noglob"}),n&&Object.keys(t).forEach((function(e){t[e]=!t[e]})),Object.keys(t).forEach((function(r){n!==t[r]&&(e.config[r]=t[r])}))}return e.register("set",t,{allowGlobbing:!1,wrapOutput:!1}),Gl=t}function fu(){if(Vl)return zl;Vl=1;var e=$c(),r=t;function n(e){var t=e.match(/^\s*(\d*)\s*(.*)$/);return{num:Number(t[1]),value:t[2]}}function o(e,t){var r=e.toLowerCase(),n=t.toLowerCase();return r===n?-1*e.localeCompare(t):r.localeCompare(n)}function i(e,t){var r=n(e),i=n(t);return r.hasOwnProperty("num")&&i.hasOwnProperty("num")&&r.num!==i.num?r.num-i.num:o(r.value,i.value)}function s(t,n){var s=e.readFromPipe();n||s||e.error("no files given"),n=[].slice.call(arguments,1),s&&n.unshift("-");var a=n.reduce((function(t,n){if("-"!==n){if(!r.existsSync(n))return e.error("no such file or directory: "+n,{continue:!0}),t;if(e.statFollowLinks(n).isDirectory())return e.error("read failed: "+n+": Is a directory",{continue:!0}),t}var o="-"===n?s:r.readFileSync(n,"utf8");return t.concat(o.trimRight().split("\n"))}),[]).sort(t.numerical?i:o);return t.reverse&&(a=a.reverse()),a.join("\n")+"\n"}return e.register("sort",s,{canReceivePipe:!0,cmdOptions:{r:"reverse",n:"numerical"}}),zl=s}function pu(){if(Hl)return ql;Hl=1;var e=$c(),r=t;function n(t,n){var o=[],i=e.readFromPipe();n||i||e.error("no paths given");var s=1;!0===t.numLines?(s=2,t.numLines=Number(arguments[1])):!1===t.numLines&&(t.numLines=10),t.numLines=-1*Math.abs(t.numLines),n=[].slice.call(arguments,s),i&&n.unshift("-");var a=!1;return n.forEach((function(n){if("-"!==n){if(!r.existsSync(n))return void e.error("no such file or directory: "+n,{continue:!0});if(e.statFollowLinks(n).isDirectory())return void e.error("error reading '"+n+"': Is a directory",{continue:!0})}var s=("-"===n?i:r.readFileSync(n,"utf8")).split("\n");""===s[s.length-1]?(s.pop(),a=!0):a=!1,o=o.concat(s.slice(t.numLines))})),a&&o.push(""),o.join("\n")}return e.register("tail",n,{canReceivePipe:!0,cmdOptions:{n:"numLines"}}),ql=n}function du(){if(Kl)return Xl;Kl=1;var e=$c(),r=t;function n(t,n){n||e.error("no path given");var o=!1;if(Object.keys(t).forEach((function(e){!0===t[e]&&(o=!0)})),o||e.error("could not interpret expression"),t.link)try{return e.statNoFollowLinks(n).isSymbolicLink()}catch(e){return!1}if(!r.existsSync(n))return!1;if(t.exists)return!0;var i=e.statFollowLinks(n);return t.block?i.isBlockDevice():t.character?i.isCharacterDevice():t.directory?i.isDirectory():t.file?i.isFile():t.pipe?i.isFIFO():!!t.socket&&i.isSocket()}return e.register("test",n,{cmdOptions:{b:"block",c:"character",d:"directory",e:"exists",f:"file",L:"link",p:"pipe",S:"socket"},wrapOutput:!1,allowGlobbing:!1}),Xl=n}function hu(){if(Ql)return Yl;Ql=1;var e=$c(),n=t,o=r;function i(t,r){r||e.error("wrong arguments"),n.existsSync(o.dirname(r))||e.error("no such file or directory: "+o.dirname(r));try{return n.writeFileSync(r,this.stdout||this.toString(),"utf8"),this}catch(t){e.error("could not write to file (code "+t.code+"): "+r,{continue:!0})}}return e.register("to",i,{pipeOnly:!0,wrapOutput:!1}),Yl=i}function mu(){if(Zl)return Jl;Zl=1;var e=$c(),n=t,o=r;function i(t,r){r||e.error("wrong arguments"),n.existsSync(o.dirname(r))||e.error("no such file or directory: "+o.dirname(r));try{return n.appendFileSync(r,this.stdout||this.toString(),"utf8"),this}catch(t){e.error("could not append to file (code "+t.code+"): "+r,{continue:!0})}}return e.register("toEnd",i,{pipeOnly:!0,wrapOutput:!1}),Jl=i}function gu(){if(tu)return eu;tu=1;var e=$c(),r=t;function n(t,n){return n?"string"==typeof n?n=[].slice.call(arguments,1):e.error("file arg should be a string file path or an Array of string file paths"):e.error("no files given"),n.forEach((function(n){!function(t,n){var i=o(n);if(i&&i.isDirectory())return;if(!i&&t.no_create)return;r.closeSync(r.openSync(n,"a"));var s=new Date,a=t.date||s,c=t.date||s;if(t.reference){var l=o(t.reference);l||e.error("failed to get attributess of "+t.reference),a=l.mtime,c=l.atime}else t.date&&(a=t.date,c=t.date);t.atime_only&&t.mtime_only||(t.atime_only?a=i.mtime:t.mtime_only&&(c=i.atime));r.utimesSync(n,c,a)}(t,n)})),""}function o(t){try{return e.statFollowLinks(t)}catch(e){return null}}return e.register("touch",n,{cmdOptions:{a:"atime_only",c:"no_create",d:"date",m:"mtime_only",r:"reference"}}),eu=n}function yu(){if(nu)return ru;nu=1;var e=$c(),r=t;function n(t,n,o){var i=e.readFromPipe();i||(n||e.error("no input given"),r.existsSync(n)?e.statFollowLinks(n).isDirectory()&&e.error("error reading '"+n+"'"):e.error(n+": No such file or directory")),o&&r.existsSync(o)&&e.statFollowLinks(o).isDirectory()&&e.error(o+": Is a directory");var s=(n?r.readFileSync(n,"utf8"):i).trimRight().split("\n"),a=s.reduceRight((function(e,r){return 0===e.length?[{count:1,ln:r}]:0===function(e,r){return t.ignoreCase?e.toLocaleLowerCase().localeCompare(r.toLocaleLowerCase()):e.localeCompare(r)}(e[0].ln,r)?[{count:e[0].count+1,ln:r}].concat(e.slice(1)):[{count:1,ln:r}].concat(e)}),[]).filter((function(e){return!t.duplicates||e.count>1})).map((function(e){return(t.count?function(e,t){var r=""+t;return r.length0)||t.all);p++){var d=o.resolve(s[p],r);n&&(d=d.toUpperCase());var h=d.match(/\.[^<>:"/\|?*.]+$/);if(h&&f.indexOf(h[0])>=0){if(l(d)){u.push(d);break}}else for(var m=0;m0?t.all?u:u[0]:t.all?[]:null}return ou=u}function vu(){return su||(su={"/node_modules/shelljs/src/cat.js":Uc,"/node_modules/shelljs/src/cd.js":Gc,"/node_modules/shelljs/src/chmod.js":Wc,"/node_modules/shelljs/src/common.js":$c,"/node_modules/shelljs/src/cp.js":zc,"/node_modules/shelljs/src/dirs.js":Qc,"/node_modules/shelljs/src/echo.js":Jc,"/node_modules/shelljs/src/error.js":Zc,"/node_modules/shelljs/src/exec-child.js":rl,"/node_modules/shelljs/src/exec.js":xl,"/node_modules/shelljs/src/find.js":Al,"/node_modules/shelljs/src/grep.js":Dl,"/node_modules/shelljs/src/head.js":Nl,"/node_modules/shelljs/src/ln.js":Ll,"/node_modules/shelljs/src/ls.js":Rl,"/node_modules/shelljs/src/mkdir.js":kl,"/node_modules/shelljs/src/mv.js":Pl,"/node_modules/shelljs/src/popd.js":Fl,"/node_modules/shelljs/src/pushd.js":cu,"/node_modules/shelljs/src/pwd.js":jl,"/node_modules/shelljs/src/rm.js":Cl,"/node_modules/shelljs/src/sed.js":lu,"/node_modules/shelljs/src/set.js":uu,"/node_modules/shelljs/src/sort.js":fu,"/node_modules/shelljs/src/tail.js":pu,"/node_modules/shelljs/src/tempdir.js":Tl,"/node_modules/shelljs/src/test.js":du,"/node_modules/shelljs/src/to.js":hu,"/node_modules/shelljs/src/toEnd.js":mu,"/node_modules/shelljs/src/touch.js":gu,"/node_modules/shelljs/src/uniq.js":yu,"/node_modules/shelljs/src/which.js":bu})}function wu(e,t){var r,n=function(e){var t=e[0];if("/"===t||"\\"===t)return!1;var r=e[1],n=e[2];return!(!("."!==t||r&&"/"!==r&&"\\"!==r)||!("."!==t||"."!==r||n&&"/"!==n&&"\\"!==n))&&(":"!==r||"/"!==n&&"\\"!==n)}(e);"/"===(e=Eu(e))[0]&&(t="");for(var o=vu(),i=["",".js",".json"];!(r=Eu(n?t+"/node_modules/"+e:t+"/"+e)).endsWith("/..");){for(var s=0;s0&&".."!==t[n-1]&&"."!==t[n-1]&&(t.splice(--n,2),n--);return e=t.join("/"),r&&"/"!==e[0]?e="/"+e:0===e.length&&(e="."),e}var Su,Ou={},Iu=["cat","cd","chmod","cp","dirs","echo","exec","find","grep","head","ln","ls","mkdir","mv","pwd","rm","sed","set","sort","tail","tempdir","test","to","toEnd","touch","uniq","which"];function Tu(){if(Su)return Ou;Su=1;var e=$c();return Iu.forEach((function(e){!function(e){function t(t){var r=wu(t,e);if(null!==r)return vu()[r]();throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}return t.resolve=function(t){var r=wu(t,e);return null!==r?r:require.resolve(t)},t}("/node_modules/shelljs")("./src/"+e)})),Ou.exit=process.exit,Ou.error=Zc(),Ou.ShellString=e.ShellString,Ou.env=process.env,Ou.config=e.config,Ou}var ju=Tu(),xu=$c();Object.keys(ju).forEach((function(e){S[e]=ju[e]}));var Ru=hu();String.prototype.to=xu.wrap("to",Ru);var Au=mu();String.prototype.toEnd=xu.wrap("toEnd",Au),S.config.fatal=!0,S.target={};var Du,Nu=process.argv.slice(2),Lu=Nu.indexOf("--");Lu>-1&&(Du=Nu.slice(Lu+1,Nu.length),Nu=Nu.slice(0,Lu)),setTimeout((function(){var e;if(1!==Nu.length||"--help"!==Nu[0]){for(e in S.target)!function(e,t){S.target[e]=function(){return t.done||(t.done=!0,t.result=t.apply(t,arguments)),t.result}}(e,S.target[e]);Nu.length>0?Nu.forEach((function(e){e in S.target?S.target[e](Du):console.log("no such target: "+e)})):"all"in S.target&&S.target.all(Du)}else for(e in console.log("Available targets:"),S.target)console.log(" "+e)}),0);var ku=Sa,Cu=_e,Pu=Zt,Mu=es;Eo({target:"Iterator",proto:!0,real:!0},{every:function(e){Pu(this),Cu(e);var t=Mu(this),r=0;return!ku(t,(function(t,n){if(!e(t,r++))return n()}),{IS_RECORD:!0,INTERRUPTED:!0}).stopped}});var _u={exports:{}};!function(e,t){var r;t=_u.exports=y,r="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?function(){var e=Array.prototype.slice.call(arguments,0);e.unshift("SEMVER"),console.log.apply(console,e)}:function(){},t.SEMVER_SPEC_VERSION="2.0.0";var n=256,o=Number.MAX_SAFE_INTEGER||9007199254740991,i=n-6,s=t.re=[],a=t.safeRe=[],c=t.src=[],l=t.tokens={},u=0;function f(e){l[e]=u++}var p="[a-zA-Z0-9-]",d=[["\\s",1],["\\d",n],[p,i]];function h(e){for(var t=0;t)?=?)",f("XRANGEIDENTIFIERLOOSE"),c[l.XRANGEIDENTIFIERLOOSE]=c[l.NUMERICIDENTIFIERLOOSE]+"|x|X|\\*",f("XRANGEIDENTIFIER"),c[l.XRANGEIDENTIFIER]=c[l.NUMERICIDENTIFIER]+"|x|X|\\*",f("XRANGEPLAIN"),c[l.XRANGEPLAIN]="[v=\\s]*("+c[l.XRANGEIDENTIFIER]+")(?:\\.("+c[l.XRANGEIDENTIFIER]+")(?:\\.("+c[l.XRANGEIDENTIFIER]+")(?:"+c[l.PRERELEASE]+")?"+c[l.BUILD]+"?)?)?",f("XRANGEPLAINLOOSE"),c[l.XRANGEPLAINLOOSE]="[v=\\s]*("+c[l.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+c[l.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+c[l.XRANGEIDENTIFIERLOOSE]+")(?:"+c[l.PRERELEASELOOSE]+")?"+c[l.BUILD]+"?)?)?",f("XRANGE"),c[l.XRANGE]="^"+c[l.GTLT]+"\\s*"+c[l.XRANGEPLAIN]+"$",f("XRANGELOOSE"),c[l.XRANGELOOSE]="^"+c[l.GTLT]+"\\s*"+c[l.XRANGEPLAINLOOSE]+"$",f("COERCE"),c[l.COERCE]="(^|[^\\d])(\\d{1,16})(?:\\.(\\d{1,16}))?(?:\\.(\\d{1,16}))?(?:$|[^\\d])",f("COERCERTL"),s[l.COERCERTL]=new RegExp(c[l.COERCE],"g"),a[l.COERCERTL]=new RegExp(h(c[l.COERCE]),"g"),f("LONETILDE"),c[l.LONETILDE]="(?:~>?)",f("TILDETRIM"),c[l.TILDETRIM]="(\\s*)"+c[l.LONETILDE]+"\\s+",s[l.TILDETRIM]=new RegExp(c[l.TILDETRIM],"g"),a[l.TILDETRIM]=new RegExp(h(c[l.TILDETRIM]),"g");f("TILDE"),c[l.TILDE]="^"+c[l.LONETILDE]+c[l.XRANGEPLAIN]+"$",f("TILDELOOSE"),c[l.TILDELOOSE]="^"+c[l.LONETILDE]+c[l.XRANGEPLAINLOOSE]+"$",f("LONECARET"),c[l.LONECARET]="(?:\\^)",f("CARETTRIM"),c[l.CARETTRIM]="(\\s*)"+c[l.LONECARET]+"\\s+",s[l.CARETTRIM]=new RegExp(c[l.CARETTRIM],"g"),a[l.CARETTRIM]=new RegExp(h(c[l.CARETTRIM]),"g");f("CARET"),c[l.CARET]="^"+c[l.LONECARET]+c[l.XRANGEPLAIN]+"$",f("CARETLOOSE"),c[l.CARETLOOSE]="^"+c[l.LONECARET]+c[l.XRANGEPLAINLOOSE]+"$",f("COMPARATORLOOSE"),c[l.COMPARATORLOOSE]="^"+c[l.GTLT]+"\\s*("+c[l.LOOSEPLAIN]+")$|^$",f("COMPARATOR"),c[l.COMPARATOR]="^"+c[l.GTLT]+"\\s*("+c[l.FULLPLAIN]+")$|^$",f("COMPARATORTRIM"),c[l.COMPARATORTRIM]="(\\s*)"+c[l.GTLT]+"\\s*("+c[l.LOOSEPLAIN]+"|"+c[l.XRANGEPLAIN]+")",s[l.COMPARATORTRIM]=new RegExp(c[l.COMPARATORTRIM],"g"),a[l.COMPARATORTRIM]=new RegExp(h(c[l.COMPARATORTRIM]),"g");f("HYPHENRANGE"),c[l.HYPHENRANGE]="^\\s*("+c[l.XRANGEPLAIN]+")\\s+-\\s+("+c[l.XRANGEPLAIN]+")\\s*$",f("HYPHENRANGELOOSE"),c[l.HYPHENRANGELOOSE]="^\\s*("+c[l.XRANGEPLAINLOOSE]+")\\s+-\\s+("+c[l.XRANGEPLAINLOOSE]+")\\s*$",f("STAR"),c[l.STAR]="(<|>)?=?\\s*\\*";for(var m=0;mn)return null;if(!(t.loose?a[l.LOOSE]:a[l.FULL]).test(e))return null;try{return new y(e,t)}catch(e){return null}}function y(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof y){if(e.loose===t.loose)return e;e=e.version}else if("string"!=typeof e)throw new TypeError("Invalid Version: "+e);if(e.length>n)throw new TypeError("version is longer than "+n+" characters");if(!(this instanceof y))return new y(e,t);r("SemVer",e,t),this.options=t,this.loose=!!t.loose;var i=e.trim().match(t.loose?a[l.LOOSE]:a[l.FULL]);if(!i)throw new TypeError("Invalid Version: "+e);if(this.raw=e,this.major=+i[1],this.minor=+i[2],this.patch=+i[3],this.major>o||this.major<0)throw new TypeError("Invalid major version");if(this.minor>o||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>o||this.patch<0)throw new TypeError("Invalid patch version");i[4]?this.prerelease=i[4].split(".").map((function(e){if(/^[0-9]+$/.test(e)){var t=+e;if(t>=0&&t=0;)"number"==typeof this.prerelease[r]&&(this.prerelease[r]++,r=-2);-1===r&&this.prerelease.push(0)}t&&(this.prerelease[0]===t?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error("invalid increment argument: "+e)}return this.format(),this.raw=this.version,this},t.inc=function(e,t,r,n){"string"==typeof r&&(n=r,r=void 0);try{return new y(e,r).inc(t,n).version}catch(e){return null}},t.diff=function(e,t){if(O(e,t))return null;var r=g(e),n=g(t),o="";if(r.prerelease.length||n.prerelease.length){o="pre";var i="prerelease"}for(var s in r)if(("major"===s||"minor"===s||"patch"===s)&&r[s]!==n[s])return o+s;return i},t.compareIdentifiers=v;var b=/^[0-9]+$/;function v(e,t){var r=b.test(e),n=b.test(t);return r&&n&&(e=+e,t=+t),e===t?0:r&&!n?-1:n&&!r?1:e0}function S(e,t,r){return w(e,t,r)<0}function O(e,t,r){return 0===w(e,t,r)}function I(e,t,r){return 0!==w(e,t,r)}function T(e,t,r){return w(e,t,r)>=0}function j(e,t,r){return w(e,t,r)<=0}function x(e,t,r,n){switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e===r;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e!==r;case"":case"=":case"==":return O(e,r,n);case"!=":return I(e,r,n);case">":return E(e,r,n);case">=":return T(e,r,n);case"<":return S(e,r,n);case"<=":return j(e,r,n);default:throw new TypeError("Invalid operator: "+t)}}function R(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof R){if(e.loose===!!t.loose)return e;e=e.value}if(!(this instanceof R))return new R(e,t);e=e.trim().split(/\s+/).join(" "),r("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===A?this.value="":this.value=this.operator+this.semver.version,r("comp",this)}t.rcompareIdentifiers=function(e,t){return v(t,e)},t.major=function(e,t){return new y(e,t).major},t.minor=function(e,t){return new y(e,t).minor},t.patch=function(e,t){return new y(e,t).patch},t.compare=w,t.compareLoose=function(e,t){return w(e,t,!0)},t.compareBuild=function(e,t,r){var n=new y(e,r),o=new y(t,r);return n.compare(o)||n.compareBuild(o)},t.rcompare=function(e,t,r){return w(t,e,r)},t.sort=function(e,r){return e.sort((function(e,n){return t.compareBuild(e,n,r)}))},t.rsort=function(e,r){return e.sort((function(e,n){return t.compareBuild(n,e,r)}))},t.gt=E,t.lt=S,t.eq=O,t.neq=I,t.gte=T,t.lte=j,t.cmp=x,t.Comparator=R;var A={};function D(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof D)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new D(e.raw,t);if(e instanceof R)return new D(e.value,t);if(!(this instanceof D))return new D(e,t);if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map((function(e){return this.parseRange(e.trim())}),this).filter((function(e){return e.length})),!this.set.length)throw new TypeError("Invalid SemVer Range: "+this.raw);this.format()}function N(e,t){for(var r=!0,n=e.slice(),o=n.pop();r&&n.length;)r=n.every((function(e){return o.intersects(e,t)})),o=n.pop();return r}function L(e){return!e||"x"===e.toLowerCase()||"*"===e}function k(e,t,r,n,o,i,s,a,c,l,u,f,p){return((t=L(r)?"":L(n)?">="+r+".0.0":L(o)?">="+r+"."+n+".0":">="+t)+" "+(a=L(c)?"":L(l)?"<"+(+c+1)+".0.0":L(u)?"<"+c+"."+(+l+1)+".0":f?"<="+c+"."+l+"."+u+"-"+f:"<="+a)).trim()}function C(e,t,n){for(var o=0;o0){var i=e[o].semver;if(i.major===t.major&&i.minor===t.minor&&i.patch===t.patch)return!0}return!1}return!0}function P(e,t,r){try{t=new D(t,r)}catch(e){return!1}return t.test(e)}function M(e,t,r,n){var o,i,s,a,c;switch(e=new y(e,n),t=new D(t,n),r){case">":o=E,i=j,s=S,a=">",c=">=";break;case"<":o=S,i=T,s=E,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(P(e,t,n))return!1;for(var l=0;l=0.0.0")),f=f||e,p=p||e,o(e.semver,f.semver,n)?f=e:s(e.semver,p.semver,n)&&(p=e)})),f.operator===a||f.operator===c)return!1;if((!p.operator||p.operator===a)&&i(e,p.semver))return!1;if(p.operator===c&&s(e,p.semver))return!1}return!0}R.prototype.parse=function(e){var t=this.options.loose?a[l.COMPARATORLOOSE]:a[l.COMPARATOR],r=e.match(t);if(!r)throw new TypeError("Invalid comparator: "+e);this.operator=void 0!==r[1]?r[1]:"","="===this.operator&&(this.operator=""),r[2]?this.semver=new y(r[2],this.options.loose):this.semver=A},R.prototype.toString=function(){return this.value},R.prototype.test=function(e){if(r("Comparator.test",e,this.options.loose),this.semver===A||e===A)return!0;if("string"==typeof e)try{e=new y(e,this.options)}catch(e){return!1}return x(e,this.operator,this.semver,this.options)},R.prototype.intersects=function(e,t){if(!(e instanceof R))throw new TypeError("a Comparator is required");var r;if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),""===this.operator)return""===this.value||(r=new D(e.value,t),P(this.value,r,t));if(""===e.operator)return""===e.value||(r=new D(this.value,t),P(e.semver,r,t));var n=!(">="!==this.operator&&">"!==this.operator||">="!==e.operator&&">"!==e.operator),o=!("<="!==this.operator&&"<"!==this.operator||"<="!==e.operator&&"<"!==e.operator),i=this.semver.version===e.semver.version,s=!(">="!==this.operator&&"<="!==this.operator||">="!==e.operator&&"<="!==e.operator),a=x(this.semver,"<",e.semver,t)&&(">="===this.operator||">"===this.operator)&&("<="===e.operator||"<"===e.operator),c=x(this.semver,">",e.semver,t)&&("<="===this.operator||"<"===this.operator)&&(">="===e.operator||">"===e.operator);return n||o||i&&s||a||c},t.Range=D,D.prototype.format=function(){return this.range=this.set.map((function(e){return e.join(" ").trim()})).join("||").trim(),this.range},D.prototype.toString=function(){return this.range},D.prototype.parseRange=function(e){var t=this.options.loose,n=t?a[l.HYPHENRANGELOOSE]:a[l.HYPHENRANGE];e=e.replace(n,k),r("hyphen replace",e),e=e.replace(a[l.COMPARATORTRIM],"$1$2$3"),r("comparator trim",e,a[l.COMPARATORTRIM]),e=(e=(e=e.replace(a[l.TILDETRIM],"$1~")).replace(a[l.CARETTRIM],"$1^")).split(/\s+/).join(" ");var o=t?a[l.COMPARATORLOOSE]:a[l.COMPARATOR],i=e.split(" ").map((function(e){return function(e,t){return r("comp",e,t),e=function(e,t){return e.trim().split(/\s+/).map((function(e){return function(e,t){r("caret",e,t);var n=t.loose?a[l.CARETLOOSE]:a[l.CARET];return e.replace(n,(function(t,n,o,i,s){var a;return r("caret",e,t,n,o,i,s),L(n)?a="":L(o)?a=">="+n+".0.0 <"+(+n+1)+".0.0":L(i)?a="0"===n?">="+n+"."+o+".0 <"+n+"."+(+o+1)+".0":">="+n+"."+o+".0 <"+(+n+1)+".0.0":s?(r("replaceCaret pr",s),a="0"===n?"0"===o?">="+n+"."+o+"."+i+"-"+s+" <"+n+"."+o+"."+(+i+1):">="+n+"."+o+"."+i+"-"+s+" <"+n+"."+(+o+1)+".0":">="+n+"."+o+"."+i+"-"+s+" <"+(+n+1)+".0.0"):(r("no pr"),a="0"===n?"0"===o?">="+n+"."+o+"."+i+" <"+n+"."+o+"."+(+i+1):">="+n+"."+o+"."+i+" <"+n+"."+(+o+1)+".0":">="+n+"."+o+"."+i+" <"+(+n+1)+".0.0"),r("caret return",a),a}))}(e,t)})).join(" ")}(e,t),r("caret",e),e=function(e,t){return e.trim().split(/\s+/).map((function(e){return function(e,t){var n=t.loose?a[l.TILDELOOSE]:a[l.TILDE];return e.replace(n,(function(t,n,o,i,s){var a;return r("tilde",e,t,n,o,i,s),L(n)?a="":L(o)?a=">="+n+".0.0 <"+(+n+1)+".0.0":L(i)?a=">="+n+"."+o+".0 <"+n+"."+(+o+1)+".0":s?(r("replaceTilde pr",s),a=">="+n+"."+o+"."+i+"-"+s+" <"+n+"."+(+o+1)+".0"):a=">="+n+"."+o+"."+i+" <"+n+"."+(+o+1)+".0",r("tilde return",a),a}))}(e,t)})).join(" ")}(e,t),r("tildes",e),e=function(e,t){return r("replaceXRanges",e,t),e.split(/\s+/).map((function(e){return function(e,t){e=e.trim();var n=t.loose?a[l.XRANGELOOSE]:a[l.XRANGE];return e.replace(n,(function(n,o,i,s,a,c){r("xRange",e,n,o,i,s,a,c);var l=L(i),u=l||L(s),f=u||L(a),p=f;return"="===o&&p&&(o=""),c=t.includePrerelease?"-0":"",l?n=">"===o||"<"===o?"<0.0.0-0":"*":o&&p?(u&&(s=0),a=0,">"===o?(o=">=",u?(i=+i+1,s=0,a=0):(s=+s+1,a=0)):"<="===o&&(o="<",u?i=+i+1:s=+s+1),n=o+i+"."+s+"."+a+c):u?n=">="+i+".0.0"+c+" <"+(+i+1)+".0.0"+c:f&&(n=">="+i+"."+s+".0"+c+" <"+i+"."+(+s+1)+".0"+c),r("xRange return",n),n}))}(e,t)})).join(" ")}(e,t),r("xrange",e),e=function(e,t){return r("replaceStars",e,t),e.trim().replace(a[l.STAR],"")}(e,t),r("stars",e),e}(e,this.options)}),this).join(" ").split(/\s+/);return this.options.loose&&(i=i.filter((function(e){return!!e.match(o)}))),i=i.map((function(e){return new R(e,this.options)}),this)},D.prototype.intersects=function(e,t){if(!(e instanceof D))throw new TypeError("a Range is required");return this.set.some((function(r){return N(r,t)&&e.set.some((function(e){return N(e,t)&&r.every((function(r){return e.every((function(e){return r.intersects(e,t)}))}))}))}))},t.toComparators=function(e,t){return new D(e,t).set.map((function(e){return e.map((function(e){return e.value})).join(" ").trim().split(" ")}))},D.prototype.test=function(e){if(!e)return!1;if("string"==typeof e)try{e=new y(e,this.options)}catch(e){return!1}for(var t=0;t":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":r&&!E(r,t)||(r=t);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+e.operator)}}))}if(r&&e.test(r))return r;return null},t.validRange=function(e,t){try{return new D(e,t).range||"*"}catch(e){return null}},t.ltr=function(e,t,r){return M(e,t,"<",r)},t.gtr=function(e,t,r){return M(e,t,">",r)},t.outside=M,t.prerelease=function(e,t){var r=g(e,t);return r&&r.prerelease.length?r.prerelease:null},t.intersects=function(e,t,r){return e=new D(e,r),t=new D(t,r),e.intersects(t)},t.coerce=function(e,t){if(e instanceof y)return e;"number"==typeof e&&(e=String(e));if("string"!=typeof e)return null;var r=null;if((t=t||{}).rtl){for(var n;(n=a[l.COERCERTL].exec(e))&&(!r||r.index+r[0].length!==e.length);)r&&n.index+n[0].length===r.index+r[0].length||(r=n),a[l.COERCERTL].lastIndex=n.index+n[1].length+n[2].length;a[l.COERCERTL].lastIndex=-1}else r=e.match(a[l.COERCE]);if(null===r)return null;return g(r[2]+"."+(r[3]||"0")+"."+(r[4]||"0"),t)}}(0,_u.exports);var Fu=O(_u.exports);function Bu(e){if("object"!=typeof e||null===e)return!1;const t=Object.getPrototypeOf(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)}var $u=Sa,Uu=_e,Gu=Zt,Wu=es;Eo({target:"Iterator",proto:!0,real:!0},{find:function(e){Gu(this),Uu(e);var t=Wu(this),r=0;return $u(t,(function(t,n){if(e(t,r++))return n(t)}),{IS_RECORD:!0,INTERRUPTED:!0}).result}});var zu=Ys,Vu=String,qu=function(e){if("Symbol"===zu(e))throw new TypeError("Cannot convert a Symbol value to a string");return Vu(e)},Hu=TypeError,Xu=function(e,t){if(e{const r=Sf(e);if("string"!=typeof r)throw new TypeError(`${t} must be a string or a file URL: ${r}.`);return r},Sf=e=>e instanceof URL?a.fileURLToPath(e):e,Of=(e,t=[],r={})=>{const n=Ef(e,"First argument"),[o,i]=Bu(t)?[[],t]:[t,r];if(!Array.isArray(o))throw new TypeError(`Second argument must be either an array of arguments or an options object: ${o}`);if(o.some((e=>"object"==typeof e&&null!==e)))throw new TypeError(`Second argument must be an array of strings: ${o}`);const s=o.map(String),a=s.find((e=>e.includes("\0")));if(void 0!==a)throw new TypeError(`Arguments cannot contain null bytes ("\\0"): ${a}`);if(!Bu(i))throw new TypeError(`Last argument must be an options object: ${i}`);return[n,s,i]};var If=z,Tf=Set.prototype,jf={Set:Set,add:If(Tf.add),has:If(Tf.has),remove:If(Tf.delete),proto:Tf},xf=jf.has,Rf=function(e){return xf(e),e},Af=L,Df=function(e,t,r){for(var n,o,i=r?e:e.iterator,s=e.next;!(n=Af(s,i)).done;)if(void 0!==(o=t(n.value)))return o},Nf=z,Lf=Df,kf=jf.Set,Cf=jf.proto,Pf=Nf(Cf.forEach),Mf=Nf(Cf.keys),_f=Mf(new kf).next,Ff=function(e,t,r){return r?Lf({iterator:Mf(e),next:_f},t):Pf(e,t)},Bf=Ff,$f=jf.Set,Uf=jf.add,Gf=function(e){var t=new $f;return Bf(e,(function(e){Uf(t,e)})),t},Wf=z,zf=_e,Vf=function(e,t,r){try{return Wf(zf(Object.getOwnPropertyDescriptor(e,t)[r]))}catch(e){}},qf=Vf(jf.proto,"size","get")||function(e){return e.size},Hf=_e,Xf=Zt,Kf=L,Yf=In,Qf=es,Jf="Invalid size",Zf=RangeError,ep=TypeError,tp=Math.max,rp=function(e,t){this.set=e,this.size=tp(t,0),this.has=Hf(e.has),this.keys=Hf(e.keys)};rp.prototype={getIterator:function(){return Qf(Xf(Kf(this.keys,this.set)))},includes:function(e){return Kf(this.has,this.set,e)}};var np=function(e){Xf(e);var t=+e.size;if(t!=t)throw new ep(Jf);var r=Yf(t);if(r<0)throw new Zf(Jf);return new rp(e,r)},op=Rf,ip=Gf,sp=qf,ap=np,cp=Ff,lp=Df,up=jf.has,fp=jf.remove,pp=de,dp=function(e){return{size:e,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}},hp=function(e){var t=pp("Set");try{(new t)[e](dp(0));try{return(new t)[e](dp(-1)),!1}catch(e){return!0}}catch(e){return!1}},mp=function(e){var t=op(this),r=ap(e),n=ip(t);return sp(t)<=r.size?cp(t,(function(e){r.includes(e)&&fp(n,e)})):lp(r.getIterator(),(function(e){up(t,e)&&fp(n,e)})),n};Eo({target:"Set",proto:!0,real:!0,forced:!hp("difference")},{difference:mp});var gp=Rf,yp=qf,bp=np,vp=Ff,wp=Df,Ep=jf.Set,Sp=jf.add,Op=jf.has,Ip=x,Tp=function(e){var t=gp(this),r=bp(e),n=new Ep;return yp(t)>r.size?wp(r.getIterator(),(function(e){Op(t,e)&&Sp(n,e)})):vp(t,(function(e){r.includes(e)&&Sp(n,e)})),n};Eo({target:"Set",proto:!0,real:!0,forced:!hp("intersection")||Ip((function(){return"3,2"!==String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))}))},{intersection:Tp});var jp=Rf,xp=jf.has,Rp=qf,Ap=np,Dp=Ff,Np=Df,Lp=is,kp=function(e){var t=jp(this),r=Ap(e);if(Rp(t)<=r.size)return!1!==Dp(t,(function(e){if(r.includes(e))return!1}),!0);var n=r.getIterator();return!1!==Np(n,(function(e){if(xp(t,e))return Lp(n,"normal",!1)}))};Eo({target:"Set",proto:!0,real:!0,forced:!hp("isDisjointFrom")},{isDisjointFrom:kp});var Cp=Rf,Pp=qf,Mp=Ff,_p=np,Fp=function(e){var t=Cp(this),r=_p(e);return!(Pp(t)>r.size)&&!1!==Mp(t,(function(e){if(!r.includes(e))return!1}),!0)};Eo({target:"Set",proto:!0,real:!0,forced:!hp("isSubsetOf")},{isSubsetOf:Fp});var Bp=Rf,$p=jf.has,Up=qf,Gp=np,Wp=Df,zp=is,Vp=function(e){var t=Bp(this),r=Gp(e);if(Up(t)92||Nd&&Rd>94||Ad&&Rd>97)return!1;var e=new ArrayBuffer(8),t=Ld(e,{transfer:[e]});return 0!==e.byteLength||8!==t.byteLength})),Cd=T,Pd=function(e){try{if(Id)return Function('return require("'+e+'")')()}catch(e){}},Md=kd,_d=Cd.structuredClone,Fd=Cd.ArrayBuffer,Bd=Cd.MessageChannel,$d=!1;if(Md)$d=function(e){_d(e,{transfer:[e]})};else if(Fd)try{Bd||(gd=Pd("worker_threads"))&&(Bd=gd.MessageChannel),Bd&&(yd=new Bd,bd=new Fd(2),vd=function(e){yd.port1.postMessage(null,[e])},2===bd.byteLength&&(vd(bd),0===bd.byteLength&&($d=vd)))}catch(e){}var Ud=T,Gd=z,Wd=Vf,zd=function(e){if(void 0===e)return 0;var t=wd(e),r=Ed(t);if(t!==r)throw new Sd("Wrong length or index");return r},Vd=fd,qd=cd,Hd=$d,Xd=kd,Kd=Ud.structuredClone,Yd=Ud.ArrayBuffer,Qd=Ud.DataView,Jd=Ud.TypeError,Zd=Math.min,eh=Yd.prototype,th=Qd.prototype,rh=Gd(eh.slice),nh=Wd(eh,"resizable","get"),oh=Wd(eh,"maxByteLength","get"),ih=Gd(th.getInt8),sh=Gd(th.setInt8),ah=(Xd||Hd)&&function(e,t,r){var n,o=qd(e),i=void 0===t?o:zd(t),s=!nh||!nh(e);if(Vd(e))throw new Jd("ArrayBuffer is detached");if(Xd&&(e=Kd(e,{transfer:[e]}),o===i&&(r||s)))return e;if(o>=i&&(!r||s))n=rh(e,0,i);else{var a=r&&!s&&oh?{maxByteLength:oh(e)}:void 0;n=new Yd(i,a);for(var c=new Qd(e),l=new Qd(n),u=Zd(i,o),f=0;f2?r:lm(t),i=new e(o);o>n;)i[n]=t[n++];return i},pm=im.aTypedArray,dm=im.getTypedArrayConstructor,hm=im.exportTypedArrayMethod,mm=z(im.TypedArrayPrototype.sort);hm("toSorted",(function(e){void 0!==e&&um(e);var t=pm(this),r=fm(dm(t),t);return mm(r,e)}));var gm=Ln,ym=In,bm=RangeError,vm=Ys,wm=At,Em=TypeError,Sm=function(e,t,r,n){var o=gm(e),i=ym(r),s=i<0?o+i:i;if(s>=o||s<0)throw new bm("Incorrect index");for(var a=new t(o),c=0;c"[object Uint8Array]"===Dm.call(e),Lm=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),km=new TextEncoder,Cm=e=>km.encode(e),Pm=new TextDecoder,Mm=e=>Pm.decode(e),_m=(e,t)=>{if("utf8"===t&&e.every((e=>"string"==typeof e)))return e;const r=new l.StringDecoder(t),n=e.map((e=>"string"==typeof e?Cm(e):e)).map((e=>r.write(e))),o=r.end();return""===o?n:[...n,o]},Fm=e=>1===e.length&&Nm(e[0])?e[0]:$m(Bm(e)),Bm=e=>e.map((e=>"string"==typeof e?Cm(e):e)),$m=e=>{const t=new Uint8Array(Um(e));let r=0;for(const n of e)t.set(n,r),r+=n.length;return t},Um=e=>{let t=0;for(const r of e)t+=r.length;return t},Gm=({templates:e,expressions:t,tokens:r,index:n,template:o})=>{if(void 0===o)throw new TypeError(`Invalid backslash sequence: ${e.raw[n]}`);const{nextTokens:i,leadingWhitespaces:s,trailingWhitespaces:a}=Wm(o,e.raw[n]),c=qm(r,i,s);if(n===t.length)return c;const l=t[n],u=Array.isArray(l)?l.map((e=>Hm(e))):[Hm(l)];return qm(c,u,a)},Wm=(e,t)=>{if(0===t.length)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};const r=[];let n=0;const o=zm.has(t[0]);for(let o=0,i=0;or||0===e.length||0===t.length?[...e,...t]:[...e.slice(0,-1),`${e.at(-1)}${t[0]}`,...t.slice(1)],Hm=e=>{const t=typeof e;if("string"===t)return e;if("number"===t)return String(e);if(Bu(e)&&("stdout"in e||"isMaxBuffer"in e))return Xm(e);if(e instanceof c.ChildProcess||"[object Promise]"===Object.prototype.toString.call(e))throw new TypeError("Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}.");throw new TypeError(`Unexpected "${t}" in template expression`)},Xm=({stdout:e})=>{if("string"==typeof e)return e;if(Nm(e))return Mm(e);if(void 0===e)throw new TypeError('Missing result.stdout in template expression. This is probably due to the previous subprocess\' "stdout" option.');throw new TypeError(`Unexpected "${typeof e}" stdout in template expression`)};function Km(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;nQm.includes(e),Qm=[f.stdin,f.stdout,f.stderr],Jm=["stdin","stdout","stderr"],Zm=e=>Jm[e]??`stdio[${e}]`,eg=(e,t)=>{const r=Array.from({length:tg(e)+1}),n=rg(e[t],r,t);return lg(n,t)},tg=({stdio:e})=>Array.isArray(e)?Math.max(e.length,Jm.length):Jm.length,rg=(e,t,r)=>Bu(e)?ng(e,t,r):t.fill(e),ng=(e,t,r)=>{for(const n of Object.keys(e).sort(og))for(const o of sg(n,r,t))t[o]=e[n];return t},og=(e,t)=>ig(e)"stdout"===e||"stderr"===e?0:"all"===e?2:1,sg=(e,t,r)=>{if("ipc"===e)return[r.length-1];const n=ag(e);if(void 0===n||0===n)throw new TypeError(`"${t}.${e}" is invalid.\nIt must be "${t}.stdout", "${t}.stderr", "${t}.all", "${t}.ipc", or "${t}.fd3", "${t}.fd4" (and so on).`);if(n>=r.length)throw new TypeError(`"${t}.${e}" is invalid: that file descriptor does not exist.\nPlease set the "stdio" option to ensure that file descriptor exists.`);return"all"===n?[1,2]:[n]},ag=e=>{if("all"===e)return e;if(Jm.includes(e))return Jm.indexOf(e);const t=cg.exec(e);return null!==t?Number(t[1]):void 0},cg=/^fd(\d+)$/,lg=(e,t)=>e.map((e=>void 0===e?ug[t]:e)),ug={lines:!1,buffer:!0,maxBuffer:1e8,verbose:u.debuglog("execa").enabled?"full":"none",stripFinalNewline:!0},fg=["lines","buffer","maxBuffer","verbose","stripFinalNewline"],pg=(e,t)=>"ipc"===t?e.at(-1):e[t],dg=({verbose:e},t)=>"none"!==mg(e,t),hg=({verbose:e},t)=>!["none","short"].includes(mg(e,t)),mg=(e,t)=>void 0===t?gg(e):pg(e,t),gg=e=>e.find((e=>yg(e)))??bg.findLast((t=>e.includes(t))),yg=e=>"function"==typeof e,bg=["none","short","full"],vg=e=>u.stripVTControlCharacters(e).split("\n").map((e=>wg(e))).join("\n"),wg=e=>e.replaceAll(Sg,(e=>Eg(e))),Eg=e=>{const t=Og[e];if(void 0!==t)return t;const r=e.codePointAt(0),n=r.toString(16);return r<=Ig?`\\u${n.padStart(4,"0")}`:`\\U${n}`},Sg=/\p{Separator}|\p{Other}/gu,Og={" ":" ","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t"},Ig=65535,Tg=e=>jg.test(e)?e:"win32"===f.platform?`"${e.replaceAll('"','""')}"`:`'${e.replaceAll("'","'\\''")}'`,jg=/^[\w./-]+$/;const xg={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:"╱"},Rg={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:"⅒"},Ag=Object.assign(Object.assign({},xg),Rg),Dg=Object.assign(Object.assign({},xg),{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"}),Ng=("win32"!==f.platform?"linux"!==f.env.TERM:Boolean(f.env.WT_SESSION)||Boolean(f.env.TERMINUS_SUBLIME)||"{cmd::Cmder}"===f.env.ConEmuTask||"Terminus-Sublime"===f.env.TERM_PROGRAM||"vscode"===f.env.TERM_PROGRAM||"xterm-256color"===f.env.TERM||"alacritty"===f.env.TERM||"JetBrains-JediTerm"===f.env.TERMINAL_EMULATOR)?Ag:Dg;Object.entries(Rg);const Lg=d?.WriteStream?.prototype?.hasColors?.()??!1,kg=(e,t)=>{if(!Lg)return e=>e;const r=`[${e}m`,n=`[${t}m`;return e=>{const t=e+"";let o=t.indexOf(n);if(-1===o)return r+t+n;let i=r,s=0;for(;-1!==o;)i+=t.slice(s,o)+r,s=o+n.length,o=t.indexOf(n,s);return i+=t.slice(s)+n,i}},Cg=kg(1,22),Pg=kg(90,39),Mg=kg(91,39),_g=kg(93,39),Fg=e=>`${Bg(e.getHours(),2)}:${Bg(e.getMinutes(),2)}:${Bg(e.getSeconds(),2)}.${Bg(e.getMilliseconds(),3)}`,Bg=(e,t)=>String(e).padStart(t,"0"),$g=({failed:e,reject:t})=>e?t?Ng.cross:Ng.warning:Ng.tick,Ug={command:({piped:e})=>e?"|":"$",output:()=>" ",ipc:()=>"*",error:$g,duration:$g},Gg=e=>e,Wg={command:()=>Cg,output:()=>Gg,ipc:()=>Gg,error:({reject:e})=>e?Mg:_g,duration:()=>Pg},zg=(e,t,r)=>{const n=(({verbose:e},t)=>{const r=mg(e,t);return yg(r)?r:void 0})(t,r);return e.map((({verboseLine:e,verboseObject:t})=>Vg(e,t,n))).filter((e=>void 0!==e)).map((e=>qg(e))).join("")},Vg=(e,t,r)=>{if(void 0===r)return e;const n=r(e,t);return"string"==typeof n?n:void 0},qg=e=>e.endsWith("\n")?e:`${e}\n`,Hg=["piped"],Xg=({type:e,verboseMessage:t,fdNumber:r,verboseInfo:n,result:o})=>{const i=Kg({type:e,result:o,verboseInfo:n}),s=Yg(t,i),a=zg(s,n,r);p.writeFileSync(Jg,a)},Kg=e=>{let{type:t,result:r,verboseInfo:{escapedCommand:n,commandId:o,rawOptions:{piped:i=!1}}}=e,s=Km(e.verboseInfo.rawOptions,Hg);return{type:t,escapedCommand:n,commandId:`${o}`,timestamp:new Date,piped:i,result:r,options:s}},Yg=(e,t)=>e.split("\n").map((e=>Qg(Object.assign(Object.assign({},t),{},{message:e})))),Qg=e=>({verboseLine:(({type:e,message:t,timestamp:r,piped:n,commandId:o,result:{failed:i=!1}={},options:{reject:s=!0}})=>{const a=Fg(r),c=Ug[e]({failed:i,reject:s,piped:n}),l=Wg[e]({reject:s});return`${Pg(`[${a}]`)} ${Pg(`[${o}]`)} ${l(c)} ${l(t)}`})(e),verboseObject:e}),Jg=2,Zg=e=>{const t="string"==typeof e?e:u.inspect(e);return vg(t).replaceAll("\t"," ".repeat(ey))},ey=2,ty=e=>dg({verbose:e})?ry++:void 0;let ry=0n;const ny=e=>{for(const t of e){if(!1===t)throw new TypeError('The "verbose: false" option was renamed to "verbose: \'none\'".');if(!0===t)throw new TypeError('The "verbose: true" option was renamed to "verbose: \'short\'".');if(!bg.includes(t)&&!yg(t)){const e=bg.map((e=>`'${e}'`)).join(", ");throw new TypeError(`The "verbose" option must not be ${t}. Allowed values are: ${e} or a function.`)}}},oy=()=>f.hrtime.bigint(),iy=e=>Number(f.hrtime.bigint()-e)/1e6,sy=(e,t,r)=>{const n=oy(),{command:o,escapedCommand:i}=((e,t)=>{const r=[e,...t];return{command:r.join(" "),escapedCommand:r.map((e=>Tg(wg(e)))).join(" ")}})(e,t),s=((e,t,r)=>(ny(e),{verbose:e,escapedCommand:t,commandId:ty(e),rawOptions:r}))(eg(r,"verbose"),i,Object.assign({},r));return((e,t)=>{dg(t)&&Xg({type:"command",verboseMessage:e,verboseInfo:t})})(i,s),{command:o,escapedCommand:i,startTime:n,verboseInfo:s}};var ay,cy,ly,uy,fy,py={exports:{}};fy="win32"===process.platform||S.TESTING_WINDOWS?function(){if(cy)return ay;cy=1,ay=n,n.sync=function(t,n){return r(e.statSync(t),t,n)};var e=t;function r(e,t,r){return!(!e.isSymbolicLink()&&!e.isFile())&&function(e,t){var r=void 0!==t.pathExt?t.pathExt:process.env.PATHEXT;if(!r)return!0;if(-1!==(r=r.split(";")).indexOf(""))return!0;for(var n=0;nObject.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),wy=(e,t)=>{const r=t.colon||yy,n=e.match(/\//)||my&&e.match(/\\/)?[""]:[...my?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(r)],o=my?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",i=my?o.split(r):[""];return my&&-1!==e.indexOf(".")&&""!==i[0]&&i.unshift(""),{pathEnv:n,pathExt:i,pathExtExe:o}},Ey=(e,t,r)=>{"function"==typeof t&&(r=t,t={}),t||(t={});const{pathEnv:n,pathExt:o,pathExtExe:i}=wy(e,t),s=[],a=r=>new Promise(((o,i)=>{if(r===n.length)return t.all&&s.length?o(s):i(vy(e));const a=n[r],l=/^".*"$/.test(a)?a.slice(1,-1):a,u=gy.join(l,e),f=!l&&/^\.[\\\/]/.test(e)?e.slice(0,2)+u:u;o(c(f,r,0))})),c=(e,r,n)=>new Promise(((l,u)=>{if(n===o.length)return l(a(r+1));const f=o[n];by(e+f,{pathExt:i},((o,i)=>{if(!o&&i){if(!t.all)return l(e+f);s.push(e+f)}return l(c(e,r,n+1))}))}));return r?a(0).then((e=>r(null,e)),r):a(0)};var Sy=Ey;Ey.sync=(e,t)=>{t=t||{};const{pathEnv:r,pathExt:n,pathExtExe:o}=wy(e,t),i=[];for(let s=0;s{const t=e.env||process.env;return"win32"!==(e.platform||process.platform)?"PATH":Object.keys(t).reverse().find((e=>"PATH"===e.toUpperCase()))||"Path"};Oy.exports=Iy,Oy.exports.default=Iy;var Ty=Oy.exports;const jy=r,xy=Sy,Ry=Ty;function Ay(e,t){const r=e.options.env||process.env,n=process.cwd(),o=null!=e.options.cwd,i=o&&void 0!==process.chdir&&!process.chdir.disabled;if(i)try{process.chdir(e.options.cwd)}catch(e){}let s;try{s=xy.sync(e.command,{path:r[Ry({env:r})],pathExt:t?jy.delimiter:void 0})}catch(e){}finally{i&&process.chdir(n)}return s&&(s=jy.resolve(o?e.options.cwd:"",s)),s}var Dy=function(e){return Ay(e)||Ay(e,!0)},Ny={};const Ly=/([()\][%!^"`<>&|;, *?])/g;Ny.command=function(e){return e=e.replace(Ly,"^$1")},Ny.argument=function(e,t){return e=(e=`"${e=(e=(e=`${e}`).replace(/(\\*)"/g,'$1$1\\"')).replace(/(\\*)$/,"$1$1")}"`).replace(Ly,"^$1"),t&&(e=e.replace(Ly,"^$1")),e};const ky=/^#!(.*)/;const Cy=t,Py=(e="")=>{const t=e.match(ky);if(!t)return null;const[r,n]=t[0].replace(/#! ?/,"").split(" "),o=r.split("/").pop();return"env"===o?n:n?`${o} ${n}`:o};var My=function(e){const t=Buffer.alloc(150);let r;try{r=Cy.openSync(e,"r"),Cy.readSync(r,t,0,150,0),Cy.closeSync(r)}catch(e){}return Py(t.toString())};const _y=r,Fy=Dy,By=Ny,$y=My,Uy="win32"===process.platform,Gy=/\.(?:com|exe)$/i,Wy=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function zy(e){if(!Uy)return e;const t=function(e){e.file=Fy(e);const t=e.file&&$y(e.file);return t?(e.args.unshift(e.file),e.command=t,Fy(e)):e.file}(e),r=!Gy.test(t);if(e.options.forceShell||r){const r=Wy.test(t);e.command=_y.normalize(e.command),e.command=By.command(e.command),e.args=e.args.map((e=>By.argument(e,r)));const n=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${n}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}var Vy=function(e,t,r){t&&!Array.isArray(t)&&(r=t,t=null);const n={command:e,args:t=t?t.slice(0):[],options:r=Object.assign({},r),file:void 0,original:{command:e,args:t}};return r.shell?n:zy(n)};const qy="win32"===process.platform;function Hy(e,t){return Object.assign(new Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function Xy(e,t){return qy&&1===e&&!t.file?Hy(t.original,"spawn"):null}var Ky={hookChildProcess:function(e,t){if(!qy)return;const r=e.emit;e.emit=function(n,o){if("exit"===n){const n=Xy(o,t);if(n)return r.call(e,"error",n)}return r.apply(e,arguments)}},verifyENOENT:Xy,verifyENOENTSync:function(e,t){return qy&&1===e&&!t.file?Hy(t.original,"spawnSync"):null},notFoundError:Hy};const Yy=s,Qy=Vy,Jy=Ky;function Zy(e,t,r){const n=Qy(e,t,r),o=Yy.spawn(n.command,n.args,n.options);return Jy.hookChildProcess(o,n),o}py.exports=Zy,py.exports.spawn=Zy,py.exports.sync=function(e,t,r){const n=Qy(e,t,r),o=Yy.spawnSync(n.command,n.args,n.options);return o.error=o.error||Jy.verifyENOENTSync(o.status,n),o},py.exports._parse=Qy,py.exports._enoent=Jy;var eb=O(py.exports);function tb(e={}){const{env:t=process.env,platform:r=process.platform}=e;return"win32"!==r?"PATH":Object.keys(t).reverse().find((e=>"PATH"===e.toUpperCase()))||"Path"}const rb=["env"],nb=(e,t)=>{let r;for(;r!==t;)e.push(h.join(t,"node_modules/.bin")),r=t,t=h.resolve(t,"..")},ob=(e,t,r)=>{const n=t instanceof URL?a.fileURLToPath(t):t;e.push(h.resolve(r,n,".."))},ib=(e={})=>{let{env:t=f.env}=e,r=Km(e,rb);t=Object.assign({},t);const n=tb({env:t});return r.path=t[n],t[n]=(({cwd:e=f.cwd(),path:t=f.env[tb()],preferLocal:r=!0,execPath:n=f.execPath,addExecPath:o=!0}={})=>{const i=e instanceof URL?a.fileURLToPath(e):e,s=h.resolve(i),c=[];return r&&nb(c,s),o&&ob(c,n,s),[...c,t].join(h.delimiter)})(r),t};class sb extends Error{}const ab=(e,t)=>{Object.defineProperty(e.prototype,"name",{value:t,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,cb,{value:!0,writable:!1,enumerable:!1,configurable:!1})},cb=Symbol("isExecaError"),lb=e=>"[object Error]"===Object.prototype.toString.call(e);class ub extends Error{}ab(ub,ub.name);class fb extends Error{}ab(fb,fb.name);const pb=(e,t)=>({name:`SIGRT${t+1}`,number:db+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),db=34,hb=64,mb=[{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"}],gb=()=>{const e=(()=>{const e=hb-db+1;return Array.from({length:e},pb)})();return[...mb,...e].map(yb)},yb=({name:e,number:t,description:r,action:n,forced:o=!1,standard:i})=>{const{signals:{[e]:s}}=g.constants,a=void 0!==s;return{name:e,number:a?s:t,description:r,supported:a,action:n,forced:o,standard:i}},bb=({name:e,number:t,description:r,supported:n,action:o,forced:i,standard:s})=>[e,{name:e,number:t,description:r,supported:n,action:o,forced:i,standard:s}],vb=(()=>{const e=gb();return Object.fromEntries(e.map(bb))})(),wb=(e,t)=>{const r=Eb(e,t);if(void 0===r)return{};const{name:n,description:o,supported:i,action:s,forced:a,standard:c}=r;return{[e]:{name:n,number:e,description:o,supported:i,action:s,forced:a,standard:c}}},Eb=(e,t)=>{const r=t.find((({name:t})=>g.constants.signals[t]===e));return void 0!==r?r:t.find((t=>t.number===e))};(()=>{const e=gb(),t=hb+1,r=Array.from({length:t},((t,r)=>wb(r,e)));Object.assign({},...r)})();const Sb=e=>0===e?e:Ob(e,"`subprocess.kill()`'s argument"),Ob=(e,t)=>{if(Number.isInteger(e))return Ib(e,t);if("string"==typeof e)return jb(e,t);throw new TypeError(`Invalid ${t} ${String(e)}: it must be a string or an integer.\n${xb()}`)},Ib=(e,t)=>{if(Tb.has(e))return Tb.get(e);throw new TypeError(`Invalid ${t} ${e}: this signal integer does not exist.\n${xb()}`)},Tb=new Map(Object.entries(g.constants.signals).reverse().map((([e,t])=>[t,e]))),jb=(e,t)=>{if(e in g.constants.signals)return e;if(e.toUpperCase()in g.constants.signals)throw new TypeError(`Invalid ${t} '${e}': please rename it to '${e.toUpperCase()}'.`);throw new TypeError(`Invalid ${t} '${e}': this signal name does not exist.\n${xb()}`)},xb=()=>`Available signal names: ${Rb()}.\nAvailable signal numbers: ${Ab()}.`,Rb=()=>Object.keys(g.constants.signals).sort().map((e=>`'${e}'`)).join(", "),Ab=()=>[...new Set(Object.values(g.constants.signals).sort(((e,t)=>e-t)))].join(", "),Db=e=>vb[e].description,Nb=5e3,Lb=({kill:e,options:{forceKillAfterDelay:t,killSignal:r},onInternalError:n,context:o,controller:i},s,a)=>{const{signal:c,error:l}=kb(s,a,r);Cb(l,n);const u=e(c);return Pb({kill:e,signal:c,forceKillAfterDelay:t,killSignal:r,killResult:u,context:o,controller:i}),u},kb=(e,t,r)=>{const[n=r,o]=lb(e)?[void 0,e]:[e,t];if("string"!=typeof n&&!Number.isInteger(n))throw new TypeError(`The first argument must be an error instance or a signal name string/integer: ${String(n)}`);if(void 0!==o&&!lb(o))throw new TypeError(`The second argument is optional. If specified, it must be an error instance: ${o}`);return{signal:Sb(n),error:o}},Cb=(e,t)=>{void 0!==e&&t.reject(e)},Pb=async({kill:e,signal:t,forceKillAfterDelay:r,killSignal:n,killResult:o,context:i,controller:s})=>{t===n&&o&&Mb({kill:e,forceKillAfterDelay:r,context:i,controllerSignal:s.signal})},Mb=async({kill:e,forceKillAfterDelay:t,context:r,controllerSignal:n})=>{if(!1!==t)try{await m.setTimeout(t,void 0,{signal:n}),e("SIGKILL")&&(r.isForcefullyTerminated??=!0)}catch{}},_b=async(e,t)=>{e.aborted||await y.once(e,"abort",{signal:t})},Fb=({subprocess:e,cancelSignal:t,gracefulCancel:r,context:n,controller:o})=>void 0===t||r?[]:[Bb(e,t,n,o)],Bb=async(e,t,r,{signal:n})=>{throw await _b(t,n),r.terminationReason??="cancel",e.kill(),t.reason},$b=({methodName:e,isSubprocess:t,ipc:r,isConnected:n})=>{Ub(e,t,r),Gb(e,t,n)},Ub=(e,t,r)=>{if(!r)throw new Error(`${Hb(e,t)} can only be used if the \`ipc\` option is \`true\`.`)},Gb=(e,t,r)=>{if(!r)throw new Error(`${Hb(e,t)} cannot be used: the ${Kb(t)} has already exited or disconnected.`)},Wb=(e,t)=>new Error(`${Hb("sendMessage",t)} failed when sending an acknowledgment response to the ${Kb(t)}.`,{cause:e}),zb=({code:e,message:t})=>Vb.has(e)||qb.some((e=>t.includes(e))),Vb=new Set(["ERR_MISSING_ARGS","ERR_INVALID_ARG_TYPE"]),qb=["could not be cloned","circular structure","call stack size exceeded"],Hb=(e,t,r="")=>"cancelSignal"===e?"`cancelSignal`'s `controller.abort()`":`${Xb(t)}${e}(${r})`,Xb=e=>e?"":"subprocess.",Kb=e=>e?"parent process":"subprocess",Yb=e=>{e.connected&&e.disconnect()},Qb=()=>{const e={},t=new Promise(((t,r)=>{Object.assign(e,{resolve:t,reject:r})}));return Object.assign(t,e)},Jb=(e,t="stdin")=>{const{options:r,fileDescriptors:n}=ev.get(e),o=tv(n,t,true),i=e.stdio[o];if(null===i)throw new TypeError(ov(o,t,r,true));return i},Zb=(e,t="stdout")=>{const{options:r,fileDescriptors:n}=ev.get(e),o=tv(n,t,false),i="all"===o?e.all:e.stdio[o];if(null==i)throw new TypeError(ov(o,t,r,false));return i},ev=new WeakMap,tv=(e,t,r)=>{const n=rv(t,r);return nv(n,t,r,e),n},rv=(e,t)=>{const r=ag(e);if(void 0!==r)return r;const{validOptions:n,defaultValue:o}=t?{validOptions:'"stdin"',defaultValue:"stdin"}:{validOptions:'"stdout", "stderr", "all"',defaultValue:"stdout"};throw new TypeError(`"${av(t)}" must not be "${e}".\nIt must be ${n} or "fd3", "fd4" (and so on).\nIt is optional and defaults to "${o}".`)},nv=(e,t,r,n)=>{const o=n[sv(e)];if(void 0===o)throw new TypeError(`"${av(r)}" must not be ${t}. That file descriptor does not exist.\nPlease set the "stdio" option to ensure that file descriptor exists.`);if("input"===o.direction&&!r)throw new TypeError(`"${av(r)}" must not be ${t}. It must be a readable stream, not writable.`);if("input"!==o.direction&&r)throw new TypeError(`"${av(r)}" must not be ${t}. It must be a writable stream, not readable.`)},ov=(e,t,r,n)=>{if("all"===e&&!r.all)return'The "all" option must be true to use "from: \'all\'".';const{optionName:o,optionValue:i}=iv(e,r);return`The "${o}: ${cv(i)}" option is incompatible with using "${av(n)}: ${cv(t)}".\nPlease set this option with "pipe" instead.`},iv=(e,{stdin:t,stdout:r,stderr:n,stdio:o})=>{const i=sv(e);return 0===i&&void 0!==t?{optionName:"stdin",optionValue:t}:1===i&&void 0!==r?{optionName:"stdout",optionValue:r}:2===i&&void 0!==n?{optionName:"stderr",optionValue:n}:{optionName:`stdio[${i}]`,optionValue:o[i]}},sv=e=>"all"===e?1:e,av=e=>e?"to":"from",cv=e=>"string"==typeof e?`'${e}'`:"number"==typeof e?`${e}`:"Stream",lv=(e,t,r)=>{const n=e.getMaxListeners();0!==n&&n!==Number.POSITIVE_INFINITY&&(e.setMaxListeners(n+t),y.addAbortListener(r,(()=>{e.setMaxListeners(e.getMaxListeners()-t)})))},uv=(e,t)=>{t&&fv(e)},fv=e=>{e.refCounted()},pv=(e,t)=>{t&&dv(e)},dv=e=>{e.unrefCounted()},hv=async({anyProcess:e,channel:t,isSubprocess:r,ipcEmitter:n},o)=>{if(Iv(o)||Gv(o))return;gv.has(e)||gv.set(e,[]);const i=gv.get(e);if(i.push(o),!(i.length>1))for(;i.length>0;){await Dv(e,n,o),await m.scheduler.yield();const s=await Ov({wrappedMessage:i[0],anyProcess:e,channel:t,isSubprocess:r,ipcEmitter:n});i.shift(),n.emit("message",s),n.emit("message:done")}},mv=async({anyProcess:e,channel:t,isSubprocess:r,ipcEmitter:n,boundOnMessage:o})=>{zv();const i=gv.get(e);for(;i?.length>0;)await y.once(n,"message:done");e.removeListener("message",o),((e,t)=>{t&&(fv(e),fv(e))})(t,r),n.connected=!1,n.emit("disconnect")},gv=new WeakMap,yv=(e,t,r)=>{if(bv.has(e))return bv.get(e);const n=new y.EventEmitter;return n.connected=!0,bv.set(e,n),vv({ipcEmitter:n,anyProcess:e,channel:t,isSubprocess:r}),n},bv=new WeakMap,vv=({ipcEmitter:e,anyProcess:t,channel:r,isSubprocess:n})=>{const o=hv.bind(void 0,{anyProcess:t,channel:r,isSubprocess:n,ipcEmitter:e});t.on("message",o),t.once("disconnect",mv.bind(void 0,{anyProcess:t,channel:r,isSubprocess:n,ipcEmitter:e,boundOnMessage:o})),((e,t)=>{t&&(dv(e),dv(e))})(r,n)},wv=e=>{const t=bv.get(e);return void 0===t?null!==e.channel:t.connected};let Ev=0n;const Sv=(e,t)=>{if(t?.type===Rv&&!t.hasListeners)for(const{id:t}of e)void 0!==t&&jv[t].resolve({isDeadlock:!0,hasListeners:!1})},Ov=async({wrappedMessage:e,anyProcess:t,channel:r,isSubprocess:n,ipcEmitter:o})=>{if(e?.type!==Rv||!t.connected)return e;const{id:i,message:s}=e,a={id:i,type:Av,message:Lv(t,o)};try{await Cv({anyProcess:t,channel:r,isSubprocess:n,ipc:!0},a)}catch(e){o.emit("strict:error",e)}return s},Iv=e=>{if(e?.type!==Av)return!1;const{id:t,message:r}=e;return jv[t]?.resolve({isDeadlock:!1,hasListeners:r}),!0},Tv=async(e,t,r)=>{if(e?.type!==Rv)return;const n=Qb();jv[e.id]=n;const o=new AbortController;try{const{isDeadlock:e,hasListeners:i}=await Promise.race([n,xv(t,r,o)]);e&&(e=>{throw new Error(`${Hb("sendMessage",e)} failed: the ${Kb(e)} is sending a message too, instead of listening to incoming messages.\nThis can be fixed by both sending a message and listening to incoming messages at the same time:\n\nconst [receivedMessage] = await Promise.all([\n\t${Hb("getOneMessage",e)},\n\t${Hb("sendMessage",e,"message, {strict: true}")},\n]);`)})(r),i||(e=>{throw new Error(`${Hb("sendMessage",e)} failed: the ${Kb(e)} is not listening to incoming messages.`)})(r)}finally{o.abort(),delete jv[e.id]}},jv={},xv=async(e,t,{signal:r})=>{lv(e,1,r),await y.once(e,"disconnect",{signal:r}),(e=>{throw new Error(`${Hb("sendMessage",e)} failed: the ${Kb(e)} exited without listening to incoming messages.`)})(t)},Rv="execa:ipc:request",Av="execa:ipc:response",Dv=async(e,t,r)=>{for(;!Lv(e,t)&&Nv.get(e)?.size>0;){const t=[...Nv.get(e)];Sv(t,r),await Promise.all(t.map((({onMessageSent:e})=>e)))}},Nv=new WeakMap,Lv=(e,t)=>t.listenerCount("message")>kv(e),kv=e=>ev.has(e)&&!pg(ev.get(e).options.buffer,"ipc")?1:0,Cv=({anyProcess:e,channel:t,isSubprocess:r,ipc:n},o,{strict:i=!1}={})=>{const s="sendMessage";return $b({methodName:s,isSubprocess:r,ipc:n,isConnected:e.connected}),Pv({anyProcess:e,channel:t,methodName:s,isSubprocess:r,message:o,strict:i})},Pv=async({anyProcess:e,channel:t,methodName:r,isSubprocess:n,message:o,strict:i})=>{const s=(({anyProcess:e,channel:t,isSubprocess:r,message:n,strict:o})=>{if(!o)return n;const i=yv(e,t,r),s=Lv(e,i);return{id:Ev++,type:Rv,message:n,hasListeners:s}})({anyProcess:e,channel:t,isSubprocess:n,message:o,strict:i}),a=((e,t,r)=>{Nv.has(e)||Nv.set(e,new Set);const n=Nv.get(e),o={onMessageSent:Qb(),id:r?t.id:void 0};return n.add(o),{outgoingMessages:n,outgoingMessage:o}})(e,s,i);try{await Mv({anyProcess:e,methodName:r,isSubprocess:n,wrappedMessage:s,message:o})}catch(t){throw Yb(e),t}finally{(({outgoingMessages:e,outgoingMessage:t})=>{e.delete(t),t.onMessageSent.resolve()})(a)}},Mv=async({anyProcess:e,methodName:t,isSubprocess:r,wrappedMessage:n,message:o})=>{const i=_v(e);try{await Promise.all([Tv(n,e,r),i(n)])}catch(e){throw(({error:e,methodName:t,isSubprocess:r})=>{if("EPIPE"===e.code)throw new Error(`${Hb(t,r)} cannot be used: the ${Kb(r)} is disconnecting.`,{cause:e})})({error:e,methodName:t,isSubprocess:r}),(({error:e,methodName:t,isSubprocess:r,message:n})=>{if(zb(e))throw new Error(`${Hb(t,r)}'s argument type is invalid: the message cannot be serialized: ${String(n)}.`,{cause:e})})({error:e,methodName:t,isSubprocess:r,message:o}),e}},_v=e=>{if(Fv.has(e))return Fv.get(e);const t=u.promisify(e.send.bind(e));return Fv.set(e,t),t},Fv=new WeakMap,Bv=async({anyProcess:e,channel:t,isSubprocess:r,ipc:n})=>(await $v({anyProcess:e,channel:t,isSubprocess:r,ipc:n}),Vv.signal),$v=async({anyProcess:e,channel:t,isSubprocess:r,ipc:n})=>{Uv||(Uv=!0,n?null!==t?(yv(e,t,r),await m.scheduler.yield()):zv():(()=>{throw new Error("`getCancelSignal()` cannot be used without setting the `cancelSignal` subprocess option.")})())};let Uv=!1;const Gv=e=>e?.type===Wv&&(Vv.abort(e.message),!0),Wv="execa:ipc:cancel",zv=()=>{Vv.abort(new Error(`\`cancelSignal\` aborted: the ${Kb(!0)} disconnected.`))},Vv=new AbortController,qv=({subprocess:e,cancelSignal:t,gracefulCancel:r,forceKillAfterDelay:n,context:o,controller:i})=>r?[Hv({subprocess:e,cancelSignal:t,forceKillAfterDelay:n,context:o,controller:i})]:[],Hv=async({subprocess:e,cancelSignal:t,forceKillAfterDelay:r,context:n,controller:{signal:o}})=>{await _b(t,o);const i=Xv(t);throw await((e,t)=>{const r="cancelSignal";return Gb(r,!1,e.connected),Mv({anyProcess:e,methodName:r,isSubprocess:!1,wrappedMessage:{type:Wv,message:t},message:t})})(e,i),Mb({kill:e.kill,forceKillAfterDelay:r,context:n,controllerSignal:o}),n.terminationReason??="gracefulCancel",t.reason},Xv=({reason:e})=>{if(!(e instanceof DOMException))return e;const t=new Error(e.message);return Object.defineProperty(t,"stack",{value:e.stack,enumerable:!1,configurable:!0,writable:!0}),t},Kv=(e,t,r,n)=>0===t||void 0===t?[]:[Yv(e,t,r,n)],Yv=async(e,t,r,{signal:n})=>{throw await m.setTimeout(t,void 0,{signal:n}),r.terminationReason??="timeout",e.kill(),new sb},Qv=["node","nodePath","nodeOptions","cwd","execPath"],Jv={advanced:e=>{try{b.serialize(e)}catch(e){throw new Error("The `ipcInput` option is not serializable with a structured clone.",{cause:e})}},json:e=>{try{JSON.stringify(e)}catch(e){throw new Error("The `ipcInput` option is not serializable with JSON.",{cause:e})}}},Zv=async(e,t)=>{void 0!==t&&await e.sendMessage(t)},ew=new Set(["utf8","utf16le"]),tw=new Set(["buffer","hex","base64","base64url","latin1","ascii"]),rw=new Set([...ew,...tw]),nw=e=>{if(null===e)return"buffer";if("string"!=typeof e)return;const t=e.toLowerCase();return t in ow?ow[t]:rw.has(t)?t:void 0},ow={"utf-8":"utf8","utf-16le":"utf16le","ucs-2":"utf16le",ucs2:"utf16le",binary:"latin1"},iw=e=>"string"==typeof e?`"${e}"`:String(e),sw=()=>{try{return f.cwd()}catch(e){throw e.message=`The current directory does not exist.\n${e.message}`,e}},aw=["extendEnv","preferLocal","cwd","localDir","encoding","reject","cleanup","all","windowsHide","killSignal","forceKillAfterDelay","gracefulCancel","ipcInput","ipc","serialization"],cw=(e,t,r)=>{r.cwd=((e=sw())=>{const t=Ef(e,'The "cwd" option');return h.resolve(t)})(r.cwd);const[n,o,i]=((e,t,r)=>{let{node:n=!1,nodePath:o=f.execPath,nodeOptions:i=f.execArgv.filter((e=>!e.startsWith("--inspect"))),cwd:s,execPath:a}=r,c=Km(r,Qv);if(void 0!==a)throw new TypeError('The "execPath" option has been removed. Please use the "nodePath" option instead.');const l=Ef(o,'The "nodePath" option'),u=h.resolve(s,l),p=Object.assign(Object.assign({},c),{},{nodePath:u,node:n,cwd:s});if(!n)return[e,t,p];if("node"===h.basename(e,".exe"))throw new TypeError('When the "node" option is true, the first argument does not need to be "node".');return[u,[...i,e,...t],Object.assign(Object.assign({ipc:!0},p),{},{shell:!1})]})(e,t,r),{command:s,args:a,options:c}=eb._parse(n,o,i),l=(e=>{const t=Object.assign({},e);for(const r of fg)t[r]=eg(e,r);return t})(c),u=lw(l);return(({timeout:e})=>{if(void 0!==e&&(!Number.isFinite(e)||e<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`)})(u),(({encoding:e})=>{if(rw.has(e))return;const t=nw(e);if(void 0!==t)throw new TypeError(`Invalid option \`encoding: ${iw(e)}\`.\nPlease rename it to ${iw(t)}.`);const r=[...rw].map((e=>iw(e))).join(", ");throw new TypeError(`Invalid option \`encoding: ${iw(e)}\`.\nPlease rename it to one of: ${r}.`)})(u),(({ipcInput:e,ipc:t,serialization:r})=>{if(void 0!==e){if(!t)throw new Error("The `ipcInput` option cannot be set unless the `ipc` option is `true`.");Jv[r](e)}})(u),(({cancelSignal:e})=>{if(void 0!==e&&"[object AbortSignal]"!==Object.prototype.toString.call(e))throw new Error(`The \`cancelSignal\` option must be an AbortSignal: ${String(e)}`)})(u),(({gracefulCancel:e,cancelSignal:t,ipc:r,serialization:n})=>{if(e){if(void 0===t)throw new Error("The `cancelSignal` option must be defined when setting the `gracefulCancel` option.");if(!r)throw new Error("The `ipc` option cannot be false when setting the `gracefulCancel` option.");if("json"===n)throw new Error("The `serialization` option cannot be 'json' when setting the `gracefulCancel` option.")}})(u),u.shell=Sf(u.shell),u.env=uw(u),u.killSignal=(e=>{const t="option `killSignal`";if(0===e)throw new TypeError(`Invalid ${t}: 0 cannot be used.`);return Ob(e,t)})(u.killSignal),u.forceKillAfterDelay=(e=>{if(!1===e)return e;if(!0===e)return Nb;if(!Number.isFinite(e)||e<0)throw new TypeError(`Expected the \`forceKillAfterDelay\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);return e})(u.forceKillAfterDelay),u.lines=u.lines.map(((e,t)=>e&&!tw.has(u.encoding)&&u.buffer[t])),"win32"===f.platform&&"cmd"===h.basename(s,".exe")&&a.unshift("/q"),{file:s,commandArguments:a,options:u}},lw=e=>{let{extendEnv:t=!0,preferLocal:r=!1,cwd:n,localDir:o=n,encoding:i="utf8",reject:s=!0,cleanup:a=!0,all:c=!1,windowsHide:l=!0,killSignal:u="SIGTERM",forceKillAfterDelay:f=!0,gracefulCancel:p=!1,ipcInput:d,ipc:h=void 0!==d||p,serialization:m="advanced"}=e,g=Km(e,aw);return Object.assign(Object.assign({},g),{},{extendEnv:t,preferLocal:r,cwd:n,localDirectory:o,encoding:i,reject:s,cleanup:a,all:c,windowsHide:l,killSignal:u,forceKillAfterDelay:f,gracefulCancel:p,ipcInput:d,ipc:h,serialization:m})},uw=({env:e,extendEnv:t,preferLocal:r,node:n,localDirectory:o,nodePath:i})=>{const s=t?Object.assign(Object.assign({},f.env),e):e;return r||n?ib({env:s,cwd:o,execPath:i,preferLocal:r,addExecPath:n}):s};function fw(e){if("string"==typeof e)return pw(e);if(!ArrayBuffer.isView(e)||1!==e.BYTES_PER_ELEMENT)throw new Error("Input must be a string or a Uint8Array");return dw(e)}const pw=e=>e.at(-1)===hw?e.slice(0,e.at(-2)===gw?-2:-1):e,dw=e=>e.at(-1)===mw?e.subarray(0,e.at(-2)===yw?-2:-1):e,hw="\n",mw=hw.codePointAt(0),gw="\r",yw=gw.codePointAt(0);function bw(e,{checkOpen:t=!0}={}){return null!==e&&"object"==typeof e&&(e.writable||e.readable||!t||void 0===e.writable&&void 0===e.readable)&&"function"==typeof e.pipe}function vw(e,{checkOpen:t=!0}={}){return bw(e,{checkOpen:t})&&(e.writable||!t)&&"function"==typeof e.write&&"function"==typeof e.end&&"boolean"==typeof e.writable&&"boolean"==typeof e.writableObjectMode&&"function"==typeof e.destroy&&"boolean"==typeof e.destroyed}function ww(e,{checkOpen:t=!0}={}){return bw(e,{checkOpen:t})&&(e.readable||!t)&&"function"==typeof e.read&&"boolean"==typeof e.readable&&"boolean"==typeof e.readableObjectMode&&"function"==typeof e.destroy&&"boolean"==typeof e.destroyed}function Ew(e,t){return vw(e,t)&&ww(e,t)}const Sw=Object.getPrototypeOf(Object.getPrototypeOf((async function*(){})).prototype);class Ow{#e;#t;#r=!1;#n=void 0;constructor(e,t){this.#e=e,this.#t=t}next(){const e=()=>this.#o();return this.#n=this.#n?this.#n.then(e,e):e(),this.#n}return(e){const t=()=>this.#i(e);return this.#n?this.#n.then(t,t):t()}async#o(){if(this.#r)return{done:!0,value:void 0};let e;try{e=await this.#e.read()}catch(e){throw this.#n=void 0,this.#r=!0,this.#e.releaseLock(),e}return e.done&&(this.#n=void 0,this.#r=!0,this.#e.releaseLock()),e}async#i(e){if(this.#r)return{done:!0,value:e};if(this.#r=!0,!this.#t){const t=this.#e.cancel(e);return this.#e.releaseLock(),await t,{done:!0,value:e}}return this.#e.releaseLock(),{done:!0,value:e}}}const Iw=Symbol();function Tw(){return this[Iw].next()}function jw(e){return this[Iw].return(e)}Object.defineProperty(Tw,"name",{value:"next"}),Object.defineProperty(jw,"name",{value:"return"});const xw=Object.create(Sw,{next:{enumerable:!0,configurable:!0,writable:!0,value:Tw},return:{enumerable:!0,configurable:!0,writable:!0,value:jw}});function Rw({preventCancel:e=!1}={}){const t=this.getReader(),r=new Ow(t,e),n=Object.create(xw);return n[Iw]=r,n}const Aw=e=>{if(ww(e,{checkOpen:!1})&&void 0!==kw.on)return Nw(e);if("function"==typeof e?.[Symbol.asyncIterator])return e;if("[object ReadableStream]"===Dw.call(e))return Rw.call(e);throw new TypeError("The first argument must be a Readable, a ReadableStream, or an async iterable.")},{toString:Dw}=Object.prototype,Nw=async function*(e){const t=new AbortController,r={};Lw(e,t,r);try{for await(const[r]of kw.on(e,"data",{signal:t.signal}))yield r}catch(e){if(void 0!==r.error)throw r.error;if(!t.signal.aborted)throw e}finally{e.destroy()}},Lw=async(e,t,r)=>{try{await kw.finished(e,{cleanup:!0,readable:!0,writable:!1,error:!1})}catch(e){r.error=e}finally{t.abort()}},kw={},Cw=async(e,{init:t,convertChunk:r,getSize:n,truncateChunk:o,addChunk:i,getFinalChunk:s,finalize:a},{maxBuffer:c=Number.POSITIVE_INFINITY}={})=>{const l=Aw(e),u=t();u.length=0;try{for await(const e of l){const t=r[Fw(e)](e,u);Mw({convertedChunk:t,state:u,getSize:n,truncateChunk:o,addChunk:i,maxBuffer:c})}return Pw({state:u,convertChunk:r,getSize:n,truncateChunk:o,addChunk:i,getFinalChunk:s,maxBuffer:c}),a(u)}catch(e){const t="object"==typeof e&&null!==e?e:new Error(e);throw t.bufferedData=a(u),t}},Pw=({state:e,getSize:t,truncateChunk:r,addChunk:n,getFinalChunk:o,maxBuffer:i})=>{const s=o(e);void 0!==s&&Mw({convertedChunk:s,state:e,getSize:t,truncateChunk:r,addChunk:n,maxBuffer:i})},Mw=({convertedChunk:e,state:t,getSize:r,truncateChunk:n,addChunk:o,maxBuffer:i})=>{const s=r(e),a=t.length+s;if(a<=i)return void _w(e,t,o,a);const c=n(e,i-t.length);throw void 0!==c&&_w(c,t,o,i),new $w},_w=(e,t,r,n)=>{t.contents=r(e,t,n),t.length=n},Fw=e=>{const t=typeof e;if("string"===t)return"string";if("object"!==t||null===e)return"others";if(globalThis.Buffer?.isBuffer(e))return"buffer";const r=Bw.call(e);return"[object ArrayBuffer]"===r?"arrayBuffer":"[object DataView]"===r?"dataView":Number.isInteger(e.byteLength)&&Number.isInteger(e.byteOffset)&&"[object ArrayBuffer]"===Bw.call(e.buffer)?"typedArray":"others"},{toString:Bw}=Object.prototype;class $w extends Error{name="MaxBufferError";constructor(){super("maxBuffer exceeded")}}const Uw=e=>e,Gw=()=>{},Ww=({contents:e})=>e,zw=e=>{throw new Error(`Streams in object mode are not supported: ${String(e)}`)},Vw=e=>e.length;const qw={init:()=>({contents:[]}),convertChunk:{string:Uw,buffer:Uw,arrayBuffer:Uw,dataView:Uw,typedArray:Uw,others:Uw},getSize:()=>1,truncateChunk:Gw,addChunk:(e,{contents:t})=>(t.push(e),t),getFinalChunk:Gw,finalize:Ww};const Hw=new TextEncoder,Xw=e=>new Uint8Array(e),Kw=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),Yw=(e,t)=>{if(t<=e.byteLength)return e;const r=new ArrayBuffer(Jw(t));return new Uint8Array(r).set(new Uint8Array(e),0),r},Qw=(e,t)=>{if(t<=e.maxByteLength)return e.resize(t),e;const r=new ArrayBuffer(t,{maxByteLength:Jw(t)});return new Uint8Array(r).set(new Uint8Array(e),0),r},Jw=e=>Zw**Math.ceil(Math.log(e)/Math.log(Zw)),Zw=2,eE=()=>"resize"in ArrayBuffer.prototype,tE={init:()=>({contents:new ArrayBuffer(0)}),convertChunk:{string:e=>Hw.encode(e),buffer:Xw,arrayBuffer:Xw,dataView:Kw,typedArray:Kw,others:zw},getSize:Vw,truncateChunk:(e,t)=>e.slice(0,t),addChunk:(e,{contents:t,length:r},n)=>{const o=eE()?Qw(t,n):Yw(t,n);return new Uint8Array(o).set(e,r),o},getFinalChunk:Gw,finalize:({contents:e,length:t})=>eE()?e:e.slice(0,t)};const rE=(e,{textDecoder:t})=>t.decode(e,{stream:!0}),nE={init:()=>({contents:"",textDecoder:new TextDecoder}),convertChunk:{string:Uw,buffer:rE,arrayBuffer:rE,dataView:rE,typedArray:rE,others:zw},getSize:Vw,truncateChunk:(e,t)=>e.slice(0,t),addChunk:(e,{contents:t})=>t+e,getFinalChunk:({textDecoder:e})=>{const t=e.decode();return""===t?void 0:t},finalize:Ww},oE=(e,t,r)=>e?"objects":t?"lines":"buffer"===r?"bytes":"characters",iE=(e,t,r)=>{if(t.length!==r)return;const n=new $w;throw n.maxBufferInfo={fdNumber:"ipc"},n},sE=(e,t)=>{if(void 0===e?.maxBufferInfo)return{streamName:"output",threshold:t[1],unit:"bytes"};const{maxBufferInfo:{fdNumber:r,unit:n}}=e;delete e.maxBufferInfo;const o=pg(t,r);return"ipc"===r?{streamName:"IPC output",threshold:o,unit:"messages"}:{streamName:Zm(r),threshold:o,unit:n}},aE=([,e])=>e,cE=({originalError:e,timedOut:t,timeout:r,isMaxBuffer:n,maxBuffer:o,errorCode:i,signal:s,signalDescription:a,exitCode:c,isCanceled:l,isGracefullyCanceled:u,isForcefullyTerminated:f,forceKillAfterDelay:p,killSignal:d})=>{const h=lE(f,p);return t?`Command timed out after ${r} milliseconds${h}`:u?void 0===s?`Command was gracefully canceled with exit code ${c}`:f?`Command was gracefully canceled${h}`:`Command was gracefully canceled with ${s} (${a})`:l?`Command was canceled${h}`:n?`${((e,t)=>{const{streamName:r,threshold:n,unit:o}=sE(e,t);return`Command's ${r} was larger than ${n} ${o}`})(e,o)}${h}`:void 0!==i?`Command failed with ${i}${h}`:f?`Command was killed with ${d} (${Db(d)})${h}`:void 0!==s?`Command was killed with ${s} (${a})`:void 0!==c?`Command failed with exit code ${c}`:"Command failed"},lE=(e,t)=>e?` and was forcefully terminated after ${t} milliseconds`:"",uE=(e,t)=>{if(e instanceof sb)return;const r=lb(n=e)&&cb in n?e.originalMessage:String(e?.message??e);var n;const o=vg(((e,t)=>{if(t===sw())return e;let r;try{r=p.statSync(t)}catch(r){return`The "cwd" option is invalid: ${t}.\n${r.message}\n${e}`}return r.isDirectory()?e:`The "cwd" option is not a directory: ${t}.\n${e}`})(r,t));return""===o?void 0:o},fE=e=>"string"==typeof e?e:u.inspect(e),pE=e=>Array.isArray(e)?e.map((e=>fw(dE(e)))).filter(Boolean).join("\n"):dE(e),dE=e=>"string"==typeof e?e:Nm(e)?Mm(e):"",hE=({command:e,escapedCommand:t,stdio:r,all:n,ipcOutput:o,options:{cwd:i},startTime:s})=>bE({command:e,escapedCommand:t,cwd:i,durationMs:iy(s),failed:!1,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isTerminated:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,exitCode:0,stdout:r[1],stderr:r[2],all:n,stdio:r,ipcOutput:o,pipedFrom:[]}),mE=({error:e,command:t,escapedCommand:r,fileDescriptors:n,options:o,startTime:i,isSync:s})=>gE({error:e,command:t,escapedCommand:r,startTime:i,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,stdio:Array.from({length:n.length}),ipcOutput:[],options:o,isSync:s}),gE=({error:e,command:t,escapedCommand:r,startTime:n,timedOut:o,isCanceled:i,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:l,signal:u,stdio:f,all:p,ipcOutput:d,options:{timeoutDuration:h,timeout:m=h,forceKillAfterDelay:g,killSignal:y,cwd:b,maxBuffer:v},isSync:w})=>{const{exitCode:E,signal:S,signalDescription:O}=vE(l,u),{originalMessage:I,shortMessage:T,message:j}=(({stdio:e,all:t,ipcOutput:r,originalError:n,signal:o,signalDescription:i,exitCode:s,escapedCommand:a,timedOut:c,isCanceled:l,isGracefullyCanceled:u,isMaxBuffer:f,isForcefullyTerminated:p,forceKillAfterDelay:d,killSignal:h,maxBuffer:m,timeout:g,cwd:y})=>{const b=n?.code,v=cE({originalError:n,timedOut:c,timeout:g,isMaxBuffer:f,maxBuffer:m,errorCode:b,signal:o,signalDescription:i,exitCode:s,isCanceled:l,isGracefullyCanceled:u,isForcefullyTerminated:p,forceKillAfterDelay:d,killSignal:h}),w=uE(n,y),E=`${v}: ${a}${void 0===w?"":`\n${w}`}`,S=[E,...void 0===t?[e[2],e[1]]:[t],...e.slice(3),r.map((e=>fE(e))).join("\n")].map((e=>vg(fw(pE(e))))).filter(Boolean).join("\n\n");return{originalMessage:w,shortMessage:E,message:S}})({stdio:f,all:p,ipcOutput:d,originalError:e,signal:S,signalDescription:O,exitCode:E,escapedCommand:r,timedOut:o,isCanceled:i,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,forceKillAfterDelay:g,killSignal:y,maxBuffer:v,timeout:m,cwd:b}),x=((e,t,r)=>new(r?fb:ub)(t,e instanceof sb?{}:{cause:e}))(e,j,w);return Object.assign(x,yE({error:x,command:t,escapedCommand:r,startTime:n,timedOut:o,isCanceled:i,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:E,signal:S,signalDescription:O,stdio:f,all:p,ipcOutput:d,cwd:b,originalMessage:I,shortMessage:T})),x},yE=({error:e,command:t,escapedCommand:r,startTime:n,timedOut:o,isCanceled:i,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:l,signal:u,signalDescription:f,stdio:p,all:d,ipcOutput:h,cwd:m,originalMessage:g,shortMessage:y})=>bE({shortMessage:y,originalMessage:g,command:t,escapedCommand:r,cwd:m,durationMs:iy(n),failed:!0,timedOut:o,isCanceled:i,isGracefullyCanceled:s,isTerminated:void 0!==u,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:l,signal:u,signalDescription:f,code:e.cause?.code,stdout:p[1],stderr:p[2],all:d,stdio:p,ipcOutput:h,pipedFrom:[]}),bE=e=>Object.fromEntries(Object.entries(e).filter((([,e])=>void 0!==e))),vE=(e,t)=>{const r=null===t?void 0:t;return{exitCode:null===e?void 0:e,signal:r,signalDescription:void 0===r?void 0:Db(t)}},wE=e=>Number.isFinite(e)?e:0;function EE(e){switch(typeof e){case"number":if(Number.isFinite(e))return function(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(wE(1e3*e)%1e3),nanoseconds:Math.trunc(wE(1e6*e)%1e3)}}(e);break;case"bigint":return function(e){return{days:e/86400000n,hours:e/3600000n%24n,minutes:e/60000n%60n,seconds:e/1000n%60n,milliseconds:e%1000n,microseconds:0n,nanoseconds:0n}}(e)}throw new TypeError("Expected a finite number or bigint")}const SE=24n*60n*60n*1000n;function OE(e,t){const r="bigint"==typeof e;if(!r&&!Number.isFinite(e))throw new TypeError("Expected a finite number or bigint");(t=Object.assign({},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 n=[];const o=(e,r,o,i)=>{if(0!==n.length&&t.colonNotation||!(e=>0===e||0n===e)(e)||t.colonNotation&&"m"===o){if(i=i??String(e),t.colonNotation){const e=i.includes(".")?i.split(".")[0].length:i.length,t=n.length>0?2:1;i="0".repeat(Math.max(0,t-e))+i}else i+=t.verbose?" "+((e,t)=>1===t||1n===t?e:`${e}s`)(r,e):o;n.push(i)}},i=EE(e),s=BigInt(i.days);if(o(s/365n,"year","y"),o(s%365n,"day","d"),o(Number(i.hours),"hour","h"),o(Number(i.minutes),"minute","m"),t.separateMilliseconds||t.formatSubMilliseconds||!t.colonNotation&&e<1e3){const e=Number(i.seconds),r=Number(i.milliseconds),n=Number(i.microseconds),s=Number(i.nanoseconds);if(o(e,"second","s"),t.formatSubMilliseconds)o(r,"millisecond","ms"),o(n,"microsecond","µs"),o(s,"nanosecond","ns");else{const e=r+n/1e3+s/1e6,i="number"==typeof t.millisecondsDecimalDigits?t.millisecondsDecimalDigits:0,a=e>=1?Math.round(e):Math.ceil(e),c=i?e.toFixed(i):a;o(Number.parseFloat(c),"millisecond","ms",c)}}else{const n=((e,t)=>{const r=Math.floor(e*10**t+1e-7);return(Math.round(r)/10**t).toFixed(t)})((r?Number(e%SE):e)/1e3%60,"number"==typeof t.secondsDecimalDigits?t.secondsDecimalDigits:1),i=t.keepDecimalsOnWholeSeconds?n:n.replace(/\.0+$/,"");o(Number.parseFloat(i),"second","s",i)}if(0===n.length)return"0"+(t.verbose?" milliseconds":"ms");const a=t.colonNotation?":":" ";return"number"==typeof t.unitCount&&(n=n.slice(0,Math.max(t.unitCount,1))),n.join(a)}const IE=(e,t)=>{dg(t)&&(((e,t)=>{e.failed&&Xg({type:"error",verboseMessage:e.shortMessage,verboseInfo:t,result:e})})(e,t),TE(e,t))},TE=(e,t)=>{const r=`(done in ${OE(e.durationMs)})`;Xg({type:"duration",verboseMessage:r,verboseInfo:t,result:e})},jE=(e,t,{reject:r})=>{if(IE(e,t),e.failed&&r)throw e;return e},xE=(e,t)=>ME(e)?"asyncGenerator":_E(e)?"generator":BE(e)?"fileUrl":$E(e)?"filePath":VE(e)?"webStream":bw(e,{checkOpen:!1})?"native":Nm(e)?"uint8Array":HE(e)?"asyncIterable":XE(e)?"iterable":qE(e)?DE({transform:e},t):FE(e)?RE(e,t):"native",RE=(e,t)=>Ew(e.transform,{checkOpen:!1})?AE(e,t):qE(e.transform)?DE(e,t):kE(e,t),AE=(e,t)=>(NE(e,t,"Duplex stream"),"duplex"),DE=(e,t)=>(NE(e,t,"web TransformStream"),"webTransform"),NE=({final:e,binary:t,objectMode:r},n,o)=>{LE(e,`${n}.final`,o),LE(t,`${n}.binary`,o),CE(r,`${n}.objectMode`)},LE=(e,t,r)=>{if(void 0!==e)throw new TypeError(`The \`${t}\` option can only be defined when using a generator, not a ${r}.`)},kE=({transform:e,final:t,binary:r,objectMode:n},o)=>{if(void 0!==e&&!PE(e))throw new TypeError(`The \`${o}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(Ew(t,{checkOpen:!1}))throw new TypeError(`The \`${o}.final\` option must not be a Duplex stream.`);if(qE(t))throw new TypeError(`The \`${o}.final\` option must not be a web TransformStream.`);if(void 0!==t&&!PE(t))throw new TypeError(`The \`${o}.final\` option must be a generator.`);return CE(r,`${o}.binary`),CE(n,`${o}.objectMode`),ME(e)||ME(t)?"asyncGenerator":"generator"},CE=(e,t)=>{if(void 0!==e&&"boolean"!=typeof e)throw new TypeError(`The \`${t}\` option must use a boolean.`)},PE=e=>ME(e)||_E(e),ME=e=>"[object AsyncGeneratorFunction]"===Object.prototype.toString.call(e),_E=e=>"[object GeneratorFunction]"===Object.prototype.toString.call(e),FE=e=>Bu(e)&&(void 0!==e.transform||void 0!==e.final),BE=e=>"[object URL]"===Object.prototype.toString.call(e),$E=e=>Bu(e)&&1===Object.keys(e).length&&UE(e.file),UE=e=>"string"==typeof e,GE=new Set(["ipc","ignore","inherit","overlapped","pipe"]),WE=e=>"[object ReadableStream]"===Object.prototype.toString.call(e),zE=e=>"[object WritableStream]"===Object.prototype.toString.call(e),VE=e=>WE(e)||zE(e),qE=e=>WE(e?.readable)&&zE(e?.writable),HE=e=>KE(e)&&"function"==typeof e[Symbol.asyncIterator],XE=e=>KE(e)&&"function"==typeof e[Symbol.iterator],KE=e=>"object"==typeof e&&null!==e,YE=new Set(["generator","asyncGenerator","duplex","webTransform"]),QE=new Set(["fileUrl","filePath","fileNumber"]),JE=new Set(["fileUrl","filePath"]),ZE=new Set([...JE,"webStream","nodeStream"]),eS=new Set(["webTransform","duplex"]),tS={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"},rS=(e,t,r,n)=>"output"===n?nS(e,t,r):oS(e,t,r),nS=(e,t,r)=>{const n=0!==t&&r[t-1].value.readableObjectMode;return{writableObjectMode:n,readableObjectMode:e??n}},oS=(e,t,r)=>{const n=0===t?!0===e:r[t-1].value.readableObjectMode;return{writableObjectMode:n,readableObjectMode:t!==r.length-1&&(e??n)}},iS=(e,t,r,{encoding:n})=>{const o=e.filter((({type:e})=>YE.has(e))),i=Array.from({length:o.length});for(const[e,s]of Object.entries(o))i[e]=sS({stdioItem:s,index:Number(e),newTransforms:i,optionName:t,direction:r,encoding:n});return uS(i,r)},sS=({stdioItem:e,stdioItem:{type:t},index:r,newTransforms:n,optionName:o,direction:i,encoding:s})=>"duplex"===t?aS({stdioItem:e,optionName:o}):"webTransform"===t?cS({stdioItem:e,index:r,newTransforms:n,direction:i}):lS({stdioItem:e,index:r,newTransforms:n,direction:i,encoding:s}),aS=({stdioItem:e,stdioItem:{value:{transform:t,transform:{writableObjectMode:r,readableObjectMode:n},objectMode:o=n}},optionName:i})=>{if(o&&!n)throw new TypeError(`The \`${i}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`);if(!o&&n)throw new TypeError(`The \`${i}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`);return Object.assign(Object.assign({},e),{},{value:{transform:t,writableObjectMode:r,readableObjectMode:n}})},cS=({stdioItem:e,stdioItem:{value:t},index:r,newTransforms:n,direction:o})=>{const{transform:i,objectMode:s}=Bu(t)?t:{transform:t},{writableObjectMode:a,readableObjectMode:c}=rS(s,r,n,o);return Object.assign(Object.assign({},e),{},{value:{transform:i,writableObjectMode:a,readableObjectMode:c}})},lS=({stdioItem:e,stdioItem:{value:t},index:r,newTransforms:n,direction:o,encoding:i})=>{const{transform:s,final:a,binary:c=!1,preserveNewlines:l=!1,objectMode:u}=Bu(t)?t:{transform:t},f=c||tw.has(i),{writableObjectMode:p,readableObjectMode:d}=rS(u,r,n,o);return Object.assign(Object.assign({},e),{},{value:{transform:s,final:a,binary:f,preserveNewlines:l,writableObjectMode:p,readableObjectMode:d}})},uS=(e,t)=>"input"===t?e.reverse():e,fS=({type:e,value:t},r)=>pS[r]??mS[e](t),pS=["input","output","output"],dS=()=>{},hS=()=>"input",mS={generator:dS,asyncGenerator:dS,fileUrl:dS,filePath:dS,iterable:hS,asyncIterable:hS,uint8Array:hS,webStream:e=>zE(e)?"output":"input",nodeStream:e=>ww(e,{checkOpen:!1})?vw(e,{checkOpen:!1})?void 0:"input":"output",webTransform:dS,duplex:dS,native(e){const t=gS(e);return void 0!==t?t:bw(e,{checkOpen:!1})?mS.nodeStream(e):void 0}},gS=e=>[0,f.stdin].includes(e)?"input":[1,2,f.stdout,f.stderr].includes(e)?"output":void 0,yS="output",bS=["stdio","ipc","buffer"],vS=(e,t)=>{if(void 0===e)return Jm.map((e=>t[e]));if(wS(t))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${Jm.map((e=>`\`${e}\``)).join(", ")}`);if("string"==typeof e)return[e,e,e];if(!Array.isArray(e))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof e}\``);const r=Math.max(e.length,Jm.length);return Array.from({length:r},((t,r)=>e[r]))},wS=e=>Jm.some((t=>void 0!==e[t])),ES=(e,t)=>Array.isArray(e)?e.map((e=>ES(e,t))):null==e?t>=Jm.length?"ignore":"pipe":e,SS=(e,t,r)=>e.map(((e,n)=>t[n]||0===n||hg(r,n)||!OS(e)?e:"ignore")),OS=e=>"pipe"===e||Array.isArray(e)&&e.every((e=>"pipe"===e)),IS=({stdioItem:e,stdioItem:{value:t,optionName:r},fdNumber:n,direction:o})=>{const i=TS({value:t,optionName:r,fdNumber:n,direction:o});if(void 0!==i)return i;if(bw(t,{checkOpen:!1}))throw new TypeError(`The \`${r}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return e},TS=({value:e,optionName:t,fdNumber:r,direction:n})=>{const o=jS(e,r);if(void 0!==o){if("output"===n)return{type:"fileNumber",value:o,optionName:t};if(d.isatty(o))throw new TypeError(`The \`${t}: ${cv(e)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:"uint8Array",value:Lm(p.readFileSync(o)),optionName:t}}},jS=(e,t)=>{if("inherit"===e)return t;if("number"==typeof e)return e;const r=Qm.indexOf(e);return-1!==r?r:void 0},xS=({stdioItem:e,stdioItem:{value:t,optionName:r},fdNumber:n})=>"inherit"===t?{type:"nodeStream",value:RS(n,t,r),optionName:r}:"number"==typeof t?{type:"nodeStream",value:RS(t,t,r),optionName:r}:bw(t,{checkOpen:!1})?{type:"nodeStream",value:t,optionName:r}:e,RS=(e,t,r)=>{const n=Qm[e];if(void 0===n)throw new TypeError(`The \`${r}: ${t}\` option is invalid: no such standard stream.`);return n},AS=({input:e,inputFile:t},r)=>0===r?[...DS(e),...LS(t)]:[],DS=e=>void 0===e?[]:[{type:NS(e),value:e,optionName:"input"}],NS=e=>{if(ww(e,{checkOpen:!1}))return"nodeStream";if("string"==typeof e)return"string";if(Nm(e))return"uint8Array";throw new Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},LS=e=>void 0===e?[]:[Object.assign(Object.assign({},kS(e)),{},{optionName:"inputFile"})],kS=e=>{if(BE(e))return{type:"fileUrl",value:e};if(UE(e))return{type:"filePath",value:{file:e}};throw new Error("The `inputFile` option must be a file path string or a file URL.")};var CS=L,PS=Zt,MS=es,_S=ra,FS=Eo,BS=L,$S=_e,US=Zt,GS=es,WS=function(e,t){t&&"string"==typeof e||PS(e);var r=_S(e);return MS(PS(void 0!==r?CS(r,e):e))},zS=is,VS=Ss((function(){for(var e,t,r=this.iterator,n=this.mapper;;){if(t=this.inner)try{if(!(e=US(BS(t.next,t.iterator))).done)return e.value;this.inner=null}catch(e){zS(r,"throw",e)}if(e=US(BS(this.next,r)),this.done=!!e.done)return;try{this.inner=WS(n(e.value,this.counter++),!1)}catch(e){zS(r,"throw",e)}}}));FS({target:"Iterator",proto:!0,real:!0,forced:false},{flatMap:function(e){return US(this),$S(e),new VS(GS(this),{mapper:e,inner:null})}});const qS=(e,t)=>e.flatMap((({direction:e,stdioItems:r})=>r.filter((e=>e.type===t)).map((t=>Object.assign(Object.assign({},t),{},{direction:e}))))),HS=({otherStdioItems:e,type:t,value:r,optionName:n,direction:o})=>{JE.has(t)&&XS({otherStdioItems:e,type:t,value:r,optionName:n,direction:o})},XS=({otherStdioItems:e,type:t,value:r,optionName:n,direction:o})=>{const i=e.filter((e=>KS(e,r)));if(0===i.length)return;const s=i.find((e=>e.direction!==o));return QS(s,n,t),"output"===o?i[0].stream:void 0},KS=({type:e,value:t},r)=>"filePath"===e?t.file===r.file:"fileUrl"===e?t.href===r.href:t===r,YS=({otherStdioItems:e,type:t,value:r,optionName:n})=>{const o=e.find((({value:{transform:e}})=>e===r.transform));QS(o,n,t)},QS=(e,t,r)=>{if(void 0!==e)throw new TypeError(`The \`${e.optionName}\` and \`${t}\` options must not target ${tS[r]} that is the same.`)},JS=(e,t,r,n)=>{const o=((e,t,r)=>{let{stdio:n,ipc:o,buffer:i}=e,s=Km(e,bS);const a=vS(n,s).map(((e,t)=>ES(e,t)));return r?SS(a,i,t):((e,t)=>t&&!e.includes("ipc")?[...e,"ipc"]:e)(a,o)})(t,r,n),i=o.map(((e,r)=>ZS({stdioOption:e,fdNumber:r,options:t,isSync:n}))),s=aO({initialFileDescriptors:i,addProperties:e,options:t,isSync:n});return t.stdio=s.map((({stdioItems:e})=>fO(e))),s},ZS=({stdioOption:e,fdNumber:t,options:r,isSync:n})=>{const o=Zm(t),{stdioItems:i,isStdioArray:s}=eO({stdioOption:e,fdNumber:t,options:r,optionName:o}),a=((e,t,r)=>{const n=e.map((e=>fS(e,t)));if(n.includes("input")&&n.includes("output"))throw new TypeError(`The \`${r}\` option must not be an array of both readable and writable values.`);return n.find(Boolean)??yS})(i,t,o),c=i.map((e=>(({stdioItem:e,stdioItem:{type:t},isStdioArray:r,fdNumber:n,direction:o,isSync:i})=>r&&"native"===t?i?IS({stdioItem:e,fdNumber:n,direction:o}):xS({stdioItem:e,fdNumber:n}):e)({stdioItem:e,isStdioArray:s,fdNumber:t,direction:a,isSync:n}))),l=((e,t,r,n)=>[...e.filter((({type:e})=>!YE.has(e))),...iS(e,t,r,n)])(c,o,a,r),u=((e,t)=>{const r=e.findLast((({type:e})=>YE.has(e)));return void 0!==r&&("input"===t?r.value.writableObjectMode:r.value.readableObjectMode)})(l,a);return sO(l,u),{direction:a,objectMode:u,stdioItems:l}},eO=({stdioOption:e,fdNumber:t,options:r,optionName:n})=>{const o=(e=>e.filter(((t,r)=>e.every(((e,n)=>t.value!==e.value||r>=n||"generator"===t.type||"asyncGenerator"===t.type)))))([...(Array.isArray(e)?e:[e]).map((e=>tO(e,n))),...AS(r,t)]),i=o.length>1;return rO(o,i,n),oO(o),{stdioItems:o,isStdioArray:i}},tO=(e,t)=>({type:xE(e,t),value:e,optionName:t}),rO=(e,t,r)=>{if(0===e.length)throw new TypeError(`The \`${r}\` option must not be an empty array.`);if(t)for(const{value:t,optionName:r}of e)if(nO.has(t))throw new Error(`The \`${r}\` option must not include \`${t}\`.`)},nO=new Set(["ignore","ipc"]),oO=e=>{for(const t of e)iO(t)},iO=({type:e,value:t,optionName:r})=>{if((e=>BE(e)&&"file:"!==e.protocol)(t))throw new TypeError(`The \`${r}: URL\` option must use the \`file:\` scheme.\nFor example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`);if(((e,t)=>"native"===e&&"string"==typeof t&&!GE.has(t))(e,t))throw new TypeError(`The \`${r}: { file: '...' }\` option must be used instead of \`${r}: '...'\`.`)},sO=(e,t)=>{if(!t)return;const r=e.find((({type:e})=>QE.has(e)));if(void 0!==r)throw new TypeError(`The \`${r.optionName}\` option cannot use both files and transforms in objectMode.`)},aO=({initialFileDescriptors:e,addProperties:t,options:r,isSync:n})=>{const o=[];try{for(const i of e)o.push(cO({fileDescriptor:i,fileDescriptors:o,addProperties:t,options:r,isSync:n}));return o}catch(e){throw uO(o),e}},cO=({fileDescriptor:{direction:e,objectMode:t,stdioItems:r},fileDescriptors:n,addProperties:o,options:i,isSync:s})=>{const a=r.map((t=>lO({stdioItem:t,addProperties:o,direction:e,options:i,fileDescriptors:n,isSync:s})));return{direction:e,objectMode:t,stdioItems:a}},lO=({stdioItem:e,addProperties:t,direction:r,options:n,fileDescriptors:o,isSync:i})=>{const s=(({stdioItem:{type:e,value:t,optionName:r},direction:n,fileDescriptors:o,isSync:i})=>{const s=qS(o,e);if(0!==s.length){if(!i)return ZE.has(e)?XS({otherStdioItems:s,type:e,value:t,optionName:r,direction:n}):void(eS.has(e)&&YS({otherStdioItems:s,type:e,value:t,optionName:r}));HS({otherStdioItems:s,type:e,value:t,optionName:r,direction:n})}})({stdioItem:e,direction:r,fileDescriptors:o,isSync:i});return void 0!==s?Object.assign(Object.assign({},e),{},{stream:s}):Object.assign(Object.assign({},e),t[r][e.type](e,n))},uO=e=>{for(const{stdioItems:t}of e)for(const{stream:e}of t)void 0===e||Ym(e)||e.destroy()},fO=e=>{if(e.length>1)return e.some((({value:e})=>"overlapped"===e))?"overlapped":"pipe";const[{type:t,value:r}]=e;return"native"===t?r:"pipe"},pO=({type:e,optionName:t})=>{dO(t,tS[e])},dO=(e,t)=>{throw new TypeError(`The \`${e}\` option cannot be ${t} with synchronous methods.`)},hO={generator(){},asyncGenerator:pO,webStream:pO,nodeStream:pO,webTransform:pO,duplex:pO,asyncIterable:pO,native:({optionName:e,value:t})=>("ipc"!==t&&"overlapped"!==t||dO(e,`"${t}"`),{})},mO={input:Object.assign(Object.assign({},hO),{},{fileUrl:({value:e})=>({contents:[Lm(p.readFileSync(e))]}),filePath:({value:{file:e}})=>({contents:[Lm(p.readFileSync(e))]}),fileNumber:pO,iterable:({value:e})=>({contents:[...e]}),string:({value:e})=>({contents:[e]}),uint8Array:({value:e})=>({contents:[e]})}),output:Object.assign(Object.assign({},hO),{},{fileUrl:({value:e})=>({path:e}),filePath:({value:{file:e}})=>({path:e}),fileNumber:({value:e})=>({path:e}),iterable:pO,string:pO,uint8Array:pO})},gO=(e,{stripFinalNewline:t},r)=>yO(t,r)&&void 0!==e&&!Array.isArray(e)?fw(e):e,yO=(e,t)=>"all"===t?e[1]||e[2]:e[t],bO=(e,t,r,n)=>e||r?void 0:EO(t,n),vO=(e,t,r)=>r?e.flatMap((e=>wO(e,t))):wO(e,t),wO=(e,t)=>{const{transform:r,final:n}=EO(t,{});return[...r(e),...n()]},EO=(e,t)=>(t.previousChunks="",{transform:SO.bind(void 0,t,e),final:IO.bind(void 0,t)}),SO=function*(e,t,r){if("string"!=typeof r)return void(yield r);let{previousChunks:n}=e,o=-1;for(let i=0;i0&&(a=xO(n,a),n=""),yield a,o=i}o!==r.length-1&&(n=xO(n,r.slice(o+1))),e.previousChunks=n},OO=(e,t,r,n)=>r?0:(n.isWindowsNewline=0!==t&&"\r"===e[t-1],n.isWindowsNewline?2:1),IO=function*({previousChunks:e}){e.length>0&&(yield e)},TO=({binary:e,preserveNewlines:t,readableObjectMode:r,state:n})=>e||t||r?void 0:{transform:jO.bind(void 0,n)},jO=function*({isWindowsNewline:e=!1},t){const{unixNewline:r,windowsNewline:n,LF:o,concatBytes:i}="string"==typeof t?RO:AO;if(t.at(-1)===o)return void(yield t);const s=e?n:r;yield i(t,s)},xO=(e,t)=>`${e}${t}`,RO={windowsNewline:"\r\n",unixNewline:"\n",LF:"\n",concatBytes:xO},AO={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:(e,t)=>{const r=new Uint8Array(e.length+t.length);return r.set(e,0),r.set(t,e.length),r}},DO=(e,t)=>e?void 0:NO.bind(void 0,t),NO=function*(e,t){if("string"!=typeof t&&!Nm(t)&&!w.Buffer.isBuffer(t))throw new TypeError(`The \`${e}\` option's transform must use "objectMode: true" to receive as input: ${typeof t}.`);yield t},LO=(e,t)=>e?kO.bind(void 0,t):CO.bind(void 0,t),kO=function*(e,t){PO(e,t),yield t},CO=function*(e,t){if(PO(e,t),"string"!=typeof t&&!Nm(t))throw new TypeError(`The \`${e}\` option's function must yield a string or an Uint8Array, not ${typeof t}.`);yield t},PO=(e,t)=>{if(null==t)throw new TypeError(`The \`${e}\` option's function must not call \`yield ${t}\`.\nInstead, \`yield\` should either be called with a value, or not be called at all. For example:\n if (condition) { yield value; }`)},MO=(e,t,r)=>{if(r)return;if(e)return{transform:_O.bind(void 0,new TextEncoder)};const n=new l.StringDecoder(t);return{transform:FO.bind(void 0,n),final:BO.bind(void 0,n)}},_O=function*(e,t){w.Buffer.isBuffer(t)?yield Lm(t):"string"==typeof t?yield e.encode(t):yield t},FO=function*(e,t){yield Nm(t)?e.write(t):t},BO=function*(e){const t=e.end();""!==t&&(yield t)},$O=u.callbackify((async(e,t,r,n)=>{t.currentIterable=e(...r);try{for await(const e of t.currentIterable)n.push(e)}finally{delete t.currentIterable}})),UO=async function*(e,t,r){if(r===t.length)return void(yield e);const{transform:n=VO}=t[r];for await(const o of n(e))yield*UO(o,t,r+1)},GO=async function*(e){for(const[t,{final:r}]of Object.entries(e))yield*WO(r,Number(t),e)},WO=async function*(e,t,r){if(void 0!==e)for await(const n of e())yield*UO(n,r,t+1)},zO=u.callbackify((async({currentIterable:e},t)=>{if(void 0===e){if(t)throw t}else await(t?e.throw(t):e.return())})),VO=function*(e){yield e},qO=(e,t,r,n)=>{try{for(const n of e(...t))r.push(n);n()}catch(e){n(e)}},HO=(e,t)=>[...t.flatMap((t=>[...XO(t,e,0)])),...KO(e)],XO=function*(e,t,r){if(r===t.length)return void(yield e);const{transform:n=QO}=t[r];for(const o of n(e))yield*XO(o,t,r+1)},KO=function*(e){for(const[t,{final:r}]of Object.entries(e))yield*YO(r,Number(t),e)},YO=function*(e,t,r){if(void 0!==e)for(const n of e())yield*XO(n,r,t+1)},QO=function*(e){yield e},JO=({value:e,value:{transform:t,final:r,writableObjectMode:n,readableObjectMode:o},optionName:i},{encoding:s})=>{const a={},c=eI(e,s,i),l=ME(t),u=ME(r),f=l?$O.bind(void 0,UO,a):qO.bind(void 0,XO),p=l||u?$O.bind(void 0,GO,a):qO.bind(void 0,KO),d=l||u?zO.bind(void 0,a):void 0;return{stream:new v.Transform({writableObjectMode:n,writableHighWaterMark:v.getDefaultHighWaterMark(n),readableObjectMode:o,readableHighWaterMark:v.getDefaultHighWaterMark(o),transform(e,t,r){f([e,c,0],this,r)},flush(e){p([c],this,e)},destroy:d})}},ZO=(e,t,r,n)=>{const o=t.filter((({type:e})=>"generator"===e)),i=n?o.reverse():o;for(const{value:t,optionName:n}of i){const o=eI(t,r,n);e=HO(o,e)}return e},eI=({transform:e,final:t,binary:r,writableObjectMode:n,readableObjectMode:o,preserveNewlines:i},s,a)=>{const c={};return[{transform:DO(n,a)},MO(r,s,n),bO(r,i,n,c),{transform:e,final:t},{transform:LO(o,a)},TO({binary:r,preserveNewlines:i,readableObjectMode:o,state:c})].filter(Boolean)},tI=e=>new Set(Object.entries(e).filter((([,{direction:e}])=>"input"===e)).map((([e])=>Number(e)))),rI=(e,t,r)=>{const{stdioItems:n}=e[t],o=n.filter((({contents:e})=>void 0!==e));if(0===o.length)return;if(0!==t){const[{type:e,optionName:t}]=o;throw new TypeError(`Only the \`stdin\` option, not \`${t}\`, can be ${tS[e]} with synchronous methods.`)}const i=o.map((({contents:e})=>e)).map((e=>nI(e,n)));r.input=Fm(i)},nI=(e,t)=>{const r=ZO(e,t,"utf8",!0);return oI(r),Fm(r)},oI=e=>{const t=e.find((e=>"string"!=typeof e&&!Nm(e)));if(void 0!==t)throw new TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${t}.`)},iI=({stdioItems:e,encoding:t,verboseInfo:r,fdNumber:n})=>"all"!==n&&hg(r,n)&&!tw.has(t)&&sI(n)&&(e.some((({type:e,value:t})=>"native"===e&&aI.has(t)))||e.every((({type:e})=>YE.has(e)))),sI=e=>1===e||2===e,aI=new Set(["pipe","overlapped"]),cI=e=>e._readableState.pipes.length>0,lI=(e,t,r)=>{const n=Zg(e);Xg({type:"output",verboseMessage:n,fdNumber:t,verboseInfo:r})},uI=({result:e,fileDescriptors:t,fdNumber:r,state:n,outputFiles:o,isMaxBuffer:i,verboseInfo:s},{buffer:a,encoding:c,lines:l,stripFinalNewline:u,maxBuffer:f})=>{if(null===e)return;const p=((e,t,r)=>{if(!t)return e;const n=aE(r);return e.length>n?e.slice(0,n):e})(e,i,f),d=Lm(p),{stdioItems:h,objectMode:m}=t[r],g=fI([d],h,c,n),{serializedResult:y,finalResult:b=y}=pI({chunks:g,objectMode:m,encoding:c,lines:l,stripFinalNewline:u,fdNumber:r});dI({serializedResult:y,fdNumber:r,state:n,verboseInfo:s,encoding:c,stdioItems:h,objectMode:m});const v=a[r]?b:void 0;try{return void 0===n.error&&hI(y,h,o),v}catch(e){return n.error=e,v}},fI=(e,t,r,n)=>{try{return ZO(e,t,r,!1)}catch(t){return n.error=t,e}},pI=({chunks:e,objectMode:t,encoding:r,lines:n,stripFinalNewline:o,fdNumber:i})=>{if(t)return{serializedResult:e};if("buffer"===r)return{serializedResult:Fm(e)};const s=((e,t)=>_m(e,t).join(""))(e,r);return n[i]?{serializedResult:s,finalResult:vO(s,!o[i],t)}:{serializedResult:s}},dI=({serializedResult:e,fdNumber:t,state:r,verboseInfo:n,encoding:o,stdioItems:i,objectMode:s})=>{if(!iI({stdioItems:i,encoding:o,verboseInfo:n,fdNumber:t}))return;const a=vO(e,!1,s);try{((e,t,r)=>{for(const n of e)lI(n,t,r)})(a,t,n)}catch(e){r.error??=e}},hI=(e,t,r)=>{for(const{path:n}of t.filter((({type:e})=>QE.has(e)))){const t="string"==typeof n?n:n.toString();r.has(t)?p.appendFileSync(n,e):(r.add(t),p.writeFileSync(n,e))}},mI=async e=>{const[t,r]=await Promise.allSettled([y.once(e,"spawn"),y.once(e,"exit")]);return"rejected"===t.status?[]:"rejected"===r.status?gI(e):r.value},gI=async e=>{try{return await y.once(e,"exit")}catch{return gI(e)}},yI=async e=>{const[t,r]=await e;if(!bI(t,r)&&vI(t,r))throw new sb;return[t,r]},bI=(e,t)=>void 0===e&&void 0===t,vI=(e,t)=>0!==e||null!==t,wI=({error:e,status:t,signal:r,output:n},{maxBuffer:o})=>{const i=EI(e,t,r),s="ETIMEDOUT"===i?.code,a=((e,t,r)=>"ENOBUFS"===e?.code&&null!==t&&t.some((e=>null!==e&&e.length>aE(r))))(i,n,o);return{resultError:i,exitCode:t,signal:r,timedOut:s,isMaxBuffer:a}},EI=(e,t,r)=>void 0!==e?e:vI(t,r)?new sb:void 0,SI=["encoding","maxBuffer"],OI=(e,t,r)=>{const{command:n,escapedCommand:o,startTime:i,verboseInfo:s}=sy(e,t,r),a=II(r),{file:c,commandArguments:l,options:u}=cw(e,t,a);TI(u);const f=((e,t)=>JS(mO,e,t,!0))(u,s);return{file:c,commandArguments:l,command:n,escapedCommand:o,startTime:i,verboseInfo:s,options:u,fileDescriptors:f}},II=e=>e.node&&!e.ipc?Object.assign(Object.assign({},e),{},{ipc:!1}):e,TI=({ipc:e,ipcInput:t,detached:r,cancelSignal:n})=>{t&&jI("ipcInput"),e&&jI("ipc: true"),r&&jI("detached: true"),n&&jI("cancelSignal")},jI=e=>{throw new TypeError(`The "${e}" option cannot be used with synchronous methods.`)},xI=({file:e,commandArguments:t,options:r,command:n,escapedCommand:o,verboseInfo:i,fileDescriptors:s,startTime:a})=>{const c=RI({file:e,commandArguments:t,options:r,command:n,escapedCommand:o,fileDescriptors:s,startTime:a});if(c.failed)return c;const{resultError:l,exitCode:u,signal:f,timedOut:p,isMaxBuffer:d}=wI(c,r),{output:h,error:m=l}=(({fileDescriptors:e,syncResult:{output:t},options:r,isMaxBuffer:n,verboseInfo:o})=>{if(null===t)return{output:Array.from({length:3})};const i={},s=new Set([]),a=t.map(((t,a)=>uI({result:t,fileDescriptors:e,fdNumber:a,state:i,outputFiles:s,isMaxBuffer:n,verboseInfo:o},r)));return Object.assign({output:a},i)})({fileDescriptors:s,syncResult:c,options:r,isMaxBuffer:d,verboseInfo:i}),g=h.map(((e,t)=>gO(e,r,t))),y=gO((([,e,t],r)=>{if(r.all)return void 0===e?t:void 0===t?e:Array.isArray(e)?Array.isArray(t)?[...e,...t]:[...e,gO(t,r,"all")]:Array.isArray(t)?[gO(e,r,"all"),...t]:Nm(e)&&Nm(t)?$m([e,t]):`${e}${t}`})(h,r),r,"all");return DI({error:m,exitCode:u,signal:f,timedOut:p,isMaxBuffer:d,stdio:g,all:y,options:r,command:n,escapedCommand:o,startTime:a})},RI=({file:e,commandArguments:t,options:r,command:n,escapedCommand:o,fileDescriptors:i,startTime:s})=>{try{((e,t)=>{for(const r of tI(e))rI(e,r,t)})(i,r);const n=AI(r);return c.spawnSync(e,t,n)}catch(e){return mE({error:e,command:n,escapedCommand:o,fileDescriptors:i,options:r,startTime:s,isSync:!0})}},AI=e=>{let{encoding:t,maxBuffer:r}=e,n=Km(e,SI);return Object.assign(Object.assign({},n),{},{encoding:"buffer",maxBuffer:aE(r)})},DI=({error:e,exitCode:t,signal:r,timedOut:n,isMaxBuffer:o,stdio:i,all:s,options:a,command:c,escapedCommand:l,startTime:u})=>void 0===e?hE({command:c,escapedCommand:l,stdio:i,all:s,ipcOutput:[],options:a,startTime:u}):gE({error:e,command:c,escapedCommand:l,timedOut:n,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:o,isForcefullyTerminated:!1,exitCode:t,signal:r,stdio:i,all:s,ipcOutput:[],options:a,startTime:u,isSync:!0}),NI=({anyProcess:e,channel:t,isSubprocess:r,ipc:n},{reference:o=!0,filter:i}={})=>($b({methodName:"getOneMessage",isSubprocess:r,ipc:n,isConnected:wv(e)}),LI({anyProcess:e,channel:t,isSubprocess:r,filter:i,reference:o})),LI=async({anyProcess:e,channel:t,isSubprocess:r,filter:n,reference:o})=>{uv(t,o);const i=yv(e,t,r),s=new AbortController;try{return await Promise.race([kI(i,n,s),CI(i,r,s),PI(i,r,s)])}catch(t){throw Yb(e),t}finally{s.abort(),pv(t,o)}},kI=async(e,t,{signal:r})=>{if(void 0===t){const[t]=await y.once(e,"message",{signal:r});return t}for await(const[n]of y.on(e,"message",{signal:r}))if(t(n))return n},CI=async(e,t,{signal:r})=>{await y.once(e,"disconnect",{signal:r}),(e=>{throw new Error(`${Hb("getOneMessage",e)} could not complete: the ${Kb(e)} exited or disconnected.`)})(t)},PI=async(e,t,{signal:r})=>{const[n]=await y.once(e,"strict:error",{signal:r});throw Wb(n,t)},MI=({anyProcess:e,channel:t,isSubprocess:r,ipc:n},{reference:o=!0}={})=>_I({anyProcess:e,channel:t,isSubprocess:r,ipc:n,shouldAwait:!r,reference:o}),_I=({anyProcess:e,channel:t,isSubprocess:r,ipc:n,shouldAwait:o,reference:i})=>{$b({methodName:"getEachMessage",isSubprocess:r,ipc:n,isConnected:wv(e)}),uv(t,i);const s=yv(e,t,r),a=new AbortController,c={};return FI(e,s,a),BI({ipcEmitter:s,isSubprocess:r,controller:a,state:c}),$I({anyProcess:e,channel:t,ipcEmitter:s,isSubprocess:r,shouldAwait:o,controller:a,state:c,reference:i})},FI=async(e,t,r)=>{try{await y.once(t,"disconnect",{signal:r.signal}),r.abort()}catch{}},BI=async({ipcEmitter:e,isSubprocess:t,controller:r,state:n})=>{try{const[o]=await y.once(e,"strict:error",{signal:r.signal});n.error=Wb(o,t),r.abort()}catch{}},$I=async function*({anyProcess:e,channel:t,ipcEmitter:r,isSubprocess:n,shouldAwait:o,controller:i,state:s,reference:a}){try{for await(const[e]of y.on(r,"message",{signal:i.signal}))UI(s),yield e}catch{UI(s)}finally{i.abort(),pv(t,a),n||Yb(e),o&&await e}},UI=({error:e})=>{if(e)throw e},GI=(e,t,r)=>({sendMessage:Cv.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:r}),getOneMessage:NI.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:r}),getEachMessage:MI.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:r})}),WI=(e,t)=>{const r=zI(),n=zI(),o=zI(),i=Array.from({length:t.length-3},zI),s=zI(),a=[r,n,o,...i];Object.assign(e,{stdin:r,stdout:n,stderr:o,all:s,stdio:a})},zI=()=>{const e=new v.PassThrough;return e.end(),e},VI=()=>new v.Readable({read(){}}),qI=()=>new v.Writable({write(){}}),HI=()=>new v.Duplex({read(){},write(){}}),XI=async(e,t,r)=>jE(e,t,r),KI=({type:e,optionName:t})=>{throw new TypeError(`The \`${t}\` option cannot be ${tS[e]}.`)},YI={fileNumber:KI,generator:JO,asyncGenerator:JO,nodeStream:({value:e})=>({stream:e}),webTransform({value:{transform:e,writableObjectMode:t,readableObjectMode:r}}){const n=t||r;return{stream:v.Duplex.fromWeb(e,{objectMode:n})}},duplex:({value:{transform:e}})=>({stream:e}),native(){}},QI={input:Object.assign(Object.assign({},YI),{},{fileUrl:({value:e})=>({stream:p.createReadStream(e)}),filePath:({value:{file:e}})=>({stream:p.createReadStream(e)}),webStream:({value:e})=>({stream:v.Readable.fromWeb(e)}),iterable:({value:e})=>({stream:v.Readable.from(e)}),asyncIterable:({value:e})=>({stream:v.Readable.from(e)}),string:({value:e})=>({stream:v.Readable.from(e)}),uint8Array:({value:e})=>({stream:v.Readable.from(w.Buffer.from(e))})}),output:Object.assign(Object.assign({},YI),{},{fileUrl:({value:e})=>({stream:p.createWriteStream(e)}),filePath:({value:{file:e}})=>({stream:p.createWriteStream(e)}),webStream:({value:e})=>({stream:v.Writable.fromWeb(e)}),iterable:KI,asyncIterable:KI,string:KI,uint8Array:KI})};function JI(e){if(!Array.isArray(e))throw new TypeError(`Expected an array, got \`${typeof e}\`.`);for(const t of e)oT(t);const t=e.some((({readableObjectMode:e})=>e)),r=ZI(e,t),n=new eT({objectMode:t,writableHighWaterMark:r,readableHighWaterMark:r});for(const t of e)n.add(t);return n}const ZI=(e,t)=>{if(0===e.length)return v.getDefaultHighWaterMark(t);const r=e.filter((({readableObjectMode:e})=>e===t)).map((({readableHighWaterMark:e})=>e));return Math.max(...r)};class eT extends v.PassThrough{#s=new Set([]);#a=new Set([]);#c=new Set([]);#l;#u=Symbol("unpipe");#f=new WeakMap;add(e){if(oT(e),this.#s.has(e))return;this.#s.add(e),this.#l??=tT(this,this.#s,this.#u);const t=iT({passThroughStream:this,stream:e,streams:this.#s,ended:this.#a,aborted:this.#c,onFinished:this.#l,unpipeEvent:this.#u});this.#f.set(e,t),e.pipe(this,{end:!1})}async remove(e){if(oT(e),!this.#s.has(e))return!1;const t=this.#f.get(e);return void 0!==t&&(this.#f.delete(e),e.unpipe(this),await t,!0)}}const tT=async(e,t,r)=>{mT(e,gT);const n=new AbortController;try{await Promise.race([rT(e,n),nT(e,t,r,n)])}finally{n.abort(),mT(e,-gT)}},rT=async(e,{signal:t})=>{try{await E.finished(e,{signal:t,cleanup:!0})}catch(t){throw uT(e,t),t}},nT=async(e,t,r,{signal:n})=>{for await(const[o]of y.on(e,"unpipe",{signal:n}))t.has(o)&&o.emit(r)},oT=e=>{if("function"!=typeof e?.pipe)throw new TypeError(`Expected a readable stream, got: \`${typeof e}\`.`)},iT=async({passThroughStream:e,stream:t,streams:r,ended:n,aborted:o,onFinished:i,unpipeEvent:s})=>{mT(e,yT);const a=new AbortController;try{await Promise.race([sT(i,t,a),aT({passThroughStream:e,stream:t,streams:r,ended:n,aborted:o,controller:a}),cT({stream:t,streams:r,ended:n,aborted:o,unpipeEvent:s,controller:a})])}finally{a.abort(),mT(e,-yT)}r.size>0&&r.size===n.size+o.size&&(0===n.size&&o.size>0?pT(e):lT(e))},sT=async(e,t,{signal:r})=>{try{await e,r.aborted||pT(t)}catch(e){r.aborted||uT(t,e)}},aT=async({passThroughStream:e,stream:t,streams:r,ended:n,aborted:o,controller:{signal:i}})=>{try{await E.finished(t,{signal:i,cleanup:!0,readable:!0,writable:!1}),r.has(t)&&n.add(t)}catch(n){if(i.aborted||!r.has(t))return;fT(n)?o.add(t):dT(e,n)}},cT=async({stream:e,streams:t,ended:r,aborted:n,unpipeEvent:o,controller:{signal:i}})=>{if(await y.once(e,o,{signal:i}),!e.readable)return y.once(i,"abort",{signal:i});t.delete(e),r.delete(e),n.delete(e)},lT=e=>{e.writable&&e.end()},uT=(e,t)=>{fT(t)?pT(e):dT(e,t)},fT=e=>"ERR_STREAM_PREMATURE_CLOSE"===e?.code,pT=e=>{(e.readable||e.writable)&&e.destroy()},dT=(e,t)=>{e.destroyed||(e.once("error",hT),e.destroy(t))},hT=()=>{},mT=(e,t)=>{const r=e.getMaxListeners();0!==r&&r!==Number.POSITIVE_INFINITY&&e.setMaxListeners(r+t)},gT=2,yT=1,bT=(e,t)=>{e.pipe(t),vT(e,t),ET(e,t)},vT=async(e,t)=>{if(!Ym(e)&&!Ym(t)){try{await E.finished(e,{cleanup:!0,readable:!0,writable:!1})}catch{}wT(t)}},wT=e=>{e.writable&&e.end()},ET=async(e,t)=>{if(!Ym(e)&&!Ym(t)){try{await E.finished(t,{cleanup:!0,readable:!1,writable:!0})}catch{}ST(e)}},ST=e=>{e.readable&&e.destroy()},OT=(e,t,r,n)=>{"output"===r?bT(e.stdio[n],t):bT(t,e.stdio[n]);const o=IT[n];void 0!==o&&(e[o]=t),e.stdio[n]=t},IT=["stdin","stdout","stderr"],TT=({subprocess:e,stream:t,direction:r,fdNumber:n,pipeGroups:o,controller:i})=>{if(void 0===t)return;jT(t,i);const[s,a]="output"===r?[t,e.stdio[n]]:[e.stdio[n],t],c=o.get(s)??[];o.set(s,[...c,a])},jT=(e,{signal:t})=>{Ym(e)&&lv(e,xT,t)},xT=2,RT=[];RT.push("SIGHUP","SIGINT","SIGTERM"),"win32"!==process.platform&&RT.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT"),"linux"===process.platform&&RT.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");const AT=e=>!!e&&"object"==typeof e&&"function"==typeof e.removeListener&&"function"==typeof e.emit&&"function"==typeof e.reallyExit&&"function"==typeof e.listeners&&"function"==typeof e.kill&&"number"==typeof e.pid&&"function"==typeof e.on,DT=Symbol.for("signal-exit emitter"),NT=globalThis,LT=Object.defineProperty.bind(Object);class kT{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(NT[DT])return NT[DT];LT(NT,DT,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,t){this.listeners[e].push(t)}removeListener(e,t){const r=this.listeners[e],n=r.indexOf(t);-1!==n&&(0===n&&1===r.length?r.length=0:r.splice(n,1))}emit(e,t,r){if(this.emitted[e])return!1;this.emitted[e]=!0;let n=!1;for(const o of this.listeners[e])n=!0===o(t,r)||n;return"exit"===e&&(n=this.emit("afterExit",t,r)||n),n}}class CT{}const PT=globalThis.process,{onExit:MT,load:_T,unload:FT}=(BT=AT(PT)?new class extends CT{#p="win32"===PT.platform?"SIGINT":"SIGHUP";#d=new kT;#h;#m;#g;#y={};#b=!1;constructor(e){super(),this.#h=e,this.#y={};for(const t of RT)this.#y[t]=()=>{const r=this.#h.listeners(t);let{count:n}=this.#d;const o=e;if("object"==typeof o.__signal_exit_emitter__&&"number"==typeof o.__signal_exit_emitter__.count&&(n+=o.__signal_exit_emitter__.count),r.length===n){this.unload();const r=this.#d.emit("exit",null,t),n="SIGHUP"===t?this.#p:t;r||e.kill(e.pid,n)}};this.#g=e.reallyExit,this.#m=e.emit}onExit(e,t){if(!AT(this.#h))return()=>{};!1===this.#b&&this.load();const r=t?.alwaysLast?"afterExit":"exit";return this.#d.on(r,e),()=>{this.#d.removeListener(r,e),0===this.#d.listeners.exit.length&&0===this.#d.listeners.afterExit.length&&this.unload()}}load(){if(!this.#b){this.#b=!0,this.#d.count+=1;for(const e of RT)try{const t=this.#y[e];t&&this.#h.on(e,t)}catch(e){}this.#h.emit=(e,...t)=>this.#v(e,...t),this.#h.reallyExit=e=>this.#w(e)}}unload(){this.#b&&(this.#b=!1,RT.forEach((e=>{const t=this.#y[e];if(!t)throw new Error("Listener not defined for signal: "+e);try{this.#h.removeListener(e,t)}catch(e){}})),this.#h.emit=this.#m,this.#h.reallyExit=this.#g,this.#d.count-=1)}#w(e){return AT(this.#h)?(this.#h.exitCode=e||0,this.#d.emit("exit",this.#h.exitCode,null),this.#g.call(this.#h,this.#h.exitCode)):0}#v(e,...t){const r=this.#m;if("exit"===e&&AT(this.#h)){"number"==typeof t[0]&&(this.#h.exitCode=t[0]);const n=r.call(this.#h,e,...t);return this.#d.emit("exit",this.#h.exitCode,null),n}return r.call(this.#h,e,...t)}}(PT):new class extends CT{onExit(){return()=>{}}load(){}unload(){}},{onExit:(e,t)=>BT.onExit(e,t),load:()=>BT.load(),unload:()=>BT.unload()});var BT;const $T=(e,t,r)=>{try{const{destination:n,pipeOptions:{from:o,to:i,unpipeSignal:s}={}}=UT(e,t,...r);return{destination:n,destinationStream:Jb(n,i),from:o,unpipeSignal:s}}catch(e){return{destinationError:e}}},UT=(e,t,r,...n)=>{if(Array.isArray(r)){return{destination:t(GT,e)(r,...n),pipeOptions:e}}if("string"==typeof r||r instanceof URL){if(Object.keys(e).length>0)throw new TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).');const[o,i,s]=Of(r,...n);return{destination:t(GT)(o,i,s),pipeOptions:s}}if(ev.has(r)){if(Object.keys(e).length>0)throw new TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:r,pipeOptions:n[0]}}throw new TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${r}`)},GT=({options:e})=>({options:Object.assign(Object.assign({},e),{},{stdin:"pipe",piped:!0})}),WT=(e,t)=>{try{return{sourceStream:Zb(e,t)}}catch(e){return{sourceError:e}}},zT=({sourceStream:e,sourceError:t,destinationStream:r,destinationError:n})=>void 0!==t&&void 0!==n?n:void 0!==n?(ST(e),n):void 0!==t?(wT(r),t):void 0,VT=({error:e,fileDescriptors:t,sourceOptions:r,startTime:n})=>mE({error:e,command:qT,escapedCommand:qT,fileDescriptors:t,options:r,startTime:n,isSync:!1}),qT="source.pipe(destination)",HT=async e=>{const[{status:t,reason:r,value:n=r},{status:o,reason:i,value:s=i}]=await e;if(s.pipedFrom.includes(n)||s.pipedFrom.push(n),"rejected"===o)throw s;if("rejected"===t)throw n;return s},XT=(e,t)=>{const r=JI([e]);return bT(r,t),QT.set(t,r),r},KT=(e,t)=>{const r=QT.get(t);return r.add(e),r},YT=async e=>{try{await E.finished(e,{cleanup:!0,readable:!1,writable:!0})}catch{}QT.delete(e)},QT=new WeakMap,JT=2,ZT=1,ej=(e,t)=>void 0===e?[]:[tj(e,t)],tj=async(e,{sourceStream:t,mergedStream:r,fileDescriptors:n,sourceOptions:o,startTime:i})=>{await u.aborted(e,t),await r.remove(t);const s=new Error("Pipe canceled by `unpipeSignal` option.");throw VT({error:s,fileDescriptors:n,sourceOptions:o,startTime:i})},rj=["destination"],nj=(e,...t)=>{if(Bu(t[0]))return nj.bind(void 0,Object.assign(Object.assign({},e),{},{boundOptions:Object.assign(Object.assign({},e.boundOptions),t[0])}));const r=(({source:e,sourcePromise:t,boundOptions:r,createNested:n},...o)=>{const i=oy(),{destination:s,destinationStream:a,destinationError:c,from:l,unpipeSignal:u}=$T(r,n,o),{sourceStream:f,sourceError:p}=WT(e,l),{options:d,fileDescriptors:h}=ev.get(e);return{sourcePromise:t,sourceStream:f,sourceOptions:d,sourceError:p,destination:s,destinationStream:a,destinationError:c,unpipeSignal:u,fileDescriptors:h,startTime:i}})(e,...t),{destination:n}=r,o=Km(r,rj),i=oj(Object.assign(Object.assign({},o),{},{destination:n}));return i.pipe=nj.bind(void 0,Object.assign(Object.assign({},e),{},{source:n,sourcePromise:i,boundOptions:{}})),i},oj=async({sourcePromise:e,sourceStream:t,sourceOptions:r,sourceError:n,destination:o,destinationStream:i,destinationError:s,unpipeSignal:a,fileDescriptors:c,startTime:l})=>{const u=ij(e,o);(({sourceStream:e,sourceError:t,destinationStream:r,destinationError:n,fileDescriptors:o,sourceOptions:i,startTime:s})=>{const a=zT({sourceStream:e,sourceError:t,destinationStream:r,destinationError:n});if(void 0!==a)throw VT({error:a,fileDescriptors:o,sourceOptions:i,startTime:s})})({sourceStream:t,sourceError:n,destinationStream:i,destinationError:s,fileDescriptors:c,sourceOptions:r,startTime:l});const f=new AbortController;try{const e=((e,t,r)=>{const n=QT.has(t)?KT(e,t):XT(e,t);return lv(e,JT,r.signal),lv(t,ZT,r.signal),YT(t),n})(t,i,f);return await Promise.race([HT(u),...ej(a,{sourceStream:t,mergedStream:e,sourceOptions:r,fileDescriptors:c,startTime:l})])}finally{f.abort()}},ij=(e,t)=>Promise.allSettled([e,t]),sj=({subprocessStdout:e,subprocess:t,binary:r,shouldEncode:n,encoding:o,preserveNewlines:i})=>{const s=new AbortController;return aj(t,s),uj({stream:e,controller:s,binary:r,shouldEncode:!e.readableObjectMode&&n,encoding:o,shouldSplit:!e.readableObjectMode,preserveNewlines:i})},aj=async(e,t)=>{try{await e}catch{}finally{t.abort()}},cj=({stream:e,onStreamEnd:t,lines:r,encoding:n,stripFinalNewline:o,allMixed:i})=>{const s=new AbortController;lj(t,s,e);const a=e.readableObjectMode&&!i;return uj({stream:e,controller:s,binary:"buffer"===n,shouldEncode:!a,encoding:n,shouldSplit:!a&&r,preserveNewlines:!o})},lj=async(e,t,r)=>{try{await e}catch{r.destroy()}finally{t.abort()}},uj=({stream:e,controller:t,binary:r,shouldEncode:n,encoding:o,shouldSplit:i,preserveNewlines:s})=>{const a=y.on(e,"data",{signal:t.signal,highWaterMark:pj,highWatermark:pj});return dj({onStdoutChunk:a,controller:t,binary:r,shouldEncode:n,encoding:o,shouldSplit:i,preserveNewlines:s})},fj=v.getDefaultHighWaterMark(!0),pj=fj,dj=async function*({onStdoutChunk:e,controller:t,binary:r,shouldEncode:n,encoding:o,shouldSplit:i,preserveNewlines:s}){const a=hj({binary:r,shouldEncode:n,encoding:o,shouldSplit:i,preserveNewlines:s});try{for await(const[t]of e)yield*XO(t,a,0)}catch(e){if(!t.signal.aborted)throw e}finally{yield*KO(a)}},hj=({binary:e,shouldEncode:t,encoding:r,shouldSplit:n,preserveNewlines:o})=>[MO(e,r,!t),bO(e,o,!n,{})].filter(Boolean),mj=async({stream:e,onStreamEnd:t,fdNumber:r,encoding:n,buffer:o,maxBuffer:i,lines:s,allMixed:a,stripFinalNewline:c,verboseInfo:l,streamInfo:u})=>{const f=gj({stream:e,onStreamEnd:t,fdNumber:r,encoding:n,allMixed:a,verboseInfo:l,streamInfo:u});if(!o)return void await Promise.all([yj(e),f]);const p=yO(c,r),d=cj({stream:e,onStreamEnd:t,lines:s,encoding:n,stripFinalNewline:p,allMixed:a}),[h]=await Promise.all([bj({stream:e,iterable:d,fdNumber:r,encoding:n,maxBuffer:i,lines:s}),f]);return h},gj=async({stream:e,onStreamEnd:t,fdNumber:r,encoding:n,allMixed:o,verboseInfo:i,streamInfo:{fileDescriptors:s}})=>{if(!iI({stdioItems:s[r]?.stdioItems,encoding:n,verboseInfo:i,fdNumber:r}))return;const a=cj({stream:e,onStreamEnd:t,lines:!0,encoding:n,stripFinalNewline:!0,allMixed:o});await(async(e,t,r,n)=>{for await(const o of e)cI(t)||lI(o,r,n)})(a,e,r,i)},yj=async e=>{await m.setImmediate(),null===e.readableFlowing&&e.resume()},bj=async({stream:e,stream:{readableObjectMode:t},iterable:r,fdNumber:n,encoding:o,maxBuffer:i,lines:s})=>{try{return t||s?await async function(e,t){return Cw(e,qw,t)}(r,{maxBuffer:i}):"buffer"===o?new Uint8Array(await async function(e,t){return Cw(e,tE,t)}(r,{maxBuffer:i})):await async function(e,t){return Cw(e,nE,t)}(r,{maxBuffer:i})}catch(r){return wj((({error:e,stream:t,readableObjectMode:r,lines:n,encoding:o,fdNumber:i})=>{if(!(e instanceof $w))throw e;if("all"===i)return e;const s=oE(r,n,o);throw e.maxBufferInfo={fdNumber:i,unit:s},t.destroy(),e})({error:r,stream:e,readableObjectMode:t,lines:s,encoding:o,fdNumber:n}))}},vj=async e=>{try{return await e}catch(e){return wj(e)}},wj=({bufferedData:e})=>{return t=e,"[object ArrayBuffer]"===Dm.call(t)?new Uint8Array(e):e;var t},Ej=async(e,t,r,{isSameDirection:n,stopOnExit:o=!1}={})=>{const i=Sj(e,r),s=new AbortController;try{await Promise.race([...o?[r.exitPromise]:[],E.finished(e,{cleanup:!0,signal:s.signal})])}catch(e){i.stdinCleanedUp||Tj(e,t,r,n)}finally{s.abort()}},Sj=(e,{originalStreams:[t],subprocess:r})=>{const n={stdinCleanedUp:!1};return e===t&&Oj(e,r,n),n},Oj=(e,t,r)=>{const{_destroy:n}=e;e._destroy=(...o)=>{Ij(t,r),n.call(e,...o)}},Ij=({exitCode:e,signalCode:t},r)=>{null===e&&null===t||(r.stdinCleanedUp=!0)},Tj=(e,t,r,n)=>{if(!jj(e,t,r,n))throw e},jj=(e,t,r,n=!0)=>r.propagating?Aj(e)||Rj(e):(r.propagating=!0,xj(r,t)===n?Aj(e):Rj(e)),xj=({fileDescriptors:e},t)=>"all"!==t&&"input"===e[t].direction,Rj=e=>"ERR_STREAM_PREMATURE_CLOSE"===e?.code,Aj=e=>"EPIPE"===e?.code,Dj=async({stream:e,fdNumber:t,encoding:r,buffer:n,maxBuffer:o,lines:i,allMixed:s,stripFinalNewline:a,verboseInfo:c,streamInfo:l})=>{if(!e)return;const u=Ej(e,t,l);if(xj(l,t))return void await u;const[f]=await Promise.all([mj({stream:e,onStreamEnd:u,fdNumber:t,encoding:r,buffer:n,maxBuffer:o,lines:i,allMixed:s,stripFinalNewline:a,verboseInfo:c,streamInfo:l}),u]);return f},Nj=({stdout:e,stderr:t,all:r},[,n,o])=>{const i=n||o;return i?n?o?{stream:r,buffer:i}:{stream:e,buffer:i}:{stream:t,buffer:i}:{stream:r,buffer:i}},Lj=({all:e,stdout:t,stderr:r})=>e&&t&&r&&t.readableObjectMode!==r.readableObjectMode,kj=(e,t)=>{const r=Zg(e);Xg({type:"ipc",verboseMessage:r,fdNumber:"ipc",verboseInfo:t})},Cj=async({subprocess:e,buffer:t,maxBuffer:r,ipc:n,ipcOutput:o,verboseInfo:i})=>{if(!n)return o;const s=(e=>hg(e,"ipc"))(i),a=pg(t,"ipc"),c=pg(r,"ipc");for await(const t of _I({anyProcess:e,channel:e.channel,isSubprocess:!1,ipc:n,shouldAwait:!1,reference:!0}))a&&(iE(0,o,c),o.push(t)),s&&kj(t,i);return o},Pj=async(e,t)=>(await Promise.allSettled([e]),t),Mj=async({subprocess:e,options:{encoding:t,buffer:r,maxBuffer:n,lines:o,timeoutDuration:i,cancelSignal:s,gracefulCancel:a,forceKillAfterDelay:c,stripFinalNewline:l,ipc:u,ipcInput:f},context:p,verboseInfo:d,fileDescriptors:h,originalStreams:m,onInternalError:g,controller:y})=>{const b=(async(e,t)=>{const[r,n]=await mI(e);return t.isForcefullyTerminated??=!1,[r,n]})(e,p),v={originalStreams:m,fileDescriptors:h,subprocess:e,exitPromise:b,propagating:!1},w=(({subprocess:e,encoding:t,buffer:r,maxBuffer:n,lines:o,stripFinalNewline:i,verboseInfo:s,streamInfo:a})=>e.stdio.map(((e,c)=>Dj({stream:e,fdNumber:c,encoding:t,buffer:r[c],maxBuffer:n[c],lines:o[c],allMixed:!1,stripFinalNewline:i,verboseInfo:s,streamInfo:a}))))({subprocess:e,encoding:t,buffer:r,maxBuffer:n,lines:o,stripFinalNewline:l,verboseInfo:d,streamInfo:v}),E=(({subprocess:e,encoding:t,buffer:r,maxBuffer:n,lines:o,stripFinalNewline:i,verboseInfo:s,streamInfo:a})=>Dj(Object.assign(Object.assign({},Nj(e,r)),{},{fdNumber:"all",encoding:t,maxBuffer:n[1]+n[2],lines:o[1]||o[2],allMixed:Lj(e),stripFinalNewline:i,verboseInfo:s,streamInfo:a})))({subprocess:e,encoding:t,buffer:r,maxBuffer:n,lines:o,stripFinalNewline:l,verboseInfo:d,streamInfo:v}),S=[],O=Cj({subprocess:e,buffer:r,maxBuffer:n,ipc:u,ipcOutput:S,verboseInfo:d}),I=_j(m,e,v),T=Fj(h,v);try{return await Promise.race([Promise.all([{},yI(b),Promise.all(w),E,O,Zv(e,f),...I,...T]),g,Bj(e,y),...Kv(e,i,p,y),...Fb({subprocess:e,cancelSignal:s,gracefulCancel:a,context:p,controller:y}),...qv({subprocess:e,cancelSignal:s,gracefulCancel:a,forceKillAfterDelay:c,context:p,controller:y})])}catch(e){return p.terminationReason??="other",Promise.all([{error:e},b,Promise.all(w.map((e=>vj(e)))),vj(E),Pj(O,S),Promise.allSettled(I),Promise.allSettled(T)])}},_j=(e,t,r)=>e.map(((e,n)=>e===t.stdio[n]?void 0:Ej(e,n,r))),Fj=(e,t)=>e.flatMap((({stdioItems:e},r)=>e.filter((({value:e,stream:t=e})=>bw(t,{checkOpen:!1})&&!Ym(t))).map((({type:e,value:n,stream:o=n})=>Ej(o,r,t,{isSameDirection:YE.has(e),stopOnExit:"native"===e}))))),Bj=async(e,{signal:t})=>{const[r]=await y.once(e,"error",{signal:t});throw r},$j=(e,t,r)=>{const n=e[r];n.has(t)||n.set(t,[]);const o=n.get(t),i=Qb();o.push(i);return{resolve:i.resolve.bind(i),promises:o}},Uj=async({resolve:e,promises:t},r)=>{e();const[n]=await Promise.race([Promise.allSettled([!0,r]),Promise.all([!1,...t])]);return!n},Gj=async e=>{if(void 0!==e)try{await Wj(e)}catch{}},Wj=async e=>{await E.finished(e,{cleanup:!0,readable:!1,writable:!0})},zj=async e=>{await E.finished(e,{cleanup:!0,readable:!0,writable:!1})},Vj=async(e,t)=>{if(await e,t)throw t},qj=(e,t,r)=>{r&&!Rj(r)?e.destroy(r):t&&e.destroy()},Hj=({subprocess:e,concurrentStreams:t,encoding:r},{from:n,binary:o=!0,preserveNewlines:i=!0}={})=>{const s=o||tw.has(r),{subprocessStdout:a,waitReadableDestroy:c}=Xj(e,n,t),{readableEncoding:l,readableObjectMode:f,readableHighWaterMark:p}=Kj(a,s),{read:d,onStdoutDataDone:h}=Yj({subprocessStdout:a,subprocess:e,binary:s,encoding:r,preserveNewlines:i}),m=new v.Readable({read:d,destroy:u.callbackify(Zj.bind(void 0,{subprocessStdout:a,subprocess:e,waitReadableDestroy:c})),highWaterMark:p,objectMode:f,encoding:l});return Jj({subprocessStdout:a,onStdoutDataDone:h,readable:m,subprocess:e}),m},Xj=(e,t,r)=>{const n=Zb(e,t);return{subprocessStdout:n,waitReadableDestroy:$j(r,n,"readableDestroy")}},Kj=({readableEncoding:e,readableObjectMode:t,readableHighWaterMark:r},n)=>n?{readableEncoding:e,readableObjectMode:t,readableHighWaterMark:r}:{readableEncoding:e,readableObjectMode:!0,readableHighWaterMark:fj},Yj=({subprocessStdout:e,subprocess:t,binary:r,encoding:n,preserveNewlines:o})=>{const i=Qb(),s=sj({subprocessStdout:e,subprocess:t,binary:r,shouldEncode:!r,encoding:n,preserveNewlines:o});return{read(){Qj(this,s,i)},onStdoutDataDone:i}},Qj=async(e,t,r)=>{try{const{value:n,done:o}=await t.next();o?r.resolve():e.push(n)}catch{}},Jj=async({subprocessStdout:e,onStdoutDataDone:t,readable:r,subprocess:n,subprocessStdin:o})=>{try{await zj(e),await n,await Gj(o),await t,r.readable&&r.push(null)}catch(e){await Gj(o),ex(r,e)}},Zj=async({subprocessStdout:e,subprocess:t,waitReadableDestroy:r},n)=>{await Uj(r,t)&&(ex(e,n),await Vj(t,n))},ex=(e,t)=>{qj(e,e.readable,t)},tx=({subprocess:e,concurrentStreams:t},{to:r}={})=>{const{subprocessStdin:n,waitWritableFinal:o,waitWritableDestroy:i}=rx(e,r,t),s=new v.Writable(Object.assign(Object.assign({},nx(n,e,o)),{},{destroy:u.callbackify(ax.bind(void 0,{subprocessStdin:n,subprocess:e,waitWritableFinal:o,waitWritableDestroy:i})),highWaterMark:n.writableHighWaterMark,objectMode:n.writableObjectMode}));return sx(n,s),s},rx=(e,t,r)=>{const n=Jb(e,t);return{subprocessStdin:n,waitWritableFinal:$j(r,n,"writableFinal"),waitWritableDestroy:$j(r,n,"writableDestroy")}},nx=(e,t,r)=>({write:ox.bind(void 0,e),final:u.callbackify(ix.bind(void 0,e,t,r))}),ox=(e,t,r,n)=>{e.write(t,r)?n():e.once("drain",n)},ix=async(e,t,r)=>{await Uj(r,t)&&(e.writable&&e.end(),await t)},sx=async(e,t,r)=>{try{await Wj(e),t.writable&&t.end()}catch(e){await(async e=>{if(void 0!==e)try{await zj(e)}catch{}})(r),cx(t,e)}},ax=async({subprocessStdin:e,subprocess:t,waitWritableFinal:r,waitWritableDestroy:n},o)=>{await Uj(r,t),await Uj(n,t)&&(cx(e,o),await Vj(t,o))},cx=(e,t)=>{qj(e,e.writable,t)},lx=({subprocess:e,concurrentStreams:t,encoding:r},{from:n,to:o,binary:i=!0,preserveNewlines:s=!0}={})=>{const a=i||tw.has(r),{subprocessStdout:c,waitReadableDestroy:l}=Xj(e,n,t),{subprocessStdin:f,waitWritableFinal:p,waitWritableDestroy:d}=rx(e,o,t),{readableEncoding:h,readableObjectMode:m,readableHighWaterMark:g}=Kj(c,a),{read:y,onStdoutDataDone:b}=Yj({subprocessStdout:c,subprocess:e,binary:a,encoding:r,preserveNewlines:s}),w=new v.Duplex(Object.assign(Object.assign({read:y},nx(f,e,p)),{},{destroy:u.callbackify(ux.bind(void 0,{subprocessStdout:c,subprocessStdin:f,subprocess:e,waitReadableDestroy:l,waitWritableFinal:p,waitWritableDestroy:d})),readableHighWaterMark:g,writableHighWaterMark:f.writableHighWaterMark,readableObjectMode:m,writableObjectMode:f.writableObjectMode,encoding:h}));return Jj({subprocessStdout:c,onStdoutDataDone:b,readable:w,subprocess:e,subprocessStdin:f}),sx(f,w,c),w},ux=async({subprocessStdout:e,subprocessStdin:t,subprocess:r,waitReadableDestroy:n,waitWritableFinal:o,waitWritableDestroy:i},s)=>{await Promise.all([Zj({subprocessStdout:e,subprocess:r,waitReadableDestroy:n},s),ax({subprocessStdin:t,subprocess:r,waitWritableFinal:o,waitWritableDestroy:i},s)])},fx=(e,t,{from:r,binary:n=!1,preserveNewlines:o=!1}={})=>{const i=n||tw.has(t),s=Zb(e,r),a=sj({subprocessStdout:s,subprocess:e,binary:i,shouldEncode:!0,encoding:t,preserveNewlines:o});return px(a,s,e)},px=async function*(e,t,r){try{yield*e}finally{t.readable&&t.destroy(),await r}},dx=(e,{encoding:t})=>{const r={readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap};e.readable=Hj.bind(void 0,{subprocess:e,concurrentStreams:r,encoding:t}),e.writable=tx.bind(void 0,{subprocess:e,concurrentStreams:r}),e.duplex=lx.bind(void 0,{subprocess:e,concurrentStreams:r,encoding:t}),e.iterable=fx.bind(void 0,e,t),e[Symbol.asyncIterator]=fx.bind(void 0,e,t,{})},hx=(async()=>{})().constructor.prototype,mx=["then","catch","finally"].map((e=>[e,Reflect.getOwnPropertyDescriptor(hx,e)])),gx=["timeout","signal"],yx=(e,t,r,n)=>{const{file:o,commandArguments:i,command:s,escapedCommand:a,startTime:c,verboseInfo:l,options:u,fileDescriptors:f}=bx(e,t,r),{subprocess:p,promise:d}=wx({file:o,commandArguments:i,options:u,startTime:c,verboseInfo:l,command:s,escapedCommand:a,fileDescriptors:f});return p.pipe=nj.bind(void 0,{source:p,sourcePromise:d,boundOptions:{},createNested:n}),((e,t)=>{for(const[r,n]of mx){const o=n.value.bind(t);Reflect.defineProperty(e,r,Object.assign(Object.assign({},n),{},{value:o}))}})(p,d),ev.set(p,{options:u,fileDescriptors:f}),p},bx=(e,t,r)=>{const{command:n,escapedCommand:o,startTime:i,verboseInfo:s}=sy(e,t,r),{file:a,commandArguments:c,options:l}=cw(e,t,r),u=vx(l),f=((e,t)=>JS(QI,e,t,!1))(u,s);return{file:a,commandArguments:c,command:n,escapedCommand:o,startTime:i,verboseInfo:s,options:u,fileDescriptors:f}},vx=e=>{let{timeout:t,signal:r}=e,n=Km(e,gx);if(void 0!==r)throw new TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return Object.assign(Object.assign({},n),{},{timeoutDuration:t})},wx=({file:e,commandArguments:t,options:r,startTime:n,verboseInfo:o,command:i,escapedCommand:s,fileDescriptors:a})=>{let l;try{l=c.spawn(e,t,r)}catch(e){return(({error:e,command:t,escapedCommand:r,fileDescriptors:n,options:o,startTime:i,verboseInfo:s})=>{uO(n);const a=new c.ChildProcess;WI(a,n),Object.assign(a,{readable:VI,writable:qI,duplex:HI});const l=mE({error:e,command:t,escapedCommand:r,fileDescriptors:n,options:o,startTime:i,isSync:!1});return{subprocess:a,promise:XI(l,s,o)}})({error:e,command:i,escapedCommand:s,fileDescriptors:a,options:r,startTime:n,verboseInfo:o})}const u=new AbortController;y.setMaxListeners(Number.POSITIVE_INFINITY,u.signal);const f=[...l.stdio];((e,t,r)=>{const n=new Map;for(const[o,{stdioItems:i,direction:s}]of Object.entries(t)){for(const{stream:t}of i.filter((({type:e})=>YE.has(e))))OT(e,t,s,o);for(const{stream:t}of i.filter((({type:e})=>!YE.has(e))))TT({subprocess:e,stream:t,direction:s,fdNumber:o,pipeGroups:n,controller:r})}for(const[e,t]of n.entries()){const r=1===t.length?t[0]:JI(t);bT(r,e)}})(l,a,u),((e,{cleanup:t,detached:r},{signal:n})=>{if(!t||r)return;const o=MT((()=>{e.kill()}));y.addAbortListener(n,(()=>{o()}))})(l,r,u);const p={},d=Qb();l.kill=Lb.bind(void 0,{kill:l.kill.bind(l),options:r,onInternalError:d,context:p,controller:u}),l.all=(({stdout:e,stderr:t},{all:r})=>r&&(e||t)?JI([e,t].filter(Boolean)):void 0)(l,r),dx(l,r),((e,{ipc:t})=>{Object.assign(e,GI(e,!1,t))})(l,r);return{subprocess:l,promise:Ex({subprocess:l,options:r,startTime:n,verboseInfo:o,fileDescriptors:a,originalStreams:f,command:i,escapedCommand:s,context:p,onInternalError:d,controller:u})}},Ex=async({subprocess:e,options:t,startTime:r,verboseInfo:n,fileDescriptors:o,originalStreams:i,command:s,escapedCommand:a,context:c,onInternalError:l,controller:u})=>{const[f,[p,d],h,m,g]=await Mj({subprocess:e,options:t,context:c,verboseInfo:n,fileDescriptors:o,originalStreams:i,onInternalError:l,controller:u});u.abort(),l.resolve();const y=h.map(((e,r)=>gO(e,t,r))),b=gO(m,t,"all"),v=Sx({errorInfo:f,exitCode:p,signal:d,stdio:y,all:b,ipcOutput:g,context:c,options:t,command:s,escapedCommand:a,startTime:r});return jE(v,n,t)},Sx=({errorInfo:e,exitCode:t,signal:r,stdio:n,all:o,ipcOutput:i,context:s,options:a,command:c,escapedCommand:l,startTime:u})=>"error"in e?gE({error:e.error,command:c,escapedCommand:l,timedOut:"timeout"===s.terminationReason,isCanceled:"cancel"===s.terminationReason||"gracefulCancel"===s.terminationReason,isGracefullyCanceled:"gracefulCancel"===s.terminationReason,isMaxBuffer:e.error instanceof $w,isForcefullyTerminated:s.isForcefullyTerminated,exitCode:t,signal:r,stdio:n,all:o,ipcOutput:i,options:a,startTime:u,isSync:!1}):hE({command:c,escapedCommand:l,stdio:n,all:o,ipcOutput:i,options:a,startTime:u}),Ox=(e,t)=>{const r=Object.fromEntries(Object.entries(t).map((([t,r])=>[t,Ix(t,e[t],r)])));return Object.assign(Object.assign({},e),r)},Ix=(e,t,r)=>Tx.has(e)&&Bu(t)&&Bu(r)?Object.assign(Object.assign({},t),r):r,Tx=new Set(["env",...fg]),jx=(e,t,r,n)=>{const o=(e,t,n)=>jx(e,t,r,n),i=(...i)=>xx({mapArguments:e,deepOptions:r,boundOptions:t,setBoundExeca:n,createNested:o},...i);return void 0!==n&&n(i,o,t),i},xx=({mapArguments:e,deepOptions:t={},boundOptions:r={},setBoundExeca:n,createNested:o},i,...s)=>{if(Bu(i))return o(e,Ox(r,i),n);const{file:a,commandArguments:c,options:l,isSync:u}=Rx({mapArguments:e,firstArgument:i,nextArguments:s,deepOptions:t,boundOptions:r});return u?((e,t,r)=>{const{file:n,commandArguments:o,command:i,escapedCommand:s,startTime:a,verboseInfo:c,options:l,fileDescriptors:u}=OI(e,t,r),f=xI({file:n,commandArguments:o,options:l,command:i,escapedCommand:s,verboseInfo:c,fileDescriptors:u,startTime:a});return jE(f,c,l)})(a,c,l):yx(a,c,l,o)},Rx=({mapArguments:e,firstArgument:t,nextArguments:r,deepOptions:n,boundOptions:o})=>{const i=(s=t,Array.isArray(s)&&Array.isArray(s.raw)?((e,t)=>{let r=[];for(const[n,o]of e.entries())r=Gm({templates:e,expressions:t,tokens:r,index:n,template:o});if(0===r.length)throw new TypeError("Template script must not be empty");const[n,...o]=r;return[n,o,{}]})(t,r):[t,...r]);var s;const[a,c,l]=Of(...i),u=Ox(Ox(n,o),l),{file:f=a,commandArguments:p=c,options:d=u,isSync:h=!1}=e({file:a,commandArguments:c,options:u});return{file:f,commandArguments:p,options:d,isSync:h}},Ax=(e,t)=>{if(t.length>0)throw new TypeError(`The command and its arguments must be passed as a single string: ${e} ${t}.`);const[r,...n]=Dx(e);return{file:r,commandArguments:n}},Dx=e=>{if("string"!=typeof e)throw new TypeError(`The command must be a string: ${String(e)}.`);const t=e.trim();if(""===t)return[];const r=[];for(const e of t.split(Nx)){const t=r.at(-1);t&&t.endsWith("\\")?r[r.length-1]=`${t.slice(0,-1)} ${e}`:r.push(e)}return r},Nx=/ +/g,Lx=({options:e})=>Object.assign(Object.assign({},kx(e)),{},{isSync:!0}),kx=e=>({options:Object.assign(Object.assign({},Cx(e)),e)}),Cx=({input:e,inputFile:t,stdio:r})=>void 0===e&&void 0===t&&void 0===r?{stdin:"inherit"}:{};jx((()=>({})));const Px=jx((()=>({isSync:!0})));jx((({file:e,commandArguments:t})=>Ax(e,t))),jx((({file:e,commandArguments:t})=>Object.assign(Object.assign({},Ax(e,t)),{},{isSync:!0}))),jx((({options:e})=>{if(!1===e.node)throw new TypeError('The "node" option cannot be false with `execaNode()`.');return{options:Object.assign(Object.assign({},e),{},{node:!0})}})),jx((({options:e})=>kx(e)),{},{preferLocal:!0},((e,t,r)=>{e.sync=t(Lx,r),e.s=e.sync})),(()=>{const e=f,t=void 0!==f.channel;Object.assign(Object.assign({},GI(e,true,t)),{},{getCancelSignal:Bv.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:true,ipc:t})})})();const Mx=global,_x=new Proxy(global.target,{set:function(e,t,r){return Reflect.set(...arguments)},get:function(e,t,r){return Ux(`make ${t}`),Reflect.get(...arguments)}}),Fx=["packages","codemods","eslint"],Bx=Mx.which("yarn").stdout,$x=process.execPath;function Ux(...e){console.log.apply(console,e)}function Gx(e,t,n,o=!0,i=!1){Ux(`${e.replaceAll(Bx,"yarn").replaceAll($x,"node")} ${t.join(" ")}`);try{return Px(e,t,{stdio:o?"inherit":void 0,cwd:n&&r.resolve(n),env:process.env}).stdout}catch(r){throw o&&0!==r.exitCode&&(console.error(new Error(`\ncommand: ${e} ${t.join(" ")}\ncode: ${r.exitCode}`)),i||process.exit(r.exitCode)),r}}function Wx(e,t,r,n){return Gx(Bx,e,t,r,n)}function zx(e,t,r){return Gx($x,e,t,r)}function Vx(e,t){const r=process.env;process.env=Object.assign(Object.assign({},r),t),e(),process.env=r}function qx(...e){const r=["--format","codeframe",...e.filter(Boolean)],n=t.readdirSync("packages").filter((e=>t.existsSync(`packages/${e}/package.json`))),o=[];for(let e=0,t=40;eWx(["eslint","packages",...i,...r])),{BABEL_ENV:"test",NODE_OPTIONS:"--max-old-space-size=16384"});else{let e=null;for(const t of o)try{Vx((()=>Wx(["eslint",...t,...r],void 0,void 0,!0)),{BABEL_ENV:"test"})}catch(t){e=t}e&&process.exit(e.exitCode)}}function Hx(e,r,n){const o="./build/"+e.toLowerCase();Mx.rm("-rf",o),Ux("mkdir -p build"),t.mkdirSync("build",{recursive:!0}),Gx("git",["clone","--filter=blob:none","--sparse","--single-branch","--shallow-since='2 years ago'",r,o]),Gx("git",["sparse-checkout","set",...n],o),Gx("git",["checkout","-q",function(e){const r=t.readFileSync("./Makefile","utf8").match(new RegExp(`${e}_COMMIT = (\\w{40})`))[1];if(!r)throw new Error(`Could not find ${e}_COMMIT in Makefile`);return r}(e)],o)}function Xx(){const e=JSON.parse(t.readFileSync("./package.json","utf8")).version_babel8;return Fx.forEach((r=>{t.readdirSync(r).forEach((n=>{const o=`${r}/${n}/package.json`;if(t.existsSync(o)){const r=JSON.parse(t.readFileSync(o,"utf8"));r.peerDependencies?.["@babel/core"]&&(r.peerDependencies["@babel/core"]=`^${e}`);const i=r.conditions?.BABEL_8_BREAKING[0];i?.peerDependencies?.["@babel/core"]&&(i.peerDependencies["@babel/core"]=`^${e}`),"babel-eslint-plugin"===n&&(i.peerDependencies["@babel/eslint-parser"]=`^${e}`),t.writeFileSync(o,JSON.stringify(r,null,2)+"\n")}}))})),Vx((()=>Wx(["install"])),{YARN_ENABLE_IMMUTABLE_INSTALLS:!1}),e}Mx.config.verbose=!0,_x["clean-all"]=function(){Mx.rm("-rf",["package-lock.json",".changelog"]),Fx.forEach((e=>{Mx.rm("-rf",`${e}/*/test/tmp`),Mx.rm("-rf",`${e}/*/package-lock.json`)})),_x.clean(),_x["clean-lib"](),_x["clean-node-modules"]()},_x["clean-node-modules"]=function(){Mx.rm("-rf","node_modules"),Fx.forEach((e=>{Mx.rm("-rf",`${e}/*/node_modules`)}))},_x.clean=function(){_x["test-clean"](),Mx.rm("-rf",[".npmrc","coverage","packages/*/npm-debug*","node_modules/.cache"])},_x["test-clean"]=function(){Fx.forEach((e=>{Mx.rm("-rf",`${e}/*/test/tmp`),Mx.rm("-rf",`${e}/*/test-fixtures.json`)}))},_x["clean-lib"]=function(){Mx.rm("-rf",Fx.map((e=>`${e}/*/lib`))),zx(["scripts/set-module-type.js"])},_x["clean-runtime-helpers"]=function(){Mx.rm("-rf",["packages/babel-runtime/helpers/**/*.js","packages/babel-runtime-corejs2/helpers/**/*.js","packages/babel-runtime-corejs3/helpers/**/*.js","packages/babel-runtime/helpers/**/*.mjs","packages/babel-runtime-corejs2/helpers/**/*.mjs","packages/babel-runtime-corejs3/helpers/**/*.mjs","packages/babel-runtime-corejs2/core-js","packages/babel-runtime-corejs3/core-js","packages/babel-runtime-corejs3/core-js-stable"])},_x["use-cjs"]=function(){zx(["scripts/set-module-type.js","commonjs"]),_x.bootstrap()},_x["use-esm"]=function(){zx(["scripts/set-module-type.js","module"]),_x.bootstrap()},_x["bootstrap-only"]=function(){_x["clean-all"](),Wx(["install"])},_x.bootstrap=function(){_x["bootstrap-only"](),_x["generate-tsconfig"](),_x.build()},_x.build=function(){_x["build-no-bundle"](),"true"!==process.env.BABEL_COVERAGE&&_x["build-standalone"]()},_x["build-standalone"]=function(){Wx(["gulp","build-babel-standalone"])},_x["build-bundle"]=function(){_x.clean(),_x["clean-lib"](),zx(["scripts/set-module-type.js"]),Wx(["gulp","build"]),_x["build-dist"]()},_x["build-no-bundle"]=function(){_x.clean(),_x["clean-lib"](),zx(["scripts/set-module-type.js"]),Vx((()=>{Wx(["gulp","build-dev"])}),{BABEL_ENV:"development"}),_x["build-dist"]()},_x["build-flow-typings"]=function(){t.writeFileSync("packages/babel-types/lib/index.js.flow",zx(["packages/babel-types/scripts/generators/flow.js"],void 0,!1))},_x["build-dist"]=function(){_x["build-plugin-transform-runtime-dist"]()},_x["build-plugin-transform-runtime-dist"]=function(){zx(["scripts/build-dist.js"],"packages/babel-plugin-transform-runtime")},_x.prepublish=function(){process.env.BABEL_8_BREAKING?zx(["scripts/set-module-type.js","module"]):zx(["scripts/set-module-type.js","commonjs"]),_x["bootstrap-only"](),Vx((()=>{_x["prepublish-build"](),_x.test()}),{IS_PUBLISH:"true"}),zx(["scripts/set-module-type.js","clean"])},_x["prepublish-build"]=function(){_x["clean-lib"](),_x["clean-runtime-helpers"](),zx(["scripts/generators/npm-ignore.js"]),Vx((()=>{_x["build-bundle"]()}),{NODE_ENV:"production",BABEL_ENV:"production",STRIP_BABEL_8_FLAG:"true"}),Vx((()=>{_x["prepublish-build-standalone"](),_x["clone-license"](),_x["prepublish-prepare-dts"](),_x["build-flow-typings"]()}),{NODE_ENV:"production",STRIP_BABEL_8_FLAG:"true"})},_x["prepublish-ts-build"]=function(){_x["clean-lib"](),_x["clean-runtime-helpers"](),zx(["scripts/generators/npm-ignore.js"]),Vx((()=>{_x["build-bundle"](),_x["prepublish-build-standalone"](),_x["clone-license"]()}),{NODE_ENV:"production",BABEL_ENV:"production",STRIP_BABEL_8_FLAG:"true"}),Vx((()=>{Mx.rm("-rf",Fx.map((e=>`${e}/*/lib`))),Wx(["gulp","build-babel"]),Wx(["gulp","copy-dts-to-lib"])}),{NODE_ENV:"production",BABEL_ENV:"production",STRIP_BABEL_8_FLAG:"true",PRESERVE_TYPESCRIPT:"true"})},_x["prepublish-build-standalone"]=function(){Vx((()=>{_x["build-standalone"]()}),{BABEL_ENV:"production",IS_PUBLISH:"true"})},_x["prepublish-prepare-dts"]=function(){_x["clean-ts"](),_x.tscheck(),_x["prepublish-prepare-dts-no-clean"]()},_x["prepublish-prepare-dts-no-clean"]=function(){Wx(["gulp","bundle-dts"]),_x["build-typescript-legacy-typings"](),Wx(["tsc","-p","tsconfig.dts-bundles.json"])},_x.tscheck=function(){_x["generate-tsconfig"](),zx(["scripts/parallel-tsc/tsc.js","."]),_x["tscheck-helpers"]()},_x["tscheck-helpers"]=function(){Wx(["tsc","-p","./packages/babel-helpers/src/helpers/tsconfig.json"])},_x["clean-ts"]=function(){Mx.rm("-rf","tsconfig.tsbuildinfo"),Mx.rm("-rf","*/*/tsconfig.tsbuildinfo"),Mx.rm("-rf","dts")},_x["generate-tsconfig"]=function(){zx(["scripts/generators/tsconfig.js"]),zx(["scripts/generators/archived-libs-typings.js"])},_x["generate-type-helpers"]=function(){Wx(["gulp","generate-type-helpers"])},_x["build-typescript-legacy-typings"]=function(){t.writeFileSync("packages/babel-types/lib/index-legacy.d.ts",zx(["packages/babel-types/scripts/generators/typescript-legacy.js"],void 0,!1))},_x["clone-license"]=function(){zx(["scripts/clone-license.js"])},_x.lint=function(){Vx((()=>_x.tscheck()),{TSCHECK_SILENT:"true"}),qx(),_x["lint-prettier"]()},_x["lint-ci"]=function(){_x.tscheck(),qx(),_x["lint-prettier"](),_x["prepublish-prepare-dts-no-clean"]()},_x["lint-prettier"]=function(){Wx(["prettier",".","--check"])},_x.fix=function(){_x["fix-js"](),_x["fix-prettier"]()},_x["fix-js"]=function(){Vx((()=>_x.tscheck()),{TSCHECK_SILENT:"true"}),qx("--fix")},_x["fix-prettier"]=function(){Wx(["prettier",".","--write"])},_x.watch=function(){_x["build-no-bundle"](),Vx((()=>{Wx(["gulp","watch"])}),{BABEL_ENV:"development",WATCH_SKIP_BUILD:"true"})},_x.test=function(){_x.lint(),_x["test-only"]()},_x["test-only"]=function(e=[]){Wx(["jest",...e])},_x["test-cov"]=function(){_x.build(),Vx((()=>{Wx(["c8","jest"])}),{BABEL_ENV:"test",BABEL_COVERAGE:"true"})},_x["bootstrap-test262"]=function(){Hx("TEST262","https://github.com/tc39/test262.git",["test","harness"])},_x["bootstrap-typescript"]=function(){Hx("TYPESCRIPT","https://github.com/microsoft/TypeScript.git",["tests"])},_x["bootstrap-flow"]=function(){Hx("FLOW","https://github.com/facebook/flow.git",["src/parser/test/flow"])},_x["new-version-checklist"]=function(){},_x["new-version"]=function(){_x["new-version-checklist"](),Gx("git",["pull","--rebase"]),Wx(["release-tool","version","-f","@babel/standalone"])},_x["new-babel-8-version"]=function(){Gx("git",["pull","--rebase"]);const e=JSON.parse(t.readFileSync("./package.json","utf8")),r=Fu.inc(e.version_babel8,"prerelease");return e.version_babel8=r,t.writeFileSync("./package.json",JSON.stringify(e,null,2)+"\n"),Gx("git",["add","./package.json"]),Gx("git",["commit","-m","Bump Babel 8 version to "+r]),Gx("git",["tag",`v${r}`,"-m",`v${r}`]),r},_x["new-babel-8-version-create-commit-ci"]=function(){Wx(["release-tool","version",Xx(),"--all","--tag-version-prefix","tmp.v","--yes"])},_x["new-babel-8-version-create-commit"]=function(){const e=Xx();Gx("git",["checkout","-b",`release/temp/v${e}`]),Wx(["release-tool","version",e,"--all","--tag-version-prefix","tmp.v"]),console.log("Run `BABEL_8_BREAKING=true make publish` to finish publishing")}; diff --git a/Makefile.source.mjs b/Makefile.source.mjs index 74c216473d40..0d36e279a482 100644 --- a/Makefile.source.mjs +++ b/Makefile.source.mjs @@ -282,6 +282,45 @@ target["prepublish-build"] = function () { ); }; +target["prepublish-ts-build"] = function () { + target["clean-lib"](); + target["clean-runtime-helpers"](); + + node(["scripts/generators/npm-ignore.js"]); + + env( + () => { + target["build-bundle"](); + target["prepublish-build-standalone"](); + target["clone-license"](); + }, + { + NODE_ENV: "production", + BABEL_ENV: "production", + STRIP_BABEL_8_FLAG: "true", + } + ); + + env( + () => { + // After that everythins is built, re-compile + // /src/ to /lib/ preserving TypeScript + shell.rm( + "-rf", + SOURCES.map(source => `${source}/*/lib`) + ); + yarn(["gulp", "build-babel"]); + yarn(["gulp", "copy-dts-to-lib"]); + }, + { + NODE_ENV: "production", + BABEL_ENV: "production", + STRIP_BABEL_8_FLAG: "true", + PRESERVE_TYPESCRIPT: "true", + } + ); +}; + target["prepublish-build-standalone"] = function () { env( () => { diff --git a/babel.config.js b/babel.config.js index 08b66c93ce94..5cb2d06c2ca3 100644 --- a/babel.config.js +++ b/babel.config.js @@ -81,7 +81,7 @@ module.exports = function (api) { let targets = {}; let convertESM = outputType === "script"; - let replaceTSImportExtension = true; + let replaceTSImportExtension = !bool(process.env.PRESERVE_TYPESCRIPT); let ignoreLib = true; let needsPolyfillsForOldNode = false; @@ -163,7 +163,11 @@ module.exports = function (api) { // other random files in Babel's codebase, so we use script as the default, // and then mark actual modules as modules farther down. sourceType: "script", - comments: false, + + shouldPrintComment(comment) { + return /@__PURE__|@license|@preserve|@ts-self-types/.test(comment); + }, + ignore: [ // These may not be strictly necessary with the newly-limited scope of // babelrc searching, but including them for now because we had them @@ -180,9 +184,13 @@ module.exports = function (api) { presets: [ // presets are applied from right to left ["@babel/env", envOpts], - ["@babel/preset-typescript", presetTsOpts], - ], + bool(process.env.PRESERVE_TYPESCRIPT) + ? null + : ["@babel/preset-typescript", presetTsOpts], + ].filter(Boolean), plugins: [ + "@babel/plugin-syntax-typescript", + ["@babel/transform-object-rest-spread", { useBuiltIns: true }], convertESM ? "@babel/transform-export-namespace-from" : null, diff --git a/package.json b/package.json index ca4915dbaaaf..b2963ae424e8 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,7 @@ "@babel/eslint-parser": "workspace:^", "@babel/eslint-plugin-development": "workspace:^", "@babel/eslint-plugin-development-internal": "workspace:^", + "@babel/plugin-syntax-typescript": "8.0.0-alpha.16", "@babel/plugin-transform-dynamic-import": "8.0.0-alpha.16", "@babel/plugin-transform-export-namespace-from": "8.0.0-alpha.16", "@babel/plugin-transform-json-modules": "8.0.0-alpha.16", diff --git a/packages/babel-core/src/config/files/module-types.ts b/packages/babel-core/src/config/files/module-types.ts index 1cecfe9742a0..a97b9da9e57b 100644 --- a/packages/babel-core/src/config/files/module-types.ts +++ b/packages/babel-core/src/config/files/module-types.ts @@ -242,9 +242,7 @@ You are using a ${ext} config file, but Babel only supports transpiling .cts con filename, ); } catch (error) { - // TODO(Babel 8): Add this as an optional peer dependency - // eslint-disable-next-line import/no-extraneous-dependencies - const packageJson = require("@babel/preset-typescript/package.json"); + const packageJson = require("@babel/preset-typescript/package.json" + ""); if (semver.lt(packageJson.version, "7.21.4")) { console.error( "`.cts` configuration file failed to load, please try to update `@babel/preset-typescript`.", @@ -267,8 +265,7 @@ You are using a ${ext} config file, but Babel only supports transpiling .cts con function getTSPreset(filepath: string) { try { - // eslint-disable-next-line import/no-extraneous-dependencies - return require("@babel/preset-typescript"); + return require("@babel/preset-typescript" + ""); } catch (error) { if (error.code !== "MODULE_NOT_FOUND") throw error; diff --git a/packages/babel-helper-compilation-targets/src/index.ts b/packages/babel-helper-compilation-targets/src/index.ts index 151d8ecad2d8..23422ee3847d 100644 --- a/packages/babel-helper-compilation-targets/src/index.ts +++ b/packages/babel-helper-compilation-targets/src/index.ts @@ -20,7 +20,7 @@ import type { Browsers, BrowserslistBrowserName, TargetsTuple, -} from "./types.ts"; +} from "./types.d.ts"; export type { Target, Targets, InputTargets }; diff --git a/packages/babel-preset-env/src/index.ts b/packages/babel-preset-env/src/index.ts index 9c9c1cc3e548..1337f4d14e2a 100644 --- a/packages/babel-preset-env/src/index.ts +++ b/packages/babel-preset-env/src/index.ts @@ -35,7 +35,7 @@ import type { Targets, InputTargets } from "@babel/helper-compilation-targets"; import availablePlugins from "./available-plugins.ts"; import { declarePreset } from "@babel/helper-plugin-utils"; -import type { BuiltInsOption, ModuleOption, Options } from "./types.ts"; +import type { BuiltInsOption, ModuleOption, Options } from "./types.d.ts"; export type { Options }; // TODO: Remove in Babel 8 diff --git a/scripts/generators/deno-json.js b/scripts/generators/deno-json.js new file mode 100644 index 000000000000..18ee9c3d721c --- /dev/null +++ b/scripts/generators/deno-json.js @@ -0,0 +1,126 @@ +import { glob } from "glob"; +import { repoRoot } from "$repo-utils"; +import { existsSync, readFileSync, writeFileSync } from "fs"; +import path from "path"; + +const packages = glob + .sync("./packages/*", { + cwd: repoRoot, + absolute: true, + }) + .filter(packageDir => { + return existsSync(path.join(packageDir, "package.json")); + }); + +const allPackages = []; +const babelVersion = `0.0.8-${ + JSON.parse(readFileSync(path.join(repoRoot, "package.json"), "utf8")) + .version_babel8 +}`; + +for (const packageDir of packages) { + if ( + packageDir.includes("babel-runtime-corejs2") || + packageDir.includes("babel-cli") || + packageDir.includes("babel-node") || + packageDir.includes("babel-register") + ) { + continue; + } + + const packageJson = JSON.parse( + readFileSync(path.join(packageDir, "package.json"), "utf8") + ); + + if (packageJson.private) { + continue; + } + + allPackages.push(packageDir); + + const imports = {}; + takeDeps(imports, packageJson.dependencies); + takeDeps(imports, packageJson.peerDependencies); + + const denoJson = { + name: jsrify(packageJson.name), + version: babelVersion, + exports: objectMap(packageJson.exports, (values, key) => { + if (!Array.isArray(values)) values = [values]; + for (let value of values) { + if (typeof value === "object") { + value = value.default; + } + if (typeof value === "string") { + if (value === "./regenerator/*.js") return undefined; + if (value === "./regenerator/") return undefined; + if (value === "./core-js/*.js") return undefined; + if (value === "./core-js/") return undefined; + if (value === "./core-js-stable/*.js") return undefined; + if (value === "./core-js-stable/") return undefined; + if (value.startsWith("./lib")) { + return value.replace(/\.([mc]?)js$/, ".$1ts"); + } + return value; + } + } + throw new Error(`Unexpected exports value for ${key} in ${packageDir}`); + }), + imports, + publish: { + exclude: [ + "test/", + "!lib/", + packageDir.includes("babel-runtime") ? "!helpers/" : null, + packageDir.includes("babel-runtime") ? "!core-js/" : null, + packageDir.includes("babel-runtime") ? "!core-js-stable/" : null, + packageDir.includes("babel-standalone") ? "!babel.js/" : null, + packageDir.includes("babel-standalone") ? "!babel.min.js/" : null, + ].filter(Boolean), + }, + }; + + writeFileSync( + path.join(packageDir, "deno.json"), + JSON.stringify(denoJson, null, 2) + "\n" + ); +} + +writeFileSync( + path.join(repoRoot, "deno.json"), + JSON.stringify({ workspace: allPackages }, null, 2) + "\n" +); + +function objectMap(obj, cb) { + return Object.fromEntries(Object.entries(obj).map(([k, v]) => [k, cb(v, k)])); +} + +function jsrify(npmName) { + // prettier-ignore + const [/* scope */ , name] = npmName.split("/"); + return `@babel-test-6ae45912/${name.slice(0, 58)}`; +} + +function takeDeps(imports, dependencies) { + if (!dependencies) return; + + // eslint-disable-next-line prefer-const + for (let [name, version] of Object.entries(dependencies)) { + if (version.startsWith("condition:")) { + const match = + /condition:\s*\w+\s*\?\s*(?:(?[\w.^~*]+)\s*)?:\s*(?:[\w.^~*]+\s*)?/.exec( + version + ); + if (!match) { + throw new Error(`Invalid condition: ${version}`); + } + if (!match.groups.ifTrue) continue; + version = match.groups.ifTrue; + } + if (version.startsWith("workspace:")) { + imports[name] = `jsr:${jsrify(name)}@${babelVersion}`; + } else { + imports[name] = `npm:${name}@${version}`; + } + } +} diff --git a/yarn.lock b/yarn.lock index 8a2a21f626e8..2c9b576bae1c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2044,6 +2044,17 @@ __metadata: languageName: node linkType: hard +"@babel/plugin-syntax-typescript@npm:8.0.0-alpha.16, @babel/plugin-syntax-typescript@npm:^8.0.0-alpha.16": + version: 8.0.0-alpha.16 + resolution: "@babel/plugin-syntax-typescript@npm:8.0.0-alpha.16" + dependencies: + "@babel/helper-plugin-utils": "npm:^8.0.0-alpha.16" + peerDependencies: + "@babel/core": ^8.0.0-alpha.16 + checksum: 10/067cd1b7d31f0741ff966979dda96c010dbef37d4b34a07bbe71a9208094c8f36604acaee98ec0c657c5dca6b2735012cdd910662a2ddba5fcd37d433d1a7401 + languageName: node + linkType: hard + "@babel/plugin-syntax-typescript@npm:^7.7.2": version: 7.22.5 resolution: "@babel/plugin-syntax-typescript@npm:7.22.5" @@ -2055,17 +2066,6 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-syntax-typescript@npm:^8.0.0-alpha.16": - version: 8.0.0-alpha.16 - resolution: "@babel/plugin-syntax-typescript@npm:8.0.0-alpha.16" - dependencies: - "@babel/helper-plugin-utils": "npm:^8.0.0-alpha.16" - peerDependencies: - "@babel/core": ^8.0.0-alpha.16 - checksum: 10/067cd1b7d31f0741ff966979dda96c010dbef37d4b34a07bbe71a9208094c8f36604acaee98ec0c657c5dca6b2735012cdd910662a2ddba5fcd37d433d1a7401 - languageName: node - linkType: hard - "@babel/plugin-syntax-typescript@workspace:^, @babel/plugin-syntax-typescript@workspace:packages/babel-plugin-syntax-typescript": version: 0.0.0-use.local resolution: "@babel/plugin-syntax-typescript@workspace:packages/babel-plugin-syntax-typescript" @@ -6817,6 +6817,7 @@ __metadata: "@babel/eslint-parser": "workspace:^" "@babel/eslint-plugin-development": "workspace:^" "@babel/eslint-plugin-development-internal": "workspace:^" + "@babel/plugin-syntax-typescript": "npm:8.0.0-alpha.16" "@babel/plugin-transform-dynamic-import": "npm:8.0.0-alpha.16" "@babel/plugin-transform-export-namespace-from": "npm:8.0.0-alpha.16" "@babel/plugin-transform-json-modules": "npm:8.0.0-alpha.16"