@turbo/codemod 2.0.0-canary.3 → 2.0.0

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,14 +37,14 @@ ${i.message}`:y,k=[x,e,t].filter(Boolean).join(`
37
37
  `+t.slice(n,s),n=s+1),o=a;return l+=`
38
38
  `,t.length-n>e&&o>n?l+=t.slice(n,o)+`
39
39
  `+t.slice(o+1):l+=t.slice(n),l.slice(1)}function a0(t){for(var e="",r=0,i,n=0;n<t.length;r>=65536?n+=2:n++)r=fn(t,n),i=Le[r],!i&&gn(r)?(e+=t[n],r>=65536&&(e+=t[n+1])):e+=i||Jv(r);return e}function l0(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)),(Bt(t,e,a,!1,!1)||typeof a=="undefined"&&Bt(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,l;for(o=0,a=r.length;o<a;o+=1)l=r[o],t.replacer&&(l=t.replacer.call(r,String(o),l)),(Bt(t,e+1,l,!0,!0,!1,!0)||typeof l=="undefined"&&Bt(t,e+1,null,!0,!0,!1,!0))&&((!i||n!=="")&&(n+=Na(t,e)),t.dump&&dn===t.dump.charCodeAt(0)?n+="-":n+="- ",n+=t.dump);t.tag=s,t.dump=n||"[]"}function c0(t,e,r){var i="",n=t.tag,s=Object.keys(r),o,a,l,c,u;for(o=0,a=s.length;o<a;o+=1)u="",i!==""&&(u+=", "),t.condenseFlow&&(u+='"'),l=s[o],c=r[l],t.replacer&&(c=t.replacer.call(r,l,c)),Bt(t,e,l,!1,!1)&&(t.dump.length>1024&&(u+="? "),u+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),Bt(t,e,c,!1,!1)&&(u+=t.dump,i+=u));t.tag=n,t.dump="{"+i+"}"}function u0(t,e,r,i){var n="",s=t.tag,o=Object.keys(r),a,l,c,u,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,l=o.length;a<l;a+=1)h="",(!i||n!=="")&&(h+=Na(t,e)),c=o[a],u=r[c],t.replacer&&(u=t.replacer.call(r,c,u)),Bt(t,e+1,c,!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+=Na(t,e)),Bt(t,e+1,u,!0,f)&&(t.dump&&dn===t.dump.charCodeAt(0)?h+=":":h+=": ",h+=t.dump,n+=h));t.tag=s,t.dump=n||"{}"}function bf(t,e,r){var i,n,s,o,a,l;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(l=t.styleMap[a.tag]||a.defaultStyle,Vf.call(a.represent)==="[object Function]")i=a.represent(e,l);else if(Zf.call(a.represent,l))i=a.represent[l](e,l);else throw new He("!<"+a.tag+'> tag resolver accepts not "'+l+'" style');t.dump=i}return!0}return!1}function Bt(t,e,r,i,n,s,o){t.tag=null,t.dump=r,bf(t,r,!1)||bf(t,r,!0);var a=Vf.call(t.dump),l=i,c;i&&(i=t.flowLevel<0||t.flowLevel>e);var u=a==="[object Object]"||a==="[object Array]",f,h;if(u&&(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(u&&h&&!t.usedDuplicates[f]&&(t.usedDuplicates[f]=!0),a==="[object Object]")i&&Object.keys(t.dump).length!==0?(u0(t,e,t.dump,n),h&&(t.dump="&ref_"+f+t.dump)):(c0(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)):(l0(t,e,t.dump),h&&(t.dump="&ref_"+f+" "+t.dump));else if(a==="[object String]")t.tag!=="?"&&s0(t,t.dump,e,s,l);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!=="?"&&(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 h0(t,e){var r=[],i=[],n,s;for(Ma(t,r,i),n=0,s=i.length;n<s;n+=1)e.duplicates.push(r[i[n]]);e.usedDuplicates=new Array(s)}function Ma(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)Ma(t[n],e,r);else for(i=Object.keys(t),n=0,s=i.length;n<s;n+=1)Ma(t[i[n]],e,r)}function f0(t,e){e=e||{};var r=new e0(e);r.noRefs||h0(t,r);var i=t;return r.replacer&&(i=r.replacer.call({"":i},"",i)),Bt(r,0,i,!0,!0)?r.dump+`
40
- `:""}var p0=f0,d0={dump:p0};function Ua(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 m0=Ce,g0=Sf,y0=xf,b0=Cf,_0=Lf,w0=Ba,S0=Kf.load,E0=Kf.loadAll,v0=d0.dump,R0=He,x0={binary:Mf,float:kf,map:Rf,null:Af,pairs:Bf,set:jf,timestamp:Nf,bool:Of,int:Tf,merge:Df,omap:Ff,seq:vf,str:Ef},A0=Ua("safeLoad","load"),O0=Ua("safeLoadAll","loadAll"),T0=Ua("safeDump","dump"),k0={Type:m0,Schema:g0,FAILSAFE_SCHEMA:y0,JSON_SCHEMA:b0,CORE_SCHEMA:_0,DEFAULT_SCHEMA:w0,load:S0,loadAll:E0,dump:v0,YAMLException:R0,types:x0,safeLoad:A0,safeLoadAll:O0,safeDump:T0},qa=k0;var qO=X(Fs()),GO=X(require("json5"));var ne={};rE(ne,{bold:()=>DO,dimmed:()=>FO,error:()=>eg,grey:()=>BO,info:()=>NO,item:()=>jO,log:()=>pr,turboBlue:()=>Ei,turboGradient:()=>IO,turboLoader:()=>Jm,turboRed:()=>Zm,underline:()=>MO,warn:()=>Qm,yellow:()=>Xm});var fr=X(require("chalk")),Wm=X(require("ora")),Ym=X(require("gradient-string")),Km="#0099F7",Vm="#F11712",PO="#FFFF00",IO=(0,Ym.default)(Km,Vm),Ei=fr.default.hex(Km),Zm=fr.default.hex(Vm),Xm=fr.default.hex(PO),Jm=t=>(0,Wm.default)({text:t,spinner:{frames:[" ",Ei("> "),Ei(">> "),Ei(">>>")]}}),NO=(...t)=>{pr(Ei.bold(">>>"),...t)},DO=(...t)=>{pr(fr.default.bold(...t))},MO=(...t)=>{pr(fr.default.underline(...t))},FO=(...t)=>{pr(fr.default.dim(...t))},BO=(...t)=>{pr(fr.default.grey(...t))},jO=(...t)=>{pr(Ei.bold(" \u2022"),...t)},pr=(...t)=>{console.log(...t)},Qm=(...t)=>{console.error(Xm.bold(">>>"),...t)},eg=(...t)=>{console.error(Zm.bold(">>>"),...t)};var Fy=X(require("os")),By=X(Li());async function dr(t,e=[],r){let i={cwd:Fy.default.tmpdir(),env:{COREPACK_ENABLE_STRICT:"0"},...r};try{let{stdout:n}=await(0,By.default)(t,e,i);return n.trim()}catch{return}}async function Gc(){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 zc(){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 Bk=X(require("fs-extra"));var jk=X(require("path")),$k=X(require("fs-extra")),Hk=X(require("chalk"));var Fw=require("stream"),Bw=require("util"),vL=require("path"),RL=require("os"),jw=require("fs"),xL=X(Mw());var _F=(0,Bw.promisify)(Fw.Stream.pipeline);var $w=require("fs-extra");var DL=X(require("path")),ML=X(Yw()),FL=X(require("chalk")),Lh=require("fs-extra");var ZS=require("commander");var ia={name:"@turbo/codemod",version:"2.0.0-canary.3",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",json5:"^2.2.3","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=X(require("os")),zS=require("child_process"),$e=X(require("chalk")),WS=require("inquirer");var Cr=X(require("chalk"),1),lS=X(require("ora"),1),cS=X(require("gradient-string"),1);var MP=X(Li(),1),eB=require("fs-extra");var sB=X(Fs(),1),aB=require("fs-extra"),cB=require("fs-extra"),hB=require("chalk"),dS=require("stream"),mS=require("util"),mB=require("fs-extra"),_B=require("chalk"),SB=require("fs-extra"),ii=X(require("path"),1),Ue=require("fs-extra"),gS=X(Li(),1),yS=X(require("path"),1),bS=require("fs-extra"),_S=X(require("chalk"),1),rr=X(require("path"),1),wS=X(Li(),1),rt=require("fs-extra"),SS=X(Fs(),1);var Yn=X(require("path"),1),Pt=require("fs-extra"),nn=X(require("path"),1),It=require("fs-extra"),Kn=X(require("path"),1),Nt=require("fs-extra"),yI=X(require("chalk"),1),bI=X(require("gradient-string"),1),_I=X(Li(),1),wI=X(require("ora"),1),SI=require("semver"),EI=X(require("chalk"),1),jL=Object.create,Nh=Object.defineProperty,$L=Object.getOwnPropertyDescriptor,HL=Object.getOwnPropertyNames,UL=Object.getPrototypeOf,qL=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')}),GL=(t,e)=>()=>(t&&(e=t(t=0)),e),te=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),zL=(t,e)=>{for(var r in e)Nh(t,r,{get:e[r],enumerable:!0})},WL=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of HL(e))!qL.call(t,n)&&n!==r&&Nh(t,n,{get:()=>e[n],enumerable:!(i=$L(e,n))||i.enumerable});return t},oa=(t,e,r)=>(r=t!=null?jL(UL(t)):{},WL(e||!t||!t.__esModule?Nh(r,"default",{value:t,enumerable:!0}):r,t)),W=GL(()=>{}),YL=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}),KL=te((t,e)=>{W();var r=YL().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,l=Object.defineProperty||function(D,d,m){D[d]=m.value},c=typeof Symbol=="function"?Symbol:{},u=c.iterator||"@@iterator",f=c.asyncIterator||"@@asyncIterator",h=c.toStringTag||"@@toStringTag";function p(D,d,m){return Object.defineProperty(D,d,{value:m,enumerable:!0,configurable:!0,writable:!0}),D[d]}try{p({},"")}catch{p=function(D,d,m){return D[d]=m}}function g(D,d,m,_){var R=d&&d.prototype instanceof O?d:O,E=Object.create(R.prototype),M=new j(_||[]);return l(E,"_invoke",{value:V(D,m,M)}),E}function y(D,d,m){try{return{type:"normal",arg:D.call(d,m)}}catch(_){return{type:"throw",arg:_}}}s.wrap=g;var b="suspendedStart",x="suspendedYield",k="executing",C="completed",T={};function O(){}function I(){}function w(){}var v={};p(v,u,function(){return this});var F=Object.getPrototypeOf,H=F&&F(F(z([])));H&&H!==o&&a.call(H,u)&&(v=H);var P=w.prototype=O.prototype=Object.create(v);function q(D){["next","throw","return"].forEach(function(d){p(D,d,function(m){return this._invoke(d,m)})})}function K(D,d){function m(R,E,M,B){var Z=y(D[R],D,E);if(Z.type!=="throw"){var U=Z.arg,Q=U.value;return Q&&r(Q)=="object"&&a.call(Q,"__await")?d.resolve(Q.__await).then(function(G){m("next",G,M,B)},function(G){m("throw",G,M,B)}):d.resolve(Q).then(function(G){U.value=G,M(U)},function(G){return m("throw",G,M,B)})}B(Z.arg)}var _;l(this,"_invoke",{value:function(R,E){function M(){return new d(function(B,Z){m(R,E,B,Z)})}return _=_?_.then(M,M):M()}})}function V(D,d,m){var _=b;return function(R,E){if(_===k)throw new Error("Generator is already running");if(_===C){if(R==="throw")throw E;return{value:n,done:!0}}for(m.method=R,m.arg=E;;){var M=m.delegate;if(M){var B=N(M,m);if(B){if(B===T)continue;return B}}if(m.method==="next")m.sent=m._sent=m.arg;else if(m.method==="throw"){if(_===b)throw _=C,m.arg;m.dispatchException(m.arg)}else m.method==="return"&&m.abrupt("return",m.arg);_=k;var Z=y(D,d,m);if(Z.type==="normal"){if(_=m.done?C:x,Z.arg===T)continue;return{value:Z.arg,done:m.done}}Z.type==="throw"&&(_=C,m.method="throw",m.arg=Z.arg)}}}function N(D,d){var m=d.method,_=D.iterator[m];if(_===n)return d.delegate=null,m==="throw"&&D.iterator.return&&(d.method="return",d.arg=n,N(D,d),d.method==="throw")||m!=="return"&&(d.method="throw",d.arg=new TypeError("The iterator does not provide a '"+m+"' method")),T;var R=y(_,D.iterator,d.arg);if(R.type==="throw")return d.method="throw",d.arg=R.arg,d.delegate=null,T;var E=R.arg;return E?E.done?(d[D.resultName]=E.value,d.next=D.nextLoc,d.method!=="return"&&(d.method="next",d.arg=n),d.delegate=null,T):E:(d.method="throw",d.arg=new TypeError("iterator result is not an object"),d.delegate=null,T)}function A(D){var d={tryLoc:D[0]};1 in D&&(d.catchLoc=D[1]),2 in D&&(d.finallyLoc=D[2],d.afterLoc=D[3]),this.tryEntries.push(d)}function L(D){var d=D.completion||{};d.type="normal",delete d.arg,D.completion=d}function j(D){this.tryEntries=[{tryLoc:"root"}],D.forEach(A,this),this.reset(!0)}function z(D){if(D||D===""){var d=D[u];if(d)return d.call(D);if(typeof D.next=="function")return D;if(!isNaN(D.length)){var m=-1,_=function R(){for(;++m<D.length;)if(a.call(D,m))return R.value=D[m],R.done=!1,R;return R.value=n,R.done=!0,R};return _.next=_}}throw new TypeError(r(D)+" is not iterable")}return I.prototype=w,l(P,"constructor",{value:w,configurable:!0}),l(w,"constructor",{value:I,configurable:!0}),I.displayName=p(w,h,"GeneratorFunction"),s.isGeneratorFunction=function(D){var d=typeof D=="function"&&D.constructor;return!!d&&(d===I||(d.displayName||d.name)==="GeneratorFunction")},s.mark=function(D){return Object.setPrototypeOf?Object.setPrototypeOf(D,w):(D.__proto__=w,p(D,h,"GeneratorFunction")),D.prototype=Object.create(P),D},s.awrap=function(D){return{__await:D}},q(K.prototype),p(K.prototype,f,function(){return this}),s.AsyncIterator=K,s.async=function(D,d,m,_,R){R===void 0&&(R=Promise);var E=new K(g(D,d,m,_),R);return s.isGeneratorFunction(d)?E:E.next().then(function(M){return M.done?M.value:E.next()})},q(P),p(P,h,"Generator"),p(P,u,function(){return this}),p(P,"toString",function(){return"[object Generator]"}),s.keys=function(D){var d=Object(D),m=[];for(var _ in d)m.push(_);return m.reverse(),function R(){for(;m.length;){var E=m.pop();if(E in d)return R.value=E,R.done=!1,R}return R.done=!0,R}},s.values=z,j.prototype={constructor:j,reset:function(D){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(L),!D)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 D=this.tryEntries[0].completion;if(D.type==="throw")throw D.arg;return this.rval},dispatchException:function(D){if(this.done)throw D;var d=this;function m(Z,U){return E.type="throw",E.arg=D,d.next=Z,U&&(d.method="next",d.arg=n),!!U}for(var _=this.tryEntries.length-1;_>=0;--_){var R=this.tryEntries[_],E=R.completion;if(R.tryLoc==="root")return m("end");if(R.tryLoc<=this.prev){var M=a.call(R,"catchLoc"),B=a.call(R,"finallyLoc");if(M&&B){if(this.prev<R.catchLoc)return m(R.catchLoc,!0);if(this.prev<R.finallyLoc)return m(R.finallyLoc)}else if(M){if(this.prev<R.catchLoc)return m(R.catchLoc,!0)}else{if(!B)throw new Error("try statement without catch or finally");if(this.prev<R.finallyLoc)return m(R.finallyLoc)}}}},abrupt:function(D,d){for(var m=this.tryEntries.length-1;m>=0;--m){var _=this.tryEntries[m];if(_.tryLoc<=this.prev&&a.call(_,"finallyLoc")&&this.prev<_.finallyLoc){var R=_;break}}R&&(D==="break"||D==="continue")&&R.tryLoc<=d&&d<=R.finallyLoc&&(R=null);var E=R?R.completion:{};return E.type=D,E.arg=d,R?(this.method="next",this.next=R.finallyLoc,T):this.complete(E)},complete:function(D,d){if(D.type==="throw")throw D.arg;return D.type==="break"||D.type==="continue"?this.next=D.arg:D.type==="return"?(this.rval=this.arg=D.arg,this.method="return",this.next="end"):D.type==="normal"&&d&&(this.next=d),T},finish:function(D){for(var d=this.tryEntries.length-1;d>=0;--d){var m=this.tryEntries[d];if(m.finallyLoc===D)return this.complete(m.completion,m.afterLoc),L(m),T}},catch:function(D){for(var d=this.tryEntries.length-1;d>=0;--d){var m=this.tryEntries[d];if(m.tryLoc===D){var _=m.completion;if(_.type==="throw"){var R=_.arg;L(m)}return R}}throw new Error("illegal catch attempt")},delegateYield:function(D,d,m){return this.delegate={iterator:z(D),resultName:d,nextLoc:m},this.method==="next"&&(this.arg=n),T}},s}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports}),VL=te((t,e)=>{W();var r=KL()();e.exports=r;try{regeneratorRuntime=r}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}}),ZL=te((t,e)=>{"use strict";W();var r=(i,...n)=>new Promise(s=>{s(i(...n))});e.exports=r,e.exports.default=r}),XL=te((t,e)=>{"use strict";W();var r=ZL(),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()()},l=(f,h,...p)=>{o++;let g=r(f,...p);h(g),g.then(a,a)},c=(f,h,...p)=>{o<n?l(f,h,...p):s.push(l.bind(null,f,h,...p))},u=(f,...h)=>new Promise(p=>c(f,p,...h));return Object.defineProperties(u,{activeCount:{get:()=>o},pendingCount:{get:()=>s.length},clearQueue:{value:()=>{s.length=0}}}),u};e.exports=i,e.exports.default=i}),JL=te((t,e)=>{"use strict";W();var r=XL(),i=class extends Error{constructor(a){super(),this.value=a}},n=async(a,l)=>l(await a),s=async a=>{let l=await Promise.all(a);if(l[1]===!0)throw new i(l[0]);return!1},o=async(a,l,c)=>{c={concurrency:1/0,preserveOrder:!0,...c};let u=r(c.concurrency),f=[...a].map(p=>[p,u(n,p,l)]),h=r(c.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}),QL=te((t,e)=>{"use strict";W();var r=re("path"),i=re("fs"),{promisify:n}=re("util"),s=JL(),o=n(i.stat),a=n(i.lstat),l={directory:"isDirectory",file:"isFile"};function c({type:f}){if(!(f in l))throw new Error(`Invalid type specified: ${f}`)}var u=(f,h)=>f===void 0||h[l[f]]();e.exports=async(f,h)=>{h={cwd:process.cwd(),type:"file",allowSymlinks:!0,...h},c(h);let p=h.allowSymlinks?o:a;return s(f,async g=>{try{let y=await p(r.resolve(h.cwd,g));return u(h.type,y)}catch{return!1}},h)},e.exports.sync=(f,h)=>{h={cwd:process.cwd(),allowSymlinks:!0,type:"file",...h},c(h);let p=h.allowSymlinks?i.statSync:i.lstatSync;for(let g of f)try{let y=p(r.resolve(h.cwd,g));if(u(h.type,y))return g}catch{}}}),eP=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}}}),tP=te((t,e)=>{"use strict";W();var r=re("path"),i=QL(),n=eP(),s=Symbol("findUp.stop");e.exports=async(o,a={})=>{let l=r.resolve(a.cwd||""),{root:c}=r.parse(l),u=[].concat(o),f=async h=>{if(typeof o!="function")return i(u,h);let p=await o(h.cwd);return typeof p=="string"?i([p],h):p};for(;;){let h=await f({...a,cwd:l});if(h===s)return;if(h)return r.resolve(l,h);if(l===c)return;l=r.dirname(l)}},e.exports.sync=(o,a={})=>{let l=r.resolve(a.cwd||""),{root:c}=r.parse(l),u=[].concat(o),f=h=>{if(typeof o!="function")return i.sync(u,h);let p=o(h.cwd);return typeof p=="string"?i.sync([p],h):p};for(;;){let h=f({...a,cwd:l});if(h===s)return;if(h)return r.resolve(l,h);if(l===c)return;l=r.dirname(l)}},e.exports.exists=n,e.exports.sync.exists=n.sync,e.exports.stop=s}),Vn=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)):{}}),Dh=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"),l=Symbol("emittedEnd"),c=Symbol("emittingEnd"),u=Symbol("emittedError"),f=Symbol("closed"),h=Symbol("read"),p=Symbol("flush"),g=Symbol("flushChunk"),y=Symbol("encoding"),b=Symbol("decoder"),x=Symbol("flowing"),k=Symbol("paused"),C=Symbol("resume"),T=Symbol("buffer"),O=Symbol("pipes"),I=Symbol("bufferLength"),w=Symbol("bufferPush"),v=Symbol("bufferShift"),F=Symbol("objectMode"),H=Symbol("destroyed"),P=Symbol("emitData"),q=Symbol("emitEnd"),K=Symbol("emitEnd2"),V=Symbol("async"),N=R=>Promise.resolve().then(R),A=global._MP_NO_ITERATOR_SYMBOLS_!=="1",L=A&&Symbol.asyncIterator||Symbol("asyncIterator not implemented"),j=A&&Symbol.iterator||Symbol("iterator not implemented"),z=R=>R==="end"||R==="finish"||R==="prefinish",D=R=>R instanceof ArrayBuffer||typeof R=="object"&&R.constructor&&R.constructor.name==="ArrayBuffer"&&R.byteLength>=0,d=R=>!Buffer.isBuffer(R)&&ArrayBuffer.isView(R),m=class{constructor(R,E,M){this.src=R,this.dest=E,this.opts=M,this.ondrain=()=>R[C](),E.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},_=class extends m{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(R,E,M){super(R,E,M),this.proxyErrors=B=>E.emit("error",B),R.on("error",this.proxyErrors)}};e.exports=class Vw extends n{constructor(E){super(),this[x]=!1,this[k]=!1,this[O]=[],this[T]=[],this[F]=E&&E.objectMode||!1,this[F]?this[y]=null:this[y]=E&&E.encoding||null,this[y]==="buffer"&&(this[y]=null),this[V]=E&&!!E.async||!1,this[b]=this[y]?new s(this[y]):null,this[o]=!1,this[l]=!1,this[c]=!1,this[f]=!1,this[u]=null,this.writable=!0,this.readable=!0,this[I]=0,this[H]=!1,E&&E.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[T]}),E&&E.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[O]})}get bufferLength(){return this[I]}get encoding(){return this[y]}set encoding(E){if(this[F])throw new Error("cannot set encoding in objectMode");if(this[y]&&E!==this[y]&&(this[b]&&this[b].lastNeed||this[I]))throw new Error("cannot change encoding");this[y]!==E&&(this[b]=E?new s(E):null,this[T].length&&(this[T]=this[T].map(M=>this[b].write(M)))),this[y]=E}setEncoding(E){this.encoding=E}get objectMode(){return this[F]}set objectMode(E){this[F]=this[F]||!!E}get async(){return this[V]}set async(E){this[V]=this[V]||!!E}write(E,M,B){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 M=="function"&&(B=M,M="utf8"),M||(M="utf8");let Z=this[V]?N:U=>U();return!this[F]&&!Buffer.isBuffer(E)&&(d(E)?E=Buffer.from(E.buffer,E.byteOffset,E.byteLength):D(E)?E=Buffer.from(E):typeof E!="string"&&(this.objectMode=!0)),this[F]?(this.flowing&&this[I]!==0&&this[p](!0),this.flowing?this.emit("data",E):this[w](E),this[I]!==0&&this.emit("readable"),B&&Z(B),this.flowing):E.length?(typeof E=="string"&&!(M===this[y]&&!this[b].lastNeed)&&(E=Buffer.from(E,M)),Buffer.isBuffer(E)&&this[y]&&(E=this[b].write(E)),this.flowing&&this[I]!==0&&this[p](!0),this.flowing?this.emit("data",E):this[w](E),this[I]!==0&&this.emit("readable"),B&&Z(B),this.flowing):(this[I]!==0&&this.emit("readable"),B&&Z(B),this.flowing)}read(E){if(this[H])return null;if(this[I]===0||E===0||E>this[I])return this[a](),null;this[F]&&(E=null),this[T].length>1&&!this[F]&&(this.encoding?this[T]=[this[T].join("")]:this[T]=[Buffer.concat(this[T],this[I])]);let M=this[h](E||null,this[T][0]);return this[a](),M}[h](E,M){return E===M.length||E===null?this[v]():(this[T][0]=M.slice(E),M=M.slice(0,E),this[I]-=E),this.emit("data",M),!this[T].length&&!this[o]&&this.emit("drain"),M}end(E,M,B){return typeof E=="function"&&(B=E,E=null),typeof M=="function"&&(B=M,M="utf8"),E&&this.write(E,M),B&&this.once("end",B),this[o]=!0,this.writable=!1,(this.flowing||!this[k])&&this[a](),this}[C](){this[H]||(this[k]=!1,this[x]=!0,this.emit("resume"),this[T].length?this[p]():this[o]?this[a]():this.emit("drain"))}resume(){return this[C]()}pause(){this[x]=!1,this[k]=!0}get destroyed(){return this[H]}get flowing(){return this[x]}get paused(){return this[k]}[w](E){this[F]?this[I]+=1:this[I]+=E.length,this[T].push(E)}[v](){return this[T].length&&(this[F]?this[I]-=1:this[I]-=this[T][0].length),this[T].shift()}[p](E){do;while(this[g](this[v]()));!E&&!this[T].length&&!this[o]&&this.emit("drain")}[g](E){return E?(this.emit("data",E),this.flowing):!1}pipe(E,M){if(this[H])return;let B=this[l];return M=M||{},E===r.stdout||E===r.stderr?M.end=!1:M.end=M.end!==!1,M.proxyErrors=!!M.proxyErrors,B?M.end&&E.end():(this[O].push(M.proxyErrors?new _(this,E,M):new m(this,E,M)),this[V]?N(()=>this[C]()):this[C]()),E}unpipe(E){let M=this[O].find(B=>B.dest===E);M&&(this[O].splice(this[O].indexOf(M),1),M.unpipe())}addListener(E,M){return this.on(E,M)}on(E,M){let B=super.on(E,M);return E==="data"&&!this[O].length&&!this.flowing?this[C]():E==="readable"&&this[I]!==0?super.emit("readable"):z(E)&&this[l]?(super.emit(E),this.removeAllListeners(E)):E==="error"&&this[u]&&(this[V]?N(()=>M.call(this,this[u])):M.call(this,this[u])),B}get emittedEnd(){return this[l]}[a](){!this[c]&&!this[l]&&!this[H]&&this[T].length===0&&this[o]&&(this[c]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[f]&&this.emit("close"),this[c]=!1)}emit(E,M,...B){if(E!=="error"&&E!=="close"&&E!==H&&this[H])return;if(E==="data")return M?this[V]?N(()=>this[P](M)):this[P](M):!1;if(E==="end")return this[q]();if(E==="close"){if(this[f]=!0,!this[l]&&!this[H])return;let U=super.emit("close");return this.removeAllListeners("close"),U}else if(E==="error"){this[u]=M;let U=super.emit("error",M);return this[a](),U}else if(E==="resume"){let U=super.emit("resume");return this[a](),U}else if(E==="finish"||E==="prefinish"){let U=super.emit(E);return this.removeAllListeners(E),U}let Z=super.emit(E,M,...B);return this[a](),Z}[P](E){for(let B of this[O])B.dest.write(E)===!1&&this.pause();let M=super.emit("data",E);return this[a](),M}[q](){this[l]||(this[l]=!0,this.readable=!1,this[V]?N(()=>this[K]()):this[K]())}[K](){if(this[b]){let M=this[b].end();if(M){for(let B of this[O])B.dest.write(M);super.emit("data",M)}}for(let M of this[O])M.end();let E=super.emit("end");return this.removeAllListeners("end"),E}collect(){let E=[];this[F]||(E.dataLength=0);let M=this.promise();return this.on("data",B=>{E.push(B),this[F]||(E.dataLength+=B.length)}),M.then(()=>E)}concat(){return this[F]?Promise.reject(new Error("cannot concat in objectMode")):this.collect().then(E=>this[F]?Promise.reject(new Error("cannot concat in objectMode")):this[y]?E.join(""):Buffer.concat(E,E.dataLength))}promise(){return new Promise((E,M)=>{this.on(H,()=>M(new Error("stream destroyed"))),this.on("error",B=>M(B)),this.on("end",()=>E())})}[L](){return{next:()=>{let E=this.read();if(E!==null)return Promise.resolve({done:!1,value:E});if(this[o])return Promise.resolve({done:!0});let M=null,B=null,Z=ie=>{this.removeListener("data",U),this.removeListener("end",Q),B(ie)},U=ie=>{this.removeListener("error",Z),this.removeListener("end",Q),this.pause(),M({value:ie,done:!!this[o]})},Q=()=>{this.removeListener("error",Z),this.removeListener("data",U),M({done:!0})},G=()=>Z(new Error("stream destroyed"));return new Promise((ie,ue)=>{B=ue,M=ie,this.once(H,G),this.once("error",Z),this.once("end",Q),this.once("data",U)})}}}[j](){return{next:()=>{let E=this.read();return{value:E,done:E===null}}}}destroy(E){return this[H]?(E?this.emit("error",E):this.emit(H),this):(this[H]=!0,this[T].length=0,this[I]=0,typeof this.close=="function"&&!this[f]&&this.close(),E?this.emit("error",E):this.emit(H),this)}static isStream(E){return!!E&&(E instanceof Vw||E instanceof n||E instanceof i&&(typeof E.pipe=="function"||typeof E.write=="function"&&typeof E.end=="function"))}}}),rP=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))}),Zw=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"),l=Symbol("emittedEnd"),c=Symbol("emittingEnd"),u=Symbol("emittedError"),f=Symbol("closed"),h=Symbol("read"),p=Symbol("flush"),g=Symbol("flushChunk"),y=Symbol("encoding"),b=Symbol("decoder"),x=Symbol("flowing"),k=Symbol("paused"),C=Symbol("resume"),T=Symbol("bufferLength"),O=Symbol("bufferPush"),I=Symbol("bufferShift"),w=Symbol("objectMode"),v=Symbol("destroyed"),F=Symbol("emitData"),H=Symbol("emitEnd"),P=Symbol("emitEnd2"),q=Symbol("async"),K=m=>Promise.resolve().then(m),V=global._MP_NO_ITERATOR_SYMBOLS_!=="1",N=V&&Symbol.asyncIterator||Symbol("asyncIterator not implemented"),A=V&&Symbol.iterator||Symbol("iterator not implemented"),L=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),D=class{constructor(m,_,R){this.src=m,this.dest=_,this.opts=R,this.ondrain=()=>m[C](),_.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},d=class extends D{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(m,_,R){super(m,_,R),this.proxyErrors=E=>_.emit("error",E),m.on("error",this.proxyErrors)}};e.exports=class Xw extends n{constructor(_){super(),this[x]=!1,this[k]=!1,this.pipes=[],this.buffer=[],this[w]=_&&_.objectMode||!1,this[w]?this[y]=null:this[y]=_&&_.encoding||null,this[y]==="buffer"&&(this[y]=null),this[q]=_&&!!_.async||!1,this[b]=this[y]?new s(this[y]):null,this[o]=!1,this[l]=!1,this[c]=!1,this[f]=!1,this[u]=null,this.writable=!0,this.readable=!0,this[T]=0,this[v]=!1}get bufferLength(){return this[T]}get encoding(){return this[y]}set encoding(_){if(this[w])throw new Error("cannot set encoding in objectMode");if(this[y]&&_!==this[y]&&(this[b]&&this[b].lastNeed||this[T]))throw new Error("cannot change encoding");this[y]!==_&&(this[b]=_?new s(_):null,this.buffer.length&&(this.buffer=this.buffer.map(R=>this[b].write(R)))),this[y]=_}setEncoding(_){this.encoding=_}get objectMode(){return this[w]}set objectMode(_){this[w]=this[w]||!!_}get async(){return this[q]}set async(_){this[q]=this[q]||!!_}write(_,R,E){if(this[o])throw new Error("write after end");if(this[v])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof R=="function"&&(E=R,R="utf8"),R||(R="utf8");let M=this[q]?K:B=>B();return!this[w]&&!Buffer.isBuffer(_)&&(z(_)?_=Buffer.from(_.buffer,_.byteOffset,_.byteLength):j(_)?_=Buffer.from(_):typeof _!="string"&&(this.objectMode=!0)),this[w]?(this.flowing&&this[T]!==0&&this[p](!0),this.flowing?this.emit("data",_):this[O](_),this[T]!==0&&this.emit("readable"),E&&M(E),this.flowing):_.length?(typeof _=="string"&&!(R===this[y]&&!this[b].lastNeed)&&(_=Buffer.from(_,R)),Buffer.isBuffer(_)&&this[y]&&(_=this[b].write(_)),this.flowing&&this[T]!==0&&this[p](!0),this.flowing?this.emit("data",_):this[O](_),this[T]!==0&&this.emit("readable"),E&&M(E),this.flowing):(this[T]!==0&&this.emit("readable"),E&&M(E),this.flowing)}read(_){if(this[v])return null;if(this[T]===0||_===0||_>this[T])return this[a](),null;this[w]&&(_=null),this.buffer.length>1&&!this[w]&&(this.encoding?this.buffer=[this.buffer.join("")]:this.buffer=[Buffer.concat(this.buffer,this[T])]);let R=this[h](_||null,this.buffer[0]);return this[a](),R}[h](_,R){return _===R.length||_===null?this[I]():(this.buffer[0]=R.slice(_),R=R.slice(0,_),this[T]-=_),this.emit("data",R),!this.buffer.length&&!this[o]&&this.emit("drain"),R}end(_,R,E){return typeof _=="function"&&(E=_,_=null),typeof R=="function"&&(E=R,R="utf8"),_&&this.write(_,R),E&&this.once("end",E),this[o]=!0,this.writable=!1,(this.flowing||!this[k])&&this[a](),this}[C](){this[v]||(this[k]=!1,this[x]=!0,this.emit("resume"),this.buffer.length?this[p]():this[o]?this[a]():this.emit("drain"))}resume(){return this[C]()}pause(){this[x]=!1,this[k]=!0}get destroyed(){return this[v]}get flowing(){return this[x]}get paused(){return this[k]}[O](_){this[w]?this[T]+=1:this[T]+=_.length,this.buffer.push(_)}[I](){return this.buffer.length&&(this[w]?this[T]-=1:this[T]-=this.buffer[0].length),this.buffer.shift()}[p](_){do;while(this[g](this[I]()));!_&&!this.buffer.length&&!this[o]&&this.emit("drain")}[g](_){return _?(this.emit("data",_),this.flowing):!1}pipe(_,R){if(this[v])return;let E=this[l];return R=R||{},_===r.stdout||_===r.stderr?R.end=!1:R.end=R.end!==!1,R.proxyErrors=!!R.proxyErrors,E?R.end&&_.end():(this.pipes.push(R.proxyErrors?new d(this,_,R):new D(this,_,R)),this[q]?K(()=>this[C]()):this[C]()),_}unpipe(_){let R=this.pipes.find(E=>E.dest===_);R&&(this.pipes.splice(this.pipes.indexOf(R),1),R.unpipe())}addListener(_,R){return this.on(_,R)}on(_,R){let E=super.on(_,R);return _==="data"&&!this.pipes.length&&!this.flowing?this[C]():_==="readable"&&this[T]!==0?super.emit("readable"):L(_)&&this[l]?(super.emit(_),this.removeAllListeners(_)):_==="error"&&this[u]&&(this[q]?K(()=>R.call(this,this[u])):R.call(this,this[u])),E}get emittedEnd(){return this[l]}[a](){!this[c]&&!this[l]&&!this[v]&&this.buffer.length===0&&this[o]&&(this[c]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[f]&&this.emit("close"),this[c]=!1)}emit(_,R,...E){if(_!=="error"&&_!=="close"&&_!==v&&this[v])return;if(_==="data")return R?this[q]?K(()=>this[F](R)):this[F](R):!1;if(_==="end")return this[H]();if(_==="close"){if(this[f]=!0,!this[l]&&!this[v])return;let B=super.emit("close");return this.removeAllListeners("close"),B}else if(_==="error"){this[u]=R;let B=super.emit("error",R);return this[a](),B}else if(_==="resume"){let B=super.emit("resume");return this[a](),B}else if(_==="finish"||_==="prefinish"){let B=super.emit(_);return this.removeAllListeners(_),B}let M=super.emit(_,R,...E);return this[a](),M}[F](_){for(let E of this.pipes)E.dest.write(_)===!1&&this.pause();let R=super.emit("data",_);return this[a](),R}[H](){this[l]||(this[l]=!0,this.readable=!1,this[q]?K(()=>this[P]()):this[P]())}[P](){if(this[b]){let R=this[b].end();if(R){for(let E of this.pipes)E.dest.write(R);super.emit("data",R)}}for(let R of this.pipes)R.end();let _=super.emit("end");return this.removeAllListeners("end"),_}collect(){let _=[];this[w]||(_.dataLength=0);let R=this.promise();return this.on("data",E=>{_.push(E),this[w]||(_.dataLength+=E.length)}),R.then(()=>_)}concat(){return this[w]?Promise.reject(new Error("cannot concat in objectMode")):this.collect().then(_=>this[w]?Promise.reject(new Error("cannot concat in objectMode")):this[y]?_.join(""):Buffer.concat(_,_.dataLength))}promise(){return new Promise((_,R)=>{this.on(v,()=>R(new Error("stream destroyed"))),this.on("error",E=>R(E)),this.on("end",()=>_())})}[N](){return{next:()=>{let _=this.read();if(_!==null)return Promise.resolve({done:!1,value:_});if(this[o])return Promise.resolve({done:!0});let R=null,E=null,M=Q=>{this.removeListener("data",B),this.removeListener("end",Z),E(Q)},B=Q=>{this.removeListener("error",M),this.removeListener("end",Z),this.pause(),R({value:Q,done:!!this[o]})},Z=()=>{this.removeListener("error",M),this.removeListener("data",B),R({done:!0})},U=()=>M(new Error("stream destroyed"));return new Promise((Q,G)=>{E=G,R=Q,this.once(v,U),this.once("error",M),this.once("end",Z),this.once("data",B)})}}}[A](){return{next:()=>{let _=this.read();return{value:_,done:_===null}}}}destroy(_){return this[v]?(_?this.emit("error",_):this.emit(v),this):(this[v]=!0,this.buffer.length=0,this[T]=0,typeof this.close=="function"&&!this[f]&&this.close(),_?this.emit("error",_):this.emit(v),this)}static isStream(_){return!!_&&(_ instanceof Xw||_ instanceof n||_ instanceof i&&(typeof _.pipe=="function"||typeof _.write=="function"&&typeof _.end=="function"))}}}),Jw=te(t=>{"use strict";W();var e=re("assert"),r=re("buffer").Buffer,i=re("zlib"),n=t.constants=rP(),s=Zw(),o=r.concat,a=Symbol("_superWrite"),l=class extends Error{constructor(L){super("zlib: "+L.message),this.code=L.code,this.errno=L.errno,this.code||(this.code="ZLIB_ERROR"),this.message="zlib: "+L.message,Error.captureStackTrace(this,this.constructor)}get name(){return"ZlibError"}},c=Symbol("opts"),u=Symbol("flushFlag"),f=Symbol("finishFlushFlag"),h=Symbol("fullFlushFlag"),p=Symbol("handle"),g=Symbol("onError"),y=Symbol("sawError"),b=Symbol("level"),x=Symbol("strategy"),k=Symbol("ended"),C=Symbol("_defaultFullFlush"),T=class extends s{constructor(L,j){if(!L||typeof L!="object")throw new TypeError("invalid options for ZlibBase constructor");super(L),this[y]=!1,this[k]=!1,this[c]=L,this[u]=L.flush,this[f]=L.finishFlush;try{this[p]=new i[j](L)}catch(z){throw new l(z)}this[g]=z=>{this[y]||(this[y]=!0,this.close(),this.emit("error",z))},this[p].on("error",z=>this[g](new l(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(L){this.ended||(typeof L!="number"&&(L=this[h]),this.write(Object.assign(r.alloc(0),{[u]:L})))}end(L,j,z){return L&&this.write(L,j),this.flush(this[f]),this[k]=!0,super.end(null,null,z)}get ended(){return this[k]}write(L,j,z){if(typeof j=="function"&&(z=j,j="utf8"),typeof L=="string"&&(L=r.from(L,j)),this[y])return;e(this[p],"zlib binding closed");let D=this[p]._handle,d=D.close;D.close=()=>{};let m=this[p].close;this[p].close=()=>{},r.concat=E=>E;let _;try{let E=typeof L[u]=="number"?L[u]:this[u];_=this[p]._processChunk(L,E),r.concat=o}catch(E){r.concat=o,this[g](new l(E))}finally{this[p]&&(this[p]._handle=D,D.close=d,this[p].close=m,this[p].removeAllListeners("error"))}this[p]&&this[p].on("error",E=>this[g](new l(E)));let R;if(_)if(Array.isArray(_)&&_.length>0){R=this[a](r.from(_[0]));for(let E=1;E<_.length;E++)R=this[a](_[E])}else R=this[a](r.from(_));return z&&z(),R}[a](L){return super.write(L)}},O=class extends T{constructor(L,j){L=L||{},L.flush=L.flush||n.Z_NO_FLUSH,L.finishFlush=L.finishFlush||n.Z_FINISH,super(L,j),this[h]=n.Z_FULL_FLUSH,this[b]=L.level,this[x]=L.strategy}params(L,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[b]!==L||this[x]!==j){this.flush(n.Z_SYNC_FLUSH),e(this[p],"zlib binding closed");let z=this[p].flush;this[p].flush=(D,d)=>{this.flush(D),d()};try{this[p].params(L,j)}finally{this[p].flush=z}this[p]&&(this[b]=L,this[x]=j)}}}},I=class extends O{constructor(L){super(L,"Deflate")}},w=class extends O{constructor(L){super(L,"Inflate")}},v=Symbol("_portable"),F=class extends O{constructor(L){super(L,"Gzip"),this[v]=L&&!!L.portable}[a](L){return this[v]?(this[v]=!1,L[9]=255,super[a](L)):super[a](L)}},H=class extends O{constructor(L){super(L,"Gunzip")}},P=class extends O{constructor(L){super(L,"DeflateRaw")}},q=class extends O{constructor(L){super(L,"InflateRaw")}},K=class extends O{constructor(L){super(L,"Unzip")}},V=class extends T{constructor(L,j){L=L||{},L.flush=L.flush||n.BROTLI_OPERATION_PROCESS,L.finishFlush=L.finishFlush||n.BROTLI_OPERATION_FINISH,super(L,j),this[h]=n.BROTLI_OPERATION_FLUSH}},N=class extends V{constructor(L){super(L,"BrotliCompress")}},A=class extends V{constructor(L){super(L,"BrotliDecompress")}};t.Deflate=I,t.Inflate=w,t.Gzip=F,t.Gunzip=H,t.DeflateRaw=P,t.InflateRaw=q,t.Unzip=K,typeof i.BrotliCompress=="function"?(t.BrotliCompress=N,t.BrotliDecompress=A):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,"/")}),Mh=te((t,e)=>{"use strict";W();var r=Dh(),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,l=this.blockRemain;return this.remain=Math.max(0,a-o),this.blockRemain=Math.max(0,l-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])}}}),Qw=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]]))}),iP=te((t,e)=>{"use strict";W();var r=(u,f)=>{if(Number.isSafeInteger(u))u<0?n(u,f):i(u,f);else throw Error("cannot encode number outside of javascript safe integer range");return f},i=(u,f)=>{f[0]=128;for(var h=f.length;h>1;h--)f[h-1]=u&255,u=Math.floor(u/256)},n=(u,f)=>{f[0]=255;var h=!1;u=u*-1;for(var p=f.length;p>1;p--){var g=u&255;u=Math.floor(u/256),h?f[p-1]=l(g):g===0?f[p-1]=0:(h=!0,f[p-1]=c(g))}},s=u=>{let f=u[0],h=f===128?a(u.slice(1,u.length)):f===255?o(u):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=u=>{for(var f=u.length,h=0,p=!1,g=f-1;g>-1;g--){var y=u[g],b;p?b=l(y):y===0?b=y:(p=!0,b=c(y)),b!==0&&(h-=b*Math.pow(256,f-g-1))}return h},a=u=>{for(var f=u.length,h=0,p=f-1;p>-1;p--){var g=u[p];g!==0&&(h+=g*Math.pow(256,f-p-1))}return h},l=u=>(255^u)&255,c=u=>(255^u)+1&255;e.exports={encode:r,parse:s}}),Xn=te((t,e)=>{"use strict";W();var r=Qw(),i=re("path").posix,n=iP(),s=Symbol("slurp"),o=Symbol("type"),a=class{constructor(w,v,F,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(w)?this.decode(w,v||0,F,H):w&&this.set(w)}decode(w,v,F,H){if(v||(v=0),!w||!(w.length>=v+512))throw new Error("need 512 bytes for header");if(this.path=c(w,v,100),this.mode=h(w,v+100,8),this.uid=h(w,v+108,8),this.gid=h(w,v+116,8),this.size=h(w,v+124,12),this.mtime=u(w,v+136,12),this.cksum=h(w,v+148,12),this[s](F),this[s](H,!0),this[o]=c(w,v+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=c(w,v+157,100),w.slice(v+257,v+265).toString()==="ustar\x0000")if(this.uname=c(w,v+265,32),this.gname=c(w,v+297,32),this.devmaj=h(w,v+329,8),this.devmin=h(w,v+337,8),w[v+475]!==0){let q=c(w,v+345,155);this.path=q+"/"+this.path}else{let q=c(w,v+345,130);q&&(this.path=q+"/"+this.path),this.atime=u(w,v+476,12),this.ctime=u(w,v+488,12)}let P=8*32;for(let q=v;q<v+148;q++)P+=w[q];for(let q=v+156;q<v+512;q++)P+=w[q];this.cksumValid=P===this.cksum,this.cksum===null&&P===8*32&&(this.nullBlock=!0)}[s](w,v){for(let F in w)w[F]!==null&&w[F]!==void 0&&!(v&&F==="path")&&(this[F]=w[F])}encode(w,v){if(w||(w=this.block=Buffer.alloc(512),v=0),v||(v=0),!(w.length>=v+512))throw new Error("need 512 bytes for header");let F=this.ctime||this.atime?130:155,H=l(this.path||"",F),P=H[0],q=H[1];this.needPax=H[2],this.needPax=I(w,v,100,P)||this.needPax,this.needPax=b(w,v+100,8,this.mode)||this.needPax,this.needPax=b(w,v+108,8,this.uid)||this.needPax,this.needPax=b(w,v+116,8,this.gid)||this.needPax,this.needPax=b(w,v+124,12,this.size)||this.needPax,this.needPax=T(w,v+136,12,this.mtime)||this.needPax,w[v+156]=this[o].charCodeAt(0),this.needPax=I(w,v+157,100,this.linkpath)||this.needPax,w.write("ustar\x0000",v+257,8),this.needPax=I(w,v+265,32,this.uname)||this.needPax,this.needPax=I(w,v+297,32,this.gname)||this.needPax,this.needPax=b(w,v+329,8,this.devmaj)||this.needPax,this.needPax=b(w,v+337,8,this.devmin)||this.needPax,this.needPax=I(w,v+345,F,q)||this.needPax,w[v+475]!==0?this.needPax=I(w,v+345,155,q)||this.needPax:(this.needPax=I(w,v+345,130,q)||this.needPax,this.needPax=T(w,v+476,12,this.atime)||this.needPax,this.needPax=T(w,v+488,12,this.ctime)||this.needPax);let K=8*32;for(let V=v;V<v+148;V++)K+=w[V];for(let V=v+156;V<v+512;V++)K+=w[V];return this.cksum=K,b(w,v+148,8,this.cksum),this.cksumValid=!0,this.needPax}set(w){for(let v in w)w[v]!==null&&w[v]!==void 0&&(this[v]=w[v])}get type(){return r.name.get(this[o])||this[o]}get typeKey(){return this[o]}set type(w){r.code.has(w)?this[o]=r.code.get(w):this[o]=w}},l=(w,v)=>{let F=w,H="",P,q=i.parse(w).root||".";if(Buffer.byteLength(F)<100)P=[F,H,!1];else{H=i.dirname(F),F=i.basename(F);do Buffer.byteLength(F)<=100&&Buffer.byteLength(H)<=v?P=[F,H,!1]:Buffer.byteLength(F)>100&&Buffer.byteLength(H)<=v?P=[F.slice(0,100-1),H,!0]:(F=i.join(i.basename(H),F),H=i.dirname(H));while(H!==q&&!P);P||(P=[w.slice(0,100-1),"",!0])}return P},c=(w,v,F)=>w.slice(v,v+F).toString("utf8").replace(/\0.*/,""),u=(w,v,F)=>f(h(w,v,F)),f=w=>w===null?null:new Date(w*1e3),h=(w,v,F)=>w[v]&128?n.parse(w.slice(v,v+F)):g(w,v,F),p=w=>isNaN(w)?null:w,g=(w,v,F)=>p(parseInt(w.slice(v,v+F).toString("utf8").replace(/\0.*$/,"").trim(),8)),y={12:8589934591,8:2097151},b=(w,v,F,H)=>H===null?!1:H>y[F]||H<0?(n.encode(H,w.slice(v,v+F)),!0):(x(w,v,F,H),!1),x=(w,v,F,H)=>w.write(k(H,F),v,F,"ascii"),k=(w,v)=>C(Math.floor(w).toString(8),v),C=(w,v)=>(w.length===v-1?w:new Array(v-w.length-1).join("0")+w+" ")+"\0",T=(w,v,F,H)=>H===null?!1:b(w,v,F,H.getTime()/1e3),O=new Array(156).join("\0"),I=(w,v,F,H)=>H===null?!1:(w.write(H+O,v,F,"utf8"),H.length!==Buffer.byteLength(H)||H.length>F);e.exports=a}),Fh=te((t,e)=>{"use strict";W();var r=Xn(),i=re("path"),n=class{constructor(l,c){this.atime=l.atime||null,this.charset=l.charset||null,this.comment=l.comment||null,this.ctime=l.ctime||null,this.gid=l.gid||null,this.gname=l.gname||null,this.linkpath=l.linkpath||null,this.mtime=l.mtime||null,this.path=l.path||null,this.size=l.size||null,this.uid=l.uid||null,this.uname=l.uname||null,this.dev=l.dev||null,this.ino=l.ino||null,this.nlink=l.nlink||null,this.global=c||!1}encode(){let l=this.encodeBody();if(l==="")return null;let c=Buffer.byteLength(l),u=512*Math.ceil(1+c/512),f=Buffer.allocUnsafe(u);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:c,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(l,512,c,"utf8");for(let h=c+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(l){if(this[l]===null||this[l]===void 0)return"";let c=this[l]instanceof Date?this[l].getTime()/1e3:this[l],u=" "+(l==="dev"||l==="ino"||l==="nlink"?"SCHILY.":"")+l+"="+c+`
40
+ `:""}var p0=f0,d0={dump:p0};function Ua(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 m0=Ce,g0=Sf,y0=xf,b0=Cf,_0=Lf,w0=Ba,S0=Kf.load,E0=Kf.loadAll,v0=d0.dump,R0=He,x0={binary:Mf,float:kf,map:Rf,null:Af,pairs:Bf,set:jf,timestamp:Nf,bool:Of,int:Tf,merge:Df,omap:Ff,seq:vf,str:Ef},A0=Ua("safeLoad","load"),O0=Ua("safeLoadAll","loadAll"),T0=Ua("safeDump","dump"),k0={Type:m0,Schema:g0,FAILSAFE_SCHEMA:y0,JSON_SCHEMA:b0,CORE_SCHEMA:_0,DEFAULT_SCHEMA:w0,load:S0,loadAll:E0,dump:v0,YAMLException:R0,types:x0,safeLoad:A0,safeLoadAll:O0,safeDump:T0},qa=k0;var qO=X(Fs()),GO=X(require("json5"));var ne={};rE(ne,{bold:()=>DO,dimmed:()=>FO,error:()=>eg,grey:()=>BO,info:()=>NO,item:()=>jO,log:()=>pr,turboBlue:()=>Ei,turboGradient:()=>IO,turboLoader:()=>Jm,turboRed:()=>Zm,underline:()=>MO,warn:()=>Qm,yellow:()=>Xm});var fr=X(require("chalk")),Wm=X(require("ora")),Ym=X(require("gradient-string")),Km="#0099F7",Vm="#F11712",PO="#FFFF00",IO=(0,Ym.default)(Km,Vm),Ei=fr.default.hex(Km),Zm=fr.default.hex(Vm),Xm=fr.default.hex(PO),Jm=t=>(0,Wm.default)({text:t,spinner:{frames:[" ",Ei("> "),Ei(">> "),Ei(">>>")]}}),NO=(...t)=>{pr(Ei.bold(">>>"),...t)},DO=(...t)=>{pr(fr.default.bold(...t))},MO=(...t)=>{pr(fr.default.underline(...t))},FO=(...t)=>{pr(fr.default.dim(...t))},BO=(...t)=>{pr(fr.default.grey(...t))},jO=(...t)=>{pr(Ei.bold(" \u2022"),...t)},pr=(...t)=>{console.log(...t)},Qm=(...t)=>{console.error(Xm.bold(">>>"),...t)},eg=(...t)=>{console.error(Zm.bold(">>>"),...t)};var Fy=X(require("os")),By=X(Li());async function dr(t,e=[],r){let i={cwd:Fy.default.tmpdir(),env:{COREPACK_ENABLE_STRICT:"0"},...r};try{let{stdout:n}=await(0,By.default)(t,e,i);return n.trim()}catch{return}}async function Gc(){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 zc(){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 Bk=X(require("fs-extra"));var jk=X(require("path")),$k=X(require("fs-extra")),Hk=X(require("chalk"));var Fw=require("stream"),Bw=require("util"),vL=require("path"),RL=require("os"),jw=require("fs"),xL=X(Mw());var _F=(0,Bw.promisify)(Fw.Stream.pipeline);var $w=require("fs-extra");var DL=X(require("path")),ML=X(Yw()),FL=X(require("chalk")),Lh=require("fs-extra");var ZS=require("commander");var ia={name:"@turbo/codemod",version:"2.0.0",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",json5:"^2.2.3","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=X(require("os")),zS=require("child_process"),$e=X(require("chalk")),WS=require("inquirer");var Cr=X(require("chalk"),1),lS=X(require("ora"),1),cS=X(require("gradient-string"),1);var MP=X(Li(),1),eB=require("fs-extra");var sB=X(Fs(),1),aB=require("fs-extra"),cB=require("fs-extra"),hB=require("chalk"),dS=require("stream"),mS=require("util"),mB=require("fs-extra"),_B=require("chalk"),SB=require("fs-extra"),ii=X(require("path"),1),Ue=require("fs-extra"),gS=X(Li(),1),yS=X(require("path"),1),bS=require("fs-extra"),_S=X(require("chalk"),1),rr=X(require("path"),1),wS=X(Li(),1),rt=require("fs-extra"),SS=X(Fs(),1);var Yn=X(require("path"),1),Pt=require("fs-extra"),nn=X(require("path"),1),It=require("fs-extra"),Kn=X(require("path"),1),Nt=require("fs-extra"),yI=X(require("chalk"),1),bI=X(require("gradient-string"),1),_I=X(Li(),1),wI=X(require("ora"),1),SI=require("semver"),EI=X(require("chalk"),1),jL=Object.create,Nh=Object.defineProperty,$L=Object.getOwnPropertyDescriptor,HL=Object.getOwnPropertyNames,UL=Object.getPrototypeOf,qL=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')}),GL=(t,e)=>()=>(t&&(e=t(t=0)),e),te=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),zL=(t,e)=>{for(var r in e)Nh(t,r,{get:e[r],enumerable:!0})},WL=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of HL(e))!qL.call(t,n)&&n!==r&&Nh(t,n,{get:()=>e[n],enumerable:!(i=$L(e,n))||i.enumerable});return t},oa=(t,e,r)=>(r=t!=null?jL(UL(t)):{},WL(e||!t||!t.__esModule?Nh(r,"default",{value:t,enumerable:!0}):r,t)),W=GL(()=>{}),YL=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}),KL=te((t,e)=>{W();var r=YL().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,l=Object.defineProperty||function(D,d,m){D[d]=m.value},c=typeof Symbol=="function"?Symbol:{},u=c.iterator||"@@iterator",f=c.asyncIterator||"@@asyncIterator",h=c.toStringTag||"@@toStringTag";function p(D,d,m){return Object.defineProperty(D,d,{value:m,enumerable:!0,configurable:!0,writable:!0}),D[d]}try{p({},"")}catch{p=function(D,d,m){return D[d]=m}}function g(D,d,m,_){var R=d&&d.prototype instanceof O?d:O,E=Object.create(R.prototype),M=new j(_||[]);return l(E,"_invoke",{value:V(D,m,M)}),E}function y(D,d,m){try{return{type:"normal",arg:D.call(d,m)}}catch(_){return{type:"throw",arg:_}}}s.wrap=g;var b="suspendedStart",x="suspendedYield",k="executing",C="completed",T={};function O(){}function I(){}function w(){}var v={};p(v,u,function(){return this});var F=Object.getPrototypeOf,H=F&&F(F(z([])));H&&H!==o&&a.call(H,u)&&(v=H);var P=w.prototype=O.prototype=Object.create(v);function q(D){["next","throw","return"].forEach(function(d){p(D,d,function(m){return this._invoke(d,m)})})}function K(D,d){function m(R,E,M,B){var Z=y(D[R],D,E);if(Z.type!=="throw"){var U=Z.arg,Q=U.value;return Q&&r(Q)=="object"&&a.call(Q,"__await")?d.resolve(Q.__await).then(function(G){m("next",G,M,B)},function(G){m("throw",G,M,B)}):d.resolve(Q).then(function(G){U.value=G,M(U)},function(G){return m("throw",G,M,B)})}B(Z.arg)}var _;l(this,"_invoke",{value:function(R,E){function M(){return new d(function(B,Z){m(R,E,B,Z)})}return _=_?_.then(M,M):M()}})}function V(D,d,m){var _=b;return function(R,E){if(_===k)throw new Error("Generator is already running");if(_===C){if(R==="throw")throw E;return{value:n,done:!0}}for(m.method=R,m.arg=E;;){var M=m.delegate;if(M){var B=N(M,m);if(B){if(B===T)continue;return B}}if(m.method==="next")m.sent=m._sent=m.arg;else if(m.method==="throw"){if(_===b)throw _=C,m.arg;m.dispatchException(m.arg)}else m.method==="return"&&m.abrupt("return",m.arg);_=k;var Z=y(D,d,m);if(Z.type==="normal"){if(_=m.done?C:x,Z.arg===T)continue;return{value:Z.arg,done:m.done}}Z.type==="throw"&&(_=C,m.method="throw",m.arg=Z.arg)}}}function N(D,d){var m=d.method,_=D.iterator[m];if(_===n)return d.delegate=null,m==="throw"&&D.iterator.return&&(d.method="return",d.arg=n,N(D,d),d.method==="throw")||m!=="return"&&(d.method="throw",d.arg=new TypeError("The iterator does not provide a '"+m+"' method")),T;var R=y(_,D.iterator,d.arg);if(R.type==="throw")return d.method="throw",d.arg=R.arg,d.delegate=null,T;var E=R.arg;return E?E.done?(d[D.resultName]=E.value,d.next=D.nextLoc,d.method!=="return"&&(d.method="next",d.arg=n),d.delegate=null,T):E:(d.method="throw",d.arg=new TypeError("iterator result is not an object"),d.delegate=null,T)}function A(D){var d={tryLoc:D[0]};1 in D&&(d.catchLoc=D[1]),2 in D&&(d.finallyLoc=D[2],d.afterLoc=D[3]),this.tryEntries.push(d)}function L(D){var d=D.completion||{};d.type="normal",delete d.arg,D.completion=d}function j(D){this.tryEntries=[{tryLoc:"root"}],D.forEach(A,this),this.reset(!0)}function z(D){if(D||D===""){var d=D[u];if(d)return d.call(D);if(typeof D.next=="function")return D;if(!isNaN(D.length)){var m=-1,_=function R(){for(;++m<D.length;)if(a.call(D,m))return R.value=D[m],R.done=!1,R;return R.value=n,R.done=!0,R};return _.next=_}}throw new TypeError(r(D)+" is not iterable")}return I.prototype=w,l(P,"constructor",{value:w,configurable:!0}),l(w,"constructor",{value:I,configurable:!0}),I.displayName=p(w,h,"GeneratorFunction"),s.isGeneratorFunction=function(D){var d=typeof D=="function"&&D.constructor;return!!d&&(d===I||(d.displayName||d.name)==="GeneratorFunction")},s.mark=function(D){return Object.setPrototypeOf?Object.setPrototypeOf(D,w):(D.__proto__=w,p(D,h,"GeneratorFunction")),D.prototype=Object.create(P),D},s.awrap=function(D){return{__await:D}},q(K.prototype),p(K.prototype,f,function(){return this}),s.AsyncIterator=K,s.async=function(D,d,m,_,R){R===void 0&&(R=Promise);var E=new K(g(D,d,m,_),R);return s.isGeneratorFunction(d)?E:E.next().then(function(M){return M.done?M.value:E.next()})},q(P),p(P,h,"Generator"),p(P,u,function(){return this}),p(P,"toString",function(){return"[object Generator]"}),s.keys=function(D){var d=Object(D),m=[];for(var _ in d)m.push(_);return m.reverse(),function R(){for(;m.length;){var E=m.pop();if(E in d)return R.value=E,R.done=!1,R}return R.done=!0,R}},s.values=z,j.prototype={constructor:j,reset:function(D){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(L),!D)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 D=this.tryEntries[0].completion;if(D.type==="throw")throw D.arg;return this.rval},dispatchException:function(D){if(this.done)throw D;var d=this;function m(Z,U){return E.type="throw",E.arg=D,d.next=Z,U&&(d.method="next",d.arg=n),!!U}for(var _=this.tryEntries.length-1;_>=0;--_){var R=this.tryEntries[_],E=R.completion;if(R.tryLoc==="root")return m("end");if(R.tryLoc<=this.prev){var M=a.call(R,"catchLoc"),B=a.call(R,"finallyLoc");if(M&&B){if(this.prev<R.catchLoc)return m(R.catchLoc,!0);if(this.prev<R.finallyLoc)return m(R.finallyLoc)}else if(M){if(this.prev<R.catchLoc)return m(R.catchLoc,!0)}else{if(!B)throw new Error("try statement without catch or finally");if(this.prev<R.finallyLoc)return m(R.finallyLoc)}}}},abrupt:function(D,d){for(var m=this.tryEntries.length-1;m>=0;--m){var _=this.tryEntries[m];if(_.tryLoc<=this.prev&&a.call(_,"finallyLoc")&&this.prev<_.finallyLoc){var R=_;break}}R&&(D==="break"||D==="continue")&&R.tryLoc<=d&&d<=R.finallyLoc&&(R=null);var E=R?R.completion:{};return E.type=D,E.arg=d,R?(this.method="next",this.next=R.finallyLoc,T):this.complete(E)},complete:function(D,d){if(D.type==="throw")throw D.arg;return D.type==="break"||D.type==="continue"?this.next=D.arg:D.type==="return"?(this.rval=this.arg=D.arg,this.method="return",this.next="end"):D.type==="normal"&&d&&(this.next=d),T},finish:function(D){for(var d=this.tryEntries.length-1;d>=0;--d){var m=this.tryEntries[d];if(m.finallyLoc===D)return this.complete(m.completion,m.afterLoc),L(m),T}},catch:function(D){for(var d=this.tryEntries.length-1;d>=0;--d){var m=this.tryEntries[d];if(m.tryLoc===D){var _=m.completion;if(_.type==="throw"){var R=_.arg;L(m)}return R}}throw new Error("illegal catch attempt")},delegateYield:function(D,d,m){return this.delegate={iterator:z(D),resultName:d,nextLoc:m},this.method==="next"&&(this.arg=n),T}},s}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports}),VL=te((t,e)=>{W();var r=KL()();e.exports=r;try{regeneratorRuntime=r}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}}),ZL=te((t,e)=>{"use strict";W();var r=(i,...n)=>new Promise(s=>{s(i(...n))});e.exports=r,e.exports.default=r}),XL=te((t,e)=>{"use strict";W();var r=ZL(),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()()},l=(f,h,...p)=>{o++;let g=r(f,...p);h(g),g.then(a,a)},c=(f,h,...p)=>{o<n?l(f,h,...p):s.push(l.bind(null,f,h,...p))},u=(f,...h)=>new Promise(p=>c(f,p,...h));return Object.defineProperties(u,{activeCount:{get:()=>o},pendingCount:{get:()=>s.length},clearQueue:{value:()=>{s.length=0}}}),u};e.exports=i,e.exports.default=i}),JL=te((t,e)=>{"use strict";W();var r=XL(),i=class extends Error{constructor(a){super(),this.value=a}},n=async(a,l)=>l(await a),s=async a=>{let l=await Promise.all(a);if(l[1]===!0)throw new i(l[0]);return!1},o=async(a,l,c)=>{c={concurrency:1/0,preserveOrder:!0,...c};let u=r(c.concurrency),f=[...a].map(p=>[p,u(n,p,l)]),h=r(c.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}),QL=te((t,e)=>{"use strict";W();var r=re("path"),i=re("fs"),{promisify:n}=re("util"),s=JL(),o=n(i.stat),a=n(i.lstat),l={directory:"isDirectory",file:"isFile"};function c({type:f}){if(!(f in l))throw new Error(`Invalid type specified: ${f}`)}var u=(f,h)=>f===void 0||h[l[f]]();e.exports=async(f,h)=>{h={cwd:process.cwd(),type:"file",allowSymlinks:!0,...h},c(h);let p=h.allowSymlinks?o:a;return s(f,async g=>{try{let y=await p(r.resolve(h.cwd,g));return u(h.type,y)}catch{return!1}},h)},e.exports.sync=(f,h)=>{h={cwd:process.cwd(),allowSymlinks:!0,type:"file",...h},c(h);let p=h.allowSymlinks?i.statSync:i.lstatSync;for(let g of f)try{let y=p(r.resolve(h.cwd,g));if(u(h.type,y))return g}catch{}}}),eP=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}}}),tP=te((t,e)=>{"use strict";W();var r=re("path"),i=QL(),n=eP(),s=Symbol("findUp.stop");e.exports=async(o,a={})=>{let l=r.resolve(a.cwd||""),{root:c}=r.parse(l),u=[].concat(o),f=async h=>{if(typeof o!="function")return i(u,h);let p=await o(h.cwd);return typeof p=="string"?i([p],h):p};for(;;){let h=await f({...a,cwd:l});if(h===s)return;if(h)return r.resolve(l,h);if(l===c)return;l=r.dirname(l)}},e.exports.sync=(o,a={})=>{let l=r.resolve(a.cwd||""),{root:c}=r.parse(l),u=[].concat(o),f=h=>{if(typeof o!="function")return i.sync(u,h);let p=o(h.cwd);return typeof p=="string"?i.sync([p],h):p};for(;;){let h=f({...a,cwd:l});if(h===s)return;if(h)return r.resolve(l,h);if(l===c)return;l=r.dirname(l)}},e.exports.exists=n,e.exports.sync.exists=n.sync,e.exports.stop=s}),Vn=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)):{}}),Dh=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"),l=Symbol("emittedEnd"),c=Symbol("emittingEnd"),u=Symbol("emittedError"),f=Symbol("closed"),h=Symbol("read"),p=Symbol("flush"),g=Symbol("flushChunk"),y=Symbol("encoding"),b=Symbol("decoder"),x=Symbol("flowing"),k=Symbol("paused"),C=Symbol("resume"),T=Symbol("buffer"),O=Symbol("pipes"),I=Symbol("bufferLength"),w=Symbol("bufferPush"),v=Symbol("bufferShift"),F=Symbol("objectMode"),H=Symbol("destroyed"),P=Symbol("emitData"),q=Symbol("emitEnd"),K=Symbol("emitEnd2"),V=Symbol("async"),N=R=>Promise.resolve().then(R),A=global._MP_NO_ITERATOR_SYMBOLS_!=="1",L=A&&Symbol.asyncIterator||Symbol("asyncIterator not implemented"),j=A&&Symbol.iterator||Symbol("iterator not implemented"),z=R=>R==="end"||R==="finish"||R==="prefinish",D=R=>R instanceof ArrayBuffer||typeof R=="object"&&R.constructor&&R.constructor.name==="ArrayBuffer"&&R.byteLength>=0,d=R=>!Buffer.isBuffer(R)&&ArrayBuffer.isView(R),m=class{constructor(R,E,M){this.src=R,this.dest=E,this.opts=M,this.ondrain=()=>R[C](),E.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},_=class extends m{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(R,E,M){super(R,E,M),this.proxyErrors=B=>E.emit("error",B),R.on("error",this.proxyErrors)}};e.exports=class Vw extends n{constructor(E){super(),this[x]=!1,this[k]=!1,this[O]=[],this[T]=[],this[F]=E&&E.objectMode||!1,this[F]?this[y]=null:this[y]=E&&E.encoding||null,this[y]==="buffer"&&(this[y]=null),this[V]=E&&!!E.async||!1,this[b]=this[y]?new s(this[y]):null,this[o]=!1,this[l]=!1,this[c]=!1,this[f]=!1,this[u]=null,this.writable=!0,this.readable=!0,this[I]=0,this[H]=!1,E&&E.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[T]}),E&&E.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[O]})}get bufferLength(){return this[I]}get encoding(){return this[y]}set encoding(E){if(this[F])throw new Error("cannot set encoding in objectMode");if(this[y]&&E!==this[y]&&(this[b]&&this[b].lastNeed||this[I]))throw new Error("cannot change encoding");this[y]!==E&&(this[b]=E?new s(E):null,this[T].length&&(this[T]=this[T].map(M=>this[b].write(M)))),this[y]=E}setEncoding(E){this.encoding=E}get objectMode(){return this[F]}set objectMode(E){this[F]=this[F]||!!E}get async(){return this[V]}set async(E){this[V]=this[V]||!!E}write(E,M,B){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 M=="function"&&(B=M,M="utf8"),M||(M="utf8");let Z=this[V]?N:U=>U();return!this[F]&&!Buffer.isBuffer(E)&&(d(E)?E=Buffer.from(E.buffer,E.byteOffset,E.byteLength):D(E)?E=Buffer.from(E):typeof E!="string"&&(this.objectMode=!0)),this[F]?(this.flowing&&this[I]!==0&&this[p](!0),this.flowing?this.emit("data",E):this[w](E),this[I]!==0&&this.emit("readable"),B&&Z(B),this.flowing):E.length?(typeof E=="string"&&!(M===this[y]&&!this[b].lastNeed)&&(E=Buffer.from(E,M)),Buffer.isBuffer(E)&&this[y]&&(E=this[b].write(E)),this.flowing&&this[I]!==0&&this[p](!0),this.flowing?this.emit("data",E):this[w](E),this[I]!==0&&this.emit("readable"),B&&Z(B),this.flowing):(this[I]!==0&&this.emit("readable"),B&&Z(B),this.flowing)}read(E){if(this[H])return null;if(this[I]===0||E===0||E>this[I])return this[a](),null;this[F]&&(E=null),this[T].length>1&&!this[F]&&(this.encoding?this[T]=[this[T].join("")]:this[T]=[Buffer.concat(this[T],this[I])]);let M=this[h](E||null,this[T][0]);return this[a](),M}[h](E,M){return E===M.length||E===null?this[v]():(this[T][0]=M.slice(E),M=M.slice(0,E),this[I]-=E),this.emit("data",M),!this[T].length&&!this[o]&&this.emit("drain"),M}end(E,M,B){return typeof E=="function"&&(B=E,E=null),typeof M=="function"&&(B=M,M="utf8"),E&&this.write(E,M),B&&this.once("end",B),this[o]=!0,this.writable=!1,(this.flowing||!this[k])&&this[a](),this}[C](){this[H]||(this[k]=!1,this[x]=!0,this.emit("resume"),this[T].length?this[p]():this[o]?this[a]():this.emit("drain"))}resume(){return this[C]()}pause(){this[x]=!1,this[k]=!0}get destroyed(){return this[H]}get flowing(){return this[x]}get paused(){return this[k]}[w](E){this[F]?this[I]+=1:this[I]+=E.length,this[T].push(E)}[v](){return this[T].length&&(this[F]?this[I]-=1:this[I]-=this[T][0].length),this[T].shift()}[p](E){do;while(this[g](this[v]()));!E&&!this[T].length&&!this[o]&&this.emit("drain")}[g](E){return E?(this.emit("data",E),this.flowing):!1}pipe(E,M){if(this[H])return;let B=this[l];return M=M||{},E===r.stdout||E===r.stderr?M.end=!1:M.end=M.end!==!1,M.proxyErrors=!!M.proxyErrors,B?M.end&&E.end():(this[O].push(M.proxyErrors?new _(this,E,M):new m(this,E,M)),this[V]?N(()=>this[C]()):this[C]()),E}unpipe(E){let M=this[O].find(B=>B.dest===E);M&&(this[O].splice(this[O].indexOf(M),1),M.unpipe())}addListener(E,M){return this.on(E,M)}on(E,M){let B=super.on(E,M);return E==="data"&&!this[O].length&&!this.flowing?this[C]():E==="readable"&&this[I]!==0?super.emit("readable"):z(E)&&this[l]?(super.emit(E),this.removeAllListeners(E)):E==="error"&&this[u]&&(this[V]?N(()=>M.call(this,this[u])):M.call(this,this[u])),B}get emittedEnd(){return this[l]}[a](){!this[c]&&!this[l]&&!this[H]&&this[T].length===0&&this[o]&&(this[c]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[f]&&this.emit("close"),this[c]=!1)}emit(E,M,...B){if(E!=="error"&&E!=="close"&&E!==H&&this[H])return;if(E==="data")return M?this[V]?N(()=>this[P](M)):this[P](M):!1;if(E==="end")return this[q]();if(E==="close"){if(this[f]=!0,!this[l]&&!this[H])return;let U=super.emit("close");return this.removeAllListeners("close"),U}else if(E==="error"){this[u]=M;let U=super.emit("error",M);return this[a](),U}else if(E==="resume"){let U=super.emit("resume");return this[a](),U}else if(E==="finish"||E==="prefinish"){let U=super.emit(E);return this.removeAllListeners(E),U}let Z=super.emit(E,M,...B);return this[a](),Z}[P](E){for(let B of this[O])B.dest.write(E)===!1&&this.pause();let M=super.emit("data",E);return this[a](),M}[q](){this[l]||(this[l]=!0,this.readable=!1,this[V]?N(()=>this[K]()):this[K]())}[K](){if(this[b]){let M=this[b].end();if(M){for(let B of this[O])B.dest.write(M);super.emit("data",M)}}for(let M of this[O])M.end();let E=super.emit("end");return this.removeAllListeners("end"),E}collect(){let E=[];this[F]||(E.dataLength=0);let M=this.promise();return this.on("data",B=>{E.push(B),this[F]||(E.dataLength+=B.length)}),M.then(()=>E)}concat(){return this[F]?Promise.reject(new Error("cannot concat in objectMode")):this.collect().then(E=>this[F]?Promise.reject(new Error("cannot concat in objectMode")):this[y]?E.join(""):Buffer.concat(E,E.dataLength))}promise(){return new Promise((E,M)=>{this.on(H,()=>M(new Error("stream destroyed"))),this.on("error",B=>M(B)),this.on("end",()=>E())})}[L](){return{next:()=>{let E=this.read();if(E!==null)return Promise.resolve({done:!1,value:E});if(this[o])return Promise.resolve({done:!0});let M=null,B=null,Z=ie=>{this.removeListener("data",U),this.removeListener("end",Q),B(ie)},U=ie=>{this.removeListener("error",Z),this.removeListener("end",Q),this.pause(),M({value:ie,done:!!this[o]})},Q=()=>{this.removeListener("error",Z),this.removeListener("data",U),M({done:!0})},G=()=>Z(new Error("stream destroyed"));return new Promise((ie,ue)=>{B=ue,M=ie,this.once(H,G),this.once("error",Z),this.once("end",Q),this.once("data",U)})}}}[j](){return{next:()=>{let E=this.read();return{value:E,done:E===null}}}}destroy(E){return this[H]?(E?this.emit("error",E):this.emit(H),this):(this[H]=!0,this[T].length=0,this[I]=0,typeof this.close=="function"&&!this[f]&&this.close(),E?this.emit("error",E):this.emit(H),this)}static isStream(E){return!!E&&(E instanceof Vw||E instanceof n||E instanceof i&&(typeof E.pipe=="function"||typeof E.write=="function"&&typeof E.end=="function"))}}}),rP=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))}),Zw=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"),l=Symbol("emittedEnd"),c=Symbol("emittingEnd"),u=Symbol("emittedError"),f=Symbol("closed"),h=Symbol("read"),p=Symbol("flush"),g=Symbol("flushChunk"),y=Symbol("encoding"),b=Symbol("decoder"),x=Symbol("flowing"),k=Symbol("paused"),C=Symbol("resume"),T=Symbol("bufferLength"),O=Symbol("bufferPush"),I=Symbol("bufferShift"),w=Symbol("objectMode"),v=Symbol("destroyed"),F=Symbol("emitData"),H=Symbol("emitEnd"),P=Symbol("emitEnd2"),q=Symbol("async"),K=m=>Promise.resolve().then(m),V=global._MP_NO_ITERATOR_SYMBOLS_!=="1",N=V&&Symbol.asyncIterator||Symbol("asyncIterator not implemented"),A=V&&Symbol.iterator||Symbol("iterator not implemented"),L=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),D=class{constructor(m,_,R){this.src=m,this.dest=_,this.opts=R,this.ondrain=()=>m[C](),_.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},d=class extends D{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(m,_,R){super(m,_,R),this.proxyErrors=E=>_.emit("error",E),m.on("error",this.proxyErrors)}};e.exports=class Xw extends n{constructor(_){super(),this[x]=!1,this[k]=!1,this.pipes=[],this.buffer=[],this[w]=_&&_.objectMode||!1,this[w]?this[y]=null:this[y]=_&&_.encoding||null,this[y]==="buffer"&&(this[y]=null),this[q]=_&&!!_.async||!1,this[b]=this[y]?new s(this[y]):null,this[o]=!1,this[l]=!1,this[c]=!1,this[f]=!1,this[u]=null,this.writable=!0,this.readable=!0,this[T]=0,this[v]=!1}get bufferLength(){return this[T]}get encoding(){return this[y]}set encoding(_){if(this[w])throw new Error("cannot set encoding in objectMode");if(this[y]&&_!==this[y]&&(this[b]&&this[b].lastNeed||this[T]))throw new Error("cannot change encoding");this[y]!==_&&(this[b]=_?new s(_):null,this.buffer.length&&(this.buffer=this.buffer.map(R=>this[b].write(R)))),this[y]=_}setEncoding(_){this.encoding=_}get objectMode(){return this[w]}set objectMode(_){this[w]=this[w]||!!_}get async(){return this[q]}set async(_){this[q]=this[q]||!!_}write(_,R,E){if(this[o])throw new Error("write after end");if(this[v])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof R=="function"&&(E=R,R="utf8"),R||(R="utf8");let M=this[q]?K:B=>B();return!this[w]&&!Buffer.isBuffer(_)&&(z(_)?_=Buffer.from(_.buffer,_.byteOffset,_.byteLength):j(_)?_=Buffer.from(_):typeof _!="string"&&(this.objectMode=!0)),this[w]?(this.flowing&&this[T]!==0&&this[p](!0),this.flowing?this.emit("data",_):this[O](_),this[T]!==0&&this.emit("readable"),E&&M(E),this.flowing):_.length?(typeof _=="string"&&!(R===this[y]&&!this[b].lastNeed)&&(_=Buffer.from(_,R)),Buffer.isBuffer(_)&&this[y]&&(_=this[b].write(_)),this.flowing&&this[T]!==0&&this[p](!0),this.flowing?this.emit("data",_):this[O](_),this[T]!==0&&this.emit("readable"),E&&M(E),this.flowing):(this[T]!==0&&this.emit("readable"),E&&M(E),this.flowing)}read(_){if(this[v])return null;if(this[T]===0||_===0||_>this[T])return this[a](),null;this[w]&&(_=null),this.buffer.length>1&&!this[w]&&(this.encoding?this.buffer=[this.buffer.join("")]:this.buffer=[Buffer.concat(this.buffer,this[T])]);let R=this[h](_||null,this.buffer[0]);return this[a](),R}[h](_,R){return _===R.length||_===null?this[I]():(this.buffer[0]=R.slice(_),R=R.slice(0,_),this[T]-=_),this.emit("data",R),!this.buffer.length&&!this[o]&&this.emit("drain"),R}end(_,R,E){return typeof _=="function"&&(E=_,_=null),typeof R=="function"&&(E=R,R="utf8"),_&&this.write(_,R),E&&this.once("end",E),this[o]=!0,this.writable=!1,(this.flowing||!this[k])&&this[a](),this}[C](){this[v]||(this[k]=!1,this[x]=!0,this.emit("resume"),this.buffer.length?this[p]():this[o]?this[a]():this.emit("drain"))}resume(){return this[C]()}pause(){this[x]=!1,this[k]=!0}get destroyed(){return this[v]}get flowing(){return this[x]}get paused(){return this[k]}[O](_){this[w]?this[T]+=1:this[T]+=_.length,this.buffer.push(_)}[I](){return this.buffer.length&&(this[w]?this[T]-=1:this[T]-=this.buffer[0].length),this.buffer.shift()}[p](_){do;while(this[g](this[I]()));!_&&!this.buffer.length&&!this[o]&&this.emit("drain")}[g](_){return _?(this.emit("data",_),this.flowing):!1}pipe(_,R){if(this[v])return;let E=this[l];return R=R||{},_===r.stdout||_===r.stderr?R.end=!1:R.end=R.end!==!1,R.proxyErrors=!!R.proxyErrors,E?R.end&&_.end():(this.pipes.push(R.proxyErrors?new d(this,_,R):new D(this,_,R)),this[q]?K(()=>this[C]()):this[C]()),_}unpipe(_){let R=this.pipes.find(E=>E.dest===_);R&&(this.pipes.splice(this.pipes.indexOf(R),1),R.unpipe())}addListener(_,R){return this.on(_,R)}on(_,R){let E=super.on(_,R);return _==="data"&&!this.pipes.length&&!this.flowing?this[C]():_==="readable"&&this[T]!==0?super.emit("readable"):L(_)&&this[l]?(super.emit(_),this.removeAllListeners(_)):_==="error"&&this[u]&&(this[q]?K(()=>R.call(this,this[u])):R.call(this,this[u])),E}get emittedEnd(){return this[l]}[a](){!this[c]&&!this[l]&&!this[v]&&this.buffer.length===0&&this[o]&&(this[c]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[f]&&this.emit("close"),this[c]=!1)}emit(_,R,...E){if(_!=="error"&&_!=="close"&&_!==v&&this[v])return;if(_==="data")return R?this[q]?K(()=>this[F](R)):this[F](R):!1;if(_==="end")return this[H]();if(_==="close"){if(this[f]=!0,!this[l]&&!this[v])return;let B=super.emit("close");return this.removeAllListeners("close"),B}else if(_==="error"){this[u]=R;let B=super.emit("error",R);return this[a](),B}else if(_==="resume"){let B=super.emit("resume");return this[a](),B}else if(_==="finish"||_==="prefinish"){let B=super.emit(_);return this.removeAllListeners(_),B}let M=super.emit(_,R,...E);return this[a](),M}[F](_){for(let E of this.pipes)E.dest.write(_)===!1&&this.pause();let R=super.emit("data",_);return this[a](),R}[H](){this[l]||(this[l]=!0,this.readable=!1,this[q]?K(()=>this[P]()):this[P]())}[P](){if(this[b]){let R=this[b].end();if(R){for(let E of this.pipes)E.dest.write(R);super.emit("data",R)}}for(let R of this.pipes)R.end();let _=super.emit("end");return this.removeAllListeners("end"),_}collect(){let _=[];this[w]||(_.dataLength=0);let R=this.promise();return this.on("data",E=>{_.push(E),this[w]||(_.dataLength+=E.length)}),R.then(()=>_)}concat(){return this[w]?Promise.reject(new Error("cannot concat in objectMode")):this.collect().then(_=>this[w]?Promise.reject(new Error("cannot concat in objectMode")):this[y]?_.join(""):Buffer.concat(_,_.dataLength))}promise(){return new Promise((_,R)=>{this.on(v,()=>R(new Error("stream destroyed"))),this.on("error",E=>R(E)),this.on("end",()=>_())})}[N](){return{next:()=>{let _=this.read();if(_!==null)return Promise.resolve({done:!1,value:_});if(this[o])return Promise.resolve({done:!0});let R=null,E=null,M=Q=>{this.removeListener("data",B),this.removeListener("end",Z),E(Q)},B=Q=>{this.removeListener("error",M),this.removeListener("end",Z),this.pause(),R({value:Q,done:!!this[o]})},Z=()=>{this.removeListener("error",M),this.removeListener("data",B),R({done:!0})},U=()=>M(new Error("stream destroyed"));return new Promise((Q,G)=>{E=G,R=Q,this.once(v,U),this.once("error",M),this.once("end",Z),this.once("data",B)})}}}[A](){return{next:()=>{let _=this.read();return{value:_,done:_===null}}}}destroy(_){return this[v]?(_?this.emit("error",_):this.emit(v),this):(this[v]=!0,this.buffer.length=0,this[T]=0,typeof this.close=="function"&&!this[f]&&this.close(),_?this.emit("error",_):this.emit(v),this)}static isStream(_){return!!_&&(_ instanceof Xw||_ instanceof n||_ instanceof i&&(typeof _.pipe=="function"||typeof _.write=="function"&&typeof _.end=="function"))}}}),Jw=te(t=>{"use strict";W();var e=re("assert"),r=re("buffer").Buffer,i=re("zlib"),n=t.constants=rP(),s=Zw(),o=r.concat,a=Symbol("_superWrite"),l=class extends Error{constructor(L){super("zlib: "+L.message),this.code=L.code,this.errno=L.errno,this.code||(this.code="ZLIB_ERROR"),this.message="zlib: "+L.message,Error.captureStackTrace(this,this.constructor)}get name(){return"ZlibError"}},c=Symbol("opts"),u=Symbol("flushFlag"),f=Symbol("finishFlushFlag"),h=Symbol("fullFlushFlag"),p=Symbol("handle"),g=Symbol("onError"),y=Symbol("sawError"),b=Symbol("level"),x=Symbol("strategy"),k=Symbol("ended"),C=Symbol("_defaultFullFlush"),T=class extends s{constructor(L,j){if(!L||typeof L!="object")throw new TypeError("invalid options for ZlibBase constructor");super(L),this[y]=!1,this[k]=!1,this[c]=L,this[u]=L.flush,this[f]=L.finishFlush;try{this[p]=new i[j](L)}catch(z){throw new l(z)}this[g]=z=>{this[y]||(this[y]=!0,this.close(),this.emit("error",z))},this[p].on("error",z=>this[g](new l(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(L){this.ended||(typeof L!="number"&&(L=this[h]),this.write(Object.assign(r.alloc(0),{[u]:L})))}end(L,j,z){return L&&this.write(L,j),this.flush(this[f]),this[k]=!0,super.end(null,null,z)}get ended(){return this[k]}write(L,j,z){if(typeof j=="function"&&(z=j,j="utf8"),typeof L=="string"&&(L=r.from(L,j)),this[y])return;e(this[p],"zlib binding closed");let D=this[p]._handle,d=D.close;D.close=()=>{};let m=this[p].close;this[p].close=()=>{},r.concat=E=>E;let _;try{let E=typeof L[u]=="number"?L[u]:this[u];_=this[p]._processChunk(L,E),r.concat=o}catch(E){r.concat=o,this[g](new l(E))}finally{this[p]&&(this[p]._handle=D,D.close=d,this[p].close=m,this[p].removeAllListeners("error"))}this[p]&&this[p].on("error",E=>this[g](new l(E)));let R;if(_)if(Array.isArray(_)&&_.length>0){R=this[a](r.from(_[0]));for(let E=1;E<_.length;E++)R=this[a](_[E])}else R=this[a](r.from(_));return z&&z(),R}[a](L){return super.write(L)}},O=class extends T{constructor(L,j){L=L||{},L.flush=L.flush||n.Z_NO_FLUSH,L.finishFlush=L.finishFlush||n.Z_FINISH,super(L,j),this[h]=n.Z_FULL_FLUSH,this[b]=L.level,this[x]=L.strategy}params(L,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[b]!==L||this[x]!==j){this.flush(n.Z_SYNC_FLUSH),e(this[p],"zlib binding closed");let z=this[p].flush;this[p].flush=(D,d)=>{this.flush(D),d()};try{this[p].params(L,j)}finally{this[p].flush=z}this[p]&&(this[b]=L,this[x]=j)}}}},I=class extends O{constructor(L){super(L,"Deflate")}},w=class extends O{constructor(L){super(L,"Inflate")}},v=Symbol("_portable"),F=class extends O{constructor(L){super(L,"Gzip"),this[v]=L&&!!L.portable}[a](L){return this[v]?(this[v]=!1,L[9]=255,super[a](L)):super[a](L)}},H=class extends O{constructor(L){super(L,"Gunzip")}},P=class extends O{constructor(L){super(L,"DeflateRaw")}},q=class extends O{constructor(L){super(L,"InflateRaw")}},K=class extends O{constructor(L){super(L,"Unzip")}},V=class extends T{constructor(L,j){L=L||{},L.flush=L.flush||n.BROTLI_OPERATION_PROCESS,L.finishFlush=L.finishFlush||n.BROTLI_OPERATION_FINISH,super(L,j),this[h]=n.BROTLI_OPERATION_FLUSH}},N=class extends V{constructor(L){super(L,"BrotliCompress")}},A=class extends V{constructor(L){super(L,"BrotliDecompress")}};t.Deflate=I,t.Inflate=w,t.Gzip=F,t.Gunzip=H,t.DeflateRaw=P,t.InflateRaw=q,t.Unzip=K,typeof i.BrotliCompress=="function"?(t.BrotliCompress=N,t.BrotliDecompress=A):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,"/")}),Mh=te((t,e)=>{"use strict";W();var r=Dh(),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,l=this.blockRemain;return this.remain=Math.max(0,a-o),this.blockRemain=Math.max(0,l-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])}}}),Qw=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]]))}),iP=te((t,e)=>{"use strict";W();var r=(u,f)=>{if(Number.isSafeInteger(u))u<0?n(u,f):i(u,f);else throw Error("cannot encode number outside of javascript safe integer range");return f},i=(u,f)=>{f[0]=128;for(var h=f.length;h>1;h--)f[h-1]=u&255,u=Math.floor(u/256)},n=(u,f)=>{f[0]=255;var h=!1;u=u*-1;for(var p=f.length;p>1;p--){var g=u&255;u=Math.floor(u/256),h?f[p-1]=l(g):g===0?f[p-1]=0:(h=!0,f[p-1]=c(g))}},s=u=>{let f=u[0],h=f===128?a(u.slice(1,u.length)):f===255?o(u):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=u=>{for(var f=u.length,h=0,p=!1,g=f-1;g>-1;g--){var y=u[g],b;p?b=l(y):y===0?b=y:(p=!0,b=c(y)),b!==0&&(h-=b*Math.pow(256,f-g-1))}return h},a=u=>{for(var f=u.length,h=0,p=f-1;p>-1;p--){var g=u[p];g!==0&&(h+=g*Math.pow(256,f-p-1))}return h},l=u=>(255^u)&255,c=u=>(255^u)+1&255;e.exports={encode:r,parse:s}}),Xn=te((t,e)=>{"use strict";W();var r=Qw(),i=re("path").posix,n=iP(),s=Symbol("slurp"),o=Symbol("type"),a=class{constructor(w,v,F,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(w)?this.decode(w,v||0,F,H):w&&this.set(w)}decode(w,v,F,H){if(v||(v=0),!w||!(w.length>=v+512))throw new Error("need 512 bytes for header");if(this.path=c(w,v,100),this.mode=h(w,v+100,8),this.uid=h(w,v+108,8),this.gid=h(w,v+116,8),this.size=h(w,v+124,12),this.mtime=u(w,v+136,12),this.cksum=h(w,v+148,12),this[s](F),this[s](H,!0),this[o]=c(w,v+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=c(w,v+157,100),w.slice(v+257,v+265).toString()==="ustar\x0000")if(this.uname=c(w,v+265,32),this.gname=c(w,v+297,32),this.devmaj=h(w,v+329,8),this.devmin=h(w,v+337,8),w[v+475]!==0){let q=c(w,v+345,155);this.path=q+"/"+this.path}else{let q=c(w,v+345,130);q&&(this.path=q+"/"+this.path),this.atime=u(w,v+476,12),this.ctime=u(w,v+488,12)}let P=8*32;for(let q=v;q<v+148;q++)P+=w[q];for(let q=v+156;q<v+512;q++)P+=w[q];this.cksumValid=P===this.cksum,this.cksum===null&&P===8*32&&(this.nullBlock=!0)}[s](w,v){for(let F in w)w[F]!==null&&w[F]!==void 0&&!(v&&F==="path")&&(this[F]=w[F])}encode(w,v){if(w||(w=this.block=Buffer.alloc(512),v=0),v||(v=0),!(w.length>=v+512))throw new Error("need 512 bytes for header");let F=this.ctime||this.atime?130:155,H=l(this.path||"",F),P=H[0],q=H[1];this.needPax=H[2],this.needPax=I(w,v,100,P)||this.needPax,this.needPax=b(w,v+100,8,this.mode)||this.needPax,this.needPax=b(w,v+108,8,this.uid)||this.needPax,this.needPax=b(w,v+116,8,this.gid)||this.needPax,this.needPax=b(w,v+124,12,this.size)||this.needPax,this.needPax=T(w,v+136,12,this.mtime)||this.needPax,w[v+156]=this[o].charCodeAt(0),this.needPax=I(w,v+157,100,this.linkpath)||this.needPax,w.write("ustar\x0000",v+257,8),this.needPax=I(w,v+265,32,this.uname)||this.needPax,this.needPax=I(w,v+297,32,this.gname)||this.needPax,this.needPax=b(w,v+329,8,this.devmaj)||this.needPax,this.needPax=b(w,v+337,8,this.devmin)||this.needPax,this.needPax=I(w,v+345,F,q)||this.needPax,w[v+475]!==0?this.needPax=I(w,v+345,155,q)||this.needPax:(this.needPax=I(w,v+345,130,q)||this.needPax,this.needPax=T(w,v+476,12,this.atime)||this.needPax,this.needPax=T(w,v+488,12,this.ctime)||this.needPax);let K=8*32;for(let V=v;V<v+148;V++)K+=w[V];for(let V=v+156;V<v+512;V++)K+=w[V];return this.cksum=K,b(w,v+148,8,this.cksum),this.cksumValid=!0,this.needPax}set(w){for(let v in w)w[v]!==null&&w[v]!==void 0&&(this[v]=w[v])}get type(){return r.name.get(this[o])||this[o]}get typeKey(){return this[o]}set type(w){r.code.has(w)?this[o]=r.code.get(w):this[o]=w}},l=(w,v)=>{let F=w,H="",P,q=i.parse(w).root||".";if(Buffer.byteLength(F)<100)P=[F,H,!1];else{H=i.dirname(F),F=i.basename(F);do Buffer.byteLength(F)<=100&&Buffer.byteLength(H)<=v?P=[F,H,!1]:Buffer.byteLength(F)>100&&Buffer.byteLength(H)<=v?P=[F.slice(0,100-1),H,!0]:(F=i.join(i.basename(H),F),H=i.dirname(H));while(H!==q&&!P);P||(P=[w.slice(0,100-1),"",!0])}return P},c=(w,v,F)=>w.slice(v,v+F).toString("utf8").replace(/\0.*/,""),u=(w,v,F)=>f(h(w,v,F)),f=w=>w===null?null:new Date(w*1e3),h=(w,v,F)=>w[v]&128?n.parse(w.slice(v,v+F)):g(w,v,F),p=w=>isNaN(w)?null:w,g=(w,v,F)=>p(parseInt(w.slice(v,v+F).toString("utf8").replace(/\0.*$/,"").trim(),8)),y={12:8589934591,8:2097151},b=(w,v,F,H)=>H===null?!1:H>y[F]||H<0?(n.encode(H,w.slice(v,v+F)),!0):(x(w,v,F,H),!1),x=(w,v,F,H)=>w.write(k(H,F),v,F,"ascii"),k=(w,v)=>C(Math.floor(w).toString(8),v),C=(w,v)=>(w.length===v-1?w:new Array(v-w.length-1).join("0")+w+" ")+"\0",T=(w,v,F,H)=>H===null?!1:b(w,v,F,H.getTime()/1e3),O=new Array(156).join("\0"),I=(w,v,F,H)=>H===null?!1:(w.write(H+O,v,F,"utf8"),H.length!==Buffer.byteLength(H)||H.length>F);e.exports=a}),Fh=te((t,e)=>{"use strict";W();var r=Xn(),i=re("path"),n=class{constructor(l,c){this.atime=l.atime||null,this.charset=l.charset||null,this.comment=l.comment||null,this.ctime=l.ctime||null,this.gid=l.gid||null,this.gname=l.gname||null,this.linkpath=l.linkpath||null,this.mtime=l.mtime||null,this.path=l.path||null,this.size=l.size||null,this.uid=l.uid||null,this.uname=l.uname||null,this.dev=l.dev||null,this.ino=l.ino||null,this.nlink=l.nlink||null,this.global=c||!1}encode(){let l=this.encodeBody();if(l==="")return null;let c=Buffer.byteLength(l),u=512*Math.ceil(1+c/512),f=Buffer.allocUnsafe(u);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:c,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(l,512,c,"utf8");for(let h=c+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(l){if(this[l]===null||this[l]===void 0)return"";let c=this[l]instanceof Date?this[l].getTime()/1e3:this[l],u=" "+(l==="dev"||l==="ino"||l==="nlink"?"SCHILY.":"")+l+"="+c+`
41
41
  `,f=Buffer.byteLength(u),h=Math.floor(Math.log(f)/Math.log(10))+1;return f+h>=Math.pow(10,h)&&(h+=1),h+f+u}};n.parse=(l,c,u)=>new n(s(o(l),c),u);var s=(l,c)=>c?Object.keys(l).reduce((u,f)=>(u[f]=l[f],u),c):l,o=l=>l.replace(/\n$/,"").split(`
42
42
  `).reduce(a,Object.create(null)),a=(l,c)=>{let u=parseInt(c,10);if(u!==Buffer.byteLength(c)+1)return l;c=c.slice((u+" ").length);let f=c.split("="),h=f.shift().replace(/^SCHILY\.(dev|ino|nlink)/,"$1");if(!h)return l;let p=f.join("=");return l[h]=/^([A-Z]+\.)?([mac]|birth|creation)time$/.test(h)?new Date(p*1e3):/^[0-9]+$/.test(p)?+p:p,l};e.exports=n}),Jn=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)}}),Bh=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))}}}),eS=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,l)=>a.split(l).join(n.get(l)),o),decode:o=>i.reduce((a,l)=>a.split(l).join(s.get(l)),o)}}),tS=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]}}),nP=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)}),rS=te((t,e)=>{"use strict";W();var r=Dh(),i=Fh(),n=Xn(),s=re("fs"),o=re("path"),a=Zn(),l=Jn(),c=(m,_)=>_?(m=a(m).replace(/^\.(\/|$)/,""),l(_)+"/"+m):a(m),u=16*1024*1024,f=Symbol("process"),h=Symbol("file"),p=Symbol("directory"),g=Symbol("symlink"),y=Symbol("hardlink"),b=Symbol("header"),x=Symbol("read"),k=Symbol("lstat"),C=Symbol("onlstat"),T=Symbol("onread"),O=Symbol("onreadlink"),I=Symbol("openfile"),w=Symbol("onopenfile"),v=Symbol("close"),F=Symbol("mode"),H=Symbol("awaitDrain"),P=Symbol("ondrain"),q=Symbol("prefix"),K=Symbol("hadError"),V=Bh(),N=eS(),A=tS(),L=nP(),j=V(class extends r{constructor(m,_){if(_=_||{},super(_),typeof m!="string")throw new TypeError("path is required");this.path=a(m),this.portable=!!_.portable,this.myuid=process.getuid&&process.getuid()||0,this.myuser=process.env.USER||"",this.maxReadSize=_.maxReadSize||u,this.linkCache=_.linkCache||new Map,this.statCache=_.statCache||new Map,this.preservePaths=!!_.preservePaths,this.cwd=a(_.cwd||process.cwd()),this.strict=!!_.strict,this.noPax=!!_.noPax,this.noMtime=!!_.noMtime,this.mtime=_.mtime||null,this.prefix=_.prefix?a(_.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 _.onwarn=="function"&&this.on("warn",_.onwarn);let R=!1;if(!this.preservePaths){let[E,M]=A(this.path);E&&(this.path=M,R=E)}this.win32=!!_.win32||process.platform==="win32",this.win32&&(this.path=N.decode(this.path.replace(/\\/g,"/")),m=m.replace(/\\/g,"/")),this.absolute=a(_.absolute||o.resolve(this.cwd,m)),this.path===""&&(this.path="./"),R&&this.warn("TAR_ENTRY_INFO",`stripping ${R} from absolute path`,{entry:this,path:R+this.path}),this.statCache.has(this.absolute)?this[C](this.statCache.get(this.absolute)):this[k]()}emit(m,..._){return m==="error"&&(this[K]=!0),super.emit(m,..._)}[k](){s.lstat(this.absolute,(m,_)=>{if(m)return this.emit("error",m);this[C](_)})}[C](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()}}[F](m){return L(m,this.type==="Directory",this.portable)}[q](m){return c(m,this.prefix)}[b](){this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.header=new n({path:this[q](this.path),linkpath:this.type==="Link"?this[q](this.linkpath):this.linkpath,mode:this[F](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[q](this.path),linkpath:this.type==="Link"?this[q](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[b](),this.end()}[g](){s.readlink(this.absolute,(m,_)=>{if(m)return this.emit("error",m);this[O](_)})}[O](m){this.linkpath=a(m),this[b](),this.end()}[y](m){this.type="Link",this.linkpath=a(o.relative(this.cwd,m)),this.stat.size=0,this[b](),this.end()}[h](){if(this.stat.nlink>1){let m=this.stat.dev+":"+this.stat.ino;if(this.linkCache.has(m)){let _=this.linkCache.get(m);if(_.indexOf(this.cwd)===0)return this[y](_)}this.linkCache.set(m,this.absolute)}if(this[b](),this.stat.size===0)return this.end();this[I]()}[I](){s.open(this.absolute,"r",(m,_)=>{if(m)return this.emit("error",m);this[w](_)})}[w](m){if(this.fd=m,this[K])return this[v]();this.blockLen=512*Math.ceil(this.stat.size/512),this.blockRemain=this.blockLen;let _=Math.min(this.blockLen,this.maxReadSize);this.buf=Buffer.allocUnsafe(_),this.offset=0,this.pos=0,this.remain=this.stat.size,this.length=this.buf.length,this[x]()}[x](){let{fd:m,buf:_,offset:R,length:E,pos:M}=this;s.read(m,_,R,E,M,(B,Z)=>{if(B)return this[v](()=>this.emit("error",B));this[T](Z)})}[v](m){s.close(this.fd,m)}[T](m){if(m<=0&&this.remain>0){let R=new Error("encountered unexpected EOF");return R.path=this.absolute,R.syscall="read",R.code="EOF",this[v](()=>this.emit("error",R))}if(m>this.remain){let R=new Error("did not encounter expected EOF");return R.path=this.absolute,R.syscall="read",R.code="EOF",this[v](()=>this.emit("error",R))}if(m===this.remain)for(let R=m;R<this.length&&m<this.blockRemain;R++)this.buf[R+this.offset]=0,m++,this.remain++;let _=this.offset===0&&m===this.buf.length?this.buf:this.buf.slice(this.offset,this.offset+m);this.write(_)?this[P]():this[H](()=>this[P]())}[H](m){this.once("drain",m)}write(m){if(this.blockRemain<m.length){let _=new Error("writing more data than expected");return _.path=this.absolute,this.emit("error",_)}return this.remain-=m.length,this.blockRemain-=m.length,this.pos+=m.length,this.offset+=m.length,super.write(m)}[P](){if(!this.remain)return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),this[v](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[x]()}}),z=class extends j{[k](){this[C](s.lstatSync(this.absolute))}[g](){this[O](s.readlinkSync(this.absolute))}[I](){this[w](s.openSync(this.absolute,"r"))}[x](){let m=!0;try{let{fd:_,buf:R,offset:E,length:M,pos:B}=this,Z=s.readSync(_,R,E,M,B);this[T](Z),m=!1}finally{if(m)try{this[v](()=>{})}catch{}}}[H](m){m()}[v](m){s.closeSync(this.fd),m()}},D=V(class extends r{constructor(m,_){_=_||{},super(_),this.preservePaths=!!_.preservePaths,this.portable=!!_.portable,this.strict=!!_.strict,this.noPax=!!_.noPax,this.noMtime=!!_.noMtime,this.readEntry=m,this.type=m.type,this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.prefix=_.prefix||null,this.path=a(m.path),this.mode=this[F](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:_.mtime||m.mtime,this.atime=this.portable?null:m.atime,this.ctime=this.portable?null:m.ctime,this.linkpath=a(m.linkpath),typeof _.onwarn=="function"&&this.on("warn",_.onwarn);let R=!1;if(!this.preservePaths){let[E,M]=A(this.path);E&&(this.path=M,R=E)}this.remain=m.size,this.blockRemain=m.startBlockSize,this.header=new n({path:this[q](this.path),linkpath:this.type==="Link"?this[q](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}),R&&this.warn("TAR_ENTRY_INFO",`stripping ${R} from absolute path`,{entry:this,path:R+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[q](this.path),linkpath:this.type==="Link"?this[q](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)}[q](m){return c(m,this.prefix)}[F](m){return L(m,this.type==="Directory",this.portable)}write(m){let _=m.length;if(_>this.blockRemain)throw new Error("writing more to entry than is appropriate");return this.blockRemain-=_,super.write(m)}end(){return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),super.end()}});j.Sync=z,j.Tar=D;var d=m=>m.isFile()?"File":m.isDirectory()?"Directory":m.isSymbolicLink()?"SymbolicLink":"Unsupported";e.exports=j}),sP=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}}}),iS=te((t,e)=>{"use strict";W(),e.exports=r,r.Node=o,r.create=r;function r(a){var l=this;if(l instanceof r||(l=new r),l.tail=null,l.head=null,l.length=0,a&&typeof a.forEach=="function")a.forEach(function(f){l.push(f)});else if(arguments.length>0)for(var c=0,u=arguments.length;c<u;c++)l.push(arguments[c]);return l}r.prototype.removeNode=function(a){if(a.list!==this)throw new Error("removing node which does not belong to this list");var l=a.next,c=a.prev;return l&&(l.prev=c),c&&(c.next=l),a===this.head&&(this.head=l),a===this.tail&&(this.tail=c),a.list.length--,a.next=null,a.prev=null,a.list=null,l},r.prototype.unshiftNode=function(a){if(a!==this.head){a.list&&a.list.removeNode(a);var l=this.head;a.list=this,a.next=l,l&&(l.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 l=this.tail;a.list=this,a.prev=l,l&&(l.next=a),this.tail=a,this.head||(this.head=a),this.length++}},r.prototype.push=function(){for(var a=0,l=arguments.length;a<l;a++)n(this,arguments[a]);return this.length},r.prototype.unshift=function(){for(var a=0,l=arguments.length;a<l;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,l){l=l||this;for(var c=this.head,u=0;c!==null;u++)a.call(l,c.value,u,this),c=c.next},r.prototype.forEachReverse=function(a,l){l=l||this;for(var c=this.tail,u=this.length-1;c!==null;u--)a.call(l,c.value,u,this),c=c.prev},r.prototype.get=function(a){for(var l=0,c=this.head;c!==null&&l<a;l++)c=c.next;if(l===a&&c!==null)return c.value},r.prototype.getReverse=function(a){for(var l=0,c=this.tail;c!==null&&l<a;l++)c=c.prev;if(l===a&&c!==null)return c.value},r.prototype.map=function(a,l){l=l||this;for(var c=new r,u=this.head;u!==null;)c.push(a.call(l,u.value,this)),u=u.next;return c},r.prototype.mapReverse=function(a,l){l=l||this;for(var c=new r,u=this.tail;u!==null;)c.push(a.call(l,u.value,this)),u=u.prev;return c},r.prototype.reduce=function(a,l){var c,u=this.head;if(arguments.length>1)c=l;else if(this.head)u=this.head.next,c=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var f=0;u!==null;f++)c=a(c,u.value,f),u=u.next;return c},r.prototype.reduceReverse=function(a,l){var c,u=this.tail;if(arguments.length>1)c=l;else if(this.tail)u=this.tail.prev,c=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var f=this.length-1;u!==null;f--)c=a(c,u.value,f),u=u.prev;return c},r.prototype.toArray=function(){for(var a=new Array(this.length),l=0,c=this.head;c!==null;l++)a[l]=c.value,c=c.next;return a},r.prototype.toArrayReverse=function(){for(var a=new Array(this.length),l=0,c=this.tail;c!==null;l++)a[l]=c.value,c=c.prev;return a},r.prototype.slice=function(a,l){l=l||this.length,l<0&&(l+=this.length),a=a||0,a<0&&(a+=this.length);var c=new r;if(l<a||l<0)return c;a<0&&(a=0),l>this.length&&(l=this.length);for(var u=0,f=this.head;f!==null&&u<a;u++)f=f.next;for(;f!==null&&u<l;u++,f=f.next)c.push(f.value);return c},r.prototype.sliceReverse=function(a,l){l=l||this.length,l<0&&(l+=this.length),a=a||0,a<0&&(a+=this.length);var c=new r;if(l<a||l<0)return c;a<0&&(a=0),l>this.length&&(l=this.length);for(var u=this.length,f=this.tail;f!==null&&u>l;u--)f=f.prev;for(;f!==null&&u>a;u--,f=f.prev)c.push(f.value);return c},r.prototype.splice=function(a,l,...c){a>this.length&&(a=this.length-1),a<0&&(a=this.length+a);for(var u=0,f=this.head;f!==null&&u<a;u++)f=f.next;for(var h=[],u=0;f&&u<l;u++)h.push(f.value),f=this.removeNode(f);f===null&&(f=this.tail),f!==this.head&&f!==this.tail&&(f=f.prev);for(var u=0;u<c.length;u++)f=i(this,f,c[u]);return h},r.prototype.reverse=function(){for(var a=this.head,l=this.tail,c=a;c!==null;c=c.prev){var u=c.prev;c.prev=c.next,c.next=u}return this.head=l,this.tail=a,this};function i(a,l,c){var u=l===a.head?new o(c,null,l,a):new o(c,l,l.next,a);return u.next===null&&(a.tail=u),u.prev===null&&(a.head=u),a.length++,u}function n(a,l){a.tail=new o(l,a.tail,null,a),a.head||(a.head=a.tail),a.length++}function s(a,l){a.head=new o(l,null,a.head,a),a.tail||(a.tail=a.head),a.length++}function o(a,l,c,u){if(!(this instanceof o))return new o(a,l,c,u);this.list=u,this.value=a,l?(l.next=this,this.prev=l):this.prev=null,c?(c.prev=this,this.next=c):this.next=null}try{sP()(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=Dh(),n=Jw(),s=Mh(),o=rS(),a=o.Sync,l=o.Tar,c=iS(),u=Buffer.alloc(1024),f=Symbol("onStat"),h=Symbol("ended"),p=Symbol("queue"),g=Symbol("current"),y=Symbol("process"),b=Symbol("processing"),x=Symbol("processJob"),k=Symbol("jobs"),C=Symbol("jobDone"),T=Symbol("addFSEntry"),O=Symbol("addTarEntry"),I=Symbol("stat"),w=Symbol("readdir"),v=Symbol("onreaddir"),F=Symbol("pipe"),H=Symbol("entry"),P=Symbol("entryOpt"),q=Symbol("writeEntryClass"),K=Symbol("write"),V=Symbol("ondrain"),N=re("fs"),A=re("path"),L=Bh(),j=Zn(),z=L(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[q]=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[V]()),this.on("resume",m=>this.zip.resume())):this.on("drain",this[V]),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 c,this[k]=0,this.jobs=+d.jobs||4,this[b]=!1,this[h]=!1}[K](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[O](d):this[T](d),this.flowing}[O](d){let m=j(A.resolve(this.cwd,d.path));if(!this.filter(d.path,d))d.resume();else{let _=new r(d.path,m,!1);_.entry=new l(d,this[P](_)),_.entry.on("end",R=>this[C](_)),this[k]+=1,this[p].push(_)}this[y]()}[T](d){let m=j(A.resolve(this.cwd,d));this[p].push(new r(d,m)),this[y]()}[I](d){d.pending=!0,this[k]+=1;let m=this.follow?"stat":"lstat";N[m](d.absolute,(_,R)=>{d.pending=!1,this[k]-=1,_?this.emit("error",_):this[f](d,R)})}[f](d,m){this.statCache.set(d.absolute,m),d.stat=m,this.filter(d.path,m)||(d.ignore=!0),this[y]()}[w](d){d.pending=!0,this[k]+=1,N.readdir(d.absolute,(m,_)=>{if(d.pending=!1,this[k]-=1,m)return this.emit("error",m);this[v](d,_)})}[v](d,m){this.readdirCache.set(d.absolute,m),d.readdir=m,this[y]()}[y](){if(!this[b]){this[b]=!0;for(let d=this[p].head;d!==null&&this[k]<this.jobs;d=d.next)if(this[x](d.value),d.value.ignore){let m=d.next;this[p].removeNode(d),d.next=m}this[b]=!1,this[h]&&!this[p].length&&this[k]===0&&(this.zip?this.zip.end(u):(super.write(u),super.end()))}}get[g](){return this[p]&&this[p].head&&this[p].head.value}[C](d){this[p].shift(),this[k]-=1,this[y]()}[x](d){if(!d.pending){if(d.entry){d===this[g]&&!d.piped&&this[F](d);return}if(d.stat||(this.statCache.has(d.absolute)?this[f](d,this.statCache.get(d.absolute)):this[I](d)),!!d.stat&&!d.ignore&&!(!this.noDirRecurse&&d.stat.isDirectory()&&!d.readdir&&(this.readdirCache.has(d.absolute)?this[v](d,this.readdirCache.get(d.absolute)):this[w](d),!d.readdir))){if(d.entry=this[H](d),!d.entry){d.ignore=!0;return}d===this[g]&&!d.piped&&this[F](d)}}}[P](d){return{onwarn:(m,_,R)=>this.warn(m,_,R),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[k]+=1;try{return new this[q](d.path,this[P](d)).on("end",()=>this[C](d)).on("error",m=>this.emit("error",m))}catch(m){this.emit("error",m)}}[V](){this[g]&&this[g].entry&&this[g].entry.resume()}[F](d){d.piped=!0,d.readdir&&d.readdir.forEach(R=>{let E=d.path,M=E==="./"?"":E.replace(/\/*$/,"/");this[T](M+R)});let m=d.entry,_=this.zip;_?m.on("data",R=>{_.write(R)||m.pause()}):m.on("data",R=>{super.write(R)||m.pause()})}pause(){return this.zip&&this.zip.pause(),super.pause()}}),D=class extends z{constructor(d){super(d),this[q]=a}pause(){}resume(){}[I](d){let m=this.follow?"statSync":"lstatSync";this[f](d,N[m](d.absolute))}[w](d,m){this[v](d,N.readdirSync(d.absolute))}[F](d){let m=d.entry,_=this.zip;d.readdir&&d.readdir.forEach(R=>{let E=d.path,M=E==="./"?"":E.replace(/\/*$/,"/");this[T](M+R)}),_?m.on("data",R=>{_.write(R)}):m.on("data",R=>{super[K](R)})}};z.Sync=D,e.exports=z}),Qn=te(t=>{"use strict";W();var e=Zw(),r=re("events").EventEmitter,i=re("fs"),n=i.writev;if(!n){let d=process.binding("fs"),m=d.FSReqWrap||d.FSReqCallback;n=(_,R,E,M)=>{let B=(U,Q)=>M(U,Q,R),Z=new m;Z.oncomplete=B,d.writeBuffers(_,R,E,Z)}}var s=Symbol("_autoClose"),o=Symbol("_close"),a=Symbol("_ended"),l=Symbol("_fd"),c=Symbol("_finished"),u=Symbol("_flags"),f=Symbol("_flush"),h=Symbol("_handleChunk"),p=Symbol("_makeBuf"),g=Symbol("_mode"),y=Symbol("_needDrain"),b=Symbol("_onerror"),x=Symbol("_onopen"),k=Symbol("_onread"),C=Symbol("_onwrite"),T=Symbol("_open"),O=Symbol("_path"),I=Symbol("_pos"),w=Symbol("_queue"),v=Symbol("_read"),F=Symbol("_readSize"),H=Symbol("_reading"),P=Symbol("_remain"),q=Symbol("_size"),K=Symbol("_write"),V=Symbol("_writing"),N=Symbol("_defaultFlag"),A=Symbol("_errored"),L=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[A]=!1,this[l]=typeof m.fd=="number"?m.fd:null,this[O]=d,this[F]=m.readSize||16*1024*1024,this[H]=!1,this[q]=typeof m.size=="number"?m.size:1/0,this[P]=this[q],this[s]=typeof m.autoClose=="boolean"?m.autoClose:!0,typeof this[l]=="number"?this[v]():this[T]()}get fd(){return this[l]}get path(){return this[O]}write(){throw new TypeError("this is a readable stream")}end(){throw new TypeError("this is a readable stream")}[T](){i.open(this[O],"r",(d,m)=>this[x](d,m))}[x](d,m){d?this[b](d):(this[l]=m,this.emit("open",m),this[v]())}[p](){return Buffer.allocUnsafe(Math.min(this[F],this[P]))}[v](){if(!this[H]){this[H]=!0;let d=this[p]();if(d.length===0)return process.nextTick(()=>this[k](null,0,d));i.read(this[l],d,0,d.length,null,(m,_,R)=>this[k](m,_,R))}}[k](d,m,_){this[H]=!1,d?this[b](d):this[h](m,_)&&this[v]()}[o](){if(this[s]&&typeof this[l]=="number"){let d=this[l];this[l]=null,i.close(d,m=>m?this.emit("error",m):this.emit("close"))}}[b](d){this[H]=!0,this[o](),this.emit("error",d)}[h](d,m){let _=!1;return this[P]-=d,d>0&&(_=super.write(d<m.length?m.slice(0,d):m)),(d===0||this[P]<=0)&&(_=!1,this[o](),super.end()),_}emit(d,m){switch(d){case"prefinish":case"finish":break;case"drain":typeof this[l]=="number"&&this[v]();break;case"error":return this[A]?void 0:(this[A]=!0,super.emit(d,m));default:return super.emit(d,m)}}},j=class extends L{[T](){let d=!0;try{this[x](null,i.openSync(this[O],"r")),d=!1}finally{d&&this[o]()}}[v](){let d=!0;try{if(!this[H]){this[H]=!0;do{let m=this[p](),_=m.length===0?0:i.readSync(this[l],m,0,m.length,null);if(!this[h](_,m))break}while(!0);this[H]=!1}d=!1}finally{d&&this[o]()}}[o](){if(this[s]&&typeof this[l]=="number"){let d=this[l];this[l]=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[A]=!1,this[V]=!1,this[a]=!1,this[y]=!1,this[w]=[],this[O]=d,this[l]=typeof m.fd=="number"?m.fd:null,this[g]=m.mode===void 0?438:m.mode,this[I]=typeof m.start=="number"?m.start:null,this[s]=typeof m.autoClose=="boolean"?m.autoClose:!0;let _=this[I]!==null?"r+":"w";this[N]=m.flags===void 0,this[u]=this[N]?_:m.flags,this[l]===null&&this[T]()}emit(d,m){if(d==="error"){if(this[A])return;this[A]=!0}return super.emit(d,m)}get fd(){return this[l]}get path(){return this[O]}[b](d){this[o](),this[V]=!0,this.emit("error",d)}[T](){i.open(this[O],this[u],this[g],(d,m)=>this[x](d,m))}[x](d,m){this[N]&&this[u]==="r+"&&d&&d.code==="ENOENT"?(this[u]="w",this[T]()):d?this[b](d):(this[l]=m,this.emit("open",m),this[f]())}end(d,m){return d&&this.write(d,m),this[a]=!0,!this[V]&&!this[w].length&&typeof this[l]=="number"&&this[C](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[l]===null||this[V]||this[w].length?(this[w].push(d),this[y]=!0,!1):(this[V]=!0,this[K](d),!0)}[K](d){i.write(this[l],d,0,d.length,this[I],(m,_)=>this[C](m,_))}[C](d,m){d?this[b](d):(this[I]!==null&&(this[I]+=m),this[w].length?this[f]():(this[V]=!1,this[a]&&!this[c]?(this[c]=!0,this[o](),this.emit("finish")):this[y]&&(this[y]=!1,this.emit("drain"))))}[f](){if(this[w].length===0)this[a]&&this[C](null,0);else if(this[w].length===1)this[K](this[w].pop());else{let d=this[w];this[w]=[],n(this[l],d,this[I],(m,_)=>this[C](m,_))}}[o](){if(this[s]&&typeof this[l]=="number"){let d=this[l];this[l]=null,i.close(d,m=>m?this.emit("error",m):this.emit("close"))}}},D=class extends z{[T](){let d;if(this[N]&&this[u]==="r+")try{d=i.openSync(this[O],this[u],this[g])}catch(m){if(m.code==="ENOENT")return this[u]="w",this[T]();throw m}else d=i.openSync(this[O],this[u],this[g]);this[x](null,d)}[o](){if(this[s]&&typeof this[l]=="number"){let d=this[l];this[l]=null,i.closeSync(d),this.emit("close")}}[K](d){let m=!0;try{this[C](null,i.writeSync(this[l],d,0,d.length,this[I])),m=!1}finally{if(m)try{this[o]()}catch{}}}};t.ReadStream=L,t.ReadStreamSync=j,t.WriteStream=z,t.WriteStreamSync=D}),$h=te((t,e)=>{"use strict";W();var r=Bh(),i=Xn(),n=re("events"),s=iS(),o=1024*1024,a=Mh(),l=Fh(),c=Jw(),{nextTick:u}=re("process"),f=Buffer.from([31,139]),h=Symbol("state"),p=Symbol("writeEntry"),g=Symbol("readEntry"),y=Symbol("nextEntry"),b=Symbol("processEntry"),x=Symbol("extendedHeader"),k=Symbol("globalExtendedHeader"),C=Symbol("meta"),T=Symbol("emitMeta"),O=Symbol("buffer"),I=Symbol("queue"),w=Symbol("ended"),v=Symbol("emittedEnd"),F=Symbol("emit"),H=Symbol("unzip"),P=Symbol("consumeChunk"),q=Symbol("consumeChunkSub"),K=Symbol("consumeBody"),V=Symbol("consumeMeta"),N=Symbol("consumeHeader"),A=Symbol("consuming"),L=Symbol("bufferConcat"),j=Symbol("maybeEnd"),z=Symbol("writing"),D=Symbol("aborted"),d=Symbol("onDone"),m=Symbol("sawValidEntry"),_=Symbol("sawNullBlock"),R=Symbol("sawEOF"),E=Symbol("closeStream"),M=B=>!0;e.exports=r(class extends n{constructor(B){B=B||{},super(B),this.file=B.file||"",this[m]=null,this.on(d,Z=>{(this[h]==="begin"||this[m]===!1)&&this.warn("TAR_BAD_ARCHIVE","Unrecognized archive format")}),B.ondone?this.on(d,B.ondone):this.on(d,Z=>{this.emit("prefinish"),this.emit("finish"),this.emit("end")}),this.strict=!!B.strict,this.maxMetaEntrySize=B.maxMetaEntrySize||o,this.filter=typeof B.filter=="function"?B.filter:M,this.writable=!0,this.readable=!1,this[I]=new s,this[O]=null,this[g]=null,this[p]=null,this[h]="begin",this[C]="",this[x]=null,this[k]=null,this[w]=!1,this[H]=null,this[D]=!1,this[_]=!1,this[R]=!1,this.on("end",()=>this[E]()),typeof B.onwarn=="function"&&this.on("warn",B.onwarn),typeof B.onentry=="function"&&this.on("entry",B.onentry)}[N](B,Z){this[m]===null&&(this[m]=!1);let U;try{U=new i(B,Z,this[x],this[k])}catch(Q){return this.warn("TAR_ENTRY_INVALID",Q)}if(U.nullBlock)this[_]?(this[R]=!0,this[h]==="begin"&&(this[h]="header"),this[F]("eof")):(this[_]=!0,this[F]("nullBlock"));else if(this[_]=!1,!U.cksumValid)this.warn("TAR_ENTRY_INVALID","checksum failure",{header:U});else if(!U.path)this.warn("TAR_ENTRY_INVALID","path is required",{header:U});else{let Q=U.type;if(/^(Symbolic)?Link$/.test(Q)&&!U.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath required",{header:U});else if(!/^(Symbolic)?Link$/.test(Q)&&U.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath forbidden",{header:U});else{let G=this[p]=new a(U,this[x],this[k]);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[F]("ignoredEntry",G),this[h]="ignore",G.resume()):G.size>0&&(this[C]="",G.on("data",ie=>this[C]+=ie),this[h]="meta"):(this[x]=null,G.ignore=G.ignore||!this.filter(G.path,G),G.ignore?(this[F]("ignoredEntry",G),this[h]=G.remain?"ignore":"header",G.resume()):(G.remain?this[h]="body":(this[h]="header",G.end()),this[g]?this[I].push(G):(this[I].push(G),this[y]())))}}}[E](){u(()=>this.emit("close"))}[b](B){let Z=!0;return B?Array.isArray(B)?this.emit.apply(this,B):(this[g]=B,this.emit("entry",B),B.emittedEnd||(B.on("end",U=>this[y]()),Z=!1)):(this[g]=null,Z=!1),Z}[y](){do;while(this[b](this[I].shift()));if(!this[I].length){let B=this[g];!B||B.flowing||B.size===B.remain?this[z]||this.emit("drain"):B.once("drain",Z=>this.emit("drain"))}}[K](B,Z){let U=this[p],Q=U.blockRemain,G=Q>=B.length&&Z===0?B:B.slice(Z,Z+Q);return U.write(G),U.blockRemain||(this[h]="header",this[p]=null,U.end()),G.length}[V](B,Z){let U=this[p],Q=this[K](B,Z);return this[p]||this[T](U),Q}[F](B,Z,U){!this[I].length&&!this[g]?this.emit(B,Z,U):this[I].push([B,Z,U])}[T](B){switch(this[F]("meta",this[C]),B.type){case"ExtendedHeader":case"OldExtendedHeader":this[x]=l.parse(this[C],this[x],!1);break;case"GlobalExtendedHeader":this[k]=l.parse(this[C],this[k],!0);break;case"NextFileHasLongPath":case"OldGnuLongPath":this[x]=this[x]||Object.create(null),this[x].path=this[C].replace(/\0.*/,"");break;case"NextFileHasLongLinkpath":this[x]=this[x]||Object.create(null),this[x].linkpath=this[C].replace(/\0.*/,"");break;default:throw new Error("unknown meta: "+B.type)}}abort(B){this[D]=!0,this.emit("abort",B),this.warn("TAR_ABORT",B,{recoverable:!1})}write(B){if(this[D])return;if(this[H]===null&&B){if(this[O]&&(B=Buffer.concat([this[O],B]),this[O]=null),B.length<f.length)return this[O]=B,!0;for(let U=0;this[H]===null&&U<f.length;U++)B[U]!==f[U]&&(this[H]=!1);if(this[H]===null){let U=this[w];this[w]=!1,this[H]=new c.Unzip,this[H].on("data",G=>this[P](G)),this[H].on("error",G=>this.abort(G)),this[H].on("end",G=>{this[w]=!0,this[P]()}),this[z]=!0;let Q=this[H][U?"end":"write"](B);return this[z]=!1,Q}}this[z]=!0,this[H]?this[H].write(B):this[P](B),this[z]=!1;let Z=this[I].length?!1:this[g]?this[g].flowing:!0;return!Z&&!this[I].length&&this[g].once("drain",U=>this.emit("drain")),Z}[L](B){B&&!this[D]&&(this[O]=this[O]?Buffer.concat([this[O],B]):B)}[j](){if(this[w]&&!this[v]&&!this[D]&&!this[A]){this[v]=!0;let B=this[p];if(B&&B.blockRemain){let Z=this[O]?this[O].length:0;this.warn("TAR_BAD_ARCHIVE",`Truncated input (needed ${B.blockRemain} more bytes, only ${Z} available)`,{entry:B}),this[O]&&B.write(this[O]),B.end()}this[F](d)}}[P](B){if(this[A])this[L](B);else if(!B&&!this[O])this[j]();else{if(this[A]=!0,this[O]){this[L](B);let Z=this[O];this[O]=null,this[q](Z)}else this[q](B);for(;this[O]&&this[O].length>=512&&!this[D]&&!this[R];){let Z=this[O];this[O]=null,this[q](Z)}this[A]=!1}(!this[O]||this[w])&&this[j]()}[q](B){let Z=0,U=B.length;for(;Z+512<=U&&!this[D]&&!this[R];)switch(this[h]){case"begin":case"header":this[N](B,Z),Z+=512;break;case"ignore":case"body":Z+=this[K](B,Z);break;case"meta":Z+=this[V](B,Z);break;default:throw new Error("invalid state: "+this[h])}Z<U&&(this[O]?this[O]=Buffer.concat([B.slice(Z),this[O]]):this[O]=B.slice(Z))}end(B){this[D]||(this[H]?this[H].end(B):(this[w]=!0,this.write(B)))}})}),Hh=te((t,e)=>{"use strict";W();var r=Vn(),i=$h(),n=re("fs"),s=Qn(),o=re("path"),a=Jn();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 b=r(p);if(b.sync&&typeof y=="function")throw new TypeError("callback not supported for sync tar functions");if(!b.file&&typeof y=="function")throw new TypeError("callback only supported with file option");return g.length&&c(b,g),b.noResume||l(b),b.file&&b.sync?u(b):b.file?f(b,y):h(b)};var l=p=>{let g=p.onentry;p.onentry=g?y=>{g(y),y.resume()}:y=>y.resume()},c=(p,g)=>{let y=new Map(g.map(k=>[a(k),!0])),b=p.filter,x=(k,C)=>{let T=C||o.parse(k).root||".",O=k===T?!1:y.has(k)?y.get(k):x(o.dirname(k),T);return y.set(k,O),O};p.filter=b?(k,C)=>b(k,C)&&x(a(k)):k=>x(a(k))},u=p=>{let g=h(p),y=p.file,b=!0,x;try{let k=n.statSync(y),C=p.maxReadSize||16*1024*1024;if(k.size<C)g.end(n.readFileSync(y));else{let T=0,O=Buffer.allocUnsafe(C);for(x=n.openSync(y,"r");T<k.size;){let I=n.readSync(x,O,0,C,T);T+=I,g.write(O.slice(0,I))}g.end()}b=!1}finally{if(b&&x)try{n.closeSync(x)}catch{}}},f=(p,g)=>{let y=new i(p),b=p.maxReadSize||16*1024*1024,x=p.file,k=new Promise((C,T)=>{y.on("error",T),y.on("end",C),n.stat(x,(O,I)=>{if(O)T(O);else{let w=new s.ReadStream(x,{readSize:b,size:I.size});w.on("error",T),w.pipe(y)}})});return g?k.then(g,g):k},h=p=>new i(p)}),oP=te((t,e)=>{"use strict";W();var r=Vn(),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 b=r(p);if(b.sync&&typeof y=="function")throw new TypeError("callback not supported for sync tar functions");if(!b.file&&typeof y=="function")throw new TypeError("callback only supported with file option");return b.file&&b.sync?a(b,g):b.file?l(b,g,y):b.sync?f(b,g):h(b,g)};var a=(p,g)=>{let y=new i.Sync(p),b=new n.WriteStreamSync(p.file,{mode:p.mode||438});y.pipe(b),c(y,g)},l=(p,g,y)=>{let b=new i(p),x=new n.WriteStream(p.file,{mode:p.mode||438});b.pipe(x);let k=new Promise((C,T)=>{x.on("error",T),x.on("close",C),b.on("error",T)});return u(b,g),y?k.then(y,y):k},c=(p,g)=>{g.forEach(y=>{y.charAt(0)==="@"?s({file:o.resolve(p.cwd,y.slice(1)),sync:!0,noResume:!0,onentry:b=>p.add(b)}):p.add(y)}),p.end()},u=(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:b=>p.add(b)}).then(b=>u(p,g));p.add(y)}p.end()},f=(p,g)=>{let y=new i.Sync(p);return c(y,g),y},h=(p,g)=>{let y=new i(p);return u(y,g),y}}),nS=te((t,e)=>{"use strict";W();var r=Vn(),i=jh(),n=re("fs"),s=Qn(),o=Hh(),a=re("path"),l=Xn();e.exports=(g,y,b)=>{let x=r(g);if(!x.file)throw new TypeError("file is required");if(x.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),x.sync?c(x,y):f(x,y,b)};var c=(g,y)=>{let b=new i.Sync(g),x=!0,k,C;try{try{k=n.openSync(g.file,"r+")}catch(I){if(I.code==="ENOENT")k=n.openSync(g.file,"w+");else throw I}let T=n.fstatSync(k),O=Buffer.alloc(512);e:for(C=0;C<T.size;C+=512){for(let v=0,F=0;v<512;v+=F){if(F=n.readSync(k,O,v,O.length-v,C+v),C===0&&O[0]===31&&O[1]===139)throw new Error("cannot append to compressed archives");if(!F)break e}let I=new l(O);if(!I.cksumValid)break;let w=512*Math.ceil(I.size/512);if(C+w+512>T.size)break;C+=w,g.mtimeCache&&g.mtimeCache.set(I.path,I.mtime)}x=!1,u(g,b,C,k,y)}finally{if(x)try{n.closeSync(k)}catch{}}},u=(g,y,b,x,k)=>{let C=new s.WriteStreamSync(g.file,{fd:x,start:b});y.pipe(C),h(y,k)},f=(g,y,b)=>{y=Array.from(y);let x=new i(g),k=(T,O,I)=>{let w=(q,K)=>{q?n.close(T,V=>I(q)):I(null,K)},v=0;if(O===0)return w(null,0);let F=0,H=Buffer.alloc(512),P=(q,K)=>{if(q)return w(q);if(F+=K,F<512&&K)return n.read(T,H,F,H.length-F,v+F,P);if(v===0&&H[0]===31&&H[1]===139)return w(new Error("cannot append to compressed archives"));if(F<512)return w(null,v);let V=new l(H);if(!V.cksumValid)return w(null,v);let N=512*Math.ceil(V.size/512);if(v+N+512>O||(v+=N+512,v>=O))return w(null,v);g.mtimeCache&&g.mtimeCache.set(V.path,V.mtime),F=0,n.read(T,H,0,512,v,P)};n.read(T,H,0,512,v,P)},C=new Promise((T,O)=>{x.on("error",O);let I="r+",w=(v,F)=>{if(v&&v.code==="ENOENT"&&I==="r+")return I="w+",n.open(g.file,I,w);if(v)return O(v);n.fstat(F,(H,P)=>{if(H)return n.close(F,()=>O(H));k(F,P.size,(q,K)=>{if(q)return O(q);let V=new s.WriteStream(g.file,{fd:F,start:K});x.pipe(V),V.on("error",O),V.on("close",T),p(x,y)})})};n.open(g.file,I,w)});return b?C.then(b,b):C},h=(g,y)=>{y.forEach(b=>{b.charAt(0)==="@"?o({file:a.resolve(g.cwd,b.slice(1)),sync:!0,noResume:!0,onentry:x=>g.add(x)}):g.add(b)}),g.end()},p=(g,y)=>{for(;y.length;){let b=y.shift();if(b.charAt(0)==="@")return o({file:a.resolve(g.cwd,b.slice(1)),noResume:!0,onentry:x=>g.add(x)}).then(x=>p(g,y));g.add(b)}g.end()}}),aP=te((t,e)=>{"use strict";W();var r=Vn(),i=nS();e.exports=(s,o,a)=>{let l=r(s);if(!l.file)throw new TypeError("file is required");if(l.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(l),i(l,o,a)};var n=s=>{let o=s.filter;s.mtimeCache||(s.mtimeCache=new Map),s.filter=o?(a,l)=>o(a,l)&&!(s.mtimeCache.get(a)>l.mtime):(a,l)=>!(s.mtimeCache.get(a)>l.mtime)}}),lP=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}),cP=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:l}=n(o);if(a.test(o.substr(l.length)))throw Object.assign(new Error("Illegal characters in path."),{path:o,code:"EINVAL"})}return o};e.exports=s}),uP=te((t,e)=>{W();var{dirname:r}=re("path"),i=(s,o,a=void 0)=>a===o?Promise.resolve():s.statAsync(o).then(l=>l.isDirectory()?a:void 0,l=>l.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(l){return l.code==="ENOENT"?n(s,r(o),o):void 0}};e.exports={findMade:i,findMadeSync:n}}),sS=te((t,e)=>{W();var{dirname:r}=re("path"),i=(s,o,a)=>{o.recursive=!1;let l=r(s);return l===s?o.mkdirAsync(s,o).catch(c=>{if(c.code!=="EISDIR")throw c}):o.mkdirAsync(s,o).then(()=>a||s,c=>{if(c.code==="ENOENT")return i(l,o).then(u=>i(s,o,u));if(c.code!=="EEXIST"&&c.code!=="EROFS")throw c;return o.statAsync(s).then(u=>{if(u.isDirectory())return a;throw c},()=>{throw c})})},n=(s,o,a)=>{let l=r(s);if(o.recursive=!1,l===s)try{return o.mkdirSync(s,o)}catch(c){if(c.code!=="EISDIR")throw c;return}try{return o.mkdirSync(s,o),a||s}catch(c){if(c.code==="ENOENT")return n(s,o,n(l,o,a));if(c.code!=="EEXIST"&&c.code!=="EROFS")throw c;try{if(!o.statSync(s).isDirectory())throw c}catch{throw c}}};e.exports={mkdirpManual:i,mkdirpManualSync:n}}),hP=te((t,e)=>{W();var{dirname:r}=re("path"),{findMade:i,findMadeSync:n}=uP(),{mkdirpManual:s,mkdirpManualSync:o}=sS(),a=(c,u)=>(u.recursive=!0,r(c)===c?u.mkdirAsync(c,u):i(u,c).then(f=>u.mkdirAsync(c,u).then(()=>f).catch(h=>{if(h.code==="ENOENT")return s(c,u);throw h}))),l=(c,u)=>{if(u.recursive=!0,r(c)===c)return u.mkdirSync(c,u);let f=n(u,c);try{return u.mkdirSync(c,u),f}catch(h){if(h.code==="ENOENT")return o(c,u);throw h}};e.exports={mkdirpNative:a,mkdirpNativeSync:l}}),fP=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?l=>l.mkdir===r.mkdir:()=>!1,a=s?l=>l.mkdirSync===r.mkdirSync:()=>!1;e.exports={useNative:o,useNativeSync:a}}),pP=te((t,e)=>{W();var r=lP(),i=cP(),{mkdirpNative:n,mkdirpNativeSync:s}=hP(),{mkdirpManual:o,mkdirpManualSync:a}=sS(),{useNative:l,useNativeSync:c}=fP(),u=(h,p)=>(h=i(h),p=r(p),l(p)?n(h,p):o(h,p)),f=(h,p)=>(h=i(h),p=r(p),c(p)?s(h,p):a(h,p));u.sync=f,u.native=(h,p)=>n(i(h),r(p)),u.manual=(h,p)=>o(i(h),r(p)),u.nativeSync=(h,p)=>s(i(h),r(p)),u.manualSync=(h,p)=>a(i(h),r(p)),e.exports=u}),dP=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=(C,T,O)=>{try{return r[s](C,T,O)}catch(I){if(I.code!=="ENOENT")throw I}},l=(C,T,O)=>{try{return r.chownSync(C,T,O)}catch(I){if(I.code!=="ENOENT")throw I}},c=o?(C,T,O,I)=>w=>{!w||w.code!=="EISDIR"?I(w):r.chown(C,T,O,I)}:(C,T,O,I)=>I,u=o?(C,T,O)=>{try{return a(C,T,O)}catch(I){if(I.code!=="EISDIR")throw I;l(C,T,O)}}:(C,T,O)=>a(C,T,O),f=process.version,h=(C,T,O)=>r.readdir(C,T,O),p=(C,T)=>r.readdirSync(C,T);/^v4\./.test(f)&&(h=(C,T,O)=>r.readdir(C,O));var g=(C,T,O,I)=>{r[n](C,T,O,c(C,T,O,w=>{I(w&&w.code!=="ENOENT"?w:null)}))},y=(C,T,O,I,w)=>{if(typeof T=="string")return r.lstat(i.resolve(C,T),(v,F)=>{if(v)return w(v.code!=="ENOENT"?v:null);F.name=T,y(C,F,O,I,w)});if(T.isDirectory())b(i.resolve(C,T.name),O,I,v=>{if(v)return w(v);let F=i.resolve(C,T.name);g(F,O,I,w)});else{let v=i.resolve(C,T.name);g(v,O,I,w)}},b=(C,T,O,I)=>{h(C,{withFileTypes:!0},(w,v)=>{if(w){if(w.code==="ENOENT")return I();if(w.code!=="ENOTDIR"&&w.code!=="ENOTSUP")return I(w)}if(w||!v.length)return g(C,T,O,I);let F=v.length,H=null,P=q=>{if(!H){if(q)return I(H=q);if(--F===0)return g(C,T,O,I)}};v.forEach(q=>y(C,q,T,O,P))})},x=(C,T,O,I)=>{if(typeof T=="string")try{let w=r.lstatSync(i.resolve(C,T));w.name=T,T=w}catch(w){if(w.code==="ENOENT")return;throw w}T.isDirectory()&&k(i.resolve(C,T.name),O,I),u(i.resolve(C,T.name),O,I)},k=(C,T,O)=>{let I;try{I=p(C,{withFileTypes:!0})}catch(w){if(w.code==="ENOENT")return;if(w.code==="ENOTDIR"||w.code==="ENOTSUP")return u(C,T,O);throw w}return I&&I.length&&I.forEach(w=>x(C,w,T,O)),u(C,T,O)};e.exports=b,b.sync=k}),mP=te((t,e)=>{"use strict";W();var r=pP(),i=re("fs"),n=re("path"),s=dP(),o=Zn(),a=class extends Error{constructor(y,b){super("Cannot extract through symbolic link"),this.path=b,this.symlink=y}get name(){return"SylinkError"}},l=class extends Error{constructor(y,b){super(b+": Cannot cd into '"+y+"'"),this.path=y,this.code=b}get name(){return"CwdError"}},c=(y,b)=>y.get(o(b)),u=(y,b,x)=>y.set(o(b),x),f=(y,b)=>{i.stat(y,(x,k)=>{(x||!k.isDirectory())&&(x=new l(y,x&&x.code||"ENOTDIR")),b(x)})};e.exports=(y,b,x)=>{y=o(y);let k=b.umask,C=b.mode|448,T=(C&k)!==0,O=b.uid,I=b.gid,w=typeof O=="number"&&typeof I=="number"&&(O!==b.processUid||I!==b.processGid),v=b.preserve,F=b.unlink,H=b.cache,P=o(b.cwd),q=(V,N)=>{V?x(V):(u(H,y,!0),N&&w?s(N,O,I,A=>q(A)):T?i.chmod(y,C,x):x())};if(H&&c(H,y)===!0)return q();if(y===P)return f(y,q);if(v)return r(y,{mode:C}).then(V=>q(null,V),q);let K=o(n.relative(P,y)).split("/");h(P,K,C,H,F,P,null,q)};var h=(y,b,x,k,C,T,O,I)=>{if(!b.length)return I(null,O);let w=b.shift(),v=o(n.resolve(y+"/"+w));if(c(k,v))return h(v,b,x,k,C,T,O,I);i.mkdir(v,x,p(v,b,x,k,C,T,O,I))},p=(y,b,x,k,C,T,O,I)=>w=>{w?i.lstat(y,(v,F)=>{if(v)v.path=v.path&&o(v.path),I(v);else if(F.isDirectory())h(y,b,x,k,C,T,O,I);else if(C)i.unlink(y,H=>{if(H)return I(H);i.mkdir(y,x,p(y,b,x,k,C,T,O,I))});else{if(F.isSymbolicLink())return I(new a(y,y+"/"+b.join("/")));I(w)}}):(O=O||y,h(y,b,x,k,C,T,O,I))},g=y=>{let b=!1,x="ENOTDIR";try{b=i.statSync(y).isDirectory()}catch(k){x=k.code}finally{if(!b)throw new l(y,x)}};e.exports.sync=(y,b)=>{y=o(y);let x=b.umask,k=b.mode|448,C=(k&x)!==0,T=b.uid,O=b.gid,I=typeof T=="number"&&typeof O=="number"&&(T!==b.processUid||O!==b.processGid),w=b.preserve,v=b.unlink,F=b.cache,H=o(b.cwd),P=V=>{u(F,y,!0),V&&I&&s.sync(V,T,O),C&&i.chmodSync(y,k)};if(F&&c(F,y)===!0)return P();if(y===H)return g(H),P();if(w)return P(r.sync(y,k));let q=o(n.relative(H,y)).split("/"),K=null;for(let V=q.shift(),N=H;V&&(N+="/"+V);V=q.shift())if(N=o(n.resolve(N)),!c(F,N))try{i.mkdirSync(N,k),K=K||N,u(F,N,!0)}catch{let A=i.lstatSync(N);if(A.isDirectory()){u(F,N,!0);continue}else if(v){i.unlinkSync(N),i.mkdirSync(N,k),K=K||N,u(F,N,!0);continue}else if(A.isSymbolicLink())return new a(N,N+"/"+q.join("/"))}return P(K)}}),oS=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])}),gP=te((t,e)=>{W();var r=re("assert"),i=oS(),n=Jn(),{join:s}=re("path"),o=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,a=o==="win32";e.exports=()=>{let l=new Map,c=new Map,u=b=>b.split("/").slice(0,-1).reduce((x,k)=>(x.length&&(k=s(x[x.length-1],k)),x.push(k||"/"),x),[]),f=new Set,h=b=>{let x=c.get(b);if(!x)throw new Error("function does not have any path reservations");return{paths:x.paths.map(k=>l.get(k)),dirs:[...x.dirs].map(k=>l.get(k))}},p=b=>{let{paths:x,dirs:k}=h(b);return x.every(C=>C[0]===b)&&k.every(C=>C[0]instanceof Set&&C[0].has(b))},g=b=>f.has(b)||!p(b)?!1:(f.add(b),b(()=>y(b)),!0),y=b=>{if(!f.has(b))return!1;let{paths:x,dirs:k}=c.get(b),C=new Set;return x.forEach(T=>{let O=l.get(T);r.equal(O[0],b),O.length===1?l.delete(T):(O.shift(),typeof O[0]=="function"?C.add(O[0]):O[0].forEach(I=>C.add(I)))}),k.forEach(T=>{let O=l.get(T);r(O[0]instanceof Set),O[0].size===1&&O.length===1?l.delete(T):O[0].size===1?(O.shift(),C.add(O[0])):O[0].delete(b)}),f.delete(b),C.forEach(T=>g(T)),!0};return{check:p,reserve:(b,x)=>{b=a?["win32 parallelization disabled"]:b.map(C=>i(n(s(C))).toLowerCase());let k=new Set(b.map(C=>u(C)).reduce((C,T)=>C.concat(T)));return c.set(x,{dirs:k,paths:b}),b.forEach(C=>{let T=l.get(C);T?T.push(x):l.set(C,[x])}),k.forEach(C=>{let T=l.get(C);T?T[T.length-1]instanceof Set?T[T.length-1].add(x):T.push(new Set([x])):l.set(C,[new Set([x])])}),g(x)}}}}),yP=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:l=0}=n.constants,c=i&&!!l,u=512*1024,f=l|o|s|a;e.exports=c?h=>h<u?f:"w":()=>"w"}),aS=te((t,e)=>{"use strict";W();var r=re("assert"),i=$h(),n=re("fs"),s=Qn(),o=re("path"),a=mP(),l=eS(),c=gP(),u=tS(),f=Zn(),h=Jn(),p=oS(),g=Symbol("onEntry"),y=Symbol("checkFs"),b=Symbol("checkFs2"),x=Symbol("pruneCache"),k=Symbol("isReusable"),C=Symbol("makeFs"),T=Symbol("file"),O=Symbol("directory"),I=Symbol("link"),w=Symbol("symlink"),v=Symbol("hardlink"),F=Symbol("unsupported"),H=Symbol("checkPath"),P=Symbol("mkdir"),q=Symbol("onError"),K=Symbol("pending"),V=Symbol("pend"),N=Symbol("unpend"),A=Symbol("ended"),L=Symbol("maybeClose"),j=Symbol("skip"),z=Symbol("doChown"),D=Symbol("uid"),d=Symbol("gid"),m=Symbol("checkedCwd"),_=re("crypto"),R=yP(),E=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,M=E==="win32",B=(S,Y)=>{if(!M)return n.unlink(S,Y);let J=S+".DELETE."+_.randomBytes(16).toString("hex");n.rename(S,J,oe=>{if(oe)return Y(oe);n.unlink(J,Y)})},Z=S=>{if(!M)return n.unlinkSync(S);let Y=S+".DELETE."+_.randomBytes(16).toString("hex");n.renameSync(S,Y),n.unlinkSync(Y)},U=(S,Y,J)=>S===S>>>0?S:Y===Y>>>0?Y:J,Q=S=>p(h(f(S))).toLowerCase(),G=(S,Y)=>{Y=Q(Y);for(let J of S.keys()){let oe=Q(J);(oe===Y||oe.indexOf(Y+"/")===0)&&S.delete(J)}},ie=S=>{for(let Y of S.keys())S.delete(Y)},ue=class extends i{constructor(S){if(S||(S={}),S.ondone=Y=>{this[A]=!0,this[L]()},super(S),this[m]=!1,this.reservations=c(),this.transform=typeof S.transform=="function"?S.transform:null,this.writable=!0,this.readable=!1,this[K]=0,this[A]=!1,this.dirCache=S.dirCache||new Map,typeof S.uid=="number"||typeof S.gid=="number"){if(typeof S.uid!="number"||typeof S.gid!="number")throw new TypeError("cannot set owner without number uid and gid");if(S.preserveOwner)throw new TypeError("cannot preserve owner in archive and also set owner explicitly");this.uid=S.uid,this.gid=S.gid,this.setOwner=!0}else this.uid=null,this.gid=null,this.setOwner=!1;S.preserveOwner===void 0&&typeof S.uid!="number"?this.preserveOwner=process.getuid&&process.getuid()===0:this.preserveOwner=!!S.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=S.forceChown===!0,this.win32=!!S.win32||M,this.newer=!!S.newer,this.keep=!!S.keep,this.noMtime=!!S.noMtime,this.preservePaths=!!S.preservePaths,this.unlink=!!S.unlink,this.cwd=f(o.resolve(S.cwd||process.cwd())),this.strip=+S.strip||0,this.processUmask=S.noChmod?0:process.umask(),this.umask=typeof S.umask=="number"?S.umask:this.processUmask,this.dmode=S.dmode||511&~this.umask,this.fmode=S.fmode||438&~this.umask,this.on("entry",Y=>this[g](Y))}warn(S,Y,J={}){return(S==="TAR_BAD_ARCHIVE"||S==="TAR_ABORT")&&(J.recoverable=!1),super.warn(S,Y,J)}[L](){this[A]&&this[K]===0&&(this.emit("prefinish"),this.emit("finish"),this.emit("end"))}[H](S){if(this.strip){let Y=f(S.path).split("/");if(Y.length<this.strip)return!1;if(S.path=Y.slice(this.strip).join("/"),S.type==="Link"){let J=f(S.linkpath).split("/");if(J.length>=this.strip)S.linkpath=J.slice(this.strip).join("/");else return!1}}if(!this.preservePaths){let Y=f(S.path),J=Y.split("/");if(J.includes("..")||M&&/^[a-z]:\.\.$/i.test(J[0]))return this.warn("TAR_ENTRY_ERROR","path contains '..'",{entry:S,path:Y}),!1;let[oe,ce]=u(Y);oe&&(S.path=ce,this.warn("TAR_ENTRY_INFO",`stripping ${oe} from absolute path`,{entry:S,path:Y}))}if(o.isAbsolute(S.path)?S.absolute=f(o.resolve(S.path)):S.absolute=f(o.resolve(this.cwd,S.path)),!this.preservePaths&&S.absolute.indexOf(this.cwd+"/")!==0&&S.absolute!==this.cwd)return this.warn("TAR_ENTRY_ERROR","path escaped extraction target",{entry:S,path:f(S.path),resolvedPath:S.absolute,cwd:this.cwd}),!1;if(S.absolute===this.cwd&&S.type!=="Directory"&&S.type!=="GNUDumpDir")return!1;if(this.win32){let{root:Y}=o.win32.parse(S.absolute);S.absolute=Y+l.encode(S.absolute.slice(Y.length));let{root:J}=o.win32.parse(S.path);S.path=J+l.encode(S.path.slice(J.length))}return!0}[g](S){if(!this[H](S))return S.resume();switch(r.equal(typeof S.absolute,"string"),S.type){case"Directory":case"GNUDumpDir":S.mode&&(S.mode=S.mode|448);case"File":case"OldFile":case"ContiguousFile":case"Link":case"SymbolicLink":return this[y](S);case"CharacterDevice":case"BlockDevice":case"FIFO":default:return this[F](S)}}[q](S,Y){S.name==="CwdError"?this.emit("error",S):(this.warn("TAR_ENTRY_ERROR",S,{entry:Y}),this[N](),Y.resume())}[P](S,Y,J){a(f(S),{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},J)}[z](S){return this.forceChown||this.preserveOwner&&(typeof S.uid=="number"&&S.uid!==this.processUid||typeof S.gid=="number"&&S.gid!==this.processGid)||typeof this.uid=="number"&&this.uid!==this.processUid||typeof this.gid=="number"&&this.gid!==this.processGid}[D](S){return U(this.uid,S.uid,this.processUid)}[d](S){return U(this.gid,S.gid,this.processGid)}[T](S,Y){let J=S.mode&4095||this.fmode,oe=new s.WriteStream(S.absolute,{flags:R(S.size),mode:J,autoClose:!1});oe.on("error",pe=>{oe.fd&&n.close(oe.fd,()=>{}),oe.write=()=>!0,this[q](pe,S),Y()});let ce=1,be=pe=>{if(pe){oe.fd&&n.close(oe.fd,()=>{}),this[q](pe,S),Y();return}--ce===0&&n.close(oe.fd,Re=>{Re?this[q](Re,S):this[N](),Y()})};oe.on("finish",pe=>{let Re=S.absolute,ht=oe.fd;if(S.mtime&&!this.noMtime){ce++;let ft=S.atime||new Date,ln=S.mtime;n.futimes(ht,ft,ln,cn=>cn?n.utimes(Re,ft,ln,wa=>be(wa&&cn)):be())}if(this[z](S)){ce++;let ft=this[D](S),ln=this[d](S);n.fchown(ht,ft,ln,cn=>cn?n.chown(Re,ft,ln,wa=>be(wa&&cn)):be())}be()});let he=this.transform&&this.transform(S)||S;he!==S&&(he.on("error",pe=>{this[q](pe,S),Y()}),S.pipe(he)),he.pipe(oe)}[O](S,Y){let J=S.mode&4095||this.dmode;this[P](S.absolute,J,oe=>{if(oe){this[q](oe,S),Y();return}let ce=1,be=he=>{--ce===0&&(Y(),this[N](),S.resume())};S.mtime&&!this.noMtime&&(ce++,n.utimes(S.absolute,S.atime||new Date,S.mtime,be)),this[z](S)&&(ce++,n.chown(S.absolute,this[D](S),this[d](S),be)),be()})}[F](S){S.unsupported=!0,this.warn("TAR_ENTRY_UNSUPPORTED",`unsupported entry type: ${S.type}`,{entry:S}),S.resume()}[w](S,Y){this[I](S,S.linkpath,"symlink",Y)}[v](S,Y){let J=f(o.resolve(this.cwd,S.linkpath));this[I](S,J,"link",Y)}[V](){this[K]++}[N](){this[K]--,this[L]()}[j](S){this[N](),S.resume()}[k](S,Y){return S.type==="File"&&!this.unlink&&Y.isFile()&&Y.nlink<=1&&!M}[y](S){this[V]();let Y=[S.path];S.linkpath&&Y.push(S.linkpath),this.reservations.reserve(Y,J=>this[b](S,J))}[x](S){S.type==="SymbolicLink"?ie(this.dirCache):S.type!=="Directory"&&G(this.dirCache,S.absolute)}[b](S,Y){this[x](S);let J=he=>{this[x](S),Y(he)},oe=()=>{this[P](this.cwd,this.dmode,he=>{if(he){this[q](he,S),J();return}this[m]=!0,ce()})},ce=()=>{if(S.absolute!==this.cwd){let he=f(o.dirname(S.absolute));if(he!==this.cwd)return this[P](he,this.dmode,pe=>{if(pe){this[q](pe,S),J();return}be()})}be()},be=()=>{n.lstat(S.absolute,(he,pe)=>{if(pe&&(this.keep||this.newer&&pe.mtime>S.mtime)){this[j](S),J();return}if(he||this[k](S,pe))return this[C](null,S,J);if(pe.isDirectory()){if(S.type==="Directory"){let Re=!this.noChmod&&S.mode&&(pe.mode&4095)!==S.mode,ht=ft=>this[C](ft,S,J);return Re?n.chmod(S.absolute,S.mode,ht):ht()}if(S.absolute!==this.cwd)return n.rmdir(S.absolute,Re=>this[C](Re,S,J))}if(S.absolute===this.cwd)return this[C](null,S,J);B(S.absolute,Re=>this[C](Re,S,J))})};this[m]?ce():oe()}[C](S,Y,J){if(S){this[q](S,Y),J();return}switch(Y.type){case"File":case"OldFile":case"ContiguousFile":return this[T](Y,J);case"Link":return this[v](Y,J);case"SymbolicLink":return this[w](Y,J);case"Directory":case"GNUDumpDir":return this[O](Y,J)}}[I](S,Y,J,oe){n[J](Y,S.absolute,ce=>{ce?this[q](ce,S):(this[N](),S.resume()),oe()})}},Ee=S=>{try{return[null,S()]}catch(Y){return[Y,null]}},_e=class extends ue{[C](S,Y){return super[C](S,Y,()=>{})}[y](S){if(this[x](S),!this[m]){let ce=this[P](this.cwd,this.dmode);if(ce)return this[q](ce,S);this[m]=!0}if(S.absolute!==this.cwd){let ce=f(o.dirname(S.absolute));if(ce!==this.cwd){let be=this[P](ce,this.dmode);if(be)return this[q](be,S)}}let[Y,J]=Ee(()=>n.lstatSync(S.absolute));if(J&&(this.keep||this.newer&&J.mtime>S.mtime))return this[j](S);if(Y||this[k](S,J))return this[C](null,S);if(J.isDirectory()){if(S.type==="Directory"){let be=!this.noChmod&&S.mode&&(J.mode&4095)!==S.mode,[he]=be?Ee(()=>{n.chmodSync(S.absolute,S.mode)}):[];return this[C](he,S)}let[ce]=Ee(()=>n.rmdirSync(S.absolute));this[C](ce,S)}let[oe]=S.absolute===this.cwd?[]:Ee(()=>Z(S.absolute));this[C](oe,S)}[T](S,Y){let J=S.mode&4095||this.fmode,oe=he=>{let pe;try{n.closeSync(ce)}catch(Re){pe=Re}(he||pe)&&this[q](he||pe,S),Y()},ce;try{ce=n.openSync(S.absolute,R(S.size),J)}catch(he){return oe(he)}let be=this.transform&&this.transform(S)||S;be!==S&&(be.on("error",he=>this[q](he,S)),S.pipe(be)),be.on("data",he=>{try{n.writeSync(ce,he,0,he.length)}catch(pe){oe(pe)}}),be.on("end",he=>{let pe=null;if(S.mtime&&!this.noMtime){let Re=S.atime||new Date,ht=S.mtime;try{n.futimesSync(ce,Re,ht)}catch(ft){try{n.utimesSync(S.absolute,Re,ht)}catch{pe=ft}}}if(this[z](S)){let Re=this[D](S),ht=this[d](S);try{n.fchownSync(ce,Re,ht)}catch(ft){try{n.chownSync(S.absolute,Re,ht)}catch{pe=pe||ft}}}oe(pe)})}[O](S,Y){let J=S.mode&4095||this.dmode,oe=this[P](S.absolute,J);if(oe){this[q](oe,S),Y();return}if(S.mtime&&!this.noMtime)try{n.utimesSync(S.absolute,S.atime||new Date,S.mtime)}catch{}if(this[z](S))try{n.chownSync(S.absolute,this[D](S),this[d](S))}catch{}Y(),S.resume()}[P](S,Y){try{return a.sync(f(S),{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(J){return J}}[I](S,Y,J,oe){try{n[J+"Sync"](Y,S.absolute),oe(),S.resume()}catch(ce){return this[q](ce,S)}}};ue.Sync=_e,e.exports=ue}),bP=te((t,e)=>{"use strict";W();var r=Vn(),i=aS(),n=re("fs"),s=Qn(),o=re("path"),a=Jn();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 b=r(p);if(b.sync&&typeof y=="function")throw new TypeError("callback not supported for sync tar functions");if(!b.file&&typeof y=="function")throw new TypeError("callback only supported with file option");return g.length&&l(b,g),b.file&&b.sync?c(b):b.file?u(b,y):b.sync?f(b):h(b)};var l=(p,g)=>{let y=new Map(g.map(k=>[a(k),!0])),b=p.filter,x=(k,C)=>{let T=C||o.parse(k).root||".",O=k===T?!1:y.has(k)?y.get(k):x(o.dirname(k),T);return y.set(k,O),O};p.filter=b?(k,C)=>b(k,C)&&x(a(k)):k=>x(a(k))},c=p=>{let g=new i.Sync(p),y=p.file,b=n.statSync(y),x=p.maxReadSize||16*1024*1024;new s.ReadStreamSync(y,{readSize:x,size:b.size}).pipe(g)},u=(p,g)=>{let y=new i(p),b=p.maxReadSize||16*1024*1024,x=p.file,k=new Promise((C,T)=>{y.on("error",T),y.on("close",C),n.stat(x,(O,I)=>{if(O)T(O);else{let w=new s.ReadStream(x,{readSize:b,size:I.size});w.on("error",T),w.pipe(y)}})});return g?k.then(g,g):k},f=p=>new i.Sync(p),h=p=>new i(p)}),_P=te(t=>{"use strict";W(),t.c=t.create=oP(),t.r=t.replace=nS(),t.t=t.list=Hh(),t.u=t.update=aP(),t.x=t.extract=bP(),t.Pack=jh(),t.Unpack=aS(),t.Parse=$h(),t.ReadEntry=Mh(),t.WriteEntry=rS(),t.Header=Xn(),t.Pax=Fh(),t.types=Qw()}),wP=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],l=a.message,c=(i[l]||0)+1;i[l]=c,c>=s&&(n=a,s=c)}return n}}),SP=te(t=>{W();var e=wP();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,l){return a-l}),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],l=r[a];r[a]=function(c){var u=t.operation(i),f=Array.prototype.slice.call(arguments,1),h=f.pop();f.push(function(p){u.retry(p)||(p&&(arguments[0]=u.mainError()),h.apply(this,arguments))}),u.attempt(function(){c.apply(r,f)})}.bind(r,l),r[a].options=i}}}),EP=te((t,e)=>{W(),e.exports=SP()}),vP=te((t,e)=>{W();var r=EP();function i(n,s){function o(a,l){var c=s||{},u;"randomize"in c||(c.randomize=!0),u=r.operation(c);function f(g){l(g||new Error("Aborted"))}function h(g,y){if(g.bail){f(g);return}u.retry(g)?c.onRetry&&c.onRetry(g,y):l(u.mainError())}function p(g){var y;try{y=n(f,g)}catch(b){h(b,g);return}Promise.resolve(y).then(a).catch(function(b){h(b,g)})}u.attempt(p)}return new Promise(o)}e.exports=i}),RP={};zL(RP,{bold:()=>kP,dimmed:()=>LP,error:()=>DP,grey:()=>PP,info:()=>TP,item:()=>IP,log:()=>si,turboBlue:()=>tn,turboGradient:()=>AP,turboLoader:()=>OP,turboRed:()=>fS,underline:()=>CP,warn:()=>NP,yellow:()=>pS});W();var uS="#0099F7",hS="#F11712",xP="#FFFF00",AP=(0,cS.default)(uS,hS),tn=Cr.default.hex(uS),fS=Cr.default.hex(hS),pS=Cr.default.hex(xP),OP=t=>(0,lS.default)({text:t,spinner:{frames:[" ",tn("> "),tn(">> "),tn(">>>")]}}),TP=(...t)=>{si(tn.bold(">>>"),...t)},kP=(...t)=>{si(Cr.default.bold(...t))},CP=(...t)=>{si(Cr.default.underline(...t))},LP=(...t)=>{si(Cr.default.dim(...t))},PP=(...t)=>{si(Cr.default.grey(...t))},IP=(...t)=>{si(tn.bold(" \u2022"),...t)},si=(...t)=>{console.log(...t)},NP=(...t)=>{console.error(pS.bold(">>>"),...t)},DP=(...t)=>{console.error(fS.bold(">>>"),...t)};W();W();W();W();var JF=oa(VL());W();W();function FP(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}W();W();function Ph(t){return Ph=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},Ph(t)}W();function BP(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function jP(t,e){if(e&&(Ph(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return BP(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 $P(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 HP(t){return Function.toString.call(t).indexOf("[native code]")!==-1}W();W();function UP(){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 UP()?na=Reflect.construct.bind():na=function(i,n,s){var o=[null];o.push.apply(o,n);var a=Function.bind.apply(i,o),l=new a;return s&&Wn(l,s.prototype),l},na.apply(null,arguments)}function Ih(t){var e=typeof Map=="function"?new Map:void 0;return Ih=function(r){if(r===null||!HP(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)},Ih(t)}var QF=oa(tP()),rB=function(t){$P(e,t);function e(r){var i;return FP(this,e),i=jP(this,sa(e).call(this,"No package.json could be found upwards from the directory ".concat(r))),i.directory=r,i}return e}(Ih(Error));W();W();W();W();W();W();var pB=oa(_P()),dB=(0,mS.promisify)(dS.Stream.pipeline);W();W();var bB=oa(vP());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 qP=/^(?!_)(?<manager>.+)@(?<version>.+)$/;function Ve({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}=Ve({workspaceRoot:t});if(e)try{let r=qP.exec(e);if(r){let[i,n]=r;return n}}catch{}}function es({workspaceRoot:t}){let e=Ve({workspaceRoot:t}),r=rr.default.basename(t),{name:i=r,description:n}=e;return{name:i,description:n}}function Kw({workspaceRoot:t}){let e=rr.default.join(t,"pnpm-workspace.yaml");if((0,rt.existsSync)(e))try{let r=qa.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 la({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 Uh({workspaces:t}){var e;return t?Array.isArray(t)?t:"packages"in t?(e=t.packages)!=null?e:[]:[]:[]}function ca({workspaceRoot:t,workspaceGlobs:e}){return e?e.flatMap(r=>{let i=[`${r}/package.json`];return(0,SS.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 GP({directory:t}){let e=rr.default.resolve(process.cwd(),t);return{exists:(0,rt.existsSync)(e),absolute:e}}function Lr({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 zP({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 ES({project:t,options:e}){if(!(e!=null&&e.dry)&&(0,rt.existsSync)(t.paths.lockfile))try{let{stdout:r}=await(0,wS.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 WP({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 Tr({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=Ve({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}=WP({dependencyList:h,project:t,to:r});s[f]=g,o[f]=p}});let l=f=>{let h=o[f].length;if(h>0)return`${_S.default.green(h.toString())} ${f}`},c=a.map(l).filter(Boolean),u=`./${yS.default.relative(t.paths.root,e.paths.packageJson)}`;if(c.length>=1){let f="updating";c.forEach((h,p)=>{c.length===1?f+=` ${h} in ${u}`:p===c.length-1?f+=`and ${h} in ${u}`:f+=` ${h}, `}),i.workspaceStep(f)}else i.workspaceStep(`no workspace dependencies found in ${u}`);n!=null&&n.dry||(0,bS.writeJSONSync)(e.paths.packageJson,s,{spaces:2})}var kr={name:"pnpm",lock:"pnpm-lock.yaml"};async function vS(t){let e=ii.default.join(t.workspaceRoot,kr.lock),r=ii.default.join(t.workspaceRoot,"pnpm-workspace.yaml"),i=aa({workspaceRoot:t.workspaceRoot});return(0,Ue.existsSync)(e)||(0,Ue.existsSync)(r)||i===kr.name}async function YP(t){if(!await vS(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:kr.name,paths:la({root:t.workspaceRoot,lockFile:kr.lock,workspaceConfig:"pnpm-workspace.yaml"}),workspaceData:{globs:Kw(t),workspaces:ca({workspaceGlobs:Kw(t),...t})}}}async function KP(t){let{project:e,to:r,logger:i,options:n}=t,s=e.workspaceData.globs.length>0;i.mainStep(Lr({action:"create",packageManager:kr.name,project:e}));let o=Ve({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,Ue.writeJSONSync)(e.paths.packageJson,o,{spaces:2}),s&&(i.rootStep('adding "pnpm-workspace.yaml"'),(0,Ue.writeFileSync)(ii.default.join(e.paths.root,"pnpm-workspace.yaml"),`packages:
43
43
  ${e.workspaceData.globs.map(a=>` - "${a}"`).join(`
44
44
  `)}`))),s&&(Tr({workspace:{name:"root",paths:e.paths},project:e,to:r,logger:i,options:n}),i.workspaceHeader(),e.workspaceData.workspaces.forEach(a=>{Tr({workspace:a,project:e,to:r,logger:i,options:n})}))}async function VP(t){let{project:e,logger:r,options:i}=t,n=e.workspaceData.globs.length>0;r.mainStep(Lr({action:"remove",packageManager:kr.name,project:e}));let s=Ve({workspaceRoot:e.paths.root});if(e.paths.workspaceConfig&&n&&(r.subStep('removing "pnpm-workspace.yaml"'),i!=null&&i.dry||(0,Ue.rmSync)(e.paths.workspaceConfig,{force:!0})),r.subStep(`removing "packageManager" field in ${e.name} root "package.json"`),delete s.packageManager,!(i!=null&&i.dry)){(0,Ue.writeJSONSync)(e.paths.packageJson,s,{spaces:2});let o=[e.paths.nodeModules,...e.workspaceData.workspaces.map(a=>a.paths.nodeModules)];try{r.subStep('removing "node_modules"'),await Promise.all(o.map(a=>(0,Ue.rm)(a,{recursive:!0,force:!0})))}catch{throw new je("Failed to remove node_modules",{type:"error_removing_node_modules"})}}}async function ZP(t){let{project:e,logger:r,options:i}=t;r.subStep(`removing ${ii.default.relative(e.paths.root,e.paths.lockfile)}`),i!=null&&i.dry||(0,Ue.rmSync)(e.paths.lockfile,{force:!0})}async function XP(t){let{project:e,options:r,logger:i}=t,n=()=>{i.subStep(`converting ${ii.default.relative(e.paths.root,e.paths.lockfile)} to ${kr.lock}`)},s=async()=>{if(!(r!=null&&r.dry)&&(0,Ue.existsSync)(e.paths.lockfile))try{await(0,gS.default)(kr.name,["import"],{stdio:"ignore",cwd:e.paths.root})}catch{}finally{tr({project:e,options:r})}};switch(e.packageManager){case"pnpm":break;case"bun":n(),await ES({project:e,options:r}),await s(),(0,Ue.rmSync)(ii.default.join(e.paths.root,"yarn.lock"),{force:!0});break;case"npm":n(),await s();break;case"yarn":n(),await s();break}}var JP={detect:vS,read:YP,create:KP,remove:VP,clean:ZP,convertLock:XP};W();var rn={name:"npm",lock:"package-lock.json"};async function RS(t){let e=Yn.default.join(t.workspaceRoot,rn.lock),r=aa({workspaceRoot:t.workspaceRoot});return(0,Pt.existsSync)(e)||r===rn.name}async function QP(t){if(!await RS(t))throw new je("Not an npm project",{type:"package_manager-unexpected"});let e=Ve(t),{name:r,description:i}=es(t),n=Uh({workspaces:e.workspaces});return{name:r,description:i,packageManager:rn.name,paths:la({root:t.workspaceRoot,lockFile:rn.lock}),workspaceData:{globs:n,workspaces:ca({workspaceGlobs:n,...t})}}}async function eI(t){let{project:e,options:r,to:i,logger:n}=t,s=e.workspaceData.globs.length>0;n.mainStep(Lr({packageManager:rn.name,action:"create",project:e}));let o=Ve({workspaceRoot:e.paths.root});n.rootHeader(),n.rootStep(`adding "packageManager" field to ${Yn.default.relative(e.paths.root,e.paths.packageJson)}`),o.packageManager=`${i.name}@${i.version}`,s?(n.rootStep(`adding "workspaces" field to ${Yn.default.relative(e.paths.root,e.paths.packageJson)}`),o.workspaces=e.workspaceData.globs,r!=null&&r.dry||(0,Pt.writeJSONSync)(e.paths.packageJson,o,{spaces:2}),Tr({workspace:{name:"root",paths:e.paths},project:e,to:i,logger:n,options:r}),n.workspaceHeader(),e.workspaceData.workspaces.forEach(a=>{Tr({workspace:a,project:e,to:i,logger:n,options:r})})):r!=null&&r.dry||(0,Pt.writeJSONSync)(e.paths.packageJson,o,{spaces:2})}async function tI(t){let{project:e,logger:r,options:i}=t,n=e.workspaceData.globs.length>0;r.mainStep(Lr({packageManager:rn.name,action:"remove",project:e}));let s=Ve({workspaceRoot:e.paths.root});if(n&&(r.subStep(`removing "workspaces" field in ${e.name} root "package.json"`),delete s.workspaces),r.subStep(`removing "packageManager" field in ${e.name} root "package.json"`),delete s.packageManager,!(i!=null&&i.dry)){(0,Pt.writeJSONSync)(e.paths.packageJson,s,{spaces:2});let o=[e.paths.nodeModules,...e.workspaceData.workspaces.map(a=>a.paths.nodeModules)];try{r.subStep('removing "node_modules"'),await Promise.all(o.map(a=>(0,Pt.rm)(a,{recursive:!0,force:!0})))}catch{throw new je("Failed to remove node_modules",{type:"error_removing_node_modules"})}}}async function rI(t){let{project:e,logger:r,options:i}=t;r.subStep(`removing ${Yn.default.relative(e.paths.root,e.paths.lockfile)}`),i!=null&&i.dry||(0,Pt.rmSync)(e.paths.lockfile,{force:!0})}async function iI(t){let{project:e,options:r}=t;switch(e.packageManager){case"pnpm":tr({project:e,options:r});break;case"bun":tr({project:e,options:r});break;case"npm":break;case"yarn":tr({project:e,options:r});break}}var nI={detect:RS,read:QP,create:eI,remove:tI,clean:rI,convertLock:iI};W();var ni={name:"yarn",lock:"yarn.lock"};async function xS(t){let e=nn.default.join(t.workspaceRoot,ni.lock),r=aa({workspaceRoot:t.workspaceRoot});return(0,It.existsSync)(e)||r===ni.name}async function sI(t){if(!await xS(t))throw new je("Not a yarn project",{type:"package_manager-unexpected"});let e=Ve(t),{name:r,description:i}=es(t),n=Uh({workspaces:e.workspaces});return{name:r,description:i,packageManager:ni.name,paths:la({root:t.workspaceRoot,lockFile:ni.lock}),workspaceData:{globs:n,workspaces:ca({workspaceGlobs:n,...t})}}}async function oI(t){let{project:e,to:r,logger:i,options:n}=t,s=e.workspaceData.globs.length>0;i.mainStep(Lr({packageManager:ni.name,action:"create",project:e}));let o=Ve({workspaceRoot:e.paths.root});i.rootHeader(),i.rootStep(`adding "packageManager" field to ${nn.default.relative(e.paths.root,e.paths.packageJson)}`),o.packageManager=`${r.name}@${r.version}`,s?(i.rootStep(`adding "workspaces" field to ${nn.default.relative(e.paths.root,e.paths.packageJson)}`),o.workspaces=e.workspaceData.globs,n!=null&&n.dry||(0,It.writeJSONSync)(e.paths.packageJson,o,{spaces:2}),Tr({workspace:{name:"root",paths:e.paths},project:e,to:r,logger:i,options:n}),i.workspaceHeader(),e.workspaceData.workspaces.forEach(a=>{Tr({workspace:a,project:e,to:r,logger:i,options:n})})):n!=null&&n.dry||(0,It.writeJSONSync)(e.paths.packageJson,o,{spaces:2})}async function aI(t){let{project:e,logger:r,options:i}=t,n=e.workspaceData.globs.length>0;r.mainStep(Lr({packageManager:ni.name,action:"remove",project:e}));let s=Ve({workspaceRoot:e.paths.root});if(n&&(r.subStep(`removing "workspaces" field in ${e.name} root "package.json"`),delete s.workspaces),r.subStep(`removing "packageManager" field in ${e.name} root "package.json"`),delete s.packageManager,!(i!=null&&i.dry)){(0,It.writeJSONSync)(e.paths.packageJson,s,{spaces:2});let o=[e.paths.nodeModules,...e.workspaceData.workspaces.map(a=>a.paths.nodeModules)];try{r.subStep('removing "node_modules"'),await Promise.all(o.map(a=>(0,It.rm)(a,{recursive:!0,force:!0})))}catch{throw new je("Failed to remove node_modules",{type:"error_removing_node_modules"})}}}async function lI(t){let{project:e,logger:r,options:i}=t;r.subStep(`removing ${nn.default.relative(e.paths.root,e.paths.lockfile)}`),i!=null&&i.dry||(0,It.rmSync)(e.paths.lockfile,{force:!0})}async function cI(t){let{project:e,options:r,logger:i}=t,n=()=>{i.subStep(`converting ${nn.default.relative(e.paths.root,e.paths.lockfile)} to ${ni.lock}`)};switch(e.packageManager){case"pnpm":tr({project:e,options:r});break;case"bun":n(),await ES({project:e,options:r});break;case"npm":tr({project:e,options:r});break;case"yarn":break}}var uI={detect:xS,read:sI,create:oI,remove:aI,clean:lI,convertLock:cI};W();var sn={name:"bun",lock:"bun.lockb"};async function AS(t){let e=Kn.default.join(t.workspaceRoot,sn.lock),r=aa({workspaceRoot:t.workspaceRoot});return(0,Nt.existsSync)(e)||r===sn.name}async function hI(t){if(!await AS(t))throw new je("Not a bun project",{type:"package_manager-unexpected"});let e=Ve(t),{name:r,description:i}=es(t),n=Uh({workspaces:e.workspaces});return{name:r,description:i,packageManager:sn.name,paths:la({root:t.workspaceRoot,lockFile:sn.lock}),workspaceData:{globs:n,workspaces:ca({workspaceGlobs:n,...t})}}}async function fI(t){let{project:e,to:r,logger:i,options:n}=t,s=e.workspaceData.globs.length>0;if(!zP({project:e}))throw new je("Unable to convert project to bun - workspace globs unsupported",{type:"bun-workspace_glob_error"});i.mainStep(Lr({packageManager:sn.name,action:"create",project:e}));let o=Ve({workspaceRoot:e.paths.root});i.rootHeader(),i.rootStep(`adding "packageManager" field to ${Kn.default.relative(e.paths.root,e.paths.packageJson)}`),o.packageManager=`${r.name}@${r.version}`,s?(i.rootStep(`adding "workspaces" field to ${Kn.default.relative(e.paths.root,e.paths.packageJson)}`),o.workspaces=e.workspaceData.globs,n!=null&&n.dry||(0,Nt.writeJSONSync)(e.paths.packageJson,o,{spaces:2}),Tr({workspace:{name:"root",paths:e.paths},project:e,to:r,logger:i,options:n}),i.workspaceHeader(),e.workspaceData.workspaces.forEach(a=>{Tr({workspace:a,project:e,to:r,logger:i,options:n})})):n!=null&&n.dry||(0,Nt.writeJSONSync)(e.paths.packageJson,o,{spaces:2})}async function pI(t){let{project:e,logger:r,options:i}=t,n=e.workspaceData.globs.length>0;r.mainStep(Lr({packageManager:sn.name,action:"remove",project:e}));let s=Ve({workspaceRoot:e.paths.root});if(n&&(r.subStep(`removing "workspaces" field in ${e.name} root "package.json"`),delete s.workspaces),r.subStep(`removing "packageManager" field in ${e.name} root "package.json"`),delete s.packageManager,!(i!=null&&i.dry)){(0,Nt.writeJSONSync)(e.paths.packageJson,s,{spaces:2});let o=[e.paths.nodeModules,...e.workspaceData.workspaces.map(a=>a.paths.nodeModules)];try{r.subStep('removing "node_modules"'),await Promise.all(o.map(a=>(0,Nt.rm)(a,{recursive:!0,force:!0})))}catch{throw new je("Failed to remove node_modules",{type:"error_removing_node_modules"})}}}async function dI(t){let{project:e,logger:r,options:i}=t;r.subStep(`removing ${Kn.default.relative(e.paths.root,e.paths.lockfile)}`),i!=null&&i.dry||(0,Nt.rmSync)(e.paths.lockfile,{force:!0})}async function mI(t){let{project:e,options:r}=t;switch(e.packageManager){case"pnpm":tr({project:e,options:r});break;case"bun":break;case"npm":tr({project:e,options:r});break;case"yarn":tr({project:e,options:r});break}}var gI={detect:AS,read:hI,create:fI,remove:pI,clean:dI,convertLock:mI},OS={pnpm:JP,yarn:uI,npm:nI,bun:gI};W();async function ts({root:t}){let{exists:e,absolute:r}=GP({directory:t});if(!e)throw new je(`Could not find directory at ${r}. Ensure the directory exists.`,{type:"invalid_directory"});for(let{detect:i,read:n}of Object.values(OS))if(await i({workspaceRoot:r}))return n({workspaceRoot:r});throw new je("Could not determine package manager. Add `packageManager` to `package.json` or ensure a lockfile is present.",{type:"package_manager-unable_to_detect"})}W();W();W();W();var qh=X(require("chalk")),TS=X(require("is-git-clean"));function ua({directory:t,force:e}){var n;let r=!1,i="Unable to determine if git directory is clean";try{r=TS.default.sync(t||process.cwd()),i="Git directory is not clean"}catch(s){(n=s.stderr)!=null&&n.includes("not a git repository")&&(r=!0)}r||(e?ne.log(`${qh.default.yellow("WARNING")}: ${i}. Forcibly continuing...`):(ne.log("Thank you for using @turbo/codemod!"),ne.log(qh.default.yellow(`
45
45
  But before we continue, please stash or commit your git changes.`)),ne.log(`
46
- You may use the --force flag to override this safety check.`),process.exit(1)))}var Gh=X(require("path")),kS=X(require("fs"));function on({directory:t}){let e=Gh.default.isAbsolute(t)?t:Gh.default.join(process.cwd(),t);return{exists:kS.default.existsSync(e),absolute:e}}var ma=X(require("chalk"));var mt=X(require("chalk")),ha=class{constructor(e){this.transform=e.transformer,this.dry=e.dry}_log(...e){console.log(...e)}modified(...e){this._log(mt.default.green(" MODIFIED "),...e,this.dry?mt.default.dim("(dry run)"):"")}unchanged(...e){this._log(mt.default.gray(" UNCHANGED "),...e,this.dry?mt.default.dim("(dry run)"):"")}skipped(...e){this._log(mt.default.yellow(" SKIPPED "),...e,this.dry?mt.default.dim("(dry run)"):"")}error(...e){this._log(mt.default.red(" ERROR "),...e,this.dry?mt.default.dim("(dry run)"):"")}info(...e){this._log(mt.default.bold(" INFO "),...e,this.dry?mt.default.dim("(dry run)"):"")}};var CS=X(require("os")),zh=X(require("path"));var fa=X(require("chalk")),da=require("diff"),Pr=require("fs-extra"),pa=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{zh.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,da.diffJson)(this.before,e.after):this.changes=(0,da.diffLines)(this.before,e.after):this.changes=[]}fileName(){return zh.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(fa.default.green(r.value)):r.removed?process.stdout.write(fa.default.red(r.value)):process.stdout.write(fa.default.dim(r.value))}),ne.log(CS.default.EOL)):ne.log(this.after)}};var oi=class{constructor(e){this.modifications={};this.transform=e.transformer,this.rootPath=e.rootPath,this.dry=e.dry,this.print=e.print,this.logger=new ha(e)}abortTransform(e){return this.logger.error(e.reason),{fatalError:new Error(e.reason),changes:e.changes||{}}}modifyFile(e){this.modifications[e.filePath]=new pa({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(ma.default.dim(n.fileName()));else try{n.write(),s.action="modified",this.logger.modified(ma.default.bold(n.fileName()))}catch(o){let a="Unknown error";o instanceof Error&&(a=o.message),s.error=new Error(a),s.action="error",this.logger.error(n.fileName(),a)}this.print&&n.log({diff:!0})}else this.logger.unchanged(ma.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(ne.log(),r.length>0){ne.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),ne.log()}}};var LS=X(require("path")),PS=require("fs-extra"),vI=["package.json","turbo.json",".git"];function IS({directory:t}){return vI.some(e=>(0,PS.existsSync)(LS.default.join(t,e)))}var NS=require("child_process");function gt(t,e,r){try{return(0,NS.execSync)(t,{stdio:"pipe",...e}).toString("utf8").trim()}catch{return r||void 0}}function DS(t,e){let{from:r}=e;if(r)return r;let i=gt("turbo --version",{cwd:t.paths.root});if(i)return i;let{packageManager:n}=t;return n==="yarn"?gt("yarn turbo --version",{cwd:t.paths.root}):n==="pnpm"?gt("pnpm turbo --version",{cwd:t.paths.root}):gt("npm exec -c 'turbo --version'",{cwd:t.paths.root})}var MS=X(require("axios")),RI="https://registry.npmjs.org";async function xI({packageName:t}){try{return(await MS.default.get(`${RI}/${t}`)).data}catch{throw new Error(`Unable to fetch the latest version of ${t}`)}}async function FS({to:t}){let e=await xI({packageName:"turbo"}),{"dist-tags":r,versions:i}=e;if(t){if(r[t]||t in i)return t;throw new Error(`turbo@${t} does not exist`)}return r.latest}var ir=require("semver");var ga=X(require("path")),jS=X(require("fs-extra")),BS=process.env.NODE_ENV==="test"?ga.default.join(__dirname,"../transforms"):ga.default.join(__dirname,"./transforms");function ya(){return jS.default.readdirSync(BS).map(e=>{let r=ga.default.join(BS,e);try{return require(r).default}catch{return}}).filter(Boolean)}function $S({fromVersion:t,toVersion:e}){let r=t.split(".")[0],n=r!==e.split(".")[0]?`${r}.0.0`:t,s=ya().filter(o=>{var c;let a=(0,ir.gt)(o.introducedIn,t)&&(0,ir.lte)(o.introducedIn,e),l=((c=o.idempotent)!=null?c:!0)&&(0,ir.gt)(o.introducedIn,n)&&(0,ir.lte)(o.introducedIn,e);return a||l});return s.sort((o,a)=>(0,ir.gt)(o.introducedIn,a.introducedIn)?1:(0,ir.eq)(o.introducedIn,a.introducedIn)?0:-1),s}var HS=X(require("path")),ba=require("fs-extra"),US=require("semver");function AI(t,e="latest"){switch(t){case"yarn":return`yarn global add turbo@${e}`;case"npm":return`npm install turbo@${e} --global`;case"pnpm":return`pnpm add turbo@${e} --global`;case"bun":return`bun add turbo@${e} --global`}}function OI({packageManager:t,packageManagerVersion:e,installType:r,isUsingWorkspaces:i,to:n="latest"}){let s=o=>o.filter(Boolean).join(" ");switch(t){case"yarn":return(0,US.gte)(e,"2.0.0")?s(["yarn","add",`turbo@${n}`,r==="devDependencies"&&"--dev"]):s(["yarn","add",`turbo@${n}`,r==="devDependencies"&&"--dev",i&&"-W"]);case"npm":return s(["npm","install",`turbo@${n}`,r==="devDependencies"&&"--save-dev"]);case"pnpm":return s(["pnpm","add",`turbo@${n}`,r==="devDependencies"&&"--save-dev",i&&"-w"]);case"bun":return s(["bun","add",`turbo@${n}`,r==="devDependencies"&&"--dev"])}}function TI({root:t}){let e=HS.default.join(t,"package.json");if(!(0,ba.existsSync)(e)){ne.error(`Unable to find package.json at ${e}`);return}let r=(0,ba.readJsonSync)(e),i=r.devDependencies&&"turbo"in r.devDependencies,n=r.dependencies&&"turbo"in r.dependencies;if(n||i)return n?"dependencies":"devDependencies"}async function qS({project:t,to:e}){let r=gt("turbo bin",{cwd:t.paths.root,stdio:"pipe"}),i=await zc(),n=Object.keys(i).find(u=>{let f=i[u];return f&&r?r.includes(f):!1});if(r&&n)return AI(n,e);let{packageManager:s}=t,o=t.workspaceData.globs.length>0,a=TI({root:t.paths.root}),c=(await Gc())[s];if(c&&a)return OI({packageManager:s,packageManagerVersion:c,installType:a,isUsingWorkspaces:o,to:e})}function GS({project:t}){try{let e={cwd:t.paths.root,stdio:"ignore"};if(gt("turbo bin",e))gt("turbo daemon stop",e);else{let i=`${t.packageManager} turbo daemon stop`;t.packageManager==="npm"&&(i="npm exec -c 'turbo daemon stop'"),gt(i,e)}}catch{}}function yt({message:t,success:e}){return e?(ne.bold($e.default.green("Migration completed")),t&&ne.log(t),process.exit(0)):(ne.bold($e.default.red("Migration failed")),t&&ne.log(t),process.exit(1))}async function Wh(t,e){e.dry||ua({directory:t,force:e.force});let r=await(0,WS.prompt)([{type:"input",name:"directoryInput",message:"Where is the root of the repo to migrate?",when:!t,default:".",validate:p=>{let{exists:g,absolute:y}=on({directory:p});return g?!0:`Directory ${$e.default.dim(`(${y})`)} does not exist`},filter:p=>p.trim()}]),{directoryInput:i=t}=r,{exists:n,absolute:s}=on({directory:i});if(!n)return yt({success:!1,message:`Directory ${$e.default.dim(`(${s})`)} does not exist`});if(!IS({directory:s}))return yt({success:!1,message:`Directory (${$e.default.dim(s)}) does not appear to be a repository`});let o;try{o=await ts({root:s})}catch{return yt({success:!1,message:`Unable to read determine package manager details from ${$e.default.dim(s)}`})}let a=DS(o,e);if(!a)return yt({success:!1,message:`Unable to infer the version of turbo being used by ${o.name}`});let l=e.to;try{l=await FS(e)}catch(p){let g="UNKNOWN_ERROR";return p instanceof Error&&(g=p.message),yt({success:!1,message:g})}if(!l)return yt({success:!1,message:"Unable to fetch the latest version of turbo"});if(a===l)return yt({success:!0,message:`Nothing to do, current version (${$e.default.bold(a)}) is the same as the requested version (${$e.default.bold(l)})`});let c=$S({fromVersion:a,toVersion:l});c.length===0&&ne.log(`No codemods required to migrate from ${a} to ${l}`,an.default.EOL),e.dry||GS({project:o}),ne.log(`Upgrading turbo from ${$e.default.bold(a)} to ${$e.default.bold(l)} (${c.length===0?"no codemods required":`${c.length} required codemod${c.length===1?"":"s"}`})`,an.default.EOL);let u=[];for(let[p,g]of c.entries()){ne.log(`(${p+1}/${c.length}) ${$e.default.bold(`Running ${g.name}`)}`);let y=await g.transformer({root:o.paths.root,options:e});oi.logResults(y),u.push(y)}if(u.some(p=>p.fatalError||Object.keys(p.changes).some(g=>p.changes[g].error)))return yt({success:!1,message:"Could not complete migration due to codemod errors. Please fix the errors and try again."});let h=await qS({project:o,to:e.to});if(!h)return yt({success:!1,message:"Unable to determine upgrade command"});if(e.install)if(e.dry)ne.log(`Upgrading turbo with ${$e.default.bold(h)} ${$e.default.dim("(dry run)")}`,an.default.EOL);else{ne.log(`Upgrading turbo with ${$e.default.bold(h)}`,an.default.EOL);try{(0,zS.execSync)(h,{stdio:"pipe",cwd:o.paths.root})}catch(p){return yt({success:!1,message:`Unable to upgrade turbo: ${String(p)}`})}}else ne.log(`Upgrade turbo with ${$e.default.bold(h)}`,an.default.EOL);yt({success:!0})}var Ir=X(require("chalk")),YS=require("inquirer");async function Yh(t,e,r){let i=ya();if(r.list)return ne.log(i.map(h=>`- ${Ir.default.cyan(h.name)}`).join(`
47
- `)),process.exit(0);r.dry||ua({directory:e,force:r.force});let n=await(0,YS.prompt)([{type:"input",name:"directoryInput",message:"Where is the root of the repo where the transform should run?",when:!e,default:".",validate:h=>{let{exists:p,absolute:g}=on({directory:h});return p?!0:`Directory ${Ir.default.dim(`(${g})`)} does not exist`},filter:h=>h.trim()},{type:"list",name:"transformerInput",message:"Which transform would you like to apply?",when:!t,pageSize:i.length,choices:i.map(h=>({name:`${Ir.default.bold(h.name)} - ${Ir.default.gray(h.description)} ${Ir.default.gray(`(${h.introducedIn})`)}`,value:h.name}))}]),{directoryInput:s=e,transformerInput:o=t}=n,{exists:a,absolute:l}=on({directory:s});if(!a)return ne.error(`Directory ${Ir.default.dim(`(${l})`)} does not exist`),process.exit(1);let c=i.map(h=>h.name),u=i.find(h=>h.name===o);if(!u)return ne.error(`Invalid transform choice ${Ir.default.dim(`(${t})`)}, pick one of:`),ne.error(c.map(h=>`- ${h}`).join(`
46
+ You may use the --force flag to override this safety check.`),process.exit(1)))}var Gh=X(require("path")),kS=X(require("fs"));function on({directory:t}){let e=Gh.default.isAbsolute(t)?t:Gh.default.join(process.cwd(),t);return{exists:kS.default.existsSync(e),absolute:e}}var ma=X(require("chalk"));var mt=X(require("chalk")),ha=class{constructor(e){this.transform=e.transformer,this.dry=e.dryRun}_log(...e){console.log(...e)}modified(...e){this._log(mt.default.green(" MODIFIED "),...e,this.dry?mt.default.dim("(dry run)"):"")}unchanged(...e){this._log(mt.default.gray(" UNCHANGED "),...e,this.dry?mt.default.dim("(dry run)"):"")}skipped(...e){this._log(mt.default.yellow(" SKIPPED "),...e,this.dry?mt.default.dim("(dry run)"):"")}error(...e){this._log(mt.default.red(" ERROR "),...e,this.dry?mt.default.dim("(dry run)"):"")}info(...e){this._log(mt.default.bold(" INFO "),...e,this.dry?mt.default.dim("(dry run)"):"")}};var CS=X(require("os")),zh=X(require("path"));var fa=X(require("chalk")),da=require("diff"),Pr=require("fs-extra"),pa=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{zh.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,da.diffJson)(this.before,e.after):this.changes=(0,da.diffLines)(this.before,e.after):this.changes=[]}fileName(){return zh.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(fa.default.green(r.value)):r.removed?process.stdout.write(fa.default.red(r.value)):process.stdout.write(fa.default.dim(r.value))}),ne.log(CS.default.EOL)):ne.log(this.after)}};var oi=class{constructor(e){this.modifications={};this.transform=e.transformer,this.rootPath=e.rootPath,this.dry=e.dryRun,this.print=e.print,this.logger=new ha(e)}abortTransform(e){return this.logger.error(e.reason),{fatalError:new Error(e.reason),changes:e.changes||{}}}modifyFile(e){this.modifications[e.filePath]=new pa({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(ma.default.dim(n.fileName()));else try{n.write(),s.action="modified",this.logger.modified(ma.default.bold(n.fileName()))}catch(o){let a="Unknown error";o instanceof Error&&(a=o.message),s.error=new Error(a),s.action="error",this.logger.error(n.fileName(),a)}this.print&&n.log({diff:!0})}else this.logger.unchanged(ma.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(ne.log(),r.length>0){ne.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),ne.log()}}};var LS=X(require("path")),PS=require("fs-extra"),vI=["package.json","turbo.json",".git"];function IS({directory:t}){return vI.some(e=>(0,PS.existsSync)(LS.default.join(t,e)))}var NS=require("child_process");function gt(t,e,r){try{return(0,NS.execSync)(t,{stdio:"pipe",...e}).toString("utf8").trim()}catch{return r||void 0}}function DS(t,e){let{from:r}=e;if(r)return r;let i=gt("turbo --version",{cwd:t.paths.root});if(i)return i;let{packageManager:n}=t;return n==="yarn"?gt("yarn turbo --version",{cwd:t.paths.root}):n==="pnpm"?gt("pnpm turbo --version",{cwd:t.paths.root}):gt("npm exec -c 'turbo --version'",{cwd:t.paths.root})}var MS=X(require("axios")),RI="https://registry.npmjs.org";async function xI({packageName:t}){try{return(await MS.default.get(`${RI}/${t}`)).data}catch{throw new Error(`Unable to fetch the latest version of ${t}`)}}async function FS({to:t}){let e=await xI({packageName:"turbo"}),{"dist-tags":r,versions:i}=e;if(t){if(r[t]||t in i)return t;throw new Error(`turbo@${t} does not exist`)}return r.latest}var ir=require("semver");var ga=X(require("path")),jS=X(require("fs-extra")),BS=process.env.NODE_ENV==="test"?ga.default.join(__dirname,"../transforms"):ga.default.join(__dirname,"./transforms");function ya(){return jS.default.readdirSync(BS).map(e=>{let r=ga.default.join(BS,e);try{return require(r).default}catch{return}}).filter(Boolean)}function $S({fromVersion:t,toVersion:e}){let r=t.split(".")[0],n=r!==e.split(".")[0]?`${r}.0.0`:t,s=ya().filter(o=>{var c;let a=(0,ir.gt)(o.introducedIn,t)&&(0,ir.lte)(o.introducedIn,e),l=((c=o.idempotent)!=null?c:!0)&&(0,ir.gt)(o.introducedIn,n)&&(0,ir.lte)(o.introducedIn,e);return a||l});return s.sort((o,a)=>(0,ir.gt)(o.introducedIn,a.introducedIn)?1:(0,ir.eq)(o.introducedIn,a.introducedIn)?0:-1),s}var HS=X(require("path")),ba=require("fs-extra"),US=require("semver");function AI(t,e="latest"){switch(t){case"yarn":return`yarn global add turbo@${e}`;case"npm":return`npm install turbo@${e} --global`;case"pnpm":return`pnpm add turbo@${e} --global`;case"bun":return`bun add turbo@${e} --global`}}function OI({packageManager:t,packageManagerVersion:e,installType:r,isUsingWorkspaces:i,to:n="latest"}){let s=o=>o.filter(Boolean).join(" ");switch(t){case"yarn":return(0,US.gte)(e,"2.0.0")?s(["yarn","add",`turbo@${n}`,r==="devDependencies"&&"--dev"]):s(["yarn","add",`turbo@${n}`,r==="devDependencies"&&"--dev",i&&"-W"]);case"npm":return s(["npm","install",`turbo@${n}`,r==="devDependencies"&&"--save-dev"]);case"pnpm":return s(["pnpm","add",`turbo@${n}`,r==="devDependencies"&&"--save-dev",i&&"-w"]);case"bun":return s(["bun","add",`turbo@${n}`,r==="devDependencies"&&"--dev"])}}function TI({root:t}){let e=HS.default.join(t,"package.json");if(!(0,ba.existsSync)(e)){ne.error(`Unable to find package.json at ${e}`);return}let r=(0,ba.readJsonSync)(e),i=r.devDependencies&&"turbo"in r.devDependencies,n=r.dependencies&&"turbo"in r.dependencies;if(n||i)return n?"dependencies":"devDependencies"}async function qS({project:t,to:e}){let r=gt("turbo bin",{cwd:t.paths.root,stdio:"pipe"}),i=await zc(),n=Object.keys(i).find(u=>{let f=i[u];return f&&r?r.includes(f):!1});if(r&&n)return AI(n,e);let{packageManager:s}=t,o=t.workspaceData.globs.length>0,a=TI({root:t.paths.root}),c=(await Gc())[s];if(c&&a)return OI({packageManager:s,packageManagerVersion:c,installType:a,isUsingWorkspaces:o,to:e})}function GS({project:t}){try{let e={cwd:t.paths.root,stdio:"ignore"};if(gt("turbo bin",e))gt("turbo daemon stop",e);else{let i=`${t.packageManager} turbo daemon stop`;t.packageManager==="npm"&&(i="npm exec -c 'turbo daemon stop'"),gt(i,e)}}catch{}}function yt({message:t,success:e}){return e?(ne.bold($e.default.green("Migration completed")),t&&ne.log(t),process.exit(0)):(ne.bold($e.default.red("Migration failed")),t&&ne.log(t),process.exit(1))}async function Wh(t,e){e.dryRun||ua({directory:t,force:e.force});let r=await(0,WS.prompt)([{type:"input",name:"directoryInput",message:"Where is the root of the repo to migrate?",when:!t,default:".",validate:p=>{let{exists:g,absolute:y}=on({directory:p});return g?!0:`Directory ${$e.default.dim(`(${y})`)} does not exist`},filter:p=>p.trim()}]),{directoryInput:i=t}=r,{exists:n,absolute:s}=on({directory:i});if(!n)return yt({success:!1,message:`Directory ${$e.default.dim(`(${s})`)} does not exist`});if(!IS({directory:s}))return yt({success:!1,message:`Directory (${$e.default.dim(s)}) does not appear to be a repository`});let o;try{o=await ts({root:s})}catch{return yt({success:!1,message:`Unable to read determine package manager details from ${$e.default.dim(s)}`})}let a=DS(o,e);if(!a)return yt({success:!1,message:`Unable to infer the version of turbo being used by ${o.name}`});let l=e.to;try{l=await FS(e)}catch(p){let g="UNKNOWN_ERROR";return p instanceof Error&&(g=p.message),yt({success:!1,message:g})}if(!l)return yt({success:!1,message:"Unable to fetch the latest version of turbo"});if(a===l)return yt({success:!0,message:`Nothing to do, current version (${$e.default.bold(a)}) is the same as the requested version (${$e.default.bold(l)})`});let c=$S({fromVersion:a,toVersion:l});c.length===0&&ne.log(`No codemods required to migrate from ${a} to ${l}`,an.default.EOL),e.dryRun||GS({project:o}),ne.log(`Upgrading turbo from ${$e.default.bold(a)} to ${$e.default.bold(l)} (${c.length===0?"no codemods required":`${c.length} required codemod${c.length===1?"":"s"}`})`,an.default.EOL);let u=[];for(let[p,g]of c.entries()){ne.log(`(${p+1}/${c.length}) ${$e.default.bold(`Running ${g.name}`)}`);let y=await g.transformer({root:o.paths.root,options:e});oi.logResults(y),u.push(y)}if(u.some(p=>p.fatalError||Object.keys(p.changes).some(g=>p.changes[g].error)))return yt({success:!1,message:"Could not complete migration due to codemod errors. Please fix the errors and try again."});let h=await qS({project:o,to:e.to});if(!h)return yt({success:!1,message:"Unable to determine upgrade command"});if(e.install)if(e.dryRun)ne.log(`Upgrading turbo with ${$e.default.bold(h)} ${$e.default.dim("(dry run)")}`,an.default.EOL);else{ne.log(`Upgrading turbo with ${$e.default.bold(h)}`,an.default.EOL);try{(0,zS.execSync)(h,{stdio:"pipe",cwd:o.paths.root})}catch(p){return yt({success:!1,message:`Unable to upgrade turbo: ${String(p)}`})}}else ne.log(`Upgrade turbo with ${$e.default.bold(h)}`,an.default.EOL);yt({success:!0})}var Ir=X(require("chalk")),YS=require("inquirer");async function Yh(t,e,r){let i=ya();if(r.list)return ne.log(i.map(h=>`- ${Ir.default.cyan(h.name)}`).join(`
47
+ `)),process.exit(0);r.dryRun||ua({directory:e,force:r.force});let n=await(0,YS.prompt)([{type:"input",name:"directoryInput",message:"Where is the root of the repo where the transform should run?",when:!e,default:".",validate:h=>{let{exists:p,absolute:g}=on({directory:h});return p?!0:`Directory ${Ir.default.dim(`(${g})`)} does not exist`},filter:h=>h.trim()},{type:"list",name:"transformerInput",message:"Which transform would you like to apply?",when:!t,pageSize:i.length,choices:i.map(h=>({name:`${Ir.default.bold(h.name)} - ${Ir.default.gray(h.description)} ${Ir.default.gray(`(${h.introducedIn})`)}`,value:h.name}))}]),{directoryInput:s=e,transformerInput:o=t}=n,{exists:a,absolute:l}=on({directory:s});if(!a)return ne.error(`Directory ${Ir.default.dim(`(${l})`)} does not exist`),process.exit(1);let c=i.map(h=>h.name),u=i.find(h=>h.name===o);if(!u)return ne.error(`Invalid transform choice ${Ir.default.dim(`(${t})`)}, pick one of:`),ne.error(c.map(h=>`- ${h}`).join(`
48
48
  `)),process.exit(1);let f=await u.transformer({root:l,options:r});if(f.fatalError)return process.exit(1);oi.logResults(f)}var Kh=X(require("chalk")),KS=X(require("update-check"));var kI=(0,KS.default)(ia).catch(()=>null);async function Vh(){try{let t=await kI;if(t!=null&&t.latest){let{packageManager:e}=await ts({root:process.cwd()}),r="npm i -g @turbo/codemod";e==="yarn"?r="yarn global add @turbo/codemod":e==="pnpm"&&(r="pnpm i -g @turbo/codemod"),ne.log(),ne.log(Kh.default.yellow.bold("A new version of `@turbo/codemod` is available!")),ne.log(`You can update by running: ${Kh.default.cyan(r)}`),ne.log()}process.exit()}catch{}}var _a=new ZS.Command;_a.name("@turbo/codemod").description("Codemod transformations to help upgrade your Turborepo codebase when a feature is deprecated.").version(ia.version,"-v, --version","output the current version");_a.command("migrate").aliases(["update","upgrade"]).description("Migrate a project to the latest version of Turborepo").argument("[path]","Directory where the transforms should be applied").option("--from <version>","Specify the version to migrate from (default: current version)").option("--to <version>","Specify the version to migrate to (default: latest)").option("--install","Install new version of turbo after migration",!0).option("--force","Bypass Git safety checks and forcibly run codemods",!1).option("--dry, --dry-run, -d","Dry run (no changes are made to files)",!1).option("--print","Print transformed files to your terminal",!1).action(Wh);_a.command("transform",{isDefault:!0}).description("Apply a single code transformation to a project").argument("[transform]","The transformer to run").argument("[path]","Directory where the transforms should be applied").option("--force","Bypass Git safety checks and forcibly run codemods",!1).option("--list","List all available transforms",!1).option("--dry, --dry-run, -d","Dry run (no changes are made to files)",!1).option("--print","Print transformed files to your terminal",!1).action(Yh);_a.parseAsync().then(Vh).catch(async t=>{ne.log(),ne.log(VS.default.red("Unexpected error. Please report it as a bug:")),ne.log(t),ne.log(),await Vh(),process.exit(1)});
49
49
  /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
50
50
  /*! Bundled license information: