@turbo/codemod 2.0.0-canary.1 → 2.0.0-canary.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -37,7 +37,7 @@ ${i.message}`:y,F=[v,e,t].filter(Boolean).join(`
37
37
  `+t.slice(n,s),n=s+1),o=a;return u+=`
38
38
  `,t.length-n>e&&o>n?u+=t.slice(n,o)+`
39
39
  `+t.slice(o+1):u+=t.slice(n),u.slice(1)}function aS(t){for(var e="",r=0,i,n=0;n<t.length;r>=65536?n+=2:n++)r=fn(t,n),i=ke[r],!i&&gn(r)?(e+=t[n],r>=65536&&(e+=t[n+1])):e+=i||Xw(r);return e}function uS(t,e,r){var i="",n=t.tag,s,o,a;for(s=0,o=r.length;s<o;s+=1)a=r[s],t.replacer&&(a=t.replacer.call(r,String(s),a)),(Mt(t,e,a,!1,!1)||typeof a=="undefined"&&Mt(t,e,null,!1,!1))&&(i!==""&&(i+=","+(t.condenseFlow?"":" ")),i+=t.dump);t.tag=n,t.dump="["+i+"]"}function yf(t,e,r,i){var n="",s=t.tag,o,a,u;for(o=0,a=r.length;o<a;o+=1)u=r[o],t.replacer&&(u=t.replacer.call(r,String(o),u)),(Mt(t,e+1,u,!0,!0,!1,!0)||typeof u=="undefined"&&Mt(t,e+1,null,!0,!0,!1,!0))&&((!i||n!=="")&&(n+=Ba(t,e)),t.dump&&dn===t.dump.charCodeAt(0)?n+="-":n+="- ",n+=t.dump);t.tag=s,t.dump=n||"[]"}function lS(t,e,r){var i="",n=t.tag,s=Object.keys(r),o,a,u,l,c;for(o=0,a=s.length;o<a;o+=1)c="",i!==""&&(c+=", "),t.condenseFlow&&(c+='"'),u=s[o],l=r[u],t.replacer&&(l=t.replacer.call(r,u,l)),Mt(t,e,u,!1,!1)&&(t.dump.length>1024&&(c+="? "),c+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),Mt(t,e,l,!1,!1)&&(c+=t.dump,i+=c));t.tag=n,t.dump="{"+i+"}"}function cS(t,e,r,i){var n="",s=t.tag,o=Object.keys(r),a,u,l,c,f,h;if(t.sortKeys===!0)o.sort();else if(typeof t.sortKeys=="function")o.sort(t.sortKeys);else if(t.sortKeys)throw new He("sortKeys must be a boolean or a function");for(a=0,u=o.length;a<u;a+=1)h="",(!i||n!=="")&&(h+=Ba(t,e)),l=o[a],c=r[l],t.replacer&&(c=t.replacer.call(r,l,c)),Mt(t,e+1,l,!0,!0,!0)&&(f=t.tag!==null&&t.tag!=="?"||t.dump&&t.dump.length>1024,f&&(t.dump&&dn===t.dump.charCodeAt(0)?h+="?":h+="? "),h+=t.dump,f&&(h+=Ba(t,e)),Mt(t,e+1,c,!0,f)&&(t.dump&&dn===t.dump.charCodeAt(0)?h+=":":h+=": ",h+=t.dump,n+=h));t.tag=s,t.dump=n||"{}"}function Ef(t,e,r){var i,n,s,o,a,u;for(n=r?t.explicitTypes:t.implicitTypes,s=0,o=n.length;s<o;s+=1)if(a=n[s],(a.instanceOf||a.predicate)&&(!a.instanceOf||typeof e=="object"&&e instanceof a.instanceOf)&&(!a.predicate||a.predicate(e))){if(r?a.multi&&a.representName?t.tag=a.representName(e):t.tag=a.tag:t.tag="?",a.represent){if(u=t.styleMap[a.tag]||a.defaultStyle,Kf.call(a.represent)==="[object Function]")i=a.represent(e,u);else if(Zf.call(a.represent,u))i=a.represent[u](e,u);else throw new He("!<"+a.tag+'> tag resolver accepts not "'+u+'" style');t.dump=i}return!0}return!1}function Mt(t,e,r,i,n,s,o){t.tag=null,t.dump=r,Ef(t,r,!1)||Ef(t,r,!0);var a=Kf.call(t.dump),u=i,l;i&&(i=t.flowLevel<0||t.flowLevel>e);var c=a==="[object Object]"||a==="[object Array]",f,h;if(c&&(f=t.duplicates.indexOf(r),h=f!==-1),(t.tag!==null&&t.tag!=="?"||h||t.indent!==2&&e>0)&&(n=!1),h&&t.usedDuplicates[f])t.dump="*ref_"+f;else{if(c&&h&&!t.usedDuplicates[f]&&(t.usedDuplicates[f]=!0),a==="[object Object]")i&&Object.keys(t.dump).length!==0?(cS(t,e,t.dump,n),h&&(t.dump="&ref_"+f+t.dump)):(lS(t,e,t.dump),h&&(t.dump="&ref_"+f+" "+t.dump));else if(a==="[object Array]")i&&t.dump.length!==0?(t.noArrayIndent&&!o&&e>0?yf(t,e-1,t.dump,n):yf(t,e,t.dump,n),h&&(t.dump="&ref_"+f+t.dump)):(uS(t,e,t.dump),h&&(t.dump="&ref_"+f+" "+t.dump));else if(a==="[object String]")t.tag!=="?"&&sS(t,t.dump,e,s,u);else{if(a==="[object Undefined]")return!1;if(t.skipInvalid)return!1;throw new He("unacceptable kind of an object to dump "+a)}t.tag!==null&&t.tag!=="?"&&(l=encodeURI(t.tag[0]==="!"?t.tag.slice(1):t.tag).replace(/!/g,"%21"),t.tag[0]==="!"?l="!"+l:l.slice(0,18)==="tag:yaml.org,2002:"?l="!!"+l.slice(18):l="!<"+l+">",t.dump=l+" "+t.dump)}return!0}function hS(t,e){var r=[],i=[],n,s;for(Ia(t,r,i),n=0,s=i.length;n<s;n+=1)e.duplicates.push(r[i[n]]);e.usedDuplicates=new Array(s)}function Ia(t,e,r){var i,n,s;if(t!==null&&typeof t=="object")if(n=e.indexOf(t),n!==-1)r.indexOf(n)===-1&&r.push(n);else if(e.push(t),Array.isArray(t))for(n=0,s=t.length;n<s;n+=1)Ia(t[n],e,r);else for(i=Object.keys(t),n=0,s=i.length;n<s;n+=1)Ia(t[i[n]],e,r)}function fS(t,e){e=e||{};var r=new eS(e);r.noRefs||hS(t,r);var i=t;return r.replacer&&(i=r.replacer.call({"":i},"",i)),Mt(r,0,i,!0,!0)?r.dump+`
40
- `:""}var pS=fS,dS={dump:pS};function qa(t,e){return function(){throw new Error("Function yaml."+t+" is removed in js-yaml 4. Use yaml."+e+" instead, which is now safe by default.")}}var mS=Oe,gS=_f,yS=vf,ES=Of,DS=kf,bS=Ma,_S=Vf.load,wS=Vf.loadAll,SS=dS.dump,AS=He,vS={binary:If,float:Ff,map:Af,null:Cf,pairs:Mf,set:jf,timestamp:Bf,bool:xf,int:Rf,merge:Pf,omap:Nf,seq:Sf,str:wf},CS=qa("safeLoad","load"),xS=qa("safeLoadAll","loadAll"),RS=qa("safeDump","dump"),FS={Type:mS,Schema:gS,FAILSAFE_SCHEMA:yS,JSON_SCHEMA:ES,CORE_SCHEMA:DS,DEFAULT_SCHEMA:bS,load:_S,loadAll:wS,dump:SS,YAMLException:AS,types:vS,safeLoad:CS,safeLoadAll:xS,safeDump:RS},Ua=FS;var UC=J(Ns());var ne={};r_(ne,{bold:()=>PC,dimmed:()=>NC,error:()=>e0,grey:()=>MC,info:()=>BC,item:()=>jC,log:()=>pr,turboBlue:()=>wi,turboGradient:()=>LC,turboLoader:()=>Xm,turboRed:()=>Zm,underline:()=>IC,warn:()=>Qm,yellow:()=>Jm});var fr=J(require("chalk")),Wm=J(require("ora")),Ym=J(require("gradient-string")),Vm="#0099F7",Km="#F11712",TC="#FFFF00",LC=(0,Ym.default)(Vm,Km),wi=fr.default.hex(Vm),Zm=fr.default.hex(Km),Jm=fr.default.hex(TC),Xm=t=>(0,Wm.default)({text:t,spinner:{frames:[" ",wi("> "),wi(">> "),wi(">>>")]}}),BC=(...t)=>{pr(wi.bold(">>>"),...t)},PC=(...t)=>{pr(fr.default.bold(...t))},IC=(...t)=>{pr(fr.default.underline(...t))},NC=(...t)=>{pr(fr.default.dim(...t))},MC=(...t)=>{pr(fr.default.grey(...t))},jC=(...t)=>{pr(wi.bold(" \u2022"),...t)},pr=(...t)=>{console.log(...t)},Qm=(...t)=>{console.error(Jm.bold(">>>"),...t)},e0=(...t)=>{console.error(Zm.bold(">>>"),...t)};var Ng=J(require("os")),Mg=J(ki());async function dr(t,e=[],r){let i={cwd:Ng.default.tmpdir(),env:{COREPACK_ENABLE_STRICT:"0"},...r};try{let{stdout:n}=await(0,Mg.default)(t,e,i);return n.trim()}catch{return}}async function Gl(){let[t,e,r,i]=await Promise.all([dr("yarnpkg",["--version"]),dr("npm",["--version"]),dr("pnpm",["--version"]),dr("bun",["--version"])]);return{yarn:t,pnpm:r,npm:e,bun:i}}async function zl(){let[t,e,r,i]=await Promise.all([dr("yarnpkg",["global","bin"]),dr("npm",["config","get","prefix"]),dr("pnpm",["bin","--global"]),dr("bun",["pm","--g","bin"])]);return{yarn:t,pnpm:r,npm:e,bun:i}}var NR=J(require("fs-extra"));var MR=J(require("path")),jR=J(require("fs-extra")),$R=J(require("chalk"));var ND=require("stream"),MD=require("util"),wk=require("path"),Sk=require("os"),jD=require("fs"),Ak=J(ID());var _I=(0,MD.promisify)(ND.Stream.pipeline);var $D=require("fs-extra");var Bk=J(require("path")),Pk=J(YD()),Ik=J(require("chalk")),kh=require("fs-extra");var Zb=require("commander");var ia={name:"@turbo/codemod",version:"2.0.0-canary.1",description:"Provides Codemod transformations to help upgrade your Turborepo codebase when a feature is deprecated.",homepage:"https://turbo.build/repo",license:"MIT",repository:{type:"git",url:"https://github.com/vercel/turbo",directory:"packages/turbo-codemod"},bugs:{url:"https://github.com/vercel/turbo/issues"},bin:"dist/cli.js",scripts:{build:"tsup",test:"jest",lint:"eslint src/","check-types":"tsc --noEmit","add-transformer":"plop","lint:prettier":"prettier -c . --cache --ignore-path=../../.prettierignore"},dependencies:{axios:"0.27.2",chalk:"2.4.2",commander:"^9.5.0",diff:"^5.1.0","find-up":"4.1.0","fs-extra":"^10.0.0","gradient-string":"^2.0.0",inquirer:"^8.2.4","inquirer-file-tree-selection-prompt":"^1.0.19","is-git-clean":"^1.1.0",ora:"4.1.1",semver:"^7.3.7","update-check":"^1.5.4"},devDependencies:{"@turbo/eslint-config":"workspace:*","@turbo/gen":"workspace:*","@turbo/test-utils":"workspace:*","@turbo/tsconfig":"workspace:*","@turbo/types":"workspace:*","@turbo/utils":"workspace:*","@turbo/workspaces":"workspace:*","@types/chalk-animation":"^1.6.0","@types/diff":"^5.0.2","@types/fs-extra":"^9.0.13","@types/gradient-string":"^1.1.2","@types/inquirer":"^8.2.0","@types/jest":"^27.4.0","@types/node":"^18.17.2","@types/semver":"^7.3.9","@types/uuid":"^9.0.0",deepmerge:"^4.2.2",jest:"^27.4.3",plop:"^3.1.1",semver:"^7.3.5","ts-jest":"^27.1.1",tsup:"^6.7.0",typescript:"5.3.3"},files:["dist"],publishConfig:{access:"public"}};var an=J(require("os")),zb=require("child_process"),$e=J(require("chalk")),Wb=require("inquirer");var Or=J(require("chalk"),1),ub=J(require("ora"),1),lb=J(require("gradient-string"),1);var PT=J(ki(),1),rN=require("fs-extra");var aN=J(Ns(),1),lN=require("fs-extra"),hN=require("fs-extra"),pN=require("chalk"),db=require("stream"),mb=require("util"),yN=require("fs-extra"),_N=require("chalk"),SN=require("fs-extra"),ii=J(require("path"),1),qe=require("fs-extra"),gb=J(ki(),1),yb=J(require("path"),1),Eb=require("fs-extra"),Db=J(require("chalk"),1),rr=J(require("path"),1),bb=J(ki(),1),rt=require("fs-extra"),_b=J(Ns(),1);var Yn=J(require("path"),1),Tt=require("fs-extra"),nn=J(require("path"),1),Lt=require("fs-extra"),Vn=J(require("path"),1),Bt=require("fs-extra"),gL=J(require("chalk"),1),yL=J(require("gradient-string"),1),EL=J(ki(),1),DL=J(require("ora"),1),bL=require("semver"),_L=J(require("chalk"),1),Mk=Object.create,Bh=Object.defineProperty,jk=Object.getOwnPropertyDescriptor,$k=Object.getOwnPropertyNames,Hk=Object.getPrototypeOf,qk=Object.prototype.hasOwnProperty,re=(t=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(t,{get:(e,r)=>(typeof require!="undefined"?require:e)[r]}):t)(function(t){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+t+'" is not supported')}),Uk=(t,e)=>()=>(t&&(e=t(t=0)),e),te=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Gk=(t,e)=>{for(var r in e)Bh(t,r,{get:e[r],enumerable:!0})},zk=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of $k(e))!qk.call(t,n)&&n!==r&&Bh(t,n,{get:()=>e[n],enumerable:!(i=jk(e,n))||i.enumerable});return t},oa=(t,e,r)=>(r=t!=null?Mk(Hk(t)):{},zk(e||!t||!t.__esModule?Bh(r,"default",{value:t,enumerable:!0}):r,t)),W=Uk(()=>{}),Wk=te((t,e)=>{W();function r(i){return e.exports=r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},e.exports.__esModule=!0,e.exports.default=e.exports,r(i)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports}),Yk=te((t,e)=>{W();var r=Wk().default;function i(){"use strict";e.exports=i=function(){return s},e.exports.__esModule=!0,e.exports.default=e.exports;var n,s={},o=Object.prototype,a=o.hasOwnProperty,u=Object.defineProperty||function(P,d,m){P[d]=m.value},l=typeof Symbol=="function"?Symbol:{},c=l.iterator||"@@iterator",f=l.asyncIterator||"@@asyncIterator",h=l.toStringTag||"@@toStringTag";function p(P,d,m){return Object.defineProperty(P,d,{value:m,enumerable:!0,configurable:!0,writable:!0}),P[d]}try{p({},"")}catch{p=function(P,d,m){return P[d]=m}}function g(P,d,m,D){var A=d&&d.prototype instanceof x?d:x,w=Object.create(A.prototype),I=new j(D||[]);return u(w,"_invoke",{value:K(P,m,I)}),w}function y(P,d,m){try{return{type:"normal",arg:P.call(d,m)}}catch(D){return{type:"throw",arg:D}}}s.wrap=g;var E="suspendedStart",v="suspendedYield",F="executing",O="completed",R={};function x(){}function L(){}function b(){}var S={};p(S,c,function(){return this});var N=Object.getPrototypeOf,H=N&&N(N(z([])));H&&H!==o&&a.call(H,c)&&(S=H);var T=b.prototype=x.prototype=Object.create(S);function U(P){["next","throw","return"].forEach(function(d){p(P,d,function(m){return this._invoke(d,m)})})}function V(P,d){function m(A,w,I,M){var Z=y(P[A],P,w);if(Z.type!=="throw"){var q=Z.arg,Q=q.value;return Q&&r(Q)=="object"&&a.call(Q,"__await")?d.resolve(Q.__await).then(function(G){m("next",G,I,M)},function(G){m("throw",G,I,M)}):d.resolve(Q).then(function(G){q.value=G,I(q)},function(G){return m("throw",G,I,M)})}M(Z.arg)}var D;u(this,"_invoke",{value:function(A,w){function I(){return new d(function(M,Z){m(A,w,M,Z)})}return D=D?D.then(I,I):I()}})}function K(P,d,m){var D=E;return function(A,w){if(D===F)throw new Error("Generator is already running");if(D===O){if(A==="throw")throw w;return{value:n,done:!0}}for(m.method=A,m.arg=w;;){var I=m.delegate;if(I){var M=B(I,m);if(M){if(M===R)continue;return M}}if(m.method==="next")m.sent=m._sent=m.arg;else if(m.method==="throw"){if(D===E)throw D=O,m.arg;m.dispatchException(m.arg)}else m.method==="return"&&m.abrupt("return",m.arg);D=F;var Z=y(P,d,m);if(Z.type==="normal"){if(D=m.done?O:v,Z.arg===R)continue;return{value:Z.arg,done:m.done}}Z.type==="throw"&&(D=O,m.method="throw",m.arg=Z.arg)}}}function B(P,d){var m=d.method,D=P.iterator[m];if(D===n)return d.delegate=null,m==="throw"&&P.iterator.return&&(d.method="return",d.arg=n,B(P,d),d.method==="throw")||m!=="return"&&(d.method="throw",d.arg=new TypeError("The iterator does not provide a '"+m+"' method")),R;var A=y(D,P.iterator,d.arg);if(A.type==="throw")return d.method="throw",d.arg=A.arg,d.delegate=null,R;var w=A.arg;return w?w.done?(d[P.resultName]=w.value,d.next=P.nextLoc,d.method!=="return"&&(d.method="next",d.arg=n),d.delegate=null,R):w:(d.method="throw",d.arg=new TypeError("iterator result is not an object"),d.delegate=null,R)}function C(P){var d={tryLoc:P[0]};1 in P&&(d.catchLoc=P[1]),2 in P&&(d.finallyLoc=P[2],d.afterLoc=P[3]),this.tryEntries.push(d)}function k(P){var d=P.completion||{};d.type="normal",delete d.arg,P.completion=d}function j(P){this.tryEntries=[{tryLoc:"root"}],P.forEach(C,this),this.reset(!0)}function z(P){if(P||P===""){var d=P[c];if(d)return d.call(P);if(typeof P.next=="function")return P;if(!isNaN(P.length)){var m=-1,D=function A(){for(;++m<P.length;)if(a.call(P,m))return A.value=P[m],A.done=!1,A;return A.value=n,A.done=!0,A};return D.next=D}}throw new TypeError(r(P)+" is not iterable")}return L.prototype=b,u(T,"constructor",{value:b,configurable:!0}),u(b,"constructor",{value:L,configurable:!0}),L.displayName=p(b,h,"GeneratorFunction"),s.isGeneratorFunction=function(P){var d=typeof P=="function"&&P.constructor;return!!d&&(d===L||(d.displayName||d.name)==="GeneratorFunction")},s.mark=function(P){return Object.setPrototypeOf?Object.setPrototypeOf(P,b):(P.__proto__=b,p(P,h,"GeneratorFunction")),P.prototype=Object.create(T),P},s.awrap=function(P){return{__await:P}},U(V.prototype),p(V.prototype,f,function(){return this}),s.AsyncIterator=V,s.async=function(P,d,m,D,A){A===void 0&&(A=Promise);var w=new V(g(P,d,m,D),A);return s.isGeneratorFunction(d)?w:w.next().then(function(I){return I.done?I.value:w.next()})},U(T),p(T,h,"Generator"),p(T,c,function(){return this}),p(T,"toString",function(){return"[object Generator]"}),s.keys=function(P){var d=Object(P),m=[];for(var D in d)m.push(D);return m.reverse(),function A(){for(;m.length;){var w=m.pop();if(w in d)return A.value=w,A.done=!1,A}return A.done=!0,A}},s.values=z,j.prototype={constructor:j,reset:function(P){if(this.prev=0,this.next=0,this.sent=this._sent=n,this.done=!1,this.delegate=null,this.method="next",this.arg=n,this.tryEntries.forEach(k),!P)for(var d in this)d.charAt(0)==="t"&&a.call(this,d)&&!isNaN(+d.slice(1))&&(this[d]=n)},stop:function(){this.done=!0;var P=this.tryEntries[0].completion;if(P.type==="throw")throw P.arg;return this.rval},dispatchException:function(P){if(this.done)throw P;var d=this;function m(Z,q){return w.type="throw",w.arg=P,d.next=Z,q&&(d.method="next",d.arg=n),!!q}for(var D=this.tryEntries.length-1;D>=0;--D){var A=this.tryEntries[D],w=A.completion;if(A.tryLoc==="root")return m("end");if(A.tryLoc<=this.prev){var I=a.call(A,"catchLoc"),M=a.call(A,"finallyLoc");if(I&&M){if(this.prev<A.catchLoc)return m(A.catchLoc,!0);if(this.prev<A.finallyLoc)return m(A.finallyLoc)}else if(I){if(this.prev<A.catchLoc)return m(A.catchLoc,!0)}else{if(!M)throw new Error("try statement without catch or finally");if(this.prev<A.finallyLoc)return m(A.finallyLoc)}}}},abrupt:function(P,d){for(var m=this.tryEntries.length-1;m>=0;--m){var D=this.tryEntries[m];if(D.tryLoc<=this.prev&&a.call(D,"finallyLoc")&&this.prev<D.finallyLoc){var A=D;break}}A&&(P==="break"||P==="continue")&&A.tryLoc<=d&&d<=A.finallyLoc&&(A=null);var w=A?A.completion:{};return w.type=P,w.arg=d,A?(this.method="next",this.next=A.finallyLoc,R):this.complete(w)},complete:function(P,d){if(P.type==="throw")throw P.arg;return P.type==="break"||P.type==="continue"?this.next=P.arg:P.type==="return"?(this.rval=this.arg=P.arg,this.method="return",this.next="end"):P.type==="normal"&&d&&(this.next=d),R},finish:function(P){for(var d=this.tryEntries.length-1;d>=0;--d){var m=this.tryEntries[d];if(m.finallyLoc===P)return this.complete(m.completion,m.afterLoc),k(m),R}},catch:function(P){for(var d=this.tryEntries.length-1;d>=0;--d){var m=this.tryEntries[d];if(m.tryLoc===P){var D=m.completion;if(D.type==="throw"){var A=D.arg;k(m)}return A}}throw new Error("illegal catch attempt")},delegateYield:function(P,d,m){return this.delegate={iterator:z(P),resultName:d,nextLoc:m},this.method==="next"&&(this.arg=n),R}},s}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports}),Vk=te((t,e)=>{W();var r=Yk()();e.exports=r;try{regeneratorRuntime=r}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}}),Kk=te((t,e)=>{"use strict";W();var r=(i,...n)=>new Promise(s=>{s(i(...n))});e.exports=r,e.exports.default=r}),Zk=te((t,e)=>{"use strict";W();var r=Kk(),i=n=>{if(!((Number.isInteger(n)||n===1/0)&&n>0))return Promise.reject(new TypeError("Expected `concurrency` to be a number from 1 and up"));let s=[],o=0,a=()=>{o--,s.length>0&&s.shift()()},u=(f,h,...p)=>{o++;let g=r(f,...p);h(g),g.then(a,a)},l=(f,h,...p)=>{o<n?u(f,h,...p):s.push(u.bind(null,f,h,...p))},c=(f,...h)=>new Promise(p=>l(f,p,...h));return Object.defineProperties(c,{activeCount:{get:()=>o},pendingCount:{get:()=>s.length},clearQueue:{value:()=>{s.length=0}}}),c};e.exports=i,e.exports.default=i}),Jk=te((t,e)=>{"use strict";W();var r=Zk(),i=class extends Error{constructor(a){super(),this.value=a}},n=async(a,u)=>u(await a),s=async a=>{let u=await Promise.all(a);if(u[1]===!0)throw new i(u[0]);return!1},o=async(a,u,l)=>{l={concurrency:1/0,preserveOrder:!0,...l};let c=r(l.concurrency),f=[...a].map(p=>[p,c(n,p,u)]),h=r(l.preserveOrder?1:1/0);try{await Promise.all(f.map(p=>h(s,p)))}catch(p){if(p instanceof i)return p.value;throw p}};e.exports=o,e.exports.default=o}),Xk=te((t,e)=>{"use strict";W();var r=re("path"),i=re("fs"),{promisify:n}=re("util"),s=Jk(),o=n(i.stat),a=n(i.lstat),u={directory:"isDirectory",file:"isFile"};function l({type:f}){if(!(f in u))throw new Error(`Invalid type specified: ${f}`)}var c=(f,h)=>f===void 0||h[u[f]]();e.exports=async(f,h)=>{h={cwd:process.cwd(),type:"file",allowSymlinks:!0,...h},l(h);let p=h.allowSymlinks?o:a;return s(f,async g=>{try{let y=await p(r.resolve(h.cwd,g));return c(h.type,y)}catch{return!1}},h)},e.exports.sync=(f,h)=>{h={cwd:process.cwd(),allowSymlinks:!0,type:"file",...h},l(h);let p=h.allowSymlinks?i.statSync:i.lstatSync;for(let g of f)try{let y=p(r.resolve(h.cwd,g));if(c(h.type,y))return g}catch{}}}),Qk=te((t,e)=>{"use strict";W();var r=re("fs"),{promisify:i}=re("util"),n=i(r.access);e.exports=async s=>{try{return await n(s),!0}catch{return!1}},e.exports.sync=s=>{try{return r.accessSync(s),!0}catch{return!1}}}),eT=te((t,e)=>{"use strict";W();var r=re("path"),i=Xk(),n=Qk(),s=Symbol("findUp.stop");e.exports=async(o,a={})=>{let u=r.resolve(a.cwd||""),{root:l}=r.parse(u),c=[].concat(o),f=async h=>{if(typeof o!="function")return i(c,h);let p=await o(h.cwd);return typeof p=="string"?i([p],h):p};for(;;){let h=await f({...a,cwd:u});if(h===s)return;if(h)return r.resolve(u,h);if(u===l)return;u=r.dirname(u)}},e.exports.sync=(o,a={})=>{let u=r.resolve(a.cwd||""),{root:l}=r.parse(u),c=[].concat(o),f=h=>{if(typeof o!="function")return i.sync(c,h);let p=o(h.cwd);return typeof p=="string"?i.sync([p],h):p};for(;;){let h=f({...a,cwd:u});if(h===s)return;if(h)return r.resolve(u,h);if(u===l)return;u=r.dirname(u)}},e.exports.exists=n,e.exports.sync.exists=n.sync,e.exports.stop=s}),Kn=te((t,e)=>{"use strict";W();var r=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"]]);e.exports=i=>i?Object.keys(i).map(n=>[r.has(n)?r.get(n):n,i[n]]).reduce((n,s)=>(n[s[0]]=s[1],n),Object.create(null)):{}}),Ph=te((t,e)=>{"use strict";W();var r=typeof process=="object"&&process?process:{stdout:null,stderr:null},i=re("events"),n=re("stream"),s=re("string_decoder").StringDecoder,o=Symbol("EOF"),a=Symbol("maybeEmitEnd"),u=Symbol("emittedEnd"),l=Symbol("emittingEnd"),c=Symbol("emittedError"),f=Symbol("closed"),h=Symbol("read"),p=Symbol("flush"),g=Symbol("flushChunk"),y=Symbol("encoding"),E=Symbol("decoder"),v=Symbol("flowing"),F=Symbol("paused"),O=Symbol("resume"),R=Symbol("buffer"),x=Symbol("pipes"),L=Symbol("bufferLength"),b=Symbol("bufferPush"),S=Symbol("bufferShift"),N=Symbol("objectMode"),H=Symbol("destroyed"),T=Symbol("emitData"),U=Symbol("emitEnd"),V=Symbol("emitEnd2"),K=Symbol("async"),B=A=>Promise.resolve().then(A),C=global._MP_NO_ITERATOR_SYMBOLS_!=="1",k=C&&Symbol.asyncIterator||Symbol("asyncIterator not implemented"),j=C&&Symbol.iterator||Symbol("iterator not implemented"),z=A=>A==="end"||A==="finish"||A==="prefinish",P=A=>A instanceof ArrayBuffer||typeof A=="object"&&A.constructor&&A.constructor.name==="ArrayBuffer"&&A.byteLength>=0,d=A=>!Buffer.isBuffer(A)&&ArrayBuffer.isView(A),m=class{constructor(A,w,I){this.src=A,this.dest=w,this.opts=I,this.ondrain=()=>A[O](),w.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},D=class extends m{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(A,w,I){super(A,w,I),this.proxyErrors=M=>w.emit("error",M),A.on("error",this.proxyErrors)}};e.exports=class KD extends n{constructor(w){super(),this[v]=!1,this[F]=!1,this[x]=[],this[R]=[],this[N]=w&&w.objectMode||!1,this[N]?this[y]=null:this[y]=w&&w.encoding||null,this[y]==="buffer"&&(this[y]=null),this[K]=w&&!!w.async||!1,this[E]=this[y]?new s(this[y]):null,this[o]=!1,this[u]=!1,this[l]=!1,this[f]=!1,this[c]=null,this.writable=!0,this.readable=!0,this[L]=0,this[H]=!1,w&&w.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[R]}),w&&w.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[x]})}get bufferLength(){return this[L]}get encoding(){return this[y]}set encoding(w){if(this[N])throw new Error("cannot set encoding in objectMode");if(this[y]&&w!==this[y]&&(this[E]&&this[E].lastNeed||this[L]))throw new Error("cannot change encoding");this[y]!==w&&(this[E]=w?new s(w):null,this[R].length&&(this[R]=this[R].map(I=>this[E].write(I)))),this[y]=w}setEncoding(w){this.encoding=w}get objectMode(){return this[N]}set objectMode(w){this[N]=this[N]||!!w}get async(){return this[K]}set async(w){this[K]=this[K]||!!w}write(w,I,M){if(this[o])throw new Error("write after end");if(this[H])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof I=="function"&&(M=I,I="utf8"),I||(I="utf8");let Z=this[K]?B:q=>q();return!this[N]&&!Buffer.isBuffer(w)&&(d(w)?w=Buffer.from(w.buffer,w.byteOffset,w.byteLength):P(w)?w=Buffer.from(w):typeof w!="string"&&(this.objectMode=!0)),this[N]?(this.flowing&&this[L]!==0&&this[p](!0),this.flowing?this.emit("data",w):this[b](w),this[L]!==0&&this.emit("readable"),M&&Z(M),this.flowing):w.length?(typeof w=="string"&&!(I===this[y]&&!this[E].lastNeed)&&(w=Buffer.from(w,I)),Buffer.isBuffer(w)&&this[y]&&(w=this[E].write(w)),this.flowing&&this[L]!==0&&this[p](!0),this.flowing?this.emit("data",w):this[b](w),this[L]!==0&&this.emit("readable"),M&&Z(M),this.flowing):(this[L]!==0&&this.emit("readable"),M&&Z(M),this.flowing)}read(w){if(this[H])return null;if(this[L]===0||w===0||w>this[L])return this[a](),null;this[N]&&(w=null),this[R].length>1&&!this[N]&&(this.encoding?this[R]=[this[R].join("")]:this[R]=[Buffer.concat(this[R],this[L])]);let I=this[h](w||null,this[R][0]);return this[a](),I}[h](w,I){return w===I.length||w===null?this[S]():(this[R][0]=I.slice(w),I=I.slice(0,w),this[L]-=w),this.emit("data",I),!this[R].length&&!this[o]&&this.emit("drain"),I}end(w,I,M){return typeof w=="function"&&(M=w,w=null),typeof I=="function"&&(M=I,I="utf8"),w&&this.write(w,I),M&&this.once("end",M),this[o]=!0,this.writable=!1,(this.flowing||!this[F])&&this[a](),this}[O](){this[H]||(this[F]=!1,this[v]=!0,this.emit("resume"),this[R].length?this[p]():this[o]?this[a]():this.emit("drain"))}resume(){return this[O]()}pause(){this[v]=!1,this[F]=!0}get destroyed(){return this[H]}get flowing(){return this[v]}get paused(){return this[F]}[b](w){this[N]?this[L]+=1:this[L]+=w.length,this[R].push(w)}[S](){return this[R].length&&(this[N]?this[L]-=1:this[L]-=this[R][0].length),this[R].shift()}[p](w){do;while(this[g](this[S]()));!w&&!this[R].length&&!this[o]&&this.emit("drain")}[g](w){return w?(this.emit("data",w),this.flowing):!1}pipe(w,I){if(this[H])return;let M=this[u];return I=I||{},w===r.stdout||w===r.stderr?I.end=!1:I.end=I.end!==!1,I.proxyErrors=!!I.proxyErrors,M?I.end&&w.end():(this[x].push(I.proxyErrors?new D(this,w,I):new m(this,w,I)),this[K]?B(()=>this[O]()):this[O]()),w}unpipe(w){let I=this[x].find(M=>M.dest===w);I&&(this[x].splice(this[x].indexOf(I),1),I.unpipe())}addListener(w,I){return this.on(w,I)}on(w,I){let M=super.on(w,I);return w==="data"&&!this[x].length&&!this.flowing?this[O]():w==="readable"&&this[L]!==0?super.emit("readable"):z(w)&&this[u]?(super.emit(w),this.removeAllListeners(w)):w==="error"&&this[c]&&(this[K]?B(()=>I.call(this,this[c])):I.call(this,this[c])),M}get emittedEnd(){return this[u]}[a](){!this[l]&&!this[u]&&!this[H]&&this[R].length===0&&this[o]&&(this[l]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[f]&&this.emit("close"),this[l]=!1)}emit(w,I,...M){if(w!=="error"&&w!=="close"&&w!==H&&this[H])return;if(w==="data")return I?this[K]?B(()=>this[T](I)):this[T](I):!1;if(w==="end")return this[U]();if(w==="close"){if(this[f]=!0,!this[u]&&!this[H])return;let q=super.emit("close");return this.removeAllListeners("close"),q}else if(w==="error"){this[c]=I;let q=super.emit("error",I);return this[a](),q}else if(w==="resume"){let q=super.emit("resume");return this[a](),q}else if(w==="finish"||w==="prefinish"){let q=super.emit(w);return this.removeAllListeners(w),q}let Z=super.emit(w,I,...M);return this[a](),Z}[T](w){for(let M of this[x])M.dest.write(w)===!1&&this.pause();let I=super.emit("data",w);return this[a](),I}[U](){this[u]||(this[u]=!0,this.readable=!1,this[K]?B(()=>this[V]()):this[V]())}[V](){if(this[E]){let I=this[E].end();if(I){for(let M of this[x])M.dest.write(I);super.emit("data",I)}}for(let I of this[x])I.end();let w=super.emit("end");return this.removeAllListeners("end"),w}collect(){let w=[];this[N]||(w.dataLength=0);let I=this.promise();return this.on("data",M=>{w.push(M),this[N]||(w.dataLength+=M.length)}),I.then(()=>w)}concat(){return this[N]?Promise.reject(new Error("cannot concat in objectMode")):this.collect().then(w=>this[N]?Promise.reject(new Error("cannot concat in objectMode")):this[y]?w.join(""):Buffer.concat(w,w.dataLength))}promise(){return new Promise((w,I)=>{this.on(H,()=>I(new Error("stream destroyed"))),this.on("error",M=>I(M)),this.on("end",()=>w())})}[k](){return{next:()=>{let w=this.read();if(w!==null)return Promise.resolve({done:!1,value:w});if(this[o])return Promise.resolve({done:!0});let I=null,M=null,Z=ie=>{this.removeListener("data",q),this.removeListener("end",Q),M(ie)},q=ie=>{this.removeListener("error",Z),this.removeListener("end",Q),this.pause(),I({value:ie,done:!!this[o]})},Q=()=>{this.removeListener("error",Z),this.removeListener("data",q),I({done:!0})},G=()=>Z(new Error("stream destroyed"));return new Promise((ie,ce)=>{M=ce,I=ie,this.once(H,G),this.once("error",Z),this.once("end",Q),this.once("data",q)})}}}[j](){return{next:()=>{let w=this.read();return{value:w,done:w===null}}}}destroy(w){return this[H]?(w?this.emit("error",w):this.emit(H),this):(this[H]=!0,this[R].length=0,this[L]=0,typeof this.close=="function"&&!this[f]&&this.close(),w?this.emit("error",w):this.emit(H),this)}static isStream(w){return!!w&&(w instanceof KD||w instanceof n||w instanceof i&&(typeof w.pipe=="function"||typeof w.write=="function"&&typeof w.end=="function"))}}}),tT=te((t,e)=>{W();var r=re("zlib").constants||{ZLIB_VERNUM:4736};e.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},r))}),ZD=te((t,e)=>{"use strict";W();var r=typeof process=="object"&&process?process:{stdout:null,stderr:null},i=re("events"),n=re("stream"),s=re("string_decoder").StringDecoder,o=Symbol("EOF"),a=Symbol("maybeEmitEnd"),u=Symbol("emittedEnd"),l=Symbol("emittingEnd"),c=Symbol("emittedError"),f=Symbol("closed"),h=Symbol("read"),p=Symbol("flush"),g=Symbol("flushChunk"),y=Symbol("encoding"),E=Symbol("decoder"),v=Symbol("flowing"),F=Symbol("paused"),O=Symbol("resume"),R=Symbol("bufferLength"),x=Symbol("bufferPush"),L=Symbol("bufferShift"),b=Symbol("objectMode"),S=Symbol("destroyed"),N=Symbol("emitData"),H=Symbol("emitEnd"),T=Symbol("emitEnd2"),U=Symbol("async"),V=m=>Promise.resolve().then(m),K=global._MP_NO_ITERATOR_SYMBOLS_!=="1",B=K&&Symbol.asyncIterator||Symbol("asyncIterator not implemented"),C=K&&Symbol.iterator||Symbol("iterator not implemented"),k=m=>m==="end"||m==="finish"||m==="prefinish",j=m=>m instanceof ArrayBuffer||typeof m=="object"&&m.constructor&&m.constructor.name==="ArrayBuffer"&&m.byteLength>=0,z=m=>!Buffer.isBuffer(m)&&ArrayBuffer.isView(m),P=class{constructor(m,D,A){this.src=m,this.dest=D,this.opts=A,this.ondrain=()=>m[O](),D.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},d=class extends P{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(m,D,A){super(m,D,A),this.proxyErrors=w=>D.emit("error",w),m.on("error",this.proxyErrors)}};e.exports=class JD extends n{constructor(D){super(),this[v]=!1,this[F]=!1,this.pipes=[],this.buffer=[],this[b]=D&&D.objectMode||!1,this[b]?this[y]=null:this[y]=D&&D.encoding||null,this[y]==="buffer"&&(this[y]=null),this[U]=D&&!!D.async||!1,this[E]=this[y]?new s(this[y]):null,this[o]=!1,this[u]=!1,this[l]=!1,this[f]=!1,this[c]=null,this.writable=!0,this.readable=!0,this[R]=0,this[S]=!1}get bufferLength(){return this[R]}get encoding(){return this[y]}set encoding(D){if(this[b])throw new Error("cannot set encoding in objectMode");if(this[y]&&D!==this[y]&&(this[E]&&this[E].lastNeed||this[R]))throw new Error("cannot change encoding");this[y]!==D&&(this[E]=D?new s(D):null,this.buffer.length&&(this.buffer=this.buffer.map(A=>this[E].write(A)))),this[y]=D}setEncoding(D){this.encoding=D}get objectMode(){return this[b]}set objectMode(D){this[b]=this[b]||!!D}get async(){return this[U]}set async(D){this[U]=this[U]||!!D}write(D,A,w){if(this[o])throw new Error("write after end");if(this[S])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof A=="function"&&(w=A,A="utf8"),A||(A="utf8");let I=this[U]?V:M=>M();return!this[b]&&!Buffer.isBuffer(D)&&(z(D)?D=Buffer.from(D.buffer,D.byteOffset,D.byteLength):j(D)?D=Buffer.from(D):typeof D!="string"&&(this.objectMode=!0)),this[b]?(this.flowing&&this[R]!==0&&this[p](!0),this.flowing?this.emit("data",D):this[x](D),this[R]!==0&&this.emit("readable"),w&&I(w),this.flowing):D.length?(typeof D=="string"&&!(A===this[y]&&!this[E].lastNeed)&&(D=Buffer.from(D,A)),Buffer.isBuffer(D)&&this[y]&&(D=this[E].write(D)),this.flowing&&this[R]!==0&&this[p](!0),this.flowing?this.emit("data",D):this[x](D),this[R]!==0&&this.emit("readable"),w&&I(w),this.flowing):(this[R]!==0&&this.emit("readable"),w&&I(w),this.flowing)}read(D){if(this[S])return null;if(this[R]===0||D===0||D>this[R])return this[a](),null;this[b]&&(D=null),this.buffer.length>1&&!this[b]&&(this.encoding?this.buffer=[this.buffer.join("")]:this.buffer=[Buffer.concat(this.buffer,this[R])]);let A=this[h](D||null,this.buffer[0]);return this[a](),A}[h](D,A){return D===A.length||D===null?this[L]():(this.buffer[0]=A.slice(D),A=A.slice(0,D),this[R]-=D),this.emit("data",A),!this.buffer.length&&!this[o]&&this.emit("drain"),A}end(D,A,w){return typeof D=="function"&&(w=D,D=null),typeof A=="function"&&(w=A,A="utf8"),D&&this.write(D,A),w&&this.once("end",w),this[o]=!0,this.writable=!1,(this.flowing||!this[F])&&this[a](),this}[O](){this[S]||(this[F]=!1,this[v]=!0,this.emit("resume"),this.buffer.length?this[p]():this[o]?this[a]():this.emit("drain"))}resume(){return this[O]()}pause(){this[v]=!1,this[F]=!0}get destroyed(){return this[S]}get flowing(){return this[v]}get paused(){return this[F]}[x](D){this[b]?this[R]+=1:this[R]+=D.length,this.buffer.push(D)}[L](){return this.buffer.length&&(this[b]?this[R]-=1:this[R]-=this.buffer[0].length),this.buffer.shift()}[p](D){do;while(this[g](this[L]()));!D&&!this.buffer.length&&!this[o]&&this.emit("drain")}[g](D){return D?(this.emit("data",D),this.flowing):!1}pipe(D,A){if(this[S])return;let w=this[u];return A=A||{},D===r.stdout||D===r.stderr?A.end=!1:A.end=A.end!==!1,A.proxyErrors=!!A.proxyErrors,w?A.end&&D.end():(this.pipes.push(A.proxyErrors?new d(this,D,A):new P(this,D,A)),this[U]?V(()=>this[O]()):this[O]()),D}unpipe(D){let A=this.pipes.find(w=>w.dest===D);A&&(this.pipes.splice(this.pipes.indexOf(A),1),A.unpipe())}addListener(D,A){return this.on(D,A)}on(D,A){let w=super.on(D,A);return D==="data"&&!this.pipes.length&&!this.flowing?this[O]():D==="readable"&&this[R]!==0?super.emit("readable"):k(D)&&this[u]?(super.emit(D),this.removeAllListeners(D)):D==="error"&&this[c]&&(this[U]?V(()=>A.call(this,this[c])):A.call(this,this[c])),w}get emittedEnd(){return this[u]}[a](){!this[l]&&!this[u]&&!this[S]&&this.buffer.length===0&&this[o]&&(this[l]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[f]&&this.emit("close"),this[l]=!1)}emit(D,A,...w){if(D!=="error"&&D!=="close"&&D!==S&&this[S])return;if(D==="data")return A?this[U]?V(()=>this[N](A)):this[N](A):!1;if(D==="end")return this[H]();if(D==="close"){if(this[f]=!0,!this[u]&&!this[S])return;let M=super.emit("close");return this.removeAllListeners("close"),M}else if(D==="error"){this[c]=A;let M=super.emit("error",A);return this[a](),M}else if(D==="resume"){let M=super.emit("resume");return this[a](),M}else if(D==="finish"||D==="prefinish"){let M=super.emit(D);return this.removeAllListeners(D),M}let I=super.emit(D,A,...w);return this[a](),I}[N](D){for(let w of this.pipes)w.dest.write(D)===!1&&this.pause();let A=super.emit("data",D);return this[a](),A}[H](){this[u]||(this[u]=!0,this.readable=!1,this[U]?V(()=>this[T]()):this[T]())}[T](){if(this[E]){let A=this[E].end();if(A){for(let w of this.pipes)w.dest.write(A);super.emit("data",A)}}for(let A of this.pipes)A.end();let D=super.emit("end");return this.removeAllListeners("end"),D}collect(){let D=[];this[b]||(D.dataLength=0);let A=this.promise();return this.on("data",w=>{D.push(w),this[b]||(D.dataLength+=w.length)}),A.then(()=>D)}concat(){return this[b]?Promise.reject(new Error("cannot concat in objectMode")):this.collect().then(D=>this[b]?Promise.reject(new Error("cannot concat in objectMode")):this[y]?D.join(""):Buffer.concat(D,D.dataLength))}promise(){return new Promise((D,A)=>{this.on(S,()=>A(new Error("stream destroyed"))),this.on("error",w=>A(w)),this.on("end",()=>D())})}[B](){return{next:()=>{let D=this.read();if(D!==null)return Promise.resolve({done:!1,value:D});if(this[o])return Promise.resolve({done:!0});let A=null,w=null,I=Q=>{this.removeListener("data",M),this.removeListener("end",Z),w(Q)},M=Q=>{this.removeListener("error",I),this.removeListener("end",Z),this.pause(),A({value:Q,done:!!this[o]})},Z=()=>{this.removeListener("error",I),this.removeListener("data",M),A({done:!0})},q=()=>I(new Error("stream destroyed"));return new Promise((Q,G)=>{w=G,A=Q,this.once(S,q),this.once("error",I),this.once("end",Z),this.once("data",M)})}}}[C](){return{next:()=>{let D=this.read();return{value:D,done:D===null}}}}destroy(D){return this[S]?(D?this.emit("error",D):this.emit(S),this):(this[S]=!0,this.buffer.length=0,this[R]=0,typeof this.close=="function"&&!this[f]&&this.close(),D?this.emit("error",D):this.emit(S),this)}static isStream(D){return!!D&&(D instanceof JD||D instanceof n||D instanceof i&&(typeof D.pipe=="function"||typeof D.write=="function"&&typeof D.end=="function"))}}}),XD=te(t=>{"use strict";W();var e=re("assert"),r=re("buffer").Buffer,i=re("zlib"),n=t.constants=tT(),s=ZD(),o=r.concat,a=Symbol("_superWrite"),u=class extends Error{constructor(k){super("zlib: "+k.message),this.code=k.code,this.errno=k.errno,this.code||(this.code="ZLIB_ERROR"),this.message="zlib: "+k.message,Error.captureStackTrace(this,this.constructor)}get name(){return"ZlibError"}},l=Symbol("opts"),c=Symbol("flushFlag"),f=Symbol("finishFlushFlag"),h=Symbol("fullFlushFlag"),p=Symbol("handle"),g=Symbol("onError"),y=Symbol("sawError"),E=Symbol("level"),v=Symbol("strategy"),F=Symbol("ended"),O=Symbol("_defaultFullFlush"),R=class extends s{constructor(k,j){if(!k||typeof k!="object")throw new TypeError("invalid options for ZlibBase constructor");super(k),this[y]=!1,this[F]=!1,this[l]=k,this[c]=k.flush,this[f]=k.finishFlush;try{this[p]=new i[j](k)}catch(z){throw new u(z)}this[g]=z=>{this[y]||(this[y]=!0,this.close(),this.emit("error",z))},this[p].on("error",z=>this[g](new u(z))),this.once("end",()=>this.close)}close(){this[p]&&(this[p].close(),this[p]=null,this.emit("close"))}reset(){if(!this[y])return e(this[p],"zlib binding closed"),this[p].reset()}flush(k){this.ended||(typeof k!="number"&&(k=this[h]),this.write(Object.assign(r.alloc(0),{[c]:k})))}end(k,j,z){return k&&this.write(k,j),this.flush(this[f]),this[F]=!0,super.end(null,null,z)}get ended(){return this[F]}write(k,j,z){if(typeof j=="function"&&(z=j,j="utf8"),typeof k=="string"&&(k=r.from(k,j)),this[y])return;e(this[p],"zlib binding closed");let P=this[p]._handle,d=P.close;P.close=()=>{};let m=this[p].close;this[p].close=()=>{},r.concat=w=>w;let D;try{let w=typeof k[c]=="number"?k[c]:this[c];D=this[p]._processChunk(k,w),r.concat=o}catch(w){r.concat=o,this[g](new u(w))}finally{this[p]&&(this[p]._handle=P,P.close=d,this[p].close=m,this[p].removeAllListeners("error"))}this[p]&&this[p].on("error",w=>this[g](new u(w)));let A;if(D)if(Array.isArray(D)&&D.length>0){A=this[a](r.from(D[0]));for(let w=1;w<D.length;w++)A=this[a](D[w])}else A=this[a](r.from(D));return z&&z(),A}[a](k){return super.write(k)}},x=class extends R{constructor(k,j){k=k||{},k.flush=k.flush||n.Z_NO_FLUSH,k.finishFlush=k.finishFlush||n.Z_FINISH,super(k,j),this[h]=n.Z_FULL_FLUSH,this[E]=k.level,this[v]=k.strategy}params(k,j){if(!this[y]){if(!this[p])throw new Error("cannot switch params when binding is closed");if(!this[p].params)throw new Error("not supported in this implementation");if(this[E]!==k||this[v]!==j){this.flush(n.Z_SYNC_FLUSH),e(this[p],"zlib binding closed");let z=this[p].flush;this[p].flush=(P,d)=>{this.flush(P),d()};try{this[p].params(k,j)}finally{this[p].flush=z}this[p]&&(this[E]=k,this[v]=j)}}}},L=class extends x{constructor(k){super(k,"Deflate")}},b=class extends x{constructor(k){super(k,"Inflate")}},S=Symbol("_portable"),N=class extends x{constructor(k){super(k,"Gzip"),this[S]=k&&!!k.portable}[a](k){return this[S]?(this[S]=!1,k[9]=255,super[a](k)):super[a](k)}},H=class extends x{constructor(k){super(k,"Gunzip")}},T=class extends x{constructor(k){super(k,"DeflateRaw")}},U=class extends x{constructor(k){super(k,"InflateRaw")}},V=class extends x{constructor(k){super(k,"Unzip")}},K=class extends R{constructor(k,j){k=k||{},k.flush=k.flush||n.BROTLI_OPERATION_PROCESS,k.finishFlush=k.finishFlush||n.BROTLI_OPERATION_FINISH,super(k,j),this[h]=n.BROTLI_OPERATION_FLUSH}},B=class extends K{constructor(k){super(k,"BrotliCompress")}},C=class extends K{constructor(k){super(k,"BrotliDecompress")}};t.Deflate=L,t.Inflate=b,t.Gzip=N,t.Gunzip=H,t.DeflateRaw=T,t.InflateRaw=U,t.Unzip=V,typeof i.BrotliCompress=="function"?(t.BrotliCompress=B,t.BrotliDecompress=C):t.BrotliCompress=t.BrotliDecompress=class{constructor(){throw new Error("Brotli is not supported in this version of Node.js")}}}),Zn=te((t,e)=>{W();var r=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform;e.exports=r!=="win32"?i=>i:i=>i&&i.replace(/\\/g,"/")}),Ih=te((t,e)=>{"use strict";W();var r=Ph(),i=Zn(),n=Symbol("slurp");e.exports=class extends r{constructor(s,o,a){switch(super(),this.pause(),this.extended=o,this.globalExtended=a,this.header=s,this.startBlockSize=512*Math.ceil(s.size/512),this.blockRemain=this.startBlockSize,this.remain=s.size,this.type=s.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=i(s.path),this.mode=s.mode,this.mode&&(this.mode=this.mode&4095),this.uid=s.uid,this.gid=s.gid,this.uname=s.uname,this.gname=s.gname,this.size=s.size,this.mtime=s.mtime,this.atime=s.atime,this.ctime=s.ctime,this.linkpath=i(s.linkpath),this.uname=s.uname,this.gname=s.gname,o&&this[n](o),a&&this[n](a,!0)}write(s){let o=s.length;if(o>this.blockRemain)throw new Error("writing more to entry than is appropriate");let a=this.remain,u=this.blockRemain;return this.remain=Math.max(0,a-o),this.blockRemain=Math.max(0,u-o),this.ignore?!0:a>=o?super.write(s):super.write(s.slice(0,a))}[n](s,o){for(let a in s)s[a]!==null&&s[a]!==void 0&&!(o&&a==="path")&&(this[a]=a==="path"||a==="linkpath"?i(s[a]):s[a])}}}),QD=te(t=>{"use strict";W(),t.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"]]),t.code=new Map(Array.from(t.name).map(e=>[e[1],e[0]]))}),rT=te((t,e)=>{"use strict";W();var r=(c,f)=>{if(Number.isSafeInteger(c))c<0?n(c,f):i(c,f);else throw Error("cannot encode number outside of javascript safe integer range");return f},i=(c,f)=>{f[0]=128;for(var h=f.length;h>1;h--)f[h-1]=c&255,c=Math.floor(c/256)},n=(c,f)=>{f[0]=255;var h=!1;c=c*-1;for(var p=f.length;p>1;p--){var g=c&255;c=Math.floor(c/256),h?f[p-1]=u(g):g===0?f[p-1]=0:(h=!0,f[p-1]=l(g))}},s=c=>{let f=c[0],h=f===128?a(c.slice(1,c.length)):f===255?o(c):null;if(h===null)throw Error("invalid base256 encoding");if(!Number.isSafeInteger(h))throw Error("parsed number outside of javascript safe integer range");return h},o=c=>{for(var f=c.length,h=0,p=!1,g=f-1;g>-1;g--){var y=c[g],E;p?E=u(y):y===0?E=y:(p=!0,E=l(y)),E!==0&&(h-=E*Math.pow(256,f-g-1))}return h},a=c=>{for(var f=c.length,h=0,p=f-1;p>-1;p--){var g=c[p];g!==0&&(h+=g*Math.pow(256,f-p-1))}return h},u=c=>(255^c)&255,l=c=>(255^c)+1&255;e.exports={encode:r,parse:s}}),Jn=te((t,e)=>{"use strict";W();var r=QD(),i=re("path").posix,n=rT(),s=Symbol("slurp"),o=Symbol("type"),a=class{constructor(b,S,N,H){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[o]="0",this.linkpath=null,this.uname=null,this.gname=null,this.devmaj=0,this.devmin=0,this.atime=null,this.ctime=null,Buffer.isBuffer(b)?this.decode(b,S||0,N,H):b&&this.set(b)}decode(b,S,N,H){if(S||(S=0),!b||!(b.length>=S+512))throw new Error("need 512 bytes for header");if(this.path=l(b,S,100),this.mode=h(b,S+100,8),this.uid=h(b,S+108,8),this.gid=h(b,S+116,8),this.size=h(b,S+124,12),this.mtime=c(b,S+136,12),this.cksum=h(b,S+148,12),this[s](N),this[s](H,!0),this[o]=l(b,S+156,1),this[o]===""&&(this[o]="0"),this[o]==="0"&&this.path.slice(-1)==="/"&&(this[o]="5"),this[o]==="5"&&(this.size=0),this.linkpath=l(b,S+157,100),b.slice(S+257,S+265).toString()==="ustar\x0000")if(this.uname=l(b,S+265,32),this.gname=l(b,S+297,32),this.devmaj=h(b,S+329,8),this.devmin=h(b,S+337,8),b[S+475]!==0){let U=l(b,S+345,155);this.path=U+"/"+this.path}else{let U=l(b,S+345,130);U&&(this.path=U+"/"+this.path),this.atime=c(b,S+476,12),this.ctime=c(b,S+488,12)}let T=8*32;for(let U=S;U<S+148;U++)T+=b[U];for(let U=S+156;U<S+512;U++)T+=b[U];this.cksumValid=T===this.cksum,this.cksum===null&&T===8*32&&(this.nullBlock=!0)}[s](b,S){for(let N in b)b[N]!==null&&b[N]!==void 0&&!(S&&N==="path")&&(this[N]=b[N])}encode(b,S){if(b||(b=this.block=Buffer.alloc(512),S=0),S||(S=0),!(b.length>=S+512))throw new Error("need 512 bytes for header");let N=this.ctime||this.atime?130:155,H=u(this.path||"",N),T=H[0],U=H[1];this.needPax=H[2],this.needPax=L(b,S,100,T)||this.needPax,this.needPax=E(b,S+100,8,this.mode)||this.needPax,this.needPax=E(b,S+108,8,this.uid)||this.needPax,this.needPax=E(b,S+116,8,this.gid)||this.needPax,this.needPax=E(b,S+124,12,this.size)||this.needPax,this.needPax=R(b,S+136,12,this.mtime)||this.needPax,b[S+156]=this[o].charCodeAt(0),this.needPax=L(b,S+157,100,this.linkpath)||this.needPax,b.write("ustar\x0000",S+257,8),this.needPax=L(b,S+265,32,this.uname)||this.needPax,this.needPax=L(b,S+297,32,this.gname)||this.needPax,this.needPax=E(b,S+329,8,this.devmaj)||this.needPax,this.needPax=E(b,S+337,8,this.devmin)||this.needPax,this.needPax=L(b,S+345,N,U)||this.needPax,b[S+475]!==0?this.needPax=L(b,S+345,155,U)||this.needPax:(this.needPax=L(b,S+345,130,U)||this.needPax,this.needPax=R(b,S+476,12,this.atime)||this.needPax,this.needPax=R(b,S+488,12,this.ctime)||this.needPax);let V=8*32;for(let K=S;K<S+148;K++)V+=b[K];for(let K=S+156;K<S+512;K++)V+=b[K];return this.cksum=V,E(b,S+148,8,this.cksum),this.cksumValid=!0,this.needPax}set(b){for(let S in b)b[S]!==null&&b[S]!==void 0&&(this[S]=b[S])}get type(){return r.name.get(this[o])||this[o]}get typeKey(){return this[o]}set type(b){r.code.has(b)?this[o]=r.code.get(b):this[o]=b}},u=(b,S)=>{let N=b,H="",T,U=i.parse(b).root||".";if(Buffer.byteLength(N)<100)T=[N,H,!1];else{H=i.dirname(N),N=i.basename(N);do Buffer.byteLength(N)<=100&&Buffer.byteLength(H)<=S?T=[N,H,!1]:Buffer.byteLength(N)>100&&Buffer.byteLength(H)<=S?T=[N.slice(0,100-1),H,!0]:(N=i.join(i.basename(H),N),H=i.dirname(H));while(H!==U&&!T);T||(T=[b.slice(0,100-1),"",!0])}return T},l=(b,S,N)=>b.slice(S,S+N).toString("utf8").replace(/\0.*/,""),c=(b,S,N)=>f(h(b,S,N)),f=b=>b===null?null:new Date(b*1e3),h=(b,S,N)=>b[S]&128?n.parse(b.slice(S,S+N)):g(b,S,N),p=b=>isNaN(b)?null:b,g=(b,S,N)=>p(parseInt(b.slice(S,S+N).toString("utf8").replace(/\0.*$/,"").trim(),8)),y={12:8589934591,8:2097151},E=(b,S,N,H)=>H===null?!1:H>y[N]||H<0?(n.encode(H,b.slice(S,S+N)),!0):(v(b,S,N,H),!1),v=(b,S,N,H)=>b.write(F(H,N),S,N,"ascii"),F=(b,S)=>O(Math.floor(b).toString(8),S),O=(b,S)=>(b.length===S-1?b:new Array(S-b.length-1).join("0")+b+" ")+"\0",R=(b,S,N,H)=>H===null?!1:E(b,S,N,H.getTime()/1e3),x=new Array(156).join("\0"),L=(b,S,N,H)=>H===null?!1:(b.write(H+x,S,N,"utf8"),H.length!==Buffer.byteLength(H)||H.length>N);e.exports=a}),Nh=te((t,e)=>{"use strict";W();var r=Jn(),i=re("path"),n=class{constructor(u,l){this.atime=u.atime||null,this.charset=u.charset||null,this.comment=u.comment||null,this.ctime=u.ctime||null,this.gid=u.gid||null,this.gname=u.gname||null,this.linkpath=u.linkpath||null,this.mtime=u.mtime||null,this.path=u.path||null,this.size=u.size||null,this.uid=u.uid||null,this.uname=u.uname||null,this.dev=u.dev||null,this.ino=u.ino||null,this.nlink=u.nlink||null,this.global=l||!1}encode(){let u=this.encodeBody();if(u==="")return null;let l=Buffer.byteLength(u),c=512*Math.ceil(1+l/512),f=Buffer.allocUnsafe(c);for(let h=0;h<512;h++)f[h]=0;new r({path:("PaxHeader/"+i.basename(this.path)).slice(0,99),mode:this.mode||420,uid:this.uid||null,gid:this.gid||null,size:l,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(f),f.write(u,512,l,"utf8");for(let h=l+512;h<f.length;h++)f[h]=0;return f}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(u){if(this[u]===null||this[u]===void 0)return"";let l=this[u]instanceof Date?this[u].getTime()/1e3:this[u],c=" "+(u==="dev"||u==="ino"||u==="nlink"?"SCHILY.":"")+u+"="+l+`
40
+ `:""}var pS=fS,dS={dump:pS};function qa(t,e){return function(){throw new Error("Function yaml."+t+" is removed in js-yaml 4. Use yaml."+e+" instead, which is now safe by default.")}}var mS=Oe,gS=_f,yS=vf,ES=Of,DS=kf,bS=Ma,_S=Vf.load,wS=Vf.loadAll,SS=dS.dump,AS=He,vS={binary:If,float:Ff,map:Af,null:Cf,pairs:Mf,set:jf,timestamp:Bf,bool:xf,int:Rf,merge:Pf,omap:Nf,seq:Sf,str:wf},CS=qa("safeLoad","load"),xS=qa("safeLoadAll","loadAll"),RS=qa("safeDump","dump"),FS={Type:mS,Schema:gS,FAILSAFE_SCHEMA:yS,JSON_SCHEMA:ES,CORE_SCHEMA:DS,DEFAULT_SCHEMA:bS,load:_S,loadAll:wS,dump:SS,YAMLException:AS,types:vS,safeLoad:CS,safeLoadAll:xS,safeDump:RS},Ua=FS;var UC=J(Ns());var ne={};r_(ne,{bold:()=>PC,dimmed:()=>NC,error:()=>e0,grey:()=>MC,info:()=>BC,item:()=>jC,log:()=>pr,turboBlue:()=>wi,turboGradient:()=>LC,turboLoader:()=>Xm,turboRed:()=>Zm,underline:()=>IC,warn:()=>Qm,yellow:()=>Jm});var fr=J(require("chalk")),Wm=J(require("ora")),Ym=J(require("gradient-string")),Vm="#0099F7",Km="#F11712",TC="#FFFF00",LC=(0,Ym.default)(Vm,Km),wi=fr.default.hex(Vm),Zm=fr.default.hex(Km),Jm=fr.default.hex(TC),Xm=t=>(0,Wm.default)({text:t,spinner:{frames:[" ",wi("> "),wi(">> "),wi(">>>")]}}),BC=(...t)=>{pr(wi.bold(">>>"),...t)},PC=(...t)=>{pr(fr.default.bold(...t))},IC=(...t)=>{pr(fr.default.underline(...t))},NC=(...t)=>{pr(fr.default.dim(...t))},MC=(...t)=>{pr(fr.default.grey(...t))},jC=(...t)=>{pr(wi.bold(" \u2022"),...t)},pr=(...t)=>{console.log(...t)},Qm=(...t)=>{console.error(Jm.bold(">>>"),...t)},e0=(...t)=>{console.error(Zm.bold(">>>"),...t)};var Ng=J(require("os")),Mg=J(ki());async function dr(t,e=[],r){let i={cwd:Ng.default.tmpdir(),env:{COREPACK_ENABLE_STRICT:"0"},...r};try{let{stdout:n}=await(0,Mg.default)(t,e,i);return n.trim()}catch{return}}async function Gl(){let[t,e,r,i]=await Promise.all([dr("yarnpkg",["--version"]),dr("npm",["--version"]),dr("pnpm",["--version"]),dr("bun",["--version"])]);return{yarn:t,pnpm:r,npm:e,bun:i}}async function zl(){let[t,e,r,i]=await Promise.all([dr("yarnpkg",["global","bin"]),dr("npm",["config","get","prefix"]),dr("pnpm",["bin","--global"]),dr("bun",["pm","--g","bin"])]);return{yarn:t,pnpm:r,npm:e,bun:i}}var NR=J(require("fs-extra"));var MR=J(require("path")),jR=J(require("fs-extra")),$R=J(require("chalk"));var ND=require("stream"),MD=require("util"),wk=require("path"),Sk=require("os"),jD=require("fs"),Ak=J(ID());var _I=(0,MD.promisify)(ND.Stream.pipeline);var $D=require("fs-extra");var Bk=J(require("path")),Pk=J(YD()),Ik=J(require("chalk")),kh=require("fs-extra");var Zb=require("commander");var ia={name:"@turbo/codemod",version:"2.0.0-canary.2",description:"Provides Codemod transformations to help upgrade your Turborepo codebase when a feature is deprecated.",homepage:"https://turbo.build/repo",license:"MIT",repository:{type:"git",url:"https://github.com/vercel/turbo",directory:"packages/turbo-codemod"},bugs:{url:"https://github.com/vercel/turbo/issues"},bin:"dist/cli.js",scripts:{build:"tsup",test:"jest",lint:"eslint src/","check-types":"tsc --noEmit","add-transformer":"plop","lint:prettier":"prettier -c . --cache --ignore-path=../../.prettierignore"},dependencies:{axios:"0.27.2",chalk:"2.4.2",commander:"^9.5.0",diff:"^5.1.0","find-up":"4.1.0","fs-extra":"^10.0.0","gradient-string":"^2.0.0",inquirer:"^8.2.4","inquirer-file-tree-selection-prompt":"^1.0.19","is-git-clean":"^1.1.0",ora:"4.1.1",semver:"^7.3.7","update-check":"^1.5.4"},devDependencies:{"@turbo/eslint-config":"workspace:*","@turbo/gen":"workspace:*","@turbo/test-utils":"workspace:*","@turbo/tsconfig":"workspace:*","@turbo/types":"workspace:*","@turbo/utils":"workspace:*","@turbo/workspaces":"workspace:*","@types/chalk-animation":"^1.6.0","@types/diff":"^5.0.2","@types/fs-extra":"^9.0.13","@types/gradient-string":"^1.1.2","@types/inquirer":"^8.2.0","@types/jest":"^27.4.0","@types/node":"^18.17.2","@types/semver":"^7.3.9","@types/uuid":"^9.0.0",deepmerge:"^4.2.2",jest:"^27.4.3",plop:"^3.1.1",semver:"^7.3.5","ts-jest":"^27.1.1",tsup:"^6.7.0",typescript:"5.3.3"},files:["dist"],publishConfig:{access:"public"}};var an=J(require("os")),zb=require("child_process"),$e=J(require("chalk")),Wb=require("inquirer");var Or=J(require("chalk"),1),ub=J(require("ora"),1),lb=J(require("gradient-string"),1);var PT=J(ki(),1),rN=require("fs-extra");var aN=J(Ns(),1),lN=require("fs-extra"),hN=require("fs-extra"),pN=require("chalk"),db=require("stream"),mb=require("util"),yN=require("fs-extra"),_N=require("chalk"),SN=require("fs-extra"),ii=J(require("path"),1),qe=require("fs-extra"),gb=J(ki(),1),yb=J(require("path"),1),Eb=require("fs-extra"),Db=J(require("chalk"),1),rr=J(require("path"),1),bb=J(ki(),1),rt=require("fs-extra"),_b=J(Ns(),1);var Yn=J(require("path"),1),Tt=require("fs-extra"),nn=J(require("path"),1),Lt=require("fs-extra"),Vn=J(require("path"),1),Bt=require("fs-extra"),gL=J(require("chalk"),1),yL=J(require("gradient-string"),1),EL=J(ki(),1),DL=J(require("ora"),1),bL=require("semver"),_L=J(require("chalk"),1),Mk=Object.create,Bh=Object.defineProperty,jk=Object.getOwnPropertyDescriptor,$k=Object.getOwnPropertyNames,Hk=Object.getPrototypeOf,qk=Object.prototype.hasOwnProperty,re=(t=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(t,{get:(e,r)=>(typeof require!="undefined"?require:e)[r]}):t)(function(t){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+t+'" is not supported')}),Uk=(t,e)=>()=>(t&&(e=t(t=0)),e),te=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Gk=(t,e)=>{for(var r in e)Bh(t,r,{get:e[r],enumerable:!0})},zk=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of $k(e))!qk.call(t,n)&&n!==r&&Bh(t,n,{get:()=>e[n],enumerable:!(i=jk(e,n))||i.enumerable});return t},oa=(t,e,r)=>(r=t!=null?Mk(Hk(t)):{},zk(e||!t||!t.__esModule?Bh(r,"default",{value:t,enumerable:!0}):r,t)),W=Uk(()=>{}),Wk=te((t,e)=>{W();function r(i){return e.exports=r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},e.exports.__esModule=!0,e.exports.default=e.exports,r(i)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports}),Yk=te((t,e)=>{W();var r=Wk().default;function i(){"use strict";e.exports=i=function(){return s},e.exports.__esModule=!0,e.exports.default=e.exports;var n,s={},o=Object.prototype,a=o.hasOwnProperty,u=Object.defineProperty||function(P,d,m){P[d]=m.value},l=typeof Symbol=="function"?Symbol:{},c=l.iterator||"@@iterator",f=l.asyncIterator||"@@asyncIterator",h=l.toStringTag||"@@toStringTag";function p(P,d,m){return Object.defineProperty(P,d,{value:m,enumerable:!0,configurable:!0,writable:!0}),P[d]}try{p({},"")}catch{p=function(P,d,m){return P[d]=m}}function g(P,d,m,D){var A=d&&d.prototype instanceof x?d:x,w=Object.create(A.prototype),I=new j(D||[]);return u(w,"_invoke",{value:K(P,m,I)}),w}function y(P,d,m){try{return{type:"normal",arg:P.call(d,m)}}catch(D){return{type:"throw",arg:D}}}s.wrap=g;var E="suspendedStart",v="suspendedYield",F="executing",O="completed",R={};function x(){}function L(){}function b(){}var S={};p(S,c,function(){return this});var N=Object.getPrototypeOf,H=N&&N(N(z([])));H&&H!==o&&a.call(H,c)&&(S=H);var T=b.prototype=x.prototype=Object.create(S);function U(P){["next","throw","return"].forEach(function(d){p(P,d,function(m){return this._invoke(d,m)})})}function V(P,d){function m(A,w,I,M){var Z=y(P[A],P,w);if(Z.type!=="throw"){var q=Z.arg,Q=q.value;return Q&&r(Q)=="object"&&a.call(Q,"__await")?d.resolve(Q.__await).then(function(G){m("next",G,I,M)},function(G){m("throw",G,I,M)}):d.resolve(Q).then(function(G){q.value=G,I(q)},function(G){return m("throw",G,I,M)})}M(Z.arg)}var D;u(this,"_invoke",{value:function(A,w){function I(){return new d(function(M,Z){m(A,w,M,Z)})}return D=D?D.then(I,I):I()}})}function K(P,d,m){var D=E;return function(A,w){if(D===F)throw new Error("Generator is already running");if(D===O){if(A==="throw")throw w;return{value:n,done:!0}}for(m.method=A,m.arg=w;;){var I=m.delegate;if(I){var M=B(I,m);if(M){if(M===R)continue;return M}}if(m.method==="next")m.sent=m._sent=m.arg;else if(m.method==="throw"){if(D===E)throw D=O,m.arg;m.dispatchException(m.arg)}else m.method==="return"&&m.abrupt("return",m.arg);D=F;var Z=y(P,d,m);if(Z.type==="normal"){if(D=m.done?O:v,Z.arg===R)continue;return{value:Z.arg,done:m.done}}Z.type==="throw"&&(D=O,m.method="throw",m.arg=Z.arg)}}}function B(P,d){var m=d.method,D=P.iterator[m];if(D===n)return d.delegate=null,m==="throw"&&P.iterator.return&&(d.method="return",d.arg=n,B(P,d),d.method==="throw")||m!=="return"&&(d.method="throw",d.arg=new TypeError("The iterator does not provide a '"+m+"' method")),R;var A=y(D,P.iterator,d.arg);if(A.type==="throw")return d.method="throw",d.arg=A.arg,d.delegate=null,R;var w=A.arg;return w?w.done?(d[P.resultName]=w.value,d.next=P.nextLoc,d.method!=="return"&&(d.method="next",d.arg=n),d.delegate=null,R):w:(d.method="throw",d.arg=new TypeError("iterator result is not an object"),d.delegate=null,R)}function C(P){var d={tryLoc:P[0]};1 in P&&(d.catchLoc=P[1]),2 in P&&(d.finallyLoc=P[2],d.afterLoc=P[3]),this.tryEntries.push(d)}function k(P){var d=P.completion||{};d.type="normal",delete d.arg,P.completion=d}function j(P){this.tryEntries=[{tryLoc:"root"}],P.forEach(C,this),this.reset(!0)}function z(P){if(P||P===""){var d=P[c];if(d)return d.call(P);if(typeof P.next=="function")return P;if(!isNaN(P.length)){var m=-1,D=function A(){for(;++m<P.length;)if(a.call(P,m))return A.value=P[m],A.done=!1,A;return A.value=n,A.done=!0,A};return D.next=D}}throw new TypeError(r(P)+" is not iterable")}return L.prototype=b,u(T,"constructor",{value:b,configurable:!0}),u(b,"constructor",{value:L,configurable:!0}),L.displayName=p(b,h,"GeneratorFunction"),s.isGeneratorFunction=function(P){var d=typeof P=="function"&&P.constructor;return!!d&&(d===L||(d.displayName||d.name)==="GeneratorFunction")},s.mark=function(P){return Object.setPrototypeOf?Object.setPrototypeOf(P,b):(P.__proto__=b,p(P,h,"GeneratorFunction")),P.prototype=Object.create(T),P},s.awrap=function(P){return{__await:P}},U(V.prototype),p(V.prototype,f,function(){return this}),s.AsyncIterator=V,s.async=function(P,d,m,D,A){A===void 0&&(A=Promise);var w=new V(g(P,d,m,D),A);return s.isGeneratorFunction(d)?w:w.next().then(function(I){return I.done?I.value:w.next()})},U(T),p(T,h,"Generator"),p(T,c,function(){return this}),p(T,"toString",function(){return"[object Generator]"}),s.keys=function(P){var d=Object(P),m=[];for(var D in d)m.push(D);return m.reverse(),function A(){for(;m.length;){var w=m.pop();if(w in d)return A.value=w,A.done=!1,A}return A.done=!0,A}},s.values=z,j.prototype={constructor:j,reset:function(P){if(this.prev=0,this.next=0,this.sent=this._sent=n,this.done=!1,this.delegate=null,this.method="next",this.arg=n,this.tryEntries.forEach(k),!P)for(var d in this)d.charAt(0)==="t"&&a.call(this,d)&&!isNaN(+d.slice(1))&&(this[d]=n)},stop:function(){this.done=!0;var P=this.tryEntries[0].completion;if(P.type==="throw")throw P.arg;return this.rval},dispatchException:function(P){if(this.done)throw P;var d=this;function m(Z,q){return w.type="throw",w.arg=P,d.next=Z,q&&(d.method="next",d.arg=n),!!q}for(var D=this.tryEntries.length-1;D>=0;--D){var A=this.tryEntries[D],w=A.completion;if(A.tryLoc==="root")return m("end");if(A.tryLoc<=this.prev){var I=a.call(A,"catchLoc"),M=a.call(A,"finallyLoc");if(I&&M){if(this.prev<A.catchLoc)return m(A.catchLoc,!0);if(this.prev<A.finallyLoc)return m(A.finallyLoc)}else if(I){if(this.prev<A.catchLoc)return m(A.catchLoc,!0)}else{if(!M)throw new Error("try statement without catch or finally");if(this.prev<A.finallyLoc)return m(A.finallyLoc)}}}},abrupt:function(P,d){for(var m=this.tryEntries.length-1;m>=0;--m){var D=this.tryEntries[m];if(D.tryLoc<=this.prev&&a.call(D,"finallyLoc")&&this.prev<D.finallyLoc){var A=D;break}}A&&(P==="break"||P==="continue")&&A.tryLoc<=d&&d<=A.finallyLoc&&(A=null);var w=A?A.completion:{};return w.type=P,w.arg=d,A?(this.method="next",this.next=A.finallyLoc,R):this.complete(w)},complete:function(P,d){if(P.type==="throw")throw P.arg;return P.type==="break"||P.type==="continue"?this.next=P.arg:P.type==="return"?(this.rval=this.arg=P.arg,this.method="return",this.next="end"):P.type==="normal"&&d&&(this.next=d),R},finish:function(P){for(var d=this.tryEntries.length-1;d>=0;--d){var m=this.tryEntries[d];if(m.finallyLoc===P)return this.complete(m.completion,m.afterLoc),k(m),R}},catch:function(P){for(var d=this.tryEntries.length-1;d>=0;--d){var m=this.tryEntries[d];if(m.tryLoc===P){var D=m.completion;if(D.type==="throw"){var A=D.arg;k(m)}return A}}throw new Error("illegal catch attempt")},delegateYield:function(P,d,m){return this.delegate={iterator:z(P),resultName:d,nextLoc:m},this.method==="next"&&(this.arg=n),R}},s}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports}),Vk=te((t,e)=>{W();var r=Yk()();e.exports=r;try{regeneratorRuntime=r}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}}),Kk=te((t,e)=>{"use strict";W();var r=(i,...n)=>new Promise(s=>{s(i(...n))});e.exports=r,e.exports.default=r}),Zk=te((t,e)=>{"use strict";W();var r=Kk(),i=n=>{if(!((Number.isInteger(n)||n===1/0)&&n>0))return Promise.reject(new TypeError("Expected `concurrency` to be a number from 1 and up"));let s=[],o=0,a=()=>{o--,s.length>0&&s.shift()()},u=(f,h,...p)=>{o++;let g=r(f,...p);h(g),g.then(a,a)},l=(f,h,...p)=>{o<n?u(f,h,...p):s.push(u.bind(null,f,h,...p))},c=(f,...h)=>new Promise(p=>l(f,p,...h));return Object.defineProperties(c,{activeCount:{get:()=>o},pendingCount:{get:()=>s.length},clearQueue:{value:()=>{s.length=0}}}),c};e.exports=i,e.exports.default=i}),Jk=te((t,e)=>{"use strict";W();var r=Zk(),i=class extends Error{constructor(a){super(),this.value=a}},n=async(a,u)=>u(await a),s=async a=>{let u=await Promise.all(a);if(u[1]===!0)throw new i(u[0]);return!1},o=async(a,u,l)=>{l={concurrency:1/0,preserveOrder:!0,...l};let c=r(l.concurrency),f=[...a].map(p=>[p,c(n,p,u)]),h=r(l.preserveOrder?1:1/0);try{await Promise.all(f.map(p=>h(s,p)))}catch(p){if(p instanceof i)return p.value;throw p}};e.exports=o,e.exports.default=o}),Xk=te((t,e)=>{"use strict";W();var r=re("path"),i=re("fs"),{promisify:n}=re("util"),s=Jk(),o=n(i.stat),a=n(i.lstat),u={directory:"isDirectory",file:"isFile"};function l({type:f}){if(!(f in u))throw new Error(`Invalid type specified: ${f}`)}var c=(f,h)=>f===void 0||h[u[f]]();e.exports=async(f,h)=>{h={cwd:process.cwd(),type:"file",allowSymlinks:!0,...h},l(h);let p=h.allowSymlinks?o:a;return s(f,async g=>{try{let y=await p(r.resolve(h.cwd,g));return c(h.type,y)}catch{return!1}},h)},e.exports.sync=(f,h)=>{h={cwd:process.cwd(),allowSymlinks:!0,type:"file",...h},l(h);let p=h.allowSymlinks?i.statSync:i.lstatSync;for(let g of f)try{let y=p(r.resolve(h.cwd,g));if(c(h.type,y))return g}catch{}}}),Qk=te((t,e)=>{"use strict";W();var r=re("fs"),{promisify:i}=re("util"),n=i(r.access);e.exports=async s=>{try{return await n(s),!0}catch{return!1}},e.exports.sync=s=>{try{return r.accessSync(s),!0}catch{return!1}}}),eT=te((t,e)=>{"use strict";W();var r=re("path"),i=Xk(),n=Qk(),s=Symbol("findUp.stop");e.exports=async(o,a={})=>{let u=r.resolve(a.cwd||""),{root:l}=r.parse(u),c=[].concat(o),f=async h=>{if(typeof o!="function")return i(c,h);let p=await o(h.cwd);return typeof p=="string"?i([p],h):p};for(;;){let h=await f({...a,cwd:u});if(h===s)return;if(h)return r.resolve(u,h);if(u===l)return;u=r.dirname(u)}},e.exports.sync=(o,a={})=>{let u=r.resolve(a.cwd||""),{root:l}=r.parse(u),c=[].concat(o),f=h=>{if(typeof o!="function")return i.sync(c,h);let p=o(h.cwd);return typeof p=="string"?i.sync([p],h):p};for(;;){let h=f({...a,cwd:u});if(h===s)return;if(h)return r.resolve(u,h);if(u===l)return;u=r.dirname(u)}},e.exports.exists=n,e.exports.sync.exists=n.sync,e.exports.stop=s}),Kn=te((t,e)=>{"use strict";W();var r=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"]]);e.exports=i=>i?Object.keys(i).map(n=>[r.has(n)?r.get(n):n,i[n]]).reduce((n,s)=>(n[s[0]]=s[1],n),Object.create(null)):{}}),Ph=te((t,e)=>{"use strict";W();var r=typeof process=="object"&&process?process:{stdout:null,stderr:null},i=re("events"),n=re("stream"),s=re("string_decoder").StringDecoder,o=Symbol("EOF"),a=Symbol("maybeEmitEnd"),u=Symbol("emittedEnd"),l=Symbol("emittingEnd"),c=Symbol("emittedError"),f=Symbol("closed"),h=Symbol("read"),p=Symbol("flush"),g=Symbol("flushChunk"),y=Symbol("encoding"),E=Symbol("decoder"),v=Symbol("flowing"),F=Symbol("paused"),O=Symbol("resume"),R=Symbol("buffer"),x=Symbol("pipes"),L=Symbol("bufferLength"),b=Symbol("bufferPush"),S=Symbol("bufferShift"),N=Symbol("objectMode"),H=Symbol("destroyed"),T=Symbol("emitData"),U=Symbol("emitEnd"),V=Symbol("emitEnd2"),K=Symbol("async"),B=A=>Promise.resolve().then(A),C=global._MP_NO_ITERATOR_SYMBOLS_!=="1",k=C&&Symbol.asyncIterator||Symbol("asyncIterator not implemented"),j=C&&Symbol.iterator||Symbol("iterator not implemented"),z=A=>A==="end"||A==="finish"||A==="prefinish",P=A=>A instanceof ArrayBuffer||typeof A=="object"&&A.constructor&&A.constructor.name==="ArrayBuffer"&&A.byteLength>=0,d=A=>!Buffer.isBuffer(A)&&ArrayBuffer.isView(A),m=class{constructor(A,w,I){this.src=A,this.dest=w,this.opts=I,this.ondrain=()=>A[O](),w.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},D=class extends m{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(A,w,I){super(A,w,I),this.proxyErrors=M=>w.emit("error",M),A.on("error",this.proxyErrors)}};e.exports=class KD extends n{constructor(w){super(),this[v]=!1,this[F]=!1,this[x]=[],this[R]=[],this[N]=w&&w.objectMode||!1,this[N]?this[y]=null:this[y]=w&&w.encoding||null,this[y]==="buffer"&&(this[y]=null),this[K]=w&&!!w.async||!1,this[E]=this[y]?new s(this[y]):null,this[o]=!1,this[u]=!1,this[l]=!1,this[f]=!1,this[c]=null,this.writable=!0,this.readable=!0,this[L]=0,this[H]=!1,w&&w.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[R]}),w&&w.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[x]})}get bufferLength(){return this[L]}get encoding(){return this[y]}set encoding(w){if(this[N])throw new Error("cannot set encoding in objectMode");if(this[y]&&w!==this[y]&&(this[E]&&this[E].lastNeed||this[L]))throw new Error("cannot change encoding");this[y]!==w&&(this[E]=w?new s(w):null,this[R].length&&(this[R]=this[R].map(I=>this[E].write(I)))),this[y]=w}setEncoding(w){this.encoding=w}get objectMode(){return this[N]}set objectMode(w){this[N]=this[N]||!!w}get async(){return this[K]}set async(w){this[K]=this[K]||!!w}write(w,I,M){if(this[o])throw new Error("write after end");if(this[H])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof I=="function"&&(M=I,I="utf8"),I||(I="utf8");let Z=this[K]?B:q=>q();return!this[N]&&!Buffer.isBuffer(w)&&(d(w)?w=Buffer.from(w.buffer,w.byteOffset,w.byteLength):P(w)?w=Buffer.from(w):typeof w!="string"&&(this.objectMode=!0)),this[N]?(this.flowing&&this[L]!==0&&this[p](!0),this.flowing?this.emit("data",w):this[b](w),this[L]!==0&&this.emit("readable"),M&&Z(M),this.flowing):w.length?(typeof w=="string"&&!(I===this[y]&&!this[E].lastNeed)&&(w=Buffer.from(w,I)),Buffer.isBuffer(w)&&this[y]&&(w=this[E].write(w)),this.flowing&&this[L]!==0&&this[p](!0),this.flowing?this.emit("data",w):this[b](w),this[L]!==0&&this.emit("readable"),M&&Z(M),this.flowing):(this[L]!==0&&this.emit("readable"),M&&Z(M),this.flowing)}read(w){if(this[H])return null;if(this[L]===0||w===0||w>this[L])return this[a](),null;this[N]&&(w=null),this[R].length>1&&!this[N]&&(this.encoding?this[R]=[this[R].join("")]:this[R]=[Buffer.concat(this[R],this[L])]);let I=this[h](w||null,this[R][0]);return this[a](),I}[h](w,I){return w===I.length||w===null?this[S]():(this[R][0]=I.slice(w),I=I.slice(0,w),this[L]-=w),this.emit("data",I),!this[R].length&&!this[o]&&this.emit("drain"),I}end(w,I,M){return typeof w=="function"&&(M=w,w=null),typeof I=="function"&&(M=I,I="utf8"),w&&this.write(w,I),M&&this.once("end",M),this[o]=!0,this.writable=!1,(this.flowing||!this[F])&&this[a](),this}[O](){this[H]||(this[F]=!1,this[v]=!0,this.emit("resume"),this[R].length?this[p]():this[o]?this[a]():this.emit("drain"))}resume(){return this[O]()}pause(){this[v]=!1,this[F]=!0}get destroyed(){return this[H]}get flowing(){return this[v]}get paused(){return this[F]}[b](w){this[N]?this[L]+=1:this[L]+=w.length,this[R].push(w)}[S](){return this[R].length&&(this[N]?this[L]-=1:this[L]-=this[R][0].length),this[R].shift()}[p](w){do;while(this[g](this[S]()));!w&&!this[R].length&&!this[o]&&this.emit("drain")}[g](w){return w?(this.emit("data",w),this.flowing):!1}pipe(w,I){if(this[H])return;let M=this[u];return I=I||{},w===r.stdout||w===r.stderr?I.end=!1:I.end=I.end!==!1,I.proxyErrors=!!I.proxyErrors,M?I.end&&w.end():(this[x].push(I.proxyErrors?new D(this,w,I):new m(this,w,I)),this[K]?B(()=>this[O]()):this[O]()),w}unpipe(w){let I=this[x].find(M=>M.dest===w);I&&(this[x].splice(this[x].indexOf(I),1),I.unpipe())}addListener(w,I){return this.on(w,I)}on(w,I){let M=super.on(w,I);return w==="data"&&!this[x].length&&!this.flowing?this[O]():w==="readable"&&this[L]!==0?super.emit("readable"):z(w)&&this[u]?(super.emit(w),this.removeAllListeners(w)):w==="error"&&this[c]&&(this[K]?B(()=>I.call(this,this[c])):I.call(this,this[c])),M}get emittedEnd(){return this[u]}[a](){!this[l]&&!this[u]&&!this[H]&&this[R].length===0&&this[o]&&(this[l]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[f]&&this.emit("close"),this[l]=!1)}emit(w,I,...M){if(w!=="error"&&w!=="close"&&w!==H&&this[H])return;if(w==="data")return I?this[K]?B(()=>this[T](I)):this[T](I):!1;if(w==="end")return this[U]();if(w==="close"){if(this[f]=!0,!this[u]&&!this[H])return;let q=super.emit("close");return this.removeAllListeners("close"),q}else if(w==="error"){this[c]=I;let q=super.emit("error",I);return this[a](),q}else if(w==="resume"){let q=super.emit("resume");return this[a](),q}else if(w==="finish"||w==="prefinish"){let q=super.emit(w);return this.removeAllListeners(w),q}let Z=super.emit(w,I,...M);return this[a](),Z}[T](w){for(let M of this[x])M.dest.write(w)===!1&&this.pause();let I=super.emit("data",w);return this[a](),I}[U](){this[u]||(this[u]=!0,this.readable=!1,this[K]?B(()=>this[V]()):this[V]())}[V](){if(this[E]){let I=this[E].end();if(I){for(let M of this[x])M.dest.write(I);super.emit("data",I)}}for(let I of this[x])I.end();let w=super.emit("end");return this.removeAllListeners("end"),w}collect(){let w=[];this[N]||(w.dataLength=0);let I=this.promise();return this.on("data",M=>{w.push(M),this[N]||(w.dataLength+=M.length)}),I.then(()=>w)}concat(){return this[N]?Promise.reject(new Error("cannot concat in objectMode")):this.collect().then(w=>this[N]?Promise.reject(new Error("cannot concat in objectMode")):this[y]?w.join(""):Buffer.concat(w,w.dataLength))}promise(){return new Promise((w,I)=>{this.on(H,()=>I(new Error("stream destroyed"))),this.on("error",M=>I(M)),this.on("end",()=>w())})}[k](){return{next:()=>{let w=this.read();if(w!==null)return Promise.resolve({done:!1,value:w});if(this[o])return Promise.resolve({done:!0});let I=null,M=null,Z=ie=>{this.removeListener("data",q),this.removeListener("end",Q),M(ie)},q=ie=>{this.removeListener("error",Z),this.removeListener("end",Q),this.pause(),I({value:ie,done:!!this[o]})},Q=()=>{this.removeListener("error",Z),this.removeListener("data",q),I({done:!0})},G=()=>Z(new Error("stream destroyed"));return new Promise((ie,ce)=>{M=ce,I=ie,this.once(H,G),this.once("error",Z),this.once("end",Q),this.once("data",q)})}}}[j](){return{next:()=>{let w=this.read();return{value:w,done:w===null}}}}destroy(w){return this[H]?(w?this.emit("error",w):this.emit(H),this):(this[H]=!0,this[R].length=0,this[L]=0,typeof this.close=="function"&&!this[f]&&this.close(),w?this.emit("error",w):this.emit(H),this)}static isStream(w){return!!w&&(w instanceof KD||w instanceof n||w instanceof i&&(typeof w.pipe=="function"||typeof w.write=="function"&&typeof w.end=="function"))}}}),tT=te((t,e)=>{W();var r=re("zlib").constants||{ZLIB_VERNUM:4736};e.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},r))}),ZD=te((t,e)=>{"use strict";W();var r=typeof process=="object"&&process?process:{stdout:null,stderr:null},i=re("events"),n=re("stream"),s=re("string_decoder").StringDecoder,o=Symbol("EOF"),a=Symbol("maybeEmitEnd"),u=Symbol("emittedEnd"),l=Symbol("emittingEnd"),c=Symbol("emittedError"),f=Symbol("closed"),h=Symbol("read"),p=Symbol("flush"),g=Symbol("flushChunk"),y=Symbol("encoding"),E=Symbol("decoder"),v=Symbol("flowing"),F=Symbol("paused"),O=Symbol("resume"),R=Symbol("bufferLength"),x=Symbol("bufferPush"),L=Symbol("bufferShift"),b=Symbol("objectMode"),S=Symbol("destroyed"),N=Symbol("emitData"),H=Symbol("emitEnd"),T=Symbol("emitEnd2"),U=Symbol("async"),V=m=>Promise.resolve().then(m),K=global._MP_NO_ITERATOR_SYMBOLS_!=="1",B=K&&Symbol.asyncIterator||Symbol("asyncIterator not implemented"),C=K&&Symbol.iterator||Symbol("iterator not implemented"),k=m=>m==="end"||m==="finish"||m==="prefinish",j=m=>m instanceof ArrayBuffer||typeof m=="object"&&m.constructor&&m.constructor.name==="ArrayBuffer"&&m.byteLength>=0,z=m=>!Buffer.isBuffer(m)&&ArrayBuffer.isView(m),P=class{constructor(m,D,A){this.src=m,this.dest=D,this.opts=A,this.ondrain=()=>m[O](),D.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},d=class extends P{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(m,D,A){super(m,D,A),this.proxyErrors=w=>D.emit("error",w),m.on("error",this.proxyErrors)}};e.exports=class JD extends n{constructor(D){super(),this[v]=!1,this[F]=!1,this.pipes=[],this.buffer=[],this[b]=D&&D.objectMode||!1,this[b]?this[y]=null:this[y]=D&&D.encoding||null,this[y]==="buffer"&&(this[y]=null),this[U]=D&&!!D.async||!1,this[E]=this[y]?new s(this[y]):null,this[o]=!1,this[u]=!1,this[l]=!1,this[f]=!1,this[c]=null,this.writable=!0,this.readable=!0,this[R]=0,this[S]=!1}get bufferLength(){return this[R]}get encoding(){return this[y]}set encoding(D){if(this[b])throw new Error("cannot set encoding in objectMode");if(this[y]&&D!==this[y]&&(this[E]&&this[E].lastNeed||this[R]))throw new Error("cannot change encoding");this[y]!==D&&(this[E]=D?new s(D):null,this.buffer.length&&(this.buffer=this.buffer.map(A=>this[E].write(A)))),this[y]=D}setEncoding(D){this.encoding=D}get objectMode(){return this[b]}set objectMode(D){this[b]=this[b]||!!D}get async(){return this[U]}set async(D){this[U]=this[U]||!!D}write(D,A,w){if(this[o])throw new Error("write after end");if(this[S])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof A=="function"&&(w=A,A="utf8"),A||(A="utf8");let I=this[U]?V:M=>M();return!this[b]&&!Buffer.isBuffer(D)&&(z(D)?D=Buffer.from(D.buffer,D.byteOffset,D.byteLength):j(D)?D=Buffer.from(D):typeof D!="string"&&(this.objectMode=!0)),this[b]?(this.flowing&&this[R]!==0&&this[p](!0),this.flowing?this.emit("data",D):this[x](D),this[R]!==0&&this.emit("readable"),w&&I(w),this.flowing):D.length?(typeof D=="string"&&!(A===this[y]&&!this[E].lastNeed)&&(D=Buffer.from(D,A)),Buffer.isBuffer(D)&&this[y]&&(D=this[E].write(D)),this.flowing&&this[R]!==0&&this[p](!0),this.flowing?this.emit("data",D):this[x](D),this[R]!==0&&this.emit("readable"),w&&I(w),this.flowing):(this[R]!==0&&this.emit("readable"),w&&I(w),this.flowing)}read(D){if(this[S])return null;if(this[R]===0||D===0||D>this[R])return this[a](),null;this[b]&&(D=null),this.buffer.length>1&&!this[b]&&(this.encoding?this.buffer=[this.buffer.join("")]:this.buffer=[Buffer.concat(this.buffer,this[R])]);let A=this[h](D||null,this.buffer[0]);return this[a](),A}[h](D,A){return D===A.length||D===null?this[L]():(this.buffer[0]=A.slice(D),A=A.slice(0,D),this[R]-=D),this.emit("data",A),!this.buffer.length&&!this[o]&&this.emit("drain"),A}end(D,A,w){return typeof D=="function"&&(w=D,D=null),typeof A=="function"&&(w=A,A="utf8"),D&&this.write(D,A),w&&this.once("end",w),this[o]=!0,this.writable=!1,(this.flowing||!this[F])&&this[a](),this}[O](){this[S]||(this[F]=!1,this[v]=!0,this.emit("resume"),this.buffer.length?this[p]():this[o]?this[a]():this.emit("drain"))}resume(){return this[O]()}pause(){this[v]=!1,this[F]=!0}get destroyed(){return this[S]}get flowing(){return this[v]}get paused(){return this[F]}[x](D){this[b]?this[R]+=1:this[R]+=D.length,this.buffer.push(D)}[L](){return this.buffer.length&&(this[b]?this[R]-=1:this[R]-=this.buffer[0].length),this.buffer.shift()}[p](D){do;while(this[g](this[L]()));!D&&!this.buffer.length&&!this[o]&&this.emit("drain")}[g](D){return D?(this.emit("data",D),this.flowing):!1}pipe(D,A){if(this[S])return;let w=this[u];return A=A||{},D===r.stdout||D===r.stderr?A.end=!1:A.end=A.end!==!1,A.proxyErrors=!!A.proxyErrors,w?A.end&&D.end():(this.pipes.push(A.proxyErrors?new d(this,D,A):new P(this,D,A)),this[U]?V(()=>this[O]()):this[O]()),D}unpipe(D){let A=this.pipes.find(w=>w.dest===D);A&&(this.pipes.splice(this.pipes.indexOf(A),1),A.unpipe())}addListener(D,A){return this.on(D,A)}on(D,A){let w=super.on(D,A);return D==="data"&&!this.pipes.length&&!this.flowing?this[O]():D==="readable"&&this[R]!==0?super.emit("readable"):k(D)&&this[u]?(super.emit(D),this.removeAllListeners(D)):D==="error"&&this[c]&&(this[U]?V(()=>A.call(this,this[c])):A.call(this,this[c])),w}get emittedEnd(){return this[u]}[a](){!this[l]&&!this[u]&&!this[S]&&this.buffer.length===0&&this[o]&&(this[l]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[f]&&this.emit("close"),this[l]=!1)}emit(D,A,...w){if(D!=="error"&&D!=="close"&&D!==S&&this[S])return;if(D==="data")return A?this[U]?V(()=>this[N](A)):this[N](A):!1;if(D==="end")return this[H]();if(D==="close"){if(this[f]=!0,!this[u]&&!this[S])return;let M=super.emit("close");return this.removeAllListeners("close"),M}else if(D==="error"){this[c]=A;let M=super.emit("error",A);return this[a](),M}else if(D==="resume"){let M=super.emit("resume");return this[a](),M}else if(D==="finish"||D==="prefinish"){let M=super.emit(D);return this.removeAllListeners(D),M}let I=super.emit(D,A,...w);return this[a](),I}[N](D){for(let w of this.pipes)w.dest.write(D)===!1&&this.pause();let A=super.emit("data",D);return this[a](),A}[H](){this[u]||(this[u]=!0,this.readable=!1,this[U]?V(()=>this[T]()):this[T]())}[T](){if(this[E]){let A=this[E].end();if(A){for(let w of this.pipes)w.dest.write(A);super.emit("data",A)}}for(let A of this.pipes)A.end();let D=super.emit("end");return this.removeAllListeners("end"),D}collect(){let D=[];this[b]||(D.dataLength=0);let A=this.promise();return this.on("data",w=>{D.push(w),this[b]||(D.dataLength+=w.length)}),A.then(()=>D)}concat(){return this[b]?Promise.reject(new Error("cannot concat in objectMode")):this.collect().then(D=>this[b]?Promise.reject(new Error("cannot concat in objectMode")):this[y]?D.join(""):Buffer.concat(D,D.dataLength))}promise(){return new Promise((D,A)=>{this.on(S,()=>A(new Error("stream destroyed"))),this.on("error",w=>A(w)),this.on("end",()=>D())})}[B](){return{next:()=>{let D=this.read();if(D!==null)return Promise.resolve({done:!1,value:D});if(this[o])return Promise.resolve({done:!0});let A=null,w=null,I=Q=>{this.removeListener("data",M),this.removeListener("end",Z),w(Q)},M=Q=>{this.removeListener("error",I),this.removeListener("end",Z),this.pause(),A({value:Q,done:!!this[o]})},Z=()=>{this.removeListener("error",I),this.removeListener("data",M),A({done:!0})},q=()=>I(new Error("stream destroyed"));return new Promise((Q,G)=>{w=G,A=Q,this.once(S,q),this.once("error",I),this.once("end",Z),this.once("data",M)})}}}[C](){return{next:()=>{let D=this.read();return{value:D,done:D===null}}}}destroy(D){return this[S]?(D?this.emit("error",D):this.emit(S),this):(this[S]=!0,this.buffer.length=0,this[R]=0,typeof this.close=="function"&&!this[f]&&this.close(),D?this.emit("error",D):this.emit(S),this)}static isStream(D){return!!D&&(D instanceof JD||D instanceof n||D instanceof i&&(typeof D.pipe=="function"||typeof D.write=="function"&&typeof D.end=="function"))}}}),XD=te(t=>{"use strict";W();var e=re("assert"),r=re("buffer").Buffer,i=re("zlib"),n=t.constants=tT(),s=ZD(),o=r.concat,a=Symbol("_superWrite"),u=class extends Error{constructor(k){super("zlib: "+k.message),this.code=k.code,this.errno=k.errno,this.code||(this.code="ZLIB_ERROR"),this.message="zlib: "+k.message,Error.captureStackTrace(this,this.constructor)}get name(){return"ZlibError"}},l=Symbol("opts"),c=Symbol("flushFlag"),f=Symbol("finishFlushFlag"),h=Symbol("fullFlushFlag"),p=Symbol("handle"),g=Symbol("onError"),y=Symbol("sawError"),E=Symbol("level"),v=Symbol("strategy"),F=Symbol("ended"),O=Symbol("_defaultFullFlush"),R=class extends s{constructor(k,j){if(!k||typeof k!="object")throw new TypeError("invalid options for ZlibBase constructor");super(k),this[y]=!1,this[F]=!1,this[l]=k,this[c]=k.flush,this[f]=k.finishFlush;try{this[p]=new i[j](k)}catch(z){throw new u(z)}this[g]=z=>{this[y]||(this[y]=!0,this.close(),this.emit("error",z))},this[p].on("error",z=>this[g](new u(z))),this.once("end",()=>this.close)}close(){this[p]&&(this[p].close(),this[p]=null,this.emit("close"))}reset(){if(!this[y])return e(this[p],"zlib binding closed"),this[p].reset()}flush(k){this.ended||(typeof k!="number"&&(k=this[h]),this.write(Object.assign(r.alloc(0),{[c]:k})))}end(k,j,z){return k&&this.write(k,j),this.flush(this[f]),this[F]=!0,super.end(null,null,z)}get ended(){return this[F]}write(k,j,z){if(typeof j=="function"&&(z=j,j="utf8"),typeof k=="string"&&(k=r.from(k,j)),this[y])return;e(this[p],"zlib binding closed");let P=this[p]._handle,d=P.close;P.close=()=>{};let m=this[p].close;this[p].close=()=>{},r.concat=w=>w;let D;try{let w=typeof k[c]=="number"?k[c]:this[c];D=this[p]._processChunk(k,w),r.concat=o}catch(w){r.concat=o,this[g](new u(w))}finally{this[p]&&(this[p]._handle=P,P.close=d,this[p].close=m,this[p].removeAllListeners("error"))}this[p]&&this[p].on("error",w=>this[g](new u(w)));let A;if(D)if(Array.isArray(D)&&D.length>0){A=this[a](r.from(D[0]));for(let w=1;w<D.length;w++)A=this[a](D[w])}else A=this[a](r.from(D));return z&&z(),A}[a](k){return super.write(k)}},x=class extends R{constructor(k,j){k=k||{},k.flush=k.flush||n.Z_NO_FLUSH,k.finishFlush=k.finishFlush||n.Z_FINISH,super(k,j),this[h]=n.Z_FULL_FLUSH,this[E]=k.level,this[v]=k.strategy}params(k,j){if(!this[y]){if(!this[p])throw new Error("cannot switch params when binding is closed");if(!this[p].params)throw new Error("not supported in this implementation");if(this[E]!==k||this[v]!==j){this.flush(n.Z_SYNC_FLUSH),e(this[p],"zlib binding closed");let z=this[p].flush;this[p].flush=(P,d)=>{this.flush(P),d()};try{this[p].params(k,j)}finally{this[p].flush=z}this[p]&&(this[E]=k,this[v]=j)}}}},L=class extends x{constructor(k){super(k,"Deflate")}},b=class extends x{constructor(k){super(k,"Inflate")}},S=Symbol("_portable"),N=class extends x{constructor(k){super(k,"Gzip"),this[S]=k&&!!k.portable}[a](k){return this[S]?(this[S]=!1,k[9]=255,super[a](k)):super[a](k)}},H=class extends x{constructor(k){super(k,"Gunzip")}},T=class extends x{constructor(k){super(k,"DeflateRaw")}},U=class extends x{constructor(k){super(k,"InflateRaw")}},V=class extends x{constructor(k){super(k,"Unzip")}},K=class extends R{constructor(k,j){k=k||{},k.flush=k.flush||n.BROTLI_OPERATION_PROCESS,k.finishFlush=k.finishFlush||n.BROTLI_OPERATION_FINISH,super(k,j),this[h]=n.BROTLI_OPERATION_FLUSH}},B=class extends K{constructor(k){super(k,"BrotliCompress")}},C=class extends K{constructor(k){super(k,"BrotliDecompress")}};t.Deflate=L,t.Inflate=b,t.Gzip=N,t.Gunzip=H,t.DeflateRaw=T,t.InflateRaw=U,t.Unzip=V,typeof i.BrotliCompress=="function"?(t.BrotliCompress=B,t.BrotliDecompress=C):t.BrotliCompress=t.BrotliDecompress=class{constructor(){throw new Error("Brotli is not supported in this version of Node.js")}}}),Zn=te((t,e)=>{W();var r=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform;e.exports=r!=="win32"?i=>i:i=>i&&i.replace(/\\/g,"/")}),Ih=te((t,e)=>{"use strict";W();var r=Ph(),i=Zn(),n=Symbol("slurp");e.exports=class extends r{constructor(s,o,a){switch(super(),this.pause(),this.extended=o,this.globalExtended=a,this.header=s,this.startBlockSize=512*Math.ceil(s.size/512),this.blockRemain=this.startBlockSize,this.remain=s.size,this.type=s.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=i(s.path),this.mode=s.mode,this.mode&&(this.mode=this.mode&4095),this.uid=s.uid,this.gid=s.gid,this.uname=s.uname,this.gname=s.gname,this.size=s.size,this.mtime=s.mtime,this.atime=s.atime,this.ctime=s.ctime,this.linkpath=i(s.linkpath),this.uname=s.uname,this.gname=s.gname,o&&this[n](o),a&&this[n](a,!0)}write(s){let o=s.length;if(o>this.blockRemain)throw new Error("writing more to entry than is appropriate");let a=this.remain,u=this.blockRemain;return this.remain=Math.max(0,a-o),this.blockRemain=Math.max(0,u-o),this.ignore?!0:a>=o?super.write(s):super.write(s.slice(0,a))}[n](s,o){for(let a in s)s[a]!==null&&s[a]!==void 0&&!(o&&a==="path")&&(this[a]=a==="path"||a==="linkpath"?i(s[a]):s[a])}}}),QD=te(t=>{"use strict";W(),t.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"]]),t.code=new Map(Array.from(t.name).map(e=>[e[1],e[0]]))}),rT=te((t,e)=>{"use strict";W();var r=(c,f)=>{if(Number.isSafeInteger(c))c<0?n(c,f):i(c,f);else throw Error("cannot encode number outside of javascript safe integer range");return f},i=(c,f)=>{f[0]=128;for(var h=f.length;h>1;h--)f[h-1]=c&255,c=Math.floor(c/256)},n=(c,f)=>{f[0]=255;var h=!1;c=c*-1;for(var p=f.length;p>1;p--){var g=c&255;c=Math.floor(c/256),h?f[p-1]=u(g):g===0?f[p-1]=0:(h=!0,f[p-1]=l(g))}},s=c=>{let f=c[0],h=f===128?a(c.slice(1,c.length)):f===255?o(c):null;if(h===null)throw Error("invalid base256 encoding");if(!Number.isSafeInteger(h))throw Error("parsed number outside of javascript safe integer range");return h},o=c=>{for(var f=c.length,h=0,p=!1,g=f-1;g>-1;g--){var y=c[g],E;p?E=u(y):y===0?E=y:(p=!0,E=l(y)),E!==0&&(h-=E*Math.pow(256,f-g-1))}return h},a=c=>{for(var f=c.length,h=0,p=f-1;p>-1;p--){var g=c[p];g!==0&&(h+=g*Math.pow(256,f-p-1))}return h},u=c=>(255^c)&255,l=c=>(255^c)+1&255;e.exports={encode:r,parse:s}}),Jn=te((t,e)=>{"use strict";W();var r=QD(),i=re("path").posix,n=rT(),s=Symbol("slurp"),o=Symbol("type"),a=class{constructor(b,S,N,H){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[o]="0",this.linkpath=null,this.uname=null,this.gname=null,this.devmaj=0,this.devmin=0,this.atime=null,this.ctime=null,Buffer.isBuffer(b)?this.decode(b,S||0,N,H):b&&this.set(b)}decode(b,S,N,H){if(S||(S=0),!b||!(b.length>=S+512))throw new Error("need 512 bytes for header");if(this.path=l(b,S,100),this.mode=h(b,S+100,8),this.uid=h(b,S+108,8),this.gid=h(b,S+116,8),this.size=h(b,S+124,12),this.mtime=c(b,S+136,12),this.cksum=h(b,S+148,12),this[s](N),this[s](H,!0),this[o]=l(b,S+156,1),this[o]===""&&(this[o]="0"),this[o]==="0"&&this.path.slice(-1)==="/"&&(this[o]="5"),this[o]==="5"&&(this.size=0),this.linkpath=l(b,S+157,100),b.slice(S+257,S+265).toString()==="ustar\x0000")if(this.uname=l(b,S+265,32),this.gname=l(b,S+297,32),this.devmaj=h(b,S+329,8),this.devmin=h(b,S+337,8),b[S+475]!==0){let U=l(b,S+345,155);this.path=U+"/"+this.path}else{let U=l(b,S+345,130);U&&(this.path=U+"/"+this.path),this.atime=c(b,S+476,12),this.ctime=c(b,S+488,12)}let T=8*32;for(let U=S;U<S+148;U++)T+=b[U];for(let U=S+156;U<S+512;U++)T+=b[U];this.cksumValid=T===this.cksum,this.cksum===null&&T===8*32&&(this.nullBlock=!0)}[s](b,S){for(let N in b)b[N]!==null&&b[N]!==void 0&&!(S&&N==="path")&&(this[N]=b[N])}encode(b,S){if(b||(b=this.block=Buffer.alloc(512),S=0),S||(S=0),!(b.length>=S+512))throw new Error("need 512 bytes for header");let N=this.ctime||this.atime?130:155,H=u(this.path||"",N),T=H[0],U=H[1];this.needPax=H[2],this.needPax=L(b,S,100,T)||this.needPax,this.needPax=E(b,S+100,8,this.mode)||this.needPax,this.needPax=E(b,S+108,8,this.uid)||this.needPax,this.needPax=E(b,S+116,8,this.gid)||this.needPax,this.needPax=E(b,S+124,12,this.size)||this.needPax,this.needPax=R(b,S+136,12,this.mtime)||this.needPax,b[S+156]=this[o].charCodeAt(0),this.needPax=L(b,S+157,100,this.linkpath)||this.needPax,b.write("ustar\x0000",S+257,8),this.needPax=L(b,S+265,32,this.uname)||this.needPax,this.needPax=L(b,S+297,32,this.gname)||this.needPax,this.needPax=E(b,S+329,8,this.devmaj)||this.needPax,this.needPax=E(b,S+337,8,this.devmin)||this.needPax,this.needPax=L(b,S+345,N,U)||this.needPax,b[S+475]!==0?this.needPax=L(b,S+345,155,U)||this.needPax:(this.needPax=L(b,S+345,130,U)||this.needPax,this.needPax=R(b,S+476,12,this.atime)||this.needPax,this.needPax=R(b,S+488,12,this.ctime)||this.needPax);let V=8*32;for(let K=S;K<S+148;K++)V+=b[K];for(let K=S+156;K<S+512;K++)V+=b[K];return this.cksum=V,E(b,S+148,8,this.cksum),this.cksumValid=!0,this.needPax}set(b){for(let S in b)b[S]!==null&&b[S]!==void 0&&(this[S]=b[S])}get type(){return r.name.get(this[o])||this[o]}get typeKey(){return this[o]}set type(b){r.code.has(b)?this[o]=r.code.get(b):this[o]=b}},u=(b,S)=>{let N=b,H="",T,U=i.parse(b).root||".";if(Buffer.byteLength(N)<100)T=[N,H,!1];else{H=i.dirname(N),N=i.basename(N);do Buffer.byteLength(N)<=100&&Buffer.byteLength(H)<=S?T=[N,H,!1]:Buffer.byteLength(N)>100&&Buffer.byteLength(H)<=S?T=[N.slice(0,100-1),H,!0]:(N=i.join(i.basename(H),N),H=i.dirname(H));while(H!==U&&!T);T||(T=[b.slice(0,100-1),"",!0])}return T},l=(b,S,N)=>b.slice(S,S+N).toString("utf8").replace(/\0.*/,""),c=(b,S,N)=>f(h(b,S,N)),f=b=>b===null?null:new Date(b*1e3),h=(b,S,N)=>b[S]&128?n.parse(b.slice(S,S+N)):g(b,S,N),p=b=>isNaN(b)?null:b,g=(b,S,N)=>p(parseInt(b.slice(S,S+N).toString("utf8").replace(/\0.*$/,"").trim(),8)),y={12:8589934591,8:2097151},E=(b,S,N,H)=>H===null?!1:H>y[N]||H<0?(n.encode(H,b.slice(S,S+N)),!0):(v(b,S,N,H),!1),v=(b,S,N,H)=>b.write(F(H,N),S,N,"ascii"),F=(b,S)=>O(Math.floor(b).toString(8),S),O=(b,S)=>(b.length===S-1?b:new Array(S-b.length-1).join("0")+b+" ")+"\0",R=(b,S,N,H)=>H===null?!1:E(b,S,N,H.getTime()/1e3),x=new Array(156).join("\0"),L=(b,S,N,H)=>H===null?!1:(b.write(H+x,S,N,"utf8"),H.length!==Buffer.byteLength(H)||H.length>N);e.exports=a}),Nh=te((t,e)=>{"use strict";W();var r=Jn(),i=re("path"),n=class{constructor(u,l){this.atime=u.atime||null,this.charset=u.charset||null,this.comment=u.comment||null,this.ctime=u.ctime||null,this.gid=u.gid||null,this.gname=u.gname||null,this.linkpath=u.linkpath||null,this.mtime=u.mtime||null,this.path=u.path||null,this.size=u.size||null,this.uid=u.uid||null,this.uname=u.uname||null,this.dev=u.dev||null,this.ino=u.ino||null,this.nlink=u.nlink||null,this.global=l||!1}encode(){let u=this.encodeBody();if(u==="")return null;let l=Buffer.byteLength(u),c=512*Math.ceil(1+l/512),f=Buffer.allocUnsafe(c);for(let h=0;h<512;h++)f[h]=0;new r({path:("PaxHeader/"+i.basename(this.path)).slice(0,99),mode:this.mode||420,uid:this.uid||null,gid:this.gid||null,size:l,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(f),f.write(u,512,l,"utf8");for(let h=l+512;h<f.length;h++)f[h]=0;return f}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(u){if(this[u]===null||this[u]===void 0)return"";let l=this[u]instanceof Date?this[u].getTime()/1e3:this[u],c=" "+(u==="dev"||u==="ino"||u==="nlink"?"SCHILY.":"")+u+"="+l+`
41
41
  `,f=Buffer.byteLength(c),h=Math.floor(Math.log(f)/Math.log(10))+1;return f+h>=Math.pow(10,h)&&(h+=1),h+f+c}};n.parse=(u,l,c)=>new n(s(o(u),l),c);var s=(u,l)=>l?Object.keys(u).reduce((c,f)=>(c[f]=u[f],c),l):u,o=u=>u.replace(/\n$/,"").split(`
42
42
  `).reduce(a,Object.create(null)),a=(u,l)=>{let c=parseInt(l,10);if(c!==Buffer.byteLength(l)+1)return u;l=l.slice((c+" ").length);let f=l.split("="),h=f.shift().replace(/^SCHILY\.(dev|ino|nlink)/,"$1");if(!h)return u;let p=f.join("=");return u[h]=/^([A-Z]+\.)?([mac]|birth|creation)time$/.test(h)?new Date(p*1e3):/^[0-9]+$/.test(p)?+p:p,u};e.exports=n}),Xn=te((t,e)=>{W(),e.exports=r=>{let i=r.length-1,n=-1;for(;i>-1&&r.charAt(i)==="/";)n=i,i--;return n===-1?r:r.slice(0,n)}}),Mh=te((t,e)=>{"use strict";W(),e.exports=r=>class extends r{warn(i,n,s={}){this.file&&(s.file=this.file),this.cwd&&(s.cwd=this.cwd),s.code=n instanceof Error&&n.code||i,s.tarCode=i,!this.strict&&s.recoverable!==!1?(n instanceof Error&&(s=Object.assign(n,s),n=n.message),this.emit("warn",s.tarCode,n,s)):n instanceof Error?this.emit("error",Object.assign(n,s)):this.emit("error",Object.assign(new Error(`${i}: ${n}`),s))}}}),eb=te((t,e)=>{"use strict";W();var r=["|","<",">","?",":"],i=r.map(o=>String.fromCharCode(61440+o.charCodeAt(0))),n=new Map(r.map((o,a)=>[o,i[a]])),s=new Map(i.map((o,a)=>[o,r[a]]));e.exports={encode:o=>r.reduce((a,u)=>a.split(u).join(n.get(u)),o),decode:o=>i.reduce((a,u)=>a.split(u).join(s.get(u)),o)}}),tb=te((t,e)=>{W();var{isAbsolute:r,parse:i}=re("path").win32;e.exports=n=>{let s="",o=i(n);for(;r(n)||o.root;){let a=n.charAt(0)==="/"&&n.slice(0,4)!=="//?/"?"/":o.root;n=n.slice(a.length),s+=a,o=i(n)}return[s,n]}}),iT=te((t,e)=>{"use strict";W(),e.exports=(r,i,n)=>(r&=4095,n&&(r=(r|384)&-19),i&&(r&256&&(r|=64),r&32&&(r|=8),r&4&&(r|=1)),r)}),rb=te((t,e)=>{"use strict";W();var r=Ph(),i=Nh(),n=Jn(),s=re("fs"),o=re("path"),a=Zn(),u=Xn(),l=(m,D)=>D?(m=a(m).replace(/^\.(\/|$)/,""),u(D)+"/"+m):a(m),c=16*1024*1024,f=Symbol("process"),h=Symbol("file"),p=Symbol("directory"),g=Symbol("symlink"),y=Symbol("hardlink"),E=Symbol("header"),v=Symbol("read"),F=Symbol("lstat"),O=Symbol("onlstat"),R=Symbol("onread"),x=Symbol("onreadlink"),L=Symbol("openfile"),b=Symbol("onopenfile"),S=Symbol("close"),N=Symbol("mode"),H=Symbol("awaitDrain"),T=Symbol("ondrain"),U=Symbol("prefix"),V=Symbol("hadError"),K=Mh(),B=eb(),C=tb(),k=iT(),j=K(class extends r{constructor(m,D){if(D=D||{},super(D),typeof m!="string")throw new TypeError("path is required");this.path=a(m),this.portable=!!D.portable,this.myuid=process.getuid&&process.getuid()||0,this.myuser=process.env.USER||"",this.maxReadSize=D.maxReadSize||c,this.linkCache=D.linkCache||new Map,this.statCache=D.statCache||new Map,this.preservePaths=!!D.preservePaths,this.cwd=a(D.cwd||process.cwd()),this.strict=!!D.strict,this.noPax=!!D.noPax,this.noMtime=!!D.noMtime,this.mtime=D.mtime||null,this.prefix=D.prefix?a(D.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 D.onwarn=="function"&&this.on("warn",D.onwarn);let A=!1;if(!this.preservePaths){let[w,I]=C(this.path);w&&(this.path=I,A=w)}this.win32=!!D.win32||process.platform==="win32",this.win32&&(this.path=B.decode(this.path.replace(/\\/g,"/")),m=m.replace(/\\/g,"/")),this.absolute=a(D.absolute||o.resolve(this.cwd,m)),this.path===""&&(this.path="./"),A&&this.warn("TAR_ENTRY_INFO",`stripping ${A} from absolute path`,{entry:this,path:A+this.path}),this.statCache.has(this.absolute)?this[O](this.statCache.get(this.absolute)):this[F]()}emit(m,...D){return m==="error"&&(this[V]=!0),super.emit(m,...D)}[F](){s.lstat(this.absolute,(m,D)=>{if(m)return this.emit("error",m);this[O](D)})}[O](m){this.statCache.set(this.absolute,m),this.stat=m,m.isFile()||(m.size=0),this.type=d(m),this.emit("stat",m),this[f]()}[f](){switch(this.type){case"File":return this[h]();case"Directory":return this[p]();case"SymbolicLink":return this[g]();default:return this.end()}}[N](m){return k(m,this.type==="Directory",this.portable)}[U](m){return l(m,this.prefix)}[E](){this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.header=new n({path:this[U](this.path),linkpath:this.type==="Link"?this[U](this.linkpath):this.linkpath,mode:this[N](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 i({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[U](this.path),linkpath:this.type==="Link"?this[U](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)}[p](){this.path.slice(-1)!=="/"&&(this.path+="/"),this.stat.size=0,this[E](),this.end()}[g](){s.readlink(this.absolute,(m,D)=>{if(m)return this.emit("error",m);this[x](D)})}[x](m){this.linkpath=a(m),this[E](),this.end()}[y](m){this.type="Link",this.linkpath=a(o.relative(this.cwd,m)),this.stat.size=0,this[E](),this.end()}[h](){if(this.stat.nlink>1){let m=this.stat.dev+":"+this.stat.ino;if(this.linkCache.has(m)){let D=this.linkCache.get(m);if(D.indexOf(this.cwd)===0)return this[y](D)}this.linkCache.set(m,this.absolute)}if(this[E](),this.stat.size===0)return this.end();this[L]()}[L](){s.open(this.absolute,"r",(m,D)=>{if(m)return this.emit("error",m);this[b](D)})}[b](m){if(this.fd=m,this[V])return this[S]();this.blockLen=512*Math.ceil(this.stat.size/512),this.blockRemain=this.blockLen;let D=Math.min(this.blockLen,this.maxReadSize);this.buf=Buffer.allocUnsafe(D),this.offset=0,this.pos=0,this.remain=this.stat.size,this.length=this.buf.length,this[v]()}[v](){let{fd:m,buf:D,offset:A,length:w,pos:I}=this;s.read(m,D,A,w,I,(M,Z)=>{if(M)return this[S](()=>this.emit("error",M));this[R](Z)})}[S](m){s.close(this.fd,m)}[R](m){if(m<=0&&this.remain>0){let A=new Error("encountered unexpected EOF");return A.path=this.absolute,A.syscall="read",A.code="EOF",this[S](()=>this.emit("error",A))}if(m>this.remain){let A=new Error("did not encounter expected EOF");return A.path=this.absolute,A.syscall="read",A.code="EOF",this[S](()=>this.emit("error",A))}if(m===this.remain)for(let A=m;A<this.length&&m<this.blockRemain;A++)this.buf[A+this.offset]=0,m++,this.remain++;let D=this.offset===0&&m===this.buf.length?this.buf:this.buf.slice(this.offset,this.offset+m);this.write(D)?this[T]():this[H](()=>this[T]())}[H](m){this.once("drain",m)}write(m){if(this.blockRemain<m.length){let D=new Error("writing more data than expected");return D.path=this.absolute,this.emit("error",D)}return this.remain-=m.length,this.blockRemain-=m.length,this.pos+=m.length,this.offset+=m.length,super.write(m)}[T](){if(!this.remain)return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),this[S](m=>m?this.emit("error",m):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[v]()}}),z=class extends j{[F](){this[O](s.lstatSync(this.absolute))}[g](){this[x](s.readlinkSync(this.absolute))}[L](){this[b](s.openSync(this.absolute,"r"))}[v](){let m=!0;try{let{fd:D,buf:A,offset:w,length:I,pos:M}=this,Z=s.readSync(D,A,w,I,M);this[R](Z),m=!1}finally{if(m)try{this[S](()=>{})}catch{}}}[H](m){m()}[S](m){s.closeSync(this.fd),m()}},P=K(class extends r{constructor(m,D){D=D||{},super(D),this.preservePaths=!!D.preservePaths,this.portable=!!D.portable,this.strict=!!D.strict,this.noPax=!!D.noPax,this.noMtime=!!D.noMtime,this.readEntry=m,this.type=m.type,this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.prefix=D.prefix||null,this.path=a(m.path),this.mode=this[N](m.mode),this.uid=this.portable?null:m.uid,this.gid=this.portable?null:m.gid,this.uname=this.portable?null:m.uname,this.gname=this.portable?null:m.gname,this.size=m.size,this.mtime=this.noMtime?null:D.mtime||m.mtime,this.atime=this.portable?null:m.atime,this.ctime=this.portable?null:m.ctime,this.linkpath=a(m.linkpath),typeof D.onwarn=="function"&&this.on("warn",D.onwarn);let A=!1;if(!this.preservePaths){let[w,I]=C(this.path);w&&(this.path=I,A=w)}this.remain=m.size,this.blockRemain=m.startBlockSize,this.header=new n({path:this[U](this.path),linkpath:this.type==="Link"?this[U](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}),A&&this.warn("TAR_ENTRY_INFO",`stripping ${A} from absolute path`,{entry:this,path:A+this.path}),this.header.encode()&&!this.noPax&&super.write(new i({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[U](this.path),linkpath:this.type==="Link"?this[U](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),m.pipe(this)}[U](m){return l(m,this.prefix)}[N](m){return k(m,this.type==="Directory",this.portable)}write(m){let D=m.length;if(D>this.blockRemain)throw new Error("writing more to entry than is appropriate");return this.blockRemain-=D,super.write(m)}end(){return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),super.end()}});j.Sync=z,j.Tar=P;var d=m=>m.isFile()?"File":m.isDirectory()?"Directory":m.isSymbolicLink()?"SymbolicLink":"Unsupported";e.exports=j}),nT=te((t,e)=>{"use strict";W(),e.exports=function(r){r.prototype[Symbol.iterator]=function*(){for(let i=this.head;i;i=i.next)yield i.value}}}),ib=te((t,e)=>{"use strict";W(),e.exports=r,r.Node=o,r.create=r;function r(a){var u=this;if(u instanceof r||(u=new r),u.tail=null,u.head=null,u.length=0,a&&typeof a.forEach=="function")a.forEach(function(f){u.push(f)});else if(arguments.length>0)for(var l=0,c=arguments.length;l<c;l++)u.push(arguments[l]);return u}r.prototype.removeNode=function(a){if(a.list!==this)throw new Error("removing node which does not belong to this list");var u=a.next,l=a.prev;return u&&(u.prev=l),l&&(l.next=u),a===this.head&&(this.head=u),a===this.tail&&(this.tail=l),a.list.length--,a.next=null,a.prev=null,a.list=null,u},r.prototype.unshiftNode=function(a){if(a!==this.head){a.list&&a.list.removeNode(a);var u=this.head;a.list=this,a.next=u,u&&(u.prev=a),this.head=a,this.tail||(this.tail=a),this.length++}},r.prototype.pushNode=function(a){if(a!==this.tail){a.list&&a.list.removeNode(a);var u=this.tail;a.list=this,a.prev=u,u&&(u.next=a),this.tail=a,this.head||(this.head=a),this.length++}},r.prototype.push=function(){for(var a=0,u=arguments.length;a<u;a++)n(this,arguments[a]);return this.length},r.prototype.unshift=function(){for(var a=0,u=arguments.length;a<u;a++)s(this,arguments[a]);return this.length},r.prototype.pop=function(){if(this.tail){var a=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,a}},r.prototype.shift=function(){if(this.head){var a=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,a}},r.prototype.forEach=function(a,u){u=u||this;for(var l=this.head,c=0;l!==null;c++)a.call(u,l.value,c,this),l=l.next},r.prototype.forEachReverse=function(a,u){u=u||this;for(var l=this.tail,c=this.length-1;l!==null;c--)a.call(u,l.value,c,this),l=l.prev},r.prototype.get=function(a){for(var u=0,l=this.head;l!==null&&u<a;u++)l=l.next;if(u===a&&l!==null)return l.value},r.prototype.getReverse=function(a){for(var u=0,l=this.tail;l!==null&&u<a;u++)l=l.prev;if(u===a&&l!==null)return l.value},r.prototype.map=function(a,u){u=u||this;for(var l=new r,c=this.head;c!==null;)l.push(a.call(u,c.value,this)),c=c.next;return l},r.prototype.mapReverse=function(a,u){u=u||this;for(var l=new r,c=this.tail;c!==null;)l.push(a.call(u,c.value,this)),c=c.prev;return l},r.prototype.reduce=function(a,u){var l,c=this.head;if(arguments.length>1)l=u;else if(this.head)c=this.head.next,l=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var f=0;c!==null;f++)l=a(l,c.value,f),c=c.next;return l},r.prototype.reduceReverse=function(a,u){var l,c=this.tail;if(arguments.length>1)l=u;else if(this.tail)c=this.tail.prev,l=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var f=this.length-1;c!==null;f--)l=a(l,c.value,f),c=c.prev;return l},r.prototype.toArray=function(){for(var a=new Array(this.length),u=0,l=this.head;l!==null;u++)a[u]=l.value,l=l.next;return a},r.prototype.toArrayReverse=function(){for(var a=new Array(this.length),u=0,l=this.tail;l!==null;u++)a[u]=l.value,l=l.prev;return a},r.prototype.slice=function(a,u){u=u||this.length,u<0&&(u+=this.length),a=a||0,a<0&&(a+=this.length);var l=new r;if(u<a||u<0)return l;a<0&&(a=0),u>this.length&&(u=this.length);for(var c=0,f=this.head;f!==null&&c<a;c++)f=f.next;for(;f!==null&&c<u;c++,f=f.next)l.push(f.value);return l},r.prototype.sliceReverse=function(a,u){u=u||this.length,u<0&&(u+=this.length),a=a||0,a<0&&(a+=this.length);var l=new r;if(u<a||u<0)return l;a<0&&(a=0),u>this.length&&(u=this.length);for(var c=this.length,f=this.tail;f!==null&&c>u;c--)f=f.prev;for(;f!==null&&c>a;c--,f=f.prev)l.push(f.value);return l},r.prototype.splice=function(a,u,...l){a>this.length&&(a=this.length-1),a<0&&(a=this.length+a);for(var c=0,f=this.head;f!==null&&c<a;c++)f=f.next;for(var h=[],c=0;f&&c<u;c++)h.push(f.value),f=this.removeNode(f);f===null&&(f=this.tail),f!==this.head&&f!==this.tail&&(f=f.prev);for(var c=0;c<l.length;c++)f=i(this,f,l[c]);return h},r.prototype.reverse=function(){for(var a=this.head,u=this.tail,l=a;l!==null;l=l.prev){var c=l.prev;l.prev=l.next,l.next=c}return this.head=u,this.tail=a,this};function i(a,u,l){var c=u===a.head?new o(l,null,u,a):new o(l,u,u.next,a);return c.next===null&&(a.tail=c),c.prev===null&&(a.head=c),a.length++,c}function n(a,u){a.tail=new o(u,a.tail,null,a),a.head||(a.head=a.tail),a.length++}function s(a,u){a.head=new o(u,null,a.head,a),a.tail||(a.tail=a.head),a.length++}function o(a,u,l,c){if(!(this instanceof o))return new o(a,u,l,c);this.list=c,this.value=a,u?(u.next=this,this.prev=u):this.prev=null,l?(l.prev=this,this.next=l):this.next=null}try{nT()(r)}catch{}}),jh=te((t,e)=>{"use strict";W();var r=class{constructor(d,m){this.path=d||"./",this.absolute=m,this.entry=null,this.stat=null,this.readdir=null,this.pending=!1,this.ignore=!1,this.piped=!1}},i=Ph(),n=XD(),s=Ih(),o=rb(),a=o.Sync,u=o.Tar,l=ib(),c=Buffer.alloc(1024),f=Symbol("onStat"),h=Symbol("ended"),p=Symbol("queue"),g=Symbol("current"),y=Symbol("process"),E=Symbol("processing"),v=Symbol("processJob"),F=Symbol("jobs"),O=Symbol("jobDone"),R=Symbol("addFSEntry"),x=Symbol("addTarEntry"),L=Symbol("stat"),b=Symbol("readdir"),S=Symbol("onreaddir"),N=Symbol("pipe"),H=Symbol("entry"),T=Symbol("entryOpt"),U=Symbol("writeEntryClass"),V=Symbol("write"),K=Symbol("ondrain"),B=re("fs"),C=re("path"),k=Mh(),j=Zn(),z=k(class extends i{constructor(d){super(d),d=d||Object.create(null),this.opt=d,this.file=d.file||"",this.cwd=d.cwd||process.cwd(),this.maxReadSize=d.maxReadSize,this.preservePaths=!!d.preservePaths,this.strict=!!d.strict,this.noPax=!!d.noPax,this.prefix=j(d.prefix||""),this.linkCache=d.linkCache||new Map,this.statCache=d.statCache||new Map,this.readdirCache=d.readdirCache||new Map,this[U]=o,typeof d.onwarn=="function"&&this.on("warn",d.onwarn),this.portable=!!d.portable,this.zip=null,d.gzip?(typeof d.gzip!="object"&&(d.gzip={}),this.portable&&(d.gzip.portable=!0),this.zip=new n.Gzip(d.gzip),this.zip.on("data",m=>super.write(m)),this.zip.on("end",m=>super.end()),this.zip.on("drain",m=>this[K]()),this.on("resume",m=>this.zip.resume())):this.on("drain",this[K]),this.noDirRecurse=!!d.noDirRecurse,this.follow=!!d.follow,this.noMtime=!!d.noMtime,this.mtime=d.mtime||null,this.filter=typeof d.filter=="function"?d.filter:m=>!0,this[p]=new l,this[F]=0,this.jobs=+d.jobs||4,this[E]=!1,this[h]=!1}[V](d){return super.write(d)}add(d){return this.write(d),this}end(d){return d&&this.write(d),this[h]=!0,this[y](),this}write(d){if(this[h])throw new Error("write after end");return d instanceof s?this[x](d):this[R](d),this.flowing}[x](d){let m=j(C.resolve(this.cwd,d.path));if(!this.filter(d.path,d))d.resume();else{let D=new r(d.path,m,!1);D.entry=new u(d,this[T](D)),D.entry.on("end",A=>this[O](D)),this[F]+=1,this[p].push(D)}this[y]()}[R](d){let m=j(C.resolve(this.cwd,d));this[p].push(new r(d,m)),this[y]()}[L](d){d.pending=!0,this[F]+=1;let m=this.follow?"stat":"lstat";B[m](d.absolute,(D,A)=>{d.pending=!1,this[F]-=1,D?this.emit("error",D):this[f](d,A)})}[f](d,m){this.statCache.set(d.absolute,m),d.stat=m,this.filter(d.path,m)||(d.ignore=!0),this[y]()}[b](d){d.pending=!0,this[F]+=1,B.readdir(d.absolute,(m,D)=>{if(d.pending=!1,this[F]-=1,m)return this.emit("error",m);this[S](d,D)})}[S](d,m){this.readdirCache.set(d.absolute,m),d.readdir=m,this[y]()}[y](){if(!this[E]){this[E]=!0;for(let d=this[p].head;d!==null&&this[F]<this.jobs;d=d.next)if(this[v](d.value),d.value.ignore){let m=d.next;this[p].removeNode(d),d.next=m}this[E]=!1,this[h]&&!this[p].length&&this[F]===0&&(this.zip?this.zip.end(c):(super.write(c),super.end()))}}get[g](){return this[p]&&this[p].head&&this[p].head.value}[O](d){this[p].shift(),this[F]-=1,this[y]()}[v](d){if(!d.pending){if(d.entry){d===this[g]&&!d.piped&&this[N](d);return}if(d.stat||(this.statCache.has(d.absolute)?this[f](d,this.statCache.get(d.absolute)):this[L](d)),!!d.stat&&!d.ignore&&!(!this.noDirRecurse&&d.stat.isDirectory()&&!d.readdir&&(this.readdirCache.has(d.absolute)?this[S](d,this.readdirCache.get(d.absolute)):this[b](d),!d.readdir))){if(d.entry=this[H](d),!d.entry){d.ignore=!0;return}d===this[g]&&!d.piped&&this[N](d)}}}[T](d){return{onwarn:(m,D,A)=>this.warn(m,D,A),noPax:this.noPax,cwd:this.cwd,absolute:d.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}}[H](d){this[F]+=1;try{return new this[U](d.path,this[T](d)).on("end",()=>this[O](d)).on("error",m=>this.emit("error",m))}catch(m){this.emit("error",m)}}[K](){this[g]&&this[g].entry&&this[g].entry.resume()}[N](d){d.piped=!0,d.readdir&&d.readdir.forEach(A=>{let w=d.path,I=w==="./"?"":w.replace(/\/*$/,"/");this[R](I+A)});let m=d.entry,D=this.zip;D?m.on("data",A=>{D.write(A)||m.pause()}):m.on("data",A=>{super.write(A)||m.pause()})}pause(){return this.zip&&this.zip.pause(),super.pause()}}),P=class extends z{constructor(d){super(d),this[U]=a}pause(){}resume(){}[L](d){let m=this.follow?"statSync":"lstatSync";this[f](d,B[m](d.absolute))}[b](d,m){this[S](d,B.readdirSync(d.absolute))}[N](d){let m=d.entry,D=this.zip;d.readdir&&d.readdir.forEach(A=>{let w=d.path,I=w==="./"?"":w.replace(/\/*$/,"/");this[R](I+A)}),D?m.on("data",A=>{D.write(A)}):m.on("data",A=>{super[V](A)})}};z.Sync=P,e.exports=z}),Qn=te(t=>{"use strict";W();var e=ZD(),r=re("events").EventEmitter,i=re("fs"),n=i.writev;if(!n){let d=process.binding("fs"),m=d.FSReqWrap||d.FSReqCallback;n=(D,A,w,I)=>{let M=(q,Q)=>I(q,Q,A),Z=new m;Z.oncomplete=M,d.writeBuffers(D,A,w,Z)}}var s=Symbol("_autoClose"),o=Symbol("_close"),a=Symbol("_ended"),u=Symbol("_fd"),l=Symbol("_finished"),c=Symbol("_flags"),f=Symbol("_flush"),h=Symbol("_handleChunk"),p=Symbol("_makeBuf"),g=Symbol("_mode"),y=Symbol("_needDrain"),E=Symbol("_onerror"),v=Symbol("_onopen"),F=Symbol("_onread"),O=Symbol("_onwrite"),R=Symbol("_open"),x=Symbol("_path"),L=Symbol("_pos"),b=Symbol("_queue"),S=Symbol("_read"),N=Symbol("_readSize"),H=Symbol("_reading"),T=Symbol("_remain"),U=Symbol("_size"),V=Symbol("_write"),K=Symbol("_writing"),B=Symbol("_defaultFlag"),C=Symbol("_errored"),k=class extends e{constructor(d,m){if(m=m||{},super(m),this.readable=!0,this.writable=!1,typeof d!="string")throw new TypeError("path must be a string");this[C]=!1,this[u]=typeof m.fd=="number"?m.fd:null,this[x]=d,this[N]=m.readSize||16*1024*1024,this[H]=!1,this[U]=typeof m.size=="number"?m.size:1/0,this[T]=this[U],this[s]=typeof m.autoClose=="boolean"?m.autoClose:!0,typeof this[u]=="number"?this[S]():this[R]()}get fd(){return this[u]}get path(){return this[x]}write(){throw new TypeError("this is a readable stream")}end(){throw new TypeError("this is a readable stream")}[R](){i.open(this[x],"r",(d,m)=>this[v](d,m))}[v](d,m){d?this[E](d):(this[u]=m,this.emit("open",m),this[S]())}[p](){return Buffer.allocUnsafe(Math.min(this[N],this[T]))}[S](){if(!this[H]){this[H]=!0;let d=this[p]();if(d.length===0)return process.nextTick(()=>this[F](null,0,d));i.read(this[u],d,0,d.length,null,(m,D,A)=>this[F](m,D,A))}}[F](d,m,D){this[H]=!1,d?this[E](d):this[h](m,D)&&this[S]()}[o](){if(this[s]&&typeof this[u]=="number"){let d=this[u];this[u]=null,i.close(d,m=>m?this.emit("error",m):this.emit("close"))}}[E](d){this[H]=!0,this[o](),this.emit("error",d)}[h](d,m){let D=!1;return this[T]-=d,d>0&&(D=super.write(d<m.length?m.slice(0,d):m)),(d===0||this[T]<=0)&&(D=!1,this[o](),super.end()),D}emit(d,m){switch(d){case"prefinish":case"finish":break;case"drain":typeof this[u]=="number"&&this[S]();break;case"error":return this[C]?void 0:(this[C]=!0,super.emit(d,m));default:return super.emit(d,m)}}},j=class extends k{[R](){let d=!0;try{this[v](null,i.openSync(this[x],"r")),d=!1}finally{d&&this[o]()}}[S](){let d=!0;try{if(!this[H]){this[H]=!0;do{let m=this[p](),D=m.length===0?0:i.readSync(this[u],m,0,m.length,null);if(!this[h](D,m))break}while(!0);this[H]=!1}d=!1}finally{d&&this[o]()}}[o](){if(this[s]&&typeof this[u]=="number"){let d=this[u];this[u]=null,i.closeSync(d),this.emit("close")}}},z=class extends r{constructor(d,m){m=m||{},super(m),this.readable=!1,this.writable=!0,this[C]=!1,this[K]=!1,this[a]=!1,this[y]=!1,this[b]=[],this[x]=d,this[u]=typeof m.fd=="number"?m.fd:null,this[g]=m.mode===void 0?438:m.mode,this[L]=typeof m.start=="number"?m.start:null,this[s]=typeof m.autoClose=="boolean"?m.autoClose:!0;let D=this[L]!==null?"r+":"w";this[B]=m.flags===void 0,this[c]=this[B]?D:m.flags,this[u]===null&&this[R]()}emit(d,m){if(d==="error"){if(this[C])return;this[C]=!0}return super.emit(d,m)}get fd(){return this[u]}get path(){return this[x]}[E](d){this[o](),this[K]=!0,this.emit("error",d)}[R](){i.open(this[x],this[c],this[g],(d,m)=>this[v](d,m))}[v](d,m){this[B]&&this[c]==="r+"&&d&&d.code==="ENOENT"?(this[c]="w",this[R]()):d?this[E](d):(this[u]=m,this.emit("open",m),this[f]())}end(d,m){return d&&this.write(d,m),this[a]=!0,!this[K]&&!this[b].length&&typeof this[u]=="number"&&this[O](null,0),this}write(d,m){return typeof d=="string"&&(d=Buffer.from(d,m)),this[a]?(this.emit("error",new Error("write() after end()")),!1):this[u]===null||this[K]||this[b].length?(this[b].push(d),this[y]=!0,!1):(this[K]=!0,this[V](d),!0)}[V](d){i.write(this[u],d,0,d.length,this[L],(m,D)=>this[O](m,D))}[O](d,m){d?this[E](d):(this[L]!==null&&(this[L]+=m),this[b].length?this[f]():(this[K]=!1,this[a]&&!this[l]?(this[l]=!0,this[o](),this.emit("finish")):this[y]&&(this[y]=!1,this.emit("drain"))))}[f](){if(this[b].length===0)this[a]&&this[O](null,0);else if(this[b].length===1)this[V](this[b].pop());else{let d=this[b];this[b]=[],n(this[u],d,this[L],(m,D)=>this[O](m,D))}}[o](){if(this[s]&&typeof this[u]=="number"){let d=this[u];this[u]=null,i.close(d,m=>m?this.emit("error",m):this.emit("close"))}}},P=class extends z{[R](){let d;if(this[B]&&this[c]==="r+")try{d=i.openSync(this[x],this[c],this[g])}catch(m){if(m.code==="ENOENT")return this[c]="w",this[R]();throw m}else d=i.openSync(this[x],this[c],this[g]);this[v](null,d)}[o](){if(this[s]&&typeof this[u]=="number"){let d=this[u];this[u]=null,i.closeSync(d),this.emit("close")}}[V](d){let m=!0;try{this[O](null,i.writeSync(this[u],d,0,d.length,this[L])),m=!1}finally{if(m)try{this[o]()}catch{}}}};t.ReadStream=k,t.ReadStreamSync=j,t.WriteStream=z,t.WriteStreamSync=P}),$h=te((t,e)=>{"use strict";W();var r=Mh(),i=Jn(),n=re("events"),s=ib(),o=1024*1024,a=Ih(),u=Nh(),l=XD(),{nextTick:c}=re("process"),f=Buffer.from([31,139]),h=Symbol("state"),p=Symbol("writeEntry"),g=Symbol("readEntry"),y=Symbol("nextEntry"),E=Symbol("processEntry"),v=Symbol("extendedHeader"),F=Symbol("globalExtendedHeader"),O=Symbol("meta"),R=Symbol("emitMeta"),x=Symbol("buffer"),L=Symbol("queue"),b=Symbol("ended"),S=Symbol("emittedEnd"),N=Symbol("emit"),H=Symbol("unzip"),T=Symbol("consumeChunk"),U=Symbol("consumeChunkSub"),V=Symbol("consumeBody"),K=Symbol("consumeMeta"),B=Symbol("consumeHeader"),C=Symbol("consuming"),k=Symbol("bufferConcat"),j=Symbol("maybeEnd"),z=Symbol("writing"),P=Symbol("aborted"),d=Symbol("onDone"),m=Symbol("sawValidEntry"),D=Symbol("sawNullBlock"),A=Symbol("sawEOF"),w=Symbol("closeStream"),I=M=>!0;e.exports=r(class extends n{constructor(M){M=M||{},super(M),this.file=M.file||"",this[m]=null,this.on(d,Z=>{(this[h]==="begin"||this[m]===!1)&&this.warn("TAR_BAD_ARCHIVE","Unrecognized archive format")}),M.ondone?this.on(d,M.ondone):this.on(d,Z=>{this.emit("prefinish"),this.emit("finish"),this.emit("end")}),this.strict=!!M.strict,this.maxMetaEntrySize=M.maxMetaEntrySize||o,this.filter=typeof M.filter=="function"?M.filter:I,this.writable=!0,this.readable=!1,this[L]=new s,this[x]=null,this[g]=null,this[p]=null,this[h]="begin",this[O]="",this[v]=null,this[F]=null,this[b]=!1,this[H]=null,this[P]=!1,this[D]=!1,this[A]=!1,this.on("end",()=>this[w]()),typeof M.onwarn=="function"&&this.on("warn",M.onwarn),typeof M.onentry=="function"&&this.on("entry",M.onentry)}[B](M,Z){this[m]===null&&(this[m]=!1);let q;try{q=new i(M,Z,this[v],this[F])}catch(Q){return this.warn("TAR_ENTRY_INVALID",Q)}if(q.nullBlock)this[D]?(this[A]=!0,this[h]==="begin"&&(this[h]="header"),this[N]("eof")):(this[D]=!0,this[N]("nullBlock"));else if(this[D]=!1,!q.cksumValid)this.warn("TAR_ENTRY_INVALID","checksum failure",{header:q});else if(!q.path)this.warn("TAR_ENTRY_INVALID","path is required",{header:q});else{let Q=q.type;if(/^(Symbolic)?Link$/.test(Q)&&!q.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath required",{header:q});else if(!/^(Symbolic)?Link$/.test(Q)&&q.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath forbidden",{header:q});else{let G=this[p]=new a(q,this[v],this[F]);if(!this[m])if(G.remain){let ie=()=>{G.invalid||(this[m]=!0)};G.on("end",ie)}else this[m]=!0;G.meta?G.size>this.maxMetaEntrySize?(G.ignore=!0,this[N]("ignoredEntry",G),this[h]="ignore",G.resume()):G.size>0&&(this[O]="",G.on("data",ie=>this[O]+=ie),this[h]="meta"):(this[v]=null,G.ignore=G.ignore||!this.filter(G.path,G),G.ignore?(this[N]("ignoredEntry",G),this[h]=G.remain?"ignore":"header",G.resume()):(G.remain?this[h]="body":(this[h]="header",G.end()),this[g]?this[L].push(G):(this[L].push(G),this[y]())))}}}[w](){c(()=>this.emit("close"))}[E](M){let Z=!0;return M?Array.isArray(M)?this.emit.apply(this,M):(this[g]=M,this.emit("entry",M),M.emittedEnd||(M.on("end",q=>this[y]()),Z=!1)):(this[g]=null,Z=!1),Z}[y](){do;while(this[E](this[L].shift()));if(!this[L].length){let M=this[g];!M||M.flowing||M.size===M.remain?this[z]||this.emit("drain"):M.once("drain",Z=>this.emit("drain"))}}[V](M,Z){let q=this[p],Q=q.blockRemain,G=Q>=M.length&&Z===0?M:M.slice(Z,Z+Q);return q.write(G),q.blockRemain||(this[h]="header",this[p]=null,q.end()),G.length}[K](M,Z){let q=this[p],Q=this[V](M,Z);return this[p]||this[R](q),Q}[N](M,Z,q){!this[L].length&&!this[g]?this.emit(M,Z,q):this[L].push([M,Z,q])}[R](M){switch(this[N]("meta",this[O]),M.type){case"ExtendedHeader":case"OldExtendedHeader":this[v]=u.parse(this[O],this[v],!1);break;case"GlobalExtendedHeader":this[F]=u.parse(this[O],this[F],!0);break;case"NextFileHasLongPath":case"OldGnuLongPath":this[v]=this[v]||Object.create(null),this[v].path=this[O].replace(/\0.*/,"");break;case"NextFileHasLongLinkpath":this[v]=this[v]||Object.create(null),this[v].linkpath=this[O].replace(/\0.*/,"");break;default:throw new Error("unknown meta: "+M.type)}}abort(M){this[P]=!0,this.emit("abort",M),this.warn("TAR_ABORT",M,{recoverable:!1})}write(M){if(this[P])return;if(this[H]===null&&M){if(this[x]&&(M=Buffer.concat([this[x],M]),this[x]=null),M.length<f.length)return this[x]=M,!0;for(let q=0;this[H]===null&&q<f.length;q++)M[q]!==f[q]&&(this[H]=!1);if(this[H]===null){let q=this[b];this[b]=!1,this[H]=new l.Unzip,this[H].on("data",G=>this[T](G)),this[H].on("error",G=>this.abort(G)),this[H].on("end",G=>{this[b]=!0,this[T]()}),this[z]=!0;let Q=this[H][q?"end":"write"](M);return this[z]=!1,Q}}this[z]=!0,this[H]?this[H].write(M):this[T](M),this[z]=!1;let Z=this[L].length?!1:this[g]?this[g].flowing:!0;return!Z&&!this[L].length&&this[g].once("drain",q=>this.emit("drain")),Z}[k](M){M&&!this[P]&&(this[x]=this[x]?Buffer.concat([this[x],M]):M)}[j](){if(this[b]&&!this[S]&&!this[P]&&!this[C]){this[S]=!0;let M=this[p];if(M&&M.blockRemain){let Z=this[x]?this[x].length:0;this.warn("TAR_BAD_ARCHIVE",`Truncated input (needed ${M.blockRemain} more bytes, only ${Z} available)`,{entry:M}),this[x]&&M.write(this[x]),M.end()}this[N](d)}}[T](M){if(this[C])this[k](M);else if(!M&&!this[x])this[j]();else{if(this[C]=!0,this[x]){this[k](M);let Z=this[x];this[x]=null,this[U](Z)}else this[U](M);for(;this[x]&&this[x].length>=512&&!this[P]&&!this[A];){let Z=this[x];this[x]=null,this[U](Z)}this[C]=!1}(!this[x]||this[b])&&this[j]()}[U](M){let Z=0,q=M.length;for(;Z+512<=q&&!this[P]&&!this[A];)switch(this[h]){case"begin":case"header":this[B](M,Z),Z+=512;break;case"ignore":case"body":Z+=this[V](M,Z);break;case"meta":Z+=this[K](M,Z);break;default:throw new Error("invalid state: "+this[h])}Z<q&&(this[x]?this[x]=Buffer.concat([M.slice(Z),this[x]]):this[x]=M.slice(Z))}end(M){this[P]||(this[H]?this[H].end(M):(this[b]=!0,this.write(M)))}})}),Hh=te((t,e)=>{"use strict";W();var r=Kn(),i=$h(),n=re("fs"),s=Qn(),o=re("path"),a=Xn();e.exports=(p,g,y)=>{typeof p=="function"?(y=p,g=null,p={}):Array.isArray(p)&&(g=p,p={}),typeof g=="function"&&(y=g,g=null),g?g=Array.from(g):g=[];let E=r(p);if(E.sync&&typeof y=="function")throw new TypeError("callback not supported for sync tar functions");if(!E.file&&typeof y=="function")throw new TypeError("callback only supported with file option");return g.length&&l(E,g),E.noResume||u(E),E.file&&E.sync?c(E):E.file?f(E,y):h(E)};var u=p=>{let g=p.onentry;p.onentry=g?y=>{g(y),y.resume()}:y=>y.resume()},l=(p,g)=>{let y=new Map(g.map(F=>[a(F),!0])),E=p.filter,v=(F,O)=>{let R=O||o.parse(F).root||".",x=F===R?!1:y.has(F)?y.get(F):v(o.dirname(F),R);return y.set(F,x),x};p.filter=E?(F,O)=>E(F,O)&&v(a(F)):F=>v(a(F))},c=p=>{let g=h(p),y=p.file,E=!0,v;try{let F=n.statSync(y),O=p.maxReadSize||16*1024*1024;if(F.size<O)g.end(n.readFileSync(y));else{let R=0,x=Buffer.allocUnsafe(O);for(v=n.openSync(y,"r");R<F.size;){let L=n.readSync(v,x,0,O,R);R+=L,g.write(x.slice(0,L))}g.end()}E=!1}finally{if(E&&v)try{n.closeSync(v)}catch{}}},f=(p,g)=>{let y=new i(p),E=p.maxReadSize||16*1024*1024,v=p.file,F=new Promise((O,R)=>{y.on("error",R),y.on("end",O),n.stat(v,(x,L)=>{if(x)R(x);else{let b=new s.ReadStream(v,{readSize:E,size:L.size});b.on("error",R),b.pipe(y)}})});return g?F.then(g,g):F},h=p=>new i(p)}),sT=te((t,e)=>{"use strict";W();var r=Kn(),i=jh(),n=Qn(),s=Hh(),o=re("path");e.exports=(p,g,y)=>{if(typeof g=="function"&&(y=g),Array.isArray(p)&&(g=p,p={}),!g||!Array.isArray(g)||!g.length)throw new TypeError("no files or directories specified");g=Array.from(g);let E=r(p);if(E.sync&&typeof y=="function")throw new TypeError("callback not supported for sync tar functions");if(!E.file&&typeof y=="function")throw new TypeError("callback only supported with file option");return E.file&&E.sync?a(E,g):E.file?u(E,g,y):E.sync?f(E,g):h(E,g)};var a=(p,g)=>{let y=new i.Sync(p),E=new n.WriteStreamSync(p.file,{mode:p.mode||438});y.pipe(E),l(y,g)},u=(p,g,y)=>{let E=new i(p),v=new n.WriteStream(p.file,{mode:p.mode||438});E.pipe(v);let F=new Promise((O,R)=>{v.on("error",R),v.on("close",O),E.on("error",R)});return c(E,g),y?F.then(y,y):F},l=(p,g)=>{g.forEach(y=>{y.charAt(0)==="@"?s({file:o.resolve(p.cwd,y.slice(1)),sync:!0,noResume:!0,onentry:E=>p.add(E)}):p.add(y)}),p.end()},c=(p,g)=>{for(;g.length;){let y=g.shift();if(y.charAt(0)==="@")return s({file:o.resolve(p.cwd,y.slice(1)),noResume:!0,onentry:E=>p.add(E)}).then(E=>c(p,g));p.add(y)}p.end()},f=(p,g)=>{let y=new i.Sync(p);return l(y,g),y},h=(p,g)=>{let y=new i(p);return c(y,g),y}}),nb=te((t,e)=>{"use strict";W();var r=Kn(),i=jh(),n=re("fs"),s=Qn(),o=Hh(),a=re("path"),u=Jn();e.exports=(g,y,E)=>{let v=r(g);if(!v.file)throw new TypeError("file is required");if(v.gzip)throw new TypeError("cannot append to compressed archives");if(!y||!Array.isArray(y)||!y.length)throw new TypeError("no files or directories specified");return y=Array.from(y),v.sync?l(v,y):f(v,y,E)};var l=(g,y)=>{let E=new i.Sync(g),v=!0,F,O;try{try{F=n.openSync(g.file,"r+")}catch(L){if(L.code==="ENOENT")F=n.openSync(g.file,"w+");else throw L}let R=n.fstatSync(F),x=Buffer.alloc(512);e:for(O=0;O<R.size;O+=512){for(let S=0,N=0;S<512;S+=N){if(N=n.readSync(F,x,S,x.length-S,O+S),O===0&&x[0]===31&&x[1]===139)throw new Error("cannot append to compressed archives");if(!N)break e}let L=new u(x);if(!L.cksumValid)break;let b=512*Math.ceil(L.size/512);if(O+b+512>R.size)break;O+=b,g.mtimeCache&&g.mtimeCache.set(L.path,L.mtime)}v=!1,c(g,E,O,F,y)}finally{if(v)try{n.closeSync(F)}catch{}}},c=(g,y,E,v,F)=>{let O=new s.WriteStreamSync(g.file,{fd:v,start:E});y.pipe(O),h(y,F)},f=(g,y,E)=>{y=Array.from(y);let v=new i(g),F=(R,x,L)=>{let b=(U,V)=>{U?n.close(R,K=>L(U)):L(null,V)},S=0;if(x===0)return b(null,0);let N=0,H=Buffer.alloc(512),T=(U,V)=>{if(U)return b(U);if(N+=V,N<512&&V)return n.read(R,H,N,H.length-N,S+N,T);if(S===0&&H[0]===31&&H[1]===139)return b(new Error("cannot append to compressed archives"));if(N<512)return b(null,S);let K=new u(H);if(!K.cksumValid)return b(null,S);let B=512*Math.ceil(K.size/512);if(S+B+512>x||(S+=B+512,S>=x))return b(null,S);g.mtimeCache&&g.mtimeCache.set(K.path,K.mtime),N=0,n.read(R,H,0,512,S,T)};n.read(R,H,0,512,S,T)},O=new Promise((R,x)=>{v.on("error",x);let L="r+",b=(S,N)=>{if(S&&S.code==="ENOENT"&&L==="r+")return L="w+",n.open(g.file,L,b);if(S)return x(S);n.fstat(N,(H,T)=>{if(H)return n.close(N,()=>x(H));F(N,T.size,(U,V)=>{if(U)return x(U);let K=new s.WriteStream(g.file,{fd:N,start:V});v.pipe(K),K.on("error",x),K.on("close",R),p(v,y)})})};n.open(g.file,L,b)});return E?O.then(E,E):O},h=(g,y)=>{y.forEach(E=>{E.charAt(0)==="@"?o({file:a.resolve(g.cwd,E.slice(1)),sync:!0,noResume:!0,onentry:v=>g.add(v)}):g.add(E)}),g.end()},p=(g,y)=>{for(;y.length;){let E=y.shift();if(E.charAt(0)==="@")return o({file:a.resolve(g.cwd,E.slice(1)),noResume:!0,onentry:v=>g.add(v)}).then(v=>p(g,y));g.add(E)}g.end()}}),oT=te((t,e)=>{"use strict";W();var r=Kn(),i=nb();e.exports=(s,o,a)=>{let u=r(s);if(!u.file)throw new TypeError("file is required");if(u.gzip)throw new TypeError("cannot append to compressed archives");if(!o||!Array.isArray(o)||!o.length)throw new TypeError("no files or directories specified");return o=Array.from(o),n(u),i(u,o,a)};var n=s=>{let o=s.filter;s.mtimeCache||(s.mtimeCache=new Map),s.filter=o?(a,u)=>o(a,u)&&!(s.mtimeCache.get(a)>u.mtime):(a,u)=>!(s.mtimeCache.get(a)>u.mtime)}}),aT=te((t,e)=>{W();var{promisify:r}=re("util"),i=re("fs"),n=s=>{if(!s)s={mode:511,fs:i};else if(typeof s=="object")s={mode:511,fs:i,...s};else if(typeof s=="number")s={mode:s,fs:i};else if(typeof s=="string")s={mode:parseInt(s,8),fs:i};else throw new TypeError("invalid options argument");return s.mkdir=s.mkdir||s.fs.mkdir||i.mkdir,s.mkdirAsync=r(s.mkdir),s.stat=s.stat||s.fs.stat||i.stat,s.statAsync=r(s.stat),s.statSync=s.statSync||s.fs.statSync||i.statSync,s.mkdirSync=s.mkdirSync||s.fs.mkdirSync||i.mkdirSync,s};e.exports=n}),uT=te((t,e)=>{W();var r=process.env.__TESTING_MKDIRP_PLATFORM__||process.platform,{resolve:i,parse:n}=re("path"),s=o=>{if(/\0/.test(o))throw Object.assign(new TypeError("path must be a string without null bytes"),{path:o,code:"ERR_INVALID_ARG_VALUE"});if(o=i(o),r==="win32"){let a=/[*|"<>?:]/,{root:u}=n(o);if(a.test(o.substr(u.length)))throw Object.assign(new Error("Illegal characters in path."),{path:o,code:"EINVAL"})}return o};e.exports=s}),lT=te((t,e)=>{W();var{dirname:r}=re("path"),i=(s,o,a=void 0)=>a===o?Promise.resolve():s.statAsync(o).then(u=>u.isDirectory()?a:void 0,u=>u.code==="ENOENT"?i(s,r(o),o):void 0),n=(s,o,a=void 0)=>{if(a!==o)try{return s.statSync(o).isDirectory()?a:void 0}catch(u){return u.code==="ENOENT"?n(s,r(o),o):void 0}};e.exports={findMade:i,findMadeSync:n}}),sb=te((t,e)=>{W();var{dirname:r}=re("path"),i=(s,o,a)=>{o.recursive=!1;let u=r(s);return u===s?o.mkdirAsync(s,o).catch(l=>{if(l.code!=="EISDIR")throw l}):o.mkdirAsync(s,o).then(()=>a||s,l=>{if(l.code==="ENOENT")return i(u,o).then(c=>i(s,o,c));if(l.code!=="EEXIST"&&l.code!=="EROFS")throw l;return o.statAsync(s).then(c=>{if(c.isDirectory())return a;throw l},()=>{throw l})})},n=(s,o,a)=>{let u=r(s);if(o.recursive=!1,u===s)try{return o.mkdirSync(s,o)}catch(l){if(l.code!=="EISDIR")throw l;return}try{return o.mkdirSync(s,o),a||s}catch(l){if(l.code==="ENOENT")return n(s,o,n(u,o,a));if(l.code!=="EEXIST"&&l.code!=="EROFS")throw l;try{if(!o.statSync(s).isDirectory())throw l}catch{throw l}}};e.exports={mkdirpManual:i,mkdirpManualSync:n}}),cT=te((t,e)=>{W();var{dirname:r}=re("path"),{findMade:i,findMadeSync:n}=lT(),{mkdirpManual:s,mkdirpManualSync:o}=sb(),a=(l,c)=>(c.recursive=!0,r(l)===l?c.mkdirAsync(l,c):i(c,l).then(f=>c.mkdirAsync(l,c).then(()=>f).catch(h=>{if(h.code==="ENOENT")return s(l,c);throw h}))),u=(l,c)=>{if(c.recursive=!0,r(l)===l)return c.mkdirSync(l,c);let f=n(c,l);try{return c.mkdirSync(l,c),f}catch(h){if(h.code==="ENOENT")return o(l,c);throw h}};e.exports={mkdirpNative:a,mkdirpNativeSync:u}}),hT=te((t,e)=>{W();var r=re("fs"),i=process.env.__TESTING_MKDIRP_NODE_VERSION__||process.version,n=i.replace(/^v/,"").split("."),s=+n[0]>10||+n[0]==10&&+n[1]>=12,o=s?u=>u.mkdir===r.mkdir:()=>!1,a=s?u=>u.mkdirSync===r.mkdirSync:()=>!1;e.exports={useNative:o,useNativeSync:a}}),fT=te((t,e)=>{W();var r=aT(),i=uT(),{mkdirpNative:n,mkdirpNativeSync:s}=cT(),{mkdirpManual:o,mkdirpManualSync:a}=sb(),{useNative:u,useNativeSync:l}=hT(),c=(h,p)=>(h=i(h),p=r(p),u(p)?n(h,p):o(h,p)),f=(h,p)=>(h=i(h),p=r(p),l(p)?s(h,p):a(h,p));c.sync=f,c.native=(h,p)=>n(i(h),r(p)),c.manual=(h,p)=>o(i(h),r(p)),c.nativeSync=(h,p)=>s(i(h),r(p)),c.manualSync=(h,p)=>a(i(h),r(p)),e.exports=c}),pT=te((t,e)=>{"use strict";W();var r=re("fs"),i=re("path"),n=r.lchown?"lchown":"chown",s=r.lchownSync?"lchownSync":"chownSync",o=r.lchown&&!process.version.match(/v1[1-9]+\./)&&!process.version.match(/v10\.[6-9]/),a=(O,R,x)=>{try{return r[s](O,R,x)}catch(L){if(L.code!=="ENOENT")throw L}},u=(O,R,x)=>{try{return r.chownSync(O,R,x)}catch(L){if(L.code!=="ENOENT")throw L}},l=o?(O,R,x,L)=>b=>{!b||b.code!=="EISDIR"?L(b):r.chown(O,R,x,L)}:(O,R,x,L)=>L,c=o?(O,R,x)=>{try{return a(O,R,x)}catch(L){if(L.code!=="EISDIR")throw L;u(O,R,x)}}:(O,R,x)=>a(O,R,x),f=process.version,h=(O,R,x)=>r.readdir(O,R,x),p=(O,R)=>r.readdirSync(O,R);/^v4\./.test(f)&&(h=(O,R,x)=>r.readdir(O,x));var g=(O,R,x,L)=>{r[n](O,R,x,l(O,R,x,b=>{L(b&&b.code!=="ENOENT"?b:null)}))},y=(O,R,x,L,b)=>{if(typeof R=="string")return r.lstat(i.resolve(O,R),(S,N)=>{if(S)return b(S.code!=="ENOENT"?S:null);N.name=R,y(O,N,x,L,b)});if(R.isDirectory())E(i.resolve(O,R.name),x,L,S=>{if(S)return b(S);let N=i.resolve(O,R.name);g(N,x,L,b)});else{let S=i.resolve(O,R.name);g(S,x,L,b)}},E=(O,R,x,L)=>{h(O,{withFileTypes:!0},(b,S)=>{if(b){if(b.code==="ENOENT")return L();if(b.code!=="ENOTDIR"&&b.code!=="ENOTSUP")return L(b)}if(b||!S.length)return g(O,R,x,L);let N=S.length,H=null,T=U=>{if(!H){if(U)return L(H=U);if(--N===0)return g(O,R,x,L)}};S.forEach(U=>y(O,U,R,x,T))})},v=(O,R,x,L)=>{if(typeof R=="string")try{let b=r.lstatSync(i.resolve(O,R));b.name=R,R=b}catch(b){if(b.code==="ENOENT")return;throw b}R.isDirectory()&&F(i.resolve(O,R.name),x,L),c(i.resolve(O,R.name),x,L)},F=(O,R,x)=>{let L;try{L=p(O,{withFileTypes:!0})}catch(b){if(b.code==="ENOENT")return;if(b.code==="ENOTDIR"||b.code==="ENOTSUP")return c(O,R,x);throw b}return L&&L.length&&L.forEach(b=>v(O,b,R,x)),c(O,R,x)};e.exports=E,E.sync=F}),dT=te((t,e)=>{"use strict";W();var r=fT(),i=re("fs"),n=re("path"),s=pT(),o=Zn(),a=class extends Error{constructor(y,E){super("Cannot extract through symbolic link"),this.path=E,this.symlink=y}get name(){return"SylinkError"}},u=class extends Error{constructor(y,E){super(E+": Cannot cd into '"+y+"'"),this.path=y,this.code=E}get name(){return"CwdError"}},l=(y,E)=>y.get(o(E)),c=(y,E,v)=>y.set(o(E),v),f=(y,E)=>{i.stat(y,(v,F)=>{(v||!F.isDirectory())&&(v=new u(y,v&&v.code||"ENOTDIR")),E(v)})};e.exports=(y,E,v)=>{y=o(y);let F=E.umask,O=E.mode|448,R=(O&F)!==0,x=E.uid,L=E.gid,b=typeof x=="number"&&typeof L=="number"&&(x!==E.processUid||L!==E.processGid),S=E.preserve,N=E.unlink,H=E.cache,T=o(E.cwd),U=(K,B)=>{K?v(K):(c(H,y,!0),B&&b?s(B,x,L,C=>U(C)):R?i.chmod(y,O,v):v())};if(H&&l(H,y)===!0)return U();if(y===T)return f(y,U);if(S)return r(y,{mode:O}).then(K=>U(null,K),U);let V=o(n.relative(T,y)).split("/");h(T,V,O,H,N,T,null,U)};var h=(y,E,v,F,O,R,x,L)=>{if(!E.length)return L(null,x);let b=E.shift(),S=o(n.resolve(y+"/"+b));if(l(F,S))return h(S,E,v,F,O,R,x,L);i.mkdir(S,v,p(S,E,v,F,O,R,x,L))},p=(y,E,v,F,O,R,x,L)=>b=>{b?i.lstat(y,(S,N)=>{if(S)S.path=S.path&&o(S.path),L(S);else if(N.isDirectory())h(y,E,v,F,O,R,x,L);else if(O)i.unlink(y,H=>{if(H)return L(H);i.mkdir(y,v,p(y,E,v,F,O,R,x,L))});else{if(N.isSymbolicLink())return L(new a(y,y+"/"+E.join("/")));L(b)}}):(x=x||y,h(y,E,v,F,O,R,x,L))},g=y=>{let E=!1,v="ENOTDIR";try{E=i.statSync(y).isDirectory()}catch(F){v=F.code}finally{if(!E)throw new u(y,v)}};e.exports.sync=(y,E)=>{y=o(y);let v=E.umask,F=E.mode|448,O=(F&v)!==0,R=E.uid,x=E.gid,L=typeof R=="number"&&typeof x=="number"&&(R!==E.processUid||x!==E.processGid),b=E.preserve,S=E.unlink,N=E.cache,H=o(E.cwd),T=K=>{c(N,y,!0),K&&L&&s.sync(K,R,x),O&&i.chmodSync(y,F)};if(N&&l(N,y)===!0)return T();if(y===H)return g(H),T();if(b)return T(r.sync(y,F));let U=o(n.relative(H,y)).split("/"),V=null;for(let K=U.shift(),B=H;K&&(B+="/"+K);K=U.shift())if(B=o(n.resolve(B)),!l(N,B))try{i.mkdirSync(B,F),V=V||B,c(N,B,!0)}catch{let C=i.lstatSync(B);if(C.isDirectory()){c(N,B,!0);continue}else if(S){i.unlinkSync(B),i.mkdirSync(B,F),V=V||B,c(N,B,!0);continue}else if(C.isSymbolicLink())return new a(B,B+"/"+U.join("/"))}return T(V)}}),ob=te((t,e)=>{W();var r=Object.create(null),{hasOwnProperty:i}=Object.prototype;e.exports=n=>(i.call(r,n)||(r[n]=n.normalize("NFKD")),r[n])}),mT=te((t,e)=>{W();var r=re("assert"),i=ob(),n=Xn(),{join:s}=re("path"),o=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,a=o==="win32";e.exports=()=>{let u=new Map,l=new Map,c=E=>E.split("/").slice(0,-1).reduce((v,F)=>(v.length&&(F=s(v[v.length-1],F)),v.push(F||"/"),v),[]),f=new Set,h=E=>{let v=l.get(E);if(!v)throw new Error("function does not have any path reservations");return{paths:v.paths.map(F=>u.get(F)),dirs:[...v.dirs].map(F=>u.get(F))}},p=E=>{let{paths:v,dirs:F}=h(E);return v.every(O=>O[0]===E)&&F.every(O=>O[0]instanceof Set&&O[0].has(E))},g=E=>f.has(E)||!p(E)?!1:(f.add(E),E(()=>y(E)),!0),y=E=>{if(!f.has(E))return!1;let{paths:v,dirs:F}=l.get(E),O=new Set;return v.forEach(R=>{let x=u.get(R);r.equal(x[0],E),x.length===1?u.delete(R):(x.shift(),typeof x[0]=="function"?O.add(x[0]):x[0].forEach(L=>O.add(L)))}),F.forEach(R=>{let x=u.get(R);r(x[0]instanceof Set),x[0].size===1&&x.length===1?u.delete(R):x[0].size===1?(x.shift(),O.add(x[0])):x[0].delete(E)}),f.delete(E),O.forEach(R=>g(R)),!0};return{check:p,reserve:(E,v)=>{E=a?["win32 parallelization disabled"]:E.map(O=>i(n(s(O))).toLowerCase());let F=new Set(E.map(O=>c(O)).reduce((O,R)=>O.concat(R)));return l.set(v,{dirs:F,paths:E}),E.forEach(O=>{let R=u.get(O);R?R.push(v):u.set(O,[v])}),F.forEach(O=>{let R=u.get(O);R?R[R.length-1]instanceof Set?R[R.length-1].add(v):R.push(new Set([v])):u.set(O,[new Set([v])])}),g(v)}}}}),gT=te((t,e)=>{W();var r=process.env.__FAKE_PLATFORM__||process.platform,i=r==="win32",n=global.__FAKE_TESTING_FS__||re("fs"),{O_CREAT:s,O_TRUNC:o,O_WRONLY:a,UV_FS_O_FILEMAP:u=0}=n.constants,l=i&&!!u,c=512*1024,f=u|o|s|a;e.exports=l?h=>h<c?f:"w":()=>"w"}),ab=te((t,e)=>{"use strict";W();var r=re("assert"),i=$h(),n=re("fs"),s=Qn(),o=re("path"),a=dT(),u=eb(),l=mT(),c=tb(),f=Zn(),h=Xn(),p=ob(),g=Symbol("onEntry"),y=Symbol("checkFs"),E=Symbol("checkFs2"),v=Symbol("pruneCache"),F=Symbol("isReusable"),O=Symbol("makeFs"),R=Symbol("file"),x=Symbol("directory"),L=Symbol("link"),b=Symbol("symlink"),S=Symbol("hardlink"),N=Symbol("unsupported"),H=Symbol("checkPath"),T=Symbol("mkdir"),U=Symbol("onError"),V=Symbol("pending"),K=Symbol("pend"),B=Symbol("unpend"),C=Symbol("ended"),k=Symbol("maybeClose"),j=Symbol("skip"),z=Symbol("doChown"),P=Symbol("uid"),d=Symbol("gid"),m=Symbol("checkedCwd"),D=re("crypto"),A=gT(),w=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,I=w==="win32",M=(_,Y)=>{if(!I)return n.unlink(_,Y);let X=_+".DELETE."+D.randomBytes(16).toString("hex");n.rename(_,X,oe=>{if(oe)return Y(oe);n.unlink(X,Y)})},Z=_=>{if(!I)return n.unlinkSync(_);let Y=_+".DELETE."+D.randomBytes(16).toString("hex");n.renameSync(_,Y),n.unlinkSync(Y)},q=(_,Y,X)=>_===_>>>0?_:Y===Y>>>0?Y:X,Q=_=>p(h(f(_))).toLowerCase(),G=(_,Y)=>{Y=Q(Y);for(let X of _.keys()){let oe=Q(X);(oe===Y||oe.indexOf(Y+"/")===0)&&_.delete(X)}},ie=_=>{for(let Y of _.keys())_.delete(Y)},ce=class extends i{constructor(_){if(_||(_={}),_.ondone=Y=>{this[C]=!0,this[k]()},super(_),this[m]=!1,this.reservations=l(),this.transform=typeof _.transform=="function"?_.transform:null,this.writable=!0,this.readable=!1,this[V]=0,this[C]=!1,this.dirCache=_.dirCache||new Map,typeof _.uid=="number"||typeof _.gid=="number"){if(typeof _.uid!="number"||typeof _.gid!="number")throw new TypeError("cannot set owner without number uid and gid");if(_.preserveOwner)throw new TypeError("cannot preserve owner in archive and also set owner explicitly");this.uid=_.uid,this.gid=_.gid,this.setOwner=!0}else this.uid=null,this.gid=null,this.setOwner=!1;_.preserveOwner===void 0&&typeof _.uid!="number"?this.preserveOwner=process.getuid&&process.getuid()===0:this.preserveOwner=!!_.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=_.forceChown===!0,this.win32=!!_.win32||I,this.newer=!!_.newer,this.keep=!!_.keep,this.noMtime=!!_.noMtime,this.preservePaths=!!_.preservePaths,this.unlink=!!_.unlink,this.cwd=f(o.resolve(_.cwd||process.cwd())),this.strip=+_.strip||0,this.processUmask=_.noChmod?0:process.umask(),this.umask=typeof _.umask=="number"?_.umask:this.processUmask,this.dmode=_.dmode||511&~this.umask,this.fmode=_.fmode||438&~this.umask,this.on("entry",Y=>this[g](Y))}warn(_,Y,X={}){return(_==="TAR_BAD_ARCHIVE"||_==="TAR_ABORT")&&(X.recoverable=!1),super.warn(_,Y,X)}[k](){this[C]&&this[V]===0&&(this.emit("prefinish"),this.emit("finish"),this.emit("end"))}[H](_){if(this.strip){let Y=f(_.path).split("/");if(Y.length<this.strip)return!1;if(_.path=Y.slice(this.strip).join("/"),_.type==="Link"){let X=f(_.linkpath).split("/");if(X.length>=this.strip)_.linkpath=X.slice(this.strip).join("/");else return!1}}if(!this.preservePaths){let Y=f(_.path),X=Y.split("/");if(X.includes("..")||I&&/^[a-z]:\.\.$/i.test(X[0]))return this.warn("TAR_ENTRY_ERROR","path contains '..'",{entry:_,path:Y}),!1;let[oe,le]=c(Y);oe&&(_.path=le,this.warn("TAR_ENTRY_INFO",`stripping ${oe} from absolute path`,{entry:_,path:Y}))}if(o.isAbsolute(_.path)?_.absolute=f(o.resolve(_.path)):_.absolute=f(o.resolve(this.cwd,_.path)),!this.preservePaths&&_.absolute.indexOf(this.cwd+"/")!==0&&_.absolute!==this.cwd)return this.warn("TAR_ENTRY_ERROR","path escaped extraction target",{entry:_,path:f(_.path),resolvedPath:_.absolute,cwd:this.cwd}),!1;if(_.absolute===this.cwd&&_.type!=="Directory"&&_.type!=="GNUDumpDir")return!1;if(this.win32){let{root:Y}=o.win32.parse(_.absolute);_.absolute=Y+u.encode(_.absolute.slice(Y.length));let{root:X}=o.win32.parse(_.path);_.path=X+u.encode(_.path.slice(X.length))}return!0}[g](_){if(!this[H](_))return _.resume();switch(r.equal(typeof _.absolute,"string"),_.type){case"Directory":case"GNUDumpDir":_.mode&&(_.mode=_.mode|448);case"File":case"OldFile":case"ContiguousFile":case"Link":case"SymbolicLink":return this[y](_);case"CharacterDevice":case"BlockDevice":case"FIFO":default:return this[N](_)}}[U](_,Y){_.name==="CwdError"?this.emit("error",_):(this.warn("TAR_ENTRY_ERROR",_,{entry:Y}),this[B](),Y.resume())}[T](_,Y,X){a(f(_),{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:Y,noChmod:this.noChmod},X)}[z](_){return this.forceChown||this.preserveOwner&&(typeof _.uid=="number"&&_.uid!==this.processUid||typeof _.gid=="number"&&_.gid!==this.processGid)||typeof this.uid=="number"&&this.uid!==this.processUid||typeof this.gid=="number"&&this.gid!==this.processGid}[P](_){return q(this.uid,_.uid,this.processUid)}[d](_){return q(this.gid,_.gid,this.processGid)}[R](_,Y){let X=_.mode&4095||this.fmode,oe=new s.WriteStream(_.absolute,{flags:A(_.size),mode:X,autoClose:!1});oe.on("error",pe=>{oe.fd&&n.close(oe.fd,()=>{}),oe.write=()=>!0,this[U](pe,_),Y()});let le=1,Ee=pe=>{if(pe){oe.fd&&n.close(oe.fd,()=>{}),this[U](pe,_),Y();return}--le===0&&n.close(oe.fd,Ae=>{Ae?this[U](Ae,_):this[B](),Y()})};oe.on("finish",pe=>{let Ae=_.absolute,ht=oe.fd;if(_.mtime&&!this.noMtime){le++;let ft=_.atime||new Date,un=_.mtime;n.futimes(ht,ft,un,ln=>ln?n.utimes(Ae,ft,un,ba=>Ee(ba&&ln)):Ee())}if(this[z](_)){le++;let ft=this[P](_),un=this[d](_);n.fchown(ht,ft,un,ln=>ln?n.chown(Ae,ft,un,ba=>Ee(ba&&ln)):Ee())}Ee()});let he=this.transform&&this.transform(_)||_;he!==_&&(he.on("error",pe=>{this[U](pe,_),Y()}),_.pipe(he)),he.pipe(oe)}[x](_,Y){let X=_.mode&4095||this.dmode;this[T](_.absolute,X,oe=>{if(oe){this[U](oe,_),Y();return}let le=1,Ee=he=>{--le===0&&(Y(),this[B](),_.resume())};_.mtime&&!this.noMtime&&(le++,n.utimes(_.absolute,_.atime||new Date,_.mtime,Ee)),this[z](_)&&(le++,n.chown(_.absolute,this[P](_),this[d](_),Ee)),Ee()})}[N](_){_.unsupported=!0,this.warn("TAR_ENTRY_UNSUPPORTED",`unsupported entry type: ${_.type}`,{entry:_}),_.resume()}[b](_,Y){this[L](_,_.linkpath,"symlink",Y)}[S](_,Y){let X=f(o.resolve(this.cwd,_.linkpath));this[L](_,X,"link",Y)}[K](){this[V]++}[B](){this[V]--,this[k]()}[j](_){this[B](),_.resume()}[F](_,Y){return _.type==="File"&&!this.unlink&&Y.isFile()&&Y.nlink<=1&&!I}[y](_){this[K]();let Y=[_.path];_.linkpath&&Y.push(_.linkpath),this.reservations.reserve(Y,X=>this[E](_,X))}[v](_){_.type==="SymbolicLink"?ie(this.dirCache):_.type!=="Directory"&&G(this.dirCache,_.absolute)}[E](_,Y){this[v](_);let X=he=>{this[v](_),Y(he)},oe=()=>{this[T](this.cwd,this.dmode,he=>{if(he){this[U](he,_),X();return}this[m]=!0,le()})},le=()=>{if(_.absolute!==this.cwd){let he=f(o.dirname(_.absolute));if(he!==this.cwd)return this[T](he,this.dmode,pe=>{if(pe){this[U](pe,_),X();return}Ee()})}Ee()},Ee=()=>{n.lstat(_.absolute,(he,pe)=>{if(pe&&(this.keep||this.newer&&pe.mtime>_.mtime)){this[j](_),X();return}if(he||this[F](_,pe))return this[O](null,_,X);if(pe.isDirectory()){if(_.type==="Directory"){let Ae=!this.noChmod&&_.mode&&(pe.mode&4095)!==_.mode,ht=ft=>this[O](ft,_,X);return Ae?n.chmod(_.absolute,_.mode,ht):ht()}if(_.absolute!==this.cwd)return n.rmdir(_.absolute,Ae=>this[O](Ae,_,X))}if(_.absolute===this.cwd)return this[O](null,_,X);M(_.absolute,Ae=>this[O](Ae,_,X))})};this[m]?le():oe()}[O](_,Y,X){if(_){this[U](_,Y),X();return}switch(Y.type){case"File":case"OldFile":case"ContiguousFile":return this[R](Y,X);case"Link":return this[S](Y,X);case"SymbolicLink":return this[b](Y,X);case"Directory":case"GNUDumpDir":return this[x](Y,X)}}[L](_,Y,X,oe){n[X](Y,_.absolute,le=>{le?this[U](le,_):(this[B](),_.resume()),oe()})}},we=_=>{try{return[null,_()]}catch(Y){return[Y,null]}},De=class extends ce{[O](_,Y){return super[O](_,Y,()=>{})}[y](_){if(this[v](_),!this[m]){let le=this[T](this.cwd,this.dmode);if(le)return this[U](le,_);this[m]=!0}if(_.absolute!==this.cwd){let le=f(o.dirname(_.absolute));if(le!==this.cwd){let Ee=this[T](le,this.dmode);if(Ee)return this[U](Ee,_)}}let[Y,X]=we(()=>n.lstatSync(_.absolute));if(X&&(this.keep||this.newer&&X.mtime>_.mtime))return this[j](_);if(Y||this[F](_,X))return this[O](null,_);if(X.isDirectory()){if(_.type==="Directory"){let Ee=!this.noChmod&&_.mode&&(X.mode&4095)!==_.mode,[he]=Ee?we(()=>{n.chmodSync(_.absolute,_.mode)}):[];return this[O](he,_)}let[le]=we(()=>n.rmdirSync(_.absolute));this[O](le,_)}let[oe]=_.absolute===this.cwd?[]:we(()=>Z(_.absolute));this[O](oe,_)}[R](_,Y){let X=_.mode&4095||this.fmode,oe=he=>{let pe;try{n.closeSync(le)}catch(Ae){pe=Ae}(he||pe)&&this[U](he||pe,_),Y()},le;try{le=n.openSync(_.absolute,A(_.size),X)}catch(he){return oe(he)}let Ee=this.transform&&this.transform(_)||_;Ee!==_&&(Ee.on("error",he=>this[U](he,_)),_.pipe(Ee)),Ee.on("data",he=>{try{n.writeSync(le,he,0,he.length)}catch(pe){oe(pe)}}),Ee.on("end",he=>{let pe=null;if(_.mtime&&!this.noMtime){let Ae=_.atime||new Date,ht=_.mtime;try{n.futimesSync(le,Ae,ht)}catch(ft){try{n.utimesSync(_.absolute,Ae,ht)}catch{pe=ft}}}if(this[z](_)){let Ae=this[P](_),ht=this[d](_);try{n.fchownSync(le,Ae,ht)}catch(ft){try{n.chownSync(_.absolute,Ae,ht)}catch{pe=pe||ft}}}oe(pe)})}[x](_,Y){let X=_.mode&4095||this.dmode,oe=this[T](_.absolute,X);if(oe){this[U](oe,_),Y();return}if(_.mtime&&!this.noMtime)try{n.utimesSync(_.absolute,_.atime||new Date,_.mtime)}catch{}if(this[z](_))try{n.chownSync(_.absolute,this[P](_),this[d](_))}catch{}Y(),_.resume()}[T](_,Y){try{return a.sync(f(_),{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:Y})}catch(X){return X}}[L](_,Y,X,oe){try{n[X+"Sync"](Y,_.absolute),oe(),_.resume()}catch(le){return this[U](le,_)}}};ce.Sync=De,e.exports=ce}),yT=te((t,e)=>{"use strict";W();var r=Kn(),i=ab(),n=re("fs"),s=Qn(),o=re("path"),a=Xn();e.exports=(p,g,y)=>{typeof p=="function"?(y=p,g=null,p={}):Array.isArray(p)&&(g=p,p={}),typeof g=="function"&&(y=g,g=null),g?g=Array.from(g):g=[];let E=r(p);if(E.sync&&typeof y=="function")throw new TypeError("callback not supported for sync tar functions");if(!E.file&&typeof y=="function")throw new TypeError("callback only supported with file option");return g.length&&u(E,g),E.file&&E.sync?l(E):E.file?c(E,y):E.sync?f(E):h(E)};var u=(p,g)=>{let y=new Map(g.map(F=>[a(F),!0])),E=p.filter,v=(F,O)=>{let R=O||o.parse(F).root||".",x=F===R?!1:y.has(F)?y.get(F):v(o.dirname(F),R);return y.set(F,x),x};p.filter=E?(F,O)=>E(F,O)&&v(a(F)):F=>v(a(F))},l=p=>{let g=new i.Sync(p),y=p.file,E=n.statSync(y),v=p.maxReadSize||16*1024*1024;new s.ReadStreamSync(y,{readSize:v,size:E.size}).pipe(g)},c=(p,g)=>{let y=new i(p),E=p.maxReadSize||16*1024*1024,v=p.file,F=new Promise((O,R)=>{y.on("error",R),y.on("close",O),n.stat(v,(x,L)=>{if(x)R(x);else{let b=new s.ReadStream(v,{readSize:E,size:L.size});b.on("error",R),b.pipe(y)}})});return g?F.then(g,g):F},f=p=>new i.Sync(p),h=p=>new i(p)}),ET=te(t=>{"use strict";W(),t.c=t.create=sT(),t.r=t.replace=nb(),t.t=t.list=Hh(),t.u=t.update=oT(),t.x=t.extract=yT(),t.Pack=jh(),t.Unpack=ab(),t.Parse=$h(),t.ReadEntry=Ih(),t.WriteEntry=rb(),t.Header=Jn(),t.Pax=Nh(),t.types=QD()}),DT=te((t,e)=>{W();function r(i,n){typeof n=="boolean"&&(n={forever:n}),this._originalTimeouts=JSON.parse(JSON.stringify(i)),this._timeouts=i,this._options=n||{},this._maxRetryTime=n&&n.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))}e.exports=r,r.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)},r.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null},r.prototype.retry=function(i){if(this._timeout&&clearTimeout(this._timeout),!i)return!1;var n=new Date().getTime();if(i&&n-this._operationStart>=this._maxRetryTime)return this._errors.push(i),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(i);var s=this._timeouts.shift();if(s===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),s=this._cachedTimeouts.slice(-1);else return!1;var o=this;return this._timer=setTimeout(function(){o._attempts++,o._operationTimeoutCb&&(o._timeout=setTimeout(function(){o._operationTimeoutCb(o._attempts)},o._operationTimeout),o._options.unref&&o._timeout.unref()),o._fn(o._attempts)},s),this._options.unref&&this._timer.unref(),!0},r.prototype.attempt=function(i,n){this._fn=i,n&&(n.timeout&&(this._operationTimeout=n.timeout),n.cb&&(this._operationTimeoutCb=n.cb));var s=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){s._operationTimeoutCb()},s._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)},r.prototype.try=function(i){console.log("Using RetryOperation.try() is deprecated"),this.attempt(i)},r.prototype.start=function(i){console.log("Using RetryOperation.start() is deprecated"),this.attempt(i)},r.prototype.start=r.prototype.try,r.prototype.errors=function(){return this._errors},r.prototype.attempts=function(){return this._attempts},r.prototype.mainError=function(){if(this._errors.length===0)return null;for(var i={},n=null,s=0,o=0;o<this._errors.length;o++){var a=this._errors[o],u=a.message,l=(i[u]||0)+1;i[u]=l,l>=s&&(n=a,s=l)}return n}}),bT=te(t=>{W();var e=DT();t.operation=function(r){var i=t.timeouts(r);return new e(i,{forever:r&&(r.forever||r.retries===1/0),unref:r&&r.unref,maxRetryTime:r&&r.maxRetryTime})},t.timeouts=function(r){if(r instanceof Array)return[].concat(r);var i={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var n in r)i[n]=r[n];if(i.minTimeout>i.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var s=[],o=0;o<i.retries;o++)s.push(this.createTimeout(o,i));return r&&r.forever&&!s.length&&s.push(this.createTimeout(o,i)),s.sort(function(a,u){return a-u}),s},t.createTimeout=function(r,i){var n=i.randomize?Math.random()+1:1,s=Math.round(n*Math.max(i.minTimeout,1)*Math.pow(i.factor,r));return s=Math.min(s,i.maxTimeout),s},t.wrap=function(r,i,n){if(i instanceof Array&&(n=i,i=null),!n){n=[];for(var s in r)typeof r[s]=="function"&&n.push(s)}for(var o=0;o<n.length;o++){var a=n[o],u=r[a];r[a]=function(l){var c=t.operation(i),f=Array.prototype.slice.call(arguments,1),h=f.pop();f.push(function(p){c.retry(p)||(p&&(arguments[0]=c.mainError()),h.apply(this,arguments))}),c.attempt(function(){l.apply(r,f)})}.bind(r,u),r[a].options=i}}}),_T=te((t,e)=>{W(),e.exports=bT()}),wT=te((t,e)=>{W();var r=_T();function i(n,s){function o(a,u){var l=s||{},c;"randomize"in l||(l.randomize=!0),c=r.operation(l);function f(g){u(g||new Error("Aborted"))}function h(g,y){if(g.bail){f(g);return}c.retry(g)?l.onRetry&&l.onRetry(g,y):u(c.mainError())}function p(g){var y;try{y=n(f,g)}catch(E){h(E,g);return}Promise.resolve(y).then(a).catch(function(E){h(E,g)})}c.attempt(p)}return new Promise(o)}e.exports=i}),ST={};Gk(ST,{bold:()=>RT,dimmed:()=>OT,error:()=>BT,grey:()=>kT,info:()=>xT,item:()=>TT,log:()=>si,turboBlue:()=>tn,turboGradient:()=>vT,turboLoader:()=>CT,turboRed:()=>fb,underline:()=>FT,warn:()=>LT,yellow:()=>pb});W();var cb="#0099F7",hb="#F11712",AT="#FFFF00",vT=(0,lb.default)(cb,hb),tn=Or.default.hex(cb),fb=Or.default.hex(hb),pb=Or.default.hex(AT),CT=t=>(0,ub.default)({text:t,spinner:{frames:[" ",tn("> "),tn(">> "),tn(">>>")]}}),xT=(...t)=>{si(tn.bold(">>>"),...t)},RT=(...t)=>{si(Or.default.bold(...t))},FT=(...t)=>{si(Or.default.underline(...t))},OT=(...t)=>{si(Or.default.dim(...t))},kT=(...t)=>{si(Or.default.grey(...t))},TT=(...t)=>{si(tn.bold(" \u2022"),...t)},si=(...t)=>{console.log(...t)},LT=(...t)=>{console.error(pb.bold(">>>"),...t)},BT=(...t)=>{console.error(fb.bold(">>>"),...t)};W();W();W();W();var eN=oa(Vk());W();W();function IT(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}W();W();function Th(t){return Th=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},Th(t)}W();function NT(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function MT(t,e){if(e&&(Th(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return NT(t)}W();function sa(t){return sa=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},sa(t)}W();W();function Wn(t,e){return Wn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Wn(t,e)}function jT(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Wn(t,e)}W();W();function $T(t){return Function.toString.call(t).indexOf("[native code]")!==-1}W();W();function HT(){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 na(t,e,r){return HT()?na=Reflect.construct.bind():na=function(i,n,s){var o=[null];o.push.apply(o,n);var a=Function.bind.apply(i,o),u=new a;return s&&Wn(u,s.prototype),u},na.apply(null,arguments)}function Lh(t){var e=typeof Map=="function"?new Map:void 0;return Lh=function(r){if(r===null||!$T(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(r))return e.get(r);e.set(r,i)}function i(){return na(r,arguments,sa(this).constructor)}return i.prototype=Object.create(r.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),Wn(i,r)},Lh(t)}var tN=oa(eT()),nN=function(t){jT(e,t);function e(r){var i;return IT(this,e),i=MT(this,sa(e).call(this,"No package.json could be found upwards from the directory ".concat(r))),i.directory=r,i}return e}(Lh(Error));W();W();W();W();W();W();var mN=oa(ET()),gN=(0,mb.promisify)(db.Stream.pipeline);W();W();var bN=oa(wT());W();W();W();var je=class extends Error{constructor(t,e){var r;super(t),this.name="ConvertError",this.type=(r=e==null?void 0:e.type)!=null?r:"unknown",Error.captureStackTrace(this,je)}};W();W();W();W();var qT=/^(?!_)(?<manager>.+)@(?<version>.+)$/;function Ke({workspaceRoot:t}){let e=rr.default.join(t,"package.json");try{return(0,rt.readJsonSync)(e,"utf8")}catch(r){if(r&&typeof r=="object"&&"code"in r){if(r.code==="ENOENT")throw new je(`no "package.json" found at ${t}`,{type:"package_json-missing"});if(r.code==="EJSONPARSE")throw new je(`failed to parse "package.json" at ${t}`,{type:"package_json-parse_error"})}throw new Error(`unexpected error reading "package.json" at ${t}`)}}function aa({workspaceRoot:t}){let{packageManager:e}=Ke({workspaceRoot:t});if(e)try{let r=qT.exec(e);if(r){let[i,n]=r;return n}}catch{}}function es({workspaceRoot:t}){let e=Ke({workspaceRoot:t}),r=rr.default.basename(t),{name:i=r,description:n}=e;return{name:i,description:n}}function VD({workspaceRoot:t}){let e=rr.default.join(t,"pnpm-workspace.yaml");if((0,rt.existsSync)(e))try{let r=Ua.load((0,rt.readFileSync)(e,"utf8"));if(r instanceof Object&&"packages"in r&&Array.isArray(r.packages))return r.packages}catch{throw new je(`failed to parse ${e}`,{type:"pnpm-workspace_parse_error"})}return[]}function ua({root:t,lockFile:e,workspaceConfig:r}){let i=s=>rr.default.join(t,s),n={root:t,lockfile:i(e),packageJson:i("package.json"),nodeModules:i("node_modules")};return r&&(n.workspaceConfig=i(r)),n}function qh({workspaces:t}){var e;return t?Array.isArray(t)?t:"packages"in t?(e=t.packages)!=null?e:[]:[]:[]}function la({workspaceRoot:t,workspaceGlobs:e}){return e?e.flatMap(r=>{let i=[`${r}/package.json`];return(0,_b.sync)(i,{onlyFiles:!0,absolute:!0,cwd:t,ignore:["**/node_modules/**"]})}).map(r=>{let i=rr.default.dirname(r),{name:n,description:s}=es({workspaceRoot:i});return{name:n,description:s,paths:{root:i,packageJson:r,nodeModules:rr.default.join(i,"node_modules")}}}):[]}function UT({directory:t}){let e=rr.default.resolve(process.cwd(),t);return{exists:(0,rt.existsSync)(e),absolute:e}}function kr({packageManager:t,action:e,project:r}){let i=r.workspaceData.globs.length>0;return`${e==="remove"?"Removing":"Adding"} ${t} ${i?"workspaces":""} ${e==="remove"?"from":"to"} ${r.name}`}function GT({project:t}){let e=r=>!(r.includes("*")&&(r.includes("**")||r.split("/").slice(0,-1).join("/").includes("*"))||["!","[","]","{","}"].some(i=>r.includes(i)));return t.workspaceData.globs.every(e)}function tr({project:t,options:e}){e!=null&&e.dry||(0,rt.rmSync)(t.paths.lockfile,{force:!0})}async function wb({project:t,options:e}){if(!(e!=null&&e.dry)&&(0,rt.existsSync)(t.paths.lockfile))try{let{stdout:r}=await(0,bb.default)("bun",["bun.lockb"],{stdin:"ignore",cwd:t.paths.root});await(0,rt.writeFile)(rr.default.join(t.paths.root,"yarn.lock"),r)}catch{}finally{(0,rt.rmSync)(t.paths.lockfile,{force:!0})}}function zT({dependencyList:t,project:e,to:r}){let i=[];return e.workspaceData.workspaces.forEach(n=>{let{name:s}=n;if(t[s]){let o=t[s],a=o.startsWith("workspace:")?o.slice(10):o;t[s]=r.name==="pnpm"?`workspace:${a}`:a,i.push(s)}}),{dependencyList:t,updated:i}}function Rr({project:t,workspace:e,to:r,logger:i,options:n}){if(["yarn","npm","bun"].includes(r.name)&&["yarn","npm","bun"].includes(t.packageManager))return;let s=Ke({workspaceRoot:e.paths.root}),o={dependencies:[],devDependencies:[],peerDependencies:[],optionalDependencies:[]},a=["dependencies","devDependencies","peerDependencies","optionalDependencies"];a.forEach(f=>{let h=s[f];if(h){let{updated:p,dependencyList:g}=zT({dependencyList:h,project:t,to:r});s[f]=g,o[f]=p}});let u=f=>{let h=o[f].length;if(h>0)return`${Db.default.green(h.toString())} ${f}`},l=a.map(u).filter(Boolean),c=`./${yb.default.relative(t.paths.root,e.paths.packageJson)}`;if(l.length>=1){let f="updating";l.forEach((h,p)=>{l.length===1?f+=` ${h} in ${c}`:p===l.length-1?f+=`and ${h} in ${c}`:f+=` ${h}, `}),i.workspaceStep(f)}else i.workspaceStep(`no workspace dependencies found in ${c}`);n!=null&&n.dry||(0,Eb.writeJSONSync)(e.paths.packageJson,s,{spaces:2})}var Fr={name:"pnpm",lock:"pnpm-lock.yaml"};async function Sb(t){let e=ii.default.join(t.workspaceRoot,Fr.lock),r=ii.default.join(t.workspaceRoot,"pnpm-workspace.yaml"),i=aa({workspaceRoot:t.workspaceRoot});return(0,qe.existsSync)(e)||(0,qe.existsSync)(r)||i===Fr.name}async function WT(t){if(!await Sb(t))throw new je("Not a pnpm project",{type:"package_manager-unexpected"});let{name:e,description:r}=es(t);return{name:e,description:r,packageManager:Fr.name,paths:ua({root:t.workspaceRoot,lockFile:Fr.lock,workspaceConfig:"pnpm-workspace.yaml"}),workspaceData:{globs:VD(t),workspaces:la({workspaceGlobs:VD(t),...t})}}}async function YT(t){let{project:e,to:r,logger:i,options:n}=t,s=e.workspaceData.globs.length>0;i.mainStep(kr({action:"create",packageManager:Fr.name,project:e}));let o=Ke({workspaceRoot:e.paths.root});i.rootHeader(),o.packageManager=`${r.name}@${r.version}`,i.rootStep(`adding "packageManager" field to ${e.name} root "package.json"`),n!=null&&n.dry||((0,qe.writeJSONSync)(e.paths.packageJson,o,{spaces:2}),s&&(i.rootStep('adding "pnpm-workspace.yaml"'),(0,qe.writeFileSync)(ii.default.join(e.paths.root,"pnpm-workspace.yaml"),`packages:
43
43
  ${e.workspaceData.globs.map(a=>` - "${a}"`).join(`
@@ -49,7 +49,7 @@ ${i.message}`:d,w=[y,e,t].filter(Boolean).join(`
49
49
  `+t.slice(n,s),n=s+1),o=u;return a+=`
50
50
  `,t.length-n>e&&o>n?a+=t.slice(n,o)+`
51
51
  `+t.slice(o+1):a+=t.slice(n),a.slice(1)}function N_(t){for(var e="",r=0,i,n=0;n<t.length;r>=65536?n+=2:n++)r=qi(t,n),i=_e[r],!i&&ji(r)?(e+=t[n],r>=65536&&(e+=t[n+1])):e+=i||x_(r);return e}function k_(t,e,r){var i="",n=t.tag,s,o,u;for(s=0,o=r.length;s<o;s+=1)u=r[s],t.replacer&&(u=t.replacer.call(r,String(s),u)),(Ft(t,e,u,!1,!1)||typeof u=="undefined"&&Ft(t,e,null,!1,!1))&&(i!==""&&(i+=","+(t.condenseFlow?"":" ")),i+=t.dump);t.tag=n,t.dump="["+i+"]"}function Tf(t,e,r,i){var n="",s=t.tag,o,u,a;for(o=0,u=r.length;o<u;o+=1)a=r[o],t.replacer&&(a=t.replacer.call(r,String(o),a)),(Ft(t,e+1,a,!0,!0,!1,!0)||typeof a=="undefined"&&Ft(t,e+1,null,!0,!0,!1,!0))&&((!i||n!=="")&&(n+=su(t,e)),t.dump&&$i===t.dump.charCodeAt(0)?n+="-":n+="- ",n+=t.dump);t.tag=s,t.dump=n||"[]"}function M_(t,e,r){var i="",n=t.tag,s=Object.keys(r),o,u,a,c,l;for(o=0,u=s.length;o<u;o+=1)l="",i!==""&&(l+=", "),t.condenseFlow&&(l+='"'),a=s[o],c=r[a],t.replacer&&(c=t.replacer.call(r,a,c)),Ft(t,e,a,!1,!1)&&(t.dump.length>1024&&(l+="? "),l+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),Ft(t,e,c,!1,!1)&&(l+=t.dump,i+=l));t.tag=n,t.dump="{"+i+"}"}function q_(t,e,r,i){var n="",s=t.tag,o=Object.keys(r),u,a,c,l,f,h;if(t.sortKeys===!0)o.sort();else if(typeof t.sortKeys=="function")o.sort(t.sortKeys);else if(t.sortKeys)throw new Be("sortKeys must be a boolean or a function");for(u=0,a=o.length;u<a;u+=1)h="",(!i||n!=="")&&(h+=su(t,e)),c=o[u],l=r[c],t.replacer&&(l=t.replacer.call(r,c,l)),Ft(t,e+1,c,!0,!0,!0)&&(f=t.tag!==null&&t.tag!=="?"||t.dump&&t.dump.length>1024,f&&(t.dump&&$i===t.dump.charCodeAt(0)?h+="?":h+="? "),h+=t.dump,f&&(h+=su(t,e)),Ft(t,e+1,l,!0,f)&&(t.dump&&$i===t.dump.charCodeAt(0)?h+=":":h+=": ",h+=t.dump,n+=h));t.tag=s,t.dump=n||"{}"}function Of(t,e,r){var i,n,s,o,u,a;for(n=r?t.explicitTypes:t.implicitTypes,s=0,o=n.length;s<o;s+=1)if(u=n[s],(u.instanceOf||u.predicate)&&(!u.instanceOf||typeof e=="object"&&e instanceof u.instanceOf)&&(!u.predicate||u.predicate(e))){if(r?u.multi&&u.representName?t.tag=u.representName(e):t.tag=u.tag:t.tag="?",u.represent){if(a=t.styleMap[u.tag]||u.defaultStyle,ah.call(u.represent)==="[object Function]")i=u.represent(e,a);else if(ch.call(u.represent,a))i=u.represent[a](e,a);else throw new Be("!<"+u.tag+'> tag resolver accepts not "'+a+'" style');t.dump=i}return!0}return!1}function Ft(t,e,r,i,n,s,o){t.tag=null,t.dump=r,Of(t,r,!1)||Of(t,r,!0);var u=ah.call(t.dump),a=i,c;i&&(i=t.flowLevel<0||t.flowLevel>e);var l=u==="[object Object]"||u==="[object Array]",f,h;if(l&&(f=t.duplicates.indexOf(r),h=f!==-1),(t.tag!==null&&t.tag!=="?"||h||t.indent!==2&&e>0)&&(n=!1),h&&t.usedDuplicates[f])t.dump="*ref_"+f;else{if(l&&h&&!t.usedDuplicates[f]&&(t.usedDuplicates[f]=!0),u==="[object Object]")i&&Object.keys(t.dump).length!==0?(q_(t,e,t.dump,n),h&&(t.dump="&ref_"+f+t.dump)):(M_(t,e,t.dump),h&&(t.dump="&ref_"+f+" "+t.dump));else if(u==="[object Array]")i&&t.dump.length!==0?(t.noArrayIndent&&!o&&e>0?Tf(t,e-1,t.dump,n):Tf(t,e,t.dump,n),h&&(t.dump="&ref_"+f+t.dump)):(k_(t,e,t.dump),h&&(t.dump="&ref_"+f+" "+t.dump));else if(u==="[object String]")t.tag!=="?"&&L_(t,t.dump,e,s,a);else{if(u==="[object Undefined]")return!1;if(t.skipInvalid)return!1;throw new Be("unacceptable kind of an object to dump "+u)}t.tag!==null&&t.tag!=="?"&&(c=encodeURI(t.tag[0]==="!"?t.tag.slice(1):t.tag).replace(/!/g,"%21"),t.tag[0]==="!"?c="!"+c:c.slice(0,18)==="tag:yaml.org,2002:"?c="!!"+c.slice(18):c="!<"+c+">",t.dump=c+" "+t.dump)}return!0}function H_(t,e){var r=[],i=[],n,s;for(uu(t,r,i),n=0,s=i.length;n<s;n+=1)e.duplicates.push(r[i[n]]);e.usedDuplicates=new Array(s)}function uu(t,e,r){var i,n,s;if(t!==null&&typeof t=="object")if(n=e.indexOf(t),n!==-1)r.indexOf(n)===-1&&r.push(n);else if(e.push(t),Array.isArray(t))for(n=0,s=t.length;n<s;n+=1)uu(t[n],e,r);else for(i=Object.keys(t),n=0,s=i.length;n<s;n+=1)uu(t[i[n]],e,r)}function $_(t,e){e=e||{};var r=new R_(e);r.noRefs||H_(t,r);var i=t;return r.replacer&&(i=r.replacer.call({"":i},"",i)),Ft(r,0,i,!0,!0)?r.dump+`
52
- `:""}var U_=$_,j_={dump:U_};function pu(t,e){return function(){throw new Error("Function yaml."+t+" is removed in js-yaml 4. Use yaml."+e+" instead, which is now safe by default.")}}var G_=Ae,W_=Lf,z_=Mf,Y_=jf,K_=Gf,V_=cu,X_=uh.load,Z_=uh.loadAll,Q_=j_.dump,J_=Be,eS={binary:Vf,float:Uf,map:kf,null:qf,pairs:Zf,set:Qf,timestamp:Yf,bool:Hf,int:$f,merge:Kf,omap:Xf,seq:Nf,str:If},tS=pu("safeLoad","load"),rS=pu("safeLoadAll","loadAll"),iS=pu("safeDump","dump"),nS={Type:G_,Schema:W_,FAILSAFE_SCHEMA:z_,JSON_SCHEMA:Y_,CORE_SCHEMA:K_,DEFAULT_SCHEMA:V_,load:X_,loadAll:Z_,dump:Q_,YAMLException:J_,types:eS,safeLoad:tS,safeLoadAll:rS,safeDump:iS},yh=nS;var mm=K(om());var Ve={};sf(Ve,{bold:()=>lw,dimmed:()=>hw,error:()=>dm,grey:()=>pw,info:()=>cw,item:()=>dw,log:()=>Jt,turboBlue:()=>ti,turboGradient:()=>aw,turboLoader:()=>pm,turboRed:()=>fm,underline:()=>fw,warn:()=>Va,yellow:()=>hm});var Qt=K(require("chalk")),um=K(require("ora")),am=K(require("gradient-string")),cm="#0099F7",lm="#F11712",uw="#FFFF00",aw=(0,am.default)(cm,lm),ti=Qt.default.hex(cm),fm=Qt.default.hex(lm),hm=Qt.default.hex(uw),pm=t=>(0,um.default)({text:t,spinner:{frames:[" ",ti("> "),ti(">> "),ti(">>>")]}}),cw=(...t)=>{Jt(ti.bold(">>>"),...t)},lw=(...t)=>{Jt(Qt.default.bold(...t))},fw=(...t)=>{Jt(Qt.default.underline(...t))},hw=(...t)=>{Jt(Qt.default.dim(...t))},pw=(...t)=>{Jt(Qt.default.grey(...t))},dw=(...t)=>{Jt(ti.bold(" \u2022"),...t)},Jt=(...t)=>{console.log(...t)},Va=(...t)=>{console.error(hm.bold(">>>"),...t)},dm=(...t)=>{console.error(fm.bold(">>>"),...t)};var mw="turbo.json";var Xa={};function gw(t){try{if(Ki.default.existsSync(br.default.join(t,"pnpm-workspace.yaml")))return yh.load(Ki.default.readFileSync(br.default.join(t,"pnpm-workspace.yaml"),"utf8")).packages||[];let e=JSON.parse(Ki.default.readFileSync(br.default.join(t,"package.json"),"utf8"));if(e.workspaces){if("packages"in e.workspaces)return e.workspaces.packages||[];if(Array.isArray(e.workspaces))return e.workspaces}return[]}catch{return[]}}function Za(t,e){var s;let r=Jo(t,e),i=[],n=(s=e==null?void 0:e.cache)!=null?s:!0;if(n&&t&&t in Xa)return Xa[t];if(r){let u=gw(r).map(c=>`${c}/turbo.json`);(0,mm.sync)([mw,...u],{cwd:r,onlyFiles:!0,followSymbolicLinks:!1,suppressErrors:!0}).map(c=>br.default.join(r,c)).forEach(c=>{try{let l=Ki.default.readFileSync(c,"utf8"),f=Tn.parse(l),h=br.default.dirname(c)===r;if(h){if("extends"in f)return}else if(!("extends"in f))return;i.push({config:f,turboConfigPath:c,workspacePath:br.default.dirname(c),isRootConfig:h})}catch(l){Va(l)}})}return n&&t&&(Xa[t]=i),i}var lx=K(require("os")),fx=K(Q0());var hx=K(require("fs-extra"));var px=K(require("path")),dx=K(require("fs-extra")),mx=K(require("chalk"));var ZD=require("stream"),QD=require("util"),ZR=require("path"),QR=require("os"),JD=require("fs"),JR=K(XD());var uP=(0,QD.promisify)(ZD.Stream.pipeline);var ey=require("fs-extra");var cT=K(require("path")),lT=K(uy()),fT=K(require("chalk")),rf=require("fs-extra");var Po=K(require("chalk"));var st=K(require("chalk")),Pi=class{constructor(e){this.transform=e.transformer,this.dry=e.dry}_log(...e){console.log(...e)}modified(...e){this._log(st.default.green(" MODIFIED "),...e,this.dry?st.default.dim("(dry run)"):"")}unchanged(...e){this._log(st.default.gray(" UNCHANGED "),...e,this.dry?st.default.dim("(dry run)"):"")}skipped(...e){this._log(st.default.yellow(" SKIPPED "),...e,this.dry?st.default.dim("(dry run)"):"")}error(...e){this._log(st.default.red(" ERROR "),...e,this.dry?st.default.dim("(dry run)"):"")}info(...e){this._log(st.default.bold(" INFO "),...e,this.dry?st.default.dim("(dry run)"):"")}};var ay=K(require("os")),nf=K(require("path"));var To=K(require("chalk")),Bo=require("diff"),pr=require("fs-extra"),Oo=class{constructor(e){this.changes=[];if(this.filePath=e.filePath,this.rootPath=e.rootPath,this.after=e.after,this.error=e.error,e.before===void 0)try{nf.default.extname(e.filePath)===".json"?this.before=(0,pr.readJsonSync)(e.filePath):this.before=(0,pr.readFileSync)(e.filePath)}catch{this.before=""}else e.before===null?this.before="":this.before=e.before;e.after?typeof this.before=="object"||typeof e.after=="object"?this.changes=(0,Bo.diffJson)(this.before,e.after):this.changes=(0,Bo.diffLines)(this.before,e.after):this.changes=[]}fileName(){return nf.default.relative(this.rootPath,this.filePath)}write(){this.after&&(typeof this.after=="object"?(0,pr.writeJsonSync)(this.filePath,this.after,{spaces:2}):(0,pr.writeFileSync)(this.filePath,this.after))}additions(){return this.changes.filter(e=>e.added).length}deletions(){return this.changes.filter(e=>e.removed).length}hasChanges(){return this.additions()>0||this.deletions()>0}log(e){e.diff?(this.changes.forEach(r=>{r.added?process.stdout.write(To.default.green(r.value)):r.removed?process.stdout.write(To.default.red(r.value)):process.stdout.write(To.default.dim(r.value))}),Ve.log(ay.default.EOL)):Ve.log(this.after)}};var _n=class{constructor(e){this.modifications={};this.transform=e.transformer,this.rootPath=e.rootPath,this.dry=e.dry,this.print=e.print,this.logger=new Pi(e)}abortTransform(e){return this.logger.error(e.reason),{fatalError:new Error(e.reason),changes:e.changes||{}}}modifyFile(e){this.modifications[e.filePath]=new Oo({rootPath:this.rootPath,...e})}finish(){let e={changes:{}};return Object.keys(this.modifications).forEach(i=>{let n=this.modifications[i],s={action:"unchanged",additions:n.additions(),deletions:n.deletions()};if(n.hasChanges()){if(this.dry)s.action="skipped",this.logger.skipped(Po.default.dim(n.fileName()));else try{n.write(),s.action="modified",this.logger.modified(Po.default.bold(n.fileName()))}catch(o){let u="Unknown error";o instanceof Error&&(u=o.message),s.error=new Error(u),s.action="error",this.logger.error(n.fileName(),u)}this.print&&n.log({diff:!0})}else this.logger.unchanged(Po.default.dim(n.fileName()));e.changes[n.fileName()]=s}),Object.keys(e.changes).some(i=>e.changes[i].action==="error")?this.abortTransform({reason:"Encountered an error while transforming files",changes:e.changes}):e}static logResults(e){let r=Object.keys(e.changes);if(Ve.log(),r.length>0){Ve.bold("Results:");let i={};r.forEach(n=>{var o;let s=e.changes[n];i[n]={action:s.action,additions:s.additions,deletions:s.deletions,error:((o=s.error)==null?void 0:o.message)||"None"}}),console.table(i),Ve.log()}}};function cy({transformer:t,rootPath:e,options:r}){let i={transformer:t,rootPath:e,...r},n=new Pi(i),s=new _n(i);return{log:n,runner:s}}var hy="rename-pipeline",hT='Rename the "pipeline" key to "tasks" in `turbo.json`',pT="2.0.0-canary.0";function ly(t){let{pipeline:e,...r}=t;return{tasks:e,...r}}function py({root:t,options:e}){let{log:r,runner:i}=cy({transformer:hy,rootPath:t,options:e});r.info("Renaming `pipeline` key in turbo.json to `tasks`");let n=fy.default.join(t,"turbo.json");if(!(0,Lo.existsSync)(n))return i.abortTransform({reason:`No turbo.json found at ${t}. Is the path correct?`});let s=(0,Lo.readJsonSync)(n);return i.modifyFile({filePath:n,after:ly(s)}),Za(t).forEach(u=>{let{config:a,turboConfigPath:c}=u;"pipeline"in a&&i.modifyFile({filePath:c,after:ly(a)})}),i.finish()}var dT={name:hy,description:hT,introducedIn:pT,transformer:py},mT=dT;0&&(module.exports={transformer});
52
+ `:""}var U_=$_,j_={dump:U_};function pu(t,e){return function(){throw new Error("Function yaml."+t+" is removed in js-yaml 4. Use yaml."+e+" instead, which is now safe by default.")}}var G_=Ae,W_=Lf,z_=Mf,Y_=jf,K_=Gf,V_=cu,X_=uh.load,Z_=uh.loadAll,Q_=j_.dump,J_=Be,eS={binary:Vf,float:Uf,map:kf,null:qf,pairs:Zf,set:Qf,timestamp:Yf,bool:Hf,int:$f,merge:Kf,omap:Xf,seq:Nf,str:If},tS=pu("safeLoad","load"),rS=pu("safeLoadAll","loadAll"),iS=pu("safeDump","dump"),nS={Type:G_,Schema:W_,FAILSAFE_SCHEMA:z_,JSON_SCHEMA:Y_,CORE_SCHEMA:K_,DEFAULT_SCHEMA:V_,load:X_,loadAll:Z_,dump:Q_,YAMLException:J_,types:eS,safeLoad:tS,safeLoadAll:rS,safeDump:iS},yh=nS;var mm=K(om());var Ve={};sf(Ve,{bold:()=>lw,dimmed:()=>hw,error:()=>dm,grey:()=>pw,info:()=>cw,item:()=>dw,log:()=>Jt,turboBlue:()=>ti,turboGradient:()=>aw,turboLoader:()=>pm,turboRed:()=>fm,underline:()=>fw,warn:()=>Va,yellow:()=>hm});var Qt=K(require("chalk")),um=K(require("ora")),am=K(require("gradient-string")),cm="#0099F7",lm="#F11712",uw="#FFFF00",aw=(0,am.default)(cm,lm),ti=Qt.default.hex(cm),fm=Qt.default.hex(lm),hm=Qt.default.hex(uw),pm=t=>(0,um.default)({text:t,spinner:{frames:[" ",ti("> "),ti(">> "),ti(">>>")]}}),cw=(...t)=>{Jt(ti.bold(">>>"),...t)},lw=(...t)=>{Jt(Qt.default.bold(...t))},fw=(...t)=>{Jt(Qt.default.underline(...t))},hw=(...t)=>{Jt(Qt.default.dim(...t))},pw=(...t)=>{Jt(Qt.default.grey(...t))},dw=(...t)=>{Jt(ti.bold(" \u2022"),...t)},Jt=(...t)=>{console.log(...t)},Va=(...t)=>{console.error(hm.bold(">>>"),...t)},dm=(...t)=>{console.error(fm.bold(">>>"),...t)};var mw="turbo.json";var Xa={};function gw(t){try{if(Ki.default.existsSync(br.default.join(t,"pnpm-workspace.yaml")))return yh.load(Ki.default.readFileSync(br.default.join(t,"pnpm-workspace.yaml"),"utf8")).packages||[];let e=JSON.parse(Ki.default.readFileSync(br.default.join(t,"package.json"),"utf8"));if(e.workspaces){if("packages"in e.workspaces)return e.workspaces.packages||[];if(Array.isArray(e.workspaces))return e.workspaces}return[]}catch{return[]}}function Za(t,e){var s;let r=Jo(t,e),i=[],n=(s=e==null?void 0:e.cache)!=null?s:!0;if(n&&t&&t in Xa)return Xa[t];if(r){let u=gw(r).map(c=>`${c}/turbo.json`);(0,mm.sync)([mw,...u],{cwd:r,onlyFiles:!0,followSymbolicLinks:!1,suppressErrors:!0}).map(c=>br.default.join(r,c)).forEach(c=>{try{let l=Ki.default.readFileSync(c,"utf8"),f=Tn.parse(l),h=br.default.dirname(c)===r;if(h){if("extends"in f)return}else if(!("extends"in f))return;i.push({config:f,turboConfigPath:c,workspacePath:br.default.dirname(c),isRootConfig:h})}catch(l){Va(l)}})}return n&&t&&(Xa[t]=i),i}var lx=K(require("os")),fx=K(Q0());var hx=K(require("fs-extra"));var px=K(require("path")),dx=K(require("fs-extra")),mx=K(require("chalk"));var ZD=require("stream"),QD=require("util"),ZR=require("path"),QR=require("os"),JD=require("fs"),JR=K(XD());var uP=(0,QD.promisify)(ZD.Stream.pipeline);var ey=require("fs-extra");var cT=K(require("path")),lT=K(uy()),fT=K(require("chalk")),rf=require("fs-extra");var Po=K(require("chalk"));var st=K(require("chalk")),Pi=class{constructor(e){this.transform=e.transformer,this.dry=e.dry}_log(...e){console.log(...e)}modified(...e){this._log(st.default.green(" MODIFIED "),...e,this.dry?st.default.dim("(dry run)"):"")}unchanged(...e){this._log(st.default.gray(" UNCHANGED "),...e,this.dry?st.default.dim("(dry run)"):"")}skipped(...e){this._log(st.default.yellow(" SKIPPED "),...e,this.dry?st.default.dim("(dry run)"):"")}error(...e){this._log(st.default.red(" ERROR "),...e,this.dry?st.default.dim("(dry run)"):"")}info(...e){this._log(st.default.bold(" INFO "),...e,this.dry?st.default.dim("(dry run)"):"")}};var ay=K(require("os")),nf=K(require("path"));var To=K(require("chalk")),Bo=require("diff"),pr=require("fs-extra"),Oo=class{constructor(e){this.changes=[];if(this.filePath=e.filePath,this.rootPath=e.rootPath,this.after=e.after,this.error=e.error,e.before===void 0)try{nf.default.extname(e.filePath)===".json"?this.before=(0,pr.readJsonSync)(e.filePath):this.before=(0,pr.readFileSync)(e.filePath)}catch{this.before=""}else e.before===null?this.before="":this.before=e.before;e.after?typeof this.before=="object"||typeof e.after=="object"?this.changes=(0,Bo.diffJson)(this.before,e.after):this.changes=(0,Bo.diffLines)(this.before,e.after):this.changes=[]}fileName(){return nf.default.relative(this.rootPath,this.filePath)}write(){this.after&&(typeof this.after=="object"?(0,pr.writeJsonSync)(this.filePath,this.after,{spaces:2}):(0,pr.writeFileSync)(this.filePath,this.after))}additions(){return this.changes.filter(e=>e.added).length}deletions(){return this.changes.filter(e=>e.removed).length}hasChanges(){return this.additions()>0||this.deletions()>0}log(e){e.diff?(this.changes.forEach(r=>{r.added?process.stdout.write(To.default.green(r.value)):r.removed?process.stdout.write(To.default.red(r.value)):process.stdout.write(To.default.dim(r.value))}),Ve.log(ay.default.EOL)):Ve.log(this.after)}};var _n=class{constructor(e){this.modifications={};this.transform=e.transformer,this.rootPath=e.rootPath,this.dry=e.dry,this.print=e.print,this.logger=new Pi(e)}abortTransform(e){return this.logger.error(e.reason),{fatalError:new Error(e.reason),changes:e.changes||{}}}modifyFile(e){this.modifications[e.filePath]=new Oo({rootPath:this.rootPath,...e})}finish(){let e={changes:{}};return Object.keys(this.modifications).forEach(i=>{let n=this.modifications[i],s={action:"unchanged",additions:n.additions(),deletions:n.deletions()};if(n.hasChanges()){if(this.dry)s.action="skipped",this.logger.skipped(Po.default.dim(n.fileName()));else try{n.write(),s.action="modified",this.logger.modified(Po.default.bold(n.fileName()))}catch(o){let u="Unknown error";o instanceof Error&&(u=o.message),s.error=new Error(u),s.action="error",this.logger.error(n.fileName(),u)}this.print&&n.log({diff:!0})}else this.logger.unchanged(Po.default.dim(n.fileName()));e.changes[n.fileName()]=s}),Object.keys(e.changes).some(i=>e.changes[i].action==="error")?this.abortTransform({reason:"Encountered an error while transforming files",changes:e.changes}):e}static logResults(e){let r=Object.keys(e.changes);if(Ve.log(),r.length>0){Ve.bold("Results:");let i={};r.forEach(n=>{var o;let s=e.changes[n];i[n]={action:s.action,additions:s.additions,deletions:s.deletions,error:((o=s.error)==null?void 0:o.message)||"None"}}),console.table(i),Ve.log()}}};function cy({transformer:t,rootPath:e,options:r}){let i={transformer:t,rootPath:e,...r},n=new Pi(i),s=new _n(i);return{log:n,runner:s}}var hy="rename-pipeline",hT='Rename the "pipeline" key to "tasks" in `turbo.json`',pT="2.0.0-canary.0";function ly(t){let{pipeline:e,...r}=t;return{...r,tasks:e}}function py({root:t,options:e}){let{log:r,runner:i}=cy({transformer:hy,rootPath:t,options:e});r.info("Renaming `pipeline` key in turbo.json to `tasks`");let n=fy.default.join(t,"turbo.json");if(!(0,Lo.existsSync)(n))return i.abortTransform({reason:`No turbo.json found at ${t}. Is the path correct?`});let s=(0,Lo.readJsonSync)(n);return i.modifyFile({filePath:n,after:ly(s)}),Za(t).forEach(u=>{let{config:a,turboConfigPath:c}=u;"pipeline"in a&&i.modifyFile({filePath:c,after:ly(a)})}),i.finish()}var dT={name:hy,description:hT,introducedIn:pT,transformer:py},mT=dT;0&&(module.exports={transformer});
53
53
  /*! Bundled license information:
54
54
 
55
55
  @babel/runtime/helpers/regeneratorRuntime.js:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@turbo/codemod",
3
- "version": "2.0.0-canary.1",
3
+ "version": "2.0.0-canary.2",
4
4
  "description": "Provides Codemod transformations to help upgrade your Turborepo codebase when a feature is deprecated.",
5
5
  "homepage": "https://turbo.build/repo",
6
6
  "license": "MIT",
@@ -46,12 +46,12 @@
46
46
  "tsup": "^6.7.0",
47
47
  "typescript": "5.3.3",
48
48
  "@turbo/eslint-config": "0.0.0",
49
- "@turbo/gen": "2.0.0-canary.1",
49
+ "@turbo/gen": "2.0.0-canary.2",
50
50
  "@turbo/test-utils": "0.0.0",
51
- "@turbo/types": "2.0.0-canary.1",
52
- "@turbo/tsconfig": "0.0.0",
53
51
  "@turbo/utils": "0.0.0",
54
- "@turbo/workspaces": "2.0.0-canary.1"
52
+ "@turbo/types": "2.0.0-canary.2",
53
+ "@turbo/workspaces": "2.0.0-canary.2",
54
+ "@turbo/tsconfig": "0.0.0"
55
55
  },
56
56
  "files": [
57
57
  "dist"