@turbo/gen 0.0.1-alpha.1 → 0.0.1-alpha.3
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 +2 -2
- package/package.json +4 -4
package/dist/cli.js
CHANGED
|
@@ -114,7 +114,7 @@ ${s.message}`:S,m=[v,a,l].filter(Boolean).join(`
|
|
|
114
114
|
${r.workspaceData.globs.map(o=>` - "${o}"`).join(`
|
|
115
115
|
`)}`))),l&&(Wn({workspace:{name:"root",paths:r.paths},project:r,to:t,logger:n,options:i}),n.workspaceHeader(),r.workspaceData.workspaces.forEach(o=>Wn({workspace:o,project:r,to:t,logger:n,options:i})))}async function sN(e){let{project:r,logger:t,options:n}=e,i=r.workspaceData.globs.length>0;t.mainStep(Yn({action:"remove",packageManager:"pnpm",project:r}));let l=Nt({workspaceRoot:r.paths.root});if(r.paths.workspaceConfig&&i&&(t.subStep('removing "pnpm-workspace.yaml"'),n!=null&&n.dry||Yt.default.rmSync(r.paths.workspaceConfig,{force:!0})),t.subStep(`removing "packageManager" field in ${r.name} root "package.json"`),delete l.packageManager,!(n!=null&&n.dry)){Yt.default.writeJSONSync(r.paths.packageJson,l,{spaces:2});let a=[r.paths.nodeModules,...r.workspaceData.workspaces.map(o=>o.paths.nodeModules)];try{t.subStep('removing "node_modules"'),await Promise.all(a.map(o=>Yt.default.rm(o,{recursive:!0,force:!0})))}catch{throw new vt("Failed to remove node_modules",{type:"error_removing_node_modules"})}}}async function oN(e){let{project:r,logger:t,options:n}=e;t.subStep(`removing ${qi.default.relative(r.paths.root,r.paths.lockfile)}`),n!=null&&n.dry||Yt.default.rmSync(r.paths.lockfile,{force:!0})}async function aN(e){let{project:r,logger:t,options:n}=e;if(r.packageManager!=="pnpm"&&(t.subStep(`converting ${qi.default.relative(r.paths.root,r.paths.lockfile)} to pnpm-lock.yaml`),!(n!=null&&n.dry)&&Yt.default.existsSync(r.paths.lockfile)))try{await(0,KM.default)("pnpm",["import"],{stdio:"ignore",cwd:r.paths.root})}finally{Yt.default.rmSync(r.paths.lockfile,{force:!0})}}var uN={detect:w5,read:nN,create:iN,remove:sN,clean:oN,convertLock:aN},lN=uN,Jr=et(require("fs-extra")),jo=et(require("path"));async function E5(e){let r=jo.default.join(e.workspaceRoot,"package-lock.json"),t=jh({workspaceRoot:e.workspaceRoot});return Jr.default.existsSync(r)||t==="npm"}async function cN(e){if(!await E5(e))throw new vt("Not an npm project",{type:"package_manager-unexpected"});let r=Nt(e),{name:t,description:n}=Zo(e);return{name:t,description:n,packageManager:"npm",paths:$h({root:e.workspaceRoot,lockFile:"package-lock.json"}),workspaceData:{globs:r.workspaces||[],workspaces:Hh({workspaceGlobs:r.workspaces,...e})}}}async function hN(e){let{project:r,options:t,to:n,logger:i}=e,l=r.workspaceData.globs.length>0;i.mainStep(Yn({packageManager:"npm",action:"create",project:r}));let a=Nt({workspaceRoot:r.paths.root});i.rootHeader(),i.rootStep(`adding "packageManager" field to ${jo.default.relative(r.paths.root,r.paths.packageJson)}`),a.packageManager=`${n.name}@${n.version}`,l?(i.rootStep(`adding "workspaces" field to ${jo.default.relative(r.paths.root,r.paths.packageJson)}`),a.workspaces=r.workspaceData.globs,t!=null&&t.dry||Jr.default.writeJSONSync(r.paths.packageJson,a,{spaces:2}),Wn({workspace:{name:"root",paths:r.paths},project:r,to:n,logger:i,options:t}),i.workspaceHeader(),r.workspaceData.workspaces.forEach(o=>Wn({workspace:o,project:r,to:n,logger:i,options:t}))):t!=null&&t.dry||Jr.default.writeJSONSync(r.paths.packageJson,a,{spaces:2})}async function fN(e){let{project:r,logger:t,options:n}=e,i=r.workspaceData.globs.length>0;t.mainStep(Yn({packageManager:"npm",action:"remove",project:r}));let l=Nt({workspaceRoot:r.paths.root});if(i&&(t.subStep(`removing "workspaces" field in ${r.name} root "package.json"`),delete l.workspaces),t.subStep(`removing "packageManager" field in ${r.name} root "package.json"`),delete l.packageManager,!(n!=null&&n.dry)){Jr.default.writeJSONSync(r.paths.packageJson,l,{spaces:2});let a=[r.paths.nodeModules,...r.workspaceData.workspaces.map(o=>o.paths.nodeModules)];try{t.subStep('removing "node_modules"'),await Promise.all(a.map(o=>Jr.default.rm(o,{recursive:!0,force:!0})))}catch{throw new vt("Failed to remove node_modules",{type:"error_removing_node_modules"})}}}async function pN(e){let{project:r,logger:t,options:n}=e;t.subStep(`removing ${jo.default.relative(r.paths.root,r.paths.lockfile)}`),n!=null&&n.dry||Jr.default.rmSync(r.paths.lockfile,{force:!0})}async function dN(e){let{project:r,options:t}=e;r.packageManager!=="npm"&&(t!=null&&t.dry||Jr.default.rmSync(r.paths.lockfile,{force:!0}))}var mN={detect:E5,read:cN,create:hN,remove:fN,clean:pN,convertLock:dN},yN=mN,en=et(require("fs-extra")),$o=et(require("path"));async function S5(e){let r=$o.default.join(e.workspaceRoot,"yarn.lock"),t=jh({workspaceRoot:e.workspaceRoot});return en.default.existsSync(r)||t==="yarn"}async function gN(e){if(!await S5(e))throw new vt("Not a yarn project",{type:"package_manager-unexpected"});let r=Nt(e),{name:t,description:n}=Zo(e);return{name:t,description:n,packageManager:"yarn",paths:$h({root:e.workspaceRoot,lockFile:"yarn.lock"}),workspaceData:{globs:r.workspaces||[],workspaces:Hh({workspaceGlobs:r.workspaces,...e})}}}async function bN(e){let{project:r,to:t,logger:n,options:i}=e,l=r.workspaceData.globs.length>0;n.mainStep(Yn({packageManager:"yarn",action:"create",project:r}));let a=Nt({workspaceRoot:r.paths.root});n.rootHeader(),n.rootStep(`adding "packageManager" field to ${$o.default.relative(r.paths.root,r.paths.packageJson)}`),a.packageManager=`${t.name}@${t.version}`,l?(n.rootStep(`adding "workspaces" field to ${$o.default.relative(r.paths.root,r.paths.packageJson)}`),a.workspaces=r.workspaceData.globs,i!=null&&i.dry||en.default.writeJSONSync(r.paths.packageJson,a,{spaces:2}),Wn({workspace:{name:"root",paths:r.paths},project:r,to:t,logger:n,options:i}),n.workspaceHeader(),r.workspaceData.workspaces.forEach(o=>Wn({workspace:o,project:r,to:t,logger:n,options:i}))):i!=null&&i.dry||en.default.writeJSONSync(r.paths.packageJson,a,{spaces:2})}async function vN(e){let{project:r,logger:t,options:n}=e,i=r.workspaceData.globs.length>0;t.mainStep(Yn({packageManager:"yarn",action:"remove",project:r}));let l=Nt({workspaceRoot:r.paths.root});if(i&&(t.subStep(`removing "workspaces" field in ${r.name} root "package.json"`),delete l.workspaces),t.subStep(`removing "packageManager" field in ${r.name} root "package.json"`),delete l.packageManager,!(n!=null&&n.dry)){en.default.writeJSONSync(r.paths.packageJson,l,{spaces:2});let a=[r.paths.nodeModules,...r.workspaceData.workspaces.map(o=>o.paths.nodeModules)];try{t.subStep('removing "node_modules"'),await Promise.all(a.map(o=>en.default.rm(o,{recursive:!0,force:!0})))}catch{throw new vt("Failed to remove node_modules",{type:"error_removing_node_modules"})}}}async function _N(e){let{project:r,logger:t,options:n}=e;t.subStep(`removing ${$o.default.relative(r.paths.root,r.paths.lockfile)}`),n!=null&&n.dry||en.default.rmSync(r.paths.lockfile,{force:!0})}async function wN(e){let{project:r,options:t}=e;r.packageManager!=="yarn"&&(t!=null&&t.dry||en.default.rmSync(r.paths.lockfile,{force:!0}))}var EN={detect:S5,read:gN,create:bN,remove:vN,clean:_N,convertLock:wN},SN=EN,xN={pnpm:lN,yarn:SN,npm:yN},qn=xN;async function x5({root:e}){let{exists:r,absolute:t}=tN({directory:e});if(!r)throw new vt(`Could not find directory at ${t}. Ensure the directory exists.`,{type:"invalid_directory"});for(let{detect:n,read:i}of Object.values(qn))if(await n({workspaceRoot:t}))return i({workspaceRoot:t});throw new vt("Could not determine package manager. Add `packageManager` to `package.json` or ensure a lockfile is present.",{type:"package_manager-unable_to_detect"})}var AN=et(require("chalk")),CN=et(Pu()),kN=et(wg()),DN=require("semver"),Bt=et(require("chalk")),RN=et(Bg()),Nn=2,A5=class{constructor({interactive:e,dry:r}={}){this.interactive=e!=null?e:!0,this.dry=r!=null?r:!1,this.step=1}logger(...e){this.interactive&&console.log(...e)}indented(e,...r){this.logger(" ".repeat(Nn*e),...r)}header(e){this.blankLine(),this.logger(Bt.default.bold(e))}installerFrames(){let e=`${" ".repeat(Nn)} - ${this.dry?Bt.default.yellow("SKIPPED | "):Bt.default.green("OK | ")}`;return[`${e} `,`${e}> `,`${e}>> `,`${e}>>>`]}gradient(e){return(0,RN.default)("#0099F7","#F11712")(e.toString())}hero(){this.logger(Bt.default.bold(this.gradient(`
|
|
116
116
|
>>> TURBOREPO
|
|
117
|
-
`)))}info(...e){this.logger(...e)}mainStep(e){this.blankLine(),this.logger(`${this.step}. ${Bt.default.underline(e)}`),this.step+=1}subStep(...e){this.logger(" ".repeat(Nn),"-",this.dry?Bt.default.yellow("SKIPPED |"):Bt.default.green("OK |"),...e)}subStepFailure(...e){this.logger(" ".repeat(Nn),"-",Bt.default.red("ERROR |"),...e)}rootHeader(){this.blankLine(),this.indented(2,"Root:")}rootStep(...e){this.logger(" ".repeat(Nn*3),"-",this.dry?Bt.default.yellow("SKIPPED |"):Bt.default.green("OK |"),...e)}workspaceHeader(){this.blankLine(),this.indented(2,"Workspaces:")}workspaceStep(...e){this.logger(" ".repeat(Nn*3),"-",this.dry?Bt.default.yellow("SKIPPED |"):Bt.default.green("OK |"),...e)}blankLine(){this.logger()}error(...e){console.error(...e)}},Qg={npm:[{name:"npm",template:"npm",command:"npm",installArgs:["install"],version:"latest",executable:"npx",semver:"*",default:!0}],pnpm:[{name:"pnpm6",template:"pnpm",command:"pnpm",installArgs:["install"],version:"latest-6",executable:"pnpx",semver:"6.x"},{name:"pnpm",template:"pnpm",command:"pnpm",installArgs:["install"],version:"latest",executable:"pnpm dlx",semver:">=7",default:!0}],yarn:[{name:"yarn",template:"yarn",command:"yarn",installArgs:["install"],version:"1.x",executable:"npx",semver:"<2",default:!0},{name:"berry",template:"berry",command:"yarn",installArgs:["install","--no-immutable"],version:"stable",executable:"yarn dlx",semver:">=2"}]};function C5(e){let{version:r,name:t}=e;return r?Qg[t].find(n=>(0,DN.satisfies)(r,n.semver)):Qg[t].find(n=>n.default)}async function k5(e){let{to:r,logger:t,options:n}=e,i=t!=null?t:new A5(n),l=C5(r);if(!l)throw new vt("Unsupported package manager version.",{type:"package_manager-unsupported_version"});if(i.subStep(`running "${l.command} ${l.installArgs}"`),!(n!=null&&n.dry)){let a;i!=null&&i.interactive&&(a=(0,kN.default)({text:"installing dependencies...",spinner:{frames:i.installerFrames()}}).start());try{await(0,CN.default)(l.command,l.installArgs,{cwd:e.project.paths.root}),a&&a.stop(),i.subStep("dependencies installed")}catch(o){throw i.subStepFailure("failed to install dependencies"),o}}}async function ON({project:e,to:r,logger:t,options:n}){if(t.header(`Converting project from ${e.packageManager} to ${r.name}.`),e.packageManager==r.name)throw new vt("You are already using this package manager",{type:"package_manager-already_in_use"});await qn[e.packageManager].remove({project:e,to:r,logger:t,options:n}),await qn[r.name].create({project:e,to:r,logger:t,options:n}),t.mainStep("Installing dependencies"),n!=null&&n.skipInstall?t.subStep(AN.default.yellow("Skipping install")):(await qn[r.name].convertLock({project:e,logger:t,options:n}),await k5({project:e,to:r,logger:t,options:n})),t.mainStep(`Cleaning up ${e.packageManager} workspaces`),await qn[e.packageManager].clean({project:e,logger:t})}async function TN({root:e,to:r,options:t}){let n=new A5({...t,interactive:!1}),[i,l]=await Promise.all([x5({root:e}),j9()]);await ON({project:i,to:{name:r,version:l[r].version},logger:n,options:t})}});var Jh=Ue(require("chalk")),ot=require("commander");var tf=Ue(require("chalk")),rf=Ue(require("update-check"));var Xn={name:"@turbo/gen",version:"0.0.1-alpha.1",description:"Extend a Turborepo",homepage:"https://turbo.build/repo",license:"MPL-2.0",repository:{type:"git",url:"https://github.com/vercel/turbo",directory:"packages/turbo-gen"},bugs:{url:"https://github.com/vercel/turbo/issues"},bin:"dist/cli.js",scripts:{build:"tsup",test:"jest",lint:"eslint src/**/*.ts","check-types":"tsc --noEmit"},dependencies:{chalk:"2.4.2",commander:"^10.0.0","fs-extra":"^10.1.0",inquirer:"^8.2.4",minimatch:"^9.0.0","node-plop":"^0.26.3",semver:"^7.3.8","update-check":"^1.5.4","validate-npm-package-name":"^5.0.0"},devDependencies:{"@turbo/test-utils":"workspace:*","@turbo/tsconfig":"workspace:*","@turbo/utils":"workspace:*","@turbo/workspaces":"workspace:*","@types/fs-extra":"^9.0.13","@types/inquirer":"^8.2.5","@types/jest":"^27.4.0","@types/node":"^16.11.12","@types/semver":"^7.3.9","@types/validate-npm-package-name":"^4.0.0",eslint:"^7.23.0",jest:"^27.4.3","ts-jest":"^27.1.1",tsup:"^6.7.0",typescript:"^4.5.5"},files:["dist"],publishConfig:{access:"public"}};var ib=(0,rf.default)(Xn).catch(()=>null);async function Ji(){try{let e=await ib;e!=null&&e.latest&&(console.log(),console.log(tf.default.yellow.bold(`A new version of \`${Xn.name}\` is available!`)),console.log()),process.exit()}catch{}}var sb=Object.create,sa=Object.defineProperty,ob=Object.getOwnPropertyDescriptor,ab=Object.getOwnPropertyNames,ub=Object.getPrototypeOf,lb=Object.prototype.hasOwnProperty,he=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(r,t)=>(typeof require!="undefined"?require:r)[t]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')}),cb=(e,r)=>()=>(e&&(r=e(e=0)),r),te=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports),nf=(e,r)=>{for(var t in r)sa(e,t,{get:r[t],enumerable:!0})},hb=(e,r,t,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of ab(r))!lb.call(e,i)&&i!==t&&sa(e,i,{get:()=>r[i],enumerable:!(n=ob(r,i))||n.enumerable});return e},Ge=(e,r,t)=>(t=e!=null?sb(ub(e)):{},hb(r||!e||!e.__esModule?sa(t,"default",{value:e,enumerable:!0}):t,e)),Z=cb(()=>{});var Tf=require("stream"),Ff=require("util"),Pf=require("path"),Bf=require("os"),ri=require("fs"),hr=te((e,r)=>{"use strict";Z(),Object.defineProperty(e,"__esModule",{value:!0});var t=["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"];function n(m){return t.includes(m)}var i=["Function","Generator","AsyncGenerator","GeneratorFunction","AsyncGeneratorFunction","AsyncFunction","Observable","Array","Buffer","Blob","Object","RegExp","Date","Error","Map","Set","WeakMap","WeakSet","ArrayBuffer","SharedArrayBuffer","DataView","Promise","URL","FormData","URLSearchParams","HTMLElement",...t];function l(m){return i.includes(m)}var a=["null","undefined","string","number","bigint","boolean","symbol"];function o(m){return a.includes(m)}function s(m){return w=>typeof w===m}var{toString:f}=Object.prototype,c=m=>{let w=f.call(m).slice(8,-1);if(/HTML\w+Element/.test(w)&&u.domElement(m))return"HTMLElement";if(l(w))return w},h=m=>w=>c(w)===m;function u(m){if(m===null)return"null";switch(typeof m){case"undefined":return"undefined";case"string":return"string";case"number":return"number";case"boolean":return"boolean";case"function":return"Function";case"bigint":return"bigint";case"symbol":return"symbol";default:}if(u.observable(m))return"Observable";if(u.array(m))return"Array";if(u.buffer(m))return"Buffer";let w=c(m);if(w)return w;if(m instanceof String||m instanceof Boolean||m instanceof Number)throw new TypeError("Please don't use object wrappers for primitive types");return"Object"}u.undefined=s("undefined"),u.string=s("string");var d=s("number");u.number=m=>d(m)&&!u.nan(m),u.bigint=s("bigint"),u.function_=s("function"),u.null_=m=>m===null,u.class_=m=>u.function_(m)&&m.toString().startsWith("class "),u.boolean=m=>m===!0||m===!1,u.symbol=s("symbol"),u.numericString=m=>u.string(m)&&!u.emptyStringOrWhitespace(m)&&!Number.isNaN(Number(m)),u.array=(m,w)=>Array.isArray(m)?u.function_(w)?m.every(w):!0:!1,u.buffer=m=>{var w,x,A,R;return(R=(A=(x=(w=m)===null||w===void 0?void 0:w.constructor)===null||x===void 0?void 0:x.isBuffer)===null||A===void 0?void 0:A.call(x,m))!==null&&R!==void 0?R:!1},u.blob=m=>h("Blob")(m),u.nullOrUndefined=m=>u.null_(m)||u.undefined(m),u.object=m=>!u.null_(m)&&(typeof m=="object"||u.function_(m)),u.iterable=m=>{var w;return u.function_((w=m)===null||w===void 0?void 0:w[Symbol.iterator])},u.asyncIterable=m=>{var w;return u.function_((w=m)===null||w===void 0?void 0:w[Symbol.asyncIterator])},u.generator=m=>{var w,x;return u.iterable(m)&&u.function_((w=m)===null||w===void 0?void 0:w.next)&&u.function_((x=m)===null||x===void 0?void 0:x.throw)},u.asyncGenerator=m=>u.asyncIterable(m)&&u.function_(m.next)&&u.function_(m.throw),u.nativePromise=m=>h("Promise")(m);var p=m=>{var w,x;return u.function_((w=m)===null||w===void 0?void 0:w.then)&&u.function_((x=m)===null||x===void 0?void 0:x.catch)};u.promise=m=>u.nativePromise(m)||p(m),u.generatorFunction=h("GeneratorFunction"),u.asyncGeneratorFunction=m=>c(m)==="AsyncGeneratorFunction",u.asyncFunction=m=>c(m)==="AsyncFunction",u.boundFunction=m=>u.function_(m)&&!m.hasOwnProperty("prototype"),u.regExp=h("RegExp"),u.date=h("Date"),u.error=h("Error"),u.map=m=>h("Map")(m),u.set=m=>h("Set")(m),u.weakMap=m=>h("WeakMap")(m),u.weakSet=m=>h("WeakSet")(m),u.int8Array=h("Int8Array"),u.uint8Array=h("Uint8Array"),u.uint8ClampedArray=h("Uint8ClampedArray"),u.int16Array=h("Int16Array"),u.uint16Array=h("Uint16Array"),u.int32Array=h("Int32Array"),u.uint32Array=h("Uint32Array"),u.float32Array=h("Float32Array"),u.float64Array=h("Float64Array"),u.bigInt64Array=h("BigInt64Array"),u.bigUint64Array=h("BigUint64Array"),u.arrayBuffer=h("ArrayBuffer"),u.sharedArrayBuffer=h("SharedArrayBuffer"),u.dataView=h("DataView"),u.enumCase=(m,w)=>Object.values(w).includes(m),u.directInstanceOf=(m,w)=>Object.getPrototypeOf(m)===w.prototype,u.urlInstance=m=>h("URL")(m),u.urlString=m=>{if(!u.string(m))return!1;try{return new URL(m),!0}catch{return!1}},u.truthy=m=>!!m,u.falsy=m=>!m,u.nan=m=>Number.isNaN(m),u.primitive=m=>u.null_(m)||o(typeof m),u.integer=m=>Number.isInteger(m),u.safeInteger=m=>Number.isSafeInteger(m),u.plainObject=m=>{if(f.call(m)!=="[object Object]")return!1;let w=Object.getPrototypeOf(m);return w===null||w===Object.getPrototypeOf({})},u.typedArray=m=>n(c(m));var y=m=>u.safeInteger(m)&&m>=0;u.arrayLike=m=>!u.nullOrUndefined(m)&&!u.function_(m)&&y(m.length),u.inRange=(m,w)=>{if(u.number(w))return m>=Math.min(0,w)&&m<=Math.max(w,0);if(u.array(w)&&w.length===2)return m>=Math.min(...w)&&m<=Math.max(...w);throw new TypeError(`Invalid range: ${JSON.stringify(w)}`)};var b=1,_=["innerHTML","ownerDocument","style","attributes","nodeValue"];u.domElement=m=>u.object(m)&&m.nodeType===b&&u.string(m.nodeName)&&!u.plainObject(m)&&_.every(w=>w in m),u.observable=m=>{var w,x,A,R;return m?m===((x=(w=m)[Symbol.observable])===null||x===void 0?void 0:x.call(w))||m===((R=(A=m)["@@observable"])===null||R===void 0?void 0:R.call(A)):!1},u.nodeStream=m=>u.object(m)&&u.function_(m.pipe)&&!u.observable(m),u.infinite=m=>m===1/0||m===-1/0;var g=m=>w=>u.integer(w)&&Math.abs(w%2)===m;u.evenInteger=g(0),u.oddInteger=g(1),u.emptyArray=m=>u.array(m)&&m.length===0,u.nonEmptyArray=m=>u.array(m)&&m.length>0,u.emptyString=m=>u.string(m)&&m.length===0;var S=m=>u.string(m)&&!/\S/.test(m);u.emptyStringOrWhitespace=m=>u.emptyString(m)||S(m),u.nonEmptyString=m=>u.string(m)&&m.length>0,u.nonEmptyStringAndNotWhitespace=m=>u.string(m)&&!u.emptyStringOrWhitespace(m),u.emptyObject=m=>u.object(m)&&!u.map(m)&&!u.set(m)&&Object.keys(m).length===0,u.nonEmptyObject=m=>u.object(m)&&!u.map(m)&&!u.set(m)&&Object.keys(m).length>0,u.emptySet=m=>u.set(m)&&m.size===0,u.nonEmptySet=m=>u.set(m)&&m.size>0,u.emptyMap=m=>u.map(m)&&m.size===0,u.nonEmptyMap=m=>u.map(m)&&m.size>0,u.propertyKey=m=>u.any([u.string,u.number,u.symbol],m),u.formData=m=>h("FormData")(m),u.urlSearchParams=m=>h("URLSearchParams")(m);var E=(m,w,x)=>{if(!u.function_(w))throw new TypeError(`Invalid predicate: ${JSON.stringify(w)}`);if(x.length===0)throw new TypeError("Invalid number of values");return m.call(x,w)};u.any=(m,...w)=>(u.array(m)?m:[m]).some(x=>E(Array.prototype.some,x,w)),u.all=(m,...w)=>E(Array.prototype.every,m,w);var v=(m,w,x,A={})=>{if(!m){let{multipleValues:R}=A,B=R?`received values of types ${[...new Set(x.map(P=>`\`${u(P)}\``))].join(", ")}`:`received value of type \`${u(x)}\``;throw new TypeError(`Expected value which is \`${w}\`, ${B}.`)}};e.assert={undefined:m=>v(u.undefined(m),"undefined",m),string:m=>v(u.string(m),"string",m),number:m=>v(u.number(m),"number",m),bigint:m=>v(u.bigint(m),"bigint",m),function_:m=>v(u.function_(m),"Function",m),null_:m=>v(u.null_(m),"null",m),class_:m=>v(u.class_(m),"Class",m),boolean:m=>v(u.boolean(m),"boolean",m),symbol:m=>v(u.symbol(m),"symbol",m),numericString:m=>v(u.numericString(m),"string with a number",m),array:(m,w)=>{v(u.array(m),"Array",m),w&&m.forEach(w)},buffer:m=>v(u.buffer(m),"Buffer",m),blob:m=>v(u.blob(m),"Blob",m),nullOrUndefined:m=>v(u.nullOrUndefined(m),"null or undefined",m),object:m=>v(u.object(m),"Object",m),iterable:m=>v(u.iterable(m),"Iterable",m),asyncIterable:m=>v(u.asyncIterable(m),"AsyncIterable",m),generator:m=>v(u.generator(m),"Generator",m),asyncGenerator:m=>v(u.asyncGenerator(m),"AsyncGenerator",m),nativePromise:m=>v(u.nativePromise(m),"native Promise",m),promise:m=>v(u.promise(m),"Promise",m),generatorFunction:m=>v(u.generatorFunction(m),"GeneratorFunction",m),asyncGeneratorFunction:m=>v(u.asyncGeneratorFunction(m),"AsyncGeneratorFunction",m),asyncFunction:m=>v(u.asyncFunction(m),"AsyncFunction",m),boundFunction:m=>v(u.boundFunction(m),"Function",m),regExp:m=>v(u.regExp(m),"RegExp",m),date:m=>v(u.date(m),"Date",m),error:m=>v(u.error(m),"Error",m),map:m=>v(u.map(m),"Map",m),set:m=>v(u.set(m),"Set",m),weakMap:m=>v(u.weakMap(m),"WeakMap",m),weakSet:m=>v(u.weakSet(m),"WeakSet",m),int8Array:m=>v(u.int8Array(m),"Int8Array",m),uint8Array:m=>v(u.uint8Array(m),"Uint8Array",m),uint8ClampedArray:m=>v(u.uint8ClampedArray(m),"Uint8ClampedArray",m),int16Array:m=>v(u.int16Array(m),"Int16Array",m),uint16Array:m=>v(u.uint16Array(m),"Uint16Array",m),int32Array:m=>v(u.int32Array(m),"Int32Array",m),uint32Array:m=>v(u.uint32Array(m),"Uint32Array",m),float32Array:m=>v(u.float32Array(m),"Float32Array",m),float64Array:m=>v(u.float64Array(m),"Float64Array",m),bigInt64Array:m=>v(u.bigInt64Array(m),"BigInt64Array",m),bigUint64Array:m=>v(u.bigUint64Array(m),"BigUint64Array",m),arrayBuffer:m=>v(u.arrayBuffer(m),"ArrayBuffer",m),sharedArrayBuffer:m=>v(u.sharedArrayBuffer(m),"SharedArrayBuffer",m),dataView:m=>v(u.dataView(m),"DataView",m),enumCase:(m,w)=>v(u.enumCase(m,w),"EnumCase",m),urlInstance:m=>v(u.urlInstance(m),"URL",m),urlString:m=>v(u.urlString(m),"string with a URL",m),truthy:m=>v(u.truthy(m),"truthy",m),falsy:m=>v(u.falsy(m),"falsy",m),nan:m=>v(u.nan(m),"NaN",m),primitive:m=>v(u.primitive(m),"primitive",m),integer:m=>v(u.integer(m),"integer",m),safeInteger:m=>v(u.safeInteger(m),"integer",m),plainObject:m=>v(u.plainObject(m),"plain object",m),typedArray:m=>v(u.typedArray(m),"TypedArray",m),arrayLike:m=>v(u.arrayLike(m),"array-like",m),domElement:m=>v(u.domElement(m),"HTMLElement",m),observable:m=>v(u.observable(m),"Observable",m),nodeStream:m=>v(u.nodeStream(m),"Node.js Stream",m),infinite:m=>v(u.infinite(m),"infinite number",m),emptyArray:m=>v(u.emptyArray(m),"empty array",m),nonEmptyArray:m=>v(u.nonEmptyArray(m),"non-empty array",m),emptyString:m=>v(u.emptyString(m),"empty string",m),emptyStringOrWhitespace:m=>v(u.emptyStringOrWhitespace(m),"empty string or whitespace",m),nonEmptyString:m=>v(u.nonEmptyString(m),"non-empty string",m),nonEmptyStringAndNotWhitespace:m=>v(u.nonEmptyStringAndNotWhitespace(m),"non-empty string and not whitespace",m),emptyObject:m=>v(u.emptyObject(m),"empty object",m),nonEmptyObject:m=>v(u.nonEmptyObject(m),"non-empty object",m),emptySet:m=>v(u.emptySet(m),"empty set",m),nonEmptySet:m=>v(u.nonEmptySet(m),"non-empty set",m),emptyMap:m=>v(u.emptyMap(m),"empty map",m),nonEmptyMap:m=>v(u.nonEmptyMap(m),"non-empty map",m),propertyKey:m=>v(u.propertyKey(m),"PropertyKey",m),formData:m=>v(u.formData(m),"FormData",m),urlSearchParams:m=>v(u.urlSearchParams(m),"URLSearchParams",m),evenInteger:m=>v(u.evenInteger(m),"even integer",m),oddInteger:m=>v(u.oddInteger(m),"odd integer",m),directInstanceOf:(m,w)=>v(u.directInstanceOf(m,w),"T",m),inRange:(m,w)=>v(u.inRange(m,w),"in range",m),any:(m,...w)=>v(u.any(m,...w),"predicate returns truthy for any value",w,{multipleValues:!0}),all:(m,...w)=>v(u.all(m,...w),"predicate returns truthy for all values",w,{multipleValues:!0})},Object.defineProperties(u,{class:{value:u.class_},function:{value:u.function_},null:{value:u.null_}}),Object.defineProperties(e.assert,{class:{value:e.assert.class_},function:{value:e.assert.function_},null:{value:e.assert.null_}}),e.default=u,r.exports=u,r.exports.default=u,r.exports.assert=e.assert}),fb=te((e,r)=>{"use strict";Z();var t=class extends Error{constructor(i){super(i||"Promise was canceled"),this.name="CancelError"}get isCanceled(){return!0}},n=class{static fn(i){return(...l)=>new n((a,o,s)=>{l.push(s),i(...l).then(a,o)})}constructor(i){this._cancelHandlers=[],this._isPending=!0,this._isCanceled=!1,this._rejectOnCancel=!0,this._promise=new Promise((l,a)=>{this._reject=a;let o=c=>{(!this._isCanceled||!f.shouldReject)&&(this._isPending=!1,l(c))},s=c=>{this._isPending=!1,a(c)},f=c=>{if(!this._isPending)throw new Error("The `onCancel` handler was attached after the promise settled.");this._cancelHandlers.push(c)};return Object.defineProperties(f,{shouldReject:{get:()=>this._rejectOnCancel,set:c=>{this._rejectOnCancel=c}}}),i(o,s,f)})}then(i,l){return this._promise.then(i,l)}catch(i){return this._promise.catch(i)}finally(i){return this._promise.finally(i)}cancel(i){if(!(!this._isPending||this._isCanceled)){if(this._isCanceled=!0,this._cancelHandlers.length>0)try{for(let l of this._cancelHandlers)l()}catch(l){this._reject(l);return}this._rejectOnCancel&&this._reject(new t(i))}}get isCanceled(){return this._isCanceled}};Object.setPrototypeOf(n.prototype,Promise.prototype),r.exports=n,r.exports.CancelError=t}),pb=te((e,r)=>{"use strict";Z(),Object.defineProperty(e,"__esModule",{value:!0});function t(i){return i.encrypted}var n=(i,l)=>{let a;typeof l=="function"?a={connect:l}:a=l;let o=typeof a.connect=="function",s=typeof a.secureConnect=="function",f=typeof a.close=="function",c=()=>{o&&a.connect(),t(i)&&s&&(i.authorized?a.secureConnect():i.authorizationError||i.once("secureConnect",a.secureConnect)),f&&i.once("close",a.close)};i.writable&&!i.connecting?c():i.connecting?i.once("connect",c):i.destroyed&&f&&a.close(i._hadError)};e.default=n,r.exports=n,r.exports.default=n}),db=te((e,r)=>{"use strict";Z(),Object.defineProperty(e,"__esModule",{value:!0});var t=pb(),n=he("util"),i=Number(process.versions.node.split(".")[0]),l=a=>{if(a.timings)return a.timings;let o={start:Date.now(),socket:void 0,lookup:void 0,connect:void 0,secureConnect:void 0,upload:void 0,response:void 0,end:void 0,error:void 0,abort:void 0,phases:{wait:void 0,dns:void 0,tcp:void 0,tls:void 0,request:void 0,firstByte:void 0,download:void 0,total:void 0}};a.timings=o;let s=u=>{let d=u.emit.bind(u);u.emit=(p,...y)=>(p==="error"&&(o.error=Date.now(),o.phases.total=o.error-o.start,u.emit=d),d(p,...y))};s(a);let f=()=>{o.abort=Date.now(),(!o.response||i>=13)&&(o.phases.total=Date.now()-o.start)};a.prependOnceListener("abort",f);let c=u=>{if(o.socket=Date.now(),o.phases.wait=o.socket-o.start,n.types.isProxy(u))return;let d=()=>{o.lookup=Date.now(),o.phases.dns=o.lookup-o.socket};u.prependOnceListener("lookup",d),t.default(u,{connect:()=>{o.connect=Date.now(),o.lookup===void 0&&(u.removeListener("lookup",d),o.lookup=o.connect,o.phases.dns=o.lookup-o.socket),o.phases.tcp=o.connect-o.lookup},secureConnect:()=>{o.secureConnect=Date.now(),o.phases.tls=o.secureConnect-o.connect}})};a.socket?c(a.socket):a.prependOnceListener("socket",c);let h=()=>{var u;o.upload=Date.now(),o.phases.request=o.upload-((u=o.secureConnect)!==null&&u!==void 0?u:o.connect)};return(()=>typeof a.writableFinished=="boolean"?a.writableFinished:a.finished&&a.outputSize===0&&(!a.socket||a.socket.writableLength===0))()?h():a.prependOnceListener("finish",h),a.prependOnceListener("response",u=>{o.response=Date.now(),o.phases.firstByte=o.response-o.upload,u.timings=o,s(u),u.prependOnceListener("end",()=>{o.end=Date.now(),o.phases.download=o.end-o.response,o.phases.total=o.end-o.start}),u.prependOnceListener("aborted",f)}),o};e.default=l,r.exports=l,r.exports.default=l}),mb=te((e,r)=>{"use strict";Z();var{V4MAPPED:t,ADDRCONFIG:n,ALL:i,promises:{Resolver:l},lookup:a}=he("dns"),{promisify:o}=he("util"),s=he("os"),f=Symbol("cacheableLookupCreateConnection"),c=Symbol("cacheableLookupInstance"),h=Symbol("expires"),u=typeof i=="number",d=E=>{if(!(E&&typeof E.createConnection=="function"))throw new Error("Expected an Agent instance as the first argument")},p=E=>{for(let v of E)v.family!==6&&(v.address=`::ffff:${v.address}`,v.family=6)},y=()=>{let E=!1,v=!1;for(let m of Object.values(s.networkInterfaces()))for(let w of m)if(!w.internal&&(w.family==="IPv6"?v=!0:E=!0,E&&v))return{has4:E,has6:v};return{has4:E,has6:v}},b=E=>Symbol.iterator in E,_={ttl:!0},g={all:!0},S=class{constructor({cache:E=new Map,maxTtl:v=1/0,fallbackDuration:m=3600,errorTtl:w=.15,resolver:x=new l,lookup:A=a}={}){if(this.maxTtl=v,this.errorTtl=w,this._cache=E,this._resolver=x,this._dnsLookup=o(A),this._resolver instanceof l?(this._resolve4=this._resolver.resolve4.bind(this._resolver),this._resolve6=this._resolver.resolve6.bind(this._resolver)):(this._resolve4=o(this._resolver.resolve4.bind(this._resolver)),this._resolve6=o(this._resolver.resolve6.bind(this._resolver))),this._iface=y(),this._pending={},this._nextRemovalTime=!1,this._hostnamesToFallback=new Set,m<1)this._fallback=!1;else{this._fallback=!0;let R=setInterval(()=>{this._hostnamesToFallback.clear()},m*1e3);R.unref&&R.unref()}this.lookup=this.lookup.bind(this),this.lookupAsync=this.lookupAsync.bind(this)}set servers(E){this.clear(),this._resolver.setServers(E)}get servers(){return this._resolver.getServers()}lookup(E,v,m){if(typeof v=="function"?(m=v,v={}):typeof v=="number"&&(v={family:v}),!m)throw new Error("Callback must be a function.");this.lookupAsync(E,v).then(w=>{v.all?m(null,w):m(null,w.address,w.family,w.expires,w.ttl)},m)}async lookupAsync(E,v={}){typeof v=="number"&&(v={family:v});let m=await this.query(E);if(v.family===6){let w=m.filter(x=>x.family===6);v.hints&t&&(u&&v.hints&i||w.length===0)?p(m):m=w}else v.family===4&&(m=m.filter(w=>w.family===4));if(v.hints&n){let{_iface:w}=this;m=m.filter(x=>x.family===6?w.has6:w.has4)}if(m.length===0){let w=new Error(`cacheableLookup ENOTFOUND ${E}`);throw w.code="ENOTFOUND",w.hostname=E,w}return v.all?m:m[0]}async query(E){let v=await this._cache.get(E);if(!v){let m=this._pending[E];if(m)v=await m;else{let w=this.queryAndCache(E);this._pending[E]=w;try{v=await w}finally{delete this._pending[E]}}}return v=v.map(m=>({...m})),v}async _resolve(E){let v=async P=>{try{return await P}catch(O){if(O.code==="ENODATA"||O.code==="ENOTFOUND")return[];throw O}},[m,w]=await Promise.all([this._resolve4(E,_),this._resolve6(E,_)].map(P=>v(P))),x=0,A=0,R=0,B=Date.now();for(let P of m)P.family=4,P.expires=B+P.ttl*1e3,x=Math.max(x,P.ttl);for(let P of w)P.family=6,P.expires=B+P.ttl*1e3,A=Math.max(A,P.ttl);return m.length>0?w.length>0?R=Math.min(x,A):R=x:R=A,{entries:[...m,...w],cacheTtl:R}}async _lookup(E){try{return{entries:await this._dnsLookup(E,{all:!0}),cacheTtl:0}}catch{return{entries:[],cacheTtl:0}}}async _set(E,v,m){if(this.maxTtl>0&&m>0){m=Math.min(m,this.maxTtl)*1e3,v[h]=Date.now()+m;try{await this._cache.set(E,v,m)}catch(w){this.lookupAsync=async()=>{let x=new Error("Cache Error. Please recreate the CacheableLookup instance.");throw x.cause=w,x}}b(this._cache)&&this._tick(m)}}async queryAndCache(E){if(this._hostnamesToFallback.has(E))return this._dnsLookup(E,g);let v=await this._resolve(E);v.entries.length===0&&this._fallback&&(v=await this._lookup(E),v.entries.length!==0&&this._hostnamesToFallback.add(E));let m=v.entries.length===0?this.errorTtl:v.cacheTtl;return await this._set(E,v.entries,m),v.entries}_tick(E){let v=this._nextRemovalTime;(!v||E<v)&&(clearTimeout(this._removalTimeout),this._nextRemovalTime=E,this._removalTimeout=setTimeout(()=>{this._nextRemovalTime=!1;let m=1/0,w=Date.now();for(let[x,A]of this._cache){let R=A[h];w>=R?this._cache.delete(x):R<m&&(m=R)}m!==1/0&&this._tick(m-w)},E),this._removalTimeout.unref&&this._removalTimeout.unref())}install(E){if(d(E),f in E)throw new Error("CacheableLookup has been already installed");E[f]=E.createConnection,E[c]=this,E.createConnection=(v,m)=>("lookup"in v||(v.lookup=this.lookup),E[f](v,m))}uninstall(E){if(d(E),E[f]){if(E[c]!==this)throw new Error("The agent is not owned by this CacheableLookup instance");E.createConnection=E[f],delete E[f],delete E[c]}}updateInterfaceInfo(){let{_iface:E}=this;this._iface=y(),(E.has4&&!this._iface.has4||E.has6&&!this._iface.has6)&&this._cache.clear()}clear(E){if(E){this._cache.delete(E);return}this._cache.clear()}};r.exports=S,r.exports.default=S}),yb=te((e,r)=>{"use strict";Z();var t="text/plain",n="us-ascii",i=(o,s)=>s.some(f=>f instanceof RegExp?f.test(o):f===o),l=(o,{stripHash:s})=>{let f=/^data:(?<type>[^,]*?),(?<data>[^#]*?)(?:#(?<hash>.*))?$/.exec(o);if(!f)throw new Error(`Invalid URL: ${o}`);let{type:c,data:h,hash:u}=f.groups,d=c.split(";");u=s?"":u;let p=!1;d[d.length-1]==="base64"&&(d.pop(),p=!0);let y=(d.shift()||"").toLowerCase(),b=[...d.map(_=>{let[g,S=""]=_.split("=").map(E=>E.trim());return g==="charset"&&(S=S.toLowerCase(),S===n)?"":`${g}${S?`=${S}`:""}`}).filter(Boolean)];return p&&b.push("base64"),(b.length!==0||y&&y!==t)&&b.unshift(y),`data:${b.join(";")},${p?h.trim():h}${u?`#${u}`:""}`},a=(o,s)=>{if(s={defaultProtocol:"http:",normalizeProtocol:!0,forceHttp:!1,forceHttps:!1,stripAuthentication:!0,stripHash:!1,stripTextFragment:!0,stripWWW:!0,removeQueryParameters:[/^utm_\w+/i],removeTrailingSlash:!0,removeSingleSlash:!0,removeDirectoryIndex:!1,sortQueryParameters:!0,...s},o=o.trim(),/^data:/i.test(o))return l(o,s);if(/^view-source:/i.test(o))throw new Error("`view-source:` is not supported as it is a non-standard protocol");let f=o.startsWith("//");!f&&/^\.*\//.test(o)||(o=o.replace(/^(?!(?:\w+:)?\/\/)|^\/\//,s.defaultProtocol));let c=new URL(o);if(s.forceHttp&&s.forceHttps)throw new Error("The `forceHttp` and `forceHttps` options cannot be used together");if(s.forceHttp&&c.protocol==="https:"&&(c.protocol="http:"),s.forceHttps&&c.protocol==="http:"&&(c.protocol="https:"),s.stripAuthentication&&(c.username="",c.password=""),s.stripHash?c.hash="":s.stripTextFragment&&(c.hash=c.hash.replace(/#?:~:text.*?$/i,"")),c.pathname&&(c.pathname=c.pathname.replace(/(?<!\b(?:[a-z][a-z\d+\-.]{1,50}:))\/{2,}/g,"/")),c.pathname)try{c.pathname=decodeURI(c.pathname)}catch{}if(s.removeDirectoryIndex===!0&&(s.removeDirectoryIndex=[/^index\.[a-z]+$/]),Array.isArray(s.removeDirectoryIndex)&&s.removeDirectoryIndex.length>0){let u=c.pathname.split("/"),d=u[u.length-1];i(d,s.removeDirectoryIndex)&&(u=u.slice(0,u.length-1),c.pathname=u.slice(1).join("/")+"/")}if(c.hostname&&(c.hostname=c.hostname.replace(/\.$/,""),s.stripWWW&&/^www\.(?!www\.)(?:[a-z\-\d]{1,63})\.(?:[a-z.\-\d]{2,63})$/.test(c.hostname)&&(c.hostname=c.hostname.replace(/^www\./,""))),Array.isArray(s.removeQueryParameters))for(let u of[...c.searchParams.keys()])i(u,s.removeQueryParameters)&&c.searchParams.delete(u);s.removeQueryParameters===!0&&(c.search=""),s.sortQueryParameters&&c.searchParams.sort(),s.removeTrailingSlash&&(c.pathname=c.pathname.replace(/\/$/,""));let h=o;return o=c.toString(),!s.removeSingleSlash&&c.pathname==="/"&&!h.endsWith("/")&&c.hash===""&&(o=o.replace(/\/$/,"")),(s.removeTrailingSlash||c.pathname==="/")&&c.hash===""&&s.removeSingleSlash&&(o=o.replace(/\/$/,"")),f&&!s.normalizeProtocol&&(o=o.replace(/^http:\/\//,"//")),s.stripProtocol&&(o=o.replace(/^(?:https?:)?\/\//,"")),o};r.exports=a}),gb=te((e,r)=>{Z(),r.exports=t;function t(n,i){if(n&&i)return t(n)(i);if(typeof n!="function")throw new TypeError("need wrapper function");return Object.keys(n).forEach(function(a){l[a]=n[a]}),l;function l(){for(var a=new Array(arguments.length),o=0;o<a.length;o++)a[o]=arguments[o];var s=n.apply(this,a),f=a[a.length-1];return typeof s=="function"&&s!==f&&Object.keys(f).forEach(function(c){s[c]=f[c]}),s}}}),of=te((e,r)=>{Z();var t=gb();r.exports=t(n),r.exports.strict=t(i),n.proto=n(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return n(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return i(this)},configurable:!0})});function n(l){var a=function(){return a.called?a.value:(a.called=!0,a.value=l.apply(this,arguments))};return a.called=!1,a}function i(l){var a=function(){if(a.called)throw new Error(a.onceError);return a.called=!0,a.value=l.apply(this,arguments)},o=l.name||"Function wrapped with `once`";return a.onceError=o+" shouldn't be called more than once",a.called=!1,a}}),bb=te((e,r)=>{Z();var t=of(),n=function(){},i=function(o){return o.setHeader&&typeof o.abort=="function"},l=function(o){return o.stdio&&Array.isArray(o.stdio)&&o.stdio.length===3},a=function(o,s,f){if(typeof s=="function")return a(o,null,s);s||(s={}),f=t(f||n);var c=o._writableState,h=o._readableState,u=s.readable||s.readable!==!1&&o.readable,d=s.writable||s.writable!==!1&&o.writable,p=!1,y=function(){o.writable||b()},b=function(){d=!1,u||f.call(o)},_=function(){u=!1,d||f.call(o)},g=function(w){f.call(o,w?new Error("exited with error code: "+w):null)},S=function(w){f.call(o,w)},E=function(){process.nextTick(v)},v=function(){if(!p){if(u&&!(h&&h.ended&&!h.destroyed))return f.call(o,new Error("premature close"));if(d&&!(c&&c.ended&&!c.destroyed))return f.call(o,new Error("premature close"))}},m=function(){o.req.on("finish",b)};return i(o)?(o.on("complete",b),o.on("abort",E),o.req?m():o.on("request",m)):d&&!c&&(o.on("end",y),o.on("close",y)),l(o)&&o.on("exit",g),o.on("end",_),o.on("finish",b),s.error!==!1&&o.on("error",S),o.on("close",E),function(){p=!0,o.removeListener("complete",b),o.removeListener("abort",E),o.removeListener("request",m),o.req&&o.req.removeListener("finish",b),o.removeListener("end",y),o.removeListener("close",y),o.removeListener("finish",b),o.removeListener("exit",g),o.removeListener("end",_),o.removeListener("error",S),o.removeListener("close",E)}};r.exports=a}),vb=te((e,r)=>{Z();var t=of(),n=bb(),i=he("fs"),l=function(){},a=/^v?\.0/.test(process.version),o=function(p){return typeof p=="function"},s=function(p){return!a||!i?!1:(p instanceof(i.ReadStream||l)||p instanceof(i.WriteStream||l))&&o(p.close)},f=function(p){return p.setHeader&&o(p.abort)},c=function(p,y,b,_){_=t(_);var g=!1;p.on("close",function(){g=!0}),n(p,{readable:y,writable:b},function(E){if(E)return _(E);g=!0,_()});var S=!1;return function(E){if(!g&&!S){if(S=!0,s(p))return p.close(l);if(f(p))return p.abort();if(o(p.destroy))return p.destroy();_(E||new Error("stream was destroyed"))}}},h=function(p){p()},u=function(p,y){return p.pipe(y)},d=function(){var p=Array.prototype.slice.call(arguments),y=o(p[p.length-1]||l)&&p.pop()||l;if(Array.isArray(p[0])&&(p=p[0]),p.length<2)throw new Error("pump requires two streams per minimum");var b,_=p.map(function(g,S){var E=S<p.length-1,v=S>0;return c(g,E,v,function(m){b||(b=m),m&&_.forEach(h),!E&&(_.forEach(h),y(b))})});return p.reduce(u)};r.exports=d}),_b=te((e,r)=>{"use strict";Z();var{PassThrough:t}=he("stream");r.exports=n=>{n={...n};let{array:i}=n,{encoding:l}=n,a=l==="buffer",o=!1;i?o=!(l||a):l=l||"utf8",a&&(l=null);let s=new t({objectMode:o});l&&s.setEncoding(l);let f=0,c=[];return s.on("data",h=>{c.push(h),o?f=c.length:f+=h.length}),s.getBufferedValue=()=>i?c:a?Buffer.concat(c,f):c.join(""),s.getBufferedLength=()=>f,s}}),wb=te((e,r)=>{"use strict";Z();var{constants:t}=he("buffer"),n=vb(),i=_b(),l=class extends Error{constructor(){super("maxBuffer exceeded"),this.name="MaxBufferError"}};async function a(o,s){if(!o)return Promise.reject(new Error("Expected a stream"));s={maxBuffer:1/0,...s};let{maxBuffer:f}=s,c;return await new Promise((h,u)=>{let d=p=>{p&&c.getBufferedLength()<=t.MAX_LENGTH&&(p.bufferedData=c.getBufferedValue()),u(p)};c=n(o,i(s),p=>{if(p){d(p);return}h()}),c.on("data",()=>{c.getBufferedLength()>f&&d(new l)})}),c.getBufferedValue()}r.exports=a,r.exports.default=a,r.exports.buffer=(o,s)=>a(o,{...s,encoding:"buffer"}),r.exports.array=(o,s)=>a(o,{...s,array:!0}),r.exports.MaxBufferError=l}),Eb=te((e,r)=>{"use strict";Z();var t=new Set([200,203,204,206,300,301,308,404,405,410,414,501]),n=new Set([200,203,204,300,301,302,303,307,308,404,405,410,414,501]),i=new Set([500,502,503,504]),l={date:!0,connection:!0,"keep-alive":!0,"proxy-authenticate":!0,"proxy-authorization":!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0},a={"content-length":!0,"content-encoding":!0,"transfer-encoding":!0,"content-range":!0};function o(h){let u=parseInt(h,10);return isFinite(u)?u:0}function s(h){return h?i.has(h.status):!0}function f(h){let u={};if(!h)return u;let d=h.trim().split(/,/);for(let p of d){let[y,b]=p.split(/=/,2);u[y.trim()]=b===void 0?!0:b.trim().replace(/^"|"$/g,"")}return u}function c(h){let u=[];for(let d in h){let p=h[d];u.push(p===!0?d:d+"="+p)}if(u.length)return u.join(", ")}r.exports=class{constructor(h,u,{shared:d,cacheHeuristic:p,immutableMinTimeToLive:y,ignoreCargoCult:b,_fromObject:_}={}){if(_){this._fromObject(_);return}if(!u||!u.headers)throw Error("Response headers missing");this._assertRequestHasHeaders(h),this._responseTime=this.now(),this._isShared=d!==!1,this._cacheHeuristic=p!==void 0?p:.1,this._immutableMinTtl=y!==void 0?y:24*3600*1e3,this._status="status"in u?u.status:200,this._resHeaders=u.headers,this._rescc=f(u.headers["cache-control"]),this._method="method"in h?h.method:"GET",this._url=h.url,this._host=h.headers.host,this._noAuthorization=!h.headers.authorization,this._reqHeaders=u.headers.vary?h.headers:null,this._reqcc=f(h.headers["cache-control"]),b&&"pre-check"in this._rescc&&"post-check"in this._rescc&&(delete this._rescc["pre-check"],delete this._rescc["post-check"],delete this._rescc["no-cache"],delete this._rescc["no-store"],delete this._rescc["must-revalidate"],this._resHeaders=Object.assign({},this._resHeaders,{"cache-control":c(this._rescc)}),delete this._resHeaders.expires,delete this._resHeaders.pragma),u.headers["cache-control"]==null&&/no-cache/.test(u.headers.pragma)&&(this._rescc["no-cache"]=!0)}now(){return Date.now()}storable(){return!!(!this._reqcc["no-store"]&&(this._method==="GET"||this._method==="HEAD"||this._method==="POST"&&this._hasExplicitExpiration())&&n.has(this._status)&&!this._rescc["no-store"]&&(!this._isShared||!this._rescc.private)&&(!this._isShared||this._noAuthorization||this._allowsStoringAuthenticated())&&(this._resHeaders.expires||this._rescc["max-age"]||this._isShared&&this._rescc["s-maxage"]||this._rescc.public||t.has(this._status)))}_hasExplicitExpiration(){return this._isShared&&this._rescc["s-maxage"]||this._rescc["max-age"]||this._resHeaders.expires}_assertRequestHasHeaders(h){if(!h||!h.headers)throw Error("Request headers missing")}satisfiesWithoutRevalidation(h){this._assertRequestHasHeaders(h);let u=f(h.headers["cache-control"]);return u["no-cache"]||/no-cache/.test(h.headers.pragma)||u["max-age"]&&this.age()>u["max-age"]||u["min-fresh"]&&this.timeToLive()<1e3*u["min-fresh"]||this.stale()&&!(u["max-stale"]&&!this._rescc["must-revalidate"]&&(u["max-stale"]===!0||u["max-stale"]>this.age()-this.maxAge()))?!1:this._requestMatches(h,!1)}_requestMatches(h,u){return(!this._url||this._url===h.url)&&this._host===h.headers.host&&(!h.method||this._method===h.method||u&&h.method==="HEAD")&&this._varyMatches(h)}_allowsStoringAuthenticated(){return this._rescc["must-revalidate"]||this._rescc.public||this._rescc["s-maxage"]}_varyMatches(h){if(!this._resHeaders.vary)return!0;if(this._resHeaders.vary==="*")return!1;let u=this._resHeaders.vary.trim().toLowerCase().split(/\s*,\s*/);for(let d of u)if(h.headers[d]!==this._reqHeaders[d])return!1;return!0}_copyWithoutHopByHopHeaders(h){let u={};for(let d in h)l[d]||(u[d]=h[d]);if(h.connection){let d=h.connection.trim().split(/\s*,\s*/);for(let p of d)delete u[p]}if(u.warning){let d=u.warning.split(/,/).filter(p=>!/^\s*1[0-9][0-9]/.test(p));d.length?u.warning=d.join(",").trim():delete u.warning}return u}responseHeaders(){let h=this._copyWithoutHopByHopHeaders(this._resHeaders),u=this.age();return u>3600*24&&!this._hasExplicitExpiration()&&this.maxAge()>3600*24&&(h.warning=(h.warning?`${h.warning}, `:"")+'113 - "rfc7234 5.5.4"'),h.age=`${Math.round(u)}`,h.date=new Date(this.now()).toUTCString(),h}date(){let h=Date.parse(this._resHeaders.date);return isFinite(h)?h:this._responseTime}age(){let h=this._ageValue(),u=(this.now()-this._responseTime)/1e3;return h+u}_ageValue(){return o(this._resHeaders.age)}maxAge(){if(!this.storable()||this._rescc["no-cache"]||this._isShared&&this._resHeaders["set-cookie"]&&!this._rescc.public&&!this._rescc.immutable||this._resHeaders.vary==="*")return 0;if(this._isShared){if(this._rescc["proxy-revalidate"])return 0;if(this._rescc["s-maxage"])return o(this._rescc["s-maxage"])}if(this._rescc["max-age"])return o(this._rescc["max-age"]);let h=this._rescc.immutable?this._immutableMinTtl:0,u=this.date();if(this._resHeaders.expires){let d=Date.parse(this._resHeaders.expires);return Number.isNaN(d)||d<u?0:Math.max(h,(d-u)/1e3)}if(this._resHeaders["last-modified"]){let d=Date.parse(this._resHeaders["last-modified"]);if(isFinite(d)&&u>d)return Math.max(h,(u-d)/1e3*this._cacheHeuristic)}return h}timeToLive(){let h=this.maxAge()-this.age(),u=h+o(this._rescc["stale-if-error"]),d=h+o(this._rescc["stale-while-revalidate"]);return Math.max(0,h,u,d)*1e3}stale(){return this.maxAge()<=this.age()}_useStaleIfError(){return this.maxAge()+o(this._rescc["stale-if-error"])>this.age()}useStaleWhileRevalidate(){return this.maxAge()+o(this._rescc["stale-while-revalidate"])>this.age()}static fromObject(h){return new this(void 0,void 0,{_fromObject:h})}_fromObject(h){if(this._responseTime)throw Error("Reinitialized");if(!h||h.v!==1)throw Error("Invalid serialization");this._responseTime=h.t,this._isShared=h.sh,this._cacheHeuristic=h.ch,this._immutableMinTtl=h.imm!==void 0?h.imm:24*3600*1e3,this._status=h.st,this._resHeaders=h.resh,this._rescc=h.rescc,this._method=h.m,this._url=h.u,this._host=h.h,this._noAuthorization=h.a,this._reqHeaders=h.reqh,this._reqcc=h.reqcc}toObject(){return{v:1,t:this._responseTime,sh:this._isShared,ch:this._cacheHeuristic,imm:this._immutableMinTtl,st:this._status,resh:this._resHeaders,rescc:this._rescc,m:this._method,u:this._url,h:this._host,a:this._noAuthorization,reqh:this._reqHeaders,reqcc:this._reqcc}}revalidationHeaders(h){this._assertRequestHasHeaders(h);let u=this._copyWithoutHopByHopHeaders(h.headers);if(delete u["if-range"],!this._requestMatches(h,!0)||!this.storable())return delete u["if-none-match"],delete u["if-modified-since"],u;if(this._resHeaders.etag&&(u["if-none-match"]=u["if-none-match"]?`${u["if-none-match"]}, ${this._resHeaders.etag}`:this._resHeaders.etag),u["accept-ranges"]||u["if-match"]||u["if-unmodified-since"]||this._method&&this._method!="GET"){if(delete u["if-modified-since"],u["if-none-match"]){let d=u["if-none-match"].split(/,/).filter(p=>!/^\s*W\//.test(p));d.length?u["if-none-match"]=d.join(",").trim():delete u["if-none-match"]}}else this._resHeaders["last-modified"]&&!u["if-modified-since"]&&(u["if-modified-since"]=this._resHeaders["last-modified"]);return u}revalidatedPolicy(h,u){if(this._assertRequestHasHeaders(h),this._useStaleIfError()&&s(u))return{modified:!1,matches:!1,policy:this};if(!u||!u.headers)throw Error("Response headers missing");let d=!1;if(u.status!==void 0&&u.status!=304?d=!1:u.headers.etag&&!/^\s*W\//.test(u.headers.etag)?d=this._resHeaders.etag&&this._resHeaders.etag.replace(/^\s*W\//,"")===u.headers.etag:this._resHeaders.etag&&u.headers.etag?d=this._resHeaders.etag.replace(/^\s*W\//,"")===u.headers.etag.replace(/^\s*W\//,""):this._resHeaders["last-modified"]?d=this._resHeaders["last-modified"]===u.headers["last-modified"]:!this._resHeaders.etag&&!this._resHeaders["last-modified"]&&!u.headers.etag&&!u.headers["last-modified"]&&(d=!0),!d)return{policy:new this.constructor(h,u),modified:u.status!=304,matches:!1};let p={};for(let b in this._resHeaders)p[b]=b in u.headers&&!a[b]?u.headers[b]:this._resHeaders[b];let y=Object.assign({},u,{status:this._status,method:this._method,headers:p});return{policy:new this.constructor(h,y,{shared:this._isShared,cacheHeuristic:this._cacheHeuristic,immutableMinTimeToLive:this._immutableMinTtl}),modified:!1,matches:!0}}}}),oa=te((e,r)=>{"use strict";Z(),r.exports=t=>{let n={};for(let[i,l]of Object.entries(t))n[i.toLowerCase()]=l;return n}}),Sb=te((e,r)=>{"use strict";Z();var t=he("stream").Readable,n=oa(),i=class extends t{constructor(l,a,o,s){if(typeof l!="number")throw new TypeError("Argument `statusCode` should be a number");if(typeof a!="object")throw new TypeError("Argument `headers` should be an object");if(!(o instanceof Buffer))throw new TypeError("Argument `body` should be a buffer");if(typeof s!="string")throw new TypeError("Argument `url` should be a string");super(),this.statusCode=l,this.headers=n(a),this.body=o,this.url=s}_read(){this.push(this.body),this.push(null)}};r.exports=i}),xb=te((e,r)=>{"use strict";Z();var t=["destroy","setTimeout","socket","headers","trailers","rawHeaders","statusCode","httpVersion","httpVersionMinor","httpVersionMajor","rawTrailers","statusMessage"];r.exports=(n,i)=>{let l=new Set(Object.keys(n).concat(t));for(let a of l)a in i||(i[a]=typeof n[a]=="function"?n[a].bind(n):n[a])}}),Ab=te((e,r)=>{"use strict";Z();var t=he("stream").PassThrough,n=xb(),i=l=>{if(!(l&&l.pipe))throw new TypeError("Parameter `response` must be a response stream.");let a=new t;return n(l,a),l.pipe(a)};r.exports=i}),Cb=te(e=>{Z(),e.stringify=function r(t){if(typeof t>"u")return t;if(t&&Buffer.isBuffer(t))return JSON.stringify(":base64:"+t.toString("base64"));if(t&&t.toJSON&&(t=t.toJSON()),t&&typeof t=="object"){var n="",i=Array.isArray(t);n=i?"[":"{";var l=!0;for(var a in t){var o=typeof t[a]=="function"||!i&&typeof t[a]>"u";Object.hasOwnProperty.call(t,a)&&!o&&(l||(n+=","),l=!1,i?t[a]==null?n+="null":n+=r(t[a]):t[a]!==void 0&&(n+=r(a)+":"+r(t[a])))}return n+=i?"]":"}",n}else return typeof t=="string"?JSON.stringify(/^:/.test(t)?":"+t:t):typeof t>"u"?"null":JSON.stringify(t)},e.parse=function(r){return JSON.parse(r,function(t,n){return typeof n=="string"?/^:base64:/.test(n)?Buffer.from(n.substring(8),"base64"):/^:/.test(n)?n.substring(1):n:n})}}),kb=te((e,r)=>{"use strict";Z();var t=he("events"),n=Cb(),i=o=>{let s={redis:"@keyv/redis",rediss:"@keyv/redis",mongodb:"@keyv/mongo",mongo:"@keyv/mongo",sqlite:"@keyv/sqlite",postgresql:"@keyv/postgres",postgres:"@keyv/postgres",mysql:"@keyv/mysql",etcd:"@keyv/etcd",offline:"@keyv/offline",tiered:"@keyv/tiered"};if(o.adapter||o.uri){let f=o.adapter||/^[^:+]*/.exec(o.uri)[0];return new(he(s[f]))(o)}return new Map},l=["sqlite","postgres","mysql","mongo","redis","tiered"],a=class extends t{constructor(o,{emitErrors:s=!0,...f}={}){if(super(),this.opts={namespace:"keyv",serialize:n.stringify,deserialize:n.parse,...typeof o=="string"?{uri:o}:o,...f},!this.opts.store){let h={...this.opts};this.opts.store=i(h)}if(this.opts.compression){let h=this.opts.compression;this.opts.serialize=h.serialize.bind(h),this.opts.deserialize=h.deserialize.bind(h)}typeof this.opts.store.on=="function"&&s&&this.opts.store.on("error",h=>this.emit("error",h)),this.opts.store.namespace=this.opts.namespace;let c=h=>async function*(){for await(let[u,d]of typeof h=="function"?h(this.opts.store.namespace):h){let p=this.opts.deserialize(d);if(!(this.opts.store.namespace&&!u.includes(this.opts.store.namespace))){if(typeof p.expires=="number"&&Date.now()>p.expires){this.delete(u);continue}yield[this._getKeyUnprefix(u),p.value]}}};typeof this.opts.store[Symbol.iterator]=="function"&&this.opts.store instanceof Map?this.iterator=c(this.opts.store):typeof this.opts.store.iterator=="function"&&this.opts.store.opts&&this._checkIterableAdaptar()&&(this.iterator=c(this.opts.store.iterator.bind(this.opts.store)))}_checkIterableAdaptar(){return l.includes(this.opts.store.opts.dialect)||l.findIndex(o=>this.opts.store.opts.url.includes(o))>=0}_getKeyPrefix(o){return`${this.opts.namespace}:${o}`}_getKeyPrefixArray(o){return o.map(s=>`${this.opts.namespace}:${s}`)}_getKeyUnprefix(o){return o.split(":").splice(1).join(":")}get(o,s){let{store:f}=this.opts,c=Array.isArray(o),h=c?this._getKeyPrefixArray(o):this._getKeyPrefix(o);if(c&&f.getMany===void 0){let u=[];for(let d of h)u.push(Promise.resolve().then(()=>f.get(d)).then(p=>typeof p=="string"?this.opts.deserialize(p):this.opts.compression?this.opts.deserialize(p):p).then(p=>{if(p!=null)return typeof p.expires=="number"&&Date.now()>p.expires?this.delete(d).then(()=>{}):s&&s.raw?p:p.value}));return Promise.allSettled(u).then(d=>{let p=[];for(let y of d)p.push(y.value);return p})}return Promise.resolve().then(()=>c?f.getMany(h):f.get(h)).then(u=>typeof u=="string"?this.opts.deserialize(u):this.opts.compression?this.opts.deserialize(u):u).then(u=>{if(u!=null){if(c){let d=[];for(let p of u){if(typeof p=="string"&&(p=this.opts.deserialize(p)),p==null){d.push(void 0);continue}typeof p.expires=="number"&&Date.now()>p.expires?(this.delete(o).then(()=>{}),d.push(void 0)):d.push(s&&s.raw?p:p.value)}return d}return typeof u.expires=="number"&&Date.now()>u.expires?this.delete(o).then(()=>{}):s&&s.raw?u:u.value}})}set(o,s,f){let c=this._getKeyPrefix(o);typeof f>"u"&&(f=this.opts.ttl),f===0&&(f=void 0);let{store:h}=this.opts;return Promise.resolve().then(()=>{let u=typeof f=="number"?Date.now()+f:null;return typeof s=="symbol"&&this.emit("error","symbol cannot be serialized"),s={value:s,expires:u},this.opts.serialize(s)}).then(u=>h.set(c,u,f)).then(()=>!0)}delete(o){let{store:s}=this.opts;if(Array.isArray(o)){let c=this._getKeyPrefixArray(o);if(s.deleteMany===void 0){let h=[];for(let u of c)h.push(s.delete(u));return Promise.allSettled(h).then(u=>u.every(d=>d.value===!0))}return Promise.resolve().then(()=>s.deleteMany(c))}let f=this._getKeyPrefix(o);return Promise.resolve().then(()=>s.delete(f))}clear(){let{store:o}=this.opts;return Promise.resolve().then(()=>o.clear())}has(o){let s=this._getKeyPrefix(o),{store:f}=this.opts;return Promise.resolve().then(async()=>typeof f.has=="function"?f.has(s):await f.get(s)!==void 0)}disconnect(){let{store:o}=this.opts;if(typeof o.disconnect=="function")return o.disconnect()}};r.exports=a}),Db=te((e,r)=>{"use strict";Z();var t=he("events"),n=he("url"),i=yb(),l=wb(),a=Eb(),o=Sb(),s=oa(),f=Ab(),c=kb(),h=class{constructor(p,y){if(typeof p!="function")throw new TypeError("Parameter `request` must be a function");return this.cache=new c({uri:typeof y=="string"&&y,store:typeof y!="string"&&y,namespace:"cacheable-request"}),this.createCacheableRequest(p)}createCacheableRequest(p){return(y,b)=>{let _;if(typeof y=="string")_=d(n.parse(y)),y={};else if(y instanceof n.URL)_=d(n.parse(y.toString())),y={};else{let[x,...A]=(y.path||"").split("?"),R=A.length>0?`?${A.join("?")}`:"";_=d({...y,pathname:x,search:R})}y={headers:{},method:"GET",cache:!0,strictTtl:!1,automaticFailover:!1,...y,...u(_)},y.headers=s(y.headers);let g=new t,S=i(n.format(_),{stripWWW:!1,removeTrailingSlash:!1,stripAuthentication:!1}),E=`${y.method}:${S}`,v=!1,m=!1,w=x=>{m=!0;let A=!1,R,B=new Promise(O=>{R=()=>{A||(A=!0,O())}}),P=O=>{if(v&&!x.forceRefresh){O.status=O.statusCode;let k=a.fromObject(v.cachePolicy).revalidatedPolicy(x,O);if(!k.modified){let M=k.policy.responseHeaders();O=new o(v.statusCode,M,v.body,v.url),O.cachePolicy=k.policy,O.fromCache=!0}}O.fromCache||(O.cachePolicy=new a(x,O,x),O.fromCache=!1);let D;x.cache&&O.cachePolicy.storable()?(D=f(O),(async()=>{try{let k=l.buffer(O);if(await Promise.race([B,new Promise(W=>O.once("end",W))]),A)return;let M=await k,L={cachePolicy:O.cachePolicy.toObject(),url:O.url,statusCode:O.fromCache?v.statusCode:O.statusCode,body:M},U=x.strictTtl?O.cachePolicy.timeToLive():void 0;x.maxTtl&&(U=U?Math.min(U,x.maxTtl):x.maxTtl),await this.cache.set(E,L,U)}catch(k){g.emit("error",new h.CacheError(k))}})()):x.cache&&v&&(async()=>{try{await this.cache.delete(E)}catch(k){g.emit("error",new h.CacheError(k))}})(),g.emit("response",D||O),typeof b=="function"&&b(D||O)};try{let O=p(x,P);O.once("error",R),O.once("abort",R),g.emit("request",O)}catch(O){g.emit("error",new h.RequestError(O))}};return(async()=>{let x=async R=>{await Promise.resolve();let B=R.cache?await this.cache.get(E):void 0;if(typeof B>"u")return w(R);let P=a.fromObject(B.cachePolicy);if(P.satisfiesWithoutRevalidation(R)&&!R.forceRefresh){let O=P.responseHeaders(),D=new o(B.statusCode,O,B.body,B.url);D.cachePolicy=P,D.fromCache=!0,g.emit("response",D),typeof b=="function"&&b(D)}else v=B,R.headers=P.revalidationHeaders(R),w(R)},A=R=>g.emit("error",new h.CacheError(R));this.cache.once("error",A),g.on("response",()=>this.cache.removeListener("error",A));try{await x(y)}catch(R){y.automaticFailover&&!m&&w(y),g.emit("error",new h.CacheError(R))}})(),g}}};function u(p){let y={...p};return y.path=`${p.pathname||"/"}${p.search||""}`,delete y.pathname,delete y.search,y}function d(p){return{protocol:p.protocol,auth:p.auth,hostname:p.hostname||p.host||"localhost",port:p.port,pathname:p.pathname,search:p.search}}h.RequestError=class extends Error{constructor(p){super(p.message),this.name="RequestError",Object.assign(this,p)}},h.CacheError=class extends Error{constructor(p){super(p.message),this.name="CacheError",Object.assign(this,p)}},r.exports=h}),Rb=te((e,r)=>{"use strict";Z();var t=["aborted","complete","headers","httpVersion","httpVersionMinor","httpVersionMajor","method","rawHeaders","rawTrailers","setTimeout","socket","statusCode","statusMessage","trailers","url"];r.exports=(n,i)=>{if(i._readableState.autoDestroy)throw new Error("The second stream must have the `autoDestroy` option set to `false`");let l=new Set(Object.keys(n).concat(t)),a={};for(let o of l)o in i||(a[o]={get(){let s=n[o];return typeof s=="function"?s.bind(n):s},set(s){n[o]=s},enumerable:!0,configurable:!1});return Object.defineProperties(i,a),n.once("aborted",()=>{i.destroy(),i.emit("aborted")}),n.once("close",()=>{n.complete&&i.readable?i.once("end",()=>{i.emit("close")}):i.emit("close")}),i}}),Ob=te((e,r)=>{"use strict";Z();var{Transform:t,PassThrough:n}=he("stream"),i=he("zlib"),l=Rb();r.exports=a=>{let o=(a.headers["content-encoding"]||"").toLowerCase();if(!["gzip","deflate","br"].includes(o))return a;let s=o==="br";if(s&&typeof i.createBrotliDecompress!="function")return a.destroy(new Error("Brotli is not supported on Node.js < 12")),a;let f=!0,c=new t({transform(d,p,y){f=!1,y(null,d)},flush(d){d()}}),h=new n({autoDestroy:!1,destroy(d,p){a.destroy(),p(d)}}),u=s?i.createBrotliDecompress():i.createUnzip();return u.once("error",d=>{if(f&&!a.readable){h.end();return}h.destroy(d)}),l(a,h),a.pipe(c).pipe(u).pipe(h),h}}),af=te((e,r)=>{"use strict";Z();var t=class{constructor(n={}){if(!(n.maxSize&&n.maxSize>0))throw new TypeError("`maxSize` must be a number greater than 0");this.maxSize=n.maxSize,this.onEviction=n.onEviction,this.cache=new Map,this.oldCache=new Map,this._size=0}_set(n,i){if(this.cache.set(n,i),this._size++,this._size>=this.maxSize){if(this._size=0,typeof this.onEviction=="function")for(let[l,a]of this.oldCache.entries())this.onEviction(l,a);this.oldCache=this.cache,this.cache=new Map}}get(n){if(this.cache.has(n))return this.cache.get(n);if(this.oldCache.has(n)){let i=this.oldCache.get(n);return this.oldCache.delete(n),this._set(n,i),i}}set(n,i){return this.cache.has(n)?this.cache.set(n,i):this._set(n,i),this}has(n){return this.cache.has(n)||this.oldCache.has(n)}peek(n){if(this.cache.has(n))return this.cache.get(n);if(this.oldCache.has(n))return this.oldCache.get(n)}delete(n){let i=this.cache.delete(n);return i&&this._size--,this.oldCache.delete(n)||i}clear(){this.cache.clear(),this.oldCache.clear(),this._size=0}*keys(){for(let[n]of this)yield n}*values(){for(let[,n]of this)yield n}*[Symbol.iterator](){for(let n of this.cache)yield n;for(let n of this.oldCache){let[i]=n;this.cache.has(i)||(yield n)}}get size(){let n=0;for(let i of this.oldCache.keys())this.cache.has(i)||n++;return Math.min(this._size+n,this.maxSize)}};r.exports=t}),uf=te((e,r)=>{"use strict";Z();var t=he("events"),n=he("tls"),i=he("http2"),l=af(),a=Symbol("currentStreamsCount"),o=Symbol("request"),s=Symbol("cachedOriginSet"),f=Symbol("gracefullyClosing"),c=["maxDeflateDynamicTableSize","maxSessionMemory","maxHeaderListPairs","maxOutstandingPings","maxReservedRemoteStreams","maxSendHeaderBlockLength","paddingStrategy","localAddress","path","rejectUnauthorized","minDHSize","ca","cert","clientCertEngine","ciphers","key","pfx","servername","minVersion","maxVersion","secureProtocol","crl","honorCipherOrder","ecdhCurve","dhparam","secureOptions","sessionIdContext"],h=(g,S,E)=>{let v=0,m=g.length;for(;v<m;){let w=v+m>>>1;E(g[w],S)?v=w+1:m=w}return v},u=(g,S)=>g.remoteSettings.maxConcurrentStreams>S.remoteSettings.maxConcurrentStreams,d=(g,S)=>{for(let E of g)E[s].length<S[s].length&&E[s].every(v=>S[s].includes(v))&&E[a]+S[a]<=S.remoteSettings.maxConcurrentStreams&&b(E)},p=(g,S)=>{for(let E of g)S[s].length<E[s].length&&S[s].every(v=>E[s].includes(v))&&S[a]+E[a]<=E.remoteSettings.maxConcurrentStreams&&b(S)},y=({agent:g,isFree:S})=>{let E={};for(let v in g.sessions){let m=g.sessions[v].filter(w=>{let x=w[_.kCurrentStreamsCount]<w.remoteSettings.maxConcurrentStreams;return S?x:!x});m.length!==0&&(E[v]=m)}return E},b=g=>{g[f]=!0,g[a]===0&&g.close()},_=class extends t{constructor({timeout:g=6e4,maxSessions:S=1/0,maxFreeSessions:E=10,maxCachedTlsSessions:v=100}={}){super(),this.sessions={},this.queue={},this.timeout=g,this.maxSessions=S,this.maxFreeSessions=E,this._freeSessionsCount=0,this._sessionsCount=0,this.settings={enablePush:!1},this.tlsSessionCache=new l({maxSize:v})}static normalizeOrigin(g,S){return typeof g=="string"&&(g=new URL(g)),S&&g.hostname!==S&&(g.hostname=S),g.origin}normalizeOptions(g){let S="";if(g)for(let E of c)g[E]&&(S+=`:${g[E]}`);return S}_tryToCreateNewSession(g,S){if(!(g in this.queue)||!(S in this.queue[g]))return;let E=this.queue[g][S];this._sessionsCount<this.maxSessions&&!E.completed&&(E.completed=!0,E())}getSession(g,S,E){return new Promise((v,m)=>{Array.isArray(E)?(E=[...E],v()):E=[{resolve:v,reject:m}];let w=this.normalizeOptions(S),x=_.normalizeOrigin(g,S&&S.servername);if(x===void 0){for(let{reject:B}of E)B(new TypeError("The `origin` argument needs to be a string or an URL object"));return}if(w in this.sessions){let B=this.sessions[w],P=-1,O=-1,D;for(let k of B){let M=k.remoteSettings.maxConcurrentStreams;if(M<P)break;if(k[s].includes(x)){let L=k[a];if(L>=M||k[f]||k.destroyed)continue;D||(P=M),L>O&&(D=k,O=L)}}if(D){if(E.length!==1){for(let{reject:k}of E){let M=new Error(`Expected the length of listeners to be 1, got ${E.length}.
|
|
117
|
+
`)))}info(...e){this.logger(...e)}mainStep(e){this.blankLine(),this.logger(`${this.step}. ${Bt.default.underline(e)}`),this.step+=1}subStep(...e){this.logger(" ".repeat(Nn),"-",this.dry?Bt.default.yellow("SKIPPED |"):Bt.default.green("OK |"),...e)}subStepFailure(...e){this.logger(" ".repeat(Nn),"-",Bt.default.red("ERROR |"),...e)}rootHeader(){this.blankLine(),this.indented(2,"Root:")}rootStep(...e){this.logger(" ".repeat(Nn*3),"-",this.dry?Bt.default.yellow("SKIPPED |"):Bt.default.green("OK |"),...e)}workspaceHeader(){this.blankLine(),this.indented(2,"Workspaces:")}workspaceStep(...e){this.logger(" ".repeat(Nn*3),"-",this.dry?Bt.default.yellow("SKIPPED |"):Bt.default.green("OK |"),...e)}blankLine(){this.logger()}error(...e){console.error(...e)}},Qg={npm:[{name:"npm",template:"npm",command:"npm",installArgs:["install"],version:"latest",executable:"npx",semver:"*",default:!0}],pnpm:[{name:"pnpm6",template:"pnpm",command:"pnpm",installArgs:["install"],version:"latest-6",executable:"pnpx",semver:"6.x"},{name:"pnpm",template:"pnpm",command:"pnpm",installArgs:["install"],version:"latest",executable:"pnpm dlx",semver:">=7",default:!0}],yarn:[{name:"yarn",template:"yarn",command:"yarn",installArgs:["install"],version:"1.x",executable:"npx",semver:"<2",default:!0},{name:"berry",template:"berry",command:"yarn",installArgs:["install","--no-immutable"],version:"stable",executable:"yarn dlx",semver:">=2"}]};function C5(e){let{version:r,name:t}=e;return r?Qg[t].find(n=>(0,DN.satisfies)(r,n.semver)):Qg[t].find(n=>n.default)}async function k5(e){let{to:r,logger:t,options:n}=e,i=t!=null?t:new A5(n),l=C5(r);if(!l)throw new vt("Unsupported package manager version.",{type:"package_manager-unsupported_version"});if(i.subStep(`running "${l.command} ${l.installArgs}"`),!(n!=null&&n.dry)){let a;i!=null&&i.interactive&&(a=(0,kN.default)({text:"installing dependencies...",spinner:{frames:i.installerFrames()}}).start());try{await(0,CN.default)(l.command,l.installArgs,{cwd:e.project.paths.root}),a&&a.stop(),i.subStep("dependencies installed")}catch(o){throw i.subStepFailure("failed to install dependencies"),o}}}async function ON({project:e,to:r,logger:t,options:n}){if(t.header(`Converting project from ${e.packageManager} to ${r.name}.`),e.packageManager==r.name)throw new vt("You are already using this package manager",{type:"package_manager-already_in_use"});await qn[e.packageManager].remove({project:e,to:r,logger:t,options:n}),await qn[r.name].create({project:e,to:r,logger:t,options:n}),t.mainStep("Installing dependencies"),n!=null&&n.skipInstall?t.subStep(AN.default.yellow("Skipping install")):(await qn[r.name].convertLock({project:e,logger:t,options:n}),await k5({project:e,to:r,logger:t,options:n})),t.mainStep(`Cleaning up ${e.packageManager} workspaces`),await qn[e.packageManager].clean({project:e,logger:t})}async function TN({root:e,to:r,options:t}){let n=new A5({...t,interactive:!1}),[i,l]=await Promise.all([x5({root:e}),j9()]);await ON({project:i,to:{name:r,version:l[r].version},logger:n,options:t})}});var Jh=Ue(require("chalk")),ot=require("commander");var tf=Ue(require("chalk")),rf=Ue(require("update-check"));var Xn={name:"@turbo/gen",version:"0.0.1-alpha.3",description:"Extend a Turborepo",homepage:"https://turbo.build/repo",license:"MPL-2.0",repository:{type:"git",url:"https://github.com/vercel/turbo",directory:"packages/turbo-gen"},bugs:{url:"https://github.com/vercel/turbo/issues"},bin:"dist/cli.js",scripts:{build:"tsup",test:"jest",lint:"eslint src/**/*.ts","check-types":"tsc --noEmit"},dependencies:{chalk:"2.4.2",commander:"^10.0.0","fs-extra":"^10.1.0",inquirer:"^8.2.4",minimatch:"^9.0.0","node-plop":"^0.26.3",semver:"^7.3.8","update-check":"^1.5.4","validate-npm-package-name":"^5.0.0"},devDependencies:{"@turbo/test-utils":"workspace:*","@turbo/tsconfig":"workspace:*","@turbo/utils":"workspace:*","@turbo/workspaces":"workspace:*","@types/fs-extra":"^9.0.13","@types/inquirer":"^8.2.5","@types/jest":"^27.4.0","@types/node":"^16.11.12","@types/semver":"^7.3.9","@types/validate-npm-package-name":"^4.0.0",eslint:"^7.23.0",jest:"^27.4.3","ts-jest":"^27.1.1",tsup:"^6.7.0",typescript:"^4.5.5"},files:["dist"],publishConfig:{access:"public"}};var ib=(0,rf.default)(Xn).catch(()=>null);async function Ji(){try{let e=await ib;e!=null&&e.latest&&(console.log(),console.log(tf.default.yellow.bold(`A new version of \`${Xn.name}\` is available!`)),console.log()),process.exit()}catch{}}var sb=Object.create,sa=Object.defineProperty,ob=Object.getOwnPropertyDescriptor,ab=Object.getOwnPropertyNames,ub=Object.getPrototypeOf,lb=Object.prototype.hasOwnProperty,he=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(r,t)=>(typeof require!="undefined"?require:r)[t]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')}),cb=(e,r)=>()=>(e&&(r=e(e=0)),r),te=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports),nf=(e,r)=>{for(var t in r)sa(e,t,{get:r[t],enumerable:!0})},hb=(e,r,t,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of ab(r))!lb.call(e,i)&&i!==t&&sa(e,i,{get:()=>r[i],enumerable:!(n=ob(r,i))||n.enumerable});return e},Ge=(e,r,t)=>(t=e!=null?sb(ub(e)):{},hb(r||!e||!e.__esModule?sa(t,"default",{value:e,enumerable:!0}):t,e)),Z=cb(()=>{});var Tf=require("stream"),Ff=require("util"),Pf=require("path"),Bf=require("os"),ri=require("fs"),hr=te((e,r)=>{"use strict";Z(),Object.defineProperty(e,"__esModule",{value:!0});var t=["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"];function n(m){return t.includes(m)}var i=["Function","Generator","AsyncGenerator","GeneratorFunction","AsyncGeneratorFunction","AsyncFunction","Observable","Array","Buffer","Blob","Object","RegExp","Date","Error","Map","Set","WeakMap","WeakSet","ArrayBuffer","SharedArrayBuffer","DataView","Promise","URL","FormData","URLSearchParams","HTMLElement",...t];function l(m){return i.includes(m)}var a=["null","undefined","string","number","bigint","boolean","symbol"];function o(m){return a.includes(m)}function s(m){return w=>typeof w===m}var{toString:f}=Object.prototype,c=m=>{let w=f.call(m).slice(8,-1);if(/HTML\w+Element/.test(w)&&u.domElement(m))return"HTMLElement";if(l(w))return w},h=m=>w=>c(w)===m;function u(m){if(m===null)return"null";switch(typeof m){case"undefined":return"undefined";case"string":return"string";case"number":return"number";case"boolean":return"boolean";case"function":return"Function";case"bigint":return"bigint";case"symbol":return"symbol";default:}if(u.observable(m))return"Observable";if(u.array(m))return"Array";if(u.buffer(m))return"Buffer";let w=c(m);if(w)return w;if(m instanceof String||m instanceof Boolean||m instanceof Number)throw new TypeError("Please don't use object wrappers for primitive types");return"Object"}u.undefined=s("undefined"),u.string=s("string");var d=s("number");u.number=m=>d(m)&&!u.nan(m),u.bigint=s("bigint"),u.function_=s("function"),u.null_=m=>m===null,u.class_=m=>u.function_(m)&&m.toString().startsWith("class "),u.boolean=m=>m===!0||m===!1,u.symbol=s("symbol"),u.numericString=m=>u.string(m)&&!u.emptyStringOrWhitespace(m)&&!Number.isNaN(Number(m)),u.array=(m,w)=>Array.isArray(m)?u.function_(w)?m.every(w):!0:!1,u.buffer=m=>{var w,x,A,R;return(R=(A=(x=(w=m)===null||w===void 0?void 0:w.constructor)===null||x===void 0?void 0:x.isBuffer)===null||A===void 0?void 0:A.call(x,m))!==null&&R!==void 0?R:!1},u.blob=m=>h("Blob")(m),u.nullOrUndefined=m=>u.null_(m)||u.undefined(m),u.object=m=>!u.null_(m)&&(typeof m=="object"||u.function_(m)),u.iterable=m=>{var w;return u.function_((w=m)===null||w===void 0?void 0:w[Symbol.iterator])},u.asyncIterable=m=>{var w;return u.function_((w=m)===null||w===void 0?void 0:w[Symbol.asyncIterator])},u.generator=m=>{var w,x;return u.iterable(m)&&u.function_((w=m)===null||w===void 0?void 0:w.next)&&u.function_((x=m)===null||x===void 0?void 0:x.throw)},u.asyncGenerator=m=>u.asyncIterable(m)&&u.function_(m.next)&&u.function_(m.throw),u.nativePromise=m=>h("Promise")(m);var p=m=>{var w,x;return u.function_((w=m)===null||w===void 0?void 0:w.then)&&u.function_((x=m)===null||x===void 0?void 0:x.catch)};u.promise=m=>u.nativePromise(m)||p(m),u.generatorFunction=h("GeneratorFunction"),u.asyncGeneratorFunction=m=>c(m)==="AsyncGeneratorFunction",u.asyncFunction=m=>c(m)==="AsyncFunction",u.boundFunction=m=>u.function_(m)&&!m.hasOwnProperty("prototype"),u.regExp=h("RegExp"),u.date=h("Date"),u.error=h("Error"),u.map=m=>h("Map")(m),u.set=m=>h("Set")(m),u.weakMap=m=>h("WeakMap")(m),u.weakSet=m=>h("WeakSet")(m),u.int8Array=h("Int8Array"),u.uint8Array=h("Uint8Array"),u.uint8ClampedArray=h("Uint8ClampedArray"),u.int16Array=h("Int16Array"),u.uint16Array=h("Uint16Array"),u.int32Array=h("Int32Array"),u.uint32Array=h("Uint32Array"),u.float32Array=h("Float32Array"),u.float64Array=h("Float64Array"),u.bigInt64Array=h("BigInt64Array"),u.bigUint64Array=h("BigUint64Array"),u.arrayBuffer=h("ArrayBuffer"),u.sharedArrayBuffer=h("SharedArrayBuffer"),u.dataView=h("DataView"),u.enumCase=(m,w)=>Object.values(w).includes(m),u.directInstanceOf=(m,w)=>Object.getPrototypeOf(m)===w.prototype,u.urlInstance=m=>h("URL")(m),u.urlString=m=>{if(!u.string(m))return!1;try{return new URL(m),!0}catch{return!1}},u.truthy=m=>!!m,u.falsy=m=>!m,u.nan=m=>Number.isNaN(m),u.primitive=m=>u.null_(m)||o(typeof m),u.integer=m=>Number.isInteger(m),u.safeInteger=m=>Number.isSafeInteger(m),u.plainObject=m=>{if(f.call(m)!=="[object Object]")return!1;let w=Object.getPrototypeOf(m);return w===null||w===Object.getPrototypeOf({})},u.typedArray=m=>n(c(m));var y=m=>u.safeInteger(m)&&m>=0;u.arrayLike=m=>!u.nullOrUndefined(m)&&!u.function_(m)&&y(m.length),u.inRange=(m,w)=>{if(u.number(w))return m>=Math.min(0,w)&&m<=Math.max(w,0);if(u.array(w)&&w.length===2)return m>=Math.min(...w)&&m<=Math.max(...w);throw new TypeError(`Invalid range: ${JSON.stringify(w)}`)};var b=1,_=["innerHTML","ownerDocument","style","attributes","nodeValue"];u.domElement=m=>u.object(m)&&m.nodeType===b&&u.string(m.nodeName)&&!u.plainObject(m)&&_.every(w=>w in m),u.observable=m=>{var w,x,A,R;return m?m===((x=(w=m)[Symbol.observable])===null||x===void 0?void 0:x.call(w))||m===((R=(A=m)["@@observable"])===null||R===void 0?void 0:R.call(A)):!1},u.nodeStream=m=>u.object(m)&&u.function_(m.pipe)&&!u.observable(m),u.infinite=m=>m===1/0||m===-1/0;var g=m=>w=>u.integer(w)&&Math.abs(w%2)===m;u.evenInteger=g(0),u.oddInteger=g(1),u.emptyArray=m=>u.array(m)&&m.length===0,u.nonEmptyArray=m=>u.array(m)&&m.length>0,u.emptyString=m=>u.string(m)&&m.length===0;var S=m=>u.string(m)&&!/\S/.test(m);u.emptyStringOrWhitespace=m=>u.emptyString(m)||S(m),u.nonEmptyString=m=>u.string(m)&&m.length>0,u.nonEmptyStringAndNotWhitespace=m=>u.string(m)&&!u.emptyStringOrWhitespace(m),u.emptyObject=m=>u.object(m)&&!u.map(m)&&!u.set(m)&&Object.keys(m).length===0,u.nonEmptyObject=m=>u.object(m)&&!u.map(m)&&!u.set(m)&&Object.keys(m).length>0,u.emptySet=m=>u.set(m)&&m.size===0,u.nonEmptySet=m=>u.set(m)&&m.size>0,u.emptyMap=m=>u.map(m)&&m.size===0,u.nonEmptyMap=m=>u.map(m)&&m.size>0,u.propertyKey=m=>u.any([u.string,u.number,u.symbol],m),u.formData=m=>h("FormData")(m),u.urlSearchParams=m=>h("URLSearchParams")(m);var E=(m,w,x)=>{if(!u.function_(w))throw new TypeError(`Invalid predicate: ${JSON.stringify(w)}`);if(x.length===0)throw new TypeError("Invalid number of values");return m.call(x,w)};u.any=(m,...w)=>(u.array(m)?m:[m]).some(x=>E(Array.prototype.some,x,w)),u.all=(m,...w)=>E(Array.prototype.every,m,w);var v=(m,w,x,A={})=>{if(!m){let{multipleValues:R}=A,B=R?`received values of types ${[...new Set(x.map(P=>`\`${u(P)}\``))].join(", ")}`:`received value of type \`${u(x)}\``;throw new TypeError(`Expected value which is \`${w}\`, ${B}.`)}};e.assert={undefined:m=>v(u.undefined(m),"undefined",m),string:m=>v(u.string(m),"string",m),number:m=>v(u.number(m),"number",m),bigint:m=>v(u.bigint(m),"bigint",m),function_:m=>v(u.function_(m),"Function",m),null_:m=>v(u.null_(m),"null",m),class_:m=>v(u.class_(m),"Class",m),boolean:m=>v(u.boolean(m),"boolean",m),symbol:m=>v(u.symbol(m),"symbol",m),numericString:m=>v(u.numericString(m),"string with a number",m),array:(m,w)=>{v(u.array(m),"Array",m),w&&m.forEach(w)},buffer:m=>v(u.buffer(m),"Buffer",m),blob:m=>v(u.blob(m),"Blob",m),nullOrUndefined:m=>v(u.nullOrUndefined(m),"null or undefined",m),object:m=>v(u.object(m),"Object",m),iterable:m=>v(u.iterable(m),"Iterable",m),asyncIterable:m=>v(u.asyncIterable(m),"AsyncIterable",m),generator:m=>v(u.generator(m),"Generator",m),asyncGenerator:m=>v(u.asyncGenerator(m),"AsyncGenerator",m),nativePromise:m=>v(u.nativePromise(m),"native Promise",m),promise:m=>v(u.promise(m),"Promise",m),generatorFunction:m=>v(u.generatorFunction(m),"GeneratorFunction",m),asyncGeneratorFunction:m=>v(u.asyncGeneratorFunction(m),"AsyncGeneratorFunction",m),asyncFunction:m=>v(u.asyncFunction(m),"AsyncFunction",m),boundFunction:m=>v(u.boundFunction(m),"Function",m),regExp:m=>v(u.regExp(m),"RegExp",m),date:m=>v(u.date(m),"Date",m),error:m=>v(u.error(m),"Error",m),map:m=>v(u.map(m),"Map",m),set:m=>v(u.set(m),"Set",m),weakMap:m=>v(u.weakMap(m),"WeakMap",m),weakSet:m=>v(u.weakSet(m),"WeakSet",m),int8Array:m=>v(u.int8Array(m),"Int8Array",m),uint8Array:m=>v(u.uint8Array(m),"Uint8Array",m),uint8ClampedArray:m=>v(u.uint8ClampedArray(m),"Uint8ClampedArray",m),int16Array:m=>v(u.int16Array(m),"Int16Array",m),uint16Array:m=>v(u.uint16Array(m),"Uint16Array",m),int32Array:m=>v(u.int32Array(m),"Int32Array",m),uint32Array:m=>v(u.uint32Array(m),"Uint32Array",m),float32Array:m=>v(u.float32Array(m),"Float32Array",m),float64Array:m=>v(u.float64Array(m),"Float64Array",m),bigInt64Array:m=>v(u.bigInt64Array(m),"BigInt64Array",m),bigUint64Array:m=>v(u.bigUint64Array(m),"BigUint64Array",m),arrayBuffer:m=>v(u.arrayBuffer(m),"ArrayBuffer",m),sharedArrayBuffer:m=>v(u.sharedArrayBuffer(m),"SharedArrayBuffer",m),dataView:m=>v(u.dataView(m),"DataView",m),enumCase:(m,w)=>v(u.enumCase(m,w),"EnumCase",m),urlInstance:m=>v(u.urlInstance(m),"URL",m),urlString:m=>v(u.urlString(m),"string with a URL",m),truthy:m=>v(u.truthy(m),"truthy",m),falsy:m=>v(u.falsy(m),"falsy",m),nan:m=>v(u.nan(m),"NaN",m),primitive:m=>v(u.primitive(m),"primitive",m),integer:m=>v(u.integer(m),"integer",m),safeInteger:m=>v(u.safeInteger(m),"integer",m),plainObject:m=>v(u.plainObject(m),"plain object",m),typedArray:m=>v(u.typedArray(m),"TypedArray",m),arrayLike:m=>v(u.arrayLike(m),"array-like",m),domElement:m=>v(u.domElement(m),"HTMLElement",m),observable:m=>v(u.observable(m),"Observable",m),nodeStream:m=>v(u.nodeStream(m),"Node.js Stream",m),infinite:m=>v(u.infinite(m),"infinite number",m),emptyArray:m=>v(u.emptyArray(m),"empty array",m),nonEmptyArray:m=>v(u.nonEmptyArray(m),"non-empty array",m),emptyString:m=>v(u.emptyString(m),"empty string",m),emptyStringOrWhitespace:m=>v(u.emptyStringOrWhitespace(m),"empty string or whitespace",m),nonEmptyString:m=>v(u.nonEmptyString(m),"non-empty string",m),nonEmptyStringAndNotWhitespace:m=>v(u.nonEmptyStringAndNotWhitespace(m),"non-empty string and not whitespace",m),emptyObject:m=>v(u.emptyObject(m),"empty object",m),nonEmptyObject:m=>v(u.nonEmptyObject(m),"non-empty object",m),emptySet:m=>v(u.emptySet(m),"empty set",m),nonEmptySet:m=>v(u.nonEmptySet(m),"non-empty set",m),emptyMap:m=>v(u.emptyMap(m),"empty map",m),nonEmptyMap:m=>v(u.nonEmptyMap(m),"non-empty map",m),propertyKey:m=>v(u.propertyKey(m),"PropertyKey",m),formData:m=>v(u.formData(m),"FormData",m),urlSearchParams:m=>v(u.urlSearchParams(m),"URLSearchParams",m),evenInteger:m=>v(u.evenInteger(m),"even integer",m),oddInteger:m=>v(u.oddInteger(m),"odd integer",m),directInstanceOf:(m,w)=>v(u.directInstanceOf(m,w),"T",m),inRange:(m,w)=>v(u.inRange(m,w),"in range",m),any:(m,...w)=>v(u.any(m,...w),"predicate returns truthy for any value",w,{multipleValues:!0}),all:(m,...w)=>v(u.all(m,...w),"predicate returns truthy for all values",w,{multipleValues:!0})},Object.defineProperties(u,{class:{value:u.class_},function:{value:u.function_},null:{value:u.null_}}),Object.defineProperties(e.assert,{class:{value:e.assert.class_},function:{value:e.assert.function_},null:{value:e.assert.null_}}),e.default=u,r.exports=u,r.exports.default=u,r.exports.assert=e.assert}),fb=te((e,r)=>{"use strict";Z();var t=class extends Error{constructor(i){super(i||"Promise was canceled"),this.name="CancelError"}get isCanceled(){return!0}},n=class{static fn(i){return(...l)=>new n((a,o,s)=>{l.push(s),i(...l).then(a,o)})}constructor(i){this._cancelHandlers=[],this._isPending=!0,this._isCanceled=!1,this._rejectOnCancel=!0,this._promise=new Promise((l,a)=>{this._reject=a;let o=c=>{(!this._isCanceled||!f.shouldReject)&&(this._isPending=!1,l(c))},s=c=>{this._isPending=!1,a(c)},f=c=>{if(!this._isPending)throw new Error("The `onCancel` handler was attached after the promise settled.");this._cancelHandlers.push(c)};return Object.defineProperties(f,{shouldReject:{get:()=>this._rejectOnCancel,set:c=>{this._rejectOnCancel=c}}}),i(o,s,f)})}then(i,l){return this._promise.then(i,l)}catch(i){return this._promise.catch(i)}finally(i){return this._promise.finally(i)}cancel(i){if(!(!this._isPending||this._isCanceled)){if(this._isCanceled=!0,this._cancelHandlers.length>0)try{for(let l of this._cancelHandlers)l()}catch(l){this._reject(l);return}this._rejectOnCancel&&this._reject(new t(i))}}get isCanceled(){return this._isCanceled}};Object.setPrototypeOf(n.prototype,Promise.prototype),r.exports=n,r.exports.CancelError=t}),pb=te((e,r)=>{"use strict";Z(),Object.defineProperty(e,"__esModule",{value:!0});function t(i){return i.encrypted}var n=(i,l)=>{let a;typeof l=="function"?a={connect:l}:a=l;let o=typeof a.connect=="function",s=typeof a.secureConnect=="function",f=typeof a.close=="function",c=()=>{o&&a.connect(),t(i)&&s&&(i.authorized?a.secureConnect():i.authorizationError||i.once("secureConnect",a.secureConnect)),f&&i.once("close",a.close)};i.writable&&!i.connecting?c():i.connecting?i.once("connect",c):i.destroyed&&f&&a.close(i._hadError)};e.default=n,r.exports=n,r.exports.default=n}),db=te((e,r)=>{"use strict";Z(),Object.defineProperty(e,"__esModule",{value:!0});var t=pb(),n=he("util"),i=Number(process.versions.node.split(".")[0]),l=a=>{if(a.timings)return a.timings;let o={start:Date.now(),socket:void 0,lookup:void 0,connect:void 0,secureConnect:void 0,upload:void 0,response:void 0,end:void 0,error:void 0,abort:void 0,phases:{wait:void 0,dns:void 0,tcp:void 0,tls:void 0,request:void 0,firstByte:void 0,download:void 0,total:void 0}};a.timings=o;let s=u=>{let d=u.emit.bind(u);u.emit=(p,...y)=>(p==="error"&&(o.error=Date.now(),o.phases.total=o.error-o.start,u.emit=d),d(p,...y))};s(a);let f=()=>{o.abort=Date.now(),(!o.response||i>=13)&&(o.phases.total=Date.now()-o.start)};a.prependOnceListener("abort",f);let c=u=>{if(o.socket=Date.now(),o.phases.wait=o.socket-o.start,n.types.isProxy(u))return;let d=()=>{o.lookup=Date.now(),o.phases.dns=o.lookup-o.socket};u.prependOnceListener("lookup",d),t.default(u,{connect:()=>{o.connect=Date.now(),o.lookup===void 0&&(u.removeListener("lookup",d),o.lookup=o.connect,o.phases.dns=o.lookup-o.socket),o.phases.tcp=o.connect-o.lookup},secureConnect:()=>{o.secureConnect=Date.now(),o.phases.tls=o.secureConnect-o.connect}})};a.socket?c(a.socket):a.prependOnceListener("socket",c);let h=()=>{var u;o.upload=Date.now(),o.phases.request=o.upload-((u=o.secureConnect)!==null&&u!==void 0?u:o.connect)};return(()=>typeof a.writableFinished=="boolean"?a.writableFinished:a.finished&&a.outputSize===0&&(!a.socket||a.socket.writableLength===0))()?h():a.prependOnceListener("finish",h),a.prependOnceListener("response",u=>{o.response=Date.now(),o.phases.firstByte=o.response-o.upload,u.timings=o,s(u),u.prependOnceListener("end",()=>{o.end=Date.now(),o.phases.download=o.end-o.response,o.phases.total=o.end-o.start}),u.prependOnceListener("aborted",f)}),o};e.default=l,r.exports=l,r.exports.default=l}),mb=te((e,r)=>{"use strict";Z();var{V4MAPPED:t,ADDRCONFIG:n,ALL:i,promises:{Resolver:l},lookup:a}=he("dns"),{promisify:o}=he("util"),s=he("os"),f=Symbol("cacheableLookupCreateConnection"),c=Symbol("cacheableLookupInstance"),h=Symbol("expires"),u=typeof i=="number",d=E=>{if(!(E&&typeof E.createConnection=="function"))throw new Error("Expected an Agent instance as the first argument")},p=E=>{for(let v of E)v.family!==6&&(v.address=`::ffff:${v.address}`,v.family=6)},y=()=>{let E=!1,v=!1;for(let m of Object.values(s.networkInterfaces()))for(let w of m)if(!w.internal&&(w.family==="IPv6"?v=!0:E=!0,E&&v))return{has4:E,has6:v};return{has4:E,has6:v}},b=E=>Symbol.iterator in E,_={ttl:!0},g={all:!0},S=class{constructor({cache:E=new Map,maxTtl:v=1/0,fallbackDuration:m=3600,errorTtl:w=.15,resolver:x=new l,lookup:A=a}={}){if(this.maxTtl=v,this.errorTtl=w,this._cache=E,this._resolver=x,this._dnsLookup=o(A),this._resolver instanceof l?(this._resolve4=this._resolver.resolve4.bind(this._resolver),this._resolve6=this._resolver.resolve6.bind(this._resolver)):(this._resolve4=o(this._resolver.resolve4.bind(this._resolver)),this._resolve6=o(this._resolver.resolve6.bind(this._resolver))),this._iface=y(),this._pending={},this._nextRemovalTime=!1,this._hostnamesToFallback=new Set,m<1)this._fallback=!1;else{this._fallback=!0;let R=setInterval(()=>{this._hostnamesToFallback.clear()},m*1e3);R.unref&&R.unref()}this.lookup=this.lookup.bind(this),this.lookupAsync=this.lookupAsync.bind(this)}set servers(E){this.clear(),this._resolver.setServers(E)}get servers(){return this._resolver.getServers()}lookup(E,v,m){if(typeof v=="function"?(m=v,v={}):typeof v=="number"&&(v={family:v}),!m)throw new Error("Callback must be a function.");this.lookupAsync(E,v).then(w=>{v.all?m(null,w):m(null,w.address,w.family,w.expires,w.ttl)},m)}async lookupAsync(E,v={}){typeof v=="number"&&(v={family:v});let m=await this.query(E);if(v.family===6){let w=m.filter(x=>x.family===6);v.hints&t&&(u&&v.hints&i||w.length===0)?p(m):m=w}else v.family===4&&(m=m.filter(w=>w.family===4));if(v.hints&n){let{_iface:w}=this;m=m.filter(x=>x.family===6?w.has6:w.has4)}if(m.length===0){let w=new Error(`cacheableLookup ENOTFOUND ${E}`);throw w.code="ENOTFOUND",w.hostname=E,w}return v.all?m:m[0]}async query(E){let v=await this._cache.get(E);if(!v){let m=this._pending[E];if(m)v=await m;else{let w=this.queryAndCache(E);this._pending[E]=w;try{v=await w}finally{delete this._pending[E]}}}return v=v.map(m=>({...m})),v}async _resolve(E){let v=async P=>{try{return await P}catch(O){if(O.code==="ENODATA"||O.code==="ENOTFOUND")return[];throw O}},[m,w]=await Promise.all([this._resolve4(E,_),this._resolve6(E,_)].map(P=>v(P))),x=0,A=0,R=0,B=Date.now();for(let P of m)P.family=4,P.expires=B+P.ttl*1e3,x=Math.max(x,P.ttl);for(let P of w)P.family=6,P.expires=B+P.ttl*1e3,A=Math.max(A,P.ttl);return m.length>0?w.length>0?R=Math.min(x,A):R=x:R=A,{entries:[...m,...w],cacheTtl:R}}async _lookup(E){try{return{entries:await this._dnsLookup(E,{all:!0}),cacheTtl:0}}catch{return{entries:[],cacheTtl:0}}}async _set(E,v,m){if(this.maxTtl>0&&m>0){m=Math.min(m,this.maxTtl)*1e3,v[h]=Date.now()+m;try{await this._cache.set(E,v,m)}catch(w){this.lookupAsync=async()=>{let x=new Error("Cache Error. Please recreate the CacheableLookup instance.");throw x.cause=w,x}}b(this._cache)&&this._tick(m)}}async queryAndCache(E){if(this._hostnamesToFallback.has(E))return this._dnsLookup(E,g);let v=await this._resolve(E);v.entries.length===0&&this._fallback&&(v=await this._lookup(E),v.entries.length!==0&&this._hostnamesToFallback.add(E));let m=v.entries.length===0?this.errorTtl:v.cacheTtl;return await this._set(E,v.entries,m),v.entries}_tick(E){let v=this._nextRemovalTime;(!v||E<v)&&(clearTimeout(this._removalTimeout),this._nextRemovalTime=E,this._removalTimeout=setTimeout(()=>{this._nextRemovalTime=!1;let m=1/0,w=Date.now();for(let[x,A]of this._cache){let R=A[h];w>=R?this._cache.delete(x):R<m&&(m=R)}m!==1/0&&this._tick(m-w)},E),this._removalTimeout.unref&&this._removalTimeout.unref())}install(E){if(d(E),f in E)throw new Error("CacheableLookup has been already installed");E[f]=E.createConnection,E[c]=this,E.createConnection=(v,m)=>("lookup"in v||(v.lookup=this.lookup),E[f](v,m))}uninstall(E){if(d(E),E[f]){if(E[c]!==this)throw new Error("The agent is not owned by this CacheableLookup instance");E.createConnection=E[f],delete E[f],delete E[c]}}updateInterfaceInfo(){let{_iface:E}=this;this._iface=y(),(E.has4&&!this._iface.has4||E.has6&&!this._iface.has6)&&this._cache.clear()}clear(E){if(E){this._cache.delete(E);return}this._cache.clear()}};r.exports=S,r.exports.default=S}),yb=te((e,r)=>{"use strict";Z();var t="text/plain",n="us-ascii",i=(o,s)=>s.some(f=>f instanceof RegExp?f.test(o):f===o),l=(o,{stripHash:s})=>{let f=/^data:(?<type>[^,]*?),(?<data>[^#]*?)(?:#(?<hash>.*))?$/.exec(o);if(!f)throw new Error(`Invalid URL: ${o}`);let{type:c,data:h,hash:u}=f.groups,d=c.split(";");u=s?"":u;let p=!1;d[d.length-1]==="base64"&&(d.pop(),p=!0);let y=(d.shift()||"").toLowerCase(),b=[...d.map(_=>{let[g,S=""]=_.split("=").map(E=>E.trim());return g==="charset"&&(S=S.toLowerCase(),S===n)?"":`${g}${S?`=${S}`:""}`}).filter(Boolean)];return p&&b.push("base64"),(b.length!==0||y&&y!==t)&&b.unshift(y),`data:${b.join(";")},${p?h.trim():h}${u?`#${u}`:""}`},a=(o,s)=>{if(s={defaultProtocol:"http:",normalizeProtocol:!0,forceHttp:!1,forceHttps:!1,stripAuthentication:!0,stripHash:!1,stripTextFragment:!0,stripWWW:!0,removeQueryParameters:[/^utm_\w+/i],removeTrailingSlash:!0,removeSingleSlash:!0,removeDirectoryIndex:!1,sortQueryParameters:!0,...s},o=o.trim(),/^data:/i.test(o))return l(o,s);if(/^view-source:/i.test(o))throw new Error("`view-source:` is not supported as it is a non-standard protocol");let f=o.startsWith("//");!f&&/^\.*\//.test(o)||(o=o.replace(/^(?!(?:\w+:)?\/\/)|^\/\//,s.defaultProtocol));let c=new URL(o);if(s.forceHttp&&s.forceHttps)throw new Error("The `forceHttp` and `forceHttps` options cannot be used together");if(s.forceHttp&&c.protocol==="https:"&&(c.protocol="http:"),s.forceHttps&&c.protocol==="http:"&&(c.protocol="https:"),s.stripAuthentication&&(c.username="",c.password=""),s.stripHash?c.hash="":s.stripTextFragment&&(c.hash=c.hash.replace(/#?:~:text.*?$/i,"")),c.pathname&&(c.pathname=c.pathname.replace(/(?<!\b(?:[a-z][a-z\d+\-.]{1,50}:))\/{2,}/g,"/")),c.pathname)try{c.pathname=decodeURI(c.pathname)}catch{}if(s.removeDirectoryIndex===!0&&(s.removeDirectoryIndex=[/^index\.[a-z]+$/]),Array.isArray(s.removeDirectoryIndex)&&s.removeDirectoryIndex.length>0){let u=c.pathname.split("/"),d=u[u.length-1];i(d,s.removeDirectoryIndex)&&(u=u.slice(0,u.length-1),c.pathname=u.slice(1).join("/")+"/")}if(c.hostname&&(c.hostname=c.hostname.replace(/\.$/,""),s.stripWWW&&/^www\.(?!www\.)(?:[a-z\-\d]{1,63})\.(?:[a-z.\-\d]{2,63})$/.test(c.hostname)&&(c.hostname=c.hostname.replace(/^www\./,""))),Array.isArray(s.removeQueryParameters))for(let u of[...c.searchParams.keys()])i(u,s.removeQueryParameters)&&c.searchParams.delete(u);s.removeQueryParameters===!0&&(c.search=""),s.sortQueryParameters&&c.searchParams.sort(),s.removeTrailingSlash&&(c.pathname=c.pathname.replace(/\/$/,""));let h=o;return o=c.toString(),!s.removeSingleSlash&&c.pathname==="/"&&!h.endsWith("/")&&c.hash===""&&(o=o.replace(/\/$/,"")),(s.removeTrailingSlash||c.pathname==="/")&&c.hash===""&&s.removeSingleSlash&&(o=o.replace(/\/$/,"")),f&&!s.normalizeProtocol&&(o=o.replace(/^http:\/\//,"//")),s.stripProtocol&&(o=o.replace(/^(?:https?:)?\/\//,"")),o};r.exports=a}),gb=te((e,r)=>{Z(),r.exports=t;function t(n,i){if(n&&i)return t(n)(i);if(typeof n!="function")throw new TypeError("need wrapper function");return Object.keys(n).forEach(function(a){l[a]=n[a]}),l;function l(){for(var a=new Array(arguments.length),o=0;o<a.length;o++)a[o]=arguments[o];var s=n.apply(this,a),f=a[a.length-1];return typeof s=="function"&&s!==f&&Object.keys(f).forEach(function(c){s[c]=f[c]}),s}}}),of=te((e,r)=>{Z();var t=gb();r.exports=t(n),r.exports.strict=t(i),n.proto=n(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return n(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return i(this)},configurable:!0})});function n(l){var a=function(){return a.called?a.value:(a.called=!0,a.value=l.apply(this,arguments))};return a.called=!1,a}function i(l){var a=function(){if(a.called)throw new Error(a.onceError);return a.called=!0,a.value=l.apply(this,arguments)},o=l.name||"Function wrapped with `once`";return a.onceError=o+" shouldn't be called more than once",a.called=!1,a}}),bb=te((e,r)=>{Z();var t=of(),n=function(){},i=function(o){return o.setHeader&&typeof o.abort=="function"},l=function(o){return o.stdio&&Array.isArray(o.stdio)&&o.stdio.length===3},a=function(o,s,f){if(typeof s=="function")return a(o,null,s);s||(s={}),f=t(f||n);var c=o._writableState,h=o._readableState,u=s.readable||s.readable!==!1&&o.readable,d=s.writable||s.writable!==!1&&o.writable,p=!1,y=function(){o.writable||b()},b=function(){d=!1,u||f.call(o)},_=function(){u=!1,d||f.call(o)},g=function(w){f.call(o,w?new Error("exited with error code: "+w):null)},S=function(w){f.call(o,w)},E=function(){process.nextTick(v)},v=function(){if(!p){if(u&&!(h&&h.ended&&!h.destroyed))return f.call(o,new Error("premature close"));if(d&&!(c&&c.ended&&!c.destroyed))return f.call(o,new Error("premature close"))}},m=function(){o.req.on("finish",b)};return i(o)?(o.on("complete",b),o.on("abort",E),o.req?m():o.on("request",m)):d&&!c&&(o.on("end",y),o.on("close",y)),l(o)&&o.on("exit",g),o.on("end",_),o.on("finish",b),s.error!==!1&&o.on("error",S),o.on("close",E),function(){p=!0,o.removeListener("complete",b),o.removeListener("abort",E),o.removeListener("request",m),o.req&&o.req.removeListener("finish",b),o.removeListener("end",y),o.removeListener("close",y),o.removeListener("finish",b),o.removeListener("exit",g),o.removeListener("end",_),o.removeListener("error",S),o.removeListener("close",E)}};r.exports=a}),vb=te((e,r)=>{Z();var t=of(),n=bb(),i=he("fs"),l=function(){},a=/^v?\.0/.test(process.version),o=function(p){return typeof p=="function"},s=function(p){return!a||!i?!1:(p instanceof(i.ReadStream||l)||p instanceof(i.WriteStream||l))&&o(p.close)},f=function(p){return p.setHeader&&o(p.abort)},c=function(p,y,b,_){_=t(_);var g=!1;p.on("close",function(){g=!0}),n(p,{readable:y,writable:b},function(E){if(E)return _(E);g=!0,_()});var S=!1;return function(E){if(!g&&!S){if(S=!0,s(p))return p.close(l);if(f(p))return p.abort();if(o(p.destroy))return p.destroy();_(E||new Error("stream was destroyed"))}}},h=function(p){p()},u=function(p,y){return p.pipe(y)},d=function(){var p=Array.prototype.slice.call(arguments),y=o(p[p.length-1]||l)&&p.pop()||l;if(Array.isArray(p[0])&&(p=p[0]),p.length<2)throw new Error("pump requires two streams per minimum");var b,_=p.map(function(g,S){var E=S<p.length-1,v=S>0;return c(g,E,v,function(m){b||(b=m),m&&_.forEach(h),!E&&(_.forEach(h),y(b))})});return p.reduce(u)};r.exports=d}),_b=te((e,r)=>{"use strict";Z();var{PassThrough:t}=he("stream");r.exports=n=>{n={...n};let{array:i}=n,{encoding:l}=n,a=l==="buffer",o=!1;i?o=!(l||a):l=l||"utf8",a&&(l=null);let s=new t({objectMode:o});l&&s.setEncoding(l);let f=0,c=[];return s.on("data",h=>{c.push(h),o?f=c.length:f+=h.length}),s.getBufferedValue=()=>i?c:a?Buffer.concat(c,f):c.join(""),s.getBufferedLength=()=>f,s}}),wb=te((e,r)=>{"use strict";Z();var{constants:t}=he("buffer"),n=vb(),i=_b(),l=class extends Error{constructor(){super("maxBuffer exceeded"),this.name="MaxBufferError"}};async function a(o,s){if(!o)return Promise.reject(new Error("Expected a stream"));s={maxBuffer:1/0,...s};let{maxBuffer:f}=s,c;return await new Promise((h,u)=>{let d=p=>{p&&c.getBufferedLength()<=t.MAX_LENGTH&&(p.bufferedData=c.getBufferedValue()),u(p)};c=n(o,i(s),p=>{if(p){d(p);return}h()}),c.on("data",()=>{c.getBufferedLength()>f&&d(new l)})}),c.getBufferedValue()}r.exports=a,r.exports.default=a,r.exports.buffer=(o,s)=>a(o,{...s,encoding:"buffer"}),r.exports.array=(o,s)=>a(o,{...s,array:!0}),r.exports.MaxBufferError=l}),Eb=te((e,r)=>{"use strict";Z();var t=new Set([200,203,204,206,300,301,308,404,405,410,414,501]),n=new Set([200,203,204,300,301,302,303,307,308,404,405,410,414,501]),i=new Set([500,502,503,504]),l={date:!0,connection:!0,"keep-alive":!0,"proxy-authenticate":!0,"proxy-authorization":!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0},a={"content-length":!0,"content-encoding":!0,"transfer-encoding":!0,"content-range":!0};function o(h){let u=parseInt(h,10);return isFinite(u)?u:0}function s(h){return h?i.has(h.status):!0}function f(h){let u={};if(!h)return u;let d=h.trim().split(/,/);for(let p of d){let[y,b]=p.split(/=/,2);u[y.trim()]=b===void 0?!0:b.trim().replace(/^"|"$/g,"")}return u}function c(h){let u=[];for(let d in h){let p=h[d];u.push(p===!0?d:d+"="+p)}if(u.length)return u.join(", ")}r.exports=class{constructor(h,u,{shared:d,cacheHeuristic:p,immutableMinTimeToLive:y,ignoreCargoCult:b,_fromObject:_}={}){if(_){this._fromObject(_);return}if(!u||!u.headers)throw Error("Response headers missing");this._assertRequestHasHeaders(h),this._responseTime=this.now(),this._isShared=d!==!1,this._cacheHeuristic=p!==void 0?p:.1,this._immutableMinTtl=y!==void 0?y:24*3600*1e3,this._status="status"in u?u.status:200,this._resHeaders=u.headers,this._rescc=f(u.headers["cache-control"]),this._method="method"in h?h.method:"GET",this._url=h.url,this._host=h.headers.host,this._noAuthorization=!h.headers.authorization,this._reqHeaders=u.headers.vary?h.headers:null,this._reqcc=f(h.headers["cache-control"]),b&&"pre-check"in this._rescc&&"post-check"in this._rescc&&(delete this._rescc["pre-check"],delete this._rescc["post-check"],delete this._rescc["no-cache"],delete this._rescc["no-store"],delete this._rescc["must-revalidate"],this._resHeaders=Object.assign({},this._resHeaders,{"cache-control":c(this._rescc)}),delete this._resHeaders.expires,delete this._resHeaders.pragma),u.headers["cache-control"]==null&&/no-cache/.test(u.headers.pragma)&&(this._rescc["no-cache"]=!0)}now(){return Date.now()}storable(){return!!(!this._reqcc["no-store"]&&(this._method==="GET"||this._method==="HEAD"||this._method==="POST"&&this._hasExplicitExpiration())&&n.has(this._status)&&!this._rescc["no-store"]&&(!this._isShared||!this._rescc.private)&&(!this._isShared||this._noAuthorization||this._allowsStoringAuthenticated())&&(this._resHeaders.expires||this._rescc["max-age"]||this._isShared&&this._rescc["s-maxage"]||this._rescc.public||t.has(this._status)))}_hasExplicitExpiration(){return this._isShared&&this._rescc["s-maxage"]||this._rescc["max-age"]||this._resHeaders.expires}_assertRequestHasHeaders(h){if(!h||!h.headers)throw Error("Request headers missing")}satisfiesWithoutRevalidation(h){this._assertRequestHasHeaders(h);let u=f(h.headers["cache-control"]);return u["no-cache"]||/no-cache/.test(h.headers.pragma)||u["max-age"]&&this.age()>u["max-age"]||u["min-fresh"]&&this.timeToLive()<1e3*u["min-fresh"]||this.stale()&&!(u["max-stale"]&&!this._rescc["must-revalidate"]&&(u["max-stale"]===!0||u["max-stale"]>this.age()-this.maxAge()))?!1:this._requestMatches(h,!1)}_requestMatches(h,u){return(!this._url||this._url===h.url)&&this._host===h.headers.host&&(!h.method||this._method===h.method||u&&h.method==="HEAD")&&this._varyMatches(h)}_allowsStoringAuthenticated(){return this._rescc["must-revalidate"]||this._rescc.public||this._rescc["s-maxage"]}_varyMatches(h){if(!this._resHeaders.vary)return!0;if(this._resHeaders.vary==="*")return!1;let u=this._resHeaders.vary.trim().toLowerCase().split(/\s*,\s*/);for(let d of u)if(h.headers[d]!==this._reqHeaders[d])return!1;return!0}_copyWithoutHopByHopHeaders(h){let u={};for(let d in h)l[d]||(u[d]=h[d]);if(h.connection){let d=h.connection.trim().split(/\s*,\s*/);for(let p of d)delete u[p]}if(u.warning){let d=u.warning.split(/,/).filter(p=>!/^\s*1[0-9][0-9]/.test(p));d.length?u.warning=d.join(",").trim():delete u.warning}return u}responseHeaders(){let h=this._copyWithoutHopByHopHeaders(this._resHeaders),u=this.age();return u>3600*24&&!this._hasExplicitExpiration()&&this.maxAge()>3600*24&&(h.warning=(h.warning?`${h.warning}, `:"")+'113 - "rfc7234 5.5.4"'),h.age=`${Math.round(u)}`,h.date=new Date(this.now()).toUTCString(),h}date(){let h=Date.parse(this._resHeaders.date);return isFinite(h)?h:this._responseTime}age(){let h=this._ageValue(),u=(this.now()-this._responseTime)/1e3;return h+u}_ageValue(){return o(this._resHeaders.age)}maxAge(){if(!this.storable()||this._rescc["no-cache"]||this._isShared&&this._resHeaders["set-cookie"]&&!this._rescc.public&&!this._rescc.immutable||this._resHeaders.vary==="*")return 0;if(this._isShared){if(this._rescc["proxy-revalidate"])return 0;if(this._rescc["s-maxage"])return o(this._rescc["s-maxage"])}if(this._rescc["max-age"])return o(this._rescc["max-age"]);let h=this._rescc.immutable?this._immutableMinTtl:0,u=this.date();if(this._resHeaders.expires){let d=Date.parse(this._resHeaders.expires);return Number.isNaN(d)||d<u?0:Math.max(h,(d-u)/1e3)}if(this._resHeaders["last-modified"]){let d=Date.parse(this._resHeaders["last-modified"]);if(isFinite(d)&&u>d)return Math.max(h,(u-d)/1e3*this._cacheHeuristic)}return h}timeToLive(){let h=this.maxAge()-this.age(),u=h+o(this._rescc["stale-if-error"]),d=h+o(this._rescc["stale-while-revalidate"]);return Math.max(0,h,u,d)*1e3}stale(){return this.maxAge()<=this.age()}_useStaleIfError(){return this.maxAge()+o(this._rescc["stale-if-error"])>this.age()}useStaleWhileRevalidate(){return this.maxAge()+o(this._rescc["stale-while-revalidate"])>this.age()}static fromObject(h){return new this(void 0,void 0,{_fromObject:h})}_fromObject(h){if(this._responseTime)throw Error("Reinitialized");if(!h||h.v!==1)throw Error("Invalid serialization");this._responseTime=h.t,this._isShared=h.sh,this._cacheHeuristic=h.ch,this._immutableMinTtl=h.imm!==void 0?h.imm:24*3600*1e3,this._status=h.st,this._resHeaders=h.resh,this._rescc=h.rescc,this._method=h.m,this._url=h.u,this._host=h.h,this._noAuthorization=h.a,this._reqHeaders=h.reqh,this._reqcc=h.reqcc}toObject(){return{v:1,t:this._responseTime,sh:this._isShared,ch:this._cacheHeuristic,imm:this._immutableMinTtl,st:this._status,resh:this._resHeaders,rescc:this._rescc,m:this._method,u:this._url,h:this._host,a:this._noAuthorization,reqh:this._reqHeaders,reqcc:this._reqcc}}revalidationHeaders(h){this._assertRequestHasHeaders(h);let u=this._copyWithoutHopByHopHeaders(h.headers);if(delete u["if-range"],!this._requestMatches(h,!0)||!this.storable())return delete u["if-none-match"],delete u["if-modified-since"],u;if(this._resHeaders.etag&&(u["if-none-match"]=u["if-none-match"]?`${u["if-none-match"]}, ${this._resHeaders.etag}`:this._resHeaders.etag),u["accept-ranges"]||u["if-match"]||u["if-unmodified-since"]||this._method&&this._method!="GET"){if(delete u["if-modified-since"],u["if-none-match"]){let d=u["if-none-match"].split(/,/).filter(p=>!/^\s*W\//.test(p));d.length?u["if-none-match"]=d.join(",").trim():delete u["if-none-match"]}}else this._resHeaders["last-modified"]&&!u["if-modified-since"]&&(u["if-modified-since"]=this._resHeaders["last-modified"]);return u}revalidatedPolicy(h,u){if(this._assertRequestHasHeaders(h),this._useStaleIfError()&&s(u))return{modified:!1,matches:!1,policy:this};if(!u||!u.headers)throw Error("Response headers missing");let d=!1;if(u.status!==void 0&&u.status!=304?d=!1:u.headers.etag&&!/^\s*W\//.test(u.headers.etag)?d=this._resHeaders.etag&&this._resHeaders.etag.replace(/^\s*W\//,"")===u.headers.etag:this._resHeaders.etag&&u.headers.etag?d=this._resHeaders.etag.replace(/^\s*W\//,"")===u.headers.etag.replace(/^\s*W\//,""):this._resHeaders["last-modified"]?d=this._resHeaders["last-modified"]===u.headers["last-modified"]:!this._resHeaders.etag&&!this._resHeaders["last-modified"]&&!u.headers.etag&&!u.headers["last-modified"]&&(d=!0),!d)return{policy:new this.constructor(h,u),modified:u.status!=304,matches:!1};let p={};for(let b in this._resHeaders)p[b]=b in u.headers&&!a[b]?u.headers[b]:this._resHeaders[b];let y=Object.assign({},u,{status:this._status,method:this._method,headers:p});return{policy:new this.constructor(h,y,{shared:this._isShared,cacheHeuristic:this._cacheHeuristic,immutableMinTimeToLive:this._immutableMinTtl}),modified:!1,matches:!0}}}}),oa=te((e,r)=>{"use strict";Z(),r.exports=t=>{let n={};for(let[i,l]of Object.entries(t))n[i.toLowerCase()]=l;return n}}),Sb=te((e,r)=>{"use strict";Z();var t=he("stream").Readable,n=oa(),i=class extends t{constructor(l,a,o,s){if(typeof l!="number")throw new TypeError("Argument `statusCode` should be a number");if(typeof a!="object")throw new TypeError("Argument `headers` should be an object");if(!(o instanceof Buffer))throw new TypeError("Argument `body` should be a buffer");if(typeof s!="string")throw new TypeError("Argument `url` should be a string");super(),this.statusCode=l,this.headers=n(a),this.body=o,this.url=s}_read(){this.push(this.body),this.push(null)}};r.exports=i}),xb=te((e,r)=>{"use strict";Z();var t=["destroy","setTimeout","socket","headers","trailers","rawHeaders","statusCode","httpVersion","httpVersionMinor","httpVersionMajor","rawTrailers","statusMessage"];r.exports=(n,i)=>{let l=new Set(Object.keys(n).concat(t));for(let a of l)a in i||(i[a]=typeof n[a]=="function"?n[a].bind(n):n[a])}}),Ab=te((e,r)=>{"use strict";Z();var t=he("stream").PassThrough,n=xb(),i=l=>{if(!(l&&l.pipe))throw new TypeError("Parameter `response` must be a response stream.");let a=new t;return n(l,a),l.pipe(a)};r.exports=i}),Cb=te(e=>{Z(),e.stringify=function r(t){if(typeof t>"u")return t;if(t&&Buffer.isBuffer(t))return JSON.stringify(":base64:"+t.toString("base64"));if(t&&t.toJSON&&(t=t.toJSON()),t&&typeof t=="object"){var n="",i=Array.isArray(t);n=i?"[":"{";var l=!0;for(var a in t){var o=typeof t[a]=="function"||!i&&typeof t[a]>"u";Object.hasOwnProperty.call(t,a)&&!o&&(l||(n+=","),l=!1,i?t[a]==null?n+="null":n+=r(t[a]):t[a]!==void 0&&(n+=r(a)+":"+r(t[a])))}return n+=i?"]":"}",n}else return typeof t=="string"?JSON.stringify(/^:/.test(t)?":"+t:t):typeof t>"u"?"null":JSON.stringify(t)},e.parse=function(r){return JSON.parse(r,function(t,n){return typeof n=="string"?/^:base64:/.test(n)?Buffer.from(n.substring(8),"base64"):/^:/.test(n)?n.substring(1):n:n})}}),kb=te((e,r)=>{"use strict";Z();var t=he("events"),n=Cb(),i=o=>{let s={redis:"@keyv/redis",rediss:"@keyv/redis",mongodb:"@keyv/mongo",mongo:"@keyv/mongo",sqlite:"@keyv/sqlite",postgresql:"@keyv/postgres",postgres:"@keyv/postgres",mysql:"@keyv/mysql",etcd:"@keyv/etcd",offline:"@keyv/offline",tiered:"@keyv/tiered"};if(o.adapter||o.uri){let f=o.adapter||/^[^:+]*/.exec(o.uri)[0];return new(he(s[f]))(o)}return new Map},l=["sqlite","postgres","mysql","mongo","redis","tiered"],a=class extends t{constructor(o,{emitErrors:s=!0,...f}={}){if(super(),this.opts={namespace:"keyv",serialize:n.stringify,deserialize:n.parse,...typeof o=="string"?{uri:o}:o,...f},!this.opts.store){let h={...this.opts};this.opts.store=i(h)}if(this.opts.compression){let h=this.opts.compression;this.opts.serialize=h.serialize.bind(h),this.opts.deserialize=h.deserialize.bind(h)}typeof this.opts.store.on=="function"&&s&&this.opts.store.on("error",h=>this.emit("error",h)),this.opts.store.namespace=this.opts.namespace;let c=h=>async function*(){for await(let[u,d]of typeof h=="function"?h(this.opts.store.namespace):h){let p=this.opts.deserialize(d);if(!(this.opts.store.namespace&&!u.includes(this.opts.store.namespace))){if(typeof p.expires=="number"&&Date.now()>p.expires){this.delete(u);continue}yield[this._getKeyUnprefix(u),p.value]}}};typeof this.opts.store[Symbol.iterator]=="function"&&this.opts.store instanceof Map?this.iterator=c(this.opts.store):typeof this.opts.store.iterator=="function"&&this.opts.store.opts&&this._checkIterableAdaptar()&&(this.iterator=c(this.opts.store.iterator.bind(this.opts.store)))}_checkIterableAdaptar(){return l.includes(this.opts.store.opts.dialect)||l.findIndex(o=>this.opts.store.opts.url.includes(o))>=0}_getKeyPrefix(o){return`${this.opts.namespace}:${o}`}_getKeyPrefixArray(o){return o.map(s=>`${this.opts.namespace}:${s}`)}_getKeyUnprefix(o){return o.split(":").splice(1).join(":")}get(o,s){let{store:f}=this.opts,c=Array.isArray(o),h=c?this._getKeyPrefixArray(o):this._getKeyPrefix(o);if(c&&f.getMany===void 0){let u=[];for(let d of h)u.push(Promise.resolve().then(()=>f.get(d)).then(p=>typeof p=="string"?this.opts.deserialize(p):this.opts.compression?this.opts.deserialize(p):p).then(p=>{if(p!=null)return typeof p.expires=="number"&&Date.now()>p.expires?this.delete(d).then(()=>{}):s&&s.raw?p:p.value}));return Promise.allSettled(u).then(d=>{let p=[];for(let y of d)p.push(y.value);return p})}return Promise.resolve().then(()=>c?f.getMany(h):f.get(h)).then(u=>typeof u=="string"?this.opts.deserialize(u):this.opts.compression?this.opts.deserialize(u):u).then(u=>{if(u!=null){if(c){let d=[];for(let p of u){if(typeof p=="string"&&(p=this.opts.deserialize(p)),p==null){d.push(void 0);continue}typeof p.expires=="number"&&Date.now()>p.expires?(this.delete(o).then(()=>{}),d.push(void 0)):d.push(s&&s.raw?p:p.value)}return d}return typeof u.expires=="number"&&Date.now()>u.expires?this.delete(o).then(()=>{}):s&&s.raw?u:u.value}})}set(o,s,f){let c=this._getKeyPrefix(o);typeof f>"u"&&(f=this.opts.ttl),f===0&&(f=void 0);let{store:h}=this.opts;return Promise.resolve().then(()=>{let u=typeof f=="number"?Date.now()+f:null;return typeof s=="symbol"&&this.emit("error","symbol cannot be serialized"),s={value:s,expires:u},this.opts.serialize(s)}).then(u=>h.set(c,u,f)).then(()=>!0)}delete(o){let{store:s}=this.opts;if(Array.isArray(o)){let c=this._getKeyPrefixArray(o);if(s.deleteMany===void 0){let h=[];for(let u of c)h.push(s.delete(u));return Promise.allSettled(h).then(u=>u.every(d=>d.value===!0))}return Promise.resolve().then(()=>s.deleteMany(c))}let f=this._getKeyPrefix(o);return Promise.resolve().then(()=>s.delete(f))}clear(){let{store:o}=this.opts;return Promise.resolve().then(()=>o.clear())}has(o){let s=this._getKeyPrefix(o),{store:f}=this.opts;return Promise.resolve().then(async()=>typeof f.has=="function"?f.has(s):await f.get(s)!==void 0)}disconnect(){let{store:o}=this.opts;if(typeof o.disconnect=="function")return o.disconnect()}};r.exports=a}),Db=te((e,r)=>{"use strict";Z();var t=he("events"),n=he("url"),i=yb(),l=wb(),a=Eb(),o=Sb(),s=oa(),f=Ab(),c=kb(),h=class{constructor(p,y){if(typeof p!="function")throw new TypeError("Parameter `request` must be a function");return this.cache=new c({uri:typeof y=="string"&&y,store:typeof y!="string"&&y,namespace:"cacheable-request"}),this.createCacheableRequest(p)}createCacheableRequest(p){return(y,b)=>{let _;if(typeof y=="string")_=d(n.parse(y)),y={};else if(y instanceof n.URL)_=d(n.parse(y.toString())),y={};else{let[x,...A]=(y.path||"").split("?"),R=A.length>0?`?${A.join("?")}`:"";_=d({...y,pathname:x,search:R})}y={headers:{},method:"GET",cache:!0,strictTtl:!1,automaticFailover:!1,...y,...u(_)},y.headers=s(y.headers);let g=new t,S=i(n.format(_),{stripWWW:!1,removeTrailingSlash:!1,stripAuthentication:!1}),E=`${y.method}:${S}`,v=!1,m=!1,w=x=>{m=!0;let A=!1,R,B=new Promise(O=>{R=()=>{A||(A=!0,O())}}),P=O=>{if(v&&!x.forceRefresh){O.status=O.statusCode;let k=a.fromObject(v.cachePolicy).revalidatedPolicy(x,O);if(!k.modified){let M=k.policy.responseHeaders();O=new o(v.statusCode,M,v.body,v.url),O.cachePolicy=k.policy,O.fromCache=!0}}O.fromCache||(O.cachePolicy=new a(x,O,x),O.fromCache=!1);let D;x.cache&&O.cachePolicy.storable()?(D=f(O),(async()=>{try{let k=l.buffer(O);if(await Promise.race([B,new Promise(W=>O.once("end",W))]),A)return;let M=await k,L={cachePolicy:O.cachePolicy.toObject(),url:O.url,statusCode:O.fromCache?v.statusCode:O.statusCode,body:M},U=x.strictTtl?O.cachePolicy.timeToLive():void 0;x.maxTtl&&(U=U?Math.min(U,x.maxTtl):x.maxTtl),await this.cache.set(E,L,U)}catch(k){g.emit("error",new h.CacheError(k))}})()):x.cache&&v&&(async()=>{try{await this.cache.delete(E)}catch(k){g.emit("error",new h.CacheError(k))}})(),g.emit("response",D||O),typeof b=="function"&&b(D||O)};try{let O=p(x,P);O.once("error",R),O.once("abort",R),g.emit("request",O)}catch(O){g.emit("error",new h.RequestError(O))}};return(async()=>{let x=async R=>{await Promise.resolve();let B=R.cache?await this.cache.get(E):void 0;if(typeof B>"u")return w(R);let P=a.fromObject(B.cachePolicy);if(P.satisfiesWithoutRevalidation(R)&&!R.forceRefresh){let O=P.responseHeaders(),D=new o(B.statusCode,O,B.body,B.url);D.cachePolicy=P,D.fromCache=!0,g.emit("response",D),typeof b=="function"&&b(D)}else v=B,R.headers=P.revalidationHeaders(R),w(R)},A=R=>g.emit("error",new h.CacheError(R));this.cache.once("error",A),g.on("response",()=>this.cache.removeListener("error",A));try{await x(y)}catch(R){y.automaticFailover&&!m&&w(y),g.emit("error",new h.CacheError(R))}})(),g}}};function u(p){let y={...p};return y.path=`${p.pathname||"/"}${p.search||""}`,delete y.pathname,delete y.search,y}function d(p){return{protocol:p.protocol,auth:p.auth,hostname:p.hostname||p.host||"localhost",port:p.port,pathname:p.pathname,search:p.search}}h.RequestError=class extends Error{constructor(p){super(p.message),this.name="RequestError",Object.assign(this,p)}},h.CacheError=class extends Error{constructor(p){super(p.message),this.name="CacheError",Object.assign(this,p)}},r.exports=h}),Rb=te((e,r)=>{"use strict";Z();var t=["aborted","complete","headers","httpVersion","httpVersionMinor","httpVersionMajor","method","rawHeaders","rawTrailers","setTimeout","socket","statusCode","statusMessage","trailers","url"];r.exports=(n,i)=>{if(i._readableState.autoDestroy)throw new Error("The second stream must have the `autoDestroy` option set to `false`");let l=new Set(Object.keys(n).concat(t)),a={};for(let o of l)o in i||(a[o]={get(){let s=n[o];return typeof s=="function"?s.bind(n):s},set(s){n[o]=s},enumerable:!0,configurable:!1});return Object.defineProperties(i,a),n.once("aborted",()=>{i.destroy(),i.emit("aborted")}),n.once("close",()=>{n.complete&&i.readable?i.once("end",()=>{i.emit("close")}):i.emit("close")}),i}}),Ob=te((e,r)=>{"use strict";Z();var{Transform:t,PassThrough:n}=he("stream"),i=he("zlib"),l=Rb();r.exports=a=>{let o=(a.headers["content-encoding"]||"").toLowerCase();if(!["gzip","deflate","br"].includes(o))return a;let s=o==="br";if(s&&typeof i.createBrotliDecompress!="function")return a.destroy(new Error("Brotli is not supported on Node.js < 12")),a;let f=!0,c=new t({transform(d,p,y){f=!1,y(null,d)},flush(d){d()}}),h=new n({autoDestroy:!1,destroy(d,p){a.destroy(),p(d)}}),u=s?i.createBrotliDecompress():i.createUnzip();return u.once("error",d=>{if(f&&!a.readable){h.end();return}h.destroy(d)}),l(a,h),a.pipe(c).pipe(u).pipe(h),h}}),af=te((e,r)=>{"use strict";Z();var t=class{constructor(n={}){if(!(n.maxSize&&n.maxSize>0))throw new TypeError("`maxSize` must be a number greater than 0");this.maxSize=n.maxSize,this.onEviction=n.onEviction,this.cache=new Map,this.oldCache=new Map,this._size=0}_set(n,i){if(this.cache.set(n,i),this._size++,this._size>=this.maxSize){if(this._size=0,typeof this.onEviction=="function")for(let[l,a]of this.oldCache.entries())this.onEviction(l,a);this.oldCache=this.cache,this.cache=new Map}}get(n){if(this.cache.has(n))return this.cache.get(n);if(this.oldCache.has(n)){let i=this.oldCache.get(n);return this.oldCache.delete(n),this._set(n,i),i}}set(n,i){return this.cache.has(n)?this.cache.set(n,i):this._set(n,i),this}has(n){return this.cache.has(n)||this.oldCache.has(n)}peek(n){if(this.cache.has(n))return this.cache.get(n);if(this.oldCache.has(n))return this.oldCache.get(n)}delete(n){let i=this.cache.delete(n);return i&&this._size--,this.oldCache.delete(n)||i}clear(){this.cache.clear(),this.oldCache.clear(),this._size=0}*keys(){for(let[n]of this)yield n}*values(){for(let[,n]of this)yield n}*[Symbol.iterator](){for(let n of this.cache)yield n;for(let n of this.oldCache){let[i]=n;this.cache.has(i)||(yield n)}}get size(){let n=0;for(let i of this.oldCache.keys())this.cache.has(i)||n++;return Math.min(this._size+n,this.maxSize)}};r.exports=t}),uf=te((e,r)=>{"use strict";Z();var t=he("events"),n=he("tls"),i=he("http2"),l=af(),a=Symbol("currentStreamsCount"),o=Symbol("request"),s=Symbol("cachedOriginSet"),f=Symbol("gracefullyClosing"),c=["maxDeflateDynamicTableSize","maxSessionMemory","maxHeaderListPairs","maxOutstandingPings","maxReservedRemoteStreams","maxSendHeaderBlockLength","paddingStrategy","localAddress","path","rejectUnauthorized","minDHSize","ca","cert","clientCertEngine","ciphers","key","pfx","servername","minVersion","maxVersion","secureProtocol","crl","honorCipherOrder","ecdhCurve","dhparam","secureOptions","sessionIdContext"],h=(g,S,E)=>{let v=0,m=g.length;for(;v<m;){let w=v+m>>>1;E(g[w],S)?v=w+1:m=w}return v},u=(g,S)=>g.remoteSettings.maxConcurrentStreams>S.remoteSettings.maxConcurrentStreams,d=(g,S)=>{for(let E of g)E[s].length<S[s].length&&E[s].every(v=>S[s].includes(v))&&E[a]+S[a]<=S.remoteSettings.maxConcurrentStreams&&b(E)},p=(g,S)=>{for(let E of g)S[s].length<E[s].length&&S[s].every(v=>E[s].includes(v))&&S[a]+E[a]<=E.remoteSettings.maxConcurrentStreams&&b(S)},y=({agent:g,isFree:S})=>{let E={};for(let v in g.sessions){let m=g.sessions[v].filter(w=>{let x=w[_.kCurrentStreamsCount]<w.remoteSettings.maxConcurrentStreams;return S?x:!x});m.length!==0&&(E[v]=m)}return E},b=g=>{g[f]=!0,g[a]===0&&g.close()},_=class extends t{constructor({timeout:g=6e4,maxSessions:S=1/0,maxFreeSessions:E=10,maxCachedTlsSessions:v=100}={}){super(),this.sessions={},this.queue={},this.timeout=g,this.maxSessions=S,this.maxFreeSessions=E,this._freeSessionsCount=0,this._sessionsCount=0,this.settings={enablePush:!1},this.tlsSessionCache=new l({maxSize:v})}static normalizeOrigin(g,S){return typeof g=="string"&&(g=new URL(g)),S&&g.hostname!==S&&(g.hostname=S),g.origin}normalizeOptions(g){let S="";if(g)for(let E of c)g[E]&&(S+=`:${g[E]}`);return S}_tryToCreateNewSession(g,S){if(!(g in this.queue)||!(S in this.queue[g]))return;let E=this.queue[g][S];this._sessionsCount<this.maxSessions&&!E.completed&&(E.completed=!0,E())}getSession(g,S,E){return new Promise((v,m)=>{Array.isArray(E)?(E=[...E],v()):E=[{resolve:v,reject:m}];let w=this.normalizeOptions(S),x=_.normalizeOrigin(g,S&&S.servername);if(x===void 0){for(let{reject:B}of E)B(new TypeError("The `origin` argument needs to be a string or an URL object"));return}if(w in this.sessions){let B=this.sessions[w],P=-1,O=-1,D;for(let k of B){let M=k.remoteSettings.maxConcurrentStreams;if(M<P)break;if(k[s].includes(x)){let L=k[a];if(L>=M||k[f]||k.destroyed)continue;D||(P=M),L>O&&(D=k,O=L)}}if(D){if(E.length!==1){for(let{reject:k}of E){let M=new Error(`Expected the length of listeners to be 1, got ${E.length}.
|
|
118
118
|
Please report this to https://github.com/szmarczak/http2-wrapper/`);k(M)}return}E[0].resolve(D);return}}if(w in this.queue){if(x in this.queue[w]){this.queue[w][x].listeners.push(...E),this._tryToCreateNewSession(w,x);return}}else this.queue[w]={};let A=()=>{w in this.queue&&this.queue[w][x]===R&&(delete this.queue[w][x],Object.keys(this.queue[w]).length===0&&delete this.queue[w])},R=()=>{let B=`${x}:${w}`,P=!1;try{let O=i.connect(g,{createConnection:this.createConnection,settings:this.settings,session:this.tlsSessionCache.get(B),...S});O[a]=0,O[f]=!1;let D=()=>O[a]<O.remoteSettings.maxConcurrentStreams,k=!0;O.socket.once("session",L=>{this.tlsSessionCache.set(B,L)}),O.once("error",L=>{for(let{reject:U}of E)U(L);this.tlsSessionCache.delete(B)}),O.setTimeout(this.timeout,()=>{O.destroy()}),O.once("close",()=>{if(P){k&&this._freeSessionsCount--,this._sessionsCount--;let L=this.sessions[w];L.splice(L.indexOf(O),1),L.length===0&&delete this.sessions[w]}else{let L=new Error("Session closed without receiving a SETTINGS frame");L.code="HTTP2WRAPPER_NOSETTINGS";for(let{reject:U}of E)U(L);A()}this._tryToCreateNewSession(w,x)});let M=()=>{if(!(!(w in this.queue)||!D())){for(let L of O[s])if(L in this.queue[w]){let{listeners:U}=this.queue[w][L];for(;U.length!==0&&D();)U.shift().resolve(O);let W=this.queue[w];if(W[L].listeners.length===0&&(delete W[L],Object.keys(W).length===0)){delete this.queue[w];break}if(!D())break}}};O.on("origin",()=>{O[s]=O.originSet,D()&&(M(),d(this.sessions[w],O))}),O.once("remoteSettings",()=>{if(O.ref(),O.unref(),this._sessionsCount++,R.destroyed){let L=new Error("Agent has been destroyed");for(let U of E)U.reject(L);O.destroy();return}O[s]=O.originSet;{let L=this.sessions;if(w in L){let U=L[w];U.splice(h(U,O,u),0,O)}else L[w]=[O]}this._freeSessionsCount+=1,P=!0,this.emit("session",O),M(),A(),O[a]===0&&this._freeSessionsCount>this.maxFreeSessions&&O.close(),E.length!==0&&(this.getSession(x,S,E),E.length=0),O.on("remoteSettings",()=>{M(),d(this.sessions[w],O)})}),O[o]=O.request,O.request=(L,U)=>{if(O[f])throw new Error("The session is gracefully closing. No new streams are allowed.");let W=O[o](L,U);return O.ref(),++O[a],O[a]===O.remoteSettings.maxConcurrentStreams&&this._freeSessionsCount--,W.once("close",()=>{if(k=D(),--O[a],!O.destroyed&&!O.closed&&(p(this.sessions[w],O),D()&&!O.closed)){k||(this._freeSessionsCount++,k=!0);let se=O[a]===0;se&&O.unref(),se&&(this._freeSessionsCount>this.maxFreeSessions||O[f])?O.close():(d(this.sessions[w],O),M())}}),W}}catch(O){for(let D of E)D.reject(O);A()}};R.listeners=E,R.completed=!1,R.destroyed=!1,this.queue[w][x]=R,this._tryToCreateNewSession(w,x)})}request(g,S,E,v){return new Promise((m,w)=>{this.getSession(g,S,[{reject:w,resolve:x=>{try{m(x.request(E,v))}catch(A){w(A)}}}])})}createConnection(g,S){return _.connect(g,S)}static connect(g,S){S.ALPNProtocols=["h2"];let E=g.port||443,v=g.hostname||g.host;return typeof S.servername>"u"&&(S.servername=v),n.connect(E,v,S)}closeFreeSessions(){for(let g of Object.values(this.sessions))for(let S of g)S[a]===0&&S.close()}destroy(g){for(let S of Object.values(this.sessions))for(let E of S)E.destroy(g);for(let S of Object.values(this.queue))for(let E of Object.values(S))E.destroyed=!0;this.queue={}}get freeSessions(){return y({agent:this,isFree:!0})}get busySessions(){return y({agent:this,isFree:!1})}};_.kCurrentStreamsCount=a,_.kGracefullyClosing=f,r.exports={Agent:_,globalAgent:new _}}),lf=te((e,r)=>{"use strict";Z();var{Readable:t}=he("stream"),n=class extends t{constructor(i,l){super({highWaterMark:l,autoDestroy:!1}),this.statusCode=null,this.statusMessage="",this.httpVersion="2.0",this.httpVersionMajor=2,this.httpVersionMinor=0,this.headers={},this.trailers={},this.req=null,this.aborted=!1,this.complete=!1,this.upgrade=null,this.rawHeaders=[],this.rawTrailers=[],this.socket=i,this.connection=i,this._dumped=!1}_destroy(i){this.req._request.destroy(i)}setTimeout(i,l){return this.req.setTimeout(i,l),this}_dump(){this._dumped||(this._dumped=!0,this.removeAllListeners("data"),this.resume())}_read(){this.req&&this.req._request.resume()}};r.exports=n}),cf=te((e,r)=>{"use strict";Z(),r.exports=t=>{let n={protocol:t.protocol,hostname:typeof t.hostname=="string"&&t.hostname.startsWith("[")?t.hostname.slice(1,-1):t.hostname,host:t.host,hash:t.hash,search:t.search,pathname:t.pathname,href:t.href,path:`${t.pathname||""}${t.search||""}`};return typeof t.port=="string"&&t.port.length!==0&&(n.port=Number(t.port)),(t.username||t.password)&&(n.auth=`${t.username||""}:${t.password||""}`),n}}),Tb=te((e,r)=>{"use strict";Z(),r.exports=(t,n,i)=>{for(let l of i)t.on(l,(...a)=>n.emit(l,...a))}}),Fb=te((e,r)=>{"use strict";Z(),r.exports=t=>{switch(t){case":method":case":scheme":case":authority":case":path":return!0;default:return!1}}}),Pb=te((e,r)=>{"use strict";Z();var t=(n,i,l)=>{r.exports[i]=class extends n{constructor(...a){super(typeof l=="string"?l:l(a)),this.name=`${super.name} [${i}]`,this.code=i}}};t(TypeError,"ERR_INVALID_ARG_TYPE",n=>{let i=n[0].includes(".")?"property":"argument",l=n[1],a=Array.isArray(l);return a&&(l=`${l.slice(0,-1).join(", ")} or ${l.slice(-1)}`),`The "${n[0]}" ${i} must be ${a?"one of":"of"} type ${l}. Received ${typeof n[2]}`}),t(TypeError,"ERR_INVALID_PROTOCOL",n=>`Protocol "${n[0]}" not supported. Expected "${n[1]}"`),t(Error,"ERR_HTTP_HEADERS_SENT",n=>`Cannot ${n[0]} headers after they are sent to the client`),t(TypeError,"ERR_INVALID_HTTP_TOKEN",n=>`${n[0]} must be a valid HTTP token [${n[1]}]`),t(TypeError,"ERR_HTTP_INVALID_HEADER_VALUE",n=>`Invalid value "${n[0]} for header "${n[1]}"`),t(TypeError,"ERR_INVALID_CHAR",n=>`Invalid character in ${n[0]} [${n[1]}]`)}),hf=te((e,r)=>{"use strict";Z();var t=he("http2"),{Writable:n}=he("stream"),{Agent:i,globalAgent:l}=uf(),a=lf(),o=cf(),s=Tb(),f=Fb(),{ERR_INVALID_ARG_TYPE:c,ERR_INVALID_PROTOCOL:h,ERR_HTTP_HEADERS_SENT:u,ERR_INVALID_HTTP_TOKEN:d,ERR_HTTP_INVALID_HEADER_VALUE:p,ERR_INVALID_CHAR:y}=Pb(),{HTTP2_HEADER_STATUS:b,HTTP2_HEADER_METHOD:_,HTTP2_HEADER_PATH:g,HTTP2_METHOD_CONNECT:S}=t.constants,E=Symbol("headers"),v=Symbol("origin"),m=Symbol("session"),w=Symbol("options"),x=Symbol("flushedHeaders"),A=Symbol("jobs"),R=/^[\^`\-\w!#$%&*+.|~]+$/,B=/[^\t\u0020-\u007E\u0080-\u00FF]/,P=class extends n{constructor(O,D,k){super({autoDestroy:!1});let M=typeof O=="string"||O instanceof URL;if(M&&(O=o(O instanceof URL?O:new URL(O))),typeof D=="function"||D===void 0?(k=D,D=M?O:{...O}):D={...O,...D},D.h2session)this[m]=D.h2session;else if(D.agent===!1)this.agent=new i({maxFreeSessions:0});else if(typeof D.agent>"u"||D.agent===null)typeof D.createConnection=="function"?(this.agent=new i({maxFreeSessions:0}),this.agent.createConnection=D.createConnection):this.agent=l;else if(typeof D.agent.request=="function")this.agent=D.agent;else throw new c("options.agent",["Agent-like Object","undefined","false"],D.agent);if(D.protocol&&D.protocol!=="https:")throw new h(D.protocol,"https:");let L=D.port||D.defaultPort||this.agent&&this.agent.defaultPort||443,U=D.hostname||D.host||"localhost";delete D.hostname,delete D.host,delete D.port;let{timeout:W}=D;if(D.timeout=void 0,this[E]=Object.create(null),this[A]=[],this.socket=null,this.connection=null,this.method=D.method||"GET",this.path=D.path,this.res=null,this.aborted=!1,this.reusedSocket=!1,D.headers)for(let[se,I]of Object.entries(D.headers))this.setHeader(se,I);D.auth&&!("authorization"in this[E])&&(this[E].authorization="Basic "+Buffer.from(D.auth).toString("base64")),D.session=D.tlsSession,D.path=D.socketPath,this[w]=D,L===443?(this[v]=`https://${U}`,":authority"in this[E]||(this[E][":authority"]=U)):(this[v]=`https://${U}:${L}`,":authority"in this[E]||(this[E][":authority"]=`${U}:${L}`)),W&&this.setTimeout(W),k&&this.once("response",k),this[x]=!1}get method(){return this[E][_]}set method(O){O&&(this[E][_]=O.toUpperCase())}get path(){return this[E][g]}set path(O){O&&(this[E][g]=O)}get _mustNotHaveABody(){return this.method==="GET"||this.method==="HEAD"||this.method==="DELETE"}_write(O,D,k){if(this._mustNotHaveABody){k(new Error("The GET, HEAD and DELETE methods must NOT have a body"));return}this.flushHeaders();let M=()=>this._request.write(O,D,k);this._request?M():this[A].push(M)}_final(O){if(this.destroyed)return;this.flushHeaders();let D=()=>{if(this._mustNotHaveABody){O();return}this._request.end(O)};this._request?D():this[A].push(D)}abort(){this.res&&this.res.complete||(this.aborted||process.nextTick(()=>this.emit("abort")),this.aborted=!0,this.destroy())}_destroy(O,D){this.res&&this.res._dump(),this._request&&this._request.destroy(),D(O)}async flushHeaders(){if(this[x]||this.destroyed)return;this[x]=!0;let O=this.method===S,D=k=>{if(this._request=k,this.destroyed){k.destroy();return}O||s(k,this,["timeout","continue","close","error"]);let M=U=>(...W)=>{!this.writable&&!this.destroyed?U(...W):this.once("finish",()=>{U(...W)})};k.once("response",M((U,W,se)=>{let I=new a(this.socket,k.readableHighWaterMark);this.res=I,I.req=this,I.statusCode=U[b],I.headers=U,I.rawHeaders=se,I.once("end",()=>{this.aborted?(I.aborted=!0,I.emit("aborted")):(I.complete=!0,I.socket=null,I.connection=null)}),O?(I.upgrade=!0,this.emit("connect",I,k,Buffer.alloc(0))?this.emit("close"):k.destroy()):(k.on("data",N=>{!I._dumped&&!I.push(N)&&k.pause()}),k.once("end",()=>{I.push(null)}),this.emit("response",I)||I._dump())})),k.once("headers",M(U=>this.emit("information",{statusCode:U[b]}))),k.once("trailers",M((U,W,se)=>{let{res:I}=this;I.trailers=U,I.rawTrailers=se}));let{socket:L}=k.session;this.socket=L,this.connection=L;for(let U of this[A])U();this.emit("socket",this.socket)};if(this[m])try{D(this[m].request(this[E]))}catch(k){this.emit("error",k)}else{this.reusedSocket=!0;try{D(await this.agent.request(this[v],this[w],this[E]))}catch(k){this.emit("error",k)}}}getHeader(O){if(typeof O!="string")throw new c("name","string",O);return this[E][O.toLowerCase()]}get headersSent(){return this[x]}removeHeader(O){if(typeof O!="string")throw new c("name","string",O);if(this.headersSent)throw new u("remove");delete this[E][O.toLowerCase()]}setHeader(O,D){if(this.headersSent)throw new u("set");if(typeof O!="string"||!R.test(O)&&!f(O))throw new d("Header name",O);if(typeof D>"u")throw new p(D,O);if(B.test(D))throw new y("header content",O);this[E][O.toLowerCase()]=D}setNoDelay(){}setSocketKeepAlive(){}setTimeout(O,D){let k=()=>this._request.setTimeout(O,D);return this._request?k():this[A].push(k),this}get maxHeadersCount(){if(!this.destroyed&&this._request)return this._request.session.localSettings.maxHeaderListSize}set maxHeadersCount(O){}};r.exports=P}),Bb=te((e,r)=>{"use strict";Z();var t=he("tls");r.exports=(n={},i=t.connect)=>new Promise((l,a)=>{let o=!1,s,f=async()=>{await h,s.off("timeout",c),s.off("error",a),n.resolveSocket?(l({alpnProtocol:s.alpnProtocol,socket:s,timeout:o}),o&&(await Promise.resolve(),s.emit("timeout"))):(s.destroy(),l({alpnProtocol:s.alpnProtocol,timeout:o}))},c=async()=>{o=!0,f()},h=(async()=>{try{s=await i(n,f),s.on("error",a),s.once("timeout",c)}catch(u){a(u)}})()})}),Ib=te((e,r)=>{"use strict";Z();var t=he("net");r.exports=n=>{let i=n.host,l=n.headers&&n.headers.host;return l&&(l.startsWith("[")?l.indexOf("]")===-1?i=l:i=l.slice(1,-1):i=l.split(":",1)[0]),t.isIP(i)?"":i}}),Lb=te((e,r)=>{"use strict";Z();var t=he("http"),n=he("https"),i=Bb(),l=af(),a=hf(),o=Ib(),s=cf(),f=new l({maxSize:100}),c=new Map,h=(d,p,y)=>{p._httpMessage={shouldKeepAlive:!0};let b=()=>{d.emit("free",p,y)};p.on("free",b);let _=()=>{d.removeSocket(p,y)};p.on("close",_);let g=()=>{d.removeSocket(p,y),p.off("close",_),p.off("free",b),p.off("agentRemove",g)};p.on("agentRemove",g),d.emit("free",p,y)},u=async d=>{let p=`${d.host}:${d.port}:${d.ALPNProtocols.sort()}`;if(!f.has(p)){if(c.has(p))return(await c.get(p)).alpnProtocol;let{path:y,agent:b}=d;d.path=d.socketPath;let _=i(d);c.set(p,_);try{let{socket:g,alpnProtocol:S}=await _;if(f.set(p,S),d.path=y,S==="h2")g.destroy();else{let{globalAgent:E}=n,v=n.Agent.prototype.createConnection;b?b.createConnection===v?h(b,g,d):g.destroy():E.createConnection===v?h(E,g,d):g.destroy()}return c.delete(p),S}catch(g){throw c.delete(p),g}}return f.get(p)};r.exports=async(d,p,y)=>{if((typeof d=="string"||d instanceof URL)&&(d=s(new URL(d))),typeof p=="function"&&(y=p,p=void 0),p={ALPNProtocols:["h2","http/1.1"],...d,...p,resolveSocket:!0},!Array.isArray(p.ALPNProtocols)||p.ALPNProtocols.length===0)throw new Error("The `ALPNProtocols` option must be an Array with at least one entry");p.protocol=p.protocol||"https:";let b=p.protocol==="https:";p.host=p.hostname||p.host||"localhost",p.session=p.tlsSession,p.servername=p.servername||o(p),p.port=p.port||(b?443:80),p._defaultAgent=b?n.globalAgent:t.globalAgent;let _=p.agent;if(_){if(_.addRequest)throw new Error("The `options.agent` object can contain only `http`, `https` or `http2` properties");p.agent=_[b?"https":"http"]}return b&&await u(p)==="h2"?(_&&(p.agent=_.http2),new a(p,y)):t.request(p,y)},r.exports.protocolCache=f}),Mb=te((e,r)=>{"use strict";Z();var t=he("http2"),n=uf(),i=hf(),l=lf(),a=Lb(),o=(f,c,h)=>new i(f,c,h),s=(f,c,h)=>{let u=new i(f,c,h);return u.end(),u};r.exports={...t,ClientRequest:i,IncomingMessage:l,...n,request:o,get:s,auto:a}}),ff=te(e=>{"use strict";Z(),Object.defineProperty(e,"__esModule",{value:!0});var r=hr();e.default=t=>r.default.nodeStream(t)&&r.default.function_(t.getBoundary)}),Nb=te(e=>{"use strict";Z(),Object.defineProperty(e,"__esModule",{value:!0});var r=he("fs"),t=he("util"),n=hr(),i=ff(),l=t.promisify(r.stat);e.default=async(a,o)=>{if(o&&"content-length"in o)return Number(o["content-length"]);if(!a)return 0;if(n.default.string(a))return Buffer.byteLength(a);if(n.default.buffer(a))return a.length;if(i.default(a))return t.promisify(a.getLength.bind(a))();if(a instanceof r.ReadStream){let{size:s}=await l(a.path);return s===0?void 0:s}}}),pf=te(e=>{"use strict";Z(),Object.defineProperty(e,"__esModule",{value:!0});function r(t,n,i){let l={};for(let a of i)l[a]=(...o)=>{n.emit(a,...o)},t.on(a,l[a]);return()=>{for(let a of i)t.off(a,l[a])}}e.default=r}),jb=te(e=>{"use strict";Z(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=()=>{let r=[];return{once(t,n,i){t.once(n,i),r.push({origin:t,event:n,fn:i})},unhandleAll(){for(let t of r){let{origin:n,event:i,fn:l}=t;n.removeListener(i,l)}r.length=0}}}}),$b=te(e=>{"use strict";Z(),Object.defineProperty(e,"__esModule",{value:!0}),e.TimeoutError=void 0;var r=he("net"),t=jb(),n=Symbol("reentry"),i=()=>{},l=class extends Error{constructor(a,o){super(`Timeout awaiting '${o}' for ${a}ms`),this.event=o,this.name="TimeoutError",this.code="ETIMEDOUT"}};e.TimeoutError=l,e.default=(a,o,s)=>{if(n in a)return i;a[n]=!0;let f=[],{once:c,unhandleAll:h}=t.default(),u=(_,g,S)=>{var E;let v=setTimeout(g,_,_,S);(E=v.unref)===null||E===void 0||E.call(v);let m=()=>{clearTimeout(v)};return f.push(m),m},{host:d,hostname:p}=s,y=(_,g)=>{a.destroy(new l(_,g))},b=()=>{for(let _ of f)_();h()};if(a.once("error",_=>{if(b(),a.listenerCount("error")===0)throw _}),a.once("close",b),c(a,"response",_=>{c(_,"end",b)}),typeof o.request<"u"&&u(o.request,y,"request"),typeof o.socket<"u"){let _=()=>{y(o.socket,"socket")};a.setTimeout(o.socket,_),f.push(()=>{a.removeListener("timeout",_)})}return c(a,"socket",_=>{var g;let{socketPath:S}=a;if(_.connecting){let E=!!(S!=null?S:r.isIP((g=p!=null?p:d)!==null&&g!==void 0?g:"")!==0);if(typeof o.lookup<"u"&&!E&&typeof _.address().address>"u"){let v=u(o.lookup,y,"lookup");c(_,"lookup",v)}if(typeof o.connect<"u"){let v=()=>u(o.connect,y,"connect");E?c(_,"connect",v()):c(_,"lookup",m=>{m===null&&c(_,"connect",v())})}typeof o.secureConnect<"u"&&s.protocol==="https:"&&c(_,"connect",()=>{let v=u(o.secureConnect,y,"secureConnect");c(_,"secureConnect",v)})}if(typeof o.send<"u"){let E=()=>u(o.send,y,"send");_.connecting?c(_,"connect",()=>{c(a,"upload-complete",E())}):c(a,"upload-complete",E())}}),typeof o.response<"u"&&c(a,"upload-complete",()=>{let _=u(o.response,y,"response");c(a,"response",_)}),b}}),Hb=te(e=>{"use strict";Z(),Object.defineProperty(e,"__esModule",{value:!0});var r=hr();e.default=t=>{t=t;let n={protocol:t.protocol,hostname:r.default.string(t.hostname)&&t.hostname.startsWith("[")?t.hostname.slice(1,-1):t.hostname,host:t.host,hash:t.hash,search:t.search,pathname:t.pathname,href:t.href,path:`${t.pathname||""}${t.search||""}`};return r.default.string(t.port)&&t.port.length>0&&(n.port=Number(t.port)),(t.username||t.password)&&(n.auth=`${t.username||""}:${t.password||""}`),n}}),qb=te(e=>{"use strict";Z(),Object.defineProperty(e,"__esModule",{value:!0});var r=he("url"),t=["protocol","host","hostname","port","pathname","search"];e.default=(n,i)=>{var l,a;if(i.path){if(i.pathname)throw new TypeError("Parameters `path` and `pathname` are mutually exclusive.");if(i.search)throw new TypeError("Parameters `path` and `search` are mutually exclusive.");if(i.searchParams)throw new TypeError("Parameters `path` and `searchParams` are mutually exclusive.")}if(i.search&&i.searchParams)throw new TypeError("Parameters `search` and `searchParams` are mutually exclusive.");if(!n){if(!i.protocol)throw new TypeError("No URL protocol specified");n=`${i.protocol}//${(a=(l=i.hostname)!==null&&l!==void 0?l:i.host)!==null&&a!==void 0?a:""}`}let o=new r.URL(n);if(i.path){let s=i.path.indexOf("?");s===-1?i.pathname=i.path:(i.pathname=i.path.slice(0,s),i.search=i.path.slice(s+1)),delete i.path}for(let s of t)i[s]&&(o[s]=i[s].toString());return o}}),Ub=te(e=>{"use strict";Z(),Object.defineProperty(e,"__esModule",{value:!0});var r=class{constructor(){this.weakMap=new WeakMap,this.map=new Map}set(t,n){typeof t=="object"?this.weakMap.set(t,n):this.map.set(t,n)}get(t){return typeof t=="object"?this.weakMap.get(t):this.map.get(t)}has(t){return typeof t=="object"?this.weakMap.has(t):this.map.has(t)}};e.default=r}),df=te(e=>{"use strict";Z(),Object.defineProperty(e,"__esModule",{value:!0});var r=async t=>{let n=[],i=0;for await(let l of t)n.push(l),i+=Buffer.byteLength(l);return Buffer.isBuffer(n[0])?Buffer.concat(n,i):Buffer.from(n.join(""))};e.default=r}),Gb=te(e=>{"use strict";Z(),Object.defineProperty(e,"__esModule",{value:!0}),e.dnsLookupIpVersionToFamily=e.isDnsLookupIpVersion=void 0;var r={auto:0,ipv4:4,ipv6:6};e.isDnsLookupIpVersion=t=>t in r,e.dnsLookupIpVersionToFamily=t=>{if(e.isDnsLookupIpVersion(t))return r[t];throw new Error("Invalid DNS lookup IP version")}}),mf=te(e=>{"use strict";Z(),Object.defineProperty(e,"__esModule",{value:!0}),e.isResponseOk=void 0,e.isResponseOk=r=>{let{statusCode:t}=r,n=r.request.options.followRedirect?299:399;return t>=200&&t<=n||t===304}}),Wb=te(e=>{"use strict";Z(),Object.defineProperty(e,"__esModule",{value:!0});var r=new Set;e.default=t=>{r.has(t)||(r.add(t),process.emitWarning(`Got: ${t}`,{type:"DeprecationWarning"}))}}),zb=te(e=>{"use strict";Z(),Object.defineProperty(e,"__esModule",{value:!0});var r=hr(),t=(n,i)=>{if(r.default.null_(n.encoding))throw new TypeError("To get a Buffer, set `options.responseType` to `buffer` instead");r.assert.any([r.default.string,r.default.undefined],n.encoding),r.assert.any([r.default.boolean,r.default.undefined],n.resolveBodyOnly),r.assert.any([r.default.boolean,r.default.undefined],n.methodRewriting),r.assert.any([r.default.boolean,r.default.undefined],n.isStream),r.assert.any([r.default.string,r.default.undefined],n.responseType),n.responseType===void 0&&(n.responseType="text");let{retry:l}=n;if(i?n.retry={...i.retry}:n.retry={calculateDelay:a=>a.computedValue,limit:0,methods:[],statusCodes:[],errorCodes:[],maxRetryAfter:void 0},r.default.object(l)?(n.retry={...n.retry,...l},n.retry.methods=[...new Set(n.retry.methods.map(a=>a.toUpperCase()))],n.retry.statusCodes=[...new Set(n.retry.statusCodes)],n.retry.errorCodes=[...new Set(n.retry.errorCodes)]):r.default.number(l)&&(n.retry.limit=l),r.default.undefined(n.retry.maxRetryAfter)&&(n.retry.maxRetryAfter=Math.min(...[n.timeout.request,n.timeout.connect].filter(r.default.number))),r.default.object(n.pagination)){i&&(n.pagination={...i.pagination,...n.pagination});let{pagination:a}=n;if(!r.default.function_(a.transform))throw new Error("`options.pagination.transform` must be implemented");if(!r.default.function_(a.shouldContinue))throw new Error("`options.pagination.shouldContinue` must be implemented");if(!r.default.function_(a.filter))throw new TypeError("`options.pagination.filter` must be implemented");if(!r.default.function_(a.paginate))throw new Error("`options.pagination.paginate` must be implemented")}return n.responseType==="json"&&n.headers.accept===void 0&&(n.headers.accept="application/json"),n};e.default=t}),Vb=te(e=>{"use strict";Z(),Object.defineProperty(e,"__esModule",{value:!0}),e.retryAfterStatusCodes=void 0,e.retryAfterStatusCodes=new Set([413,429,503]);var r=({attemptCount:t,retryOptions:n,error:i,retryAfter:l})=>{if(t>n.limit)return 0;let a=n.methods.includes(i.options.method),o=n.errorCodes.includes(i.code),s=i.response&&n.statusCodes.includes(i.response.statusCode);if(!a||!o&&!s)return 0;if(i.response){if(l)return n.maxRetryAfter===void 0||l>n.maxRetryAfter?0:l;if(i.response.statusCode===413)return 0}let f=Math.random()*100;return 2**(t-1)*1e3+f};e.default=r}),es=te(e=>{"use strict";Z(),Object.defineProperty(e,"__esModule",{value:!0}),e.UnsupportedProtocolError=e.ReadError=e.TimeoutError=e.UploadError=e.CacheError=e.HTTPError=e.MaxRedirectsError=e.RequestError=e.setNonEnumerableProperties=e.knownHookEvents=e.withoutBody=e.kIsNormalizedAlready=void 0;var r=he("util"),t=he("stream"),n=he("fs"),i=he("url"),l=he("http"),a=he("http"),o=he("https"),s=db(),f=mb(),c=Db(),h=Ob(),u=Mb(),d=oa(),p=hr(),y=Nb(),b=ff(),_=pf(),g=$b(),S=Hb(),E=qb(),v=Ub(),m=df(),w=Gb(),x=mf(),A=Wb(),R=zb(),B=Vb(),P,O=Symbol("request"),D=Symbol("response"),k=Symbol("responseSize"),M=Symbol("downloadedSize"),L=Symbol("bodySize"),U=Symbol("uploadedSize"),W=Symbol("serverResponsesPiped"),se=Symbol("unproxyEvents"),I=Symbol("isFromCache"),N=Symbol("cancelTimeouts"),F=Symbol("startedReading"),V=Symbol("stopReading"),G=Symbol("triggerRead"),J=Symbol("body"),j=Symbol("jobs"),z=Symbol("originalResponse"),Q=Symbol("retryTimeout");e.kIsNormalizedAlready=Symbol("isNormalizedAlready");var le=p.default.string(process.versions.brotli);e.withoutBody=new Set(["GET","HEAD"]),e.knownHookEvents=["init","beforeRequest","beforeRedirect","beforeError","beforeRetry","afterResponse"];function ue(K){for(let $ in K){let ce=K[$];if(!p.default.string(ce)&&!p.default.number(ce)&&!p.default.boolean(ce)&&!p.default.null_(ce)&&!p.default.undefined(ce))throw new TypeError(`The \`searchParams\` value '${String(ce)}' must be a string, number, boolean or null`)}}function Y(K){return p.default.object(K)&&!("statusCode"in K)}var ne=new v.default,T=async K=>new Promise(($,ce)=>{let we=be=>{ce(be)};K.pending||$(),K.once("error",we),K.once("ready",()=>{K.off("error",we),$()})}),q=new Set([300,301,302,303,304,307,308]),C=["context","body","json","form"];e.setNonEnumerableProperties=(K,$)=>{let ce={};for(let we of K)if(we)for(let be of C)be in we&&(ce[be]={writable:!0,configurable:!0,enumerable:!1,value:we[be]});Object.defineProperties($,ce)};var H=class extends Error{constructor(K,$,ce){var we,be;if(super(K),Error.captureStackTrace(this,this.constructor),this.name="RequestError",this.code=(we=$.code)!==null&&we!==void 0?we:"ERR_GOT_REQUEST_ERROR",ce instanceof Ce?(Object.defineProperty(this,"request",{enumerable:!1,value:ce}),Object.defineProperty(this,"response",{enumerable:!1,value:ce[D]}),Object.defineProperty(this,"options",{enumerable:!1,value:ce.options})):Object.defineProperty(this,"options",{enumerable:!1,value:ce}),this.timings=(be=this.request)===null||be===void 0?void 0:be.timings,p.default.string($.stack)&&p.default.string(this.stack)){let de=this.stack.indexOf(this.message)+this.message.length,ve=this.stack.slice(de).split(`
|
|
119
119
|
`).reverse(),Se=$.stack.slice($.stack.indexOf($.message)+$.message.length).split(`
|
|
120
120
|
`).reverse();for(;Se.length!==0&&Se[0]===ve[0];)ve.shift();this.stack=`${this.stack.slice(0,de)}${ve.reverse().join(`
|
|
@@ -201,7 +201,7 @@ ${s.message}`:S,m=[v,a,l].filter(Boolean).join(`
|
|
|
201
201
|
`+e.slice(i,l),i=l+1),a=o;return s+=`
|
|
202
202
|
`,e.length-i>r&&a>i?s+=e.slice(i,a)+`
|
|
203
203
|
`+e.slice(a+1):s+=e.slice(i),s.slice(1)}function dA(e){for(var r="",t=0,n,i=0;i<e.length;t>=65536?i+=2:i++)t=ci(e,i),n=lt[t],!n&&mi(t)?(r+=e[i],t>=65536&&(r+=e[i+1])):r+=n||sA(t);return r}function mA(e,r,t){var n="",i=e.tag,l,a,o;for(l=0,a=t.length;l<a;l+=1)o=t[l],e.replacer&&(o=e.replacer.call(t,String(l),o)),(ir(e,r,o,!1,!1)||typeof o>"u"&&ir(e,r,null,!1,!1))&&(n!==""&&(n+=","+(e.condenseFlow?"":" ")),n+=e.dump);e.tag=i,e.dump="["+n+"]"}function gp(e,r,t,n){var i="",l=e.tag,a,o,s;for(a=0,o=t.length;a<o;a+=1)s=t[a],e.replacer&&(s=e.replacer.call(t,String(a),s)),(ir(e,r+1,s,!0,!0,!1,!0)||typeof s>"u"&&ir(e,r+1,null,!0,!0,!1,!0))&&((!n||i!=="")&&(i+=Ya(e,r)),e.dump&&pi===e.dump.charCodeAt(0)?i+="-":i+="- ",i+=e.dump);e.tag=l,e.dump=i||"[]"}function yA(e,r,t){var n="",i=e.tag,l=Object.keys(t),a,o,s,f,c;for(a=0,o=l.length;a<o;a+=1)c="",n!==""&&(c+=", "),e.condenseFlow&&(c+='"'),s=l[a],f=t[s],e.replacer&&(f=e.replacer.call(t,s,f)),ir(e,r,s,!1,!1)&&(e.dump.length>1024&&(c+="? "),c+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),ir(e,r,f,!1,!1)&&(c+=e.dump,n+=c));e.tag=i,e.dump="{"+n+"}"}function gA(e,r,t,n){var i="",l=e.tag,a=Object.keys(t),o,s,f,c,h,u;if(e.sortKeys===!0)a.sort();else if(typeof e.sortKeys=="function")a.sort(e.sortKeys);else if(e.sortKeys)throw new gt("sortKeys must be a boolean or a function");for(o=0,s=a.length;o<s;o+=1)u="",(!n||i!=="")&&(u+=Ya(e,r)),f=a[o],c=t[f],e.replacer&&(c=e.replacer.call(t,f,c)),ir(e,r+1,f,!0,!0,!0)&&(h=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,h&&(e.dump&&pi===e.dump.charCodeAt(0)?u+="?":u+="? "),u+=e.dump,h&&(u+=Ya(e,r)),ir(e,r+1,c,!0,h)&&(e.dump&&pi===e.dump.charCodeAt(0)?u+=":":u+=": ",u+=e.dump,i+=u));e.tag=l,e.dump=i||"{}"}function bp(e,r,t){var n,i,l,a,o,s;for(i=t?e.explicitTypes:e.implicitTypes,l=0,a=i.length;l<a;l+=1)if(o=i[l],(o.instanceOf||o.predicate)&&(!o.instanceOf||typeof r=="object"&&r instanceof o.instanceOf)&&(!o.predicate||o.predicate(r))){if(t?o.multi&&o.representName?e.tag=o.representName(r):e.tag=o.tag:e.tag="?",o.represent){if(s=e.styleMap[o.tag]||o.defaultStyle,rd.call(o.represent)==="[object Function]")n=o.represent(r,s);else if(nd.call(o.represent,s))n=o.represent[s](r,s);else throw new gt("!<"+o.tag+'> tag resolver accepts not "'+s+'" style');e.dump=n}return!0}return!1}function ir(e,r,t,n,i,l,a){e.tag=null,e.dump=t,bp(e,t,!1)||bp(e,t,!0);var o=rd.call(e.dump),s=n,f;n&&(n=e.flowLevel<0||e.flowLevel>r);var c=o==="[object Object]"||o==="[object Array]",h,u;if(c&&(h=e.duplicates.indexOf(t),u=h!==-1),(e.tag!==null&&e.tag!=="?"||u||e.indent!==2&&r>0)&&(i=!1),u&&e.usedDuplicates[h])e.dump="*ref_"+h;else{if(c&&u&&!e.usedDuplicates[h]&&(e.usedDuplicates[h]=!0),o==="[object Object]")n&&Object.keys(e.dump).length!==0?(gA(e,r,e.dump,i),u&&(e.dump="&ref_"+h+e.dump)):(yA(e,r,e.dump),u&&(e.dump="&ref_"+h+" "+e.dump));else if(o==="[object Array]")n&&e.dump.length!==0?(e.noArrayIndent&&!a&&r>0?gp(e,r-1,e.dump,i):gp(e,r,e.dump,i),u&&(e.dump="&ref_"+h+e.dump)):(mA(e,r,e.dump),u&&(e.dump="&ref_"+h+" "+e.dump));else if(o==="[object String]")e.tag!=="?"&&fA(e,e.dump,r,l,s);else{if(o==="[object Undefined]"||e.skipInvalid)return!1;throw new gt("unacceptable kind of an object to dump "+o)}e.tag!==null&&e.tag!=="?"&&(f=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?f="!"+f:f.slice(0,18)==="tag:yaml.org,2002:"?f="!!"+f.slice(18):f="!<"+f+">",e.dump=f+" "+e.dump)}return!0}function bA(e,r){var t=[],n=[],i,l;for(Za(e,t,n),i=0,l=n.length;i<l;i+=1)r.duplicates.push(t[n[i]]);r.usedDuplicates=new Array(l)}function Za(e,r,t){var n,i,l;if(e!==null&&typeof e=="object")if(i=r.indexOf(e),i!==-1)t.indexOf(i)===-1&&t.push(i);else if(r.push(e),Array.isArray(e))for(i=0,l=e.length;i<l;i+=1)Za(e[i],r,t);else for(n=Object.keys(e),i=0,l=n.length;i<l;i+=1)Za(e[n[i]],r,t)}function vA(e,r){r=r||{};var t=new aA(r);t.noRefs||bA(e,t);var n=e;return t.replacer&&(n=t.replacer.call({"":n},"",n)),ir(t,0,n,!0,!0)?t.dump+`
|
|
204
|
-
`:""}var _A=vA,wA={dump:_A};function cu(e,r){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+r+" instead, which is now safe by default.")}}var EA=at,SA=Dp,xA=Fp,AA=Mp,CA=Np,kA=ou,DA=td.load,RA=td.loadAll,OA=wA.dump,TA=gt,FA={binary:Up,float:Lp,map:Tp,null:Pp,pairs:Wp,set:zp,timestamp:Hp,bool:Bp,int:Ip,merge:qp,omap:Gp,seq:Op,str:Rp},PA=cu("safeLoad","load"),BA=cu("safeLoadAll","loadAll"),IA=cu("safeDump","dump"),LA={Type:EA,Schema:SA,FAILSAFE_SCHEMA:xA,JSON_SCHEMA:AA,CORE_SCHEMA:CA,DEFAULT_SCHEMA:kA,load:DA,loadAll:RA,dump:OA,YAMLException:TA,types:FA,safeLoad:PA,safeLoadAll:BA,safeDump:IA},MA=LA,NA=Ge(yS()),jA="turbo.json",za={};function $A(e){try{if(hi.default.existsSync(Mr.default.join(e,"pnpm-workspace.yaml"))){let r=MA.load(hi.default.readFileSync(Mr.default.join(e,"pnpm-workspace.yaml"),"utf8"));return(r==null?void 0:r.packages)||[]}else{let r=JSON.parse(hi.default.readFileSync(Mr.default.join(e,"package.json"),"utf8"));return r!=null&&r.workspaces?"packages"in(r==null?void 0:r.workspaces)?r.workspaces.packages||[]:(r==null?void 0:r.workspaces)||[]:[]}}catch{return[]}}function hu(e,r){var t;let n=li(e,r),i=[],l=(t=r==null?void 0:r.cache)!=null?t:!0;if(l&&e&&za[e])return za[e];if(n){let a=$A(n).map(o=>`${o}/turbo.json`);(0,NA.sync)([jA,...a],{cwd:n,onlyFiles:!0,followSymbolicLinks:!1,suppressErrors:!0}).map(o=>Mr.default.join(n,o)).forEach(o=>{try{let s=hi.default.readFileSync(o,"utf8"),f=qa.parse(s),c=Mr.default.dirname(o)===n;if(c){if("extends"in f)return}else if(!("extends"in f))return;i.push({config:f,turboConfigPath:o,workspacePath:Mr.default.dirname(o),isRootConfig:c})}catch(s){console.warn(s)}})}return l&&e&&(za[e]=i),i}var O5=Ue(R5());async function Qo({root:e}){let r=e||process.cwd(),t=li(r);if(!t)qe.error("Unable to infer repository root - override with --root");else try{return(0,O5.getWorkspaceDetails)({root:t})}catch{qe.error(`Unable to determine workspace details. Make sure "${e}" is the root, or add "packageManager" to "package.json" or ensure a lockfile is present.`)}process.exit(1)}var N5=Ue(require("chalk"));var F5=Ue(require("fs-extra")),qh=Ue(require("node-plop")),Ki=Ue(require("path")),P5=Ue(require("inquirer"));var Uh=Ki.default.join("generators","config.js"),FN=[Uh,"plopfile.js","plopfile.cjs","plopfile.mjs"];function B5({project:e,configPath:r}){if(r){let t=(0,qh.default)(r,{destBasePath:e.paths.root,force:!1});return T5({plop:t,project:e})}for(let t of FN){let n=Ki.default.join(e.paths.root,t);try{let i=(0,qh.default)(n,{destBasePath:e.paths.root,force:!1});return T5({plop:i,project:e})}catch{}}}function I5({project:e}){let r=B5({project:e});if(!r)return[];let n=r.getGeneratorList().map(o=>r.getGenerator(o.name)),i={};n.forEach(o=>{let s=o,f=e.workspaceData.workspaces.find(c=>s.basePath.includes(c.paths.root));f?(i[f.name]||(i[f.name]=[]),i[f.name].push(s)):(i.root||(i.root=[]),i.root.push(s))});let l=[],a=void 0;if(Object.keys(i).forEach(o=>{o!==a&&l.push(new P5.default.Separator(o)),l.push(...i[o])}),!l.length)throw new Error("No generators found");return l}function PN({project:e,generator:r}){let t={root:e.paths.root,workspace:r.basePath?si({cwd:r.basePath,target:"package.json"}):void 0},n={};try{n=hu(r.basePath)}catch{}return{turbo:{paths:t,configs:n}}}function T5({plop:e,project:r}){return r.workspaceData.workspaces.forEach(t=>{F5.default.existsSync(Ki.default.join(t.paths.root,Uh))&&e.load(Ki.default.join(t.paths.root,Uh),{destBasePath:t.paths.root})}),e}async function L5({project:e,generator:r,bypassArgs:t}){let n=B5({project:e});if(!n)throw new Error("Unable to load generators");let i=n.getGenerator(r);if(!i)throw new Error(`Generator ${r} not found`);let l=await i.runPrompts(t),a=await i.runActions({...l,...PN({project:e,generator:i})},{onComment:o=>{console.info(o)}});if(a.failures&&a.failures.length>0)throw a.failures.forEach(o=>{qe.error(`Error - ${o.error}. Unable to ${o.type} to "${o.path}"`)}),new Error(`Failed to run "${r}" generator`);a.changes&&a.changes.length>0&&(qe.info("Changes made:"),a.changes.forEach(o=>{o.path&&qe.item(`${o.path} (${o.type})`)}))}var Jo=Ue(require("inquirer"));async function M5({generators:e,generator:r}){return r&&e.find(n=>!(n instanceof Jo.default.Separator)&&n.name===r)?{selectedGenerator:r}:await Jo.default.prompt({type:"list",name:"selectedGenerator",default:r,when:!r,message:"Select generator to run?",choices:e.map(n=>n instanceof Jo.default.Separator?n:{name:n.description?` ${n.name}: ${n.description}`:` ${n.name}`,value:n.name})})}async function Gh({generator:e,project:r,opts:t}){let n=I5({project:r});if(!n.length){qe.error("No custom generators found."),console.log(),qe.dimmed("Visit https://turbo.build/repo/docs/generators to get started.");return}let{selectedGenerator:i}=await M5({generators:n,generator:e});await L5({project:r,generator:i,bypassArgs:t.args}),console.log(),console.log(N5.default.bold(qe.turboGradient(">>> Success!")))}var Kh=Ue(require("path")),na=Ue(require("fs-extra")),Y5=Ue(require("chalk"));var q5=Ue(require("fs-extra")),Yi=Ue(require("path")),Zt=Ue(require("inquirer")),U5=require("minimatch"),Vh=Ue(require("validate-npm-package-name"));var Wh=Ue(require("path"));var j5=Ue(require("path"));function $5({project:e}){let t=e.workspaceData.workspaces.map(i=>j5.default.relative(e.paths.root,i.paths.root)),n=new Set;return e.workspaceData.globs.forEach(i=>{if(!t.includes(i)){if(i.startsWith("!"))return;{let a=i.split("/")[0];n.add(a)}}}),Array.from(n)}function zh({project:e,workspace:r}){return Wh.default.relative(e.paths.root,r.paths.root).split(Wh.default.sep)[0]}function ea({project:e}){let r=$5({project:e}),t=r.includes("apps"),n=r.includes("packages"),i={},l=[];return e.workspaceData.workspaces.forEach(a=>{let o=zh({project:e,workspace:a});o!=="apps"&&l.push(a),i[o]||(i[o]=[]),i[o].push(a)}),{hasRootApps:t,hasRootPackages:n,workspacesByGroup:i,nonAppWorkspaces:l}}var H5=Ue(require("inquirer"));function ta({project:e,what:r,showAllDependencies:t}){let n=ea({project:e}),i=[],l=e.workspaceData.workspaces;t||(r==="app"&&n.hasRootApps?l=n.workspacesByGroup.apps:r==="package"&&n.nonAppWorkspaces.length>0&&(l=n.nonAppWorkspaces));let a;return l.forEach(o=>{let s=zh({project:e,workspace:o});s!==a&&i.push(new H5.default.Separator(s)),a=s,i.push(o)}),i}async function G5({override:e,suggestion:r,what:t}){let{validForNewPackages:n}=(0,Vh.default)(e||"");return e&&n?{answer:e}:Zt.default.prompt({type:"input",name:"answer",default:r,validate:i=>{let{validForNewPackages:l}=(0,Vh.default)(i);return l||`Invalid ${t} name`},message:`What is the name of the ${t}?`})}async function W5({override:e}){return e?{answer:e}:Zt.default.prompt({type:"list",name:"answer",message:"What type of workspace should be added?",choices:[{name:"app",value:"app"},{name:"package",value:"package"}]})}async function z5({what:e,name:r,destination:t,project:n}){let i=r.includes("/")?r.split("/")[1]:r;if(t){let{valid:s,root:f}=as(t);if(s)return{absolute:f,relative:Yi.default.relative(n.paths.root,f)}}let l,a=ea({project:n});e==="app"&&a.hasRootApps?l=`${n.paths.root}/apps/${i}`:e==="package"&&a.hasRootPackages&&(l=`${n.paths.root}/packages/${i}`);let{answer:o}=await Zt.default.prompt({type:"input",name:"answer",message:`Where should "${r}" be added?`,default:l?Yi.default.relative(n.paths.root,l):void 0,validate:s=>{let f=Yi.default.join(n.paths.root,s),{valid:c,error:h}=as(f),u=n.workspaceData.globs.some(d=>(0,U5.minimatch)(s,d));return c&&u?!0:u?h:`${s} is not a valid workspace location`}});return{absolute:Yi.default.join(n.paths.root,o),relative:o}}async function V5({workspaces:e,name:r}){return await Zt.default.prompt({type:"list",name:"answer",loop:!1,pageSize:25,message:`Which workspace should "${r}" start from?`,choices:e.map(n=>n instanceof Zt.default.Separator?n:{name:` ${n.name}`,value:n})})}async function K5({name:e,project:r,source:t,showAllDependencies:n}){let i={dependencies:{},devDependencies:{},peerDependencies:{},optionalDependencies:{}},{answer:l}=await IN({message:`Add workspace dependencies to "${e}"?`});if(!l)return i;let{answer:a}=await Zt.default.prompt({type:"checkbox",name:"answer",message:`Select all dependencies types to modify for "${e}"`,loop:!1,choices:[{name:"dependencies",value:"dependencies"},{name:"devDependencies",value:"devDependencies"},{name:"peerDependencies",value:"peerDependencies"},{name:"optionalDependencies",value:"optionalDependencies"}]}),o=ta({project:r,what:"package",showAllDependencies:n}),s=t?q5.default.readJsonSync(t.paths.packageJson):void 0;for(let f of a){let{answer:c}=await Zt.default.prompt({type:"checkbox",name:"answer",default:s&&Object.keys((s==null?void 0:s[f])||{}),pageSize:15,message:`Which packages should be added as ${f} to "${e}?`,loop:!1,choices:o.map(u=>u instanceof Zt.default.Separator?u:{name:` ${u.name}`,value:u.name})}),h=(s==null?void 0:s[f])||{};if(Object.keys(h).length){let u=new Set(Object.keys(h));c.forEach(d=>{u.has(d)||(h[d]=r.packageManager==="pnpm"?"workspace:*":"*")}),i[f]=h}else i[f]=c.reduce((u,d)=>({...u,[d]:r.packageManager==="pnpm"?"workspace:*":"*"}),{})}return i}async function IN({message:e}){return await Zt.default.prompt({type:"confirm",name:"answer",message:e})}async function ra({project:e,opts:r}){var s,f;let t,{answer:n}=await W5({override:r.what}),i=((s=r.examplePath)==null?void 0:s.split("/").pop())||((f=r.example)==null?void 0:f.split("/").pop())||void 0,{answer:l}=await G5({override:r.name,what:n,suggestion:i});if(r.copy&&!r.example){let{answer:c}=await V5({workspaces:ta({project:e,what:n}),name:l});t=c}let a=await z5({what:n,name:l,project:e,destination:r.destination}),o=await K5({name:l,project:e,source:t,showAllDependencies:r.showAllDependencies});return{what:n,name:l,location:a,source:t,dependencies:o}}async function Yh({project:e,opts:r}){let{name:t,location:n,dependencies:i}=await ra({project:e,opts:r}),l={name:t,version:"0.0.0",private:!0,scripts:{build:"turbo build"}};Object.keys(i).forEach(a=>{let o=i[a];o&&Object.keys(o).length>0&&(l[a]=o)}),na.default.mkdirSync(n.absolute,{recursive:!0}),na.default.writeFileSync(Kh.default.join(n.absolute,"package.json"),JSON.stringify(l,null,2)),na.default.writeFileSync(Kh.default.join(n.absolute,"README.md"),`# \`${t}\``),console.log(),console.log(`${Y5.default.bold(qe.turboGradient(">>> Success!"))} Created ${t} at "${n.relative}"`)}var Xh=Ue(require("path")),Tr=Ue(require("fs-extra")),X5=Ue(require("chalk"));async function Zh({project:e,opts:r}){let{name:t,what:n,location:i,source:l,dependencies:a}=await ra({project:e,opts:r}),o=Xh.default.join(i.absolute,"package.json");if(r.example){console.log(),qe.warn("Some manual modifications may be required."),qe.dimmed(`This ${n} may require local dependencies or a different package manager than what is available in this repo`),await ka({appPath:i.absolute,example:r.example,examplePath:r.examplePath});try{if(Tr.default.existsSync(o)){if((await Tr.default.readJSON(o)).workspaces)throw new Error("New workspace root detected - unexpected 'workspaces' field in package.json")}else throw new Error("New workspace is missing a package.json file");if(Tr.default.existsSync(Xh.default.join(i.absolute,"pnpm-workspace.yaml")))throw new Error("New workspace root detected - unexpected pnpm-workspace.yaml")}catch(f){let c="UNKNOWN_ERROR";f instanceof Error&&(c=f.message),qe.error(c),await Tr.default.rm(i.absolute,{recursive:!0,force:!0});return}}else if(l){let f=async(h,u)=>!h.includes("node_modules"),c=qe.turboLoader(`Creating "${t}" from "${l.name}"...`);c.start(),await Tr.default.copy(l.paths.root,i.absolute,{filter:f}),c.stop()}let s=await Tr.default.readJSON(o);s.name=t,Object.keys(a).forEach(f=>{let c=a[f];c&&Object.keys(c).length>0&&(s[f]=c)}),await Tr.default.writeJSON(o,s,{spaces:2}),console.log(),console.log(`${X5.default.bold(qe.turboGradient(">>> Success!"))} Created ${t} at "${i.relative}"`)}async function Xi(e){let r=await Qo(e);console.log();let t={project:r,opts:e};e.copy?(e.example?qe.info(`Copy a remote workspace from ${e.example}`):qe.info(`Copy an existing workspace from ${r.name}`),console.log(),await Zh(t)):(qe.info(`Add an empty workspace to ${r.name}`),console.log(),await Yh(t))}async function Zi(e,r){let t=await Qo(r);console.log(),qe.info(`Modify ${t.name} using custom generators`),console.log(),await Gh({generator:e,project:t,opts:r})}function Qh(e){let r={command:"add"};try{r=JSON.parse(e.json)}catch(i){console.error("Error parsing arguments",i),process.exit(1)}let{command:t,...n}=r;switch(t){case"add":Xi(n);case"generate":let{generator:i}=n;Zi(i,n);default:console.error("Unknown command",t),process.exit(1)}}var Qi=new ot.Command;Qi.name(Jh.default.bold(qe.turboGradient("@turbo/gen"))).description("Extend your Turborepo").version(Xn.version,"-v, --version","Output the current version").helpOption("-h, --help","Display help for command").showHelpAfterError(!1);Qi.command("raw",{hidden:!0}).addOption(new ot.Option("--json <arguments>","Arguments as raw JSON")).action(Qh);Qi.command("add").aliases(["a"]).description("Add a new package or app to your project").addOption(new ot.Option("-n, --name <workspace-name>","Name for the new workspace")).addOption(new ot.Option("-b, --empty","Generate an empty workspace").conflicts("copy").default(!0)).addOption(new ot.Option("-c, --copy","Generate a workspace using an existing workspace as a template").conflicts("empty")).addOption(new ot.Option("-d, --destination <dir>","Where the new workspace should be created")).addOption(new ot.Option("-w, --what <type>","The type of workspace to create").choices(["app","package"])).addOption(new ot.Option("-r, --root <dir>","The root of your repository (default: directory with root turbo.json)")).addOption(new ot.Option("-e, --example [github-url]","An example package to add. You can use a GitHub URL with any branch and/or subdirectory.").implies({copy:!0})).addOption(new ot.Option("-p, --example-path <path-to-example>",`In a rare case, your GitHub URL might contain a branch name with
|
|
204
|
+
`:""}var _A=vA,wA={dump:_A};function cu(e,r){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+r+" instead, which is now safe by default.")}}var EA=at,SA=Dp,xA=Fp,AA=Mp,CA=Np,kA=ou,DA=td.load,RA=td.loadAll,OA=wA.dump,TA=gt,FA={binary:Up,float:Lp,map:Tp,null:Pp,pairs:Wp,set:zp,timestamp:Hp,bool:Bp,int:Ip,merge:qp,omap:Gp,seq:Op,str:Rp},PA=cu("safeLoad","load"),BA=cu("safeLoadAll","loadAll"),IA=cu("safeDump","dump"),LA={Type:EA,Schema:SA,FAILSAFE_SCHEMA:xA,JSON_SCHEMA:AA,CORE_SCHEMA:CA,DEFAULT_SCHEMA:kA,load:DA,loadAll:RA,dump:OA,YAMLException:TA,types:FA,safeLoad:PA,safeLoadAll:BA,safeDump:IA},MA=LA,NA=Ge(yS()),jA="turbo.json",za={};function $A(e){try{if(hi.default.existsSync(Mr.default.join(e,"pnpm-workspace.yaml"))){let r=MA.load(hi.default.readFileSync(Mr.default.join(e,"pnpm-workspace.yaml"),"utf8"));return(r==null?void 0:r.packages)||[]}else{let r=JSON.parse(hi.default.readFileSync(Mr.default.join(e,"package.json"),"utf8"));return r!=null&&r.workspaces?"packages"in(r==null?void 0:r.workspaces)?r.workspaces.packages||[]:(r==null?void 0:r.workspaces)||[]:[]}}catch{return[]}}function hu(e,r){var t;let n=li(e,r),i=[],l=(t=r==null?void 0:r.cache)!=null?t:!0;if(l&&e&&za[e])return za[e];if(n){let a=$A(n).map(o=>`${o}/turbo.json`);(0,NA.sync)([jA,...a],{cwd:n,onlyFiles:!0,followSymbolicLinks:!1,suppressErrors:!0}).map(o=>Mr.default.join(n,o)).forEach(o=>{try{let s=hi.default.readFileSync(o,"utf8"),f=qa.parse(s),c=Mr.default.dirname(o)===n;if(c){if("extends"in f)return}else if(!("extends"in f))return;i.push({config:f,turboConfigPath:o,workspacePath:Mr.default.dirname(o),isRootConfig:c})}catch(s){console.warn(s)}})}return l&&e&&(za[e]=i),i}var O5=Ue(R5());async function Qo({root:e}){let r=e||process.cwd(),t=li(r);if(!t)qe.error("Unable to infer repository root - override with --root");else try{return(0,O5.getWorkspaceDetails)({root:t})}catch{qe.error(`Unable to determine workspace details. Make sure "${e}" is the root, or add "packageManager" to "package.json" or ensure a lockfile is present.`)}process.exit(1)}var N5=Ue(require("chalk"));var F5=Ue(require("fs-extra")),qh=Ue(require("node-plop")),Ki=Ue(require("path")),P5=Ue(require("inquirer"));var Uh=Ki.default.join("generators","config.js"),FN=[Uh,"plopfile.js","plopfile.cjs","plopfile.mjs"];function B5({project:e,configPath:r}){if(r){let t=(0,qh.default)(r,{destBasePath:e.paths.root,force:!1});return T5({plop:t,project:e})}for(let t of FN){let n=Ki.default.join(e.paths.root,t);try{let i=(0,qh.default)(n,{destBasePath:e.paths.root,force:!1});return T5({plop:i,project:e})}catch{}}}function I5({project:e}){let r=B5({project:e});if(!r)return[];let n=r.getGeneratorList().map(o=>r.getGenerator(o.name)),i={};n.forEach(o=>{let s=o,f=e.workspaceData.workspaces.find(c=>s.basePath.includes(c.paths.root));f?(i[f.name]||(i[f.name]=[]),i[f.name].push(s)):(i.root||(i.root=[]),i.root.push(s))});let l=[],a=void 0;if(Object.keys(i).forEach(o=>{o!==a&&l.push(new P5.default.Separator(o)),l.push(...i[o])}),!l.length)throw new Error("No generators found");return l}function PN({project:e,generator:r}){let t={root:e.paths.root,workspace:r.basePath?si({cwd:r.basePath,target:"package.json"}):void 0},n={};try{n=hu(r.basePath)}catch{}return{turbo:{paths:t,configs:n}}}function T5({plop:e,project:r}){return r.workspaceData.workspaces.forEach(t=>{F5.default.existsSync(Ki.default.join(t.paths.root,Uh))&&e.load(Ki.default.join(t.paths.root,Uh),{destBasePath:t.paths.root})}),e}async function L5({project:e,generator:r,bypassArgs:t}){let n=B5({project:e});if(!n)throw new Error("Unable to load generators");let i=n.getGenerator(r);if(!i)throw new Error(`Generator ${r} not found`);let l=await i.runPrompts(t),a=await i.runActions({...l,...PN({project:e,generator:i})},{onComment:o=>{console.info(o)}});if(a.failures&&a.failures.length>0)throw a.failures.forEach(o=>{qe.error(`Error - ${o.error}. Unable to ${o.type} to "${o.path}"`)}),new Error(`Failed to run "${r}" generator`);a.changes&&a.changes.length>0&&(qe.info("Changes made:"),a.changes.forEach(o=>{o.path&&qe.item(`${o.path} (${o.type})`)}))}var Jo=Ue(require("inquirer"));async function M5({generators:e,generator:r}){return r&&e.find(n=>!(n instanceof Jo.default.Separator)&&n.name===r)?{selectedGenerator:r}:await Jo.default.prompt({type:"list",name:"selectedGenerator",default:r,when:!r,message:"Select generator to run?",choices:e.map(n=>n instanceof Jo.default.Separator?n:{name:n.description?` ${n.name}: ${n.description}`:` ${n.name}`,value:n.name})})}async function Gh({generator:e,project:r,opts:t}){let n=I5({project:r});if(!n.length){qe.error("No custom generators found."),console.log(),qe.dimmed("Visit https://turbo.build/repo/docs/generators to get started.");return}let{selectedGenerator:i}=await M5({generators:n,generator:e});await L5({project:r,generator:i,bypassArgs:t.args}),console.log(),console.log(N5.default.bold(qe.turboGradient(">>> Success!")))}var Kh=Ue(require("path")),na=Ue(require("fs-extra")),Y5=Ue(require("chalk"));var q5=Ue(require("fs-extra")),Yi=Ue(require("path")),Zt=Ue(require("inquirer")),U5=require("minimatch"),Vh=Ue(require("validate-npm-package-name"));var Wh=Ue(require("path"));var j5=Ue(require("path"));function $5({project:e}){let t=e.workspaceData.workspaces.map(i=>j5.default.relative(e.paths.root,i.paths.root)),n=new Set;return e.workspaceData.globs.forEach(i=>{if(!t.includes(i)){if(i.startsWith("!"))return;{let a=i.split("/")[0];n.add(a)}}}),Array.from(n)}function zh({project:e,workspace:r}){return Wh.default.relative(e.paths.root,r.paths.root).split(Wh.default.sep)[0]}function ea({project:e}){let r=$5({project:e}),t=r.includes("apps"),n=r.includes("packages"),i={},l=[];return e.workspaceData.workspaces.forEach(a=>{let o=zh({project:e,workspace:a});o!=="apps"&&l.push(a),i[o]||(i[o]=[]),i[o].push(a)}),{hasRootApps:t,hasRootPackages:n,workspacesByGroup:i,nonAppWorkspaces:l}}var H5=Ue(require("inquirer"));function ta({project:e,what:r,showAllDependencies:t}){let n=ea({project:e}),i=[],l=e.workspaceData.workspaces;t||(r==="app"&&n.hasRootApps?l=n.workspacesByGroup.apps:r==="package"&&n.nonAppWorkspaces.length>0&&(l=n.nonAppWorkspaces));let a;return l.forEach(o=>{let s=zh({project:e,workspace:o});s!==a&&i.push(new H5.default.Separator(s)),a=s,i.push(o)}),i}async function G5({override:e,suggestion:r,what:t}){let{validForNewPackages:n}=(0,Vh.default)(e||"");return e&&n?{answer:e}:Zt.default.prompt({type:"input",name:"answer",default:r,validate:i=>{let{validForNewPackages:l}=(0,Vh.default)(i);return l||`Invalid ${t} name`},message:`What is the name of the ${t}?`})}async function W5({override:e}){return e?{answer:e}:Zt.default.prompt({type:"list",name:"answer",message:"What type of workspace should be added?",choices:[{name:"app",value:"app"},{name:"package",value:"package"}]})}async function z5({what:e,name:r,destination:t,project:n}){let i=r.includes("/")?r.split("/")[1]:r;if(t){let{valid:s,root:f}=as(t);if(s)return{absolute:f,relative:Yi.default.relative(n.paths.root,f)}}let l,a=ea({project:n});e==="app"&&a.hasRootApps?l=`${n.paths.root}/apps/${i}`:e==="package"&&a.hasRootPackages&&(l=`${n.paths.root}/packages/${i}`);let{answer:o}=await Zt.default.prompt({type:"input",name:"answer",message:`Where should "${r}" be added?`,default:l?Yi.default.relative(n.paths.root,l):void 0,validate:s=>{let f=Yi.default.join(n.paths.root,s),{valid:c,error:h}=as(f),u=n.workspaceData.globs.some(d=>(0,U5.minimatch)(s,d));return c&&u?!0:u?h:`${s} is not a valid workspace location`}});return{absolute:Yi.default.join(n.paths.root,o),relative:o}}async function V5({workspaces:e,name:r}){return await Zt.default.prompt({type:"list",name:"answer",loop:!1,pageSize:25,message:`Which workspace should "${r}" start from?`,choices:e.map(n=>n instanceof Zt.default.Separator?n:{name:` ${n.name}`,value:n})})}async function K5({name:e,project:r,source:t,showAllDependencies:n}){let i={dependencies:{},devDependencies:{},peerDependencies:{},optionalDependencies:{}},{answer:l}=await IN({message:`Add workspace dependencies to "${e}"?`});if(!l)return i;let{answer:a}=await Zt.default.prompt({type:"checkbox",name:"answer",message:`Select all dependencies types to modify for "${e}"`,loop:!1,choices:[{name:"dependencies",value:"dependencies"},{name:"devDependencies",value:"devDependencies"},{name:"peerDependencies",value:"peerDependencies"},{name:"optionalDependencies",value:"optionalDependencies"}]}),o=ta({project:r,what:"package",showAllDependencies:n}),s=t?q5.default.readJsonSync(t.paths.packageJson):void 0;for(let f of a){let{answer:c}=await Zt.default.prompt({type:"checkbox",name:"answer",default:s&&Object.keys((s==null?void 0:s[f])||{}),pageSize:15,message:`Which packages should be added as ${f} to "${e}?`,loop:!1,choices:o.map(u=>u instanceof Zt.default.Separator?u:{name:` ${u.name}`,value:u.name})}),h=(s==null?void 0:s[f])||{};if(Object.keys(h).length){let u=new Set(Object.keys(h));c.forEach(d=>{u.has(d)||(h[d]=r.packageManager==="pnpm"?"workspace:*":"*")}),i[f]=h}else i[f]=c.reduce((u,d)=>({...u,[d]:r.packageManager==="pnpm"?"workspace:*":"*"}),{})}return i}async function IN({message:e}){return await Zt.default.prompt({type:"confirm",name:"answer",message:e})}async function ra({project:e,opts:r}){var s,f;let t,{answer:n}=await W5({override:r.what}),i=((s=r.examplePath)==null?void 0:s.split("/").pop())||((f=r.example)==null?void 0:f.split("/").pop())||void 0,{answer:l}=await G5({override:r.name,what:n,suggestion:i});if(r.copy&&!r.example){let{answer:c}=await V5({workspaces:ta({project:e,what:n}),name:l});t=c}let a=await z5({what:n,name:l,project:e,destination:r.destination}),o=await K5({name:l,project:e,source:t,showAllDependencies:r.showAllDependencies});return{what:n,name:l,location:a,source:t,dependencies:o}}async function Yh({project:e,opts:r}){let{name:t,location:n,dependencies:i}=await ra({project:e,opts:r}),l={name:t,version:"0.0.0",private:!0,scripts:{build:"turbo build"}};Object.keys(i).forEach(a=>{let o=i[a];o&&Object.keys(o).length>0&&(l[a]=o)}),na.default.mkdirSync(n.absolute,{recursive:!0}),na.default.writeFileSync(Kh.default.join(n.absolute,"package.json"),JSON.stringify(l,null,2)),na.default.writeFileSync(Kh.default.join(n.absolute,"README.md"),`# \`${t}\``),console.log(),console.log(`${Y5.default.bold(qe.turboGradient(">>> Success!"))} Created ${t} at "${n.relative}"`)}var Xh=Ue(require("path")),Tr=Ue(require("fs-extra")),X5=Ue(require("chalk"));async function Zh({project:e,opts:r}){let{name:t,what:n,location:i,source:l,dependencies:a}=await ra({project:e,opts:r}),o=Xh.default.join(i.absolute,"package.json");if(r.example){console.log(),qe.warn("Some manual modifications may be required."),qe.dimmed(`This ${n} may require local dependencies or a different package manager than what is available in this repo`),await ka({appPath:i.absolute,example:r.example,examplePath:r.examplePath});try{if(Tr.default.existsSync(o)){if((await Tr.default.readJSON(o)).workspaces)throw new Error("New workspace root detected - unexpected 'workspaces' field in package.json")}else throw new Error("New workspace is missing a package.json file");if(Tr.default.existsSync(Xh.default.join(i.absolute,"pnpm-workspace.yaml")))throw new Error("New workspace root detected - unexpected pnpm-workspace.yaml")}catch(f){let c="UNKNOWN_ERROR";f instanceof Error&&(c=f.message),qe.error(c),await Tr.default.rm(i.absolute,{recursive:!0,force:!0});return}}else if(l){let f=async(h,u)=>!h.includes("node_modules"),c=qe.turboLoader(`Creating "${t}" from "${l.name}"...`);c.start(),await Tr.default.copy(l.paths.root,i.absolute,{filter:f}),c.stop()}let s=await Tr.default.readJSON(o);s.name=t,Object.keys(a).forEach(f=>{let c=a[f];c&&Object.keys(c).length>0&&(s[f]=c)}),await Tr.default.writeJSON(o,s,{spaces:2}),console.log(),console.log(`${X5.default.bold(qe.turboGradient(">>> Success!"))} Created ${t} at "${i.relative}"`)}async function Xi(e){let r=await Qo(e);console.log();let t={project:r,opts:e};e.copy?(e.example?qe.info(`Copy a remote workspace from ${e.example}`):qe.info(`Copy an existing workspace from ${r.name}`),console.log(),await Zh(t)):(qe.info(`Add an empty workspace to ${r.name}`),console.log(),await Yh(t))}async function Zi(e,r){let t=await Qo(r);console.log(),qe.info(`Modify ${t.name} using custom generators`),console.log(),await Gh({generator:e,project:t,opts:r})}async function Qh(e,r){let t={};try{t=JSON.parse(r.json)}catch(n){console.error("Error parsing arguments",n),process.exit(1)}switch(e){case"add":await Xi(t);break;case"generate":let{generator:n}=t;await Zi(n,t);break;default:console.error(`Received unknown command - "${e}" (must be one of "add" | "generate")`),process.exit(1)}}var Qi=new ot.Command;Qi.name(Jh.default.bold(qe.turboGradient("@turbo/gen"))).description("Extend your Turborepo").version(Xn.version,"-v, --version","Output the current version").helpOption("-h, --help","Display help for command").showHelpAfterError(!1);Qi.command("raw",{hidden:!0}).argument("<type>","The type of generator to run").addOption(new ot.Option("--json <arguments>","Arguments as raw JSON")).action(Qh);Qi.command("add").aliases(["a"]).description("Add a new package or app to your project").addOption(new ot.Option("-n, --name <workspace-name>","Name for the new workspace")).addOption(new ot.Option("-b, --empty","Generate an empty workspace").conflicts("copy").default(!0)).addOption(new ot.Option("-c, --copy","Generate a workspace using an existing workspace as a template").conflicts("empty")).addOption(new ot.Option("-d, --destination <dir>","Where the new workspace should be created")).addOption(new ot.Option("-w, --what <type>","The type of workspace to create").choices(["app","package"])).addOption(new ot.Option("-r, --root <dir>","The root of your repository (default: directory with root turbo.json)")).addOption(new ot.Option("-e, --example [github-url]","An example package to add. You can use a GitHub URL with any branch and/or subdirectory.").implies({copy:!0})).addOption(new ot.Option("-p, --example-path <path-to-example>",`In a rare case, your GitHub URL might contain a branch name with
|
|
205
205
|
a slash (e.g. bug/fix-1) and the path to the example (e.g. foo/bar).
|
|
206
206
|
In this case, you must specify the path to the example separately:
|
|
207
207
|
--example-path foo/bar
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@turbo/gen",
|
|
3
|
-
"version": "0.0.1-alpha.
|
|
3
|
+
"version": "0.0.1-alpha.3",
|
|
4
4
|
"description": "Extend a Turborepo",
|
|
5
5
|
"homepage": "https://turbo.build/repo",
|
|
6
6
|
"license": "MPL-2.0",
|
|
@@ -36,10 +36,10 @@
|
|
|
36
36
|
"ts-jest": "^27.1.1",
|
|
37
37
|
"tsup": "^6.7.0",
|
|
38
38
|
"typescript": "^4.5.5",
|
|
39
|
-
"@turbo/utils": "0.0.0",
|
|
40
|
-
"@turbo/workspaces": "1.9.4-canary.11",
|
|
39
|
+
"@turbo/test-utils": "0.0.0",
|
|
41
40
|
"@turbo/tsconfig": "0.0.0",
|
|
42
|
-
"@turbo/
|
|
41
|
+
"@turbo/workspaces": "1.9.4-canary.11",
|
|
42
|
+
"@turbo/utils": "0.0.0"
|
|
43
43
|
},
|
|
44
44
|
"files": [
|
|
45
45
|
"dist"
|