create-turbo 2.5.9-canary.5 → 2.5.9-canary.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +3 -3
- package/package.json +3 -3
package/dist/cli.js
CHANGED
@@ -27,7 +27,7 @@ Please report this to https://github.com/szmarczak/http2-wrapper/`);m(y)}return}
|
|
27
27
|
`).reverse(),u=r.stack.slice(r.stack.indexOf(r.message)+r.message.length).split(`
|
28
28
|
`).reverse();for(;u.length!==0&&u[0]===a[0];)a.shift();this.stack=`${this.stack.slice(0,o)}${a.reverse().join(`
|
29
29
|
`)}${u.reverse().join(`
|
30
|
-
`)}`}}};ke.RequestError=Ue;var Bl=class extends Ue{constructor(e){super(`Redirected ${e.options.maxRedirects} times. Aborting.`,{},e),this.name="MaxRedirectsError",this.code="ERR_TOO_MANY_REDIRECTS"}};ke.MaxRedirectsError=Bl;var Nl=class extends Ue{constructor(e){super(`Response code ${e.statusCode} (${e.statusMessage})`,{},e.request),this.name="HTTPError",this.code="ERR_NON_2XX_3XX_RESPONSE"}};ke.HTTPError=Nl;var Ml=class extends Ue{constructor(e,r){super(e.message,e,r),this.name="CacheError",this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_CACHE_ACCESS":this.code}};ke.CacheError=Ml;var jl=class extends Ue{constructor(e,r){super(e.message,e,r),this.name="UploadError",this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_UPLOAD":this.code}};ke.UploadError=jl;var ql=class extends Ue{constructor(e,r,n){super(e.message,e,n),this.name="TimeoutError",this.event=e.event,this.timings=r}};ke.TimeoutError=ql;var wa=class extends Ue{constructor(e,r){super(e.message,e,r),this.name="ReadError",this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_READING_RESPONSE_STREAM":this.code}};ke.ReadError=wa;var Ul=class extends Ue{constructor(e){super(`Unsupported protocol "${e.url.protocol}"`,{},e),this.name="UnsupportedProtocolError",this.code="ERR_UNSUPPORTED_PROTOCOL"}};ke.UnsupportedProtocolError=Ul;var Uq=["socket","connect","continue","information","upgrade","timeout"],Hl=class extends vR.Duplex{constructor(e,r={},n){super({autoDestroy:!1,highWaterMark:0}),this[Ks]=0,this[Js]=0,this.requestInitialized=!1,this[Pl]=new Set,this.redirects=[],this[Xs]=!1,this[Il]=!1,this[Ea]=[],this.retryCount=0,this._progressCallbacks=[];let i=()=>this._unlockWrite(),s=()=>this._lockWrite();this.on("pipe",c=>{c.prependListener("data",i),c.on("data",s),c.prependListener("end",i),c.on("end",s)}),this.on("unpipe",c=>{c.off("data",i),c.off("data",s),c.off("end",i),c.off("end",s)}),this.on("pipe",c=>{c instanceof dy.IncomingMessage&&(this.options.headers={...c.headers,...this.options.headers})});let{json:o,body:a,form:u}=r;if((o||a||u)&&this._lockWrite(),ke.kIsNormalizedAlready in r)this.options=r;else try{this.options=this.constructor.normalizeArguments(e,r,n)}catch(c){K.default.nodeStream(r.body)&&r.body.destroy(),this.destroy(c);return}(async()=>{var c;try{this.options.body instanceof vq.ReadStream&&await Mq(this.options.body);let{url:l}=this.options;if(!l)throw new TypeError("Missing `url` property");if(this.requestUrl=l.toString(),decodeURI(this.requestUrl),await this._finalizeBody(),await this._makeRequest(),this.destroyed){(c=this[nt])===null||c===void 0||c.destroy();return}for(let h of this[Ea])h();this[Ea].length=0,this.requestInitialized=!0}catch(l){if(l instanceof Ue){this._beforeError(l);return}this.destroyed||this.destroy(l)}})()}static normalizeArguments(e,r,n){var i,s,o,a,u;let c=r;if(K.default.object(e)&&!K.default.urlInstance(e))r={...n,...e,...r};else{if(e&&r&&r.url!==void 0)throw new TypeError("The `url` option is mutually exclusive with the `input` argument");r={...n,...r},e!==void 0&&(r.url=e),K.default.urlInstance(r.url)&&(r.url=new Pn.URL(r.url.toString()))}if(r.cache===!1&&(r.cache=void 0),r.dnsCache===!1&&(r.dnsCache=void 0),K.assert.any([K.default.string,K.default.undefined],r.method),K.assert.any([K.default.object,K.default.undefined],r.headers),K.assert.any([K.default.string,K.default.urlInstance,K.default.undefined],r.prefixUrl),K.assert.any([K.default.object,K.default.undefined],r.cookieJar),K.assert.any([K.default.object,K.default.string,K.default.undefined],r.searchParams),K.assert.any([K.default.object,K.default.string,K.default.undefined],r.cache),K.assert.any([K.default.object,K.default.number,K.default.undefined],r.timeout),K.assert.any([K.default.object,K.default.undefined],r.context),K.assert.any([K.default.object,K.default.undefined],r.hooks),K.assert.any([K.default.boolean,K.default.undefined],r.decompress),K.assert.any([K.default.boolean,K.default.undefined],r.ignoreInvalidCookies),K.assert.any([K.default.boolean,K.default.undefined],r.followRedirect),K.assert.any([K.default.number,K.default.undefined],r.maxRedirects),K.assert.any([K.default.boolean,K.default.undefined],r.throwHttpErrors),K.assert.any([K.default.boolean,K.default.undefined],r.http2),K.assert.any([K.default.boolean,K.default.undefined],r.allowGetBody),K.assert.any([K.default.string,K.default.undefined],r.localAddress),K.assert.any([DR.isDnsLookupIpVersion,K.default.undefined],r.dnsLookupIpVersion),K.assert.any([K.default.object,K.default.undefined],r.https),K.assert.any([K.default.boolean,K.default.undefined],r.rejectUnauthorized),r.https&&(K.assert.any([K.default.boolean,K.default.undefined],r.https.rejectUnauthorized),K.assert.any([K.default.function_,K.default.undefined],r.https.checkServerIdentity),K.assert.any([K.default.string,K.default.object,K.default.array,K.default.undefined],r.https.certificateAuthority),K.assert.any([K.default.string,K.default.object,K.default.array,K.default.undefined],r.https.key),K.assert.any([K.default.string,K.default.object,K.default.array,K.default.undefined],r.https.certificate),K.assert.any([K.default.string,K.default.undefined],r.https.passphrase),K.assert.any([K.default.string,K.default.buffer,K.default.array,K.default.undefined],r.https.pfx)),K.assert.any([K.default.object,K.default.undefined],r.cacheOptions),K.default.string(r.method)?r.method=r.method.toUpperCase():r.method="GET",r.headers===(n==null?void 0:n.headers)?r.headers={...r.headers}:r.headers=Dq({...n==null?void 0:n.headers,...r.headers}),"slashes"in r)throw new TypeError("The legacy `url.Url` has been deprecated. Use `URL` instead.");if("auth"in r)throw new TypeError("Parameter `auth` is deprecated. Use `username` / `password` instead.");if("searchParams"in r&&r.searchParams&&r.searchParams!==(n==null?void 0:n.searchParams)){let d;if(K.default.string(r.searchParams)||r.searchParams instanceof Pn.URLSearchParams)d=new Pn.URLSearchParams(r.searchParams);else{Bq(r.searchParams),d=new Pn.URLSearchParams;for(let m in r.searchParams){let y=r.searchParams[m];y===null?d.append(m,""):y!==void 0&&d.append(m,y)}}(i=n==null?void 0:n.searchParams)===null||i===void 0||i.forEach((m,y)=>{d.has(y)||d.append(y,m)}),r.searchParams=d}if(r.username=(s=r.username)!==null&&s!==void 0?s:"",r.password=(o=r.password)!==null&&o!==void 0?o:"",K.default.undefined(r.prefixUrl)?r.prefixUrl=(a=n==null?void 0:n.prefixUrl)!==null&&a!==void 0?a:"":(r.prefixUrl=r.prefixUrl.toString(),r.prefixUrl!==""&&!r.prefixUrl.endsWith("/")&&(r.prefixUrl+="/")),K.default.string(r.url)){if(r.url.startsWith("/"))throw new Error("`input` must not start with a slash when using `prefixUrl`");r.url=AR.default(r.prefixUrl+r.url,r)}else(K.default.undefined(r.url)&&r.prefixUrl!==""||r.protocol)&&(r.url=AR.default(r.prefixUrl,r));if(r.url){"port"in r&&delete r.port;let{prefixUrl:d}=r;Object.defineProperty(r,"prefixUrl",{set:y=>{let p=r.url;if(!p.href.startsWith(y))throw new Error(`Cannot change \`prefixUrl\` from ${d} to ${y}: ${p.href}`);r.url=new Pn.URL(y+p.href.slice(d.length)),d=y},get:()=>d});let{protocol:m}=r.url;if(m==="unix:"&&(m="http:",r.url=new Pn.URL(`http://unix${r.url.pathname}${r.url.search}`)),r.searchParams&&(r.url.search=r.searchParams.toString()),m!=="http:"&&m!=="https:")throw new Ul(r);r.username===""?r.username=r.url.username:r.url.username=r.username,r.password===""?r.password=r.url.password:r.url.password=r.password}let{cookieJar:l}=r;if(l){let{setCookie:d,getCookieString:m}=l;K.assert.function_(d),K.assert.function_(m),d.length===4&&m.length===0&&(d=bR.promisify(d.bind(r.cookieJar)),m=bR.promisify(m.bind(r.cookieJar)),r.cookieJar={setCookie:d,getCookieString:m})}let{cache:h}=r;if(h&&(yy.has(h)||yy.set(h,new wR((d,m)=>{let y=d[nt](d,m);return K.default.promise(y)&&(y.once=(p,E)=>{if(p==="error")y.catch(E);else if(p==="abort")(async()=>{try{(await y).once("abort",E)}catch{}})();else throw new Error(`Unknown HTTP2 promise event: ${p}`);return y}),y},h))),r.cacheOptions={...r.cacheOptions},r.dnsCache===!0)py||(py=new xq.default),r.dnsCache=py;else if(!K.default.undefined(r.dnsCache)&&!r.dnsCache.lookup)throw new TypeError(`Parameter \`dnsCache\` must be a CacheableLookup instance or a boolean, got ${K.default(r.dnsCache)}`);K.default.number(r.timeout)?r.timeout={request:r.timeout}:n&&r.timeout!==n.timeout?r.timeout={...n.timeout,...r.timeout}:r.timeout={...r.timeout},r.context||(r.context={});let f=r.hooks===(n==null?void 0:n.hooks);r.hooks={...r.hooks};for(let d of ke.knownHookEvents)if(d in r.hooks)if(K.default.array(r.hooks[d]))r.hooks[d]=[...r.hooks[d]];else throw new TypeError(`Parameter \`${d}\` must be an Array, got ${K.default(r.hooks[d])}`);else r.hooks[d]=[];if(n&&!f)for(let d of ke.knownHookEvents)n.hooks[d].length>0&&(r.hooks[d]=[...n.hooks[d],...r.hooks[d]]);if("family"in r&&In.default('"options.family" was never documented, please use "options.dnsLookupIpVersion"'),n!=null&&n.https&&(r.https={...n.https,...r.https}),"rejectUnauthorized"in r&&In.default('"options.rejectUnauthorized" is now deprecated, please use "options.https.rejectUnauthorized"'),"checkServerIdentity"in r&&In.default('"options.checkServerIdentity" was never documented, please use "options.https.checkServerIdentity"'),"ca"in r&&In.default('"options.ca" was never documented, please use "options.https.certificateAuthority"'),"key"in r&&In.default('"options.key" was never documented, please use "options.https.key"'),"cert"in r&&In.default('"options.cert" was never documented, please use "options.https.certificate"'),"passphrase"in r&&In.default('"options.passphrase" was never documented, please use "options.https.passphrase"'),"pfx"in r&&In.default('"options.pfx" was never documented, please use "options.https.pfx"'),"followRedirects"in r)throw new TypeError("The `followRedirects` option does not exist. Use `followRedirect` instead.");if(r.agent){for(let d in r.agent)if(d!=="http"&&d!=="https"&&d!=="http2")throw new TypeError(`Expected the \`options.agent\` properties to be \`http\`, \`https\` or \`http2\`, got \`${d}\``)}return r.maxRedirects=(u=r.maxRedirects)!==null&&u!==void 0?u:0,ke.setNonEnumerableProperties([n,c],r),Pq.default(r,n)}_lockWrite(){let e=()=>{throw new TypeError("The payload has been already provided")};this.write=e,this.end=e}_unlockWrite(){this.write=super.write,this.end=super.end}async _finalizeBody(){let{options:e}=this,{headers:r}=e,n=!K.default.undefined(e.form),i=!K.default.undefined(e.json),s=!K.default.undefined(e.body),o=n||i||s,a=ke.withoutBody.has(e.method)&&!(e.method==="GET"&&e.allowGetBody);if(this._cannotHaveBody=a,o){if(a)throw new TypeError(`The \`${e.method}\` method cannot be used with a body`);if([s,n,i].filter(u=>u).length>1)throw new TypeError("The `body`, `json` and `form` options are mutually exclusive");if(s&&!(e.body instanceof vR.Readable)&&!K.default.string(e.body)&&!K.default.buffer(e.body)&&!xR.default(e.body))throw new TypeError("The `body` option must be a stream.Readable, string or Buffer");if(n&&!K.default.object(e.form))throw new TypeError("The `form` option must be an Object");{let u=!K.default.string(r["content-type"]);s?(xR.default(e.body)&&u&&(r["content-type"]=`multipart/form-data; boundary=${e.body.getBoundary()}`),this[Ln]=e.body):n?(u&&(r["content-type"]="application/x-www-form-urlencoded"),this[Ln]=new Pn.URLSearchParams(e.form).toString()):(u&&(r["content-type"]="application/json"),this[Ln]=e.stringifyJson(e.json));let c=await Cq.default(this[Ln],e.headers);K.default.undefined(r["content-length"])&&K.default.undefined(r["transfer-encoding"])&&!a&&!K.default.undefined(c)&&(r["content-length"]=String(c))}}else a?this._lockWrite():this._unlockWrite();this[Zs]=Number(r["content-length"])||void 0}async _onResponseBase(e){let{options:r}=this,{url:n}=r;this[TR]=e,r.decompress&&(e=Sq(e));let i=e.statusCode,s=e;s.statusMessage=s.statusMessage?s.statusMessage:ER.STATUS_CODES[i],s.url=r.url.toString(),s.requestUrl=this.requestUrl,s.redirectUrls=this.redirects,s.request=this,s.isFromCache=e.fromCache||!1,s.ip=this.ip,s.retryCount=this.retryCount,this[RR]=s.isFromCache,this[Ys]=Number(e.headers["content-length"])||void 0,this[Ll]=e,e.once("end",()=>{this[Ys]=this[Ks],this.emit("downloadProgress",this.downloadProgress)}),e.once("error",a=>{e.destroy(),this._beforeError(new wa(a,this))}),e.once("aborted",()=>{this._beforeError(new wa({name:"Error",message:"The server aborted pending request",code:"ECONNRESET"},this))}),this.emit("downloadProgress",this.downloadProgress);let o=e.headers["set-cookie"];if(K.default.object(r.cookieJar)&&o){let a=o.map(async u=>r.cookieJar.setCookie(u,n.toString()));r.ignoreInvalidCookies&&(a=a.map(async u=>u.catch(()=>{})));try{await Promise.all(a)}catch(u){this._beforeError(u);return}}if(r.followRedirect&&e.headers.location&&jq.has(i)){if(e.resume(),this[nt]&&(this[my](),delete this[nt],this[CR]()),(i===303&&r.method!=="GET"&&r.method!=="HEAD"||!r.methodRewriting)&&(r.method="GET","body"in r&&delete r.body,"json"in r&&delete r.json,"form"in r&&delete r.form,this[Ln]=void 0,delete r.headers["content-length"]),this.redirects.length>=r.maxRedirects){this._beforeError(new Bl(this));return}try{let h=function(f){return f.protocol==="unix:"||f.hostname==="unix"},u=Buffer.from(e.headers.location,"binary").toString(),c=new Pn.URL(u,n),l=c.toString();if(decodeURI(l),!h(n)&&h(c)){this._beforeError(new Ue("Cannot redirect to UNIX socket",{},this));return}c.hostname!==n.hostname||c.port!==n.port?("host"in r.headers&&delete r.headers.host,"cookie"in r.headers&&delete r.headers.cookie,"authorization"in r.headers&&delete r.headers.authorization,(r.username||r.password)&&(r.username="",r.password="")):(c.username=r.username,c.password=r.password),this.redirects.push(l),r.url=c;for(let f of r.hooks.beforeRedirect)await f(r,s);this.emit("redirect",s,r),await this._makeRequest()}catch(u){this._beforeError(u);return}return}if(r.isStream&&r.throwHttpErrors&&!Fq.isResponseOk(s)){this._beforeError(new Nl(s));return}e.on("readable",()=>{this[Il]&&this._read()}),this.on("resume",()=>{e.resume()}),this.on("pause",()=>{e.pause()}),e.once("end",()=>{this.push(null)}),this.emit("response",e);for(let a of this[Pl])if(!a.headersSent){for(let u in e.headers){let c=r.decompress?u!=="content-encoding":!0,l=e.headers[u];c&&a.setHeader(u,l)}a.statusCode=i}}async _onResponse(e){try{await this._onResponseBase(e)}catch(r){this._beforeError(r)}}_onRequest(e){let{options:r}=this,{timeout:n,url:i}=r;wq.default(e),this[my]=SR.default(e,n,i);let s=r.cache?"cacheableResponse":"response";e.once(s,u=>{this._onResponse(u)}),e.once("error",u=>{var c;e.destroy(),(c=e.res)===null||c===void 0||c.removeAllListeners("end"),u=u instanceof SR.TimeoutError?new ql(u,this.timings,this):new Ue(u.message,u,this),this._beforeError(u)}),this[CR]=Rq.default(e,this,Uq),this[nt]=e,this.emit("uploadProgress",this.uploadProgress);let o=this[Ln],a=this.redirects.length===0?this:e;K.default.nodeStream(o)?(o.pipe(a),o.once("error",u=>{this._beforeError(new jl(u,this))})):(this._unlockWrite(),K.default.undefined(o)?(this._cannotHaveBody||this._noPipe)&&(a.end(),this._lockWrite()):(this._writeRequest(o,void 0,()=>{}),a.end(),this._lockWrite())),this.emit("request",e)}async _createCacheableRequest(e,r){return new Promise((n,i)=>{Object.assign(r,kq.default(e)),delete r.url;let s,o=yy.get(r.cache)(r,async a=>{a._readableState.autoDestroy=!1,s&&(await s).emit("cacheableResponse",a),n(a)});r.url=e,o.once("error",i),o.once("request",async a=>{s=a,n(s)})})}async _makeRequest(){var e,r,n,i,s;let{options:o}=this,{headers:a}=o;for(let E in a)if(K.default.undefined(a[E]))delete a[E];else if(K.default.null_(a[E]))throw new TypeError(`Use \`undefined\` instead of \`null\` to delete the \`${E}\` header`);if(o.decompress&&K.default.undefined(a["accept-encoding"])&&(a["accept-encoding"]=Lq?"gzip, deflate, br":"gzip, deflate"),o.cookieJar){let E=await o.cookieJar.getCookieString(o.url.toString());K.default.nonEmptyString(E)&&(o.headers.cookie=E)}for(let E of o.hooks.beforeRequest){let R=await E(o);if(!K.default.undefined(R)){o.request=()=>R;break}}o.body&&this[Ln]!==o.body&&(this[Ln]=o.body);let{agent:u,request:c,timeout:l,url:h}=o;if(o.dnsCache&&!("lookup"in o)&&(o.lookup=o.dnsCache.lookup),h.hostname==="unix"){let E=/(?<socketPath>.+?):(?<path>.+)/.exec(`${h.pathname}${h.search}`);if(E!=null&&E.groups){let{socketPath:R,path:P}=E.groups;Object.assign(o,{socketPath:R,path:P,host:""})}}let f=h.protocol==="https:",d;o.http2?d=Aq.auto:d=f?Eq.request:ER.request;let m=(e=o.request)!==null&&e!==void 0?e:d,y=o.cache?this._createCacheableRequest:m;u&&!o.http2&&(o.agent=u[f?"https":"http"]),o[nt]=m,delete o.request,delete o.timeout;let p=o;if(p.shared=(r=o.cacheOptions)===null||r===void 0?void 0:r.shared,p.cacheHeuristic=(n=o.cacheOptions)===null||n===void 0?void 0:n.cacheHeuristic,p.immutableMinTimeToLive=(i=o.cacheOptions)===null||i===void 0?void 0:i.immutableMinTimeToLive,p.ignoreCargoCult=(s=o.cacheOptions)===null||s===void 0?void 0:s.ignoreCargoCult,o.dnsLookupIpVersion!==void 0)try{p.family=DR.dnsLookupIpVersionToFamily(o.dnsLookupIpVersion)}catch{throw new Error("Invalid `dnsLookupIpVersion` option value")}o.https&&("rejectUnauthorized"in o.https&&(p.rejectUnauthorized=o.https.rejectUnauthorized),o.https.checkServerIdentity&&(p.checkServerIdentity=o.https.checkServerIdentity),o.https.certificateAuthority&&(p.ca=o.https.certificateAuthority),o.https.certificate&&(p.cert=o.https.certificate),o.https.key&&(p.key=o.https.key),o.https.passphrase&&(p.passphrase=o.https.passphrase),o.https.pfx&&(p.pfx=o.https.pfx));try{let E=await y(h,p);K.default.undefined(E)&&(E=d(h,p)),o.request=c,o.timeout=l,o.agent=u,o.https&&("rejectUnauthorized"in o.https&&delete p.rejectUnauthorized,o.https.checkServerIdentity&&delete p.checkServerIdentity,o.https.certificateAuthority&&delete p.ca,o.https.certificate&&delete p.cert,o.https.key&&delete p.key,o.https.passphrase&&delete p.passphrase,o.https.pfx&&delete p.pfx),Nq(E)?this._onRequest(E):this.writable?(this.once("finish",()=>{this._onResponse(E)}),this._unlockWrite(),this.end(),this._lockWrite()):this._onResponse(E)}catch(E){throw E instanceof wR.CacheError?new Ml(E,this):new Ue(E.message,E,this)}}async _error(e){try{for(let r of this.options.hooks.beforeError)e=await r(e)}catch(r){e=new Ue(r.message,r,this)}this.destroy(e)}_beforeError(e){if(this[Xs])return;let{options:r}=this,n=this.retryCount+1;this[Xs]=!0,e instanceof Ue||(e=new Ue(e.message,e,this));let i=e,{response:s}=i;(async()=>{if(s&&!s.body){s.setEncoding(this._readableState.encoding);try{s.rawBody=await Oq.default(s),s.body=s.rawBody.toString()}catch{}}if(this.listenerCount("retry")!==0){let o;try{let a;s&&"retry-after"in s.headers&&(a=Number(s.headers["retry-after"]),Number.isNaN(a)?(a=Date.parse(s.headers["retry-after"])-Date.now(),a<=0&&(a=1)):a*=1e3),o=await r.retry.calculateDelay({attemptCount:n,retryOptions:r.retry,error:i,retryAfter:a,computedValue:Iq.default({attemptCount:n,retryOptions:r.retry,error:i,retryAfter:a,computedValue:0})})}catch(a){this._error(new Ue(a.message,a,this));return}if(o){let a=async()=>{try{for(let u of this.options.hooks.beforeRetry)await u(this.options,i,n)}catch(u){this._error(new Ue(u.message,e,this));return}this.destroyed||(this.destroy(),this.emit("retry",n,e))};this[OR]=setTimeout(a,o);return}}this._error(i)})()}_read(){this[Il]=!0;let e=this[Ll];if(e&&!this[Xs]){e.readableLength&&(this[Il]=!1);let r;for(;(r=e.read())!==null;){this[Ks]+=r.length,this[kR]=!0;let n=this.downloadProgress;n.percent<1&&this.emit("downloadProgress",n),this.push(r)}}}_write(e,r,n){let i=()=>{this._writeRequest(e,r,n)};this.requestInitialized?i():this[Ea].push(i)}_writeRequest(e,r,n){this[nt].destroyed||(this._progressCallbacks.push(()=>{this[Js]+=Buffer.byteLength(e,r);let i=this.uploadProgress;i.percent<1&&this.emit("uploadProgress",i)}),this[nt].write(e,r,i=>{!i&&this._progressCallbacks.length>0&&this._progressCallbacks.shift()(),n(i)}))}_final(e){let r=()=>{for(;this._progressCallbacks.length!==0;)this._progressCallbacks.shift()();if(!(nt in this)){e();return}if(this[nt].destroyed){e();return}this[nt].end(n=>{n||(this[Zs]=this[Js],this.emit("uploadProgress",this.uploadProgress),this[nt].emit("upload-complete")),e(n)})};this.requestInitialized?r():this[Ea].push(r)}_destroy(e,r){var n;this[Xs]=!0,clearTimeout(this[OR]),nt in this&&(this[my](),!((n=this[Ll])===null||n===void 0)&&n.complete||this[nt].destroy()),e!==null&&!K.default.undefined(e)&&!(e instanceof Ue)&&(e=new Ue(e.message,e,this)),r(e)}get _isAboutToError(){return this[Xs]}get ip(){var e;return(e=this.socket)===null||e===void 0?void 0:e.remoteAddress}get aborted(){var e,r,n;return((r=(e=this[nt])===null||e===void 0?void 0:e.destroyed)!==null&&r!==void 0?r:this.destroyed)&&!(!((n=this[TR])===null||n===void 0)&&n.complete)}get socket(){var e,r;return(r=(e=this[nt])===null||e===void 0?void 0:e.socket)!==null&&r!==void 0?r:void 0}get downloadProgress(){let e;return this[Ys]?e=this[Ks]/this[Ys]:this[Ys]===this[Ks]?e=1:e=0,{percent:e,transferred:this[Ks],total:this[Ys]}}get uploadProgress(){let e;return this[Zs]?e=this[Js]/this[Zs]:this[Zs]===this[Js]?e=1:e=0,{percent:e,transferred:this[Js],total:this[Zs]}}get timings(){var e;return(e=this[nt])===null||e===void 0?void 0:e.timings}get isFromCache(){return this[RR]}pipe(e,r){if(this[kR])throw new Error("Failed to pipe. The response has been emitted already.");return e instanceof dy.ServerResponse&&this[Pl].add(e),super.pipe(e,r)}unpipe(e){return e instanceof dy.ServerResponse&&this[Pl].delete(e),super.unpipe(e),this}};ke.default=Hl});var Sa=A(ur=>{"use strict";var Hq=ur&&ur.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),$q=ur&&ur.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Hq(e,t,r)};Object.defineProperty(ur,"__esModule",{value:!0});ur.CancelError=ur.ParseError=void 0;var FR=xa(),gy=class extends FR.RequestError{constructor(e,r){let{options:n}=r.request;super(`${e.message} in "${n.url.toString()}"`,e,r.request),this.name="ParseError",this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_BODY_PARSE_FAILURE":this.code}};ur.ParseError=gy;var _y=class extends FR.RequestError{constructor(e){super("Promise was canceled",{},e),this.name="CancelError",this.code="ERR_CANCELED"}get isCanceled(){return!0}};ur.CancelError=_y;$q(xa(),ur)});var IR=A(by=>{"use strict";Object.defineProperty(by,"__esModule",{value:!0});var PR=Sa(),Gq=(t,e,r,n)=>{let{rawBody:i}=t;try{if(e==="text")return i.toString(n);if(e==="json")return i.length===0?"":r(i.toString());if(e==="buffer")return i;throw new PR.ParseError({message:`Unknown body type '${e}'`,name:"Error"},t)}catch(s){throw new PR.ParseError(s,t)}};by.default=Gq});var vy=A(Bn=>{"use strict";var zq=Bn&&Bn.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Vq=Bn&&Bn.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&zq(e,t,r)};Object.defineProperty(Bn,"__esModule",{value:!0});var Wq=require("events"),Yq=en(),Kq=FC(),$l=Sa(),LR=IR(),BR=xa(),Zq=ry(),Jq=cy(),NR=ly(),Xq=["request","response","redirect","uploadProgress","downloadProgress"];function MR(t){let e,r,n=new Wq.EventEmitter,i=new Kq((o,a,u)=>{let c=l=>{let h=new BR.default(void 0,t);h.retryCount=l,h._noPipe=!0,u(()=>h.destroy()),u.shouldReject=!1,u(()=>a(new $l.CancelError(h))),e=h,h.once("response",async m=>{var y;if(m.retryCount=l,m.request.aborted)return;let p;try{p=await Jq.default(h),m.rawBody=p}catch{return}if(h._isAboutToError)return;let E=((y=m.headers["content-encoding"])!==null&&y!==void 0?y:"").toLowerCase(),R=["gzip","deflate","br"].includes(E),{options:P}=h;if(R&&!P.decompress)m.body=p;else try{m.body=LR.default(m,P.responseType,P.parseJson,P.encoding)}catch(I){if(m.body=p.toString(),NR.isResponseOk(m)){h._beforeError(I);return}}try{for(let[I,T]of P.hooks.afterResponse.entries())m=await T(m,async M=>{let x=BR.default.normalizeArguments(void 0,{...M,retry:{calculateDelay:()=>0},throwHttpErrors:!1,resolveBodyOnly:!1},P);x.hooks.afterResponse=x.hooks.afterResponse.slice(0,I);for(let U of x.hooks.beforeRetry)await U(x);let D=MR(x);return u(()=>{D.catch(()=>{}),D.cancel()}),D})}catch(I){h._beforeError(new $l.RequestError(I.message,I,h));return}if(r=m,!NR.isResponseOk(m)){h._beforeError(new $l.HTTPError(m));return}h.destroy(),o(h.options.resolveBodyOnly?m.body:m)});let f=m=>{if(i.isCanceled)return;let{options:y}=h;if(m instanceof $l.HTTPError&&!y.throwHttpErrors){let{response:p}=m;o(h.options.resolveBodyOnly?p.body:p);return}a(m)};h.once("error",f);let d=h.options.body;h.once("retry",(m,y)=>{var p,E;if(d===((p=y.request)===null||p===void 0?void 0:p.options.body)&&Yq.default.nodeStream((E=y.request)===null||E===void 0?void 0:E.options.body)){f(y);return}c(m)}),Zq.default(h,n,Xq)};c(0)});i.on=(o,a)=>(n.on(o,a),i);let s=o=>{let a=(async()=>{await i;let{options:u}=r.request;return LR.default(r,o,u.parseJson,u.encoding)})();return Object.defineProperties(a,Object.getOwnPropertyDescriptors(i)),a};return i.json=()=>{let{headers:o}=e.options;return!e.writableFinished&&o.accept===void 0&&(o.accept="application/json"),s("json")},i.buffer=()=>s("buffer"),i.text=()=>s("text"),i}Bn.default=MR;Vq(Sa(),Bn)});var jR=A(Ey=>{"use strict";Object.defineProperty(Ey,"__esModule",{value:!0});var Qq=Sa();function eU(t,...e){let r=(async()=>{if(t instanceof Qq.RequestError)try{for(let i of e)if(i)for(let s of i)t=await s(t)}catch(i){t=i}throw t})(),n=()=>r;return r.json=n,r.text=n,r.buffer=n,r.on=n,r}Ey.default=eU});var HR=A(wy=>{"use strict";Object.defineProperty(wy,"__esModule",{value:!0});var qR=en();function UR(t){for(let e of Object.values(t))(qR.default.plainObject(e)||qR.default.array(e))&&UR(e);return Object.freeze(t)}wy.default=UR});var GR=A($R=>{"use strict";Object.defineProperty($R,"__esModule",{value:!0})});var xy=A(Xt=>{"use strict";var tU=Xt&&Xt.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),rU=Xt&&Xt.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&tU(e,t,r)};Object.defineProperty(Xt,"__esModule",{value:!0});Xt.defaultHandler=void 0;var zR=en(),Jt=vy(),nU=jR(),zl=xa(),iU=HR(),sU={RequestError:Jt.RequestError,CacheError:Jt.CacheError,ReadError:Jt.ReadError,HTTPError:Jt.HTTPError,MaxRedirectsError:Jt.MaxRedirectsError,TimeoutError:Jt.TimeoutError,ParseError:Jt.ParseError,CancelError:Jt.CancelError,UnsupportedProtocolError:Jt.UnsupportedProtocolError,UploadError:Jt.UploadError},oU=async t=>new Promise(e=>{setTimeout(e,t)}),{normalizeArguments:Gl}=zl.default,VR=(...t)=>{let e;for(let r of t)e=Gl(void 0,r,e);return e},aU=t=>t.isStream?new zl.default(void 0,t):Jt.default(t),uU=t=>"defaults"in t&&"options"in t.defaults,cU=["get","post","put","patch","head","delete"];Xt.defaultHandler=(t,e)=>e(t);var WR=(t,e)=>{if(t)for(let r of t)r(e)},YR=t=>{t._rawHandlers=t.handlers,t.handlers=t.handlers.map(n=>(i,s)=>{let o,a=n(i,u=>(o=s(u),o));if(a!==o&&!i.isStream&&o){let u=a,{then:c,catch:l,finally:h}=u;Object.setPrototypeOf(u,Object.getPrototypeOf(o)),Object.defineProperties(u,Object.getOwnPropertyDescriptors(o)),u.then=c,u.catch=l,u.finally=h}return a});let e=(n,i={},s)=>{var o,a;let u=0,c=l=>t.handlers[u++](l,u===t.handlers.length?aU:c);if(zR.default.plainObject(n)){let l={...n,...i};zl.setNonEnumerableProperties([n,i],l),i=l,n=void 0}try{let l;try{WR(t.options.hooks.init,i),WR((o=i.hooks)===null||o===void 0?void 0:o.init,i)}catch(f){l=f}let h=Gl(n,i,s!=null?s:t.options);if(h[zl.kIsNormalizedAlready]=!0,l)throw new Jt.RequestError(l.message,l,h);return c(h)}catch(l){if(i.isStream)throw l;return nU.default(l,t.options.hooks.beforeError,(a=i.hooks)===null||a===void 0?void 0:a.beforeError)}};e.extend=(...n)=>{let i=[t.options],s=[...t._rawHandlers],o;for(let a of n)uU(a)?(i.push(a.defaults.options),s.push(...a.defaults._rawHandlers),o=a.defaults.mutableDefaults):(i.push(a),"handlers"in a&&s.push(...a.handlers),o=a.mutableDefaults);return s=s.filter(a=>a!==Xt.defaultHandler),s.length===0&&s.push(Xt.defaultHandler),YR({options:VR(...i),handlers:s,mutableDefaults:!!o})};let r=async function*(n,i){let s=Gl(n,i,t.options);s.resolveBodyOnly=!1;let o=s.pagination;if(!zR.default.object(o))throw new TypeError("`options.pagination` must be implemented");let a=[],{countLimit:u}=o,c=0;for(;c<o.requestLimit;){c!==0&&await oU(o.backoff);let l=await e(void 0,void 0,s),h=await o.transform(l),f=[];for(let m of h)if(o.filter(m,a,f)&&(!o.shouldContinue(m,a,f)||(yield m,o.stackAllItems&&a.push(m),f.push(m),--u<=0)))return;let d=o.paginate(l,a,f);if(d===!1)return;d===l.request.options?s=l.request.options:d!==void 0&&(s=Gl(void 0,d,s)),c++}};e.paginate=r,e.paginate.all=async(n,i)=>{let s=[];for await(let o of r(n,i))s.push(o);return s},e.paginate.each=r,e.stream=(n,i)=>e(n,{...i,isStream:!0});for(let n of cU)e[n]=(i,s)=>e(i,{...s,method:n}),e.stream[n]=(i,s)=>e(i,{...s,method:n,isStream:!0});return Object.assign(e,sU),Object.defineProperty(e,"defaults",{value:t.mutableDefaults?t:iU.default(t),writable:t.mutableDefaults,configurable:t.mutableDefaults,enumerable:!0}),e.mergeOptions=VR,e};Xt.default=YR;rU(GR(),Xt)});var Ay=A((tn,Vl)=>{"use strict";var lU=tn&&tn.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),KR=tn&&tn.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&lU(e,t,r)};Object.defineProperty(tn,"__esModule",{value:!0});var hU=require("url"),ZR=xy(),fU={options:{method:"GET",retry:{limit:2,methods:["GET","PUT","HEAD","DELETE","OPTIONS","TRACE"],statusCodes:[408,413,429,500,502,503,504,521,522,524],errorCodes:["ETIMEDOUT","ECONNRESET","EADDRINUSE","ECONNREFUSED","EPIPE","ENOTFOUND","ENETUNREACH","EAI_AGAIN"],maxRetryAfter:void 0,calculateDelay:({computedValue:t})=>t},timeout:{},headers:{"user-agent":"got (https://github.com/sindresorhus/got)"},hooks:{init:[],beforeRequest:[],beforeRedirect:[],beforeRetry:[],beforeError:[],afterResponse:[]},cache:void 0,dnsCache:void 0,decompress:!0,throwHttpErrors:!0,followRedirect:!0,isStream:!1,responseType:"text",resolveBodyOnly:!1,maxRedirects:10,prefixUrl:"",methodRewriting:!0,ignoreInvalidCookies:!1,context:{},http2:!1,allowGetBody:!1,https:void 0,pagination:{transform:t=>t.request.options.responseType==="json"?t.body:JSON.parse(t.body),paginate:t=>{if(!Reflect.has(t.headers,"link"))return!1;let e=t.headers.link.split(","),r;for(let n of e){let i=n.split(";");if(i[1].includes("next")){r=i[0].trimStart().trim(),r=r.slice(1,-1);break}}return r?{url:new hU.URL(r)}:!1},filter:()=>!0,shouldContinue:()=>!0,countLimit:1/0,backoff:0,requestLimit:1e4,stackAllItems:!0},parseJson:t=>JSON.parse(t),stringifyJson:t=>JSON.stringify(t),cacheOptions:{}},handlers:[ZR.defaultHandler],mutableDefaults:!1},Sy=ZR.default(fU);tn.default=Sy;Vl.exports=Sy;Vl.exports.default=Sy;Vl.exports.__esModule=!0;KR(xy(),tn);KR(vy(),tn)});var nk=A((SK,rk)=>{function Qt(t,e){typeof e=="boolean"&&(e={forever:e}),this._originalTimeouts=JSON.parse(JSON.stringify(t)),this._timeouts=t,this._options=e||{},this._maxRetryTime=e&&e.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}rk.exports=Qt;Qt.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)};Qt.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null};Qt.prototype.retry=function(t){if(this._timeout&&clearTimeout(this._timeout),!t)return!1;var e=new Date().getTime();if(t&&e-this._operationStart>=this._maxRetryTime)return this._errors.push(t),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(t);var r=this._timeouts.shift();if(r===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),r=this._cachedTimeouts.slice(-1);else return!1;var n=this;return this._timer=setTimeout(function(){n._attempts++,n._operationTimeoutCb&&(n._timeout=setTimeout(function(){n._operationTimeoutCb(n._attempts)},n._operationTimeout),n._options.unref&&n._timeout.unref()),n._fn(n._attempts)},r),this._options.unref&&this._timer.unref(),!0};Qt.prototype.attempt=function(t,e){this._fn=t,e&&(e.timeout&&(this._operationTimeout=e.timeout),e.cb&&(this._operationTimeoutCb=e.cb));var r=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){r._operationTimeoutCb()},r._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};Qt.prototype.try=function(t){console.log("Using RetryOperation.try() is deprecated"),this.attempt(t)};Qt.prototype.start=function(t){console.log("Using RetryOperation.start() is deprecated"),this.attempt(t)};Qt.prototype.start=Qt.prototype.try;Qt.prototype.errors=function(){return this._errors};Qt.prototype.attempts=function(){return this._attempts};Qt.prototype.mainError=function(){if(this._errors.length===0)return null;for(var t={},e=null,r=0,n=0;n<this._errors.length;n++){var i=this._errors[n],s=i.message,o=(t[s]||0)+1;t[s]=o,o>=r&&(e=i,r=o)}return e}});var ik=A(yi=>{var pU=nk();yi.operation=function(t){var e=yi.timeouts(t);return new pU(e,{forever:t&&(t.forever||t.retries===1/0),unref:t&&t.unref,maxRetryTime:t&&t.maxRetryTime})};yi.timeouts=function(t){if(t instanceof Array)return[].concat(t);var e={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var r in t)e[r]=t[r];if(e.minTimeout>e.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var n=[],i=0;i<e.retries;i++)n.push(this.createTimeout(i,e));return t&&t.forever&&!n.length&&n.push(this.createTimeout(i,e)),n.sort(function(s,o){return s-o}),n};yi.createTimeout=function(t,e){var r=e.randomize?Math.random()+1:1,n=Math.round(r*Math.max(e.minTimeout,1)*Math.pow(e.factor,t));return n=Math.min(n,e.maxTimeout),n};yi.wrap=function(t,e,r){if(e instanceof Array&&(r=e,e=null),!r){r=[];for(var n in t)typeof t[n]=="function"&&r.push(n)}for(var i=0;i<r.length;i++){var s=r[i],o=t[s];t[s]=function(u){var c=yi.operation(e),l=Array.prototype.slice.call(arguments,1),h=l.pop();l.push(function(f){c.retry(f)||(f&&(arguments[0]=c.mainError()),h.apply(this,arguments))}),c.attempt(function(){u.apply(t,l)})}.bind(t,o),t[s].options=e}}});var ok=A((DK,sk)=>{sk.exports=ik()});var uk=A((CK,ak)=>{var mU=ok();function yU(t,e){function r(n,i){var s=e||{},o;"randomize"in s||(s.randomize=!0),o=mU.operation(s);function a(l){i(l||new Error("Aborted"))}function u(l,h){if(l.bail){a(l);return}o.retry(l)?s.onRetry&&s.onRetry(l,h):i(o.mainError())}function c(l){var h;try{h=t(a,l)}catch(f){u(f,l);return}Promise.resolve(h).then(n).catch(function(d){u(d,l)})}o.attempt(c)}return new Promise(r)}ak.exports=yU});var Sk=A(Or=>{"use strict";Object.defineProperty(Or,"__esModule",{value:!0});function y7(t){return t&&t.__esModule?t:{default:t}}var vk=Object.defineProperty,_k=Object.getOwnPropertySymbols,g7=Object.prototype.hasOwnProperty,_7=Object.prototype.propertyIsEnumerable,bk=(t,e,r)=>e in t?vk(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,b7=(t,e)=>{for(var r in e||(e={}))g7.call(e,r)&&bk(t,r,e[r]);if(_k)for(var r of _k(e))_7.call(e,r)&&bk(t,r,e[r]);return t},v7=(t,e)=>{for(var r in e)vk(t,r,{get:e[r],enumerable:!0})},E7=(t,e,r)=>new Promise((n,i)=>{var s=u=>{try{a(r.next(u))}catch(c){i(c)}},o=u=>{try{a(r.throw(u))}catch(c){i(c)}},a=u=>u.done?n(u.value):Promise.resolve(u.value).then(s,o);a((r=r.apply(t,e)).next())}),Ek={};v7(Ek,{configDir:()=>xk,darwinConfig:()=>Hy,getPathForPlatform:()=>Gy,getPlatform:()=>Uy,linuxConfig:()=>th,winConfig:()=>$y});var w7=require("fs/promises"),x7=require("path"),wk=y7(x7);function Uy(){return process.platform}function th(){if(process.env.XDG_CONFIG_HOME!==void 0)return process.env.XDG_CONFIG_HOME;if(process.env.HOME!==void 0)return wk.default.join(process.env.HOME,".config")}function Hy(){if(process.env.HOME!==void 0)return wk.default.join(process.env.HOME,"/Library/Application Support")}function $y(){return process.env.APPDATA}function Gy({platform:t}){switch(t){case"linux":return th();case"darwin":return Hy();case"win32":return $y();default:return th()}}function xk(){return E7(this,arguments,function*(t={}){var e;let r=(e=t.platform)!=null?e:Uy(),n=Gy({platform:r});if(n!==void 0){if(t.validate===!1)return n;try{return yield w7.stat.call(void 0,n),n}catch{return}}})}Or.__spreadValues=b7;Or.getPlatform=Uy;Or.linuxConfig=th;Or.darwinConfig=Hy;Or.winConfig=$y;Or.getPathForPlatform=Gy;Or.configDir=xk;Or.config_dir_exports=Ek});var Ak=A(zy=>{"use strict";Object.defineProperty(zy,"__esModule",{value:!0});var S7=Sk();zy.configDir=S7.configDir});var Ok=A((lZ,L7)=>{L7.exports=[{name:"Agola CI",constant:"AGOLA",env:"AGOLA_GIT_REF",pr:"AGOLA_PULL_REQUEST_ID"},{name:"Appcircle",constant:"APPCIRCLE",env:"AC_APPCIRCLE"},{name:"AppVeyor",constant:"APPVEYOR",env:"APPVEYOR",pr:"APPVEYOR_PULL_REQUEST_NUMBER"},{name:"AWS CodeBuild",constant:"CODEBUILD",env:"CODEBUILD_BUILD_ARN"},{name:"Azure Pipelines",constant:"AZURE_PIPELINES",env:"TF_BUILD",pr:{BUILD_REASON:"PullRequest"}},{name:"Bamboo",constant:"BAMBOO",env:"bamboo_planKey"},{name:"Bitbucket Pipelines",constant:"BITBUCKET",env:"BITBUCKET_COMMIT",pr:"BITBUCKET_PR_ID"},{name:"Bitrise",constant:"BITRISE",env:"BITRISE_IO",pr:"BITRISE_PULL_REQUEST"},{name:"Buddy",constant:"BUDDY",env:"BUDDY_WORKSPACE_ID",pr:"BUDDY_EXECUTION_PULL_REQUEST_ID"},{name:"Buildkite",constant:"BUILDKITE",env:"BUILDKITE",pr:{env:"BUILDKITE_PULL_REQUEST",ne:"false"}},{name:"CircleCI",constant:"CIRCLE",env:"CIRCLECI",pr:"CIRCLE_PULL_REQUEST"},{name:"Cirrus CI",constant:"CIRRUS",env:"CIRRUS_CI",pr:"CIRRUS_PR"},{name:"Codefresh",constant:"CODEFRESH",env:"CF_BUILD_ID",pr:{any:["CF_PULL_REQUEST_NUMBER","CF_PULL_REQUEST_ID"]}},{name:"Codemagic",constant:"CODEMAGIC",env:"CM_BUILD_ID",pr:"CM_PULL_REQUEST"},{name:"Codeship",constant:"CODESHIP",env:{CI_NAME:"codeship"}},{name:"Drone",constant:"DRONE",env:"DRONE",pr:{DRONE_BUILD_EVENT:"pull_request"}},{name:"dsari",constant:"DSARI",env:"DSARI"},{name:"Earthly",constant:"EARTHLY",env:"EARTHLY_CI"},{name:"Expo Application Services",constant:"EAS",env:"EAS_BUILD"},{name:"Gerrit",constant:"GERRIT",env:"GERRIT_PROJECT"},{name:"Gitea Actions",constant:"GITEA_ACTIONS",env:"GITEA_ACTIONS"},{name:"GitHub Actions",constant:"GITHUB_ACTIONS",env:"GITHUB_ACTIONS",pr:{GITHUB_EVENT_NAME:"pull_request"}},{name:"GitLab CI",constant:"GITLAB",env:"GITLAB_CI",pr:"CI_MERGE_REQUEST_ID"},{name:"GoCD",constant:"GOCD",env:"GO_PIPELINE_LABEL"},{name:"Google Cloud Build",constant:"GOOGLE_CLOUD_BUILD",env:"BUILDER_OUTPUT"},{name:"Harness CI",constant:"HARNESS",env:"HARNESS_BUILD_ID"},{name:"Heroku",constant:"HEROKU",env:{env:"NODE",includes:"/app/.heroku/node/bin/node"}},{name:"Hudson",constant:"HUDSON",env:"HUDSON_URL"},{name:"Jenkins",constant:"JENKINS",env:["JENKINS_URL","BUILD_ID"],pr:{any:["ghprbPullId","CHANGE_ID"]}},{name:"LayerCI",constant:"LAYERCI",env:"LAYERCI",pr:"LAYERCI_PULL_REQUEST"},{name:"Magnum CI",constant:"MAGNUM",env:"MAGNUM"},{name:"Netlify CI",constant:"NETLIFY",env:"NETLIFY",pr:{env:"PULL_REQUEST",ne:"false"}},{name:"Nevercode",constant:"NEVERCODE",env:"NEVERCODE",pr:{env:"NEVERCODE_PULL_REQUEST",ne:"false"}},{name:"Prow",constant:"PROW",env:"PROW_JOB_ID"},{name:"ReleaseHub",constant:"RELEASEHUB",env:"RELEASE_BUILD_ID"},{name:"Render",constant:"RENDER",env:"RENDER",pr:{IS_PULL_REQUEST:"true"}},{name:"Sail CI",constant:"SAIL",env:"SAILCI",pr:"SAIL_PULL_REQUEST_NUMBER"},{name:"Screwdriver",constant:"SCREWDRIVER",env:"SCREWDRIVER",pr:{env:"SD_PULL_REQUEST",ne:"false"}},{name:"Semaphore",constant:"SEMAPHORE",env:"SEMAPHORE",pr:"PULL_REQUEST_NUMBER"},{name:"Sourcehut",constant:"SOURCEHUT",env:{CI_NAME:"sourcehut"}},{name:"Strider CD",constant:"STRIDER",env:"STRIDER"},{name:"TaskCluster",constant:"TASKCLUSTER",env:["TASK_ID","RUN_ID"]},{name:"TeamCity",constant:"TEAMCITY",env:"TEAMCITY_VERSION"},{name:"Travis CI",constant:"TRAVIS",env:"TRAVIS",pr:{env:"TRAVIS_PULL_REQUEST",ne:"false"}},{name:"Vela",constant:"VELA",env:"VELA",pr:{VELA_PULL_REQUEST:"1"}},{name:"Vercel",constant:"VERCEL",env:{any:["NOW_BUILDER","VERCEL"]},pr:"VERCEL_GIT_PULL_REQUEST_ID"},{name:"Visual Studio App Center",constant:"APPCENTER",env:"APPCENTER_BUILD_ID"},{name:"Woodpecker",constant:"WOODPECKER",env:{CI:"woodpecker"},pr:{CI_BUILD_EVENT:"pull_request"}},{name:"Xcode Cloud",constant:"XCODE_CLOUD",env:"CI_XCODE_PROJECT",pr:"CI_PULL_REQUEST_NUMBER"},{name:"Xcode Server",constant:"XCODE_SERVER",env:"XCS"}]});var Ik=A(jt=>{"use strict";var Pk=Ok(),Ye=process.env;Object.defineProperty(jt,"_vendors",{value:Pk.map(function(t){return t.constant})});jt.name=null;jt.isPR=null;Pk.forEach(function(t){let r=(Array.isArray(t.env)?t.env:[t.env]).every(function(n){return Fk(n)});if(jt[t.constant]=r,!!r)switch(jt.name=t.name,typeof t.pr){case"string":jt.isPR=!!Ye[t.pr];break;case"object":"env"in t.pr?jt.isPR=t.pr.env in Ye&&Ye[t.pr.env]!==t.pr.ne:"any"in t.pr?jt.isPR=t.pr.any.some(function(n){return!!Ye[n]}):jt.isPR=Fk(t.pr);break;default:jt.isPR=null}});jt.isCI=!!(Ye.CI!=="false"&&(Ye.BUILD_ID||Ye.BUILD_NUMBER||Ye.CI||Ye.CI_APP_ID||Ye.CI_BUILD_ID||Ye.CI_BUILD_NUMBER||Ye.CI_NAME||Ye.CONTINUOUS_INTEGRATION||Ye.RUN_ID||jt.name));function Fk(t){return typeof t=="string"?!!Ye[t]:"env"in t?Ye[t.env]&&Ye[t.env].includes(t.includes):"any"in t?t.any.some(function(e){return!!Ye[e]}):Object.keys(t).every(function(e){return Ye[e]===t[e]})}});var rh=A((CZ,H7)=>{H7.exports={name:"create-turbo",version:"2.5.9-canary.5",description:"Create a new Turborepo",homepage:"https://turborepo.com",license:"MIT",repository:{type:"git",url:"https://github.com/vercel/turborepo",directory:"packages/create-turbo"},bugs:{url:"https://github.com/vercel/turborepo/issues"},bin:{"create-turbo":"dist/cli.js"},scripts:{build:"tsup",test:"jest",lint:"eslint src/","check-types":"tsc --noEmit","lint:prettier":"prettier -c . --cache --ignore-path=../../.prettierignore"},dependencies:{commander:"^11.0.0","fs-extra":"^11.1.1",inquirer:"^8.0.0",picocolors:"1.0.1","proxy-agent":"^6.5.0",semver:"^7.3.8","update-check":"^1.5.4"},devDependencies:{"@jest/globals":"^29.7.0","@turbo/eslint-config":"workspace:*","@turbo/telemetry":"workspace:*","@turbo/test-utils":"workspace:*","@turbo/tsconfig":"workspace:*","@turbo/utils":"workspace:*","@turbo/workspaces":"workspace:*","@types/fs-extra":"^9.0.13","@types/inquirer":"^7.3.1","@types/node":"^18.17.2","@types/semver":"^7.3.9",jest:"^29.7.0","ts-jest":"^29.2.5",tsup:"^6.7.0",typescript:"5.5.4"},files:["dist"]}});var ZT=oe(require("http")),JT=oe(require("https")),Sg=oe(require("picocolors")),Ha=require("commander");var mO=oe(Fg());function bh(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function wo(t){return wo=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},wo(t)}function vh(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Eh(t,e){if(e&&(wo(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return vh(t)}function zn(t){return zn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},zn(t)}function Ir(t,e){return Ir=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Ir(t,e)}function wh(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&&Ir(t,e)}function xh(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function Sh(){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 Bi(t,e,r){return Sh()?Bi=Reflect.construct.bind():Bi=function(i,s,o){var a=[null];a.push.apply(a,s);var u=Function.bind.apply(i,a),c=new u;return o&&Ir(c,o.prototype),c},Bi.apply(null,arguments)}function xo(t){var e=typeof Map=="function"?new Map:void 0;return xo=function(n){if(n===null||!xh(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e!="undefined"){if(e.has(n))return e.get(n);e.set(n,i)}function i(){return Bi(n,arguments,zn(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),Ir(i,n)},xo(t)}var Zg=oe(Kg());var yO=oe(require("fs-extra")),bG=function(t){wh(e,t);function e(r){var n;return bh(this,e),n=Eh(this,zn(e).call(this,"No package.json could be found upwards from the directory ".concat(r))),n.directory=r,n}return e}(xo(Error));var gO=oe(require("fs")),_O=oe(require("path"));var I3=oe(require("fs")),L3=oe(require("path"));function f_(t){return typeof t=="undefined"||t===null}function EO(t){return typeof t=="object"&&t!==null}function wO(t){return Array.isArray(t)?t:f_(t)?[]:[t]}function xO(t,e){var r,n,i,s;if(e)for(s=Object.keys(e),r=0,n=s.length;r<n;r+=1)i=s[r],t[i]=e[i];return t}function SO(t,e){var r="",n;for(n=0;n<e;n+=1)r+=t;return r}function AO(t){return t===0&&Number.NEGATIVE_INFINITY===1/t}var DO=f_,CO=EO,RO=wO,kO=SO,TO=AO,OO=xO,Ve={isNothing:DO,isObject:CO,toArray:RO,repeat:kO,isNegativeZero:TO,extend:OO};function d_(t,e){var r="",n=t.reason||"(unknown reason)";return t.mark?(t.mark.name&&(r+='in "'+t.mark.name+'" '),r+="("+(t.mark.line+1)+":"+(t.mark.column+1)+")",!e&&t.mark.snippet&&(r+=`
|
30
|
+
`)}`}}};ke.RequestError=Ue;var Bl=class extends Ue{constructor(e){super(`Redirected ${e.options.maxRedirects} times. Aborting.`,{},e),this.name="MaxRedirectsError",this.code="ERR_TOO_MANY_REDIRECTS"}};ke.MaxRedirectsError=Bl;var Nl=class extends Ue{constructor(e){super(`Response code ${e.statusCode} (${e.statusMessage})`,{},e.request),this.name="HTTPError",this.code="ERR_NON_2XX_3XX_RESPONSE"}};ke.HTTPError=Nl;var Ml=class extends Ue{constructor(e,r){super(e.message,e,r),this.name="CacheError",this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_CACHE_ACCESS":this.code}};ke.CacheError=Ml;var jl=class extends Ue{constructor(e,r){super(e.message,e,r),this.name="UploadError",this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_UPLOAD":this.code}};ke.UploadError=jl;var ql=class extends Ue{constructor(e,r,n){super(e.message,e,n),this.name="TimeoutError",this.event=e.event,this.timings=r}};ke.TimeoutError=ql;var wa=class extends Ue{constructor(e,r){super(e.message,e,r),this.name="ReadError",this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_READING_RESPONSE_STREAM":this.code}};ke.ReadError=wa;var Ul=class extends Ue{constructor(e){super(`Unsupported protocol "${e.url.protocol}"`,{},e),this.name="UnsupportedProtocolError",this.code="ERR_UNSUPPORTED_PROTOCOL"}};ke.UnsupportedProtocolError=Ul;var Uq=["socket","connect","continue","information","upgrade","timeout"],Hl=class extends vR.Duplex{constructor(e,r={},n){super({autoDestroy:!1,highWaterMark:0}),this[Ks]=0,this[Js]=0,this.requestInitialized=!1,this[Pl]=new Set,this.redirects=[],this[Xs]=!1,this[Il]=!1,this[Ea]=[],this.retryCount=0,this._progressCallbacks=[];let i=()=>this._unlockWrite(),s=()=>this._lockWrite();this.on("pipe",c=>{c.prependListener("data",i),c.on("data",s),c.prependListener("end",i),c.on("end",s)}),this.on("unpipe",c=>{c.off("data",i),c.off("data",s),c.off("end",i),c.off("end",s)}),this.on("pipe",c=>{c instanceof dy.IncomingMessage&&(this.options.headers={...c.headers,...this.options.headers})});let{json:o,body:a,form:u}=r;if((o||a||u)&&this._lockWrite(),ke.kIsNormalizedAlready in r)this.options=r;else try{this.options=this.constructor.normalizeArguments(e,r,n)}catch(c){K.default.nodeStream(r.body)&&r.body.destroy(),this.destroy(c);return}(async()=>{var c;try{this.options.body instanceof vq.ReadStream&&await Mq(this.options.body);let{url:l}=this.options;if(!l)throw new TypeError("Missing `url` property");if(this.requestUrl=l.toString(),decodeURI(this.requestUrl),await this._finalizeBody(),await this._makeRequest(),this.destroyed){(c=this[nt])===null||c===void 0||c.destroy();return}for(let h of this[Ea])h();this[Ea].length=0,this.requestInitialized=!0}catch(l){if(l instanceof Ue){this._beforeError(l);return}this.destroyed||this.destroy(l)}})()}static normalizeArguments(e,r,n){var i,s,o,a,u;let c=r;if(K.default.object(e)&&!K.default.urlInstance(e))r={...n,...e,...r};else{if(e&&r&&r.url!==void 0)throw new TypeError("The `url` option is mutually exclusive with the `input` argument");r={...n,...r},e!==void 0&&(r.url=e),K.default.urlInstance(r.url)&&(r.url=new Pn.URL(r.url.toString()))}if(r.cache===!1&&(r.cache=void 0),r.dnsCache===!1&&(r.dnsCache=void 0),K.assert.any([K.default.string,K.default.undefined],r.method),K.assert.any([K.default.object,K.default.undefined],r.headers),K.assert.any([K.default.string,K.default.urlInstance,K.default.undefined],r.prefixUrl),K.assert.any([K.default.object,K.default.undefined],r.cookieJar),K.assert.any([K.default.object,K.default.string,K.default.undefined],r.searchParams),K.assert.any([K.default.object,K.default.string,K.default.undefined],r.cache),K.assert.any([K.default.object,K.default.number,K.default.undefined],r.timeout),K.assert.any([K.default.object,K.default.undefined],r.context),K.assert.any([K.default.object,K.default.undefined],r.hooks),K.assert.any([K.default.boolean,K.default.undefined],r.decompress),K.assert.any([K.default.boolean,K.default.undefined],r.ignoreInvalidCookies),K.assert.any([K.default.boolean,K.default.undefined],r.followRedirect),K.assert.any([K.default.number,K.default.undefined],r.maxRedirects),K.assert.any([K.default.boolean,K.default.undefined],r.throwHttpErrors),K.assert.any([K.default.boolean,K.default.undefined],r.http2),K.assert.any([K.default.boolean,K.default.undefined],r.allowGetBody),K.assert.any([K.default.string,K.default.undefined],r.localAddress),K.assert.any([DR.isDnsLookupIpVersion,K.default.undefined],r.dnsLookupIpVersion),K.assert.any([K.default.object,K.default.undefined],r.https),K.assert.any([K.default.boolean,K.default.undefined],r.rejectUnauthorized),r.https&&(K.assert.any([K.default.boolean,K.default.undefined],r.https.rejectUnauthorized),K.assert.any([K.default.function_,K.default.undefined],r.https.checkServerIdentity),K.assert.any([K.default.string,K.default.object,K.default.array,K.default.undefined],r.https.certificateAuthority),K.assert.any([K.default.string,K.default.object,K.default.array,K.default.undefined],r.https.key),K.assert.any([K.default.string,K.default.object,K.default.array,K.default.undefined],r.https.certificate),K.assert.any([K.default.string,K.default.undefined],r.https.passphrase),K.assert.any([K.default.string,K.default.buffer,K.default.array,K.default.undefined],r.https.pfx)),K.assert.any([K.default.object,K.default.undefined],r.cacheOptions),K.default.string(r.method)?r.method=r.method.toUpperCase():r.method="GET",r.headers===(n==null?void 0:n.headers)?r.headers={...r.headers}:r.headers=Dq({...n==null?void 0:n.headers,...r.headers}),"slashes"in r)throw new TypeError("The legacy `url.Url` has been deprecated. Use `URL` instead.");if("auth"in r)throw new TypeError("Parameter `auth` is deprecated. Use `username` / `password` instead.");if("searchParams"in r&&r.searchParams&&r.searchParams!==(n==null?void 0:n.searchParams)){let d;if(K.default.string(r.searchParams)||r.searchParams instanceof Pn.URLSearchParams)d=new Pn.URLSearchParams(r.searchParams);else{Bq(r.searchParams),d=new Pn.URLSearchParams;for(let m in r.searchParams){let y=r.searchParams[m];y===null?d.append(m,""):y!==void 0&&d.append(m,y)}}(i=n==null?void 0:n.searchParams)===null||i===void 0||i.forEach((m,y)=>{d.has(y)||d.append(y,m)}),r.searchParams=d}if(r.username=(s=r.username)!==null&&s!==void 0?s:"",r.password=(o=r.password)!==null&&o!==void 0?o:"",K.default.undefined(r.prefixUrl)?r.prefixUrl=(a=n==null?void 0:n.prefixUrl)!==null&&a!==void 0?a:"":(r.prefixUrl=r.prefixUrl.toString(),r.prefixUrl!==""&&!r.prefixUrl.endsWith("/")&&(r.prefixUrl+="/")),K.default.string(r.url)){if(r.url.startsWith("/"))throw new Error("`input` must not start with a slash when using `prefixUrl`");r.url=AR.default(r.prefixUrl+r.url,r)}else(K.default.undefined(r.url)&&r.prefixUrl!==""||r.protocol)&&(r.url=AR.default(r.prefixUrl,r));if(r.url){"port"in r&&delete r.port;let{prefixUrl:d}=r;Object.defineProperty(r,"prefixUrl",{set:y=>{let p=r.url;if(!p.href.startsWith(y))throw new Error(`Cannot change \`prefixUrl\` from ${d} to ${y}: ${p.href}`);r.url=new Pn.URL(y+p.href.slice(d.length)),d=y},get:()=>d});let{protocol:m}=r.url;if(m==="unix:"&&(m="http:",r.url=new Pn.URL(`http://unix${r.url.pathname}${r.url.search}`)),r.searchParams&&(r.url.search=r.searchParams.toString()),m!=="http:"&&m!=="https:")throw new Ul(r);r.username===""?r.username=r.url.username:r.url.username=r.username,r.password===""?r.password=r.url.password:r.url.password=r.password}let{cookieJar:l}=r;if(l){let{setCookie:d,getCookieString:m}=l;K.assert.function_(d),K.assert.function_(m),d.length===4&&m.length===0&&(d=bR.promisify(d.bind(r.cookieJar)),m=bR.promisify(m.bind(r.cookieJar)),r.cookieJar={setCookie:d,getCookieString:m})}let{cache:h}=r;if(h&&(yy.has(h)||yy.set(h,new wR((d,m)=>{let y=d[nt](d,m);return K.default.promise(y)&&(y.once=(p,E)=>{if(p==="error")y.catch(E);else if(p==="abort")(async()=>{try{(await y).once("abort",E)}catch{}})();else throw new Error(`Unknown HTTP2 promise event: ${p}`);return y}),y},h))),r.cacheOptions={...r.cacheOptions},r.dnsCache===!0)py||(py=new xq.default),r.dnsCache=py;else if(!K.default.undefined(r.dnsCache)&&!r.dnsCache.lookup)throw new TypeError(`Parameter \`dnsCache\` must be a CacheableLookup instance or a boolean, got ${K.default(r.dnsCache)}`);K.default.number(r.timeout)?r.timeout={request:r.timeout}:n&&r.timeout!==n.timeout?r.timeout={...n.timeout,...r.timeout}:r.timeout={...r.timeout},r.context||(r.context={});let f=r.hooks===(n==null?void 0:n.hooks);r.hooks={...r.hooks};for(let d of ke.knownHookEvents)if(d in r.hooks)if(K.default.array(r.hooks[d]))r.hooks[d]=[...r.hooks[d]];else throw new TypeError(`Parameter \`${d}\` must be an Array, got ${K.default(r.hooks[d])}`);else r.hooks[d]=[];if(n&&!f)for(let d of ke.knownHookEvents)n.hooks[d].length>0&&(r.hooks[d]=[...n.hooks[d],...r.hooks[d]]);if("family"in r&&In.default('"options.family" was never documented, please use "options.dnsLookupIpVersion"'),n!=null&&n.https&&(r.https={...n.https,...r.https}),"rejectUnauthorized"in r&&In.default('"options.rejectUnauthorized" is now deprecated, please use "options.https.rejectUnauthorized"'),"checkServerIdentity"in r&&In.default('"options.checkServerIdentity" was never documented, please use "options.https.checkServerIdentity"'),"ca"in r&&In.default('"options.ca" was never documented, please use "options.https.certificateAuthority"'),"key"in r&&In.default('"options.key" was never documented, please use "options.https.key"'),"cert"in r&&In.default('"options.cert" was never documented, please use "options.https.certificate"'),"passphrase"in r&&In.default('"options.passphrase" was never documented, please use "options.https.passphrase"'),"pfx"in r&&In.default('"options.pfx" was never documented, please use "options.https.pfx"'),"followRedirects"in r)throw new TypeError("The `followRedirects` option does not exist. Use `followRedirect` instead.");if(r.agent){for(let d in r.agent)if(d!=="http"&&d!=="https"&&d!=="http2")throw new TypeError(`Expected the \`options.agent\` properties to be \`http\`, \`https\` or \`http2\`, got \`${d}\``)}return r.maxRedirects=(u=r.maxRedirects)!==null&&u!==void 0?u:0,ke.setNonEnumerableProperties([n,c],r),Pq.default(r,n)}_lockWrite(){let e=()=>{throw new TypeError("The payload has been already provided")};this.write=e,this.end=e}_unlockWrite(){this.write=super.write,this.end=super.end}async _finalizeBody(){let{options:e}=this,{headers:r}=e,n=!K.default.undefined(e.form),i=!K.default.undefined(e.json),s=!K.default.undefined(e.body),o=n||i||s,a=ke.withoutBody.has(e.method)&&!(e.method==="GET"&&e.allowGetBody);if(this._cannotHaveBody=a,o){if(a)throw new TypeError(`The \`${e.method}\` method cannot be used with a body`);if([s,n,i].filter(u=>u).length>1)throw new TypeError("The `body`, `json` and `form` options are mutually exclusive");if(s&&!(e.body instanceof vR.Readable)&&!K.default.string(e.body)&&!K.default.buffer(e.body)&&!xR.default(e.body))throw new TypeError("The `body` option must be a stream.Readable, string or Buffer");if(n&&!K.default.object(e.form))throw new TypeError("The `form` option must be an Object");{let u=!K.default.string(r["content-type"]);s?(xR.default(e.body)&&u&&(r["content-type"]=`multipart/form-data; boundary=${e.body.getBoundary()}`),this[Ln]=e.body):n?(u&&(r["content-type"]="application/x-www-form-urlencoded"),this[Ln]=new Pn.URLSearchParams(e.form).toString()):(u&&(r["content-type"]="application/json"),this[Ln]=e.stringifyJson(e.json));let c=await Cq.default(this[Ln],e.headers);K.default.undefined(r["content-length"])&&K.default.undefined(r["transfer-encoding"])&&!a&&!K.default.undefined(c)&&(r["content-length"]=String(c))}}else a?this._lockWrite():this._unlockWrite();this[Zs]=Number(r["content-length"])||void 0}async _onResponseBase(e){let{options:r}=this,{url:n}=r;this[TR]=e,r.decompress&&(e=Sq(e));let i=e.statusCode,s=e;s.statusMessage=s.statusMessage?s.statusMessage:ER.STATUS_CODES[i],s.url=r.url.toString(),s.requestUrl=this.requestUrl,s.redirectUrls=this.redirects,s.request=this,s.isFromCache=e.fromCache||!1,s.ip=this.ip,s.retryCount=this.retryCount,this[RR]=s.isFromCache,this[Ys]=Number(e.headers["content-length"])||void 0,this[Ll]=e,e.once("end",()=>{this[Ys]=this[Ks],this.emit("downloadProgress",this.downloadProgress)}),e.once("error",a=>{e.destroy(),this._beforeError(new wa(a,this))}),e.once("aborted",()=>{this._beforeError(new wa({name:"Error",message:"The server aborted pending request",code:"ECONNRESET"},this))}),this.emit("downloadProgress",this.downloadProgress);let o=e.headers["set-cookie"];if(K.default.object(r.cookieJar)&&o){let a=o.map(async u=>r.cookieJar.setCookie(u,n.toString()));r.ignoreInvalidCookies&&(a=a.map(async u=>u.catch(()=>{})));try{await Promise.all(a)}catch(u){this._beforeError(u);return}}if(r.followRedirect&&e.headers.location&&jq.has(i)){if(e.resume(),this[nt]&&(this[my](),delete this[nt],this[CR]()),(i===303&&r.method!=="GET"&&r.method!=="HEAD"||!r.methodRewriting)&&(r.method="GET","body"in r&&delete r.body,"json"in r&&delete r.json,"form"in r&&delete r.form,this[Ln]=void 0,delete r.headers["content-length"]),this.redirects.length>=r.maxRedirects){this._beforeError(new Bl(this));return}try{let h=function(f){return f.protocol==="unix:"||f.hostname==="unix"},u=Buffer.from(e.headers.location,"binary").toString(),c=new Pn.URL(u,n),l=c.toString();if(decodeURI(l),!h(n)&&h(c)){this._beforeError(new Ue("Cannot redirect to UNIX socket",{},this));return}c.hostname!==n.hostname||c.port!==n.port?("host"in r.headers&&delete r.headers.host,"cookie"in r.headers&&delete r.headers.cookie,"authorization"in r.headers&&delete r.headers.authorization,(r.username||r.password)&&(r.username="",r.password="")):(c.username=r.username,c.password=r.password),this.redirects.push(l),r.url=c;for(let f of r.hooks.beforeRedirect)await f(r,s);this.emit("redirect",s,r),await this._makeRequest()}catch(u){this._beforeError(u);return}return}if(r.isStream&&r.throwHttpErrors&&!Fq.isResponseOk(s)){this._beforeError(new Nl(s));return}e.on("readable",()=>{this[Il]&&this._read()}),this.on("resume",()=>{e.resume()}),this.on("pause",()=>{e.pause()}),e.once("end",()=>{this.push(null)}),this.emit("response",e);for(let a of this[Pl])if(!a.headersSent){for(let u in e.headers){let c=r.decompress?u!=="content-encoding":!0,l=e.headers[u];c&&a.setHeader(u,l)}a.statusCode=i}}async _onResponse(e){try{await this._onResponseBase(e)}catch(r){this._beforeError(r)}}_onRequest(e){let{options:r}=this,{timeout:n,url:i}=r;wq.default(e),this[my]=SR.default(e,n,i);let s=r.cache?"cacheableResponse":"response";e.once(s,u=>{this._onResponse(u)}),e.once("error",u=>{var c;e.destroy(),(c=e.res)===null||c===void 0||c.removeAllListeners("end"),u=u instanceof SR.TimeoutError?new ql(u,this.timings,this):new Ue(u.message,u,this),this._beforeError(u)}),this[CR]=Rq.default(e,this,Uq),this[nt]=e,this.emit("uploadProgress",this.uploadProgress);let o=this[Ln],a=this.redirects.length===0?this:e;K.default.nodeStream(o)?(o.pipe(a),o.once("error",u=>{this._beforeError(new jl(u,this))})):(this._unlockWrite(),K.default.undefined(o)?(this._cannotHaveBody||this._noPipe)&&(a.end(),this._lockWrite()):(this._writeRequest(o,void 0,()=>{}),a.end(),this._lockWrite())),this.emit("request",e)}async _createCacheableRequest(e,r){return new Promise((n,i)=>{Object.assign(r,kq.default(e)),delete r.url;let s,o=yy.get(r.cache)(r,async a=>{a._readableState.autoDestroy=!1,s&&(await s).emit("cacheableResponse",a),n(a)});r.url=e,o.once("error",i),o.once("request",async a=>{s=a,n(s)})})}async _makeRequest(){var e,r,n,i,s;let{options:o}=this,{headers:a}=o;for(let E in a)if(K.default.undefined(a[E]))delete a[E];else if(K.default.null_(a[E]))throw new TypeError(`Use \`undefined\` instead of \`null\` to delete the \`${E}\` header`);if(o.decompress&&K.default.undefined(a["accept-encoding"])&&(a["accept-encoding"]=Lq?"gzip, deflate, br":"gzip, deflate"),o.cookieJar){let E=await o.cookieJar.getCookieString(o.url.toString());K.default.nonEmptyString(E)&&(o.headers.cookie=E)}for(let E of o.hooks.beforeRequest){let R=await E(o);if(!K.default.undefined(R)){o.request=()=>R;break}}o.body&&this[Ln]!==o.body&&(this[Ln]=o.body);let{agent:u,request:c,timeout:l,url:h}=o;if(o.dnsCache&&!("lookup"in o)&&(o.lookup=o.dnsCache.lookup),h.hostname==="unix"){let E=/(?<socketPath>.+?):(?<path>.+)/.exec(`${h.pathname}${h.search}`);if(E!=null&&E.groups){let{socketPath:R,path:P}=E.groups;Object.assign(o,{socketPath:R,path:P,host:""})}}let f=h.protocol==="https:",d;o.http2?d=Aq.auto:d=f?Eq.request:ER.request;let m=(e=o.request)!==null&&e!==void 0?e:d,y=o.cache?this._createCacheableRequest:m;u&&!o.http2&&(o.agent=u[f?"https":"http"]),o[nt]=m,delete o.request,delete o.timeout;let p=o;if(p.shared=(r=o.cacheOptions)===null||r===void 0?void 0:r.shared,p.cacheHeuristic=(n=o.cacheOptions)===null||n===void 0?void 0:n.cacheHeuristic,p.immutableMinTimeToLive=(i=o.cacheOptions)===null||i===void 0?void 0:i.immutableMinTimeToLive,p.ignoreCargoCult=(s=o.cacheOptions)===null||s===void 0?void 0:s.ignoreCargoCult,o.dnsLookupIpVersion!==void 0)try{p.family=DR.dnsLookupIpVersionToFamily(o.dnsLookupIpVersion)}catch{throw new Error("Invalid `dnsLookupIpVersion` option value")}o.https&&("rejectUnauthorized"in o.https&&(p.rejectUnauthorized=o.https.rejectUnauthorized),o.https.checkServerIdentity&&(p.checkServerIdentity=o.https.checkServerIdentity),o.https.certificateAuthority&&(p.ca=o.https.certificateAuthority),o.https.certificate&&(p.cert=o.https.certificate),o.https.key&&(p.key=o.https.key),o.https.passphrase&&(p.passphrase=o.https.passphrase),o.https.pfx&&(p.pfx=o.https.pfx));try{let E=await y(h,p);K.default.undefined(E)&&(E=d(h,p)),o.request=c,o.timeout=l,o.agent=u,o.https&&("rejectUnauthorized"in o.https&&delete p.rejectUnauthorized,o.https.checkServerIdentity&&delete p.checkServerIdentity,o.https.certificateAuthority&&delete p.ca,o.https.certificate&&delete p.cert,o.https.key&&delete p.key,o.https.passphrase&&delete p.passphrase,o.https.pfx&&delete p.pfx),Nq(E)?this._onRequest(E):this.writable?(this.once("finish",()=>{this._onResponse(E)}),this._unlockWrite(),this.end(),this._lockWrite()):this._onResponse(E)}catch(E){throw E instanceof wR.CacheError?new Ml(E,this):new Ue(E.message,E,this)}}async _error(e){try{for(let r of this.options.hooks.beforeError)e=await r(e)}catch(r){e=new Ue(r.message,r,this)}this.destroy(e)}_beforeError(e){if(this[Xs])return;let{options:r}=this,n=this.retryCount+1;this[Xs]=!0,e instanceof Ue||(e=new Ue(e.message,e,this));let i=e,{response:s}=i;(async()=>{if(s&&!s.body){s.setEncoding(this._readableState.encoding);try{s.rawBody=await Oq.default(s),s.body=s.rawBody.toString()}catch{}}if(this.listenerCount("retry")!==0){let o;try{let a;s&&"retry-after"in s.headers&&(a=Number(s.headers["retry-after"]),Number.isNaN(a)?(a=Date.parse(s.headers["retry-after"])-Date.now(),a<=0&&(a=1)):a*=1e3),o=await r.retry.calculateDelay({attemptCount:n,retryOptions:r.retry,error:i,retryAfter:a,computedValue:Iq.default({attemptCount:n,retryOptions:r.retry,error:i,retryAfter:a,computedValue:0})})}catch(a){this._error(new Ue(a.message,a,this));return}if(o){let a=async()=>{try{for(let u of this.options.hooks.beforeRetry)await u(this.options,i,n)}catch(u){this._error(new Ue(u.message,e,this));return}this.destroyed||(this.destroy(),this.emit("retry",n,e))};this[OR]=setTimeout(a,o);return}}this._error(i)})()}_read(){this[Il]=!0;let e=this[Ll];if(e&&!this[Xs]){e.readableLength&&(this[Il]=!1);let r;for(;(r=e.read())!==null;){this[Ks]+=r.length,this[kR]=!0;let n=this.downloadProgress;n.percent<1&&this.emit("downloadProgress",n),this.push(r)}}}_write(e,r,n){let i=()=>{this._writeRequest(e,r,n)};this.requestInitialized?i():this[Ea].push(i)}_writeRequest(e,r,n){this[nt].destroyed||(this._progressCallbacks.push(()=>{this[Js]+=Buffer.byteLength(e,r);let i=this.uploadProgress;i.percent<1&&this.emit("uploadProgress",i)}),this[nt].write(e,r,i=>{!i&&this._progressCallbacks.length>0&&this._progressCallbacks.shift()(),n(i)}))}_final(e){let r=()=>{for(;this._progressCallbacks.length!==0;)this._progressCallbacks.shift()();if(!(nt in this)){e();return}if(this[nt].destroyed){e();return}this[nt].end(n=>{n||(this[Zs]=this[Js],this.emit("uploadProgress",this.uploadProgress),this[nt].emit("upload-complete")),e(n)})};this.requestInitialized?r():this[Ea].push(r)}_destroy(e,r){var n;this[Xs]=!0,clearTimeout(this[OR]),nt in this&&(this[my](),!((n=this[Ll])===null||n===void 0)&&n.complete||this[nt].destroy()),e!==null&&!K.default.undefined(e)&&!(e instanceof Ue)&&(e=new Ue(e.message,e,this)),r(e)}get _isAboutToError(){return this[Xs]}get ip(){var e;return(e=this.socket)===null||e===void 0?void 0:e.remoteAddress}get aborted(){var e,r,n;return((r=(e=this[nt])===null||e===void 0?void 0:e.destroyed)!==null&&r!==void 0?r:this.destroyed)&&!(!((n=this[TR])===null||n===void 0)&&n.complete)}get socket(){var e,r;return(r=(e=this[nt])===null||e===void 0?void 0:e.socket)!==null&&r!==void 0?r:void 0}get downloadProgress(){let e;return this[Ys]?e=this[Ks]/this[Ys]:this[Ys]===this[Ks]?e=1:e=0,{percent:e,transferred:this[Ks],total:this[Ys]}}get uploadProgress(){let e;return this[Zs]?e=this[Js]/this[Zs]:this[Zs]===this[Js]?e=1:e=0,{percent:e,transferred:this[Js],total:this[Zs]}}get timings(){var e;return(e=this[nt])===null||e===void 0?void 0:e.timings}get isFromCache(){return this[RR]}pipe(e,r){if(this[kR])throw new Error("Failed to pipe. The response has been emitted already.");return e instanceof dy.ServerResponse&&this[Pl].add(e),super.pipe(e,r)}unpipe(e){return e instanceof dy.ServerResponse&&this[Pl].delete(e),super.unpipe(e),this}};ke.default=Hl});var Sa=A(ur=>{"use strict";var Hq=ur&&ur.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),$q=ur&&ur.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Hq(e,t,r)};Object.defineProperty(ur,"__esModule",{value:!0});ur.CancelError=ur.ParseError=void 0;var FR=xa(),gy=class extends FR.RequestError{constructor(e,r){let{options:n}=r.request;super(`${e.message} in "${n.url.toString()}"`,e,r.request),this.name="ParseError",this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_BODY_PARSE_FAILURE":this.code}};ur.ParseError=gy;var _y=class extends FR.RequestError{constructor(e){super("Promise was canceled",{},e),this.name="CancelError",this.code="ERR_CANCELED"}get isCanceled(){return!0}};ur.CancelError=_y;$q(xa(),ur)});var IR=A(by=>{"use strict";Object.defineProperty(by,"__esModule",{value:!0});var PR=Sa(),Gq=(t,e,r,n)=>{let{rawBody:i}=t;try{if(e==="text")return i.toString(n);if(e==="json")return i.length===0?"":r(i.toString());if(e==="buffer")return i;throw new PR.ParseError({message:`Unknown body type '${e}'`,name:"Error"},t)}catch(s){throw new PR.ParseError(s,t)}};by.default=Gq});var vy=A(Bn=>{"use strict";var zq=Bn&&Bn.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Vq=Bn&&Bn.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&zq(e,t,r)};Object.defineProperty(Bn,"__esModule",{value:!0});var Wq=require("events"),Yq=en(),Kq=FC(),$l=Sa(),LR=IR(),BR=xa(),Zq=ry(),Jq=cy(),NR=ly(),Xq=["request","response","redirect","uploadProgress","downloadProgress"];function MR(t){let e,r,n=new Wq.EventEmitter,i=new Kq((o,a,u)=>{let c=l=>{let h=new BR.default(void 0,t);h.retryCount=l,h._noPipe=!0,u(()=>h.destroy()),u.shouldReject=!1,u(()=>a(new $l.CancelError(h))),e=h,h.once("response",async m=>{var y;if(m.retryCount=l,m.request.aborted)return;let p;try{p=await Jq.default(h),m.rawBody=p}catch{return}if(h._isAboutToError)return;let E=((y=m.headers["content-encoding"])!==null&&y!==void 0?y:"").toLowerCase(),R=["gzip","deflate","br"].includes(E),{options:P}=h;if(R&&!P.decompress)m.body=p;else try{m.body=LR.default(m,P.responseType,P.parseJson,P.encoding)}catch(I){if(m.body=p.toString(),NR.isResponseOk(m)){h._beforeError(I);return}}try{for(let[I,T]of P.hooks.afterResponse.entries())m=await T(m,async M=>{let x=BR.default.normalizeArguments(void 0,{...M,retry:{calculateDelay:()=>0},throwHttpErrors:!1,resolveBodyOnly:!1},P);x.hooks.afterResponse=x.hooks.afterResponse.slice(0,I);for(let U of x.hooks.beforeRetry)await U(x);let D=MR(x);return u(()=>{D.catch(()=>{}),D.cancel()}),D})}catch(I){h._beforeError(new $l.RequestError(I.message,I,h));return}if(r=m,!NR.isResponseOk(m)){h._beforeError(new $l.HTTPError(m));return}h.destroy(),o(h.options.resolveBodyOnly?m.body:m)});let f=m=>{if(i.isCanceled)return;let{options:y}=h;if(m instanceof $l.HTTPError&&!y.throwHttpErrors){let{response:p}=m;o(h.options.resolveBodyOnly?p.body:p);return}a(m)};h.once("error",f);let d=h.options.body;h.once("retry",(m,y)=>{var p,E;if(d===((p=y.request)===null||p===void 0?void 0:p.options.body)&&Yq.default.nodeStream((E=y.request)===null||E===void 0?void 0:E.options.body)){f(y);return}c(m)}),Zq.default(h,n,Xq)};c(0)});i.on=(o,a)=>(n.on(o,a),i);let s=o=>{let a=(async()=>{await i;let{options:u}=r.request;return LR.default(r,o,u.parseJson,u.encoding)})();return Object.defineProperties(a,Object.getOwnPropertyDescriptors(i)),a};return i.json=()=>{let{headers:o}=e.options;return!e.writableFinished&&o.accept===void 0&&(o.accept="application/json"),s("json")},i.buffer=()=>s("buffer"),i.text=()=>s("text"),i}Bn.default=MR;Vq(Sa(),Bn)});var jR=A(Ey=>{"use strict";Object.defineProperty(Ey,"__esModule",{value:!0});var Qq=Sa();function eU(t,...e){let r=(async()=>{if(t instanceof Qq.RequestError)try{for(let i of e)if(i)for(let s of i)t=await s(t)}catch(i){t=i}throw t})(),n=()=>r;return r.json=n,r.text=n,r.buffer=n,r.on=n,r}Ey.default=eU});var HR=A(wy=>{"use strict";Object.defineProperty(wy,"__esModule",{value:!0});var qR=en();function UR(t){for(let e of Object.values(t))(qR.default.plainObject(e)||qR.default.array(e))&&UR(e);return Object.freeze(t)}wy.default=UR});var GR=A($R=>{"use strict";Object.defineProperty($R,"__esModule",{value:!0})});var xy=A(Xt=>{"use strict";var tU=Xt&&Xt.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),rU=Xt&&Xt.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&tU(e,t,r)};Object.defineProperty(Xt,"__esModule",{value:!0});Xt.defaultHandler=void 0;var zR=en(),Jt=vy(),nU=jR(),zl=xa(),iU=HR(),sU={RequestError:Jt.RequestError,CacheError:Jt.CacheError,ReadError:Jt.ReadError,HTTPError:Jt.HTTPError,MaxRedirectsError:Jt.MaxRedirectsError,TimeoutError:Jt.TimeoutError,ParseError:Jt.ParseError,CancelError:Jt.CancelError,UnsupportedProtocolError:Jt.UnsupportedProtocolError,UploadError:Jt.UploadError},oU=async t=>new Promise(e=>{setTimeout(e,t)}),{normalizeArguments:Gl}=zl.default,VR=(...t)=>{let e;for(let r of t)e=Gl(void 0,r,e);return e},aU=t=>t.isStream?new zl.default(void 0,t):Jt.default(t),uU=t=>"defaults"in t&&"options"in t.defaults,cU=["get","post","put","patch","head","delete"];Xt.defaultHandler=(t,e)=>e(t);var WR=(t,e)=>{if(t)for(let r of t)r(e)},YR=t=>{t._rawHandlers=t.handlers,t.handlers=t.handlers.map(n=>(i,s)=>{let o,a=n(i,u=>(o=s(u),o));if(a!==o&&!i.isStream&&o){let u=a,{then:c,catch:l,finally:h}=u;Object.setPrototypeOf(u,Object.getPrototypeOf(o)),Object.defineProperties(u,Object.getOwnPropertyDescriptors(o)),u.then=c,u.catch=l,u.finally=h}return a});let e=(n,i={},s)=>{var o,a;let u=0,c=l=>t.handlers[u++](l,u===t.handlers.length?aU:c);if(zR.default.plainObject(n)){let l={...n,...i};zl.setNonEnumerableProperties([n,i],l),i=l,n=void 0}try{let l;try{WR(t.options.hooks.init,i),WR((o=i.hooks)===null||o===void 0?void 0:o.init,i)}catch(f){l=f}let h=Gl(n,i,s!=null?s:t.options);if(h[zl.kIsNormalizedAlready]=!0,l)throw new Jt.RequestError(l.message,l,h);return c(h)}catch(l){if(i.isStream)throw l;return nU.default(l,t.options.hooks.beforeError,(a=i.hooks)===null||a===void 0?void 0:a.beforeError)}};e.extend=(...n)=>{let i=[t.options],s=[...t._rawHandlers],o;for(let a of n)uU(a)?(i.push(a.defaults.options),s.push(...a.defaults._rawHandlers),o=a.defaults.mutableDefaults):(i.push(a),"handlers"in a&&s.push(...a.handlers),o=a.mutableDefaults);return s=s.filter(a=>a!==Xt.defaultHandler),s.length===0&&s.push(Xt.defaultHandler),YR({options:VR(...i),handlers:s,mutableDefaults:!!o})};let r=async function*(n,i){let s=Gl(n,i,t.options);s.resolveBodyOnly=!1;let o=s.pagination;if(!zR.default.object(o))throw new TypeError("`options.pagination` must be implemented");let a=[],{countLimit:u}=o,c=0;for(;c<o.requestLimit;){c!==0&&await oU(o.backoff);let l=await e(void 0,void 0,s),h=await o.transform(l),f=[];for(let m of h)if(o.filter(m,a,f)&&(!o.shouldContinue(m,a,f)||(yield m,o.stackAllItems&&a.push(m),f.push(m),--u<=0)))return;let d=o.paginate(l,a,f);if(d===!1)return;d===l.request.options?s=l.request.options:d!==void 0&&(s=Gl(void 0,d,s)),c++}};e.paginate=r,e.paginate.all=async(n,i)=>{let s=[];for await(let o of r(n,i))s.push(o);return s},e.paginate.each=r,e.stream=(n,i)=>e(n,{...i,isStream:!0});for(let n of cU)e[n]=(i,s)=>e(i,{...s,method:n}),e.stream[n]=(i,s)=>e(i,{...s,method:n,isStream:!0});return Object.assign(e,sU),Object.defineProperty(e,"defaults",{value:t.mutableDefaults?t:iU.default(t),writable:t.mutableDefaults,configurable:t.mutableDefaults,enumerable:!0}),e.mergeOptions=VR,e};Xt.default=YR;rU(GR(),Xt)});var Ay=A((tn,Vl)=>{"use strict";var lU=tn&&tn.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),KR=tn&&tn.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&lU(e,t,r)};Object.defineProperty(tn,"__esModule",{value:!0});var hU=require("url"),ZR=xy(),fU={options:{method:"GET",retry:{limit:2,methods:["GET","PUT","HEAD","DELETE","OPTIONS","TRACE"],statusCodes:[408,413,429,500,502,503,504,521,522,524],errorCodes:["ETIMEDOUT","ECONNRESET","EADDRINUSE","ECONNREFUSED","EPIPE","ENOTFOUND","ENETUNREACH","EAI_AGAIN"],maxRetryAfter:void 0,calculateDelay:({computedValue:t})=>t},timeout:{},headers:{"user-agent":"got (https://github.com/sindresorhus/got)"},hooks:{init:[],beforeRequest:[],beforeRedirect:[],beforeRetry:[],beforeError:[],afterResponse:[]},cache:void 0,dnsCache:void 0,decompress:!0,throwHttpErrors:!0,followRedirect:!0,isStream:!1,responseType:"text",resolveBodyOnly:!1,maxRedirects:10,prefixUrl:"",methodRewriting:!0,ignoreInvalidCookies:!1,context:{},http2:!1,allowGetBody:!1,https:void 0,pagination:{transform:t=>t.request.options.responseType==="json"?t.body:JSON.parse(t.body),paginate:t=>{if(!Reflect.has(t.headers,"link"))return!1;let e=t.headers.link.split(","),r;for(let n of e){let i=n.split(";");if(i[1].includes("next")){r=i[0].trimStart().trim(),r=r.slice(1,-1);break}}return r?{url:new hU.URL(r)}:!1},filter:()=>!0,shouldContinue:()=>!0,countLimit:1/0,backoff:0,requestLimit:1e4,stackAllItems:!0},parseJson:t=>JSON.parse(t),stringifyJson:t=>JSON.stringify(t),cacheOptions:{}},handlers:[ZR.defaultHandler],mutableDefaults:!1},Sy=ZR.default(fU);tn.default=Sy;Vl.exports=Sy;Vl.exports.default=Sy;Vl.exports.__esModule=!0;KR(xy(),tn);KR(vy(),tn)});var nk=A((SK,rk)=>{function Qt(t,e){typeof e=="boolean"&&(e={forever:e}),this._originalTimeouts=JSON.parse(JSON.stringify(t)),this._timeouts=t,this._options=e||{},this._maxRetryTime=e&&e.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}rk.exports=Qt;Qt.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)};Qt.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null};Qt.prototype.retry=function(t){if(this._timeout&&clearTimeout(this._timeout),!t)return!1;var e=new Date().getTime();if(t&&e-this._operationStart>=this._maxRetryTime)return this._errors.push(t),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(t);var r=this._timeouts.shift();if(r===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),r=this._cachedTimeouts.slice(-1);else return!1;var n=this;return this._timer=setTimeout(function(){n._attempts++,n._operationTimeoutCb&&(n._timeout=setTimeout(function(){n._operationTimeoutCb(n._attempts)},n._operationTimeout),n._options.unref&&n._timeout.unref()),n._fn(n._attempts)},r),this._options.unref&&this._timer.unref(),!0};Qt.prototype.attempt=function(t,e){this._fn=t,e&&(e.timeout&&(this._operationTimeout=e.timeout),e.cb&&(this._operationTimeoutCb=e.cb));var r=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){r._operationTimeoutCb()},r._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};Qt.prototype.try=function(t){console.log("Using RetryOperation.try() is deprecated"),this.attempt(t)};Qt.prototype.start=function(t){console.log("Using RetryOperation.start() is deprecated"),this.attempt(t)};Qt.prototype.start=Qt.prototype.try;Qt.prototype.errors=function(){return this._errors};Qt.prototype.attempts=function(){return this._attempts};Qt.prototype.mainError=function(){if(this._errors.length===0)return null;for(var t={},e=null,r=0,n=0;n<this._errors.length;n++){var i=this._errors[n],s=i.message,o=(t[s]||0)+1;t[s]=o,o>=r&&(e=i,r=o)}return e}});var ik=A(yi=>{var pU=nk();yi.operation=function(t){var e=yi.timeouts(t);return new pU(e,{forever:t&&(t.forever||t.retries===1/0),unref:t&&t.unref,maxRetryTime:t&&t.maxRetryTime})};yi.timeouts=function(t){if(t instanceof Array)return[].concat(t);var e={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var r in t)e[r]=t[r];if(e.minTimeout>e.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var n=[],i=0;i<e.retries;i++)n.push(this.createTimeout(i,e));return t&&t.forever&&!n.length&&n.push(this.createTimeout(i,e)),n.sort(function(s,o){return s-o}),n};yi.createTimeout=function(t,e){var r=e.randomize?Math.random()+1:1,n=Math.round(r*Math.max(e.minTimeout,1)*Math.pow(e.factor,t));return n=Math.min(n,e.maxTimeout),n};yi.wrap=function(t,e,r){if(e instanceof Array&&(r=e,e=null),!r){r=[];for(var n in t)typeof t[n]=="function"&&r.push(n)}for(var i=0;i<r.length;i++){var s=r[i],o=t[s];t[s]=function(u){var c=yi.operation(e),l=Array.prototype.slice.call(arguments,1),h=l.pop();l.push(function(f){c.retry(f)||(f&&(arguments[0]=c.mainError()),h.apply(this,arguments))}),c.attempt(function(){u.apply(t,l)})}.bind(t,o),t[s].options=e}}});var ok=A((DK,sk)=>{sk.exports=ik()});var uk=A((CK,ak)=>{var mU=ok();function yU(t,e){function r(n,i){var s=e||{},o;"randomize"in s||(s.randomize=!0),o=mU.operation(s);function a(l){i(l||new Error("Aborted"))}function u(l,h){if(l.bail){a(l);return}o.retry(l)?s.onRetry&&s.onRetry(l,h):i(o.mainError())}function c(l){var h;try{h=t(a,l)}catch(f){u(f,l);return}Promise.resolve(h).then(n).catch(function(d){u(d,l)})}o.attempt(c)}return new Promise(r)}ak.exports=yU});var Sk=A(Or=>{"use strict";Object.defineProperty(Or,"__esModule",{value:!0});function y7(t){return t&&t.__esModule?t:{default:t}}var vk=Object.defineProperty,_k=Object.getOwnPropertySymbols,g7=Object.prototype.hasOwnProperty,_7=Object.prototype.propertyIsEnumerable,bk=(t,e,r)=>e in t?vk(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,b7=(t,e)=>{for(var r in e||(e={}))g7.call(e,r)&&bk(t,r,e[r]);if(_k)for(var r of _k(e))_7.call(e,r)&&bk(t,r,e[r]);return t},v7=(t,e)=>{for(var r in e)vk(t,r,{get:e[r],enumerable:!0})},E7=(t,e,r)=>new Promise((n,i)=>{var s=u=>{try{a(r.next(u))}catch(c){i(c)}},o=u=>{try{a(r.throw(u))}catch(c){i(c)}},a=u=>u.done?n(u.value):Promise.resolve(u.value).then(s,o);a((r=r.apply(t,e)).next())}),Ek={};v7(Ek,{configDir:()=>xk,darwinConfig:()=>Hy,getPathForPlatform:()=>Gy,getPlatform:()=>Uy,linuxConfig:()=>th,winConfig:()=>$y});var w7=require("fs/promises"),x7=require("path"),wk=y7(x7);function Uy(){return process.platform}function th(){if(process.env.XDG_CONFIG_HOME!==void 0)return process.env.XDG_CONFIG_HOME;if(process.env.HOME!==void 0)return wk.default.join(process.env.HOME,".config")}function Hy(){if(process.env.HOME!==void 0)return wk.default.join(process.env.HOME,"/Library/Application Support")}function $y(){return process.env.APPDATA}function Gy({platform:t}){switch(t){case"linux":return th();case"darwin":return Hy();case"win32":return $y();default:return th()}}function xk(){return E7(this,arguments,function*(t={}){var e;let r=(e=t.platform)!=null?e:Uy(),n=Gy({platform:r});if(n!==void 0){if(t.validate===!1)return n;try{return yield w7.stat.call(void 0,n),n}catch{return}}})}Or.__spreadValues=b7;Or.getPlatform=Uy;Or.linuxConfig=th;Or.darwinConfig=Hy;Or.winConfig=$y;Or.getPathForPlatform=Gy;Or.configDir=xk;Or.config_dir_exports=Ek});var Ak=A(zy=>{"use strict";Object.defineProperty(zy,"__esModule",{value:!0});var S7=Sk();zy.configDir=S7.configDir});var Ok=A((hZ,L7)=>{L7.exports=[{name:"Agola CI",constant:"AGOLA",env:"AGOLA_GIT_REF",pr:"AGOLA_PULL_REQUEST_ID"},{name:"Appcircle",constant:"APPCIRCLE",env:"AC_APPCIRCLE"},{name:"AppVeyor",constant:"APPVEYOR",env:"APPVEYOR",pr:"APPVEYOR_PULL_REQUEST_NUMBER"},{name:"AWS CodeBuild",constant:"CODEBUILD",env:"CODEBUILD_BUILD_ARN"},{name:"Azure Pipelines",constant:"AZURE_PIPELINES",env:"TF_BUILD",pr:{BUILD_REASON:"PullRequest"}},{name:"Bamboo",constant:"BAMBOO",env:"bamboo_planKey"},{name:"Bitbucket Pipelines",constant:"BITBUCKET",env:"BITBUCKET_COMMIT",pr:"BITBUCKET_PR_ID"},{name:"Bitrise",constant:"BITRISE",env:"BITRISE_IO",pr:"BITRISE_PULL_REQUEST"},{name:"Buddy",constant:"BUDDY",env:"BUDDY_WORKSPACE_ID",pr:"BUDDY_EXECUTION_PULL_REQUEST_ID"},{name:"Buildkite",constant:"BUILDKITE",env:"BUILDKITE",pr:{env:"BUILDKITE_PULL_REQUEST",ne:"false"}},{name:"CircleCI",constant:"CIRCLE",env:"CIRCLECI",pr:"CIRCLE_PULL_REQUEST"},{name:"Cirrus CI",constant:"CIRRUS",env:"CIRRUS_CI",pr:"CIRRUS_PR"},{name:"Codefresh",constant:"CODEFRESH",env:"CF_BUILD_ID",pr:{any:["CF_PULL_REQUEST_NUMBER","CF_PULL_REQUEST_ID"]}},{name:"Codemagic",constant:"CODEMAGIC",env:"CM_BUILD_ID",pr:"CM_PULL_REQUEST"},{name:"Codeship",constant:"CODESHIP",env:{CI_NAME:"codeship"}},{name:"Drone",constant:"DRONE",env:"DRONE",pr:{DRONE_BUILD_EVENT:"pull_request"}},{name:"dsari",constant:"DSARI",env:"DSARI"},{name:"Earthly",constant:"EARTHLY",env:"EARTHLY_CI"},{name:"Expo Application Services",constant:"EAS",env:"EAS_BUILD"},{name:"Gerrit",constant:"GERRIT",env:"GERRIT_PROJECT"},{name:"Gitea Actions",constant:"GITEA_ACTIONS",env:"GITEA_ACTIONS"},{name:"GitHub Actions",constant:"GITHUB_ACTIONS",env:"GITHUB_ACTIONS",pr:{GITHUB_EVENT_NAME:"pull_request"}},{name:"GitLab CI",constant:"GITLAB",env:"GITLAB_CI",pr:"CI_MERGE_REQUEST_ID"},{name:"GoCD",constant:"GOCD",env:"GO_PIPELINE_LABEL"},{name:"Google Cloud Build",constant:"GOOGLE_CLOUD_BUILD",env:"BUILDER_OUTPUT"},{name:"Harness CI",constant:"HARNESS",env:"HARNESS_BUILD_ID"},{name:"Heroku",constant:"HEROKU",env:{env:"NODE",includes:"/app/.heroku/node/bin/node"}},{name:"Hudson",constant:"HUDSON",env:"HUDSON_URL"},{name:"Jenkins",constant:"JENKINS",env:["JENKINS_URL","BUILD_ID"],pr:{any:["ghprbPullId","CHANGE_ID"]}},{name:"LayerCI",constant:"LAYERCI",env:"LAYERCI",pr:"LAYERCI_PULL_REQUEST"},{name:"Magnum CI",constant:"MAGNUM",env:"MAGNUM"},{name:"Netlify CI",constant:"NETLIFY",env:"NETLIFY",pr:{env:"PULL_REQUEST",ne:"false"}},{name:"Nevercode",constant:"NEVERCODE",env:"NEVERCODE",pr:{env:"NEVERCODE_PULL_REQUEST",ne:"false"}},{name:"Prow",constant:"PROW",env:"PROW_JOB_ID"},{name:"ReleaseHub",constant:"RELEASEHUB",env:"RELEASE_BUILD_ID"},{name:"Render",constant:"RENDER",env:"RENDER",pr:{IS_PULL_REQUEST:"true"}},{name:"Sail CI",constant:"SAIL",env:"SAILCI",pr:"SAIL_PULL_REQUEST_NUMBER"},{name:"Screwdriver",constant:"SCREWDRIVER",env:"SCREWDRIVER",pr:{env:"SD_PULL_REQUEST",ne:"false"}},{name:"Semaphore",constant:"SEMAPHORE",env:"SEMAPHORE",pr:"PULL_REQUEST_NUMBER"},{name:"Sourcehut",constant:"SOURCEHUT",env:{CI_NAME:"sourcehut"}},{name:"Strider CD",constant:"STRIDER",env:"STRIDER"},{name:"TaskCluster",constant:"TASKCLUSTER",env:["TASK_ID","RUN_ID"]},{name:"TeamCity",constant:"TEAMCITY",env:"TEAMCITY_VERSION"},{name:"Travis CI",constant:"TRAVIS",env:"TRAVIS",pr:{env:"TRAVIS_PULL_REQUEST",ne:"false"}},{name:"Vela",constant:"VELA",env:"VELA",pr:{VELA_PULL_REQUEST:"1"}},{name:"Vercel",constant:"VERCEL",env:{any:["NOW_BUILDER","VERCEL"]},pr:"VERCEL_GIT_PULL_REQUEST_ID"},{name:"Visual Studio App Center",constant:"APPCENTER",env:"APPCENTER_BUILD_ID"},{name:"Woodpecker",constant:"WOODPECKER",env:{CI:"woodpecker"},pr:{CI_BUILD_EVENT:"pull_request"}},{name:"Xcode Cloud",constant:"XCODE_CLOUD",env:"CI_XCODE_PROJECT",pr:"CI_PULL_REQUEST_NUMBER"},{name:"Xcode Server",constant:"XCODE_SERVER",env:"XCS"}]});var Ik=A(jt=>{"use strict";var Pk=Ok(),Ye=process.env;Object.defineProperty(jt,"_vendors",{value:Pk.map(function(t){return t.constant})});jt.name=null;jt.isPR=null;Pk.forEach(function(t){let r=(Array.isArray(t.env)?t.env:[t.env]).every(function(n){return Fk(n)});if(jt[t.constant]=r,!!r)switch(jt.name=t.name,typeof t.pr){case"string":jt.isPR=!!Ye[t.pr];break;case"object":"env"in t.pr?jt.isPR=t.pr.env in Ye&&Ye[t.pr.env]!==t.pr.ne:"any"in t.pr?jt.isPR=t.pr.any.some(function(n){return!!Ye[n]}):jt.isPR=Fk(t.pr);break;default:jt.isPR=null}});jt.isCI=!!(Ye.CI!=="false"&&(Ye.BUILD_ID||Ye.BUILD_NUMBER||Ye.CI||Ye.CI_APP_ID||Ye.CI_BUILD_ID||Ye.CI_BUILD_NUMBER||Ye.CI_NAME||Ye.CONTINUOUS_INTEGRATION||Ye.RUN_ID||jt.name));function Fk(t){return typeof t=="string"?!!Ye[t]:"env"in t?Ye[t.env]&&Ye[t.env].includes(t.includes):"any"in t?t.any.some(function(e){return!!Ye[e]}):Object.keys(t).every(function(e){return Ye[e]===t[e]})}});var rh=A((RZ,H7)=>{H7.exports={name:"create-turbo",version:"2.5.9-canary.7",description:"Create a new Turborepo",homepage:"https://turborepo.com",license:"MIT",repository:{type:"git",url:"https://github.com/vercel/turborepo",directory:"packages/create-turbo"},bugs:{url:"https://github.com/vercel/turborepo/issues"},bin:{"create-turbo":"dist/cli.js"},scripts:{build:"tsup",test:"jest",lint:"eslint src/","check-types":"tsc --noEmit","lint:prettier":"prettier -c . --cache --ignore-path=../../.prettierignore"},dependencies:{commander:"^11.0.0","fs-extra":"^11.1.1",inquirer:"^8.0.0",picocolors:"1.0.1","proxy-agent":"^6.5.0",semver:"^7.3.8","update-check":"^1.5.4"},devDependencies:{"@jest/globals":"^29.7.0","@turbo/eslint-config":"workspace:*","@turbo/telemetry":"workspace:*","@turbo/test-utils":"workspace:*","@turbo/tsconfig":"workspace:*","@turbo/utils":"workspace:*","@turbo/workspaces":"workspace:*","@types/fs-extra":"^9.0.13","@types/inquirer":"^7.3.1","@types/node":"^18.17.2","@types/semver":"^7.3.9",jest:"^29.7.0","ts-jest":"^29.2.5",tsup:"^6.7.0",typescript:"5.5.4"},files:["dist"]}});var ZT=oe(require("http")),JT=oe(require("https")),Sg=oe(require("picocolors")),Ha=require("commander");var mO=oe(Fg());function bh(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function wo(t){return wo=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},wo(t)}function vh(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Eh(t,e){if(e&&(wo(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return vh(t)}function zn(t){return zn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},zn(t)}function Ir(t,e){return Ir=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Ir(t,e)}function wh(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&&Ir(t,e)}function xh(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function Sh(){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 Bi(t,e,r){return Sh()?Bi=Reflect.construct.bind():Bi=function(i,s,o){var a=[null];a.push.apply(a,s);var u=Function.bind.apply(i,a),c=new u;return o&&Ir(c,o.prototype),c},Bi.apply(null,arguments)}function xo(t){var e=typeof Map=="function"?new Map:void 0;return xo=function(n){if(n===null||!xh(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e!="undefined"){if(e.has(n))return e.get(n);e.set(n,i)}function i(){return Bi(n,arguments,zn(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),Ir(i,n)},xo(t)}var Zg=oe(Kg());var yO=oe(require("fs-extra")),bG=function(t){wh(e,t);function e(r){var n;return bh(this,e),n=Eh(this,zn(e).call(this,"No package.json could be found upwards from the directory ".concat(r))),n.directory=r,n}return e}(xo(Error));var gO=oe(require("fs")),_O=oe(require("path"));var I3=oe(require("fs")),L3=oe(require("path"));function f_(t){return typeof t=="undefined"||t===null}function EO(t){return typeof t=="object"&&t!==null}function wO(t){return Array.isArray(t)?t:f_(t)?[]:[t]}function xO(t,e){var r,n,i,s;if(e)for(s=Object.keys(e),r=0,n=s.length;r<n;r+=1)i=s[r],t[i]=e[i];return t}function SO(t,e){var r="",n;for(n=0;n<e;n+=1)r+=t;return r}function AO(t){return t===0&&Number.NEGATIVE_INFINITY===1/t}var DO=f_,CO=EO,RO=wO,kO=SO,TO=AO,OO=xO,Ve={isNothing:DO,isObject:CO,toArray:RO,repeat:kO,isNegativeZero:TO,extend:OO};function d_(t,e){var r="",n=t.reason||"(unknown reason)";return t.mark?(t.mark.name&&(r+='in "'+t.mark.name+'" '),r+="("+(t.mark.line+1)+":"+(t.mark.column+1)+")",!e&&t.mark.snippet&&(r+=`
|
31
31
|
|
32
32
|
`+t.mark.snippet),n+" "+r):n}function Ao(t,e){Error.call(this),this.name="YAMLException",this.reason=t,this.mark=e,this.message=d_(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}Ao.prototype=Object.create(Error.prototype);Ao.prototype.constructor=Ao;Ao.prototype.toString=function(e){return this.name+": "+d_(this,e)};var pt=Ao;function Oh(t,e,r,n,i){var s="",o="",a=Math.floor(i/2)-1;return n-e>a&&(s=" ... ",e=n-a+s.length),r-n>a&&(o=" ...",r=n+a-o.length),{str:s+t.slice(e,r).replace(/\t/g,"\u2192")+o,pos:n-e+s.length}}function Fh(t,e){return Ve.repeat(" ",e-t.length)+t}function FO(t,e){if(e=Object.create(e||null),!t.buffer)return null;e.maxLength||(e.maxLength=79),typeof e.indent!="number"&&(e.indent=1),typeof e.linesBefore!="number"&&(e.linesBefore=3),typeof e.linesAfter!="number"&&(e.linesAfter=2);for(var r=/\r?\n|\r|\0/g,n=[0],i=[],s,o=-1;s=r.exec(t.buffer);)i.push(s.index),n.push(s.index+s[0].length),t.position<=s.index&&o<0&&(o=n.length-2);o<0&&(o=n.length-1);var a="",u,c,l=Math.min(t.line+e.linesAfter,i.length).toString().length,h=e.maxLength-(e.indent+l+3);for(u=1;u<=e.linesBefore&&!(o-u<0);u++)c=Oh(t.buffer,n[o-u],i[o-u],t.position-(n[o]-n[o-u]),h),a=Ve.repeat(" ",e.indent)+Fh((t.line-u+1).toString(),l)+" | "+c.str+`
|
33
33
|
`+a;for(c=Oh(t.buffer,n[o],i[o],t.position,h),a+=Ve.repeat(" ",e.indent)+Fh((t.line+1).toString(),l)+" | "+c.str+`
|
@@ -60,9 +60,9 @@ Please report this to https://github.com/szmarczak/http2-wrapper/`);m(y)}return}
|
|
60
60
|
`+t.slice(o+1):u+=t.slice(i),u.slice(1)}function _5(t){for(var e="",r=0,n,i=0;i<t.length;r>=65536?i+=2:i++)r=So(t,i),n=it[r],!n&&Ro(r)?(e+=t[i],r>=65536&&(e+=t[i+1])):e+=n||c5(r);return e}function b5(t,e,r){var n="",i=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)),(Lr(t,e,a,!1,!1)||typeof a=="undefined"&&Lr(t,e,null,!1,!1))&&(n!==""&&(n+=","+(t.condenseFlow?"":" ")),n+=t.dump);t.tag=i,t.dump="["+n+"]"}function l_(t,e,r,n){var i="",s=t.tag,o,a,u;for(o=0,a=r.length;o<a;o+=1)u=r[o],t.replacer&&(u=t.replacer.call(r,String(o),u)),(Lr(t,e+1,u,!0,!0,!1,!0)||typeof u=="undefined"&&Lr(t,e+1,null,!0,!0,!1,!0))&&((!n||i!=="")&&(i+=Bh(t,e)),t.dump&&Do===t.dump.charCodeAt(0)?i+="-":i+="- ",i+=t.dump);t.tag=s,t.dump=i||"[]"}function v5(t,e,r){var n="",i=t.tag,s=Object.keys(r),o,a,u,c,l;for(o=0,a=s.length;o<a;o+=1)l="",n!==""&&(l+=", "),t.condenseFlow&&(l+='"'),u=s[o],c=r[u],t.replacer&&(c=t.replacer.call(r,u,c)),Lr(t,e,u,!1,!1)&&(t.dump.length>1024&&(l+="? "),l+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),Lr(t,e,c,!1,!1)&&(l+=t.dump,n+=l));t.tag=i,t.dump="{"+n+"}"}function E5(t,e,r,n){var i="",s=t.tag,o=Object.keys(r),a,u,c,l,h,f;if(t.sortKeys===!0)o.sort();else if(typeof t.sortKeys=="function")o.sort(t.sortKeys);else if(t.sortKeys)throw new pt("sortKeys must be a boolean or a function");for(a=0,u=o.length;a<u;a+=1)f="",(!n||i!=="")&&(f+=Bh(t,e)),c=o[a],l=r[c],t.replacer&&(l=t.replacer.call(r,c,l)),Lr(t,e+1,c,!0,!0,!0)&&(h=t.tag!==null&&t.tag!=="?"||t.dump&&t.dump.length>1024,h&&(t.dump&&Do===t.dump.charCodeAt(0)?f+="?":f+="? "),f+=t.dump,h&&(f+=Bh(t,e)),Lr(t,e+1,l,!0,h)&&(t.dump&&Do===t.dump.charCodeAt(0)?f+=":":f+=": ",f+=t.dump,i+=f));t.tag=s,t.dump=i||"{}"}function h_(t,e,r){var n,i,s,o,a,u;for(i=r?t.explicitTypes:t.implicitTypes,s=0,o=i.length;s<o;s+=1)if(a=i[s],(a.instanceOf||a.predicate)&&(!a.instanceOf||typeof e=="object"&&e instanceof a.instanceOf)&&(!a.predicate||a.predicate(e))){if(r?a.multi&&a.representName?t.tag=a.representName(e):t.tag=a.tag:t.tag="?",a.represent){if(u=t.styleMap[a.tag]||a.defaultStyle,H_.call(a.represent)==="[object Function]")n=a.represent(e,u);else if($_.call(a.represent,u))n=a.represent[u](e,u);else throw new pt("!<"+a.tag+'> tag resolver accepts not "'+u+'" style');t.dump=n}return!0}return!1}function Lr(t,e,r,n,i,s,o){t.tag=null,t.dump=r,h_(t,r,!1)||h_(t,r,!0);var a=H_.call(t.dump),u=n,c;n&&(n=t.flowLevel<0||t.flowLevel>e);var l=a==="[object Object]"||a==="[object Array]",h,f;if(l&&(h=t.duplicates.indexOf(r),f=h!==-1),(t.tag!==null&&t.tag!=="?"||f||t.indent!==2&&e>0)&&(i=!1),f&&t.usedDuplicates[h])t.dump="*ref_"+h;else{if(l&&f&&!t.usedDuplicates[h]&&(t.usedDuplicates[h]=!0),a==="[object Object]")n&&Object.keys(t.dump).length!==0?(E5(t,e,t.dump,i),f&&(t.dump="&ref_"+h+t.dump)):(v5(t,e,t.dump),f&&(t.dump="&ref_"+h+" "+t.dump));else if(a==="[object Array]")n&&t.dump.length!==0?(t.noArrayIndent&&!o&&e>0?l_(t,e-1,t.dump,i):l_(t,e,t.dump,i),f&&(t.dump="&ref_"+h+t.dump)):(b5(t,e,t.dump),f&&(t.dump="&ref_"+h+" "+t.dump));else if(a==="[object String]")t.tag!=="?"&&y5(t,t.dump,e,s,u);else{if(a==="[object Undefined]")return!1;if(t.skipInvalid)return!1;throw new pt("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 w5(t,e){var r=[],n=[],i,s;for(Mh(t,r,n),i=0,s=n.length;i<s;i+=1)e.duplicates.push(r[n[i]]);e.usedDuplicates=new Array(s)}function Mh(t,e,r){var n,i,s;if(t!==null&&typeof t=="object")if(i=e.indexOf(t),i!==-1)r.indexOf(i)===-1&&r.push(i);else if(e.push(t),Array.isArray(t))for(i=0,s=t.length;i<s;i+=1)Mh(t[i],e,r);else for(n=Object.keys(t),i=0,s=n.length;i<s;i+=1)Mh(t[n[i]],e,r)}function x5(t,e){e=e||{};var r=new h5(e);r.noRefs||w5(t,r);var n=t;return r.replacer&&(n=r.replacer.call({"":n},"",n)),Lr(r,0,n,!0,!0)?r.dump+`
|
61
61
|
`:""}var S5=x5,A5={dump:S5};function Gh(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 D5=rt,C5=p_,R5=__,k5=x_,T5=S_,O5=qh,F5=U_.load,P5=U_.loadAll,I5=A5.dump,L5=pt,B5={binary:k_,float:w_,map:g_,null:b_,pairs:O_,set:F_,timestamp:C_,bool:v_,int:E_,merge:R_,omap:T_,seq:y_,str:m_},N5=Gh("safeLoad","load"),M5=Gh("safeLoadAll","loadAll"),j5=Gh("safeDump","dump"),q5={Type:D5,Schema:C5,FAILSAFE_SCHEMA:R5,JSON_SCHEMA:k5,CORE_SCHEMA:T5,DEFAULT_SCHEMA:O5,load:F5,loadAll:P5,dump:I5,YAMLException:L5,types:B5,safeLoad:N5,safeLoadAll:M5,safeDump:j5},zh=q5;var B3=oe(Cu());var de={};sO(de,{bold:()=>C3,dimmed:()=>k3,error:()=>Tt,grey:()=>T3,info:()=>D3,item:()=>O3,log:()=>jr,turboBlue:()=>fs,turboGradient:()=>A3,turboLoader:()=>fp,turboRed:()=>Qw,underline:()=>R3,warn:()=>tx,yellow:()=>ex});var vt=require("picocolors"),Kw=oe(Xu()),Zw=oe(sc()),Jw="#0099F7",Xw="#F11712",S3="#FFFF00",hp=t=>{let e=F3(t);return r=>`\x1B[38;5;${e}m${r}${(0,vt.reset)("")}`},A3=(0,Zw.default)(Jw,Xw),fs=hp(Jw),Qw=hp(Xw),ex=hp(S3),fp=t=>(0,Kw.default)({text:t,spinner:{frames:[" ",fs("> "),fs(">> "),fs(">>>")]}}),D3=(...t)=>{jr(fs((0,vt.bold)(">>>")),t.join(" "))},C3=(...t)=>{jr((0,vt.bold)(t.join(" ")))},R3=(...t)=>{jr((0,vt.underline)(t.join(" ")))},k3=(...t)=>{jr((0,vt.dim)(t.join(" ")))},T3=(...t)=>{jr((0,vt.gray)(t.join(" ")))},O3=(...t)=>{jr(fs((0,vt.bold)(" \u2022")),t.join(" "))},jr=(...t)=>{console.log(...t)},tx=(...t)=>{console.error(ex((0,vt.bold)(">>>")),t.join(" "))},Tt=(...t)=>{console.error(Qw((0,vt.bold)(">>>")),t.join(" "))};function F3(t){let e=parseInt(t.slice(1),16),r=Math.floor(e/(256*256))%256,n=Math.floor(e/256)%256,i=e%256;return 16+36*Math.round(r/255*5)+6*Math.round(n/255*5)+Math.round(i/255*5)}var RS=oe(require("os")),kS=oe(_s());async function dc(t,e=[],r){let n={cwd:RS.default.tmpdir(),env:{COREPACK_ENABLE_STRICT:"0"},...r};try{let{stdout:i}=await(0,kS.default)(t,e,n);return i.trim()}catch{return}}async function Wo(){let[t,e,r,n]=await Promise.all([dc("yarnpkg",["--version"],{cwd:"."}),dc("npm",["--version"]),dc("pnpm",["--version"]),dc("bun",["--version"])]);return{yarn:t,pnpm:r,npm:e,bun:n}}var TS=oe(require("fs-extra")),k8=[".DS_Store",".git",".gitattributes",".gitignore",".gitlab-ci.yml",".hg",".hgcheck",".hgignore",".idea",".npmignore",".travis.yml","LICENSE","Thumbs.db","docs","mkdocs.yml","npm-debug.log","yarn-debug.log","yarn-error.log","yarnrc.yml",".yarn"];function Yo(t){let e=TS.default.readdirSync(t).filter(r=>!k8.includes(r)).filter(r=>!r.endsWith(".iml"));return{isEmpty:e.length===0,conflicts:e}}var kp=oe(require("path")),Tp=oe(require("fs-extra")),Op=oe(require("picocolors"));function pc(t){let e=kp.default.resolve(t),r=kp.default.basename(e),n=Tp.default.existsSync(e),i=Tp.default.lstatSync(e,{throwIfNoEntry:!1});if(i&&!i.isDirectory())return{valid:!1,root:e,projectName:r,error:`${Op.default.dim(r)} is not a directory - please try a different location`};if(n){let{isEmpty:s,conflicts:o}=Yo(e);if(!s)return{valid:!1,root:e,projectName:r,error:`${Op.default.dim(r)} (${e}) has ${o.length} conflicting ${o.length===1?"file":"files"} - please try a different location`}}return{valid:!0,root:e,projectName:r}}var JR=require("stream"),XR=require("util"),QR=require("path"),ek=require("os"),Aa=require("fs"),Dy=oe(CC()),Yl=oe(Ay()),dU=(0,XR.promisify)(JR.Stream.pipeline);async function Wl(t){try{return(await Yl.default.head(t)).statusCode===200}catch{return!1}}async function Cy(t,e){let[,r,n,i,s,...o]=t.pathname.split("/"),a=e?e.replace(/^\//,""):o.join("/");if(i===void 0||i===""&&s===void 0)try{let c=await(0,Yl.default)(`https://api.github.com/repos/${r}/${n}`),l=JSON.parse(c.body);return{username:r,name:n,branch:l.default_branch,filePath:a}}catch{return}let u=e?`${s}/${o.join("/")}`.replace(new RegExp(`/${a}|/$`),""):s;if(r&&n&&u&&i==="tree")return{username:r,name:n,branch:u,filePath:a}}function Ry({username:t,name:e,branch:r,filePath:n}){let i=`https://api.github.com/repos/${t}/${e}/contents`,s=`${n?`/${n}`:""}/package.json`;return Wl(`${i+s}?ref=${r}`)}function ky(t){try{let e=new URL(t);return Wl(e.href)}catch{return Wl(`https://api.github.com/repos/vercel/turborepo/contents/examples/${encodeURIComponent(t)}`)}}async function tk(t,e){let r=(0,QR.join)((0,ek.tmpdir)(),`${e}.temp-${Date.now()}`);return await dU(Yl.default.stream(t),(0,Aa.createWriteStream)(r)),r}async function Ty(t,{username:e,name:r,branch:n,filePath:i}){let s=await tk(`https://codeload.github.com/${e}/${r}/tar.gz/${n}`,"turbo-ct-example"),o=null;await(0,Dy.x)({file:s,cwd:t,strip:i?i.split("/").length+1:1,filter:a=>{if(o===null){let u=a.split("/");o=u.length?u[0]:null}return a.startsWith(`${o}${i?`/${i}/`:"/"}`)}}),await Aa.promises.unlink(s)}async function Oy(t,e){let r=await tk("https://codeload.github.com/vercel/turborepo/tar.gz/main","turbo-ct-example"),n=null;await(0,Dy.x)({file:r,cwd:t,strip:2+e.split("/").length,filter:i=>{if(n===null){let s=i.split("/");n=s.length?s[0]:null}return i.includes(`${n}/examples/${e}/`)}}),await Aa.promises.unlink(r)}var Fy=oe(require("fs-extra"));async function Py(t){try{return await Fy.default.access(t,Fy.default.constants.W_OK),!0}catch{return!1}}var Qs=oe(require("path")),Iy=oe(uk()),gi=oe(require("picocolors")),Kl=oe(require("fs-extra"));function gU(t){return typeof t=="object"&&t!==null&&typeof t.message=="string"}var eo=class extends Error{};async function Ly({appPath:t,example:e,isDefaultExample:r,examplePath:n}){let i,s;if(r)i={username:"vercel",name:"turborepo",branch:"main",filePath:"examples/basic"};else{try{s=new URL(e)}catch(p){p.code!=="ERR_INVALID_URL"&&(Tt(p),process.exit(1))}s?(s.origin!=="https://github.com"&&(Tt(`Invalid URL: ${gi.default.red(`"${e}"`)}. Only GitHub repositories are supported. Please use a GitHub URL and try again.`),process.exit(1)),i=await Cy(s,n),i||(Tt(`Unable to fetch repository information from: ${gi.default.red(`"${e}"`)}. Please fix the URL and try again.`),process.exit(1)),await Ry(i)||(Tt(`Could not locate the repository for ${gi.default.red(`"${e}"`)}. Please check that the repository exists and try again.`),process.exit(1))):await ky(e)||(Tt(`Could not locate an example named ${gi.default.red(`"${e}"`)}. It could be due to the following:
|
62
62
|
`,`1. Your spelling of example ${gi.default.red(`"${e}"`)} might be incorrect.
|
63
|
-
`,"2. You might not be connected to the internet or you are behind a proxy."),process.exit(1))}let o=Qs.default.resolve(t);await Py(Qs.default.dirname(o))||(Tt("The application path is not writable, please check folder permissions and try again."),Tt("It is likely you do not have write permissions for this folder."),process.exit(1));let a=Qs.default.basename(o);try{await Kl.default.mkdir(o,{recursive:!0})}catch(p){Tt("Unable to create project directory"),Tt(p),process.exit(1)}let{isEmpty:u,conflicts:c}=Yo(o);u||(Tt(`${gi.default.dim(o)} has ${c.length} conflicting ${c.length===1?"file":"files"} - please try a different location`),process.exit(1));let l=process.cwd();process.chdir(o),jr();let h=fp("Downloading files... (This might take a moment)");try{!r&&i?(h.start(),await(0,Iy.default)(()=>Ty(o,i),{retries:3})):(h.start(),await(0,Iy.default)(()=>Oy(o,e),{retries:3}))}catch(p){throw new eo(gU(p)?p.message:String(p))}finally{h.stop()}let f=Qs.default.join(o,"package.json"),d=Kl.default.existsSync(f),m=[];if(d){let p;try{p=Kl.default.readJsonSync(f)}catch{}p&&m.push(...Object.keys(p.scripts||{}))}let y=t;return Qs.default.join(l,a)===t&&(y=a),{cdPath:y,hasPackageJson:d,availableScripts:m,repoInfo:i}}var ho=require("fs"),Wy=require("crypto");var kk=oe(require("picocolors"));var Te;(function(t){t.assertEqual=i=>i;function e(i){}t.assertIs=e;function r(i){throw new Error}t.assertNever=r,t.arrayToEnum=i=>{let s={};for(let o of i)s[o]=o;return s},t.getValidEnumValues=i=>{let s=t.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),o={};for(let a of s)o[a]=i[a];return t.objectValues(o)},t.objectValues=i=>t.objectKeys(i).map(function(s){return i[s]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let s=[];for(let o in i)Object.prototype.hasOwnProperty.call(i,o)&&s.push(o);return s},t.find=(i,s)=>{for(let o of i)if(s(o))return o},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function n(i,s=" | "){return i.map(o=>typeof o=="string"?`'${o}'`:o).join(s)}t.joinValues=n,t.jsonStringifyReplacer=(i,s)=>typeof s=="bigint"?s.toString():s})(Te||(Te={}));var Ny;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(Ny||(Ny={}));var ae=Te.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Nn=t=>{switch(typeof t){case"undefined":return ae.undefined;case"string":return ae.string;case"number":return isNaN(t)?ae.nan:ae.number;case"boolean":return ae.boolean;case"function":return ae.function;case"bigint":return ae.bigint;case"symbol":return ae.symbol;case"object":return Array.isArray(t)?ae.array:t===null?ae.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?ae.promise:typeof Map!="undefined"&&t instanceof Map?ae.map:typeof Set!="undefined"&&t instanceof Set?ae.set:typeof Date!="undefined"&&t instanceof Date?ae.date:ae.object;default:return ae.unknown}},ie=Te.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),_U=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),Bt=class extends Error{constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){let r=e||function(s){return s.message},n={_errors:[]},i=s=>{for(let o of s.issues)if(o.code==="invalid_union")o.unionErrors.map(i);else if(o.code==="invalid_return_type")i(o.returnTypeError);else if(o.code==="invalid_arguments")i(o.argumentsError);else if(o.path.length===0)n._errors.push(r(o));else{let a=n,u=0;for(;u<o.path.length;){let c=o.path[u];u===o.path.length-1?(a[c]=a[c]||{_errors:[]},a[c]._errors.push(r(o))):a[c]=a[c]||{_errors:[]},a=a[c],u++}}};return i(this),n}toString(){return this.message}get message(){return JSON.stringify(this.issues,Te.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},n=[];for(let i of this.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(e(i))):n.push(e(i));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};Bt.create=t=>new Bt(t);var Da=(t,e)=>{let r;switch(t.code){case ie.invalid_type:t.received===ae.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case ie.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,Te.jsonStringifyReplacer)}`;break;case ie.unrecognized_keys:r=`Unrecognized key(s) in object: ${Te.joinValues(t.keys,", ")}`;break;case ie.invalid_union:r="Invalid input";break;case ie.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Te.joinValues(t.options)}`;break;case ie.invalid_enum_value:r=`Invalid enum value. Expected ${Te.joinValues(t.options)}, received '${t.received}'`;break;case ie.invalid_arguments:r="Invalid function arguments";break;case ie.invalid_return_type:r="Invalid function return type";break;case ie.invalid_date:r="Invalid date";break;case ie.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:Te.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case ie.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case ie.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case ie.custom:r="Invalid input";break;case ie.invalid_intersection_types:r="Intersection results could not be merged";break;case ie.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case ie.not_finite:r="Number must be finite";break;default:r=e.defaultError,Te.assertNever(t)}return{message:r}},hk=Da;function bU(t){hk=t}function Jl(){return hk}var Xl=t=>{let{data:e,path:r,errorMaps:n,issueData:i}=t,s=[...r,...i.path||[]],o={...i,path:s},a="",u=n.filter(c=>!!c).slice().reverse();for(let c of u)a=c(o,{data:e,defaultError:a}).message;return{...i,path:s,message:i.message||a}},vU=[];function ue(t,e){let r=Xl({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Jl(),Da].filter(n=>!!n)});t.common.issues.push(r)}var et=class{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let n=[];for(let i of r){if(i.status==="aborted")return Ee;i.status==="dirty"&&e.dirty(),n.push(i.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){let n=[];for(let i of r)n.push({key:await i.key,value:await i.value});return et.mergeObjectSync(e,n)}static mergeObjectSync(e,r){let n={};for(let i of r){let{key:s,value:o}=i;if(s.status==="aborted"||o.status==="aborted")return Ee;s.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof o.value!="undefined"||i.alwaysSet)&&(n[s.value]=o.value)}return{status:e.value,value:n}}},Ee=Object.freeze({status:"aborted"}),fk=t=>({status:"dirty",value:t}),gt=t=>({status:"valid",value:t}),My=t=>t.status==="aborted",jy=t=>t.status==="dirty",Ca=t=>t.status==="valid",Ql=t=>typeof Promise!="undefined"&&t instanceof Promise,ge;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(ge||(ge={}));var er=class{constructor(e,r,n,i){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},ck=(t,e)=>{if(Ca(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new Bt(t.common.issues);return this._error=r,this._error}}};function we(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:n,description:i}=t;if(e&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(o,a)=>o.code!=="invalid_type"?{message:a.defaultError}:typeof a.data=="undefined"?{message:n!=null?n:a.defaultError}:{message:r!=null?r:a.defaultError},description:i}}var xe=class{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return Nn(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:Nn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new et,ctx:{common:e.parent.common,data:e.data,parsedType:Nn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(Ql(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){var n;let i={common:{issues:[],async:(n=r==null?void 0:r.async)!==null&&n!==void 0?n:!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Nn(e)},s=this._parseSync({data:e,path:i.path,parent:i});return ck(i,s)}async parseAsync(e,r){let n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){let n={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Nn(e)},i=this._parse({data:e,path:n.path,parent:n}),s=await(Ql(i)?i:Promise.resolve(i));return ck(n,s)}refine(e,r){let n=i=>typeof r=="string"||typeof r=="undefined"?{message:r}:typeof r=="function"?r(i):r;return this._refinement((i,s)=>{let o=e(i),a=()=>s.addIssue({code:ie.custom,...n(i)});return typeof Promise!="undefined"&&o instanceof Promise?o.then(u=>u?!0:(a(),!1)):o?!0:(a(),!1)})}refinement(e,r){return this._refinement((n,i)=>e(n)?!0:(i.addIssue(typeof r=="function"?r(n,i):r),!1))}_refinement(e){return new Mt({schema:this,typeName:be.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return cr.create(this,this._def)}nullable(){return on.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Nt.create(this,this._def)}promise(){return qn.create(this,this._def)}or(e){return Ei.create([this,e],this._def)}and(e){return wi.create(this,e,this._def)}transform(e){return new Mt({...we(this._def),schema:this,typeName:be.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new Ci({...we(this._def),innerType:this,defaultValue:r,typeName:be.ZodDefault})}brand(){return new eh({typeName:be.ZodBranded,type:this,...we(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new oo({...we(this._def),innerType:this,catchValue:r,typeName:be.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return Ri.create(this,e)}readonly(){return uo.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},EU=/^c[^\s-]{8,}$/i,wU=/^[a-z][a-z0-9]*$/,xU=/^[0-9A-HJKMNP-TV-Z]{26}$/,SU=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,AU=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,DU="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",By,CU=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,RU=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,kU=t=>t.precision?t.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}Z$`):t.precision===0?t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function TU(t,e){return!!((e==="v4"||!e)&&CU.test(t)||(e==="v6"||!e)&&RU.test(t))}var Lt=class extends xe{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==ae.string){let s=this._getOrReturnCtx(e);return ue(s,{code:ie.invalid_type,expected:ae.string,received:s.parsedType}),Ee}let n=new et,i;for(let s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(i=this._getOrReturnCtx(e,i),ue(i,{code:ie.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="max")e.data.length>s.value&&(i=this._getOrReturnCtx(e,i),ue(i,{code:ie.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="length"){let o=e.data.length>s.value,a=e.data.length<s.value;(o||a)&&(i=this._getOrReturnCtx(e,i),o?ue(i,{code:ie.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):a&&ue(i,{code:ie.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),n.dirty())}else if(s.kind==="email")AU.test(e.data)||(i=this._getOrReturnCtx(e,i),ue(i,{validation:"email",code:ie.invalid_string,message:s.message}),n.dirty());else if(s.kind==="emoji")By||(By=new RegExp(DU,"u")),By.test(e.data)||(i=this._getOrReturnCtx(e,i),ue(i,{validation:"emoji",code:ie.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")SU.test(e.data)||(i=this._getOrReturnCtx(e,i),ue(i,{validation:"uuid",code:ie.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")EU.test(e.data)||(i=this._getOrReturnCtx(e,i),ue(i,{validation:"cuid",code:ie.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid2")wU.test(e.data)||(i=this._getOrReturnCtx(e,i),ue(i,{validation:"cuid2",code:ie.invalid_string,message:s.message}),n.dirty());else if(s.kind==="ulid")xU.test(e.data)||(i=this._getOrReturnCtx(e,i),ue(i,{validation:"ulid",code:ie.invalid_string,message:s.message}),n.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),ue(i,{validation:"url",code:ie.invalid_string,message:s.message}),n.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),ue(i,{validation:"regex",code:ie.invalid_string,message:s.message}),n.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(i=this._getOrReturnCtx(e,i),ue(i,{code:ie.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),n.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(i=this._getOrReturnCtx(e,i),ue(i,{code:ie.invalid_string,validation:{startsWith:s.value},message:s.message}),n.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(i=this._getOrReturnCtx(e,i),ue(i,{code:ie.invalid_string,validation:{endsWith:s.value},message:s.message}),n.dirty()):s.kind==="datetime"?kU(s).test(e.data)||(i=this._getOrReturnCtx(e,i),ue(i,{code:ie.invalid_string,validation:"datetime",message:s.message}),n.dirty()):s.kind==="ip"?TU(e.data,s.version)||(i=this._getOrReturnCtx(e,i),ue(i,{validation:"ip",code:ie.invalid_string,message:s.message}),n.dirty()):Te.assertNever(s);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(i=>e.test(i),{validation:r,code:ie.invalid_string,...ge.errToObj(n)})}_addCheck(e){return new Lt({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...ge.errToObj(e)})}url(e){return this._addCheck({kind:"url",...ge.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...ge.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...ge.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...ge.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...ge.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...ge.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...ge.errToObj(e)})}datetime(e){var r;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)=="undefined"?null:e==null?void 0:e.precision,offset:(r=e==null?void 0:e.offset)!==null&&r!==void 0?r:!1,...ge.errToObj(e==null?void 0:e.message)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...ge.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r==null?void 0:r.position,...ge.errToObj(r==null?void 0:r.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...ge.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...ge.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...ge.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...ge.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...ge.errToObj(r)})}nonempty(e){return this.min(1,ge.errToObj(e))}trim(){return new Lt({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Lt({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Lt({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};Lt.create=t=>{var e;return new Lt({checks:[],typeName:be.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...we(t)})};function OU(t,e){let r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,i=r>n?r:n,s=parseInt(t.toFixed(i).replace(".","")),o=parseInt(e.toFixed(i).replace(".",""));return s%o/Math.pow(10,i)}var Rr=class extends xe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==ae.number){let s=this._getOrReturnCtx(e);return ue(s,{code:ie.invalid_type,expected:ae.number,received:s.parsedType}),Ee}let n,i=new et;for(let s of this._def.checks)s.kind==="int"?Te.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),ue(n,{code:ie.invalid_type,expected:"integer",received:"float",message:s.message}),i.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),ue(n,{code:ie.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),ue(n,{code:ie.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="multipleOf"?OU(e.data,s.value)!==0&&(n=this._getOrReturnCtx(e,n),ue(n,{code:ie.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),ue(n,{code:ie.not_finite,message:s.message}),i.dirty()):Te.assertNever(s);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,ge.toString(r))}gt(e,r){return this.setLimit("min",e,!1,ge.toString(r))}lte(e,r){return this.setLimit("max",e,!0,ge.toString(r))}lt(e,r){return this.setLimit("max",e,!1,ge.toString(r))}setLimit(e,r,n,i){return new Rr({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:ge.toString(i)}]})}_addCheck(e){return new Rr({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:ge.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ge.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ge.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ge.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ge.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:ge.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:ge.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ge.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ge.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Te.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(r)&&Number.isFinite(e)}};Rr.create=t=>new Rr({checks:[],typeName:be.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...we(t)});var kr=class extends xe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==ae.bigint){let s=this._getOrReturnCtx(e);return ue(s,{code:ie.invalid_type,expected:ae.bigint,received:s.parsedType}),Ee}let n,i=new et;for(let s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),ue(n,{code:ie.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),ue(n,{code:ie.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),ue(n,{code:ie.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):Te.assertNever(s);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,ge.toString(r))}gt(e,r){return this.setLimit("min",e,!1,ge.toString(r))}lte(e,r){return this.setLimit("max",e,!0,ge.toString(r))}lt(e,r){return this.setLimit("max",e,!1,ge.toString(r))}setLimit(e,r,n,i){return new kr({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:ge.toString(i)}]})}_addCheck(e){return new kr({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ge.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ge.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ge.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ge.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:ge.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};kr.create=t=>{var e;return new kr({checks:[],typeName:be.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...we(t)})};var _i=class extends xe{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==ae.boolean){let n=this._getOrReturnCtx(e);return ue(n,{code:ie.invalid_type,expected:ae.boolean,received:n.parsedType}),Ee}return gt(e.data)}};_i.create=t=>new _i({typeName:be.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...we(t)});var nn=class extends xe{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==ae.date){let s=this._getOrReturnCtx(e);return ue(s,{code:ie.invalid_type,expected:ae.date,received:s.parsedType}),Ee}if(isNaN(e.data.getTime())){let s=this._getOrReturnCtx(e);return ue(s,{code:ie.invalid_date}),Ee}let n=new et,i;for(let s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(i=this._getOrReturnCtx(e,i),ue(i,{code:ie.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),n.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(i=this._getOrReturnCtx(e,i),ue(i,{code:ie.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):Te.assertNever(s);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new nn({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:ge.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:ge.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};nn.create=t=>new nn({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:be.ZodDate,...we(t)});var ro=class extends xe{_parse(e){if(this._getType(e)!==ae.symbol){let n=this._getOrReturnCtx(e);return ue(n,{code:ie.invalid_type,expected:ae.symbol,received:n.parsedType}),Ee}return gt(e.data)}};ro.create=t=>new ro({typeName:be.ZodSymbol,...we(t)});var bi=class extends xe{_parse(e){if(this._getType(e)!==ae.undefined){let n=this._getOrReturnCtx(e);return ue(n,{code:ie.invalid_type,expected:ae.undefined,received:n.parsedType}),Ee}return gt(e.data)}};bi.create=t=>new bi({typeName:be.ZodUndefined,...we(t)});var vi=class extends xe{_parse(e){if(this._getType(e)!==ae.null){let n=this._getOrReturnCtx(e);return ue(n,{code:ie.invalid_type,expected:ae.null,received:n.parsedType}),Ee}return gt(e.data)}};vi.create=t=>new vi({typeName:be.ZodNull,...we(t)});var jn=class extends xe{constructor(){super(...arguments),this._any=!0}_parse(e){return gt(e.data)}};jn.create=t=>new jn({typeName:be.ZodAny,...we(t)});var rn=class extends xe{constructor(){super(...arguments),this._unknown=!0}_parse(e){return gt(e.data)}};rn.create=t=>new rn({typeName:be.ZodUnknown,...we(t)});var lr=class extends xe{_parse(e){let r=this._getOrReturnCtx(e);return ue(r,{code:ie.invalid_type,expected:ae.never,received:r.parsedType}),Ee}};lr.create=t=>new lr({typeName:be.ZodNever,...we(t)});var no=class extends xe{_parse(e){if(this._getType(e)!==ae.undefined){let n=this._getOrReturnCtx(e);return ue(n,{code:ie.invalid_type,expected:ae.void,received:n.parsedType}),Ee}return gt(e.data)}};no.create=t=>new no({typeName:be.ZodVoid,...we(t)});var Nt=class extends xe{_parse(e){let{ctx:r,status:n}=this._processInputParams(e),i=this._def;if(r.parsedType!==ae.array)return ue(r,{code:ie.invalid_type,expected:ae.array,received:r.parsedType}),Ee;if(i.exactLength!==null){let o=r.data.length>i.exactLength.value,a=r.data.length<i.exactLength.value;(o||a)&&(ue(r,{code:o?ie.too_big:ie.too_small,minimum:a?i.exactLength.value:void 0,maximum:o?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),n.dirty())}if(i.minLength!==null&&r.data.length<i.minLength.value&&(ue(r,{code:ie.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),n.dirty()),i.maxLength!==null&&r.data.length>i.maxLength.value&&(ue(r,{code:ie.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((o,a)=>i.type._parseAsync(new er(r,o,r.path,a)))).then(o=>et.mergeArray(n,o));let s=[...r.data].map((o,a)=>i.type._parseSync(new er(r,o,r.path,a)));return et.mergeArray(n,s)}get element(){return this._def.type}min(e,r){return new Nt({...this._def,minLength:{value:e,message:ge.toString(r)}})}max(e,r){return new Nt({...this._def,maxLength:{value:e,message:ge.toString(r)}})}length(e,r){return new Nt({...this._def,exactLength:{value:e,message:ge.toString(r)}})}nonempty(e){return this.min(1,e)}};Nt.create=(t,e)=>new Nt({type:t,minLength:null,maxLength:null,exactLength:null,typeName:be.ZodArray,...we(e)});function to(t){if(t instanceof Be){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=cr.create(to(n))}return new Be({...t._def,shape:()=>e})}else return t instanceof Nt?new Nt({...t._def,type:to(t.element)}):t instanceof cr?cr.create(to(t.unwrap())):t instanceof on?on.create(to(t.unwrap())):t instanceof tr?tr.create(t.items.map(e=>to(e))):t}var Be=class extends xe{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=Te.objectKeys(e);return this._cached={shape:e,keys:r}}_parse(e){if(this._getType(e)!==ae.object){let c=this._getOrReturnCtx(e);return ue(c,{code:ie.invalid_type,expected:ae.object,received:c.parsedType}),Ee}let{status:n,ctx:i}=this._processInputParams(e),{shape:s,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof lr&&this._def.unknownKeys==="strip"))for(let c in i.data)o.includes(c)||a.push(c);let u=[];for(let c of o){let l=s[c],h=i.data[c];u.push({key:{status:"valid",value:c},value:l._parse(new er(i,h,i.path,c)),alwaysSet:c in i.data})}if(this._def.catchall instanceof lr){let c=this._def.unknownKeys;if(c==="passthrough")for(let l of a)u.push({key:{status:"valid",value:l},value:{status:"valid",value:i.data[l]}});else if(c==="strict")a.length>0&&(ue(i,{code:ie.unrecognized_keys,keys:a}),n.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let c=this._def.catchall;for(let l of a){let h=i.data[l];u.push({key:{status:"valid",value:l},value:c._parse(new er(i,h,i.path,l)),alwaysSet:l in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let c=[];for(let l of u){let h=await l.key;c.push({key:h,value:await l.value,alwaysSet:l.alwaysSet})}return c}).then(c=>et.mergeObjectSync(n,c)):et.mergeObjectSync(n,u)}get shape(){return this._def.shape()}strict(e){return ge.errToObj,new Be({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{var i,s,o,a;let u=(o=(s=(i=this._def).errorMap)===null||s===void 0?void 0:s.call(i,r,n).message)!==null&&o!==void 0?o:n.defaultError;return r.code==="unrecognized_keys"?{message:(a=ge.errToObj(e).message)!==null&&a!==void 0?a:u}:{message:u}}}:{}})}strip(){return new Be({...this._def,unknownKeys:"strip"})}passthrough(){return new Be({...this._def,unknownKeys:"passthrough"})}extend(e){return new Be({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Be({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:be.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new Be({...this._def,catchall:e})}pick(e){let r={};return Te.objectKeys(e).forEach(n=>{e[n]&&this.shape[n]&&(r[n]=this.shape[n])}),new Be({...this._def,shape:()=>r})}omit(e){let r={};return Te.objectKeys(this.shape).forEach(n=>{e[n]||(r[n]=this.shape[n])}),new Be({...this._def,shape:()=>r})}deepPartial(){return to(this)}partial(e){let r={};return Te.objectKeys(this.shape).forEach(n=>{let i=this.shape[n];e&&!e[n]?r[n]=i:r[n]=i.optional()}),new Be({...this._def,shape:()=>r})}required(e){let r={};return Te.objectKeys(this.shape).forEach(n=>{if(e&&!e[n])r[n]=this.shape[n];else{let s=this.shape[n];for(;s instanceof cr;)s=s._def.innerType;r[n]=s}}),new Be({...this._def,shape:()=>r})}keyof(){return dk(Te.objectKeys(this.shape))}};Be.create=(t,e)=>new Be({shape:()=>t,unknownKeys:"strip",catchall:lr.create(),typeName:be.ZodObject,...we(e)});Be.strictCreate=(t,e)=>new Be({shape:()=>t,unknownKeys:"strict",catchall:lr.create(),typeName:be.ZodObject,...we(e)});Be.lazycreate=(t,e)=>new Be({shape:t,unknownKeys:"strip",catchall:lr.create(),typeName:be.ZodObject,...we(e)});var Ei=class extends xe{_parse(e){let{ctx:r}=this._processInputParams(e),n=this._def.options;function i(s){for(let a of s)if(a.result.status==="valid")return a.result;for(let a of s)if(a.result.status==="dirty")return r.common.issues.push(...a.ctx.common.issues),a.result;let o=s.map(a=>new Bt(a.ctx.common.issues));return ue(r,{code:ie.invalid_union,unionErrors:o}),Ee}if(r.common.async)return Promise.all(n.map(async s=>{let o={...r,common:{...r.common,issues:[]},parent:null};return{result:await s._parseAsync({data:r.data,path:r.path,parent:o}),ctx:o}})).then(i);{let s,o=[];for(let u of n){let c={...r,common:{...r.common,issues:[]},parent:null},l=u._parseSync({data:r.data,path:r.path,parent:c});if(l.status==="valid")return l;l.status==="dirty"&&!s&&(s={result:l,ctx:c}),c.common.issues.length&&o.push(c.common.issues)}if(s)return r.common.issues.push(...s.ctx.common.issues),s.result;let a=o.map(u=>new Bt(u));return ue(r,{code:ie.invalid_union,unionErrors:a}),Ee}}get options(){return this._def.options}};Ei.create=(t,e)=>new Ei({options:t,typeName:be.ZodUnion,...we(e)});var Zl=t=>t instanceof Si?Zl(t.schema):t instanceof Mt?Zl(t.innerType()):t instanceof Ai?[t.value]:t instanceof Tr?t.options:t instanceof Di?Object.keys(t.enum):t instanceof Ci?Zl(t._def.innerType):t instanceof bi?[void 0]:t instanceof vi?[null]:null,io=class extends xe{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==ae.object)return ue(r,{code:ie.invalid_type,expected:ae.object,received:r.parsedType}),Ee;let n=this.discriminator,i=r.data[n],s=this.optionsMap.get(i);return s?r.common.async?s._parseAsync({data:r.data,path:r.path,parent:r}):s._parseSync({data:r.data,path:r.path,parent:r}):(ue(r,{code:ie.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),Ee)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,n){let i=new Map;for(let s of r){let o=Zl(s.shape[e]);if(!o)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let a of o){if(i.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);i.set(a,s)}}return new io({typeName:be.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:i,...we(n)})}};function qy(t,e){let r=Nn(t),n=Nn(e);if(t===e)return{valid:!0,data:t};if(r===ae.object&&n===ae.object){let i=Te.objectKeys(e),s=Te.objectKeys(t).filter(a=>i.indexOf(a)!==-1),o={...t,...e};for(let a of s){let u=qy(t[a],e[a]);if(!u.valid)return{valid:!1};o[a]=u.data}return{valid:!0,data:o}}else if(r===ae.array&&n===ae.array){if(t.length!==e.length)return{valid:!1};let i=[];for(let s=0;s<t.length;s++){let o=t[s],a=e[s],u=qy(o,a);if(!u.valid)return{valid:!1};i.push(u.data)}return{valid:!0,data:i}}else return r===ae.date&&n===ae.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var wi=class extends xe{_parse(e){let{status:r,ctx:n}=this._processInputParams(e),i=(s,o)=>{if(My(s)||My(o))return Ee;let a=qy(s.value,o.value);return a.valid?((jy(s)||jy(o))&&r.dirty(),{status:r.value,value:a.data}):(ue(n,{code:ie.invalid_intersection_types}),Ee)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([s,o])=>i(s,o)):i(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};wi.create=(t,e,r)=>new wi({left:t,right:e,typeName:be.ZodIntersection,...we(r)});var tr=class extends xe{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==ae.array)return ue(n,{code:ie.invalid_type,expected:ae.array,received:n.parsedType}),Ee;if(n.data.length<this._def.items.length)return ue(n,{code:ie.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ee;!this._def.rest&&n.data.length>this._def.items.length&&(ue(n,{code:ie.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let s=[...n.data].map((o,a)=>{let u=this._def.items[a]||this._def.rest;return u?u._parse(new er(n,o,n.path,a)):null}).filter(o=>!!o);return n.common.async?Promise.all(s).then(o=>et.mergeArray(r,o)):et.mergeArray(r,s)}get items(){return this._def.items}rest(e){return new tr({...this._def,rest:e})}};tr.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new tr({items:t,typeName:be.ZodTuple,rest:null,...we(e)})};var xi=class extends xe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==ae.object)return ue(n,{code:ie.invalid_type,expected:ae.object,received:n.parsedType}),Ee;let i=[],s=this._def.keyType,o=this._def.valueType;for(let a in n.data)i.push({key:s._parse(new er(n,a,n.path,a)),value:o._parse(new er(n,n.data[a],n.path,a))});return n.common.async?et.mergeObjectAsync(r,i):et.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof xe?new xi({keyType:e,valueType:r,typeName:be.ZodRecord,...we(n)}):new xi({keyType:Lt.create(),valueType:e,typeName:be.ZodRecord,...we(r)})}},so=class extends xe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==ae.map)return ue(n,{code:ie.invalid_type,expected:ae.map,received:n.parsedType}),Ee;let i=this._def.keyType,s=this._def.valueType,o=[...n.data.entries()].map(([a,u],c)=>({key:i._parse(new er(n,a,n.path,[c,"key"])),value:s._parse(new er(n,u,n.path,[c,"value"]))}));if(n.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let u of o){let c=await u.key,l=await u.value;if(c.status==="aborted"||l.status==="aborted")return Ee;(c.status==="dirty"||l.status==="dirty")&&r.dirty(),a.set(c.value,l.value)}return{status:r.value,value:a}})}else{let a=new Map;for(let u of o){let c=u.key,l=u.value;if(c.status==="aborted"||l.status==="aborted")return Ee;(c.status==="dirty"||l.status==="dirty")&&r.dirty(),a.set(c.value,l.value)}return{status:r.value,value:a}}}};so.create=(t,e,r)=>new so({valueType:e,keyType:t,typeName:be.ZodMap,...we(r)});var sn=class extends xe{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==ae.set)return ue(n,{code:ie.invalid_type,expected:ae.set,received:n.parsedType}),Ee;let i=this._def;i.minSize!==null&&n.data.size<i.minSize.value&&(ue(n,{code:ie.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),r.dirty()),i.maxSize!==null&&n.data.size>i.maxSize.value&&(ue(n,{code:ie.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());let s=this._def.valueType;function o(u){let c=new Set;for(let l of u){if(l.status==="aborted")return Ee;l.status==="dirty"&&r.dirty(),c.add(l.value)}return{status:r.value,value:c}}let a=[...n.data.values()].map((u,c)=>s._parse(new er(n,u,n.path,c)));return n.common.async?Promise.all(a).then(u=>o(u)):o(a)}min(e,r){return new sn({...this._def,minSize:{value:e,message:ge.toString(r)}})}max(e,r){return new sn({...this._def,maxSize:{value:e,message:ge.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};sn.create=(t,e)=>new sn({valueType:t,minSize:null,maxSize:null,typeName:be.ZodSet,...we(e)});var Mn=class extends xe{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==ae.function)return ue(r,{code:ie.invalid_type,expected:ae.function,received:r.parsedType}),Ee;function n(a,u){return Xl({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Jl(),Da].filter(c=>!!c),issueData:{code:ie.invalid_arguments,argumentsError:u}})}function i(a,u){return Xl({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Jl(),Da].filter(c=>!!c),issueData:{code:ie.invalid_return_type,returnTypeError:u}})}let s={errorMap:r.common.contextualErrorMap},o=r.data;if(this._def.returns instanceof qn){let a=this;return gt(async function(...u){let c=new Bt([]),l=await a._def.args.parseAsync(u,s).catch(d=>{throw c.addIssue(n(u,d)),c}),h=await Reflect.apply(o,this,l);return await a._def.returns._def.type.parseAsync(h,s).catch(d=>{throw c.addIssue(i(h,d)),c})})}else{let a=this;return gt(function(...u){let c=a._def.args.safeParse(u,s);if(!c.success)throw new Bt([n(u,c.error)]);let l=Reflect.apply(o,this,c.data),h=a._def.returns.safeParse(l,s);if(!h.success)throw new Bt([i(l,h.error)]);return h.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Mn({...this._def,args:tr.create(e).rest(rn.create())})}returns(e){return new Mn({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,n){return new Mn({args:e||tr.create([]).rest(rn.create()),returns:r||rn.create(),typeName:be.ZodFunction,...we(n)})}},Si=class extends xe{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};Si.create=(t,e)=>new Si({getter:t,typeName:be.ZodLazy,...we(e)});var Ai=class extends xe{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return ue(r,{received:r.data,code:ie.invalid_literal,expected:this._def.value}),Ee}return{status:"valid",value:e.data}}get value(){return this._def.value}};Ai.create=(t,e)=>new Ai({value:t,typeName:be.ZodLiteral,...we(e)});function dk(t,e){return new Tr({values:t,typeName:be.ZodEnum,...we(e)})}var Tr=class extends xe{_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),n=this._def.values;return ue(r,{expected:Te.joinValues(n),received:r.parsedType,code:ie.invalid_type}),Ee}if(this._def.values.indexOf(e.data)===-1){let r=this._getOrReturnCtx(e),n=this._def.values;return ue(r,{received:r.data,code:ie.invalid_enum_value,options:n}),Ee}return gt(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e){return Tr.create(e)}exclude(e){return Tr.create(this.options.filter(r=>!e.includes(r)))}};Tr.create=dk;var Di=class extends xe{_parse(e){let r=Te.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==ae.string&&n.parsedType!==ae.number){let i=Te.objectValues(r);return ue(n,{expected:Te.joinValues(i),received:n.parsedType,code:ie.invalid_type}),Ee}if(r.indexOf(e.data)===-1){let i=Te.objectValues(r);return ue(n,{received:n.data,code:ie.invalid_enum_value,options:i}),Ee}return gt(e.data)}get enum(){return this._def.values}};Di.create=(t,e)=>new Di({values:t,typeName:be.ZodNativeEnum,...we(e)});var qn=class extends xe{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==ae.promise&&r.common.async===!1)return ue(r,{code:ie.invalid_type,expected:ae.promise,received:r.parsedType}),Ee;let n=r.parsedType===ae.promise?r.data:Promise.resolve(r.data);return gt(n.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}};qn.create=(t,e)=>new qn({type:t,typeName:be.ZodPromise,...we(e)});var Mt=class extends xe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===be.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),i=this._def.effect||null,s={addIssue:o=>{ue(n,o),o.fatal?r.abort():r.dirty()},get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),i.type==="preprocess"){let o=i.transform(n.data,s);return n.common.issues.length?{status:"dirty",value:n.data}:n.common.async?Promise.resolve(o).then(a=>this._def.schema._parseAsync({data:a,path:n.path,parent:n})):this._def.schema._parseSync({data:o,path:n.path,parent:n})}if(i.type==="refinement"){let o=a=>{let u=i.refinement(a,s);if(n.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(n.common.async===!1){let a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?Ee:(a.status==="dirty"&&r.dirty(),o(a.value),{status:r.value,value:a.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>a.status==="aborted"?Ee:(a.status==="dirty"&&r.dirty(),o(a.value).then(()=>({status:r.value,value:a.value}))))}if(i.type==="transform")if(n.common.async===!1){let o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Ca(o))return o;let a=i.transform(o.value,s);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>Ca(o)?Promise.resolve(i.transform(o.value,s)).then(a=>({status:r.value,value:a})):o);Te.assertNever(i)}};Mt.create=(t,e,r)=>new Mt({schema:t,typeName:be.ZodEffects,effect:e,...we(r)});Mt.createWithPreprocess=(t,e,r)=>new Mt({schema:e,effect:{type:"preprocess",transform:t},typeName:be.ZodEffects,...we(r)});var cr=class extends xe{_parse(e){return this._getType(e)===ae.undefined?gt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};cr.create=(t,e)=>new cr({innerType:t,typeName:be.ZodOptional,...we(e)});var on=class extends xe{_parse(e){return this._getType(e)===ae.null?gt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};on.create=(t,e)=>new on({innerType:t,typeName:be.ZodNullable,...we(e)});var Ci=class extends xe{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return r.parsedType===ae.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};Ci.create=(t,e)=>new Ci({innerType:t,typeName:be.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...we(e)});var oo=class extends xe{_parse(e){let{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Ql(i)?i.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Bt(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Bt(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};oo.create=(t,e)=>new oo({innerType:t,typeName:be.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...we(e)});var ao=class extends xe{_parse(e){if(this._getType(e)!==ae.nan){let n=this._getOrReturnCtx(e);return ue(n,{code:ie.invalid_type,expected:ae.nan,received:n.parsedType}),Ee}return{status:"valid",value:e.data}}};ao.create=t=>new ao({typeName:be.ZodNaN,...we(t)});var FU=Symbol("zod_brand"),eh=class extends xe{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},Ri=class extends xe{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let s=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?Ee:s.status==="dirty"?(r.dirty(),fk(s.value)):this._def.out._parseAsync({data:s.value,path:n.path,parent:n})})();{let i=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?Ee:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(e,r){return new Ri({in:e,out:r,typeName:be.ZodPipeline})}},uo=class extends xe{_parse(e){let r=this._def.innerType._parse(e);return Ca(r)&&(r.value=Object.freeze(r.value)),r}};uo.create=(t,e)=>new uo({innerType:t,typeName:be.ZodReadonly,...we(e)});var pk=(t,e={},r)=>t?jn.create().superRefine((n,i)=>{var s,o;if(!t(n)){let a=typeof e=="function"?e(n):typeof e=="string"?{message:e}:e,u=(o=(s=a.fatal)!==null&&s!==void 0?s:r)!==null&&o!==void 0?o:!0,c=typeof a=="string"?{message:a}:a;i.addIssue({code:"custom",...c,fatal:u})}}):jn.create(),PU={object:Be.lazycreate},be;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(be||(be={}));var IU=(t,e={message:`Input not instance of ${t.name}`})=>pk(r=>r instanceof t,e),mk=Lt.create,yk=Rr.create,LU=ao.create,BU=kr.create,gk=_i.create,NU=nn.create,MU=ro.create,jU=bi.create,qU=vi.create,UU=jn.create,HU=rn.create,$U=lr.create,GU=no.create,zU=Nt.create,VU=Be.create,WU=Be.strictCreate,YU=Ei.create,KU=io.create,ZU=wi.create,JU=tr.create,XU=xi.create,QU=so.create,e7=sn.create,t7=Mn.create,r7=Si.create,n7=Ai.create,i7=Tr.create,s7=Di.create,o7=qn.create,lk=Mt.create,a7=cr.create,u7=on.create,c7=Mt.createWithPreprocess,l7=Ri.create,h7=()=>mk().optional(),f7=()=>yk().optional(),d7=()=>gk().optional(),p7={string:t=>Lt.create({...t,coerce:!0}),number:t=>Rr.create({...t,coerce:!0}),boolean:t=>_i.create({...t,coerce:!0}),bigint:t=>kr.create({...t,coerce:!0}),date:t=>nn.create({...t,coerce:!0})},m7=Ee,co=Object.freeze({__proto__:null,defaultErrorMap:Da,setErrorMap:bU,getErrorMap:Jl,makeIssue:Xl,EMPTY_PATH:vU,addIssueToContext:ue,ParseStatus:et,INVALID:Ee,DIRTY:fk,OK:gt,isAborted:My,isDirty:jy,isValid:Ca,isAsync:Ql,get util(){return Te},get objectUtil(){return Ny},ZodParsedType:ae,getParsedType:Nn,ZodType:xe,ZodString:Lt,ZodNumber:Rr,ZodBigInt:kr,ZodBoolean:_i,ZodDate:nn,ZodSymbol:ro,ZodUndefined:bi,ZodNull:vi,ZodAny:jn,ZodUnknown:rn,ZodNever:lr,ZodVoid:no,ZodArray:Nt,ZodObject:Be,ZodUnion:Ei,ZodDiscriminatedUnion:io,ZodIntersection:wi,ZodTuple:tr,ZodRecord:xi,ZodMap:so,ZodSet:sn,ZodFunction:Mn,ZodLazy:Si,ZodLiteral:Ai,ZodEnum:Tr,ZodNativeEnum:Di,ZodPromise:qn,ZodEffects:Mt,ZodTransformer:Mt,ZodOptional:cr,ZodNullable:on,ZodDefault:Ci,ZodCatch:oo,ZodNaN:ao,BRAND:FU,ZodBranded:eh,ZodPipeline:Ri,ZodReadonly:uo,custom:pk,Schema:xe,ZodSchema:xe,late:PU,get ZodFirstPartyTypeKind(){return be},coerce:p7,any:UU,array:zU,bigint:BU,boolean:gk,date:NU,discriminatedUnion:KU,effect:lk,enum:i7,function:t7,instanceof:IU,intersection:ZU,lazy:r7,literal:n7,map:QU,nan:LU,nativeEnum:s7,never:$U,null:qU,nullable:u7,number:yk,object:VU,oboolean:d7,onumber:f7,optional:a7,ostring:h7,pipeline:l7,preprocess:c7,promise:o7,record:XU,set:e7,strictObject:WU,string:mk,symbol:MU,transformer:lk,tuple:JU,undefined:jU,union:YU,unknown:HU,void:GU,NEVER:m7,ZodIssueCode:ie,quotelessJson:_U,ZodError:Bt});var Vy=oe(require("os")),Dk=oe(require("crypto")),Ck=oe(require("path")),Rk=oe(Ak());function A7(t){let e=process.version,r=Vy.default.type(),n=Vy.default.arch();return`${t.name} ${t.version} ${e} ${r} ${n}`}async function D7(){let t=process.env.TURBO_CONFIG_DIR_PATH?process.env.TURBO_CONFIG_DIR_PATH:await(0,Rk.configDir)();if(!t)throw new Error("Could not find telemetry config directory");return Ck.default.join(t,"turborepo","telemetry.json")}function C7({input:t,salt:e}){return Dk.default.createHash("sha256").update(`${e}${t}`).digest("hex")}var lo={buildUserAgent:A7,oneWayHashWithSalt:C7,defaultConfigPath:D7};var R7="TURBO_TELEMETRY_DEBUG",k7="TURBO_TELEMETRY_DISABLED",T7="TURBO_TELEMETRY_MESSAGE_DISABLED",O7="DO_NOT_TRACK",F7=co.object({telemetry_enabled:co.boolean(),telemetry_id:co.string(),telemetry_salt:co.string(),telemetry_alerted:co.string().optional()}),At=class{constructor({configPath:e,config:r}){this.config=r,this.configPath=e}static fromConfigPath(e){try{let r=(0,ho.readFileSync)(e,"utf-8"),n=JSON.parse(r),i=At.validateConfig(n);return new At({configPath:e,config:i})}catch{return At.tryRemove({configPath:e})?At.create({configPath:e}):void 0}}static async fromDefaultConfig(){try{let e=await lo.defaultConfigPath();return At.fromConfigPath(e)}catch{return}}static validateConfig(e){try{return F7.parse(e)}catch{throw new Error("Config is invalid.")}}static create({configPath:e}){let r=(0,Wy.randomUUID)(),n=(0,Wy.randomUUID)(),i=lo.oneWayHashWithSalt({input:r,salt:n}),s=new At({configPath:e,config:{telemetry_enabled:!0,telemetry_id:i,telemetry_salt:n}});if(s.tryWrite())return s}tryWrite(){try{let e=JSON.stringify(this.config,null,2);return(0,ho.writeFileSync)(this.configPath,e),!0}catch{return!1}}static tryRemove({configPath:e}){try{return(0,ho.rmSync)(e,{force:!0}),!0}catch{return!1}}hasSeenAlert(){return this.config.telemetry_alerted!==void 0}isEnabled(){let e=process.env[O7]||"0",r=process.env[k7]||"0";return e==="1"||e.toLowerCase()==="true"||r==="1"||r.toLowerCase()==="true"?!1:this.config.telemetry_enabled}isTelemetryWarningEnabled(){let e=process.env[T7]||"0";return!(e==="1"||e.toLowerCase()==="true")}get id(){return this.config.telemetry_id}showAlert(){!this.hasSeenAlert()&&this.isEnabled()&&this.isTelemetryWarningEnabled()&&(de.log(),de.bold("Attention:"),de.grey("Turborepo now collects completely anonymous telemetry regarding usage."),de.grey("This information is used to shape the Turborepo roadmap and prioritize features."),de.grey("You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:"),de.underline(kk.default.gray("https://turborepo.com/docs/telemetry"))),this.alertShown()}enable(){this.config.telemetry_enabled=!0,this.tryWrite()}disable(){this.config.telemetry_enabled=!1,this.tryWrite()}alertShown(){return this.hasSeenAlert()||(this.config.telemetry_alerted=new Date().toISOString(),this.tryWrite()),!0}oneWayHash(e){return lo.oneWayHashWithSalt({input:e,salt:this.config.telemetry_salt})}static isDebug(){let e=process.env[R7]||"0";return e==="1"||e.toLowerCase()==="true"}};var Yy=require("crypto"),Tk=oe(Ay());var P7=20,I7="/api/turborepo/v1/events",ki=class{constructor({api:e,packageInfo:r,config:n,opts:i}){this.batchSize=P7;this.timeout=250;this.sessionId=(0,Yy.randomUUID)();this.eventBatches=[];this.events=[];let s=new URL(I7,e);this.api=s.toString(),this.packageInfo=r,this.config=n,i!=null&&i.timeout&&(this.timeout=i.timeout),i!=null&&i.batchSize&&(this.batchSize=i.batchSize)}hasPendingEvents(){return this.events.length!==0}async waitForFlush(){await Promise.all(this.eventBatches)}flushEvents(){let e=this.events.splice(0,this.batchSize);this.config.isEnabled()&&this.eventBatches.push(Tk.default.post(this.api,{timeout:this.timeout,json:e,headers:{"x-turbo-telemetry-id":this.config.id,"x-turbo-session-id":this.sessionId,"User-Agent":lo.buildUserAgent(this.packageInfo)}}))}track({key:e,value:r,parentId:n,isSensitive:i}){let s={id:(0,Yy.randomUUID)(),key:e,value:i?this.config.oneWayHash(r):r,package_name:this.packageInfo.name,package_version:this.packageInfo.version,parent_id:n};return At.isDebug()&&(de.log(),de.bold("[telemetry event]"),de.dimmed(JSON.stringify(s,null,2)),de.log()),this.config.isEnabled()&&(this.events.push({package:s}),this.events.length>=this.batchSize&&this.flushEvents()),s}async close(){for(;this.hasPendingEvents();)this.flushEvents();try{await this.waitForFlush()}catch{}}trackCliOption({option:e,value:r}){return this.track({key:`option:${e}`,value:r})}trackCliArgument({argument:e,value:r}){return this.track({key:`argument:${e}`,value:r})}trackCliCommand({command:e,value:r}){return this.track({key:`command:${e}`,value:r})}trackCommandStatus({command:e,status:r}){return this.trackCliCommand({command:e,value:r})}trackCommandWarning(e){return this.track({key:"warning",value:e})}trackCommandError(e){return this.track({key:"error",value:e})}};var Ra=class extends ki{trackOptionExample(e){if(e)return this.trackCliOption({option:"example",value:e})}trackOptionPackageManager(e){if(e)return this.trackCliOption({option:"package_manager",value:e})}trackOptionSkipInstall(e){if(e)return this.trackCliOption({option:"skip_install",value:e.toString()})}trackOptionSkipTransforms(e){if(e)return this.trackCliOption({option:"skip_transforms",value:e.toString()})}trackOptionTurboVersion(e){if(e)return this.trackCliOption({option:"turbo_version",value:e})}trackOptionExamplePath(e){if(e)return this.trackCliOption({option:"example_path",value:e})}trackArgumentDirectory(e){if(e)return this.trackCliArgument({argument:"project_directory",value:"provided"})}trackArgumentPackageManager(e){if(e)return this.trackCliArgument({argument:"package_manager",value:e})}};var Lk=oe(Ik());var B7=["build","test","lint","typecheck","checktypes","check-types","type-check","check"],ka=class extends ki{trackCI(){var e;return this.track({key:"ci",value:(e=Lk.name)!=null?e:"unknown"})}trackArgumentWorkspace(e){if(e)return this.trackCliArgument({argument:"workspace",value:"provided"})}trackOptionTask(e){if(e)return this.trackCliOption({option:"task",value:B7.includes(e)?e:"other"})}trackOptionFallback(e){if(e)return this.trackCliOption({option:"fallback",value:e})}trackOptionDirectory(e){if(e)return this.trackCliOption({option:"directory",value:"custom"})}trackOptionMaxBuffer(e){if(e!==void 0)return this.trackCliOption({option:"max_buffer",value:e.toString()})}};var N7={"create-turbo":Ra,"turbo-ignore":ka},M7="https://telemetry.vercel.com";async function Ky({packageInfo:t,opts:e}){let r=N7[t.name],n=await At.fromDefaultConfig();return n?(n.showAlert(),{telemetry:new r({api:M7,packageInfo:t,config:n,opts:e})}):{telemetry:void 0}}var Ta=oe(require("picocolors"));var Bk=require("commander"),Nk="status",j7=["enable","disable",Nk];function q7(t){var r;let e=(r=t.telemetry)==null?void 0:r.config.isEnabled();de.log(`Status: ${e?Ta.default.bold(Ta.default.green("Enabled")):Ta.default.bold(Ta.default.red("Disabled"))}`),de.log(),e?de.log("Turborepo telemetry is completely anonymous. Thank you for participating!"):de.log("You have opted-out of Turborepo anonymous telemetry. No data will be collected from your machine."),de.log("Learn more: https://turborepo.com/docs/telemetry")}function U7(t,e){if(!e.telemetry){de.error("Telemetry could not be initialized");return}t==="enable"?(e.telemetry.config.enable(),de.bold("Success!")):t==="disable"&&(e.telemetry.config.disable(),de.bold("Success!")),de.log(),q7(e)}function Zy(t){t.command("telemetry").description("Manage telemetry settings").addArgument(new Bk.Argument("[action]","Action to perform").choices(j7).default(Nk)).action(U7)}var XT=require("proxy-agent"),Ag=oe(rh());var Jy=oe(require("picocolors")),Mk=oe(require("update-check"));var jk=oe(rh()),$7=(0,Mk.default)(jk.default).catch(()=>null);async function Xy(){try{let t=await $7;t!=null&&t.latest&&(de.log(),de.log(Jy.default.yellow(Jy.default.bold("A new version of `create-turbo` is available!"))),de.log()),process.exit()}catch{}}var qa=oe(require("path")),tt=oe(require("picocolors"));var Dt=require("picocolors"),tT=oe(Xu(),1),rT=oe(sc(),1),aT=oe(require("os"),1),uT=oe(_s(),1),FZ=require("fs-extra");var NZ=oe(Cu(),1),jZ=require("fs-extra"),UZ=require("fs-extra"),$Z=require("picocolors"),lT=require("stream"),hT=require("util"),WZ=require("fs-extra"),ZZ=require("picocolors"),XZ=require("fs-extra"),Ti=oe(require("path"),1),hr=oe(require("fs-extra"),1),fT=oe(_s(),1),dT=oe(require("path"),1),pT=oe(require("fs-extra"),1),mT=oe(require("picocolors"),1),un=oe(require("path"),1),yT=oe(_s(),1),Ut=require("fs-extra"),gT=oe(Cu(),1);var Fa=oe(require("path"),1),Oi=oe(require("fs-extra"),1),go=oe(require("path"),1),Fi=oe(require("fs-extra"),1),Pa=oe(require("path"),1),Ii=oe(require("fs-extra"),1),qt=oe(require("picocolors"),1),xT=oe(sc(),1),ST=oe(_s(),1),AT=oe(Xu(),1),DT=require("semver"),CT=oe(require("picocolors"),1),G7=Object.create,tg=Object.defineProperty,z7=Object.getOwnPropertyDescriptor,V7=Object.getOwnPropertyNames,W7=Object.getPrototypeOf,Y7=Object.prototype.hasOwnProperty,_e=(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')}),K7=(t,e)=>()=>(t&&(e=t(t=0)),e),me=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Z7=(t,e)=>{for(var r in e)tg(t,r,{get:e[r],enumerable:!0})},J7=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of V7(e))!Y7.call(t,i)&&i!==r&&tg(t,i,{get:()=>e[i],enumerable:!(n=z7(e,i))||n.enumerable});return t},oh=(t,e,r)=>(r=t!=null?G7(W7(t)):{},J7(e||!t||!t.__esModule?tg(r,"default",{value:t,enumerable:!0}):r,t)),ee=K7(()=>{}),X7=me((t,e)=>{ee();function r(n){return e.exports=r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(i){return typeof i}:function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},e.exports.__esModule=!0,e.exports.default=e.exports,r(n)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports}),Q7=me((t,e)=>{ee();var r=X7().default;function n(){"use strict";e.exports=n=function(){return s},e.exports.__esModule=!0,e.exports.default=e.exports;var i,s={},o=Object.prototype,a=o.hasOwnProperty,u=Object.defineProperty||function(q,g,_){q[g]=_.value},c=typeof Symbol=="function"?Symbol:{},l=c.iterator||"@@iterator",h=c.asyncIterator||"@@asyncIterator",f=c.toStringTag||"@@toStringTag";function d(q,g,_){return Object.defineProperty(q,g,{value:_,enumerable:!0,configurable:!0,writable:!0}),q[g]}try{d({},"")}catch{d=function(q,g,_){return q[g]=_}}function m(q,g,_,v){var k=g&&g.prototype instanceof T?g:T,S=Object.create(k.prototype),H=new G(v||[]);return u(S,"_invoke",{value:te(q,_,H)}),S}function y(q,g,_){try{return{type:"normal",arg:q.call(g,_)}}catch(v){return{type:"throw",arg:v}}}s.wrap=m;var p="suspendedStart",E="suspendedYield",R="executing",P="completed",I={};function T(){}function M(){}function x(){}var D={};d(D,l,function(){return this});var U=Object.getPrototypeOf,V=U&&U(U(Z([])));V&&V!==o&&a.call(V,l)&&(D=V);var N=x.prototype=T.prototype=Object.create(D);function W(q){["next","throw","return"].forEach(function(g){d(q,g,function(_){return this._invoke(g,_)})})}function Q(q,g){function _(k,S,H,$){var ne=y(q[k],q,S);if(ne.type!=="throw"){var Y=ne.arg,fe=Y.value;return fe&&r(fe)=="object"&&a.call(fe,"__await")?g.resolve(fe.__await).then(function(J){_("next",J,H,$)},function(J){_("throw",J,H,$)}):g.resolve(fe).then(function(J){Y.value=J,H(Y)},function(J){return _("throw",J,H,$)})}$(ne.arg)}var v;u(this,"_invoke",{value:function(k,S){function H(){return new g(function($,ne){_(k,S,$,ne)})}return v=v?v.then(H,H):H()}})}function te(q,g,_){var v=p;return function(k,S){if(v===R)throw new Error("Generator is already running");if(v===P){if(k==="throw")throw S;return{value:i,done:!0}}for(_.method=k,_.arg=S;;){var H=_.delegate;if(H){var $=j(H,_);if($){if($===I)continue;return $}}if(_.method==="next")_.sent=_._sent=_.arg;else if(_.method==="throw"){if(v===p)throw v=P,_.arg;_.dispatchException(_.arg)}else _.method==="return"&&_.abrupt("return",_.arg);v=R;var ne=y(q,g,_);if(ne.type==="normal"){if(v=_.done?P:E,ne.arg===I)continue;return{value:ne.arg,done:_.done}}ne.type==="throw"&&(v=P,_.method="throw",_.arg=ne.arg)}}}function j(q,g){var _=g.method,v=q.iterator[_];if(v===i)return g.delegate=null,_==="throw"&&q.iterator.return&&(g.method="return",g.arg=i,j(q,g),g.method==="throw")||_!=="return"&&(g.method="throw",g.arg=new TypeError("The iterator does not provide a '"+_+"' method")),I;var k=y(v,q.iterator,g.arg);if(k.type==="throw")return g.method="throw",g.arg=k.arg,g.delegate=null,I;var S=k.arg;return S?S.done?(g[q.resultName]=S.value,g.next=q.nextLoc,g.method!=="return"&&(g.method="next",g.arg=i),g.delegate=null,I):S:(g.method="throw",g.arg=new TypeError("iterator result is not an object"),g.delegate=null,I)}function F(q){var g={tryLoc:q[0]};1 in q&&(g.catchLoc=q[1]),2 in q&&(g.finallyLoc=q[2],g.afterLoc=q[3]),this.tryEntries.push(g)}function L(q){var g=q.completion||{};g.type="normal",delete g.arg,q.completion=g}function G(q){this.tryEntries=[{tryLoc:"root"}],q.forEach(F,this),this.reset(!0)}function Z(q){if(q||q===""){var g=q[l];if(g)return g.call(q);if(typeof q.next=="function")return q;if(!isNaN(q.length)){var _=-1,v=function k(){for(;++_<q.length;)if(a.call(q,_))return k.value=q[_],k.done=!1,k;return k.value=i,k.done=!0,k};return v.next=v}}throw new TypeError(r(q)+" is not iterable")}return M.prototype=x,u(N,"constructor",{value:x,configurable:!0}),u(x,"constructor",{value:M,configurable:!0}),M.displayName=d(x,f,"GeneratorFunction"),s.isGeneratorFunction=function(q){var g=typeof q=="function"&&q.constructor;return!!g&&(g===M||(g.displayName||g.name)==="GeneratorFunction")},s.mark=function(q){return Object.setPrototypeOf?Object.setPrototypeOf(q,x):(q.__proto__=x,d(q,f,"GeneratorFunction")),q.prototype=Object.create(N),q},s.awrap=function(q){return{__await:q}},W(Q.prototype),d(Q.prototype,h,function(){return this}),s.AsyncIterator=Q,s.async=function(q,g,_,v,k){k===void 0&&(k=Promise);var S=new Q(m(q,g,_,v),k);return s.isGeneratorFunction(g)?S:S.next().then(function(H){return H.done?H.value:S.next()})},W(N),d(N,f,"Generator"),d(N,l,function(){return this}),d(N,"toString",function(){return"[object Generator]"}),s.keys=function(q){var g=Object(q),_=[];for(var v in g)_.push(v);return _.reverse(),function k(){for(;_.length;){var S=_.pop();if(S in g)return k.value=S,k.done=!1,k}return k.done=!0,k}},s.values=Z,G.prototype={constructor:G,reset:function(q){if(this.prev=0,this.next=0,this.sent=this._sent=i,this.done=!1,this.delegate=null,this.method="next",this.arg=i,this.tryEntries.forEach(L),!q)for(var g in this)g.charAt(0)==="t"&&a.call(this,g)&&!isNaN(+g.slice(1))&&(this[g]=i)},stop:function(){this.done=!0;var q=this.tryEntries[0].completion;if(q.type==="throw")throw q.arg;return this.rval},dispatchException:function(q){if(this.done)throw q;var g=this;function _(ne,Y){return S.type="throw",S.arg=q,g.next=ne,Y&&(g.method="next",g.arg=i),!!Y}for(var v=this.tryEntries.length-1;v>=0;--v){var k=this.tryEntries[v],S=k.completion;if(k.tryLoc==="root")return _("end");if(k.tryLoc<=this.prev){var H=a.call(k,"catchLoc"),$=a.call(k,"finallyLoc");if(H&&$){if(this.prev<k.catchLoc)return _(k.catchLoc,!0);if(this.prev<k.finallyLoc)return _(k.finallyLoc)}else if(H){if(this.prev<k.catchLoc)return _(k.catchLoc,!0)}else{if(!$)throw new Error("try statement without catch or finally");if(this.prev<k.finallyLoc)return _(k.finallyLoc)}}}},abrupt:function(q,g){for(var _=this.tryEntries.length-1;_>=0;--_){var v=this.tryEntries[_];if(v.tryLoc<=this.prev&&a.call(v,"finallyLoc")&&this.prev<v.finallyLoc){var k=v;break}}k&&(q==="break"||q==="continue")&&k.tryLoc<=g&&g<=k.finallyLoc&&(k=null);var S=k?k.completion:{};return S.type=q,S.arg=g,k?(this.method="next",this.next=k.finallyLoc,I):this.complete(S)},complete:function(q,g){if(q.type==="throw")throw q.arg;return q.type==="break"||q.type==="continue"?this.next=q.arg:q.type==="return"?(this.rval=this.arg=q.arg,this.method="return",this.next="end"):q.type==="normal"&&g&&(this.next=g),I},finish:function(q){for(var g=this.tryEntries.length-1;g>=0;--g){var _=this.tryEntries[g];if(_.finallyLoc===q)return this.complete(_.completion,_.afterLoc),L(_),I}},catch:function(q){for(var g=this.tryEntries.length-1;g>=0;--g){var _=this.tryEntries[g];if(_.tryLoc===q){var v=_.completion;if(v.type==="throw"){var k=v.arg;L(_)}return k}}throw new Error("illegal catch attempt")},delegateYield:function(q,g,_){return this.delegate={iterator:Z(q),resultName:g,nextLoc:_},this.method==="next"&&(this.arg=i),I}},s}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}),eH=me((t,e)=>{ee();var r=Q7()();e.exports=r;try{regeneratorRuntime=r}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}}),tH=me((t,e)=>{"use strict";ee();var r=(n,...i)=>new Promise(s=>{s(n(...i))});e.exports=r,e.exports.default=r}),rH=me((t,e)=>{"use strict";ee();var r=tH(),n=i=>{if(!((Number.isInteger(i)||i===1/0)&&i>0))return Promise.reject(new TypeError("Expected `concurrency` to be a number from 1 and up"));let s=[],o=0,a=()=>{o--,s.length>0&&s.shift()()},u=(h,f,...d)=>{o++;let m=r(h,...d);f(m),m.then(a,a)},c=(h,f,...d)=>{o<i?u(h,f,...d):s.push(u.bind(null,h,f,...d))},l=(h,...f)=>new Promise(d=>c(h,d,...f));return Object.defineProperties(l,{activeCount:{get:()=>o},pendingCount:{get:()=>s.length},clearQueue:{value:()=>{s.length=0}}}),l};e.exports=n,e.exports.default=n}),nH=me((t,e)=>{"use strict";ee();var r=rH(),n=class extends Error{constructor(a){super(),this.value=a}},i=async(a,u)=>u(await a),s=async a=>{let u=await Promise.all(a);if(u[1]===!0)throw new n(u[0]);return!1},o=async(a,u,c)=>{c={concurrency:1/0,preserveOrder:!0,...c};let l=r(c.concurrency),h=[...a].map(d=>[d,l(i,d,u)]),f=r(c.preserveOrder?1:1/0);try{await Promise.all(h.map(d=>f(s,d)))}catch(d){if(d instanceof n)return d.value;throw d}};e.exports=o,e.exports.default=o}),iH=me((t,e)=>{"use strict";ee();var r=_e("path"),n=_e("fs"),{promisify:i}=_e("util"),s=nH(),o=i(n.stat),a=i(n.lstat),u={directory:"isDirectory",file:"isFile"};function c({type:h}){if(!(h in u))throw new Error(`Invalid type specified: ${h}`)}var l=(h,f)=>h===void 0||f[u[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 m=>{try{let y=await d(r.resolve(f.cwd,m));return l(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?n.statSync:n.lstatSync;for(let m of h)try{let y=d(r.resolve(f.cwd,m));if(l(f.type,y))return m}catch{}}}),sH=me((t,e)=>{"use strict";ee();var r=_e("fs"),{promisify:n}=_e("util"),i=n(r.access);e.exports=async s=>{try{return await i(s),!0}catch{return!1}},e.exports.sync=s=>{try{return r.accessSync(s),!0}catch{return!1}}}),oH=me((t,e)=>{"use strict";ee();var r=_e("path"),n=iH(),i=sH(),s=Symbol("findUp.stop");e.exports=async(o,a={})=>{let u=r.resolve(a.cwd||""),{root:c}=r.parse(u),l=[].concat(o),h=async f=>{if(typeof o!="function")return n(l,f);let d=await o(f.cwd);return typeof d=="string"?n([d],f):d};for(;;){let f=await h({...a,cwd:u});if(f===s)return;if(f)return r.resolve(u,f);if(u===c)return;u=r.dirname(u)}},e.exports.sync=(o,a={})=>{let u=r.resolve(a.cwd||""),{root:c}=r.parse(u),l=[].concat(o),h=f=>{if(typeof o!="function")return n.sync(l,f);let d=o(f.cwd);return typeof d=="string"?n.sync([d],f):d};for(;;){let f=h({...a,cwd:u});if(f===s)return;if(f)return r.resolve(u,f);if(u===c)return;u=r.dirname(u)}},e.exports.exists=i,e.exports.sync.exists=i.sync,e.exports.stop=s}),Ia=me((t,e)=>{"use strict";ee();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=n=>n?Object.keys(n).map(i=>[r.has(i)?r.get(i):i,n[i]]).reduce((i,s)=>(i[s[0]]=s[1],i),Object.create(null)):{}}),rg=me((t,e)=>{"use strict";ee();var r=typeof process=="object"&&process?process:{stdout:null,stderr:null},n=_e("events"),i=_e("stream"),s=_e("string_decoder").StringDecoder,o=Symbol("EOF"),a=Symbol("maybeEmitEnd"),u=Symbol("emittedEnd"),c=Symbol("emittingEnd"),l=Symbol("emittedError"),h=Symbol("closed"),f=Symbol("read"),d=Symbol("flush"),m=Symbol("flushChunk"),y=Symbol("encoding"),p=Symbol("decoder"),E=Symbol("flowing"),R=Symbol("paused"),P=Symbol("resume"),I=Symbol("buffer"),T=Symbol("pipes"),M=Symbol("bufferLength"),x=Symbol("bufferPush"),D=Symbol("bufferShift"),U=Symbol("objectMode"),V=Symbol("destroyed"),N=Symbol("emitData"),W=Symbol("emitEnd"),Q=Symbol("emitEnd2"),te=Symbol("async"),j=k=>Promise.resolve().then(k),F=global._MP_NO_ITERATOR_SYMBOLS_!=="1",L=F&&Symbol.asyncIterator||Symbol("asyncIterator not implemented"),G=F&&Symbol.iterator||Symbol("iterator not implemented"),Z=k=>k==="end"||k==="finish"||k==="prefinish",q=k=>k instanceof ArrayBuffer||typeof k=="object"&&k.constructor&&k.constructor.name==="ArrayBuffer"&&k.byteLength>=0,g=k=>!Buffer.isBuffer(k)&&ArrayBuffer.isView(k),_=class{constructor(k,S,H){this.src=k,this.dest=S,this.opts=H,this.ondrain=()=>k[P](),S.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},v=class extends _{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(k,S,H){super(k,S,H),this.proxyErrors=$=>S.emit("error",$),k.on("error",this.proxyErrors)}};e.exports=class Hk extends i{constructor(S){super(),this[E]=!1,this[R]=!1,this[T]=[],this[I]=[],this[U]=S&&S.objectMode||!1,this[U]?this[y]=null:this[y]=S&&S.encoding||null,this[y]==="buffer"&&(this[y]=null),this[te]=S&&!!S.async||!1,this[p]=this[y]?new s(this[y]):null,this[o]=!1,this[u]=!1,this[c]=!1,this[h]=!1,this[l]=null,this.writable=!0,this.readable=!0,this[M]=0,this[V]=!1,S&&S.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[I]}),S&&S.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[T]})}get bufferLength(){return this[M]}get encoding(){return this[y]}set encoding(S){if(this[U])throw new Error("cannot set encoding in objectMode");if(this[y]&&S!==this[y]&&(this[p]&&this[p].lastNeed||this[M]))throw new Error("cannot change encoding");this[y]!==S&&(this[p]=S?new s(S):null,this[I].length&&(this[I]=this[I].map(H=>this[p].write(H)))),this[y]=S}setEncoding(S){this.encoding=S}get objectMode(){return this[U]}set objectMode(S){this[U]=this[U]||!!S}get async(){return this[te]}set async(S){this[te]=this[te]||!!S}write(S,H,$){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 H=="function"&&($=H,H="utf8"),H||(H="utf8");let ne=this[te]?j:Y=>Y();return!this[U]&&!Buffer.isBuffer(S)&&(g(S)?S=Buffer.from(S.buffer,S.byteOffset,S.byteLength):q(S)?S=Buffer.from(S):typeof S!="string"&&(this.objectMode=!0)),this[U]?(this.flowing&&this[M]!==0&&this[d](!0),this.flowing?this.emit("data",S):this[x](S),this[M]!==0&&this.emit("readable"),$&&ne($),this.flowing):S.length?(typeof S=="string"&&!(H===this[y]&&!this[p].lastNeed)&&(S=Buffer.from(S,H)),Buffer.isBuffer(S)&&this[y]&&(S=this[p].write(S)),this.flowing&&this[M]!==0&&this[d](!0),this.flowing?this.emit("data",S):this[x](S),this[M]!==0&&this.emit("readable"),$&&ne($),this.flowing):(this[M]!==0&&this.emit("readable"),$&&ne($),this.flowing)}read(S){if(this[V])return null;if(this[M]===0||S===0||S>this[M])return this[a](),null;this[U]&&(S=null),this[I].length>1&&!this[U]&&(this.encoding?this[I]=[this[I].join("")]:this[I]=[Buffer.concat(this[I],this[M])]);let H=this[f](S||null,this[I][0]);return this[a](),H}[f](S,H){return S===H.length||S===null?this[D]():(this[I][0]=H.slice(S),H=H.slice(0,S),this[M]-=S),this.emit("data",H),!this[I].length&&!this[o]&&this.emit("drain"),H}end(S,H,$){return typeof S=="function"&&($=S,S=null),typeof H=="function"&&($=H,H="utf8"),S&&this.write(S,H),$&&this.once("end",$),this[o]=!0,this.writable=!1,(this.flowing||!this[R])&&this[a](),this}[P](){this[V]||(this[R]=!1,this[E]=!0,this.emit("resume"),this[I].length?this[d]():this[o]?this[a]():this.emit("drain"))}resume(){return this[P]()}pause(){this[E]=!1,this[R]=!0}get destroyed(){return this[V]}get flowing(){return this[E]}get paused(){return this[R]}[x](S){this[U]?this[M]+=1:this[M]+=S.length,this[I].push(S)}[D](){return this[I].length&&(this[U]?this[M]-=1:this[M]-=this[I][0].length),this[I].shift()}[d](S){do;while(this[m](this[D]()));!S&&!this[I].length&&!this[o]&&this.emit("drain")}[m](S){return S?(this.emit("data",S),this.flowing):!1}pipe(S,H){if(this[V])return;let $=this[u];return H=H||{},S===r.stdout||S===r.stderr?H.end=!1:H.end=H.end!==!1,H.proxyErrors=!!H.proxyErrors,$?H.end&&S.end():(this[T].push(H.proxyErrors?new v(this,S,H):new _(this,S,H)),this[te]?j(()=>this[P]()):this[P]()),S}unpipe(S){let H=this[T].find($=>$.dest===S);H&&(this[T].splice(this[T].indexOf(H),1),H.unpipe())}addListener(S,H){return this.on(S,H)}on(S,H){let $=super.on(S,H);return S==="data"&&!this[T].length&&!this.flowing?this[P]():S==="readable"&&this[M]!==0?super.emit("readable"):Z(S)&&this[u]?(super.emit(S),this.removeAllListeners(S)):S==="error"&&this[l]&&(this[te]?j(()=>H.call(this,this[l])):H.call(this,this[l])),$}get emittedEnd(){return this[u]}[a](){!this[c]&&!this[u]&&!this[V]&&this[I].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(S,H,...$){if(S!=="error"&&S!=="close"&&S!==V&&this[V])return;if(S==="data")return H?this[te]?j(()=>this[N](H)):this[N](H):!1;if(S==="end")return this[W]();if(S==="close"){if(this[h]=!0,!this[u]&&!this[V])return;let Y=super.emit("close");return this.removeAllListeners("close"),Y}else if(S==="error"){this[l]=H;let Y=super.emit("error",H);return this[a](),Y}else if(S==="resume"){let Y=super.emit("resume");return this[a](),Y}else if(S==="finish"||S==="prefinish"){let Y=super.emit(S);return this.removeAllListeners(S),Y}let ne=super.emit(S,H,...$);return this[a](),ne}[N](S){for(let $ of this[T])$.dest.write(S)===!1&&this.pause();let H=super.emit("data",S);return this[a](),H}[W](){this[u]||(this[u]=!0,this.readable=!1,this[te]?j(()=>this[Q]()):this[Q]())}[Q](){if(this[p]){let H=this[p].end();if(H){for(let $ of this[T])$.dest.write(H);super.emit("data",H)}}for(let H of this[T])H.end();let S=super.emit("end");return this.removeAllListeners("end"),S}collect(){let S=[];this[U]||(S.dataLength=0);let H=this.promise();return this.on("data",$=>{S.push($),this[U]||(S.dataLength+=$.length)}),H.then(()=>S)}concat(){return this[U]?Promise.reject(new Error("cannot concat in objectMode")):this.collect().then(S=>this[U]?Promise.reject(new Error("cannot concat in objectMode")):this[y]?S.join(""):Buffer.concat(S,S.dataLength))}promise(){return new Promise((S,H)=>{this.on(V,()=>H(new Error("stream destroyed"))),this.on("error",$=>H($)),this.on("end",()=>S())})}[L](){return{next:()=>{let S=this.read();if(S!==null)return Promise.resolve({done:!1,value:S});if(this[o])return Promise.resolve({done:!0});let H=null,$=null,ne=w=>{this.removeListener("data",Y),this.removeListener("end",fe),$(w)},Y=w=>{this.removeListener("error",ne),this.removeListener("end",fe),this.pause(),H({value:w,done:!!this[o]})},fe=()=>{this.removeListener("error",ne),this.removeListener("data",Y),H({done:!0})},J=()=>ne(new Error("stream destroyed"));return new Promise((w,B)=>{$=B,H=w,this.once(V,J),this.once("error",ne),this.once("end",fe),this.once("data",Y)})}}}[G](){return{next:()=>{let S=this.read();return{value:S,done:S===null}}}}destroy(S){return this[V]?(S?this.emit("error",S):this.emit(V),this):(this[V]=!0,this[I].length=0,this[M]=0,typeof this.close=="function"&&!this[h]&&this.close(),S?this.emit("error",S):this.emit(V),this)}static isStream(S){return!!S&&(S instanceof Hk||S instanceof i||S instanceof n&&(typeof S.pipe=="function"||typeof S.write=="function"&&typeof S.end=="function"))}}}),aH=me((t,e)=>{ee();var r=_e("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))}),$k=me((t,e)=>{"use strict";ee();var r=typeof process=="object"&&process?process:{stdout:null,stderr:null},n=_e("events"),i=_e("stream"),s=_e("string_decoder").StringDecoder,o=Symbol("EOF"),a=Symbol("maybeEmitEnd"),u=Symbol("emittedEnd"),c=Symbol("emittingEnd"),l=Symbol("emittedError"),h=Symbol("closed"),f=Symbol("read"),d=Symbol("flush"),m=Symbol("flushChunk"),y=Symbol("encoding"),p=Symbol("decoder"),E=Symbol("flowing"),R=Symbol("paused"),P=Symbol("resume"),I=Symbol("bufferLength"),T=Symbol("bufferPush"),M=Symbol("bufferShift"),x=Symbol("objectMode"),D=Symbol("destroyed"),U=Symbol("emitData"),V=Symbol("emitEnd"),N=Symbol("emitEnd2"),W=Symbol("async"),Q=_=>Promise.resolve().then(_),te=global._MP_NO_ITERATOR_SYMBOLS_!=="1",j=te&&Symbol.asyncIterator||Symbol("asyncIterator not implemented"),F=te&&Symbol.iterator||Symbol("iterator not implemented"),L=_=>_==="end"||_==="finish"||_==="prefinish",G=_=>_ instanceof ArrayBuffer||typeof _=="object"&&_.constructor&&_.constructor.name==="ArrayBuffer"&&_.byteLength>=0,Z=_=>!Buffer.isBuffer(_)&&ArrayBuffer.isView(_),q=class{constructor(_,v,k){this.src=_,this.dest=v,this.opts=k,this.ondrain=()=>_[P](),v.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},g=class extends q{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(_,v,k){super(_,v,k),this.proxyErrors=S=>v.emit("error",S),_.on("error",this.proxyErrors)}};e.exports=class Gk extends i{constructor(v){super(),this[E]=!1,this[R]=!1,this.pipes=[],this.buffer=[],this[x]=v&&v.objectMode||!1,this[x]?this[y]=null:this[y]=v&&v.encoding||null,this[y]==="buffer"&&(this[y]=null),this[W]=v&&!!v.async||!1,this[p]=this[y]?new s(this[y]):null,this[o]=!1,this[u]=!1,this[c]=!1,this[h]=!1,this[l]=null,this.writable=!0,this.readable=!0,this[I]=0,this[D]=!1}get bufferLength(){return this[I]}get encoding(){return this[y]}set encoding(v){if(this[x])throw new Error("cannot set encoding in objectMode");if(this[y]&&v!==this[y]&&(this[p]&&this[p].lastNeed||this[I]))throw new Error("cannot change encoding");this[y]!==v&&(this[p]=v?new s(v):null,this.buffer.length&&(this.buffer=this.buffer.map(k=>this[p].write(k)))),this[y]=v}setEncoding(v){this.encoding=v}get objectMode(){return this[x]}set objectMode(v){this[x]=this[x]||!!v}get async(){return this[W]}set async(v){this[W]=this[W]||!!v}write(v,k,S){if(this[o])throw new Error("write after end");if(this[D])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof k=="function"&&(S=k,k="utf8"),k||(k="utf8");let H=this[W]?Q:$=>$();return!this[x]&&!Buffer.isBuffer(v)&&(Z(v)?v=Buffer.from(v.buffer,v.byteOffset,v.byteLength):G(v)?v=Buffer.from(v):typeof v!="string"&&(this.objectMode=!0)),this[x]?(this.flowing&&this[I]!==0&&this[d](!0),this.flowing?this.emit("data",v):this[T](v),this[I]!==0&&this.emit("readable"),S&&H(S),this.flowing):v.length?(typeof v=="string"&&!(k===this[y]&&!this[p].lastNeed)&&(v=Buffer.from(v,k)),Buffer.isBuffer(v)&&this[y]&&(v=this[p].write(v)),this.flowing&&this[I]!==0&&this[d](!0),this.flowing?this.emit("data",v):this[T](v),this[I]!==0&&this.emit("readable"),S&&H(S),this.flowing):(this[I]!==0&&this.emit("readable"),S&&H(S),this.flowing)}read(v){if(this[D])return null;if(this[I]===0||v===0||v>this[I])return this[a](),null;this[x]&&(v=null),this.buffer.length>1&&!this[x]&&(this.encoding?this.buffer=[this.buffer.join("")]:this.buffer=[Buffer.concat(this.buffer,this[I])]);let k=this[f](v||null,this.buffer[0]);return this[a](),k}[f](v,k){return v===k.length||v===null?this[M]():(this.buffer[0]=k.slice(v),k=k.slice(0,v),this[I]-=v),this.emit("data",k),!this.buffer.length&&!this[o]&&this.emit("drain"),k}end(v,k,S){return typeof v=="function"&&(S=v,v=null),typeof k=="function"&&(S=k,k="utf8"),v&&this.write(v,k),S&&this.once("end",S),this[o]=!0,this.writable=!1,(this.flowing||!this[R])&&this[a](),this}[P](){this[D]||(this[R]=!1,this[E]=!0,this.emit("resume"),this.buffer.length?this[d]():this[o]?this[a]():this.emit("drain"))}resume(){return this[P]()}pause(){this[E]=!1,this[R]=!0}get destroyed(){return this[D]}get flowing(){return this[E]}get paused(){return this[R]}[T](v){this[x]?this[I]+=1:this[I]+=v.length,this.buffer.push(v)}[M](){return this.buffer.length&&(this[x]?this[I]-=1:this[I]-=this.buffer[0].length),this.buffer.shift()}[d](v){do;while(this[m](this[M]()));!v&&!this.buffer.length&&!this[o]&&this.emit("drain")}[m](v){return v?(this.emit("data",v),this.flowing):!1}pipe(v,k){if(this[D])return;let S=this[u];return k=k||{},v===r.stdout||v===r.stderr?k.end=!1:k.end=k.end!==!1,k.proxyErrors=!!k.proxyErrors,S?k.end&&v.end():(this.pipes.push(k.proxyErrors?new g(this,v,k):new q(this,v,k)),this[W]?Q(()=>this[P]()):this[P]()),v}unpipe(v){let k=this.pipes.find(S=>S.dest===v);k&&(this.pipes.splice(this.pipes.indexOf(k),1),k.unpipe())}addListener(v,k){return this.on(v,k)}on(v,k){let S=super.on(v,k);return v==="data"&&!this.pipes.length&&!this.flowing?this[P]():v==="readable"&&this[I]!==0?super.emit("readable"):L(v)&&this[u]?(super.emit(v),this.removeAllListeners(v)):v==="error"&&this[l]&&(this[W]?Q(()=>k.call(this,this[l])):k.call(this,this[l])),S}get emittedEnd(){return this[u]}[a](){!this[c]&&!this[u]&&!this[D]&&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(v,k,...S){if(v!=="error"&&v!=="close"&&v!==D&&this[D])return;if(v==="data")return k?this[W]?Q(()=>this[U](k)):this[U](k):!1;if(v==="end")return this[V]();if(v==="close"){if(this[h]=!0,!this[u]&&!this[D])return;let $=super.emit("close");return this.removeAllListeners("close"),$}else if(v==="error"){this[l]=k;let $=super.emit("error",k);return this[a](),$}else if(v==="resume"){let $=super.emit("resume");return this[a](),$}else if(v==="finish"||v==="prefinish"){let $=super.emit(v);return this.removeAllListeners(v),$}let H=super.emit(v,k,...S);return this[a](),H}[U](v){for(let S of this.pipes)S.dest.write(v)===!1&&this.pause();let k=super.emit("data",v);return this[a](),k}[V](){this[u]||(this[u]=!0,this.readable=!1,this[W]?Q(()=>this[N]()):this[N]())}[N](){if(this[p]){let k=this[p].end();if(k){for(let S of this.pipes)S.dest.write(k);super.emit("data",k)}}for(let k of this.pipes)k.end();let v=super.emit("end");return this.removeAllListeners("end"),v}collect(){let v=[];this[x]||(v.dataLength=0);let k=this.promise();return this.on("data",S=>{v.push(S),this[x]||(v.dataLength+=S.length)}),k.then(()=>v)}concat(){return this[x]?Promise.reject(new Error("cannot concat in objectMode")):this.collect().then(v=>this[x]?Promise.reject(new Error("cannot concat in objectMode")):this[y]?v.join(""):Buffer.concat(v,v.dataLength))}promise(){return new Promise((v,k)=>{this.on(D,()=>k(new Error("stream destroyed"))),this.on("error",S=>k(S)),this.on("end",()=>v())})}[j](){return{next:()=>{let v=this.read();if(v!==null)return Promise.resolve({done:!1,value:v});if(this[o])return Promise.resolve({done:!0});let k=null,S=null,H=fe=>{this.removeListener("data",$),this.removeListener("end",ne),S(fe)},$=fe=>{this.removeListener("error",H),this.removeListener("end",ne),this.pause(),k({value:fe,done:!!this[o]})},ne=()=>{this.removeListener("error",H),this.removeListener("data",$),k({done:!0})},Y=()=>H(new Error("stream destroyed"));return new Promise((fe,J)=>{S=J,k=fe,this.once(D,Y),this.once("error",H),this.once("end",ne),this.once("data",$)})}}}[F](){return{next:()=>{let v=this.read();return{value:v,done:v===null}}}}destroy(v){return this[D]?(v?this.emit("error",v):this.emit(D),this):(this[D]=!0,this.buffer.length=0,this[I]=0,typeof this.close=="function"&&!this[h]&&this.close(),v?this.emit("error",v):this.emit(D),this)}static isStream(v){return!!v&&(v instanceof Gk||v instanceof i||v instanceof n&&(typeof v.pipe=="function"||typeof v.write=="function"&&typeof v.end=="function"))}}}),zk=me(t=>{"use strict";ee();var e=_e("assert"),r=_e("buffer").Buffer,n=_e("zlib"),i=t.constants=aH(),s=$k(),o=r.concat,a=Symbol("_superWrite"),u=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"),l=Symbol("flushFlag"),h=Symbol("finishFlushFlag"),f=Symbol("fullFlushFlag"),d=Symbol("handle"),m=Symbol("onError"),y=Symbol("sawError"),p=Symbol("level"),E=Symbol("strategy"),R=Symbol("ended"),P=Symbol("_defaultFullFlush"),I=class extends s{constructor(L,G){if(!L||typeof L!="object")throw new TypeError("invalid options for ZlibBase constructor");super(L),this[y]=!1,this[R]=!1,this[c]=L,this[l]=L.flush,this[h]=L.finishFlush;try{this[d]=new n[G](L)}catch(Z){throw new u(Z)}this[m]=Z=>{this[y]||(this[y]=!0,this.close(),this.emit("error",Z))},this[d].on("error",Z=>this[m](new u(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),{[l]:L})))}end(L,G,Z){return L&&this.write(L,G),this.flush(this[h]),this[R]=!0,super.end(null,null,Z)}get ended(){return this[R]}write(L,G,Z){if(typeof G=="function"&&(Z=G,G="utf8"),typeof L=="string"&&(L=r.from(L,G)),this[y])return;e(this[d],"zlib binding closed");let q=this[d]._handle,g=q.close;q.close=()=>{};let _=this[d].close;this[d].close=()=>{},r.concat=S=>S;let v;try{let S=typeof L[l]=="number"?L[l]:this[l];v=this[d]._processChunk(L,S),r.concat=o}catch(S){r.concat=o,this[m](new u(S))}finally{this[d]&&(this[d]._handle=q,q.close=g,this[d].close=_,this[d].removeAllListeners("error"))}this[d]&&this[d].on("error",S=>this[m](new u(S)));let k;if(v)if(Array.isArray(v)&&v.length>0){k=this[a](r.from(v[0]));for(let S=1;S<v.length;S++)k=this[a](v[S])}else k=this[a](r.from(v));return Z&&Z(),k}[a](L){return super.write(L)}},T=class extends I{constructor(L,G){L=L||{},L.flush=L.flush||i.Z_NO_FLUSH,L.finishFlush=L.finishFlush||i.Z_FINISH,super(L,G),this[f]=i.Z_FULL_FLUSH,this[p]=L.level,this[E]=L.strategy}params(L,G){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[p]!==L||this[E]!==G){this.flush(i.Z_SYNC_FLUSH),e(this[d],"zlib binding closed");let Z=this[d].flush;this[d].flush=(q,g)=>{this.flush(q),g()};try{this[d].params(L,G)}finally{this[d].flush=Z}this[d]&&(this[p]=L,this[E]=G)}}}},M=class extends T{constructor(L){super(L,"Deflate")}},x=class extends T{constructor(L){super(L,"Inflate")}},D=Symbol("_portable"),U=class extends T{constructor(L){super(L,"Gzip"),this[D]=L&&!!L.portable}[a](L){return this[D]?(this[D]=!1,L[9]=255,super[a](L)):super[a](L)}},V=class extends T{constructor(L){super(L,"Gunzip")}},N=class extends T{constructor(L){super(L,"DeflateRaw")}},W=class extends T{constructor(L){super(L,"InflateRaw")}},Q=class extends T{constructor(L){super(L,"Unzip")}},te=class extends I{constructor(L,G){L=L||{},L.flush=L.flush||i.BROTLI_OPERATION_PROCESS,L.finishFlush=L.finishFlush||i.BROTLI_OPERATION_FINISH,super(L,G),this[f]=i.BROTLI_OPERATION_FLUSH}},j=class extends te{constructor(L){super(L,"BrotliCompress")}},F=class extends te{constructor(L){super(L,"BrotliDecompress")}};t.Deflate=M,t.Inflate=x,t.Gzip=U,t.Gunzip=V,t.DeflateRaw=N,t.InflateRaw=W,t.Unzip=Q,typeof n.BrotliCompress=="function"?(t.BrotliCompress=j,t.BrotliDecompress=F):t.BrotliCompress=t.BrotliDecompress=class{constructor(){throw new Error("Brotli is not supported in this version of Node.js")}}}),La=me((t,e)=>{ee();var r=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform;e.exports=r!=="win32"?n=>n:n=>n&&n.replace(/\\/g,"/")}),ng=me((t,e)=>{"use strict";ee();var r=rg(),n=La(),i=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=n(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=n(s.linkpath),this.uname=s.uname,this.gname=s.gname,o&&this[i](o),a&&this[i](a,!0)}write(s){let o=s.length;if(o>this.blockRemain)throw new Error("writing more to entry than is appropriate");let a=this.remain,u=this.blockRemain;return this.remain=Math.max(0,a-o),this.blockRemain=Math.max(0,u-o),this.ignore?!0:a>=o?super.write(s):super.write(s.slice(0,a))}[i](s,o){for(let a in s)s[a]!==null&&s[a]!==void 0&&!(o&&a==="path")&&(this[a]=a==="path"||a==="linkpath"?n(s[a]):s[a])}}}),Vk=me(t=>{"use strict";ee(),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]]))}),uH=me((t,e)=>{"use strict";ee();var r=(l,h)=>{if(Number.isSafeInteger(l))l<0?i(l,h):n(l,h);else throw Error("cannot encode number outside of javascript safe integer range");return h},n=(l,h)=>{h[0]=128;for(var f=h.length;f>1;f--)h[f-1]=l&255,l=Math.floor(l/256)},i=(l,h)=>{h[0]=255;var f=!1;l=l*-1;for(var d=h.length;d>1;d--){var m=l&255;l=Math.floor(l/256),f?h[d-1]=u(m):m===0?h[d-1]=0:(f=!0,h[d-1]=c(m))}},s=l=>{let h=l[0],f=h===128?a(l.slice(1,l.length)):h===255?o(l):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=l=>{for(var h=l.length,f=0,d=!1,m=h-1;m>-1;m--){var y=l[m],p;d?p=u(y):y===0?p=y:(d=!0,p=c(y)),p!==0&&(f-=p*Math.pow(256,h-m-1))}return f},a=l=>{for(var h=l.length,f=0,d=h-1;d>-1;d--){var m=l[d];m!==0&&(f+=m*Math.pow(256,h-d-1))}return f},u=l=>(255^l)&255,c=l=>(255^l)+1&255;e.exports={encode:r,parse:s}}),Ba=me((t,e)=>{"use strict";ee();var r=Vk(),n=_e("path").posix,i=uH(),s=Symbol("slurp"),o=Symbol("type"),a=class{constructor(x,D,U,V){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(x)?this.decode(x,D||0,U,V):x&&this.set(x)}decode(x,D,U,V){if(D||(D=0),!x||!(x.length>=D+512))throw new Error("need 512 bytes for header");if(this.path=c(x,D,100),this.mode=f(x,D+100,8),this.uid=f(x,D+108,8),this.gid=f(x,D+116,8),this.size=f(x,D+124,12),this.mtime=l(x,D+136,12),this.cksum=f(x,D+148,12),this[s](U),this[s](V,!0),this[o]=c(x,D+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(x,D+157,100),x.slice(D+257,D+265).toString()==="ustar\x0000")if(this.uname=c(x,D+265,32),this.gname=c(x,D+297,32),this.devmaj=f(x,D+329,8),this.devmin=f(x,D+337,8),x[D+475]!==0){let W=c(x,D+345,155);this.path=W+"/"+this.path}else{let W=c(x,D+345,130);W&&(this.path=W+"/"+this.path),this.atime=l(x,D+476,12),this.ctime=l(x,D+488,12)}let N=8*32;for(let W=D;W<D+148;W++)N+=x[W];for(let W=D+156;W<D+512;W++)N+=x[W];this.cksumValid=N===this.cksum,this.cksum===null&&N===8*32&&(this.nullBlock=!0)}[s](x,D){for(let U in x)x[U]!==null&&x[U]!==void 0&&!(D&&U==="path")&&(this[U]=x[U])}encode(x,D){if(x||(x=this.block=Buffer.alloc(512),D=0),D||(D=0),!(x.length>=D+512))throw new Error("need 512 bytes for header");let U=this.ctime||this.atime?130:155,V=u(this.path||"",U),N=V[0],W=V[1];this.needPax=V[2],this.needPax=M(x,D,100,N)||this.needPax,this.needPax=p(x,D+100,8,this.mode)||this.needPax,this.needPax=p(x,D+108,8,this.uid)||this.needPax,this.needPax=p(x,D+116,8,this.gid)||this.needPax,this.needPax=p(x,D+124,12,this.size)||this.needPax,this.needPax=I(x,D+136,12,this.mtime)||this.needPax,x[D+156]=this[o].charCodeAt(0),this.needPax=M(x,D+157,100,this.linkpath)||this.needPax,x.write("ustar\x0000",D+257,8),this.needPax=M(x,D+265,32,this.uname)||this.needPax,this.needPax=M(x,D+297,32,this.gname)||this.needPax,this.needPax=p(x,D+329,8,this.devmaj)||this.needPax,this.needPax=p(x,D+337,8,this.devmin)||this.needPax,this.needPax=M(x,D+345,U,W)||this.needPax,x[D+475]!==0?this.needPax=M(x,D+345,155,W)||this.needPax:(this.needPax=M(x,D+345,130,W)||this.needPax,this.needPax=I(x,D+476,12,this.atime)||this.needPax,this.needPax=I(x,D+488,12,this.ctime)||this.needPax);let Q=8*32;for(let te=D;te<D+148;te++)Q+=x[te];for(let te=D+156;te<D+512;te++)Q+=x[te];return this.cksum=Q,p(x,D+148,8,this.cksum),this.cksumValid=!0,this.needPax}set(x){for(let D in x)x[D]!==null&&x[D]!==void 0&&(this[D]=x[D])}get type(){return r.name.get(this[o])||this[o]}get typeKey(){return this[o]}set type(x){r.code.has(x)?this[o]=r.code.get(x):this[o]=x}},u=(x,D)=>{let U=x,V="",N,W=n.parse(x).root||".";if(Buffer.byteLength(U)<100)N=[U,V,!1];else{V=n.dirname(U),U=n.basename(U);do Buffer.byteLength(U)<=100&&Buffer.byteLength(V)<=D?N=[U,V,!1]:Buffer.byteLength(U)>100&&Buffer.byteLength(V)<=D?N=[U.slice(0,100-1),V,!0]:(U=n.join(n.basename(V),U),V=n.dirname(V));while(V!==W&&!N);N||(N=[x.slice(0,100-1),"",!0])}return N},c=(x,D,U)=>x.slice(D,D+U).toString("utf8").replace(/\0.*/,""),l=(x,D,U)=>h(f(x,D,U)),h=x=>x===null?null:new Date(x*1e3),f=(x,D,U)=>x[D]&128?i.parse(x.slice(D,D+U)):m(x,D,U),d=x=>isNaN(x)?null:x,m=(x,D,U)=>d(parseInt(x.slice(D,D+U).toString("utf8").replace(/\0.*$/,"").trim(),8)),y={12:8589934591,8:2097151},p=(x,D,U,V)=>V===null?!1:V>y[U]||V<0?(i.encode(V,x.slice(D,D+U)),!0):(E(x,D,U,V),!1),E=(x,D,U,V)=>x.write(R(V,U),D,U,"ascii"),R=(x,D)=>P(Math.floor(x).toString(8),D),P=(x,D)=>(x.length===D-1?x:new Array(D-x.length-1).join("0")+x+" ")+"\0",I=(x,D,U,V)=>V===null?!1:p(x,D,U,V.getTime()/1e3),T=new Array(156).join("\0"),M=(x,D,U,V)=>V===null?!1:(x.write(V+T,D,U,"utf8"),V.length!==Buffer.byteLength(V)||V.length>U);e.exports=a}),ig=me((t,e)=>{"use strict";ee();var r=Ba(),n=_e("path"),i=class{constructor(u,c){this.atime=u.atime||null,this.charset=u.charset||null,this.comment=u.comment||null,this.ctime=u.ctime||null,this.gid=u.gid||null,this.gname=u.gname||null,this.linkpath=u.linkpath||null,this.mtime=u.mtime||null,this.path=u.path||null,this.size=u.size||null,this.uid=u.uid||null,this.uname=u.uname||null,this.dev=u.dev||null,this.ino=u.ino||null,this.nlink=u.nlink||null,this.global=c||!1}encode(){let u=this.encodeBody();if(u==="")return null;let c=Buffer.byteLength(u),l=512*Math.ceil(1+c/512),h=Buffer.allocUnsafe(l);for(let f=0;f<512;f++)h[f]=0;new r({path:("PaxHeader/"+n.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(u,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(u){if(this[u]===null||this[u]===void 0)return"";let c=this[u]instanceof Date?this[u].getTime()/1e3:this[u],l=" "+(u==="dev"||u==="ino"||u==="nlink"?"SCHILY.":"")+u+"="+c+`
|
63
|
+
`,"2. You might not be connected to the internet or you are behind a proxy."),process.exit(1))}let o=Qs.default.resolve(t);await Py(Qs.default.dirname(o))||(Tt("The application path is not writable, please check folder permissions and try again."),Tt("It is likely you do not have write permissions for this folder."),process.exit(1));let a=Qs.default.basename(o);try{await Kl.default.mkdir(o,{recursive:!0})}catch(p){Tt("Unable to create project directory"),Tt(p),process.exit(1)}let{isEmpty:u,conflicts:c}=Yo(o);u||(Tt(`${gi.default.dim(o)} has ${c.length} conflicting ${c.length===1?"file":"files"} - please try a different location`),process.exit(1));let l=process.cwd();process.chdir(o),jr();let h=fp("Downloading files... (This might take a moment)");try{!r&&i?(h.start(),await(0,Iy.default)(()=>Ty(o,i),{retries:3})):(h.start(),await(0,Iy.default)(()=>Oy(o,e),{retries:3}))}catch(p){throw new eo(gU(p)?p.message:String(p))}finally{h.stop()}let f=Qs.default.join(o,"package.json"),d=Kl.default.existsSync(f),m=[];if(d){let p;try{p=Kl.default.readJsonSync(f)}catch{}p&&m.push(...Object.keys(p.scripts||{}))}let y=t;return Qs.default.join(l,a)===t&&(y=a),{cdPath:y,hasPackageJson:d,availableScripts:m,repoInfo:i}}var ho=require("fs"),Wy=require("crypto");var kk=oe(require("picocolors"));var Te;(function(t){t.assertEqual=i=>i;function e(i){}t.assertIs=e;function r(i){throw new Error}t.assertNever=r,t.arrayToEnum=i=>{let s={};for(let o of i)s[o]=o;return s},t.getValidEnumValues=i=>{let s=t.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),o={};for(let a of s)o[a]=i[a];return t.objectValues(o)},t.objectValues=i=>t.objectKeys(i).map(function(s){return i[s]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let s=[];for(let o in i)Object.prototype.hasOwnProperty.call(i,o)&&s.push(o);return s},t.find=(i,s)=>{for(let o of i)if(s(o))return o},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function n(i,s=" | "){return i.map(o=>typeof o=="string"?`'${o}'`:o).join(s)}t.joinValues=n,t.jsonStringifyReplacer=(i,s)=>typeof s=="bigint"?s.toString():s})(Te||(Te={}));var Ny;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(Ny||(Ny={}));var ae=Te.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Nn=t=>{switch(typeof t){case"undefined":return ae.undefined;case"string":return ae.string;case"number":return isNaN(t)?ae.nan:ae.number;case"boolean":return ae.boolean;case"function":return ae.function;case"bigint":return ae.bigint;case"symbol":return ae.symbol;case"object":return Array.isArray(t)?ae.array:t===null?ae.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?ae.promise:typeof Map!="undefined"&&t instanceof Map?ae.map:typeof Set!="undefined"&&t instanceof Set?ae.set:typeof Date!="undefined"&&t instanceof Date?ae.date:ae.object;default:return ae.unknown}},ie=Te.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),_U=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),Bt=class extends Error{constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){let r=e||function(s){return s.message},n={_errors:[]},i=s=>{for(let o of s.issues)if(o.code==="invalid_union")o.unionErrors.map(i);else if(o.code==="invalid_return_type")i(o.returnTypeError);else if(o.code==="invalid_arguments")i(o.argumentsError);else if(o.path.length===0)n._errors.push(r(o));else{let a=n,u=0;for(;u<o.path.length;){let c=o.path[u];u===o.path.length-1?(a[c]=a[c]||{_errors:[]},a[c]._errors.push(r(o))):a[c]=a[c]||{_errors:[]},a=a[c],u++}}};return i(this),n}toString(){return this.message}get message(){return JSON.stringify(this.issues,Te.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},n=[];for(let i of this.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(e(i))):n.push(e(i));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};Bt.create=t=>new Bt(t);var Da=(t,e)=>{let r;switch(t.code){case ie.invalid_type:t.received===ae.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case ie.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,Te.jsonStringifyReplacer)}`;break;case ie.unrecognized_keys:r=`Unrecognized key(s) in object: ${Te.joinValues(t.keys,", ")}`;break;case ie.invalid_union:r="Invalid input";break;case ie.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Te.joinValues(t.options)}`;break;case ie.invalid_enum_value:r=`Invalid enum value. Expected ${Te.joinValues(t.options)}, received '${t.received}'`;break;case ie.invalid_arguments:r="Invalid function arguments";break;case ie.invalid_return_type:r="Invalid function return type";break;case ie.invalid_date:r="Invalid date";break;case ie.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:Te.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case ie.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case ie.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case ie.custom:r="Invalid input";break;case ie.invalid_intersection_types:r="Intersection results could not be merged";break;case ie.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case ie.not_finite:r="Number must be finite";break;default:r=e.defaultError,Te.assertNever(t)}return{message:r}},hk=Da;function bU(t){hk=t}function Jl(){return hk}var Xl=t=>{let{data:e,path:r,errorMaps:n,issueData:i}=t,s=[...r,...i.path||[]],o={...i,path:s},a="",u=n.filter(c=>!!c).slice().reverse();for(let c of u)a=c(o,{data:e,defaultError:a}).message;return{...i,path:s,message:i.message||a}},vU=[];function ue(t,e){let r=Xl({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Jl(),Da].filter(n=>!!n)});t.common.issues.push(r)}var et=class{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let n=[];for(let i of r){if(i.status==="aborted")return Ee;i.status==="dirty"&&e.dirty(),n.push(i.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){let n=[];for(let i of r)n.push({key:await i.key,value:await i.value});return et.mergeObjectSync(e,n)}static mergeObjectSync(e,r){let n={};for(let i of r){let{key:s,value:o}=i;if(s.status==="aborted"||o.status==="aborted")return Ee;s.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof o.value!="undefined"||i.alwaysSet)&&(n[s.value]=o.value)}return{status:e.value,value:n}}},Ee=Object.freeze({status:"aborted"}),fk=t=>({status:"dirty",value:t}),gt=t=>({status:"valid",value:t}),My=t=>t.status==="aborted",jy=t=>t.status==="dirty",Ca=t=>t.status==="valid",Ql=t=>typeof Promise!="undefined"&&t instanceof Promise,ge;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(ge||(ge={}));var er=class{constructor(e,r,n,i){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},ck=(t,e)=>{if(Ca(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new Bt(t.common.issues);return this._error=r,this._error}}};function we(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:n,description:i}=t;if(e&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(o,a)=>o.code!=="invalid_type"?{message:a.defaultError}:typeof a.data=="undefined"?{message:n!=null?n:a.defaultError}:{message:r!=null?r:a.defaultError},description:i}}var xe=class{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return Nn(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:Nn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new et,ctx:{common:e.parent.common,data:e.data,parsedType:Nn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(Ql(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){var n;let i={common:{issues:[],async:(n=r==null?void 0:r.async)!==null&&n!==void 0?n:!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Nn(e)},s=this._parseSync({data:e,path:i.path,parent:i});return ck(i,s)}async parseAsync(e,r){let n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){let n={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Nn(e)},i=this._parse({data:e,path:n.path,parent:n}),s=await(Ql(i)?i:Promise.resolve(i));return ck(n,s)}refine(e,r){let n=i=>typeof r=="string"||typeof r=="undefined"?{message:r}:typeof r=="function"?r(i):r;return this._refinement((i,s)=>{let o=e(i),a=()=>s.addIssue({code:ie.custom,...n(i)});return typeof Promise!="undefined"&&o instanceof Promise?o.then(u=>u?!0:(a(),!1)):o?!0:(a(),!1)})}refinement(e,r){return this._refinement((n,i)=>e(n)?!0:(i.addIssue(typeof r=="function"?r(n,i):r),!1))}_refinement(e){return new Mt({schema:this,typeName:be.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return cr.create(this,this._def)}nullable(){return on.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Nt.create(this,this._def)}promise(){return qn.create(this,this._def)}or(e){return Ei.create([this,e],this._def)}and(e){return wi.create(this,e,this._def)}transform(e){return new Mt({...we(this._def),schema:this,typeName:be.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new Ci({...we(this._def),innerType:this,defaultValue:r,typeName:be.ZodDefault})}brand(){return new eh({typeName:be.ZodBranded,type:this,...we(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new oo({...we(this._def),innerType:this,catchValue:r,typeName:be.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return Ri.create(this,e)}readonly(){return uo.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},EU=/^c[^\s-]{8,}$/i,wU=/^[a-z][a-z0-9]*$/,xU=/^[0-9A-HJKMNP-TV-Z]{26}$/,SU=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,AU=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,DU="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",By,CU=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,RU=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,kU=t=>t.precision?t.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}Z$`):t.precision===0?t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function TU(t,e){return!!((e==="v4"||!e)&&CU.test(t)||(e==="v6"||!e)&&RU.test(t))}var Lt=class extends xe{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==ae.string){let s=this._getOrReturnCtx(e);return ue(s,{code:ie.invalid_type,expected:ae.string,received:s.parsedType}),Ee}let n=new et,i;for(let s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(i=this._getOrReturnCtx(e,i),ue(i,{code:ie.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="max")e.data.length>s.value&&(i=this._getOrReturnCtx(e,i),ue(i,{code:ie.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="length"){let o=e.data.length>s.value,a=e.data.length<s.value;(o||a)&&(i=this._getOrReturnCtx(e,i),o?ue(i,{code:ie.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):a&&ue(i,{code:ie.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),n.dirty())}else if(s.kind==="email")AU.test(e.data)||(i=this._getOrReturnCtx(e,i),ue(i,{validation:"email",code:ie.invalid_string,message:s.message}),n.dirty());else if(s.kind==="emoji")By||(By=new RegExp(DU,"u")),By.test(e.data)||(i=this._getOrReturnCtx(e,i),ue(i,{validation:"emoji",code:ie.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")SU.test(e.data)||(i=this._getOrReturnCtx(e,i),ue(i,{validation:"uuid",code:ie.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")EU.test(e.data)||(i=this._getOrReturnCtx(e,i),ue(i,{validation:"cuid",code:ie.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid2")wU.test(e.data)||(i=this._getOrReturnCtx(e,i),ue(i,{validation:"cuid2",code:ie.invalid_string,message:s.message}),n.dirty());else if(s.kind==="ulid")xU.test(e.data)||(i=this._getOrReturnCtx(e,i),ue(i,{validation:"ulid",code:ie.invalid_string,message:s.message}),n.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),ue(i,{validation:"url",code:ie.invalid_string,message:s.message}),n.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),ue(i,{validation:"regex",code:ie.invalid_string,message:s.message}),n.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(i=this._getOrReturnCtx(e,i),ue(i,{code:ie.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),n.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(i=this._getOrReturnCtx(e,i),ue(i,{code:ie.invalid_string,validation:{startsWith:s.value},message:s.message}),n.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(i=this._getOrReturnCtx(e,i),ue(i,{code:ie.invalid_string,validation:{endsWith:s.value},message:s.message}),n.dirty()):s.kind==="datetime"?kU(s).test(e.data)||(i=this._getOrReturnCtx(e,i),ue(i,{code:ie.invalid_string,validation:"datetime",message:s.message}),n.dirty()):s.kind==="ip"?TU(e.data,s.version)||(i=this._getOrReturnCtx(e,i),ue(i,{validation:"ip",code:ie.invalid_string,message:s.message}),n.dirty()):Te.assertNever(s);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(i=>e.test(i),{validation:r,code:ie.invalid_string,...ge.errToObj(n)})}_addCheck(e){return new Lt({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...ge.errToObj(e)})}url(e){return this._addCheck({kind:"url",...ge.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...ge.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...ge.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...ge.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...ge.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...ge.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...ge.errToObj(e)})}datetime(e){var r;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)=="undefined"?null:e==null?void 0:e.precision,offset:(r=e==null?void 0:e.offset)!==null&&r!==void 0?r:!1,...ge.errToObj(e==null?void 0:e.message)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...ge.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r==null?void 0:r.position,...ge.errToObj(r==null?void 0:r.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...ge.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...ge.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...ge.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...ge.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...ge.errToObj(r)})}nonempty(e){return this.min(1,ge.errToObj(e))}trim(){return new Lt({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Lt({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Lt({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};Lt.create=t=>{var e;return new Lt({checks:[],typeName:be.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...we(t)})};function OU(t,e){let r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,i=r>n?r:n,s=parseInt(t.toFixed(i).replace(".","")),o=parseInt(e.toFixed(i).replace(".",""));return s%o/Math.pow(10,i)}var Rr=class extends xe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==ae.number){let s=this._getOrReturnCtx(e);return ue(s,{code:ie.invalid_type,expected:ae.number,received:s.parsedType}),Ee}let n,i=new et;for(let s of this._def.checks)s.kind==="int"?Te.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),ue(n,{code:ie.invalid_type,expected:"integer",received:"float",message:s.message}),i.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),ue(n,{code:ie.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),ue(n,{code:ie.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="multipleOf"?OU(e.data,s.value)!==0&&(n=this._getOrReturnCtx(e,n),ue(n,{code:ie.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),ue(n,{code:ie.not_finite,message:s.message}),i.dirty()):Te.assertNever(s);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,ge.toString(r))}gt(e,r){return this.setLimit("min",e,!1,ge.toString(r))}lte(e,r){return this.setLimit("max",e,!0,ge.toString(r))}lt(e,r){return this.setLimit("max",e,!1,ge.toString(r))}setLimit(e,r,n,i){return new Rr({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:ge.toString(i)}]})}_addCheck(e){return new Rr({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:ge.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ge.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ge.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ge.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ge.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:ge.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:ge.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ge.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ge.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Te.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(r)&&Number.isFinite(e)}};Rr.create=t=>new Rr({checks:[],typeName:be.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...we(t)});var kr=class extends xe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==ae.bigint){let s=this._getOrReturnCtx(e);return ue(s,{code:ie.invalid_type,expected:ae.bigint,received:s.parsedType}),Ee}let n,i=new et;for(let s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),ue(n,{code:ie.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),ue(n,{code:ie.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),ue(n,{code:ie.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):Te.assertNever(s);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,ge.toString(r))}gt(e,r){return this.setLimit("min",e,!1,ge.toString(r))}lte(e,r){return this.setLimit("max",e,!0,ge.toString(r))}lt(e,r){return this.setLimit("max",e,!1,ge.toString(r))}setLimit(e,r,n,i){return new kr({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:ge.toString(i)}]})}_addCheck(e){return new kr({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ge.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ge.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ge.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ge.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:ge.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};kr.create=t=>{var e;return new kr({checks:[],typeName:be.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...we(t)})};var _i=class extends xe{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==ae.boolean){let n=this._getOrReturnCtx(e);return ue(n,{code:ie.invalid_type,expected:ae.boolean,received:n.parsedType}),Ee}return gt(e.data)}};_i.create=t=>new _i({typeName:be.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...we(t)});var nn=class extends xe{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==ae.date){let s=this._getOrReturnCtx(e);return ue(s,{code:ie.invalid_type,expected:ae.date,received:s.parsedType}),Ee}if(isNaN(e.data.getTime())){let s=this._getOrReturnCtx(e);return ue(s,{code:ie.invalid_date}),Ee}let n=new et,i;for(let s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(i=this._getOrReturnCtx(e,i),ue(i,{code:ie.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),n.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(i=this._getOrReturnCtx(e,i),ue(i,{code:ie.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):Te.assertNever(s);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new nn({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:ge.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:ge.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};nn.create=t=>new nn({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:be.ZodDate,...we(t)});var ro=class extends xe{_parse(e){if(this._getType(e)!==ae.symbol){let n=this._getOrReturnCtx(e);return ue(n,{code:ie.invalid_type,expected:ae.symbol,received:n.parsedType}),Ee}return gt(e.data)}};ro.create=t=>new ro({typeName:be.ZodSymbol,...we(t)});var bi=class extends xe{_parse(e){if(this._getType(e)!==ae.undefined){let n=this._getOrReturnCtx(e);return ue(n,{code:ie.invalid_type,expected:ae.undefined,received:n.parsedType}),Ee}return gt(e.data)}};bi.create=t=>new bi({typeName:be.ZodUndefined,...we(t)});var vi=class extends xe{_parse(e){if(this._getType(e)!==ae.null){let n=this._getOrReturnCtx(e);return ue(n,{code:ie.invalid_type,expected:ae.null,received:n.parsedType}),Ee}return gt(e.data)}};vi.create=t=>new vi({typeName:be.ZodNull,...we(t)});var jn=class extends xe{constructor(){super(...arguments),this._any=!0}_parse(e){return gt(e.data)}};jn.create=t=>new jn({typeName:be.ZodAny,...we(t)});var rn=class extends xe{constructor(){super(...arguments),this._unknown=!0}_parse(e){return gt(e.data)}};rn.create=t=>new rn({typeName:be.ZodUnknown,...we(t)});var lr=class extends xe{_parse(e){let r=this._getOrReturnCtx(e);return ue(r,{code:ie.invalid_type,expected:ae.never,received:r.parsedType}),Ee}};lr.create=t=>new lr({typeName:be.ZodNever,...we(t)});var no=class extends xe{_parse(e){if(this._getType(e)!==ae.undefined){let n=this._getOrReturnCtx(e);return ue(n,{code:ie.invalid_type,expected:ae.void,received:n.parsedType}),Ee}return gt(e.data)}};no.create=t=>new no({typeName:be.ZodVoid,...we(t)});var Nt=class extends xe{_parse(e){let{ctx:r,status:n}=this._processInputParams(e),i=this._def;if(r.parsedType!==ae.array)return ue(r,{code:ie.invalid_type,expected:ae.array,received:r.parsedType}),Ee;if(i.exactLength!==null){let o=r.data.length>i.exactLength.value,a=r.data.length<i.exactLength.value;(o||a)&&(ue(r,{code:o?ie.too_big:ie.too_small,minimum:a?i.exactLength.value:void 0,maximum:o?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),n.dirty())}if(i.minLength!==null&&r.data.length<i.minLength.value&&(ue(r,{code:ie.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),n.dirty()),i.maxLength!==null&&r.data.length>i.maxLength.value&&(ue(r,{code:ie.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((o,a)=>i.type._parseAsync(new er(r,o,r.path,a)))).then(o=>et.mergeArray(n,o));let s=[...r.data].map((o,a)=>i.type._parseSync(new er(r,o,r.path,a)));return et.mergeArray(n,s)}get element(){return this._def.type}min(e,r){return new Nt({...this._def,minLength:{value:e,message:ge.toString(r)}})}max(e,r){return new Nt({...this._def,maxLength:{value:e,message:ge.toString(r)}})}length(e,r){return new Nt({...this._def,exactLength:{value:e,message:ge.toString(r)}})}nonempty(e){return this.min(1,e)}};Nt.create=(t,e)=>new Nt({type:t,minLength:null,maxLength:null,exactLength:null,typeName:be.ZodArray,...we(e)});function to(t){if(t instanceof Be){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=cr.create(to(n))}return new Be({...t._def,shape:()=>e})}else return t instanceof Nt?new Nt({...t._def,type:to(t.element)}):t instanceof cr?cr.create(to(t.unwrap())):t instanceof on?on.create(to(t.unwrap())):t instanceof tr?tr.create(t.items.map(e=>to(e))):t}var Be=class extends xe{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=Te.objectKeys(e);return this._cached={shape:e,keys:r}}_parse(e){if(this._getType(e)!==ae.object){let c=this._getOrReturnCtx(e);return ue(c,{code:ie.invalid_type,expected:ae.object,received:c.parsedType}),Ee}let{status:n,ctx:i}=this._processInputParams(e),{shape:s,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof lr&&this._def.unknownKeys==="strip"))for(let c in i.data)o.includes(c)||a.push(c);let u=[];for(let c of o){let l=s[c],h=i.data[c];u.push({key:{status:"valid",value:c},value:l._parse(new er(i,h,i.path,c)),alwaysSet:c in i.data})}if(this._def.catchall instanceof lr){let c=this._def.unknownKeys;if(c==="passthrough")for(let l of a)u.push({key:{status:"valid",value:l},value:{status:"valid",value:i.data[l]}});else if(c==="strict")a.length>0&&(ue(i,{code:ie.unrecognized_keys,keys:a}),n.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let c=this._def.catchall;for(let l of a){let h=i.data[l];u.push({key:{status:"valid",value:l},value:c._parse(new er(i,h,i.path,l)),alwaysSet:l in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let c=[];for(let l of u){let h=await l.key;c.push({key:h,value:await l.value,alwaysSet:l.alwaysSet})}return c}).then(c=>et.mergeObjectSync(n,c)):et.mergeObjectSync(n,u)}get shape(){return this._def.shape()}strict(e){return ge.errToObj,new Be({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{var i,s,o,a;let u=(o=(s=(i=this._def).errorMap)===null||s===void 0?void 0:s.call(i,r,n).message)!==null&&o!==void 0?o:n.defaultError;return r.code==="unrecognized_keys"?{message:(a=ge.errToObj(e).message)!==null&&a!==void 0?a:u}:{message:u}}}:{}})}strip(){return new Be({...this._def,unknownKeys:"strip"})}passthrough(){return new Be({...this._def,unknownKeys:"passthrough"})}extend(e){return new Be({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Be({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:be.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new Be({...this._def,catchall:e})}pick(e){let r={};return Te.objectKeys(e).forEach(n=>{e[n]&&this.shape[n]&&(r[n]=this.shape[n])}),new Be({...this._def,shape:()=>r})}omit(e){let r={};return Te.objectKeys(this.shape).forEach(n=>{e[n]||(r[n]=this.shape[n])}),new Be({...this._def,shape:()=>r})}deepPartial(){return to(this)}partial(e){let r={};return Te.objectKeys(this.shape).forEach(n=>{let i=this.shape[n];e&&!e[n]?r[n]=i:r[n]=i.optional()}),new Be({...this._def,shape:()=>r})}required(e){let r={};return Te.objectKeys(this.shape).forEach(n=>{if(e&&!e[n])r[n]=this.shape[n];else{let s=this.shape[n];for(;s instanceof cr;)s=s._def.innerType;r[n]=s}}),new Be({...this._def,shape:()=>r})}keyof(){return dk(Te.objectKeys(this.shape))}};Be.create=(t,e)=>new Be({shape:()=>t,unknownKeys:"strip",catchall:lr.create(),typeName:be.ZodObject,...we(e)});Be.strictCreate=(t,e)=>new Be({shape:()=>t,unknownKeys:"strict",catchall:lr.create(),typeName:be.ZodObject,...we(e)});Be.lazycreate=(t,e)=>new Be({shape:t,unknownKeys:"strip",catchall:lr.create(),typeName:be.ZodObject,...we(e)});var Ei=class extends xe{_parse(e){let{ctx:r}=this._processInputParams(e),n=this._def.options;function i(s){for(let a of s)if(a.result.status==="valid")return a.result;for(let a of s)if(a.result.status==="dirty")return r.common.issues.push(...a.ctx.common.issues),a.result;let o=s.map(a=>new Bt(a.ctx.common.issues));return ue(r,{code:ie.invalid_union,unionErrors:o}),Ee}if(r.common.async)return Promise.all(n.map(async s=>{let o={...r,common:{...r.common,issues:[]},parent:null};return{result:await s._parseAsync({data:r.data,path:r.path,parent:o}),ctx:o}})).then(i);{let s,o=[];for(let u of n){let c={...r,common:{...r.common,issues:[]},parent:null},l=u._parseSync({data:r.data,path:r.path,parent:c});if(l.status==="valid")return l;l.status==="dirty"&&!s&&(s={result:l,ctx:c}),c.common.issues.length&&o.push(c.common.issues)}if(s)return r.common.issues.push(...s.ctx.common.issues),s.result;let a=o.map(u=>new Bt(u));return ue(r,{code:ie.invalid_union,unionErrors:a}),Ee}}get options(){return this._def.options}};Ei.create=(t,e)=>new Ei({options:t,typeName:be.ZodUnion,...we(e)});var Zl=t=>t instanceof Si?Zl(t.schema):t instanceof Mt?Zl(t.innerType()):t instanceof Ai?[t.value]:t instanceof Tr?t.options:t instanceof Di?Object.keys(t.enum):t instanceof Ci?Zl(t._def.innerType):t instanceof bi?[void 0]:t instanceof vi?[null]:null,io=class extends xe{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==ae.object)return ue(r,{code:ie.invalid_type,expected:ae.object,received:r.parsedType}),Ee;let n=this.discriminator,i=r.data[n],s=this.optionsMap.get(i);return s?r.common.async?s._parseAsync({data:r.data,path:r.path,parent:r}):s._parseSync({data:r.data,path:r.path,parent:r}):(ue(r,{code:ie.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),Ee)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,n){let i=new Map;for(let s of r){let o=Zl(s.shape[e]);if(!o)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let a of o){if(i.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);i.set(a,s)}}return new io({typeName:be.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:i,...we(n)})}};function qy(t,e){let r=Nn(t),n=Nn(e);if(t===e)return{valid:!0,data:t};if(r===ae.object&&n===ae.object){let i=Te.objectKeys(e),s=Te.objectKeys(t).filter(a=>i.indexOf(a)!==-1),o={...t,...e};for(let a of s){let u=qy(t[a],e[a]);if(!u.valid)return{valid:!1};o[a]=u.data}return{valid:!0,data:o}}else if(r===ae.array&&n===ae.array){if(t.length!==e.length)return{valid:!1};let i=[];for(let s=0;s<t.length;s++){let o=t[s],a=e[s],u=qy(o,a);if(!u.valid)return{valid:!1};i.push(u.data)}return{valid:!0,data:i}}else return r===ae.date&&n===ae.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var wi=class extends xe{_parse(e){let{status:r,ctx:n}=this._processInputParams(e),i=(s,o)=>{if(My(s)||My(o))return Ee;let a=qy(s.value,o.value);return a.valid?((jy(s)||jy(o))&&r.dirty(),{status:r.value,value:a.data}):(ue(n,{code:ie.invalid_intersection_types}),Ee)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([s,o])=>i(s,o)):i(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};wi.create=(t,e,r)=>new wi({left:t,right:e,typeName:be.ZodIntersection,...we(r)});var tr=class extends xe{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==ae.array)return ue(n,{code:ie.invalid_type,expected:ae.array,received:n.parsedType}),Ee;if(n.data.length<this._def.items.length)return ue(n,{code:ie.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ee;!this._def.rest&&n.data.length>this._def.items.length&&(ue(n,{code:ie.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let s=[...n.data].map((o,a)=>{let u=this._def.items[a]||this._def.rest;return u?u._parse(new er(n,o,n.path,a)):null}).filter(o=>!!o);return n.common.async?Promise.all(s).then(o=>et.mergeArray(r,o)):et.mergeArray(r,s)}get items(){return this._def.items}rest(e){return new tr({...this._def,rest:e})}};tr.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new tr({items:t,typeName:be.ZodTuple,rest:null,...we(e)})};var xi=class extends xe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==ae.object)return ue(n,{code:ie.invalid_type,expected:ae.object,received:n.parsedType}),Ee;let i=[],s=this._def.keyType,o=this._def.valueType;for(let a in n.data)i.push({key:s._parse(new er(n,a,n.path,a)),value:o._parse(new er(n,n.data[a],n.path,a))});return n.common.async?et.mergeObjectAsync(r,i):et.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof xe?new xi({keyType:e,valueType:r,typeName:be.ZodRecord,...we(n)}):new xi({keyType:Lt.create(),valueType:e,typeName:be.ZodRecord,...we(r)})}},so=class extends xe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==ae.map)return ue(n,{code:ie.invalid_type,expected:ae.map,received:n.parsedType}),Ee;let i=this._def.keyType,s=this._def.valueType,o=[...n.data.entries()].map(([a,u],c)=>({key:i._parse(new er(n,a,n.path,[c,"key"])),value:s._parse(new er(n,u,n.path,[c,"value"]))}));if(n.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let u of o){let c=await u.key,l=await u.value;if(c.status==="aborted"||l.status==="aborted")return Ee;(c.status==="dirty"||l.status==="dirty")&&r.dirty(),a.set(c.value,l.value)}return{status:r.value,value:a}})}else{let a=new Map;for(let u of o){let c=u.key,l=u.value;if(c.status==="aborted"||l.status==="aborted")return Ee;(c.status==="dirty"||l.status==="dirty")&&r.dirty(),a.set(c.value,l.value)}return{status:r.value,value:a}}}};so.create=(t,e,r)=>new so({valueType:e,keyType:t,typeName:be.ZodMap,...we(r)});var sn=class extends xe{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==ae.set)return ue(n,{code:ie.invalid_type,expected:ae.set,received:n.parsedType}),Ee;let i=this._def;i.minSize!==null&&n.data.size<i.minSize.value&&(ue(n,{code:ie.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),r.dirty()),i.maxSize!==null&&n.data.size>i.maxSize.value&&(ue(n,{code:ie.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());let s=this._def.valueType;function o(u){let c=new Set;for(let l of u){if(l.status==="aborted")return Ee;l.status==="dirty"&&r.dirty(),c.add(l.value)}return{status:r.value,value:c}}let a=[...n.data.values()].map((u,c)=>s._parse(new er(n,u,n.path,c)));return n.common.async?Promise.all(a).then(u=>o(u)):o(a)}min(e,r){return new sn({...this._def,minSize:{value:e,message:ge.toString(r)}})}max(e,r){return new sn({...this._def,maxSize:{value:e,message:ge.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};sn.create=(t,e)=>new sn({valueType:t,minSize:null,maxSize:null,typeName:be.ZodSet,...we(e)});var Mn=class extends xe{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==ae.function)return ue(r,{code:ie.invalid_type,expected:ae.function,received:r.parsedType}),Ee;function n(a,u){return Xl({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Jl(),Da].filter(c=>!!c),issueData:{code:ie.invalid_arguments,argumentsError:u}})}function i(a,u){return Xl({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Jl(),Da].filter(c=>!!c),issueData:{code:ie.invalid_return_type,returnTypeError:u}})}let s={errorMap:r.common.contextualErrorMap},o=r.data;if(this._def.returns instanceof qn){let a=this;return gt(async function(...u){let c=new Bt([]),l=await a._def.args.parseAsync(u,s).catch(d=>{throw c.addIssue(n(u,d)),c}),h=await Reflect.apply(o,this,l);return await a._def.returns._def.type.parseAsync(h,s).catch(d=>{throw c.addIssue(i(h,d)),c})})}else{let a=this;return gt(function(...u){let c=a._def.args.safeParse(u,s);if(!c.success)throw new Bt([n(u,c.error)]);let l=Reflect.apply(o,this,c.data),h=a._def.returns.safeParse(l,s);if(!h.success)throw new Bt([i(l,h.error)]);return h.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Mn({...this._def,args:tr.create(e).rest(rn.create())})}returns(e){return new Mn({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,n){return new Mn({args:e||tr.create([]).rest(rn.create()),returns:r||rn.create(),typeName:be.ZodFunction,...we(n)})}},Si=class extends xe{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};Si.create=(t,e)=>new Si({getter:t,typeName:be.ZodLazy,...we(e)});var Ai=class extends xe{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return ue(r,{received:r.data,code:ie.invalid_literal,expected:this._def.value}),Ee}return{status:"valid",value:e.data}}get value(){return this._def.value}};Ai.create=(t,e)=>new Ai({value:t,typeName:be.ZodLiteral,...we(e)});function dk(t,e){return new Tr({values:t,typeName:be.ZodEnum,...we(e)})}var Tr=class extends xe{_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),n=this._def.values;return ue(r,{expected:Te.joinValues(n),received:r.parsedType,code:ie.invalid_type}),Ee}if(this._def.values.indexOf(e.data)===-1){let r=this._getOrReturnCtx(e),n=this._def.values;return ue(r,{received:r.data,code:ie.invalid_enum_value,options:n}),Ee}return gt(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e){return Tr.create(e)}exclude(e){return Tr.create(this.options.filter(r=>!e.includes(r)))}};Tr.create=dk;var Di=class extends xe{_parse(e){let r=Te.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==ae.string&&n.parsedType!==ae.number){let i=Te.objectValues(r);return ue(n,{expected:Te.joinValues(i),received:n.parsedType,code:ie.invalid_type}),Ee}if(r.indexOf(e.data)===-1){let i=Te.objectValues(r);return ue(n,{received:n.data,code:ie.invalid_enum_value,options:i}),Ee}return gt(e.data)}get enum(){return this._def.values}};Di.create=(t,e)=>new Di({values:t,typeName:be.ZodNativeEnum,...we(e)});var qn=class extends xe{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==ae.promise&&r.common.async===!1)return ue(r,{code:ie.invalid_type,expected:ae.promise,received:r.parsedType}),Ee;let n=r.parsedType===ae.promise?r.data:Promise.resolve(r.data);return gt(n.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}};qn.create=(t,e)=>new qn({type:t,typeName:be.ZodPromise,...we(e)});var Mt=class extends xe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===be.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),i=this._def.effect||null,s={addIssue:o=>{ue(n,o),o.fatal?r.abort():r.dirty()},get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),i.type==="preprocess"){let o=i.transform(n.data,s);return n.common.issues.length?{status:"dirty",value:n.data}:n.common.async?Promise.resolve(o).then(a=>this._def.schema._parseAsync({data:a,path:n.path,parent:n})):this._def.schema._parseSync({data:o,path:n.path,parent:n})}if(i.type==="refinement"){let o=a=>{let u=i.refinement(a,s);if(n.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(n.common.async===!1){let a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?Ee:(a.status==="dirty"&&r.dirty(),o(a.value),{status:r.value,value:a.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>a.status==="aborted"?Ee:(a.status==="dirty"&&r.dirty(),o(a.value).then(()=>({status:r.value,value:a.value}))))}if(i.type==="transform")if(n.common.async===!1){let o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Ca(o))return o;let a=i.transform(o.value,s);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>Ca(o)?Promise.resolve(i.transform(o.value,s)).then(a=>({status:r.value,value:a})):o);Te.assertNever(i)}};Mt.create=(t,e,r)=>new Mt({schema:t,typeName:be.ZodEffects,effect:e,...we(r)});Mt.createWithPreprocess=(t,e,r)=>new Mt({schema:e,effect:{type:"preprocess",transform:t},typeName:be.ZodEffects,...we(r)});var cr=class extends xe{_parse(e){return this._getType(e)===ae.undefined?gt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};cr.create=(t,e)=>new cr({innerType:t,typeName:be.ZodOptional,...we(e)});var on=class extends xe{_parse(e){return this._getType(e)===ae.null?gt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};on.create=(t,e)=>new on({innerType:t,typeName:be.ZodNullable,...we(e)});var Ci=class extends xe{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return r.parsedType===ae.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};Ci.create=(t,e)=>new Ci({innerType:t,typeName:be.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...we(e)});var oo=class extends xe{_parse(e){let{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Ql(i)?i.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Bt(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Bt(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};oo.create=(t,e)=>new oo({innerType:t,typeName:be.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...we(e)});var ao=class extends xe{_parse(e){if(this._getType(e)!==ae.nan){let n=this._getOrReturnCtx(e);return ue(n,{code:ie.invalid_type,expected:ae.nan,received:n.parsedType}),Ee}return{status:"valid",value:e.data}}};ao.create=t=>new ao({typeName:be.ZodNaN,...we(t)});var FU=Symbol("zod_brand"),eh=class extends xe{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},Ri=class extends xe{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let s=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?Ee:s.status==="dirty"?(r.dirty(),fk(s.value)):this._def.out._parseAsync({data:s.value,path:n.path,parent:n})})();{let i=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?Ee:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(e,r){return new Ri({in:e,out:r,typeName:be.ZodPipeline})}},uo=class extends xe{_parse(e){let r=this._def.innerType._parse(e);return Ca(r)&&(r.value=Object.freeze(r.value)),r}};uo.create=(t,e)=>new uo({innerType:t,typeName:be.ZodReadonly,...we(e)});var pk=(t,e={},r)=>t?jn.create().superRefine((n,i)=>{var s,o;if(!t(n)){let a=typeof e=="function"?e(n):typeof e=="string"?{message:e}:e,u=(o=(s=a.fatal)!==null&&s!==void 0?s:r)!==null&&o!==void 0?o:!0,c=typeof a=="string"?{message:a}:a;i.addIssue({code:"custom",...c,fatal:u})}}):jn.create(),PU={object:Be.lazycreate},be;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(be||(be={}));var IU=(t,e={message:`Input not instance of ${t.name}`})=>pk(r=>r instanceof t,e),mk=Lt.create,yk=Rr.create,LU=ao.create,BU=kr.create,gk=_i.create,NU=nn.create,MU=ro.create,jU=bi.create,qU=vi.create,UU=jn.create,HU=rn.create,$U=lr.create,GU=no.create,zU=Nt.create,VU=Be.create,WU=Be.strictCreate,YU=Ei.create,KU=io.create,ZU=wi.create,JU=tr.create,XU=xi.create,QU=so.create,e7=sn.create,t7=Mn.create,r7=Si.create,n7=Ai.create,i7=Tr.create,s7=Di.create,o7=qn.create,lk=Mt.create,a7=cr.create,u7=on.create,c7=Mt.createWithPreprocess,l7=Ri.create,h7=()=>mk().optional(),f7=()=>yk().optional(),d7=()=>gk().optional(),p7={string:t=>Lt.create({...t,coerce:!0}),number:t=>Rr.create({...t,coerce:!0}),boolean:t=>_i.create({...t,coerce:!0}),bigint:t=>kr.create({...t,coerce:!0}),date:t=>nn.create({...t,coerce:!0})},m7=Ee,co=Object.freeze({__proto__:null,defaultErrorMap:Da,setErrorMap:bU,getErrorMap:Jl,makeIssue:Xl,EMPTY_PATH:vU,addIssueToContext:ue,ParseStatus:et,INVALID:Ee,DIRTY:fk,OK:gt,isAborted:My,isDirty:jy,isValid:Ca,isAsync:Ql,get util(){return Te},get objectUtil(){return Ny},ZodParsedType:ae,getParsedType:Nn,ZodType:xe,ZodString:Lt,ZodNumber:Rr,ZodBigInt:kr,ZodBoolean:_i,ZodDate:nn,ZodSymbol:ro,ZodUndefined:bi,ZodNull:vi,ZodAny:jn,ZodUnknown:rn,ZodNever:lr,ZodVoid:no,ZodArray:Nt,ZodObject:Be,ZodUnion:Ei,ZodDiscriminatedUnion:io,ZodIntersection:wi,ZodTuple:tr,ZodRecord:xi,ZodMap:so,ZodSet:sn,ZodFunction:Mn,ZodLazy:Si,ZodLiteral:Ai,ZodEnum:Tr,ZodNativeEnum:Di,ZodPromise:qn,ZodEffects:Mt,ZodTransformer:Mt,ZodOptional:cr,ZodNullable:on,ZodDefault:Ci,ZodCatch:oo,ZodNaN:ao,BRAND:FU,ZodBranded:eh,ZodPipeline:Ri,ZodReadonly:uo,custom:pk,Schema:xe,ZodSchema:xe,late:PU,get ZodFirstPartyTypeKind(){return be},coerce:p7,any:UU,array:zU,bigint:BU,boolean:gk,date:NU,discriminatedUnion:KU,effect:lk,enum:i7,function:t7,instanceof:IU,intersection:ZU,lazy:r7,literal:n7,map:QU,nan:LU,nativeEnum:s7,never:$U,null:qU,nullable:u7,number:yk,object:VU,oboolean:d7,onumber:f7,optional:a7,ostring:h7,pipeline:l7,preprocess:c7,promise:o7,record:XU,set:e7,strictObject:WU,string:mk,symbol:MU,transformer:lk,tuple:JU,undefined:jU,union:YU,unknown:HU,void:GU,NEVER:m7,ZodIssueCode:ie,quotelessJson:_U,ZodError:Bt});var Vy=oe(require("os")),Dk=oe(require("crypto")),Ck=oe(require("path")),Rk=oe(Ak());function A7(t){let e=process.version,r=Vy.default.type(),n=Vy.default.arch();return`${t.name} ${t.version} ${e} ${r} ${n}`}async function D7(){let t=process.env.TURBO_CONFIG_DIR_PATH?process.env.TURBO_CONFIG_DIR_PATH:await(0,Rk.configDir)();if(!t)throw new Error("Could not find telemetry config directory");return Ck.default.join(t,"turborepo","telemetry.json")}function C7({input:t,salt:e}){return Dk.default.createHash("sha256").update(`${e}${t}`).digest("hex")}var lo={buildUserAgent:A7,oneWayHashWithSalt:C7,defaultConfigPath:D7};var R7="TURBO_TELEMETRY_DEBUG",k7="TURBO_TELEMETRY_DISABLED",T7="TURBO_TELEMETRY_MESSAGE_DISABLED",O7="DO_NOT_TRACK",F7=co.object({telemetry_enabled:co.boolean(),telemetry_id:co.string(),telemetry_salt:co.string(),telemetry_alerted:co.string().optional()}),At=class{constructor({configPath:e,config:r}){this.config=r,this.configPath=e}static fromConfigPath(e){try{let r=(0,ho.readFileSync)(e,"utf-8"),n=JSON.parse(r),i=At.validateConfig(n);return new At({configPath:e,config:i})}catch{return At.tryRemove({configPath:e})?At.create({configPath:e}):void 0}}static async fromDefaultConfig(){try{let e=await lo.defaultConfigPath();return At.fromConfigPath(e)}catch{return}}static validateConfig(e){try{return F7.parse(e)}catch{throw new Error("Config is invalid.")}}static create({configPath:e}){let r=(0,Wy.randomUUID)(),n=(0,Wy.randomUUID)(),i=lo.oneWayHashWithSalt({input:r,salt:n}),s=new At({configPath:e,config:{telemetry_enabled:!0,telemetry_id:i,telemetry_salt:n}});if(s.tryWrite())return s}tryWrite(){try{let e=JSON.stringify(this.config,null,2);return(0,ho.writeFileSync)(this.configPath,e),!0}catch{return!1}}static tryRemove({configPath:e}){try{return(0,ho.rmSync)(e,{force:!0}),!0}catch{return!1}}hasSeenAlert(){return this.config.telemetry_alerted!==void 0}isEnabled(){let e=process.env[O7]||"0",r=process.env[k7]||"0";return e==="1"||e.toLowerCase()==="true"||r==="1"||r.toLowerCase()==="true"?!1:this.config.telemetry_enabled}isTelemetryWarningEnabled(){let e=process.env[T7]||"0";return!(e==="1"||e.toLowerCase()==="true")}get id(){return this.config.telemetry_id}showAlert(){!this.hasSeenAlert()&&this.isEnabled()&&this.isTelemetryWarningEnabled()&&(de.log(),de.bold("Attention:"),de.grey("Turborepo now collects completely anonymous telemetry regarding usage."),de.grey("This information is used to shape the Turborepo roadmap and prioritize features."),de.grey("You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:"),de.underline(kk.default.gray("https://turborepo.com/docs/telemetry"))),this.alertShown()}enable(){this.config.telemetry_enabled=!0,this.tryWrite()}disable(){this.config.telemetry_enabled=!1,this.tryWrite()}alertShown(){return this.hasSeenAlert()||(this.config.telemetry_alerted=new Date().toISOString(),this.tryWrite()),!0}oneWayHash(e){return lo.oneWayHashWithSalt({input:e,salt:this.config.telemetry_salt})}static isDebug(){let e=process.env[R7]||"0";return e==="1"||e.toLowerCase()==="true"}};var Yy=require("crypto"),Tk=oe(Ay());var P7=20,I7="/api/turborepo/v1/events",ki=class{constructor({api:e,packageInfo:r,config:n,opts:i}){this.batchSize=P7;this.timeout=250;this.sessionId=(0,Yy.randomUUID)();this.eventBatches=[];this.events=[];let s=new URL(I7,e);this.api=s.toString(),this.packageInfo=r,this.config=n,i!=null&&i.timeout&&(this.timeout=i.timeout),i!=null&&i.batchSize&&(this.batchSize=i.batchSize)}hasPendingEvents(){return this.events.length!==0}async waitForFlush(){await Promise.all(this.eventBatches)}flushEvents(){let e=this.events.splice(0,this.batchSize);this.config.isEnabled()&&this.eventBatches.push(Tk.default.post(this.api,{timeout:this.timeout,json:e,headers:{"x-turbo-telemetry-id":this.config.id,"x-turbo-session-id":this.sessionId,"User-Agent":lo.buildUserAgent(this.packageInfo)}}))}track({key:e,value:r,parentId:n,isSensitive:i}){let s={id:(0,Yy.randomUUID)(),key:e,value:i?this.config.oneWayHash(r):r,package_name:this.packageInfo.name,package_version:this.packageInfo.version,parent_id:n};return At.isDebug()&&(de.log(),de.bold("[telemetry event]"),de.dimmed(JSON.stringify(s,null,2)),de.log()),this.config.isEnabled()&&(this.events.push({package:s}),this.events.length>=this.batchSize&&this.flushEvents()),s}async close(){for(;this.hasPendingEvents();)this.flushEvents();try{await this.waitForFlush()}catch{}}trackCliOption({option:e,value:r}){return this.track({key:`option:${e}`,value:r})}trackCliArgument({argument:e,value:r}){return this.track({key:`argument:${e}`,value:r})}trackCliCommand({command:e,value:r}){return this.track({key:`command:${e}`,value:r})}trackCommandStatus({command:e,status:r}){return this.trackCliCommand({command:e,value:r})}trackCommandWarning(e){return this.track({key:"warning",value:e})}trackCommandError(e){return this.track({key:"error",value:e})}};var Ra=class extends ki{trackOptionExample(e){if(e)return this.trackCliOption({option:"example",value:e})}trackOptionPackageManager(e){if(e)return this.trackCliOption({option:"package_manager",value:e})}trackOptionSkipInstall(e){if(e)return this.trackCliOption({option:"skip_install",value:e.toString()})}trackOptionSkipTransforms(e){if(e)return this.trackCliOption({option:"skip_transforms",value:e.toString()})}trackOptionTurboVersion(e){if(e)return this.trackCliOption({option:"turbo_version",value:e})}trackOptionExamplePath(e){if(e)return this.trackCliOption({option:"example_path",value:e})}trackArgumentDirectory(e){if(e)return this.trackCliArgument({argument:"project_directory",value:"provided"})}trackArgumentPackageManager(e){if(e)return this.trackCliArgument({argument:"package_manager",value:e})}};var Lk=oe(Ik());var B7=["build","test","lint","typecheck","checktypes","check-types","type-check","check"],ka=class extends ki{trackCI(){var e;return this.track({key:"ci",value:(e=Lk.name)!=null?e:"unknown"})}trackArgumentWorkspace(e){if(e)return this.trackCliArgument({argument:"workspace",value:"provided"})}trackOptionTask(e){if(e)return this.trackCliOption({option:"task",value:B7.includes(e)?e:"other"})}trackOptionFallback(e){if(e)return this.trackCliOption({option:"fallback",value:e})}trackOptionDirectory(e){if(e)return this.trackCliOption({option:"directory",value:"custom"})}trackOptionMaxBuffer(e){if(e!==void 0)return this.trackCliOption({option:"max_buffer",value:e.toString()})}};var N7={"create-turbo":Ra,"turbo-ignore":ka},M7="https://telemetry.vercel.com";async function Ky({packageInfo:t,opts:e}){let r=N7[t.name],n=await At.fromDefaultConfig();return n?(n.showAlert(),{telemetry:new r({api:M7,packageInfo:t,config:n,opts:e})}):{telemetry:void 0}}var Ta=oe(require("picocolors"));var Bk=require("commander"),Nk="status",j7=["enable","disable",Nk];function q7(t){var r;let e=(r=t.telemetry)==null?void 0:r.config.isEnabled();de.log(`Status: ${e?Ta.default.bold(Ta.default.green("Enabled")):Ta.default.bold(Ta.default.red("Disabled"))}`),de.log(),e?de.log("Turborepo telemetry is completely anonymous. Thank you for participating!"):de.log("You have opted-out of Turborepo anonymous telemetry. No data will be collected from your machine."),de.log("Learn more: https://turborepo.com/docs/telemetry")}function U7(t,e){if(!e.telemetry){de.error("Telemetry could not be initialized");return}t==="enable"?(e.telemetry.config.enable(),de.bold("Success!")):t==="disable"&&(e.telemetry.config.disable(),de.bold("Success!")),de.log(),q7(e)}function Zy(t){t.command("telemetry").description("Manage telemetry settings").addArgument(new Bk.Argument("[action]","Action to perform").choices(j7).default(Nk)).action(U7)}var XT=require("proxy-agent"),Ag=oe(rh());var Jy=oe(require("picocolors")),Mk=oe(require("update-check"));var jk=oe(rh()),$7=(0,Mk.default)(jk.default).catch(()=>null);async function Xy(){try{let t=await $7;t!=null&&t.latest&&(de.log(),de.log(Jy.default.yellow(Jy.default.bold("A new version of `create-turbo` is available!"))),de.log()),process.exit()}catch{}}var qa=oe(require("path")),tt=oe(require("picocolors"));var Dt=require("picocolors"),tT=oe(Xu(),1),rT=oe(sc(),1),aT=oe(require("os"),1),uT=oe(_s(),1),PZ=require("fs-extra");var MZ=oe(Cu(),1),qZ=require("fs-extra"),HZ=require("fs-extra"),GZ=require("picocolors"),lT=require("stream"),hT=require("util"),YZ=require("fs-extra"),JZ=require("picocolors"),QZ=require("fs-extra"),Ti=oe(require("path"),1),hr=oe(require("fs-extra"),1),fT=oe(_s(),1),dT=oe(require("path"),1),pT=oe(require("fs-extra"),1),mT=oe(require("picocolors"),1),un=oe(require("path"),1),yT=oe(_s(),1),Ut=require("fs-extra"),gT=oe(Cu(),1);var Fa=oe(require("path"),1),Oi=oe(require("fs-extra"),1),go=oe(require("path"),1),Fi=oe(require("fs-extra"),1),Pa=oe(require("path"),1),Ii=oe(require("fs-extra"),1),qt=oe(require("picocolors"),1),xT=oe(sc(),1),ST=oe(_s(),1),AT=oe(Xu(),1),DT=require("semver"),CT=oe(require("picocolors"),1),G7=Object.create,tg=Object.defineProperty,z7=Object.getOwnPropertyDescriptor,V7=Object.getOwnPropertyNames,W7=Object.getPrototypeOf,Y7=Object.prototype.hasOwnProperty,_e=(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')}),K7=(t,e)=>()=>(t&&(e=t(t=0)),e),me=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Z7=(t,e)=>{for(var r in e)tg(t,r,{get:e[r],enumerable:!0})},J7=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of V7(e))!Y7.call(t,i)&&i!==r&&tg(t,i,{get:()=>e[i],enumerable:!(n=z7(e,i))||n.enumerable});return t},oh=(t,e,r)=>(r=t!=null?G7(W7(t)):{},J7(e||!t||!t.__esModule?tg(r,"default",{value:t,enumerable:!0}):r,t)),ee=K7(()=>{}),X7=me((t,e)=>{ee();function r(n){return e.exports=r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(i){return typeof i}:function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},e.exports.__esModule=!0,e.exports.default=e.exports,r(n)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports}),Q7=me((t,e)=>{ee();var r=X7().default;function n(){"use strict";e.exports=n=function(){return s},e.exports.__esModule=!0,e.exports.default=e.exports;var i,s={},o=Object.prototype,a=o.hasOwnProperty,u=Object.defineProperty||function(q,g,_){q[g]=_.value},c=typeof Symbol=="function"?Symbol:{},l=c.iterator||"@@iterator",h=c.asyncIterator||"@@asyncIterator",f=c.toStringTag||"@@toStringTag";function d(q,g,_){return Object.defineProperty(q,g,{value:_,enumerable:!0,configurable:!0,writable:!0}),q[g]}try{d({},"")}catch{d=function(q,g,_){return q[g]=_}}function m(q,g,_,v){var k=g&&g.prototype instanceof T?g:T,S=Object.create(k.prototype),H=new G(v||[]);return u(S,"_invoke",{value:te(q,_,H)}),S}function y(q,g,_){try{return{type:"normal",arg:q.call(g,_)}}catch(v){return{type:"throw",arg:v}}}s.wrap=m;var p="suspendedStart",E="suspendedYield",R="executing",P="completed",I={};function T(){}function M(){}function x(){}var D={};d(D,l,function(){return this});var U=Object.getPrototypeOf,V=U&&U(U(Z([])));V&&V!==o&&a.call(V,l)&&(D=V);var N=x.prototype=T.prototype=Object.create(D);function W(q){["next","throw","return"].forEach(function(g){d(q,g,function(_){return this._invoke(g,_)})})}function Q(q,g){function _(k,S,H,$){var ne=y(q[k],q,S);if(ne.type!=="throw"){var Y=ne.arg,fe=Y.value;return fe&&r(fe)=="object"&&a.call(fe,"__await")?g.resolve(fe.__await).then(function(J){_("next",J,H,$)},function(J){_("throw",J,H,$)}):g.resolve(fe).then(function(J){Y.value=J,H(Y)},function(J){return _("throw",J,H,$)})}$(ne.arg)}var v;u(this,"_invoke",{value:function(k,S){function H(){return new g(function($,ne){_(k,S,$,ne)})}return v=v?v.then(H,H):H()}})}function te(q,g,_){var v=p;return function(k,S){if(v===R)throw new Error("Generator is already running");if(v===P){if(k==="throw")throw S;return{value:i,done:!0}}for(_.method=k,_.arg=S;;){var H=_.delegate;if(H){var $=j(H,_);if($){if($===I)continue;return $}}if(_.method==="next")_.sent=_._sent=_.arg;else if(_.method==="throw"){if(v===p)throw v=P,_.arg;_.dispatchException(_.arg)}else _.method==="return"&&_.abrupt("return",_.arg);v=R;var ne=y(q,g,_);if(ne.type==="normal"){if(v=_.done?P:E,ne.arg===I)continue;return{value:ne.arg,done:_.done}}ne.type==="throw"&&(v=P,_.method="throw",_.arg=ne.arg)}}}function j(q,g){var _=g.method,v=q.iterator[_];if(v===i)return g.delegate=null,_==="throw"&&q.iterator.return&&(g.method="return",g.arg=i,j(q,g),g.method==="throw")||_!=="return"&&(g.method="throw",g.arg=new TypeError("The iterator does not provide a '"+_+"' method")),I;var k=y(v,q.iterator,g.arg);if(k.type==="throw")return g.method="throw",g.arg=k.arg,g.delegate=null,I;var S=k.arg;return S?S.done?(g[q.resultName]=S.value,g.next=q.nextLoc,g.method!=="return"&&(g.method="next",g.arg=i),g.delegate=null,I):S:(g.method="throw",g.arg=new TypeError("iterator result is not an object"),g.delegate=null,I)}function F(q){var g={tryLoc:q[0]};1 in q&&(g.catchLoc=q[1]),2 in q&&(g.finallyLoc=q[2],g.afterLoc=q[3]),this.tryEntries.push(g)}function L(q){var g=q.completion||{};g.type="normal",delete g.arg,q.completion=g}function G(q){this.tryEntries=[{tryLoc:"root"}],q.forEach(F,this),this.reset(!0)}function Z(q){if(q||q===""){var g=q[l];if(g)return g.call(q);if(typeof q.next=="function")return q;if(!isNaN(q.length)){var _=-1,v=function k(){for(;++_<q.length;)if(a.call(q,_))return k.value=q[_],k.done=!1,k;return k.value=i,k.done=!0,k};return v.next=v}}throw new TypeError(r(q)+" is not iterable")}return M.prototype=x,u(N,"constructor",{value:x,configurable:!0}),u(x,"constructor",{value:M,configurable:!0}),M.displayName=d(x,f,"GeneratorFunction"),s.isGeneratorFunction=function(q){var g=typeof q=="function"&&q.constructor;return!!g&&(g===M||(g.displayName||g.name)==="GeneratorFunction")},s.mark=function(q){return Object.setPrototypeOf?Object.setPrototypeOf(q,x):(q.__proto__=x,d(q,f,"GeneratorFunction")),q.prototype=Object.create(N),q},s.awrap=function(q){return{__await:q}},W(Q.prototype),d(Q.prototype,h,function(){return this}),s.AsyncIterator=Q,s.async=function(q,g,_,v,k){k===void 0&&(k=Promise);var S=new Q(m(q,g,_,v),k);return s.isGeneratorFunction(g)?S:S.next().then(function(H){return H.done?H.value:S.next()})},W(N),d(N,f,"Generator"),d(N,l,function(){return this}),d(N,"toString",function(){return"[object Generator]"}),s.keys=function(q){var g=Object(q),_=[];for(var v in g)_.push(v);return _.reverse(),function k(){for(;_.length;){var S=_.pop();if(S in g)return k.value=S,k.done=!1,k}return k.done=!0,k}},s.values=Z,G.prototype={constructor:G,reset:function(q){if(this.prev=0,this.next=0,this.sent=this._sent=i,this.done=!1,this.delegate=null,this.method="next",this.arg=i,this.tryEntries.forEach(L),!q)for(var g in this)g.charAt(0)==="t"&&a.call(this,g)&&!isNaN(+g.slice(1))&&(this[g]=i)},stop:function(){this.done=!0;var q=this.tryEntries[0].completion;if(q.type==="throw")throw q.arg;return this.rval},dispatchException:function(q){if(this.done)throw q;var g=this;function _(ne,Y){return S.type="throw",S.arg=q,g.next=ne,Y&&(g.method="next",g.arg=i),!!Y}for(var v=this.tryEntries.length-1;v>=0;--v){var k=this.tryEntries[v],S=k.completion;if(k.tryLoc==="root")return _("end");if(k.tryLoc<=this.prev){var H=a.call(k,"catchLoc"),$=a.call(k,"finallyLoc");if(H&&$){if(this.prev<k.catchLoc)return _(k.catchLoc,!0);if(this.prev<k.finallyLoc)return _(k.finallyLoc)}else if(H){if(this.prev<k.catchLoc)return _(k.catchLoc,!0)}else{if(!$)throw new Error("try statement without catch or finally");if(this.prev<k.finallyLoc)return _(k.finallyLoc)}}}},abrupt:function(q,g){for(var _=this.tryEntries.length-1;_>=0;--_){var v=this.tryEntries[_];if(v.tryLoc<=this.prev&&a.call(v,"finallyLoc")&&this.prev<v.finallyLoc){var k=v;break}}k&&(q==="break"||q==="continue")&&k.tryLoc<=g&&g<=k.finallyLoc&&(k=null);var S=k?k.completion:{};return S.type=q,S.arg=g,k?(this.method="next",this.next=k.finallyLoc,I):this.complete(S)},complete:function(q,g){if(q.type==="throw")throw q.arg;return q.type==="break"||q.type==="continue"?this.next=q.arg:q.type==="return"?(this.rval=this.arg=q.arg,this.method="return",this.next="end"):q.type==="normal"&&g&&(this.next=g),I},finish:function(q){for(var g=this.tryEntries.length-1;g>=0;--g){var _=this.tryEntries[g];if(_.finallyLoc===q)return this.complete(_.completion,_.afterLoc),L(_),I}},catch:function(q){for(var g=this.tryEntries.length-1;g>=0;--g){var _=this.tryEntries[g];if(_.tryLoc===q){var v=_.completion;if(v.type==="throw"){var k=v.arg;L(_)}return k}}throw new Error("illegal catch attempt")},delegateYield:function(q,g,_){return this.delegate={iterator:Z(q),resultName:g,nextLoc:_},this.method==="next"&&(this.arg=i),I}},s}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}),eH=me((t,e)=>{ee();var r=Q7()();e.exports=r;try{regeneratorRuntime=r}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}}),tH=me((t,e)=>{"use strict";ee();var r=(n,...i)=>new Promise(s=>{s(n(...i))});e.exports=r,e.exports.default=r}),rH=me((t,e)=>{"use strict";ee();var r=tH(),n=i=>{if(!((Number.isInteger(i)||i===1/0)&&i>0))return Promise.reject(new TypeError("Expected `concurrency` to be a number from 1 and up"));let s=[],o=0,a=()=>{o--,s.length>0&&s.shift()()},u=(h,f,...d)=>{o++;let m=r(h,...d);f(m),m.then(a,a)},c=(h,f,...d)=>{o<i?u(h,f,...d):s.push(u.bind(null,h,f,...d))},l=(h,...f)=>new Promise(d=>c(h,d,...f));return Object.defineProperties(l,{activeCount:{get:()=>o},pendingCount:{get:()=>s.length},clearQueue:{value:()=>{s.length=0}}}),l};e.exports=n,e.exports.default=n}),nH=me((t,e)=>{"use strict";ee();var r=rH(),n=class extends Error{constructor(a){super(),this.value=a}},i=async(a,u)=>u(await a),s=async a=>{let u=await Promise.all(a);if(u[1]===!0)throw new n(u[0]);return!1},o=async(a,u,c)=>{c={concurrency:1/0,preserveOrder:!0,...c};let l=r(c.concurrency),h=[...a].map(d=>[d,l(i,d,u)]),f=r(c.preserveOrder?1:1/0);try{await Promise.all(h.map(d=>f(s,d)))}catch(d){if(d instanceof n)return d.value;throw d}};e.exports=o,e.exports.default=o}),iH=me((t,e)=>{"use strict";ee();var r=_e("path"),n=_e("fs"),{promisify:i}=_e("util"),s=nH(),o=i(n.stat),a=i(n.lstat),u={directory:"isDirectory",file:"isFile"};function c({type:h}){if(!(h in u))throw new Error(`Invalid type specified: ${h}`)}var l=(h,f)=>h===void 0||f[u[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 m=>{try{let y=await d(r.resolve(f.cwd,m));return l(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?n.statSync:n.lstatSync;for(let m of h)try{let y=d(r.resolve(f.cwd,m));if(l(f.type,y))return m}catch{}}}),sH=me((t,e)=>{"use strict";ee();var r=_e("fs"),{promisify:n}=_e("util"),i=n(r.access);e.exports=async s=>{try{return await i(s),!0}catch{return!1}},e.exports.sync=s=>{try{return r.accessSync(s),!0}catch{return!1}}}),oH=me((t,e)=>{"use strict";ee();var r=_e("path"),n=iH(),i=sH(),s=Symbol("findUp.stop");e.exports=async(o,a={})=>{let u=r.resolve(a.cwd||""),{root:c}=r.parse(u),l=[].concat(o),h=async f=>{if(typeof o!="function")return n(l,f);let d=await o(f.cwd);return typeof d=="string"?n([d],f):d};for(;;){let f=await h({...a,cwd:u});if(f===s)return;if(f)return r.resolve(u,f);if(u===c)return;u=r.dirname(u)}},e.exports.sync=(o,a={})=>{let u=r.resolve(a.cwd||""),{root:c}=r.parse(u),l=[].concat(o),h=f=>{if(typeof o!="function")return n.sync(l,f);let d=o(f.cwd);return typeof d=="string"?n.sync([d],f):d};for(;;){let f=h({...a,cwd:u});if(f===s)return;if(f)return r.resolve(u,f);if(u===c)return;u=r.dirname(u)}},e.exports.exists=i,e.exports.sync.exists=i.sync,e.exports.stop=s}),Ia=me((t,e)=>{"use strict";ee();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=n=>n?Object.keys(n).map(i=>[r.has(i)?r.get(i):i,n[i]]).reduce((i,s)=>(i[s[0]]=s[1],i),Object.create(null)):{}}),rg=me((t,e)=>{"use strict";ee();var r=typeof process=="object"&&process?process:{stdout:null,stderr:null},n=_e("events"),i=_e("stream"),s=_e("string_decoder").StringDecoder,o=Symbol("EOF"),a=Symbol("maybeEmitEnd"),u=Symbol("emittedEnd"),c=Symbol("emittingEnd"),l=Symbol("emittedError"),h=Symbol("closed"),f=Symbol("read"),d=Symbol("flush"),m=Symbol("flushChunk"),y=Symbol("encoding"),p=Symbol("decoder"),E=Symbol("flowing"),R=Symbol("paused"),P=Symbol("resume"),I=Symbol("buffer"),T=Symbol("pipes"),M=Symbol("bufferLength"),x=Symbol("bufferPush"),D=Symbol("bufferShift"),U=Symbol("objectMode"),V=Symbol("destroyed"),N=Symbol("emitData"),W=Symbol("emitEnd"),Q=Symbol("emitEnd2"),te=Symbol("async"),j=k=>Promise.resolve().then(k),F=global._MP_NO_ITERATOR_SYMBOLS_!=="1",L=F&&Symbol.asyncIterator||Symbol("asyncIterator not implemented"),G=F&&Symbol.iterator||Symbol("iterator not implemented"),Z=k=>k==="end"||k==="finish"||k==="prefinish",q=k=>k instanceof ArrayBuffer||typeof k=="object"&&k.constructor&&k.constructor.name==="ArrayBuffer"&&k.byteLength>=0,g=k=>!Buffer.isBuffer(k)&&ArrayBuffer.isView(k),_=class{constructor(k,S,H){this.src=k,this.dest=S,this.opts=H,this.ondrain=()=>k[P](),S.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},v=class extends _{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(k,S,H){super(k,S,H),this.proxyErrors=$=>S.emit("error",$),k.on("error",this.proxyErrors)}};e.exports=class Hk extends i{constructor(S){super(),this[E]=!1,this[R]=!1,this[T]=[],this[I]=[],this[U]=S&&S.objectMode||!1,this[U]?this[y]=null:this[y]=S&&S.encoding||null,this[y]==="buffer"&&(this[y]=null),this[te]=S&&!!S.async||!1,this[p]=this[y]?new s(this[y]):null,this[o]=!1,this[u]=!1,this[c]=!1,this[h]=!1,this[l]=null,this.writable=!0,this.readable=!0,this[M]=0,this[V]=!1,S&&S.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[I]}),S&&S.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[T]})}get bufferLength(){return this[M]}get encoding(){return this[y]}set encoding(S){if(this[U])throw new Error("cannot set encoding in objectMode");if(this[y]&&S!==this[y]&&(this[p]&&this[p].lastNeed||this[M]))throw new Error("cannot change encoding");this[y]!==S&&(this[p]=S?new s(S):null,this[I].length&&(this[I]=this[I].map(H=>this[p].write(H)))),this[y]=S}setEncoding(S){this.encoding=S}get objectMode(){return this[U]}set objectMode(S){this[U]=this[U]||!!S}get async(){return this[te]}set async(S){this[te]=this[te]||!!S}write(S,H,$){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 H=="function"&&($=H,H="utf8"),H||(H="utf8");let ne=this[te]?j:Y=>Y();return!this[U]&&!Buffer.isBuffer(S)&&(g(S)?S=Buffer.from(S.buffer,S.byteOffset,S.byteLength):q(S)?S=Buffer.from(S):typeof S!="string"&&(this.objectMode=!0)),this[U]?(this.flowing&&this[M]!==0&&this[d](!0),this.flowing?this.emit("data",S):this[x](S),this[M]!==0&&this.emit("readable"),$&&ne($),this.flowing):S.length?(typeof S=="string"&&!(H===this[y]&&!this[p].lastNeed)&&(S=Buffer.from(S,H)),Buffer.isBuffer(S)&&this[y]&&(S=this[p].write(S)),this.flowing&&this[M]!==0&&this[d](!0),this.flowing?this.emit("data",S):this[x](S),this[M]!==0&&this.emit("readable"),$&&ne($),this.flowing):(this[M]!==0&&this.emit("readable"),$&&ne($),this.flowing)}read(S){if(this[V])return null;if(this[M]===0||S===0||S>this[M])return this[a](),null;this[U]&&(S=null),this[I].length>1&&!this[U]&&(this.encoding?this[I]=[this[I].join("")]:this[I]=[Buffer.concat(this[I],this[M])]);let H=this[f](S||null,this[I][0]);return this[a](),H}[f](S,H){return S===H.length||S===null?this[D]():(this[I][0]=H.slice(S),H=H.slice(0,S),this[M]-=S),this.emit("data",H),!this[I].length&&!this[o]&&this.emit("drain"),H}end(S,H,$){return typeof S=="function"&&($=S,S=null),typeof H=="function"&&($=H,H="utf8"),S&&this.write(S,H),$&&this.once("end",$),this[o]=!0,this.writable=!1,(this.flowing||!this[R])&&this[a](),this}[P](){this[V]||(this[R]=!1,this[E]=!0,this.emit("resume"),this[I].length?this[d]():this[o]?this[a]():this.emit("drain"))}resume(){return this[P]()}pause(){this[E]=!1,this[R]=!0}get destroyed(){return this[V]}get flowing(){return this[E]}get paused(){return this[R]}[x](S){this[U]?this[M]+=1:this[M]+=S.length,this[I].push(S)}[D](){return this[I].length&&(this[U]?this[M]-=1:this[M]-=this[I][0].length),this[I].shift()}[d](S){do;while(this[m](this[D]()));!S&&!this[I].length&&!this[o]&&this.emit("drain")}[m](S){return S?(this.emit("data",S),this.flowing):!1}pipe(S,H){if(this[V])return;let $=this[u];return H=H||{},S===r.stdout||S===r.stderr?H.end=!1:H.end=H.end!==!1,H.proxyErrors=!!H.proxyErrors,$?H.end&&S.end():(this[T].push(H.proxyErrors?new v(this,S,H):new _(this,S,H)),this[te]?j(()=>this[P]()):this[P]()),S}unpipe(S){let H=this[T].find($=>$.dest===S);H&&(this[T].splice(this[T].indexOf(H),1),H.unpipe())}addListener(S,H){return this.on(S,H)}on(S,H){let $=super.on(S,H);return S==="data"&&!this[T].length&&!this.flowing?this[P]():S==="readable"&&this[M]!==0?super.emit("readable"):Z(S)&&this[u]?(super.emit(S),this.removeAllListeners(S)):S==="error"&&this[l]&&(this[te]?j(()=>H.call(this,this[l])):H.call(this,this[l])),$}get emittedEnd(){return this[u]}[a](){!this[c]&&!this[u]&&!this[V]&&this[I].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(S,H,...$){if(S!=="error"&&S!=="close"&&S!==V&&this[V])return;if(S==="data")return H?this[te]?j(()=>this[N](H)):this[N](H):!1;if(S==="end")return this[W]();if(S==="close"){if(this[h]=!0,!this[u]&&!this[V])return;let Y=super.emit("close");return this.removeAllListeners("close"),Y}else if(S==="error"){this[l]=H;let Y=super.emit("error",H);return this[a](),Y}else if(S==="resume"){let Y=super.emit("resume");return this[a](),Y}else if(S==="finish"||S==="prefinish"){let Y=super.emit(S);return this.removeAllListeners(S),Y}let ne=super.emit(S,H,...$);return this[a](),ne}[N](S){for(let $ of this[T])$.dest.write(S)===!1&&this.pause();let H=super.emit("data",S);return this[a](),H}[W](){this[u]||(this[u]=!0,this.readable=!1,this[te]?j(()=>this[Q]()):this[Q]())}[Q](){if(this[p]){let H=this[p].end();if(H){for(let $ of this[T])$.dest.write(H);super.emit("data",H)}}for(let H of this[T])H.end();let S=super.emit("end");return this.removeAllListeners("end"),S}collect(){let S=[];this[U]||(S.dataLength=0);let H=this.promise();return this.on("data",$=>{S.push($),this[U]||(S.dataLength+=$.length)}),H.then(()=>S)}concat(){return this[U]?Promise.reject(new Error("cannot concat in objectMode")):this.collect().then(S=>this[U]?Promise.reject(new Error("cannot concat in objectMode")):this[y]?S.join(""):Buffer.concat(S,S.dataLength))}promise(){return new Promise((S,H)=>{this.on(V,()=>H(new Error("stream destroyed"))),this.on("error",$=>H($)),this.on("end",()=>S())})}[L](){return{next:()=>{let S=this.read();if(S!==null)return Promise.resolve({done:!1,value:S});if(this[o])return Promise.resolve({done:!0});let H=null,$=null,ne=w=>{this.removeListener("data",Y),this.removeListener("end",fe),$(w)},Y=w=>{this.removeListener("error",ne),this.removeListener("end",fe),this.pause(),H({value:w,done:!!this[o]})},fe=()=>{this.removeListener("error",ne),this.removeListener("data",Y),H({done:!0})},J=()=>ne(new Error("stream destroyed"));return new Promise((w,B)=>{$=B,H=w,this.once(V,J),this.once("error",ne),this.once("end",fe),this.once("data",Y)})}}}[G](){return{next:()=>{let S=this.read();return{value:S,done:S===null}}}}destroy(S){return this[V]?(S?this.emit("error",S):this.emit(V),this):(this[V]=!0,this[I].length=0,this[M]=0,typeof this.close=="function"&&!this[h]&&this.close(),S?this.emit("error",S):this.emit(V),this)}static isStream(S){return!!S&&(S instanceof Hk||S instanceof i||S instanceof n&&(typeof S.pipe=="function"||typeof S.write=="function"&&typeof S.end=="function"))}}}),aH=me((t,e)=>{ee();var r=_e("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))}),$k=me((t,e)=>{"use strict";ee();var r=typeof process=="object"&&process?process:{stdout:null,stderr:null},n=_e("events"),i=_e("stream"),s=_e("string_decoder").StringDecoder,o=Symbol("EOF"),a=Symbol("maybeEmitEnd"),u=Symbol("emittedEnd"),c=Symbol("emittingEnd"),l=Symbol("emittedError"),h=Symbol("closed"),f=Symbol("read"),d=Symbol("flush"),m=Symbol("flushChunk"),y=Symbol("encoding"),p=Symbol("decoder"),E=Symbol("flowing"),R=Symbol("paused"),P=Symbol("resume"),I=Symbol("bufferLength"),T=Symbol("bufferPush"),M=Symbol("bufferShift"),x=Symbol("objectMode"),D=Symbol("destroyed"),U=Symbol("emitData"),V=Symbol("emitEnd"),N=Symbol("emitEnd2"),W=Symbol("async"),Q=_=>Promise.resolve().then(_),te=global._MP_NO_ITERATOR_SYMBOLS_!=="1",j=te&&Symbol.asyncIterator||Symbol("asyncIterator not implemented"),F=te&&Symbol.iterator||Symbol("iterator not implemented"),L=_=>_==="end"||_==="finish"||_==="prefinish",G=_=>_ instanceof ArrayBuffer||typeof _=="object"&&_.constructor&&_.constructor.name==="ArrayBuffer"&&_.byteLength>=0,Z=_=>!Buffer.isBuffer(_)&&ArrayBuffer.isView(_),q=class{constructor(_,v,k){this.src=_,this.dest=v,this.opts=k,this.ondrain=()=>_[P](),v.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},g=class extends q{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(_,v,k){super(_,v,k),this.proxyErrors=S=>v.emit("error",S),_.on("error",this.proxyErrors)}};e.exports=class Gk extends i{constructor(v){super(),this[E]=!1,this[R]=!1,this.pipes=[],this.buffer=[],this[x]=v&&v.objectMode||!1,this[x]?this[y]=null:this[y]=v&&v.encoding||null,this[y]==="buffer"&&(this[y]=null),this[W]=v&&!!v.async||!1,this[p]=this[y]?new s(this[y]):null,this[o]=!1,this[u]=!1,this[c]=!1,this[h]=!1,this[l]=null,this.writable=!0,this.readable=!0,this[I]=0,this[D]=!1}get bufferLength(){return this[I]}get encoding(){return this[y]}set encoding(v){if(this[x])throw new Error("cannot set encoding in objectMode");if(this[y]&&v!==this[y]&&(this[p]&&this[p].lastNeed||this[I]))throw new Error("cannot change encoding");this[y]!==v&&(this[p]=v?new s(v):null,this.buffer.length&&(this.buffer=this.buffer.map(k=>this[p].write(k)))),this[y]=v}setEncoding(v){this.encoding=v}get objectMode(){return this[x]}set objectMode(v){this[x]=this[x]||!!v}get async(){return this[W]}set async(v){this[W]=this[W]||!!v}write(v,k,S){if(this[o])throw new Error("write after end");if(this[D])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof k=="function"&&(S=k,k="utf8"),k||(k="utf8");let H=this[W]?Q:$=>$();return!this[x]&&!Buffer.isBuffer(v)&&(Z(v)?v=Buffer.from(v.buffer,v.byteOffset,v.byteLength):G(v)?v=Buffer.from(v):typeof v!="string"&&(this.objectMode=!0)),this[x]?(this.flowing&&this[I]!==0&&this[d](!0),this.flowing?this.emit("data",v):this[T](v),this[I]!==0&&this.emit("readable"),S&&H(S),this.flowing):v.length?(typeof v=="string"&&!(k===this[y]&&!this[p].lastNeed)&&(v=Buffer.from(v,k)),Buffer.isBuffer(v)&&this[y]&&(v=this[p].write(v)),this.flowing&&this[I]!==0&&this[d](!0),this.flowing?this.emit("data",v):this[T](v),this[I]!==0&&this.emit("readable"),S&&H(S),this.flowing):(this[I]!==0&&this.emit("readable"),S&&H(S),this.flowing)}read(v){if(this[D])return null;if(this[I]===0||v===0||v>this[I])return this[a](),null;this[x]&&(v=null),this.buffer.length>1&&!this[x]&&(this.encoding?this.buffer=[this.buffer.join("")]:this.buffer=[Buffer.concat(this.buffer,this[I])]);let k=this[f](v||null,this.buffer[0]);return this[a](),k}[f](v,k){return v===k.length||v===null?this[M]():(this.buffer[0]=k.slice(v),k=k.slice(0,v),this[I]-=v),this.emit("data",k),!this.buffer.length&&!this[o]&&this.emit("drain"),k}end(v,k,S){return typeof v=="function"&&(S=v,v=null),typeof k=="function"&&(S=k,k="utf8"),v&&this.write(v,k),S&&this.once("end",S),this[o]=!0,this.writable=!1,(this.flowing||!this[R])&&this[a](),this}[P](){this[D]||(this[R]=!1,this[E]=!0,this.emit("resume"),this.buffer.length?this[d]():this[o]?this[a]():this.emit("drain"))}resume(){return this[P]()}pause(){this[E]=!1,this[R]=!0}get destroyed(){return this[D]}get flowing(){return this[E]}get paused(){return this[R]}[T](v){this[x]?this[I]+=1:this[I]+=v.length,this.buffer.push(v)}[M](){return this.buffer.length&&(this[x]?this[I]-=1:this[I]-=this.buffer[0].length),this.buffer.shift()}[d](v){do;while(this[m](this[M]()));!v&&!this.buffer.length&&!this[o]&&this.emit("drain")}[m](v){return v?(this.emit("data",v),this.flowing):!1}pipe(v,k){if(this[D])return;let S=this[u];return k=k||{},v===r.stdout||v===r.stderr?k.end=!1:k.end=k.end!==!1,k.proxyErrors=!!k.proxyErrors,S?k.end&&v.end():(this.pipes.push(k.proxyErrors?new g(this,v,k):new q(this,v,k)),this[W]?Q(()=>this[P]()):this[P]()),v}unpipe(v){let k=this.pipes.find(S=>S.dest===v);k&&(this.pipes.splice(this.pipes.indexOf(k),1),k.unpipe())}addListener(v,k){return this.on(v,k)}on(v,k){let S=super.on(v,k);return v==="data"&&!this.pipes.length&&!this.flowing?this[P]():v==="readable"&&this[I]!==0?super.emit("readable"):L(v)&&this[u]?(super.emit(v),this.removeAllListeners(v)):v==="error"&&this[l]&&(this[W]?Q(()=>k.call(this,this[l])):k.call(this,this[l])),S}get emittedEnd(){return this[u]}[a](){!this[c]&&!this[u]&&!this[D]&&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(v,k,...S){if(v!=="error"&&v!=="close"&&v!==D&&this[D])return;if(v==="data")return k?this[W]?Q(()=>this[U](k)):this[U](k):!1;if(v==="end")return this[V]();if(v==="close"){if(this[h]=!0,!this[u]&&!this[D])return;let $=super.emit("close");return this.removeAllListeners("close"),$}else if(v==="error"){this[l]=k;let $=super.emit("error",k);return this[a](),$}else if(v==="resume"){let $=super.emit("resume");return this[a](),$}else if(v==="finish"||v==="prefinish"){let $=super.emit(v);return this.removeAllListeners(v),$}let H=super.emit(v,k,...S);return this[a](),H}[U](v){for(let S of this.pipes)S.dest.write(v)===!1&&this.pause();let k=super.emit("data",v);return this[a](),k}[V](){this[u]||(this[u]=!0,this.readable=!1,this[W]?Q(()=>this[N]()):this[N]())}[N](){if(this[p]){let k=this[p].end();if(k){for(let S of this.pipes)S.dest.write(k);super.emit("data",k)}}for(let k of this.pipes)k.end();let v=super.emit("end");return this.removeAllListeners("end"),v}collect(){let v=[];this[x]||(v.dataLength=0);let k=this.promise();return this.on("data",S=>{v.push(S),this[x]||(v.dataLength+=S.length)}),k.then(()=>v)}concat(){return this[x]?Promise.reject(new Error("cannot concat in objectMode")):this.collect().then(v=>this[x]?Promise.reject(new Error("cannot concat in objectMode")):this[y]?v.join(""):Buffer.concat(v,v.dataLength))}promise(){return new Promise((v,k)=>{this.on(D,()=>k(new Error("stream destroyed"))),this.on("error",S=>k(S)),this.on("end",()=>v())})}[j](){return{next:()=>{let v=this.read();if(v!==null)return Promise.resolve({done:!1,value:v});if(this[o])return Promise.resolve({done:!0});let k=null,S=null,H=fe=>{this.removeListener("data",$),this.removeListener("end",ne),S(fe)},$=fe=>{this.removeListener("error",H),this.removeListener("end",ne),this.pause(),k({value:fe,done:!!this[o]})},ne=()=>{this.removeListener("error",H),this.removeListener("data",$),k({done:!0})},Y=()=>H(new Error("stream destroyed"));return new Promise((fe,J)=>{S=J,k=fe,this.once(D,Y),this.once("error",H),this.once("end",ne),this.once("data",$)})}}}[F](){return{next:()=>{let v=this.read();return{value:v,done:v===null}}}}destroy(v){return this[D]?(v?this.emit("error",v):this.emit(D),this):(this[D]=!0,this.buffer.length=0,this[I]=0,typeof this.close=="function"&&!this[h]&&this.close(),v?this.emit("error",v):this.emit(D),this)}static isStream(v){return!!v&&(v instanceof Gk||v instanceof i||v instanceof n&&(typeof v.pipe=="function"||typeof v.write=="function"&&typeof v.end=="function"))}}}),zk=me(t=>{"use strict";ee();var e=_e("assert"),r=_e("buffer").Buffer,n=_e("zlib"),i=t.constants=aH(),s=$k(),o=r.concat,a=Symbol("_superWrite"),u=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"),l=Symbol("flushFlag"),h=Symbol("finishFlushFlag"),f=Symbol("fullFlushFlag"),d=Symbol("handle"),m=Symbol("onError"),y=Symbol("sawError"),p=Symbol("level"),E=Symbol("strategy"),R=Symbol("ended"),P=Symbol("_defaultFullFlush"),I=class extends s{constructor(L,G){if(!L||typeof L!="object")throw new TypeError("invalid options for ZlibBase constructor");super(L),this[y]=!1,this[R]=!1,this[c]=L,this[l]=L.flush,this[h]=L.finishFlush;try{this[d]=new n[G](L)}catch(Z){throw new u(Z)}this[m]=Z=>{this[y]||(this[y]=!0,this.close(),this.emit("error",Z))},this[d].on("error",Z=>this[m](new u(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),{[l]:L})))}end(L,G,Z){return L&&this.write(L,G),this.flush(this[h]),this[R]=!0,super.end(null,null,Z)}get ended(){return this[R]}write(L,G,Z){if(typeof G=="function"&&(Z=G,G="utf8"),typeof L=="string"&&(L=r.from(L,G)),this[y])return;e(this[d],"zlib binding closed");let q=this[d]._handle,g=q.close;q.close=()=>{};let _=this[d].close;this[d].close=()=>{},r.concat=S=>S;let v;try{let S=typeof L[l]=="number"?L[l]:this[l];v=this[d]._processChunk(L,S),r.concat=o}catch(S){r.concat=o,this[m](new u(S))}finally{this[d]&&(this[d]._handle=q,q.close=g,this[d].close=_,this[d].removeAllListeners("error"))}this[d]&&this[d].on("error",S=>this[m](new u(S)));let k;if(v)if(Array.isArray(v)&&v.length>0){k=this[a](r.from(v[0]));for(let S=1;S<v.length;S++)k=this[a](v[S])}else k=this[a](r.from(v));return Z&&Z(),k}[a](L){return super.write(L)}},T=class extends I{constructor(L,G){L=L||{},L.flush=L.flush||i.Z_NO_FLUSH,L.finishFlush=L.finishFlush||i.Z_FINISH,super(L,G),this[f]=i.Z_FULL_FLUSH,this[p]=L.level,this[E]=L.strategy}params(L,G){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[p]!==L||this[E]!==G){this.flush(i.Z_SYNC_FLUSH),e(this[d],"zlib binding closed");let Z=this[d].flush;this[d].flush=(q,g)=>{this.flush(q),g()};try{this[d].params(L,G)}finally{this[d].flush=Z}this[d]&&(this[p]=L,this[E]=G)}}}},M=class extends T{constructor(L){super(L,"Deflate")}},x=class extends T{constructor(L){super(L,"Inflate")}},D=Symbol("_portable"),U=class extends T{constructor(L){super(L,"Gzip"),this[D]=L&&!!L.portable}[a](L){return this[D]?(this[D]=!1,L[9]=255,super[a](L)):super[a](L)}},V=class extends T{constructor(L){super(L,"Gunzip")}},N=class extends T{constructor(L){super(L,"DeflateRaw")}},W=class extends T{constructor(L){super(L,"InflateRaw")}},Q=class extends T{constructor(L){super(L,"Unzip")}},te=class extends I{constructor(L,G){L=L||{},L.flush=L.flush||i.BROTLI_OPERATION_PROCESS,L.finishFlush=L.finishFlush||i.BROTLI_OPERATION_FINISH,super(L,G),this[f]=i.BROTLI_OPERATION_FLUSH}},j=class extends te{constructor(L){super(L,"BrotliCompress")}},F=class extends te{constructor(L){super(L,"BrotliDecompress")}};t.Deflate=M,t.Inflate=x,t.Gzip=U,t.Gunzip=V,t.DeflateRaw=N,t.InflateRaw=W,t.Unzip=Q,typeof n.BrotliCompress=="function"?(t.BrotliCompress=j,t.BrotliDecompress=F):t.BrotliCompress=t.BrotliDecompress=class{constructor(){throw new Error("Brotli is not supported in this version of Node.js")}}}),La=me((t,e)=>{ee();var r=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform;e.exports=r!=="win32"?n=>n:n=>n&&n.replace(/\\/g,"/")}),ng=me((t,e)=>{"use strict";ee();var r=rg(),n=La(),i=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=n(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=n(s.linkpath),this.uname=s.uname,this.gname=s.gname,o&&this[i](o),a&&this[i](a,!0)}write(s){let o=s.length;if(o>this.blockRemain)throw new Error("writing more to entry than is appropriate");let a=this.remain,u=this.blockRemain;return this.remain=Math.max(0,a-o),this.blockRemain=Math.max(0,u-o),this.ignore?!0:a>=o?super.write(s):super.write(s.slice(0,a))}[i](s,o){for(let a in s)s[a]!==null&&s[a]!==void 0&&!(o&&a==="path")&&(this[a]=a==="path"||a==="linkpath"?n(s[a]):s[a])}}}),Vk=me(t=>{"use strict";ee(),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]]))}),uH=me((t,e)=>{"use strict";ee();var r=(l,h)=>{if(Number.isSafeInteger(l))l<0?i(l,h):n(l,h);else throw Error("cannot encode number outside of javascript safe integer range");return h},n=(l,h)=>{h[0]=128;for(var f=h.length;f>1;f--)h[f-1]=l&255,l=Math.floor(l/256)},i=(l,h)=>{h[0]=255;var f=!1;l=l*-1;for(var d=h.length;d>1;d--){var m=l&255;l=Math.floor(l/256),f?h[d-1]=u(m):m===0?h[d-1]=0:(f=!0,h[d-1]=c(m))}},s=l=>{let h=l[0],f=h===128?a(l.slice(1,l.length)):h===255?o(l):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=l=>{for(var h=l.length,f=0,d=!1,m=h-1;m>-1;m--){var y=l[m],p;d?p=u(y):y===0?p=y:(d=!0,p=c(y)),p!==0&&(f-=p*Math.pow(256,h-m-1))}return f},a=l=>{for(var h=l.length,f=0,d=h-1;d>-1;d--){var m=l[d];m!==0&&(f+=m*Math.pow(256,h-d-1))}return f},u=l=>(255^l)&255,c=l=>(255^l)+1&255;e.exports={encode:r,parse:s}}),Ba=me((t,e)=>{"use strict";ee();var r=Vk(),n=_e("path").posix,i=uH(),s=Symbol("slurp"),o=Symbol("type"),a=class{constructor(x,D,U,V){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(x)?this.decode(x,D||0,U,V):x&&this.set(x)}decode(x,D,U,V){if(D||(D=0),!x||!(x.length>=D+512))throw new Error("need 512 bytes for header");if(this.path=c(x,D,100),this.mode=f(x,D+100,8),this.uid=f(x,D+108,8),this.gid=f(x,D+116,8),this.size=f(x,D+124,12),this.mtime=l(x,D+136,12),this.cksum=f(x,D+148,12),this[s](U),this[s](V,!0),this[o]=c(x,D+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(x,D+157,100),x.slice(D+257,D+265).toString()==="ustar\x0000")if(this.uname=c(x,D+265,32),this.gname=c(x,D+297,32),this.devmaj=f(x,D+329,8),this.devmin=f(x,D+337,8),x[D+475]!==0){let W=c(x,D+345,155);this.path=W+"/"+this.path}else{let W=c(x,D+345,130);W&&(this.path=W+"/"+this.path),this.atime=l(x,D+476,12),this.ctime=l(x,D+488,12)}let N=8*32;for(let W=D;W<D+148;W++)N+=x[W];for(let W=D+156;W<D+512;W++)N+=x[W];this.cksumValid=N===this.cksum,this.cksum===null&&N===8*32&&(this.nullBlock=!0)}[s](x,D){for(let U in x)x[U]!==null&&x[U]!==void 0&&!(D&&U==="path")&&(this[U]=x[U])}encode(x,D){if(x||(x=this.block=Buffer.alloc(512),D=0),D||(D=0),!(x.length>=D+512))throw new Error("need 512 bytes for header");let U=this.ctime||this.atime?130:155,V=u(this.path||"",U),N=V[0],W=V[1];this.needPax=V[2],this.needPax=M(x,D,100,N)||this.needPax,this.needPax=p(x,D+100,8,this.mode)||this.needPax,this.needPax=p(x,D+108,8,this.uid)||this.needPax,this.needPax=p(x,D+116,8,this.gid)||this.needPax,this.needPax=p(x,D+124,12,this.size)||this.needPax,this.needPax=I(x,D+136,12,this.mtime)||this.needPax,x[D+156]=this[o].charCodeAt(0),this.needPax=M(x,D+157,100,this.linkpath)||this.needPax,x.write("ustar\x0000",D+257,8),this.needPax=M(x,D+265,32,this.uname)||this.needPax,this.needPax=M(x,D+297,32,this.gname)||this.needPax,this.needPax=p(x,D+329,8,this.devmaj)||this.needPax,this.needPax=p(x,D+337,8,this.devmin)||this.needPax,this.needPax=M(x,D+345,U,W)||this.needPax,x[D+475]!==0?this.needPax=M(x,D+345,155,W)||this.needPax:(this.needPax=M(x,D+345,130,W)||this.needPax,this.needPax=I(x,D+476,12,this.atime)||this.needPax,this.needPax=I(x,D+488,12,this.ctime)||this.needPax);let Q=8*32;for(let te=D;te<D+148;te++)Q+=x[te];for(let te=D+156;te<D+512;te++)Q+=x[te];return this.cksum=Q,p(x,D+148,8,this.cksum),this.cksumValid=!0,this.needPax}set(x){for(let D in x)x[D]!==null&&x[D]!==void 0&&(this[D]=x[D])}get type(){return r.name.get(this[o])||this[o]}get typeKey(){return this[o]}set type(x){r.code.has(x)?this[o]=r.code.get(x):this[o]=x}},u=(x,D)=>{let U=x,V="",N,W=n.parse(x).root||".";if(Buffer.byteLength(U)<100)N=[U,V,!1];else{V=n.dirname(U),U=n.basename(U);do Buffer.byteLength(U)<=100&&Buffer.byteLength(V)<=D?N=[U,V,!1]:Buffer.byteLength(U)>100&&Buffer.byteLength(V)<=D?N=[U.slice(0,100-1),V,!0]:(U=n.join(n.basename(V),U),V=n.dirname(V));while(V!==W&&!N);N||(N=[x.slice(0,100-1),"",!0])}return N},c=(x,D,U)=>x.slice(D,D+U).toString("utf8").replace(/\0.*/,""),l=(x,D,U)=>h(f(x,D,U)),h=x=>x===null?null:new Date(x*1e3),f=(x,D,U)=>x[D]&128?i.parse(x.slice(D,D+U)):m(x,D,U),d=x=>isNaN(x)?null:x,m=(x,D,U)=>d(parseInt(x.slice(D,D+U).toString("utf8").replace(/\0.*$/,"").trim(),8)),y={12:8589934591,8:2097151},p=(x,D,U,V)=>V===null?!1:V>y[U]||V<0?(i.encode(V,x.slice(D,D+U)),!0):(E(x,D,U,V),!1),E=(x,D,U,V)=>x.write(R(V,U),D,U,"ascii"),R=(x,D)=>P(Math.floor(x).toString(8),D),P=(x,D)=>(x.length===D-1?x:new Array(D-x.length-1).join("0")+x+" ")+"\0",I=(x,D,U,V)=>V===null?!1:p(x,D,U,V.getTime()/1e3),T=new Array(156).join("\0"),M=(x,D,U,V)=>V===null?!1:(x.write(V+T,D,U,"utf8"),V.length!==Buffer.byteLength(V)||V.length>U);e.exports=a}),ig=me((t,e)=>{"use strict";ee();var r=Ba(),n=_e("path"),i=class{constructor(u,c){this.atime=u.atime||null,this.charset=u.charset||null,this.comment=u.comment||null,this.ctime=u.ctime||null,this.gid=u.gid||null,this.gname=u.gname||null,this.linkpath=u.linkpath||null,this.mtime=u.mtime||null,this.path=u.path||null,this.size=u.size||null,this.uid=u.uid||null,this.uname=u.uname||null,this.dev=u.dev||null,this.ino=u.ino||null,this.nlink=u.nlink||null,this.global=c||!1}encode(){let u=this.encodeBody();if(u==="")return null;let c=Buffer.byteLength(u),l=512*Math.ceil(1+c/512),h=Buffer.allocUnsafe(l);for(let f=0;f<512;f++)h[f]=0;new r({path:("PaxHeader/"+n.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(u,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(u){if(this[u]===null||this[u]===void 0)return"";let c=this[u]instanceof Date?this[u].getTime()/1e3:this[u],l=" "+(u==="dev"||u==="ino"||u==="nlink"?"SCHILY.":"")+u+"="+c+`
|
64
64
|
`,h=Buffer.byteLength(l),f=Math.floor(Math.log(h)/Math.log(10))+1;return h+f>=Math.pow(10,f)&&(f+=1),f+h+l}};i.parse=(u,c,l)=>new i(s(o(u),c),l);var s=(u,c)=>c?Object.keys(u).reduce((l,h)=>(l[h]=u[h],l),c):u,o=u=>u.replace(/\n$/,"").split(`
|
65
|
-
`).reduce(a,Object.create(null)),a=(u,c)=>{let l=parseInt(c,10);if(l!==Buffer.byteLength(c)+1)return u;c=c.slice((l+" ").length);let h=c.split("="),f=h.shift().replace(/^SCHILY\.(dev|ino|nlink)/,"$1");if(!f)return u;let d=h.join("=");return u[f]=/^([A-Z]+\.)?([mac]|birth|creation)time$/.test(f)?new Date(d*1e3):/^[0-9]+$/.test(d)?+d:d,u};e.exports=i}),Na=me((t,e)=>{ee(),e.exports=r=>{let n=r.length-1,i=-1;for(;n>-1&&r.charAt(n)==="/";)i=n,n--;return i===-1?r:r.slice(0,i)}}),sg=me((t,e)=>{"use strict";ee(),e.exports=r=>class extends r{warn(n,i,s={}){this.file&&(s.file=this.file),this.cwd&&(s.cwd=this.cwd),s.code=i instanceof Error&&i.code||n,s.tarCode=n,!this.strict&&s.recoverable!==!1?(i instanceof Error&&(s=Object.assign(i,s),i=i.message),this.emit("warn",s.tarCode,i,s)):i instanceof Error?this.emit("error",Object.assign(i,s)):this.emit("error",Object.assign(new Error(`${n}: ${i}`),s))}}}),Wk=me((t,e)=>{"use strict";ee();var r=["|","<",">","?",":"],n=r.map(o=>String.fromCharCode(61440+o.charCodeAt(0))),i=new Map(r.map((o,a)=>[o,n[a]])),s=new Map(n.map((o,a)=>[o,r[a]]));e.exports={encode:o=>r.reduce((a,u)=>a.split(u).join(i.get(u)),o),decode:o=>n.reduce((a,u)=>a.split(u).join(s.get(u)),o)}}),Yk=me((t,e)=>{ee();var{isAbsolute:r,parse:n}=_e("path").win32;e.exports=i=>{let s="",o=n(i);for(;r(i)||o.root;){let a=i.charAt(0)==="/"&&i.slice(0,4)!=="//?/"?"/":o.root;i=i.slice(a.length),s+=a,o=n(i)}return[s,i]}}),cH=me((t,e)=>{"use strict";ee(),e.exports=(r,n,i)=>(r&=4095,i&&(r=(r|384)&-19),n&&(r&256&&(r|=64),r&32&&(r|=8),r&4&&(r|=1)),r)}),Kk=me((t,e)=>{"use strict";ee();var r=rg(),n=ig(),i=Ba(),s=_e("fs"),o=_e("path"),a=La(),u=Na(),c=(_,v)=>v?(_=a(_).replace(/^\.(\/|$)/,""),u(v)+"/"+_):a(_),l=16*1024*1024,h=Symbol("process"),f=Symbol("file"),d=Symbol("directory"),m=Symbol("symlink"),y=Symbol("hardlink"),p=Symbol("header"),E=Symbol("read"),R=Symbol("lstat"),P=Symbol("onlstat"),I=Symbol("onread"),T=Symbol("onreadlink"),M=Symbol("openfile"),x=Symbol("onopenfile"),D=Symbol("close"),U=Symbol("mode"),V=Symbol("awaitDrain"),N=Symbol("ondrain"),W=Symbol("prefix"),Q=Symbol("hadError"),te=sg(),j=Wk(),F=Yk(),L=cH(),G=te(class extends r{constructor(_,v){if(v=v||{},super(v),typeof _!="string")throw new TypeError("path is required");this.path=a(_),this.portable=!!v.portable,this.myuid=process.getuid&&process.getuid()||0,this.myuser=process.env.USER||"",this.maxReadSize=v.maxReadSize||l,this.linkCache=v.linkCache||new Map,this.statCache=v.statCache||new Map,this.preservePaths=!!v.preservePaths,this.cwd=a(v.cwd||process.cwd()),this.strict=!!v.strict,this.noPax=!!v.noPax,this.noMtime=!!v.noMtime,this.mtime=v.mtime||null,this.prefix=v.prefix?a(v.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 v.onwarn=="function"&&this.on("warn",v.onwarn);let k=!1;if(!this.preservePaths){let[S,H]=F(this.path);S&&(this.path=H,k=S)}this.win32=!!v.win32||process.platform==="win32",this.win32&&(this.path=j.decode(this.path.replace(/\\/g,"/")),_=_.replace(/\\/g,"/")),this.absolute=a(v.absolute||o.resolve(this.cwd,_)),this.path===""&&(this.path="./"),k&&this.warn("TAR_ENTRY_INFO",`stripping ${k} from absolute path`,{entry:this,path:k+this.path}),this.statCache.has(this.absolute)?this[P](this.statCache.get(this.absolute)):this[R]()}emit(_,...v){return _==="error"&&(this[Q]=!0),super.emit(_,...v)}[R](){s.lstat(this.absolute,(_,v)=>{if(_)return this.emit("error",_);this[P](v)})}[P](_){this.statCache.set(this.absolute,_),this.stat=_,_.isFile()||(_.size=0),this.type=g(_),this.emit("stat",_),this[h]()}[h](){switch(this.type){case"File":return this[f]();case"Directory":return this[d]();case"SymbolicLink":return this[m]();default:return this.end()}}[U](_){return L(_,this.type==="Directory",this.portable)}[W](_){return c(_,this.prefix)}[p](){this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.header=new i({path:this[W](this.path),linkpath:this.type==="Link"?this[W](this.linkpath):this.linkpath,mode:this[U](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 n({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[W](this.path),linkpath:this.type==="Link"?this[W](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[p](),this.end()}[m](){s.readlink(this.absolute,(_,v)=>{if(_)return this.emit("error",_);this[T](v)})}[T](_){this.linkpath=a(_),this[p](),this.end()}[y](_){this.type="Link",this.linkpath=a(o.relative(this.cwd,_)),this.stat.size=0,this[p](),this.end()}[f](){if(this.stat.nlink>1){let _=this.stat.dev+":"+this.stat.ino;if(this.linkCache.has(_)){let v=this.linkCache.get(_);if(v.indexOf(this.cwd)===0)return this[y](v)}this.linkCache.set(_,this.absolute)}if(this[p](),this.stat.size===0)return this.end();this[M]()}[M](){s.open(this.absolute,"r",(_,v)=>{if(_)return this.emit("error",_);this[x](v)})}[x](_){if(this.fd=_,this[Q])return this[D]();this.blockLen=512*Math.ceil(this.stat.size/512),this.blockRemain=this.blockLen;let v=Math.min(this.blockLen,this.maxReadSize);this.buf=Buffer.allocUnsafe(v),this.offset=0,this.pos=0,this.remain=this.stat.size,this.length=this.buf.length,this[E]()}[E](){let{fd:_,buf:v,offset:k,length:S,pos:H}=this;s.read(_,v,k,S,H,($,ne)=>{if($)return this[D](()=>this.emit("error",$));this[I](ne)})}[D](_){s.close(this.fd,_)}[I](_){if(_<=0&&this.remain>0){let k=new Error("encountered unexpected EOF");return k.path=this.absolute,k.syscall="read",k.code="EOF",this[D](()=>this.emit("error",k))}if(_>this.remain){let k=new Error("did not encounter expected EOF");return k.path=this.absolute,k.syscall="read",k.code="EOF",this[D](()=>this.emit("error",k))}if(_===this.remain)for(let k=_;k<this.length&&_<this.blockRemain;k++)this.buf[k+this.offset]=0,_++,this.remain++;let v=this.offset===0&&_===this.buf.length?this.buf:this.buf.slice(this.offset,this.offset+_);this.write(v)?this[N]():this[V](()=>this[N]())}[V](_){this.once("drain",_)}write(_){if(this.blockRemain<_.length){let v=new Error("writing more data than expected");return v.path=this.absolute,this.emit("error",v)}return this.remain-=_.length,this.blockRemain-=_.length,this.pos+=_.length,this.offset+=_.length,super.write(_)}[N](){if(!this.remain)return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),this[D](_=>_?this.emit("error",_):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[E]()}}),Z=class extends G{[R](){this[P](s.lstatSync(this.absolute))}[m](){this[T](s.readlinkSync(this.absolute))}[M](){this[x](s.openSync(this.absolute,"r"))}[E](){let _=!0;try{let{fd:v,buf:k,offset:S,length:H,pos:$}=this,ne=s.readSync(v,k,S,H,$);this[I](ne),_=!1}finally{if(_)try{this[D](()=>{})}catch{}}}[V](_){_()}[D](_){s.closeSync(this.fd),_()}},q=te(class extends r{constructor(_,v){v=v||{},super(v),this.preservePaths=!!v.preservePaths,this.portable=!!v.portable,this.strict=!!v.strict,this.noPax=!!v.noPax,this.noMtime=!!v.noMtime,this.readEntry=_,this.type=_.type,this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.prefix=v.prefix||null,this.path=a(_.path),this.mode=this[U](_.mode),this.uid=this.portable?null:_.uid,this.gid=this.portable?null:_.gid,this.uname=this.portable?null:_.uname,this.gname=this.portable?null:_.gname,this.size=_.size,this.mtime=this.noMtime?null:v.mtime||_.mtime,this.atime=this.portable?null:_.atime,this.ctime=this.portable?null:_.ctime,this.linkpath=a(_.linkpath),typeof v.onwarn=="function"&&this.on("warn",v.onwarn);let k=!1;if(!this.preservePaths){let[S,H]=F(this.path);S&&(this.path=H,k=S)}this.remain=_.size,this.blockRemain=_.startBlockSize,this.header=new i({path:this[W](this.path),linkpath:this.type==="Link"?this[W](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}),k&&this.warn("TAR_ENTRY_INFO",`stripping ${k} from absolute path`,{entry:this,path:k+this.path}),this.header.encode()&&!this.noPax&&super.write(new n({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[W](this.path),linkpath:this.type==="Link"?this[W](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),_.pipe(this)}[W](_){return c(_,this.prefix)}[U](_){return L(_,this.type==="Directory",this.portable)}write(_){let v=_.length;if(v>this.blockRemain)throw new Error("writing more to entry than is appropriate");return this.blockRemain-=v,super.write(_)}end(){return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),super.end()}});G.Sync=Z,G.Tar=q;var g=_=>_.isFile()?"File":_.isDirectory()?"Directory":_.isSymbolicLink()?"SymbolicLink":"Unsupported";e.exports=G}),lH=me((t,e)=>{"use strict";ee(),e.exports=function(r){r.prototype[Symbol.iterator]=function*(){for(let n=this.head;n;n=n.next)yield n.value}}}),Zk=me((t,e)=>{"use strict";ee(),e.exports=r,r.Node=o,r.create=r;function r(a){var u=this;if(u instanceof r||(u=new r),u.tail=null,u.head=null,u.length=0,a&&typeof a.forEach=="function")a.forEach(function(h){u.push(h)});else if(arguments.length>0)for(var c=0,l=arguments.length;c<l;c++)u.push(arguments[c]);return u}r.prototype.removeNode=function(a){if(a.list!==this)throw new Error("removing node which does not belong to this list");var u=a.next,c=a.prev;return u&&(u.prev=c),c&&(c.next=u),a===this.head&&(this.head=u),a===this.tail&&(this.tail=c),a.list.length--,a.next=null,a.prev=null,a.list=null,u},r.prototype.unshiftNode=function(a){if(a!==this.head){a.list&&a.list.removeNode(a);var u=this.head;a.list=this,a.next=u,u&&(u.prev=a),this.head=a,this.tail||(this.tail=a),this.length++}},r.prototype.pushNode=function(a){if(a!==this.tail){a.list&&a.list.removeNode(a);var u=this.tail;a.list=this,a.prev=u,u&&(u.next=a),this.tail=a,this.head||(this.head=a),this.length++}},r.prototype.push=function(){for(var a=0,u=arguments.length;a<u;a++)i(this,arguments[a]);return this.length},r.prototype.unshift=function(){for(var a=0,u=arguments.length;a<u;a++)s(this,arguments[a]);return this.length},r.prototype.pop=function(){if(this.tail){var a=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,a}},r.prototype.shift=function(){if(this.head){var a=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,a}},r.prototype.forEach=function(a,u){u=u||this;for(var c=this.head,l=0;c!==null;l++)a.call(u,c.value,l,this),c=c.next},r.prototype.forEachReverse=function(a,u){u=u||this;for(var c=this.tail,l=this.length-1;c!==null;l--)a.call(u,c.value,l,this),c=c.prev},r.prototype.get=function(a){for(var u=0,c=this.head;c!==null&&u<a;u++)c=c.next;if(u===a&&c!==null)return c.value},r.prototype.getReverse=function(a){for(var u=0,c=this.tail;c!==null&&u<a;u++)c=c.prev;if(u===a&&c!==null)return c.value},r.prototype.map=function(a,u){u=u||this;for(var c=new r,l=this.head;l!==null;)c.push(a.call(u,l.value,this)),l=l.next;return c},r.prototype.mapReverse=function(a,u){u=u||this;for(var c=new r,l=this.tail;l!==null;)c.push(a.call(u,l.value,this)),l=l.prev;return c},r.prototype.reduce=function(a,u){var c,l=this.head;if(arguments.length>1)c=u;else if(this.head)l=this.head.next,c=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var h=0;l!==null;h++)c=a(c,l.value,h),l=l.next;return c},r.prototype.reduceReverse=function(a,u){var c,l=this.tail;if(arguments.length>1)c=u;else if(this.tail)l=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;l!==null;h--)c=a(c,l.value,h),l=l.prev;return c},r.prototype.toArray=function(){for(var a=new Array(this.length),u=0,c=this.head;c!==null;u++)a[u]=c.value,c=c.next;return a},r.prototype.toArrayReverse=function(){for(var a=new Array(this.length),u=0,c=this.tail;c!==null;u++)a[u]=c.value,c=c.prev;return a},r.prototype.slice=function(a,u){u=u||this.length,u<0&&(u+=this.length),a=a||0,a<0&&(a+=this.length);var c=new r;if(u<a||u<0)return c;a<0&&(a=0),u>this.length&&(u=this.length);for(var l=0,h=this.head;h!==null&&l<a;l++)h=h.next;for(;h!==null&&l<u;l++,h=h.next)c.push(h.value);return c},r.prototype.sliceReverse=function(a,u){u=u||this.length,u<0&&(u+=this.length),a=a||0,a<0&&(a+=this.length);var c=new r;if(u<a||u<0)return c;a<0&&(a=0),u>this.length&&(u=this.length);for(var l=this.length,h=this.tail;h!==null&&l>u;l--)h=h.prev;for(;h!==null&&l>a;l--,h=h.prev)c.push(h.value);return c},r.prototype.splice=function(a,u,...c){a>this.length&&(a=this.length-1),a<0&&(a=this.length+a);for(var l=0,h=this.head;h!==null&&l<a;l++)h=h.next;for(var f=[],l=0;h&&l<u;l++)f.push(h.value),h=this.removeNode(h);h===null&&(h=this.tail),h!==this.head&&h!==this.tail&&(h=h.prev);for(var l=0;l<c.length;l++)h=n(this,h,c[l]);return f},r.prototype.reverse=function(){for(var a=this.head,u=this.tail,c=a;c!==null;c=c.prev){var l=c.prev;c.prev=c.next,c.next=l}return this.head=u,this.tail=a,this};function n(a,u,c){var l=u===a.head?new o(c,null,u,a):new o(c,u,u.next,a);return l.next===null&&(a.tail=l),l.prev===null&&(a.head=l),a.length++,l}function i(a,u){a.tail=new o(u,a.tail,null,a),a.head||(a.head=a.tail),a.length++}function s(a,u){a.head=new o(u,null,a.head,a),a.tail||(a.tail=a.head),a.length++}function o(a,u,c,l){if(!(this instanceof o))return new o(a,u,c,l);this.list=l,this.value=a,u?(u.next=this,this.prev=u):this.prev=null,c?(c.prev=this,this.next=c):this.next=null}try{lH()(r)}catch{}}),og=me((t,e)=>{"use strict";ee();var r=class{constructor(g,_){this.path=g||"./",this.absolute=_,this.entry=null,this.stat=null,this.readdir=null,this.pending=!1,this.ignore=!1,this.piped=!1}},n=rg(),i=zk(),s=ng(),o=Kk(),a=o.Sync,u=o.Tar,c=Zk(),l=Buffer.alloc(1024),h=Symbol("onStat"),f=Symbol("ended"),d=Symbol("queue"),m=Symbol("current"),y=Symbol("process"),p=Symbol("processing"),E=Symbol("processJob"),R=Symbol("jobs"),P=Symbol("jobDone"),I=Symbol("addFSEntry"),T=Symbol("addTarEntry"),M=Symbol("stat"),x=Symbol("readdir"),D=Symbol("onreaddir"),U=Symbol("pipe"),V=Symbol("entry"),N=Symbol("entryOpt"),W=Symbol("writeEntryClass"),Q=Symbol("write"),te=Symbol("ondrain"),j=_e("fs"),F=_e("path"),L=sg(),G=La(),Z=L(class extends n{constructor(g){super(g),g=g||Object.create(null),this.opt=g,this.file=g.file||"",this.cwd=g.cwd||process.cwd(),this.maxReadSize=g.maxReadSize,this.preservePaths=!!g.preservePaths,this.strict=!!g.strict,this.noPax=!!g.noPax,this.prefix=G(g.prefix||""),this.linkCache=g.linkCache||new Map,this.statCache=g.statCache||new Map,this.readdirCache=g.readdirCache||new Map,this[W]=o,typeof g.onwarn=="function"&&this.on("warn",g.onwarn),this.portable=!!g.portable,this.zip=null,g.gzip?(typeof g.gzip!="object"&&(g.gzip={}),this.portable&&(g.gzip.portable=!0),this.zip=new i.Gzip(g.gzip),this.zip.on("data",_=>super.write(_)),this.zip.on("end",_=>super.end()),this.zip.on("drain",_=>this[te]()),this.on("resume",_=>this.zip.resume())):this.on("drain",this[te]),this.noDirRecurse=!!g.noDirRecurse,this.follow=!!g.follow,this.noMtime=!!g.noMtime,this.mtime=g.mtime||null,this.filter=typeof g.filter=="function"?g.filter:_=>!0,this[d]=new c,this[R]=0,this.jobs=+g.jobs||4,this[p]=!1,this[f]=!1}[Q](g){return super.write(g)}add(g){return this.write(g),this}end(g){return g&&this.write(g),this[f]=!0,this[y](),this}write(g){if(this[f])throw new Error("write after end");return g instanceof s?this[T](g):this[I](g),this.flowing}[T](g){let _=G(F.resolve(this.cwd,g.path));if(!this.filter(g.path,g))g.resume();else{let v=new r(g.path,_,!1);v.entry=new u(g,this[N](v)),v.entry.on("end",k=>this[P](v)),this[R]+=1,this[d].push(v)}this[y]()}[I](g){let _=G(F.resolve(this.cwd,g));this[d].push(new r(g,_)),this[y]()}[M](g){g.pending=!0,this[R]+=1;let _=this.follow?"stat":"lstat";j[_](g.absolute,(v,k)=>{g.pending=!1,this[R]-=1,v?this.emit("error",v):this[h](g,k)})}[h](g,_){this.statCache.set(g.absolute,_),g.stat=_,this.filter(g.path,_)||(g.ignore=!0),this[y]()}[x](g){g.pending=!0,this[R]+=1,j.readdir(g.absolute,(_,v)=>{if(g.pending=!1,this[R]-=1,_)return this.emit("error",_);this[D](g,v)})}[D](g,_){this.readdirCache.set(g.absolute,_),g.readdir=_,this[y]()}[y](){if(!this[p]){this[p]=!0;for(let g=this[d].head;g!==null&&this[R]<this.jobs;g=g.next)if(this[E](g.value),g.value.ignore){let _=g.next;this[d].removeNode(g),g.next=_}this[p]=!1,this[f]&&!this[d].length&&this[R]===0&&(this.zip?this.zip.end(l):(super.write(l),super.end()))}}get[m](){return this[d]&&this[d].head&&this[d].head.value}[P](g){this[d].shift(),this[R]-=1,this[y]()}[E](g){if(!g.pending){if(g.entry){g===this[m]&&!g.piped&&this[U](g);return}if(g.stat||(this.statCache.has(g.absolute)?this[h](g,this.statCache.get(g.absolute)):this[M](g)),!!g.stat&&!g.ignore&&!(!this.noDirRecurse&&g.stat.isDirectory()&&!g.readdir&&(this.readdirCache.has(g.absolute)?this[D](g,this.readdirCache.get(g.absolute)):this[x](g),!g.readdir))){if(g.entry=this[V](g),!g.entry){g.ignore=!0;return}g===this[m]&&!g.piped&&this[U](g)}}}[N](g){return{onwarn:(_,v,k)=>this.warn(_,v,k),noPax:this.noPax,cwd:this.cwd,absolute:g.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}}[V](g){this[R]+=1;try{return new this[W](g.path,this[N](g)).on("end",()=>this[P](g)).on("error",_=>this.emit("error",_))}catch(_){this.emit("error",_)}}[te](){this[m]&&this[m].entry&&this[m].entry.resume()}[U](g){g.piped=!0,g.readdir&&g.readdir.forEach(k=>{let S=g.path,H=S==="./"?"":S.replace(/\/*$/,"/");this[I](H+k)});let _=g.entry,v=this.zip;v?_.on("data",k=>{v.write(k)||_.pause()}):_.on("data",k=>{super.write(k)||_.pause()})}pause(){return this.zip&&this.zip.pause(),super.pause()}}),q=class extends Z{constructor(g){super(g),this[W]=a}pause(){}resume(){}[M](g){let _=this.follow?"statSync":"lstatSync";this[h](g,j[_](g.absolute))}[x](g,_){this[D](g,j.readdirSync(g.absolute))}[U](g){let _=g.entry,v=this.zip;g.readdir&&g.readdir.forEach(k=>{let S=g.path,H=S==="./"?"":S.replace(/\/*$/,"/");this[I](H+k)}),v?_.on("data",k=>{v.write(k)}):_.on("data",k=>{super[Q](k)})}};Z.Sync=q,e.exports=Z}),Ma=me(t=>{"use strict";ee();var e=$k(),r=_e("events").EventEmitter,n=_e("fs"),i=n.writev;if(!i){let g=process.binding("fs"),_=g.FSReqWrap||g.FSReqCallback;i=(v,k,S,H)=>{let $=(Y,fe)=>H(Y,fe,k),ne=new _;ne.oncomplete=$,g.writeBuffers(v,k,S,ne)}}var s=Symbol("_autoClose"),o=Symbol("_close"),a=Symbol("_ended"),u=Symbol("_fd"),c=Symbol("_finished"),l=Symbol("_flags"),h=Symbol("_flush"),f=Symbol("_handleChunk"),d=Symbol("_makeBuf"),m=Symbol("_mode"),y=Symbol("_needDrain"),p=Symbol("_onerror"),E=Symbol("_onopen"),R=Symbol("_onread"),P=Symbol("_onwrite"),I=Symbol("_open"),T=Symbol("_path"),M=Symbol("_pos"),x=Symbol("_queue"),D=Symbol("_read"),U=Symbol("_readSize"),V=Symbol("_reading"),N=Symbol("_remain"),W=Symbol("_size"),Q=Symbol("_write"),te=Symbol("_writing"),j=Symbol("_defaultFlag"),F=Symbol("_errored"),L=class extends e{constructor(g,_){if(_=_||{},super(_),this.readable=!0,this.writable=!1,typeof g!="string")throw new TypeError("path must be a string");this[F]=!1,this[u]=typeof _.fd=="number"?_.fd:null,this[T]=g,this[U]=_.readSize||16*1024*1024,this[V]=!1,this[W]=typeof _.size=="number"?_.size:1/0,this[N]=this[W],this[s]=typeof _.autoClose=="boolean"?_.autoClose:!0,typeof this[u]=="number"?this[D]():this[I]()}get fd(){return this[u]}get path(){return this[T]}write(){throw new TypeError("this is a readable stream")}end(){throw new TypeError("this is a readable stream")}[I](){n.open(this[T],"r",(g,_)=>this[E](g,_))}[E](g,_){g?this[p](g):(this[u]=_,this.emit("open",_),this[D]())}[d](){return Buffer.allocUnsafe(Math.min(this[U],this[N]))}[D](){if(!this[V]){this[V]=!0;let g=this[d]();if(g.length===0)return process.nextTick(()=>this[R](null,0,g));n.read(this[u],g,0,g.length,null,(_,v,k)=>this[R](_,v,k))}}[R](g,_,v){this[V]=!1,g?this[p](g):this[f](_,v)&&this[D]()}[o](){if(this[s]&&typeof this[u]=="number"){let g=this[u];this[u]=null,n.close(g,_=>_?this.emit("error",_):this.emit("close"))}}[p](g){this[V]=!0,this[o](),this.emit("error",g)}[f](g,_){let v=!1;return this[N]-=g,g>0&&(v=super.write(g<_.length?_.slice(0,g):_)),(g===0||this[N]<=0)&&(v=!1,this[o](),super.end()),v}emit(g,_){switch(g){case"prefinish":case"finish":break;case"drain":typeof this[u]=="number"&&this[D]();break;case"error":return this[F]?void 0:(this[F]=!0,super.emit(g,_));default:return super.emit(g,_)}}},G=class extends L{[I](){let g=!0;try{this[E](null,n.openSync(this[T],"r")),g=!1}finally{g&&this[o]()}}[D](){let g=!0;try{if(!this[V]){this[V]=!0;do{let _=this[d](),v=_.length===0?0:n.readSync(this[u],_,0,_.length,null);if(!this[f](v,_))break}while(!0);this[V]=!1}g=!1}finally{g&&this[o]()}}[o](){if(this[s]&&typeof this[u]=="number"){let g=this[u];this[u]=null,n.closeSync(g),this.emit("close")}}},Z=class extends r{constructor(g,_){_=_||{},super(_),this.readable=!1,this.writable=!0,this[F]=!1,this[te]=!1,this[a]=!1,this[y]=!1,this[x]=[],this[T]=g,this[u]=typeof _.fd=="number"?_.fd:null,this[m]=_.mode===void 0?438:_.mode,this[M]=typeof _.start=="number"?_.start:null,this[s]=typeof _.autoClose=="boolean"?_.autoClose:!0;let v=this[M]!==null?"r+":"w";this[j]=_.flags===void 0,this[l]=this[j]?v:_.flags,this[u]===null&&this[I]()}emit(g,_){if(g==="error"){if(this[F])return;this[F]=!0}return super.emit(g,_)}get fd(){return this[u]}get path(){return this[T]}[p](g){this[o](),this[te]=!0,this.emit("error",g)}[I](){n.open(this[T],this[l],this[m],(g,_)=>this[E](g,_))}[E](g,_){this[j]&&this[l]==="r+"&&g&&g.code==="ENOENT"?(this[l]="w",this[I]()):g?this[p](g):(this[u]=_,this.emit("open",_),this[h]())}end(g,_){return g&&this.write(g,_),this[a]=!0,!this[te]&&!this[x].length&&typeof this[u]=="number"&&this[P](null,0),this}write(g,_){return typeof g=="string"&&(g=Buffer.from(g,_)),this[a]?(this.emit("error",new Error("write() after end()")),!1):this[u]===null||this[te]||this[x].length?(this[x].push(g),this[y]=!0,!1):(this[te]=!0,this[Q](g),!0)}[Q](g){n.write(this[u],g,0,g.length,this[M],(_,v)=>this[P](_,v))}[P](g,_){g?this[p](g):(this[M]!==null&&(this[M]+=_),this[x].length?this[h]():(this[te]=!1,this[a]&&!this[c]?(this[c]=!0,this[o](),this.emit("finish")):this[y]&&(this[y]=!1,this.emit("drain"))))}[h](){if(this[x].length===0)this[a]&&this[P](null,0);else if(this[x].length===1)this[Q](this[x].pop());else{let g=this[x];this[x]=[],i(this[u],g,this[M],(_,v)=>this[P](_,v))}}[o](){if(this[s]&&typeof this[u]=="number"){let g=this[u];this[u]=null,n.close(g,_=>_?this.emit("error",_):this.emit("close"))}}},q=class extends Z{[I](){let g;if(this[j]&&this[l]==="r+")try{g=n.openSync(this[T],this[l],this[m])}catch(_){if(_.code==="ENOENT")return this[l]="w",this[I]();throw _}else g=n.openSync(this[T],this[l],this[m]);this[E](null,g)}[o](){if(this[s]&&typeof this[u]=="number"){let g=this[u];this[u]=null,n.closeSync(g),this.emit("close")}}[Q](g){let _=!0;try{this[P](null,n.writeSync(this[u],g,0,g.length,this[M])),_=!1}finally{if(_)try{this[o]()}catch{}}}};t.ReadStream=L,t.ReadStreamSync=G,t.WriteStream=Z,t.WriteStreamSync=q}),ag=me((t,e)=>{"use strict";ee();var r=sg(),n=Ba(),i=_e("events"),s=Zk(),o=1024*1024,a=ng(),u=ig(),c=zk(),{nextTick:l}=_e("process"),h=Buffer.from([31,139]),f=Symbol("state"),d=Symbol("writeEntry"),m=Symbol("readEntry"),y=Symbol("nextEntry"),p=Symbol("processEntry"),E=Symbol("extendedHeader"),R=Symbol("globalExtendedHeader"),P=Symbol("meta"),I=Symbol("emitMeta"),T=Symbol("buffer"),M=Symbol("queue"),x=Symbol("ended"),D=Symbol("emittedEnd"),U=Symbol("emit"),V=Symbol("unzip"),N=Symbol("consumeChunk"),W=Symbol("consumeChunkSub"),Q=Symbol("consumeBody"),te=Symbol("consumeMeta"),j=Symbol("consumeHeader"),F=Symbol("consuming"),L=Symbol("bufferConcat"),G=Symbol("maybeEnd"),Z=Symbol("writing"),q=Symbol("aborted"),g=Symbol("onDone"),_=Symbol("sawValidEntry"),v=Symbol("sawNullBlock"),k=Symbol("sawEOF"),S=Symbol("closeStream"),H=$=>!0;e.exports=r(class extends i{constructor($){$=$||{},super($),this.file=$.file||"",this[_]=null,this.on(g,ne=>{(this[f]==="begin"||this[_]===!1)&&this.warn("TAR_BAD_ARCHIVE","Unrecognized archive format")}),$.ondone?this.on(g,$.ondone):this.on(g,ne=>{this.emit("prefinish"),this.emit("finish"),this.emit("end")}),this.strict=!!$.strict,this.maxMetaEntrySize=$.maxMetaEntrySize||o,this.filter=typeof $.filter=="function"?$.filter:H,this.writable=!0,this.readable=!1,this[M]=new s,this[T]=null,this[m]=null,this[d]=null,this[f]="begin",this[P]="",this[E]=null,this[R]=null,this[x]=!1,this[V]=null,this[q]=!1,this[v]=!1,this[k]=!1,this.on("end",()=>this[S]()),typeof $.onwarn=="function"&&this.on("warn",$.onwarn),typeof $.onentry=="function"&&this.on("entry",$.onentry)}[j]($,ne){this[_]===null&&(this[_]=!1);let Y;try{Y=new n($,ne,this[E],this[R])}catch(fe){return this.warn("TAR_ENTRY_INVALID",fe)}if(Y.nullBlock)this[v]?(this[k]=!0,this[f]==="begin"&&(this[f]="header"),this[U]("eof")):(this[v]=!0,this[U]("nullBlock"));else if(this[v]=!1,!Y.cksumValid)this.warn("TAR_ENTRY_INVALID","checksum failure",{header:Y});else if(!Y.path)this.warn("TAR_ENTRY_INVALID","path is required",{header:Y});else{let fe=Y.type;if(/^(Symbolic)?Link$/.test(fe)&&!Y.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath required",{header:Y});else if(!/^(Symbolic)?Link$/.test(fe)&&Y.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath forbidden",{header:Y});else{let J=this[d]=new a(Y,this[E],this[R]);if(!this[_])if(J.remain){let w=()=>{J.invalid||(this[_]=!0)};J.on("end",w)}else this[_]=!0;J.meta?J.size>this.maxMetaEntrySize?(J.ignore=!0,this[U]("ignoredEntry",J),this[f]="ignore",J.resume()):J.size>0&&(this[P]="",J.on("data",w=>this[P]+=w),this[f]="meta"):(this[E]=null,J.ignore=J.ignore||!this.filter(J.path,J),J.ignore?(this[U]("ignoredEntry",J),this[f]=J.remain?"ignore":"header",J.resume()):(J.remain?this[f]="body":(this[f]="header",J.end()),this[m]?this[M].push(J):(this[M].push(J),this[y]())))}}}[S](){l(()=>this.emit("close"))}[p]($){let ne=!0;return $?Array.isArray($)?this.emit.apply(this,$):(this[m]=$,this.emit("entry",$),$.emittedEnd||($.on("end",Y=>this[y]()),ne=!1)):(this[m]=null,ne=!1),ne}[y](){do;while(this[p](this[M].shift()));if(!this[M].length){let $=this[m];!$||$.flowing||$.size===$.remain?this[Z]||this.emit("drain"):$.once("drain",ne=>this.emit("drain"))}}[Q]($,ne){let Y=this[d],fe=Y.blockRemain,J=fe>=$.length&&ne===0?$:$.slice(ne,ne+fe);return Y.write(J),Y.blockRemain||(this[f]="header",this[d]=null,Y.end()),J.length}[te]($,ne){let Y=this[d],fe=this[Q]($,ne);return this[d]||this[I](Y),fe}[U]($,ne,Y){!this[M].length&&!this[m]?this.emit($,ne,Y):this[M].push([$,ne,Y])}[I]($){switch(this[U]("meta",this[P]),$.type){case"ExtendedHeader":case"OldExtendedHeader":this[E]=u.parse(this[P],this[E],!1);break;case"GlobalExtendedHeader":this[R]=u.parse(this[P],this[R],!0);break;case"NextFileHasLongPath":case"OldGnuLongPath":this[E]=this[E]||Object.create(null),this[E].path=this[P].replace(/\0.*/,"");break;case"NextFileHasLongLinkpath":this[E]=this[E]||Object.create(null),this[E].linkpath=this[P].replace(/\0.*/,"");break;default:throw new Error("unknown meta: "+$.type)}}abort($){this[q]=!0,this.emit("abort",$),this.warn("TAR_ABORT",$,{recoverable:!1})}write($){if(this[q])return;if(this[V]===null&&$){if(this[T]&&($=Buffer.concat([this[T],$]),this[T]=null),$.length<h.length)return this[T]=$,!0;for(let Y=0;this[V]===null&&Y<h.length;Y++)$[Y]!==h[Y]&&(this[V]=!1);if(this[V]===null){let Y=this[x];this[x]=!1,this[V]=new c.Unzip,this[V].on("data",J=>this[N](J)),this[V].on("error",J=>this.abort(J)),this[V].on("end",J=>{this[x]=!0,this[N]()}),this[Z]=!0;let fe=this[V][Y?"end":"write"]($);return this[Z]=!1,fe}}this[Z]=!0,this[V]?this[V].write($):this[N]($),this[Z]=!1;let ne=this[M].length?!1:this[m]?this[m].flowing:!0;return!ne&&!this[M].length&&this[m].once("drain",Y=>this.emit("drain")),ne}[L]($){$&&!this[q]&&(this[T]=this[T]?Buffer.concat([this[T],$]):$)}[G](){if(this[x]&&!this[D]&&!this[q]&&!this[F]){this[D]=!0;let $=this[d];if($&&$.blockRemain){let ne=this[T]?this[T].length:0;this.warn("TAR_BAD_ARCHIVE",`Truncated input (needed ${$.blockRemain} more bytes, only ${ne} available)`,{entry:$}),this[T]&&$.write(this[T]),$.end()}this[U](g)}}[N]($){if(this[F])this[L]($);else if(!$&&!this[T])this[G]();else{if(this[F]=!0,this[T]){this[L]($);let ne=this[T];this[T]=null,this[W](ne)}else this[W]($);for(;this[T]&&this[T].length>=512&&!this[q]&&!this[k];){let ne=this[T];this[T]=null,this[W](ne)}this[F]=!1}(!this[T]||this[x])&&this[G]()}[W]($){let ne=0,Y=$.length;for(;ne+512<=Y&&!this[q]&&!this[k];)switch(this[f]){case"begin":case"header":this[j]($,ne),ne+=512;break;case"ignore":case"body":ne+=this[Q]($,ne);break;case"meta":ne+=this[te]($,ne);break;default:throw new Error("invalid state: "+this[f])}ne<Y&&(this[T]?this[T]=Buffer.concat([$.slice(ne),this[T]]):this[T]=$.slice(ne))}end($){this[q]||(this[V]?this[V].end($):(this[x]=!0,this.write($)))}})}),ug=me((t,e)=>{"use strict";ee();var r=Ia(),n=ag(),i=_e("fs"),s=Ma(),o=_e("path"),a=Na();e.exports=(d,m,y)=>{typeof d=="function"?(y=d,m=null,d={}):Array.isArray(d)&&(m=d,d={}),typeof m=="function"&&(y=m,m=null),m?m=Array.from(m):m=[];let p=r(d);if(p.sync&&typeof y=="function")throw new TypeError("callback not supported for sync tar functions");if(!p.file&&typeof y=="function")throw new TypeError("callback only supported with file option");return m.length&&c(p,m),p.noResume||u(p),p.file&&p.sync?l(p):p.file?h(p,y):f(p)};var u=d=>{let m=d.onentry;d.onentry=m?y=>{m(y),y.resume()}:y=>y.resume()},c=(d,m)=>{let y=new Map(m.map(R=>[a(R),!0])),p=d.filter,E=(R,P)=>{let I=P||o.parse(R).root||".",T=R===I?!1:y.has(R)?y.get(R):E(o.dirname(R),I);return y.set(R,T),T};d.filter=p?(R,P)=>p(R,P)&&E(a(R)):R=>E(a(R))},l=d=>{let m=f(d),y=d.file,p=!0,E;try{let R=i.statSync(y),P=d.maxReadSize||16*1024*1024;if(R.size<P)m.end(i.readFileSync(y));else{let I=0,T=Buffer.allocUnsafe(P);for(E=i.openSync(y,"r");I<R.size;){let M=i.readSync(E,T,0,P,I);I+=M,m.write(T.slice(0,M))}m.end()}p=!1}finally{if(p&&E)try{i.closeSync(E)}catch{}}},h=(d,m)=>{let y=new n(d),p=d.maxReadSize||16*1024*1024,E=d.file,R=new Promise((P,I)=>{y.on("error",I),y.on("end",P),i.stat(E,(T,M)=>{if(T)I(T);else{let x=new s.ReadStream(E,{readSize:p,size:M.size});x.on("error",I),x.pipe(y)}})});return m?R.then(m,m):R},f=d=>new n(d)}),hH=me((t,e)=>{"use strict";ee();var r=Ia(),n=og(),i=Ma(),s=ug(),o=_e("path");e.exports=(d,m,y)=>{if(typeof m=="function"&&(y=m),Array.isArray(d)&&(m=d,d={}),!m||!Array.isArray(m)||!m.length)throw new TypeError("no files or directories specified");m=Array.from(m);let p=r(d);if(p.sync&&typeof y=="function")throw new TypeError("callback not supported for sync tar functions");if(!p.file&&typeof y=="function")throw new TypeError("callback only supported with file option");return p.file&&p.sync?a(p,m):p.file?u(p,m,y):p.sync?h(p,m):f(p,m)};var a=(d,m)=>{let y=new n.Sync(d),p=new i.WriteStreamSync(d.file,{mode:d.mode||438});y.pipe(p),c(y,m)},u=(d,m,y)=>{let p=new n(d),E=new i.WriteStream(d.file,{mode:d.mode||438});p.pipe(E);let R=new Promise((P,I)=>{E.on("error",I),E.on("close",P),p.on("error",I)});return l(p,m),y?R.then(y,y):R},c=(d,m)=>{m.forEach(y=>{y.charAt(0)==="@"?s({file:o.resolve(d.cwd,y.slice(1)),sync:!0,noResume:!0,onentry:p=>d.add(p)}):d.add(y)}),d.end()},l=(d,m)=>{for(;m.length;){let y=m.shift();if(y.charAt(0)==="@")return s({file:o.resolve(d.cwd,y.slice(1)),noResume:!0,onentry:p=>d.add(p)}).then(p=>l(d,m));d.add(y)}d.end()},h=(d,m)=>{let y=new n.Sync(d);return c(y,m),y},f=(d,m)=>{let y=new n(d);return l(y,m),y}}),Jk=me((t,e)=>{"use strict";ee();var r=Ia(),n=og(),i=_e("fs"),s=Ma(),o=ug(),a=_e("path"),u=Ba();e.exports=(m,y,p)=>{let E=r(m);if(!E.file)throw new TypeError("file is required");if(E.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),E.sync?c(E,y):h(E,y,p)};var c=(m,y)=>{let p=new n.Sync(m),E=!0,R,P;try{try{R=i.openSync(m.file,"r+")}catch(M){if(M.code==="ENOENT")R=i.openSync(m.file,"w+");else throw M}let I=i.fstatSync(R),T=Buffer.alloc(512);e:for(P=0;P<I.size;P+=512){for(let D=0,U=0;D<512;D+=U){if(U=i.readSync(R,T,D,T.length-D,P+D),P===0&&T[0]===31&&T[1]===139)throw new Error("cannot append to compressed archives");if(!U)break e}let M=new u(T);if(!M.cksumValid)break;let x=512*Math.ceil(M.size/512);if(P+x+512>I.size)break;P+=x,m.mtimeCache&&m.mtimeCache.set(M.path,M.mtime)}E=!1,l(m,p,P,R,y)}finally{if(E)try{i.closeSync(R)}catch{}}},l=(m,y,p,E,R)=>{let P=new s.WriteStreamSync(m.file,{fd:E,start:p});y.pipe(P),f(y,R)},h=(m,y,p)=>{y=Array.from(y);let E=new n(m),R=(I,T,M)=>{let x=(W,Q)=>{W?i.close(I,te=>M(W)):M(null,Q)},D=0;if(T===0)return x(null,0);let U=0,V=Buffer.alloc(512),N=(W,Q)=>{if(W)return x(W);if(U+=Q,U<512&&Q)return i.read(I,V,U,V.length-U,D+U,N);if(D===0&&V[0]===31&&V[1]===139)return x(new Error("cannot append to compressed archives"));if(U<512)return x(null,D);let te=new u(V);if(!te.cksumValid)return x(null,D);let j=512*Math.ceil(te.size/512);if(D+j+512>T||(D+=j+512,D>=T))return x(null,D);m.mtimeCache&&m.mtimeCache.set(te.path,te.mtime),U=0,i.read(I,V,0,512,D,N)};i.read(I,V,0,512,D,N)},P=new Promise((I,T)=>{E.on("error",T);let M="r+",x=(D,U)=>{if(D&&D.code==="ENOENT"&&M==="r+")return M="w+",i.open(m.file,M,x);if(D)return T(D);i.fstat(U,(V,N)=>{if(V)return i.close(U,()=>T(V));R(U,N.size,(W,Q)=>{if(W)return T(W);let te=new s.WriteStream(m.file,{fd:U,start:Q});E.pipe(te),te.on("error",T),te.on("close",I),d(E,y)})})};i.open(m.file,M,x)});return p?P.then(p,p):P},f=(m,y)=>{y.forEach(p=>{p.charAt(0)==="@"?o({file:a.resolve(m.cwd,p.slice(1)),sync:!0,noResume:!0,onentry:E=>m.add(E)}):m.add(p)}),m.end()},d=(m,y)=>{for(;y.length;){let p=y.shift();if(p.charAt(0)==="@")return o({file:a.resolve(m.cwd,p.slice(1)),noResume:!0,onentry:E=>m.add(E)}).then(E=>d(m,y));m.add(p)}m.end()}}),fH=me((t,e)=>{"use strict";ee();var r=Ia(),n=Jk();e.exports=(s,o,a)=>{let u=r(s);if(!u.file)throw new TypeError("file is required");if(u.gzip)throw new TypeError("cannot append to compressed archives");if(!o||!Array.isArray(o)||!o.length)throw new TypeError("no files or directories specified");return o=Array.from(o),i(u),n(u,o,a)};var i=s=>{let o=s.filter;s.mtimeCache||(s.mtimeCache=new Map),s.filter=o?(a,u)=>o(a,u)&&!(s.mtimeCache.get(a)>u.mtime):(a,u)=>!(s.mtimeCache.get(a)>u.mtime)}}),dH=me((t,e)=>{ee();var{promisify:r}=_e("util"),n=_e("fs"),i=s=>{if(!s)s={mode:511,fs:n};else if(typeof s=="object")s={mode:511,fs:n,...s};else if(typeof s=="number")s={mode:s,fs:n};else if(typeof s=="string")s={mode:parseInt(s,8),fs:n};else throw new TypeError("invalid options argument");return s.mkdir=s.mkdir||s.fs.mkdir||n.mkdir,s.mkdirAsync=r(s.mkdir),s.stat=s.stat||s.fs.stat||n.stat,s.statAsync=r(s.stat),s.statSync=s.statSync||s.fs.statSync||n.statSync,s.mkdirSync=s.mkdirSync||s.fs.mkdirSync||n.mkdirSync,s};e.exports=i}),pH=me((t,e)=>{ee();var r=process.env.__TESTING_MKDIRP_PLATFORM__||process.platform,{resolve:n,parse:i}=_e("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=n(o),r==="win32"){let a=/[*|"<>?:]/,{root:u}=i(o);if(a.test(o.substr(u.length)))throw Object.assign(new Error("Illegal characters in path."),{path:o,code:"EINVAL"})}return o};e.exports=s}),mH=me((t,e)=>{ee();var{dirname:r}=_e("path"),n=(s,o,a=void 0)=>a===o?Promise.resolve():s.statAsync(o).then(u=>u.isDirectory()?a:void 0,u=>u.code==="ENOENT"?n(s,r(o),o):void 0),i=(s,o,a=void 0)=>{if(a!==o)try{return s.statSync(o).isDirectory()?a:void 0}catch(u){return u.code==="ENOENT"?i(s,r(o),o):void 0}};e.exports={findMade:n,findMadeSync:i}}),Xk=me((t,e)=>{ee();var{dirname:r}=_e("path"),n=(s,o,a)=>{o.recursive=!1;let u=r(s);return u===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 n(u,o).then(l=>n(s,o,l));if(c.code!=="EEXIST"&&c.code!=="EROFS")throw c;return o.statAsync(s).then(l=>{if(l.isDirectory())return a;throw c},()=>{throw c})})},i=(s,o,a)=>{let u=r(s);if(o.recursive=!1,u===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 i(s,o,i(u,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:n,mkdirpManualSync:i}}),yH=me((t,e)=>{ee();var{dirname:r}=_e("path"),{findMade:n,findMadeSync:i}=mH(),{mkdirpManual:s,mkdirpManualSync:o}=Xk(),a=(c,l)=>(l.recursive=!0,r(c)===c?l.mkdirAsync(c,l):n(l,c).then(h=>l.mkdirAsync(c,l).then(()=>h).catch(f=>{if(f.code==="ENOENT")return s(c,l);throw f}))),u=(c,l)=>{if(l.recursive=!0,r(c)===c)return l.mkdirSync(c,l);let h=i(l,c);try{return l.mkdirSync(c,l),h}catch(f){if(f.code==="ENOENT")return o(c,l);throw f}};e.exports={mkdirpNative:a,mkdirpNativeSync:u}}),gH=me((t,e)=>{ee();var r=_e("fs"),n=process.env.__TESTING_MKDIRP_NODE_VERSION__||process.version,i=n.replace(/^v/,"").split("."),s=+i[0]>10||+i[0]==10&&+i[1]>=12,o=s?u=>u.mkdir===r.mkdir:()=>!1,a=s?u=>u.mkdirSync===r.mkdirSync:()=>!1;e.exports={useNative:o,useNativeSync:a}}),_H=me((t,e)=>{ee();var r=dH(),n=pH(),{mkdirpNative:i,mkdirpNativeSync:s}=yH(),{mkdirpManual:o,mkdirpManualSync:a}=Xk(),{useNative:u,useNativeSync:c}=gH(),l=(f,d)=>(f=n(f),d=r(d),u(d)?i(f,d):o(f,d)),h=(f,d)=>(f=n(f),d=r(d),c(d)?s(f,d):a(f,d));l.sync=h,l.native=(f,d)=>i(n(f),r(d)),l.manual=(f,d)=>o(n(f),r(d)),l.nativeSync=(f,d)=>s(n(f),r(d)),l.manualSync=(f,d)=>a(n(f),r(d)),e.exports=l}),bH=me((t,e)=>{"use strict";ee();var r=_e("fs"),n=_e("path"),i=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=(P,I,T)=>{try{return r[s](P,I,T)}catch(M){if(M.code!=="ENOENT")throw M}},u=(P,I,T)=>{try{return r.chownSync(P,I,T)}catch(M){if(M.code!=="ENOENT")throw M}},c=o?(P,I,T,M)=>x=>{!x||x.code!=="EISDIR"?M(x):r.chown(P,I,T,M)}:(P,I,T,M)=>M,l=o?(P,I,T)=>{try{return a(P,I,T)}catch(M){if(M.code!=="EISDIR")throw M;u(P,I,T)}}:(P,I,T)=>a(P,I,T),h=process.version,f=(P,I,T)=>r.readdir(P,I,T),d=(P,I)=>r.readdirSync(P,I);/^v4\./.test(h)&&(f=(P,I,T)=>r.readdir(P,T));var m=(P,I,T,M)=>{r[i](P,I,T,c(P,I,T,x=>{M(x&&x.code!=="ENOENT"?x:null)}))},y=(P,I,T,M,x)=>{if(typeof I=="string")return r.lstat(n.resolve(P,I),(D,U)=>{if(D)return x(D.code!=="ENOENT"?D:null);U.name=I,y(P,U,T,M,x)});if(I.isDirectory())p(n.resolve(P,I.name),T,M,D=>{if(D)return x(D);let U=n.resolve(P,I.name);m(U,T,M,x)});else{let D=n.resolve(P,I.name);m(D,T,M,x)}},p=(P,I,T,M)=>{f(P,{withFileTypes:!0},(x,D)=>{if(x){if(x.code==="ENOENT")return M();if(x.code!=="ENOTDIR"&&x.code!=="ENOTSUP")return M(x)}if(x||!D.length)return m(P,I,T,M);let U=D.length,V=null,N=W=>{if(!V){if(W)return M(V=W);if(--U===0)return m(P,I,T,M)}};D.forEach(W=>y(P,W,I,T,N))})},E=(P,I,T,M)=>{if(typeof I=="string")try{let x=r.lstatSync(n.resolve(P,I));x.name=I,I=x}catch(x){if(x.code==="ENOENT")return;throw x}I.isDirectory()&&R(n.resolve(P,I.name),T,M),l(n.resolve(P,I.name),T,M)},R=(P,I,T)=>{let M;try{M=d(P,{withFileTypes:!0})}catch(x){if(x.code==="ENOENT")return;if(x.code==="ENOTDIR"||x.code==="ENOTSUP")return l(P,I,T);throw x}return M&&M.length&&M.forEach(x=>E(P,x,I,T)),l(P,I,T)};e.exports=p,p.sync=R}),vH=me((t,e)=>{"use strict";ee();var r=_H(),n=_e("fs"),i=_e("path"),s=bH(),o=La(),a=class extends Error{constructor(y,p){super("Cannot extract through symbolic link"),this.path=p,this.symlink=y}get name(){return"SylinkError"}},u=class extends Error{constructor(y,p){super(p+": Cannot cd into '"+y+"'"),this.path=y,this.code=p}get name(){return"CwdError"}},c=(y,p)=>y.get(o(p)),l=(y,p,E)=>y.set(o(p),E),h=(y,p)=>{n.stat(y,(E,R)=>{(E||!R.isDirectory())&&(E=new u(y,E&&E.code||"ENOTDIR")),p(E)})};e.exports=(y,p,E)=>{y=o(y);let R=p.umask,P=p.mode|448,I=(P&R)!==0,T=p.uid,M=p.gid,x=typeof T=="number"&&typeof M=="number"&&(T!==p.processUid||M!==p.processGid),D=p.preserve,U=p.unlink,V=p.cache,N=o(p.cwd),W=(te,j)=>{te?E(te):(l(V,y,!0),j&&x?s(j,T,M,F=>W(F)):I?n.chmod(y,P,E):E())};if(V&&c(V,y)===!0)return W();if(y===N)return h(y,W);if(D)return r(y,{mode:P}).then(te=>W(null,te),W);let Q=o(i.relative(N,y)).split("/");f(N,Q,P,V,U,N,null,W)};var f=(y,p,E,R,P,I,T,M)=>{if(!p.length)return M(null,T);let x=p.shift(),D=o(i.resolve(y+"/"+x));if(c(R,D))return f(D,p,E,R,P,I,T,M);n.mkdir(D,E,d(D,p,E,R,P,I,T,M))},d=(y,p,E,R,P,I,T,M)=>x=>{x?n.lstat(y,(D,U)=>{if(D)D.path=D.path&&o(D.path),M(D);else if(U.isDirectory())f(y,p,E,R,P,I,T,M);else if(P)n.unlink(y,V=>{if(V)return M(V);n.mkdir(y,E,d(y,p,E,R,P,I,T,M))});else{if(U.isSymbolicLink())return M(new a(y,y+"/"+p.join("/")));M(x)}}):(T=T||y,f(y,p,E,R,P,I,T,M))},m=y=>{let p=!1,E="ENOTDIR";try{p=n.statSync(y).isDirectory()}catch(R){E=R.code}finally{if(!p)throw new u(y,E)}};e.exports.sync=(y,p)=>{y=o(y);let E=p.umask,R=p.mode|448,P=(R&E)!==0,I=p.uid,T=p.gid,M=typeof I=="number"&&typeof T=="number"&&(I!==p.processUid||T!==p.processGid),x=p.preserve,D=p.unlink,U=p.cache,V=o(p.cwd),N=te=>{l(U,y,!0),te&&M&&s.sync(te,I,T),P&&n.chmodSync(y,R)};if(U&&c(U,y)===!0)return N();if(y===V)return m(V),N();if(x)return N(r.sync(y,R));let W=o(i.relative(V,y)).split("/"),Q=null;for(let te=W.shift(),j=V;te&&(j+="/"+te);te=W.shift())if(j=o(i.resolve(j)),!c(U,j))try{n.mkdirSync(j,R),Q=Q||j,l(U,j,!0)}catch{let F=n.lstatSync(j);if(F.isDirectory()){l(U,j,!0);continue}else if(D){n.unlinkSync(j),n.mkdirSync(j,R),Q=Q||j,l(U,j,!0);continue}else if(F.isSymbolicLink())return new a(j,j+"/"+W.join("/"))}return N(Q)}}),Qk=me((t,e)=>{ee();var r=Object.create(null),{hasOwnProperty:n}=Object.prototype;e.exports=i=>(n.call(r,i)||(r[i]=i.normalize("NFKD")),r[i])}),EH=me((t,e)=>{ee();var r=_e("assert"),n=Qk(),i=Na(),{join:s}=_e("path"),o=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,a=o==="win32";e.exports=()=>{let u=new Map,c=new Map,l=p=>p.split("/").slice(0,-1).reduce((E,R)=>(E.length&&(R=s(E[E.length-1],R)),E.push(R||"/"),E),[]),h=new Set,f=p=>{let E=c.get(p);if(!E)throw new Error("function does not have any path reservations");return{paths:E.paths.map(R=>u.get(R)),dirs:[...E.dirs].map(R=>u.get(R))}},d=p=>{let{paths:E,dirs:R}=f(p);return E.every(P=>P[0]===p)&&R.every(P=>P[0]instanceof Set&&P[0].has(p))},m=p=>h.has(p)||!d(p)?!1:(h.add(p),p(()=>y(p)),!0),y=p=>{if(!h.has(p))return!1;let{paths:E,dirs:R}=c.get(p),P=new Set;return E.forEach(I=>{let T=u.get(I);r.equal(T[0],p),T.length===1?u.delete(I):(T.shift(),typeof T[0]=="function"?P.add(T[0]):T[0].forEach(M=>P.add(M)))}),R.forEach(I=>{let T=u.get(I);r(T[0]instanceof Set),T[0].size===1&&T.length===1?u.delete(I):T[0].size===1?(T.shift(),P.add(T[0])):T[0].delete(p)}),h.delete(p),P.forEach(I=>m(I)),!0};return{check:d,reserve:(p,E)=>{p=a?["win32 parallelization disabled"]:p.map(P=>n(i(s(P))).toLowerCase());let R=new Set(p.map(P=>l(P)).reduce((P,I)=>P.concat(I)));return c.set(E,{dirs:R,paths:p}),p.forEach(P=>{let I=u.get(P);I?I.push(E):u.set(P,[E])}),R.forEach(P=>{let I=u.get(P);I?I[I.length-1]instanceof Set?I[I.length-1].add(E):I.push(new Set([E])):u.set(P,[new Set([E])])}),m(E)}}}}),wH=me((t,e)=>{ee();var r=process.env.__FAKE_PLATFORM__||process.platform,n=r==="win32",i=global.__FAKE_TESTING_FS__||_e("fs"),{O_CREAT:s,O_TRUNC:o,O_WRONLY:a,UV_FS_O_FILEMAP:u=0}=i.constants,c=n&&!!u,l=512*1024,h=u|o|s|a;e.exports=c?f=>f<l?h:"w":()=>"w"}),eT=me((t,e)=>{"use strict";ee();var r=_e("assert"),n=ag(),i=_e("fs"),s=Ma(),o=_e("path"),a=vH(),u=Wk(),c=EH(),l=Yk(),h=La(),f=Na(),d=Qk(),m=Symbol("onEntry"),y=Symbol("checkFs"),p=Symbol("checkFs2"),E=Symbol("pruneCache"),R=Symbol("isReusable"),P=Symbol("makeFs"),I=Symbol("file"),T=Symbol("directory"),M=Symbol("link"),x=Symbol("symlink"),D=Symbol("hardlink"),U=Symbol("unsupported"),V=Symbol("checkPath"),N=Symbol("mkdir"),W=Symbol("onError"),Q=Symbol("pending"),te=Symbol("pend"),j=Symbol("unpend"),F=Symbol("ended"),L=Symbol("maybeClose"),G=Symbol("skip"),Z=Symbol("doChown"),q=Symbol("uid"),g=Symbol("gid"),_=Symbol("checkedCwd"),v=_e("crypto"),k=wH(),S=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,H=S==="win32",$=(b,z)=>{if(!H)return i.unlink(b,z);let re=b+".DELETE."+v.randomBytes(16).toString("hex");i.rename(b,re,ce=>{if(ce)return z(ce);i.unlink(re,z)})},ne=b=>{if(!H)return i.unlinkSync(b);let z=b+".DELETE."+v.randomBytes(16).toString("hex");i.renameSync(b,z),i.unlinkSync(z)},Y=(b,z,re)=>b===b>>>0?b:z===z>>>0?z:re,fe=b=>d(f(h(b))).toLowerCase(),J=(b,z)=>{z=fe(z);for(let re of b.keys()){let ce=fe(re);(ce===z||ce.indexOf(z+"/")===0)&&b.delete(re)}},w=b=>{for(let z of b.keys())b.delete(z)},B=class extends n{constructor(b){if(b||(b={}),b.ondone=z=>{this[F]=!0,this[L]()},super(b),this[_]=!1,this.reservations=c(),this.transform=typeof b.transform=="function"?b.transform:null,this.writable=!0,this.readable=!1,this[Q]=0,this[F]=!1,this.dirCache=b.dirCache||new Map,typeof b.uid=="number"||typeof b.gid=="number"){if(typeof b.uid!="number"||typeof b.gid!="number")throw new TypeError("cannot set owner without number uid and gid");if(b.preserveOwner)throw new TypeError("cannot preserve owner in archive and also set owner explicitly");this.uid=b.uid,this.gid=b.gid,this.setOwner=!0}else this.uid=null,this.gid=null,this.setOwner=!1;b.preserveOwner===void 0&&typeof b.uid!="number"?this.preserveOwner=process.getuid&&process.getuid()===0:this.preserveOwner=!!b.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=b.forceChown===!0,this.win32=!!b.win32||H,this.newer=!!b.newer,this.keep=!!b.keep,this.noMtime=!!b.noMtime,this.preservePaths=!!b.preservePaths,this.unlink=!!b.unlink,this.cwd=h(o.resolve(b.cwd||process.cwd())),this.strip=+b.strip||0,this.processUmask=b.noChmod?0:process.umask(),this.umask=typeof b.umask=="number"?b.umask:this.processUmask,this.dmode=b.dmode||511&~this.umask,this.fmode=b.fmode||438&~this.umask,this.on("entry",z=>this[m](z))}warn(b,z,re={}){return(b==="TAR_BAD_ARCHIVE"||b==="TAR_ABORT")&&(re.recoverable=!1),super.warn(b,z,re)}[L](){this[F]&&this[Q]===0&&(this.emit("prefinish"),this.emit("finish"),this.emit("end"))}[V](b){if(this.strip){let z=h(b.path).split("/");if(z.length<this.strip)return!1;if(b.path=z.slice(this.strip).join("/"),b.type==="Link"){let re=h(b.linkpath).split("/");if(re.length>=this.strip)b.linkpath=re.slice(this.strip).join("/");else return!1}}if(!this.preservePaths){let z=h(b.path),re=z.split("/");if(re.includes("..")||H&&/^[a-z]:\.\.$/i.test(re[0]))return this.warn("TAR_ENTRY_ERROR","path contains '..'",{entry:b,path:z}),!1;let[ce,ye]=l(z);ce&&(b.path=ye,this.warn("TAR_ENTRY_INFO",`stripping ${ce} from absolute path`,{entry:b,path:z}))}if(o.isAbsolute(b.path)?b.absolute=h(o.resolve(b.path)):b.absolute=h(o.resolve(this.cwd,b.path)),!this.preservePaths&&b.absolute.indexOf(this.cwd+"/")!==0&&b.absolute!==this.cwd)return this.warn("TAR_ENTRY_ERROR","path escaped extraction target",{entry:b,path:h(b.path),resolvedPath:b.absolute,cwd:this.cwd}),!1;if(b.absolute===this.cwd&&b.type!=="Directory"&&b.type!=="GNUDumpDir")return!1;if(this.win32){let{root:z}=o.win32.parse(b.absolute);b.absolute=z+u.encode(b.absolute.slice(z.length));let{root:re}=o.win32.parse(b.path);b.path=re+u.encode(b.path.slice(re.length))}return!0}[m](b){if(!this[V](b))return b.resume();switch(r.equal(typeof b.absolute,"string"),b.type){case"Directory":case"GNUDumpDir":b.mode&&(b.mode=b.mode|448);case"File":case"OldFile":case"ContiguousFile":case"Link":case"SymbolicLink":return this[y](b);case"CharacterDevice":case"BlockDevice":case"FIFO":default:return this[U](b)}}[W](b,z){b.name==="CwdError"?this.emit("error",b):(this.warn("TAR_ENTRY_ERROR",b,{entry:z}),this[j](),z.resume())}[N](b,z,re){a(h(b),{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:z,noChmod:this.noChmod},re)}[Z](b){return this.forceChown||this.preserveOwner&&(typeof b.uid=="number"&&b.uid!==this.processUid||typeof b.gid=="number"&&b.gid!==this.processGid)||typeof this.uid=="number"&&this.uid!==this.processUid||typeof this.gid=="number"&&this.gid!==this.processGid}[q](b){return Y(this.uid,b.uid,this.processUid)}[g](b){return Y(this.gid,b.gid,this.processGid)}[I](b,z){let re=b.mode&4095||this.fmode,ce=new s.WriteStream(b.absolute,{flags:k(b.size),mode:re,autoClose:!1});ce.on("error",Se=>{ce.fd&&i.close(ce.fd,()=>{}),ce.write=()=>!0,this[W](Se,b),z()});let ye=1,Ae=Se=>{if(Se){ce.fd&&i.close(ce.fd,()=>{}),this[W](Se,b),z();return}--ye===0&&i.close(ce.fd,ze=>{ze?this[W](ze,b):this[j](),z()})};ce.on("finish",Se=>{let ze=b.absolute,rr=ce.fd;if(b.mtime&&!this.noMtime){ye++;let nr=b.atime||new Date,vo=b.mtime;i.futimes(rr,nr,vo,Eo=>Eo?i.utimes(ze,nr,vo,yh=>Ae(yh&&Eo)):Ae())}if(this[Z](b)){ye++;let nr=this[q](b),vo=this[g](b);i.fchown(rr,nr,vo,Eo=>Eo?i.chown(ze,nr,vo,yh=>Ae(yh&&Eo)):Ae())}Ae()});let De=this.transform&&this.transform(b)||b;De!==b&&(De.on("error",Se=>{this[W](Se,b),z()}),b.pipe(De)),De.pipe(ce)}[T](b,z){let re=b.mode&4095||this.dmode;this[N](b.absolute,re,ce=>{if(ce){this[W](ce,b),z();return}let ye=1,Ae=De=>{--ye===0&&(z(),this[j](),b.resume())};b.mtime&&!this.noMtime&&(ye++,i.utimes(b.absolute,b.atime||new Date,b.mtime,Ae)),this[Z](b)&&(ye++,i.chown(b.absolute,this[q](b),this[g](b),Ae)),Ae()})}[U](b){b.unsupported=!0,this.warn("TAR_ENTRY_UNSUPPORTED",`unsupported entry type: ${b.type}`,{entry:b}),b.resume()}[x](b,z){this[M](b,b.linkpath,"symlink",z)}[D](b,z){let re=h(o.resolve(this.cwd,b.linkpath));this[M](b,re,"link",z)}[te](){this[Q]++}[j](){this[Q]--,this[L]()}[G](b){this[j](),b.resume()}[R](b,z){return b.type==="File"&&!this.unlink&&z.isFile()&&z.nlink<=1&&!H}[y](b){this[te]();let z=[b.path];b.linkpath&&z.push(b.linkpath),this.reservations.reserve(z,re=>this[p](b,re))}[E](b){b.type==="SymbolicLink"?w(this.dirCache):b.type!=="Directory"&&J(this.dirCache,b.absolute)}[p](b,z){this[E](b);let re=De=>{this[E](b),z(De)},ce=()=>{this[N](this.cwd,this.dmode,De=>{if(De){this[W](De,b),re();return}this[_]=!0,ye()})},ye=()=>{if(b.absolute!==this.cwd){let De=h(o.dirname(b.absolute));if(De!==this.cwd)return this[N](De,this.dmode,Se=>{if(Se){this[W](Se,b),re();return}Ae()})}Ae()},Ae=()=>{i.lstat(b.absolute,(De,Se)=>{if(Se&&(this.keep||this.newer&&Se.mtime>b.mtime)){this[G](b),re();return}if(De||this[R](b,Se))return this[P](null,b,re);if(Se.isDirectory()){if(b.type==="Directory"){let ze=!this.noChmod&&b.mode&&(Se.mode&4095)!==b.mode,rr=nr=>this[P](nr,b,re);return ze?i.chmod(b.absolute,b.mode,rr):rr()}if(b.absolute!==this.cwd)return i.rmdir(b.absolute,ze=>this[P](ze,b,re))}if(b.absolute===this.cwd)return this[P](null,b,re);$(b.absolute,ze=>this[P](ze,b,re))})};this[_]?ye():ce()}[P](b,z,re){if(b){this[W](b,z),re();return}switch(z.type){case"File":case"OldFile":case"ContiguousFile":return this[I](z,re);case"Link":return this[D](z,re);case"SymbolicLink":return this[x](z,re);case"Directory":case"GNUDumpDir":return this[T](z,re)}}[M](b,z,re,ce){i[re](z,b.absolute,ye=>{ye?this[W](ye,b):(this[j](),b.resume()),ce()})}},C=b=>{try{return[null,b()]}catch(z){return[z,null]}},X=class extends B{[P](b,z){return super[P](b,z,()=>{})}[y](b){if(this[E](b),!this[_]){let ye=this[N](this.cwd,this.dmode);if(ye)return this[W](ye,b);this[_]=!0}if(b.absolute!==this.cwd){let ye=h(o.dirname(b.absolute));if(ye!==this.cwd){let Ae=this[N](ye,this.dmode);if(Ae)return this[W](Ae,b)}}let[z,re]=C(()=>i.lstatSync(b.absolute));if(re&&(this.keep||this.newer&&re.mtime>b.mtime))return this[G](b);if(z||this[R](b,re))return this[P](null,b);if(re.isDirectory()){if(b.type==="Directory"){let Ae=!this.noChmod&&b.mode&&(re.mode&4095)!==b.mode,[De]=Ae?C(()=>{i.chmodSync(b.absolute,b.mode)}):[];return this[P](De,b)}let[ye]=C(()=>i.rmdirSync(b.absolute));this[P](ye,b)}let[ce]=b.absolute===this.cwd?[]:C(()=>ne(b.absolute));this[P](ce,b)}[I](b,z){let re=b.mode&4095||this.fmode,ce=De=>{let Se;try{i.closeSync(ye)}catch(ze){Se=ze}(De||Se)&&this[W](De||Se,b),z()},ye;try{ye=i.openSync(b.absolute,k(b.size),re)}catch(De){return ce(De)}let Ae=this.transform&&this.transform(b)||b;Ae!==b&&(Ae.on("error",De=>this[W](De,b)),b.pipe(Ae)),Ae.on("data",De=>{try{i.writeSync(ye,De,0,De.length)}catch(Se){ce(Se)}}),Ae.on("end",De=>{let Se=null;if(b.mtime&&!this.noMtime){let ze=b.atime||new Date,rr=b.mtime;try{i.futimesSync(ye,ze,rr)}catch(nr){try{i.utimesSync(b.absolute,ze,rr)}catch{Se=nr}}}if(this[Z](b)){let ze=this[q](b),rr=this[g](b);try{i.fchownSync(ye,ze,rr)}catch(nr){try{i.chownSync(b.absolute,ze,rr)}catch{Se=Se||nr}}}ce(Se)})}[T](b,z){let re=b.mode&4095||this.dmode,ce=this[N](b.absolute,re);if(ce){this[W](ce,b),z();return}if(b.mtime&&!this.noMtime)try{i.utimesSync(b.absolute,b.atime||new Date,b.mtime)}catch{}if(this[Z](b))try{i.chownSync(b.absolute,this[q](b),this[g](b))}catch{}z(),b.resume()}[N](b,z){try{return a.sync(h(b),{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:z})}catch(re){return re}}[M](b,z,re,ce){try{i[re+"Sync"](z,b.absolute),ce(),b.resume()}catch(ye){return this[W](ye,b)}}};B.Sync=X,e.exports=B}),xH=me((t,e)=>{"use strict";ee();var r=Ia(),n=eT(),i=_e("fs"),s=Ma(),o=_e("path"),a=Na();e.exports=(d,m,y)=>{typeof d=="function"?(y=d,m=null,d={}):Array.isArray(d)&&(m=d,d={}),typeof m=="function"&&(y=m,m=null),m?m=Array.from(m):m=[];let p=r(d);if(p.sync&&typeof y=="function")throw new TypeError("callback not supported for sync tar functions");if(!p.file&&typeof y=="function")throw new TypeError("callback only supported with file option");return m.length&&u(p,m),p.file&&p.sync?c(p):p.file?l(p,y):p.sync?h(p):f(p)};var u=(d,m)=>{let y=new Map(m.map(R=>[a(R),!0])),p=d.filter,E=(R,P)=>{let I=P||o.parse(R).root||".",T=R===I?!1:y.has(R)?y.get(R):E(o.dirname(R),I);return y.set(R,T),T};d.filter=p?(R,P)=>p(R,P)&&E(a(R)):R=>E(a(R))},c=d=>{let m=new n.Sync(d),y=d.file,p=i.statSync(y),E=d.maxReadSize||16*1024*1024;new s.ReadStreamSync(y,{readSize:E,size:p.size}).pipe(m)},l=(d,m)=>{let y=new n(d),p=d.maxReadSize||16*1024*1024,E=d.file,R=new Promise((P,I)=>{y.on("error",I),y.on("close",P),i.stat(E,(T,M)=>{if(T)I(T);else{let x=new s.ReadStream(E,{readSize:p,size:M.size});x.on("error",I),x.pipe(y)}})});return m?R.then(m,m):R},h=d=>new n.Sync(d),f=d=>new n(d)}),SH=me(t=>{"use strict";ee(),t.c=t.create=hH(),t.r=t.replace=Jk(),t.t=t.list=ug(),t.u=t.update=fH(),t.x=t.extract=xH(),t.Pack=og(),t.Unpack=eT(),t.Parse=ag(),t.ReadEntry=ng(),t.WriteEntry=Kk(),t.Header=Ba(),t.Pax=ig(),t.types=Vk()}),AH=me((t,e)=>{ee();function r(n,i){typeof i=="boolean"&&(i={forever:i}),this._originalTimeouts=JSON.parse(JSON.stringify(n)),this._timeouts=n,this._options=i||{},this._maxRetryTime=i&&i.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(n){if(this._timeout&&clearTimeout(this._timeout),!n)return!1;var i=new Date().getTime();if(n&&i-this._operationStart>=this._maxRetryTime)return this._errors.push(n),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(n);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(n,i){this._fn=n,i&&(i.timeout&&(this._operationTimeout=i.timeout),i.cb&&(this._operationTimeoutCb=i.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(n){console.log("Using RetryOperation.try() is deprecated"),this.attempt(n)},r.prototype.start=function(n){console.log("Using RetryOperation.start() is deprecated"),this.attempt(n)},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 n={},i=null,s=0,o=0;o<this._errors.length;o++){var a=this._errors[o],u=a.message,c=(n[u]||0)+1;n[u]=c,c>=s&&(i=a,s=c)}return i}}),DH=me(t=>{ee();var e=AH();t.operation=function(r){var n=t.timeouts(r);return new e(n,{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 n={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var i in r)n[i]=r[i];if(n.minTimeout>n.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var s=[],o=0;o<n.retries;o++)s.push(this.createTimeout(o,n));return r&&r.forever&&!s.length&&s.push(this.createTimeout(o,n)),s.sort(function(a,u){return a-u}),s},t.createTimeout=function(r,n){var i=n.randomize?Math.random()+1:1,s=Math.round(i*Math.max(n.minTimeout,1)*Math.pow(n.factor,r));return s=Math.min(s,n.maxTimeout),s},t.wrap=function(r,n,i){if(n instanceof Array&&(i=n,n=null),!i){i=[];for(var s in r)typeof r[s]=="function"&&i.push(s)}for(var o=0;o<i.length;o++){var a=i[o],u=r[a];r[a]=function(c){var l=t.operation(n),h=Array.prototype.slice.call(arguments,1),f=h.pop();h.push(function(d){l.retry(d)||(d&&(arguments[0]=l.mainError()),f.apply(this,arguments))}),l.attempt(function(){c.apply(r,h)})}.bind(r,u),r[a].options=n}}}),CH=me((t,e)=>{ee(),e.exports=DH()}),RH=me((t,e)=>{ee();var r=CH();function n(i,s){function o(a,u){var c=s||{},l;"randomize"in c||(c.randomize=!0),l=r.operation(c);function h(m){u(m||new Error("Aborted"))}function f(m,y){if(m.bail){h(m);return}l.retry(m)?c.onRetry&&c.onRetry(m,y):u(l.mainError())}function d(m){var y;try{y=i(h,m)}catch(p){f(p,m);return}Promise.resolve(y).then(a).catch(function(p){f(p,m)})}l.attempt(d)}return new Promise(o)}e.exports=n}),kH={};Z7(kH,{bold:()=>IH,dimmed:()=>BH,error:()=>qH,grey:()=>NH,info:()=>PH,item:()=>MH,log:()=>Li,turboBlue:()=>mo,turboGradient:()=>OH,turboLoader:()=>FH,turboRed:()=>sT,underline:()=>LH,warn:()=>jH,yellow:()=>oT});ee();var nT="#0099F7",iT="#F11712",TH="#FFFF00",cg=t=>{let e=UH(t);return r=>`\x1B[38;5;${e}m${r}${(0,Dt.reset)("")}`},OH=(0,rT.default)(nT,iT),mo=cg(nT),sT=cg(iT),oT=cg(TH),FH=t=>(0,tT.default)({text:t,spinner:{frames:[" ",mo("> "),mo(">> "),mo(">>>")]}}),PH=(...t)=>{Li(mo((0,Dt.bold)(">>>")),t.join(" "))},IH=(...t)=>{Li((0,Dt.bold)(t.join(" ")))},LH=(...t)=>{Li((0,Dt.underline)(t.join(" ")))},BH=(...t)=>{Li((0,Dt.dim)(t.join(" ")))},NH=(...t)=>{Li((0,Dt.gray)(t.join(" ")))},MH=(...t)=>{Li(mo((0,Dt.bold)(" \u2022")),t.join(" "))},Li=(...t)=>{console.log(...t)},jH=(...t)=>{console.error(oT((0,Dt.bold)(">>>")),t.join(" "))},qH=(...t)=>{console.error(sT((0,Dt.bold)(">>>")),t.join(" "))};function UH(t){let e=parseInt(t.slice(1),16),r=Math.floor(e/(256*256))%256,n=Math.floor(e/256)%256,i=e%256;return 16+36*Math.round(r/255*5)+6*Math.round(n/255*5)+Math.round(i/255*5)}ee();async function nh(t,e=[],r){let n={cwd:aT.default.tmpdir(),env:{COREPACK_ENABLE_STRICT:"0"},...r};try{let{stdout:i}=await(0,uT.default)(t,e,n);return i.trim()}catch{return}}async function cT(){let[t,e,r,n]=await Promise.all([nh("yarnpkg",["--version"],{cwd:"."}),nh("npm",["--version"]),nh("pnpm",["--version"]),nh("bun",["--version"])]);return{yarn:t,pnpm:r,npm:e,bun:n}}ee();ee();ee();var TZ=oh(eH());ee();ee();function HH(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}ee();ee();function Qy(t){return Qy=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},Qy(t)}ee();function $H(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function GH(t,e){if(e&&(Qy(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return $H(t)}ee();function sh(t){return sh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},sh(t)}ee();ee();function Oa(t,e){return Oa=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Oa(t,e)}function zH(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&&Oa(t,e)}ee();ee();function VH(t){return Function.toString.call(t).indexOf("[native code]")!==-1}ee();ee();function WH(){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 ih(t,e,r){return WH()?ih=Reflect.construct.bind():ih=function(n,i,s){var o=[null];o.push.apply(o,i);var a=Function.bind.apply(n,o),u=new a;return s&&Oa(u,s.prototype),u},ih.apply(null,arguments)}function eg(t){var e=typeof Map=="function"?new Map:void 0;return eg=function(r){if(r===null||!VH(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,n)}function n(){return ih(r,arguments,sh(this).constructor)}return n.prototype=Object.create(r.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),Oa(n,r)},eg(t)}var OZ=oh(oH()),IZ=function(t){zH(e,t);function e(r){var n;return HH(this,e),n=GH(this,sh(e).call(this,"No package.json could be found upwards from the directory ".concat(r))),n.directory=r,n}return e}(eg(Error));ee();ee();ee();ee();ee();ee();var zZ=oh(SH()),VZ=(0,hT.promisify)(lT.Stream.pipeline);ee();ee();var KZ=oh(RH());ee();ee();ee();var He=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,He)}};ee();ee();ee();ee();var YH=/^(?!_)(?<manager>.+)@(?<version>.+)$/;function Ct({workspaceRoot:t}){let e=un.default.join(t,"package.json");try{return(0,Ut.readJsonSync)(e,"utf8")}catch(r){if(r&&typeof r=="object"&&"code"in r){if(r.code==="ENOENT")throw new He(`no "package.json" found at ${t}`,{type:"package_json-missing"});if(r.code==="EJSONPARSE")throw new He(`failed to parse "package.json" at ${t}`,{type:"package_json-parse_error"})}throw new Error(`unexpected error reading "package.json" at ${t}`)}}function ah({workspaceRoot:t}){let{packageManager:e}=Ct({workspaceRoot:t});if(e)try{let r=YH.exec(e);if(r){let[n,i]=r;return i}}catch{}}function ja({workspaceRoot:t}){let e=Ct({workspaceRoot:t}),r=un.default.basename(t),{name:n=r,description:i}=e;return{name:n,description:i}}function qk({workspaceRoot:t}){let e=un.default.join(t,"pnpm-workspace.yaml");if((0,Ut.existsSync)(e))try{let r=zh.load((0,Ut.readFileSync)(e,"utf8"));if(r instanceof Object&&"packages"in r&&Array.isArray(r.packages))return r.packages}catch{throw new He(`failed to parse ${e}`,{type:"pnpm-workspace_parse_error"})}return[]}function uh({root:t,lockFile:e,workspaceConfig:r}){let n=s=>un.default.join(t,s),i={root:t,lockfile:n(e),packageJson:n("package.json"),nodeModules:n("node_modules")};return r&&(i.workspaceConfig=n(r)),i}function lg({workspaces:t}){var e;return t?Array.isArray(t)?t:"packages"in t?(e=t.packages)!=null?e:[]:[]:[]}function ch({workspaceRoot:t,workspaceGlobs:e}){if(!e)return[];let r=e.filter(n=>n.startsWith("!")).map(n=>n.slice(1));return e.filter(n=>!n.startsWith("!")).flatMap(n=>{let i=[`${n}/package.json`];return(0,gT.sync)(i,{onlyFiles:!0,absolute:!0,cwd:t,ignore:["**/node_modules/**",...r]})}).map(n=>{let i=un.default.dirname(n),{name:s,description:o}=ja({workspaceRoot:i});return{name:s,description:o,paths:{root:i,packageJson:n,nodeModules:un.default.join(i,"node_modules")}}})}function KH({directory:t}){let e=un.default.resolve(process.cwd(),t);return{exists:(0,Ut.existsSync)(e),absolute:e}}function $n({packageManager:t,action:e,project:r}){let n=r.workspaceData.globs.length>0;return`${e==="remove"?"Removing":"Adding"} ${t} ${n?"workspaces":""} ${e==="remove"?"from":"to"} ${r.name}`}function ZH({project:t}){let e=r=>!(r.includes("*")&&(r.includes("**")||r.split("/").slice(0,-1).join("/").includes("*"))||["!","[","]","{","}"].some(n=>r.includes(n)));return t.workspaceData.globs.every(e)}function an({project:t,options:e}){e!=null&&e.dry||(0,Ut.rmSync)(t.paths.lockfile,{force:!0})}async function _T({project:t,options:e}){if(!(e!=null&&e.dry)&&(0,Ut.existsSync)(t.paths.lockfile))try{let{stdout:r}=await(0,yT.default)("bun",["bun.lockb"],{stdin:"ignore",cwd:t.paths.root});await(0,Ut.writeFile)(un.default.join(t.paths.root,"yarn.lock"),r)}catch{}finally{(0,Ut.rmSync)(t.paths.lockfile,{force:!0})}}function JH({dependencyList:t,project:e,to:r}){let n=[];return e.workspaceData.workspaces.forEach(i=>{let{name:s}=i;if(t[s]){let o=t[s],a=o.startsWith("workspace:")?o.slice(10):o;t[s]=r.name==="pnpm"?`workspace:${a}`:a,n.push(s)}}),{dependencyList:t,updated:n}}function Un({project:t,workspace:e,to:r,logger:n,options:i}){if(["yarn","npm","bun"].includes(r.name)&&["yarn","npm","bun"].includes(t.packageManager))return;let s=Ct({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:m}=JH({dependencyList:f,project:t,to:r});s[h]=m,o[h]=d}});let u=h=>{let f=o[h].length;if(f>0)return`${mT.default.green(f.toString())} ${h}`},c=a.map(u).filter(Boolean),l=`./${dT.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 ${l}`:d===c.length-1?h+=`and ${f} in ${l}`:h+=` ${f}, `}),n.workspaceStep(h)}else n.workspaceStep(`no workspace dependencies found in ${l}`);i!=null&&i.dry||pT.default.writeJSONSync(e.paths.packageJson,s,{spaces:2})}var Hn={name:"pnpm",lock:"pnpm-lock.yaml"};async function bT(t){let e=Ti.default.join(t.workspaceRoot,Hn.lock),r=Ti.default.join(t.workspaceRoot,"pnpm-workspace.yaml"),n=ah({workspaceRoot:t.workspaceRoot});return hr.default.existsSync(e)||hr.default.existsSync(r)||n===Hn.name}async function XH(t){if(!await bT(t))throw new He("Not a pnpm project",{type:"package_manager-unexpected"});let{name:e,description:r}=ja(t);return{name:e,description:r,packageManager:Hn.name,paths:uh({root:t.workspaceRoot,lockFile:Hn.lock,workspaceConfig:"pnpm-workspace.yaml"}),workspaceData:{globs:qk(t),workspaces:ch({workspaceGlobs:qk(t),...t})}}}async function QH(t){let{project:e,to:r,logger:n,options:i}=t,s=e.workspaceData.globs.length>0;n.mainStep($n({action:"create",packageManager:Hn.name,project:e}));let o=Ct({workspaceRoot:e.paths.root});n.rootHeader(),o.packageManager=`${r.name}@${r.version}`,n.rootStep(`adding "packageManager" field to ${e.name} root "package.json"`),i!=null&&i.dry||(hr.default.writeJSONSync(e.paths.packageJson,o,{spaces:2}),s&&(n.rootStep('adding "pnpm-workspace.yaml"'),hr.default.writeFileSync(Ti.default.join(e.paths.root,"pnpm-workspace.yaml"),`packages:
|
65
|
+
`).reduce(a,Object.create(null)),a=(u,c)=>{let l=parseInt(c,10);if(l!==Buffer.byteLength(c)+1)return u;c=c.slice((l+" ").length);let h=c.split("="),f=h.shift().replace(/^SCHILY\.(dev|ino|nlink)/,"$1");if(!f)return u;let d=h.join("=");return u[f]=/^([A-Z]+\.)?([mac]|birth|creation)time$/.test(f)?new Date(d*1e3):/^[0-9]+$/.test(d)?+d:d,u};e.exports=i}),Na=me((t,e)=>{ee(),e.exports=r=>{let n=r.length-1,i=-1;for(;n>-1&&r.charAt(n)==="/";)i=n,n--;return i===-1?r:r.slice(0,i)}}),sg=me((t,e)=>{"use strict";ee(),e.exports=r=>class extends r{warn(n,i,s={}){this.file&&(s.file=this.file),this.cwd&&(s.cwd=this.cwd),s.code=i instanceof Error&&i.code||n,s.tarCode=n,!this.strict&&s.recoverable!==!1?(i instanceof Error&&(s=Object.assign(i,s),i=i.message),this.emit("warn",s.tarCode,i,s)):i instanceof Error?this.emit("error",Object.assign(i,s)):this.emit("error",Object.assign(new Error(`${n}: ${i}`),s))}}}),Wk=me((t,e)=>{"use strict";ee();var r=["|","<",">","?",":"],n=r.map(o=>String.fromCharCode(61440+o.charCodeAt(0))),i=new Map(r.map((o,a)=>[o,n[a]])),s=new Map(n.map((o,a)=>[o,r[a]]));e.exports={encode:o=>r.reduce((a,u)=>a.split(u).join(i.get(u)),o),decode:o=>n.reduce((a,u)=>a.split(u).join(s.get(u)),o)}}),Yk=me((t,e)=>{ee();var{isAbsolute:r,parse:n}=_e("path").win32;e.exports=i=>{let s="",o=n(i);for(;r(i)||o.root;){let a=i.charAt(0)==="/"&&i.slice(0,4)!=="//?/"?"/":o.root;i=i.slice(a.length),s+=a,o=n(i)}return[s,i]}}),cH=me((t,e)=>{"use strict";ee(),e.exports=(r,n,i)=>(r&=4095,i&&(r=(r|384)&-19),n&&(r&256&&(r|=64),r&32&&(r|=8),r&4&&(r|=1)),r)}),Kk=me((t,e)=>{"use strict";ee();var r=rg(),n=ig(),i=Ba(),s=_e("fs"),o=_e("path"),a=La(),u=Na(),c=(_,v)=>v?(_=a(_).replace(/^\.(\/|$)/,""),u(v)+"/"+_):a(_),l=16*1024*1024,h=Symbol("process"),f=Symbol("file"),d=Symbol("directory"),m=Symbol("symlink"),y=Symbol("hardlink"),p=Symbol("header"),E=Symbol("read"),R=Symbol("lstat"),P=Symbol("onlstat"),I=Symbol("onread"),T=Symbol("onreadlink"),M=Symbol("openfile"),x=Symbol("onopenfile"),D=Symbol("close"),U=Symbol("mode"),V=Symbol("awaitDrain"),N=Symbol("ondrain"),W=Symbol("prefix"),Q=Symbol("hadError"),te=sg(),j=Wk(),F=Yk(),L=cH(),G=te(class extends r{constructor(_,v){if(v=v||{},super(v),typeof _!="string")throw new TypeError("path is required");this.path=a(_),this.portable=!!v.portable,this.myuid=process.getuid&&process.getuid()||0,this.myuser=process.env.USER||"",this.maxReadSize=v.maxReadSize||l,this.linkCache=v.linkCache||new Map,this.statCache=v.statCache||new Map,this.preservePaths=!!v.preservePaths,this.cwd=a(v.cwd||process.cwd()),this.strict=!!v.strict,this.noPax=!!v.noPax,this.noMtime=!!v.noMtime,this.mtime=v.mtime||null,this.prefix=v.prefix?a(v.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 v.onwarn=="function"&&this.on("warn",v.onwarn);let k=!1;if(!this.preservePaths){let[S,H]=F(this.path);S&&(this.path=H,k=S)}this.win32=!!v.win32||process.platform==="win32",this.win32&&(this.path=j.decode(this.path.replace(/\\/g,"/")),_=_.replace(/\\/g,"/")),this.absolute=a(v.absolute||o.resolve(this.cwd,_)),this.path===""&&(this.path="./"),k&&this.warn("TAR_ENTRY_INFO",`stripping ${k} from absolute path`,{entry:this,path:k+this.path}),this.statCache.has(this.absolute)?this[P](this.statCache.get(this.absolute)):this[R]()}emit(_,...v){return _==="error"&&(this[Q]=!0),super.emit(_,...v)}[R](){s.lstat(this.absolute,(_,v)=>{if(_)return this.emit("error",_);this[P](v)})}[P](_){this.statCache.set(this.absolute,_),this.stat=_,_.isFile()||(_.size=0),this.type=g(_),this.emit("stat",_),this[h]()}[h](){switch(this.type){case"File":return this[f]();case"Directory":return this[d]();case"SymbolicLink":return this[m]();default:return this.end()}}[U](_){return L(_,this.type==="Directory",this.portable)}[W](_){return c(_,this.prefix)}[p](){this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.header=new i({path:this[W](this.path),linkpath:this.type==="Link"?this[W](this.linkpath):this.linkpath,mode:this[U](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 n({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[W](this.path),linkpath:this.type==="Link"?this[W](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[p](),this.end()}[m](){s.readlink(this.absolute,(_,v)=>{if(_)return this.emit("error",_);this[T](v)})}[T](_){this.linkpath=a(_),this[p](),this.end()}[y](_){this.type="Link",this.linkpath=a(o.relative(this.cwd,_)),this.stat.size=0,this[p](),this.end()}[f](){if(this.stat.nlink>1){let _=this.stat.dev+":"+this.stat.ino;if(this.linkCache.has(_)){let v=this.linkCache.get(_);if(v.indexOf(this.cwd)===0)return this[y](v)}this.linkCache.set(_,this.absolute)}if(this[p](),this.stat.size===0)return this.end();this[M]()}[M](){s.open(this.absolute,"r",(_,v)=>{if(_)return this.emit("error",_);this[x](v)})}[x](_){if(this.fd=_,this[Q])return this[D]();this.blockLen=512*Math.ceil(this.stat.size/512),this.blockRemain=this.blockLen;let v=Math.min(this.blockLen,this.maxReadSize);this.buf=Buffer.allocUnsafe(v),this.offset=0,this.pos=0,this.remain=this.stat.size,this.length=this.buf.length,this[E]()}[E](){let{fd:_,buf:v,offset:k,length:S,pos:H}=this;s.read(_,v,k,S,H,($,ne)=>{if($)return this[D](()=>this.emit("error",$));this[I](ne)})}[D](_){s.close(this.fd,_)}[I](_){if(_<=0&&this.remain>0){let k=new Error("encountered unexpected EOF");return k.path=this.absolute,k.syscall="read",k.code="EOF",this[D](()=>this.emit("error",k))}if(_>this.remain){let k=new Error("did not encounter expected EOF");return k.path=this.absolute,k.syscall="read",k.code="EOF",this[D](()=>this.emit("error",k))}if(_===this.remain)for(let k=_;k<this.length&&_<this.blockRemain;k++)this.buf[k+this.offset]=0,_++,this.remain++;let v=this.offset===0&&_===this.buf.length?this.buf:this.buf.slice(this.offset,this.offset+_);this.write(v)?this[N]():this[V](()=>this[N]())}[V](_){this.once("drain",_)}write(_){if(this.blockRemain<_.length){let v=new Error("writing more data than expected");return v.path=this.absolute,this.emit("error",v)}return this.remain-=_.length,this.blockRemain-=_.length,this.pos+=_.length,this.offset+=_.length,super.write(_)}[N](){if(!this.remain)return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),this[D](_=>_?this.emit("error",_):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[E]()}}),Z=class extends G{[R](){this[P](s.lstatSync(this.absolute))}[m](){this[T](s.readlinkSync(this.absolute))}[M](){this[x](s.openSync(this.absolute,"r"))}[E](){let _=!0;try{let{fd:v,buf:k,offset:S,length:H,pos:$}=this,ne=s.readSync(v,k,S,H,$);this[I](ne),_=!1}finally{if(_)try{this[D](()=>{})}catch{}}}[V](_){_()}[D](_){s.closeSync(this.fd),_()}},q=te(class extends r{constructor(_,v){v=v||{},super(v),this.preservePaths=!!v.preservePaths,this.portable=!!v.portable,this.strict=!!v.strict,this.noPax=!!v.noPax,this.noMtime=!!v.noMtime,this.readEntry=_,this.type=_.type,this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.prefix=v.prefix||null,this.path=a(_.path),this.mode=this[U](_.mode),this.uid=this.portable?null:_.uid,this.gid=this.portable?null:_.gid,this.uname=this.portable?null:_.uname,this.gname=this.portable?null:_.gname,this.size=_.size,this.mtime=this.noMtime?null:v.mtime||_.mtime,this.atime=this.portable?null:_.atime,this.ctime=this.portable?null:_.ctime,this.linkpath=a(_.linkpath),typeof v.onwarn=="function"&&this.on("warn",v.onwarn);let k=!1;if(!this.preservePaths){let[S,H]=F(this.path);S&&(this.path=H,k=S)}this.remain=_.size,this.blockRemain=_.startBlockSize,this.header=new i({path:this[W](this.path),linkpath:this.type==="Link"?this[W](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}),k&&this.warn("TAR_ENTRY_INFO",`stripping ${k} from absolute path`,{entry:this,path:k+this.path}),this.header.encode()&&!this.noPax&&super.write(new n({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[W](this.path),linkpath:this.type==="Link"?this[W](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),_.pipe(this)}[W](_){return c(_,this.prefix)}[U](_){return L(_,this.type==="Directory",this.portable)}write(_){let v=_.length;if(v>this.blockRemain)throw new Error("writing more to entry than is appropriate");return this.blockRemain-=v,super.write(_)}end(){return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),super.end()}});G.Sync=Z,G.Tar=q;var g=_=>_.isFile()?"File":_.isDirectory()?"Directory":_.isSymbolicLink()?"SymbolicLink":"Unsupported";e.exports=G}),lH=me((t,e)=>{"use strict";ee(),e.exports=function(r){r.prototype[Symbol.iterator]=function*(){for(let n=this.head;n;n=n.next)yield n.value}}}),Zk=me((t,e)=>{"use strict";ee(),e.exports=r,r.Node=o,r.create=r;function r(a){var u=this;if(u instanceof r||(u=new r),u.tail=null,u.head=null,u.length=0,a&&typeof a.forEach=="function")a.forEach(function(h){u.push(h)});else if(arguments.length>0)for(var c=0,l=arguments.length;c<l;c++)u.push(arguments[c]);return u}r.prototype.removeNode=function(a){if(a.list!==this)throw new Error("removing node which does not belong to this list");var u=a.next,c=a.prev;return u&&(u.prev=c),c&&(c.next=u),a===this.head&&(this.head=u),a===this.tail&&(this.tail=c),a.list.length--,a.next=null,a.prev=null,a.list=null,u},r.prototype.unshiftNode=function(a){if(a!==this.head){a.list&&a.list.removeNode(a);var u=this.head;a.list=this,a.next=u,u&&(u.prev=a),this.head=a,this.tail||(this.tail=a),this.length++}},r.prototype.pushNode=function(a){if(a!==this.tail){a.list&&a.list.removeNode(a);var u=this.tail;a.list=this,a.prev=u,u&&(u.next=a),this.tail=a,this.head||(this.head=a),this.length++}},r.prototype.push=function(){for(var a=0,u=arguments.length;a<u;a++)i(this,arguments[a]);return this.length},r.prototype.unshift=function(){for(var a=0,u=arguments.length;a<u;a++)s(this,arguments[a]);return this.length},r.prototype.pop=function(){if(this.tail){var a=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,a}},r.prototype.shift=function(){if(this.head){var a=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,a}},r.prototype.forEach=function(a,u){u=u||this;for(var c=this.head,l=0;c!==null;l++)a.call(u,c.value,l,this),c=c.next},r.prototype.forEachReverse=function(a,u){u=u||this;for(var c=this.tail,l=this.length-1;c!==null;l--)a.call(u,c.value,l,this),c=c.prev},r.prototype.get=function(a){for(var u=0,c=this.head;c!==null&&u<a;u++)c=c.next;if(u===a&&c!==null)return c.value},r.prototype.getReverse=function(a){for(var u=0,c=this.tail;c!==null&&u<a;u++)c=c.prev;if(u===a&&c!==null)return c.value},r.prototype.map=function(a,u){u=u||this;for(var c=new r,l=this.head;l!==null;)c.push(a.call(u,l.value,this)),l=l.next;return c},r.prototype.mapReverse=function(a,u){u=u||this;for(var c=new r,l=this.tail;l!==null;)c.push(a.call(u,l.value,this)),l=l.prev;return c},r.prototype.reduce=function(a,u){var c,l=this.head;if(arguments.length>1)c=u;else if(this.head)l=this.head.next,c=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var h=0;l!==null;h++)c=a(c,l.value,h),l=l.next;return c},r.prototype.reduceReverse=function(a,u){var c,l=this.tail;if(arguments.length>1)c=u;else if(this.tail)l=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;l!==null;h--)c=a(c,l.value,h),l=l.prev;return c},r.prototype.toArray=function(){for(var a=new Array(this.length),u=0,c=this.head;c!==null;u++)a[u]=c.value,c=c.next;return a},r.prototype.toArrayReverse=function(){for(var a=new Array(this.length),u=0,c=this.tail;c!==null;u++)a[u]=c.value,c=c.prev;return a},r.prototype.slice=function(a,u){u=u||this.length,u<0&&(u+=this.length),a=a||0,a<0&&(a+=this.length);var c=new r;if(u<a||u<0)return c;a<0&&(a=0),u>this.length&&(u=this.length);for(var l=0,h=this.head;h!==null&&l<a;l++)h=h.next;for(;h!==null&&l<u;l++,h=h.next)c.push(h.value);return c},r.prototype.sliceReverse=function(a,u){u=u||this.length,u<0&&(u+=this.length),a=a||0,a<0&&(a+=this.length);var c=new r;if(u<a||u<0)return c;a<0&&(a=0),u>this.length&&(u=this.length);for(var l=this.length,h=this.tail;h!==null&&l>u;l--)h=h.prev;for(;h!==null&&l>a;l--,h=h.prev)c.push(h.value);return c},r.prototype.splice=function(a,u,...c){a>this.length&&(a=this.length-1),a<0&&(a=this.length+a);for(var l=0,h=this.head;h!==null&&l<a;l++)h=h.next;for(var f=[],l=0;h&&l<u;l++)f.push(h.value),h=this.removeNode(h);h===null&&(h=this.tail),h!==this.head&&h!==this.tail&&(h=h.prev);for(var l=0;l<c.length;l++)h=n(this,h,c[l]);return f},r.prototype.reverse=function(){for(var a=this.head,u=this.tail,c=a;c!==null;c=c.prev){var l=c.prev;c.prev=c.next,c.next=l}return this.head=u,this.tail=a,this};function n(a,u,c){var l=u===a.head?new o(c,null,u,a):new o(c,u,u.next,a);return l.next===null&&(a.tail=l),l.prev===null&&(a.head=l),a.length++,l}function i(a,u){a.tail=new o(u,a.tail,null,a),a.head||(a.head=a.tail),a.length++}function s(a,u){a.head=new o(u,null,a.head,a),a.tail||(a.tail=a.head),a.length++}function o(a,u,c,l){if(!(this instanceof o))return new o(a,u,c,l);this.list=l,this.value=a,u?(u.next=this,this.prev=u):this.prev=null,c?(c.prev=this,this.next=c):this.next=null}try{lH()(r)}catch{}}),og=me((t,e)=>{"use strict";ee();var r=class{constructor(g,_){this.path=g||"./",this.absolute=_,this.entry=null,this.stat=null,this.readdir=null,this.pending=!1,this.ignore=!1,this.piped=!1}},n=rg(),i=zk(),s=ng(),o=Kk(),a=o.Sync,u=o.Tar,c=Zk(),l=Buffer.alloc(1024),h=Symbol("onStat"),f=Symbol("ended"),d=Symbol("queue"),m=Symbol("current"),y=Symbol("process"),p=Symbol("processing"),E=Symbol("processJob"),R=Symbol("jobs"),P=Symbol("jobDone"),I=Symbol("addFSEntry"),T=Symbol("addTarEntry"),M=Symbol("stat"),x=Symbol("readdir"),D=Symbol("onreaddir"),U=Symbol("pipe"),V=Symbol("entry"),N=Symbol("entryOpt"),W=Symbol("writeEntryClass"),Q=Symbol("write"),te=Symbol("ondrain"),j=_e("fs"),F=_e("path"),L=sg(),G=La(),Z=L(class extends n{constructor(g){super(g),g=g||Object.create(null),this.opt=g,this.file=g.file||"",this.cwd=g.cwd||process.cwd(),this.maxReadSize=g.maxReadSize,this.preservePaths=!!g.preservePaths,this.strict=!!g.strict,this.noPax=!!g.noPax,this.prefix=G(g.prefix||""),this.linkCache=g.linkCache||new Map,this.statCache=g.statCache||new Map,this.readdirCache=g.readdirCache||new Map,this[W]=o,typeof g.onwarn=="function"&&this.on("warn",g.onwarn),this.portable=!!g.portable,this.zip=null,g.gzip?(typeof g.gzip!="object"&&(g.gzip={}),this.portable&&(g.gzip.portable=!0),this.zip=new i.Gzip(g.gzip),this.zip.on("data",_=>super.write(_)),this.zip.on("end",_=>super.end()),this.zip.on("drain",_=>this[te]()),this.on("resume",_=>this.zip.resume())):this.on("drain",this[te]),this.noDirRecurse=!!g.noDirRecurse,this.follow=!!g.follow,this.noMtime=!!g.noMtime,this.mtime=g.mtime||null,this.filter=typeof g.filter=="function"?g.filter:_=>!0,this[d]=new c,this[R]=0,this.jobs=+g.jobs||4,this[p]=!1,this[f]=!1}[Q](g){return super.write(g)}add(g){return this.write(g),this}end(g){return g&&this.write(g),this[f]=!0,this[y](),this}write(g){if(this[f])throw new Error("write after end");return g instanceof s?this[T](g):this[I](g),this.flowing}[T](g){let _=G(F.resolve(this.cwd,g.path));if(!this.filter(g.path,g))g.resume();else{let v=new r(g.path,_,!1);v.entry=new u(g,this[N](v)),v.entry.on("end",k=>this[P](v)),this[R]+=1,this[d].push(v)}this[y]()}[I](g){let _=G(F.resolve(this.cwd,g));this[d].push(new r(g,_)),this[y]()}[M](g){g.pending=!0,this[R]+=1;let _=this.follow?"stat":"lstat";j[_](g.absolute,(v,k)=>{g.pending=!1,this[R]-=1,v?this.emit("error",v):this[h](g,k)})}[h](g,_){this.statCache.set(g.absolute,_),g.stat=_,this.filter(g.path,_)||(g.ignore=!0),this[y]()}[x](g){g.pending=!0,this[R]+=1,j.readdir(g.absolute,(_,v)=>{if(g.pending=!1,this[R]-=1,_)return this.emit("error",_);this[D](g,v)})}[D](g,_){this.readdirCache.set(g.absolute,_),g.readdir=_,this[y]()}[y](){if(!this[p]){this[p]=!0;for(let g=this[d].head;g!==null&&this[R]<this.jobs;g=g.next)if(this[E](g.value),g.value.ignore){let _=g.next;this[d].removeNode(g),g.next=_}this[p]=!1,this[f]&&!this[d].length&&this[R]===0&&(this.zip?this.zip.end(l):(super.write(l),super.end()))}}get[m](){return this[d]&&this[d].head&&this[d].head.value}[P](g){this[d].shift(),this[R]-=1,this[y]()}[E](g){if(!g.pending){if(g.entry){g===this[m]&&!g.piped&&this[U](g);return}if(g.stat||(this.statCache.has(g.absolute)?this[h](g,this.statCache.get(g.absolute)):this[M](g)),!!g.stat&&!g.ignore&&!(!this.noDirRecurse&&g.stat.isDirectory()&&!g.readdir&&(this.readdirCache.has(g.absolute)?this[D](g,this.readdirCache.get(g.absolute)):this[x](g),!g.readdir))){if(g.entry=this[V](g),!g.entry){g.ignore=!0;return}g===this[m]&&!g.piped&&this[U](g)}}}[N](g){return{onwarn:(_,v,k)=>this.warn(_,v,k),noPax:this.noPax,cwd:this.cwd,absolute:g.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}}[V](g){this[R]+=1;try{return new this[W](g.path,this[N](g)).on("end",()=>this[P](g)).on("error",_=>this.emit("error",_))}catch(_){this.emit("error",_)}}[te](){this[m]&&this[m].entry&&this[m].entry.resume()}[U](g){g.piped=!0,g.readdir&&g.readdir.forEach(k=>{let S=g.path,H=S==="./"?"":S.replace(/\/*$/,"/");this[I](H+k)});let _=g.entry,v=this.zip;v?_.on("data",k=>{v.write(k)||_.pause()}):_.on("data",k=>{super.write(k)||_.pause()})}pause(){return this.zip&&this.zip.pause(),super.pause()}}),q=class extends Z{constructor(g){super(g),this[W]=a}pause(){}resume(){}[M](g){let _=this.follow?"statSync":"lstatSync";this[h](g,j[_](g.absolute))}[x](g,_){this[D](g,j.readdirSync(g.absolute))}[U](g){let _=g.entry,v=this.zip;g.readdir&&g.readdir.forEach(k=>{let S=g.path,H=S==="./"?"":S.replace(/\/*$/,"/");this[I](H+k)}),v?_.on("data",k=>{v.write(k)}):_.on("data",k=>{super[Q](k)})}};Z.Sync=q,e.exports=Z}),Ma=me(t=>{"use strict";ee();var e=$k(),r=_e("events").EventEmitter,n=_e("fs"),i=n.writev;if(!i){let g=process.binding("fs"),_=g.FSReqWrap||g.FSReqCallback;i=(v,k,S,H)=>{let $=(Y,fe)=>H(Y,fe,k),ne=new _;ne.oncomplete=$,g.writeBuffers(v,k,S,ne)}}var s=Symbol("_autoClose"),o=Symbol("_close"),a=Symbol("_ended"),u=Symbol("_fd"),c=Symbol("_finished"),l=Symbol("_flags"),h=Symbol("_flush"),f=Symbol("_handleChunk"),d=Symbol("_makeBuf"),m=Symbol("_mode"),y=Symbol("_needDrain"),p=Symbol("_onerror"),E=Symbol("_onopen"),R=Symbol("_onread"),P=Symbol("_onwrite"),I=Symbol("_open"),T=Symbol("_path"),M=Symbol("_pos"),x=Symbol("_queue"),D=Symbol("_read"),U=Symbol("_readSize"),V=Symbol("_reading"),N=Symbol("_remain"),W=Symbol("_size"),Q=Symbol("_write"),te=Symbol("_writing"),j=Symbol("_defaultFlag"),F=Symbol("_errored"),L=class extends e{constructor(g,_){if(_=_||{},super(_),this.readable=!0,this.writable=!1,typeof g!="string")throw new TypeError("path must be a string");this[F]=!1,this[u]=typeof _.fd=="number"?_.fd:null,this[T]=g,this[U]=_.readSize||16*1024*1024,this[V]=!1,this[W]=typeof _.size=="number"?_.size:1/0,this[N]=this[W],this[s]=typeof _.autoClose=="boolean"?_.autoClose:!0,typeof this[u]=="number"?this[D]():this[I]()}get fd(){return this[u]}get path(){return this[T]}write(){throw new TypeError("this is a readable stream")}end(){throw new TypeError("this is a readable stream")}[I](){n.open(this[T],"r",(g,_)=>this[E](g,_))}[E](g,_){g?this[p](g):(this[u]=_,this.emit("open",_),this[D]())}[d](){return Buffer.allocUnsafe(Math.min(this[U],this[N]))}[D](){if(!this[V]){this[V]=!0;let g=this[d]();if(g.length===0)return process.nextTick(()=>this[R](null,0,g));n.read(this[u],g,0,g.length,null,(_,v,k)=>this[R](_,v,k))}}[R](g,_,v){this[V]=!1,g?this[p](g):this[f](_,v)&&this[D]()}[o](){if(this[s]&&typeof this[u]=="number"){let g=this[u];this[u]=null,n.close(g,_=>_?this.emit("error",_):this.emit("close"))}}[p](g){this[V]=!0,this[o](),this.emit("error",g)}[f](g,_){let v=!1;return this[N]-=g,g>0&&(v=super.write(g<_.length?_.slice(0,g):_)),(g===0||this[N]<=0)&&(v=!1,this[o](),super.end()),v}emit(g,_){switch(g){case"prefinish":case"finish":break;case"drain":typeof this[u]=="number"&&this[D]();break;case"error":return this[F]?void 0:(this[F]=!0,super.emit(g,_));default:return super.emit(g,_)}}},G=class extends L{[I](){let g=!0;try{this[E](null,n.openSync(this[T],"r")),g=!1}finally{g&&this[o]()}}[D](){let g=!0;try{if(!this[V]){this[V]=!0;do{let _=this[d](),v=_.length===0?0:n.readSync(this[u],_,0,_.length,null);if(!this[f](v,_))break}while(!0);this[V]=!1}g=!1}finally{g&&this[o]()}}[o](){if(this[s]&&typeof this[u]=="number"){let g=this[u];this[u]=null,n.closeSync(g),this.emit("close")}}},Z=class extends r{constructor(g,_){_=_||{},super(_),this.readable=!1,this.writable=!0,this[F]=!1,this[te]=!1,this[a]=!1,this[y]=!1,this[x]=[],this[T]=g,this[u]=typeof _.fd=="number"?_.fd:null,this[m]=_.mode===void 0?438:_.mode,this[M]=typeof _.start=="number"?_.start:null,this[s]=typeof _.autoClose=="boolean"?_.autoClose:!0;let v=this[M]!==null?"r+":"w";this[j]=_.flags===void 0,this[l]=this[j]?v:_.flags,this[u]===null&&this[I]()}emit(g,_){if(g==="error"){if(this[F])return;this[F]=!0}return super.emit(g,_)}get fd(){return this[u]}get path(){return this[T]}[p](g){this[o](),this[te]=!0,this.emit("error",g)}[I](){n.open(this[T],this[l],this[m],(g,_)=>this[E](g,_))}[E](g,_){this[j]&&this[l]==="r+"&&g&&g.code==="ENOENT"?(this[l]="w",this[I]()):g?this[p](g):(this[u]=_,this.emit("open",_),this[h]())}end(g,_){return g&&this.write(g,_),this[a]=!0,!this[te]&&!this[x].length&&typeof this[u]=="number"&&this[P](null,0),this}write(g,_){return typeof g=="string"&&(g=Buffer.from(g,_)),this[a]?(this.emit("error",new Error("write() after end()")),!1):this[u]===null||this[te]||this[x].length?(this[x].push(g),this[y]=!0,!1):(this[te]=!0,this[Q](g),!0)}[Q](g){n.write(this[u],g,0,g.length,this[M],(_,v)=>this[P](_,v))}[P](g,_){g?this[p](g):(this[M]!==null&&(this[M]+=_),this[x].length?this[h]():(this[te]=!1,this[a]&&!this[c]?(this[c]=!0,this[o](),this.emit("finish")):this[y]&&(this[y]=!1,this.emit("drain"))))}[h](){if(this[x].length===0)this[a]&&this[P](null,0);else if(this[x].length===1)this[Q](this[x].pop());else{let g=this[x];this[x]=[],i(this[u],g,this[M],(_,v)=>this[P](_,v))}}[o](){if(this[s]&&typeof this[u]=="number"){let g=this[u];this[u]=null,n.close(g,_=>_?this.emit("error",_):this.emit("close"))}}},q=class extends Z{[I](){let g;if(this[j]&&this[l]==="r+")try{g=n.openSync(this[T],this[l],this[m])}catch(_){if(_.code==="ENOENT")return this[l]="w",this[I]();throw _}else g=n.openSync(this[T],this[l],this[m]);this[E](null,g)}[o](){if(this[s]&&typeof this[u]=="number"){let g=this[u];this[u]=null,n.closeSync(g),this.emit("close")}}[Q](g){let _=!0;try{this[P](null,n.writeSync(this[u],g,0,g.length,this[M])),_=!1}finally{if(_)try{this[o]()}catch{}}}};t.ReadStream=L,t.ReadStreamSync=G,t.WriteStream=Z,t.WriteStreamSync=q}),ag=me((t,e)=>{"use strict";ee();var r=sg(),n=Ba(),i=_e("events"),s=Zk(),o=1024*1024,a=ng(),u=ig(),c=zk(),{nextTick:l}=_e("process"),h=Buffer.from([31,139]),f=Symbol("state"),d=Symbol("writeEntry"),m=Symbol("readEntry"),y=Symbol("nextEntry"),p=Symbol("processEntry"),E=Symbol("extendedHeader"),R=Symbol("globalExtendedHeader"),P=Symbol("meta"),I=Symbol("emitMeta"),T=Symbol("buffer"),M=Symbol("queue"),x=Symbol("ended"),D=Symbol("emittedEnd"),U=Symbol("emit"),V=Symbol("unzip"),N=Symbol("consumeChunk"),W=Symbol("consumeChunkSub"),Q=Symbol("consumeBody"),te=Symbol("consumeMeta"),j=Symbol("consumeHeader"),F=Symbol("consuming"),L=Symbol("bufferConcat"),G=Symbol("maybeEnd"),Z=Symbol("writing"),q=Symbol("aborted"),g=Symbol("onDone"),_=Symbol("sawValidEntry"),v=Symbol("sawNullBlock"),k=Symbol("sawEOF"),S=Symbol("closeStream"),H=$=>!0;e.exports=r(class extends i{constructor($){$=$||{},super($),this.file=$.file||"",this[_]=null,this.on(g,ne=>{(this[f]==="begin"||this[_]===!1)&&this.warn("TAR_BAD_ARCHIVE","Unrecognized archive format")}),$.ondone?this.on(g,$.ondone):this.on(g,ne=>{this.emit("prefinish"),this.emit("finish"),this.emit("end")}),this.strict=!!$.strict,this.maxMetaEntrySize=$.maxMetaEntrySize||o,this.filter=typeof $.filter=="function"?$.filter:H,this.writable=!0,this.readable=!1,this[M]=new s,this[T]=null,this[m]=null,this[d]=null,this[f]="begin",this[P]="",this[E]=null,this[R]=null,this[x]=!1,this[V]=null,this[q]=!1,this[v]=!1,this[k]=!1,this.on("end",()=>this[S]()),typeof $.onwarn=="function"&&this.on("warn",$.onwarn),typeof $.onentry=="function"&&this.on("entry",$.onentry)}[j]($,ne){this[_]===null&&(this[_]=!1);let Y;try{Y=new n($,ne,this[E],this[R])}catch(fe){return this.warn("TAR_ENTRY_INVALID",fe)}if(Y.nullBlock)this[v]?(this[k]=!0,this[f]==="begin"&&(this[f]="header"),this[U]("eof")):(this[v]=!0,this[U]("nullBlock"));else if(this[v]=!1,!Y.cksumValid)this.warn("TAR_ENTRY_INVALID","checksum failure",{header:Y});else if(!Y.path)this.warn("TAR_ENTRY_INVALID","path is required",{header:Y});else{let fe=Y.type;if(/^(Symbolic)?Link$/.test(fe)&&!Y.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath required",{header:Y});else if(!/^(Symbolic)?Link$/.test(fe)&&Y.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath forbidden",{header:Y});else{let J=this[d]=new a(Y,this[E],this[R]);if(!this[_])if(J.remain){let w=()=>{J.invalid||(this[_]=!0)};J.on("end",w)}else this[_]=!0;J.meta?J.size>this.maxMetaEntrySize?(J.ignore=!0,this[U]("ignoredEntry",J),this[f]="ignore",J.resume()):J.size>0&&(this[P]="",J.on("data",w=>this[P]+=w),this[f]="meta"):(this[E]=null,J.ignore=J.ignore||!this.filter(J.path,J),J.ignore?(this[U]("ignoredEntry",J),this[f]=J.remain?"ignore":"header",J.resume()):(J.remain?this[f]="body":(this[f]="header",J.end()),this[m]?this[M].push(J):(this[M].push(J),this[y]())))}}}[S](){l(()=>this.emit("close"))}[p]($){let ne=!0;return $?Array.isArray($)?this.emit.apply(this,$):(this[m]=$,this.emit("entry",$),$.emittedEnd||($.on("end",Y=>this[y]()),ne=!1)):(this[m]=null,ne=!1),ne}[y](){do;while(this[p](this[M].shift()));if(!this[M].length){let $=this[m];!$||$.flowing||$.size===$.remain?this[Z]||this.emit("drain"):$.once("drain",ne=>this.emit("drain"))}}[Q]($,ne){let Y=this[d],fe=Y.blockRemain,J=fe>=$.length&&ne===0?$:$.slice(ne,ne+fe);return Y.write(J),Y.blockRemain||(this[f]="header",this[d]=null,Y.end()),J.length}[te]($,ne){let Y=this[d],fe=this[Q]($,ne);return this[d]||this[I](Y),fe}[U]($,ne,Y){!this[M].length&&!this[m]?this.emit($,ne,Y):this[M].push([$,ne,Y])}[I]($){switch(this[U]("meta",this[P]),$.type){case"ExtendedHeader":case"OldExtendedHeader":this[E]=u.parse(this[P],this[E],!1);break;case"GlobalExtendedHeader":this[R]=u.parse(this[P],this[R],!0);break;case"NextFileHasLongPath":case"OldGnuLongPath":this[E]=this[E]||Object.create(null),this[E].path=this[P].replace(/\0.*/,"");break;case"NextFileHasLongLinkpath":this[E]=this[E]||Object.create(null),this[E].linkpath=this[P].replace(/\0.*/,"");break;default:throw new Error("unknown meta: "+$.type)}}abort($){this[q]=!0,this.emit("abort",$),this.warn("TAR_ABORT",$,{recoverable:!1})}write($){if(this[q])return;if(this[V]===null&&$){if(this[T]&&($=Buffer.concat([this[T],$]),this[T]=null),$.length<h.length)return this[T]=$,!0;for(let Y=0;this[V]===null&&Y<h.length;Y++)$[Y]!==h[Y]&&(this[V]=!1);if(this[V]===null){let Y=this[x];this[x]=!1,this[V]=new c.Unzip,this[V].on("data",J=>this[N](J)),this[V].on("error",J=>this.abort(J)),this[V].on("end",J=>{this[x]=!0,this[N]()}),this[Z]=!0;let fe=this[V][Y?"end":"write"]($);return this[Z]=!1,fe}}this[Z]=!0,this[V]?this[V].write($):this[N]($),this[Z]=!1;let ne=this[M].length?!1:this[m]?this[m].flowing:!0;return!ne&&!this[M].length&&this[m].once("drain",Y=>this.emit("drain")),ne}[L]($){$&&!this[q]&&(this[T]=this[T]?Buffer.concat([this[T],$]):$)}[G](){if(this[x]&&!this[D]&&!this[q]&&!this[F]){this[D]=!0;let $=this[d];if($&&$.blockRemain){let ne=this[T]?this[T].length:0;this.warn("TAR_BAD_ARCHIVE",`Truncated input (needed ${$.blockRemain} more bytes, only ${ne} available)`,{entry:$}),this[T]&&$.write(this[T]),$.end()}this[U](g)}}[N]($){if(this[F])this[L]($);else if(!$&&!this[T])this[G]();else{if(this[F]=!0,this[T]){this[L]($);let ne=this[T];this[T]=null,this[W](ne)}else this[W]($);for(;this[T]&&this[T].length>=512&&!this[q]&&!this[k];){let ne=this[T];this[T]=null,this[W](ne)}this[F]=!1}(!this[T]||this[x])&&this[G]()}[W]($){let ne=0,Y=$.length;for(;ne+512<=Y&&!this[q]&&!this[k];)switch(this[f]){case"begin":case"header":this[j]($,ne),ne+=512;break;case"ignore":case"body":ne+=this[Q]($,ne);break;case"meta":ne+=this[te]($,ne);break;default:throw new Error("invalid state: "+this[f])}ne<Y&&(this[T]?this[T]=Buffer.concat([$.slice(ne),this[T]]):this[T]=$.slice(ne))}end($){this[q]||(this[V]?this[V].end($):(this[x]=!0,this.write($)))}})}),ug=me((t,e)=>{"use strict";ee();var r=Ia(),n=ag(),i=_e("fs"),s=Ma(),o=_e("path"),a=Na();e.exports=(d,m,y)=>{typeof d=="function"?(y=d,m=null,d={}):Array.isArray(d)&&(m=d,d={}),typeof m=="function"&&(y=m,m=null),m?m=Array.from(m):m=[];let p=r(d);if(p.sync&&typeof y=="function")throw new TypeError("callback not supported for sync tar functions");if(!p.file&&typeof y=="function")throw new TypeError("callback only supported with file option");return m.length&&c(p,m),p.noResume||u(p),p.file&&p.sync?l(p):p.file?h(p,y):f(p)};var u=d=>{let m=d.onentry;d.onentry=m?y=>{m(y),y.resume()}:y=>y.resume()},c=(d,m)=>{let y=new Map(m.map(R=>[a(R),!0])),p=d.filter,E=(R,P)=>{let I=P||o.parse(R).root||".",T=R===I?!1:y.has(R)?y.get(R):E(o.dirname(R),I);return y.set(R,T),T};d.filter=p?(R,P)=>p(R,P)&&E(a(R)):R=>E(a(R))},l=d=>{let m=f(d),y=d.file,p=!0,E;try{let R=i.statSync(y),P=d.maxReadSize||16*1024*1024;if(R.size<P)m.end(i.readFileSync(y));else{let I=0,T=Buffer.allocUnsafe(P);for(E=i.openSync(y,"r");I<R.size;){let M=i.readSync(E,T,0,P,I);I+=M,m.write(T.slice(0,M))}m.end()}p=!1}finally{if(p&&E)try{i.closeSync(E)}catch{}}},h=(d,m)=>{let y=new n(d),p=d.maxReadSize||16*1024*1024,E=d.file,R=new Promise((P,I)=>{y.on("error",I),y.on("end",P),i.stat(E,(T,M)=>{if(T)I(T);else{let x=new s.ReadStream(E,{readSize:p,size:M.size});x.on("error",I),x.pipe(y)}})});return m?R.then(m,m):R},f=d=>new n(d)}),hH=me((t,e)=>{"use strict";ee();var r=Ia(),n=og(),i=Ma(),s=ug(),o=_e("path");e.exports=(d,m,y)=>{if(typeof m=="function"&&(y=m),Array.isArray(d)&&(m=d,d={}),!m||!Array.isArray(m)||!m.length)throw new TypeError("no files or directories specified");m=Array.from(m);let p=r(d);if(p.sync&&typeof y=="function")throw new TypeError("callback not supported for sync tar functions");if(!p.file&&typeof y=="function")throw new TypeError("callback only supported with file option");return p.file&&p.sync?a(p,m):p.file?u(p,m,y):p.sync?h(p,m):f(p,m)};var a=(d,m)=>{let y=new n.Sync(d),p=new i.WriteStreamSync(d.file,{mode:d.mode||438});y.pipe(p),c(y,m)},u=(d,m,y)=>{let p=new n(d),E=new i.WriteStream(d.file,{mode:d.mode||438});p.pipe(E);let R=new Promise((P,I)=>{E.on("error",I),E.on("close",P),p.on("error",I)});return l(p,m),y?R.then(y,y):R},c=(d,m)=>{m.forEach(y=>{y.charAt(0)==="@"?s({file:o.resolve(d.cwd,y.slice(1)),sync:!0,noResume:!0,onentry:p=>d.add(p)}):d.add(y)}),d.end()},l=(d,m)=>{for(;m.length;){let y=m.shift();if(y.charAt(0)==="@")return s({file:o.resolve(d.cwd,y.slice(1)),noResume:!0,onentry:p=>d.add(p)}).then(p=>l(d,m));d.add(y)}d.end()},h=(d,m)=>{let y=new n.Sync(d);return c(y,m),y},f=(d,m)=>{let y=new n(d);return l(y,m),y}}),Jk=me((t,e)=>{"use strict";ee();var r=Ia(),n=og(),i=_e("fs"),s=Ma(),o=ug(),a=_e("path"),u=Ba();e.exports=(m,y,p)=>{let E=r(m);if(!E.file)throw new TypeError("file is required");if(E.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),E.sync?c(E,y):h(E,y,p)};var c=(m,y)=>{let p=new n.Sync(m),E=!0,R,P;try{try{R=i.openSync(m.file,"r+")}catch(M){if(M.code==="ENOENT")R=i.openSync(m.file,"w+");else throw M}let I=i.fstatSync(R),T=Buffer.alloc(512);e:for(P=0;P<I.size;P+=512){for(let D=0,U=0;D<512;D+=U){if(U=i.readSync(R,T,D,T.length-D,P+D),P===0&&T[0]===31&&T[1]===139)throw new Error("cannot append to compressed archives");if(!U)break e}let M=new u(T);if(!M.cksumValid)break;let x=512*Math.ceil(M.size/512);if(P+x+512>I.size)break;P+=x,m.mtimeCache&&m.mtimeCache.set(M.path,M.mtime)}E=!1,l(m,p,P,R,y)}finally{if(E)try{i.closeSync(R)}catch{}}},l=(m,y,p,E,R)=>{let P=new s.WriteStreamSync(m.file,{fd:E,start:p});y.pipe(P),f(y,R)},h=(m,y,p)=>{y=Array.from(y);let E=new n(m),R=(I,T,M)=>{let x=(W,Q)=>{W?i.close(I,te=>M(W)):M(null,Q)},D=0;if(T===0)return x(null,0);let U=0,V=Buffer.alloc(512),N=(W,Q)=>{if(W)return x(W);if(U+=Q,U<512&&Q)return i.read(I,V,U,V.length-U,D+U,N);if(D===0&&V[0]===31&&V[1]===139)return x(new Error("cannot append to compressed archives"));if(U<512)return x(null,D);let te=new u(V);if(!te.cksumValid)return x(null,D);let j=512*Math.ceil(te.size/512);if(D+j+512>T||(D+=j+512,D>=T))return x(null,D);m.mtimeCache&&m.mtimeCache.set(te.path,te.mtime),U=0,i.read(I,V,0,512,D,N)};i.read(I,V,0,512,D,N)},P=new Promise((I,T)=>{E.on("error",T);let M="r+",x=(D,U)=>{if(D&&D.code==="ENOENT"&&M==="r+")return M="w+",i.open(m.file,M,x);if(D)return T(D);i.fstat(U,(V,N)=>{if(V)return i.close(U,()=>T(V));R(U,N.size,(W,Q)=>{if(W)return T(W);let te=new s.WriteStream(m.file,{fd:U,start:Q});E.pipe(te),te.on("error",T),te.on("close",I),d(E,y)})})};i.open(m.file,M,x)});return p?P.then(p,p):P},f=(m,y)=>{y.forEach(p=>{p.charAt(0)==="@"?o({file:a.resolve(m.cwd,p.slice(1)),sync:!0,noResume:!0,onentry:E=>m.add(E)}):m.add(p)}),m.end()},d=(m,y)=>{for(;y.length;){let p=y.shift();if(p.charAt(0)==="@")return o({file:a.resolve(m.cwd,p.slice(1)),noResume:!0,onentry:E=>m.add(E)}).then(E=>d(m,y));m.add(p)}m.end()}}),fH=me((t,e)=>{"use strict";ee();var r=Ia(),n=Jk();e.exports=(s,o,a)=>{let u=r(s);if(!u.file)throw new TypeError("file is required");if(u.gzip)throw new TypeError("cannot append to compressed archives");if(!o||!Array.isArray(o)||!o.length)throw new TypeError("no files or directories specified");return o=Array.from(o),i(u),n(u,o,a)};var i=s=>{let o=s.filter;s.mtimeCache||(s.mtimeCache=new Map),s.filter=o?(a,u)=>o(a,u)&&!(s.mtimeCache.get(a)>u.mtime):(a,u)=>!(s.mtimeCache.get(a)>u.mtime)}}),dH=me((t,e)=>{ee();var{promisify:r}=_e("util"),n=_e("fs"),i=s=>{if(!s)s={mode:511,fs:n};else if(typeof s=="object")s={mode:511,fs:n,...s};else if(typeof s=="number")s={mode:s,fs:n};else if(typeof s=="string")s={mode:parseInt(s,8),fs:n};else throw new TypeError("invalid options argument");return s.mkdir=s.mkdir||s.fs.mkdir||n.mkdir,s.mkdirAsync=r(s.mkdir),s.stat=s.stat||s.fs.stat||n.stat,s.statAsync=r(s.stat),s.statSync=s.statSync||s.fs.statSync||n.statSync,s.mkdirSync=s.mkdirSync||s.fs.mkdirSync||n.mkdirSync,s};e.exports=i}),pH=me((t,e)=>{ee();var r=process.env.__TESTING_MKDIRP_PLATFORM__||process.platform,{resolve:n,parse:i}=_e("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=n(o),r==="win32"){let a=/[*|"<>?:]/,{root:u}=i(o);if(a.test(o.substr(u.length)))throw Object.assign(new Error("Illegal characters in path."),{path:o,code:"EINVAL"})}return o};e.exports=s}),mH=me((t,e)=>{ee();var{dirname:r}=_e("path"),n=(s,o,a=void 0)=>a===o?Promise.resolve():s.statAsync(o).then(u=>u.isDirectory()?a:void 0,u=>u.code==="ENOENT"?n(s,r(o),o):void 0),i=(s,o,a=void 0)=>{if(a!==o)try{return s.statSync(o).isDirectory()?a:void 0}catch(u){return u.code==="ENOENT"?i(s,r(o),o):void 0}};e.exports={findMade:n,findMadeSync:i}}),Xk=me((t,e)=>{ee();var{dirname:r}=_e("path"),n=(s,o,a)=>{o.recursive=!1;let u=r(s);return u===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 n(u,o).then(l=>n(s,o,l));if(c.code!=="EEXIST"&&c.code!=="EROFS")throw c;return o.statAsync(s).then(l=>{if(l.isDirectory())return a;throw c},()=>{throw c})})},i=(s,o,a)=>{let u=r(s);if(o.recursive=!1,u===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 i(s,o,i(u,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:n,mkdirpManualSync:i}}),yH=me((t,e)=>{ee();var{dirname:r}=_e("path"),{findMade:n,findMadeSync:i}=mH(),{mkdirpManual:s,mkdirpManualSync:o}=Xk(),a=(c,l)=>(l.recursive=!0,r(c)===c?l.mkdirAsync(c,l):n(l,c).then(h=>l.mkdirAsync(c,l).then(()=>h).catch(f=>{if(f.code==="ENOENT")return s(c,l);throw f}))),u=(c,l)=>{if(l.recursive=!0,r(c)===c)return l.mkdirSync(c,l);let h=i(l,c);try{return l.mkdirSync(c,l),h}catch(f){if(f.code==="ENOENT")return o(c,l);throw f}};e.exports={mkdirpNative:a,mkdirpNativeSync:u}}),gH=me((t,e)=>{ee();var r=_e("fs"),n=process.env.__TESTING_MKDIRP_NODE_VERSION__||process.version,i=n.replace(/^v/,"").split("."),s=+i[0]>10||+i[0]==10&&+i[1]>=12,o=s?u=>u.mkdir===r.mkdir:()=>!1,a=s?u=>u.mkdirSync===r.mkdirSync:()=>!1;e.exports={useNative:o,useNativeSync:a}}),_H=me((t,e)=>{ee();var r=dH(),n=pH(),{mkdirpNative:i,mkdirpNativeSync:s}=yH(),{mkdirpManual:o,mkdirpManualSync:a}=Xk(),{useNative:u,useNativeSync:c}=gH(),l=(f,d)=>(f=n(f),d=r(d),u(d)?i(f,d):o(f,d)),h=(f,d)=>(f=n(f),d=r(d),c(d)?s(f,d):a(f,d));l.sync=h,l.native=(f,d)=>i(n(f),r(d)),l.manual=(f,d)=>o(n(f),r(d)),l.nativeSync=(f,d)=>s(n(f),r(d)),l.manualSync=(f,d)=>a(n(f),r(d)),e.exports=l}),bH=me((t,e)=>{"use strict";ee();var r=_e("fs"),n=_e("path"),i=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=(P,I,T)=>{try{return r[s](P,I,T)}catch(M){if(M.code!=="ENOENT")throw M}},u=(P,I,T)=>{try{return r.chownSync(P,I,T)}catch(M){if(M.code!=="ENOENT")throw M}},c=o?(P,I,T,M)=>x=>{!x||x.code!=="EISDIR"?M(x):r.chown(P,I,T,M)}:(P,I,T,M)=>M,l=o?(P,I,T)=>{try{return a(P,I,T)}catch(M){if(M.code!=="EISDIR")throw M;u(P,I,T)}}:(P,I,T)=>a(P,I,T),h=process.version,f=(P,I,T)=>r.readdir(P,I,T),d=(P,I)=>r.readdirSync(P,I);/^v4\./.test(h)&&(f=(P,I,T)=>r.readdir(P,T));var m=(P,I,T,M)=>{r[i](P,I,T,c(P,I,T,x=>{M(x&&x.code!=="ENOENT"?x:null)}))},y=(P,I,T,M,x)=>{if(typeof I=="string")return r.lstat(n.resolve(P,I),(D,U)=>{if(D)return x(D.code!=="ENOENT"?D:null);U.name=I,y(P,U,T,M,x)});if(I.isDirectory())p(n.resolve(P,I.name),T,M,D=>{if(D)return x(D);let U=n.resolve(P,I.name);m(U,T,M,x)});else{let D=n.resolve(P,I.name);m(D,T,M,x)}},p=(P,I,T,M)=>{f(P,{withFileTypes:!0},(x,D)=>{if(x){if(x.code==="ENOENT")return M();if(x.code!=="ENOTDIR"&&x.code!=="ENOTSUP")return M(x)}if(x||!D.length)return m(P,I,T,M);let U=D.length,V=null,N=W=>{if(!V){if(W)return M(V=W);if(--U===0)return m(P,I,T,M)}};D.forEach(W=>y(P,W,I,T,N))})},E=(P,I,T,M)=>{if(typeof I=="string")try{let x=r.lstatSync(n.resolve(P,I));x.name=I,I=x}catch(x){if(x.code==="ENOENT")return;throw x}I.isDirectory()&&R(n.resolve(P,I.name),T,M),l(n.resolve(P,I.name),T,M)},R=(P,I,T)=>{let M;try{M=d(P,{withFileTypes:!0})}catch(x){if(x.code==="ENOENT")return;if(x.code==="ENOTDIR"||x.code==="ENOTSUP")return l(P,I,T);throw x}return M&&M.length&&M.forEach(x=>E(P,x,I,T)),l(P,I,T)};e.exports=p,p.sync=R}),vH=me((t,e)=>{"use strict";ee();var r=_H(),n=_e("fs"),i=_e("path"),s=bH(),o=La(),a=class extends Error{constructor(y,p){super("Cannot extract through symbolic link"),this.path=p,this.symlink=y}get name(){return"SylinkError"}},u=class extends Error{constructor(y,p){super(p+": Cannot cd into '"+y+"'"),this.path=y,this.code=p}get name(){return"CwdError"}},c=(y,p)=>y.get(o(p)),l=(y,p,E)=>y.set(o(p),E),h=(y,p)=>{n.stat(y,(E,R)=>{(E||!R.isDirectory())&&(E=new u(y,E&&E.code||"ENOTDIR")),p(E)})};e.exports=(y,p,E)=>{y=o(y);let R=p.umask,P=p.mode|448,I=(P&R)!==0,T=p.uid,M=p.gid,x=typeof T=="number"&&typeof M=="number"&&(T!==p.processUid||M!==p.processGid),D=p.preserve,U=p.unlink,V=p.cache,N=o(p.cwd),W=(te,j)=>{te?E(te):(l(V,y,!0),j&&x?s(j,T,M,F=>W(F)):I?n.chmod(y,P,E):E())};if(V&&c(V,y)===!0)return W();if(y===N)return h(y,W);if(D)return r(y,{mode:P}).then(te=>W(null,te),W);let Q=o(i.relative(N,y)).split("/");f(N,Q,P,V,U,N,null,W)};var f=(y,p,E,R,P,I,T,M)=>{if(!p.length)return M(null,T);let x=p.shift(),D=o(i.resolve(y+"/"+x));if(c(R,D))return f(D,p,E,R,P,I,T,M);n.mkdir(D,E,d(D,p,E,R,P,I,T,M))},d=(y,p,E,R,P,I,T,M)=>x=>{x?n.lstat(y,(D,U)=>{if(D)D.path=D.path&&o(D.path),M(D);else if(U.isDirectory())f(y,p,E,R,P,I,T,M);else if(P)n.unlink(y,V=>{if(V)return M(V);n.mkdir(y,E,d(y,p,E,R,P,I,T,M))});else{if(U.isSymbolicLink())return M(new a(y,y+"/"+p.join("/")));M(x)}}):(T=T||y,f(y,p,E,R,P,I,T,M))},m=y=>{let p=!1,E="ENOTDIR";try{p=n.statSync(y).isDirectory()}catch(R){E=R.code}finally{if(!p)throw new u(y,E)}};e.exports.sync=(y,p)=>{y=o(y);let E=p.umask,R=p.mode|448,P=(R&E)!==0,I=p.uid,T=p.gid,M=typeof I=="number"&&typeof T=="number"&&(I!==p.processUid||T!==p.processGid),x=p.preserve,D=p.unlink,U=p.cache,V=o(p.cwd),N=te=>{l(U,y,!0),te&&M&&s.sync(te,I,T),P&&n.chmodSync(y,R)};if(U&&c(U,y)===!0)return N();if(y===V)return m(V),N();if(x)return N(r.sync(y,R));let W=o(i.relative(V,y)).split("/"),Q=null;for(let te=W.shift(),j=V;te&&(j+="/"+te);te=W.shift())if(j=o(i.resolve(j)),!c(U,j))try{n.mkdirSync(j,R),Q=Q||j,l(U,j,!0)}catch{let F=n.lstatSync(j);if(F.isDirectory()){l(U,j,!0);continue}else if(D){n.unlinkSync(j),n.mkdirSync(j,R),Q=Q||j,l(U,j,!0);continue}else if(F.isSymbolicLink())return new a(j,j+"/"+W.join("/"))}return N(Q)}}),Qk=me((t,e)=>{ee();var r=Object.create(null),{hasOwnProperty:n}=Object.prototype;e.exports=i=>(n.call(r,i)||(r[i]=i.normalize("NFKD")),r[i])}),EH=me((t,e)=>{ee();var r=_e("assert"),n=Qk(),i=Na(),{join:s}=_e("path"),o=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,a=o==="win32";e.exports=()=>{let u=new Map,c=new Map,l=p=>p.split("/").slice(0,-1).reduce((E,R)=>(E.length&&(R=s(E[E.length-1],R)),E.push(R||"/"),E),[]),h=new Set,f=p=>{let E=c.get(p);if(!E)throw new Error("function does not have any path reservations");return{paths:E.paths.map(R=>u.get(R)),dirs:[...E.dirs].map(R=>u.get(R))}},d=p=>{let{paths:E,dirs:R}=f(p);return E.every(P=>P[0]===p)&&R.every(P=>P[0]instanceof Set&&P[0].has(p))},m=p=>h.has(p)||!d(p)?!1:(h.add(p),p(()=>y(p)),!0),y=p=>{if(!h.has(p))return!1;let{paths:E,dirs:R}=c.get(p),P=new Set;return E.forEach(I=>{let T=u.get(I);r.equal(T[0],p),T.length===1?u.delete(I):(T.shift(),typeof T[0]=="function"?P.add(T[0]):T[0].forEach(M=>P.add(M)))}),R.forEach(I=>{let T=u.get(I);r(T[0]instanceof Set),T[0].size===1&&T.length===1?u.delete(I):T[0].size===1?(T.shift(),P.add(T[0])):T[0].delete(p)}),h.delete(p),P.forEach(I=>m(I)),!0};return{check:d,reserve:(p,E)=>{p=a?["win32 parallelization disabled"]:p.map(P=>n(i(s(P))).toLowerCase());let R=new Set(p.map(P=>l(P)).reduce((P,I)=>P.concat(I)));return c.set(E,{dirs:R,paths:p}),p.forEach(P=>{let I=u.get(P);I?I.push(E):u.set(P,[E])}),R.forEach(P=>{let I=u.get(P);I?I[I.length-1]instanceof Set?I[I.length-1].add(E):I.push(new Set([E])):u.set(P,[new Set([E])])}),m(E)}}}}),wH=me((t,e)=>{ee();var r=process.env.__FAKE_PLATFORM__||process.platform,n=r==="win32",i=global.__FAKE_TESTING_FS__||_e("fs"),{O_CREAT:s,O_TRUNC:o,O_WRONLY:a,UV_FS_O_FILEMAP:u=0}=i.constants,c=n&&!!u,l=512*1024,h=u|o|s|a;e.exports=c?f=>f<l?h:"w":()=>"w"}),eT=me((t,e)=>{"use strict";ee();var r=_e("assert"),n=ag(),i=_e("fs"),s=Ma(),o=_e("path"),a=vH(),u=Wk(),c=EH(),l=Yk(),h=La(),f=Na(),d=Qk(),m=Symbol("onEntry"),y=Symbol("checkFs"),p=Symbol("checkFs2"),E=Symbol("pruneCache"),R=Symbol("isReusable"),P=Symbol("makeFs"),I=Symbol("file"),T=Symbol("directory"),M=Symbol("link"),x=Symbol("symlink"),D=Symbol("hardlink"),U=Symbol("unsupported"),V=Symbol("checkPath"),N=Symbol("mkdir"),W=Symbol("onError"),Q=Symbol("pending"),te=Symbol("pend"),j=Symbol("unpend"),F=Symbol("ended"),L=Symbol("maybeClose"),G=Symbol("skip"),Z=Symbol("doChown"),q=Symbol("uid"),g=Symbol("gid"),_=Symbol("checkedCwd"),v=_e("crypto"),k=wH(),S=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,H=S==="win32",$=(b,z)=>{if(!H)return i.unlink(b,z);let re=b+".DELETE."+v.randomBytes(16).toString("hex");i.rename(b,re,ce=>{if(ce)return z(ce);i.unlink(re,z)})},ne=b=>{if(!H)return i.unlinkSync(b);let z=b+".DELETE."+v.randomBytes(16).toString("hex");i.renameSync(b,z),i.unlinkSync(z)},Y=(b,z,re)=>b===b>>>0?b:z===z>>>0?z:re,fe=b=>d(f(h(b))).toLowerCase(),J=(b,z)=>{z=fe(z);for(let re of b.keys()){let ce=fe(re);(ce===z||ce.indexOf(z+"/")===0)&&b.delete(re)}},w=b=>{for(let z of b.keys())b.delete(z)},B=class extends n{constructor(b){if(b||(b={}),b.ondone=z=>{this[F]=!0,this[L]()},super(b),this[_]=!1,this.reservations=c(),this.transform=typeof b.transform=="function"?b.transform:null,this.writable=!0,this.readable=!1,this[Q]=0,this[F]=!1,this.dirCache=b.dirCache||new Map,typeof b.uid=="number"||typeof b.gid=="number"){if(typeof b.uid!="number"||typeof b.gid!="number")throw new TypeError("cannot set owner without number uid and gid");if(b.preserveOwner)throw new TypeError("cannot preserve owner in archive and also set owner explicitly");this.uid=b.uid,this.gid=b.gid,this.setOwner=!0}else this.uid=null,this.gid=null,this.setOwner=!1;b.preserveOwner===void 0&&typeof b.uid!="number"?this.preserveOwner=process.getuid&&process.getuid()===0:this.preserveOwner=!!b.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=b.forceChown===!0,this.win32=!!b.win32||H,this.newer=!!b.newer,this.keep=!!b.keep,this.noMtime=!!b.noMtime,this.preservePaths=!!b.preservePaths,this.unlink=!!b.unlink,this.cwd=h(o.resolve(b.cwd||process.cwd())),this.strip=+b.strip||0,this.processUmask=b.noChmod?0:process.umask(),this.umask=typeof b.umask=="number"?b.umask:this.processUmask,this.dmode=b.dmode||511&~this.umask,this.fmode=b.fmode||438&~this.umask,this.on("entry",z=>this[m](z))}warn(b,z,re={}){return(b==="TAR_BAD_ARCHIVE"||b==="TAR_ABORT")&&(re.recoverable=!1),super.warn(b,z,re)}[L](){this[F]&&this[Q]===0&&(this.emit("prefinish"),this.emit("finish"),this.emit("end"))}[V](b){if(this.strip){let z=h(b.path).split("/");if(z.length<this.strip)return!1;if(b.path=z.slice(this.strip).join("/"),b.type==="Link"){let re=h(b.linkpath).split("/");if(re.length>=this.strip)b.linkpath=re.slice(this.strip).join("/");else return!1}}if(!this.preservePaths){let z=h(b.path),re=z.split("/");if(re.includes("..")||H&&/^[a-z]:\.\.$/i.test(re[0]))return this.warn("TAR_ENTRY_ERROR","path contains '..'",{entry:b,path:z}),!1;let[ce,ye]=l(z);ce&&(b.path=ye,this.warn("TAR_ENTRY_INFO",`stripping ${ce} from absolute path`,{entry:b,path:z}))}if(o.isAbsolute(b.path)?b.absolute=h(o.resolve(b.path)):b.absolute=h(o.resolve(this.cwd,b.path)),!this.preservePaths&&b.absolute.indexOf(this.cwd+"/")!==0&&b.absolute!==this.cwd)return this.warn("TAR_ENTRY_ERROR","path escaped extraction target",{entry:b,path:h(b.path),resolvedPath:b.absolute,cwd:this.cwd}),!1;if(b.absolute===this.cwd&&b.type!=="Directory"&&b.type!=="GNUDumpDir")return!1;if(this.win32){let{root:z}=o.win32.parse(b.absolute);b.absolute=z+u.encode(b.absolute.slice(z.length));let{root:re}=o.win32.parse(b.path);b.path=re+u.encode(b.path.slice(re.length))}return!0}[m](b){if(!this[V](b))return b.resume();switch(r.equal(typeof b.absolute,"string"),b.type){case"Directory":case"GNUDumpDir":b.mode&&(b.mode=b.mode|448);case"File":case"OldFile":case"ContiguousFile":case"Link":case"SymbolicLink":return this[y](b);case"CharacterDevice":case"BlockDevice":case"FIFO":default:return this[U](b)}}[W](b,z){b.name==="CwdError"?this.emit("error",b):(this.warn("TAR_ENTRY_ERROR",b,{entry:z}),this[j](),z.resume())}[N](b,z,re){a(h(b),{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:z,noChmod:this.noChmod},re)}[Z](b){return this.forceChown||this.preserveOwner&&(typeof b.uid=="number"&&b.uid!==this.processUid||typeof b.gid=="number"&&b.gid!==this.processGid)||typeof this.uid=="number"&&this.uid!==this.processUid||typeof this.gid=="number"&&this.gid!==this.processGid}[q](b){return Y(this.uid,b.uid,this.processUid)}[g](b){return Y(this.gid,b.gid,this.processGid)}[I](b,z){let re=b.mode&4095||this.fmode,ce=new s.WriteStream(b.absolute,{flags:k(b.size),mode:re,autoClose:!1});ce.on("error",Se=>{ce.fd&&i.close(ce.fd,()=>{}),ce.write=()=>!0,this[W](Se,b),z()});let ye=1,Ae=Se=>{if(Se){ce.fd&&i.close(ce.fd,()=>{}),this[W](Se,b),z();return}--ye===0&&i.close(ce.fd,ze=>{ze?this[W](ze,b):this[j](),z()})};ce.on("finish",Se=>{let ze=b.absolute,rr=ce.fd;if(b.mtime&&!this.noMtime){ye++;let nr=b.atime||new Date,vo=b.mtime;i.futimes(rr,nr,vo,Eo=>Eo?i.utimes(ze,nr,vo,yh=>Ae(yh&&Eo)):Ae())}if(this[Z](b)){ye++;let nr=this[q](b),vo=this[g](b);i.fchown(rr,nr,vo,Eo=>Eo?i.chown(ze,nr,vo,yh=>Ae(yh&&Eo)):Ae())}Ae()});let De=this.transform&&this.transform(b)||b;De!==b&&(De.on("error",Se=>{this[W](Se,b),z()}),b.pipe(De)),De.pipe(ce)}[T](b,z){let re=b.mode&4095||this.dmode;this[N](b.absolute,re,ce=>{if(ce){this[W](ce,b),z();return}let ye=1,Ae=De=>{--ye===0&&(z(),this[j](),b.resume())};b.mtime&&!this.noMtime&&(ye++,i.utimes(b.absolute,b.atime||new Date,b.mtime,Ae)),this[Z](b)&&(ye++,i.chown(b.absolute,this[q](b),this[g](b),Ae)),Ae()})}[U](b){b.unsupported=!0,this.warn("TAR_ENTRY_UNSUPPORTED",`unsupported entry type: ${b.type}`,{entry:b}),b.resume()}[x](b,z){this[M](b,b.linkpath,"symlink",z)}[D](b,z){let re=h(o.resolve(this.cwd,b.linkpath));this[M](b,re,"link",z)}[te](){this[Q]++}[j](){this[Q]--,this[L]()}[G](b){this[j](),b.resume()}[R](b,z){return b.type==="File"&&!this.unlink&&z.isFile()&&z.nlink<=1&&!H}[y](b){this[te]();let z=[b.path];b.linkpath&&z.push(b.linkpath),this.reservations.reserve(z,re=>this[p](b,re))}[E](b){b.type==="SymbolicLink"?w(this.dirCache):b.type!=="Directory"&&J(this.dirCache,b.absolute)}[p](b,z){this[E](b);let re=De=>{this[E](b),z(De)},ce=()=>{this[N](this.cwd,this.dmode,De=>{if(De){this[W](De,b),re();return}this[_]=!0,ye()})},ye=()=>{if(b.absolute!==this.cwd){let De=h(o.dirname(b.absolute));if(De!==this.cwd)return this[N](De,this.dmode,Se=>{if(Se){this[W](Se,b),re();return}Ae()})}Ae()},Ae=()=>{i.lstat(b.absolute,(De,Se)=>{if(Se&&(this.keep||this.newer&&Se.mtime>b.mtime)){this[G](b),re();return}if(De||this[R](b,Se))return this[P](null,b,re);if(Se.isDirectory()){if(b.type==="Directory"){let ze=!this.noChmod&&b.mode&&(Se.mode&4095)!==b.mode,rr=nr=>this[P](nr,b,re);return ze?i.chmod(b.absolute,b.mode,rr):rr()}if(b.absolute!==this.cwd)return i.rmdir(b.absolute,ze=>this[P](ze,b,re))}if(b.absolute===this.cwd)return this[P](null,b,re);$(b.absolute,ze=>this[P](ze,b,re))})};this[_]?ye():ce()}[P](b,z,re){if(b){this[W](b,z),re();return}switch(z.type){case"File":case"OldFile":case"ContiguousFile":return this[I](z,re);case"Link":return this[D](z,re);case"SymbolicLink":return this[x](z,re);case"Directory":case"GNUDumpDir":return this[T](z,re)}}[M](b,z,re,ce){i[re](z,b.absolute,ye=>{ye?this[W](ye,b):(this[j](),b.resume()),ce()})}},C=b=>{try{return[null,b()]}catch(z){return[z,null]}},X=class extends B{[P](b,z){return super[P](b,z,()=>{})}[y](b){if(this[E](b),!this[_]){let ye=this[N](this.cwd,this.dmode);if(ye)return this[W](ye,b);this[_]=!0}if(b.absolute!==this.cwd){let ye=h(o.dirname(b.absolute));if(ye!==this.cwd){let Ae=this[N](ye,this.dmode);if(Ae)return this[W](Ae,b)}}let[z,re]=C(()=>i.lstatSync(b.absolute));if(re&&(this.keep||this.newer&&re.mtime>b.mtime))return this[G](b);if(z||this[R](b,re))return this[P](null,b);if(re.isDirectory()){if(b.type==="Directory"){let Ae=!this.noChmod&&b.mode&&(re.mode&4095)!==b.mode,[De]=Ae?C(()=>{i.chmodSync(b.absolute,b.mode)}):[];return this[P](De,b)}let[ye]=C(()=>i.rmdirSync(b.absolute));this[P](ye,b)}let[ce]=b.absolute===this.cwd?[]:C(()=>ne(b.absolute));this[P](ce,b)}[I](b,z){let re=b.mode&4095||this.fmode,ce=De=>{let Se;try{i.closeSync(ye)}catch(ze){Se=ze}(De||Se)&&this[W](De||Se,b),z()},ye;try{ye=i.openSync(b.absolute,k(b.size),re)}catch(De){return ce(De)}let Ae=this.transform&&this.transform(b)||b;Ae!==b&&(Ae.on("error",De=>this[W](De,b)),b.pipe(Ae)),Ae.on("data",De=>{try{i.writeSync(ye,De,0,De.length)}catch(Se){ce(Se)}}),Ae.on("end",De=>{let Se=null;if(b.mtime&&!this.noMtime){let ze=b.atime||new Date,rr=b.mtime;try{i.futimesSync(ye,ze,rr)}catch(nr){try{i.utimesSync(b.absolute,ze,rr)}catch{Se=nr}}}if(this[Z](b)){let ze=this[q](b),rr=this[g](b);try{i.fchownSync(ye,ze,rr)}catch(nr){try{i.chownSync(b.absolute,ze,rr)}catch{Se=Se||nr}}}ce(Se)})}[T](b,z){let re=b.mode&4095||this.dmode,ce=this[N](b.absolute,re);if(ce){this[W](ce,b),z();return}if(b.mtime&&!this.noMtime)try{i.utimesSync(b.absolute,b.atime||new Date,b.mtime)}catch{}if(this[Z](b))try{i.chownSync(b.absolute,this[q](b),this[g](b))}catch{}z(),b.resume()}[N](b,z){try{return a.sync(h(b),{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:z})}catch(re){return re}}[M](b,z,re,ce){try{i[re+"Sync"](z,b.absolute),ce(),b.resume()}catch(ye){return this[W](ye,b)}}};B.Sync=X,e.exports=B}),xH=me((t,e)=>{"use strict";ee();var r=Ia(),n=eT(),i=_e("fs"),s=Ma(),o=_e("path"),a=Na();e.exports=(d,m,y)=>{typeof d=="function"?(y=d,m=null,d={}):Array.isArray(d)&&(m=d,d={}),typeof m=="function"&&(y=m,m=null),m?m=Array.from(m):m=[];let p=r(d);if(p.sync&&typeof y=="function")throw new TypeError("callback not supported for sync tar functions");if(!p.file&&typeof y=="function")throw new TypeError("callback only supported with file option");return m.length&&u(p,m),p.file&&p.sync?c(p):p.file?l(p,y):p.sync?h(p):f(p)};var u=(d,m)=>{let y=new Map(m.map(R=>[a(R),!0])),p=d.filter,E=(R,P)=>{let I=P||o.parse(R).root||".",T=R===I?!1:y.has(R)?y.get(R):E(o.dirname(R),I);return y.set(R,T),T};d.filter=p?(R,P)=>p(R,P)&&E(a(R)):R=>E(a(R))},c=d=>{let m=new n.Sync(d),y=d.file,p=i.statSync(y),E=d.maxReadSize||16*1024*1024;new s.ReadStreamSync(y,{readSize:E,size:p.size}).pipe(m)},l=(d,m)=>{let y=new n(d),p=d.maxReadSize||16*1024*1024,E=d.file,R=new Promise((P,I)=>{y.on("error",I),y.on("close",P),i.stat(E,(T,M)=>{if(T)I(T);else{let x=new s.ReadStream(E,{readSize:p,size:M.size});x.on("error",I),x.pipe(y)}})});return m?R.then(m,m):R},h=d=>new n.Sync(d),f=d=>new n(d)}),SH=me(t=>{"use strict";ee(),t.c=t.create=hH(),t.r=t.replace=Jk(),t.t=t.list=ug(),t.u=t.update=fH(),t.x=t.extract=xH(),t.Pack=og(),t.Unpack=eT(),t.Parse=ag(),t.ReadEntry=ng(),t.WriteEntry=Kk(),t.Header=Ba(),t.Pax=ig(),t.types=Vk()}),AH=me((t,e)=>{ee();function r(n,i){typeof i=="boolean"&&(i={forever:i}),this._originalTimeouts=JSON.parse(JSON.stringify(n)),this._timeouts=n,this._options=i||{},this._maxRetryTime=i&&i.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(n){if(this._timeout&&clearTimeout(this._timeout),!n)return!1;var i=new Date().getTime();if(n&&i-this._operationStart>=this._maxRetryTime)return this._errors.push(n),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(n);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(n,i){this._fn=n,i&&(i.timeout&&(this._operationTimeout=i.timeout),i.cb&&(this._operationTimeoutCb=i.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(n){console.log("Using RetryOperation.try() is deprecated"),this.attempt(n)},r.prototype.start=function(n){console.log("Using RetryOperation.start() is deprecated"),this.attempt(n)},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 n={},i=null,s=0,o=0;o<this._errors.length;o++){var a=this._errors[o],u=a.message,c=(n[u]||0)+1;n[u]=c,c>=s&&(i=a,s=c)}return i}}),DH=me(t=>{ee();var e=AH();t.operation=function(r){var n=t.timeouts(r);return new e(n,{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 n={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var i in r)n[i]=r[i];if(n.minTimeout>n.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var s=[],o=0;o<n.retries;o++)s.push(this.createTimeout(o,n));return r&&r.forever&&!s.length&&s.push(this.createTimeout(o,n)),s.sort(function(a,u){return a-u}),s},t.createTimeout=function(r,n){var i=n.randomize?Math.random()+1:1,s=Math.round(i*Math.max(n.minTimeout,1)*Math.pow(n.factor,r));return s=Math.min(s,n.maxTimeout),s},t.wrap=function(r,n,i){if(n instanceof Array&&(i=n,n=null),!i){i=[];for(var s in r)typeof r[s]=="function"&&i.push(s)}for(var o=0;o<i.length;o++){var a=i[o],u=r[a];r[a]=function(c){var l=t.operation(n),h=Array.prototype.slice.call(arguments,1),f=h.pop();h.push(function(d){l.retry(d)||(d&&(arguments[0]=l.mainError()),f.apply(this,arguments))}),l.attempt(function(){c.apply(r,h)})}.bind(r,u),r[a].options=n}}}),CH=me((t,e)=>{ee(),e.exports=DH()}),RH=me((t,e)=>{ee();var r=CH();function n(i,s){function o(a,u){var c=s||{},l;"randomize"in c||(c.randomize=!0),l=r.operation(c);function h(m){u(m||new Error("Aborted"))}function f(m,y){if(m.bail){h(m);return}l.retry(m)?c.onRetry&&c.onRetry(m,y):u(l.mainError())}function d(m){var y;try{y=i(h,m)}catch(p){f(p,m);return}Promise.resolve(y).then(a).catch(function(p){f(p,m)})}l.attempt(d)}return new Promise(o)}e.exports=n}),kH={};Z7(kH,{bold:()=>IH,dimmed:()=>BH,error:()=>qH,grey:()=>NH,info:()=>PH,item:()=>MH,log:()=>Li,turboBlue:()=>mo,turboGradient:()=>OH,turboLoader:()=>FH,turboRed:()=>sT,underline:()=>LH,warn:()=>jH,yellow:()=>oT});ee();var nT="#0099F7",iT="#F11712",TH="#FFFF00",cg=t=>{let e=UH(t);return r=>`\x1B[38;5;${e}m${r}${(0,Dt.reset)("")}`},OH=(0,rT.default)(nT,iT),mo=cg(nT),sT=cg(iT),oT=cg(TH),FH=t=>(0,tT.default)({text:t,spinner:{frames:[" ",mo("> "),mo(">> "),mo(">>>")]}}),PH=(...t)=>{Li(mo((0,Dt.bold)(">>>")),t.join(" "))},IH=(...t)=>{Li((0,Dt.bold)(t.join(" ")))},LH=(...t)=>{Li((0,Dt.underline)(t.join(" ")))},BH=(...t)=>{Li((0,Dt.dim)(t.join(" ")))},NH=(...t)=>{Li((0,Dt.gray)(t.join(" ")))},MH=(...t)=>{Li(mo((0,Dt.bold)(" \u2022")),t.join(" "))},Li=(...t)=>{console.log(...t)},jH=(...t)=>{console.error(oT((0,Dt.bold)(">>>")),t.join(" "))},qH=(...t)=>{console.error(sT((0,Dt.bold)(">>>")),t.join(" "))};function UH(t){let e=parseInt(t.slice(1),16),r=Math.floor(e/(256*256))%256,n=Math.floor(e/256)%256,i=e%256;return 16+36*Math.round(r/255*5)+6*Math.round(n/255*5)+Math.round(i/255*5)}ee();async function nh(t,e=[],r){let n={cwd:aT.default.tmpdir(),env:{COREPACK_ENABLE_STRICT:"0"},...r};try{let{stdout:i}=await(0,uT.default)(t,e,n);return i.trim()}catch{return}}async function cT(){let[t,e,r,n]=await Promise.all([nh("yarnpkg",["--version"],{cwd:"."}),nh("npm",["--version"]),nh("pnpm",["--version"]),nh("bun",["--version"])]);return{yarn:t,pnpm:r,npm:e,bun:n}}ee();ee();ee();var OZ=oh(eH());ee();ee();function HH(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}ee();ee();function Qy(t){return Qy=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},Qy(t)}ee();function $H(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function GH(t,e){if(e&&(Qy(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return $H(t)}ee();function sh(t){return sh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},sh(t)}ee();ee();function Oa(t,e){return Oa=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Oa(t,e)}function zH(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&&Oa(t,e)}ee();ee();function VH(t){return Function.toString.call(t).indexOf("[native code]")!==-1}ee();ee();function WH(){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 ih(t,e,r){return WH()?ih=Reflect.construct.bind():ih=function(n,i,s){var o=[null];o.push.apply(o,i);var a=Function.bind.apply(n,o),u=new a;return s&&Oa(u,s.prototype),u},ih.apply(null,arguments)}function eg(t){var e=typeof Map=="function"?new Map:void 0;return eg=function(r){if(r===null||!VH(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,n)}function n(){return ih(r,arguments,sh(this).constructor)}return n.prototype=Object.create(r.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),Oa(n,r)},eg(t)}var FZ=oh(oH()),LZ=function(t){zH(e,t);function e(r){var n;return HH(this,e),n=GH(this,sh(e).call(this,"No package.json could be found upwards from the directory ".concat(r))),n.directory=r,n}return e}(eg(Error));ee();ee();ee();ee();ee();ee();var VZ=oh(SH()),WZ=(0,hT.promisify)(lT.Stream.pipeline);ee();ee();var ZZ=oh(RH());ee();ee();ee();var He=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,He)}};ee();ee();ee();ee();var YH=/^(?!_)(?<manager>.+)@(?<version>.+)$/;function Ct({workspaceRoot:t}){let e=un.default.join(t,"package.json");try{return(0,Ut.readJsonSync)(e,"utf8")}catch(r){if(r&&typeof r=="object"&&"code"in r){if(r.code==="ENOENT")throw new He(`no "package.json" found at ${t}`,{type:"package_json-missing"});if(r.code==="EJSONPARSE")throw new He(`failed to parse "package.json" at ${t}`,{type:"package_json-parse_error"})}throw new Error(`unexpected error reading "package.json" at ${t}`)}}function ah({workspaceRoot:t}){let{packageManager:e}=Ct({workspaceRoot:t});if(e)try{let r=YH.exec(e);if(r){let[n,i]=r;return i}}catch{}}function ja({workspaceRoot:t}){let e=Ct({workspaceRoot:t}),r=un.default.basename(t),{name:n=r,description:i}=e;return{name:n,description:i}}function qk({workspaceRoot:t}){let e=un.default.join(t,"pnpm-workspace.yaml");if((0,Ut.existsSync)(e))try{let r=zh.load((0,Ut.readFileSync)(e,"utf8"));if(r instanceof Object&&"packages"in r&&Array.isArray(r.packages))return r.packages}catch{throw new He(`failed to parse ${e}`,{type:"pnpm-workspace_parse_error"})}return[]}function uh({root:t,lockFile:e,workspaceConfig:r}){let n=s=>un.default.join(t,s),i={root:t,lockfile:n(e),packageJson:n("package.json"),nodeModules:n("node_modules")};return r&&(i.workspaceConfig=n(r)),i}function lg({workspaces:t}){var e;return t?Array.isArray(t)?t:"packages"in t?(e=t.packages)!=null?e:[]:[]:[]}function ch({workspaceRoot:t,workspaceGlobs:e}){if(!e)return[];let r=e.filter(n=>n.startsWith("!")).map(n=>n.slice(1));return e.filter(n=>!n.startsWith("!")).flatMap(n=>{let i=[`${n}/package.json`];return(0,gT.sync)(i,{onlyFiles:!0,absolute:!0,cwd:t,ignore:["**/node_modules/**",...r]})}).map(n=>{let i=un.default.dirname(n),{name:s,description:o}=ja({workspaceRoot:i});return{name:s,description:o,paths:{root:i,packageJson:n,nodeModules:un.default.join(i,"node_modules")}}})}function KH({directory:t}){let e=un.default.resolve(process.cwd(),t);return{exists:(0,Ut.existsSync)(e),absolute:e}}function $n({packageManager:t,action:e,project:r}){let n=r.workspaceData.globs.length>0;return`${e==="remove"?"Removing":"Adding"} ${t} ${n?"workspaces":""} ${e==="remove"?"from":"to"} ${r.name}`}function ZH({project:t}){let e=r=>!(r.includes("*")&&(r.includes("**")||r.split("/").slice(0,-1).join("/").includes("*"))||["!","[","]","{","}"].some(n=>r.includes(n)));return t.workspaceData.globs.every(e)}function an({project:t,options:e}){e!=null&&e.dry||(0,Ut.rmSync)(t.paths.lockfile,{force:!0})}async function _T({project:t,options:e}){if(!(e!=null&&e.dry)&&(0,Ut.existsSync)(t.paths.lockfile))try{let{stdout:r}=await(0,yT.default)("bun",["bun.lockb"],{stdin:"ignore",cwd:t.paths.root});await(0,Ut.writeFile)(un.default.join(t.paths.root,"yarn.lock"),r)}catch{}finally{(0,Ut.rmSync)(t.paths.lockfile,{force:!0})}}function JH({dependencyList:t,project:e,to:r}){let n=[];return e.workspaceData.workspaces.forEach(i=>{let{name:s}=i;if(t[s]){let o=t[s],a=o.startsWith("workspace:")?o.slice(10):o;t[s]=r.name==="pnpm"?`workspace:${a}`:a,n.push(s)}}),{dependencyList:t,updated:n}}function Un({project:t,workspace:e,to:r,logger:n,options:i}){if(["yarn","npm","bun"].includes(r.name)&&["yarn","npm","bun"].includes(t.packageManager))return;let s=Ct({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:m}=JH({dependencyList:f,project:t,to:r});s[h]=m,o[h]=d}});let u=h=>{let f=o[h].length;if(f>0)return`${mT.default.green(f.toString())} ${h}`},c=a.map(u).filter(Boolean),l=`./${dT.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 ${l}`:d===c.length-1?h+=`and ${f} in ${l}`:h+=` ${f}, `}),n.workspaceStep(h)}else n.workspaceStep(`no workspace dependencies found in ${l}`);i!=null&&i.dry||pT.default.writeJSONSync(e.paths.packageJson,s,{spaces:2})}var Hn={name:"pnpm",lock:"pnpm-lock.yaml"};async function bT(t){let e=Ti.default.join(t.workspaceRoot,Hn.lock),r=Ti.default.join(t.workspaceRoot,"pnpm-workspace.yaml"),n=ah({workspaceRoot:t.workspaceRoot});return hr.default.existsSync(e)||hr.default.existsSync(r)||n===Hn.name}async function XH(t){if(!await bT(t))throw new He("Not a pnpm project",{type:"package_manager-unexpected"});let{name:e,description:r}=ja(t);return{name:e,description:r,packageManager:Hn.name,paths:uh({root:t.workspaceRoot,lockFile:Hn.lock,workspaceConfig:"pnpm-workspace.yaml"}),workspaceData:{globs:qk(t),workspaces:ch({workspaceGlobs:qk(t),...t})}}}async function QH(t){let{project:e,to:r,logger:n,options:i}=t,s=e.workspaceData.globs.length>0;n.mainStep($n({action:"create",packageManager:Hn.name,project:e}));let o=Ct({workspaceRoot:e.paths.root});n.rootHeader(),o.packageManager=`${r.name}@${r.version}`,n.rootStep(`adding "packageManager" field to ${e.name} root "package.json"`),i!=null&&i.dry||(hr.default.writeJSONSync(e.paths.packageJson,o,{spaces:2}),s&&(n.rootStep('adding "pnpm-workspace.yaml"'),hr.default.writeFileSync(Ti.default.join(e.paths.root,"pnpm-workspace.yaml"),`packages:
|
66
66
|
${e.workspaceData.globs.map(a=>` - "${a}"`).join(`
|
67
67
|
`)}`))),s&&(Un({workspace:{name:"root",paths:e.paths},project:e,to:r,logger:n,options:i}),n.workspaceHeader(),e.workspaceData.workspaces.forEach(a=>{Un({workspace:a,project:e,to:r,logger:n,options:i})}))}async function e$(t){let{project:e,logger:r,options:n}=t,i=e.workspaceData.globs.length>0;r.mainStep($n({action:"remove",packageManager:Hn.name,project:e}));let s=Ct({workspaceRoot:e.paths.root});if(e.paths.workspaceConfig&&i&&(r.subStep('removing "pnpm-workspace.yaml"'),n!=null&&n.dry||hr.default.rmSync(e.paths.workspaceConfig,{force:!0})),r.subStep(`removing "packageManager" field in ${e.name} root "package.json"`),delete s.packageManager,!(n!=null&&n.dry)){hr.default.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=>hr.default.rm(a,{recursive:!0,force:!0})))}catch{throw new He("Failed to remove node_modules",{type:"error_removing_node_modules"})}}}async function t$(t){let{project:e,logger:r,options:n}=t;r.subStep(`removing ${Ti.default.relative(e.paths.root,e.paths.lockfile)}`),n!=null&&n.dry||hr.default.rmSync(e.paths.lockfile,{force:!0})}async function r$(t){let{project:e,options:r,logger:n}=t,i=()=>{n.subStep(`converting ${Ti.default.relative(e.paths.root,e.paths.lockfile)} to ${Hn.lock}`)},s=async()=>{if(!(r!=null&&r.dry)&&hr.default.existsSync(e.paths.lockfile))try{await(0,fT.default)(Hn.name,["import"],{stdio:"ignore",cwd:e.paths.root})}catch{}finally{an({project:e,options:r})}};switch(e.packageManager){case"pnpm":break;case"bun":i(),await _T({project:e,options:r}),await s(),hr.default.rmSync(Ti.default.join(e.paths.root,"yarn.lock"),{force:!0});break;case"npm":i(),await s();break;case"yarn":i(),await s();break}}var n$={detect:bT,read:XH,create:QH,remove:e$,clean:t$,convertLock:r$};ee();var yo={name:"npm",lock:"package-lock.json"};async function vT(t){let e=Fa.default.join(t.workspaceRoot,yo.lock),r=ah({workspaceRoot:t.workspaceRoot});return Oi.default.existsSync(e)||r===yo.name}async function i$(t){if(!await vT(t))throw new He("Not an npm project",{type:"package_manager-unexpected"});let e=Ct(t),{name:r,description:n}=ja(t),i=lg({workspaces:e.workspaces});return{name:r,description:n,packageManager:yo.name,paths:uh({root:t.workspaceRoot,lockFile:yo.lock}),workspaceData:{globs:i,workspaces:ch({workspaceGlobs:i,...t})}}}async function s$(t){let{project:e,options:r,to:n,logger:i}=t,s=e.workspaceData.globs.length>0;i.mainStep($n({packageManager:yo.name,action:"create",project:e}));let o=Ct({workspaceRoot:e.paths.root});i.rootHeader(),i.rootStep(`adding "packageManager" field to ${Fa.default.relative(e.paths.root,e.paths.packageJson)}`),o.packageManager=`${n.name}@${n.version}`,s?(i.rootStep(`adding "workspaces" field to ${Fa.default.relative(e.paths.root,e.paths.packageJson)}`),o.workspaces=e.workspaceData.globs,r!=null&&r.dry||Oi.default.writeJSONSync(e.paths.packageJson,o,{spaces:2}),Un({workspace:{name:"root",paths:e.paths},project:e,to:n,logger:i,options:r}),i.workspaceHeader(),e.workspaceData.workspaces.forEach(a=>{Un({workspace:a,project:e,to:n,logger:i,options:r})})):r!=null&&r.dry||Oi.default.writeJSONSync(e.paths.packageJson,o,{spaces:2})}async function o$(t){let{project:e,logger:r,options:n}=t,i=e.workspaceData.globs.length>0;r.mainStep($n({packageManager:yo.name,action:"remove",project:e}));let s=Ct({workspaceRoot:e.paths.root});if(i&&(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,!(n!=null&&n.dry)){Oi.default.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=>Oi.default.rm(a,{recursive:!0,force:!0})))}catch{throw new He("Failed to remove node_modules",{type:"error_removing_node_modules"})}}}async function a$(t){let{project:e,logger:r,options:n}=t;r.subStep(`removing ${Fa.default.relative(e.paths.root,e.paths.lockfile)}`),n!=null&&n.dry||Oi.default.rmSync(e.paths.lockfile,{force:!0})}async function u$(t){let{project:e,options:r}=t;switch(e.packageManager){case"pnpm":an({project:e,options:r});break;case"bun":an({project:e,options:r});break;case"npm":break;case"yarn":an({project:e,options:r});break}}var c$={detect:vT,read:i$,create:s$,remove:o$,clean:a$,convertLock:u$};ee();var Pi={name:"yarn",lock:"yarn.lock"};async function ET(t){let e=go.default.join(t.workspaceRoot,Pi.lock),r=ah({workspaceRoot:t.workspaceRoot});return Fi.default.existsSync(e)||r===Pi.name}async function l$(t){if(!await ET(t))throw new He("Not a yarn project",{type:"package_manager-unexpected"});let e=Ct(t),{name:r,description:n}=ja(t),i=lg({workspaces:e.workspaces});return{name:r,description:n,packageManager:Pi.name,paths:uh({root:t.workspaceRoot,lockFile:Pi.lock}),workspaceData:{globs:i,workspaces:ch({workspaceGlobs:i,...t})}}}async function h$(t){let{project:e,to:r,logger:n,options:i}=t,s=e.workspaceData.globs.length>0;n.mainStep($n({packageManager:Pi.name,action:"create",project:e}));let o=Ct({workspaceRoot:e.paths.root});n.rootHeader(),n.rootStep(`adding "packageManager" field to ${go.default.relative(e.paths.root,e.paths.packageJson)}`),o.packageManager=`${r.name}@${r.version}`,s?(n.rootStep(`adding "workspaces" field to ${go.default.relative(e.paths.root,e.paths.packageJson)}`),o.workspaces=e.workspaceData.globs,i!=null&&i.dry||Fi.default.writeJSONSync(e.paths.packageJson,o,{spaces:2}),Un({workspace:{name:"root",paths:e.paths},project:e,to:r,logger:n,options:i}),n.workspaceHeader(),e.workspaceData.workspaces.forEach(a=>{Un({workspace:a,project:e,to:r,logger:n,options:i})})):i!=null&&i.dry||Fi.default.writeJSONSync(e.paths.packageJson,o,{spaces:2})}async function f$(t){let{project:e,logger:r,options:n}=t,i=e.workspaceData.globs.length>0;r.mainStep($n({packageManager:Pi.name,action:"remove",project:e}));let s=Ct({workspaceRoot:e.paths.root});if(i&&(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,!(n!=null&&n.dry)){Fi.default.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=>Fi.default.rm(a,{recursive:!0,force:!0})))}catch{throw new He("Failed to remove node_modules",{type:"error_removing_node_modules"})}}}async function d$(t){let{project:e,logger:r,options:n}=t;r.subStep(`removing ${go.default.relative(e.paths.root,e.paths.lockfile)}`),n!=null&&n.dry||Fi.default.rmSync(e.paths.lockfile,{force:!0})}async function p$(t){let{project:e,options:r,logger:n}=t,i=()=>{n.subStep(`converting ${go.default.relative(e.paths.root,e.paths.lockfile)} to ${Pi.lock}`)};switch(e.packageManager){case"pnpm":an({project:e,options:r});break;case"bun":i(),await _T({project:e,options:r});break;case"npm":an({project:e,options:r});break;case"yarn":break}}var m$={detect:ET,read:l$,create:h$,remove:f$,clean:d$,convertLock:p$};ee();var _o={name:"bun",lock:"bun.lockb"};async function wT(t){let e=Pa.default.join(t.workspaceRoot,_o.lock),r=ah({workspaceRoot:t.workspaceRoot});return Ii.default.existsSync(e)||r===_o.name}async function y$(t){if(!await wT(t))throw new He("Not a bun project",{type:"package_manager-unexpected"});let e=Ct(t),{name:r,description:n}=ja(t),i=lg({workspaces:e.workspaces});return{name:r,description:n,packageManager:_o.name,paths:uh({root:t.workspaceRoot,lockFile:_o.lock}),workspaceData:{globs:i,workspaces:ch({workspaceGlobs:i,...t})}}}async function g$(t){let{project:e,to:r,logger:n,options:i}=t,s=e.workspaceData.globs.length>0;if(!ZH({project:e}))throw new He("Unable to convert project to bun - workspace globs unsupported",{type:"bun-workspace_glob_error"});n.mainStep($n({packageManager:_o.name,action:"create",project:e}));let o=Ct({workspaceRoot:e.paths.root});n.rootHeader(),n.rootStep(`adding "packageManager" field to ${Pa.default.relative(e.paths.root,e.paths.packageJson)}`),o.packageManager=`${r.name}@${r.version}`,s?(n.rootStep(`adding "workspaces" field to ${Pa.default.relative(e.paths.root,e.paths.packageJson)}`),o.workspaces=e.workspaceData.globs,i!=null&&i.dry||Ii.default.writeJSONSync(e.paths.packageJson,o,{spaces:2}),Un({workspace:{name:"root",paths:e.paths},project:e,to:r,logger:n,options:i}),n.workspaceHeader(),e.workspaceData.workspaces.forEach(a=>{Un({workspace:a,project:e,to:r,logger:n,options:i})})):i!=null&&i.dry||Ii.default.writeJSONSync(e.paths.packageJson,o,{spaces:2})}async function _$(t){let{project:e,logger:r,options:n}=t,i=e.workspaceData.globs.length>0;r.mainStep($n({packageManager:_o.name,action:"remove",project:e}));let s=Ct({workspaceRoot:e.paths.root});if(i&&(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,!(n!=null&&n.dry)){Ii.default.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=>Ii.default.rm(a,{recursive:!0,force:!0})))}catch{throw new He("Failed to remove node_modules",{type:"error_removing_node_modules"})}}}async function b$(t){let{project:e,logger:r,options:n}=t;r.subStep(`removing ${Pa.default.relative(e.paths.root,e.paths.lockfile)}`),n!=null&&n.dry||Ii.default.rmSync(e.paths.lockfile,{force:!0})}async function v$(t){let{project:e,options:r}=t;switch(e.packageManager){case"pnpm":an({project:e,options:r});break;case"bun":break;case"npm":an({project:e,options:r});break;case"yarn":an({project:e,options:r});break}}var E$={detect:wT,read:y$,create:g$,remove:_$,clean:b$,convertLock:v$},po={pnpm:n$,yarn:m$,npm:c$,bun:E$};ee();async function lh({root:t}){let{exists:e,absolute:r}=KH({directory:t});if(!e)throw new He(`Could not find directory at ${r}. Ensure the directory exists.`,{type:"invalid_directory"});for(let{detect:n,read:i}of Object.values(po))if(await n({workspaceRoot:r}))return i({workspaceRoot:r});throw new He("Could not determine package manager. Add `packageManager` to `package.json` or ensure a lockfile is present.",{type:"package_manager-unable_to_detect"})}ee();var fo=2,hg=class{constructor({interactive:t,dry:e}={}){this.interactive=t!=null?t:!0,this.dry=e!=null?e:!1,this.step=1}logger(...t){this.interactive&&console.log(...t)}indented(t,...e){this.logger(" ".repeat(fo*t),...e)}header(t){this.blankLine(),this.logger(qt.default.bold(t))}installerFrames(){let t=`${" ".repeat(fo)} - ${this.dry?qt.default.yellow("SKIPPED | "):qt.default.green("OK | ")}`;return[`${t} `,`${t}> `,`${t}>> `,`${t}>>>`]}gradient(t){return(0,xT.default)("#0099F7","#F11712")(t.toString())}hero(){this.logger(qt.default.bold(this.gradient(`
|
68
68
|
>>> TURBOREPO
|