@turbo/workspaces 2.6.4-canary.1 → 2.6.4-canary.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
- "use strict";var gl=Object.create;var Pr=Object.defineProperty;var El=Object.getOwnPropertyDescriptor;var yl=Object.getOwnPropertyNames;var Al=Object.getPrototypeOf,Cl=Object.prototype.hasOwnProperty;var wl=(r,e)=>()=>(r&&(e=r(r=0)),e);var E=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),Fl=(r,e)=>{for(var t in e)Pr(r,t,{get:e[t],enumerable:!0})},no=(r,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of yl(e))!Cl.call(r,i)&&i!==t&&Pr(r,i,{get:()=>e[i],enumerable:!(s=El(e,i))||s.enumerable});return r};var w=(r,e,t)=>(t=r!=null?gl(Al(r)):{},no(e||!r||!r.__esModule?Pr(t,"default",{value:r,enumerable:!0}):t,r)),bl=r=>no(Pr({},"__esModule",{value:!0}),r);var u=wl(()=>{});var oo=E((Sm,Fe)=>{u();function Qs(r){return Fe.exports=Qs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Fe.exports.__esModule=!0,Fe.exports.default=Fe.exports,Qs(r)}Fe.exports=Qs,Fe.exports.__esModule=!0,Fe.exports.default=Fe.exports});var co=E((km,be)=>{u();var uo=oo().default;function ao(){"use strict";be.exports=ao=function(){return e},be.exports.__esModule=!0,be.exports.default=be.exports;var r,e={},t=Object.prototype,s=t.hasOwnProperty,i=Object.defineProperty||function(g,p,d){g[p]=d.value},n=typeof Symbol=="function"?Symbol:{},o=n.iterator||"@@iterator",a=n.asyncIterator||"@@asyncIterator",l=n.toStringTag||"@@toStringTag";function c(g,p,d){return Object.defineProperty(g,p,{value:d,enumerable:!0,configurable:!0,writable:!0}),g[p]}try{c({},"")}catch{c=function(d,y,F){return d[y]=F}}function h(g,p,d,y){var F=p&&p.prototype instanceof x?p:x,C=Object.create(F.prototype),P=new Zs(y||[]);return i(C,"_invoke",{value:dl(g,d,P)}),C}function m(g,p,d){try{return{type:"normal",arg:g.call(p,d)}}catch(y){return{type:"throw",arg:y}}}e.wrap=h;var D="suspendedStart",A="suspendedYield",b="executing",T="completed",S={};function x(){}function ut(){}function de(){}var Vs={};c(Vs,o,function(){return this});var Ys=Object.getPrototypeOf,Or=Ys&&Ys(Ys(Xs([])));Or&&Or!==t&&s.call(Or,o)&&(Vs=Or);var vt=de.prototype=x.prototype=Object.create(Vs);function so(g){["next","throw","return"].forEach(function(p){c(g,p,function(d){return this._invoke(p,d)})})}function Tr(g,p){function d(F,C,P,G){var H=m(g[F],g,C);if(H.type!=="throw"){var at=H.arg,$e=at.value;return $e&&uo($e)=="object"&&s.call($e,"__await")?p.resolve($e.__await).then(function(ct){d("next",ct,P,G)},function(ct){d("throw",ct,P,G)}):p.resolve($e).then(function(ct){at.value=ct,P(at)},function(ct){return d("throw",ct,P,G)})}G(H.arg)}var y;i(this,"_invoke",{value:function(C,P){function G(){return new p(function(H,at){d(C,P,H,at)})}return y=y?y.then(G,G):G()}})}function dl(g,p,d){var y=D;return function(F,C){if(y===b)throw new Error("Generator is already running");if(y===T){if(F==="throw")throw C;return{value:r,done:!0}}for(d.method=F,d.arg=C;;){var P=d.delegate;if(P){var G=io(P,d);if(G){if(G===S)continue;return G}}if(d.method==="next")d.sent=d._sent=d.arg;else if(d.method==="throw"){if(y===D)throw y=T,d.arg;d.dispatchException(d.arg)}else d.method==="return"&&d.abrupt("return",d.arg);y=b;var H=m(g,p,d);if(H.type==="normal"){if(y=d.done?T:A,H.arg===S)continue;return{value:H.arg,done:d.done}}H.type==="throw"&&(y=T,d.method="throw",d.arg=H.arg)}}}function io(g,p){var d=p.method,y=g.iterator[d];if(y===r)return p.delegate=null,d==="throw"&&g.iterator.return&&(p.method="return",p.arg=r,io(g,p),p.method==="throw")||d!=="return"&&(p.method="throw",p.arg=new TypeError("The iterator does not provide a '"+d+"' method")),S;var F=m(y,g.iterator,p.arg);if(F.type==="throw")return p.method="throw",p.arg=F.arg,p.delegate=null,S;var C=F.arg;return C?C.done?(p[g.resultName]=C.value,p.next=g.nextLoc,p.method!=="return"&&(p.method="next",p.arg=r),p.delegate=null,S):C:(p.method="throw",p.arg=new TypeError("iterator result is not an object"),p.delegate=null,S)}function Dl(g){var p={tryLoc:g[0]};1 in g&&(p.catchLoc=g[1]),2 in g&&(p.finallyLoc=g[2],p.afterLoc=g[3]),this.tryEntries.push(p)}function Ks(g){var p=g.completion||{};p.type="normal",delete p.arg,g.completion=p}function Zs(g){this.tryEntries=[{tryLoc:"root"}],g.forEach(Dl,this),this.reset(!0)}function Xs(g){if(g||g===""){var p=g[o];if(p)return p.call(g);if(typeof g.next=="function")return g;if(!isNaN(g.length)){var d=-1,y=function F(){for(;++d<g.length;)if(s.call(g,d))return F.value=g[d],F.done=!1,F;return F.value=r,F.done=!0,F};return y.next=y}}throw new TypeError(uo(g)+" is not iterable")}return ut.prototype=de,i(vt,"constructor",{value:de,configurable:!0}),i(de,"constructor",{value:ut,configurable:!0}),ut.displayName=c(de,l,"GeneratorFunction"),e.isGeneratorFunction=function(g){var p=typeof g=="function"&&g.constructor;return!!p&&(p===ut||(p.displayName||p.name)==="GeneratorFunction")},e.mark=function(g){return Object.setPrototypeOf?Object.setPrototypeOf(g,de):(g.__proto__=de,c(g,l,"GeneratorFunction")),g.prototype=Object.create(vt),g},e.awrap=function(g){return{__await:g}},so(Tr.prototype),c(Tr.prototype,a,function(){return this}),e.AsyncIterator=Tr,e.async=function(g,p,d,y,F){F===void 0&&(F=Promise);var C=new Tr(h(g,p,d,y),F);return e.isGeneratorFunction(p)?C:C.next().then(function(P){return P.done?P.value:C.next()})},so(vt),c(vt,l,"Generator"),c(vt,o,function(){return this}),c(vt,"toString",function(){return"[object Generator]"}),e.keys=function(g){var p=Object(g),d=[];for(var y in p)d.push(y);return d.reverse(),function F(){for(;d.length;){var C=d.pop();if(C in p)return F.value=C,F.done=!1,F}return F.done=!0,F}},e.values=Xs,Zs.prototype={constructor:Zs,reset:function(p){if(this.prev=0,this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(Ks),!p)for(var d in this)d.charAt(0)==="t"&&s.call(this,d)&&!isNaN(+d.slice(1))&&(this[d]=r)},stop:function(){this.done=!0;var p=this.tryEntries[0].completion;if(p.type==="throw")throw p.arg;return this.rval},dispatchException:function(p){if(this.done)throw p;var d=this;function y(at,$e){return P.type="throw",P.arg=p,d.next=at,$e&&(d.method="next",d.arg=r),!!$e}for(var F=this.tryEntries.length-1;F>=0;--F){var C=this.tryEntries[F],P=C.completion;if(C.tryLoc==="root")return y("end");if(C.tryLoc<=this.prev){var G=s.call(C,"catchLoc"),H=s.call(C,"finallyLoc");if(G&&H){if(this.prev<C.catchLoc)return y(C.catchLoc,!0);if(this.prev<C.finallyLoc)return y(C.finallyLoc)}else if(G){if(this.prev<C.catchLoc)return y(C.catchLoc,!0)}else{if(!H)throw new Error("try statement without catch or finally");if(this.prev<C.finallyLoc)return y(C.finallyLoc)}}}},abrupt:function(p,d){for(var y=this.tryEntries.length-1;y>=0;--y){var F=this.tryEntries[y];if(F.tryLoc<=this.prev&&s.call(F,"finallyLoc")&&this.prev<F.finallyLoc){var C=F;break}}C&&(p==="break"||p==="continue")&&C.tryLoc<=d&&d<=C.finallyLoc&&(C=null);var P=C?C.completion:{};return P.type=p,P.arg=d,C?(this.method="next",this.next=C.finallyLoc,S):this.complete(P)},complete:function(p,d){if(p.type==="throw")throw p.arg;return p.type==="break"||p.type==="continue"?this.next=p.arg:p.type==="return"?(this.rval=this.arg=p.arg,this.method="return",this.next="end"):p.type==="normal"&&d&&(this.next=d),S},finish:function(p){for(var d=this.tryEntries.length-1;d>=0;--d){var y=this.tryEntries[d];if(y.finallyLoc===p)return this.complete(y.completion,y.afterLoc),Ks(y),S}},catch:function(p){for(var d=this.tryEntries.length-1;d>=0;--d){var y=this.tryEntries[d];if(y.tryLoc===p){var F=y.completion;if(F.type==="throw"){var C=F.arg;Ks(y)}return C}}throw new Error("illegal catch attempt")},delegateYield:function(p,d,y){return this.delegate={iterator:Xs(p),resultName:d,nextLoc:y},this.method==="next"&&(this.arg=r),S}},e}be.exports=ao,be.exports.__esModule=!0,be.exports.default=be.exports});var ho=E((_m,lo)=>{u();var Nr=co()();lo.exports=Nr;try{regeneratorRuntime=Nr}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=Nr:Function("r","regeneratorRuntime = r")(Nr)}});var po=E((Ym,oi)=>{"use strict";u();var fo=(r,...e)=>new Promise(t=>{t(r(...e))});oi.exports=fo;oi.exports.default=fo});var Do=E((Km,ui)=>{"use strict";u();var Sl=po(),mo=r=>{if(!((Number.isInteger(r)||r===1/0)&&r>0))return Promise.reject(new TypeError("Expected `concurrency` to be a number from 1 and up"));let e=[],t=0,s=()=>{t--,e.length>0&&e.shift()()},i=(a,l,...c)=>{t++;let h=Sl(a,...c);l(h),h.then(s,s)},n=(a,l,...c)=>{t<r?i(a,l,...c):e.push(i.bind(null,a,l,...c))},o=(a,...l)=>new Promise(c=>n(a,c,...l));return Object.defineProperties(o,{activeCount:{get:()=>t},pendingCount:{get:()=>e.length},clearQueue:{value:()=>{e.length=0}}}),o};ui.exports=mo;ui.exports.default=mo});var yo=E((Zm,ai)=>{"use strict";u();var go=Do(),Lr=class extends Error{constructor(e){super(),this.value=e}},kl=async(r,e)=>e(await r),_l=async r=>{let e=await Promise.all(r);if(e[1]===!0)throw new Lr(e[0]);return!1},Eo=async(r,e,t)=>{t={concurrency:1/0,preserveOrder:!0,...t};let s=go(t.concurrency),i=[...r].map(o=>[o,s(kl,o,e)]),n=go(t.preserveOrder?1:1/0);try{await Promise.all(i.map(o=>n(_l,o)))}catch(o){if(o instanceof Lr)return o.value;throw o}};ai.exports=Eo;ai.exports.default=Eo});var So=E((Xm,ci)=>{"use strict";u();var Ao=require("path"),Mr=require("fs"),{promisify:Co}=require("util"),Rl=yo(),vl=Co(Mr.stat),Bl=Co(Mr.lstat),wo={directory:"isDirectory",file:"isFile"};function Fo({type:r}){if(!(r in wo))throw new Error(`Invalid type specified: ${r}`)}var bo=(r,e)=>r===void 0||e[wo[r]]();ci.exports=async(r,e)=>{e={cwd:process.cwd(),type:"file",allowSymlinks:!0,...e},Fo(e);let t=e.allowSymlinks?vl:Bl;return Rl(r,async s=>{try{let i=await t(Ao.resolve(e.cwd,s));return bo(e.type,i)}catch{return!1}},e)};ci.exports.sync=(r,e)=>{e={cwd:process.cwd(),allowSymlinks:!0,type:"file",...e},Fo(e);let t=e.allowSymlinks?Mr.statSync:Mr.lstatSync;for(let s of r)try{let i=t(Ao.resolve(e.cwd,s));if(bo(e.type,i))return s}catch{}}});var _o=E((Qm,li)=>{"use strict";u();var ko=require("fs"),{promisify:xl}=require("util"),Ol=xl(ko.access);li.exports=async r=>{try{return await Ol(r),!0}catch{return!1}};li.exports.sync=r=>{try{return ko.accessSync(r),!0}catch{return!1}}});var vo=E((ed,xt)=>{"use strict";u();var We=require("path"),Ir=So(),Ro=_o(),hi=Symbol("findUp.stop");xt.exports=async(r,e={})=>{let t=We.resolve(e.cwd||""),{root:s}=We.parse(t),i=[].concat(r),n=async o=>{if(typeof r!="function")return Ir(i,o);let a=await r(o.cwd);return typeof a=="string"?Ir([a],o):a};for(;;){let o=await n({...e,cwd:t});if(o===hi)return;if(o)return We.resolve(t,o);if(t===s)return;t=We.dirname(t)}};xt.exports.sync=(r,e={})=>{let t=We.resolve(e.cwd||""),{root:s}=We.parse(t),i=[].concat(r),n=o=>{if(typeof r!="function")return Ir.sync(i,o);let a=r(o.cwd);return typeof a=="string"?Ir.sync([a],o):a};for(;;){let o=n({...e,cwd:t});if(o===hi)return;if(o)return We.resolve(t,o);if(t===s)return;t=We.dirname(t)}};xt.exports.exists=Ro;xt.exports.sync.exists=Ro.sync;xt.exports.stop=hi});var Tt=E((vd,jo)=>{"use strict";u();var Io=new Map([["C","cwd"],["f","file"],["z","gzip"],["P","preservePaths"],["U","unlink"],["strip-components","strip"],["stripComponents","strip"],["keep-newer","newer"],["keepNewer","newer"],["keep-newer-files","newer"],["keepNewerFiles","newer"],["k","keep"],["keep-existing","keep"],["keepExisting","keep"],["m","noMtime"],["no-mtime","noMtime"],["p","preserveOwner"],["L","follow"],["h","follow"]]);jo.exports=r=>r?Object.keys(r).map(e=>[Io.has(e)?Io.get(e):e,r[e]]).reduce((e,t)=>(e[t[0]]=t[1],e),Object.create(null)):{}});var Hr=E((Bd,Vo)=>{"use strict";u();var Uo=typeof process=="object"&&process?process:{stdout:null,stderr:null},Zl=require("events"),qo=require("stream"),$o=require("string_decoder").StringDecoder,ke=Symbol("EOF"),_e=Symbol("maybeEmitEnd"),ze=Symbol("emittedEnd"),qr=Symbol("emittingEnd"),lr=Symbol("emittedError"),$r=Symbol("closed"),Wo=Symbol("read"),Wr=Symbol("flush"),zo=Symbol("flushChunk"),J=Symbol("encoding"),Re=Symbol("decoder"),zr=Symbol("flowing"),hr=Symbol("paused"),Pt=Symbol("resume"),N=Symbol("buffer"),De=Symbol("pipes"),I=Symbol("bufferLength"),mi=Symbol("bufferPush"),di=Symbol("bufferShift"),U=Symbol("objectMode"),q=Symbol("destroyed"),Di=Symbol("emitData"),Go=Symbol("emitEnd"),gi=Symbol("emitEnd2"),ve=Symbol("async"),fr=r=>Promise.resolve().then(r),Ho=global._MP_NO_ITERATOR_SYMBOLS_!=="1",Xl=Ho&&Symbol.asyncIterator||Symbol("asyncIterator not implemented"),Ql=Ho&&Symbol.iterator||Symbol("iterator not implemented"),eh=r=>r==="end"||r==="finish"||r==="prefinish",th=r=>r instanceof ArrayBuffer||typeof r=="object"&&r.constructor&&r.constructor.name==="ArrayBuffer"&&r.byteLength>=0,rh=r=>!Buffer.isBuffer(r)&&ArrayBuffer.isView(r),Gr=class{constructor(e,t,s){this.src=e,this.dest=t,this.opts=s,this.ondrain=()=>e[Pt](),t.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},Ei=class extends Gr{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,t,s){super(e,t,s),this.proxyErrors=i=>t.emit("error",i),e.on("error",this.proxyErrors)}};Vo.exports=class Jo extends qo{constructor(e){super(),this[zr]=!1,this[hr]=!1,this[De]=[],this[N]=[],this[U]=e&&e.objectMode||!1,this[U]?this[J]=null:this[J]=e&&e.encoding||null,this[J]==="buffer"&&(this[J]=null),this[ve]=e&&!!e.async||!1,this[Re]=this[J]?new $o(this[J]):null,this[ke]=!1,this[ze]=!1,this[qr]=!1,this[$r]=!1,this[lr]=null,this.writable=!0,this.readable=!0,this[I]=0,this[q]=!1,e&&e.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[N]}),e&&e.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[De]})}get bufferLength(){return this[I]}get encoding(){return this[J]}set encoding(e){if(this[U])throw new Error("cannot set encoding in objectMode");if(this[J]&&e!==this[J]&&(this[Re]&&this[Re].lastNeed||this[I]))throw new Error("cannot change encoding");this[J]!==e&&(this[Re]=e?new $o(e):null,this[N].length&&(this[N]=this[N].map(t=>this[Re].write(t)))),this[J]=e}setEncoding(e){this.encoding=e}get objectMode(){return this[U]}set objectMode(e){this[U]=this[U]||!!e}get async(){return this[ve]}set async(e){this[ve]=this[ve]||!!e}write(e,t,s){if(this[ke])throw new Error("write after end");if(this[q])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof t=="function"&&(s=t,t="utf8"),t||(t="utf8");let i=this[ve]?fr:n=>n();return!this[U]&&!Buffer.isBuffer(e)&&(rh(e)?e=Buffer.from(e.buffer,e.byteOffset,e.byteLength):th(e)?e=Buffer.from(e):typeof e!="string"&&(this.objectMode=!0)),this[U]?(this.flowing&&this[I]!==0&&this[Wr](!0),this.flowing?this.emit("data",e):this[mi](e),this[I]!==0&&this.emit("readable"),s&&i(s),this.flowing):e.length?(typeof e=="string"&&!(t===this[J]&&!this[Re].lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[J]&&(e=this[Re].write(e)),this.flowing&&this[I]!==0&&this[Wr](!0),this.flowing?this.emit("data",e):this[mi](e),this[I]!==0&&this.emit("readable"),s&&i(s),this.flowing):(this[I]!==0&&this.emit("readable"),s&&i(s),this.flowing)}read(e){if(this[q])return null;if(this[I]===0||e===0||e>this[I])return this[_e](),null;this[U]&&(e=null),this[N].length>1&&!this[U]&&(this.encoding?this[N]=[this[N].join("")]:this[N]=[Buffer.concat(this[N],this[I])]);let t=this[Wo](e||null,this[N][0]);return this[_e](),t}[Wo](e,t){return e===t.length||e===null?this[di]():(this[N][0]=t.slice(e),t=t.slice(0,e),this[I]-=e),this.emit("data",t),!this[N].length&&!this[ke]&&this.emit("drain"),t}end(e,t,s){return typeof e=="function"&&(s=e,e=null),typeof t=="function"&&(s=t,t="utf8"),e&&this.write(e,t),s&&this.once("end",s),this[ke]=!0,this.writable=!1,(this.flowing||!this[hr])&&this[_e](),this}[Pt](){this[q]||(this[hr]=!1,this[zr]=!0,this.emit("resume"),this[N].length?this[Wr]():this[ke]?this[_e]():this.emit("drain"))}resume(){return this[Pt]()}pause(){this[zr]=!1,this[hr]=!0}get destroyed(){return this[q]}get flowing(){return this[zr]}get paused(){return this[hr]}[mi](e){this[U]?this[I]+=1:this[I]+=e.length,this[N].push(e)}[di](){return this[N].length&&(this[U]?this[I]-=1:this[I]-=this[N][0].length),this[N].shift()}[Wr](e){do;while(this[zo](this[di]()));!e&&!this[N].length&&!this[ke]&&this.emit("drain")}[zo](e){return e?(this.emit("data",e),this.flowing):!1}pipe(e,t){if(this[q])return;let s=this[ze];return t=t||{},e===Uo.stdout||e===Uo.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,s?t.end&&e.end():(this[De].push(t.proxyErrors?new Ei(this,e,t):new Gr(this,e,t)),this[ve]?fr(()=>this[Pt]()):this[Pt]()),e}unpipe(e){let t=this[De].find(s=>s.dest===e);t&&(this[De].splice(this[De].indexOf(t),1),t.unpipe())}addListener(e,t){return this.on(e,t)}on(e,t){let s=super.on(e,t);return e==="data"&&!this[De].length&&!this.flowing?this[Pt]():e==="readable"&&this[I]!==0?super.emit("readable"):eh(e)&&this[ze]?(super.emit(e),this.removeAllListeners(e)):e==="error"&&this[lr]&&(this[ve]?fr(()=>t.call(this,this[lr])):t.call(this,this[lr])),s}get emittedEnd(){return this[ze]}[_e](){!this[qr]&&!this[ze]&&!this[q]&&this[N].length===0&&this[ke]&&(this[qr]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[$r]&&this.emit("close"),this[qr]=!1)}emit(e,t,...s){if(e!=="error"&&e!=="close"&&e!==q&&this[q])return;if(e==="data")return t?this[ve]?fr(()=>this[Di](t)):this[Di](t):!1;if(e==="end")return this[Go]();if(e==="close"){if(this[$r]=!0,!this[ze]&&!this[q])return;let n=super.emit("close");return this.removeAllListeners("close"),n}else if(e==="error"){this[lr]=t;let n=super.emit("error",t);return this[_e](),n}else if(e==="resume"){let n=super.emit("resume");return this[_e](),n}else if(e==="finish"||e==="prefinish"){let n=super.emit(e);return this.removeAllListeners(e),n}let i=super.emit(e,t,...s);return this[_e](),i}[Di](e){for(let s of this[De])s.dest.write(e)===!1&&this.pause();let t=super.emit("data",e);return this[_e](),t}[Go](){this[ze]||(this[ze]=!0,this.readable=!1,this[ve]?fr(()=>this[gi]()):this[gi]())}[gi](){if(this[Re]){let t=this[Re].end();if(t){for(let s of this[De])s.dest.write(t);super.emit("data",t)}}for(let t of this[De])t.end();let e=super.emit("end");return this.removeAllListeners("end"),e}collect(){let e=[];this[U]||(e.dataLength=0);let t=this.promise();return this.on("data",s=>{e.push(s),this[U]||(e.dataLength+=s.length)}),t.then(()=>e)}concat(){return this[U]?Promise.reject(new Error("cannot concat in objectMode")):this.collect().then(e=>this[U]?Promise.reject(new Error("cannot concat in objectMode")):this[J]?e.join(""):Buffer.concat(e,e.dataLength))}promise(){return new Promise((e,t)=>{this.on(q,()=>t(new Error("stream destroyed"))),this.on("error",s=>t(s)),this.on("end",()=>e())})}[Xl](){return{next:()=>{let t=this.read();if(t!==null)return Promise.resolve({done:!1,value:t});if(this[ke])return Promise.resolve({done:!0});let s=null,i=null,n=c=>{this.removeListener("data",o),this.removeListener("end",a),i(c)},o=c=>{this.removeListener("error",n),this.removeListener("end",a),this.pause(),s({value:c,done:!!this[ke]})},a=()=>{this.removeListener("error",n),this.removeListener("data",o),s({done:!0})},l=()=>n(new Error("stream destroyed"));return new Promise((c,h)=>{i=h,s=c,this.once(q,l),this.once("error",n),this.once("end",a),this.once("data",o)})}}}[Ql](){return{next:()=>{let t=this.read();return{value:t,done:t===null}}}}destroy(e){return this[q]?(e?this.emit("error",e):this.emit(q),this):(this[q]=!0,this[N].length=0,this[I]=0,typeof this.close=="function"&&!this[$r]&&this.close(),e?this.emit("error",e):this.emit(q),this)}static isStream(e){return!!e&&(e instanceof Jo||e instanceof qo||e instanceof Zl&&(typeof e.pipe=="function"||typeof e.write=="function"&&typeof e.end=="function"))}}});var Ko=E((xd,Yo)=>{u();var sh=require("zlib").constants||{ZLIB_VERNUM:4736};Yo.exports=Object.freeze(Object.assign(Object.create(null),{Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_VERSION_ERROR:-6,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,DEFLATE:1,INFLATE:2,GZIP:3,GUNZIP:4,DEFLATERAW:5,INFLATERAW:6,UNZIP:7,BROTLI_DECODE:8,BROTLI_ENCODE:9,Z_MIN_WINDOWBITS:8,Z_MAX_WINDOWBITS:15,Z_DEFAULT_WINDOWBITS:15,Z_MIN_CHUNK:64,Z_MAX_CHUNK:1/0,Z_DEFAULT_CHUNK:16384,Z_MIN_MEMLEVEL:1,Z_MAX_MEMLEVEL:9,Z_DEFAULT_MEMLEVEL:8,Z_MIN_LEVEL:-1,Z_MAX_LEVEL:9,Z_DEFAULT_LEVEL:-1,BROTLI_OPERATION_PROCESS:0,BROTLI_OPERATION_FLUSH:1,BROTLI_OPERATION_FINISH:2,BROTLI_OPERATION_EMIT_METADATA:3,BROTLI_MODE_GENERIC:0,BROTLI_MODE_TEXT:1,BROTLI_MODE_FONT:2,BROTLI_DEFAULT_MODE:0,BROTLI_MIN_QUALITY:0,BROTLI_MAX_QUALITY:11,BROTLI_DEFAULT_QUALITY:11,BROTLI_MIN_WINDOW_BITS:10,BROTLI_MAX_WINDOW_BITS:24,BROTLI_LARGE_MAX_WINDOW_BITS:30,BROTLI_DEFAULT_WINDOW:22,BROTLI_MIN_INPUT_BLOCK_BITS:16,BROTLI_MAX_INPUT_BLOCK_BITS:24,BROTLI_PARAM_MODE:0,BROTLI_PARAM_QUALITY:1,BROTLI_PARAM_LGWIN:2,BROTLI_PARAM_LGBLOCK:3,BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING:4,BROTLI_PARAM_SIZE_HINT:5,BROTLI_PARAM_LARGE_WINDOW:6,BROTLI_PARAM_NPOSTFIX:7,BROTLI_PARAM_NDIRECT:8,BROTLI_DECODER_RESULT_ERROR:0,BROTLI_DECODER_RESULT_SUCCESS:1,BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT:2,BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION:0,BROTLI_DECODER_PARAM_LARGE_WINDOW:1,BROTLI_DECODER_NO_ERROR:0,BROTLI_DECODER_SUCCESS:1,BROTLI_DECODER_NEEDS_MORE_INPUT:2,BROTLI_DECODER_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE:-1,BROTLI_DECODER_ERROR_FORMAT_RESERVED:-2,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE:-3,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET:-4,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME:-5,BROTLI_DECODER_ERROR_FORMAT_CL_SPACE:-6,BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE:-7,BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT:-8,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1:-9,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2:-10,BROTLI_DECODER_ERROR_FORMAT_TRANSFORM:-11,BROTLI_DECODER_ERROR_FORMAT_DICTIONARY:-12,BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS:-13,BROTLI_DECODER_ERROR_FORMAT_PADDING_1:-14,BROTLI_DECODER_ERROR_FORMAT_PADDING_2:-15,BROTLI_DECODER_ERROR_FORMAT_DISTANCE:-16,BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET:-19,BROTLI_DECODER_ERROR_INVALID_ARGUMENTS:-20,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES:-21,BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS:-22,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP:-25,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1:-26,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2:-27,BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES:-30,BROTLI_DECODER_ERROR_UNREACHABLE:-31},sh))});var bi=E((Od,nu)=>{"use strict";u();var Zo=typeof process=="object"&&process?process:{stdout:null,stderr:null},ih=require("events"),Xo=require("stream"),Qo=require("string_decoder").StringDecoder,Be=Symbol("EOF"),xe=Symbol("maybeEmitEnd"),Ge=Symbol("emittedEnd"),Jr=Symbol("emittingEnd"),pr=Symbol("emittedError"),Vr=Symbol("closed"),eu=Symbol("read"),Yr=Symbol("flush"),tu=Symbol("flushChunk"),V=Symbol("encoding"),Oe=Symbol("decoder"),Kr=Symbol("flowing"),mr=Symbol("paused"),Nt=Symbol("resume"),j=Symbol("bufferLength"),yi=Symbol("bufferPush"),Ai=Symbol("bufferShift"),$=Symbol("objectMode"),W=Symbol("destroyed"),Ci=Symbol("emitData"),ru=Symbol("emitEnd"),wi=Symbol("emitEnd2"),Te=Symbol("async"),dr=r=>Promise.resolve().then(r),su=global._MP_NO_ITERATOR_SYMBOLS_!=="1",nh=su&&Symbol.asyncIterator||Symbol("asyncIterator not implemented"),oh=su&&Symbol.iterator||Symbol("iterator not implemented"),uh=r=>r==="end"||r==="finish"||r==="prefinish",ah=r=>r instanceof ArrayBuffer||typeof r=="object"&&r.constructor&&r.constructor.name==="ArrayBuffer"&&r.byteLength>=0,ch=r=>!Buffer.isBuffer(r)&&ArrayBuffer.isView(r),Zr=class{constructor(e,t,s){this.src=e,this.dest=t,this.opts=s,this.ondrain=()=>e[Nt](),t.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},Fi=class extends Zr{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,t,s){super(e,t,s),this.proxyErrors=i=>t.emit("error",i),e.on("error",this.proxyErrors)}};nu.exports=class iu extends Xo{constructor(e){super(),this[Kr]=!1,this[mr]=!1,this.pipes=[],this.buffer=[],this[$]=e&&e.objectMode||!1,this[$]?this[V]=null:this[V]=e&&e.encoding||null,this[V]==="buffer"&&(this[V]=null),this[Te]=e&&!!e.async||!1,this[Oe]=this[V]?new Qo(this[V]):null,this[Be]=!1,this[Ge]=!1,this[Jr]=!1,this[Vr]=!1,this[pr]=null,this.writable=!0,this.readable=!0,this[j]=0,this[W]=!1}get bufferLength(){return this[j]}get encoding(){return this[V]}set encoding(e){if(this[$])throw new Error("cannot set encoding in objectMode");if(this[V]&&e!==this[V]&&(this[Oe]&&this[Oe].lastNeed||this[j]))throw new Error("cannot change encoding");this[V]!==e&&(this[Oe]=e?new Qo(e):null,this.buffer.length&&(this.buffer=this.buffer.map(t=>this[Oe].write(t)))),this[V]=e}setEncoding(e){this.encoding=e}get objectMode(){return this[$]}set objectMode(e){this[$]=this[$]||!!e}get async(){return this[Te]}set async(e){this[Te]=this[Te]||!!e}write(e,t,s){if(this[Be])throw new Error("write after end");if(this[W])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof t=="function"&&(s=t,t="utf8"),t||(t="utf8");let i=this[Te]?dr:n=>n();return!this[$]&&!Buffer.isBuffer(e)&&(ch(e)?e=Buffer.from(e.buffer,e.byteOffset,e.byteLength):ah(e)?e=Buffer.from(e):typeof e!="string"&&(this.objectMode=!0)),this[$]?(this.flowing&&this[j]!==0&&this[Yr](!0),this.flowing?this.emit("data",e):this[yi](e),this[j]!==0&&this.emit("readable"),s&&i(s),this.flowing):e.length?(typeof e=="string"&&!(t===this[V]&&!this[Oe].lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[V]&&(e=this[Oe].write(e)),this.flowing&&this[j]!==0&&this[Yr](!0),this.flowing?this.emit("data",e):this[yi](e),this[j]!==0&&this.emit("readable"),s&&i(s),this.flowing):(this[j]!==0&&this.emit("readable"),s&&i(s),this.flowing)}read(e){if(this[W])return null;if(this[j]===0||e===0||e>this[j])return this[xe](),null;this[$]&&(e=null),this.buffer.length>1&&!this[$]&&(this.encoding?this.buffer=[this.buffer.join("")]:this.buffer=[Buffer.concat(this.buffer,this[j])]);let t=this[eu](e||null,this.buffer[0]);return this[xe](),t}[eu](e,t){return e===t.length||e===null?this[Ai]():(this.buffer[0]=t.slice(e),t=t.slice(0,e),this[j]-=e),this.emit("data",t),!this.buffer.length&&!this[Be]&&this.emit("drain"),t}end(e,t,s){return typeof e=="function"&&(s=e,e=null),typeof t=="function"&&(s=t,t="utf8"),e&&this.write(e,t),s&&this.once("end",s),this[Be]=!0,this.writable=!1,(this.flowing||!this[mr])&&this[xe](),this}[Nt](){this[W]||(this[mr]=!1,this[Kr]=!0,this.emit("resume"),this.buffer.length?this[Yr]():this[Be]?this[xe]():this.emit("drain"))}resume(){return this[Nt]()}pause(){this[Kr]=!1,this[mr]=!0}get destroyed(){return this[W]}get flowing(){return this[Kr]}get paused(){return this[mr]}[yi](e){this[$]?this[j]+=1:this[j]+=e.length,this.buffer.push(e)}[Ai](){return this.buffer.length&&(this[$]?this[j]-=1:this[j]-=this.buffer[0].length),this.buffer.shift()}[Yr](e){do;while(this[tu](this[Ai]()));!e&&!this.buffer.length&&!this[Be]&&this.emit("drain")}[tu](e){return e?(this.emit("data",e),this.flowing):!1}pipe(e,t){if(this[W])return;let s=this[Ge];return t=t||{},e===Zo.stdout||e===Zo.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,s?t.end&&e.end():(this.pipes.push(t.proxyErrors?new Fi(this,e,t):new Zr(this,e,t)),this[Te]?dr(()=>this[Nt]()):this[Nt]()),e}unpipe(e){let t=this.pipes.find(s=>s.dest===e);t&&(this.pipes.splice(this.pipes.indexOf(t),1),t.unpipe())}addListener(e,t){return this.on(e,t)}on(e,t){let s=super.on(e,t);return e==="data"&&!this.pipes.length&&!this.flowing?this[Nt]():e==="readable"&&this[j]!==0?super.emit("readable"):uh(e)&&this[Ge]?(super.emit(e),this.removeAllListeners(e)):e==="error"&&this[pr]&&(this[Te]?dr(()=>t.call(this,this[pr])):t.call(this,this[pr])),s}get emittedEnd(){return this[Ge]}[xe](){!this[Jr]&&!this[Ge]&&!this[W]&&this.buffer.length===0&&this[Be]&&(this[Jr]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Vr]&&this.emit("close"),this[Jr]=!1)}emit(e,t,...s){if(e!=="error"&&e!=="close"&&e!==W&&this[W])return;if(e==="data")return t?this[Te]?dr(()=>this[Ci](t)):this[Ci](t):!1;if(e==="end")return this[ru]();if(e==="close"){if(this[Vr]=!0,!this[Ge]&&!this[W])return;let n=super.emit("close");return this.removeAllListeners("close"),n}else if(e==="error"){this[pr]=t;let n=super.emit("error",t);return this[xe](),n}else if(e==="resume"){let n=super.emit("resume");return this[xe](),n}else if(e==="finish"||e==="prefinish"){let n=super.emit(e);return this.removeAllListeners(e),n}let i=super.emit(e,t,...s);return this[xe](),i}[Ci](e){for(let s of this.pipes)s.dest.write(e)===!1&&this.pause();let t=super.emit("data",e);return this[xe](),t}[ru](){this[Ge]||(this[Ge]=!0,this.readable=!1,this[Te]?dr(()=>this[wi]()):this[wi]())}[wi](){if(this[Oe]){let t=this[Oe].end();if(t){for(let s of this.pipes)s.dest.write(t);super.emit("data",t)}}for(let t of this.pipes)t.end();let e=super.emit("end");return this.removeAllListeners("end"),e}collect(){let e=[];this[$]||(e.dataLength=0);let t=this.promise();return this.on("data",s=>{e.push(s),this[$]||(e.dataLength+=s.length)}),t.then(()=>e)}concat(){return this[$]?Promise.reject(new Error("cannot concat in objectMode")):this.collect().then(e=>this[$]?Promise.reject(new Error("cannot concat in objectMode")):this[V]?e.join(""):Buffer.concat(e,e.dataLength))}promise(){return new Promise((e,t)=>{this.on(W,()=>t(new Error("stream destroyed"))),this.on("error",s=>t(s)),this.on("end",()=>e())})}[nh](){return{next:()=>{let t=this.read();if(t!==null)return Promise.resolve({done:!1,value:t});if(this[Be])return Promise.resolve({done:!0});let s=null,i=null,n=c=>{this.removeListener("data",o),this.removeListener("end",a),i(c)},o=c=>{this.removeListener("error",n),this.removeListener("end",a),this.pause(),s({value:c,done:!!this[Be]})},a=()=>{this.removeListener("error",n),this.removeListener("data",o),s({done:!0})},l=()=>n(new Error("stream destroyed"));return new Promise((c,h)=>{i=h,s=c,this.once(W,l),this.once("error",n),this.once("end",a),this.once("data",o)})}}}[oh](){return{next:()=>{let t=this.read();return{value:t,done:t===null}}}}destroy(e){return this[W]?(e?this.emit("error",e):this.emit(W),this):(this[W]=!0,this.buffer.length=0,this[j]=0,typeof this.close=="function"&&!this[Vr]&&this.close(),e?this.emit("error",e):this.emit(W),this)}static isStream(e){return!!e&&(e instanceof iu||e instanceof Xo||e instanceof ih&&(typeof e.pipe=="function"||typeof e.write=="function"&&typeof e.end=="function"))}}});var Ui=E(Z=>{"use strict";u();var vi=require("assert"),He=require("buffer").Buffer,au=require("zlib"),ht=Z.constants=Ko(),lh=bi(),ou=He.concat,ft=Symbol("_superWrite"),Mt=class extends Error{constructor(e){super("zlib: "+e.message),this.code=e.code,this.errno=e.errno,this.code||(this.code="ZLIB_ERROR"),this.message="zlib: "+e.message,Error.captureStackTrace(this,this.constructor)}get name(){return"ZlibError"}},hh=Symbol("opts"),Dr=Symbol("flushFlag"),uu=Symbol("finishFlushFlag"),ji=Symbol("fullFlushFlag"),B=Symbol("handle"),Xr=Symbol("onError"),Lt=Symbol("sawError"),Si=Symbol("level"),ki=Symbol("strategy"),_i=Symbol("ended"),Td=Symbol("_defaultFullFlush"),Qr=class extends lh{constructor(e,t){if(!e||typeof e!="object")throw new TypeError("invalid options for ZlibBase constructor");super(e),this[Lt]=!1,this[_i]=!1,this[hh]=e,this[Dr]=e.flush,this[uu]=e.finishFlush;try{this[B]=new au[t](e)}catch(s){throw new Mt(s)}this[Xr]=s=>{this[Lt]||(this[Lt]=!0,this.close(),this.emit("error",s))},this[B].on("error",s=>this[Xr](new Mt(s))),this.once("end",()=>this.close)}close(){this[B]&&(this[B].close(),this[B]=null,this.emit("close"))}reset(){if(!this[Lt])return vi(this[B],"zlib binding closed"),this[B].reset()}flush(e){this.ended||(typeof e!="number"&&(e=this[ji]),this.write(Object.assign(He.alloc(0),{[Dr]:e})))}end(e,t,s){return e&&this.write(e,t),this.flush(this[uu]),this[_i]=!0,super.end(null,null,s)}get ended(){return this[_i]}write(e,t,s){if(typeof t=="function"&&(s=t,t="utf8"),typeof e=="string"&&(e=He.from(e,t)),this[Lt])return;vi(this[B],"zlib binding closed");let i=this[B]._handle,n=i.close;i.close=()=>{};let o=this[B].close;this[B].close=()=>{},He.concat=c=>c;let a;try{let c=typeof e[Dr]=="number"?e[Dr]:this[Dr];a=this[B]._processChunk(e,c),He.concat=ou}catch(c){He.concat=ou,this[Xr](new Mt(c))}finally{this[B]&&(this[B]._handle=i,i.close=n,this[B].close=o,this[B].removeAllListeners("error"))}this[B]&&this[B].on("error",c=>this[Xr](new Mt(c)));let l;if(a)if(Array.isArray(a)&&a.length>0){l=this[ft](He.from(a[0]));for(let c=1;c<a.length;c++)l=this[ft](a[c])}else l=this[ft](He.from(a));return s&&s(),l}[ft](e){return super.write(e)}},Pe=class extends Qr{constructor(e,t){e=e||{},e.flush=e.flush||ht.Z_NO_FLUSH,e.finishFlush=e.finishFlush||ht.Z_FINISH,super(e,t),this[ji]=ht.Z_FULL_FLUSH,this[Si]=e.level,this[ki]=e.strategy}params(e,t){if(!this[Lt]){if(!this[B])throw new Error("cannot switch params when binding is closed");if(!this[B].params)throw new Error("not supported in this implementation");if(this[Si]!==e||this[ki]!==t){this.flush(ht.Z_SYNC_FLUSH),vi(this[B],"zlib binding closed");let s=this[B].flush;this[B].flush=(i,n)=>{this.flush(i),n()};try{this[B].params(e,t)}finally{this[B].flush=s}this[B]&&(this[Si]=e,this[ki]=t)}}}},Bi=class extends Pe{constructor(e){super(e,"Deflate")}},xi=class extends Pe{constructor(e){super(e,"Inflate")}},Ri=Symbol("_portable"),Oi=class extends Pe{constructor(e){super(e,"Gzip"),this[Ri]=e&&!!e.portable}[ft](e){return this[Ri]?(this[Ri]=!1,e[9]=255,super[ft](e)):super[ft](e)}},Ti=class extends Pe{constructor(e){super(e,"Gunzip")}},Pi=class extends Pe{constructor(e){super(e,"DeflateRaw")}},Ni=class extends Pe{constructor(e){super(e,"InflateRaw")}},Li=class extends Pe{constructor(e){super(e,"Unzip")}},es=class extends Qr{constructor(e,t){e=e||{},e.flush=e.flush||ht.BROTLI_OPERATION_PROCESS,e.finishFlush=e.finishFlush||ht.BROTLI_OPERATION_FINISH,super(e,t),this[ji]=ht.BROTLI_OPERATION_FLUSH}},Mi=class extends es{constructor(e){super(e,"BrotliCompress")}},Ii=class extends es{constructor(e){super(e,"BrotliDecompress")}};Z.Deflate=Bi;Z.Inflate=xi;Z.Gzip=Oi;Z.Gunzip=Ti;Z.DeflateRaw=Pi;Z.InflateRaw=Ni;Z.Unzip=Li;typeof au.BrotliCompress=="function"?(Z.BrotliCompress=Mi,Z.BrotliDecompress=Ii):Z.BrotliCompress=Z.BrotliDecompress=class{constructor(){throw new Error("Brotli is not supported in this version of Node.js")}}});var It=E((Ld,cu)=>{u();var fh=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform;cu.exports=fh!=="win32"?r=>r:r=>r&&r.replace(/\\/g,"/")});var ts=E((Id,lu)=>{"use strict";u();var ph=Hr(),qi=It(),$i=Symbol("slurp");lu.exports=class extends ph{constructor(e,t,s){switch(super(),this.pause(),this.extended=t,this.globalExtended=s,this.header=e,this.startBlockSize=512*Math.ceil(e.size/512),this.blockRemain=this.startBlockSize,this.remain=e.size,this.type=e.type,this.meta=!1,this.ignore=!1,this.type){case"File":case"OldFile":case"Link":case"SymbolicLink":case"CharacterDevice":case"BlockDevice":case"Directory":case"FIFO":case"ContiguousFile":case"GNUDumpDir":break;case"NextFileHasLongLinkpath":case"NextFileHasLongPath":case"OldGnuLongPath":case"GlobalExtendedHeader":case"ExtendedHeader":case"OldExtendedHeader":this.meta=!0;break;default:this.ignore=!0}this.path=qi(e.path),this.mode=e.mode,this.mode&&(this.mode=this.mode&4095),this.uid=e.uid,this.gid=e.gid,this.uname=e.uname,this.gname=e.gname,this.size=e.size,this.mtime=e.mtime,this.atime=e.atime,this.ctime=e.ctime,this.linkpath=qi(e.linkpath),this.uname=e.uname,this.gname=e.gname,t&&this[$i](t),s&&this[$i](s,!0)}write(e){let t=e.length;if(t>this.blockRemain)throw new Error("writing more to entry than is appropriate");let s=this.remain,i=this.blockRemain;return this.remain=Math.max(0,s-t),this.blockRemain=Math.max(0,i-t),this.ignore?!0:s>=t?super.write(e):super.write(e.slice(0,s))}[$i](e,t){for(let s in e)e[s]!==null&&e[s]!==void 0&&!(t&&s==="path")&&(this[s]=s==="path"||s==="linkpath"?qi(e[s]):e[s])}}});var Wi=E(rs=>{"use strict";u();rs.name=new Map([["0","File"],["","OldFile"],["1","Link"],["2","SymbolicLink"],["3","CharacterDevice"],["4","BlockDevice"],["5","Directory"],["6","FIFO"],["7","ContiguousFile"],["g","GlobalExtendedHeader"],["x","ExtendedHeader"],["A","SolarisACL"],["D","GNUDumpDir"],["I","Inode"],["K","NextFileHasLongLinkpath"],["L","NextFileHasLongPath"],["M","ContinuationFile"],["N","OldGnuLongPath"],["S","SparseFile"],["V","TapeVolumeHeader"],["X","OldExtendedHeader"]]);rs.code=new Map(Array.from(rs.name).map(r=>[r[1],r[0]]))});var mu=E((Ud,pu)=>{"use strict";u();var mh=(r,e)=>{if(Number.isSafeInteger(r))r<0?Dh(r,e):dh(r,e);else throw Error("cannot encode number outside of javascript safe integer range");return e},dh=(r,e)=>{e[0]=128;for(var t=e.length;t>1;t--)e[t-1]=r&255,r=Math.floor(r/256)},Dh=(r,e)=>{e[0]=255;var t=!1;r=r*-1;for(var s=e.length;s>1;s--){var i=r&255;r=Math.floor(r/256),t?e[s-1]=hu(i):i===0?e[s-1]=0:(t=!0,e[s-1]=fu(i))}},gh=r=>{let e=r[0],t=e===128?yh(r.slice(1,r.length)):e===255?Eh(r):null;if(t===null)throw Error("invalid base256 encoding");if(!Number.isSafeInteger(t))throw Error("parsed number outside of javascript safe integer range");return t},Eh=r=>{for(var e=r.length,t=0,s=!1,i=e-1;i>-1;i--){var n=r[i],o;s?o=hu(n):n===0?o=n:(s=!0,o=fu(n)),o!==0&&(t-=o*Math.pow(256,e-i-1))}return t},yh=r=>{for(var e=r.length,t=0,s=e-1;s>-1;s--){var i=r[s];i!==0&&(t+=i*Math.pow(256,e-s-1))}return t},hu=r=>(255^r)&255,fu=r=>(255^r)+1&255;pu.exports={encode:mh,parse:gh}});var Ut=E((qd,Du)=>{"use strict";u();var zi=Wi(),jt=require("path").posix,du=mu(),Gi=Symbol("slurp"),X=Symbol("type"),Vi=class{constructor(e,t,s,i){this.cksumValid=!1,this.needPax=!1,this.nullBlock=!1,this.block=null,this.path=null,this.mode=null,this.uid=null,this.gid=null,this.size=null,this.mtime=null,this.cksum=null,this[X]="0",this.linkpath=null,this.uname=null,this.gname=null,this.devmaj=0,this.devmin=0,this.atime=null,this.ctime=null,Buffer.isBuffer(e)?this.decode(e,t||0,s,i):e&&this.set(e)}decode(e,t,s,i){if(t||(t=0),!e||!(e.length>=t+512))throw new Error("need 512 bytes for header");if(this.path=pt(e,t,100),this.mode=Je(e,t+100,8),this.uid=Je(e,t+108,8),this.gid=Je(e,t+116,8),this.size=Je(e,t+124,12),this.mtime=Hi(e,t+136,12),this.cksum=Je(e,t+148,12),this[Gi](s),this[Gi](i,!0),this[X]=pt(e,t+156,1),this[X]===""&&(this[X]="0"),this[X]==="0"&&this.path.slice(-1)==="/"&&(this[X]="5"),this[X]==="5"&&(this.size=0),this.linkpath=pt(e,t+157,100),e.slice(t+257,t+265).toString()==="ustar\x0000")if(this.uname=pt(e,t+265,32),this.gname=pt(e,t+297,32),this.devmaj=Je(e,t+329,8),this.devmin=Je(e,t+337,8),e[t+475]!==0){let o=pt(e,t+345,155);this.path=o+"/"+this.path}else{let o=pt(e,t+345,130);o&&(this.path=o+"/"+this.path),this.atime=Hi(e,t+476,12),this.ctime=Hi(e,t+488,12)}let n=8*32;for(let o=t;o<t+148;o++)n+=e[o];for(let o=t+156;o<t+512;o++)n+=e[o];this.cksumValid=n===this.cksum,this.cksum===null&&n===8*32&&(this.nullBlock=!0)}[Gi](e,t){for(let s in e)e[s]!==null&&e[s]!==void 0&&!(t&&s==="path")&&(this[s]=e[s])}encode(e,t){if(e||(e=this.block=Buffer.alloc(512),t=0),t||(t=0),!(e.length>=t+512))throw new Error("need 512 bytes for header");let s=this.ctime||this.atime?130:155,i=Ah(this.path||"",s),n=i[0],o=i[1];this.needPax=i[2],this.needPax=mt(e,t,100,n)||this.needPax,this.needPax=Ve(e,t+100,8,this.mode)||this.needPax,this.needPax=Ve(e,t+108,8,this.uid)||this.needPax,this.needPax=Ve(e,t+116,8,this.gid)||this.needPax,this.needPax=Ve(e,t+124,12,this.size)||this.needPax,this.needPax=Ji(e,t+136,12,this.mtime)||this.needPax,e[t+156]=this[X].charCodeAt(0),this.needPax=mt(e,t+157,100,this.linkpath)||this.needPax,e.write("ustar\x0000",t+257,8),this.needPax=mt(e,t+265,32,this.uname)||this.needPax,this.needPax=mt(e,t+297,32,this.gname)||this.needPax,this.needPax=Ve(e,t+329,8,this.devmaj)||this.needPax,this.needPax=Ve(e,t+337,8,this.devmin)||this.needPax,this.needPax=mt(e,t+345,s,o)||this.needPax,e[t+475]!==0?this.needPax=mt(e,t+345,155,o)||this.needPax:(this.needPax=mt(e,t+345,130,o)||this.needPax,this.needPax=Ji(e,t+476,12,this.atime)||this.needPax,this.needPax=Ji(e,t+488,12,this.ctime)||this.needPax);let a=8*32;for(let l=t;l<t+148;l++)a+=e[l];for(let l=t+156;l<t+512;l++)a+=e[l];return this.cksum=a,Ve(e,t+148,8,this.cksum),this.cksumValid=!0,this.needPax}set(e){for(let t in e)e[t]!==null&&e[t]!==void 0&&(this[t]=e[t])}get type(){return zi.name.get(this[X])||this[X]}get typeKey(){return this[X]}set type(e){zi.code.has(e)?this[X]=zi.code.get(e):this[X]=e}},Ah=(r,e)=>{let s=r,i="",n,o=jt.parse(r).root||".";if(Buffer.byteLength(s)<100)n=[s,i,!1];else{i=jt.dirname(s),s=jt.basename(s);do Buffer.byteLength(s)<=100&&Buffer.byteLength(i)<=e?n=[s,i,!1]:Buffer.byteLength(s)>100&&Buffer.byteLength(i)<=e?n=[s.slice(0,100-1),i,!0]:(s=jt.join(jt.basename(i),s),i=jt.dirname(i));while(i!==o&&!n);n||(n=[r.slice(0,100-1),"",!0])}return n},pt=(r,e,t)=>r.slice(e,e+t).toString("utf8").replace(/\0.*/,""),Hi=(r,e,t)=>Ch(Je(r,e,t)),Ch=r=>r===null?null:new Date(r*1e3),Je=(r,e,t)=>r[e]&128?du.parse(r.slice(e,e+t)):Fh(r,e,t),wh=r=>isNaN(r)?null:r,Fh=(r,e,t)=>wh(parseInt(r.slice(e,e+t).toString("utf8").replace(/\0.*$/,"").trim(),8)),bh={12:8589934591,8:2097151},Ve=(r,e,t,s)=>s===null?!1:s>bh[t]||s<0?(du.encode(s,r.slice(e,e+t)),!0):(Sh(r,e,t,s),!1),Sh=(r,e,t,s)=>r.write(kh(s,t),e,t,"ascii"),kh=(r,e)=>_h(Math.floor(r).toString(8),e),_h=(r,e)=>(r.length===e-1?r:new Array(e-r.length-1).join("0")+r+" ")+"\0",Ji=(r,e,t,s)=>s===null?!1:Ve(r,e,t,s.getTime()/1e3),Rh=new Array(156).join("\0"),mt=(r,e,t,s)=>s===null?!1:(r.write(s+Rh,e,t,"utf8"),s.length!==Buffer.byteLength(s)||s.length>t);Du.exports=Vi});var ss=E(($d,gu)=>{"use strict";u();var vh=Ut(),Bh=require("path"),gr=class{constructor(e,t){this.atime=e.atime||null,this.charset=e.charset||null,this.comment=e.comment||null,this.ctime=e.ctime||null,this.gid=e.gid||null,this.gname=e.gname||null,this.linkpath=e.linkpath||null,this.mtime=e.mtime||null,this.path=e.path||null,this.size=e.size||null,this.uid=e.uid||null,this.uname=e.uname||null,this.dev=e.dev||null,this.ino=e.ino||null,this.nlink=e.nlink||null,this.global=t||!1}encode(){let e=this.encodeBody();if(e==="")return null;let t=Buffer.byteLength(e),s=512*Math.ceil(1+t/512),i=Buffer.allocUnsafe(s);for(let n=0;n<512;n++)i[n]=0;new vh({path:("PaxHeader/"+Bh.basename(this.path)).slice(0,99),mode:this.mode||420,uid:this.uid||null,gid:this.gid||null,size:t,mtime:this.mtime||null,type:this.global?"GlobalExtendedHeader":"ExtendedHeader",linkpath:"",uname:this.uname||"",gname:this.gname||"",devmaj:0,devmin:0,atime:this.atime||null,ctime:this.ctime||null}).encode(i),i.write(e,512,t,"utf8");for(let n=t+512;n<i.length;n++)i[n]=0;return i}encodeBody(){return this.encodeField("path")+this.encodeField("ctime")+this.encodeField("atime")+this.encodeField("dev")+this.encodeField("ino")+this.encodeField("nlink")+this.encodeField("charset")+this.encodeField("comment")+this.encodeField("gid")+this.encodeField("gname")+this.encodeField("linkpath")+this.encodeField("mtime")+this.encodeField("size")+this.encodeField("uid")+this.encodeField("uname")}encodeField(e){if(this[e]===null||this[e]===void 0)return"";let t=this[e]instanceof Date?this[e].getTime()/1e3:this[e],s=" "+(e==="dev"||e==="ino"||e==="nlink"?"SCHILY.":"")+e+"="+t+`
2
- `,i=Buffer.byteLength(s),n=Math.floor(Math.log(i)/Math.log(10))+1;return i+n>=Math.pow(10,n)&&(n+=1),n+i+s}};gr.parse=(r,e,t)=>new gr(xh(Oh(r),e),t);var xh=(r,e)=>e?Object.keys(r).reduce((t,s)=>(t[s]=r[s],t),e):r,Oh=r=>r.replace(/\n$/,"").split(`
3
- `).reduce(Th,Object.create(null)),Th=(r,e)=>{let t=parseInt(e,10);if(t!==Buffer.byteLength(e)+1)return r;e=e.slice((t+" ").length);let s=e.split("="),i=s.shift().replace(/^SCHILY\.(dev|ino|nlink)/,"$1");if(!i)return r;let n=s.join("=");return r[i]=/^([A-Z]+\.)?([mac]|birth|creation)time$/.test(i)?new Date(n*1e3):/^[0-9]+$/.test(n)?+n:n,r};gu.exports=gr});var qt=E((Wd,Eu)=>{u();Eu.exports=r=>{let e=r.length-1,t=-1;for(;e>-1&&r.charAt(e)==="/";)t=e,e--;return t===-1?r:r.slice(0,t)}});var is=E((zd,yu)=>{"use strict";u();yu.exports=r=>class extends r{warn(e,t,s={}){this.file&&(s.file=this.file),this.cwd&&(s.cwd=this.cwd),s.code=t instanceof Error&&t.code||e,s.tarCode=e,!this.strict&&s.recoverable!==!1?(t instanceof Error&&(s=Object.assign(t,s),t=t.message),this.emit("warn",s.tarCode,t,s)):t instanceof Error?this.emit("error",Object.assign(t,s)):this.emit("error",Object.assign(new Error(`${e}: ${t}`),s))}}});var Ki=E((Hd,Au)=>{"use strict";u();var ns=["|","<",">","?",":"],Yi=ns.map(r=>String.fromCharCode(61440+r.charCodeAt(0))),Ph=new Map(ns.map((r,e)=>[r,Yi[e]])),Nh=new Map(Yi.map((r,e)=>[r,ns[e]]));Au.exports={encode:r=>ns.reduce((e,t)=>e.split(t).join(Ph.get(t)),r),decode:r=>Yi.reduce((e,t)=>e.split(t).join(Nh.get(t)),r)}});var Zi=E((Jd,wu)=>{u();var{isAbsolute:Lh,parse:Cu}=require("path").win32;wu.exports=r=>{let e="",t=Cu(r);for(;Lh(r)||t.root;){let s=r.charAt(0)==="/"&&r.slice(0,4)!=="//?/"?"/":t.root;r=r.slice(s.length),e+=s,t=Cu(r)}return[e,r]}});var bu=E((Vd,Fu)=>{"use strict";u();Fu.exports=(r,e,t)=>(r&=4095,t&&(r=(r|384)&-19),e&&(r&256&&(r|=64),r&32&&(r|=8),r&4&&(r|=1)),r)});var an=E((Zd,Iu)=>{"use strict";u();var xu=Hr(),Ou=ss(),Tu=Ut(),Ee=require("fs"),Su=require("path"),ge=It(),Mh=qt(),Pu=(r,e)=>e?(r=ge(r).replace(/^\.(\/|$)/,""),Mh(e)+"/"+r):ge(r),Ih=16*1024*1024,ku=Symbol("process"),_u=Symbol("file"),Ru=Symbol("directory"),Qi=Symbol("symlink"),vu=Symbol("hardlink"),Er=Symbol("header"),os=Symbol("read"),en=Symbol("lstat"),us=Symbol("onlstat"),tn=Symbol("onread"),rn=Symbol("onreadlink"),sn=Symbol("openfile"),nn=Symbol("onopenfile"),Ye=Symbol("close"),as=Symbol("mode"),on=Symbol("awaitDrain"),Xi=Symbol("ondrain"),ye=Symbol("prefix"),Bu=Symbol("hadError"),Nu=is(),jh=Ki(),Lu=Zi(),Mu=bu(),cs=Nu(class extends xu{constructor(e,t){if(t=t||{},super(t),typeof e!="string")throw new TypeError("path is required");this.path=ge(e),this.portable=!!t.portable,this.myuid=process.getuid&&process.getuid()||0,this.myuser=process.env.USER||"",this.maxReadSize=t.maxReadSize||Ih,this.linkCache=t.linkCache||new Map,this.statCache=t.statCache||new Map,this.preservePaths=!!t.preservePaths,this.cwd=ge(t.cwd||process.cwd()),this.strict=!!t.strict,this.noPax=!!t.noPax,this.noMtime=!!t.noMtime,this.mtime=t.mtime||null,this.prefix=t.prefix?ge(t.prefix):null,this.fd=null,this.blockLen=null,this.blockRemain=null,this.buf=null,this.offset=null,this.length=null,this.pos=null,this.remain=null,typeof t.onwarn=="function"&&this.on("warn",t.onwarn);let s=!1;if(!this.preservePaths){let[i,n]=Lu(this.path);i&&(this.path=n,s=i)}this.win32=!!t.win32||process.platform==="win32",this.win32&&(this.path=jh.decode(this.path.replace(/\\/g,"/")),e=e.replace(/\\/g,"/")),this.absolute=ge(t.absolute||Su.resolve(this.cwd,e)),this.path===""&&(this.path="./"),s&&this.warn("TAR_ENTRY_INFO",`stripping ${s} from absolute path`,{entry:this,path:s+this.path}),this.statCache.has(this.absolute)?this[us](this.statCache.get(this.absolute)):this[en]()}emit(e,...t){return e==="error"&&(this[Bu]=!0),super.emit(e,...t)}[en](){Ee.lstat(this.absolute,(e,t)=>{if(e)return this.emit("error",e);this[us](t)})}[us](e){this.statCache.set(this.absolute,e),this.stat=e,e.isFile()||(e.size=0),this.type=qh(e),this.emit("stat",e),this[ku]()}[ku](){switch(this.type){case"File":return this[_u]();case"Directory":return this[Ru]();case"SymbolicLink":return this[Qi]();default:return this.end()}}[as](e){return Mu(e,this.type==="Directory",this.portable)}[ye](e){return Pu(e,this.prefix)}[Er](){this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.header=new Tu({path:this[ye](this.path),linkpath:this.type==="Link"?this[ye](this.linkpath):this.linkpath,mode:this[as](this.stat.mode),uid:this.portable?null:this.stat.uid,gid:this.portable?null:this.stat.gid,size:this.stat.size,mtime:this.noMtime?null:this.mtime||this.stat.mtime,type:this.type,uname:this.portable?null:this.stat.uid===this.myuid?this.myuser:"",atime:this.portable?null:this.stat.atime,ctime:this.portable?null:this.stat.ctime}),this.header.encode()&&!this.noPax&&super.write(new Ou({atime:this.portable?null:this.header.atime,ctime:this.portable?null:this.header.ctime,gid:this.portable?null:this.header.gid,mtime:this.noMtime?null:this.mtime||this.header.mtime,path:this[ye](this.path),linkpath:this.type==="Link"?this[ye](this.linkpath):this.linkpath,size:this.header.size,uid:this.portable?null:this.header.uid,uname:this.portable?null:this.header.uname,dev:this.portable?null:this.stat.dev,ino:this.portable?null:this.stat.ino,nlink:this.portable?null:this.stat.nlink}).encode()),super.write(this.header.block)}[Ru](){this.path.slice(-1)!=="/"&&(this.path+="/"),this.stat.size=0,this[Er](),this.end()}[Qi](){Ee.readlink(this.absolute,(e,t)=>{if(e)return this.emit("error",e);this[rn](t)})}[rn](e){this.linkpath=ge(e),this[Er](),this.end()}[vu](e){this.type="Link",this.linkpath=ge(Su.relative(this.cwd,e)),this.stat.size=0,this[Er](),this.end()}[_u](){if(this.stat.nlink>1){let e=this.stat.dev+":"+this.stat.ino;if(this.linkCache.has(e)){let t=this.linkCache.get(e);if(t.indexOf(this.cwd)===0)return this[vu](t)}this.linkCache.set(e,this.absolute)}if(this[Er](),this.stat.size===0)return this.end();this[sn]()}[sn](){Ee.open(this.absolute,"r",(e,t)=>{if(e)return this.emit("error",e);this[nn](t)})}[nn](e){if(this.fd=e,this[Bu])return this[Ye]();this.blockLen=512*Math.ceil(this.stat.size/512),this.blockRemain=this.blockLen;let t=Math.min(this.blockLen,this.maxReadSize);this.buf=Buffer.allocUnsafe(t),this.offset=0,this.pos=0,this.remain=this.stat.size,this.length=this.buf.length,this[os]()}[os](){let{fd:e,buf:t,offset:s,length:i,pos:n}=this;Ee.read(e,t,s,i,n,(o,a)=>{if(o)return this[Ye](()=>this.emit("error",o));this[tn](a)})}[Ye](e){Ee.close(this.fd,e)}[tn](e){if(e<=0&&this.remain>0){let i=new Error("encountered unexpected EOF");return i.path=this.absolute,i.syscall="read",i.code="EOF",this[Ye](()=>this.emit("error",i))}if(e>this.remain){let i=new Error("did not encounter expected EOF");return i.path=this.absolute,i.syscall="read",i.code="EOF",this[Ye](()=>this.emit("error",i))}if(e===this.remain)for(let i=e;i<this.length&&e<this.blockRemain;i++)this.buf[i+this.offset]=0,e++,this.remain++;let t=this.offset===0&&e===this.buf.length?this.buf:this.buf.slice(this.offset,this.offset+e);this.write(t)?this[Xi]():this[on](()=>this[Xi]())}[on](e){this.once("drain",e)}write(e){if(this.blockRemain<e.length){let t=new Error("writing more data than expected");return t.path=this.absolute,this.emit("error",t)}return this.remain-=e.length,this.blockRemain-=e.length,this.pos+=e.length,this.offset+=e.length,super.write(e)}[Xi](){if(!this.remain)return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),this[Ye](e=>e?this.emit("error",e):this.end());this.offset>=this.length&&(this.buf=Buffer.allocUnsafe(Math.min(this.blockRemain,this.buf.length)),this.offset=0),this.length=this.buf.length-this.offset,this[os]()}}),un=class extends cs{[en](){this[us](Ee.lstatSync(this.absolute))}[Qi](){this[rn](Ee.readlinkSync(this.absolute))}[sn](){this[nn](Ee.openSync(this.absolute,"r"))}[os](){let e=!0;try{let{fd:t,buf:s,offset:i,length:n,pos:o}=this,a=Ee.readSync(t,s,i,n,o);this[tn](a),e=!1}finally{if(e)try{this[Ye](()=>{})}catch{}}}[on](e){e()}[Ye](e){Ee.closeSync(this.fd),e()}},Uh=Nu(class extends xu{constructor(e,t){t=t||{},super(t),this.preservePaths=!!t.preservePaths,this.portable=!!t.portable,this.strict=!!t.strict,this.noPax=!!t.noPax,this.noMtime=!!t.noMtime,this.readEntry=e,this.type=e.type,this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.prefix=t.prefix||null,this.path=ge(e.path),this.mode=this[as](e.mode),this.uid=this.portable?null:e.uid,this.gid=this.portable?null:e.gid,this.uname=this.portable?null:e.uname,this.gname=this.portable?null:e.gname,this.size=e.size,this.mtime=this.noMtime?null:t.mtime||e.mtime,this.atime=this.portable?null:e.atime,this.ctime=this.portable?null:e.ctime,this.linkpath=ge(e.linkpath),typeof t.onwarn=="function"&&this.on("warn",t.onwarn);let s=!1;if(!this.preservePaths){let[i,n]=Lu(this.path);i&&(this.path=n,s=i)}this.remain=e.size,this.blockRemain=e.startBlockSize,this.header=new Tu({path:this[ye](this.path),linkpath:this.type==="Link"?this[ye](this.linkpath):this.linkpath,mode:this.mode,uid:this.portable?null:this.uid,gid:this.portable?null:this.gid,size:this.size,mtime:this.noMtime?null:this.mtime,type:this.type,uname:this.portable?null:this.uname,atime:this.portable?null:this.atime,ctime:this.portable?null:this.ctime}),s&&this.warn("TAR_ENTRY_INFO",`stripping ${s} from absolute path`,{entry:this,path:s+this.path}),this.header.encode()&&!this.noPax&&super.write(new Ou({atime:this.portable?null:this.atime,ctime:this.portable?null:this.ctime,gid:this.portable?null:this.gid,mtime:this.noMtime?null:this.mtime,path:this[ye](this.path),linkpath:this.type==="Link"?this[ye](this.linkpath):this.linkpath,size:this.size,uid:this.portable?null:this.uid,uname:this.portable?null:this.uname,dev:this.portable?null:this.readEntry.dev,ino:this.portable?null:this.readEntry.ino,nlink:this.portable?null:this.readEntry.nlink}).encode()),super.write(this.header.block),e.pipe(this)}[ye](e){return Pu(e,this.prefix)}[as](e){return Mu(e,this.type==="Directory",this.portable)}write(e){let t=e.length;if(t>this.blockRemain)throw new Error("writing more to entry than is appropriate");return this.blockRemain-=t,super.write(e)}end(){return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),super.end()}});cs.Sync=un;cs.Tar=Uh;var qh=r=>r.isFile()?"File":r.isDirectory()?"Directory":r.isSymbolicLink()?"SymbolicLink":"Unsupported";Iu.exports=cs});var Uu=E((Xd,ju)=>{"use strict";u();ju.exports=function(r){r.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}});var cn=E((Qd,qu)=>{"use strict";u();qu.exports=k;k.Node=dt;k.create=k;function k(r){var e=this;if(e instanceof k||(e=new k),e.tail=null,e.head=null,e.length=0,r&&typeof r.forEach=="function")r.forEach(function(i){e.push(i)});else if(arguments.length>0)for(var t=0,s=arguments.length;t<s;t++)e.push(arguments[t]);return e}k.prototype.removeNode=function(r){if(r.list!==this)throw new Error("removing node which does not belong to this list");var e=r.next,t=r.prev;return e&&(e.prev=t),t&&(t.next=e),r===this.head&&(this.head=e),r===this.tail&&(this.tail=t),r.list.length--,r.next=null,r.prev=null,r.list=null,e};k.prototype.unshiftNode=function(r){if(r!==this.head){r.list&&r.list.removeNode(r);var e=this.head;r.list=this,r.next=e,e&&(e.prev=r),this.head=r,this.tail||(this.tail=r),this.length++}};k.prototype.pushNode=function(r){if(r!==this.tail){r.list&&r.list.removeNode(r);var e=this.tail;r.list=this,r.prev=e,e&&(e.next=r),this.tail=r,this.head||(this.head=r),this.length++}};k.prototype.push=function(){for(var r=0,e=arguments.length;r<e;r++)Wh(this,arguments[r]);return this.length};k.prototype.unshift=function(){for(var r=0,e=arguments.length;r<e;r++)zh(this,arguments[r]);return this.length};k.prototype.pop=function(){if(!!this.tail){var r=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,r}};k.prototype.shift=function(){if(!!this.head){var r=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,r}};k.prototype.forEach=function(r,e){e=e||this;for(var t=this.head,s=0;t!==null;s++)r.call(e,t.value,s,this),t=t.next};k.prototype.forEachReverse=function(r,e){e=e||this;for(var t=this.tail,s=this.length-1;t!==null;s--)r.call(e,t.value,s,this),t=t.prev};k.prototype.get=function(r){for(var e=0,t=this.head;t!==null&&e<r;e++)t=t.next;if(e===r&&t!==null)return t.value};k.prototype.getReverse=function(r){for(var e=0,t=this.tail;t!==null&&e<r;e++)t=t.prev;if(e===r&&t!==null)return t.value};k.prototype.map=function(r,e){e=e||this;for(var t=new k,s=this.head;s!==null;)t.push(r.call(e,s.value,this)),s=s.next;return t};k.prototype.mapReverse=function(r,e){e=e||this;for(var t=new k,s=this.tail;s!==null;)t.push(r.call(e,s.value,this)),s=s.prev;return t};k.prototype.reduce=function(r,e){var t,s=this.head;if(arguments.length>1)t=e;else if(this.head)s=this.head.next,t=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=0;s!==null;i++)t=r(t,s.value,i),s=s.next;return t};k.prototype.reduceReverse=function(r,e){var t,s=this.tail;if(arguments.length>1)t=e;else if(this.tail)s=this.tail.prev,t=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=this.length-1;s!==null;i--)t=r(t,s.value,i),s=s.prev;return t};k.prototype.toArray=function(){for(var r=new Array(this.length),e=0,t=this.head;t!==null;e++)r[e]=t.value,t=t.next;return r};k.prototype.toArrayReverse=function(){for(var r=new Array(this.length),e=0,t=this.tail;t!==null;e++)r[e]=t.value,t=t.prev;return r};k.prototype.slice=function(r,e){e=e||this.length,e<0&&(e+=this.length),r=r||0,r<0&&(r+=this.length);var t=new k;if(e<r||e<0)return t;r<0&&(r=0),e>this.length&&(e=this.length);for(var s=0,i=this.head;i!==null&&s<r;s++)i=i.next;for(;i!==null&&s<e;s++,i=i.next)t.push(i.value);return t};k.prototype.sliceReverse=function(r,e){e=e||this.length,e<0&&(e+=this.length),r=r||0,r<0&&(r+=this.length);var t=new k;if(e<r||e<0)return t;r<0&&(r=0),e>this.length&&(e=this.length);for(var s=this.length,i=this.tail;i!==null&&s>e;s--)i=i.prev;for(;i!==null&&s>r;s--,i=i.prev)t.push(i.value);return t};k.prototype.splice=function(r,e,...t){r>this.length&&(r=this.length-1),r<0&&(r=this.length+r);for(var s=0,i=this.head;i!==null&&s<r;s++)i=i.next;for(var n=[],s=0;i&&s<e;s++)n.push(i.value),i=this.removeNode(i);i===null&&(i=this.tail),i!==this.head&&i!==this.tail&&(i=i.prev);for(var s=0;s<t.length;s++)i=$h(this,i,t[s]);return n};k.prototype.reverse=function(){for(var r=this.head,e=this.tail,t=r;t!==null;t=t.prev){var s=t.prev;t.prev=t.next,t.next=s}return this.head=e,this.tail=r,this};function $h(r,e,t){var s=e===r.head?new dt(t,null,e,r):new dt(t,e,e.next,r);return s.next===null&&(r.tail=s),s.prev===null&&(r.head=s),r.length++,s}function Wh(r,e){r.tail=new dt(e,r.tail,null,r),r.head||(r.head=r.tail),r.length++}function zh(r,e){r.head=new dt(e,null,r.head,r),r.tail||(r.tail=r.head),r.length++}function dt(r,e,t,s){if(!(this instanceof dt))return new dt(r,e,t,s);this.list=s,this.value=r,e?(e.next=this,this.prev=e):this.prev=null,t?(t.prev=this,this.next=t):this.next=null}try{Uu()(k)}catch{}});var Es=E((t0,Vu)=>{"use strict";u();var Ds=class{constructor(e,t){this.path=e||"./",this.absolute=t,this.entry=null,this.stat=null,this.readdir=null,this.pending=!1,this.ignore=!1,this.piped=!1}},Gh=Hr(),Hh=Ui(),Jh=ts(),En=an(),Vh=En.Sync,Yh=En.Tar,Kh=cn(),$u=Buffer.alloc(1024),fs=Symbol("onStat"),ls=Symbol("ended"),Ae=Symbol("queue"),$t=Symbol("current"),Dt=Symbol("process"),hs=Symbol("processing"),Wu=Symbol("processJob"),Ce=Symbol("jobs"),ln=Symbol("jobDone"),ps=Symbol("addFSEntry"),zu=Symbol("addTarEntry"),mn=Symbol("stat"),dn=Symbol("readdir"),ms=Symbol("onreaddir"),ds=Symbol("pipe"),Gu=Symbol("entry"),hn=Symbol("entryOpt"),Dn=Symbol("writeEntryClass"),Ju=Symbol("write"),fn=Symbol("ondrain"),gs=require("fs"),Hu=require("path"),Zh=is(),pn=It(),yn=Zh(class extends Gh{constructor(e){super(e),e=e||Object.create(null),this.opt=e,this.file=e.file||"",this.cwd=e.cwd||process.cwd(),this.maxReadSize=e.maxReadSize,this.preservePaths=!!e.preservePaths,this.strict=!!e.strict,this.noPax=!!e.noPax,this.prefix=pn(e.prefix||""),this.linkCache=e.linkCache||new Map,this.statCache=e.statCache||new Map,this.readdirCache=e.readdirCache||new Map,this[Dn]=En,typeof e.onwarn=="function"&&this.on("warn",e.onwarn),this.portable=!!e.portable,this.zip=null,e.gzip?(typeof e.gzip!="object"&&(e.gzip={}),this.portable&&(e.gzip.portable=!0),this.zip=new Hh.Gzip(e.gzip),this.zip.on("data",t=>super.write(t)),this.zip.on("end",t=>super.end()),this.zip.on("drain",t=>this[fn]()),this.on("resume",t=>this.zip.resume())):this.on("drain",this[fn]),this.noDirRecurse=!!e.noDirRecurse,this.follow=!!e.follow,this.noMtime=!!e.noMtime,this.mtime=e.mtime||null,this.filter=typeof e.filter=="function"?e.filter:t=>!0,this[Ae]=new Kh,this[Ce]=0,this.jobs=+e.jobs||4,this[hs]=!1,this[ls]=!1}[Ju](e){return super.write(e)}add(e){return this.write(e),this}end(e){return e&&this.write(e),this[ls]=!0,this[Dt](),this}write(e){if(this[ls])throw new Error("write after end");return e instanceof Jh?this[zu](e):this[ps](e),this.flowing}[zu](e){let t=pn(Hu.resolve(this.cwd,e.path));if(!this.filter(e.path,e))e.resume();else{let s=new Ds(e.path,t,!1);s.entry=new Yh(e,this[hn](s)),s.entry.on("end",i=>this[ln](s)),this[Ce]+=1,this[Ae].push(s)}this[Dt]()}[ps](e){let t=pn(Hu.resolve(this.cwd,e));this[Ae].push(new Ds(e,t)),this[Dt]()}[mn](e){e.pending=!0,this[Ce]+=1;let t=this.follow?"stat":"lstat";gs[t](e.absolute,(s,i)=>{e.pending=!1,this[Ce]-=1,s?this.emit("error",s):this[fs](e,i)})}[fs](e,t){this.statCache.set(e.absolute,t),e.stat=t,this.filter(e.path,t)||(e.ignore=!0),this[Dt]()}[dn](e){e.pending=!0,this[Ce]+=1,gs.readdir(e.absolute,(t,s)=>{if(e.pending=!1,this[Ce]-=1,t)return this.emit("error",t);this[ms](e,s)})}[ms](e,t){this.readdirCache.set(e.absolute,t),e.readdir=t,this[Dt]()}[Dt](){if(!this[hs]){this[hs]=!0;for(let e=this[Ae].head;e!==null&&this[Ce]<this.jobs;e=e.next)if(this[Wu](e.value),e.value.ignore){let t=e.next;this[Ae].removeNode(e),e.next=t}this[hs]=!1,this[ls]&&!this[Ae].length&&this[Ce]===0&&(this.zip?this.zip.end($u):(super.write($u),super.end()))}}get[$t](){return this[Ae]&&this[Ae].head&&this[Ae].head.value}[ln](e){this[Ae].shift(),this[Ce]-=1,this[Dt]()}[Wu](e){if(!e.pending){if(e.entry){e===this[$t]&&!e.piped&&this[ds](e);return}if(e.stat||(this.statCache.has(e.absolute)?this[fs](e,this.statCache.get(e.absolute)):this[mn](e)),!!e.stat&&!e.ignore&&!(!this.noDirRecurse&&e.stat.isDirectory()&&!e.readdir&&(this.readdirCache.has(e.absolute)?this[ms](e,this.readdirCache.get(e.absolute)):this[dn](e),!e.readdir))){if(e.entry=this[Gu](e),!e.entry){e.ignore=!0;return}e===this[$t]&&!e.piped&&this[ds](e)}}}[hn](e){return{onwarn:(t,s,i)=>this.warn(t,s,i),noPax:this.noPax,cwd:this.cwd,absolute:e.absolute,preservePaths:this.preservePaths,maxReadSize:this.maxReadSize,strict:this.strict,portable:this.portable,linkCache:this.linkCache,statCache:this.statCache,noMtime:this.noMtime,mtime:this.mtime,prefix:this.prefix}}[Gu](e){this[Ce]+=1;try{return new this[Dn](e.path,this[hn](e)).on("end",()=>this[ln](e)).on("error",t=>this.emit("error",t))}catch(t){this.emit("error",t)}}[fn](){this[$t]&&this[$t].entry&&this[$t].entry.resume()}[ds](e){e.piped=!0,e.readdir&&e.readdir.forEach(i=>{let n=e.path,o=n==="./"?"":n.replace(/\/*$/,"/");this[ps](o+i)});let t=e.entry,s=this.zip;s?t.on("data",i=>{s.write(i)||t.pause()}):t.on("data",i=>{super.write(i)||t.pause()})}pause(){return this.zip&&this.zip.pause(),super.pause()}}),gn=class extends yn{constructor(e){super(e),this[Dn]=Vh}pause(){}resume(){}[mn](e){let t=this.follow?"statSync":"lstatSync";this[fs](e,gs[t](e.absolute))}[dn](e,t){this[ms](e,gs.readdirSync(e.absolute))}[ds](e){let t=e.entry,s=this.zip;e.readdir&&e.readdir.forEach(i=>{let n=e.path,o=n==="./"?"":n.replace(/\/*$/,"/");this[ps](o+i)}),s?t.on("data",i=>{s.write(i)}):t.on("data",i=>{super[Ju](i)})}};yn.Sync=gn;Vu.exports=yn});var Kt=E(Ar=>{"use strict";u();var Xh=bi(),Qh=require("events").EventEmitter,Y=require("fs"),wn=Y.writev;if(!wn){let r=process.binding("fs"),e=r.FSReqWrap||r.FSReqCallback;wn=(t,s,i,n)=>{let o=(l,c)=>n(l,c,s),a=new e;a.oncomplete=o,r.writeBuffers(t,s,i,a)}}var Vt=Symbol("_autoClose"),fe=Symbol("_close"),yr=Symbol("_ended"),v=Symbol("_fd"),Yu=Symbol("_finished"),Ze=Symbol("_flags"),An=Symbol("_flush"),Fn=Symbol("_handleChunk"),bn=Symbol("_makeBuf"),Fs=Symbol("_mode"),ys=Symbol("_needDrain"),Ht=Symbol("_onerror"),Yt=Symbol("_onopen"),Cn=Symbol("_onread"),zt=Symbol("_onwrite"),Xe=Symbol("_open"),Ne=Symbol("_path"),gt=Symbol("_pos"),we=Symbol("_queue"),Gt=Symbol("_read"),Ku=Symbol("_readSize"),Ke=Symbol("_reading"),As=Symbol("_remain"),Zu=Symbol("_size"),Cs=Symbol("_write"),Wt=Symbol("_writing"),ws=Symbol("_defaultFlag"),Jt=Symbol("_errored"),bs=class extends Xh{constructor(e,t){if(t=t||{},super(t),this.readable=!0,this.writable=!1,typeof e!="string")throw new TypeError("path must be a string");this[Jt]=!1,this[v]=typeof t.fd=="number"?t.fd:null,this[Ne]=e,this[Ku]=t.readSize||16*1024*1024,this[Ke]=!1,this[Zu]=typeof t.size=="number"?t.size:1/0,this[As]=this[Zu],this[Vt]=typeof t.autoClose=="boolean"?t.autoClose:!0,typeof this[v]=="number"?this[Gt]():this[Xe]()}get fd(){return this[v]}get path(){return this[Ne]}write(){throw new TypeError("this is a readable stream")}end(){throw new TypeError("this is a readable stream")}[Xe](){Y.open(this[Ne],"r",(e,t)=>this[Yt](e,t))}[Yt](e,t){e?this[Ht](e):(this[v]=t,this.emit("open",t),this[Gt]())}[bn](){return Buffer.allocUnsafe(Math.min(this[Ku],this[As]))}[Gt](){if(!this[Ke]){this[Ke]=!0;let e=this[bn]();if(e.length===0)return process.nextTick(()=>this[Cn](null,0,e));Y.read(this[v],e,0,e.length,null,(t,s,i)=>this[Cn](t,s,i))}}[Cn](e,t,s){this[Ke]=!1,e?this[Ht](e):this[Fn](t,s)&&this[Gt]()}[fe](){if(this[Vt]&&typeof this[v]=="number"){let e=this[v];this[v]=null,Y.close(e,t=>t?this.emit("error",t):this.emit("close"))}}[Ht](e){this[Ke]=!0,this[fe](),this.emit("error",e)}[Fn](e,t){let s=!1;return this[As]-=e,e>0&&(s=super.write(e<t.length?t.slice(0,e):t)),(e===0||this[As]<=0)&&(s=!1,this[fe](),super.end()),s}emit(e,t){switch(e){case"prefinish":case"finish":break;case"drain":typeof this[v]=="number"&&this[Gt]();break;case"error":return this[Jt]?void 0:(this[Jt]=!0,super.emit(e,t));default:return super.emit(e,t)}}},Sn=class extends bs{[Xe](){let e=!0;try{this[Yt](null,Y.openSync(this[Ne],"r")),e=!1}finally{e&&this[fe]()}}[Gt](){let e=!0;try{if(!this[Ke]){this[Ke]=!0;do{let t=this[bn](),s=t.length===0?0:Y.readSync(this[v],t,0,t.length,null);if(!this[Fn](s,t))break}while(!0);this[Ke]=!1}e=!1}finally{e&&this[fe]()}}[fe](){if(this[Vt]&&typeof this[v]=="number"){let e=this[v];this[v]=null,Y.closeSync(e),this.emit("close")}}},Ss=class extends Qh{constructor(e,t){t=t||{},super(t),this.readable=!1,this.writable=!0,this[Jt]=!1,this[Wt]=!1,this[yr]=!1,this[ys]=!1,this[we]=[],this[Ne]=e,this[v]=typeof t.fd=="number"?t.fd:null,this[Fs]=t.mode===void 0?438:t.mode,this[gt]=typeof t.start=="number"?t.start:null,this[Vt]=typeof t.autoClose=="boolean"?t.autoClose:!0;let s=this[gt]!==null?"r+":"w";this[ws]=t.flags===void 0,this[Ze]=this[ws]?s:t.flags,this[v]===null&&this[Xe]()}emit(e,t){if(e==="error"){if(this[Jt])return;this[Jt]=!0}return super.emit(e,t)}get fd(){return this[v]}get path(){return this[Ne]}[Ht](e){this[fe](),this[Wt]=!0,this.emit("error",e)}[Xe](){Y.open(this[Ne],this[Ze],this[Fs],(e,t)=>this[Yt](e,t))}[Yt](e,t){this[ws]&&this[Ze]==="r+"&&e&&e.code==="ENOENT"?(this[Ze]="w",this[Xe]()):e?this[Ht](e):(this[v]=t,this.emit("open",t),this[An]())}end(e,t){return e&&this.write(e,t),this[yr]=!0,!this[Wt]&&!this[we].length&&typeof this[v]=="number"&&this[zt](null,0),this}write(e,t){return typeof e=="string"&&(e=Buffer.from(e,t)),this[yr]?(this.emit("error",new Error("write() after end()")),!1):this[v]===null||this[Wt]||this[we].length?(this[we].push(e),this[ys]=!0,!1):(this[Wt]=!0,this[Cs](e),!0)}[Cs](e){Y.write(this[v],e,0,e.length,this[gt],(t,s)=>this[zt](t,s))}[zt](e,t){e?this[Ht](e):(this[gt]!==null&&(this[gt]+=t),this[we].length?this[An]():(this[Wt]=!1,this[yr]&&!this[Yu]?(this[Yu]=!0,this[fe](),this.emit("finish")):this[ys]&&(this[ys]=!1,this.emit("drain"))))}[An](){if(this[we].length===0)this[yr]&&this[zt](null,0);else if(this[we].length===1)this[Cs](this[we].pop());else{let e=this[we];this[we]=[],wn(this[v],e,this[gt],(t,s)=>this[zt](t,s))}}[fe](){if(this[Vt]&&typeof this[v]=="number"){let e=this[v];this[v]=null,Y.close(e,t=>t?this.emit("error",t):this.emit("close"))}}},kn=class extends Ss{[Xe](){let e;if(this[ws]&&this[Ze]==="r+")try{e=Y.openSync(this[Ne],this[Ze],this[Fs])}catch(t){if(t.code==="ENOENT")return this[Ze]="w",this[Xe]();throw t}else e=Y.openSync(this[Ne],this[Ze],this[Fs]);this[Yt](null,e)}[fe](){if(this[Vt]&&typeof this[v]=="number"){let e=this[v];this[v]=null,Y.closeSync(e),this.emit("close")}}[Cs](e){let t=!0;try{this[zt](null,Y.writeSync(this[v],e,0,e.length,this[gt])),t=!1}finally{if(t)try{this[fe]()}catch{}}}};Ar.ReadStream=bs;Ar.ReadStreamSync=Sn;Ar.WriteStream=Ss;Ar.WriteStreamSync=kn});var Os=E((i0,na)=>{"use strict";u();var ef=is(),tf=Ut(),rf=require("events"),sf=cn(),nf=1024*1024,of=ts(),Xu=ss(),uf=Ui(),{nextTick:af}=require("process"),_n=Buffer.from([31,139]),ie=Symbol("state"),Et=Symbol("writeEntry"),Le=Symbol("readEntry"),Rn=Symbol("nextEntry"),Qu=Symbol("processEntry"),ne=Symbol("extendedHeader"),Cr=Symbol("globalExtendedHeader"),Qe=Symbol("meta"),ea=Symbol("emitMeta"),O=Symbol("buffer"),Me=Symbol("queue"),yt=Symbol("ended"),ta=Symbol("emittedEnd"),At=Symbol("emit"),K=Symbol("unzip"),ks=Symbol("consumeChunk"),_s=Symbol("consumeChunkSub"),vn=Symbol("consumeBody"),ra=Symbol("consumeMeta"),sa=Symbol("consumeHeader"),Rs=Symbol("consuming"),Bn=Symbol("bufferConcat"),xn=Symbol("maybeEnd"),wr=Symbol("writing"),et=Symbol("aborted"),vs=Symbol("onDone"),Ct=Symbol("sawValidEntry"),Bs=Symbol("sawNullBlock"),xs=Symbol("sawEOF"),ia=Symbol("closeStream"),cf=r=>!0;na.exports=ef(class extends rf{constructor(e){e=e||{},super(e),this.file=e.file||"",this[Ct]=null,this.on(vs,t=>{(this[ie]==="begin"||this[Ct]===!1)&&this.warn("TAR_BAD_ARCHIVE","Unrecognized archive format")}),e.ondone?this.on(vs,e.ondone):this.on(vs,t=>{this.emit("prefinish"),this.emit("finish"),this.emit("end")}),this.strict=!!e.strict,this.maxMetaEntrySize=e.maxMetaEntrySize||nf,this.filter=typeof e.filter=="function"?e.filter:cf,this.writable=!0,this.readable=!1,this[Me]=new sf,this[O]=null,this[Le]=null,this[Et]=null,this[ie]="begin",this[Qe]="",this[ne]=null,this[Cr]=null,this[yt]=!1,this[K]=null,this[et]=!1,this[Bs]=!1,this[xs]=!1,this.on("end",()=>this[ia]()),typeof e.onwarn=="function"&&this.on("warn",e.onwarn),typeof e.onentry=="function"&&this.on("entry",e.onentry)}[sa](e,t){this[Ct]===null&&(this[Ct]=!1);let s;try{s=new tf(e,t,this[ne],this[Cr])}catch(i){return this.warn("TAR_ENTRY_INVALID",i)}if(s.nullBlock)this[Bs]?(this[xs]=!0,this[ie]==="begin"&&(this[ie]="header"),this[At]("eof")):(this[Bs]=!0,this[At]("nullBlock"));else if(this[Bs]=!1,!s.cksumValid)this.warn("TAR_ENTRY_INVALID","checksum failure",{header:s});else if(!s.path)this.warn("TAR_ENTRY_INVALID","path is required",{header:s});else{let i=s.type;if(/^(Symbolic)?Link$/.test(i)&&!s.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath required",{header:s});else if(!/^(Symbolic)?Link$/.test(i)&&s.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath forbidden",{header:s});else{let n=this[Et]=new of(s,this[ne],this[Cr]);if(!this[Ct])if(n.remain){let o=()=>{n.invalid||(this[Ct]=!0)};n.on("end",o)}else this[Ct]=!0;n.meta?n.size>this.maxMetaEntrySize?(n.ignore=!0,this[At]("ignoredEntry",n),this[ie]="ignore",n.resume()):n.size>0&&(this[Qe]="",n.on("data",o=>this[Qe]+=o),this[ie]="meta"):(this[ne]=null,n.ignore=n.ignore||!this.filter(n.path,n),n.ignore?(this[At]("ignoredEntry",n),this[ie]=n.remain?"ignore":"header",n.resume()):(n.remain?this[ie]="body":(this[ie]="header",n.end()),this[Le]?this[Me].push(n):(this[Me].push(n),this[Rn]())))}}}[ia](){af(()=>this.emit("close"))}[Qu](e){let t=!0;return e?Array.isArray(e)?this.emit.apply(this,e):(this[Le]=e,this.emit("entry",e),e.emittedEnd||(e.on("end",s=>this[Rn]()),t=!1)):(this[Le]=null,t=!1),t}[Rn](){do;while(this[Qu](this[Me].shift()));if(!this[Me].length){let e=this[Le];!e||e.flowing||e.size===e.remain?this[wr]||this.emit("drain"):e.once("drain",s=>this.emit("drain"))}}[vn](e,t){let s=this[Et],i=s.blockRemain,n=i>=e.length&&t===0?e:e.slice(t,t+i);return s.write(n),s.blockRemain||(this[ie]="header",this[Et]=null,s.end()),n.length}[ra](e,t){let s=this[Et],i=this[vn](e,t);return this[Et]||this[ea](s),i}[At](e,t,s){!this[Me].length&&!this[Le]?this.emit(e,t,s):this[Me].push([e,t,s])}[ea](e){switch(this[At]("meta",this[Qe]),e.type){case"ExtendedHeader":case"OldExtendedHeader":this[ne]=Xu.parse(this[Qe],this[ne],!1);break;case"GlobalExtendedHeader":this[Cr]=Xu.parse(this[Qe],this[Cr],!0);break;case"NextFileHasLongPath":case"OldGnuLongPath":this[ne]=this[ne]||Object.create(null),this[ne].path=this[Qe].replace(/\0.*/,"");break;case"NextFileHasLongLinkpath":this[ne]=this[ne]||Object.create(null),this[ne].linkpath=this[Qe].replace(/\0.*/,"");break;default:throw new Error("unknown meta: "+e.type)}}abort(e){this[et]=!0,this.emit("abort",e),this.warn("TAR_ABORT",e,{recoverable:!1})}write(e){if(this[et])return;if(this[K]===null&&e){if(this[O]&&(e=Buffer.concat([this[O],e]),this[O]=null),e.length<_n.length)return this[O]=e,!0;for(let s=0;this[K]===null&&s<_n.length;s++)e[s]!==_n[s]&&(this[K]=!1);if(this[K]===null){let s=this[yt];this[yt]=!1,this[K]=new uf.Unzip,this[K].on("data",n=>this[ks](n)),this[K].on("error",n=>this.abort(n)),this[K].on("end",n=>{this[yt]=!0,this[ks]()}),this[wr]=!0;let i=this[K][s?"end":"write"](e);return this[wr]=!1,i}}this[wr]=!0,this[K]?this[K].write(e):this[ks](e),this[wr]=!1;let t=this[Me].length?!1:this[Le]?this[Le].flowing:!0;return!t&&!this[Me].length&&this[Le].once("drain",s=>this.emit("drain")),t}[Bn](e){e&&!this[et]&&(this[O]=this[O]?Buffer.concat([this[O],e]):e)}[xn](){if(this[yt]&&!this[ta]&&!this[et]&&!this[Rs]){this[ta]=!0;let e=this[Et];if(e&&e.blockRemain){let t=this[O]?this[O].length:0;this.warn("TAR_BAD_ARCHIVE",`Truncated input (needed ${e.blockRemain} more bytes, only ${t} available)`,{entry:e}),this[O]&&e.write(this[O]),e.end()}this[At](vs)}}[ks](e){if(this[Rs])this[Bn](e);else if(!e&&!this[O])this[xn]();else{if(this[Rs]=!0,this[O]){this[Bn](e);let t=this[O];this[O]=null,this[_s](t)}else this[_s](e);for(;this[O]&&this[O].length>=512&&!this[et]&&!this[xs];){let t=this[O];this[O]=null,this[_s](t)}this[Rs]=!1}(!this[O]||this[yt])&&this[xn]()}[_s](e){let t=0,s=e.length;for(;t+512<=s&&!this[et]&&!this[xs];)switch(this[ie]){case"begin":case"header":this[sa](e,t),t+=512;break;case"ignore":case"body":t+=this[vn](e,t);break;case"meta":t+=this[ra](e,t);break;default:throw new Error("invalid state: "+this[ie])}t<s&&(this[O]?this[O]=Buffer.concat([e.slice(t),this[O]]):this[O]=e.slice(t))}end(e){this[et]||(this[K]?this[K].end(e):(this[yt]=!0,this.write(e)))}})});var Ts=E((n0,ca)=>{"use strict";u();var lf=Tt(),ua=Os(),Zt=require("fs"),hf=Kt(),oa=require("path"),On=qt();ca.exports=(r,e,t)=>{typeof r=="function"?(t=r,e=null,r={}):Array.isArray(r)&&(e=r,r={}),typeof e=="function"&&(t=e,e=null),e?e=Array.from(e):e=[];let s=lf(r);if(s.sync&&typeof t=="function")throw new TypeError("callback not supported for sync tar functions");if(!s.file&&typeof t=="function")throw new TypeError("callback only supported with file option");return e.length&&pf(s,e),s.noResume||ff(s),s.file&&s.sync?mf(s):s.file?df(s,t):aa(s)};var ff=r=>{let e=r.onentry;r.onentry=e?t=>{e(t),t.resume()}:t=>t.resume()},pf=(r,e)=>{let t=new Map(e.map(n=>[On(n),!0])),s=r.filter,i=(n,o)=>{let a=o||oa.parse(n).root||".",l=n===a?!1:t.has(n)?t.get(n):i(oa.dirname(n),a);return t.set(n,l),l};r.filter=s?(n,o)=>s(n,o)&&i(On(n)):n=>i(On(n))},mf=r=>{let e=aa(r),t=r.file,s=!0,i;try{let n=Zt.statSync(t),o=r.maxReadSize||16*1024*1024;if(n.size<o)e.end(Zt.readFileSync(t));else{let a=0,l=Buffer.allocUnsafe(o);for(i=Zt.openSync(t,"r");a<n.size;){let c=Zt.readSync(i,l,0,o,a);a+=c,e.write(l.slice(0,c))}e.end()}s=!1}finally{if(s&&i)try{Zt.closeSync(i)}catch{}}},df=(r,e)=>{let t=new ua(r),s=r.maxReadSize||16*1024*1024,i=r.file,n=new Promise((o,a)=>{t.on("error",a),t.on("end",o),Zt.stat(i,(l,c)=>{if(l)a(l);else{let h=new hf.ReadStream(i,{readSize:s,size:c.size});h.on("error",a),h.pipe(t)}})});return e?n.then(e,e):n},aa=r=>new ua(r)});var da=E((o0,ma)=>{"use strict";u();var Df=Tt(),Ps=Es(),la=Kt(),ha=Ts(),fa=require("path");ma.exports=(r,e,t)=>{if(typeof e=="function"&&(t=e),Array.isArray(r)&&(e=r,r={}),!e||!Array.isArray(e)||!e.length)throw new TypeError("no files or directories specified");e=Array.from(e);let s=Df(r);if(s.sync&&typeof t=="function")throw new TypeError("callback not supported for sync tar functions");if(!s.file&&typeof t=="function")throw new TypeError("callback only supported with file option");return s.file&&s.sync?gf(s,e):s.file?Ef(s,e,t):s.sync?yf(s,e):Af(s,e)};var gf=(r,e)=>{let t=new Ps.Sync(r),s=new la.WriteStreamSync(r.file,{mode:r.mode||438});t.pipe(s),pa(t,e)},Ef=(r,e,t)=>{let s=new Ps(r),i=new la.WriteStream(r.file,{mode:r.mode||438});s.pipe(i);let n=new Promise((o,a)=>{i.on("error",a),i.on("close",o),s.on("error",a)});return Tn(s,e),t?n.then(t,t):n},pa=(r,e)=>{e.forEach(t=>{t.charAt(0)==="@"?ha({file:fa.resolve(r.cwd,t.slice(1)),sync:!0,noResume:!0,onentry:s=>r.add(s)}):r.add(t)}),r.end()},Tn=(r,e)=>{for(;e.length;){let t=e.shift();if(t.charAt(0)==="@")return ha({file:fa.resolve(r.cwd,t.slice(1)),noResume:!0,onentry:s=>r.add(s)}).then(s=>Tn(r,e));r.add(t)}r.end()},yf=(r,e)=>{let t=new Ps.Sync(r);return pa(t,e),t},Af=(r,e)=>{let t=new Ps(r);return Tn(t,e),t}});var Pn=E((u0,wa)=>{"use strict";u();var Cf=Tt(),Da=Es(),Q=require("fs"),ga=Kt(),Ea=Ts(),ya=require("path"),Aa=Ut();wa.exports=(r,e,t)=>{let s=Cf(r);if(!s.file)throw new TypeError("file is required");if(s.gzip)throw new TypeError("cannot append to compressed archives");if(!e||!Array.isArray(e)||!e.length)throw new TypeError("no files or directories specified");return e=Array.from(e),s.sync?wf(s,e):bf(s,e,t)};var wf=(r,e)=>{let t=new Da.Sync(r),s=!0,i,n;try{try{i=Q.openSync(r.file,"r+")}catch(l){if(l.code==="ENOENT")i=Q.openSync(r.file,"w+");else throw l}let o=Q.fstatSync(i),a=Buffer.alloc(512);e:for(n=0;n<o.size;n+=512){for(let h=0,m=0;h<512;h+=m){if(m=Q.readSync(i,a,h,a.length-h,n+h),n===0&&a[0]===31&&a[1]===139)throw new Error("cannot append to compressed archives");if(!m)break e}let l=new Aa(a);if(!l.cksumValid)break;let c=512*Math.ceil(l.size/512);if(n+c+512>o.size)break;n+=c,r.mtimeCache&&r.mtimeCache.set(l.path,l.mtime)}s=!1,Ff(r,t,n,i,e)}finally{if(s)try{Q.closeSync(i)}catch{}}},Ff=(r,e,t,s,i)=>{let n=new ga.WriteStreamSync(r.file,{fd:s,start:t});e.pipe(n),Sf(e,i)},bf=(r,e,t)=>{e=Array.from(e);let s=new Da(r),i=(o,a,l)=>{let c=(b,T)=>{b?Q.close(o,S=>l(b)):l(null,T)},h=0;if(a===0)return c(null,0);let m=0,D=Buffer.alloc(512),A=(b,T)=>{if(b)return c(b);if(m+=T,m<512&&T)return Q.read(o,D,m,D.length-m,h+m,A);if(h===0&&D[0]===31&&D[1]===139)return c(new Error("cannot append to compressed archives"));if(m<512)return c(null,h);let S=new Aa(D);if(!S.cksumValid)return c(null,h);let x=512*Math.ceil(S.size/512);if(h+x+512>a||(h+=x+512,h>=a))return c(null,h);r.mtimeCache&&r.mtimeCache.set(S.path,S.mtime),m=0,Q.read(o,D,0,512,h,A)};Q.read(o,D,0,512,h,A)},n=new Promise((o,a)=>{s.on("error",a);let l="r+",c=(h,m)=>{if(h&&h.code==="ENOENT"&&l==="r+")return l="w+",Q.open(r.file,l,c);if(h)return a(h);Q.fstat(m,(D,A)=>{if(D)return Q.close(m,()=>a(D));i(m,A.size,(b,T)=>{if(b)return a(b);let S=new ga.WriteStream(r.file,{fd:m,start:T});s.pipe(S),S.on("error",a),S.on("close",o),Ca(s,e)})})};Q.open(r.file,l,c)});return t?n.then(t,t):n},Sf=(r,e)=>{e.forEach(t=>{t.charAt(0)==="@"?Ea({file:ya.resolve(r.cwd,t.slice(1)),sync:!0,noResume:!0,onentry:s=>r.add(s)}):r.add(t)}),r.end()},Ca=(r,e)=>{for(;e.length;){let t=e.shift();if(t.charAt(0)==="@")return Ea({file:ya.resolve(r.cwd,t.slice(1)),noResume:!0,onentry:s=>r.add(s)}).then(s=>Ca(r,e));r.add(t)}r.end()}});var ba=E((a0,Fa)=>{"use strict";u();var kf=Tt(),_f=Pn();Fa.exports=(r,e,t)=>{let s=kf(r);if(!s.file)throw new TypeError("file is required");if(s.gzip)throw new TypeError("cannot append to compressed archives");if(!e||!Array.isArray(e)||!e.length)throw new TypeError("no files or directories specified");return e=Array.from(e),Rf(s),_f(s,e,t)};var Rf=r=>{let e=r.filter;r.mtimeCache||(r.mtimeCache=new Map),r.filter=e?(t,s)=>e(t,s)&&!(r.mtimeCache.get(t)>s.mtime):(t,s)=>!(r.mtimeCache.get(t)>s.mtime)}});var _a=E((c0,ka)=>{u();var{promisify:Sa}=require("util"),tt=require("fs"),vf=r=>{if(!r)r={mode:511,fs:tt};else if(typeof r=="object")r={mode:511,fs:tt,...r};else if(typeof r=="number")r={mode:r,fs:tt};else if(typeof r=="string")r={mode:parseInt(r,8),fs:tt};else throw new TypeError("invalid options argument");return r.mkdir=r.mkdir||r.fs.mkdir||tt.mkdir,r.mkdirAsync=Sa(r.mkdir),r.stat=r.stat||r.fs.stat||tt.stat,r.statAsync=Sa(r.stat),r.statSync=r.statSync||r.fs.statSync||tt.statSync,r.mkdirSync=r.mkdirSync||r.fs.mkdirSync||tt.mkdirSync,r};ka.exports=vf});var va=E((l0,Ra)=>{u();var Bf=process.env.__TESTING_MKDIRP_PLATFORM__||process.platform,{resolve:xf,parse:Of}=require("path"),Tf=r=>{if(/\0/.test(r))throw Object.assign(new TypeError("path must be a string without null bytes"),{path:r,code:"ERR_INVALID_ARG_VALUE"});if(r=xf(r),Bf==="win32"){let e=/[*|"<>?:]/,{root:t}=Of(r);if(e.test(r.substr(t.length)))throw Object.assign(new Error("Illegal characters in path."),{path:r,code:"EINVAL"})}return r};Ra.exports=Tf});var Pa=E((h0,Ta)=>{u();var{dirname:Ba}=require("path"),xa=(r,e,t=void 0)=>t===e?Promise.resolve():r.statAsync(e).then(s=>s.isDirectory()?t:void 0,s=>s.code==="ENOENT"?xa(r,Ba(e),e):void 0),Oa=(r,e,t=void 0)=>{if(t!==e)try{return r.statSync(e).isDirectory()?t:void 0}catch(s){return s.code==="ENOENT"?Oa(r,Ba(e),e):void 0}};Ta.exports={findMade:xa,findMadeSync:Oa}});var Mn=E((f0,La)=>{u();var{dirname:Na}=require("path"),Nn=(r,e,t)=>{e.recursive=!1;let s=Na(r);return s===r?e.mkdirAsync(r,e).catch(i=>{if(i.code!=="EISDIR")throw i}):e.mkdirAsync(r,e).then(()=>t||r,i=>{if(i.code==="ENOENT")return Nn(s,e).then(n=>Nn(r,e,n));if(i.code!=="EEXIST"&&i.code!=="EROFS")throw i;return e.statAsync(r).then(n=>{if(n.isDirectory())return t;throw i},()=>{throw i})})},Ln=(r,e,t)=>{let s=Na(r);if(e.recursive=!1,s===r)try{return e.mkdirSync(r,e)}catch(i){if(i.code!=="EISDIR")throw i;return}try{return e.mkdirSync(r,e),t||r}catch(i){if(i.code==="ENOENT")return Ln(r,e,Ln(s,e,t));if(i.code!=="EEXIST"&&i.code!=="EROFS")throw i;try{if(!e.statSync(r).isDirectory())throw i}catch{throw i}}};La.exports={mkdirpManual:Nn,mkdirpManualSync:Ln}});var ja=E((p0,Ia)=>{u();var{dirname:Ma}=require("path"),{findMade:Pf,findMadeSync:Nf}=Pa(),{mkdirpManual:Lf,mkdirpManualSync:Mf}=Mn(),If=(r,e)=>(e.recursive=!0,Ma(r)===r?e.mkdirAsync(r,e):Pf(e,r).then(s=>e.mkdirAsync(r,e).then(()=>s).catch(i=>{if(i.code==="ENOENT")return Lf(r,e);throw i}))),jf=(r,e)=>{if(e.recursive=!0,Ma(r)===r)return e.mkdirSync(r,e);let s=Nf(e,r);try{return e.mkdirSync(r,e),s}catch(i){if(i.code==="ENOENT")return Mf(r,e);throw i}};Ia.exports={mkdirpNative:If,mkdirpNativeSync:jf}});var Wa=E((m0,$a)=>{u();var Ua=require("fs"),Uf=process.env.__TESTING_MKDIRP_NODE_VERSION__||process.version,In=Uf.replace(/^v/,"").split("."),qa=+In[0]>10||+In[0]==10&&+In[1]>=12,qf=qa?r=>r.mkdir===Ua.mkdir:()=>!1,$f=qa?r=>r.mkdirSync===Ua.mkdirSync:()=>!1;$a.exports={useNative:qf,useNativeSync:$f}});var Ya=E((d0,Va)=>{u();var Xt=_a(),Qt=va(),{mkdirpNative:za,mkdirpNativeSync:Ga}=ja(),{mkdirpManual:Ha,mkdirpManualSync:Ja}=Mn(),{useNative:Wf,useNativeSync:zf}=Wa(),er=(r,e)=>(r=Qt(r),e=Xt(e),Wf(e)?za(r,e):Ha(r,e)),Gf=(r,e)=>(r=Qt(r),e=Xt(e),zf(e)?Ga(r,e):Ja(r,e));er.sync=Gf;er.native=(r,e)=>za(Qt(r),Xt(e));er.manual=(r,e)=>Ha(Qt(r),Xt(e));er.nativeSync=(r,e)=>Ga(Qt(r),Xt(e));er.manualSync=(r,e)=>Ja(Qt(r),Xt(e));Va.exports=er});var rc=E((D0,tc)=>{"use strict";u();var oe=require("fs"),wt=require("path"),Hf=oe.lchown?"lchown":"chown",Jf=oe.lchownSync?"lchownSync":"chownSync",Za=oe.lchown&&!process.version.match(/v1[1-9]+\./)&&!process.version.match(/v10\.[6-9]/),Ka=(r,e,t)=>{try{return oe[Jf](r,e,t)}catch(s){if(s.code!=="ENOENT")throw s}},Vf=(r,e,t)=>{try{return oe.chownSync(r,e,t)}catch(s){if(s.code!=="ENOENT")throw s}},Yf=Za?(r,e,t,s)=>i=>{!i||i.code!=="EISDIR"?s(i):oe.chown(r,e,t,s)}:(r,e,t,s)=>s,jn=Za?(r,e,t)=>{try{return Ka(r,e,t)}catch(s){if(s.code!=="EISDIR")throw s;Vf(r,e,t)}}:(r,e,t)=>Ka(r,e,t),Kf=process.version,Xa=(r,e,t)=>oe.readdir(r,e,t),Zf=(r,e)=>oe.readdirSync(r,e);/^v4\./.test(Kf)&&(Xa=(r,e,t)=>oe.readdir(r,t));var Ns=(r,e,t,s)=>{oe[Hf](r,e,t,Yf(r,e,t,i=>{s(i&&i.code!=="ENOENT"?i:null)}))},Qa=(r,e,t,s,i)=>{if(typeof e=="string")return oe.lstat(wt.resolve(r,e),(n,o)=>{if(n)return i(n.code!=="ENOENT"?n:null);o.name=e,Qa(r,o,t,s,i)});if(e.isDirectory())Un(wt.resolve(r,e.name),t,s,n=>{if(n)return i(n);let o=wt.resolve(r,e.name);Ns(o,t,s,i)});else{let n=wt.resolve(r,e.name);Ns(n,t,s,i)}},Un=(r,e,t,s)=>{Xa(r,{withFileTypes:!0},(i,n)=>{if(i){if(i.code==="ENOENT")return s();if(i.code!=="ENOTDIR"&&i.code!=="ENOTSUP")return s(i)}if(i||!n.length)return Ns(r,e,t,s);let o=n.length,a=null,l=c=>{if(!a){if(c)return s(a=c);if(--o===0)return Ns(r,e,t,s)}};n.forEach(c=>Qa(r,c,e,t,l))})},Xf=(r,e,t,s)=>{if(typeof e=="string")try{let i=oe.lstatSync(wt.resolve(r,e));i.name=e,e=i}catch(i){if(i.code==="ENOENT")return;throw i}e.isDirectory()&&ec(wt.resolve(r,e.name),t,s),jn(wt.resolve(r,e.name),t,s)},ec=(r,e,t)=>{let s;try{s=Zf(r,{withFileTypes:!0})}catch(i){if(i.code==="ENOENT")return;if(i.code==="ENOTDIR"||i.code==="ENOTSUP")return jn(r,e,t);throw i}return s&&s.length&&s.forEach(i=>Xf(r,i,e,t)),jn(r,e,t)};tc.exports=Un;Un.sync=ec});var oc=E((g0,qn)=>{"use strict";u();var sc=Ya(),ue=require("fs"),Ls=require("path"),ic=rc(),pe=It(),Ms=class extends Error{constructor(e,t){super("Cannot extract through symbolic link"),this.path=t,this.symlink=e}get name(){return"SylinkError"}},Is=class extends Error{constructor(e,t){super(t+": Cannot cd into '"+e+"'"),this.path=e,this.code=t}get name(){return"CwdError"}},js=(r,e)=>r.get(pe(e)),Fr=(r,e,t)=>r.set(pe(e),t),Qf=(r,e)=>{ue.stat(r,(t,s)=>{(t||!s.isDirectory())&&(t=new Is(r,t&&t.code||"ENOTDIR")),e(t)})};qn.exports=(r,e,t)=>{r=pe(r);let s=e.umask,i=e.mode|448,n=(i&s)!==0,o=e.uid,a=e.gid,l=typeof o=="number"&&typeof a=="number"&&(o!==e.processUid||a!==e.processGid),c=e.preserve,h=e.unlink,m=e.cache,D=pe(e.cwd),A=(S,x)=>{S?t(S):(Fr(m,r,!0),x&&l?ic(x,o,a,ut=>A(ut)):n?ue.chmod(r,i,t):t())};if(m&&js(m,r)===!0)return A();if(r===D)return Qf(r,A);if(c)return sc(r,{mode:i}).then(S=>A(null,S),A);let T=pe(Ls.relative(D,r)).split("/");Us(D,T,i,m,h,D,null,A)};var Us=(r,e,t,s,i,n,o,a)=>{if(!e.length)return a(null,o);let l=e.shift(),c=pe(Ls.resolve(r+"/"+l));if(js(s,c))return Us(c,e,t,s,i,n,o,a);ue.mkdir(c,t,nc(c,e,t,s,i,n,o,a))},nc=(r,e,t,s,i,n,o,a)=>l=>{l?ue.lstat(r,(c,h)=>{if(c)c.path=c.path&&pe(c.path),a(c);else if(h.isDirectory())Us(r,e,t,s,i,n,o,a);else if(i)ue.unlink(r,m=>{if(m)return a(m);ue.mkdir(r,t,nc(r,e,t,s,i,n,o,a))});else{if(h.isSymbolicLink())return a(new Ms(r,r+"/"+e.join("/")));a(l)}}):(o=o||r,Us(r,e,t,s,i,n,o,a))},ep=r=>{let e=!1,t="ENOTDIR";try{e=ue.statSync(r).isDirectory()}catch(s){t=s.code}finally{if(!e)throw new Is(r,t)}};qn.exports.sync=(r,e)=>{r=pe(r);let t=e.umask,s=e.mode|448,i=(s&t)!==0,n=e.uid,o=e.gid,a=typeof n=="number"&&typeof o=="number"&&(n!==e.processUid||o!==e.processGid),l=e.preserve,c=e.unlink,h=e.cache,m=pe(e.cwd),D=S=>{Fr(h,r,!0),S&&a&&ic.sync(S,n,o),i&&ue.chmodSync(r,s)};if(h&&js(h,r)===!0)return D();if(r===m)return ep(m),D();if(l)return D(sc.sync(r,s));let b=pe(Ls.relative(m,r)).split("/"),T=null;for(let S=b.shift(),x=m;S&&(x+="/"+S);S=b.shift())if(x=pe(Ls.resolve(x)),!js(h,x))try{ue.mkdirSync(x,s),T=T||x,Fr(h,x,!0)}catch{let de=ue.lstatSync(x);if(de.isDirectory()){Fr(h,x,!0);continue}else if(c){ue.unlinkSync(x),ue.mkdirSync(x,s),T=T||x,Fr(h,x,!0);continue}else if(de.isSymbolicLink())return new Ms(x,x+"/"+b.join("/"))}return D(T)}});var Wn=E((E0,uc)=>{u();var $n=Object.create(null),{hasOwnProperty:tp}=Object.prototype;uc.exports=r=>(tp.call($n,r)||($n[r]=r.normalize("NFKD")),$n[r])});var hc=E((y0,lc)=>{u();var ac=require("assert"),rp=Wn(),sp=qt(),{join:cc}=require("path"),ip=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,np=ip==="win32";lc.exports=()=>{let r=new Map,e=new Map,t=c=>c.split("/").slice(0,-1).reduce((m,D)=>(m.length&&(D=cc(m[m.length-1],D)),m.push(D||"/"),m),[]),s=new Set,i=c=>{let h=e.get(c);if(!h)throw new Error("function does not have any path reservations");return{paths:h.paths.map(m=>r.get(m)),dirs:[...h.dirs].map(m=>r.get(m))}},n=c=>{let{paths:h,dirs:m}=i(c);return h.every(D=>D[0]===c)&&m.every(D=>D[0]instanceof Set&&D[0].has(c))},o=c=>s.has(c)||!n(c)?!1:(s.add(c),c(()=>a(c)),!0),a=c=>{if(!s.has(c))return!1;let{paths:h,dirs:m}=e.get(c),D=new Set;return h.forEach(A=>{let b=r.get(A);ac.equal(b[0],c),b.length===1?r.delete(A):(b.shift(),typeof b[0]=="function"?D.add(b[0]):b[0].forEach(T=>D.add(T)))}),m.forEach(A=>{let b=r.get(A);ac(b[0]instanceof Set),b[0].size===1&&b.length===1?r.delete(A):b[0].size===1?(b.shift(),D.add(b[0])):b[0].delete(c)}),s.delete(c),D.forEach(A=>o(A)),!0};return{check:n,reserve:(c,h)=>{c=np?["win32 parallelization disabled"]:c.map(D=>rp(sp(cc(D))).toLowerCase());let m=new Set(c.map(D=>t(D)).reduce((D,A)=>D.concat(A)));return e.set(h,{dirs:m,paths:c}),c.forEach(D=>{let A=r.get(D);A?A.push(h):r.set(D,[h])}),m.forEach(D=>{let A=r.get(D);A?A[A.length-1]instanceof Set?A[A.length-1].add(h):A.push(new Set([h])):r.set(D,[new Set([h])])}),o(h)}}}});var mc=E((A0,pc)=>{u();var op=process.env.__FAKE_PLATFORM__||process.platform,up=op==="win32",ap=global.__FAKE_TESTING_FS__||require("fs"),{O_CREAT:cp,O_TRUNC:lp,O_WRONLY:hp,UV_FS_O_FILEMAP:fc=0}=ap.constants,fp=up&&!!fc,pp=512*1024,mp=fc|lp|cp|hp;pc.exports=fp?r=>r<pp?mp:"w":()=>"w"});var Xn=E((C0,Rc)=>{"use strict";u();var dp=require("assert"),Dp=Os(),_=require("fs"),gp=Kt(),Ie=require("path"),Sc=oc(),dc=Ki(),Ep=hc(),yp=Zi(),ee=It(),Ap=qt(),Cp=Wn(),Dc=Symbol("onEntry"),Hn=Symbol("checkFs"),gc=Symbol("checkFs2"),Ws=Symbol("pruneCache"),Jn=Symbol("isReusable"),ae=Symbol("makeFs"),Vn=Symbol("file"),Yn=Symbol("directory"),zs=Symbol("link"),Ec=Symbol("symlink"),yc=Symbol("hardlink"),Ac=Symbol("unsupported"),Cc=Symbol("checkPath"),rt=Symbol("mkdir"),z=Symbol("onError"),qs=Symbol("pending"),wc=Symbol("pend"),tr=Symbol("unpend"),zn=Symbol("ended"),Gn=Symbol("maybeClose"),Kn=Symbol("skip"),br=Symbol("doChown"),Sr=Symbol("uid"),kr=Symbol("gid"),_r=Symbol("checkedCwd"),kc=require("crypto"),_c=mc(),wp=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,Rr=wp==="win32",Fp=(r,e)=>{if(!Rr)return _.unlink(r,e);let t=r+".DELETE."+kc.randomBytes(16).toString("hex");_.rename(r,t,s=>{if(s)return e(s);_.unlink(t,e)})},bp=r=>{if(!Rr)return _.unlinkSync(r);let e=r+".DELETE."+kc.randomBytes(16).toString("hex");_.renameSync(r,e),_.unlinkSync(e)},Fc=(r,e,t)=>r===r>>>0?r:e===e>>>0?e:t,bc=r=>Cp(Ap(ee(r))).toLowerCase(),Sp=(r,e)=>{e=bc(e);for(let t of r.keys()){let s=bc(t);(s===e||s.indexOf(e+"/")===0)&&r.delete(t)}},kp=r=>{for(let e of r.keys())r.delete(e)},vr=class extends Dp{constructor(e){if(e||(e={}),e.ondone=t=>{this[zn]=!0,this[Gn]()},super(e),this[_r]=!1,this.reservations=Ep(),this.transform=typeof e.transform=="function"?e.transform:null,this.writable=!0,this.readable=!1,this[qs]=0,this[zn]=!1,this.dirCache=e.dirCache||new Map,typeof e.uid=="number"||typeof e.gid=="number"){if(typeof e.uid!="number"||typeof e.gid!="number")throw new TypeError("cannot set owner without number uid and gid");if(e.preserveOwner)throw new TypeError("cannot preserve owner in archive and also set owner explicitly");this.uid=e.uid,this.gid=e.gid,this.setOwner=!0}else this.uid=null,this.gid=null,this.setOwner=!1;e.preserveOwner===void 0&&typeof e.uid!="number"?this.preserveOwner=process.getuid&&process.getuid()===0:this.preserveOwner=!!e.preserveOwner,this.processUid=(this.preserveOwner||this.setOwner)&&process.getuid?process.getuid():null,this.processGid=(this.preserveOwner||this.setOwner)&&process.getgid?process.getgid():null,this.forceChown=e.forceChown===!0,this.win32=!!e.win32||Rr,this.newer=!!e.newer,this.keep=!!e.keep,this.noMtime=!!e.noMtime,this.preservePaths=!!e.preservePaths,this.unlink=!!e.unlink,this.cwd=ee(Ie.resolve(e.cwd||process.cwd())),this.strip=+e.strip||0,this.processUmask=e.noChmod?0:process.umask(),this.umask=typeof e.umask=="number"?e.umask:this.processUmask,this.dmode=e.dmode||511&~this.umask,this.fmode=e.fmode||438&~this.umask,this.on("entry",t=>this[Dc](t))}warn(e,t,s={}){return(e==="TAR_BAD_ARCHIVE"||e==="TAR_ABORT")&&(s.recoverable=!1),super.warn(e,t,s)}[Gn](){this[zn]&&this[qs]===0&&(this.emit("prefinish"),this.emit("finish"),this.emit("end"))}[Cc](e){if(this.strip){let t=ee(e.path).split("/");if(t.length<this.strip)return!1;if(e.path=t.slice(this.strip).join("/"),e.type==="Link"){let s=ee(e.linkpath).split("/");if(s.length>=this.strip)e.linkpath=s.slice(this.strip).join("/");else return!1}}if(!this.preservePaths){let t=ee(e.path),s=t.split("/");if(s.includes("..")||Rr&&/^[a-z]:\.\.$/i.test(s[0]))return this.warn("TAR_ENTRY_ERROR","path contains '..'",{entry:e,path:t}),!1;let[i,n]=yp(t);i&&(e.path=n,this.warn("TAR_ENTRY_INFO",`stripping ${i} from absolute path`,{entry:e,path:t}))}if(Ie.isAbsolute(e.path)?e.absolute=ee(Ie.resolve(e.path)):e.absolute=ee(Ie.resolve(this.cwd,e.path)),!this.preservePaths&&e.absolute.indexOf(this.cwd+"/")!==0&&e.absolute!==this.cwd)return this.warn("TAR_ENTRY_ERROR","path escaped extraction target",{entry:e,path:ee(e.path),resolvedPath:e.absolute,cwd:this.cwd}),!1;if(e.absolute===this.cwd&&e.type!=="Directory"&&e.type!=="GNUDumpDir")return!1;if(this.win32){let{root:t}=Ie.win32.parse(e.absolute);e.absolute=t+dc.encode(e.absolute.slice(t.length));let{root:s}=Ie.win32.parse(e.path);e.path=s+dc.encode(e.path.slice(s.length))}return!0}[Dc](e){if(!this[Cc](e))return e.resume();switch(dp.equal(typeof e.absolute,"string"),e.type){case"Directory":case"GNUDumpDir":e.mode&&(e.mode=e.mode|448);case"File":case"OldFile":case"ContiguousFile":case"Link":case"SymbolicLink":return this[Hn](e);case"CharacterDevice":case"BlockDevice":case"FIFO":default:return this[Ac](e)}}[z](e,t){e.name==="CwdError"?this.emit("error",e):(this.warn("TAR_ENTRY_ERROR",e,{entry:t}),this[tr](),t.resume())}[rt](e,t,s){Sc(ee(e),{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cache:this.dirCache,cwd:this.cwd,mode:t,noChmod:this.noChmod},s)}[br](e){return this.forceChown||this.preserveOwner&&(typeof e.uid=="number"&&e.uid!==this.processUid||typeof e.gid=="number"&&e.gid!==this.processGid)||typeof this.uid=="number"&&this.uid!==this.processUid||typeof this.gid=="number"&&this.gid!==this.processGid}[Sr](e){return Fc(this.uid,e.uid,this.processUid)}[kr](e){return Fc(this.gid,e.gid,this.processGid)}[Vn](e,t){let s=e.mode&4095||this.fmode,i=new gp.WriteStream(e.absolute,{flags:_c(e.size),mode:s,autoClose:!1});i.on("error",l=>{i.fd&&_.close(i.fd,()=>{}),i.write=()=>!0,this[z](l,e),t()});let n=1,o=l=>{if(l){i.fd&&_.close(i.fd,()=>{}),this[z](l,e),t();return}--n===0&&_.close(i.fd,c=>{c?this[z](c,e):this[tr](),t()})};i.on("finish",l=>{let c=e.absolute,h=i.fd;if(e.mtime&&!this.noMtime){n++;let m=e.atime||new Date,D=e.mtime;_.futimes(h,m,D,A=>A?_.utimes(c,m,D,b=>o(b&&A)):o())}if(this[br](e)){n++;let m=this[Sr](e),D=this[kr](e);_.fchown(h,m,D,A=>A?_.chown(c,m,D,b=>o(b&&A)):o())}o()});let a=this.transform&&this.transform(e)||e;a!==e&&(a.on("error",l=>{this[z](l,e),t()}),e.pipe(a)),a.pipe(i)}[Yn](e,t){let s=e.mode&4095||this.dmode;this[rt](e.absolute,s,i=>{if(i){this[z](i,e),t();return}let n=1,o=a=>{--n===0&&(t(),this[tr](),e.resume())};e.mtime&&!this.noMtime&&(n++,_.utimes(e.absolute,e.atime||new Date,e.mtime,o)),this[br](e)&&(n++,_.chown(e.absolute,this[Sr](e),this[kr](e),o)),o()})}[Ac](e){e.unsupported=!0,this.warn("TAR_ENTRY_UNSUPPORTED",`unsupported entry type: ${e.type}`,{entry:e}),e.resume()}[Ec](e,t){this[zs](e,e.linkpath,"symlink",t)}[yc](e,t){let s=ee(Ie.resolve(this.cwd,e.linkpath));this[zs](e,s,"link",t)}[wc](){this[qs]++}[tr](){this[qs]--,this[Gn]()}[Kn](e){this[tr](),e.resume()}[Jn](e,t){return e.type==="File"&&!this.unlink&&t.isFile()&&t.nlink<=1&&!Rr}[Hn](e){this[wc]();let t=[e.path];e.linkpath&&t.push(e.linkpath),this.reservations.reserve(t,s=>this[gc](e,s))}[Ws](e){e.type==="SymbolicLink"?kp(this.dirCache):e.type!=="Directory"&&Sp(this.dirCache,e.absolute)}[gc](e,t){this[Ws](e);let s=a=>{this[Ws](e),t(a)},i=()=>{this[rt](this.cwd,this.dmode,a=>{if(a){this[z](a,e),s();return}this[_r]=!0,n()})},n=()=>{if(e.absolute!==this.cwd){let a=ee(Ie.dirname(e.absolute));if(a!==this.cwd)return this[rt](a,this.dmode,l=>{if(l){this[z](l,e),s();return}o()})}o()},o=()=>{_.lstat(e.absolute,(a,l)=>{if(l&&(this.keep||this.newer&&l.mtime>e.mtime)){this[Kn](e),s();return}if(a||this[Jn](e,l))return this[ae](null,e,s);if(l.isDirectory()){if(e.type==="Directory"){let c=!this.noChmod&&e.mode&&(l.mode&4095)!==e.mode,h=m=>this[ae](m,e,s);return c?_.chmod(e.absolute,e.mode,h):h()}if(e.absolute!==this.cwd)return _.rmdir(e.absolute,c=>this[ae](c,e,s))}if(e.absolute===this.cwd)return this[ae](null,e,s);Fp(e.absolute,c=>this[ae](c,e,s))})};this[_r]?n():i()}[ae](e,t,s){if(e){this[z](e,t),s();return}switch(t.type){case"File":case"OldFile":case"ContiguousFile":return this[Vn](t,s);case"Link":return this[yc](t,s);case"SymbolicLink":return this[Ec](t,s);case"Directory":case"GNUDumpDir":return this[Yn](t,s)}}[zs](e,t,s,i){_[s](t,e.absolute,n=>{n?this[z](n,e):(this[tr](),e.resume()),i()})}},$s=r=>{try{return[null,r()]}catch(e){return[e,null]}},Zn=class extends vr{[ae](e,t){return super[ae](e,t,()=>{})}[Hn](e){if(this[Ws](e),!this[_r]){let n=this[rt](this.cwd,this.dmode);if(n)return this[z](n,e);this[_r]=!0}if(e.absolute!==this.cwd){let n=ee(Ie.dirname(e.absolute));if(n!==this.cwd){let o=this[rt](n,this.dmode);if(o)return this[z](o,e)}}let[t,s]=$s(()=>_.lstatSync(e.absolute));if(s&&(this.keep||this.newer&&s.mtime>e.mtime))return this[Kn](e);if(t||this[Jn](e,s))return this[ae](null,e);if(s.isDirectory()){if(e.type==="Directory"){let o=!this.noChmod&&e.mode&&(s.mode&4095)!==e.mode,[a]=o?$s(()=>{_.chmodSync(e.absolute,e.mode)}):[];return this[ae](a,e)}let[n]=$s(()=>_.rmdirSync(e.absolute));this[ae](n,e)}let[i]=e.absolute===this.cwd?[]:$s(()=>bp(e.absolute));this[ae](i,e)}[Vn](e,t){let s=e.mode&4095||this.fmode,i=a=>{let l;try{_.closeSync(n)}catch(c){l=c}(a||l)&&this[z](a||l,e),t()},n;try{n=_.openSync(e.absolute,_c(e.size),s)}catch(a){return i(a)}let o=this.transform&&this.transform(e)||e;o!==e&&(o.on("error",a=>this[z](a,e)),e.pipe(o)),o.on("data",a=>{try{_.writeSync(n,a,0,a.length)}catch(l){i(l)}}),o.on("end",a=>{let l=null;if(e.mtime&&!this.noMtime){let c=e.atime||new Date,h=e.mtime;try{_.futimesSync(n,c,h)}catch(m){try{_.utimesSync(e.absolute,c,h)}catch{l=m}}}if(this[br](e)){let c=this[Sr](e),h=this[kr](e);try{_.fchownSync(n,c,h)}catch(m){try{_.chownSync(e.absolute,c,h)}catch{l=l||m}}}i(l)})}[Yn](e,t){let s=e.mode&4095||this.dmode,i=this[rt](e.absolute,s);if(i){this[z](i,e),t();return}if(e.mtime&&!this.noMtime)try{_.utimesSync(e.absolute,e.atime||new Date,e.mtime)}catch{}if(this[br](e))try{_.chownSync(e.absolute,this[Sr](e),this[kr](e))}catch{}t(),e.resume()}[rt](e,t){try{return Sc.sync(ee(e),{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cache:this.dirCache,cwd:this.cwd,mode:t})}catch(s){return s}}[zs](e,t,s,i){try{_[s+"Sync"](t,e.absolute),i(),e.resume()}catch(n){return this[z](n,e)}}};vr.Sync=Zn;Rc.exports=vr});var Tc=E((w0,Oc)=>{"use strict";u();var _p=Tt(),Gs=Xn(),Bc=require("fs"),xc=Kt(),vc=require("path"),Qn=qt();Oc.exports=(r,e,t)=>{typeof r=="function"?(t=r,e=null,r={}):Array.isArray(r)&&(e=r,r={}),typeof e=="function"&&(t=e,e=null),e?e=Array.from(e):e=[];let s=_p(r);if(s.sync&&typeof t=="function")throw new TypeError("callback not supported for sync tar functions");if(!s.file&&typeof t=="function")throw new TypeError("callback only supported with file option");return e.length&&Rp(s,e),s.file&&s.sync?vp(s):s.file?Bp(s,t):s.sync?xp(s):Op(s)};var Rp=(r,e)=>{let t=new Map(e.map(n=>[Qn(n),!0])),s=r.filter,i=(n,o)=>{let a=o||vc.parse(n).root||".",l=n===a?!1:t.has(n)?t.get(n):i(vc.dirname(n),a);return t.set(n,l),l};r.filter=s?(n,o)=>s(n,o)&&i(Qn(n)):n=>i(Qn(n))},vp=r=>{let e=new Gs.Sync(r),t=r.file,s=Bc.statSync(t),i=r.maxReadSize||16*1024*1024;new xc.ReadStreamSync(t,{readSize:i,size:s.size}).pipe(e)},Bp=(r,e)=>{let t=new Gs(r),s=r.maxReadSize||16*1024*1024,i=r.file,n=new Promise((o,a)=>{t.on("error",a),t.on("close",o),Bc.stat(i,(l,c)=>{if(l)a(l);else{let h=new xc.ReadStream(i,{readSize:s,size:c.size});h.on("error",a),h.pipe(t)}})});return e?n.then(e,e):n},xp=r=>new Gs.Sync(r),Op=r=>new Gs(r)});var Pc=E(L=>{"use strict";u();L.c=L.create=da();L.r=L.replace=Pn();L.t=L.list=Ts();L.u=L.update=ba();L.x=L.extract=Tc();L.Pack=Es();L.Unpack=Xn();L.Parse=Os();L.ReadEntry=ts();L.WriteEntry=an();L.Header=Ut();L.Pax=ss();L.types=Wi()});var jc=E((_0,Ic)=>{u();function ce(r,e){typeof e=="boolean"&&(e={forever:e}),this._originalTimeouts=JSON.parse(JSON.stringify(r)),this._timeouts=r,this._options=e||{},this._maxRetryTime=e&&e.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}Ic.exports=ce;ce.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)};ce.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null};ce.prototype.retry=function(r){if(this._timeout&&clearTimeout(this._timeout),!r)return!1;var e=new Date().getTime();if(r&&e-this._operationStart>=this._maxRetryTime)return this._errors.push(r),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(r);var t=this._timeouts.shift();if(t===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),t=this._cachedTimeouts.slice(-1);else return!1;var s=this;return this._timer=setTimeout(function(){s._attempts++,s._operationTimeoutCb&&(s._timeout=setTimeout(function(){s._operationTimeoutCb(s._attempts)},s._operationTimeout),s._options.unref&&s._timeout.unref()),s._fn(s._attempts)},t),this._options.unref&&this._timer.unref(),!0};ce.prototype.attempt=function(r,e){this._fn=r,e&&(e.timeout&&(this._operationTimeout=e.timeout),e.cb&&(this._operationTimeoutCb=e.cb));var t=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){t._operationTimeoutCb()},t._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};ce.prototype.try=function(r){console.log("Using RetryOperation.try() is deprecated"),this.attempt(r)};ce.prototype.start=function(r){console.log("Using RetryOperation.start() is deprecated"),this.attempt(r)};ce.prototype.start=ce.prototype.try;ce.prototype.errors=function(){return this._errors};ce.prototype.attempts=function(){return this._attempts};ce.prototype.mainError=function(){if(this._errors.length===0)return null;for(var r={},e=null,t=0,s=0;s<this._errors.length;s++){var i=this._errors[s],n=i.message,o=(r[n]||0)+1;r[n]=o,o>=t&&(e=i,t=o)}return e}});var Uc=E(Ft=>{u();var Mp=jc();Ft.operation=function(r){var e=Ft.timeouts(r);return new Mp(e,{forever:r&&(r.forever||r.retries===1/0),unref:r&&r.unref,maxRetryTime:r&&r.maxRetryTime})};Ft.timeouts=function(r){if(r instanceof Array)return[].concat(r);var e={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var t in r)e[t]=r[t];if(e.minTimeout>e.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var s=[],i=0;i<e.retries;i++)s.push(this.createTimeout(i,e));return r&&r.forever&&!s.length&&s.push(this.createTimeout(i,e)),s.sort(function(n,o){return n-o}),s};Ft.createTimeout=function(r,e){var t=e.randomize?Math.random()+1:1,s=Math.round(t*Math.max(e.minTimeout,1)*Math.pow(e.factor,r));return s=Math.min(s,e.maxTimeout),s};Ft.wrap=function(r,e,t){if(e instanceof Array&&(t=e,e=null),!t){t=[];for(var s in r)typeof r[s]=="function"&&t.push(s)}for(var i=0;i<t.length;i++){var n=t[i],o=r[n];r[n]=function(l){var c=Ft.operation(e),h=Array.prototype.slice.call(arguments,1),m=h.pop();h.push(function(D){c.retry(D)||(D&&(arguments[0]=c.mainError()),m.apply(this,arguments))}),c.attempt(function(){l.apply(r,h)})}.bind(r,o),r[n].options=e}}});var $c=E((v0,qc)=>{u();qc.exports=Uc()});var zc=E((B0,Wc)=>{u();var Ip=$c();function jp(r,e){function t(s,i){var n=e||{},o;"randomize"in n||(n.randomize=!0),o=Ip.operation(n);function a(h){i(h||new Error("Aborted"))}function l(h,m){if(h.bail){a(h);return}o.retry(h)?n.onRetry&&n.onRetry(h,m):i(o.mainError())}function c(h){var m;try{m=r(a,h)}catch(D){l(D,h);return}Promise.resolve(m).then(s).catch(function(A){l(A,h)})}o.attempt(c)}return new Promise(t)}Wc.exports=jp});var wm={};Fl(wm,{ConvertError:()=>R,MANAGERS:()=>qe,convert:()=>Cm,getPackageManagerMeta:()=>ro,getWorkspaceDetails:()=>to,install:()=>Js});module.exports=bl(wm);u();u();u();u();var Tl=w(ho());u();u();function ei(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}u();u();function ar(r){return ar=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ar(r)}u();function ti(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function ri(r,e){if(e&&(ar(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ti(r)}u();function lt(r){return lt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},lt(r)}u();u();function Se(r,e){return Se=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(s,i){return s.__proto__=i,s},Se(r,e)}function si(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),e&&Se(r,e)}u();u();function ii(r){return Function.toString.call(r).indexOf("[native code]")!==-1}u();u();function ni(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Bt(r,e,t){return ni()?Bt=Reflect.construct.bind():Bt=function(i,n,o){var a=[null];a.push.apply(a,n);var l=Function.bind.apply(i,a),c=new l;return o&&Se(c,o.prototype),c},Bt.apply(null,arguments)}function cr(r){var e=typeof Map=="function"?new Map:void 0;return cr=function(s){if(s===null||!ii(s))return s;if(typeof s!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(s))return e.get(s);e.set(s,i)}function i(){return Bt(s,arguments,lt(this).constructor)}return i.prototype=Object.create(s.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),Se(i,s)},cr(r)}var Bo=w(vo());var Pl=w(require("fs-extra")),ad=function(r){si(e,r);function e(t){var s;return ei(this,e),s=ri(this,lt(e).call(this,"No package.json could be found upwards from the directory ".concat(t))),s.directory=t,s}return e}(cr(Error));u();u();var Nl=w(require("fs")),Ll=w(require("path"));u();var Wl=w(require("fs")),zl=w(require("path")),Gl=w(require("js-yaml")),Hl=require("fast-glob");u();var Ot=require("picocolors"),jl=w(require("ora")),xo=w(require("gradient-string")),Oo="#0099F7",To="#F11712",Ul="#FFFF00",fi=r=>{let e=ql(r);return t=>`\x1B[38;5;${e}m${t}${(0,Ot.reset)("")}`},gd=(0,xo.default)(Oo,To),Ed=fi(Oo),yd=fi(To),Ad=fi(Ul);function ql(r){let e=parseInt(r.slice(1),16),t=Math.floor(e/(256*256))%256,s=Math.floor(e/256)%256,i=e%256;return 16+36*Math.round(t/255*5)+6*Math.round(s/255*5)+Math.round(i/255*5)}u();var No=w(require("os")),Lo=w(require("execa"));async function Ur(r,e=[],t){let s={cwd:No.default.tmpdir(),env:{COREPACK_ENABLE_STRICT:"0"},...t};try{let{stdout:i}=await(0,Lo.default)(r,e,s);return i.trim()}catch{return}}async function pi(){let[r,e,t,s]=await Promise.all([Ur("yarnpkg",["--version"],{cwd:"."}),Ur("npm",["--version"]),Ur("pnpm",["--version"]),Ur("bun",["--version"])]);return{yarn:r,pnpm:t,npm:e,bun:s}}u();var Jl=w(require("fs-extra"));u();var Vl=w(require("path")),Yl=w(require("fs-extra")),Kl=w(require("picocolors"));u();var Nc=require("stream"),Lc=require("util"),Tp=require("path"),Pp=require("os"),Mc=require("fs"),Np=w(Pc());var b0=(0,Lc.promisify)(Nc.Stream.pipeline);u();var Lp=w(require("fs-extra"));u();var Jp=w(require("path")),Vp=w(zc()),Yp=w(require("picocolors")),Kp=w(require("fs-extra"));u();u();var Zp=w(require("picocolors")),Xp=w(require("update-check"));u();u();u();var R=class extends Error{constructor(t,s){var i;super(t);this.name="ConvertError",this.type=(i=s==null?void 0:s.type)!=null?i:"unknown",Error.captureStackTrace(this,R)}};u();u();var bt=w(require("path")),me=w(require("fs-extra")),Qc=w(require("execa"));u();var Kc=w(require("path")),Zc=w(require("fs-extra")),Xc=w(require("picocolors"));u();var je=w(require("path")),Gc=w(require("execa")),te=require("fs-extra"),Hc=require("fast-glob"),Jc=w(require("js-yaml"));var Qp=/^(?!_)(?<manager>.+)@(?<version>.+)$/;function M({workspaceRoot:r}){let e=je.default.join(r,"package.json");try{return(0,te.readJsonSync)(e,"utf8")}catch(t){if(t&&typeof t=="object"&&"code"in t){if(t.code==="ENOENT")throw new R(`no "package.json" found at ${r}`,{type:"package_json-missing"});if(t.code==="EJSONPARSE")throw new R(`failed to parse "package.json" at ${r}`,{type:"package_json-parse_error"})}throw new Error(`unexpected error reading "package.json" at ${r}`)}}function st({workspaceRoot:r}){let{packageManager:e}=M({workspaceRoot:r});if(e)try{let t=Qp.exec(e);if(t){let[s,i]=t;return i}}catch{}}function Ue({workspaceRoot:r}){let e=M({workspaceRoot:r}),t=je.default.basename(r),{name:s=t,description:i}=e;return{name:s,description:i}}function eo({workspaceRoot:r}){let e=je.default.join(r,"pnpm-workspace.yaml");if((0,te.existsSync)(e))try{let t=Jc.default.load((0,te.readFileSync)(e,"utf8"));if(t instanceof Object&&"packages"in t&&Array.isArray(t.packages))return t.packages}catch{throw new R(`failed to parse ${e}`,{type:"pnpm-workspace_parse_error"})}return[]}function it({root:r,lockFile:e,workspaceConfig:t}){let s=n=>je.default.join(r,n),i={root:r,lockfile:s(e),packageJson:s("package.json"),nodeModules:s("node_modules")};return t&&(i.workspaceConfig=s(t)),i}function rr({workspaces:r}){var e;return r?Array.isArray(r)?r:"packages"in r?(e=r.packages)!=null?e:[]:[]:[]}function nt({workspaceRoot:r,workspaceGlobs:e}){if(!e)return[];let t=e.filter(s=>s.startsWith("!")).map(s=>s.slice(1));return e.filter(s=>!s.startsWith("!")).flatMap(s=>{let i=[`${s}/package.json`];return(0,Hc.sync)(i,{onlyFiles:!0,absolute:!0,cwd:r,ignore:["**/node_modules/**",...t]})}).map(s=>{let i=je.default.dirname(s),{name:n,description:o}=Ue({workspaceRoot:i});return{name:n,description:o,paths:{root:i,packageJson:s,nodeModules:je.default.join(i,"node_modules")}}})}function Vc({directory:r}){let e=je.default.resolve(process.cwd(),r);return{exists:(0,te.existsSync)(e),absolute:e}}function le({packageManager:r,action:e,project:t}){let s=t.workspaceData.globs.length>0;return`${e==="remove"?"Removing":"Adding"} ${r} ${s?"workspaces":""} ${e==="remove"?"from":"to"} ${t.name}`}function Yc({project:r}){let e=t=>!(t.includes("*")&&(t.includes("**")||t.split("/").slice(0,-1).join("/").includes("*"))||["!","[","]","{","}"].some(s=>t.includes(s)));return r.workspaceData.globs.every(e)}function re({project:r,options:e}){e!=null&&e.dry||(0,te.rmSync)(r.paths.lockfile,{force:!0})}async function Hs({project:r,options:e}){if(!(e!=null&&e.dry)&&(0,te.existsSync)(r.paths.lockfile))try{let{stdout:t}=await(0,Gc.default)("bun",["bun.lockb"],{stdin:"ignore",cwd:r.paths.root,preferLocal:!0,shell:process.platform==="win32"});await(0,te.writeFile)(je.default.join(r.paths.root,"yarn.lock"),t)}catch{}finally{(0,te.rmSync)(r.paths.lockfile,{force:!0})}}function em({dependencyList:r,project:e,to:t}){let s=[];return e.workspaceData.workspaces.forEach(i=>{let{name:n}=i;if(r[n]){let o=r[n],a=o.startsWith("workspace:")?o.slice(10):o;r[n]=t.name==="pnpm"?`workspace:${a}`:a,s.push(n)}}),{dependencyList:r,updated:s}}function he({project:r,workspace:e,to:t,logger:s,options:i}){if(["yarn","npm","bun"].includes(t.name)&&["yarn","npm","bun"].includes(r.packageManager))return;let n=M({workspaceRoot:e.paths.root}),o={dependencies:[],devDependencies:[],peerDependencies:[],optionalDependencies:[]},a=["dependencies","devDependencies","peerDependencies","optionalDependencies"];a.forEach(m=>{let D=n[m];if(D){let{updated:A,dependencyList:b}=em({dependencyList:D,project:r,to:t});n[m]=b,o[m]=A}});let l=m=>{let D=o[m].length;if(D>0)return`${Xc.default.green(D.toString())} ${m}`},c=a.map(l).filter(Boolean),h=`./${Kc.default.relative(r.paths.root,e.paths.packageJson)}`;if(c.length>=1){let m="updating";c.forEach((D,A)=>{c.length===1?m+=` ${D} in ${h}`:A===c.length-1?m+=`and ${D} in ${h}`:m+=` ${D}, `}),s.workspaceStep(m)}else s.workspaceStep(`no workspace dependencies found in ${h}`);i!=null&&i.dry||Zc.default.writeJSONSync(e.paths.packageJson,n,{spaces:2})}var ot={name:"pnpm",lock:"pnpm-lock.yaml"};async function el(r){let e=bt.default.join(r.workspaceRoot,ot.lock),t=bt.default.join(r.workspaceRoot,"pnpm-workspace.yaml"),s=st({workspaceRoot:r.workspaceRoot});return me.default.existsSync(e)||me.default.existsSync(t)||s===ot.name}async function tm(r){if(!await el(r))throw new R("Not a pnpm project",{type:"package_manager-unexpected"});let{name:t,description:s}=Ue(r);return{name:t,description:s,packageManager:ot.name,paths:it({root:r.workspaceRoot,lockFile:ot.lock,workspaceConfig:"pnpm-workspace.yaml"}),workspaceData:{globs:eo(r),workspaces:nt({workspaceGlobs:eo(r),...r})}}}async function rm(r){let{project:e,to:t,logger:s,options:i}=r,n=e.workspaceData.globs.length>0;s.mainStep(le({action:"create",packageManager:ot.name,project:e}));let o=M({workspaceRoot:e.paths.root});s.rootHeader(),o.packageManager=`${t.name}@${t.version}`,s.rootStep(`adding "packageManager" field to ${e.name} root "package.json"`),i!=null&&i.dry||(me.default.writeJSONSync(e.paths.packageJson,o,{spaces:2}),n&&(s.rootStep('adding "pnpm-workspace.yaml"'),me.default.writeFileSync(bt.default.join(e.paths.root,"pnpm-workspace.yaml"),`packages:
1
+ "use strict";var gl=Object.create;var Pr=Object.defineProperty;var El=Object.getOwnPropertyDescriptor;var yl=Object.getOwnPropertyNames;var Al=Object.getPrototypeOf,Cl=Object.prototype.hasOwnProperty;var wl=(r,e)=>()=>(r&&(e=r(r=0)),e);var E=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),Fl=(r,e)=>{for(var t in e)Pr(r,t,{get:e[t],enumerable:!0})},no=(r,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of yl(e))!Cl.call(r,i)&&i!==t&&Pr(r,i,{get:()=>e[i],enumerable:!(s=El(e,i))||s.enumerable});return r};var w=(r,e,t)=>(t=r!=null?gl(Al(r)):{},no(e||!r||!r.__esModule?Pr(t,"default",{value:r,enumerable:!0}):t,r)),bl=r=>no(Pr({},"__esModule",{value:!0}),r);var u=wl(()=>{});var oo=E((km,Fe)=>{u();function Qs(r){return Fe.exports=Qs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Fe.exports.__esModule=!0,Fe.exports.default=Fe.exports,Qs(r)}Fe.exports=Qs,Fe.exports.__esModule=!0,Fe.exports.default=Fe.exports});var co=E((_m,be)=>{u();var uo=oo().default;function ao(){"use strict";be.exports=ao=function(){return e},be.exports.__esModule=!0,be.exports.default=be.exports;var r,e={},t=Object.prototype,s=t.hasOwnProperty,i=Object.defineProperty||function(g,p,d){g[p]=d.value},n=typeof Symbol=="function"?Symbol:{},o=n.iterator||"@@iterator",a=n.asyncIterator||"@@asyncIterator",l=n.toStringTag||"@@toStringTag";function c(g,p,d){return Object.defineProperty(g,p,{value:d,enumerable:!0,configurable:!0,writable:!0}),g[p]}try{c({},"")}catch{c=function(d,y,F){return d[y]=F}}function h(g,p,d,y){var F=p&&p.prototype instanceof x?p:x,C=Object.create(F.prototype),P=new Zs(y||[]);return i(C,"_invoke",{value:dl(g,d,P)}),C}function m(g,p,d){try{return{type:"normal",arg:g.call(p,d)}}catch(y){return{type:"throw",arg:y}}}e.wrap=h;var D="suspendedStart",A="suspendedYield",b="executing",T="completed",S={};function x(){}function ut(){}function de(){}var Vs={};c(Vs,o,function(){return this});var Ys=Object.getPrototypeOf,Or=Ys&&Ys(Ys(Xs([])));Or&&Or!==t&&s.call(Or,o)&&(Vs=Or);var vt=de.prototype=x.prototype=Object.create(Vs);function so(g){["next","throw","return"].forEach(function(p){c(g,p,function(d){return this._invoke(p,d)})})}function Tr(g,p){function d(F,C,P,G){var H=m(g[F],g,C);if(H.type!=="throw"){var at=H.arg,$e=at.value;return $e&&uo($e)=="object"&&s.call($e,"__await")?p.resolve($e.__await).then(function(ct){d("next",ct,P,G)},function(ct){d("throw",ct,P,G)}):p.resolve($e).then(function(ct){at.value=ct,P(at)},function(ct){return d("throw",ct,P,G)})}G(H.arg)}var y;i(this,"_invoke",{value:function(C,P){function G(){return new p(function(H,at){d(C,P,H,at)})}return y=y?y.then(G,G):G()}})}function dl(g,p,d){var y=D;return function(F,C){if(y===b)throw new Error("Generator is already running");if(y===T){if(F==="throw")throw C;return{value:r,done:!0}}for(d.method=F,d.arg=C;;){var P=d.delegate;if(P){var G=io(P,d);if(G){if(G===S)continue;return G}}if(d.method==="next")d.sent=d._sent=d.arg;else if(d.method==="throw"){if(y===D)throw y=T,d.arg;d.dispatchException(d.arg)}else d.method==="return"&&d.abrupt("return",d.arg);y=b;var H=m(g,p,d);if(H.type==="normal"){if(y=d.done?T:A,H.arg===S)continue;return{value:H.arg,done:d.done}}H.type==="throw"&&(y=T,d.method="throw",d.arg=H.arg)}}}function io(g,p){var d=p.method,y=g.iterator[d];if(y===r)return p.delegate=null,d==="throw"&&g.iterator.return&&(p.method="return",p.arg=r,io(g,p),p.method==="throw")||d!=="return"&&(p.method="throw",p.arg=new TypeError("The iterator does not provide a '"+d+"' method")),S;var F=m(y,g.iterator,p.arg);if(F.type==="throw")return p.method="throw",p.arg=F.arg,p.delegate=null,S;var C=F.arg;return C?C.done?(p[g.resultName]=C.value,p.next=g.nextLoc,p.method!=="return"&&(p.method="next",p.arg=r),p.delegate=null,S):C:(p.method="throw",p.arg=new TypeError("iterator result is not an object"),p.delegate=null,S)}function Dl(g){var p={tryLoc:g[0]};1 in g&&(p.catchLoc=g[1]),2 in g&&(p.finallyLoc=g[2],p.afterLoc=g[3]),this.tryEntries.push(p)}function Ks(g){var p=g.completion||{};p.type="normal",delete p.arg,g.completion=p}function Zs(g){this.tryEntries=[{tryLoc:"root"}],g.forEach(Dl,this),this.reset(!0)}function Xs(g){if(g||g===""){var p=g[o];if(p)return p.call(g);if(typeof g.next=="function")return g;if(!isNaN(g.length)){var d=-1,y=function F(){for(;++d<g.length;)if(s.call(g,d))return F.value=g[d],F.done=!1,F;return F.value=r,F.done=!0,F};return y.next=y}}throw new TypeError(uo(g)+" is not iterable")}return ut.prototype=de,i(vt,"constructor",{value:de,configurable:!0}),i(de,"constructor",{value:ut,configurable:!0}),ut.displayName=c(de,l,"GeneratorFunction"),e.isGeneratorFunction=function(g){var p=typeof g=="function"&&g.constructor;return!!p&&(p===ut||(p.displayName||p.name)==="GeneratorFunction")},e.mark=function(g){return Object.setPrototypeOf?Object.setPrototypeOf(g,de):(g.__proto__=de,c(g,l,"GeneratorFunction")),g.prototype=Object.create(vt),g},e.awrap=function(g){return{__await:g}},so(Tr.prototype),c(Tr.prototype,a,function(){return this}),e.AsyncIterator=Tr,e.async=function(g,p,d,y,F){F===void 0&&(F=Promise);var C=new Tr(h(g,p,d,y),F);return e.isGeneratorFunction(p)?C:C.next().then(function(P){return P.done?P.value:C.next()})},so(vt),c(vt,l,"Generator"),c(vt,o,function(){return this}),c(vt,"toString",function(){return"[object Generator]"}),e.keys=function(g){var p=Object(g),d=[];for(var y in p)d.push(y);return d.reverse(),function F(){for(;d.length;){var C=d.pop();if(C in p)return F.value=C,F.done=!1,F}return F.done=!0,F}},e.values=Xs,Zs.prototype={constructor:Zs,reset:function(p){if(this.prev=0,this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(Ks),!p)for(var d in this)d.charAt(0)==="t"&&s.call(this,d)&&!isNaN(+d.slice(1))&&(this[d]=r)},stop:function(){this.done=!0;var p=this.tryEntries[0].completion;if(p.type==="throw")throw p.arg;return this.rval},dispatchException:function(p){if(this.done)throw p;var d=this;function y(at,$e){return P.type="throw",P.arg=p,d.next=at,$e&&(d.method="next",d.arg=r),!!$e}for(var F=this.tryEntries.length-1;F>=0;--F){var C=this.tryEntries[F],P=C.completion;if(C.tryLoc==="root")return y("end");if(C.tryLoc<=this.prev){var G=s.call(C,"catchLoc"),H=s.call(C,"finallyLoc");if(G&&H){if(this.prev<C.catchLoc)return y(C.catchLoc,!0);if(this.prev<C.finallyLoc)return y(C.finallyLoc)}else if(G){if(this.prev<C.catchLoc)return y(C.catchLoc,!0)}else{if(!H)throw new Error("try statement without catch or finally");if(this.prev<C.finallyLoc)return y(C.finallyLoc)}}}},abrupt:function(p,d){for(var y=this.tryEntries.length-1;y>=0;--y){var F=this.tryEntries[y];if(F.tryLoc<=this.prev&&s.call(F,"finallyLoc")&&this.prev<F.finallyLoc){var C=F;break}}C&&(p==="break"||p==="continue")&&C.tryLoc<=d&&d<=C.finallyLoc&&(C=null);var P=C?C.completion:{};return P.type=p,P.arg=d,C?(this.method="next",this.next=C.finallyLoc,S):this.complete(P)},complete:function(p,d){if(p.type==="throw")throw p.arg;return p.type==="break"||p.type==="continue"?this.next=p.arg:p.type==="return"?(this.rval=this.arg=p.arg,this.method="return",this.next="end"):p.type==="normal"&&d&&(this.next=d),S},finish:function(p){for(var d=this.tryEntries.length-1;d>=0;--d){var y=this.tryEntries[d];if(y.finallyLoc===p)return this.complete(y.completion,y.afterLoc),Ks(y),S}},catch:function(p){for(var d=this.tryEntries.length-1;d>=0;--d){var y=this.tryEntries[d];if(y.tryLoc===p){var F=y.completion;if(F.type==="throw"){var C=F.arg;Ks(y)}return C}}throw new Error("illegal catch attempt")},delegateYield:function(p,d,y){return this.delegate={iterator:Xs(p),resultName:d,nextLoc:y},this.method==="next"&&(this.arg=r),S}},e}be.exports=ao,be.exports.__esModule=!0,be.exports.default=be.exports});var ho=E((Rm,lo)=>{u();var Nr=co()();lo.exports=Nr;try{regeneratorRuntime=Nr}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=Nr:Function("r","regeneratorRuntime = r")(Nr)}});var po=E((Km,oi)=>{"use strict";u();var fo=(r,...e)=>new Promise(t=>{t(r(...e))});oi.exports=fo;oi.exports.default=fo});var Do=E((Zm,ui)=>{"use strict";u();var Sl=po(),mo=r=>{if(!((Number.isInteger(r)||r===1/0)&&r>0))return Promise.reject(new TypeError("Expected `concurrency` to be a number from 1 and up"));let e=[],t=0,s=()=>{t--,e.length>0&&e.shift()()},i=(a,l,...c)=>{t++;let h=Sl(a,...c);l(h),h.then(s,s)},n=(a,l,...c)=>{t<r?i(a,l,...c):e.push(i.bind(null,a,l,...c))},o=(a,...l)=>new Promise(c=>n(a,c,...l));return Object.defineProperties(o,{activeCount:{get:()=>t},pendingCount:{get:()=>e.length},clearQueue:{value:()=>{e.length=0}}}),o};ui.exports=mo;ui.exports.default=mo});var yo=E((Xm,ai)=>{"use strict";u();var go=Do(),Lr=class extends Error{constructor(e){super(),this.value=e}},kl=async(r,e)=>e(await r),_l=async r=>{let e=await Promise.all(r);if(e[1]===!0)throw new Lr(e[0]);return!1},Eo=async(r,e,t)=>{t={concurrency:1/0,preserveOrder:!0,...t};let s=go(t.concurrency),i=[...r].map(o=>[o,s(kl,o,e)]),n=go(t.preserveOrder?1:1/0);try{await Promise.all(i.map(o=>n(_l,o)))}catch(o){if(o instanceof Lr)return o.value;throw o}};ai.exports=Eo;ai.exports.default=Eo});var So=E((Qm,ci)=>{"use strict";u();var Ao=require("path"),Mr=require("fs"),{promisify:Co}=require("util"),Rl=yo(),vl=Co(Mr.stat),Bl=Co(Mr.lstat),wo={directory:"isDirectory",file:"isFile"};function Fo({type:r}){if(!(r in wo))throw new Error(`Invalid type specified: ${r}`)}var bo=(r,e)=>r===void 0||e[wo[r]]();ci.exports=async(r,e)=>{e={cwd:process.cwd(),type:"file",allowSymlinks:!0,...e},Fo(e);let t=e.allowSymlinks?vl:Bl;return Rl(r,async s=>{try{let i=await t(Ao.resolve(e.cwd,s));return bo(e.type,i)}catch{return!1}},e)};ci.exports.sync=(r,e)=>{e={cwd:process.cwd(),allowSymlinks:!0,type:"file",...e},Fo(e);let t=e.allowSymlinks?Mr.statSync:Mr.lstatSync;for(let s of r)try{let i=t(Ao.resolve(e.cwd,s));if(bo(e.type,i))return s}catch{}}});var _o=E((ed,li)=>{"use strict";u();var ko=require("fs"),{promisify:xl}=require("util"),Ol=xl(ko.access);li.exports=async r=>{try{return await Ol(r),!0}catch{return!1}};li.exports.sync=r=>{try{return ko.accessSync(r),!0}catch{return!1}}});var vo=E((td,xt)=>{"use strict";u();var We=require("path"),Ir=So(),Ro=_o(),hi=Symbol("findUp.stop");xt.exports=async(r,e={})=>{let t=We.resolve(e.cwd||""),{root:s}=We.parse(t),i=[].concat(r),n=async o=>{if(typeof r!="function")return Ir(i,o);let a=await r(o.cwd);return typeof a=="string"?Ir([a],o):a};for(;;){let o=await n({...e,cwd:t});if(o===hi)return;if(o)return We.resolve(t,o);if(t===s)return;t=We.dirname(t)}};xt.exports.sync=(r,e={})=>{let t=We.resolve(e.cwd||""),{root:s}=We.parse(t),i=[].concat(r),n=o=>{if(typeof r!="function")return Ir.sync(i,o);let a=r(o.cwd);return typeof a=="string"?Ir.sync([a],o):a};for(;;){let o=n({...e,cwd:t});if(o===hi)return;if(o)return We.resolve(t,o);if(t===s)return;t=We.dirname(t)}};xt.exports.exists=Ro;xt.exports.sync.exists=Ro.sync;xt.exports.stop=hi});var Tt=E((Bd,jo)=>{"use strict";u();var Io=new Map([["C","cwd"],["f","file"],["z","gzip"],["P","preservePaths"],["U","unlink"],["strip-components","strip"],["stripComponents","strip"],["keep-newer","newer"],["keepNewer","newer"],["keep-newer-files","newer"],["keepNewerFiles","newer"],["k","keep"],["keep-existing","keep"],["keepExisting","keep"],["m","noMtime"],["no-mtime","noMtime"],["p","preserveOwner"],["L","follow"],["h","follow"]]);jo.exports=r=>r?Object.keys(r).map(e=>[Io.has(e)?Io.get(e):e,r[e]]).reduce((e,t)=>(e[t[0]]=t[1],e),Object.create(null)):{}});var Hr=E((xd,Vo)=>{"use strict";u();var Uo=typeof process=="object"&&process?process:{stdout:null,stderr:null},Xl=require("events"),qo=require("stream"),$o=require("string_decoder").StringDecoder,ke=Symbol("EOF"),_e=Symbol("maybeEmitEnd"),ze=Symbol("emittedEnd"),qr=Symbol("emittingEnd"),lr=Symbol("emittedError"),$r=Symbol("closed"),Wo=Symbol("read"),Wr=Symbol("flush"),zo=Symbol("flushChunk"),J=Symbol("encoding"),Re=Symbol("decoder"),zr=Symbol("flowing"),hr=Symbol("paused"),Pt=Symbol("resume"),N=Symbol("buffer"),De=Symbol("pipes"),I=Symbol("bufferLength"),mi=Symbol("bufferPush"),di=Symbol("bufferShift"),U=Symbol("objectMode"),q=Symbol("destroyed"),Di=Symbol("emitData"),Go=Symbol("emitEnd"),gi=Symbol("emitEnd2"),ve=Symbol("async"),fr=r=>Promise.resolve().then(r),Ho=global._MP_NO_ITERATOR_SYMBOLS_!=="1",Ql=Ho&&Symbol.asyncIterator||Symbol("asyncIterator not implemented"),eh=Ho&&Symbol.iterator||Symbol("iterator not implemented"),th=r=>r==="end"||r==="finish"||r==="prefinish",rh=r=>r instanceof ArrayBuffer||typeof r=="object"&&r.constructor&&r.constructor.name==="ArrayBuffer"&&r.byteLength>=0,sh=r=>!Buffer.isBuffer(r)&&ArrayBuffer.isView(r),Gr=class{constructor(e,t,s){this.src=e,this.dest=t,this.opts=s,this.ondrain=()=>e[Pt](),t.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},Ei=class extends Gr{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,t,s){super(e,t,s),this.proxyErrors=i=>t.emit("error",i),e.on("error",this.proxyErrors)}};Vo.exports=class Jo extends qo{constructor(e){super(),this[zr]=!1,this[hr]=!1,this[De]=[],this[N]=[],this[U]=e&&e.objectMode||!1,this[U]?this[J]=null:this[J]=e&&e.encoding||null,this[J]==="buffer"&&(this[J]=null),this[ve]=e&&!!e.async||!1,this[Re]=this[J]?new $o(this[J]):null,this[ke]=!1,this[ze]=!1,this[qr]=!1,this[$r]=!1,this[lr]=null,this.writable=!0,this.readable=!0,this[I]=0,this[q]=!1,e&&e.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[N]}),e&&e.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[De]})}get bufferLength(){return this[I]}get encoding(){return this[J]}set encoding(e){if(this[U])throw new Error("cannot set encoding in objectMode");if(this[J]&&e!==this[J]&&(this[Re]&&this[Re].lastNeed||this[I]))throw new Error("cannot change encoding");this[J]!==e&&(this[Re]=e?new $o(e):null,this[N].length&&(this[N]=this[N].map(t=>this[Re].write(t)))),this[J]=e}setEncoding(e){this.encoding=e}get objectMode(){return this[U]}set objectMode(e){this[U]=this[U]||!!e}get async(){return this[ve]}set async(e){this[ve]=this[ve]||!!e}write(e,t,s){if(this[ke])throw new Error("write after end");if(this[q])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof t=="function"&&(s=t,t="utf8"),t||(t="utf8");let i=this[ve]?fr:n=>n();return!this[U]&&!Buffer.isBuffer(e)&&(sh(e)?e=Buffer.from(e.buffer,e.byteOffset,e.byteLength):rh(e)?e=Buffer.from(e):typeof e!="string"&&(this.objectMode=!0)),this[U]?(this.flowing&&this[I]!==0&&this[Wr](!0),this.flowing?this.emit("data",e):this[mi](e),this[I]!==0&&this.emit("readable"),s&&i(s),this.flowing):e.length?(typeof e=="string"&&!(t===this[J]&&!this[Re].lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[J]&&(e=this[Re].write(e)),this.flowing&&this[I]!==0&&this[Wr](!0),this.flowing?this.emit("data",e):this[mi](e),this[I]!==0&&this.emit("readable"),s&&i(s),this.flowing):(this[I]!==0&&this.emit("readable"),s&&i(s),this.flowing)}read(e){if(this[q])return null;if(this[I]===0||e===0||e>this[I])return this[_e](),null;this[U]&&(e=null),this[N].length>1&&!this[U]&&(this.encoding?this[N]=[this[N].join("")]:this[N]=[Buffer.concat(this[N],this[I])]);let t=this[Wo](e||null,this[N][0]);return this[_e](),t}[Wo](e,t){return e===t.length||e===null?this[di]():(this[N][0]=t.slice(e),t=t.slice(0,e),this[I]-=e),this.emit("data",t),!this[N].length&&!this[ke]&&this.emit("drain"),t}end(e,t,s){return typeof e=="function"&&(s=e,e=null),typeof t=="function"&&(s=t,t="utf8"),e&&this.write(e,t),s&&this.once("end",s),this[ke]=!0,this.writable=!1,(this.flowing||!this[hr])&&this[_e](),this}[Pt](){this[q]||(this[hr]=!1,this[zr]=!0,this.emit("resume"),this[N].length?this[Wr]():this[ke]?this[_e]():this.emit("drain"))}resume(){return this[Pt]()}pause(){this[zr]=!1,this[hr]=!0}get destroyed(){return this[q]}get flowing(){return this[zr]}get paused(){return this[hr]}[mi](e){this[U]?this[I]+=1:this[I]+=e.length,this[N].push(e)}[di](){return this[N].length&&(this[U]?this[I]-=1:this[I]-=this[N][0].length),this[N].shift()}[Wr](e){do;while(this[zo](this[di]()));!e&&!this[N].length&&!this[ke]&&this.emit("drain")}[zo](e){return e?(this.emit("data",e),this.flowing):!1}pipe(e,t){if(this[q])return;let s=this[ze];return t=t||{},e===Uo.stdout||e===Uo.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,s?t.end&&e.end():(this[De].push(t.proxyErrors?new Ei(this,e,t):new Gr(this,e,t)),this[ve]?fr(()=>this[Pt]()):this[Pt]()),e}unpipe(e){let t=this[De].find(s=>s.dest===e);t&&(this[De].splice(this[De].indexOf(t),1),t.unpipe())}addListener(e,t){return this.on(e,t)}on(e,t){let s=super.on(e,t);return e==="data"&&!this[De].length&&!this.flowing?this[Pt]():e==="readable"&&this[I]!==0?super.emit("readable"):th(e)&&this[ze]?(super.emit(e),this.removeAllListeners(e)):e==="error"&&this[lr]&&(this[ve]?fr(()=>t.call(this,this[lr])):t.call(this,this[lr])),s}get emittedEnd(){return this[ze]}[_e](){!this[qr]&&!this[ze]&&!this[q]&&this[N].length===0&&this[ke]&&(this[qr]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[$r]&&this.emit("close"),this[qr]=!1)}emit(e,t,...s){if(e!=="error"&&e!=="close"&&e!==q&&this[q])return;if(e==="data")return t?this[ve]?fr(()=>this[Di](t)):this[Di](t):!1;if(e==="end")return this[Go]();if(e==="close"){if(this[$r]=!0,!this[ze]&&!this[q])return;let n=super.emit("close");return this.removeAllListeners("close"),n}else if(e==="error"){this[lr]=t;let n=super.emit("error",t);return this[_e](),n}else if(e==="resume"){let n=super.emit("resume");return this[_e](),n}else if(e==="finish"||e==="prefinish"){let n=super.emit(e);return this.removeAllListeners(e),n}let i=super.emit(e,t,...s);return this[_e](),i}[Di](e){for(let s of this[De])s.dest.write(e)===!1&&this.pause();let t=super.emit("data",e);return this[_e](),t}[Go](){this[ze]||(this[ze]=!0,this.readable=!1,this[ve]?fr(()=>this[gi]()):this[gi]())}[gi](){if(this[Re]){let t=this[Re].end();if(t){for(let s of this[De])s.dest.write(t);super.emit("data",t)}}for(let t of this[De])t.end();let e=super.emit("end");return this.removeAllListeners("end"),e}collect(){let e=[];this[U]||(e.dataLength=0);let t=this.promise();return this.on("data",s=>{e.push(s),this[U]||(e.dataLength+=s.length)}),t.then(()=>e)}concat(){return this[U]?Promise.reject(new Error("cannot concat in objectMode")):this.collect().then(e=>this[U]?Promise.reject(new Error("cannot concat in objectMode")):this[J]?e.join(""):Buffer.concat(e,e.dataLength))}promise(){return new Promise((e,t)=>{this.on(q,()=>t(new Error("stream destroyed"))),this.on("error",s=>t(s)),this.on("end",()=>e())})}[Ql](){return{next:()=>{let t=this.read();if(t!==null)return Promise.resolve({done:!1,value:t});if(this[ke])return Promise.resolve({done:!0});let s=null,i=null,n=c=>{this.removeListener("data",o),this.removeListener("end",a),i(c)},o=c=>{this.removeListener("error",n),this.removeListener("end",a),this.pause(),s({value:c,done:!!this[ke]})},a=()=>{this.removeListener("error",n),this.removeListener("data",o),s({done:!0})},l=()=>n(new Error("stream destroyed"));return new Promise((c,h)=>{i=h,s=c,this.once(q,l),this.once("error",n),this.once("end",a),this.once("data",o)})}}}[eh](){return{next:()=>{let t=this.read();return{value:t,done:t===null}}}}destroy(e){return this[q]?(e?this.emit("error",e):this.emit(q),this):(this[q]=!0,this[N].length=0,this[I]=0,typeof this.close=="function"&&!this[$r]&&this.close(),e?this.emit("error",e):this.emit(q),this)}static isStream(e){return!!e&&(e instanceof Jo||e instanceof qo||e instanceof Xl&&(typeof e.pipe=="function"||typeof e.write=="function"&&typeof e.end=="function"))}}});var Ko=E((Od,Yo)=>{u();var ih=require("zlib").constants||{ZLIB_VERNUM:4736};Yo.exports=Object.freeze(Object.assign(Object.create(null),{Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_VERSION_ERROR:-6,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,DEFLATE:1,INFLATE:2,GZIP:3,GUNZIP:4,DEFLATERAW:5,INFLATERAW:6,UNZIP:7,BROTLI_DECODE:8,BROTLI_ENCODE:9,Z_MIN_WINDOWBITS:8,Z_MAX_WINDOWBITS:15,Z_DEFAULT_WINDOWBITS:15,Z_MIN_CHUNK:64,Z_MAX_CHUNK:1/0,Z_DEFAULT_CHUNK:16384,Z_MIN_MEMLEVEL:1,Z_MAX_MEMLEVEL:9,Z_DEFAULT_MEMLEVEL:8,Z_MIN_LEVEL:-1,Z_MAX_LEVEL:9,Z_DEFAULT_LEVEL:-1,BROTLI_OPERATION_PROCESS:0,BROTLI_OPERATION_FLUSH:1,BROTLI_OPERATION_FINISH:2,BROTLI_OPERATION_EMIT_METADATA:3,BROTLI_MODE_GENERIC:0,BROTLI_MODE_TEXT:1,BROTLI_MODE_FONT:2,BROTLI_DEFAULT_MODE:0,BROTLI_MIN_QUALITY:0,BROTLI_MAX_QUALITY:11,BROTLI_DEFAULT_QUALITY:11,BROTLI_MIN_WINDOW_BITS:10,BROTLI_MAX_WINDOW_BITS:24,BROTLI_LARGE_MAX_WINDOW_BITS:30,BROTLI_DEFAULT_WINDOW:22,BROTLI_MIN_INPUT_BLOCK_BITS:16,BROTLI_MAX_INPUT_BLOCK_BITS:24,BROTLI_PARAM_MODE:0,BROTLI_PARAM_QUALITY:1,BROTLI_PARAM_LGWIN:2,BROTLI_PARAM_LGBLOCK:3,BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING:4,BROTLI_PARAM_SIZE_HINT:5,BROTLI_PARAM_LARGE_WINDOW:6,BROTLI_PARAM_NPOSTFIX:7,BROTLI_PARAM_NDIRECT:8,BROTLI_DECODER_RESULT_ERROR:0,BROTLI_DECODER_RESULT_SUCCESS:1,BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT:2,BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION:0,BROTLI_DECODER_PARAM_LARGE_WINDOW:1,BROTLI_DECODER_NO_ERROR:0,BROTLI_DECODER_SUCCESS:1,BROTLI_DECODER_NEEDS_MORE_INPUT:2,BROTLI_DECODER_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE:-1,BROTLI_DECODER_ERROR_FORMAT_RESERVED:-2,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE:-3,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET:-4,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME:-5,BROTLI_DECODER_ERROR_FORMAT_CL_SPACE:-6,BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE:-7,BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT:-8,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1:-9,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2:-10,BROTLI_DECODER_ERROR_FORMAT_TRANSFORM:-11,BROTLI_DECODER_ERROR_FORMAT_DICTIONARY:-12,BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS:-13,BROTLI_DECODER_ERROR_FORMAT_PADDING_1:-14,BROTLI_DECODER_ERROR_FORMAT_PADDING_2:-15,BROTLI_DECODER_ERROR_FORMAT_DISTANCE:-16,BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET:-19,BROTLI_DECODER_ERROR_INVALID_ARGUMENTS:-20,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES:-21,BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS:-22,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP:-25,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1:-26,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2:-27,BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES:-30,BROTLI_DECODER_ERROR_UNREACHABLE:-31},ih))});var bi=E((Td,nu)=>{"use strict";u();var Zo=typeof process=="object"&&process?process:{stdout:null,stderr:null},nh=require("events"),Xo=require("stream"),Qo=require("string_decoder").StringDecoder,Be=Symbol("EOF"),xe=Symbol("maybeEmitEnd"),Ge=Symbol("emittedEnd"),Jr=Symbol("emittingEnd"),pr=Symbol("emittedError"),Vr=Symbol("closed"),eu=Symbol("read"),Yr=Symbol("flush"),tu=Symbol("flushChunk"),V=Symbol("encoding"),Oe=Symbol("decoder"),Kr=Symbol("flowing"),mr=Symbol("paused"),Nt=Symbol("resume"),j=Symbol("bufferLength"),yi=Symbol("bufferPush"),Ai=Symbol("bufferShift"),$=Symbol("objectMode"),W=Symbol("destroyed"),Ci=Symbol("emitData"),ru=Symbol("emitEnd"),wi=Symbol("emitEnd2"),Te=Symbol("async"),dr=r=>Promise.resolve().then(r),su=global._MP_NO_ITERATOR_SYMBOLS_!=="1",oh=su&&Symbol.asyncIterator||Symbol("asyncIterator not implemented"),uh=su&&Symbol.iterator||Symbol("iterator not implemented"),ah=r=>r==="end"||r==="finish"||r==="prefinish",ch=r=>r instanceof ArrayBuffer||typeof r=="object"&&r.constructor&&r.constructor.name==="ArrayBuffer"&&r.byteLength>=0,lh=r=>!Buffer.isBuffer(r)&&ArrayBuffer.isView(r),Zr=class{constructor(e,t,s){this.src=e,this.dest=t,this.opts=s,this.ondrain=()=>e[Nt](),t.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},Fi=class extends Zr{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,t,s){super(e,t,s),this.proxyErrors=i=>t.emit("error",i),e.on("error",this.proxyErrors)}};nu.exports=class iu extends Xo{constructor(e){super(),this[Kr]=!1,this[mr]=!1,this.pipes=[],this.buffer=[],this[$]=e&&e.objectMode||!1,this[$]?this[V]=null:this[V]=e&&e.encoding||null,this[V]==="buffer"&&(this[V]=null),this[Te]=e&&!!e.async||!1,this[Oe]=this[V]?new Qo(this[V]):null,this[Be]=!1,this[Ge]=!1,this[Jr]=!1,this[Vr]=!1,this[pr]=null,this.writable=!0,this.readable=!0,this[j]=0,this[W]=!1}get bufferLength(){return this[j]}get encoding(){return this[V]}set encoding(e){if(this[$])throw new Error("cannot set encoding in objectMode");if(this[V]&&e!==this[V]&&(this[Oe]&&this[Oe].lastNeed||this[j]))throw new Error("cannot change encoding");this[V]!==e&&(this[Oe]=e?new Qo(e):null,this.buffer.length&&(this.buffer=this.buffer.map(t=>this[Oe].write(t)))),this[V]=e}setEncoding(e){this.encoding=e}get objectMode(){return this[$]}set objectMode(e){this[$]=this[$]||!!e}get async(){return this[Te]}set async(e){this[Te]=this[Te]||!!e}write(e,t,s){if(this[Be])throw new Error("write after end");if(this[W])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof t=="function"&&(s=t,t="utf8"),t||(t="utf8");let i=this[Te]?dr:n=>n();return!this[$]&&!Buffer.isBuffer(e)&&(lh(e)?e=Buffer.from(e.buffer,e.byteOffset,e.byteLength):ch(e)?e=Buffer.from(e):typeof e!="string"&&(this.objectMode=!0)),this[$]?(this.flowing&&this[j]!==0&&this[Yr](!0),this.flowing?this.emit("data",e):this[yi](e),this[j]!==0&&this.emit("readable"),s&&i(s),this.flowing):e.length?(typeof e=="string"&&!(t===this[V]&&!this[Oe].lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[V]&&(e=this[Oe].write(e)),this.flowing&&this[j]!==0&&this[Yr](!0),this.flowing?this.emit("data",e):this[yi](e),this[j]!==0&&this.emit("readable"),s&&i(s),this.flowing):(this[j]!==0&&this.emit("readable"),s&&i(s),this.flowing)}read(e){if(this[W])return null;if(this[j]===0||e===0||e>this[j])return this[xe](),null;this[$]&&(e=null),this.buffer.length>1&&!this[$]&&(this.encoding?this.buffer=[this.buffer.join("")]:this.buffer=[Buffer.concat(this.buffer,this[j])]);let t=this[eu](e||null,this.buffer[0]);return this[xe](),t}[eu](e,t){return e===t.length||e===null?this[Ai]():(this.buffer[0]=t.slice(e),t=t.slice(0,e),this[j]-=e),this.emit("data",t),!this.buffer.length&&!this[Be]&&this.emit("drain"),t}end(e,t,s){return typeof e=="function"&&(s=e,e=null),typeof t=="function"&&(s=t,t="utf8"),e&&this.write(e,t),s&&this.once("end",s),this[Be]=!0,this.writable=!1,(this.flowing||!this[mr])&&this[xe](),this}[Nt](){this[W]||(this[mr]=!1,this[Kr]=!0,this.emit("resume"),this.buffer.length?this[Yr]():this[Be]?this[xe]():this.emit("drain"))}resume(){return this[Nt]()}pause(){this[Kr]=!1,this[mr]=!0}get destroyed(){return this[W]}get flowing(){return this[Kr]}get paused(){return this[mr]}[yi](e){this[$]?this[j]+=1:this[j]+=e.length,this.buffer.push(e)}[Ai](){return this.buffer.length&&(this[$]?this[j]-=1:this[j]-=this.buffer[0].length),this.buffer.shift()}[Yr](e){do;while(this[tu](this[Ai]()));!e&&!this.buffer.length&&!this[Be]&&this.emit("drain")}[tu](e){return e?(this.emit("data",e),this.flowing):!1}pipe(e,t){if(this[W])return;let s=this[Ge];return t=t||{},e===Zo.stdout||e===Zo.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,s?t.end&&e.end():(this.pipes.push(t.proxyErrors?new Fi(this,e,t):new Zr(this,e,t)),this[Te]?dr(()=>this[Nt]()):this[Nt]()),e}unpipe(e){let t=this.pipes.find(s=>s.dest===e);t&&(this.pipes.splice(this.pipes.indexOf(t),1),t.unpipe())}addListener(e,t){return this.on(e,t)}on(e,t){let s=super.on(e,t);return e==="data"&&!this.pipes.length&&!this.flowing?this[Nt]():e==="readable"&&this[j]!==0?super.emit("readable"):ah(e)&&this[Ge]?(super.emit(e),this.removeAllListeners(e)):e==="error"&&this[pr]&&(this[Te]?dr(()=>t.call(this,this[pr])):t.call(this,this[pr])),s}get emittedEnd(){return this[Ge]}[xe](){!this[Jr]&&!this[Ge]&&!this[W]&&this.buffer.length===0&&this[Be]&&(this[Jr]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Vr]&&this.emit("close"),this[Jr]=!1)}emit(e,t,...s){if(e!=="error"&&e!=="close"&&e!==W&&this[W])return;if(e==="data")return t?this[Te]?dr(()=>this[Ci](t)):this[Ci](t):!1;if(e==="end")return this[ru]();if(e==="close"){if(this[Vr]=!0,!this[Ge]&&!this[W])return;let n=super.emit("close");return this.removeAllListeners("close"),n}else if(e==="error"){this[pr]=t;let n=super.emit("error",t);return this[xe](),n}else if(e==="resume"){let n=super.emit("resume");return this[xe](),n}else if(e==="finish"||e==="prefinish"){let n=super.emit(e);return this.removeAllListeners(e),n}let i=super.emit(e,t,...s);return this[xe](),i}[Ci](e){for(let s of this.pipes)s.dest.write(e)===!1&&this.pause();let t=super.emit("data",e);return this[xe](),t}[ru](){this[Ge]||(this[Ge]=!0,this.readable=!1,this[Te]?dr(()=>this[wi]()):this[wi]())}[wi](){if(this[Oe]){let t=this[Oe].end();if(t){for(let s of this.pipes)s.dest.write(t);super.emit("data",t)}}for(let t of this.pipes)t.end();let e=super.emit("end");return this.removeAllListeners("end"),e}collect(){let e=[];this[$]||(e.dataLength=0);let t=this.promise();return this.on("data",s=>{e.push(s),this[$]||(e.dataLength+=s.length)}),t.then(()=>e)}concat(){return this[$]?Promise.reject(new Error("cannot concat in objectMode")):this.collect().then(e=>this[$]?Promise.reject(new Error("cannot concat in objectMode")):this[V]?e.join(""):Buffer.concat(e,e.dataLength))}promise(){return new Promise((e,t)=>{this.on(W,()=>t(new Error("stream destroyed"))),this.on("error",s=>t(s)),this.on("end",()=>e())})}[oh](){return{next:()=>{let t=this.read();if(t!==null)return Promise.resolve({done:!1,value:t});if(this[Be])return Promise.resolve({done:!0});let s=null,i=null,n=c=>{this.removeListener("data",o),this.removeListener("end",a),i(c)},o=c=>{this.removeListener("error",n),this.removeListener("end",a),this.pause(),s({value:c,done:!!this[Be]})},a=()=>{this.removeListener("error",n),this.removeListener("data",o),s({done:!0})},l=()=>n(new Error("stream destroyed"));return new Promise((c,h)=>{i=h,s=c,this.once(W,l),this.once("error",n),this.once("end",a),this.once("data",o)})}}}[uh](){return{next:()=>{let t=this.read();return{value:t,done:t===null}}}}destroy(e){return this[W]?(e?this.emit("error",e):this.emit(W),this):(this[W]=!0,this.buffer.length=0,this[j]=0,typeof this.close=="function"&&!this[Vr]&&this.close(),e?this.emit("error",e):this.emit(W),this)}static isStream(e){return!!e&&(e instanceof iu||e instanceof Xo||e instanceof nh&&(typeof e.pipe=="function"||typeof e.write=="function"&&typeof e.end=="function"))}}});var Ui=E(Z=>{"use strict";u();var vi=require("assert"),He=require("buffer").Buffer,au=require("zlib"),ht=Z.constants=Ko(),hh=bi(),ou=He.concat,ft=Symbol("_superWrite"),Mt=class extends Error{constructor(e){super("zlib: "+e.message),this.code=e.code,this.errno=e.errno,this.code||(this.code="ZLIB_ERROR"),this.message="zlib: "+e.message,Error.captureStackTrace(this,this.constructor)}get name(){return"ZlibError"}},fh=Symbol("opts"),Dr=Symbol("flushFlag"),uu=Symbol("finishFlushFlag"),ji=Symbol("fullFlushFlag"),B=Symbol("handle"),Xr=Symbol("onError"),Lt=Symbol("sawError"),Si=Symbol("level"),ki=Symbol("strategy"),_i=Symbol("ended"),Pd=Symbol("_defaultFullFlush"),Qr=class extends hh{constructor(e,t){if(!e||typeof e!="object")throw new TypeError("invalid options for ZlibBase constructor");super(e),this[Lt]=!1,this[_i]=!1,this[fh]=e,this[Dr]=e.flush,this[uu]=e.finishFlush;try{this[B]=new au[t](e)}catch(s){throw new Mt(s)}this[Xr]=s=>{this[Lt]||(this[Lt]=!0,this.close(),this.emit("error",s))},this[B].on("error",s=>this[Xr](new Mt(s))),this.once("end",()=>this.close)}close(){this[B]&&(this[B].close(),this[B]=null,this.emit("close"))}reset(){if(!this[Lt])return vi(this[B],"zlib binding closed"),this[B].reset()}flush(e){this.ended||(typeof e!="number"&&(e=this[ji]),this.write(Object.assign(He.alloc(0),{[Dr]:e})))}end(e,t,s){return e&&this.write(e,t),this.flush(this[uu]),this[_i]=!0,super.end(null,null,s)}get ended(){return this[_i]}write(e,t,s){if(typeof t=="function"&&(s=t,t="utf8"),typeof e=="string"&&(e=He.from(e,t)),this[Lt])return;vi(this[B],"zlib binding closed");let i=this[B]._handle,n=i.close;i.close=()=>{};let o=this[B].close;this[B].close=()=>{},He.concat=c=>c;let a;try{let c=typeof e[Dr]=="number"?e[Dr]:this[Dr];a=this[B]._processChunk(e,c),He.concat=ou}catch(c){He.concat=ou,this[Xr](new Mt(c))}finally{this[B]&&(this[B]._handle=i,i.close=n,this[B].close=o,this[B].removeAllListeners("error"))}this[B]&&this[B].on("error",c=>this[Xr](new Mt(c)));let l;if(a)if(Array.isArray(a)&&a.length>0){l=this[ft](He.from(a[0]));for(let c=1;c<a.length;c++)l=this[ft](a[c])}else l=this[ft](He.from(a));return s&&s(),l}[ft](e){return super.write(e)}},Pe=class extends Qr{constructor(e,t){e=e||{},e.flush=e.flush||ht.Z_NO_FLUSH,e.finishFlush=e.finishFlush||ht.Z_FINISH,super(e,t),this[ji]=ht.Z_FULL_FLUSH,this[Si]=e.level,this[ki]=e.strategy}params(e,t){if(!this[Lt]){if(!this[B])throw new Error("cannot switch params when binding is closed");if(!this[B].params)throw new Error("not supported in this implementation");if(this[Si]!==e||this[ki]!==t){this.flush(ht.Z_SYNC_FLUSH),vi(this[B],"zlib binding closed");let s=this[B].flush;this[B].flush=(i,n)=>{this.flush(i),n()};try{this[B].params(e,t)}finally{this[B].flush=s}this[B]&&(this[Si]=e,this[ki]=t)}}}},Bi=class extends Pe{constructor(e){super(e,"Deflate")}},xi=class extends Pe{constructor(e){super(e,"Inflate")}},Ri=Symbol("_portable"),Oi=class extends Pe{constructor(e){super(e,"Gzip"),this[Ri]=e&&!!e.portable}[ft](e){return this[Ri]?(this[Ri]=!1,e[9]=255,super[ft](e)):super[ft](e)}},Ti=class extends Pe{constructor(e){super(e,"Gunzip")}},Pi=class extends Pe{constructor(e){super(e,"DeflateRaw")}},Ni=class extends Pe{constructor(e){super(e,"InflateRaw")}},Li=class extends Pe{constructor(e){super(e,"Unzip")}},es=class extends Qr{constructor(e,t){e=e||{},e.flush=e.flush||ht.BROTLI_OPERATION_PROCESS,e.finishFlush=e.finishFlush||ht.BROTLI_OPERATION_FINISH,super(e,t),this[ji]=ht.BROTLI_OPERATION_FLUSH}},Mi=class extends es{constructor(e){super(e,"BrotliCompress")}},Ii=class extends es{constructor(e){super(e,"BrotliDecompress")}};Z.Deflate=Bi;Z.Inflate=xi;Z.Gzip=Oi;Z.Gunzip=Ti;Z.DeflateRaw=Pi;Z.InflateRaw=Ni;Z.Unzip=Li;typeof au.BrotliCompress=="function"?(Z.BrotliCompress=Mi,Z.BrotliDecompress=Ii):Z.BrotliCompress=Z.BrotliDecompress=class{constructor(){throw new Error("Brotli is not supported in this version of Node.js")}}});var It=E((Md,cu)=>{u();var ph=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform;cu.exports=ph!=="win32"?r=>r:r=>r&&r.replace(/\\/g,"/")});var ts=E((jd,lu)=>{"use strict";u();var mh=Hr(),qi=It(),$i=Symbol("slurp");lu.exports=class extends mh{constructor(e,t,s){switch(super(),this.pause(),this.extended=t,this.globalExtended=s,this.header=e,this.startBlockSize=512*Math.ceil(e.size/512),this.blockRemain=this.startBlockSize,this.remain=e.size,this.type=e.type,this.meta=!1,this.ignore=!1,this.type){case"File":case"OldFile":case"Link":case"SymbolicLink":case"CharacterDevice":case"BlockDevice":case"Directory":case"FIFO":case"ContiguousFile":case"GNUDumpDir":break;case"NextFileHasLongLinkpath":case"NextFileHasLongPath":case"OldGnuLongPath":case"GlobalExtendedHeader":case"ExtendedHeader":case"OldExtendedHeader":this.meta=!0;break;default:this.ignore=!0}this.path=qi(e.path),this.mode=e.mode,this.mode&&(this.mode=this.mode&4095),this.uid=e.uid,this.gid=e.gid,this.uname=e.uname,this.gname=e.gname,this.size=e.size,this.mtime=e.mtime,this.atime=e.atime,this.ctime=e.ctime,this.linkpath=qi(e.linkpath),this.uname=e.uname,this.gname=e.gname,t&&this[$i](t),s&&this[$i](s,!0)}write(e){let t=e.length;if(t>this.blockRemain)throw new Error("writing more to entry than is appropriate");let s=this.remain,i=this.blockRemain;return this.remain=Math.max(0,s-t),this.blockRemain=Math.max(0,i-t),this.ignore?!0:s>=t?super.write(e):super.write(e.slice(0,s))}[$i](e,t){for(let s in e)e[s]!==null&&e[s]!==void 0&&!(t&&s==="path")&&(this[s]=s==="path"||s==="linkpath"?qi(e[s]):e[s])}}});var Wi=E(rs=>{"use strict";u();rs.name=new Map([["0","File"],["","OldFile"],["1","Link"],["2","SymbolicLink"],["3","CharacterDevice"],["4","BlockDevice"],["5","Directory"],["6","FIFO"],["7","ContiguousFile"],["g","GlobalExtendedHeader"],["x","ExtendedHeader"],["A","SolarisACL"],["D","GNUDumpDir"],["I","Inode"],["K","NextFileHasLongLinkpath"],["L","NextFileHasLongPath"],["M","ContinuationFile"],["N","OldGnuLongPath"],["S","SparseFile"],["V","TapeVolumeHeader"],["X","OldExtendedHeader"]]);rs.code=new Map(Array.from(rs.name).map(r=>[r[1],r[0]]))});var mu=E((qd,pu)=>{"use strict";u();var dh=(r,e)=>{if(Number.isSafeInteger(r))r<0?gh(r,e):Dh(r,e);else throw Error("cannot encode number outside of javascript safe integer range");return e},Dh=(r,e)=>{e[0]=128;for(var t=e.length;t>1;t--)e[t-1]=r&255,r=Math.floor(r/256)},gh=(r,e)=>{e[0]=255;var t=!1;r=r*-1;for(var s=e.length;s>1;s--){var i=r&255;r=Math.floor(r/256),t?e[s-1]=hu(i):i===0?e[s-1]=0:(t=!0,e[s-1]=fu(i))}},Eh=r=>{let e=r[0],t=e===128?Ah(r.slice(1,r.length)):e===255?yh(r):null;if(t===null)throw Error("invalid base256 encoding");if(!Number.isSafeInteger(t))throw Error("parsed number outside of javascript safe integer range");return t},yh=r=>{for(var e=r.length,t=0,s=!1,i=e-1;i>-1;i--){var n=r[i],o;s?o=hu(n):n===0?o=n:(s=!0,o=fu(n)),o!==0&&(t-=o*Math.pow(256,e-i-1))}return t},Ah=r=>{for(var e=r.length,t=0,s=e-1;s>-1;s--){var i=r[s];i!==0&&(t+=i*Math.pow(256,e-s-1))}return t},hu=r=>(255^r)&255,fu=r=>(255^r)+1&255;pu.exports={encode:dh,parse:Eh}});var Ut=E(($d,Du)=>{"use strict";u();var zi=Wi(),jt=require("path").posix,du=mu(),Gi=Symbol("slurp"),X=Symbol("type"),Vi=class{constructor(e,t,s,i){this.cksumValid=!1,this.needPax=!1,this.nullBlock=!1,this.block=null,this.path=null,this.mode=null,this.uid=null,this.gid=null,this.size=null,this.mtime=null,this.cksum=null,this[X]="0",this.linkpath=null,this.uname=null,this.gname=null,this.devmaj=0,this.devmin=0,this.atime=null,this.ctime=null,Buffer.isBuffer(e)?this.decode(e,t||0,s,i):e&&this.set(e)}decode(e,t,s,i){if(t||(t=0),!e||!(e.length>=t+512))throw new Error("need 512 bytes for header");if(this.path=pt(e,t,100),this.mode=Je(e,t+100,8),this.uid=Je(e,t+108,8),this.gid=Je(e,t+116,8),this.size=Je(e,t+124,12),this.mtime=Hi(e,t+136,12),this.cksum=Je(e,t+148,12),this[Gi](s),this[Gi](i,!0),this[X]=pt(e,t+156,1),this[X]===""&&(this[X]="0"),this[X]==="0"&&this.path.slice(-1)==="/"&&(this[X]="5"),this[X]==="5"&&(this.size=0),this.linkpath=pt(e,t+157,100),e.slice(t+257,t+265).toString()==="ustar\x0000")if(this.uname=pt(e,t+265,32),this.gname=pt(e,t+297,32),this.devmaj=Je(e,t+329,8),this.devmin=Je(e,t+337,8),e[t+475]!==0){let o=pt(e,t+345,155);this.path=o+"/"+this.path}else{let o=pt(e,t+345,130);o&&(this.path=o+"/"+this.path),this.atime=Hi(e,t+476,12),this.ctime=Hi(e,t+488,12)}let n=8*32;for(let o=t;o<t+148;o++)n+=e[o];for(let o=t+156;o<t+512;o++)n+=e[o];this.cksumValid=n===this.cksum,this.cksum===null&&n===8*32&&(this.nullBlock=!0)}[Gi](e,t){for(let s in e)e[s]!==null&&e[s]!==void 0&&!(t&&s==="path")&&(this[s]=e[s])}encode(e,t){if(e||(e=this.block=Buffer.alloc(512),t=0),t||(t=0),!(e.length>=t+512))throw new Error("need 512 bytes for header");let s=this.ctime||this.atime?130:155,i=Ch(this.path||"",s),n=i[0],o=i[1];this.needPax=i[2],this.needPax=mt(e,t,100,n)||this.needPax,this.needPax=Ve(e,t+100,8,this.mode)||this.needPax,this.needPax=Ve(e,t+108,8,this.uid)||this.needPax,this.needPax=Ve(e,t+116,8,this.gid)||this.needPax,this.needPax=Ve(e,t+124,12,this.size)||this.needPax,this.needPax=Ji(e,t+136,12,this.mtime)||this.needPax,e[t+156]=this[X].charCodeAt(0),this.needPax=mt(e,t+157,100,this.linkpath)||this.needPax,e.write("ustar\x0000",t+257,8),this.needPax=mt(e,t+265,32,this.uname)||this.needPax,this.needPax=mt(e,t+297,32,this.gname)||this.needPax,this.needPax=Ve(e,t+329,8,this.devmaj)||this.needPax,this.needPax=Ve(e,t+337,8,this.devmin)||this.needPax,this.needPax=mt(e,t+345,s,o)||this.needPax,e[t+475]!==0?this.needPax=mt(e,t+345,155,o)||this.needPax:(this.needPax=mt(e,t+345,130,o)||this.needPax,this.needPax=Ji(e,t+476,12,this.atime)||this.needPax,this.needPax=Ji(e,t+488,12,this.ctime)||this.needPax);let a=8*32;for(let l=t;l<t+148;l++)a+=e[l];for(let l=t+156;l<t+512;l++)a+=e[l];return this.cksum=a,Ve(e,t+148,8,this.cksum),this.cksumValid=!0,this.needPax}set(e){for(let t in e)e[t]!==null&&e[t]!==void 0&&(this[t]=e[t])}get type(){return zi.name.get(this[X])||this[X]}get typeKey(){return this[X]}set type(e){zi.code.has(e)?this[X]=zi.code.get(e):this[X]=e}},Ch=(r,e)=>{let s=r,i="",n,o=jt.parse(r).root||".";if(Buffer.byteLength(s)<100)n=[s,i,!1];else{i=jt.dirname(s),s=jt.basename(s);do Buffer.byteLength(s)<=100&&Buffer.byteLength(i)<=e?n=[s,i,!1]:Buffer.byteLength(s)>100&&Buffer.byteLength(i)<=e?n=[s.slice(0,100-1),i,!0]:(s=jt.join(jt.basename(i),s),i=jt.dirname(i));while(i!==o&&!n);n||(n=[r.slice(0,100-1),"",!0])}return n},pt=(r,e,t)=>r.slice(e,e+t).toString("utf8").replace(/\0.*/,""),Hi=(r,e,t)=>wh(Je(r,e,t)),wh=r=>r===null?null:new Date(r*1e3),Je=(r,e,t)=>r[e]&128?du.parse(r.slice(e,e+t)):bh(r,e,t),Fh=r=>isNaN(r)?null:r,bh=(r,e,t)=>Fh(parseInt(r.slice(e,e+t).toString("utf8").replace(/\0.*$/,"").trim(),8)),Sh={12:8589934591,8:2097151},Ve=(r,e,t,s)=>s===null?!1:s>Sh[t]||s<0?(du.encode(s,r.slice(e,e+t)),!0):(kh(r,e,t,s),!1),kh=(r,e,t,s)=>r.write(_h(s,t),e,t,"ascii"),_h=(r,e)=>Rh(Math.floor(r).toString(8),e),Rh=(r,e)=>(r.length===e-1?r:new Array(e-r.length-1).join("0")+r+" ")+"\0",Ji=(r,e,t,s)=>s===null?!1:Ve(r,e,t,s.getTime()/1e3),vh=new Array(156).join("\0"),mt=(r,e,t,s)=>s===null?!1:(r.write(s+vh,e,t,"utf8"),s.length!==Buffer.byteLength(s)||s.length>t);Du.exports=Vi});var ss=E((Wd,gu)=>{"use strict";u();var Bh=Ut(),xh=require("path"),gr=class{constructor(e,t){this.atime=e.atime||null,this.charset=e.charset||null,this.comment=e.comment||null,this.ctime=e.ctime||null,this.gid=e.gid||null,this.gname=e.gname||null,this.linkpath=e.linkpath||null,this.mtime=e.mtime||null,this.path=e.path||null,this.size=e.size||null,this.uid=e.uid||null,this.uname=e.uname||null,this.dev=e.dev||null,this.ino=e.ino||null,this.nlink=e.nlink||null,this.global=t||!1}encode(){let e=this.encodeBody();if(e==="")return null;let t=Buffer.byteLength(e),s=512*Math.ceil(1+t/512),i=Buffer.allocUnsafe(s);for(let n=0;n<512;n++)i[n]=0;new Bh({path:("PaxHeader/"+xh.basename(this.path)).slice(0,99),mode:this.mode||420,uid:this.uid||null,gid:this.gid||null,size:t,mtime:this.mtime||null,type:this.global?"GlobalExtendedHeader":"ExtendedHeader",linkpath:"",uname:this.uname||"",gname:this.gname||"",devmaj:0,devmin:0,atime:this.atime||null,ctime:this.ctime||null}).encode(i),i.write(e,512,t,"utf8");for(let n=t+512;n<i.length;n++)i[n]=0;return i}encodeBody(){return this.encodeField("path")+this.encodeField("ctime")+this.encodeField("atime")+this.encodeField("dev")+this.encodeField("ino")+this.encodeField("nlink")+this.encodeField("charset")+this.encodeField("comment")+this.encodeField("gid")+this.encodeField("gname")+this.encodeField("linkpath")+this.encodeField("mtime")+this.encodeField("size")+this.encodeField("uid")+this.encodeField("uname")}encodeField(e){if(this[e]===null||this[e]===void 0)return"";let t=this[e]instanceof Date?this[e].getTime()/1e3:this[e],s=" "+(e==="dev"||e==="ino"||e==="nlink"?"SCHILY.":"")+e+"="+t+`
2
+ `,i=Buffer.byteLength(s),n=Math.floor(Math.log(i)/Math.log(10))+1;return i+n>=Math.pow(10,n)&&(n+=1),n+i+s}};gr.parse=(r,e,t)=>new gr(Oh(Th(r),e),t);var Oh=(r,e)=>e?Object.keys(r).reduce((t,s)=>(t[s]=r[s],t),e):r,Th=r=>r.replace(/\n$/,"").split(`
3
+ `).reduce(Ph,Object.create(null)),Ph=(r,e)=>{let t=parseInt(e,10);if(t!==Buffer.byteLength(e)+1)return r;e=e.slice((t+" ").length);let s=e.split("="),i=s.shift().replace(/^SCHILY\.(dev|ino|nlink)/,"$1");if(!i)return r;let n=s.join("=");return r[i]=/^([A-Z]+\.)?([mac]|birth|creation)time$/.test(i)?new Date(n*1e3):/^[0-9]+$/.test(n)?+n:n,r};gu.exports=gr});var qt=E((zd,Eu)=>{u();Eu.exports=r=>{let e=r.length-1,t=-1;for(;e>-1&&r.charAt(e)==="/";)t=e,e--;return t===-1?r:r.slice(0,t)}});var is=E((Gd,yu)=>{"use strict";u();yu.exports=r=>class extends r{warn(e,t,s={}){this.file&&(s.file=this.file),this.cwd&&(s.cwd=this.cwd),s.code=t instanceof Error&&t.code||e,s.tarCode=e,!this.strict&&s.recoverable!==!1?(t instanceof Error&&(s=Object.assign(t,s),t=t.message),this.emit("warn",s.tarCode,t,s)):t instanceof Error?this.emit("error",Object.assign(t,s)):this.emit("error",Object.assign(new Error(`${e}: ${t}`),s))}}});var Ki=E((Jd,Au)=>{"use strict";u();var ns=["|","<",">","?",":"],Yi=ns.map(r=>String.fromCharCode(61440+r.charCodeAt(0))),Nh=new Map(ns.map((r,e)=>[r,Yi[e]])),Lh=new Map(Yi.map((r,e)=>[r,ns[e]]));Au.exports={encode:r=>ns.reduce((e,t)=>e.split(t).join(Nh.get(t)),r),decode:r=>Yi.reduce((e,t)=>e.split(t).join(Lh.get(t)),r)}});var Zi=E((Vd,wu)=>{u();var{isAbsolute:Mh,parse:Cu}=require("path").win32;wu.exports=r=>{let e="",t=Cu(r);for(;Mh(r)||t.root;){let s=r.charAt(0)==="/"&&r.slice(0,4)!=="//?/"?"/":t.root;r=r.slice(s.length),e+=s,t=Cu(r)}return[e,r]}});var bu=E((Yd,Fu)=>{"use strict";u();Fu.exports=(r,e,t)=>(r&=4095,t&&(r=(r|384)&-19),e&&(r&256&&(r|=64),r&32&&(r|=8),r&4&&(r|=1)),r)});var an=E((Xd,Iu)=>{"use strict";u();var xu=Hr(),Ou=ss(),Tu=Ut(),Ee=require("fs"),Su=require("path"),ge=It(),Ih=qt(),Pu=(r,e)=>e?(r=ge(r).replace(/^\.(\/|$)/,""),Ih(e)+"/"+r):ge(r),jh=16*1024*1024,ku=Symbol("process"),_u=Symbol("file"),Ru=Symbol("directory"),Qi=Symbol("symlink"),vu=Symbol("hardlink"),Er=Symbol("header"),os=Symbol("read"),en=Symbol("lstat"),us=Symbol("onlstat"),tn=Symbol("onread"),rn=Symbol("onreadlink"),sn=Symbol("openfile"),nn=Symbol("onopenfile"),Ye=Symbol("close"),as=Symbol("mode"),on=Symbol("awaitDrain"),Xi=Symbol("ondrain"),ye=Symbol("prefix"),Bu=Symbol("hadError"),Nu=is(),Uh=Ki(),Lu=Zi(),Mu=bu(),cs=Nu(class extends xu{constructor(e,t){if(t=t||{},super(t),typeof e!="string")throw new TypeError("path is required");this.path=ge(e),this.portable=!!t.portable,this.myuid=process.getuid&&process.getuid()||0,this.myuser=process.env.USER||"",this.maxReadSize=t.maxReadSize||jh,this.linkCache=t.linkCache||new Map,this.statCache=t.statCache||new Map,this.preservePaths=!!t.preservePaths,this.cwd=ge(t.cwd||process.cwd()),this.strict=!!t.strict,this.noPax=!!t.noPax,this.noMtime=!!t.noMtime,this.mtime=t.mtime||null,this.prefix=t.prefix?ge(t.prefix):null,this.fd=null,this.blockLen=null,this.blockRemain=null,this.buf=null,this.offset=null,this.length=null,this.pos=null,this.remain=null,typeof t.onwarn=="function"&&this.on("warn",t.onwarn);let s=!1;if(!this.preservePaths){let[i,n]=Lu(this.path);i&&(this.path=n,s=i)}this.win32=!!t.win32||process.platform==="win32",this.win32&&(this.path=Uh.decode(this.path.replace(/\\/g,"/")),e=e.replace(/\\/g,"/")),this.absolute=ge(t.absolute||Su.resolve(this.cwd,e)),this.path===""&&(this.path="./"),s&&this.warn("TAR_ENTRY_INFO",`stripping ${s} from absolute path`,{entry:this,path:s+this.path}),this.statCache.has(this.absolute)?this[us](this.statCache.get(this.absolute)):this[en]()}emit(e,...t){return e==="error"&&(this[Bu]=!0),super.emit(e,...t)}[en](){Ee.lstat(this.absolute,(e,t)=>{if(e)return this.emit("error",e);this[us](t)})}[us](e){this.statCache.set(this.absolute,e),this.stat=e,e.isFile()||(e.size=0),this.type=$h(e),this.emit("stat",e),this[ku]()}[ku](){switch(this.type){case"File":return this[_u]();case"Directory":return this[Ru]();case"SymbolicLink":return this[Qi]();default:return this.end()}}[as](e){return Mu(e,this.type==="Directory",this.portable)}[ye](e){return Pu(e,this.prefix)}[Er](){this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.header=new Tu({path:this[ye](this.path),linkpath:this.type==="Link"?this[ye](this.linkpath):this.linkpath,mode:this[as](this.stat.mode),uid:this.portable?null:this.stat.uid,gid:this.portable?null:this.stat.gid,size:this.stat.size,mtime:this.noMtime?null:this.mtime||this.stat.mtime,type:this.type,uname:this.portable?null:this.stat.uid===this.myuid?this.myuser:"",atime:this.portable?null:this.stat.atime,ctime:this.portable?null:this.stat.ctime}),this.header.encode()&&!this.noPax&&super.write(new Ou({atime:this.portable?null:this.header.atime,ctime:this.portable?null:this.header.ctime,gid:this.portable?null:this.header.gid,mtime:this.noMtime?null:this.mtime||this.header.mtime,path:this[ye](this.path),linkpath:this.type==="Link"?this[ye](this.linkpath):this.linkpath,size:this.header.size,uid:this.portable?null:this.header.uid,uname:this.portable?null:this.header.uname,dev:this.portable?null:this.stat.dev,ino:this.portable?null:this.stat.ino,nlink:this.portable?null:this.stat.nlink}).encode()),super.write(this.header.block)}[Ru](){this.path.slice(-1)!=="/"&&(this.path+="/"),this.stat.size=0,this[Er](),this.end()}[Qi](){Ee.readlink(this.absolute,(e,t)=>{if(e)return this.emit("error",e);this[rn](t)})}[rn](e){this.linkpath=ge(e),this[Er](),this.end()}[vu](e){this.type="Link",this.linkpath=ge(Su.relative(this.cwd,e)),this.stat.size=0,this[Er](),this.end()}[_u](){if(this.stat.nlink>1){let e=this.stat.dev+":"+this.stat.ino;if(this.linkCache.has(e)){let t=this.linkCache.get(e);if(t.indexOf(this.cwd)===0)return this[vu](t)}this.linkCache.set(e,this.absolute)}if(this[Er](),this.stat.size===0)return this.end();this[sn]()}[sn](){Ee.open(this.absolute,"r",(e,t)=>{if(e)return this.emit("error",e);this[nn](t)})}[nn](e){if(this.fd=e,this[Bu])return this[Ye]();this.blockLen=512*Math.ceil(this.stat.size/512),this.blockRemain=this.blockLen;let t=Math.min(this.blockLen,this.maxReadSize);this.buf=Buffer.allocUnsafe(t),this.offset=0,this.pos=0,this.remain=this.stat.size,this.length=this.buf.length,this[os]()}[os](){let{fd:e,buf:t,offset:s,length:i,pos:n}=this;Ee.read(e,t,s,i,n,(o,a)=>{if(o)return this[Ye](()=>this.emit("error",o));this[tn](a)})}[Ye](e){Ee.close(this.fd,e)}[tn](e){if(e<=0&&this.remain>0){let i=new Error("encountered unexpected EOF");return i.path=this.absolute,i.syscall="read",i.code="EOF",this[Ye](()=>this.emit("error",i))}if(e>this.remain){let i=new Error("did not encounter expected EOF");return i.path=this.absolute,i.syscall="read",i.code="EOF",this[Ye](()=>this.emit("error",i))}if(e===this.remain)for(let i=e;i<this.length&&e<this.blockRemain;i++)this.buf[i+this.offset]=0,e++,this.remain++;let t=this.offset===0&&e===this.buf.length?this.buf:this.buf.slice(this.offset,this.offset+e);this.write(t)?this[Xi]():this[on](()=>this[Xi]())}[on](e){this.once("drain",e)}write(e){if(this.blockRemain<e.length){let t=new Error("writing more data than expected");return t.path=this.absolute,this.emit("error",t)}return this.remain-=e.length,this.blockRemain-=e.length,this.pos+=e.length,this.offset+=e.length,super.write(e)}[Xi](){if(!this.remain)return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),this[Ye](e=>e?this.emit("error",e):this.end());this.offset>=this.length&&(this.buf=Buffer.allocUnsafe(Math.min(this.blockRemain,this.buf.length)),this.offset=0),this.length=this.buf.length-this.offset,this[os]()}}),un=class extends cs{[en](){this[us](Ee.lstatSync(this.absolute))}[Qi](){this[rn](Ee.readlinkSync(this.absolute))}[sn](){this[nn](Ee.openSync(this.absolute,"r"))}[os](){let e=!0;try{let{fd:t,buf:s,offset:i,length:n,pos:o}=this,a=Ee.readSync(t,s,i,n,o);this[tn](a),e=!1}finally{if(e)try{this[Ye](()=>{})}catch{}}}[on](e){e()}[Ye](e){Ee.closeSync(this.fd),e()}},qh=Nu(class extends xu{constructor(e,t){t=t||{},super(t),this.preservePaths=!!t.preservePaths,this.portable=!!t.portable,this.strict=!!t.strict,this.noPax=!!t.noPax,this.noMtime=!!t.noMtime,this.readEntry=e,this.type=e.type,this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.prefix=t.prefix||null,this.path=ge(e.path),this.mode=this[as](e.mode),this.uid=this.portable?null:e.uid,this.gid=this.portable?null:e.gid,this.uname=this.portable?null:e.uname,this.gname=this.portable?null:e.gname,this.size=e.size,this.mtime=this.noMtime?null:t.mtime||e.mtime,this.atime=this.portable?null:e.atime,this.ctime=this.portable?null:e.ctime,this.linkpath=ge(e.linkpath),typeof t.onwarn=="function"&&this.on("warn",t.onwarn);let s=!1;if(!this.preservePaths){let[i,n]=Lu(this.path);i&&(this.path=n,s=i)}this.remain=e.size,this.blockRemain=e.startBlockSize,this.header=new Tu({path:this[ye](this.path),linkpath:this.type==="Link"?this[ye](this.linkpath):this.linkpath,mode:this.mode,uid:this.portable?null:this.uid,gid:this.portable?null:this.gid,size:this.size,mtime:this.noMtime?null:this.mtime,type:this.type,uname:this.portable?null:this.uname,atime:this.portable?null:this.atime,ctime:this.portable?null:this.ctime}),s&&this.warn("TAR_ENTRY_INFO",`stripping ${s} from absolute path`,{entry:this,path:s+this.path}),this.header.encode()&&!this.noPax&&super.write(new Ou({atime:this.portable?null:this.atime,ctime:this.portable?null:this.ctime,gid:this.portable?null:this.gid,mtime:this.noMtime?null:this.mtime,path:this[ye](this.path),linkpath:this.type==="Link"?this[ye](this.linkpath):this.linkpath,size:this.size,uid:this.portable?null:this.uid,uname:this.portable?null:this.uname,dev:this.portable?null:this.readEntry.dev,ino:this.portable?null:this.readEntry.ino,nlink:this.portable?null:this.readEntry.nlink}).encode()),super.write(this.header.block),e.pipe(this)}[ye](e){return Pu(e,this.prefix)}[as](e){return Mu(e,this.type==="Directory",this.portable)}write(e){let t=e.length;if(t>this.blockRemain)throw new Error("writing more to entry than is appropriate");return this.blockRemain-=t,super.write(e)}end(){return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),super.end()}});cs.Sync=un;cs.Tar=qh;var $h=r=>r.isFile()?"File":r.isDirectory()?"Directory":r.isSymbolicLink()?"SymbolicLink":"Unsupported";Iu.exports=cs});var Uu=E((Qd,ju)=>{"use strict";u();ju.exports=function(r){r.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}});var cn=E((e0,qu)=>{"use strict";u();qu.exports=k;k.Node=dt;k.create=k;function k(r){var e=this;if(e instanceof k||(e=new k),e.tail=null,e.head=null,e.length=0,r&&typeof r.forEach=="function")r.forEach(function(i){e.push(i)});else if(arguments.length>0)for(var t=0,s=arguments.length;t<s;t++)e.push(arguments[t]);return e}k.prototype.removeNode=function(r){if(r.list!==this)throw new Error("removing node which does not belong to this list");var e=r.next,t=r.prev;return e&&(e.prev=t),t&&(t.next=e),r===this.head&&(this.head=e),r===this.tail&&(this.tail=t),r.list.length--,r.next=null,r.prev=null,r.list=null,e};k.prototype.unshiftNode=function(r){if(r!==this.head){r.list&&r.list.removeNode(r);var e=this.head;r.list=this,r.next=e,e&&(e.prev=r),this.head=r,this.tail||(this.tail=r),this.length++}};k.prototype.pushNode=function(r){if(r!==this.tail){r.list&&r.list.removeNode(r);var e=this.tail;r.list=this,r.prev=e,e&&(e.next=r),this.tail=r,this.head||(this.head=r),this.length++}};k.prototype.push=function(){for(var r=0,e=arguments.length;r<e;r++)zh(this,arguments[r]);return this.length};k.prototype.unshift=function(){for(var r=0,e=arguments.length;r<e;r++)Gh(this,arguments[r]);return this.length};k.prototype.pop=function(){if(!!this.tail){var r=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,r}};k.prototype.shift=function(){if(!!this.head){var r=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,r}};k.prototype.forEach=function(r,e){e=e||this;for(var t=this.head,s=0;t!==null;s++)r.call(e,t.value,s,this),t=t.next};k.prototype.forEachReverse=function(r,e){e=e||this;for(var t=this.tail,s=this.length-1;t!==null;s--)r.call(e,t.value,s,this),t=t.prev};k.prototype.get=function(r){for(var e=0,t=this.head;t!==null&&e<r;e++)t=t.next;if(e===r&&t!==null)return t.value};k.prototype.getReverse=function(r){for(var e=0,t=this.tail;t!==null&&e<r;e++)t=t.prev;if(e===r&&t!==null)return t.value};k.prototype.map=function(r,e){e=e||this;for(var t=new k,s=this.head;s!==null;)t.push(r.call(e,s.value,this)),s=s.next;return t};k.prototype.mapReverse=function(r,e){e=e||this;for(var t=new k,s=this.tail;s!==null;)t.push(r.call(e,s.value,this)),s=s.prev;return t};k.prototype.reduce=function(r,e){var t,s=this.head;if(arguments.length>1)t=e;else if(this.head)s=this.head.next,t=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=0;s!==null;i++)t=r(t,s.value,i),s=s.next;return t};k.prototype.reduceReverse=function(r,e){var t,s=this.tail;if(arguments.length>1)t=e;else if(this.tail)s=this.tail.prev,t=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=this.length-1;s!==null;i--)t=r(t,s.value,i),s=s.prev;return t};k.prototype.toArray=function(){for(var r=new Array(this.length),e=0,t=this.head;t!==null;e++)r[e]=t.value,t=t.next;return r};k.prototype.toArrayReverse=function(){for(var r=new Array(this.length),e=0,t=this.tail;t!==null;e++)r[e]=t.value,t=t.prev;return r};k.prototype.slice=function(r,e){e=e||this.length,e<0&&(e+=this.length),r=r||0,r<0&&(r+=this.length);var t=new k;if(e<r||e<0)return t;r<0&&(r=0),e>this.length&&(e=this.length);for(var s=0,i=this.head;i!==null&&s<r;s++)i=i.next;for(;i!==null&&s<e;s++,i=i.next)t.push(i.value);return t};k.prototype.sliceReverse=function(r,e){e=e||this.length,e<0&&(e+=this.length),r=r||0,r<0&&(r+=this.length);var t=new k;if(e<r||e<0)return t;r<0&&(r=0),e>this.length&&(e=this.length);for(var s=this.length,i=this.tail;i!==null&&s>e;s--)i=i.prev;for(;i!==null&&s>r;s--,i=i.prev)t.push(i.value);return t};k.prototype.splice=function(r,e,...t){r>this.length&&(r=this.length-1),r<0&&(r=this.length+r);for(var s=0,i=this.head;i!==null&&s<r;s++)i=i.next;for(var n=[],s=0;i&&s<e;s++)n.push(i.value),i=this.removeNode(i);i===null&&(i=this.tail),i!==this.head&&i!==this.tail&&(i=i.prev);for(var s=0;s<t.length;s++)i=Wh(this,i,t[s]);return n};k.prototype.reverse=function(){for(var r=this.head,e=this.tail,t=r;t!==null;t=t.prev){var s=t.prev;t.prev=t.next,t.next=s}return this.head=e,this.tail=r,this};function Wh(r,e,t){var s=e===r.head?new dt(t,null,e,r):new dt(t,e,e.next,r);return s.next===null&&(r.tail=s),s.prev===null&&(r.head=s),r.length++,s}function zh(r,e){r.tail=new dt(e,r.tail,null,r),r.head||(r.head=r.tail),r.length++}function Gh(r,e){r.head=new dt(e,null,r.head,r),r.tail||(r.tail=r.head),r.length++}function dt(r,e,t,s){if(!(this instanceof dt))return new dt(r,e,t,s);this.list=s,this.value=r,e?(e.next=this,this.prev=e):this.prev=null,t?(t.prev=this,this.next=t):this.next=null}try{Uu()(k)}catch{}});var Es=E((r0,Vu)=>{"use strict";u();var Ds=class{constructor(e,t){this.path=e||"./",this.absolute=t,this.entry=null,this.stat=null,this.readdir=null,this.pending=!1,this.ignore=!1,this.piped=!1}},Hh=Hr(),Jh=Ui(),Vh=ts(),En=an(),Yh=En.Sync,Kh=En.Tar,Zh=cn(),$u=Buffer.alloc(1024),fs=Symbol("onStat"),ls=Symbol("ended"),Ae=Symbol("queue"),$t=Symbol("current"),Dt=Symbol("process"),hs=Symbol("processing"),Wu=Symbol("processJob"),Ce=Symbol("jobs"),ln=Symbol("jobDone"),ps=Symbol("addFSEntry"),zu=Symbol("addTarEntry"),mn=Symbol("stat"),dn=Symbol("readdir"),ms=Symbol("onreaddir"),ds=Symbol("pipe"),Gu=Symbol("entry"),hn=Symbol("entryOpt"),Dn=Symbol("writeEntryClass"),Ju=Symbol("write"),fn=Symbol("ondrain"),gs=require("fs"),Hu=require("path"),Xh=is(),pn=It(),yn=Xh(class extends Hh{constructor(e){super(e),e=e||Object.create(null),this.opt=e,this.file=e.file||"",this.cwd=e.cwd||process.cwd(),this.maxReadSize=e.maxReadSize,this.preservePaths=!!e.preservePaths,this.strict=!!e.strict,this.noPax=!!e.noPax,this.prefix=pn(e.prefix||""),this.linkCache=e.linkCache||new Map,this.statCache=e.statCache||new Map,this.readdirCache=e.readdirCache||new Map,this[Dn]=En,typeof e.onwarn=="function"&&this.on("warn",e.onwarn),this.portable=!!e.portable,this.zip=null,e.gzip?(typeof e.gzip!="object"&&(e.gzip={}),this.portable&&(e.gzip.portable=!0),this.zip=new Jh.Gzip(e.gzip),this.zip.on("data",t=>super.write(t)),this.zip.on("end",t=>super.end()),this.zip.on("drain",t=>this[fn]()),this.on("resume",t=>this.zip.resume())):this.on("drain",this[fn]),this.noDirRecurse=!!e.noDirRecurse,this.follow=!!e.follow,this.noMtime=!!e.noMtime,this.mtime=e.mtime||null,this.filter=typeof e.filter=="function"?e.filter:t=>!0,this[Ae]=new Zh,this[Ce]=0,this.jobs=+e.jobs||4,this[hs]=!1,this[ls]=!1}[Ju](e){return super.write(e)}add(e){return this.write(e),this}end(e){return e&&this.write(e),this[ls]=!0,this[Dt](),this}write(e){if(this[ls])throw new Error("write after end");return e instanceof Vh?this[zu](e):this[ps](e),this.flowing}[zu](e){let t=pn(Hu.resolve(this.cwd,e.path));if(!this.filter(e.path,e))e.resume();else{let s=new Ds(e.path,t,!1);s.entry=new Kh(e,this[hn](s)),s.entry.on("end",i=>this[ln](s)),this[Ce]+=1,this[Ae].push(s)}this[Dt]()}[ps](e){let t=pn(Hu.resolve(this.cwd,e));this[Ae].push(new Ds(e,t)),this[Dt]()}[mn](e){e.pending=!0,this[Ce]+=1;let t=this.follow?"stat":"lstat";gs[t](e.absolute,(s,i)=>{e.pending=!1,this[Ce]-=1,s?this.emit("error",s):this[fs](e,i)})}[fs](e,t){this.statCache.set(e.absolute,t),e.stat=t,this.filter(e.path,t)||(e.ignore=!0),this[Dt]()}[dn](e){e.pending=!0,this[Ce]+=1,gs.readdir(e.absolute,(t,s)=>{if(e.pending=!1,this[Ce]-=1,t)return this.emit("error",t);this[ms](e,s)})}[ms](e,t){this.readdirCache.set(e.absolute,t),e.readdir=t,this[Dt]()}[Dt](){if(!this[hs]){this[hs]=!0;for(let e=this[Ae].head;e!==null&&this[Ce]<this.jobs;e=e.next)if(this[Wu](e.value),e.value.ignore){let t=e.next;this[Ae].removeNode(e),e.next=t}this[hs]=!1,this[ls]&&!this[Ae].length&&this[Ce]===0&&(this.zip?this.zip.end($u):(super.write($u),super.end()))}}get[$t](){return this[Ae]&&this[Ae].head&&this[Ae].head.value}[ln](e){this[Ae].shift(),this[Ce]-=1,this[Dt]()}[Wu](e){if(!e.pending){if(e.entry){e===this[$t]&&!e.piped&&this[ds](e);return}if(e.stat||(this.statCache.has(e.absolute)?this[fs](e,this.statCache.get(e.absolute)):this[mn](e)),!!e.stat&&!e.ignore&&!(!this.noDirRecurse&&e.stat.isDirectory()&&!e.readdir&&(this.readdirCache.has(e.absolute)?this[ms](e,this.readdirCache.get(e.absolute)):this[dn](e),!e.readdir))){if(e.entry=this[Gu](e),!e.entry){e.ignore=!0;return}e===this[$t]&&!e.piped&&this[ds](e)}}}[hn](e){return{onwarn:(t,s,i)=>this.warn(t,s,i),noPax:this.noPax,cwd:this.cwd,absolute:e.absolute,preservePaths:this.preservePaths,maxReadSize:this.maxReadSize,strict:this.strict,portable:this.portable,linkCache:this.linkCache,statCache:this.statCache,noMtime:this.noMtime,mtime:this.mtime,prefix:this.prefix}}[Gu](e){this[Ce]+=1;try{return new this[Dn](e.path,this[hn](e)).on("end",()=>this[ln](e)).on("error",t=>this.emit("error",t))}catch(t){this.emit("error",t)}}[fn](){this[$t]&&this[$t].entry&&this[$t].entry.resume()}[ds](e){e.piped=!0,e.readdir&&e.readdir.forEach(i=>{let n=e.path,o=n==="./"?"":n.replace(/\/*$/,"/");this[ps](o+i)});let t=e.entry,s=this.zip;s?t.on("data",i=>{s.write(i)||t.pause()}):t.on("data",i=>{super.write(i)||t.pause()})}pause(){return this.zip&&this.zip.pause(),super.pause()}}),gn=class extends yn{constructor(e){super(e),this[Dn]=Yh}pause(){}resume(){}[mn](e){let t=this.follow?"statSync":"lstatSync";this[fs](e,gs[t](e.absolute))}[dn](e,t){this[ms](e,gs.readdirSync(e.absolute))}[ds](e){let t=e.entry,s=this.zip;e.readdir&&e.readdir.forEach(i=>{let n=e.path,o=n==="./"?"":n.replace(/\/*$/,"/");this[ps](o+i)}),s?t.on("data",i=>{s.write(i)}):t.on("data",i=>{super[Ju](i)})}};yn.Sync=gn;Vu.exports=yn});var Kt=E(Ar=>{"use strict";u();var Qh=bi(),ef=require("events").EventEmitter,Y=require("fs"),wn=Y.writev;if(!wn){let r=process.binding("fs"),e=r.FSReqWrap||r.FSReqCallback;wn=(t,s,i,n)=>{let o=(l,c)=>n(l,c,s),a=new e;a.oncomplete=o,r.writeBuffers(t,s,i,a)}}var Vt=Symbol("_autoClose"),fe=Symbol("_close"),yr=Symbol("_ended"),v=Symbol("_fd"),Yu=Symbol("_finished"),Ze=Symbol("_flags"),An=Symbol("_flush"),Fn=Symbol("_handleChunk"),bn=Symbol("_makeBuf"),Fs=Symbol("_mode"),ys=Symbol("_needDrain"),Ht=Symbol("_onerror"),Yt=Symbol("_onopen"),Cn=Symbol("_onread"),zt=Symbol("_onwrite"),Xe=Symbol("_open"),Ne=Symbol("_path"),gt=Symbol("_pos"),we=Symbol("_queue"),Gt=Symbol("_read"),Ku=Symbol("_readSize"),Ke=Symbol("_reading"),As=Symbol("_remain"),Zu=Symbol("_size"),Cs=Symbol("_write"),Wt=Symbol("_writing"),ws=Symbol("_defaultFlag"),Jt=Symbol("_errored"),bs=class extends Qh{constructor(e,t){if(t=t||{},super(t),this.readable=!0,this.writable=!1,typeof e!="string")throw new TypeError("path must be a string");this[Jt]=!1,this[v]=typeof t.fd=="number"?t.fd:null,this[Ne]=e,this[Ku]=t.readSize||16*1024*1024,this[Ke]=!1,this[Zu]=typeof t.size=="number"?t.size:1/0,this[As]=this[Zu],this[Vt]=typeof t.autoClose=="boolean"?t.autoClose:!0,typeof this[v]=="number"?this[Gt]():this[Xe]()}get fd(){return this[v]}get path(){return this[Ne]}write(){throw new TypeError("this is a readable stream")}end(){throw new TypeError("this is a readable stream")}[Xe](){Y.open(this[Ne],"r",(e,t)=>this[Yt](e,t))}[Yt](e,t){e?this[Ht](e):(this[v]=t,this.emit("open",t),this[Gt]())}[bn](){return Buffer.allocUnsafe(Math.min(this[Ku],this[As]))}[Gt](){if(!this[Ke]){this[Ke]=!0;let e=this[bn]();if(e.length===0)return process.nextTick(()=>this[Cn](null,0,e));Y.read(this[v],e,0,e.length,null,(t,s,i)=>this[Cn](t,s,i))}}[Cn](e,t,s){this[Ke]=!1,e?this[Ht](e):this[Fn](t,s)&&this[Gt]()}[fe](){if(this[Vt]&&typeof this[v]=="number"){let e=this[v];this[v]=null,Y.close(e,t=>t?this.emit("error",t):this.emit("close"))}}[Ht](e){this[Ke]=!0,this[fe](),this.emit("error",e)}[Fn](e,t){let s=!1;return this[As]-=e,e>0&&(s=super.write(e<t.length?t.slice(0,e):t)),(e===0||this[As]<=0)&&(s=!1,this[fe](),super.end()),s}emit(e,t){switch(e){case"prefinish":case"finish":break;case"drain":typeof this[v]=="number"&&this[Gt]();break;case"error":return this[Jt]?void 0:(this[Jt]=!0,super.emit(e,t));default:return super.emit(e,t)}}},Sn=class extends bs{[Xe](){let e=!0;try{this[Yt](null,Y.openSync(this[Ne],"r")),e=!1}finally{e&&this[fe]()}}[Gt](){let e=!0;try{if(!this[Ke]){this[Ke]=!0;do{let t=this[bn](),s=t.length===0?0:Y.readSync(this[v],t,0,t.length,null);if(!this[Fn](s,t))break}while(!0);this[Ke]=!1}e=!1}finally{e&&this[fe]()}}[fe](){if(this[Vt]&&typeof this[v]=="number"){let e=this[v];this[v]=null,Y.closeSync(e),this.emit("close")}}},Ss=class extends ef{constructor(e,t){t=t||{},super(t),this.readable=!1,this.writable=!0,this[Jt]=!1,this[Wt]=!1,this[yr]=!1,this[ys]=!1,this[we]=[],this[Ne]=e,this[v]=typeof t.fd=="number"?t.fd:null,this[Fs]=t.mode===void 0?438:t.mode,this[gt]=typeof t.start=="number"?t.start:null,this[Vt]=typeof t.autoClose=="boolean"?t.autoClose:!0;let s=this[gt]!==null?"r+":"w";this[ws]=t.flags===void 0,this[Ze]=this[ws]?s:t.flags,this[v]===null&&this[Xe]()}emit(e,t){if(e==="error"){if(this[Jt])return;this[Jt]=!0}return super.emit(e,t)}get fd(){return this[v]}get path(){return this[Ne]}[Ht](e){this[fe](),this[Wt]=!0,this.emit("error",e)}[Xe](){Y.open(this[Ne],this[Ze],this[Fs],(e,t)=>this[Yt](e,t))}[Yt](e,t){this[ws]&&this[Ze]==="r+"&&e&&e.code==="ENOENT"?(this[Ze]="w",this[Xe]()):e?this[Ht](e):(this[v]=t,this.emit("open",t),this[An]())}end(e,t){return e&&this.write(e,t),this[yr]=!0,!this[Wt]&&!this[we].length&&typeof this[v]=="number"&&this[zt](null,0),this}write(e,t){return typeof e=="string"&&(e=Buffer.from(e,t)),this[yr]?(this.emit("error",new Error("write() after end()")),!1):this[v]===null||this[Wt]||this[we].length?(this[we].push(e),this[ys]=!0,!1):(this[Wt]=!0,this[Cs](e),!0)}[Cs](e){Y.write(this[v],e,0,e.length,this[gt],(t,s)=>this[zt](t,s))}[zt](e,t){e?this[Ht](e):(this[gt]!==null&&(this[gt]+=t),this[we].length?this[An]():(this[Wt]=!1,this[yr]&&!this[Yu]?(this[Yu]=!0,this[fe](),this.emit("finish")):this[ys]&&(this[ys]=!1,this.emit("drain"))))}[An](){if(this[we].length===0)this[yr]&&this[zt](null,0);else if(this[we].length===1)this[Cs](this[we].pop());else{let e=this[we];this[we]=[],wn(this[v],e,this[gt],(t,s)=>this[zt](t,s))}}[fe](){if(this[Vt]&&typeof this[v]=="number"){let e=this[v];this[v]=null,Y.close(e,t=>t?this.emit("error",t):this.emit("close"))}}},kn=class extends Ss{[Xe](){let e;if(this[ws]&&this[Ze]==="r+")try{e=Y.openSync(this[Ne],this[Ze],this[Fs])}catch(t){if(t.code==="ENOENT")return this[Ze]="w",this[Xe]();throw t}else e=Y.openSync(this[Ne],this[Ze],this[Fs]);this[Yt](null,e)}[fe](){if(this[Vt]&&typeof this[v]=="number"){let e=this[v];this[v]=null,Y.closeSync(e),this.emit("close")}}[Cs](e){let t=!0;try{this[zt](null,Y.writeSync(this[v],e,0,e.length,this[gt])),t=!1}finally{if(t)try{this[fe]()}catch{}}}};Ar.ReadStream=bs;Ar.ReadStreamSync=Sn;Ar.WriteStream=Ss;Ar.WriteStreamSync=kn});var Os=E((n0,na)=>{"use strict";u();var tf=is(),rf=Ut(),sf=require("events"),nf=cn(),of=1024*1024,uf=ts(),Xu=ss(),af=Ui(),{nextTick:cf}=require("process"),_n=Buffer.from([31,139]),ie=Symbol("state"),Et=Symbol("writeEntry"),Le=Symbol("readEntry"),Rn=Symbol("nextEntry"),Qu=Symbol("processEntry"),ne=Symbol("extendedHeader"),Cr=Symbol("globalExtendedHeader"),Qe=Symbol("meta"),ea=Symbol("emitMeta"),O=Symbol("buffer"),Me=Symbol("queue"),yt=Symbol("ended"),ta=Symbol("emittedEnd"),At=Symbol("emit"),K=Symbol("unzip"),ks=Symbol("consumeChunk"),_s=Symbol("consumeChunkSub"),vn=Symbol("consumeBody"),ra=Symbol("consumeMeta"),sa=Symbol("consumeHeader"),Rs=Symbol("consuming"),Bn=Symbol("bufferConcat"),xn=Symbol("maybeEnd"),wr=Symbol("writing"),et=Symbol("aborted"),vs=Symbol("onDone"),Ct=Symbol("sawValidEntry"),Bs=Symbol("sawNullBlock"),xs=Symbol("sawEOF"),ia=Symbol("closeStream"),lf=r=>!0;na.exports=tf(class extends sf{constructor(e){e=e||{},super(e),this.file=e.file||"",this[Ct]=null,this.on(vs,t=>{(this[ie]==="begin"||this[Ct]===!1)&&this.warn("TAR_BAD_ARCHIVE","Unrecognized archive format")}),e.ondone?this.on(vs,e.ondone):this.on(vs,t=>{this.emit("prefinish"),this.emit("finish"),this.emit("end")}),this.strict=!!e.strict,this.maxMetaEntrySize=e.maxMetaEntrySize||of,this.filter=typeof e.filter=="function"?e.filter:lf,this.writable=!0,this.readable=!1,this[Me]=new nf,this[O]=null,this[Le]=null,this[Et]=null,this[ie]="begin",this[Qe]="",this[ne]=null,this[Cr]=null,this[yt]=!1,this[K]=null,this[et]=!1,this[Bs]=!1,this[xs]=!1,this.on("end",()=>this[ia]()),typeof e.onwarn=="function"&&this.on("warn",e.onwarn),typeof e.onentry=="function"&&this.on("entry",e.onentry)}[sa](e,t){this[Ct]===null&&(this[Ct]=!1);let s;try{s=new rf(e,t,this[ne],this[Cr])}catch(i){return this.warn("TAR_ENTRY_INVALID",i)}if(s.nullBlock)this[Bs]?(this[xs]=!0,this[ie]==="begin"&&(this[ie]="header"),this[At]("eof")):(this[Bs]=!0,this[At]("nullBlock"));else if(this[Bs]=!1,!s.cksumValid)this.warn("TAR_ENTRY_INVALID","checksum failure",{header:s});else if(!s.path)this.warn("TAR_ENTRY_INVALID","path is required",{header:s});else{let i=s.type;if(/^(Symbolic)?Link$/.test(i)&&!s.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath required",{header:s});else if(!/^(Symbolic)?Link$/.test(i)&&s.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath forbidden",{header:s});else{let n=this[Et]=new uf(s,this[ne],this[Cr]);if(!this[Ct])if(n.remain){let o=()=>{n.invalid||(this[Ct]=!0)};n.on("end",o)}else this[Ct]=!0;n.meta?n.size>this.maxMetaEntrySize?(n.ignore=!0,this[At]("ignoredEntry",n),this[ie]="ignore",n.resume()):n.size>0&&(this[Qe]="",n.on("data",o=>this[Qe]+=o),this[ie]="meta"):(this[ne]=null,n.ignore=n.ignore||!this.filter(n.path,n),n.ignore?(this[At]("ignoredEntry",n),this[ie]=n.remain?"ignore":"header",n.resume()):(n.remain?this[ie]="body":(this[ie]="header",n.end()),this[Le]?this[Me].push(n):(this[Me].push(n),this[Rn]())))}}}[ia](){cf(()=>this.emit("close"))}[Qu](e){let t=!0;return e?Array.isArray(e)?this.emit.apply(this,e):(this[Le]=e,this.emit("entry",e),e.emittedEnd||(e.on("end",s=>this[Rn]()),t=!1)):(this[Le]=null,t=!1),t}[Rn](){do;while(this[Qu](this[Me].shift()));if(!this[Me].length){let e=this[Le];!e||e.flowing||e.size===e.remain?this[wr]||this.emit("drain"):e.once("drain",s=>this.emit("drain"))}}[vn](e,t){let s=this[Et],i=s.blockRemain,n=i>=e.length&&t===0?e:e.slice(t,t+i);return s.write(n),s.blockRemain||(this[ie]="header",this[Et]=null,s.end()),n.length}[ra](e,t){let s=this[Et],i=this[vn](e,t);return this[Et]||this[ea](s),i}[At](e,t,s){!this[Me].length&&!this[Le]?this.emit(e,t,s):this[Me].push([e,t,s])}[ea](e){switch(this[At]("meta",this[Qe]),e.type){case"ExtendedHeader":case"OldExtendedHeader":this[ne]=Xu.parse(this[Qe],this[ne],!1);break;case"GlobalExtendedHeader":this[Cr]=Xu.parse(this[Qe],this[Cr],!0);break;case"NextFileHasLongPath":case"OldGnuLongPath":this[ne]=this[ne]||Object.create(null),this[ne].path=this[Qe].replace(/\0.*/,"");break;case"NextFileHasLongLinkpath":this[ne]=this[ne]||Object.create(null),this[ne].linkpath=this[Qe].replace(/\0.*/,"");break;default:throw new Error("unknown meta: "+e.type)}}abort(e){this[et]=!0,this.emit("abort",e),this.warn("TAR_ABORT",e,{recoverable:!1})}write(e){if(this[et])return;if(this[K]===null&&e){if(this[O]&&(e=Buffer.concat([this[O],e]),this[O]=null),e.length<_n.length)return this[O]=e,!0;for(let s=0;this[K]===null&&s<_n.length;s++)e[s]!==_n[s]&&(this[K]=!1);if(this[K]===null){let s=this[yt];this[yt]=!1,this[K]=new af.Unzip,this[K].on("data",n=>this[ks](n)),this[K].on("error",n=>this.abort(n)),this[K].on("end",n=>{this[yt]=!0,this[ks]()}),this[wr]=!0;let i=this[K][s?"end":"write"](e);return this[wr]=!1,i}}this[wr]=!0,this[K]?this[K].write(e):this[ks](e),this[wr]=!1;let t=this[Me].length?!1:this[Le]?this[Le].flowing:!0;return!t&&!this[Me].length&&this[Le].once("drain",s=>this.emit("drain")),t}[Bn](e){e&&!this[et]&&(this[O]=this[O]?Buffer.concat([this[O],e]):e)}[xn](){if(this[yt]&&!this[ta]&&!this[et]&&!this[Rs]){this[ta]=!0;let e=this[Et];if(e&&e.blockRemain){let t=this[O]?this[O].length:0;this.warn("TAR_BAD_ARCHIVE",`Truncated input (needed ${e.blockRemain} more bytes, only ${t} available)`,{entry:e}),this[O]&&e.write(this[O]),e.end()}this[At](vs)}}[ks](e){if(this[Rs])this[Bn](e);else if(!e&&!this[O])this[xn]();else{if(this[Rs]=!0,this[O]){this[Bn](e);let t=this[O];this[O]=null,this[_s](t)}else this[_s](e);for(;this[O]&&this[O].length>=512&&!this[et]&&!this[xs];){let t=this[O];this[O]=null,this[_s](t)}this[Rs]=!1}(!this[O]||this[yt])&&this[xn]()}[_s](e){let t=0,s=e.length;for(;t+512<=s&&!this[et]&&!this[xs];)switch(this[ie]){case"begin":case"header":this[sa](e,t),t+=512;break;case"ignore":case"body":t+=this[vn](e,t);break;case"meta":t+=this[ra](e,t);break;default:throw new Error("invalid state: "+this[ie])}t<s&&(this[O]?this[O]=Buffer.concat([e.slice(t),this[O]]):this[O]=e.slice(t))}end(e){this[et]||(this[K]?this[K].end(e):(this[yt]=!0,this.write(e)))}})});var Ts=E((o0,ca)=>{"use strict";u();var hf=Tt(),ua=Os(),Zt=require("fs"),ff=Kt(),oa=require("path"),On=qt();ca.exports=(r,e,t)=>{typeof r=="function"?(t=r,e=null,r={}):Array.isArray(r)&&(e=r,r={}),typeof e=="function"&&(t=e,e=null),e?e=Array.from(e):e=[];let s=hf(r);if(s.sync&&typeof t=="function")throw new TypeError("callback not supported for sync tar functions");if(!s.file&&typeof t=="function")throw new TypeError("callback only supported with file option");return e.length&&mf(s,e),s.noResume||pf(s),s.file&&s.sync?df(s):s.file?Df(s,t):aa(s)};var pf=r=>{let e=r.onentry;r.onentry=e?t=>{e(t),t.resume()}:t=>t.resume()},mf=(r,e)=>{let t=new Map(e.map(n=>[On(n),!0])),s=r.filter,i=(n,o)=>{let a=o||oa.parse(n).root||".",l=n===a?!1:t.has(n)?t.get(n):i(oa.dirname(n),a);return t.set(n,l),l};r.filter=s?(n,o)=>s(n,o)&&i(On(n)):n=>i(On(n))},df=r=>{let e=aa(r),t=r.file,s=!0,i;try{let n=Zt.statSync(t),o=r.maxReadSize||16*1024*1024;if(n.size<o)e.end(Zt.readFileSync(t));else{let a=0,l=Buffer.allocUnsafe(o);for(i=Zt.openSync(t,"r");a<n.size;){let c=Zt.readSync(i,l,0,o,a);a+=c,e.write(l.slice(0,c))}e.end()}s=!1}finally{if(s&&i)try{Zt.closeSync(i)}catch{}}},Df=(r,e)=>{let t=new ua(r),s=r.maxReadSize||16*1024*1024,i=r.file,n=new Promise((o,a)=>{t.on("error",a),t.on("end",o),Zt.stat(i,(l,c)=>{if(l)a(l);else{let h=new ff.ReadStream(i,{readSize:s,size:c.size});h.on("error",a),h.pipe(t)}})});return e?n.then(e,e):n},aa=r=>new ua(r)});var da=E((u0,ma)=>{"use strict";u();var gf=Tt(),Ps=Es(),la=Kt(),ha=Ts(),fa=require("path");ma.exports=(r,e,t)=>{if(typeof e=="function"&&(t=e),Array.isArray(r)&&(e=r,r={}),!e||!Array.isArray(e)||!e.length)throw new TypeError("no files or directories specified");e=Array.from(e);let s=gf(r);if(s.sync&&typeof t=="function")throw new TypeError("callback not supported for sync tar functions");if(!s.file&&typeof t=="function")throw new TypeError("callback only supported with file option");return s.file&&s.sync?Ef(s,e):s.file?yf(s,e,t):s.sync?Af(s,e):Cf(s,e)};var Ef=(r,e)=>{let t=new Ps.Sync(r),s=new la.WriteStreamSync(r.file,{mode:r.mode||438});t.pipe(s),pa(t,e)},yf=(r,e,t)=>{let s=new Ps(r),i=new la.WriteStream(r.file,{mode:r.mode||438});s.pipe(i);let n=new Promise((o,a)=>{i.on("error",a),i.on("close",o),s.on("error",a)});return Tn(s,e),t?n.then(t,t):n},pa=(r,e)=>{e.forEach(t=>{t.charAt(0)==="@"?ha({file:fa.resolve(r.cwd,t.slice(1)),sync:!0,noResume:!0,onentry:s=>r.add(s)}):r.add(t)}),r.end()},Tn=(r,e)=>{for(;e.length;){let t=e.shift();if(t.charAt(0)==="@")return ha({file:fa.resolve(r.cwd,t.slice(1)),noResume:!0,onentry:s=>r.add(s)}).then(s=>Tn(r,e));r.add(t)}r.end()},Af=(r,e)=>{let t=new Ps.Sync(r);return pa(t,e),t},Cf=(r,e)=>{let t=new Ps(r);return Tn(t,e),t}});var Pn=E((a0,wa)=>{"use strict";u();var wf=Tt(),Da=Es(),Q=require("fs"),ga=Kt(),Ea=Ts(),ya=require("path"),Aa=Ut();wa.exports=(r,e,t)=>{let s=wf(r);if(!s.file)throw new TypeError("file is required");if(s.gzip)throw new TypeError("cannot append to compressed archives");if(!e||!Array.isArray(e)||!e.length)throw new TypeError("no files or directories specified");return e=Array.from(e),s.sync?Ff(s,e):Sf(s,e,t)};var Ff=(r,e)=>{let t=new Da.Sync(r),s=!0,i,n;try{try{i=Q.openSync(r.file,"r+")}catch(l){if(l.code==="ENOENT")i=Q.openSync(r.file,"w+");else throw l}let o=Q.fstatSync(i),a=Buffer.alloc(512);e:for(n=0;n<o.size;n+=512){for(let h=0,m=0;h<512;h+=m){if(m=Q.readSync(i,a,h,a.length-h,n+h),n===0&&a[0]===31&&a[1]===139)throw new Error("cannot append to compressed archives");if(!m)break e}let l=new Aa(a);if(!l.cksumValid)break;let c=512*Math.ceil(l.size/512);if(n+c+512>o.size)break;n+=c,r.mtimeCache&&r.mtimeCache.set(l.path,l.mtime)}s=!1,bf(r,t,n,i,e)}finally{if(s)try{Q.closeSync(i)}catch{}}},bf=(r,e,t,s,i)=>{let n=new ga.WriteStreamSync(r.file,{fd:s,start:t});e.pipe(n),kf(e,i)},Sf=(r,e,t)=>{e=Array.from(e);let s=new Da(r),i=(o,a,l)=>{let c=(b,T)=>{b?Q.close(o,S=>l(b)):l(null,T)},h=0;if(a===0)return c(null,0);let m=0,D=Buffer.alloc(512),A=(b,T)=>{if(b)return c(b);if(m+=T,m<512&&T)return Q.read(o,D,m,D.length-m,h+m,A);if(h===0&&D[0]===31&&D[1]===139)return c(new Error("cannot append to compressed archives"));if(m<512)return c(null,h);let S=new Aa(D);if(!S.cksumValid)return c(null,h);let x=512*Math.ceil(S.size/512);if(h+x+512>a||(h+=x+512,h>=a))return c(null,h);r.mtimeCache&&r.mtimeCache.set(S.path,S.mtime),m=0,Q.read(o,D,0,512,h,A)};Q.read(o,D,0,512,h,A)},n=new Promise((o,a)=>{s.on("error",a);let l="r+",c=(h,m)=>{if(h&&h.code==="ENOENT"&&l==="r+")return l="w+",Q.open(r.file,l,c);if(h)return a(h);Q.fstat(m,(D,A)=>{if(D)return Q.close(m,()=>a(D));i(m,A.size,(b,T)=>{if(b)return a(b);let S=new ga.WriteStream(r.file,{fd:m,start:T});s.pipe(S),S.on("error",a),S.on("close",o),Ca(s,e)})})};Q.open(r.file,l,c)});return t?n.then(t,t):n},kf=(r,e)=>{e.forEach(t=>{t.charAt(0)==="@"?Ea({file:ya.resolve(r.cwd,t.slice(1)),sync:!0,noResume:!0,onentry:s=>r.add(s)}):r.add(t)}),r.end()},Ca=(r,e)=>{for(;e.length;){let t=e.shift();if(t.charAt(0)==="@")return Ea({file:ya.resolve(r.cwd,t.slice(1)),noResume:!0,onentry:s=>r.add(s)}).then(s=>Ca(r,e));r.add(t)}r.end()}});var ba=E((c0,Fa)=>{"use strict";u();var _f=Tt(),Rf=Pn();Fa.exports=(r,e,t)=>{let s=_f(r);if(!s.file)throw new TypeError("file is required");if(s.gzip)throw new TypeError("cannot append to compressed archives");if(!e||!Array.isArray(e)||!e.length)throw new TypeError("no files or directories specified");return e=Array.from(e),vf(s),Rf(s,e,t)};var vf=r=>{let e=r.filter;r.mtimeCache||(r.mtimeCache=new Map),r.filter=e?(t,s)=>e(t,s)&&!(r.mtimeCache.get(t)>s.mtime):(t,s)=>!(r.mtimeCache.get(t)>s.mtime)}});var _a=E((l0,ka)=>{u();var{promisify:Sa}=require("util"),tt=require("fs"),Bf=r=>{if(!r)r={mode:511,fs:tt};else if(typeof r=="object")r={mode:511,fs:tt,...r};else if(typeof r=="number")r={mode:r,fs:tt};else if(typeof r=="string")r={mode:parseInt(r,8),fs:tt};else throw new TypeError("invalid options argument");return r.mkdir=r.mkdir||r.fs.mkdir||tt.mkdir,r.mkdirAsync=Sa(r.mkdir),r.stat=r.stat||r.fs.stat||tt.stat,r.statAsync=Sa(r.stat),r.statSync=r.statSync||r.fs.statSync||tt.statSync,r.mkdirSync=r.mkdirSync||r.fs.mkdirSync||tt.mkdirSync,r};ka.exports=Bf});var va=E((h0,Ra)=>{u();var xf=process.env.__TESTING_MKDIRP_PLATFORM__||process.platform,{resolve:Of,parse:Tf}=require("path"),Pf=r=>{if(/\0/.test(r))throw Object.assign(new TypeError("path must be a string without null bytes"),{path:r,code:"ERR_INVALID_ARG_VALUE"});if(r=Of(r),xf==="win32"){let e=/[*|"<>?:]/,{root:t}=Tf(r);if(e.test(r.substr(t.length)))throw Object.assign(new Error("Illegal characters in path."),{path:r,code:"EINVAL"})}return r};Ra.exports=Pf});var Pa=E((f0,Ta)=>{u();var{dirname:Ba}=require("path"),xa=(r,e,t=void 0)=>t===e?Promise.resolve():r.statAsync(e).then(s=>s.isDirectory()?t:void 0,s=>s.code==="ENOENT"?xa(r,Ba(e),e):void 0),Oa=(r,e,t=void 0)=>{if(t!==e)try{return r.statSync(e).isDirectory()?t:void 0}catch(s){return s.code==="ENOENT"?Oa(r,Ba(e),e):void 0}};Ta.exports={findMade:xa,findMadeSync:Oa}});var Mn=E((p0,La)=>{u();var{dirname:Na}=require("path"),Nn=(r,e,t)=>{e.recursive=!1;let s=Na(r);return s===r?e.mkdirAsync(r,e).catch(i=>{if(i.code!=="EISDIR")throw i}):e.mkdirAsync(r,e).then(()=>t||r,i=>{if(i.code==="ENOENT")return Nn(s,e).then(n=>Nn(r,e,n));if(i.code!=="EEXIST"&&i.code!=="EROFS")throw i;return e.statAsync(r).then(n=>{if(n.isDirectory())return t;throw i},()=>{throw i})})},Ln=(r,e,t)=>{let s=Na(r);if(e.recursive=!1,s===r)try{return e.mkdirSync(r,e)}catch(i){if(i.code!=="EISDIR")throw i;return}try{return e.mkdirSync(r,e),t||r}catch(i){if(i.code==="ENOENT")return Ln(r,e,Ln(s,e,t));if(i.code!=="EEXIST"&&i.code!=="EROFS")throw i;try{if(!e.statSync(r).isDirectory())throw i}catch{throw i}}};La.exports={mkdirpManual:Nn,mkdirpManualSync:Ln}});var ja=E((m0,Ia)=>{u();var{dirname:Ma}=require("path"),{findMade:Nf,findMadeSync:Lf}=Pa(),{mkdirpManual:Mf,mkdirpManualSync:If}=Mn(),jf=(r,e)=>(e.recursive=!0,Ma(r)===r?e.mkdirAsync(r,e):Nf(e,r).then(s=>e.mkdirAsync(r,e).then(()=>s).catch(i=>{if(i.code==="ENOENT")return Mf(r,e);throw i}))),Uf=(r,e)=>{if(e.recursive=!0,Ma(r)===r)return e.mkdirSync(r,e);let s=Lf(e,r);try{return e.mkdirSync(r,e),s}catch(i){if(i.code==="ENOENT")return If(r,e);throw i}};Ia.exports={mkdirpNative:jf,mkdirpNativeSync:Uf}});var Wa=E((d0,$a)=>{u();var Ua=require("fs"),qf=process.env.__TESTING_MKDIRP_NODE_VERSION__||process.version,In=qf.replace(/^v/,"").split("."),qa=+In[0]>10||+In[0]==10&&+In[1]>=12,$f=qa?r=>r.mkdir===Ua.mkdir:()=>!1,Wf=qa?r=>r.mkdirSync===Ua.mkdirSync:()=>!1;$a.exports={useNative:$f,useNativeSync:Wf}});var Ya=E((D0,Va)=>{u();var Xt=_a(),Qt=va(),{mkdirpNative:za,mkdirpNativeSync:Ga}=ja(),{mkdirpManual:Ha,mkdirpManualSync:Ja}=Mn(),{useNative:zf,useNativeSync:Gf}=Wa(),er=(r,e)=>(r=Qt(r),e=Xt(e),zf(e)?za(r,e):Ha(r,e)),Hf=(r,e)=>(r=Qt(r),e=Xt(e),Gf(e)?Ga(r,e):Ja(r,e));er.sync=Hf;er.native=(r,e)=>za(Qt(r),Xt(e));er.manual=(r,e)=>Ha(Qt(r),Xt(e));er.nativeSync=(r,e)=>Ga(Qt(r),Xt(e));er.manualSync=(r,e)=>Ja(Qt(r),Xt(e));Va.exports=er});var rc=E((g0,tc)=>{"use strict";u();var oe=require("fs"),wt=require("path"),Jf=oe.lchown?"lchown":"chown",Vf=oe.lchownSync?"lchownSync":"chownSync",Za=oe.lchown&&!process.version.match(/v1[1-9]+\./)&&!process.version.match(/v10\.[6-9]/),Ka=(r,e,t)=>{try{return oe[Vf](r,e,t)}catch(s){if(s.code!=="ENOENT")throw s}},Yf=(r,e,t)=>{try{return oe.chownSync(r,e,t)}catch(s){if(s.code!=="ENOENT")throw s}},Kf=Za?(r,e,t,s)=>i=>{!i||i.code!=="EISDIR"?s(i):oe.chown(r,e,t,s)}:(r,e,t,s)=>s,jn=Za?(r,e,t)=>{try{return Ka(r,e,t)}catch(s){if(s.code!=="EISDIR")throw s;Yf(r,e,t)}}:(r,e,t)=>Ka(r,e,t),Zf=process.version,Xa=(r,e,t)=>oe.readdir(r,e,t),Xf=(r,e)=>oe.readdirSync(r,e);/^v4\./.test(Zf)&&(Xa=(r,e,t)=>oe.readdir(r,t));var Ns=(r,e,t,s)=>{oe[Jf](r,e,t,Kf(r,e,t,i=>{s(i&&i.code!=="ENOENT"?i:null)}))},Qa=(r,e,t,s,i)=>{if(typeof e=="string")return oe.lstat(wt.resolve(r,e),(n,o)=>{if(n)return i(n.code!=="ENOENT"?n:null);o.name=e,Qa(r,o,t,s,i)});if(e.isDirectory())Un(wt.resolve(r,e.name),t,s,n=>{if(n)return i(n);let o=wt.resolve(r,e.name);Ns(o,t,s,i)});else{let n=wt.resolve(r,e.name);Ns(n,t,s,i)}},Un=(r,e,t,s)=>{Xa(r,{withFileTypes:!0},(i,n)=>{if(i){if(i.code==="ENOENT")return s();if(i.code!=="ENOTDIR"&&i.code!=="ENOTSUP")return s(i)}if(i||!n.length)return Ns(r,e,t,s);let o=n.length,a=null,l=c=>{if(!a){if(c)return s(a=c);if(--o===0)return Ns(r,e,t,s)}};n.forEach(c=>Qa(r,c,e,t,l))})},Qf=(r,e,t,s)=>{if(typeof e=="string")try{let i=oe.lstatSync(wt.resolve(r,e));i.name=e,e=i}catch(i){if(i.code==="ENOENT")return;throw i}e.isDirectory()&&ec(wt.resolve(r,e.name),t,s),jn(wt.resolve(r,e.name),t,s)},ec=(r,e,t)=>{let s;try{s=Xf(r,{withFileTypes:!0})}catch(i){if(i.code==="ENOENT")return;if(i.code==="ENOTDIR"||i.code==="ENOTSUP")return jn(r,e,t);throw i}return s&&s.length&&s.forEach(i=>Qf(r,i,e,t)),jn(r,e,t)};tc.exports=Un;Un.sync=ec});var oc=E((E0,qn)=>{"use strict";u();var sc=Ya(),ue=require("fs"),Ls=require("path"),ic=rc(),pe=It(),Ms=class extends Error{constructor(e,t){super("Cannot extract through symbolic link"),this.path=t,this.symlink=e}get name(){return"SylinkError"}},Is=class extends Error{constructor(e,t){super(t+": Cannot cd into '"+e+"'"),this.path=e,this.code=t}get name(){return"CwdError"}},js=(r,e)=>r.get(pe(e)),Fr=(r,e,t)=>r.set(pe(e),t),ep=(r,e)=>{ue.stat(r,(t,s)=>{(t||!s.isDirectory())&&(t=new Is(r,t&&t.code||"ENOTDIR")),e(t)})};qn.exports=(r,e,t)=>{r=pe(r);let s=e.umask,i=e.mode|448,n=(i&s)!==0,o=e.uid,a=e.gid,l=typeof o=="number"&&typeof a=="number"&&(o!==e.processUid||a!==e.processGid),c=e.preserve,h=e.unlink,m=e.cache,D=pe(e.cwd),A=(S,x)=>{S?t(S):(Fr(m,r,!0),x&&l?ic(x,o,a,ut=>A(ut)):n?ue.chmod(r,i,t):t())};if(m&&js(m,r)===!0)return A();if(r===D)return ep(r,A);if(c)return sc(r,{mode:i}).then(S=>A(null,S),A);let T=pe(Ls.relative(D,r)).split("/");Us(D,T,i,m,h,D,null,A)};var Us=(r,e,t,s,i,n,o,a)=>{if(!e.length)return a(null,o);let l=e.shift(),c=pe(Ls.resolve(r+"/"+l));if(js(s,c))return Us(c,e,t,s,i,n,o,a);ue.mkdir(c,t,nc(c,e,t,s,i,n,o,a))},nc=(r,e,t,s,i,n,o,a)=>l=>{l?ue.lstat(r,(c,h)=>{if(c)c.path=c.path&&pe(c.path),a(c);else if(h.isDirectory())Us(r,e,t,s,i,n,o,a);else if(i)ue.unlink(r,m=>{if(m)return a(m);ue.mkdir(r,t,nc(r,e,t,s,i,n,o,a))});else{if(h.isSymbolicLink())return a(new Ms(r,r+"/"+e.join("/")));a(l)}}):(o=o||r,Us(r,e,t,s,i,n,o,a))},tp=r=>{let e=!1,t="ENOTDIR";try{e=ue.statSync(r).isDirectory()}catch(s){t=s.code}finally{if(!e)throw new Is(r,t)}};qn.exports.sync=(r,e)=>{r=pe(r);let t=e.umask,s=e.mode|448,i=(s&t)!==0,n=e.uid,o=e.gid,a=typeof n=="number"&&typeof o=="number"&&(n!==e.processUid||o!==e.processGid),l=e.preserve,c=e.unlink,h=e.cache,m=pe(e.cwd),D=S=>{Fr(h,r,!0),S&&a&&ic.sync(S,n,o),i&&ue.chmodSync(r,s)};if(h&&js(h,r)===!0)return D();if(r===m)return tp(m),D();if(l)return D(sc.sync(r,s));let b=pe(Ls.relative(m,r)).split("/"),T=null;for(let S=b.shift(),x=m;S&&(x+="/"+S);S=b.shift())if(x=pe(Ls.resolve(x)),!js(h,x))try{ue.mkdirSync(x,s),T=T||x,Fr(h,x,!0)}catch{let de=ue.lstatSync(x);if(de.isDirectory()){Fr(h,x,!0);continue}else if(c){ue.unlinkSync(x),ue.mkdirSync(x,s),T=T||x,Fr(h,x,!0);continue}else if(de.isSymbolicLink())return new Ms(x,x+"/"+b.join("/"))}return D(T)}});var Wn=E((y0,uc)=>{u();var $n=Object.create(null),{hasOwnProperty:rp}=Object.prototype;uc.exports=r=>(rp.call($n,r)||($n[r]=r.normalize("NFKD")),$n[r])});var hc=E((A0,lc)=>{u();var ac=require("assert"),sp=Wn(),ip=qt(),{join:cc}=require("path"),np=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,op=np==="win32";lc.exports=()=>{let r=new Map,e=new Map,t=c=>c.split("/").slice(0,-1).reduce((m,D)=>(m.length&&(D=cc(m[m.length-1],D)),m.push(D||"/"),m),[]),s=new Set,i=c=>{let h=e.get(c);if(!h)throw new Error("function does not have any path reservations");return{paths:h.paths.map(m=>r.get(m)),dirs:[...h.dirs].map(m=>r.get(m))}},n=c=>{let{paths:h,dirs:m}=i(c);return h.every(D=>D[0]===c)&&m.every(D=>D[0]instanceof Set&&D[0].has(c))},o=c=>s.has(c)||!n(c)?!1:(s.add(c),c(()=>a(c)),!0),a=c=>{if(!s.has(c))return!1;let{paths:h,dirs:m}=e.get(c),D=new Set;return h.forEach(A=>{let b=r.get(A);ac.equal(b[0],c),b.length===1?r.delete(A):(b.shift(),typeof b[0]=="function"?D.add(b[0]):b[0].forEach(T=>D.add(T)))}),m.forEach(A=>{let b=r.get(A);ac(b[0]instanceof Set),b[0].size===1&&b.length===1?r.delete(A):b[0].size===1?(b.shift(),D.add(b[0])):b[0].delete(c)}),s.delete(c),D.forEach(A=>o(A)),!0};return{check:n,reserve:(c,h)=>{c=op?["win32 parallelization disabled"]:c.map(D=>sp(ip(cc(D))).toLowerCase());let m=new Set(c.map(D=>t(D)).reduce((D,A)=>D.concat(A)));return e.set(h,{dirs:m,paths:c}),c.forEach(D=>{let A=r.get(D);A?A.push(h):r.set(D,[h])}),m.forEach(D=>{let A=r.get(D);A?A[A.length-1]instanceof Set?A[A.length-1].add(h):A.push(new Set([h])):r.set(D,[new Set([h])])}),o(h)}}}});var mc=E((C0,pc)=>{u();var up=process.env.__FAKE_PLATFORM__||process.platform,ap=up==="win32",cp=global.__FAKE_TESTING_FS__||require("fs"),{O_CREAT:lp,O_TRUNC:hp,O_WRONLY:fp,UV_FS_O_FILEMAP:fc=0}=cp.constants,pp=ap&&!!fc,mp=512*1024,dp=fc|hp|lp|fp;pc.exports=pp?r=>r<mp?dp:"w":()=>"w"});var Xn=E((w0,Rc)=>{"use strict";u();var Dp=require("assert"),gp=Os(),_=require("fs"),Ep=Kt(),Ie=require("path"),Sc=oc(),dc=Ki(),yp=hc(),Ap=Zi(),ee=It(),Cp=qt(),wp=Wn(),Dc=Symbol("onEntry"),Hn=Symbol("checkFs"),gc=Symbol("checkFs2"),Ws=Symbol("pruneCache"),Jn=Symbol("isReusable"),ae=Symbol("makeFs"),Vn=Symbol("file"),Yn=Symbol("directory"),zs=Symbol("link"),Ec=Symbol("symlink"),yc=Symbol("hardlink"),Ac=Symbol("unsupported"),Cc=Symbol("checkPath"),rt=Symbol("mkdir"),z=Symbol("onError"),qs=Symbol("pending"),wc=Symbol("pend"),tr=Symbol("unpend"),zn=Symbol("ended"),Gn=Symbol("maybeClose"),Kn=Symbol("skip"),br=Symbol("doChown"),Sr=Symbol("uid"),kr=Symbol("gid"),_r=Symbol("checkedCwd"),kc=require("crypto"),_c=mc(),Fp=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,Rr=Fp==="win32",bp=(r,e)=>{if(!Rr)return _.unlink(r,e);let t=r+".DELETE."+kc.randomBytes(16).toString("hex");_.rename(r,t,s=>{if(s)return e(s);_.unlink(t,e)})},Sp=r=>{if(!Rr)return _.unlinkSync(r);let e=r+".DELETE."+kc.randomBytes(16).toString("hex");_.renameSync(r,e),_.unlinkSync(e)},Fc=(r,e,t)=>r===r>>>0?r:e===e>>>0?e:t,bc=r=>wp(Cp(ee(r))).toLowerCase(),kp=(r,e)=>{e=bc(e);for(let t of r.keys()){let s=bc(t);(s===e||s.indexOf(e+"/")===0)&&r.delete(t)}},_p=r=>{for(let e of r.keys())r.delete(e)},vr=class extends gp{constructor(e){if(e||(e={}),e.ondone=t=>{this[zn]=!0,this[Gn]()},super(e),this[_r]=!1,this.reservations=yp(),this.transform=typeof e.transform=="function"?e.transform:null,this.writable=!0,this.readable=!1,this[qs]=0,this[zn]=!1,this.dirCache=e.dirCache||new Map,typeof e.uid=="number"||typeof e.gid=="number"){if(typeof e.uid!="number"||typeof e.gid!="number")throw new TypeError("cannot set owner without number uid and gid");if(e.preserveOwner)throw new TypeError("cannot preserve owner in archive and also set owner explicitly");this.uid=e.uid,this.gid=e.gid,this.setOwner=!0}else this.uid=null,this.gid=null,this.setOwner=!1;e.preserveOwner===void 0&&typeof e.uid!="number"?this.preserveOwner=process.getuid&&process.getuid()===0:this.preserveOwner=!!e.preserveOwner,this.processUid=(this.preserveOwner||this.setOwner)&&process.getuid?process.getuid():null,this.processGid=(this.preserveOwner||this.setOwner)&&process.getgid?process.getgid():null,this.forceChown=e.forceChown===!0,this.win32=!!e.win32||Rr,this.newer=!!e.newer,this.keep=!!e.keep,this.noMtime=!!e.noMtime,this.preservePaths=!!e.preservePaths,this.unlink=!!e.unlink,this.cwd=ee(Ie.resolve(e.cwd||process.cwd())),this.strip=+e.strip||0,this.processUmask=e.noChmod?0:process.umask(),this.umask=typeof e.umask=="number"?e.umask:this.processUmask,this.dmode=e.dmode||511&~this.umask,this.fmode=e.fmode||438&~this.umask,this.on("entry",t=>this[Dc](t))}warn(e,t,s={}){return(e==="TAR_BAD_ARCHIVE"||e==="TAR_ABORT")&&(s.recoverable=!1),super.warn(e,t,s)}[Gn](){this[zn]&&this[qs]===0&&(this.emit("prefinish"),this.emit("finish"),this.emit("end"))}[Cc](e){if(this.strip){let t=ee(e.path).split("/");if(t.length<this.strip)return!1;if(e.path=t.slice(this.strip).join("/"),e.type==="Link"){let s=ee(e.linkpath).split("/");if(s.length>=this.strip)e.linkpath=s.slice(this.strip).join("/");else return!1}}if(!this.preservePaths){let t=ee(e.path),s=t.split("/");if(s.includes("..")||Rr&&/^[a-z]:\.\.$/i.test(s[0]))return this.warn("TAR_ENTRY_ERROR","path contains '..'",{entry:e,path:t}),!1;let[i,n]=Ap(t);i&&(e.path=n,this.warn("TAR_ENTRY_INFO",`stripping ${i} from absolute path`,{entry:e,path:t}))}if(Ie.isAbsolute(e.path)?e.absolute=ee(Ie.resolve(e.path)):e.absolute=ee(Ie.resolve(this.cwd,e.path)),!this.preservePaths&&e.absolute.indexOf(this.cwd+"/")!==0&&e.absolute!==this.cwd)return this.warn("TAR_ENTRY_ERROR","path escaped extraction target",{entry:e,path:ee(e.path),resolvedPath:e.absolute,cwd:this.cwd}),!1;if(e.absolute===this.cwd&&e.type!=="Directory"&&e.type!=="GNUDumpDir")return!1;if(this.win32){let{root:t}=Ie.win32.parse(e.absolute);e.absolute=t+dc.encode(e.absolute.slice(t.length));let{root:s}=Ie.win32.parse(e.path);e.path=s+dc.encode(e.path.slice(s.length))}return!0}[Dc](e){if(!this[Cc](e))return e.resume();switch(Dp.equal(typeof e.absolute,"string"),e.type){case"Directory":case"GNUDumpDir":e.mode&&(e.mode=e.mode|448);case"File":case"OldFile":case"ContiguousFile":case"Link":case"SymbolicLink":return this[Hn](e);case"CharacterDevice":case"BlockDevice":case"FIFO":default:return this[Ac](e)}}[z](e,t){e.name==="CwdError"?this.emit("error",e):(this.warn("TAR_ENTRY_ERROR",e,{entry:t}),this[tr](),t.resume())}[rt](e,t,s){Sc(ee(e),{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cache:this.dirCache,cwd:this.cwd,mode:t,noChmod:this.noChmod},s)}[br](e){return this.forceChown||this.preserveOwner&&(typeof e.uid=="number"&&e.uid!==this.processUid||typeof e.gid=="number"&&e.gid!==this.processGid)||typeof this.uid=="number"&&this.uid!==this.processUid||typeof this.gid=="number"&&this.gid!==this.processGid}[Sr](e){return Fc(this.uid,e.uid,this.processUid)}[kr](e){return Fc(this.gid,e.gid,this.processGid)}[Vn](e,t){let s=e.mode&4095||this.fmode,i=new Ep.WriteStream(e.absolute,{flags:_c(e.size),mode:s,autoClose:!1});i.on("error",l=>{i.fd&&_.close(i.fd,()=>{}),i.write=()=>!0,this[z](l,e),t()});let n=1,o=l=>{if(l){i.fd&&_.close(i.fd,()=>{}),this[z](l,e),t();return}--n===0&&_.close(i.fd,c=>{c?this[z](c,e):this[tr](),t()})};i.on("finish",l=>{let c=e.absolute,h=i.fd;if(e.mtime&&!this.noMtime){n++;let m=e.atime||new Date,D=e.mtime;_.futimes(h,m,D,A=>A?_.utimes(c,m,D,b=>o(b&&A)):o())}if(this[br](e)){n++;let m=this[Sr](e),D=this[kr](e);_.fchown(h,m,D,A=>A?_.chown(c,m,D,b=>o(b&&A)):o())}o()});let a=this.transform&&this.transform(e)||e;a!==e&&(a.on("error",l=>{this[z](l,e),t()}),e.pipe(a)),a.pipe(i)}[Yn](e,t){let s=e.mode&4095||this.dmode;this[rt](e.absolute,s,i=>{if(i){this[z](i,e),t();return}let n=1,o=a=>{--n===0&&(t(),this[tr](),e.resume())};e.mtime&&!this.noMtime&&(n++,_.utimes(e.absolute,e.atime||new Date,e.mtime,o)),this[br](e)&&(n++,_.chown(e.absolute,this[Sr](e),this[kr](e),o)),o()})}[Ac](e){e.unsupported=!0,this.warn("TAR_ENTRY_UNSUPPORTED",`unsupported entry type: ${e.type}`,{entry:e}),e.resume()}[Ec](e,t){this[zs](e,e.linkpath,"symlink",t)}[yc](e,t){let s=ee(Ie.resolve(this.cwd,e.linkpath));this[zs](e,s,"link",t)}[wc](){this[qs]++}[tr](){this[qs]--,this[Gn]()}[Kn](e){this[tr](),e.resume()}[Jn](e,t){return e.type==="File"&&!this.unlink&&t.isFile()&&t.nlink<=1&&!Rr}[Hn](e){this[wc]();let t=[e.path];e.linkpath&&t.push(e.linkpath),this.reservations.reserve(t,s=>this[gc](e,s))}[Ws](e){e.type==="SymbolicLink"?_p(this.dirCache):e.type!=="Directory"&&kp(this.dirCache,e.absolute)}[gc](e,t){this[Ws](e);let s=a=>{this[Ws](e),t(a)},i=()=>{this[rt](this.cwd,this.dmode,a=>{if(a){this[z](a,e),s();return}this[_r]=!0,n()})},n=()=>{if(e.absolute!==this.cwd){let a=ee(Ie.dirname(e.absolute));if(a!==this.cwd)return this[rt](a,this.dmode,l=>{if(l){this[z](l,e),s();return}o()})}o()},o=()=>{_.lstat(e.absolute,(a,l)=>{if(l&&(this.keep||this.newer&&l.mtime>e.mtime)){this[Kn](e),s();return}if(a||this[Jn](e,l))return this[ae](null,e,s);if(l.isDirectory()){if(e.type==="Directory"){let c=!this.noChmod&&e.mode&&(l.mode&4095)!==e.mode,h=m=>this[ae](m,e,s);return c?_.chmod(e.absolute,e.mode,h):h()}if(e.absolute!==this.cwd)return _.rmdir(e.absolute,c=>this[ae](c,e,s))}if(e.absolute===this.cwd)return this[ae](null,e,s);bp(e.absolute,c=>this[ae](c,e,s))})};this[_r]?n():i()}[ae](e,t,s){if(e){this[z](e,t),s();return}switch(t.type){case"File":case"OldFile":case"ContiguousFile":return this[Vn](t,s);case"Link":return this[yc](t,s);case"SymbolicLink":return this[Ec](t,s);case"Directory":case"GNUDumpDir":return this[Yn](t,s)}}[zs](e,t,s,i){_[s](t,e.absolute,n=>{n?this[z](n,e):(this[tr](),e.resume()),i()})}},$s=r=>{try{return[null,r()]}catch(e){return[e,null]}},Zn=class extends vr{[ae](e,t){return super[ae](e,t,()=>{})}[Hn](e){if(this[Ws](e),!this[_r]){let n=this[rt](this.cwd,this.dmode);if(n)return this[z](n,e);this[_r]=!0}if(e.absolute!==this.cwd){let n=ee(Ie.dirname(e.absolute));if(n!==this.cwd){let o=this[rt](n,this.dmode);if(o)return this[z](o,e)}}let[t,s]=$s(()=>_.lstatSync(e.absolute));if(s&&(this.keep||this.newer&&s.mtime>e.mtime))return this[Kn](e);if(t||this[Jn](e,s))return this[ae](null,e);if(s.isDirectory()){if(e.type==="Directory"){let o=!this.noChmod&&e.mode&&(s.mode&4095)!==e.mode,[a]=o?$s(()=>{_.chmodSync(e.absolute,e.mode)}):[];return this[ae](a,e)}let[n]=$s(()=>_.rmdirSync(e.absolute));this[ae](n,e)}let[i]=e.absolute===this.cwd?[]:$s(()=>Sp(e.absolute));this[ae](i,e)}[Vn](e,t){let s=e.mode&4095||this.fmode,i=a=>{let l;try{_.closeSync(n)}catch(c){l=c}(a||l)&&this[z](a||l,e),t()},n;try{n=_.openSync(e.absolute,_c(e.size),s)}catch(a){return i(a)}let o=this.transform&&this.transform(e)||e;o!==e&&(o.on("error",a=>this[z](a,e)),e.pipe(o)),o.on("data",a=>{try{_.writeSync(n,a,0,a.length)}catch(l){i(l)}}),o.on("end",a=>{let l=null;if(e.mtime&&!this.noMtime){let c=e.atime||new Date,h=e.mtime;try{_.futimesSync(n,c,h)}catch(m){try{_.utimesSync(e.absolute,c,h)}catch{l=m}}}if(this[br](e)){let c=this[Sr](e),h=this[kr](e);try{_.fchownSync(n,c,h)}catch(m){try{_.chownSync(e.absolute,c,h)}catch{l=l||m}}}i(l)})}[Yn](e,t){let s=e.mode&4095||this.dmode,i=this[rt](e.absolute,s);if(i){this[z](i,e),t();return}if(e.mtime&&!this.noMtime)try{_.utimesSync(e.absolute,e.atime||new Date,e.mtime)}catch{}if(this[br](e))try{_.chownSync(e.absolute,this[Sr](e),this[kr](e))}catch{}t(),e.resume()}[rt](e,t){try{return Sc.sync(ee(e),{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cache:this.dirCache,cwd:this.cwd,mode:t})}catch(s){return s}}[zs](e,t,s,i){try{_[s+"Sync"](t,e.absolute),i(),e.resume()}catch(n){return this[z](n,e)}}};vr.Sync=Zn;Rc.exports=vr});var Tc=E((F0,Oc)=>{"use strict";u();var Rp=Tt(),Gs=Xn(),Bc=require("fs"),xc=Kt(),vc=require("path"),Qn=qt();Oc.exports=(r,e,t)=>{typeof r=="function"?(t=r,e=null,r={}):Array.isArray(r)&&(e=r,r={}),typeof e=="function"&&(t=e,e=null),e?e=Array.from(e):e=[];let s=Rp(r);if(s.sync&&typeof t=="function")throw new TypeError("callback not supported for sync tar functions");if(!s.file&&typeof t=="function")throw new TypeError("callback only supported with file option");return e.length&&vp(s,e),s.file&&s.sync?Bp(s):s.file?xp(s,t):s.sync?Op(s):Tp(s)};var vp=(r,e)=>{let t=new Map(e.map(n=>[Qn(n),!0])),s=r.filter,i=(n,o)=>{let a=o||vc.parse(n).root||".",l=n===a?!1:t.has(n)?t.get(n):i(vc.dirname(n),a);return t.set(n,l),l};r.filter=s?(n,o)=>s(n,o)&&i(Qn(n)):n=>i(Qn(n))},Bp=r=>{let e=new Gs.Sync(r),t=r.file,s=Bc.statSync(t),i=r.maxReadSize||16*1024*1024;new xc.ReadStreamSync(t,{readSize:i,size:s.size}).pipe(e)},xp=(r,e)=>{let t=new Gs(r),s=r.maxReadSize||16*1024*1024,i=r.file,n=new Promise((o,a)=>{t.on("error",a),t.on("close",o),Bc.stat(i,(l,c)=>{if(l)a(l);else{let h=new xc.ReadStream(i,{readSize:s,size:c.size});h.on("error",a),h.pipe(t)}})});return e?n.then(e,e):n},Op=r=>new Gs.Sync(r),Tp=r=>new Gs(r)});var Pc=E(L=>{"use strict";u();L.c=L.create=da();L.r=L.replace=Pn();L.t=L.list=Ts();L.u=L.update=ba();L.x=L.extract=Tc();L.Pack=Es();L.Unpack=Xn();L.Parse=Os();L.ReadEntry=ts();L.WriteEntry=an();L.Header=Ut();L.Pax=ss();L.types=Wi()});var jc=E((R0,Ic)=>{u();function ce(r,e){typeof e=="boolean"&&(e={forever:e}),this._originalTimeouts=JSON.parse(JSON.stringify(r)),this._timeouts=r,this._options=e||{},this._maxRetryTime=e&&e.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}Ic.exports=ce;ce.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)};ce.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null};ce.prototype.retry=function(r){if(this._timeout&&clearTimeout(this._timeout),!r)return!1;var e=new Date().getTime();if(r&&e-this._operationStart>=this._maxRetryTime)return this._errors.push(r),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(r);var t=this._timeouts.shift();if(t===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),t=this._cachedTimeouts.slice(-1);else return!1;var s=this;return this._timer=setTimeout(function(){s._attempts++,s._operationTimeoutCb&&(s._timeout=setTimeout(function(){s._operationTimeoutCb(s._attempts)},s._operationTimeout),s._options.unref&&s._timeout.unref()),s._fn(s._attempts)},t),this._options.unref&&this._timer.unref(),!0};ce.prototype.attempt=function(r,e){this._fn=r,e&&(e.timeout&&(this._operationTimeout=e.timeout),e.cb&&(this._operationTimeoutCb=e.cb));var t=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){t._operationTimeoutCb()},t._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};ce.prototype.try=function(r){console.log("Using RetryOperation.try() is deprecated"),this.attempt(r)};ce.prototype.start=function(r){console.log("Using RetryOperation.start() is deprecated"),this.attempt(r)};ce.prototype.start=ce.prototype.try;ce.prototype.errors=function(){return this._errors};ce.prototype.attempts=function(){return this._attempts};ce.prototype.mainError=function(){if(this._errors.length===0)return null;for(var r={},e=null,t=0,s=0;s<this._errors.length;s++){var i=this._errors[s],n=i.message,o=(r[n]||0)+1;r[n]=o,o>=t&&(e=i,t=o)}return e}});var Uc=E(Ft=>{u();var Ip=jc();Ft.operation=function(r){var e=Ft.timeouts(r);return new Ip(e,{forever:r&&(r.forever||r.retries===1/0),unref:r&&r.unref,maxRetryTime:r&&r.maxRetryTime})};Ft.timeouts=function(r){if(r instanceof Array)return[].concat(r);var e={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var t in r)e[t]=r[t];if(e.minTimeout>e.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var s=[],i=0;i<e.retries;i++)s.push(this.createTimeout(i,e));return r&&r.forever&&!s.length&&s.push(this.createTimeout(i,e)),s.sort(function(n,o){return n-o}),s};Ft.createTimeout=function(r,e){var t=e.randomize?Math.random()+1:1,s=Math.round(t*Math.max(e.minTimeout,1)*Math.pow(e.factor,r));return s=Math.min(s,e.maxTimeout),s};Ft.wrap=function(r,e,t){if(e instanceof Array&&(t=e,e=null),!t){t=[];for(var s in r)typeof r[s]=="function"&&t.push(s)}for(var i=0;i<t.length;i++){var n=t[i],o=r[n];r[n]=function(l){var c=Ft.operation(e),h=Array.prototype.slice.call(arguments,1),m=h.pop();h.push(function(D){c.retry(D)||(D&&(arguments[0]=c.mainError()),m.apply(this,arguments))}),c.attempt(function(){l.apply(r,h)})}.bind(r,o),r[n].options=e}}});var $c=E((B0,qc)=>{u();qc.exports=Uc()});var zc=E((x0,Wc)=>{u();var jp=$c();function Up(r,e){function t(s,i){var n=e||{},o;"randomize"in n||(n.randomize=!0),o=jp.operation(n);function a(h){i(h||new Error("Aborted"))}function l(h,m){if(h.bail){a(h);return}o.retry(h)?n.onRetry&&n.onRetry(h,m):i(o.mainError())}function c(h){var m;try{m=r(a,h)}catch(D){l(D,h);return}Promise.resolve(m).then(s).catch(function(A){l(A,h)})}o.attempt(c)}return new Promise(t)}Wc.exports=Up});var Fm={};Fl(Fm,{ConvertError:()=>R,MANAGERS:()=>qe,convert:()=>wm,getPackageManagerMeta:()=>ro,getWorkspaceDetails:()=>to,install:()=>Js});module.exports=bl(Fm);u();u();u();u();var Tl=w(ho());u();u();function ei(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}u();u();function ar(r){return ar=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ar(r)}u();function ti(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function ri(r,e){if(e&&(ar(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ti(r)}u();function lt(r){return lt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},lt(r)}u();u();function Se(r,e){return Se=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(s,i){return s.__proto__=i,s},Se(r,e)}function si(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),e&&Se(r,e)}u();u();function ii(r){return Function.toString.call(r).indexOf("[native code]")!==-1}u();u();function ni(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Bt(r,e,t){return ni()?Bt=Reflect.construct.bind():Bt=function(i,n,o){var a=[null];a.push.apply(a,n);var l=Function.bind.apply(i,a),c=new l;return o&&Se(c,o.prototype),c},Bt.apply(null,arguments)}function cr(r){var e=typeof Map=="function"?new Map:void 0;return cr=function(s){if(s===null||!ii(s))return s;if(typeof s!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(s))return e.get(s);e.set(s,i)}function i(){return Bt(s,arguments,lt(this).constructor)}return i.prototype=Object.create(s.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),Se(i,s)},cr(r)}var Bo=w(vo());var Pl=w(require("fs-extra")),cd=function(r){si(e,r);function e(t){var s;return ei(this,e),s=ri(this,lt(e).call(this,"No package.json could be found upwards from the directory ".concat(t))),s.directory=t,s}return e}(cr(Error));u();u();var Nl=w(require("fs")),Ll=w(require("path"));u();var zl=w(require("fs")),Gl=w(require("path")),Hl=w(require("js-yaml")),Jl=require("fast-glob");u();var Ot=require("picocolors"),jl=w(require("ora")),xo=w(require("gradient-string")),Oo="#0099F7",To="#F11712",Ul="#FFFF00",fi=r=>{let e=ql(r);return t=>`\x1B[38;5;${e}m${t}${(0,Ot.reset)("")}`},Ed=(0,xo.default)(Oo,To),yd=fi(Oo),Ad=fi(To),Cd=fi(Ul);function ql(r){let e=parseInt(r.slice(1),16),t=Math.floor(e/(256*256))%256,s=Math.floor(e/256)%256,i=e%256;return 16+36*Math.round(t/255*5)+6*Math.round(s/255*5)+Math.round(i/255*5)}u();var No=w(require("os")),Lo=w(require("execa"));async function Ur(r,e=[],t){let s={cwd:No.default.tmpdir(),env:{COREPACK_ENABLE_STRICT:"0"},...t};try{let{stdout:i}=await(0,Lo.default)(r,e,s);return i.trim()}catch{return}}async function pi(){let[r,e,t,s]=await Promise.all([Ur("yarnpkg",["--version"],{cwd:"."}),Ur("npm",["--version"]),Ur("pnpm",["--version"]),Ur("bun",["--version"])]);return{yarn:r,pnpm:t,npm:e,bun:s}}u();var Vl=w(require("fs-extra"));u();var Yl=w(require("path")),Kl=w(require("fs-extra")),Zl=w(require("picocolors"));u();var Nc=require("stream"),Lc=require("util"),Pp=require("path"),Np=require("os"),Mc=require("fs"),Lp=w(Pc());var S0=(0,Lc.promisify)(Nc.Stream.pipeline);u();var Mp=w(require("fs-extra"));u();var Vp=w(require("path")),Yp=w(zc()),Kp=w(require("picocolors")),Zp=w(require("fs-extra"));u();u();var Xp=w(require("picocolors")),Qp=w(require("update-check"));u();u();u();var R=class extends Error{constructor(t,s){var i;super(t);this.name="ConvertError",this.type=(i=s==null?void 0:s.type)!=null?i:"unknown",Error.captureStackTrace(this,R)}};u();u();var bt=w(require("path")),me=w(require("fs-extra")),Qc=w(require("execa"));u();var Kc=w(require("path")),Zc=w(require("fs-extra")),Xc=w(require("picocolors"));u();var je=w(require("path")),Gc=w(require("execa")),te=require("fs-extra"),Hc=require("fast-glob"),Jc=w(require("js-yaml"));var em=/^(?!_)(?<manager>.+)@(?<version>.+)$/;function M({workspaceRoot:r}){let e=je.default.join(r,"package.json");try{return(0,te.readJsonSync)(e,"utf8")}catch(t){if(t&&typeof t=="object"&&"code"in t){if(t.code==="ENOENT")throw new R(`no "package.json" found at ${r}`,{type:"package_json-missing"});if(t.code==="EJSONPARSE")throw new R(`failed to parse "package.json" at ${r}`,{type:"package_json-parse_error"})}throw new Error(`unexpected error reading "package.json" at ${r}`)}}function st({workspaceRoot:r}){let{packageManager:e}=M({workspaceRoot:r});if(e)try{let t=em.exec(e);if(t){let[s,i]=t;return i}}catch{}}function Ue({workspaceRoot:r}){let e=M({workspaceRoot:r}),t=je.default.basename(r),{name:s=t,description:i}=e;return{name:s,description:i}}function eo({workspaceRoot:r}){let e=je.default.join(r,"pnpm-workspace.yaml");if((0,te.existsSync)(e))try{let t=Jc.default.load((0,te.readFileSync)(e,"utf8"));if(t instanceof Object&&"packages"in t&&Array.isArray(t.packages))return t.packages}catch{throw new R(`failed to parse ${e}`,{type:"pnpm-workspace_parse_error"})}return[]}function it({root:r,lockFile:e,workspaceConfig:t}){let s=n=>je.default.join(r,n),i={root:r,lockfile:s(e),packageJson:s("package.json"),nodeModules:s("node_modules")};return t&&(i.workspaceConfig=s(t)),i}function rr({workspaces:r}){var e;return r?Array.isArray(r)?r:"packages"in r?(e=r.packages)!=null?e:[]:[]:[]}function nt({workspaceRoot:r,workspaceGlobs:e}){if(!e)return[];let t=e.filter(s=>s.startsWith("!")).map(s=>s.slice(1));return e.filter(s=>!s.startsWith("!")).flatMap(s=>{let i=[`${s}/package.json`];return(0,Hc.sync)(i,{onlyFiles:!0,absolute:!0,cwd:r,ignore:["**/node_modules/**",...t]})}).map(s=>{let i=je.default.dirname(s),{name:n,description:o}=Ue({workspaceRoot:i});return{name:n,description:o,paths:{root:i,packageJson:s,nodeModules:je.default.join(i,"node_modules")}}})}function Vc({directory:r}){let e=je.default.resolve(process.cwd(),r);return{exists:(0,te.existsSync)(e),absolute:e}}function le({packageManager:r,action:e,project:t}){let s=t.workspaceData.globs.length>0;return`${e==="remove"?"Removing":"Adding"} ${r} ${s?"workspaces":""} ${e==="remove"?"from":"to"} ${t.name}`}function Yc({project:r}){let e=t=>!(t.includes("*")&&(t.includes("**")||t.split("/").slice(0,-1).join("/").includes("*"))||["!","[","]","{","}"].some(s=>t.includes(s)));return r.workspaceData.globs.every(e)}function re({project:r,options:e}){e!=null&&e.dry||(0,te.rmSync)(r.paths.lockfile,{force:!0})}async function Hs({project:r,options:e}){if(!(e!=null&&e.dry)&&(0,te.existsSync)(r.paths.lockfile))try{let{stdout:t}=await(0,Gc.default)("bun",["bun.lockb"],{stdin:"ignore",cwd:r.paths.root,preferLocal:!0,shell:process.platform==="win32"});await(0,te.writeFile)(je.default.join(r.paths.root,"yarn.lock"),t)}catch{}finally{(0,te.rmSync)(r.paths.lockfile,{force:!0})}}function tm({dependencyList:r,project:e,to:t}){let s=[];return e.workspaceData.workspaces.forEach(i=>{let{name:n}=i;if(r[n]){let o=r[n],a=o.startsWith("workspace:")?o.slice(10):o;r[n]=t.name==="pnpm"?`workspace:${a}`:a,s.push(n)}}),{dependencyList:r,updated:s}}function he({project:r,workspace:e,to:t,logger:s,options:i}){if(["yarn","npm","bun"].includes(t.name)&&["yarn","npm","bun"].includes(r.packageManager))return;let n=M({workspaceRoot:e.paths.root}),o={dependencies:[],devDependencies:[],peerDependencies:[],optionalDependencies:[]},a=["dependencies","devDependencies","peerDependencies","optionalDependencies"];a.forEach(m=>{let D=n[m];if(D){let{updated:A,dependencyList:b}=tm({dependencyList:D,project:r,to:t});n[m]=b,o[m]=A}});let l=m=>{let D=o[m].length;if(D>0)return`${Xc.default.green(D.toString())} ${m}`},c=a.map(l).filter(Boolean),h=`./${Kc.default.relative(r.paths.root,e.paths.packageJson)}`;if(c.length>=1){let m="updating";c.forEach((D,A)=>{c.length===1?m+=` ${D} in ${h}`:A===c.length-1?m+=`and ${D} in ${h}`:m+=` ${D}, `}),s.workspaceStep(m)}else s.workspaceStep(`no workspace dependencies found in ${h}`);i!=null&&i.dry||Zc.default.writeJSONSync(e.paths.packageJson,n,{spaces:2})}var ot={name:"pnpm",lock:"pnpm-lock.yaml"};async function el(r){let e=bt.default.join(r.workspaceRoot,ot.lock),t=bt.default.join(r.workspaceRoot,"pnpm-workspace.yaml"),s=st({workspaceRoot:r.workspaceRoot});return me.default.existsSync(e)||me.default.existsSync(t)||s===ot.name}async function rm(r){if(!await el(r))throw new R("Not a pnpm project",{type:"package_manager-unexpected"});let{name:t,description:s}=Ue(r);return{name:t,description:s,packageManager:ot.name,paths:it({root:r.workspaceRoot,lockFile:ot.lock,workspaceConfig:"pnpm-workspace.yaml"}),workspaceData:{globs:eo(r),workspaces:nt({workspaceGlobs:eo(r),...r})}}}async function sm(r){let{project:e,to:t,logger:s,options:i}=r,n=e.workspaceData.globs.length>0;s.mainStep(le({action:"create",packageManager:ot.name,project:e}));let o=M({workspaceRoot:e.paths.root});s.rootHeader(),o.packageManager=`${t.name}@${t.version}`,s.rootStep(`adding "packageManager" field to ${e.name} root "package.json"`),i!=null&&i.dry||(me.default.writeJSONSync(e.paths.packageJson,o,{spaces:2}),n&&(s.rootStep('adding "pnpm-workspace.yaml"'),me.default.writeFileSync(bt.default.join(e.paths.root,"pnpm-workspace.yaml"),`packages:
4
4
  ${e.workspaceData.globs.map(a=>` - "${a}"`).join(`
5
- `)}`))),n&&(he({workspace:{name:"root",paths:e.paths},project:e,to:t,logger:s,options:i}),s.workspaceHeader(),e.workspaceData.workspaces.forEach(a=>{he({workspace:a,project:e,to:t,logger:s,options:i})}))}async function sm(r){let{project:e,logger:t,options:s}=r,i=e.workspaceData.globs.length>0;t.mainStep(le({action:"remove",packageManager:ot.name,project:e}));let n=M({workspaceRoot:e.paths.root});if(e.paths.workspaceConfig&&i&&(t.subStep('removing "pnpm-workspace.yaml"'),s!=null&&s.dry||me.default.rmSync(e.paths.workspaceConfig,{force:!0})),t.subStep(`removing "packageManager" field in ${e.name} root "package.json"`),delete n.packageManager,!(s!=null&&s.dry)){me.default.writeJSONSync(e.paths.packageJson,n,{spaces:2});let o=[e.paths.nodeModules,...e.workspaceData.workspaces.map(a=>a.paths.nodeModules)];try{t.subStep('removing "node_modules"'),await Promise.all(o.map(a=>me.default.rm(a,{recursive:!0,force:!0})))}catch{throw new R("Failed to remove node_modules",{type:"error_removing_node_modules"})}}}async function im(r){let{project:e,logger:t,options:s}=r;t.subStep(`removing ${bt.default.relative(e.paths.root,e.paths.lockfile)}`),s!=null&&s.dry||me.default.rmSync(e.paths.lockfile,{force:!0})}async function nm(r){let{project:e,options:t,logger:s}=r,i=()=>{s.subStep(`converting ${bt.default.relative(e.paths.root,e.paths.lockfile)} to ${ot.lock}`)},n=async()=>{if(!(t!=null&&t.dry)&&me.default.existsSync(e.paths.lockfile))try{await(0,Qc.default)(ot.name,["import"],{stdio:"ignore",cwd:e.paths.root,preferLocal:!0,shell:process.platform==="win32"})}catch{}finally{re({project:e,options:t})}};switch(e.packageManager){case"pnpm":break;case"bun":i(),await Hs({project:e,options:t}),await n(),me.default.rmSync(bt.default.join(e.paths.root,"yarn.lock"),{force:!0});break;case"npm":i(),await n();break;case"yarn":i(),await n();break}}var tl={detect:el,read:tm,create:rm,remove:sm,clean:im,convertLock:nm};u();var Br=w(require("path")),St=w(require("fs-extra"));var sr={name:"npm",lock:"package-lock.json"};async function rl(r){let e=Br.default.join(r.workspaceRoot,sr.lock),t=st({workspaceRoot:r.workspaceRoot});return St.default.existsSync(e)||t===sr.name}async function om(r){if(!await rl(r))throw new R("Not an npm project",{type:"package_manager-unexpected"});let t=M(r),{name:s,description:i}=Ue(r),n=rr({workspaces:t.workspaces});return{name:s,description:i,packageManager:sr.name,paths:it({root:r.workspaceRoot,lockFile:sr.lock}),workspaceData:{globs:n,workspaces:nt({workspaceGlobs:n,...r})}}}async function um(r){let{project:e,options:t,to:s,logger:i}=r,n=e.workspaceData.globs.length>0;i.mainStep(le({packageManager:sr.name,action:"create",project:e}));let o=M({workspaceRoot:e.paths.root});i.rootHeader(),i.rootStep(`adding "packageManager" field to ${Br.default.relative(e.paths.root,e.paths.packageJson)}`),o.packageManager=`${s.name}@${s.version}`,n?(i.rootStep(`adding "workspaces" field to ${Br.default.relative(e.paths.root,e.paths.packageJson)}`),o.workspaces=e.workspaceData.globs,t!=null&&t.dry||St.default.writeJSONSync(e.paths.packageJson,o,{spaces:2}),he({workspace:{name:"root",paths:e.paths},project:e,to:s,logger:i,options:t}),i.workspaceHeader(),e.workspaceData.workspaces.forEach(a=>{he({workspace:a,project:e,to:s,logger:i,options:t})})):t!=null&&t.dry||St.default.writeJSONSync(e.paths.packageJson,o,{spaces:2})}async function am(r){let{project:e,logger:t,options:s}=r,i=e.workspaceData.globs.length>0;t.mainStep(le({packageManager:sr.name,action:"remove",project:e}));let n=M({workspaceRoot:e.paths.root});if(i&&(t.subStep(`removing "workspaces" field in ${e.name} root "package.json"`),delete n.workspaces),t.subStep(`removing "packageManager" field in ${e.name} root "package.json"`),delete n.packageManager,!(s!=null&&s.dry)){St.default.writeJSONSync(e.paths.packageJson,n,{spaces:2});let o=[e.paths.nodeModules,...e.workspaceData.workspaces.map(a=>a.paths.nodeModules)];try{t.subStep('removing "node_modules"'),await Promise.all(o.map(a=>St.default.rm(a,{recursive:!0,force:!0})))}catch{throw new R("Failed to remove node_modules",{type:"error_removing_node_modules"})}}}async function cm(r){let{project:e,logger:t,options:s}=r;t.subStep(`removing ${Br.default.relative(e.paths.root,e.paths.lockfile)}`),s!=null&&s.dry||St.default.rmSync(e.paths.lockfile,{force:!0})}async function lm(r){let{project:e,options:t}=r;switch(e.packageManager){case"pnpm":re({project:e,options:t});break;case"bun":re({project:e,options:t});break;case"npm":break;case"yarn":re({project:e,options:t});break}}var sl={detect:rl,read:om,create:um,remove:am,clean:cm,convertLock:lm};u();var ir=w(require("path")),kt=w(require("fs-extra"));var _t={name:"yarn",lock:"yarn.lock"};async function il(r){let e=ir.default.join(r.workspaceRoot,_t.lock),t=st({workspaceRoot:r.workspaceRoot});return kt.default.existsSync(e)||t===_t.name}async function hm(r){if(!await il(r))throw new R("Not a yarn project",{type:"package_manager-unexpected"});let t=M(r),{name:s,description:i}=Ue(r),n=rr({workspaces:t.workspaces});return{name:s,description:i,packageManager:_t.name,paths:it({root:r.workspaceRoot,lockFile:_t.lock}),workspaceData:{globs:n,workspaces:nt({workspaceGlobs:n,...r})}}}async function fm(r){let{project:e,to:t,logger:s,options:i}=r,n=e.workspaceData.globs.length>0;s.mainStep(le({packageManager:_t.name,action:"create",project:e}));let o=M({workspaceRoot:e.paths.root});s.rootHeader(),s.rootStep(`adding "packageManager" field to ${ir.default.relative(e.paths.root,e.paths.packageJson)}`),o.packageManager=`${t.name}@${t.version}`,n?(s.rootStep(`adding "workspaces" field to ${ir.default.relative(e.paths.root,e.paths.packageJson)}`),o.workspaces=e.workspaceData.globs,i!=null&&i.dry||kt.default.writeJSONSync(e.paths.packageJson,o,{spaces:2}),he({workspace:{name:"root",paths:e.paths},project:e,to:t,logger:s,options:i}),s.workspaceHeader(),e.workspaceData.workspaces.forEach(a=>{he({workspace:a,project:e,to:t,logger:s,options:i})})):i!=null&&i.dry||kt.default.writeJSONSync(e.paths.packageJson,o,{spaces:2})}async function pm(r){let{project:e,logger:t,options:s}=r,i=e.workspaceData.globs.length>0;t.mainStep(le({packageManager:_t.name,action:"remove",project:e}));let n=M({workspaceRoot:e.paths.root});if(i&&(t.subStep(`removing "workspaces" field in ${e.name} root "package.json"`),delete n.workspaces),t.subStep(`removing "packageManager" field in ${e.name} root "package.json"`),delete n.packageManager,!(s!=null&&s.dry)){kt.default.writeJSONSync(e.paths.packageJson,n,{spaces:2});let o=[e.paths.nodeModules,...e.workspaceData.workspaces.map(a=>a.paths.nodeModules)];try{t.subStep('removing "node_modules"'),await Promise.all(o.map(a=>kt.default.rm(a,{recursive:!0,force:!0})))}catch{throw new R("Failed to remove node_modules",{type:"error_removing_node_modules"})}}}async function mm(r){let{project:e,logger:t,options:s}=r;t.subStep(`removing ${ir.default.relative(e.paths.root,e.paths.lockfile)}`),s!=null&&s.dry||kt.default.rmSync(e.paths.lockfile,{force:!0})}async function dm(r){let{project:e,options:t,logger:s}=r,i=()=>{s.subStep(`converting ${ir.default.relative(e.paths.root,e.paths.lockfile)} to ${_t.lock}`)};switch(e.packageManager){case"pnpm":re({project:e,options:t});break;case"bun":i(),await Hs({project:e,options:t});break;case"npm":re({project:e,options:t});break;case"yarn":break}}var nl={detect:il,read:hm,create:fm,remove:pm,clean:mm,convertLock:dm};u();var xr=w(require("path")),Rt=w(require("fs-extra"));var nr={name:"bun",lock:"bun.lockb"};async function ol(r){let e=xr.default.join(r.workspaceRoot,nr.lock),t=st({workspaceRoot:r.workspaceRoot});return Rt.default.existsSync(e)||t===nr.name}async function Dm(r){if(!await ol(r))throw new R("Not a bun project",{type:"package_manager-unexpected"});let t=M(r),{name:s,description:i}=Ue(r),n=rr({workspaces:t.workspaces});return{name:s,description:i,packageManager:nr.name,paths:it({root:r.workspaceRoot,lockFile:nr.lock}),workspaceData:{globs:n,workspaces:nt({workspaceGlobs:n,...r})}}}async function gm(r){let{project:e,to:t,logger:s,options:i}=r,n=e.workspaceData.globs.length>0;if(!Yc({project:e}))throw new R("Unable to convert project to bun - workspace globs unsupported",{type:"bun-workspace_glob_error"});s.mainStep(le({packageManager:nr.name,action:"create",project:e}));let o=M({workspaceRoot:e.paths.root});s.rootHeader(),s.rootStep(`adding "packageManager" field to ${xr.default.relative(e.paths.root,e.paths.packageJson)}`),o.packageManager=`${t.name}@${t.version}`,n?(s.rootStep(`adding "workspaces" field to ${xr.default.relative(e.paths.root,e.paths.packageJson)}`),o.workspaces=e.workspaceData.globs,i!=null&&i.dry||Rt.default.writeJSONSync(e.paths.packageJson,o,{spaces:2}),he({workspace:{name:"root",paths:e.paths},project:e,to:t,logger:s,options:i}),s.workspaceHeader(),e.workspaceData.workspaces.forEach(a=>{he({workspace:a,project:e,to:t,logger:s,options:i})})):i!=null&&i.dry||Rt.default.writeJSONSync(e.paths.packageJson,o,{spaces:2})}async function Em(r){let{project:e,logger:t,options:s}=r,i=e.workspaceData.globs.length>0;t.mainStep(le({packageManager:nr.name,action:"remove",project:e}));let n=M({workspaceRoot:e.paths.root});if(i&&(t.subStep(`removing "workspaces" field in ${e.name} root "package.json"`),delete n.workspaces),t.subStep(`removing "packageManager" field in ${e.name} root "package.json"`),delete n.packageManager,!(s!=null&&s.dry)){Rt.default.writeJSONSync(e.paths.packageJson,n,{spaces:2});let o=[e.paths.nodeModules,...e.workspaceData.workspaces.map(a=>a.paths.nodeModules)];try{t.subStep('removing "node_modules"'),await Promise.all(o.map(a=>Rt.default.rm(a,{recursive:!0,force:!0})))}catch{throw new R("Failed to remove node_modules",{type:"error_removing_node_modules"})}}}async function ym(r){let{project:e,logger:t,options:s}=r;t.subStep(`removing ${xr.default.relative(e.paths.root,e.paths.lockfile)}`),s!=null&&s.dry||Rt.default.rmSync(e.paths.lockfile,{force:!0})}async function Am(r){let{project:e,options:t}=r;switch(e.packageManager){case"pnpm":re({project:e,options:t});break;case"bun":break;case"npm":re({project:e,options:t});break;case"yarn":re({project:e,options:t});break}}var ul={detect:ol,read:Dm,create:gm,remove:Em,clean:ym,convertLock:Am};var qe={pnpm:tl,yarn:nl,npm:sl,bun:ul};async function to({root:r}){let{exists:e,absolute:t}=Vc({directory:r});if(!e)throw new R(`Could not find directory at ${t}. Ensure the directory exists.`,{type:"invalid_directory"});for(let{detect:s,read:i}of Object.values(qe))if(await s({workspaceRoot:t}))return i({workspaceRoot:t});throw new R("Could not determine package manager. Add `packageManager` to `package.json` or ensure a lockfile is present.",{type:"package_manager-unable_to_detect"})}u();var pl=w(require("picocolors"));u();var ll=w(require("execa")),hl=w(require("ora")),fl=require("semver");u();var se=w(require("picocolors")),al=w(require("gradient-string")),or=2,ur=class{constructor({interactive:e,dry:t}={}){this.interactive=e!=null?e:!0,this.dry=t!=null?t:!1,this.step=1}logger(...e){this.interactive&&console.log(...e)}indented(e,...t){this.logger(" ".repeat(or*e),...t)}header(e){this.blankLine(),this.logger(se.default.bold(e))}installerFrames(){let e=`${" ".repeat(or)} - ${this.dry?se.default.yellow("SKIPPED | "):se.default.green("OK | ")}`;return[`${e} `,`${e}> `,`${e}>> `,`${e}>>>`]}gradient(e){return(0,al.default)("#0099F7","#F11712")(e.toString())}hero(){this.logger(se.default.bold(this.gradient(`
5
+ `)}`))),n&&(he({workspace:{name:"root",paths:e.paths},project:e,to:t,logger:s,options:i}),s.workspaceHeader(),e.workspaceData.workspaces.forEach(a=>{he({workspace:a,project:e,to:t,logger:s,options:i})}))}async function im(r){let{project:e,logger:t,options:s}=r,i=e.workspaceData.globs.length>0;t.mainStep(le({action:"remove",packageManager:ot.name,project:e}));let n=M({workspaceRoot:e.paths.root});if(e.paths.workspaceConfig&&i&&(t.subStep('removing "pnpm-workspace.yaml"'),s!=null&&s.dry||me.default.rmSync(e.paths.workspaceConfig,{force:!0})),t.subStep(`removing "packageManager" field in ${e.name} root "package.json"`),delete n.packageManager,!(s!=null&&s.dry)){me.default.writeJSONSync(e.paths.packageJson,n,{spaces:2});let o=[e.paths.nodeModules,...e.workspaceData.workspaces.map(a=>a.paths.nodeModules)];try{t.subStep('removing "node_modules"'),await Promise.all(o.map(a=>me.default.rm(a,{recursive:!0,force:!0})))}catch{throw new R("Failed to remove node_modules",{type:"error_removing_node_modules"})}}}async function nm(r){let{project:e,logger:t,options:s}=r;t.subStep(`removing ${bt.default.relative(e.paths.root,e.paths.lockfile)}`),s!=null&&s.dry||me.default.rmSync(e.paths.lockfile,{force:!0})}async function om(r){let{project:e,options:t,logger:s}=r,i=()=>{s.subStep(`converting ${bt.default.relative(e.paths.root,e.paths.lockfile)} to ${ot.lock}`)},n=async()=>{if(!(t!=null&&t.dry)&&me.default.existsSync(e.paths.lockfile))try{await(0,Qc.default)(ot.name,["import"],{stdio:"ignore",cwd:e.paths.root,preferLocal:!0,shell:process.platform==="win32"})}catch{}finally{re({project:e,options:t})}};switch(e.packageManager){case"pnpm":break;case"bun":i(),await Hs({project:e,options:t}),await n(),me.default.rmSync(bt.default.join(e.paths.root,"yarn.lock"),{force:!0});break;case"npm":i(),await n();break;case"yarn":i(),await n();break}}var tl={detect:el,read:rm,create:sm,remove:im,clean:nm,convertLock:om};u();var Br=w(require("path")),St=w(require("fs-extra"));var sr={name:"npm",lock:"package-lock.json"};async function rl(r){let e=Br.default.join(r.workspaceRoot,sr.lock),t=st({workspaceRoot:r.workspaceRoot});return St.default.existsSync(e)||t===sr.name}async function um(r){if(!await rl(r))throw new R("Not an npm project",{type:"package_manager-unexpected"});let t=M(r),{name:s,description:i}=Ue(r),n=rr({workspaces:t.workspaces});return{name:s,description:i,packageManager:sr.name,paths:it({root:r.workspaceRoot,lockFile:sr.lock}),workspaceData:{globs:n,workspaces:nt({workspaceGlobs:n,...r})}}}async function am(r){let{project:e,options:t,to:s,logger:i}=r,n=e.workspaceData.globs.length>0;i.mainStep(le({packageManager:sr.name,action:"create",project:e}));let o=M({workspaceRoot:e.paths.root});i.rootHeader(),i.rootStep(`adding "packageManager" field to ${Br.default.relative(e.paths.root,e.paths.packageJson)}`),o.packageManager=`${s.name}@${s.version}`,n?(i.rootStep(`adding "workspaces" field to ${Br.default.relative(e.paths.root,e.paths.packageJson)}`),o.workspaces=e.workspaceData.globs,t!=null&&t.dry||St.default.writeJSONSync(e.paths.packageJson,o,{spaces:2}),he({workspace:{name:"root",paths:e.paths},project:e,to:s,logger:i,options:t}),i.workspaceHeader(),e.workspaceData.workspaces.forEach(a=>{he({workspace:a,project:e,to:s,logger:i,options:t})})):t!=null&&t.dry||St.default.writeJSONSync(e.paths.packageJson,o,{spaces:2})}async function cm(r){let{project:e,logger:t,options:s}=r,i=e.workspaceData.globs.length>0;t.mainStep(le({packageManager:sr.name,action:"remove",project:e}));let n=M({workspaceRoot:e.paths.root});if(i&&(t.subStep(`removing "workspaces" field in ${e.name} root "package.json"`),delete n.workspaces),t.subStep(`removing "packageManager" field in ${e.name} root "package.json"`),delete n.packageManager,!(s!=null&&s.dry)){St.default.writeJSONSync(e.paths.packageJson,n,{spaces:2});let o=[e.paths.nodeModules,...e.workspaceData.workspaces.map(a=>a.paths.nodeModules)];try{t.subStep('removing "node_modules"'),await Promise.all(o.map(a=>St.default.rm(a,{recursive:!0,force:!0})))}catch{throw new R("Failed to remove node_modules",{type:"error_removing_node_modules"})}}}async function lm(r){let{project:e,logger:t,options:s}=r;t.subStep(`removing ${Br.default.relative(e.paths.root,e.paths.lockfile)}`),s!=null&&s.dry||St.default.rmSync(e.paths.lockfile,{force:!0})}async function hm(r){let{project:e,options:t}=r;switch(e.packageManager){case"pnpm":re({project:e,options:t});break;case"bun":re({project:e,options:t});break;case"npm":break;case"yarn":re({project:e,options:t});break}}var sl={detect:rl,read:um,create:am,remove:cm,clean:lm,convertLock:hm};u();var ir=w(require("path")),kt=w(require("fs-extra"));var _t={name:"yarn",lock:"yarn.lock"};async function il(r){let e=ir.default.join(r.workspaceRoot,_t.lock),t=st({workspaceRoot:r.workspaceRoot});return kt.default.existsSync(e)||t===_t.name}async function fm(r){if(!await il(r))throw new R("Not a yarn project",{type:"package_manager-unexpected"});let t=M(r),{name:s,description:i}=Ue(r),n=rr({workspaces:t.workspaces});return{name:s,description:i,packageManager:_t.name,paths:it({root:r.workspaceRoot,lockFile:_t.lock}),workspaceData:{globs:n,workspaces:nt({workspaceGlobs:n,...r})}}}async function pm(r){let{project:e,to:t,logger:s,options:i}=r,n=e.workspaceData.globs.length>0;s.mainStep(le({packageManager:_t.name,action:"create",project:e}));let o=M({workspaceRoot:e.paths.root});s.rootHeader(),s.rootStep(`adding "packageManager" field to ${ir.default.relative(e.paths.root,e.paths.packageJson)}`),o.packageManager=`${t.name}@${t.version}`,n?(s.rootStep(`adding "workspaces" field to ${ir.default.relative(e.paths.root,e.paths.packageJson)}`),o.workspaces=e.workspaceData.globs,i!=null&&i.dry||kt.default.writeJSONSync(e.paths.packageJson,o,{spaces:2}),he({workspace:{name:"root",paths:e.paths},project:e,to:t,logger:s,options:i}),s.workspaceHeader(),e.workspaceData.workspaces.forEach(a=>{he({workspace:a,project:e,to:t,logger:s,options:i})})):i!=null&&i.dry||kt.default.writeJSONSync(e.paths.packageJson,o,{spaces:2})}async function mm(r){let{project:e,logger:t,options:s}=r,i=e.workspaceData.globs.length>0;t.mainStep(le({packageManager:_t.name,action:"remove",project:e}));let n=M({workspaceRoot:e.paths.root});if(i&&(t.subStep(`removing "workspaces" field in ${e.name} root "package.json"`),delete n.workspaces),t.subStep(`removing "packageManager" field in ${e.name} root "package.json"`),delete n.packageManager,!(s!=null&&s.dry)){kt.default.writeJSONSync(e.paths.packageJson,n,{spaces:2});let o=[e.paths.nodeModules,...e.workspaceData.workspaces.map(a=>a.paths.nodeModules)];try{t.subStep('removing "node_modules"'),await Promise.all(o.map(a=>kt.default.rm(a,{recursive:!0,force:!0})))}catch{throw new R("Failed to remove node_modules",{type:"error_removing_node_modules"})}}}async function dm(r){let{project:e,logger:t,options:s}=r;t.subStep(`removing ${ir.default.relative(e.paths.root,e.paths.lockfile)}`),s!=null&&s.dry||kt.default.rmSync(e.paths.lockfile,{force:!0})}async function Dm(r){let{project:e,options:t,logger:s}=r,i=()=>{s.subStep(`converting ${ir.default.relative(e.paths.root,e.paths.lockfile)} to ${_t.lock}`)};switch(e.packageManager){case"pnpm":re({project:e,options:t});break;case"bun":i(),await Hs({project:e,options:t});break;case"npm":re({project:e,options:t});break;case"yarn":break}}var nl={detect:il,read:fm,create:pm,remove:mm,clean:dm,convertLock:Dm};u();var xr=w(require("path")),Rt=w(require("fs-extra"));var nr={name:"bun",lock:"bun.lockb"};async function ol(r){let e=xr.default.join(r.workspaceRoot,nr.lock),t=st({workspaceRoot:r.workspaceRoot});return Rt.default.existsSync(e)||t===nr.name}async function gm(r){if(!await ol(r))throw new R("Not a bun project",{type:"package_manager-unexpected"});let t=M(r),{name:s,description:i}=Ue(r),n=rr({workspaces:t.workspaces});return{name:s,description:i,packageManager:nr.name,paths:it({root:r.workspaceRoot,lockFile:nr.lock}),workspaceData:{globs:n,workspaces:nt({workspaceGlobs:n,...r})}}}async function Em(r){let{project:e,to:t,logger:s,options:i}=r,n=e.workspaceData.globs.length>0;if(!Yc({project:e}))throw new R("Unable to convert project to bun - workspace globs unsupported",{type:"bun-workspace_glob_error"});s.mainStep(le({packageManager:nr.name,action:"create",project:e}));let o=M({workspaceRoot:e.paths.root});s.rootHeader(),s.rootStep(`adding "packageManager" field to ${xr.default.relative(e.paths.root,e.paths.packageJson)}`),o.packageManager=`${t.name}@${t.version}`,n?(s.rootStep(`adding "workspaces" field to ${xr.default.relative(e.paths.root,e.paths.packageJson)}`),o.workspaces=e.workspaceData.globs,i!=null&&i.dry||Rt.default.writeJSONSync(e.paths.packageJson,o,{spaces:2}),he({workspace:{name:"root",paths:e.paths},project:e,to:t,logger:s,options:i}),s.workspaceHeader(),e.workspaceData.workspaces.forEach(a=>{he({workspace:a,project:e,to:t,logger:s,options:i})})):i!=null&&i.dry||Rt.default.writeJSONSync(e.paths.packageJson,o,{spaces:2})}async function ym(r){let{project:e,logger:t,options:s}=r,i=e.workspaceData.globs.length>0;t.mainStep(le({packageManager:nr.name,action:"remove",project:e}));let n=M({workspaceRoot:e.paths.root});if(i&&(t.subStep(`removing "workspaces" field in ${e.name} root "package.json"`),delete n.workspaces),t.subStep(`removing "packageManager" field in ${e.name} root "package.json"`),delete n.packageManager,!(s!=null&&s.dry)){Rt.default.writeJSONSync(e.paths.packageJson,n,{spaces:2});let o=[e.paths.nodeModules,...e.workspaceData.workspaces.map(a=>a.paths.nodeModules)];try{t.subStep('removing "node_modules"'),await Promise.all(o.map(a=>Rt.default.rm(a,{recursive:!0,force:!0})))}catch{throw new R("Failed to remove node_modules",{type:"error_removing_node_modules"})}}}async function Am(r){let{project:e,logger:t,options:s}=r;t.subStep(`removing ${xr.default.relative(e.paths.root,e.paths.lockfile)}`),s!=null&&s.dry||Rt.default.rmSync(e.paths.lockfile,{force:!0})}async function Cm(r){let{project:e,options:t}=r;switch(e.packageManager){case"pnpm":re({project:e,options:t});break;case"bun":break;case"npm":re({project:e,options:t});break;case"yarn":re({project:e,options:t});break}}var ul={detect:ol,read:gm,create:Em,remove:ym,clean:Am,convertLock:Cm};var qe={pnpm:tl,yarn:nl,npm:sl,bun:ul};async function to({root:r}){let{exists:e,absolute:t}=Vc({directory:r});if(!e)throw new R(`Could not find directory at ${t}. Ensure the directory exists.`,{type:"invalid_directory"});for(let{detect:s,read:i}of Object.values(qe))if(await s({workspaceRoot:t}))return i({workspaceRoot:t});throw new R("Could not determine package manager. Add `packageManager` to `package.json` or ensure a lockfile is present.",{type:"package_manager-unable_to_detect"})}u();var pl=w(require("picocolors"));u();var ll=w(require("execa")),hl=w(require("ora")),fl=require("semver");u();var se=w(require("picocolors")),al=w(require("gradient-string")),or=2,ur=class{constructor({interactive:e,dry:t}={}){this.interactive=e!=null?e:!0,this.dry=t!=null?t:!1,this.step=1}logger(...e){this.interactive&&console.log(...e)}indented(e,...t){this.logger(" ".repeat(or*e),...t)}header(e){this.blankLine(),this.logger(se.default.bold(e))}installerFrames(){let e=`${" ".repeat(or)} - ${this.dry?se.default.yellow("SKIPPED | "):se.default.green("OK | ")}`;return[`${e} `,`${e}> `,`${e}>> `,`${e}>>>`]}gradient(e){return(0,al.default)("#0099F7","#F11712")(e.toString())}hero(){this.logger(se.default.bold(this.gradient(`
6
6
  >>> TURBOREPO
7
- `)))}info(...e){this.logger(...e)}mainStep(e){this.blankLine(),this.logger(`${this.step}. ${se.default.underline(e)}`),this.step+=1}subStep(...e){this.logger(" ".repeat(or),"-",this.dry?se.default.yellow("SKIPPED |"):se.default.green("OK |"),...e)}subStepFailure(...e){this.logger(" ".repeat(or),"-",se.default.red("ERROR |"),...e)}rootHeader(){this.blankLine(),this.indented(2,"Root:")}rootStep(...e){this.logger(" ".repeat(or*3),"-",this.dry?se.default.yellow("SKIPPED |"):se.default.green("OK |"),...e)}workspaceHeader(){this.blankLine(),this.indented(2,"Workspaces:")}workspaceStep(...e){this.logger(" ".repeat(or*3),"-",this.dry?se.default.yellow("SKIPPED |"):se.default.green("OK |"),...e)}blankLine(){this.logger()}error(...e){console.error(...e)}};var cl={npm:[{name:"npm",template:"npm",command:"npm",installArgs:["install"],version:"latest",executable:"npx",semver:"*",default:!0}],pnpm:[{name:"pnpm6",template:"pnpm",command:"pnpm",installArgs:["install"],version:"latest-6",executable:"pnpx",semver:"6.x"},{name:"pnpm",template:"pnpm",command:"pnpm",installArgs:["install","--fix-lockfile"],version:"latest",executable:"pnpm dlx",semver:">=7",default:!0}],yarn:[{name:"yarn",template:"yarn",command:"yarn",installArgs:["install"],version:"1.x",executable:"npx",semver:"<2",default:!0},{name:"berry",template:"berry",command:"yarn",installArgs:["install","--no-immutable"],version:"stable",executable:"yarn dlx",semver:">=2"}],bun:[{name:"bun",template:"bun",command:"bun",installArgs:["install"],version:"latest",executable:"bunx",semver:"^1.0.1",default:!0}]};function ro(r){let{version:e,name:t}=r;return e?cl[t].find(s=>(0,fl.satisfies)(e,s.semver)):cl[t].find(s=>s.default)}async function Js(r){let{to:e,logger:t,options:s}=r,i=t!=null?t:new ur(s),n=ro(e);if(!n)throw new R("Unsupported package manager version.",{type:"package_manager-unsupported_version"});if(i.subStep(`running "${n.command} ${n.installArgs.join(" ")}"`),!(s!=null&&s.dry)){let o;i.interactive&&(o=(0,hl.default)({text:"installing dependencies...",spinner:{frames:i.installerFrames()}}).start());try{await(0,ll.default)(n.command,n.installArgs,{cwd:r.project.paths.root,preferLocal:!0,shell:process.platform==="win32"}),o&&o.stop(),i.subStep("dependencies installed")}catch(a){throw i.subStepFailure("failed to install dependencies"),a}}}async function ml({project:r,convertTo:e,logger:t,options:s}){if(t.header(`Converting project from ${r.packageManager} to ${e.name}.`),!(s!=null&&s.ignoreUnchangedPackageManager)){if(r.packageManager===e.name)throw new R("You are already using this package manager",{type:"package_manager-already_in_use"});if(!e.version)throw new R(`${e.name} is not installed, or could not be located`,{type:"package_manager-could_not_be_found"})}let i=e;s!=null&&s.ignoreUnchangedPackageManager||await qe[r.packageManager].remove({project:r,to:i,logger:t,options:s}),await qe[i.name].create({project:r,to:i,logger:t,options:s}),t.mainStep("Installing dependencies"),s!=null&&s.skipInstall?t.subStep(pl.default.yellow("Skipping install")):(await qe[i.name].convertLock({project:r,to:i,logger:t,options:s}),await Js({project:r,to:i,logger:t,options:s})),t.mainStep(`Cleaning up ${r.packageManager} workspaces`),r.packageManager!==e.name&&await qe[r.packageManager].clean({project:r,logger:t})}async function Cm({root:r,to:e,options:t}){let s=new ur({...t,interactive:!1}),[i,n]=await Promise.all([to({root:r}),pi()]);await ml({project:i,convertTo:{name:e,version:n[e]},logger:s,options:t})}0&&(module.exports={ConvertError,MANAGERS,convert,getPackageManagerMeta,getWorkspaceDetails,install});
7
+ `)))}info(...e){this.logger(...e)}mainStep(e){this.blankLine(),this.logger(`${this.step}. ${se.default.underline(e)}`),this.step+=1}subStep(...e){this.logger(" ".repeat(or),"-",this.dry?se.default.yellow("SKIPPED |"):se.default.green("OK |"),...e)}subStepFailure(...e){this.logger(" ".repeat(or),"-",se.default.red("ERROR |"),...e)}rootHeader(){this.blankLine(),this.indented(2,"Root:")}rootStep(...e){this.logger(" ".repeat(or*3),"-",this.dry?se.default.yellow("SKIPPED |"):se.default.green("OK |"),...e)}workspaceHeader(){this.blankLine(),this.indented(2,"Workspaces:")}workspaceStep(...e){this.logger(" ".repeat(or*3),"-",this.dry?se.default.yellow("SKIPPED |"):se.default.green("OK |"),...e)}blankLine(){this.logger()}error(...e){console.error(...e)}};var cl={npm:[{name:"npm",template:"npm",command:"npm",installArgs:["install"],version:"latest",executable:"npx",semver:"*",default:!0}],pnpm:[{name:"pnpm6",template:"pnpm",command:"pnpm",installArgs:["install"],version:"latest-6",executable:"pnpx",semver:"6.x"},{name:"pnpm",template:"pnpm",command:"pnpm",installArgs:["install","--fix-lockfile"],version:"latest",executable:"pnpm dlx",semver:">=7",default:!0}],yarn:[{name:"yarn",template:"yarn",command:"yarn",installArgs:["install"],version:"1.x",executable:"npx",semver:"<2",default:!0},{name:"berry",template:"berry",command:"yarn",installArgs:["install","--no-immutable"],version:"stable",executable:"yarn dlx",semver:">=2"}],bun:[{name:"bun",template:"bun",command:"bun",installArgs:["install"],version:"latest",executable:"bunx",semver:"^1.0.1",default:!0}]};function ro(r){let{version:e,name:t}=r;return e?cl[t].find(s=>(0,fl.satisfies)(e,s.semver)):cl[t].find(s=>s.default)}async function Js(r){let{to:e,logger:t,options:s}=r,i=t!=null?t:new ur(s),n=ro(e);if(!n)throw new R("Unsupported package manager version.",{type:"package_manager-unsupported_version"});if(i.subStep(`running "${n.command} ${n.installArgs.join(" ")}"`),!(s!=null&&s.dry)){let o;i.interactive&&(o=(0,hl.default)({text:"installing dependencies...",spinner:{frames:i.installerFrames()}}).start());try{await(0,ll.default)(n.command,n.installArgs,{cwd:r.project.paths.root,preferLocal:!0,shell:process.platform==="win32"}),o&&o.stop(),i.subStep("dependencies installed")}catch(a){throw i.subStepFailure("failed to install dependencies"),a}}}async function ml({project:r,convertTo:e,logger:t,options:s}){if(t.header(`Converting project from ${r.packageManager} to ${e.name}.`),!(s!=null&&s.ignoreUnchangedPackageManager)){if(r.packageManager===e.name)throw new R("You are already using this package manager",{type:"package_manager-already_in_use"});if(!e.version)throw new R(`${e.name} is not installed, or could not be located`,{type:"package_manager-could_not_be_found"})}let i=e;s!=null&&s.ignoreUnchangedPackageManager||await qe[r.packageManager].remove({project:r,to:i,logger:t,options:s}),await qe[i.name].create({project:r,to:i,logger:t,options:s}),t.mainStep("Installing dependencies"),s!=null&&s.skipInstall?t.subStep(pl.default.yellow("Skipping install")):(await qe[i.name].convertLock({project:r,to:i,logger:t,options:s}),await Js({project:r,to:i,logger:t,options:s})),t.mainStep(`Cleaning up ${r.packageManager} workspaces`),r.packageManager!==e.name&&await qe[r.packageManager].clean({project:r,logger:t})}async function wm({root:r,to:e,options:t}){let s=new ur({...t,interactive:!1}),[i,n]=await Promise.all([to({root:r}),pi()]);await ml({project:i,convertTo:{name:e,version:n[e]},logger:s,options:t})}0&&(module.exports={ConvertError,MANAGERS,convert,getPackageManagerMeta,getWorkspaceDetails,install});
8
8
  /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */