@turbo/codemod 2.0.1 → 2.0.2-canary.1
Sign up to get free protection for your applications and to get access to all the features.
@@ -38,7 +38,7 @@ ${i.message}`:y,k=[x,e,t].filter(Boolean).join(`
|
|
38
38
|
`+t.slice(o+1):l+=t.slice(n),l.slice(1)}function fR(t){for(var e="",r=0,i,n=0;n<t.length;r>=65536?n+=2:n++)r=an(t,n),i=Ce[r],!i&&hn(r)?(e+=t[n],r>=65536&&(e+=t[n+1])):e+=i||iR(r);return e}function pR(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)),(Pt(t,e,a,!1,!1)||typeof a=="undefined"&&Pt(t,e,null,!1,!1))&&(i!==""&&(i+=","+(t.condenseFlow?"":" ")),i+=t.dump);t.tag=n,t.dump="["+i+"]"}function Tp(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)),(Pt(t,e+1,l,!0,!0,!1,!0)||typeof l=="undefined"&&Pt(t,e+1,null,!0,!0,!1,!0))&&((!i||n!=="")&&(n+=Pa(t,e)),t.dump&&cn===t.dump.charCodeAt(0)?n+="-":n+="- ",n+=t.dump);t.tag=s,t.dump=n||"[]"}function dR(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)),Pt(t,e,l,!1,!1)&&(t.dump.length>1024&&(u+="? "),u+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),Pt(t,e,c,!1,!1)&&(u+=t.dump,i+=u));t.tag=n,t.dump="{"+i+"}"}function mR(t,e,r,i){var n="",s=t.tag,o=Object.keys(r),a,l,c,u,h,f;if(t.sortKeys===!0)o.sort();else if(typeof t.sortKeys=="function")o.sort(t.sortKeys);else if(t.sortKeys)throw new je("sortKeys must be a boolean or a function");for(a=0,l=o.length;a<l;a+=1)f="",(!i||n!=="")&&(f+=Pa(t,e)),c=o[a],u=r[c],t.replacer&&(u=t.replacer.call(r,c,u)),Pt(t,e+1,c,!0,!0,!0)&&(h=t.tag!==null&&t.tag!=="?"||t.dump&&t.dump.length>1024,h&&(t.dump&&cn===t.dump.charCodeAt(0)?f+="?":f+="? "),f+=t.dump,h&&(f+=Pa(t,e)),Pt(t,e+1,u,!0,h)&&(t.dump&&cn===t.dump.charCodeAt(0)?f+=":":f+=": ",f+=t.dump,n+=f));t.tag=s,t.dump=n||"{}"}function kp(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,od.call(a.represent)==="[object Function]")i=a.represent(e,l);else if(ad.call(a.represent,l))i=a.represent[l](e,l);else throw new je("!<"+a.tag+'> tag resolver accepts not "'+l+'" style');t.dump=i}return!0}return!1}function Pt(t,e,r,i,n,s,o){t.tag=null,t.dump=r,kp(t,r,!1)||kp(t,r,!0);var a=od.call(t.dump),l=i,c;i&&(i=t.flowLevel<0||t.flowLevel>e);var u=a==="[object Object]"||a==="[object Array]",h,f;if(u&&(h=t.duplicates.indexOf(r),f=h!==-1),(t.tag!==null&&t.tag!=="?"||f||t.indent!==2&&e>0)&&(n=!1),f&&t.usedDuplicates[h])t.dump="*ref_"+h;else{if(u&&f&&!t.usedDuplicates[h]&&(t.usedDuplicates[h]=!0),a==="[object Object]")i&&Object.keys(t.dump).length!==0?(mR(t,e,t.dump,n),f&&(t.dump="&ref_"+h+t.dump)):(dR(t,e,t.dump),f&&(t.dump="&ref_"+h+" "+t.dump));else if(a==="[object Array]")i&&t.dump.length!==0?(t.noArrayIndent&&!o&&e>0?Tp(t,e-1,t.dump,n):Tp(t,e,t.dump,n),f&&(t.dump="&ref_"+h+t.dump)):(pR(t,e,t.dump),f&&(t.dump="&ref_"+h+" "+t.dump));else if(a==="[object String]")t.tag!=="?"&&uR(t,t.dump,e,s,l);else{if(a==="[object Undefined]")return!1;if(t.skipInvalid)return!1;throw new je("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 yR(t,e){var r=[],i=[],n,s;for(Na(t,r,i),n=0,s=i.length;n<s;n+=1)e.duplicates.push(r[i[n]]);e.usedDuplicates=new Array(s)}function Na(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)Na(t[n],e,r);else for(i=Object.keys(t),n=0,s=i.length;n<s;n+=1)Na(t[i[n]],e,r)}function gR(t,e){e=e||{};var r=new sR(e);r.noRefs||yR(t,r);var i=t;return r.replacer&&(i=r.replacer.call({"":i},"",i)),Pt(r,0,i,!0,!0)?r.dump+`
|
39
39
|
`:""}var _R=gR,bR={dump:_R};function Ha(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 wR=ke,SR=Pp,ER=Mp,vR=qp,RR=Up,xR=Ma,AR=sd.load,OR=sd.loadAll,TR=bR.dump,kR=je,CR={binary:Yp,float:Hp,map:Dp,null:Fp,pairs:Vp,set:Zp,timestamp:zp,bool:Bp,int:jp,merge:Wp,omap:Kp,seq:Np,str:Ip},LR=Ha("safeLoad","load"),PR=Ha("safeLoadAll","loadAll"),IR=Ha("safeDump","dump"),NR={Type:wR,Schema:SR,FAILSAFE_SCHEMA:ER,JSON_SCHEMA:vR,CORE_SCHEMA:RR,DEFAULT_SCHEMA:xR,load:AR,loadAll:OR,dump:TR,YAMLException:kR,types:CR,safeLoad:LR,safeLoadAll:PR,safeDump:IR},qa=NR;var tD=ie(Us(),1),iD=require("fs-extra"),sD=require("fs-extra"),aD=require("chalk"),vg=require("stream"),Rg=require("util"),hD=require("fs-extra"),mD=require("chalk"),gD=require("fs-extra"),Fr=ie(require("path"),1),He=require("fs-extra"),xg=ie(li(),1),Ag=ie(require("path"),1),Og=require("fs-extra"),Tg=ie(require("chalk"),1),Ft=ie(require("path"),1),kg=ie(li(),1),Ze=require("fs-extra"),Cg=ie(Us(),1);var gn=ie(require("path"),1),Et=require("fs-extra"),xi=ie(require("path"),1),vt=require("fs-extra"),_n=ie(require("path"),1),Rt=require("fs-extra"),m1=ie(require("chalk"),1),y1=ie(require("gradient-string"),1),g1=ie(li(),1),_1=ie(require("ora"),1),b1=require("semver"),w1=ie(require("chalk"),1),FT=Object.create,xc=Object.defineProperty,BT=Object.getOwnPropertyDescriptor,jT=Object.getOwnPropertyNames,HT=Object.getPrototypeOf,qT=Object.prototype.hasOwnProperty,te=(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')}),UT=(t,e)=>()=>(t&&(e=t(t=0)),e),ee=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),$T=(t,e)=>{for(var r in e)xc(t,r,{get:e[r],enumerable:!0})},GT=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of jT(e))!qT.call(t,n)&&n!==r&&xc(t,n,{get:()=>e[n],enumerable:!(i=BT(e,n))||i.enumerable});return t},zs=(t,e,r)=>(r=t!=null?FT(HT(t)):{},GT(e||!t||!t.__esModule?xc(r,"default",{value:t,enumerable:!0}):r,t)),W=UT(()=>{}),zT=ee((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}),WT=ee((t,e)=>{W();var r=zT().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,p,m){D[p]=m.value},c=typeof Symbol=="function"?Symbol:{},u=c.iterator||"@@iterator",h=c.asyncIterator||"@@asyncIterator",f=c.toStringTag||"@@toStringTag";function d(D,p,m){return Object.defineProperty(D,p,{value:m,enumerable:!0,configurable:!0,writable:!0}),D[p]}try{d({},"")}catch{d=function(D,p,m){return D[p]=m}}function g(D,p,m,b){var R=p&&p.prototype instanceof O?p:O,E=Object.create(R.prototype),M=new j(b||[]);return l(E,"_invoke",{value:V(D,m,M)}),E}function y(D,p,m){try{return{type:"normal",arg:D.call(p,m)}}catch(b){return{type:"throw",arg:b}}}s.wrap=g;var _="suspendedStart",x="suspendedYield",k="executing",C="completed",T={};function O(){}function I(){}function w(){}var v={};d(v,u,function(){return this});var F=Object.getPrototypeOf,q=F&&F(F(z([])));q&&q!==o&&a.call(q,u)&&(v=q);var P=w.prototype=O.prototype=Object.create(v);function $(D){["next","throw","return"].forEach(function(p){d(D,p,function(m){return this._invoke(p,m)})})}function K(D,p){function m(R,E,M,B){var Z=y(D[R],D,E);if(Z.type!=="throw"){var U=Z.arg,J=U.value;return J&&r(J)=="object"&&a.call(J,"__await")?p.resolve(J.__await).then(function(G){m("next",G,M,B)},function(G){m("throw",G,M,B)}):p.resolve(J).then(function(G){U.value=G,M(U)},function(G){return m("throw",G,M,B)})}B(Z.arg)}var b;l(this,"_invoke",{value:function(R,E){function M(){return new p(function(B,Z){m(R,E,B,Z)})}return b=b?b.then(M,M):M()}})}function V(D,p,m){var b=_;return function(R,E){if(b===k)throw new Error("Generator is already running");if(b===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 b=C,m.arg;m.dispatchException(m.arg)}else m.method==="return"&&m.abrupt("return",m.arg);b=k;var Z=y(D,p,m);if(Z.type==="normal"){if(b=m.done?C:x,Z.arg===T)continue;return{value:Z.arg,done:m.done}}Z.type==="throw"&&(b=C,m.method="throw",m.arg=Z.arg)}}}function N(D,p){var m=p.method,b=D.iterator[m];if(b===n)return p.delegate=null,m==="throw"&&D.iterator.return&&(p.method="return",p.arg=n,N(D,p),p.method==="throw")||m!=="return"&&(p.method="throw",p.arg=new TypeError("The iterator does not provide a '"+m+"' method")),T;var R=y(b,D.iterator,p.arg);if(R.type==="throw")return p.method="throw",p.arg=R.arg,p.delegate=null,T;var E=R.arg;return E?E.done?(p[D.resultName]=E.value,p.next=D.nextLoc,p.method!=="return"&&(p.method="next",p.arg=n),p.delegate=null,T):E:(p.method="throw",p.arg=new TypeError("iterator result is not an object"),p.delegate=null,T)}function A(D){var p={tryLoc:D[0]};1 in D&&(p.catchLoc=D[1]),2 in D&&(p.finallyLoc=D[2],p.afterLoc=D[3]),this.tryEntries.push(p)}function L(D){var p=D.completion||{};p.type="normal",delete p.arg,D.completion=p}function j(D){this.tryEntries=[{tryLoc:"root"}],D.forEach(A,this),this.reset(!0)}function z(D){if(D||D===""){var p=D[u];if(p)return p.call(D);if(typeof D.next=="function")return D;if(!isNaN(D.length)){var m=-1,b=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 b.next=b}}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=d(w,f,"GeneratorFunction"),s.isGeneratorFunction=function(D){var p=typeof D=="function"&&D.constructor;return!!p&&(p===I||(p.displayName||p.name)==="GeneratorFunction")},s.mark=function(D){return Object.setPrototypeOf?Object.setPrototypeOf(D,w):(D.__proto__=w,d(D,f,"GeneratorFunction")),D.prototype=Object.create(P),D},s.awrap=function(D){return{__await:D}},$(K.prototype),d(K.prototype,h,function(){return this}),s.AsyncIterator=K,s.async=function(D,p,m,b,R){R===void 0&&(R=Promise);var E=new K(g(D,p,m,b),R);return s.isGeneratorFunction(p)?E:E.next().then(function(M){return M.done?M.value:E.next()})},$(P),d(P,f,"Generator"),d(P,u,function(){return this}),d(P,"toString",function(){return"[object Generator]"}),s.keys=function(D){var p=Object(D),m=[];for(var b in p)m.push(b);return m.reverse(),function R(){for(;m.length;){var E=m.pop();if(E in p)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 p in this)p.charAt(0)==="t"&&a.call(this,p)&&!isNaN(+p.slice(1))&&(this[p]=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 p=this;function m(Z,U){return E.type="throw",E.arg=D,p.next=Z,U&&(p.method="next",p.arg=n),!!U}for(var b=this.tryEntries.length-1;b>=0;--b){var R=this.tryEntries[b],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,p){for(var m=this.tryEntries.length-1;m>=0;--m){var b=this.tryEntries[m];if(b.tryLoc<=this.prev&&a.call(b,"finallyLoc")&&this.prev<b.finallyLoc){var R=b;break}}R&&(D==="break"||D==="continue")&&R.tryLoc<=p&&p<=R.finallyLoc&&(R=null);var E=R?R.completion:{};return E.type=D,E.arg=p,R?(this.method="next",this.next=R.finallyLoc,T):this.complete(E)},complete:function(D,p){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"&&p&&(this.next=p),T},finish:function(D){for(var p=this.tryEntries.length-1;p>=0;--p){var m=this.tryEntries[p];if(m.finallyLoc===D)return this.complete(m.completion,m.afterLoc),L(m),T}},catch:function(D){for(var p=this.tryEntries.length-1;p>=0;--p){var m=this.tryEntries[p];if(m.tryLoc===D){var b=m.completion;if(b.type==="throw"){var R=b.arg;L(m)}return R}}throw new Error("illegal catch attempt")},delegateYield:function(D,p,m){return this.delegate={iterator:z(D),resultName:p,nextLoc:m},this.method==="next"&&(this.arg=n),T}},s}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports}),YT=ee((t,e)=>{W();var r=WT()();e.exports=r;try{regeneratorRuntime=r}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}}),KT=ee((t,e)=>{"use strict";W();var r=(i,...n)=>new Promise(s=>{s(i(...n))});e.exports=r,e.exports.default=r}),VT=ee((t,e)=>{"use strict";W();var r=KT(),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=(h,f,...d)=>{o++;let g=r(h,...d);f(g),g.then(a,a)},c=(h,f,...d)=>{o<n?l(h,f,...d):s.push(l.bind(null,h,f,...d))},u=(h,...f)=>new Promise(d=>c(h,d,...f));return Object.defineProperties(u,{activeCount:{get:()=>o},pendingCount:{get:()=>s.length},clearQueue:{value:()=>{s.length=0}}}),u};e.exports=i,e.exports.default=i}),ZT=ee((t,e)=>{"use strict";W();var r=VT(),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),h=[...a].map(d=>[d,u(n,d,l)]),f=r(c.preserveOrder?1:1/0);try{await Promise.all(h.map(d=>f(s,d)))}catch(d){if(d instanceof i)return d.value;throw d}};e.exports=o,e.exports.default=o}),XT=ee((t,e)=>{"use strict";W();var r=te("path"),i=te("fs"),{promisify:n}=te("util"),s=ZT(),o=n(i.stat),a=n(i.lstat),l={directory:"isDirectory",file:"isFile"};function c({type:h}){if(!(h in l))throw new Error(`Invalid type specified: ${h}`)}var u=(h,f)=>h===void 0||f[l[h]]();e.exports=async(h,f)=>{f={cwd:process.cwd(),type:"file",allowSymlinks:!0,...f},c(f);let d=f.allowSymlinks?o:a;return s(h,async g=>{try{let y=await d(r.resolve(f.cwd,g));return u(f.type,y)}catch{return!1}},f)},e.exports.sync=(h,f)=>{f={cwd:process.cwd(),allowSymlinks:!0,type:"file",...f},c(f);let d=f.allowSymlinks?i.statSync:i.lstatSync;for(let g of h)try{let y=d(r.resolve(f.cwd,g));if(u(f.type,y))return g}catch{}}}),JT=ee((t,e)=>{"use strict";W();var r=te("fs"),{promisify:i}=te("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}}}),QT=ee((t,e)=>{"use strict";W();var r=te("path"),i=XT(),n=JT(),s=Symbol("findUp.stop");e.exports=async(o,a={})=>{let l=r.resolve(a.cwd||""),{root:c}=r.parse(l),u=[].concat(o),h=async f=>{if(typeof o!="function")return i(u,f);let d=await o(f.cwd);return typeof d=="string"?i([d],f):d};for(;;){let f=await h({...a,cwd:l});if(f===s)return;if(f)return r.resolve(l,f);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),h=f=>{if(typeof o!="function")return i.sync(u,f);let d=o(f.cwd);return typeof d=="string"?i.sync([d],f):d};for(;;){let f=h({...a,cwd:l});if(f===s)return;if(f)return r.resolve(l,f);if(l===c)return;l=r.dirname(l)}},e.exports.exists=n,e.exports.sync.exists=n.sync,e.exports.stop=s}),bn=ee((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)):{}}),Ac=ee((t,e)=>{"use strict";W();var r=typeof process=="object"&&process?process:{stdout:null,stderr:null},i=te("events"),n=te("stream"),s=te("string_decoder").StringDecoder,o=Symbol("EOF"),a=Symbol("maybeEmitEnd"),l=Symbol("emittedEnd"),c=Symbol("emittingEnd"),u=Symbol("emittedError"),h=Symbol("closed"),f=Symbol("read"),d=Symbol("flush"),g=Symbol("flushChunk"),y=Symbol("encoding"),_=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"),q=Symbol("destroyed"),P=Symbol("emitData"),$=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,p=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()}},b=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 ng 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[_]=this[y]?new s(this[y]):null,this[o]=!1,this[l]=!1,this[c]=!1,this[h]=!1,this[u]=null,this.writable=!0,this.readable=!0,this[I]=0,this[q]=!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[_]&&this[_].lastNeed||this[I]))throw new Error("cannot change encoding");this[y]!==E&&(this[_]=E?new s(E):null,this[T].length&&(this[T]=this[T].map(M=>this[_].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[q])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)&&(p(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[d](!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[_].lastNeed)&&(E=Buffer.from(E,M)),Buffer.isBuffer(E)&&this[y]&&(E=this[_].write(E)),this.flowing&&this[I]!==0&&this[d](!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[q])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[f](E||null,this[T][0]);return this[a](),M}[f](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[q]||(this[k]=!1,this[x]=!0,this.emit("resume"),this[T].length?this[d]():this[o]?this[a]():this.emit("drain"))}resume(){return this[C]()}pause(){this[x]=!1,this[k]=!0}get destroyed(){return this[q]}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()}[d](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[q])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 b(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[q]&&this[T].length===0&&this[o]&&(this[c]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[h]&&this.emit("close"),this[c]=!1)}emit(E,M,...B){if(E!=="error"&&E!=="close"&&E!==q&&this[q])return;if(E==="data")return M?this[V]?N(()=>this[P](M)):this[P](M):!1;if(E==="end")return this[$]();if(E==="close"){if(this[h]=!0,!this[l]&&!this[q])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}[$](){this[l]||(this[l]=!0,this.readable=!1,this[V]?N(()=>this[K]()):this[K]())}[K](){if(this[_]){let M=this[_].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(q,()=>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=re=>{this.removeListener("data",U),this.removeListener("end",J),B(re)},U=re=>{this.removeListener("error",Z),this.removeListener("end",J),this.pause(),M({value:re,done:!!this[o]})},J=()=>{this.removeListener("error",Z),this.removeListener("data",U),M({done:!0})},G=()=>Z(new Error("stream destroyed"));return new Promise((re,ce)=>{B=ce,M=re,this.once(q,G),this.once("error",Z),this.once("end",J),this.once("data",U)})}}}[j](){return{next:()=>{let E=this.read();return{value:E,done:E===null}}}}destroy(E){return this[q]?(E?this.emit("error",E):this.emit(q),this):(this[q]=!0,this[T].length=0,this[I]=0,typeof this.close=="function"&&!this[h]&&this.close(),E?this.emit("error",E):this.emit(q),this)}static isStream(E){return!!E&&(E instanceof ng||E instanceof n||E instanceof i&&(typeof E.pipe=="function"||typeof E.write=="function"&&typeof E.end=="function"))}}}),ek=ee((t,e)=>{W();var r=te("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))}),sg=ee((t,e)=>{"use strict";W();var r=typeof process=="object"&&process?process:{stdout:null,stderr:null},i=te("events"),n=te("stream"),s=te("string_decoder").StringDecoder,o=Symbol("EOF"),a=Symbol("maybeEmitEnd"),l=Symbol("emittedEnd"),c=Symbol("emittingEnd"),u=Symbol("emittedError"),h=Symbol("closed"),f=Symbol("read"),d=Symbol("flush"),g=Symbol("flushChunk"),y=Symbol("encoding"),_=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"),q=Symbol("emitEnd"),P=Symbol("emitEnd2"),$=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,b,R){this.src=m,this.dest=b,this.opts=R,this.ondrain=()=>m[C](),b.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},p=class extends D{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(m,b,R){super(m,b,R),this.proxyErrors=E=>b.emit("error",E),m.on("error",this.proxyErrors)}};e.exports=class og extends n{constructor(b){super(),this[x]=!1,this[k]=!1,this.pipes=[],this.buffer=[],this[w]=b&&b.objectMode||!1,this[w]?this[y]=null:this[y]=b&&b.encoding||null,this[y]==="buffer"&&(this[y]=null),this[$]=b&&!!b.async||!1,this[_]=this[y]?new s(this[y]):null,this[o]=!1,this[l]=!1,this[c]=!1,this[h]=!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(b){if(this[w])throw new Error("cannot set encoding in objectMode");if(this[y]&&b!==this[y]&&(this[_]&&this[_].lastNeed||this[T]))throw new Error("cannot change encoding");this[y]!==b&&(this[_]=b?new s(b):null,this.buffer.length&&(this.buffer=this.buffer.map(R=>this[_].write(R)))),this[y]=b}setEncoding(b){this.encoding=b}get objectMode(){return this[w]}set objectMode(b){this[w]=this[w]||!!b}get async(){return this[$]}set async(b){this[$]=this[$]||!!b}write(b,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[$]?K:B=>B();return!this[w]&&!Buffer.isBuffer(b)&&(z(b)?b=Buffer.from(b.buffer,b.byteOffset,b.byteLength):j(b)?b=Buffer.from(b):typeof b!="string"&&(this.objectMode=!0)),this[w]?(this.flowing&&this[T]!==0&&this[d](!0),this.flowing?this.emit("data",b):this[O](b),this[T]!==0&&this.emit("readable"),E&&M(E),this.flowing):b.length?(typeof b=="string"&&!(R===this[y]&&!this[_].lastNeed)&&(b=Buffer.from(b,R)),Buffer.isBuffer(b)&&this[y]&&(b=this[_].write(b)),this.flowing&&this[T]!==0&&this[d](!0),this.flowing?this.emit("data",b):this[O](b),this[T]!==0&&this.emit("readable"),E&&M(E),this.flowing):(this[T]!==0&&this.emit("readable"),E&&M(E),this.flowing)}read(b){if(this[v])return null;if(this[T]===0||b===0||b>this[T])return this[a](),null;this[w]&&(b=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[f](b||null,this.buffer[0]);return this[a](),R}[f](b,R){return b===R.length||b===null?this[I]():(this.buffer[0]=R.slice(b),R=R.slice(0,b),this[T]-=b),this.emit("data",R),!this.buffer.length&&!this[o]&&this.emit("drain"),R}end(b,R,E){return typeof b=="function"&&(E=b,b=null),typeof R=="function"&&(E=R,R="utf8"),b&&this.write(b,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[d]():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](b){this[w]?this[T]+=1:this[T]+=b.length,this.buffer.push(b)}[I](){return this.buffer.length&&(this[w]?this[T]-=1:this[T]-=this.buffer[0].length),this.buffer.shift()}[d](b){do;while(this[g](this[I]()));!b&&!this.buffer.length&&!this[o]&&this.emit("drain")}[g](b){return b?(this.emit("data",b),this.flowing):!1}pipe(b,R){if(this[v])return;let E=this[l];return R=R||{},b===r.stdout||b===r.stderr?R.end=!1:R.end=R.end!==!1,R.proxyErrors=!!R.proxyErrors,E?R.end&&b.end():(this.pipes.push(R.proxyErrors?new p(this,b,R):new D(this,b,R)),this[$]?K(()=>this[C]()):this[C]()),b}unpipe(b){let R=this.pipes.find(E=>E.dest===b);R&&(this.pipes.splice(this.pipes.indexOf(R),1),R.unpipe())}addListener(b,R){return this.on(b,R)}on(b,R){let E=super.on(b,R);return b==="data"&&!this.pipes.length&&!this.flowing?this[C]():b==="readable"&&this[T]!==0?super.emit("readable"):L(b)&&this[l]?(super.emit(b),this.removeAllListeners(b)):b==="error"&&this[u]&&(this[$]?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[h]&&this.emit("close"),this[c]=!1)}emit(b,R,...E){if(b!=="error"&&b!=="close"&&b!==v&&this[v])return;if(b==="data")return R?this[$]?K(()=>this[F](R)):this[F](R):!1;if(b==="end")return this[q]();if(b==="close"){if(this[h]=!0,!this[l]&&!this[v])return;let B=super.emit("close");return this.removeAllListeners("close"),B}else if(b==="error"){this[u]=R;let B=super.emit("error",R);return this[a](),B}else if(b==="resume"){let B=super.emit("resume");return this[a](),B}else if(b==="finish"||b==="prefinish"){let B=super.emit(b);return this.removeAllListeners(b),B}let M=super.emit(b,R,...E);return this[a](),M}[F](b){for(let E of this.pipes)E.dest.write(b)===!1&&this.pause();let R=super.emit("data",b);return this[a](),R}[q](){this[l]||(this[l]=!0,this.readable=!1,this[$]?K(()=>this[P]()):this[P]())}[P](){if(this[_]){let R=this[_].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 b=super.emit("end");return this.removeAllListeners("end"),b}collect(){let b=[];this[w]||(b.dataLength=0);let R=this.promise();return this.on("data",E=>{b.push(E),this[w]||(b.dataLength+=E.length)}),R.then(()=>b)}concat(){return this[w]?Promise.reject(new Error("cannot concat in objectMode")):this.collect().then(b=>this[w]?Promise.reject(new Error("cannot concat in objectMode")):this[y]?b.join(""):Buffer.concat(b,b.dataLength))}promise(){return new Promise((b,R)=>{this.on(v,()=>R(new Error("stream destroyed"))),this.on("error",E=>R(E)),this.on("end",()=>b())})}[N](){return{next:()=>{let b=this.read();if(b!==null)return Promise.resolve({done:!1,value:b});if(this[o])return Promise.resolve({done:!0});let R=null,E=null,M=J=>{this.removeListener("data",B),this.removeListener("end",Z),E(J)},B=J=>{this.removeListener("error",M),this.removeListener("end",Z),this.pause(),R({value:J,done:!!this[o]})},Z=()=>{this.removeListener("error",M),this.removeListener("data",B),R({done:!0})},U=()=>M(new Error("stream destroyed"));return new Promise((J,G)=>{E=G,R=J,this.once(v,U),this.once("error",M),this.once("end",Z),this.once("data",B)})}}}[A](){return{next:()=>{let b=this.read();return{value:b,done:b===null}}}}destroy(b){return this[v]?(b?this.emit("error",b):this.emit(v),this):(this[v]=!0,this.buffer.length=0,this[T]=0,typeof this.close=="function"&&!this[h]&&this.close(),b?this.emit("error",b):this.emit(v),this)}static isStream(b){return!!b&&(b instanceof og||b instanceof n||b instanceof i&&(typeof b.pipe=="function"||typeof b.write=="function"&&typeof b.end=="function"))}}}),ag=ee(t=>{"use strict";W();var e=te("assert"),r=te("buffer").Buffer,i=te("zlib"),n=t.constants=ek(),s=sg(),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"),h=Symbol("finishFlushFlag"),f=Symbol("fullFlushFlag"),d=Symbol("handle"),g=Symbol("onError"),y=Symbol("sawError"),_=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[h]=L.finishFlush;try{this[d]=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[d].on("error",z=>this[g](new l(z))),this.once("end",()=>this.close)}close(){this[d]&&(this[d].close(),this[d]=null,this.emit("close"))}reset(){if(!this[y])return e(this[d],"zlib binding closed"),this[d].reset()}flush(L){this.ended||(typeof L!="number"&&(L=this[f]),this.write(Object.assign(r.alloc(0),{[u]:L})))}end(L,j,z){return L&&this.write(L,j),this.flush(this[h]),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[d],"zlib binding closed");let D=this[d]._handle,p=D.close;D.close=()=>{};let m=this[d].close;this[d].close=()=>{},r.concat=E=>E;let b;try{let E=typeof L[u]=="number"?L[u]:this[u];b=this[d]._processChunk(L,E),r.concat=o}catch(E){r.concat=o,this[g](new l(E))}finally{this[d]&&(this[d]._handle=D,D.close=p,this[d].close=m,this[d].removeAllListeners("error"))}this[d]&&this[d].on("error",E=>this[g](new l(E)));let R;if(b)if(Array.isArray(b)&&b.length>0){R=this[a](r.from(b[0]));for(let E=1;E<b.length;E++)R=this[a](b[E])}else R=this[a](r.from(b));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[f]=n.Z_FULL_FLUSH,this[_]=L.level,this[x]=L.strategy}params(L,j){if(!this[y]){if(!this[d])throw new Error("cannot switch params when binding is closed");if(!this[d].params)throw new Error("not supported in this implementation");if(this[_]!==L||this[x]!==j){this.flush(n.Z_SYNC_FLUSH),e(this[d],"zlib binding closed");let z=this[d].flush;this[d].flush=(D,p)=>{this.flush(D),p()};try{this[d].params(L,j)}finally{this[d].flush=z}this[d]&&(this[_]=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)}},q=class extends O{constructor(L){super(L,"Gunzip")}},P=class extends O{constructor(L){super(L,"DeflateRaw")}},$=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[f]=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=q,t.DeflateRaw=P,t.InflateRaw=$,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")}}}),wn=ee((t,e)=>{W();var r=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform;e.exports=r!=="win32"?i=>i:i=>i&&i.replace(/\\/g,"/")}),Oc=ee((t,e)=>{"use strict";W();var r=Ac(),i=wn(),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])}}}),lg=ee(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]]))}),tk=ee((t,e)=>{"use strict";W();var r=(u,h)=>{if(Number.isSafeInteger(u))u<0?n(u,h):i(u,h);else throw Error("cannot encode number outside of javascript safe integer range");return h},i=(u,h)=>{h[0]=128;for(var f=h.length;f>1;f--)h[f-1]=u&255,u=Math.floor(u/256)},n=(u,h)=>{h[0]=255;var f=!1;u=u*-1;for(var d=h.length;d>1;d--){var g=u&255;u=Math.floor(u/256),f?h[d-1]=l(g):g===0?h[d-1]=0:(f=!0,h[d-1]=c(g))}},s=u=>{let h=u[0],f=h===128?a(u.slice(1,u.length)):h===255?o(u):null;if(f===null)throw Error("invalid base256 encoding");if(!Number.isSafeInteger(f))throw Error("parsed number outside of javascript safe integer range");return f},o=u=>{for(var h=u.length,f=0,d=!1,g=h-1;g>-1;g--){var y=u[g],_;d?_=l(y):y===0?_=y:(d=!0,_=c(y)),_!==0&&(f-=_*Math.pow(256,h-g-1))}return f},a=u=>{for(var h=u.length,f=0,d=h-1;d>-1;d--){var g=u[d];g!==0&&(f+=g*Math.pow(256,h-d-1))}return f},l=u=>(255^u)&255,c=u=>(255^u)+1&255;e.exports={encode:r,parse:s}}),Sn=ee((t,e)=>{"use strict";W();var r=lg(),i=te("path").posix,n=tk(),s=Symbol("slurp"),o=Symbol("type"),a=class{constructor(w,v,F,q){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,q):w&&this.set(w)}decode(w,v,F,q){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=f(w,v+100,8),this.uid=f(w,v+108,8),this.gid=f(w,v+116,8),this.size=f(w,v+124,12),this.mtime=u(w,v+136,12),this.cksum=f(w,v+148,12),this[s](F),this[s](q,!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=f(w,v+329,8),this.devmin=f(w,v+337,8),w[v+475]!==0){let $=c(w,v+345,155);this.path=$+"/"+this.path}else{let $=c(w,v+345,130);$&&(this.path=$+"/"+this.path),this.atime=u(w,v+476,12),this.ctime=u(w,v+488,12)}let P=8*32;for(let $=v;$<v+148;$++)P+=w[$];for(let $=v+156;$<v+512;$++)P+=w[$];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,q=l(this.path||"",F),P=q[0],$=q[1];this.needPax=q[2],this.needPax=I(w,v,100,P)||this.needPax,this.needPax=_(w,v+100,8,this.mode)||this.needPax,this.needPax=_(w,v+108,8,this.uid)||this.needPax,this.needPax=_(w,v+116,8,this.gid)||this.needPax,this.needPax=_(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=_(w,v+329,8,this.devmaj)||this.needPax,this.needPax=_(w,v+337,8,this.devmin)||this.needPax,this.needPax=I(w,v+345,F,$)||this.needPax,w[v+475]!==0?this.needPax=I(w,v+345,155,$)||this.needPax:(this.needPax=I(w,v+345,130,$)||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,_(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,q="",P,$=i.parse(w).root||".";if(Buffer.byteLength(F)<100)P=[F,q,!1];else{q=i.dirname(F),F=i.basename(F);do Buffer.byteLength(F)<=100&&Buffer.byteLength(q)<=v?P=[F,q,!1]:Buffer.byteLength(F)>100&&Buffer.byteLength(q)<=v?P=[F.slice(0,100-1),q,!0]:(F=i.join(i.basename(q),F),q=i.dirname(q));while(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)=>h(f(w,v,F)),h=w=>w===null?null:new Date(w*1e3),f=(w,v,F)=>w[v]&128?n.parse(w.slice(v,v+F)):g(w,v,F),d=w=>isNaN(w)?null:w,g=(w,v,F)=>d(parseInt(w.slice(v,v+F).toString("utf8").replace(/\0.*$/,"").trim(),8)),y={12:8589934591,8:2097151},_=(w,v,F,q)=>q===null?!1:q>y[F]||q<0?(n.encode(q,w.slice(v,v+F)),!0):(x(w,v,F,q),!1),x=(w,v,F,q)=>w.write(k(q,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,q)=>q===null?!1:_(w,v,F,q.getTime()/1e3),O=new Array(156).join("\0"),I=(w,v,F,q)=>q===null?!1:(w.write(q+O,v,F,"utf8"),q.length!==Buffer.byteLength(q)||q.length>F);e.exports=a}),Tc=ee((t,e)=>{"use strict";W();var r=Sn(),i=te("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),h=Buffer.allocUnsafe(u);for(let f=0;f<512;f++)h[f]=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(h),h.write(l,512,c,"utf8");for(let f=c+512;f<h.length;f++)h[f]=0;return h}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
40
|
`,h=Buffer.byteLength(u),f=Math.floor(Math.log(h)/Math.log(10))+1;return h+f>=Math.pow(10,f)&&(f+=1),f+h+u}};n.parse=(l,c,u)=>new n(s(o(l),c),u);var s=(l,c)=>c?Object.keys(l).reduce((u,h)=>(u[h]=l[h],u),c):l,o=l=>l.replace(/\n$/,"").split(`
|
41
|
-
`).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 h=c.split("="),f=h.shift().replace(/^SCHILY\.(dev|ino|nlink)/,"$1");if(!f)return l;let d=h.join("=");return l[f]=/^([A-Z]+\.)?([mac]|birth|creation)time$/.test(f)?new Date(d*1e3):/^[0-9]+$/.test(d)?+d:d,l};e.exports=n}),En=ee((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)}}),kc=ee((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))}}}),cg=ee((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)}}),ug=ee((t,e)=>{W();var{isAbsolute:r,parse:i}=te("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]}}),rk=ee((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)}),hg=ee((t,e)=>{"use strict";W();var r=Ac(),i=Tc(),n=Sn(),s=te("fs"),o=te("path"),a=wn(),l=En(),c=(m,b)=>b?(m=a(m).replace(/^\.(\/|$)/,""),l(b)+"/"+m):a(m),u=16*1024*1024,h=Symbol("process"),f=Symbol("file"),d=Symbol("directory"),g=Symbol("symlink"),y=Symbol("hardlink"),_=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"),q=Symbol("awaitDrain"),P=Symbol("ondrain"),$=Symbol("prefix"),K=Symbol("hadError"),V=kc(),N=cg(),A=ug(),L=rk(),j=V(class extends r{constructor(m,b){if(b=b||{},super(b),typeof m!="string")throw new TypeError("path is required");this.path=a(m),this.portable=!!b.portable,this.myuid=process.getuid&&process.getuid()||0,this.myuser=process.env.USER||"",this.maxReadSize=b.maxReadSize||u,this.linkCache=b.linkCache||new Map,this.statCache=b.statCache||new Map,this.preservePaths=!!b.preservePaths,this.cwd=a(b.cwd||process.cwd()),this.strict=!!b.strict,this.noPax=!!b.noPax,this.noMtime=!!b.noMtime,this.mtime=b.mtime||null,this.prefix=b.prefix?a(b.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 b.onwarn=="function"&&this.on("warn",b.onwarn);let R=!1;if(!this.preservePaths){let[E,M]=A(this.path);E&&(this.path=M,R=E)}this.win32=!!b.win32||process.platform==="win32",this.win32&&(this.path=N.decode(this.path.replace(/\\/g,"/")),m=m.replace(/\\/g,"/")),this.absolute=a(b.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,...b){return m==="error"&&(this[K]=!0),super.emit(m,...b)}[k](){s.lstat(this.absolute,(m,b)=>{if(m)return this.emit("error",m);this[C](b)})}[C](m){this.statCache.set(this.absolute,m),this.stat=m,m.isFile()||(m.size=0),this.type=p(m),this.emit("stat",m),this[h]()}[h](){switch(this.type){case"File":return this[f]();case"Directory":return this[d]();case"SymbolicLink":return this[g]();default:return this.end()}}[F](m){return L(m,this.type==="Directory",this.portable)}[$](m){return c(m,this.prefix)}[_](){this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.header=new n({path:this[$](this.path),linkpath:this.type==="Link"?this[$](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[$](this.path),linkpath:this.type==="Link"?this[$](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)}[d](){this.path.slice(-1)!=="/"&&(this.path+="/"),this.stat.size=0,this[_](),this.end()}[g](){s.readlink(this.absolute,(m,b)=>{if(m)return this.emit("error",m);this[O](b)})}[O](m){this.linkpath=a(m),this[_](),this.end()}[y](m){this.type="Link",this.linkpath=a(o.relative(this.cwd,m)),this.stat.size=0,this[_](),this.end()}[f](){if(this.stat.nlink>1){let m=this.stat.dev+":"+this.stat.ino;if(this.linkCache.has(m)){let b=this.linkCache.get(m);if(b.indexOf(this.cwd)===0)return this[y](b)}this.linkCache.set(m,this.absolute)}if(this[_](),this.stat.size===0)return this.end();this[I]()}[I](){s.open(this.absolute,"r",(m,b)=>{if(m)return this.emit("error",m);this[w](b)})}[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 b=Math.min(this.blockLen,this.maxReadSize);this.buf=Buffer.allocUnsafe(b),this.offset=0,this.pos=0,this.remain=this.stat.size,this.length=this.buf.length,this[x]()}[x](){let{fd:m,buf:b,offset:R,length:E,pos:M}=this;s.read(m,b,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 b=this.offset===0&&m===this.buf.length?this.buf:this.buf.slice(this.offset,this.offset+m);this.write(b)?this[P]():this[q](()=>this[P]())}[q](m){this.once("drain",m)}write(m){if(this.blockRemain<m.length){let b=new Error("writing more data than expected");return b.path=this.absolute,this.emit("error",b)}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:b,buf:R,offset:E,length:M,pos:B}=this,Z=s.readSync(b,R,E,M,B);this[T](Z),m=!1}finally{if(m)try{this[v](()=>{})}catch{}}}[q](m){m()}[v](m){s.closeSync(this.fd),m()}},D=V(class extends r{constructor(m,b){b=b||{},super(b),this.preservePaths=!!b.preservePaths,this.portable=!!b.portable,this.strict=!!b.strict,this.noPax=!!b.noPax,this.noMtime=!!b.noMtime,this.readEntry=m,this.type=m.type,this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.prefix=b.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:b.mtime||m.mtime,this.atime=this.portable?null:m.atime,this.ctime=this.portable?null:m.ctime,this.linkpath=a(m.linkpath),typeof b.onwarn=="function"&&this.on("warn",b.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[$](this.path),linkpath:this.type==="Link"?this[$](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[$](this.path),linkpath:this.type==="Link"?this[$](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)}[$](m){return c(m,this.prefix)}[F](m){return L(m,this.type==="Directory",this.portable)}write(m){let b=m.length;if(b>this.blockRemain)throw new Error("writing more to entry than is appropriate");return this.blockRemain-=b,super.write(m)}end(){return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),super.end()}});j.Sync=z,j.Tar=D;var p=m=>m.isFile()?"File":m.isDirectory()?"Directory":m.isSymbolicLink()?"SymbolicLink":"Unsupported";e.exports=j}),ik=ee((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}}}),fg=ee((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(h){l.push(h)});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 h=0;u!==null;h++)c=a(c,u.value,h),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 h=this.length-1;u!==null;h--)c=a(c,u.value,h),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,h=this.head;h!==null&&u<a;u++)h=h.next;for(;h!==null&&u<l;u++,h=h.next)c.push(h.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,h=this.tail;h!==null&&u>l;u--)h=h.prev;for(;h!==null&&u>a;u--,h=h.prev)c.push(h.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,h=this.head;h!==null&&u<a;u++)h=h.next;for(var f=[],u=0;h&&u<l;u++)f.push(h.value),h=this.removeNode(h);h===null&&(h=this.tail),h!==this.head&&h!==this.tail&&(h=h.prev);for(var u=0;u<c.length;u++)h=i(this,h,c[u]);return f},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{ik()(r)}catch{}}),Cc=ee((t,e)=>{"use strict";W();var r=class{constructor(p,m){this.path=p||"./",this.absolute=m,this.entry=null,this.stat=null,this.readdir=null,this.pending=!1,this.ignore=!1,this.piped=!1}},i=Ac(),n=ag(),s=Oc(),o=hg(),a=o.Sync,l=o.Tar,c=fg(),u=Buffer.alloc(1024),h=Symbol("onStat"),f=Symbol("ended"),d=Symbol("queue"),g=Symbol("current"),y=Symbol("process"),_=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"),q=Symbol("entry"),P=Symbol("entryOpt"),$=Symbol("writeEntryClass"),K=Symbol("write"),V=Symbol("ondrain"),N=te("fs"),A=te("path"),L=kc(),j=wn(),z=L(class extends i{constructor(p){super(p),p=p||Object.create(null),this.opt=p,this.file=p.file||"",this.cwd=p.cwd||process.cwd(),this.maxReadSize=p.maxReadSize,this.preservePaths=!!p.preservePaths,this.strict=!!p.strict,this.noPax=!!p.noPax,this.prefix=j(p.prefix||""),this.linkCache=p.linkCache||new Map,this.statCache=p.statCache||new Map,this.readdirCache=p.readdirCache||new Map,this[$]=o,typeof p.onwarn=="function"&&this.on("warn",p.onwarn),this.portable=!!p.portable,this.zip=null,p.gzip?(typeof p.gzip!="object"&&(p.gzip={}),this.portable&&(p.gzip.portable=!0),this.zip=new n.Gzip(p.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=!!p.noDirRecurse,this.follow=!!p.follow,this.noMtime=!!p.noMtime,this.mtime=p.mtime||null,this.filter=typeof p.filter=="function"?p.filter:m=>!0,this[d]=new c,this[k]=0,this.jobs=+p.jobs||4,this[_]=!1,this[f]=!1}[K](p){return super.write(p)}add(p){return this.write(p),this}end(p){return p&&this.write(p),this[f]=!0,this[y](),this}write(p){if(this[f])throw new Error("write after end");return p instanceof s?this[O](p):this[T](p),this.flowing}[O](p){let m=j(A.resolve(this.cwd,p.path));if(!this.filter(p.path,p))p.resume();else{let b=new r(p.path,m,!1);b.entry=new l(p,this[P](b)),b.entry.on("end",R=>this[C](b)),this[k]+=1,this[d].push(b)}this[y]()}[T](p){let m=j(A.resolve(this.cwd,p));this[d].push(new r(p,m)),this[y]()}[I](p){p.pending=!0,this[k]+=1;let m=this.follow?"stat":"lstat";N[m](p.absolute,(b,R)=>{p.pending=!1,this[k]-=1,b?this.emit("error",b):this[h](p,R)})}[h](p,m){this.statCache.set(p.absolute,m),p.stat=m,this.filter(p.path,m)||(p.ignore=!0),this[y]()}[w](p){p.pending=!0,this[k]+=1,N.readdir(p.absolute,(m,b)=>{if(p.pending=!1,this[k]-=1,m)return this.emit("error",m);this[v](p,b)})}[v](p,m){this.readdirCache.set(p.absolute,m),p.readdir=m,this[y]()}[y](){if(!this[_]){this[_]=!0;for(let p=this[d].head;p!==null&&this[k]<this.jobs;p=p.next)if(this[x](p.value),p.value.ignore){let m=p.next;this[d].removeNode(p),p.next=m}this[_]=!1,this[f]&&!this[d].length&&this[k]===0&&(this.zip?this.zip.end(u):(super.write(u),super.end()))}}get[g](){return this[d]&&this[d].head&&this[d].head.value}[C](p){this[d].shift(),this[k]-=1,this[y]()}[x](p){if(!p.pending){if(p.entry){p===this[g]&&!p.piped&&this[F](p);return}if(p.stat||(this.statCache.has(p.absolute)?this[h](p,this.statCache.get(p.absolute)):this[I](p)),!!p.stat&&!p.ignore&&!(!this.noDirRecurse&&p.stat.isDirectory()&&!p.readdir&&(this.readdirCache.has(p.absolute)?this[v](p,this.readdirCache.get(p.absolute)):this[w](p),!p.readdir))){if(p.entry=this[q](p),!p.entry){p.ignore=!0;return}p===this[g]&&!p.piped&&this[F](p)}}}[P](p){return{onwarn:(m,b,R)=>this.warn(m,b,R),noPax:this.noPax,cwd:this.cwd,absolute:p.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}}[q](p){this[k]+=1;try{return new this[$](p.path,this[P](p)).on("end",()=>this[C](p)).on("error",m=>this.emit("error",m))}catch(m){this.emit("error",m)}}[V](){this[g]&&this[g].entry&&this[g].entry.resume()}[F](p){p.piped=!0,p.readdir&&p.readdir.forEach(R=>{let E=p.path,M=E==="./"?"":E.replace(/\/*$/,"/");this[T](M+R)});let m=p.entry,b=this.zip;b?m.on("data",R=>{b.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(p){super(p),this[$]=a}pause(){}resume(){}[I](p){let m=this.follow?"statSync":"lstatSync";this[h](p,N[m](p.absolute))}[w](p,m){this[v](p,N.readdirSync(p.absolute))}[F](p){let m=p.entry,b=this.zip;p.readdir&&p.readdir.forEach(R=>{let E=p.path,M=E==="./"?"":E.replace(/\/*$/,"/");this[T](M+R)}),b?m.on("data",R=>{b.write(R)}):m.on("data",R=>{super[K](R)})}};z.Sync=D,e.exports=z}),vn=ee(t=>{"use strict";W();var e=sg(),r=te("events").EventEmitter,i=te("fs"),n=i.writev;if(!n){let p=process.binding("fs"),m=p.FSReqWrap||p.FSReqCallback;n=(b,R,E,M)=>{let B=(U,J)=>M(U,J,R),Z=new m;Z.oncomplete=B,p.writeBuffers(b,R,E,Z)}}var s=Symbol("_autoClose"),o=Symbol("_close"),a=Symbol("_ended"),l=Symbol("_fd"),c=Symbol("_finished"),u=Symbol("_flags"),h=Symbol("_flush"),f=Symbol("_handleChunk"),d=Symbol("_makeBuf"),g=Symbol("_mode"),y=Symbol("_needDrain"),_=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"),q=Symbol("_reading"),P=Symbol("_remain"),$=Symbol("_size"),K=Symbol("_write"),V=Symbol("_writing"),N=Symbol("_defaultFlag"),A=Symbol("_errored"),L=class extends e{constructor(p,m){if(m=m||{},super(m),this.readable=!0,this.writable=!1,typeof p!="string")throw new TypeError("path must be a string");this[A]=!1,this[l]=typeof m.fd=="number"?m.fd:null,this[O]=p,this[F]=m.readSize||16*1024*1024,this[q]=!1,this[$]=typeof m.size=="number"?m.size:1/0,this[P]=this[$],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",(p,m)=>this[x](p,m))}[x](p,m){p?this[_](p):(this[l]=m,this.emit("open",m),this[v]())}[d](){return Buffer.allocUnsafe(Math.min(this[F],this[P]))}[v](){if(!this[q]){this[q]=!0;let p=this[d]();if(p.length===0)return process.nextTick(()=>this[k](null,0,p));i.read(this[l],p,0,p.length,null,(m,b,R)=>this[k](m,b,R))}}[k](p,m,b){this[q]=!1,p?this[_](p):this[f](m,b)&&this[v]()}[o](){if(this[s]&&typeof this[l]=="number"){let p=this[l];this[l]=null,i.close(p,m=>m?this.emit("error",m):this.emit("close"))}}[_](p){this[q]=!0,this[o](),this.emit("error",p)}[f](p,m){let b=!1;return this[P]-=p,p>0&&(b=super.write(p<m.length?m.slice(0,p):m)),(p===0||this[P]<=0)&&(b=!1,this[o](),super.end()),b}emit(p,m){switch(p){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(p,m));default:return super.emit(p,m)}}},j=class extends L{[T](){let p=!0;try{this[x](null,i.openSync(this[O],"r")),p=!1}finally{p&&this[o]()}}[v](){let p=!0;try{if(!this[q]){this[q]=!0;do{let m=this[d](),b=m.length===0?0:i.readSync(this[l],m,0,m.length,null);if(!this[f](b,m))break}while(!0);this[q]=!1}p=!1}finally{p&&this[o]()}}[o](){if(this[s]&&typeof this[l]=="number"){let p=this[l];this[l]=null,i.closeSync(p),this.emit("close")}}},z=class extends r{constructor(p,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]=p,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 b=this[I]!==null?"r+":"w";this[N]=m.flags===void 0,this[u]=this[N]?b:m.flags,this[l]===null&&this[T]()}emit(p,m){if(p==="error"){if(this[A])return;this[A]=!0}return super.emit(p,m)}get fd(){return this[l]}get path(){return this[O]}[_](p){this[o](),this[V]=!0,this.emit("error",p)}[T](){i.open(this[O],this[u],this[g],(p,m)=>this[x](p,m))}[x](p,m){this[N]&&this[u]==="r+"&&p&&p.code==="ENOENT"?(this[u]="w",this[T]()):p?this[_](p):(this[l]=m,this.emit("open",m),this[h]())}end(p,m){return p&&this.write(p,m),this[a]=!0,!this[V]&&!this[w].length&&typeof this[l]=="number"&&this[C](null,0),this}write(p,m){return typeof p=="string"&&(p=Buffer.from(p,m)),this[a]?(this.emit("error",new Error("write() after end()")),!1):this[l]===null||this[V]||this[w].length?(this[w].push(p),this[y]=!0,!1):(this[V]=!0,this[K](p),!0)}[K](p){i.write(this[l],p,0,p.length,this[I],(m,b)=>this[C](m,b))}[C](p,m){p?this[_](p):(this[I]!==null&&(this[I]+=m),this[w].length?this[h]():(this[V]=!1,this[a]&&!this[c]?(this[c]=!0,this[o](),this.emit("finish")):this[y]&&(this[y]=!1,this.emit("drain"))))}[h](){if(this[w].length===0)this[a]&&this[C](null,0);else if(this[w].length===1)this[K](this[w].pop());else{let p=this[w];this[w]=[],n(this[l],p,this[I],(m,b)=>this[C](m,b))}}[o](){if(this[s]&&typeof this[l]=="number"){let p=this[l];this[l]=null,i.close(p,m=>m?this.emit("error",m):this.emit("close"))}}},D=class extends z{[T](){let p;if(this[N]&&this[u]==="r+")try{p=i.openSync(this[O],this[u],this[g])}catch(m){if(m.code==="ENOENT")return this[u]="w",this[T]();throw m}else p=i.openSync(this[O],this[u],this[g]);this[x](null,p)}[o](){if(this[s]&&typeof this[l]=="number"){let p=this[l];this[l]=null,i.closeSync(p),this.emit("close")}}[K](p){let m=!0;try{this[C](null,i.writeSync(this[l],p,0,p.length,this[I])),m=!1}finally{if(m)try{this[o]()}catch{}}}};t.ReadStream=L,t.ReadStreamSync=j,t.WriteStream=z,t.WriteStreamSync=D}),Lc=ee((t,e)=>{"use strict";W();var r=kc(),i=Sn(),n=te("events"),s=fg(),o=1024*1024,a=Oc(),l=Tc(),c=ag(),{nextTick:u}=te("process"),h=Buffer.from([31,139]),f=Symbol("state"),d=Symbol("writeEntry"),g=Symbol("readEntry"),y=Symbol("nextEntry"),_=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"),q=Symbol("unzip"),P=Symbol("consumeChunk"),$=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"),p=Symbol("onDone"),m=Symbol("sawValidEntry"),b=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(p,Z=>{(this[f]==="begin"||this[m]===!1)&&this.warn("TAR_BAD_ARCHIVE","Unrecognized archive format")}),B.ondone?this.on(p,B.ondone):this.on(p,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[d]=null,this[f]="begin",this[C]="",this[x]=null,this[k]=null,this[w]=!1,this[q]=null,this[D]=!1,this[b]=!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(J){return this.warn("TAR_ENTRY_INVALID",J)}if(U.nullBlock)this[b]?(this[R]=!0,this[f]==="begin"&&(this[f]="header"),this[F]("eof")):(this[b]=!0,this[F]("nullBlock"));else if(this[b]=!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 J=U.type;if(/^(Symbolic)?Link$/.test(J)&&!U.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath required",{header:U});else if(!/^(Symbolic)?Link$/.test(J)&&U.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath forbidden",{header:U});else{let G=this[d]=new a(U,this[x],this[k]);if(!this[m])if(G.remain){let re=()=>{G.invalid||(this[m]=!0)};G.on("end",re)}else this[m]=!0;G.meta?G.size>this.maxMetaEntrySize?(G.ignore=!0,this[F]("ignoredEntry",G),this[f]="ignore",G.resume()):G.size>0&&(this[C]="",G.on("data",re=>this[C]+=re),this[f]="meta"):(this[x]=null,G.ignore=G.ignore||!this.filter(G.path,G),G.ignore?(this[F]("ignoredEntry",G),this[f]=G.remain?"ignore":"header",G.resume()):(G.remain?this[f]="body":(this[f]="header",G.end()),this[g]?this[I].push(G):(this[I].push(G),this[y]())))}}}[E](){u(()=>this.emit("close"))}[_](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[_](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[d],J=U.blockRemain,G=J>=B.length&&Z===0?B:B.slice(Z,Z+J);return U.write(G),U.blockRemain||(this[f]="header",this[d]=null,U.end()),G.length}[V](B,Z){let U=this[d],J=this[K](B,Z);return this[d]||this[T](U),J}[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[q]===null&&B){if(this[O]&&(B=Buffer.concat([this[O],B]),this[O]=null),B.length<h.length)return this[O]=B,!0;for(let U=0;this[q]===null&&U<h.length;U++)B[U]!==h[U]&&(this[q]=!1);if(this[q]===null){let U=this[w];this[w]=!1,this[q]=new c.Unzip,this[q].on("data",G=>this[P](G)),this[q].on("error",G=>this.abort(G)),this[q].on("end",G=>{this[w]=!0,this[P]()}),this[z]=!0;let J=this[q][U?"end":"write"](B);return this[z]=!1,J}}this[z]=!0,this[q]?this[q].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[d];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](p)}}[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[$](Z)}else this[$](B);for(;this[O]&&this[O].length>=512&&!this[D]&&!this[R];){let Z=this[O];this[O]=null,this[$](Z)}this[A]=!1}(!this[O]||this[w])&&this[j]()}[$](B){let Z=0,U=B.length;for(;Z+512<=U&&!this[D]&&!this[R];)switch(this[f]){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[f])}Z<U&&(this[O]?this[O]=Buffer.concat([B.slice(Z),this[O]]):this[O]=B.slice(Z))}end(B){this[D]||(this[q]?this[q].end(B):(this[w]=!0,this.write(B)))}})}),Pc=ee((t,e)=>{"use strict";W();var r=bn(),i=Lc(),n=te("fs"),s=vn(),o=te("path"),a=En();e.exports=(d,g,y)=>{typeof d=="function"?(y=d,g=null,d={}):Array.isArray(d)&&(g=d,d={}),typeof g=="function"&&(y=g,g=null),g?g=Array.from(g):g=[];let _=r(d);if(_.sync&&typeof y=="function")throw new TypeError("callback not supported for sync tar functions");if(!_.file&&typeof y=="function")throw new TypeError("callback only supported with file option");return g.length&&c(_,g),_.noResume||l(_),_.file&&_.sync?u(_):_.file?h(_,y):f(_)};var l=d=>{let g=d.onentry;d.onentry=g?y=>{g(y),y.resume()}:y=>y.resume()},c=(d,g)=>{let y=new Map(g.map(k=>[a(k),!0])),_=d.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};d.filter=_?(k,C)=>_(k,C)&&x(a(k)):k=>x(a(k))},u=d=>{let g=f(d),y=d.file,_=!0,x;try{let k=n.statSync(y),C=d.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()}_=!1}finally{if(_&&x)try{n.closeSync(x)}catch{}}},h=(d,g)=>{let y=new i(d),_=d.maxReadSize||16*1024*1024,x=d.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:_,size:I.size});w.on("error",T),w.pipe(y)}})});return g?k.then(g,g):k},f=d=>new i(d)}),nk=ee((t,e)=>{"use strict";W();var r=bn(),i=Cc(),n=vn(),s=Pc(),o=te("path");e.exports=(d,g,y)=>{if(typeof g=="function"&&(y=g),Array.isArray(d)&&(g=d,d={}),!g||!Array.isArray(g)||!g.length)throw new TypeError("no files or directories specified");g=Array.from(g);let _=r(d);if(_.sync&&typeof y=="function")throw new TypeError("callback not supported for sync tar functions");if(!_.file&&typeof y=="function")throw new TypeError("callback only supported with file option");return _.file&&_.sync?a(_,g):_.file?l(_,g,y):_.sync?h(_,g):f(_,g)};var a=(d,g)=>{let y=new i.Sync(d),_=new n.WriteStreamSync(d.file,{mode:d.mode||438});y.pipe(_),c(y,g)},l=(d,g,y)=>{let _=new i(d),x=new n.WriteStream(d.file,{mode:d.mode||438});_.pipe(x);let k=new Promise((C,T)=>{x.on("error",T),x.on("close",C),_.on("error",T)});return u(_,g),y?k.then(y,y):k},c=(d,g)=>{g.forEach(y=>{y.charAt(0)==="@"?s({file:o.resolve(d.cwd,y.slice(1)),sync:!0,noResume:!0,onentry:_=>d.add(_)}):d.add(y)}),d.end()},u=(d,g)=>{for(;g.length;){let y=g.shift();if(y.charAt(0)==="@")return s({file:o.resolve(d.cwd,y.slice(1)),noResume:!0,onentry:_=>d.add(_)}).then(_=>u(d,g));d.add(y)}d.end()},h=(d,g)=>{let y=new i.Sync(d);return c(y,g),y},f=(d,g)=>{let y=new i(d);return u(y,g),y}}),pg=ee((t,e)=>{"use strict";W();var r=bn(),i=Cc(),n=te("fs"),s=vn(),o=Pc(),a=te("path"),l=Sn();e.exports=(g,y,_)=>{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):h(x,y,_)};var c=(g,y)=>{let _=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,_,C,k,y)}finally{if(x)try{n.closeSync(k)}catch{}}},u=(g,y,_,x,k)=>{let C=new s.WriteStreamSync(g.file,{fd:x,start:_});y.pipe(C),f(y,k)},h=(g,y,_)=>{y=Array.from(y);let x=new i(g),k=(T,O,I)=>{let w=($,K)=>{$?n.close(T,V=>I($)):I(null,K)},v=0;if(O===0)return w(null,0);let F=0,q=Buffer.alloc(512),P=($,K)=>{if($)return w($);if(F+=K,F<512&&K)return n.read(T,q,F,q.length-F,v+F,P);if(v===0&&q[0]===31&&q[1]===139)return w(new Error("cannot append to compressed archives"));if(F<512)return w(null,v);let V=new l(q);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,q,0,512,v,P)};n.read(T,q,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,(q,P)=>{if(q)return n.close(F,()=>O(q));k(F,P.size,($,K)=>{if($)return O($);let V=new s.WriteStream(g.file,{fd:F,start:K});x.pipe(V),V.on("error",O),V.on("close",T),d(x,y)})})};n.open(g.file,I,w)});return _?C.then(_,_):C},f=(g,y)=>{y.forEach(_=>{_.charAt(0)==="@"?o({file:a.resolve(g.cwd,_.slice(1)),sync:!0,noResume:!0,onentry:x=>g.add(x)}):g.add(_)}),g.end()},d=(g,y)=>{for(;y.length;){let _=y.shift();if(_.charAt(0)==="@")return o({file:a.resolve(g.cwd,_.slice(1)),noResume:!0,onentry:x=>g.add(x)}).then(x=>d(g,y));g.add(_)}g.end()}}),sk=ee((t,e)=>{"use strict";W();var r=bn(),i=pg();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)}}),ok=ee((t,e)=>{W();var{promisify:r}=te("util"),i=te("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}),ak=ee((t,e)=>{W();var r=process.env.__TESTING_MKDIRP_PLATFORM__||process.platform,{resolve:i,parse:n}=te("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}),lk=ee((t,e)=>{W();var{dirname:r}=te("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}}),dg=ee((t,e)=>{W();var{dirname:r}=te("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}}),ck=ee((t,e)=>{W();var{dirname:r}=te("path"),{findMade:i,findMadeSync:n}=lk(),{mkdirpManual:s,mkdirpManualSync:o}=dg(),a=(c,u)=>(u.recursive=!0,r(c)===c?u.mkdirAsync(c,u):i(u,c).then(h=>u.mkdirAsync(c,u).then(()=>h).catch(f=>{if(f.code==="ENOENT")return s(c,u);throw f}))),l=(c,u)=>{if(u.recursive=!0,r(c)===c)return u.mkdirSync(c,u);let h=n(u,c);try{return u.mkdirSync(c,u),h}catch(f){if(f.code==="ENOENT")return o(c,u);throw f}};e.exports={mkdirpNative:a,mkdirpNativeSync:l}}),uk=ee((t,e)=>{W();var r=te("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}}),hk=ee((t,e)=>{W();var r=ok(),i=ak(),{mkdirpNative:n,mkdirpNativeSync:s}=ck(),{mkdirpManual:o,mkdirpManualSync:a}=dg(),{useNative:l,useNativeSync:c}=uk(),u=(f,d)=>(f=i(f),d=r(d),l(d)?n(f,d):o(f,d)),h=(f,d)=>(f=i(f),d=r(d),c(d)?s(f,d):a(f,d));u.sync=h,u.native=(f,d)=>n(i(f),r(d)),u.manual=(f,d)=>o(i(f),r(d)),u.nativeSync=(f,d)=>s(i(f),r(d)),u.manualSync=(f,d)=>a(i(f),r(d)),e.exports=u}),fk=ee((t,e)=>{"use strict";W();var r=te("fs"),i=te("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),h=process.version,f=(C,T,O)=>r.readdir(C,T,O),d=(C,T)=>r.readdirSync(C,T);/^v4\./.test(h)&&(f=(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())_(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)}},_=(C,T,O,I)=>{f(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,q=null,P=$=>{if(!q){if($)return I(q=$);if(--F===0)return g(C,T,O,I)}};v.forEach($=>y(C,$,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=d(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=_,_.sync=k}),pk=ee((t,e)=>{"use strict";W();var r=hk(),i=te("fs"),n=te("path"),s=fk(),o=wn(),a=class extends Error{constructor(y,_){super("Cannot extract through symbolic link"),this.path=_,this.symlink=y}get name(){return"SylinkError"}},l=class extends Error{constructor(y,_){super(_+": Cannot cd into '"+y+"'"),this.path=y,this.code=_}get name(){return"CwdError"}},c=(y,_)=>y.get(o(_)),u=(y,_,x)=>y.set(o(_),x),h=(y,_)=>{i.stat(y,(x,k)=>{(x||!k.isDirectory())&&(x=new l(y,x&&x.code||"ENOTDIR")),_(x)})};e.exports=(y,_,x)=>{y=o(y);let k=_.umask,C=_.mode|448,T=(C&k)!==0,O=_.uid,I=_.gid,w=typeof O=="number"&&typeof I=="number"&&(O!==_.processUid||I!==_.processGid),v=_.preserve,F=_.unlink,q=_.cache,P=o(_.cwd),$=(V,N)=>{V?x(V):(u(q,y,!0),N&&w?s(N,O,I,A=>$(A)):T?i.chmod(y,C,x):x())};if(q&&c(q,y)===!0)return $();if(y===P)return h(y,$);if(v)return r(y,{mode:C}).then(V=>$(null,V),$);let K=o(n.relative(P,y)).split("/");f(P,K,C,q,F,P,null,$)};var f=(y,_,x,k,C,T,O,I)=>{if(!_.length)return I(null,O);let w=_.shift(),v=o(n.resolve(y+"/"+w));if(c(k,v))return f(v,_,x,k,C,T,O,I);i.mkdir(v,x,d(v,_,x,k,C,T,O,I))},d=(y,_,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())f(y,_,x,k,C,T,O,I);else if(C)i.unlink(y,q=>{if(q)return I(q);i.mkdir(y,x,d(y,_,x,k,C,T,O,I))});else{if(F.isSymbolicLink())return I(new a(y,y+"/"+_.join("/")));I(w)}}):(O=O||y,f(y,_,x,k,C,T,O,I))},g=y=>{let _=!1,x="ENOTDIR";try{_=i.statSync(y).isDirectory()}catch(k){x=k.code}finally{if(!_)throw new l(y,x)}};e.exports.sync=(y,_)=>{y=o(y);let x=_.umask,k=_.mode|448,C=(k&x)!==0,T=_.uid,O=_.gid,I=typeof T=="number"&&typeof O=="number"&&(T!==_.processUid||O!==_.processGid),w=_.preserve,v=_.unlink,F=_.cache,q=o(_.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===q)return g(q),P();if(w)return P(r.sync(y,k));let $=o(n.relative(q,y)).split("/"),K=null;for(let V=$.shift(),N=q;V&&(N+="/"+V);V=$.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+"/"+$.join("/"))}return P(K)}}),mg=ee((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])}),dk=ee((t,e)=>{W();var r=te("assert"),i=mg(),n=En(),{join:s}=te("path"),o=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,a=o==="win32";e.exports=()=>{let l=new Map,c=new Map,u=_=>_.split("/").slice(0,-1).reduce((x,k)=>(x.length&&(k=s(x[x.length-1],k)),x.push(k||"/"),x),[]),h=new Set,f=_=>{let x=c.get(_);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))}},d=_=>{let{paths:x,dirs:k}=f(_);return x.every(C=>C[0]===_)&&k.every(C=>C[0]instanceof Set&&C[0].has(_))},g=_=>h.has(_)||!d(_)?!1:(h.add(_),_(()=>y(_)),!0),y=_=>{if(!h.has(_))return!1;let{paths:x,dirs:k}=c.get(_),C=new Set;return x.forEach(T=>{let O=l.get(T);r.equal(O[0],_),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(_)}),h.delete(_),C.forEach(T=>g(T)),!0};return{check:d,reserve:(_,x)=>{_=a?["win32 parallelization disabled"]:_.map(C=>i(n(s(C))).toLowerCase());let k=new Set(_.map(C=>u(C)).reduce((C,T)=>C.concat(T)));return c.set(x,{dirs:k,paths:_}),_.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)}}}}),mk=ee((t,e)=>{W();var r=process.env.__FAKE_PLATFORM__||process.platform,i=r==="win32",n=global.__FAKE_TESTING_FS__||te("fs"),{O_CREAT:s,O_TRUNC:o,O_WRONLY:a,UV_FS_O_FILEMAP:l=0}=n.constants,c=i&&!!l,u=512*1024,h=l|o|s|a;e.exports=c?f=>f<u?h:"w":()=>"w"}),yg=ee((t,e)=>{"use strict";W();var r=te("assert"),i=Lc(),n=te("fs"),s=vn(),o=te("path"),a=pk(),l=cg(),c=dk(),u=ug(),h=wn(),f=En(),d=mg(),g=Symbol("onEntry"),y=Symbol("checkFs"),_=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"),q=Symbol("checkPath"),P=Symbol("mkdir"),$=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"),p=Symbol("gid"),m=Symbol("checkedCwd"),b=te("crypto"),R=mk(),E=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,M=E==="win32",B=(S,Y)=>{if(!M)return n.unlink(S,Y);let X=S+".DELETE."+b.randomBytes(16).toString("hex");n.rename(S,X,se=>{if(se)return Y(se);n.unlink(X,Y)})},Z=S=>{if(!M)return n.unlinkSync(S);let Y=S+".DELETE."+b.randomBytes(16).toString("hex");n.renameSync(S,Y),n.unlinkSync(Y)},U=(S,Y,X)=>S===S>>>0?S:Y===Y>>>0?Y:X,J=S=>d(f(h(S))).toLowerCase(),G=(S,Y)=>{Y=J(Y);for(let X of S.keys()){let se=J(X);(se===Y||se.indexOf(Y+"/")===0)&&S.delete(X)}},re=S=>{for(let Y of S.keys())S.delete(Y)},ce=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=h(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,X={}){return(S==="TAR_BAD_ARCHIVE"||S==="TAR_ABORT")&&(X.recoverable=!1),super.warn(S,Y,X)}[L](){this[A]&&this[K]===0&&(this.emit("prefinish"),this.emit("finish"),this.emit("end"))}[q](S){if(this.strip){let Y=h(S.path).split("/");if(Y.length<this.strip)return!1;if(S.path=Y.slice(this.strip).join("/"),S.type==="Link"){let X=h(S.linkpath).split("/");if(X.length>=this.strip)S.linkpath=X.slice(this.strip).join("/");else return!1}}if(!this.preservePaths){let Y=h(S.path),X=Y.split("/");if(X.includes("..")||M&&/^[a-z]:\.\.$/i.test(X[0]))return this.warn("TAR_ENTRY_ERROR","path contains '..'",{entry:S,path:Y}),!1;let[se,le]=u(Y);se&&(S.path=le,this.warn("TAR_ENTRY_INFO",`stripping ${se} from absolute path`,{entry:S,path:Y}))}if(o.isAbsolute(S.path)?S.absolute=h(o.resolve(S.path)):S.absolute=h(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:h(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:X}=o.win32.parse(S.path);S.path=X+l.encode(S.path.slice(X.length))}return!0}[g](S){if(!this[q](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)}}[$](S,Y){S.name==="CwdError"?this.emit("error",S):(this.warn("TAR_ENTRY_ERROR",S,{entry:Y}),this[N](),Y.resume())}[P](S,Y,X){a(h(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},X)}[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)}[p](S){return U(this.gid,S.gid,this.processGid)}[T](S,Y){let X=S.mode&4095||this.fmode,se=new s.WriteStream(S.absolute,{flags:R(S.size),mode:X,autoClose:!1});se.on("error",fe=>{se.fd&&n.close(se.fd,()=>{}),se.write=()=>!0,this[$](fe,S),Y()});let le=1,ge=fe=>{if(fe){se.fd&&n.close(se.fd,()=>{}),this[$](fe,S),Y();return}--le===0&&n.close(se.fd,ve=>{ve?this[$](ve,S):this[N](),Y()})};se.on("finish",fe=>{let ve=S.absolute,ut=se.fd;if(S.mtime&&!this.noMtime){le++;let ht=S.atime||new Date,Qi=S.mtime;n.futimes(ut,ht,Qi,en=>en?n.utimes(ve,ht,Qi,aa=>ge(aa&&en)):ge())}if(this[z](S)){le++;let ht=this[D](S),Qi=this[p](S);n.fchown(ut,ht,Qi,en=>en?n.chown(ve,ht,Qi,aa=>ge(aa&&en)):ge())}ge()});let ue=this.transform&&this.transform(S)||S;ue!==S&&(ue.on("error",fe=>{this[$](fe,S),Y()}),S.pipe(ue)),ue.pipe(se)}[O](S,Y){let X=S.mode&4095||this.dmode;this[P](S.absolute,X,se=>{if(se){this[$](se,S),Y();return}let le=1,ge=ue=>{--le===0&&(Y(),this[N](),S.resume())};S.mtime&&!this.noMtime&&(le++,n.utimes(S.absolute,S.atime||new Date,S.mtime,ge)),this[z](S)&&(le++,n.chown(S.absolute,this[D](S),this[p](S),ge)),ge()})}[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 X=h(o.resolve(this.cwd,S.linkpath));this[I](S,X,"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,X=>this[_](S,X))}[x](S){S.type==="SymbolicLink"?re(this.dirCache):S.type!=="Directory"&&G(this.dirCache,S.absolute)}[_](S,Y){this[x](S);let X=ue=>{this[x](S),Y(ue)},se=()=>{this[P](this.cwd,this.dmode,ue=>{if(ue){this[$](ue,S),X();return}this[m]=!0,le()})},le=()=>{if(S.absolute!==this.cwd){let ue=h(o.dirname(S.absolute));if(ue!==this.cwd)return this[P](ue,this.dmode,fe=>{if(fe){this[$](fe,S),X();return}ge()})}ge()},ge=()=>{n.lstat(S.absolute,(ue,fe)=>{if(fe&&(this.keep||this.newer&&fe.mtime>S.mtime)){this[j](S),X();return}if(ue||this[k](S,fe))return this[C](null,S,X);if(fe.isDirectory()){if(S.type==="Directory"){let ve=!this.noChmod&&S.mode&&(fe.mode&4095)!==S.mode,ut=ht=>this[C](ht,S,X);return ve?n.chmod(S.absolute,S.mode,ut):ut()}if(S.absolute!==this.cwd)return n.rmdir(S.absolute,ve=>this[C](ve,S,X))}if(S.absolute===this.cwd)return this[C](null,S,X);B(S.absolute,ve=>this[C](ve,S,X))})};this[m]?le():se()}[C](S,Y,X){if(S){this[$](S,Y),X();return}switch(Y.type){case"File":case"OldFile":case"ContiguousFile":return this[T](Y,X);case"Link":return this[v](Y,X);case"SymbolicLink":return this[w](Y,X);case"Directory":case"GNUDumpDir":return this[O](Y,X)}}[I](S,Y,X,se){n[X](Y,S.absolute,le=>{le?this[$](le,S):(this[N](),S.resume()),se()})}},Se=S=>{try{return[null,S()]}catch(Y){return[Y,null]}},_e=class extends ce{[C](S,Y){return super[C](S,Y,()=>{})}[y](S){if(this[x](S),!this[m]){let le=this[P](this.cwd,this.dmode);if(le)return this[$](le,S);this[m]=!0}if(S.absolute!==this.cwd){let le=h(o.dirname(S.absolute));if(le!==this.cwd){let ge=this[P](le,this.dmode);if(ge)return this[$](ge,S)}}let[Y,X]=Se(()=>n.lstatSync(S.absolute));if(X&&(this.keep||this.newer&&X.mtime>S.mtime))return this[j](S);if(Y||this[k](S,X))return this[C](null,S);if(X.isDirectory()){if(S.type==="Directory"){let ge=!this.noChmod&&S.mode&&(X.mode&4095)!==S.mode,[ue]=ge?Se(()=>{n.chmodSync(S.absolute,S.mode)}):[];return this[C](ue,S)}let[le]=Se(()=>n.rmdirSync(S.absolute));this[C](le,S)}let[se]=S.absolute===this.cwd?[]:Se(()=>Z(S.absolute));this[C](se,S)}[T](S,Y){let X=S.mode&4095||this.fmode,se=ue=>{let fe;try{n.closeSync(le)}catch(ve){fe=ve}(ue||fe)&&this[$](ue||fe,S),Y()},le;try{le=n.openSync(S.absolute,R(S.size),X)}catch(ue){return se(ue)}let ge=this.transform&&this.transform(S)||S;ge!==S&&(ge.on("error",ue=>this[$](ue,S)),S.pipe(ge)),ge.on("data",ue=>{try{n.writeSync(le,ue,0,ue.length)}catch(fe){se(fe)}}),ge.on("end",ue=>{let fe=null;if(S.mtime&&!this.noMtime){let ve=S.atime||new Date,ut=S.mtime;try{n.futimesSync(le,ve,ut)}catch(ht){try{n.utimesSync(S.absolute,ve,ut)}catch{fe=ht}}}if(this[z](S)){let ve=this[D](S),ut=this[p](S);try{n.fchownSync(le,ve,ut)}catch(ht){try{n.chownSync(S.absolute,ve,ut)}catch{fe=fe||ht}}}se(fe)})}[O](S,Y){let X=S.mode&4095||this.dmode,se=this[P](S.absolute,X);if(se){this[$](se,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[p](S))}catch{}Y(),S.resume()}[P](S,Y){try{return a.sync(h(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(X){return X}}[I](S,Y,X,se){try{n[X+"Sync"](Y,S.absolute),se(),S.resume()}catch(le){return this[$](le,S)}}};ce.Sync=_e,e.exports=ce}),yk=ee((t,e)=>{"use strict";W();var r=bn(),i=yg(),n=te("fs"),s=vn(),o=te("path"),a=En();e.exports=(d,g,y)=>{typeof d=="function"?(y=d,g=null,d={}):Array.isArray(d)&&(g=d,d={}),typeof g=="function"&&(y=g,g=null),g?g=Array.from(g):g=[];let _=r(d);if(_.sync&&typeof y=="function")throw new TypeError("callback not supported for sync tar functions");if(!_.file&&typeof y=="function")throw new TypeError("callback only supported with file option");return g.length&&l(_,g),_.file&&_.sync?c(_):_.file?u(_,y):_.sync?h(_):f(_)};var l=(d,g)=>{let y=new Map(g.map(k=>[a(k),!0])),_=d.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};d.filter=_?(k,C)=>_(k,C)&&x(a(k)):k=>x(a(k))},c=d=>{let g=new i.Sync(d),y=d.file,_=n.statSync(y),x=d.maxReadSize||16*1024*1024;new s.ReadStreamSync(y,{readSize:x,size:_.size}).pipe(g)},u=(d,g)=>{let y=new i(d),_=d.maxReadSize||16*1024*1024,x=d.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:_,size:I.size});w.on("error",T),w.pipe(y)}})});return g?k.then(g,g):k},h=d=>new i.Sync(d),f=d=>new i(d)}),gk=ee(t=>{"use strict";W(),t.c=t.create=nk(),t.r=t.replace=pg(),t.t=t.list=Pc(),t.u=t.update=sk(),t.x=t.extract=yk(),t.Pack=Cc(),t.Unpack=yg(),t.Parse=Lc(),t.ReadEntry=Oc(),t.WriteEntry=hg(),t.Header=Sn(),t.Pax=Tc(),t.types=lg()}),_k=ee((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}}),bk=ee(t=>{W();var e=_k();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),h=Array.prototype.slice.call(arguments,1),f=h.pop();h.push(function(d){u.retry(d)||(d&&(arguments[0]=u.mainError()),f.apply(this,arguments))}),u.attempt(function(){c.apply(r,h)})}.bind(r,l),r[a].options=i}}}),wk=ee((t,e)=>{W(),e.exports=bk()}),Sk=ee((t,e)=>{W();var r=wk();function i(n,s){function o(a,l){var c=s||{},u;"randomize"in c||(c.randomize=!0),u=r.operation(c);function h(g){l(g||new Error("Aborted"))}function f(g,y){if(g.bail){h(g);return}u.retry(g)?c.onRetry&&c.onRetry(g,y):l(u.mainError())}function d(g){var y;try{y=n(h,g)}catch(_){f(_,g);return}Promise.resolve(y).then(a).catch(function(_){f(_,g)})}u.attempt(d)}return new Promise(o)}e.exports=i}),Ek={};$T(Ek,{bold:()=>Ok,dimmed:()=>kk,error:()=>Ik,grey:()=>Ck,info:()=>Ak,item:()=>Lk,log:()=>jr,turboBlue:()=>vi,turboGradient:()=>Rk,turboLoader:()=>xk,turboRed:()=>Sg,underline:()=>Tk,warn:()=>Pk,yellow:()=>Eg});W();var bg="#0099F7",wg="#F11712",vk="#FFFF00",Rk=(0,_g.default)(bg,wg),vi=ur.default.hex(bg),Sg=ur.default.hex(wg),Eg=ur.default.hex(vk),xk=t=>(0,gg.default)({text:t,spinner:{frames:[" ",vi("> "),vi(">> "),vi(">>>")]}}),Ak=(...t)=>{jr(vi.bold(">>>"),...t)},Ok=(...t)=>{jr(ur.default.bold(...t))},Tk=(...t)=>{jr(ur.default.underline(...t))},kk=(...t)=>{jr(ur.default.dim(...t))},Ck=(...t)=>{jr(ur.default.grey(...t))},Lk=(...t)=>{jr(vi.bold(" \u2022"),...t)},jr=(...t)=>{console.log(...t)},Pk=(...t)=>{console.error(Eg.bold(">>>"),...t)},Ik=(...t)=>{console.error(Sg.bold(">>>"),...t)};W();W();W();W();var KN=zs(YT());W();W();function Dk(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}W();W();function vc(t){return vc=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},vc(t)}W();function Mk(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Fk(t,e){if(e&&(vc(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Mk(t)}W();function Gs(t){return Gs=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Gs(t)}W();W();function yn(t,e){return yn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},yn(t,e)}function Bk(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&&yn(t,e)}W();W();function jk(t){return Function.toString.call(t).indexOf("[native code]")!==-1}W();W();function Hk(){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 $s(t,e,r){return Hk()?$s=Reflect.construct.bind():$s=function(i,n,s){var o=[null];o.push.apply(o,n);var a=Function.bind.apply(i,o),l=new a;return s&&yn(l,s.prototype),l},$s.apply(null,arguments)}function Rc(t){var e=typeof Map=="function"?new Map:void 0;return Rc=function(r){if(r===null||!jk(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 $s(r,arguments,Gs(this).constructor)}return i.prototype=Object.create(r.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),yn(i,r)},Rc(t)}var VN=zs(QT()),JN=function(t){Bk(e,t);function e(r){var i;return Dk(this,e),i=Fk(this,Gs(e).call(this,"No package.json could be found upwards from the directory ".concat(r))),i.directory=r,i}return e}(Rc(Error));W();W();W();W();W();W();var cD=zs(gk()),uD=(0,Rg.promisify)(vg.Stream.pipeline);W();W();var dD=zs(Sk());W();W();W();var Ie=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,Ie)}};W();W();W();W();var qk=/^(?!_)(?<manager>.+)@(?<version>.+)$/;function $e({workspaceRoot:t}){let e=Ft.default.join(t,"package.json");try{return(0,Ze.readJsonSync)(e,"utf8")}catch(r){if(r&&typeof r=="object"&&"code"in r){if(r.code==="ENOENT")throw new Ie(`no "package.json" found at ${t}`,{type:"package_json-missing"});if(r.code==="EJSONPARSE")throw new Ie(`failed to parse "package.json" at ${t}`,{type:"package_json-parse_error"})}throw new Error(`unexpected error reading "package.json" at ${t}`)}}function Ws({workspaceRoot:t}){let{packageManager:e}=$e({workspaceRoot:t});if(e)try{let r=qk.exec(e);if(r){let[i,n]=r;return n}}catch{}}function Rn({workspaceRoot:t}){let e=$e({workspaceRoot:t}),r=Ft.default.basename(t),{name:i=r,description:n}=e;return{name:i,description:n}}function ig({workspaceRoot:t}){let e=Ft.default.join(t,"pnpm-workspace.yaml");if((0,Ze.existsSync)(e))try{let r=qa.load((0,Ze.readFileSync)(e,"utf8"));if(r instanceof Object&&"packages"in r&&Array.isArray(r.packages))return r.packages}catch{throw new Ie(`failed to parse ${e}`,{type:"pnpm-workspace_parse_error"})}return[]}function Ys({root:t,lockFile:e,workspaceConfig:r}){let i=s=>Ft.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 Ic({workspaces:t}){var e;return t?Array.isArray(t)?t:"packages"in t?(e=t.packages)!=null?e:[]:[]:[]}function Ks({workspaceRoot:t,workspaceGlobs:e}){return e?e.flatMap(r=>{let i=[`${r}/package.json`];return(0,Cg.sync)(i,{onlyFiles:!0,absolute:!0,cwd:t,ignore:["**/node_modules/**"]})}).map(r=>{let i=Ft.default.dirname(r),{name:n,description:s}=Rn({workspaceRoot:i});return{name:n,description:s,paths:{root:i,packageJson:r,nodeModules:Ft.default.join(i,"node_modules")}}}):[]}function Uk({directory:t}){let e=Ft.default.resolve(process.cwd(),t);return{exists:(0,Ze.existsSync)(e),absolute:e}}function hr({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 $k({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 Mt({project:t,options:e}){e!=null&&e.dry||(0,Ze.rmSync)(t.paths.lockfile,{force:!0})}async function Lg({project:t,options:e}){if(!(e!=null&&e.dry)&&(0,Ze.existsSync)(t.paths.lockfile))try{let{stdout:r}=await(0,kg.default)("bun",["bun.lockb"],{stdin:"ignore",cwd:t.paths.root});await(0,Ze.writeFile)(Ft.default.join(t.paths.root,"yarn.lock"),r)}catch{}finally{(0,Ze.rmSync)(t.paths.lockfile,{force:!0})}}function Gk({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 lr({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=$e({workspaceRoot:e.paths.root}),o={dependencies:[],devDependencies:[],peerDependencies:[],optionalDependencies:[]},a=["dependencies","devDependencies","peerDependencies","optionalDependencies"];a.forEach(h=>{let f=s[h];if(f){let{updated:d,dependencyList:g}=Gk({dependencyList:f,project:t,to:r});s[h]=g,o[h]=d}});let l=h=>{let f=o[h].length;if(f>0)return`${Tg.default.green(f.toString())} ${h}`},c=a.map(l).filter(Boolean),u=`./${Ag.default.relative(t.paths.root,e.paths.packageJson)}`;if(c.length>=1){let h="updating";c.forEach((f,d)=>{c.length===1?h+=` ${f} in ${u}`:d===c.length-1?h+=`and ${f} in ${u}`:h+=` ${f}, `}),i.workspaceStep(h)}else i.workspaceStep(`no workspace dependencies found in ${u}`);n!=null&&n.dry||(0,Og.writeJSONSync)(e.paths.packageJson,s,{spaces:2})}var cr={name:"pnpm",lock:"pnpm-lock.yaml"};async function Pg(t){let e=Fr.default.join(t.workspaceRoot,cr.lock),r=Fr.default.join(t.workspaceRoot,"pnpm-workspace.yaml"),i=Ws({workspaceRoot:t.workspaceRoot});return(0,He.existsSync)(e)||(0,He.existsSync)(r)||i===cr.name}async function zk(t){if(!await Pg(t))throw new Ie("Not a pnpm project",{type:"package_manager-unexpected"});let{name:e,description:r}=Rn(t);return{name:e,description:r,packageManager:cr.name,paths:Ys({root:t.workspaceRoot,lockFile:cr.lock,workspaceConfig:"pnpm-workspace.yaml"}),workspaceData:{globs:ig(t),workspaces:Ks({workspaceGlobs:ig(t),...t})}}}async function Wk(t){let{project:e,to:r,logger:i,options:n}=t,s=e.workspaceData.globs.length>0;i.mainStep(hr({action:"create",packageManager:cr.name,project:e}));let o=$e({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,He.writeJSONSync)(e.paths.packageJson,o,{spaces:2}),s&&(i.rootStep('adding "pnpm-workspace.yaml"'),(0,He.writeFileSync)(Fr.default.join(e.paths.root,"pnpm-workspace.yaml"),`packages:
|
41
|
+
`).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 h=c.split("="),f=h.shift().replace(/^SCHILY\.(dev|ino|nlink)/,"$1");if(!f)return l;let d=h.join("=");return l[f]=/^([A-Z]+\.)?([mac]|birth|creation)time$/.test(f)?new Date(d*1e3):/^[0-9]+$/.test(d)?+d:d,l};e.exports=n}),En=ee((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)}}),kc=ee((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))}}}),cg=ee((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)}}),ug=ee((t,e)=>{W();var{isAbsolute:r,parse:i}=te("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]}}),rk=ee((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)}),hg=ee((t,e)=>{"use strict";W();var r=Ac(),i=Tc(),n=Sn(),s=te("fs"),o=te("path"),a=wn(),l=En(),c=(m,b)=>b?(m=a(m).replace(/^\.(\/|$)/,""),l(b)+"/"+m):a(m),u=16*1024*1024,h=Symbol("process"),f=Symbol("file"),d=Symbol("directory"),g=Symbol("symlink"),y=Symbol("hardlink"),_=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"),q=Symbol("awaitDrain"),P=Symbol("ondrain"),$=Symbol("prefix"),K=Symbol("hadError"),V=kc(),N=cg(),A=ug(),L=rk(),j=V(class extends r{constructor(m,b){if(b=b||{},super(b),typeof m!="string")throw new TypeError("path is required");this.path=a(m),this.portable=!!b.portable,this.myuid=process.getuid&&process.getuid()||0,this.myuser=process.env.USER||"",this.maxReadSize=b.maxReadSize||u,this.linkCache=b.linkCache||new Map,this.statCache=b.statCache||new Map,this.preservePaths=!!b.preservePaths,this.cwd=a(b.cwd||process.cwd()),this.strict=!!b.strict,this.noPax=!!b.noPax,this.noMtime=!!b.noMtime,this.mtime=b.mtime||null,this.prefix=b.prefix?a(b.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 b.onwarn=="function"&&this.on("warn",b.onwarn);let R=!1;if(!this.preservePaths){let[E,M]=A(this.path);E&&(this.path=M,R=E)}this.win32=!!b.win32||process.platform==="win32",this.win32&&(this.path=N.decode(this.path.replace(/\\/g,"/")),m=m.replace(/\\/g,"/")),this.absolute=a(b.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,...b){return m==="error"&&(this[K]=!0),super.emit(m,...b)}[k](){s.lstat(this.absolute,(m,b)=>{if(m)return this.emit("error",m);this[C](b)})}[C](m){this.statCache.set(this.absolute,m),this.stat=m,m.isFile()||(m.size=0),this.type=p(m),this.emit("stat",m),this[h]()}[h](){switch(this.type){case"File":return this[f]();case"Directory":return this[d]();case"SymbolicLink":return this[g]();default:return this.end()}}[F](m){return L(m,this.type==="Directory",this.portable)}[$](m){return c(m,this.prefix)}[_](){this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.header=new n({path:this[$](this.path),linkpath:this.type==="Link"?this[$](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[$](this.path),linkpath:this.type==="Link"?this[$](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)}[d](){this.path.slice(-1)!=="/"&&(this.path+="/"),this.stat.size=0,this[_](),this.end()}[g](){s.readlink(this.absolute,(m,b)=>{if(m)return this.emit("error",m);this[O](b)})}[O](m){this.linkpath=a(m),this[_](),this.end()}[y](m){this.type="Link",this.linkpath=a(o.relative(this.cwd,m)),this.stat.size=0,this[_](),this.end()}[f](){if(this.stat.nlink>1){let m=this.stat.dev+":"+this.stat.ino;if(this.linkCache.has(m)){let b=this.linkCache.get(m);if(b.indexOf(this.cwd)===0)return this[y](b)}this.linkCache.set(m,this.absolute)}if(this[_](),this.stat.size===0)return this.end();this[I]()}[I](){s.open(this.absolute,"r",(m,b)=>{if(m)return this.emit("error",m);this[w](b)})}[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 b=Math.min(this.blockLen,this.maxReadSize);this.buf=Buffer.allocUnsafe(b),this.offset=0,this.pos=0,this.remain=this.stat.size,this.length=this.buf.length,this[x]()}[x](){let{fd:m,buf:b,offset:R,length:E,pos:M}=this;s.read(m,b,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 b=this.offset===0&&m===this.buf.length?this.buf:this.buf.slice(this.offset,this.offset+m);this.write(b)?this[P]():this[q](()=>this[P]())}[q](m){this.once("drain",m)}write(m){if(this.blockRemain<m.length){let b=new Error("writing more data than expected");return b.path=this.absolute,this.emit("error",b)}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:b,buf:R,offset:E,length:M,pos:B}=this,Z=s.readSync(b,R,E,M,B);this[T](Z),m=!1}finally{if(m)try{this[v](()=>{})}catch{}}}[q](m){m()}[v](m){s.closeSync(this.fd),m()}},D=V(class extends r{constructor(m,b){b=b||{},super(b),this.preservePaths=!!b.preservePaths,this.portable=!!b.portable,this.strict=!!b.strict,this.noPax=!!b.noPax,this.noMtime=!!b.noMtime,this.readEntry=m,this.type=m.type,this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.prefix=b.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:b.mtime||m.mtime,this.atime=this.portable?null:m.atime,this.ctime=this.portable?null:m.ctime,this.linkpath=a(m.linkpath),typeof b.onwarn=="function"&&this.on("warn",b.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[$](this.path),linkpath:this.type==="Link"?this[$](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[$](this.path),linkpath:this.type==="Link"?this[$](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)}[$](m){return c(m,this.prefix)}[F](m){return L(m,this.type==="Directory",this.portable)}write(m){let b=m.length;if(b>this.blockRemain)throw new Error("writing more to entry than is appropriate");return this.blockRemain-=b,super.write(m)}end(){return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),super.end()}});j.Sync=z,j.Tar=D;var p=m=>m.isFile()?"File":m.isDirectory()?"Directory":m.isSymbolicLink()?"SymbolicLink":"Unsupported";e.exports=j}),ik=ee((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}}}),fg=ee((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(h){l.push(h)});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 h=0;u!==null;h++)c=a(c,u.value,h),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 h=this.length-1;u!==null;h--)c=a(c,u.value,h),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,h=this.head;h!==null&&u<a;u++)h=h.next;for(;h!==null&&u<l;u++,h=h.next)c.push(h.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,h=this.tail;h!==null&&u>l;u--)h=h.prev;for(;h!==null&&u>a;u--,h=h.prev)c.push(h.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,h=this.head;h!==null&&u<a;u++)h=h.next;for(var f=[],u=0;h&&u<l;u++)f.push(h.value),h=this.removeNode(h);h===null&&(h=this.tail),h!==this.head&&h!==this.tail&&(h=h.prev);for(var u=0;u<c.length;u++)h=i(this,h,c[u]);return f},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{ik()(r)}catch{}}),Cc=ee((t,e)=>{"use strict";W();var r=class{constructor(p,m){this.path=p||"./",this.absolute=m,this.entry=null,this.stat=null,this.readdir=null,this.pending=!1,this.ignore=!1,this.piped=!1}},i=Ac(),n=ag(),s=Oc(),o=hg(),a=o.Sync,l=o.Tar,c=fg(),u=Buffer.alloc(1024),h=Symbol("onStat"),f=Symbol("ended"),d=Symbol("queue"),g=Symbol("current"),y=Symbol("process"),_=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"),q=Symbol("entry"),P=Symbol("entryOpt"),$=Symbol("writeEntryClass"),K=Symbol("write"),V=Symbol("ondrain"),N=te("fs"),A=te("path"),L=kc(),j=wn(),z=L(class extends i{constructor(p){super(p),p=p||Object.create(null),this.opt=p,this.file=p.file||"",this.cwd=p.cwd||process.cwd(),this.maxReadSize=p.maxReadSize,this.preservePaths=!!p.preservePaths,this.strict=!!p.strict,this.noPax=!!p.noPax,this.prefix=j(p.prefix||""),this.linkCache=p.linkCache||new Map,this.statCache=p.statCache||new Map,this.readdirCache=p.readdirCache||new Map,this[$]=o,typeof p.onwarn=="function"&&this.on("warn",p.onwarn),this.portable=!!p.portable,this.zip=null,p.gzip?(typeof p.gzip!="object"&&(p.gzip={}),this.portable&&(p.gzip.portable=!0),this.zip=new n.Gzip(p.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=!!p.noDirRecurse,this.follow=!!p.follow,this.noMtime=!!p.noMtime,this.mtime=p.mtime||null,this.filter=typeof p.filter=="function"?p.filter:m=>!0,this[d]=new c,this[k]=0,this.jobs=+p.jobs||4,this[_]=!1,this[f]=!1}[K](p){return super.write(p)}add(p){return this.write(p),this}end(p){return p&&this.write(p),this[f]=!0,this[y](),this}write(p){if(this[f])throw new Error("write after end");return p instanceof s?this[O](p):this[T](p),this.flowing}[O](p){let m=j(A.resolve(this.cwd,p.path));if(!this.filter(p.path,p))p.resume();else{let b=new r(p.path,m,!1);b.entry=new l(p,this[P](b)),b.entry.on("end",R=>this[C](b)),this[k]+=1,this[d].push(b)}this[y]()}[T](p){let m=j(A.resolve(this.cwd,p));this[d].push(new r(p,m)),this[y]()}[I](p){p.pending=!0,this[k]+=1;let m=this.follow?"stat":"lstat";N[m](p.absolute,(b,R)=>{p.pending=!1,this[k]-=1,b?this.emit("error",b):this[h](p,R)})}[h](p,m){this.statCache.set(p.absolute,m),p.stat=m,this.filter(p.path,m)||(p.ignore=!0),this[y]()}[w](p){p.pending=!0,this[k]+=1,N.readdir(p.absolute,(m,b)=>{if(p.pending=!1,this[k]-=1,m)return this.emit("error",m);this[v](p,b)})}[v](p,m){this.readdirCache.set(p.absolute,m),p.readdir=m,this[y]()}[y](){if(!this[_]){this[_]=!0;for(let p=this[d].head;p!==null&&this[k]<this.jobs;p=p.next)if(this[x](p.value),p.value.ignore){let m=p.next;this[d].removeNode(p),p.next=m}this[_]=!1,this[f]&&!this[d].length&&this[k]===0&&(this.zip?this.zip.end(u):(super.write(u),super.end()))}}get[g](){return this[d]&&this[d].head&&this[d].head.value}[C](p){this[d].shift(),this[k]-=1,this[y]()}[x](p){if(!p.pending){if(p.entry){p===this[g]&&!p.piped&&this[F](p);return}if(p.stat||(this.statCache.has(p.absolute)?this[h](p,this.statCache.get(p.absolute)):this[I](p)),!!p.stat&&!p.ignore&&!(!this.noDirRecurse&&p.stat.isDirectory()&&!p.readdir&&(this.readdirCache.has(p.absolute)?this[v](p,this.readdirCache.get(p.absolute)):this[w](p),!p.readdir))){if(p.entry=this[q](p),!p.entry){p.ignore=!0;return}p===this[g]&&!p.piped&&this[F](p)}}}[P](p){return{onwarn:(m,b,R)=>this.warn(m,b,R),noPax:this.noPax,cwd:this.cwd,absolute:p.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}}[q](p){this[k]+=1;try{return new this[$](p.path,this[P](p)).on("end",()=>this[C](p)).on("error",m=>this.emit("error",m))}catch(m){this.emit("error",m)}}[V](){this[g]&&this[g].entry&&this[g].entry.resume()}[F](p){p.piped=!0,p.readdir&&p.readdir.forEach(R=>{let E=p.path,M=E==="./"?"":E.replace(/\/*$/,"/");this[T](M+R)});let m=p.entry,b=this.zip;b?m.on("data",R=>{b.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(p){super(p),this[$]=a}pause(){}resume(){}[I](p){let m=this.follow?"statSync":"lstatSync";this[h](p,N[m](p.absolute))}[w](p,m){this[v](p,N.readdirSync(p.absolute))}[F](p){let m=p.entry,b=this.zip;p.readdir&&p.readdir.forEach(R=>{let E=p.path,M=E==="./"?"":E.replace(/\/*$/,"/");this[T](M+R)}),b?m.on("data",R=>{b.write(R)}):m.on("data",R=>{super[K](R)})}};z.Sync=D,e.exports=z}),vn=ee(t=>{"use strict";W();var e=sg(),r=te("events").EventEmitter,i=te("fs"),n=i.writev;if(!n){let p=process.binding("fs"),m=p.FSReqWrap||p.FSReqCallback;n=(b,R,E,M)=>{let B=(U,J)=>M(U,J,R),Z=new m;Z.oncomplete=B,p.writeBuffers(b,R,E,Z)}}var s=Symbol("_autoClose"),o=Symbol("_close"),a=Symbol("_ended"),l=Symbol("_fd"),c=Symbol("_finished"),u=Symbol("_flags"),h=Symbol("_flush"),f=Symbol("_handleChunk"),d=Symbol("_makeBuf"),g=Symbol("_mode"),y=Symbol("_needDrain"),_=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"),q=Symbol("_reading"),P=Symbol("_remain"),$=Symbol("_size"),K=Symbol("_write"),V=Symbol("_writing"),N=Symbol("_defaultFlag"),A=Symbol("_errored"),L=class extends e{constructor(p,m){if(m=m||{},super(m),this.readable=!0,this.writable=!1,typeof p!="string")throw new TypeError("path must be a string");this[A]=!1,this[l]=typeof m.fd=="number"?m.fd:null,this[O]=p,this[F]=m.readSize||16*1024*1024,this[q]=!1,this[$]=typeof m.size=="number"?m.size:1/0,this[P]=this[$],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",(p,m)=>this[x](p,m))}[x](p,m){p?this[_](p):(this[l]=m,this.emit("open",m),this[v]())}[d](){return Buffer.allocUnsafe(Math.min(this[F],this[P]))}[v](){if(!this[q]){this[q]=!0;let p=this[d]();if(p.length===0)return process.nextTick(()=>this[k](null,0,p));i.read(this[l],p,0,p.length,null,(m,b,R)=>this[k](m,b,R))}}[k](p,m,b){this[q]=!1,p?this[_](p):this[f](m,b)&&this[v]()}[o](){if(this[s]&&typeof this[l]=="number"){let p=this[l];this[l]=null,i.close(p,m=>m?this.emit("error",m):this.emit("close"))}}[_](p){this[q]=!0,this[o](),this.emit("error",p)}[f](p,m){let b=!1;return this[P]-=p,p>0&&(b=super.write(p<m.length?m.slice(0,p):m)),(p===0||this[P]<=0)&&(b=!1,this[o](),super.end()),b}emit(p,m){switch(p){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(p,m));default:return super.emit(p,m)}}},j=class extends L{[T](){let p=!0;try{this[x](null,i.openSync(this[O],"r")),p=!1}finally{p&&this[o]()}}[v](){let p=!0;try{if(!this[q]){this[q]=!0;do{let m=this[d](),b=m.length===0?0:i.readSync(this[l],m,0,m.length,null);if(!this[f](b,m))break}while(!0);this[q]=!1}p=!1}finally{p&&this[o]()}}[o](){if(this[s]&&typeof this[l]=="number"){let p=this[l];this[l]=null,i.closeSync(p),this.emit("close")}}},z=class extends r{constructor(p,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]=p,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 b=this[I]!==null?"r+":"w";this[N]=m.flags===void 0,this[u]=this[N]?b:m.flags,this[l]===null&&this[T]()}emit(p,m){if(p==="error"){if(this[A])return;this[A]=!0}return super.emit(p,m)}get fd(){return this[l]}get path(){return this[O]}[_](p){this[o](),this[V]=!0,this.emit("error",p)}[T](){i.open(this[O],this[u],this[g],(p,m)=>this[x](p,m))}[x](p,m){this[N]&&this[u]==="r+"&&p&&p.code==="ENOENT"?(this[u]="w",this[T]()):p?this[_](p):(this[l]=m,this.emit("open",m),this[h]())}end(p,m){return p&&this.write(p,m),this[a]=!0,!this[V]&&!this[w].length&&typeof this[l]=="number"&&this[C](null,0),this}write(p,m){return typeof p=="string"&&(p=Buffer.from(p,m)),this[a]?(this.emit("error",new Error("write() after end()")),!1):this[l]===null||this[V]||this[w].length?(this[w].push(p),this[y]=!0,!1):(this[V]=!0,this[K](p),!0)}[K](p){i.write(this[l],p,0,p.length,this[I],(m,b)=>this[C](m,b))}[C](p,m){p?this[_](p):(this[I]!==null&&(this[I]+=m),this[w].length?this[h]():(this[V]=!1,this[a]&&!this[c]?(this[c]=!0,this[o](),this.emit("finish")):this[y]&&(this[y]=!1,this.emit("drain"))))}[h](){if(this[w].length===0)this[a]&&this[C](null,0);else if(this[w].length===1)this[K](this[w].pop());else{let p=this[w];this[w]=[],n(this[l],p,this[I],(m,b)=>this[C](m,b))}}[o](){if(this[s]&&typeof this[l]=="number"){let p=this[l];this[l]=null,i.close(p,m=>m?this.emit("error",m):this.emit("close"))}}},D=class extends z{[T](){let p;if(this[N]&&this[u]==="r+")try{p=i.openSync(this[O],this[u],this[g])}catch(m){if(m.code==="ENOENT")return this[u]="w",this[T]();throw m}else p=i.openSync(this[O],this[u],this[g]);this[x](null,p)}[o](){if(this[s]&&typeof this[l]=="number"){let p=this[l];this[l]=null,i.closeSync(p),this.emit("close")}}[K](p){let m=!0;try{this[C](null,i.writeSync(this[l],p,0,p.length,this[I])),m=!1}finally{if(m)try{this[o]()}catch{}}}};t.ReadStream=L,t.ReadStreamSync=j,t.WriteStream=z,t.WriteStreamSync=D}),Lc=ee((t,e)=>{"use strict";W();var r=kc(),i=Sn(),n=te("events"),s=fg(),o=1024*1024,a=Oc(),l=Tc(),c=ag(),{nextTick:u}=te("process"),h=Buffer.from([31,139]),f=Symbol("state"),d=Symbol("writeEntry"),g=Symbol("readEntry"),y=Symbol("nextEntry"),_=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"),q=Symbol("unzip"),P=Symbol("consumeChunk"),$=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"),p=Symbol("onDone"),m=Symbol("sawValidEntry"),b=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(p,Z=>{(this[f]==="begin"||this[m]===!1)&&this.warn("TAR_BAD_ARCHIVE","Unrecognized archive format")}),B.ondone?this.on(p,B.ondone):this.on(p,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[d]=null,this[f]="begin",this[C]="",this[x]=null,this[k]=null,this[w]=!1,this[q]=null,this[D]=!1,this[b]=!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(J){return this.warn("TAR_ENTRY_INVALID",J)}if(U.nullBlock)this[b]?(this[R]=!0,this[f]==="begin"&&(this[f]="header"),this[F]("eof")):(this[b]=!0,this[F]("nullBlock"));else if(this[b]=!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 J=U.type;if(/^(Symbolic)?Link$/.test(J)&&!U.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath required",{header:U});else if(!/^(Symbolic)?Link$/.test(J)&&U.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath forbidden",{header:U});else{let G=this[d]=new a(U,this[x],this[k]);if(!this[m])if(G.remain){let re=()=>{G.invalid||(this[m]=!0)};G.on("end",re)}else this[m]=!0;G.meta?G.size>this.maxMetaEntrySize?(G.ignore=!0,this[F]("ignoredEntry",G),this[f]="ignore",G.resume()):G.size>0&&(this[C]="",G.on("data",re=>this[C]+=re),this[f]="meta"):(this[x]=null,G.ignore=G.ignore||!this.filter(G.path,G),G.ignore?(this[F]("ignoredEntry",G),this[f]=G.remain?"ignore":"header",G.resume()):(G.remain?this[f]="body":(this[f]="header",G.end()),this[g]?this[I].push(G):(this[I].push(G),this[y]())))}}}[E](){u(()=>this.emit("close"))}[_](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[_](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[d],J=U.blockRemain,G=J>=B.length&&Z===0?B:B.slice(Z,Z+J);return U.write(G),U.blockRemain||(this[f]="header",this[d]=null,U.end()),G.length}[V](B,Z){let U=this[d],J=this[K](B,Z);return this[d]||this[T](U),J}[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[q]===null&&B){if(this[O]&&(B=Buffer.concat([this[O],B]),this[O]=null),B.length<h.length)return this[O]=B,!0;for(let U=0;this[q]===null&&U<h.length;U++)B[U]!==h[U]&&(this[q]=!1);if(this[q]===null){let U=this[w];this[w]=!1,this[q]=new c.Unzip,this[q].on("data",G=>this[P](G)),this[q].on("error",G=>this.abort(G)),this[q].on("end",G=>{this[w]=!0,this[P]()}),this[z]=!0;let J=this[q][U?"end":"write"](B);return this[z]=!1,J}}this[z]=!0,this[q]?this[q].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[d];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](p)}}[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[$](Z)}else this[$](B);for(;this[O]&&this[O].length>=512&&!this[D]&&!this[R];){let Z=this[O];this[O]=null,this[$](Z)}this[A]=!1}(!this[O]||this[w])&&this[j]()}[$](B){let Z=0,U=B.length;for(;Z+512<=U&&!this[D]&&!this[R];)switch(this[f]){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[f])}Z<U&&(this[O]?this[O]=Buffer.concat([B.slice(Z),this[O]]):this[O]=B.slice(Z))}end(B){this[D]||(this[q]?this[q].end(B):(this[w]=!0,this.write(B)))}})}),Pc=ee((t,e)=>{"use strict";W();var r=bn(),i=Lc(),n=te("fs"),s=vn(),o=te("path"),a=En();e.exports=(d,g,y)=>{typeof d=="function"?(y=d,g=null,d={}):Array.isArray(d)&&(g=d,d={}),typeof g=="function"&&(y=g,g=null),g?g=Array.from(g):g=[];let _=r(d);if(_.sync&&typeof y=="function")throw new TypeError("callback not supported for sync tar functions");if(!_.file&&typeof y=="function")throw new TypeError("callback only supported with file option");return g.length&&c(_,g),_.noResume||l(_),_.file&&_.sync?u(_):_.file?h(_,y):f(_)};var l=d=>{let g=d.onentry;d.onentry=g?y=>{g(y),y.resume()}:y=>y.resume()},c=(d,g)=>{let y=new Map(g.map(k=>[a(k),!0])),_=d.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};d.filter=_?(k,C)=>_(k,C)&&x(a(k)):k=>x(a(k))},u=d=>{let g=f(d),y=d.file,_=!0,x;try{let k=n.statSync(y),C=d.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()}_=!1}finally{if(_&&x)try{n.closeSync(x)}catch{}}},h=(d,g)=>{let y=new i(d),_=d.maxReadSize||16*1024*1024,x=d.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:_,size:I.size});w.on("error",T),w.pipe(y)}})});return g?k.then(g,g):k},f=d=>new i(d)}),nk=ee((t,e)=>{"use strict";W();var r=bn(),i=Cc(),n=vn(),s=Pc(),o=te("path");e.exports=(d,g,y)=>{if(typeof g=="function"&&(y=g),Array.isArray(d)&&(g=d,d={}),!g||!Array.isArray(g)||!g.length)throw new TypeError("no files or directories specified");g=Array.from(g);let _=r(d);if(_.sync&&typeof y=="function")throw new TypeError("callback not supported for sync tar functions");if(!_.file&&typeof y=="function")throw new TypeError("callback only supported with file option");return _.file&&_.sync?a(_,g):_.file?l(_,g,y):_.sync?h(_,g):f(_,g)};var a=(d,g)=>{let y=new i.Sync(d),_=new n.WriteStreamSync(d.file,{mode:d.mode||438});y.pipe(_),c(y,g)},l=(d,g,y)=>{let _=new i(d),x=new n.WriteStream(d.file,{mode:d.mode||438});_.pipe(x);let k=new Promise((C,T)=>{x.on("error",T),x.on("close",C),_.on("error",T)});return u(_,g),y?k.then(y,y):k},c=(d,g)=>{g.forEach(y=>{y.charAt(0)==="@"?s({file:o.resolve(d.cwd,y.slice(1)),sync:!0,noResume:!0,onentry:_=>d.add(_)}):d.add(y)}),d.end()},u=(d,g)=>{for(;g.length;){let y=g.shift();if(y.charAt(0)==="@")return s({file:o.resolve(d.cwd,y.slice(1)),noResume:!0,onentry:_=>d.add(_)}).then(_=>u(d,g));d.add(y)}d.end()},h=(d,g)=>{let y=new i.Sync(d);return c(y,g),y},f=(d,g)=>{let y=new i(d);return u(y,g),y}}),pg=ee((t,e)=>{"use strict";W();var r=bn(),i=Cc(),n=te("fs"),s=vn(),o=Pc(),a=te("path"),l=Sn();e.exports=(g,y,_)=>{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):h(x,y,_)};var c=(g,y)=>{let _=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,_,C,k,y)}finally{if(x)try{n.closeSync(k)}catch{}}},u=(g,y,_,x,k)=>{let C=new s.WriteStreamSync(g.file,{fd:x,start:_});y.pipe(C),f(y,k)},h=(g,y,_)=>{y=Array.from(y);let x=new i(g),k=(T,O,I)=>{let w=($,K)=>{$?n.close(T,V=>I($)):I(null,K)},v=0;if(O===0)return w(null,0);let F=0,q=Buffer.alloc(512),P=($,K)=>{if($)return w($);if(F+=K,F<512&&K)return n.read(T,q,F,q.length-F,v+F,P);if(v===0&&q[0]===31&&q[1]===139)return w(new Error("cannot append to compressed archives"));if(F<512)return w(null,v);let V=new l(q);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,q,0,512,v,P)};n.read(T,q,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,(q,P)=>{if(q)return n.close(F,()=>O(q));k(F,P.size,($,K)=>{if($)return O($);let V=new s.WriteStream(g.file,{fd:F,start:K});x.pipe(V),V.on("error",O),V.on("close",T),d(x,y)})})};n.open(g.file,I,w)});return _?C.then(_,_):C},f=(g,y)=>{y.forEach(_=>{_.charAt(0)==="@"?o({file:a.resolve(g.cwd,_.slice(1)),sync:!0,noResume:!0,onentry:x=>g.add(x)}):g.add(_)}),g.end()},d=(g,y)=>{for(;y.length;){let _=y.shift();if(_.charAt(0)==="@")return o({file:a.resolve(g.cwd,_.slice(1)),noResume:!0,onentry:x=>g.add(x)}).then(x=>d(g,y));g.add(_)}g.end()}}),sk=ee((t,e)=>{"use strict";W();var r=bn(),i=pg();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)}}),ok=ee((t,e)=>{W();var{promisify:r}=te("util"),i=te("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}),ak=ee((t,e)=>{W();var r=process.env.__TESTING_MKDIRP_PLATFORM__||process.platform,{resolve:i,parse:n}=te("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}),lk=ee((t,e)=>{W();var{dirname:r}=te("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}}),dg=ee((t,e)=>{W();var{dirname:r}=te("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}}),ck=ee((t,e)=>{W();var{dirname:r}=te("path"),{findMade:i,findMadeSync:n}=lk(),{mkdirpManual:s,mkdirpManualSync:o}=dg(),a=(c,u)=>(u.recursive=!0,r(c)===c?u.mkdirAsync(c,u):i(u,c).then(h=>u.mkdirAsync(c,u).then(()=>h).catch(f=>{if(f.code==="ENOENT")return s(c,u);throw f}))),l=(c,u)=>{if(u.recursive=!0,r(c)===c)return u.mkdirSync(c,u);let h=n(u,c);try{return u.mkdirSync(c,u),h}catch(f){if(f.code==="ENOENT")return o(c,u);throw f}};e.exports={mkdirpNative:a,mkdirpNativeSync:l}}),uk=ee((t,e)=>{W();var r=te("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}}),hk=ee((t,e)=>{W();var r=ok(),i=ak(),{mkdirpNative:n,mkdirpNativeSync:s}=ck(),{mkdirpManual:o,mkdirpManualSync:a}=dg(),{useNative:l,useNativeSync:c}=uk(),u=(f,d)=>(f=i(f),d=r(d),l(d)?n(f,d):o(f,d)),h=(f,d)=>(f=i(f),d=r(d),c(d)?s(f,d):a(f,d));u.sync=h,u.native=(f,d)=>n(i(f),r(d)),u.manual=(f,d)=>o(i(f),r(d)),u.nativeSync=(f,d)=>s(i(f),r(d)),u.manualSync=(f,d)=>a(i(f),r(d)),e.exports=u}),fk=ee((t,e)=>{"use strict";W();var r=te("fs"),i=te("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),h=process.version,f=(C,T,O)=>r.readdir(C,T,O),d=(C,T)=>r.readdirSync(C,T);/^v4\./.test(h)&&(f=(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())_(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)}},_=(C,T,O,I)=>{f(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,q=null,P=$=>{if(!q){if($)return I(q=$);if(--F===0)return g(C,T,O,I)}};v.forEach($=>y(C,$,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=d(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=_,_.sync=k}),pk=ee((t,e)=>{"use strict";W();var r=hk(),i=te("fs"),n=te("path"),s=fk(),o=wn(),a=class extends Error{constructor(y,_){super("Cannot extract through symbolic link"),this.path=_,this.symlink=y}get name(){return"SylinkError"}},l=class extends Error{constructor(y,_){super(_+": Cannot cd into '"+y+"'"),this.path=y,this.code=_}get name(){return"CwdError"}},c=(y,_)=>y.get(o(_)),u=(y,_,x)=>y.set(o(_),x),h=(y,_)=>{i.stat(y,(x,k)=>{(x||!k.isDirectory())&&(x=new l(y,x&&x.code||"ENOTDIR")),_(x)})};e.exports=(y,_,x)=>{y=o(y);let k=_.umask,C=_.mode|448,T=(C&k)!==0,O=_.uid,I=_.gid,w=typeof O=="number"&&typeof I=="number"&&(O!==_.processUid||I!==_.processGid),v=_.preserve,F=_.unlink,q=_.cache,P=o(_.cwd),$=(V,N)=>{V?x(V):(u(q,y,!0),N&&w?s(N,O,I,A=>$(A)):T?i.chmod(y,C,x):x())};if(q&&c(q,y)===!0)return $();if(y===P)return h(y,$);if(v)return r(y,{mode:C}).then(V=>$(null,V),$);let K=o(n.relative(P,y)).split("/");f(P,K,C,q,F,P,null,$)};var f=(y,_,x,k,C,T,O,I)=>{if(!_.length)return I(null,O);let w=_.shift(),v=o(n.resolve(y+"/"+w));if(c(k,v))return f(v,_,x,k,C,T,O,I);i.mkdir(v,x,d(v,_,x,k,C,T,O,I))},d=(y,_,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())f(y,_,x,k,C,T,O,I);else if(C)i.unlink(y,q=>{if(q)return I(q);i.mkdir(y,x,d(y,_,x,k,C,T,O,I))});else{if(F.isSymbolicLink())return I(new a(y,y+"/"+_.join("/")));I(w)}}):(O=O||y,f(y,_,x,k,C,T,O,I))},g=y=>{let _=!1,x="ENOTDIR";try{_=i.statSync(y).isDirectory()}catch(k){x=k.code}finally{if(!_)throw new l(y,x)}};e.exports.sync=(y,_)=>{y=o(y);let x=_.umask,k=_.mode|448,C=(k&x)!==0,T=_.uid,O=_.gid,I=typeof T=="number"&&typeof O=="number"&&(T!==_.processUid||O!==_.processGid),w=_.preserve,v=_.unlink,F=_.cache,q=o(_.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===q)return g(q),P();if(w)return P(r.sync(y,k));let $=o(n.relative(q,y)).split("/"),K=null;for(let V=$.shift(),N=q;V&&(N+="/"+V);V=$.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+"/"+$.join("/"))}return P(K)}}),mg=ee((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])}),dk=ee((t,e)=>{W();var r=te("assert"),i=mg(),n=En(),{join:s}=te("path"),o=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,a=o==="win32";e.exports=()=>{let l=new Map,c=new Map,u=_=>_.split("/").slice(0,-1).reduce((x,k)=>(x.length&&(k=s(x[x.length-1],k)),x.push(k||"/"),x),[]),h=new Set,f=_=>{let x=c.get(_);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))}},d=_=>{let{paths:x,dirs:k}=f(_);return x.every(C=>C[0]===_)&&k.every(C=>C[0]instanceof Set&&C[0].has(_))},g=_=>h.has(_)||!d(_)?!1:(h.add(_),_(()=>y(_)),!0),y=_=>{if(!h.has(_))return!1;let{paths:x,dirs:k}=c.get(_),C=new Set;return x.forEach(T=>{let O=l.get(T);r.equal(O[0],_),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(_)}),h.delete(_),C.forEach(T=>g(T)),!0};return{check:d,reserve:(_,x)=>{_=a?["win32 parallelization disabled"]:_.map(C=>i(n(s(C))).toLowerCase());let k=new Set(_.map(C=>u(C)).reduce((C,T)=>C.concat(T)));return c.set(x,{dirs:k,paths:_}),_.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)}}}}),mk=ee((t,e)=>{W();var r=process.env.__FAKE_PLATFORM__||process.platform,i=r==="win32",n=global.__FAKE_TESTING_FS__||te("fs"),{O_CREAT:s,O_TRUNC:o,O_WRONLY:a,UV_FS_O_FILEMAP:l=0}=n.constants,c=i&&!!l,u=512*1024,h=l|o|s|a;e.exports=c?f=>f<u?h:"w":()=>"w"}),yg=ee((t,e)=>{"use strict";W();var r=te("assert"),i=Lc(),n=te("fs"),s=vn(),o=te("path"),a=pk(),l=cg(),c=dk(),u=ug(),h=wn(),f=En(),d=mg(),g=Symbol("onEntry"),y=Symbol("checkFs"),_=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"),q=Symbol("checkPath"),P=Symbol("mkdir"),$=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"),p=Symbol("gid"),m=Symbol("checkedCwd"),b=te("crypto"),R=mk(),E=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,M=E==="win32",B=(S,Y)=>{if(!M)return n.unlink(S,Y);let X=S+".DELETE."+b.randomBytes(16).toString("hex");n.rename(S,X,se=>{if(se)return Y(se);n.unlink(X,Y)})},Z=S=>{if(!M)return n.unlinkSync(S);let Y=S+".DELETE."+b.randomBytes(16).toString("hex");n.renameSync(S,Y),n.unlinkSync(Y)},U=(S,Y,X)=>S===S>>>0?S:Y===Y>>>0?Y:X,J=S=>d(f(h(S))).toLowerCase(),G=(S,Y)=>{Y=J(Y);for(let X of S.keys()){let se=J(X);(se===Y||se.indexOf(Y+"/")===0)&&S.delete(X)}},re=S=>{for(let Y of S.keys())S.delete(Y)},ce=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=h(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,X={}){return(S==="TAR_BAD_ARCHIVE"||S==="TAR_ABORT")&&(X.recoverable=!1),super.warn(S,Y,X)}[L](){this[A]&&this[K]===0&&(this.emit("prefinish"),this.emit("finish"),this.emit("end"))}[q](S){if(this.strip){let Y=h(S.path).split("/");if(Y.length<this.strip)return!1;if(S.path=Y.slice(this.strip).join("/"),S.type==="Link"){let X=h(S.linkpath).split("/");if(X.length>=this.strip)S.linkpath=X.slice(this.strip).join("/");else return!1}}if(!this.preservePaths){let Y=h(S.path),X=Y.split("/");if(X.includes("..")||M&&/^[a-z]:\.\.$/i.test(X[0]))return this.warn("TAR_ENTRY_ERROR","path contains '..'",{entry:S,path:Y}),!1;let[se,le]=u(Y);se&&(S.path=le,this.warn("TAR_ENTRY_INFO",`stripping ${se} from absolute path`,{entry:S,path:Y}))}if(o.isAbsolute(S.path)?S.absolute=h(o.resolve(S.path)):S.absolute=h(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:h(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:X}=o.win32.parse(S.path);S.path=X+l.encode(S.path.slice(X.length))}return!0}[g](S){if(!this[q](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)}}[$](S,Y){S.name==="CwdError"?this.emit("error",S):(this.warn("TAR_ENTRY_ERROR",S,{entry:Y}),this[N](),Y.resume())}[P](S,Y,X){a(h(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},X)}[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)}[p](S){return U(this.gid,S.gid,this.processGid)}[T](S,Y){let X=S.mode&4095||this.fmode,se=new s.WriteStream(S.absolute,{flags:R(S.size),mode:X,autoClose:!1});se.on("error",fe=>{se.fd&&n.close(se.fd,()=>{}),se.write=()=>!0,this[$](fe,S),Y()});let le=1,ge=fe=>{if(fe){se.fd&&n.close(se.fd,()=>{}),this[$](fe,S),Y();return}--le===0&&n.close(se.fd,ve=>{ve?this[$](ve,S):this[N](),Y()})};se.on("finish",fe=>{let ve=S.absolute,ut=se.fd;if(S.mtime&&!this.noMtime){le++;let ht=S.atime||new Date,Qi=S.mtime;n.futimes(ut,ht,Qi,en=>en?n.utimes(ve,ht,Qi,aa=>ge(aa&&en)):ge())}if(this[z](S)){le++;let ht=this[D](S),Qi=this[p](S);n.fchown(ut,ht,Qi,en=>en?n.chown(ve,ht,Qi,aa=>ge(aa&&en)):ge())}ge()});let ue=this.transform&&this.transform(S)||S;ue!==S&&(ue.on("error",fe=>{this[$](fe,S),Y()}),S.pipe(ue)),ue.pipe(se)}[O](S,Y){let X=S.mode&4095||this.dmode;this[P](S.absolute,X,se=>{if(se){this[$](se,S),Y();return}let le=1,ge=ue=>{--le===0&&(Y(),this[N](),S.resume())};S.mtime&&!this.noMtime&&(le++,n.utimes(S.absolute,S.atime||new Date,S.mtime,ge)),this[z](S)&&(le++,n.chown(S.absolute,this[D](S),this[p](S),ge)),ge()})}[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 X=h(o.resolve(this.cwd,S.linkpath));this[I](S,X,"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,X=>this[_](S,X))}[x](S){S.type==="SymbolicLink"?re(this.dirCache):S.type!=="Directory"&&G(this.dirCache,S.absolute)}[_](S,Y){this[x](S);let X=ue=>{this[x](S),Y(ue)},se=()=>{this[P](this.cwd,this.dmode,ue=>{if(ue){this[$](ue,S),X();return}this[m]=!0,le()})},le=()=>{if(S.absolute!==this.cwd){let ue=h(o.dirname(S.absolute));if(ue!==this.cwd)return this[P](ue,this.dmode,fe=>{if(fe){this[$](fe,S),X();return}ge()})}ge()},ge=()=>{n.lstat(S.absolute,(ue,fe)=>{if(fe&&(this.keep||this.newer&&fe.mtime>S.mtime)){this[j](S),X();return}if(ue||this[k](S,fe))return this[C](null,S,X);if(fe.isDirectory()){if(S.type==="Directory"){let ve=!this.noChmod&&S.mode&&(fe.mode&4095)!==S.mode,ut=ht=>this[C](ht,S,X);return ve?n.chmod(S.absolute,S.mode,ut):ut()}if(S.absolute!==this.cwd)return n.rmdir(S.absolute,ve=>this[C](ve,S,X))}if(S.absolute===this.cwd)return this[C](null,S,X);B(S.absolute,ve=>this[C](ve,S,X))})};this[m]?le():se()}[C](S,Y,X){if(S){this[$](S,Y),X();return}switch(Y.type){case"File":case"OldFile":case"ContiguousFile":return this[T](Y,X);case"Link":return this[v](Y,X);case"SymbolicLink":return this[w](Y,X);case"Directory":case"GNUDumpDir":return this[O](Y,X)}}[I](S,Y,X,se){n[X](Y,S.absolute,le=>{le?this[$](le,S):(this[N](),S.resume()),se()})}},Se=S=>{try{return[null,S()]}catch(Y){return[Y,null]}},_e=class extends ce{[C](S,Y){return super[C](S,Y,()=>{})}[y](S){if(this[x](S),!this[m]){let le=this[P](this.cwd,this.dmode);if(le)return this[$](le,S);this[m]=!0}if(S.absolute!==this.cwd){let le=h(o.dirname(S.absolute));if(le!==this.cwd){let ge=this[P](le,this.dmode);if(ge)return this[$](ge,S)}}let[Y,X]=Se(()=>n.lstatSync(S.absolute));if(X&&(this.keep||this.newer&&X.mtime>S.mtime))return this[j](S);if(Y||this[k](S,X))return this[C](null,S);if(X.isDirectory()){if(S.type==="Directory"){let ge=!this.noChmod&&S.mode&&(X.mode&4095)!==S.mode,[ue]=ge?Se(()=>{n.chmodSync(S.absolute,S.mode)}):[];return this[C](ue,S)}let[le]=Se(()=>n.rmdirSync(S.absolute));this[C](le,S)}let[se]=S.absolute===this.cwd?[]:Se(()=>Z(S.absolute));this[C](se,S)}[T](S,Y){let X=S.mode&4095||this.fmode,se=ue=>{let fe;try{n.closeSync(le)}catch(ve){fe=ve}(ue||fe)&&this[$](ue||fe,S),Y()},le;try{le=n.openSync(S.absolute,R(S.size),X)}catch(ue){return se(ue)}let ge=this.transform&&this.transform(S)||S;ge!==S&&(ge.on("error",ue=>this[$](ue,S)),S.pipe(ge)),ge.on("data",ue=>{try{n.writeSync(le,ue,0,ue.length)}catch(fe){se(fe)}}),ge.on("end",ue=>{let fe=null;if(S.mtime&&!this.noMtime){let ve=S.atime||new Date,ut=S.mtime;try{n.futimesSync(le,ve,ut)}catch(ht){try{n.utimesSync(S.absolute,ve,ut)}catch{fe=ht}}}if(this[z](S)){let ve=this[D](S),ut=this[p](S);try{n.fchownSync(le,ve,ut)}catch(ht){try{n.chownSync(S.absolute,ve,ut)}catch{fe=fe||ht}}}se(fe)})}[O](S,Y){let X=S.mode&4095||this.dmode,se=this[P](S.absolute,X);if(se){this[$](se,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[p](S))}catch{}Y(),S.resume()}[P](S,Y){try{return a.sync(h(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(X){return X}}[I](S,Y,X,se){try{n[X+"Sync"](Y,S.absolute),se(),S.resume()}catch(le){return this[$](le,S)}}};ce.Sync=_e,e.exports=ce}),yk=ee((t,e)=>{"use strict";W();var r=bn(),i=yg(),n=te("fs"),s=vn(),o=te("path"),a=En();e.exports=(d,g,y)=>{typeof d=="function"?(y=d,g=null,d={}):Array.isArray(d)&&(g=d,d={}),typeof g=="function"&&(y=g,g=null),g?g=Array.from(g):g=[];let _=r(d);if(_.sync&&typeof y=="function")throw new TypeError("callback not supported for sync tar functions");if(!_.file&&typeof y=="function")throw new TypeError("callback only supported with file option");return g.length&&l(_,g),_.file&&_.sync?c(_):_.file?u(_,y):_.sync?h(_):f(_)};var l=(d,g)=>{let y=new Map(g.map(k=>[a(k),!0])),_=d.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};d.filter=_?(k,C)=>_(k,C)&&x(a(k)):k=>x(a(k))},c=d=>{let g=new i.Sync(d),y=d.file,_=n.statSync(y),x=d.maxReadSize||16*1024*1024;new s.ReadStreamSync(y,{readSize:x,size:_.size}).pipe(g)},u=(d,g)=>{let y=new i(d),_=d.maxReadSize||16*1024*1024,x=d.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:_,size:I.size});w.on("error",T),w.pipe(y)}})});return g?k.then(g,g):k},h=d=>new i.Sync(d),f=d=>new i(d)}),gk=ee(t=>{"use strict";W(),t.c=t.create=nk(),t.r=t.replace=pg(),t.t=t.list=Pc(),t.u=t.update=sk(),t.x=t.extract=yk(),t.Pack=Cc(),t.Unpack=yg(),t.Parse=Lc(),t.ReadEntry=Oc(),t.WriteEntry=hg(),t.Header=Sn(),t.Pax=Tc(),t.types=lg()}),_k=ee((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}}),bk=ee(t=>{W();var e=_k();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),h=Array.prototype.slice.call(arguments,1),f=h.pop();h.push(function(d){u.retry(d)||(d&&(arguments[0]=u.mainError()),f.apply(this,arguments))}),u.attempt(function(){c.apply(r,h)})}.bind(r,l),r[a].options=i}}}),wk=ee((t,e)=>{W(),e.exports=bk()}),Sk=ee((t,e)=>{W();var r=wk();function i(n,s){function o(a,l){var c=s||{},u;"randomize"in c||(c.randomize=!0),u=r.operation(c);function h(g){l(g||new Error("Aborted"))}function f(g,y){if(g.bail){h(g);return}u.retry(g)?c.onRetry&&c.onRetry(g,y):l(u.mainError())}function d(g){var y;try{y=n(h,g)}catch(_){f(_,g);return}Promise.resolve(y).then(a).catch(function(_){f(_,g)})}u.attempt(d)}return new Promise(o)}e.exports=i}),Ek={};$T(Ek,{bold:()=>Ok,dimmed:()=>kk,error:()=>Ik,grey:()=>Ck,info:()=>Ak,item:()=>Lk,log:()=>jr,turboBlue:()=>vi,turboGradient:()=>Rk,turboLoader:()=>xk,turboRed:()=>Sg,underline:()=>Tk,warn:()=>Pk,yellow:()=>Eg});W();var bg="#0099F7",wg="#F11712",vk="#FFFF00",Rk=(0,_g.default)(bg,wg),vi=ur.default.hex(bg),Sg=ur.default.hex(wg),Eg=ur.default.hex(vk),xk=t=>(0,gg.default)({text:t,spinner:{frames:[" ",vi("> "),vi(">> "),vi(">>>")]}}),Ak=(...t)=>{jr(vi.bold(">>>"),...t)},Ok=(...t)=>{jr(ur.default.bold(...t))},Tk=(...t)=>{jr(ur.default.underline(...t))},kk=(...t)=>{jr(ur.default.dim(...t))},Ck=(...t)=>{jr(ur.default.grey(...t))},Lk=(...t)=>{jr(vi.bold(" \u2022"),...t)},jr=(...t)=>{console.log(...t)},Pk=(...t)=>{console.error(Eg.bold(">>>"),...t)},Ik=(...t)=>{console.error(Sg.bold(">>>"),...t)};W();W();W();W();var KN=zs(YT());W();W();function Dk(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}W();W();function vc(t){return vc=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},vc(t)}W();function Mk(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Fk(t,e){if(e&&(vc(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Mk(t)}W();function Gs(t){return Gs=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Gs(t)}W();W();function yn(t,e){return yn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},yn(t,e)}function Bk(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&&yn(t,e)}W();W();function jk(t){return Function.toString.call(t).indexOf("[native code]")!==-1}W();W();function Hk(){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 $s(t,e,r){return Hk()?$s=Reflect.construct.bind():$s=function(i,n,s){var o=[null];o.push.apply(o,n);var a=Function.bind.apply(i,o),l=new a;return s&&yn(l,s.prototype),l},$s.apply(null,arguments)}function Rc(t){var e=typeof Map=="function"?new Map:void 0;return Rc=function(r){if(r===null||!jk(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 $s(r,arguments,Gs(this).constructor)}return i.prototype=Object.create(r.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),yn(i,r)},Rc(t)}var VN=zs(QT()),JN=function(t){Bk(e,t);function e(r){var i;return Dk(this,e),i=Fk(this,Gs(e).call(this,"No package.json could be found upwards from the directory ".concat(r))),i.directory=r,i}return e}(Rc(Error));W();W();W();W();W();W();var cD=zs(gk()),uD=(0,Rg.promisify)(vg.Stream.pipeline);W();W();var dD=zs(Sk());W();W();W();var Ie=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,Ie)}};W();W();W();W();var qk=/^(?!_)(?<manager>.+)@(?<version>.+)$/;function $e({workspaceRoot:t}){let e=Ft.default.join(t,"package.json");try{return(0,Ze.readJsonSync)(e,"utf8")}catch(r){if(r&&typeof r=="object"&&"code"in r){if(r.code==="ENOENT")throw new Ie(`no "package.json" found at ${t}`,{type:"package_json-missing"});if(r.code==="EJSONPARSE")throw new Ie(`failed to parse "package.json" at ${t}`,{type:"package_json-parse_error"})}throw new Error(`unexpected error reading "package.json" at ${t}`)}}function Ws({workspaceRoot:t}){let{packageManager:e}=$e({workspaceRoot:t});if(e)try{let r=qk.exec(e);if(r){let[i,n]=r;return n}}catch{}}function Rn({workspaceRoot:t}){let e=$e({workspaceRoot:t}),r=Ft.default.basename(t),{name:i=r,description:n}=e;return{name:i,description:n}}function ig({workspaceRoot:t}){let e=Ft.default.join(t,"pnpm-workspace.yaml");if((0,Ze.existsSync)(e))try{let r=qa.load((0,Ze.readFileSync)(e,"utf8"));if(r instanceof Object&&"packages"in r&&Array.isArray(r.packages))return r.packages}catch{throw new Ie(`failed to parse ${e}`,{type:"pnpm-workspace_parse_error"})}return[]}function Ys({root:t,lockFile:e,workspaceConfig:r}){let i=s=>Ft.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 Ic({workspaces:t}){var e;return t?Array.isArray(t)?t:"packages"in t?(e=t.packages)!=null?e:[]:[]:[]}function Ks({workspaceRoot:t,workspaceGlobs:e}){if(!e)return[];let r=e.filter(i=>i.startsWith("!")).map(i=>i.slice(1));return e.filter(i=>!i.startsWith("!")).flatMap(i=>{let n=[`${i}/package.json`];return(0,Cg.sync)(n,{onlyFiles:!0,absolute:!0,cwd:t,ignore:["**/node_modules/**",...r]})}).map(i=>{let n=Ft.default.dirname(i),{name:s,description:o}=Rn({workspaceRoot:n});return{name:s,description:o,paths:{root:n,packageJson:i,nodeModules:Ft.default.join(n,"node_modules")}}})}function Uk({directory:t}){let e=Ft.default.resolve(process.cwd(),t);return{exists:(0,Ze.existsSync)(e),absolute:e}}function hr({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 $k({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 Mt({project:t,options:e}){e!=null&&e.dry||(0,Ze.rmSync)(t.paths.lockfile,{force:!0})}async function Lg({project:t,options:e}){if(!(e!=null&&e.dry)&&(0,Ze.existsSync)(t.paths.lockfile))try{let{stdout:r}=await(0,kg.default)("bun",["bun.lockb"],{stdin:"ignore",cwd:t.paths.root});await(0,Ze.writeFile)(Ft.default.join(t.paths.root,"yarn.lock"),r)}catch{}finally{(0,Ze.rmSync)(t.paths.lockfile,{force:!0})}}function Gk({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 lr({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=$e({workspaceRoot:e.paths.root}),o={dependencies:[],devDependencies:[],peerDependencies:[],optionalDependencies:[]},a=["dependencies","devDependencies","peerDependencies","optionalDependencies"];a.forEach(h=>{let f=s[h];if(f){let{updated:d,dependencyList:g}=Gk({dependencyList:f,project:t,to:r});s[h]=g,o[h]=d}});let l=h=>{let f=o[h].length;if(f>0)return`${Tg.default.green(f.toString())} ${h}`},c=a.map(l).filter(Boolean),u=`./${Ag.default.relative(t.paths.root,e.paths.packageJson)}`;if(c.length>=1){let h="updating";c.forEach((f,d)=>{c.length===1?h+=` ${f} in ${u}`:d===c.length-1?h+=`and ${f} in ${u}`:h+=` ${f}, `}),i.workspaceStep(h)}else i.workspaceStep(`no workspace dependencies found in ${u}`);n!=null&&n.dry||(0,Og.writeJSONSync)(e.paths.packageJson,s,{spaces:2})}var cr={name:"pnpm",lock:"pnpm-lock.yaml"};async function Pg(t){let e=Fr.default.join(t.workspaceRoot,cr.lock),r=Fr.default.join(t.workspaceRoot,"pnpm-workspace.yaml"),i=Ws({workspaceRoot:t.workspaceRoot});return(0,He.existsSync)(e)||(0,He.existsSync)(r)||i===cr.name}async function zk(t){if(!await Pg(t))throw new Ie("Not a pnpm project",{type:"package_manager-unexpected"});let{name:e,description:r}=Rn(t);return{name:e,description:r,packageManager:cr.name,paths:Ys({root:t.workspaceRoot,lockFile:cr.lock,workspaceConfig:"pnpm-workspace.yaml"}),workspaceData:{globs:ig(t),workspaces:Ks({workspaceGlobs:ig(t),...t})}}}async function Wk(t){let{project:e,to:r,logger:i,options:n}=t,s=e.workspaceData.globs.length>0;i.mainStep(hr({action:"create",packageManager:cr.name,project:e}));let o=$e({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,He.writeJSONSync)(e.paths.packageJson,o,{spaces:2}),s&&(i.rootStep('adding "pnpm-workspace.yaml"'),(0,He.writeFileSync)(Fr.default.join(e.paths.root,"pnpm-workspace.yaml"),`packages:
|
42
42
|
${e.workspaceData.globs.map(a=>` - "${a}"`).join(`
|
43
43
|
`)}`))),s&&(lr({workspace:{name:"root",paths:e.paths},project:e,to:r,logger:i,options:n}),i.workspaceHeader(),e.workspaceData.workspaces.forEach(a=>{lr({workspace:a,project:e,to:r,logger:i,options:n})}))}async function Yk(t){let{project:e,logger:r,options:i}=t,n=e.workspaceData.globs.length>0;r.mainStep(hr({action:"remove",packageManager:cr.name,project:e}));let s=$e({workspaceRoot:e.paths.root});if(e.paths.workspaceConfig&&n&&(r.subStep('removing "pnpm-workspace.yaml"'),i!=null&&i.dry||(0,He.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,He.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,He.rm)(a,{recursive:!0,force:!0})))}catch{throw new Ie("Failed to remove node_modules",{type:"error_removing_node_modules"})}}}async function Kk(t){let{project:e,logger:r,options:i}=t;r.subStep(`removing ${Fr.default.relative(e.paths.root,e.paths.lockfile)}`),i!=null&&i.dry||(0,He.rmSync)(e.paths.lockfile,{force:!0})}async function Vk(t){let{project:e,options:r,logger:i}=t,n=()=>{i.subStep(`converting ${Fr.default.relative(e.paths.root,e.paths.lockfile)} to ${cr.lock}`)},s=async()=>{if(!(r!=null&&r.dry)&&(0,He.existsSync)(e.paths.lockfile))try{await(0,xg.default)(cr.name,["import"],{stdio:"ignore",cwd:e.paths.root})}catch{}finally{Mt({project:e,options:r})}};switch(e.packageManager){case"pnpm":break;case"bun":n(),await Lg({project:e,options:r}),await s(),(0,He.rmSync)(Fr.default.join(e.paths.root,"yarn.lock"),{force:!0});break;case"npm":n(),await s();break;case"yarn":n(),await s();break}}var Zk={detect:Pg,read:zk,create:Wk,remove:Yk,clean:Kk,convertLock:Vk};W();var Ri={name:"npm",lock:"package-lock.json"};async function Ig(t){let e=gn.default.join(t.workspaceRoot,Ri.lock),r=Ws({workspaceRoot:t.workspaceRoot});return(0,Et.existsSync)(e)||r===Ri.name}async function Xk(t){if(!await Ig(t))throw new Ie("Not an npm project",{type:"package_manager-unexpected"});let e=$e(t),{name:r,description:i}=Rn(t),n=Ic({workspaces:e.workspaces});return{name:r,description:i,packageManager:Ri.name,paths:Ys({root:t.workspaceRoot,lockFile:Ri.lock}),workspaceData:{globs:n,workspaces:Ks({workspaceGlobs:n,...t})}}}async function Jk(t){let{project:e,options:r,to:i,logger:n}=t,s=e.workspaceData.globs.length>0;n.mainStep(hr({packageManager:Ri.name,action:"create",project:e}));let o=$e({workspaceRoot:e.paths.root});n.rootHeader(),n.rootStep(`adding "packageManager" field to ${gn.default.relative(e.paths.root,e.paths.packageJson)}`),o.packageManager=`${i.name}@${i.version}`,s?(n.rootStep(`adding "workspaces" field to ${gn.default.relative(e.paths.root,e.paths.packageJson)}`),o.workspaces=e.workspaceData.globs,r!=null&&r.dry||(0,Et.writeJSONSync)(e.paths.packageJson,o,{spaces:2}),lr({workspace:{name:"root",paths:e.paths},project:e,to:i,logger:n,options:r}),n.workspaceHeader(),e.workspaceData.workspaces.forEach(a=>{lr({workspace:a,project:e,to:i,logger:n,options:r})})):r!=null&&r.dry||(0,Et.writeJSONSync)(e.paths.packageJson,o,{spaces:2})}async function Qk(t){let{project:e,logger:r,options:i}=t,n=e.workspaceData.globs.length>0;r.mainStep(hr({packageManager:Ri.name,action:"remove",project:e}));let s=$e({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,Et.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,Et.rm)(a,{recursive:!0,force:!0})))}catch{throw new Ie("Failed to remove node_modules",{type:"error_removing_node_modules"})}}}async function e1(t){let{project:e,logger:r,options:i}=t;r.subStep(`removing ${gn.default.relative(e.paths.root,e.paths.lockfile)}`),i!=null&&i.dry||(0,Et.rmSync)(e.paths.lockfile,{force:!0})}async function t1(t){let{project:e,options:r}=t;switch(e.packageManager){case"pnpm":Mt({project:e,options:r});break;case"bun":Mt({project:e,options:r});break;case"npm":break;case"yarn":Mt({project:e,options:r});break}}var r1={detect:Ig,read:Xk,create:Jk,remove:Qk,clean:e1,convertLock:t1};W();var Br={name:"yarn",lock:"yarn.lock"};async function Ng(t){let e=xi.default.join(t.workspaceRoot,Br.lock),r=Ws({workspaceRoot:t.workspaceRoot});return(0,vt.existsSync)(e)||r===Br.name}async function i1(t){if(!await Ng(t))throw new Ie("Not a yarn project",{type:"package_manager-unexpected"});let e=$e(t),{name:r,description:i}=Rn(t),n=Ic({workspaces:e.workspaces});return{name:r,description:i,packageManager:Br.name,paths:Ys({root:t.workspaceRoot,lockFile:Br.lock}),workspaceData:{globs:n,workspaces:Ks({workspaceGlobs:n,...t})}}}async function n1(t){let{project:e,to:r,logger:i,options:n}=t,s=e.workspaceData.globs.length>0;i.mainStep(hr({packageManager:Br.name,action:"create",project:e}));let o=$e({workspaceRoot:e.paths.root});i.rootHeader(),i.rootStep(`adding "packageManager" field to ${xi.default.relative(e.paths.root,e.paths.packageJson)}`),o.packageManager=`${r.name}@${r.version}`,s?(i.rootStep(`adding "workspaces" field to ${xi.default.relative(e.paths.root,e.paths.packageJson)}`),o.workspaces=e.workspaceData.globs,n!=null&&n.dry||(0,vt.writeJSONSync)(e.paths.packageJson,o,{spaces:2}),lr({workspace:{name:"root",paths:e.paths},project:e,to:r,logger:i,options:n}),i.workspaceHeader(),e.workspaceData.workspaces.forEach(a=>{lr({workspace:a,project:e,to:r,logger:i,options:n})})):n!=null&&n.dry||(0,vt.writeJSONSync)(e.paths.packageJson,o,{spaces:2})}async function s1(t){let{project:e,logger:r,options:i}=t,n=e.workspaceData.globs.length>0;r.mainStep(hr({packageManager:Br.name,action:"remove",project:e}));let s=$e({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,vt.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,vt.rm)(a,{recursive:!0,force:!0})))}catch{throw new Ie("Failed to remove node_modules",{type:"error_removing_node_modules"})}}}async function o1(t){let{project:e,logger:r,options:i}=t;r.subStep(`removing ${xi.default.relative(e.paths.root,e.paths.lockfile)}`),i!=null&&i.dry||(0,vt.rmSync)(e.paths.lockfile,{force:!0})}async function a1(t){let{project:e,options:r,logger:i}=t,n=()=>{i.subStep(`converting ${xi.default.relative(e.paths.root,e.paths.lockfile)} to ${Br.lock}`)};switch(e.packageManager){case"pnpm":Mt({project:e,options:r});break;case"bun":n(),await Lg({project:e,options:r});break;case"npm":Mt({project:e,options:r});break;case"yarn":break}}var l1={detect:Ng,read:i1,create:n1,remove:s1,clean:o1,convertLock:a1};W();var Ai={name:"bun",lock:"bun.lockb"};async function Dg(t){let e=_n.default.join(t.workspaceRoot,Ai.lock),r=Ws({workspaceRoot:t.workspaceRoot});return(0,Rt.existsSync)(e)||r===Ai.name}async function c1(t){if(!await Dg(t))throw new Ie("Not a bun project",{type:"package_manager-unexpected"});let e=$e(t),{name:r,description:i}=Rn(t),n=Ic({workspaces:e.workspaces});return{name:r,description:i,packageManager:Ai.name,paths:Ys({root:t.workspaceRoot,lockFile:Ai.lock}),workspaceData:{globs:n,workspaces:Ks({workspaceGlobs:n,...t})}}}async function u1(t){let{project:e,to:r,logger:i,options:n}=t,s=e.workspaceData.globs.length>0;if(!$k({project:e}))throw new Ie("Unable to convert project to bun - workspace globs unsupported",{type:"bun-workspace_glob_error"});i.mainStep(hr({packageManager:Ai.name,action:"create",project:e}));let o=$e({workspaceRoot:e.paths.root});i.rootHeader(),i.rootStep(`adding "packageManager" field to ${_n.default.relative(e.paths.root,e.paths.packageJson)}`),o.packageManager=`${r.name}@${r.version}`,s?(i.rootStep(`adding "workspaces" field to ${_n.default.relative(e.paths.root,e.paths.packageJson)}`),o.workspaces=e.workspaceData.globs,n!=null&&n.dry||(0,Rt.writeJSONSync)(e.paths.packageJson,o,{spaces:2}),lr({workspace:{name:"root",paths:e.paths},project:e,to:r,logger:i,options:n}),i.workspaceHeader(),e.workspaceData.workspaces.forEach(a=>{lr({workspace:a,project:e,to:r,logger:i,options:n})})):n!=null&&n.dry||(0,Rt.writeJSONSync)(e.paths.packageJson,o,{spaces:2})}async function h1(t){let{project:e,logger:r,options:i}=t,n=e.workspaceData.globs.length>0;r.mainStep(hr({packageManager:Ai.name,action:"remove",project:e}));let s=$e({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,Rt.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,Rt.rm)(a,{recursive:!0,force:!0})))}catch{throw new Ie("Failed to remove node_modules",{type:"error_removing_node_modules"})}}}async function f1(t){let{project:e,logger:r,options:i}=t;r.subStep(`removing ${_n.default.relative(e.paths.root,e.paths.lockfile)}`),i!=null&&i.dry||(0,Rt.rmSync)(e.paths.lockfile,{force:!0})}async function p1(t){let{project:e,options:r}=t;switch(e.packageManager){case"pnpm":Mt({project:e,options:r});break;case"bun":break;case"npm":Mt({project:e,options:r});break;case"yarn":Mt({project:e,options:r});break}}var d1={detect:Dg,read:c1,create:u1,remove:h1,clean:f1,convertLock:p1},Mg={pnpm:Zk,yarn:l1,npm:r1,bun:d1};W();async function Nc({root:t}){let{exists:e,absolute:r}=Uk({directory:t});if(!e)throw new Ie(`Could not find directory at ${r}. Ensure the directory exists.`,{type:"invalid_directory"});for(let{detect:i,read:n}of Object.values(Mg))if(await i({workspaceRoot:r}))return n({workspaceRoot:r});throw new Ie("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 S1=ie(Ug());function Mc(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function xn(t){return xn=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},xn(t)}function Fc(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Bc(t,e){if(e&&(xn(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Fc(t)}function Hr(t){return Hr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Hr(t)}function Ht(t,e){return Ht=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,n){return i.__proto__=n,i},Ht(t,e)}function jc(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&&Ht(t,e)}function Hc(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function qc(){if(typeof Reflect=="undefined"||!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 Oi(t,e,r){return qc()?Oi=Reflect.construct.bind():Oi=function(n,s,o){var a=[null];a.push.apply(a,s);var l=Function.bind.apply(n,a),c=new l;return o&&Ht(c,o.prototype),c},Oi.apply(null,arguments)}function An(t){var e=typeof Map=="function"?new Map:void 0;return An=function(i){if(i===null||!Hc(i))return i;if(typeof i!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e!="undefined"){if(e.has(i))return e.get(i);e.set(i,n)}function n(){return Oi(i,arguments,Hr(this).constructor)}return n.prototype=Object.create(i.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),Ht(n,i)},An(t)}var $g=ie(require("find-up"));var E1=ie(require("fs-extra")),WM=function(t){jc(e,t);function e(r){var i;return Mc(this,e),i=Bc(this,Hr(e).call(this,"No package.json could be found upwards from the directory ".concat(r))),i.directory=r,i}return e}(An(Error));var A1=ie(require("json5"));var v1=ie(require("fs")),R1=ie(require("path"));var M1=ie(require("fs")),F1=ie(require("path"));var B1=ie(Us()),j1=ie(require("json5"));var it={};Ch(it,{bold:()=>C1,dimmed:()=>P1,error:()=>Jg,grey:()=>I1,info:()=>k1,item:()=>N1,log:()=>pr,turboBlue:()=>Ti,turboGradient:()=>T1,turboLoader:()=>Zg,turboRed:()=>Kg,underline:()=>L1,warn:()=>Xg,yellow:()=>Vg});var fr=ie(require("chalk")),Gg=ie(require("ora")),zg=ie(require("gradient-string")),Wg="#0099F7",Yg="#F11712",O1="#FFFF00",T1=(0,zg.default)(Wg,Yg),Ti=fr.default.hex(Wg),Kg=fr.default.hex(Yg),Vg=fr.default.hex(O1),Zg=t=>(0,Gg.default)({text:t,spinner:{frames:[" ",Ti("> "),Ti(">> "),Ti(">>>")]}}),k1=(...t)=>{pr(Ti.bold(">>>"),...t)},C1=(...t)=>{pr(fr.default.bold(...t))},L1=(...t)=>{pr(fr.default.underline(...t))},P1=(...t)=>{pr(fr.default.dim(...t))},I1=(...t)=>{pr(fr.default.grey(...t))},N1=(...t)=>{pr(Ti.bold(" \u2022"),...t)},pr=(...t)=>{console.log(...t)},Xg=(...t)=>{console.error(Vg.bold(">>>"),...t)},Jg=(...t)=>{console.error(Kg.bold(">>>"),...t)};var Qg=ie(require("os")),e_=ie(li());async function Zs(t,e=[],r){let i={cwd:Qg.default.tmpdir(),env:{COREPACK_ENABLE_STRICT:"0"},...r};try{let{stdout:n}=await(0,e_.default)(t,e,i);return n.trim()}catch{return}}async function Uc(){let[t,e,r,i]=await Promise.all([Zs("yarnpkg",["--version"]),Zs("npm",["--version"]),Zs("pnpm",["--version"]),Zs("bun",["--version"])]);return{yarn:t,pnpm:r,npm:e,bun:i}}var H1=ie(require("fs-extra"));var q1=ie(require("path")),U1=ie(require("fs-extra")),$1=ie(require("chalk"));var Qw=require("stream"),eS=require("util"),xP=require("path"),AP=require("os"),tS=require("fs"),OP=ie(Jw());var tB=(0,eS.promisify)(Qw.Stream.pipeline);var rS=require("fs-extra");var FP=ie(require("path")),BP=ie(cS()),jP=ie(require("chalk")),Th=require("fs-extra");var oa=ie(require("chalk"));var dt=ie(require("chalk")),Ji=class{constructor(e){this.transform=e.transformer,this.dry=e.dryRun}_log(...e){console.log(...e)}modified(...e){this._log(dt.default.green(" MODIFIED "),...e,this.dry?dt.default.dim("(dry run)"):"")}unchanged(...e){this._log(dt.default.gray(" UNCHANGED "),...e,this.dry?dt.default.dim("(dry run)"):"")}skipped(...e){this._log(dt.default.yellow(" SKIPPED "),...e,this.dry?dt.default.dim("(dry run)"):"")}error(...e){this._log(dt.default.red(" ERROR "),...e,this.dry?dt.default.dim("(dry run)"):"")}info(...e){this._log(dt.default.bold(" INFO "),...e,this.dry?dt.default.dim("(dry run)"):"")}};var uS=ie(require("os")),kh=ie(require("path"));var ia=ie(require("chalk")),sa=require("diff"),Or=require("fs-extra"),na=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{kh.default.extname(e.filePath)===".json"?this.before=(0,Or.readJsonSync)(e.filePath):this.before=(0,Or.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,sa.diffJson)(this.before,e.after):this.changes=(0,sa.diffLines)(this.before,e.after):this.changes=[]}fileName(){return kh.default.relative(this.rootPath,this.filePath)}write(){this.after&&(typeof this.after=="object"?(0,Or.writeJsonSync)(this.filePath,this.after,{spaces:2}):(0,Or.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(ia.default.green(r.value)):r.removed?process.stdout.write(ia.default.red(r.value)):process.stdout.write(ia.default.dim(r.value))}),it.log(uS.default.EOL)):it.log(this.after)}};var Yn=class{constructor(e){this.modifications={};this.transform=e.transformer,this.rootPath=e.rootPath,this.dry=e.dryRun,this.print=e.print,this.logger=new Ji(e)}abortTransform(e){return this.logger.error(e.reason),{fatalError:new Error(e.reason),changes:e.changes||{}}}modifyFile(e){this.modifications[e.filePath]=new na({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(oa.default.dim(n.fileName()));else try{n.write(),s.action="modified",this.logger.modified(oa.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(oa.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(it.log(),r.length>0){it.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),it.log()}}};function hS({transformer:t,rootPath:e,options:r}){let i={transformer:t,rootPath:e,...r},n=new Ji(i),s=new Yn(i);return{log:n,runner:s}}var dS="add-package-manager",HP="Set the `packageManager` key in root `package.json` file",qP="1.1.0";async function mS({root:t,options:e}){let{log:r,runner:i}=hS({transformer:dS,rootPath:t,options:e});r.info('Set "packageManager" key in root "package.json" file...');let n;try{n=await Nc({root:t})}catch{return i.abortTransform({reason:`Unable to determine package manager for ${t}`})}let s=await Uc(),{packageManager:o}=n,a=s[o];if(!a)return i.abortTransform({reason:`Unable to determine package manager version for ${t}`});let l=`${o}@${a}`,c=fS.default.join(t,"package.json"),u=(0,pS.readJsonSync)(c),h=[{name:"package.json",path:t,packageJson:{...u,packageJsonPath:c}}];for(let f of h){let{packageJsonPath:d,...g}=f.packageJson,y={...g,packageManager:l};i.modifyFile({filePath:d,after:y})}return i.finish()}var UP={name:dS,description:HP,introducedIn:qP,transformer:mS},$P=UP;0&&(module.exports={transformer});
|
44
44
|
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|