diff --git a/.gitignore b/.gitignore
index c5ae6ea68d82fa..70b82eb2e66bf0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -62,6 +62,7 @@ _UpgradeReport_Files/
*.wixobj
/tools/msvs/genfiles/
/npm.wxs
+/corepack.wxs
/tools/msvs/msi/Release/
/tools/msvs/msi/obj/
/tools/msvs/msi/x64/
diff --git a/LICENSE b/LICENSE
index c5177204b84980..f79ed8dbaf8b01 100644
--- a/LICENSE
+++ b/LICENSE
@@ -648,6 +648,17 @@ The externally maintained libraries used by Node.js are:
USE OR OTHER DEALINGS IN THE SOFTWARE.
"""
+- corepack, located at deps/corepack, is licensed as follows:
+ """
+ **Copyright © Corepack contributors**
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ """
+
- OpenSSL, located at deps/openssl, is licensed as follows:
"""
Copyright (c) 1998-2019 The OpenSSL Project. All rights reserved.
diff --git a/Makefile b/Makefile
index 7db5b3320f6181..b8223e86981ce6 100644
--- a/Makefile
+++ b/Makefile
@@ -1008,6 +1008,13 @@ $(PKG): release-only
# Builds the macOS installer for releases.
pkg: $(PKG)
+corepack-update:
+ rm -rf /tmp/node-corepack-clone
+ git clone 'https://github.com/nodejs/corepack.git' /tmp/node-corepack-clone
+ cd /tmp/node-corepack-clone && yarn pack
+ rm -rf deps/corepack && mkdir -p deps/corepack
+ cd deps/corepack && tar xf /tmp/node-corepack-clone/package.tgz --strip-components=1
+
# Note: this is strictly for release builds on release machines only.
pkg-upload: pkg
ssh $(STAGINGSERVER) "mkdir -p nodejs/$(DISTTYPEDIR)/$(FULLVERSION)"
diff --git a/deps/corepack/LICENSE.md b/deps/corepack/LICENSE.md
new file mode 100644
index 00000000000000..965ccaa1ae72fa
--- /dev/null
+++ b/deps/corepack/LICENSE.md
@@ -0,0 +1,7 @@
+**Copyright © Corepack contributors**
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/deps/corepack/README.md b/deps/corepack/README.md
new file mode 100644
index 00000000000000..2c660e3216c7d1
--- /dev/null
+++ b/deps/corepack/README.md
@@ -0,0 +1,137 @@
+# corepack
+
+Corepack is a zero-runtime-dependency Node script that acts as a bridge between Node projects and the package managers they are intended to be used with during development. In practical terms, **Corepack will let you use Yarn and pnpm without having to install them** - just like what currently happens with npm, which is shipped by Node by default.
+
+**Important:** At the moment, Corepack only covers Yarn and pnpm. Given that we have little control on the npm project, we prefer to focus on the Yarn and pnpm use cases. As a result, Corepack doesn't have any effect at all on the way you use npm.
+
+## How to Install
+
+### Default Installs
+
+Corepack isn't intended to be installed manually. While it's certainly possible, we're working with the Node TSC to provide Corepack by default starting from Node 15, thus ensuring that all package managers can be used with little to no friction.
+
+### Manual Installs
+
+
+Click here to see how to install Corepack using npm
+
+First uninstall your global Yarn and pnpm binaries (just leave npm). In general, you'd do this by running the following command:
+
+```shell
+npm uninstall -g yarn pnpm
+
+# That should be enough, but if you installed Yarn without going through npm it might
+# be more tedious - for example, you might need to run `brew uninstall yarn` as well.
+```
+
+Then install Corepack:
+
+```shell
+npm install -g corepack
+```
+
+We do acknowledge the irony and overhead of using npm to install Corepack, which is at least part of why the preferred option is to use the Corepack version that will be distributed along with Node itself.
+
+
+
+### Prebuilt Binaries
+
+
+Click here to see how to download prebuilt Corepack Node distributions
+
+We have a few prebuilt Node binaries (based on the [following branch](https://github.com/arcanis/node/tree/mael/pmm)) that you can just download, unpack somewhere, and add to your `PATH` environment variable.
+
+1. Go to [this page](https://github.com/arcanis/pmm/actions?query=workflow%3ABuild)
+2. Open the latest build (the one at the top)
+3. Download the right artifact (Linux or Darwin)
+4. Unzip the artifact, then untar it
+5. Add the `node-v15.0.0-nightlyYYYY-MM-DDXXXX-linux-x64/bin` directory to your `$PATH`
+
+
+
+## Usage
+
+Just use your package managers as you usually would. Run `yarn install` in Yarn projects, `pnpm install` in pnpm projects, and `npm` in npm projects. Corepack will catch these calls, and depending on the situation:
+
+- **If the local project is configured for the package manager you're using**, Corepack will silently download and cache the latest compatible version.
+
+- **If the local project is configured for a different package manager**, Corepack will request you to run the command again using the right package manager - thus avoiding corruptions of your install artifacts.
+
+- **If the local project isn't configured for any package manager**, Corepack will assume that you know what you're doing, and will use whatever package manager version has been pinned as "known good release". Check the relevant section for more details.
+
+## Known Good Releases
+
+When running Yarn or pnpm within projects that don't list a supported package manager, Corepack will default to a set of Known Good Releases. In a way, you can compare this to Node, where each version ships with a specific version of npm.
+
+The Known Good Releases can be updated system-wide using the `--activate` flag from the `corepack prepare` and `corepack hydrate` commands.
+
+## Offline Workflow
+
+The utility commands detailed in the next section.
+
+- Either you can use the network while building your container image, in which case you'll simply run `corepack prepare` to make sure that your image includes the Last Known Good release for the specified package manager.
+
+ - If you want to have *all* Last Known Good releases for all package managers, just use the `--all` flag which will do just that.
+
+- Or you're publishing your project to a system where the network is unavailable, in which case you'll preemptively generate a package manager archive from your local computer (using `corepack prepare -o`) before storing it somewhere your container will be able to access (for example within your repository). After that it'll just be a matter of running `corepack hydrate ` to setup the cache.
+
+## Utility Commands
+
+### `corepack enable [... name]`
+
+| Option | Description |
+| --- | --- |
+| `--install-directory` | Add the shims to the specified location |
+
+This command will detect where Node is installed and will create shims next to it for each of the specified package managers (or all of them if the command is called without parameters). Note that the npm shims will not be installed unless explicitly requested, as npm is currently distributed with Node through other means.
+
+### `corepack disable [... name]`
+
+| Option | Description |
+| --- | --- |
+| `--install-directory` | Remove the shims to the specified location |
+
+This command will detect where Node is installed and will remove the shims from there.
+
+### `corepack prepare [... name@version]`
+
+| Option | Description |
+| --- | --- |
+| `--all` | Prepare the "Last Known Good" version of all supported package managers |
+| `-o,--output` | Also generate an archive containing the package managers |
+| `--activate` | Also update the "Last Known Good" release |
+
+This command will download the given package managers (or the one configured for the local project if no argument is passed in parameter) and store it within the Corepack cache. If the `-o,--output` flag is set (optionally with a path as parameter), an archive will also be generated that can be used by the `corepack hydrate` command.
+
+### `corepack hydrate `
+
+| Option | Description |
+| --- | --- |
+| `--activate` | Also update the "Last Known Good" release |
+
+This command will retrieve the given package manager from the specified archive and will install it within the Corepack cache, ready to be used without further network interaction.
+
+## Contributing
+
+If you want to build corepack yourself things yourself, you can build the project like this:
+
+1. Clone this repository
+2. Run `yarn build` (no need for `yarn install`)
+3. The `dist/` directory now contains the pmm build and the shims
+4. Call `node ./dist/pmm --version` and behold
+
+You can also run the tests with `yarn jest` (still no install needed).
+
+## Design
+
+Various tidbits about Corepack's design are explained in more details in [DESIGN.md](/DESIGN.md).
+
+## License (MIT)
+
+> **Copyright © Corepack contributors**
+>
+> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+>
+> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+>
+> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/deps/corepack/dist/corepack.js b/deps/corepack/dist/corepack.js
new file mode 100755
index 00000000000000..819745837ecdce
--- /dev/null
+++ b/deps/corepack/dist/corepack.js
@@ -0,0 +1,23 @@
+#!/usr/bin/env node
+!function(t,e){for(var s in e)t[s]=e[s];e.__esModule&&Object.defineProperty(t,"__esModule",{value:!0})}(exports,(()=>{var __webpack_modules__={8256:(t,e,s)=>{e.log=function(...t){return"object"==typeof console&&console.log&&console.log(...t)},e.formatArgs=function(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;const s="color: "+this.color;e.splice(1,0,s,"color: inherit");let i=0,r=0;e[0].replace(/%[a-zA-Z%]/g,t=>{"%%"!==t&&(i++,"%c"===t&&(r=i))}),e.splice(r,0,s)},e.save=function(t){try{t?e.storage.setItem("debug",t):e.storage.removeItem("debug")}catch(t){}},e.load=function(){let t;try{t=e.storage.getItem("debug")}catch(t){}!t&&"undefined"!=typeof process&&"env"in process&&(t=process.env.DEBUG);return t},e.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},e.storage=function(){try{return localStorage}catch(t){}}(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.exports=s(514)(e);const{formatters:i}=t.exports;i.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}},514:(t,e,s)=>{t.exports=function(t){function e(t){let e=0;for(let s=0;s{if("%%"===s)return s;a++;const n=i.formatters[r];if("function"==typeof n){const i=t[a];s=n.call(e,i),t.splice(a,1),a--}return s}),i.formatArgs.call(e,t);(e.log||i.log).apply(e,t)}return o.namespace=t,o.enabled=i.enabled(t),o.useColors=i.useColors(),o.color=e(t),o.destroy=r,o.extend=n,"function"==typeof i.init&&i.init(o),i.instances.push(o),o}function r(){const t=i.instances.indexOf(this);return-1!==t&&(i.instances.splice(t,1),!0)}function n(t,e){const s=i(this.namespace+(void 0===e?":":e)+t);return s.log=this.log,s}function o(t){return t.toString().substring(2,t.toString().length-2).replace(/\.\*\?$/,"*")}return i.debug=i,i.default=i,i.coerce=function(t){if(t instanceof Error)return t.stack||t.message;return t},i.disable=function(){const t=[...i.names.map(o),...i.skips.map(o).map(t=>"-"+t)].join(",");return i.enable(""),t},i.enable=function(t){let e;i.save(t),i.names=[],i.skips=[];const s=("string"==typeof t?t:"").split(/[\s,]+/),r=s.length;for(e=0;e{i[e]=t[e]}),i.instances=[],i.names=[],i.skips=[],i.formatters={},i.selectColor=e,i.enable(i.load()),i}},324:(t,e,s)=>{"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?t.exports=s(8256):t.exports=s(7390)},7390:(t,e,s)=>{const i=s(3867),r=s(1669);e.init=function(t){t.inspectOpts={};const s=Object.keys(e.inspectOpts);for(let i=0;i=2&&(e.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(t){}e.inspectOpts=Object.keys(process.env).filter(t=>/^debug_/i.test(t)).reduce((t,e)=>{const s=e.substring(6).toLowerCase().replace(/_([a-z])/g,(t,e)=>e.toUpperCase());let i=process.env[e];return i=!!/^(yes|on|true|enabled)$/i.test(i)||!/^(no|off|false|disabled)$/i.test(i)&&("null"===i?null:Number(i)),t[s]=i,t},{}),t.exports=s(514)(e);const{formatters:n}=t.exports;n.o=function(t){return this.inspectOpts.colors=this.useColors,r.inspect(t,this.inspectOpts).replace(/\s*\n\s*/g," ")},n.O=function(t){return this.inspectOpts.colors=this.useColors,r.inspect(t,this.inspectOpts)}},6163:(t,e,s)=>{"use strict";s.d(e,{D:()=>f});var i=s(2408),r=s(5747),n=s.n(r),o=s(5622),a=s.n(o),h=s(8775),c=s.n(h),l=s(150),u=s(2404),p=s(2543),d=s(1476);class f{constructor(t=l){this.config=t}getBinariesFor(t){const e=new Set;for(const s of Object.values(this.config.definitions[t].ranges)){const t=Array.isArray(s.bin)?s.bin:Object.keys(s.bin);for(const s of t)e.add(s)}return e}async getDefaultDescriptors(){const t=[];for(const e of d.JR)t.push({name:e,range:await this.getDefaultVersion(e)});return t}async getDefaultVersion(t){const e=this.config.definitions[t];if(void 0===e)throw new i.Oi(`This package manager (${t}) isn't supported by this corepack build`);let s;try{s=JSON.parse(await n().promises.readFile(this.getLastKnownGoodFile(),"utf8"))}catch(t){}if("object"!=typeof s||null===s)return e.default;if(!Object.prototype.hasOwnProperty.call(s,t))return e.default;const r=s[t];return"string"!=typeof r?e.default:r}async activatePackageManager(t){const e=this.getLastKnownGoodFile();let s;try{s=JSON.parse(await n().promises.readFile(e,"utf8"))}catch(t){}"object"==typeof s&&null!==s||(s={}),s[t.name]=t.reference,await n().promises.mkdir(a().dirname(e),{recursive:!0}),await n().promises.writeFile(e,JSON.stringify(s,null,2)+"\n")}async ensurePackageManager(t){const e=this.config.definitions[t.name];if(void 0===e)throw new i.Oi(`This package manager (${t.name}) isn't supported by this corepack build`);const s=Object.keys(e.ranges).reverse(),r=s.find(e=>c().satisfies(t.reference,e));if(void 0===r)throw new Error(`Assertion failed: Specified resolution (${t.reference}) isn't supported by any of ${s.join(", ")}`);return{location:await p.t(u.o(),t,{spec:e.ranges[r]}),spec:e.ranges[r]}}async resolveDescriptor(t,{useCache:e=!0}={}){const s=this.config.definitions[t.name];if(void 0===s)throw new i.Oi(`This package manager (${t.name}) isn't supported by this corepack build`);const r=await p.HZ(u.o(),t);if(null!==r&&e)return{name:t.name,reference:r};const n=Object.keys(s.ranges).filter(e=>c().intersects(e,t.range)),o=await Promise.all(n.map(async t=>[t,await p.CG(s.ranges[t].tags)])),a=new Map;for(const[t,e]of o)for(const s of e)a.set(s,t);const h=[...a.keys()],l=c().maxSatisfying(h,t.range);return null===l?null:{name:t.name,reference:l}}getLastKnownGoodFile(){return a().join(u.o(),"lastKnownGood.json")}}},1764:(t,e,s)=>{"use strict";s.d(e,{q:()=>p});var i=s(2408),r=s(5747),n=s.n(r),o=s(5622),a=s.n(o),h=s(9521),c=s.n(h),l=s(1476),u=function(t,e,s,i){var r,n=arguments.length,o=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,s,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(n<3?r(o):n>3?r(e,s,o):r(e,s))||o);return n>3&&o&&Object.defineProperty(e,s,o),o};class p extends i.mY{constructor(){super(...arguments),this.names=[]}async execute(){let t=this.installDirectory;void 0===t&&(t=a().dirname(await c()("corepack")));const e=0===this.names.length?l.sG:this.names;for(const s of new Set(e)){if(!(0,l.c)(s))throw new i.Oi(`Invalid package manager name '${s}'`);for(const e of this.context.engine.getBinariesFor(s))"win32"===process.platform?await this.removeWin32Link(t,e):await this.removePosixLink(t,e)}}async removePosixLink(t,e){const s=a().join(t,e);try{await n().promises.unlink(s)}catch(t){if("ENOENT"!==t.code)throw t}}async removeWin32Link(t,e){for(const s of["",".ps1",".cmd"]){const i=a().join(t,`${e}${s}`);try{await n().promises.unlink(i)}catch(t){if("ENOENT"!==t.code)throw t}}}}p.usage=i.mY.Usage({description:"Remove the Corepack shims from the install directory",details:"\n When run, this command will remove the shims for the specified package managers from the install directory, or all shims if no parameters are passed.\n\n By default it will locate the install directory by running the equivalent of `which corepack`, but this can be tweaked by explicitly passing the install directory via the `--bin-folder` flag.\n ",examples:[["Disable all shims, removing them if they're next to the `coreshim` binary","$0 disable"],["Disable all shims, removing them from the specified directory","$0 disable --install-directory /path/to/bin"],["Disable the Yarn shim only","$0 disable yarn"]]}),u([i.mY.String("--install-directory")],p.prototype,"installDirectory",void 0),u([i.mY.Rest()],p.prototype,"names",void 0),u([i.mY.Path("disable")],p.prototype,"execute",null)},6801:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{E:()=>EnableCommand});var _zkochan_cmd_shim__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(1474),_zkochan_cmd_shim__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(_zkochan_cmd_shim__WEBPACK_IMPORTED_MODULE_0__),clipanion__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(2408),fs__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(5747),fs__WEBPACK_IMPORTED_MODULE_2___default=__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_2__),path__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(5622),path__WEBPACK_IMPORTED_MODULE_3___default=__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_3__),which__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(9521),which__WEBPACK_IMPORTED_MODULE_4___default=__webpack_require__.n(which__WEBPACK_IMPORTED_MODULE_4__),_types__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(1476),__decorate=function(t,e,s,i){var r,n=arguments.length,o=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,s,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(n<3?r(o):n>3?r(e,s,o):r(e,s))||o);return n>3&&o&&Object.defineProperty(e,s,o),o};class EnableCommand extends clipanion__WEBPACK_IMPORTED_MODULE_1__.mY{constructor(){super(...arguments),this.names=[]}async execute(){let installDirectory=this.installDirectory;void 0===installDirectory&&(installDirectory=path__WEBPACK_IMPORTED_MODULE_3___default().dirname(await which__WEBPACK_IMPORTED_MODULE_4___default()("corepack")));const manifestPath=eval("require").resolve("corepack/package.json"),distFolder=path__WEBPACK_IMPORTED_MODULE_3___default().join(path__WEBPACK_IMPORTED_MODULE_3___default().dirname(manifestPath),"dist");if(!fs__WEBPACK_IMPORTED_MODULE_2___default().existsSync(distFolder))throw new Error("Assertion failed: The stub folder doesn't exist");const names=0===this.names.length?_types__WEBPACK_IMPORTED_MODULE_5__.sG:this.names;for(const t of new Set(names)){if(!(0,_types__WEBPACK_IMPORTED_MODULE_5__.c)(t))throw new clipanion__WEBPACK_IMPORTED_MODULE_1__.Oi(`Invalid package manager name '${t}'`);for(const e of this.context.engine.getBinariesFor(t))"win32"===process.platform?await this.generateWin32Link(installDirectory,distFolder,e):await this.generatePosixLink(installDirectory,distFolder,e)}}async generatePosixLink(t,e,s){const i=path__WEBPACK_IMPORTED_MODULE_3___default().join(t,s),r=path__WEBPACK_IMPORTED_MODULE_3___default().relative(t,path__WEBPACK_IMPORTED_MODULE_3___default().join(e,s+".js"));if(fs__WEBPACK_IMPORTED_MODULE_2___default().existsSync(i)){if(await fs__WEBPACK_IMPORTED_MODULE_2___default().promises.readlink(i)===r)return;await fs__WEBPACK_IMPORTED_MODULE_2___default().promises.unlink(i)}await fs__WEBPACK_IMPORTED_MODULE_2___default().promises.symlink(r,i)}async generateWin32Link(t,e,s){const i=path__WEBPACK_IMPORTED_MODULE_3___default().join(t,s);await _zkochan_cmd_shim__WEBPACK_IMPORTED_MODULE_0___default()(path__WEBPACK_IMPORTED_MODULE_3___default().join(e,s+".js"),i,{createCmdFile:!0})}}EnableCommand.usage=clipanion__WEBPACK_IMPORTED_MODULE_1__.mY.Usage({description:"Add the Corepack shims to the install directories",details:"\n When run, this commmand will check whether the shims for the specified package managers can be found with the correct values inside the install directory. If not, or if they don't exist, they will be created.\n\n By default it will locate the install directory by running the equivalent of `which corepack`, but this can be tweaked by explicitly passing the install directory via the `--bin-folder` flag.\n ",examples:[["Enable all shims, putting them next to the `corepath` binary","$0 enable"],["Enable all shims, putting them in the specified directory","$0 enable --install-directory /path/to/folder"],["Enable the Yarn shim only","$0 enable yarn"]]}),__decorate([clipanion__WEBPACK_IMPORTED_MODULE_1__.mY.String("--install-directory")],EnableCommand.prototype,"installDirectory",void 0),__decorate([clipanion__WEBPACK_IMPORTED_MODULE_1__.mY.Rest()],EnableCommand.prototype,"names",void 0),__decorate([clipanion__WEBPACK_IMPORTED_MODULE_1__.mY.Path("enable")],EnableCommand.prototype,"execute",null)},3886:(t,e,s)=>{"use strict";s.d(e,{H:()=>l});var i=s(2408),r=s(5622),n=s.n(r),o=s(5229),a=s(2404),h=s(1476),c=function(t,e,s,i){var r,n=arguments.length,o=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,s,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(n<3?r(o):n>3?r(e,s,o):r(e,s))||o);return n>3&&o&&Object.defineProperty(e,s,o),o};class l extends i.mY{constructor(){super(...arguments),this.activate=!1}async execute(){const t=a.o(),e=n().resolve(this.context.cwd,this.fileName),s=new Map;let r=!1;if(await o.t({file:e,onentry:t=>{const e=t.header.path.split(/\//g);if(e.length<3)r=!0;else{let t=s.get(e[0]);void 0===t&&s.set(e[0],t=new Set),t.add(e[1])}}}),r||s.size<1)throw new i.Oi("Invalid archive format; did it get generated by 'corepack prepare'?");for(const[r,n]of s)for(const s of n){if(!(0,h.c)(r))throw new i.Oi(`Unsupported package manager '${r}'`);this.activate?this.context.stdout.write(`Hydrating ${r}@${s} for immediate activation...\n`):this.context.stdout.write(`Hydrating ${r}@${s}...\n`),await o.x({file:e,cwd:t},[`${r}/${s}`]),this.activate&&await this.context.engine.activatePackageManager({name:r,reference:s})}this.context.stdout.write("All done!\n")}}l.usage=i.mY.Usage({description:"Import a package manager into the cache",details:"\n This command unpacks a package manager archive into the cache. The archive must have been generated by the `corepack prepare` command - no other will work.\n ",examples:[["Import a package manager in the cache","$0 hydrate corepack.tgz"]]}),c([i.mY.String()],l.prototype,"fileName",void 0),c([i.mY.Boolean("--activate")],l.prototype,"activate",void 0),c([i.mY.Path("hydrate")],l.prototype,"execute",null)},1172:(t,e,s)=>{"use strict";s.d(e,{$:()=>l});var i=s(2408),r=s(5622),n=s.n(r),o=s(5229),a=s(2404),h=s(3403),c=function(t,e,s,i){var r,n=arguments.length,o=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,s,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(n<3?r(o):n>3?r(e,s,o):r(e,s))||o);return n>3&&o&&Object.defineProperty(e,s,o),o};class l extends i.mY{constructor(){super(...arguments),this.specs=[],this.activate=!1,this.all=!1,this.json=!1}async execute(){if(this.all&&this.specs.length>0)throw new i.Oi("The --all option cannot be used along with an explicit package manager specification");const t=this.all?await this.context.engine.getDefaultDescriptors():this.specs,e=[];for(const s of t){let t;if(void 0===s){const e=await h.PE(this.context.cwd);switch(e.type){case"NoProject":throw new i.Oi("Couldn't find a project in the local directory - please explicit the package manager to pack, or run this command from a valid project");case"NoSpec":throw new i.Oi("The local project doesn't feature a 'packageManager' field - please explicit the package manager to pack, or update the manifest to reference it");default:t=e.spec}}else t="string"==typeof s?h.Bq(s,"CLI arguments"):s;const r=await this.context.engine.resolveDescriptor(t);if(null===r)throw new i.Oi(`Failed to successfully resolve '${t.range}' to a valid ${t.name} release`);this.json||(this.activate?this.context.stdout.write(`Preparing ${t.name}@${t.range} for immediate activation...\n`):this.context.stdout.write(`Preparing ${t.name}@${t.range}...\n`));const n=await this.context.engine.ensurePackageManager(r);e.push(n.location),this.activate&&await this.context.engine.activatePackageManager(r)}if(this.output){const t="string"==typeof this.output?this.output:"corepack.tgz",s=a.o(),i=n().resolve(this.context.cwd,t);this.json||this.context.stdout.write(`Packing the selected tools in ${n().basename(i)}...\n`),await o.c({gzip:!0,cwd:s,file:n().resolve(i)},e.map(t=>n().relative(s,t))),this.json?this.context.stdout.write(JSON.stringify(i)+"\n"):this.context.stdout.write("All done!\n")}}}l.usage=i.mY.Usage({description:"Generate a package manager archive",details:"\n This command makes sure that the specified package managers are installed in the local cache. Calling this command explicitly unless you operate in an environment without network access (in which case you'd have to call `prepare` while building your image, to make sure all tools are available for later use).\n\n When the `-o,--output` flag is set, Corepack will also compress the resulting package manager into a format suitable for `corepack hydrate`, and will store it at the specified location on the disk.\n ",examples:[["Prepare the package manager from the active project","$0 prepare"],["Prepare a specific Yarn version","$0 prepare yarn@2.2.2"],["Generate an archive for a specific Yarn version","$0 prepare yarn@2.2.2 -o"],["Generate a named archive","$0 prepare yarn@2.2.2 --output=yarn.tgz"]]}),c([i.mY.Rest()],l.prototype,"specs",void 0),c([i.mY.Boolean("--activate")],l.prototype,"activate",void 0),c([i.mY.Boolean("--all")],l.prototype,"all",void 0),c([i.mY.String("-o,--output",{tolerateBoolean:!0})],l.prototype,"output",void 0),c([i.mY.Boolean("--json")],l.prototype,"json",void 0),c([i.mY.Path("prepare")],l.prototype,"execute",null)},2404:(t,e,s)=>{"use strict";s.d(e,{o:()=>o,$:()=>a});var i=s(5747),r=s(2087),n=s(5622);function o(){var t;return null!==(t=process.env.COREPACK_HOME)&&void 0!==t?t:(0,n.join)((0,r.homedir)(),".node/corepack")}function a(t=(0,r.tmpdir)()){for((0,i.mkdirSync)(t,{recursive:!0});;){const e=(4294967296*Math.random()).toString(16).padStart(8,"0"),s=(0,n.join)(t,`corepack-${process.pid}-${e}`);try{return(0,i.mkdirSync)(s),s}catch(t){if("EEXIST"===t.code)continue;throw t}}}},3355:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{main:()=>main,runMain:()=>runMain});var clipanion__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(2408),_Engine__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(6163),_commands_Disable__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(1764),_commands_Enable__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(6801),_commands_Hydrate__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(3886),_commands_Prepare__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(1172),_miscUtils__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__(9469),_pmmUtils__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__(2543),_specUtils__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__(3403),_types__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__(1476);async function main(t,e){const s=t[0];if((0,_types__WEBPACK_IMPORTED_MODULE_9__.c)(s)){const i=s,r=t[1],n=new clipanion__WEBPACK_IMPORTED_MODULE_0__.zl({binaryName:r}),o=await e.engine.getDefaultVersion(s);class a extends clipanion__WEBPACK_IMPORTED_MODULE_0__.mY{constructor(){super(...arguments),this.proxy=[]}async execute(){var t;const s=e.engine.config.definitions[i];let n=!1;for(const t of s.transparent.commands)if(t[0]===r&&t.slice(1).every((t,e)=>t===this.proxy[e])){n=!0;break}const a=n&&null!==(t=s.transparent.default)&&void 0!==t?t:o,h={name:i,reference:a};let c;try{c=await _specUtils__WEBPACK_IMPORTED_MODULE_8__.oe(this.context.cwd,h,{transparent:n})}catch(t){if(t instanceof _miscUtils__WEBPACK_IMPORTED_MODULE_6__.u)return 1;throw t}const l=await e.engine.resolveDescriptor(c);if(null===l)throw new clipanion__WEBPACK_IMPORTED_MODULE_0__.Oi(`Failed to successfully resolve '${c.range}' to a valid ${c.name} release`);const u=await e.engine.ensurePackageManager(l);return await _pmmUtils__WEBPACK_IMPORTED_MODULE_7__.yZ(u,l,r,this.proxy,this.context)}}return a.addPath(),a.addOption("proxy",clipanion__WEBPACK_IMPORTED_MODULE_0__.mY.Proxy()),n.register(a),await n.run(t.slice(2),Object.assign(Object.assign({},clipanion__WEBPACK_IMPORTED_MODULE_0__.zl.defaultContext),e))}{const s=new clipanion__WEBPACK_IMPORTED_MODULE_0__.zl({binaryName:"corepack"});return s.register(clipanion__WEBPACK_IMPORTED_MODULE_0__.mY.Entries.Help),s.register(_commands_Enable__WEBPACK_IMPORTED_MODULE_3__.E),s.register(_commands_Disable__WEBPACK_IMPORTED_MODULE_2__.q),s.register(_commands_Hydrate__WEBPACK_IMPORTED_MODULE_4__.H),s.register(_commands_Prepare__WEBPACK_IMPORTED_MODULE_5__.$),await s.run(t,Object.assign(Object.assign({},clipanion__WEBPACK_IMPORTED_MODULE_0__.zl.defaultContext),e))}}function runMain(t){main(t,{cwd:process.cwd(),engine:new _Engine__WEBPACK_IMPORTED_MODULE_1__.D}).then(t=>{process.exitCode=t},t=>{console.error(t.stack),process.exitCode=1})}process.mainModule===eval("module")&&runMain(process.argv.slice(2))},9469:(t,e,s)=>{"use strict";s.d(e,{u:()=>i});class i extends Error{}},2543:(t,e,s)=>{"use strict";s.d(e,{CG:()=>b,HZ:()=>O,t:()=>R,yZ:()=>v});var i=s(324),r=s.n(i),n=s(2408),o=s(3129),a=s(7211),h=s.n(a),c=s(5747),l=s.n(c),u=s(5622),p=s.n(u),d=s(8775),f=s.n(d),m=s(5229);const y=r()("corepack");var g=s(2404);function _(t,e={}){if("0"===process.env.COREPACK_ENABLE_NETWORK)throw new n.Oi("Network access disabled by the environment; can't reach "+t);return new Promise((s,i)=>{h().get(t,e,t=>{var e;const r=null!==(e=t.statusCode)&&void 0!==e?e:500;return r>=200&&r<300?s(t):i(new Error("Server answered with HTTP "+r))}).on("error",t=>{i(t)})})}async function E(t,e){const s=await _(t,e);return new Promise((t,e)=>{const i=[];s.on("data",t=>{i.push(t)}),s.on("error",t=>{e(t)}),s.on("end",()=>{t(Buffer.concat(i))})})}const w=/^refs\/tags\/(.*)(?:\^\{\})?$/;async function b(t){switch(t.type){case"npm":{const e=await async function(t,e){const s=(await E(t,e)).toString();try{return JSON.parse(s)}catch(t){const e=s.length>30?s.slice(0,30)+"...":s;throw new Error("Couldn't parse JSON data: "+JSON.stringify(e))}}("https://registry.npmjs.org/"+t.package,{headers:{Accept:"application/vnd.npm.install-v1+json"}});return Object.keys(e.versions)}case"git":{const e=await async function(t){const e=await E(t+"/info/refs?service=git-upload-pack"),s=new Set;let i=0;for(;i=o)continue;const h=n.slice(a+1,o);if("capabilities^{}"===h)return new Set;s.add(h)}return s}(t.repository),s=new RegExp(`^${t.pattern.replace("{}","(.*)")}$`),i=[];for(const t of e){const e=t.match(w);if(!e)continue;const r=e[1].match(s);r&&i.push(r[1])}return i}default:throw new Error("Unsupported specification "+JSON.stringify(t))}}async function O(t,e){const s=p().join(t,e.name);let i;try{i=await l().promises.readdir(s)}catch(t){if("ENOENT"!==t.code)throw t;i=[]}const r=[];for(const t of i)t.startsWith(".")||r.push(t);const n=f().maxSatisfying(r,e.range);return null===n?null:n}async function R(t,e,{spec:s}){const i=p().join(t,e.name,e.reference);if(l().existsSync(i))return y(`Reusing ${e.name}@${e.reference}`),i;const r=s.url.replace("{}",e.reference);return y(`Installing ${e.name}@${e.reference} from ${r}`),await async function(t,e){return await e()}(0,async()=>{const e=g.$(t),s=await _(r),n=new URL(r),o=p().posix.extname(n.pathname);let a,h=null;return".tgz"===o?a=m.x({strip:1,cwd:e}):".js"===o&&(h=p().join(e,p().posix.basename(n.pathname)),a=l().createWriteStream(h)),s.pipe(a),await new Promise(t=>{a.on("finish",t)}),await l().promises.mkdir(p().dirname(i),{recursive:!0}),await l().promises.rename(e,i),y("Install finished"),i})}async function v(t,e,s,i,r){let n=null;if(Array.isArray(t.spec.bin)){if(t.spec.bin.some(t=>t===s)){const e=new URL(t.spec.url);".js"===p().posix.extname(e.pathname)&&(n=p().join(t.location,p().posix.basename(e.pathname)))}}else for(const[e,i]of Object.entries(t.spec.bin))if(e===s){n=p().join(t.location,i);break}if(!n)throw new Error(`Assertion failed: Unable to locate path for bin '${s}'`);return new Promise((t,e)=>{process.on("SIGINT",()=>{});const s=["pipe","pipe","pipe"];r.stdin===process.stdin&&(s[0]="inherit"),r.stdout===process.stdout&&(s[1]="inherit"),r.stderr===process.stderr&&(s[2]="inherit");const a=(0,o.spawn)(process.execPath,[n,...i],{cwd:r.cwd,stdio:s});r.stdin!==process.stdin&&r.stdin.pipe(a.stdin),r.stdout!==process.stdout&&a.stdout.pipe(r.stdout),r.stderr!==process.stderr&&a.stderr.pipe(r.stderr),a.on("exit",e=>{t(null!==e?e:1)})})}},3403:(t,e,s)=>{"use strict";s.d(e,{Bq:()=>u,oe:()=>p,PE:()=>d});var i=s(2408),r=s(5747),n=s.n(r),o=s(5622),a=s.n(o),h=s(8775),c=s.n(h),l=s(1476);function u(t,e){if("string"!=typeof t)throw new i.Oi(`Invalid package manager specification in ${e}; expected a string`);const s=t.match(/^(?!_)(.+)@(.+)$/);if(null===s||!c().valid(s[2]))throw new i.Oi(`Invalid package manager specification in ${e}; expected a semver version`);if(!(0,l.c)(s[1]))throw new i.Oi(`Unsupported package manager specification (${s})`);return{name:s[1],range:s[2]}}async function p(t,e,{transparent:s=!1}={}){const r={name:e.name,range:e.reference};for(;;){const n=await d(t);switch(n.type){case"NoProject":case"NoSpec":return r;case"Found":if(n.spec.name!==e.name){if(s)return r;throw new i.Oi("This project is configured to use "+n.spec.name)}return n.spec}}}async function d(t){let e=t,s="",r=null;for(;e!==s&&null===r;){s=e,e=a().dirname(s);const o=a().join(s,"package.json");if(!n().existsSync(o))continue;const h=await n().promises.readFile(o,"utf8");let c;try{c=JSON.parse(h)}catch(t){}if("object"!=typeof c||null===c)throw new i.Oi("Invalid package.json in "+a().relative(t,o));r={data:c,manifestPath:o}}if(null===r)return{type:"NoProject",target:a().join(t,"package.json")};const o=r.data.packageManager;return void 0===o?{type:"NoSpec",target:r.manifestPath}:{type:"Found",spec:u(o,a().relative(t,r.manifestPath))}}},1476:(t,e,s)=>{"use strict";var i;s.d(e,{JR:()=>r,sG:()=>n,c:()=>o}),function(t){t.Npm="npm",t.Pnpm="pnpm",t.Yarn="yarn"}(i||(i={}));const r=new Set(Object.values(i)),n=new Set(Object.values(i));function o(t){return r.has(t)}n.delete(i.Npm)},1474:(t,e,s)=>{"use strict";l.ifExists=function(t,e,s){return l(t,e,s).catch(()=>{})};const i=s(1669),r=s(5622),n=s(3290),o=/^#!\s*(?:\/usr\/bin\/env)?\s*([^ \t]+)(.*)$/,a={createPwshFile:!0,createCmdFile:n(),fs:s(5747)},h=new Map([[".js","node"],[".cmd","cmd"],[".bat","cmd"],[".ps1","pwsh"],[".sh","sh"]]);function c(t){const e={...a,...t},s=e.fs;return e.fs_={chmod:s.chmod?i.promisify(s.chmod):async()=>{},mkdir:i.promisify(s.mkdir),readFile:i.promisify(s.readFile),stat:i.promisify(s.stat),unlink:i.promisify(s.unlink),writeFile:i.promisify(s.writeFile)},e}async function l(t,e,s){const i=c(s);await i.fs_.stat(t),await async function(t,e,s){const i=await async function(t,e){const s=await e.fs_.readFile(t,"utf8"),i=s.trim().split(/\r*\n/)[0].match(o);if(!i){const e=r.extname(t).toLowerCase();return{program:h.get(e)||null,additionalArgs:""}}return{program:i[1],additionalArgs:i[2]}}(t,s);return await function(t,e){return e.fs_.mkdir(r.dirname(t),{recursive:!0})}(e,s),function(t,e,s,i){const r=c(i),n=[{generator:p,extension:""}];r.createCmdFile&&n.push({generator:u,extension:".cmd"});r.createPwshFile&&n.push({generator:d,extension:".ps1"});return Promise.all(n.map(i=>async function(t,e,s,i,r){const n=r.preserveSymlinks?"--preserve-symlinks":"",o=[s.additionalArgs,n].filter(t=>t).join(" ");return r=Object.assign({},r,{prog:s.program,args:o}),await function(t,e){return function(t,e){return e.fs_.unlink(t).catch(()=>{})}(t,e)}(e,r),await r.fs_.writeFile(e,i(t,e,r),"utf8"),function(t,e){return function(t,e){return e.fs_.chmod(t,493)}(t,e)}(e,r)}(t,e+i.extension,s,i.generator,r)))}(t,e,i,s)}(t,e,i)}function u(t,e,s){let i=r.relative(r.dirname(e),t).split("/").join("\\");const n=r.isAbsolute(i)?`"${i}"`:`"%~dp0\\${i}"`;let o,a=s.prog,h=s.args||"";const c=f(s.nodePath).win32;a?(o=`"%~dp0\\${a}.exe"`,i=n):(a=n,h="",i="");let l=s.progArgs?s.progArgs.join(" ")+" ":"",u=c?`@SET NODE_PATH=${c}\r\n`:"";return u+=o?`@IF EXIST ${o} (\r\n ${o} ${h} ${i} ${l}%*\r\n) ELSE (\r\n @SETLOCAL\r\n @SET PATHEXT=%PATHEXT:;.JS;=;%\r\n ${a} ${h} ${i} ${l}%*\r\n)`:`@${a} ${h} ${i} ${l}%*\r\n`,u}function p(t,e,s){let i,n=r.relative(r.dirname(e),t),o=s.prog&&s.prog.split("\\").join("/");n=n.split("\\").join("/");const a=r.isAbsolute(n)?`"${n}"`:`"$basedir/${n}"`;let h=s.args||"";const c=f(s.nodePath).posix;o?(i=`"$basedir/${s.prog}"`,n=a):(o=a,h="",n="");let l=s.progArgs?s.progArgs.join(" ")+" ":"",u="#!/bin/sh\n";u+='basedir=$(dirname "$(echo "$0" | sed -e \'s,\\\\,/,g\')")\n\ncase `uname` in\n *CYGWIN*) basedir=`cygpath -w "$basedir"`;;\nesac\n\n';const p=s.nodePath?`export NODE_PATH="${c}"\n`:"";return u+=i?p+`if [ -x ${i} ]; then\n`+` exec ${i} ${h} ${n} ${l}"$@"\nelse \n`+` exec ${o} ${h} ${n} ${l}"$@"\nfi\n`:`${p}${o} ${h} ${n} ${l}"$@"\nexit $?\n`,u}function d(t,e,s){let i=r.relative(r.dirname(e),t);const n=s.prog&&s.prog.split("\\").join("/");let o,a=n&&`"${n}$exe"`;i=i.split("\\").join("/");const h=r.isAbsolute(i)?`"${i}"`:`"$basedir/${i}"`;let c=s.args||"",l=f(s.nodePath);const u=l.win32,p=l.posix;a?(o=`"$basedir/${s.prog}$exe"`,i=h):(a=h,c="",i="");let d=s.progArgs?s.progArgs.join(" ")+" ":"",m='#!/usr/bin/env pwsh\n$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent\n\n$exe=""\n'+(s.nodePath?`$env_node_path=$env:NODE_PATH\n$env:NODE_PATH="${u}"\n`:"")+'if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {\n # Fix case when both the Windows and Linux builds of Node\n # are installed in the same directory\n $exe=".exe"\n}';return s.nodePath&&(m=m+" else {\n"+` $env:NODE_PATH="${p}"\n}`),m+="\n",m=o?m+"$ret=0\n"+`if (Test-Path ${o}) {\n # Support pipeline input\n if ($MyInvocation.ExpectingInput) {\n`+` $input | & ${o} ${c} ${i} ${d}$args\n } else {\n`+` & ${o} ${c} ${i} ${d}$args\n }\n $ret=$LASTEXITCODE\n} else {\n # Support pipeline input\n if ($MyInvocation.ExpectingInput) {\n`+` $input | & ${a} ${c} ${i} ${d}$args\n } else {\n`+` & ${a} ${c} ${i} ${d}$args\n }\n $ret=$LASTEXITCODE\n}\n`+(s.nodePath?"$env:NODE_PATH=$env_node_path\n":"")+"exit $ret\n":m+"# Support pipeline input\nif ($MyInvocation.ExpectingInput) {\n"+` $input | & ${a} ${c} ${i} ${d}$args\n} else {\n`+` & ${a} ${c} ${i} ${d}$args\n}\n`+(s.nodePath?"$env:NODE_PATH=$env_node_path\n":"")+"exit $LASTEXITCODE\n",m}function f(t){if(!t)return{win32:"",posix:""};let e="string"==typeof t?t.split(r.delimiter):Array.from(t),s={};for(let t=0;t"/mnt/"+e.toLowerCase()):e[t];s.win32=s.win32?`${s.win32};${i}`:i,s.posix=s.posix?`${s.posix}:${r}`:r,s[t]={win32:i,posix:r}}return s}t.exports=l},7059:(t,e,s)=>{"use strict";const i=s(5747),r=s(5622),n=i.lchown?"lchown":"chown",o=i.lchownSync?"lchownSync":"chownSync",a=i.lchown&&!process.version.match(/v1[1-9]+\./)&&!process.version.match(/v10\.[6-9]/),h=(t,e,s)=>{try{return i[o](t,e,s)}catch(t){if("ENOENT"!==t.code)throw t}},c=a?(t,e,s,r)=>n=>{n&&"EISDIR"===n.code?i.chown(t,e,s,r):r(n)}:(t,e,s,i)=>i,l=a?(t,e,s)=>{try{return h(t,e,s)}catch(r){if("EISDIR"!==r.code)throw r;((t,e,s)=>{try{i.chownSync(t,e,s)}catch(t){if("ENOENT"!==t.code)throw t}})(t,e,s)}}:(t,e,s)=>h(t,e,s),u=process.version;let p=(t,e,s)=>i.readdir(t,e,s);/^v4\./.test(u)&&(p=(t,e,s)=>i.readdir(t,s));const d=(t,e,s,r)=>{i[n](t,e,s,c(t,e,s,t=>{r(t&&"ENOENT"!==t.code?t:null)}))},f=(t,e,s,n,o)=>{if("string"==typeof e)return i.lstat(r.resolve(t,e),(i,r)=>{if(i)return o("ENOENT"!==i.code?i:null);r.name=e,f(t,r,s,n,o)});if(e.isDirectory())m(r.resolve(t,e.name),s,n,i=>{if(i)return o(i);const a=r.resolve(t,e.name);d(a,s,n,o)});else{const i=r.resolve(t,e.name);d(i,s,n,o)}},m=(t,e,s,i)=>{p(t,{withFileTypes:!0},(r,n)=>{if(r){if("ENOENT"===r.code)return i();if("ENOTDIR"!==r.code&&"ENOTSUP"!==r.code)return i(r)}if(r||!n.length)return d(t,e,s,i);let o=n.length,a=null;const h=r=>{if(!a)return r?i(a=r):0==--o?d(t,e,s,i):void 0};n.forEach(i=>f(t,i,e,s,h))})},y=(t,e,s)=>{let n;try{n=((t,e)=>i.readdirSync(t,e))(t,{withFileTypes:!0})}catch(i){if("ENOENT"===i.code)return;if("ENOTDIR"===i.code||"ENOTSUP"===i.code)return l(t,e,s);throw i}return n&&n.length&&n.forEach(n=>((t,e,s,n)=>{if("string"==typeof e)try{const s=i.lstatSync(r.resolve(t,e));s.name=e,e=s}catch(t){if("ENOENT"===t.code)return;throw t}e.isDirectory()&&y(r.resolve(t,e.name),s,n),l(r.resolve(t,e.name),s,n)})(t,n,e,s)),l(t,e,s)};t.exports=m,m.sync=y},2408:(t,e)=>{"use strict";const s=/^(-h|--help)(?:=([0-9]+))?$/,i=/^(--[a-z]+(?:-[a-z]+)*|-[a-zA-Z]+)$/,r=/^-[a-zA-Z]{2,}$/,n=/^([^=]+)=([\s\S]*)$/,o="1"===process.env.DEBUG_CLI;class a extends Error{constructor(t){super(t),this.clipanion={type:"usage"},this.name="UsageError"}}class h extends Error{constructor(t,e){if(super(),this.input=t,this.candidates=e,this.clipanion={type:"none"},this.name="UnknownSyntaxError",0===this.candidates.length)this.message="Command not found, but we're not sure what's the alternative.";else if(1===this.candidates.length&&null!==this.candidates[0].reason){const[{usage:t,reason:e}]=this.candidates;this.message=`${e}\n\n$ ${t}`}else if(1===this.candidates.length){const[{usage:e}]=this.candidates;this.message=`Command not found; did you mean:\n\n$ ${e}\n${l(t)}`}else this.message=`Command not found; did you mean one of:\n\n${this.candidates.map(({usage:t},e)=>`${(e+".").padStart(4)} ${t}`).join("\n")}\n\n${l(t)}`}}class c extends Error{constructor(t,e){super(),this.input=t,this.usages=e,this.clipanion={type:"none"},this.name="AmbiguousSyntaxError",this.message=`Cannot find who to pick amongst the following alternatives:\n\n${this.usages.map((t,e)=>`${(e+".").padStart(4)} ${t}`).join("\n")}\n\n${l(t)}`}}const l=t=>"While running "+t.filter(t=>"\0"!==t).map(t=>{const e=JSON.stringify(t);return t.match(/\s/)||0===t.length||e!==`"${t}"`?e:t}).join(" ");function u(t){o&&console.log(t)}const p={candidateUsage:null,errorMessage:null,ignoreOptions:!1,path:[],positionals:[],options:[],remainder:null,selectedIndex:-1};function d(t,e){return t.nodes.push(e),t.nodes.length-1}function f(t,e,s=!1){u("Running a vm on "+JSON.stringify(e));let i=[{node:0,state:{candidateUsage:null,errorMessage:null,ignoreOptions:!1,options:[],path:[],positionals:[],remainder:null,selectedIndex:null}}];!function(t,{prefix:e=""}={}){u(e+"Nodes are:");for(let s=0;s2!==t).map(({state:t})=>({usage:t.candidateUsage,reason:null})));if(a.every(({node:t})=>2===t))throw new h(e,a.map(({state:t})=>({usage:t.candidateUsage,reason:t.errorMessage})));i=g(a)}if(i.length>0){u(" Results:");for(const t of i)u(` - ${t.node} -> ${JSON.stringify(t.state)}`)}else u(" No results");return i}function m(t,e){if(null!==e.selectedIndex)return!0;if(Object.prototype.hasOwnProperty.call(t.statics,"\0"))for(const{to:e}of t.statics["\0"])if(1===e)return!0;return!1}function y(t,e){return function(t,e){const s=e.filter(t=>null!==t.selectedIndex);if(0===s.length)throw new Error;let i=0;for(const t of s)t.path.length>i&&(i=t.path.length);const r=s.filter(t=>t.path.length===i),n=t=>t.positionals.filter(({extra:t})=>!t).length+t.options.length,o=r.map(t=>({state:t,positionalCount:n(t)}));let a=0;for(const{positionalCount:t}of o)t>a&&(a=t);const h=function(t){const e=[],s=[];for(const i of t)-1===i.selectedIndex?s.push(i):e.push(i);s.length>0&&e.push(Object.assign(Object.assign({},p),{path:_(...s.map(t=>t.path)),options:s.reduce((t,e)=>t.concat(e.options),[])}));return e}(o.filter(({positionalCount:t})=>t===a).map(({state:t})=>t));if(h.length>1)throw new c(t,h.map(t=>t.candidateUsage));return h[0]}(e,f(t,[...e,"\0"]).map(({state:t})=>t))}function g(t){let e=0;for(const{state:s}of t)s.path.length>e&&(e=s.path.length);return t.filter(({state:t})=>t.path.length===e)}function _(t,e,...s){return void 0===e?Array.from(t):_(t.filter((t,s)=>t===e[s]),...s)}function E(t){return 1===t||2===t}function w(t,e=0){return{to:E(t.to)?t.to:t.to>2?t.to+e-2:t.to+e,reducer:t.reducer}}function b(t,e=0){const s={dynamics:[],shortcuts:[],statics:{}};for(const[i,r]of t.dynamics)s.dynamics.push([i,w(r,e)]);for(const i of t.shortcuts)s.shortcuts.push(w(i,e));for(const[i,r]of Object.entries(t.statics))s.statics[i]=r.map(t=>w(t,e));return s}function O(t,e,s,i,r){t.nodes[e].dynamics.push([s,{to:i,reducer:r}])}function R(t,e,s,i){t.nodes[e].shortcuts.push({to:s,reducer:i})}function v(t,e,s,i,r){(Object.prototype.hasOwnProperty.call(t.nodes[e].statics,s)?t.nodes[e].statics[s]:t.nodes[e].statics[s]=[]).push({to:i,reducer:r})}function S(t,e,s,i){if(Array.isArray(e)){const[r,...n]=e;return t[r](s,i,...n)}return t[e](s,i)}function x(t,e){const s=Array.isArray(t)?I[t[0]]:I[t];if(void 0===s.suggest)return null;const i=Array.isArray(t)?t.slice(1):[];return s.suggest(e,...i)}const I={always:()=>!0,isOptionLike:(t,e)=>!t.ignoreOptions&&e.startsWith("-"),isNotOptionLike:(t,e)=>t.ignoreOptions||!e.startsWith("-"),isOption:(t,e,s,i)=>!t.ignoreOptions&&e===s,isBatchOption:(t,e,s)=>!t.ignoreOptions&&r.test(e)&&[...e.slice(1)].every(t=>s.includes("-"+t)),isBoundOption:(t,e,s,r)=>{const o=e.match(n);return!t.ignoreOptions&&!!o&&i.test(o[1])&&s.includes(o[1])&&r.filter(t=>t.names.includes(o[1])).every(t=>t.allowBinding)},isNegatedOption:(t,e,s)=>!t.ignoreOptions&&e==="--no-"+s.slice(2),isHelp:(t,e)=>!t.ignoreOptions&&s.test(e),isUnsupportedOption:(t,e,s)=>!t.ignoreOptions&&e.startsWith("-")&&i.test(e)&&!s.includes(e),isInvalidOption:(t,e)=>!t.ignoreOptions&&e.startsWith("-")&&!i.test(e)};I.isOption.suggest=(t,e,s=!0)=>s?null:[e];const T={setCandidateUsage:(t,e,s)=>Object.assign(Object.assign({},t),{candidateUsage:s}),setSelectedIndex:(t,e,s)=>Object.assign(Object.assign({},t),{selectedIndex:s}),pushBatch:(t,e)=>Object.assign(Object.assign({},t),{options:t.options.concat([...e.slice(1)].map(t=>({name:"-"+t,value:!0})))}),pushBound:(t,e)=>{const[,s,i]=e.match(n);return Object.assign(Object.assign({},t),{options:t.options.concat({name:s,value:i})})},pushPath:(t,e)=>Object.assign(Object.assign({},t),{path:t.path.concat(e)}),pushPositional:(t,e)=>Object.assign(Object.assign({},t),{positionals:t.positionals.concat({value:e,extra:!1})}),pushExtra:(t,e)=>Object.assign(Object.assign({},t),{positionals:t.positionals.concat({value:e,extra:!0})}),pushExtraNoLimits:(t,e)=>Object.assign(Object.assign({},t),{positionals:t.positionals.concat({value:e,extra:C})}),pushTrue:(t,e,s=e)=>Object.assign(Object.assign({},t),{options:t.options.concat({name:e,value:!0})}),pushFalse:(t,e,s=e)=>Object.assign(Object.assign({},t),{options:t.options.concat({name:s,value:!1})}),pushUndefined:(t,e)=>Object.assign(Object.assign({},t),{options:t.options.concat({name:e,value:void 0})}),pushStringValue:(t,e)=>{var s;const i=Object.assign(Object.assign({},t),{options:[...t.options]}),r=t.options[t.options.length-1];return r.value=(null!==(s=r.value)&&void 0!==s?s:[]).concat([e]),i},setStringValue:(t,e)=>{const s=Object.assign(Object.assign({},t),{options:[...t.options]});return t.options[t.options.length-1].value=e,s},inhibateOptions:t=>Object.assign(Object.assign({},t),{ignoreOptions:!0}),useHelp:(t,e,i)=>{const[,r,n]=e.match(s);return void 0!==n?Object.assign(Object.assign({},t),{options:[{name:"-c",value:String(i)},{name:"-i",value:n}]}):Object.assign(Object.assign({},t),{options:[{name:"-c",value:String(i)}]})},setError:(t,e,s)=>"\0"===e?Object.assign(Object.assign({},t),{errorMessage:s+"."}):Object.assign(Object.assign({},t),{errorMessage:`${s} ("${e}").`}),setOptionArityError:(t,e)=>{const s=t.options[t.options.length-1];return Object.assign(Object.assign({},t),{errorMessage:`Not enough arguments to option ${s.name}.`})}},C=Symbol();class A{constructor(t,e){this.allOptionNames=[],this.arity={leading:[],trailing:[],extra:[],proxy:!1},this.options=[],this.paths=[],this.cliIndex=t,this.cliOpts=e}addPath(t){this.paths.push(t)}setArity({leading:t=this.arity.leading,trailing:e=this.arity.trailing,extra:s=this.arity.extra,proxy:i=this.arity.proxy}){Object.assign(this.arity,{leading:t,trailing:e,extra:s,proxy:i})}addPositional({name:t="arg",required:e=!0}={}){if(!e&&this.arity.extra===C)throw new Error("Optional parameters cannot be declared when using .rest() or .proxy()");if(!e&&this.arity.trailing.length>0)throw new Error("Optional parameters cannot be declared after the required trailing positional arguments");e||this.arity.extra===C?this.arity.extra!==C&&0===this.arity.extra.length?this.arity.leading.push(t):this.arity.trailing.push(t):this.arity.extra.push(t)}addRest({name:t="arg",required:e=0}={}){if(this.arity.extra===C)throw new Error("Infinite lists cannot be declared multiple times in the same command");if(this.arity.trailing.length>0)throw new Error("Infinite lists cannot be declared after the required trailing positional arguments");for(let s=0;s1)throw new Error("The arity cannot be higher than 1 when the option only supports the --arg=value syntax");if(!Number.isInteger(s))throw new Error("The arity must be an integer, got "+s);if(s<0)throw new Error("The arity must be positive, got "+s);this.allOptionNames.push(...t),this.options.push({names:t,description:e,arity:s,hidden:i,allowBinding:r})}setContext(t){this.context=t}usage({detailed:t=!0,inlineOptions:e=!0}={}){const s=[this.cliOpts.binaryName],i=[];if(this.paths.length>0&&s.push(...this.paths[0]),t){for(const{names:t,arity:r,hidden:n,description:o}of this.options){if(n)continue;const a=[];for(let t=0;t`<${t}>`)),this.arity.extra===C?s.push("..."):s.push(...this.arity.extra.map(t=>`[${t}]`)),s.push(...this.arity.trailing.map(t=>`<${t}>`))}return{usage:s.join(" "),options:i}}compile(){if(void 0===this.context)throw new Error("Assertion failed: No context attached");const t={nodes:[{dynamics:[],shortcuts:[],statics:{}},{dynamics:[],shortcuts:[],statics:{}},{dynamics:[],shortcuts:[],statics:{}}]};let e=0;e=d(t,{dynamics:[],shortcuts:[],statics:{}}),v(t,0,"",e,["setCandidateUsage",this.usage().usage]);const s=this.arity.proxy?"always":"isNotOptionLike",i=this.paths.length>0?this.paths:[[]];for(const r of i){let i=e;if(r.length>0){const e=d(t,{dynamics:[],shortcuts:[],statics:{}});R(t,i,e),this.registerOptions(t,e),i=e}for(let e=0;e0||!this.arity.proxy){const e=d(t,{dynamics:[],shortcuts:[],statics:{}});O(t,i,"isHelp",e,["useHelp",this.cliIndex]),v(t,e,"\0",1,["setSelectedIndex",-1]),this.registerOptions(t,i)}this.arity.leading.length>0&&v(t,i,"\0",2,["setError","Not enough positional arguments"]);let n=i;for(let e=0;e0||e+1!==this.arity.leading.length)&&v(t,s,"\0",2,["setError","Not enough positional arguments"]),O(t,n,"isNotOptionLike",s,"pushPositional"),n=s}let o=n;if(this.arity.extra===C||this.arity.extra.length>0){const e=d(t,{dynamics:[],shortcuts:[],statics:{}});if(R(t,n,e),this.arity.extra===C){const i=d(t,{dynamics:[],shortcuts:[],statics:{}});this.arity.proxy||this.registerOptions(t,i),O(t,n,s,i,"pushExtraNoLimits"),O(t,i,s,i,"pushExtraNoLimits"),R(t,i,e)}else for(let i=0;i0&&v(t,o,"\0",2,["setError","Not enough positional arguments"]);let a=o;for(let e=0;ee.length>t.length?e:t,"");if(0===s.arity)for(const r of s.names)O(t,e,["isOption",r,s.hidden||r!==i],e,"pushTrue"),r.startsWith("--")&&!r.startsWith("--no-")&&O(t,e,["isNegatedOption",r],e,["pushFalse",r]);else{let r=d(t,{dynamics:[],shortcuts:[],statics:{}});for(const n of s.names)O(t,e,["isOption",n,s.hidden||n!==i],r,"pushUndefined");for(let e=0;e=0&&t{if(e.has(i))return;e.add(i);const r=t.nodes[i];for(const t of Object.values(r.statics))for(const{to:e}of t)s(e);for(const[,{to:t}]of r.dynamics)s(t);for(const{to:t}of r.shortcuts)s(t);const n=new Set(r.shortcuts.map(({to:t})=>t));for(;r.shortcuts.length>0;){const{to:e}=r.shortcuts.shift(),s=t.nodes[e];for(const[t,e]of Object.entries(s.statics)){let s=Object.prototype.hasOwnProperty.call(r.statics,t)?r.statics[t]:r.statics[t]=[];for(const t of e)s.some(({to:e})=>t.to===e)||s.push(t)}for(const[t,e]of s.dynamics)r.dynamics.some(([s,{to:i}])=>t===s&&e.to===i)||r.dynamics.push([t,e]);for(const t of s.shortcuts)n.has(t.to)||(r.shortcuts.push(t),n.add(t.to))}};s(0)}(s),{machine:s,contexts:e,process:t=>y(s,t),suggest:(t,e)=>function(t,e,s){const i=s&&e.length>0?[""]:[],r=f(t,e,s),n=[],o=new Set,a=(e,s,i=!0)=>{let r=[s];for(;r.length>0;){const s=r;r=[];for(const n of s){const s=t.nodes[n],o=Object.keys(s.statics);for(const t of Object.keys(s.statics)){const t=o[0];for(const{to:n,reducer:o}of s.statics[t])"pushPath"===o&&(i||e.push(t),r.push(n))}}i=!1}const a=JSON.stringify(e);o.has(a)||(n.push(e),o.add(a))};for(const{node:e,state:s}of r){if(null!==s.remainder){a([s.remainder],e);continue}const r=t.nodes[e],n=m(r,s);for(const[t,s]of Object.entries(r.statics))(n&&"\0"!==t||!t.startsWith("-")&&s.some(({reducer:t})=>"pushPath"===t))&&a([...i,t],e);if(n)for(const[t,{to:n}]of r.dynamics){if(2===n)continue;const r=x(t,s);if(null!==r)for(const t of r)a([...i,t],e)}}return[...n].sort()}(s,t,e)}}}class k{constructor(){this.help=!1}static getMeta(t){const e=t.constructor;return e.meta=Object.prototype.hasOwnProperty.call(e,"meta")?e.meta:{definitions:[],transformers:[(t,e)=>{for(const{name:s,value:i}of t.options)"-h"!==s&&"--help"!==s||(e.help=i)}]}}static resolveMeta(t){const e=[],s=[];for(let i=t;i instanceof k;i=i.__proto__){const t=this.getMeta(i);for(const s of t.definitions)e.push(s);for(const e of t.transformers)s.push(e)}return{definitions:e,transformers:s}}static registerDefinition(t,e){this.getMeta(t).definitions.push(e)}static registerTransformer(t,e){this.getMeta(t).transformers.push(e)}static addPath(...t){this.Path(...t)(this.prototype,"execute")}static addOption(t,e){e(this.prototype,t)}static Path(...t){return(e,s)=>{this.registerDefinition(e,e=>{e.addPath(t)})}}static Boolean(t,{hidden:e=!1,description:s}={}){return(i,r)=>{const n=t.split(",");this.registerDefinition(i,t=>{t.addOption({names:n,arity:0,hidden:e,allowBinding:!1,description:s})}),this.registerTransformer(i,(t,e)=>{for(const{name:s,value:i}of t.options)n.includes(s)&&(e[r]=i)})}}static Counter(t,{hidden:e=!1,description:s}={}){return(i,r)=>{const n=t.split(",");this.registerDefinition(i,t=>{t.addOption({names:n,arity:0,hidden:e,allowBinding:!1,description:s})}),this.registerTransformer(i,(t,e)=>{var s;for(const{name:i,value:o}of t.options)n.includes(i)&&(null!==(s=e[r])&&void 0!==s||(e[r]=0),o?e[r]++:e[r]=0)})}}static String(t={},{arity:e=1,tolerateBoolean:s=!1,hidden:i=!1,description:r}={}){return(n,o)=>{if("string"==typeof t){const a=t.split(",");this.registerDefinition(n,t=>{t.addOption({names:a,arity:s?0:e,hidden:i,description:r})}),this.registerTransformer(n,(t,e)=>{for(const{name:s,value:i}of t.options)a.includes(s)&&(e[o]=i)})}else{const{name:e=o,required:s=!0}=t;this.registerDefinition(n,t=>{t.addPositional({name:e,required:s})}),this.registerTransformer(n,(t,e)=>{for(let i=0;i{if(0===e)throw new Error("Array options are expected to have at least an arity of 1");const o=t.split(",");this.registerDefinition(r,t=>{t.addOption({names:o,arity:e,hidden:s,description:i})}),this.registerTransformer(r,(t,e)=>{for(const{name:s,value:i}of t.options)o.includes(s)&&(e[n]=e[n]||[],e[n].push(i))})}}static Rest({required:t=0}={}){return(e,s)=>{this.registerDefinition(e,e=>{e.addRest({name:s,required:t})}),this.registerTransformer(e,(t,e,i)=>{const r=e=>{const s=t.positionals[e];return s.extra===C||!1===s.extra&&et)})}}static Proxy({required:t=0}={}){return(e,s)=>{this.registerDefinition(e,e=>{e.addProxy({required:t})}),this.registerTransformer(e,(t,e)=>{e[s]=t.positionals.map(({value:t})=>t)})}}static Usage(t){return t}static Schema(t){return t}async catch(t){throw t}async validateAndExecute(){const t=this.constructor.schema;if(void 0!==t)try{await t.validate(this)}catch(t){throw"ValidationError"===t.name&&(t.clipanion={type:"usage"}),t}const e=await this.execute();return void 0!==e?e:0}}
+/*! *****************************************************************************
+Copyright (c) Microsoft Corporation.
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
+REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
+INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+PERFORMANCE OF THIS SOFTWARE.
+***************************************************************************** */
+function P(t,e,s,i){var r,n=arguments.length,o=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,s,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(n<3?r(o):n>3?r(e,s,o):r(e,s))||o);return n>3&&o&&Object.defineProperty(e,s,o),o}k.Entries={};class D extends k{async execute(){this.context.stdout.write(this.cli.usage(null))}}P([k.Path("--help"),k.Path("-h")],D.prototype,"execute",null);class N extends k{async execute(){var t;this.context.stdout.write((null!==(t=this.cli.binaryVersion)&&void 0!==t?t:"")+"\n")}}P([k.Path("--version"),k.Path("-v")],N.prototype,"execute",null);const $={bold:t=>`[1m${t}[22m`,error:t=>`[31m[1m${t}[22m[39m`,code:t=>`[36m${t}[39m`},M={bold:t=>t,error:t=>t,code:t=>t};function F(t,{format:e,paragraphs:s}){return t=(t=(t=(t=(t=t.replace(/\r\n?/g,"\n")).replace(/^[\t ]+|[\t ]+$/gm,"")).replace(/^\n+|\n+$/g,"")).replace(/^-([^\n]*?)\n+/gm,"-$1\n\n")).replace(/\n(\n)?\n*/g,"$1"),s&&(t=t.split(/\n/).map((function(t){let e=t.match(/^[*-][\t ]+(.*)/);return e?e[1].match(/(.{1,78})(?: |$)/g).map((t,e)=>(0===e?"- ":" ")+t).join("\n"):t.match(/(.{1,80})(?: |$)/g).join("\n")})).join("\n\n")),(t=t.replace(/(`+)((?:.|[\n])*?)\1/g,(function(t,s,i){return e.code(s+i+s)})))?t+"\n":""}class B extends k{constructor(t){super(),this.contexts=t,this.commands=[]}static from(t,e){const s=new B(e);s.path=t.path;for(const e of t.options)switch(e.name){case"-c":s.commands.push(Number(e.value));break;case"-i":s.index=Number(e.value)}return s}async execute(){let t=this.commands;if(void 0!==this.index&&this.index>=0&&this.index1){this.context.stdout.write("Multiple commands match your selection:\n"),this.context.stdout.write("\n");let t=0;for(const e of this.commands)this.context.stdout.write(this.cli.usage(this.contexts[e].commandClass,{prefix:(t+++". ").padStart(5)}));this.context.stdout.write("\n"),this.context.stdout.write("Run again with -h= to see the longer details of any of those commands.\n")}}}function j(){return"0"!==process.env.FORCE_COLOR&&("1"===process.env.FORCE_COLOR||!(void 0===process.stdout||!process.stdout.isTTY))}class U{constructor({binaryLabel:t,binaryName:e="...",binaryVersion:s,enableColors:i=j()}={}){this.registrations=new Map,this.builder=new L({binaryName:e}),this.binaryLabel=t,this.binaryName=e,this.binaryVersion=s,this.enableColors=i}static from(t,e={}){const s=new U(e);for(const e of t)s.register(e);return s}register(t){const e=this.builder.command();this.registrations.set(t,e.cliIndex);const{definitions:s}=t.resolveMeta(t.prototype);for(const t of s)t(e);e.setContext({commandClass:t})}process(t){const{contexts:e,process:s}=this.builder.compile(),i=s(t);switch(i.selectedIndex){case-1:return B.from(i,e);default:{const{commandClass:t}=e[i.selectedIndex],s=this.registrations.get(t);if(void 0===s)throw new Error("Assertion failed: Expected the command class to have been registered.");const r=this.builder.getBuilderByIndex(s),n=new t;n.path=i.path;const{transformers:o}=t.resolveMeta(t.prototype);for(const t of o)t(i,n,r);return n}}}async run(t,e){let s,i;if(Array.isArray(t))try{s=this.process(t)}catch(t){return e.stdout.write(this.error(t)),1}else s=t;if(s.help)return e.stdout.write(this.usage(s,{detailed:!0})),0;s.context=e,s.cli={binaryLabel:this.binaryLabel,binaryName:this.binaryName,binaryVersion:this.binaryVersion,enableColors:this.enableColors,definitions:()=>this.definitions(),error:(t,e)=>this.error(t,e),process:t=>this.process(t),run:(t,s)=>this.run(t,Object.assign(Object.assign({},e),s)),usage:(t,e)=>this.usage(t,e)};try{i=await s.validateAndExecute().catch(t=>s.catch(t).then(()=>0))}catch(t){return e.stdout.write(this.error(t,{command:s})),1}return i}async runExit(t,e){process.exitCode=await this.run(t,e)}suggest(t,e){const{contexts:s,process:i,suggest:r}=this.builder.compile();return r(t,e)}definitions({colored:t=!1}={}){const e=[];for(const[s,i]of this.registrations){if(void 0===s.usage)continue;const{usage:r}=this.getUsageByIndex(i,{detailed:!1}),{usage:n,options:o}=this.getUsageByIndex(i,{detailed:!0,inlineOptions:!1}),a=void 0!==s.usage.category?F(s.usage.category,{format:this.format(t),paragraphs:!1}):void 0,h=void 0!==s.usage.description?F(s.usage.description,{format:this.format(t),paragraphs:!1}):void 0,c=void 0!==s.usage.details?F(s.usage.details,{format:this.format(t),paragraphs:!0}):void 0,l=void 0!==s.usage.examples?s.usage.examples.map(([e,s])=>[F(e,{format:this.format(t),paragraphs:!1}),s.replace(/\$0/g,this.binaryName)]):void 0;e.push({path:r,usage:n,category:a,description:h,details:c,examples:l,options:o})}return e}usage(t=null,{colored:e,detailed:s=!1,prefix:i="$ "}={}){const r=null!==t&&void 0===t.getMeta?t.constructor:t;let n="";if(r)if(s){const{description:t="",details:s="",examples:o=[]}=r.usage||{};""!==t&&(n+=F(t,{format:this.format(e),paragraphs:!1}).replace(/^./,t=>t.toUpperCase()),n+="\n"),(""!==s||o.length>0)&&(n+=this.format(e).bold("Usage:")+"\n",n+="\n");const{usage:a,options:h}=this.getUsageByRegistration(r,{inlineOptions:!1});if(n+=`${this.format(e).bold(i)}${a}\n`,h.length>0){n+="\n",n+=$.bold("Options:")+"\n";const t=h.reduce((t,e)=>Math.max(t,e.definition.length),0);n+="\n";for(const{definition:s,description:i}of h)n+=` ${s.padEnd(t)} ${F(i,{format:this.format(e),paragraphs:!1})}`}if(""!==s&&(n+="\n",n+=this.format(e).bold("Details:")+"\n",n+="\n",n+=F(s,{format:this.format(e),paragraphs:!0})),o.length>0){n+="\n",n+=this.format(e).bold("Examples:")+"\n";for(let[t,s]of o)n+="\n",n+=F(t,{format:this.format(e),paragraphs:!1}),n+=s.replace(/^/m," "+this.format(e).bold(i)).replace(/\$0/g,this.binaryName)+"\n"}}else{const{usage:t}=this.getUsageByRegistration(r);n+=`${this.format(e).bold(i)}${t}\n`}else{const t=new Map;for(const[s,i]of this.registrations.entries()){if(void 0===s.usage)continue;const r=void 0!==s.usage.category?F(s.usage.category,{format:this.format(e),paragraphs:!1}):null;let n=t.get(r);void 0===n&&t.set(r,n=[]);const{usage:o}=this.getUsageByIndex(i);n.push({commandClass:s,usage:o})}const s=Array.from(t.keys()).sort((t,e)=>null===t?-1:null===e?1:t.localeCompare(e,"en",{usage:"sort",caseFirst:"upper"})),r=void 0!==this.binaryLabel,o=void 0!==this.binaryVersion;r||o?(n+=r&&o?this.format(e).bold(`${this.binaryLabel} - ${this.binaryVersion}`)+"\n\n":r?this.format(e).bold(""+this.binaryLabel)+"\n":this.format(e).bold(""+this.binaryVersion)+"\n",n+=` ${this.format(e).bold(i)}${this.binaryName} \n`):n+=`${this.format(e).bold(i)}${this.binaryName} \n`;for(let i of s){const s=t.get(i).slice().sort((t,e)=>t.usage.localeCompare(e.usage,"en",{usage:"sort",caseFirst:"upper"})),r=null!==i?i.trim():"Where is one of";n+="\n",n+=this.format(e).bold(r+":")+"\n";for(let{commandClass:t,usage:i}of s){const s=t.usage.description||"undocumented";n+="\n",n+=` ${this.format(e).bold(i)}\n`,n+=" "+F(s,{format:this.format(e),paragraphs:!1})}}n+="\n",n+=F("You can also print more details about any of these commands by calling them after adding the `-h,--help` flag right after the command name.",{format:this.format(e),paragraphs:!0})}return n}error(t,{colored:e,command:s=null}={}){t instanceof Error||(t=new Error(`Execution failed with a non-error rejection (rejected value: ${JSON.stringify(t)})`));let i="",r=t.name.replace(/([a-z])([A-Z])/g,"$1 $2");"Error"===r&&(r="Internal Error"),i+=`${this.format(e).error(r)}: ${t.message}\n`;const n=t.clipanion;return void 0!==n?"usage"===n.type&&(i+="\n",i+=this.usage(s)):t.stack&&(i+=t.stack.replace(/^.*\n/,"")+"\n"),i}getUsageByRegistration(t,e){const s=this.registrations.get(t);if(void 0===s)throw new Error("Assertion failed: Unregistered command");return this.getUsageByIndex(s,e)}getUsageByIndex(t,e){return this.builder.getBuilderByIndex(t).usage(e)}format(t=this.enableColors){return t?$:M}}U.defaultContext={stdin:process.stdin,stdout:process.stdout,stderr:process.stderr},k.Entries.Help=D,k.Entries.Version=N,e.zl=U,e.mY=k,e.Oi=a},4889:(t,e,s)=>{"use strict";const i=s(4309),r=s(8614).EventEmitter,n=s(5747);let o=n.writev;if(!o){const t=process.binding("fs"),e=t.FSReqWrap||t.FSReqCallback;o=(s,i,r,n)=>{const o=new e;o.oncomplete=(t,e)=>n(t,e,i),t.writeBuffers(s,i,r,o)}}const a=Symbol("_autoClose"),h=Symbol("_close"),c=Symbol("_ended"),l=Symbol("_fd"),u=Symbol("_finished"),p=Symbol("_flags"),d=Symbol("_flush"),f=Symbol("_handleChunk"),m=Symbol("_makeBuf"),y=Symbol("_mode"),g=Symbol("_needDrain"),_=Symbol("_onerror"),E=Symbol("_onopen"),w=Symbol("_onread"),b=Symbol("_onwrite"),O=Symbol("_open"),R=Symbol("_path"),v=Symbol("_pos"),S=Symbol("_queue"),x=Symbol("_read"),I=Symbol("_readSize"),T=Symbol("_reading"),C=Symbol("_remain"),A=Symbol("_size"),L=Symbol("_write"),k=Symbol("_writing"),P=Symbol("_defaultFlag"),D=Symbol("_errored");class N extends i{constructor(t,e){if(super(e=e||{}),this.readable=!0,this.writable=!1,"string"!=typeof t)throw new TypeError("path must be a string");this[D]=!1,this[l]="number"==typeof e.fd?e.fd:null,this[R]=t,this[I]=e.readSize||16777216,this[T]=!1,this[A]="number"==typeof e.size?e.size:1/0,this[C]=this[A],this[a]="boolean"!=typeof e.autoClose||e.autoClose,"number"==typeof this[l]?this[x]():this[O]()}get fd(){return this[l]}get path(){return this[R]}write(){throw new TypeError("this is a readable stream")}end(){throw new TypeError("this is a readable stream")}[O](){n.open(this[R],"r",(t,e)=>this[E](t,e))}[E](t,e){t?this[_](t):(this[l]=e,this.emit("open",e),this[x]())}[m](){return Buffer.allocUnsafe(Math.min(this[I],this[C]))}[x](){if(!this[T]){this[T]=!0;const t=this[m]();if(0===t.length)return process.nextTick(()=>this[w](null,0,t));n.read(this[l],t,0,t.length,null,(t,e,s)=>this[w](t,e,s))}}[w](t,e,s){this[T]=!1,t?this[_](t):this[f](e,s)&&this[x]()}[h](){if(this[a]&&"number"==typeof this[l]){const t=this[l];this[l]=null,n.close(t,t=>t?this.emit("error",t):this.emit("close"))}}[_](t){this[T]=!0,this[h](),this.emit("error",t)}[f](t,e){let s=!1;return this[C]-=t,t>0&&(s=super.write(tthis[E](t,e))}[E](t,e){this[P]&&"r+"===this[p]&&t&&"ENOENT"===t.code?(this[p]="w",this[O]()):t?this[_](t):(this[l]=e,this.emit("open",e),this[d]())}end(t,e){return t&&this.write(t,e),this[c]=!0,this[k]||this[S].length||"number"!=typeof this[l]||this[b](null,0),this}write(t,e){return"string"==typeof t&&(t=Buffer.from(t,e)),this[c]?(this.emit("error",new Error("write() after end()")),!1):null===this[l]||this[k]||this[S].length?(this[S].push(t),this[g]=!0,!1):(this[k]=!0,this[L](t),!0)}[L](t){n.write(this[l],t,0,t.length,this[v],(t,e)=>this[b](t,e))}[b](t,e){t?this[_](t):(null!==this[v]&&(this[v]+=e),this[S].length?this[d]():(this[k]=!1,this[c]&&!this[u]?(this[u]=!0,this[h](),this.emit("finish")):this[g]&&(this[g]=!1,this.emit("drain"))))}[d](){if(0===this[S].length)this[c]&&this[b](null,0);else if(1===this[S].length)this[L](this[S].pop());else{const t=this[S];this[S]=[],o(this[l],t,this[v],(t,e)=>this[b](t,e))}}[h](){if(this[a]&&"number"==typeof this[l]){const t=this[l];this[l]=null,n.close(t,t=>t?this.emit("error",t):this.emit("close"))}}}e.ReadStream=N,e.ReadStreamSync=class extends N{[O](){let t=!0;try{this[E](null,n.openSync(this[R],"r")),t=!1}finally{t&&this[h]()}}[x](){let t=!0;try{if(!this[T]){for(this[T]=!0;;){const t=this[m](),e=0===t.length?0:n.readSync(this[l],t,0,t.length,null);if(!this[f](e,t))break}this[T]=!1}t=!1}finally{t&&this[h]()}}[h](){if(this[a]&&"number"==typeof this[l]){const t=this[l];this[l]=null,n.closeSync(t),this.emit("close")}}},e.WriteStream=$,e.WriteStreamSync=class extends ${[O](){let t;if(this[P]&&"r+"===this[p])try{t=n.openSync(this[R],this[p],this[y])}catch(t){if("ENOENT"===t.code)return this[p]="w",this[O]();throw t}else t=n.openSync(this[R],this[p],this[y]);this[E](null,t)}[h](){if(this[a]&&"number"==typeof this[l]){const t=this[l];this[l]=null,n.closeSync(t),this.emit("close")}}[L](t){let e=!0;try{this[b](null,n.writeSync(this[l],t,0,t.length,this[v])),e=!1}finally{if(e)try{this[h]()}catch(t){}}}}},6603:t=>{"use strict";t.exports=(t,e=process.argv)=>{const s=t.startsWith("-")?"":1===t.length?"-":"--",i=e.indexOf(s+t),r=e.indexOf("--");return-1!==i&&(-1===r||i{var s,i,r,n;
+/*!
+ * is-windows
+ *
+ * Copyright © 2015-2018, Jon Schlinkert.
+ * Released under the MIT License.
+ */n=function(){"use strict";return function(){return process&&("win32"===process.platform||/^(msys|cygwin)$/.test(process.env.OSTYPE))}},e&&"object"==typeof e?t.exports=n():(i=[],void 0===(r="function"==typeof(s=n)?s.apply(e,i):s)||(t.exports=r))},9882:(t,e,s)=>{var i;s(5747);function r(t,e,s){if("function"==typeof e&&(s=e,e={}),!s){if("function"!=typeof Promise)throw new TypeError("callback not provided");return new Promise((function(s,i){r(t,e||{},(function(t,e){t?i(t):s(e)}))}))}i(t,e||{},(function(t,i){t&&("EACCES"===t.code||e&&e.ignoreErrors)&&(t=null,i=!1),s(t,i)}))}i="win32"===process.platform||global.TESTING_WINDOWS?s(4348):s(5064),t.exports=r,r.sync=function(t,e){try{return i.sync(t,e||{})}catch(t){if(e&&e.ignoreErrors||"EACCES"===t.code)return!1;throw t}}},5064:(t,e,s)=>{t.exports=r,r.sync=function(t,e){return n(i.statSync(t),e)};var i=s(5747);function r(t,e,s){i.stat(t,(function(t,i){s(t,!t&&n(i,e))}))}function n(t,e){return t.isFile()&&function(t,e){var s=t.mode,i=t.uid,r=t.gid,n=void 0!==e.uid?e.uid:process.getuid&&process.getuid(),o=void 0!==e.gid?e.gid:process.getgid&&process.getgid(),a=parseInt("100",8),h=parseInt("010",8),c=parseInt("001",8),l=a|h;return s&c||s&h&&r===o||s&a&&i===n||s&l&&0===n}(t,e)}},4348:(t,e,s)=>{t.exports=n,n.sync=function(t,e){return r(i.statSync(t),t,e)};var i=s(5747);function r(t,e,s){return!(!t.isSymbolicLink()&&!t.isFile())&&function(t,e){var s=void 0!==e.pathExt?e.pathExt:process.env.PATHEXT;if(!s)return!0;if(-1!==(s=s.split(";")).indexOf(""))return!0;for(var i=0;i{"use strict";const i=s(8614),r=s(2413),n=s(7638),o=s(4304).StringDecoder,a=Symbol("EOF"),h=Symbol("maybeEmitEnd"),c=Symbol("emittedEnd"),l=Symbol("emittingEnd"),u=Symbol("closed"),p=Symbol("read"),d=Symbol("flush"),f=Symbol("flushChunk"),m=Symbol("encoding"),y=Symbol("decoder"),g=Symbol("flowing"),_=Symbol("paused"),E=Symbol("resume"),w=Symbol("bufferLength"),b=Symbol("bufferPush"),O=Symbol("bufferShift"),R=Symbol("objectMode"),v=Symbol("destroyed"),S="1"!==global._MP_NO_ITERATOR_SYMBOLS_,x=S&&Symbol.asyncIterator||Symbol("asyncIterator not implemented"),I=S&&Symbol.iterator||Symbol("iterator not implemented"),T=t=>"end"===t||"finish"===t||"prefinish"===t;t.exports=class t extends r{constructor(t){super(),this[g]=!1,this[_]=!1,this.pipes=new n,this.buffer=new n,this[R]=t&&t.objectMode||!1,this[R]?this[m]=null:this[m]=t&&t.encoding||null,"buffer"===this[m]&&(this[m]=null),this[y]=this[m]?new o(this[m]):null,this[a]=!1,this[c]=!1,this[l]=!1,this[u]=!1,this.writable=!0,this.readable=!0,this[w]=0,this[v]=!1}get bufferLength(){return this[w]}get encoding(){return this[m]}set encoding(t){if(this[R])throw new Error("cannot set encoding in objectMode");if(this[m]&&t!==this[m]&&(this[y]&&this[y].lastNeed||this[w]))throw new Error("cannot change encoding");this[m]!==t&&(this[y]=t?new o(t):null,this.buffer.length&&(this.buffer=this.buffer.map(t=>this[y].write(t)))),this[m]=t}setEncoding(t){this.encoding=t}get objectMode(){return this[R]}set objectMode(t){this[R]=this[R]||!!t}write(t,e,s){if(this[a])throw new Error("write after end");if(this[v])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;var i;if("function"==typeof e&&(s=e,e="utf8"),e||(e="utf8"),this[R]||Buffer.isBuffer(t)||(i=t,!Buffer.isBuffer(i)&&ArrayBuffer.isView(i)?t=Buffer.from(t.buffer,t.byteOffset,t.byteLength):(t=>t instanceof ArrayBuffer||"object"==typeof t&&t.constructor&&"ArrayBuffer"===t.constructor.name&&t.byteLength>=0)(t)?t=Buffer.from(t):"string"!=typeof t&&(this.objectMode=!0)),!this.objectMode&&!t.length){const t=this.flowing;return 0!==this[w]&&this.emit("readable"),s&&s(),t}"string"!=typeof t||this[R]||e===this[m]&&!this[y].lastNeed||(t=Buffer.from(t,e)),Buffer.isBuffer(t)&&this[m]&&(t=this[y].write(t));try{return this.flowing?(this.emit("data",t),this.flowing):(this[b](t),!1)}finally{0!==this[w]&&this.emit("readable"),s&&s()}}read(t){if(this[v])return null;try{return 0===this[w]||0===t||t>this[w]?null:(this[R]&&(t=null),this.buffer.length>1&&!this[R]&&(this.encoding?this.buffer=new n([Array.from(this.buffer).join("")]):this.buffer=new n([Buffer.concat(Array.from(this.buffer),this[w])])),this[p](t||null,this.buffer.head.value))}finally{this[h]()}}[p](t,e){return t===e.length||null===t?this[O]():(this.buffer.head.value=e.slice(t),e=e.slice(0,t),this[w]-=t),this.emit("data",e),this.buffer.length||this[a]||this.emit("drain"),e}end(t,e,s){return"function"==typeof t&&(s=t,t=null),"function"==typeof e&&(s=e,e="utf8"),t&&this.write(t,e),s&&this.once("end",s),this[a]=!0,this.writable=!1,!this.flowing&&this[_]||this[h](),this}[E](){this[v]||(this[_]=!1,this[g]=!0,this.emit("resume"),this.buffer.length?this[d]():this[a]?this[h]():this.emit("drain"))}resume(){return this[E]()}pause(){this[g]=!1,this[_]=!0}get destroyed(){return this[v]}get flowing(){return this[g]}get paused(){return this[_]}[b](t){return this[R]?this[w]+=1:this[w]+=t.length,this.buffer.push(t)}[O](){return this.buffer.length&&(this[R]?this[w]-=1:this[w]-=this.buffer.head.value.length),this.buffer.shift()}[d](){do{}while(this[f](this[O]()));this.buffer.length||this[a]||this.emit("drain")}[f](t){return!!t&&(this.emit("data",t),this.flowing)}pipe(t,e){if(this[v])return;const s=this[c];e=e||{},t===process.stdout||t===process.stderr?e.end=!1:e.end=!1!==e.end;const i={dest:t,opts:e,ondrain:t=>this[E]()};return this.pipes.push(i),t.on("drain",i.ondrain),this[E](),s&&i.opts.end&&i.dest.end(),t}addListener(t,e){return this.on(t,e)}on(t,e){try{return super.on(t,e)}finally{"data"!==t||this.pipes.length||this.flowing?T(t)&&this[c]&&(super.emit(t),this.removeAllListeners(t)):this[E]()}}get emittedEnd(){return this[c]}[h](){this[l]||this[c]||this[v]||0!==this.buffer.length||!this[a]||(this[l]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[u]&&this.emit("close"),this[l]=!1)}emit(t,e){if("error"!==t&&"close"!==t&&t!==v&&this[v])return;if("data"===t){if(!e)return;this.pipes.length&&this.pipes.forEach(t=>!1===t.dest.write(e)&&this.pause())}else if("end"===t){if(!0===this[c])return;this[c]=!0,this.readable=!1,this[y]&&(e=this[y].end())&&(this.pipes.forEach(t=>t.dest.write(e)),super.emit("data",e)),this.pipes.forEach(t=>{t.dest.removeListener("drain",t.ondrain),t.opts.end&&t.dest.end()})}else if("close"===t&&(this[u]=!0,!this[c]&&!this[v]))return;const s=new Array(arguments.length);if(s[0]=t,s[1]=e,arguments.length>2)for(let t=2;t{t.push(e),this[R]||(t.dataLength+=e.length)}),e.then(()=>t)}concat(){return this[R]?Promise.reject(new Error("cannot concat in objectMode")):this.collect().then(t=>this[R]?Promise.reject(new Error("cannot concat in objectMode")):this[m]?t.join(""):Buffer.concat(t,t.dataLength))}promise(){return new Promise((t,e)=>{this.on(v,()=>e(new Error("stream destroyed"))),this.on("end",()=>t()),this.on("error",t=>e(t))})}[x](){return{next:()=>{const t=this.read();if(null!==t)return Promise.resolve({done:!1,value:t});if(this[a])return Promise.resolve({done:!0});let e=null,s=null;const i=t=>{this.removeListener("data",r),this.removeListener("end",n),s(t)},r=t=>{this.removeListener("error",i),this.removeListener("end",n),this.pause(),e({value:t,done:!!this[a]})},n=()=>{this.removeListener("error",i),this.removeListener("data",r),e({done:!0})},o=()=>i(new Error("stream destroyed"));return new Promise((t,a)=>{s=a,e=t,this.once(v,o),this.once("error",i),this.once("end",n),this.once("data",r)})}}}[I](){return{next:()=>{const t=this.read();return{value:t,done:null===t}}}}destroy(t){return this[v]?(t?this.emit("error",t):this.emit(v),this):(this[v]=!0,this.buffer=new n,this[w]=0,"function"!=typeof this.close||this[u]||this.close(),t?this.emit("error",t):this.emit(v),this)}static isStream(e){return!!e&&(e instanceof t||e instanceof r||e instanceof i&&("function"==typeof e.pipe||"function"==typeof e.write&&"function"==typeof e.end))}}},1690:(t,e,s)=>{const i=s(8761).constants||{ZLIB_VERNUM:4736};t.exports=Object.freeze(Object.assign(Object.create(null),{Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_VERSION_ERROR:-6,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,DEFLATE:1,INFLATE:2,GZIP:3,GUNZIP:4,DEFLATERAW:5,INFLATERAW:6,UNZIP:7,BROTLI_DECODE:8,BROTLI_ENCODE:9,Z_MIN_WINDOWBITS:8,Z_MAX_WINDOWBITS:15,Z_DEFAULT_WINDOWBITS:15,Z_MIN_CHUNK:64,Z_MAX_CHUNK:1/0,Z_DEFAULT_CHUNK:16384,Z_MIN_MEMLEVEL:1,Z_MAX_MEMLEVEL:9,Z_DEFAULT_MEMLEVEL:8,Z_MIN_LEVEL:-1,Z_MAX_LEVEL:9,Z_DEFAULT_LEVEL:-1,BROTLI_OPERATION_PROCESS:0,BROTLI_OPERATION_FLUSH:1,BROTLI_OPERATION_FINISH:2,BROTLI_OPERATION_EMIT_METADATA:3,BROTLI_MODE_GENERIC:0,BROTLI_MODE_TEXT:1,BROTLI_MODE_FONT:2,BROTLI_DEFAULT_MODE:0,BROTLI_MIN_QUALITY:0,BROTLI_MAX_QUALITY:11,BROTLI_DEFAULT_QUALITY:11,BROTLI_MIN_WINDOW_BITS:10,BROTLI_MAX_WINDOW_BITS:24,BROTLI_LARGE_MAX_WINDOW_BITS:30,BROTLI_DEFAULT_WINDOW:22,BROTLI_MIN_INPUT_BLOCK_BITS:16,BROTLI_MAX_INPUT_BLOCK_BITS:24,BROTLI_PARAM_MODE:0,BROTLI_PARAM_QUALITY:1,BROTLI_PARAM_LGWIN:2,BROTLI_PARAM_LGBLOCK:3,BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING:4,BROTLI_PARAM_SIZE_HINT:5,BROTLI_PARAM_LARGE_WINDOW:6,BROTLI_PARAM_NPOSTFIX:7,BROTLI_PARAM_NDIRECT:8,BROTLI_DECODER_RESULT_ERROR:0,BROTLI_DECODER_RESULT_SUCCESS:1,BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT:2,BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION:0,BROTLI_DECODER_PARAM_LARGE_WINDOW:1,BROTLI_DECODER_NO_ERROR:0,BROTLI_DECODER_SUCCESS:1,BROTLI_DECODER_NEEDS_MORE_INPUT:2,BROTLI_DECODER_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE:-1,BROTLI_DECODER_ERROR_FORMAT_RESERVED:-2,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE:-3,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET:-4,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME:-5,BROTLI_DECODER_ERROR_FORMAT_CL_SPACE:-6,BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE:-7,BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT:-8,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1:-9,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2:-10,BROTLI_DECODER_ERROR_FORMAT_TRANSFORM:-11,BROTLI_DECODER_ERROR_FORMAT_DICTIONARY:-12,BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS:-13,BROTLI_DECODER_ERROR_FORMAT_PADDING_1:-14,BROTLI_DECODER_ERROR_FORMAT_PADDING_2:-15,BROTLI_DECODER_ERROR_FORMAT_DISTANCE:-16,BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET:-19,BROTLI_DECODER_ERROR_INVALID_ARGUMENTS:-20,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES:-21,BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS:-22,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP:-25,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1:-26,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2:-27,BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES:-30,BROTLI_DECODER_ERROR_UNREACHABLE:-31},i))},8855:(t,e,s)=>{"use strict";const i=s(2357),r=s(4293).Buffer,n=s(8761),o=e.constants=s(1690),a=s(4309),h=r.concat,c=Symbol("_superWrite");class l extends Error{constructor(t){super("zlib: "+t.message),this.code=t.code,this.errno=t.errno,this.code||(this.code="ZLIB_ERROR"),this.message="zlib: "+t.message,Error.captureStackTrace(this,this.constructor)}get name(){return"ZlibError"}}const u=Symbol("opts"),p=Symbol("flushFlag"),d=Symbol("finishFlushFlag"),f=Symbol("fullFlushFlag"),m=Symbol("handle"),y=Symbol("onError"),g=Symbol("sawError"),_=Symbol("level"),E=Symbol("strategy"),w=Symbol("ended");Symbol("_defaultFullFlush");class b extends a{constructor(t,e){if(!t||"object"!=typeof t)throw new TypeError("invalid options for ZlibBase constructor");super(t),this[w]=!1,this[u]=t,this[p]=t.flush,this[d]=t.finishFlush;try{this[m]=new n[e](t)}catch(t){throw new l(t)}this[y]=t=>{this[g]=!0,this.close(),this.emit("error",t)},this[m].on("error",t=>this[y](new l(t))),this.once("end",()=>this.close)}close(){this[m]&&(this[m].close(),this[m]=null,this.emit("close"))}reset(){if(!this[g])return i(this[m],"zlib binding closed"),this[m].reset()}flush(t){this.ended||("number"!=typeof t&&(t=this[f]),this.write(Object.assign(r.alloc(0),{[p]:t})))}end(t,e,s){return t&&this.write(t,e),this.flush(this[d]),this[w]=!0,super.end(null,null,s)}get ended(){return this[w]}write(t,e,s){if("function"==typeof e&&(s=e,e="utf8"),"string"==typeof t&&(t=r.from(t,e)),this[g])return;i(this[m],"zlib binding closed");const n=this[m]._handle,o=n.close;n.close=()=>{};const a=this[m].close;let u,d;this[m].close=()=>{},r.concat=t=>t;try{const e="number"==typeof t[p]?t[p]:this[p];u=this[m]._processChunk(t,e),r.concat=h}catch(t){r.concat=h,this[y](new l(t))}finally{this[m]&&(this[m]._handle=n,n.close=o,this[m].close=a,this[m].removeAllListeners("error"))}if(u)if(Array.isArray(u)&&u.length>0){d=this[c](r.from(u[0]));for(let t=1;t{this.flush(t),e()};try{this[m].params(t,e)}finally{this[m].flush=s}this[m]&&(this[_]=t,this[E]=e)}}}}const R=Symbol("_portable");class v extends b{constructor(t,e){(t=t||{}).flush=t.flush||o.BROTLI_OPERATION_PROCESS,t.finishFlush=t.finishFlush||o.BROTLI_OPERATION_FINISH,super(t,e),this[f]=o.BROTLI_OPERATION_FLUSH}}class S extends v{constructor(t){super(t,"BrotliCompress")}}class x extends v{constructor(t){super(t,"BrotliDecompress")}}e.Deflate=class extends O{constructor(t){super(t,"Deflate")}},e.Inflate=class extends O{constructor(t){super(t,"Inflate")}},e.Gzip=class extends O{constructor(t){super(t,"Gzip"),this[R]=t&&!!t.portable}[c](t){return this[R]?(this[R]=!1,t[9]=255,super[c](t)):super[c](t)}},e.Gunzip=class extends O{constructor(t){super(t,"Gunzip")}},e.DeflateRaw=class extends O{constructor(t){super(t,"DeflateRaw")}},e.InflateRaw=class extends O{constructor(t){super(t,"InflateRaw")}},e.Unzip=class extends O{constructor(t){super(t,"Unzip")}},"function"==typeof n.BrotliCompress?(e.BrotliCompress=S,e.BrotliDecompress=x):e.BrotliCompress=e.BrotliDecompress=class{constructor(){throw new Error("Brotli is not supported in this version of Node.js")}}},1679:(t,e,s)=>{const i=s(4338),r=s(8780),{mkdirpNative:n,mkdirpNativeSync:o}=s(2639),{mkdirpManual:a,mkdirpManualSync:h}=s(4489),{useNative:c,useNativeSync:l}=s(4146),u=(t,e)=>(t=r(t),e=i(e),c(e)?n(t,e):a(t,e));u.sync=(t,e)=>(t=r(t),e=i(e),l(e)?o(t,e):h(t,e)),u.native=(t,e)=>n(r(t),i(e)),u.manual=(t,e)=>a(r(t),i(e)),u.nativeSync=(t,e)=>o(r(t),i(e)),u.manualSync=(t,e)=>h(r(t),i(e)),t.exports=u},9522:(t,e,s)=>{const{dirname:i}=s(5622),r=(t,e,s)=>s===e?Promise.resolve():t.statAsync(e).then(t=>t.isDirectory()?s:void 0,s=>"ENOENT"===s.code?r(t,i(e),e):void 0),n=(t,e,s)=>{if(s!==e)try{return t.statSync(e).isDirectory()?s:void 0}catch(s){return"ENOENT"===s.code?n(t,i(e),e):void 0}};t.exports={findMade:r,findMadeSync:n}},4489:(t,e,s)=>{const{dirname:i}=s(5622),r=(t,e,s)=>{e.recursive=!1;const n=i(t);return n===t?e.mkdirAsync(t,e).catch(t=>{if("EISDIR"!==t.code)throw t}):e.mkdirAsync(t,e).then(()=>s||t,i=>{if("ENOENT"===i.code)return r(n,e).then(s=>r(t,e,s));if("EEXIST"!==i.code&&"EROFS"!==i.code)throw i;return e.statAsync(t).then(t=>{if(t.isDirectory())return s;throw i},()=>{throw i})})},n=(t,e,s)=>{const r=i(t);if(e.recursive=!1,r===t)try{return e.mkdirSync(t,e)}catch(t){if("EISDIR"!==t.code)throw t;return}try{return e.mkdirSync(t,e),s||t}catch(i){if("ENOENT"===i.code)return n(t,e,n(r,e,s));if("EEXIST"!==i.code&&"EROFS"!==i.code)throw i;try{if(!e.statSync(t).isDirectory())throw i}catch(t){throw i}}};t.exports={mkdirpManual:r,mkdirpManualSync:n}},2639:(t,e,s)=>{const{dirname:i}=s(5622),{findMade:r,findMadeSync:n}=s(9522),{mkdirpManual:o,mkdirpManualSync:a}=s(4489);t.exports={mkdirpNative:(t,e)=>{e.recursive=!0;return i(t)===t?e.mkdirAsync(t,e):r(e,t).then(s=>e.mkdirAsync(t,e).then(()=>s).catch(s=>{if("ENOENT"===s.code)return o(t,e);throw s}))},mkdirpNativeSync:(t,e)=>{e.recursive=!0;if(i(t)===t)return e.mkdirSync(t,e);const s=n(e,t);try{return e.mkdirSync(t,e),s}catch(s){if("ENOENT"===s.code)return a(t,e);throw s}}}},4338:(t,e,s)=>{const{promisify:i}=s(1669),r=s(5747);t.exports=t=>{if(t)if("object"==typeof t)t={mode:511&~process.umask(),fs:r,...t};else if("number"==typeof t)t={mode:t,fs:r};else{if("string"!=typeof t)throw new TypeError("invalid options argument");t={mode:parseInt(t,8),fs:r}}else t={mode:511&~process.umask(),fs:r};return t.mkdir=t.mkdir||t.fs.mkdir||r.mkdir,t.mkdirAsync=i(t.mkdir),t.stat=t.stat||t.fs.stat||r.stat,t.statAsync=i(t.stat),t.statSync=t.statSync||t.fs.statSync||r.statSync,t.mkdirSync=t.mkdirSync||t.fs.mkdirSync||r.mkdirSync,t}},8780:(t,e,s)=>{const i=process.env.__TESTING_MKDIRP_PLATFORM__||process.platform,{resolve:r,parse:n}=s(5622);t.exports=t=>{if(/\0/.test(t))throw Object.assign(new TypeError("path must be a string without null bytes"),{path:t,code:"ERR_INVALID_ARG_VALUE"});if(t=r(t),"win32"===i){const e=/[*|"<>?:]/,{root:s}=n(t);if(e.test(t.substr(s.length)))throw Object.assign(new Error("Illegal characters in path."),{path:t,code:"EINVAL"})}return t}},4146:(t,e,s)=>{const i=s(5747),r=(process.env.__TESTING_MKDIRP_NODE_VERSION__||process.version).replace(/^v/,"").split("."),n=+r[0]>10||10==+r[0]&&+r[1]>=12,o=n?t=>t.mkdir===i.mkdir:()=>!1,a=n?t=>t.mkdirSync===i.mkdirSync:()=>!1;t.exports={useNative:o,useNativeSync:a}},322:t=>{var e=1e3,s=6e4,i=60*s,r=24*i;function n(t,e,s,i){var r=e>=1.5*s;return Math.round(t/s)+" "+i+(r?"s":"")}t.exports=function(t,o){o=o||{};var a=typeof t;if("string"===a&&t.length>0)return function(t){if((t=String(t)).length>100)return;var n=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(!n)return;var o=parseFloat(n[1]);switch((n[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*o;case"weeks":case"week":case"w":return 6048e5*o;case"days":case"day":case"d":return o*r;case"hours":case"hour":case"hrs":case"hr":case"h":return o*i;case"minutes":case"minute":case"mins":case"min":case"m":return o*s;case"seconds":case"second":case"secs":case"sec":case"s":return o*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return o;default:return}}(t);if("number"===a&&isFinite(t))return o.long?function(t){var o=Math.abs(t);if(o>=r)return n(t,o,r,"day");if(o>=i)return n(t,o,i,"hour");if(o>=s)return n(t,o,s,"minute");if(o>=e)return n(t,o,e,"second");return t+" ms"}(t):function(t){var n=Math.abs(t);if(n>=r)return Math.round(t/r)+"d";if(n>=i)return Math.round(t/i)+"h";if(n>=s)return Math.round(t/s)+"m";if(n>=e)return Math.round(t/e)+"s";return t+"ms"}(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))}},4636:(t,e,s)=>{const i=Symbol("SemVer ANY");class r{static get ANY(){return i}constructor(t,e){if(e&&"object"==typeof e||(e={loose:!!e,includePrerelease:!1}),t instanceof r){if(t.loose===!!e.loose)return t;t=t.value}h("comparator",t,e),this.options=e,this.loose=!!e.loose,this.parse(t),this.semver===i?this.value="":this.value=this.operator+this.semver.version,h("comp",this)}parse(t){const e=this.options.loose?n[o.COMPARATORLOOSE]:n[o.COMPARATOR],s=t.match(e);if(!s)throw new TypeError("Invalid comparator: "+t);this.operator=void 0!==s[1]?s[1]:"","="===this.operator&&(this.operator=""),s[2]?this.semver=new c(s[2],this.options.loose):this.semver=i}toString(){return this.value}test(t){if(h("Comparator.test",t,this.options.loose),this.semver===i||t===i)return!0;if("string"==typeof t)try{t=new c(t,this.options)}catch(t){return!1}return a(t,this.operator,this.semver,this.options)}intersects(t,e){if(!(t instanceof r))throw new TypeError("a Comparator is required");if(e&&"object"==typeof e||(e={loose:!!e,includePrerelease:!1}),""===this.operator)return""===this.value||new l(t.value,e).test(this.value);if(""===t.operator)return""===t.value||new l(this.value,e).test(t.semver);const s=!(">="!==this.operator&&">"!==this.operator||">="!==t.operator&&">"!==t.operator),i=!("<="!==this.operator&&"<"!==this.operator||"<="!==t.operator&&"<"!==t.operator),n=this.semver.version===t.semver.version,o=!(">="!==this.operator&&"<="!==this.operator||">="!==t.operator&&"<="!==t.operator),h=a(this.semver,"<",t.semver,e)&&(">="===this.operator||">"===this.operator)&&("<="===t.operator||"<"===t.operator),c=a(this.semver,">",t.semver,e)&&("<="===this.operator||"<"===this.operator)&&(">="===t.operator||">"===t.operator);return s||i||n&&o||h||c}}t.exports=r;const{re:n,t:o}=s(5315),a=s(477),h=s(6245),c=s(8048),l=s(15)},15:(t,e,s)=>{class i{constructor(t,e){if(e&&"object"==typeof e||(e={loose:!!e,includePrerelease:!1}),t instanceof i)return t.loose===!!e.loose&&t.includePrerelease===!!e.includePrerelease?t:new i(t.raw,e);if(t instanceof r)return this.raw=t.value,this.set=[[t]],this.format(),this;if(this.options=e,this.loose=!!e.loose,this.includePrerelease=!!e.includePrerelease,this.raw=t,this.set=t.split(/\s*\|\|\s*/).map(t=>this.parseRange(t.trim())).filter(t=>t.length),!this.set.length)throw new TypeError("Invalid SemVer Range: "+t);this.format()}format(){return this.range=this.set.map(t=>t.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(t){const e=this.options.loose;t=t.trim();const s=e?a[h.HYPHENRANGELOOSE]:a[h.HYPHENRANGE];t=t.replace(s,O),n("hyphen replace",t),t=t.replace(a[h.COMPARATORTRIM],c),n("comparator trim",t,a[h.COMPARATORTRIM]),t=(t=(t=t.replace(a[h.TILDETRIM],l)).replace(a[h.CARETTRIM],u)).split(/\s+/).join(" ");const i=e?a[h.COMPARATORLOOSE]:a[h.COMPARATOR];return t.split(" ").map(t=>d(t,this.options)).join(" ").split(/\s+/).filter(this.options.loose?t=>!!t.match(i):()=>!0).map(t=>new r(t,this.options))}intersects(t,e){if(!(t instanceof i))throw new TypeError("a Range is required");return this.set.some(s=>p(s,e)&&t.set.some(t=>p(t,e)&&s.every(s=>t.every(t=>s.intersects(t,e)))))}test(t){if(!t)return!1;if("string"==typeof t)try{t=new o(t,this.options)}catch(t){return!1}for(let e=0;e{let s=!0;const i=t.slice();let r=i.pop();for(;s&&i.length;)s=i.every(t=>r.intersects(t,e)),r=i.pop();return s},d=(t,e)=>(n("comp",t,e),t=g(t,e),n("caret",t),t=m(t,e),n("tildes",t),t=E(t,e),n("xrange",t),t=b(t,e),n("stars",t),t),f=t=>!t||"x"===t.toLowerCase()||"*"===t,m=(t,e)=>t.trim().split(/\s+/).map(t=>y(t,e)).join(" "),y=(t,e)=>{const s=e.loose?a[h.TILDELOOSE]:a[h.TILDE];return t.replace(s,(e,s,i,r,o)=>{let a;return n("tilde",t,e,s,i,r,o),f(s)?a="":f(i)?a=`>=${s}.0.0 <${+s+1}.0.0`:f(r)?a=`>=${s}.${i}.0 <${s}.${+i+1}.0`:o?(n("replaceTilde pr",o),a=`>=${s}.${i}.${r}-${o} <${s}.${+i+1}.0`):a=`>=${s}.${i}.${r} <${s}.${+i+1}.0`,n("tilde return",a),a})},g=(t,e)=>t.trim().split(/\s+/).map(t=>_(t,e)).join(" "),_=(t,e)=>{n("caret",t,e);const s=e.loose?a[h.CARETLOOSE]:a[h.CARET];return t.replace(s,(e,s,i,r,o)=>{let a;return n("caret",t,e,s,i,r,o),f(s)?a="":f(i)?a=`>=${s}.0.0 <${+s+1}.0.0`:f(r)?a="0"===s?`>=${s}.${i}.0 <${s}.${+i+1}.0`:`>=${s}.${i}.0 <${+s+1}.0.0`:o?(n("replaceCaret pr",o),a="0"===s?"0"===i?`>=${s}.${i}.${r}-${o} <${s}.${i}.${+r+1}`:`>=${s}.${i}.${r}-${o} <${s}.${+i+1}.0`:`>=${s}.${i}.${r}-${o} <${+s+1}.0.0`):(n("no pr"),a="0"===s?"0"===i?`>=${s}.${i}.${r} <${s}.${i}.${+r+1}`:`>=${s}.${i}.${r} <${s}.${+i+1}.0`:`>=${s}.${i}.${r} <${+s+1}.0.0`),n("caret return",a),a})},E=(t,e)=>(n("replaceXRanges",t,e),t.split(/\s+/).map(t=>w(t,e)).join(" ")),w=(t,e)=>{t=t.trim();const s=e.loose?a[h.XRANGELOOSE]:a[h.XRANGE];return t.replace(s,(s,i,r,o,a,h)=>{n("xRange",t,s,i,r,o,a,h);const c=f(r),l=c||f(o),u=l||f(a),p=u;return"="===i&&p&&(i=""),h=e.includePrerelease?"-0":"",c?s=">"===i||"<"===i?"<0.0.0-0":"*":i&&p?(l&&(o=0),a=0,">"===i?(i=">=",l?(r=+r+1,o=0,a=0):(o=+o+1,a=0)):"<="===i&&(i="<",l?r=+r+1:o=+o+1),s=`${i+r}.${o}.${a}${h}`):l?s=`>=${r}.0.0${h} <${+r+1}.0.0${h}`:u&&(s=`>=${r}.${o}.0${h} <${r}.${+o+1}.0${h}`),n("xRange return",s),s})},b=(t,e)=>(n("replaceStars",t,e),t.trim().replace(a[h.STAR],"")),O=(t,e,s,i,r,n,o,a,h,c,l,u,p)=>`${e=f(s)?"":f(i)?`>=${s}.0.0`:f(r)?`>=${s}.${i}.0`:">="+e} ${a=f(h)?"":f(c)?`<${+h+1}.0.0`:f(l)?`<${h}.${+c+1}.0`:u?`<=${h}.${c}.${l}-${u}`:"<="+a}`.trim(),R=(t,e,s)=>{for(let s=0;s0){const i=t[s].semver;if(i.major===e.major&&i.minor===e.minor&&i.patch===e.patch)return!0}return!1}return!0}},8048:(t,e,s)=>{const i=s(6245),{MAX_LENGTH:r,MAX_SAFE_INTEGER:n}=s(8182),{re:o,t:a}=s(5315),{compareIdentifiers:h}=s(2055);class c{constructor(t,e){if(e&&"object"==typeof e||(e={loose:!!e,includePrerelease:!1}),t instanceof c){if(t.loose===!!e.loose&&t.includePrerelease===!!e.includePrerelease)return t;t=t.version}else if("string"!=typeof t)throw new TypeError("Invalid Version: "+t);if(t.length>r)throw new TypeError(`version is longer than ${r} characters`);i("SemVer",t,e),this.options=e,this.loose=!!e.loose,this.includePrerelease=!!e.includePrerelease;const s=t.trim().match(e.loose?o[a.LOOSE]:o[a.FULL]);if(!s)throw new TypeError("Invalid Version: "+t);if(this.raw=t,this.major=+s[1],this.minor=+s[2],this.patch=+s[3],this.major>n||this.major<0)throw new TypeError("Invalid major version");if(this.minor>n||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>n||this.patch<0)throw new TypeError("Invalid patch version");s[4]?this.prerelease=s[4].split(".").map(t=>{if(/^[0-9]+$/.test(t)){const e=+t;if(e>=0&&e=0;)"number"==typeof this.prerelease[t]&&(this.prerelease[t]++,t=-2);-1===t&&this.prerelease.push(0)}e&&(this.prerelease[0]===e?isNaN(this.prerelease[1])&&(this.prerelease=[e,0]):this.prerelease=[e,0]);break;default:throw new Error("invalid increment argument: "+t)}return this.format(),this.raw=this.version,this}}t.exports=c},6928:(t,e,s)=>{const i=s(9722);t.exports=(t,e)=>{const s=i(t.trim().replace(/^[=v]+/,""),e);return s?s.version:null}},477:(t,e,s)=>{const i=s(5618),r=s(1395),n=s(1891),o=s(101),a=s(5689),h=s(8004);t.exports=(t,e,s,c)=>{switch(e){case"===":return"object"==typeof t&&(t=t.version),"object"==typeof s&&(s=s.version),t===s;case"!==":return"object"==typeof t&&(t=t.version),"object"==typeof s&&(s=s.version),t!==s;case"":case"=":case"==":return i(t,s,c);case"!=":return r(t,s,c);case">":return n(t,s,c);case">=":return o(t,s,c);case"<":return a(t,s,c);case"<=":return h(t,s,c);default:throw new TypeError("Invalid operator: "+e)}}},1595:(t,e,s)=>{const i=s(8048),r=s(9722),{re:n,t:o}=s(5315);t.exports=(t,e)=>{if(t instanceof i)return t;if("number"==typeof t&&(t=String(t)),"string"!=typeof t)return null;let s=null;if((e=e||{}).rtl){let e;for(;(e=n[o.COERCERTL].exec(t))&&(!s||s.index+s[0].length!==t.length);)s&&e.index+e[0].length===s.index+s[0].length||(s=e),n[o.COERCERTL].lastIndex=e.index+e[1].length+e[2].length;n[o.COERCERTL].lastIndex=-1}else s=t.match(n[o.COERCE]);return null===s?null:r(`${s[2]}.${s[3]||"0"}.${s[4]||"0"}`,e)}},2250:(t,e,s)=>{const i=s(8048);t.exports=(t,e,s)=>{const r=new i(t,s),n=new i(e,s);return r.compare(n)||r.compareBuild(n)}},8570:(t,e,s)=>{const i=s(7682);t.exports=(t,e)=>i(t,e,!0)},7682:(t,e,s)=>{const i=s(8048);t.exports=(t,e,s)=>new i(t,s).compare(new i(e,s))},2281:(t,e,s)=>{const i=s(9722),r=s(5618);t.exports=(t,e)=>{if(r(t,e))return null;{const s=i(t),r=i(e),n=s.prerelease.length||r.prerelease.length,o=n?"pre":"",a=n?"prerelease":"";for(const t in s)if(("major"===t||"minor"===t||"patch"===t)&&s[t]!==r[t])return o+t;return a}}},5618:(t,e,s)=>{const i=s(7682);t.exports=(t,e,s)=>0===i(t,e,s)},1891:(t,e,s)=>{const i=s(7682);t.exports=(t,e,s)=>i(t,e,s)>0},101:(t,e,s)=>{const i=s(7682);t.exports=(t,e,s)=>i(t,e,s)>=0},5049:(t,e,s)=>{const i=s(8048);t.exports=(t,e,s,r)=>{"string"==typeof s&&(r=s,s=void 0);try{return new i(t,s).inc(e,r).version}catch(t){return null}}},5689:(t,e,s)=>{const i=s(7682);t.exports=(t,e,s)=>i(t,e,s)<0},8004:(t,e,s)=>{const i=s(7682);t.exports=(t,e,s)=>i(t,e,s)<=0},7249:(t,e,s)=>{const i=s(8048);t.exports=(t,e)=>new i(t,e).major},2518:(t,e,s)=>{const i=s(8048);t.exports=(t,e)=>new i(t,e).minor},1395:(t,e,s)=>{const i=s(7682);t.exports=(t,e,s)=>0!==i(t,e,s)},9722:(t,e,s)=>{const{MAX_LENGTH:i}=s(8182),{re:r,t:n}=s(5315),o=s(8048);t.exports=(t,e)=>{if(e&&"object"==typeof e||(e={loose:!!e,includePrerelease:!1}),t instanceof o)return t;if("string"!=typeof t)return null;if(t.length>i)return null;if(!(e.loose?r[n.LOOSE]:r[n.FULL]).test(t))return null;try{return new o(t,e)}catch(t){return null}}},8813:(t,e,s)=>{const i=s(8048);t.exports=(t,e)=>new i(t,e).patch},4778:(t,e,s)=>{const i=s(9722);t.exports=(t,e)=>{const s=i(t,e);return s&&s.prerelease.length?s.prerelease:null}},820:(t,e,s)=>{const i=s(7682);t.exports=(t,e,s)=>i(e,t,s)},8137:(t,e,s)=>{const i=s(2250);t.exports=(t,e)=>t.sort((t,s)=>i(s,t,e))},8970:(t,e,s)=>{const i=s(15);t.exports=(t,e,s)=>{try{e=new i(e,s)}catch(t){return!1}return e.test(t)}},2370:(t,e,s)=>{const i=s(2250);t.exports=(t,e)=>t.sort((t,s)=>i(t,s,e))},2815:(t,e,s)=>{const i=s(9722);t.exports=(t,e)=>{const s=i(t,e);return s?s.version:null}},8775:(t,e,s)=>{const i=s(5315);t.exports={re:i.re,src:i.src,tokens:i.t,SEMVER_SPEC_VERSION:s(8182).SEMVER_SPEC_VERSION,SemVer:s(8048),compareIdentifiers:s(2055).compareIdentifiers,rcompareIdentifiers:s(2055).rcompareIdentifiers,parse:s(9722),valid:s(2815),clean:s(6928),inc:s(5049),diff:s(2281),major:s(7249),minor:s(2518),patch:s(8813),prerelease:s(4778),compare:s(7682),rcompare:s(820),compareLoose:s(8570),compareBuild:s(2250),sort:s(2370),rsort:s(8137),gt:s(1891),lt:s(5689),eq:s(5618),neq:s(1395),gte:s(101),lte:s(8004),cmp:s(477),coerce:s(1595),Comparator:s(4636),Range:s(15),satisfies:s(8970),toComparators:s(6426),maxSatisfying:s(2965),minSatisfying:s(3042),minVersion:s(6850),validRange:s(5017),outside:s(8796),gtr:s(8576),ltr:s(6846),intersects:s(9344)}},8182:t=>{const e=Number.MAX_SAFE_INTEGER||9007199254740991;t.exports={SEMVER_SPEC_VERSION:"2.0.0",MAX_LENGTH:256,MAX_SAFE_INTEGER:e,MAX_SAFE_COMPONENT_LENGTH:16}},6245:t=>{const e="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};t.exports=e},2055:t=>{const e=/^[0-9]+$/,s=(t,s)=>{const i=e.test(t),r=e.test(s);return i&&r&&(t=+t,s=+s),t===s?0:i&&!r?-1:r&&!i?1:ts(e,t)}},5315:(t,e,s)=>{const{MAX_SAFE_COMPONENT_LENGTH:i}=s(8182),r=s(6245),n=(e=t.exports={}).re=[],o=e.src=[],a=e.t={};let h=0;const c=(t,e,s)=>{const i=h++;r(i,e),a[t]=i,o[i]=e,n[i]=new RegExp(e,s?"g":void 0)};c("NUMERICIDENTIFIER","0|[1-9]\\d*"),c("NUMERICIDENTIFIERLOOSE","[0-9]+"),c("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*"),c("MAINVERSION",`(${o[a.NUMERICIDENTIFIER]})\\.(${o[a.NUMERICIDENTIFIER]})\\.(${o[a.NUMERICIDENTIFIER]})`),c("MAINVERSIONLOOSE",`(${o[a.NUMERICIDENTIFIERLOOSE]})\\.(${o[a.NUMERICIDENTIFIERLOOSE]})\\.(${o[a.NUMERICIDENTIFIERLOOSE]})`),c("PRERELEASEIDENTIFIER",`(?:${o[a.NUMERICIDENTIFIER]}|${o[a.NONNUMERICIDENTIFIER]})`),c("PRERELEASEIDENTIFIERLOOSE",`(?:${o[a.NUMERICIDENTIFIERLOOSE]}|${o[a.NONNUMERICIDENTIFIER]})`),c("PRERELEASE",`(?:-(${o[a.PRERELEASEIDENTIFIER]}(?:\\.${o[a.PRERELEASEIDENTIFIER]})*))`),c("PRERELEASELOOSE",`(?:-?(${o[a.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${o[a.PRERELEASEIDENTIFIERLOOSE]})*))`),c("BUILDIDENTIFIER","[0-9A-Za-z-]+"),c("BUILD",`(?:\\+(${o[a.BUILDIDENTIFIER]}(?:\\.${o[a.BUILDIDENTIFIER]})*))`),c("FULLPLAIN",`v?${o[a.MAINVERSION]}${o[a.PRERELEASE]}?${o[a.BUILD]}?`),c("FULL",`^${o[a.FULLPLAIN]}$`),c("LOOSEPLAIN",`[v=\\s]*${o[a.MAINVERSIONLOOSE]}${o[a.PRERELEASELOOSE]}?${o[a.BUILD]}?`),c("LOOSE",`^${o[a.LOOSEPLAIN]}$`),c("GTLT","((?:<|>)?=?)"),c("XRANGEIDENTIFIERLOOSE",o[a.NUMERICIDENTIFIERLOOSE]+"|x|X|\\*"),c("XRANGEIDENTIFIER",o[a.NUMERICIDENTIFIER]+"|x|X|\\*"),c("XRANGEPLAIN",`[v=\\s]*(${o[a.XRANGEIDENTIFIER]})(?:\\.(${o[a.XRANGEIDENTIFIER]})(?:\\.(${o[a.XRANGEIDENTIFIER]})(?:${o[a.PRERELEASE]})?${o[a.BUILD]}?)?)?`),c("XRANGEPLAINLOOSE",`[v=\\s]*(${o[a.XRANGEIDENTIFIERLOOSE]})(?:\\.(${o[a.XRANGEIDENTIFIERLOOSE]})(?:\\.(${o[a.XRANGEIDENTIFIERLOOSE]})(?:${o[a.PRERELEASELOOSE]})?${o[a.BUILD]}?)?)?`),c("XRANGE",`^${o[a.GTLT]}\\s*${o[a.XRANGEPLAIN]}$`),c("XRANGELOOSE",`^${o[a.GTLT]}\\s*${o[a.XRANGEPLAINLOOSE]}$`),c("COERCE",`(^|[^\\d])(\\d{1,${i}})(?:\\.(\\d{1,${i}}))?(?:\\.(\\d{1,${i}}))?(?:$|[^\\d])`),c("COERCERTL",o[a.COERCE],!0),c("LONETILDE","(?:~>?)"),c("TILDETRIM",`(\\s*)${o[a.LONETILDE]}\\s+`,!0),e.tildeTrimReplace="$1~",c("TILDE",`^${o[a.LONETILDE]}${o[a.XRANGEPLAIN]}$`),c("TILDELOOSE",`^${o[a.LONETILDE]}${o[a.XRANGEPLAINLOOSE]}$`),c("LONECARET","(?:\\^)"),c("CARETTRIM",`(\\s*)${o[a.LONECARET]}\\s+`,!0),e.caretTrimReplace="$1^",c("CARET",`^${o[a.LONECARET]}${o[a.XRANGEPLAIN]}$`),c("CARETLOOSE",`^${o[a.LONECARET]}${o[a.XRANGEPLAINLOOSE]}$`),c("COMPARATORLOOSE",`^${o[a.GTLT]}\\s*(${o[a.LOOSEPLAIN]})$|^$`),c("COMPARATOR",`^${o[a.GTLT]}\\s*(${o[a.FULLPLAIN]})$|^$`),c("COMPARATORTRIM",`(\\s*)${o[a.GTLT]}\\s*(${o[a.LOOSEPLAIN]}|${o[a.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace="$1$2$3",c("HYPHENRANGE",`^\\s*(${o[a.XRANGEPLAIN]})\\s+-\\s+(${o[a.XRANGEPLAIN]})\\s*$`),c("HYPHENRANGELOOSE",`^\\s*(${o[a.XRANGEPLAINLOOSE]})\\s+-\\s+(${o[a.XRANGEPLAINLOOSE]})\\s*$`),c("STAR","(<|>)?=?\\s*\\*")},8576:(t,e,s)=>{const i=s(8796);t.exports=(t,e,s)=>i(t,e,">",s)},9344:(t,e,s)=>{const i=s(15);t.exports=(t,e,s)=>(t=new i(t,s),e=new i(e,s),t.intersects(e))},6846:(t,e,s)=>{const i=s(8796);t.exports=(t,e,s)=>i(t,e,"<",s)},2965:(t,e,s)=>{const i=s(8048),r=s(15);t.exports=(t,e,s)=>{let n=null,o=null,a=null;try{a=new r(e,s)}catch(t){return null}return t.forEach(t=>{a.test(t)&&(n&&-1!==o.compare(t)||(n=t,o=new i(n,s)))}),n}},3042:(t,e,s)=>{const i=s(8048),r=s(15);t.exports=(t,e,s)=>{let n=null,o=null,a=null;try{a=new r(e,s)}catch(t){return null}return t.forEach(t=>{a.test(t)&&(n&&1!==o.compare(t)||(n=t,o=new i(n,s)))}),n}},6850:(t,e,s)=>{const i=s(8048),r=s(15),n=s(1891);t.exports=(t,e)=>{t=new r(t,e);let s=new i("0.0.0");if(t.test(s))return s;if(s=new i("0.0.0-0"),t.test(s))return s;s=null;for(let e=0;e{const e=new i(t.semver.version);switch(t.operator){case">":0===e.prerelease.length?e.patch++:e.prerelease.push(0),e.raw=e.format();case"":case">=":s&&!n(s,e)||(s=e);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+t.operator)}})}return s&&t.test(s)?s:null}},8796:(t,e,s)=>{const i=s(8048),r=s(4636),{ANY:n}=r,o=s(15),a=s(8970),h=s(1891),c=s(5689),l=s(8004),u=s(101);t.exports=(t,e,s,p)=>{let d,f,m,y,g;switch(t=new i(t,p),e=new o(e,p),s){case">":d=h,f=l,m=c,y=">",g=">=";break;case"<":d=c,f=u,m=h,y="<",g="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(a(t,e,p))return!1;for(let s=0;s{t.semver===n&&(t=new r(">=0.0.0")),o=o||t,a=a||t,d(t.semver,o.semver,p)?o=t:m(t.semver,a.semver,p)&&(a=t)}),o.operator===y||o.operator===g)return!1;if((!a.operator||a.operator===y)&&f(t,a.semver))return!1;if(a.operator===g&&m(t,a.semver))return!1}return!0}},6426:(t,e,s)=>{const i=s(15);t.exports=(t,e)=>new i(t,e).set.map(t=>t.map(t=>t.value).join(" ").trim().split(" "))},5017:(t,e,s)=>{const i=s(15);t.exports=(t,e)=>{try{return new i(t,e).range||"*"}catch(t){return null}}},7953:(t,e,s)=>{"use strict";const i=s(2087),r=s(3867),n=s(6603),{env:o}=process;let a;function h(t){return 0!==t&&{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function c(t,e){if(0===a)return 0;if(n("color=16m")||n("color=full")||n("color=truecolor"))return 3;if(n("color=256"))return 2;if(t&&!e&&void 0===a)return 0;const s=a||0;if("dumb"===o.TERM)return s;if("win32"===process.platform){const t=i.release().split(".");return Number(t[0])>=10&&Number(t[2])>=10586?Number(t[2])>=14931?3:2:1}if("CI"in o)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(t=>t in o)||"codeship"===o.CI_NAME?1:s;if("TEAMCITY_VERSION"in o)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(o.TEAMCITY_VERSION)?1:0;if("GITHUB_ACTIONS"in o)return 1;if("truecolor"===o.COLORTERM)return 3;if("TERM_PROGRAM"in o){const t=parseInt((o.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(o.TERM_PROGRAM){case"iTerm.app":return t>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(o.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(o.TERM)||"COLORTERM"in o?1:s}n("no-color")||n("no-colors")||n("color=false")||n("color=never")?a=0:(n("color")||n("colors")||n("color=true")||n("color=always"))&&(a=1),"FORCE_COLOR"in o&&(a="true"===o.FORCE_COLOR?1:"false"===o.FORCE_COLOR?0:0===o.FORCE_COLOR.length?1:Math.min(parseInt(o.FORCE_COLOR,10),3)),t.exports={supportsColor:function(t){return h(c(t,t&&t.isTTY))},stdout:h(c(!0,r.isatty(1))),stderr:h(c(!0,r.isatty(2)))}},5229:(t,e,s)=>{"use strict";e.c=s(4033),s(3830),e.t=s(571),s(5336),e.x=s(5244),s(7414),s(5110),s(3706),s(5908),s(4563),s(1577),s(1379),s(501)},4033:(t,e,s)=>{"use strict";const i=s(8029),r=s(7414),n=(s(5747),s(4889)),o=s(571),a=s(5622),h=(t.exports=(t,e,s)=>{if("function"==typeof e&&(s=e),Array.isArray(t)&&(e=t,t={}),!e||!Array.isArray(e)||!e.length)throw new TypeError("no files or directories specified");e=Array.from(e);const r=i(t);if(r.sync&&"function"==typeof s)throw new TypeError("callback not supported for sync tar functions");if(!r.file&&"function"==typeof s)throw new TypeError("callback only supported with file option");return r.file&&r.sync?h(r,e):r.file?c(r,e,s):r.sync?p(r,e):d(r,e)},(t,e)=>{const s=new r.Sync(t),i=new n.WriteStreamSync(t.file,{mode:t.mode||438});s.pipe(i),l(s,e)}),c=(t,e,s)=>{const i=new r(t),o=new n.WriteStream(t.file,{mode:t.mode||438});i.pipe(o);const a=new Promise((t,e)=>{o.on("error",e),o.on("close",t),i.on("error",e)});return u(i,e),s?a.then(s,s):a},l=(t,e)=>{e.forEach(e=>{"@"===e.charAt(0)?o({file:a.resolve(t.cwd,e.substr(1)),sync:!0,noResume:!0,onentry:e=>t.add(e)}):t.add(e)}),t.end()},u=(t,e)=>{for(;e.length;){const s=e.shift();if("@"===s.charAt(0))return o({file:a.resolve(t.cwd,s.substr(1)),noResume:!0,onentry:e=>t.add(e)}).then(s=>u(t,e));t.add(s)}t.end()},p=(t,e)=>{const s=new r.Sync(t);return l(s,e),s},d=(t,e)=>{const s=new r(t);return u(s,e),s}},5244:(t,e,s)=>{"use strict";const i=s(8029),r=s(5110),n=s(5747),o=s(4889),a=s(5622),h=(t.exports=(t,e,s)=>{"function"==typeof t?(s=t,e=null,t={}):Array.isArray(t)&&(e=t,t={}),"function"==typeof e&&(s=e,e=null),e=e?Array.from(e):[];const r=i(t);if(r.sync&&"function"==typeof s)throw new TypeError("callback not supported for sync tar functions");if(!r.file&&"function"==typeof s)throw new TypeError("callback only supported with file option");return e.length&&h(r,e),r.file&&r.sync?c(r):r.file?l(r,s):r.sync?u(r):p(r)},(t,e)=>{const s=new Map(e.map(t=>[t.replace(/\/+$/,""),!0])),i=t.filter,r=(t,e)=>{const i=e||a.parse(t).root||".",n=t!==i&&(s.has(t)?s.get(t):r(a.dirname(t),i));return s.set(t,n),n};t.filter=i?(t,e)=>i(t,e)&&r(t.replace(/\/+$/,"")):t=>r(t.replace(/\/+$/,""))}),c=t=>{const e=new r.Sync(t),s=t.file;const i=n.statSync(s),a=t.maxReadSize||16777216;new o.ReadStreamSync(s,{readSize:a,size:i.size}).pipe(e)},l=(t,e)=>{const s=new r(t),i=t.maxReadSize||16777216,a=t.file,h=new Promise((t,e)=>{s.on("error",e),s.on("close",t),n.stat(a,(t,r)=>{if(t)e(t);else{const t=new o.ReadStream(a,{readSize:i,size:r.size});t.on("error",e),t.pipe(s)}})});return e?h.then(e,e):h},u=t=>new r.Sync(t),p=t=>new r(t)},8191:(t,e,s)=>{const i="win32"===(process.env.__FAKE_PLATFORM__||process.platform),r=global.__FAKE_TESTING_FS__||s(5747),{O_CREAT:n,O_TRUNC:o,O_WRONLY:a,UV_FS_O_FILEMAP:h=0}=r.constants,c=i&&!!h,l=h|o|n|a;t.exports=c?t=>t<524288?l:"w":()=>"w"},1577:(t,e,s)=>{"use strict";const i=s(501),r=s(5622).posix,n=s(540),o=Symbol("slurp"),a=Symbol("type");const h=(t,e)=>{let s,i=t,n="";const o=r.parse(t).root||".";if(Buffer.byteLength(i)<100)s=[i,n,!1];else{n=r.dirname(i),i=r.basename(i);do{Buffer.byteLength(i)<=100&&Buffer.byteLength(n)<=e?s=[i,n,!1]:Buffer.byteLength(i)>100&&Buffer.byteLength(n)<=e?s=[i.substr(0,99),n,!0]:(i=r.join(r.basename(n),i),n=r.dirname(n))}while(n!==o&&!s);s||(s=[t.substr(0,99),"",!0])}return s},c=(t,e,s)=>t.slice(e,e+s).toString("utf8").replace(/\0.*/,""),l=(t,e,s)=>u(p(t,e,s)),u=t=>null===t?null:new Date(1e3*t),p=(t,e,s)=>128&t[e]?n.parse(t.slice(e,e+s)):d(t,e,s),d=(t,e,s)=>{return i=parseInt(t.slice(e,e+s).toString("utf8").replace(/\0.*$/,"").trim(),8),isNaN(i)?null:i;var i},f={12:8589934591,8:2097151},m=(t,e,s,i)=>null!==i&&(i>f[s]||i<0?(n.encode(i,t.slice(e,e+s)),!0):(y(t,e,s,i),!1)),y=(t,e,s,i)=>t.write(g(i,s),e,s,"ascii"),g=(t,e)=>_(Math.floor(t).toString(8),e),_=(t,e)=>(t.length===e-1?t:new Array(e-t.length-1).join("0")+t+" ")+"\0",E=(t,e,s,i)=>null!==i&&m(t,e,s,i.getTime()/1e3),w=new Array(156).join("\0"),b=(t,e,s,i)=>null!==i&&(t.write(i+w,e,s,"utf8"),i.length!==Buffer.byteLength(i)||i.length>s);t.exports=class{constructor(t,e,s,i){this.cksumValid=!1,this.needPax=!1,this.nullBlock=!1,this.block=null,this.path=null,this.mode=null,this.uid=null,this.gid=null,this.size=null,this.mtime=null,this.cksum=null,this[a]="0",this.linkpath=null,this.uname=null,this.gname=null,this.devmaj=0,this.devmin=0,this.atime=null,this.ctime=null,Buffer.isBuffer(t)?this.decode(t,e||0,s,i):t&&this.set(t)}decode(t,e,s,i){if(e||(e=0),!(t&&t.length>=e+512))throw new Error("need 512 bytes for header");if(this.path=c(t,e,100),this.mode=p(t,e+100,8),this.uid=p(t,e+108,8),this.gid=p(t,e+116,8),this.size=p(t,e+124,12),this.mtime=l(t,e+136,12),this.cksum=p(t,e+148,12),this[o](s),this[o](i,!0),this[a]=c(t,e+156,1),""===this[a]&&(this[a]="0"),"0"===this[a]&&"/"===this.path.substr(-1)&&(this[a]="5"),"5"===this[a]&&(this.size=0),this.linkpath=c(t,e+157,100),"ustar\x0000"===t.slice(e+257,e+265).toString())if(this.uname=c(t,e+265,32),this.gname=c(t,e+297,32),this.devmaj=p(t,e+329,8),this.devmin=p(t,e+337,8),0!==t[e+475]){const s=c(t,e+345,155);this.path=s+"/"+this.path}else{const s=c(t,e+345,130);s&&(this.path=s+"/"+this.path),this.atime=l(t,e+476,12),this.ctime=l(t,e+488,12)}let r=256;for(let s=e;s=e+512))throw new Error("need 512 bytes for header");const s=this.ctime||this.atime?130:155,i=h(this.path||"",s),r=i[0],n=i[1];this.needPax=i[2],this.needPax=b(t,e,100,r)||this.needPax,this.needPax=m(t,e+100,8,this.mode)||this.needPax,this.needPax=m(t,e+108,8,this.uid)||this.needPax,this.needPax=m(t,e+116,8,this.gid)||this.needPax,this.needPax=m(t,e+124,12,this.size)||this.needPax,this.needPax=E(t,e+136,12,this.mtime)||this.needPax,t[e+156]=this[a].charCodeAt(0),this.needPax=b(t,e+157,100,this.linkpath)||this.needPax,t.write("ustar\x0000",e+257,8),this.needPax=b(t,e+265,32,this.uname)||this.needPax,this.needPax=b(t,e+297,32,this.gname)||this.needPax,this.needPax=m(t,e+329,8,this.devmaj)||this.needPax,this.needPax=m(t,e+337,8,this.devmin)||this.needPax,this.needPax=b(t,e+345,s,n)||this.needPax,0!==t[e+475]?this.needPax=b(t,e+345,155,n)||this.needPax:(this.needPax=b(t,e+345,130,n)||this.needPax,this.needPax=E(t,e+476,12,this.atime)||this.needPax,this.needPax=E(t,e+488,12,this.ctime)||this.needPax);let o=256;for(let s=e;s{"use strict";const e=new Map([["C","cwd"],["f","file"],["z","gzip"],["P","preservePaths"],["U","unlink"],["strip-components","strip"],["stripComponents","strip"],["keep-newer","newer"],["keepNewer","newer"],["keep-newer-files","newer"],["keepNewerFiles","newer"],["k","keep"],["keep-existing","keep"],["keepExisting","keep"],["m","noMtime"],["no-mtime","noMtime"],["p","preserveOwner"],["L","follow"],["h","follow"]]);t.exports=t=>t?Object.keys(t).map(s=>[e.has(s)?e.get(s):s,t[s]]).reduce((t,e)=>(t[e[0]]=e[1],t),Object.create(null)):{}},540:(t,e)=>{"use strict";e.encode=(t,e)=>{if(!Number.isSafeInteger(t))throw Error("cannot encode number outside of javascript safe integer range");return t<0?i(t,e):s(t,e),e};const s=(t,e)=>{e[0]=128;for(var s=e.length;s>1;s--)e[s-1]=255&t,t=Math.floor(t/256)},i=(t,e)=>{e[0]=255;var s=!1;t*=-1;for(var i=e.length;i>1;i--){var r=255&t;t=Math.floor(t/256),s?e[i-1]=o(r):0===r?e[i-1]=0:(s=!0,e[i-1]=a(r))}},r=(e.parse=t=>{t[t.length-1];var e,s=t[0];if(128===s)e=n(t.slice(1,t.length));else{if(255!==s)throw Error("invalid base256 encoding");e=r(t)}if(!Number.isSafeInteger(e))throw Error("parsed number outside of javascript safe integer range");return e},t=>{for(var e=t.length,s=0,i=!1,r=e-1;r>-1;r--){var n,h=t[r];i?n=o(h):0===h?n=h:(i=!0,n=a(h)),0!==n&&(s-=n*Math.pow(256,e-r-1))}return s}),n=t=>{for(var e=t.length,s=0,i=e-1;i>-1;i--){var r=t[i];0!==r&&(s+=r*Math.pow(256,e-i-1))}return s},o=t=>255&(255^t),a=t=>1+(255^t)&255},571:(t,e,s)=>{"use strict";const i=s(8029),r=s(3706),n=s(5747),o=s(4889),a=s(5622),h=(t.exports=(t,e,s)=>{"function"==typeof t?(s=t,e=null,t={}):Array.isArray(t)&&(e=t,t={}),"function"==typeof e&&(s=e,e=null),e=e?Array.from(e):[];const r=i(t);if(r.sync&&"function"==typeof s)throw new TypeError("callback not supported for sync tar functions");if(!r.file&&"function"==typeof s)throw new TypeError("callback only supported with file option");return e.length&&c(r,e),r.noResume||h(r),r.file&&r.sync?l(r):r.file?u(r,s):p(r)},t=>{const e=t.onentry;t.onentry=e?t=>{e(t),t.resume()}:t=>t.resume()}),c=(t,e)=>{const s=new Map(e.map(t=>[t.replace(/\/+$/,""),!0])),i=t.filter,r=(t,e)=>{const i=e||a.parse(t).root||".",n=t!==i&&(s.has(t)?s.get(t):r(a.dirname(t),i));return s.set(t,n),n};t.filter=i?(t,e)=>i(t,e)&&r(t.replace(/\/+$/,"")):t=>r(t.replace(/\/+$/,""))},l=t=>{const e=p(t),s=t.file;let i,r=!0;try{const o=n.statSync(s),a=t.maxReadSize||16777216;if(o.size{const s=new r(t),i=t.maxReadSize||16777216,a=t.file,h=new Promise((t,e)=>{s.on("error",e),s.on("end",t),n.stat(a,(t,r)=>{if(t)e(t);else{const t=new o.ReadStream(a,{readSize:i,size:r.size});t.on("error",e),t.pipe(s)}})});return e?h.then(e,e):h},p=t=>new r(t)},2985:(t,e,s)=>{"use strict";const i=s(1679),r=s(5747),n=s(5622),o=s(7059);class a extends Error{constructor(t,e){super("Cannot extract through symbolic link"),this.path=e,this.symlink=t}get name(){return"SylinkError"}}class h extends Error{constructor(t,e){super(e+": Cannot cd into '"+t+"'"),this.path=t,this.code=e}get name(){return"CwdError"}}t.exports=(t,e,s)=>{const a=e.umask,l=448|e.mode,u=0!=(l&a),p=e.uid,d=e.gid,f="number"==typeof p&&"number"==typeof d&&(p!==e.processUid||d!==e.processGid),m=e.preserve,y=e.unlink,g=e.cache,_=e.cwd,E=(e,i)=>{e?s(e):(g.set(t,!0),i&&f?o(i,p,d,t=>E(t)):u?r.chmod(t,l,s):s())};if(g&&!0===g.get(t))return E();if(t===_)return r.stat(t,(e,s)=>{!e&&s.isDirectory()||(e=new h(t,e&&e.code||"ENOTDIR")),E(e)});if(m)return i(t,{mode:l}).then(t=>E(null,t),E);const w=n.relative(_,t).split(/\/|\\/);c(_,w,l,g,y,_,null,E)};const c=(t,e,s,i,n,o,a,h)=>{if(!e.length)return h(null,a);const u=t+"/"+e.shift();if(i.get(u))return c(u,e,s,i,n,o,a,h);r.mkdir(u,s,l(u,e,s,i,n,o,a,h))},l=(t,e,s,i,o,u,p,d)=>f=>{if(f){if(f.path&&n.dirname(f.path)===u&&("ENOTDIR"===f.code||"ENOENT"===f.code))return d(new h(u,f.code));r.lstat(t,(n,h)=>{if(n)d(n);else if(h.isDirectory())c(t,e,s,i,o,u,p,d);else if(o)r.unlink(t,n=>{if(n)return d(n);r.mkdir(t,s,l(t,e,s,i,o,u,p,d))});else{if(h.isSymbolicLink())return d(new a(t,t+"/"+e.join("/")));d(f)}})}else c(t,e,s,i,o,u,p=p||t,d)};t.exports.sync=(t,e)=>{const s=e.umask,c=448|e.mode,l=0!=(c&s),u=e.uid,p=e.gid,d="number"==typeof u&&"number"==typeof p&&(u!==e.processUid||p!==e.processGid),f=e.preserve,m=e.unlink,y=e.cache,g=e.cwd,_=e=>{y.set(t,!0),e&&d&&o.sync(e,u,p),l&&r.chmodSync(t,c)};if(y&&!0===y.get(t))return _();if(t===g){let e=!1,s="ENOTDIR";try{e=r.statSync(t).isDirectory()}catch(t){s=t.code}finally{if(!e)throw new h(t,s)}return void _()}if(f)return _(i.sync(t,c));const E=n.relative(g,t).split(/\/|\\/);let w=null;for(let t=E.shift(),e=g;t&&(e+="/"+t);t=E.shift())if(!y.get(e))try{r.mkdirSync(e,c),w=w||e,y.set(e,!0)}catch(t){if(t.path&&n.dirname(t.path)===g&&("ENOTDIR"===t.code||"ENOENT"===t.code))return new h(g,t.code);const s=r.lstatSync(e);if(s.isDirectory()){y.set(e,!0);continue}if(m){r.unlinkSync(e),r.mkdirSync(e,c),w=w||e,y.set(e,!0);continue}if(s.isSymbolicLink())return new a(e,e+"/"+E.join("/"))}return _(w)}},8073:t=>{"use strict";t.exports=(t,e,s)=>(t&=4095,s&&(t=-19&(384|t)),e&&(256&t&&(t|=64),32&t&&(t|=8),4&t&&(t|=1)),t)},7414:(t,e,s)=>{"use strict";class i{constructor(t,e){this.path=t||"./",this.absolute=e,this.entry=null,this.stat=null,this.readdir=null,this.pending=!1,this.ignore=!1,this.piped=!1}}const r=s(4309),n=s(8855),o=s(5908),a=s(4563),h=a.Sync,c=a.Tar,l=s(7638),u=Buffer.alloc(1024),p=Symbol("onStat"),d=Symbol("ended"),f=Symbol("queue"),m=Symbol("current"),y=Symbol("process"),g=Symbol("processing"),_=Symbol("processJob"),E=Symbol("jobs"),w=Symbol("jobDone"),b=Symbol("addFSEntry"),O=Symbol("addTarEntry"),R=Symbol("stat"),v=Symbol("readdir"),S=Symbol("onreaddir"),x=Symbol("pipe"),I=Symbol("entry"),T=Symbol("entryOpt"),C=Symbol("writeEntryClass"),A=Symbol("write"),L=Symbol("ondrain"),k=s(5747),P=s(5622),D=s(2020)(class extends r{constructor(t){super(t),t=t||Object.create(null),this.opt=t,this.file=t.file||"",this.cwd=t.cwd||process.cwd(),this.maxReadSize=t.maxReadSize,this.preservePaths=!!t.preservePaths,this.strict=!!t.strict,this.noPax=!!t.noPax,this.prefix=(t.prefix||"").replace(/(\\|\/)+$/,""),this.linkCache=t.linkCache||new Map,this.statCache=t.statCache||new Map,this.readdirCache=t.readdirCache||new Map,this[C]=a,"function"==typeof t.onwarn&&this.on("warn",t.onwarn),this.portable=!!t.portable,this.zip=null,t.gzip?("object"!=typeof t.gzip&&(t.gzip={}),this.portable&&(t.gzip.portable=!0),this.zip=new n.Gzip(t.gzip),this.zip.on("data",t=>super.write(t)),this.zip.on("end",t=>super.end()),this.zip.on("drain",t=>this[L]()),this.on("resume",t=>this.zip.resume())):this.on("drain",this[L]),this.noDirRecurse=!!t.noDirRecurse,this.follow=!!t.follow,this.noMtime=!!t.noMtime,this.mtime=t.mtime||null,this.filter="function"==typeof t.filter?t.filter:t=>!0,this[f]=new l,this[E]=0,this.jobs=+t.jobs||4,this[g]=!1,this[d]=!1}[A](t){return super.write(t)}add(t){return this.write(t),this}end(t){return t&&this.write(t),this[d]=!0,this[y](),this}write(t){if(this[d])throw new Error("write after end");return t instanceof o?this[O](t):this[b](t),this.flowing}[O](t){const e=P.resolve(this.cwd,t.path);if(this.prefix&&(t.path=this.prefix+"/"+t.path.replace(/^\.(\/+|$)/,"")),this.filter(t.path,t)){const s=new i(t.path,e,!1);s.entry=new c(t,this[T](s)),s.entry.on("end",t=>this[w](s)),this[E]+=1,this[f].push(s)}else t.resume();this[y]()}[b](t){const e=P.resolve(this.cwd,t);this.prefix&&(t=this.prefix+"/"+t.replace(/^\.(\/+|$)/,"")),this[f].push(new i(t,e)),this[y]()}[R](t){t.pending=!0,this[E]+=1;const e=this.follow?"stat":"lstat";k[e](t.absolute,(e,s)=>{t.pending=!1,this[E]-=1,e?this.emit("error",e):this[p](t,s)})}[p](t,e){this.statCache.set(t.absolute,e),t.stat=e,this.filter(t.path,e)||(t.ignore=!0),this[y]()}[v](t){t.pending=!0,this[E]+=1,k.readdir(t.absolute,(e,s)=>{if(t.pending=!1,this[E]-=1,e)return this.emit("error",e);this[S](t,s)})}[S](t,e){this.readdirCache.set(t.absolute,e),t.readdir=e,this[y]()}[y](){if(!this[g]){this[g]=!0;for(let t=this[f].head;null!==t&&this[E]this.warn(t,e,s),noPax:this.noPax,cwd:this.cwd,absolute:t.absolute,preservePaths:this.preservePaths,maxReadSize:this.maxReadSize,strict:this.strict,portable:this.portable,linkCache:this.linkCache,statCache:this.statCache,noMtime:this.noMtime,mtime:this.mtime}}[I](t){this[E]+=1;try{return new this[C](t.path,this[T](t)).on("end",()=>this[w](t)).on("error",t=>this.emit("error",t))}catch(t){this.emit("error",t)}}[L](){this[m]&&this[m].entry&&this[m].entry.resume()}[x](t){t.piped=!0,t.readdir&&t.readdir.forEach(e=>{const s=this.prefix?t.path.slice(this.prefix.length+1)||"./":t.path,i="./"===s?"":s.replace(/\/*$/,"/");this[b](i+e)});const e=t.entry,s=this.zip;s?e.on("data",t=>{s.write(t)||e.pause()}):e.on("data",t=>{super.write(t)||e.pause()})}pause(){return this.zip&&this.zip.pause(),super.pause()}});D.Sync=class extends D{constructor(t){super(t),this[C]=h}pause(){}resume(){}[R](t){const e=this.follow?"statSync":"lstatSync";this[p](t,k[e](t.absolute))}[v](t,e){this[S](t,k.readdirSync(t.absolute))}[x](t){const e=t.entry,s=this.zip;t.readdir&&t.readdir.forEach(e=>{const s=this.prefix?t.path.slice(this.prefix.length+1)||"./":t.path,i="./"===s?"":s.replace(/\/*$/,"/");this[b](i+e)}),s?e.on("data",t=>{s.write(t)}):e.on("data",t=>{super[A](t)})}},t.exports=D},3706:(t,e,s)=>{"use strict";const i=s(2020),r=(s(5622),s(1577)),n=s(8614),o=s(7638),a=s(5908),h=s(1379),c=s(8855),l=Buffer.from([31,139]),u=Symbol("state"),p=Symbol("writeEntry"),d=Symbol("readEntry"),f=Symbol("nextEntry"),m=Symbol("processEntry"),y=Symbol("extendedHeader"),g=Symbol("globalExtendedHeader"),_=Symbol("meta"),E=Symbol("emitMeta"),w=Symbol("buffer"),b=Symbol("queue"),O=Symbol("ended"),R=Symbol("emittedEnd"),v=Symbol("emit"),S=Symbol("unzip"),x=Symbol("consumeChunk"),I=Symbol("consumeChunkSub"),T=Symbol("consumeBody"),C=Symbol("consumeMeta"),A=Symbol("consumeHeader"),L=Symbol("consuming"),k=Symbol("bufferConcat"),P=Symbol("maybeEnd"),D=Symbol("writing"),N=Symbol("aborted"),$=Symbol("onDone"),M=Symbol("sawValidEntry"),F=Symbol("sawNullBlock"),B=Symbol("sawEOF"),j=t=>!0;t.exports=i(class extends n{constructor(t){super(t=t||{}),this.file=t.file||"",this[M]=null,this.on($,t=>{"begin"!==this[u]&&!1!==this[M]||this.warn("TAR_BAD_ARCHIVE","Unrecognized archive format")}),t.ondone?this.on($,t.ondone):this.on($,t=>{this.emit("prefinish"),this.emit("finish"),this.emit("end"),this.emit("close")}),this.strict=!!t.strict,this.maxMetaEntrySize=t.maxMetaEntrySize||1048576,this.filter="function"==typeof t.filter?t.filter:j,this.writable=!0,this.readable=!1,this[b]=new o,this[w]=null,this[d]=null,this[p]=null,this[u]="begin",this[_]="",this[y]=null,this[g]=null,this[O]=!1,this[S]=null,this[N]=!1,this[F]=!1,this[B]=!1,"function"==typeof t.onwarn&&this.on("warn",t.onwarn),"function"==typeof t.onentry&&this.on("entry",t.onentry)}[A](t,e){let s;null===this[M]&&(this[M]=!1);try{s=new r(t,e,this[y],this[g])}catch(t){return this.warn("TAR_ENTRY_INVALID",t)}if(s.nullBlock)this[F]?(this[B]=!0,"begin"===this[u]&&(this[u]="header"),this[v]("eof")):(this[F]=!0,this[v]("nullBlock"));else if(this[F]=!1,s.cksumValid)if(s.path){const t=s.type;if(/^(Symbolic)?Link$/.test(t)&&!s.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath required",{header:s});else if(!/^(Symbolic)?Link$/.test(t)&&s.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath forbidden",{header:s});else{const t=this[p]=new a(s,this[y],this[g]);if(!this[M])if(t.remain){const e=()=>{t.invalid||(this[M]=!0)};t.on("end",e)}else this[M]=!0;t.meta?t.size>this.maxMetaEntrySize?(t.ignore=!0,this[v]("ignoredEntry",t),this[u]="ignore",t.resume()):t.size>0&&(this[_]="",t.on("data",t=>this[_]+=t),this[u]="meta"):(this[y]=null,t.ignore=t.ignore||!this.filter(t.path,t),t.ignore?(this[v]("ignoredEntry",t),this[u]=t.remain?"ignore":"header",t.resume()):(t.remain?this[u]="body":(this[u]="header",t.end()),this[d]?this[b].push(t):(this[b].push(t),this[f]())))}}else this.warn("TAR_ENTRY_INVALID","path is required",{header:s});else this.warn("TAR_ENTRY_INVALID","checksum failure",{header:s})}[m](t){let e=!0;return t?Array.isArray(t)?this.emit.apply(this,t):(this[d]=t,this.emit("entry",t),t.emittedEnd||(t.on("end",t=>this[f]()),e=!1)):(this[d]=null,e=!1),e}[f](){do{}while(this[m](this[b].shift()));if(!this[b].length){const t=this[d];!t||t.flowing||t.size===t.remain?this[D]||this.emit("drain"):t.once("drain",t=>this.emit("drain"))}}[T](t,e){const s=this[p],i=s.blockRemain,r=i>=t.length&&0===e?t:t.slice(e,e+i);return s.write(r),s.blockRemain||(this[u]="header",this[p]=null,s.end()),r.length}[C](t,e){const s=this[p],i=this[T](t,e);return this[p]||this[E](s),i}[v](t,e,s){this[b].length||this[d]?this[b].push([t,e,s]):this.emit(t,e,s)}[E](t){switch(this[v]("meta",this[_]),t.type){case"ExtendedHeader":case"OldExtendedHeader":this[y]=h.parse(this[_],this[y],!1);break;case"GlobalExtendedHeader":this[g]=h.parse(this[_],this[g],!0);break;case"NextFileHasLongPath":case"OldGnuLongPath":this[y]=this[y]||Object.create(null),this[y].path=this[_].replace(/\0.*/,"");break;case"NextFileHasLongLinkpath":this[y]=this[y]||Object.create(null),this[y].linkpath=this[_].replace(/\0.*/,"");break;default:throw new Error("unknown meta: "+t.type)}}abort(t){this[N]=!0,this.emit("abort",t),this.warn("TAR_ABORT",t,{recoverable:!1})}write(t){if(this[N])return;if(null===this[S]&&t){if(this[w]&&(t=Buffer.concat([this[w],t]),this[w]=null),t.lengththis[x](t)),this[S].on("error",t=>this.abort(t)),this[S].on("end",t=>{this[O]=!0,this[x]()}),this[D]=!0;const s=this[S][e?"end":"write"](t);return this[D]=!1,s}}this[D]=!0,this[S]?this[S].write(t):this[x](t),this[D]=!1;const e=!this[b].length&&(!this[d]||this[d].flowing);return e||this[b].length||this[d].once("drain",t=>this.emit("drain")),e}[k](t){t&&!this[N]&&(this[w]=this[w]?Buffer.concat([this[w],t]):t)}[P](){if(this[O]&&!this[R]&&!this[N]&&!this[L]){this[R]=!0;const t=this[p];if(t&&t.blockRemain){const e=this[w]?this[w].length:0;this.warn("TAR_BAD_ARCHIVE",`Truncated input (needed ${t.blockRemain} more bytes, only ${e} available)`,{entry:t}),this[w]&&t.write(this[w]),t.end()}this[v]($)}}[x](t){if(this[L])this[k](t);else if(t||this[w]){if(this[L]=!0,this[w]){this[k](t);const e=this[w];this[w]=null,this[I](e)}else this[I](t);for(;this[w]&&this[w].length>=512&&!this[N]&&!this[B];){const t=this[w];this[w]=null,this[I](t)}this[L]=!1}else this[P]();this[w]&&!this[O]||this[P]()}[I](t){let e=0,s=t.length;for(;e+512<=s&&!this[N]&&!this[B];)switch(this[u]){case"begin":case"header":this[A](t,e),e+=512;break;case"ignore":case"body":e+=this[T](t,e);break;case"meta":e+=this[C](t,e);break;default:throw new Error("invalid state: "+this[u])}e{const i=s(2357);t.exports=()=>{const t=new Map,e=new Map,{join:r}=s(5622),n=new Set,o=s=>{const{paths:i,dirs:r}=(s=>{const i=e.get(s);if(!i)throw new Error("function does not have any path reservations");return{paths:i.paths.map(e=>t.get(e)),dirs:[...i.dirs].map(e=>t.get(e))}})(s);return i.every(t=>t[0]===s)&&r.every(t=>t[0]instanceof Set&&t[0].has(s))},a=t=>!(n.has(t)||!o(t))&&(n.add(t),t(()=>h(t)),!0),h=s=>{if(!n.has(s))return!1;const{paths:r,dirs:o}=e.get(s),h=new Set;return r.forEach(e=>{const r=t.get(e);i.equal(r[0],s),1===r.length?t.delete(e):(r.shift(),"function"==typeof r[0]?h.add(r[0]):r[0].forEach(t=>h.add(t)))}),o.forEach(e=>{const r=t.get(e);i(r[0]instanceof Set),1===r[0].size&&1===r.length?t.delete(e):1===r[0].size?(r.shift(),h.add(r[0])):r[0].delete(s)}),n.delete(s),h.forEach(t=>a(t)),!0};return{check:o,reserve:(s,i)=>{const n=new Set(s.map(t=>(t=>r(t).split(/[\\\/]/).slice(0,-1).reduce((t,e)=>t.length?t.concat(r(t[t.length-1],e)):[e],[]))(t)).reduce((t,e)=>t.concat(e)));return e.set(i,{dirs:n,paths:s}),s.forEach(e=>{const s=t.get(e);s?s.push(i):t.set(e,[i])}),n.forEach(e=>{const s=t.get(e);s?s[s.length-1]instanceof Set?s[s.length-1].add(i):s.push(new Set([i])):t.set(e,[new Set([i])])}),a(i)}}}},1379:(t,e,s)=>{"use strict";const i=s(1577),r=s(5622);class n{constructor(t,e){this.atime=t.atime||null,this.charset=t.charset||null,this.comment=t.comment||null,this.ctime=t.ctime||null,this.gid=t.gid||null,this.gname=t.gname||null,this.linkpath=t.linkpath||null,this.mtime=t.mtime||null,this.path=t.path||null,this.size=t.size||null,this.uid=t.uid||null,this.uname=t.uname||null,this.dev=t.dev||null,this.ino=t.ino||null,this.nlink=t.nlink||null,this.global=e||!1}encode(){const t=this.encodeBody();if(""===t)return null;const e=Buffer.byteLength(t),s=512*Math.ceil(1+e/512),n=Buffer.allocUnsafe(s);for(let t=0;t<512;t++)n[t]=0;new i({path:("PaxHeader/"+r.basename(this.path)).slice(0,99),mode:this.mode||420,uid:this.uid||null,gid:this.gid||null,size:e,mtime:this.mtime||null,type:this.global?"GlobalExtendedHeader":"ExtendedHeader",linkpath:"",uname:this.uname||"",gname:this.gname||"",devmaj:0,devmin:0,atime:this.atime||null,ctime:this.ctime||null}).encode(n),n.write(t,512,e,"utf8");for(let t=e+512;t=Math.pow(10,i)&&(i+=1);return i+s+e}}n.parse=(t,e,s)=>new n(o(a(t),e),s);const o=(t,e)=>e?Object.keys(t).reduce((e,s)=>(e[s]=t[s],e),e):t,a=t=>t.replace(/\n$/,"").split("\n").reduce(h,Object.create(null)),h=(t,e)=>{const s=parseInt(e,10);if(s!==Buffer.byteLength(e)+1)return t;const i=(e=e.substr((s+" ").length)).split("="),r=i.shift().replace(/^SCHILY\.(dev|ino|nlink)/,"$1");if(!r)return t;const n=i.join("=");return t[r]=/^([A-Z]+\.)?([mac]|birth|creation)time$/.test(r)?new Date(1e3*n):/^[0-9]+$/.test(n)?+n:n,t};t.exports=n},5908:(t,e,s)=>{"use strict";s(501);const i=s(4309),r=Symbol("slurp");t.exports=class extends i{constructor(t,e,s){switch(super(),this.pause(),this.extended=e,this.globalExtended=s,this.header=t,this.startBlockSize=512*Math.ceil(t.size/512),this.blockRemain=this.startBlockSize,this.remain=t.size,this.type=t.type,this.meta=!1,this.ignore=!1,this.type){case"File":case"OldFile":case"Link":case"SymbolicLink":case"CharacterDevice":case"BlockDevice":case"Directory":case"FIFO":case"ContiguousFile":case"GNUDumpDir":break;case"NextFileHasLongLinkpath":case"NextFileHasLongPath":case"OldGnuLongPath":case"GlobalExtendedHeader":case"ExtendedHeader":case"OldExtendedHeader":this.meta=!0;break;default:this.ignore=!0}this.path=t.path,this.mode=t.mode,this.mode&&(this.mode=4095&this.mode),this.uid=t.uid,this.gid=t.gid,this.uname=t.uname,this.gname=t.gname,this.size=t.size,this.mtime=t.mtime,this.atime=t.atime,this.ctime=t.ctime,this.linkpath=t.linkpath,this.uname=t.uname,this.gname=t.gname,e&&this[r](e),s&&this[r](s,!0)}write(t){const e=t.length;if(e>this.blockRemain)throw new Error("writing more to entry than is appropriate");const s=this.remain,i=this.blockRemain;return this.remain=Math.max(0,s-e),this.blockRemain=Math.max(0,i-e),!!this.ignore||(s>=e?super.write(t):super.write(t.slice(0,s)))}[r](t,e){for(let s in t)null===t[s]||void 0===t[s]||e&&"path"===s||(this[s]=t[s])}}},3830:(t,e,s)=>{"use strict";const i=s(8029),r=s(7414),n=(s(3706),s(5747)),o=s(4889),a=s(571),h=s(5622),c=s(1577),l=(t.exports=(t,e,s)=>{const r=i(t);if(!r.file)throw new TypeError("file is required");if(r.gzip)throw new TypeError("cannot append to compressed archives");if(!e||!Array.isArray(e)||!e.length)throw new TypeError("no files or directories specified");return e=Array.from(e),r.sync?l(r,e):p(r,e,s)},(t,e)=>{const s=new r.Sync(t);let i,o,a=!0;try{try{i=n.openSync(t.file,"r+")}catch(e){if("ENOENT"!==e.code)throw e;i=n.openSync(t.file,"w+")}const r=n.fstatSync(i),h=Buffer.alloc(512);t:for(o=0;or.size)break;o+=s,t.mtimeCache&&t.mtimeCache.set(e.path,e.mtime)}a=!1,u(t,s,o,i,e)}finally{if(a)try{n.closeSync(i)}catch(t){}}}),u=(t,e,s,i,r)=>{const n=new o.WriteStreamSync(t.file,{fd:i,start:s});e.pipe(n),d(e,r)},p=(t,e,s)=>{e=Array.from(e);const i=new r(t),a=new Promise((s,r)=>{i.on("error",r);let a="r+";const h=(l,u)=>l&&"ENOENT"===l.code&&"r+"===a?(a="w+",n.open(t.file,a,h)):l?r(l):void n.fstat(u,(a,h)=>{if(a)return r(a);((e,s,i)=>{const r=(t,s)=>{t?n.close(e,e=>i(t)):i(null,s)};let o=0;if(0===s)return r(null,0);let a=0;const h=Buffer.alloc(512),l=(i,u)=>{if(i)return r(i);if(a+=u,a<512&&u)return n.read(e,h,a,h.length-a,o+a,l);if(0===o&&31===h[0]&&139===h[1])return r(new Error("cannot append to compressed archives"));if(a<512)return r(null,o);const p=new c(h);if(!p.cksumValid)return r(null,o);const d=512*Math.ceil(p.size/512);return o+d+512>s?r(null,o):(o+=d+512,o>=s?r(null,o):(t.mtimeCache&&t.mtimeCache.set(p.path,p.mtime),a=0,void n.read(e,h,0,512,o,l)))};n.read(e,h,0,512,o,l)})(u,h.size,(n,a)=>{if(n)return r(n);const h=new o.WriteStream(t.file,{fd:u,start:a});i.pipe(h),h.on("error",r),h.on("close",s),f(i,e)})});n.open(t.file,a,h)});return s?a.then(s,s):a},d=(t,e)=>{e.forEach(e=>{"@"===e.charAt(0)?a({file:h.resolve(t.cwd,e.substr(1)),sync:!0,noResume:!0,onentry:e=>t.add(e)}):t.add(e)}),t.end()},f=(t,e)=>{for(;e.length;){const s=e.shift();if("@"===s.charAt(0))return a({file:h.resolve(t.cwd,s.substr(1)),noResume:!0,onentry:e=>t.add(e)}).then(s=>f(t,e));t.add(s)}t.end()}},501:(t,e)=>{"use strict";e.name=new Map([["0","File"],["","OldFile"],["1","Link"],["2","SymbolicLink"],["3","CharacterDevice"],["4","BlockDevice"],["5","Directory"],["6","FIFO"],["7","ContiguousFile"],["g","GlobalExtendedHeader"],["x","ExtendedHeader"],["A","SolarisACL"],["D","GNUDumpDir"],["I","Inode"],["K","NextFileHasLongLinkpath"],["L","NextFileHasLongPath"],["M","ContinuationFile"],["N","OldGnuLongPath"],["S","SparseFile"],["V","TapeVolumeHeader"],["X","OldExtendedHeader"]]),e.code=new Map(Array.from(e.name).map(t=>[t[1],t[0]]))},5110:(t,e,s)=>{"use strict";const i=s(2357),r=(s(8614).EventEmitter,s(3706)),n=s(5747),o=s(4889),a=s(5622),h=s(2985),c=(h.sync,s(5317)),l=s(516),u=Symbol("onEntry"),p=Symbol("checkFs"),d=Symbol("checkFs2"),f=Symbol("isReusable"),m=Symbol("makeFs"),y=Symbol("file"),g=Symbol("directory"),_=Symbol("link"),E=Symbol("symlink"),w=Symbol("hardlink"),b=Symbol("unsupported"),O=(Symbol("unknown"),Symbol("checkPath")),R=Symbol("mkdir"),v=Symbol("onError"),S=Symbol("pending"),x=Symbol("pend"),I=Symbol("unpend"),T=Symbol("ended"),C=Symbol("maybeClose"),A=Symbol("skip"),L=Symbol("doChown"),k=Symbol("uid"),P=Symbol("gid"),D=s(6417),N=s(8191),$=()=>{throw new Error("sync function called cb somehow?!?")},M=(t,e,s)=>t===t>>>0?t:e===e>>>0?e:s;class F extends r{constructor(t){if(t||(t={}),t.ondone=t=>{this[T]=!0,this[C]()},super(t),this.reservations=l(),this.transform="function"==typeof t.transform?t.transform:null,this.writable=!0,this.readable=!1,this[S]=0,this[T]=!1,this.dirCache=t.dirCache||new Map,"number"==typeof t.uid||"number"==typeof t.gid){if("number"!=typeof t.uid||"number"!=typeof t.gid)throw new TypeError("cannot set owner without number uid and gid");if(t.preserveOwner)throw new TypeError("cannot preserve owner in archive and also set owner explicitly");this.uid=t.uid,this.gid=t.gid,this.setOwner=!0}else this.uid=null,this.gid=null,this.setOwner=!1;void 0===t.preserveOwner&&"number"!=typeof t.uid?this.preserveOwner=process.getuid&&0===process.getuid():this.preserveOwner=!!t.preserveOwner,this.processUid=(this.preserveOwner||this.setOwner)&&process.getuid?process.getuid():null,this.processGid=(this.preserveOwner||this.setOwner)&&process.getgid?process.getgid():null,this.forceChown=!0===t.forceChown,this.win32=!!t.win32||"win32"===process.platform,this.newer=!!t.newer,this.keep=!!t.keep,this.noMtime=!!t.noMtime,this.preservePaths=!!t.preservePaths,this.unlink=!!t.unlink,this.cwd=a.resolve(t.cwd||process.cwd()),this.strip=+t.strip||0,this.processUmask=process.umask(),this.umask="number"==typeof t.umask?t.umask:this.processUmask,this.dmode=t.dmode||511&~this.umask,this.fmode=t.fmode||438&~this.umask,this.on("entry",t=>this[u](t))}warn(t,e,s={}){return"TAR_BAD_ARCHIVE"!==t&&"TAR_ABORT"!==t||(s.recoverable=!1),super.warn(t,e,s)}[C](){this[T]&&0===this[S]&&(this.emit("prefinish"),this.emit("finish"),this.emit("end"),this.emit("close"))}[O](t){if(this.strip){const e=t.path.split(/\/|\\/);if(e.length=this.strip&&(t.linkpath=e.slice(this.strip).join("/"))}}if(!this.preservePaths){const e=t.path;if(e.match(/(^|\/|\\)\.\.(\\|\/|$)/))return this.warn("TAR_ENTRY_ERROR","path contains '..'",{entry:t,path:e}),!1;if(a.win32.isAbsolute(e)){const s=a.win32.parse(e);t.path=e.substr(s.root.length);const i=s.root;this.warn("TAR_ENTRY_INFO",`stripping ${i} from absolute path`,{entry:t,path:e})}}if(this.win32){const e=a.win32.parse(t.path);t.path=""===e.root?c.encode(t.path):e.root+c.encode(t.path.substr(e.root.length))}return a.isAbsolute(t.path)?t.absolute=t.path:t.absolute=a.resolve(this.cwd,t.path),!0}[u](t){if(!this[O](t))return t.resume();switch(i.equal(typeof t.absolute,"string"),t.type){case"Directory":case"GNUDumpDir":t.mode&&(t.mode=448|t.mode);case"File":case"OldFile":case"ContiguousFile":case"Link":case"SymbolicLink":return this[p](t);case"CharacterDevice":case"BlockDevice":case"FIFO":return this[b](t)}}[v](t,e){"CwdError"===t.name?this.emit("error",t):(this.warn("TAR_ENTRY_ERROR",t,{entry:e}),this[I](),e.resume())}[R](t,e,s){h(t,{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cache:this.dirCache,cwd:this.cwd,mode:e},s)}[L](t){return this.forceChown||this.preserveOwner&&("number"==typeof t.uid&&t.uid!==this.processUid||"number"==typeof t.gid&&t.gid!==this.processGid)||"number"==typeof this.uid&&this.uid!==this.processUid||"number"==typeof this.gid&&this.gid!==this.processGid}[k](t){return M(this.uid,t.uid,this.processUid)}[P](t){return M(this.gid,t.gid,this.processGid)}[y](t,e){const s=4095&t.mode||this.fmode,i=new o.WriteStream(t.absolute,{flags:N(t.size),mode:s,autoClose:!1});i.on("error",e=>this[v](e,t));let r=1;const a=s=>{if(s)return this[v](s,t);0==--r&&n.close(i.fd,s=>{e(),s?this[v](s,t):this[I]()})};i.on("finish",e=>{const s=t.absolute,o=i.fd;if(t.mtime&&!this.noMtime){r++;const e=t.atime||new Date,i=t.mtime;n.futimes(o,e,i,t=>t?n.utimes(s,e,i,e=>a(e&&t)):a())}if(this[L](t)){r++;const e=this[k](t),i=this[P](t);n.fchown(o,e,i,t=>t?n.chown(s,e,i,e=>a(e&&t)):a())}a()});const h=this.transform&&this.transform(t)||t;h!==t&&(h.on("error",e=>this[v](e,t)),t.pipe(h)),h.pipe(i)}[g](t,e){const s=4095&t.mode||this.dmode;this[R](t.absolute,s,s=>{if(s)return e(),this[v](s,t);let i=1;const r=s=>{0==--i&&(e(),this[I](),t.resume())};t.mtime&&!this.noMtime&&(i++,n.utimes(t.absolute,t.atime||new Date,t.mtime,r)),this[L](t)&&(i++,n.chown(t.absolute,this[k](t),this[P](t),r)),r()})}[b](t){t.unsupported=!0,this.warn("TAR_ENTRY_UNSUPPORTED","unsupported entry type: "+t.type,{entry:t}),t.resume()}[E](t,e){this[_](t,t.linkpath,"symlink",e)}[w](t,e){this[_](t,a.resolve(this.cwd,t.linkpath),"link",e)}[x](){this[S]++}[I](){this[S]--,this[C]()}[A](t){this[I](),t.resume()}[f](t,e){return"File"===t.type&&!this.unlink&&e.isFile()&&e.nlink<=1&&"win32"!==process.platform}[p](t){this[x]();const e=[t.path];t.linkpath&&e.push(t.linkpath),this.reservations.reserve(e,e=>this[d](t,e))}[d](t,e){this[R](a.dirname(t.absolute),this.dmode,s=>{if(s)return e(),this[v](s,t);n.lstat(t.absolute,(s,i)=>{i&&(this.keep||this.newer&&i.mtime>t.mtime)?(this[A](t),e()):s||this[f](t,i)?this[m](null,t,e):i.isDirectory()?"Directory"===t.type?t.mode&&(4095&i.mode)!==t.mode?n.chmod(t.absolute,t.mode,s=>this[m](s,t,e)):this[m](null,t,e):n.rmdir(t.absolute,s=>this[m](s,t,e)):((t,e)=>{if("win32"!==process.platform)return n.unlink(t,e);const s=t+".DELETE."+D.randomBytes(16).toString("hex");n.rename(t,s,t=>{if(t)return e(t);n.unlink(s,e)})})(t.absolute,s=>this[m](s,t,e))})})}[m](t,e,s){if(t)return this[v](t,e);switch(e.type){case"File":case"OldFile":case"ContiguousFile":return this[y](e,s);case"Link":return this[w](e,s);case"SymbolicLink":return this[E](e,s);case"Directory":case"GNUDumpDir":return this[g](e,s)}}[_](t,e,s,i){n[s](e,t.absolute,e=>{if(e)return this[v](e,t);i(),this[I](),t.resume()})}}F.Sync=class extends F{constructor(t){super(t)}[p](t){const e=this[R](a.dirname(t.absolute),this.dmode,$);if(e)return this[v](e,t);try{const s=n.lstatSync(t.absolute);if(this.keep||this.newer&&s.mtime>t.mtime)return this[A](t);if(this[f](t,s))return this[m](null,t,$);try{return s.isDirectory()?"Directory"===t.type?t.mode&&(4095&s.mode)!==t.mode&&n.chmodSync(t.absolute,t.mode):n.rmdirSync(t.absolute):(t=>{if("win32"!==process.platform)return n.unlinkSync(t);const e=t+".DELETE."+D.randomBytes(16).toString("hex");n.renameSync(t,e),n.unlinkSync(e)})(t.absolute),this[m](null,t,$)}catch(e){return this[v](e,t)}}catch(e){return this[m](null,t,$)}}[y](t,e){const s=4095&t.mode||this.fmode,i=e=>{let s;try{n.closeSync(r)}catch(t){s=t}(e||s)&&this[v](e||s,t)};let r;try{r=n.openSync(t.absolute,N(t.size),s)}catch(t){return i(t)}const o=this.transform&&this.transform(t)||t;o!==t&&(o.on("error",e=>this[v](e,t)),t.pipe(o)),o.on("data",t=>{try{n.writeSync(r,t,0,t.length)}catch(t){i(t)}}),o.on("end",e=>{let s=null;if(t.mtime&&!this.noMtime){const e=t.atime||new Date,i=t.mtime;try{n.futimesSync(r,e,i)}catch(r){try{n.utimesSync(t.absolute,e,i)}catch(t){s=r}}}if(this[L](t)){const e=this[k](t),i=this[P](t);try{n.fchownSync(r,e,i)}catch(r){try{n.chownSync(t.absolute,e,i)}catch(t){s=s||r}}}i(s)})}[g](t,e){const s=4095&t.mode||this.dmode,i=this[R](t.absolute,s);if(i)return this[v](i,t);if(t.mtime&&!this.noMtime)try{n.utimesSync(t.absolute,t.atime||new Date,t.mtime)}catch(i){}if(this[L](t))try{n.chownSync(t.absolute,this[k](t),this[P](t))}catch(i){}t.resume()}[R](t,e){try{return h.sync(t,{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cache:this.dirCache,cwd:this.cwd,mode:e})}catch(t){return t}}[_](t,e,s,i){try{n[s+"Sync"](e,t.absolute),t.resume()}catch(e){return this[v](e,t)}}},t.exports=F},5336:(t,e,s)=>{"use strict";const i=s(8029),r=s(3830),n=(t.exports=(t,e,s)=>{const o=i(t);if(!o.file)throw new TypeError("file is required");if(o.gzip)throw new TypeError("cannot append to compressed archives");if(!e||!Array.isArray(e)||!e.length)throw new TypeError("no files or directories specified");return e=Array.from(e),n(o),r(o,e,s)},t=>{const e=t.filter;t.mtimeCache||(t.mtimeCache=new Map),t.filter=e?(s,i)=>e(s,i)&&!(t.mtimeCache.get(s)>i.mtime):(e,s)=>!(t.mtimeCache.get(e)>s.mtime)})},2020:t=>{"use strict";t.exports=t=>class extends t{warn(t,e,s={}){this.file&&(s.file=this.file),this.cwd&&(s.cwd=this.cwd),s.code=e instanceof Error&&e.code||t,s.tarCode=t,this.strict||!1===s.recoverable?e instanceof Error?this.emit("error",Object.assign(e,s)):this.emit("error",Object.assign(new Error(`${t}: ${e}`),s)):(e instanceof Error&&(s=Object.assign(e,s),e=e.message),this.emit("warn",s.tarCode,e,s))}}},5317:t=>{"use strict";const e=["|","<",">","?",":"],s=e.map(t=>String.fromCharCode(61440+t.charCodeAt(0))),i=new Map(e.map((t,e)=>[t,s[e]])),r=new Map(s.map((t,s)=>[t,e[s]]));t.exports={encode:t=>e.reduce((t,e)=>t.split(e).join(i.get(e)),t),decode:t=>s.reduce((t,e)=>t.split(e).join(r.get(e)),t)}},4563:(t,e,s)=>{"use strict";const i=s(4309),r=s(1379),n=s(1577),o=(s(5908),s(5747)),a=s(5622),h=(s(501),Symbol("process")),c=Symbol("file"),l=Symbol("directory"),u=Symbol("symlink"),p=Symbol("hardlink"),d=Symbol("header"),f=Symbol("read"),m=Symbol("lstat"),y=Symbol("onlstat"),g=Symbol("onread"),_=Symbol("onreadlink"),E=Symbol("openfile"),w=Symbol("onopenfile"),b=Symbol("close"),O=Symbol("mode"),R=s(2020),v=s(5317),S=s(8073),x=R(class extends i{constructor(t,e){if(super(e=e||{}),"string"!=typeof t)throw new TypeError("path is required");this.path=t,this.portable=!!e.portable,this.myuid=process.getuid&&process.getuid(),this.myuser=process.env.USER||"",this.maxReadSize=e.maxReadSize||16777216,this.linkCache=e.linkCache||new Map,this.statCache=e.statCache||new Map,this.preservePaths=!!e.preservePaths,this.cwd=e.cwd||process.cwd(),this.strict=!!e.strict,this.noPax=!!e.noPax,this.noMtime=!!e.noMtime,this.mtime=e.mtime||null,"function"==typeof e.onwarn&&this.on("warn",e.onwarn);let s=!1;if(!this.preservePaths&&a.win32.isAbsolute(t)){const e=a.win32.parse(t);this.path=t.substr(e.root.length),s=e.root}this.win32=!!e.win32||"win32"===process.platform,this.win32&&(this.path=v.decode(this.path.replace(/\\/g,"/")),t=t.replace(/\\/g,"/")),this.absolute=e.absolute||a.resolve(this.cwd,t),""===this.path&&(this.path="./"),s&&this.warn("TAR_ENTRY_INFO",`stripping ${s} from absolute path`,{entry:this,path:s+this.path}),this.statCache.has(this.absolute)?this[y](this.statCache.get(this.absolute)):this[m]()}[m](){o.lstat(this.absolute,(t,e)=>{if(t)return this.emit("error",t);this[y](e)})}[y](t){this.statCache.set(this.absolute,t),this.stat=t,t.isFile()||(t.size=0),this.type=T(t),this.emit("stat",t),this[h]()}[h](){switch(this.type){case"File":return this[c]();case"Directory":return this[l]();case"SymbolicLink":return this[u]();default:return this.end()}}[O](t){return S(t,"Directory"===this.type,this.portable)}[d](){"Directory"===this.type&&this.portable&&(this.noMtime=!0),this.header=new n({path:this.path,linkpath:this.linkpath,mode:this[O](this.stat.mode),uid:this.portable?null:this.stat.uid,gid:this.portable?null:this.stat.gid,size:this.stat.size,mtime:this.noMtime?null:this.mtime||this.stat.mtime,type:this.type,uname:this.portable?null:this.stat.uid===this.myuid?this.myuser:"",atime:this.portable?null:this.stat.atime,ctime:this.portable?null:this.stat.ctime}),this.header.encode()&&!this.noPax&&this.write(new r({atime:this.portable?null:this.header.atime,ctime:this.portable?null:this.header.ctime,gid:this.portable?null:this.header.gid,mtime:this.noMtime?null:this.mtime||this.header.mtime,path:this.path,linkpath:this.linkpath,size:this.header.size,uid:this.portable?null:this.header.uid,uname:this.portable?null:this.header.uname,dev:this.portable?null:this.stat.dev,ino:this.portable?null:this.stat.ino,nlink:this.portable?null:this.stat.nlink}).encode()),this.write(this.header.block)}[l](){"/"!==this.path.substr(-1)&&(this.path+="/"),this.stat.size=0,this[d](),this.end()}[u](){o.readlink(this.absolute,(t,e)=>{if(t)return this.emit("error",t);this[_](e)})}[_](t){this.linkpath=t.replace(/\\/g,"/"),this[d](),this.end()}[p](t){this.type="Link",this.linkpath=a.relative(this.cwd,t).replace(/\\/g,"/"),this.stat.size=0,this[d](),this.end()}[c](){if(this.stat.nlink>1){const t=this.stat.dev+":"+this.stat.ino;if(this.linkCache.has(t)){const e=this.linkCache.get(t);if(0===e.indexOf(this.cwd))return this[p](e)}this.linkCache.set(t,this.absolute)}if(this[d](),0===this.stat.size)return this.end();this[E]()}[E](){o.open(this.absolute,"r",(t,e)=>{if(t)return this.emit("error",t);this[w](e)})}[w](t){const e=512*Math.ceil(this.stat.size/512),s=Math.min(e,this.maxReadSize),i=Buffer.allocUnsafe(s);this[f](t,i,0,i.length,0,this.stat.size,e)}[f](t,e,s,i,r,n,a){o.read(t,e,s,i,r,(o,h)=>{if(o)return this[b](t,()=>this.emit("error",o));this[g](t,e,s,i,r,n,a,h)})}[b](t,e){o.close(t,e)}[g](t,e,s,i,r,n,o,a){if(a<=0&&n>0){const e=new Error("encountered unexpected EOF");return e.path=this.absolute,e.syscall="read",e.code="EOF",this[b](t,()=>this.emit("error",e))}if(a>n){const e=new Error("did not encounter expected EOF");return e.path=this.absolute,e.syscall="read",e.code="EOF",this[b](t,()=>this.emit("error",e))}if(a===n)for(let t=a;tt?this.emit("error",t):this.end());s>=i&&(e=Buffer.allocUnsafe(i),s=0),i=e.length-s,this[f](t,e,s,i,r,n,o)}});const I=R(class extends i{constructor(t,e){super(e=e||{}),this.preservePaths=!!e.preservePaths,this.portable=!!e.portable,this.strict=!!e.strict,this.noPax=!!e.noPax,this.noMtime=!!e.noMtime,this.readEntry=t,this.type=t.type,"Directory"===this.type&&this.portable&&(this.noMtime=!0),this.path=t.path,this.mode=this[O](t.mode),this.uid=this.portable?null:t.uid,this.gid=this.portable?null:t.gid,this.uname=this.portable?null:t.uname,this.gname=this.portable?null:t.gname,this.size=t.size,this.mtime=this.noMtime?null:e.mtime||t.mtime,this.atime=this.portable?null:t.atime,this.ctime=this.portable?null:t.ctime,this.linkpath=t.linkpath,"function"==typeof e.onwarn&&this.on("warn",e.onwarn);let s=!1;if(a.isAbsolute(this.path)&&!this.preservePaths){const t=a.parse(this.path);s=t.root,this.path=this.path.substr(t.root.length)}this.remain=t.size,this.blockRemain=t.startBlockSize,this.header=new n({path:this.path,linkpath:this.linkpath,mode:this.mode,uid:this.portable?null:this.uid,gid:this.portable?null:this.gid,size:this.size,mtime:this.noMtime?null:this.mtime,type:this.type,uname:this.portable?null:this.uname,atime:this.portable?null:this.atime,ctime:this.portable?null:this.ctime}),s&&this.warn("TAR_ENTRY_INFO",`stripping ${s} from absolute path`,{entry:this,path:s+this.path}),this.header.encode()&&!this.noPax&&super.write(new r({atime:this.portable?null:this.atime,ctime:this.portable?null:this.ctime,gid:this.portable?null:this.gid,mtime:this.noMtime?null:this.mtime,path:this.path,linkpath:this.linkpath,size:this.size,uid:this.portable?null:this.uid,uname:this.portable?null:this.uname,dev:this.portable?null:this.readEntry.dev,ino:this.portable?null:this.readEntry.ino,nlink:this.portable?null:this.readEntry.nlink}).encode()),super.write(this.header.block),t.pipe(this)}[O](t){return S(t,"Directory"===this.type,this.portable)}write(t){const e=t.length;if(e>this.blockRemain)throw new Error("writing more to entry than is appropriate");return this.blockRemain-=e,super.write(t)}end(){return this.blockRemain&&this.write(Buffer.alloc(this.blockRemain)),super.end()}});x.Sync=class extends x{constructor(t,e){super(t,e)}[m](){this[y](o.lstatSync(this.absolute))}[u](){this[_](o.readlinkSync(this.absolute))}[E](){this[w](o.openSync(this.absolute,"r"))}[f](t,e,s,i,r,n,a){let h=!0;try{const c=o.readSync(t,e,s,i,r);this[g](t,e,s,i,r,n,a,c),h=!1}finally{if(h)try{this[b](t,()=>{})}catch(t){}}}[b](t,e){o.closeSync(t),e()}},x.Tar=I;const T=t=>t.isFile()?"File":t.isDirectory()?"Directory":t.isSymbolicLink()?"SymbolicLink":"Unsupported";t.exports=x},9521:(t,e,s)=>{const i="win32"===process.platform||"cygwin"===process.env.OSTYPE||"msys"===process.env.OSTYPE,r=s(5622),n=i?";":":",o=s(9882),a=t=>Object.assign(new Error("not found: "+t),{code:"ENOENT"}),h=(t,e)=>{const s=e.colon||n,r=t.match(/\//)||i&&t.match(/\\/)?[""]:[...i?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(s)],o=i?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",a=i?o.split(s):[""];return i&&-1!==t.indexOf(".")&&""!==a[0]&&a.unshift(""),{pathEnv:r,pathExt:a,pathExtExe:o}},c=(t,e,s)=>{"function"==typeof e&&(s=e,e={}),e||(e={});const{pathEnv:i,pathExt:n,pathExtExe:c}=h(t,e),l=[],u=s=>new Promise((n,o)=>{if(s===i.length)return e.all&&l.length?n(l):o(a(t));const h=i[s],c=/^".*"$/.test(h)?h.slice(1,-1):h,u=r.join(c,t),d=!c&&/^\.[\\\/]/.test(t)?t.slice(0,2)+u:u;n(p(d,s,0))}),p=(t,s,i)=>new Promise((r,a)=>{if(i===n.length)return r(u(s+1));const h=n[i];o(t+h,{pathExt:c},(n,o)=>{if(!n&&o){if(!e.all)return r(t+h);l.push(t+h)}return r(p(t,s,i+1))})});return s?u(0).then(t=>s(null,t),s):u(0)};t.exports=c,c.sync=(t,e)=>{e=e||{};const{pathEnv:s,pathExt:i,pathExtExe:n}=h(t,e),c=[];for(let a=0;a{"use strict";t.exports=function(t){t.prototype[Symbol.iterator]=function*(){for(let t=this.head;t;t=t.next)yield t.value}}},7638:(t,e,s)=>{"use strict";function i(t){var e=this;if(e instanceof i||(e=new i),e.tail=null,e.head=null,e.length=0,t&&"function"==typeof t.forEach)t.forEach((function(t){e.push(t)}));else if(arguments.length>0)for(var s=0,r=arguments.length;s1)s=e;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");i=this.head.next,s=this.head.value}for(var r=0;null!==i;r++)s=t(s,i.value,r),i=i.next;return s},i.prototype.reduceReverse=function(t,e){var s,i=this.tail;if(arguments.length>1)s=e;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");i=this.tail.prev,s=this.tail.value}for(var r=this.length-1;null!==i;r--)s=t(s,i.value,r),i=i.prev;return s},i.prototype.toArray=function(){for(var t=new Array(this.length),e=0,s=this.head;null!==s;e++)t[e]=s.value,s=s.next;return t},i.prototype.toArrayReverse=function(){for(var t=new Array(this.length),e=0,s=this.tail;null!==s;e++)t[e]=s.value,s=s.prev;return t},i.prototype.slice=function(t,e){(e=e||this.length)<0&&(e+=this.length),(t=t||0)<0&&(t+=this.length);var s=new i;if(ethis.length&&(e=this.length);for(var r=0,n=this.head;null!==n&&rthis.length&&(e=this.length);for(var r=this.length,n=this.tail;null!==n&&r>e;r--)n=n.prev;for(;null!==n&&r>t;r--,n=n.prev)s.push(n.value);return s},i.prototype.splice=function(t,e,...s){t>this.length&&(t=this.length-1),t<0&&(t=this.length+t);for(var i=0,n=this.head;null!==n&&i{"use strict";t.exports=JSON.parse('{"definitions":{"npm":{"default":"6.14.7","transparent":{"commands":[["npm","init"],["npx"]]},"ranges":{"*":{"url":"https://registry.npmjs.org/npm/-/npm-{}.tgz","bin":{"npm":"./bin/npm-cli.js","npx":"./bin/npx-cli.js"},"tags":{"type":"npm","package":"npm"}}}},"pnpm":{"default":"5.4.11","transparent":{"commands":[["pnpm","init"],["pnpx"]]},"ranges":{"*":{"url":"https://registry.npmjs.org/pnpm/-/pnpm-{}.tgz","bin":{"pnpm":"./bin/pnpm.js","pnpx":"./bin/pnpx.js"},"tags":{"type":"npm","package":"pnpm"}}}},"yarn":{"default":"1.22.10","transparent":{"default":"2.2.0","commands":[["yarn","init"],["yarn","dlx"]]},"ranges":{"<2.0.0-0":{"url":"https://registry.yarnpkg.com/yarn/-/yarn-{}.tgz","bin":{"yarn":"./bin/yarn.js","yarnpkg":"./bin/yarn.js"},"tags":{"type":"npm","package":"yarn"}},">=2.0.0-0":{"name":"yarn","url":"https://raw.githubusercontent.com/yarnpkg/berry/%40yarnpkg/cli/{}/packages/yarnpkg-cli/bin/yarn.js","bin":["yarn","yarnpkg"],"tags":{"type":"git","repository":"https://github.com/yarnpkg/berry.git","pattern":"@yarnpkg/cli/{}"}}}}}}')},2357:t=>{"use strict";t.exports=require("assert")},4293:t=>{"use strict";t.exports=require("buffer")},3129:t=>{"use strict";t.exports=require("child_process")},6417:t=>{"use strict";t.exports=require("crypto")},8614:t=>{"use strict";t.exports=require("events")},5747:t=>{"use strict";t.exports=require("fs")},7211:t=>{"use strict";t.exports=require("https")},2087:t=>{"use strict";t.exports=require("os")},5622:t=>{"use strict";t.exports=require("path")},2413:t=>{"use strict";t.exports=require("stream")},4304:t=>{"use strict";t.exports=require("string_decoder")},3867:t=>{"use strict";t.exports=require("tty")},1669:t=>{"use strict";t.exports=require("util")},8761:t=>{"use strict";t.exports=require("zlib")}},__webpack_module_cache__={};function __webpack_require__(t){if(__webpack_module_cache__[t])return __webpack_module_cache__[t].exports;var e=__webpack_module_cache__[t]={exports:{}};return __webpack_modules__[t](e,e.exports,__webpack_require__),e.exports}return __webpack_require__.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return __webpack_require__.d(e,{a:e}),e},__webpack_require__.d=(t,e)=>{for(var s in e)__webpack_require__.o(e,s)&&!__webpack_require__.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},__webpack_require__.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),__webpack_require__.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},__webpack_require__(3355)})());
\ No newline at end of file
diff --git a/deps/corepack/dist/npm.js b/deps/corepack/dist/npm.js
new file mode 100755
index 00000000000000..99181a02f1bd1d
--- /dev/null
+++ b/deps/corepack/dist/npm.js
@@ -0,0 +1,2 @@
+#!/usr/bin/env node
+require('./corepack').runMain(['npm', 'npm', ...process.argv.slice(2)]);
diff --git a/deps/corepack/dist/npx.js b/deps/corepack/dist/npx.js
new file mode 100755
index 00000000000000..28f32c8195a0be
--- /dev/null
+++ b/deps/corepack/dist/npx.js
@@ -0,0 +1,2 @@
+#!/usr/bin/env node
+require('./corepack').runMain(['npm', 'npx', ...process.argv.slice(2)]);
diff --git a/deps/corepack/dist/pnpm.js b/deps/corepack/dist/pnpm.js
new file mode 100755
index 00000000000000..58dbad0824d58f
--- /dev/null
+++ b/deps/corepack/dist/pnpm.js
@@ -0,0 +1,2 @@
+#!/usr/bin/env node
+require('./corepack').runMain(['pnpm', 'pnpm', ...process.argv.slice(2)]);
diff --git a/deps/corepack/dist/pnpx.js b/deps/corepack/dist/pnpx.js
new file mode 100755
index 00000000000000..5ed2162df845ea
--- /dev/null
+++ b/deps/corepack/dist/pnpx.js
@@ -0,0 +1,2 @@
+#!/usr/bin/env node
+require('./corepack').runMain(['pnpm', 'pnpx', ...process.argv.slice(2)]);
diff --git a/deps/corepack/dist/yarn.js b/deps/corepack/dist/yarn.js
new file mode 100755
index 00000000000000..5d6c2ff856493e
--- /dev/null
+++ b/deps/corepack/dist/yarn.js
@@ -0,0 +1,2 @@
+#!/usr/bin/env node
+require('./corepack').runMain(['yarn', 'yarn', ...process.argv.slice(2)]);
diff --git a/deps/corepack/dist/yarnpkg.js b/deps/corepack/dist/yarnpkg.js
new file mode 100755
index 00000000000000..2f408b7e8f29f0
--- /dev/null
+++ b/deps/corepack/dist/yarnpkg.js
@@ -0,0 +1,2 @@
+#!/usr/bin/env node
+require('./corepack').runMain(['yarn', 'yarnpkg', ...process.argv.slice(2)]);
diff --git a/deps/corepack/package.json b/deps/corepack/package.json
new file mode 100644
index 00000000000000..c5f756c2f0f720
--- /dev/null
+++ b/deps/corepack/package.json
@@ -0,0 +1,82 @@
+{
+ "name": "corepack",
+ "version": "0.5.0",
+ "bin": {
+ "corepack": "./dist/corepack.js",
+ "pnpm": "./dist/pnpm.js",
+ "pnpx": "./dist/pnpx.js",
+ "yarn": "./dist/yarn.js",
+ "yarnpkg": "./dist/yarnpkg.js"
+ },
+ "packageManager": "yarn@2.0.0-rc.29",
+ "devDependencies": {
+ "@babel/core": "^7.11.0",
+ "@babel/plugin-proposal-class-properties": "^7.10.4",
+ "@babel/plugin-proposal-decorators": "^7.10.5",
+ "@babel/plugin-proposal-nullish-coalescing-operator": "^7.10.4",
+ "@babel/plugin-transform-modules-commonjs": "^7.8.3",
+ "@babel/preset-typescript": "^7.10.4",
+ "@types/debug": "^4.1.5",
+ "@types/jest": "^25.1.4",
+ "@types/node": "^13.9.2",
+ "@types/semver": "^7.1.0",
+ "@types/tar": "^4.0.3",
+ "@types/which": "^1.3.2",
+ "@typescript-eslint/eslint-plugin": "^2.0.0",
+ "@typescript-eslint/parser": "^4.2.0",
+ "@yarnpkg/eslint-config": "^0.1.0",
+ "@yarnpkg/fslib": "^2.1.0",
+ "@zkochan/cmd-shim": "^5.0.0",
+ "clipanion": "^2.6.2",
+ "debug": "^4.1.1",
+ "eslint": "^7.10.0",
+ "eslint-plugin-arca": "^0.9.5",
+ "jest": "^25.1.0",
+ "nock": "^13.0.4",
+ "semver": "^7.1.3",
+ "supports-color": "^7.1.0",
+ "tar": "^6.0.1",
+ "terser-webpack-plugin": "^3.1.0",
+ "ts-loader": "^8.0.2",
+ "ts-node": "^8.10.2",
+ "typescript": "^3.9.7",
+ "webpack": "next",
+ "webpack-cli": "^3.3.11",
+ "which": "^2.0.2"
+ },
+ "scripts": {
+ "build": "rm -rf dist && webpack && ts-node ./mkshims.ts",
+ "corepack": "ts-node ./sources/main.ts",
+ "prepack": "node ./.yarn/releases/*.*js build",
+ "postpack": "rm -rf dist shims",
+ "test": "yarn jest"
+ },
+ "files": [
+ "dist",
+ "shims",
+ "LICENSE.md"
+ ],
+ "publishConfig": {
+ "executableFiles": [
+ "./dist/npm.js",
+ "./dist/npx.js",
+ "./dist/pnpm.js",
+ "./dist/pnpx.js",
+ "./dist/yarn.js",
+ "./dist/yarnpkg.js",
+ "./dist/corepack.js",
+ "./shims/npm",
+ "./shims/npm.ps1",
+ "./shims/npx",
+ "./shims/npx.ps1",
+ "./shims/pnpm",
+ "./shims/pnpm.ps1",
+ "./shims/pnpx",
+ "./shims/pnpx.ps1",
+ "./shims/yarn",
+ "./shims/yarn.ps1",
+ "./shims/yarnpkg",
+ "./shims/yarnpkg.ps1"
+ ]
+ }
+}
\ No newline at end of file
diff --git a/deps/corepack/shims/corepack b/deps/corepack/shims/corepack
new file mode 100644
index 00000000000000..3e78b5591196f8
--- /dev/null
+++ b/deps/corepack/shims/corepack
@@ -0,0 +1,12 @@
+#!/bin/sh
+basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
+
+case `uname` in
+ *CYGWIN*) basedir=`cygpath -w "$basedir"`;;
+esac
+
+if [ -x "$basedir/node" ]; then
+ exec "$basedir/node" "$basedir/../dist/corepack.js" "$@"
+else
+ exec node "$basedir/../dist/corepack.js" "$@"
+fi
diff --git a/deps/corepack/shims/corepack.cmd b/deps/corepack/shims/corepack.cmd
new file mode 100644
index 00000000000000..9fd54a0bf33827
--- /dev/null
+++ b/deps/corepack/shims/corepack.cmd
@@ -0,0 +1,7 @@
+@IF EXIST "%~dp0\node.exe" (
+ "%~dp0\node.exe" "%~dp0\..\dist\corepack.js" %*
+) ELSE (
+ @SETLOCAL
+ @SET PATHEXT=%PATHEXT:;.JS;=;%
+ node "%~dp0\..\dist\corepack.js" %*
+)
\ No newline at end of file
diff --git a/deps/corepack/shims/corepack.ps1 b/deps/corepack/shims/corepack.ps1
new file mode 100644
index 00000000000000..c3b027b7070bca
--- /dev/null
+++ b/deps/corepack/shims/corepack.ps1
@@ -0,0 +1,28 @@
+#!/usr/bin/env pwsh
+$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
+
+$exe=""
+if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
+ # Fix case when both the Windows and Linux builds of Node
+ # are installed in the same directory
+ $exe=".exe"
+}
+$ret=0
+if (Test-Path "$basedir/node$exe") {
+ # Support pipeline input
+ if ($MyInvocation.ExpectingInput) {
+ $input | & "$basedir/node$exe" "$basedir/../dist/corepack.js" $args
+ } else {
+ & "$basedir/node$exe" "$basedir/../dist/corepack.js" $args
+ }
+ $ret=$LASTEXITCODE
+} else {
+ # Support pipeline input
+ if ($MyInvocation.ExpectingInput) {
+ $input | & "node$exe" "$basedir/../dist/corepack.js" $args
+ } else {
+ & "node$exe" "$basedir/../dist/corepack.js" $args
+ }
+ $ret=$LASTEXITCODE
+}
+exit $ret
diff --git a/deps/corepack/shims/nodewin/corepack b/deps/corepack/shims/nodewin/corepack
new file mode 100644
index 00000000000000..f07039780041f8
--- /dev/null
+++ b/deps/corepack/shims/nodewin/corepack
@@ -0,0 +1,12 @@
+#!/bin/sh
+basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
+
+case `uname` in
+ *CYGWIN*) basedir=`cygpath -w "$basedir"`;;
+esac
+
+if [ -x "$basedir/node" ]; then
+ exec "$basedir/node" "$basedir/node_modules/corepack/dist/corepack.js" "$@"
+else
+ exec node "$basedir/node_modules/corepack/dist/corepack.js" "$@"
+fi
diff --git a/deps/corepack/shims/nodewin/corepack.cmd b/deps/corepack/shims/nodewin/corepack.cmd
new file mode 100644
index 00000000000000..ef86865f757b65
--- /dev/null
+++ b/deps/corepack/shims/nodewin/corepack.cmd
@@ -0,0 +1,7 @@
+@IF EXIST "%~dp0\node.exe" (
+ "%~dp0\node.exe" "%~dp0\node_modules\corepack\dist\corepack.js" %*
+) ELSE (
+ @SETLOCAL
+ @SET PATHEXT=%PATHEXT:;.JS;=;%
+ node "%~dp0\node_modules\corepack\dist\corepack.js" %*
+)
\ No newline at end of file
diff --git a/deps/corepack/shims/nodewin/corepack.ps1 b/deps/corepack/shims/nodewin/corepack.ps1
new file mode 100644
index 00000000000000..4bed6916816b97
--- /dev/null
+++ b/deps/corepack/shims/nodewin/corepack.ps1
@@ -0,0 +1,28 @@
+#!/usr/bin/env pwsh
+$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
+
+$exe=""
+if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
+ # Fix case when both the Windows and Linux builds of Node
+ # are installed in the same directory
+ $exe=".exe"
+}
+$ret=0
+if (Test-Path "$basedir/node$exe") {
+ # Support pipeline input
+ if ($MyInvocation.ExpectingInput) {
+ $input | & "$basedir/node$exe" "$basedir/node_modules/corepack/dist/corepack.js" $args
+ } else {
+ & "$basedir/node$exe" "$basedir/node_modules/corepack/dist/corepack.js" $args
+ }
+ $ret=$LASTEXITCODE
+} else {
+ # Support pipeline input
+ if ($MyInvocation.ExpectingInput) {
+ $input | & "node$exe" "$basedir/node_modules/corepack/dist/corepack.js" $args
+ } else {
+ & "node$exe" "$basedir/node_modules/corepack/dist/corepack.js" $args
+ }
+ $ret=$LASTEXITCODE
+}
+exit $ret
diff --git a/deps/corepack/shims/nodewin/npm b/deps/corepack/shims/nodewin/npm
new file mode 100644
index 00000000000000..396430290339cf
--- /dev/null
+++ b/deps/corepack/shims/nodewin/npm
@@ -0,0 +1,12 @@
+#!/bin/sh
+basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
+
+case `uname` in
+ *CYGWIN*) basedir=`cygpath -w "$basedir"`;;
+esac
+
+if [ -x "$basedir/node" ]; then
+ exec "$basedir/node" "$basedir/node_modules/corepack/dist/npm.js" "$@"
+else
+ exec node "$basedir/node_modules/corepack/dist/npm.js" "$@"
+fi
diff --git a/deps/corepack/shims/nodewin/npm.cmd b/deps/corepack/shims/nodewin/npm.cmd
new file mode 100644
index 00000000000000..f2aa293259da77
--- /dev/null
+++ b/deps/corepack/shims/nodewin/npm.cmd
@@ -0,0 +1,7 @@
+@IF EXIST "%~dp0\node.exe" (
+ "%~dp0\node.exe" "%~dp0\node_modules\corepack\dist\npm.js" %*
+) ELSE (
+ @SETLOCAL
+ @SET PATHEXT=%PATHEXT:;.JS;=;%
+ node "%~dp0\node_modules\corepack\dist\npm.js" %*
+)
\ No newline at end of file
diff --git a/deps/corepack/shims/nodewin/npm.ps1 b/deps/corepack/shims/nodewin/npm.ps1
new file mode 100644
index 00000000000000..53fa7e425acf83
--- /dev/null
+++ b/deps/corepack/shims/nodewin/npm.ps1
@@ -0,0 +1,28 @@
+#!/usr/bin/env pwsh
+$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
+
+$exe=""
+if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
+ # Fix case when both the Windows and Linux builds of Node
+ # are installed in the same directory
+ $exe=".exe"
+}
+$ret=0
+if (Test-Path "$basedir/node$exe") {
+ # Support pipeline input
+ if ($MyInvocation.ExpectingInput) {
+ $input | & "$basedir/node$exe" "$basedir/node_modules/corepack/dist/npm.js" $args
+ } else {
+ & "$basedir/node$exe" "$basedir/node_modules/corepack/dist/npm.js" $args
+ }
+ $ret=$LASTEXITCODE
+} else {
+ # Support pipeline input
+ if ($MyInvocation.ExpectingInput) {
+ $input | & "node$exe" "$basedir/node_modules/corepack/dist/npm.js" $args
+ } else {
+ & "node$exe" "$basedir/node_modules/corepack/dist/npm.js" $args
+ }
+ $ret=$LASTEXITCODE
+}
+exit $ret
diff --git a/deps/corepack/shims/nodewin/npx b/deps/corepack/shims/nodewin/npx
new file mode 100644
index 00000000000000..32f7dbcc2a25ea
--- /dev/null
+++ b/deps/corepack/shims/nodewin/npx
@@ -0,0 +1,12 @@
+#!/bin/sh
+basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
+
+case `uname` in
+ *CYGWIN*) basedir=`cygpath -w "$basedir"`;;
+esac
+
+if [ -x "$basedir/node" ]; then
+ exec "$basedir/node" "$basedir/node_modules/corepack/dist/npx.js" "$@"
+else
+ exec node "$basedir/node_modules/corepack/dist/npx.js" "$@"
+fi
diff --git a/deps/corepack/shims/nodewin/npx.cmd b/deps/corepack/shims/nodewin/npx.cmd
new file mode 100644
index 00000000000000..edd58fd269d991
--- /dev/null
+++ b/deps/corepack/shims/nodewin/npx.cmd
@@ -0,0 +1,7 @@
+@IF EXIST "%~dp0\node.exe" (
+ "%~dp0\node.exe" "%~dp0\node_modules\corepack\dist\npx.js" %*
+) ELSE (
+ @SETLOCAL
+ @SET PATHEXT=%PATHEXT:;.JS;=;%
+ node "%~dp0\node_modules\corepack\dist\npx.js" %*
+)
\ No newline at end of file
diff --git a/deps/corepack/shims/nodewin/npx.ps1 b/deps/corepack/shims/nodewin/npx.ps1
new file mode 100644
index 00000000000000..14c08544c5de8f
--- /dev/null
+++ b/deps/corepack/shims/nodewin/npx.ps1
@@ -0,0 +1,28 @@
+#!/usr/bin/env pwsh
+$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
+
+$exe=""
+if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
+ # Fix case when both the Windows and Linux builds of Node
+ # are installed in the same directory
+ $exe=".exe"
+}
+$ret=0
+if (Test-Path "$basedir/node$exe") {
+ # Support pipeline input
+ if ($MyInvocation.ExpectingInput) {
+ $input | & "$basedir/node$exe" "$basedir/node_modules/corepack/dist/npx.js" $args
+ } else {
+ & "$basedir/node$exe" "$basedir/node_modules/corepack/dist/npx.js" $args
+ }
+ $ret=$LASTEXITCODE
+} else {
+ # Support pipeline input
+ if ($MyInvocation.ExpectingInput) {
+ $input | & "node$exe" "$basedir/node_modules/corepack/dist/npx.js" $args
+ } else {
+ & "node$exe" "$basedir/node_modules/corepack/dist/npx.js" $args
+ }
+ $ret=$LASTEXITCODE
+}
+exit $ret
diff --git a/deps/corepack/shims/nodewin/pnpm b/deps/corepack/shims/nodewin/pnpm
new file mode 100644
index 00000000000000..b8d922e9d3619f
--- /dev/null
+++ b/deps/corepack/shims/nodewin/pnpm
@@ -0,0 +1,12 @@
+#!/bin/sh
+basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
+
+case `uname` in
+ *CYGWIN*) basedir=`cygpath -w "$basedir"`;;
+esac
+
+if [ -x "$basedir/node" ]; then
+ exec "$basedir/node" "$basedir/node_modules/corepack/dist/pnpm.js" "$@"
+else
+ exec node "$basedir/node_modules/corepack/dist/pnpm.js" "$@"
+fi
diff --git a/deps/corepack/shims/nodewin/pnpm.cmd b/deps/corepack/shims/nodewin/pnpm.cmd
new file mode 100644
index 00000000000000..e5c62711468115
--- /dev/null
+++ b/deps/corepack/shims/nodewin/pnpm.cmd
@@ -0,0 +1,7 @@
+@IF EXIST "%~dp0\node.exe" (
+ "%~dp0\node.exe" "%~dp0\node_modules\corepack\dist\pnpm.js" %*
+) ELSE (
+ @SETLOCAL
+ @SET PATHEXT=%PATHEXT:;.JS;=;%
+ node "%~dp0\node_modules\corepack\dist\pnpm.js" %*
+)
\ No newline at end of file
diff --git a/deps/corepack/shims/nodewin/pnpm.ps1 b/deps/corepack/shims/nodewin/pnpm.ps1
new file mode 100644
index 00000000000000..13f0be3b21827b
--- /dev/null
+++ b/deps/corepack/shims/nodewin/pnpm.ps1
@@ -0,0 +1,28 @@
+#!/usr/bin/env pwsh
+$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
+
+$exe=""
+if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
+ # Fix case when both the Windows and Linux builds of Node
+ # are installed in the same directory
+ $exe=".exe"
+}
+$ret=0
+if (Test-Path "$basedir/node$exe") {
+ # Support pipeline input
+ if ($MyInvocation.ExpectingInput) {
+ $input | & "$basedir/node$exe" "$basedir/node_modules/corepack/dist/pnpm.js" $args
+ } else {
+ & "$basedir/node$exe" "$basedir/node_modules/corepack/dist/pnpm.js" $args
+ }
+ $ret=$LASTEXITCODE
+} else {
+ # Support pipeline input
+ if ($MyInvocation.ExpectingInput) {
+ $input | & "node$exe" "$basedir/node_modules/corepack/dist/pnpm.js" $args
+ } else {
+ & "node$exe" "$basedir/node_modules/corepack/dist/pnpm.js" $args
+ }
+ $ret=$LASTEXITCODE
+}
+exit $ret
diff --git a/deps/corepack/shims/nodewin/pnpx b/deps/corepack/shims/nodewin/pnpx
new file mode 100644
index 00000000000000..5fe24b62152c74
--- /dev/null
+++ b/deps/corepack/shims/nodewin/pnpx
@@ -0,0 +1,12 @@
+#!/bin/sh
+basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
+
+case `uname` in
+ *CYGWIN*) basedir=`cygpath -w "$basedir"`;;
+esac
+
+if [ -x "$basedir/node" ]; then
+ exec "$basedir/node" "$basedir/node_modules/corepack/dist/pnpx.js" "$@"
+else
+ exec node "$basedir/node_modules/corepack/dist/pnpx.js" "$@"
+fi
diff --git a/deps/corepack/shims/nodewin/pnpx.cmd b/deps/corepack/shims/nodewin/pnpx.cmd
new file mode 100644
index 00000000000000..9907571ea4ea73
--- /dev/null
+++ b/deps/corepack/shims/nodewin/pnpx.cmd
@@ -0,0 +1,7 @@
+@IF EXIST "%~dp0\node.exe" (
+ "%~dp0\node.exe" "%~dp0\node_modules\corepack\dist\pnpx.js" %*
+) ELSE (
+ @SETLOCAL
+ @SET PATHEXT=%PATHEXT:;.JS;=;%
+ node "%~dp0\node_modules\corepack\dist\pnpx.js" %*
+)
\ No newline at end of file
diff --git a/deps/corepack/shims/nodewin/pnpx.ps1 b/deps/corepack/shims/nodewin/pnpx.ps1
new file mode 100644
index 00000000000000..a25e07e580cac8
--- /dev/null
+++ b/deps/corepack/shims/nodewin/pnpx.ps1
@@ -0,0 +1,28 @@
+#!/usr/bin/env pwsh
+$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
+
+$exe=""
+if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
+ # Fix case when both the Windows and Linux builds of Node
+ # are installed in the same directory
+ $exe=".exe"
+}
+$ret=0
+if (Test-Path "$basedir/node$exe") {
+ # Support pipeline input
+ if ($MyInvocation.ExpectingInput) {
+ $input | & "$basedir/node$exe" "$basedir/node_modules/corepack/dist/pnpx.js" $args
+ } else {
+ & "$basedir/node$exe" "$basedir/node_modules/corepack/dist/pnpx.js" $args
+ }
+ $ret=$LASTEXITCODE
+} else {
+ # Support pipeline input
+ if ($MyInvocation.ExpectingInput) {
+ $input | & "node$exe" "$basedir/node_modules/corepack/dist/pnpx.js" $args
+ } else {
+ & "node$exe" "$basedir/node_modules/corepack/dist/pnpx.js" $args
+ }
+ $ret=$LASTEXITCODE
+}
+exit $ret
diff --git a/deps/corepack/shims/nodewin/yarn b/deps/corepack/shims/nodewin/yarn
new file mode 100644
index 00000000000000..c8757d2aa9b019
--- /dev/null
+++ b/deps/corepack/shims/nodewin/yarn
@@ -0,0 +1,12 @@
+#!/bin/sh
+basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
+
+case `uname` in
+ *CYGWIN*) basedir=`cygpath -w "$basedir"`;;
+esac
+
+if [ -x "$basedir/node" ]; then
+ exec "$basedir/node" "$basedir/node_modules/corepack/dist/yarn.js" "$@"
+else
+ exec node "$basedir/node_modules/corepack/dist/yarn.js" "$@"
+fi
diff --git a/deps/corepack/shims/nodewin/yarn.cmd b/deps/corepack/shims/nodewin/yarn.cmd
new file mode 100644
index 00000000000000..ce32ffe3e0d2f2
--- /dev/null
+++ b/deps/corepack/shims/nodewin/yarn.cmd
@@ -0,0 +1,7 @@
+@IF EXIST "%~dp0\node.exe" (
+ "%~dp0\node.exe" "%~dp0\node_modules\corepack\dist\yarn.js" %*
+) ELSE (
+ @SETLOCAL
+ @SET PATHEXT=%PATHEXT:;.JS;=;%
+ node "%~dp0\node_modules\corepack\dist\yarn.js" %*
+)
\ No newline at end of file
diff --git a/deps/corepack/shims/nodewin/yarn.ps1 b/deps/corepack/shims/nodewin/yarn.ps1
new file mode 100644
index 00000000000000..2af2b4478ad260
--- /dev/null
+++ b/deps/corepack/shims/nodewin/yarn.ps1
@@ -0,0 +1,28 @@
+#!/usr/bin/env pwsh
+$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
+
+$exe=""
+if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
+ # Fix case when both the Windows and Linux builds of Node
+ # are installed in the same directory
+ $exe=".exe"
+}
+$ret=0
+if (Test-Path "$basedir/node$exe") {
+ # Support pipeline input
+ if ($MyInvocation.ExpectingInput) {
+ $input | & "$basedir/node$exe" "$basedir/node_modules/corepack/dist/yarn.js" $args
+ } else {
+ & "$basedir/node$exe" "$basedir/node_modules/corepack/dist/yarn.js" $args
+ }
+ $ret=$LASTEXITCODE
+} else {
+ # Support pipeline input
+ if ($MyInvocation.ExpectingInput) {
+ $input | & "node$exe" "$basedir/node_modules/corepack/dist/yarn.js" $args
+ } else {
+ & "node$exe" "$basedir/node_modules/corepack/dist/yarn.js" $args
+ }
+ $ret=$LASTEXITCODE
+}
+exit $ret
diff --git a/deps/corepack/shims/nodewin/yarnpkg b/deps/corepack/shims/nodewin/yarnpkg
new file mode 100644
index 00000000000000..a33404c52666cc
--- /dev/null
+++ b/deps/corepack/shims/nodewin/yarnpkg
@@ -0,0 +1,12 @@
+#!/bin/sh
+basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
+
+case `uname` in
+ *CYGWIN*) basedir=`cygpath -w "$basedir"`;;
+esac
+
+if [ -x "$basedir/node" ]; then
+ exec "$basedir/node" "$basedir/node_modules/corepack/dist/yarnpkg.js" "$@"
+else
+ exec node "$basedir/node_modules/corepack/dist/yarnpkg.js" "$@"
+fi
diff --git a/deps/corepack/shims/nodewin/yarnpkg.cmd b/deps/corepack/shims/nodewin/yarnpkg.cmd
new file mode 100644
index 00000000000000..7e78a17aa53f15
--- /dev/null
+++ b/deps/corepack/shims/nodewin/yarnpkg.cmd
@@ -0,0 +1,7 @@
+@IF EXIST "%~dp0\node.exe" (
+ "%~dp0\node.exe" "%~dp0\node_modules\corepack\dist\yarnpkg.js" %*
+) ELSE (
+ @SETLOCAL
+ @SET PATHEXT=%PATHEXT:;.JS;=;%
+ node "%~dp0\node_modules\corepack\dist\yarnpkg.js" %*
+)
\ No newline at end of file
diff --git a/deps/corepack/shims/nodewin/yarnpkg.ps1 b/deps/corepack/shims/nodewin/yarnpkg.ps1
new file mode 100644
index 00000000000000..a6df5d22d2c856
--- /dev/null
+++ b/deps/corepack/shims/nodewin/yarnpkg.ps1
@@ -0,0 +1,28 @@
+#!/usr/bin/env pwsh
+$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
+
+$exe=""
+if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
+ # Fix case when both the Windows and Linux builds of Node
+ # are installed in the same directory
+ $exe=".exe"
+}
+$ret=0
+if (Test-Path "$basedir/node$exe") {
+ # Support pipeline input
+ if ($MyInvocation.ExpectingInput) {
+ $input | & "$basedir/node$exe" "$basedir/node_modules/corepack/dist/yarnpkg.js" $args
+ } else {
+ & "$basedir/node$exe" "$basedir/node_modules/corepack/dist/yarnpkg.js" $args
+ }
+ $ret=$LASTEXITCODE
+} else {
+ # Support pipeline input
+ if ($MyInvocation.ExpectingInput) {
+ $input | & "node$exe" "$basedir/node_modules/corepack/dist/yarnpkg.js" $args
+ } else {
+ & "node$exe" "$basedir/node_modules/corepack/dist/yarnpkg.js" $args
+ }
+ $ret=$LASTEXITCODE
+}
+exit $ret
diff --git a/deps/corepack/shims/npm b/deps/corepack/shims/npm
new file mode 100755
index 00000000000000..5e4ec9a230e5de
--- /dev/null
+++ b/deps/corepack/shims/npm
@@ -0,0 +1,12 @@
+#!/bin/sh
+basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
+
+case `uname` in
+ *CYGWIN*) basedir=`cygpath -w "$basedir"`;;
+esac
+
+if [ -x "$basedir/node" ]; then
+ exec "$basedir/node" "$basedir/../dist/npm.js" "$@"
+else
+ exec node "$basedir/../dist/npm.js" "$@"
+fi
diff --git a/deps/corepack/shims/npm.cmd b/deps/corepack/shims/npm.cmd
new file mode 100644
index 00000000000000..11c22ebf26b0bd
--- /dev/null
+++ b/deps/corepack/shims/npm.cmd
@@ -0,0 +1,7 @@
+@IF EXIST "%~dp0\node.exe" (
+ "%~dp0\node.exe" "%~dp0\..\dist\npm.js" %*
+) ELSE (
+ @SETLOCAL
+ @SET PATHEXT=%PATHEXT:;.JS;=;%
+ node "%~dp0\..\dist\npm.js" %*
+)
\ No newline at end of file
diff --git a/deps/corepack/shims/npm.ps1 b/deps/corepack/shims/npm.ps1
new file mode 100755
index 00000000000000..3f6d6516892031
--- /dev/null
+++ b/deps/corepack/shims/npm.ps1
@@ -0,0 +1,28 @@
+#!/usr/bin/env pwsh
+$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
+
+$exe=""
+if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
+ # Fix case when both the Windows and Linux builds of Node
+ # are installed in the same directory
+ $exe=".exe"
+}
+$ret=0
+if (Test-Path "$basedir/node$exe") {
+ # Support pipeline input
+ if ($MyInvocation.ExpectingInput) {
+ $input | & "$basedir/node$exe" "$basedir/../dist/npm.js" $args
+ } else {
+ & "$basedir/node$exe" "$basedir/../dist/npm.js" $args
+ }
+ $ret=$LASTEXITCODE
+} else {
+ # Support pipeline input
+ if ($MyInvocation.ExpectingInput) {
+ $input | & "node$exe" "$basedir/../dist/npm.js" $args
+ } else {
+ & "node$exe" "$basedir/../dist/npm.js" $args
+ }
+ $ret=$LASTEXITCODE
+}
+exit $ret
diff --git a/deps/corepack/shims/npx b/deps/corepack/shims/npx
new file mode 100755
index 00000000000000..f17a82d7ff8506
--- /dev/null
+++ b/deps/corepack/shims/npx
@@ -0,0 +1,12 @@
+#!/bin/sh
+basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
+
+case `uname` in
+ *CYGWIN*) basedir=`cygpath -w "$basedir"`;;
+esac
+
+if [ -x "$basedir/node" ]; then
+ exec "$basedir/node" "$basedir/../dist/npx.js" "$@"
+else
+ exec node "$basedir/../dist/npx.js" "$@"
+fi
diff --git a/deps/corepack/shims/npx.cmd b/deps/corepack/shims/npx.cmd
new file mode 100644
index 00000000000000..1a5aa9863b6a98
--- /dev/null
+++ b/deps/corepack/shims/npx.cmd
@@ -0,0 +1,7 @@
+@IF EXIST "%~dp0\node.exe" (
+ "%~dp0\node.exe" "%~dp0\..\dist\npx.js" %*
+) ELSE (
+ @SETLOCAL
+ @SET PATHEXT=%PATHEXT:;.JS;=;%
+ node "%~dp0\..\dist\npx.js" %*
+)
\ No newline at end of file
diff --git a/deps/corepack/shims/npx.ps1 b/deps/corepack/shims/npx.ps1
new file mode 100755
index 00000000000000..950c2212ed9f9a
--- /dev/null
+++ b/deps/corepack/shims/npx.ps1
@@ -0,0 +1,28 @@
+#!/usr/bin/env pwsh
+$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
+
+$exe=""
+if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
+ # Fix case when both the Windows and Linux builds of Node
+ # are installed in the same directory
+ $exe=".exe"
+}
+$ret=0
+if (Test-Path "$basedir/node$exe") {
+ # Support pipeline input
+ if ($MyInvocation.ExpectingInput) {
+ $input | & "$basedir/node$exe" "$basedir/../dist/npx.js" $args
+ } else {
+ & "$basedir/node$exe" "$basedir/../dist/npx.js" $args
+ }
+ $ret=$LASTEXITCODE
+} else {
+ # Support pipeline input
+ if ($MyInvocation.ExpectingInput) {
+ $input | & "node$exe" "$basedir/../dist/npx.js" $args
+ } else {
+ & "node$exe" "$basedir/../dist/npx.js" $args
+ }
+ $ret=$LASTEXITCODE
+}
+exit $ret
diff --git a/deps/corepack/shims/pnpm b/deps/corepack/shims/pnpm
new file mode 100755
index 00000000000000..785c7d75e2bbe9
--- /dev/null
+++ b/deps/corepack/shims/pnpm
@@ -0,0 +1,12 @@
+#!/bin/sh
+basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
+
+case `uname` in
+ *CYGWIN*) basedir=`cygpath -w "$basedir"`;;
+esac
+
+if [ -x "$basedir/node" ]; then
+ exec "$basedir/node" "$basedir/../dist/pnpm.js" "$@"
+else
+ exec node "$basedir/../dist/pnpm.js" "$@"
+fi
diff --git a/deps/corepack/shims/pnpm.cmd b/deps/corepack/shims/pnpm.cmd
new file mode 100644
index 00000000000000..6b56eead039737
--- /dev/null
+++ b/deps/corepack/shims/pnpm.cmd
@@ -0,0 +1,7 @@
+@IF EXIST "%~dp0\node.exe" (
+ "%~dp0\node.exe" "%~dp0\..\dist\pnpm.js" %*
+) ELSE (
+ @SETLOCAL
+ @SET PATHEXT=%PATHEXT:;.JS;=;%
+ node "%~dp0\..\dist\pnpm.js" %*
+)
\ No newline at end of file
diff --git a/deps/corepack/shims/pnpm.ps1 b/deps/corepack/shims/pnpm.ps1
new file mode 100755
index 00000000000000..35046e1ef7dfc9
--- /dev/null
+++ b/deps/corepack/shims/pnpm.ps1
@@ -0,0 +1,28 @@
+#!/usr/bin/env pwsh
+$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
+
+$exe=""
+if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
+ # Fix case when both the Windows and Linux builds of Node
+ # are installed in the same directory
+ $exe=".exe"
+}
+$ret=0
+if (Test-Path "$basedir/node$exe") {
+ # Support pipeline input
+ if ($MyInvocation.ExpectingInput) {
+ $input | & "$basedir/node$exe" "$basedir/../dist/pnpm.js" $args
+ } else {
+ & "$basedir/node$exe" "$basedir/../dist/pnpm.js" $args
+ }
+ $ret=$LASTEXITCODE
+} else {
+ # Support pipeline input
+ if ($MyInvocation.ExpectingInput) {
+ $input | & "node$exe" "$basedir/../dist/pnpm.js" $args
+ } else {
+ & "node$exe" "$basedir/../dist/pnpm.js" $args
+ }
+ $ret=$LASTEXITCODE
+}
+exit $ret
diff --git a/deps/corepack/shims/pnpx b/deps/corepack/shims/pnpx
new file mode 100755
index 00000000000000..12bd7cc4f565e3
--- /dev/null
+++ b/deps/corepack/shims/pnpx
@@ -0,0 +1,12 @@
+#!/bin/sh
+basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
+
+case `uname` in
+ *CYGWIN*) basedir=`cygpath -w "$basedir"`;;
+esac
+
+if [ -x "$basedir/node" ]; then
+ exec "$basedir/node" "$basedir/../dist/pnpx.js" "$@"
+else
+ exec node "$basedir/../dist/pnpx.js" "$@"
+fi
diff --git a/deps/corepack/shims/pnpx.cmd b/deps/corepack/shims/pnpx.cmd
new file mode 100644
index 00000000000000..e5050ae93cba81
--- /dev/null
+++ b/deps/corepack/shims/pnpx.cmd
@@ -0,0 +1,7 @@
+@IF EXIST "%~dp0\node.exe" (
+ "%~dp0\node.exe" "%~dp0\..\dist\pnpx.js" %*
+) ELSE (
+ @SETLOCAL
+ @SET PATHEXT=%PATHEXT:;.JS;=;%
+ node "%~dp0\..\dist\pnpx.js" %*
+)
\ No newline at end of file
diff --git a/deps/corepack/shims/pnpx.ps1 b/deps/corepack/shims/pnpx.ps1
new file mode 100755
index 00000000000000..341bb49fbead7a
--- /dev/null
+++ b/deps/corepack/shims/pnpx.ps1
@@ -0,0 +1,28 @@
+#!/usr/bin/env pwsh
+$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
+
+$exe=""
+if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
+ # Fix case when both the Windows and Linux builds of Node
+ # are installed in the same directory
+ $exe=".exe"
+}
+$ret=0
+if (Test-Path "$basedir/node$exe") {
+ # Support pipeline input
+ if ($MyInvocation.ExpectingInput) {
+ $input | & "$basedir/node$exe" "$basedir/../dist/pnpx.js" $args
+ } else {
+ & "$basedir/node$exe" "$basedir/../dist/pnpx.js" $args
+ }
+ $ret=$LASTEXITCODE
+} else {
+ # Support pipeline input
+ if ($MyInvocation.ExpectingInput) {
+ $input | & "node$exe" "$basedir/../dist/pnpx.js" $args
+ } else {
+ & "node$exe" "$basedir/../dist/pnpx.js" $args
+ }
+ $ret=$LASTEXITCODE
+}
+exit $ret
diff --git a/deps/corepack/shims/yarn b/deps/corepack/shims/yarn
new file mode 100755
index 00000000000000..298711ea934fbf
--- /dev/null
+++ b/deps/corepack/shims/yarn
@@ -0,0 +1,12 @@
+#!/bin/sh
+basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
+
+case `uname` in
+ *CYGWIN*) basedir=`cygpath -w "$basedir"`;;
+esac
+
+if [ -x "$basedir/node" ]; then
+ exec "$basedir/node" "$basedir/../dist/yarn.js" "$@"
+else
+ exec node "$basedir/../dist/yarn.js" "$@"
+fi
diff --git a/deps/corepack/shims/yarn.cmd b/deps/corepack/shims/yarn.cmd
new file mode 100644
index 00000000000000..d287d59ac5e301
--- /dev/null
+++ b/deps/corepack/shims/yarn.cmd
@@ -0,0 +1,7 @@
+@IF EXIST "%~dp0\node.exe" (
+ "%~dp0\node.exe" "%~dp0\..\dist\yarn.js" %*
+) ELSE (
+ @SETLOCAL
+ @SET PATHEXT=%PATHEXT:;.JS;=;%
+ node "%~dp0\..\dist\yarn.js" %*
+)
\ No newline at end of file
diff --git a/deps/corepack/shims/yarn.ps1 b/deps/corepack/shims/yarn.ps1
new file mode 100755
index 00000000000000..f40254603d8aae
--- /dev/null
+++ b/deps/corepack/shims/yarn.ps1
@@ -0,0 +1,28 @@
+#!/usr/bin/env pwsh
+$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
+
+$exe=""
+if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
+ # Fix case when both the Windows and Linux builds of Node
+ # are installed in the same directory
+ $exe=".exe"
+}
+$ret=0
+if (Test-Path "$basedir/node$exe") {
+ # Support pipeline input
+ if ($MyInvocation.ExpectingInput) {
+ $input | & "$basedir/node$exe" "$basedir/../dist/yarn.js" $args
+ } else {
+ & "$basedir/node$exe" "$basedir/../dist/yarn.js" $args
+ }
+ $ret=$LASTEXITCODE
+} else {
+ # Support pipeline input
+ if ($MyInvocation.ExpectingInput) {
+ $input | & "node$exe" "$basedir/../dist/yarn.js" $args
+ } else {
+ & "node$exe" "$basedir/../dist/yarn.js" $args
+ }
+ $ret=$LASTEXITCODE
+}
+exit $ret
diff --git a/deps/corepack/shims/yarnpkg b/deps/corepack/shims/yarnpkg
new file mode 100755
index 00000000000000..3aa289648ad107
--- /dev/null
+++ b/deps/corepack/shims/yarnpkg
@@ -0,0 +1,12 @@
+#!/bin/sh
+basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
+
+case `uname` in
+ *CYGWIN*) basedir=`cygpath -w "$basedir"`;;
+esac
+
+if [ -x "$basedir/node" ]; then
+ exec "$basedir/node" "$basedir/../dist/yarnpkg.js" "$@"
+else
+ exec node "$basedir/../dist/yarnpkg.js" "$@"
+fi
diff --git a/deps/corepack/shims/yarnpkg.cmd b/deps/corepack/shims/yarnpkg.cmd
new file mode 100644
index 00000000000000..90d32f5c239463
--- /dev/null
+++ b/deps/corepack/shims/yarnpkg.cmd
@@ -0,0 +1,7 @@
+@IF EXIST "%~dp0\node.exe" (
+ "%~dp0\node.exe" "%~dp0\..\dist\yarnpkg.js" %*
+) ELSE (
+ @SETLOCAL
+ @SET PATHEXT=%PATHEXT:;.JS;=;%
+ node "%~dp0\..\dist\yarnpkg.js" %*
+)
\ No newline at end of file
diff --git a/deps/corepack/shims/yarnpkg.ps1 b/deps/corepack/shims/yarnpkg.ps1
new file mode 100755
index 00000000000000..825935c07351da
--- /dev/null
+++ b/deps/corepack/shims/yarnpkg.ps1
@@ -0,0 +1,28 @@
+#!/usr/bin/env pwsh
+$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
+
+$exe=""
+if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
+ # Fix case when both the Windows and Linux builds of Node
+ # are installed in the same directory
+ $exe=".exe"
+}
+$ret=0
+if (Test-Path "$basedir/node$exe") {
+ # Support pipeline input
+ if ($MyInvocation.ExpectingInput) {
+ $input | & "$basedir/node$exe" "$basedir/../dist/yarnpkg.js" $args
+ } else {
+ & "$basedir/node$exe" "$basedir/../dist/yarnpkg.js" $args
+ }
+ $ret=$LASTEXITCODE
+} else {
+ # Support pipeline input
+ if ($MyInvocation.ExpectingInput) {
+ $input | & "node$exe" "$basedir/../dist/yarnpkg.js" $args
+ } else {
+ & "node$exe" "$basedir/../dist/yarnpkg.js" $args
+ }
+ $ret=$LASTEXITCODE
+}
+exit $ret
diff --git a/doc/api/corepack.md b/doc/api/corepack.md
new file mode 100644
index 00000000000000..c31c5b69cd8b9b
--- /dev/null
+++ b/doc/api/corepack.md
@@ -0,0 +1,108 @@
+# Corepack
+
+
+
+
+> Stability: 1 - Experimental
+
+_[Corepack][]_ is an experimental tool shipped with Node.js to help with
+managing versions of your package managers. It exposes binary proxies for
+each [supported package manager][] that, when called, will identify whatever
+package manager is configured for the current project, transparently install
+it if needed, and finally run it without requiring explicit user interactions.
+
+This feature simplifies two core workflows:
+
+* It eases new contributor onboarding, since they won't have to follow
+ system-specific installation processes anymore just to have the package
+ manager you want them to.
+
+* It allows you to ensure that everyone in your team will use exactly the
+ package manager version you intend them to, without them having to
+ manually synchronize it each time you need to make an update.
+
+## Workflows
+
+### Enabling the feature
+
+Due to its experimental status Corepack currently needs to be explicitly
+enabled to have any effect. To do that simply run [`corepack enable`][], which
+will set up the symlinks in your environment, next to the `node` binary
+(and overwrite the existing symlinks if necessary).
+
+From this point forward, any call to the [supported binaries][] will work
+without further setup. Should you experience a problem, just run
+[`corepack disable`][] to remove the proxies from your system (and consider
+opening up an issue on the [Corepack repository][] to let us know).
+
+### Configuring a package
+
+The Corepack proxies will find the closest [`package.json`][] file in your
+current directory hierarchy to extract its [`"packageManager"`][] property.
+
+If the value corresponds to a [supported package manager][], Corepack will make
+sure that all calls to the relevant binaries are run against the requested
+version, downloading it on demand if needed, and aborting if it cannot be
+successfully retrieved.
+
+### Upgrading the global versions
+
+When running outside of an existing project (for example when running
+`yarn init`), Corepack will by default use predefined versions roughly
+corresponding to the latest stable releases from each tool. Those versions can
+be easily overriden by running the [`corepack prepare`][] command along with the
+package manager version you wish to set:
+
+```bash
+corepack prepare yarn@x.y.z --activate
+```
+
+### Offline workflow
+
+Many production environments don't have network accesses. Since Corepack
+usually downloads the package manager releases straight from their registries,
+it can conflict with such environments. To avoid that happening, call the
+[`corepack prepare`][] command while you still have network access (typically at
+the same time you're preparing your deploy image). This will ensure that the
+required package managers are available even without network access.
+
+The `prepare` command has [various flags][], consult the detailed
+[Corepack documentation][] for more information on the matter.
+
+## Supported package managers
+
+The following binaries are provided through Corepack:
+
+| Package manager | Binary names |
+| --------------- | -------------- |
+| [Yarn][] | `yarn` |
+| [pnpm][] | `pnpm`, `pnpx` |
+
+## Troubleshooting
+
+### Running `npm install -g yarn` doesn't work
+
+npm prevents accidentally overriding the Corepack binaries when doing a global
+install. To avoid this problem, consider one of the following options:
+
+* Don't run this command anymore; Corepack will provide the package manager
+binaries anyway and will ensure that the requested versions are always
+available, so installing the package managers explicitly isn't needed anymore.
+
+* Add the `--force` to `npm install`; this will tell npm that it's fine to
+override binaries, but you'll erase the Corepack ones in the process (should
+that happen, run [`corepack enable`][] again to add them back).
+
+[Corepack]: https://github.com/nodejs/corepack
+[Corepack documentation]: https://github.com/nodejs/corepack#readme
+[Corepack repository]: https://github.com/nodejs/corepack
+[Yarn]: https://yarnpkg.com
+[`"packageManager"`]: packages.md#packages_packagemanager
+[`corepack disable`]: https://github.com/nodejs/corepack#corepack-disable--name
+[`corepack enable`]: https://github.com/nodejs/corepack#corepack-enable--name
+[`corepack prepare`]: https://github.com/nodejs/corepack#corepack-prepare--nameversion
+[`package.json`]: packages.md#packages_node_js_package_json_field_definitions
+[pnpm]: https://pnpm.js.org
+[supported binaries]: #corepack_supported_package_managers
+[supported package manager]: #corepack_supported_package_managers
+[various flags]: https://github.com/nodejs/corepack#utility-commands
diff --git a/doc/api/index.md b/doc/api/index.md
index 391873c16122c6..f25bce23e79b27 100644
--- a/doc/api/index.md
+++ b/doc/api/index.md
@@ -20,6 +20,7 @@
* [Cluster](cluster.md)
* [Command-line options](cli.md)
* [Console](console.md)
+* [Corepack](corepack.md)
* [Crypto](crypto.md)
* [Debugger](debugger.md)
* [Deprecated APIs](deprecations.md)
diff --git a/doc/api/packages.md b/doc/api/packages.md
index 9b7ba7fb1198b2..d9bb3faf86a6fd 100644
--- a/doc/api/packages.md
+++ b/doc/api/packages.md
@@ -149,6 +149,20 @@ For completeness there is also `--input-type=commonjs`, for explicitly running
string input as CommonJS. This is the default behavior if `--input-type` is
unspecified.
+## Determining package manager
+
+> Stability: 1 - Experimental
+
+While all Node.js projects are expected to be installable by all package
+managers once published, their development teams are often required to use one
+specific package manager. To make this process easier, Node.js ships with a
+tool called [Corepack][] that aims to make all package managers transparently
+available in your environment - provided you have Node.js installed.
+
+By default Corepack won't enforce any specific package manager and will use
+generic "Last Known Good" versions, but you can improve this experience by
+setting the [`"packageManager"`][] field in your project's `package.json`.
+
## Package entry points
In a package’s `package.json` file, two fields can define entry points for a
@@ -865,6 +879,8 @@ The following fields in `package.json` files are used in Node.js:
by package managers as the name of the package.
* [`"main"`][] - The default module when loading the package, if exports is not
specified, and in versions of Node.js prior to the introduction of exports.
+* [`"packageManager"`][] - The package manager recommended when contributing to
+ the package. Leveraged by the [Corepack][] shims.
* [`"type"`][] - The package type determining whether to load `.js` files as
CommonJS or ES modules.
* [`"exports"`][] - Package exports and conditional exports. When present,
@@ -924,6 +940,30 @@ require('./path/to/directory'); // This resolves to ./path/to/directory/main.js.
When a package has an [`"exports"`][] field, this will take precedence over the
`"main"` field when importing the package by name.
+### `"packageManager"`
+
+
+> Stability: 1 - Experimental
+
+* Type: {string}
+
+```json
+{
+ "packageManager": "@"
+}
+```
+
+The `"packageManager"` field defines which package manager is expected to be
+used when working on the current project. It can set to any of the
+[supported package managers][], and will ensure that your teams use the exact
+same package manager versions without having to install anything else than
+Node.js.
+
+This field is currently experimental and needs to be opted-in; check the
+[Corepack][] page for details about the procedure.
+
### `"type"`