From c418b447453f1cbe971efdaf5c524beda761e801 Mon Sep 17 00:00:00 2001 From: Max Howell Date: Mon, 7 Apr 2025 09:51:08 -0400 Subject: [PATCH 1/2] No pre-reqs (#270) Windows installer installs without admin privs --- .github/workflows/ci.action.yml | 29 ++++++ .github/workflows/ci.installer.yml | 4 +- README.md | 5 ++ action.js | 36 ++++---- installer.ps1 | 10 +-- installer.sh | 90 +++---------------- package-lock.json | 138 ++++++++++++++++++++++++++++- package.json | 5 +- 8 files changed, 213 insertions(+), 104 deletions(-) diff --git a/.github/workflows/ci.action.yml b/.github/workflows/ci.action.yml index 6d2ef20..a659054 100644 --- a/.github/workflows/ci.action.yml +++ b/.github/workflows/ci.action.yml @@ -94,3 +94,32 @@ jobs: - run: git clean -xfd - uses: ./ - run: pkgx --version + - uses: actions/upload-artifact@v4 + with: + path: | + ./action.js + ./action.yml + name: action + + linuxen: + needs: dist + continue-on-error: true + runs-on: ubuntu-latest + strategy: + matrix: + container: + - debian:buster-slim + - debian:bullseye-slim + - debian:bookworm-slim + - archlinux:latest + - ubuntu:focal + - ubuntu:jammy + - ubuntu:noble + - fedora:latest + container: ${{ matrix.container }} + steps: + - uses: actions/download-artifact@v4 + with: + name: action + - uses: ./ + - run: pkgx node -e 'console.log(1)' diff --git a/.github/workflows/ci.installer.yml b/.github/workflows/ci.installer.yml index 73af341..25f097b 100644 --- a/.github/workflows/ci.installer.yml +++ b/.github/workflows/ci.installer.yml @@ -180,7 +180,7 @@ jobs: env: PATH: ${{ github.workspace }}/bin:/usr/bin:/bin - - run: pkgx deno eval 'console.log(1)' + - run: pkgx node -e 'console.log(1)' windows: runs-on: windows-latest @@ -188,7 +188,7 @@ jobs: - uses: actions/checkout@v4 - run: .\\installer.ps1 - run: | - $env:Path += ";C:\Program Files\pkgx" + $env:Path += ";$env:LOCALAPPDATA\pkgx" pkgx +zlib.net upgrades: diff --git a/README.md b/README.md index 8659a3a..bd6b105 100644 --- a/README.md +++ b/README.md @@ -43,11 +43,16 @@ just slow things down. ## Version History +* `v4` defaults to `pkgx`^2, uses node^20 and doesn’t install any pre-reqs on Linux† * `v3` defaults to `pkgx`^2 and uses node^20 * `v2` defaults to `pkgx`^1 and uses node^20 * `v1` defaults to `pkgx`@latest and uses node^16 * `v0` should not be used +> † `pkgx` requires glibc>=2.28, libgcc, libstdc++ and libatomic. Generally +> images come installed with these. If you are building binaries you may need +> the `-dev` versions of these packages also. +   diff --git a/action.js b/action.js index b4a09b8..8900246 100644 --- a/action.js +++ b/action.js @@ -1,4 +1,5 @@ const { execSync } = require('child_process'); +const unzipper = require('unzipper'); const semver = require('semver'); const https = require('https'); const path = require('path'); @@ -27,6 +28,7 @@ function platform_key() { } function downloadAndExtract(url, destination, strip) { + return new Promise((resolve, reject) => { https.get(url, (response) => { if (response.statusCode !== 200) { @@ -34,16 +36,23 @@ function downloadAndExtract(url, destination, strip) { return; } - console.log(`extracting tarball…`); - - const tar_stream = tar.x({ cwd: destination, strip }); + console.log(`extracting pkgx archive…`); - response - .pipe(tar_stream) // Extract directly to destination - .on('finish', resolve) - .on('error', reject); - - tar_stream.on('error', reject); + if (platform_key().startsWith('windows')) { + const unzip_stream = unzipper.Extract({ path: destination }); + response + .pipe(unzip_stream) + .promise() + .then(resolve, reject); + unzip_stream.on('error', reject); + } else { + const tar_stream = tar.x({ cwd: destination, strip }); + response + .pipe(tar_stream) + .on('finish', resolve) + .on('error', reject); + tar_stream.on('error', reject); + } }).on('error', reject); }); @@ -93,7 +102,7 @@ async function install_pkgx() { if (platform_key().startsWith('windows')) { // not yet versioned strip = 0; - return 'https://pkgx.sh/Windows/x86_64.tgz'; + return 'https://pkgx.sh/Windows/x86_64.zip'; } let url = `https://dist.pkgx.dev/pkgx.sh/${platform_key()}/versions.txt`; @@ -139,13 +148,6 @@ async function install_pkgx() { fs.appendFileSync(process.env["GITHUB_ENV"], `PKGX_DIR=${process.env.INPUT_PKGX_DIR}\n`); } - if (os.platform() == 'linux') { - console.log(`::group::installing pre-requisites`); - const installer_script_path = path.join(path.dirname(__filename), "installer.sh"); - execSync(installer_script_path, {env: {PKGX_INSTALL_PREREQS: '1', ...process.env}}); - console.log(`::endgroup::`); - } - if (process.env['INPUT_+']) { console.log(`::group::installing pkgx input packages`); let args = process.env['INPUT_+'].split(' '); diff --git a/installer.ps1 b/installer.ps1 index 15466b8..c25b3f4 100644 --- a/installer.ps1 +++ b/installer.ps1 @@ -2,8 +2,8 @@ $ErrorActionPreference = "Stop" -# Determine install location -$installDir = "$env:ProgramFiles\pkgx" +# Determine install location for the current user +$installDir = "$env:LOCALAPPDATA\pkgx" # Create directory if it doesn't exist if (!(Test-Path $installDir)) { @@ -17,10 +17,10 @@ Invoke-WebRequest -Uri $zipUrl -OutFile $zipFile Expand-Archive -Path $zipFile -DestinationPath $installDir -Force Remove-Item $zipFile -# Ensure PATH is updated -$envPath = [System.Environment]::GetEnvironmentVariable("Path", [System.EnvironmentVariableTarget]::Machine) +# Ensure user's PATH is updated +$envPath = [System.Environment]::GetEnvironmentVariable("Path", [System.EnvironmentVariableTarget]::User) if ($envPath -notlike "*$installDir*") { - [System.Environment]::SetEnvironmentVariable("Path", "$envPath;$installDir", [System.EnvironmentVariableTarget]::Machine) + [System.Environment]::SetEnvironmentVariable("Path", "$envPath;$installDir", [System.EnvironmentVariableTarget]::User) } Write-Host "pkgx installed successfully! Restart your terminal to use it." diff --git a/installer.sh b/installer.sh index a6fe005..01940dc 100755 --- a/installer.sh +++ b/installer.sh @@ -5,7 +5,6 @@ set -e _main() { if _should_install_pkgx; then _install_pkgx "$@" - _install_pre_reqs elif [ $# -eq 0 ]; then echo /usr/local/bin/"$(pkgx --version) already installed" >&2 echo /usr/local/bin/"$(pkgm --version) already installed" >&2 @@ -47,70 +46,6 @@ _is_ci() { [ -n "$CI" ] && [ $CI != 0 ] } -_install_pre_reqs() { - if _is_ci; then - apt() { - # we should use apt-get not apt in CI - # weird shit ref: https://askubuntu.com/a/668859 - export DEBIAN_FRONTEND=noninteractive - cmd=$1 - shift - $SUDO apt-get $cmd --yes -qq -o=Dpkg::Use-Pty=0 $@ - } - else - apt() { - case "$1" in - update) - echo "ensure you have the \`pkgx\` pre-requisites installed:" >&2 - ;; - install) - echo " apt-get" "$@" >&2 - ;; - esac - } - yum() { - echo "ensure you have the \`pkgx\` pre-requisites installed:" >&2 - echo " yum" "$@" >&2 - } - pacman() { - echo "ensure you have the \`pkgx\` pre-requisites installed:" >&2 - echo " pacman" "$@" >&2 - } - fi - - if test -f /etc/debian_version; then - apt update - - # minimal but required or networking doesn’t work - # https://packages.debian.org/buster/all/netbase/filelist - A="netbase" - - # difficult to pkg in our opinion - B=libudev-dev - - # ca-certs needed until we bundle our own root cert - C=ca-certificates - - case $(cat /etc/debian_version) in - jessie/sid|8.*|stretch/sid|9.*) - apt install libc-dev libstdc++-4.8-dev libgcc-4.7-dev $A $B $C;; - buster/sid|10.*) - apt install libc-dev libstdc++-8-dev libgcc-8-dev $A $B $C;; - bullseye/sid|11.*) - apt install libc-dev libstdc++-10-dev libgcc-9-dev $A $B $C;; - bookworm/sid|12.*|*) - apt install libc-dev libstdc++-11-dev libgcc-11-dev $A $B $C;; - esac - elif test -f /etc/fedora-release; then - $SUDO yum --assumeyes install libatomic - elif test -f /etc/arch-release; then - # installing gcc isn't my favorite thing, but even clang depends on it - # on archlinux. it provides libgcc. since we use it for testing, the risk - # to our builds is very low. - $SUDO pacman --noconfirm -Sy gcc libatomic_ops libxcrypt-compat - fi -} - _install_pkgx() { if _is_ci; then progress="--no-progress-meter" @@ -122,23 +57,27 @@ _install_pkgx() { if [ $# -eq 0 ]; then if [ -f /usr/local/bin/pkgx ]; then - echo "upgrading: /usr/local/bin/pkg[xm]" >&2 + echo "upgrading: /usr/local/bin/pkgx" >&2 else - echo "installing: /usr/local/bin/pkg[xm]" >&2 + echo "installing: /usr/local/bin/pkgx" >&2 fi # using a named pipe to prevent curl progress output trumping the sudo password prompt pipe="$tmpdir/pipe" mkfifo "$pipe" - curl --silent --fail --proto '=https' -o "$tmpdir/pkgm" \ - https://pkgxdev.github.io/pkgm/pkgm.ts - curl $progress --fail --proto '=https' "https://pkgx.sh/$(uname)/$(uname -m)".tgz > "$pipe" & $SUDO sh -c " mkdir -p /usr/local/bin tar xz --directory /usr/local/bin < '$pipe' - install -m 755 "$tmpdir/pkgm" /usr/local/bin + if [ ! -f /usr/local/bin/pkgm ]; then + echo '#!/usr/bin/env -S pkgx -q! pkgm' > /usr/local/bin/pkgm + chmod +x /usr/local/bin/pkgm + fi + if [ ! -f /usr/local/bin/mash ]; then + echo '#!/usr/bin/env -S pkgx -q! mash' > /usr/local/bin/mash + chmod +x /usr/local/bin/mash + fi " & wait @@ -151,7 +90,8 @@ _install_pkgx() { # tell the user what version we just installed pkgx --version - pkgm --version + pkgx pkgm@latest --version + pkgx mash@latest --version else curl $progress --fail --proto '=https' \ @@ -201,8 +141,4 @@ _should_install_pkgx() { } _prep -if [ "$PKGX_INSTALL_PREREQS" != 1 ]; then - _main "$@" -else - _install_pre_reqs -fi +_main "$@" diff --git a/package-lock.json b/package-lock.json index e78b673..5db4f51 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6,7 +6,8 @@ "": { "dependencies": { "semver": "^7.7.1", - "tar": "^7.4.3" + "tar": "^7.4.3", + "unzipper": "^0.12.3" } }, "node_modules/@isaacs/cliui": { @@ -78,6 +79,12 @@ "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", "license": "MIT" }, + "node_modules/bluebird": { + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", + "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", + "license": "MIT" + }, "node_modules/brace-expansion": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", @@ -114,6 +121,12 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "license": "MIT" }, + "node_modules/core-util-is": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", + "license": "MIT" + }, "node_modules/cross-spawn": { "version": "7.0.6", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", @@ -128,6 +141,15 @@ "node": ">= 8" } }, + "node_modules/duplexer2": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.1.4.tgz", + "integrity": "sha512-asLFVfWWtJ90ZyOUHMqk7/S2w2guQKxUI2itj3d92ADHhxUSbCMGi1f1cBcJ7xM1To+pE/Khbwo1yuNbMEPKeA==", + "license": "BSD-3-Clause", + "dependencies": { + "readable-stream": "^2.0.2" + } + }, "node_modules/eastasianwidth": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", @@ -168,6 +190,20 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/fs-extra": { + "version": "11.3.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.3.0.tgz", + "integrity": "sha512-Z4XaCL6dUDHfP/jT25jJKMmtxvuwbkrD1vNSMFlo9lNLY2c5FHYSQgHPRZUjAB26TpDEoW9HCOgplrdbaPV/ew==", + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=14.14" + } + }, "node_modules/glob": { "version": "10.4.5", "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", @@ -188,6 +224,18 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "license": "ISC" + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "license": "ISC" + }, "node_modules/is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", @@ -197,6 +245,12 @@ "node": ">=8" } }, + "node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", + "license": "MIT" + }, "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", @@ -217,6 +271,18 @@ "@pkgjs/parseargs": "^0.11.0" } }, + "node_modules/jsonfile": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", + "license": "MIT", + "dependencies": { + "universalify": "^2.0.0" + }, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, "node_modules/lru-cache": { "version": "10.4.3", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", @@ -275,6 +341,12 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/node-int64": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", + "integrity": "sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==", + "license": "MIT" + }, "node_modules/package-json-from-dist": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", @@ -306,6 +378,27 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "license": "MIT" + }, + "node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "license": "MIT", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, "node_modules/rimraf": { "version": "5.0.10", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-5.0.10.tgz", @@ -321,6 +414,12 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "license": "MIT" + }, "node_modules/semver": { "version": "7.7.1", "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz", @@ -354,6 +453,15 @@ "node": ">=8" } }, + "node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, "node_modules/string-width": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", @@ -467,6 +575,34 @@ "node": ">=18" } }, + "node_modules/universalify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", + "license": "MIT", + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/unzipper": { + "version": "0.12.3", + "resolved": "https://registry.npmjs.org/unzipper/-/unzipper-0.12.3.tgz", + "integrity": "sha512-PZ8hTS+AqcGxsaQntl3IRBw65QrBI6lxzqDEL7IAo/XCEqRTKGfOX56Vea5TH9SZczRVxuzk1re04z/YjuYCJA==", + "license": "MIT", + "dependencies": { + "bluebird": "~3.7.2", + "duplexer2": "~0.1.4", + "fs-extra": "^11.2.0", + "graceful-fs": "^4.2.2", + "node-int64": "^0.4.0" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "license": "MIT" + }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", diff --git a/package.json b/package.json index 1c4761c..6deb251 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,10 @@ { "dependencies": { "semver": "^7.7.1", - "tar": "^7.4.3" + "tar": "^7.4.3", + "unzipper": "^0.12.3" }, "scripts": { - "dist": "npx esbuild ./action.js --bundle --platform=node --target=node20 --outfile=./action.js --allow-overwrite --minify" + "dist": "npx esbuild ./action.js --bundle --platform=node --target=node20 --outfile=./action.js --allow-overwrite --minify --external:@aws-sdk/client-s3" } } From f211ee4db3110b42e5a156282372527e7c1ed723 Mon Sep 17 00:00:00 2001 From: Max Howell Date: Mon, 7 Apr 2025 09:54:40 -0400 Subject: [PATCH 2/2] v4.0.0 --- action.js | 365 +++++++++++++++++++++++++++++------------------------- 1 file changed, 193 insertions(+), 172 deletions(-) diff --git a/action.js b/action.js index 8900246..9e4b2a2 100644 --- a/action.js +++ b/action.js @@ -1,172 +1,193 @@ -const { execSync } = require('child_process'); -const unzipper = require('unzipper'); -const semver = require('semver'); -const https = require('https'); -const path = require('path'); -const tar = require('tar'); -const fs = require('fs'); -const os = require('os'); - -const dstdir = (() => { - try { - fs.accessSync('/usr/local/bin', fs.constants.W_OK); - return '/usr/local/bin'; - } catch (err) { - return path.join(process.env.INPUT_PKGX_DIR || path.join(os.homedir(), '.pkgx'), 'bin'); - } -})(); - -fs.writeFileSync(process.env["GITHUB_PATH"], `${dstdir}\n`); - -function platform_key() { - let platform = os.platform(); // 'darwin', 'linux', 'win32', etc. - if (platform == 'win32') platform = 'windows'; - let arch = os.arch(); // 'x64', 'arm64', etc. - if (arch == 'x64') arch = 'x86-64'; - if (arch == 'arm64') arch = 'aarch64'; - return `${platform}/${arch}`; -} - -function downloadAndExtract(url, destination, strip) { - - return new Promise((resolve, reject) => { - https.get(url, (response) => { - if (response.statusCode !== 200) { - reject(new Error(`Failed to get '${url}' (${response.statusCode})`)); - return; - } - - console.log(`extracting pkgx archive…`); - - if (platform_key().startsWith('windows')) { - const unzip_stream = unzipper.Extract({ path: destination }); - response - .pipe(unzip_stream) - .promise() - .then(resolve, reject); - unzip_stream.on('error', reject); - } else { - const tar_stream = tar.x({ cwd: destination, strip }); - response - .pipe(tar_stream) - .on('finish', resolve) - .on('error', reject); - tar_stream.on('error', reject); - } - - }).on('error', reject); - }); -} - -function parse_pkgx_output(output) { - - const stripQuotes = (str) => - str.startsWith('"') || str.startsWith("'") ? str.slice(1, -1) : str; - - const replaceEnvVars = (str) => { - const value = str - .replaceAll( - /\$\{([a-zA-Z0-9_]+):\+:\$[a-zA-Z0-9_]+\}/g, - (_, key) => ((v) => v ? `:${v}` : "")(process.env[key]), - ) - .replaceAll(/\$\{([a-zA-Z0-9_]+)\}/g, (_, key) => process.env[key] ?? "") - .replaceAll(/\$([a-zA-Z0-9_]+)/g, (_, key) => process.env[key] ?? ""); - return value; - }; - - for (const line of output.split("\n")) { - const match = line.match(/^([^=]+)=(.*)$/); - if (match) { - const [_, key, value_] = match; - const value = stripQuotes(value_); - if (key === "PATH") { - value - .replaceAll("${PATH:+:$PATH}", "") - .replaceAll("$PATH", "") - .replaceAll("${PATH}", "") - .split(":").forEach((path) => { - fs.appendFileSync(process.env["GITHUB_PATH"], `${path}\n`); - }); - } else { - let v = replaceEnvVars(value); - fs.appendFileSync(process.env["GITHUB_ENV"], `${key}=${v}\n`); - } - } - } -} - -async function install_pkgx() { - let strip = 3; - - async function get_url() { - if (platform_key().startsWith('windows')) { - // not yet versioned - strip = 0; - return 'https://pkgx.sh/Windows/x86_64.zip'; - } - - let url = `https://dist.pkgx.dev/pkgx.sh/${platform_key()}/versions.txt`; - - console.log(`fetching ${url}`); - - const rsp = await fetch(url); - const txt = await rsp.text(); - - const versions = txt.split('\n'); - const version = process.env.INPUT_VERSION - ? semver.maxSatisfying(versions, process.env.INPUT_VERSION) - : versions.slice(-1)[0]; - - if (!version) { - throw new Error(`no version found for ${process.env.INPUT_VERSION}`); - } - - console.log(`selected pkgx v${version}`); - - return `https://dist.pkgx.dev/pkgx.sh/${platform_key()}/v${version}.tar.gz`; - } - - console.log(`::group::installing ${path.join(dstdir, 'pkgx')}`); - - const url = await get_url(); - - console.log(`fetching ${url}`); - - if (!fs.existsSync(dstdir)) { - fs.mkdirSync(dstdir, {recursive: true}); - } - - await downloadAndExtract(url, dstdir, strip); - - console.log(`::endgroup::`); -} - -(async () => { - await install_pkgx(); - - if (process.env.INPUT_PKGX_DIR) { - fs.appendFileSync(process.env["GITHUB_ENV"], `PKGX_DIR=${process.env.INPUT_PKGX_DIR}\n`); - } - - if (process.env['INPUT_+']) { - console.log(`::group::installing pkgx input packages`); - let args = process.env['INPUT_+'].split(' '); - if (os.platform() == 'win32') { - // cmd.exe uses ^ as an escape character - args = args.map(x => x.replace('^', '^^')); - } - const cmd = `${path.join(dstdir, 'pkgx')} ${args.map(x => `+${x}`).join(' ')}`; - console.log(`running: \`${cmd}\``); - let env = undefined; - if (process.env.INPUT_PKGX_DIR) { - env = process.env - env['PKGX_DIR'] = process.env.INPUT_PKGX_DIR; - } - const output = execSync(cmd, {env}); - parse_pkgx_output(output.toString()); - console.log(`::endgroup::`); - } -})().catch(err => { - console.error(`::error::${err.message}`) - process.exit(1); -}); +var _=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var jn=_((Hx,fl)=>{var Mn=require("stream"),tg=require("util"),rg="function";function Ht(){if(!(this instanceof Ht))return new Ht;Mn.Duplex.call(this,{decodeStrings:!1,objectMode:!0}),this.buffer=Buffer.from("");let t=this;t.on("finish",function(){t.finished=!0,t.emit("chunk",!1)})}tg.inherits(Ht,Mn.Duplex);Ht.prototype._write=function(t,e,r){this.buffer=Buffer.concat([this.buffer,t]),this.cb=r,this.emit("chunk")};Ht.prototype.stream=function(t,e){let r=Mn.PassThrough(),i,n=this;function s(){if(typeof n.cb===rg){let a=n.cb;return n.cb=void 0,a()}}function o(){let a;if(n.buffer&&n.buffer.length){if(typeof t=="number")a=n.buffer.slice(0,t),n.buffer=n.buffer.slice(t),t-=a.length,i=i||!t;else{let u=n.buffer.indexOf(t);if(u!==-1)n.match=u,e&&(u=u+t.length),a=n.buffer.slice(0,u),n.buffer=n.buffer.slice(u),i=!0;else{let f=n.buffer.length-t.length;f<=0?s():(a=n.buffer.slice(0,f),n.buffer=n.buffer.slice(f))}}a&&r.write(a,function(){(n.buffer.length===0||t.length&&n.buffer.length<=t.length)&&s()})}if(i)n.removeListener("chunk",o),r.end();else if(n.finished){n.removeListener("chunk",o),n.emit("error",new Error("FILE_ENDED"));return}}return n.on("chunk",o),o(),r};Ht.prototype.pull=function(t,e){if(t===0)return Promise.resolve("");if(!isNaN(t)&&this.buffer.length>t){let a=this.buffer.slice(0,t);return this.buffer=this.buffer.slice(t),Promise.resolve(a)}let r=Buffer.from(""),i=this,n=new Mn.Transform;n._transform=function(a,u,f){r=Buffer.concat([r,a]),f()};let s,o;return new Promise(function(a,u){if(s=u,o=function(f){i.__emittedError=f,u(f)},i.finished)return u(new Error("FILE_ENDED"));i.once("error",o),i.stream(t,e).on("error",u).pipe(n).on("finish",function(){a(r)}).on("error",u)}).finally(function(){i.removeListener("error",s),i.removeListener("error",o)})};Ht.prototype._read=function(){};fl.exports=Ht});var pl=_((Gx,dl)=>{var hl=require("stream"),ig=require("util");function Ni(){if(!(this instanceof Ni))return new Ni;hl.Transform.call(this)}ig.inherits(Ni,hl.Transform);Ni.prototype._transform=function(t,e,r){r()};dl.exports=Ni});var Bn=_((Vx,ml)=>{var ng=require("stream");ml.exports=function(t){return new Promise(function(e,r){let i=[],n=ng.Transform().on("finish",function(){e(Buffer.concat(i))}).on("error",r);n._transform=function(s,o,a){i.push(s),a()},t.on("error",r).pipe(n)})}});var Di=_((Xx,_l)=>{var sg=function(t,e,r){let i;switch(r){case 1:i=t.readUInt8(e);break;case 2:i=t.readUInt16LE(e);break;case 4:i=t.readUInt32LE(e);break;case 8:i=Number(t.readBigUInt64LE(e));break;default:throw new Error("Unsupported UInt LE size!")}return i},og=function(t,e){let r={},i=0;for(let[n,s]of e)t.length>=i+s?r[n]=sg(t,i,s):r[n]=null,i+=s;return r};_l.exports={parse:og}});var $n=_((Kx,vl)=>{var yl=Di();vl.exports=function(t,e){let r;for(;!r&&t&&t.length;){let i=yl.parse(t,[["signature",2],["partSize",2]]);if(i.signature===1){let n=[];e.uncompressedSize===4294967295&&n.push(["uncompressedSize",8]),e.compressedSize===4294967295&&n.push(["compressedSize",8]),e.offsetToLocalFileHeader===4294967295&&n.push(["offsetToLocalFileHeader",8]),r=yl.parse(t.slice(4),n)}else t=t.slice(i.partSize+4)}return r=r||{},e.compressedSize===4294967295&&(e.compressedSize=r.compressedSize),e.uncompressedSize===4294967295&&(e.uncompressedSize=r.uncompressedSize),e.offsetToLocalFileHeader===4294967295&&(e.offsetToLocalFileHeader=r.offsetToLocalFileHeader),r}});var Un=_((Yx,gl)=>{gl.exports=function(e,r){let i=e&31,n=e>>5&15,s=(e>>9&127)+1980,o=r?(r&31)*2:0,a=r?r>>5&63:0,u=r?r>>11:0;return new Date(Date.UTC(s,n-1,i,u,a,o))}});var zn=_((Zx,Sl)=>{var ag=require("util"),ug=require("zlib"),ea=require("stream"),wl=jn(),cg=pl(),lg=Bn(),fg=$n(),hg=Un(),dg=ea.pipeline,Li=Di(),El=Buffer.alloc(4);El.writeUInt32LE(101010256,0);function ut(t){if(!(this instanceof ut))return new ut(t);let e=this;e._opts=t||{verbose:!1},wl.call(e,e._opts),e.on("finish",function(){e.emit("end"),e.emit("close")}),e._readRecord().catch(function(r){(!e.__emittedError||e.__emittedError!==r)&&e.emit("error",r)})}ag.inherits(ut,wl);ut.prototype._readRecord=function(){let t=this;return t.pull(4).then(function(e){if(e.length===0)return;let r=e.readUInt32LE(0);if(r===875721283)return t._readCrxHeader();if(r===67324752)return t._readFile();if(r===33639248)return t.reachedCD=!0,t._readCentralDirectoryFileHeader();if(r===101010256)return t._readEndOfCentralDirectoryRecord();if(t.reachedCD)return t.pull(El,!0).then(function(){return t._readEndOfCentralDirectoryRecord()});t.emit("error",new Error("invalid signature: 0x"+r.toString(16)))}).then(function(e){if(e)return t._readRecord()})};ut.prototype._readCrxHeader=function(){let t=this;return t.pull(12).then(function(e){return t.crxHeader=Li.parse(e,[["version",4],["pubKeyLength",4],["signatureLength",4]]),t.pull(t.crxHeader.pubKeyLength+t.crxHeader.signatureLength)}).then(function(e){return t.crxHeader.publicKey=e.slice(0,t.crxHeader.pubKeyLength),t.crxHeader.signature=e.slice(t.crxHeader.pubKeyLength),t.emit("crx-header",t.crxHeader),!0})};ut.prototype._readFile=function(){let t=this;return t.pull(26).then(function(e){let r=Li.parse(e,[["versionsNeededToExtract",2],["flags",2],["compressionMethod",2],["lastModifiedTime",2],["lastModifiedDate",2],["crc32",4],["compressedSize",4],["uncompressedSize",4],["fileNameLength",2],["extraFieldLength",2]]);return r.lastModifiedDateTime=hg(r.lastModifiedDate,r.lastModifiedTime),t.crxHeader&&(r.crxHeader=t.crxHeader),t.pull(r.fileNameLength).then(function(i){let n=i.toString("utf8"),s=ea.PassThrough(),o=!1;return s.autodrain=function(){o=!0;let a=s.pipe(cg());return a.promise=function(){return new Promise(function(u,f){a.on("finish",u),a.on("error",f)})},a},s.buffer=function(){return lg(s)},s.path=n,s.props={},s.props.path=n,s.props.pathBuffer=i,s.props.flags={isUnicode:(r.flags&2048)!=0},s.type=r.uncompressedSize===0&&/[/\\]$/.test(n)?"Directory":"File",t._opts.verbose&&(s.type==="Directory"?console.log(" creating:",n):s.type==="File"&&(r.compressionMethod===0?console.log(" extracting:",n):console.log(" inflating:",n))),t.pull(r.extraFieldLength).then(function(a){let u=fg(a,r);s.vars=r,s.extra=u,t._opts.forceStream?t.push(s):(t.emit("entry",s),(t._readableState.pipesCount||t._readableState.pipes&&t._readableState.pipes.length)&&t.push(s)),t._opts.verbose&&console.log({filename:n,vars:r,extra:u});let f=!(r.flags&8)||r.compressedSize>0,c;s.__autodraining=o;let h=r.compressionMethod&&!o?ug.createInflateRaw():ea.PassThrough();return f?(s.size=r.uncompressedSize,c=r.compressedSize):(c=Buffer.alloc(4),c.writeUInt32LE(134695760,0)),new Promise(function(p,l){dg(t.stream(c),h,s,function(d){return d?l(d):f?p(f):t._processDataDescriptor(s).then(p).catch(l)})})})})})};ut.prototype._processDataDescriptor=function(t){return this.pull(16).then(function(r){let i=Li.parse(r,[["dataDescriptorSignature",4],["crc32",4],["compressedSize",4],["uncompressedSize",4]]);return t.size=i.uncompressedSize,!0})};ut.prototype._readCentralDirectoryFileHeader=function(){let t=this;return t.pull(42).then(function(e){let r=Li.parse(e,[["versionMadeBy",2],["versionsNeededToExtract",2],["flags",2],["compressionMethod",2],["lastModifiedTime",2],["lastModifiedDate",2],["crc32",4],["compressedSize",4],["uncompressedSize",4],["fileNameLength",2],["extraFieldLength",2],["fileCommentLength",2],["diskNumber",2],["internalFileAttributes",2],["externalFileAttributes",4],["offsetToLocalFileHeader",4]]);return t.pull(r.fileNameLength).then(function(i){return r.fileName=i.toString("utf8"),t.pull(r.extraFieldLength)}).then(function(){return t.pull(r.fileCommentLength)}).then(function(){return!0})})};ut.prototype._readEndOfCentralDirectoryRecord=function(){let t=this;return t.pull(18).then(function(e){let r=Li.parse(e,[["diskNumber",2],["diskStart",2],["numberOfRecordsOnDisk",2],["numberOfRecords",2],["sizeOfCentralDirectory",4],["offsetToStartOfCentralDirectory",4],["commentLength",2]]);return t.pull(r.commentLength).then(function(){t.end(),t.push(null)})})};ut.prototype.promise=function(){let t=this;return new Promise(function(e,r){t.on("finish",e),t.on("error",r)})};Sl.exports=ut});var Ii=_((Qx,ta)=>{"use strict";typeof process>"u"||!process.version||process.version.indexOf("v0.")===0||process.version.indexOf("v1.")===0&&process.version.indexOf("v1.8.")!==0?ta.exports={nextTick:pg}:ta.exports=process;function pg(t,e,r,i){if(typeof t!="function")throw new TypeError('"callback" argument must be a function');var n=arguments.length,s,o;switch(n){case 0:case 1:return process.nextTick(t);case 2:return process.nextTick(function(){t.call(null,e)});case 3:return process.nextTick(function(){t.call(null,e,r)});case 4:return process.nextTick(function(){t.call(null,e,r,i)});default:for(s=new Array(n-1),o=0;o{var mg={}.toString;bl.exports=Array.isArray||function(t){return mg.call(t)=="[object Array]"}});var ra=_((ek,Ol)=>{Ol.exports=require("stream")});var qi=_((ia,Cl)=>{var Wn=require("buffer"),At=Wn.Buffer;function Tl(t,e){for(var r in t)e[r]=t[r]}At.from&&At.alloc&&At.allocUnsafe&&At.allocUnsafeSlow?Cl.exports=Wn:(Tl(Wn,ia),ia.Buffer=$r);function $r(t,e,r){return At(t,e,r)}Tl(At,$r);$r.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return At(t,e,r)};$r.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var i=At(t);return e!==void 0?typeof r=="string"?i.fill(e,r):i.fill(e):i.fill(0),i};$r.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return At(t)};$r.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Wn.SlowBuffer(t)}});var Ur=_(ke=>{function _g(t){return Array.isArray?Array.isArray(t):Hn(t)==="[object Array]"}ke.isArray=_g;function yg(t){return typeof t=="boolean"}ke.isBoolean=yg;function vg(t){return t===null}ke.isNull=vg;function gg(t){return t==null}ke.isNullOrUndefined=gg;function wg(t){return typeof t=="number"}ke.isNumber=wg;function Eg(t){return typeof t=="string"}ke.isString=Eg;function Sg(t){return typeof t=="symbol"}ke.isSymbol=Sg;function bg(t){return t===void 0}ke.isUndefined=bg;function Rg(t){return Hn(t)==="[object RegExp]"}ke.isRegExp=Rg;function Og(t){return typeof t=="object"&&t!==null}ke.isObject=Og;function Tg(t){return Hn(t)==="[object Date]"}ke.isDate=Tg;function Cg(t){return Hn(t)==="[object Error]"||t instanceof Error}ke.isError=Cg;function xg(t){return typeof t=="function"}ke.isFunction=xg;function kg(t){return t===null||typeof t=="boolean"||typeof t=="number"||typeof t=="string"||typeof t=="symbol"||typeof t>"u"}ke.isPrimitive=kg;ke.isBuffer=require("buffer").Buffer.isBuffer;function Hn(t){return Object.prototype.toString.call(t)}});var xl=_((rk,na)=>{typeof Object.create=="function"?na.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:na.exports=function(e,r){if(r){e.super_=r;var i=function(){};i.prototype=r.prototype,e.prototype=new i,e.prototype.constructor=e}}});var zr=_((ik,oa)=>{try{if(sa=require("util"),typeof sa.inherits!="function")throw"";oa.exports=sa.inherits}catch{oa.exports=xl()}var sa});var Fl=_((nk,aa)=>{"use strict";function Fg(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var kl=qi().Buffer,Pi=require("util");function Ag(t,e,r){t.copy(e,r)}aa.exports=function(){function t(){Fg(this,t),this.head=null,this.tail=null,this.length=0}return t.prototype.push=function(r){var i={data:r,next:null};this.length>0?this.tail.next=i:this.head=i,this.tail=i,++this.length},t.prototype.unshift=function(r){var i={data:r,next:this.head};this.length===0&&(this.tail=i),this.head=i,++this.length},t.prototype.shift=function(){if(this.length!==0){var r=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,r}},t.prototype.clear=function(){this.head=this.tail=null,this.length=0},t.prototype.join=function(r){if(this.length===0)return"";for(var i=this.head,n=""+i.data;i=i.next;)n+=r+i.data;return n},t.prototype.concat=function(r){if(this.length===0)return kl.alloc(0);for(var i=kl.allocUnsafe(r>>>0),n=this.head,s=0;n;)Ag(n.data,i,s),s+=n.data.length,n=n.next;return i},t}();Pi&&Pi.inspect&&Pi.inspect.custom&&(aa.exports.prototype[Pi.inspect.custom]=function(){var t=Pi.inspect({length:this.length});return this.constructor.name+" "+t})});var ua=_((sk,Al)=>{"use strict";var Gn=Ii();function Ng(t,e){var r=this,i=this._readableState&&this._readableState.destroyed,n=this._writableState&&this._writableState.destroyed;return i||n?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,Gn.nextTick(Vn,this,t)):Gn.nextTick(Vn,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(s){!e&&s?r._writableState?r._writableState.errorEmitted||(r._writableState.errorEmitted=!0,Gn.nextTick(Vn,r,s)):Gn.nextTick(Vn,r,s):e&&e(s)}),this)}function Dg(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function Vn(t,e){t.emit("error",e)}Al.exports={destroy:Ng,undestroy:Dg}});var Dl=_((ok,Nl)=>{Nl.exports=require("util").deprecate});var la=_((ak,$l)=>{"use strict";var yr=Ii();$l.exports=ge;function Il(t){var e=this;this.next=null,this.entry=null,this.finish=function(){Zg(e,t)}}var Lg=!process.browser&&["v0.10","v0.9."].indexOf(process.version.slice(0,5))>-1?setImmediate:yr.nextTick,Wr;ge.WritableState=ji;var ql=Object.create(Ur());ql.inherits=zr();var Ig={deprecate:Dl()},Pl=ra(),Kn=qi().Buffer,qg=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function Pg(t){return Kn.from(t)}function Mg(t){return Kn.isBuffer(t)||t instanceof qg}var Ml=ua();ql.inherits(ge,Pl);function jg(){}function ji(t,e){Wr=Wr||vr(),t=t||{};var r=e instanceof Wr;this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var i=t.highWaterMark,n=t.writableHighWaterMark,s=this.objectMode?16:16*1024;i||i===0?this.highWaterMark=i:r&&(n||n===0)?this.highWaterMark=n:this.highWaterMark=s,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var o=t.decodeStrings===!1;this.decodeStrings=!o,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(a){Gg(e,a)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new Il(this)}ji.prototype.getBuffer=function(){for(var e=this.bufferedRequest,r=[];e;)r.push(e),e=e.next;return r};(function(){try{Object.defineProperty(ji.prototype,"buffer",{get:Ig.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var Xn;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(Xn=Function.prototype[Symbol.hasInstance],Object.defineProperty(ge,Symbol.hasInstance,{value:function(t){return Xn.call(this,t)?!0:this!==ge?!1:t&&t._writableState instanceof ji}})):Xn=function(t){return t instanceof this};function ge(t){if(Wr=Wr||vr(),!Xn.call(ge,this)&&!(this instanceof Wr))return new ge(t);this._writableState=new ji(t,this),this.writable=!0,t&&(typeof t.write=="function"&&(this._write=t.write),typeof t.writev=="function"&&(this._writev=t.writev),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.final=="function"&&(this._final=t.final)),Pl.call(this)}ge.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function Bg(t,e){var r=new Error("write after end");t.emit("error",r),yr.nextTick(e,r)}function $g(t,e,r,i){var n=!0,s=!1;return r===null?s=new TypeError("May not write null values to stream"):typeof r!="string"&&r!==void 0&&!e.objectMode&&(s=new TypeError("Invalid non-string/buffer chunk")),s&&(t.emit("error",s),yr.nextTick(i,s),n=!1),n}ge.prototype.write=function(t,e,r){var i=this._writableState,n=!1,s=!i.objectMode&&Mg(t);return s&&!Kn.isBuffer(t)&&(t=Pg(t)),typeof e=="function"&&(r=e,e=null),s?e="buffer":e||(e=i.defaultEncoding),typeof r!="function"&&(r=jg),i.ended?Bg(this,r):(s||$g(this,i,t,r))&&(i.pendingcb++,n=zg(this,i,s,t,e,r)),n};ge.prototype.cork=function(){var t=this._writableState;t.corked++};ge.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,!t.writing&&!t.corked&&!t.bufferProcessing&&t.bufferedRequest&&jl(this,t))};ge.prototype.setDefaultEncoding=function(e){if(typeof e=="string"&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this};function Ug(t,e,r){return!t.objectMode&&t.decodeStrings!==!1&&typeof e=="string"&&(e=Kn.from(e,r)),e}Object.defineProperty(ge.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function zg(t,e,r,i,n,s){if(!r){var o=Ug(e,i,n);i!==o&&(r=!0,n="buffer",i=o)}var a=e.objectMode?1:i.length;e.length+=a;var u=e.length{"use strict";var Ul=Ii(),Qg=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};Hl.exports=Nt;var zl=Object.create(Ur());zl.inherits=zr();var Wl=da(),ha=la();zl.inherits(Nt,Wl);for(fa=Qg(ha.prototype),Yn=0;Yn{"use strict";var ma=qi().Buffer,Gl=ma.isEncoding||function(t){switch(t=""+t,t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function tw(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}function rw(t){var e=tw(t);if(typeof e!="string"&&(ma.isEncoding===Gl||!Gl(t)))throw new Error("Unknown encoding: "+t);return e||t}Vl.StringDecoder=Bi;function Bi(t){this.encoding=rw(t);var e;switch(this.encoding){case"utf16le":this.text=uw,this.end=cw,e=4;break;case"utf8":this.fillLast=sw,e=4;break;case"base64":this.text=lw,this.end=fw,e=3;break;default:this.write=hw,this.end=dw;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=ma.allocUnsafe(e)}Bi.prototype.write=function(t){if(t.length===0)return"";var e,r;if(this.lastNeed){if(e=this.fillLast(t),e===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}function iw(t,e,r){var i=e.length-1;if(i=0?(n>0&&(t.lastNeed=n-1),n):--i=0?(n>0&&(t.lastNeed=n-2),n):--i=0?(n>0&&(n===2?n=0:t.lastNeed=n-3),n):0))}function nw(t,e,r){if((e[0]&192)!==128)return t.lastNeed=0,"\uFFFD";if(t.lastNeed>1&&e.length>1){if((e[1]&192)!==128)return t.lastNeed=1,"\uFFFD";if(t.lastNeed>2&&e.length>2&&(e[2]&192)!==128)return t.lastNeed=2,"\uFFFD"}}function sw(t){var e=this.lastTotal-this.lastNeed,r=nw(this,t,e);if(r!==void 0)return r;if(this.lastNeed<=t.length)return t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,e,0,t.length),this.lastNeed-=t.length}function ow(t,e){var r=iw(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var i=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,i),t.toString("utf8",e,i)}function aw(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\uFFFD":e}function uw(t,e){if((t.length-e)%2===0){var r=t.toString("utf16le",e);if(r){var i=r.charCodeAt(r.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function cw(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function lw(t,e){var r=(t.length-e)%3;return r===0?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function fw(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function hw(t){return t.toString(this.encoding)}function dw(t){return t&&t.length?this.write(t):""}});var da=_((fk,of)=>{"use strict";var Gr=Ii();of.exports=le;var pw=Rl(),$i;le.ReadableState=ef;var lk=require("events").EventEmitter,Zl=function(t,e){return t.listeners(e).length},Ea=ra(),Ui=qi().Buffer,mw=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function _w(t){return Ui.from(t)}function yw(t){return Ui.isBuffer(t)||t instanceof mw}var Ql=Object.create(Ur());Ql.inherits=zr();var ya=require("util"),ee=void 0;ya&&ya.debuglog?ee=ya.debuglog("stream"):ee=function(){};var vw=Fl(),Jl=ua(),Hr;Ql.inherits(le,Ea);var va=["error","close","destroy","pause","resume"];function gw(t,e,r){if(typeof t.prependListener=="function")return t.prependListener(e,r);!t._events||!t._events[e]?t.on(e,r):pw(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]}function ef(t,e){$i=$i||vr(),t=t||{};var r=e instanceof $i;this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.readableObjectMode);var i=t.highWaterMark,n=t.readableHighWaterMark,s=this.objectMode?16:16*1024;i||i===0?this.highWaterMark=i:r&&(n||n===0)?this.highWaterMark=n:this.highWaterMark=s,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new vw,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(Hr||(Hr=_a().StringDecoder),this.decoder=new Hr(t.encoding),this.encoding=t.encoding)}function le(t){if($i=$i||vr(),!(this instanceof le))return new le(t);this._readableState=new ef(t,this),this.readable=!0,t&&(typeof t.read=="function"&&(this._read=t.read),typeof t.destroy=="function"&&(this._destroy=t.destroy)),Ea.call(this)}Object.defineProperty(le.prototype,"destroyed",{get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}});le.prototype.destroy=Jl.destroy;le.prototype._undestroy=Jl.undestroy;le.prototype._destroy=function(t,e){this.push(null),e(t)};le.prototype.push=function(t,e){var r=this._readableState,i;return r.objectMode?i=!0:typeof t=="string"&&(e=e||r.defaultEncoding,e!==r.encoding&&(t=Ui.from(t,e),e=""),i=!0),tf(this,t,e,!1,i)};le.prototype.unshift=function(t){return tf(this,t,null,!0,!1)};function tf(t,e,r,i,n){var s=t._readableState;if(e===null)s.reading=!1,bw(t,s);else{var o;n||(o=ww(s,e)),o?t.emit("error",o):s.objectMode||e&&e.length>0?(typeof e!="string"&&!s.objectMode&&Object.getPrototypeOf(e)!==Ui.prototype&&(e=_w(e)),i?s.endEmitted?t.emit("error",new Error("stream.unshift() after end event")):ga(t,s,e,!0):s.ended?t.emit("error",new Error("stream.push() after EOF")):(s.reading=!1,s.decoder&&!r?(e=s.decoder.write(e),s.objectMode||e.length!==0?ga(t,s,e,!1):rf(t,s)):ga(t,s,e,!1))):i||(s.reading=!1)}return Ew(s)}function ga(t,e,r,i){e.flowing&&e.length===0&&!e.sync?(t.emit("data",r),t.read(0)):(e.length+=e.objectMode?1:r.length,i?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&Qn(t)),rf(t,e)}function ww(t,e){var r;return!yw(e)&&typeof e!="string"&&e!==void 0&&!t.objectMode&&(r=new TypeError("Invalid non-string/buffer chunk")),r}function Ew(t){return!t.ended&&(t.needReadable||t.length=Xl?t=Xl:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}function Kl(t,e){return t<=0||e.length===0&&e.ended?0:e.objectMode?1:t!==t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=Sw(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}le.prototype.read=function(t){ee("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(t!==0&&(e.emittedReadable=!1),t===0&&e.needReadable&&(e.length>=e.highWaterMark||e.ended))return ee("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?wa(this):Qn(this),null;if(t=Kl(t,e),t===0&&e.ended)return e.length===0&&wa(this),null;var i=e.needReadable;ee("need readable",i),(e.length===0||e.length-t0?n=nf(t,e):n=null,n===null?(e.needReadable=!0,t=0):e.length-=t,e.length===0&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&wa(this)),n!==null&&this.emit("data",n),n};function bw(t,e){if(!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,Qn(t)}}function Qn(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(ee("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?Gr.nextTick(Yl,t):Yl(t))}function Yl(t){ee("emit readable"),t.emit("readable"),Sa(t)}function rf(t,e){e.readingMore||(e.readingMore=!0,Gr.nextTick(Rw,t,e))}function Rw(t,e){for(var r=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length1&&sf(i.pipes,t)!==-1)&&!f&&(ee("false write response, pause",i.awaitDrain),i.awaitDrain++,h=!0),r.pause())}function l(w){ee("onerror",w),y(),t.removeListener("error",l),Zl(t,"error")===0&&t.emit("error",w)}gw(t,"error",l);function d(){t.removeListener("finish",m),y()}t.once("close",d);function m(){ee("onfinish"),t.removeListener("close",d),y()}t.once("finish",m);function y(){ee("unpipe"),r.unpipe(t)}return t.emit("pipe",r),i.flowing||(ee("pipe resume"),r.resume()),t};function Ow(t){return function(){var e=t._readableState;ee("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,e.awaitDrain===0&&Zl(t,"data")&&(e.flowing=!0,Sa(t))}}le.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(e.pipesCount===0)return this;if(e.pipesCount===1)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r),this);if(!t){var i=e.pipes,n=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var s=0;s=e.length?(e.decoder?r=e.buffer.join(""):e.buffer.length===1?r=e.buffer.head.data:r=e.buffer.concat(e.length),e.buffer.clear()):r=kw(t,e.buffer,e.decoder),r}function kw(t,e,r){var i;return ts.length?s.length:t;if(o===s.length?n+=s:n+=s.slice(0,t),t-=o,t===0){o===s.length?(++i,r.next?e.head=r.next:e.head=e.tail=null):(e.head=r,r.data=s.slice(o));break}++i}return e.length-=i,n}function Aw(t,e){var r=Ui.allocUnsafe(t),i=e.head,n=1;for(i.data.copy(r),t-=i.data.length;i=i.next;){var s=i.data,o=t>s.length?s.length:t;if(s.copy(r,r.length-t,0,o),t-=o,t===0){o===s.length?(++n,i.next?e.head=i.next:e.head=e.tail=null):(e.head=i,i.data=s.slice(o));break}++n}return e.length-=n,r}function wa(t){var e=t._readableState;if(e.length>0)throw new Error('"endReadable()" called on non-empty stream');e.endEmitted||(e.ended=!0,Gr.nextTick(Nw,e,t))}function Nw(t,e){!t.endEmitted&&t.length===0&&(t.endEmitted=!0,e.readable=!1,e.emit("end"))}function sf(t,e){for(var r=0,i=t.length;r{"use strict";cf.exports=Dt;var Jn=vr(),uf=Object.create(Ur());uf.inherits=zr();uf.inherits(Dt,Jn);function Dw(t,e){var r=this._transformState;r.transforming=!1;var i=r.writecb;if(!i)return this.emit("error",new Error("write callback called multiple times"));r.writechunk=null,r.writecb=null,e!=null&&this.push(e),i(t);var n=this._readableState;n.reading=!1,(n.needReadable||n.length{"use strict";hf.exports=zi;var lf=ba(),ff=Object.create(Ur());ff.inherits=zr();ff.inherits(zi,lf);function zi(t){if(!(this instanceof zi))return new zi(t);lf.call(this,t)}zi.prototype._transform=function(t,e,r){r(null,t)}});var Ra=_((Ce,es)=>{var yt=require("stream");process.env.READABLE_STREAM==="disable"&&yt?(es.exports=yt,Ce=es.exports=yt.Readable,Ce.Readable=yt.Readable,Ce.Writable=yt.Writable,Ce.Duplex=yt.Duplex,Ce.Transform=yt.Transform,Ce.PassThrough=yt.PassThrough,Ce.Stream=yt):(Ce=es.exports=da(),Ce.Stream=yt||Ce,Ce.Readable=Ce,Ce.Writable=la(),Ce.Duplex=vr(),Ce.Transform=ba(),Ce.PassThrough=df())});var Ca=_((pk,Ta)=>{"use strict";var Oa=Ra();function Vr(t,e,r){typeof r>"u"&&(r=e,e=t,t=null),Oa.Duplex.call(this,t),typeof r.read!="function"&&(r=new Oa.Readable(t).wrap(r)),this._writable=e,this._readable=r,this._waiting=!1;var i=this;e.once("finish",function(){i.end()}),this.once("finish",function(){e.end()}),r.on("readable",function(){i._waiting&&(i._waiting=!1,i._read())}),r.once("end",function(){i.push(null)}),(!t||typeof t.bubbleErrors>"u"||t.bubbleErrors)&&(e.on("error",function(n){i.emit("error",n)}),r.on("error",function(n){i.emit("error",n)}))}Vr.prototype=Object.create(Oa.Duplex.prototype,{constructor:{value:Vr}});Vr.prototype._write=function(e,r,i){this._writable.write(e,r,i)};Vr.prototype._read=function(){for(var e,r=0;(e=this._readable.read())!==null;)this.push(e),r++;r===0&&(this._waiting=!0)};Ta.exports=function(e,r,i){return new Vr(e,r,i)};Ta.exports.DuplexWrapper=Vr});var mf=_((mk,pf)=>{var xa=require("stream"),Iw=zn(),qw=Ca(),Pw=Bn();function Mw(t,e){let r=xa.PassThrough({objectMode:!0}),i=xa.PassThrough(),n=xa.Transform({objectMode:!0}),s=t instanceof RegExp?t:t&&new RegExp(t),o;n._transform=function(u,f,c){if(o||s&&!s.exec(u.path))return u.autodrain(),c();o=!0,a.emit("entry",u),u.on("error",function(h){i.emit("error",h)}),u.pipe(i).on("error",function(h){c(h)}).on("finish",function(h){c(null,h)})},r.pipe(Iw(e)).on("error",function(u){i.emit("error",u)}).pipe(n).on("error",Object).on("finish",function(){o?i.end():i.emit("error",new Error("PATTERN_NOT_FOUND"))});let a=qw(r,i);return a.buffer=function(){return Pw(i)},a}pf.exports=Mw});var Se=_(ka=>{"use strict";ka.fromCallback=function(t){return Object.defineProperty(function(...e){if(typeof e[e.length-1]=="function")t.apply(this,e);else return new Promise((r,i)=>{e.push((n,s)=>n!=null?i(n):r(s)),t.apply(this,e)})},"name",{value:t.name})};ka.fromPromise=function(t){return Object.defineProperty(function(...e){let r=e[e.length-1];if(typeof r!="function")return t.apply(this,e);e.pop(),t.apply(this,e).then(i=>r(null,i),r)},"name",{value:t.name})}});var yf=_((yk,_f)=>{var Gt=require("constants"),jw=process.cwd,ts=null,Bw=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return ts||(ts=jw.call(process)),ts};try{process.cwd()}catch{}typeof process.chdir=="function"&&(Fa=process.chdir,process.chdir=function(t){ts=null,Fa.call(process,t)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,Fa));var Fa;_f.exports=$w;function $w(t){Gt.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&e(t),t.lutimes||r(t),t.chown=s(t.chown),t.fchown=s(t.fchown),t.lchown=s(t.lchown),t.chmod=i(t.chmod),t.fchmod=i(t.fchmod),t.lchmod=i(t.lchmod),t.chownSync=o(t.chownSync),t.fchownSync=o(t.fchownSync),t.lchownSync=o(t.lchownSync),t.chmodSync=n(t.chmodSync),t.fchmodSync=n(t.fchmodSync),t.lchmodSync=n(t.lchmodSync),t.stat=a(t.stat),t.fstat=a(t.fstat),t.lstat=a(t.lstat),t.statSync=u(t.statSync),t.fstatSync=u(t.fstatSync),t.lstatSync=u(t.lstatSync),t.chmod&&!t.lchmod&&(t.lchmod=function(c,h,p){p&&process.nextTick(p)},t.lchmodSync=function(){}),t.chown&&!t.lchown&&(t.lchown=function(c,h,p,l){l&&process.nextTick(l)},t.lchownSync=function(){}),Bw==="win32"&&(t.rename=typeof t.rename!="function"?t.rename:function(c){function h(p,l,d){var m=Date.now(),y=0;c(p,l,function w(x){if(x&&(x.code==="EACCES"||x.code==="EPERM"||x.code==="EBUSY")&&Date.now()-m<6e4){setTimeout(function(){t.stat(l,function(C,F){C&&C.code==="ENOENT"?c(p,l,w):d(x)})},y),y<100&&(y+=10);return}d&&d(x)})}return Object.setPrototypeOf&&Object.setPrototypeOf(h,c),h}(t.rename)),t.read=typeof t.read!="function"?t.read:function(c){function h(p,l,d,m,y,w){var x;if(w&&typeof w=="function"){var C=0;x=function(F,W,re){if(F&&F.code==="EAGAIN"&&C<10)return C++,c.call(t,p,l,d,m,y,x);w.apply(this,arguments)}}return c.call(t,p,l,d,m,y,x)}return Object.setPrototypeOf&&Object.setPrototypeOf(h,c),h}(t.read),t.readSync=typeof t.readSync!="function"?t.readSync:function(c){return function(h,p,l,d,m){for(var y=0;;)try{return c.call(t,h,p,l,d,m)}catch(w){if(w.code==="EAGAIN"&&y<10){y++;continue}throw w}}}(t.readSync);function e(c){c.lchmod=function(h,p,l){c.open(h,Gt.O_WRONLY|Gt.O_SYMLINK,p,function(d,m){if(d){l&&l(d);return}c.fchmod(m,p,function(y){c.close(m,function(w){l&&l(y||w)})})})},c.lchmodSync=function(h,p){var l=c.openSync(h,Gt.O_WRONLY|Gt.O_SYMLINK,p),d=!0,m;try{m=c.fchmodSync(l,p),d=!1}finally{if(d)try{c.closeSync(l)}catch{}else c.closeSync(l)}return m}}function r(c){Gt.hasOwnProperty("O_SYMLINK")&&c.futimes?(c.lutimes=function(h,p,l,d){c.open(h,Gt.O_SYMLINK,function(m,y){if(m){d&&d(m);return}c.futimes(y,p,l,function(w){c.close(y,function(x){d&&d(w||x)})})})},c.lutimesSync=function(h,p,l){var d=c.openSync(h,Gt.O_SYMLINK),m,y=!0;try{m=c.futimesSync(d,p,l),y=!1}finally{if(y)try{c.closeSync(d)}catch{}else c.closeSync(d)}return m}):c.futimes&&(c.lutimes=function(h,p,l,d){d&&process.nextTick(d)},c.lutimesSync=function(){})}function i(c){return c&&function(h,p,l){return c.call(t,h,p,function(d){f(d)&&(d=null),l&&l.apply(this,arguments)})}}function n(c){return c&&function(h,p){try{return c.call(t,h,p)}catch(l){if(!f(l))throw l}}}function s(c){return c&&function(h,p,l,d){return c.call(t,h,p,l,function(m){f(m)&&(m=null),d&&d.apply(this,arguments)})}}function o(c){return c&&function(h,p,l){try{return c.call(t,h,p,l)}catch(d){if(!f(d))throw d}}}function a(c){return c&&function(h,p,l){typeof p=="function"&&(l=p,p=null);function d(m,y){y&&(y.uid<0&&(y.uid+=4294967296),y.gid<0&&(y.gid+=4294967296)),l&&l.apply(this,arguments)}return p?c.call(t,h,p,d):c.call(t,h,d)}}function u(c){return c&&function(h,p){var l=p?c.call(t,h,p):c.call(t,h);return l&&(l.uid<0&&(l.uid+=4294967296),l.gid<0&&(l.gid+=4294967296)),l}}function f(c){if(!c||c.code==="ENOSYS")return!0;var h=!process.getuid||process.getuid()!==0;return!!(h&&(c.code==="EINVAL"||c.code==="EPERM"))}}});var wf=_((vk,gf)=>{var vf=require("stream").Stream;gf.exports=Uw;function Uw(t){return{ReadStream:e,WriteStream:r};function e(i,n){if(!(this instanceof e))return new e(i,n);vf.call(this);var s=this;this.path=i,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,n=n||{};for(var o=Object.keys(n),a=0,u=o.length;athis.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){s._read()});return}t.open(this.path,this.flags,this.mode,function(c,h){if(c){s.emit("error",c),s.readable=!1;return}s.fd=h,s.emit("open",h),s._read()})}function r(i,n){if(!(this instanceof r))return new r(i,n);vf.call(this),this.path=i,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,n=n||{};for(var s=Object.keys(n),o=0,a=s.length;o= zero");this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=t.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}});var Sf=_((gk,Ef)=>{"use strict";Ef.exports=Ww;var zw=Object.getPrototypeOf||function(t){return t.__proto__};function Ww(t){if(t===null||typeof t!="object")return t;if(t instanceof Object)var e={__proto__:zw(t)};else var e=Object.create(null);return Object.getOwnPropertyNames(t).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}});var wr=_((wk,Da)=>{var me=require("fs"),Hw=yf(),Gw=wf(),Vw=Sf(),rs=require("util"),xe,ns;typeof Symbol=="function"&&typeof Symbol.for=="function"?(xe=Symbol.for("graceful-fs.queue"),ns=Symbol.for("graceful-fs.previous")):(xe="___graceful-fs.queue",ns="___graceful-fs.previous");function Xw(){}function Of(t,e){Object.defineProperty(t,xe,{get:function(){return e}})}var gr=Xw;rs.debuglog?gr=rs.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(gr=function(){var t=rs.format.apply(rs,arguments);t="GFS4: "+t.split(/\n/).join(` +GFS4: `),console.error(t)});me[xe]||(bf=global[xe]||[],Of(me,bf),me.close=function(t){function e(r,i){return t.call(me,r,function(n){n||Rf(),typeof i=="function"&&i.apply(this,arguments)})}return Object.defineProperty(e,ns,{value:t}),e}(me.close),me.closeSync=function(t){function e(r){t.apply(me,arguments),Rf()}return Object.defineProperty(e,ns,{value:t}),e}(me.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){gr(me[xe]),require("assert").equal(me[xe].length,0)}));var bf;global[xe]||Of(global,me[xe]);Da.exports=Aa(Vw(me));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!me.__patched&&(Da.exports=Aa(me),me.__patched=!0);function Aa(t){Hw(t),t.gracefulify=Aa,t.createReadStream=W,t.createWriteStream=re;var e=t.readFile;t.readFile=r;function r(A,G,P){return typeof G=="function"&&(P=G,G=null),J(A,G,P);function J(b,D,j,L){return e(b,D,function(M){M&&(M.code==="EMFILE"||M.code==="ENFILE")?Xr([J,[b,D,j],M,L||Date.now(),Date.now()]):typeof j=="function"&&j.apply(this,arguments)})}}var i=t.writeFile;t.writeFile=n;function n(A,G,P,J){return typeof P=="function"&&(J=P,P=null),b(A,G,P,J);function b(D,j,L,M,K){return i(D,j,L,function(g){g&&(g.code==="EMFILE"||g.code==="ENFILE")?Xr([b,[D,j,L,M],g,K||Date.now(),Date.now()]):typeof M=="function"&&M.apply(this,arguments)})}}var s=t.appendFile;s&&(t.appendFile=o);function o(A,G,P,J){return typeof P=="function"&&(J=P,P=null),b(A,G,P,J);function b(D,j,L,M,K){return s(D,j,L,function(g){g&&(g.code==="EMFILE"||g.code==="ENFILE")?Xr([b,[D,j,L,M],g,K||Date.now(),Date.now()]):typeof M=="function"&&M.apply(this,arguments)})}}var a=t.copyFile;a&&(t.copyFile=u);function u(A,G,P,J){return typeof P=="function"&&(J=P,P=0),b(A,G,P,J);function b(D,j,L,M,K){return a(D,j,L,function(g){g&&(g.code==="EMFILE"||g.code==="ENFILE")?Xr([b,[D,j,L,M],g,K||Date.now(),Date.now()]):typeof M=="function"&&M.apply(this,arguments)})}}var f=t.readdir;t.readdir=h;var c=/^v[0-5]\./;function h(A,G,P){typeof G=="function"&&(P=G,G=null);var J=c.test(process.version)?function(j,L,M,K){return f(j,b(j,L,M,K))}:function(j,L,M,K){return f(j,L,b(j,L,M,K))};return J(A,G,P);function b(D,j,L,M){return function(K,g){K&&(K.code==="EMFILE"||K.code==="ENFILE")?Xr([J,[D,j,L],K,M||Date.now(),Date.now()]):(g&&g.sort&&g.sort(),typeof L=="function"&&L.call(this,K,g))}}}if(process.version.substr(0,4)==="v0.8"){var p=Gw(t);w=p.ReadStream,C=p.WriteStream}var l=t.ReadStream;l&&(w.prototype=Object.create(l.prototype),w.prototype.open=x);var d=t.WriteStream;d&&(C.prototype=Object.create(d.prototype),C.prototype.open=F),Object.defineProperty(t,"ReadStream",{get:function(){return w},set:function(A){w=A},enumerable:!0,configurable:!0}),Object.defineProperty(t,"WriteStream",{get:function(){return C},set:function(A){C=A},enumerable:!0,configurable:!0});var m=w;Object.defineProperty(t,"FileReadStream",{get:function(){return m},set:function(A){m=A},enumerable:!0,configurable:!0});var y=C;Object.defineProperty(t,"FileWriteStream",{get:function(){return y},set:function(A){y=A},enumerable:!0,configurable:!0});function w(A,G){return this instanceof w?(l.apply(this,arguments),this):w.apply(Object.create(w.prototype),arguments)}function x(){var A=this;H(A.path,A.flags,A.mode,function(G,P){G?(A.autoClose&&A.destroy(),A.emit("error",G)):(A.fd=P,A.emit("open",P),A.read())})}function C(A,G){return this instanceof C?(d.apply(this,arguments),this):C.apply(Object.create(C.prototype),arguments)}function F(){var A=this;H(A.path,A.flags,A.mode,function(G,P){G?(A.destroy(),A.emit("error",G)):(A.fd=P,A.emit("open",P))})}function W(A,G){return new t.ReadStream(A,G)}function re(A,G){return new t.WriteStream(A,G)}var U=t.open;t.open=H;function H(A,G,P,J){return typeof P=="function"&&(J=P,P=null),b(A,G,P,J);function b(D,j,L,M,K){return U(D,j,L,function(g,se){g&&(g.code==="EMFILE"||g.code==="ENFILE")?Xr([b,[D,j,L,M],g,K||Date.now(),Date.now()]):typeof M=="function"&&M.apply(this,arguments)})}}return t}function Xr(t){gr("ENQUEUE",t[0].name,t[1]),me[xe].push(t),Na()}var is;function Rf(){for(var t=Date.now(),e=0;e2&&(me[xe][e][3]=t,me[xe][e][4]=t);Na()}function Na(){if(clearTimeout(is),is=void 0,me[xe].length!==0){var t=me[xe].shift(),e=t[0],r=t[1],i=t[2],n=t[3],s=t[4];if(n===void 0)gr("RETRY",e.name,r),e.apply(null,r);else if(Date.now()-n>=6e4){gr("TIMEOUT",e.name,r);var o=r.pop();typeof o=="function"&&o.call(null,i)}else{var a=Date.now()-s,u=Math.max(s-n,1),f=Math.min(u*1.2,100);a>=f?(gr("RETRY",e.name,r),e.apply(null,r.concat([n]))):me[xe].push(t)}is===void 0&&(is=setTimeout(Na,0))}}});var Me=_(Lt=>{"use strict";var Tf=Se().fromCallback,Pe=wr(),Kw=["access","appendFile","chmod","chown","close","copyFile","cp","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","glob","lchmod","lchown","lutimes","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","statfs","symlink","truncate","unlink","utimes","writeFile"].filter(t=>typeof Pe[t]=="function");Object.assign(Lt,Pe);Kw.forEach(t=>{Lt[t]=Tf(Pe[t])});Lt.exists=function(t,e){return typeof e=="function"?Pe.exists(t,e):new Promise(r=>Pe.exists(t,r))};Lt.read=function(t,e,r,i,n,s){return typeof s=="function"?Pe.read(t,e,r,i,n,s):new Promise((o,a)=>{Pe.read(t,e,r,i,n,(u,f,c)=>{if(u)return a(u);o({bytesRead:f,buffer:c})})})};Lt.write=function(t,e,...r){return typeof r[r.length-1]=="function"?Pe.write(t,e,...r):new Promise((i,n)=>{Pe.write(t,e,...r,(s,o,a)=>{if(s)return n(s);i({bytesWritten:o,buffer:a})})})};Lt.readv=function(t,e,...r){return typeof r[r.length-1]=="function"?Pe.readv(t,e,...r):new Promise((i,n)=>{Pe.readv(t,e,...r,(s,o,a)=>{if(s)return n(s);i({bytesRead:o,buffers:a})})})};Lt.writev=function(t,e,...r){return typeof r[r.length-1]=="function"?Pe.writev(t,e,...r):new Promise((i,n)=>{Pe.writev(t,e,...r,(s,o,a)=>{if(s)return n(s);i({bytesWritten:o,buffers:a})})})};typeof Pe.realpath.native=="function"?Lt.realpath.native=Tf(Pe.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")});var xf=_((Sk,Cf)=>{"use strict";var Yw=require("path");Cf.exports.checkPath=function(e){if(process.platform==="win32"&&/[<>:"|?*]/.test(e.replace(Yw.parse(e).root,""))){let i=new Error(`Path contains invalid characters: ${e}`);throw i.code="EINVAL",i}}});var Nf=_((bk,La)=>{"use strict";var kf=Me(),{checkPath:Ff}=xf(),Af=t=>{let e={mode:511};return typeof t=="number"?t:{...e,...t}.mode};La.exports.makeDir=async(t,e)=>(Ff(t),kf.mkdir(t,{mode:Af(e),recursive:!0}));La.exports.makeDirSync=(t,e)=>(Ff(t),kf.mkdirSync(t,{mode:Af(e),recursive:!0}))});var ct=_((Rk,Df)=>{"use strict";var Zw=Se().fromPromise,{makeDir:Qw,makeDirSync:Ia}=Nf(),qa=Zw(Qw);Df.exports={mkdirs:qa,mkdirsSync:Ia,mkdirp:qa,mkdirpSync:Ia,ensureDir:qa,ensureDirSync:Ia}});var Vt=_((Ok,If)=>{"use strict";var Jw=Se().fromPromise,Lf=Me();function e0(t){return Lf.access(t).then(()=>!0).catch(()=>!1)}If.exports={pathExists:Jw(e0),pathExistsSync:Lf.existsSync}});var Pa=_((Tk,qf)=>{"use strict";var Kr=Me(),t0=Se().fromPromise;async function r0(t,e,r){let i=await Kr.open(t,"r+"),n=null;try{await Kr.futimes(i,e,r)}finally{try{await Kr.close(i)}catch(s){n=s}}if(n)throw n}function i0(t,e,r){let i=Kr.openSync(t,"r+");return Kr.futimesSync(i,e,r),Kr.closeSync(i)}qf.exports={utimesMillis:t0(r0),utimesMillisSync:i0}});var Er=_((Ck,Bf)=>{"use strict";var Yr=Me(),be=require("path"),Pf=Se().fromPromise;function n0(t,e,r){let i=r.dereference?n=>Yr.stat(n,{bigint:!0}):n=>Yr.lstat(n,{bigint:!0});return Promise.all([i(t),i(e).catch(n=>{if(n.code==="ENOENT")return null;throw n})]).then(([n,s])=>({srcStat:n,destStat:s}))}function s0(t,e,r){let i,n=r.dereference?o=>Yr.statSync(o,{bigint:!0}):o=>Yr.lstatSync(o,{bigint:!0}),s=n(t);try{i=n(e)}catch(o){if(o.code==="ENOENT")return{srcStat:s,destStat:null};throw o}return{srcStat:s,destStat:i}}async function o0(t,e,r,i){let{srcStat:n,destStat:s}=await n0(t,e,i);if(s){if(Wi(n,s)){let o=be.basename(t),a=be.basename(e);if(r==="move"&&o!==a&&o.toLowerCase()===a.toLowerCase())return{srcStat:n,destStat:s,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(n.isDirectory()&&!s.isDirectory())throw new Error(`Cannot overwrite non-directory '${e}' with directory '${t}'.`);if(!n.isDirectory()&&s.isDirectory())throw new Error(`Cannot overwrite directory '${e}' with non-directory '${t}'.`)}if(n.isDirectory()&&Ma(t,e))throw new Error(ss(t,e,r));return{srcStat:n,destStat:s}}function a0(t,e,r,i){let{srcStat:n,destStat:s}=s0(t,e,i);if(s){if(Wi(n,s)){let o=be.basename(t),a=be.basename(e);if(r==="move"&&o!==a&&o.toLowerCase()===a.toLowerCase())return{srcStat:n,destStat:s,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(n.isDirectory()&&!s.isDirectory())throw new Error(`Cannot overwrite non-directory '${e}' with directory '${t}'.`);if(!n.isDirectory()&&s.isDirectory())throw new Error(`Cannot overwrite directory '${e}' with non-directory '${t}'.`)}if(n.isDirectory()&&Ma(t,e))throw new Error(ss(t,e,r));return{srcStat:n,destStat:s}}async function Mf(t,e,r,i){let n=be.resolve(be.dirname(t)),s=be.resolve(be.dirname(r));if(s===n||s===be.parse(s).root)return;let o;try{o=await Yr.stat(s,{bigint:!0})}catch(a){if(a.code==="ENOENT")return;throw a}if(Wi(e,o))throw new Error(ss(t,r,i));return Mf(t,e,s,i)}function jf(t,e,r,i){let n=be.resolve(be.dirname(t)),s=be.resolve(be.dirname(r));if(s===n||s===be.parse(s).root)return;let o;try{o=Yr.statSync(s,{bigint:!0})}catch(a){if(a.code==="ENOENT")return;throw a}if(Wi(e,o))throw new Error(ss(t,r,i));return jf(t,e,s,i)}function Wi(t,e){return e.ino&&e.dev&&e.ino===t.ino&&e.dev===t.dev}function Ma(t,e){let r=be.resolve(t).split(be.sep).filter(n=>n),i=be.resolve(e).split(be.sep).filter(n=>n);return r.every((n,s)=>i[s]===n)}function ss(t,e,r){return`Cannot ${r} '${t}' to a subdirectory of itself, '${e}'.`}Bf.exports={checkPaths:Pf(o0),checkPathsSync:a0,checkParentPaths:Pf(Mf),checkParentPathsSync:jf,isSrcSubdir:Ma,areIdentical:Wi}});var Hf=_((xk,Wf)=>{"use strict";var Fe=Me(),Hi=require("path"),{mkdirs:u0}=ct(),{pathExists:c0}=Vt(),{utimesMillis:l0}=Pa(),Gi=Er();async function f0(t,e,r={}){typeof r=="function"&&(r={filter:r}),r.clobber="clobber"in r?!!r.clobber:!0,r.overwrite="overwrite"in r?!!r.overwrite:r.clobber,r.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended; + + see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0001");let{srcStat:i,destStat:n}=await Gi.checkPaths(t,e,"copy",r);if(await Gi.checkParentPaths(t,i,e,"copy"),!await Uf(t,e,r))return;let o=Hi.dirname(e);await c0(o)||await u0(o),await zf(n,t,e,r)}async function Uf(t,e,r){return r.filter?r.filter(t,e):!0}async function zf(t,e,r,i){let s=await(i.dereference?Fe.stat:Fe.lstat)(e);if(s.isDirectory())return m0(s,t,e,r,i);if(s.isFile()||s.isCharacterDevice()||s.isBlockDevice())return h0(s,t,e,r,i);if(s.isSymbolicLink())return _0(t,e,r,i);throw s.isSocket()?new Error(`Cannot copy a socket file: ${e}`):s.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${e}`):new Error(`Unknown file: ${e}`)}async function h0(t,e,r,i,n){if(!e)return $f(t,r,i,n);if(n.overwrite)return await Fe.unlink(i),$f(t,r,i,n);if(n.errorOnExist)throw new Error(`'${i}' already exists`)}async function $f(t,e,r,i){if(await Fe.copyFile(e,r),i.preserveTimestamps){d0(t.mode)&&await p0(r,t.mode);let n=await Fe.stat(e);await l0(r,n.atime,n.mtime)}return Fe.chmod(r,t.mode)}function d0(t){return(t&128)===0}function p0(t,e){return Fe.chmod(t,e|128)}async function m0(t,e,r,i,n){e||await Fe.mkdir(i);let s=[];for await(let o of await Fe.opendir(r)){let a=Hi.join(r,o.name),u=Hi.join(i,o.name);s.push(Uf(a,u,n).then(f=>{if(f)return Gi.checkPaths(a,u,"copy",n).then(({destStat:c})=>zf(c,a,u,n))}))}await Promise.all(s),e||await Fe.chmod(i,t.mode)}async function _0(t,e,r,i){let n=await Fe.readlink(e);if(i.dereference&&(n=Hi.resolve(process.cwd(),n)),!t)return Fe.symlink(n,r);let s=null;try{s=await Fe.readlink(r)}catch(o){if(o.code==="EINVAL"||o.code==="UNKNOWN")return Fe.symlink(n,r);throw o}if(i.dereference&&(s=Hi.resolve(process.cwd(),s)),Gi.isSrcSubdir(n,s))throw new Error(`Cannot copy '${n}' to a subdirectory of itself, '${s}'.`);if(Gi.isSrcSubdir(s,n))throw new Error(`Cannot overwrite '${s}' with '${n}'.`);return await Fe.unlink(r),Fe.symlink(n,r)}Wf.exports=f0});var Yf=_((kk,Kf)=>{"use strict";var je=wr(),Vi=require("path"),y0=ct().mkdirsSync,v0=Pa().utimesMillisSync,Xi=Er();function g0(t,e,r){typeof r=="function"&&(r={filter:r}),r=r||{},r.clobber="clobber"in r?!!r.clobber:!0,r.overwrite="overwrite"in r?!!r.overwrite:r.clobber,r.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended; + + see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0002");let{srcStat:i,destStat:n}=Xi.checkPathsSync(t,e,"copy",r);if(Xi.checkParentPathsSync(t,i,e,"copy"),r.filter&&!r.filter(t,e))return;let s=Vi.dirname(e);return je.existsSync(s)||y0(s),Gf(n,t,e,r)}function Gf(t,e,r,i){let s=(i.dereference?je.statSync:je.lstatSync)(e);if(s.isDirectory())return T0(s,t,e,r,i);if(s.isFile()||s.isCharacterDevice()||s.isBlockDevice())return w0(s,t,e,r,i);if(s.isSymbolicLink())return k0(t,e,r,i);throw s.isSocket()?new Error(`Cannot copy a socket file: ${e}`):s.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${e}`):new Error(`Unknown file: ${e}`)}function w0(t,e,r,i,n){return e?E0(t,r,i,n):Vf(t,r,i,n)}function E0(t,e,r,i){if(i.overwrite)return je.unlinkSync(r),Vf(t,e,r,i);if(i.errorOnExist)throw new Error(`'${r}' already exists`)}function Vf(t,e,r,i){return je.copyFileSync(e,r),i.preserveTimestamps&&S0(t.mode,e,r),ja(r,t.mode)}function S0(t,e,r){return b0(t)&&R0(r,t),O0(e,r)}function b0(t){return(t&128)===0}function R0(t,e){return ja(t,e|128)}function ja(t,e){return je.chmodSync(t,e)}function O0(t,e){let r=je.statSync(t);return v0(e,r.atime,r.mtime)}function T0(t,e,r,i,n){return e?Xf(r,i,n):C0(t.mode,r,i,n)}function C0(t,e,r,i){return je.mkdirSync(r),Xf(e,r,i),ja(r,t)}function Xf(t,e,r){let i=je.opendirSync(t);try{let n;for(;(n=i.readSync())!==null;)x0(n.name,t,e,r)}finally{i.closeSync()}}function x0(t,e,r,i){let n=Vi.join(e,t),s=Vi.join(r,t);if(i.filter&&!i.filter(n,s))return;let{destStat:o}=Xi.checkPathsSync(n,s,"copy",i);return Gf(o,n,s,i)}function k0(t,e,r,i){let n=je.readlinkSync(e);if(i.dereference&&(n=Vi.resolve(process.cwd(),n)),t){let s;try{s=je.readlinkSync(r)}catch(o){if(o.code==="EINVAL"||o.code==="UNKNOWN")return je.symlinkSync(n,r);throw o}if(i.dereference&&(s=Vi.resolve(process.cwd(),s)),Xi.isSrcSubdir(n,s))throw new Error(`Cannot copy '${n}' to a subdirectory of itself, '${s}'.`);if(Xi.isSrcSubdir(s,n))throw new Error(`Cannot overwrite '${s}' with '${n}'.`);return F0(n,r)}else return je.symlinkSync(n,r)}function F0(t,e){return je.unlinkSync(e),je.symlinkSync(t,e)}Kf.exports=g0});var os=_((Fk,Zf)=>{"use strict";var A0=Se().fromPromise;Zf.exports={copy:A0(Hf()),copySync:Yf()}});var Ki=_((Ak,Jf)=>{"use strict";var Qf=wr(),N0=Se().fromCallback;function D0(t,e){Qf.rm(t,{recursive:!0,force:!0},e)}function L0(t){Qf.rmSync(t,{recursive:!0,force:!0})}Jf.exports={remove:N0(D0),removeSync:L0}});var ah=_((Nk,oh)=>{"use strict";var I0=Se().fromPromise,rh=Me(),ih=require("path"),nh=ct(),sh=Ki(),eh=I0(async function(e){let r;try{r=await rh.readdir(e)}catch{return nh.mkdirs(e)}return Promise.all(r.map(i=>sh.remove(ih.join(e,i))))});function th(t){let e;try{e=rh.readdirSync(t)}catch{return nh.mkdirsSync(t)}e.forEach(r=>{r=ih.join(t,r),sh.removeSync(r)})}oh.exports={emptyDirSync:th,emptydirSync:th,emptyDir:eh,emptydir:eh}});var fh=_((Dk,lh)=>{"use strict";var q0=Se().fromPromise,uh=require("path"),It=Me(),ch=ct();async function P0(t){let e;try{e=await It.stat(t)}catch{}if(e&&e.isFile())return;let r=uh.dirname(t),i=null;try{i=await It.stat(r)}catch(n){if(n.code==="ENOENT"){await ch.mkdirs(r),await It.writeFile(t,"");return}else throw n}i.isDirectory()?await It.writeFile(t,""):await It.readdir(r)}function M0(t){let e;try{e=It.statSync(t)}catch{}if(e&&e.isFile())return;let r=uh.dirname(t);try{It.statSync(r).isDirectory()||It.readdirSync(r)}catch(i){if(i&&i.code==="ENOENT")ch.mkdirsSync(r);else throw i}It.writeFileSync(t,"")}lh.exports={createFile:q0(P0),createFileSync:M0}});var _h=_((Lk,mh)=>{"use strict";var j0=Se().fromPromise,hh=require("path"),Xt=Me(),dh=ct(),{pathExists:B0}=Vt(),{areIdentical:ph}=Er();async function $0(t,e){let r;try{r=await Xt.lstat(e)}catch{}let i;try{i=await Xt.lstat(t)}catch(o){throw o.message=o.message.replace("lstat","ensureLink"),o}if(r&&ph(i,r))return;let n=hh.dirname(e);await B0(n)||await dh.mkdirs(n),await Xt.link(t,e)}function U0(t,e){let r;try{r=Xt.lstatSync(e)}catch{}try{let s=Xt.lstatSync(t);if(r&&ph(s,r))return}catch(s){throw s.message=s.message.replace("lstat","ensureLink"),s}let i=hh.dirname(e);return Xt.existsSync(i)||dh.mkdirsSync(i),Xt.linkSync(t,e)}mh.exports={createLink:j0($0),createLinkSync:U0}});var vh=_((Ik,yh)=>{"use strict";var Kt=require("path"),Yi=Me(),{pathExists:z0}=Vt(),W0=Se().fromPromise;async function H0(t,e){if(Kt.isAbsolute(t)){try{await Yi.lstat(t)}catch(s){throw s.message=s.message.replace("lstat","ensureSymlink"),s}return{toCwd:t,toDst:t}}let r=Kt.dirname(e),i=Kt.join(r,t);if(await z0(i))return{toCwd:i,toDst:t};try{await Yi.lstat(t)}catch(s){throw s.message=s.message.replace("lstat","ensureSymlink"),s}return{toCwd:t,toDst:Kt.relative(r,t)}}function G0(t,e){if(Kt.isAbsolute(t)){if(!Yi.existsSync(t))throw new Error("absolute srcpath does not exist");return{toCwd:t,toDst:t}}let r=Kt.dirname(e),i=Kt.join(r,t);if(Yi.existsSync(i))return{toCwd:i,toDst:t};if(!Yi.existsSync(t))throw new Error("relative srcpath does not exist");return{toCwd:t,toDst:Kt.relative(r,t)}}yh.exports={symlinkPaths:W0(H0),symlinkPathsSync:G0}});var Eh=_((qk,wh)=>{"use strict";var gh=Me(),V0=Se().fromPromise;async function X0(t,e){if(e)return e;let r;try{r=await gh.lstat(t)}catch{return"file"}return r&&r.isDirectory()?"dir":"file"}function K0(t,e){if(e)return e;let r;try{r=gh.lstatSync(t)}catch{return"file"}return r&&r.isDirectory()?"dir":"file"}wh.exports={symlinkType:V0(X0),symlinkTypeSync:K0}});var Oh=_((Pk,Rh)=>{"use strict";var Y0=Se().fromPromise,Sh=require("path"),vt=Me(),{mkdirs:Z0,mkdirsSync:Q0}=ct(),{symlinkPaths:J0,symlinkPathsSync:eE}=vh(),{symlinkType:tE,symlinkTypeSync:rE}=Eh(),{pathExists:iE}=Vt(),{areIdentical:bh}=Er();async function nE(t,e,r){let i;try{i=await vt.lstat(e)}catch{}if(i&&i.isSymbolicLink()){let[a,u]=await Promise.all([vt.stat(t),vt.stat(e)]);if(bh(a,u))return}let n=await J0(t,e);t=n.toDst;let s=await tE(n.toCwd,r),o=Sh.dirname(e);return await iE(o)||await Z0(o),vt.symlink(t,e,s)}function sE(t,e,r){let i;try{i=vt.lstatSync(e)}catch{}if(i&&i.isSymbolicLink()){let a=vt.statSync(t),u=vt.statSync(e);if(bh(a,u))return}let n=eE(t,e);t=n.toDst,r=rE(n.toCwd,r);let s=Sh.dirname(e);return vt.existsSync(s)||Q0(s),vt.symlinkSync(t,e,r)}Rh.exports={createSymlink:Y0(nE),createSymlinkSync:sE}});var Dh=_((Mk,Nh)=>{"use strict";var{createFile:Th,createFileSync:Ch}=fh(),{createLink:xh,createLinkSync:kh}=_h(),{createSymlink:Fh,createSymlinkSync:Ah}=Oh();Nh.exports={createFile:Th,createFileSync:Ch,ensureFile:Th,ensureFileSync:Ch,createLink:xh,createLinkSync:kh,ensureLink:xh,ensureLinkSync:kh,createSymlink:Fh,createSymlinkSync:Ah,ensureSymlink:Fh,ensureSymlinkSync:Ah}});var as=_((jk,Lh)=>{function oE(t,{EOL:e=` +`,finalEOL:r=!0,replacer:i=null,spaces:n}={}){let s=r?e:"";return JSON.stringify(t,i,n).replace(/\n/g,e)+s}function aE(t){return Buffer.isBuffer(t)&&(t=t.toString("utf8")),t.replace(/^\uFEFF/,"")}Lh.exports={stringify:oE,stripBom:aE}});var Mh=_((Bk,Ph)=>{var Zr;try{Zr=wr()}catch{Zr=require("fs")}var us=Se(),{stringify:Ih,stripBom:qh}=as();async function uE(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||Zr,i="throws"in e?e.throws:!0,n=await us.fromCallback(r.readFile)(t,e);n=qh(n);let s;try{s=JSON.parse(n,e?e.reviver:null)}catch(o){if(i)throw o.message=`${t}: ${o.message}`,o;return null}return s}var cE=us.fromPromise(uE);function lE(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||Zr,i="throws"in e?e.throws:!0;try{let n=r.readFileSync(t,e);return n=qh(n),JSON.parse(n,e.reviver)}catch(n){if(i)throw n.message=`${t}: ${n.message}`,n;return null}}async function fE(t,e,r={}){let i=r.fs||Zr,n=Ih(e,r);await us.fromCallback(i.writeFile)(t,n,r)}var hE=us.fromPromise(fE);function dE(t,e,r={}){let i=r.fs||Zr,n=Ih(e,r);return i.writeFileSync(t,n,r)}var pE={readFile:cE,readFileSync:lE,writeFile:hE,writeFileSync:dE};Ph.exports=pE});var Bh=_(($k,jh)=>{"use strict";var cs=Mh();jh.exports={readJson:cs.readFile,readJsonSync:cs.readFileSync,writeJson:cs.writeFile,writeJsonSync:cs.writeFileSync}});var ls=_((Uk,zh)=>{"use strict";var mE=Se().fromPromise,Ba=Me(),$h=require("path"),Uh=ct(),_E=Vt().pathExists;async function yE(t,e,r="utf-8"){let i=$h.dirname(t);return await _E(i)||await Uh.mkdirs(i),Ba.writeFile(t,e,r)}function vE(t,...e){let r=$h.dirname(t);Ba.existsSync(r)||Uh.mkdirsSync(r),Ba.writeFileSync(t,...e)}zh.exports={outputFile:mE(yE),outputFileSync:vE}});var Hh=_((zk,Wh)=>{"use strict";var{stringify:gE}=as(),{outputFile:wE}=ls();async function EE(t,e,r={}){let i=gE(e,r);await wE(t,i,r)}Wh.exports=EE});var Vh=_((Wk,Gh)=>{"use strict";var{stringify:SE}=as(),{outputFileSync:bE}=ls();function RE(t,e,r){let i=SE(e,r);bE(t,i,r)}Gh.exports=RE});var Kh=_((Hk,Xh)=>{"use strict";var OE=Se().fromPromise,Be=Bh();Be.outputJson=OE(Hh());Be.outputJsonSync=Vh();Be.outputJSON=Be.outputJson;Be.outputJSONSync=Be.outputJsonSync;Be.writeJSON=Be.writeJson;Be.writeJSONSync=Be.writeJsonSync;Be.readJSON=Be.readJson;Be.readJSONSync=Be.readJsonSync;Xh.exports=Be});var ed=_((Gk,Jh)=>{"use strict";var TE=Me(),Yh=require("path"),{copy:CE}=os(),{remove:Qh}=Ki(),{mkdirp:xE}=ct(),{pathExists:kE}=Vt(),Zh=Er();async function FE(t,e,r={}){let i=r.overwrite||r.clobber||!1,{srcStat:n,isChangingCase:s=!1}=await Zh.checkPaths(t,e,"move",r);await Zh.checkParentPaths(t,n,e,"move");let o=Yh.dirname(e);return Yh.parse(o).root!==o&&await xE(o),AE(t,e,i,s)}async function AE(t,e,r,i){if(!i){if(r)await Qh(e);else if(await kE(e))throw new Error("dest already exists.")}try{await TE.rename(t,e)}catch(n){if(n.code!=="EXDEV")throw n;await NE(t,e,r)}}async function NE(t,e,r){return await CE(t,e,{overwrite:r,errorOnExist:!0,preserveTimestamps:!0}),Qh(t)}Jh.exports=FE});var sd=_((Vk,nd)=>{"use strict";var rd=wr(),Ua=require("path"),DE=os().copySync,id=Ki().removeSync,LE=ct().mkdirpSync,td=Er();function IE(t,e,r){r=r||{};let i=r.overwrite||r.clobber||!1,{srcStat:n,isChangingCase:s=!1}=td.checkPathsSync(t,e,"move",r);return td.checkParentPathsSync(t,n,e,"move"),qE(e)||LE(Ua.dirname(e)),PE(t,e,i,s)}function qE(t){let e=Ua.dirname(t);return Ua.parse(e).root===e}function PE(t,e,r,i){if(i)return $a(t,e,r);if(r)return id(e),$a(t,e,r);if(rd.existsSync(e))throw new Error("dest already exists.");return $a(t,e,r)}function $a(t,e,r){try{rd.renameSync(t,e)}catch(i){if(i.code!=="EXDEV")throw i;return ME(t,e,r)}}function ME(t,e,r){return DE(t,e,{overwrite:r,errorOnExist:!0,preserveTimestamps:!0}),id(t)}nd.exports=IE});var ad=_((Xk,od)=>{"use strict";var jE=Se().fromPromise;od.exports={move:jE(ed()),moveSync:sd()}});var za=_((Kk,ud)=>{"use strict";ud.exports={...Me(),...os(),...ah(),...Dh(),...Kh(),...ct(),...ad(),...ls(),...Vt(),...Ki()}});var ld=_((Yk,cd)=>{cd.exports=zE;var BE=zn(),Wa=za(),fs=require("path"),$E=require("stream"),UE=Ca();function zE(t){t.path=fs.resolve(fs.normalize(t.path));let e=new BE(t),r=new $E.Writable({objectMode:!0});r._write=async function(n,s,o){let a=fs.join(t.path,n.path.replace(/\\/g,"/"));if(a.indexOf(t.path)!=0)return o();if(n.type=="Directory")return await Wa.ensureDir(a),o();await Wa.ensureDir(fs.dirname(a));let u=t.getWriter?t.getWriter({path:a}):Wa.createWriteStream(a);n.pipe(u).on("error",o).on("close",o)};let i=UE(e,r);return e.once("crx-header",function(n){i.crxHeader=n}),e.pipe(r).on("finish",function(){i.emit("close")}),i.promise=function(){return new Promise(function(n,s){i.on("close",n),i.on("error",s)})},i}});var dd=_((Zk,hd)=>{var Ha=4294967296,fd=[];for(Qr=0;Qr<256;Qr++)fd[Qr]=(Qr>15?"":"0")+Qr.toString(16);var Qr,Zi=hd.exports=function(t,e){t instanceof Buffer?(this.buffer=t,this.offset=e||0):Object.prototype.toString.call(t)=="[object Uint8Array]"?(this.buffer=new Buffer(t),this.offset=e||0):(this.buffer=this.buffer||new Buffer(8),this.offset=0,this.setValue.apply(this,arguments))};Zi.MAX_INT=Math.pow(2,53);Zi.MIN_INT=-Math.pow(2,53);Zi.prototype={constructor:Zi,_2scomp:function(){for(var t=this.buffer,e=this.offset,r=1,i=e+7;i>=e;i--){var n=(t[i]^255)+r;t[i]=n&255,r=n>>8}},setValue:function(t,e){var r=!1;if(arguments.length==1)if(typeof t=="number"){if(r=t<0,t=Math.abs(t),e=t%Ha,t=t/Ha,t>Ha)throw new RangeError(t+" is outside Int64 range");t=t|0}else if(typeof t=="string")t=(t+"").replace(/^0x/,""),e=t.substr(-8),t=t.length>8?t.substr(0,t.length-8):"",t=parseInt(t,16),e=parseInt(e,16);else throw new Error(t+" must be a Number or String");for(var i=this.buffer,n=this.offset,s=7;s>=0;s--)i[n+s]=e&255,e=s==4?t:e>>>8;r&&this._2scomp()},toNumber:function(t){for(var e=this.buffer,r=this.offset,i=e[r]&128,n=0,s=1,o=7,a=1;o>=0;o--,a*=256){var u=e[r+o];i&&(u=(u^255)+s,s=u>>8,u=u&255),n+=u*a}return!t&&n>=Zi.MAX_INT?i?-1/0:1/0:i?-n:n},valueOf:function(){return this.toNumber(!1)},toString:function(t){return this.valueOf().toString(t||10)},toOctetString:function(t){for(var e=new Array(8),r=this.buffer,i=this.offset,n=0;n<8;n++)e[n]=fd[r[i+n]];return e.join(t||"")},toBuffer:function(t){if(t&&this.offset===0)return this.buffer;var e=new Buffer(8);return this.buffer.copy(e,0,this.offset,this.offset+8),e},copy:function(t,e){this.buffer.copy(t,e||0,this.offset,this.offset+8)},compare:function(t){if((this.buffer[this.offset]&128)!=(t.buffer[t.offset]&128))return t.buffer[t.offset]-this.buffer[this.offset];for(var e=0;e<8;e++)if(this.buffer[this.offset+e]!==t.buffer[t.offset+e])return this.buffer[this.offset+e]-t.buffer[t.offset+e];return 0},equals:function(t){return this.compare(t)===0},inspect:function(){return"[Int64 value:"+this+" octets:"+this.toOctetString(" ")+"]"}}});var yd=_((Qk,_d)=>{var WE=dd(),hs=require("stream");(!hs.Writable||!hs.Writable.prototype.destroy)&&(hs=Ra());var ds;function HE(){let e,r,i;for(ds=[],r=0;r<256;r++){for(e=r,i=0;i<8;i++)e=e&1?3988292384^e>>>1:e=e>>>1;ds[r]=e>>>0}}function pd(t,e){ds||HE(),t.charCodeAt&&(t=t.charCodeAt(0));let r=e.readUInt32BE()>>8&16777215,i=ds[(e.readUInt32BE()^t>>>0)&255];return(r^i)>>>0}function md(t,e){let r=t>>16&65535,i=t&65535,n=e>>16&65535,s=e&65535;return((r*s+i*n&65535)<<16>>>0)+i*s}function Jr(){if(!(this instanceof Jr))return new Jr;this.key0=Buffer.allocUnsafe(4),this.key1=Buffer.allocUnsafe(4),this.key2=Buffer.allocUnsafe(4),this.key0.writeUInt32BE(305419896,0),this.key1.writeUInt32BE(591751049,0),this.key2.writeUInt32BE(878082192,0)}Jr.prototype.update=function(t){this.key0.writeUInt32BE(pd(t,this.key0)),this.key1.writeUInt32BE((this.key0.readUInt32BE()&255&4294967295)+this.key1.readUInt32BE()>>>0);let e=new WE(md(this.key1.readUInt32BE(),134775813)+1&4294967295),r=Buffer.alloc(8);e.copy(r,0),r.copy(this.key1,0,4,8),this.key2.writeUInt32BE(pd((this.key1.readUInt32BE()>>24&255)>>>0,this.key2))};Jr.prototype.decryptByte=function(t){let e=(this.key2.readUInt32BE()|2)>>>0;return t=t^md(e,e^1)>>8&255,this.update(t),t};Jr.prototype.stream=function(){let t=hs.Transform(),e=this;return t._transform=function(r,i,n){for(let s=0;s{var GE=yd(),VE=jn(),vd=require("stream"),XE=require("zlib"),KE=$n(),YE=Un(),ZE=Di();gd.exports=function(e,r,i,n,s){let o=VE(),a=vd.PassThrough(),u=e.stream(r,s);return u.pipe(o).on("error",function(f){a.emit("error",f)}),a.vars=o.pull(30).then(function(f){let c=ZE.parse(f,[["signature",4],["versionsNeededToExtract",2],["flags",2],["compressionMethod",2],["lastModifiedTime",2],["lastModifiedDate",2],["crc32",4],["compressedSize",4],["uncompressedSize",4],["fileNameLength",2],["extraFieldLength",2]]);return c.lastModifiedDateTime=YE(c.lastModifiedDate,c.lastModifiedTime),o.pull(c.fileNameLength).then(function(h){return c.fileName=h.toString("utf8"),o.pull(c.extraFieldLength)}).then(function(h){let p;return c.extra=KE(h,c),n&&n.compressedSize&&(c=n),c.flags&1&&(p=o.pull(12).then(function(l){if(!i)throw new Error("MISSING_PASSWORD");let d=GE();String(i).split("").forEach(function(y){d.update(y)});for(let y=0;y>8&255:c.crc32>>24&255;if(l[11]!==m)throw new Error("BAD_PASSWORD");return c})),Promise.resolve(p).then(function(){return a.emit("vars",c),c})})}),a.vars.then(function(f){let c=!(f.flags&8)||f.compressedSize>0,h,p=f.compressionMethod?XE.createInflateRaw():vd.PassThrough();c?(a.size=f.uncompressedSize,h=f.compressedSize):(h=Buffer.alloc(4),h.writeUInt32LE(134695760,0));let l=o.stream(h);f.decrypt&&(l=l.pipe(f.decrypt.stream())),l.pipe(p).on("error",function(d){a.emit("error",d)}).pipe(a).on("finish",function(){u.destroy?u.destroy():u.abort?u.abort():u.close?u.close():u.push?u.push():console.log("warning - unable to close stream")})}).catch(function(f){a.emit("error",f)}),a}});var Yt=_((eF,Xa)=>{var Ga=function(){"use strict";return this===void 0}();Ga?Xa.exports={freeze:Object.freeze,defineProperty:Object.defineProperty,getDescriptor:Object.getOwnPropertyDescriptor,keys:Object.keys,names:Object.getOwnPropertyNames,getPrototypeOf:Object.getPrototypeOf,isArray:Array.isArray,isES5:Ga,propertyIsWritable:function(t,e){var r=Object.getOwnPropertyDescriptor(t,e);return!!(!r||r.writable||r.set)}}:(Ed={}.hasOwnProperty,Sd={}.toString,bd={}.constructor.prototype,Va=function(t){var e=[];for(var r in t)Ed.call(t,r)&&e.push(r);return e},Rd=function(t,e){return{value:t[e]}},Od=function(t,e,r){return t[e]=r.value,t},Td=function(t){return t},Cd=function(t){try{return Object(t).constructor.prototype}catch{return bd}},xd=function(t){try{return Sd.call(t)==="[object Array]"}catch{return!1}},Xa.exports={isArray:xd,keys:Va,names:Va,defineProperty:Od,getDescriptor:Rd,freeze:Td,getPrototypeOf:Cd,isES5:Ga,propertyIsWritable:function(){return!0}});var Ed,Sd,bd,Va,Rd,Od,Td,Cd,xd});var ue=_((exports,module)=>{"use strict";var es5=Yt(),canEvaluate=typeof navigator>"u",errorObj={e:{}},tryCatchTarget,globalObject=typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:exports!==void 0?exports:null;function tryCatcher(){try{var t=tryCatchTarget;return tryCatchTarget=null,t.apply(this,arguments)}catch(e){return errorObj.e=e,errorObj}}function tryCatch(t){return tryCatchTarget=t,tryCatcher}var inherits=function(t,e){var r={}.hasOwnProperty;function i(){this.constructor=t,this.constructor$=e;for(var n in e.prototype)r.call(e.prototype,n)&&n.charAt(n.length-1)!=="$"&&(this[n+"$"]=e.prototype[n])}return i.prototype=e.prototype,t.prototype=new i,t.prototype};function isPrimitive(t){return t==null||t===!0||t===!1||typeof t=="string"||typeof t=="number"}function isObject(t){return typeof t=="function"||typeof t=="object"&&t!==null}function maybeWrapAsError(t){return isPrimitive(t)?new Error(safeToString(t)):t}function withAppended(t,e){var r=t.length,i=new Array(r+1),n;for(n=0;n1,i=e.length>0&&!(e.length===1&&e[0]==="constructor"),n=thisAssignmentPattern.test(t+"")&&es5.names(t).length>0;if(r||i||n)return!0}return!1}catch{return!1}}function toFastProperties(obj){function FakeConstructor(){}FakeConstructor.prototype=obj;var receiver=new FakeConstructor;function ic(){return typeof receiver.foo}return ic(),ic(),obj;eval(obj)}var rident=/^[a-z$_][a-z$_0-9]*$/i;function isIdentifier(t){return rident.test(t)}function filledRange(t,e,r){for(var i=new Array(t),n=0;n10||t[0]>0}();ret.nodeSupportsAsyncResource=ret.isNode&&function(){var t=!1;try{var e=require("async_hooks").AsyncResource;t=typeof e.prototype.runInAsyncScope=="function"}catch{t=!1}return t}();ret.isNode&&ret.toFastProperties(process);try{throw new Error}catch(t){ret.lastLineError=t}module.exports=ret});var Dd=_((tF,Nd)=>{"use strict";var Ya=ue(),Sr,QE=function(){throw new Error(`No async scheduler available + + See http://goo.gl/MqrFmX +`)},Ka=Ya.getNativePromise();Ya.isNode&&typeof MutationObserver>"u"?(kd=global.setImmediate,Fd=process.nextTick,Sr=Ya.isRecentNode?function(t){kd.call(global,t)}:function(t){Fd.call(process,t)}):typeof Ka=="function"&&typeof Ka.resolve=="function"?(Ad=Ka.resolve(),Sr=function(t){Ad.then(t)}):typeof MutationObserver<"u"&&!(typeof window<"u"&&window.navigator&&(window.navigator.standalone||window.cordova))&&"classList"in document.documentElement?Sr=function(){var t=document.createElement("div"),e={attributes:!0},r=!1,i=document.createElement("div"),n=new MutationObserver(function(){t.classList.toggle("foo"),r=!1});n.observe(i,e);var s=function(){r||(r=!0,i.classList.toggle("foo"))};return function(a){var u=new MutationObserver(function(){u.disconnect(),a()});u.observe(t,e),s()}}():typeof setImmediate<"u"?Sr=function(t){setImmediate(t)}:typeof setTimeout<"u"?Sr=function(t){setTimeout(t,0)}:Sr=QE;var kd,Fd,Ad;Nd.exports=Sr});var Id=_((rF,Ld)=>{"use strict";function JE(t,e,r,i,n){for(var s=0;s{"use strict";var Md;try{throw new Error}catch(t){Md=t}var eS=Dd(),qd=Id();function Qe(){this._customScheduler=!1,this._isTickUsed=!1,this._lateQueue=new qd(16),this._normalQueue=new qd(16),this._haveDrainedQueues=!1;var t=this;this.drainQueues=function(){t._drainQueues()},this._schedule=eS}Qe.prototype.setScheduler=function(t){var e=this._schedule;return this._schedule=t,this._customScheduler=!0,e};Qe.prototype.hasCustomScheduler=function(){return this._customScheduler};Qe.prototype.haveItemsQueued=function(){return this._isTickUsed||this._haveDrainedQueues};Qe.prototype.fatalError=function(t,e){e?(process.stderr.write("Fatal "+(t instanceof Error?t.stack:t)+` +`),process.exit(2)):this.throwLater(t)};Qe.prototype.throwLater=function(t,e){if(arguments.length===1&&(e=t,t=function(){throw e}),typeof setTimeout<"u")setTimeout(function(){t(e)},0);else try{this._schedule(function(){t(e)})}catch{throw new Error(`No async scheduler available + + See http://goo.gl/MqrFmX +`)}};function tS(t,e,r){this._lateQueue.push(t,e,r),this._queueTick()}function rS(t,e,r){this._normalQueue.push(t,e,r),this._queueTick()}function iS(t){this._normalQueue._pushOne(t),this._queueTick()}Qe.prototype.invokeLater=tS;Qe.prototype.invoke=rS;Qe.prototype.settlePromises=iS;function Pd(t){for(;t.length()>0;)nS(t)}function nS(t){var e=t.shift();if(typeof e!="function")e._settlePromises();else{var r=t.shift(),i=t.shift();e.call(r,i)}}Qe.prototype._drainQueues=function(){Pd(this._normalQueue),this._reset(),this._haveDrainedQueues=!0,Pd(this._lateQueue)};Qe.prototype._queueTick=function(){this._isTickUsed||(this._isTickUsed=!0,this._schedule(this.drainQueues))};Qe.prototype._reset=function(){this._isTickUsed=!1};Za.exports=Qe;Za.exports.firstLineError=Md});var qt=_((nF,Ud)=>{"use strict";var eu=Yt(),sS=eu.freeze,Bd=ue(),$d=Bd.inherits,ti=Bd.notEnumerableProp;function ri(t,e){function r(i){if(!(this instanceof r))return new r(i);ti(this,"message",typeof i=="string"?i:e),ti(this,"name",t),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):Error.call(this)}return $d(r,Error),r}var Qa,Ja,oS=ri("Warning","warning"),aS=ri("CancellationError","cancellation error"),uS=ri("TimeoutError","timeout error"),Ji=ri("AggregateError","aggregate error");try{Qa=TypeError,Ja=RangeError}catch{Qa=ri("TypeError","type error"),Ja=ri("RangeError","range error")}var ps="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" ");for(ei=0;ei{"use strict";zd.exports=function(t,e){var r=ue(),i=r.errorObj,n=r.isObject;function s(h,p){if(n(h)){if(h instanceof t)return h;var l=a(h);if(l===i){p&&p._pushContext();var d=t.reject(l.e);return p&&p._popContext(),d}else if(typeof l=="function"){if(f(h)){var d=new t(e);return h._then(d._fulfill,d._reject,void 0,d,null),d}return c(h,l,p)}}return h}function o(h){return h.then}function a(h){try{return o(h)}catch(p){return i.e=p,i}}var u={}.hasOwnProperty;function f(h){try{return u.call(h,"_promise0")}catch{return!1}}function c(h,p,l){var d=new t(e),m=d;l&&l._pushContext(),d._captureStackTrace(),l&&l._popContext();var y=!0,w=r.tryCatch(p).call(h,x,C);y=!1,d&&w===i&&(d._rejectCallback(w.e,!0,!0),d=null);function x(F){d&&(d._resolveCallback(F),d=null)}function C(F){d&&(d._rejectCallback(F,y,!0),d=null)}return m}return s}});var Gd=_((oF,Hd)=>{"use strict";Hd.exports=function(t,e,r,i,n){var s=ue(),o=s.isArray;function a(f){switch(f){case-2:return[];case-3:return{};case-6:return new Map}}function u(f){var c=this._promise=new t(e);f instanceof t&&(c._propagateFrom(f,3),f.suppressUnhandledRejections()),c._setOnCancel(this),this._values=f,this._length=0,this._totalResolved=0,this._init(void 0,-2)}return s.inherits(u,n),u.prototype.length=function(){return this._length},u.prototype.promise=function(){return this._promise},u.prototype._init=function f(c,h){var p=r(this._values,this._promise);if(p instanceof t){p=p._target();var l=p._bitField;if(this._values=p,(l&50397184)===0)return this._promise._setAsyncGuaranteed(),p._then(f,this._reject,void 0,this,h);if((l&33554432)!==0)p=p._value();else return(l&16777216)!==0?this._reject(p._reason()):this._cancel()}if(p=s.asArray(p),p===null){var d=i("expecting an array or an iterable object but got "+s.classString(p)).reason();this._promise._rejectCallback(d,!1);return}if(p.length===0){h===-5?this._resolveEmptyArray():this._resolve(a(h));return}this._iterate(p)},u.prototype._iterate=function(f){var c=this.getActualLength(f.length);this._length=c,this._values=this.shouldCopyValues()?new Array(c):this._values;for(var h=this._promise,p=!1,l=null,d=0;d=this._length?(this._resolve(this._values),!0):!1},u.prototype._promiseCancelled=function(){return this._cancel(),!0},u.prototype._promiseRejected=function(f){return this._totalResolved++,this._reject(f),!0},u.prototype._resultCancelled=function(){if(!this._isResolved()){var f=this._values;if(this._cancel(),f instanceof t)f.cancel();else for(var c=0;c{"use strict";Vd.exports=function(t){var e=!1,r=[];t.prototype._promiseCreated=function(){},t.prototype._pushContext=function(){},t.prototype._popContext=function(){return null},t._peekContext=t.prototype._peekContext=function(){};function i(){this._trace=new i.CapturedTrace(s())}i.prototype._pushContext=function(){this._trace!==void 0&&(this._trace._promiseCreated=null,r.push(this._trace))},i.prototype._popContext=function(){if(this._trace!==void 0){var o=r.pop(),a=o._promiseCreated;return o._promiseCreated=null,a}return null};function n(){if(e)return new i}function s(){var o=r.length-1;if(o>=0)return r[o]}return i.CapturedTrace=null,i.create=n,i.deactivateLongStackTraces=function(){},i.activateLongStackTraces=function(){var o=t.prototype._pushContext,a=t.prototype._popContext,u=t._peekContext,f=t.prototype._peekContext,c=t.prototype._promiseCreated;i.deactivateLongStackTraces=function(){t.prototype._pushContext=o,t.prototype._popContext=a,t._peekContext=u,t.prototype._peekContext=f,t.prototype._promiseCreated=c,e=!1},e=!0,t.prototype._pushContext=i.prototype._pushContext,t.prototype._popContext=i.prototype._popContext,t._peekContext=t.prototype._peekContext=s,t.prototype._promiseCreated=function(){var h=this._peekContext();h&&h._promiseCreated==null&&(h._promiseCreated=this)}},i}});var Yd=_((uF,Kd)=>{"use strict";Kd.exports=function(t,e,r,i){var n=t._async,s=qt().Warning,o=ue(),a=Yt(),u=o.canAttachTrace,f,c,h=/[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/,p=/\((?:timers\.js):\d+:\d+\)/,l=/[\/<\(](.+?):(\d+):(\d+)\)?\s*$/,d=null,m=null,y=!1,w,x=!!(o.env("BLUEBIRD_DEBUG")!=0&&(o.env("BLUEBIRD_DEBUG")||o.env("NODE_ENV")==="development")),C=!!(o.env("BLUEBIRD_WARNINGS")!=0&&(x||o.env("BLUEBIRD_WARNINGS"))),F=!!(o.env("BLUEBIRD_LONG_STACK_TRACES")!=0&&(x||o.env("BLUEBIRD_LONG_STACK_TRACES"))),W=o.env("BLUEBIRD_W_FORGOTTEN_RETURN")!=0&&(C||!!o.env("BLUEBIRD_W_FORGOTTEN_RETURN")),re;(function(){var E=[];function S(){for(var O=0;O0},t.prototype._setRejectionIsUnhandled=function(){this._bitField=this._bitField|1048576},t.prototype._unsetRejectionIsUnhandled=function(){this._bitField=this._bitField&-1048577,this._isUnhandledRejectionNotified()&&(this._unsetUnhandledRejectionIsNotified(),this._notifyUnhandledRejectionIsHandled())},t.prototype._isRejectionUnhandled=function(){return(this._bitField&1048576)>0},t.prototype._warn=function(E,S,T){return oe(E,S,T||this)},t.onPossiblyUnhandledRejection=function(E){var S=t._getContext();c=o.contextBind(S,E)},t.onUnhandledRejectionHandled=function(E){var S=t._getContext();f=o.contextBind(S,E)};var U=function(){};t.longStackTraces=function(){if(n.haveItemsQueued()&&!pe.longStackTraces)throw new Error(`cannot enable long stack traces after promises have been created + + See http://goo.gl/MqrFmX +`);if(!pe.longStackTraces&&Zo()){var E=t.prototype._captureStackTrace,S=t.prototype._attachExtraTrace,T=t.prototype._dereferenceTrace;pe.longStackTraces=!0,U=function(){if(n.haveItemsQueued()&&!pe.longStackTraces)throw new Error(`cannot enable long stack traces after promises have been created + + See http://goo.gl/MqrFmX +`);t.prototype._captureStackTrace=E,t.prototype._attachExtraTrace=S,t.prototype._dereferenceTrace=T,e.deactivateLongStackTraces(),pe.longStackTraces=!1},t.prototype._captureStackTrace=R,t.prototype._attachExtraTrace=k,t.prototype._dereferenceTrace=N,e.activateLongStackTraces()}},t.hasLongStackTraces=function(){return pe.longStackTraces&&Zo()};var H={unhandledrejection:{before:function(){var E=o.global.onunhandledrejection;return o.global.onunhandledrejection=null,E},after:function(E){o.global.onunhandledrejection=E}},rejectionhandled:{before:function(){var E=o.global.onrejectionhandled;return o.global.onrejectionhandled=null,E},after:function(E){o.global.onrejectionhandled=E}}},A=function(){var E=function(T,O){if(T){var $;try{return $=T.before(),!o.global.dispatchEvent(O)}finally{T.after($)}}else return!o.global.dispatchEvent(O)};try{if(typeof CustomEvent=="function"){var S=new CustomEvent("CustomEvent");return o.global.dispatchEvent(S),function(T,O){T=T.toLowerCase();var $={detail:O,cancelable:!0},Y=new CustomEvent(T,$);return a.defineProperty(Y,"promise",{value:O.promise}),a.defineProperty(Y,"reason",{value:O.reason}),E(H[T],Y)}}else if(typeof Event=="function"){var S=new Event("CustomEvent");return o.global.dispatchEvent(S),function(O,$){O=O.toLowerCase();var Y=new Event(O,{cancelable:!0});return Y.detail=$,a.defineProperty(Y,"promise",{value:$.promise}),a.defineProperty(Y,"reason",{value:$.reason}),E(H[O],Y)}}else{var S=document.createEvent("CustomEvent");return S.initCustomEvent("testingtheevent",!1,!0,{}),o.global.dispatchEvent(S),function(O,$){O=O.toLowerCase();var Y=document.createEvent("CustomEvent");return Y.initCustomEvent(O,!1,!0,$),E(H[O],Y)}}}catch{}return function(){return!1}}(),G=function(){return o.isNode?function(){return process.emit.apply(process,arguments)}:o.global?function(E){var S="on"+E.toLowerCase(),T=o.global[S];return T?(T.apply(o.global,[].slice.call(arguments,1)),!0):!1}:function(){return!1}}();function P(E,S){return{promise:S}}var J={promiseCreated:P,promiseFulfilled:P,promiseRejected:P,promiseResolved:P,promiseCancelled:P,promiseChained:function(E,S,T){return{promise:S,child:T}},warning:function(E,S){return{warning:S}},unhandledRejection:function(E,S,T){return{reason:S,promise:T}},rejectionHandled:P},b=function(E){var S=!1;try{S=G.apply(null,arguments)}catch(O){n.throwLater(O),S=!0}var T=!1;try{T=A(E,J[E].apply(null,arguments))}catch(O){n.throwLater(O),T=!0}return T||S};t.config=function(E){if(E=Object(E),"longStackTraces"in E&&(E.longStackTraces?t.longStackTraces():!E.longStackTraces&&t.hasLongStackTraces()&&U()),"warnings"in E){var S=E.warnings;pe.warnings=!!S,W=pe.warnings,o.isObject(S)&&"wForgottenReturn"in S&&(W=!!S.wForgottenReturn)}if("cancellation"in E&&E.cancellation&&!pe.cancellation){if(n.haveItemsQueued())throw new Error("cannot enable cancellation after promises are in use");t.prototype._clearCancellationData=g,t.prototype._propagateFrom=se,t.prototype._onCancel=M,t.prototype._setOnCancel=K,t.prototype._attachCancellationCallback=L,t.prototype._execute=j,he=se,pe.cancellation=!0}if("monitoring"in E&&(E.monitoring&&!pe.monitoring?(pe.monitoring=!0,t.prototype._fireEvent=b):!E.monitoring&&pe.monitoring&&(pe.monitoring=!1,t.prototype._fireEvent=D)),"asyncHooks"in E&&o.nodeSupportsAsyncResource){var T=pe.asyncHooks,O=!!E.asyncHooks;T!==O&&(pe.asyncHooks=O,O?r():i())}return t};function D(){return!1}t.prototype._fireEvent=D,t.prototype._execute=function(E,S,T){try{E(S,T)}catch(O){return O}},t.prototype._onCancel=function(){},t.prototype._setOnCancel=function(E){},t.prototype._attachCancellationCallback=function(E){},t.prototype._captureStackTrace=function(){},t.prototype._attachExtraTrace=function(){},t.prototype._dereferenceTrace=function(){},t.prototype._clearCancellationData=function(){},t.prototype._propagateFrom=function(E,S){};function j(E,S,T){var O=this;try{E(S,T,function($){if(typeof $!="function")throw new TypeError("onCancel must be a function, got: "+o.toString($));O._attachCancellationCallback($)})}catch($){return $}}function L(E){if(!this._isCancellable())return this;var S=this._onCancel();S!==void 0?o.isArray(S)?S.push(E):this._setOnCancel([S,E]):this._setOnCancel(E)}function M(){return this._onCancelField}function K(E){this._onCancelField=E}function g(){this._cancellationParent=void 0,this._onCancelField=void 0}function se(E,S){if((S&1)!==0){this._cancellationParent=E;var T=E._branchesRemainingToCancel;T===void 0&&(T=0),E._branchesRemainingToCancel=T+1}(S&2)!==0&&E._isBound()&&this._setBoundTo(E._boundTo)}function _e(E,S){(S&2)!==0&&E._isBound()&&this._setBoundTo(E._boundTo)}var he=_e;function v(){var E=this._boundTo;return E!==void 0&&E instanceof t?E.isFulfilled()?E.value():void 0:E}function R(){this._trace=new _r(this._peekContext())}function k(E,S){if(u(E)){var T=this._trace;if(T!==void 0&&S&&(T=T._parent),T!==void 0)T.attachExtraTrace(E);else if(!E.__stackCleaned__){var O=Br(E);o.notEnumerableProp(E,"stack",O.message+` +`+O.stack.join(` +`)),o.notEnumerableProp(E,"__stackCleaned__",!0)}}}function N(){this._trace=void 0}function B(E,S,T,O,$){if(E===void 0&&S!==null&&W){if($!==void 0&&$._returnedNonUndefined()||(O._bitField&65535)===0)return;T&&(T=T+" ");var Y="",ae="";if(S._trace){for(var V=S._trace.stack.split(` +`),de=Wt(V),ve=de.length-1;ve>=0;--ve){var kt=de[ve];if(!p.test(kt)){var Ft=kt.match(l);Ft&&(Y="at "+Ft[1]+":"+Ft[2]+":"+Ft[3]+" ");break}}if(de.length>0){for(var Jv=de[0],ve=0;ve0&&(ae=` +`+V[ve-1]);break}}}var eg="a promise was created in a "+T+"handler "+Y+"but was not returned from it, see http://goo.gl/rRqMUw"+ae;O._warn(eg,!0,S)}}function z(E,S){var T=E+" is deprecated and will be removed in a future version.";return S&&(T+=" Use "+S+" instead."),oe(T)}function oe(E,S,T){if(pe.warnings){var O=new s(E),$;if(S)T._attachExtraTrace(O);else if(pe.longStackTraces&&($=t._peekContext()))$.attachExtraTrace(O);else{var Y=Br(O);O.stack=Y.message+` +`+Y.stack.join(` +`)}b("warning",O)||al(O,"",!0)}}function qe(E,S){for(var T=0;T=0;--V)if(O[V]===Y){ae=V;break}for(var V=ae;V>=0;--V){var de=O[V];if(S[$]===de)S.pop(),$--;else break}S=O}}function Wt(E){for(var S=[],T=0;T0&&E.name!="SyntaxError"&&(S=S.slice(T)),S}function Br(E){var S=E.stack,T=E.toString();return S=typeof S=="string"&&S.length>0?mr(E):[" (No stack trace)"],{message:T,stack:E.name=="SyntaxError"?S:Wt(S)}}function al(E,S,T){if(typeof console<"u"){var O;if(o.isObject(E)){var $=E.stack;O=S+m($,E)}else O=S+String(E);typeof w=="function"?w(O,T):(typeof console.log=="function"||typeof console.log=="object")&&console.log(O)}}function ul(E,S,T,O){var $=!1;try{typeof S=="function"&&($=!0,E==="rejectionHandled"?S(O):S(T,O))}catch(Y){n.throwLater(Y)}E==="unhandledRejection"?!b(E,T,O)&&!$&&al(T,"Unhandled rejection "):b(E,O)}function cl(E){var S;if(typeof E=="function")S="[function "+(E.name||"anonymous")+"]";else{S=E&&typeof E.toString=="function"?E.toString():o.toString(E);var T=/\[object [a-zA-Z0-9$_]+\]/;if(T.test(S))try{var O=JSON.stringify(E);S=O}catch{}S.length===0&&(S="(empty array)")}return"(<"+Yv(S)+">, no stack trace)"}function Yv(E){var S=41;return E.length=Y||(Qo=function(kt){if(h.test(kt))return!0;var Ft=Jo(kt);return!!(Ft&&Ft.fileName===ae&&$<=Ft.line&&Ft.line<=Y)})}}function _r(E){this._parent=E,this._promisesCreated=0;var S=this._length=1+(E===void 0?0:E._length);ll(this,_r),S>32&&this.uncycle()}o.inherits(_r,Error),e.CapturedTrace=_r,_r.prototype.uncycle=function(){var E=this._length;if(!(E<2)){for(var S=[],T={},O=0,$=this;$!==void 0;++O)S.push($),$=$._parent;E=this._length=O;for(var O=E-1;O>=0;--O){var Y=S[O].stack;T[Y]===void 0&&(T[Y]=O)}for(var O=0;O0&&(S[V-1]._parent=void 0,S[V-1]._length=1),S[O]._parent=void 0,S[O]._length=1;var de=O>0?S[O-1]:this;V=0;--kt)S[kt]._length=ve,ve++;return}}}},_r.prototype.attachExtraTrace=function(E){if(!E.__stackCleaned__){this.uncycle();for(var S=Br(E),T=S.message,O=[S.stack],$=this;$!==void 0;)O.push(Wt($.stack.split(` +`))),$=$._parent;Pn(O),jr(O),o.notEnumerableProp(E,"stack",qe(T,O)),o.notEnumerableProp(E,"__stackCleaned__",!0)}};var ll=function(){var S=/^\s*at\s*/,T=function(ae,V){return typeof ae=="string"?ae:V.name!==void 0&&V.message!==void 0?V.toString():cl(V)};if(typeof Error.stackTraceLimit=="number"&&typeof Error.captureStackTrace=="function"){Error.stackTraceLimit+=6,d=S,m=T;var O=Error.captureStackTrace;return Qo=function(ae){return h.test(ae)},function(ae,V){Error.stackTraceLimit+=6,O(ae,V),Error.stackTraceLimit-=6}}var $=new Error;if(typeof $.stack=="string"&&$.stack.split(` +`)[0].indexOf("stackDetection@")>=0)return d=/@/,m=T,y=!0,function(V){V.stack=new Error().stack};var Y;try{throw new Error}catch(ae){Y="stack"in ae}return!("stack"in $)&&Y&&typeof Error.stackTraceLimit=="number"?(d=S,m=T,function(V){Error.stackTraceLimit+=6;try{throw new Error}catch(de){V.stack=de.stack}Error.stackTraceLimit-=6}):(m=function(ae,V){return typeof ae=="string"?ae:(typeof V=="object"||typeof V=="function")&&V.name!==void 0&&V.message!==void 0?V.toString():cl(V)},null)}([]);typeof console<"u"&&typeof console.warn<"u"&&(w=function(E){console.warn(E)},o.isNode&&process.stderr.isTTY?w=function(E,S){var T=S?"\x1B[33m":"\x1B[31m";console.warn(T+E+`\x1B[0m +`)}:!o.isNode&&typeof new Error().stack=="string"&&(w=function(E,S){console.warn("%c"+E,S?"color: darkorange":"color: red")}));var pe={warnings:C,longStackTraces:!1,cancellation:!1,monitoring:!1,asyncHooks:!1};return F&&t.longStackTraces(),{asyncHooks:function(){return pe.asyncHooks},longStackTraces:function(){return pe.longStackTraces},warnings:function(){return pe.warnings},cancellation:function(){return pe.cancellation},monitoring:function(){return pe.monitoring},propagateFromFunction:function(){return he},boundValueFunction:function(){return v},checkForgottenReturns:B,setBounds:Qv,warn:oe,deprecated:z,CapturedTrace:_r,fireDomEvent:A,fireGlobalEvent:G}}});var tu=_((cF,Zd)=>{"use strict";Zd.exports=function(t){var e=ue(),r=Yt().keys,i=e.tryCatch,n=e.errorObj;function s(o,a,u){return function(f){var c=u._boundValue();e:for(var h=0;h{"use strict";Qd.exports=function(t,e,r){var i=ue(),n=t.CancellationError,s=i.errorObj,o=tu()(r);function a(l,d,m){this.promise=l,this.type=d,this.handler=m,this.called=!1,this.cancelPromise=null}a.prototype.isFinallyHandler=function(){return this.type===0};function u(l){this.finallyHandler=l}u.prototype._resultCancelled=function(){f(this.finallyHandler)};function f(l,d){return l.cancelPromise!=null?(arguments.length>1?l.cancelPromise._reject(d):l.cancelPromise._cancel(),l.cancelPromise=null,!0):!1}function c(){return p.call(this,this.promise._target()._settledValue())}function h(l){if(!f(this,l))return s.e=l,s}function p(l){var d=this.promise,m=this.handler;if(!this.called){this.called=!0;var y=this.isFinallyHandler()?m.call(d._boundValue()):m.call(d._boundValue(),l);if(y===r)return y;if(y!==void 0){d._setReturnedNonUndefined();var w=e(y,d);if(w instanceof t){if(this.cancelPromise!=null)if(w._isCancelled()){var x=new n("late cancellation observer");return d._attachExtraTrace(x),s.e=x,s}else w.isPending()&&w._attachCancellationCallback(new u(this));return w._then(c,h,void 0,this,void 0)}}}return d.isRejected()?(f(this),s.e=l,s):(f(this),l)}return t.prototype._passThrough=function(l,d,m,y){return typeof l!="function"?this.then():this._then(m,y,void 0,new a(this,d,l),void 0)},t.prototype.lastly=t.prototype.finally=function(l){return this._passThrough(l,0,p,p)},t.prototype.tap=function(l){return this._passThrough(l,1,p)},t.prototype.tapCatch=function(l){var d=arguments.length;if(d===1)return this._passThrough(l,1,void 0,p);var m=new Array(d-1),y=0,w;for(w=0;w{"use strict";var ep=ue(),cS=ep.maybeWrapAsError,lS=qt(),fS=lS.OperationalError,tp=Yt();function hS(t){return t instanceof Error&&tp.getPrototypeOf(t)===Error.prototype}var dS=/^(?:name|message|stack|cause)$/;function pS(t){var e;if(hS(t)){e=new fS(t),e.name=t.name,e.message=t.message,e.stack=t.stack;for(var r=tp.keys(t),i=0;i{"use strict";ip.exports=function(t,e,r,i,n){var s=ue(),o=s.tryCatch;t.method=function(a){if(typeof a!="function")throw new t.TypeError("expecting a function but got "+s.classString(a));return function(){var u=new t(e);u._captureStackTrace(),u._pushContext();var f=o(a).apply(this,arguments),c=u._popContext();return n.checkForgottenReturns(f,c,"Promise.method",u),u._resolveFromSyncValue(f),u}},t.attempt=t.try=function(a){if(typeof a!="function")return i("expecting a function but got "+s.classString(a));var u=new t(e);u._captureStackTrace(),u._pushContext();var f;if(arguments.length>1){n.deprecated("calling Promise.try with more than 1 argument");var c=arguments[1],h=arguments[2];f=s.isArray(c)?o(a).apply(h,c):o(a).call(h,c)}else f=o(a)();var p=u._popContext();return n.checkForgottenReturns(f,p,"Promise.try",u),u._resolveFromSyncValue(f),u},t.prototype._resolveFromSyncValue=function(a){a===s.errorObj?this._rejectCallback(a.e,!1):this._resolveCallback(a,!0)}}});var op=_((dF,sp)=>{"use strict";sp.exports=function(t,e,r,i){var n=!1,s=function(f,c){this._reject(c)},o=function(f,c){c.promiseRejectionQueued=!0,c.bindingPromise._then(s,s,null,this,f)},a=function(f,c){(this._bitField&50397184)===0&&this._resolveCallback(c.target)},u=function(f,c){c.promiseRejectionQueued||this._reject(f)};t.prototype.bind=function(f){n||(n=!0,t.prototype._propagateFrom=i.propagateFromFunction(),t.prototype._boundValue=i.boundValueFunction());var c=r(f),h=new t(e);h._propagateFrom(this,1);var p=this._target();if(h._setBoundTo(c),c instanceof t){var l={promiseRejectionQueued:!1,promise:h,target:p,bindingPromise:c};p._then(e,o,void 0,h,l),c._then(a,u,void 0,h,l),h._setOnCancel(c)}else h._resolveCallback(p);return h},t.prototype._setBoundTo=function(f){f!==void 0?(this._bitField=this._bitField|2097152,this._boundTo=f):this._bitField=this._bitField&-2097153},t.prototype._isBound=function(){return(this._bitField&2097152)===2097152},t.bind=function(f,c){return t.resolve(c).bind(f)}}});var up=_((pF,ap)=>{"use strict";ap.exports=function(t,e,r,i){var n=ue(),s=n.tryCatch,o=n.errorObj,a=t._async;t.prototype.break=t.prototype.cancel=function(){if(!i.cancellation())return this._warn("cancellation is disabled");for(var u=this,f=u;u._isCancellable();){if(!u._cancelBy(f)){f._isFollowing()?f._followee().cancel():f._cancelBranched();break}var c=u._cancellationParent;if(c==null||!c._isCancellable()){u._isFollowing()?u._followee().cancel():u._cancelBranched();break}else u._isFollowing()&&u._followee().cancel(),u._setWillBeCancelled(),f=u,u=c}},t.prototype._branchHasCancelled=function(){this._branchesRemainingToCancel--},t.prototype._enoughBranchesHaveCancelled=function(){return this._branchesRemainingToCancel===void 0||this._branchesRemainingToCancel<=0},t.prototype._cancelBy=function(u){return u===this?(this._branchesRemainingToCancel=0,this._invokeOnCancel(),!0):(this._branchHasCancelled(),this._enoughBranchesHaveCancelled()?(this._invokeOnCancel(),!0):!1)},t.prototype._cancelBranched=function(){this._enoughBranchesHaveCancelled()&&this._cancel()},t.prototype._cancel=function(){this._isCancellable()&&(this._setCancelled(),a.invoke(this._cancelPromises,this,void 0))},t.prototype._cancelPromises=function(){this._length()>0&&this._settlePromises()},t.prototype._unsetOnCancel=function(){this._onCancelField=void 0},t.prototype._isCancellable=function(){return this.isPending()&&!this._isCancelled()},t.prototype.isCancellable=function(){return this.isPending()&&!this.isCancelled()},t.prototype._doInvokeOnCancel=function(u,f){if(n.isArray(u))for(var c=0;c{"use strict";cp.exports=function(t){function e(){return this.value}function r(){throw this.reason}t.prototype.return=t.prototype.thenReturn=function(i){return i instanceof t&&i.suppressUnhandledRejections(),this._then(e,void 0,void 0,{value:i},void 0)},t.prototype.throw=t.prototype.thenThrow=function(i){return this._then(r,void 0,void 0,{reason:i},void 0)},t.prototype.catchThrow=function(i){if(arguments.length<=1)return this._then(void 0,r,void 0,{reason:i},void 0);var n=arguments[1],s=function(){throw n};return this.caught(i,s)},t.prototype.catchReturn=function(i){if(arguments.length<=1)return i instanceof t&&i.suppressUnhandledRejections(),this._then(void 0,e,void 0,{value:i},void 0);var n=arguments[1];n instanceof t&&n.suppressUnhandledRejections();var s=function(){return n};return this.caught(i,s)}}});var hp=_((_F,fp)=>{"use strict";fp.exports=function(t){function e(u){u!==void 0?(u=u._target(),this._bitField=u._bitField,this._settledValueField=u._isFateSealed()?u._settledValue():void 0):(this._bitField=0,this._settledValueField=void 0)}e.prototype._settledValue=function(){return this._settledValueField};var r=e.prototype.value=function(){if(!this.isFulfilled())throw new TypeError(`cannot get fulfillment value of a non-fulfilled promise + + See http://goo.gl/MqrFmX +`);return this._settledValue()},i=e.prototype.error=e.prototype.reason=function(){if(!this.isRejected())throw new TypeError(`cannot get rejection reason of a non-rejected promise + + See http://goo.gl/MqrFmX +`);return this._settledValue()},n=e.prototype.isFulfilled=function(){return(this._bitField&33554432)!==0},s=e.prototype.isRejected=function(){return(this._bitField&16777216)!==0},o=e.prototype.isPending=function(){return(this._bitField&50397184)===0},a=e.prototype.isResolved=function(){return(this._bitField&50331648)!==0};e.prototype.isCancelled=function(){return(this._bitField&8454144)!==0},t.prototype.__isCancelled=function(){return(this._bitField&65536)===65536},t.prototype._isCancelled=function(){return this._target().__isCancelled()},t.prototype.isCancelled=function(){return(this._target()._bitField&8454144)!==0},t.prototype.isPending=function(){return o.call(this._target())},t.prototype.isRejected=function(){return s.call(this._target())},t.prototype.isFulfilled=function(){return n.call(this._target())},t.prototype.isResolved=function(){return a.call(this._target())},t.prototype.value=function(){return r.call(this._target())},t.prototype.reason=function(){var u=this._target();return u._unsetRejectionIsUnhandled(),i.call(u)},t.prototype._value=function(){return this._settledValue()},t.prototype._reason=function(){return this._unsetRejectionIsUnhandled(),this._settledValue()},t.PromiseInspection=e}});var pp=_((yF,dp)=>{"use strict";dp.exports=function(t,e,r,i,n){var s=ue(),o=s.canEvaluate,a=s.tryCatch,u=s.errorObj,f;if(o){for(var c=function(w){return new Function("value","holder",` + 'use strict'; + holder.pIndex = value; + holder.checkFulfillment(this); + `.replace(/Index/g,w))},h=function(w){return new Function("promise","holder",` + 'use strict'; + holder.pIndex = promise; + `.replace(/Index/g,w))},p=function(w){for(var x=new Array(w),C=0;C0&&typeof arguments[w]=="function"&&(x=arguments[w],w<=8&&o)){var b=new t(i);b._captureStackTrace();for(var C=l[w-1],F=new C(x),W=d,re=0;re{"use strict";var iu=Object.create;iu&&(nu=iu(null),su=iu(null),nu[" size"]=su[" size"]=0);var nu,su;mp.exports=function(t){var e=ue(),r=e.canEvaluate,i=e.isIdentifier,n,s,o=function(l){return new Function("ensureMethod",` + return function(obj) { + 'use strict' + var len = this.length; + ensureMethod(obj, 'methodName'); + switch(len) { + case 1: return obj.methodName(this[0]); + case 2: return obj.methodName(this[0], this[1]); + case 3: return obj.methodName(this[0], this[1], this[2]); + case 0: return obj.methodName(); + default: + return obj.methodName.apply(obj, this); + } + }; + `.replace(/methodName/g,l))(f)},a=function(l){return new Function("obj",` + 'use strict'; + return obj.propertyName; + `.replace("propertyName",l))},u=function(l,d,m){var y=m[l];if(typeof y!="function"){if(!i(l))return null;if(y=d(l),m[l]=y,m[" size"]++,m[" size"]>512){for(var w=Object.keys(m),x=0;x<256;++x)delete m[w[x]];m[" size"]=w.length-256}}return y};n=function(l){return u(l,o,nu)},s=function(l){return u(l,a,su)};function f(l,d){var m;if(l!=null&&(m=l[d]),typeof m!="function"){var y="Object "+e.classString(l)+" has no method '"+e.toString(d)+"'";throw new t.TypeError(y)}return m}function c(l){var d=this.pop(),m=f(l,d);return m.apply(l,this)}t.prototype.call=function(l){for(var d=arguments.length,m=new Array(Math.max(d-1,0)),y=1;y{"use strict";yp.exports=function(t,e,r,i,n,s){var o=qt(),a=o.TypeError,u=ue(),f=u.errorObj,c=u.tryCatch,h=[];function p(d,m,y){for(var w=0;w{"use strict";gp.exports=function(t,e,r,i,n,s){var o=ue(),a=o.tryCatch,u=o.errorObj,f=t._async;function c(p,l,d,m){this.constructor$(p),this._promise._captureStackTrace();var y=t._getContext();if(this._callback=o.contextBind(y,l),this._preservedValues=m===n?new Array(this.length()):null,this._limit=d,this._inFlight=0,this._queue=[],f.invoke(this._asyncInit,this,void 0),o.isArray(p))for(var w=0;w=1&&(this._inFlight--,this._drainQueue(),this._isResolved()))return!0}else{if(w>=1&&this._inFlight>=w)return d[l]=p,this._queue.push(l),!1;y!==null&&(y[l]=p);var x=this._promise,C=this._callback,F=x._boundValue();x._pushContext();var W=a(C).call(F,p,l,m),re=x._popContext();if(s.checkForgottenReturns(W,re,y!==null?"Promise.filter":"Promise.map",x),W===u)return this._reject(W.e),!0;var U=i(W,this._promise);if(U instanceof t){U=U._target();var H=U._bitField;if((H&50397184)===0)return w>=1&&this._inFlight++,d[l]=U,U._proxy(this,(l+1)*-1),!1;if((H&33554432)!==0)W=U._value();else return(H&16777216)!==0?(this._reject(U._reason()),!0):(this._cancel(),!0)}d[l]=W}var A=++this._totalResolved;return A>=m?(y!==null?this._filter(d,y):this._resolve(d),!0):!1},c.prototype._drainQueue=function(){for(var p=this._queue,l=this._limit,d=this._values;p.length>0&&this._inFlight=1?y:0,new c(p,l,y,m).promise()}t.prototype.map=function(p,l){return h(this,p,l,null)},t.map=function(p,l,d,m){return h(p,l,d,m)}}});var Sp=_((EF,Ep)=>{"use strict";Ep.exports=function(t){var e=ue(),r=t._async,i=e.tryCatch,n=e.errorObj;function s(u,f){var c=this;if(!e.isArray(u))return o.call(c,u,f);var h=i(f).apply(c._boundValue(),[null].concat(u));h===n&&r.throwLater(h.e)}function o(u,f){var c=this,h=c._boundValue(),p=u===void 0?i(f).call(h,null):i(f).call(h,null,u);p===n&&r.throwLater(p.e)}function a(u,f){var c=this;if(!u){var h=new Error(u+"");h.cause=u,u=h}var p=i(f).call(c._boundValue(),u);p===n&&r.throwLater(p.e)}t.prototype.asCallback=t.prototype.nodeify=function(u,f){if(typeof u=="function"){var c=o;f!==void 0&&Object(f).spread&&(c=s),this._then(c,a,void 0,this,u)}return this}}});var Rp=_((SF,bp)=>{"use strict";bp.exports=function(t,e){var r={},i=ue(),n=ru(),s=i.withAppended,o=i.maybeWrapAsError,a=i.canEvaluate,u=qt().TypeError,f="Async",c={__isPromisified__:!0},h=["arity","length","name","arguments","caller","callee","prototype","__isPromisified__"],p=new RegExp("^(?:"+h.join("|")+")$"),l=function(b){return i.isIdentifier(b)&&b.charAt(0)!=="_"&&b!=="constructor"};function d(b){return!p.test(b)}function m(b){try{return b.__isPromisified__===!0}catch{return!1}}function y(b,D,j){var L=i.getDataPropertyOrDefault(b,D+j,c);return L?m(L):!1}function w(b,D,j){for(var L=0;L=j;--L)D.push(L);for(var L=b+1;L<=3;++L)D.push(L);return D},re=function(b){return i.filledRange(b,"_arg","")},U=function(b){return i.filledRange(Math.max(b,3),"_arg","")},H=function(b){return typeof b.length=="number"?Math.max(Math.min(b.length,1024),0):0};F=function(b,D,j,L,M,K){var g=Math.max(0,H(L)-1),se=W(g),_e=typeof b=="string"||D===r;function he(N){var B=re(N).join(", "),z=N>0?", ":"",oe;return _e?oe=`ret = callback.call(this, {{args}}, nodeback); break; +`:oe=D===void 0?`ret = callback({{args}}, nodeback); break; +`:`ret = callback.call(receiver, {{args}}, nodeback); break; +`,oe.replace("{{args}}",B).replace(", ",z)}function v(){for(var N="",B=0;B{"use strict";Op.exports=function(t,e,r,i){var n=ue(),s=n.isObject,o=Yt(),a;typeof Map=="function"&&(a=Map);var u=function(){var p=0,l=0;function d(m,y){this[p]=m,this[p+l]=y,p++}return function(y){l=y.size,p=0;var w=new Array(y.size*2);return y.forEach(d,w),w}}(),f=function(p){for(var l=new a,d=p.length/2|0,m=0;m=this._length){var m;if(this._isMap)m=f(this._values);else{m={};for(var y=this.length(),w=0,x=this.length();w>1};function h(p){var l,d=r(p);if(s(d))d instanceof t?l=d._then(t.props,void 0,void 0,void 0,void 0):l=new c(d).promise();else return i(`cannot await properties of a non-object + + See http://goo.gl/MqrFmX +`);return d instanceof t&&l._propagateFrom(d,2),l}t.prototype.props=function(){return h(this)},t.props=function(p){return h(p)}}});var xp=_((RF,Cp)=>{"use strict";Cp.exports=function(t,e,r,i){var n=ue(),s=function(a){return a.then(function(u){return o(u,a)})};function o(a,u){var f=r(a);if(f instanceof t)return s(f);if(a=n.asArray(a),a===null)return i("expecting an array or an iterable object but got "+n.classString(a));var c=new t(e);u!==void 0&&c._propagateFrom(u,3);for(var h=c._fulfill,p=c._reject,l=0,d=a.length;l{"use strict";kp.exports=function(t,e,r,i,n,s){var o=ue(),a=o.tryCatch;function u(l,d,m,y){this.constructor$(l);var w=t._getContext();this._fn=o.contextBind(w,d),m!==void 0&&(m=t.resolve(m),m._attachCancellationCallback(this)),this._initialValue=m,this._currentCancellable=null,y===n?this._eachValues=Array(this._length):y===0?this._eachValues=null:this._eachValues=void 0,this._promise._captureStackTrace(),this._init$(void 0,-5)}o.inherits(u,e),u.prototype._gotAccum=function(l){this._eachValues!==void 0&&this._eachValues!==null&&l!==n&&this._eachValues.push(l)},u.prototype._eachComplete=function(l){return this._eachValues!==null&&this._eachValues.push(l),this._eachValues},u.prototype._init=function(){},u.prototype._resolveEmptyArray=function(){this._resolve(this._eachValues!==void 0?this._eachValues:this._initialValue)},u.prototype.shouldCopyValues=function(){return!1},u.prototype._resolve=function(l){this._promise._resolveCallback(l),this._values=null},u.prototype._resultCancelled=function(l){if(l===this._initialValue)return this._cancel();this._isResolved()||(this._resultCancelled$(),this._currentCancellable instanceof t&&this._currentCancellable.cancel(),this._initialValue instanceof t&&this._initialValue.cancel())},u.prototype._iterate=function(l){this._values=l;var d,m,y=l.length;this._initialValue!==void 0?(d=this._initialValue,m=0):(d=t.resolve(l[0]),m=1),this._currentCancellable=d;for(var w=m;w{"use strict";Ap.exports=function(t,e,r){var i=t.PromiseInspection,n=ue();function s(o){this.constructor$(o)}n.inherits(s,e),s.prototype._promiseResolved=function(o,a){this._values[o]=a;var u=++this._totalResolved;return u>=this._length?(this._resolve(this._values),!0):!1},s.prototype._promiseFulfilled=function(o,a){var u=new i;return u._bitField=33554432,u._settledValueField=o,this._promiseResolved(a,u)},s.prototype._promiseRejected=function(o,a){var u=new i;return u._bitField=16777216,u._settledValueField=o,this._promiseResolved(a,u)},t.settle=function(o){return r.deprecated(".settle()",".reflect()"),new s(o).promise()},t.allSettled=function(o){return new s(o).promise()},t.prototype.settle=function(){return t.settle(this)}}});var Lp=_((CF,Dp)=>{"use strict";Dp.exports=function(t,e,r){var i=ue(),n=qt().RangeError,s=qt().AggregateError,o=i.isArray,a={};function u(c){this.constructor$(c),this._howMany=0,this._unwrap=!1,this._initialized=!1}i.inherits(u,e),u.prototype._init=function(){if(this._initialized){if(this._howMany===0){this._resolve([]);return}this._init$(void 0,-5);var c=o(this._values);!this._isResolved()&&c&&this._howMany>this._canPossiblyFulfill()&&this._reject(this._getRangeError(this.length()))}},u.prototype.init=function(){this._initialized=!0,this._init()},u.prototype.setUnwrap=function(){this._unwrap=!0},u.prototype.howMany=function(){return this._howMany},u.prototype.setHowMany=function(c){this._howMany=c},u.prototype._promiseFulfilled=function(c){return this._addFulfilled(c),this._fulfilled()===this.howMany()?(this._values.length=this.howMany(),this.howMany()===1&&this._unwrap?this._resolve(this._values[0]):this._resolve(this._values),!0):!1},u.prototype._promiseRejected=function(c){return this._addRejected(c),this._checkOutcome()},u.prototype._promiseCancelled=function(){return this._values instanceof t||this._values==null?this._cancel():(this._addRejected(a),this._checkOutcome())},u.prototype._checkOutcome=function(){if(this.howMany()>this._canPossiblyFulfill()){for(var c=new s,h=this.length();h0?this._reject(c):this._cancel(),!0}return!1},u.prototype._fulfilled=function(){return this._totalResolved},u.prototype._rejected=function(){return this._values.length-this.length()},u.prototype._addRejected=function(c){this._values.push(c)},u.prototype._addFulfilled=function(c){this._values[this._totalResolved++]=c},u.prototype._canPossiblyFulfill=function(){return this.length()-this._rejected()},u.prototype._getRangeError=function(c){var h="Input array must contain at least "+this._howMany+" items but contains only "+c+" items";return new n(h)},u.prototype._resolveEmptyArray=function(){this._reject(this._getRangeError(0))};function f(c,h){if((h|0)!==h||h<0)return r(`expecting a positive integer + + See http://goo.gl/MqrFmX +`);var p=new u(c),l=p.promise();return p.setHowMany(h),p.init(),l}t.some=function(c,h){return f(c,h)},t.prototype.some=function(c){return f(this,c)},t._SomePromiseArray=u}});var qp=_((xF,Ip)=>{"use strict";Ip.exports=function(t,e,r){var i=ue(),n=t.TimeoutError;function s(h){this.handle=h}s.prototype._resultCancelled=function(){clearTimeout(this.handle)};var o=function(h){return a(+this).thenReturn(h)},a=t.delay=function(h,p){var l,d;return p!==void 0?(l=t.resolve(p)._then(o,null,null,h,void 0),r.cancellation()&&p instanceof t&&l._setOnCancel(p)):(l=new t(e),d=setTimeout(function(){l._fulfill()},+h),r.cancellation()&&l._setOnCancel(new s(d)),l._captureStackTrace()),l._setAsyncGuaranteed(),l};t.prototype.delay=function(h){return a(h,this)};var u=function(h,p,l){var d;typeof p!="string"?p instanceof Error?d=p:d=new n("operation timed out"):d=new n(p),i.markAsOriginatingFromRejection(d),h._attachExtraTrace(d),h._reject(d),l?.cancel()};function f(h){return clearTimeout(this.handle),h}function c(h){throw clearTimeout(this.handle),h}t.prototype.timeout=function(h,p){h=+h;var l,d,m=new s(setTimeout(function(){l.isPending()&&u(l,p,d)},h));return r.cancellation()?(d=this.then(),l=d._then(f,c,void 0,m,void 0),l._setOnCancel(m)):l=this._then(f,c,void 0,m,void 0),l}}});var Mp=_((kF,Pp)=>{"use strict";Pp.exports=function(t,e,r,i,n,s){var o=ue(),a=qt().TypeError,u=ue().inherits,f=o.errorObj,c=o.tryCatch,h={};function p(C){setTimeout(function(){throw C},0)}function l(C){var F=r(C);return F!==C&&typeof C._isDisposable=="function"&&typeof C._getDisposer=="function"&&C._isDisposable()&&F._setDisposable(C._getDisposer()),F}function d(C,F){var W=0,re=C.length,U=new t(n);function H(){if(W>=re)return U._fulfill();var A=l(C[W++]);if(A instanceof t&&A._isDisposable()){try{A=r(A._getDisposer().tryDispose(F),C.promise)}catch(G){return p(G)}if(A instanceof t)return A._then(H,p,null,null,null)}H()}return H(),U}function m(C,F,W){this._data=C,this._promise=F,this._context=W}m.prototype.data=function(){return this._data},m.prototype.promise=function(){return this._promise},m.prototype.resource=function(){return this.promise().isFulfilled()?this.promise().value():h},m.prototype.tryDispose=function(C){var F=this.resource(),W=this._context;W!==void 0&&W._pushContext();var re=F!==h?this.doDispose(F,C):null;return W!==void 0&&W._popContext(),this._promise._unsetDisposable(),this._data=null,re},m.isDisposer=function(C){return C!=null&&typeof C.resource=="function"&&typeof C.tryDispose=="function"};function y(C,F,W){this.constructor$(C,F,W)}u(y,m),y.prototype.doDispose=function(C,F){var W=this.data();return W.call(C,C,F)};function w(C){return m.isDisposer(C)?(this.resources[this.index]._setDisposable(C),C.promise()):C}function x(C){this.length=C,this.promise=null,this[C-1]=null}x.prototype._resultCancelled=function(){for(var C=this.length,F=0;F0},t.prototype._getDisposer=function(){return this._disposer},t.prototype._unsetDisposable=function(){this._bitField=this._bitField&-131073,this._disposer=void 0},t.prototype.disposer=function(C){if(typeof C=="function")return new y(C,this,i());throw new a}}});var Bp=_((FF,jp)=>{"use strict";jp.exports=function(t){var e=t._SomePromiseArray;function r(i){var n=new e(i),s=n.promise();return n.setHowMany(1),n.setUnwrap(),n.init(),s}t.any=function(i){return r(i)},t.prototype.any=function(){return r(this)}}});var Up=_((AF,$p)=>{"use strict";$p.exports=function(t,e){var r=t.reduce,i=t.all;function n(){return i(this)}function s(o,a){return r(o,a,e,e)}t.prototype.each=function(o){return r(this,o,e,0)._then(n,void 0,void 0,this,void 0)},t.prototype.mapSeries=function(o){return r(this,o,e,e)},t.each=function(o,a){return r(o,a,e,0)._then(n,void 0,void 0,o,void 0)},t.mapSeries=s}});var Wp=_((NF,zp)=>{"use strict";zp.exports=function(t,e){var r=t.map;t.prototype.filter=function(i,n){return r(this,i,n,e)},t.filter=function(i,n,s){return r(i,n,s,e)}}});var Hp=_((DF,ou)=>{"use strict";ou.exports=function(){var t=function(){return new x(`circular promise resolution chain + + See http://goo.gl/MqrFmX +`)},e=function(){return new g.PromiseInspection(this._target())},r=function(v){return g.reject(new x(v))};function i(){}var n={},s=ue();s.setReflectHandler(e);var o=function(){var v=process.domain;return v===void 0?null:v},a=function(){return null},u=function(){return{domain:o(),async:null}},f=s.isNode&&s.nodeSupportsAsyncResource?require("async_hooks").AsyncResource:null,c=function(){return{domain:o(),async:new f("Bluebird::Promise")}},h=s.isNode?u:a;s.notEnumerableProp(g,"_getContext",h);var p=function(){h=c,s.notEnumerableProp(g,"_getContext",c)},l=function(){h=u,s.notEnumerableProp(g,"_getContext",u)},d=Yt(),m=jd(),y=new m;d.defineProperty(g,"_async",{value:y});var w=qt(),x=g.TypeError=w.TypeError;g.RangeError=w.RangeError;var C=g.CancellationError=w.CancellationError;g.TimeoutError=w.TimeoutError,g.OperationalError=w.OperationalError,g.RejectionError=w.OperationalError,g.AggregateError=w.AggregateError;var F=function(){},W={},re={},U=Wd()(g,F),H=Gd()(g,F,U,r,i),A=Xd()(g),G=A.create,P=Yd()(g,A,p,l),J=P.CapturedTrace,b=Jd()(g,U,re),D=tu()(re),j=ru(),L=s.errorObj,M=s.tryCatch;function K(v,R){if(v==null||v.constructor!==g)throw new x(`the promise constructor cannot be invoked directly + + See http://goo.gl/MqrFmX +`);if(typeof R!="function")throw new x("expecting a function but got "+s.classString(R))}function g(v){v!==F&&K(this,v),this._bitField=0,this._fulfillmentHandler0=void 0,this._rejectionHandler0=void 0,this._promise0=void 0,this._receiver0=void 0,this._resolveFromExecutor(v),this._promiseCreated(),this._fireEvent("promiseCreated",this)}g.prototype.toString=function(){return"[object Promise]"},g.prototype.caught=g.prototype.catch=function(v){var R=arguments.length;if(R>1){var k=new Array(R-1),N=0,B;for(B=0;B0&&typeof v!="function"&&typeof R!="function"){var k=".then() only accepts functions but was passed: "+s.classString(v);arguments.length>1&&(k+=", "+s.classString(R)),this._warn(k)}return this._then(v,R,void 0,void 0,void 0)},g.prototype.done=function(v,R){var k=this._then(v,R,void 0,void 0,void 0);k._setIsFinal()},g.prototype.spread=function(v){return typeof v!="function"?r("expecting a function but got "+s.classString(v)):this.all()._then(v,void 0,void 0,W,void 0)},g.prototype.toJSON=function(){var v={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};return this.isFulfilled()?(v.fulfillmentValue=this.value(),v.isFulfilled=!0):this.isRejected()&&(v.rejectionReason=this.reason(),v.isRejected=!0),v},g.prototype.all=function(){return arguments.length>0&&this._warn(".all() was passed arguments but it does not take any"),new H(this).promise()},g.prototype.error=function(v){return this.caught(s.originatesFromRejection,v)},g.getNewLibraryCopy=ou.exports,g.is=function(v){return v instanceof g},g.fromNode=g.fromCallback=function(v){var R=new g(F);R._captureStackTrace();var k=arguments.length>1?!!Object(arguments[1]).multiArgs:!1,N=M(v)(j(R,k));return N===L&&R._rejectCallback(N.e,!0),R._isFateSealed()||R._setAsyncGuaranteed(),R},g.all=function(v){return new H(v).promise()},g.cast=function(v){var R=U(v);return R instanceof g||(R=new g(F),R._captureStackTrace(),R._setFulfilled(),R._rejectionHandler0=v),R},g.resolve=g.fulfilled=g.cast,g.reject=g.rejected=function(v){var R=new g(F);return R._captureStackTrace(),R._rejectCallback(v,!0),R},g.setScheduler=function(v){if(typeof v!="function")throw new x("expecting a function but got "+s.classString(v));return y.setScheduler(v)},g.prototype._then=function(v,R,k,N,B){var z=B!==void 0,oe=z?B:new g(F),qe=this._target(),jr=qe._bitField;z||(oe._propagateFrom(this,3),oe._captureStackTrace(),N===void 0&&(this._bitField&2097152)!==0&&((jr&50397184)!==0?N=this._boundValue():N=qe===this?void 0:this._boundTo),this._fireEvent("promiseChained",this,oe));var Pn=h();if((jr&50397184)!==0){var Wt,mr,Br=qe._settlePromiseCtx;(jr&33554432)!==0?(mr=qe._rejectionHandler0,Wt=v):(jr&16777216)!==0?(mr=qe._fulfillmentHandler0,Wt=R,qe._unsetRejectionIsUnhandled()):(Br=qe._settlePromiseLateCancellationObserver,mr=new C("late cancellation observer"),qe._attachExtraTrace(mr),Wt=R),y.invoke(Br,qe,{handler:s.contextBind(Pn,Wt),promise:oe,receiver:N,value:mr})}else qe._addCallbacks(v,R,oe,N,Pn);return oe},g.prototype._length=function(){return this._bitField&65535},g.prototype._isFateSealed=function(){return(this._bitField&117506048)!==0},g.prototype._isFollowing=function(){return(this._bitField&67108864)===67108864},g.prototype._setLength=function(v){this._bitField=this._bitField&-65536|v&65535},g.prototype._setFulfilled=function(){this._bitField=this._bitField|33554432,this._fireEvent("promiseFulfilled",this)},g.prototype._setRejected=function(){this._bitField=this._bitField|16777216,this._fireEvent("promiseRejected",this)},g.prototype._setFollowing=function(){this._bitField=this._bitField|67108864,this._fireEvent("promiseResolved",this)},g.prototype._setIsFinal=function(){this._bitField=this._bitField|4194304},g.prototype._isFinal=function(){return(this._bitField&4194304)>0},g.prototype._unsetCancelled=function(){this._bitField=this._bitField&-65537},g.prototype._setCancelled=function(){this._bitField=this._bitField|65536,this._fireEvent("promiseCancelled",this)},g.prototype._setWillBeCancelled=function(){this._bitField=this._bitField|8388608},g.prototype._setAsyncGuaranteed=function(){if(!y.hasCustomScheduler()){var v=this._bitField;this._bitField=v|(v&536870912)>>2^134217728}},g.prototype._setNoAsyncGuarantee=function(){this._bitField=(this._bitField|536870912)&-134217729},g.prototype._receiverAt=function(v){var R=v===0?this._receiver0:this[v*4-4+3];if(R!==n)return R===void 0&&this._isBound()?this._boundValue():R},g.prototype._promiseAt=function(v){return this[v*4-4+2]},g.prototype._fulfillmentHandlerAt=function(v){return this[v*4-4+0]},g.prototype._rejectionHandlerAt=function(v){return this[v*4-4+1]},g.prototype._boundValue=function(){},g.prototype._migrateCallback0=function(v){var R=v._bitField,k=v._fulfillmentHandler0,N=v._rejectionHandler0,B=v._promise0,z=v._receiverAt(0);z===void 0&&(z=n),this._addCallbacks(k,N,B,z,null)},g.prototype._migrateCallbackAt=function(v,R){var k=v._fulfillmentHandlerAt(R),N=v._rejectionHandlerAt(R),B=v._promiseAt(R),z=v._receiverAt(R);z===void 0&&(z=n),this._addCallbacks(k,N,B,z,null)},g.prototype._addCallbacks=function(v,R,k,N,B){var z=this._length();if(z>=65531&&(z=0,this._setLength(0)),z===0)this._promise0=k,this._receiver0=N,typeof v=="function"&&(this._fulfillmentHandler0=s.contextBind(B,v)),typeof R=="function"&&(this._rejectionHandler0=s.contextBind(B,R));else{var oe=z*4-4;this[oe+2]=k,this[oe+3]=N,typeof v=="function"&&(this[oe+0]=s.contextBind(B,v)),typeof R=="function"&&(this[oe+1]=s.contextBind(B,R))}return this._setLength(z+1),z},g.prototype._proxy=function(v,R){this._addCallbacks(void 0,void 0,R,v,null)},g.prototype._resolveCallback=function(v,R){if((this._bitField&117506048)===0){if(v===this)return this._rejectCallback(t(),!1);var k=U(v,this);if(!(k instanceof g))return this._fulfill(v);R&&this._propagateFrom(k,2);var N=k._target();if(N===this){this._reject(t());return}var B=N._bitField;if((B&50397184)===0){var z=this._length();z>0&&N._migrateCallback0(this);for(var oe=1;oe>>16)){if(v===this){var k=t();return this._attachExtraTrace(k),this._reject(k)}this._setFulfilled(),this._rejectionHandler0=v,(R&65535)>0&&((R&134217728)!==0?this._settlePromises():y.settlePromises(this),this._dereferenceTrace())}},g.prototype._reject=function(v){var R=this._bitField;if(!((R&117506048)>>>16)){if(this._setRejected(),this._fulfillmentHandler0=v,this._isFinal())return y.fatalError(v,s.isNode);(R&65535)>0?y.settlePromises(this):this._ensurePossibleRejectionHandled()}},g.prototype._fulfillPromises=function(v,R){for(var k=1;k0){if((v&16842752)!==0){var k=this._fulfillmentHandler0;this._settlePromise0(this._rejectionHandler0,k,v),this._rejectPromises(R,k)}else{var N=this._rejectionHandler0;this._settlePromise0(this._fulfillmentHandler0,N,v),this._fulfillPromises(R,N)}this._setLength(0)}this._clearCancellationData()},g.prototype._settledValue=function(){var v=this._bitField;if((v&33554432)!==0)return this._rejectionHandler0;if((v&16777216)!==0)return this._fulfillmentHandler0},typeof Symbol<"u"&&Symbol.toStringTag&&d.defineProperty(g.prototype,Symbol.toStringTag,{get:function(){return"Object"}});function se(v){this.promise._resolveCallback(v)}function _e(v){this.promise._rejectCallback(v,!1)}g.defer=g.pending=function(){P.deprecated("Promise.defer","new Promise");var v=new g(F);return{promise:v,resolve:se,reject:_e}},s.notEnumerableProp(g,"_makeSelfResolutionError",t),np()(g,F,U,r,P),op()(g,F,U,P),up()(g,H,r,P),lp()(g),hp()(g),pp()(g,H,U,F,y),g.Promise=g,g.version="3.7.2",_p()(g),vp()(g,r,F,U,i,P),wp()(g,H,r,U,F,P),Sp()(g),Rp()(g,F),Tp()(g,H,U,r),xp()(g,F,U,r),Fp()(g,H,r,U,F,P),Np()(g,H,P),Lp()(g,H,r),qp()(g,F,P),Mp()(g,r,U,G,F,P),Bp()(g),Up()(g,F),Wp()(g,F),s.toFastProperties(g),s.toFastProperties(g.prototype);function he(v){var R=new g(F);R._fulfillmentHandler0=v,R._rejectionHandler0=v,R._promise0=v,R._receiver0=v}return he({a:1}),he({b:2}),he({c:3}),he(1),he(function(){}),he(void 0),he(!1),he(new g(F)),P.setBounds(m.firstLineError,s.lastLineError),g}});var Xp=_((LF,Vp)=>{"use strict";var Gp;typeof Promise<"u"&&(Gp=Promise);function _S(){try{Promise===_s&&(Promise=Gp)}catch{}return _s}var _s=Hp()();_s.noConflict=_S;Vp.exports=_s});var Zp=_((IF,Yp)=>{var en=jn(),yS=wd(),vS=Bn(),gS=$n(),ys=require("path"),au=za(),wS=Un(),tn=Di(),vs=Xp(),Kp=Buffer.alloc(4);Kp.writeUInt32LE(101010256,0);function ES(t){let e=t.stream(0).pipe(en());return e.pull(4).then(function(r){if(r.readUInt32LE(0)===875721283){let n;return e.pull(12).then(function(s){n=tn.parse(s,[["version",4],["pubKeyLength",4],["signatureLength",4]])}).then(function(){return e.pull(n.pubKeyLength+n.signatureLength)}).then(function(s){return n.publicKey=s.slice(0,n.pubKeyLength),n.signature=s.slice(n.pubKeyLength),n.size=16+n.pubKeyLength+n.signatureLength,n})}})}function SS(t,e){let r=tn.parse(e,[["signature",4],["diskNumber",4],["offsetToStartOfCentralDirectory",8],["numberOfDisks",4]]);if(r.signature!=117853008)throw new Error("invalid zip64 end of central dir locator signature (0x07064b50): 0x"+r.signature.toString(16));let i=en();return t.stream(r.offsetToStartOfCentralDirectory).pipe(i),i.pull(56)}function bS(t){let e=tn.parse(t,[["signature",4],["sizeOfCentralDirectory",8],["version",2],["versionsNeededToExtract",2],["diskNumber",4],["diskStart",4],["numberOfRecordsOnDisk",8],["numberOfRecords",8],["sizeOfCentralDirectory",8],["offsetToStartOfCentralDirectory",8]]);if(e.signature!=101075792)throw new Error("invalid zip64 end of central dir locator signature (0x06064b50): 0x0"+e.signature.toString(16));return e}Yp.exports=function(e,r){let i=en(),n=en(),s=r&&r.tailSize||80,o,a,u,f;return r&&r.crx&&(a=ES(e)),e.size().then(function(c){return o=c,e.stream(Math.max(0,c-s)).on("error",function(h){i.emit("error",h)}).pipe(i),i.pull(Kp)}).then(function(){return vs.props({directory:i.pull(22),crxHeader:a})}).then(function(c){let h=c.directory;if(u=c.crxHeader&&c.crxHeader.size||0,f=tn.parse(h,[["signature",4],["diskNumber",2],["diskStart",2],["numberOfRecordsOnDisk",2],["numberOfRecords",2],["sizeOfCentralDirectory",4],["offsetToStartOfCentralDirectory",4],["commentLength",2]]),f.diskNumber==65535||f.numberOfRecords==65535||f.offsetToStartOfCentralDirectory==4294967295){let l=o-(s-i.match+20),d=en();return e.stream(l).pipe(d),d.pull(20).then(function(m){return SS(e,m)}).then(function(m){f=bS(m)})}else f.offsetToStartOfCentralDirectory+=u}).then(function(){if(f.commentLength)return i.pull(f.commentLength).then(function(c){f.comment=c.toString("utf8")})}).then(function(){return e.stream(f.offsetToStartOfCentralDirectory).pipe(n),f.extract=function(c){if(!c||!c.path)throw new Error("PATH_MISSING");return c.path=ys.resolve(ys.normalize(c.path)),f.files.then(function(h){return vs.map(h,async function(p){let l=ys.join(c.path,p.path);if(l.indexOf(c.path)!=0)return;if(p.type=="Directory"){await au.ensureDir(l);return}await au.ensureDir(ys.dirname(l));let d=c.getWriter?c.getWriter({path:l}):au.createWriteStream(l);return new Promise(function(m,y){p.stream(c.password).on("error",y).pipe(d).on("close",m).on("error",y)})},{concurrency:c.concurrency>1?c.concurrency:1})})},f.files=vs.mapSeries(Array(f.numberOfRecords),function(){return n.pull(46).then(function(c){let h=tn.parse(c,[["signature",4],["versionMadeBy",2],["versionsNeededToExtract",2],["flags",2],["compressionMethod",2],["lastModifiedTime",2],["lastModifiedDate",2],["crc32",4],["compressedSize",4],["uncompressedSize",4],["fileNameLength",2],["extraFieldLength",2],["fileCommentLength",2],["diskNumber",2],["internalFileAttributes",2],["externalFileAttributes",4],["offsetToLocalFileHeader",4]]);return h.offsetToLocalFileHeader+=u,h.lastModifiedDateTime=wS(h.lastModifiedDate,h.lastModifiedTime),n.pull(h.fileNameLength).then(function(p){return h.pathBuffer=p,h.path=p.toString("utf8"),h.isUnicode=(h.flags&2048)!=0,n.pull(h.extraFieldLength)}).then(function(p){return h.extra=gS(p,h),n.pull(h.fileCommentLength)}).then(function(p){h.comment=p,h.type=h.uncompressedSize===0&&/[/\\]$/.test(h.path)?"Directory":"File";let l=r&&r.padding||1e3;return h.stream=function(d){let m=30+l+(h.extraFieldLength||0)+(h.fileNameLength||0)+h.compressedSize;return yS(e,h.offsetToLocalFileHeader,d,h,m)},h.buffer=function(d){return vS(h.stream(d))},h})})}),vs.props(f)})}});var tm=_((qF,em)=>{var Qp=wr(),ii=Zp(),Jp=require("stream");em.exports={buffer:function(t,e){return ii({stream:function(i,n){let s=Jp.PassThrough(),o=n?i+n:void 0;return s.end(t.slice(i,o)),s},size:function(){return Promise.resolve(t.length)}},e)},file:function(t,e){return ii({stream:function(i,n){let s=n?i+n:void 0;return Qp.createReadStream(t,{start:i,end:s})},size:function(){return new Promise(function(i,n){Qp.stat(t,function(s,o){s?n(s):i(o.size)})})}},e)},url:function(t,e,r){if(typeof e=="string"&&(e={url:e}),!e.url)throw"URL missing";return e.headers=e.headers||{},ii({stream:function(n,s){let o=Object.create(e),a=s?n+s:"";return o.headers=Object.create(e.headers),o.headers.range="bytes="+n+"-"+a,t(o)},size:function(){return new Promise(function(n,s){let o=t(e);o.on("response",function(a){o.abort(),a.headers["content-length"]?n(a.headers["content-length"]):s(new Error("Missing content length header"))}).on("error",s)})}},r)},s3:function(t,e,r){return ii({size:function(){return new Promise(function(n,s){t.headObject(e,function(o,a){o?s(o):n(a.ContentLength)})})},stream:function(n,s){let o={};for(let u in e)o[u]=e[u];let a=s?n+s:"";return o.Range="bytes="+n+"-"+a,t.getObject(o).createReadStream()}},r)},s3_v3:function(t,e,r){let{GetObjectCommand:i,HeadObjectCommand:n}=require("@aws-sdk/client-s3");return ii({size:async()=>{let o=await t.send(new n({Bucket:e.Bucket,Key:e.Key}));return o.ContentLength?o.ContentLength:0},stream:(o,a)=>{let u=Jp.PassThrough(),f=a?o+a:"";return t.send(new i({Bucket:e.Bucket,Key:e.Key,Range:`bytes=${o}-${f}`})).then(c=>{c.Body.pipe(u)}).catch(c=>{u.emit("error",c)}),u}},r)},custom:function(t,e){return ii(t,e)}}});var rm=_(rn=>{"use strict";rn.Parse=zn();rn.ParseOne=mf();rn.Extract=ld();rn.Open=tm()});var nn=_((MF,im)=>{var RS="2.0.0",OS=Number.MAX_SAFE_INTEGER||9007199254740991,TS=16,CS=250,xS=["major","premajor","minor","preminor","patch","prepatch","prerelease"];im.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:TS,MAX_SAFE_BUILD_LENGTH:CS,MAX_SAFE_INTEGER:OS,RELEASE_TYPES:xS,SEMVER_SPEC_VERSION:RS,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var sn=_((jF,nm)=>{var kS=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};nm.exports=kS});var ni=_((gt,sm)=>{var{MAX_SAFE_COMPONENT_LENGTH:uu,MAX_SAFE_BUILD_LENGTH:FS,MAX_LENGTH:AS}=nn(),NS=sn();gt=sm.exports={};var DS=gt.re=[],LS=gt.safeRe=[],I=gt.src=[],IS=gt.safeSrc=[],q=gt.t={},qS=0,cu="[a-zA-Z0-9-]",PS=[["\\s",1],["\\d",AS],[cu,FS]],MS=t=>{for(let[e,r]of PS)t=t.split(`${e}*`).join(`${e}{0,${r}}`).split(`${e}+`).join(`${e}{1,${r}}`);return t},X=(t,e,r)=>{let i=MS(e),n=qS++;NS(t,n,e),q[t]=n,I[n]=e,IS[n]=i,DS[n]=new RegExp(e,r?"g":void 0),LS[n]=new RegExp(i,r?"g":void 0)};X("NUMERICIDENTIFIER","0|[1-9]\\d*");X("NUMERICIDENTIFIERLOOSE","\\d+");X("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${cu}*`);X("MAINVERSION",`(${I[q.NUMERICIDENTIFIER]})\\.(${I[q.NUMERICIDENTIFIER]})\\.(${I[q.NUMERICIDENTIFIER]})`);X("MAINVERSIONLOOSE",`(${I[q.NUMERICIDENTIFIERLOOSE]})\\.(${I[q.NUMERICIDENTIFIERLOOSE]})\\.(${I[q.NUMERICIDENTIFIERLOOSE]})`);X("PRERELEASEIDENTIFIER",`(?:${I[q.NUMERICIDENTIFIER]}|${I[q.NONNUMERICIDENTIFIER]})`);X("PRERELEASEIDENTIFIERLOOSE",`(?:${I[q.NUMERICIDENTIFIERLOOSE]}|${I[q.NONNUMERICIDENTIFIER]})`);X("PRERELEASE",`(?:-(${I[q.PRERELEASEIDENTIFIER]}(?:\\.${I[q.PRERELEASEIDENTIFIER]})*))`);X("PRERELEASELOOSE",`(?:-?(${I[q.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${I[q.PRERELEASEIDENTIFIERLOOSE]})*))`);X("BUILDIDENTIFIER",`${cu}+`);X("BUILD",`(?:\\+(${I[q.BUILDIDENTIFIER]}(?:\\.${I[q.BUILDIDENTIFIER]})*))`);X("FULLPLAIN",`v?${I[q.MAINVERSION]}${I[q.PRERELEASE]}?${I[q.BUILD]}?`);X("FULL",`^${I[q.FULLPLAIN]}$`);X("LOOSEPLAIN",`[v=\\s]*${I[q.MAINVERSIONLOOSE]}${I[q.PRERELEASELOOSE]}?${I[q.BUILD]}?`);X("LOOSE",`^${I[q.LOOSEPLAIN]}$`);X("GTLT","((?:<|>)?=?)");X("XRANGEIDENTIFIERLOOSE",`${I[q.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);X("XRANGEIDENTIFIER",`${I[q.NUMERICIDENTIFIER]}|x|X|\\*`);X("XRANGEPLAIN",`[v=\\s]*(${I[q.XRANGEIDENTIFIER]})(?:\\.(${I[q.XRANGEIDENTIFIER]})(?:\\.(${I[q.XRANGEIDENTIFIER]})(?:${I[q.PRERELEASE]})?${I[q.BUILD]}?)?)?`);X("XRANGEPLAINLOOSE",`[v=\\s]*(${I[q.XRANGEIDENTIFIERLOOSE]})(?:\\.(${I[q.XRANGEIDENTIFIERLOOSE]})(?:\\.(${I[q.XRANGEIDENTIFIERLOOSE]})(?:${I[q.PRERELEASELOOSE]})?${I[q.BUILD]}?)?)?`);X("XRANGE",`^${I[q.GTLT]}\\s*${I[q.XRANGEPLAIN]}$`);X("XRANGELOOSE",`^${I[q.GTLT]}\\s*${I[q.XRANGEPLAINLOOSE]}$`);X("COERCEPLAIN",`(^|[^\\d])(\\d{1,${uu}})(?:\\.(\\d{1,${uu}}))?(?:\\.(\\d{1,${uu}}))?`);X("COERCE",`${I[q.COERCEPLAIN]}(?:$|[^\\d])`);X("COERCEFULL",I[q.COERCEPLAIN]+`(?:${I[q.PRERELEASE]})?(?:${I[q.BUILD]})?(?:$|[^\\d])`);X("COERCERTL",I[q.COERCE],!0);X("COERCERTLFULL",I[q.COERCEFULL],!0);X("LONETILDE","(?:~>?)");X("TILDETRIM",`(\\s*)${I[q.LONETILDE]}\\s+`,!0);gt.tildeTrimReplace="$1~";X("TILDE",`^${I[q.LONETILDE]}${I[q.XRANGEPLAIN]}$`);X("TILDELOOSE",`^${I[q.LONETILDE]}${I[q.XRANGEPLAINLOOSE]}$`);X("LONECARET","(?:\\^)");X("CARETTRIM",`(\\s*)${I[q.LONECARET]}\\s+`,!0);gt.caretTrimReplace="$1^";X("CARET",`^${I[q.LONECARET]}${I[q.XRANGEPLAIN]}$`);X("CARETLOOSE",`^${I[q.LONECARET]}${I[q.XRANGEPLAINLOOSE]}$`);X("COMPARATORLOOSE",`^${I[q.GTLT]}\\s*(${I[q.LOOSEPLAIN]})$|^$`);X("COMPARATOR",`^${I[q.GTLT]}\\s*(${I[q.FULLPLAIN]})$|^$`);X("COMPARATORTRIM",`(\\s*)${I[q.GTLT]}\\s*(${I[q.LOOSEPLAIN]}|${I[q.XRANGEPLAIN]})`,!0);gt.comparatorTrimReplace="$1$2$3";X("HYPHENRANGE",`^\\s*(${I[q.XRANGEPLAIN]})\\s+-\\s+(${I[q.XRANGEPLAIN]})\\s*$`);X("HYPHENRANGELOOSE",`^\\s*(${I[q.XRANGEPLAINLOOSE]})\\s+-\\s+(${I[q.XRANGEPLAINLOOSE]})\\s*$`);X("STAR","(<|>)?=?\\s*\\*");X("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");X("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var gs=_((BF,om)=>{var jS=Object.freeze({loose:!0}),BS=Object.freeze({}),$S=t=>t?typeof t!="object"?jS:t:BS;om.exports=$S});var lu=_(($F,cm)=>{var am=/^[0-9]+$/,um=(t,e)=>{let r=am.test(t),i=am.test(e);return r&&i&&(t=+t,e=+e),t===e?0:r&&!i?-1:i&&!r?1:tum(e,t);cm.exports={compareIdentifiers:um,rcompareIdentifiers:US}});var Ae=_((UF,dm)=>{var ws=sn(),{MAX_LENGTH:lm,MAX_SAFE_INTEGER:Es}=nn(),{safeRe:fm,safeSrc:hm,t:Ss}=ni(),zS=gs(),{compareIdentifiers:si}=lu(),fu=class t{constructor(e,r){if(r=zS(r),e instanceof t){if(e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>lm)throw new TypeError(`version is longer than ${lm} characters`);ws("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let i=e.trim().match(r.loose?fm[Ss.LOOSE]:fm[Ss.FULL]);if(!i)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+i[1],this.minor=+i[2],this.patch=+i[3],this.major>Es||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Es||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Es||this.patch<0)throw new TypeError("Invalid patch version");i[4]?this.prerelease=i[4].split(".").map(n=>{if(/^[0-9]+$/.test(n)){let s=+n;if(s>=0&&s=0;)typeof this.prerelease[s]=="number"&&(this.prerelease[s]++,s=-2);if(s===-1){if(r===this.prerelease.join(".")&&i===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(n)}}if(r){let s=[r,n];i===!1&&(s=[r]),si(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=s):this.prerelease=s}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};dm.exports=fu});var Rr=_((zF,mm)=>{var pm=Ae(),WS=(t,e,r=!1)=>{if(t instanceof pm)return t;try{return new pm(t,e)}catch(i){if(!r)return null;throw i}};mm.exports=WS});var ym=_((WF,_m)=>{var HS=Rr(),GS=(t,e)=>{let r=HS(t,e);return r?r.version:null};_m.exports=GS});var gm=_((HF,vm)=>{var VS=Rr(),XS=(t,e)=>{let r=VS(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null};vm.exports=XS});var Sm=_((GF,Em)=>{var wm=Ae(),KS=(t,e,r,i,n)=>{typeof r=="string"&&(n=i,i=r,r=void 0);try{return new wm(t instanceof wm?t.version:t,r).inc(e,i,n).version}catch{return null}};Em.exports=KS});var Om=_((VF,Rm)=>{var bm=Rr(),YS=(t,e)=>{let r=bm(t,null,!0),i=bm(e,null,!0),n=r.compare(i);if(n===0)return null;let s=n>0,o=s?r:i,a=s?i:r,u=!!o.prerelease.length;if(!!a.prerelease.length&&!u){if(!a.patch&&!a.minor)return"major";if(a.compareMain(o)===0)return a.minor&&!a.patch?"minor":"patch"}let c=u?"pre":"";return r.major!==i.major?c+"major":r.minor!==i.minor?c+"minor":r.patch!==i.patch?c+"patch":"prerelease"};Rm.exports=YS});var Cm=_((XF,Tm)=>{var ZS=Ae(),QS=(t,e)=>new ZS(t,e).major;Tm.exports=QS});var km=_((KF,xm)=>{var JS=Ae(),eb=(t,e)=>new JS(t,e).minor;xm.exports=eb});var Am=_((YF,Fm)=>{var tb=Ae(),rb=(t,e)=>new tb(t,e).patch;Fm.exports=rb});var Dm=_((ZF,Nm)=>{var ib=Rr(),nb=(t,e)=>{let r=ib(t,e);return r&&r.prerelease.length?r.prerelease:null};Nm.exports=nb});var Je=_((QF,Im)=>{var Lm=Ae(),sb=(t,e,r)=>new Lm(t,r).compare(new Lm(e,r));Im.exports=sb});var Pm=_((JF,qm)=>{var ob=Je(),ab=(t,e,r)=>ob(e,t,r);qm.exports=ab});var jm=_((e1,Mm)=>{var ub=Je(),cb=(t,e)=>ub(t,e,!0);Mm.exports=cb});var bs=_((t1,$m)=>{var Bm=Ae(),lb=(t,e,r)=>{let i=new Bm(t,r),n=new Bm(e,r);return i.compare(n)||i.compareBuild(n)};$m.exports=lb});var zm=_((r1,Um)=>{var fb=bs(),hb=(t,e)=>t.sort((r,i)=>fb(r,i,e));Um.exports=hb});var Hm=_((i1,Wm)=>{var db=bs(),pb=(t,e)=>t.sort((r,i)=>db(i,r,e));Wm.exports=pb});var on=_((n1,Gm)=>{var mb=Je(),_b=(t,e,r)=>mb(t,e,r)>0;Gm.exports=_b});var Rs=_((s1,Vm)=>{var yb=Je(),vb=(t,e,r)=>yb(t,e,r)<0;Vm.exports=vb});var hu=_((o1,Xm)=>{var gb=Je(),wb=(t,e,r)=>gb(t,e,r)===0;Xm.exports=wb});var du=_((a1,Km)=>{var Eb=Je(),Sb=(t,e,r)=>Eb(t,e,r)!==0;Km.exports=Sb});var Os=_((u1,Ym)=>{var bb=Je(),Rb=(t,e,r)=>bb(t,e,r)>=0;Ym.exports=Rb});var Ts=_((c1,Zm)=>{var Ob=Je(),Tb=(t,e,r)=>Ob(t,e,r)<=0;Zm.exports=Tb});var pu=_((l1,Qm)=>{var Cb=hu(),xb=du(),kb=on(),Fb=Os(),Ab=Rs(),Nb=Ts(),Db=(t,e,r,i)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t===r;case"!==":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t!==r;case"":case"=":case"==":return Cb(t,r,i);case"!=":return xb(t,r,i);case">":return kb(t,r,i);case">=":return Fb(t,r,i);case"<":return Ab(t,r,i);case"<=":return Nb(t,r,i);default:throw new TypeError(`Invalid operator: ${e}`)}};Qm.exports=Db});var e_=_((f1,Jm)=>{var Lb=Ae(),Ib=Rr(),{safeRe:Cs,t:xs}=ni(),qb=(t,e)=>{if(t instanceof Lb)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let r=null;if(!e.rtl)r=t.match(e.includePrerelease?Cs[xs.COERCEFULL]:Cs[xs.COERCE]);else{let u=e.includePrerelease?Cs[xs.COERCERTLFULL]:Cs[xs.COERCERTL],f;for(;(f=u.exec(t))&&(!r||r.index+r[0].length!==t.length);)(!r||f.index+f[0].length!==r.index+r[0].length)&&(r=f),u.lastIndex=f.index+f[1].length+f[2].length;u.lastIndex=-1}if(r===null)return null;let i=r[2],n=r[3]||"0",s=r[4]||"0",o=e.includePrerelease&&r[5]?`-${r[5]}`:"",a=e.includePrerelease&&r[6]?`+${r[6]}`:"";return Ib(`${i}.${n}.${s}${o}${a}`,e)};Jm.exports=qb});var r_=_((h1,t_)=>{var mu=class{constructor(){this.max=1e3,this.map=new Map}get(e){let r=this.map.get(e);if(r!==void 0)return this.map.delete(e),this.map.set(e,r),r}delete(e){return this.map.delete(e)}set(e,r){if(!this.delete(e)&&r!==void 0){if(this.map.size>=this.max){let n=this.map.keys().next().value;this.delete(n)}this.map.set(e,r)}return this}};t_.exports=mu});var et=_((d1,o_)=>{var Pb=/\s+/g,_u=class t{constructor(e,r){if(r=jb(r),e instanceof t)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new t(e.raw,r);if(e instanceof yu)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=e.trim().replace(Pb," "),this.set=this.raw.split("||").map(i=>this.parseRange(i.trim())).filter(i=>i.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let i=this.set[0];if(this.set=this.set.filter(n=>!n_(n[0])),this.set.length===0)this.set=[i];else if(this.set.length>1){for(let n of this.set)if(n.length===1&&Gb(n[0])){this.set=[n];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e0&&(this.formatted+="||");let r=this.set[e];for(let i=0;i0&&(this.formatted+=" "),this.formatted+=r[i].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let i=((this.options.includePrerelease&&Wb)|(this.options.loose&&Hb))+":"+e,n=i_.get(i);if(n)return n;let s=this.options.loose,o=s?Ge[$e.HYPHENRANGELOOSE]:Ge[$e.HYPHENRANGE];e=e.replace(o,rR(this.options.includePrerelease)),fe("hyphen replace",e),e=e.replace(Ge[$e.COMPARATORTRIM],$b),fe("comparator trim",e),e=e.replace(Ge[$e.TILDETRIM],Ub),fe("tilde trim",e),e=e.replace(Ge[$e.CARETTRIM],zb),fe("caret trim",e);let a=e.split(" ").map(h=>Vb(h,this.options)).join(" ").split(/\s+/).map(h=>tR(h,this.options));s&&(a=a.filter(h=>(fe("loose invalid filter",h,this.options),!!h.match(Ge[$e.COMPARATORLOOSE])))),fe("range list",a);let u=new Map,f=a.map(h=>new yu(h,this.options));for(let h of f){if(n_(h))return[h];u.set(h.value,h)}u.size>1&&u.has("")&&u.delete("");let c=[...u.values()];return i_.set(i,c),c}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(i=>s_(i,r)&&e.set.some(n=>s_(n,r)&&i.every(s=>n.every(o=>s.intersects(o,r)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new Bb(e,this.options)}catch{return!1}for(let r=0;rt.value==="<0.0.0-0",Gb=t=>t.value==="",s_=(t,e)=>{let r=!0,i=t.slice(),n=i.pop();for(;r&&i.length;)r=i.every(s=>n.intersects(s,e)),n=i.pop();return r},Vb=(t,e)=>(fe("comp",t,e),t=Yb(t,e),fe("caret",t),t=Xb(t,e),fe("tildes",t),t=Qb(t,e),fe("xrange",t),t=eR(t,e),fe("stars",t),t),Ue=t=>!t||t.toLowerCase()==="x"||t==="*",Xb=(t,e)=>t.trim().split(/\s+/).map(r=>Kb(r,e)).join(" "),Kb=(t,e)=>{let r=e.loose?Ge[$e.TILDELOOSE]:Ge[$e.TILDE];return t.replace(r,(i,n,s,o,a)=>{fe("tilde",t,i,n,s,o,a);let u;return Ue(n)?u="":Ue(s)?u=`>=${n}.0.0 <${+n+1}.0.0-0`:Ue(o)?u=`>=${n}.${s}.0 <${n}.${+s+1}.0-0`:a?(fe("replaceTilde pr",a),u=`>=${n}.${s}.${o}-${a} <${n}.${+s+1}.0-0`):u=`>=${n}.${s}.${o} <${n}.${+s+1}.0-0`,fe("tilde return",u),u})},Yb=(t,e)=>t.trim().split(/\s+/).map(r=>Zb(r,e)).join(" "),Zb=(t,e)=>{fe("caret",t,e);let r=e.loose?Ge[$e.CARETLOOSE]:Ge[$e.CARET],i=e.includePrerelease?"-0":"";return t.replace(r,(n,s,o,a,u)=>{fe("caret",t,n,s,o,a,u);let f;return Ue(s)?f="":Ue(o)?f=`>=${s}.0.0${i} <${+s+1}.0.0-0`:Ue(a)?s==="0"?f=`>=${s}.${o}.0${i} <${s}.${+o+1}.0-0`:f=`>=${s}.${o}.0${i} <${+s+1}.0.0-0`:u?(fe("replaceCaret pr",u),s==="0"?o==="0"?f=`>=${s}.${o}.${a}-${u} <${s}.${o}.${+a+1}-0`:f=`>=${s}.${o}.${a}-${u} <${s}.${+o+1}.0-0`:f=`>=${s}.${o}.${a}-${u} <${+s+1}.0.0-0`):(fe("no pr"),s==="0"?o==="0"?f=`>=${s}.${o}.${a}${i} <${s}.${o}.${+a+1}-0`:f=`>=${s}.${o}.${a}${i} <${s}.${+o+1}.0-0`:f=`>=${s}.${o}.${a} <${+s+1}.0.0-0`),fe("caret return",f),f})},Qb=(t,e)=>(fe("replaceXRanges",t,e),t.split(/\s+/).map(r=>Jb(r,e)).join(" ")),Jb=(t,e)=>{t=t.trim();let r=e.loose?Ge[$e.XRANGELOOSE]:Ge[$e.XRANGE];return t.replace(r,(i,n,s,o,a,u)=>{fe("xRange",t,i,n,s,o,a,u);let f=Ue(s),c=f||Ue(o),h=c||Ue(a),p=h;return n==="="&&p&&(n=""),u=e.includePrerelease?"-0":"",f?n===">"||n==="<"?i="<0.0.0-0":i="*":n&&p?(c&&(o=0),a=0,n===">"?(n=">=",c?(s=+s+1,o=0,a=0):(o=+o+1,a=0)):n==="<="&&(n="<",c?s=+s+1:o=+o+1),n==="<"&&(u="-0"),i=`${n+s}.${o}.${a}${u}`):c?i=`>=${s}.0.0${u} <${+s+1}.0.0-0`:h&&(i=`>=${s}.${o}.0${u} <${s}.${+o+1}.0-0`),fe("xRange return",i),i})},eR=(t,e)=>(fe("replaceStars",t,e),t.trim().replace(Ge[$e.STAR],"")),tR=(t,e)=>(fe("replaceGTE0",t,e),t.trim().replace(Ge[e.includePrerelease?$e.GTE0PRE:$e.GTE0],"")),rR=t=>(e,r,i,n,s,o,a,u,f,c,h,p)=>(Ue(i)?r="":Ue(n)?r=`>=${i}.0.0${t?"-0":""}`:Ue(s)?r=`>=${i}.${n}.0${t?"-0":""}`:o?r=`>=${r}`:r=`>=${r}${t?"-0":""}`,Ue(f)?u="":Ue(c)?u=`<${+f+1}.0.0-0`:Ue(h)?u=`<${f}.${+c+1}.0-0`:p?u=`<=${f}.${c}.${h}-${p}`:t?u=`<${f}.${c}.${+h+1}-0`:u=`<=${u}`,`${r} ${u}`.trim()),iR=(t,e,r)=>{for(let i=0;i0){let n=t[i].semver;if(n.major===e.major&&n.minor===e.minor&&n.patch===e.patch)return!0}return!1}return!0}});var an=_((p1,h_)=>{var un=Symbol("SemVer ANY"),wu=class t{static get ANY(){return un}constructor(e,r){if(r=a_(r),e instanceof t){if(e.loose===!!r.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),gu("comparator",e,r),this.options=r,this.loose=!!r.loose,this.parse(e),this.semver===un?this.value="":this.value=this.operator+this.semver.version,gu("comp",this)}parse(e){let r=this.options.loose?u_[c_.COMPARATORLOOSE]:u_[c_.COMPARATOR],i=e.match(r);if(!i)throw new TypeError(`Invalid comparator: ${e}`);this.operator=i[1]!==void 0?i[1]:"",this.operator==="="&&(this.operator=""),i[2]?this.semver=new l_(i[2],this.options.loose):this.semver=un}toString(){return this.value}test(e){if(gu("Comparator.test",e,this.options.loose),this.semver===un||e===un)return!0;if(typeof e=="string")try{e=new l_(e,this.options)}catch{return!1}return vu(e,this.operator,this.semver,this.options)}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new f_(e.value,r).test(this.value):e.operator===""?e.value===""?!0:new f_(this.value,r).test(e.semver):(r=a_(r),r.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!r.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||vu(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||vu(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};h_.exports=wu;var a_=gs(),{safeRe:u_,t:c_}=ni(),vu=pu(),gu=sn(),l_=Ae(),f_=et()});var cn=_((m1,d_)=>{var nR=et(),sR=(t,e,r)=>{try{e=new nR(e,r)}catch{return!1}return e.test(t)};d_.exports=sR});var m_=_((_1,p_)=>{var oR=et(),aR=(t,e)=>new oR(t,e).set.map(r=>r.map(i=>i.value).join(" ").trim().split(" "));p_.exports=aR});var y_=_((y1,__)=>{var uR=Ae(),cR=et(),lR=(t,e,r)=>{let i=null,n=null,s=null;try{s=new cR(e,r)}catch{return null}return t.forEach(o=>{s.test(o)&&(!i||n.compare(o)===-1)&&(i=o,n=new uR(i,r))}),i};__.exports=lR});var g_=_((v1,v_)=>{var fR=Ae(),hR=et(),dR=(t,e,r)=>{let i=null,n=null,s=null;try{s=new hR(e,r)}catch{return null}return t.forEach(o=>{s.test(o)&&(!i||n.compare(o)===1)&&(i=o,n=new fR(i,r))}),i};v_.exports=dR});var S_=_((g1,E_)=>{var Eu=Ae(),pR=et(),w_=on(),mR=(t,e)=>{t=new pR(t,e);let r=new Eu("0.0.0");if(t.test(r)||(r=new Eu("0.0.0-0"),t.test(r)))return r;r=null;for(let i=0;i{let a=new Eu(o.semver.version);switch(o.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!s||w_(a,s))&&(s=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${o.operator}`)}}),s&&(!r||w_(r,s))&&(r=s)}return r&&t.test(r)?r:null};E_.exports=mR});var R_=_((w1,b_)=>{var _R=et(),yR=(t,e)=>{try{return new _R(t,e).range||"*"}catch{return null}};b_.exports=yR});var ks=_((E1,x_)=>{var vR=Ae(),C_=an(),{ANY:gR}=C_,wR=et(),ER=cn(),O_=on(),T_=Rs(),SR=Ts(),bR=Os(),RR=(t,e,r,i)=>{t=new vR(t,i),e=new wR(e,i);let n,s,o,a,u;switch(r){case">":n=O_,s=SR,o=T_,a=">",u=">=";break;case"<":n=T_,s=bR,o=O_,a="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(ER(t,e,i))return!1;for(let f=0;f{l.semver===gR&&(l=new C_(">=0.0.0")),h=h||l,p=p||l,n(l.semver,h.semver,i)?h=l:o(l.semver,p.semver,i)&&(p=l)}),h.operator===a||h.operator===u||(!p.operator||p.operator===a)&&s(t,p.semver))return!1;if(p.operator===u&&o(t,p.semver))return!1}return!0};x_.exports=RR});var F_=_((S1,k_)=>{var OR=ks(),TR=(t,e,r)=>OR(t,e,">",r);k_.exports=TR});var N_=_((b1,A_)=>{var CR=ks(),xR=(t,e,r)=>CR(t,e,"<",r);A_.exports=xR});var I_=_((R1,L_)=>{var D_=et(),kR=(t,e,r)=>(t=new D_(t,r),e=new D_(e,r),t.intersects(e,r));L_.exports=kR});var P_=_((O1,q_)=>{var FR=cn(),AR=Je();q_.exports=(t,e,r)=>{let i=[],n=null,s=null,o=t.sort((c,h)=>AR(c,h,r));for(let c of o)FR(c,e,r)?(s=c,n||(n=c)):(s&&i.push([n,s]),s=null,n=null);n&&i.push([n,null]);let a=[];for(let[c,h]of i)c===h?a.push(c):!h&&c===o[0]?a.push("*"):h?c===o[0]?a.push(`<=${h}`):a.push(`${c} - ${h}`):a.push(`>=${c}`);let u=a.join(" || "),f=typeof e.raw=="string"?e.raw:String(e);return u.length{var M_=et(),bu=an(),{ANY:Su}=bu,ln=cn(),Ru=Je(),NR=(t,e,r={})=>{if(t===e)return!0;t=new M_(t,r),e=new M_(e,r);let i=!1;e:for(let n of t.set){for(let s of e.set){let o=LR(n,s,r);if(i=i||o!==null,o)continue e}if(i)return!1}return!0},DR=[new bu(">=0.0.0-0")],j_=[new bu(">=0.0.0")],LR=(t,e,r)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===Su){if(e.length===1&&e[0].semver===Su)return!0;r.includePrerelease?t=DR:t=j_}if(e.length===1&&e[0].semver===Su){if(r.includePrerelease)return!0;e=j_}let i=new Set,n,s;for(let l of t)l.operator===">"||l.operator===">="?n=B_(n,l,r):l.operator==="<"||l.operator==="<="?s=$_(s,l,r):i.add(l.semver);if(i.size>1)return null;let o;if(n&&s){if(o=Ru(n.semver,s.semver,r),o>0)return null;if(o===0&&(n.operator!==">="||s.operator!=="<="))return null}for(let l of i){if(n&&!ln(l,String(n),r)||s&&!ln(l,String(s),r))return null;for(let d of e)if(!ln(l,String(d),r))return!1;return!0}let a,u,f,c,h=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1,p=n&&!r.includePrerelease&&n.semver.prerelease.length?n.semver:!1;h&&h.prerelease.length===1&&s.operator==="<"&&h.prerelease[0]===0&&(h=!1);for(let l of e){if(c=c||l.operator===">"||l.operator===">=",f=f||l.operator==="<"||l.operator==="<=",n){if(p&&l.semver.prerelease&&l.semver.prerelease.length&&l.semver.major===p.major&&l.semver.minor===p.minor&&l.semver.patch===p.patch&&(p=!1),l.operator===">"||l.operator===">="){if(a=B_(n,l,r),a===l&&a!==n)return!1}else if(n.operator===">="&&!ln(n.semver,String(l),r))return!1}if(s){if(h&&l.semver.prerelease&&l.semver.prerelease.length&&l.semver.major===h.major&&l.semver.minor===h.minor&&l.semver.patch===h.patch&&(h=!1),l.operator==="<"||l.operator==="<="){if(u=$_(s,l,r),u===l&&u!==s)return!1}else if(s.operator==="<="&&!ln(s.semver,String(l),r))return!1}if(!l.operator&&(s||n)&&o!==0)return!1}return!(n&&f&&!s&&o!==0||s&&c&&!n&&o!==0||p||h)},B_=(t,e,r)=>{if(!t)return e;let i=Ru(t.semver,e.semver,r);return i>0?t:i<0||e.operator===">"&&t.operator===">="?e:t},$_=(t,e,r)=>{if(!t)return e;let i=Ru(t.semver,e.semver,r);return i<0?t:i>0||e.operator==="<"&&t.operator==="<="?e:t};U_.exports=NR});var V_=_((C1,G_)=>{var Ou=ni(),W_=nn(),IR=Ae(),H_=lu(),qR=Rr(),PR=ym(),MR=gm(),jR=Sm(),BR=Om(),$R=Cm(),UR=km(),zR=Am(),WR=Dm(),HR=Je(),GR=Pm(),VR=jm(),XR=bs(),KR=zm(),YR=Hm(),ZR=on(),QR=Rs(),JR=hu(),eO=du(),tO=Os(),rO=Ts(),iO=pu(),nO=e_(),sO=an(),oO=et(),aO=cn(),uO=m_(),cO=y_(),lO=g_(),fO=S_(),hO=R_(),dO=ks(),pO=F_(),mO=N_(),_O=I_(),yO=P_(),vO=z_();G_.exports={parse:qR,valid:PR,clean:MR,inc:jR,diff:BR,major:$R,minor:UR,patch:zR,prerelease:WR,compare:HR,rcompare:GR,compareLoose:VR,compareBuild:XR,sort:KR,rsort:YR,gt:ZR,lt:QR,eq:JR,neq:eO,gte:tO,lte:rO,cmp:iO,coerce:nO,Comparator:sO,Range:oO,satisfies:aO,toComparators:uO,maxSatisfying:cO,minSatisfying:lO,minVersion:fO,validRange:hO,outside:dO,gtr:pO,ltr:mO,intersects:_O,simplifyRange:yO,subset:vO,SemVer:IR,re:Ou.re,src:Ou.src,tokens:Ou.t,SEMVER_SPEC_VERSION:W_.SEMVER_SPEC_VERSION,RELEASE_TYPES:W_.RELEASE_TYPES,compareIdentifiers:H_.compareIdentifiers,rcompareIdentifiers:H_.rcompareIdentifiers}});var ui=_(We=>{"use strict";var gO=We&&We.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(We,"__esModule",{value:!0});We.Minipass=We.isWritable=We.isReadable=We.isStream=void 0;var X_=typeof process=="object"&&process?process:{stdout:null,stderr:null},Nu=require("node:events"),Q_=gO(require("node:stream")),wO=require("node:string_decoder"),EO=t=>!!t&&typeof t=="object"&&(t instanceof qs||t instanceof Q_.default||(0,We.isReadable)(t)||(0,We.isWritable)(t));We.isStream=EO;var SO=t=>!!t&&typeof t=="object"&&t instanceof Nu.EventEmitter&&typeof t.pipe=="function"&&t.pipe!==Q_.default.Writable.prototype.pipe;We.isReadable=SO;var bO=t=>!!t&&typeof t=="object"&&t instanceof Nu.EventEmitter&&typeof t.write=="function"&&typeof t.end=="function";We.isWritable=bO;var Pt=Symbol("EOF"),Mt=Symbol("maybeEmitEnd"),Qt=Symbol("emittedEnd"),Fs=Symbol("emittingEnd"),fn=Symbol("emittedError"),As=Symbol("closed"),K_=Symbol("read"),Ns=Symbol("flush"),Y_=Symbol("flushChunk"),lt=Symbol("encoding"),oi=Symbol("decoder"),Re=Symbol("flowing"),hn=Symbol("paused"),ai=Symbol("resume"),Oe=Symbol("buffer"),ze=Symbol("pipes"),Te=Symbol("bufferLength"),Tu=Symbol("bufferPush"),Ds=Symbol("bufferShift"),Ne=Symbol("objectMode"),ye=Symbol("destroyed"),Cu=Symbol("error"),xu=Symbol("emitData"),Z_=Symbol("emitEnd"),ku=Symbol("emitEnd2"),wt=Symbol("async"),Fu=Symbol("abort"),Ls=Symbol("aborted"),dn=Symbol("signal"),Or=Symbol("dataListeners"),Ke=Symbol("discarded"),pn=t=>Promise.resolve().then(t),RO=t=>t(),OO=t=>t==="end"||t==="finish"||t==="prefinish",TO=t=>t instanceof ArrayBuffer||!!t&&typeof t=="object"&&t.constructor&&t.constructor.name==="ArrayBuffer"&&t.byteLength>=0,CO=t=>!Buffer.isBuffer(t)&&ArrayBuffer.isView(t),Is=class{src;dest;opts;ondrain;constructor(e,r,i){this.src=e,this.dest=r,this.opts=i,this.ondrain=()=>e[ai](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},Au=class extends Is{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,r,i){super(e,r,i),this.proxyErrors=n=>r.emit("error",n),e.on("error",this.proxyErrors)}},xO=t=>!!t.objectMode,kO=t=>!t.objectMode&&!!t.encoding&&t.encoding!=="buffer",qs=class extends Nu.EventEmitter{[Re]=!1;[hn]=!1;[ze]=[];[Oe]=[];[Ne];[lt];[wt];[oi];[Pt]=!1;[Qt]=!1;[Fs]=!1;[As]=!1;[fn]=null;[Te]=0;[ye]=!1;[dn];[Ls]=!1;[Or]=0;[Ke]=!1;writable=!0;readable=!0;constructor(...e){let r=e[0]||{};if(super(),r.objectMode&&typeof r.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");xO(r)?(this[Ne]=!0,this[lt]=null):kO(r)?(this[lt]=r.encoding,this[Ne]=!1):(this[Ne]=!1,this[lt]=null),this[wt]=!!r.async,this[oi]=this[lt]?new wO.StringDecoder(this[lt]):null,r&&r.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[Oe]}),r&&r.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[ze]});let{signal:i}=r;i&&(this[dn]=i,i.aborted?this[Fu]():i.addEventListener("abort",()=>this[Fu]()))}get bufferLength(){return this[Te]}get encoding(){return this[lt]}set encoding(e){throw new Error("Encoding must be set at instantiation time")}setEncoding(e){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[Ne]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[wt]}set async(e){this[wt]=this[wt]||!!e}[Fu](){this[Ls]=!0,this.emit("abort",this[dn]?.reason),this.destroy(this[dn]?.reason)}get aborted(){return this[Ls]}set aborted(e){}write(e,r,i){if(this[Ls])return!1;if(this[Pt])throw new Error("write after end");if(this[ye])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof r=="function"&&(i=r,r="utf8"),r||(r="utf8");let n=this[wt]?pn:RO;if(!this[Ne]&&!Buffer.isBuffer(e)){if(CO(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(TO(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[Ne]?(this[Re]&&this[Te]!==0&&this[Ns](!0),this[Re]?this.emit("data",e):this[Tu](e),this[Te]!==0&&this.emit("readable"),i&&n(i),this[Re]):e.length?(typeof e=="string"&&!(r===this[lt]&&!this[oi]?.lastNeed)&&(e=Buffer.from(e,r)),Buffer.isBuffer(e)&&this[lt]&&(e=this[oi].write(e)),this[Re]&&this[Te]!==0&&this[Ns](!0),this[Re]?this.emit("data",e):this[Tu](e),this[Te]!==0&&this.emit("readable"),i&&n(i),this[Re]):(this[Te]!==0&&this.emit("readable"),i&&n(i),this[Re])}read(e){if(this[ye])return null;if(this[Ke]=!1,this[Te]===0||e===0||e&&e>this[Te])return this[Mt](),null;this[Ne]&&(e=null),this[Oe].length>1&&!this[Ne]&&(this[Oe]=[this[lt]?this[Oe].join(""):Buffer.concat(this[Oe],this[Te])]);let r=this[K_](e||null,this[Oe][0]);return this[Mt](),r}[K_](e,r){if(this[Ne])this[Ds]();else{let i=r;e===i.length||e===null?this[Ds]():typeof i=="string"?(this[Oe][0]=i.slice(e),r=i.slice(0,e),this[Te]-=e):(this[Oe][0]=i.subarray(e),r=i.subarray(0,e),this[Te]-=e)}return this.emit("data",r),!this[Oe].length&&!this[Pt]&&this.emit("drain"),r}end(e,r,i){return typeof e=="function"&&(i=e,e=void 0),typeof r=="function"&&(i=r,r="utf8"),e!==void 0&&this.write(e,r),i&&this.once("end",i),this[Pt]=!0,this.writable=!1,(this[Re]||!this[hn])&&this[Mt](),this}[ai](){this[ye]||(!this[Or]&&!this[ze].length&&(this[Ke]=!0),this[hn]=!1,this[Re]=!0,this.emit("resume"),this[Oe].length?this[Ns]():this[Pt]?this[Mt]():this.emit("drain"))}resume(){return this[ai]()}pause(){this[Re]=!1,this[hn]=!0,this[Ke]=!1}get destroyed(){return this[ye]}get flowing(){return this[Re]}get paused(){return this[hn]}[Tu](e){this[Ne]?this[Te]+=1:this[Te]+=e.length,this[Oe].push(e)}[Ds](){return this[Ne]?this[Te]-=1:this[Te]-=this[Oe][0].length,this[Oe].shift()}[Ns](e=!1){do;while(this[Y_](this[Ds]())&&this[Oe].length);!e&&!this[Oe].length&&!this[Pt]&&this.emit("drain")}[Y_](e){return this.emit("data",e),this[Re]}pipe(e,r){if(this[ye])return e;this[Ke]=!1;let i=this[Qt];return r=r||{},e===X_.stdout||e===X_.stderr?r.end=!1:r.end=r.end!==!1,r.proxyErrors=!!r.proxyErrors,i?r.end&&e.end():(this[ze].push(r.proxyErrors?new Au(this,e,r):new Is(this,e,r)),this[wt]?pn(()=>this[ai]()):this[ai]()),e}unpipe(e){let r=this[ze].find(i=>i.dest===e);r&&(this[ze].length===1?(this[Re]&&this[Or]===0&&(this[Re]=!1),this[ze]=[]):this[ze].splice(this[ze].indexOf(r),1),r.unpipe())}addListener(e,r){return this.on(e,r)}on(e,r){let i=super.on(e,r);if(e==="data")this[Ke]=!1,this[Or]++,!this[ze].length&&!this[Re]&&this[ai]();else if(e==="readable"&&this[Te]!==0)super.emit("readable");else if(OO(e)&&this[Qt])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[fn]){let n=r;this[wt]?pn(()=>n.call(this,this[fn])):n.call(this,this[fn])}return i}removeListener(e,r){return this.off(e,r)}off(e,r){let i=super.off(e,r);return e==="data"&&(this[Or]=this.listeners("data").length,this[Or]===0&&!this[Ke]&&!this[ze].length&&(this[Re]=!1)),i}removeAllListeners(e){let r=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[Or]=0,!this[Ke]&&!this[ze].length&&(this[Re]=!1)),r}get emittedEnd(){return this[Qt]}[Mt](){!this[Fs]&&!this[Qt]&&!this[ye]&&this[Oe].length===0&&this[Pt]&&(this[Fs]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[As]&&this.emit("close"),this[Fs]=!1)}emit(e,...r){let i=r[0];if(e!=="error"&&e!=="close"&&e!==ye&&this[ye])return!1;if(e==="data")return!this[Ne]&&!i?!1:this[wt]?(pn(()=>this[xu](i)),!0):this[xu](i);if(e==="end")return this[Z_]();if(e==="close"){if(this[As]=!0,!this[Qt]&&!this[ye])return!1;let s=super.emit("close");return this.removeAllListeners("close"),s}else if(e==="error"){this[fn]=i,super.emit(Cu,i);let s=!this[dn]||this.listeners("error").length?super.emit("error",i):!1;return this[Mt](),s}else if(e==="resume"){let s=super.emit("resume");return this[Mt](),s}else if(e==="finish"||e==="prefinish"){let s=super.emit(e);return this.removeAllListeners(e),s}let n=super.emit(e,...r);return this[Mt](),n}[xu](e){for(let i of this[ze])i.dest.write(e)===!1&&this.pause();let r=this[Ke]?!1:super.emit("data",e);return this[Mt](),r}[Z_](){return this[Qt]?!1:(this[Qt]=!0,this.readable=!1,this[wt]?(pn(()=>this[ku]()),!0):this[ku]())}[ku](){if(this[oi]){let r=this[oi].end();if(r){for(let i of this[ze])i.dest.write(r);this[Ke]||super.emit("data",r)}}for(let r of this[ze])r.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[Ne]||(e.dataLength=0);let r=this.promise();return this.on("data",i=>{e.push(i),this[Ne]||(e.dataLength+=i.length)}),await r,e}async concat(){if(this[Ne])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[lt]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,r)=>{this.on(ye,()=>r(new Error("stream destroyed"))),this.on("error",i=>r(i)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[Ke]=!1;let e=!1,r=async()=>(this.pause(),e=!0,{value:void 0,done:!0});return{next:()=>{if(e)return r();let n=this.read();if(n!==null)return Promise.resolve({done:!1,value:n});if(this[Pt])return r();let s,o,a=h=>{this.off("data",u),this.off("end",f),this.off(ye,c),r(),o(h)},u=h=>{this.off("error",a),this.off("end",f),this.off(ye,c),this.pause(),s({value:h,done:!!this[Pt]})},f=()=>{this.off("error",a),this.off("data",u),this.off(ye,c),r(),s({done:!0,value:void 0})},c=()=>a(new Error("stream destroyed"));return new Promise((h,p)=>{o=p,s=h,this.once(ye,c),this.once("error",a),this.once("end",f),this.once("data",u)})},throw:r,return:r,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[Ke]=!1;let e=!1,r=()=>(this.pause(),this.off(Cu,r),this.off(ye,r),this.off("end",r),e=!0,{done:!0,value:void 0}),i=()=>{if(e)return r();let n=this.read();return n===null?r():{done:!1,value:n}};return this.once("end",r),this.once(Cu,r),this.once(ye,r),{next:i,throw:r,return:r,[Symbol.iterator](){return this}}}destroy(e){if(this[ye])return e?this.emit("error",e):this.emit(ye),this;this[ye]=!0,this[Ke]=!0,this[Oe].length=0,this[Te]=0;let r=this;return typeof r.close=="function"&&!this[As]&&r.close(),e?this.emit("error",e):this.emit(ye),this}static get isStream(){return We.isStream}};We.Minipass=qs});var di=_(tt=>{"use strict";var J_=tt&&tt.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(tt,"__esModule",{value:!0});tt.WriteStreamSync=tt.WriteStream=tt.ReadStreamSync=tt.ReadStream=void 0;var FO=J_(require("events")),Ve=J_(require("fs")),AO=ui(),NO=Ve.default.writev,er=Symbol("_autoClose"),ht=Symbol("_close"),mn=Symbol("_ended"),ie=Symbol("_fd"),Du=Symbol("_finished"),Bt=Symbol("_flags"),Lu=Symbol("_flush"),Mu=Symbol("_handleChunk"),ju=Symbol("_makeBuf"),yn=Symbol("_mode"),Ps=Symbol("_needDrain"),fi=Symbol("_onerror"),hi=Symbol("_onopen"),Iu=Symbol("_onread"),ci=Symbol("_onwrite"),tr=Symbol("_open"),ft=Symbol("_path"),Jt=Symbol("_pos"),Et=Symbol("_queue"),li=Symbol("_read"),qu=Symbol("_readSize"),jt=Symbol("_reading"),_n=Symbol("_remain"),Pu=Symbol("_size"),Ms=Symbol("_write"),Tr=Symbol("_writing"),js=Symbol("_defaultFlag"),Cr=Symbol("_errored"),Bs=class extends AO.Minipass{[Cr]=!1;[ie];[ft];[qu];[jt]=!1;[Pu];[_n];[er];constructor(e,r){if(r=r||{},super(r),this.readable=!0,this.writable=!1,typeof e!="string")throw new TypeError("path must be a string");this[Cr]=!1,this[ie]=typeof r.fd=="number"?r.fd:void 0,this[ft]=e,this[qu]=r.readSize||16*1024*1024,this[jt]=!1,this[Pu]=typeof r.size=="number"?r.size:1/0,this[_n]=this[Pu],this[er]=typeof r.autoClose=="boolean"?r.autoClose:!0,typeof this[ie]=="number"?this[li]():this[tr]()}get fd(){return this[ie]}get path(){return this[ft]}write(){throw new TypeError("this is a readable stream")}end(){throw new TypeError("this is a readable stream")}[tr](){Ve.default.open(this[ft],"r",(e,r)=>this[hi](e,r))}[hi](e,r){e?this[fi](e):(this[ie]=r,this.emit("open",r),this[li]())}[ju](){return Buffer.allocUnsafe(Math.min(this[qu],this[_n]))}[li](){if(!this[jt]){this[jt]=!0;let e=this[ju]();if(e.length===0)return process.nextTick(()=>this[Iu](null,0,e));Ve.default.read(this[ie],e,0,e.length,null,(r,i,n)=>this[Iu](r,i,n))}}[Iu](e,r,i){this[jt]=!1,e?this[fi](e):this[Mu](r,i)&&this[li]()}[ht](){if(this[er]&&typeof this[ie]=="number"){let e=this[ie];this[ie]=void 0,Ve.default.close(e,r=>r?this.emit("error",r):this.emit("close"))}}[fi](e){this[jt]=!0,this[ht](),this.emit("error",e)}[Mu](e,r){let i=!1;return this[_n]-=e,e>0&&(i=super.write(ethis[hi](e,r))}[hi](e,r){this[js]&&this[Bt]==="r+"&&e&&e.code==="ENOENT"?(this[Bt]="w",this[tr]()):e?this[fi](e):(this[ie]=r,this.emit("open",r),this[Tr]||this[Lu]())}end(e,r){return e&&this.write(e,r),this[mn]=!0,!this[Tr]&&!this[Et].length&&typeof this[ie]=="number"&&this[ci](null,0),this}write(e,r){return typeof e=="string"&&(e=Buffer.from(e,r)),this[mn]?(this.emit("error",new Error("write() after end()")),!1):this[ie]===void 0||this[Tr]||this[Et].length?(this[Et].push(e),this[Ps]=!0,!1):(this[Tr]=!0,this[Ms](e),!0)}[Ms](e){Ve.default.write(this[ie],e,0,e.length,this[Jt],(r,i)=>this[ci](r,i))}[ci](e,r){e?this[fi](e):(this[Jt]!==void 0&&typeof r=="number"&&(this[Jt]+=r),this[Et].length?this[Lu]():(this[Tr]=!1,this[mn]&&!this[Du]?(this[Du]=!0,this[ht](),this.emit("finish")):this[Ps]&&(this[Ps]=!1,this.emit("drain"))))}[Lu](){if(this[Et].length===0)this[mn]&&this[ci](null,0);else if(this[Et].length===1)this[Ms](this[Et].pop());else{let e=this[Et];this[Et]=[],NO(this[ie],e,this[Jt],(r,i)=>this[ci](r,i))}}[ht](){if(this[er]&&typeof this[ie]=="number"){let e=this[ie];this[ie]=void 0,Ve.default.close(e,r=>r?this.emit("error",r):this.emit("close"))}}};tt.WriteStream=$s;var $u=class extends $s{[tr](){let e;if(this[js]&&this[Bt]==="r+")try{e=Ve.default.openSync(this[ft],this[Bt],this[yn])}catch(r){if(r?.code==="ENOENT")return this[Bt]="w",this[tr]();throw r}else e=Ve.default.openSync(this[ft],this[Bt],this[yn]);this[hi](null,e)}[ht](){if(this[er]&&typeof this[ie]=="number"){let e=this[ie];this[ie]=void 0,Ve.default.closeSync(e),this.emit("close")}}[Ms](e){let r=!0;try{this[ci](null,Ve.default.writeSync(this[ie],e,0,e.length,this[Jt])),r=!1}finally{if(r)try{this[ht]()}catch{}}}};tt.WriteStreamSync=$u});var Us=_(we=>{"use strict";Object.defineProperty(we,"__esModule",{value:!0});we.dealias=we.isNoFile=we.isFile=we.isAsync=we.isSync=we.isAsyncNoFile=we.isSyncNoFile=we.isAsyncFile=we.isSyncFile=void 0;var DO=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"],["onentry","onReadEntry"]]),LO=t=>!!t.sync&&!!t.file;we.isSyncFile=LO;var IO=t=>!t.sync&&!!t.file;we.isAsyncFile=IO;var qO=t=>!!t.sync&&!t.file;we.isSyncNoFile=qO;var PO=t=>!t.sync&&!t.file;we.isAsyncNoFile=PO;var MO=t=>!!t.sync;we.isSync=MO;var jO=t=>!t.sync;we.isAsync=jO;var BO=t=>!!t.file;we.isFile=BO;var $O=t=>!t.file;we.isNoFile=$O;var UO=t=>{let e=DO.get(t);return e||t},zO=(t={})=>{if(!t)return{};let e={};for(let[r,i]of Object.entries(t)){let n=UO(r);e[n]=i}return e.chmod===void 0&&e.noChmod===!1&&(e.chmod=!0),delete e.noChmod,e};we.dealias=zO});var pi=_(zs=>{"use strict";Object.defineProperty(zs,"__esModule",{value:!0});zs.makeCommand=void 0;var vn=Us(),WO=(t,e,r,i,n)=>Object.assign((s=[],o,a)=>{Array.isArray(s)&&(o=s,s={}),typeof o=="function"&&(a=o,o=void 0),o?o=Array.from(o):o=[];let u=(0,vn.dealias)(s);if(n?.(u,o),(0,vn.isSyncFile)(u)){if(typeof a=="function")throw new TypeError("callback not supported for sync tar functions");return t(u,o)}else if((0,vn.isAsyncFile)(u)){let f=e(u,o),c=a||void 0;return c?f.then(()=>c(),c):f}else if((0,vn.isSyncNoFile)(u)){if(typeof a=="function")throw new TypeError("callback not supported for sync tar functions");return r(u,o)}else if((0,vn.isAsyncNoFile)(u)){if(typeof a=="function")throw new TypeError("callback only supported with file option");return i(u,o)}else throw new Error("impossible options??")},{syncFile:t,asyncFile:e,syncNoFile:r,asyncNoFile:i,validate:n});zs.makeCommand=WO});var Uu=_(mi=>{"use strict";var HO=mi&&mi.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(mi,"__esModule",{value:!0});mi.constants=void 0;var GO=HO(require("zlib")),VO=GO.default.constants||{ZLIB_VERNUM:4736};mi.constants=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},VO))});var ec=_(ne=>{"use strict";var ty=ne&&ne.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ne,"__esModule",{value:!0});ne.BrotliDecompress=ne.BrotliCompress=ne.Brotli=ne.Unzip=ne.InflateRaw=ne.DeflateRaw=ne.Gunzip=ne.Gzip=ne.Inflate=ne.Deflate=ne.Zlib=ne.ZlibError=ne.constants=void 0;var Wu=ty(require("assert")),rr=require("buffer"),XO=ui(),KO=ty(require("zlib")),xr=Uu(),YO=Uu();Object.defineProperty(ne,"constants",{enumerable:!0,get:function(){return YO.constants}});var ey=rr.Buffer.concat,kr=Symbol("_superWrite"),Fr=class extends Error{code;errno;constructor(e){super("zlib: "+e.message),this.code=e.code,this.errno=e.errno,this.code||(this.code="ZLIB_ERROR"),this.message="zlib: "+e.message,Error.captureStackTrace(this,this.constructor)}get name(){return"ZlibError"}};ne.ZlibError=Fr;var zu=Symbol("flushFlag"),Ws=class extends XO.Minipass{#e=!1;#r=!1;#i;#s;#n;#t;#o;get sawError(){return this.#e}get handle(){return this.#t}get flushFlag(){return this.#i}constructor(e,r){if(!e||typeof e!="object")throw new TypeError("invalid options for ZlibBase constructor");super(e),this.#i=e.flush??0,this.#s=e.finishFlush??0,this.#n=e.fullFlushFlag??0;try{this.#t=new KO.default[r](e)}catch(i){throw new Fr(i)}this.#o=i=>{this.#e||(this.#e=!0,this.close(),this.emit("error",i))},this.#t?.on("error",i=>this.#o(new Fr(i))),this.once("end",()=>this.close)}close(){this.#t&&(this.#t.close(),this.#t=void 0,this.emit("close"))}reset(){if(!this.#e)return(0,Wu.default)(this.#t,"zlib binding closed"),this.#t.reset?.()}flush(e){this.ended||(typeof e!="number"&&(e=this.#n),this.write(Object.assign(rr.Buffer.alloc(0),{[zu]:e})))}end(e,r,i){return typeof e=="function"&&(i=e,r=void 0,e=void 0),typeof r=="function"&&(i=r,r=void 0),e&&(r?this.write(e,r):this.write(e)),this.flush(this.#s),this.#r=!0,super.end(i)}get ended(){return this.#r}[kr](e){return super.write(e)}write(e,r,i){if(typeof r=="function"&&(i=r,r="utf8"),typeof e=="string"&&(e=rr.Buffer.from(e,r)),this.#e)return;(0,Wu.default)(this.#t,"zlib binding closed");let n=this.#t._handle,s=n.close;n.close=()=>{};let o=this.#t.close;this.#t.close=()=>{},rr.Buffer.concat=f=>f;let a;try{let f=typeof e[zu]=="number"?e[zu]:this.#i;a=this.#t._processChunk(e,f),rr.Buffer.concat=ey}catch(f){rr.Buffer.concat=ey,this.#o(new Fr(f))}finally{this.#t&&(this.#t._handle=n,n.close=s,this.#t.close=o,this.#t.removeAllListeners("error"))}this.#t&&this.#t.on("error",f=>this.#o(new Fr(f)));let u;if(a)if(Array.isArray(a)&&a.length>0){let f=a[0];u=this[kr](rr.Buffer.from(f));for(let c=1;c{typeof n=="function"&&(s=n,n=this.flushFlag),this.flush(n),s?.()};try{this.handle.params(e,r)}finally{this.handle.flush=i}this.handle&&(this.#e=e,this.#r=r)}}}};ne.Zlib=St;var Hu=class extends St{constructor(e){super(e,"Deflate")}};ne.Deflate=Hu;var Gu=class extends St{constructor(e){super(e,"Inflate")}};ne.Inflate=Gu;var Vu=class extends St{#e;constructor(e){super(e,"Gzip"),this.#e=e&&!!e.portable}[kr](e){return this.#e?(this.#e=!1,e[9]=255,super[kr](e)):super[kr](e)}};ne.Gzip=Vu;var Xu=class extends St{constructor(e){super(e,"Gunzip")}};ne.Gunzip=Xu;var Ku=class extends St{constructor(e){super(e,"DeflateRaw")}};ne.DeflateRaw=Ku;var Yu=class extends St{constructor(e){super(e,"InflateRaw")}};ne.InflateRaw=Yu;var Zu=class extends St{constructor(e){super(e,"Unzip")}};ne.Unzip=Zu;var gn=class extends Ws{constructor(e,r){e=e||{},e.flush=e.flush||xr.constants.BROTLI_OPERATION_PROCESS,e.finishFlush=e.finishFlush||xr.constants.BROTLI_OPERATION_FINISH,e.fullFlushFlag=xr.constants.BROTLI_OPERATION_FLUSH,super(e,r)}};ne.Brotli=gn;var Qu=class extends gn{constructor(e){super(e,"BrotliCompress")}};ne.BrotliCompress=Qu;var Ju=class extends gn{constructor(e){super(e,"BrotliDecompress")}};ne.BrotliDecompress=Ju});var rc=_(yi=>{"use strict";Object.defineProperty(yi,"__esModule",{value:!0});yi.Node=yi.Yallist=void 0;var tc=class t{tail;head;length=0;static create(e=[]){return new t(e)}constructor(e=[]){for(let r of e)this.push(r)}*[Symbol.iterator](){for(let e=this.head;e;e=e.next)yield e.value}removeNode(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");let r=e.next,i=e.prev;return r&&(r.prev=i),i&&(i.next=r),e===this.head&&(this.head=r),e===this.tail&&(this.tail=i),this.length--,e.next=void 0,e.prev=void 0,e.list=void 0,r}unshiftNode(e){if(e===this.head)return;e.list&&e.list.removeNode(e);let r=this.head;e.list=this,e.next=r,r&&(r.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}pushNode(e){if(e===this.tail)return;e.list&&e.list.removeNode(e);let r=this.tail;e.list=this,e.prev=r,r&&(r.next=e),this.tail=e,this.head||(this.head=e),this.length++}push(...e){for(let r=0,i=e.length;r1)i=r;else if(this.head)n=this.head.next,i=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var s=0;n;s++)i=e(i,n.value,s),n=n.next;return i}reduceReverse(e,r){let i,n=this.tail;if(arguments.length>1)i=r;else if(this.tail)n=this.tail.prev,i=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(let s=this.length-1;n;s--)i=e(i,n.value,s),n=n.prev;return i}toArray(){let e=new Array(this.length);for(let r=0,i=this.head;i;r++)e[r]=i.value,i=i.next;return e}toArrayReverse(){let e=new Array(this.length);for(let r=0,i=this.tail;i;r++)e[r]=i.value,i=i.prev;return e}slice(e=0,r=this.length){r<0&&(r+=this.length),e<0&&(e+=this.length);let i=new t;if(rthis.length&&(r=this.length);let n=this.head,s=0;for(s=0;n&&sthis.length&&(r=this.length);let n=this.length,s=this.tail;for(;s&&n>r;n--)s=s.prev;for(;s&&n>e;n--,s=s.prev)i.push(s.value);return i}splice(e,r=0,...i){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);let n=this.head;for(let o=0;n&&o{"use strict";Object.defineProperty(vi,"__esModule",{value:!0});vi.parse=vi.encode=void 0;var eT=(t,e)=>{if(Number.isSafeInteger(t))t<0?rT(t,e):tT(t,e);else throw Error("cannot encode number outside of javascript safe integer range");return e};vi.encode=eT;var tT=(t,e)=>{e[0]=128;for(var r=e.length;r>1;r--)e[r-1]=t&255,t=Math.floor(t/256)},rT=(t,e)=>{e[0]=255;var r=!1;t=t*-1;for(var i=e.length;i>1;i--){var n=t&255;t=Math.floor(t/256),r?e[i-1]=ry(n):n===0?e[i-1]=0:(r=!0,e[i-1]=iy(n))}},iT=t=>{let e=t[0],r=e===128?sT(t.subarray(1,t.length)):e===255?nT(t):null;if(r===null)throw Error("invalid base256 encoding");if(!Number.isSafeInteger(r))throw Error("parsed number outside of javascript safe integer range");return r};vi.parse=iT;var nT=t=>{for(var e=t.length,r=0,i=!1,n=e-1;n>-1;n--){var s=Number(t[n]),o;i?o=ry(s):s===0?o=s:(i=!0,o=iy(s)),o!==0&&(r-=o*Math.pow(256,e-n-1))}return r},sT=t=>{for(var e=t.length,r=0,i=e-1;i>-1;i--){var n=Number(t[i]);n!==0&&(r+=n*Math.pow(256,e-i-1))}return r},ry=t=>(255^t)&255,iy=t=>(255^t)+1&255});var nc=_(Ye=>{"use strict";Object.defineProperty(Ye,"__esModule",{value:!0});Ye.code=Ye.name=Ye.isName=Ye.isCode=void 0;var oT=t=>Ye.name.has(t);Ye.isCode=oT;var aT=t=>Ye.code.has(t);Ye.isName=aT;Ye.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"]]);Ye.code=new Map(Array.from(Ye.name).map(t=>[t[1],t[0]]))});var wi=_(bt=>{"use strict";var uT=bt&&bt.__createBinding||(Object.create?function(t,e,r,i){i===void 0&&(i=r);var n=Object.getOwnPropertyDescriptor(e,r);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,i,n)}:function(t,e,r,i){i===void 0&&(i=r),t[i]=e[r]}),cT=bt&&bt.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),sy=bt&&bt.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&uT(e,t,r);return cT(e,t),e};Object.defineProperty(bt,"__esModule",{value:!0});bt.Header=void 0;var gi=require("node:path"),oy=sy(ny()),wn=sy(nc()),ac=class{cksumValid=!1;needPax=!1;nullBlock=!1;block;path;mode;uid;gid;size;cksum;#e="Unsupported";linkpath;uname;gname;devmaj=0;devmin=0;atime;ctime;mtime;charset;comment;constructor(e,r=0,i,n){Buffer.isBuffer(e)?this.decode(e,r||0,i,n):e&&this.#r(e)}decode(e,r,i,n){if(r||(r=0),!e||!(e.length>=r+512))throw new Error("need 512 bytes for header");this.path=Ar(e,r,100),this.mode=ir(e,r+100,8),this.uid=ir(e,r+108,8),this.gid=ir(e,r+116,8),this.size=ir(e,r+124,12),this.mtime=sc(e,r+136,12),this.cksum=ir(e,r+148,12),n&&this.#r(n,!0),i&&this.#r(i);let s=Ar(e,r+156,1);if(wn.isCode(s)&&(this.#e=s||"0"),this.#e==="0"&&this.path.slice(-1)==="/"&&(this.#e="5"),this.#e==="5"&&(this.size=0),this.linkpath=Ar(e,r+157,100),e.subarray(r+257,r+265).toString()==="ustar\x0000")if(this.uname=Ar(e,r+265,32),this.gname=Ar(e,r+297,32),this.devmaj=ir(e,r+329,8)??0,this.devmin=ir(e,r+337,8)??0,e[r+475]!==0){let a=Ar(e,r+345,155);this.path=a+"/"+this.path}else{let a=Ar(e,r+345,130);a&&(this.path=a+"/"+this.path),this.atime=sc(e,r+476,12),this.ctime=sc(e,r+488,12)}let o=8*32;for(let a=r;a!(n==null||i==="path"&&r||i==="linkpath"&&r||i==="global"))))}encode(e,r=0){if(e||(e=this.block=Buffer.alloc(512)),this.#e==="Unsupported"&&(this.#e="0"),!(e.length>=r+512))throw new Error("need 512 bytes for header");let i=this.ctime||this.atime?130:155,n=lT(this.path||"",i),s=n[0],o=n[1];this.needPax=!!n[2],this.needPax=Nr(e,r,100,s)||this.needPax,this.needPax=nr(e,r+100,8,this.mode)||this.needPax,this.needPax=nr(e,r+108,8,this.uid)||this.needPax,this.needPax=nr(e,r+116,8,this.gid)||this.needPax,this.needPax=nr(e,r+124,12,this.size)||this.needPax,this.needPax=oc(e,r+136,12,this.mtime)||this.needPax,e[r+156]=this.#e.charCodeAt(0),this.needPax=Nr(e,r+157,100,this.linkpath)||this.needPax,e.write("ustar\x0000",r+257,8),this.needPax=Nr(e,r+265,32,this.uname)||this.needPax,this.needPax=Nr(e,r+297,32,this.gname)||this.needPax,this.needPax=nr(e,r+329,8,this.devmaj)||this.needPax,this.needPax=nr(e,r+337,8,this.devmin)||this.needPax,this.needPax=Nr(e,r+345,i,o)||this.needPax,e[r+475]!==0?this.needPax=Nr(e,r+345,155,o)||this.needPax:(this.needPax=Nr(e,r+345,130,o)||this.needPax,this.needPax=oc(e,r+476,12,this.atime)||this.needPax,this.needPax=oc(e,r+488,12,this.ctime)||this.needPax);let a=8*32;for(let u=r;u{let i=t,n="",s,o=gi.posix.parse(t).root||".";if(Buffer.byteLength(i)<100)s=[i,n,!1];else{n=gi.posix.dirname(i),i=gi.posix.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.slice(0,99),n,!0]:(i=gi.posix.join(gi.posix.basename(n),i),n=gi.posix.dirname(n));while(n!==o&&s===void 0);s||(s=[t.slice(0,99),"",!0])}return s},Ar=(t,e,r)=>t.subarray(e,e+r).toString("utf8").replace(/\0.*/,""),sc=(t,e,r)=>fT(ir(t,e,r)),fT=t=>t===void 0?void 0:new Date(t*1e3),ir=(t,e,r)=>Number(t[e])&128?oy.parse(t.subarray(e,e+r)):dT(t,e,r),hT=t=>isNaN(t)?void 0:t,dT=(t,e,r)=>hT(parseInt(t.subarray(e,e+r).toString("utf8").replace(/\0.*$/,"").trim(),8)),pT={12:8589934591,8:2097151},nr=(t,e,r,i)=>i===void 0?!1:i>pT[r]||i<0?(oy.encode(i,t.subarray(e,e+r)),!0):(mT(t,e,r,i),!1),mT=(t,e,r,i)=>t.write(_T(i,r),e,r,"ascii"),_T=(t,e)=>yT(Math.floor(t).toString(8),e),yT=(t,e)=>(t.length===e-1?t:new Array(e-t.length-1).join("0")+t+" ")+"\0",oc=(t,e,r,i)=>i===void 0?!1:nr(t,e,r,i.getTime()/1e3),vT=new Array(156).join("\0"),Nr=(t,e,r,i)=>i===void 0?!1:(t.write(i+vT,e,r,"utf8"),i.length!==Buffer.byteLength(i)||i.length>r)});var Gs=_(Hs=>{"use strict";Object.defineProperty(Hs,"__esModule",{value:!0});Hs.Pax=void 0;var gT=require("node:path"),wT=wi(),uc=class t{atime;mtime;ctime;charset;comment;gid;uid;gname;uname;linkpath;dev;ino;nlink;path;size;mode;global;constructor(e,r=!1){this.atime=e.atime,this.charset=e.charset,this.comment=e.comment,this.ctime=e.ctime,this.dev=e.dev,this.gid=e.gid,this.global=r,this.gname=e.gname,this.ino=e.ino,this.linkpath=e.linkpath,this.mtime=e.mtime,this.nlink=e.nlink,this.path=e.path,this.size=e.size,this.uid=e.uid,this.uname=e.uname}encode(){let e=this.encodeBody();if(e==="")return Buffer.allocUnsafe(0);let r=Buffer.byteLength(e),i=512*Math.ceil(1+r/512),n=Buffer.allocUnsafe(i);for(let s=0;s<512;s++)n[s]=0;new wT.Header({path:("PaxHeader/"+(0,gT.basename)(this.path??"")).slice(0,99),mode:this.mode||420,uid:this.uid,gid:this.gid,size:r,mtime:this.mtime,type:this.global?"GlobalExtendedHeader":"ExtendedHeader",linkpath:"",uname:this.uname||"",gname:this.gname||"",devmaj:0,devmin:0,atime:this.atime,ctime:this.ctime}).encode(n),n.write(e,512,r,"utf8");for(let s=r+512;s=Math.pow(10,o)&&(o+=1),o+s+n}static parse(e,r,i=!1){return new t(ET(ST(e),r),i)}};Hs.Pax=uc;var ET=(t,e)=>e?Object.assign({},e,t):t,ST=t=>t.replace(/\n$/,"").split(` +`).reduce(bT,Object.create(null)),bT=(t,e)=>{let r=parseInt(e,10);if(r!==Buffer.byteLength(e)+1)return t;e=e.slice((r+" ").length);let i=e.split("="),n=i.shift();if(!n)return t;let s=n.replace(/^SCHILY\.(dev|ino|nlink)/,"$1"),o=i.join("=");return t[s]=/^([A-Z]+\.)?([mac]|birth|creation)time$/.test(s)?new Date(Number(o)*1e3):/^[0-9]+$/.test(o)?+o:o,t}});var Ei=_(Vs=>{"use strict";Object.defineProperty(Vs,"__esModule",{value:!0});Vs.normalizeWindowsPath=void 0;var RT=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform;Vs.normalizeWindowsPath=RT!=="win32"?t=>t:t=>t&&t.replace(/\\/g,"/")});var Ys=_(Ks=>{"use strict";Object.defineProperty(Ks,"__esModule",{value:!0});Ks.ReadEntry=void 0;var OT=ui(),Xs=Ei(),cc=class extends OT.Minipass{extended;globalExtended;header;startBlockSize;blockRemain;remain;type;meta=!1;ignore=!1;path;mode;uid;gid;uname;gname;size=0;mtime;atime;ctime;linkpath;dev;ino;nlink;invalid=!1;absolute;unsupported=!1;constructor(e,r,i){switch(super({}),this.pause(),this.extended=r,this.globalExtended=i,this.header=e,this.remain=e.size??0,this.startBlockSize=512*Math.ceil(this.remain/512),this.blockRemain=this.startBlockSize,this.type=e.type,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}if(!e.path)throw new Error("no path provided for tar.ReadEntry");this.path=(0,Xs.normalizeWindowsPath)(e.path),this.mode=e.mode,this.mode&&(this.mode=this.mode&4095),this.uid=e.uid,this.gid=e.gid,this.uname=e.uname,this.gname=e.gname,this.size=this.remain,this.mtime=e.mtime,this.atime=e.atime,this.ctime=e.ctime,this.linkpath=e.linkpath?(0,Xs.normalizeWindowsPath)(e.linkpath):void 0,this.uname=e.uname,this.gname=e.gname,r&&this.#e(r),i&&this.#e(i,!0)}write(e){let r=e.length;if(r>this.blockRemain)throw new Error("writing more to entry than is appropriate");let i=this.remain,n=this.blockRemain;return this.remain=Math.max(0,i-r),this.blockRemain=Math.max(0,n-r),this.ignore?!0:i>=r?super.write(e):super.write(e.subarray(0,i))}#e(e,r=!1){e.path&&(e.path=(0,Xs.normalizeWindowsPath)(e.path)),e.linkpath&&(e.linkpath=(0,Xs.normalizeWindowsPath)(e.linkpath)),Object.assign(this,Object.fromEntries(Object.entries(e).filter(([i,n])=>!(n==null||i==="path"&&r))))}};Ks.ReadEntry=cc});var Qs=_(Zs=>{"use strict";Object.defineProperty(Zs,"__esModule",{value:!0});Zs.warnMethod=void 0;var TT=(t,e,r,i={})=>{t.file&&(i.file=t.file),t.cwd&&(i.cwd=t.cwd),i.code=r instanceof Error&&r.code||e,i.tarCode=e,!t.strict&&i.recoverable!==!1?(r instanceof Error&&(i=Object.assign(r,i),r=r.message),t.emit("warn",e,r,i)):r instanceof Error?t.emit("error",Object.assign(r,i)):t.emit("error",Object.assign(new Error(`${e}: ${r}`),i))};Zs.warnMethod=TT});var oo=_(so=>{"use strict";Object.defineProperty(so,"__esModule",{value:!0});so.Parser=void 0;var CT=require("events"),ay=ec(),xT=rc(),uy=wi(),cy=Gs(),kT=Ys(),FT=Qs(),AT=1024*1024,lc=Buffer.from([31,139]),rt=Symbol("state"),Dr=Symbol("writeEntry"),$t=Symbol("readEntry"),fc=Symbol("nextEntry"),ly=Symbol("processEntry"),Rt=Symbol("extendedHeader"),En=Symbol("globalExtendedHeader"),sr=Symbol("meta"),fy=Symbol("emitMeta"),ce=Symbol("buffer"),Ut=Symbol("queue"),or=Symbol("ended"),hc=Symbol("emittedEnd"),Lr=Symbol("emit"),Ee=Symbol("unzip"),Js=Symbol("consumeChunk"),eo=Symbol("consumeChunkSub"),dc=Symbol("consumeBody"),hy=Symbol("consumeMeta"),dy=Symbol("consumeHeader"),Sn=Symbol("consuming"),pc=Symbol("bufferConcat"),to=Symbol("maybeEnd"),Si=Symbol("writing"),ar=Symbol("aborted"),ro=Symbol("onDone"),Ir=Symbol("sawValidEntry"),io=Symbol("sawNullBlock"),no=Symbol("sawEOF"),py=Symbol("closeStream"),NT=()=>!0,mc=class extends CT.EventEmitter{file;strict;maxMetaEntrySize;filter;brotli;writable=!0;readable=!1;[Ut]=new xT.Yallist;[ce];[$t];[Dr];[rt]="begin";[sr]="";[Rt];[En];[or]=!1;[Ee];[ar]=!1;[Ir];[io]=!1;[no]=!1;[Si]=!1;[Sn]=!1;[hc]=!1;constructor(e={}){super(),this.file=e.file||"",this.on(ro,()=>{(this[rt]==="begin"||this[Ir]===!1)&&this.warn("TAR_BAD_ARCHIVE","Unrecognized archive format")}),e.ondone?this.on(ro,e.ondone):this.on(ro,()=>{this.emit("prefinish"),this.emit("finish"),this.emit("end")}),this.strict=!!e.strict,this.maxMetaEntrySize=e.maxMetaEntrySize||AT,this.filter=typeof e.filter=="function"?e.filter:NT;let r=e.file&&(e.file.endsWith(".tar.br")||e.file.endsWith(".tbr"));this.brotli=!e.gzip&&e.brotli!==void 0?e.brotli:r?void 0:!1,this.on("end",()=>this[py]()),typeof e.onwarn=="function"&&this.on("warn",e.onwarn),typeof e.onReadEntry=="function"&&this.on("entry",e.onReadEntry)}warn(e,r,i={}){(0,FT.warnMethod)(this,e,r,i)}[dy](e,r){this[Ir]===void 0&&(this[Ir]=!1);let i;try{i=new uy.Header(e,r,this[Rt],this[En])}catch(n){return this.warn("TAR_ENTRY_INVALID",n)}if(i.nullBlock)this[io]?(this[no]=!0,this[rt]==="begin"&&(this[rt]="header"),this[Lr]("eof")):(this[io]=!0,this[Lr]("nullBlock"));else if(this[io]=!1,!i.cksumValid)this.warn("TAR_ENTRY_INVALID","checksum failure",{header:i});else if(!i.path)this.warn("TAR_ENTRY_INVALID","path is required",{header:i});else{let n=i.type;if(/^(Symbolic)?Link$/.test(n)&&!i.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath required",{header:i});else if(!/^(Symbolic)?Link$/.test(n)&&!/^(Global)?ExtendedHeader$/.test(n)&&i.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath forbidden",{header:i});else{let s=this[Dr]=new kT.ReadEntry(i,this[Rt],this[En]);if(!this[Ir])if(s.remain){let o=()=>{s.invalid||(this[Ir]=!0)};s.on("end",o)}else this[Ir]=!0;s.meta?s.size>this.maxMetaEntrySize?(s.ignore=!0,this[Lr]("ignoredEntry",s),this[rt]="ignore",s.resume()):s.size>0&&(this[sr]="",s.on("data",o=>this[sr]+=o),this[rt]="meta"):(this[Rt]=void 0,s.ignore=s.ignore||!this.filter(s.path,s),s.ignore?(this[Lr]("ignoredEntry",s),this[rt]=s.remain?"ignore":"header",s.resume()):(s.remain?this[rt]="body":(this[rt]="header",s.end()),this[$t]?this[Ut].push(s):(this[Ut].push(s),this[fc]())))}}}[py](){queueMicrotask(()=>this.emit("close"))}[ly](e){let r=!0;if(!e)this[$t]=void 0,r=!1;else if(Array.isArray(e)){let[i,...n]=e;this.emit(i,...n)}else this[$t]=e,this.emit("entry",e),e.emittedEnd||(e.on("end",()=>this[fc]()),r=!1);return r}[fc](){do;while(this[ly](this[Ut].shift()));if(!this[Ut].length){let e=this[$t];!e||e.flowing||e.size===e.remain?this[Si]||this.emit("drain"):e.once("drain",()=>this.emit("drain"))}}[dc](e,r){let i=this[Dr];if(!i)throw new Error("attempt to consume body without entry??");let n=i.blockRemain??0,s=n>=e.length&&r===0?e:e.subarray(r,r+n);return i.write(s),i.blockRemain||(this[rt]="header",this[Dr]=void 0,i.end()),s.length}[hy](e,r){let i=this[Dr],n=this[dc](e,r);return!this[Dr]&&i&&this[fy](i),n}[Lr](e,r,i){!this[Ut].length&&!this[$t]?this.emit(e,r,i):this[Ut].push([e,r,i])}[fy](e){switch(this[Lr]("meta",this[sr]),e.type){case"ExtendedHeader":case"OldExtendedHeader":this[Rt]=cy.Pax.parse(this[sr],this[Rt],!1);break;case"GlobalExtendedHeader":this[En]=cy.Pax.parse(this[sr],this[En],!0);break;case"NextFileHasLongPath":case"OldGnuLongPath":{let r=this[Rt]??Object.create(null);this[Rt]=r,r.path=this[sr].replace(/\0.*/,"");break}case"NextFileHasLongLinkpath":{let r=this[Rt]||Object.create(null);this[Rt]=r,r.linkpath=this[sr].replace(/\0.*/,"");break}default:throw new Error("unknown meta: "+e.type)}}abort(e){this[ar]=!0,this.emit("abort",e),this.warn("TAR_ABORT",e,{recoverable:!1})}write(e,r,i){if(typeof r=="function"&&(i=r,r=void 0),typeof e=="string"&&(e=Buffer.from(e,typeof r=="string"?r:"utf8")),this[ar])return i?.(),!1;if((this[Ee]===void 0||this.brotli===void 0&&this[Ee]===!1)&&e){if(this[ce]&&(e=Buffer.concat([this[ce],e]),this[ce]=void 0),e.lengththis[Js](f)),this[Ee].on("error",f=>this.abort(f)),this[Ee].on("end",()=>{this[or]=!0,this[Js]()}),this[Si]=!0;let u=!!this[Ee][a?"end":"write"](e);return this[Si]=!1,i?.(),u}}this[Si]=!0,this[Ee]?this[Ee].write(e):this[Js](e),this[Si]=!1;let s=this[Ut].length?!1:this[$t]?this[$t].flowing:!0;return!s&&!this[Ut].length&&this[$t]?.once("drain",()=>this.emit("drain")),i?.(),s}[pc](e){e&&!this[ar]&&(this[ce]=this[ce]?Buffer.concat([this[ce],e]):e)}[to](){if(this[or]&&!this[hc]&&!this[ar]&&!this[Sn]){this[hc]=!0;let e=this[Dr];if(e&&e.blockRemain){let r=this[ce]?this[ce].length:0;this.warn("TAR_BAD_ARCHIVE",`Truncated input (needed ${e.blockRemain} more bytes, only ${r} available)`,{entry:e}),this[ce]&&e.write(this[ce]),e.end()}this[Lr](ro)}}[Js](e){if(this[Sn]&&e)this[pc](e);else if(!e&&!this[ce])this[to]();else if(e){if(this[Sn]=!0,this[ce]){this[pc](e);let r=this[ce];this[ce]=void 0,this[eo](r)}else this[eo](e);for(;this[ce]&&this[ce]?.length>=512&&!this[ar]&&!this[no];){let r=this[ce];this[ce]=void 0,this[eo](r)}this[Sn]=!1}(!this[ce]||this[or])&&this[to]()}[eo](e){let r=0,i=e.length;for(;r+512<=i&&!this[ar]&&!this[no];)switch(this[rt]){case"begin":case"header":this[dy](e,r),r+=512;break;case"ignore":case"body":r+=this[dc](e,r);break;case"meta":r+=this[hy](e,r);break;default:throw new Error("invalid state: "+this[rt])}r{"use strict";Object.defineProperty(ao,"__esModule",{value:!0});ao.stripTrailingSlashes=void 0;var DT=t=>{let e=t.length-1,r=-1;for(;e>-1&&t.charAt(e)==="/";)r=e,e--;return r===-1?t:t.slice(0,r)};ao.stripTrailingSlashes=DT});var Ri=_(He=>{"use strict";var LT=He&&He.__createBinding||(Object.create?function(t,e,r,i){i===void 0&&(i=r);var n=Object.getOwnPropertyDescriptor(e,r);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,i,n)}:function(t,e,r,i){i===void 0&&(i=r),t[i]=e[r]}),IT=He&&He.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),qT=He&&He.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&<(e,t,r);return IT(e,t),e},PT=He&&He.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(He,"__esModule",{value:!0});He.list=He.filesFilter=void 0;var MT=qT(di()),bi=PT(require("node:fs")),my=require("path"),jT=pi(),uo=oo(),_c=bn(),BT=t=>{let e=t.onReadEntry;t.onReadEntry=e?r=>{e(r),r.resume()}:r=>r.resume()},$T=(t,e)=>{let r=new Map(e.map(s=>[(0,_c.stripTrailingSlashes)(s),!0])),i=t.filter,n=(s,o="")=>{let a=o||(0,my.parse)(s).root||".",u;if(s===a)u=!1;else{let f=r.get(s);f!==void 0?u=f:u=n((0,my.dirname)(s),a)}return r.set(s,u),u};t.filter=i?(s,o)=>i(s,o)&&n((0,_c.stripTrailingSlashes)(s)):s=>n((0,_c.stripTrailingSlashes)(s))};He.filesFilter=$T;var UT=t=>{let e=new uo.Parser(t),r=t.file,i;try{let n=bi.default.statSync(r),s=t.maxReadSize||16*1024*1024;if(n.size{let r=new uo.Parser(t),i=t.maxReadSize||16*1024*1024,n=t.file;return new Promise((o,a)=>{r.on("error",a),r.on("end",o),bi.default.stat(n,(u,f)=>{if(u)a(u);else{let c=new MT.ReadStream(n,{readSize:i,size:f.size});c.on("error",a),c.pipe(r)}})})};He.list=(0,jT.makeCommand)(UT,zT,t=>new uo.Parser(t),t=>new uo.Parser(t),(t,e)=>{e?.length&&(0,He.filesFilter)(t,e),t.noResume||BT(t)})});var _y=_(co=>{"use strict";Object.defineProperty(co,"__esModule",{value:!0});co.modeFix=void 0;var WT=(t,e,r)=>(t&=4095,r&&(t=(t|384)&-19),e&&(t&256&&(t|=64),t&32&&(t|=8),t&4&&(t|=1)),t);co.modeFix=WT});var yc=_(lo=>{"use strict";Object.defineProperty(lo,"__esModule",{value:!0});lo.stripAbsolutePath=void 0;var HT=require("node:path"),{isAbsolute:GT,parse:yy}=HT.win32,VT=t=>{let e="",r=yy(t);for(;GT(t)||r.root;){let i=t.charAt(0)==="/"&&t.slice(0,4)!=="//?/"?"/":r.root;t=t.slice(i.length),e+=i,r=yy(t)}return[e,t]};lo.stripAbsolutePath=VT});var gc=_(Oi=>{"use strict";Object.defineProperty(Oi,"__esModule",{value:!0});Oi.decode=Oi.encode=void 0;var fo=["|","<",">","?",":"],vc=fo.map(t=>String.fromCharCode(61440+t.charCodeAt(0))),XT=new Map(fo.map((t,e)=>[t,vc[e]])),KT=new Map(vc.map((t,e)=>[t,fo[e]])),YT=t=>fo.reduce((e,r)=>e.split(r).join(XT.get(r)),t);Oi.encode=YT;var ZT=t=>vc.reduce((e,r)=>e.split(r).join(KT.get(r)),t);Oi.decode=ZT});var Fc=_(De=>{"use strict";var QT=De&&De.__createBinding||(Object.create?function(t,e,r,i){i===void 0&&(i=r);var n=Object.getOwnPropertyDescriptor(e,r);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,i,n)}:function(t,e,r,i){i===void 0&&(i=r),t[i]=e[r]}),JT=De&&De.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),eC=De&&De.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&QT(e,t,r);return JT(e,t),e},by=De&&De.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(De,"__esModule",{value:!0});De.WriteEntryTar=De.WriteEntrySync=De.WriteEntry=void 0;var Tt=by(require("fs")),Ry=ui(),vy=by(require("path")),Oy=wi(),Ty=_y(),Ot=Ei(),Cy=Us(),xy=Gs(),ky=yc(),tC=bn(),Fy=Qs(),rC=eC(gc()),Ay=(t,e)=>e?(t=(0,Ot.normalizeWindowsPath)(t).replace(/^\.(\/|$)/,""),(0,tC.stripTrailingSlashes)(e)+"/"+t):(0,Ot.normalizeWindowsPath)(t),iC=16*1024*1024,gy=Symbol("process"),wy=Symbol("file"),Ey=Symbol("directory"),Ec=Symbol("symlink"),Sy=Symbol("hardlink"),Rn=Symbol("header"),ho=Symbol("read"),Sc=Symbol("lstat"),po=Symbol("onlstat"),bc=Symbol("onread"),Rc=Symbol("onreadlink"),Oc=Symbol("openfile"),Tc=Symbol("onopenfile"),ur=Symbol("close"),mo=Symbol("mode"),Cc=Symbol("awaitDrain"),wc=Symbol("ondrain"),Ct=Symbol("prefix"),_o=class extends Ry.Minipass{path;portable;myuid=process.getuid&&process.getuid()||0;myuser=process.env.USER||"";maxReadSize;linkCache;statCache;preservePaths;cwd;strict;mtime;noPax;noMtime;prefix;fd;blockLen=0;blockRemain=0;buf;pos=0;remain=0;length=0;offset=0;win32;absolute;header;type;linkpath;stat;onWriteEntry;#e=!1;constructor(e,r={}){let i=(0,Cy.dealias)(r);super(),this.path=(0,Ot.normalizeWindowsPath)(e),this.portable=!!i.portable,this.maxReadSize=i.maxReadSize||iC,this.linkCache=i.linkCache||new Map,this.statCache=i.statCache||new Map,this.preservePaths=!!i.preservePaths,this.cwd=(0,Ot.normalizeWindowsPath)(i.cwd||process.cwd()),this.strict=!!i.strict,this.noPax=!!i.noPax,this.noMtime=!!i.noMtime,this.mtime=i.mtime,this.prefix=i.prefix?(0,Ot.normalizeWindowsPath)(i.prefix):void 0,this.onWriteEntry=i.onWriteEntry,typeof i.onwarn=="function"&&this.on("warn",i.onwarn);let n=!1;if(!this.preservePaths){let[o,a]=(0,ky.stripAbsolutePath)(this.path);o&&typeof a=="string"&&(this.path=a,n=o)}this.win32=!!i.win32||process.platform==="win32",this.win32&&(this.path=rC.decode(this.path.replace(/\\/g,"/")),e=e.replace(/\\/g,"/")),this.absolute=(0,Ot.normalizeWindowsPath)(i.absolute||vy.default.resolve(this.cwd,e)),this.path===""&&(this.path="./"),n&&this.warn("TAR_ENTRY_INFO",`stripping ${n} from absolute path`,{entry:this,path:n+this.path});let s=this.statCache.get(this.absolute);s?this[po](s):this[Sc]()}warn(e,r,i={}){return(0,Fy.warnMethod)(this,e,r,i)}emit(e,...r){return e==="error"&&(this.#e=!0),super.emit(e,...r)}[Sc](){Tt.default.lstat(this.absolute,(e,r)=>{if(e)return this.emit("error",e);this[po](r)})}[po](e){this.statCache.set(this.absolute,e),this.stat=e,e.isFile()||(e.size=0),this.type=nC(e),this.emit("stat",e),this[gy]()}[gy](){switch(this.type){case"File":return this[wy]();case"Directory":return this[Ey]();case"SymbolicLink":return this[Ec]();default:return this.end()}}[mo](e){return(0,Ty.modeFix)(e,this.type==="Directory",this.portable)}[Ct](e){return Ay(e,this.prefix)}[Rn](){if(!this.stat)throw new Error("cannot write header before stat");this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.onWriteEntry?.(this),this.header=new Oy.Header({path:this[Ct](this.path),linkpath:this.type==="Link"&&this.linkpath!==void 0?this[Ct](this.linkpath):this.linkpath,mode:this[mo](this.stat.mode),uid:this.portable?void 0:this.stat.uid,gid:this.portable?void 0:this.stat.gid,size:this.stat.size,mtime:this.noMtime?void 0:this.mtime||this.stat.mtime,type:this.type==="Unsupported"?void 0:this.type,uname:this.portable?void 0:this.stat.uid===this.myuid?this.myuser:"",atime:this.portable?void 0:this.stat.atime,ctime:this.portable?void 0:this.stat.ctime}),this.header.encode()&&!this.noPax&&super.write(new xy.Pax({atime:this.portable?void 0:this.header.atime,ctime:this.portable?void 0:this.header.ctime,gid:this.portable?void 0:this.header.gid,mtime:this.noMtime?void 0:this.mtime||this.header.mtime,path:this[Ct](this.path),linkpath:this.type==="Link"&&this.linkpath!==void 0?this[Ct](this.linkpath):this.linkpath,size:this.header.size,uid:this.portable?void 0:this.header.uid,uname:this.portable?void 0:this.header.uname,dev:this.portable?void 0:this.stat.dev,ino:this.portable?void 0:this.stat.ino,nlink:this.portable?void 0:this.stat.nlink}).encode());let e=this.header?.block;if(!e)throw new Error("failed to encode header");super.write(e)}[Ey](){if(!this.stat)throw new Error("cannot create directory entry without stat");this.path.slice(-1)!=="/"&&(this.path+="/"),this.stat.size=0,this[Rn](),this.end()}[Ec](){Tt.default.readlink(this.absolute,(e,r)=>{if(e)return this.emit("error",e);this[Rc](r)})}[Rc](e){this.linkpath=(0,Ot.normalizeWindowsPath)(e),this[Rn](),this.end()}[Sy](e){if(!this.stat)throw new Error("cannot create link entry without stat");this.type="Link",this.linkpath=(0,Ot.normalizeWindowsPath)(vy.default.relative(this.cwd,e)),this.stat.size=0,this[Rn](),this.end()}[wy](){if(!this.stat)throw new Error("cannot create file entry without stat");if(this.stat.nlink>1){let e=`${this.stat.dev}:${this.stat.ino}`,r=this.linkCache.get(e);if(r?.indexOf(this.cwd)===0)return this[Sy](r);this.linkCache.set(e,this.absolute)}if(this[Rn](),this.stat.size===0)return this.end();this[Oc]()}[Oc](){Tt.default.open(this.absolute,"r",(e,r)=>{if(e)return this.emit("error",e);this[Tc](r)})}[Tc](e){if(this.fd=e,this.#e)return this[ur]();if(!this.stat)throw new Error("should stat before calling onopenfile");this.blockLen=512*Math.ceil(this.stat.size/512),this.blockRemain=this.blockLen;let r=Math.min(this.blockLen,this.maxReadSize);this.buf=Buffer.allocUnsafe(r),this.offset=0,this.pos=0,this.remain=this.stat.size,this.length=this.buf.length,this[ho]()}[ho](){let{fd:e,buf:r,offset:i,length:n,pos:s}=this;if(e===void 0||r===void 0)throw new Error("cannot read file without first opening");Tt.default.read(e,r,i,n,s,(o,a)=>{if(o)return this[ur](()=>this.emit("error",o));this[bc](a)})}[ur](e=()=>{}){this.fd!==void 0&&Tt.default.close(this.fd,e)}[bc](e){if(e<=0&&this.remain>0){let n=Object.assign(new Error("encountered unexpected EOF"),{path:this.absolute,syscall:"read",code:"EOF"});return this[ur](()=>this.emit("error",n))}if(e>this.remain){let n=Object.assign(new Error("did not encounter expected EOF"),{path:this.absolute,syscall:"read",code:"EOF"});return this[ur](()=>this.emit("error",n))}if(!this.buf)throw new Error("should have created buffer prior to reading");if(e===this.remain)for(let n=e;nthis[wc]())}[Cc](e){this.once("drain",e)}write(e,r,i){if(typeof r=="function"&&(i=r,r=void 0),typeof e=="string"&&(e=Buffer.from(e,typeof r=="string"?r:"utf8")),this.blockRemaine?this.emit("error",e):this.end());if(!this.buf)throw new Error("buffer lost somehow in ONDRAIN");this.offset>=this.length&&(this.buf=Buffer.allocUnsafe(Math.min(this.blockRemain,this.buf.length)),this.offset=0),this.length=this.buf.length-this.offset,this[ho]()}};De.WriteEntry=_o;var xc=class extends _o{sync=!0;[Sc](){this[po](Tt.default.lstatSync(this.absolute))}[Ec](){this[Rc](Tt.default.readlinkSync(this.absolute))}[Oc](){this[Tc](Tt.default.openSync(this.absolute,"r"))}[ho](){let e=!0;try{let{fd:r,buf:i,offset:n,length:s,pos:o}=this;if(r===void 0||i===void 0)throw new Error("fd and buf must be set in READ method");let a=Tt.default.readSync(r,i,n,s,o);this[bc](a),e=!1}finally{if(e)try{this[ur](()=>{})}catch{}}}[Cc](e){e()}[ur](e=()=>{}){this.fd!==void 0&&Tt.default.closeSync(this.fd),e()}};De.WriteEntrySync=xc;var kc=class extends Ry.Minipass{blockLen=0;blockRemain=0;buf=0;pos=0;remain=0;length=0;preservePaths;portable;strict;noPax;noMtime;readEntry;type;prefix;path;mode;uid;gid;uname;gname;header;mtime;atime;ctime;linkpath;size;onWriteEntry;warn(e,r,i={}){return(0,Fy.warnMethod)(this,e,r,i)}constructor(e,r={}){let i=(0,Cy.dealias)(r);super(),this.preservePaths=!!i.preservePaths,this.portable=!!i.portable,this.strict=!!i.strict,this.noPax=!!i.noPax,this.noMtime=!!i.noMtime,this.onWriteEntry=i.onWriteEntry,this.readEntry=e;let{type:n}=e;if(n==="Unsupported")throw new Error("writing entry that should be ignored");this.type=n,this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.prefix=i.prefix,this.path=(0,Ot.normalizeWindowsPath)(e.path),this.mode=e.mode!==void 0?this[mo](e.mode):void 0,this.uid=this.portable?void 0:e.uid,this.gid=this.portable?void 0:e.gid,this.uname=this.portable?void 0:e.uname,this.gname=this.portable?void 0:e.gname,this.size=e.size,this.mtime=this.noMtime?void 0:i.mtime||e.mtime,this.atime=this.portable?void 0:e.atime,this.ctime=this.portable?void 0:e.ctime,this.linkpath=e.linkpath!==void 0?(0,Ot.normalizeWindowsPath)(e.linkpath):void 0,typeof i.onwarn=="function"&&this.on("warn",i.onwarn);let s=!1;if(!this.preservePaths){let[a,u]=(0,ky.stripAbsolutePath)(this.path);a&&typeof u=="string"&&(this.path=u,s=a)}this.remain=e.size,this.blockRemain=e.startBlockSize,this.onWriteEntry?.(this),this.header=new Oy.Header({path:this[Ct](this.path),linkpath:this.type==="Link"&&this.linkpath!==void 0?this[Ct](this.linkpath):this.linkpath,mode:this.mode,uid:this.portable?void 0:this.uid,gid:this.portable?void 0:this.gid,size:this.size,mtime:this.noMtime?void 0:this.mtime,type:this.type,uname:this.portable?void 0:this.uname,atime:this.portable?void 0:this.atime,ctime:this.portable?void 0: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 xy.Pax({atime:this.portable?void 0:this.atime,ctime:this.portable?void 0:this.ctime,gid:this.portable?void 0:this.gid,mtime:this.noMtime?void 0:this.mtime,path:this[Ct](this.path),linkpath:this.type==="Link"&&this.linkpath!==void 0?this[Ct](this.linkpath):this.linkpath,size:this.size,uid:this.portable?void 0:this.uid,uname:this.portable?void 0:this.uname,dev:this.portable?void 0:this.readEntry.dev,ino:this.portable?void 0:this.readEntry.ino,nlink:this.portable?void 0:this.readEntry.nlink}).encode());let o=this.header?.block;if(!o)throw new Error("failed to encode header");super.write(o),e.pipe(this)}[Ct](e){return Ay(e,this.prefix)}[mo](e){return(0,Ty.modeFix)(e,this.type==="Directory",this.portable)}write(e,r,i){typeof r=="function"&&(i=r,r=void 0),typeof e=="string"&&(e=Buffer.from(e,typeof r=="string"?r:"utf8"));let n=e.length;if(n>this.blockRemain)throw new Error("writing more to entry than is appropriate");return this.blockRemain-=n,super.write(e,i)}end(e,r,i){return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),typeof e=="function"&&(i=e,r=void 0,e=void 0),typeof r=="function"&&(i=r,r=void 0),typeof e=="string"&&(e=Buffer.from(e,r??"utf8")),i&&this.once("finish",i),e?super.end(e,i):super.end(i),this}};De.WriteEntryTar=kc;var nC=t=>t.isFile()?"File":t.isDirectory()?"Directory":t.isSymbolicLink()?"SymbolicLink":"Unsupported"});var Ro=_(Le=>{"use strict";var sC=Le&&Le.__createBinding||(Object.create?function(t,e,r,i){i===void 0&&(i=r);var n=Object.getOwnPropertyDescriptor(e,r);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,i,n)}:function(t,e,r,i){i===void 0&&(i=r),t[i]=e[r]}),oC=Le&&Le.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),aC=Le&&Le.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&sC(e,t,r);return oC(e,t),e},My=Le&&Le.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Le,"__esModule",{value:!0});Le.PackSync=Le.Pack=Le.PackJob=void 0;var So=My(require("fs")),Ic=Fc(),Cn=class{path;absolute;entry;stat;readdir;pending=!1;ignore=!1;piped=!1;constructor(e,r){this.path=e||"./",this.absolute=r}};Le.PackJob=Cn;var uC=ui(),Ny=aC(ec()),cC=rc(),lC=Ys(),fC=Qs(),Dy=Buffer.alloc(1024),yo=Symbol("onStat"),On=Symbol("ended"),dt=Symbol("queue"),Ti=Symbol("current"),qr=Symbol("process"),Tn=Symbol("processing"),Ly=Symbol("processJob"),pt=Symbol("jobs"),Ac=Symbol("jobDone"),vo=Symbol("addFSEntry"),Iy=Symbol("addTarEntry"),qc=Symbol("stat"),Pc=Symbol("readdir"),go=Symbol("onreaddir"),wo=Symbol("pipe"),qy=Symbol("entry"),Nc=Symbol("entryOpt"),Eo=Symbol("writeEntryClass"),jy=Symbol("write"),Dc=Symbol("ondrain"),Py=My(require("path")),Lc=Ei(),bo=class extends uC.Minipass{opt;cwd;maxReadSize;preservePaths;strict;noPax;prefix;linkCache;statCache;file;portable;zip;readdirCache;noDirRecurse;follow;noMtime;mtime;filter;jobs;[Eo];onWriteEntry;[dt];[pt]=0;[Tn]=!1;[On]=!1;constructor(e={}){if(super(),this.opt=e,this.file=e.file||"",this.cwd=e.cwd||process.cwd(),this.maxReadSize=e.maxReadSize,this.preservePaths=!!e.preservePaths,this.strict=!!e.strict,this.noPax=!!e.noPax,this.prefix=(0,Lc.normalizeWindowsPath)(e.prefix||""),this.linkCache=e.linkCache||new Map,this.statCache=e.statCache||new Map,this.readdirCache=e.readdirCache||new Map,this.onWriteEntry=e.onWriteEntry,this[Eo]=Ic.WriteEntry,typeof e.onwarn=="function"&&this.on("warn",e.onwarn),this.portable=!!e.portable,e.gzip||e.brotli){if(e.gzip&&e.brotli)throw new TypeError("gzip and brotli are mutually exclusive");if(e.gzip&&(typeof e.gzip!="object"&&(e.gzip={}),this.portable&&(e.gzip.portable=!0),this.zip=new Ny.Gzip(e.gzip)),e.brotli&&(typeof e.brotli!="object"&&(e.brotli={}),this.zip=new Ny.BrotliCompress(e.brotli)),!this.zip)throw new Error("impossible");let r=this.zip;r.on("data",i=>super.write(i)),r.on("end",()=>super.end()),r.on("drain",()=>this[Dc]()),this.on("resume",()=>r.resume())}else this.on("drain",this[Dc]);this.noDirRecurse=!!e.noDirRecurse,this.follow=!!e.follow,this.noMtime=!!e.noMtime,e.mtime&&(this.mtime=e.mtime),this.filter=typeof e.filter=="function"?e.filter:()=>!0,this[dt]=new cC.Yallist,this[pt]=0,this.jobs=Number(e.jobs)||4,this[Tn]=!1,this[On]=!1}[jy](e){return super.write(e)}add(e){return this.write(e),this}end(e,r,i){return typeof e=="function"&&(i=e,e=void 0),typeof r=="function"&&(i=r,r=void 0),e&&this.add(e),this[On]=!0,this[qr](),i&&i(),this}write(e){if(this[On])throw new Error("write after end");return e instanceof lC.ReadEntry?this[Iy](e):this[vo](e),this.flowing}[Iy](e){let r=(0,Lc.normalizeWindowsPath)(Py.default.resolve(this.cwd,e.path));if(!this.filter(e.path,e))e.resume();else{let i=new Cn(e.path,r);i.entry=new Ic.WriteEntryTar(e,this[Nc](i)),i.entry.on("end",()=>this[Ac](i)),this[pt]+=1,this[dt].push(i)}this[qr]()}[vo](e){let r=(0,Lc.normalizeWindowsPath)(Py.default.resolve(this.cwd,e));this[dt].push(new Cn(e,r)),this[qr]()}[qc](e){e.pending=!0,this[pt]+=1;let r=this.follow?"stat":"lstat";So.default[r](e.absolute,(i,n)=>{e.pending=!1,this[pt]-=1,i?this.emit("error",i):this[yo](e,n)})}[yo](e,r){this.statCache.set(e.absolute,r),e.stat=r,this.filter(e.path,r)||(e.ignore=!0),this[qr]()}[Pc](e){e.pending=!0,this[pt]+=1,So.default.readdir(e.absolute,(r,i)=>{if(e.pending=!1,this[pt]-=1,r)return this.emit("error",r);this[go](e,i)})}[go](e,r){this.readdirCache.set(e.absolute,r),e.readdir=r,this[qr]()}[qr](){if(!this[Tn]){this[Tn]=!0;for(let e=this[dt].head;e&&this[pt]this.warn(r,i,n),noPax:this.noPax,cwd:this.cwd,absolute:e.absolute,preservePaths:this.preservePaths,maxReadSize:this.maxReadSize,strict:this.strict,portable:this.portable,linkCache:this.linkCache,statCache:this.statCache,noMtime:this.noMtime,mtime:this.mtime,prefix:this.prefix,onWriteEntry:this.onWriteEntry}}[qy](e){this[pt]+=1;try{return new this[Eo](e.path,this[Nc](e)).on("end",()=>this[Ac](e)).on("error",i=>this.emit("error",i))}catch(r){this.emit("error",r)}}[Dc](){this[Ti]&&this[Ti].entry&&this[Ti].entry.resume()}[wo](e){e.piped=!0,e.readdir&&e.readdir.forEach(n=>{let s=e.path,o=s==="./"?"":s.replace(/\/*$/,"/");this[vo](o+n)});let r=e.entry,i=this.zip;if(!r)throw new Error("cannot pipe without source");i?r.on("data",n=>{i.write(n)||r.pause()}):r.on("data",n=>{super.write(n)||r.pause()})}pause(){return this.zip&&this.zip.pause(),super.pause()}warn(e,r,i={}){(0,fC.warnMethod)(this,e,r,i)}};Le.Pack=bo;var Mc=class extends bo{sync=!0;constructor(e){super(e),this[Eo]=Ic.WriteEntrySync}pause(){}resume(){}[qc](e){let r=this.follow?"statSync":"lstatSync";this[yo](e,So.default[r](e.absolute))}[Pc](e){this[go](e,So.default.readdirSync(e.absolute))}[wo](e){let r=e.entry,i=this.zip;if(e.readdir&&e.readdir.forEach(n=>{let s=e.path,o=s==="./"?"":s.replace(/\/*$/,"/");this[vo](o+n)}),!r)throw new Error("Cannot pipe without source");i?r.on("data",n=>{i.write(n)}):r.on("data",n=>{super[jy](n)})}};Le.PackSync=Mc});var jc=_(Ci=>{"use strict";var hC=Ci&&Ci.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ci,"__esModule",{value:!0});Ci.create=void 0;var By=di(),$y=hC(require("node:path")),Uy=Ri(),dC=pi(),Oo=Ro(),pC=(t,e)=>{let r=new Oo.PackSync(t),i=new By.WriteStreamSync(t.file,{mode:t.mode||438});r.pipe(i),zy(r,e)},mC=(t,e)=>{let r=new Oo.Pack(t),i=new By.WriteStream(t.file,{mode:t.mode||438});r.pipe(i);let n=new Promise((s,o)=>{i.on("error",o),i.on("close",s),r.on("error",o)});return Wy(r,e),n},zy=(t,e)=>{e.forEach(r=>{r.charAt(0)==="@"?(0,Uy.list)({file:$y.default.resolve(t.cwd,r.slice(1)),sync:!0,noResume:!0,onReadEntry:i=>t.add(i)}):t.add(r)}),t.end()},Wy=async(t,e)=>{for(let r=0;r{t.add(n)}}):t.add(i)}t.end()},_C=(t,e)=>{let r=new Oo.PackSync(t);return zy(r,e),r},yC=(t,e)=>{let r=new Oo.Pack(t);return Wy(r,e),r};Ci.create=(0,dC.makeCommand)(pC,mC,_C,yC,(t,e)=>{if(!e?.length)throw new TypeError("no paths specified to add to archive")})});var Vy=_(xi=>{"use strict";var vC=xi&&xi.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(xi,"__esModule",{value:!0});xi.getWriteFlag=void 0;var Hy=vC(require("fs")),gC=process.env.__FAKE_PLATFORM__||process.platform,wC=gC==="win32",{O_CREAT:EC,O_TRUNC:SC,O_WRONLY:bC}=Hy.default.constants,Gy=Number(process.env.__FAKE_FS_O_FILENAME__)||Hy.default.constants.UV_FS_O_FILEMAP||0,RC=wC&&!!Gy,OC=512*1024,TC=Gy|SC|EC|bC;xi.getWriteFlag=RC?t=>t"w"});var Ky=_(xt=>{"use strict";var Xy=xt&&xt.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(xt,"__esModule",{value:!0});xt.chownrSync=xt.chownr=void 0;var Co=Xy(require("node:fs")),xn=Xy(require("node:path")),Bc=(t,e,r)=>{try{return Co.default.lchownSync(t,e,r)}catch(i){if(i?.code!=="ENOENT")throw i}},To=(t,e,r,i)=>{Co.default.lchown(t,e,r,n=>{i(n&&n?.code!=="ENOENT"?n:null)})},CC=(t,e,r,i,n)=>{if(e.isDirectory())(0,xt.chownr)(xn.default.resolve(t,e.name),r,i,s=>{if(s)return n(s);let o=xn.default.resolve(t,e.name);To(o,r,i,n)});else{let s=xn.default.resolve(t,e.name);To(s,r,i,n)}},xC=(t,e,r,i)=>{Co.default.readdir(t,{withFileTypes:!0},(n,s)=>{if(n){if(n.code==="ENOENT")return i();if(n.code!=="ENOTDIR"&&n.code!=="ENOTSUP")return i(n)}if(n||!s.length)return To(t,e,r,i);let o=s.length,a=null,u=f=>{if(!a){if(f)return i(a=f);if(--o===0)return To(t,e,r,i)}};for(let f of s)CC(t,f,e,r,u)})};xt.chownr=xC;var kC=(t,e,r,i)=>{e.isDirectory()&&(0,xt.chownrSync)(xn.default.resolve(t,e.name),r,i),Bc(xn.default.resolve(t,e.name),r,i)},FC=(t,e,r)=>{let i;try{i=Co.default.readdirSync(t,{withFileTypes:!0})}catch(n){let s=n;if(s?.code==="ENOENT")return;if(s?.code==="ENOTDIR"||s?.code==="ENOTSUP")return Bc(t,e,r);throw s}for(let n of i)kC(t,n,e,r);return Bc(t,e,r)};xt.chownrSync=FC});var kn=_(ko=>{"use strict";Object.defineProperty(ko,"__esModule",{value:!0});ko.optsArg=void 0;var xo=require("fs"),AC=t=>{if(!t)t={mode:511};else if(typeof t=="object")t={mode:511,...t};else if(typeof t=="number")t={mode:t};else if(typeof t=="string")t={mode:parseInt(t,8)};else throw new TypeError("invalid options argument");let e=t,r=t.fs||{};return t.mkdir=t.mkdir||r.mkdir||xo.mkdir,t.mkdirAsync=t.mkdirAsync?t.mkdirAsync:async(i,n)=>new Promise((s,o)=>e.mkdir(i,n,(a,u)=>a?o(a):s(u))),t.stat=t.stat||r.stat||xo.stat,t.statAsync=t.statAsync?t.statAsync:async i=>new Promise((n,s)=>e.stat(i,(o,a)=>o?s(o):n(a))),t.statSync=t.statSync||r.statSync||xo.statSync,t.mkdirSync=t.mkdirSync||r.mkdirSync||xo.mkdirSync,e};ko.optsArg=AC});var Fo=_(mt=>{"use strict";Object.defineProperty(mt,"__esModule",{value:!0});mt.mkdirpManual=mt.mkdirpManualSync=void 0;var Yy=require("path"),Zy=kn(),NC=(t,e,r)=>{let i=(0,Yy.dirname)(t),n={...(0,Zy.optsArg)(e),recursive:!1};if(i===t)try{return n.mkdirSync(t,n)}catch(s){let o=s;if(o&&o.code!=="EISDIR")throw s;return}try{return n.mkdirSync(t,n),r||t}catch(s){let o=s;if(o&&o.code==="ENOENT")return(0,mt.mkdirpManualSync)(t,n,(0,mt.mkdirpManualSync)(i,n,r));if(o&&o.code!=="EEXIST"&&o&&o.code!=="EROFS")throw s;try{if(!n.statSync(t).isDirectory())throw s}catch{throw s}}};mt.mkdirpManualSync=NC;mt.mkdirpManual=Object.assign(async(t,e,r)=>{let i=(0,Zy.optsArg)(e);i.recursive=!1;let n=(0,Yy.dirname)(t);return n===t?i.mkdirAsync(t,i).catch(s=>{let o=s;if(o&&o.code!=="EISDIR")throw s}):i.mkdirAsync(t,i).then(()=>r||t,async s=>{let o=s;if(o&&o.code==="ENOENT")return(0,mt.mkdirpManual)(n,i).then(a=>(0,mt.mkdirpManual)(t,i,a));if(o&&o.code!=="EEXIST"&&o.code!=="EROFS")throw s;return i.statAsync(t).then(a=>{if(a.isDirectory())return r;throw s},()=>{throw s})})},{sync:mt.mkdirpManualSync})});var Jy=_(cr=>{"use strict";Object.defineProperty(cr,"__esModule",{value:!0});cr.findMadeSync=cr.findMade=void 0;var Qy=require("path"),DC=async(t,e,r)=>{if(r!==e)return t.statAsync(e).then(i=>i.isDirectory()?r:void 0,i=>{let n=i;return n&&n.code==="ENOENT"?(0,cr.findMade)(t,(0,Qy.dirname)(e),e):void 0})};cr.findMade=DC;var LC=(t,e,r)=>{if(r!==e)try{return t.statSync(e).isDirectory()?r:void 0}catch(i){let n=i;return n&&n.code==="ENOENT"?(0,cr.findMadeSync)(t,(0,Qy.dirname)(e),e):void 0}};cr.findMadeSync=LC});var $c=_(Pr=>{"use strict";Object.defineProperty(Pr,"__esModule",{value:!0});Pr.mkdirpNative=Pr.mkdirpNativeSync=void 0;var ev=require("path"),tv=Jy(),rv=Fo(),iv=kn(),IC=(t,e)=>{let r=(0,iv.optsArg)(e);if(r.recursive=!0,(0,ev.dirname)(t)===t)return r.mkdirSync(t,r);let n=(0,tv.findMadeSync)(r,t);try{return r.mkdirSync(t,r),n}catch(s){let o=s;if(o&&o.code==="ENOENT")return(0,rv.mkdirpManualSync)(t,r);throw s}};Pr.mkdirpNativeSync=IC;Pr.mkdirpNative=Object.assign(async(t,e)=>{let r={...(0,iv.optsArg)(e),recursive:!0};return(0,ev.dirname)(t)===t?await r.mkdirAsync(t,r):(0,tv.findMade)(r,t).then(n=>r.mkdirAsync(t,r).then(s=>n||s).catch(s=>{let o=s;if(o&&o.code==="ENOENT")return(0,rv.mkdirpManual)(t,r);throw s}))},{sync:Pr.mkdirpNativeSync})});var sv=_(Ao=>{"use strict";Object.defineProperty(Ao,"__esModule",{value:!0});Ao.pathArg=void 0;var qC=process.env.__TESTING_MKDIRP_PLATFORM__||process.platform,nv=require("path"),PC=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=(0,nv.resolve)(t),qC==="win32"){let e=/[*|"<>?:]/,{root:r}=(0,nv.parse)(t);if(e.test(t.substring(r.length)))throw Object.assign(new Error("Illegal characters in path."),{path:t,code:"EINVAL"})}return t};Ao.pathArg=PC});var zc=_(Mr=>{"use strict";Object.defineProperty(Mr,"__esModule",{value:!0});Mr.useNative=Mr.useNativeSync=void 0;var ov=require("fs"),av=kn(),MC=process.env.__TESTING_MKDIRP_NODE_VERSION__||process.version,Uc=MC.replace(/^v/,"").split("."),uv=+Uc[0]>10||+Uc[0]==10&&+Uc[1]>=12;Mr.useNativeSync=uv?t=>(0,av.optsArg)(t).mkdirSync===ov.mkdirSync:()=>!1;Mr.useNative=Object.assign(uv?t=>(0,av.optsArg)(t).mkdir===ov.mkdir:()=>!1,{sync:Mr.useNativeSync})});var pv=_(te=>{"use strict";Object.defineProperty(te,"__esModule",{value:!0});te.mkdirp=te.nativeSync=te.native=te.manualSync=te.manual=te.sync=te.mkdirpSync=te.useNativeSync=te.useNative=te.mkdirpNativeSync=te.mkdirpNative=te.mkdirpManualSync=te.mkdirpManual=void 0;var lr=Fo(),fr=$c(),cv=kn(),lv=sv(),No=zc(),fv=Fo();Object.defineProperty(te,"mkdirpManual",{enumerable:!0,get:function(){return fv.mkdirpManual}});Object.defineProperty(te,"mkdirpManualSync",{enumerable:!0,get:function(){return fv.mkdirpManualSync}});var hv=$c();Object.defineProperty(te,"mkdirpNative",{enumerable:!0,get:function(){return hv.mkdirpNative}});Object.defineProperty(te,"mkdirpNativeSync",{enumerable:!0,get:function(){return hv.mkdirpNativeSync}});var dv=zc();Object.defineProperty(te,"useNative",{enumerable:!0,get:function(){return dv.useNative}});Object.defineProperty(te,"useNativeSync",{enumerable:!0,get:function(){return dv.useNativeSync}});var jC=(t,e)=>{t=(0,lv.pathArg)(t);let r=(0,cv.optsArg)(e);return(0,No.useNativeSync)(r)?(0,fr.mkdirpNativeSync)(t,r):(0,lr.mkdirpManualSync)(t,r)};te.mkdirpSync=jC;te.sync=te.mkdirpSync;te.manual=lr.mkdirpManual;te.manualSync=lr.mkdirpManualSync;te.native=fr.mkdirpNative;te.nativeSync=fr.mkdirpNativeSync;te.mkdirp=Object.assign(async(t,e)=>{t=(0,lv.pathArg)(t);let r=(0,cv.optsArg)(e);return(0,No.useNative)(r)?(0,fr.mkdirpNative)(t,r):(0,lr.mkdirpManual)(t,r)},{mkdirpSync:te.mkdirpSync,mkdirpNative:fr.mkdirpNative,mkdirpNativeSync:fr.mkdirpNativeSync,mkdirpManual:lr.mkdirpManual,mkdirpManualSync:lr.mkdirpManualSync,sync:te.mkdirpSync,native:fr.mkdirpNative,nativeSync:fr.mkdirpNativeSync,manual:lr.mkdirpManual,manualSync:lr.mkdirpManualSync,useNative:No.useNative,useNativeSync:No.useNativeSync})});var mv=_(Do=>{"use strict";Object.defineProperty(Do,"__esModule",{value:!0});Do.CwdError=void 0;var Wc=class extends Error{path;code;syscall="chdir";constructor(e,r){super(`${r}: Cannot cd into '${e}'`),this.path=e,this.code=r}get name(){return"CwdError"}};Do.CwdError=Wc});var _v=_(Lo=>{"use strict";Object.defineProperty(Lo,"__esModule",{value:!0});Lo.SymlinkError=void 0;var Hc=class extends Error{path;symlink;syscall="symlink";code="TAR_SYMLINK_ERROR";constructor(e,r){super("TAR_SYMLINK_ERROR: Cannot extract through symbolic link"),this.symlink=e,this.path=r}get name(){return"SymlinkError"}};Lo.SymlinkError=Hc});var bv=_(hr=>{"use strict";var yv=hr&&hr.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(hr,"__esModule",{value:!0});hr.mkdirSync=hr.mkdir=void 0;var vv=Ky(),it=yv(require("fs")),gv=pv(),Io=yv(require("node:path")),wv=mv(),_t=Ei(),Ev=_v(),qo=(t,e)=>t.get((0,_t.normalizeWindowsPath)(e)),Fn=(t,e,r)=>t.set((0,_t.normalizeWindowsPath)(e),r),BC=(t,e)=>{it.default.stat(t,(r,i)=>{(r||!i.isDirectory())&&(r=new wv.CwdError(t,r?.code||"ENOTDIR")),e(r)})},$C=(t,e,r)=>{t=(0,_t.normalizeWindowsPath)(t);let i=e.umask??18,n=e.mode|448,s=(n&i)!==0,o=e.uid,a=e.gid,u=typeof o=="number"&&typeof a=="number"&&(o!==e.processUid||a!==e.processGid),f=e.preserve,c=e.unlink,h=e.cache,p=(0,_t.normalizeWindowsPath)(e.cwd),l=(y,w)=>{y?r(y):(Fn(h,t,!0),w&&u?(0,vv.chownr)(w,o,a,x=>l(x)):s?it.default.chmod(t,n,r):r())};if(h&&qo(h,t)===!0)return l();if(t===p)return BC(t,l);if(f)return(0,gv.mkdirp)(t,{mode:n}).then(y=>l(null,y??void 0),l);let m=(0,_t.normalizeWindowsPath)(Io.default.relative(p,t)).split("/");Po(p,m,n,h,c,p,void 0,l)};hr.mkdir=$C;var Po=(t,e,r,i,n,s,o,a)=>{if(!e.length)return a(null,o);let u=e.shift(),f=(0,_t.normalizeWindowsPath)(Io.default.resolve(t+"/"+u));if(qo(i,f))return Po(f,e,r,i,n,s,o,a);it.default.mkdir(f,r,Sv(f,e,r,i,n,s,o,a))},Sv=(t,e,r,i,n,s,o,a)=>u=>{u?it.default.lstat(t,(f,c)=>{if(f)f.path=f.path&&(0,_t.normalizeWindowsPath)(f.path),a(f);else if(c.isDirectory())Po(t,e,r,i,n,s,o,a);else if(n)it.default.unlink(t,h=>{if(h)return a(h);it.default.mkdir(t,r,Sv(t,e,r,i,n,s,o,a))});else{if(c.isSymbolicLink())return a(new Ev.SymlinkError(t,t+"/"+e.join("/")));a(u)}}):(o=o||t,Po(t,e,r,i,n,s,o,a))},UC=t=>{let e=!1,r;try{e=it.default.statSync(t).isDirectory()}catch(i){r=i?.code}finally{if(!e)throw new wv.CwdError(t,r??"ENOTDIR")}},zC=(t,e)=>{t=(0,_t.normalizeWindowsPath)(t);let r=e.umask??18,i=e.mode|448,n=(i&r)!==0,s=e.uid,o=e.gid,a=typeof s=="number"&&typeof o=="number"&&(s!==e.processUid||o!==e.processGid),u=e.preserve,f=e.unlink,c=e.cache,h=(0,_t.normalizeWindowsPath)(e.cwd),p=y=>{Fn(c,t,!0),y&&a&&(0,vv.chownrSync)(y,s,o),n&&it.default.chmodSync(t,i)};if(c&&qo(c,t)===!0)return p();if(t===h)return UC(h),p();if(u)return p((0,gv.mkdirpSync)(t,i)??void 0);let d=(0,_t.normalizeWindowsPath)(Io.default.relative(h,t)).split("/"),m;for(let y=d.shift(),w=h;y&&(w+="/"+y);y=d.shift())if(w=(0,_t.normalizeWindowsPath)(Io.default.resolve(w)),!qo(c,w))try{it.default.mkdirSync(w,i),m=m||w,Fn(c,w,!0)}catch{let C=it.default.lstatSync(w);if(C.isDirectory()){Fn(c,w,!0);continue}else if(f){it.default.unlinkSync(w),it.default.mkdirSync(w,i),m=m||w,Fn(c,w,!0);continue}else if(C.isSymbolicLink())return new Ev.SymlinkError(w,w+"/"+d.join("/"))}return p(m)};hr.mkdirSync=zC});var Vc=_(Mo=>{"use strict";Object.defineProperty(Mo,"__esModule",{value:!0});Mo.normalizeUnicode=void 0;var Gc=Object.create(null),{hasOwnProperty:WC}=Object.prototype,HC=t=>(WC.call(Gc,t)||(Gc[t]=t.normalize("NFD")),Gc[t]);Mo.normalizeUnicode=HC});var Ov=_(jo=>{"use strict";Object.defineProperty(jo,"__esModule",{value:!0});jo.PathReservations=void 0;var Rv=require("node:path"),GC=Vc(),VC=bn(),XC=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,KC=XC==="win32",YC=t=>t.split("/").slice(0,-1).reduce((r,i)=>{let n=r[r.length-1];return n!==void 0&&(i=(0,Rv.join)(n,i)),r.push(i||"/"),r},[]),Xc=class{#e=new Map;#r=new Map;#i=new Set;reserve(e,r){e=KC?["win32 parallelization disabled"]:e.map(n=>(0,VC.stripTrailingSlashes)((0,Rv.join)((0,GC.normalizeUnicode)(n))).toLowerCase());let i=new Set(e.map(n=>YC(n)).reduce((n,s)=>n.concat(s)));this.#r.set(r,{dirs:i,paths:e});for(let n of e){let s=this.#e.get(n);s?s.push(r):this.#e.set(n,[r])}for(let n of i){let s=this.#e.get(n);if(!s)this.#e.set(n,[new Set([r])]);else{let o=s[s.length-1];o instanceof Set?o.add(r):s.push(new Set([r]))}}return this.#n(r)}#s(e){let r=this.#r.get(e);if(!r)throw new Error("function does not have any path reservations");return{paths:r.paths.map(i=>this.#e.get(i)),dirs:[...r.dirs].map(i=>this.#e.get(i))}}check(e){let{paths:r,dirs:i}=this.#s(e);return r.every(n=>n&&n[0]===e)&&i.every(n=>n&&n[0]instanceof Set&&n[0].has(e))}#n(e){return this.#i.has(e)||!this.check(e)?!1:(this.#i.add(e),e(()=>this.#t(e)),!0)}#t(e){if(!this.#i.has(e))return!1;let r=this.#r.get(e);if(!r)throw new Error("invalid reservation");let{paths:i,dirs:n}=r,s=new Set;for(let o of i){let a=this.#e.get(o);if(!a||a?.[0]!==e)continue;let u=a[1];if(!u){this.#e.delete(o);continue}if(a.shift(),typeof u=="function")s.add(u);else for(let f of u)s.add(f)}for(let o of n){let a=this.#e.get(o),u=a?.[0];if(!(!a||!(u instanceof Set)))if(u.size===1&&a.length===1){this.#e.delete(o);continue}else if(u.size===1){a.shift();let f=a[0];typeof f=="function"&&s.add(f)}else u.delete(e)}return this.#i.delete(e),s.forEach(o=>this.#n(o)),!0}};jo.PathReservations=Xc});var nl=_(Xe=>{"use strict";var ZC=Xe&&Xe.__createBinding||(Object.create?function(t,e,r,i){i===void 0&&(i=r);var n=Object.getOwnPropertyDescriptor(e,r);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,i,n)}:function(t,e,r,i){i===void 0&&(i=r),t[i]=e[r]}),QC=Xe&&Xe.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),qv=Xe&&Xe.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&ZC(e,t,r);return QC(e,t),e},il=Xe&&Xe.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Xe,"__esModule",{value:!0});Xe.UnpackSync=Xe.Unpack=void 0;var JC=qv(di()),ex=il(require("node:assert")),Pv=require("node:crypto"),Q=il(require("node:fs")),zt=il(require("node:path")),Mv=Vy(),jv=bv(),tx=Vc(),nt=Ei(),rx=oo(),ix=yc(),nx=bn(),Tv=qv(gc()),sx=Ov(),Cv=Symbol("onEntry"),Zc=Symbol("checkFs"),xv=Symbol("checkFs2"),Uo=Symbol("pruneCache"),Qc=Symbol("isReusable"),st=Symbol("makeFs"),Jc=Symbol("file"),el=Symbol("directory"),zo=Symbol("link"),kv=Symbol("symlink"),Fv=Symbol("hardlink"),Av=Symbol("unsupported"),Nv=Symbol("checkPath"),dr=Symbol("mkdir"),Ie=Symbol("onError"),Bo=Symbol("pending"),Dv=Symbol("pend"),ki=Symbol("unpend"),Kc=Symbol("ended"),Yc=Symbol("maybeClose"),tl=Symbol("skip"),An=Symbol("doChown"),Nn=Symbol("uid"),Dn=Symbol("gid"),Ln=Symbol("checkedCwd"),ox=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,In=ox==="win32",ax=1024,ux=(t,e)=>{if(!In)return Q.default.unlink(t,e);let r=t+".DELETE."+(0,Pv.randomBytes)(16).toString("hex");Q.default.rename(t,r,i=>{if(i)return e(i);Q.default.unlink(r,e)})},cx=t=>{if(!In)return Q.default.unlinkSync(t);let e=t+".DELETE."+(0,Pv.randomBytes)(16).toString("hex");Q.default.renameSync(t,e),Q.default.unlinkSync(e)},Lv=(t,e,r)=>t!==void 0&&t===t>>>0?t:e!==void 0&&e===e>>>0?e:r,Iv=t=>(0,nx.stripTrailingSlashes)((0,nt.normalizeWindowsPath)((0,tx.normalizeUnicode)(t))).toLowerCase(),lx=(t,e)=>{e=Iv(e);for(let r of t.keys()){let i=Iv(r);(i===e||i.indexOf(e+"/")===0)&&t.delete(r)}},fx=t=>{for(let e of t.keys())t.delete(e)},Wo=class extends rx.Parser{[Kc]=!1;[Ln]=!1;[Bo]=0;reservations=new sx.PathReservations;transform;writable=!0;readable=!1;dirCache;uid;gid;setOwner;preserveOwner;processGid;processUid;maxDepth;forceChown;win32;newer;keep;noMtime;preservePaths;unlink;cwd;strip;processUmask;umask;dmode;fmode;chmod;constructor(e={}){if(e.ondone=()=>{this[Kc]=!0,this[Yc]()},super(e),this.transform=e.transform,this.dirCache=e.dirCache||new Map,this.chmod=!!e.chmod,typeof e.uid=="number"||typeof e.gid=="number"){if(typeof e.uid!="number"||typeof e.gid!="number")throw new TypeError("cannot set owner without number uid and gid");if(e.preserveOwner)throw new TypeError("cannot preserve owner in archive and also set owner explicitly");this.uid=e.uid,this.gid=e.gid,this.setOwner=!0}else this.uid=void 0,this.gid=void 0,this.setOwner=!1;e.preserveOwner===void 0&&typeof e.uid!="number"?this.preserveOwner=!!(process.getuid&&process.getuid()===0):this.preserveOwner=!!e.preserveOwner,this.processUid=(this.preserveOwner||this.setOwner)&&process.getuid?process.getuid():void 0,this.processGid=(this.preserveOwner||this.setOwner)&&process.getgid?process.getgid():void 0,this.maxDepth=typeof e.maxDepth=="number"?e.maxDepth:ax,this.forceChown=e.forceChown===!0,this.win32=!!e.win32||In,this.newer=!!e.newer,this.keep=!!e.keep,this.noMtime=!!e.noMtime,this.preservePaths=!!e.preservePaths,this.unlink=!!e.unlink,this.cwd=(0,nt.normalizeWindowsPath)(zt.default.resolve(e.cwd||process.cwd())),this.strip=Number(e.strip)||0,this.processUmask=this.chmod?typeof e.processUmask=="number"?e.processUmask:process.umask():0,this.umask=typeof e.umask=="number"?e.umask:this.processUmask,this.dmode=e.dmode||511&~this.umask,this.fmode=e.fmode||438&~this.umask,this.on("entry",r=>this[Cv](r))}warn(e,r,i={}){return(e==="TAR_BAD_ARCHIVE"||e==="TAR_ABORT")&&(i.recoverable=!1),super.warn(e,r,i)}[Yc](){this[Kc]&&this[Bo]===0&&(this.emit("prefinish"),this.emit("finish"),this.emit("end"))}[Nv](e){let r=(0,nt.normalizeWindowsPath)(e.path),i=r.split("/");if(this.strip){if(i.length=this.strip)e.linkpath=n.slice(this.strip).join("/");else return!1}i.splice(0,this.strip),e.path=i.join("/")}if(isFinite(this.maxDepth)&&i.length>this.maxDepth)return this.warn("TAR_ENTRY_ERROR","path excessively deep",{entry:e,path:r,depth:i.length,maxDepth:this.maxDepth}),!1;if(!this.preservePaths){if(i.includes("..")||In&&/^[a-z]:\.\.$/i.test(i[0]??""))return this.warn("TAR_ENTRY_ERROR","path contains '..'",{entry:e,path:r}),!1;let[n,s]=(0,ix.stripAbsolutePath)(r);n&&(e.path=String(s),this.warn("TAR_ENTRY_INFO",`stripping ${n} from absolute path`,{entry:e,path:r}))}if(zt.default.isAbsolute(e.path)?e.absolute=(0,nt.normalizeWindowsPath)(zt.default.resolve(e.path)):e.absolute=(0,nt.normalizeWindowsPath)(zt.default.resolve(this.cwd,e.path)),!this.preservePaths&&typeof e.absolute=="string"&&e.absolute.indexOf(this.cwd+"/")!==0&&e.absolute!==this.cwd)return this.warn("TAR_ENTRY_ERROR","path escaped extraction target",{entry:e,path:(0,nt.normalizeWindowsPath)(e.path),resolvedPath:e.absolute,cwd:this.cwd}),!1;if(e.absolute===this.cwd&&e.type!=="Directory"&&e.type!=="GNUDumpDir")return!1;if(this.win32){let{root:n}=zt.default.win32.parse(String(e.absolute));e.absolute=n+Tv.encode(String(e.absolute).slice(n.length));let{root:s}=zt.default.win32.parse(e.path);e.path=s+Tv.encode(e.path.slice(s.length))}return!0}[Cv](e){if(!this[Nv](e))return e.resume();switch(ex.default.equal(typeof e.absolute,"string"),e.type){case"Directory":case"GNUDumpDir":e.mode&&(e.mode=e.mode|448);case"File":case"OldFile":case"ContiguousFile":case"Link":case"SymbolicLink":return this[Zc](e);case"CharacterDevice":case"BlockDevice":case"FIFO":default:return this[Av](e)}}[Ie](e,r){e.name==="CwdError"?this.emit("error",e):(this.warn("TAR_ENTRY_ERROR",e,{entry:r}),this[ki](),r.resume())}[dr](e,r,i){(0,jv.mkdir)((0,nt.normalizeWindowsPath)(e),{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:r},i)}[An](e){return this.forceChown||this.preserveOwner&&(typeof e.uid=="number"&&e.uid!==this.processUid||typeof e.gid=="number"&&e.gid!==this.processGid)||typeof this.uid=="number"&&this.uid!==this.processUid||typeof this.gid=="number"&&this.gid!==this.processGid}[Nn](e){return Lv(this.uid,e.uid,this.processUid)}[Dn](e){return Lv(this.gid,e.gid,this.processGid)}[Jc](e,r){let i=typeof e.mode=="number"?e.mode&4095:this.fmode,n=new JC.WriteStream(String(e.absolute),{flags:(0,Mv.getWriteFlag)(e.size),mode:i,autoClose:!1});n.on("error",u=>{n.fd&&Q.default.close(n.fd,()=>{}),n.write=()=>!0,this[Ie](u,e),r()});let s=1,o=u=>{if(u){n.fd&&Q.default.close(n.fd,()=>{}),this[Ie](u,e),r();return}--s===0&&n.fd!==void 0&&Q.default.close(n.fd,f=>{f?this[Ie](f,e):this[ki](),r()})};n.on("finish",()=>{let u=String(e.absolute),f=n.fd;if(typeof f=="number"&&e.mtime&&!this.noMtime){s++;let c=e.atime||new Date,h=e.mtime;Q.default.futimes(f,c,h,p=>p?Q.default.utimes(u,c,h,l=>o(l&&p)):o())}if(typeof f=="number"&&this[An](e)){s++;let c=this[Nn](e),h=this[Dn](e);typeof c=="number"&&typeof h=="number"&&Q.default.fchown(f,c,h,p=>p?Q.default.chown(u,c,h,l=>o(l&&p)):o())}o()});let a=this.transform&&this.transform(e)||e;a!==e&&(a.on("error",u=>{this[Ie](u,e),r()}),e.pipe(a)),a.pipe(n)}[el](e,r){let i=typeof e.mode=="number"?e.mode&4095:this.dmode;this[dr](String(e.absolute),i,n=>{if(n){this[Ie](n,e),r();return}let s=1,o=()=>{--s===0&&(r(),this[ki](),e.resume())};e.mtime&&!this.noMtime&&(s++,Q.default.utimes(String(e.absolute),e.atime||new Date,e.mtime,o)),this[An](e)&&(s++,Q.default.chown(String(e.absolute),Number(this[Nn](e)),Number(this[Dn](e)),o)),o()})}[Av](e){e.unsupported=!0,this.warn("TAR_ENTRY_UNSUPPORTED",`unsupported entry type: ${e.type}`,{entry:e}),e.resume()}[kv](e,r){this[zo](e,String(e.linkpath),"symlink",r)}[Fv](e,r){let i=(0,nt.normalizeWindowsPath)(zt.default.resolve(this.cwd,String(e.linkpath)));this[zo](e,i,"link",r)}[Dv](){this[Bo]++}[ki](){this[Bo]--,this[Yc]()}[tl](e){this[ki](),e.resume()}[Qc](e,r){return e.type==="File"&&!this.unlink&&r.isFile()&&r.nlink<=1&&!In}[Zc](e){this[Dv]();let r=[e.path];e.linkpath&&r.push(e.linkpath),this.reservations.reserve(r,i=>this[xv](e,i))}[Uo](e){e.type==="SymbolicLink"?fx(this.dirCache):e.type!=="Directory"&&lx(this.dirCache,String(e.absolute))}[xv](e,r){this[Uo](e);let i=a=>{this[Uo](e),r(a)},n=()=>{this[dr](this.cwd,this.dmode,a=>{if(a){this[Ie](a,e),i();return}this[Ln]=!0,s()})},s=()=>{if(e.absolute!==this.cwd){let a=(0,nt.normalizeWindowsPath)(zt.default.dirname(String(e.absolute)));if(a!==this.cwd)return this[dr](a,this.dmode,u=>{if(u){this[Ie](u,e),i();return}o()})}o()},o=()=>{Q.default.lstat(String(e.absolute),(a,u)=>{if(u&&(this.keep||this.newer&&u.mtime>(e.mtime??u.mtime))){this[tl](e),i();return}if(a||this[Qc](e,u))return this[st](null,e,i);if(u.isDirectory()){if(e.type==="Directory"){let f=this.chmod&&e.mode&&(u.mode&4095)!==e.mode,c=h=>this[st](h??null,e,i);return f?Q.default.chmod(String(e.absolute),Number(e.mode),c):c()}if(e.absolute!==this.cwd)return Q.default.rmdir(String(e.absolute),f=>this[st](f??null,e,i))}if(e.absolute===this.cwd)return this[st](null,e,i);ux(String(e.absolute),f=>this[st](f??null,e,i))})};this[Ln]?s():n()}[st](e,r,i){if(e){this[Ie](e,r),i();return}switch(r.type){case"File":case"OldFile":case"ContiguousFile":return this[Jc](r,i);case"Link":return this[Fv](r,i);case"SymbolicLink":return this[kv](r,i);case"Directory":case"GNUDumpDir":return this[el](r,i)}}[zo](e,r,i,n){Q.default[i](r,String(e.absolute),s=>{s?this[Ie](s,e):(this[ki](),e.resume()),n()})}};Xe.Unpack=Wo;var $o=t=>{try{return[null,t()]}catch(e){return[e,null]}},rl=class extends Wo{sync=!0;[st](e,r){return super[st](e,r,()=>{})}[Zc](e){if(this[Uo](e),!this[Ln]){let s=this[dr](this.cwd,this.dmode);if(s)return this[Ie](s,e);this[Ln]=!0}if(e.absolute!==this.cwd){let s=(0,nt.normalizeWindowsPath)(zt.default.dirname(String(e.absolute)));if(s!==this.cwd){let o=this[dr](s,this.dmode);if(o)return this[Ie](o,e)}}let[r,i]=$o(()=>Q.default.lstatSync(String(e.absolute)));if(i&&(this.keep||this.newer&&i.mtime>(e.mtime??i.mtime)))return this[tl](e);if(r||this[Qc](e,i))return this[st](null,e);if(i.isDirectory()){if(e.type==="Directory"){let o=this.chmod&&e.mode&&(i.mode&4095)!==e.mode,[a]=o?$o(()=>{Q.default.chmodSync(String(e.absolute),Number(e.mode))}):[];return this[st](a,e)}let[s]=$o(()=>Q.default.rmdirSync(String(e.absolute)));this[st](s,e)}let[n]=e.absolute===this.cwd?[]:$o(()=>cx(String(e.absolute)));this[st](n,e)}[Jc](e,r){let i=typeof e.mode=="number"?e.mode&4095:this.fmode,n=a=>{let u;try{Q.default.closeSync(s)}catch(f){u=f}(a||u)&&this[Ie](a||u,e),r()},s;try{s=Q.default.openSync(String(e.absolute),(0,Mv.getWriteFlag)(e.size),i)}catch(a){return n(a)}let o=this.transform&&this.transform(e)||e;o!==e&&(o.on("error",a=>this[Ie](a,e)),e.pipe(o)),o.on("data",a=>{try{Q.default.writeSync(s,a,0,a.length)}catch(u){n(u)}}),o.on("end",()=>{let a=null;if(e.mtime&&!this.noMtime){let u=e.atime||new Date,f=e.mtime;try{Q.default.futimesSync(s,u,f)}catch(c){try{Q.default.utimesSync(String(e.absolute),u,f)}catch{a=c}}}if(this[An](e)){let u=this[Nn](e),f=this[Dn](e);try{Q.default.fchownSync(s,Number(u),Number(f))}catch(c){try{Q.default.chownSync(String(e.absolute),Number(u),Number(f))}catch{a=a||c}}}n(a)})}[el](e,r){let i=typeof e.mode=="number"?e.mode&4095:this.dmode,n=this[dr](String(e.absolute),i);if(n){this[Ie](n,e),r();return}if(e.mtime&&!this.noMtime)try{Q.default.utimesSync(String(e.absolute),e.atime||new Date,e.mtime)}catch{}if(this[An](e))try{Q.default.chownSync(String(e.absolute),Number(this[Nn](e)),Number(this[Dn](e)))}catch{}r(),e.resume()}[dr](e,r){try{return(0,jv.mkdirSync)((0,nt.normalizeWindowsPath)(e),{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:r})}catch(i){return i}}[zo](e,r,i,n){let s=`${i}Sync`;try{Q.default[s](r,String(e.absolute)),n(),e.resume()}catch(o){return this[Ie](o,e)}}};Xe.UnpackSync=rl});var sl=_(ot=>{"use strict";var hx=ot&&ot.__createBinding||(Object.create?function(t,e,r,i){i===void 0&&(i=r);var n=Object.getOwnPropertyDescriptor(e,r);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,i,n)}:function(t,e,r,i){i===void 0&&(i=r),t[i]=e[r]}),dx=ot&&ot.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),px=ot&&ot.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&hx(e,t,r);return dx(e,t),e},mx=ot&&ot.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ot,"__esModule",{value:!0});ot.extract=void 0;var Bv=px(di()),$v=mx(require("node:fs")),_x=Ri(),yx=pi(),Ho=nl(),vx=t=>{let e=new Ho.UnpackSync(t),r=t.file,i=$v.default.statSync(r),n=t.maxReadSize||16*1024*1024;new Bv.ReadStreamSync(r,{readSize:n,size:i.size}).pipe(e)},gx=(t,e)=>{let r=new Ho.Unpack(t),i=t.maxReadSize||16*1024*1024,n=t.file;return new Promise((o,a)=>{r.on("error",a),r.on("close",o),$v.default.stat(n,(u,f)=>{if(u)a(u);else{let c=new Bv.ReadStream(n,{readSize:i,size:f.size});c.on("error",a),c.pipe(r)}})})};ot.extract=(0,yx.makeCommand)(vx,gx,t=>new Ho.UnpackSync(t),t=>new Ho.Unpack(t),(t,e)=>{e?.length&&(0,_x.filesFilter)(t,e)})});var Go=_(Fi=>{"use strict";var Uv=Fi&&Fi.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Fi,"__esModule",{value:!0});Fi.replace=void 0;var zv=di(),Ze=Uv(require("node:fs")),Wv=Uv(require("node:path")),Hv=wi(),Gv=Ri(),wx=pi(),Ex=Us(),Vv=Ro(),Sx=(t,e)=>{let r=new Vv.PackSync(t),i=!0,n,s;try{try{n=Ze.default.openSync(t.file,"r+")}catch(u){if(u?.code==="ENOENT")n=Ze.default.openSync(t.file,"w+");else throw u}let o=Ze.default.fstatSync(n),a=Buffer.alloc(512);e:for(s=0;so.size)break;s+=f,t.mtimeCache&&u.mtime&&t.mtimeCache.set(String(u.path),u.mtime)}i=!1,bx(t,r,s,n,e)}finally{if(i)try{Ze.default.closeSync(n)}catch{}}},bx=(t,e,r,i,n)=>{let s=new zv.WriteStreamSync(t.file,{fd:i,start:r});e.pipe(s),Ox(e,n)},Rx=(t,e)=>{e=Array.from(e);let r=new Vv.Pack(t),i=(s,o,a)=>{let u=(l,d)=>{l?Ze.default.close(s,m=>a(l)):a(null,d)},f=0;if(o===0)return u(null,0);let c=0,h=Buffer.alloc(512),p=(l,d)=>{if(l||typeof d>"u")return u(l);if(c+=d,c<512&&d)return Ze.default.read(s,h,c,h.length-c,f+c,p);if(f===0&&h[0]===31&&h[1]===139)return u(new Error("cannot append to compressed archives"));if(c<512)return u(null,f);let m=new Hv.Header(h);if(!m.cksumValid)return u(null,f);let y=512*Math.ceil((m.size??0)/512);if(f+y+512>o||(f+=y+512,f>=o))return u(null,f);t.mtimeCache&&m.mtime&&t.mtimeCache.set(String(m.path),m.mtime),c=0,Ze.default.read(s,h,0,512,f,p)};Ze.default.read(s,h,0,512,f,p)};return new Promise((s,o)=>{r.on("error",o);let a="r+",u=(f,c)=>{if(f&&f.code==="ENOENT"&&a==="r+")return a="w+",Ze.default.open(t.file,a,u);if(f||!c)return o(f);Ze.default.fstat(c,(h,p)=>{if(h)return Ze.default.close(c,()=>o(h));i(c,p.size,(l,d)=>{if(l)return o(l);let m=new zv.WriteStream(t.file,{fd:c,start:d});r.pipe(m),m.on("error",o),m.on("close",s),Tx(r,e)})})};Ze.default.open(t.file,a,u)})},Ox=(t,e)=>{e.forEach(r=>{r.charAt(0)==="@"?(0,Gv.list)({file:Wv.default.resolve(t.cwd,r.slice(1)),sync:!0,noResume:!0,onReadEntry:i=>t.add(i)}):t.add(r)}),t.end()},Tx=async(t,e)=>{for(let r=0;rt.add(n)}):t.add(i)}t.end()};Fi.replace=(0,wx.makeCommand)(Sx,Rx,()=>{throw new TypeError("file is required")},()=>{throw new TypeError("file is required")},(t,e)=>{if(!(0,Ex.isFile)(t))throw new TypeError("file is required");if(t.gzip||t.brotli||t.file.endsWith(".br")||t.file.endsWith(".tbr"))throw new TypeError("cannot append to compressed archives");if(!e?.length)throw new TypeError("no paths specified to add/replace")})});var ol=_(Vo=>{"use strict";Object.defineProperty(Vo,"__esModule",{value:!0});Vo.update=void 0;var Cx=pi(),qn=Go();Vo.update=(0,Cx.makeCommand)(qn.replace.syncFile,qn.replace.asyncFile,qn.replace.syncNoFile,qn.replace.asyncNoFile,(t,e=[])=>{qn.replace.validate?.(t,e),xx(t)});var xx=t=>{let e=t.filter;t.mtimeCache||(t.mtimeCache=new Map),t.filter=e?(r,i)=>e(r,i)&&!((t.mtimeCache?.get(r)??i.mtime??0)>(i.mtime??0)):(r,i)=>!((t.mtimeCache?.get(r)??i.mtime??0)>(i.mtime??0))}});var Kv=_(Z=>{"use strict";var Xv=Z&&Z.__createBinding||(Object.create?function(t,e,r,i){i===void 0&&(i=r);var n=Object.getOwnPropertyDescriptor(e,r);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,i,n)}:function(t,e,r,i){i===void 0&&(i=r),t[i]=e[r]}),kx=Z&&Z.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),at=Z&&Z.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Xv(e,t,r)},Fx=Z&&Z.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&Xv(e,t,r);return kx(e,t),e};Object.defineProperty(Z,"__esModule",{value:!0});Z.u=Z.types=Z.r=Z.t=Z.x=Z.c=void 0;at(jc(),Z);var Ax=jc();Object.defineProperty(Z,"c",{enumerable:!0,get:function(){return Ax.create}});at(sl(),Z);var Nx=sl();Object.defineProperty(Z,"x",{enumerable:!0,get:function(){return Nx.extract}});at(wi(),Z);at(Ri(),Z);var Dx=Ri();Object.defineProperty(Z,"t",{enumerable:!0,get:function(){return Dx.list}});at(Ro(),Z);at(oo(),Z);at(Gs(),Z);at(Ys(),Z);at(Go(),Z);var Lx=Go();Object.defineProperty(Z,"r",{enumerable:!0,get:function(){return Lx.replace}});Z.types=Fx(nc());at(nl(),Z);at(ol(),Z);var Ix=ol();Object.defineProperty(Z,"u",{enumerable:!0,get:function(){return Ix.update}});at(Fc(),Z)});var{execSync:qx}=require("child_process"),Px=rm(),Mx=V_(),jx=require("https"),Ko=require("path"),Bx=Kv(),pr=require("fs"),Yo=require("os"),Ai=(()=>{try{return pr.accessSync("/usr/local/bin",pr.constants.W_OK),"/usr/local/bin"}catch{return Ko.join(process.env.INPUT_PKGX_DIR||Ko.join(Yo.homedir(),".pkgx"),"bin")}})();pr.writeFileSync(process.env.GITHUB_PATH,`${Ai} +`);function Xo(){let t=Yo.platform();t=="win32"&&(t="windows");let e=Yo.arch();return e=="x64"&&(e="x86-64"),e=="arm64"&&(e="aarch64"),`${t}/${e}`}function $x(t,e,r){return new Promise((i,n)=>{jx.get(t,s=>{if(s.statusCode!==200){n(new Error(`Failed to get '${t}' (${s.statusCode})`));return}if(console.log("extracting pkgx archive\u2026"),Xo().startsWith("windows")){let o=Px.Extract({path:e});s.pipe(o).promise().then(i,n),o.on("error",n)}else{let o=Bx.x({cwd:e,strip:r});s.pipe(o).on("finish",i).on("error",n),o.on("error",n)}}).on("error",n)})}function Ux(t){let e=i=>i.startsWith('"')||i.startsWith("'")?i.slice(1,-1):i,r=i=>i.replaceAll(/\$\{([a-zA-Z0-9_]+):\+:\$[a-zA-Z0-9_]+\}/g,(s,o)=>(a=>a?`:${a}`:"")(process.env[o])).replaceAll(/\$\{([a-zA-Z0-9_]+)\}/g,(s,o)=>process.env[o]??"").replaceAll(/\$([a-zA-Z0-9_]+)/g,(s,o)=>process.env[o]??"");for(let i of t.split(` +`)){let n=i.match(/^([^=]+)=(.*)$/);if(n){let[s,o,a]=n,u=e(a);if(o==="PATH")u.replaceAll("${PATH:+:$PATH}","").replaceAll("$PATH","").replaceAll("${PATH}","").split(":").forEach(f=>{pr.appendFileSync(process.env.GITHUB_PATH,`${f} +`)});else{let f=r(u);pr.appendFileSync(process.env.GITHUB_ENV,`${o}=${f} +`)}}}}async function zx(){let t=3;async function e(){if(Xo().startsWith("windows"))return t=0,"https://pkgx.sh/Windows/x86_64.zip";let i=`https://dist.pkgx.dev/pkgx.sh/${Xo()}/versions.txt`;console.log(`fetching ${i}`);let o=(await(await fetch(i)).text()).split(` +`),a=process.env.INPUT_VERSION?Mx.maxSatisfying(o,process.env.INPUT_VERSION):o.slice(-1)[0];if(!a)throw new Error(`no version found for ${process.env.INPUT_VERSION}`);return console.log(`selected pkgx v${a}`),`https://dist.pkgx.dev/pkgx.sh/${Xo()}/v${a}.tar.gz`}console.log(`::group::installing ${Ko.join(Ai,"pkgx")}`);let r=await e();console.log(`fetching ${r}`),pr.existsSync(Ai)||pr.mkdirSync(Ai,{recursive:!0}),await $x(r,Ai,t),console.log("::endgroup::")}(async()=>{if(await zx(),process.env.INPUT_PKGX_DIR&&pr.appendFileSync(process.env.GITHUB_ENV,`PKGX_DIR=${process.env.INPUT_PKGX_DIR} +`),process.env["INPUT_+"]){console.log("::group::installing pkgx input packages");let t=process.env["INPUT_+"].split(" ");Yo.platform()=="win32"&&(t=t.map(n=>n.replace("^","^^")));let e=`${Ko.join(Ai,"pkgx")} ${t.map(n=>`+${n}`).join(" ")}`;console.log(`running: \`${e}\``);let r;process.env.INPUT_PKGX_DIR&&(r=process.env,r.PKGX_DIR=process.env.INPUT_PKGX_DIR);let i=qx(e,{env:r});Ux(i.toString()),console.log("::endgroup::")}})().catch(t=>{console.error(`::error::${t.message}`),process.exit(1)});