@turbo/workspaces 2.3.4-canary.6 → 2.3.4-canary.7

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/cli.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  "use strict";var Nl=Object.create;var ii=Object.defineProperty;var Ml=Object.getOwnPropertyDescriptor;var Il=Object.getOwnPropertyNames;var jl=Object.getPrototypeOf,ql=Object.prototype.hasOwnProperty;var Ul=(r,e)=>()=>(r&&(e=r(r=0)),e);var y=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),$l=(r,e)=>{for(var t in e)ii(r,t,{get:e[t],enumerable:!0})},Wl=(r,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Il(e))!ql.call(r,i)&&i!==t&&ii(r,i,{get:()=>e[i],enumerable:!(s=Ml(e,i))||s.enumerable});return r};var S=(r,e,t)=>(t=r!=null?Nl(jl(r)):{},Wl(e||!r||!r.__esModule?ii(t,"default",{value:r,enumerable:!0}):t,r));var u=Ul(()=>{});var Do=y((Gm,Re)=>{u();function ni(r){return Re.exports=ni=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},Re.exports.__esModule=!0,Re.exports.default=Re.exports,ni(r)}Re.exports=ni,Re.exports.__esModule=!0,Re.exports.default=Re.exports});var yo=y((Hm,Be)=>{u();var go=Do().default;function Eo(){"use strict";Be.exports=Eo=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,m,D){g[m]=D.value},n=typeof Symbol=="function"?Symbol:{},o=n.iterator||"@@iterator",a=n.asyncIterator||"@@asyncIterator",l=n.toStringTag||"@@toStringTag";function c(g,m,D){return Object.defineProperty(g,m,{value:D,enumerable:!0,configurable:!0,writable:!0}),g[m]}try{c({},"")}catch{c=function(D,A,F){return D[A]=F}}function h(g,m,D,A){var F=m&&m.prototype instanceof x?m:x,w=Object.create(F.prototype),P=new ri(A||[]);return i(w,"_invoke",{value:Pl(g,D,P)}),w}function d(g,m,D){try{return{type:"normal",arg:g.call(m,D)}}catch(A){return{type:"throw",arg:A}}}e.wrap=h;var p="suspendedStart",E="suspendedYield",C="executing",T="completed",b={};function x(){}function dt(){}function ge(){}var Qs={};c(Qs,o,function(){return this});var ei=Object.getPrototypeOf,Mr=ei&&ei(ei(si([])));Mr&&Mr!==t&&s.call(Mr,o)&&(Qs=Mr);var Lt=ge.prototype=x.prototype=Object.create(Qs);function po(g){["next","throw","return"].forEach(function(m){c(g,m,function(D){return this._invoke(m,D)})})}function Ir(g,m){function D(F,w,P,H){var V=d(g[F],g,w);if(V.type!=="throw"){var Dt=V.arg,Je=Dt.value;return Je&&go(Je)=="object"&&s.call(Je,"__await")?m.resolve(Je.__await).then(function(gt){D("next",gt,P,H)},function(gt){D("throw",gt,P,H)}):m.resolve(Je).then(function(gt){Dt.value=gt,P(Dt)},function(gt){return D("throw",gt,P,H)})}H(V.arg)}var A;i(this,"_invoke",{value:function(w,P){function H(){return new m(function(V,Dt){D(w,P,V,Dt)})}return A=A?A.then(H,H):H()}})}function Pl(g,m,D){var A=p;return function(F,w){if(A===C)throw new Error("Generator is already running");if(A===T){if(F==="throw")throw w;return{value:r,done:!0}}for(D.method=F,D.arg=w;;){var P=D.delegate;if(P){var H=mo(P,D);if(H){if(H===b)continue;return H}}if(D.method==="next")D.sent=D._sent=D.arg;else if(D.method==="throw"){if(A===p)throw A=T,D.arg;D.dispatchException(D.arg)}else D.method==="return"&&D.abrupt("return",D.arg);A=C;var V=d(g,m,D);if(V.type==="normal"){if(A=D.done?T:E,V.arg===b)continue;return{value:V.arg,done:D.done}}V.type==="throw"&&(A=T,D.method="throw",D.arg=V.arg)}}}function mo(g,m){var D=m.method,A=g.iterator[D];if(A===r)return m.delegate=null,D==="throw"&&g.iterator.return&&(m.method="return",m.arg=r,mo(g,m),m.method==="throw")||D!=="return"&&(m.method="throw",m.arg=new TypeError("The iterator does not provide a '"+D+"' method")),b;var F=d(A,g.iterator,m.arg);if(F.type==="throw")return m.method="throw",m.arg=F.arg,m.delegate=null,b;var w=F.arg;return w?w.done?(m[g.resultName]=w.value,m.next=g.nextLoc,m.method!=="return"&&(m.method="next",m.arg=r),m.delegate=null,b):w:(m.method="throw",m.arg=new TypeError("iterator result is not an object"),m.delegate=null,b)}function Ll(g){var m={tryLoc:g[0]};1 in g&&(m.catchLoc=g[1]),2 in g&&(m.finallyLoc=g[2],m.afterLoc=g[3]),this.tryEntries.push(m)}function ti(g){var m=g.completion||{};m.type="normal",delete m.arg,g.completion=m}function ri(g){this.tryEntries=[{tryLoc:"root"}],g.forEach(Ll,this),this.reset(!0)}function si(g){if(g||g===""){var m=g[o];if(m)return m.call(g);if(typeof g.next=="function")return g;if(!isNaN(g.length)){var D=-1,A=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 A.next=A}}throw new TypeError(go(g)+" is not iterable")}return dt.prototype=ge,i(Lt,"constructor",{value:ge,configurable:!0}),i(ge,"constructor",{value:dt,configurable:!0}),dt.displayName=c(ge,l,"GeneratorFunction"),e.isGeneratorFunction=function(g){var m=typeof g=="function"&&g.constructor;return!!m&&(m===dt||(m.displayName||m.name)==="GeneratorFunction")},e.mark=function(g){return Object.setPrototypeOf?Object.setPrototypeOf(g,ge):(g.__proto__=ge,c(g,l,"GeneratorFunction")),g.prototype=Object.create(Lt),g},e.awrap=function(g){return{__await:g}},po(Ir.prototype),c(Ir.prototype,a,function(){return this}),e.AsyncIterator=Ir,e.async=function(g,m,D,A,F){F===void 0&&(F=Promise);var w=new Ir(h(g,m,D,A),F);return e.isGeneratorFunction(m)?w:w.next().then(function(P){return P.done?P.value:w.next()})},po(Lt),c(Lt,l,"Generator"),c(Lt,o,function(){return this}),c(Lt,"toString",function(){return"[object Generator]"}),e.keys=function(g){var m=Object(g),D=[];for(var A in m)D.push(A);return D.reverse(),function F(){for(;D.length;){var w=D.pop();if(w in m)return F.value=w,F.done=!1,F}return F.done=!0,F}},e.values=si,ri.prototype={constructor:ri,reset:function(m){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(ti),!m)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 m=this.tryEntries[0].completion;if(m.type==="throw")throw m.arg;return this.rval},dispatchException:function(m){if(this.done)throw m;var D=this;function A(Dt,Je){return P.type="throw",P.arg=m,D.next=Dt,Je&&(D.method="next",D.arg=r),!!Je}for(var F=this.tryEntries.length-1;F>=0;--F){var w=this.tryEntries[F],P=w.completion;if(w.tryLoc==="root")return A("end");if(w.tryLoc<=this.prev){var H=s.call(w,"catchLoc"),V=s.call(w,"finallyLoc");if(H&&V){if(this.prev<w.catchLoc)return A(w.catchLoc,!0);if(this.prev<w.finallyLoc)return A(w.finallyLoc)}else if(H){if(this.prev<w.catchLoc)return A(w.catchLoc,!0)}else{if(!V)throw new Error("try statement without catch or finally");if(this.prev<w.finallyLoc)return A(w.finallyLoc)}}}},abrupt:function(m,D){for(var A=this.tryEntries.length-1;A>=0;--A){var F=this.tryEntries[A];if(F.tryLoc<=this.prev&&s.call(F,"finallyLoc")&&this.prev<F.finallyLoc){var w=F;break}}w&&(m==="break"||m==="continue")&&w.tryLoc<=D&&D<=w.finallyLoc&&(w=null);var P=w?w.completion:{};return P.type=m,P.arg=D,w?(this.method="next",this.next=w.finallyLoc,b):this.complete(P)},complete:function(m,D){if(m.type==="throw")throw m.arg;return m.type==="break"||m.type==="continue"?this.next=m.arg:m.type==="return"?(this.rval=this.arg=m.arg,this.method="return",this.next="end"):m.type==="normal"&&D&&(this.next=D),b},finish:function(m){for(var D=this.tryEntries.length-1;D>=0;--D){var A=this.tryEntries[D];if(A.finallyLoc===m)return this.complete(A.completion,A.afterLoc),ti(A),b}},catch:function(m){for(var D=this.tryEntries.length-1;D>=0;--D){var A=this.tryEntries[D];if(A.tryLoc===m){var F=A.completion;if(F.type==="throw"){var w=F.arg;ti(A)}return w}}throw new Error("illegal catch attempt")},delegateYield:function(m,D,A){return this.delegate={iterator:si(m),resultName:D,nextLoc:A},this.method==="next"&&(this.arg=r),b}},e}Be.exports=Eo,Be.exports.__esModule=!0,Be.exports.default=Be.exports});var Co=y((Jm,Ao)=>{u();var jr=yo()();Ao.exports=jr;try{regeneratorRuntime=jr}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=jr:Function("r","regeneratorRuntime = r")(jr)}});var Fo=y((dd,fi)=>{"use strict";u();var wo=(r,...e)=>new Promise(t=>{t(r(...e))});fi.exports=wo;fi.exports.default=wo});var So=y((Dd,pi)=>{"use strict";u();var zl=Fo(),bo=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=zl(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};pi.exports=bo;pi.exports.default=bo});var vo=y((gd,mi)=>{"use strict";u();var ko=So(),qr=class extends Error{constructor(e){super(),this.value=e}},Gl=async(r,e)=>e(await r),Hl=async r=>{let e=await Promise.all(r);if(e[1]===!0)throw new qr(e[0]);return!1},_o=async(r,e,t)=>{t={concurrency:1/0,preserveOrder:!0,...t};let s=ko(t.concurrency),i=[...r].map(o=>[o,s(Gl,o,e)]),n=ko(t.preserveOrder?1:1/0);try{await Promise.all(i.map(o=>n(Hl,o)))}catch(o){if(o instanceof qr)return o.value;throw o}};mi.exports=_o;mi.exports.default=_o});var Po=y((Ed,di)=>{"use strict";u();var Ro=require("path"),Ur=require("fs"),{promisify:Bo}=require("util"),Jl=vo(),Vl=Bo(Ur.stat),Yl=Bo(Ur.lstat),xo={directory:"isDirectory",file:"isFile"};function Oo({type:r}){if(!(r in xo))throw new Error(`Invalid type specified: ${r}`)}var To=(r,e)=>r===void 0||e[xo[r]]();di.exports=async(r,e)=>{e={cwd:process.cwd(),type:"file",allowSymlinks:!0,...e},Oo(e);let t=e.allowSymlinks?Vl:Yl;return Jl(r,async s=>{try{let i=await t(Ro.resolve(e.cwd,s));return To(e.type,i)}catch{return!1}},e)};di.exports.sync=(r,e)=>{e={cwd:process.cwd(),allowSymlinks:!0,type:"file",...e},Oo(e);let t=e.allowSymlinks?Ur.statSync:Ur.lstatSync;for(let s of r)try{let i=t(Ro.resolve(e.cwd,s));if(To(e.type,i))return s}catch{}}});var No=y((yd,Di)=>{"use strict";u();var Lo=require("fs"),{promisify:Kl}=require("util"),Zl=Kl(Lo.access);Di.exports=async r=>{try{return await Zl(r),!0}catch{return!1}};Di.exports.sync=r=>{try{return Lo.accessSync(r),!0}catch{return!1}}});var Io=y((Ad,Mt)=>{"use strict";u();var Ve=require("path"),$r=Po(),Mo=No(),gi=Symbol("findUp.stop");Mt.exports=async(r,e={})=>{let t=Ve.resolve(e.cwd||""),{root:s}=Ve.parse(t),i=[].concat(r),n=async o=>{if(typeof r!="function")return $r(i,o);let a=await r(o.cwd);return typeof a=="string"?$r([a],o):a};for(;;){let o=await n({...e,cwd:t});if(o===gi)return;if(o)return Ve.resolve(t,o);if(t===s)return;t=Ve.dirname(t)}};Mt.exports.sync=(r,e={})=>{let t=Ve.resolve(e.cwd||""),{root:s}=Ve.parse(t),i=[].concat(r),n=o=>{if(typeof r!="function")return $r.sync(i,o);let a=r(o.cwd);return typeof a=="string"?$r.sync([a],o):a};for(;;){let o=n({...e,cwd:t});if(o===gi)return;if(o)return Ve.resolve(t,o);if(t===s)return;t=Ve.dirname(t)}};Mt.exports.exists=Mo;Mt.exports.sync.exists=Mo.sync;Mt.exports.stop=gi});var jt=y((zd,Qo)=>{"use strict";u();var Xo=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"]]);Qo.exports=r=>r?Object.keys(r).map(e=>[Xo.has(e)?Xo.get(e):e,r[e]]).reduce((e,t)=>(e[t[0]]=t[1],e),Object.create(null)):{}});var Yr=y((Gd,au)=>{"use strict";u();var eu=typeof process=="object"&&process?process:{stdout:null,stderr:null},wh=require("events"),tu=require("stream"),ru=require("string_decoder").StringDecoder,Oe=Symbol("EOF"),Te=Symbol("maybeEmitEnd"),Ke=Symbol("emittedEnd"),zr=Symbol("emittingEnd"),dr=Symbol("emittedError"),Gr=Symbol("closed"),su=Symbol("read"),Hr=Symbol("flush"),iu=Symbol("flushChunk"),K=Symbol("encoding"),Pe=Symbol("decoder"),Jr=Symbol("flowing"),Dr=Symbol("paused"),qt=Symbol("resume"),L=Symbol("buffer"),ye=Symbol("pipes"),I=Symbol("bufferLength"),Ai=Symbol("bufferPush"),Ci=Symbol("bufferShift"),U=Symbol("objectMode"),$=Symbol("destroyed"),wi=Symbol("emitData"),nu=Symbol("emitEnd"),Fi=Symbol("emitEnd2"),Le=Symbol("async"),gr=r=>Promise.resolve().then(r),ou=global._MP_NO_ITERATOR_SYMBOLS_!=="1",Fh=ou&&Symbol.asyncIterator||Symbol("asyncIterator not implemented"),bh=ou&&Symbol.iterator||Symbol("iterator not implemented"),Sh=r=>r==="end"||r==="finish"||r==="prefinish",kh=r=>r instanceof ArrayBuffer||typeof r=="object"&&r.constructor&&r.constructor.name==="ArrayBuffer"&&r.byteLength>=0,_h=r=>!Buffer.isBuffer(r)&&ArrayBuffer.isView(r),Vr=class{constructor(e,t,s){this.src=e,this.dest=t,this.opts=s,this.ondrain=()=>e[qt](),t.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},bi=class extends Vr{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)}};au.exports=class uu extends tu{constructor(e){super(),this[Jr]=!1,this[Dr]=!1,this[ye]=[],this[L]=[],this[U]=e&&e.objectMode||!1,this[U]?this[K]=null:this[K]=e&&e.encoding||null,this[K]==="buffer"&&(this[K]=null),this[Le]=e&&!!e.async||!1,this[Pe]=this[K]?new ru(this[K]):null,this[Oe]=!1,this[Ke]=!1,this[zr]=!1,this[Gr]=!1,this[dr]=null,this.writable=!0,this.readable=!0,this[I]=0,this[$]=!1,e&&e.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[L]}),e&&e.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[ye]})}get bufferLength(){return this[I]}get encoding(){return this[K]}set encoding(e){if(this[U])throw new Error("cannot set encoding in objectMode");if(this[K]&&e!==this[K]&&(this[Pe]&&this[Pe].lastNeed||this[I]))throw new Error("cannot change encoding");this[K]!==e&&(this[Pe]=e?new ru(e):null,this[L].length&&(this[L]=this[L].map(t=>this[Pe].write(t)))),this[K]=e}setEncoding(e){this.encoding=e}get objectMode(){return this[U]}set objectMode(e){this[U]=this[U]||!!e}get async(){return this[Le]}set async(e){this[Le]=this[Le]||!!e}write(e,t,s){if(this[Oe])throw new Error("write after end");if(this[$])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[Le]?gr:n=>n();return!this[U]&&!Buffer.isBuffer(e)&&(_h(e)?e=Buffer.from(e.buffer,e.byteOffset,e.byteLength):kh(e)?e=Buffer.from(e):typeof e!="string"&&(this.objectMode=!0)),this[U]?(this.flowing&&this[I]!==0&&this[Hr](!0),this.flowing?this.emit("data",e):this[Ai](e),this[I]!==0&&this.emit("readable"),s&&i(s),this.flowing):e.length?(typeof e=="string"&&!(t===this[K]&&!this[Pe].lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[K]&&(e=this[Pe].write(e)),this.flowing&&this[I]!==0&&this[Hr](!0),this.flowing?this.emit("data",e):this[Ai](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[$])return null;if(this[I]===0||e===0||e>this[I])return this[Te](),null;this[U]&&(e=null),this[L].length>1&&!this[U]&&(this.encoding?this[L]=[this[L].join("")]:this[L]=[Buffer.concat(this[L],this[I])]);let t=this[su](e||null,this[L][0]);return this[Te](),t}[su](e,t){return e===t.length||e===null?this[Ci]():(this[L][0]=t.slice(e),t=t.slice(0,e),this[I]-=e),this.emit("data",t),!this[L].length&&!this[Oe]&&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[Oe]=!0,this.writable=!1,(this.flowing||!this[Dr])&&this[Te](),this}[qt](){this[$]||(this[Dr]=!1,this[Jr]=!0,this.emit("resume"),this[L].length?this[Hr]():this[Oe]?this[Te]():this.emit("drain"))}resume(){return this[qt]()}pause(){this[Jr]=!1,this[Dr]=!0}get destroyed(){return this[$]}get flowing(){return this[Jr]}get paused(){return this[Dr]}[Ai](e){this[U]?this[I]+=1:this[I]+=e.length,this[L].push(e)}[Ci](){return this[L].length&&(this[U]?this[I]-=1:this[I]-=this[L][0].length),this[L].shift()}[Hr](e){do;while(this[iu](this[Ci]()));!e&&!this[L].length&&!this[Oe]&&this.emit("drain")}[iu](e){return e?(this.emit("data",e),this.flowing):!1}pipe(e,t){if(this[$])return;let s=this[Ke];return t=t||{},e===eu.stdout||e===eu.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,s?t.end&&e.end():(this[ye].push(t.proxyErrors?new bi(this,e,t):new Vr(this,e,t)),this[Le]?gr(()=>this[qt]()):this[qt]()),e}unpipe(e){let t=this[ye].find(s=>s.dest===e);t&&(this[ye].splice(this[ye].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[ye].length&&!this.flowing?this[qt]():e==="readable"&&this[I]!==0?super.emit("readable"):Sh(e)&&this[Ke]?(super.emit(e),this.removeAllListeners(e)):e==="error"&&this[dr]&&(this[Le]?gr(()=>t.call(this,this[dr])):t.call(this,this[dr])),s}get emittedEnd(){return this[Ke]}[Te](){!this[zr]&&!this[Ke]&&!this[$]&&this[L].length===0&&this[Oe]&&(this[zr]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Gr]&&this.emit("close"),this[zr]=!1)}emit(e,t,...s){if(e!=="error"&&e!=="close"&&e!==$&&this[$])return;if(e==="data")return t?this[Le]?gr(()=>this[wi](t)):this[wi](t):!1;if(e==="end")return this[nu]();if(e==="close"){if(this[Gr]=!0,!this[Ke]&&!this[$])return;let n=super.emit("close");return this.removeAllListeners("close"),n}else if(e==="error"){this[dr]=t;let n=super.emit("error",t);return this[Te](),n}else if(e==="resume"){let n=super.emit("resume");return this[Te](),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[Te](),i}[wi](e){for(let s of this[ye])s.dest.write(e)===!1&&this.pause();let t=super.emit("data",e);return this[Te](),t}[nu](){this[Ke]||(this[Ke]=!0,this.readable=!1,this[Le]?gr(()=>this[Fi]()):this[Fi]())}[Fi](){if(this[Pe]){let t=this[Pe].end();if(t){for(let s of this[ye])s.dest.write(t);super.emit("data",t)}}for(let t of this[ye])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[K]?e.join(""):Buffer.concat(e,e.dataLength))}promise(){return new Promise((e,t)=>{this.on($,()=>t(new Error("stream destroyed"))),this.on("error",s=>t(s)),this.on("end",()=>e())})}[Fh](){return{next:()=>{let t=this.read();if(t!==null)return Promise.resolve({done:!1,value:t});if(this[Oe])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[Oe]})},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($,l),this.once("error",n),this.once("end",a),this.once("data",o)})}}}[bh](){return{next:()=>{let t=this.read();return{value:t,done:t===null}}}}destroy(e){return this[$]?(e?this.emit("error",e):this.emit($),this):(this[$]=!0,this[L].length=0,this[I]=0,typeof this.close=="function"&&!this[Gr]&&this.close(),e?this.emit("error",e):this.emit($),this)}static isStream(e){return!!e&&(e instanceof uu||e instanceof tu||e instanceof wh&&(typeof e.pipe=="function"||typeof e.write=="function"&&typeof e.end=="function"))}}});var lu=y((Hd,cu)=>{u();var vh=require("zlib").constants||{ZLIB_VERNUM:4736};cu.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},vh))});var Bi=y((Jd,yu)=>{"use strict";u();var hu=typeof process=="object"&&process?process:{stdout:null,stderr:null},Rh=require("events"),fu=require("stream"),pu=require("string_decoder").StringDecoder,Ne=Symbol("EOF"),Me=Symbol("maybeEmitEnd"),Ze=Symbol("emittedEnd"),Kr=Symbol("emittingEnd"),Er=Symbol("emittedError"),Zr=Symbol("closed"),mu=Symbol("read"),Xr=Symbol("flush"),du=Symbol("flushChunk"),Z=Symbol("encoding"),Ie=Symbol("decoder"),Qr=Symbol("flowing"),yr=Symbol("paused"),Ut=Symbol("resume"),j=Symbol("bufferLength"),Si=Symbol("bufferPush"),ki=Symbol("bufferShift"),W=Symbol("objectMode"),z=Symbol("destroyed"),_i=Symbol("emitData"),Du=Symbol("emitEnd"),vi=Symbol("emitEnd2"),je=Symbol("async"),Ar=r=>Promise.resolve().then(r),gu=global._MP_NO_ITERATOR_SYMBOLS_!=="1",Bh=gu&&Symbol.asyncIterator||Symbol("asyncIterator not implemented"),xh=gu&&Symbol.iterator||Symbol("iterator not implemented"),Oh=r=>r==="end"||r==="finish"||r==="prefinish",Th=r=>r instanceof ArrayBuffer||typeof r=="object"&&r.constructor&&r.constructor.name==="ArrayBuffer"&&r.byteLength>=0,Ph=r=>!Buffer.isBuffer(r)&&ArrayBuffer.isView(r),es=class{constructor(e,t,s){this.src=e,this.dest=t,this.opts=s,this.ondrain=()=>e[Ut](),t.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},Ri=class extends es{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)}};yu.exports=class Eu extends fu{constructor(e){super(),this[Qr]=!1,this[yr]=!1,this.pipes=[],this.buffer=[],this[W]=e&&e.objectMode||!1,this[W]?this[Z]=null:this[Z]=e&&e.encoding||null,this[Z]==="buffer"&&(this[Z]=null),this[je]=e&&!!e.async||!1,this[Ie]=this[Z]?new pu(this[Z]):null,this[Ne]=!1,this[Ze]=!1,this[Kr]=!1,this[Zr]=!1,this[Er]=null,this.writable=!0,this.readable=!0,this[j]=0,this[z]=!1}get bufferLength(){return this[j]}get encoding(){return this[Z]}set encoding(e){if(this[W])throw new Error("cannot set encoding in objectMode");if(this[Z]&&e!==this[Z]&&(this[Ie]&&this[Ie].lastNeed||this[j]))throw new Error("cannot change encoding");this[Z]!==e&&(this[Ie]=e?new pu(e):null,this.buffer.length&&(this.buffer=this.buffer.map(t=>this[Ie].write(t)))),this[Z]=e}setEncoding(e){this.encoding=e}get objectMode(){return this[W]}set objectMode(e){this[W]=this[W]||!!e}get async(){return this[je]}set async(e){this[je]=this[je]||!!e}write(e,t,s){if(this[Ne])throw new Error("write after end");if(this[z])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[je]?Ar:n=>n();return!this[W]&&!Buffer.isBuffer(e)&&(Ph(e)?e=Buffer.from(e.buffer,e.byteOffset,e.byteLength):Th(e)?e=Buffer.from(e):typeof e!="string"&&(this.objectMode=!0)),this[W]?(this.flowing&&this[j]!==0&&this[Xr](!0),this.flowing?this.emit("data",e):this[Si](e),this[j]!==0&&this.emit("readable"),s&&i(s),this.flowing):e.length?(typeof e=="string"&&!(t===this[Z]&&!this[Ie].lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[Z]&&(e=this[Ie].write(e)),this.flowing&&this[j]!==0&&this[Xr](!0),this.flowing?this.emit("data",e):this[Si](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[z])return null;if(this[j]===0||e===0||e>this[j])return this[Me](),null;this[W]&&(e=null),this.buffer.length>1&&!this[W]&&(this.encoding?this.buffer=[this.buffer.join("")]:this.buffer=[Buffer.concat(this.buffer,this[j])]);let t=this[mu](e||null,this.buffer[0]);return this[Me](),t}[mu](e,t){return e===t.length||e===null?this[ki]():(this.buffer[0]=t.slice(e),t=t.slice(0,e),this[j]-=e),this.emit("data",t),!this.buffer.length&&!this[Ne]&&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[Ne]=!0,this.writable=!1,(this.flowing||!this[yr])&&this[Me](),this}[Ut](){this[z]||(this[yr]=!1,this[Qr]=!0,this.emit("resume"),this.buffer.length?this[Xr]():this[Ne]?this[Me]():this.emit("drain"))}resume(){return this[Ut]()}pause(){this[Qr]=!1,this[yr]=!0}get destroyed(){return this[z]}get flowing(){return this[Qr]}get paused(){return this[yr]}[Si](e){this[W]?this[j]+=1:this[j]+=e.length,this.buffer.push(e)}[ki](){return this.buffer.length&&(this[W]?this[j]-=1:this[j]-=this.buffer[0].length),this.buffer.shift()}[Xr](e){do;while(this[du](this[ki]()));!e&&!this.buffer.length&&!this[Ne]&&this.emit("drain")}[du](e){return e?(this.emit("data",e),this.flowing):!1}pipe(e,t){if(this[z])return;let s=this[Ze];return t=t||{},e===hu.stdout||e===hu.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,s?t.end&&e.end():(this.pipes.push(t.proxyErrors?new Ri(this,e,t):new es(this,e,t)),this[je]?Ar(()=>this[Ut]()):this[Ut]()),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[Ut]():e==="readable"&&this[j]!==0?super.emit("readable"):Oh(e)&&this[Ze]?(super.emit(e),this.removeAllListeners(e)):e==="error"&&this[Er]&&(this[je]?Ar(()=>t.call(this,this[Er])):t.call(this,this[Er])),s}get emittedEnd(){return this[Ze]}[Me](){!this[Kr]&&!this[Ze]&&!this[z]&&this.buffer.length===0&&this[Ne]&&(this[Kr]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Zr]&&this.emit("close"),this[Kr]=!1)}emit(e,t,...s){if(e!=="error"&&e!=="close"&&e!==z&&this[z])return;if(e==="data")return t?this[je]?Ar(()=>this[_i](t)):this[_i](t):!1;if(e==="end")return this[Du]();if(e==="close"){if(this[Zr]=!0,!this[Ze]&&!this[z])return;let n=super.emit("close");return this.removeAllListeners("close"),n}else if(e==="error"){this[Er]=t;let n=super.emit("error",t);return this[Me](),n}else if(e==="resume"){let n=super.emit("resume");return this[Me](),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[Me](),i}[_i](e){for(let s of this.pipes)s.dest.write(e)===!1&&this.pause();let t=super.emit("data",e);return this[Me](),t}[Du](){this[Ze]||(this[Ze]=!0,this.readable=!1,this[je]?Ar(()=>this[vi]()):this[vi]())}[vi](){if(this[Ie]){let t=this[Ie].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[W]||(e.dataLength=0);let t=this.promise();return this.on("data",s=>{e.push(s),this[W]||(e.dataLength+=s.length)}),t.then(()=>e)}concat(){return this[W]?Promise.reject(new Error("cannot concat in objectMode")):this.collect().then(e=>this[W]?Promise.reject(new Error("cannot concat in objectMode")):this[Z]?e.join(""):Buffer.concat(e,e.dataLength))}promise(){return new Promise((e,t)=>{this.on(z,()=>t(new Error("stream destroyed"))),this.on("error",s=>t(s)),this.on("end",()=>e())})}[Bh](){return{next:()=>{let t=this.read();if(t!==null)return Promise.resolve({done:!1,value:t});if(this[Ne])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[Ne]})},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(z,l),this.once("error",n),this.once("end",a),this.once("data",o)})}}}[xh](){return{next:()=>{let t=this.read();return{value:t,done:t===null}}}}destroy(e){return this[z]?(e?this.emit("error",e):this.emit(z),this):(this[z]=!0,this.buffer.length=0,this[j]=0,typeof this.close=="function"&&!this[Zr]&&this.close(),e?this.emit("error",e):this.emit(z),this)}static isStream(e){return!!e&&(e instanceof Eu||e instanceof fu||e instanceof Rh&&(typeof e.pipe=="function"||typeof e.write=="function"&&typeof e.end=="function"))}}});var Hi=y(ee=>{"use strict";u();var Li=require("assert"),Xe=require("buffer").Buffer,wu=require("zlib"),yt=ee.constants=lu(),Lh=Bi(),Au=Xe.concat,At=Symbol("_superWrite"),Wt=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"}},Nh=Symbol("opts"),Cr=Symbol("flushFlag"),Cu=Symbol("finishFlushFlag"),Gi=Symbol("fullFlushFlag"),B=Symbol("handle"),ts=Symbol("onError"),$t=Symbol("sawError"),xi=Symbol("level"),Oi=Symbol("strategy"),Ti=Symbol("ended"),Vd=Symbol("_defaultFullFlush"),rs=class extends Lh{constructor(e,t){if(!e||typeof e!="object")throw new TypeError("invalid options for ZlibBase constructor");super(e),this[$t]=!1,this[Ti]=!1,this[Nh]=e,this[Cr]=e.flush,this[Cu]=e.finishFlush;try{this[B]=new wu[t](e)}catch(s){throw new Wt(s)}this[ts]=s=>{this[$t]||(this[$t]=!0,this.close(),this.emit("error",s))},this[B].on("error",s=>this[ts](new Wt(s))),this.once("end",()=>this.close)}close(){this[B]&&(this[B].close(),this[B]=null,this.emit("close"))}reset(){if(!this[$t])return Li(this[B],"zlib binding closed"),this[B].reset()}flush(e){this.ended||(typeof e!="number"&&(e=this[Gi]),this.write(Object.assign(Xe.alloc(0),{[Cr]:e})))}end(e,t,s){return e&&this.write(e,t),this.flush(this[Cu]),this[Ti]=!0,super.end(null,null,s)}get ended(){return this[Ti]}write(e,t,s){if(typeof t=="function"&&(s=t,t="utf8"),typeof e=="string"&&(e=Xe.from(e,t)),this[$t])return;Li(this[B],"zlib binding closed");let i=this[B]._handle,n=i.close;i.close=()=>{};let o=this[B].close;this[B].close=()=>{},Xe.concat=c=>c;let a;try{let c=typeof e[Cr]=="number"?e[Cr]:this[Cr];a=this[B]._processChunk(e,c),Xe.concat=Au}catch(c){Xe.concat=Au,this[ts](new Wt(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[ts](new Wt(c)));let l;if(a)if(Array.isArray(a)&&a.length>0){l=this[At](Xe.from(a[0]));for(let c=1;c<a.length;c++)l=this[At](a[c])}else l=this[At](Xe.from(a));return s&&s(),l}[At](e){return super.write(e)}},qe=class extends rs{constructor(e,t){e=e||{},e.flush=e.flush||yt.Z_NO_FLUSH,e.finishFlush=e.finishFlush||yt.Z_FINISH,super(e,t),this[Gi]=yt.Z_FULL_FLUSH,this[xi]=e.level,this[Oi]=e.strategy}params(e,t){if(!this[$t]){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[xi]!==e||this[Oi]!==t){this.flush(yt.Z_SYNC_FLUSH),Li(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[xi]=e,this[Oi]=t)}}}},Ni=class extends qe{constructor(e){super(e,"Deflate")}},Mi=class extends qe{constructor(e){super(e,"Inflate")}},Pi=Symbol("_portable"),Ii=class extends qe{constructor(e){super(e,"Gzip"),this[Pi]=e&&!!e.portable}[At](e){return this[Pi]?(this[Pi]=!1,e[9]=255,super[At](e)):super[At](e)}},ji=class extends qe{constructor(e){super(e,"Gunzip")}},qi=class extends qe{constructor(e){super(e,"DeflateRaw")}},Ui=class extends qe{constructor(e){super(e,"InflateRaw")}},$i=class extends qe{constructor(e){super(e,"Unzip")}},ss=class extends rs{constructor(e,t){e=e||{},e.flush=e.flush||yt.BROTLI_OPERATION_PROCESS,e.finishFlush=e.finishFlush||yt.BROTLI_OPERATION_FINISH,super(e,t),this[Gi]=yt.BROTLI_OPERATION_FLUSH}},Wi=class extends ss{constructor(e){super(e,"BrotliCompress")}},zi=class extends ss{constructor(e){super(e,"BrotliDecompress")}};ee.Deflate=Ni;ee.Inflate=Mi;ee.Gzip=Ii;ee.Gunzip=ji;ee.DeflateRaw=qi;ee.InflateRaw=Ui;ee.Unzip=$i;typeof wu.BrotliCompress=="function"?(ee.BrotliCompress=Wi,ee.BrotliDecompress=zi):ee.BrotliCompress=ee.BrotliDecompress=class{constructor(){throw new Error("Brotli is not supported in this version of Node.js")}}});var zt=y((Zd,Fu)=>{u();var Mh=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform;Fu.exports=Mh!=="win32"?r=>r:r=>r&&r.replace(/\\/g,"/")});var is=y((Qd,bu)=>{"use strict";u();var Ih=Yr(),Ji=zt(),Vi=Symbol("slurp");bu.exports=class extends Ih{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=Ji(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=Ji(e.linkpath),this.uname=e.uname,this.gname=e.gname,t&&this[Vi](t),s&&this[Vi](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))}[Vi](e,t){for(let s in e)e[s]!==null&&e[s]!==void 0&&!(t&&s==="path")&&(this[s]=s==="path"||s==="linkpath"?Ji(e[s]):e[s])}}});var Yi=y(ns=>{"use strict";u();ns.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"]]);ns.code=new Map(Array.from(ns.name).map(r=>[r[1],r[0]]))});var vu=y((t0,_u)=>{"use strict";u();var jh=(r,e)=>{if(Number.isSafeInteger(r))r<0?Uh(r,e):qh(r,e);else throw Error("cannot encode number outside of javascript safe integer range");return e},qh=(r,e)=>{e[0]=128;for(var t=e.length;t>1;t--)e[t-1]=r&255,r=Math.floor(r/256)},Uh=(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]=Su(i):i===0?e[s-1]=0:(t=!0,e[s-1]=ku(i))}},$h=r=>{let e=r[0],t=e===128?zh(r.slice(1,r.length)):e===255?Wh(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},Wh=r=>{for(var e=r.length,t=0,s=!1,i=e-1;i>-1;i--){var n=r[i],o;s?o=Su(n):n===0?o=n:(s=!0,o=ku(n)),o!==0&&(t-=o*Math.pow(256,e-i-1))}return t},zh=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},Su=r=>(255^r)&255,ku=r=>(255^r)+1&255;_u.exports={encode:jh,parse:$h}});var Ht=y((r0,Bu)=>{"use strict";u();var Ki=Yi(),Gt=require("path").posix,Ru=vu(),Zi=Symbol("slurp"),te=Symbol("type"),en=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[te]="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=Ct(e,t,100),this.mode=Qe(e,t+100,8),this.uid=Qe(e,t+108,8),this.gid=Qe(e,t+116,8),this.size=Qe(e,t+124,12),this.mtime=Xi(e,t+136,12),this.cksum=Qe(e,t+148,12),this[Zi](s),this[Zi](i,!0),this[te]=Ct(e,t+156,1),this[te]===""&&(this[te]="0"),this[te]==="0"&&this.path.slice(-1)==="/"&&(this[te]="5"),this[te]==="5"&&(this.size=0),this.linkpath=Ct(e,t+157,100),e.slice(t+257,t+265).toString()==="ustar\x0000")if(this.uname=Ct(e,t+265,32),this.gname=Ct(e,t+297,32),this.devmaj=Qe(e,t+329,8),this.devmin=Qe(e,t+337,8),e[t+475]!==0){let o=Ct(e,t+345,155);this.path=o+"/"+this.path}else{let o=Ct(e,t+345,130);o&&(this.path=o+"/"+this.path),this.atime=Xi(e,t+476,12),this.ctime=Xi(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)}[Zi](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=Gh(this.path||"",s),n=i[0],o=i[1];this.needPax=i[2],this.needPax=wt(e,t,100,n)||this.needPax,this.needPax=et(e,t+100,8,this.mode)||this.needPax,this.needPax=et(e,t+108,8,this.uid)||this.needPax,this.needPax=et(e,t+116,8,this.gid)||this.needPax,this.needPax=et(e,t+124,12,this.size)||this.needPax,this.needPax=Qi(e,t+136,12,this.mtime)||this.needPax,e[t+156]=this[te].charCodeAt(0),this.needPax=wt(e,t+157,100,this.linkpath)||this.needPax,e.write("ustar\x0000",t+257,8),this.needPax=wt(e,t+265,32,this.uname)||this.needPax,this.needPax=wt(e,t+297,32,this.gname)||this.needPax,this.needPax=et(e,t+329,8,this.devmaj)||this.needPax,this.needPax=et(e,t+337,8,this.devmin)||this.needPax,this.needPax=wt(e,t+345,s,o)||this.needPax,e[t+475]!==0?this.needPax=wt(e,t+345,155,o)||this.needPax:(this.needPax=wt(e,t+345,130,o)||this.needPax,this.needPax=Qi(e,t+476,12,this.atime)||this.needPax,this.needPax=Qi(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,et(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 Ki.name.get(this[te])||this[te]}get typeKey(){return this[te]}set type(e){Ki.code.has(e)?this[te]=Ki.code.get(e):this[te]=e}},Gh=(r,e)=>{let s=r,i="",n,o=Gt.parse(r).root||".";if(Buffer.byteLength(s)<100)n=[s,i,!1];else{i=Gt.dirname(s),s=Gt.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=Gt.join(Gt.basename(i),s),i=Gt.dirname(i));while(i!==o&&!n);n||(n=[r.slice(0,100-1),"",!0])}return n},Ct=(r,e,t)=>r.slice(e,e+t).toString("utf8").replace(/\0.*/,""),Xi=(r,e,t)=>Hh(Qe(r,e,t)),Hh=r=>r===null?null:new Date(r*1e3),Qe=(r,e,t)=>r[e]&128?Ru.parse(r.slice(e,e+t)):Vh(r,e,t),Jh=r=>isNaN(r)?null:r,Vh=(r,e,t)=>Jh(parseInt(r.slice(e,e+t).toString("utf8").replace(/\0.*$/,"").trim(),8)),Yh={12:8589934591,8:2097151},et=(r,e,t,s)=>s===null?!1:s>Yh[t]||s<0?(Ru.encode(s,r.slice(e,e+t)),!0):(Kh(r,e,t,s),!1),Kh=(r,e,t,s)=>r.write(Zh(s,t),e,t,"ascii"),Zh=(r,e)=>Xh(Math.floor(r).toString(8),e),Xh=(r,e)=>(r.length===e-1?r:new Array(e-r.length-1).join("0")+r+" ")+"\0",Qi=(r,e,t,s)=>s===null?!1:et(r,e,t,s.getTime()/1e3),Qh=new Array(156).join("\0"),wt=(r,e,t,s)=>s===null?!1:(r.write(s+Qh,e,t,"utf8"),s.length!==Buffer.byteLength(s)||s.length>t);Bu.exports=en});var os=y((s0,xu)=>{"use strict";u();var ef=Ht(),tf=require("path"),wr=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 ef({path:("PaxHeader/"+tf.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+`
3
3
  `,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}};wr.parse=(r,e,t)=>new wr(rf(sf(r),e),t);var rf=(r,e)=>e?Object.keys(r).reduce((t,s)=>(t[s]=r[s],t),e):r,sf=r=>r.replace(/\n$/,"").split(`
4
- `).reduce(nf,Object.create(null)),nf=(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};xu.exports=wr});var Jt=y((i0,Ou)=>{u();Ou.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 us=y((n0,Tu)=>{"use strict";u();Tu.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 rn=y((u0,Pu)=>{"use strict";u();var as=["|","<",">","?",":"],tn=as.map(r=>String.fromCharCode(61440+r.charCodeAt(0))),of=new Map(as.map((r,e)=>[r,tn[e]])),uf=new Map(tn.map((r,e)=>[r,as[e]]));Pu.exports={encode:r=>as.reduce((e,t)=>e.split(t).join(of.get(t)),r),decode:r=>tn.reduce((e,t)=>e.split(t).join(uf.get(t)),r)}});var sn=y((a0,Nu)=>{u();var{isAbsolute:af,parse:Lu}=require("path").win32;Nu.exports=r=>{let e="",t=Lu(r);for(;af(r)||t.root;){let s=r.charAt(0)==="/"&&r.slice(0,4)!=="//?/"?"/":t.root;r=r.slice(s.length),e+=s,t=Lu(r)}return[e,r]}});var Iu=y((c0,Mu)=>{"use strict";u();Mu.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 mn=y((f0,Xu)=>{"use strict";u();var Gu=Yr(),Hu=os(),Ju=Ht(),Ce=require("fs"),ju=require("path"),Ae=zt(),cf=Jt(),Vu=(r,e)=>e?(r=Ae(r).replace(/^\.(\/|$)/,""),cf(e)+"/"+r):Ae(r),lf=16*1024*1024,qu=Symbol("process"),Uu=Symbol("file"),$u=Symbol("directory"),on=Symbol("symlink"),Wu=Symbol("hardlink"),Fr=Symbol("header"),cs=Symbol("read"),un=Symbol("lstat"),ls=Symbol("onlstat"),an=Symbol("onread"),cn=Symbol("onreadlink"),ln=Symbol("openfile"),hn=Symbol("onopenfile"),tt=Symbol("close"),hs=Symbol("mode"),fn=Symbol("awaitDrain"),nn=Symbol("ondrain"),we=Symbol("prefix"),zu=Symbol("hadError"),Yu=us(),hf=rn(),Ku=sn(),Zu=Iu(),fs=Yu(class extends Gu{constructor(e,t){if(t=t||{},super(t),typeof e!="string")throw new TypeError("path is required");this.path=Ae(e),this.portable=!!t.portable,this.myuid=process.getuid&&process.getuid()||0,this.myuser=process.env.USER||"",this.maxReadSize=t.maxReadSize||lf,this.linkCache=t.linkCache||new Map,this.statCache=t.statCache||new Map,this.preservePaths=!!t.preservePaths,this.cwd=Ae(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?Ae(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]=Ku(this.path);i&&(this.path=n,s=i)}this.win32=!!t.win32||process.platform==="win32",this.win32&&(this.path=hf.decode(this.path.replace(/\\/g,"/")),e=e.replace(/\\/g,"/")),this.absolute=Ae(t.absolute||ju.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[ls](this.statCache.get(this.absolute)):this[un]()}emit(e,...t){return e==="error"&&(this[zu]=!0),super.emit(e,...t)}[un](){Ce.lstat(this.absolute,(e,t)=>{if(e)return this.emit("error",e);this[ls](t)})}[ls](e){this.statCache.set(this.absolute,e),this.stat=e,e.isFile()||(e.size=0),this.type=pf(e),this.emit("stat",e),this[qu]()}[qu](){switch(this.type){case"File":return this[Uu]();case"Directory":return this[$u]();case"SymbolicLink":return this[on]();default:return this.end()}}[hs](e){return Zu(e,this.type==="Directory",this.portable)}[we](e){return Vu(e,this.prefix)}[Fr](){this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.header=new Ju({path:this[we](this.path),linkpath:this.type==="Link"?this[we](this.linkpath):this.linkpath,mode:this[hs](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 Hu({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[we](this.path),linkpath:this.type==="Link"?this[we](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)}[$u](){this.path.slice(-1)!=="/"&&(this.path+="/"),this.stat.size=0,this[Fr](),this.end()}[on](){Ce.readlink(this.absolute,(e,t)=>{if(e)return this.emit("error",e);this[cn](t)})}[cn](e){this.linkpath=Ae(e),this[Fr](),this.end()}[Wu](e){this.type="Link",this.linkpath=Ae(ju.relative(this.cwd,e)),this.stat.size=0,this[Fr](),this.end()}[Uu](){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[Wu](t)}this.linkCache.set(e,this.absolute)}if(this[Fr](),this.stat.size===0)return this.end();this[ln]()}[ln](){Ce.open(this.absolute,"r",(e,t)=>{if(e)return this.emit("error",e);this[hn](t)})}[hn](e){if(this.fd=e,this[zu])return this[tt]();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[cs]()}[cs](){let{fd:e,buf:t,offset:s,length:i,pos:n}=this;Ce.read(e,t,s,i,n,(o,a)=>{if(o)return this[tt](()=>this.emit("error",o));this[an](a)})}[tt](e){Ce.close(this.fd,e)}[an](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[tt](()=>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[tt](()=>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[nn]():this[fn](()=>this[nn]())}[fn](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)}[nn](){if(!this.remain)return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),this[tt](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[cs]()}}),pn=class extends fs{[un](){this[ls](Ce.lstatSync(this.absolute))}[on](){this[cn](Ce.readlinkSync(this.absolute))}[ln](){this[hn](Ce.openSync(this.absolute,"r"))}[cs](){let e=!0;try{let{fd:t,buf:s,offset:i,length:n,pos:o}=this,a=Ce.readSync(t,s,i,n,o);this[an](a),e=!1}finally{if(e)try{this[tt](()=>{})}catch{}}}[fn](e){e()}[tt](e){Ce.closeSync(this.fd),e()}},ff=Yu(class extends Gu{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=Ae(e.path),this.mode=this[hs](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=Ae(e.linkpath),typeof t.onwarn=="function"&&this.on("warn",t.onwarn);let s=!1;if(!this.preservePaths){let[i,n]=Ku(this.path);i&&(this.path=n,s=i)}this.remain=e.size,this.blockRemain=e.startBlockSize,this.header=new Ju({path:this[we](this.path),linkpath:this.type==="Link"?this[we](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 Hu({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[we](this.path),linkpath:this.type==="Link"?this[we](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)}[we](e){return Vu(e,this.prefix)}[hs](e){return Zu(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()}});fs.Sync=pn;fs.Tar=ff;var pf=r=>r.isFile()?"File":r.isDirectory()?"Directory":r.isSymbolicLink()?"SymbolicLink":"Unsupported";Xu.exports=fs});var ea=y((p0,Qu)=>{"use strict";u();Qu.exports=function(r){r.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}});var dn=y((m0,ta)=>{"use strict";u();ta.exports=k;k.Node=Ft;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++)df(this,arguments[r]);return this.length};k.prototype.unshift=function(){for(var r=0,e=arguments.length;r<e;r++)Df(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=mf(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 mf(r,e,t){var s=e===r.head?new Ft(t,null,e,r):new Ft(t,e,e.next,r);return s.next===null&&(r.tail=s),s.prev===null&&(r.head=s),r.length++,s}function df(r,e){r.tail=new Ft(e,r.tail,null,r),r.head||(r.head=r.tail),r.length++}function Df(r,e){r.head=new Ft(e,null,r.head,r),r.tail||(r.tail=r.head),r.length++}function Ft(r,e,t,s){if(!(this instanceof Ft))return new Ft(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{ea()(k)}catch{}});var Cs=y((D0,aa)=>{"use strict";u();var ys=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}},gf=Yr(),Ef=Hi(),yf=is(),bn=mn(),Af=bn.Sync,Cf=bn.Tar,wf=dn(),ra=Buffer.alloc(1024),ds=Symbol("onStat"),ps=Symbol("ended"),Fe=Symbol("queue"),Vt=Symbol("current"),bt=Symbol("process"),ms=Symbol("processing"),sa=Symbol("processJob"),be=Symbol("jobs"),Dn=Symbol("jobDone"),Ds=Symbol("addFSEntry"),ia=Symbol("addTarEntry"),An=Symbol("stat"),Cn=Symbol("readdir"),gs=Symbol("onreaddir"),Es=Symbol("pipe"),na=Symbol("entry"),gn=Symbol("entryOpt"),wn=Symbol("writeEntryClass"),ua=Symbol("write"),En=Symbol("ondrain"),As=require("fs"),oa=require("path"),Ff=us(),yn=zt(),Sn=Ff(class extends gf{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=yn(e.prefix||""),this.linkCache=e.linkCache||new Map,this.statCache=e.statCache||new Map,this.readdirCache=e.readdirCache||new Map,this[wn]=bn,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 Ef.Gzip(e.gzip),this.zip.on("data",t=>super.write(t)),this.zip.on("end",t=>super.end()),this.zip.on("drain",t=>this[En]()),this.on("resume",t=>this.zip.resume())):this.on("drain",this[En]),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[Fe]=new wf,this[be]=0,this.jobs=+e.jobs||4,this[ms]=!1,this[ps]=!1}[ua](e){return super.write(e)}add(e){return this.write(e),this}end(e){return e&&this.write(e),this[ps]=!0,this[bt](),this}write(e){if(this[ps])throw new Error("write after end");return e instanceof yf?this[ia](e):this[Ds](e),this.flowing}[ia](e){let t=yn(oa.resolve(this.cwd,e.path));if(!this.filter(e.path,e))e.resume();else{let s=new ys(e.path,t,!1);s.entry=new Cf(e,this[gn](s)),s.entry.on("end",i=>this[Dn](s)),this[be]+=1,this[Fe].push(s)}this[bt]()}[Ds](e){let t=yn(oa.resolve(this.cwd,e));this[Fe].push(new ys(e,t)),this[bt]()}[An](e){e.pending=!0,this[be]+=1;let t=this.follow?"stat":"lstat";As[t](e.absolute,(s,i)=>{e.pending=!1,this[be]-=1,s?this.emit("error",s):this[ds](e,i)})}[ds](e,t){this.statCache.set(e.absolute,t),e.stat=t,this.filter(e.path,t)||(e.ignore=!0),this[bt]()}[Cn](e){e.pending=!0,this[be]+=1,As.readdir(e.absolute,(t,s)=>{if(e.pending=!1,this[be]-=1,t)return this.emit("error",t);this[gs](e,s)})}[gs](e,t){this.readdirCache.set(e.absolute,t),e.readdir=t,this[bt]()}[bt](){if(!this[ms]){this[ms]=!0;for(let e=this[Fe].head;e!==null&&this[be]<this.jobs;e=e.next)if(this[sa](e.value),e.value.ignore){let t=e.next;this[Fe].removeNode(e),e.next=t}this[ms]=!1,this[ps]&&!this[Fe].length&&this[be]===0&&(this.zip?this.zip.end(ra):(super.write(ra),super.end()))}}get[Vt](){return this[Fe]&&this[Fe].head&&this[Fe].head.value}[Dn](e){this[Fe].shift(),this[be]-=1,this[bt]()}[sa](e){if(!e.pending){if(e.entry){e===this[Vt]&&!e.piped&&this[Es](e);return}if(e.stat||(this.statCache.has(e.absolute)?this[ds](e,this.statCache.get(e.absolute)):this[An](e)),!!e.stat&&!e.ignore&&!(!this.noDirRecurse&&e.stat.isDirectory()&&!e.readdir&&(this.readdirCache.has(e.absolute)?this[gs](e,this.readdirCache.get(e.absolute)):this[Cn](e),!e.readdir))){if(e.entry=this[na](e),!e.entry){e.ignore=!0;return}e===this[Vt]&&!e.piped&&this[Es](e)}}}[gn](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}}[na](e){this[be]+=1;try{return new this[wn](e.path,this[gn](e)).on("end",()=>this[Dn](e)).on("error",t=>this.emit("error",t))}catch(t){this.emit("error",t)}}[En](){this[Vt]&&this[Vt].entry&&this[Vt].entry.resume()}[Es](e){e.piped=!0,e.readdir&&e.readdir.forEach(i=>{let n=e.path,o=n==="./"?"":n.replace(/\/*$/,"/");this[Ds](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()}}),Fn=class extends Sn{constructor(e){super(e),this[wn]=Af}pause(){}resume(){}[An](e){let t=this.follow?"statSync":"lstatSync";this[ds](e,As[t](e.absolute))}[Cn](e,t){this[gs](e,As.readdirSync(e.absolute))}[Es](e){let t=e.entry,s=this.zip;e.readdir&&e.readdir.forEach(i=>{let n=e.path,o=n==="./"?"":n.replace(/\/*$/,"/");this[Ds](o+i)}),s?t.on("data",i=>{s.write(i)}):t.on("data",i=>{super[ua](i)})}};Sn.Sync=Fn;aa.exports=Sn});var rr=y(Sr=>{"use strict";u();var bf=Bi(),Sf=require("events").EventEmitter,X=require("fs"),vn=X.writev;if(!vn){let r=process.binding("fs"),e=r.FSReqWrap||r.FSReqCallback;vn=(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 er=Symbol("_autoClose"),de=Symbol("_close"),br=Symbol("_ended"),R=Symbol("_fd"),ca=Symbol("_finished"),st=Symbol("_flags"),kn=Symbol("_flush"),Rn=Symbol("_handleChunk"),Bn=Symbol("_makeBuf"),ks=Symbol("_mode"),ws=Symbol("_needDrain"),Xt=Symbol("_onerror"),tr=Symbol("_onopen"),_n=Symbol("_onread"),Kt=Symbol("_onwrite"),it=Symbol("_open"),Ue=Symbol("_path"),St=Symbol("_pos"),Se=Symbol("_queue"),Zt=Symbol("_read"),la=Symbol("_readSize"),rt=Symbol("_reading"),Fs=Symbol("_remain"),ha=Symbol("_size"),bs=Symbol("_write"),Yt=Symbol("_writing"),Ss=Symbol("_defaultFlag"),Qt=Symbol("_errored"),_s=class extends bf{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[Qt]=!1,this[R]=typeof t.fd=="number"?t.fd:null,this[Ue]=e,this[la]=t.readSize||16*1024*1024,this[rt]=!1,this[ha]=typeof t.size=="number"?t.size:1/0,this[Fs]=this[ha],this[er]=typeof t.autoClose=="boolean"?t.autoClose:!0,typeof this[R]=="number"?this[Zt]():this[it]()}get fd(){return this[R]}get path(){return this[Ue]}write(){throw new TypeError("this is a readable stream")}end(){throw new TypeError("this is a readable stream")}[it](){X.open(this[Ue],"r",(e,t)=>this[tr](e,t))}[tr](e,t){e?this[Xt](e):(this[R]=t,this.emit("open",t),this[Zt]())}[Bn](){return Buffer.allocUnsafe(Math.min(this[la],this[Fs]))}[Zt](){if(!this[rt]){this[rt]=!0;let e=this[Bn]();if(e.length===0)return process.nextTick(()=>this[_n](null,0,e));X.read(this[R],e,0,e.length,null,(t,s,i)=>this[_n](t,s,i))}}[_n](e,t,s){this[rt]=!1,e?this[Xt](e):this[Rn](t,s)&&this[Zt]()}[de](){if(this[er]&&typeof this[R]=="number"){let e=this[R];this[R]=null,X.close(e,t=>t?this.emit("error",t):this.emit("close"))}}[Xt](e){this[rt]=!0,this[de](),this.emit("error",e)}[Rn](e,t){let s=!1;return this[Fs]-=e,e>0&&(s=super.write(e<t.length?t.slice(0,e):t)),(e===0||this[Fs]<=0)&&(s=!1,this[de](),super.end()),s}emit(e,t){switch(e){case"prefinish":case"finish":break;case"drain":typeof this[R]=="number"&&this[Zt]();break;case"error":return this[Qt]?void 0:(this[Qt]=!0,super.emit(e,t));default:return super.emit(e,t)}}},xn=class extends _s{[it](){let e=!0;try{this[tr](null,X.openSync(this[Ue],"r")),e=!1}finally{e&&this[de]()}}[Zt](){let e=!0;try{if(!this[rt]){this[rt]=!0;do{let t=this[Bn](),s=t.length===0?0:X.readSync(this[R],t,0,t.length,null);if(!this[Rn](s,t))break}while(!0);this[rt]=!1}e=!1}finally{e&&this[de]()}}[de](){if(this[er]&&typeof this[R]=="number"){let e=this[R];this[R]=null,X.closeSync(e),this.emit("close")}}},vs=class extends Sf{constructor(e,t){t=t||{},super(t),this.readable=!1,this.writable=!0,this[Qt]=!1,this[Yt]=!1,this[br]=!1,this[ws]=!1,this[Se]=[],this[Ue]=e,this[R]=typeof t.fd=="number"?t.fd:null,this[ks]=t.mode===void 0?438:t.mode,this[St]=typeof t.start=="number"?t.start:null,this[er]=typeof t.autoClose=="boolean"?t.autoClose:!0;let s=this[St]!==null?"r+":"w";this[Ss]=t.flags===void 0,this[st]=this[Ss]?s:t.flags,this[R]===null&&this[it]()}emit(e,t){if(e==="error"){if(this[Qt])return;this[Qt]=!0}return super.emit(e,t)}get fd(){return this[R]}get path(){return this[Ue]}[Xt](e){this[de](),this[Yt]=!0,this.emit("error",e)}[it](){X.open(this[Ue],this[st],this[ks],(e,t)=>this[tr](e,t))}[tr](e,t){this[Ss]&&this[st]==="r+"&&e&&e.code==="ENOENT"?(this[st]="w",this[it]()):e?this[Xt](e):(this[R]=t,this.emit("open",t),this[kn]())}end(e,t){return e&&this.write(e,t),this[br]=!0,!this[Yt]&&!this[Se].length&&typeof this[R]=="number"&&this[Kt](null,0),this}write(e,t){return typeof e=="string"&&(e=Buffer.from(e,t)),this[br]?(this.emit("error",new Error("write() after end()")),!1):this[R]===null||this[Yt]||this[Se].length?(this[Se].push(e),this[ws]=!0,!1):(this[Yt]=!0,this[bs](e),!0)}[bs](e){X.write(this[R],e,0,e.length,this[St],(t,s)=>this[Kt](t,s))}[Kt](e,t){e?this[Xt](e):(this[St]!==null&&(this[St]+=t),this[Se].length?this[kn]():(this[Yt]=!1,this[br]&&!this[ca]?(this[ca]=!0,this[de](),this.emit("finish")):this[ws]&&(this[ws]=!1,this.emit("drain"))))}[kn](){if(this[Se].length===0)this[br]&&this[Kt](null,0);else if(this[Se].length===1)this[bs](this[Se].pop());else{let e=this[Se];this[Se]=[],vn(this[R],e,this[St],(t,s)=>this[Kt](t,s))}}[de](){if(this[er]&&typeof this[R]=="number"){let e=this[R];this[R]=null,X.close(e,t=>t?this.emit("error",t):this.emit("close"))}}},On=class extends vs{[it](){let e;if(this[Ss]&&this[st]==="r+")try{e=X.openSync(this[Ue],this[st],this[ks])}catch(t){if(t.code==="ENOENT")return this[st]="w",this[it]();throw t}else e=X.openSync(this[Ue],this[st],this[ks]);this[tr](null,e)}[de](){if(this[er]&&typeof this[R]=="number"){let e=this[R];this[R]=null,X.closeSync(e),this.emit("close")}}[bs](e){let t=!0;try{this[Kt](null,X.writeSync(this[R],e,0,e.length,this[St])),t=!1}finally{if(t)try{this[de]()}catch{}}}};Sr.ReadStream=_s;Sr.ReadStreamSync=xn;Sr.WriteStream=vs;Sr.WriteStreamSync=On});var Ls=y((y0,ya)=>{"use strict";u();var kf=us(),_f=Ht(),vf=require("events"),Rf=dn(),Bf=1024*1024,xf=is(),fa=os(),Of=Hi(),{nextTick:Tf}=require("process"),Tn=Buffer.from([31,139]),oe=Symbol("state"),kt=Symbol("writeEntry"),$e=Symbol("readEntry"),Pn=Symbol("nextEntry"),pa=Symbol("processEntry"),ue=Symbol("extendedHeader"),kr=Symbol("globalExtendedHeader"),nt=Symbol("meta"),ma=Symbol("emitMeta"),O=Symbol("buffer"),We=Symbol("queue"),_t=Symbol("ended"),da=Symbol("emittedEnd"),vt=Symbol("emit"),Q=Symbol("unzip"),Rs=Symbol("consumeChunk"),Bs=Symbol("consumeChunkSub"),Ln=Symbol("consumeBody"),Da=Symbol("consumeMeta"),ga=Symbol("consumeHeader"),xs=Symbol("consuming"),Nn=Symbol("bufferConcat"),Mn=Symbol("maybeEnd"),_r=Symbol("writing"),ot=Symbol("aborted"),Os=Symbol("onDone"),Rt=Symbol("sawValidEntry"),Ts=Symbol("sawNullBlock"),Ps=Symbol("sawEOF"),Ea=Symbol("closeStream"),Pf=r=>!0;ya.exports=kf(class extends vf{constructor(e){e=e||{},super(e),this.file=e.file||"",this[Rt]=null,this.on(Os,t=>{(this[oe]==="begin"||this[Rt]===!1)&&this.warn("TAR_BAD_ARCHIVE","Unrecognized archive format")}),e.ondone?this.on(Os,e.ondone):this.on(Os,t=>{this.emit("prefinish"),this.emit("finish"),this.emit("end")}),this.strict=!!e.strict,this.maxMetaEntrySize=e.maxMetaEntrySize||Bf,this.filter=typeof e.filter=="function"?e.filter:Pf,this.writable=!0,this.readable=!1,this[We]=new Rf,this[O]=null,this[$e]=null,this[kt]=null,this[oe]="begin",this[nt]="",this[ue]=null,this[kr]=null,this[_t]=!1,this[Q]=null,this[ot]=!1,this[Ts]=!1,this[Ps]=!1,this.on("end",()=>this[Ea]()),typeof e.onwarn=="function"&&this.on("warn",e.onwarn),typeof e.onentry=="function"&&this.on("entry",e.onentry)}[ga](e,t){this[Rt]===null&&(this[Rt]=!1);let s;try{s=new _f(e,t,this[ue],this[kr])}catch(i){return this.warn("TAR_ENTRY_INVALID",i)}if(s.nullBlock)this[Ts]?(this[Ps]=!0,this[oe]==="begin"&&(this[oe]="header"),this[vt]("eof")):(this[Ts]=!0,this[vt]("nullBlock"));else if(this[Ts]=!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[kt]=new xf(s,this[ue],this[kr]);if(!this[Rt])if(n.remain){let o=()=>{n.invalid||(this[Rt]=!0)};n.on("end",o)}else this[Rt]=!0;n.meta?n.size>this.maxMetaEntrySize?(n.ignore=!0,this[vt]("ignoredEntry",n),this[oe]="ignore",n.resume()):n.size>0&&(this[nt]="",n.on("data",o=>this[nt]+=o),this[oe]="meta"):(this[ue]=null,n.ignore=n.ignore||!this.filter(n.path,n),n.ignore?(this[vt]("ignoredEntry",n),this[oe]=n.remain?"ignore":"header",n.resume()):(n.remain?this[oe]="body":(this[oe]="header",n.end()),this[$e]?this[We].push(n):(this[We].push(n),this[Pn]())))}}}[Ea](){Tf(()=>this.emit("close"))}[pa](e){let t=!0;return e?Array.isArray(e)?this.emit.apply(this,e):(this[$e]=e,this.emit("entry",e),e.emittedEnd||(e.on("end",s=>this[Pn]()),t=!1)):(this[$e]=null,t=!1),t}[Pn](){do;while(this[pa](this[We].shift()));if(!this[We].length){let e=this[$e];!e||e.flowing||e.size===e.remain?this[_r]||this.emit("drain"):e.once("drain",s=>this.emit("drain"))}}[Ln](e,t){let s=this[kt],i=s.blockRemain,n=i>=e.length&&t===0?e:e.slice(t,t+i);return s.write(n),s.blockRemain||(this[oe]="header",this[kt]=null,s.end()),n.length}[Da](e,t){let s=this[kt],i=this[Ln](e,t);return this[kt]||this[ma](s),i}[vt](e,t,s){!this[We].length&&!this[$e]?this.emit(e,t,s):this[We].push([e,t,s])}[ma](e){switch(this[vt]("meta",this[nt]),e.type){case"ExtendedHeader":case"OldExtendedHeader":this[ue]=fa.parse(this[nt],this[ue],!1);break;case"GlobalExtendedHeader":this[kr]=fa.parse(this[nt],this[kr],!0);break;case"NextFileHasLongPath":case"OldGnuLongPath":this[ue]=this[ue]||Object.create(null),this[ue].path=this[nt].replace(/\0.*/,"");break;case"NextFileHasLongLinkpath":this[ue]=this[ue]||Object.create(null),this[ue].linkpath=this[nt].replace(/\0.*/,"");break;default:throw new Error("unknown meta: "+e.type)}}abort(e){this[ot]=!0,this.emit("abort",e),this.warn("TAR_ABORT",e,{recoverable:!1})}write(e){if(this[ot])return;if(this[Q]===null&&e){if(this[O]&&(e=Buffer.concat([this[O],e]),this[O]=null),e.length<Tn.length)return this[O]=e,!0;for(let s=0;this[Q]===null&&s<Tn.length;s++)e[s]!==Tn[s]&&(this[Q]=!1);if(this[Q]===null){let s=this[_t];this[_t]=!1,this[Q]=new Of.Unzip,this[Q].on("data",n=>this[Rs](n)),this[Q].on("error",n=>this.abort(n)),this[Q].on("end",n=>{this[_t]=!0,this[Rs]()}),this[_r]=!0;let i=this[Q][s?"end":"write"](e);return this[_r]=!1,i}}this[_r]=!0,this[Q]?this[Q].write(e):this[Rs](e),this[_r]=!1;let t=this[We].length?!1:this[$e]?this[$e].flowing:!0;return!t&&!this[We].length&&this[$e].once("drain",s=>this.emit("drain")),t}[Nn](e){e&&!this[ot]&&(this[O]=this[O]?Buffer.concat([this[O],e]):e)}[Mn](){if(this[_t]&&!this[da]&&!this[ot]&&!this[xs]){this[da]=!0;let e=this[kt];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[vt](Os)}}[Rs](e){if(this[xs])this[Nn](e);else if(!e&&!this[O])this[Mn]();else{if(this[xs]=!0,this[O]){this[Nn](e);let t=this[O];this[O]=null,this[Bs](t)}else this[Bs](e);for(;this[O]&&this[O].length>=512&&!this[ot]&&!this[Ps];){let t=this[O];this[O]=null,this[Bs](t)}this[xs]=!1}(!this[O]||this[_t])&&this[Mn]()}[Bs](e){let t=0,s=e.length;for(;t+512<=s&&!this[ot]&&!this[Ps];)switch(this[oe]){case"begin":case"header":this[ga](e,t),t+=512;break;case"ignore":case"body":t+=this[Ln](e,t);break;case"meta":t+=this[Da](e,t);break;default:throw new Error("invalid state: "+this[oe])}t<s&&(this[O]?this[O]=Buffer.concat([e.slice(t),this[O]]):this[O]=e.slice(t))}end(e){this[ot]||(this[Q]?this[Q].end(e):(this[_t]=!0,this.write(e)))}})});var Ns=y((A0,Fa)=>{"use strict";u();var Lf=jt(),Ca=Ls(),sr=require("fs"),Nf=rr(),Aa=require("path"),In=Jt();Fa.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&&If(s,e),s.noResume||Mf(s),s.file&&s.sync?jf(s):s.file?qf(s,t):wa(s)};var Mf=r=>{let e=r.onentry;r.onentry=e?t=>{e(t),t.resume()}:t=>t.resume()},If=(r,e)=>{let t=new Map(e.map(n=>[In(n),!0])),s=r.filter,i=(n,o)=>{let a=o||Aa.parse(n).root||".",l=n===a?!1:t.has(n)?t.get(n):i(Aa.dirname(n),a);return t.set(n,l),l};r.filter=s?(n,o)=>s(n,o)&&i(In(n)):n=>i(In(n))},jf=r=>{let e=wa(r),t=r.file,s=!0,i;try{let n=sr.statSync(t),o=r.maxReadSize||16*1024*1024;if(n.size<o)e.end(sr.readFileSync(t));else{let a=0,l=Buffer.allocUnsafe(o);for(i=sr.openSync(t,"r");a<n.size;){let c=sr.readSync(i,l,0,o,a);a+=c,e.write(l.slice(0,c))}e.end()}s=!1}finally{if(s&&i)try{sr.closeSync(i)}catch{}}},qf=(r,e)=>{let t=new Ca(r),s=r.maxReadSize||16*1024*1024,i=r.file,n=new Promise((o,a)=>{t.on("error",a),t.on("end",o),sr.stat(i,(l,c)=>{if(l)a(l);else{let h=new Nf.ReadStream(i,{readSize:s,size:c.size});h.on("error",a),h.pipe(t)}})});return e?n.then(e,e):n},wa=r=>new Ca(r)});var Ra=y((C0,va)=>{"use strict";u();var Uf=jt(),Ms=Cs(),ba=rr(),Sa=Ns(),ka=require("path");va.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=Uf(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?$f(s,e):s.file?Wf(s,e,t):s.sync?zf(s,e):Gf(s,e)};var $f=(r,e)=>{let t=new Ms.Sync(r),s=new ba.WriteStreamSync(r.file,{mode:r.mode||438});t.pipe(s),_a(t,e)},Wf=(r,e,t)=>{let s=new Ms(r),i=new ba.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 jn(s,e),t?n.then(t,t):n},_a=(r,e)=>{e.forEach(t=>{t.charAt(0)==="@"?Sa({file:ka.resolve(r.cwd,t.slice(1)),sync:!0,noResume:!0,onentry:s=>r.add(s)}):r.add(t)}),r.end()},jn=(r,e)=>{for(;e.length;){let t=e.shift();if(t.charAt(0)==="@")return Sa({file:ka.resolve(r.cwd,t.slice(1)),noResume:!0,onentry:s=>r.add(s)}).then(s=>jn(r,e));r.add(t)}r.end()},zf=(r,e)=>{let t=new Ms.Sync(r);return _a(t,e),t},Gf=(r,e)=>{let t=new Ms(r);return jn(t,e),t}});var qn=y((w0,Na)=>{"use strict";u();var Hf=jt(),Ba=Cs(),re=require("fs"),xa=rr(),Oa=Ns(),Ta=require("path"),Pa=Ht();Na.exports=(r,e,t)=>{let s=Hf(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?Jf(s,e):Yf(s,e,t)};var Jf=(r,e)=>{let t=new Ba.Sync(r),s=!0,i,n;try{try{i=re.openSync(r.file,"r+")}catch(l){if(l.code==="ENOENT")i=re.openSync(r.file,"w+");else throw l}let o=re.fstatSync(i),a=Buffer.alloc(512);e:for(n=0;n<o.size;n+=512){for(let h=0,d=0;h<512;h+=d){if(d=re.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(!d)break e}let l=new Pa(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,Vf(r,t,n,i,e)}finally{if(s)try{re.closeSync(i)}catch{}}},Vf=(r,e,t,s,i)=>{let n=new xa.WriteStreamSync(r.file,{fd:s,start:t});e.pipe(n),Kf(e,i)},Yf=(r,e,t)=>{e=Array.from(e);let s=new Ba(r),i=(o,a,l)=>{let c=(C,T)=>{C?re.close(o,b=>l(C)):l(null,T)},h=0;if(a===0)return c(null,0);let d=0,p=Buffer.alloc(512),E=(C,T)=>{if(C)return c(C);if(d+=T,d<512&&T)return re.read(o,p,d,p.length-d,h+d,E);if(h===0&&p[0]===31&&p[1]===139)return c(new Error("cannot append to compressed archives"));if(d<512)return c(null,h);let b=new Pa(p);if(!b.cksumValid)return c(null,h);let x=512*Math.ceil(b.size/512);if(h+x+512>a||(h+=x+512,h>=a))return c(null,h);r.mtimeCache&&r.mtimeCache.set(b.path,b.mtime),d=0,re.read(o,p,0,512,h,E)};re.read(o,p,0,512,h,E)},n=new Promise((o,a)=>{s.on("error",a);let l="r+",c=(h,d)=>{if(h&&h.code==="ENOENT"&&l==="r+")return l="w+",re.open(r.file,l,c);if(h)return a(h);re.fstat(d,(p,E)=>{if(p)return re.close(d,()=>a(p));i(d,E.size,(C,T)=>{if(C)return a(C);let b=new xa.WriteStream(r.file,{fd:d,start:T});s.pipe(b),b.on("error",a),b.on("close",o),La(s,e)})})};re.open(r.file,l,c)});return t?n.then(t,t):n},Kf=(r,e)=>{e.forEach(t=>{t.charAt(0)==="@"?Oa({file:Ta.resolve(r.cwd,t.slice(1)),sync:!0,noResume:!0,onentry:s=>r.add(s)}):r.add(t)}),r.end()},La=(r,e)=>{for(;e.length;){let t=e.shift();if(t.charAt(0)==="@")return Oa({file:Ta.resolve(r.cwd,t.slice(1)),noResume:!0,onentry:s=>r.add(s)}).then(s=>La(r,e));r.add(t)}r.end()}});var Ia=y((F0,Ma)=>{"use strict";u();var Zf=jt(),Xf=qn();Ma.exports=(r,e,t)=>{let s=Zf(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),Qf(s),Xf(s,e,t)};var Qf=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 Ua=y((b0,qa)=>{u();var{promisify:ja}=require("util"),ut=require("fs"),ep=r=>{if(!r)r={mode:511,fs:ut};else if(typeof r=="object")r={mode:511,fs:ut,...r};else if(typeof r=="number")r={mode:r,fs:ut};else if(typeof r=="string")r={mode:parseInt(r,8),fs:ut};else throw new TypeError("invalid options argument");return r.mkdir=r.mkdir||r.fs.mkdir||ut.mkdir,r.mkdirAsync=ja(r.mkdir),r.stat=r.stat||r.fs.stat||ut.stat,r.statAsync=ja(r.stat),r.statSync=r.statSync||r.fs.statSync||ut.statSync,r.mkdirSync=r.mkdirSync||r.fs.mkdirSync||ut.mkdirSync,r};qa.exports=ep});var Wa=y((S0,$a)=>{u();var tp=process.env.__TESTING_MKDIRP_PLATFORM__||process.platform,{resolve:rp,parse:sp}=require("path"),ip=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=rp(r),tp==="win32"){let e=/[*|"<>?:]/,{root:t}=sp(r);if(e.test(r.substr(t.length)))throw Object.assign(new Error("Illegal characters in path."),{path:r,code:"EINVAL"})}return r};$a.exports=ip});var Va=y((k0,Ja)=>{u();var{dirname:za}=require("path"),Ga=(r,e,t=void 0)=>t===e?Promise.resolve():r.statAsync(e).then(s=>s.isDirectory()?t:void 0,s=>s.code==="ENOENT"?Ga(r,za(e),e):void 0),Ha=(r,e,t=void 0)=>{if(t!==e)try{return r.statSync(e).isDirectory()?t:void 0}catch(s){return s.code==="ENOENT"?Ha(r,za(e),e):void 0}};Ja.exports={findMade:Ga,findMadeSync:Ha}});var Wn=y((_0,Ka)=>{u();var{dirname:Ya}=require("path"),Un=(r,e,t)=>{e.recursive=!1;let s=Ya(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 Un(s,e).then(n=>Un(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})})},$n=(r,e,t)=>{let s=Ya(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 $n(r,e,$n(s,e,t));if(i.code!=="EEXIST"&&i.code!=="EROFS")throw i;try{if(!e.statSync(r).isDirectory())throw i}catch{throw i}}};Ka.exports={mkdirpManual:Un,mkdirpManualSync:$n}});var Qa=y((v0,Xa)=>{u();var{dirname:Za}=require("path"),{findMade:np,findMadeSync:op}=Va(),{mkdirpManual:up,mkdirpManualSync:ap}=Wn(),cp=(r,e)=>(e.recursive=!0,Za(r)===r?e.mkdirAsync(r,e):np(e,r).then(s=>e.mkdirAsync(r,e).then(()=>s).catch(i=>{if(i.code==="ENOENT")return up(r,e);throw i}))),lp=(r,e)=>{if(e.recursive=!0,Za(r)===r)return e.mkdirSync(r,e);let s=op(e,r);try{return e.mkdirSync(r,e),s}catch(i){if(i.code==="ENOENT")return ap(r,e);throw i}};Xa.exports={mkdirpNative:cp,mkdirpNativeSync:lp}});var sc=y((R0,rc)=>{u();var ec=require("fs"),hp=process.env.__TESTING_MKDIRP_NODE_VERSION__||process.version,zn=hp.replace(/^v/,"").split("."),tc=+zn[0]>10||+zn[0]==10&&+zn[1]>=12,fp=tc?r=>r.mkdir===ec.mkdir:()=>!1,pp=tc?r=>r.mkdirSync===ec.mkdirSync:()=>!1;rc.exports={useNative:fp,useNativeSync:pp}});var cc=y((B0,ac)=>{u();var ir=Ua(),nr=Wa(),{mkdirpNative:ic,mkdirpNativeSync:nc}=Qa(),{mkdirpManual:oc,mkdirpManualSync:uc}=Wn(),{useNative:mp,useNativeSync:dp}=sc(),or=(r,e)=>(r=nr(r),e=ir(e),mp(e)?ic(r,e):oc(r,e)),Dp=(r,e)=>(r=nr(r),e=ir(e),dp(e)?nc(r,e):uc(r,e));or.sync=Dp;or.native=(r,e)=>ic(nr(r),ir(e));or.manual=(r,e)=>oc(nr(r),ir(e));or.nativeSync=(r,e)=>nc(nr(r),ir(e));or.manualSync=(r,e)=>uc(nr(r),ir(e));ac.exports=or});var Dc=y((x0,dc)=>{"use strict";u();var ae=require("fs"),Bt=require("path"),gp=ae.lchown?"lchown":"chown",Ep=ae.lchownSync?"lchownSync":"chownSync",hc=ae.lchown&&!process.version.match(/v1[1-9]+\./)&&!process.version.match(/v10\.[6-9]/),lc=(r,e,t)=>{try{return ae[Ep](r,e,t)}catch(s){if(s.code!=="ENOENT")throw s}},yp=(r,e,t)=>{try{return ae.chownSync(r,e,t)}catch(s){if(s.code!=="ENOENT")throw s}},Ap=hc?(r,e,t,s)=>i=>{!i||i.code!=="EISDIR"?s(i):ae.chown(r,e,t,s)}:(r,e,t,s)=>s,Gn=hc?(r,e,t)=>{try{return lc(r,e,t)}catch(s){if(s.code!=="EISDIR")throw s;yp(r,e,t)}}:(r,e,t)=>lc(r,e,t),Cp=process.version,fc=(r,e,t)=>ae.readdir(r,e,t),wp=(r,e)=>ae.readdirSync(r,e);/^v4\./.test(Cp)&&(fc=(r,e,t)=>ae.readdir(r,t));var Is=(r,e,t,s)=>{ae[gp](r,e,t,Ap(r,e,t,i=>{s(i&&i.code!=="ENOENT"?i:null)}))},pc=(r,e,t,s,i)=>{if(typeof e=="string")return ae.lstat(Bt.resolve(r,e),(n,o)=>{if(n)return i(n.code!=="ENOENT"?n:null);o.name=e,pc(r,o,t,s,i)});if(e.isDirectory())Hn(Bt.resolve(r,e.name),t,s,n=>{if(n)return i(n);let o=Bt.resolve(r,e.name);Is(o,t,s,i)});else{let n=Bt.resolve(r,e.name);Is(n,t,s,i)}},Hn=(r,e,t,s)=>{fc(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 Is(r,e,t,s);let o=n.length,a=null,l=c=>{if(!a){if(c)return s(a=c);if(--o===0)return Is(r,e,t,s)}};n.forEach(c=>pc(r,c,e,t,l))})},Fp=(r,e,t,s)=>{if(typeof e=="string")try{let i=ae.lstatSync(Bt.resolve(r,e));i.name=e,e=i}catch(i){if(i.code==="ENOENT")return;throw i}e.isDirectory()&&mc(Bt.resolve(r,e.name),t,s),Gn(Bt.resolve(r,e.name),t,s)},mc=(r,e,t)=>{let s;try{s=wp(r,{withFileTypes:!0})}catch(i){if(i.code==="ENOENT")return;if(i.code==="ENOTDIR"||i.code==="ENOTSUP")return Gn(r,e,t);throw i}return s&&s.length&&s.forEach(i=>Fp(r,i,e,t)),Gn(r,e,t)};dc.exports=Hn;Hn.sync=mc});var Ac=y((O0,Jn)=>{"use strict";u();var gc=cc(),ce=require("fs"),js=require("path"),Ec=Dc(),De=zt(),qs=class extends Error{constructor(e,t){super("Cannot extract through symbolic link"),this.path=t,this.symlink=e}get name(){return"SylinkError"}},Us=class extends Error{constructor(e,t){super(t+": Cannot cd into '"+e+"'"),this.path=e,this.code=t}get name(){return"CwdError"}},$s=(r,e)=>r.get(De(e)),vr=(r,e,t)=>r.set(De(e),t),bp=(r,e)=>{ce.stat(r,(t,s)=>{(t||!s.isDirectory())&&(t=new Us(r,t&&t.code||"ENOTDIR")),e(t)})};Jn.exports=(r,e,t)=>{r=De(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,d=e.cache,p=De(e.cwd),E=(b,x)=>{b?t(b):(vr(d,r,!0),x&&l?Ec(x,o,a,dt=>E(dt)):n?ce.chmod(r,i,t):t())};if(d&&$s(d,r)===!0)return E();if(r===p)return bp(r,E);if(c)return gc(r,{mode:i}).then(b=>E(null,b),E);let T=De(js.relative(p,r)).split("/");Ws(p,T,i,d,h,p,null,E)};var Ws=(r,e,t,s,i,n,o,a)=>{if(!e.length)return a(null,o);let l=e.shift(),c=De(js.resolve(r+"/"+l));if($s(s,c))return Ws(c,e,t,s,i,n,o,a);ce.mkdir(c,t,yc(c,e,t,s,i,n,o,a))},yc=(r,e,t,s,i,n,o,a)=>l=>{l?ce.lstat(r,(c,h)=>{if(c)c.path=c.path&&De(c.path),a(c);else if(h.isDirectory())Ws(r,e,t,s,i,n,o,a);else if(i)ce.unlink(r,d=>{if(d)return a(d);ce.mkdir(r,t,yc(r,e,t,s,i,n,o,a))});else{if(h.isSymbolicLink())return a(new qs(r,r+"/"+e.join("/")));a(l)}}):(o=o||r,Ws(r,e,t,s,i,n,o,a))},Sp=r=>{let e=!1,t="ENOTDIR";try{e=ce.statSync(r).isDirectory()}catch(s){t=s.code}finally{if(!e)throw new Us(r,t)}};Jn.exports.sync=(r,e)=>{r=De(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,d=De(e.cwd),p=b=>{vr(h,r,!0),b&&a&&Ec.sync(b,n,o),i&&ce.chmodSync(r,s)};if(h&&$s(h,r)===!0)return p();if(r===d)return Sp(d),p();if(l)return p(gc.sync(r,s));let C=De(js.relative(d,r)).split("/"),T=null;for(let b=C.shift(),x=d;b&&(x+="/"+b);b=C.shift())if(x=De(js.resolve(x)),!$s(h,x))try{ce.mkdirSync(x,s),T=T||x,vr(h,x,!0)}catch{let ge=ce.lstatSync(x);if(ge.isDirectory()){vr(h,x,!0);continue}else if(c){ce.unlinkSync(x),ce.mkdirSync(x,s),T=T||x,vr(h,x,!0);continue}else if(ge.isSymbolicLink())return new qs(x,x+"/"+C.join("/"))}return p(T)}});var Yn=y((T0,Cc)=>{u();var Vn=Object.create(null),{hasOwnProperty:kp}=Object.prototype;Cc.exports=r=>(kp.call(Vn,r)||(Vn[r]=r.normalize("NFKD")),Vn[r])});var Sc=y((P0,bc)=>{u();var wc=require("assert"),_p=Yn(),vp=Jt(),{join:Fc}=require("path"),Rp=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,Bp=Rp==="win32";bc.exports=()=>{let r=new Map,e=new Map,t=c=>c.split("/").slice(0,-1).reduce((d,p)=>(d.length&&(p=Fc(d[d.length-1],p)),d.push(p||"/"),d),[]),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(d=>r.get(d)),dirs:[...h.dirs].map(d=>r.get(d))}},n=c=>{let{paths:h,dirs:d}=i(c);return h.every(p=>p[0]===c)&&d.every(p=>p[0]instanceof Set&&p[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:d}=e.get(c),p=new Set;return h.forEach(E=>{let C=r.get(E);wc.equal(C[0],c),C.length===1?r.delete(E):(C.shift(),typeof C[0]=="function"?p.add(C[0]):C[0].forEach(T=>p.add(T)))}),d.forEach(E=>{let C=r.get(E);wc(C[0]instanceof Set),C[0].size===1&&C.length===1?r.delete(E):C[0].size===1?(C.shift(),p.add(C[0])):C[0].delete(c)}),s.delete(c),p.forEach(E=>o(E)),!0};return{check:n,reserve:(c,h)=>{c=Bp?["win32 parallelization disabled"]:c.map(p=>_p(vp(Fc(p))).toLowerCase());let d=new Set(c.map(p=>t(p)).reduce((p,E)=>p.concat(E)));return e.set(h,{dirs:d,paths:c}),c.forEach(p=>{let E=r.get(p);E?E.push(h):r.set(p,[h])}),d.forEach(p=>{let E=r.get(p);E?E[E.length-1]instanceof Set?E[E.length-1].add(h):E.push(new Set([h])):r.set(p,[new Set([h])])}),o(h)}}}});var vc=y((L0,_c)=>{u();var xp=process.env.__FAKE_PLATFORM__||process.platform,Op=xp==="win32",Tp=global.__FAKE_TESTING_FS__||require("fs"),{O_CREAT:Pp,O_TRUNC:Lp,O_WRONLY:Np,UV_FS_O_FILEMAP:kc=0}=Tp.constants,Mp=Op&&!!kc,Ip=512*1024,jp=kc|Lp|Pp|Np;_c.exports=Mp?r=>r<Ip?jp:"w":()=>"w"});var io=y((N0,$c)=>{"use strict";u();var qp=require("assert"),Up=Ls(),_=require("fs"),$p=rr(),ze=require("path"),jc=Ac(),Rc=rn(),Wp=Sc(),zp=sn(),se=zt(),Gp=Jt(),Hp=Yn(),Bc=Symbol("onEntry"),Xn=Symbol("checkFs"),xc=Symbol("checkFs2"),Hs=Symbol("pruneCache"),Qn=Symbol("isReusable"),le=Symbol("makeFs"),eo=Symbol("file"),to=Symbol("directory"),Js=Symbol("link"),Oc=Symbol("symlink"),Tc=Symbol("hardlink"),Pc=Symbol("unsupported"),Lc=Symbol("checkPath"),at=Symbol("mkdir"),G=Symbol("onError"),zs=Symbol("pending"),Nc=Symbol("pend"),ur=Symbol("unpend"),Kn=Symbol("ended"),Zn=Symbol("maybeClose"),ro=Symbol("skip"),Rr=Symbol("doChown"),Br=Symbol("uid"),xr=Symbol("gid"),Or=Symbol("checkedCwd"),qc=require("crypto"),Uc=vc(),Jp=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,Tr=Jp==="win32",Vp=(r,e)=>{if(!Tr)return _.unlink(r,e);let t=r+".DELETE."+qc.randomBytes(16).toString("hex");_.rename(r,t,s=>{if(s)return e(s);_.unlink(t,e)})},Yp=r=>{if(!Tr)return _.unlinkSync(r);let e=r+".DELETE."+qc.randomBytes(16).toString("hex");_.renameSync(r,e),_.unlinkSync(e)},Mc=(r,e,t)=>r===r>>>0?r:e===e>>>0?e:t,Ic=r=>Hp(Gp(se(r))).toLowerCase(),Kp=(r,e)=>{e=Ic(e);for(let t of r.keys()){let s=Ic(t);(s===e||s.indexOf(e+"/")===0)&&r.delete(t)}},Zp=r=>{for(let e of r.keys())r.delete(e)},Pr=class extends Up{constructor(e){if(e||(e={}),e.ondone=t=>{this[Kn]=!0,this[Zn]()},super(e),this[Or]=!1,this.reservations=Wp(),this.transform=typeof e.transform=="function"?e.transform:null,this.writable=!0,this.readable=!1,this[zs]=0,this[Kn]=!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||Tr,this.newer=!!e.newer,this.keep=!!e.keep,this.noMtime=!!e.noMtime,this.preservePaths=!!e.preservePaths,this.unlink=!!e.unlink,this.cwd=se(ze.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[Bc](t))}warn(e,t,s={}){return(e==="TAR_BAD_ARCHIVE"||e==="TAR_ABORT")&&(s.recoverable=!1),super.warn(e,t,s)}[Zn](){this[Kn]&&this[zs]===0&&(this.emit("prefinish"),this.emit("finish"),this.emit("end"))}[Lc](e){if(this.strip){let t=se(e.path).split("/");if(t.length<this.strip)return!1;if(e.path=t.slice(this.strip).join("/"),e.type==="Link"){let s=se(e.linkpath).split("/");if(s.length>=this.strip)e.linkpath=s.slice(this.strip).join("/");else return!1}}if(!this.preservePaths){let t=se(e.path),s=t.split("/");if(s.includes("..")||Tr&&/^[a-z]:\.\.$/i.test(s[0]))return this.warn("TAR_ENTRY_ERROR","path contains '..'",{entry:e,path:t}),!1;let[i,n]=zp(t);i&&(e.path=n,this.warn("TAR_ENTRY_INFO",`stripping ${i} from absolute path`,{entry:e,path:t}))}if(ze.isAbsolute(e.path)?e.absolute=se(ze.resolve(e.path)):e.absolute=se(ze.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:se(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}=ze.win32.parse(e.absolute);e.absolute=t+Rc.encode(e.absolute.slice(t.length));let{root:s}=ze.win32.parse(e.path);e.path=s+Rc.encode(e.path.slice(s.length))}return!0}[Bc](e){if(!this[Lc](e))return e.resume();switch(qp.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[Xn](e);case"CharacterDevice":case"BlockDevice":case"FIFO":default:return this[Pc](e)}}[G](e,t){e.name==="CwdError"?this.emit("error",e):(this.warn("TAR_ENTRY_ERROR",e,{entry:t}),this[ur](),t.resume())}[at](e,t,s){jc(se(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)}[Rr](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}[Br](e){return Mc(this.uid,e.uid,this.processUid)}[xr](e){return Mc(this.gid,e.gid,this.processGid)}[eo](e,t){let s=e.mode&4095||this.fmode,i=new $p.WriteStream(e.absolute,{flags:Uc(e.size),mode:s,autoClose:!1});i.on("error",l=>{i.fd&&_.close(i.fd,()=>{}),i.write=()=>!0,this[G](l,e),t()});let n=1,o=l=>{if(l){i.fd&&_.close(i.fd,()=>{}),this[G](l,e),t();return}--n===0&&_.close(i.fd,c=>{c?this[G](c,e):this[ur](),t()})};i.on("finish",l=>{let c=e.absolute,h=i.fd;if(e.mtime&&!this.noMtime){n++;let d=e.atime||new Date,p=e.mtime;_.futimes(h,d,p,E=>E?_.utimes(c,d,p,C=>o(C&&E)):o())}if(this[Rr](e)){n++;let d=this[Br](e),p=this[xr](e);_.fchown(h,d,p,E=>E?_.chown(c,d,p,C=>o(C&&E)):o())}o()});let a=this.transform&&this.transform(e)||e;a!==e&&(a.on("error",l=>{this[G](l,e),t()}),e.pipe(a)),a.pipe(i)}[to](e,t){let s=e.mode&4095||this.dmode;this[at](e.absolute,s,i=>{if(i){this[G](i,e),t();return}let n=1,o=a=>{--n===0&&(t(),this[ur](),e.resume())};e.mtime&&!this.noMtime&&(n++,_.utimes(e.absolute,e.atime||new Date,e.mtime,o)),this[Rr](e)&&(n++,_.chown(e.absolute,this[Br](e),this[xr](e),o)),o()})}[Pc](e){e.unsupported=!0,this.warn("TAR_ENTRY_UNSUPPORTED",`unsupported entry type: ${e.type}`,{entry:e}),e.resume()}[Oc](e,t){this[Js](e,e.linkpath,"symlink",t)}[Tc](e,t){let s=se(ze.resolve(this.cwd,e.linkpath));this[Js](e,s,"link",t)}[Nc](){this[zs]++}[ur](){this[zs]--,this[Zn]()}[ro](e){this[ur](),e.resume()}[Qn](e,t){return e.type==="File"&&!this.unlink&&t.isFile()&&t.nlink<=1&&!Tr}[Xn](e){this[Nc]();let t=[e.path];e.linkpath&&t.push(e.linkpath),this.reservations.reserve(t,s=>this[xc](e,s))}[Hs](e){e.type==="SymbolicLink"?Zp(this.dirCache):e.type!=="Directory"&&Kp(this.dirCache,e.absolute)}[xc](e,t){this[Hs](e);let s=a=>{this[Hs](e),t(a)},i=()=>{this[at](this.cwd,this.dmode,a=>{if(a){this[G](a,e),s();return}this[Or]=!0,n()})},n=()=>{if(e.absolute!==this.cwd){let a=se(ze.dirname(e.absolute));if(a!==this.cwd)return this[at](a,this.dmode,l=>{if(l){this[G](l,e),s();return}o()})}o()},o=()=>{_.lstat(e.absolute,(a,l)=>{if(l&&(this.keep||this.newer&&l.mtime>e.mtime)){this[ro](e),s();return}if(a||this[Qn](e,l))return this[le](null,e,s);if(l.isDirectory()){if(e.type==="Directory"){let c=!this.noChmod&&e.mode&&(l.mode&4095)!==e.mode,h=d=>this[le](d,e,s);return c?_.chmod(e.absolute,e.mode,h):h()}if(e.absolute!==this.cwd)return _.rmdir(e.absolute,c=>this[le](c,e,s))}if(e.absolute===this.cwd)return this[le](null,e,s);Vp(e.absolute,c=>this[le](c,e,s))})};this[Or]?n():i()}[le](e,t,s){if(e){this[G](e,t),s();return}switch(t.type){case"File":case"OldFile":case"ContiguousFile":return this[eo](t,s);case"Link":return this[Tc](t,s);case"SymbolicLink":return this[Oc](t,s);case"Directory":case"GNUDumpDir":return this[to](t,s)}}[Js](e,t,s,i){_[s](t,e.absolute,n=>{n?this[G](n,e):(this[ur](),e.resume()),i()})}},Gs=r=>{try{return[null,r()]}catch(e){return[e,null]}},so=class extends Pr{[le](e,t){return super[le](e,t,()=>{})}[Xn](e){if(this[Hs](e),!this[Or]){let n=this[at](this.cwd,this.dmode);if(n)return this[G](n,e);this[Or]=!0}if(e.absolute!==this.cwd){let n=se(ze.dirname(e.absolute));if(n!==this.cwd){let o=this[at](n,this.dmode);if(o)return this[G](o,e)}}let[t,s]=Gs(()=>_.lstatSync(e.absolute));if(s&&(this.keep||this.newer&&s.mtime>e.mtime))return this[ro](e);if(t||this[Qn](e,s))return this[le](null,e);if(s.isDirectory()){if(e.type==="Directory"){let o=!this.noChmod&&e.mode&&(s.mode&4095)!==e.mode,[a]=o?Gs(()=>{_.chmodSync(e.absolute,e.mode)}):[];return this[le](a,e)}let[n]=Gs(()=>_.rmdirSync(e.absolute));this[le](n,e)}let[i]=e.absolute===this.cwd?[]:Gs(()=>Yp(e.absolute));this[le](i,e)}[eo](e,t){let s=e.mode&4095||this.fmode,i=a=>{let l;try{_.closeSync(n)}catch(c){l=c}(a||l)&&this[G](a||l,e),t()},n;try{n=_.openSync(e.absolute,Uc(e.size),s)}catch(a){return i(a)}let o=this.transform&&this.transform(e)||e;o!==e&&(o.on("error",a=>this[G](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(d){try{_.utimesSync(e.absolute,c,h)}catch{l=d}}}if(this[Rr](e)){let c=this[Br](e),h=this[xr](e);try{_.fchownSync(n,c,h)}catch(d){try{_.chownSync(e.absolute,c,h)}catch{l=l||d}}}i(l)})}[to](e,t){let s=e.mode&4095||this.dmode,i=this[at](e.absolute,s);if(i){this[G](i,e),t();return}if(e.mtime&&!this.noMtime)try{_.utimesSync(e.absolute,e.atime||new Date,e.mtime)}catch{}if(this[Rr](e))try{_.chownSync(e.absolute,this[Br](e),this[xr](e))}catch{}t(),e.resume()}[at](e,t){try{return jc.sync(se(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}}[Js](e,t,s,i){try{_[s+"Sync"](t,e.absolute),i(),e.resume()}catch(n){return this[G](n,e)}}};Pr.Sync=so;$c.exports=Pr});var Jc=y((M0,Hc)=>{"use strict";u();var Xp=jt(),Vs=io(),zc=require("fs"),Gc=rr(),Wc=require("path"),no=Jt();Hc.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=Xp(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&&Qp(s,e),s.file&&s.sync?em(s):s.file?tm(s,t):s.sync?rm(s):sm(s)};var Qp=(r,e)=>{let t=new Map(e.map(n=>[no(n),!0])),s=r.filter,i=(n,o)=>{let a=o||Wc.parse(n).root||".",l=n===a?!1:t.has(n)?t.get(n):i(Wc.dirname(n),a);return t.set(n,l),l};r.filter=s?(n,o)=>s(n,o)&&i(no(n)):n=>i(no(n))},em=r=>{let e=new Vs.Sync(r),t=r.file,s=zc.statSync(t),i=r.maxReadSize||16*1024*1024;new Gc.ReadStreamSync(t,{readSize:i,size:s.size}).pipe(e)},tm=(r,e)=>{let t=new Vs(r),s=r.maxReadSize||16*1024*1024,i=r.file,n=new Promise((o,a)=>{t.on("error",a),t.on("close",o),zc.stat(i,(l,c)=>{if(l)a(l);else{let h=new Gc.ReadStream(i,{readSize:s,size:c.size});h.on("error",a),h.pipe(t)}})});return e?n.then(e,e):n},rm=r=>new Vs.Sync(r),sm=r=>new Vs(r)});var Vc=y(N=>{"use strict";u();N.c=N.create=Ra();N.r=N.replace=qn();N.t=N.list=Ns();N.u=N.update=Ia();N.x=N.extract=Jc();N.Pack=Cs();N.Unpack=io();N.Parse=Ls();N.ReadEntry=is();N.WriteEntry=mn();N.Header=Ht();N.Pax=os();N.types=Yi()});var el=y(($0,Qc)=>{u();function he(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))}Qc.exports=he;he.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)};he.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null};he.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};he.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)};he.prototype.try=function(r){console.log("Using RetryOperation.try() is deprecated"),this.attempt(r)};he.prototype.start=function(r){console.log("Using RetryOperation.start() is deprecated"),this.attempt(r)};he.prototype.start=he.prototype.try;he.prototype.errors=function(){return this._errors};he.prototype.attempts=function(){return this._attempts};he.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 tl=y(xt=>{u();var um=el();xt.operation=function(r){var e=xt.timeouts(r);return new um(e,{forever:r&&(r.forever||r.retries===1/0),unref:r&&r.unref,maxRetryTime:r&&r.maxRetryTime})};xt.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};xt.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};xt.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=xt.operation(e),h=Array.prototype.slice.call(arguments,1),d=h.pop();h.push(function(p){c.retry(p)||(p&&(arguments[0]=c.mainError()),d.apply(this,arguments))}),c.attempt(function(){l.apply(r,h)})}.bind(r,o),r[n].options=e}}});var sl=y((z0,rl)=>{u();rl.exports=tl()});var nl=y((G0,il)=>{u();var am=sl();function cm(r,e){function t(s,i){var n=e||{},o;"randomize"in n||(n.randomize=!0),o=am.operation(n);function a(h){i(h||new Error("Aborted"))}function l(h,d){if(h.bail){a(h);return}o.retry(h)?n.onRetry&&n.onRetry(h,d):i(o.mainError())}function c(h){var d;try{d=r(a,h)}catch(p){l(p,h);return}Promise.resolve(d).then(s).catch(function(E){l(E,h)})}o.attempt(c)}return new Promise(t)}il.exports=cm});u();var fo=require("picocolors"),Tl=require("commander");u();u();u();var Xl=S(Co());u();u();function oi(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}u();u();function pr(r){return pr=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},pr(r)}u();function ui(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function ai(r,e){if(e&&(pr(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ui(r)}u();function Et(r){return Et=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Et(r)}u();u();function xe(r,e){return xe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(s,i){return s.__proto__=i,s},xe(r,e)}function ci(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&&xe(r,e)}u();u();function li(r){return Function.toString.call(r).indexOf("[native code]")!==-1}u();u();function hi(){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 Nt(r,e,t){return hi()?Nt=Reflect.construct.bind():Nt=function(i,n,o){var a=[null];a.push.apply(a,n);var l=Function.bind.apply(i,a),c=new l;return o&&xe(c,o.prototype),c},Nt.apply(null,arguments)}function mr(r){var e=typeof Map=="function"?new Map:void 0;return mr=function(s){if(s===null||!li(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 Nt(s,arguments,Et(this).constructor)}return i.prototype=Object.create(s.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),xe(i,s)},mr(r)}var jo=S(Io());var Ql=S(require("fs-extra")),vd=function(r){ci(e,r);function e(t){var s;return oi(this,e),s=ai(this,Et(e).call(this,"No package.json could be found upwards from the directory ".concat(t))),s.directory=t,s}return e}(mr(Error));u();u();var eh=S(require("fs")),th=S(require("path"));u();var mh=S(require("fs")),dh=S(require("path")),Dh=S(require("js-yaml")),gh=require("fast-glob");var Ee={};$l(Ee,{bold:()=>uh,dimmed:()=>ch,error:()=>Vo,grey:()=>lh,info:()=>oh,item:()=>hh,log:()=>Ye,turboBlue:()=>It,turboGradient:()=>nh,turboLoader:()=>Ho,turboRed:()=>zo,underline:()=>ah,warn:()=>Jo,yellow:()=>Go});u();var Y=require("picocolors"),qo=S(require("ora")),Uo=S(require("gradient-string")),$o="#0099F7",Wo="#F11712",ih="#FFFF00",Ei=r=>{let e=fh(r);return t=>`\x1B[38;5;${e}m${t}${(0,Y.reset)("")}`},nh=(0,Uo.default)($o,Wo),It=Ei($o),zo=Ei(Wo),Go=Ei(ih),Ho=r=>(0,qo.default)({text:r,spinner:{frames:[" ",It("> "),It(">> "),It(">>>")]}}),oh=(...r)=>{Ye(It((0,Y.bold)(">>>")),r.join(" "))},uh=(...r)=>{Ye((0,Y.bold)(r.join(" ")))},ah=(...r)=>{Ye((0,Y.underline)(r.join(" ")))},ch=(...r)=>{Ye((0,Y.dim)(r.join(" ")))},lh=(...r)=>{Ye((0,Y.gray)(r.join(" ")))},hh=(...r)=>{Ye(It((0,Y.bold)(" \u2022")),r.join(" "))},Ye=(...r)=>{console.log(...r)},Jo=(...r)=>{console.error(Go((0,Y.bold)(">>>")),r.join(" "))},Vo=(...r)=>{console.error(zo((0,Y.bold)(">>>")),r.join(" "))};function fh(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 Yo=S(require("os")),Ko=S(require("execa"));async function Wr(r,e=[],t){let s={cwd:Yo.default.tmpdir(),env:{COREPACK_ENABLE_STRICT:"0"},...t};try{let{stdout:i}=await(0,Ko.default)(r,e,s);return i.trim()}catch{return}}async function yi(){let[r,e,t,s]=await Promise.all([Wr("yarnpkg",["--version"]),Wr("npm",["--version"]),Wr("pnpm",["--version"]),Wr("bun",["--version"])]);return{yarn:r,pnpm:t,npm:e,bun:s}}u();var Eh=S(require("fs-extra"));u();var yh=S(require("path")),Ah=S(require("fs-extra")),Ch=require("picocolors");u();var Yc=require("stream"),Kc=require("util"),im=require("path"),nm=require("os"),Zc=require("fs"),om=S(Vc());var j0=(0,Kc.promisify)(Yc.Stream.pipeline);u();var Xc=require("fs-extra");u();var Dm=S(require("path")),gm=S(nl()),ol=require("picocolors"),oo=require("fs-extra");u();u();var ul={name:"@turbo/workspaces",version:"2.3.4-canary.6",description:"Tools for working with package managers",homepage:"https://turbo.build/repo",license:"MIT",repository:{type:"git",url:"https://github.com/vercel/turborepo",directory:"packages/turbo-workspaces"},bugs:{url:"https://github.com/vercel/turborepo/issues"},bin:"dist/cli.js",module:"dist/index.mjs",main:"dist/index.js",types:"dist/index.d.ts",scripts:{build:"tsup",dev:"tsup --watch",test:"jest",lint:"eslint src/","check-types":"tsc --noEmit","lint:prettier":"prettier -c . --cache --ignore-path=../../.prettierignore"},dependencies:{commander:"^10.0.0",execa:"5.1.1","fast-glob":"^3.2.12","fs-extra":"^10.1.0","gradient-string":"^2.0.0",inquirer:"^8.0.0","js-yaml":"^4.1.0",ora:"4.1.1",picocolors:"1.0.1",semver:"7.6.2","update-check":"^1.5.4"},devDependencies:{"@jest/globals":"^29.7.0","@turbo/eslint-config":"workspace:*","@turbo/test-utils":"workspace:*","@turbo/tsconfig":"workspace:*","@turbo/utils":"workspace:*","@types/fs-extra":"^9.0.13","@types/gradient-string":"^1.1.2","@types/inquirer":"^7.3.1","@types/js-yaml":"^4.0.5","@types/node":"^18.17.2","@types/semver":"7.5.8",jest:"^29.7.0","ts-jest":"^29.2.5",tsup:"^5.10.3",typescript:"5.5.4"},files:["dist"],publishConfig:{access:"public"}};u();u();var Zs=S(require("path")),Sl=S(require("inquirer")),me=require("picocolors");u();var q=require("picocolors"),al=S(require("gradient-string")),ar=2,ct=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(ar*e),...t)}header(e){this.blankLine(),this.logger((0,q.bold)(e))}installerFrames(){let e=`${" ".repeat(ar)} - ${this.dry?(0,q.yellow)("SKIPPED | "):(0,q.green)("OK | ")}`;return[`${e} `,`${e}> `,`${e}>> `,`${e}>>>`]}gradient(e){return(0,al.default)("#0099F7","#F11712")(e.toString())}hero(){this.logger((0,q.bold)(this.gradient(`
4
+ `).reduce(nf,Object.create(null)),nf=(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};xu.exports=wr});var Jt=y((i0,Ou)=>{u();Ou.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 us=y((n0,Tu)=>{"use strict";u();Tu.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 rn=y((u0,Pu)=>{"use strict";u();var as=["|","<",">","?",":"],tn=as.map(r=>String.fromCharCode(61440+r.charCodeAt(0))),of=new Map(as.map((r,e)=>[r,tn[e]])),uf=new Map(tn.map((r,e)=>[r,as[e]]));Pu.exports={encode:r=>as.reduce((e,t)=>e.split(t).join(of.get(t)),r),decode:r=>tn.reduce((e,t)=>e.split(t).join(uf.get(t)),r)}});var sn=y((a0,Nu)=>{u();var{isAbsolute:af,parse:Lu}=require("path").win32;Nu.exports=r=>{let e="",t=Lu(r);for(;af(r)||t.root;){let s=r.charAt(0)==="/"&&r.slice(0,4)!=="//?/"?"/":t.root;r=r.slice(s.length),e+=s,t=Lu(r)}return[e,r]}});var Iu=y((c0,Mu)=>{"use strict";u();Mu.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 mn=y((f0,Xu)=>{"use strict";u();var Gu=Yr(),Hu=os(),Ju=Ht(),Ce=require("fs"),ju=require("path"),Ae=zt(),cf=Jt(),Vu=(r,e)=>e?(r=Ae(r).replace(/^\.(\/|$)/,""),cf(e)+"/"+r):Ae(r),lf=16*1024*1024,qu=Symbol("process"),Uu=Symbol("file"),$u=Symbol("directory"),on=Symbol("symlink"),Wu=Symbol("hardlink"),Fr=Symbol("header"),cs=Symbol("read"),un=Symbol("lstat"),ls=Symbol("onlstat"),an=Symbol("onread"),cn=Symbol("onreadlink"),ln=Symbol("openfile"),hn=Symbol("onopenfile"),tt=Symbol("close"),hs=Symbol("mode"),fn=Symbol("awaitDrain"),nn=Symbol("ondrain"),we=Symbol("prefix"),zu=Symbol("hadError"),Yu=us(),hf=rn(),Ku=sn(),Zu=Iu(),fs=Yu(class extends Gu{constructor(e,t){if(t=t||{},super(t),typeof e!="string")throw new TypeError("path is required");this.path=Ae(e),this.portable=!!t.portable,this.myuid=process.getuid&&process.getuid()||0,this.myuser=process.env.USER||"",this.maxReadSize=t.maxReadSize||lf,this.linkCache=t.linkCache||new Map,this.statCache=t.statCache||new Map,this.preservePaths=!!t.preservePaths,this.cwd=Ae(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?Ae(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]=Ku(this.path);i&&(this.path=n,s=i)}this.win32=!!t.win32||process.platform==="win32",this.win32&&(this.path=hf.decode(this.path.replace(/\\/g,"/")),e=e.replace(/\\/g,"/")),this.absolute=Ae(t.absolute||ju.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[ls](this.statCache.get(this.absolute)):this[un]()}emit(e,...t){return e==="error"&&(this[zu]=!0),super.emit(e,...t)}[un](){Ce.lstat(this.absolute,(e,t)=>{if(e)return this.emit("error",e);this[ls](t)})}[ls](e){this.statCache.set(this.absolute,e),this.stat=e,e.isFile()||(e.size=0),this.type=pf(e),this.emit("stat",e),this[qu]()}[qu](){switch(this.type){case"File":return this[Uu]();case"Directory":return this[$u]();case"SymbolicLink":return this[on]();default:return this.end()}}[hs](e){return Zu(e,this.type==="Directory",this.portable)}[we](e){return Vu(e,this.prefix)}[Fr](){this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.header=new Ju({path:this[we](this.path),linkpath:this.type==="Link"?this[we](this.linkpath):this.linkpath,mode:this[hs](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 Hu({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[we](this.path),linkpath:this.type==="Link"?this[we](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)}[$u](){this.path.slice(-1)!=="/"&&(this.path+="/"),this.stat.size=0,this[Fr](),this.end()}[on](){Ce.readlink(this.absolute,(e,t)=>{if(e)return this.emit("error",e);this[cn](t)})}[cn](e){this.linkpath=Ae(e),this[Fr](),this.end()}[Wu](e){this.type="Link",this.linkpath=Ae(ju.relative(this.cwd,e)),this.stat.size=0,this[Fr](),this.end()}[Uu](){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[Wu](t)}this.linkCache.set(e,this.absolute)}if(this[Fr](),this.stat.size===0)return this.end();this[ln]()}[ln](){Ce.open(this.absolute,"r",(e,t)=>{if(e)return this.emit("error",e);this[hn](t)})}[hn](e){if(this.fd=e,this[zu])return this[tt]();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[cs]()}[cs](){let{fd:e,buf:t,offset:s,length:i,pos:n}=this;Ce.read(e,t,s,i,n,(o,a)=>{if(o)return this[tt](()=>this.emit("error",o));this[an](a)})}[tt](e){Ce.close(this.fd,e)}[an](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[tt](()=>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[tt](()=>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[nn]():this[fn](()=>this[nn]())}[fn](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)}[nn](){if(!this.remain)return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),this[tt](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[cs]()}}),pn=class extends fs{[un](){this[ls](Ce.lstatSync(this.absolute))}[on](){this[cn](Ce.readlinkSync(this.absolute))}[ln](){this[hn](Ce.openSync(this.absolute,"r"))}[cs](){let e=!0;try{let{fd:t,buf:s,offset:i,length:n,pos:o}=this,a=Ce.readSync(t,s,i,n,o);this[an](a),e=!1}finally{if(e)try{this[tt](()=>{})}catch{}}}[fn](e){e()}[tt](e){Ce.closeSync(this.fd),e()}},ff=Yu(class extends Gu{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=Ae(e.path),this.mode=this[hs](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=Ae(e.linkpath),typeof t.onwarn=="function"&&this.on("warn",t.onwarn);let s=!1;if(!this.preservePaths){let[i,n]=Ku(this.path);i&&(this.path=n,s=i)}this.remain=e.size,this.blockRemain=e.startBlockSize,this.header=new Ju({path:this[we](this.path),linkpath:this.type==="Link"?this[we](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 Hu({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[we](this.path),linkpath:this.type==="Link"?this[we](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)}[we](e){return Vu(e,this.prefix)}[hs](e){return Zu(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()}});fs.Sync=pn;fs.Tar=ff;var pf=r=>r.isFile()?"File":r.isDirectory()?"Directory":r.isSymbolicLink()?"SymbolicLink":"Unsupported";Xu.exports=fs});var ea=y((p0,Qu)=>{"use strict";u();Qu.exports=function(r){r.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}});var dn=y((m0,ta)=>{"use strict";u();ta.exports=k;k.Node=Ft;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++)df(this,arguments[r]);return this.length};k.prototype.unshift=function(){for(var r=0,e=arguments.length;r<e;r++)Df(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=mf(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 mf(r,e,t){var s=e===r.head?new Ft(t,null,e,r):new Ft(t,e,e.next,r);return s.next===null&&(r.tail=s),s.prev===null&&(r.head=s),r.length++,s}function df(r,e){r.tail=new Ft(e,r.tail,null,r),r.head||(r.head=r.tail),r.length++}function Df(r,e){r.head=new Ft(e,null,r.head,r),r.tail||(r.tail=r.head),r.length++}function Ft(r,e,t,s){if(!(this instanceof Ft))return new Ft(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{ea()(k)}catch{}});var Cs=y((D0,aa)=>{"use strict";u();var ys=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}},gf=Yr(),Ef=Hi(),yf=is(),bn=mn(),Af=bn.Sync,Cf=bn.Tar,wf=dn(),ra=Buffer.alloc(1024),ds=Symbol("onStat"),ps=Symbol("ended"),Fe=Symbol("queue"),Vt=Symbol("current"),bt=Symbol("process"),ms=Symbol("processing"),sa=Symbol("processJob"),be=Symbol("jobs"),Dn=Symbol("jobDone"),Ds=Symbol("addFSEntry"),ia=Symbol("addTarEntry"),An=Symbol("stat"),Cn=Symbol("readdir"),gs=Symbol("onreaddir"),Es=Symbol("pipe"),na=Symbol("entry"),gn=Symbol("entryOpt"),wn=Symbol("writeEntryClass"),ua=Symbol("write"),En=Symbol("ondrain"),As=require("fs"),oa=require("path"),Ff=us(),yn=zt(),Sn=Ff(class extends gf{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=yn(e.prefix||""),this.linkCache=e.linkCache||new Map,this.statCache=e.statCache||new Map,this.readdirCache=e.readdirCache||new Map,this[wn]=bn,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 Ef.Gzip(e.gzip),this.zip.on("data",t=>super.write(t)),this.zip.on("end",t=>super.end()),this.zip.on("drain",t=>this[En]()),this.on("resume",t=>this.zip.resume())):this.on("drain",this[En]),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[Fe]=new wf,this[be]=0,this.jobs=+e.jobs||4,this[ms]=!1,this[ps]=!1}[ua](e){return super.write(e)}add(e){return this.write(e),this}end(e){return e&&this.write(e),this[ps]=!0,this[bt](),this}write(e){if(this[ps])throw new Error("write after end");return e instanceof yf?this[ia](e):this[Ds](e),this.flowing}[ia](e){let t=yn(oa.resolve(this.cwd,e.path));if(!this.filter(e.path,e))e.resume();else{let s=new ys(e.path,t,!1);s.entry=new Cf(e,this[gn](s)),s.entry.on("end",i=>this[Dn](s)),this[be]+=1,this[Fe].push(s)}this[bt]()}[Ds](e){let t=yn(oa.resolve(this.cwd,e));this[Fe].push(new ys(e,t)),this[bt]()}[An](e){e.pending=!0,this[be]+=1;let t=this.follow?"stat":"lstat";As[t](e.absolute,(s,i)=>{e.pending=!1,this[be]-=1,s?this.emit("error",s):this[ds](e,i)})}[ds](e,t){this.statCache.set(e.absolute,t),e.stat=t,this.filter(e.path,t)||(e.ignore=!0),this[bt]()}[Cn](e){e.pending=!0,this[be]+=1,As.readdir(e.absolute,(t,s)=>{if(e.pending=!1,this[be]-=1,t)return this.emit("error",t);this[gs](e,s)})}[gs](e,t){this.readdirCache.set(e.absolute,t),e.readdir=t,this[bt]()}[bt](){if(!this[ms]){this[ms]=!0;for(let e=this[Fe].head;e!==null&&this[be]<this.jobs;e=e.next)if(this[sa](e.value),e.value.ignore){let t=e.next;this[Fe].removeNode(e),e.next=t}this[ms]=!1,this[ps]&&!this[Fe].length&&this[be]===0&&(this.zip?this.zip.end(ra):(super.write(ra),super.end()))}}get[Vt](){return this[Fe]&&this[Fe].head&&this[Fe].head.value}[Dn](e){this[Fe].shift(),this[be]-=1,this[bt]()}[sa](e){if(!e.pending){if(e.entry){e===this[Vt]&&!e.piped&&this[Es](e);return}if(e.stat||(this.statCache.has(e.absolute)?this[ds](e,this.statCache.get(e.absolute)):this[An](e)),!!e.stat&&!e.ignore&&!(!this.noDirRecurse&&e.stat.isDirectory()&&!e.readdir&&(this.readdirCache.has(e.absolute)?this[gs](e,this.readdirCache.get(e.absolute)):this[Cn](e),!e.readdir))){if(e.entry=this[na](e),!e.entry){e.ignore=!0;return}e===this[Vt]&&!e.piped&&this[Es](e)}}}[gn](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}}[na](e){this[be]+=1;try{return new this[wn](e.path,this[gn](e)).on("end",()=>this[Dn](e)).on("error",t=>this.emit("error",t))}catch(t){this.emit("error",t)}}[En](){this[Vt]&&this[Vt].entry&&this[Vt].entry.resume()}[Es](e){e.piped=!0,e.readdir&&e.readdir.forEach(i=>{let n=e.path,o=n==="./"?"":n.replace(/\/*$/,"/");this[Ds](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()}}),Fn=class extends Sn{constructor(e){super(e),this[wn]=Af}pause(){}resume(){}[An](e){let t=this.follow?"statSync":"lstatSync";this[ds](e,As[t](e.absolute))}[Cn](e,t){this[gs](e,As.readdirSync(e.absolute))}[Es](e){let t=e.entry,s=this.zip;e.readdir&&e.readdir.forEach(i=>{let n=e.path,o=n==="./"?"":n.replace(/\/*$/,"/");this[Ds](o+i)}),s?t.on("data",i=>{s.write(i)}):t.on("data",i=>{super[ua](i)})}};Sn.Sync=Fn;aa.exports=Sn});var rr=y(Sr=>{"use strict";u();var bf=Bi(),Sf=require("events").EventEmitter,X=require("fs"),vn=X.writev;if(!vn){let r=process.binding("fs"),e=r.FSReqWrap||r.FSReqCallback;vn=(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 er=Symbol("_autoClose"),de=Symbol("_close"),br=Symbol("_ended"),R=Symbol("_fd"),ca=Symbol("_finished"),st=Symbol("_flags"),kn=Symbol("_flush"),Rn=Symbol("_handleChunk"),Bn=Symbol("_makeBuf"),ks=Symbol("_mode"),ws=Symbol("_needDrain"),Xt=Symbol("_onerror"),tr=Symbol("_onopen"),_n=Symbol("_onread"),Kt=Symbol("_onwrite"),it=Symbol("_open"),Ue=Symbol("_path"),St=Symbol("_pos"),Se=Symbol("_queue"),Zt=Symbol("_read"),la=Symbol("_readSize"),rt=Symbol("_reading"),Fs=Symbol("_remain"),ha=Symbol("_size"),bs=Symbol("_write"),Yt=Symbol("_writing"),Ss=Symbol("_defaultFlag"),Qt=Symbol("_errored"),_s=class extends bf{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[Qt]=!1,this[R]=typeof t.fd=="number"?t.fd:null,this[Ue]=e,this[la]=t.readSize||16*1024*1024,this[rt]=!1,this[ha]=typeof t.size=="number"?t.size:1/0,this[Fs]=this[ha],this[er]=typeof t.autoClose=="boolean"?t.autoClose:!0,typeof this[R]=="number"?this[Zt]():this[it]()}get fd(){return this[R]}get path(){return this[Ue]}write(){throw new TypeError("this is a readable stream")}end(){throw new TypeError("this is a readable stream")}[it](){X.open(this[Ue],"r",(e,t)=>this[tr](e,t))}[tr](e,t){e?this[Xt](e):(this[R]=t,this.emit("open",t),this[Zt]())}[Bn](){return Buffer.allocUnsafe(Math.min(this[la],this[Fs]))}[Zt](){if(!this[rt]){this[rt]=!0;let e=this[Bn]();if(e.length===0)return process.nextTick(()=>this[_n](null,0,e));X.read(this[R],e,0,e.length,null,(t,s,i)=>this[_n](t,s,i))}}[_n](e,t,s){this[rt]=!1,e?this[Xt](e):this[Rn](t,s)&&this[Zt]()}[de](){if(this[er]&&typeof this[R]=="number"){let e=this[R];this[R]=null,X.close(e,t=>t?this.emit("error",t):this.emit("close"))}}[Xt](e){this[rt]=!0,this[de](),this.emit("error",e)}[Rn](e,t){let s=!1;return this[Fs]-=e,e>0&&(s=super.write(e<t.length?t.slice(0,e):t)),(e===0||this[Fs]<=0)&&(s=!1,this[de](),super.end()),s}emit(e,t){switch(e){case"prefinish":case"finish":break;case"drain":typeof this[R]=="number"&&this[Zt]();break;case"error":return this[Qt]?void 0:(this[Qt]=!0,super.emit(e,t));default:return super.emit(e,t)}}},xn=class extends _s{[it](){let e=!0;try{this[tr](null,X.openSync(this[Ue],"r")),e=!1}finally{e&&this[de]()}}[Zt](){let e=!0;try{if(!this[rt]){this[rt]=!0;do{let t=this[Bn](),s=t.length===0?0:X.readSync(this[R],t,0,t.length,null);if(!this[Rn](s,t))break}while(!0);this[rt]=!1}e=!1}finally{e&&this[de]()}}[de](){if(this[er]&&typeof this[R]=="number"){let e=this[R];this[R]=null,X.closeSync(e),this.emit("close")}}},vs=class extends Sf{constructor(e,t){t=t||{},super(t),this.readable=!1,this.writable=!0,this[Qt]=!1,this[Yt]=!1,this[br]=!1,this[ws]=!1,this[Se]=[],this[Ue]=e,this[R]=typeof t.fd=="number"?t.fd:null,this[ks]=t.mode===void 0?438:t.mode,this[St]=typeof t.start=="number"?t.start:null,this[er]=typeof t.autoClose=="boolean"?t.autoClose:!0;let s=this[St]!==null?"r+":"w";this[Ss]=t.flags===void 0,this[st]=this[Ss]?s:t.flags,this[R]===null&&this[it]()}emit(e,t){if(e==="error"){if(this[Qt])return;this[Qt]=!0}return super.emit(e,t)}get fd(){return this[R]}get path(){return this[Ue]}[Xt](e){this[de](),this[Yt]=!0,this.emit("error",e)}[it](){X.open(this[Ue],this[st],this[ks],(e,t)=>this[tr](e,t))}[tr](e,t){this[Ss]&&this[st]==="r+"&&e&&e.code==="ENOENT"?(this[st]="w",this[it]()):e?this[Xt](e):(this[R]=t,this.emit("open",t),this[kn]())}end(e,t){return e&&this.write(e,t),this[br]=!0,!this[Yt]&&!this[Se].length&&typeof this[R]=="number"&&this[Kt](null,0),this}write(e,t){return typeof e=="string"&&(e=Buffer.from(e,t)),this[br]?(this.emit("error",new Error("write() after end()")),!1):this[R]===null||this[Yt]||this[Se].length?(this[Se].push(e),this[ws]=!0,!1):(this[Yt]=!0,this[bs](e),!0)}[bs](e){X.write(this[R],e,0,e.length,this[St],(t,s)=>this[Kt](t,s))}[Kt](e,t){e?this[Xt](e):(this[St]!==null&&(this[St]+=t),this[Se].length?this[kn]():(this[Yt]=!1,this[br]&&!this[ca]?(this[ca]=!0,this[de](),this.emit("finish")):this[ws]&&(this[ws]=!1,this.emit("drain"))))}[kn](){if(this[Se].length===0)this[br]&&this[Kt](null,0);else if(this[Se].length===1)this[bs](this[Se].pop());else{let e=this[Se];this[Se]=[],vn(this[R],e,this[St],(t,s)=>this[Kt](t,s))}}[de](){if(this[er]&&typeof this[R]=="number"){let e=this[R];this[R]=null,X.close(e,t=>t?this.emit("error",t):this.emit("close"))}}},On=class extends vs{[it](){let e;if(this[Ss]&&this[st]==="r+")try{e=X.openSync(this[Ue],this[st],this[ks])}catch(t){if(t.code==="ENOENT")return this[st]="w",this[it]();throw t}else e=X.openSync(this[Ue],this[st],this[ks]);this[tr](null,e)}[de](){if(this[er]&&typeof this[R]=="number"){let e=this[R];this[R]=null,X.closeSync(e),this.emit("close")}}[bs](e){let t=!0;try{this[Kt](null,X.writeSync(this[R],e,0,e.length,this[St])),t=!1}finally{if(t)try{this[de]()}catch{}}}};Sr.ReadStream=_s;Sr.ReadStreamSync=xn;Sr.WriteStream=vs;Sr.WriteStreamSync=On});var Ls=y((y0,ya)=>{"use strict";u();var kf=us(),_f=Ht(),vf=require("events"),Rf=dn(),Bf=1024*1024,xf=is(),fa=os(),Of=Hi(),{nextTick:Tf}=require("process"),Tn=Buffer.from([31,139]),oe=Symbol("state"),kt=Symbol("writeEntry"),$e=Symbol("readEntry"),Pn=Symbol("nextEntry"),pa=Symbol("processEntry"),ue=Symbol("extendedHeader"),kr=Symbol("globalExtendedHeader"),nt=Symbol("meta"),ma=Symbol("emitMeta"),O=Symbol("buffer"),We=Symbol("queue"),_t=Symbol("ended"),da=Symbol("emittedEnd"),vt=Symbol("emit"),Q=Symbol("unzip"),Rs=Symbol("consumeChunk"),Bs=Symbol("consumeChunkSub"),Ln=Symbol("consumeBody"),Da=Symbol("consumeMeta"),ga=Symbol("consumeHeader"),xs=Symbol("consuming"),Nn=Symbol("bufferConcat"),Mn=Symbol("maybeEnd"),_r=Symbol("writing"),ot=Symbol("aborted"),Os=Symbol("onDone"),Rt=Symbol("sawValidEntry"),Ts=Symbol("sawNullBlock"),Ps=Symbol("sawEOF"),Ea=Symbol("closeStream"),Pf=r=>!0;ya.exports=kf(class extends vf{constructor(e){e=e||{},super(e),this.file=e.file||"",this[Rt]=null,this.on(Os,t=>{(this[oe]==="begin"||this[Rt]===!1)&&this.warn("TAR_BAD_ARCHIVE","Unrecognized archive format")}),e.ondone?this.on(Os,e.ondone):this.on(Os,t=>{this.emit("prefinish"),this.emit("finish"),this.emit("end")}),this.strict=!!e.strict,this.maxMetaEntrySize=e.maxMetaEntrySize||Bf,this.filter=typeof e.filter=="function"?e.filter:Pf,this.writable=!0,this.readable=!1,this[We]=new Rf,this[O]=null,this[$e]=null,this[kt]=null,this[oe]="begin",this[nt]="",this[ue]=null,this[kr]=null,this[_t]=!1,this[Q]=null,this[ot]=!1,this[Ts]=!1,this[Ps]=!1,this.on("end",()=>this[Ea]()),typeof e.onwarn=="function"&&this.on("warn",e.onwarn),typeof e.onentry=="function"&&this.on("entry",e.onentry)}[ga](e,t){this[Rt]===null&&(this[Rt]=!1);let s;try{s=new _f(e,t,this[ue],this[kr])}catch(i){return this.warn("TAR_ENTRY_INVALID",i)}if(s.nullBlock)this[Ts]?(this[Ps]=!0,this[oe]==="begin"&&(this[oe]="header"),this[vt]("eof")):(this[Ts]=!0,this[vt]("nullBlock"));else if(this[Ts]=!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[kt]=new xf(s,this[ue],this[kr]);if(!this[Rt])if(n.remain){let o=()=>{n.invalid||(this[Rt]=!0)};n.on("end",o)}else this[Rt]=!0;n.meta?n.size>this.maxMetaEntrySize?(n.ignore=!0,this[vt]("ignoredEntry",n),this[oe]="ignore",n.resume()):n.size>0&&(this[nt]="",n.on("data",o=>this[nt]+=o),this[oe]="meta"):(this[ue]=null,n.ignore=n.ignore||!this.filter(n.path,n),n.ignore?(this[vt]("ignoredEntry",n),this[oe]=n.remain?"ignore":"header",n.resume()):(n.remain?this[oe]="body":(this[oe]="header",n.end()),this[$e]?this[We].push(n):(this[We].push(n),this[Pn]())))}}}[Ea](){Tf(()=>this.emit("close"))}[pa](e){let t=!0;return e?Array.isArray(e)?this.emit.apply(this,e):(this[$e]=e,this.emit("entry",e),e.emittedEnd||(e.on("end",s=>this[Pn]()),t=!1)):(this[$e]=null,t=!1),t}[Pn](){do;while(this[pa](this[We].shift()));if(!this[We].length){let e=this[$e];!e||e.flowing||e.size===e.remain?this[_r]||this.emit("drain"):e.once("drain",s=>this.emit("drain"))}}[Ln](e,t){let s=this[kt],i=s.blockRemain,n=i>=e.length&&t===0?e:e.slice(t,t+i);return s.write(n),s.blockRemain||(this[oe]="header",this[kt]=null,s.end()),n.length}[Da](e,t){let s=this[kt],i=this[Ln](e,t);return this[kt]||this[ma](s),i}[vt](e,t,s){!this[We].length&&!this[$e]?this.emit(e,t,s):this[We].push([e,t,s])}[ma](e){switch(this[vt]("meta",this[nt]),e.type){case"ExtendedHeader":case"OldExtendedHeader":this[ue]=fa.parse(this[nt],this[ue],!1);break;case"GlobalExtendedHeader":this[kr]=fa.parse(this[nt],this[kr],!0);break;case"NextFileHasLongPath":case"OldGnuLongPath":this[ue]=this[ue]||Object.create(null),this[ue].path=this[nt].replace(/\0.*/,"");break;case"NextFileHasLongLinkpath":this[ue]=this[ue]||Object.create(null),this[ue].linkpath=this[nt].replace(/\0.*/,"");break;default:throw new Error("unknown meta: "+e.type)}}abort(e){this[ot]=!0,this.emit("abort",e),this.warn("TAR_ABORT",e,{recoverable:!1})}write(e){if(this[ot])return;if(this[Q]===null&&e){if(this[O]&&(e=Buffer.concat([this[O],e]),this[O]=null),e.length<Tn.length)return this[O]=e,!0;for(let s=0;this[Q]===null&&s<Tn.length;s++)e[s]!==Tn[s]&&(this[Q]=!1);if(this[Q]===null){let s=this[_t];this[_t]=!1,this[Q]=new Of.Unzip,this[Q].on("data",n=>this[Rs](n)),this[Q].on("error",n=>this.abort(n)),this[Q].on("end",n=>{this[_t]=!0,this[Rs]()}),this[_r]=!0;let i=this[Q][s?"end":"write"](e);return this[_r]=!1,i}}this[_r]=!0,this[Q]?this[Q].write(e):this[Rs](e),this[_r]=!1;let t=this[We].length?!1:this[$e]?this[$e].flowing:!0;return!t&&!this[We].length&&this[$e].once("drain",s=>this.emit("drain")),t}[Nn](e){e&&!this[ot]&&(this[O]=this[O]?Buffer.concat([this[O],e]):e)}[Mn](){if(this[_t]&&!this[da]&&!this[ot]&&!this[xs]){this[da]=!0;let e=this[kt];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[vt](Os)}}[Rs](e){if(this[xs])this[Nn](e);else if(!e&&!this[O])this[Mn]();else{if(this[xs]=!0,this[O]){this[Nn](e);let t=this[O];this[O]=null,this[Bs](t)}else this[Bs](e);for(;this[O]&&this[O].length>=512&&!this[ot]&&!this[Ps];){let t=this[O];this[O]=null,this[Bs](t)}this[xs]=!1}(!this[O]||this[_t])&&this[Mn]()}[Bs](e){let t=0,s=e.length;for(;t+512<=s&&!this[ot]&&!this[Ps];)switch(this[oe]){case"begin":case"header":this[ga](e,t),t+=512;break;case"ignore":case"body":t+=this[Ln](e,t);break;case"meta":t+=this[Da](e,t);break;default:throw new Error("invalid state: "+this[oe])}t<s&&(this[O]?this[O]=Buffer.concat([e.slice(t),this[O]]):this[O]=e.slice(t))}end(e){this[ot]||(this[Q]?this[Q].end(e):(this[_t]=!0,this.write(e)))}})});var Ns=y((A0,Fa)=>{"use strict";u();var Lf=jt(),Ca=Ls(),sr=require("fs"),Nf=rr(),Aa=require("path"),In=Jt();Fa.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&&If(s,e),s.noResume||Mf(s),s.file&&s.sync?jf(s):s.file?qf(s,t):wa(s)};var Mf=r=>{let e=r.onentry;r.onentry=e?t=>{e(t),t.resume()}:t=>t.resume()},If=(r,e)=>{let t=new Map(e.map(n=>[In(n),!0])),s=r.filter,i=(n,o)=>{let a=o||Aa.parse(n).root||".",l=n===a?!1:t.has(n)?t.get(n):i(Aa.dirname(n),a);return t.set(n,l),l};r.filter=s?(n,o)=>s(n,o)&&i(In(n)):n=>i(In(n))},jf=r=>{let e=wa(r),t=r.file,s=!0,i;try{let n=sr.statSync(t),o=r.maxReadSize||16*1024*1024;if(n.size<o)e.end(sr.readFileSync(t));else{let a=0,l=Buffer.allocUnsafe(o);for(i=sr.openSync(t,"r");a<n.size;){let c=sr.readSync(i,l,0,o,a);a+=c,e.write(l.slice(0,c))}e.end()}s=!1}finally{if(s&&i)try{sr.closeSync(i)}catch{}}},qf=(r,e)=>{let t=new Ca(r),s=r.maxReadSize||16*1024*1024,i=r.file,n=new Promise((o,a)=>{t.on("error",a),t.on("end",o),sr.stat(i,(l,c)=>{if(l)a(l);else{let h=new Nf.ReadStream(i,{readSize:s,size:c.size});h.on("error",a),h.pipe(t)}})});return e?n.then(e,e):n},wa=r=>new Ca(r)});var Ra=y((C0,va)=>{"use strict";u();var Uf=jt(),Ms=Cs(),ba=rr(),Sa=Ns(),ka=require("path");va.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=Uf(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?$f(s,e):s.file?Wf(s,e,t):s.sync?zf(s,e):Gf(s,e)};var $f=(r,e)=>{let t=new Ms.Sync(r),s=new ba.WriteStreamSync(r.file,{mode:r.mode||438});t.pipe(s),_a(t,e)},Wf=(r,e,t)=>{let s=new Ms(r),i=new ba.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 jn(s,e),t?n.then(t,t):n},_a=(r,e)=>{e.forEach(t=>{t.charAt(0)==="@"?Sa({file:ka.resolve(r.cwd,t.slice(1)),sync:!0,noResume:!0,onentry:s=>r.add(s)}):r.add(t)}),r.end()},jn=(r,e)=>{for(;e.length;){let t=e.shift();if(t.charAt(0)==="@")return Sa({file:ka.resolve(r.cwd,t.slice(1)),noResume:!0,onentry:s=>r.add(s)}).then(s=>jn(r,e));r.add(t)}r.end()},zf=(r,e)=>{let t=new Ms.Sync(r);return _a(t,e),t},Gf=(r,e)=>{let t=new Ms(r);return jn(t,e),t}});var qn=y((w0,Na)=>{"use strict";u();var Hf=jt(),Ba=Cs(),re=require("fs"),xa=rr(),Oa=Ns(),Ta=require("path"),Pa=Ht();Na.exports=(r,e,t)=>{let s=Hf(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?Jf(s,e):Yf(s,e,t)};var Jf=(r,e)=>{let t=new Ba.Sync(r),s=!0,i,n;try{try{i=re.openSync(r.file,"r+")}catch(l){if(l.code==="ENOENT")i=re.openSync(r.file,"w+");else throw l}let o=re.fstatSync(i),a=Buffer.alloc(512);e:for(n=0;n<o.size;n+=512){for(let h=0,d=0;h<512;h+=d){if(d=re.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(!d)break e}let l=new Pa(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,Vf(r,t,n,i,e)}finally{if(s)try{re.closeSync(i)}catch{}}},Vf=(r,e,t,s,i)=>{let n=new xa.WriteStreamSync(r.file,{fd:s,start:t});e.pipe(n),Kf(e,i)},Yf=(r,e,t)=>{e=Array.from(e);let s=new Ba(r),i=(o,a,l)=>{let c=(C,T)=>{C?re.close(o,b=>l(C)):l(null,T)},h=0;if(a===0)return c(null,0);let d=0,p=Buffer.alloc(512),E=(C,T)=>{if(C)return c(C);if(d+=T,d<512&&T)return re.read(o,p,d,p.length-d,h+d,E);if(h===0&&p[0]===31&&p[1]===139)return c(new Error("cannot append to compressed archives"));if(d<512)return c(null,h);let b=new Pa(p);if(!b.cksumValid)return c(null,h);let x=512*Math.ceil(b.size/512);if(h+x+512>a||(h+=x+512,h>=a))return c(null,h);r.mtimeCache&&r.mtimeCache.set(b.path,b.mtime),d=0,re.read(o,p,0,512,h,E)};re.read(o,p,0,512,h,E)},n=new Promise((o,a)=>{s.on("error",a);let l="r+",c=(h,d)=>{if(h&&h.code==="ENOENT"&&l==="r+")return l="w+",re.open(r.file,l,c);if(h)return a(h);re.fstat(d,(p,E)=>{if(p)return re.close(d,()=>a(p));i(d,E.size,(C,T)=>{if(C)return a(C);let b=new xa.WriteStream(r.file,{fd:d,start:T});s.pipe(b),b.on("error",a),b.on("close",o),La(s,e)})})};re.open(r.file,l,c)});return t?n.then(t,t):n},Kf=(r,e)=>{e.forEach(t=>{t.charAt(0)==="@"?Oa({file:Ta.resolve(r.cwd,t.slice(1)),sync:!0,noResume:!0,onentry:s=>r.add(s)}):r.add(t)}),r.end()},La=(r,e)=>{for(;e.length;){let t=e.shift();if(t.charAt(0)==="@")return Oa({file:Ta.resolve(r.cwd,t.slice(1)),noResume:!0,onentry:s=>r.add(s)}).then(s=>La(r,e));r.add(t)}r.end()}});var Ia=y((F0,Ma)=>{"use strict";u();var Zf=jt(),Xf=qn();Ma.exports=(r,e,t)=>{let s=Zf(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),Qf(s),Xf(s,e,t)};var Qf=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 Ua=y((b0,qa)=>{u();var{promisify:ja}=require("util"),ut=require("fs"),ep=r=>{if(!r)r={mode:511,fs:ut};else if(typeof r=="object")r={mode:511,fs:ut,...r};else if(typeof r=="number")r={mode:r,fs:ut};else if(typeof r=="string")r={mode:parseInt(r,8),fs:ut};else throw new TypeError("invalid options argument");return r.mkdir=r.mkdir||r.fs.mkdir||ut.mkdir,r.mkdirAsync=ja(r.mkdir),r.stat=r.stat||r.fs.stat||ut.stat,r.statAsync=ja(r.stat),r.statSync=r.statSync||r.fs.statSync||ut.statSync,r.mkdirSync=r.mkdirSync||r.fs.mkdirSync||ut.mkdirSync,r};qa.exports=ep});var Wa=y((S0,$a)=>{u();var tp=process.env.__TESTING_MKDIRP_PLATFORM__||process.platform,{resolve:rp,parse:sp}=require("path"),ip=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=rp(r),tp==="win32"){let e=/[*|"<>?:]/,{root:t}=sp(r);if(e.test(r.substr(t.length)))throw Object.assign(new Error("Illegal characters in path."),{path:r,code:"EINVAL"})}return r};$a.exports=ip});var Va=y((k0,Ja)=>{u();var{dirname:za}=require("path"),Ga=(r,e,t=void 0)=>t===e?Promise.resolve():r.statAsync(e).then(s=>s.isDirectory()?t:void 0,s=>s.code==="ENOENT"?Ga(r,za(e),e):void 0),Ha=(r,e,t=void 0)=>{if(t!==e)try{return r.statSync(e).isDirectory()?t:void 0}catch(s){return s.code==="ENOENT"?Ha(r,za(e),e):void 0}};Ja.exports={findMade:Ga,findMadeSync:Ha}});var Wn=y((_0,Ka)=>{u();var{dirname:Ya}=require("path"),Un=(r,e,t)=>{e.recursive=!1;let s=Ya(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 Un(s,e).then(n=>Un(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})})},$n=(r,e,t)=>{let s=Ya(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 $n(r,e,$n(s,e,t));if(i.code!=="EEXIST"&&i.code!=="EROFS")throw i;try{if(!e.statSync(r).isDirectory())throw i}catch{throw i}}};Ka.exports={mkdirpManual:Un,mkdirpManualSync:$n}});var Qa=y((v0,Xa)=>{u();var{dirname:Za}=require("path"),{findMade:np,findMadeSync:op}=Va(),{mkdirpManual:up,mkdirpManualSync:ap}=Wn(),cp=(r,e)=>(e.recursive=!0,Za(r)===r?e.mkdirAsync(r,e):np(e,r).then(s=>e.mkdirAsync(r,e).then(()=>s).catch(i=>{if(i.code==="ENOENT")return up(r,e);throw i}))),lp=(r,e)=>{if(e.recursive=!0,Za(r)===r)return e.mkdirSync(r,e);let s=op(e,r);try{return e.mkdirSync(r,e),s}catch(i){if(i.code==="ENOENT")return ap(r,e);throw i}};Xa.exports={mkdirpNative:cp,mkdirpNativeSync:lp}});var sc=y((R0,rc)=>{u();var ec=require("fs"),hp=process.env.__TESTING_MKDIRP_NODE_VERSION__||process.version,zn=hp.replace(/^v/,"").split("."),tc=+zn[0]>10||+zn[0]==10&&+zn[1]>=12,fp=tc?r=>r.mkdir===ec.mkdir:()=>!1,pp=tc?r=>r.mkdirSync===ec.mkdirSync:()=>!1;rc.exports={useNative:fp,useNativeSync:pp}});var cc=y((B0,ac)=>{u();var ir=Ua(),nr=Wa(),{mkdirpNative:ic,mkdirpNativeSync:nc}=Qa(),{mkdirpManual:oc,mkdirpManualSync:uc}=Wn(),{useNative:mp,useNativeSync:dp}=sc(),or=(r,e)=>(r=nr(r),e=ir(e),mp(e)?ic(r,e):oc(r,e)),Dp=(r,e)=>(r=nr(r),e=ir(e),dp(e)?nc(r,e):uc(r,e));or.sync=Dp;or.native=(r,e)=>ic(nr(r),ir(e));or.manual=(r,e)=>oc(nr(r),ir(e));or.nativeSync=(r,e)=>nc(nr(r),ir(e));or.manualSync=(r,e)=>uc(nr(r),ir(e));ac.exports=or});var Dc=y((x0,dc)=>{"use strict";u();var ae=require("fs"),Bt=require("path"),gp=ae.lchown?"lchown":"chown",Ep=ae.lchownSync?"lchownSync":"chownSync",hc=ae.lchown&&!process.version.match(/v1[1-9]+\./)&&!process.version.match(/v10\.[6-9]/),lc=(r,e,t)=>{try{return ae[Ep](r,e,t)}catch(s){if(s.code!=="ENOENT")throw s}},yp=(r,e,t)=>{try{return ae.chownSync(r,e,t)}catch(s){if(s.code!=="ENOENT")throw s}},Ap=hc?(r,e,t,s)=>i=>{!i||i.code!=="EISDIR"?s(i):ae.chown(r,e,t,s)}:(r,e,t,s)=>s,Gn=hc?(r,e,t)=>{try{return lc(r,e,t)}catch(s){if(s.code!=="EISDIR")throw s;yp(r,e,t)}}:(r,e,t)=>lc(r,e,t),Cp=process.version,fc=(r,e,t)=>ae.readdir(r,e,t),wp=(r,e)=>ae.readdirSync(r,e);/^v4\./.test(Cp)&&(fc=(r,e,t)=>ae.readdir(r,t));var Is=(r,e,t,s)=>{ae[gp](r,e,t,Ap(r,e,t,i=>{s(i&&i.code!=="ENOENT"?i:null)}))},pc=(r,e,t,s,i)=>{if(typeof e=="string")return ae.lstat(Bt.resolve(r,e),(n,o)=>{if(n)return i(n.code!=="ENOENT"?n:null);o.name=e,pc(r,o,t,s,i)});if(e.isDirectory())Hn(Bt.resolve(r,e.name),t,s,n=>{if(n)return i(n);let o=Bt.resolve(r,e.name);Is(o,t,s,i)});else{let n=Bt.resolve(r,e.name);Is(n,t,s,i)}},Hn=(r,e,t,s)=>{fc(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 Is(r,e,t,s);let o=n.length,a=null,l=c=>{if(!a){if(c)return s(a=c);if(--o===0)return Is(r,e,t,s)}};n.forEach(c=>pc(r,c,e,t,l))})},Fp=(r,e,t,s)=>{if(typeof e=="string")try{let i=ae.lstatSync(Bt.resolve(r,e));i.name=e,e=i}catch(i){if(i.code==="ENOENT")return;throw i}e.isDirectory()&&mc(Bt.resolve(r,e.name),t,s),Gn(Bt.resolve(r,e.name),t,s)},mc=(r,e,t)=>{let s;try{s=wp(r,{withFileTypes:!0})}catch(i){if(i.code==="ENOENT")return;if(i.code==="ENOTDIR"||i.code==="ENOTSUP")return Gn(r,e,t);throw i}return s&&s.length&&s.forEach(i=>Fp(r,i,e,t)),Gn(r,e,t)};dc.exports=Hn;Hn.sync=mc});var Ac=y((O0,Jn)=>{"use strict";u();var gc=cc(),ce=require("fs"),js=require("path"),Ec=Dc(),De=zt(),qs=class extends Error{constructor(e,t){super("Cannot extract through symbolic link"),this.path=t,this.symlink=e}get name(){return"SylinkError"}},Us=class extends Error{constructor(e,t){super(t+": Cannot cd into '"+e+"'"),this.path=e,this.code=t}get name(){return"CwdError"}},$s=(r,e)=>r.get(De(e)),vr=(r,e,t)=>r.set(De(e),t),bp=(r,e)=>{ce.stat(r,(t,s)=>{(t||!s.isDirectory())&&(t=new Us(r,t&&t.code||"ENOTDIR")),e(t)})};Jn.exports=(r,e,t)=>{r=De(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,d=e.cache,p=De(e.cwd),E=(b,x)=>{b?t(b):(vr(d,r,!0),x&&l?Ec(x,o,a,dt=>E(dt)):n?ce.chmod(r,i,t):t())};if(d&&$s(d,r)===!0)return E();if(r===p)return bp(r,E);if(c)return gc(r,{mode:i}).then(b=>E(null,b),E);let T=De(js.relative(p,r)).split("/");Ws(p,T,i,d,h,p,null,E)};var Ws=(r,e,t,s,i,n,o,a)=>{if(!e.length)return a(null,o);let l=e.shift(),c=De(js.resolve(r+"/"+l));if($s(s,c))return Ws(c,e,t,s,i,n,o,a);ce.mkdir(c,t,yc(c,e,t,s,i,n,o,a))},yc=(r,e,t,s,i,n,o,a)=>l=>{l?ce.lstat(r,(c,h)=>{if(c)c.path=c.path&&De(c.path),a(c);else if(h.isDirectory())Ws(r,e,t,s,i,n,o,a);else if(i)ce.unlink(r,d=>{if(d)return a(d);ce.mkdir(r,t,yc(r,e,t,s,i,n,o,a))});else{if(h.isSymbolicLink())return a(new qs(r,r+"/"+e.join("/")));a(l)}}):(o=o||r,Ws(r,e,t,s,i,n,o,a))},Sp=r=>{let e=!1,t="ENOTDIR";try{e=ce.statSync(r).isDirectory()}catch(s){t=s.code}finally{if(!e)throw new Us(r,t)}};Jn.exports.sync=(r,e)=>{r=De(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,d=De(e.cwd),p=b=>{vr(h,r,!0),b&&a&&Ec.sync(b,n,o),i&&ce.chmodSync(r,s)};if(h&&$s(h,r)===!0)return p();if(r===d)return Sp(d),p();if(l)return p(gc.sync(r,s));let C=De(js.relative(d,r)).split("/"),T=null;for(let b=C.shift(),x=d;b&&(x+="/"+b);b=C.shift())if(x=De(js.resolve(x)),!$s(h,x))try{ce.mkdirSync(x,s),T=T||x,vr(h,x,!0)}catch{let ge=ce.lstatSync(x);if(ge.isDirectory()){vr(h,x,!0);continue}else if(c){ce.unlinkSync(x),ce.mkdirSync(x,s),T=T||x,vr(h,x,!0);continue}else if(ge.isSymbolicLink())return new qs(x,x+"/"+C.join("/"))}return p(T)}});var Yn=y((T0,Cc)=>{u();var Vn=Object.create(null),{hasOwnProperty:kp}=Object.prototype;Cc.exports=r=>(kp.call(Vn,r)||(Vn[r]=r.normalize("NFKD")),Vn[r])});var Sc=y((P0,bc)=>{u();var wc=require("assert"),_p=Yn(),vp=Jt(),{join:Fc}=require("path"),Rp=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,Bp=Rp==="win32";bc.exports=()=>{let r=new Map,e=new Map,t=c=>c.split("/").slice(0,-1).reduce((d,p)=>(d.length&&(p=Fc(d[d.length-1],p)),d.push(p||"/"),d),[]),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(d=>r.get(d)),dirs:[...h.dirs].map(d=>r.get(d))}},n=c=>{let{paths:h,dirs:d}=i(c);return h.every(p=>p[0]===c)&&d.every(p=>p[0]instanceof Set&&p[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:d}=e.get(c),p=new Set;return h.forEach(E=>{let C=r.get(E);wc.equal(C[0],c),C.length===1?r.delete(E):(C.shift(),typeof C[0]=="function"?p.add(C[0]):C[0].forEach(T=>p.add(T)))}),d.forEach(E=>{let C=r.get(E);wc(C[0]instanceof Set),C[0].size===1&&C.length===1?r.delete(E):C[0].size===1?(C.shift(),p.add(C[0])):C[0].delete(c)}),s.delete(c),p.forEach(E=>o(E)),!0};return{check:n,reserve:(c,h)=>{c=Bp?["win32 parallelization disabled"]:c.map(p=>_p(vp(Fc(p))).toLowerCase());let d=new Set(c.map(p=>t(p)).reduce((p,E)=>p.concat(E)));return e.set(h,{dirs:d,paths:c}),c.forEach(p=>{let E=r.get(p);E?E.push(h):r.set(p,[h])}),d.forEach(p=>{let E=r.get(p);E?E[E.length-1]instanceof Set?E[E.length-1].add(h):E.push(new Set([h])):r.set(p,[new Set([h])])}),o(h)}}}});var vc=y((L0,_c)=>{u();var xp=process.env.__FAKE_PLATFORM__||process.platform,Op=xp==="win32",Tp=global.__FAKE_TESTING_FS__||require("fs"),{O_CREAT:Pp,O_TRUNC:Lp,O_WRONLY:Np,UV_FS_O_FILEMAP:kc=0}=Tp.constants,Mp=Op&&!!kc,Ip=512*1024,jp=kc|Lp|Pp|Np;_c.exports=Mp?r=>r<Ip?jp:"w":()=>"w"});var io=y((N0,$c)=>{"use strict";u();var qp=require("assert"),Up=Ls(),_=require("fs"),$p=rr(),ze=require("path"),jc=Ac(),Rc=rn(),Wp=Sc(),zp=sn(),se=zt(),Gp=Jt(),Hp=Yn(),Bc=Symbol("onEntry"),Xn=Symbol("checkFs"),xc=Symbol("checkFs2"),Hs=Symbol("pruneCache"),Qn=Symbol("isReusable"),le=Symbol("makeFs"),eo=Symbol("file"),to=Symbol("directory"),Js=Symbol("link"),Oc=Symbol("symlink"),Tc=Symbol("hardlink"),Pc=Symbol("unsupported"),Lc=Symbol("checkPath"),at=Symbol("mkdir"),G=Symbol("onError"),zs=Symbol("pending"),Nc=Symbol("pend"),ur=Symbol("unpend"),Kn=Symbol("ended"),Zn=Symbol("maybeClose"),ro=Symbol("skip"),Rr=Symbol("doChown"),Br=Symbol("uid"),xr=Symbol("gid"),Or=Symbol("checkedCwd"),qc=require("crypto"),Uc=vc(),Jp=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,Tr=Jp==="win32",Vp=(r,e)=>{if(!Tr)return _.unlink(r,e);let t=r+".DELETE."+qc.randomBytes(16).toString("hex");_.rename(r,t,s=>{if(s)return e(s);_.unlink(t,e)})},Yp=r=>{if(!Tr)return _.unlinkSync(r);let e=r+".DELETE."+qc.randomBytes(16).toString("hex");_.renameSync(r,e),_.unlinkSync(e)},Mc=(r,e,t)=>r===r>>>0?r:e===e>>>0?e:t,Ic=r=>Hp(Gp(se(r))).toLowerCase(),Kp=(r,e)=>{e=Ic(e);for(let t of r.keys()){let s=Ic(t);(s===e||s.indexOf(e+"/")===0)&&r.delete(t)}},Zp=r=>{for(let e of r.keys())r.delete(e)},Pr=class extends Up{constructor(e){if(e||(e={}),e.ondone=t=>{this[Kn]=!0,this[Zn]()},super(e),this[Or]=!1,this.reservations=Wp(),this.transform=typeof e.transform=="function"?e.transform:null,this.writable=!0,this.readable=!1,this[zs]=0,this[Kn]=!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||Tr,this.newer=!!e.newer,this.keep=!!e.keep,this.noMtime=!!e.noMtime,this.preservePaths=!!e.preservePaths,this.unlink=!!e.unlink,this.cwd=se(ze.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[Bc](t))}warn(e,t,s={}){return(e==="TAR_BAD_ARCHIVE"||e==="TAR_ABORT")&&(s.recoverable=!1),super.warn(e,t,s)}[Zn](){this[Kn]&&this[zs]===0&&(this.emit("prefinish"),this.emit("finish"),this.emit("end"))}[Lc](e){if(this.strip){let t=se(e.path).split("/");if(t.length<this.strip)return!1;if(e.path=t.slice(this.strip).join("/"),e.type==="Link"){let s=se(e.linkpath).split("/");if(s.length>=this.strip)e.linkpath=s.slice(this.strip).join("/");else return!1}}if(!this.preservePaths){let t=se(e.path),s=t.split("/");if(s.includes("..")||Tr&&/^[a-z]:\.\.$/i.test(s[0]))return this.warn("TAR_ENTRY_ERROR","path contains '..'",{entry:e,path:t}),!1;let[i,n]=zp(t);i&&(e.path=n,this.warn("TAR_ENTRY_INFO",`stripping ${i} from absolute path`,{entry:e,path:t}))}if(ze.isAbsolute(e.path)?e.absolute=se(ze.resolve(e.path)):e.absolute=se(ze.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:se(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}=ze.win32.parse(e.absolute);e.absolute=t+Rc.encode(e.absolute.slice(t.length));let{root:s}=ze.win32.parse(e.path);e.path=s+Rc.encode(e.path.slice(s.length))}return!0}[Bc](e){if(!this[Lc](e))return e.resume();switch(qp.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[Xn](e);case"CharacterDevice":case"BlockDevice":case"FIFO":default:return this[Pc](e)}}[G](e,t){e.name==="CwdError"?this.emit("error",e):(this.warn("TAR_ENTRY_ERROR",e,{entry:t}),this[ur](),t.resume())}[at](e,t,s){jc(se(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)}[Rr](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}[Br](e){return Mc(this.uid,e.uid,this.processUid)}[xr](e){return Mc(this.gid,e.gid,this.processGid)}[eo](e,t){let s=e.mode&4095||this.fmode,i=new $p.WriteStream(e.absolute,{flags:Uc(e.size),mode:s,autoClose:!1});i.on("error",l=>{i.fd&&_.close(i.fd,()=>{}),i.write=()=>!0,this[G](l,e),t()});let n=1,o=l=>{if(l){i.fd&&_.close(i.fd,()=>{}),this[G](l,e),t();return}--n===0&&_.close(i.fd,c=>{c?this[G](c,e):this[ur](),t()})};i.on("finish",l=>{let c=e.absolute,h=i.fd;if(e.mtime&&!this.noMtime){n++;let d=e.atime||new Date,p=e.mtime;_.futimes(h,d,p,E=>E?_.utimes(c,d,p,C=>o(C&&E)):o())}if(this[Rr](e)){n++;let d=this[Br](e),p=this[xr](e);_.fchown(h,d,p,E=>E?_.chown(c,d,p,C=>o(C&&E)):o())}o()});let a=this.transform&&this.transform(e)||e;a!==e&&(a.on("error",l=>{this[G](l,e),t()}),e.pipe(a)),a.pipe(i)}[to](e,t){let s=e.mode&4095||this.dmode;this[at](e.absolute,s,i=>{if(i){this[G](i,e),t();return}let n=1,o=a=>{--n===0&&(t(),this[ur](),e.resume())};e.mtime&&!this.noMtime&&(n++,_.utimes(e.absolute,e.atime||new Date,e.mtime,o)),this[Rr](e)&&(n++,_.chown(e.absolute,this[Br](e),this[xr](e),o)),o()})}[Pc](e){e.unsupported=!0,this.warn("TAR_ENTRY_UNSUPPORTED",`unsupported entry type: ${e.type}`,{entry:e}),e.resume()}[Oc](e,t){this[Js](e,e.linkpath,"symlink",t)}[Tc](e,t){let s=se(ze.resolve(this.cwd,e.linkpath));this[Js](e,s,"link",t)}[Nc](){this[zs]++}[ur](){this[zs]--,this[Zn]()}[ro](e){this[ur](),e.resume()}[Qn](e,t){return e.type==="File"&&!this.unlink&&t.isFile()&&t.nlink<=1&&!Tr}[Xn](e){this[Nc]();let t=[e.path];e.linkpath&&t.push(e.linkpath),this.reservations.reserve(t,s=>this[xc](e,s))}[Hs](e){e.type==="SymbolicLink"?Zp(this.dirCache):e.type!=="Directory"&&Kp(this.dirCache,e.absolute)}[xc](e,t){this[Hs](e);let s=a=>{this[Hs](e),t(a)},i=()=>{this[at](this.cwd,this.dmode,a=>{if(a){this[G](a,e),s();return}this[Or]=!0,n()})},n=()=>{if(e.absolute!==this.cwd){let a=se(ze.dirname(e.absolute));if(a!==this.cwd)return this[at](a,this.dmode,l=>{if(l){this[G](l,e),s();return}o()})}o()},o=()=>{_.lstat(e.absolute,(a,l)=>{if(l&&(this.keep||this.newer&&l.mtime>e.mtime)){this[ro](e),s();return}if(a||this[Qn](e,l))return this[le](null,e,s);if(l.isDirectory()){if(e.type==="Directory"){let c=!this.noChmod&&e.mode&&(l.mode&4095)!==e.mode,h=d=>this[le](d,e,s);return c?_.chmod(e.absolute,e.mode,h):h()}if(e.absolute!==this.cwd)return _.rmdir(e.absolute,c=>this[le](c,e,s))}if(e.absolute===this.cwd)return this[le](null,e,s);Vp(e.absolute,c=>this[le](c,e,s))})};this[Or]?n():i()}[le](e,t,s){if(e){this[G](e,t),s();return}switch(t.type){case"File":case"OldFile":case"ContiguousFile":return this[eo](t,s);case"Link":return this[Tc](t,s);case"SymbolicLink":return this[Oc](t,s);case"Directory":case"GNUDumpDir":return this[to](t,s)}}[Js](e,t,s,i){_[s](t,e.absolute,n=>{n?this[G](n,e):(this[ur](),e.resume()),i()})}},Gs=r=>{try{return[null,r()]}catch(e){return[e,null]}},so=class extends Pr{[le](e,t){return super[le](e,t,()=>{})}[Xn](e){if(this[Hs](e),!this[Or]){let n=this[at](this.cwd,this.dmode);if(n)return this[G](n,e);this[Or]=!0}if(e.absolute!==this.cwd){let n=se(ze.dirname(e.absolute));if(n!==this.cwd){let o=this[at](n,this.dmode);if(o)return this[G](o,e)}}let[t,s]=Gs(()=>_.lstatSync(e.absolute));if(s&&(this.keep||this.newer&&s.mtime>e.mtime))return this[ro](e);if(t||this[Qn](e,s))return this[le](null,e);if(s.isDirectory()){if(e.type==="Directory"){let o=!this.noChmod&&e.mode&&(s.mode&4095)!==e.mode,[a]=o?Gs(()=>{_.chmodSync(e.absolute,e.mode)}):[];return this[le](a,e)}let[n]=Gs(()=>_.rmdirSync(e.absolute));this[le](n,e)}let[i]=e.absolute===this.cwd?[]:Gs(()=>Yp(e.absolute));this[le](i,e)}[eo](e,t){let s=e.mode&4095||this.fmode,i=a=>{let l;try{_.closeSync(n)}catch(c){l=c}(a||l)&&this[G](a||l,e),t()},n;try{n=_.openSync(e.absolute,Uc(e.size),s)}catch(a){return i(a)}let o=this.transform&&this.transform(e)||e;o!==e&&(o.on("error",a=>this[G](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(d){try{_.utimesSync(e.absolute,c,h)}catch{l=d}}}if(this[Rr](e)){let c=this[Br](e),h=this[xr](e);try{_.fchownSync(n,c,h)}catch(d){try{_.chownSync(e.absolute,c,h)}catch{l=l||d}}}i(l)})}[to](e,t){let s=e.mode&4095||this.dmode,i=this[at](e.absolute,s);if(i){this[G](i,e),t();return}if(e.mtime&&!this.noMtime)try{_.utimesSync(e.absolute,e.atime||new Date,e.mtime)}catch{}if(this[Rr](e))try{_.chownSync(e.absolute,this[Br](e),this[xr](e))}catch{}t(),e.resume()}[at](e,t){try{return jc.sync(se(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}}[Js](e,t,s,i){try{_[s+"Sync"](t,e.absolute),i(),e.resume()}catch(n){return this[G](n,e)}}};Pr.Sync=so;$c.exports=Pr});var Jc=y((M0,Hc)=>{"use strict";u();var Xp=jt(),Vs=io(),zc=require("fs"),Gc=rr(),Wc=require("path"),no=Jt();Hc.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=Xp(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&&Qp(s,e),s.file&&s.sync?em(s):s.file?tm(s,t):s.sync?rm(s):sm(s)};var Qp=(r,e)=>{let t=new Map(e.map(n=>[no(n),!0])),s=r.filter,i=(n,o)=>{let a=o||Wc.parse(n).root||".",l=n===a?!1:t.has(n)?t.get(n):i(Wc.dirname(n),a);return t.set(n,l),l};r.filter=s?(n,o)=>s(n,o)&&i(no(n)):n=>i(no(n))},em=r=>{let e=new Vs.Sync(r),t=r.file,s=zc.statSync(t),i=r.maxReadSize||16*1024*1024;new Gc.ReadStreamSync(t,{readSize:i,size:s.size}).pipe(e)},tm=(r,e)=>{let t=new Vs(r),s=r.maxReadSize||16*1024*1024,i=r.file,n=new Promise((o,a)=>{t.on("error",a),t.on("close",o),zc.stat(i,(l,c)=>{if(l)a(l);else{let h=new Gc.ReadStream(i,{readSize:s,size:c.size});h.on("error",a),h.pipe(t)}})});return e?n.then(e,e):n},rm=r=>new Vs.Sync(r),sm=r=>new Vs(r)});var Vc=y(N=>{"use strict";u();N.c=N.create=Ra();N.r=N.replace=qn();N.t=N.list=Ns();N.u=N.update=Ia();N.x=N.extract=Jc();N.Pack=Cs();N.Unpack=io();N.Parse=Ls();N.ReadEntry=is();N.WriteEntry=mn();N.Header=Ht();N.Pax=os();N.types=Yi()});var el=y(($0,Qc)=>{u();function he(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))}Qc.exports=he;he.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)};he.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null};he.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};he.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)};he.prototype.try=function(r){console.log("Using RetryOperation.try() is deprecated"),this.attempt(r)};he.prototype.start=function(r){console.log("Using RetryOperation.start() is deprecated"),this.attempt(r)};he.prototype.start=he.prototype.try;he.prototype.errors=function(){return this._errors};he.prototype.attempts=function(){return this._attempts};he.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 tl=y(xt=>{u();var um=el();xt.operation=function(r){var e=xt.timeouts(r);return new um(e,{forever:r&&(r.forever||r.retries===1/0),unref:r&&r.unref,maxRetryTime:r&&r.maxRetryTime})};xt.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};xt.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};xt.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=xt.operation(e),h=Array.prototype.slice.call(arguments,1),d=h.pop();h.push(function(p){c.retry(p)||(p&&(arguments[0]=c.mainError()),d.apply(this,arguments))}),c.attempt(function(){l.apply(r,h)})}.bind(r,o),r[n].options=e}}});var sl=y((z0,rl)=>{u();rl.exports=tl()});var nl=y((G0,il)=>{u();var am=sl();function cm(r,e){function t(s,i){var n=e||{},o;"randomize"in n||(n.randomize=!0),o=am.operation(n);function a(h){i(h||new Error("Aborted"))}function l(h,d){if(h.bail){a(h);return}o.retry(h)?n.onRetry&&n.onRetry(h,d):i(o.mainError())}function c(h){var d;try{d=r(a,h)}catch(p){l(p,h);return}Promise.resolve(d).then(s).catch(function(E){l(E,h)})}o.attempt(c)}return new Promise(t)}il.exports=cm});u();var fo=require("picocolors"),Tl=require("commander");u();u();u();var Xl=S(Co());u();u();function oi(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}u();u();function pr(r){return pr=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},pr(r)}u();function ui(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function ai(r,e){if(e&&(pr(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ui(r)}u();function Et(r){return Et=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Et(r)}u();u();function xe(r,e){return xe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(s,i){return s.__proto__=i,s},xe(r,e)}function ci(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&&xe(r,e)}u();u();function li(r){return Function.toString.call(r).indexOf("[native code]")!==-1}u();u();function hi(){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 Nt(r,e,t){return hi()?Nt=Reflect.construct.bind():Nt=function(i,n,o){var a=[null];a.push.apply(a,n);var l=Function.bind.apply(i,a),c=new l;return o&&xe(c,o.prototype),c},Nt.apply(null,arguments)}function mr(r){var e=typeof Map=="function"?new Map:void 0;return mr=function(s){if(s===null||!li(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 Nt(s,arguments,Et(this).constructor)}return i.prototype=Object.create(s.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),xe(i,s)},mr(r)}var jo=S(Io());var Ql=S(require("fs-extra")),vd=function(r){ci(e,r);function e(t){var s;return oi(this,e),s=ai(this,Et(e).call(this,"No package.json could be found upwards from the directory ".concat(t))),s.directory=t,s}return e}(mr(Error));u();u();var eh=S(require("fs")),th=S(require("path"));u();var mh=S(require("fs")),dh=S(require("path")),Dh=S(require("js-yaml")),gh=require("fast-glob");var Ee={};$l(Ee,{bold:()=>uh,dimmed:()=>ch,error:()=>Vo,grey:()=>lh,info:()=>oh,item:()=>hh,log:()=>Ye,turboBlue:()=>It,turboGradient:()=>nh,turboLoader:()=>Ho,turboRed:()=>zo,underline:()=>ah,warn:()=>Jo,yellow:()=>Go});u();var Y=require("picocolors"),qo=S(require("ora")),Uo=S(require("gradient-string")),$o="#0099F7",Wo="#F11712",ih="#FFFF00",Ei=r=>{let e=fh(r);return t=>`\x1B[38;5;${e}m${t}${(0,Y.reset)("")}`},nh=(0,Uo.default)($o,Wo),It=Ei($o),zo=Ei(Wo),Go=Ei(ih),Ho=r=>(0,qo.default)({text:r,spinner:{frames:[" ",It("> "),It(">> "),It(">>>")]}}),oh=(...r)=>{Ye(It((0,Y.bold)(">>>")),r.join(" "))},uh=(...r)=>{Ye((0,Y.bold)(r.join(" ")))},ah=(...r)=>{Ye((0,Y.underline)(r.join(" ")))},ch=(...r)=>{Ye((0,Y.dim)(r.join(" ")))},lh=(...r)=>{Ye((0,Y.gray)(r.join(" ")))},hh=(...r)=>{Ye(It((0,Y.bold)(" \u2022")),r.join(" "))},Ye=(...r)=>{console.log(...r)},Jo=(...r)=>{console.error(Go((0,Y.bold)(">>>")),r.join(" "))},Vo=(...r)=>{console.error(zo((0,Y.bold)(">>>")),r.join(" "))};function fh(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 Yo=S(require("os")),Ko=S(require("execa"));async function Wr(r,e=[],t){let s={cwd:Yo.default.tmpdir(),env:{COREPACK_ENABLE_STRICT:"0"},...t};try{let{stdout:i}=await(0,Ko.default)(r,e,s);return i.trim()}catch{return}}async function yi(){let[r,e,t,s]=await Promise.all([Wr("yarnpkg",["--version"]),Wr("npm",["--version"]),Wr("pnpm",["--version"]),Wr("bun",["--version"])]);return{yarn:r,pnpm:t,npm:e,bun:s}}u();var Eh=S(require("fs-extra"));u();var yh=S(require("path")),Ah=S(require("fs-extra")),Ch=require("picocolors");u();var Yc=require("stream"),Kc=require("util"),im=require("path"),nm=require("os"),Zc=require("fs"),om=S(Vc());var j0=(0,Kc.promisify)(Yc.Stream.pipeline);u();var Xc=require("fs-extra");u();var Dm=S(require("path")),gm=S(nl()),ol=require("picocolors"),oo=require("fs-extra");u();u();var ul={name:"@turbo/workspaces",version:"2.3.4-canary.7",description:"Tools for working with package managers",homepage:"https://turbo.build/repo",license:"MIT",repository:{type:"git",url:"https://github.com/vercel/turborepo",directory:"packages/turbo-workspaces"},bugs:{url:"https://github.com/vercel/turborepo/issues"},bin:"dist/cli.js",module:"dist/index.mjs",main:"dist/index.js",types:"dist/index.d.ts",scripts:{build:"tsup",dev:"tsup --watch",test:"jest",lint:"eslint src/","check-types":"tsc --noEmit","lint:prettier":"prettier -c . --cache --ignore-path=../../.prettierignore"},dependencies:{commander:"^10.0.0",execa:"5.1.1","fast-glob":"^3.2.12","fs-extra":"^10.1.0","gradient-string":"^2.0.0",inquirer:"^8.0.0","js-yaml":"^4.1.0",ora:"4.1.1",picocolors:"1.0.1",semver:"7.6.2","update-check":"^1.5.4"},devDependencies:{"@jest/globals":"^29.7.0","@turbo/eslint-config":"workspace:*","@turbo/test-utils":"workspace:*","@turbo/tsconfig":"workspace:*","@turbo/utils":"workspace:*","@types/fs-extra":"^9.0.13","@types/gradient-string":"^1.1.2","@types/inquirer":"^7.3.1","@types/js-yaml":"^4.0.5","@types/node":"^18.17.2","@types/semver":"7.5.8",jest:"^29.7.0","ts-jest":"^29.2.5",tsup:"^5.10.3",typescript:"5.5.4"},files:["dist"],publishConfig:{access:"public"}};u();u();var Zs=S(require("path")),Sl=S(require("inquirer")),me=require("picocolors");u();var q=require("picocolors"),al=S(require("gradient-string")),ar=2,ct=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(ar*e),...t)}header(e){this.blankLine(),this.logger((0,q.bold)(e))}installerFrames(){let e=`${" ".repeat(ar)} - ${this.dry?(0,q.yellow)("SKIPPED | "):(0,q.green)("OK | ")}`;return[`${e} `,`${e}> `,`${e}>> `,`${e}>>>`]}gradient(e){return(0,al.default)("#0099F7","#F11712")(e.toString())}hero(){this.logger((0,q.bold)(this.gradient(`
5
5
  >>> TURBOREPO
6
6
  `)))}info(...e){this.logger(...e)}mainStep(e){this.blankLine(),this.logger(`${this.step}. ${(0,q.underline)(e)}`),this.step+=1}subStep(...e){this.logger(" ".repeat(ar),"-",this.dry?(0,q.yellow)("SKIPPED |"):(0,q.green)("OK |"),...e)}subStepFailure(...e){this.logger(" ".repeat(ar),"-",(0,q.red)("ERROR |"),...e)}rootHeader(){this.blankLine(),this.indented(2,"Root:")}rootStep(...e){this.logger(" ".repeat(ar*3),"-",this.dry?(0,q.yellow)("SKIPPED |"):(0,q.green)("OK |"),...e)}workspaceHeader(){this.blankLine(),this.indented(2,"Workspaces:")}workspaceStep(...e){this.logger(" ".repeat(ar*3),"-",this.dry?(0,q.yellow)("SKIPPED |"):(0,q.green)("OK |"),...e)}blankLine(){this.logger()}error(...e){console.error(...e)}};u();var Ge=S(require("path")),cl=S(require("execa")),ie=require("fs-extra"),ll=require("fast-glob"),hl=S(require("js-yaml"));u();var v=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,v)}};var ym=/^(?!_)(?<manager>.+)@(?<version>.+)$/;function M({workspaceRoot:r}){let e=Ge.default.join(r,"package.json");try{return(0,ie.readJsonSync)(e,"utf8")}catch(t){if(t&&typeof t=="object"&&"code"in t){if(t.code==="ENOENT")throw new v(`no "package.json" found at ${r}`,{type:"package_json-missing"});if(t.code==="EJSONPARSE")throw new v(`failed to parse "package.json" at ${r}`,{type:"package_json-parse_error"})}throw new Error(`unexpected error reading "package.json" at ${r}`)}}function lt({workspaceRoot:r}){let{packageManager:e}=M({workspaceRoot:r});if(e)try{let t=ym.exec(e);if(t){let[s,i]=t;return i}}catch{}}function He({workspaceRoot:r}){let e=M({workspaceRoot:r}),t=Ge.default.basename(r),{name:s=t,description:i}=e;return{name:s,description:i}}function uo({workspaceRoot:r}){let e=Ge.default.join(r,"pnpm-workspace.yaml");if((0,ie.existsSync)(e))try{let t=hl.default.load((0,ie.readFileSync)(e,"utf8"));if(t instanceof Object&&"packages"in t&&Array.isArray(t.packages))return t.packages}catch{throw new v(`failed to parse ${e}`,{type:"pnpm-workspace_parse_error"})}return[]}function ht({root:r,lockFile:e,workspaceConfig:t}){let s=n=>Ge.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 cr({workspaces:r}){var e;return r?Array.isArray(r)?r:"packages"in r?(e=r.packages)!=null?e:[]:[]:[]}function ft({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,ll.sync)(i,{onlyFiles:!0,absolute:!0,cwd:r,ignore:["**/node_modules/**",...t]})}).map(s=>{let i=Ge.default.dirname(s),{name:n,description:o}=He({workspaceRoot:i});return{name:n,description:o,paths:{root:i,packageJson:s,nodeModules:Ge.default.join(i,"node_modules")}}})}function pt({directory:r}){let e=Ge.default.resolve(process.cwd(),r);return{exists:(0,ie.existsSync)(e),absolute:e}}function fe({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 fl({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 ne({project:r,options:e}){e!=null&&e.dry||(0,ie.rmSync)(r.paths.lockfile,{force:!0})}async function Ys({project:r,options:e}){if(!(e!=null&&e.dry)&&(0,ie.existsSync)(r.paths.lockfile))try{let{stdout:t}=await(0,cl.default)("bun",["bun.lockb"],{stdin:"ignore",cwd:r.paths.root});await(0,ie.writeFile)(Ge.default.join(r.paths.root,"yarn.lock"),t)}catch{}finally{(0,ie.rmSync)(r.paths.lockfile,{force:!0})}}u();u();u();var Ot=S(require("path")),J=require("fs-extra"),Dl=S(require("execa"));u();var pl=S(require("path")),ml=require("fs-extra"),dl=require("picocolors");function Am({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 pe({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(d=>{let p=n[d];if(p){let{updated:E,dependencyList:C}=Am({dependencyList:p,project:r,to:t});n[d]=C,o[d]=E}});let l=d=>{let p=o[d].length;if(p>0)return`${(0,dl.green)(p.toString())} ${d}`},c=a.map(l).filter(Boolean),h=`./${pl.default.relative(r.paths.root,e.paths.packageJson)}`;if(c.length>=1){let d="updating";c.forEach((p,E)=>{c.length===1?d+=` ${p} in ${h}`:E===c.length-1?d+=`and ${p} in ${h}`:d+=` ${p}, `}),s.workspaceStep(d)}else s.workspaceStep(`no workspace dependencies found in ${h}`);i!=null&&i.dry||(0,ml.writeJSONSync)(e.paths.packageJson,n,{spaces:2})}var mt={name:"pnpm",lock:"pnpm-lock.yaml"};async function gl(r){let e=Ot.default.join(r.workspaceRoot,mt.lock),t=Ot.default.join(r.workspaceRoot,"pnpm-workspace.yaml"),s=lt({workspaceRoot:r.workspaceRoot});return(0,J.existsSync)(e)||(0,J.existsSync)(t)||s===mt.name}async function Cm(r){if(!await gl(r))throw new v("Not a pnpm project",{type:"package_manager-unexpected"});let{name:t,description:s}=He(r);return{name:t,description:s,packageManager:mt.name,paths:ht({root:r.workspaceRoot,lockFile:mt.lock,workspaceConfig:"pnpm-workspace.yaml"}),workspaceData:{globs:uo(r),workspaces:ft({workspaceGlobs:uo(r),...r})}}}async function wm(r){let{project:e,to:t,logger:s,options:i}=r,n=e.workspaceData.globs.length>0;s.mainStep(fe({action:"create",packageManager:mt.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||((0,J.writeJSONSync)(e.paths.packageJson,o,{spaces:2}),n&&(s.rootStep('adding "pnpm-workspace.yaml"'),(0,J.writeFileSync)(Ot.default.join(e.paths.root,"pnpm-workspace.yaml"),`packages:
7
7
  ${e.workspaceData.globs.map(a=>` - "${a}"`).join(`
package/dist/cli.mjs CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import{a as s,b as g,c as $,d as D,e as u,g as f,h as k,k as W}from"./chunk-WVVC4IHO.mjs";s();import{red as q}from"picocolors";import{Command as z}from"commander";var A={name:"@turbo/workspaces",version:"2.3.4-canary.6",description:"Tools for working with package managers",homepage:"https://turbo.build/repo",license:"MIT",repository:{type:"git",url:"https://github.com/vercel/turborepo",directory:"packages/turbo-workspaces"},bugs:{url:"https://github.com/vercel/turborepo/issues"},bin:"dist/cli.js",module:"dist/index.mjs",main:"dist/index.js",types:"dist/index.d.ts",scripts:{build:"tsup",dev:"tsup --watch",test:"jest",lint:"eslint src/","check-types":"tsc --noEmit","lint:prettier":"prettier -c . --cache --ignore-path=../../.prettierignore"},dependencies:{commander:"^10.0.0",execa:"5.1.1","fast-glob":"^3.2.12","fs-extra":"^10.1.0","gradient-string":"^2.0.0",inquirer:"^8.0.0","js-yaml":"^4.1.0",ora:"4.1.1",picocolors:"1.0.1",semver:"7.6.2","update-check":"^1.5.4"},devDependencies:{"@jest/globals":"^29.7.0","@turbo/eslint-config":"workspace:*","@turbo/test-utils":"workspace:*","@turbo/tsconfig":"workspace:*","@turbo/utils":"workspace:*","@types/fs-extra":"^9.0.13","@types/gradient-string":"^1.1.2","@types/inquirer":"^7.3.1","@types/js-yaml":"^4.0.5","@types/node":"^18.17.2","@types/semver":"7.5.8",jest:"^29.7.0","ts-jest":"^29.2.5",tsup:"^5.10.3",typescript:"5.5.4"},files:["dist"],publishConfig:{access:"public"}};s();s();import w from"path";import R from"inquirer";import{bold as C,dim as I,italic as E,underline as G}from"picocolors";async function M(t){let r=new k;r.hero();let c=await R.prompt({type:"input",name:"directoryInput",message:"Where is the root of the repo?",when:!t,default:".",validate:e=>{let{exists:o,absolute:n}=u({directory:e});return o?!0:`Directory ${I(`(${n})`)} does not exist`},filter:e=>e.trim()}),{directoryInput:i=t}=c,{exists:b,absolute:p}=u({directory:i});if(!b)return r.error(`Directory ${I(`(${p})`)} does not exist`),process.exit(1);let m=await f({root:p}),d=m.workspaceData.workspaces.length,l=d>0,a={};m.workspaceData.workspaces.forEach(e=>{let n=w.relative(p,e.paths.root).split(w.sep)[0];n in a||(a[n]=[]),a[n].push(e)});let v=e=>`${e.name} (${E(`./${w.relative(p,e.paths.root)}`)})`,y=({number:e,dir:o,workspaces:n})=>{r.indented(2,`${e}. ${C(o)}`),n.forEach((L,T)=>{r.indented(3,`${T+1}. ${v(L)}`)})};r.header("Repository Summary"),r.indented(1,`${G(m.name)}:`),r.indented(1,`Package Manager: ${C(E(m.packageManager))}`),l&&(r.indented(1,`Workspaces (${C(d.toString())}):`),Object.keys(a).forEach((e,o)=>{y({number:o+1,workspaces:a[e],dir:e})}),r.blankLine())}s();import O from"inquirer";import{dim as S}from"picocolors";function U({packageManager:t,currentWorkspaceManger:r,availablePackageManagers:c}){return r===t?"already in use":c[t]?!1:"not installed"}async function j(t,r,c){let i=new k(c);i.hero(),i.header("Welcome, let's convert your project."),i.blankLine();let b=await O.prompt({type:"input",name:"directoryInput",message:"Where is the root of your repo?",when:!t,default:".",validate:e=>{let{exists:o,absolute:n}=u({directory:e});return o?!0:`Directory ${S(`(${n})`)} does not exist`},filter:e=>e.trim()}),{directoryInput:p=t}=b,{exists:m,absolute:d}=u({directory:p});if(!m)return i.error(`Directory ${S(`(${d})`)} does not exist`),process.exit(1);let[l,a]=await Promise.all([f({root:d}),$()]),v=await O.prompt({name:"packageManagerInput",type:"list",message:`Convert from ${l.packageManager} to:`,when:!r||!Object.keys(a).includes(r),choices:[{pm:"npm",label:"npm"},{pm:"pnpm",label:"pnpm"},{pm:"yarn",label:"yarn"},{pm:"bun",label:"Bun (beta)"}].map(({pm:e,label:o})=>({name:o,value:e,disabled:U({packageManager:e,currentWorkspaceManger:l.packageManager,availablePackageManagers:a})}))}),{packageManagerInput:y=r}=v;await W({project:l,convertTo:{name:y,version:a[y]},logger:i,options:c})}var h=new z;h.name("@turbo/workspaces").description("Tools for working with package manager workspaces").version(A.version,"-v, --version","output the current version");h.command("convert").description("Convert project between workspace managers").argument("[path]","Project root").argument("[package-manager]","Package manager to convert to").option("--skip-install","Do not run a package manager install after conversion",!1).option("--ignore-unchanged-package-manager","Prevent script failure if the package manager is unchanged",!1).option("--dry","Dry run (no changes are made to files)",!1).option("--force","Bypass Git safety checks and forcibly run conversion",!1).action(j);h.command("summary").description("Display a summary of the specified project").argument("[path]","Project root").action(M);h.parseAsync().catch(t=>{g.log(),t instanceof D?g.log(q(t.message)):(g.log(q("Unexpected error. Please report it as a bug:")),g.log(t)),g.log(),process.exit(1)});
2
+ import{a as s,b as g,c as $,d as D,e as u,g as f,h as k,k as W}from"./chunk-WVVC4IHO.mjs";s();import{red as q}from"picocolors";import{Command as z}from"commander";var A={name:"@turbo/workspaces",version:"2.3.4-canary.7",description:"Tools for working with package managers",homepage:"https://turbo.build/repo",license:"MIT",repository:{type:"git",url:"https://github.com/vercel/turborepo",directory:"packages/turbo-workspaces"},bugs:{url:"https://github.com/vercel/turborepo/issues"},bin:"dist/cli.js",module:"dist/index.mjs",main:"dist/index.js",types:"dist/index.d.ts",scripts:{build:"tsup",dev:"tsup --watch",test:"jest",lint:"eslint src/","check-types":"tsc --noEmit","lint:prettier":"prettier -c . --cache --ignore-path=../../.prettierignore"},dependencies:{commander:"^10.0.0",execa:"5.1.1","fast-glob":"^3.2.12","fs-extra":"^10.1.0","gradient-string":"^2.0.0",inquirer:"^8.0.0","js-yaml":"^4.1.0",ora:"4.1.1",picocolors:"1.0.1",semver:"7.6.2","update-check":"^1.5.4"},devDependencies:{"@jest/globals":"^29.7.0","@turbo/eslint-config":"workspace:*","@turbo/test-utils":"workspace:*","@turbo/tsconfig":"workspace:*","@turbo/utils":"workspace:*","@types/fs-extra":"^9.0.13","@types/gradient-string":"^1.1.2","@types/inquirer":"^7.3.1","@types/js-yaml":"^4.0.5","@types/node":"^18.17.2","@types/semver":"7.5.8",jest:"^29.7.0","ts-jest":"^29.2.5",tsup:"^5.10.3",typescript:"5.5.4"},files:["dist"],publishConfig:{access:"public"}};s();s();import w from"path";import R from"inquirer";import{bold as C,dim as I,italic as E,underline as G}from"picocolors";async function M(t){let r=new k;r.hero();let c=await R.prompt({type:"input",name:"directoryInput",message:"Where is the root of the repo?",when:!t,default:".",validate:e=>{let{exists:o,absolute:n}=u({directory:e});return o?!0:`Directory ${I(`(${n})`)} does not exist`},filter:e=>e.trim()}),{directoryInput:i=t}=c,{exists:b,absolute:p}=u({directory:i});if(!b)return r.error(`Directory ${I(`(${p})`)} does not exist`),process.exit(1);let m=await f({root:p}),d=m.workspaceData.workspaces.length,l=d>0,a={};m.workspaceData.workspaces.forEach(e=>{let n=w.relative(p,e.paths.root).split(w.sep)[0];n in a||(a[n]=[]),a[n].push(e)});let v=e=>`${e.name} (${E(`./${w.relative(p,e.paths.root)}`)})`,y=({number:e,dir:o,workspaces:n})=>{r.indented(2,`${e}. ${C(o)}`),n.forEach((L,T)=>{r.indented(3,`${T+1}. ${v(L)}`)})};r.header("Repository Summary"),r.indented(1,`${G(m.name)}:`),r.indented(1,`Package Manager: ${C(E(m.packageManager))}`),l&&(r.indented(1,`Workspaces (${C(d.toString())}):`),Object.keys(a).forEach((e,o)=>{y({number:o+1,workspaces:a[e],dir:e})}),r.blankLine())}s();import O from"inquirer";import{dim as S}from"picocolors";function U({packageManager:t,currentWorkspaceManger:r,availablePackageManagers:c}){return r===t?"already in use":c[t]?!1:"not installed"}async function j(t,r,c){let i=new k(c);i.hero(),i.header("Welcome, let's convert your project."),i.blankLine();let b=await O.prompt({type:"input",name:"directoryInput",message:"Where is the root of your repo?",when:!t,default:".",validate:e=>{let{exists:o,absolute:n}=u({directory:e});return o?!0:`Directory ${S(`(${n})`)} does not exist`},filter:e=>e.trim()}),{directoryInput:p=t}=b,{exists:m,absolute:d}=u({directory:p});if(!m)return i.error(`Directory ${S(`(${d})`)} does not exist`),process.exit(1);let[l,a]=await Promise.all([f({root:d}),$()]),v=await O.prompt({name:"packageManagerInput",type:"list",message:`Convert from ${l.packageManager} to:`,when:!r||!Object.keys(a).includes(r),choices:[{pm:"npm",label:"npm"},{pm:"pnpm",label:"pnpm"},{pm:"yarn",label:"yarn"},{pm:"bun",label:"Bun (beta)"}].map(({pm:e,label:o})=>({name:o,value:e,disabled:U({packageManager:e,currentWorkspaceManger:l.packageManager,availablePackageManagers:a})}))}),{packageManagerInput:y=r}=v;await W({project:l,convertTo:{name:y,version:a[y]},logger:i,options:c})}var h=new z;h.name("@turbo/workspaces").description("Tools for working with package manager workspaces").version(A.version,"-v, --version","output the current version");h.command("convert").description("Convert project between workspace managers").argument("[path]","Project root").argument("[package-manager]","Package manager to convert to").option("--skip-install","Do not run a package manager install after conversion",!1).option("--ignore-unchanged-package-manager","Prevent script failure if the package manager is unchanged",!1).option("--dry","Dry run (no changes are made to files)",!1).option("--force","Bypass Git safety checks and forcibly run conversion",!1).action(j);h.command("summary").description("Display a summary of the specified project").argument("[path]","Project root").action(M);h.parseAsync().catch(t=>{g.log(),t instanceof D?g.log(q(t.message)):(g.log(q("Unexpected error. Please report it as a bug:")),g.log(t)),g.log(),process.exit(1)});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@turbo/workspaces",
3
- "version": "2.3.4-canary.6",
3
+ "version": "2.3.4-canary.7",
4
4
  "description": "Tools for working with package managers",
5
5
  "homepage": "https://turbo.build/repo",
6
6
  "license": "MIT",