diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 0a7df2ac7d8565..5c49bd87e3c81b 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -84,7 +84,7 @@ /doc/api/module.md @nodejs/modules @nodejs/loaders /doc/api/modules.md @nodejs/modules @nodejs/loaders /doc/api/packages.md @nodejs/modules @nodejs/loaders -/lib/internal/bootstrap/loaders.js @nodejs/modules @nodejs/loaders +/lib/internal/bootstrap/realm.js @nodejs/modules @nodejs/loaders /lib/internal/modules/* @nodejs/modules @nodejs/loaders /lib/internal/process/esm_loader.js @nodejs/modules @nodejs/loaders /lib/internal/process/execution.js @nodejs/modules @nodejs/loaders @@ -117,6 +117,7 @@ /benchmark/misc/startup.js @nodejs/startup /src/node.cc @nodejs/startup +/src/node_realm* @nodejs/startup @nodejs/realm /src/node_builtins* @nodejs/startup /src/node_snapshot* @nodejs/startup /lib/internal/bootstrap/* @nodejs/startup diff --git a/.github/workflows/auto-start-ci.yml b/.github/workflows/auto-start-ci.yml index 840d4afe942f1e..4cb5d49fe77324 100644 --- a/.github/workflows/auto-start-ci.yml +++ b/.github/workflows/auto-start-ci.yml @@ -46,12 +46,12 @@ jobs: if: needs.get-prs-for-ci.outputs.numbers != '' runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 with: persist-credentials: false - name: Install Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0 with: node-version: ${{ env.NODE_VERSION }} diff --git a/.github/workflows/build-tarball.yml b/.github/workflows/build-tarball.yml index 12d5e2794091cd..235a48fa5343c9 100644 --- a/.github/workflows/build-tarball.yml +++ b/.github/workflows/build-tarball.yml @@ -39,11 +39,11 @@ jobs: if: github.event.pull_request.draft == false runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 with: persist-credentials: false - name: Set up Python ${{ env.PYTHON_VERSION }} - uses: actions/setup-python@v4 + uses: actions/setup-python@d27e3f3d7c64b4bbf8e4abfb9b63b83e846e0435 # v4.5.0 with: python-version: ${{ env.PYTHON_VERSION }} - name: Environment Information @@ -57,7 +57,7 @@ jobs: mkdir tarballs mv *.tar.gz tarballs - name: Upload tarball artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 with: name: tarballs path: tarballs @@ -65,17 +65,17 @@ jobs: needs: build-tarball runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 with: persist-credentials: false - name: Set up Python ${{ env.PYTHON_VERSION }} - uses: actions/setup-python@v4 + uses: actions/setup-python@d27e3f3d7c64b4bbf8e4abfb9b63b83e846e0435 # v4.5.0 with: python-version: ${{ env.PYTHON_VERSION }} - name: Environment Information run: npx envinfo - name: Download tarball - uses: actions/download-artifact@v3 + uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 with: name: tarballs path: tarballs diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index 64eb7ddad23988..32025677b7f112 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -38,11 +38,11 @@ jobs: fail-fast: false runs-on: ${{ matrix.windows }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 with: persist-credentials: false - name: Set up Python ${{ env.PYTHON_VERSION }} - uses: actions/setup-python@v4 + uses: actions/setup-python@d27e3f3d7c64b4bbf8e4abfb9b63b83e846e0435 # v4.5.0 with: python-version: ${{ env.PYTHON_VERSION }} - name: Install deps diff --git a/.github/workflows/close-stale-feature-requests.yml b/.github/workflows/close-stale-feature-requests.yml index f8eef7ce35d84e..ac792a84e4e410 100644 --- a/.github/workflows/close-stale-feature-requests.yml +++ b/.github/workflows/close-stale-feature-requests.yml @@ -39,7 +39,7 @@ jobs: if: github.repository == 'nodejs/node' runs-on: ubuntu-latest steps: - - uses: actions/stale@v7 + - uses: actions/stale@1160a2240286f5da8ec72b1c0816ce2481aabf84 # v8.0.0 with: repo-token: ${{ secrets.GITHUB_TOKEN }} days-before-stale: 180 diff --git a/.github/workflows/close-stalled.yml b/.github/workflows/close-stalled.yml index 6eadfae6dd2481..8fec9f1d6c417b 100644 --- a/.github/workflows/close-stalled.yml +++ b/.github/workflows/close-stalled.yml @@ -20,7 +20,7 @@ jobs: if: github.repository == 'nodejs/node' runs-on: ubuntu-latest steps: - - uses: actions/stale@v7 + - uses: actions/stale@1160a2240286f5da8ec72b1c0816ce2481aabf84 # v8.0.0 with: repo-token: ${{ secrets.GITHUB_TOKEN }} days-before-close: 30 diff --git a/.github/workflows/comment-labeled.yml b/.github/workflows/comment-labeled.yml index 5f59a48bb5a6d0..228875e0cba30a 100644 --- a/.github/workflows/comment-labeled.yml +++ b/.github/workflows/comment-labeled.yml @@ -10,6 +10,10 @@ env: This issue/PR was marked as stalled, it will be automatically closed in 30 days. If it should remain open, please leave a comment explaining why it should remain open. FAST_TRACK_MESSAGE: Fast-track has been requested by @${{ github.actor }}. Please 👍 to approve. + NOTABLE_CHANGE_MESSAGE: | + The https://github.com/nodejs/node/labels/notable-change label has been added by @${{ github.actor }}. + + Please suggest a text for the release notes if you'd like to include a more detailed summary, then proceed to update the PR description with the text or a link to the notable change suggested text comment. permissions: contents: read @@ -38,3 +42,14 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: gh pr comment ${{ github.event.pull_request.number }} --repo ${{ github.repository }} --body "$FAST_TRACK_MESSAGE" + + notable-change: + permissions: + pull-requests: write + if: github.repository == 'nodejs/node' && github.event_name == 'pull_request_target' && github.event.label.name == 'notable-change' + runs-on: ubuntu-latest + steps: + - name: Add notable change description + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: gh pr comment ${{ github.event.pull_request.number }} --repo ${{ github.repository }} --body "$NOTABLE_CHANGE_MESSAGE" diff --git a/.github/workflows/commit-lint.yml b/.github/workflows/commit-lint.yml index 617e434e40404d..1dcc459b24687b 100644 --- a/.github/workflows/commit-lint.yml +++ b/.github/workflows/commit-lint.yml @@ -17,13 +17,13 @@ jobs: run: | echo "plusOne=$((${{ github.event.pull_request.commits }} + 1))" >> $GITHUB_OUTPUT echo "minusOne=$((${{ github.event.pull_request.commits }} - 1))" >> $GITHUB_OUTPUT - - uses: actions/checkout@v3 + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 with: fetch-depth: ${{ steps.nb-of-commits.outputs.plusOne }} persist-credentials: false - run: git reset HEAD^2 - name: Install Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0 with: node-version: ${{ env.NODE_VERSION }} - name: Validate commit message diff --git a/.github/workflows/commit-queue.yml b/.github/workflows/commit-queue.yml index 59ab3d2ce64263..c469c8810daada 100644 --- a/.github/workflows/commit-queue.yml +++ b/.github/workflows/commit-queue.yml @@ -58,7 +58,7 @@ jobs: if: needs.get_mergeable_prs.outputs.numbers != '' runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 with: # Needs the whole git history for ncu to work # See https://github.com/nodejs/node-core-utils/pull/486 @@ -71,7 +71,7 @@ jobs: # Install dependencies - name: Install Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0 with: node-version: ${{ env.NODE_VERSION }} - name: Install node-core-utils diff --git a/.github/workflows/coverage-linux-without-intl.yml b/.github/workflows/coverage-linux-without-intl.yml index f718c5c7773026..88c1338028a4f3 100644 --- a/.github/workflows/coverage-linux-without-intl.yml +++ b/.github/workflows/coverage-linux-without-intl.yml @@ -37,11 +37,11 @@ jobs: if: github.event.pull_request.draft == false runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 with: persist-credentials: false - name: Set up Python ${{ env.PYTHON_VERSION }} - uses: actions/setup-python@v4 + uses: actions/setup-python@d27e3f3d7c64b4bbf8e4abfb9b63b83e846e0435 # v4.5.0 with: python-version: ${{ env.PYTHON_VERSION }} - name: Environment Information @@ -64,6 +64,6 @@ jobs: - name: Clean tmp run: rm -rf coverage/tmp && rm -rf out - name: Upload - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # v3.1.1 with: directory: ./coverage diff --git a/.github/workflows/coverage-windows.yml b/.github/workflows/coverage-windows.yml index 3dd8d01565c8cb..04ff310d2f0216 100644 --- a/.github/workflows/coverage-windows.yml +++ b/.github/workflows/coverage-windows.yml @@ -39,11 +39,11 @@ jobs: if: github.event.pull_request.draft == false runs-on: windows-2022 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 with: persist-credentials: false - name: Set up Python ${{ env.PYTHON_VERSION }} - uses: actions/setup-python@v4 + uses: actions/setup-python@d27e3f3d7c64b4bbf8e4abfb9b63b83e846e0435 # v4.5.0 with: python-version: ${{ env.PYTHON_VERSION }} - name: Install deps @@ -65,6 +65,6 @@ jobs: - name: Clean tmp run: npx rimraf ./coverage/tmp - name: Upload - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # v3.1.1 with: directory: ./coverage diff --git a/.github/workflows/daily-wpt-fyi.yml b/.github/workflows/daily-wpt-fyi.yml index 14a6e984c5ad84..0e2c3df9fcbacb 100644 --- a/.github/workflows/daily-wpt-fyi.yml +++ b/.github/workflows/daily-wpt-fyi.yml @@ -33,7 +33,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Set up Python ${{ env.PYTHON_VERSION }} - uses: actions/setup-python@v4 + uses: actions/setup-python@d27e3f3d7c64b4bbf8e4abfb9b63b83e846e0435 # v4.5.0 with: python-version: ${{ env.PYTHON_VERSION }} - name: Environment Information @@ -45,7 +45,7 @@ jobs: run: echo "NIGHTLY=$(curl -s https://nodejs.org/download/nightly/index.json | jq -r '[.[] | select(.files[] | contains("linux-x64"))][0].version')" >> $GITHUB_ENV - name: Install Node.js id: setup-node - uses: actions/setup-node@v3 + uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0 with: node-version: ${{ env.NIGHTLY || matrix.node-version }} check-latest: true @@ -57,7 +57,7 @@ jobs: SHORT_SHA=$(node -p 'process.version.split(/-nightly\d{8}/)[1]') echo "NIGHTLY_REF=$(gh api /repos/nodejs/node/commits/$SHORT_SHA --jq '.sha')" >> $GITHUB_ENV - name: Checkout ${{ steps.setup-node.outputs.node-version }} - uses: actions/checkout@v3 + uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 with: persist-credentials: false ref: ${{ env.NIGHTLY_REF || steps.setup-node.outputs.node-version }} @@ -73,7 +73,7 @@ jobs: run: rm -rf wpt working-directory: test/fixtures - name: Checkout epochs/daily WPT - uses: actions/checkout@v3 + uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 with: repository: web-platform-tests/wpt persist-credentials: false @@ -121,7 +121,7 @@ jobs: run: cp wptreport.json wptreport-${{ steps.setup-node.outputs.node-version }}.json - name: Upload GitHub Actions artifact if: ${{ env.WPT_REPORT != '' }} - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 with: path: out/wpt/wptreport-*.json name: WPT Reports @@ -135,6 +135,8 @@ jobs: run: | gzip wptreport.json echo "## Node.js ${{ steps.setup-node.outputs.node-version }}" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo "WPT Revision: [\`${WPT_REVISION:0:7}\`](https://github.com/web-platform-tests/wpt/commits/$WPT_REVISION)" >> $GITHUB_STEP_SUMMARY for WPT_FYI_ENDPOINT in "https://wpt.fyi/api/results/upload" "https://staging.wpt.fyi/api/results/upload" do response=$(curl -sS \ @@ -148,7 +150,7 @@ jobs: origin=${WPT_FYI_ENDPOINT%/api/results/upload} echo "" >> $GITHUB_STEP_SUMMARY - echo "Run ID [$run_id]($origin/api/runs/$run_id) added to the processor queue at $origin" >> $GITHUB_STEP_SUMMARY + echo "Run ID [\`$run_id\`]($origin/api/runs/$run_id) added to the processor queue at ${origin:8}" >> $GITHUB_STEP_SUMMARY echo "- [View on the ${origin:8} dashboard]($origin/results?run_id=$run_id)" >> $GITHUB_STEP_SUMMARY fi done diff --git a/.github/workflows/daily.yml b/.github/workflows/daily.yml index f14bde4c7fb629..0c23505bf0ac07 100644 --- a/.github/workflows/daily.yml +++ b/.github/workflows/daily.yml @@ -17,11 +17,11 @@ jobs: # not working on gcc-8 and gcc-9 see https://github.com/nodejs/node/issues/38570 container: gcc:11 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 with: persist-credentials: false - name: Use Node.js ${{ env.NODE_VERSION }} - uses: actions/setup-node@v3 + uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0 with: node-version: ${{ env.NODE_VERSION }} - name: Environment Information diff --git a/.github/workflows/doc.yml b/.github/workflows/doc.yml index 76660343ca2f46..0c24159658c620 100644 --- a/.github/workflows/doc.yml +++ b/.github/workflows/doc.yml @@ -24,18 +24,18 @@ jobs: if: github.event.pull_request.draft == false runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 with: persist-credentials: false - name: Use Node.js ${{ env.NODE_VERSION }} - uses: actions/setup-node@v3 + uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0 with: node-version: ${{ env.NODE_VERSION }} - name: Environment Information run: npx envinfo - name: Build run: NODE=$(command -v node) make doc-only - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 with: name: docs path: out/doc diff --git a/.github/workflows/find-inactive-collaborators.yml b/.github/workflows/find-inactive-collaborators.yml index 33b63389934f5e..d03e994c2a487f 100644 --- a/.github/workflows/find-inactive-collaborators.yml +++ b/.github/workflows/find-inactive-collaborators.yml @@ -19,13 +19,13 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 with: fetch-depth: 0 persist-credentials: false - name: Use Node.js ${{ env.NODE_VERSION }} - uses: actions/setup-node@v3 + uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0 with: node-version: ${{ env.NODE_VERSION }} diff --git a/.github/workflows/find-inactive-tsc.yml b/.github/workflows/find-inactive-tsc.yml index 452a428959cef1..15ccfd5dd82c84 100644 --- a/.github/workflows/find-inactive-tsc.yml +++ b/.github/workflows/find-inactive-tsc.yml @@ -1,4 +1,4 @@ -name: Find inactive TSC members +name: Find inactive TSC voting members on: schedule: @@ -20,13 +20,13 @@ jobs: steps: - name: Checkout the repo - uses: actions/checkout@v3 + uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 with: fetch-depth: 0 persist-credentials: false - name: Clone nodejs/TSC repository - uses: actions/checkout@v3 + uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 with: fetch-depth: 0 path: .tmp @@ -34,11 +34,11 @@ jobs: repository: nodejs/TSC - name: Use Node.js ${{ env.NODE_VERSION }} - uses: actions/setup-node@v3 + uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0 with: node-version: ${{ env.NODE_VERSION }} - - name: Find inactive TSC members + - name: Find inactive TSC voting members run: tools/find-inactive-tsc.mjs >> $GITHUB_ENV - name: Open pull request @@ -56,6 +56,6 @@ jobs: @nodejs/tsc ${{ env.INACTIVE_TSC_HANDLES }} ${{ env.DETAILS_FOR_COMMIT_BODY }} - commit-message: 'meta: move one or more TSC members to emeritus' + commit-message: 'meta: move TSC voting member(s) to regular member(s)' labels: meta - title: 'meta: move one or more TSC members to emeritus' + title: 'meta: move TSC voting member(s) to regular member(s)' diff --git a/.github/workflows/label-pr.yml b/.github/workflows/label-pr.yml index 922a9359f5ed20..95fdd42a4c700a 100644 --- a/.github/workflows/label-pr.yml +++ b/.github/workflows/label-pr.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: nodejs/node-pr-labeler@v1 + - uses: nodejs/node-pr-labeler@d4cf1b8b9f23189c37917000e5e17e796c770a6b # v1 with: repo-token: ${{ secrets.GH_USER_TOKEN }} configuration-path: .github/label-pr-config.yml diff --git a/.github/workflows/license-builder.yml b/.github/workflows/license-builder.yml index a6732b149c01f5..830865ac3d0e85 100644 --- a/.github/workflows/license-builder.yml +++ b/.github/workflows/license-builder.yml @@ -17,7 +17,7 @@ jobs: if: github.repository == 'nodejs/node' runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 with: persist-credentials: false - run: ./tools/license-builder.sh # Run the license builder tool diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml index c9b8f08f99e4a4..96eb4604a20b70 100644 --- a/.github/workflows/linters.yml +++ b/.github/workflows/linters.yml @@ -25,11 +25,11 @@ jobs: if: github.event.pull_request.draft == false runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 with: persist-credentials: false - name: Use Node.js ${{ env.NODE_VERSION }} - uses: actions/setup-node@v3 + uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0 with: node-version: ${{ env.NODE_VERSION }} - name: Environment Information @@ -40,11 +40,11 @@ jobs: if: github.event.pull_request.draft == false runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 with: persist-credentials: false - name: Set up Python ${{ env.PYTHON_VERSION }} - uses: actions/setup-python@v4 + uses: actions/setup-python@d27e3f3d7c64b4bbf8e4abfb9b63b83e846e0435 # v4.5.0 with: python-version: ${{ env.PYTHON_VERSION }} - name: Environment Information @@ -55,16 +55,16 @@ jobs: if: ${{ github.event.pull_request && github.event.pull_request.draft == false && github.base_ref == github.event.repository.default_branch }} runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 with: fetch-depth: 0 persist-credentials: false - name: Use Node.js ${{ env.NODE_VERSION }} - uses: actions/setup-node@v3 + uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0 with: node-version: ${{ env.NODE_VERSION }} - name: Set up Python ${{ env.PYTHON_VERSION }} - uses: actions/setup-python@v4 + uses: actions/setup-python@d27e3f3d7c64b4bbf8e4abfb9b63b83e846e0435 # v4.5.0 with: python-version: ${{ env.PYTHON_VERSION }} - name: Environment Information @@ -93,11 +93,11 @@ jobs: if: github.event.pull_request.draft == false runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 with: persist-credentials: false - name: Use Node.js ${{ env.NODE_VERSION }} - uses: actions/setup-node@v3 + uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0 with: node-version: ${{ env.NODE_VERSION }} - name: Environment Information @@ -118,11 +118,11 @@ jobs: if: github.event.pull_request.draft == false runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 with: persist-credentials: false - name: Set up Python ${{ env.PYTHON_VERSION }} - uses: actions/setup-python@v4 + uses: actions/setup-python@d27e3f3d7c64b4bbf8e4abfb9b63b83e846e0435 # v4.5.0 with: python-version: ${{ env.PYTHON_VERSION }} - name: Environment Information @@ -135,11 +135,11 @@ jobs: if: github.event.pull_request.draft == false runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 with: persist-credentials: false - name: Use Python ${{ env.PYTHON_VERSION }} - uses: actions/setup-python@v4 + uses: actions/setup-python@d27e3f3d7c64b4bbf8e4abfb9b63b83e846e0435 # v4.5.0 with: python-version: ${{ env.PYTHON_VERSION }} - name: Environment Information @@ -153,7 +153,7 @@ jobs: if: github.event.pull_request.draft == false runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 with: persist-credentials: false - run: shellcheck -V @@ -163,7 +163,7 @@ jobs: if: github.event.pull_request.draft == false runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 with: persist-credentials: false - uses: mszostok/codeowners-validator@7f3f5e28c6d7b8dfae5731e54ce2272ca384592f @@ -173,7 +173,7 @@ jobs: if: ${{ github.event.pull_request }} runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 with: fetch-depth: 2 persist-credentials: false diff --git a/.github/workflows/notify-force-push.yml b/.github/workflows/notify-force-push.yml deleted file mode 100644 index 69aacc8524fd93..00000000000000 --- a/.github/workflows/notify-force-push.yml +++ /dev/null @@ -1,28 +0,0 @@ -on: - push: - branches: - - main - -name: Notify on Force Push -permissions: - contents: read - -jobs: - slackNotification: - name: Slack Notification - if: github.repository == 'nodejs/node' && github.event.forced - runs-on: ubuntu-latest - steps: - - name: Slack Notification - uses: rtCamp/action-slack-notify@12e36fc18b0689399306c2e0b3e0f2978b7f1ee7 - env: - SLACK_COLOR: '#DE512A' - SLACK_ICON: https://github.com/nodejs.png?size=48 - SLACK_TITLE: ${{ github.actor }} force-pushed to ${{ github.ref }} - SLACK_MESSAGE: | - A commit was force-pushed to by - - Before: - After: - SLACK_USERNAME: nodejs-bot - SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} diff --git a/.github/workflows/notify-on-push.yml b/.github/workflows/notify-on-push.yml new file mode 100644 index 00000000000000..6a307c6ff98245 --- /dev/null +++ b/.github/workflows/notify-on-push.yml @@ -0,0 +1,70 @@ +on: + push: + branches: + - main + +name: Notify on Push +permissions: + contents: read + +jobs: + notifyOnForcePush: + name: Notify on Force Push on `main` + if: github.repository == 'nodejs/node' && github.event.forced + runs-on: ubuntu-latest + steps: + - name: Slack Notification + uses: rtCamp/action-slack-notify@12e36fc18b0689399306c2e0b3e0f2978b7f1ee7 + env: + SLACK_COLOR: '#DE512A' + SLACK_ICON: https://github.com/nodejs.png?size=48 + SLACK_TITLE: ${{ github.actor }} force-pushed to ${{ github.ref }} + SLACK_MESSAGE: | + A commit was force-pushed to by + + Before: + After: + SLACK_USERNAME: nodejs-bot + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} + + notifyOnMissingMetadata: + name: Notify on Push on `main` that lacks metadata + if: github.repository == 'nodejs/node' + runs-on: ubuntu-latest + permissions: + pull-requests: write + steps: + - uses: actions/checkout@v3 + with: + persist-credentials: false + - name: Check commit message + run: npx -q core-validate-commit ${{ github.event.after }} || echo "INVALID_COMMIT_MESSAGE=1" >> $GITHUB_ENV + - name: Retrieve PR number if possible + if: env.INVALID_COMMIT_MESSAGE + run: | + COMMIT_TITLE=$(git --no-pager log --oneline -1 --no-color) node <<'EOF' >> $GITHUB_ENV || true + const invalidCommitMessageMatch = /\s\(\#(\d+)\)$/.exec(process.env.COMMIT_TITLE); + if (invalidCommitMessageMatch == null) process.exit(1) + console.log(`PR_ID=${invalidCommitMessageMatch[1]}`) + EOF + - name: Comment on the Pull Request + if: ${{ env.PR_ID }} + run: | + gh pr comment ${{ env.PR_ID }} --repo "${{ github.repository }}" \ + --body "A commit referencing this Pull Request was pushed to `${{ github.ref_name }}` by @${{ github.actor }} with an invalid commit message." + env: + GH_TOKEN: ${{ github.token }} + - name: Slack Notification + if: ${{ env.INVALID_COMMIT_MESSAGE }} + uses: rtCamp/action-slack-notify@12e36fc18b0689399306c2e0b3e0f2978b7f1ee7 + env: + SLACK_COLOR: '#DE512A' + SLACK_ICON: https://github.com/nodejs.png?size=48 + SLACK_TITLE: Invalid commit was pushed to ${{ github.repository.default_branch }} + SLACK_MESSAGE: | + A commit with an invalid message was pushed to by . + + Before: + After: + SLACK_USERNAME: nodejs-bot + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml new file mode 100644 index 00000000000000..27ca97808cd52a --- /dev/null +++ b/.github/workflows/scorecard.yml @@ -0,0 +1,78 @@ +# This workflow uses actions that are not certified by GitHub. They are provided +# by a third-party and are governed by separate terms of service, privacy +# policy, and support documentation. + +name: Scorecard supply-chain security +on: + # For Branch-Protection check. Only the default branch is supported. See + # https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection + branch_protection_rule: + # To guarantee Maintained check is occasionally updated. See + # https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained + schedule: + - cron: 16 21 * * 1 + push: + branches: [main] + workflow_dispatch: + +# Declare default permissions as read only. +permissions: read-all + +jobs: + analysis: + name: Scorecard analysis + runs-on: ubuntu-latest + permissions: + # Needed to upload the results to code-scanning dashboard. + security-events: write + # Needed to publish results and get a badge (see publish_results below). + id-token: write + # Uncomment the permissions below if installing in a private repository. + # contents: read + # actions: read + + steps: + - name: Harden Runner + uses: step-security/harden-runner@1f99358870fe1c846a3ccba386cc2b2246836776 # v2.2.1 + with: + egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs + + - name: Checkout code + uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 + with: + persist-credentials: false + + - name: Run analysis + uses: ossf/scorecard-action@e38b1902ae4f44df626f11ba0734b14fb91f8f86 # v2.1.2 + with: + results_file: results.sarif + results_format: sarif + # (Optional) "write" PAT token. Uncomment the `repo_token` line below if: + # - you want to enable the Branch-Protection check on a *public* repository, or + # - you are installing Scorecard on a *private* repository + # To create the PAT, follow the steps in https://github.com/ossf/scorecard-action#authentication-with-pat. + # repo_token: ${{ secrets.SCORECARD_TOKEN }} + + # Public repositories: + # - Publish results to OpenSSF REST API for easy access by consumers + # - Allows the repository to include the Scorecard badge. + # - See https://github.com/ossf/scorecard-action#publishing-results. + # For private repositories: + # - `publish_results` will always be set to `false`, regardless + # of the value entered here. + publish_results: true + + # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF + # format to the repository Actions tab. + - name: Upload artifact + uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 + with: + name: SARIF file + path: results.sarif + retention-days: 5 + + # Upload the results to GitHub's code scanning dashboard. + - name: Upload to code-scanning + uses: github/codeql-action/upload-sarif@04df1262e6247151b5ac09cd2c303ac36ad3f62b # v2.2.9 + with: + sarif_file: results.sarif diff --git a/.github/workflows/test-asan.yml b/.github/workflows/test-asan.yml index fc8d38945dd397..892bcff481a52f 100644 --- a/.github/workflows/test-asan.yml +++ b/.github/workflows/test-asan.yml @@ -47,11 +47,11 @@ jobs: CONFIG_FLAGS: --enable-asan ASAN: true steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 with: persist-credentials: false - name: Set up Python ${{ env.PYTHON_VERSION }} - uses: actions/setup-python@v4 + uses: actions/setup-python@d27e3f3d7c64b4bbf8e4abfb9b63b83e846e0435 # v4.5.0 with: python-version: ${{ env.PYTHON_VERSION }} - name: Environment Information diff --git a/.github/workflows/test-internet.yml b/.github/workflows/test-internet.yml index 236d76741be40b..3ecbc5442547da 100644 --- a/.github/workflows/test-internet.yml +++ b/.github/workflows/test-internet.yml @@ -32,11 +32,11 @@ jobs: if: github.repository == 'nodejs/node' || github.event_name != 'schedule' runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 with: persist-credentials: false - name: Set up Python ${{ env.PYTHON_VERSION }} - uses: actions/setup-python@v4 + uses: actions/setup-python@d27e3f3d7c64b4bbf8e4abfb9b63b83e846e0435 # v4.5.0 with: python-version: ${{ env.PYTHON_VERSION }} - name: Environment Information diff --git a/.github/workflows/test-linux.yml b/.github/workflows/test-linux.yml index 2a1614e7e8cba1..4c8c0787bf4b0f 100644 --- a/.github/workflows/test-linux.yml +++ b/.github/workflows/test-linux.yml @@ -34,11 +34,11 @@ jobs: if: github.event.pull_request.draft == false runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 with: persist-credentials: false - name: Set up Python ${{ env.PYTHON_VERSION }} - uses: actions/setup-python@v4 + uses: actions/setup-python@d27e3f3d7c64b4bbf8e4abfb9b63b83e846e0435 # v4.5.0 with: python-version: ${{ env.PYTHON_VERSION }} - name: Environment Information diff --git a/.github/workflows/test-macos.yml b/.github/workflows/test-macos.yml index c09004cbe422c7..9e9bb3e1b45475 100644 --- a/.github/workflows/test-macos.yml +++ b/.github/workflows/test-macos.yml @@ -40,11 +40,11 @@ jobs: if: github.event.pull_request.draft == false runs-on: macos-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 with: persist-credentials: false - name: Set up Python ${{ env.PYTHON_VERSION }} - uses: actions/setup-python@v4 + uses: actions/setup-python@d27e3f3d7c64b4bbf8e4abfb9b63b83e846e0435 # v4.5.0 with: python-version: ${{ env.PYTHON_VERSION }} - name: Environment Information diff --git a/.github/workflows/timezone-update.yml b/.github/workflows/timezone-update.yml index a28434f2d9be74..0c6b6f5fafd92c 100644 --- a/.github/workflows/timezone-update.yml +++ b/.github/workflows/timezone-update.yml @@ -20,12 +20,12 @@ jobs: steps: - name: Checkout nodejs/node - uses: actions/checkout@v3 + uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 with: persist-credentials: false - name: Checkout unicode-org/icu-data - uses: actions/checkout@v3 + uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 with: path: icu-data persist-credentials: false diff --git a/.github/workflows/tools.yml b/.github/workflows/tools.yml index 5e286f98f75c7a..e3af7ab3a15009 100644 --- a/.github/workflows/tools.yml +++ b/.github/workflows/tools.yml @@ -87,13 +87,10 @@ jobs: subsystem: deps label: dependencies run: | - NEW_VERSION=$(gh api repos/aklomp/base64/releases/latest -q '.tag_name|ltrimstr("v")') - CURRENT_VERSION=$(grep "base64 LANGUAGES C VERSION" ./deps/base64/base64/CMakeLists.txt | \ - sed -n "s/^.*VERSION \(.*\))/\1/p") - if [ "$NEW_VERSION" != "$CURRENT_VERSION" ]; then - echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV - ./tools/update-base64.sh "$NEW_VERSION" - fi + ./tools/dep_updaters/update-base64.sh > temp-output + cat temp-output + tail -n1 temp-output | grep "NEW_VERSION=" >> "$GITHUB_ENV" || true + rm temp-output - id: acorn subsystem: deps label: dependencies @@ -142,25 +139,18 @@ jobs: subsystem: deps label: dependencies run: | - NEW_VERSION=$(gh api repos/nghttp2/nghttp2/releases/latest -q '.tag_name|ltrimstr("v")') - CURRENT_VERSION=$(grep "#define NGHTTP2_VERSION" ./deps/nghttp2/lib/includes/nghttp2/nghttp2ver.h | sed -n "s/^.*VERSION \(.*\)/\1/p") - if [ "$NEW_VERSION" != "$CURRENT_VERSION" ]; then - echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV - ./tools/update-nghttp2.sh "$NEW_VERSION" - fi + ./tools/dep_updaters/update-nghttp2.sh > temp-output + cat temp-output + tail -n1 temp-output | grep "NEW_VERSION=" >> "$GITHUB_ENV" || true + rm temp-output - id: llhttp subsystem: deps label: dependencies run: | - NEW_VERSION=$(gh api repos/nodejs/llhttp/releases/latest -q '.tag_name|ltrimstr("release/v")') - CURRENT_MAJOR_VERSION=$(grep "#define LLHTTP_VERSION_MAJOR" ./deps/llhttp/include/llhttp.h | sed -n "s/^.*MAJOR \(.*\)/\1/p") - CURRENT_MINOR_VERSION=$(grep "#define LLHTTP_VERSION_MINOR" ./deps/llhttp/include/llhttp.h | sed -n "s/^.*MINOR \(.*\)/\1/p") - CURRENT_PATCH_VERSION=$(grep "#define LLHTTP_VERSION_PATCH" ./deps/llhttp/include/llhttp.h | sed -n "s/^.*PATCH \(.*\)/\1/p") - CURRENT_VERSION="$CURRENT_MAJOR_VERSION.$CURRENT_MINOR_VERSION.$CURRENT_PATCH_VERSION" - if [ "$NEW_VERSION" != "$CURRENT_VERSION" ]; then - echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV - ./tools/update-llhttp.sh "$NEW_VERSION" - fi + ./tools/dep_updaters/update-llhttp.sh > temp-output + cat temp-output + tail -n1 temp-output | grep "NEW_VERSION=" >> "$GITHUB_ENV" || true + rm temp-output - id: c-ares subsystem: deps label: dependencies @@ -169,13 +159,38 @@ jobs: cat temp-output tail -n1 temp-output | grep "NEW_VERSION=" >> "$GITHUB_ENV" || true rm temp-output + - id: brotli + subsystem: deps + label: dependencies + run: | + ./tools/dep_updaters/update-brotli.sh > temp-output + cat temp-output + tail -n1 temp-output | grep "NEW_VERSION=" >> "$GITHUB_ENV" || true + rm temp-output + - id: root-certificates + subsystem: crypto + label: crypto, notable-change + run: | + node ./tools/dep_updaters/update-root-certs.mjs -v -f "$GITHUB_ENV" + - id: cjs-module-lexer + subsystem: deps + label: dependencies + run: | + ./tools/dep_updaters/update-cjs-module-lexer.sh > temp-output + cat temp-output + tail -n1 temp-output | grep "NEW_VERSION=" >> "$GITHUB_ENV" || true + rm temp-output steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 with: persist-credentials: false - run: ${{ matrix.run }} env: GITHUB_TOKEN: ${{ secrets.GH_USER_TOKEN }} + - name: Generate commit message if not set + if: ${{ env.COMMIT_MSG == '' }} + run: | + echo "COMMIT_MSG=${{ matrix.subsystem }}: update ${{ matrix.id }} to ${{ env.NEW_VERSION }}" >> "$GITHUB_ENV" - uses: gr2m/create-or-update-pull-request-action@77596e3166f328b24613f7082ab30bf2d93079d5 # Creates a PR or update the Action's existing PR, or # no-op if the base branch is already up-to-date. @@ -185,6 +200,6 @@ jobs: author: Node.js GitHub Bot body: This is an automated update of ${{ matrix.id }} to ${{ env.NEW_VERSION }}. branch: actions/tools-update-${{ matrix.id }} # Custom branch *just* for this Action. - commit-message: '${{ matrix.subsystem }}: update ${{ matrix.id }} to ${{ env.NEW_VERSION }}' + commit-message: ${{ env.COMMIT_MSG }} labels: ${{ matrix.label }} title: '${{ matrix.subsystem }}: update ${{ matrix.id }} to ${{ env.NEW_VERSION }}' diff --git a/.github/workflows/update-openssl.yml b/.github/workflows/update-openssl.yml index c2f919c60f6dcb..f79ea550b42818 100644 --- a/.github/workflows/update-openssl.yml +++ b/.github/workflows/update-openssl.yml @@ -28,7 +28,8 @@ jobs: NEW_VERSION=$(gh api repos/quictls/openssl/releases -q '.[].tag_name|select(contains("openssl-3"))|ltrimstr("openssl-")' | head -n1) NEW_VERSION_NO_RELEASE_1=$(case $NEW_VERSION in *quic1) echo ${NEW_VERSION%1};; *) echo $NEW_VERSION;; esac) VERSION_H="./deps/openssl/config/archs/linux-x86_64/asm/include/openssl/opensslv.h" - CURRENT_VERSION=$(grep "OPENSSL_FULL_VERSION_STR" $VERSION_H | sed -n "s/^.*VERSION_STR \"\(.*\)\"/\1/p") + CURRENT_VERSION=$(grep "OPENSSL_FULL_VERSION_STR" $VERSION_H | sed -n "s/^.*VERSION_STR \"\(.*\)\"/\1/p" | sed 's/+/-/g') + echo "comparing current version: $CURRENT_VERSION with $NEW_VERSION_NO_RELEASE_1" if [ "$NEW_VERSION_NO_RELEASE_1" != "$CURRENT_VERSION" ]; then echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV echo "HAS_UPDATE=true" >> $GITHUB_ENV diff --git a/.gitignore b/.gitignore index 9881176886826b..b3399fa0df2655 100644 --- a/.gitignore +++ b/.gitignore @@ -65,12 +65,12 @@ _UpgradeReport_Files/ /tools/msvs/genfiles/ /npm.wxs /corepack.wxs -/tools/msvs/msi/Release/ -/tools/msvs/msi/obj/ -/tools/msvs/msi/x64/ +/tools/msvs/msi/**/Release/ +/tools/msvs/msi/**/obj/ +/tools/msvs/msi/**/x64/ # Exclude MSVS files used for .msi file generation -!tools/msvs/msi/custom_actions.vcxproj -!tools/msvs/msi/nodemsi.sln +!tools/msvs/msi/**/custom_actions.vcxproj +!tools/msvs/msi/**/nodemsi.sln # === Rules for GYP artifacts === *-nodegyp* diff --git a/.gitpod.yml b/.gitpod.yml index e01e98fab5a1c6..b674e800f4c015 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -1,6 +1,7 @@ # Ref: https://github.com/gitpod-io/gitpod/issues/6283#issuecomment-1001043454 tasks: - init: ./configure && timeout 50m make -j16 || true + - init: pnpm i -g node-core-utils # Ref: https://www.gitpod.io/docs/prebuilds#github-specific-configuration github: diff --git a/BUILDING.md b/BUILDING.md index 3e519343a3cbf9..40220f75ad682f 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -106,14 +106,14 @@ platforms. This is true regardless of entries in the table below. | GNU/Linux | x64 | kernel >= 3.10, musl >= 1.1.19 | Experimental | e.g. Alpine 3.8 | | GNU/Linux | x86 | kernel >= 3.10, glibc >= 2.17 | Experimental | Downgraded as of Node.js 10 | | GNU/Linux | arm64 | kernel >= 4.18[^1], glibc >= 2.28 | Tier 1 | e.g. Ubuntu 20.04, Debian 10, RHEL 8 | -| GNU/Linux | armv7 | kernel >= 4.18[^1], glibc >= 2.28 | Tier 1 | e.g. Ubuntu 20.04, Debian 10 | +| GNU/Linux | armv7 | kernel >= 4.18[^1], glibc >= 2.28 | Tier 1 | e.g. Ubuntu 20.04, Debian 11 | | GNU/Linux | armv6 | kernel >= 4.14, glibc >= 2.24 | Experimental | Downgraded as of Node.js 12 | | GNU/Linux | ppc64le >=power8 | kernel >= 4.18[^1], glibc >= 2.28 | Tier 2 | e.g. Ubuntu 20.04, RHEL 8 | | GNU/Linux | s390x | kernel >= 4.18[^1], glibc >= 2.28 | Tier 2 | e.g. RHEL 8 | | Windows | x64, x86 (WoW64) | >= Windows 10/Server 2016 | Tier 1 | [^2],[^3] | | Windows | x86 (native) | >= Windows 10/Server 2016 | Tier 1 (running) / Experimental (compiling)[^4] | | | Windows | x64, x86 | Windows 8.1/Server 2012 | Experimental | | -| Windows | arm64 | >= Windows 10 | Tier 2 (compiling) / Experimental (running) | | +| Windows | arm64 | >= Windows 10 | Tier 2 | | | macOS | x64 | >= 10.15 | Tier 1 | For notes about compilation see [^5] | | macOS | arm64 | >= 11 | Tier 1 | | | SmartOS | x64 | >= 18 | Tier 2 | | @@ -160,23 +160,28 @@ Depending on the host platform, the selection of toolchains may vary. Binaries at are produced on: -| Binary package | Platform and Toolchain | -| ----------------------- | ------------------------------------------------------------------------------------------------------------- | -| aix-ppc64 | AIX 7.2 TL04 on PPC64BE with GCC 8 | -| darwin-x64 | macOS 10.15, Xcode Command Line Tools 11 with -mmacosx-version-min=10.15 | -| darwin-arm64 (and .pkg) | macOS 11 (arm64), Xcode Command Line Tools 12 with -mmacosx-version-min=10.15 | -| linux-arm64 | RHEL 8 with GCC 8[^6] | -| linux-armv7l | Cross-compiled on Ubuntu 18.04 x64 with [custom GCC toolchain](https://github.com/rvagg/rpi-newer-crosstools) | -| linux-ppc64le | RHEL 8 with GCC 8[^6] | -| linux-s390x | RHEL 8 with GCC 8[^6] | -| linux-x64 | RHEL 8 with GCC 8[^6] | -| win-x64 and win-x86 | Windows 2012 R2 (x64) with Visual Studio 2019 | +| Binary package | Platform and Toolchain | +| ----------------------- | ----------------------------------------------------------------------------------------------------------- | +| aix-ppc64 | AIX 7.2 TL04 on PPC64BE with GCC 10 | +| darwin-x64 | macOS 10.15, Xcode Command Line Tools 11 with -mmacosx-version-min=10.15 | +| darwin-arm64 (and .pkg) | macOS 11 (arm64), Xcode Command Line Tools 12 with -mmacosx-version-min=10.15 | +| linux-arm64 | RHEL 8 with GCC 10[^6] | +| linux-armv7l | Cross-compiled on RHEL 8 x64 with [custom GCC toolchain](https://github.com/rvagg/rpi-newer-crosstools)[^7] | +| linux-ppc64le | RHEL 8 with gcc-toolset-10[^6] | +| linux-s390x | RHEL 8 with gcc-toolset-10[^6] | +| linux-x64 | RHEL 8 with gcc-toolset-10[^6] | +| win-x64 and win-x86 | Windows 2012 R2 (x64) with Visual Studio 2019 | [^6]: Binaries produced on these systems are compatible with glibc >= 2.28 and libstdc++ >= 6.0.25 (`GLIBCXX_3.4.25`). These are available on distributions natively supporting GCC 8.1 or higher, such as Debian 10, RHEL 8 and Ubuntu 20.04. +[^7]: Binaries produced on these systems are compatible with glibc >= 2.28 + and libstdc++ >= 6.0.28 (`GLIBCXX_3.4.28`). These are available on + distributions natively supporting GCC 9.3 or higher, such as Debian 11, + Ubuntu 20.04. + #### OpenSSL asm support OpenSSL-1.1.1 requires the following assembler version for use of asm @@ -586,10 +591,7 @@ to run it again before invoking `make -j4`. Optional requirements to build the MSI installer package: -* The [WiX Toolset v3.11](https://wixtoolset.org/releases/) and the - [Wix Toolset Visual Studio 2019 Extension](https://marketplace.visualstudio.com/items?itemName=WixToolset.WixToolsetVisualStudio2019Extension) -* The [WiX Toolset v3.14](https://wixtoolset.org/releases/) if - building for Windows 10 on ARM (ARM64) +* The .NET SDK component from [Visual Studio 2019](https://visualstudio.microsoft.com/vs/older-downloads/#visual-studio-2019-and-other-products) Optional requirements for compiling for Windows 10 on ARM (ARM64): diff --git a/CHANGELOG.md b/CHANGELOG.md index 2b5e7bf6682730..e74162eeb45e47 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -71,7 +71,8 @@ release. 18.0.0
-16.19.1
+16.20.0
+16.19.1
16.19.0
16.18.1
16.18.0
diff --git a/GOVERNANCE.md b/GOVERNANCE.md index f5f3ffa015ced7..6ba1ef2daf2c3d 100644 --- a/GOVERNANCE.md +++ b/GOVERNANCE.md @@ -118,8 +118,8 @@ the issue tracker is: * A TSC member opens an issue explaining the proposal/issue and @-mentions @nodejs/tsc. -* The proposal passes if, after 72 hours, there are two or more TSC approvals - and no TSC opposition. +* The proposal passes if, after 72 hours, there are two or more TSC voting + member approvals and no TSC voting member opposition. * If there is an extended impasse, a TSC member may make a motion for a vote. ## Collaborator nominations @@ -177,6 +177,6 @@ The TSC follows a [Consensus Seeking][] decision-making model per the [Consensus Seeking]: https://en.wikipedia.org/wiki/Consensus-seeking_decision-making [TSC Charter]: https://github.com/nodejs/TSC/blob/HEAD/TSC-Charter.md -[collaborators discussion page]: https://github.com/orgs/nodejs/teams/collaborators/discussions +[collaborators discussion page]: https://github.com/nodejs/collaborators/discussions/categories/collaborator-nominations [nodejs/help]: https://github.com/nodejs/help [nodejs/node]: https://github.com/nodejs/node diff --git a/Makefile b/Makefile index 0be0659d372d2d..831f9613233881 100644 --- a/Makefile +++ b/Makefile @@ -351,10 +351,6 @@ test-cov: all $(MAKE) cctest CI_SKIP_TESTS=$(COV_SKIP_TESTS) $(MAKE) jstest -.PHONY: test-parallel -test-parallel: all - $(PYTHON) tools/test.py $(PARALLEL_ARGS) --mode=$(BUILDTYPE_LOWER) parallel - .PHONY: test-valgrind test-valgrind: all $(PYTHON) tools/test.py $(PARALLEL_ARGS) --mode=$(BUILDTYPE_LOWER) --valgrind sequential parallel message @@ -583,16 +579,10 @@ run-ci: build-ci $(MAKE) test-ci -j1 .PHONY: test-release -test-release: test-build - $(PYTHON) tools/test.py $(PARALLEL_ARGS) --mode=$(BUILDTYPE_LOWER) - .PHONY: test-debug -test-debug: test-build - $(PYTHON) tools/test.py $(PARALLEL_ARGS) --mode=debug - -.PHONY: test-message -test-message: test-build - $(PYTHON) tools/test.py $(PARALLEL_ARGS) message +test-debug: BUILDTYPE_LOWER=debug +test-release test-debug: test-build + $(PYTHON) tools/test.py $(PARALLEL_ARGS) --mode=$(BUILDTYPE_LOWER) .PHONY: test-wpt test-wpt: all @@ -602,24 +592,13 @@ test-wpt: all test-wpt-report: $(RM) -r out/wpt mkdir -p out/wpt - WPT_REPORT=1 $(PYTHON) tools/test.py --shell $(NODE) $(PARALLEL_ARGS) wpt - -.PHONY: test-simple -test-simple: | cctest # Depends on 'all'. - $(PYTHON) tools/test.py $(PARALLEL_ARGS) parallel sequential - -.PHONY: test-pummel -test-pummel: all - $(PYTHON) tools/test.py $(PARALLEL_ARGS) pummel + -WPT_REPORT=1 $(PYTHON) tools/test.py --shell $(NODE) $(PARALLEL_ARGS) wpt + $(NODE) "$$PWD/tools/merge-wpt-reports.mjs" .PHONY: test-internet test-internet: all $(PYTHON) tools/test.py $(PARALLEL_ARGS) internet -.PHONY: test-benchmark -test-benchmark: | bench-addons-build - $(PYTHON) tools/test.py $(PARALLEL_ARGS) benchmark - .PHONY: test-tick-processor test-tick-processor: all $(PYTHON) tools/test.py $(PARALLEL_ARGS) tick-processor @@ -687,10 +666,6 @@ test-addons-clean: $(MAKE) test-js-native-api-clean $(MAKE) test-node-api-clean -.PHONY: test-async-hooks -test-async-hooks: - $(PYTHON) tools/test.py $(PARALLEL_ARGS) --mode=$(BUILDTYPE_LOWER) async-hooks - .PHONY: test-with-async-hooks test-with-async-hooks: $(MAKE) build-addons @@ -1518,8 +1493,8 @@ cpplint: lint-cpp # Try with '--system' if it fails without; the system may have set '--user' lint-py-build: $(info Pip installing flake8 linter on $(shell $(PYTHON) --version)...) - $(PYTHON) -m pip install --no-user --upgrade -t tools/pip/site-packages flake8 || \ - $(PYTHON) -m pip install --no-user --upgrade --system -t tools/pip/site-packages flake8 + $(PYTHON) -m pip install --upgrade -t tools/pip/site-packages flake8 || \ + $(PYTHON) -m pip install --upgrade --system -t tools/pip/site-packages flake8 .PHONY: lint-py ifneq ("","$(wildcard tools/pip/site-packages/flake8)") @@ -1538,8 +1513,8 @@ endif # Try with '--system' if it fails without; the system may have set '--user' lint-yaml-build: $(info Pip installing yamllint on $(shell $(PYTHON) --version)...) - $(PYTHON) -m pip install --no-user --upgrade -t tools/pip/site-packages yamllint || \ - $(PYTHON) -m pip install --no-user --upgrade --system -t tools/pip/site-packages yamllint + $(PYTHON) -m pip install --upgrade -t tools/pip/site-packages yamllint || \ + $(PYTHON) -m pip install --upgrade --system -t tools/pip/site-packages yamllint .PHONY: lint-yaml # Lints the YAML files with yamllint. diff --git a/README.md b/README.md index 73dc15bc66bc35..e30f049fb45875 100644 --- a/README.md +++ b/README.md @@ -158,6 +158,8 @@ For information about the governance of the Node.js project, see ### TSC (Technical Steering Committee) +#### TSC voting members + * [aduh95](https://github.com/aduh95) - @@ -168,14 +170,10 @@ For information about the governance of the Node.js project, see **Beth Griggs** <> (she/her) * [BridgeAR](https://github.com/BridgeAR) - **Ruben Bridgewater** <> (he/him) -* [ChALkeR](https://github.com/ChALkeR) - - **Сковорода Никита Андреевич** <> (he/him) * [cjihrig](https://github.com/cjihrig) - **Colin Ihrig** <> (he/him) * [danielleadams](https://github.com/danielleadams) - **Danielle Adams** <> (she/her) -* [fhinkel](https://github.com/fhinkel) - - **Franziska Hinkelmann** <> (she/her) * [GeoffreyBooth](https://github.com/geoffreybooth) - **Geoffrey Booth** <> (he/him) * [gireeshpunathil](https://github.com/gireeshpunathil) - @@ -190,6 +188,8 @@ For information about the governance of the Node.js project, see **Matteo Collina** <> (he/him) * [mhdawson](https://github.com/mhdawson) - **Michael Dawson** <> (he/him) +* [MoLow](https://github.com/MoLow) - + **Moshe Atlow** <> (he/him) * [RafaelGSS](https://github.com/RafaelGSS) - **Rafael Gonzaga** <> (he/him) * [RaisinTen](https://github.com/RaisinTen) - @@ -205,28 +205,43 @@ For information about the governance of the Node.js project, see * [Trott](https://github.com/Trott) - **Rich Trott** <> (he/him) -
- -Emeriti - -### TSC emeriti +#### TSC regular members * [addaleax](https://github.com/addaleax) - **Anna Henningsen** <> (she/her) * [bnoordhuis](https://github.com/bnoordhuis) - **Ben Noordhuis** <> -* [chrisdickinson](https://github.com/chrisdickinson) - - **Chris Dickinson** <> +* [ChALkeR](https://github.com/ChALkeR) - + **Сковорода Никита Андреевич** <> (he/him) * [codebytere](https://github.com/codebytere) - **Shelley Vohr** <> (she/her) * [danbev](https://github.com/danbev) - **Daniel Bevenius** <> (he/him) +* [fhinkel](https://github.com/fhinkel) - + **Franziska Hinkelmann** <> (she/her) +* [gabrielschulhof](https://github.com/gabrielschulhof) - + **Gabriel Schulhof** <> +* [mscdex](https://github.com/mscdex) - + **Brian White** <> +* [MylesBorins](https://github.com/MylesBorins) - + **Myles Borins** <> (he/him) +* [rvagg](https://github.com/rvagg) - + **Rod Vagg** <> +* [TimothyGu](https://github.com/TimothyGu) - + **Tiancheng "Timothy" Gu** <> (he/him) + +
+ +TSC emeriti members + +#### TSC emeriti members + +* [chrisdickinson](https://github.com/chrisdickinson) - + **Chris Dickinson** <> * [evanlucas](https://github.com/evanlucas) - **Evan Lucas** <> (he/him) * [Fishrock123](https://github.com/Fishrock123) - **Jeremiah Senkpiel** <> (he/they) -* [gabrielschulhof](https://github.com/gabrielschulhof) - - **Gabriel Schulhof** <> * [gibfahn](https://github.com/gibfahn) - **Gibson Fahnestock** <> (he/him) * [indutny](https://github.com/indutny) - @@ -237,10 +252,6 @@ For information about the governance of the Node.js project, see **Josh Gavant** <> * [mmarchini](https://github.com/mmarchini) - **Mary Marchini** <> (she/her) -* [mscdex](https://github.com/mscdex) - - **Brian White** <> -* [MylesBorins](https://github.com/MylesBorins) - - **Myles Borins** <> (he/him) * [nebrius](https://github.com/nebrius) - **Bryan Hughes** <> * [ofrobots](https://github.com/ofrobots) - @@ -249,16 +260,12 @@ For information about the governance of the Node.js project, see **Alexis Campailla** <> * [piscisaureus](https://github.com/piscisaureus) - **Bert Belder** <> -* [rvagg](https://github.com/rvagg) - - **Rod Vagg** <> * [sam-github](https://github.com/sam-github) - **Sam Roberts** <> * [shigeki](https://github.com/shigeki) - **Shigeki Ohtsu** <> (he/him) * [thefourtheye](https://github.com/thefourtheye) - **Sakthipriyan Vairamani** <> (he/him) -* [TimothyGu](https://github.com/TimothyGu) - - **Tiancheng "Timothy" Gu** <> (he/him) * [trevnorris](https://github.com/trevnorris) - **Trevor Norris** <> @@ -801,8 +808,6 @@ releases on a rotation basis as outlined in the * Datadog * [bengl](https://github.com/bengl) - **Bryan English** <> (he/him) - * [vdeturckheim](https://github.com/vdeturckheim) - - **Vladimir de Turckheim** <> (he/him) * NearForm * [RafaelGSS](https://github.com/RafaelGSS) - **Rafael Gonzaga** <> (he/him) diff --git a/SECURITY.md b/SECURITY.md index 450335951b64cc..02c9f83aa32c1a 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -31,11 +31,12 @@ maintainers. Here is the security disclosure policy for Node.js * The security report is received and is assigned a primary handler. This - person will coordinate the fix and release process. The problem is confirmed - and a list of all affected versions is determined. Code is audited to find - any potential similar problems. Fixes are prepared for all releases which are - still under maintenance. These fixes are not committed to the public - repository but rather held locally pending the announcement. + person will coordinate the fix and release process. The problem is validated + against all supported Node.js versions. Once confirmed, a list of all affected + versions is determined. Code is audited to find any potential similar + problems. Fixes are prepared for all supported releases. + These fixes are not committed to the public repository but rather held locally + pending the announcement. * A suggested embargo date for this vulnerability is chosen and a CVE (Common Vulnerabilities and Exposures (CVE®)) is requested for the vulnerability. @@ -116,7 +117,8 @@ lead to a loss of confidentiality, integrity, or availability. npm registry. The code run inherits all the privileges of the execution user. 4. Inputs provided to it by the code it is asked to run, as it is the - responsibility of the application to perform the required input validations. + responsibility of the application to perform the required input validations, + e.g. the input to `JSON.parse()`. 5. Any connection used for inspector (debugger protocol) regardless of being opened by command line options or Node.js APIs, and regardless of the remote end being on the local machine or remote. @@ -124,7 +126,8 @@ lead to a loss of confidentiality, integrity, or availability. See . Any unexpected behavior from the data manipulation from Node.js Internal -functions are considered a vulnerability. +functions may be considered a vulnerability if they are expoitable via +untrusted resources. In addition to addressing vulnerabilities based on the above, the project works to avoid APIs and internal implementations that make it "easy" for application @@ -193,7 +196,7 @@ the community they pose. * If Node.js is asked to connect to a remote site and return an artifact, it is not considered a vulnerability if the size of - that artifact is large enough to impact performance and or + that artifact is large enough to impact performance or cause the runtime to run out of resources. ## Receiving security updates diff --git a/benchmark/_http-benchmarkers.js b/benchmark/_http-benchmarkers.js index 3c8997e73a8d2d..ae5429fa721750 100644 --- a/benchmark/_http-benchmarkers.js +++ b/benchmark/_http-benchmarkers.js @@ -5,7 +5,7 @@ const path = require('path'); const fs = require('fs'); const requirementsURL = - 'https://github.com/nodejs/node/blob/HEAD/benchmark/writing-and-running-benchmarks.md#http-benchmark-requirements'; + 'https://github.com/nodejs/node/blob/HEAD/doc/contributing/writing-and-running-benchmarks.md#http-benchmark-requirements'; // The port used by servers and wrk exports.PORT = Number(process.env.PORT) || 12346; diff --git a/benchmark/permission/permission-fs-deny.js b/benchmark/permission/permission-fs-deny.js deleted file mode 100644 index 29bbeb27dc7c97..00000000000000 --- a/benchmark/permission/permission-fs-deny.js +++ /dev/null @@ -1,19 +0,0 @@ -'use strict'; -const common = require('../common.js'); - -const configs = { - n: [1e5], - concurrent: [1, 10], -}; - -const options = { flags: ['--experimental-permission'] }; - -const bench = common.createBenchmark(main, configs, options); - -async function main(conf) { - bench.start(); - for (let i = 0; i < conf.n; i++) { - process.permission.deny('fs.read', ['/home/example-file-' + i]); - } - bench.end(conf.n); -} diff --git a/benchmark/permission/permission-fs-is-granted.js b/benchmark/permission/permission-fs-is-granted.js deleted file mode 100644 index 062ba1944578f4..00000000000000 --- a/benchmark/permission/permission-fs-is-granted.js +++ /dev/null @@ -1,50 +0,0 @@ -'use strict'; -const common = require('../common.js'); -const fs = require('fs/promises'); -const path = require('path'); - -const configs = { - n: [1e5], - concurrent: [1, 10], -}; - -const rootPath = path.resolve(__dirname, '../../..'); - -const options = { - flags: [ - '--experimental-permission', - `--allow-fs-read=${rootPath}`, - ], -}; - -const bench = common.createBenchmark(main, configs, options); - -const recursivelyDenyFiles = async (dir) => { - const files = await fs.readdir(dir, { withFileTypes: true }); - for (const file of files) { - if (file.isDirectory()) { - await recursivelyDenyFiles(path.join(dir, file.name)); - } else if (file.isFile()) { - process.permission.deny('fs.read', [path.join(dir, file.name)]); - } - } -}; - -async function main(conf) { - const benchmarkDir = path.join(__dirname, '../..'); - // Get all the benchmark files and deny access to it - await recursivelyDenyFiles(benchmarkDir); - - bench.start(); - - for (let i = 0; i < conf.n; i++) { - // Valid file in a sequence of denied files - process.permission.has('fs.read', benchmarkDir + '/valid-file'); - // Denied file - process.permission.has('fs.read', __filename); - // Valid file a granted directory - process.permission.has('fs.read', '/tmp/example'); - } - - bench.end(conf.n); -} diff --git a/benchmark/permission/permission-fs-read.js b/benchmark/permission/permission-fs-read.js new file mode 100644 index 00000000000000..bd81814e55861a --- /dev/null +++ b/benchmark/permission/permission-fs-read.js @@ -0,0 +1,38 @@ +'use strict'; +const common = require('../common.js'); +const path = require('path'); + +const configs = { + n: [1e5], + concurrent: [1, 10], +}; + +const rootPath = path.resolve(__dirname, '../../..'); + +const options = { + flags: [ + '--experimental-permission', + `--allow-fs-read=${rootPath}`, + ], +}; + +const bench = common.createBenchmark(main, configs, options); + +// This is a naive benchmark and might not demonstrate real-world use cases. +// New benchmarks will be created once the permission model config is available +// through a config file. +async function main(conf) { + const benchmarkDir = path.join(__dirname, '../..'); + bench.start(); + + for (let i = 0; i < conf.n; i++) { + // Valid file in a sequence of denied files + process.permission.has('fs.read', benchmarkDir + '/valid-file'); + // Denied file + process.permission.has('fs.read', __filename); + // Valid file a granted directory + process.permission.has('fs.read', '/tmp/example'); + } + + bench.end(conf.n); +} diff --git a/benchmark/url/whatwgurl-canParse.js b/benchmark/url/whatwgurl-canParse.js new file mode 100644 index 00000000000000..3896d78578f2e3 --- /dev/null +++ b/benchmark/url/whatwgurl-canParse.js @@ -0,0 +1,14 @@ +'use strict'; +const common = require('../common.js'); + +const bench = common.createBenchmark(main, { + type: Object.keys(common.urls), + n: [1e6], +}); + +function main({ type, n }) { + bench.start(); + for (let i = 0; i < n; i += 1) + URL.canParse(common.urls[type]); + bench.end(n); +} diff --git a/codecov.yml b/codecov.yml index 462fb1e79f8b5b..80ee32b360abce 100644 --- a/codecov.yml +++ b/codecov.yml @@ -8,6 +8,12 @@ comment: false # require_changes: true codecov: + branch: main notify: # Wait for all coverage builds: after_n_builds: 2 + +coverage: + status: + project: off + patch: off diff --git a/common.gypi b/common.gypi index 4e645cf50671d4..0dcf428002c4c7 100644 --- a/common.gypi +++ b/common.gypi @@ -36,7 +36,7 @@ # Reset this number to 0 on major V8 upgrades. # Increment by one for each non-official patch applied to deps/v8. - 'v8_embedder_string': '-node.10', + 'v8_embedder_string': '-node.3', ##### V8 defaults for Node.js ##### diff --git a/configure.py b/configure.py index 1e3a59dd711bbb..a0deed59c1f3df 100755 --- a/configure.py +++ b/configure.py @@ -5,7 +5,6 @@ import errno import argparse import os -import pipes import pprint import re import shlex @@ -2074,7 +2073,7 @@ def make_bin_override(): pprint.pformat(output, indent=2, width=1024) + '\n') write('config.status', '#!/bin/sh\nset -x\nexec ./configure ' + - ' '.join([pipes.quote(arg) for arg in original_argv]) + '\n') + ' '.join([shlex.quote(arg) for arg in original_argv]) + '\n') os.chmod('config.status', 0o775) diff --git a/deps/ada/ada.cpp b/deps/ada/ada.cpp index 8b2cdd38ad0bb1..197cb8ed800f98 100644 --- a/deps/ada/ada.cpp +++ b/deps/ada/ada.cpp @@ -1,2760 +1,14713 @@ -/* auto-generated on 2023-02-26 15:07:41 -0500. Do not edit! */ -// dofile: invoked with prepath=/Users/dlemire/CVS/github/ada/src, filename=ada.cpp +/* auto-generated on 2023-03-30 17:00:48 -0400. Do not edit! */ /* begin file src/ada.cpp */ #include "ada.h" -// dofile: invoked with prepath=/Users/dlemire/CVS/github/ada/src, filename=checkers.cpp /* begin file src/checkers.cpp */ #include namespace ada::checkers { - ada_really_inline ada_constexpr bool is_ipv4(std::string_view view) noexcept { - size_t last_dot = view.rfind('.'); - if(last_dot == view.size() - 1) { - view.remove_suffix(1); - last_dot = view.rfind('.'); - } - std::string_view number = (last_dot == std::string_view::npos) ? view : view.substr(last_dot+1); - if(number.empty()) { return false; } - /** Optimization opportunity: we have basically identified the last number of the - ipv4 if we return true here. We might as well parse it and have at least one - number parsed when we get to parse_ipv4. */ - if(std::all_of(number.begin(), number.end(), ada::checkers::is_digit)) { return true; } - return (checkers::has_hex_prefix(number) && std::all_of(number.begin()+2, number.end(), ada::unicode::is_lowercase_hex)); - } - - - // for use with path_signature, we include all characters that need percent encoding. - static constexpr uint8_t path_signature_table[256] = { - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; - static_assert(path_signature_table[uint8_t('?')] == 1); - static_assert(path_signature_table[uint8_t('`')] == 1); - static_assert(path_signature_table[uint8_t('{')] == 1); - static_assert(path_signature_table[uint8_t('}')] == 1); - // - static_assert(path_signature_table[uint8_t(' ')] == 1); - static_assert(path_signature_table[uint8_t('?')] == 1); - static_assert(path_signature_table[uint8_t('"')] == 1); - static_assert(path_signature_table[uint8_t('#')] == 1); - static_assert(path_signature_table[uint8_t('<')] == 1); - static_assert(path_signature_table[uint8_t('>')] == 1); - // - static_assert(path_signature_table[0] == 1); - static_assert(path_signature_table[31] == 1); - static_assert(path_signature_table[127] == 1); - static_assert(path_signature_table[128] == 1); - static_assert(path_signature_table[255] == 1); - - ada_really_inline constexpr uint8_t path_signature(std::string_view input) noexcept { - // The path percent-encode set is the query percent-encode set and U+003F (?), U+0060 (`), U+007B ({), and U+007D (}). - // The query percent-encode set is the C0 control percent-encode set and U+0020 SPACE, U+0022 ("), U+0023 (#), U+003C (<), and U+003E (>). - // The C0 control percent-encode set are the C0 controls and all code points greater than U+007E (~). - size_t i = 0; - uint8_t accumulator{}; - for (; i + 7 < input.size(); i += 8) { - accumulator |= uint8_t(path_signature_table[uint8_t(input[i])] | - path_signature_table[uint8_t(input[i + 1])] | - path_signature_table[uint8_t(input[i + 2])] | - path_signature_table[uint8_t(input[i + 3])] | - path_signature_table[uint8_t(input[i + 4])] | - path_signature_table[uint8_t(input[i + 5])] | - path_signature_table[uint8_t(input[i + 6])] | - path_signature_table[uint8_t(input[i + 7])]); - } - for (; i < input.size(); i++) { - accumulator |= uint8_t(path_signature_table[uint8_t(input[i])]); - } - return accumulator; +ada_really_inline ada_constexpr bool is_ipv4(std::string_view view) noexcept { + size_t last_dot = view.rfind('.'); + if (last_dot == view.size() - 1) { + view.remove_suffix(1); + last_dot = view.rfind('.'); } - - - ada_really_inline constexpr bool verify_dns_length(std::string_view input) noexcept { - if(input.back() == '.') { - if(input.size() > 254) return false; - } else if (input.size() > 253) return false; - - size_t start = 0; - while (start < input.size()) { - auto dot_location = input.find('.', start); - // If not found, it's likely the end of the domain - if(dot_location == std::string_view::npos) dot_location = input.size(); - - auto label_size = dot_location - start; - if (label_size > 63 || label_size == 0) return false; - - start = dot_location + 1; - } - + std::string_view number = + (last_dot == std::string_view::npos) ? view : view.substr(last_dot + 1); + if (number.empty()) { + return false; + } + /** Optimization opportunity: we have basically identified the last number of + the ipv4 if we return true here. We might as well parse it and have at + least one number parsed when we get to parse_ipv4. */ + if (std::all_of(number.begin(), number.end(), ada::checkers::is_digit)) { return true; } -} // namespace ada::checkers -/* end file src/checkers.cpp */ -// dofile: invoked with prepath=/Users/dlemire/CVS/github/ada/src, filename=unicode.cpp -/* begin file src/unicode.cpp */ - -#include -#if ADA_HAS_ICU -// We are good. -#else - -#if defined(_WIN32) && ADA_WINDOWS_TO_ASCII_FALLBACK - -#ifndef __wtypes_h__ -#include -#endif // __wtypes_h__ - -#ifndef __WINDEF_ -#include -#endif // __WINDEF_ - -#include -#endif //defined(_WIN32) && ADA_WINDOWS_TO_ASCII_FALLBACK - -#endif // ADA_HAS_ICU - -namespace ada::unicode { - - constexpr bool to_lower_ascii(char * input, size_t length) noexcept { - auto broadcast = [](uint8_t v) -> uint64_t { return 0x101010101010101 * v; }; - uint64_t broadcast_80 = broadcast(0x80); - uint64_t broadcast_Ap = broadcast(128 - 'A'); - uint64_t broadcast_Zp = broadcast(128 - 'Z'); - uint64_t non_ascii = 0; - size_t i = 0; - - for (; i + 7 < length; i += 8) { - uint64_t word{}; - memcpy(&word, input + i, sizeof(word)); - non_ascii |= (word & broadcast_80); - word ^= (((word+broadcast_Ap)^(word+broadcast_Zp))&broadcast_80)>>2; - memcpy(input + i, &word, sizeof(word)); - } - if (i < length) { - uint64_t word{}; - memcpy(&word, input + i, length - i); - non_ascii |= (word & broadcast_80); - word ^= (((word+broadcast_Ap)^(word+broadcast_Zp))&broadcast_80)>>2; - memcpy(input + i, &word, length - i); - } - return non_ascii == 0; - } - - ada_really_inline constexpr bool has_tabs_or_newline(std::string_view user_input) noexcept { - auto has_zero_byte = [](uint64_t v) { - return ((v - 0x0101010101010101) & ~(v)&0x8080808080808080); - }; - auto broadcast = [](uint8_t v) -> uint64_t { return 0x101010101010101 * v; }; - size_t i = 0; - uint64_t mask1 = broadcast('\r'); - uint64_t mask2 = broadcast('\n'); - uint64_t mask3 = broadcast('\t'); - uint64_t running{0}; - for (; i + 7 < user_input.size(); i += 8) { - uint64_t word{}; - memcpy(&word, user_input.data() + i, sizeof(word)); - uint64_t xor1 = word ^ mask1; - uint64_t xor2 = word ^ mask2; - uint64_t xor3 = word ^ mask3; - running |= has_zero_byte(xor1) | has_zero_byte(xor2) | has_zero_byte(xor3); - } - if (i < user_input.size()) { - uint64_t word{}; - memcpy(&word, user_input.data() + i, user_input.size() - i); - uint64_t xor1 = word ^ mask1; - uint64_t xor2 = word ^ mask2; - uint64_t xor3 = word ^ mask3; - running |= has_zero_byte(xor1) | has_zero_byte(xor2) | has_zero_byte(xor3); - } - return running; - } - - // A forbidden host code point is U+0000 NULL, U+0009 TAB, U+000A LF, U+000D CR, U+0020 SPACE, U+0023 (#), - // U+002F (/), U+003A (:), U+003C (<), U+003E (>), U+003F (?), U+0040 (@), U+005B ([), U+005C (\), U+005D (]), - // U+005E (^), or U+007C (|). - constexpr static bool is_forbidden_host_code_point_table[] = { - 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - static_assert(sizeof(is_forbidden_host_code_point_table) == 256); - - ada_really_inline constexpr bool is_forbidden_host_code_point(const char c) noexcept { - return is_forbidden_host_code_point_table[uint8_t(c)]; - } - - static_assert(unicode::is_forbidden_host_code_point('\0')); - static_assert(unicode::is_forbidden_host_code_point('\t')); - static_assert(unicode::is_forbidden_host_code_point('\n')); - static_assert(unicode::is_forbidden_host_code_point('\r')); - static_assert(unicode::is_forbidden_host_code_point(' ')); - static_assert(unicode::is_forbidden_host_code_point('#')); - static_assert(unicode::is_forbidden_host_code_point('/')); - static_assert(unicode::is_forbidden_host_code_point(':')); - static_assert(unicode::is_forbidden_host_code_point('?')); - static_assert(unicode::is_forbidden_host_code_point('@')); - static_assert(unicode::is_forbidden_host_code_point('[')); - static_assert(unicode::is_forbidden_host_code_point('?')); - static_assert(unicode::is_forbidden_host_code_point('<')); - static_assert(unicode::is_forbidden_host_code_point('>')); - static_assert(unicode::is_forbidden_host_code_point('\\')); - static_assert(unicode::is_forbidden_host_code_point(']')); - static_assert(unicode::is_forbidden_host_code_point('^')); - static_assert(unicode::is_forbidden_host_code_point('|')); + return (checkers::has_hex_prefix(number) && + std::all_of(number.begin() + 2, number.end(), + ada::unicode::is_lowercase_hex)); +} -constexpr static uint8_t is_forbidden_domain_code_point_table[] = { +// for use with path_signature, we include all characters that need percent +// encoding. +static constexpr uint8_t path_signature_table[256] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; - - static_assert(sizeof(is_forbidden_domain_code_point_table) == 256); - - ada_really_inline constexpr bool is_forbidden_domain_code_point(const char c) noexcept { - return is_forbidden_domain_code_point_table[uint8_t(c)]; - } - - ada_really_inline constexpr bool contains_forbidden_domain_code_point(char * input, size_t length) noexcept { - size_t i = 0; - uint8_t accumulator{}; - for(; i + 4 <= length; i+=4) { - accumulator |= is_forbidden_domain_code_point_table[uint8_t(input[i])]; - accumulator |= is_forbidden_domain_code_point_table[uint8_t(input[i+1])]; - accumulator |= is_forbidden_domain_code_point_table[uint8_t(input[i+2])]; - accumulator |= is_forbidden_domain_code_point_table[uint8_t(input[i+3])]; - } - for(; i < length; i++) { - accumulator |= is_forbidden_domain_code_point_table[uint8_t(input[i])]; - } - return accumulator; - } - - static_assert(unicode::is_forbidden_domain_code_point('%')); - static_assert(unicode::is_forbidden_domain_code_point('\x7f')); - static_assert(unicode::is_forbidden_domain_code_point('\0')); - static_assert(unicode::is_forbidden_domain_code_point('\t')); - static_assert(unicode::is_forbidden_domain_code_point('\n')); - static_assert(unicode::is_forbidden_domain_code_point('\r')); - static_assert(unicode::is_forbidden_domain_code_point(' ')); - static_assert(unicode::is_forbidden_domain_code_point('#')); - static_assert(unicode::is_forbidden_domain_code_point('/')); - static_assert(unicode::is_forbidden_domain_code_point(':')); - static_assert(unicode::is_forbidden_domain_code_point('?')); - static_assert(unicode::is_forbidden_domain_code_point('@')); - static_assert(unicode::is_forbidden_domain_code_point('[')); - static_assert(unicode::is_forbidden_domain_code_point('?')); - static_assert(unicode::is_forbidden_domain_code_point('<')); - static_assert(unicode::is_forbidden_domain_code_point('>')); - static_assert(unicode::is_forbidden_domain_code_point('\\')); - static_assert(unicode::is_forbidden_domain_code_point(']')); - static_assert(unicode::is_forbidden_domain_code_point('^')); - static_assert(unicode::is_forbidden_domain_code_point('|')); - - constexpr static bool is_alnum_plus_table[] = { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - - static_assert(sizeof(is_alnum_plus_table) == 256); - - ada_really_inline constexpr bool is_alnum_plus(const char c) noexcept { - return is_alnum_plus_table[uint8_t(c)]; - // A table is almost surely much faster than the - // following under most compilers: return - // return (std::isalnum(c) || c == '+' || c == '-' || c == '.'); - } - static_assert(unicode::is_alnum_plus('+')); - static_assert(unicode::is_alnum_plus('-')); - static_assert(unicode::is_alnum_plus('.')); - static_assert(unicode::is_alnum_plus('0')); - static_assert(unicode::is_alnum_plus('1')); - static_assert(unicode::is_alnum_plus('a')); - static_assert(unicode::is_alnum_plus('b')); - - ada_really_inline constexpr bool is_ascii_hex_digit(const char c) noexcept { - return (c >= '0' && c <= '9') || (c >= 'A' && c <= 'F') || (c >= 'a' && c<= 'f'); - } - - ada_really_inline constexpr bool is_c0_control_or_space(const char c) noexcept { - return (unsigned char) c <= ' '; - } - - ada_really_inline constexpr bool is_ascii_tab_or_newline(const char c) noexcept { - return c == '\t' || c == '\n' || c == '\r'; - } - - constexpr std::string_view table_is_double_dot_path_segment[] = {"..", "%2e.", ".%2e", "%2e%2e"}; - - ada_really_inline ada_constexpr bool is_double_dot_path_segment(std::string_view input) noexcept { - // This will catch most cases: - // The length must be 2,4 or 6. - // We divide by two and require - // that the result be between 1 and 3 inclusively. - uint64_t half_length = uint64_t(input.size())/2; - if(half_length - 1 > 2) { return false; } - // We have a string of length 2, 4 or 6. - // We now check the first character: - if((input[0] != '.') && (input[0] != '%')) { return false; } - // We are unlikely the get beyond this point. - int hash_value = (input.size() + (unsigned)(input[0])) & 3; - const std::string_view target = table_is_double_dot_path_segment[hash_value]; - if(target.size() != input.size()) { return false; } - // We almost never get here. - // Optimizing the rest is relatively unimportant. - auto prefix_equal_unsafe = [](std::string_view a, std::string_view b) { - uint16_t A, B; - memcpy(&A,a.data(), sizeof(A)); - memcpy(&B,b.data(), sizeof(B)); - return A == B; - }; - if(!prefix_equal_unsafe(input,target)) { return false; } - for(size_t i = 2; i < input.size(); i++) { - char c = input[i]; - if((uint8_t((c|0x20) - 0x61) <= 25 ? (c|0x20) : c) != target[i]) { return false; } - } - return true; - // The above code might be a bit better than the code below. Compilers - // are not stupid and may use the fact that these strings have length 2,4 and 6 - // and other tricks. - //return input == ".." || - // input == ".%2e" || input == ".%2E" || - // input == "%2e." || input == "%2E." || - // input == "%2e%2e" || input == "%2E%2E" || input == "%2E%2e" || input == "%2e%2E"; - } - - ada_really_inline constexpr bool is_single_dot_path_segment(std::string_view input) noexcept { - return input == "." || input == "%2e" || input == "%2E"; - } - - ada_really_inline constexpr bool is_lowercase_hex(const char c) noexcept { - return (c >= '0' && c <= '9') || (c >= 'a' && c<= 'f'); - } - - unsigned constexpr convert_hex_to_binary(const char c) noexcept { - // this code can be optimized. - if (c <= '9') { return c - '0'; } - char del = c >= 'a' ? 'a' : 'A'; - return 10 + (c - del); - } - - std::string percent_decode(const std::string_view input, size_t first_percent) { - // next line is for safety only, we expect users to avoid calling percent_decode - // when first_percent is outside the range. - if(first_percent == std::string_view::npos) { return std::string(input); } - std::string dest(input.substr(0, first_percent)); - dest.reserve(input.length()); - const char* pointer = input.data() + first_percent; - const char* end = input.data() + input.size(); - // Optimization opportunity: if the following code gets - // called often, it can be optimized quite a bit. - while (pointer < end) { - const char ch = pointer[0]; - size_t remaining = end - pointer - 1; - if (ch != '%' || remaining < 2 || - (//ch == '%' && // It is unnecessary to check that ch == '%'. - (!is_ascii_hex_digit(pointer[1]) || - !is_ascii_hex_digit(pointer[2])))) { - dest += ch; - pointer++; - continue; - } else { - unsigned a = convert_hex_to_binary(pointer[1]); - unsigned b = convert_hex_to_binary(pointer[2]); - char c = static_cast(a * 16 + b); - dest += c; - pointer += 3; - } - } - return dest; +static_assert(path_signature_table[uint8_t('?')] == 1); +static_assert(path_signature_table[uint8_t('`')] == 1); +static_assert(path_signature_table[uint8_t('{')] == 1); +static_assert(path_signature_table[uint8_t('}')] == 1); +// +static_assert(path_signature_table[uint8_t(' ')] == 1); +static_assert(path_signature_table[uint8_t('?')] == 1); +static_assert(path_signature_table[uint8_t('"')] == 1); +static_assert(path_signature_table[uint8_t('#')] == 1); +static_assert(path_signature_table[uint8_t('<')] == 1); +static_assert(path_signature_table[uint8_t('>')] == 1); +static_assert(path_signature_table[uint8_t('\\')] == 2); +static_assert(path_signature_table[uint8_t('.')] == 4); +static_assert(path_signature_table[uint8_t('%')] == 8); + +// +static_assert(path_signature_table[0] == 1); +static_assert(path_signature_table[31] == 1); +static_assert(path_signature_table[127] == 1); +static_assert(path_signature_table[128] == 1); +static_assert(path_signature_table[255] == 1); + +ada_really_inline constexpr uint8_t path_signature( + std::string_view input) noexcept { + // The path percent-encode set is the query percent-encode set and U+003F (?), + // U+0060 (`), U+007B ({), and U+007D (}). The query percent-encode set is the + // C0 control percent-encode set and U+0020 SPACE, U+0022 ("), U+0023 (#), + // U+003C (<), and U+003E (>). The C0 control percent-encode set are the C0 + // controls and all code points greater than U+007E (~). + size_t i = 0; + uint8_t accumulator{}; + for (; i + 7 < input.size(); i += 8) { + accumulator |= uint8_t(path_signature_table[uint8_t(input[i])] | + path_signature_table[uint8_t(input[i + 1])] | + path_signature_table[uint8_t(input[i + 2])] | + path_signature_table[uint8_t(input[i + 3])] | + path_signature_table[uint8_t(input[i + 4])] | + path_signature_table[uint8_t(input[i + 5])] | + path_signature_table[uint8_t(input[i + 6])] | + path_signature_table[uint8_t(input[i + 7])]); } + for (; i < input.size(); i++) { + accumulator |= uint8_t(path_signature_table[uint8_t(input[i])]); + } + return accumulator; +} - std::string percent_encode(const std::string_view input, const uint8_t character_set[]) { - auto pointer = std::find_if(input.begin(), input.end(), [character_set](const char c) { - return character_sets::bit_at(character_set, c); - }); - // Optimization: Don't iterate if percent encode is not required - if (pointer == input.end()) { return std::string(input); } +ada_really_inline constexpr bool verify_dns_length( + std::string_view input) noexcept { + if (input.back() == '.') { + if (input.size() > 254) return false; + } else if (input.size() > 253) + return false; - std::string result(input.substr(0,std::distance(input.begin(), pointer))); - result.reserve(input.length()); // in the worst case, percent encoding might produce 3 characters. + size_t start = 0; + while (start < input.size()) { + auto dot_location = input.find('.', start); + // If not found, it's likely the end of the domain + if (dot_location == std::string_view::npos) dot_location = input.size(); - for (;pointer != input.end(); pointer++) { - if (character_sets::bit_at(character_set, *pointer)) { - result.append(character_sets::hex + uint8_t(*pointer) * 4, 3); - } else { - result += *pointer; - } - } + auto label_size = dot_location - start; + if (label_size > 63 || label_size == 0) return false; - return result; + start = dot_location + 1; } + return true; +} +} // namespace ada::checkers +/* end file src/checkers.cpp */ +/* begin file src/unicode.cpp */ - bool percent_encode(const std::string_view input, const uint8_t character_set[], std::string &out) { - auto pointer = std::find_if(input.begin(), input.end(), [character_set](const char c) { - return character_sets::bit_at(character_set, c); - }); - // Optimization: Don't iterate if percent encode is not required - if (pointer == input.end()) { return false; } - out.clear(); - out.append(input.data(), std::distance(input.begin(), pointer)); +ADA_PUSH_DISABLE_ALL_WARNINGS +/* begin file src/ada_idna.cpp */ +/* auto-generated on 2023-03-28 11:03:13 -0400. Do not edit! */ +/* begin file src/idna.cpp */ +/* begin file src/unicode_transcoding.cpp */ - for (;pointer != input.end(); pointer++) { - if (character_sets::bit_at(character_set, *pointer)) { - out.append(character_sets::hex + uint8_t(*pointer) * 4, 3); - } else { - out += *pointer; +#include +#include +namespace ada::idna { + +size_t utf8_to_utf32(const char* buf, size_t len, char32_t* utf32_output) { + const uint8_t* data = reinterpret_cast(buf); + size_t pos = 0; + char32_t* start{utf32_output}; + while (pos < len) { + // try to convert the next block of 16 ASCII bytes + if (pos + 16 <= len) { // if it is safe to read 16 more + // bytes, check that they are ascii + uint64_t v1; + std::memcpy(&v1, data + pos, sizeof(uint64_t)); + uint64_t v2; + std::memcpy(&v2, data + pos + sizeof(uint64_t), sizeof(uint64_t)); + uint64_t v{v1 | v2}; + if ((v & 0x8080808080808080) == 0) { + size_t final_pos = pos + 16; + while (pos < final_pos) { + *utf32_output++ = char32_t(buf[pos]); + pos++; + } + continue; } } - return true; - } + uint8_t leading_byte = data[pos]; // leading byte + if (leading_byte < 0b10000000) { + // converting one ASCII byte !!! + *utf32_output++ = char32_t(leading_byte); + pos++; + } else if ((leading_byte & 0b11100000) == 0b11000000) { + // We have a two-byte UTF-8 + if (pos + 1 >= len) { + return 0; + } // minimal bound checking + if ((data[pos + 1] & 0b11000000) != 0b10000000) { + return 0; + } + // range check + uint32_t code_point = + (leading_byte & 0b00011111) << 6 | (data[pos + 1] & 0b00111111); + if (code_point < 0x80 || 0x7ff < code_point) { + return 0; + } + *utf32_output++ = char32_t(code_point); + pos += 2; + } else if ((leading_byte & 0b11110000) == 0b11100000) { + // We have a three-byte UTF-8 + if (pos + 2 >= len) { + return 0; + } // minimal bound checking + + if ((data[pos + 1] & 0b11000000) != 0b10000000) { + return 0; + } + if ((data[pos + 2] & 0b11000000) != 0b10000000) { + return 0; + } + // range check + uint32_t code_point = (leading_byte & 0b00001111) << 12 | + (data[pos + 1] & 0b00111111) << 6 | + (data[pos + 2] & 0b00111111); + if (code_point < 0x800 || 0xffff < code_point || + (0xd7ff < code_point && code_point < 0xe000)) { + return 0; + } + *utf32_output++ = char32_t(code_point); + pos += 3; + } else if ((leading_byte & 0b11111000) == 0b11110000) { // 0b11110000 + // we have a 4-byte UTF-8 word. + if (pos + 3 >= len) { + return 0; + } // minimal bound checking + if ((data[pos + 1] & 0b11000000) != 0b10000000) { + return 0; + } + if ((data[pos + 2] & 0b11000000) != 0b10000000) { + return 0; + } + if ((data[pos + 3] & 0b11000000) != 0b10000000) { + return 0; + } - bool to_ascii(std::optional& out, const std::string_view plain, const bool be_strict, size_t first_percent) { - std::string percent_decoded_buffer; - std::string_view input = plain; - if(first_percent != std::string_view::npos) { - percent_decoded_buffer = unicode::percent_decode(plain, first_percent); - input = percent_decoded_buffer; + // range check + uint32_t code_point = (leading_byte & 0b00000111) << 18 | + (data[pos + 1] & 0b00111111) << 12 | + (data[pos + 2] & 0b00111111) << 6 | + (data[pos + 3] & 0b00111111); + if (code_point <= 0xffff || 0x10ffff < code_point) { + return 0; + } + *utf32_output++ = char32_t(code_point); + pos += 4; + } else { + return 0; } -#if ADA_HAS_ICU - out = std::string(255, 0); - - UErrorCode status = U_ZERO_ERROR; - uint32_t options = UIDNA_CHECK_BIDI | UIDNA_CHECK_CONTEXTJ | UIDNA_NONTRANSITIONAL_TO_ASCII; + } + return utf32_output - start; +} - if (be_strict) { - options |= UIDNA_USE_STD3_RULES; +size_t utf8_length_from_utf32(const char32_t* buf, size_t len) { + // We are not BOM aware. + const uint32_t* p = reinterpret_cast(buf); + size_t counter{0}; + for (size_t i = 0; i < len; i++) { + /** ASCII **/ + if (p[i] <= 0x7F) { + counter++; } - - UIDNA* uidna = uidna_openUTS46(options, &status); - if (U_FAILURE(status)) { - return false; + /** two-byte **/ + else if (p[i] <= 0x7FF) { + counter += 2; } - - UIDNAInfo info = UIDNA_INFO_INITIALIZER; - // RFC 1035 section 2.3.4. - // The domain name must be at most 255 octets. - // It cannot contain a label longer than 63 octets. - // Thus we should never need more than 255 octets, if we - // do the domain name is in error. - int32_t length = uidna_nameToASCII_UTF8(uidna, - input.data(), - int32_t(input.length()), - out.value().data(), 255, - &info, - &status); - - if (status == U_BUFFER_OVERFLOW_ERROR) { - status = U_ZERO_ERROR; - out.value().resize(length); - // When be_strict is true, this should not be allowed! - length = uidna_nameToASCII_UTF8(uidna, - input.data(), - int32_t(input.length()), - out.value().data(), length, - &info, - &status); - } - - // A label contains hyphen-minus ('-') in the third and fourth positions. - info.errors &= ~UIDNA_ERROR_HYPHEN_3_4; - // A label starts with a hyphen-minus ('-'). - info.errors &= ~UIDNA_ERROR_LEADING_HYPHEN; - // A label ends with a hyphen-minus ('-'). - info.errors &= ~UIDNA_ERROR_TRAILING_HYPHEN; - - if (!be_strict) { // This seems to violate RFC 1035 section 2.3.4. - // A non-final domain name label (or the whole domain name) is empty. - info.errors &= ~UIDNA_ERROR_EMPTY_LABEL; - // A domain name label is longer than 63 bytes. - info.errors &= ~UIDNA_ERROR_LABEL_TOO_LONG; - // A domain name is longer than 255 bytes in its storage form. - info.errors &= ~UIDNA_ERROR_DOMAIN_NAME_TOO_LONG; - } - - uidna_close(uidna); - - if (U_FAILURE(status) || info.errors != 0 || length == 0) { - out = std::nullopt; - return false; + /** three-byte **/ + else if (p[i] <= 0xFFFF) { + counter += 3; } - out.value().resize(length); // we possibly want to call :shrink_to_fit otherwise we use 255 bytes. - out.value().shrink_to_fit(); -#elif defined(_WIN32) && ADA_WINDOWS_TO_ASCII_FALLBACK - (void)be_strict; // unused. - // Fallback on the system if ICU is not available. - // Windows function assumes UTF-16. - std::unique_ptr buffer(new char16_t[input.size()]); - auto convert = [](const char* buf, size_t len, char16_t* utf16_output) { - const uint8_t *data = reinterpret_cast(buf); - size_t pos = 0; - char16_t* start{utf16_output}; - while (pos < len) { - // try to convert the next block of 16 ASCII bytes - if (pos + 16 <= len) { // if it is safe to read 16 more bytes, check that they are ascii - uint64_t v1; - ::memcpy(&v1, data + pos, sizeof(uint64_t)); - uint64_t v2; - ::memcpy(&v2, data + pos + sizeof(uint64_t), sizeof(uint64_t)); - uint64_t v{v1 | v2}; - if ((v & 0x8080808080808080) == 0) { - size_t final_pos = pos + 16; - while(pos < final_pos) { - *utf16_output++ = char16_t(buf[pos]); - pos++; - } - continue; - } - } - uint8_t leading_byte = data[pos]; // leading byte - if (leading_byte < 0b10000000) { - // converting one ASCII byte !!! - *utf16_output++ = char16_t(leading_byte); - pos++; - } else if ((leading_byte & 0b11100000) == 0b11000000) { - // We have a two-byte UTF-8, it should become - // a single UTF-16 word. - if(pos + 1 >= len) { return 0; } // minimal bound checking - if ((data[pos + 1] & 0b11000000) != 0b10000000) { return 0; } - // range check - uint32_t code_point = (leading_byte & 0b00011111) << 6 | (data[pos + 1] & 0b00111111); - if (code_point < 0x80 || 0x7ff < code_point) { return 0; } - *utf16_output++ = char16_t(code_point); - pos += 2; - } else if ((leading_byte & 0b11110000) == 0b11100000) { - // We have a three-byte UTF-8, it should become - // a single UTF-16 word. - if(pos + 2 >= len) { return 0; } // minimal bound checking - - if ((data[pos + 1] & 0b11000000) != 0b10000000) { return 0; } - if ((data[pos + 2] & 0b11000000) != 0b10000000) { return 0; } - // range check - uint32_t code_point = (leading_byte & 0b00001111) << 12 | - (data[pos + 1] & 0b00111111) << 6 | - (data[pos + 2] & 0b00111111); - if (code_point < 0x800 || 0xffff < code_point || - (0xd7ff < code_point && code_point < 0xe000)) { - return 0; - } - *utf16_output++ = char16_t(code_point); - pos += 3; - } else if ((leading_byte & 0b11111000) == 0b11110000) { // 0b11110000 - // we have a 4-byte UTF-8 word. - if(pos + 3 >= len) { return 0; } // minimal bound checking - if ((data[pos + 1] & 0b11000000) != 0b10000000) { return 0; } - if ((data[pos + 2] & 0b11000000) != 0b10000000) { return 0; } - if ((data[pos + 3] & 0b11000000) != 0b10000000) { return 0; } - - // range check - uint32_t code_point = - (leading_byte & 0b00000111) << 18 | (data[pos + 1] & 0b00111111) << 12 | - (data[pos + 2] & 0b00111111) << 6 | (data[pos + 3] & 0b00111111); - if (code_point <= 0xffff || 0x10ffff < code_point) { return 0; } - code_point -= 0x10000; - uint16_t high_surrogate = uint16_t(0xD800 + (code_point >> 10)); - uint16_t low_surrogate = uint16_t(0xDC00 + (code_point & 0x3FF)); - *utf16_output++ = char16_t(high_surrogate); - *utf16_output++ = char16_t(low_surrogate); - pos += 4; - } else { - return 0; - } - } - return int(utf16_output - start); - }; - size_t codepoints = convert(input.data(), input.size(), buffer.get()); - if(codepoints == 0) { - out = std::nullopt; - return false; + /** four-bytes **/ + else { + counter += 4; } - int required_buffer_size = IdnToAscii(IDN_ALLOW_UNASSIGNED, (LPCWSTR)buffer.get(), codepoints, NULL, 0); + } + return counter; +} - if(required_buffer_size == 0) { - out = std::nullopt; - return false; +size_t utf32_length_from_utf8(const char* buf, size_t len) { + const int8_t* p = reinterpret_cast(buf); + size_t counter{0}; + for (size_t i = 0; i < len; i++) { + // -65 is 0b10111111, anything larger in two-complement's + // should start a new code point. + if (p[i] > -65) { + counter++; } + } + return counter; +} - out = std::string(required_buffer_size, 0); - std::unique_ptr ascii_buffer(new char16_t[required_buffer_size]); - - required_buffer_size = IdnToAscii(IDN_ALLOW_UNASSIGNED, (LPCWSTR)buffer.get(), codepoints, (LPWSTR)ascii_buffer.get(), required_buffer_size); - if(required_buffer_size == 0) { - out = std::nullopt; - return false; +size_t utf32_to_utf8(const char32_t* buf, size_t len, char* utf8_output) { + const uint32_t* data = reinterpret_cast(buf); + size_t pos = 0; + char* start{utf8_output}; + while (pos < len) { + // try to convert the next block of 2 ASCII characters + if (pos + 2 <= len) { // if it is safe to read 8 more + // bytes, check that they are ascii + uint64_t v; + std::memcpy(&v, data + pos, sizeof(uint64_t)); + if ((v & 0xFFFFFF80FFFFFF80) == 0) { + *utf8_output++ = char(buf[pos]); + *utf8_output++ = char(buf[pos + 1]); + pos += 2; + continue; + } } - // This will not validate the punycode, so let us work it in reverse. - int test_reverse = IdnToUnicode(IDN_ALLOW_UNASSIGNED, (LPCWSTR)ascii_buffer.get(), required_buffer_size, NULL, 0); - if(test_reverse == 0) { - out = std::nullopt; - return false; + uint32_t word = data[pos]; + if ((word & 0xFFFFFF80) == 0) { + // will generate one UTF-8 bytes + *utf8_output++ = char(word); + pos++; + } else if ((word & 0xFFFFF800) == 0) { + // will generate two UTF-8 bytes + // we have 0b110XXXXX 0b10XXXXXX + *utf8_output++ = char((word >> 6) | 0b11000000); + *utf8_output++ = char((word & 0b111111) | 0b10000000); + pos++; + } else if ((word & 0xFFFF0000) == 0) { + // will generate three UTF-8 bytes + // we have 0b1110XXXX 0b10XXXXXX 0b10XXXXXX + if (word >= 0xD800 && word <= 0xDFFF) { + return 0; + } + *utf8_output++ = char((word >> 12) | 0b11100000); + *utf8_output++ = char(((word >> 6) & 0b111111) | 0b10000000); + *utf8_output++ = char((word & 0b111111) | 0b10000000); + pos++; + } else { + // will generate four UTF-8 bytes + // we have 0b11110XXX 0b10XXXXXX 0b10XXXXXX + // 0b10XXXXXX + if (word > 0x10FFFF) { + return 0; + } + *utf8_output++ = char((word >> 18) | 0b11110000); + *utf8_output++ = char(((word >> 12) & 0b111111) | 0b10000000); + *utf8_output++ = char(((word >> 6) & 0b111111) | 0b10000000); + *utf8_output++ = char((word & 0b111111) | 0b10000000); + pos++; } - out = std::string(required_buffer_size, 0); - for(size_t i = 0; i < required_buffer_size; i++) { (*out)[i] = char(ascii_buffer.get()[i]); } -#else - (void)be_strict; // unused. - out = input; // We cannot do much more for now. -#endif - return true; } + return utf8_output - start; +} +} // namespace ada::idna +/* end file src/unicode_transcoding.cpp */ +/* begin file src/mapping.cpp */ -} // namespace ada::unicode -/* end file src/unicode.cpp */ -// dofile: invoked with prepath=/Users/dlemire/CVS/github/ada/src, filename=serializers.cpp -/* begin file src/serializers.cpp */ - +#include #include #include -namespace ada::serializers { - - void find_longest_sequence_of_ipv6_pieces(const std::array& address, size_t& compress, size_t& compress_length) noexcept { - for (size_t i = 0; i < 8; i++) { - if (address[i] == 0) { - size_t next = i + 1; - while (next != 8 && address[next] == 0) ++next; - const size_t count = next - i; - if (compress_length < count) { - compress_length = count; - compress = i; - if (next == 8) break; - i = next; - } - } +/* begin file src/mapping_tables.cpp */ +// IDNA 15.0.0 + +// clang-format off +#ifndef ADA_IDNA_TABLES_H +#define ADA_IDNA_TABLES_H +#include + +namespace ada::idna { + +const uint32_t mappings[5164] = +{ + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 32, 32, 776, 32, 772, 50, 51, 32, 769, + 956, 32, 807, 49, 49, 8260, 52, 49, 8260, 50, 51, 8260, 52, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, + 244, 245, 246, 248, 249, 250, 251, 252, 253, 254, 257, 259, 261, 263, 265, 267, + 269, 271, 273, 275, 277, 279, 281, 283, 285, 287, 289, 291, 293, 295, 297, 299, + 301, 303, 105, 775, 309, 311, 314, 316, 318, 108, 183, 322, 324, 326, 328, 700, + 110, 331, 333, 335, 337, 339, 341, 343, 345, 347, 349, 351, 353, 355, 357, 359, + 361, 363, 365, 367, 369, 371, 373, 375, 255, 378, 380, 382, 595, 387, 389, 596, + 392, 598, 599, 396, 477, 601, 603, 402, 608, 611, 617, 616, 409, 623, 626, 629, + 417, 419, 421, 640, 424, 643, 429, 648, 432, 650, 651, 436, 438, 658, 441, 445, + 100, 382, 108, 106, 110, 106, 462, 464, 466, 468, 470, 472, 474, 476, 479, 481, + 483, 485, 487, 489, 491, 493, 495, 100, 122, 501, 405, 447, 505, 507, 509, 511, + 513, 515, 517, 519, 521, 523, 525, 527, 529, 531, 533, 535, 537, 539, 541, 543, + 414, 547, 549, 551, 553, 555, 557, 559, 561, 563, 11365, 572, 410, 11366, 578, 384, + 649, 652, 583, 585, 587, 589, 591, 614, 633, 635, 641, 32, 774, 32, 775, 32, 778, + 32, 808, 32, 771, 32, 779, 661, 768, 787, 776, 769, 953, 881, 883, 697, 887, 32, + 953, 59, 1011, 32, 776, 769, 940, 941, 942, 943, 972, 973, 974, 945, 946, 947, 948, + 949, 950, 951, 952, 954, 955, 957, 958, 959, 960, 961, 963, 964, 965, 966, 967, + 968, 969, 970, 971, 983, 985, 987, 989, 991, 993, 995, 997, 999, 1001, 1003, 1005, + 1007, 1016, 1019, 891, 892, 893, 1104, 1105, 1106, 1107, 1108, 1109, 1110, 1111, + 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1072, 1073, 1074, 1075, 1076, 1077, + 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, + 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, 1101, 1102, 1103, 1121, 1123, + 1125, 1127, 1129, 1131, 1133, 1135, 1137, 1139, 1141, 1143, 1145, 1147, 1149, 1151, + 1153, 1163, 1165, 1167, 1169, 1171, 1173, 1175, 1177, 1179, 1181, 1183, 1185, 1187, + 1189, 1191, 1193, 1195, 1197, 1199, 1201, 1203, 1205, 1207, 1209, 1211, 1213, 1215, + 1218, 1220, 1222, 1224, 1226, 1228, 1230, 1233, 1235, 1237, 1239, 1241, 1243, 1245, + 1247, 1249, 1251, 1253, 1255, 1257, 1259, 1261, 1263, 1265, 1267, 1269, 1271, 1273, + 1275, 1277, 1279, 1281, 1283, 1285, 1287, 1289, 1291, 1293, 1295, 1297, 1299, 1301, + 1303, 1305, 1307, 1309, 1311, 1313, 1315, 1317, 1319, 1321, 1323, 1325, 1327, 1377, + 1378, 1379, 1380, 1381, 1382, 1383, 1384, 1385, 1386, 1387, 1388, 1389, 1390, 1391, + 1392, 1393, 1394, 1395, 1396, 1397, 1398, 1399, 1400, 1401, 1402, 1403, 1404, 1405, + 1406, 1407, 1408, 1409, 1410, 1411, 1412, 1413, 1414, 1381, 1410, 1575, 1652, 1608, + 1652, 1735, 1652, 1610, 1652, 2325, 2364, 2326, 2364, 2327, 2364, 2332, 2364, 2337, + 2364, 2338, 2364, 2347, 2364, 2351, 2364, 2465, 2492, 2466, 2492, 2479, 2492, 2610, + 2620, 2616, 2620, 2582, 2620, 2583, 2620, 2588, 2620, 2603, 2620, 2849, 2876, 2850, + 2876, 3661, 3634, 3789, 3762, 3755, 3737, 3755, 3745, 3851, 3906, 4023, 3916, 4023, + 3921, 4023, 3926, 4023, 3931, 4023, 3904, 4021, 3953, 3954, 3953, 3956, 4018, 3968, + 4018, 3953, 3968, 4019, 3968, 4019, 3953, 3968, 3986, 4023, 3996, 4023, 4001, 4023, + 4006, 4023, 4011, 4023, 3984, 4021, 11559, 11565, 4316, 5104, 5105, 5106, 5107, + 5108, 5109, 42571, 4304, 4305, 4306, 4307, 4308, 4309, 4310, 4311, 4312, 4313, 4314, + 4315, 4317, 4318, 4319, 4320, 4321, 4322, 4323, 4324, 4325, 4326, 4327, 4328, 4329, + 4330, 4331, 4332, 4333, 4334, 4335, 4336, 4337, 4338, 4339, 4340, 4341, 4342, 4343, + 4344, 4345, 4346, 4349, 4350, 4351, 592, 593, 7426, 604, 7446, 7447, 7453, 7461, + 594, 597, 607, 609, 613, 618, 7547, 669, 621, 7557, 671, 625, 624, 627, 628, 632, + 642, 427, 7452, 656, 657, 7681, 7683, 7685, 7687, 7689, 7691, 7693, 7695, 7697, + 7699, 7701, 7703, 7705, 7707, 7709, 7711, 7713, 7715, 7717, 7719, 7721, 7723, 7725, + 7727, 7729, 7731, 7733, 7735, 7737, 7739, 7741, 7743, 7745, 7747, 7749, 7751, 7753, + 7755, 7757, 7759, 7761, 7763, 7765, 7767, 7769, 7771, 7773, 7775, 7777, 7779, 7781, + 7783, 7785, 7787, 7789, 7791, 7793, 7795, 7797, 7799, 7801, 7803, 7805, 7807, 7809, + 7811, 7813, 7815, 7817, 7819, 7821, 7823, 7825, 7827, 7829, 97, 702, 115, 115, 7841, + 7843, 7845, 7847, 7849, 7851, 7853, 7855, 7857, 7859, 7861, 7863, 7865, 7867, 7869, + 7871, 7873, 7875, 7877, 7879, 7881, 7883, 7885, 7887, 7889, 7891, 7893, 7895, 7897, + 7899, 7901, 7903, 7905, 7907, 7909, 7911, 7913, 7915, 7917, 7919, 7921, 7923, 7925, + 7927, 7929, 7931, 7933, 7935, 7936, 7937, 7938, 7939, 7940, 7941, 7942, 7943, 7952, + 7953, 7954, 7955, 7956, 7957, 7968, 7969, 7970, 7971, 7972, 7973, 7974, 7975, 7984, + 7985, 7986, 7987, 7988, 7989, 7990, 7991, 8000, 8001, 8002, 8003, 8004, 8005, 8017, + 8019, 8021, 8023, 8032, 8033, 8034, 8035, 8036, 8037, 8038, 8039, 7936, 953, 7937, + 953, 7938, 953, 7939, 953, 7940, 953, 7941, 953, 7942, 953, 7943, 953, 7968, 953, + 7969, 953, 7970, 953, 7971, 953, 7972, 953, 7973, 953, 7974, 953, 7975, 953, 8032, + 953, 8033, 953, 8034, 953, 8035, 953, 8036, 953, 8037, 953, 8038, 953, 8039, 953, + 8048, 953, 945, 953, 940, 953, 8118, 953, 8112, 8113, 32, 787, 32, 834, 32, 776, + 834, 8052, 953, 951, 953, 942, 953, 8134, 953, 8050, 32, 787, 768, 32, 787, 769, + 32, 787, 834, 912, 8144, 8145, 8054, 32, 788, 768, 32, 788, 769, 32, 788, 834, 944, + 8160, 8161, 8058, 8165, 32, 776, 768, 96, 8060, 953, 969, 953, 974, 953, 8182, 953, + 8056, 8208, 32, 819, 8242, 8242, 8242, 8242, 8242, 8245, 8245, 8245, 8245, 8245, + 33, 33, 32, 773, 63, 63, 63, 33, 33, 63, 48, 53, 54, 55, 56, 57, 43, 8722, 61, 40, + 41, 97, 47, 99, 97, 47, 115, 176, 99, 99, 47, 111, 99, 47, 117, 176, 102, 115, 109, + 116, 101, 108, 116, 109, 1488, 1489, 1490, 1491, 102, 97, 120, 8721, 49, 8260, 55, + 49, 8260, 57, 49, 8260, 49, 48, 49, 8260, 51, 50, 8260, 51, 49, 8260, 53, 50, 8260, + 53, 51, 8260, 53, 52, 8260, 53, 49, 8260, 54, 53, 8260, 54, 49, 8260, 56, 51, 8260, + 56, 53, 8260, 56, 55, 8260, 56, 105, 105, 105, 105, 105, 105, 118, 118, 105, 118, + 105, 105, 118, 105, 105, 105, 105, 120, 120, 105, 120, 105, 105, 48, 8260, 51, 8747, + 8747, 8747, 8747, 8747, 8750, 8750, 8750, 8750, 8750, 12296, 12297, 49, 50, 49, + 51, 49, 52, 49, 53, 49, 54, 49, 55, 49, 56, 49, 57, 50, 48, 40, 49, 41, 40, 50, + 41, 40, 51, 41, 40, 52, 41, 40, 53, 41, 40, 54, 41, 40, 55, 41, 40, 56, 41, 40, + 57, 41, 40, 49, 48, 41, 40, 49, 49, 41, 40, 49, 50, 41, 40, 49, 51, 41, 40, 49, + 52, 41, 40, 49, 53, 41, 40, 49, 54, 41, 40, 49, 55, 41, 40, 49, 56, 41, 40, 49, + 57, 41, 40, 50, 48, 41, 40, 97, 41, 40, 98, 41, 40, 99, 41, 40, 100, 41, 40, 101, + 41, 40, 102, 41, 40, 103, 41, 40, 104, 41, 40, 105, 41, 40, 106, 41, 40, 107, 41, + 40, 108, 41, 40, 109, 41, 40, 110, 41, 40, 111, 41, 40, 112, 41, 40, 113, 41, 40, + 114, 41, 40, 115, 41, 40, 116, 41, 40, 117, 41, 40, 118, 41, 40, 119, 41, 40, 120, + 41, 40, 121, 41, 40, 122, 41, 58, 58, 61, 61, 61, 10973, 824, 11312, 11313, 11314, + 11315, 11316, 11317, 11318, 11319, 11320, 11321, 11322, 11323, 11324, 11325, 11326, + 11327, 11328, 11329, 11330, 11331, 11332, 11333, 11334, 11335, 11336, 11337, 11338, + 11339, 11340, 11341, 11342, 11343, 11344, 11345, 11346, 11347, 11348, 11349, 11350, + 11351, 11352, 11353, 11354, 11355, 11356, 11357, 11358, 11359, 11361, 619, 7549, + 637, 11368, 11370, 11372, 11379, 11382, 575, 576, 11393, 11395, 11397, 11399, 11401, + 11403, 11405, 11407, 11409, 11411, 11413, 11415, 11417, 11419, 11421, 11423, 11425, + 11427, 11429, 11431, 11433, 11435, 11437, 11439, 11441, 11443, 11445, 11447, 11449, + 11451, 11453, 11455, 11457, 11459, 11461, 11463, 11465, 11467, 11469, 11471, 11473, + 11475, 11477, 11479, 11481, 11483, 11485, 11487, 11489, 11491, 11500, 11502, 11507, + 11617, 27597, 40863, 19968, 20008, 20022, 20031, 20057, 20101, 20108, 20128, 20154, + 20799, 20837, 20843, 20866, 20886, 20907, 20960, 20981, 20992, 21147, 21241, 21269, + 21274, 21304, 21313, 21340, 21353, 21378, 21430, 21448, 21475, 22231, 22303, 22763, + 22786, 22794, 22805, 22823, 22899, 23376, 23424, 23544, 23567, 23586, 23608, 23662, + 23665, 24027, 24037, 24049, 24062, 24178, 24186, 24191, 24308, 24318, 24331, 24339, + 24400, 24417, 24435, 24515, 25096, 25142, 25163, 25903, 25908, 25991, 26007, 26020, + 26041, 26080, 26085, 26352, 26376, 26408, 27424, 27490, 27513, 27571, 27595, 27604, + 27611, 27663, 27668, 27700, 28779, 29226, 29238, 29243, 29247, 29255, 29273, 29275, + 29356, 29572, 29577, 29916, 29926, 29976, 29983, 29992, 30000, 30091, 30098, 30326, + 30333, 30382, 30399, 30446, 30683, 30690, 30707, 31034, 31160, 31166, 31348, 31435, + 31481, 31859, 31992, 32566, 32593, 32650, 32701, 32769, 32780, 32786, 32819, 32895, + 32905, 33251, 33258, 33267, 33276, 33292, 33307, 33311, 33390, 33394, 33400, 34381, + 34411, 34880, 34892, 34915, 35198, 35211, 35282, 35328, 35895, 35910, 35925, 35960, + 35997, 36196, 36208, 36275, 36523, 36554, 36763, 36784, 36789, 37009, 37193, 37318, + 37324, 37329, 38263, 38272, 38428, 38582, 38585, 38632, 38737, 38750, 38754, 38761, + 38859, 38893, 38899, 38913, 39080, 39131, 39135, 39318, 39321, 39340, 39592, 39640, + 39647, 39717, 39727, 39730, 39740, 39770, 40165, 40565, 40575, 40613, 40635, 40643, + 40653, 40657, 40697, 40701, 40718, 40723, 40736, 40763, 40778, 40786, 40845, 40860, + 40864, 46, 12306, 21316, 21317, 32, 12441, 32, 12442, 12424, 12426, 12467, 12488, + 4352, 4353, 4522, 4354, 4524, 4525, 4355, 4356, 4357, 4528, 4529, 4530, 4531, 4532, + 4533, 4378, 4358, 4359, 4360, 4385, 4361, 4362, 4363, 4364, 4365, 4366, 4367, 4368, + 4369, 4370, 4449, 4450, 4451, 4452, 4453, 4454, 4455, 4456, 4457, 4458, 4459, 4460, + 4461, 4462, 4463, 4464, 4465, 4466, 4467, 4468, 4469, 4372, 4373, 4551, 4552, 4556, + 4558, 4563, 4567, 4569, 4380, 4573, 4575, 4381, 4382, 4384, 4386, 4387, 4391, 4393, + 4395, 4396, 4397, 4398, 4399, 4402, 4406, 4416, 4423, 4428, 4593, 4594, 4439, 4440, + 4441, 4484, 4485, 4488, 4497, 4498, 4500, 4510, 4513, 19977, 22235, 19978, 20013, + 19979, 30002, 19993, 19969, 22825, 22320, 40, 4352, 41, 40, 4354, 41, 40, 4355, + 41, 40, 4357, 41, 40, 4358, 41, 40, 4359, 41, 40, 4361, 41, 40, 4363, 41, 40, 4364, + 41, 40, 4366, 41, 40, 4367, 41, 40, 4368, 41, 40, 4369, 41, 40, 4370, 41, 40, 44032, + 41, 40, 45208, 41, 40, 45796, 41, 40, 46972, 41, 40, 47560, 41, 40, 48148, 41, 40, + 49324, 41, 40, 50500, 41, 40, 51088, 41, 40, 52264, 41, 40, 52852, 41, 40, 53440, + 41, 40, 54028, 41, 40, 54616, 41, 40, 51452, 41, 40, 50724, 51204, 41, 40, 50724, + 54980, 41, 40, 19968, 41, 40, 20108, 41, 40, 19977, 41, 40, 22235, 41, 40, 20116, + 41, 40, 20845, 41, 40, 19971, 41, 40, 20843, 41, 40, 20061, 41, 40, 21313, 41, 40, + 26376, 41, 40, 28779, 41, 40, 27700, 41, 40, 26408, 41, 40, 37329, 41, 40, 22303, + 41, 40, 26085, 41, 40, 26666, 41, 40, 26377, 41, 40, 31038, 41, 40, 21517, 41, 40, + 29305, 41, 40, 36001, 41, 40, 31069, 41, 40, 21172, 41, 40, 20195, 41, 40, 21628, + 41, 40, 23398, 41, 40, 30435, 41, 40, 20225, 41, 40, 36039, 41, 40, 21332, 41, 40, + 31085, 41, 40, 20241, 41, 40, 33258, 41, 40, 33267, 41, 21839, 24188, 31631, 112, + 116, 101, 50, 50, 50, 52, 50, 53, 50, 54, 50, 55, 50, 56, 50, 57, 51, 48, 51, 51, + 51, 52, 51, 53, 52280, 44256, 51452, 51032, 50864, 31192, 30007, 36969, 20778, 21360, + 27880, 38917, 20889, 27491, 24038, 21491, 21307, 23447, 22812, 51, 54, 51, 55, 51, + 56, 51, 57, 52, 48, 52, 52, 52, 53, 52, 54, 52, 55, 52, 56, 52, 57, 53, 48, 49, + 26376, 50, 26376, 51, 26376, 52, 26376, 53, 26376, 54, 26376, 55, 26376, 56, 26376, + 57, 26376, 49, 48, 26376, 49, 49, 26376, 49, 50, 26376, 104, 103, 101, 114, 103, + 101, 118, 108, 116, 100, 12450, 12452, 12454, 12456, 12458, 12459, 12461, 12463, + 12465, 12469, 12471, 12473, 12475, 12477, 12479, 12481, 12484, 12486, 12490, 12491, + 12492, 12493, 12494, 12495, 12498, 12501, 12504, 12507, 12510, 12511, 12512, 12513, + 12514, 12516, 12518, 12520, 12521, 12522, 12523, 12524, 12525, 12527, 12528, 12529, + 12530, 20196, 21644, 12450, 12497, 12540, 12488, 12450, 12523, 12501, 12449, 12450, + 12531, 12506, 12450, 12450, 12540, 12523, 12452, 12491, 12531, 12464, 12452, 12531, + 12481, 12454, 12457, 12531, 12456, 12473, 12463, 12540, 12489, 12456, 12540, 12459, + 12540, 12458, 12531, 12473, 12458, 12540, 12512, 12459, 12452, 12522, 12459, 12521, + 12483, 12488, 12459, 12525, 12522, 12540, 12460, 12525, 12531, 12460, 12531, 12510, + 12462, 12460, 12462, 12491, 12540, 12461, 12517, 12522, 12540, 12462, 12523, 12480, + 12540, 12461, 12525, 12461, 12525, 12464, 12521, 12512, 12461, 12525, 12513, 12540, + 12488, 12523, 12461, 12525, 12527, 12483, 12488, 12464, 12521, 12512, 12488, 12531, + 12463, 12523, 12476, 12452, 12525, 12463, 12525, 12540, 12493, 12465, 12540, 12473, + 12467, 12523, 12490, 12467, 12540, 12509, 12469, 12452, 12463, 12523, 12469, 12531, + 12481, 12540, 12512, 12471, 12522, 12531, 12464, 12475, 12531, 12481, 12475, 12531, + 12488, 12480, 12540, 12473, 12487, 12471, 12489, 12523, 12490, 12494, 12494, 12483, + 12488, 12495, 12452, 12484, 12497, 12540, 12475, 12531, 12488, 12497, 12540, 12484, + 12496, 12540, 12524, 12523, 12500, 12450, 12473, 12488, 12523, 12500, 12463, 12523, + 12500, 12467, 12499, 12523, 12501, 12449, 12521, 12483, 12489, 12501, 12451, 12540, + 12488, 12502, 12483, 12471, 12455, 12523, 12501, 12521, 12531, 12504, 12463, 12479, + 12540, 12523, 12506, 12477, 12506, 12491, 12498, 12504, 12523, 12484, 12506, 12531, + 12473, 12506, 12540, 12472, 12505, 12540, 12479, 12509, 12452, 12531, 12488, 12508, + 12523, 12488, 12507, 12531, 12509, 12531, 12489, 12507, 12540, 12523, 12507, 12540, + 12531, 12510, 12452, 12463, 12525, 12510, 12452, 12523, 12510, 12483, 12495, 12510, + 12523, 12463, 12510, 12531, 12471, 12519, 12531, 12511, 12463, 12525, 12531, 12511, + 12522, 12511, 12522, 12496, 12540, 12523, 12513, 12460, 12513, 12460, 12488, 12531, + 12516, 12540, 12489, 12516, 12540, 12523, 12518, 12450, 12531, 12522, 12483, 12488, + 12523, 12522, 12521, 12523, 12500, 12540, 12523, 12540, 12502, 12523, 12524, 12512, + 12524, 12531, 12488, 12466, 12531, 48, 28857, 49, 28857, 50, 28857, 51, 28857, 52, + 28857, 53, 28857, 54, 28857, 55, 28857, 56, 28857, 57, 28857, 49, 48, 28857, 49, + 49, 28857, 49, 50, 28857, 49, 51, 28857, 49, 52, 28857, 49, 53, 28857, 49, 54, 28857, + 49, 55, 28857, 49, 56, 28857, 49, 57, 28857, 50, 48, 28857, 50, 49, 28857, 50, 50, + 28857, 50, 51, 28857, 50, 52, 28857, 104, 112, 97, 100, 97, 97, 117, 98, 97, 114, + 111, 118, 112, 99, 100, 109, 100, 109, 50, 100, 109, 51, 105, 117, 24179, 25104, + 26157, 21644, 22823, 27491, 26126, 27835, 26666, 24335, 20250, 31038, 110, 97, 956, + 97, 109, 97, 107, 97, 107, 98, 109, 98, 103, 98, 99, 97, 108, 107, 99, 97, 108, + 112, 102, 110, 102, 956, 102, 956, 103, 109, 103, 107, 103, 104, 122, 107, 104, + 122, 109, 104, 122, 116, 104, 122, 956, 108, 109, 108, 100, 108, 102, 109, 110, + 109, 956, 109, 109, 109, 99, 109, 107, 109, 109, 109, 50, 99, 109, 50, 107, 109, + 50, 109, 109, 51, 99, 109, 51, 107, 109, 51, 109, 8725, 115, 109, 8725, 115, 50, + 107, 112, 97, 109, 112, 97, 103, 112, 97, 114, 97, 100, 114, 97, 100, 8725, 115, + 114, 97, 100, 8725, 115, 50, 112, 115, 110, 115, 956, 115, 109, 115, 112, 118, 110, + 118, 956, 118, 109, 118, 107, 118, 112, 119, 110, 119, 956, 119, 109, 119, 107, + 119, 107, 969, 109, 969, 98, 113, 99, 8725, 107, 103, 100, 98, 103, 121, 104, 97, + 105, 110, 107, 107, 107, 116, 108, 110, 108, 111, 103, 108, 120, 109, 105, 108, + 109, 111, 108, 112, 104, 112, 112, 109, 112, 114, 115, 118, 119, 98, 118, 8725, + 109, 97, 8725, 109, 49, 26085, 50, 26085, 51, 26085, 52, 26085, 53, 26085, 54, 26085, + 55, 26085, 56, 26085, 57, 26085, 49, 48, 26085, 49, 49, 26085, 49, 50, 26085, 49, + 51, 26085, 49, 52, 26085, 49, 53, 26085, 49, 54, 26085, 49, 55, 26085, 49, 56, 26085, + 49, 57, 26085, 50, 48, 26085, 50, 49, 26085, 50, 50, 26085, 50, 51, 26085, 50, 52, + 26085, 50, 53, 26085, 50, 54, 26085, 50, 55, 26085, 50, 56, 26085, 50, 57, 26085, + 51, 48, 26085, 51, 49, 26085, 103, 97, 108, 42561, 42563, 42565, 42567, 42569, 42573, + 42575, 42577, 42579, 42581, 42583, 42585, 42587, 42589, 42591, 42593, 42595, 42597, + 42599, 42601, 42603, 42605, 42625, 42627, 42629, 42631, 42633, 42635, 42637, 42639, + 42641, 42643, 42645, 42647, 42649, 42651, 42787, 42789, 42791, 42793, 42795, 42797, + 42799, 42803, 42805, 42807, 42809, 42811, 42813, 42815, 42817, 42819, 42821, 42823, + 42825, 42827, 42829, 42831, 42833, 42835, 42837, 42839, 42841, 42843, 42845, 42847, + 42849, 42851, 42853, 42855, 42857, 42859, 42861, 42863, 42874, 42876, 7545, 42879, + 42881, 42883, 42885, 42887, 42892, 42897, 42899, 42903, 42905, 42907, 42909, 42911, + 42913, 42915, 42917, 42919, 42921, 620, 670, 647, 43859, 42933, 42935, 42937, 42939, + 42941, 42943, 42945, 42947, 42900, 7566, 42952, 42954, 42961, 42967, 42969, 42998, + 43831, 43858, 653, 5024, 5025, 5026, 5027, 5028, 5029, 5030, 5031, 5032, 5033, 5034, + 5035, 5036, 5037, 5038, 5039, 5040, 5041, 5042, 5043, 5044, 5045, 5046, 5047, 5048, + 5049, 5050, 5051, 5052, 5053, 5054, 5055, 5056, 5057, 5058, 5059, 5060, 5061, 5062, + 5063, 5064, 5065, 5066, 5067, 5068, 5069, 5070, 5071, 5072, 5073, 5074, 5075, 5076, + 5077, 5078, 5079, 5080, 5081, 5082, 5083, 5084, 5085, 5086, 5087, 5088, 5089, 5090, + 5091, 5092, 5093, 5094, 5095, 5096, 5097, 5098, 5099, 5100, 5101, 5102, 5103, 35912, + 26356, 36040, 28369, 20018, 21477, 22865, 21895, 22856, 25078, 30313, 32645, 34367, + 34746, 35064, 37007, 27138, 27931, 28889, 29662, 33853, 37226, 39409, 20098, 21365, + 27396, 29211, 34349, 40478, 23888, 28651, 34253, 35172, 25289, 33240, 34847, 24266, + 26391, 28010, 29436, 37070, 20358, 20919, 21214, 25796, 27347, 29200, 30439, 34310, + 34396, 36335, 38706, 39791, 40442, 30860, 31103, 32160, 33737, 37636, 35542, 22751, + 24324, 31840, 32894, 29282, 30922, 36034, 38647, 22744, 23650, 27155, 28122, 28431, + 32047, 32311, 38475, 21202, 32907, 20956, 20940, 31260, 32190, 33777, 38517, 35712, + 25295, 35582, 20025, 23527, 24594, 29575, 30064, 21271, 30971, 20415, 24489, 19981, + 27852, 25976, 32034, 21443, 22622, 30465, 33865, 35498, 27578, 27784, 25342, 33509, + 25504, 30053, 20142, 20841, 20937, 26753, 31975, 33391, 35538, 37327, 21237, 21570, + 24300, 26053, 28670, 31018, 38317, 39530, 40599, 40654, 26310, 27511, 36706, 24180, + 24976, 25088, 25754, 28451, 29001, 29833, 31178, 32244, 32879, 36646, 34030, 36899, + 37706, 21015, 21155, 21693, 28872, 35010, 24265, 24565, 25467, 27566, 31806, 29557, + 22265, 23994, 24604, 29618, 29801, 32666, 32838, 37428, 38646, 38728, 38936, 20363, + 31150, 37300, 38584, 24801, 20102, 20698, 23534, 23615, 26009, 29134, 30274, 34044, + 36988, 26248, 38446, 21129, 26491, 26611, 27969, 28316, 29705, 30041, 30827, 32016, + 39006, 25134, 38520, 20523, 23833, 28138, 36650, 24459, 24900, 26647, 38534, 21033, + 21519, 23653, 26131, 26446, 26792, 27877, 29702, 30178, 32633, 35023, 35041, 38626, + 21311, 28346, 21533, 29136, 29848, 34298, 38563, 40023, 40607, 26519, 28107, 33256, + 31520, 31890, 29376, 28825, 35672, 20160, 33590, 21050, 20999, 24230, 25299, 31958, + 23429, 27934, 26292, 36667, 38477, 24275, 20800, 21952, 22618, 26228, 20958, 29482, + 30410, 31036, 31070, 31077, 31119, 38742, 31934, 34322, 35576, 36920, 37117, 39151, + 39164, 39208, 40372, 37086, 38583, 20398, 20711, 20813, 21193, 21220, 21329, 21917, + 22022, 22120, 22592, 22696, 23652, 24724, 24936, 24974, 25074, 25935, 26082, 26257, + 26757, 28023, 28186, 28450, 29038, 29227, 29730, 30865, 31049, 31048, 31056, 31062, + 31117, 31118, 31296, 31361, 31680, 32265, 32321, 32626, 32773, 33261, 33401, 33879, + 35088, 35222, 35585, 35641, 36051, 36104, 36790, 38627, 38911, 38971, 24693, 148206, + 33304, 20006, 20917, 20840, 20352, 20805, 20864, 21191, 21242, 21845, 21913, 21986, + 22707, 22852, 22868, 23138, 23336, 24274, 24281, 24425, 24493, 24792, 24910, 24840, + 24928, 25140, 25540, 25628, 25682, 25942, 26395, 26454, 28379, 28363, 28702, 30631, + 29237, 29359, 29809, 29958, 30011, 30237, 30239, 30427, 30452, 30538, 30528, 30924, + 31409, 31867, 32091, 32574, 33618, 33775, 34681, 35137, 35206, 35519, 35531, 35565, + 35722, 36664, 36978, 37273, 37494, 38524, 38875, 38923, 39698, 141386, 141380, 144341, + 15261, 16408, 16441, 152137, 154832, 163539, 40771, 40846, 102, 102, 102, 105, 102, + 108, 102, 102, 108, 1396, 1398, 1396, 1381, 1396, 1387, 1406, 1398, 1396, 1389, + 1497, 1460, 1522, 1463, 1506, 1492, 1499, 1500, 1501, 1512, 1514, 1513, 1473, 1513, + 1474, 1513, 1468, 1473, 1513, 1468, 1474, 1488, 1463, 1488, 1464, 1488, 1468, 1489, + 1468, 1490, 1468, 1491, 1468, 1492, 1468, 1493, 1468, 1494, 1468, 1496, 1468, 1497, + 1468, 1498, 1468, 1499, 1468, 1500, 1468, 1502, 1468, 1504, 1468, 1505, 1468, 1507, + 1468, 1508, 1468, 1510, 1468, 1511, 1468, 1512, 1468, 1514, 1468, 1493, 1465, 1489, + 1471, 1499, 1471, 1508, 1471, 1488, 1500, 1649, 1659, 1662, 1664, 1658, 1663, 1657, + 1700, 1702, 1668, 1667, 1670, 1671, 1677, 1676, 1678, 1672, 1688, 1681, 1705, 1711, + 1715, 1713, 1722, 1723, 1728, 1729, 1726, 1746, 1747, 1709, 1734, 1736, 1739, 1733, + 1737, 1744, 1609, 1574, 1575, 1574, 1749, 1574, 1608, 1574, 1735, 1574, 1734, 1574, + 1736, 1574, 1744, 1574, 1609, 1740, 1574, 1580, 1574, 1581, 1574, 1605, 1574, 1610, + 1576, 1580, 1576, 1581, 1576, 1582, 1576, 1605, 1576, 1609, 1576, 1610, 1578, 1580, + 1578, 1581, 1578, 1582, 1578, 1605, 1578, 1609, 1578, 1610, 1579, 1580, 1579, 1605, + 1579, 1609, 1579, 1610, 1580, 1581, 1580, 1605, 1581, 1605, 1582, 1580, 1582, 1581, + 1582, 1605, 1587, 1580, 1587, 1581, 1587, 1582, 1587, 1605, 1589, 1581, 1589, 1605, + 1590, 1580, 1590, 1581, 1590, 1582, 1590, 1605, 1591, 1581, 1591, 1605, 1592, 1605, + 1593, 1580, 1593, 1605, 1594, 1580, 1594, 1605, 1601, 1580, 1601, 1581, 1601, 1582, + 1601, 1605, 1601, 1609, 1601, 1610, 1602, 1581, 1602, 1605, 1602, 1609, 1602, 1610, + 1603, 1575, 1603, 1580, 1603, 1581, 1603, 1582, 1603, 1604, 1603, 1605, 1603, 1609, + 1603, 1610, 1604, 1580, 1604, 1581, 1604, 1582, 1604, 1605, 1604, 1609, 1604, 1610, + 1605, 1580, 1605, 1605, 1605, 1609, 1605, 1610, 1606, 1580, 1606, 1581, 1606, 1582, + 1606, 1605, 1606, 1609, 1606, 1610, 1607, 1580, 1607, 1605, 1607, 1609, 1607, 1610, + 1610, 1581, 1610, 1582, 1610, 1609, 1584, 1648, 1585, 1648, 1609, 1648, 32, 1612, + 1617, 32, 1613, 1617, 32, 1614, 1617, 32, 1615, 1617, 32, 1616, 1617, 32, 1617, + 1648, 1574, 1585, 1574, 1586, 1574, 1606, 1576, 1585, 1576, 1586, 1576, 1606, 1578, + 1585, 1578, 1586, 1578, 1606, 1579, 1585, 1579, 1586, 1579, 1606, 1605, 1575, 1606, + 1585, 1606, 1586, 1606, 1606, 1610, 1585, 1610, 1586, 1574, 1582, 1574, 1607, 1576, + 1607, 1578, 1607, 1589, 1582, 1604, 1607, 1606, 1607, 1607, 1648, 1579, 1607, 1587, + 1607, 1588, 1605, 1588, 1607, 1600, 1614, 1617, 1600, 1615, 1617, 1600, 1616, 1617, + 1591, 1609, 1591, 1610, 1593, 1609, 1593, 1610, 1594, 1609, 1594, 1610, 1587, 1609, + 1587, 1610, 1588, 1609, 1588, 1610, 1581, 1609, 1580, 1609, 1580, 1610, 1582, 1609, + 1589, 1609, 1589, 1610, 1590, 1609, 1590, 1610, 1588, 1580, 1588, 1581, 1588, 1582, + 1588, 1585, 1587, 1585, 1589, 1585, 1590, 1585, 1575, 1611, 1578, 1580, 1605, 1578, + 1581, 1580, 1578, 1581, 1605, 1578, 1582, 1605, 1578, 1605, 1580, 1578, 1605, 1581, + 1578, 1605, 1582, 1581, 1605, 1610, 1581, 1605, 1609, 1587, 1581, 1580, 1587, 1580, + 1581, 1587, 1580, 1609, 1587, 1605, 1581, 1587, 1605, 1580, 1587, 1605, 1605, 1589, + 1581, 1581, 1589, 1605, 1605, 1588, 1581, 1605, 1588, 1580, 1610, 1588, 1605, 1582, + 1588, 1605, 1605, 1590, 1581, 1609, 1590, 1582, 1605, 1591, 1605, 1581, 1591, 1605, + 1605, 1591, 1605, 1610, 1593, 1580, 1605, 1593, 1605, 1605, 1593, 1605, 1609, 1594, + 1605, 1605, 1594, 1605, 1610, 1594, 1605, 1609, 1601, 1582, 1605, 1602, 1605, 1581, + 1602, 1605, 1605, 1604, 1581, 1605, 1604, 1581, 1610, 1604, 1581, 1609, 1604, 1580, + 1580, 1604, 1582, 1605, 1604, 1605, 1581, 1605, 1581, 1580, 1605, 1581, 1610, 1605, + 1580, 1581, 1605, 1582, 1605, 1605, 1580, 1582, 1607, 1605, 1580, 1607, 1605, 1605, + 1606, 1581, 1605, 1606, 1581, 1609, 1606, 1580, 1605, 1606, 1580, 1609, 1606, 1605, + 1610, 1606, 1605, 1609, 1610, 1605, 1605, 1576, 1582, 1610, 1578, 1580, 1610, 1578, + 1580, 1609, 1578, 1582, 1610, 1578, 1582, 1609, 1578, 1605, 1610, 1578, 1605, 1609, + 1580, 1605, 1610, 1580, 1581, 1609, 1580, 1605, 1609, 1587, 1582, 1609, 1589, 1581, + 1610, 1588, 1581, 1610, 1590, 1581, 1610, 1604, 1580, 1610, 1604, 1605, 1610, 1610, + 1580, 1610, 1610, 1605, 1610, 1605, 1605, 1610, 1602, 1605, 1610, 1606, 1581, 1610, + 1593, 1605, 1610, 1603, 1605, 1610, 1606, 1580, 1581, 1605, 1582, 1610, 1604, 1580, + 1605, 1603, 1605, 1605, 1580, 1581, 1610, 1581, 1580, 1610, 1605, 1580, 1610, 1601, + 1605, 1610, 1576, 1581, 1610, 1587, 1582, 1610, 1606, 1580, 1610, 1589, 1604, 1746, + 1602, 1604, 1746, 1575, 1604, 1604, 1607, 1575, 1603, 1576, 1585, 1605, 1581, 1605, + 1583, 1589, 1604, 1593, 1605, 1585, 1587, 1608, 1604, 1593, 1604, 1610, 1607, 1608, + 1587, 1604, 1605, 1589, 1604, 1609, 1589, 1604, 1609, 32, 1575, 1604, 1604, 1607, + 32, 1593, 1604, 1610, 1607, 32, 1608, 1587, 1604, 1605, 1580, 1604, 32, 1580, 1604, + 1575, 1604, 1607, 1585, 1740, 1575, 1604, 44, 12289, 12310, 12311, 8212, 8211, 95, + 123, 125, 12308, 12309, 12304, 12305, 12298, 12299, 12300, 12301, 12302, 12303, + 91, 93, 35, 38, 42, 45, 60, 62, 92, 36, 37, 64, 32, 1611, 1600, 1611, 1600, 1617, + 32, 1618, 1600, 1618, 1569, 1570, 1571, 1572, 1573, 1577, 1604, 1570, 1604, 1571, + 1604, 1573, 34, 39, 94, 124, 126, 10629, 10630, 12539, 12453, 12515, 162, 163, 172, + 166, 165, 8361, 9474, 8592, 8593, 8594, 8595, 9632, 9675, 66600, 66601, 66602, 66603, + 66604, 66605, 66606, 66607, 66608, 66609, 66610, 66611, 66612, 66613, 66614, 66615, + 66616, 66617, 66618, 66619, 66620, 66621, 66622, 66623, 66624, 66625, 66626, 66627, + 66628, 66629, 66630, 66631, 66632, 66633, 66634, 66635, 66636, 66637, 66638, 66639, + 66776, 66777, 66778, 66779, 66780, 66781, 66782, 66783, 66784, 66785, 66786, 66787, + 66788, 66789, 66790, 66791, 66792, 66793, 66794, 66795, 66796, 66797, 66798, 66799, + 66800, 66801, 66802, 66803, 66804, 66805, 66806, 66807, 66808, 66809, 66810, 66811, + 66967, 66968, 66969, 66970, 66971, 66972, 66973, 66974, 66975, 66976, 66977, 66979, + 66980, 66981, 66982, 66983, 66984, 66985, 66986, 66987, 66988, 66989, 66990, 66991, + 66992, 66993, 66995, 66996, 66997, 66998, 66999, 67000, 67001, 67003, 67004, 720, + 721, 665, 675, 43878, 677, 676, 7569, 600, 606, 681, 612, 610, 667, 668, 615, 644, + 682, 683, 122628, 42894, 622, 122629, 654, 122630, 630, 631, 634, 122632, 638, 680, + 678, 43879, 679, 11377, 655, 673, 674, 664, 448, 449, 450, 122634, 122654, 68800, + 68801, 68802, 68803, 68804, 68805, 68806, 68807, 68808, 68809, 68810, 68811, 68812, + 68813, 68814, 68815, 68816, 68817, 68818, 68819, 68820, 68821, 68822, 68823, 68824, + 68825, 68826, 68827, 68828, 68829, 68830, 68831, 68832, 68833, 68834, 68835, 68836, + 68837, 68838, 68839, 68840, 68841, 68842, 68843, 68844, 68845, 68846, 68847, 68848, + 68849, 68850, 71872, 71873, 71874, 71875, 71876, 71877, 71878, 71879, 71880, 71881, + 71882, 71883, 71884, 71885, 71886, 71887, 71888, 71889, 71890, 71891, 71892, 71893, + 71894, 71895, 71896, 71897, 71898, 71899, 71900, 71901, 71902, 71903, 93792, 93793, + 93794, 93795, 93796, 93797, 93798, 93799, 93800, 93801, 93802, 93803, 93804, 93805, + 93806, 93807, 93808, 93809, 93810, 93811, 93812, 93813, 93814, 93815, 93816, 93817, + 93818, 93819, 93820, 93821, 93822, 93823, 119127, 119141, 119128, 119141, 119128, + 119141, 119150, 119128, 119141, 119151, 119128, 119141, 119152, 119128, 119141, + 119153, 119128, 119141, 119154, 119225, 119141, 119226, 119141, 119225, 119141, + 119150, 119226, 119141, 119150, 119225, 119141, 119151, 119226, 119141, 119151, + 305, 567, 8711, 8706, 1231, 125218, 125219, 125220, 125221, 125222, 125223, 125224, + 125225, 125226, 125227, 125228, 125229, 125230, 125231, 125232, 125233, 125234, + 125235, 125236, 125237, 125238, 125239, 125240, 125241, 125242, 125243, 125244, + 125245, 125246, 125247, 125248, 125249, 125250, 125251, 1646, 1697, 1647, 48, 44, + 49, 44, 50, 44, 51, 44, 52, 44, 53, 44, 54, 44, 55, 44, 56, 44, 57, 44, 12308, 115, + 12309, 119, 122, 104, 118, 115, 100, 112, 112, 118, 119, 99, 109, 114, 100, 106, + 12411, 12363, 12467, 12467, 23383, 21452, 22810, 35299, 20132, 26144, 28961, 21069, + 24460, 20877, 26032, 21021, 32066, 36009, 22768, 21561, 28436, 25237, 25429, 36938, + 25351, 25171, 31105, 31354, 21512, 28288, 30003, 21106, 21942, 37197, 12308, 26412, + 12309, 12308, 19977, 12309, 12308, 20108, 12309, 12308, 23433, 12309, 12308, 28857, + 12309, 12308, 25171, 12309, 12308, 30423, 12309, 12308, 21213, 12309, 12308, 25943, + 12309, 24471, 21487, 20029, 20024, 20033, 131362, 20320, 20411, 20482, 20602, 20633, + 20687, 13470, 132666, 20820, 20836, 20855, 132380, 13497, 20839, 132427, 20887, + 20900, 20172, 20908, 168415, 20995, 13535, 21051, 21062, 21111, 13589, 21253, 21254, + 21321, 21338, 21363, 21373, 21375, 133676, 28784, 21450, 21471, 133987, 21483, 21489, + 21510, 21662, 21560, 21576, 21608, 21666, 21750, 21776, 21843, 21859, 21892, 21931, + 21939, 21954, 22294, 22295, 22097, 22132, 22766, 22478, 22516, 22541, 22411, 22578, + 22577, 22700, 136420, 22770, 22775, 22790, 22818, 22882, 136872, 136938, 23020, + 23067, 23079, 23000, 23142, 14062, 23304, 23358, 137672, 23491, 23512, 23539, 138008, + 23551, 23558, 14209, 23648, 23744, 23693, 138724, 23875, 138726, 23918, 23915, 23932, + 24033, 24034, 14383, 24061, 24104, 24125, 24169, 14434, 139651, 14460, 24240, 24243, + 24246, 172946, 140081, 33281, 24354, 14535, 144056, 156122, 24418, 24427, 14563, + 24474, 24525, 24535, 24569, 24705, 14650, 14620, 141012, 24775, 24904, 24908, 24954, + 25010, 24996, 25007, 25054, 25115, 25181, 25265, 25300, 25424, 142092, 25405, 25340, + 25448, 25475, 25572, 142321, 25634, 25541, 25513, 14894, 25705, 25726, 25757, 25719, + 14956, 25964, 143370, 26083, 26360, 26185, 15129, 15112, 15076, 20882, 20885, 26368, + 26268, 32941, 17369, 26401, 26462, 26451, 144323, 15177, 26618, 26501, 26706, 144493, + 26766, 26655, 26900, 26946, 27043, 27114, 27304, 145059, 27355, 15384, 27425, 145575, + 27476, 15438, 27506, 27551, 27579, 146061, 138507, 146170, 27726, 146620, 27839, + 27853, 27751, 27926, 27966, 28009, 28024, 28037, 146718, 27956, 28207, 28270, 15667, + 28359, 147153, 28153, 28526, 147294, 147342, 28614, 28729, 28699, 15766, 28746, + 28797, 28791, 28845, 132389, 28997, 148067, 29084, 29224, 29264, 149000, 29312, + 29333, 149301, 149524, 29562, 29579, 16044, 29605, 16056, 29767, 29788, 29829, 29898, + 16155, 29988, 150582, 30014, 150674, 139679, 30224, 151457, 151480, 151620, 16380, + 16392, 151795, 151794, 151833, 151859, 30494, 30495, 30603, 16454, 16534, 152605, + 30798, 16611, 153126, 153242, 153285, 31211, 16687, 31306, 31311, 153980, 154279, + 16898, 154539, 31686, 31689, 16935, 154752, 31954, 17056, 31976, 31971, 32000, 155526, + 32099, 17153, 32199, 32258, 32325, 17204, 156200, 156231, 17241, 156377, 32634, + 156478, 32661, 32762, 156890, 156963, 32864, 157096, 32880, 144223, 17365, 32946, + 33027, 17419, 33086, 23221, 157607, 157621, 144275, 144284, 33284, 36766, 17515, + 33425, 33419, 33437, 21171, 33457, 33459, 33469, 33510, 158524, 33565, 33635, 33709, + 33571, 33725, 33767, 33619, 33738, 33740, 33756, 158774, 159083, 158933, 17707, + 34033, 34035, 34070, 160714, 34148, 159532, 17757, 17761, 159665, 159954, 17771, + 34384, 34407, 34409, 34473, 34440, 34574, 34530, 34600, 34667, 34694, 34785, 34817, + 17913, 34912, 161383, 35031, 35038, 17973, 35066, 13499, 161966, 162150, 18110, + 18119, 35488, 162984, 36011, 36033, 36123, 36215, 163631, 133124, 36299, 36284, + 36336, 133342, 36564, 165330, 165357, 37012, 37105, 37137, 165678, 37147, 37432, + 37591, 37592, 37500, 37881, 37909, 166906, 38283, 18837, 38327, 167287, 18918, 38595, + 23986, 38691, 168261, 168474, 19054, 19062, 38880, 168970, 19122, 169110, 38953, + 169398, 39138, 19251, 39209, 39335, 39362, 39422, 19406, 170800, 40000, 40189, 19662, + 19693, 40295, 172238, 19704, 172293, 172558, 172689, 19798, 40702, 40709, 40719, + 40726, 173568, + +}; +const uint32_t table[8000][2] = +{ + {0, 1}, {65, 16777219}, {66, 16777475}, {67, 16777731}, + {68, 16777987}, {69, 16778243}, {70, 16778499}, {71, 16778755}, + {72, 16779011}, {73, 16779267}, {74, 16779523}, {75, 16779779}, + {76, 16780035}, {77, 16780291}, {78, 16780547}, {79, 16780803}, + {80, 16781059}, {81, 16781315}, {82, 16781571}, {83, 16781827}, + {84, 16782083}, {85, 16782339}, {86, 16782595}, {87, 16782851}, + {88, 16783107}, {89, 16783363}, {90, 16783619}, {91, 1}, + {128, 2}, {160, 16783875}, {161, 1}, {168, 33561347}, + {169, 1}, {170, 16777219}, {171, 1}, {173, 0}, + {174, 1}, {175, 33561859}, {176, 1}, {178, 16785155}, + {179, 16785411}, {180, 33562883}, {181, 16786179}, {182, 1}, + {184, 33563651}, {185, 16786947}, {186, 16780803}, {187, 1}, + {188, 50341635}, {189, 50342403}, {190, 50343171}, {191, 1}, + {192, 16789507}, {193, 16789763}, {194, 16790019}, {195, 16790275}, + {196, 16790531}, {197, 16790787}, {198, 16791043}, {199, 16791299}, + {200, 16791555}, {201, 16791811}, {202, 16792067}, {203, 16792323}, + {204, 16792579}, {205, 16792835}, {206, 16793091}, {207, 16793347}, + {208, 16793603}, {209, 16793859}, {210, 16794115}, {211, 16794371}, + {212, 16794627}, {213, 16794883}, {214, 16795139}, {215, 1}, + {216, 16795395}, {217, 16795651}, {218, 16795907}, {219, 16796163}, + {220, 16796419}, {221, 16796675}, {222, 16796931}, {223, 1}, + {256, 16797187}, {257, 1}, {258, 16797443}, {259, 1}, + {260, 16797699}, {261, 1}, {262, 16797955}, {263, 1}, + {264, 16798211}, {265, 1}, {266, 16798467}, {267, 1}, + {268, 16798723}, {269, 1}, {270, 16798979}, {271, 1}, + {272, 16799235}, {273, 1}, {274, 16799491}, {275, 1}, + {276, 16799747}, {277, 1}, {278, 16800003}, {279, 1}, + {280, 16800259}, {281, 1}, {282, 16800515}, {283, 1}, + {284, 16800771}, {285, 1}, {286, 16801027}, {287, 1}, + {288, 16801283}, {289, 1}, {290, 16801539}, {291, 1}, + {292, 16801795}, {293, 1}, {294, 16802051}, {295, 1}, + {296, 16802307}, {297, 1}, {298, 16802563}, {299, 1}, + {300, 16802819}, {301, 1}, {302, 16803075}, {303, 1}, + {304, 33580547}, {305, 1}, {306, 33556483}, {308, 16803843}, + {309, 1}, {310, 16804099}, {311, 1}, {313, 16804355}, + {314, 1}, {315, 16804611}, {316, 1}, {317, 16804867}, + {318, 1}, {319, 33582339}, {321, 16805635}, {322, 1}, + {323, 16805891}, {324, 1}, {325, 16806147}, {326, 1}, + {327, 16806403}, {328, 1}, {329, 33583875}, {330, 16807171}, + {331, 1}, {332, 16807427}, {333, 1}, {334, 16807683}, + {335, 1}, {336, 16807939}, {337, 1}, {338, 16808195}, + {339, 1}, {340, 16808451}, {341, 1}, {342, 16808707}, + {343, 1}, {344, 16808963}, {345, 1}, {346, 16809219}, + {347, 1}, {348, 16809475}, {349, 1}, {350, 16809731}, + {351, 1}, {352, 16809987}, {353, 1}, {354, 16810243}, + {355, 1}, {356, 16810499}, {357, 1}, {358, 16810755}, + {359, 1}, {360, 16811011}, {361, 1}, {362, 16811267}, + {363, 1}, {364, 16811523}, {365, 1}, {366, 16811779}, + {367, 1}, {368, 16812035}, {369, 1}, {370, 16812291}, + {371, 1}, {372, 16812547}, {373, 1}, {374, 16812803}, + {375, 1}, {376, 16813059}, {377, 16813315}, {378, 1}, + {379, 16813571}, {380, 1}, {381, 16813827}, {382, 1}, + {383, 16781827}, {384, 1}, {385, 16814083}, {386, 16814339}, + {387, 1}, {388, 16814595}, {389, 1}, {390, 16814851}, + {391, 16815107}, {392, 1}, {393, 16815363}, {394, 16815619}, + {395, 16815875}, {396, 1}, {398, 16816131}, {399, 16816387}, + {400, 16816643}, {401, 16816899}, {402, 1}, {403, 16817155}, + {404, 16817411}, {405, 1}, {406, 16817667}, {407, 16817923}, + {408, 16818179}, {409, 1}, {412, 16818435}, {413, 16818691}, + {414, 1}, {415, 16818947}, {416, 16819203}, {417, 1}, + {418, 16819459}, {419, 1}, {420, 16819715}, {421, 1}, + {422, 16819971}, {423, 16820227}, {424, 1}, {425, 16820483}, + {426, 1}, {428, 16820739}, {429, 1}, {430, 16820995}, + {431, 16821251}, {432, 1}, {433, 16821507}, {434, 16821763}, + {435, 16822019}, {436, 1}, {437, 16822275}, {438, 1}, + {439, 16822531}, {440, 16822787}, {441, 1}, {444, 16823043}, + {445, 1}, {452, 33600515}, {455, 33601027}, {458, 33601539}, + {461, 16824835}, {462, 1}, {463, 16825091}, {464, 1}, + {465, 16825347}, {466, 1}, {467, 16825603}, {468, 1}, + {469, 16825859}, {470, 1}, {471, 16826115}, {472, 1}, + {473, 16826371}, {474, 1}, {475, 16826627}, {476, 1}, + {478, 16826883}, {479, 1}, {480, 16827139}, {481, 1}, + {482, 16827395}, {483, 1}, {484, 16827651}, {485, 1}, + {486, 16827907}, {487, 1}, {488, 16828163}, {489, 1}, + {490, 16828419}, {491, 1}, {492, 16828675}, {493, 1}, + {494, 16828931}, {495, 1}, {497, 33606403}, {500, 16829699}, + {501, 1}, {502, 16829955}, {503, 16830211}, {504, 16830467}, + {505, 1}, {506, 16830723}, {507, 1}, {508, 16830979}, + {509, 1}, {510, 16831235}, {511, 1}, {512, 16831491}, + {513, 1}, {514, 16831747}, {515, 1}, {516, 16832003}, + {517, 1}, {518, 16832259}, {519, 1}, {520, 16832515}, + {521, 1}, {522, 16832771}, {523, 1}, {524, 16833027}, + {525, 1}, {526, 16833283}, {527, 1}, {528, 16833539}, + {529, 1}, {530, 16833795}, {531, 1}, {532, 16834051}, + {533, 1}, {534, 16834307}, {535, 1}, {536, 16834563}, + {537, 1}, {538, 16834819}, {539, 1}, {540, 16835075}, + {541, 1}, {542, 16835331}, {543, 1}, {544, 16835587}, + {545, 1}, {546, 16835843}, {547, 1}, {548, 16836099}, + {549, 1}, {550, 16836355}, {551, 1}, {552, 16836611}, + {553, 1}, {554, 16836867}, {555, 1}, {556, 16837123}, + {557, 1}, {558, 16837379}, {559, 1}, {560, 16837635}, + {561, 1}, {562, 16837891}, {563, 1}, {570, 16838147}, + {571, 16838403}, {572, 1}, {573, 16838659}, {574, 16838915}, + {575, 1}, {577, 16839171}, {578, 1}, {579, 16839427}, + {580, 16839683}, {581, 16839939}, {582, 16840195}, {583, 1}, + {584, 16840451}, {585, 1}, {586, 16840707}, {587, 1}, + {588, 16840963}, {589, 1}, {590, 16841219}, {591, 1}, + {688, 16779011}, {689, 16841475}, {690, 16779523}, {691, 16781571}, + {692, 16841731}, {693, 16841987}, {694, 16842243}, {695, 16782851}, + {696, 16783363}, {697, 1}, {728, 33619715}, {729, 33620227}, + {730, 33620739}, {731, 33621251}, {732, 33621763}, {733, 33622275}, + {734, 1}, {736, 16817411}, {737, 16780035}, {738, 16781827}, + {739, 16783107}, {740, 16845571}, {741, 1}, {832, 16845827}, + {833, 16785923}, {834, 1}, {835, 16846083}, {836, 33623555}, + {837, 16846851}, {838, 1}, {847, 0}, {848, 1}, + {880, 16847107}, {881, 1}, {882, 16847363}, {883, 1}, + {884, 16847619}, {885, 1}, {886, 16847875}, {887, 1}, + {888, 2}, {890, 33625347}, {891, 1}, {894, 16848643}, + {895, 16848899}, {896, 2}, {900, 33562883}, {901, 50403587}, + {902, 16849923}, {903, 16805379}, {904, 16850179}, {905, 16850435}, + {906, 16850691}, {907, 2}, {908, 16850947}, {909, 2}, + {910, 16851203}, {911, 16851459}, {912, 1}, {913, 16851715}, + {914, 16851971}, {915, 16852227}, {916, 16852483}, {917, 16852739}, + {918, 16852995}, {919, 16853251}, {920, 16853507}, {921, 16846851}, + {922, 16853763}, {923, 16854019}, {924, 16786179}, {925, 16854275}, + {926, 16854531}, {927, 16854787}, {928, 16855043}, {929, 16855299}, + {930, 2}, {931, 16855555}, {932, 16855811}, {933, 16856067}, + {934, 16856323}, {935, 16856579}, {936, 16856835}, {937, 16857091}, + {938, 16857347}, {939, 16857603}, {940, 1}, {975, 16857859}, + {976, 16851971}, {977, 16853507}, {978, 16856067}, {979, 16851203}, + {980, 16857603}, {981, 16856323}, {982, 16855043}, {983, 1}, + {984, 16858115}, {985, 1}, {986, 16858371}, {987, 1}, + {988, 16858627}, {989, 1}, {990, 16858883}, {991, 1}, + {992, 16859139}, {993, 1}, {994, 16859395}, {995, 1}, + {996, 16859651}, {997, 1}, {998, 16859907}, {999, 1}, + {1000, 16860163}, {1001, 1}, {1002, 16860419}, {1003, 1}, + {1004, 16860675}, {1005, 1}, {1006, 16860931}, {1007, 1}, + {1008, 16853763}, {1009, 16855299}, {1010, 16855555}, {1011, 1}, + {1012, 16853507}, {1013, 16852739}, {1014, 1}, {1015, 16861187}, + {1016, 1}, {1017, 16855555}, {1018, 16861443}, {1019, 1}, + {1021, 16861699}, {1022, 16861955}, {1023, 16862211}, {1024, 16862467}, + {1025, 16862723}, {1026, 16862979}, {1027, 16863235}, {1028, 16863491}, + {1029, 16863747}, {1030, 16864003}, {1031, 16864259}, {1032, 16864515}, + {1033, 16864771}, {1034, 16865027}, {1035, 16865283}, {1036, 16865539}, + {1037, 16865795}, {1038, 16866051}, {1039, 16866307}, {1040, 16866563}, + {1041, 16866819}, {1042, 16867075}, {1043, 16867331}, {1044, 16867587}, + {1045, 16867843}, {1046, 16868099}, {1047, 16868355}, {1048, 16868611}, + {1049, 16868867}, {1050, 16869123}, {1051, 16869379}, {1052, 16869635}, + {1053, 16869891}, {1054, 16870147}, {1055, 16870403}, {1056, 16870659}, + {1057, 16870915}, {1058, 16871171}, {1059, 16871427}, {1060, 16871683}, + {1061, 16871939}, {1062, 16872195}, {1063, 16872451}, {1064, 16872707}, + {1065, 16872963}, {1066, 16873219}, {1067, 16873475}, {1068, 16873731}, + {1069, 16873987}, {1070, 16874243}, {1071, 16874499}, {1072, 1}, + {1120, 16874755}, {1121, 1}, {1122, 16875011}, {1123, 1}, + {1124, 16875267}, {1125, 1}, {1126, 16875523}, {1127, 1}, + {1128, 16875779}, {1129, 1}, {1130, 16876035}, {1131, 1}, + {1132, 16876291}, {1133, 1}, {1134, 16876547}, {1135, 1}, + {1136, 16876803}, {1137, 1}, {1138, 16877059}, {1139, 1}, + {1140, 16877315}, {1141, 1}, {1142, 16877571}, {1143, 1}, + {1144, 16877827}, {1145, 1}, {1146, 16878083}, {1147, 1}, + {1148, 16878339}, {1149, 1}, {1150, 16878595}, {1151, 1}, + {1152, 16878851}, {1153, 1}, {1162, 16879107}, {1163, 1}, + {1164, 16879363}, {1165, 1}, {1166, 16879619}, {1167, 1}, + {1168, 16879875}, {1169, 1}, {1170, 16880131}, {1171, 1}, + {1172, 16880387}, {1173, 1}, {1174, 16880643}, {1175, 1}, + {1176, 16880899}, {1177, 1}, {1178, 16881155}, {1179, 1}, + {1180, 16881411}, {1181, 1}, {1182, 16881667}, {1183, 1}, + {1184, 16881923}, {1185, 1}, {1186, 16882179}, {1187, 1}, + {1188, 16882435}, {1189, 1}, {1190, 16882691}, {1191, 1}, + {1192, 16882947}, {1193, 1}, {1194, 16883203}, {1195, 1}, + {1196, 16883459}, {1197, 1}, {1198, 16883715}, {1199, 1}, + {1200, 16883971}, {1201, 1}, {1202, 16884227}, {1203, 1}, + {1204, 16884483}, {1205, 1}, {1206, 16884739}, {1207, 1}, + {1208, 16884995}, {1209, 1}, {1210, 16885251}, {1211, 1}, + {1212, 16885507}, {1213, 1}, {1214, 16885763}, {1215, 1}, + {1216, 2}, {1217, 16886019}, {1218, 1}, {1219, 16886275}, + {1220, 1}, {1221, 16886531}, {1222, 1}, {1223, 16886787}, + {1224, 1}, {1225, 16887043}, {1226, 1}, {1227, 16887299}, + {1228, 1}, {1229, 16887555}, {1230, 1}, {1232, 16887811}, + {1233, 1}, {1234, 16888067}, {1235, 1}, {1236, 16888323}, + {1237, 1}, {1238, 16888579}, {1239, 1}, {1240, 16888835}, + {1241, 1}, {1242, 16889091}, {1243, 1}, {1244, 16889347}, + {1245, 1}, {1246, 16889603}, {1247, 1}, {1248, 16889859}, + {1249, 1}, {1250, 16890115}, {1251, 1}, {1252, 16890371}, + {1253, 1}, {1254, 16890627}, {1255, 1}, {1256, 16890883}, + {1257, 1}, {1258, 16891139}, {1259, 1}, {1260, 16891395}, + {1261, 1}, {1262, 16891651}, {1263, 1}, {1264, 16891907}, + {1265, 1}, {1266, 16892163}, {1267, 1}, {1268, 16892419}, + {1269, 1}, {1270, 16892675}, {1271, 1}, {1272, 16892931}, + {1273, 1}, {1274, 16893187}, {1275, 1}, {1276, 16893443}, + {1277, 1}, {1278, 16893699}, {1279, 1}, {1280, 16893955}, + {1281, 1}, {1282, 16894211}, {1283, 1}, {1284, 16894467}, + {1285, 1}, {1286, 16894723}, {1287, 1}, {1288, 16894979}, + {1289, 1}, {1290, 16895235}, {1291, 1}, {1292, 16895491}, + {1293, 1}, {1294, 16895747}, {1295, 1}, {1296, 16896003}, + {1297, 1}, {1298, 16896259}, {1299, 1}, {1300, 16896515}, + {1301, 1}, {1302, 16896771}, {1303, 1}, {1304, 16897027}, + {1305, 1}, {1306, 16897283}, {1307, 1}, {1308, 16897539}, + {1309, 1}, {1310, 16897795}, {1311, 1}, {1312, 16898051}, + {1313, 1}, {1314, 16898307}, {1315, 1}, {1316, 16898563}, + {1317, 1}, {1318, 16898819}, {1319, 1}, {1320, 16899075}, + {1321, 1}, {1322, 16899331}, {1323, 1}, {1324, 16899587}, + {1325, 1}, {1326, 16899843}, {1327, 1}, {1328, 2}, + {1329, 16900099}, {1330, 16900355}, {1331, 16900611}, {1332, 16900867}, + {1333, 16901123}, {1334, 16901379}, {1335, 16901635}, {1336, 16901891}, + {1337, 16902147}, {1338, 16902403}, {1339, 16902659}, {1340, 16902915}, + {1341, 16903171}, {1342, 16903427}, {1343, 16903683}, {1344, 16903939}, + {1345, 16904195}, {1346, 16904451}, {1347, 16904707}, {1348, 16904963}, + {1349, 16905219}, {1350, 16905475}, {1351, 16905731}, {1352, 16905987}, + {1353, 16906243}, {1354, 16906499}, {1355, 16906755}, {1356, 16907011}, + {1357, 16907267}, {1358, 16907523}, {1359, 16907779}, {1360, 16908035}, + {1361, 16908291}, {1362, 16908547}, {1363, 16908803}, {1364, 16909059}, + {1365, 16909315}, {1366, 16909571}, {1367, 2}, {1369, 1}, + {1415, 33687043}, {1416, 1}, {1419, 2}, {1421, 1}, + {1424, 2}, {1425, 1}, {1480, 2}, {1488, 1}, + {1515, 2}, {1519, 1}, {1525, 2}, {1542, 1}, + {1564, 2}, {1565, 1}, {1653, 33687555}, {1654, 33688067}, + {1655, 33688579}, {1656, 33689091}, {1657, 1}, {1757, 2}, + {1758, 1}, {1806, 2}, {1808, 1}, {1867, 2}, + {1869, 1}, {1970, 2}, {1984, 1}, {2043, 2}, + {2045, 1}, {2094, 2}, {2096, 1}, {2111, 2}, + {2112, 1}, {2140, 2}, {2142, 1}, {2143, 2}, + {2144, 1}, {2155, 2}, {2160, 1}, {2191, 2}, + {2200, 1}, {2274, 2}, {2275, 1}, {2392, 33689603}, + {2393, 33690115}, {2394, 33690627}, {2395, 33691139}, {2396, 33691651}, + {2397, 33692163}, {2398, 33692675}, {2399, 33693187}, {2400, 1}, + {2436, 2}, {2437, 1}, {2445, 2}, {2447, 1}, + {2449, 2}, {2451, 1}, {2473, 2}, {2474, 1}, + {2481, 2}, {2482, 1}, {2483, 2}, {2486, 1}, + {2490, 2}, {2492, 1}, {2501, 2}, {2503, 1}, + {2505, 2}, {2507, 1}, {2511, 2}, {2519, 1}, + {2520, 2}, {2524, 33693699}, {2525, 33694211}, {2526, 2}, + {2527, 33694723}, {2528, 1}, {2532, 2}, {2534, 1}, + {2559, 2}, {2561, 1}, {2564, 2}, {2565, 1}, + {2571, 2}, {2575, 1}, {2577, 2}, {2579, 1}, + {2601, 2}, {2602, 1}, {2609, 2}, {2610, 1}, + {2611, 33695235}, {2612, 2}, {2613, 1}, {2614, 33695747}, + {2615, 2}, {2616, 1}, {2618, 2}, {2620, 1}, + {2621, 2}, {2622, 1}, {2627, 2}, {2631, 1}, + {2633, 2}, {2635, 1}, {2638, 2}, {2641, 1}, + {2642, 2}, {2649, 33696259}, {2650, 33696771}, {2651, 33697283}, + {2652, 1}, {2653, 2}, {2654, 33697795}, {2655, 2}, + {2662, 1}, {2679, 2}, {2689, 1}, {2692, 2}, + {2693, 1}, {2702, 2}, {2703, 1}, {2706, 2}, + {2707, 1}, {2729, 2}, {2730, 1}, {2737, 2}, + {2738, 1}, {2740, 2}, {2741, 1}, {2746, 2}, + {2748, 1}, {2758, 2}, {2759, 1}, {2762, 2}, + {2763, 1}, {2766, 2}, {2768, 1}, {2769, 2}, + {2784, 1}, {2788, 2}, {2790, 1}, {2802, 2}, + {2809, 1}, {2816, 2}, {2817, 1}, {2820, 2}, + {2821, 1}, {2829, 2}, {2831, 1}, {2833, 2}, + {2835, 1}, {2857, 2}, {2858, 1}, {2865, 2}, + {2866, 1}, {2868, 2}, {2869, 1}, {2874, 2}, + {2876, 1}, {2885, 2}, {2887, 1}, {2889, 2}, + {2891, 1}, {2894, 2}, {2901, 1}, {2904, 2}, + {2908, 33698307}, {2909, 33698819}, {2910, 2}, {2911, 1}, + {2916, 2}, {2918, 1}, {2936, 2}, {2946, 1}, + {2948, 2}, {2949, 1}, {2955, 2}, {2958, 1}, + {2961, 2}, {2962, 1}, {2966, 2}, {2969, 1}, + {2971, 2}, {2972, 1}, {2973, 2}, {2974, 1}, + {2976, 2}, {2979, 1}, {2981, 2}, {2984, 1}, + {2987, 2}, {2990, 1}, {3002, 2}, {3006, 1}, + {3011, 2}, {3014, 1}, {3017, 2}, {3018, 1}, + {3022, 2}, {3024, 1}, {3025, 2}, {3031, 1}, + {3032, 2}, {3046, 1}, {3067, 2}, {3072, 1}, + {3085, 2}, {3086, 1}, {3089, 2}, {3090, 1}, + {3113, 2}, {3114, 1}, {3130, 2}, {3132, 1}, + {3141, 2}, {3142, 1}, {3145, 2}, {3146, 1}, + {3150, 2}, {3157, 1}, {3159, 2}, {3160, 1}, + {3163, 2}, {3165, 1}, {3166, 2}, {3168, 1}, + {3172, 2}, {3174, 1}, {3184, 2}, {3191, 1}, + {3213, 2}, {3214, 1}, {3217, 2}, {3218, 1}, + {3241, 2}, {3242, 1}, {3252, 2}, {3253, 1}, + {3258, 2}, {3260, 1}, {3269, 2}, {3270, 1}, + {3273, 2}, {3274, 1}, {3278, 2}, {3285, 1}, + {3287, 2}, {3293, 1}, {3295, 2}, {3296, 1}, + {3300, 2}, {3302, 1}, {3312, 2}, {3313, 1}, + {3316, 2}, {3328, 1}, {3341, 2}, {3342, 1}, + {3345, 2}, {3346, 1}, {3397, 2}, {3398, 1}, + {3401, 2}, {3402, 1}, {3408, 2}, {3412, 1}, + {3428, 2}, {3430, 1}, {3456, 2}, {3457, 1}, + {3460, 2}, {3461, 1}, {3479, 2}, {3482, 1}, + {3506, 2}, {3507, 1}, {3516, 2}, {3517, 1}, + {3518, 2}, {3520, 1}, {3527, 2}, {3530, 1}, + {3531, 2}, {3535, 1}, {3541, 2}, {3542, 1}, + {3543, 2}, {3544, 1}, {3552, 2}, {3558, 1}, + {3568, 2}, {3570, 1}, {3573, 2}, {3585, 1}, + {3635, 33699331}, {3636, 1}, {3643, 2}, {3647, 1}, + {3676, 2}, {3713, 1}, {3715, 2}, {3716, 1}, + {3717, 2}, {3718, 1}, {3723, 2}, {3724, 1}, + {3748, 2}, {3749, 1}, {3750, 2}, {3751, 1}, + {3763, 33699843}, {3764, 1}, {3774, 2}, {3776, 1}, + {3781, 2}, {3782, 1}, {3783, 2}, {3784, 1}, + {3791, 2}, {3792, 1}, {3802, 2}, {3804, 33700355}, + {3805, 33700867}, {3806, 1}, {3808, 2}, {3840, 1}, + {3852, 16924163}, {3853, 1}, {3907, 33701635}, {3908, 1}, + {3912, 2}, {3913, 1}, {3917, 33702147}, {3918, 1}, + {3922, 33702659}, {3923, 1}, {3927, 33703171}, {3928, 1}, + {3932, 33703683}, {3933, 1}, {3945, 33704195}, {3946, 1}, + {3949, 2}, {3953, 1}, {3955, 33704707}, {3956, 1}, + {3957, 33705219}, {3958, 33705731}, {3959, 50483459}, {3960, 33707011}, + {3961, 50484739}, {3962, 1}, {3969, 33706499}, {3970, 1}, + {3987, 33708291}, {3988, 1}, {3992, 2}, {3993, 1}, + {3997, 33708803}, {3998, 1}, {4002, 33709315}, {4003, 1}, + {4007, 33709827}, {4008, 1}, {4012, 33710339}, {4013, 1}, + {4025, 33710851}, {4026, 1}, {4029, 2}, {4030, 1}, + {4045, 2}, {4046, 1}, {4059, 2}, {4096, 1}, + {4256, 2}, {4295, 16934147}, {4296, 2}, {4301, 16934403}, + {4302, 2}, {4304, 1}, {4348, 16934659}, {4349, 1}, + {4447, 2}, {4449, 1}, {4681, 2}, {4682, 1}, + {4686, 2}, {4688, 1}, {4695, 2}, {4696, 1}, + {4697, 2}, {4698, 1}, {4702, 2}, {4704, 1}, + {4745, 2}, {4746, 1}, {4750, 2}, {4752, 1}, + {4785, 2}, {4786, 1}, {4790, 2}, {4792, 1}, + {4799, 2}, {4800, 1}, {4801, 2}, {4802, 1}, + {4806, 2}, {4808, 1}, {4823, 2}, {4824, 1}, + {4881, 2}, {4882, 1}, {4886, 2}, {4888, 1}, + {4955, 2}, {4957, 1}, {4989, 2}, {4992, 1}, + {5018, 2}, {5024, 1}, {5110, 2}, {5112, 16934915}, + {5113, 16935171}, {5114, 16935427}, {5115, 16935683}, {5116, 16935939}, + {5117, 16936195}, {5118, 2}, {5120, 1}, {5760, 2}, + {5761, 1}, {5789, 2}, {5792, 1}, {5881, 2}, + {5888, 1}, {5910, 2}, {5919, 1}, {5943, 2}, + {5952, 1}, {5972, 2}, {5984, 1}, {5997, 2}, + {5998, 1}, {6001, 2}, {6002, 1}, {6004, 2}, + {6016, 1}, {6068, 2}, {6070, 1}, {6110, 2}, + {6112, 1}, {6122, 2}, {6128, 1}, {6138, 2}, + {6144, 1}, {6150, 2}, {6151, 1}, {6155, 0}, + {6158, 2}, {6159, 0}, {6160, 1}, {6170, 2}, + {6176, 1}, {6265, 2}, {6272, 1}, {6315, 2}, + {6320, 1}, {6390, 2}, {6400, 1}, {6431, 2}, + {6432, 1}, {6444, 2}, {6448, 1}, {6460, 2}, + {6464, 1}, {6465, 2}, {6468, 1}, {6510, 2}, + {6512, 1}, {6517, 2}, {6528, 1}, {6572, 2}, + {6576, 1}, {6602, 2}, {6608, 1}, {6619, 2}, + {6622, 1}, {6684, 2}, {6686, 1}, {6751, 2}, + {6752, 1}, {6781, 2}, {6783, 1}, {6794, 2}, + {6800, 1}, {6810, 2}, {6816, 1}, {6830, 2}, + {6832, 1}, {6863, 2}, {6912, 1}, {6989, 2}, + {6992, 1}, {7039, 2}, {7040, 1}, {7156, 2}, + {7164, 1}, {7224, 2}, {7227, 1}, {7242, 2}, + {7245, 1}, {7296, 16867075}, {7297, 16867587}, {7298, 16870147}, + {7299, 16870915}, {7300, 16871171}, {7302, 16873219}, {7303, 16875011}, + {7304, 16936451}, {7305, 2}, {7312, 16936707}, {7313, 16936963}, + {7314, 16937219}, {7315, 16937475}, {7316, 16937731}, {7317, 16937987}, + {7318, 16938243}, {7319, 16938499}, {7320, 16938755}, {7321, 16939011}, + {7322, 16939267}, {7323, 16939523}, {7324, 16934659}, {7325, 16939779}, + {7326, 16940035}, {7327, 16940291}, {7328, 16940547}, {7329, 16940803}, + {7330, 16941059}, {7331, 16941315}, {7332, 16941571}, {7333, 16941827}, + {7334, 16942083}, {7335, 16942339}, {7336, 16942595}, {7337, 16942851}, + {7338, 16943107}, {7339, 16943363}, {7340, 16943619}, {7341, 16943875}, + {7342, 16944131}, {7343, 16944387}, {7344, 16944643}, {7345, 16944899}, + {7346, 16945155}, {7347, 16945411}, {7348, 16945667}, {7349, 16945923}, + {7350, 16946179}, {7351, 16946435}, {7352, 16946691}, {7353, 16946947}, + {7354, 16947203}, {7355, 2}, {7357, 16947459}, {7358, 16947715}, + {7359, 16947971}, {7360, 1}, {7368, 2}, {7376, 1}, + {7419, 2}, {7424, 1}, {7468, 16777219}, {7469, 16791043}, + {7470, 16777475}, {7471, 1}, {7472, 16777987}, {7473, 16778243}, + {7474, 16816131}, {7475, 16778755}, {7476, 16779011}, {7477, 16779267}, + {7478, 16779523}, {7479, 16779779}, {7480, 16780035}, {7481, 16780291}, + {7482, 16780547}, {7483, 1}, {7484, 16780803}, {7485, 16835843}, + {7486, 16781059}, {7487, 16781571}, {7488, 16782083}, {7489, 16782339}, + {7490, 16782851}, {7491, 16777219}, {7492, 16948227}, {7493, 16948483}, + {7494, 16948739}, {7495, 16777475}, {7496, 16777987}, {7497, 16778243}, + {7498, 16816387}, {7499, 16816643}, {7500, 16948995}, {7501, 16778755}, + {7502, 1}, {7503, 16779779}, {7504, 16780291}, {7505, 16807171}, + {7506, 16780803}, {7507, 16814851}, {7508, 16949251}, {7509, 16949507}, + {7510, 16781059}, {7511, 16782083}, {7512, 16782339}, {7513, 16949763}, + {7514, 16818435}, {7515, 16782595}, {7516, 16950019}, {7517, 16851971}, + {7518, 16852227}, {7519, 16852483}, {7520, 16856323}, {7521, 16856579}, + {7522, 16779267}, {7523, 16781571}, {7524, 16782339}, {7525, 16782595}, + {7526, 16851971}, {7527, 16852227}, {7528, 16855299}, {7529, 16856323}, + {7530, 16856579}, {7531, 1}, {7544, 16869891}, {7545, 1}, + {7579, 16950275}, {7580, 16777731}, {7581, 16950531}, {7582, 16793603}, + {7583, 16948995}, {7584, 16778499}, {7585, 16950787}, {7586, 16951043}, + {7587, 16951299}, {7588, 16817923}, {7589, 16817667}, {7590, 16951555}, + {7591, 16951811}, {7592, 16952067}, {7593, 16952323}, {7594, 16952579}, + {7595, 16952835}, {7596, 16953091}, {7597, 16953347}, {7598, 16818691}, + {7599, 16953603}, {7600, 16953859}, {7601, 16818947}, {7602, 16954115}, + {7603, 16954371}, {7604, 16820483}, {7605, 16954627}, {7606, 16839683}, + {7607, 16821507}, {7608, 16954883}, {7609, 16821763}, {7610, 16839939}, + {7611, 16783619}, {7612, 16955139}, {7613, 16955395}, {7614, 16822531}, + {7615, 16853507}, {7616, 1}, {7680, 16955651}, {7681, 1}, + {7682, 16955907}, {7683, 1}, {7684, 16956163}, {7685, 1}, + {7686, 16956419}, {7687, 1}, {7688, 16956675}, {7689, 1}, + {7690, 16956931}, {7691, 1}, {7692, 16957187}, {7693, 1}, + {7694, 16957443}, {7695, 1}, {7696, 16957699}, {7697, 1}, + {7698, 16957955}, {7699, 1}, {7700, 16958211}, {7701, 1}, + {7702, 16958467}, {7703, 1}, {7704, 16958723}, {7705, 1}, + {7706, 16958979}, {7707, 1}, {7708, 16959235}, {7709, 1}, + {7710, 16959491}, {7711, 1}, {7712, 16959747}, {7713, 1}, + {7714, 16960003}, {7715, 1}, {7716, 16960259}, {7717, 1}, + {7718, 16960515}, {7719, 1}, {7720, 16960771}, {7721, 1}, + {7722, 16961027}, {7723, 1}, {7724, 16961283}, {7725, 1}, + {7726, 16961539}, {7727, 1}, {7728, 16961795}, {7729, 1}, + {7730, 16962051}, {7731, 1}, {7732, 16962307}, {7733, 1}, + {7734, 16962563}, {7735, 1}, {7736, 16962819}, {7737, 1}, + {7738, 16963075}, {7739, 1}, {7740, 16963331}, {7741, 1}, + {7742, 16963587}, {7743, 1}, {7744, 16963843}, {7745, 1}, + {7746, 16964099}, {7747, 1}, {7748, 16964355}, {7749, 1}, + {7750, 16964611}, {7751, 1}, {7752, 16964867}, {7753, 1}, + {7754, 16965123}, {7755, 1}, {7756, 16965379}, {7757, 1}, + {7758, 16965635}, {7759, 1}, {7760, 16965891}, {7761, 1}, + {7762, 16966147}, {7763, 1}, {7764, 16966403}, {7765, 1}, + {7766, 16966659}, {7767, 1}, {7768, 16966915}, {7769, 1}, + {7770, 16967171}, {7771, 1}, {7772, 16967427}, {7773, 1}, + {7774, 16967683}, {7775, 1}, {7776, 16967939}, {7777, 1}, + {7778, 16968195}, {7779, 1}, {7780, 16968451}, {7781, 1}, + {7782, 16968707}, {7783, 1}, {7784, 16968963}, {7785, 1}, + {7786, 16969219}, {7787, 1}, {7788, 16969475}, {7789, 1}, + {7790, 16969731}, {7791, 1}, {7792, 16969987}, {7793, 1}, + {7794, 16970243}, {7795, 1}, {7796, 16970499}, {7797, 1}, + {7798, 16970755}, {7799, 1}, {7800, 16971011}, {7801, 1}, + {7802, 16971267}, {7803, 1}, {7804, 16971523}, {7805, 1}, + {7806, 16971779}, {7807, 1}, {7808, 16972035}, {7809, 1}, + {7810, 16972291}, {7811, 1}, {7812, 16972547}, {7813, 1}, + {7814, 16972803}, {7815, 1}, {7816, 16973059}, {7817, 1}, + {7818, 16973315}, {7819, 1}, {7820, 16973571}, {7821, 1}, + {7822, 16973827}, {7823, 1}, {7824, 16974083}, {7825, 1}, + {7826, 16974339}, {7827, 1}, {7828, 16974595}, {7829, 1}, + {7834, 33752067}, {7835, 16967939}, {7836, 1}, {7838, 33752579}, + {7839, 1}, {7840, 16975875}, {7841, 1}, {7842, 16976131}, + {7843, 1}, {7844, 16976387}, {7845, 1}, {7846, 16976643}, + {7847, 1}, {7848, 16976899}, {7849, 1}, {7850, 16977155}, + {7851, 1}, {7852, 16977411}, {7853, 1}, {7854, 16977667}, + {7855, 1}, {7856, 16977923}, {7857, 1}, {7858, 16978179}, + {7859, 1}, {7860, 16978435}, {7861, 1}, {7862, 16978691}, + {7863, 1}, {7864, 16978947}, {7865, 1}, {7866, 16979203}, + {7867, 1}, {7868, 16979459}, {7869, 1}, {7870, 16979715}, + {7871, 1}, {7872, 16979971}, {7873, 1}, {7874, 16980227}, + {7875, 1}, {7876, 16980483}, {7877, 1}, {7878, 16980739}, + {7879, 1}, {7880, 16980995}, {7881, 1}, {7882, 16981251}, + {7883, 1}, {7884, 16981507}, {7885, 1}, {7886, 16981763}, + {7887, 1}, {7888, 16982019}, {7889, 1}, {7890, 16982275}, + {7891, 1}, {7892, 16982531}, {7893, 1}, {7894, 16982787}, + {7895, 1}, {7896, 16983043}, {7897, 1}, {7898, 16983299}, + {7899, 1}, {7900, 16983555}, {7901, 1}, {7902, 16983811}, + {7903, 1}, {7904, 16984067}, {7905, 1}, {7906, 16984323}, + {7907, 1}, {7908, 16984579}, {7909, 1}, {7910, 16984835}, + {7911, 1}, {7912, 16985091}, {7913, 1}, {7914, 16985347}, + {7915, 1}, {7916, 16985603}, {7917, 1}, {7918, 16985859}, + {7919, 1}, {7920, 16986115}, {7921, 1}, {7922, 16986371}, + {7923, 1}, {7924, 16986627}, {7925, 1}, {7926, 16986883}, + {7927, 1}, {7928, 16987139}, {7929, 1}, {7930, 16987395}, + {7931, 1}, {7932, 16987651}, {7933, 1}, {7934, 16987907}, + {7935, 1}, {7944, 16988163}, {7945, 16988419}, {7946, 16988675}, + {7947, 16988931}, {7948, 16989187}, {7949, 16989443}, {7950, 16989699}, + {7951, 16989955}, {7952, 1}, {7958, 2}, {7960, 16990211}, + {7961, 16990467}, {7962, 16990723}, {7963, 16990979}, {7964, 16991235}, + {7965, 16991491}, {7966, 2}, {7968, 1}, {7976, 16991747}, + {7977, 16992003}, {7978, 16992259}, {7979, 16992515}, {7980, 16992771}, + {7981, 16993027}, {7982, 16993283}, {7983, 16993539}, {7984, 1}, + {7992, 16993795}, {7993, 16994051}, {7994, 16994307}, {7995, 16994563}, + {7996, 16994819}, {7997, 16995075}, {7998, 16995331}, {7999, 16995587}, + {8000, 1}, {8006, 2}, {8008, 16995843}, {8009, 16996099}, + {8010, 16996355}, {8011, 16996611}, {8012, 16996867}, {8013, 16997123}, + {8014, 2}, {8016, 1}, {8024, 2}, {8025, 16997379}, + {8026, 2}, {8027, 16997635}, {8028, 2}, {8029, 16997891}, + {8030, 2}, {8031, 16998147}, {8032, 1}, {8040, 16998403}, + {8041, 16998659}, {8042, 16998915}, {8043, 16999171}, {8044, 16999427}, + {8045, 16999683}, {8046, 16999939}, {8047, 17000195}, {8048, 1}, + {8049, 16849923}, {8050, 1}, {8051, 16850179}, {8052, 1}, + {8053, 16850435}, {8054, 1}, {8055, 16850691}, {8056, 1}, + {8057, 16850947}, {8058, 1}, {8059, 16851203}, {8060, 1}, + {8061, 16851459}, {8062, 2}, {8064, 33777667}, {8065, 33778179}, + {8066, 33778691}, {8067, 33779203}, {8068, 33779715}, {8069, 33780227}, + {8070, 33780739}, {8071, 33781251}, {8072, 33777667}, {8073, 33778179}, + {8074, 33778691}, {8075, 33779203}, {8076, 33779715}, {8077, 33780227}, + {8078, 33780739}, {8079, 33781251}, {8080, 33781763}, {8081, 33782275}, + {8082, 33782787}, {8083, 33783299}, {8084, 33783811}, {8085, 33784323}, + {8086, 33784835}, {8087, 33785347}, {8088, 33781763}, {8089, 33782275}, + {8090, 33782787}, {8091, 33783299}, {8092, 33783811}, {8093, 33784323}, + {8094, 33784835}, {8095, 33785347}, {8096, 33785859}, {8097, 33786371}, + {8098, 33786883}, {8099, 33787395}, {8100, 33787907}, {8101, 33788419}, + {8102, 33788931}, {8103, 33789443}, {8104, 33785859}, {8105, 33786371}, + {8106, 33786883}, {8107, 33787395}, {8108, 33787907}, {8109, 33788419}, + {8110, 33788931}, {8111, 33789443}, {8112, 1}, {8114, 33789955}, + {8115, 33790467}, {8116, 33790979}, {8117, 2}, {8118, 1}, + {8119, 33791491}, {8120, 17014787}, {8121, 17015043}, {8122, 17012739}, + {8123, 16849923}, {8124, 33790467}, {8125, 33792515}, {8126, 16846851}, + {8127, 33792515}, {8128, 33793027}, {8129, 50570755}, {8130, 33794307}, + {8131, 33794819}, {8132, 33795331}, {8133, 2}, {8134, 1}, + {8135, 33795843}, {8136, 17019139}, {8137, 16850179}, {8138, 17017091}, + {8139, 16850435}, {8140, 33794819}, {8141, 50573827}, {8142, 50574595}, + {8143, 50575363}, {8144, 1}, {8147, 17021699}, {8148, 2}, + {8150, 1}, {8152, 17021955}, {8153, 17022211}, {8154, 17022467}, + {8155, 16850691}, {8156, 2}, {8157, 50577155}, {8158, 50577923}, + {8159, 50578691}, {8160, 1}, {8163, 17025027}, {8164, 1}, + {8168, 17025283}, {8169, 17025539}, {8170, 17025795}, {8171, 16851203}, + {8172, 17026051}, {8173, 50580739}, {8174, 50403587}, {8175, 17027075}, + {8176, 2}, {8178, 33804547}, {8179, 33805059}, {8180, 33805571}, + {8181, 2}, {8182, 1}, {8183, 33806083}, {8184, 17029379}, + {8185, 16850947}, {8186, 17027331}, {8187, 16851459}, {8188, 33805059}, + {8189, 33562883}, {8190, 33799939}, {8191, 2}, {8192, 16783875}, + {8203, 0}, {8204, 1}, {8206, 2}, {8208, 1}, + {8209, 17029635}, {8210, 1}, {8215, 33807107}, {8216, 1}, + {8228, 2}, {8231, 1}, {8232, 2}, {8239, 16783875}, + {8240, 1}, {8243, 33807619}, {8244, 50585347}, {8245, 1}, + {8246, 33808899}, {8247, 50586627}, {8248, 1}, {8252, 33810179}, + {8253, 1}, {8254, 33810691}, {8255, 1}, {8263, 33811203}, + {8264, 33811715}, {8265, 33812227}, {8266, 1}, {8279, 67362051}, + {8280, 1}, {8287, 16783875}, {8288, 0}, {8289, 2}, + {8292, 0}, {8293, 2}, {8304, 17035523}, {8305, 16779267}, + {8306, 2}, {8308, 16787715}, {8309, 17035779}, {8310, 17036035}, + {8311, 17036291}, {8312, 17036547}, {8313, 17036803}, {8314, 17037059}, + {8315, 17037315}, {8316, 17037571}, {8317, 17037827}, {8318, 17038083}, + {8319, 16780547}, {8320, 17035523}, {8321, 16786947}, {8322, 16785155}, + {8323, 16785411}, {8324, 16787715}, {8325, 17035779}, {8326, 17036035}, + {8327, 17036291}, {8328, 17036547}, {8329, 17036803}, {8330, 17037059}, + {8331, 17037315}, {8332, 17037571}, {8333, 17037827}, {8334, 17038083}, + {8335, 2}, {8336, 16777219}, {8337, 16778243}, {8338, 16780803}, + {8339, 16783107}, {8340, 16816387}, {8341, 16779011}, {8342, 16779779}, + {8343, 16780035}, {8344, 16780291}, {8345, 16780547}, {8346, 16781059}, + {8347, 16781827}, {8348, 16782083}, {8349, 2}, {8352, 1}, + {8360, 33558787}, {8361, 1}, {8385, 2}, {8400, 1}, + {8433, 2}, {8448, 50592771}, {8449, 50593539}, {8450, 16777731}, + {8451, 33817091}, {8452, 1}, {8453, 50594819}, {8454, 50595587}, + {8455, 16816643}, {8456, 1}, {8457, 33819139}, {8458, 16778755}, + {8459, 16779011}, {8463, 16802051}, {8464, 16779267}, {8466, 16780035}, + {8468, 1}, {8469, 16780547}, {8470, 33557763}, {8471, 1}, + {8473, 16781059}, {8474, 16781315}, {8475, 16781571}, {8478, 1}, + {8480, 33819651}, {8481, 50597379}, {8482, 33820931}, {8483, 1}, + {8484, 16783619}, {8485, 1}, {8486, 16857091}, {8487, 1}, + {8488, 16783619}, {8489, 1}, {8490, 16779779}, {8491, 16790787}, + {8492, 16777475}, {8493, 16777731}, {8494, 1}, {8495, 16778243}, + {8497, 16778499}, {8498, 2}, {8499, 16780291}, {8500, 16780803}, + {8501, 17044227}, {8502, 17044483}, {8503, 17044739}, {8504, 17044995}, + {8505, 16779267}, {8506, 1}, {8507, 50599683}, {8508, 16855043}, + {8509, 16852227}, {8511, 16855043}, {8512, 17046019}, {8513, 1}, + {8517, 16777987}, {8519, 16778243}, {8520, 16779267}, {8521, 16779523}, + {8522, 1}, {8528, 50600707}, {8529, 50601475}, {8530, 67379459}, + {8531, 50603267}, {8532, 50604035}, {8533, 50604803}, {8534, 50605571}, + {8535, 50606339}, {8536, 50607107}, {8537, 50607875}, {8538, 50608643}, + {8539, 50609411}, {8540, 50610179}, {8541, 50610947}, {8542, 50611715}, + {8543, 33564419}, {8544, 16779267}, {8545, 33835267}, {8546, 50612995}, + {8547, 33836547}, {8548, 16782595}, {8549, 33837059}, {8550, 50614787}, + {8551, 67392771}, {8552, 33839363}, {8553, 16783107}, {8554, 33839875}, + {8555, 50617603}, {8556, 16780035}, {8557, 16777731}, {8558, 16777987}, + {8559, 16780291}, {8560, 16779267}, {8561, 33835267}, {8562, 50612483}, + {8563, 33836547}, {8564, 16782595}, {8565, 33837059}, {8566, 50614787}, + {8567, 67392771}, {8568, 33839363}, {8569, 16783107}, {8570, 33839875}, + {8571, 50617603}, {8572, 16780035}, {8573, 16777731}, {8574, 16777987}, + {8575, 16780291}, {8576, 1}, {8579, 2}, {8580, 1}, + {8585, 50618371}, {8586, 1}, {8588, 2}, {8592, 1}, + {8748, 33841923}, {8749, 50619651}, {8750, 1}, {8751, 33843203}, + {8752, 50620931}, {8753, 1}, {9001, 17067267}, {9002, 17067523}, + {9003, 1}, {9255, 2}, {9280, 1}, {9291, 2}, + {9312, 16786947}, {9313, 16785155}, {9314, 16785411}, {9315, 16787715}, + {9316, 17035779}, {9317, 17036035}, {9318, 17036291}, {9319, 17036547}, + {9320, 17036803}, {9321, 33825539}, {9322, 33564163}, {9323, 33844995}, + {9324, 33845507}, {9325, 33846019}, {9326, 33846531}, {9327, 33847043}, + {9328, 33847555}, {9329, 33848067}, {9330, 33848579}, {9331, 33849091}, + {9332, 50626819}, {9333, 50627587}, {9334, 50628355}, {9335, 50629123}, + {9336, 50629891}, {9337, 50630659}, {9338, 50631427}, {9339, 50632195}, + {9340, 50632963}, {9341, 67410947}, {9342, 67411971}, {9343, 67412995}, + {9344, 67414019}, {9345, 67415043}, {9346, 67416067}, {9347, 67417091}, + {9348, 67418115}, {9349, 67419139}, {9350, 67420163}, {9351, 67421187}, + {9352, 2}, {9372, 50644995}, {9373, 50645763}, {9374, 50646531}, + {9375, 50647299}, {9376, 50648067}, {9377, 50648835}, {9378, 50649603}, + {9379, 50650371}, {9380, 50651139}, {9381, 50651907}, {9382, 50652675}, + {9383, 50653443}, {9384, 50654211}, {9385, 50654979}, {9386, 50655747}, + {9387, 50656515}, {9388, 50657283}, {9389, 50658051}, {9390, 50658819}, + {9391, 50659587}, {9392, 50660355}, {9393, 50661123}, {9394, 50661891}, + {9395, 50662659}, {9396, 50663427}, {9397, 50664195}, {9398, 16777219}, + {9399, 16777475}, {9400, 16777731}, {9401, 16777987}, {9402, 16778243}, + {9403, 16778499}, {9404, 16778755}, {9405, 16779011}, {9406, 16779267}, + {9407, 16779523}, {9408, 16779779}, {9409, 16780035}, {9410, 16780291}, + {9411, 16780547}, {9412, 16780803}, {9413, 16781059}, {9414, 16781315}, + {9415, 16781571}, {9416, 16781827}, {9417, 16782083}, {9418, 16782339}, + {9419, 16782595}, {9420, 16782851}, {9421, 16783107}, {9422, 16783363}, + {9423, 16783619}, {9424, 16777219}, {9425, 16777475}, {9426, 16777731}, + {9427, 16777987}, {9428, 16778243}, {9429, 16778499}, {9430, 16778755}, + {9431, 16779011}, {9432, 16779267}, {9433, 16779523}, {9434, 16779779}, + {9435, 16780035}, {9436, 16780291}, {9437, 16780547}, {9438, 16780803}, + {9439, 16781059}, {9440, 16781315}, {9441, 16781571}, {9442, 16781827}, + {9443, 16782083}, {9444, 16782339}, {9445, 16782595}, {9446, 16782851}, + {9447, 16783107}, {9448, 16783363}, {9449, 16783619}, {9450, 17035523}, + {9451, 1}, {10764, 67396355}, {10765, 1}, {10868, 50664963}, + {10869, 33888515}, {10870, 50665475}, {10871, 1}, {10972, 33889027}, + {10973, 1}, {11124, 2}, {11126, 1}, {11158, 2}, + {11159, 1}, {11264, 17112323}, {11265, 17112579}, {11266, 17112835}, + {11267, 17113091}, {11268, 17113347}, {11269, 17113603}, {11270, 17113859}, + {11271, 17114115}, {11272, 17114371}, {11273, 17114627}, {11274, 17114883}, + {11275, 17115139}, {11276, 17115395}, {11277, 17115651}, {11278, 17115907}, + {11279, 17116163}, {11280, 17116419}, {11281, 17116675}, {11282, 17116931}, + {11283, 17117187}, {11284, 17117443}, {11285, 17117699}, {11286, 17117955}, + {11287, 17118211}, {11288, 17118467}, {11289, 17118723}, {11290, 17118979}, + {11291, 17119235}, {11292, 17119491}, {11293, 17119747}, {11294, 17120003}, + {11295, 17120259}, {11296, 17120515}, {11297, 17120771}, {11298, 17121027}, + {11299, 17121283}, {11300, 17121539}, {11301, 17121795}, {11302, 17122051}, + {11303, 17122307}, {11304, 17122563}, {11305, 17122819}, {11306, 17123075}, + {11307, 17123331}, {11308, 17123587}, {11309, 17123843}, {11310, 17124099}, + {11311, 17124355}, {11312, 1}, {11360, 17124611}, {11361, 1}, + {11362, 17124867}, {11363, 17125123}, {11364, 17125379}, {11365, 1}, + {11367, 17125635}, {11368, 1}, {11369, 17125891}, {11370, 1}, + {11371, 17126147}, {11372, 1}, {11373, 16948483}, {11374, 16953091}, + {11375, 16948227}, {11376, 16950275}, {11377, 1}, {11378, 17126403}, + {11379, 1}, {11381, 17126659}, {11382, 1}, {11388, 16779523}, + {11389, 16782595}, {11390, 17126915}, {11391, 17127171}, {11392, 17127427}, + {11393, 1}, {11394, 17127683}, {11395, 1}, {11396, 17127939}, + {11397, 1}, {11398, 17128195}, {11399, 1}, {11400, 17128451}, + {11401, 1}, {11402, 17128707}, {11403, 1}, {11404, 17128963}, + {11405, 1}, {11406, 17129219}, {11407, 1}, {11408, 17129475}, + {11409, 1}, {11410, 17129731}, {11411, 1}, {11412, 17129987}, + {11413, 1}, {11414, 17130243}, {11415, 1}, {11416, 17130499}, + {11417, 1}, {11418, 17130755}, {11419, 1}, {11420, 17131011}, + {11421, 1}, {11422, 17131267}, {11423, 1}, {11424, 17131523}, + {11425, 1}, {11426, 17131779}, {11427, 1}, {11428, 17132035}, + {11429, 1}, {11430, 17132291}, {11431, 1}, {11432, 17132547}, + {11433, 1}, {11434, 17132803}, {11435, 1}, {11436, 17133059}, + {11437, 1}, {11438, 17133315}, {11439, 1}, {11440, 17133571}, + {11441, 1}, {11442, 17133827}, {11443, 1}, {11444, 17134083}, + {11445, 1}, {11446, 17134339}, {11447, 1}, {11448, 17134595}, + {11449, 1}, {11450, 17134851}, {11451, 1}, {11452, 17135107}, + {11453, 1}, {11454, 17135363}, {11455, 1}, {11456, 17135619}, + {11457, 1}, {11458, 17135875}, {11459, 1}, {11460, 17136131}, + {11461, 1}, {11462, 17136387}, {11463, 1}, {11464, 17136643}, + {11465, 1}, {11466, 17136899}, {11467, 1}, {11468, 17137155}, + {11469, 1}, {11470, 17137411}, {11471, 1}, {11472, 17137667}, + {11473, 1}, {11474, 17137923}, {11475, 1}, {11476, 17138179}, + {11477, 1}, {11478, 17138435}, {11479, 1}, {11480, 17138691}, + {11481, 1}, {11482, 17138947}, {11483, 1}, {11484, 17139203}, + {11485, 1}, {11486, 17139459}, {11487, 1}, {11488, 17139715}, + {11489, 1}, {11490, 17139971}, {11491, 1}, {11499, 17140227}, + {11500, 1}, {11501, 17140483}, {11502, 1}, {11506, 17140739}, + {11507, 1}, {11508, 2}, {11513, 1}, {11558, 2}, + {11559, 1}, {11560, 2}, {11565, 1}, {11566, 2}, + {11568, 1}, {11624, 2}, {11631, 17140995}, {11632, 1}, + {11633, 2}, {11647, 1}, {11671, 2}, {11680, 1}, + {11687, 2}, {11688, 1}, {11695, 2}, {11696, 1}, + {11703, 2}, {11704, 1}, {11711, 2}, {11712, 1}, + {11719, 2}, {11720, 1}, {11727, 2}, {11728, 1}, + {11735, 2}, {11736, 1}, {11743, 2}, {11744, 1}, + {11870, 2}, {11904, 1}, {11930, 2}, {11931, 1}, + {11935, 17141251}, {11936, 1}, {12019, 17141507}, {12020, 2}, + {12032, 17141763}, {12033, 17142019}, {12034, 17142275}, {12035, 17142531}, + {12036, 17142787}, {12037, 17143043}, {12038, 17143299}, {12039, 17143555}, + {12040, 17143811}, {12041, 17144067}, {12042, 17144323}, {12043, 17144579}, + {12044, 17144835}, {12045, 17145091}, {12046, 17145347}, {12047, 17145603}, + {12048, 17145859}, {12049, 17146115}, {12050, 17146371}, {12051, 17146627}, + {12052, 17146883}, {12053, 17147139}, {12054, 17147395}, {12055, 17147651}, + {12056, 17147907}, {12057, 17148163}, {12058, 17148419}, {12059, 17148675}, + {12060, 17148931}, {12061, 17149187}, {12062, 17149443}, {12063, 17149699}, + {12064, 17149955}, {12065, 17150211}, {12066, 17150467}, {12067, 17150723}, + {12068, 17150979}, {12069, 17151235}, {12070, 17151491}, {12071, 17151747}, + {12072, 17152003}, {12073, 17152259}, {12074, 17152515}, {12075, 17152771}, + {12076, 17153027}, {12077, 17153283}, {12078, 17153539}, {12079, 17153795}, + {12080, 17154051}, {12081, 17154307}, {12082, 17154563}, {12083, 17154819}, + {12084, 17155075}, {12085, 17155331}, {12086, 17155587}, {12087, 17155843}, + {12088, 17156099}, {12089, 17156355}, {12090, 17156611}, {12091, 17156867}, + {12092, 17157123}, {12093, 17157379}, {12094, 17157635}, {12095, 17157891}, + {12096, 17158147}, {12097, 17158403}, {12098, 17158659}, {12099, 17158915}, + {12100, 17159171}, {12101, 17159427}, {12102, 17159683}, {12103, 17159939}, + {12104, 17160195}, {12105, 17160451}, {12106, 17160707}, {12107, 17160963}, + {12108, 17161219}, {12109, 17161475}, {12110, 17161731}, {12111, 17161987}, + {12112, 17162243}, {12113, 17162499}, {12114, 17162755}, {12115, 17163011}, + {12116, 17163267}, {12117, 17163523}, {12118, 17163779}, {12119, 17164035}, + {12120, 17164291}, {12121, 17164547}, {12122, 17164803}, {12123, 17165059}, + {12124, 17165315}, {12125, 17165571}, {12126, 17165827}, {12127, 17166083}, + {12128, 17166339}, {12129, 17166595}, {12130, 17166851}, {12131, 17167107}, + {12132, 17167363}, {12133, 17167619}, {12134, 17167875}, {12135, 17168131}, + {12136, 17168387}, {12137, 17168643}, {12138, 17168899}, {12139, 17169155}, + {12140, 17169411}, {12141, 17169667}, {12142, 17169923}, {12143, 17170179}, + {12144, 17170435}, {12145, 17170691}, {12146, 17170947}, {12147, 17171203}, + {12148, 17171459}, {12149, 17171715}, {12150, 17171971}, {12151, 17172227}, + {12152, 17172483}, {12153, 17172739}, {12154, 17172995}, {12155, 17173251}, + {12156, 17173507}, {12157, 17173763}, {12158, 17174019}, {12159, 17174275}, + {12160, 17174531}, {12161, 17174787}, {12162, 17175043}, {12163, 17175299}, + {12164, 17175555}, {12165, 17175811}, {12166, 17176067}, {12167, 17176323}, + {12168, 17176579}, {12169, 17176835}, {12170, 17177091}, {12171, 17177347}, + {12172, 17177603}, {12173, 17177859}, {12174, 17178115}, {12175, 17178371}, + {12176, 17178627}, {12177, 17178883}, {12178, 17179139}, {12179, 17179395}, + {12180, 17179651}, {12181, 17179907}, {12182, 17180163}, {12183, 17180419}, + {12184, 17180675}, {12185, 17180931}, {12186, 17181187}, {12187, 17181443}, + {12188, 17181699}, {12189, 17181955}, {12190, 17182211}, {12191, 17182467}, + {12192, 17182723}, {12193, 17182979}, {12194, 17183235}, {12195, 17183491}, + {12196, 17183747}, {12197, 17184003}, {12198, 17184259}, {12199, 17184515}, + {12200, 17184771}, {12201, 17185027}, {12202, 17185283}, {12203, 17185539}, + {12204, 17185795}, {12205, 17186051}, {12206, 17186307}, {12207, 17186563}, + {12208, 17186819}, {12209, 17187075}, {12210, 17187331}, {12211, 17187587}, + {12212, 17187843}, {12213, 17188099}, {12214, 17188355}, {12215, 17188611}, + {12216, 17188867}, {12217, 17189123}, {12218, 17189379}, {12219, 17189635}, + {12220, 17189891}, {12221, 17190147}, {12222, 17190403}, {12223, 17190659}, + {12224, 17190915}, {12225, 17191171}, {12226, 17191427}, {12227, 17191683}, + {12228, 17191939}, {12229, 17192195}, {12230, 17192451}, {12231, 17192707}, + {12232, 17192963}, {12233, 17193219}, {12234, 17193475}, {12235, 17193731}, + {12236, 17193987}, {12237, 17194243}, {12238, 17194499}, {12239, 17194755}, + {12240, 17195011}, {12241, 17195267}, {12242, 17195523}, {12243, 17195779}, + {12244, 17196035}, {12245, 17196291}, {12246, 2}, {12288, 16783875}, + {12289, 1}, {12290, 17196547}, {12291, 1}, {12342, 17196803}, + {12343, 1}, {12344, 17147651}, {12345, 17197059}, {12346, 17197315}, + {12347, 1}, {12352, 2}, {12353, 1}, {12439, 2}, + {12441, 1}, {12443, 33974787}, {12444, 33975299}, {12445, 1}, + {12447, 33975811}, {12448, 1}, {12543, 33976323}, {12544, 2}, + {12549, 1}, {12592, 2}, {12593, 17199619}, {12594, 17199875}, + {12595, 17200131}, {12596, 17200387}, {12597, 17200643}, {12598, 17200899}, + {12599, 17201155}, {12600, 17201411}, {12601, 17201667}, {12602, 17201923}, + {12603, 17202179}, {12604, 17202435}, {12605, 17202691}, {12606, 17202947}, + {12607, 17203203}, {12608, 17203459}, {12609, 17203715}, {12610, 17203971}, + {12611, 17204227}, {12612, 17204483}, {12613, 17204739}, {12614, 17204995}, + {12615, 17205251}, {12616, 17205507}, {12617, 17205763}, {12618, 17206019}, + {12619, 17206275}, {12620, 17206531}, {12621, 17206787}, {12622, 17207043}, + {12623, 17207299}, {12624, 17207555}, {12625, 17207811}, {12626, 17208067}, + {12627, 17208323}, {12628, 17208579}, {12629, 17208835}, {12630, 17209091}, + {12631, 17209347}, {12632, 17209603}, {12633, 17209859}, {12634, 17210115}, + {12635, 17210371}, {12636, 17210627}, {12637, 17210883}, {12638, 17211139}, + {12639, 17211395}, {12640, 17211651}, {12641, 17211907}, {12642, 17212163}, + {12643, 17212419}, {12644, 2}, {12645, 17212675}, {12646, 17212931}, + {12647, 17213187}, {12648, 17213443}, {12649, 17213699}, {12650, 17213955}, + {12651, 17214211}, {12652, 17214467}, {12653, 17214723}, {12654, 17214979}, + {12655, 17215235}, {12656, 17215491}, {12657, 17215747}, {12658, 17216003}, + {12659, 17216259}, {12660, 17216515}, {12661, 17216771}, {12662, 17217027}, + {12663, 17217283}, {12664, 17217539}, {12665, 17217795}, {12666, 17218051}, + {12667, 17218307}, {12668, 17218563}, {12669, 17218819}, {12670, 17219075}, + {12671, 17219331}, {12672, 17219587}, {12673, 17219843}, {12674, 17220099}, + {12675, 17220355}, {12676, 17220611}, {12677, 17220867}, {12678, 17221123}, + {12679, 17221379}, {12680, 17221635}, {12681, 17221891}, {12682, 17222147}, + {12683, 17222403}, {12684, 17222659}, {12685, 17222915}, {12686, 17223171}, + {12687, 2}, {12688, 1}, {12690, 17141763}, {12691, 17143299}, + {12692, 17223427}, {12693, 17223683}, {12694, 17223939}, {12695, 17224195}, + {12696, 17224451}, {12697, 17224707}, {12698, 17142787}, {12699, 17224963}, + {12700, 17225219}, {12701, 17225475}, {12702, 17225731}, {12703, 17143811}, + {12704, 1}, {12772, 2}, {12784, 1}, {12800, 50780419}, + {12801, 50781187}, {12802, 50781955}, {12803, 50782723}, {12804, 50783491}, + {12805, 50784259}, {12806, 50785027}, {12807, 50785795}, {12808, 50786563}, + {12809, 50787331}, {12810, 50788099}, {12811, 50788867}, {12812, 50789635}, + {12813, 50790403}, {12814, 50791171}, {12815, 50791939}, {12816, 50792707}, + {12817, 50793475}, {12818, 50794243}, {12819, 50795011}, {12820, 50795779}, + {12821, 50796547}, {12822, 50797315}, {12823, 50798083}, {12824, 50798851}, + {12825, 50799619}, {12826, 50800387}, {12827, 50801155}, {12828, 50801923}, + {12829, 67579907}, {12830, 67580931}, {12831, 2}, {12832, 50804739}, + {12833, 50805507}, {12834, 50806275}, {12835, 50807043}, {12836, 50807811}, + {12837, 50808579}, {12838, 50809347}, {12839, 50810115}, {12840, 50810883}, + {12841, 50811651}, {12842, 50812419}, {12843, 50813187}, {12844, 50813955}, + {12845, 50814723}, {12846, 50815491}, {12847, 50816259}, {12848, 50817027}, + {12849, 50817795}, {12850, 50818563}, {12851, 50819331}, {12852, 50820099}, + {12853, 50820867}, {12854, 50821635}, {12855, 50822403}, {12856, 50823171}, + {12857, 50823939}, {12858, 50824707}, {12859, 50825475}, {12860, 50826243}, + {12861, 50827011}, {12862, 50827779}, {12863, 50828547}, {12864, 50829315}, + {12865, 50830083}, {12866, 50830851}, {12867, 50831619}, {12868, 17277955}, + {12869, 17278211}, {12870, 17158659}, {12871, 17278467}, {12872, 1}, + {12880, 50833155}, {12881, 33845251}, {12882, 34056707}, {12883, 33562371}, + {12884, 34057219}, {12885, 34057731}, {12886, 34058243}, {12887, 34058755}, + {12888, 34059267}, {12889, 34059779}, {12890, 34060291}, {12891, 33827331}, + {12892, 33826563}, {12893, 34060803}, {12894, 34061315}, {12895, 34061827}, + {12896, 17199619}, {12897, 17200387}, {12898, 17201155}, {12899, 17201667}, + {12900, 17203715}, {12901, 17203971}, {12902, 17204739}, {12903, 17205251}, + {12904, 17205507}, {12905, 17206019}, {12906, 17206275}, {12907, 17206531}, + {12908, 17206787}, {12909, 17207043}, {12910, 17236995}, {12911, 17237763}, + {12912, 17238531}, {12913, 17239299}, {12914, 17240067}, {12915, 17240835}, + {12916, 17241603}, {12917, 17242371}, {12918, 17243139}, {12919, 17243907}, + {12920, 17244675}, {12921, 17245443}, {12922, 17246211}, {12923, 17246979}, + {12924, 34062339}, {12925, 34062851}, {12926, 17286147}, {12927, 1}, + {12928, 17141763}, {12929, 17143299}, {12930, 17223427}, {12931, 17223683}, + {12932, 17253635}, {12933, 17254403}, {12934, 17255171}, {12935, 17144579}, + {12936, 17256707}, {12937, 17147651}, {12938, 17160451}, {12939, 17163523}, + {12940, 17163267}, {12941, 17160707}, {12942, 17184259}, {12943, 17149699}, + {12944, 17159939}, {12945, 17263619}, {12946, 17264387}, {12947, 17265155}, + {12948, 17265923}, {12949, 17266691}, {12950, 17267459}, {12951, 17268227}, + {12952, 17268995}, {12953, 17286403}, {12954, 17286659}, {12955, 17151235}, + {12956, 17286915}, {12957, 17287171}, {12958, 17287427}, {12959, 17287683}, + {12960, 17287939}, {12961, 17275907}, {12962, 17288195}, {12963, 17288451}, + {12964, 17223939}, {12965, 17224195}, {12966, 17224451}, {12967, 17288707}, + {12968, 17288963}, {12969, 17289219}, {12970, 17289475}, {12971, 17271299}, + {12972, 17272067}, {12973, 17272835}, {12974, 17273603}, {12975, 17274371}, + {12976, 17289731}, {12977, 34067203}, {12978, 34067715}, {12979, 34068227}, + {12980, 34068739}, {12981, 34069251}, {12982, 33564931}, {12983, 34057475}, + {12984, 34061571}, {12985, 34069763}, {12986, 34070275}, {12987, 34070787}, + {12988, 34071299}, {12989, 34071811}, {12990, 34072323}, {12991, 34072835}, + {12992, 34073347}, {12993, 34073859}, {12994, 34074371}, {12995, 34074883}, + {12996, 34075395}, {12997, 34075907}, {12998, 34076419}, {12999, 34076931}, + {13000, 34077443}, {13001, 50855171}, {13002, 50855939}, {13003, 50856707}, + {13004, 34080259}, {13005, 50857987}, {13006, 34081539}, {13007, 50859267}, + {13008, 17305603}, {13009, 17305859}, {13010, 17306115}, {13011, 17306371}, + {13012, 17306627}, {13013, 17306883}, {13014, 17307139}, {13015, 17307395}, + {13016, 17307651}, {13017, 17199107}, {13018, 17307907}, {13019, 17308163}, + {13020, 17308419}, {13021, 17308675}, {13022, 17308931}, {13023, 17309187}, + {13024, 17309443}, {13025, 17309699}, {13026, 17309955}, {13027, 17199363}, + {13028, 17310211}, {13029, 17310467}, {13030, 17310723}, {13031, 17310979}, + {13032, 17311235}, {13033, 17311491}, {13034, 17311747}, {13035, 17312003}, + {13036, 17312259}, {13037, 17312515}, {13038, 17312771}, {13039, 17313027}, + {13040, 17313283}, {13041, 17313539}, {13042, 17313795}, {13043, 17314051}, + {13044, 17314307}, {13045, 17314563}, {13046, 17314819}, {13047, 17315075}, + {13048, 17315331}, {13049, 17315587}, {13050, 17315843}, {13051, 17316099}, + {13052, 17316355}, {13053, 17316611}, {13054, 17316867}, {13055, 34094339}, + {13056, 67649283}, {13057, 67650307}, {13058, 67651331}, {13059, 50875139}, + {13060, 67653123}, {13061, 50876931}, {13062, 50877699}, {13063, 84432899}, + {13064, 67656963}, {13065, 50880771}, {13066, 50881539}, {13067, 50882307}, + {13068, 67660291}, {13069, 67661315}, {13070, 50885123}, {13071, 50885891}, + {13072, 34109443}, {13073, 50887171}, {13074, 67665155}, {13075, 67666179}, + {13076, 34112771}, {13077, 84444931}, {13078, 101223427}, {13079, 84447747}, + {13080, 50891011}, {13081, 84449027}, {13082, 84450307}, {13083, 67674371}, + {13084, 50898179}, {13085, 50898947}, {13086, 50899715}, {13087, 67677699}, + {13088, 84455939}, {13089, 67680003}, {13090, 50903811}, {13091, 50904579}, + {13092, 50905347}, {13093, 34128899}, {13094, 34129411}, {13095, 34118147}, + {13096, 34129923}, {13097, 50907651}, {13098, 50908419}, {13099, 84463619}, + {13100, 50910467}, {13101, 67688451}, {13102, 84466691}, {13103, 50913539}, + {13104, 34137091}, {13105, 34137603}, {13106, 84469763}, {13107, 67693827}, + {13108, 84472067}, {13109, 50918915}, {13110, 84474115}, {13111, 34143747}, + {13112, 50921475}, {13113, 50922243}, {13114, 50923011}, {13115, 50923779}, + {13116, 50924547}, {13117, 67702531}, {13118, 50926339}, {13119, 34149891}, + {13120, 50927619}, {13121, 50928387}, {13122, 50929155}, {13123, 67707139}, + {13124, 50930947}, {13125, 50931715}, {13126, 50932483}, {13127, 84487683}, + {13128, 67711747}, {13129, 34158339}, {13130, 84490499}, {13131, 34160131}, + {13132, 67715075}, {13133, 67669507}, {13134, 50938883}, {13135, 50939651}, + {13136, 50940419}, {13137, 67718403}, {13138, 34164995}, {13139, 50942723}, + {13140, 67720707}, {13141, 34167299}, {13142, 84499459}, {13143, 50893827}, + {13144, 34169091}, {13145, 34169603}, {13146, 34170115}, {13147, 34170627}, + {13148, 34171139}, {13149, 34171651}, {13150, 34172163}, {13151, 34172675}, + {13152, 34173187}, {13153, 34173699}, {13154, 50951427}, {13155, 50952195}, + {13156, 50952963}, {13157, 50953731}, {13158, 50954499}, {13159, 50955267}, + {13160, 50956035}, {13161, 50956803}, {13162, 50957571}, {13163, 50958339}, + {13164, 50959107}, {13165, 50959875}, {13166, 50960643}, {13167, 50961411}, + {13168, 50962179}, {13169, 50962947}, {13170, 34186499}, {13171, 34187011}, + {13172, 50964739}, {13173, 34188291}, {13174, 34188803}, {13175, 34189315}, + {13176, 50967043}, {13177, 50967811}, {13178, 34191363}, {13179, 34191875}, + {13180, 34192387}, {13181, 34192899}, {13182, 34193411}, {13183, 67748355}, + {13184, 34185987}, {13185, 34194947}, {13186, 34195459}, {13187, 34195971}, + {13188, 34196483}, {13189, 34196995}, {13190, 34197507}, {13191, 34198019}, + {13192, 50975747}, {13193, 67753731}, {13194, 34200323}, {13195, 34200835}, + {13196, 34201347}, {13197, 34201859}, {13198, 34202371}, {13199, 34202883}, + {13200, 34203395}, {13201, 50981123}, {13202, 50981891}, {13203, 50980355}, + {13204, 50982659}, {13205, 34206211}, {13206, 34206723}, {13207, 34207235}, + {13208, 33556995}, {13209, 34207747}, {13210, 34208259}, {13211, 34208771}, + {13212, 34209283}, {13213, 34209795}, {13214, 34210307}, {13215, 50988035}, + {13216, 50988803}, {13217, 34190083}, {13218, 50989571}, {13219, 50990339}, + {13220, 50991107}, {13221, 34190851}, {13222, 50991875}, {13223, 50992643}, + {13224, 67770627}, {13225, 34185987}, {13226, 50994435}, {13227, 50995203}, + {13228, 50995971}, {13229, 50996739}, {13230, 84551939}, {13231, 101330435}, + {13232, 34223107}, {13233, 34223619}, {13234, 34224131}, {13235, 34224643}, + {13236, 34225155}, {13237, 34225667}, {13238, 34226179}, {13239, 34226691}, + {13240, 34227203}, {13241, 34226691}, {13242, 34227715}, {13243, 34228227}, + {13244, 34228739}, {13245, 34229251}, {13246, 34229763}, {13247, 34229251}, + {13248, 34230275}, {13249, 34230787}, {13250, 2}, {13251, 34231299}, + {13252, 33817347}, {13253, 33554947}, {13254, 67786243}, {13255, 2}, + {13256, 34232835}, {13257, 34233347}, {13258, 34233859}, {13259, 34185731}, + {13260, 34234371}, {13261, 34234883}, {13262, 34210307}, {13263, 34235395}, + {13264, 33557251}, {13265, 34235907}, {13266, 51013635}, {13267, 34237187}, + {13268, 34197507}, {13269, 51014915}, {13270, 51015683}, {13271, 34239235}, + {13272, 2}, {13273, 51016963}, {13274, 34240515}, {13275, 34221315}, + {13276, 34241027}, {13277, 34241539}, {13278, 51019267}, {13279, 51020035}, + {13280, 34243587}, {13281, 34244099}, {13282, 34244611}, {13283, 34245123}, + {13284, 34245635}, {13285, 34246147}, {13286, 34246659}, {13287, 34247171}, + {13288, 34247683}, {13289, 51025411}, {13290, 51026179}, {13291, 51026947}, + {13292, 51027715}, {13293, 51028483}, {13294, 51029251}, {13295, 51030019}, + {13296, 51030787}, {13297, 51031555}, {13298, 51032323}, {13299, 51033091}, + {13300, 51033859}, {13301, 51034627}, {13302, 51035395}, {13303, 51036163}, + {13304, 51036931}, {13305, 51037699}, {13306, 51038467}, {13307, 51039235}, + {13308, 51040003}, {13309, 51040771}, {13310, 51041539}, {13311, 51042307}, + {13312, 1}, {42125, 2}, {42128, 1}, {42183, 2}, + {42192, 1}, {42540, 2}, {42560, 17488643}, {42561, 1}, + {42562, 17488899}, {42563, 1}, {42564, 17489155}, {42565, 1}, + {42566, 17489411}, {42567, 1}, {42568, 17489667}, {42569, 1}, + {42570, 16936451}, {42571, 1}, {42572, 17489923}, {42573, 1}, + {42574, 17490179}, {42575, 1}, {42576, 17490435}, {42577, 1}, + {42578, 17490691}, {42579, 1}, {42580, 17490947}, {42581, 1}, + {42582, 17491203}, {42583, 1}, {42584, 17491459}, {42585, 1}, + {42586, 17491715}, {42587, 1}, {42588, 17491971}, {42589, 1}, + {42590, 17492227}, {42591, 1}, {42592, 17492483}, {42593, 1}, + {42594, 17492739}, {42595, 1}, {42596, 17492995}, {42597, 1}, + {42598, 17493251}, {42599, 1}, {42600, 17493507}, {42601, 1}, + {42602, 17493763}, {42603, 1}, {42604, 17494019}, {42605, 1}, + {42624, 17494275}, {42625, 1}, {42626, 17494531}, {42627, 1}, + {42628, 17494787}, {42629, 1}, {42630, 17495043}, {42631, 1}, + {42632, 17495299}, {42633, 1}, {42634, 17495555}, {42635, 1}, + {42636, 17495811}, {42637, 1}, {42638, 17496067}, {42639, 1}, + {42640, 17496323}, {42641, 1}, {42642, 17496579}, {42643, 1}, + {42644, 17496835}, {42645, 1}, {42646, 17497091}, {42647, 1}, + {42648, 17497347}, {42649, 1}, {42650, 17497603}, {42651, 1}, + {42652, 16873219}, {42653, 16873731}, {42654, 1}, {42744, 2}, + {42752, 1}, {42786, 17497859}, {42787, 1}, {42788, 17498115}, + {42789, 1}, {42790, 17498371}, {42791, 1}, {42792, 17498627}, + {42793, 1}, {42794, 17498883}, {42795, 1}, {42796, 17499139}, + {42797, 1}, {42798, 17499395}, {42799, 1}, {42802, 17499651}, + {42803, 1}, {42804, 17499907}, {42805, 1}, {42806, 17500163}, + {42807, 1}, {42808, 17500419}, {42809, 1}, {42810, 17500675}, + {42811, 1}, {42812, 17500931}, {42813, 1}, {42814, 17501187}, + {42815, 1}, {42816, 17501443}, {42817, 1}, {42818, 17501699}, + {42819, 1}, {42820, 17501955}, {42821, 1}, {42822, 17502211}, + {42823, 1}, {42824, 17502467}, {42825, 1}, {42826, 17502723}, + {42827, 1}, {42828, 17502979}, {42829, 1}, {42830, 17503235}, + {42831, 1}, {42832, 17503491}, {42833, 1}, {42834, 17503747}, + {42835, 1}, {42836, 17504003}, {42837, 1}, {42838, 17504259}, + {42839, 1}, {42840, 17504515}, {42841, 1}, {42842, 17504771}, + {42843, 1}, {42844, 17505027}, {42845, 1}, {42846, 17505283}, + {42847, 1}, {42848, 17505539}, {42849, 1}, {42850, 17505795}, + {42851, 1}, {42852, 17506051}, {42853, 1}, {42854, 17506307}, + {42855, 1}, {42856, 17506563}, {42857, 1}, {42858, 17506819}, + {42859, 1}, {42860, 17507075}, {42861, 1}, {42862, 17507331}, + {42863, 1}, {42864, 17507331}, {42865, 1}, {42873, 17507587}, + {42874, 1}, {42875, 17507843}, {42876, 1}, {42877, 17508099}, + {42878, 17508355}, {42879, 1}, {42880, 17508611}, {42881, 1}, + {42882, 17508867}, {42883, 1}, {42884, 17509123}, {42885, 1}, + {42886, 17509379}, {42887, 1}, {42891, 17509635}, {42892, 1}, + {42893, 16951299}, {42894, 1}, {42896, 17509891}, {42897, 1}, + {42898, 17510147}, {42899, 1}, {42902, 17510403}, {42903, 1}, + {42904, 17510659}, {42905, 1}, {42906, 17510915}, {42907, 1}, + {42908, 17511171}, {42909, 1}, {42910, 17511427}, {42911, 1}, + {42912, 17511683}, {42913, 1}, {42914, 17511939}, {42915, 1}, + {42916, 17512195}, {42917, 1}, {42918, 17512451}, {42919, 1}, + {42920, 17512707}, {42921, 1}, {42922, 16841475}, {42923, 16948995}, + {42924, 16951043}, {42925, 17512963}, {42926, 16951555}, {42927, 1}, + {42928, 17513219}, {42929, 17513475}, {42930, 16952067}, {42931, 17513731}, + {42932, 17513987}, {42933, 1}, {42934, 17514243}, {42935, 1}, + {42936, 17514499}, {42937, 1}, {42938, 17514755}, {42939, 1}, + {42940, 17515011}, {42941, 1}, {42942, 17515267}, {42943, 1}, + {42944, 17515523}, {42945, 1}, {42946, 17515779}, {42947, 1}, + {42948, 17516035}, {42949, 16954371}, {42950, 17516291}, {42951, 17516547}, + {42952, 1}, {42953, 17516803}, {42954, 1}, {42955, 2}, + {42960, 17517059}, {42961, 1}, {42962, 2}, {42963, 1}, + {42964, 2}, {42965, 1}, {42966, 17517315}, {42967, 1}, + {42968, 17517571}, {42969, 1}, {42970, 2}, {42994, 16777731}, + {42995, 16778499}, {42996, 16781315}, {42997, 17517827}, {42998, 1}, + {43000, 16802051}, {43001, 16808195}, {43002, 1}, {43053, 2}, + {43056, 1}, {43066, 2}, {43072, 1}, {43128, 2}, + {43136, 1}, {43206, 2}, {43214, 1}, {43226, 2}, + {43232, 1}, {43348, 2}, {43359, 1}, {43389, 2}, + {43392, 1}, {43470, 2}, {43471, 1}, {43482, 2}, + {43486, 1}, {43519, 2}, {43520, 1}, {43575, 2}, + {43584, 1}, {43598, 2}, {43600, 1}, {43610, 2}, + {43612, 1}, {43715, 2}, {43739, 1}, {43767, 2}, + {43777, 1}, {43783, 2}, {43785, 1}, {43791, 2}, + {43793, 1}, {43799, 2}, {43808, 1}, {43815, 2}, + {43816, 1}, {43823, 2}, {43824, 1}, {43868, 17498371}, + {43869, 17518083}, {43870, 17124867}, {43871, 17518339}, {43872, 1}, + {43881, 17518595}, {43882, 1}, {43884, 2}, {43888, 17518851}, + {43889, 17519107}, {43890, 17519363}, {43891, 17519619}, {43892, 17519875}, + {43893, 17520131}, {43894, 17520387}, {43895, 17520643}, {43896, 17520899}, + {43897, 17521155}, {43898, 17521411}, {43899, 17521667}, {43900, 17521923}, + {43901, 17522179}, {43902, 17522435}, {43903, 17522691}, {43904, 17522947}, + {43905, 17523203}, {43906, 17523459}, {43907, 17523715}, {43908, 17523971}, + {43909, 17524227}, {43910, 17524483}, {43911, 17524739}, {43912, 17524995}, + {43913, 17525251}, {43914, 17525507}, {43915, 17525763}, {43916, 17526019}, + {43917, 17526275}, {43918, 17526531}, {43919, 17526787}, {43920, 17527043}, + {43921, 17527299}, {43922, 17527555}, {43923, 17527811}, {43924, 17528067}, + {43925, 17528323}, {43926, 17528579}, {43927, 17528835}, {43928, 17529091}, + {43929, 17529347}, {43930, 17529603}, {43931, 17529859}, {43932, 17530115}, + {43933, 17530371}, {43934, 17530627}, {43935, 17530883}, {43936, 17531139}, + {43937, 17531395}, {43938, 17531651}, {43939, 17531907}, {43940, 17532163}, + {43941, 17532419}, {43942, 17532675}, {43943, 17532931}, {43944, 17533187}, + {43945, 17533443}, {43946, 17533699}, {43947, 17533955}, {43948, 17534211}, + {43949, 17534467}, {43950, 17534723}, {43951, 17534979}, {43952, 17535235}, + {43953, 17535491}, {43954, 17535747}, {43955, 17536003}, {43956, 17536259}, + {43957, 17536515}, {43958, 17536771}, {43959, 17537027}, {43960, 17537283}, + {43961, 17537539}, {43962, 17537795}, {43963, 17538051}, {43964, 17538307}, + {43965, 17538563}, {43966, 17538819}, {43967, 17539075}, {43968, 1}, + {44014, 2}, {44016, 1}, {44026, 2}, {44032, 1}, + {55204, 2}, {55216, 1}, {55239, 2}, {55243, 1}, + {55292, 2}, {63744, 17539331}, {63745, 17539587}, {63746, 17182211}, + {63747, 17539843}, {63748, 17540099}, {63749, 17540355}, {63750, 17540611}, + {63751, 17196035}, {63753, 17540867}, {63754, 17184259}, {63755, 17541123}, + {63756, 17541379}, {63757, 17541635}, {63758, 17541891}, {63759, 17542147}, + {63760, 17542403}, {63761, 17542659}, {63762, 17542915}, {63763, 17543171}, + {63764, 17543427}, {63765, 17543683}, {63766, 17543939}, {63767, 17544195}, + {63768, 17544451}, {63769, 17544707}, {63770, 17544963}, {63771, 17545219}, + {63772, 17545475}, {63773, 17545731}, {63774, 17545987}, {63775, 17546243}, + {63776, 17546499}, {63777, 17546755}, {63778, 17547011}, {63779, 17547267}, + {63780, 17547523}, {63781, 17547779}, {63782, 17548035}, {63783, 17548291}, + {63784, 17548547}, {63785, 17548803}, {63786, 17549059}, {63787, 17549315}, + {63788, 17549571}, {63789, 17549827}, {63790, 17550083}, {63791, 17550339}, + {63792, 17550595}, {63793, 17550851}, {63794, 17551107}, {63795, 17551363}, + {63796, 17173507}, {63797, 17551619}, {63798, 17551875}, {63799, 17552131}, + {63800, 17552387}, {63801, 17552643}, {63802, 17552899}, {63803, 17553155}, + {63804, 17553411}, {63805, 17553667}, {63806, 17553923}, {63807, 17554179}, + {63808, 17192195}, {63809, 17554435}, {63810, 17554691}, {63811, 17554947}, + {63812, 17555203}, {63813, 17555459}, {63814, 17555715}, {63815, 17555971}, + {63816, 17556227}, {63817, 17556483}, {63818, 17556739}, {63819, 17556995}, + {63820, 17557251}, {63821, 17557507}, {63822, 17557763}, {63823, 17558019}, + {63824, 17558275}, {63825, 17558531}, {63826, 17558787}, {63827, 17559043}, + {63828, 17559299}, {63829, 17559555}, {63830, 17559811}, {63831, 17560067}, + {63832, 17560323}, {63833, 17560579}, {63834, 17560835}, {63835, 17561091}, + {63836, 17543427}, {63837, 17561347}, {63838, 17561603}, {63839, 17561859}, + {63840, 17562115}, {63841, 17562371}, {63842, 17562627}, {63843, 17562883}, + {63844, 17563139}, {63845, 17563395}, {63846, 17563651}, {63847, 17563907}, + {63848, 17564163}, {63849, 17564419}, {63850, 17564675}, {63851, 17564931}, + {63852, 17565187}, {63853, 17565443}, {63854, 17565699}, {63855, 17565955}, + {63856, 17566211}, {63857, 17182723}, {63858, 17566467}, {63859, 17566723}, + {63860, 17566979}, {63861, 17567235}, {63862, 17567491}, {63863, 17567747}, + {63864, 17568003}, {63865, 17568259}, {63866, 17568515}, {63867, 17568771}, + {63868, 17569027}, {63869, 17569283}, {63870, 17569539}, {63871, 17569795}, + {63872, 17570051}, {63873, 17151235}, {63874, 17570307}, {63875, 17570563}, + {63876, 17570819}, {63877, 17571075}, {63878, 17571331}, {63879, 17571587}, + {63880, 17571843}, {63881, 17572099}, {63882, 17146371}, {63883, 17572355}, + {63884, 17572611}, {63885, 17572867}, {63886, 17573123}, {63887, 17573379}, + {63888, 17573635}, {63889, 17573891}, {63890, 17574147}, {63891, 17574403}, + {63892, 17574659}, {63893, 17574915}, {63894, 17575171}, {63895, 17575427}, + {63896, 17575683}, {63897, 17575939}, {63898, 17576195}, {63899, 17576451}, + {63900, 17576707}, {63901, 17576963}, {63902, 17577219}, {63903, 17577475}, + {63904, 17577731}, {63905, 17565955}, {63906, 17577987}, {63907, 17578243}, + {63908, 17578499}, {63909, 17578755}, {63910, 17579011}, {63911, 17579267}, + {63912, 17317123}, {63913, 17579523}, {63914, 17561859}, {63915, 17579779}, + {63916, 17580035}, {63917, 17580291}, {63918, 17580547}, {63919, 17580803}, + {63920, 17581059}, {63921, 17581315}, {63922, 17581571}, {63923, 17581827}, + {63924, 17582083}, {63925, 17582339}, {63926, 17582595}, {63927, 17582851}, + {63928, 17583107}, {63929, 17583363}, {63930, 17583619}, {63931, 17583875}, + {63932, 17584131}, {63933, 17584387}, {63934, 17584643}, {63935, 17543427}, + {63936, 17584899}, {63937, 17585155}, {63938, 17585411}, {63939, 17585667}, + {63940, 17195779}, {63941, 17585923}, {63942, 17586179}, {63943, 17586435}, + {63944, 17586691}, {63945, 17586947}, {63946, 17587203}, {63947, 17587459}, + {63948, 17587715}, {63949, 17587971}, {63950, 17588227}, {63951, 17588483}, + {63952, 17588739}, {63953, 17254403}, {63954, 17588995}, {63955, 17589251}, + {63956, 17589507}, {63957, 17589763}, {63958, 17590019}, {63959, 17590275}, + {63960, 17590531}, {63961, 17590787}, {63962, 17591043}, {63963, 17562371}, + {63964, 17591299}, {63965, 17591555}, {63966, 17591811}, {63967, 17592067}, + {63968, 17592323}, {63969, 17592579}, {63970, 17592835}, {63971, 17593091}, + {63972, 17593347}, {63973, 17593603}, {63974, 17593859}, {63975, 17594115}, + {63976, 17594371}, {63977, 17184003}, {63978, 17594627}, {63979, 17594883}, + {63980, 17595139}, {63981, 17595395}, {63982, 17595651}, {63983, 17595907}, + {63984, 17596163}, {63985, 17596419}, {63986, 17596675}, {63987, 17596931}, + {63988, 17597187}, {63989, 17597443}, {63990, 17597699}, {63991, 17171459}, + {63992, 17597955}, {63993, 17598211}, {63994, 17598467}, {63995, 17598723}, + {63996, 17598979}, {63997, 17599235}, {63998, 17599491}, {63999, 17599747}, + {64000, 17600003}, {64001, 17600259}, {64002, 17600515}, {64003, 17600771}, + {64004, 17601027}, {64005, 17601283}, {64006, 17601539}, {64007, 17601795}, + {64008, 17178371}, {64009, 17602051}, {64010, 17179139}, {64011, 17602307}, + {64012, 17602563}, {64013, 17602819}, {64014, 1}, {64016, 17603075}, + {64017, 1}, {64018, 17603331}, {64019, 1}, {64021, 17603587}, + {64022, 17603843}, {64023, 17604099}, {64024, 17604355}, {64025, 17604611}, + {64026, 17604867}, {64027, 17605123}, {64028, 17605379}, {64029, 17605635}, + {64030, 17173251}, {64031, 1}, {64032, 17605891}, {64033, 1}, + {64034, 17606147}, {64035, 1}, {64037, 17606403}, {64038, 17606659}, + {64039, 1}, {64042, 17606915}, {64043, 17607171}, {64044, 17607427}, + {64045, 17607683}, {64046, 17607939}, {64047, 17608195}, {64048, 17608451}, + {64049, 17608707}, {64050, 17608963}, {64051, 17609219}, {64052, 17609475}, + {64053, 17609731}, {64054, 17609987}, {64055, 17610243}, {64056, 17610499}, + {64057, 17610755}, {64058, 17611011}, {64059, 17611267}, {64060, 17153027}, + {64061, 17611523}, {64062, 17611779}, {64063, 17612035}, {64064, 17612291}, + {64065, 17612547}, {64066, 17612803}, {64067, 17613059}, {64068, 17613315}, + {64069, 17613571}, {64070, 17613827}, {64071, 17614083}, {64072, 17614339}, + {64073, 17614595}, {64074, 17614851}, {64075, 17615107}, {64076, 17265155}, + {64077, 17615363}, {64078, 17615619}, {64079, 17615875}, {64080, 17616131}, + {64081, 17268227}, {64082, 17616387}, {64083, 17616643}, {64084, 17616899}, + {64085, 17617155}, {64086, 17617411}, {64087, 17575171}, {64088, 17617667}, + {64089, 17617923}, {64090, 17618179}, {64091, 17618435}, {64092, 17618691}, + {64093, 17618947}, {64095, 17619203}, {64096, 17619459}, {64097, 17619715}, + {64098, 17619971}, {64099, 17620227}, {64100, 17620483}, {64101, 17620739}, + {64102, 17620995}, {64103, 17606403}, {64104, 17621251}, {64105, 17621507}, + {64106, 17621763}, {64107, 17622019}, {64108, 17622275}, {64109, 17622531}, + {64110, 2}, {64112, 17622787}, {64113, 17623043}, {64114, 17623299}, + {64115, 17623555}, {64116, 17623811}, {64117, 17624067}, {64118, 17624323}, + {64119, 17624579}, {64120, 17609987}, {64121, 17624835}, {64122, 17625091}, + {64123, 17625347}, {64124, 17603075}, {64125, 17625603}, {64126, 17625859}, + {64127, 17626115}, {64128, 17626371}, {64129, 17626627}, {64130, 17626883}, + {64131, 17627139}, {64132, 17627395}, {64133, 17627651}, {64134, 17627907}, + {64135, 17628163}, {64136, 17628419}, {64137, 17612035}, {64138, 17628675}, + {64139, 17612291}, {64140, 17628931}, {64141, 17629187}, {64142, 17629443}, + {64143, 17629699}, {64144, 17629955}, {64145, 17603331}, {64146, 17548803}, + {64147, 17630211}, {64148, 17630467}, {64149, 17161475}, {64150, 17566211}, + {64151, 17587203}, {64152, 17630723}, {64153, 17630979}, {64154, 17614083}, + {64155, 17631235}, {64156, 17614339}, {64157, 17631491}, {64158, 17631747}, + {64159, 17632003}, {64160, 17603843}, {64161, 17632259}, {64162, 17632515}, + {64163, 17632771}, {64164, 17633027}, {64165, 17633283}, {64166, 17604099}, + {64167, 17633539}, {64168, 17633795}, {64169, 17634051}, {64170, 17634307}, + {64171, 17634563}, {64172, 17634819}, {64173, 17617411}, {64174, 17635075}, + {64175, 17635331}, {64176, 17575171}, {64177, 17635587}, {64178, 17618435}, + {64179, 17635843}, {64180, 17636099}, {64181, 17636355}, {64182, 17636611}, + {64183, 17636867}, {64184, 17619715}, {64185, 17637123}, {64186, 17606147}, + {64187, 17637379}, {64188, 17619971}, {64189, 17561347}, {64190, 17637635}, + {64191, 17620227}, {64192, 17637891}, {64193, 17620739}, {64194, 17638147}, + {64195, 17638403}, {64196, 17638659}, {64197, 17638915}, {64198, 17639171}, + {64199, 17621251}, {64200, 17605379}, {64201, 17639427}, {64202, 17621507}, + {64203, 17639683}, {64204, 17621763}, {64205, 17639939}, {64206, 17196035}, + {64207, 17640195}, {64208, 17640451}, {64209, 17640707}, {64210, 17640963}, + {64211, 17641219}, {64212, 17641475}, {64213, 17641731}, {64214, 17641987}, + {64215, 17642243}, {64216, 17642499}, {64217, 17642755}, {64218, 2}, + {64256, 34420227}, {64257, 34420739}, {64258, 34421251}, {64259, 51197699}, + {64260, 51198979}, {64261, 33559043}, {64263, 2}, {64275, 34422531}, + {64276, 34423043}, {64277, 34423555}, {64278, 34424067}, {64279, 34424579}, + {64280, 2}, {64285, 34425091}, {64286, 1}, {64287, 34425603}, + {64288, 17648899}, {64289, 17044227}, {64290, 17044995}, {64291, 17649155}, + {64292, 17649411}, {64293, 17649667}, {64294, 17649923}, {64295, 17650179}, + {64296, 17650435}, {64297, 17037059}, {64298, 34427907}, {64299, 34428419}, + {64300, 51206147}, {64301, 51206915}, {64302, 34430467}, {64303, 34430979}, + {64304, 34431491}, {64305, 34432003}, {64306, 34432515}, {64307, 34433027}, + {64308, 34433539}, {64309, 34434051}, {64310, 34434563}, {64311, 2}, + {64312, 34435075}, {64313, 34435587}, {64314, 34436099}, {64315, 34436611}, + {64316, 34437123}, {64317, 2}, {64318, 34437635}, {64319, 2}, + {64320, 34438147}, {64321, 34438659}, {64322, 2}, {64323, 34439171}, + {64324, 34439683}, {64325, 2}, {64326, 34440195}, {64327, 34440707}, + {64328, 34441219}, {64329, 34428931}, {64330, 34441731}, {64331, 34442243}, + {64332, 34442755}, {64333, 34443267}, {64334, 34443779}, {64335, 34444291}, + {64336, 17667587}, {64338, 17667843}, {64342, 17668099}, {64346, 17668355}, + {64350, 17668611}, {64354, 17668867}, {64358, 17669123}, {64362, 17669379}, + {64366, 17669635}, {64370, 17669891}, {64374, 17670147}, {64378, 17670403}, + {64382, 17670659}, {64386, 17670915}, {64388, 17671171}, {64390, 17671427}, + {64392, 17671683}, {64394, 17671939}, {64396, 17672195}, {64398, 17672451}, + {64402, 17672707}, {64406, 17672963}, {64410, 17673219}, {64414, 17673475}, + {64416, 17673731}, {64420, 17673987}, {64422, 17674243}, {64426, 17674499}, + {64430, 17674755}, {64432, 17675011}, {64434, 1}, {64451, 2}, + {64467, 17675267}, {64471, 16911363}, {64473, 17675523}, {64475, 17675779}, + {64477, 33688579}, {64478, 17676035}, {64480, 17676291}, {64482, 17676547}, + {64484, 17676803}, {64488, 17677059}, {64490, 34454531}, {64492, 34455043}, + {64494, 34455555}, {64496, 34456067}, {64498, 34456579}, {64500, 34457091}, + {64502, 34457603}, {64505, 34458115}, {64508, 17681411}, {64512, 34458883}, + {64513, 34459395}, {64514, 34459907}, {64515, 34458115}, {64516, 34460419}, + {64517, 34460931}, {64518, 34461443}, {64519, 34461955}, {64520, 34462467}, + {64521, 34462979}, {64522, 34463491}, {64523, 34464003}, {64524, 34464515}, + {64525, 34465027}, {64526, 34465539}, {64527, 34466051}, {64528, 34466563}, + {64529, 34467075}, {64530, 34467587}, {64531, 34468099}, {64532, 34468611}, + {64533, 34469123}, {64534, 34469635}, {64535, 34469379}, {64536, 34470147}, + {64537, 34470659}, {64538, 34471171}, {64539, 34471683}, {64540, 34472195}, + {64541, 34472707}, {64542, 34473219}, {64543, 34473731}, {64544, 34474243}, + {64545, 34474755}, {64546, 34475267}, {64547, 34475779}, {64548, 34476291}, + {64549, 34476803}, {64550, 34477315}, {64551, 34477827}, {64552, 34478339}, + {64553, 34478851}, {64554, 34479363}, {64555, 34479875}, {64556, 34480387}, + {64557, 34480899}, {64558, 34481411}, {64559, 34481923}, {64560, 34482435}, + {64561, 34482947}, {64562, 34483459}, {64563, 34483971}, {64564, 34484483}, + {64565, 34484995}, {64566, 34485507}, {64567, 34486019}, {64568, 34486531}, + {64569, 34487043}, {64570, 34487555}, {64571, 34488067}, {64572, 34488579}, + {64573, 34489091}, {64574, 34489603}, {64575, 34490115}, {64576, 34490627}, + {64577, 34491139}, {64578, 34491651}, {64579, 34492163}, {64580, 34492675}, + {64581, 34493187}, {64582, 34469891}, {64583, 34470403}, {64584, 34493699}, + {64585, 34494211}, {64586, 34494723}, {64587, 34495235}, {64588, 34495747}, + {64589, 34496259}, {64590, 34496771}, {64591, 34497283}, {64592, 34497795}, + {64593, 34498307}, {64594, 34498819}, {64595, 34499331}, {64596, 34499843}, + {64597, 34468867}, {64598, 34500355}, {64599, 34500867}, {64600, 34492931}, + {64601, 34501379}, {64602, 34500099}, {64603, 34501891}, {64604, 34502403}, + {64605, 34502915}, {64606, 51280643}, {64607, 51281411}, {64608, 51282179}, + {64609, 51282947}, {64610, 51283715}, {64611, 51284483}, {64612, 34508035}, + {64613, 34508547}, {64614, 34459907}, {64615, 34509059}, {64616, 34458115}, + {64617, 34460419}, {64618, 34509571}, {64619, 34510083}, {64620, 34462467}, + {64621, 34510595}, {64622, 34462979}, {64623, 34463491}, {64624, 34511107}, + {64625, 34511619}, {64626, 34465539}, {64627, 34512131}, {64628, 34466051}, + {64629, 34466563}, {64630, 34512643}, {64631, 34513155}, {64632, 34467587}, + {64633, 34513667}, {64634, 34468099}, {64635, 34468611}, {64636, 34482947}, + {64637, 34483459}, {64638, 34484995}, {64639, 34485507}, {64640, 34486019}, + {64641, 34488067}, {64642, 34488579}, {64643, 34489091}, {64644, 34489603}, + {64645, 34491651}, {64646, 34492163}, {64647, 34492675}, {64648, 34514179}, + {64649, 34493699}, {64650, 34514691}, {64651, 34515203}, {64652, 34496771}, + {64653, 34515715}, {64654, 34497283}, {64655, 34497795}, {64656, 34502915}, + {64657, 34516227}, {64658, 34516739}, {64659, 34492931}, {64660, 34494979}, + {64661, 34501379}, {64662, 34500099}, {64663, 34458883}, {64664, 34459395}, + {64665, 34517251}, {64666, 34459907}, {64667, 34517763}, {64668, 34460931}, + {64669, 34461443}, {64670, 34461955}, {64671, 34462467}, {64672, 34518275}, + {64673, 34464003}, {64674, 34464515}, {64675, 34465027}, {64676, 34465539}, + {64677, 34518787}, {64678, 34467587}, {64679, 34469123}, {64680, 34469635}, + {64681, 34469379}, {64682, 34470147}, {64683, 34470659}, {64684, 34471683}, + {64685, 34472195}, {64686, 34472707}, {64687, 34473219}, {64688, 34473731}, + {64689, 34474243}, {64690, 34519299}, {64691, 34474755}, {64692, 34475267}, + {64693, 34475779}, {64694, 34476291}, {64695, 34476803}, {64696, 34477315}, + {64697, 34478339}, {64698, 34478851}, {64699, 34479363}, {64700, 34479875}, + {64701, 34480387}, {64702, 34480899}, {64703, 34481411}, {64704, 34481923}, + {64705, 34482435}, {64706, 34483971}, {64707, 34484483}, {64708, 34486531}, + {64709, 34487043}, {64710, 34487555}, {64711, 34488067}, {64712, 34488579}, + {64713, 34490115}, {64714, 34490627}, {64715, 34491139}, {64716, 34491651}, + {64717, 34519811}, {64718, 34493187}, {64719, 34469891}, {64720, 34470403}, + {64721, 34493699}, {64722, 34495235}, {64723, 34495747}, {64724, 34496259}, + {64725, 34496771}, {64726, 34520323}, {64727, 34498307}, {64728, 34498819}, + {64729, 34520835}, {64730, 34468867}, {64731, 34500355}, {64732, 34500867}, + {64733, 34492931}, {64734, 34498051}, {64735, 34459907}, {64736, 34517763}, + {64737, 34462467}, {64738, 34518275}, {64739, 34465539}, {64740, 34518787}, + {64741, 34467587}, {64742, 34521347}, {64743, 34473731}, {64744, 34521859}, + {64745, 34522371}, {64746, 34522883}, {64747, 34488067}, {64748, 34488579}, + {64749, 34491651}, {64750, 34496771}, {64751, 34520323}, {64752, 34492931}, + {64753, 34498051}, {64754, 51300611}, {64755, 51301379}, {64756, 51302147}, + {64757, 34525699}, {64758, 34526211}, {64759, 34526723}, {64760, 34527235}, + {64761, 34527747}, {64762, 34528259}, {64763, 34528771}, {64764, 34529283}, + {64765, 34529795}, {64766, 34530307}, {64767, 34530819}, {64768, 34500611}, + {64769, 34531331}, {64770, 34531843}, {64771, 34532355}, {64772, 34501123}, + {64773, 34532867}, {64774, 34533379}, {64775, 34533891}, {64776, 34534403}, + {64777, 34534915}, {64778, 34535427}, {64779, 34535939}, {64780, 34522371}, + {64781, 34536451}, {64782, 34536963}, {64783, 34537475}, {64784, 34537987}, + {64785, 34525699}, {64786, 34526211}, {64787, 34526723}, {64788, 34527235}, + {64789, 34527747}, {64790, 34528259}, {64791, 34528771}, {64792, 34529283}, + {64793, 34529795}, {64794, 34530307}, {64795, 34530819}, {64796, 34500611}, + {64797, 34531331}, {64798, 34531843}, {64799, 34532355}, {64800, 34501123}, + {64801, 34532867}, {64802, 34533379}, {64803, 34533891}, {64804, 34534403}, + {64805, 34534915}, {64806, 34535427}, {64807, 34535939}, {64808, 34522371}, + {64809, 34536451}, {64810, 34536963}, {64811, 34537475}, {64812, 34537987}, + {64813, 34534915}, {64814, 34535427}, {64815, 34535939}, {64816, 34522371}, + {64817, 34521859}, {64818, 34522883}, {64819, 34477827}, {64820, 34472195}, + {64821, 34472707}, {64822, 34473219}, {64823, 34534915}, {64824, 34535427}, + {64825, 34535939}, {64826, 34477827}, {64827, 34478339}, {64828, 34538499}, + {64830, 1}, {64848, 51316227}, {64849, 51316995}, {64851, 51317763}, + {64852, 51318531}, {64853, 51319299}, {64854, 51320067}, {64855, 51320835}, + {64856, 51246851}, {64858, 51321603}, {64859, 51322371}, {64860, 51323139}, + {64861, 51323907}, {64862, 51324675}, {64863, 51325443}, {64865, 51326211}, + {64866, 51326979}, {64868, 51327747}, {64870, 51328515}, {64871, 51329283}, + {64873, 51330051}, {64874, 51330819}, {64876, 51331587}, {64878, 51332355}, + {64879, 51333123}, {64881, 51333891}, {64883, 51334659}, {64884, 51335427}, + {64885, 51336195}, {64886, 51336963}, {64888, 51337731}, {64889, 51338499}, + {64890, 51339267}, {64891, 51340035}, {64892, 51340803}, {64894, 51341571}, + {64895, 51342339}, {64896, 51343107}, {64897, 51343875}, {64898, 51344643}, + {64899, 51345411}, {64901, 51346179}, {64903, 51346947}, {64905, 51347715}, + {64906, 51247107}, {64907, 51348483}, {64908, 51349251}, {64909, 51270403}, + {64910, 51247619}, {64911, 51350019}, {64912, 2}, {64914, 51350787}, + {64915, 51351555}, {64916, 51352323}, {64917, 51353091}, {64918, 51353859}, + {64919, 51354627}, {64921, 51355395}, {64922, 51356163}, {64923, 51356931}, + {64924, 51357699}, {64926, 51358467}, {64927, 51359235}, {64928, 51360003}, + {64929, 51360771}, {64930, 51361539}, {64931, 51362307}, {64932, 51363075}, + {64933, 51363843}, {64934, 51364611}, {64935, 51365379}, {64936, 51366147}, + {64937, 51366915}, {64938, 51367683}, {64939, 51368451}, {64940, 51369219}, + {64941, 51369987}, {64942, 51277571}, {64943, 51370755}, {64944, 51371523}, + {64945, 51372291}, {64946, 51373059}, {64947, 51373827}, {64948, 51341571}, + {64949, 51343107}, {64950, 51374595}, {64951, 51375363}, {64952, 51376131}, + {64953, 51376899}, {64954, 51377667}, {64955, 51378435}, {64956, 51377667}, + {64957, 51376131}, {64958, 51379203}, {64959, 51379971}, {64960, 51380739}, + {64961, 51381507}, {64962, 51382275}, {64963, 51378435}, {64964, 51336195}, + {64965, 51328515}, {64966, 51383043}, {64967, 51383811}, {64968, 2}, + {64975, 1}, {64976, 2}, {65008, 51384579}, {65009, 51385347}, + {65010, 68163331}, {65011, 68164355}, {65012, 68165379}, {65013, 68166403}, + {65014, 68167427}, {65015, 68168451}, {65016, 68169475}, {65017, 51393283}, + {65018, 303052291}, {65019, 135284739}, {65020, 68177923}, {65021, 1}, + {65024, 0}, {65040, 17847299}, {65041, 17847555}, {65042, 2}, + {65043, 17110531}, {65044, 16848643}, {65045, 17032963}, {65046, 17033987}, + {65047, 17847811}, {65048, 17848067}, {65049, 2}, {65056, 1}, + {65072, 2}, {65073, 17848323}, {65074, 17848579}, {65075, 17848835}, + {65077, 17037827}, {65078, 17038083}, {65079, 17849091}, {65080, 17849347}, + {65081, 17849603}, {65082, 17849859}, {65083, 17850115}, {65084, 17850371}, + {65085, 17850627}, {65086, 17850883}, {65087, 17067267}, {65088, 17067523}, + {65089, 17851139}, {65090, 17851395}, {65091, 17851651}, {65092, 17851907}, + {65093, 1}, {65095, 17852163}, {65096, 17852419}, {65097, 33810691}, + {65101, 17848835}, {65104, 17847299}, {65105, 17847555}, {65106, 2}, + {65108, 16848643}, {65109, 17110531}, {65110, 17033987}, {65111, 17032963}, + {65112, 17848323}, {65113, 17037827}, {65114, 17038083}, {65115, 17849091}, + {65116, 17849347}, {65117, 17849603}, {65118, 17849859}, {65119, 17852675}, + {65120, 17852931}, {65121, 17853187}, {65122, 17037059}, {65123, 17853443}, + {65124, 17853699}, {65125, 17853955}, {65126, 17037571}, {65127, 2}, + {65128, 17854211}, {65129, 17854467}, {65130, 17854723}, {65131, 17854979}, + {65132, 2}, {65136, 34632451}, {65137, 34632963}, {65138, 34503427}, + {65139, 1}, {65140, 34504195}, {65141, 2}, {65142, 34504963}, + {65143, 34523395}, {65144, 34505731}, {65145, 34524163}, {65146, 34506499}, + {65147, 34524931}, {65148, 34507267}, {65149, 34633475}, {65150, 34633987}, + {65151, 34634499}, {65152, 17857795}, {65153, 17858051}, {65155, 17858307}, + {65157, 17858563}, {65159, 17858819}, {65161, 17677315}, {65165, 16910339}, + {65167, 17683715}, {65171, 17859075}, {65173, 17686787}, {65177, 17689859}, + {65181, 17681923}, {65185, 17682435}, {65189, 17684995}, {65193, 17834499}, + {65195, 17724675}, {65197, 17725187}, {65199, 17731587}, {65201, 17694979}, + {65205, 17745155}, {65209, 17697027}, {65213, 17698051}, {65217, 17700099}, + {65221, 17701123}, {65225, 17701635}, {65229, 17702659}, {65233, 17703683}, + {65237, 17706755}, {65241, 17708803}, {65245, 17711107}, {65249, 17682947}, + {65253, 17718019}, {65257, 17721091}, {65261, 16910851}, {65263, 17677059}, + {65265, 16911875}, {65269, 34636547}, {65271, 34637059}, {65273, 34637571}, + {65275, 34622467}, {65277, 2}, {65279, 0}, {65280, 2}, + {65281, 17032963}, {65282, 17860867}, {65283, 17852675}, {65284, 17854467}, + {65285, 17854723}, {65286, 17852931}, {65287, 17861123}, {65288, 17037827}, + {65289, 17038083}, {65290, 17853187}, {65291, 17037059}, {65292, 17847299}, + {65293, 17853443}, {65294, 17196547}, {65295, 17038595}, {65296, 17035523}, + {65297, 16786947}, {65298, 16785155}, {65299, 16785411}, {65300, 16787715}, + {65301, 17035779}, {65302, 17036035}, {65303, 17036291}, {65304, 17036547}, + {65305, 17036803}, {65306, 17110531}, {65307, 16848643}, {65308, 17853699}, + {65309, 17037571}, {65310, 17853955}, {65311, 17033987}, {65312, 17854979}, + {65313, 16777219}, {65314, 16777475}, {65315, 16777731}, {65316, 16777987}, + {65317, 16778243}, {65318, 16778499}, {65319, 16778755}, {65320, 16779011}, + {65321, 16779267}, {65322, 16779523}, {65323, 16779779}, {65324, 16780035}, + {65325, 16780291}, {65326, 16780547}, {65327, 16780803}, {65328, 16781059}, + {65329, 16781315}, {65330, 16781571}, {65331, 16781827}, {65332, 16782083}, + {65333, 16782339}, {65334, 16782595}, {65335, 16782851}, {65336, 16783107}, + {65337, 16783363}, {65338, 16783619}, {65339, 17852163}, {65340, 17854211}, + {65341, 17852419}, {65342, 17861379}, {65343, 17848835}, {65344, 17027075}, + {65345, 16777219}, {65346, 16777475}, {65347, 16777731}, {65348, 16777987}, + {65349, 16778243}, {65350, 16778499}, {65351, 16778755}, {65352, 16779011}, + {65353, 16779267}, {65354, 16779523}, {65355, 16779779}, {65356, 16780035}, + {65357, 16780291}, {65358, 16780547}, {65359, 16780803}, {65360, 16781059}, + {65361, 16781315}, {65362, 16781571}, {65363, 16781827}, {65364, 16782083}, + {65365, 16782339}, {65366, 16782595}, {65367, 16782851}, {65368, 16783107}, + {65369, 16783363}, {65370, 16783619}, {65371, 17849091}, {65372, 17861635}, + {65373, 17849347}, {65374, 17861891}, {65375, 17862147}, {65376, 17862403}, + {65377, 17196547}, {65378, 17851139}, {65379, 17851395}, {65380, 17847555}, + {65381, 17862659}, {65382, 17316867}, {65383, 17319427}, {65384, 17362435}, + {65385, 17862915}, {65386, 17363971}, {65387, 17323523}, {65388, 17863171}, + {65389, 17333763}, {65390, 17379587}, {65391, 17329155}, {65392, 17318147}, + {65393, 17305603}, {65394, 17305859}, {65395, 17306115}, {65396, 17306371}, + {65397, 17306627}, {65398, 17306883}, {65399, 17307139}, {65400, 17307395}, + {65401, 17307651}, {65402, 17199107}, {65403, 17307907}, {65404, 17308163}, + {65405, 17308419}, {65406, 17308675}, {65407, 17308931}, {65408, 17309187}, + {65409, 17309443}, {65410, 17309699}, {65411, 17309955}, {65412, 17199363}, + {65413, 17310211}, {65414, 17310467}, {65415, 17310723}, {65416, 17310979}, + {65417, 17311235}, {65418, 17311491}, {65419, 17311747}, {65420, 17312003}, + {65421, 17312259}, {65422, 17312515}, {65423, 17312771}, {65424, 17313027}, + {65425, 17313283}, {65426, 17313539}, {65427, 17313795}, {65428, 17314051}, + {65429, 17314307}, {65430, 17314563}, {65431, 17314819}, {65432, 17315075}, + {65433, 17315331}, {65434, 17315587}, {65435, 17315843}, {65436, 17316099}, + {65437, 17319939}, {65438, 17197827}, {65439, 17198339}, {65440, 2}, + {65441, 17199619}, {65442, 17199875}, {65443, 17200131}, {65444, 17200387}, + {65445, 17200643}, {65446, 17200899}, {65447, 17201155}, {65448, 17201411}, + {65449, 17201667}, {65450, 17201923}, {65451, 17202179}, {65452, 17202435}, + {65453, 17202691}, {65454, 17202947}, {65455, 17203203}, {65456, 17203459}, + {65457, 17203715}, {65458, 17203971}, {65459, 17204227}, {65460, 17204483}, + {65461, 17204739}, {65462, 17204995}, {65463, 17205251}, {65464, 17205507}, + {65465, 17205763}, {65466, 17206019}, {65467, 17206275}, {65468, 17206531}, + {65469, 17206787}, {65470, 17207043}, {65471, 2}, {65474, 17207299}, + {65475, 17207555}, {65476, 17207811}, {65477, 17208067}, {65478, 17208323}, + {65479, 17208579}, {65480, 2}, {65482, 17208835}, {65483, 17209091}, + {65484, 17209347}, {65485, 17209603}, {65486, 17209859}, {65487, 17210115}, + {65488, 2}, {65490, 17210371}, {65491, 17210627}, {65492, 17210883}, + {65493, 17211139}, {65494, 17211395}, {65495, 17211651}, {65496, 2}, + {65498, 17211907}, {65499, 17212163}, {65500, 17212419}, {65501, 2}, + {65504, 17863427}, {65505, 17863683}, {65506, 17863939}, {65507, 33561859}, + {65508, 17864195}, {65509, 17864451}, {65510, 17864707}, {65511, 2}, + {65512, 17864963}, {65513, 17865219}, {65514, 17865475}, {65515, 17865731}, + {65516, 17865987}, {65517, 17866243}, {65518, 17866499}, {65519, 2}, + {65536, 1}, {65548, 2}, {65549, 1}, {65575, 2}, + {65576, 1}, {65595, 2}, {65596, 1}, {65598, 2}, + {65599, 1}, {65614, 2}, {65616, 1}, {65630, 2}, + {65664, 1}, {65787, 2}, {65792, 1}, {65795, 2}, + {65799, 1}, {65844, 2}, {65847, 1}, {65935, 2}, + {65936, 1}, {65949, 2}, {65952, 1}, {65953, 2}, + {66000, 1}, {66046, 2}, {66176, 1}, {66205, 2}, + {66208, 1}, {66257, 2}, {66272, 1}, {66300, 2}, + {66304, 1}, {66340, 2}, {66349, 1}, {66379, 2}, + {66384, 1}, {66427, 2}, {66432, 1}, {66462, 2}, + {66463, 1}, {66500, 2}, {66504, 1}, {66518, 2}, + {66560, 17866755}, {66561, 17867011}, {66562, 17867267}, {66563, 17867523}, + {66564, 17867779}, {66565, 17868035}, {66566, 17868291}, {66567, 17868547}, + {66568, 17868803}, {66569, 17869059}, {66570, 17869315}, {66571, 17869571}, + {66572, 17869827}, {66573, 17870083}, {66574, 17870339}, {66575, 17870595}, + {66576, 17870851}, {66577, 17871107}, {66578, 17871363}, {66579, 17871619}, + {66580, 17871875}, {66581, 17872131}, {66582, 17872387}, {66583, 17872643}, + {66584, 17872899}, {66585, 17873155}, {66586, 17873411}, {66587, 17873667}, + {66588, 17873923}, {66589, 17874179}, {66590, 17874435}, {66591, 17874691}, + {66592, 17874947}, {66593, 17875203}, {66594, 17875459}, {66595, 17875715}, + {66596, 17875971}, {66597, 17876227}, {66598, 17876483}, {66599, 17876739}, + {66600, 1}, {66718, 2}, {66720, 1}, {66730, 2}, + {66736, 17876995}, {66737, 17877251}, {66738, 17877507}, {66739, 17877763}, + {66740, 17878019}, {66741, 17878275}, {66742, 17878531}, {66743, 17878787}, + {66744, 17879043}, {66745, 17879299}, {66746, 17879555}, {66747, 17879811}, + {66748, 17880067}, {66749, 17880323}, {66750, 17880579}, {66751, 17880835}, + {66752, 17881091}, {66753, 17881347}, {66754, 17881603}, {66755, 17881859}, + {66756, 17882115}, {66757, 17882371}, {66758, 17882627}, {66759, 17882883}, + {66760, 17883139}, {66761, 17883395}, {66762, 17883651}, {66763, 17883907}, + {66764, 17884163}, {66765, 17884419}, {66766, 17884675}, {66767, 17884931}, + {66768, 17885187}, {66769, 17885443}, {66770, 17885699}, {66771, 17885955}, + {66772, 2}, {66776, 1}, {66812, 2}, {66816, 1}, + {66856, 2}, {66864, 1}, {66916, 2}, {66927, 1}, + {66928, 17886211}, {66929, 17886467}, {66930, 17886723}, {66931, 17886979}, + {66932, 17887235}, {66933, 17887491}, {66934, 17887747}, {66935, 17888003}, + {66936, 17888259}, {66937, 17888515}, {66938, 17888771}, {66939, 2}, + {66940, 17889027}, {66941, 17889283}, {66942, 17889539}, {66943, 17889795}, + {66944, 17890051}, {66945, 17890307}, {66946, 17890563}, {66947, 17890819}, + {66948, 17891075}, {66949, 17891331}, {66950, 17891587}, {66951, 17891843}, + {66952, 17892099}, {66953, 17892355}, {66954, 17892611}, {66955, 2}, + {66956, 17892867}, {66957, 17893123}, {66958, 17893379}, {66959, 17893635}, + {66960, 17893891}, {66961, 17894147}, {66962, 17894403}, {66963, 2}, + {66964, 17894659}, {66965, 17894915}, {66966, 2}, {66967, 1}, + {66978, 2}, {66979, 1}, {66994, 2}, {66995, 1}, + {67002, 2}, {67003, 1}, {67005, 2}, {67072, 1}, + {67383, 2}, {67392, 1}, {67414, 2}, {67424, 1}, + {67432, 2}, {67456, 1}, {67457, 17895171}, {67458, 17895427}, + {67459, 16791043}, {67460, 17895683}, {67461, 16814083}, {67462, 2}, + {67463, 17895939}, {67464, 17896195}, {67465, 17896451}, {67466, 17896707}, + {67467, 16815363}, {67468, 16815619}, {67469, 17896963}, {67470, 17897219}, + {67471, 17897475}, {67472, 17897731}, {67473, 17897987}, {67474, 17898243}, + {67475, 16817155}, {67476, 17898499}, {67477, 16802051}, {67478, 17898755}, + {67479, 17899011}, {67480, 17899267}, {67481, 17899523}, {67482, 17899779}, + {67483, 17512963}, {67484, 17900035}, {67485, 17900291}, {67486, 17900547}, + {67487, 17900803}, {67488, 17901059}, {67489, 17901315}, {67490, 16795395}, + {67491, 17901571}, {67492, 17901827}, {67493, 16781315}, {67494, 17902083}, + {67495, 17902339}, {67496, 17125379}, {67497, 17902595}, {67498, 16819971}, + {67499, 17902851}, {67500, 17903107}, {67501, 17903363}, {67502, 17903619}, + {67503, 16820995}, {67504, 17903875}, {67505, 2}, {67506, 17904131}, + {67507, 17904387}, {67508, 17904643}, {67509, 17904899}, {67510, 17905155}, + {67511, 17905411}, {67512, 17905667}, {67513, 17905923}, {67514, 17906179}, + {67515, 2}, {67584, 1}, {67590, 2}, {67592, 1}, + {67593, 2}, {67594, 1}, {67638, 2}, {67639, 1}, + {67641, 2}, {67644, 1}, {67645, 2}, {67647, 1}, + {67670, 2}, {67671, 1}, {67743, 2}, {67751, 1}, + {67760, 2}, {67808, 1}, {67827, 2}, {67828, 1}, + {67830, 2}, {67835, 1}, {67868, 2}, {67871, 1}, + {67898, 2}, {67903, 1}, {67904, 2}, {67968, 1}, + {68024, 2}, {68028, 1}, {68048, 2}, {68050, 1}, + {68100, 2}, {68101, 1}, {68103, 2}, {68108, 1}, + {68116, 2}, {68117, 1}, {68120, 2}, {68121, 1}, + {68150, 2}, {68152, 1}, {68155, 2}, {68159, 1}, + {68169, 2}, {68176, 1}, {68185, 2}, {68192, 1}, + {68256, 2}, {68288, 1}, {68327, 2}, {68331, 1}, + {68343, 2}, {68352, 1}, {68406, 2}, {68409, 1}, + {68438, 2}, {68440, 1}, {68467, 2}, {68472, 1}, + {68498, 2}, {68505, 1}, {68509, 2}, {68521, 1}, + {68528, 2}, {68608, 1}, {68681, 2}, {68736, 17906435}, + {68737, 17906691}, {68738, 17906947}, {68739, 17907203}, {68740, 17907459}, + {68741, 17907715}, {68742, 17907971}, {68743, 17908227}, {68744, 17908483}, + {68745, 17908739}, {68746, 17908995}, {68747, 17909251}, {68748, 17909507}, + {68749, 17909763}, {68750, 17910019}, {68751, 17910275}, {68752, 17910531}, + {68753, 17910787}, {68754, 17911043}, {68755, 17911299}, {68756, 17911555}, + {68757, 17911811}, {68758, 17912067}, {68759, 17912323}, {68760, 17912579}, + {68761, 17912835}, {68762, 17913091}, {68763, 17913347}, {68764, 17913603}, + {68765, 17913859}, {68766, 17914115}, {68767, 17914371}, {68768, 17914627}, + {68769, 17914883}, {68770, 17915139}, {68771, 17915395}, {68772, 17915651}, + {68773, 17915907}, {68774, 17916163}, {68775, 17916419}, {68776, 17916675}, + {68777, 17916931}, {68778, 17917187}, {68779, 17917443}, {68780, 17917699}, + {68781, 17917955}, {68782, 17918211}, {68783, 17918467}, {68784, 17918723}, + {68785, 17918979}, {68786, 17919235}, {68787, 2}, {68800, 1}, + {68851, 2}, {68858, 1}, {68904, 2}, {68912, 1}, + {68922, 2}, {69216, 1}, {69247, 2}, {69248, 1}, + {69290, 2}, {69291, 1}, {69294, 2}, {69296, 1}, + {69298, 2}, {69373, 1}, {69416, 2}, {69424, 1}, + {69466, 2}, {69488, 1}, {69514, 2}, {69552, 1}, + {69580, 2}, {69600, 1}, {69623, 2}, {69632, 1}, + {69710, 2}, {69714, 1}, {69750, 2}, {69759, 1}, + {69821, 2}, {69822, 1}, {69827, 2}, {69840, 1}, + {69865, 2}, {69872, 1}, {69882, 2}, {69888, 1}, + {69941, 2}, {69942, 1}, {69960, 2}, {69968, 1}, + {70007, 2}, {70016, 1}, {70112, 2}, {70113, 1}, + {70133, 2}, {70144, 1}, {70162, 2}, {70163, 1}, + {70210, 2}, {70272, 1}, {70279, 2}, {70280, 1}, + {70281, 2}, {70282, 1}, {70286, 2}, {70287, 1}, + {70302, 2}, {70303, 1}, {70314, 2}, {70320, 1}, + {70379, 2}, {70384, 1}, {70394, 2}, {70400, 1}, + {70404, 2}, {70405, 1}, {70413, 2}, {70415, 1}, + {70417, 2}, {70419, 1}, {70441, 2}, {70442, 1}, + {70449, 2}, {70450, 1}, {70452, 2}, {70453, 1}, + {70458, 2}, {70459, 1}, {70469, 2}, {70471, 1}, + {70473, 2}, {70475, 1}, {70478, 2}, {70480, 1}, + {70481, 2}, {70487, 1}, {70488, 2}, {70493, 1}, + {70500, 2}, {70502, 1}, {70509, 2}, {70512, 1}, + {70517, 2}, {70656, 1}, {70748, 2}, {70749, 1}, + {70754, 2}, {70784, 1}, {70856, 2}, {70864, 1}, + {70874, 2}, {71040, 1}, {71094, 2}, {71096, 1}, + {71134, 2}, {71168, 1}, {71237, 2}, {71248, 1}, + {71258, 2}, {71264, 1}, {71277, 2}, {71296, 1}, + {71354, 2}, {71360, 1}, {71370, 2}, {71424, 1}, + {71451, 2}, {71453, 1}, {71468, 2}, {71472, 1}, + {71495, 2}, {71680, 1}, {71740, 2}, {71840, 17919491}, + {71841, 17919747}, {71842, 17920003}, {71843, 17920259}, {71844, 17920515}, + {71845, 17920771}, {71846, 17921027}, {71847, 17921283}, {71848, 17921539}, + {71849, 17921795}, {71850, 17922051}, {71851, 17922307}, {71852, 17922563}, + {71853, 17922819}, {71854, 17923075}, {71855, 17923331}, {71856, 17923587}, + {71857, 17923843}, {71858, 17924099}, {71859, 17924355}, {71860, 17924611}, + {71861, 17924867}, {71862, 17925123}, {71863, 17925379}, {71864, 17925635}, + {71865, 17925891}, {71866, 17926147}, {71867, 17926403}, {71868, 17926659}, + {71869, 17926915}, {71870, 17927171}, {71871, 17927427}, {71872, 1}, + {71923, 2}, {71935, 1}, {71943, 2}, {71945, 1}, + {71946, 2}, {71948, 1}, {71956, 2}, {71957, 1}, + {71959, 2}, {71960, 1}, {71990, 2}, {71991, 1}, + {71993, 2}, {71995, 1}, {72007, 2}, {72016, 1}, + {72026, 2}, {72096, 1}, {72104, 2}, {72106, 1}, + {72152, 2}, {72154, 1}, {72165, 2}, {72192, 1}, + {72264, 2}, {72272, 1}, {72355, 2}, {72368, 1}, + {72441, 2}, {72448, 1}, {72458, 2}, {72704, 1}, + {72713, 2}, {72714, 1}, {72759, 2}, {72760, 1}, + {72774, 2}, {72784, 1}, {72813, 2}, {72816, 1}, + {72848, 2}, {72850, 1}, {72872, 2}, {72873, 1}, + {72887, 2}, {72960, 1}, {72967, 2}, {72968, 1}, + {72970, 2}, {72971, 1}, {73015, 2}, {73018, 1}, + {73019, 2}, {73020, 1}, {73022, 2}, {73023, 1}, + {73032, 2}, {73040, 1}, {73050, 2}, {73056, 1}, + {73062, 2}, {73063, 1}, {73065, 2}, {73066, 1}, + {73103, 2}, {73104, 1}, {73106, 2}, {73107, 1}, + {73113, 2}, {73120, 1}, {73130, 2}, {73440, 1}, + {73465, 2}, {73472, 1}, {73489, 2}, {73490, 1}, + {73531, 2}, {73534, 1}, {73562, 2}, {73648, 1}, + {73649, 2}, {73664, 1}, {73714, 2}, {73727, 1}, + {74650, 2}, {74752, 1}, {74863, 2}, {74864, 1}, + {74869, 2}, {74880, 1}, {75076, 2}, {77712, 1}, + {77811, 2}, {77824, 1}, {78896, 2}, {78912, 1}, + {78934, 2}, {82944, 1}, {83527, 2}, {92160, 1}, + {92729, 2}, {92736, 1}, {92767, 2}, {92768, 1}, + {92778, 2}, {92782, 1}, {92863, 2}, {92864, 1}, + {92874, 2}, {92880, 1}, {92910, 2}, {92912, 1}, + {92918, 2}, {92928, 1}, {92998, 2}, {93008, 1}, + {93018, 2}, {93019, 1}, {93026, 2}, {93027, 1}, + {93048, 2}, {93053, 1}, {93072, 2}, {93760, 17927683}, + {93761, 17927939}, {93762, 17928195}, {93763, 17928451}, {93764, 17928707}, + {93765, 17928963}, {93766, 17929219}, {93767, 17929475}, {93768, 17929731}, + {93769, 17929987}, {93770, 17930243}, {93771, 17930499}, {93772, 17930755}, + {93773, 17931011}, {93774, 17931267}, {93775, 17931523}, {93776, 17931779}, + {93777, 17932035}, {93778, 17932291}, {93779, 17932547}, {93780, 17932803}, + {93781, 17933059}, {93782, 17933315}, {93783, 17933571}, {93784, 17933827}, + {93785, 17934083}, {93786, 17934339}, {93787, 17934595}, {93788, 17934851}, + {93789, 17935107}, {93790, 17935363}, {93791, 17935619}, {93792, 1}, + {93851, 2}, {93952, 1}, {94027, 2}, {94031, 1}, + {94088, 2}, {94095, 1}, {94112, 2}, {94176, 1}, + {94181, 2}, {94192, 1}, {94194, 2}, {94208, 1}, + {100344, 2}, {100352, 1}, {101590, 2}, {101632, 1}, + {101641, 2}, {110576, 1}, {110580, 2}, {110581, 1}, + {110588, 2}, {110589, 1}, {110591, 2}, {110592, 1}, + {110883, 2}, {110898, 1}, {110899, 2}, {110928, 1}, + {110931, 2}, {110933, 1}, {110934, 2}, {110948, 1}, + {110952, 2}, {110960, 1}, {111356, 2}, {113664, 1}, + {113771, 2}, {113776, 1}, {113789, 2}, {113792, 1}, + {113801, 2}, {113808, 1}, {113818, 2}, {113820, 1}, + {113824, 0}, {113828, 2}, {118528, 1}, {118574, 2}, + {118576, 1}, {118599, 2}, {118608, 1}, {118724, 2}, + {118784, 1}, {119030, 2}, {119040, 1}, {119079, 2}, + {119081, 1}, {119134, 34713091}, {119135, 34713603}, {119136, 51491331}, + {119137, 51492099}, {119138, 51492867}, {119139, 51493635}, {119140, 51494403}, + {119141, 1}, {119155, 2}, {119163, 1}, {119227, 34717955}, + {119228, 34718467}, {119229, 51496195}, {119230, 51496963}, {119231, 51497731}, + {119232, 51498499}, {119233, 1}, {119275, 2}, {119296, 1}, + {119366, 2}, {119488, 1}, {119508, 2}, {119520, 1}, + {119540, 2}, {119552, 1}, {119639, 2}, {119648, 1}, + {119673, 2}, {119808, 16777219}, {119809, 16777475}, {119810, 16777731}, + {119811, 16777987}, {119812, 16778243}, {119813, 16778499}, {119814, 16778755}, + {119815, 16779011}, {119816, 16779267}, {119817, 16779523}, {119818, 16779779}, + {119819, 16780035}, {119820, 16780291}, {119821, 16780547}, {119822, 16780803}, + {119823, 16781059}, {119824, 16781315}, {119825, 16781571}, {119826, 16781827}, + {119827, 16782083}, {119828, 16782339}, {119829, 16782595}, {119830, 16782851}, + {119831, 16783107}, {119832, 16783363}, {119833, 16783619}, {119834, 16777219}, + {119835, 16777475}, {119836, 16777731}, {119837, 16777987}, {119838, 16778243}, + {119839, 16778499}, {119840, 16778755}, {119841, 16779011}, {119842, 16779267}, + {119843, 16779523}, {119844, 16779779}, {119845, 16780035}, {119846, 16780291}, + {119847, 16780547}, {119848, 16780803}, {119849, 16781059}, {119850, 16781315}, + {119851, 16781571}, {119852, 16781827}, {119853, 16782083}, {119854, 16782339}, + {119855, 16782595}, {119856, 16782851}, {119857, 16783107}, {119858, 16783363}, + {119859, 16783619}, {119860, 16777219}, {119861, 16777475}, {119862, 16777731}, + {119863, 16777987}, {119864, 16778243}, {119865, 16778499}, {119866, 16778755}, + {119867, 16779011}, {119868, 16779267}, {119869, 16779523}, {119870, 16779779}, + {119871, 16780035}, {119872, 16780291}, {119873, 16780547}, {119874, 16780803}, + {119875, 16781059}, {119876, 16781315}, {119877, 16781571}, {119878, 16781827}, + {119879, 16782083}, {119880, 16782339}, {119881, 16782595}, {119882, 16782851}, + {119883, 16783107}, {119884, 16783363}, {119885, 16783619}, {119886, 16777219}, + {119887, 16777475}, {119888, 16777731}, {119889, 16777987}, {119890, 16778243}, + {119891, 16778499}, {119892, 16778755}, {119893, 2}, {119894, 16779267}, + {119895, 16779523}, {119896, 16779779}, {119897, 16780035}, {119898, 16780291}, + {119899, 16780547}, {119900, 16780803}, {119901, 16781059}, {119902, 16781315}, + {119903, 16781571}, {119904, 16781827}, {119905, 16782083}, {119906, 16782339}, + {119907, 16782595}, {119908, 16782851}, {119909, 16783107}, {119910, 16783363}, + {119911, 16783619}, {119912, 16777219}, {119913, 16777475}, {119914, 16777731}, + {119915, 16777987}, {119916, 16778243}, {119917, 16778499}, {119918, 16778755}, + {119919, 16779011}, {119920, 16779267}, {119921, 16779523}, {119922, 16779779}, + {119923, 16780035}, {119924, 16780291}, {119925, 16780547}, {119926, 16780803}, + {119927, 16781059}, {119928, 16781315}, {119929, 16781571}, {119930, 16781827}, + {119931, 16782083}, {119932, 16782339}, {119933, 16782595}, {119934, 16782851}, + {119935, 16783107}, {119936, 16783363}, {119937, 16783619}, {119938, 16777219}, + {119939, 16777475}, {119940, 16777731}, {119941, 16777987}, {119942, 16778243}, + {119943, 16778499}, {119944, 16778755}, {119945, 16779011}, {119946, 16779267}, + {119947, 16779523}, {119948, 16779779}, {119949, 16780035}, {119950, 16780291}, + {119951, 16780547}, {119952, 16780803}, {119953, 16781059}, {119954, 16781315}, + {119955, 16781571}, {119956, 16781827}, {119957, 16782083}, {119958, 16782339}, + {119959, 16782595}, {119960, 16782851}, {119961, 16783107}, {119962, 16783363}, + {119963, 16783619}, {119964, 16777219}, {119965, 2}, {119966, 16777731}, + {119967, 16777987}, {119968, 2}, {119970, 16778755}, {119971, 2}, + {119973, 16779523}, {119974, 16779779}, {119975, 2}, {119977, 16780547}, + {119978, 16780803}, {119979, 16781059}, {119980, 16781315}, {119981, 2}, + {119982, 16781827}, {119983, 16782083}, {119984, 16782339}, {119985, 16782595}, + {119986, 16782851}, {119987, 16783107}, {119988, 16783363}, {119989, 16783619}, + {119990, 16777219}, {119991, 16777475}, {119992, 16777731}, {119993, 16777987}, + {119994, 2}, {119995, 16778499}, {119996, 2}, {119997, 16779011}, + {119998, 16779267}, {119999, 16779523}, {120000, 16779779}, {120001, 16780035}, + {120002, 16780291}, {120003, 16780547}, {120004, 2}, {120005, 16781059}, + {120006, 16781315}, {120007, 16781571}, {120008, 16781827}, {120009, 16782083}, + {120010, 16782339}, {120011, 16782595}, {120012, 16782851}, {120013, 16783107}, + {120014, 16783363}, {120015, 16783619}, {120016, 16777219}, {120017, 16777475}, + {120018, 16777731}, {120019, 16777987}, {120020, 16778243}, {120021, 16778499}, + {120022, 16778755}, {120023, 16779011}, {120024, 16779267}, {120025, 16779523}, + {120026, 16779779}, {120027, 16780035}, {120028, 16780291}, {120029, 16780547}, + {120030, 16780803}, {120031, 16781059}, {120032, 16781315}, {120033, 16781571}, + {120034, 16781827}, {120035, 16782083}, {120036, 16782339}, {120037, 16782595}, + {120038, 16782851}, {120039, 16783107}, {120040, 16783363}, {120041, 16783619}, + {120042, 16777219}, {120043, 16777475}, {120044, 16777731}, {120045, 16777987}, + {120046, 16778243}, {120047, 16778499}, {120048, 16778755}, {120049, 16779011}, + {120050, 16779267}, {120051, 16779523}, {120052, 16779779}, {120053, 16780035}, + {120054, 16780291}, {120055, 16780547}, {120056, 16780803}, {120057, 16781059}, + {120058, 16781315}, {120059, 16781571}, {120060, 16781827}, {120061, 16782083}, + {120062, 16782339}, {120063, 16782595}, {120064, 16782851}, {120065, 16783107}, + {120066, 16783363}, {120067, 16783619}, {120068, 16777219}, {120069, 16777475}, + {120070, 2}, {120071, 16777987}, {120072, 16778243}, {120073, 16778499}, + {120074, 16778755}, {120075, 2}, {120077, 16779523}, {120078, 16779779}, + {120079, 16780035}, {120080, 16780291}, {120081, 16780547}, {120082, 16780803}, + {120083, 16781059}, {120084, 16781315}, {120085, 2}, {120086, 16781827}, + {120087, 16782083}, {120088, 16782339}, {120089, 16782595}, {120090, 16782851}, + {120091, 16783107}, {120092, 16783363}, {120093, 2}, {120094, 16777219}, + {120095, 16777475}, {120096, 16777731}, {120097, 16777987}, {120098, 16778243}, + {120099, 16778499}, {120100, 16778755}, {120101, 16779011}, {120102, 16779267}, + {120103, 16779523}, {120104, 16779779}, {120105, 16780035}, {120106, 16780291}, + {120107, 16780547}, {120108, 16780803}, {120109, 16781059}, {120110, 16781315}, + {120111, 16781571}, {120112, 16781827}, {120113, 16782083}, {120114, 16782339}, + {120115, 16782595}, {120116, 16782851}, {120117, 16783107}, {120118, 16783363}, + {120119, 16783619}, {120120, 16777219}, {120121, 16777475}, {120122, 2}, + {120123, 16777987}, {120124, 16778243}, {120125, 16778499}, {120126, 16778755}, + {120127, 2}, {120128, 16779267}, {120129, 16779523}, {120130, 16779779}, + {120131, 16780035}, {120132, 16780291}, {120133, 2}, {120134, 16780803}, + {120135, 2}, {120138, 16781827}, {120139, 16782083}, {120140, 16782339}, + {120141, 16782595}, {120142, 16782851}, {120143, 16783107}, {120144, 16783363}, + {120145, 2}, {120146, 16777219}, {120147, 16777475}, {120148, 16777731}, + {120149, 16777987}, {120150, 16778243}, {120151, 16778499}, {120152, 16778755}, + {120153, 16779011}, {120154, 16779267}, {120155, 16779523}, {120156, 16779779}, + {120157, 16780035}, {120158, 16780291}, {120159, 16780547}, {120160, 16780803}, + {120161, 16781059}, {120162, 16781315}, {120163, 16781571}, {120164, 16781827}, + {120165, 16782083}, {120166, 16782339}, {120167, 16782595}, {120168, 16782851}, + {120169, 16783107}, {120170, 16783363}, {120171, 16783619}, {120172, 16777219}, + {120173, 16777475}, {120174, 16777731}, {120175, 16777987}, {120176, 16778243}, + {120177, 16778499}, {120178, 16778755}, {120179, 16779011}, {120180, 16779267}, + {120181, 16779523}, {120182, 16779779}, {120183, 16780035}, {120184, 16780291}, + {120185, 16780547}, {120186, 16780803}, {120187, 16781059}, {120188, 16781315}, + {120189, 16781571}, {120190, 16781827}, {120191, 16782083}, {120192, 16782339}, + {120193, 16782595}, {120194, 16782851}, {120195, 16783107}, {120196, 16783363}, + {120197, 16783619}, {120198, 16777219}, {120199, 16777475}, {120200, 16777731}, + {120201, 16777987}, {120202, 16778243}, {120203, 16778499}, {120204, 16778755}, + {120205, 16779011}, {120206, 16779267}, {120207, 16779523}, {120208, 16779779}, + {120209, 16780035}, {120210, 16780291}, {120211, 16780547}, {120212, 16780803}, + {120213, 16781059}, {120214, 16781315}, {120215, 16781571}, {120216, 16781827}, + {120217, 16782083}, {120218, 16782339}, {120219, 16782595}, {120220, 16782851}, + {120221, 16783107}, {120222, 16783363}, {120223, 16783619}, {120224, 16777219}, + {120225, 16777475}, {120226, 16777731}, {120227, 16777987}, {120228, 16778243}, + {120229, 16778499}, {120230, 16778755}, {120231, 16779011}, {120232, 16779267}, + {120233, 16779523}, {120234, 16779779}, {120235, 16780035}, {120236, 16780291}, + {120237, 16780547}, {120238, 16780803}, {120239, 16781059}, {120240, 16781315}, + {120241, 16781571}, {120242, 16781827}, {120243, 16782083}, {120244, 16782339}, + {120245, 16782595}, {120246, 16782851}, {120247, 16783107}, {120248, 16783363}, + {120249, 16783619}, {120250, 16777219}, {120251, 16777475}, {120252, 16777731}, + {120253, 16777987}, {120254, 16778243}, {120255, 16778499}, {120256, 16778755}, + {120257, 16779011}, {120258, 16779267}, {120259, 16779523}, {120260, 16779779}, + {120261, 16780035}, {120262, 16780291}, {120263, 16780547}, {120264, 16780803}, + {120265, 16781059}, {120266, 16781315}, {120267, 16781571}, {120268, 16781827}, + {120269, 16782083}, {120270, 16782339}, {120271, 16782595}, {120272, 16782851}, + {120273, 16783107}, {120274, 16783363}, {120275, 16783619}, {120276, 16777219}, + {120277, 16777475}, {120278, 16777731}, {120279, 16777987}, {120280, 16778243}, + {120281, 16778499}, {120282, 16778755}, {120283, 16779011}, {120284, 16779267}, + {120285, 16779523}, {120286, 16779779}, {120287, 16780035}, {120288, 16780291}, + {120289, 16780547}, {120290, 16780803}, {120291, 16781059}, {120292, 16781315}, + {120293, 16781571}, {120294, 16781827}, {120295, 16782083}, {120296, 16782339}, + {120297, 16782595}, {120298, 16782851}, {120299, 16783107}, {120300, 16783363}, + {120301, 16783619}, {120302, 16777219}, {120303, 16777475}, {120304, 16777731}, + {120305, 16777987}, {120306, 16778243}, {120307, 16778499}, {120308, 16778755}, + {120309, 16779011}, {120310, 16779267}, {120311, 16779523}, {120312, 16779779}, + {120313, 16780035}, {120314, 16780291}, {120315, 16780547}, {120316, 16780803}, + {120317, 16781059}, {120318, 16781315}, {120319, 16781571}, {120320, 16781827}, + {120321, 16782083}, {120322, 16782339}, {120323, 16782595}, {120324, 16782851}, + {120325, 16783107}, {120326, 16783363}, {120327, 16783619}, {120328, 16777219}, + {120329, 16777475}, {120330, 16777731}, {120331, 16777987}, {120332, 16778243}, + {120333, 16778499}, {120334, 16778755}, {120335, 16779011}, {120336, 16779267}, + {120337, 16779523}, {120338, 16779779}, {120339, 16780035}, {120340, 16780291}, + {120341, 16780547}, {120342, 16780803}, {120343, 16781059}, {120344, 16781315}, + {120345, 16781571}, {120346, 16781827}, {120347, 16782083}, {120348, 16782339}, + {120349, 16782595}, {120350, 16782851}, {120351, 16783107}, {120352, 16783363}, + {120353, 16783619}, {120354, 16777219}, {120355, 16777475}, {120356, 16777731}, + {120357, 16777987}, {120358, 16778243}, {120359, 16778499}, {120360, 16778755}, + {120361, 16779011}, {120362, 16779267}, {120363, 16779523}, {120364, 16779779}, + {120365, 16780035}, {120366, 16780291}, {120367, 16780547}, {120368, 16780803}, + {120369, 16781059}, {120370, 16781315}, {120371, 16781571}, {120372, 16781827}, + {120373, 16782083}, {120374, 16782339}, {120375, 16782595}, {120376, 16782851}, + {120377, 16783107}, {120378, 16783363}, {120379, 16783619}, {120380, 16777219}, + {120381, 16777475}, {120382, 16777731}, {120383, 16777987}, {120384, 16778243}, + {120385, 16778499}, {120386, 16778755}, {120387, 16779011}, {120388, 16779267}, + {120389, 16779523}, {120390, 16779779}, {120391, 16780035}, {120392, 16780291}, + {120393, 16780547}, {120394, 16780803}, {120395, 16781059}, {120396, 16781315}, + {120397, 16781571}, {120398, 16781827}, {120399, 16782083}, {120400, 16782339}, + {120401, 16782595}, {120402, 16782851}, {120403, 16783107}, {120404, 16783363}, + {120405, 16783619}, {120406, 16777219}, {120407, 16777475}, {120408, 16777731}, + {120409, 16777987}, {120410, 16778243}, {120411, 16778499}, {120412, 16778755}, + {120413, 16779011}, {120414, 16779267}, {120415, 16779523}, {120416, 16779779}, + {120417, 16780035}, {120418, 16780291}, {120419, 16780547}, {120420, 16780803}, + {120421, 16781059}, {120422, 16781315}, {120423, 16781571}, {120424, 16781827}, + {120425, 16782083}, {120426, 16782339}, {120427, 16782595}, {120428, 16782851}, + {120429, 16783107}, {120430, 16783363}, {120431, 16783619}, {120432, 16777219}, + {120433, 16777475}, {120434, 16777731}, {120435, 16777987}, {120436, 16778243}, + {120437, 16778499}, {120438, 16778755}, {120439, 16779011}, {120440, 16779267}, + {120441, 16779523}, {120442, 16779779}, {120443, 16780035}, {120444, 16780291}, + {120445, 16780547}, {120446, 16780803}, {120447, 16781059}, {120448, 16781315}, + {120449, 16781571}, {120450, 16781827}, {120451, 16782083}, {120452, 16782339}, + {120453, 16782595}, {120454, 16782851}, {120455, 16783107}, {120456, 16783363}, + {120457, 16783619}, {120458, 16777219}, {120459, 16777475}, {120460, 16777731}, + {120461, 16777987}, {120462, 16778243}, {120463, 16778499}, {120464, 16778755}, + {120465, 16779011}, {120466, 16779267}, {120467, 16779523}, {120468, 16779779}, + {120469, 16780035}, {120470, 16780291}, {120471, 16780547}, {120472, 16780803}, + {120473, 16781059}, {120474, 16781315}, {120475, 16781571}, {120476, 16781827}, + {120477, 16782083}, {120478, 16782339}, {120479, 16782595}, {120480, 16782851}, + {120481, 16783107}, {120482, 16783363}, {120483, 16783619}, {120484, 17944835}, + {120485, 17945091}, {120486, 2}, {120488, 16851715}, {120489, 16851971}, + {120490, 16852227}, {120491, 16852483}, {120492, 16852739}, {120493, 16852995}, + {120494, 16853251}, {120495, 16853507}, {120496, 16846851}, {120497, 16853763}, + {120498, 16854019}, {120499, 16786179}, {120500, 16854275}, {120501, 16854531}, + {120502, 16854787}, {120503, 16855043}, {120504, 16855299}, {120505, 16853507}, + {120506, 16855555}, {120507, 16855811}, {120508, 16856067}, {120509, 16856323}, + {120510, 16856579}, {120511, 16856835}, {120512, 16857091}, {120513, 17945347}, + {120514, 16851715}, {120515, 16851971}, {120516, 16852227}, {120517, 16852483}, + {120518, 16852739}, {120519, 16852995}, {120520, 16853251}, {120521, 16853507}, + {120522, 16846851}, {120523, 16853763}, {120524, 16854019}, {120525, 16786179}, + {120526, 16854275}, {120527, 16854531}, {120528, 16854787}, {120529, 16855043}, + {120530, 16855299}, {120531, 16855555}, {120533, 16855811}, {120534, 16856067}, + {120535, 16856323}, {120536, 16856579}, {120537, 16856835}, {120538, 16857091}, + {120539, 17945603}, {120540, 16852739}, {120541, 16853507}, {120542, 16853763}, + {120543, 16856323}, {120544, 16855299}, {120545, 16855043}, {120546, 16851715}, + {120547, 16851971}, {120548, 16852227}, {120549, 16852483}, {120550, 16852739}, + {120551, 16852995}, {120552, 16853251}, {120553, 16853507}, {120554, 16846851}, + {120555, 16853763}, {120556, 16854019}, {120557, 16786179}, {120558, 16854275}, + {120559, 16854531}, {120560, 16854787}, {120561, 16855043}, {120562, 16855299}, + {120563, 16853507}, {120564, 16855555}, {120565, 16855811}, {120566, 16856067}, + {120567, 16856323}, {120568, 16856579}, {120569, 16856835}, {120570, 16857091}, + {120571, 17945347}, {120572, 16851715}, {120573, 16851971}, {120574, 16852227}, + {120575, 16852483}, {120576, 16852739}, {120577, 16852995}, {120578, 16853251}, + {120579, 16853507}, {120580, 16846851}, {120581, 16853763}, {120582, 16854019}, + {120583, 16786179}, {120584, 16854275}, {120585, 16854531}, {120586, 16854787}, + {120587, 16855043}, {120588, 16855299}, {120589, 16855555}, {120591, 16855811}, + {120592, 16856067}, {120593, 16856323}, {120594, 16856579}, {120595, 16856835}, + {120596, 16857091}, {120597, 17945603}, {120598, 16852739}, {120599, 16853507}, + {120600, 16853763}, {120601, 16856323}, {120602, 16855299}, {120603, 16855043}, + {120604, 16851715}, {120605, 16851971}, {120606, 16852227}, {120607, 16852483}, + {120608, 16852739}, {120609, 16852995}, {120610, 16853251}, {120611, 16853507}, + {120612, 16846851}, {120613, 16853763}, {120614, 16854019}, {120615, 16786179}, + {120616, 16854275}, {120617, 16854531}, {120618, 16854787}, {120619, 16855043}, + {120620, 16855299}, {120621, 16853507}, {120622, 16855555}, {120623, 16855811}, + {120624, 16856067}, {120625, 16856323}, {120626, 16856579}, {120627, 16856835}, + {120628, 16857091}, {120629, 17945347}, {120630, 16851715}, {120631, 16851971}, + {120632, 16852227}, {120633, 16852483}, {120634, 16852739}, {120635, 16852995}, + {120636, 16853251}, {120637, 16853507}, {120638, 16846851}, {120639, 16853763}, + {120640, 16854019}, {120641, 16786179}, {120642, 16854275}, {120643, 16854531}, + {120644, 16854787}, {120645, 16855043}, {120646, 16855299}, {120647, 16855555}, + {120649, 16855811}, {120650, 16856067}, {120651, 16856323}, {120652, 16856579}, + {120653, 16856835}, {120654, 16857091}, {120655, 17945603}, {120656, 16852739}, + {120657, 16853507}, {120658, 16853763}, {120659, 16856323}, {120660, 16855299}, + {120661, 16855043}, {120662, 16851715}, {120663, 16851971}, {120664, 16852227}, + {120665, 16852483}, {120666, 16852739}, {120667, 16852995}, {120668, 16853251}, + {120669, 16853507}, {120670, 16846851}, {120671, 16853763}, {120672, 16854019}, + {120673, 16786179}, {120674, 16854275}, {120675, 16854531}, {120676, 16854787}, + {120677, 16855043}, {120678, 16855299}, {120679, 16853507}, {120680, 16855555}, + {120681, 16855811}, {120682, 16856067}, {120683, 16856323}, {120684, 16856579}, + {120685, 16856835}, {120686, 16857091}, {120687, 17945347}, {120688, 16851715}, + {120689, 16851971}, {120690, 16852227}, {120691, 16852483}, {120692, 16852739}, + {120693, 16852995}, {120694, 16853251}, {120695, 16853507}, {120696, 16846851}, + {120697, 16853763}, {120698, 16854019}, {120699, 16786179}, {120700, 16854275}, + {120701, 16854531}, {120702, 16854787}, {120703, 16855043}, {120704, 16855299}, + {120705, 16855555}, {120707, 16855811}, {120708, 16856067}, {120709, 16856323}, + {120710, 16856579}, {120711, 16856835}, {120712, 16857091}, {120713, 17945603}, + {120714, 16852739}, {120715, 16853507}, {120716, 16853763}, {120717, 16856323}, + {120718, 16855299}, {120719, 16855043}, {120720, 16851715}, {120721, 16851971}, + {120722, 16852227}, {120723, 16852483}, {120724, 16852739}, {120725, 16852995}, + {120726, 16853251}, {120727, 16853507}, {120728, 16846851}, {120729, 16853763}, + {120730, 16854019}, {120731, 16786179}, {120732, 16854275}, {120733, 16854531}, + {120734, 16854787}, {120735, 16855043}, {120736, 16855299}, {120737, 16853507}, + {120738, 16855555}, {120739, 16855811}, {120740, 16856067}, {120741, 16856323}, + {120742, 16856579}, {120743, 16856835}, {120744, 16857091}, {120745, 17945347}, + {120746, 16851715}, {120747, 16851971}, {120748, 16852227}, {120749, 16852483}, + {120750, 16852739}, {120751, 16852995}, {120752, 16853251}, {120753, 16853507}, + {120754, 16846851}, {120755, 16853763}, {120756, 16854019}, {120757, 16786179}, + {120758, 16854275}, {120759, 16854531}, {120760, 16854787}, {120761, 16855043}, + {120762, 16855299}, {120763, 16855555}, {120765, 16855811}, {120766, 16856067}, + {120767, 16856323}, {120768, 16856579}, {120769, 16856835}, {120770, 16857091}, + {120771, 17945603}, {120772, 16852739}, {120773, 16853507}, {120774, 16853763}, + {120775, 16856323}, {120776, 16855299}, {120777, 16855043}, {120778, 16858627}, + {120780, 2}, {120782, 17035523}, {120783, 16786947}, {120784, 16785155}, + {120785, 16785411}, {120786, 16787715}, {120787, 17035779}, {120788, 17036035}, + {120789, 17036291}, {120790, 17036547}, {120791, 17036803}, {120792, 17035523}, + {120793, 16786947}, {120794, 16785155}, {120795, 16785411}, {120796, 16787715}, + {120797, 17035779}, {120798, 17036035}, {120799, 17036291}, {120800, 17036547}, + {120801, 17036803}, {120802, 17035523}, {120803, 16786947}, {120804, 16785155}, + {120805, 16785411}, {120806, 16787715}, {120807, 17035779}, {120808, 17036035}, + {120809, 17036291}, {120810, 17036547}, {120811, 17036803}, {120812, 17035523}, + {120813, 16786947}, {120814, 16785155}, {120815, 16785411}, {120816, 16787715}, + {120817, 17035779}, {120818, 17036035}, {120819, 17036291}, {120820, 17036547}, + {120821, 17036803}, {120822, 17035523}, {120823, 16786947}, {120824, 16785155}, + {120825, 16785411}, {120826, 16787715}, {120827, 17035779}, {120828, 17036035}, + {120829, 17036291}, {120830, 17036547}, {120831, 17036803}, {120832, 1}, + {121484, 2}, {121499, 1}, {121504, 2}, {121505, 1}, + {121520, 2}, {122624, 1}, {122655, 2}, {122661, 1}, + {122667, 2}, {122880, 1}, {122887, 2}, {122888, 1}, + {122905, 2}, {122907, 1}, {122914, 2}, {122915, 1}, + {122917, 2}, {122918, 1}, {122923, 2}, {122928, 16866563}, + {122929, 16866819}, {122930, 16867075}, {122931, 16867331}, {122932, 16867587}, + {122933, 16867843}, {122934, 16868099}, {122935, 16868355}, {122936, 16868611}, + {122937, 16869123}, {122938, 16869379}, {122939, 16869635}, {122940, 16870147}, + {122941, 16870403}, {122942, 16870659}, {122943, 16870915}, {122944, 16871171}, + {122945, 16871427}, {122946, 16871683}, {122947, 16871939}, {122948, 16872195}, + {122949, 16872451}, {122950, 16872707}, {122951, 16873475}, {122952, 16873987}, + {122953, 16874243}, {122954, 17495299}, {122955, 16888835}, {122956, 16864003}, + {122957, 16864515}, {122958, 16890883}, {122959, 16883715}, {122960, 17945859}, + {122961, 16866563}, {122962, 16866819}, {122963, 16867075}, {122964, 16867331}, + {122965, 16867587}, {122966, 16867843}, {122967, 16868099}, {122968, 16868355}, + {122969, 16868611}, {122970, 16869123}, {122971, 16869379}, {122972, 16870147}, + {122973, 16870403}, {122974, 16870915}, {122975, 16871427}, {122976, 16871683}, + {122977, 16871939}, {122978, 16872195}, {122979, 16872451}, {122980, 16872707}, + {122981, 16873219}, {122982, 16873475}, {122983, 16879875}, {122984, 16864003}, + {122985, 16863747}, {122986, 16866307}, {122987, 16883203}, {122988, 17490435}, + {122989, 16883971}, {122990, 2}, {123023, 1}, {123024, 2}, + {123136, 1}, {123181, 2}, {123184, 1}, {123198, 2}, + {123200, 1}, {123210, 2}, {123214, 1}, {123216, 2}, + {123536, 1}, {123567, 2}, {123584, 1}, {123642, 2}, + {123647, 1}, {123648, 2}, {124112, 1}, {124154, 2}, + {124896, 1}, {124903, 2}, {124904, 1}, {124908, 2}, + {124909, 1}, {124911, 2}, {124912, 1}, {124927, 2}, + {124928, 1}, {125125, 2}, {125127, 1}, {125143, 2}, + {125184, 17946115}, {125185, 17946371}, {125186, 17946627}, {125187, 17946883}, + {125188, 17947139}, {125189, 17947395}, {125190, 17947651}, {125191, 17947907}, + {125192, 17948163}, {125193, 17948419}, {125194, 17948675}, {125195, 17948931}, + {125196, 17949187}, {125197, 17949443}, {125198, 17949699}, {125199, 17949955}, + {125200, 17950211}, {125201, 17950467}, {125202, 17950723}, {125203, 17950979}, + {125204, 17951235}, {125205, 17951491}, {125206, 17951747}, {125207, 17952003}, + {125208, 17952259}, {125209, 17952515}, {125210, 17952771}, {125211, 17953027}, + {125212, 17953283}, {125213, 17953539}, {125214, 17953795}, {125215, 17954051}, + {125216, 17954307}, {125217, 17954563}, {125218, 1}, {125260, 2}, + {125264, 1}, {125274, 2}, {125278, 1}, {125280, 2}, + {126065, 1}, {126133, 2}, {126209, 1}, {126270, 2}, + {126464, 16910339}, {126465, 17683715}, {126466, 17681923}, {126467, 17834499}, + {126468, 2}, {126469, 16910851}, {126470, 17731587}, {126471, 17682435}, + {126472, 17700099}, {126473, 16911875}, {126474, 17708803}, {126475, 17711107}, + {126476, 17682947}, {126477, 17718019}, {126478, 17694979}, {126479, 17701635}, + {126480, 17703683}, {126481, 17697027}, {126482, 17706755}, {126483, 17725187}, + {126484, 17745155}, {126485, 17686787}, {126486, 17689859}, {126487, 17684995}, + {126488, 17724675}, {126489, 17698051}, {126490, 17701123}, {126491, 17702659}, + {126492, 17954819}, {126493, 17673475}, {126494, 17955075}, {126495, 17955331}, + {126496, 2}, {126497, 17683715}, {126498, 17681923}, {126499, 2}, + {126500, 17721091}, {126501, 2}, {126503, 17682435}, {126504, 2}, + {126505, 16911875}, {126506, 17708803}, {126507, 17711107}, {126508, 17682947}, + {126509, 17718019}, {126510, 17694979}, {126511, 17701635}, {126512, 17703683}, + {126513, 17697027}, {126514, 17706755}, {126515, 2}, {126516, 17745155}, + {126517, 17686787}, {126518, 17689859}, {126519, 17684995}, {126520, 2}, + {126521, 17698051}, {126522, 2}, {126523, 17702659}, {126524, 2}, + {126530, 17681923}, {126531, 2}, {126535, 17682435}, {126536, 2}, + {126537, 16911875}, {126538, 2}, {126539, 17711107}, {126540, 2}, + {126541, 17718019}, {126542, 17694979}, {126543, 17701635}, {126544, 2}, + {126545, 17697027}, {126546, 17706755}, {126547, 2}, {126548, 17745155}, + {126549, 2}, {126551, 17684995}, {126552, 2}, {126553, 17698051}, + {126554, 2}, {126555, 17702659}, {126556, 2}, {126557, 17673475}, + {126558, 2}, {126559, 17955331}, {126560, 2}, {126561, 17683715}, + {126562, 17681923}, {126563, 2}, {126564, 17721091}, {126565, 2}, + {126567, 17682435}, {126568, 17700099}, {126569, 16911875}, {126570, 17708803}, + {126571, 2}, {126572, 17682947}, {126573, 17718019}, {126574, 17694979}, + {126575, 17701635}, {126576, 17703683}, {126577, 17697027}, {126578, 17706755}, + {126579, 2}, {126580, 17745155}, {126581, 17686787}, {126582, 17689859}, + {126583, 17684995}, {126584, 2}, {126585, 17698051}, {126586, 17701123}, + {126587, 17702659}, {126588, 17954819}, {126589, 2}, {126590, 17955075}, + {126591, 2}, {126592, 16910339}, {126593, 17683715}, {126594, 17681923}, + {126595, 17834499}, {126596, 17721091}, {126597, 16910851}, {126598, 17731587}, + {126599, 17682435}, {126600, 17700099}, {126601, 16911875}, {126602, 2}, + {126603, 17711107}, {126604, 17682947}, {126605, 17718019}, {126606, 17694979}, + {126607, 17701635}, {126608, 17703683}, {126609, 17697027}, {126610, 17706755}, + {126611, 17725187}, {126612, 17745155}, {126613, 17686787}, {126614, 17689859}, + {126615, 17684995}, {126616, 17724675}, {126617, 17698051}, {126618, 17701123}, + {126619, 17702659}, {126620, 2}, {126625, 17683715}, {126626, 17681923}, + {126627, 17834499}, {126628, 2}, {126629, 16910851}, {126630, 17731587}, + {126631, 17682435}, {126632, 17700099}, {126633, 16911875}, {126634, 2}, + {126635, 17711107}, {126636, 17682947}, {126637, 17718019}, {126638, 17694979}, + {126639, 17701635}, {126640, 17703683}, {126641, 17697027}, {126642, 17706755}, + {126643, 17725187}, {126644, 17745155}, {126645, 17686787}, {126646, 17689859}, + {126647, 17684995}, {126648, 17724675}, {126649, 17698051}, {126650, 17701123}, + {126651, 17702659}, {126652, 2}, {126704, 1}, {126706, 2}, + {126976, 1}, {127020, 2}, {127024, 1}, {127124, 2}, + {127136, 1}, {127151, 2}, {127153, 1}, {127168, 2}, + {127169, 1}, {127184, 2}, {127185, 1}, {127222, 2}, + {127233, 34732803}, {127234, 34733315}, {127235, 34733827}, {127236, 34734339}, + {127237, 34734851}, {127238, 34735363}, {127239, 34735875}, {127240, 34736387}, + {127241, 34736899}, {127242, 34737411}, {127243, 1}, {127248, 50644995}, + {127249, 50645763}, {127250, 50646531}, {127251, 50647299}, {127252, 50648067}, + {127253, 50648835}, {127254, 50649603}, {127255, 50650371}, {127256, 50651139}, + {127257, 50651907}, {127258, 50652675}, {127259, 50653443}, {127260, 50654211}, + {127261, 50654979}, {127262, 50655747}, {127263, 50656515}, {127264, 50657283}, + {127265, 50658051}, {127266, 50658819}, {127267, 50659587}, {127268, 50660355}, + {127269, 50661123}, {127270, 50661891}, {127271, 50662659}, {127272, 50663427}, + {127273, 50664195}, {127274, 51515139}, {127275, 16777731}, {127276, 16781571}, + {127277, 33554947}, {127278, 34738691}, {127279, 1}, {127280, 16777219}, + {127281, 16777475}, {127282, 16777731}, {127283, 16777987}, {127284, 16778243}, + {127285, 16778499}, {127286, 16778755}, {127287, 16779011}, {127288, 16779267}, + {127289, 16779523}, {127290, 16779779}, {127291, 16780035}, {127292, 16780291}, + {127293, 16780547}, {127294, 16780803}, {127295, 16781059}, {127296, 16781315}, + {127297, 16781571}, {127298, 16781827}, {127299, 16782083}, {127300, 16782339}, + {127301, 16782595}, {127302, 16782851}, {127303, 16783107}, {127304, 16783363}, + {127305, 16783619}, {127306, 34739203}, {127307, 34226691}, {127308, 34739715}, + {127309, 33752579}, {127310, 51517443}, {127311, 34740995}, {127312, 1}, + {127338, 34209539}, {127339, 34189571}, {127340, 34741507}, {127341, 1}, + {127376, 34742019}, {127377, 1}, {127406, 2}, {127462, 1}, + {127488, 34742531}, {127489, 34743043}, {127490, 17307907}, {127491, 2}, + {127504, 17157891}, {127505, 17966339}, {127506, 17966595}, {127507, 17351683}, + {127508, 17143299}, {127509, 17966851}, {127510, 17967107}, {127511, 17225475}, + {127512, 17967363}, {127513, 17967619}, {127514, 17967875}, {127515, 17584643}, + {127516, 17968131}, {127517, 17968387}, {127518, 17968643}, {127519, 17968899}, + {127520, 17969155}, {127521, 17969411}, {127522, 17167107}, {127523, 17969667}, + {127524, 17969923}, {127525, 17970179}, {127526, 17970435}, {127527, 17970691}, + {127528, 17970947}, {127529, 17141763}, {127530, 17223427}, {127531, 17971203}, + {127532, 17288707}, {127533, 17224195}, {127534, 17288963}, {127535, 17971459}, + {127536, 17181443}, {127537, 17971715}, {127538, 17971971}, {127539, 17972227}, + {127540, 17972483}, {127541, 17972739}, {127542, 17264387}, {127543, 17160451}, + {127544, 17972995}, {127545, 17973251}, {127546, 17973507}, {127547, 17973763}, + {127548, 2}, {127552, 51528451}, {127553, 51529219}, {127554, 51529987}, + {127555, 51530755}, {127556, 51531523}, {127557, 51532291}, {127558, 51533059}, + {127559, 51533827}, {127560, 51534595}, {127561, 2}, {127568, 17980931}, + {127569, 17981187}, {127570, 2}, {127584, 1}, {127590, 2}, + {127744, 1}, {128728, 2}, {128732, 1}, {128749, 2}, + {128752, 1}, {128765, 2}, {128768, 1}, {128887, 2}, + {128891, 1}, {128986, 2}, {128992, 1}, {129004, 2}, + {129008, 1}, {129009, 2}, {129024, 1}, {129036, 2}, + {129040, 1}, {129096, 2}, {129104, 1}, {129114, 2}, + {129120, 1}, {129160, 2}, {129168, 1}, {129198, 2}, + {129200, 1}, {129202, 2}, {129280, 1}, {129620, 2}, + {129632, 1}, {129646, 2}, {129648, 1}, {129661, 2}, + {129664, 1}, {129673, 2}, {129680, 1}, {129726, 2}, + {129727, 1}, {129734, 2}, {129742, 1}, {129756, 2}, + {129760, 1}, {129769, 2}, {129776, 1}, {129785, 2}, + {129792, 1}, {129939, 2}, {129940, 1}, {129995, 2}, + {130032, 17035523}, {130033, 16786947}, {130034, 16785155}, {130035, 16785411}, + {130036, 16787715}, {130037, 17035779}, {130038, 17036035}, {130039, 17036291}, + {130040, 17036547}, {130041, 17036803}, {130042, 2}, {131072, 1}, + {173792, 2}, {173824, 1}, {177978, 2}, {177984, 1}, + {178206, 2}, {178208, 1}, {183970, 2}, {183984, 1}, + {191457, 2}, {194560, 17981443}, {194561, 17981699}, {194562, 17981955}, + {194563, 17982211}, {194564, 17982467}, {194565, 17608451}, {194566, 17982723}, + {194567, 17982979}, {194568, 17983235}, {194569, 17983491}, {194570, 17608707}, + {194571, 17983747}, {194572, 17984003}, {194573, 17984259}, {194574, 17608963}, + {194575, 17984515}, {194576, 17984771}, {194577, 17985027}, {194578, 17985283}, + {194579, 17985539}, {194580, 17985795}, {194581, 17968643}, {194582, 17986051}, + {194583, 17986307}, {194584, 17986563}, {194585, 17986819}, {194586, 17987075}, + {194587, 17623043}, {194588, 17987331}, {194589, 17145859}, {194590, 17987587}, + {194591, 17987843}, {194592, 17988099}, {194593, 17988355}, {194594, 17973251}, + {194595, 17988611}, {194596, 17988867}, {194597, 17624323}, {194598, 17609219}, + {194599, 17609475}, {194600, 17624579}, {194601, 17989123}, {194602, 17989379}, + {194603, 17562883}, {194604, 17989635}, {194605, 17609731}, {194606, 17989891}, + {194607, 17990147}, {194608, 17990403}, {194609, 17990659}, {194612, 17990915}, + {194613, 17991171}, {194614, 17991427}, {194615, 17991683}, {194616, 17991939}, + {194617, 17992195}, {194618, 17992451}, {194619, 17992707}, {194620, 17992963}, + {194621, 17993219}, {194622, 17993475}, {194623, 17993731}, {194624, 17993987}, + {194625, 17994243}, {194626, 17994499}, {194627, 17994755}, {194628, 17995011}, + {194629, 17995267}, {194631, 17625091}, {194632, 17995523}, {194633, 17995779}, + {194634, 17996035}, {194635, 17996291}, {194636, 17610243}, {194637, 17996547}, + {194638, 17996803}, {194639, 17997059}, {194640, 17600003}, {194641, 17997315}, + {194642, 17997571}, {194643, 17997827}, {194644, 17998083}, {194645, 17998339}, + {194646, 17998595}, {194647, 17998851}, {194648, 17999107}, {194649, 17999363}, + {194650, 17999619}, {194651, 17999875}, {194652, 18000131}, {194653, 17966851}, + {194654, 18000387}, {194655, 18000643}, {194656, 18000899}, {194657, 18001155}, + {194658, 18001411}, {194659, 18001667}, {194660, 18001923}, {194661, 18002179}, + {194662, 18002435}, {194663, 18002691}, {194664, 2}, {194665, 18002947}, + {194666, 18003203}, {194668, 18003459}, {194669, 18003715}, {194670, 18003971}, + {194671, 17561859}, {194672, 18004227}, {194673, 18004483}, {194674, 18004739}, + {194675, 18004995}, {194676, 2}, {194677, 17152515}, {194678, 18005251}, + {194679, 18005507}, {194680, 17153027}, {194681, 18005763}, {194682, 18006019}, + {194683, 18006275}, {194684, 18006531}, {194685, 18006787}, {194686, 18007043}, + {194687, 18007299}, {194688, 18007555}, {194689, 18007811}, {194690, 18008067}, + {194691, 18008323}, {194692, 18008579}, {194693, 18008835}, {194694, 18009091}, + {194695, 18009347}, {194696, 18009603}, {194697, 18009859}, {194698, 18010115}, + {194699, 18010371}, {194700, 18010627}, {194701, 18010883}, {194702, 17548547}, + {194703, 18011139}, {194704, 17155587}, {194705, 18011395}, {194707, 18011651}, + {194708, 18011907}, {194710, 18012163}, {194711, 18012419}, {194712, 18012675}, + {194713, 18012931}, {194714, 18013187}, {194715, 18013443}, {194716, 18013699}, + {194717, 18013955}, {194718, 18014211}, {194719, 18014467}, {194720, 18014723}, + {194721, 18014979}, {194722, 18015235}, {194723, 17611523}, {194724, 18015491}, + {194725, 18015747}, {194726, 18016003}, {194727, 18016259}, {194728, 17628163}, + {194729, 18016259}, {194730, 18016515}, {194731, 17612035}, {194732, 18016771}, + {194733, 18017027}, {194734, 18017283}, {194735, 18017539}, {194736, 17612291}, + {194737, 17541635}, {194738, 17414915}, {194739, 18017795}, {194740, 18018051}, + {194741, 18018307}, {194742, 18018563}, {194743, 18018819}, {194744, 18019075}, + {194745, 18019331}, {194746, 18019587}, {194747, 18019843}, {194748, 18020099}, + {194749, 18020355}, {194750, 18020611}, {194751, 18020867}, {194752, 18021123}, + {194753, 18021379}, {194754, 18021635}, {194755, 18021891}, {194756, 18022147}, + {194757, 18022403}, {194758, 18022659}, {194759, 18022915}, {194760, 17612547}, + {194761, 18023171}, {194762, 18023427}, {194763, 18023683}, {194764, 18023939}, + {194765, 18024195}, {194766, 18024451}, {194767, 17613059}, {194768, 18024707}, + {194769, 18024963}, {194770, 18025219}, {194771, 18025475}, {194772, 18025731}, + {194773, 18025987}, {194774, 18026243}, {194775, 18026499}, {194776, 17548803}, + {194777, 17630211}, {194778, 18026755}, {194779, 18027011}, {194780, 18027267}, + {194781, 18027523}, {194782, 18027779}, {194783, 18028035}, {194784, 18028291}, + {194785, 18028547}, {194786, 17613315}, {194787, 18028803}, {194788, 18029059}, + {194789, 18029315}, {194790, 18029571}, {194791, 17640963}, {194792, 18029827}, + {194793, 18030083}, {194794, 18030339}, {194795, 18030595}, {194796, 18030851}, + {194797, 18031107}, {194798, 18031363}, {194799, 18031619}, {194800, 18031875}, + {194801, 18032131}, {194802, 18032387}, {194803, 18032643}, {194804, 18032899}, + {194805, 17566211}, {194806, 18033155}, {194807, 18033411}, {194808, 18033667}, + {194809, 18033923}, {194810, 18034179}, {194811, 18034435}, {194812, 18034691}, + {194813, 18034947}, {194814, 18035203}, {194815, 18035459}, {194816, 18035715}, + {194817, 17613571}, {194818, 17587203}, {194819, 18035971}, {194820, 18036227}, + {194821, 18036483}, {194822, 18036739}, {194823, 18036995}, {194824, 18037251}, + {194825, 18037507}, {194826, 18037763}, {194827, 17630979}, {194828, 18038019}, + {194829, 18038275}, {194830, 18038531}, {194831, 18038787}, {194832, 18039043}, + {194833, 18039299}, {194834, 18039555}, {194835, 18039811}, {194836, 17631235}, + {194837, 18040067}, {194838, 18040323}, {194839, 18040579}, {194840, 18040835}, + {194841, 18041091}, {194842, 18041347}, {194843, 18041603}, {194844, 18041859}, + {194845, 18042115}, {194846, 18042371}, {194847, 2}, {194848, 18042627}, + {194849, 17631747}, {194850, 18042883}, {194851, 18043139}, {194852, 18043395}, + {194853, 18043651}, {194854, 18043907}, {194855, 18044163}, {194856, 18044419}, + {194857, 18044675}, {194858, 18044931}, {194859, 18045187}, {194860, 18045443}, + {194862, 18045699}, {194863, 18045955}, {194864, 17632259}, {194865, 18046211}, + {194866, 18046467}, {194867, 18046723}, {194868, 18046979}, {194869, 18047235}, + {194870, 18047491}, {194871, 18047747}, {194872, 17562627}, {194873, 18048003}, + {194874, 18048259}, {194875, 18048515}, {194876, 18048771}, {194877, 18049027}, + {194878, 18049283}, {194879, 18049539}, {194880, 17633795}, {194881, 18049795}, + {194882, 18050051}, {194883, 18050307}, {194884, 18050563}, {194885, 18050819}, + {194886, 18051075}, {194888, 17634051}, {194889, 17641475}, {194890, 18051331}, + {194891, 18051587}, {194892, 18051843}, {194893, 18052099}, {194894, 18052355}, + {194895, 17553155}, {194896, 17634563}, {194897, 18052611}, {194898, 18052867}, + {194899, 17616131}, {194900, 18053123}, {194901, 18053379}, {194902, 17605123}, + {194903, 18053635}, {194904, 18053891}, {194905, 17616899}, {194906, 18054147}, + {194907, 18054403}, {194908, 18054659}, {194909, 18054915}, {194911, 2}, + {194912, 18055171}, {194913, 18055427}, {194914, 18055683}, {194915, 18055939}, + {194916, 18056195}, {194917, 18056451}, {194918, 18056707}, {194919, 18056963}, + {194920, 18057219}, {194921, 18057475}, {194922, 18057731}, {194923, 18057987}, + {194924, 18058243}, {194925, 18058499}, {194926, 18058755}, {194927, 18059011}, + {194928, 18059267}, {194929, 18059523}, {194930, 18059779}, {194931, 18060035}, + {194932, 18060291}, {194933, 18060547}, {194934, 18060803}, {194935, 18061059}, + {194936, 18061315}, {194937, 18061571}, {194938, 17618435}, {194939, 18061827}, + {194940, 18062083}, {194941, 18062339}, {194942, 18062595}, {194943, 18062851}, + {194944, 18063107}, {194945, 18063363}, {194946, 18063619}, {194947, 18063875}, + {194948, 18064131}, {194949, 18064387}, {194950, 18064643}, {194951, 18064899}, + {194952, 18065155}, {194953, 18065411}, {194954, 18065667}, {194955, 18011651}, + {194956, 18065923}, {194957, 18066179}, {194958, 18066435}, {194959, 18066691}, + {194960, 18066947}, {194961, 18067203}, {194962, 18067459}, {194963, 18067715}, + {194964, 18067971}, {194965, 18068227}, {194966, 18068483}, {194967, 18068739}, + {194968, 17566979}, {194969, 18068995}, {194970, 18069251}, {194971, 18069507}, + {194972, 18069763}, {194973, 18070019}, {194974, 18070275}, {194975, 17619203}, + {194976, 18070531}, {194977, 18070787}, {194978, 18071043}, {194979, 18071299}, + {194980, 18071555}, {194981, 18071811}, {194982, 18072067}, {194983, 18072323}, + {194984, 18072579}, {194985, 18072835}, {194986, 18073091}, {194987, 18073347}, + {194988, 18073603}, {194989, 18073859}, {194990, 18074115}, {194991, 18074371}, + {194992, 18074627}, {194993, 18074883}, {194994, 18075139}, {194995, 18075395}, + {194996, 17551875}, {194997, 18075651}, {194998, 18075907}, {194999, 18076163}, + {195000, 18076419}, {195001, 18076675}, {195002, 18076931}, {195003, 17636355}, + {195004, 18077187}, {195005, 18077443}, {195006, 18077699}, {195007, 2}, + {195008, 18077955}, {195009, 18078211}, {195010, 18078467}, {195011, 18078723}, + {195012, 17178627}, {195013, 18078979}, {195014, 18079235}, {195015, 18079491}, + {195016, 18079747}, {195017, 18080003}, {195018, 18080259}, {195019, 18080515}, + {195020, 18080771}, {195021, 18081027}, {195022, 18081283}, {195023, 18081539}, + {195024, 17637635}, {195025, 17637891}, {195026, 17180419}, {195027, 18081795}, + {195028, 18082051}, {195029, 18082307}, {195030, 18082563}, {195031, 18082819}, + {195032, 18083075}, {195033, 18083331}, {195034, 18083587}, {195035, 18083843}, + {195036, 18084099}, {195037, 18084355}, {195038, 18084611}, {195039, 17638147}, + {195040, 18084867}, {195041, 18085123}, {195042, 18085379}, {195043, 18085635}, + {195044, 18085891}, {195045, 18086147}, {195046, 18086403}, {195047, 18086659}, + {195048, 18086915}, {195049, 18087171}, {195050, 18087427}, {195051, 18087683}, + {195052, 18087939}, {195053, 18088195}, {195054, 18088451}, {195055, 18088707}, + {195056, 18088963}, {195057, 18089219}, {195058, 18089475}, {195059, 18089731}, + {195060, 18089987}, {195061, 18090243}, {195062, 18090499}, {195063, 18090755}, + {195064, 18091011}, {195065, 18091267}, {195066, 18091523}, {195067, 18091779}, + {195068, 18092035}, {195069, 18092291}, {195070, 17639683}, {195072, 18092547}, + {195073, 18092803}, {195074, 18093059}, {195075, 18093315}, {195076, 18093571}, + {195077, 18093827}, {195078, 18094083}, {195079, 18094339}, {195080, 18094595}, + {195081, 18094851}, {195082, 17639939}, {195083, 18095107}, {195084, 18095363}, + {195085, 18095619}, {195086, 18095875}, {195087, 18096131}, {195088, 18096387}, + {195089, 18096643}, {195090, 18096899}, {195091, 18097155}, {195092, 18097411}, + {195093, 17192707}, {195094, 18097667}, {195095, 17193731}, {195096, 18097923}, + {195097, 18098179}, {195098, 18098435}, {195099, 18098691}, {195100, 17195011}, + {195101, 18098947}, {195102, 2}, {196608, 1}, {201547, 2}, + {201552, 1}, {205744, 2}, {917760, 0}, {918000, 2} +}; + + +} // namespace ada::idna +#endif // ADA_IDNA_TABLES_H + +/* end file src/mapping_tables.cpp */ + +namespace ada::idna { + +// This can be greatly accelerated. For now we just use a simply +// binary search. In practice, you should *not* do that. +uint32_t find_range_index(uint32_t key) { + //////////////// + // This could be implemented with std::lower_bound, but we roll our own + // because we want to allow further optimizations in the future. + //////////////// + uint32_t len = std::size(table); + uint32_t low = 0; + uint32_t high = len - 1; + while (low <= high) { + uint32_t middle_index = (low + high) >> 1; // cannot overflow + uint32_t middle_value = table[middle_index][0]; + if (middle_value < key) { + low = middle_index + 1; + } else if (middle_value > key) { + high = middle_index - 1; + } else { + return middle_index; // perfect match } } + return low == 0 ? 0 : low - 1; +} - std::string ipv6(const std::array& address) noexcept { - size_t compress_length = 0; // The length of a long sequence of zeros. - size_t compress = 0; // The start of a long sequence of zeros. - find_longest_sequence_of_ipv6_pieces(address, compress, compress_length); +bool ascii_has_upper_case(char* input, size_t length) { + auto broadcast = [](uint8_t v) -> uint64_t { return 0x101010101010101 * v; }; + uint64_t broadcast_80 = broadcast(0x80); + uint64_t broadcast_Ap = broadcast(128 - 'A'); + uint64_t broadcast_Zp = broadcast(128 - 'Z'); + size_t i = 0; - if (compress_length <= 1) { - // Optimization opportunity: Find a faster way then snprintf for imploding and return here. - compress = compress_length = 8; - } + uint64_t runner{0}; - std::string output(4 * 8 + 7 + 2, '\0'); - size_t piece_index = 0; - char *point = output.data(); - char *point_end = output.data() + output.size(); - *point++ = '['; - while (true) { - if (piece_index == compress) { - *point++ = ':'; - // If we skip a value initially, we need to write '::', otherwise - // a single ':' will do since it follows a previous ':'. - if(piece_index == 0) { *point++ = ':'; } - piece_index += compress_length; - if(piece_index == 8) { break; } - } - point = std::to_chars(point, point_end, address[piece_index], 16).ptr; - piece_index++; - if(piece_index == 8) { break; } - *point++ = ':'; - } - *point++ = ']'; - output.resize(point - output.data()); - return output; + for (; i + 7 < length; i += 8) { + uint64_t word{}; + memcpy(&word, input + i, sizeof(word)); + runner |= (((word + broadcast_Ap) ^ (word + broadcast_Zp)) & broadcast_80); } - - std::string ipv4(const uint64_t address) noexcept { - std::string output(15, '\0'); - char *point = output.data(); - char *point_end = output.data() + output.size(); - point = std::to_chars(point, point_end, uint8_t(address >> 24)).ptr; - for (int i = 2; i >= 0; i--) { - *point++ = '.'; - point = std::to_chars(point, point_end, uint8_t(address >> (i * 8))).ptr; - } - output.resize(point - output.data()); - return output; + if (i < length) { + uint64_t word{}; + memcpy(&word, input + i, length - i); + runner |= (((word + broadcast_Ap) ^ (word + broadcast_Zp)) & broadcast_80); } + return runner != 0; +} -} // namespace ada::serializers -/* end file src/serializers.cpp */ -// dofile: invoked with prepath=/Users/dlemire/CVS/github/ada/src, filename=implementation.cpp -/* begin file src/implementation.cpp */ -#include - - -namespace ada { - - ada_warn_unused tl::expected parse(std::string_view input, - const ada::url* base_url, - ada::encoding_type encoding) { - if(encoding != encoding_type::UTF8) { - // @todo Add support for non UTF8 input - } - ada::url u = ada::parser::parse_url(input, base_url, encoding); - if(!u.is_valid) { return tl::unexpected(errors::generic_error); } - return u; - } - - std::string href_from_file(std::string_view input) { - // This is going to be much faster than constructing a URL. - std::string tmp_buffer; - std::string_view internal_input; - if(unicode::has_tabs_or_newline(input)) { - tmp_buffer = input; - helpers::remove_ascii_tab_or_newline(tmp_buffer); - internal_input = tmp_buffer; - } else { - internal_input = input; - } - std::string path; - if(internal_input.empty()) { - path = "/"; - } else if((internal_input[0] == '/') ||(internal_input[0] == '\\')){ - helpers::parse_prepared_path(internal_input.substr(1), ada::scheme::type::FILE, path); - } else { - helpers::parse_prepared_path(internal_input, ada::scheme::type::FILE, path); - } - return "file://" + path; +void ascii_map(char* input, size_t length) { + auto broadcast = [](uint8_t v) -> uint64_t { return 0x101010101010101 * v; }; + uint64_t broadcast_80 = broadcast(0x80); + uint64_t broadcast_Ap = broadcast(128 - 'A'); + uint64_t broadcast_Zp = broadcast(128 - 'Z'); + size_t i = 0; + + for (; i + 7 < length; i += 8) { + uint64_t word{}; + memcpy(&word, input + i, sizeof(word)); + word ^= + (((word + broadcast_Ap) ^ (word + broadcast_Zp)) & broadcast_80) >> 2; + memcpy(input + i, &word, sizeof(word)); + } + if (i < length) { + uint64_t word{}; + memcpy(&word, input + i, length - i); + word ^= + (((word + broadcast_Ap) ^ (word + broadcast_Zp)) & broadcast_80) >> 2; + memcpy(input + i, &word, length - i); } +} + +// Map the characters according to IDNA, returning the empty string on error. +std::u32string map(std::u32string_view input) { + // [Map](https://www.unicode.org/reports/tr46/#ProcessingStepMap). + // For each code point in the domain_name string, look up the status + // value in Section 5, [IDNA Mapping + // Table](https://www.unicode.org/reports/tr46/#IDNA_Mapping_Table), + // and take the following actions: + // * disallowed: Leave the code point unchanged in the string, and + // record that there was an error. + // * ignored: Remove the code point from the string. This is + // equivalent to mapping the code point to an empty string. + // * mapped: Replace the code point in the string by the value for + // the mapping in Section 5, [IDNA Mapping + // Table](https://www.unicode.org/reports/tr46/#IDNA_Mapping_Table). + // * valid: Leave the code point unchanged in the string. + static std::u32string error = U""; + std::u32string answer; + answer.reserve(input.size()); + for (char32_t x : input) { + size_t index = find_range_index(x); + uint32_t descriptor = table[index][1]; + uint8_t code = uint8_t(descriptor); + switch (code) { + case 0: + break; // nothing to do, ignored + case 1: + answer.push_back(x); // valid, we just copy it to output + break; + case 2: + return error; // disallowed + break; - ada_warn_unused std::string to_string(ada::encoding_type type) { - switch(type) { - case ada::encoding_type::UTF8 : return "UTF-8"; - case ada::encoding_type::UTF_16LE : return "UTF-16LE"; - case ada::encoding_type::UTF_16BE : return "UTF-16BE"; - default: unreachable(); + // case 3 : + default: + // We have a mapping + { + size_t char_count = (descriptor >> 24); + uint16_t char_index = uint16_t(descriptor >> 8); + for (size_t idx = char_index; idx < char_index + char_count; idx++) { + answer.push_back(mappings[idx]); + } + } } } + return answer; +} +} // namespace ada::idna +/* end file src/mapping.cpp */ +/* begin file src/normalization.cpp */ + +/* begin file src/unilib/uninorms.h */ +// This file is part of UniLib . +// +// Copyright 2014 Institute of Formal and Applied Linguistics, Faculty of +// Mathematics and Physics, Charles University in Prague, Czech Republic. +// +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at http://mozilla.org/MPL/2.0/. +// +// UniLib version: 3.3.1-dev +// Unicode version: 15.0.0 + + +#include +#include -} // namespace ada -/* end file src/implementation.cpp */ -// dofile: invoked with prepath=/Users/dlemire/CVS/github/ada/src, filename=helpers.cpp -/* begin file src/helpers.cpp */ +namespace ufal { +namespace unilib { + +class uninorms { + public: + static void nfc(std::u32string& str); + static void nfd(std::u32string& str); + static void nfkc(std::u32string& str); + static void nfkd(std::u32string& str); + + private: + static void compose(std::u32string& str); + static void decompose(std::u32string& str, bool kanonical); + + static const char32_t CHARS = 0x110000; + + struct Hangul { + // Hangul decomposition and composition + static const char32_t SBase = 0xAC00, LBase = 0x1100, VBase = 0x1161, + TBase = 0x11A7; + static const char32_t LCount = 19, VCount = 21, TCount = 28, + NCount = VCount * TCount, SCount = LCount * NCount; + }; + + static const uint8_t ccc_index[CHARS >> 8]; + static const uint8_t ccc_block[][256]; + + static const uint8_t composition_index[CHARS >> 8]; + static const uint16_t composition_block[][257]; + static const char32_t composition_data[]; + + static const uint8_t decomposition_index[CHARS >> 8]; + static const uint16_t decomposition_block[][257]; + static const char32_t decomposition_data[]; +}; + +} // namespace unilib +} // namespace ufal +/* end file src/unilib/uninorms.h */ +/* begin file src/unilib/uninorms.cpp */ +// This file is part of UniLib . +// +// Copyright 2014 Institute of Formal and Applied Linguistics, Faculty of +// Mathematics and Physics, Charles University in Prague, Czech Republic. +// +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at http://mozilla.org/MPL/2.0/. +// +// UniLib version: 3.3.1-dev +// Unicode version: 15.0.0 + + +namespace ufal { +namespace unilib { + +void uninorms::nfc(std::u32string& str) { + decompose(str, false); + compose(str); +} -#include -#include -#include -#include +void uninorms::nfd(std::u32string& str) { decompose(str, false); } -namespace ada::helpers { +void uninorms::nfkc(std::u32string& str) { + decompose(str, true); + compose(str); +} - template - void encode_json(std::string_view view, out_iter out) { - // trivial implementation. could be faster. - const char * hexvalues = "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f"; - for(uint8_t c : view) { - if(c == '\\') { - *out++ = '\\'; *out++ = '\\'; - } else if(c == '"') { - *out++ = '\\'; *out++ = '"'; - } else if(c <= 0x1f) { - *out++ = '\\'; *out++= 'u'; *out++= '0'; *out++= '0'; - *out++ = hexvalues[2*c]; - *out++ = hexvalues[2*c+1]; - } else { - *out++ = c; - } - } - } - - ada_unused std::string get_state(ada::state s) { - switch (s) { - case ada::state::AUTHORITY: return "Authority"; - case ada::state::SCHEME_START: return "Scheme Start"; - case ada::state::SCHEME: return "Scheme"; - case ada::state::HOST: return "Host"; - case ada::state::NO_SCHEME: return "No Scheme"; - case ada::state::FRAGMENT: return "Fragment"; - case ada::state::RELATIVE_SCHEME: return "Relative Scheme"; - case ada::state::RELATIVE_SLASH: return "Relative Slash"; - case ada::state::FILE: return "File"; - case ada::state::FILE_HOST: return "File Host"; - case ada::state::FILE_SLASH: return "File Slash"; - case ada::state::PATH_OR_AUTHORITY: return "Path or Authority"; - case ada::state::SPECIAL_AUTHORITY_IGNORE_SLASHES: return "Special Authority Ignore Slashes"; - case ada::state::SPECIAL_AUTHORITY_SLASHES: return "Special Authority Slashes"; - case ada::state::SPECIAL_RELATIVE_OR_AUTHORITY: return "Special Relative or Authority"; - case ada::state::QUERY: return "Query"; - case ada::state::PATH: return "Path"; - case ada::state::PATH_START: return "Path Start"; - case ada::state::OPAQUE_PATH: return "Opaque Path"; - case ada::state::PORT: return "Port"; - default: return "unknown state"; - } - } - - ada_really_inline std::optional prune_fragment(std::string_view& input) noexcept { - // compiles down to 20--30 instructions including a class to memchr (C function). - // this function should be quite fast. - size_t location_of_first = input.find('#'); - if(location_of_first == std::string_view::npos) { return std::nullopt; } - std::string_view fragment = input; - fragment.remove_prefix(location_of_first+1); - input.remove_suffix(input.size() - location_of_first); - return fragment; - } - - ada_really_inline void shorten_path(std::string& path, ada::scheme::type type) noexcept { - size_t first_delimiter = path.find_first_of('/', 1); - - // Let path be url’s path. - // If url’s scheme is "file", path’s size is 1, and path[0] is a normalized Windows drive letter, then return. - if (type == ada::scheme::type::FILE && first_delimiter == std::string_view::npos) { - if (checkers::is_normalized_windows_drive_letter(std::string_view(path.data() + 1, first_delimiter - 1))) { - return; +void uninorms::nfkd(std::u32string& str) { decompose(str, true); } + +void uninorms::compose(std::u32string& str) { + size_t old, com; + for (old = 0, com = 0; old < str.size(); old++, com++) { + str[com] = str[old]; + if (str[old] >= Hangul::LBase && + str[old] < Hangul::LBase + Hangul::LCount) { + // Check Hangul composition L + V [+ T]. + if (old + 1 < str.size() && str[old + 1] >= Hangul::VBase && + str[old + 1] < Hangul::VBase + Hangul::VCount) { + str[com] = + Hangul::SBase + ((str[old] - Hangul::LBase) * Hangul::VCount + + str[old + 1] - Hangul::VBase) * + Hangul::TCount; + old++; + if (old + 1 < str.size() && str[old + 1] > Hangul::TBase && + str[old + 1] < Hangul::TBase + Hangul::TCount) + str[com] += str[++old] - Hangul::TBase; } - } + } else if (str[old] >= Hangul::SBase && + str[old] < Hangul::SBase + Hangul::SCount) { + // Check Hangul composition LV + T + if ((str[old] - Hangul::SBase) % Hangul::TCount && old + 1 < str.size() && + str[old + 1] > Hangul::TBase && + str[old + 1] < Hangul::TBase + Hangul::TCount) + str[com] += str[++old] - Hangul::TBase; + } else if (str[old] < CHARS) { + // Check composition_data + auto composition = + &composition_block[composition_index[str[old] >> 8]][str[old] & 0xFF]; + auto starter = com; + for (int last_ccc = -1; old + 1 < str.size(); old++) { + int ccc = + str[old + 1] < CHARS + ? ccc_block[ccc_index[str[old + 1] >> 8]][str[old + 1] & 0xFF] + : 0; + if (composition[1] - composition[0] && last_ccc < ccc) { + // Try finding a composition. + auto l = composition[0], r = composition[1]; + while (l + 2 < r) { + auto m = l + (((r - l) >> 1) & ~1); + if (composition_data[m] <= str[old + 1]) l = m; + if (composition_data[m] >= str[old + 1]) r = m; + } + if (composition_data[l] == str[old + 1]) { + // Found a composition. + str[starter] = composition_data[l + 1]; + composition = + &composition_block[composition_index[composition_data[l + 1] >> + 8]] + [composition_data[l + 1] & 0xFF]; + continue; + } + } - // Remove path’s last item, if any. - if (!path.empty()) { - path.erase(path.rfind('/')); + if (!ccc) break; + last_ccc = ccc; + str[++com] = str[old + 1]; + } } } - ada_really_inline void remove_ascii_tab_or_newline(std::string& input) noexcept { - // if this ever becomes a performance issue, we could use an approach similar to has_tabs_or_newline - input.erase(std::remove_if(input.begin(), input.end(), [](char c) { - return ada::unicode::is_ascii_tab_or_newline(c); - }), input.end()); - } - - ada_really_inline std::string_view substring(std::string_view input, size_t pos) noexcept { - ada_log("substring(", input, " [", input.size() ,"bytes],", pos, ")"); - return pos > input.size() ? std::string_view() : input.substr(pos); - } - - // Reverse the byte order. - ada_really_inline uint64_t swap_bytes(uint64_t val) noexcept { - // performance: this often compiles to a single instruction (e.g., bswap) - return ((((val) & 0xff00000000000000ull) >> 56) | - (((val) & 0x00ff000000000000ull) >> 40) | - (((val) & 0x0000ff0000000000ull) >> 24) | - (((val) & 0x000000ff00000000ull) >> 8 ) | - (((val) & 0x00000000ff000000ull) << 8 ) | - (((val) & 0x0000000000ff0000ull) << 24) | - (((val) & 0x000000000000ff00ull) << 40) | - (((val) & 0x00000000000000ffull) << 56)); - } + if (com < old) str.resize(com); +} - ada_really_inline uint64_t swap_bytes_if_big_endian(uint64_t val) noexcept { - // performance: under little-endian systems (most systems), this function - // is free (just returns the input). -#if ADA_IS_BIG_ENDIAN - return swap_bytes(val); -#else - return val; // unchanged (trivial) -#endif +void uninorms::decompose(std::u32string& str, bool kompatibility) { + // Count how much additional space do we need. + bool any_decomposition = false; + size_t additional = 0; + for (auto&& chr : str) { + int decomposition_len = 0; + + if (chr >= Hangul::SBase && chr < Hangul::SBase + Hangul::SCount) { + // Hangul decomposition. + decomposition_len = 2 + ((chr - Hangul::SBase) % Hangul::TCount ? 1 : 0); + } else if (chr < CHARS) { + // Check decomposition_data. + auto decomposition = + &decomposition_block[decomposition_index[chr >> 8]][chr & 0xFF]; + decomposition_len = (decomposition[1] >> 2) - (decomposition[0] >> 2); + if (decomposition_len && !kompatibility && (decomposition[0] & 1)) + decomposition_len = 0; + if (decomposition_len && kompatibility && (decomposition[0] & 2)) + // Further kompatibility decomposition. + for (auto i = decomposition[0] >> 2; i < decomposition[1] >> 2; i++) { + auto further_decomposition = + &decomposition_block[decomposition_index[decomposition_data[i] >> + 8]] + [decomposition_data[i] & 0xFF]; + if (further_decomposition[0] & 1) + decomposition_len += (further_decomposition[1] >> 2) - + (further_decomposition[0] >> 2) - 1; + } + } + // Do we decompose current character? + if (!decomposition_len) continue; + any_decomposition = true; + additional += decomposition_len - 1; } - // starting at index location, this finds the next location of a character - // :, /, \\, ? or [. If none is found, view.size() is returned. - // For use within get_host_delimiter_location. - ada_really_inline size_t find_next_host_delimiter_special(std::string_view view, size_t location) noexcept { - // performance: if you plan to call find_next_host_delimiter more than once, - // you *really* want find_next_host_delimiter to be inlined, because - // otherwise, the constants may get reloaded each time (bad). - auto has_zero_byte = [](uint64_t v) { - return ((v - 0x0101010101010101) & ~(v)&0x8080808080808080); - }; - auto index_of_first_set_byte = [](uint64_t v) { - return ((((v - 1) & 0x101010101010101) * 0x101010101010101) >> 56) - 1; - }; - auto broadcast = [](uint8_t v) -> uint64_t { return 0x101010101010101 * v; }; - size_t i = location; - uint64_t mask1 = broadcast(':'); - uint64_t mask2 = broadcast('/'); - uint64_t mask3 = broadcast('\\'); - uint64_t mask4 = broadcast('?'); - uint64_t mask5 = broadcast('['); - // This loop will get autovectorized under many optimizing compilers, - // so you get actually SIMD! - for (; i + 7 < view.size(); i += 8) { - uint64_t word{}; - // performance: the next memcpy translates into a single CPU instruction. - memcpy(&word, view.data() + i, sizeof(word)); - // performance: on little-endian systems (most systems), this next line is free. - word = swap_bytes_if_big_endian(word); - uint64_t xor1 = word ^ mask1; - uint64_t xor2 = word ^ mask2; - uint64_t xor3 = word ^ mask3; - uint64_t xor4 = word ^ mask4; - uint64_t xor5 = word ^ mask5; - uint64_t is_match = has_zero_byte(xor1) | has_zero_byte(xor2) | has_zero_byte(xor3) | has_zero_byte(xor4) | has_zero_byte(xor5); - if(is_match) { - return i + index_of_first_set_byte(is_match); - } - } - if (i < view.size()) { - uint64_t word{}; - // performance: the next memcpy translates into a function call, but - // that is difficult to avoid. Might be a bit expensive. - memcpy(&word, view.data() + i, view.size() - i); - word = swap_bytes_if_big_endian(word); - uint64_t xor1 = word ^ mask1; - uint64_t xor2 = word ^ mask2; - uint64_t xor3 = word ^ mask3; - uint64_t xor4 = word ^ mask4; - uint64_t xor5 = word ^ mask5; - uint64_t is_match = has_zero_byte(xor1) | has_zero_byte(xor2) | has_zero_byte(xor3) | has_zero_byte(xor4) | has_zero_byte(xor5); - if(is_match) { - return i + index_of_first_set_byte(is_match); - } - } - return view.size(); - } - - // starting at index location, this finds the next location of a character - // :, /, ? or [. If none is found, view.size() is returned. - // For use within get_host_delimiter_location. - ada_really_inline size_t find_next_host_delimiter(std::string_view view, size_t location) noexcept { - // performance: if you plan to call find_next_host_delimiter more than once, - // you *really* want find_next_host_delimiter to be inlined, because - // otherwise, the constants may get reloaded each time (bad). - auto has_zero_byte = [](uint64_t v) { - return ((v - 0x0101010101010101) & ~(v)&0x8080808080808080); - }; - auto index_of_first_set_byte = [](uint64_t v) { - return ((((v - 1) & 0x101010101010101) * 0x101010101010101) >> 56) - 1; - }; - auto broadcast = [](uint8_t v) -> uint64_t { return 0x101010101010101 * v; }; - size_t i = location; - uint64_t mask1 = broadcast(':'); - uint64_t mask2 = broadcast('/'); - uint64_t mask4 = broadcast('?'); - uint64_t mask5 = broadcast('['); - // This loop will get autovectorized under many optimizing compilers, - // so you get actually SIMD! - for (; i + 7 < view.size(); i += 8) { - uint64_t word{}; - // performance: the next memcpy translates into a single CPU instruction. - memcpy(&word, view.data() + i, sizeof(word)); - // performance: on little-endian systems (most systems), this next line is free. - word = swap_bytes_if_big_endian(word); - uint64_t xor1 = word ^ mask1; - uint64_t xor2 = word ^ mask2; - uint64_t xor4 = word ^ mask4; - uint64_t xor5 = word ^ mask5; - uint64_t is_match = has_zero_byte(xor1) | has_zero_byte(xor2) | has_zero_byte(xor4) | has_zero_byte(xor5); - if(is_match) { - return i + index_of_first_set_byte(is_match); - } - } - if (i < view.size()) { - uint64_t word{}; - // performance: the next memcpy translates into a function call, but - // that is difficult to avoid. Might be a bit expensive. - memcpy(&word, view.data() + i, view.size() - i); - // performance: on little-endian systems (most systems), this next line is free. - word = swap_bytes_if_big_endian(word); - uint64_t xor1 = word ^ mask1; - uint64_t xor2 = word ^ mask2; - uint64_t xor4 = word ^ mask4; - uint64_t xor5 = word ^ mask5; - uint64_t is_match = has_zero_byte(xor1) | has_zero_byte(xor2) | has_zero_byte(xor4) | has_zero_byte(xor5); - if(is_match) { - return i + index_of_first_set_byte(is_match); - } - } - return view.size(); - } - - ada_really_inline std::pair get_host_delimiter_location(const bool is_special, std::string_view& view) noexcept { - /** - * The spec at https://url.spec.whatwg.org/#hostname-state expects us to compute - * a variable called insideBrackets but this variable is only used once, to check - * whether a ':' character was found outside brackets. - * Exact text: - * "Otherwise, if c is U+003A (:) and insideBrackets is false, then:". - * It is conceptually simpler and arguably more efficient to just return a Boolean - * indicating whether ':' was found outside brackets. - */ - const size_t view_size = view.size(); - size_t location = 0; - bool found_colon = false; - /** - * Performance analysis: - * - * We are basically seeking the end of the hostname which can be indicated - * by the end of the view, or by one of the characters ':', '/', '?', '\\' (where '\\' is only - * applicable for special URLs). However, these must appear outside a bracket range. E.g., - * if you have [something?]fd: then the '?' does not count. - * - * So we can skip ahead to the next delimiter, as long as we include '[' in the set of delimiters, - * and that we handle it first. - * - * So the trick is to have a fast function that locates the next delimiter. Unless we find '[', - * then it only needs to be called once! Ideally, such a function would be provided by the C++ - * standard library, but it seems that find_first_of is not very fast, so we are forced to roll - * our own. - * - * We do not break into two loops for speed, but for clarity. - */ - if(is_special) { - // We move to the next delimiter. - location = find_next_host_delimiter_special(view, location); - // Unless we find '[' then we are going only going to have to call - // find_next_host_delimiter_special once. - for (;location < view_size; location = find_next_host_delimiter_special(view, location)) { - if (view[location] == '[') { - location = view.find(']', location); - if (location == std::string_view::npos) { - // performance: view.find might get translated to a memchr, which - // has no notion of std::string_view::npos, so the code does not - // reflect the assembly. - location = view_size; - break; - } - } else { - found_colon = view[location] == ':'; - break; - } - } - } else { - // We move to the next delimiter. - location = find_next_host_delimiter(view, location); - // Unless we find '[' then we are going only going to have to call - // find_next_host_delimiter_special once. - for (;location < view_size; location = find_next_host_delimiter(view, location)) { - if (view[location] == '[') { - location = view.find(']', location); - if (location == std::string_view::npos) { - // performance: view.find might get translated to a memchr, which - // has no notion of std::string_view::npos, so the code does not - // reflect the assembly. - location = view_size; - break; + // If needed, allocate enough space and perform the decomposition. + if (any_decomposition) { + str.resize(str.size() + additional); + for (size_t dec = str.size(), old = dec - additional; old--;) + if (str[old] >= Hangul::SBase && + str[old] < Hangul::SBase + Hangul::SCount) { + // Hangul decomposition. + char32_t s_index = str[old] - Hangul::SBase; + if (s_index % Hangul::TCount) + str[--dec] = Hangul::TBase + s_index % Hangul::TCount; + str[--dec] = + Hangul::VBase + (s_index % Hangul::NCount) / Hangul::TCount; + str[--dec] = Hangul::LBase + s_index / Hangul::NCount; + } else if (str[old] < CHARS) { + // Check decomposition_data. + auto decomposition = + &decomposition_block[decomposition_index[str[old] >> 8]] + [str[old] & 0xFF]; + int decomposition_len = + (decomposition[1] >> 2) - (decomposition[0] >> 2); + if (decomposition_len && !kompatibility && (decomposition[0] & 1)) + decomposition_len = 0; + if (decomposition_len && kompatibility && (decomposition[0] & 2)) { + // Further kompatibility decomposition. + while (decomposition_len--) { + auto chr = + decomposition_data[(decomposition[0] >> 2) + decomposition_len]; + auto further_decomposition = + &decomposition_block[decomposition_index[chr >> 8]][chr & 0xFF]; + if (further_decomposition[0] & 1) { + for (int further_decomposition_len = + (further_decomposition[1] >> 2) - + (further_decomposition[0] >> 2); + further_decomposition_len--;) + str[--dec] = + decomposition_data[(further_decomposition[0] >> 2) + + further_decomposition_len]; + } else { + str[--dec] = chr; + } } + } else if (decomposition_len) { + // Non-recursive decomposition. + while (decomposition_len--) + str[--dec] = + decomposition_data[(decomposition[0] >> 2) + decomposition_len]; } else { - found_colon = view[location] == ':'; - break; + // No decomposition. + str[--dec] = str[old]; } + } else { + // Non-Unicode character. + str[--dec] = str[old]; } - } - // performance: remove_suffix may translate into a single instruction. - view.remove_suffix(view_size - location); - return {location, found_colon}; } - ada_really_inline void trim_c0_whitespace(std::string_view& input) noexcept { - while(!input.empty() && ada::unicode::is_c0_control_or_space(input.front())) { input.remove_prefix(1); } - while(!input.empty() && ada::unicode::is_c0_control_or_space(input.back())) { input.remove_suffix(1); } + // Sort combining marks. + for (size_t i = 1; i < str.size(); i++) { + unsigned ccc = + str[i] < CHARS ? ccc_block[ccc_index[str[i] >> 8]][str[i] & 0xFF] : 0; + if (!ccc) continue; + + auto chr = str[i]; + size_t j; + for (j = i; + j && (str[j - 1] < CHARS + ? ccc_block[ccc_index[str[j - 1] >> 8]][str[j - 1] & 0xFF] + : 0) > ccc; + j--) + str[j] = str[j - 1]; + str[j] = chr; } +} +// Data fields +const char32_t uninorms::CHARS; + +const char32_t uninorms::Hangul::SBase; +const char32_t uninorms::Hangul::LBase; +const char32_t uninorms::Hangul::VBase; +const char32_t uninorms::Hangul::TBase; +const char32_t uninorms::Hangul::LCount; +const char32_t uninorms::Hangul::VCount; +const char32_t uninorms::Hangul::TCount; +const char32_t uninorms::Hangul::NCount; +const char32_t uninorms::Hangul::SCount; + +const uint8_t uninorms::ccc_index[uninorms::CHARS >> 8] = { + 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 0, 0, + 15, 0, 0, 0, 16, 17, 18, 19, 20, 21, 22, 0, 0, 23, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 24, 25, 0, 0, 26, 0, 0, 0, 0, 0, 0, 0, 0, + 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0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, + 230, 230, 230, 230, 230, 230, 232, 220, 220, 220, 220, 232, 216, 220, 220, + 220, 220, 220, 202, 202, 220, 220, 220, 220, 202, 202, 220, 220, 220, 220, + 220, 220, 220, 220, 220, 220, 220, 1, 1, 1, 1, 1, 220, 220, 220, + 220, 230, 230, 230, 230, 230, 230, 230, 230, 240, 230, 220, 220, 220, 230, + 230, 230, 220, 220, 0, 230, 230, 230, 220, 220, 220, 220, 230, 232, 220, + 220, 230, 233, 234, 234, 233, 234, 234, 233, 230, 230, 230, 230, 230, 230, + 230, 230, 230, 230, 230, 230, 230, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 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0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 220, 230, 230, 230, 230, + 220, 230, 230, 230, 222, 220, 230, 230, 230, 230, 230, 230, 220, 220, 220, + 220, 220, 220, 230, 230, 220, 230, 230, 222, 228, 230, 10, 11, 12, 13, + 14, 15, 16, 17, 18, 19, 19, 20, 21, 22, 0, 23, 0, 24, 25, + 0, 230, 220, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 230, 230, 230, 230, 230, 230, 230, 230, 30, 31, 32, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 27, 28, 29, 30, 31, 32, 33, 34, 230, 230, 220, 220, 230, 230, 230, + 230, 230, 220, 230, 230, 220, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 35, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 230, 230, 230, 230, 230, 230, 230, 0, 0, 230, 230, + 230, 230, 220, 230, 0, 0, 230, 230, 0, 220, 230, 230, 220, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 230, 220, 230, 230, 220, 230, 230, 220, 220, 220, 230, 220, + 220, 230, 220, 230, 230, 230, 220, 230, 220, 230, 220, 230, 220, 230, 230, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 230, 230, 230, 230, 230, + 230, 230, 220, 230, 0, 0, 0, 0, 0, 0, 0, 0, 0, 220, 0, + 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 230, 230, 230, 230, 0, 230, 230, 230, + 230, 230, 230, 230, 230, 230, 0, 230, 230, 230, 0, 230, 230, 230, 230, + 230, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 220, + 220, 220, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 230, 220, 220, 220, 230, 230, 230, 230, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 230, 230, 230, 230, 230, 220, 220, 220, + 220, 220, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, + 230, 0, 220, 230, 230, 220, 230, 230, 220, 230, 230, 230, 220, 220, 220, + 27, 28, 29, 230, 230, 230, 220, 230, 230, 220, 220, 230, 230, 230, 230, + 230}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 230, 220, 230, 230, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 230, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0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0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 230, 220, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 230, 230, 230, + 230, 230, 230, 230, 230, 0, 0, 220, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 230, 230, 230, 230, + 230, 220, 220, 220, 220, 220, 220, 230, 230, 220, 0, 220, 220, 230, 230, + 220, 220, 230, 230, 230, 230, 230, 220, 230, 230, 230, 230, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0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 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 230, 230, 220, + 230, 230, 230, 230, 230, 230, 230, 220, 230, 230, 234, 214, 220, 202, 230, + 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, + 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, + 230, 230, 230, 230, 230, 230, 232, 228, 228, 220, 218, 230, 233, 220, 230, + 220}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 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5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5}; +const uint16_t uninorms::composition_block[][257] = { + {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 3, 5, 7, 7, 7, 39, 45, 55, 67, 101, 103, 117, 131, 161, + 163, 173, 185, 191, 209, 241, 245, 245, 261, 275, 289, 327, 331, 343, 347, + 365, 377, 377, 377, 377, 377, 377, 377, 409, 415, 425, 437, 471, 473, 487, + 503, 531, 535, 545, 557, 563, 581, 613, 617, 617, 633, 647, 663, 701, 705, + 719, 723, 743, 755, 755, 755, 755, 755, 755, 755, 755, 755, 755, 755, 755, + 755, 755, 755, 755, 755, 755, 755, 755, 755, 755, 755, 755, 755, 755, 755, + 755, 755, 755, 755, 755, 755, 755, 755, 755, 755, 755, 755, 755, 755, 755, + 755, 755, 755, 755, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, + 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, + 769, 769, 771, 773, 777, 779, 779, 779, 787, 787, 787, 787, 787, 789, 789, + 789, 789, 789, 797, 803, 805, 805, 807, 807, 807, 807, 815, 815, 815, 815, + 815, 815, 823, 823, 825, 827, 831, 833, 833, 833, 841, 841, 841, 841, 841, + 843, 843, 843, 843, 843, 851, 857, 859, 859, 861, 861, 861, 861, 869, 869, + 869, 869}, + {869, 869, 869, 877, 885, 885, 885, 885, 885, 885, 885, 885, 885, 885, 885, + 885, 885, 885, 885, 889, 893, 893, 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 897, 901, 901, 901, 901, 901, 901, 901, 901, 901, 901, 901, 901, + 901, 903, 905, 905, 905, 905, 905, 907, 909, 909, 909, 909, 909, 909, 909, + 911, 913, 915, 917, 917, 917, 917, 917, 917, 917, 917, 917, 917, 917, 917, + 917, 917, 917, 917, 917, 917, 917, 917, 919, 919, 919, 919, 919, 919, 919, + 919, 919, 919, 919, 919, 919, 919, 919, 919, 919, 919, 919, 919, 919, 919, + 919, 919, 919, 919, 919, 919, 919, 919, 919, 919, 919, 929, 939, 939, 939, + 939, 939, 939, 939, 939, 939, 939, 939, 939, 939, 939, 949, 959, 959, 959, + 959, 959, 959, 959, 961, 961, 961, 961, 961, 961, 961, 961, 961, 961, 961, + 961, 961, 961, 961, 961, 961, 961, 961, 961, 961, 961, 961, 961, 961, 961, + 961, 961, 961, 961, 961, 961, 961, 961, 961, 961, 961, 961, 961, 961, 961, + 961, 961, 961, 961, 961, 961, 961, 961, 961, 961, 963, 965, 965, 965, 965, + 965, 965, 965, 965, 965, 965, 965, 965, 965, 965, 965, 965, 965, 965, 965, + 965, 965}, + {965, 965, 965, 965, 965, 965, 965, 965, 965, 965, 965, 965, 965, 965, 965, + 965, 965, 965, 965, 965, 965, 965, 965, 965, 965, 965, 965, 965, 965, 965, + 965, 965, 965, 965, 965, 965, 965, 965, 965, 967, 969, 971, 973, 973, 973, + 973, 973, 975, 977, 977, 977, 977, 977, 977, 977, 977, 977, 977, 977, 977, + 977, 977, 977, 977, 977, 977, 977, 977, 977, 977, 977, 977, 977, 977, 977, + 977, 977, 977, 977, 977, 977, 977, 977, 977, 977, 977, 977, 977, 977, 977, + 977, 977, 977, 977, 977, 977, 977, 977, 977, 977, 977, 977, 977, 977, 977, + 977, 977, 977, 977, 977, 977, 977, 977, 977, 977, 977, 977, 977, 977, 977, + 977, 977, 977, 977, 977, 977, 977, 977, 977, 977, 977, 977, 977, 977, 977, + 977, 977, 977, 977, 977, 977, 977, 977, 977, 977, 977, 977, 979, 979, 979, + 979, 979, 979, 979, 979, 979, 979, 979, 979, 979, 979, 979, 979, 979, 979, + 979, 979, 979, 979, 979, 979, 979, 979, 979, 979, 979, 979, 979, 979, 979, + 979, 979, 979, 979, 979, 979, 979, 979, 979, 979, 979, 979, 979, 979, 979, + 979, 979, 979, 979, 979, 979, 979, 979, 979, 979, 979, 979, 979, 979, 979, + 979, 979, 979, 979, 979, 979, 979, 979, 979, 979, 979, 979, 979, 979, 979, + 979, 979, 979, 979, 979, 979, 979, 979, 979, 979, 979, 979, 979, 979, 979, + 979, 979, 979, 979, 979, 979, 979, 979, 979, 979, 979, 979, 979, 979, 979, + 979, 979}, + {979, 979, 979, 979, 979, 979, 979, 979, 979, 979, 979, 979, + 979, 979, 979, 979, 979, 979, 979, 979, 979, 979, 979, 979, + 979, 979, 979, 979, 979, 979, 979, 979, 979, 979, 979, 979, + 979, 979, 979, 979, 979, 979, 979, 979, 979, 979, 979, 979, + 979, 979, 979, 979, 979, 979, 979, 979, 979, 979, 979, 979, + 979, 979, 979, 979, 979, 979, 979, 979, 979, 979, 979, 979, + 979, 979, 979, 979, 979, 979, 979, 979, 979, 979, 979, 979, + 979, 979, 979, 979, 979, 979, 979, 979, 979, 979, 979, 979, + 979, 979, 979, 979, 979, 979, 979, 979, 979, 979, 979, 979, + 979, 979, 979, 979, 979, 979, 979, 979, 979, 979, 979, 979, + 979, 979, 979, 979, 979, 979, 979, 979, 979, 979, 979, 979, + 979, 979, 979, 979, 979, 979, 979, 979, 979, 979, 979, 979, + 979, 979, 993, 993, 993, 993, 1001, 1001, 1011, 1011, 1025, 1025, + 1025, 1025, 1025, 1025, 1033, 1033, 1035, 1035, 1035, 1035, 1047, 1047, + 1047, 1047, 1057, 1057, 1057, 1059, 1059, 1061, 1061, 1061, 1077, 1077, + 1077, 1077, 1085, 1085, 1097, 1097, 1113, 1113, 1113, 1113, 1113, 1113, + 1121, 1121, 1125, 1125, 1125, 1125, 1141, 1141, 1141, 1141, 1153, 1159, + 1165, 1165, 1165, 1167, 1167, 1167, 1167, 1171, 1171, 1171, 1171, 1171, + 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, + 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, + 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, + 1171, 1171, 1171, 1171, 1171}, + {1171, 1171, 1171, 1171, 1171, 1171, 1171, 1173, 1173, 1173, 1173, 1173, + 1173, 1173, 1173, 1173, 1173, 1177, 1177, 1177, 1179, 1179, 1185, 1189, + 1191, 1199, 1199, 1201, 1201, 1201, 1201, 1203, 1203, 1203, 1203, 1203, + 1211, 1211, 1211, 1211, 1213, 1213, 1213, 1213, 1215, 1215, 1217, 1217, + 1217, 1221, 1221, 1221, 1223, 1223, 1229, 1233, 1235, 1243, 1243, 1245, + 1245, 1245, 1245, 1247, 1247, 1247, 1247, 1247, 1255, 1255, 1255, 1255, + 1257, 1257, 1257, 1257, 1259, 1259, 1261, 1261, 1261, 1261, 1261, 1261, + 1261, 1261, 1261, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, + 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, + 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1263, 1265, 1267, 1267, + 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, + 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, + 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, + 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, + 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, + 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, + 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, + 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, 1267, + 1267, 1269, 1271, 1271, 1271, 1271, 1271, 1271, 1271, 1271, 1271, 1271, + 1271, 1271, 1271, 1271, 1271, 1273, 1275, 1275, 1275, 1275, 1275, 1275, + 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, + 1275, 1275, 1275, 1275, 1275}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, + 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, + 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, + 1275, 1275, 1275, 1275, 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, + 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, + 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, + 1281, 1283, 1283, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, + 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, + 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, + 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, + 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, + 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, + 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, + 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, + 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, + 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, 1285, + 1285, 1285, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, + 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1289, 1289, 1289, 1291, 1291, + 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, + 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, + 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, + 1291, 1291, 1291, 1291, 1291}, + {1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, + 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, + 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291, + 1291, 1291, 1291, 1291, 1291, 1293, 1293, 1293, 1293, 1293, 1293, 1293, + 1293, 1295, 1295, 1295, 1297, 1297, 1297, 1297, 1297, 1297, 1297, 1297, + 1297, 1297, 1297, 1297, 1297, 1297, 1297, 1297, 1297, 1297, 1297, 1297, + 1297, 1297, 1297, 1297, 1297, 1297, 1297, 1297, 1297, 1297, 1297, 1297, + 1297, 1297, 1297, 1297, 1297, 1297, 1297, 1297, 1297, 1297, 1297, 1297, + 1297, 1297, 1297, 1297, 1297, 1297, 1297, 1297, 1297, 1297, 1297, 1297, + 1297, 1297, 1297, 1297, 1297, 1297, 1297, 1297, 1297, 1297, 1297, 1297, + 1297, 1297, 1297, 1297, 1297, 1297, 1297, 1297, 1297, 1297, 1297, 1297, + 1297, 1297, 1297, 1297, 1297, 1297, 1297, 1297, 1297, 1297, 1297, 1297, + 1297, 1297, 1297, 1297, 1297, 1297, 1297, 1297, 1297, 1297, 1297, 1297, + 1297, 1297, 1297, 1297, 1297, 1297, 1297, 1297, 1297, 1297, 1297, 1297, + 1297, 1297, 1297, 1297, 1297, 1297, 1297, 1297, 1297, 1297, 1297, 1297, + 1297, 1297, 1297, 1297, 1297, 1297, 1297, 1297, 1297, 1297, 1297, 1297, + 1297, 1297, 1297, 1297, 1297, 1297, 1297, 1297, 1301, 1301, 1301, 1301, + 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, + 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, + 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, + 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, + 1301, 1301, 1301, 1301, 1301}, + {1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, + 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, + 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, + 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, + 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, + 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, + 1307, 1307, 1307, 1307, 1307, 1307, 1307, 1307, 1307, 1307, 1307, 1307, + 1307, 1307, 1307, 1307, 1307, 1307, 1307, 1307, 1307, 1307, 1307, 1307, + 1307, 1307, 1307, 1307, 1307, 1307, 1307, 1307, 1307, 1307, 1307, 1307, + 1307, 1307, 1307, 1307, 1307, 1307, 1307, 1307, 1307, 1307, 1307, 1307, + 1307, 1307, 1307, 1307, 1307, 1307, 1307, 1307, 1307, 1307, 1307, 1307, + 1307, 1307, 1307, 1307, 1307, 1307, 1307, 1307, 1307, 1307, 1307, 1307, + 1307, 1307, 1307, 1309, 1309, 1309, 1309, 1309, 1309, 1309, 1309, 1309, + 1309, 1309, 1309, 1309, 1309, 1309, 1309, 1309, 1309, 1309, 1309, 1309, + 1309, 1309, 1309, 1309, 1309, 1309, 1309, 1309, 1309, 1309, 1309, 1309, + 1309, 1309, 1309, 1309, 1309, 1309, 1309, 1309, 1309, 1309, 1309, 1309, + 1309, 1309, 1309, 1309, 1309, 1309, 1309, 1313, 1315, 1315, 1315, 1315, + 1315, 1315, 1315, 1315, 1315, 1315, 1315, 1315, 1315, 1315, 1315, 1315, + 1315, 1315, 1315, 1315, 1315, 1315, 1315, 1315, 1315, 1315, 1315, 1315, + 1315, 1315, 1315, 1315, 1315, 1315, 1315, 1315, 1315, 1315, 1315, 1315, + 1315, 1315, 1315, 1315, 1315, 1315, 1315, 1315, 1315, 1315, 1315, 1315, + 1315, 1315, 1315, 1315, 1315}, + {1315, 1315, 1315, 1315, 1315, 1315, 1315, 1315, 1315, 1315, 1315, 1315, + 1315, 1315, 1315, 1315, 1315, 1315, 1315, 1315, 1315, 1315, 1315, 1315, + 1315, 1315, 1315, 1315, 1315, 1315, 1315, 1315, 1315, 1315, 1315, 1315, + 1315, 1315, 1315, 1315, 1315, 1315, 1315, 1315, 1315, 1315, 1315, 1315, + 1315, 1315, 1315, 1315, 1315, 1315, 1315, 1315, 1315, 1315, 1315, 1315, + 1315, 1315, 1315, 1315, 1315, 1315, 1315, 1315, 1315, 1315, 1315, 1317, + 1317, 1317, 1317, 1317, 1317, 1317, 1317, 1317, 1317, 1317, 1317, 1317, + 1317, 1317, 1317, 1317, 1317, 1317, 1317, 1317, 1317, 1317, 1317, 1317, + 1317, 1317, 1317, 1317, 1317, 1317, 1317, 1317, 1317, 1317, 1317, 1317, + 1317, 1317, 1317, 1317, 1317, 1317, 1317, 1317, 1317, 1317, 1317, 1317, + 1317, 1317, 1317, 1317, 1317, 1317, 1317, 1317, 1317, 1317, 1317, 1317, + 1317, 1317, 1317, 1317, 1317, 1317, 1317, 1317, 1317, 1317, 1317, 1317, + 1317, 1317, 1317, 1317, 1317, 1317, 1317, 1317, 1317, 1317, 1317, 1317, + 1317, 1317, 1317, 1317, 1317, 1317, 1317, 1317, 1317, 1317, 1317, 1317, + 1317, 1317, 1317, 1317, 1317, 1317, 1317, 1317, 1317, 1317, 1317, 1317, + 1317, 1317, 1317, 1317, 1317, 1317, 1317, 1317, 1317, 1317, 1317, 1317, + 1319, 1319, 1319, 1319, 1319, 1319, 1319, 1325, 1325, 1325, 1325, 1327, + 1327, 1327, 1327, 1327, 1327, 1327, 1327, 1327, 1327, 1327, 1327, 1327, + 1327, 1327, 1327, 1327, 1327, 1327, 1327, 1327, 1327, 1327, 1327, 1327, + 1327, 1327, 1327, 1327, 1327, 1327, 1327, 1327, 1327, 1327, 1327, 1327, + 1327, 1327, 1327, 1327, 1327, 1327, 1327, 1327, 1327, 1327, 1327, 1327, + 1327, 1327, 1327, 1327, 1327}, + {1327, 1327, 1327, 1327, 1327, 1327, 1327, 1327, 1327, 1327, 1327, 1327, + 1327, 1327, 1327, 1327, 1327, 1327, 1327, 1327, 1327, 1327, 1327, 1327, + 1327, 1327, 1327, 1327, 1327, 1327, 1327, 1327, 1327, 1327, 1327, 1327, + 1327, 1327, 1327, 1327, 1327, 1327, 1327, 1327, 1327, 1327, 1327, 1327, + 1327, 1327, 1327, 1327, 1327, 1327, 1327, 1327, 1327, 1327, 1327, 1327, + 1327, 1327, 1327, 1327, 1327, 1327, 1327, 1327, 1327, 1327, 1327, 1331, + 1333, 1333, 1333, 1333, 1333, 1333, 1333, 1333, 1333, 1333, 1333, 1333, + 1333, 1333, 1333, 1333, 1333, 1333, 1333, 1333, 1333, 1333, 1333, 1333, + 1333, 1333, 1333, 1333, 1333, 1333, 1333, 1333, 1333, 1333, 1333, 1333, + 1333, 1333, 1333, 1333, 1333, 1333, 1333, 1333, 1333, 1333, 1333, 1333, + 1333, 1333, 1333, 1333, 1333, 1333, 1333, 1333, 1333, 1333, 1333, 1333, + 1333, 1333, 1333, 1333, 1333, 1333, 1333, 1333, 1333, 1333, 1333, 1333, + 1333, 1333, 1333, 1333, 1333, 1333, 1333, 1333, 1333, 1333, 1333, 1333, + 1333, 1333, 1333, 1333, 1333, 1333, 1333, 1333, 1333, 1333, 1333, 1333, + 1333, 1333, 1333, 1333, 1333, 1333, 1333, 1333, 1333, 1333, 1333, 1333, + 1333, 1333, 1333, 1333, 1333, 1333, 1333, 1333, 1333, 1333, 1333, 1333, + 1333, 1333, 1333, 1333, 1333, 1333, 1333, 1333, 1333, 1333, 1333, 1333, + 1333, 1333, 1333, 1333, 1333, 1333, 1333, 1333, 1333, 1333, 1333, 1333, + 1333, 1333, 1339, 1339, 1339, 1341, 1341, 1341, 1341, 1341, 1341, 1341, + 1341, 1341, 1341, 1341, 1341, 1341, 1341, 1341, 1341, 1341, 1341, 1341, + 1341, 1341, 1341, 1341, 1341, 1341, 1341, 1341, 1341, 1341, 1341, 1341, + 1341, 1341, 1341, 1341, 1341}, + {1341, 1341, 1341, 1341, 1341, 1341, 1341, 1341, 1341, 1341, 1341, 1341, + 1341, 1341, 1341, 1341, 1341, 1341, 1341, 1341, 1341, 1341, 1341, 1341, + 1341, 1341, 1341, 1341, 1341, 1341, 1341, 1341, 1341, 1341, 1341, 1341, + 1341, 1341, 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, + 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, + 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, + 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, + 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, + 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, + 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, + 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, + 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, + 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, + 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, + 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, + 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, + 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, + 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, + 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, + 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, + 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, + 1343, 1343, 1343, 1343, 1343}, + {1343, 1343, 1343, 1343, 1343, 1343, 1345, 1345, 1347, 1347, 1349, 1349, + 1351, 1351, 1353, 1353, 1353, 1353, 1355, 1355, 1355, 1355, 1355, 1355, + 1355, 1355, 1355, 1355, 1355, 1355, 1355, 1355, 1355, 1355, 1355, 1355, + 1355, 1355, 1355, 1355, 1355, 1355, 1355, 1355, 1355, 1355, 1355, 1355, + 1355, 1355, 1355, 1355, 1355, 1355, 1355, 1355, 1355, 1355, 1355, 1357, + 1357, 1359, 1359, 1361, 1363, 1363, 1363, 1365, 1365, 1365, 1365, 1365, + 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, + 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, + 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, + 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, + 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, + 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, + 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, + 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, + 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, + 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, + 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, + 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, + 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, + 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, + 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, + 1365, 1365, 1365, 1365, 1365}, + {1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, + 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, + 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, + 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1365, + 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1367, 1369, 1369, 1369, 1369, + 1369, 1369, 1369, 1369, 1369, 1369, 1369, 1369, 1369, 1369, 1369, 1369, + 1369, 1369, 1369, 1369, 1369, 1369, 1369, 1369, 1369, 1369, 1369, 1369, + 1369, 1369, 1369, 1369, 1369, 1369, 1369, 1371, 1373, 1373, 1373, 1373, + 1373, 1373, 1373, 1375, 1377, 1377, 1377, 1377, 1377, 1377, 1377, 1377, + 1377, 1377, 1377, 1377, 1377, 1377, 1377, 1377, 1377, 1377, 1377, 1377, + 1377, 1377, 1377, 1377, 1377, 1377, 1377, 1377, 1377, 1377, 1377, 1377, + 1377, 1377, 1377, 1377, 1377, 1377, 1377, 1377, 1377, 1377, 1377, 1377, + 1377, 1377, 1377, 1377, 1377, 1377, 1377, 1377, 1377, 1377, 1377, 1377, + 1377, 1377, 1377, 1377, 1377, 1381, 1385, 1385, 1385, 1385, 1385, 1385, + 1385, 1385, 1385, 1385, 1385, 1385, 1385, 1385, 1385, 1385, 1385, 1385, + 1385, 1385, 1385, 1385, 1385, 1387, 1389, 1389, 1389, 1389, 1389, 1389, + 1389, 1389, 1389, 1389, 1389, 1389, 1389, 1389, 1389, 1389, 1389, 1389, + 1389, 1391, 1393, 1393, 1393, 1393, 1393, 1393, 1393, 1393, 1393, 1393, + 1393, 1393, 1393, 1393, 1393, 1393, 1393, 1393, 1393, 1393, 1393, 1393, + 1393, 1393, 1393, 1393, 1393, 1393, 1393, 1393, 1393, 1393, 1393, 1393, + 1393, 1393, 1393, 1393, 1393, 1393, 1393, 1393, 1393, 1393, 1393, 1393, + 1393, 1393, 1393, 1393, 1393}, + {1393, 1401, 1409, 1411, 1413, 1415, 1417, 1419, 1421, 1429, 1437, 1439, + 1441, 1443, 1445, 1447, 1449, 1453, 1457, 1457, 1457, 1457, 1457, 1457, + 1457, 1461, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1473, 1481, 1483, + 1485, 1487, 1489, 1491, 1493, 1501, 1509, 1511, 1513, 1515, 1517, 1519, + 1521, 1527, 1533, 1533, 1533, 1533, 1533, 1533, 1533, 1539, 1545, 1545, + 1545, 1545, 1545, 1545, 1545, 1549, 1553, 1553, 1553, 1553, 1553, 1553, + 1553, 1557, 1561, 1561, 1561, 1561, 1561, 1561, 1561, 1567, 1573, 1573, + 1573, 1573, 1573, 1573, 1573, 1573, 1579, 1579, 1579, 1579, 1579, 1579, + 1579, 1587, 1595, 1597, 1599, 1601, 1603, 1605, 1607, 1615, 1623, 1625, + 1627, 1629, 1631, 1633, 1635, 1637, 1637, 1637, 1637, 1639, 1639, 1639, + 1639, 1639, 1639, 1639, 1639, 1641, 1641, 1641, 1641, 1641, 1641, 1641, + 1641, 1641, 1641, 1641, 1641, 1641, 1641, 1641, 1641, 1641, 1641, 1641, + 1641, 1641, 1641, 1641, 1641, 1641, 1641, 1641, 1641, 1641, 1641, 1641, + 1641, 1641, 1641, 1641, 1641, 1641, 1641, 1641, 1641, 1641, 1641, 1641, + 1641, 1641, 1641, 1641, 1641, 1641, 1641, 1641, 1641, 1641, 1641, 1641, + 1641, 1641, 1641, 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, 1643, + 1649, 1649, 1649, 1649, 1649, 1649, 1649, 1651, 1651, 1651, 1651, 1651, + 1651, 1651, 1651, 1651, 1651, 1651, 1651, 1651, 1651, 1651, 1651, 1651, + 1651, 1651, 1651, 1651, 1651, 1651, 1651, 1651, 1651, 1651, 1651, 1651, + 1651, 1651, 1651, 1651, 1651, 1651, 1651, 1651, 1651, 1651, 1651, 1651, + 1651, 1651, 1651, 1651, 1651, 1651, 1651, 1653, 1653, 1653, 1653, 1653, + 1653, 1653, 1653, 1659, 1659}, + {1659, 1659, 1659, 1659, 1659, 1659, 1659, 1659, 1659, 1659, 1659, 1659, + 1659, 1659, 1659, 1659, 1659, 1659, 1659, 1659, 1659, 1659, 1659, 1659, + 1659, 1659, 1659, 1659, 1659, 1659, 1659, 1659, 1659, 1659, 1659, 1659, + 1659, 1659, 1659, 1659, 1659, 1659, 1659, 1659, 1659, 1659, 1659, 1659, + 1659, 1659, 1659, 1659, 1659, 1659, 1659, 1659, 1659, 1659, 1659, 1659, + 1659, 1659, 1659, 1659, 1659, 1659, 1659, 1659, 1659, 1659, 1659, 1659, + 1659, 1659, 1659, 1659, 1659, 1659, 1659, 1659, 1659, 1659, 1659, 1659, + 1659, 1659, 1659, 1659, 1659, 1659, 1659, 1659, 1659, 1659, 1659, 1659, + 1659, 1659, 1659, 1659, 1659, 1659, 1659, 1659, 1659, 1659, 1659, 1659, + 1659, 1659, 1659, 1659, 1659, 1659, 1659, 1659, 1659, 1659, 1659, 1659, + 1659, 1659, 1659, 1659, 1659, 1659, 1659, 1659, 1659, 1659, 1659, 1659, + 1659, 1659, 1659, 1659, 1659, 1659, 1659, 1659, 1659, 1659, 1659, 1659, + 1659, 1661, 1661, 1663, 1663, 1665, 1665, 1665, 1665, 1665, 1665, 1665, + 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, + 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, + 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, + 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, 1665, + 1665, 1665, 1665, 1665, 1665, 1667, 1667, 1669, 1669, 1671, 1671, 1671, + 1671, 1671, 1671, 1671, 1671, 1671, 1671, 1671, 1671, 1671, 1671, 1671, + 1671, 1671, 1671, 1671, 1671, 1671, 1671, 1671, 1671, 1671, 1671, 1671, + 1671, 1671, 1671, 1671, 1671, 1671, 1671, 1671, 1671, 1671, 1671, 1671, + 1671, 1671, 1671, 1671, 1671}, + {1671, 1671, 1671, 1671, 1673, 1673, 1673, 1673, 1673, 1675, 1675, 1675, + 1677, 1677, 1677, 1677, 1677, 1677, 1677, 1677, 1677, 1677, 1677, 1677, + 1677, 1677, 1677, 1677, 1677, 1677, 1677, 1677, 1677, 1677, 1677, 1677, + 1679, 1679, 1681, 1681, 1681, 1681, 1681, 1681, 1681, 1681, 1681, 1681, + 1681, 1681, 1681, 1681, 1681, 1681, 1681, 1681, 1681, 1681, 1681, 1681, + 1681, 1683, 1683, 1683, 1683, 1683, 1683, 1683, 1685, 1685, 1687, 1687, + 1687, 1689, 1689, 1689, 1689, 1689, 1691, 1691, 1691, 1691, 1691, 1691, + 1691, 1691, 1691, 1691, 1691, 1691, 1691, 1691, 1691, 1691, 1691, 1691, + 1691, 1691, 1693, 1693, 1693, 1695, 1697, 1697, 1697, 1697, 1697, 1697, + 1697, 1697, 1697, 1697, 1697, 1697, 1697, 1699, 1701, 1701, 1701, 1703, + 1705, 1705, 1705, 1707, 1709, 1711, 1713, 1713, 1713, 1713, 1713, 1715, + 1717, 1717, 1717, 1719, 1721, 1721, 1721, 1721, 1721, 1721, 1721, 1721, + 1721, 1721, 1723, 1725, 1725, 1725, 1725, 1725, 1725, 1725, 1725, 1725, + 1725, 1725, 1725, 1725, 1725, 1725, 1725, 1727, 1727, 1727, 1727, 1727, + 1727, 1729, 1731, 1731, 1733, 1733, 1733, 1733, 1733, 1733, 1733, 1735, + 1737, 1739, 1741, 1741, 1741, 1741, 1741, 1741, 1741, 1741, 1741, 1741, + 1741, 1741, 1741, 1741, 1741, 1741, 1741, 1741, 1741, 1741, 1741, 1741, + 1741, 1741, 1741, 1741, 1741, 1741, 1741, 1741, 1741, 1741, 1741, 1741, + 1741, 1741, 1741, 1741, 1741, 1741, 1741, 1741, 1741, 1741, 1741, 1741, + 1741, 1741, 1741, 1741, 1741, 1741, 1741, 1741, 1741, 1741, 1741, 1741, + 1741, 1741, 1741, 1741, 1741, 1741, 1741, 1741, 1741, 1741, 1741, 1741, + 1741, 1741, 1741, 1741, 1741}, + {1741, 1741, 1741, 1741, 1741, 1741, 1741, 1741, 1741, 1741, 1741, 1741, + 1741, 1741, 1741, 1741, 1741, 1741, 1741, 1741, 1741, 1741, 1741, 1741, + 1741, 1741, 1741, 1741, 1741, 1741, 1741, 1741, 1741, 1741, 1741, 1741, + 1741, 1741, 1741, 1741, 1741, 1741, 1741, 1741, 1741, 1741, 1741, 1741, + 1741, 1741, 1741, 1741, 1741, 1741, 1741, 1741, 1741, 1741, 1741, 1741, + 1741, 1741, 1741, 1741, 1741, 1741, 1741, 1741, 1741, 1741, 1741, 1743, + 1743, 1743, 1743, 1743, 1745, 1745, 1747, 1747, 1749, 1749, 1751, 1751, + 1753, 1753, 1755, 1755, 1757, 1757, 1759, 1759, 1761, 1761, 1763, 1763, + 1765, 1765, 1767, 1767, 1767, 1769, 1769, 1771, 1771, 1773, 1773, 1773, + 1773, 1773, 1773, 1773, 1777, 1777, 1777, 1781, 1781, 1781, 1785, 1785, + 1785, 1789, 1789, 1789, 1793, 1793, 1793, 1793, 1793, 1793, 1793, 1793, + 1793, 1793, 1793, 1793, 1793, 1793, 1793, 1793, 1793, 1793, 1793, 1793, + 1793, 1793, 1793, 1793, 1793, 1793, 1793, 1793, 1793, 1793, 1793, 1793, + 1793, 1793, 1795, 1795, 1795, 1795, 1795, 1795, 1795, 1795, 1795, 1797, + 1797, 1797, 1797, 1797, 1799, 1799, 1801, 1801, 1803, 1803, 1805, 1805, + 1807, 1807, 1809, 1809, 1811, 1811, 1813, 1813, 1815, 1815, 1817, 1817, + 1819, 1819, 1821, 1821, 1821, 1823, 1823, 1825, 1825, 1827, 1827, 1827, + 1827, 1827, 1827, 1827, 1831, 1831, 1831, 1835, 1835, 1835, 1839, 1839, + 1839, 1843, 1843, 1843, 1847, 1847, 1847, 1847, 1847, 1847, 1847, 1847, + 1847, 1847, 1847, 1847, 1847, 1847, 1847, 1847, 1847, 1847, 1847, 1847, + 1849, 1851, 1853, 1855, 1855, 1855, 1855, 1855, 1855, 1855, 1855, 1855, + 1855, 1855, 1857, 1857, 1857}, + {1857, 1857, 1857, 1857, 1857, 1857, 1857, 1857, 1857, 1857, 1857, 1857, + 1857, 1857, 1857, 1857, 1857, 1857, 1857, 1857, 1857, 1857, 1857, 1857, + 1857, 1857, 1857, 1857, 1857, 1857, 1857, 1857, 1857, 1857, 1857, 1857, + 1857, 1857, 1857, 1857, 1857, 1857, 1857, 1857, 1857, 1857, 1857, 1857, + 1857, 1857, 1857, 1857, 1857, 1857, 1857, 1857, 1857, 1857, 1857, 1857, + 1857, 1857, 1857, 1857, 1857, 1857, 1857, 1857, 1857, 1857, 1857, 1857, + 1857, 1857, 1857, 1857, 1857, 1857, 1857, 1857, 1857, 1857, 1857, 1857, + 1857, 1857, 1857, 1857, 1857, 1857, 1857, 1857, 1857, 1857, 1857, 1857, + 1857, 1857, 1857, 1857, 1857, 1857, 1857, 1857, 1857, 1857, 1857, 1857, + 1857, 1857, 1857, 1857, 1857, 1857, 1857, 1857, 1857, 1857, 1857, 1857, + 1857, 1857, 1857, 1857, 1857, 1857, 1857, 1857, 1857, 1857, 1857, 1857, + 1857, 1857, 1857, 1857, 1857, 1857, 1857, 1857, 1857, 1857, 1857, 1857, + 1857, 1857, 1857, 1857, 1857, 1857, 1857, 1857, 1857, 1857, 1859, 1859, + 1861, 1861, 1861, 1861, 1861, 1861, 1861, 1861, 1861, 1861, 1863, 1863, + 1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863, + 1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863, + 1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863, + 1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863, + 1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863, + 1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863, + 1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863, + 1863, 1863, 1863, 1863, 1863}, + {1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863, + 1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863, + 1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863, + 1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863, 1863, + 1863, 1863, 1865, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, + 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, + 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, + 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, + 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, + 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, + 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, + 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, + 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, + 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, + 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, + 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, + 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, + 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, + 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, + 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, + 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, + 1867, 1867, 1867, 1867, 1867}, + {1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, + 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, + 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, + 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, + 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, + 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, 1867, + 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, + 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, + 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, + 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, + 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, + 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, + 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, + 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, + 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, + 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, + 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, + 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, + 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, + 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, + 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, + 1871, 1871, 1871, 1871, 1871}, + {1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, + 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, + 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, + 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, + 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, + 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, + 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, + 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, + 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, + 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, + 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, + 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, + 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, + 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, + 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, + 1871, 1871, 1871, 1871, 1871, 1871, 1877, 1877, 1877, 1877, 1877, 1877, + 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, + 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, + 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, + 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, + 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, + 1877, 1877, 1877, 1877, 1877}, + {1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, + 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, + 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, + 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, + 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, + 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, + 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, + 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, + 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, + 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, + 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, + 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, + 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, + 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, + 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, + 1877, 1877, 1877, 1877, 1877, 1879, 1881, 1881, 1881, 1881, 1881, 1881, + 1881, 1881, 1881, 1881, 1881, 1881, 1881, 1881, 1881, 1881, 1881, 1881, + 1881, 1881, 1881, 1881, 1881, 1881, 1881, 1881, 1881, 1881, 1881, 1881, + 1881, 1881, 1881, 1881, 1881, 1881, 1881, 1881, 1881, 1881, 1881, 1881, + 1881, 1881, 1881, 1881, 1881, 1881, 1881, 1881, 1881, 1881, 1881, 1881, + 1881, 1881, 1881, 1881, 1881, 1881, 1881, 1881, 1881, 1881, 1881, 1881, + 1881, 1881, 1881, 1881, 1881}, + {1881, 1881, 1881, 1881, 1881, 1881, 1881, 1881, 1881, 1881, 1881, 1881, + 1881, 1881, 1881, 1881, 1881, 1881, 1881, 1881, 1881, 1881, 1881, 1881, + 1881, 1881, 1881, 1881, 1881, 1881, 1881, 1881, 1881, 1881, 1881, 1881, + 1881, 1881, 1881, 1881, 1881, 1881, 1881, 1881, 1881, 1881, 1881, 1881, + 1881, 1881, 1881, 1881, 1881, 1881, 1883, 1883, 1883, 1883, 1883, 1883, + 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883, + 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883, + 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883, + 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883, + 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883, + 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883, + 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883, + 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883, + 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883, + 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883, + 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883, + 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883, + 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883, + 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883, + 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883, + 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883, 1883, + 1883, 1883, 1883, 1883, 1883}}; +const char32_t uninorms::composition_data[] = { + 0, 824, 8814, 824, 8800, 824, 8815, 768, 192, 769, 193, + 770, 194, 771, 195, 772, 256, 774, 258, 775, 550, 776, + 196, 777, 7842, 778, 197, 780, 461, 783, 512, 785, 514, + 803, 7840, 805, 7680, 808, 260, 775, 7682, 803, 7684, 817, + 7686, 769, 262, 770, 264, 775, 266, 780, 268, 807, 199, + 775, 7690, 780, 270, 803, 7692, 807, 7696, 813, 7698, 817, + 7694, 768, 200, 769, 201, 770, 202, 771, 7868, 772, 274, + 774, 276, 775, 278, 776, 203, 777, 7866, 780, 282, 783, + 516, 785, 518, 803, 7864, 807, 552, 808, 280, 813, 7704, + 816, 7706, 775, 7710, 769, 500, 770, 284, 772, 7712, 774, + 286, 775, 288, 780, 486, 807, 290, 770, 292, 775, 7714, + 776, 7718, 780, 542, 803, 7716, 807, 7720, 814, 7722, 768, + 204, 769, 205, 770, 206, 771, 296, 772, 298, 774, 300, + 775, 304, 776, 207, 777, 7880, 780, 463, 783, 520, 785, + 522, 803, 7882, 808, 302, 816, 7724, 770, 308, 769, 7728, + 780, 488, 803, 7730, 807, 310, 817, 7732, 769, 313, 780, + 317, 803, 7734, 807, 315, 813, 7740, 817, 7738, 769, 7742, + 775, 7744, 803, 7746, 768, 504, 769, 323, 771, 209, 775, + 7748, 780, 327, 803, 7750, 807, 325, 813, 7754, 817, 7752, + 768, 210, 769, 211, 770, 212, 771, 213, 772, 332, 774, + 334, 775, 558, 776, 214, 777, 7886, 779, 336, 780, 465, + 783, 524, 785, 526, 795, 416, 803, 7884, 808, 490, 769, + 7764, 775, 7766, 769, 340, 775, 7768, 780, 344, 783, 528, + 785, 530, 803, 7770, 807, 342, 817, 7774, 769, 346, 770, + 348, 775, 7776, 780, 352, 803, 7778, 806, 536, 807, 350, + 775, 7786, 780, 356, 803, 7788, 806, 538, 807, 354, 813, + 7792, 817, 7790, 768, 217, 769, 218, 770, 219, 771, 360, + 772, 362, 774, 364, 776, 220, 777, 7910, 778, 366, 779, + 368, 780, 467, 783, 532, 785, 534, 795, 431, 803, 7908, + 804, 7794, 808, 370, 813, 7798, 816, 7796, 771, 7804, 803, + 7806, 768, 7808, 769, 7810, 770, 372, 775, 7814, 776, 7812, + 803, 7816, 775, 7818, 776, 7820, 768, 7922, 769, 221, 770, + 374, 771, 7928, 772, 562, 775, 7822, 776, 376, 777, 7926, + 803, 7924, 769, 377, 770, 7824, 775, 379, 780, 381, 803, + 7826, 817, 7828, 768, 224, 769, 225, 770, 226, 771, 227, + 772, 257, 774, 259, 775, 551, 776, 228, 777, 7843, 778, + 229, 780, 462, 783, 513, 785, 515, 803, 7841, 805, 7681, + 808, 261, 775, 7683, 803, 7685, 817, 7687, 769, 263, 770, + 265, 775, 267, 780, 269, 807, 231, 775, 7691, 780, 271, + 803, 7693, 807, 7697, 813, 7699, 817, 7695, 768, 232, 769, + 233, 770, 234, 771, 7869, 772, 275, 774, 277, 775, 279, + 776, 235, 777, 7867, 780, 283, 783, 517, 785, 519, 803, + 7865, 807, 553, 808, 281, 813, 7705, 816, 7707, 775, 7711, + 769, 501, 770, 285, 772, 7713, 774, 287, 775, 289, 780, + 487, 807, 291, 770, 293, 775, 7715, 776, 7719, 780, 543, + 803, 7717, 807, 7721, 814, 7723, 817, 7830, 768, 236, 769, + 237, 770, 238, 771, 297, 772, 299, 774, 301, 776, 239, + 777, 7881, 780, 464, 783, 521, 785, 523, 803, 7883, 808, + 303, 816, 7725, 770, 309, 780, 496, 769, 7729, 780, 489, + 803, 7731, 807, 311, 817, 7733, 769, 314, 780, 318, 803, + 7735, 807, 316, 813, 7741, 817, 7739, 769, 7743, 775, 7745, + 803, 7747, 768, 505, 769, 324, 771, 241, 775, 7749, 780, + 328, 803, 7751, 807, 326, 813, 7755, 817, 7753, 768, 242, + 769, 243, 770, 244, 771, 245, 772, 333, 774, 335, 775, + 559, 776, 246, 777, 7887, 779, 337, 780, 466, 783, 525, + 785, 527, 795, 417, 803, 7885, 808, 491, 769, 7765, 775, + 7767, 769, 341, 775, 7769, 780, 345, 783, 529, 785, 531, + 803, 7771, 807, 343, 817, 7775, 769, 347, 770, 349, 775, + 7777, 780, 353, 803, 7779, 806, 537, 807, 351, 775, 7787, + 776, 7831, 780, 357, 803, 7789, 806, 539, 807, 355, 813, + 7793, 817, 7791, 768, 249, 769, 250, 770, 251, 771, 361, + 772, 363, 774, 365, 776, 252, 777, 7911, 778, 367, 779, + 369, 780, 468, 783, 533, 785, 535, 795, 432, 803, 7909, + 804, 7795, 808, 371, 813, 7799, 816, 7797, 771, 7805, 803, + 7807, 768, 7809, 769, 7811, 770, 373, 775, 7815, 776, 7813, + 778, 7832, 803, 7817, 775, 7819, 776, 7821, 768, 7923, 769, + 253, 770, 375, 771, 7929, 772, 563, 775, 7823, 776, 255, + 777, 7927, 778, 7833, 803, 7925, 769, 378, 770, 7825, 775, + 380, 780, 382, 803, 7827, 817, 7829, 768, 8173, 769, 901, + 834, 8129, 768, 7846, 769, 7844, 771, 7850, 777, 7848, 772, + 478, 769, 506, 769, 508, 772, 482, 769, 7688, 768, 7872, + 769, 7870, 771, 7876, 777, 7874, 769, 7726, 768, 7890, 769, + 7888, 771, 7894, 777, 7892, 769, 7756, 772, 556, 776, 7758, + 772, 554, 769, 510, 768, 475, 769, 471, 772, 469, 780, + 473, 768, 7847, 769, 7845, 771, 7851, 777, 7849, 772, 479, + 769, 507, 769, 509, 772, 483, 769, 7689, 768, 7873, 769, + 7871, 771, 7877, 777, 7875, 769, 7727, 768, 7891, 769, 7889, + 771, 7895, 777, 7893, 769, 7757, 772, 557, 776, 7759, 772, + 555, 769, 511, 768, 476, 769, 472, 772, 470, 780, 474, + 768, 7856, 769, 7854, 771, 7860, 777, 7858, 768, 7857, 769, + 7855, 771, 7861, 777, 7859, 768, 7700, 769, 7702, 768, 7701, + 769, 7703, 768, 7760, 769, 7762, 768, 7761, 769, 7763, 775, + 7780, 775, 7781, 775, 7782, 775, 7783, 769, 7800, 769, 7801, + 776, 7802, 776, 7803, 775, 7835, 768, 7900, 769, 7898, 771, + 7904, 777, 7902, 803, 7906, 768, 7901, 769, 7899, 771, 7905, + 777, 7903, 803, 7907, 768, 7914, 769, 7912, 771, 7918, 777, + 7916, 803, 7920, 768, 7915, 769, 7913, 771, 7919, 777, 7917, + 803, 7921, 780, 494, 772, 492, 772, 493, 772, 480, 772, + 481, 774, 7708, 774, 7709, 772, 560, 772, 561, 780, 495, + 768, 8122, 769, 902, 772, 8121, 774, 8120, 787, 7944, 788, + 7945, 837, 8124, 768, 8136, 769, 904, 787, 7960, 788, 7961, + 768, 8138, 769, 905, 787, 7976, 788, 7977, 837, 8140, 768, + 8154, 769, 906, 772, 8153, 774, 8152, 776, 938, 787, 7992, + 788, 7993, 768, 8184, 769, 908, 787, 8008, 788, 8009, 788, + 8172, 768, 8170, 769, 910, 772, 8169, 774, 8168, 776, 939, + 788, 8025, 768, 8186, 769, 911, 787, 8040, 788, 8041, 837, + 8188, 837, 8116, 837, 8132, 768, 8048, 769, 940, 772, 8113, + 774, 8112, 787, 7936, 788, 7937, 834, 8118, 837, 8115, 768, + 8050, 769, 941, 787, 7952, 788, 7953, 768, 8052, 769, 942, + 787, 7968, 788, 7969, 834, 8134, 837, 8131, 768, 8054, 769, + 943, 772, 8145, 774, 8144, 776, 970, 787, 7984, 788, 7985, + 834, 8150, 768, 8056, 769, 972, 787, 8000, 788, 8001, 787, + 8164, 788, 8165, 768, 8058, 769, 973, 772, 8161, 774, 8160, + 776, 971, 787, 8016, 788, 8017, 834, 8166, 768, 8060, 769, + 974, 787, 8032, 788, 8033, 834, 8182, 837, 8179, 768, 8146, + 769, 912, 834, 8151, 768, 8162, 769, 944, 834, 8167, 837, + 8180, 769, 979, 776, 980, 776, 1031, 774, 1232, 776, 1234, + 769, 1027, 768, 1024, 774, 1238, 776, 1025, 774, 1217, 776, + 1244, 776, 1246, 768, 1037, 772, 1250, 774, 1049, 776, 1252, + 769, 1036, 776, 1254, 772, 1262, 774, 1038, 776, 1264, 779, + 1266, 776, 1268, 776, 1272, 776, 1260, 774, 1233, 776, 1235, + 769, 1107, 768, 1104, 774, 1239, 776, 1105, 774, 1218, 776, + 1245, 776, 1247, 768, 1117, 772, 1251, 774, 1081, 776, 1253, + 769, 1116, 776, 1255, 772, 1263, 774, 1118, 776, 1265, 779, + 1267, 776, 1269, 776, 1273, 776, 1261, 776, 1111, 783, 1142, + 783, 1143, 776, 1242, 776, 1243, 776, 1258, 776, 1259, 1619, + 1570, 1620, 1571, 1621, 1573, 1620, 1572, 1620, 1574, 1620, 1730, + 1620, 1747, 1620, 1728, 2364, 2345, 2364, 2353, 2364, 2356, 2494, + 2507, 2519, 2508, 2878, 2891, 2902, 2888, 2903, 2892, 3031, 2964, + 3006, 3018, 3031, 3020, 3006, 3019, 3158, 3144, 3285, 3264, 3266, + 3274, 3285, 3271, 3286, 3272, 3285, 3275, 3390, 3402, 3415, 3404, + 3390, 3403, 3530, 3546, 3535, 3548, 3551, 3550, 3530, 3549, 4142, + 4134, 6965, 6918, 6965, 6920, 6965, 6922, 6965, 6924, 6965, 6926, + 6965, 6930, 6965, 6971, 6965, 6973, 6965, 6976, 6965, 6977, 6965, + 6979, 772, 7736, 772, 7737, 772, 7772, 772, 7773, 775, 7784, + 775, 7785, 770, 7852, 774, 7862, 770, 7853, 774, 7863, 770, + 7878, 770, 7879, 770, 7896, 770, 7897, 768, 7938, 769, 7940, + 834, 7942, 837, 8064, 768, 7939, 769, 7941, 834, 7943, 837, + 8065, 837, 8066, 837, 8067, 837, 8068, 837, 8069, 837, 8070, + 837, 8071, 768, 7946, 769, 7948, 834, 7950, 837, 8072, 768, + 7947, 769, 7949, 834, 7951, 837, 8073, 837, 8074, 837, 8075, + 837, 8076, 837, 8077, 837, 8078, 837, 8079, 768, 7954, 769, + 7956, 768, 7955, 769, 7957, 768, 7962, 769, 7964, 768, 7963, + 769, 7965, 768, 7970, 769, 7972, 834, 7974, 837, 8080, 768, + 7971, 769, 7973, 834, 7975, 837, 8081, 837, 8082, 837, 8083, + 837, 8084, 837, 8085, 837, 8086, 837, 8087, 768, 7978, 769, + 7980, 834, 7982, 837, 8088, 768, 7979, 769, 7981, 834, 7983, + 837, 8089, 837, 8090, 837, 8091, 837, 8092, 837, 8093, 837, + 8094, 837, 8095, 768, 7986, 769, 7988, 834, 7990, 768, 7987, + 769, 7989, 834, 7991, 768, 7994, 769, 7996, 834, 7998, 768, + 7995, 769, 7997, 834, 7999, 768, 8002, 769, 8004, 768, 8003, + 769, 8005, 768, 8010, 769, 8012, 768, 8011, 769, 8013, 768, + 8018, 769, 8020, 834, 8022, 768, 8019, 769, 8021, 834, 8023, + 768, 8027, 769, 8029, 834, 8031, 768, 8034, 769, 8036, 834, + 8038, 837, 8096, 768, 8035, 769, 8037, 834, 8039, 837, 8097, + 837, 8098, 837, 8099, 837, 8100, 837, 8101, 837, 8102, 837, + 8103, 768, 8042, 769, 8044, 834, 8046, 837, 8104, 768, 8043, + 769, 8045, 834, 8047, 837, 8105, 837, 8106, 837, 8107, 837, + 8108, 837, 8109, 837, 8110, 837, 8111, 837, 8114, 837, 8130, + 837, 8178, 837, 8119, 768, 8141, 769, 8142, 834, 8143, 837, + 8135, 837, 8183, 768, 8157, 769, 8158, 834, 8159, 824, 8602, + 824, 8603, 824, 8622, 824, 8653, 824, 8655, 824, 8654, 824, + 8708, 824, 8713, 824, 8716, 824, 8740, 824, 8742, 824, 8769, + 824, 8772, 824, 8775, 824, 8777, 824, 8813, 824, 8802, 824, + 8816, 824, 8817, 824, 8820, 824, 8821, 824, 8824, 824, 8825, + 824, 8832, 824, 8833, 824, 8928, 824, 8929, 824, 8836, 824, + 8837, 824, 8840, 824, 8841, 824, 8930, 824, 8931, 824, 8876, + 824, 8877, 824, 8878, 824, 8879, 824, 8938, 824, 8939, 824, + 8940, 824, 8941, 12441, 12436, 12441, 12364, 12441, 12366, 12441, 12368, + 12441, 12370, 12441, 12372, 12441, 12374, 12441, 12376, 12441, 12378, 12441, + 12380, 12441, 12382, 12441, 12384, 12441, 12386, 12441, 12389, 12441, 12391, + 12441, 12393, 12441, 12400, 12442, 12401, 12441, 12403, 12442, 12404, 12441, + 12406, 12442, 12407, 12441, 12409, 12442, 12410, 12441, 12412, 12442, 12413, + 12441, 12446, 12441, 12532, 12441, 12460, 12441, 12462, 12441, 12464, 12441, + 12466, 12441, 12468, 12441, 12470, 12441, 12472, 12441, 12474, 12441, 12476, + 12441, 12478, 12441, 12480, 12441, 12482, 12441, 12485, 12441, 12487, 12441, + 12489, 12441, 12496, 12442, 12497, 12441, 12499, 12442, 12500, 12441, 12502, + 12442, 12503, 12441, 12505, 12442, 12506, 12441, 12508, 12442, 12509, 12441, + 12535, 12441, 12536, 12441, 12537, 12441, 12538, 12441, 12542, 69818, 69786, + 69818, 69788, 69818, 69803, 69927, 69934, 69927, 69935, 70462, 70475, 70487, + 70476, 70832, 70844, 70842, 70843, 70845, 70846, 71087, 71098, 71087, 71099, + 71984, 71992}; + +const uint8_t uninorms::decomposition_index[uninorms::CHARS >> 8] = { + 0, 1, 2, 3, 4, 5, 6, 7, 7, 8, 9, 10, 11, 12, 13, 14, 15, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 16, 7, 17, 18, 19, 20, 21, 22, 23, 24, 7, + 7, 7, 7, 7, 25, 7, 26, 27, 28, 29, 30, 31, 32, 33, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 34, 35, 7, 7, 7, + 36, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 37, 38, 39, 40, 41, 42, 43, 7, 7, 7, 7, 7, 7, 7, 44, 7, 7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 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7}; +const uint16_t uninorms::decomposition_block[][257] = { + {4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 8, 8, 8, 8, + 8, 8, 8, 9, 16, 17, 20, 20, 20, 20, 21, 28, 28, 29, 33, + 37, 45, 48, 48, 49, 57, 61, 64, 65, 77, 89, 100, 100, 108, 116, + 124, 132, 140, 148, 148, 156, 164, 172, 180, 188, 196, 204, 212, 220, 220, + 228, 236, 244, 252, 260, 268, 268, 268, 276, 284, 292, 300, 308, 308, 308, + 316, 324, 332, 340, 348, 356, 356, 364, 372, 380, 388, 396, 404, 412, 420, + 428, 428, 436, 444, 452, 460, 468, 476, 476, 476, 484, 492, 500, 508, 516, + 516, 524}, + {524, 532, 540, 548, 556, 564, 572, 580, 588, 596, 604, 612, + 620, 628, 636, 644, 652, 652, 652, 660, 668, 676, 684, 692, + 700, 708, 716, 724, 732, 740, 748, 756, 764, 772, 780, 788, + 796, 804, 812, 812, 812, 820, 828, 836, 844, 852, 860, 868, + 876, 884, 885, 893, 900, 908, 916, 924, 932, 932, 940, 948, + 956, 964, 972, 981, 989, 996, 996, 996, 1004, 1012, 1020, 1028, + 1036, 1045, 1052, 1052, 1052, 1060, 1068, 1076, 1084, 1092, 1100, 1100, + 1100, 1108, 1116, 1124, 1132, 1140, 1148, 1156, 1164, 1172, 1180, 1188, + 1196, 1204, 1212, 1220, 1228, 1236, 1244, 1244, 1244, 1252, 1260, 1268, + 1276, 1284, 1292, 1300, 1308, 1316, 1324, 1332, 1340, 1348, 1356, 1364, + 1372, 1380, 1388, 1396, 1404, 1412, 1420, 1429, 1432, 1432, 1432, 1432, + 1432, 1432, 1432, 1432, 1432, 1432, 1432, 1432, 1432, 1432, 1432, 1432, + 1432, 1432, 1432, 1432, 1432, 1432, 1432, 1432, 1432, 1432, 1432, 1432, + 1432, 1432, 1432, 1432, 1432, 1440, 1448, 1448, 1448, 1448, 1448, 1448, + 1448, 1448, 1448, 1448, 1448, 1448, 1448, 1448, 1456, 1464, 1464, 1464, + 1464, 1464, 1464, 1464, 1464, 1464, 1464, 1464, 1464, 1464, 1464, 1464, + 1464, 1464, 1464, 1464, 1465, 1477, 1489, 1501, 1509, 1517, 1525, 1533, + 1541, 1548, 1556, 1564, 1572, 1580, 1588, 1596, 1604, 1612, 1624, 1636, + 1648, 1660, 1672, 1684, 1696, 1708, 1708, 1720, 1732, 1744, 1756, 1764, + 1772, 1772, 1772, 1780, 1788, 1796, 1804, 1812, 1820, 1832, 1844, 1852, + 1860, 1869, 1877, 1885, 1892, 1900, 1908, 1908, 1908, 1916, 1924, 1936, + 1948, 1956, 1964, 1972, 1980}, + {1980, 1988, 1996, 2004, 2012, 2020, 2028, 2036, 2044, 2052, 2060, 2068, + 2076, 2084, 2092, 2100, 2108, 2116, 2124, 2132, 2140, 2148, 2156, 2164, + 2172, 2180, 2188, 2196, 2204, 2204, 2204, 2212, 2220, 2220, 2220, 2220, + 2220, 2220, 2220, 2228, 2236, 2244, 2252, 2264, 2276, 2288, 2300, 2308, + 2316, 2328, 2340, 2348, 2356, 2356, 2356, 2356, 2356, 2356, 2356, 2356, + 2356, 2356, 2356, 2356, 2356, 2356, 2356, 2356, 2356, 2356, 2356, 2356, + 2356, 2356, 2356, 2356, 2356, 2356, 2356, 2356, 2356, 2356, 2356, 2356, + 2356, 2356, 2356, 2356, 2356, 2356, 2356, 2356, 2356, 2356, 2356, 2356, + 2356, 2356, 2356, 2356, 2356, 2356, 2356, 2356, 2356, 2356, 2356, 2356, + 2356, 2356, 2356, 2356, 2356, 2356, 2356, 2356, 2356, 2356, 2356, 2356, + 2356, 2356, 2356, 2356, 2356, 2356, 2356, 2356, 2356, 2356, 2356, 2356, + 2356, 2356, 2356, 2356, 2356, 2356, 2356, 2356, 2356, 2356, 2356, 2356, + 2356, 2356, 2356, 2356, 2356, 2356, 2356, 2356, 2356, 2356, 2356, 2356, + 2356, 2356, 2356, 2356, 2356, 2356, 2356, 2356, 2356, 2356, 2356, 2356, + 2356, 2356, 2356, 2356, 2356, 2356, 2356, 2356, 2357, 2361, 2365, 2369, + 2373, 2377, 2381, 2385, 2389, 2392, 2392, 2392, 2392, 2392, 2392, 2392, + 2392, 2392, 2392, 2392, 2392, 2392, 2392, 2392, 2392, 2392, 2392, 2392, + 2392, 2392, 2392, 2392, 2392, 2392, 2392, 2392, 2392, 2392, 2392, 2392, + 2393, 2401, 2409, 2417, 2425, 2433, 2440, 2440, 2441, 2445, 2449, 2453, + 2457, 2460, 2460, 2460, 2460, 2460, 2460, 2460, 2460, 2460, 2460, 2460, + 2460, 2460, 2460, 2460, 2460, 2460, 2460, 2460, 2460, 2460, 2460, 2460, + 2460, 2460, 2460, 2460, 2460}, + {2460, 2460, 2460, 2460, 2460, 2460, 2460, 2460, 2460, 2460, 2460, 2460, + 2460, 2460, 2460, 2460, 2460, 2460, 2460, 2460, 2460, 2460, 2460, 2460, + 2460, 2460, 2460, 2460, 2460, 2460, 2460, 2460, 2460, 2460, 2460, 2460, + 2460, 2460, 2460, 2460, 2460, 2460, 2460, 2460, 2460, 2460, 2460, 2460, + 2460, 2460, 2460, 2460, 2460, 2460, 2460, 2460, 2460, 2460, 2460, 2460, + 2460, 2460, 2460, 2460, 2460, 2464, 2468, 2468, 2472, 2480, 2480, 2480, + 2480, 2480, 2480, 2480, 2480, 2480, 2480, 2480, 2480, 2480, 2480, 2480, + 2480, 2480, 2480, 2480, 2480, 2480, 2480, 2480, 2480, 2480, 2480, 2480, + 2480, 2480, 2480, 2480, 2480, 2480, 2480, 2480, 2480, 2480, 2480, 2480, + 2480, 2480, 2480, 2480, 2480, 2480, 2480, 2480, 2480, 2484, 2484, 2484, + 2484, 2484, 2485, 2492, 2492, 2492, 2492, 2496, 2496, 2496, 2496, 2496, + 2497, 2506, 2512, 2520, 2524, 2532, 2540, 2548, 2548, 2556, 2556, 2564, + 2572, 2584, 2584, 2584, 2584, 2584, 2584, 2584, 2584, 2584, 2584, 2584, + 2584, 2584, 2584, 2584, 2584, 2584, 2584, 2584, 2584, 2584, 2584, 2584, + 2584, 2584, 2584, 2592, 2600, 2608, 2616, 2624, 2632, 2644, 2644, 2644, + 2644, 2644, 2644, 2644, 2644, 2644, 2644, 2644, 2644, 2644, 2644, 2644, + 2644, 2644, 2644, 2644, 2644, 2644, 2644, 2644, 2644, 2644, 2644, 2652, + 2660, 2668, 2676, 2684, 2685, 2689, 2693, 2698, 2706, 2713, 2717, 2720, + 2720, 2720, 2720, 2720, 2720, 2720, 2720, 2720, 2720, 2720, 2720, 2720, + 2720, 2720, 2720, 2720, 2720, 2720, 2720, 2720, 2720, 2720, 2720, 2720, + 2721, 2725, 2729, 2732, 2733, 2737, 2740, 2740, 2740, 2741, 2744, 2744, + 2744, 2744, 2744, 2744, 2744}, + {2744, 2752, 2760, 2760, 2768, 2768, 2768, 2768, 2776, 2776, 2776, 2776, + 2776, 2784, 2792, 2800, 2800, 2800, 2800, 2800, 2800, 2800, 2800, 2800, + 2800, 2800, 2808, 2808, 2808, 2808, 2808, 2808, 2808, 2808, 2808, 2808, + 2808, 2808, 2808, 2808, 2808, 2808, 2808, 2808, 2808, 2808, 2808, 2808, + 2808, 2808, 2808, 2808, 2808, 2808, 2808, 2808, 2808, 2808, 2816, 2816, + 2816, 2816, 2816, 2816, 2816, 2816, 2816, 2816, 2816, 2816, 2816, 2816, + 2816, 2816, 2816, 2816, 2816, 2816, 2816, 2816, 2816, 2824, 2832, 2832, + 2840, 2840, 2840, 2840, 2848, 2848, 2848, 2848, 2848, 2856, 2864, 2872, + 2872, 2872, 2872, 2872, 2872, 2872, 2872, 2872, 2872, 2872, 2872, 2872, + 2872, 2872, 2872, 2872, 2872, 2872, 2872, 2872, 2872, 2872, 2872, 2880, + 2888, 2888, 2888, 2888, 2888, 2888, 2888, 2888, 2888, 2888, 2888, 2888, + 2888, 2888, 2888, 2888, 2888, 2888, 2888, 2888, 2888, 2888, 2888, 2888, + 2888, 2888, 2888, 2888, 2888, 2888, 2888, 2888, 2888, 2888, 2888, 2888, + 2888, 2888, 2888, 2888, 2888, 2888, 2888, 2888, 2888, 2888, 2888, 2888, + 2888, 2888, 2888, 2888, 2888, 2888, 2888, 2888, 2888, 2888, 2888, 2888, + 2888, 2888, 2888, 2888, 2888, 2888, 2888, 2888, 2888, 2888, 2888, 2888, + 2888, 2888, 2896, 2904, 2904, 2904, 2904, 2904, 2904, 2904, 2904, 2904, + 2904, 2904, 2904, 2904, 2904, 2912, 2920, 2928, 2936, 2936, 2936, 2944, + 2952, 2952, 2952, 2960, 2968, 2976, 2984, 2992, 3000, 3000, 3000, 3008, + 3016, 3024, 3032, 3040, 3048, 3048, 3048, 3056, 3064, 3072, 3080, 3088, + 3096, 3104, 3112, 3120, 3128, 3136, 3144, 3144, 3144, 3152, 3160, 3160, + 3160, 3160, 3160, 3160, 3160}, + {3160, 3160, 3160, 3160, 3160, 3160, 3160, 3160, 3160, 3160, 3160, 3160, + 3160, 3160, 3160, 3160, 3160, 3160, 3160, 3160, 3160, 3160, 3160, 3160, + 3160, 3160, 3160, 3160, 3160, 3160, 3160, 3160, 3160, 3160, 3160, 3160, + 3160, 3160, 3160, 3160, 3160, 3160, 3160, 3160, 3160, 3160, 3160, 3160, + 3160, 3160, 3160, 3160, 3160, 3160, 3160, 3160, 3160, 3160, 3160, 3160, + 3160, 3160, 3160, 3160, 3160, 3160, 3160, 3160, 3160, 3160, 3160, 3160, + 3160, 3160, 3160, 3160, 3160, 3160, 3160, 3160, 3160, 3160, 3160, 3160, + 3160, 3160, 3160, 3160, 3160, 3160, 3160, 3160, 3160, 3160, 3160, 3160, + 3160, 3160, 3160, 3160, 3160, 3160, 3160, 3160, 3160, 3160, 3160, 3160, + 3160, 3160, 3160, 3160, 3160, 3160, 3160, 3160, 3160, 3160, 3160, 3160, + 3160, 3160, 3160, 3160, 3160, 3160, 3160, 3160, 3160, 3160, 3160, 3160, + 3160, 3160, 3160, 3161, 3168, 3168, 3168, 3168, 3168, 3168, 3168, 3168, + 3168, 3168, 3168, 3168, 3168, 3168, 3168, 3168, 3168, 3168, 3168, 3168, + 3168, 3168, 3168, 3168, 3168, 3168, 3168, 3168, 3168, 3168, 3168, 3168, + 3168, 3168, 3168, 3168, 3168, 3168, 3168, 3168, 3168, 3168, 3168, 3168, + 3168, 3168, 3168, 3168, 3168, 3168, 3168, 3168, 3168, 3168, 3168, 3168, + 3168, 3168, 3168, 3168, 3168, 3168, 3168, 3168, 3168, 3168, 3168, 3168, + 3168, 3168, 3168, 3168, 3168, 3168, 3168, 3168, 3168, 3168, 3168, 3168, + 3168, 3168, 3168, 3168, 3168, 3168, 3168, 3168, 3168, 3168, 3168, 3168, + 3168, 3168, 3168, 3168, 3168, 3168, 3168, 3168, 3168, 3168, 3168, 3168, + 3168, 3168, 3168, 3168, 3168, 3168, 3168, 3168, 3168, 3168, 3168, 3168, + 3168, 3168, 3168, 3168, 3168}, + {3168, 3168, 3168, 3168, 3168, 3168, 3168, 3168, 3168, 3168, 3168, 3168, + 3168, 3168, 3168, 3168, 3168, 3168, 3168, 3168, 3168, 3168, 3168, 3168, + 3168, 3168, 3168, 3168, 3168, 3168, 3168, 3168, 3168, 3168, 3168, 3176, + 3184, 3192, 3200, 3208, 3208, 3208, 3208, 3208, 3208, 3208, 3208, 3208, + 3208, 3208, 3208, 3208, 3208, 3208, 3208, 3208, 3208, 3208, 3208, 3208, + 3208, 3208, 3208, 3208, 3208, 3208, 3208, 3208, 3208, 3208, 3208, 3208, + 3208, 3208, 3208, 3208, 3208, 3208, 3208, 3208, 3208, 3208, 3208, 3208, + 3208, 3208, 3208, 3208, 3208, 3208, 3208, 3208, 3208, 3208, 3208, 3208, + 3208, 3208, 3208, 3208, 3208, 3208, 3208, 3208, 3208, 3208, 3208, 3208, + 3208, 3208, 3208, 3208, 3208, 3208, 3208, 3208, 3208, 3209, 3217, 3225, + 3233, 3240, 3240, 3240, 3240, 3240, 3240, 3240, 3240, 3240, 3240, 3240, + 3240, 3240, 3240, 3240, 3240, 3240, 3240, 3240, 3240, 3240, 3240, 3240, + 3240, 3240, 3240, 3240, 3240, 3240, 3240, 3240, 3240, 3240, 3240, 3240, + 3240, 3240, 3240, 3240, 3240, 3240, 3240, 3240, 3240, 3240, 3240, 3240, + 3240, 3240, 3240, 3240, 3240, 3240, 3240, 3240, 3240, 3240, 3240, 3240, + 3240, 3240, 3240, 3240, 3240, 3240, 3240, 3240, 3240, 3240, 3240, 3240, + 3240, 3248, 3248, 3256, 3256, 3256, 3256, 3256, 3256, 3256, 3256, 3256, + 3256, 3256, 3256, 3256, 3256, 3256, 3256, 3256, 3264, 3264, 3264, 3264, + 3264, 3264, 3264, 3264, 3264, 3264, 3264, 3264, 3264, 3264, 3264, 3264, + 3264, 3264, 3264, 3264, 3264, 3264, 3264, 3264, 3264, 3264, 3264, 3264, + 3264, 3264, 3264, 3264, 3264, 3264, 3264, 3264, 3264, 3264, 3264, 3264, + 3264, 3264, 3264, 3264, 3264}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {3264, 3264, 3264, 3264, 3264, 3264, 3264, 3264, 3264, 3264, 3264, 3264, + 3264, 3264, 3264, 3264, 3264, 3264, 3264, 3264, 3264, 3264, 3264, 3264, + 3264, 3264, 3264, 3264, 3264, 3264, 3264, 3264, 3264, 3264, 3264, 3264, + 3264, 3264, 3264, 3264, 3264, 3264, 3272, 3272, 3272, 3272, 3272, 3272, + 3272, 3272, 3280, 3280, 3280, 3288, 3288, 3288, 3288, 3288, 3288, 3288, + 3288, 3288, 3288, 3288, 3288, 3288, 3288, 3288, 3288, 3288, 3288, 3288, + 3288, 3288, 3288, 3288, 3288, 3288, 3288, 3288, 3288, 3288, 3288, 3288, + 3288, 3288, 3288, 3288, 3288, 3296, 3304, 3312, 3320, 3328, 3336, 3344, + 3352, 3352, 3352, 3352, 3352, 3352, 3352, 3352, 3352, 3352, 3352, 3352, + 3352, 3352, 3352, 3352, 3352, 3352, 3352, 3352, 3352, 3352, 3352, 3352, + 3352, 3352, 3352, 3352, 3352, 3352, 3352, 3352, 3352, 3352, 3352, 3352, + 3352, 3352, 3352, 3352, 3352, 3352, 3352, 3352, 3352, 3352, 3352, 3352, + 3352, 3352, 3352, 3352, 3352, 3352, 3352, 3352, 3352, 3352, 3352, 3352, + 3352, 3352, 3352, 3352, 3352, 3352, 3352, 3352, 3352, 3352, 3352, 3352, + 3352, 3352, 3352, 3352, 3352, 3352, 3352, 3352, 3352, 3352, 3352, 3352, + 3352, 3352, 3352, 3352, 3352, 3352, 3352, 3352, 3352, 3352, 3352, 3352, + 3352, 3352, 3352, 3352, 3352, 3352, 3352, 3352, 3352, 3352, 3352, 3352, + 3360, 3368, 3368, 3368, 3368, 3368, 3368, 3368, 3368, 3368, 3368, 3368, + 3368, 3368, 3368, 3368, 3368, 3376, 3384, 3384, 3392, 3392, 3392, 3392, + 3392, 3392, 3392, 3392, 3392, 3392, 3392, 3392, 3392, 3392, 3392, 3392, + 3392, 3392, 3392, 3392, 3392, 3392, 3392, 3392, 3392, 3392, 3392, 3392, + 3392, 3392, 3392, 3392, 3392}, + {3392, 3392, 3392, 3392, 3392, 3392, 3392, 3392, 3392, 3392, 3392, 3392, + 3392, 3392, 3392, 3392, 3392, 3392, 3392, 3392, 3392, 3392, 3392, 3392, + 3392, 3392, 3392, 3392, 3392, 3392, 3392, 3392, 3392, 3392, 3392, 3392, + 3392, 3392, 3392, 3392, 3392, 3392, 3392, 3392, 3392, 3392, 3392, 3392, + 3392, 3392, 3392, 3392, 3400, 3400, 3400, 3408, 3408, 3408, 3408, 3408, + 3408, 3408, 3408, 3408, 3408, 3408, 3408, 3408, 3408, 3408, 3408, 3408, + 3408, 3408, 3408, 3408, 3408, 3408, 3408, 3408, 3408, 3408, 3408, 3408, + 3408, 3408, 3408, 3408, 3408, 3408, 3416, 3424, 3432, 3432, 3432, 3440, + 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, + 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, + 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, + 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, + 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, + 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, + 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, + 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, + 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, + 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, + 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, + 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, + 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, + 3440, 3440, 3440, 3440, 3440}, + {3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, + 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, + 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, + 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, + 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, + 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, 3440, + 3440, 3448, 3448, 3448, 3456, 3464, 3464, 3464, 3464, 3464, 3464, 3464, + 3464, 3464, 3464, 3464, 3464, 3464, 3464, 3464, 3464, 3472, 3480, 3480, + 3480, 3480, 3480, 3480, 3480, 3480, 3480, 3480, 3480, 3480, 3480, 3480, + 3480, 3480, 3480, 3480, 3480, 3480, 3480, 3480, 3480, 3480, 3480, 3480, + 3480, 3480, 3480, 3480, 3480, 3480, 3480, 3480, 3480, 3480, 3480, 3480, + 3480, 3480, 3480, 3480, 3480, 3480, 3480, 3480, 3480, 3480, 3480, 3480, + 3480, 3480, 3480, 3480, 3480, 3488, 3488, 3488, 3488, 3488, 3488, 3488, + 3488, 3488, 3488, 3488, 3488, 3488, 3488, 3488, 3488, 3488, 3488, 3488, + 3488, 3488, 3488, 3488, 3488, 3488, 3488, 3488, 3488, 3488, 3488, 3488, + 3488, 3488, 3488, 3488, 3488, 3488, 3488, 3488, 3488, 3488, 3488, 3488, + 3488, 3488, 3488, 3488, 3488, 3488, 3488, 3488, 3488, 3488, 3488, 3496, + 3504, 3512, 3512, 3512, 3512, 3512, 3512, 3512, 3512, 3512, 3512, 3512, + 3512, 3512, 3512, 3512, 3512, 3512, 3512, 3512, 3512, 3512, 3512, 3512, + 3512, 3512, 3512, 3512, 3512, 3512, 3512, 3512, 3512, 3512, 3512, 3512, + 3512, 3512, 3512, 3512, 3512, 3512, 3512, 3512, 3512, 3512, 3512, 3512, + 3512, 3512, 3512, 3512, 3512}, + {3512, 3512, 3512, 3512, 3512, 3512, 3512, 3512, 3512, 3512, 3512, 3512, + 3512, 3512, 3512, 3512, 3512, 3512, 3512, 3512, 3512, 3512, 3512, 3512, + 3512, 3512, 3512, 3512, 3512, 3512, 3512, 3512, 3512, 3512, 3512, 3512, + 3512, 3512, 3512, 3512, 3512, 3512, 3512, 3512, 3512, 3512, 3512, 3512, + 3512, 3512, 3512, 3512, 3512, 3512, 3512, 3512, 3512, 3512, 3512, 3512, + 3512, 3512, 3512, 3512, 3512, 3512, 3512, 3512, 3512, 3512, 3512, 3512, + 3512, 3520, 3520, 3520, 3520, 3520, 3520, 3520, 3520, 3520, 3520, 3520, + 3520, 3520, 3520, 3520, 3520, 3520, 3520, 3520, 3520, 3520, 3520, 3520, + 3520, 3520, 3520, 3520, 3520, 3520, 3520, 3520, 3520, 3520, 3520, 3520, + 3520, 3520, 3520, 3520, 3520, 3520, 3520, 3520, 3520, 3520, 3520, 3520, + 3520, 3520, 3520, 3520, 3520, 3520, 3520, 3520, 3520, 3520, 3520, 3520, + 3520, 3520, 3520, 3520, 3520, 3520, 3520, 3520, 3520, 3520, 3520, 3520, + 3520, 3520, 3520, 3520, 3520, 3520, 3520, 3520, 3520, 3520, 3520, 3520, + 3520, 3520, 3520, 3520, 3520, 3520, 3520, 3520, 3520, 3520, 3520, 3520, + 3520, 3520, 3520, 3520, 3520, 3520, 3520, 3520, 3520, 3520, 3520, 3520, + 3520, 3520, 3520, 3520, 3520, 3520, 3520, 3520, 3520, 3520, 3520, 3520, + 3520, 3528, 3528, 3528, 3528, 3528, 3528, 3528, 3536, 3544, 3544, 3552, + 3564, 3564, 3564, 3564, 3564, 3564, 3564, 3564, 3564, 3564, 3564, 3564, + 3564, 3564, 3564, 3564, 3564, 3564, 3564, 3564, 3564, 3564, 3564, 3564, + 3564, 3564, 3564, 3564, 3564, 3564, 3564, 3564, 3564, 3564, 3564, 3564, + 3564, 3564, 3564, 3564, 3564, 3564, 3564, 3564, 3564, 3564, 3564, 3564, + 3564, 3564, 3564, 3564, 3564}, + {3564, 3564, 3564, 3564, 3564, 3564, 3564, 3564, 3564, 3564, 3564, 3564, + 3564, 3564, 3564, 3564, 3564, 3564, 3564, 3564, 3564, 3564, 3564, 3564, + 3564, 3564, 3564, 3564, 3564, 3564, 3564, 3564, 3564, 3564, 3564, 3564, + 3564, 3564, 3564, 3564, 3564, 3564, 3564, 3564, 3564, 3564, 3564, 3564, + 3564, 3564, 3564, 3564, 3564, 3564, 3564, 3564, 3564, 3564, 3564, 3564, + 3564, 3564, 3564, 3564, 3564, 3564, 3564, 3564, 3564, 3564, 3564, 3564, + 3564, 3564, 3564, 3572, 3580, 3588, 3588, 3588, 3588, 3588, 3588, 3588, + 3588, 3588, 3588, 3588, 3588, 3588, 3588, 3588, 3588, 3588, 3588, 3588, + 3588, 3588, 3588, 3588, 3588, 3588, 3588, 3588, 3588, 3588, 3588, 3588, + 3588, 3588, 3588, 3588, 3588, 3588, 3588, 3588, 3588, 3588, 3588, 3588, + 3588, 3588, 3588, 3588, 3588, 3588, 3588, 3588, 3588, 3588, 3588, 3588, + 3588, 3588, 3588, 3588, 3588, 3588, 3588, 3588, 3588, 3588, 3588, 3588, + 3588, 3588, 3588, 3588, 3588, 3588, 3588, 3588, 3588, 3588, 3588, 3588, + 3588, 3588, 3588, 3588, 3588, 3588, 3588, 3588, 3588, 3588, 3588, 3588, + 3588, 3588, 3588, 3588, 3588, 3588, 3588, 3588, 3588, 3588, 3588, 3588, + 3588, 3588, 3588, 3588, 3588, 3588, 3588, 3588, 3588, 3588, 3588, 3588, + 3588, 3588, 3588, 3588, 3588, 3588, 3588, 3588, 3588, 3588, 3588, 3588, + 3588, 3588, 3588, 3588, 3588, 3588, 3588, 3588, 3588, 3588, 3588, 3588, + 3588, 3588, 3588, 3596, 3596, 3604, 3616, 3624, 3624, 3624, 3624, 3624, + 3624, 3624, 3624, 3624, 3624, 3624, 3624, 3624, 3624, 3624, 3624, 3624, + 3624, 3624, 3624, 3624, 3624, 3624, 3624, 3624, 3624, 3624, 3624, 3624, + 3624, 3624, 3624, 3624, 3624}, + {3624, 3624, 3624, 3624, 3624, 3624, 3624, 3624, 3624, 3624, 3624, 3624, + 3624, 3624, 3624, 3624, 3624, 3624, 3624, 3624, 3624, 3624, 3624, 3624, + 3624, 3624, 3624, 3624, 3624, 3624, 3624, 3624, 3624, 3624, 3624, 3624, + 3624, 3624, 3624, 3624, 3624, 3624, 3624, 3624, 3624, 3624, 3624, 3624, + 3624, 3624, 3624, 3625, 3632, 3632, 3632, 3632, 3632, 3632, 3632, 3632, + 3632, 3632, 3632, 3632, 3632, 3632, 3632, 3632, 3632, 3632, 3632, 3632, + 3632, 3632, 3632, 3632, 3632, 3632, 3632, 3632, 3632, 3632, 3632, 3632, + 3632, 3632, 3632, 3632, 3632, 3632, 3632, 3632, 3632, 3632, 3632, 3632, + 3632, 3632, 3632, 3632, 3632, 3632, 3632, 3632, 3632, 3632, 3632, 3632, + 3632, 3632, 3632, 3632, 3632, 3632, 3632, 3632, 3632, 3632, 3632, 3632, + 3632, 3632, 3632, 3632, 3632, 3632, 3632, 3632, 3632, 3632, 3632, 3632, + 3632, 3632, 3632, 3632, 3632, 3632, 3632, 3632, 3632, 3632, 3632, 3632, + 3632, 3632, 3632, 3632, 3632, 3632, 3632, 3632, 3632, 3632, 3632, 3632, + 3632, 3632, 3632, 3632, 3632, 3632, 3632, 3632, 3632, 3632, 3632, 3632, + 3632, 3632, 3632, 3632, 3632, 3632, 3632, 3632, 3632, 3632, 3632, 3633, + 3640, 3640, 3640, 3640, 3640, 3640, 3640, 3640, 3640, 3640, 3640, 3640, + 3640, 3640, 3640, 3640, 3640, 3640, 3640, 3640, 3640, 3640, 3640, 3640, + 3640, 3640, 3640, 3640, 3640, 3640, 3640, 3640, 3640, 3640, 3640, 3640, + 3640, 3640, 3640, 3640, 3641, 3649, 3656, 3656, 3656, 3656, 3656, 3656, + 3656, 3656, 3656, 3656, 3656, 3656, 3656, 3656, 3656, 3656, 3656, 3656, + 3656, 3656, 3656, 3656, 3656, 3656, 3656, 3656, 3656, 3656, 3656, 3656, + 3656, 3656, 3656, 3656, 3656}, + {3656, 3656, 3656, 3656, 3656, 3656, 3656, 3656, 3656, 3656, 3656, 3656, + 3657, 3660, 3660, 3660, 3660, 3660, 3660, 3660, 3660, 3660, 3660, 3660, + 3660, 3660, 3660, 3660, 3660, 3660, 3660, 3660, 3660, 3660, 3660, 3660, + 3660, 3660, 3660, 3660, 3660, 3660, 3660, 3660, 3660, 3660, 3660, 3660, + 3660, 3660, 3660, 3660, 3660, 3660, 3660, 3660, 3660, 3660, 3660, 3660, + 3660, 3660, 3660, 3660, 3660, 3660, 3660, 3660, 3668, 3668, 3668, 3668, + 3668, 3668, 3668, 3668, 3668, 3668, 3676, 3676, 3676, 3676, 3676, 3684, + 3684, 3684, 3684, 3684, 3692, 3692, 3692, 3692, 3692, 3700, 3700, 3700, + 3700, 3700, 3700, 3700, 3700, 3700, 3700, 3700, 3700, 3700, 3708, 3708, + 3708, 3708, 3708, 3708, 3708, 3708, 3708, 3708, 3716, 3716, 3724, 3733, + 3744, 3753, 3764, 3764, 3764, 3764, 3764, 3764, 3764, 3764, 3772, 3772, + 3772, 3772, 3772, 3772, 3772, 3772, 3772, 3772, 3772, 3772, 3772, 3772, + 3772, 3772, 3772, 3772, 3780, 3780, 3780, 3780, 3780, 3780, 3780, 3780, + 3780, 3780, 3788, 3788, 3788, 3788, 3788, 3796, 3796, 3796, 3796, 3796, + 3804, 3804, 3804, 3804, 3804, 3812, 3812, 3812, 3812, 3812, 3812, 3812, + 3812, 3812, 3812, 3812, 3812, 3812, 3820, 3820, 3820, 3820, 3820, 3820, + 3820, 3820, 3820, 3820, 3820, 3820, 3820, 3820, 3820, 3820, 3820, 3820, + 3820, 3820, 3820, 3820, 3820, 3820, 3820, 3820, 3820, 3820, 3820, 3820, + 3820, 3820, 3820, 3820, 3820, 3820, 3820, 3820, 3820, 3820, 3820, 3820, + 3820, 3820, 3820, 3820, 3820, 3820, 3820, 3820, 3820, 3820, 3820, 3820, + 3820, 3820, 3820, 3820, 3820, 3820, 3820, 3820, 3820, 3820, 3820, 3820, + 3820, 3820, 3820, 3820, 3820}, + {3820, 3820, 3820, 3820, 3820, 3820, 3820, 3820, 3820, 3820, 3820, 3820, + 3820, 3820, 3820, 3820, 3820, 3820, 3820, 3820, 3820, 3820, 3820, 3820, + 3820, 3820, 3820, 3820, 3820, 3820, 3820, 3820, 3820, 3820, 3820, 3820, + 3820, 3820, 3820, 3828, 3828, 3828, 3828, 3828, 3828, 3828, 3828, 3828, + 3828, 3828, 3828, 3828, 3828, 3828, 3828, 3828, 3828, 3828, 3828, 3828, + 3828, 3828, 3828, 3828, 3828, 3828, 3828, 3828, 3828, 3828, 3828, 3828, + 3828, 3828, 3828, 3828, 3828, 3828, 3828, 3828, 3828, 3828, 3828, 3828, + 3828, 3828, 3828, 3828, 3828, 3828, 3828, 3828, 3828, 3828, 3828, 3828, + 3828, 3828, 3828, 3828, 3828, 3828, 3828, 3828, 3828, 3828, 3828, 3828, + 3828, 3828, 3828, 3828, 3828, 3828, 3828, 3828, 3828, 3828, 3828, 3828, + 3828, 3828, 3828, 3828, 3828, 3828, 3828, 3828, 3828, 3828, 3828, 3828, + 3828, 3828, 3828, 3828, 3828, 3828, 3828, 3828, 3828, 3828, 3828, 3828, + 3828, 3828, 3828, 3828, 3828, 3828, 3828, 3828, 3828, 3828, 3828, 3828, + 3828, 3828, 3828, 3828, 3828, 3828, 3828, 3828, 3828, 3828, 3828, 3828, + 3828, 3828, 3828, 3828, 3828, 3828, 3828, 3828, 3828, 3828, 3828, 3828, + 3828, 3828, 3828, 3828, 3828, 3828, 3828, 3828, 3828, 3828, 3828, 3828, + 3828, 3828, 3828, 3828, 3828, 3828, 3828, 3828, 3828, 3828, 3828, 3828, + 3828, 3828, 3828, 3828, 3828, 3828, 3828, 3828, 3828, 3828, 3828, 3828, + 3828, 3828, 3828, 3828, 3828, 3828, 3828, 3828, 3828, 3828, 3828, 3828, + 3828, 3828, 3828, 3828, 3828, 3828, 3828, 3828, 3828, 3828, 3828, 3828, + 3828, 3828, 3828, 3828, 3828, 3828, 3828, 3828, 3828, 3828, 3828, 3828, + 3829, 3832, 3832, 3832, 3832}, + {3832, 3832, 3832, 3832, 3832, 3832, 3832, 3840, 3840, 3848, 3848, 3856, + 3856, 3864, 3864, 3872, 3872, 3872, 3872, 3880, 3880, 3880, 3880, 3880, + 3880, 3880, 3880, 3880, 3880, 3880, 3880, 3880, 3880, 3880, 3880, 3880, + 3880, 3880, 3880, 3880, 3880, 3880, 3880, 3880, 3880, 3880, 3880, 3880, + 3880, 3880, 3880, 3880, 3880, 3880, 3880, 3880, 3880, 3880, 3880, 3880, + 3888, 3888, 3896, 3896, 3896, 3904, 3912, 3912, 3920, 3920, 3920, 3920, + 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, + 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, + 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, + 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, + 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, + 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, + 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, + 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, + 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, + 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, + 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, + 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, + 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, + 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, + 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, + 3920, 3920, 3920, 3920, 3920}, + {3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, + 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, + 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, + 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3920, 3921, 3925, 3929, 3932, + 3933, 3937, 3941, 3945, 3949, 3953, 3957, 3961, 3965, 3969, 3973, 3976, + 3977, 3981, 3985, 3989, 3993, 3997, 4001, 4005, 4009, 4013, 4017, 4021, + 4025, 4029, 4033, 4037, 4041, 4045, 4048, 4049, 4053, 4057, 4061, 4065, + 4069, 4073, 4077, 4081, 4085, 4089, 4093, 4097, 4101, 4105, 4109, 4113, + 4117, 4121, 4125, 4129, 4133, 4137, 4141, 4145, 4149, 4153, 4157, 4160, + 4160, 4160, 4160, 4160, 4160, 4160, 4160, 4160, 4160, 4160, 4160, 4160, + 4161, 4164, 4164, 4164, 4164, 4164, 4164, 4164, 4164, 4164, 4164, 4164, + 4164, 4164, 4164, 4164, 4164, 4164, 4164, 4164, 4164, 4164, 4164, 4164, + 4164, 4164, 4164, 4164, 4164, 4164, 4164, 4164, 4164, 4164, 4164, 4165, + 4169, 4173, 4177, 4181, 4185, 4189, 4193, 4197, 4201, 4205, 4209, 4213, + 4217, 4221, 4225, 4229, 4233, 4237, 4241, 4245, 4249, 4253, 4257, 4261, + 4265, 4269, 4273, 4277, 4281, 4285, 4289, 4293, 4297, 4301, 4305, 4309, + 4312, 4312, 4312, 4312, 4312, 4312, 4312, 4312, 4312, 4312, 4312, 4312, + 4312, 4312, 4312, 4312, 4312, 4312, 4312, 4312, 4312, 4312, 4312, 4312, + 4312, 4312, 4312, 4312, 4312, 4312, 4312, 4312, 4312, 4312, 4312, 4312, + 4312, 4312, 4312, 4312, 4312, 4312, 4312, 4312, 4312, 4312, 4312, 4312, + 4312, 4312, 4312, 4312, 4312, 4312, 4312, 4312, 4312, 4312, 4312, 4312, + 4312, 4312, 4312, 4312, 4312}, + {4312, 4320, 4328, 4336, 4344, 4352, 4360, 4368, 4376, 4388, 4400, 4408, + 4416, 4424, 4432, 4440, 4448, 4456, 4464, 4472, 4480, 4492, 4504, 4516, + 4528, 4536, 4544, 4552, 4560, 4572, 4584, 4592, 4600, 4608, 4616, 4624, + 4632, 4640, 4648, 4656, 4664, 4672, 4680, 4688, 4696, 4704, 4712, 4724, + 4736, 4744, 4752, 4760, 4768, 4776, 4784, 4792, 4800, 4812, 4824, 4832, + 4840, 4848, 4856, 4864, 4872, 4880, 4888, 4896, 4904, 4912, 4920, 4928, + 4936, 4944, 4952, 4960, 4968, 4980, 4992, 5004, 5016, 5028, 5040, 5052, + 5064, 5072, 5080, 5088, 5096, 5104, 5112, 5120, 5128, 5140, 5152, 5160, + 5168, 5176, 5184, 5192, 5200, 5212, 5224, 5236, 5248, 5260, 5272, 5280, + 5288, 5296, 5304, 5312, 5320, 5328, 5336, 5344, 5352, 5360, 5368, 5376, + 5384, 5396, 5408, 5420, 5432, 5440, 5448, 5456, 5464, 5472, 5480, 5488, + 5496, 5504, 5512, 5520, 5528, 5536, 5544, 5552, 5560, 5568, 5576, 5584, + 5592, 5600, 5608, 5616, 5624, 5632, 5640, 5648, 5656, 5664, 5673, 5682, + 5688, 5688, 5688, 5688, 5688, 5696, 5704, 5712, 5720, 5732, 5744, 5756, + 5768, 5780, 5792, 5804, 5816, 5828, 5840, 5852, 5864, 5876, 5888, 5900, + 5912, 5924, 5936, 5948, 5960, 5968, 5976, 5984, 5992, 6000, 6008, 6020, + 6032, 6044, 6056, 6068, 6080, 6092, 6104, 6116, 6128, 6136, 6144, 6152, + 6160, 6168, 6176, 6184, 6192, 6204, 6216, 6228, 6240, 6252, 6264, 6276, + 6288, 6300, 6312, 6324, 6336, 6348, 6360, 6372, 6384, 6396, 6408, 6420, + 6432, 6440, 6448, 6456, 6464, 6476, 6488, 6500, 6512, 6524, 6536, 6548, + 6560, 6572, 6584, 6592, 6600, 6608, 6616, 6624, 6632, 6640, 6648, 6648, + 6648, 6648, 6648, 6648, 6648}, + {6648, 6656, 6664, 6676, 6688, 6700, 6712, 6724, 6736, 6744, 6752, 6764, + 6776, 6788, 6800, 6812, 6824, 6832, 6840, 6852, 6864, 6876, 6888, 6888, + 6888, 6896, 6904, 6916, 6928, 6940, 6952, 6952, 6952, 6960, 6968, 6980, + 6992, 7004, 7016, 7028, 7040, 7048, 7056, 7068, 7080, 7092, 7104, 7116, + 7128, 7136, 7144, 7156, 7168, 7180, 7192, 7204, 7216, 7224, 7232, 7244, + 7256, 7268, 7280, 7292, 7304, 7312, 7320, 7332, 7344, 7356, 7368, 7368, + 7368, 7376, 7384, 7396, 7408, 7420, 7432, 7432, 7432, 7440, 7448, 7460, + 7472, 7484, 7496, 7508, 7520, 7520, 7528, 7528, 7540, 7540, 7552, 7552, + 7564, 7572, 7580, 7592, 7604, 7616, 7628, 7640, 7652, 7660, 7668, 7680, + 7692, 7704, 7716, 7728, 7740, 7748, 7756, 7764, 7772, 7780, 7788, 7796, + 7804, 7812, 7820, 7828, 7836, 7844, 7852, 7852, 7852, 7864, 7876, 7892, + 7908, 7924, 7940, 7956, 7972, 7984, 7996, 8012, 8028, 8044, 8060, 8076, + 8092, 8104, 8116, 8132, 8148, 8164, 8180, 8196, 8212, 8224, 8236, 8252, + 8268, 8284, 8300, 8316, 8332, 8344, 8356, 8372, 8388, 8404, 8420, 8436, + 8452, 8464, 8476, 8492, 8508, 8524, 8540, 8556, 8572, 8580, 8588, 8600, + 8608, 8620, 8620, 8628, 8640, 8648, 8656, 8664, 8672, 8681, 8688, 8693, + 8701, 8710, 8716, 8728, 8736, 8748, 8748, 8756, 8768, 8776, 8784, 8792, + 8800, 8810, 8818, 8826, 8832, 8840, 8848, 8860, 8872, 8872, 8872, 8880, + 8892, 8900, 8908, 8916, 8924, 8926, 8934, 8942, 8948, 8956, 8964, 8976, + 8988, 8996, 9004, 9012, 9024, 9032, 9040, 9048, 9056, 9066, 9074, 9080, + 9084, 9084, 9084, 9096, 9104, 9116, 9116, 9124, 9136, 9144, 9152, 9160, + 9168, 9178, 9181, 9188, 9190}, + {9190, 9194, 9197, 9201, 9205, 9209, 9213, 9217, 9221, 9225, 9229, 9232, + 9232, 9232, 9232, 9232, 9232, 9233, 9236, 9236, 9236, 9236, 9236, 9237, + 9244, 9244, 9244, 9244, 9244, 9244, 9244, 9244, 9244, 9244, 9244, 9244, + 9245, 9249, 9257, 9268, 9268, 9268, 9268, 9268, 9268, 9268, 9268, 9269, + 9272, 9272, 9272, 9273, 9281, 9292, 9293, 9301, 9312, 9312, 9312, 9312, + 9313, 9320, 9321, 9328, 9328, 9328, 9328, 9328, 9328, 9328, 9328, 9329, + 9337, 9345, 9352, 9352, 9352, 9352, 9352, 9352, 9352, 9352, 9352, 9352, + 9352, 9352, 9352, 9353, 9368, 9368, 9368, 9368, 9368, 9368, 9368, 9369, + 9372, 9372, 9372, 9372, 9372, 9372, 9372, 9372, 9372, 9372, 9372, 9372, + 9372, 9372, 9372, 9372, 9373, 9377, 9380, 9380, 9381, 9385, 9389, 9393, + 9397, 9401, 9405, 9409, 9413, 9417, 9421, 9425, 9429, 9433, 9437, 9441, + 9445, 9449, 9453, 9457, 9461, 9465, 9469, 9473, 9477, 9481, 9485, 9488, + 9489, 9493, 9497, 9501, 9505, 9509, 9513, 9517, 9521, 9525, 9529, 9533, + 9537, 9540, 9540, 9540, 9540, 9540, 9540, 9540, 9540, 9540, 9540, 9540, + 9541, 9548, 9548, 9548, 9548, 9548, 9548, 9548, 9548, 9548, 9548, 9548, + 9548, 9548, 9548, 9548, 9548, 9548, 9548, 9548, 9548, 9548, 9548, 9548, + 9548, 9548, 9548, 9548, 9548, 9548, 9548, 9548, 9548, 9548, 9548, 9548, + 9548, 9548, 9548, 9548, 9548, 9548, 9548, 9548, 9548, 9548, 9548, 9548, + 9548, 9548, 9548, 9548, 9548, 9548, 9548, 9548, 9548, 9548, 9548, 9548, + 9548, 9548, 9548, 9548, 9548, 9548, 9548, 9548, 9548, 9548, 9548, 9548, + 9548, 9548, 9548, 9548, 9548, 9548, 9548, 9548, 9548, 9548, 9548, 9548, + 9548, 9548, 9548, 9548, 9549}, + {9549, 9561, 9573, 9577, 9584, 9585, 9597, 9609, 9612, 9613, + 9621, 9625, 9629, 9633, 9637, 9641, 9645, 9649, 9653, 9657, + 9660, 9661, 9665, 9672, 9672, 9673, 9677, 9681, 9685, 9689, + 9692, 9692, 9693, 9701, 9713, 9720, 9721, 9724, 9724, 9728, + 9729, 9732, 9732, 9736, 9745, 9749, 9752, 9753, 9757, 9761, + 9764, 9765, 9769, 9773, 9777, 9781, 9785, 9789, 9792, 9793, + 9805, 9809, 9813, 9817, 9821, 9824, 9824, 9824, 9824, 9825, + 9829, 9833, 9837, 9841, 9844, 9844, 9844, 9844, 9844, 9844, + 9845, 9857, 9869, 9885, 9897, 9909, 9921, 9933, 9945, 9957, + 9969, 9981, 9993, 10005, 10017, 10029, 10037, 10041, 10049, 10061, + 10069, 10073, 10081, 10093, 10109, 10117, 10121, 10129, 10141, 10145, + 10149, 10153, 10157, 10161, 10169, 10181, 10189, 10193, 10201, 10213, + 10229, 10237, 10241, 10249, 10261, 10265, 10269, 10273, 10276, 10276, + 10276, 10276, 10276, 10276, 10276, 10276, 10276, 10277, 10288, 10288, + 10288, 10288, 10288, 10288, 10288, 10288, 10288, 10288, 10288, 10288, + 10288, 10288, 10288, 10288, 10288, 10296, 10304, 10304, 10304, 10304, + 10304, 10304, 10304, 10304, 10304, 10304, 10304, 10304, 10304, 10304, + 10304, 10304, 10304, 10304, 10304, 10312, 10312, 10312, 10312, 10312, + 10312, 10312, 10312, 10312, 10312, 10312, 10312, 10312, 10312, 10312, + 10312, 10312, 10312, 10312, 10312, 10312, 10312, 10312, 10312, 10312, + 10312, 10312, 10312, 10312, 10312, 10312, 10320, 10328, 10336, 10336, + 10336, 10336, 10336, 10336, 10336, 10336, 10336, 10336, 10336, 10336, + 10336, 10336, 10336, 10336, 10336, 10336, 10336, 10336, 10336, 10336, + 10336, 10336, 10336, 10336, 10336, 10336, 10336, 10336, 10336, 10336, + 10336, 10336, 10336, 10336, 10336, 10336, 10336, 10336, 10336, 10336, + 10336, 10336, 10336, 10336, 10336, 10336, 10336}, + {10336, 10336, 10336, 10336, 10336, 10344, 10344, 10344, 10344, 10344, + 10352, 10352, 10352, 10360, 10360, 10360, 10360, 10360, 10360, 10360, + 10360, 10360, 10360, 10360, 10360, 10360, 10360, 10360, 10360, 10360, + 10360, 10360, 10360, 10360, 10360, 10360, 10360, 10368, 10368, 10376, + 10376, 10376, 10376, 10376, 10377, 10385, 10396, 10397, 10405, 10416, + 10416, 10416, 10416, 10416, 10416, 10416, 10416, 10416, 10416, 10416, + 10416, 10416, 10416, 10416, 10416, 10416, 10424, 10424, 10424, 10432, + 10432, 10432, 10440, 10440, 10448, 10448, 10448, 10448, 10448, 10448, + 10448, 10448, 10448, 10448, 10448, 10448, 10448, 10448, 10448, 10448, + 10448, 10448, 10448, 10448, 10448, 10448, 10448, 10456, 10456, 10464, + 10464, 10464, 10464, 10464, 10464, 10464, 10464, 10464, 10464, 10464, + 10472, 10480, 10488, 10496, 10504, 10504, 10504, 10512, 10520, 10520, + 10520, 10528, 10536, 10536, 10536, 10536, 10536, 10536, 10536, 10544, + 10552, 10552, 10552, 10560, 10568, 10568, 10568, 10576, 10584, 10584, + 10584, 10584, 10584, 10584, 10584, 10584, 10584, 10584, 10584, 10584, + 10584, 10584, 10584, 10584, 10584, 10584, 10584, 10584, 10584, 10584, + 10584, 10584, 10584, 10584, 10584, 10584, 10584, 10584, 10584, 10584, + 10584, 10584, 10584, 10592, 10600, 10608, 10616, 10616, 10616, 10616, + 10616, 10616, 10616, 10616, 10616, 10616, 10616, 10616, 10616, 10616, + 10616, 10616, 10616, 10616, 10616, 10616, 10616, 10616, 10616, 10616, + 10616, 10616, 10616, 10616, 10616, 10616, 10616, 10616, 10616, 10616, + 10616, 10616, 10616, 10616, 10616, 10616, 10616, 10616, 10616, 10616, + 10616, 10616, 10616, 10616, 10616, 10624, 10632, 10640, 10648, 10648, + 10648, 10648, 10648, 10648, 10648, 10656, 10664, 10672, 10680, 10680, + 10680, 10680, 10680, 10680, 10680, 10680, 10680, 10680, 10680, 10680, + 10680, 10680, 10680, 10680, 10680, 10680, 10680}, + {10680, 10680, 10680, 10680, 10680, 10680, 10680, 10680, 10680, 10680, + 10680, 10680, 10680, 10680, 10680, 10680, 10680, 10680, 10680, 10680, + 10680, 10680, 10680, 10680, 10680, 10680, 10680, 10680, 10680, 10680, + 10680, 10680, 10680, 10680, 10680, 10680, 10680, 10680, 10680, 10680, + 10680, 10680, 10684, 10688, 10688, 10688, 10688, 10688, 10688, 10688, + 10688, 10688, 10688, 10688, 10688, 10688, 10688, 10688, 10688, 10688, + 10688, 10688, 10688, 10688, 10688, 10688, 10688, 10688, 10688, 10688, + 10688, 10688, 10688, 10688, 10688, 10688, 10688, 10688, 10688, 10688, + 10688, 10688, 10688, 10688, 10688, 10688, 10688, 10688, 10688, 10688, + 10688, 10688, 10688, 10688, 10688, 10688, 10688, 10688, 10688, 10688, + 10688, 10688, 10688, 10688, 10688, 10688, 10688, 10688, 10688, 10688, + 10688, 10688, 10688, 10688, 10688, 10688, 10688, 10688, 10688, 10688, + 10688, 10688, 10688, 10688, 10688, 10688, 10688, 10688, 10688, 10688, + 10688, 10688, 10688, 10688, 10688, 10688, 10688, 10688, 10688, 10688, + 10688, 10688, 10688, 10688, 10688, 10688, 10688, 10688, 10688, 10688, + 10688, 10688, 10688, 10688, 10688, 10688, 10688, 10688, 10688, 10688, + 10688, 10688, 10688, 10688, 10688, 10688, 10688, 10688, 10688, 10688, + 10688, 10688, 10688, 10688, 10688, 10688, 10688, 10688, 10688, 10688, + 10688, 10688, 10688, 10688, 10688, 10688, 10688, 10688, 10688, 10688, + 10688, 10688, 10688, 10688, 10688, 10688, 10688, 10688, 10688, 10688, + 10688, 10688, 10688, 10688, 10688, 10688, 10688, 10688, 10688, 10688, + 10688, 10688, 10688, 10688, 10688, 10688, 10688, 10688, 10688, 10688, + 10688, 10688, 10688, 10688, 10688, 10688, 10688, 10688, 10688, 10688, + 10688, 10688, 10688, 10688, 10688, 10688, 10688, 10688, 10688, 10688, + 10688, 10688, 10688, 10688, 10688, 10688, 10688, 10688, 10688, 10688, + 10688, 10688, 10688, 10688, 10688, 10688, 10688}, + {10688, 10688, 10688, 10688, 10688, 10688, 10688, 10688, 10688, 10688, + 10688, 10688, 10688, 10688, 10688, 10688, 10688, 10688, 10688, 10688, + 10688, 10688, 10688, 10688, 10688, 10688, 10688, 10688, 10688, 10688, + 10688, 10688, 10688, 10688, 10688, 10688, 10688, 10688, 10688, 10688, + 10688, 10688, 10688, 10688, 10688, 10688, 10688, 10688, 10688, 10688, + 10688, 10688, 10688, 10688, 10688, 10688, 10688, 10688, 10688, 10688, + 10688, 10688, 10688, 10688, 10688, 10688, 10688, 10688, 10688, 10688, + 10688, 10688, 10688, 10688, 10688, 10688, 10688, 10688, 10688, 10688, + 10688, 10688, 10688, 10688, 10688, 10688, 10688, 10688, 10688, 10688, + 10688, 10688, 10688, 10688, 10688, 10688, 10689, 10693, 10697, 10701, + 10705, 10709, 10713, 10717, 10721, 10725, 10733, 10741, 10749, 10757, + 10765, 10773, 10781, 10789, 10797, 10805, 10813, 10825, 10837, 10849, + 10861, 10873, 10885, 10897, 10909, 10921, 10937, 10953, 10969, 10985, + 11001, 11017, 11033, 11049, 11065, 11081, 11097, 11105, 11113, 11121, + 11129, 11137, 11145, 11153, 11161, 11169, 11181, 11193, 11205, 11217, + 11229, 11241, 11253, 11265, 11277, 11289, 11301, 11313, 11325, 11337, + 11349, 11361, 11373, 11385, 11397, 11409, 11421, 11433, 11445, 11457, + 11469, 11481, 11493, 11505, 11517, 11529, 11541, 11553, 11565, 11577, + 11589, 11601, 11613, 11617, 11621, 11625, 11629, 11633, 11637, 11641, + 11645, 11649, 11653, 11657, 11661, 11665, 11669, 11673, 11677, 11681, + 11685, 11689, 11693, 11697, 11701, 11705, 11709, 11713, 11717, 11721, + 11725, 11729, 11733, 11737, 11741, 11745, 11749, 11753, 11757, 11761, + 11765, 11769, 11773, 11777, 11781, 11785, 11789, 11793, 11797, 11801, + 11805, 11809, 11813, 11817, 11821, 11824, 11824, 11824, 11824, 11824, + 11824, 11824, 11824, 11824, 11824, 11824, 11824, 11824, 11824, 11824, + 11824, 11824, 11824, 11824, 11824, 11824, 11824}, + {11824, 11824, 11824, 11824, 11824, 11824, 11824, 11824, 11824, 11824, + 11824, 11824, 11825, 11840, 11840, 11840, 11840, 11840, 11840, 11840, + 11840, 11840, 11840, 11840, 11840, 11840, 11840, 11840, 11840, 11840, + 11840, 11840, 11840, 11840, 11840, 11840, 11840, 11840, 11840, 11840, + 11840, 11840, 11840, 11840, 11840, 11840, 11840, 11840, 11840, 11840, + 11840, 11840, 11840, 11840, 11840, 11840, 11840, 11840, 11840, 11840, + 11840, 11840, 11840, 11840, 11840, 11840, 11840, 11840, 11840, 11840, + 11840, 11840, 11840, 11840, 11840, 11840, 11840, 11840, 11840, 11840, + 11840, 11840, 11840, 11840, 11840, 11840, 11840, 11840, 11840, 11840, + 11840, 11840, 11840, 11840, 11840, 11840, 11840, 11840, 11840, 11840, + 11840, 11840, 11840, 11840, 11840, 11840, 11840, 11840, 11840, 11840, + 11840, 11840, 11840, 11840, 11840, 11840, 11841, 11853, 11861, 11872, + 11872, 11872, 11872, 11872, 11872, 11872, 11872, 11872, 11872, 11872, + 11872, 11872, 11872, 11872, 11872, 11872, 11872, 11872, 11872, 11872, + 11872, 11872, 11872, 11872, 11872, 11872, 11872, 11872, 11872, 11872, + 11872, 11872, 11872, 11872, 11872, 11872, 11872, 11872, 11872, 11872, + 11872, 11872, 11872, 11872, 11872, 11872, 11872, 11872, 11872, 11872, + 11872, 11872, 11872, 11872, 11872, 11872, 11872, 11872, 11872, 11872, + 11872, 11872, 11872, 11872, 11872, 11872, 11872, 11872, 11872, 11872, + 11872, 11872, 11872, 11872, 11872, 11872, 11872, 11872, 11872, 11872, + 11872, 11872, 11872, 11872, 11872, 11872, 11872, 11872, 11872, 11872, + 11872, 11872, 11872, 11872, 11872, 11872, 11872, 11872, 11872, 11872, + 11872, 11880, 11880, 11880, 11880, 11880, 11880, 11880, 11880, 11880, + 11880, 11880, 11880, 11880, 11880, 11880, 11880, 11880, 11880, 11880, + 11880, 11880, 11880, 11880, 11880, 11880, 11880, 11880, 11880, 11880, + 11880, 11880, 11880, 11880, 11880, 11880, 11880}, + {11880, 11880, 11880, 11880, 11880, 11880, 11880, 11880, 11880, 11880, + 11880, 11880, 11880, 11880, 11880, 11880, 11880, 11880, 11880, 11880, + 11880, 11880, 11880, 11880, 11880, 11880, 11880, 11880, 11880, 11880, + 11880, 11880, 11880, 11880, 11880, 11880, 11880, 11880, 11880, 11880, + 11880, 11880, 11880, 11880, 11880, 11880, 11880, 11880, 11880, 11880, + 11880, 11880, 11880, 11880, 11880, 11880, 11880, 11880, 11880, 11880, + 11880, 11880, 11880, 11880, 11880, 11880, 11880, 11880, 11880, 11880, + 11880, 11880, 11880, 11880, 11880, 11880, 11880, 11880, 11880, 11880, + 11880, 11880, 11880, 11880, 11880, 11880, 11880, 11880, 11880, 11880, + 11880, 11880, 11880, 11880, 11880, 11880, 11880, 11880, 11880, 11880, + 11880, 11880, 11880, 11880, 11880, 11880, 11880, 11880, 11880, 11880, + 11880, 11880, 11880, 11880, 11880, 11880, 11880, 11880, 11880, 11880, + 11880, 11880, 11880, 11880, 11881, 11885, 11888, 11888, 11888, 11888, + 11888, 11888, 11888, 11888, 11888, 11888, 11888, 11888, 11888, 11888, + 11888, 11888, 11888, 11888, 11888, 11888, 11888, 11888, 11888, 11888, + 11888, 11888, 11888, 11888, 11888, 11888, 11888, 11888, 11888, 11888, + 11888, 11888, 11888, 11888, 11888, 11888, 11888, 11888, 11888, 11888, + 11888, 11888, 11888, 11888, 11888, 11888, 11888, 11888, 11888, 11888, + 11888, 11888, 11888, 11888, 11888, 11888, 11888, 11888, 11888, 11888, + 11888, 11888, 11888, 11888, 11888, 11888, 11888, 11888, 11888, 11888, + 11888, 11888, 11888, 11888, 11888, 11888, 11888, 11888, 11888, 11888, + 11888, 11888, 11888, 11888, 11888, 11888, 11888, 11888, 11888, 11888, + 11888, 11888, 11888, 11888, 11888, 11888, 11888, 11888, 11888, 11888, + 11888, 11888, 11888, 11888, 11888, 11888, 11888, 11888, 11888, 11888, + 11888, 11888, 11888, 11888, 11888, 11888, 11888, 11888, 11888, 11888, + 11888, 11888, 11888, 11888, 11888, 11888, 11888}, + {11888, 11888, 11888, 11888, 11888, 11888, 11888, 11888, 11888, 11888, + 11888, 11888, 11888, 11888, 11888, 11888, 11888, 11888, 11888, 11888, + 11888, 11888, 11888, 11888, 11888, 11888, 11888, 11888, 11888, 11888, + 11888, 11888, 11888, 11888, 11888, 11888, 11888, 11888, 11888, 11888, + 11888, 11888, 11888, 11888, 11888, 11888, 11888, 11888, 11888, 11888, + 11888, 11888, 11888, 11888, 11888, 11888, 11888, 11888, 11888, 11888, + 11888, 11888, 11888, 11888, 11888, 11888, 11888, 11888, 11888, 11888, + 11888, 11888, 11888, 11888, 11888, 11888, 11888, 11888, 11888, 11888, + 11888, 11888, 11888, 11888, 11888, 11888, 11888, 11888, 11888, 11888, + 11888, 11888, 11888, 11888, 11888, 11888, 11888, 11888, 11888, 11888, + 11888, 11888, 11888, 11888, 11888, 11888, 11888, 11888, 11888, 11888, + 11888, 11889, 11892, 11892, 11892, 11892, 11892, 11892, 11892, 11892, + 11892, 11892, 11892, 11892, 11892, 11892, 11892, 11892, 11892, 11892, + 11892, 11892, 11892, 11892, 11892, 11892, 11892, 11892, 11892, 11892, + 11892, 11892, 11892, 11892, 11892, 11892, 11892, 11892, 11892, 11892, + 11892, 11892, 11892, 11892, 11892, 11892, 11892, 11892, 11892, 11892, + 11892, 11892, 11892, 11892, 11892, 11892, 11892, 11892, 11892, 11892, + 11892, 11892, 11892, 11892, 11892, 11892, 11892, 11892, 11892, 11892, + 11892, 11892, 11892, 11892, 11892, 11892, 11892, 11892, 11892, 11892, + 11892, 11892, 11892, 11892, 11892, 11892, 11892, 11892, 11892, 11892, + 11892, 11892, 11892, 11892, 11892, 11892, 11892, 11892, 11892, 11892, + 11892, 11892, 11892, 11892, 11892, 11892, 11892, 11892, 11892, 11892, + 11892, 11892, 11892, 11892, 11892, 11892, 11892, 11892, 11892, 11892, + 11892, 11892, 11892, 11892, 11892, 11892, 11892, 11892, 11892, 11892, + 11892, 11892, 11892, 11892, 11892, 11892, 11892, 11892, 11892, 11892, + 11892, 11892, 11892, 11892, 11892, 11892, 11892}, + {11892, 11892, 11892, 11892, 11892, 11892, 11892, 11892, 11892, 11892, + 11892, 11892, 11892, 11892, 11892, 11892, 11892, 11892, 11892, 11892, + 11892, 11892, 11892, 11892, 11892, 11892, 11892, 11892, 11892, 11892, + 11892, 11892, 11892, 11892, 11892, 11892, 11892, 11892, 11892, 11892, + 11892, 11892, 11892, 11892, 11892, 11892, 11892, 11892, 11892, 11892, + 11892, 11892, 11892, 11892, 11892, 11892, 11892, 11892, 11892, 11892, + 11892, 11892, 11892, 11892, 11892, 11892, 11892, 11892, 11892, 11892, + 11892, 11892, 11892, 11892, 11892, 11892, 11892, 11892, 11892, 11892, + 11892, 11892, 11892, 11892, 11892, 11892, 11892, 11892, 11892, 11892, + 11892, 11892, 11892, 11892, 11892, 11892, 11892, 11892, 11892, 11892, + 11892, 11892, 11892, 11892, 11892, 11892, 11892, 11892, 11892, 11892, + 11892, 11892, 11892, 11892, 11892, 11892, 11892, 11892, 11892, 11892, + 11892, 11892, 11892, 11892, 11892, 11892, 11892, 11892, 11892, 11892, + 11892, 11892, 11892, 11892, 11892, 11892, 11892, 11892, 11892, 11892, + 11892, 11892, 11892, 11892, 11892, 11892, 11892, 11892, 11892, 11892, + 11892, 11892, 11892, 11892, 11892, 11892, 11892, 11892, 11892, 11893, + 11896, 11896, 11896, 11896, 11896, 11896, 11896, 11896, 11896, 11896, + 11896, 11896, 11896, 11896, 11896, 11896, 11896, 11896, 11896, 11896, + 11896, 11896, 11896, 11896, 11896, 11896, 11896, 11896, 11896, 11896, + 11896, 11896, 11896, 11896, 11896, 11896, 11896, 11896, 11896, 11896, + 11896, 11896, 11896, 11896, 11896, 11896, 11896, 11896, 11896, 11896, + 11896, 11896, 11896, 11896, 11896, 11896, 11896, 11896, 11896, 11896, + 11896, 11896, 11896, 11896, 11896, 11896, 11896, 11896, 11896, 11896, + 11896, 11896, 11896, 11896, 11896, 11896, 11896, 11896, 11896, 11896, + 11896, 11896, 11896, 11897, 11900, 11900, 11900, 11900, 11900, 11900, + 11900, 11900, 11900, 11900, 11900, 11900, 11901}, + {11901, 11905, 11909, 11913, 11917, 11921, 11925, 11929, 11933, 11937, + 11941, 11945, 11949, 11953, 11957, 11961, 11965, 11969, 11973, 11977, + 11981, 11985, 11989, 11993, 11997, 12001, 12005, 12009, 12013, 12017, + 12021, 12025, 12029, 12033, 12037, 12041, 12045, 12049, 12053, 12057, + 12061, 12065, 12069, 12073, 12077, 12081, 12085, 12089, 12093, 12097, + 12101, 12105, 12109, 12113, 12117, 12121, 12125, 12129, 12133, 12137, + 12141, 12145, 12149, 12153, 12157, 12161, 12165, 12169, 12173, 12177, + 12181, 12185, 12189, 12193, 12197, 12201, 12205, 12209, 12213, 12217, + 12221, 12225, 12229, 12233, 12237, 12241, 12245, 12249, 12253, 12257, + 12261, 12265, 12269, 12273, 12277, 12281, 12285, 12289, 12293, 12297, + 12301, 12305, 12309, 12313, 12317, 12321, 12325, 12329, 12333, 12337, + 12341, 12345, 12349, 12353, 12357, 12361, 12365, 12369, 12373, 12377, + 12381, 12385, 12389, 12393, 12397, 12401, 12405, 12409, 12413, 12417, + 12421, 12425, 12429, 12433, 12437, 12441, 12445, 12449, 12453, 12457, + 12461, 12465, 12469, 12473, 12477, 12481, 12485, 12489, 12493, 12497, + 12501, 12505, 12509, 12513, 12517, 12521, 12525, 12529, 12533, 12537, + 12541, 12545, 12549, 12553, 12557, 12561, 12565, 12569, 12573, 12577, + 12581, 12585, 12589, 12593, 12597, 12601, 12605, 12609, 12613, 12617, + 12621, 12625, 12629, 12633, 12637, 12641, 12645, 12649, 12653, 12657, + 12661, 12665, 12669, 12673, 12677, 12681, 12685, 12689, 12693, 12697, + 12701, 12705, 12709, 12713, 12717, 12721, 12725, 12729, 12733, 12737, + 12741, 12745, 12749, 12753, 12756, 12756, 12756, 12756, 12756, 12756, + 12756, 12756, 12756, 12756, 12756, 12756, 12756, 12756, 12756, 12756, + 12756, 12756, 12756, 12756, 12756, 12756, 12756, 12756, 12756, 12756, + 12756, 12756, 12756, 12756, 12756, 12756, 12756, 12756, 12756, 12756, + 12756, 12756, 12756, 12756, 12756, 12756, 12757}, + {12757, 12760, 12760, 12760, 12760, 12760, 12760, 12760, 12760, 12760, + 12760, 12760, 12760, 12760, 12760, 12760, 12760, 12760, 12760, 12760, + 12760, 12760, 12760, 12760, 12760, 12760, 12760, 12760, 12760, 12760, + 12760, 12760, 12760, 12760, 12760, 12760, 12760, 12760, 12760, 12760, + 12760, 12760, 12760, 12760, 12760, 12760, 12760, 12760, 12760, 12760, + 12760, 12760, 12760, 12760, 12761, 12764, 12765, 12769, 12773, 12776, + 12776, 12776, 12776, 12776, 12776, 12776, 12776, 12776, 12776, 12776, + 12776, 12776, 12776, 12776, 12776, 12776, 12776, 12784, 12784, 12792, + 12792, 12800, 12800, 12808, 12808, 12816, 12816, 12824, 12824, 12832, + 12832, 12840, 12840, 12848, 12848, 12856, 12856, 12864, 12864, 12872, + 12872, 12872, 12880, 12880, 12888, 12888, 12896, 12896, 12896, 12896, + 12896, 12896, 12896, 12904, 12912, 12912, 12920, 12928, 12928, 12936, + 12944, 12944, 12952, 12960, 12960, 12968, 12976, 12976, 12976, 12976, + 12976, 12976, 12976, 12976, 12976, 12976, 12976, 12976, 12976, 12976, + 12976, 12976, 12976, 12976, 12976, 12976, 12976, 12976, 12976, 12984, + 12984, 12984, 12984, 12984, 12984, 12985, 12993, 13000, 13000, 13009, + 13016, 13016, 13016, 13016, 13016, 13016, 13016, 13016, 13016, 13016, + 13016, 13016, 13016, 13024, 13024, 13032, 13032, 13040, 13040, 13048, + 13048, 13056, 13056, 13064, 13064, 13072, 13072, 13080, 13080, 13088, + 13088, 13096, 13096, 13104, 13104, 13112, 13112, 13112, 13120, 13120, + 13128, 13128, 13136, 13136, 13136, 13136, 13136, 13136, 13136, 13144, + 13152, 13152, 13160, 13168, 13168, 13176, 13184, 13184, 13192, 13200, + 13200, 13208, 13216, 13216, 13216, 13216, 13216, 13216, 13216, 13216, + 13216, 13216, 13216, 13216, 13216, 13216, 13216, 13216, 13216, 13216, + 13216, 13216, 13216, 13216, 13216, 13224, 13224, 13224, 13232, 13240, + 13248, 13256, 13256, 13256, 13256, 13265, 13272}, + {13272, 13272, 13272, 13272, 13272, 13272, 13272, 13272, 13272, 13272, + 13272, 13272, 13272, 13272, 13272, 13272, 13272, 13272, 13272, 13272, + 13272, 13272, 13272, 13272, 13272, 13272, 13272, 13272, 13272, 13272, + 13272, 13272, 13272, 13272, 13272, 13272, 13272, 13272, 13272, 13272, + 13272, 13272, 13272, 13272, 13272, 13272, 13272, 13272, 13272, 13273, + 13277, 13281, 13285, 13289, 13293, 13297, 13301, 13305, 13309, 13313, + 13317, 13321, 13325, 13329, 13333, 13337, 13341, 13345, 13349, 13353, + 13357, 13361, 13365, 13369, 13373, 13377, 13381, 13385, 13389, 13393, + 13397, 13401, 13405, 13409, 13413, 13417, 13421, 13425, 13429, 13433, + 13437, 13441, 13445, 13449, 13453, 13457, 13461, 13465, 13469, 13473, + 13477, 13481, 13485, 13489, 13493, 13497, 13501, 13505, 13509, 13513, + 13517, 13521, 13525, 13529, 13533, 13537, 13541, 13545, 13549, 13553, + 13557, 13561, 13565, 13569, 13573, 13577, 13581, 13585, 13589, 13593, + 13597, 13601, 13605, 13609, 13613, 13617, 13621, 13625, 13629, 13633, + 13637, 13641, 13645, 13648, 13648, 13648, 13649, 13653, 13657, 13661, + 13665, 13669, 13673, 13677, 13681, 13685, 13689, 13693, 13697, 13701, + 13704, 13704, 13704, 13704, 13704, 13704, 13704, 13704, 13704, 13704, + 13704, 13704, 13704, 13704, 13704, 13704, 13704, 13704, 13704, 13704, + 13704, 13704, 13704, 13704, 13704, 13704, 13704, 13704, 13704, 13704, + 13704, 13704, 13704, 13704, 13704, 13704, 13704, 13704, 13704, 13704, + 13704, 13704, 13704, 13704, 13704, 13704, 13704, 13704, 13704, 13704, + 13704, 13704, 13704, 13704, 13704, 13704, 13704, 13704, 13704, 13704, + 13704, 13704, 13704, 13704, 13704, 13704, 13704, 13704, 13704, 13704, + 13704, 13704, 13704, 13704, 13704, 13704, 13704, 13704, 13704, 13704, + 13704, 13704, 13704, 13704, 13704, 13704, 13704, 13704, 13704, 13704, + 13704, 13704, 13704, 13704, 13704, 13704, 13705}, + {13705, 13717, 13729, 13741, 13753, 13765, 13777, 13789, 13801, 13813, + 13825, 13837, 13849, 13861, 13873, 13889, 13905, 13921, 13937, 13953, + 13969, 13985, 14001, 14017, 14033, 14049, 14065, 14081, 14097, 14113, + 14141, 14164, 14165, 14177, 14189, 14201, 14213, 14225, 14237, 14249, + 14261, 14273, 14285, 14297, 14309, 14321, 14333, 14345, 14357, 14369, + 14381, 14393, 14405, 14417, 14429, 14441, 14453, 14465, 14477, 14489, + 14501, 14513, 14525, 14537, 14549, 14561, 14573, 14585, 14597, 14601, + 14605, 14609, 14612, 14612, 14612, 14612, 14612, 14612, 14612, 14612, + 14613, 14625, 14633, 14641, 14649, 14657, 14665, 14673, 14681, 14689, + 14697, 14705, 14713, 14721, 14729, 14737, 14745, 14749, 14753, 14757, + 14761, 14765, 14769, 14773, 14777, 14781, 14785, 14789, 14793, 14797, + 14801, 14809, 14817, 14825, 14833, 14841, 14849, 14857, 14865, 14873, + 14881, 14889, 14897, 14905, 14913, 14933, 14949, 14956, 14957, 14961, + 14965, 14969, 14973, 14977, 14981, 14985, 14989, 14993, 14997, 15001, + 15005, 15009, 15013, 15017, 15021, 15025, 15029, 15033, 15037, 15041, + 15045, 15049, 15053, 15057, 15061, 15065, 15069, 15073, 15077, 15081, + 15085, 15089, 15093, 15097, 15101, 15105, 15109, 15113, 15117, 15121, + 15125, 15129, 15133, 15137, 15141, 15145, 15149, 15153, 15161, 15169, + 15177, 15185, 15193, 15201, 15209, 15217, 15225, 15233, 15241, 15249, + 15257, 15265, 15273, 15281, 15289, 15297, 15305, 15313, 15321, 15329, + 15337, 15345, 15357, 15369, 15381, 15389, 15401, 15409, 15421, 15425, + 15429, 15433, 15437, 15441, 15445, 15449, 15453, 15457, 15461, 15465, + 15469, 15473, 15477, 15481, 15485, 15489, 15493, 15497, 15501, 15505, + 15509, 15513, 15517, 15521, 15525, 15529, 15533, 15537, 15541, 15545, + 15549, 15553, 15557, 15561, 15565, 15569, 15573, 15577, 15581, 15585, + 15589, 15593, 15597, 15601, 15605, 15609, 15617}, + {15617, 15637, 15653, 15673, 15685, 15705, 15717, 15729, 15753, 15769, + 15781, 15793, 15805, 15821, 15837, 15853, 15869, 15885, 15901, 15917, + 15941, 15949, 15973, 15997, 16017, 16033, 16057, 16081, 16097, 16109, + 16121, 16137, 16153, 16173, 16193, 16205, 16217, 16233, 16245, 16257, + 16265, 16273, 16285, 16297, 16321, 16337, 16357, 16381, 16397, 16409, + 16421, 16445, 16461, 16485, 16497, 16517, 16529, 16545, 16557, 16573, + 16593, 16609, 16629, 16645, 16653, 16673, 16685, 16697, 16713, 16725, + 16737, 16749, 16769, 16785, 16793, 16817, 16829, 16849, 16865, 16881, + 16893, 16905, 16921, 16929, 16945, 16965, 16973, 16997, 17009, 17017, + 17025, 17033, 17041, 17049, 17057, 17065, 17073, 17081, 17089, 17101, + 17113, 17125, 17137, 17149, 17161, 17173, 17185, 17197, 17209, 17221, + 17233, 17245, 17257, 17269, 17281, 17289, 17297, 17309, 17317, 17325, + 17333, 17345, 17357, 17365, 17373, 17381, 17389, 17397, 17413, 17421, + 17429, 17437, 17445, 17453, 17461, 17469, 17477, 17489, 17505, 17513, + 17521, 17529, 17537, 17545, 17553, 17561, 17573, 17585, 17597, 17609, + 17617, 17625, 17633, 17641, 17649, 17657, 17665, 17673, 17681, 17689, + 17701, 17713, 17721, 17733, 17745, 17757, 17765, 17777, 17789, 17805, + 17813, 17825, 17837, 17849, 17861, 17881, 17905, 17913, 17921, 17929, + 17937, 17945, 17953, 17961, 17969, 17977, 17985, 17993, 18001, 18009, + 18017, 18025, 18033, 18041, 18049, 18065, 18073, 18081, 18089, 18105, + 18117, 18125, 18133, 18141, 18149, 18157, 18165, 18173, 18181, 18189, + 18197, 18209, 18217, 18225, 18237, 18249, 18257, 18273, 18285, 18293, + 18301, 18309, 18317, 18329, 18341, 18349, 18357, 18365, 18373, 18381, + 18389, 18397, 18405, 18413, 18425, 18437, 18449, 18461, 18473, 18485, + 18497, 18509, 18521, 18533, 18545, 18557, 18569, 18581, 18593, 18605, + 18617, 18629, 18641, 18653, 18665, 18677, 18688}, + {18688, 18688, 18688, 18688, 18688, 18688, 18688, 18688, 18688, 18688, + 18688, 18688, 18688, 18688, 18688, 18688, 18688, 18688, 18688, 18688, + 18688, 18688, 18688, 18688, 18688, 18688, 18688, 18688, 18688, 18688, + 18688, 18688, 18688, 18688, 18688, 18688, 18688, 18688, 18688, 18688, + 18688, 18688, 18688, 18688, 18688, 18688, 18688, 18688, 18688, 18688, + 18688, 18688, 18688, 18688, 18688, 18688, 18688, 18688, 18688, 18688, + 18688, 18688, 18688, 18688, 18688, 18688, 18688, 18688, 18688, 18688, + 18688, 18688, 18688, 18688, 18688, 18688, 18688, 18688, 18688, 18688, + 18688, 18688, 18688, 18688, 18688, 18688, 18688, 18688, 18688, 18688, + 18688, 18688, 18688, 18688, 18688, 18688, 18688, 18688, 18688, 18688, + 18688, 18688, 18688, 18688, 18688, 18688, 18688, 18688, 18688, 18688, + 18688, 18688, 18688, 18688, 18688, 18688, 18688, 18688, 18688, 18688, + 18688, 18688, 18688, 18688, 18688, 18688, 18688, 18688, 18688, 18688, + 18688, 18688, 18688, 18688, 18688, 18688, 18688, 18688, 18688, 18688, + 18688, 18688, 18688, 18688, 18688, 18688, 18688, 18688, 18688, 18688, + 18688, 18688, 18688, 18688, 18688, 18688, 18689, 18693, 18696, 18696, + 18696, 18696, 18696, 18696, 18696, 18696, 18696, 18696, 18696, 18696, + 18696, 18696, 18696, 18696, 18696, 18696, 18696, 18696, 18696, 18696, + 18696, 18696, 18696, 18696, 18696, 18696, 18696, 18696, 18696, 18696, + 18696, 18696, 18696, 18696, 18696, 18696, 18696, 18696, 18696, 18696, + 18696, 18696, 18696, 18696, 18696, 18696, 18696, 18696, 18696, 18696, + 18696, 18696, 18696, 18696, 18696, 18696, 18696, 18696, 18696, 18696, + 18696, 18696, 18696, 18696, 18696, 18696, 18696, 18696, 18696, 18696, + 18696, 18696, 18696, 18696, 18696, 18696, 18696, 18696, 18696, 18696, + 18696, 18696, 18696, 18696, 18696, 18696, 18696, 18696, 18696, 18696, + 18696, 18696, 18696, 18696, 18696, 18696, 18696}, + {18696, 18696, 18696, 18696, 18696, 18696, 18696, 18696, 18696, 18696, + 18696, 18696, 18696, 18696, 18696, 18696, 18696, 18696, 18696, 18696, + 18696, 18696, 18696, 18696, 18696, 18696, 18696, 18696, 18696, 18696, + 18696, 18696, 18696, 18696, 18696, 18696, 18696, 18696, 18696, 18696, + 18696, 18696, 18696, 18696, 18696, 18696, 18696, 18696, 18696, 18696, + 18696, 18696, 18696, 18696, 18696, 18696, 18696, 18696, 18696, 18696, + 18696, 18696, 18696, 18696, 18696, 18696, 18696, 18696, 18696, 18696, + 18696, 18696, 18696, 18696, 18696, 18696, 18696, 18696, 18696, 18696, + 18696, 18696, 18696, 18696, 18696, 18696, 18696, 18696, 18696, 18696, + 18696, 18696, 18696, 18696, 18696, 18696, 18696, 18696, 18696, 18696, + 18696, 18696, 18696, 18696, 18696, 18696, 18696, 18696, 18696, 18696, + 18696, 18696, 18697, 18700, 18700, 18700, 18700, 18700, 18700, 18700, + 18700, 18700, 18700, 18700, 18700, 18700, 18700, 18700, 18700, 18700, + 18700, 18700, 18700, 18700, 18700, 18700, 18700, 18700, 18700, 18700, + 18700, 18700, 18700, 18700, 18700, 18700, 18700, 18700, 18700, 18700, + 18700, 18700, 18700, 18700, 18700, 18700, 18700, 18700, 18700, 18700, + 18700, 18700, 18700, 18700, 18700, 18700, 18700, 18700, 18700, 18700, + 18700, 18700, 18700, 18700, 18700, 18700, 18700, 18700, 18700, 18700, + 18700, 18700, 18700, 18700, 18700, 18700, 18700, 18700, 18700, 18700, + 18700, 18700, 18700, 18700, 18700, 18700, 18700, 18700, 18700, 18700, + 18700, 18700, 18700, 18700, 18700, 18700, 18700, 18700, 18700, 18700, + 18700, 18700, 18700, 18700, 18700, 18700, 18700, 18700, 18700, 18700, + 18700, 18700, 18700, 18700, 18700, 18700, 18700, 18700, 18700, 18700, + 18700, 18700, 18700, 18700, 18700, 18700, 18700, 18700, 18700, 18700, + 18700, 18700, 18701, 18705, 18709, 18712, 18712, 18712, 18713, 18717, + 18720, 18720, 18720, 18720, 18720, 18720, 18720}, + {18720, 18720, 18720, 18720, 18720, 18720, 18720, 18720, 18720, 18720, + 18720, 18720, 18720, 18720, 18720, 18720, 18720, 18720, 18720, 18720, + 18720, 18720, 18720, 18720, 18720, 18720, 18720, 18720, 18720, 18720, + 18720, 18720, 18720, 18720, 18720, 18720, 18720, 18720, 18720, 18720, + 18720, 18720, 18720, 18720, 18720, 18720, 18720, 18720, 18720, 18720, + 18720, 18720, 18720, 18720, 18720, 18720, 18720, 18720, 18720, 18720, + 18720, 18720, 18720, 18720, 18720, 18720, 18720, 18720, 18720, 18720, + 18720, 18720, 18720, 18720, 18720, 18720, 18720, 18720, 18720, 18720, + 18720, 18720, 18720, 18720, 18720, 18720, 18720, 18720, 18720, 18720, + 18720, 18720, 18721, 18725, 18729, 18733, 18736, 18736, 18736, 18736, + 18736, 18736, 18736, 18736, 18736, 18737, 18740, 18740, 18740, 18740, + 18740, 18740, 18740, 18740, 18740, 18740, 18740, 18740, 18740, 18740, + 18740, 18740, 18740, 18740, 18740, 18740, 18740, 18740, 18740, 18740, + 18740, 18740, 18740, 18740, 18740, 18740, 18740, 18740, 18740, 18740, + 18740, 18740, 18740, 18740, 18740, 18740, 18740, 18740, 18740, 18740, + 18740, 18740, 18740, 18740, 18740, 18740, 18740, 18740, 18740, 18740, + 18740, 18740, 18740, 18740, 18740, 18740, 18740, 18740, 18740, 18740, + 18740, 18740, 18740, 18740, 18740, 18740, 18740, 18740, 18740, 18740, + 18740, 18740, 18740, 18740, 18740, 18740, 18740, 18740, 18740, 18740, + 18740, 18740, 18740, 18740, 18740, 18740, 18740, 18740, 18740, 18740, + 18740, 18740, 18740, 18740, 18740, 18740, 18740, 18740, 18740, 18740, + 18740, 18740, 18740, 18740, 18740, 18740, 18740, 18740, 18740, 18740, + 18740, 18740, 18740, 18740, 18740, 18740, 18740, 18740, 18740, 18740, + 18740, 18740, 18740, 18740, 18740, 18740, 18740, 18740, 18740, 18740, + 18740, 18740, 18740, 18740, 18740, 18740, 18740, 18740, 18740, 18740, + 18740, 18740, 18740, 18740, 18740, 18740, 18740}, + {18740, 18744, 18748, 18752, 18756, 18760, 18764, 18768, 18772, 18776, + 18780, 18784, 18788, 18792, 18796, 18800, 18804, 18808, 18812, 18816, + 18820, 18824, 18828, 18832, 18836, 18840, 18844, 18848, 18852, 18856, + 18860, 18864, 18868, 18872, 18876, 18880, 18884, 18888, 18892, 18896, + 18900, 18904, 18908, 18912, 18916, 18920, 18924, 18928, 18932, 18936, + 18940, 18944, 18948, 18952, 18956, 18960, 18964, 18968, 18972, 18976, + 18980, 18984, 18988, 18992, 18996, 19000, 19004, 19008, 19012, 19016, + 19020, 19024, 19028, 19032, 19036, 19040, 19044, 19048, 19052, 19056, + 19060, 19064, 19068, 19072, 19076, 19080, 19084, 19088, 19092, 19096, + 19100, 19104, 19108, 19112, 19116, 19120, 19124, 19128, 19132, 19136, + 19140, 19144, 19148, 19152, 19156, 19160, 19164, 19168, 19172, 19176, + 19180, 19184, 19188, 19192, 19196, 19200, 19204, 19208, 19212, 19216, + 19220, 19224, 19228, 19232, 19236, 19240, 19244, 19248, 19252, 19256, + 19260, 19264, 19268, 19272, 19276, 19280, 19284, 19288, 19292, 19296, + 19300, 19304, 19308, 19312, 19316, 19320, 19324, 19328, 19332, 19336, + 19340, 19344, 19348, 19352, 19356, 19360, 19364, 19368, 19372, 19376, + 19380, 19384, 19388, 19392, 19396, 19400, 19404, 19408, 19412, 19416, + 19420, 19424, 19428, 19432, 19436, 19440, 19444, 19448, 19452, 19456, + 19460, 19464, 19468, 19472, 19476, 19480, 19484, 19488, 19492, 19496, + 19500, 19504, 19508, 19512, 19516, 19520, 19524, 19528, 19532, 19536, + 19540, 19544, 19548, 19552, 19556, 19560, 19564, 19568, 19572, 19576, + 19580, 19584, 19588, 19592, 19596, 19600, 19604, 19608, 19612, 19616, + 19620, 19624, 19628, 19632, 19636, 19640, 19644, 19648, 19652, 19656, + 19660, 19664, 19668, 19672, 19676, 19680, 19684, 19688, 19692, 19696, + 19700, 19704, 19708, 19712, 19716, 19720, 19724, 19728, 19732, 19736, + 19740, 19744, 19748, 19752, 19756, 19760, 19764}, + {19764, 19768, 19772, 19776, 19780, 19784, 19788, 19792, 19796, 19800, + 19804, 19808, 19812, 19816, 19820, 19820, 19820, 19824, 19824, 19828, + 19828, 19828, 19832, 19836, 19840, 19844, 19848, 19852, 19856, 19860, + 19864, 19868, 19868, 19872, 19872, 19876, 19876, 19876, 19880, 19884, + 19884, 19884, 19884, 19888, 19892, 19896, 19900, 19904, 19908, 19912, + 19916, 19920, 19924, 19928, 19932, 19936, 19940, 19944, 19948, 19952, + 19956, 19960, 19964, 19968, 19972, 19976, 19980, 19984, 19988, 19992, + 19996, 20000, 20004, 20008, 20012, 20016, 20020, 20024, 20028, 20032, + 20036, 20040, 20044, 20048, 20052, 20056, 20060, 20064, 20068, 20072, + 20076, 20080, 20084, 20088, 20092, 20096, 20100, 20104, 20108, 20112, + 20116, 20120, 20124, 20128, 20132, 20136, 20140, 20144, 20148, 20152, + 20156, 20156, 20156, 20160, 20164, 20168, 20172, 20176, 20180, 20184, + 20188, 20192, 20196, 20200, 20204, 20208, 20212, 20216, 20220, 20224, + 20228, 20232, 20236, 20240, 20244, 20248, 20252, 20256, 20260, 20264, + 20268, 20272, 20276, 20280, 20284, 20288, 20292, 20296, 20300, 20304, + 20308, 20312, 20316, 20320, 20324, 20328, 20332, 20336, 20340, 20344, + 20348, 20352, 20356, 20360, 20364, 20368, 20372, 20376, 20380, 20384, + 20388, 20392, 20396, 20400, 20404, 20408, 20412, 20416, 20420, 20424, + 20428, 20432, 20436, 20440, 20444, 20448, 20452, 20456, 20460, 20464, + 20468, 20472, 20476, 20480, 20484, 20488, 20492, 20496, 20500, 20504, + 20508, 20512, 20516, 20520, 20524, 20528, 20532, 20536, 20540, 20544, + 20548, 20552, 20556, 20560, 20564, 20568, 20572, 20576, 20580, 20580, + 20580, 20580, 20580, 20580, 20580, 20580, 20580, 20580, 20580, 20580, + 20580, 20580, 20580, 20580, 20580, 20580, 20580, 20580, 20580, 20580, + 20580, 20580, 20580, 20580, 20580, 20580, 20580, 20580, 20580, 20580, + 20580, 20580, 20580, 20580, 20580, 20580, 20581}, + {20581, 20589, 20597, 20605, 20617, 20629, 20637, 20644, 20644, 20644, + 20644, 20644, 20644, 20644, 20644, 20644, 20644, 20644, 20644, 20645, + 20653, 20661, 20669, 20677, 20684, 20684, 20684, 20684, 20684, 20684, + 20692, 20692, 20701, 20705, 20709, 20713, 20717, 20721, 20725, 20729, + 20733, 20737, 20740, 20748, 20756, 20768, 20780, 20788, 20796, 20804, + 20812, 20820, 20828, 20836, 20844, 20852, 20852, 20860, 20868, 20876, + 20884, 20892, 20892, 20900, 20900, 20908, 20916, 20916, 20924, 20932, + 20932, 20940, 20948, 20956, 20964, 20972, 20980, 20988, 20996, 21005, + 21013, 21017, 21021, 21025, 21029, 21033, 21037, 21041, 21045, 21049, + 21053, 21057, 21061, 21065, 21069, 21073, 21077, 21081, 21085, 21089, + 21093, 21097, 21101, 21105, 21109, 21113, 21117, 21121, 21125, 21129, + 21133, 21137, 21141, 21145, 21149, 21153, 21157, 21161, 21165, 21169, + 21173, 21177, 21181, 21185, 21189, 21193, 21197, 21201, 21205, 21209, + 21213, 21217, 21221, 21225, 21229, 21233, 21237, 21241, 21245, 21249, + 21253, 21257, 21261, 21265, 21269, 21273, 21277, 21281, 21285, 21289, + 21293, 21297, 21301, 21305, 21309, 21313, 21317, 21321, 21325, 21329, + 21333, 21337, 21341, 21345, 21349, 21357, 21365, 21369, 21373, 21377, + 21381, 21385, 21389, 21393, 21397, 21401, 21405, 21413, 21420, 21420, + 21420, 21420, 21420, 21420, 21420, 21420, 21420, 21420, 21420, 21420, + 21420, 21420, 21420, 21420, 21420, 21420, 21420, 21420, 21420, 21420, + 21420, 21420, 21420, 21420, 21420, 21420, 21420, 21420, 21420, 21420, + 21420, 21421, 21425, 21429, 21433, 21437, 21441, 21445, 21449, 21453, + 21457, 21461, 21469, 21473, 21477, 21481, 21485, 21489, 21493, 21497, + 21501, 21505, 21509, 21513, 21517, 21529, 21541, 21553, 21565, 21577, + 21589, 21601, 21613, 21625, 21637, 21649, 21661, 21673, 21685, 21697, + 21709, 21721, 21733, 21737, 21741, 21745, 21749}, + {21749, 21761, 21773, 21785, 21797, 21809, 21817, 21825, 21833, 21841, + 21849, 21857, 21865, 21873, 21881, 21889, 21897, 21905, 21913, 21921, + 21929, 21937, 21945, 21953, 21961, 21969, 21977, 21985, 21993, 22001, + 22009, 22017, 22025, 22033, 22041, 22049, 22057, 22065, 22073, 22081, + 22089, 22097, 22105, 22113, 22121, 22129, 22137, 22145, 22153, 22161, + 22169, 22177, 22185, 22193, 22201, 22209, 22217, 22225, 22233, 22241, + 22249, 22257, 22265, 22273, 22281, 22289, 22297, 22305, 22313, 22321, + 22329, 22337, 22345, 22353, 22361, 22369, 22377, 22385, 22393, 22401, + 22409, 22417, 22425, 22433, 22441, 22449, 22457, 22465, 22473, 22481, + 22489, 22497, 22505, 22513, 22521, 22533, 22545, 22557, 22569, 22581, + 22593, 22605, 22617, 22629, 22641, 22653, 22665, 22673, 22681, 22689, + 22697, 22705, 22713, 22721, 22729, 22737, 22745, 22753, 22761, 22769, + 22777, 22785, 22793, 22801, 22809, 22817, 22825, 22833, 22841, 22849, + 22857, 22865, 22873, 22881, 22889, 22897, 22905, 22913, 22921, 22929, + 22937, 22945, 22953, 22961, 22969, 22977, 22985, 22993, 23001, 23009, + 23017, 23025, 23037, 23049, 23061, 23073, 23085, 23093, 23101, 23109, + 23117, 23125, 23133, 23141, 23149, 23157, 23165, 23173, 23181, 23189, + 23197, 23205, 23213, 23221, 23229, 23237, 23245, 23253, 23261, 23269, + 23277, 23285, 23293, 23301, 23309, 23317, 23325, 23333, 23341, 23349, + 23357, 23365, 23373, 23381, 23389, 23397, 23405, 23413, 23421, 23429, + 23437, 23445, 23453, 23461, 23469, 23477, 23485, 23493, 23501, 23509, + 23517, 23525, 23533, 23541, 23549, 23557, 23565, 23573, 23581, 23589, + 23597, 23605, 23613, 23621, 23633, 23645, 23653, 23661, 23669, 23677, + 23685, 23693, 23701, 23709, 23717, 23725, 23733, 23741, 23749, 23757, + 23765, 23773, 23781, 23793, 23805, 23817, 23825, 23833, 23841, 23849, + 23857, 23865, 23873, 23881, 23889, 23897, 23905}, + {23905, 23913, 23921, 23929, 23937, 23945, 23953, 23961, 23969, 23977, + 23985, 23993, 24001, 24009, 24017, 24025, 24033, 24041, 24049, 24057, + 24065, 24073, 24081, 24089, 24097, 24105, 24113, 24121, 24129, 24137, + 24145, 24153, 24161, 24169, 24177, 24185, 24193, 24201, 24209, 24217, + 24225, 24233, 24241, 24249, 24257, 24265, 24273, 24281, 24289, 24297, + 24305, 24313, 24321, 24329, 24337, 24345, 24353, 24361, 24369, 24377, + 24385, 24393, 24400, 24400, 24400, 24400, 24400, 24400, 24400, 24400, + 24400, 24400, 24400, 24400, 24400, 24400, 24400, 24400, 24400, 24400, + 24401, 24413, 24425, 24437, 24449, 24461, 24473, 24485, 24497, 24509, + 24521, 24533, 24545, 24557, 24569, 24581, 24593, 24605, 24617, 24629, + 24641, 24653, 24665, 24677, 24689, 24701, 24713, 24725, 24737, 24749, + 24761, 24773, 24785, 24797, 24809, 24821, 24833, 24845, 24857, 24869, + 24881, 24893, 24905, 24917, 24929, 24941, 24953, 24965, 24977, 24989, + 25001, 25013, 25025, 25037, 25049, 25061, 25073, 25085, 25097, 25109, + 25121, 25133, 25145, 25157, 25168, 25168, 25169, 25181, 25193, 25205, + 25217, 25229, 25241, 25253, 25265, 25277, 25289, 25301, 25313, 25325, + 25337, 25349, 25361, 25373, 25385, 25397, 25409, 25421, 25433, 25445, + 25457, 25469, 25481, 25493, 25505, 25517, 25529, 25541, 25553, 25565, + 25577, 25589, 25601, 25613, 25625, 25637, 25649, 25661, 25673, 25685, + 25697, 25709, 25721, 25733, 25745, 25757, 25769, 25781, 25793, 25805, + 25816, 25816, 25816, 25816, 25816, 25816, 25816, 25816, 25816, 25816, + 25816, 25816, 25816, 25816, 25816, 25816, 25816, 25816, 25816, 25816, + 25816, 25816, 25816, 25816, 25816, 25816, 25816, 25816, 25816, 25816, + 25816, 25816, 25816, 25816, 25816, 25816, 25816, 25816, 25816, 25816, + 25817, 25829, 25841, 25857, 25873, 25889, 25905, 25921, 25937, 25953, + 25965, 26037, 26069, 26084, 26084, 26084, 26084}, + {26084, 26084, 26084, 26084, 26084, 26084, 26084, 26084, 26084, 26084, + 26084, 26084, 26084, 26084, 26084, 26084, 26085, 26089, 26093, 26097, + 26101, 26105, 26109, 26113, 26117, 26121, 26132, 26132, 26132, 26132, + 26132, 26132, 26132, 26132, 26132, 26132, 26132, 26132, 26132, 26132, + 26132, 26132, 26132, 26132, 26132, 26132, 26132, 26132, 26133, 26141, + 26145, 26149, 26153, 26157, 26161, 26165, 26169, 26173, 26177, 26181, + 26185, 26189, 26193, 26197, 26201, 26205, 26209, 26213, 26217, 26220, + 26220, 26221, 26225, 26229, 26237, 26245, 26253, 26261, 26265, 26269, + 26273, 26277, 26281, 26284, 26285, 26289, 26293, 26297, 26301, 26305, + 26309, 26313, 26317, 26321, 26325, 26329, 26333, 26337, 26341, 26345, + 26349, 26353, 26357, 26360, 26361, 26365, 26369, 26373, 26376, 26376, + 26376, 26376, 26377, 26385, 26393, 26400, 26401, 26408, 26409, 26417, + 26425, 26433, 26441, 26449, 26457, 26465, 26473, 26481, 26489, 26493, + 26501, 26509, 26517, 26525, 26533, 26541, 26549, 26557, 26565, 26573, + 26581, 26589, 26593, 26597, 26601, 26605, 26609, 26613, 26617, 26621, + 26625, 26629, 26633, 26637, 26641, 26645, 26649, 26653, 26657, 26661, + 26665, 26669, 26673, 26677, 26681, 26685, 26689, 26693, 26697, 26701, + 26705, 26709, 26713, 26717, 26721, 26725, 26729, 26733, 26737, 26741, + 26745, 26749, 26753, 26757, 26761, 26765, 26769, 26773, 26777, 26781, + 26785, 26789, 26793, 26797, 26801, 26805, 26809, 26813, 26817, 26821, + 26825, 26829, 26833, 26837, 26841, 26845, 26849, 26853, 26857, 26861, + 26865, 26869, 26873, 26877, 26881, 26885, 26889, 26893, 26897, 26901, + 26905, 26909, 26913, 26917, 26921, 26925, 26929, 26933, 26937, 26941, + 26945, 26949, 26953, 26957, 26961, 26965, 26969, 26973, 26977, 26981, + 26985, 26989, 26993, 26997, 27001, 27005, 27017, 27029, 27041, 27053, + 27065, 27077, 27085, 27092, 27092, 27092, 27092}, + {27092, 27093, 27097, 27101, 27105, 27109, 27113, 27117, 27121, 27125, + 27129, 27133, 27137, 27141, 27145, 27149, 27153, 27157, 27161, 27165, + 27169, 27173, 27177, 27181, 27185, 27189, 27193, 27197, 27201, 27205, + 27209, 27213, 27217, 27221, 27225, 27229, 27233, 27237, 27241, 27245, + 27249, 27253, 27257, 27261, 27265, 27269, 27273, 27277, 27281, 27285, + 27289, 27293, 27297, 27301, 27305, 27309, 27313, 27317, 27321, 27325, + 27329, 27333, 27337, 27341, 27345, 27349, 27353, 27357, 27361, 27365, + 27369, 27373, 27377, 27381, 27385, 27389, 27393, 27397, 27401, 27405, + 27409, 27413, 27417, 27421, 27425, 27429, 27433, 27437, 27441, 27445, + 27449, 27453, 27457, 27461, 27465, 27469, 27473, 27477, 27481, 27485, + 27489, 27493, 27497, 27501, 27505, 27509, 27513, 27517, 27521, 27525, + 27529, 27533, 27537, 27541, 27545, 27549, 27553, 27557, 27561, 27565, + 27569, 27573, 27577, 27581, 27585, 27589, 27593, 27597, 27601, 27605, + 27609, 27613, 27617, 27621, 27625, 27629, 27633, 27637, 27641, 27645, + 27649, 27653, 27657, 27661, 27665, 27669, 27673, 27677, 27681, 27685, + 27689, 27693, 27697, 27701, 27705, 27709, 27713, 27717, 27721, 27725, + 27729, 27733, 27737, 27741, 27745, 27749, 27753, 27757, 27761, 27765, + 27769, 27773, 27777, 27781, 27785, 27789, 27793, 27797, 27801, 27805, + 27809, 27813, 27817, 27821, 27825, 27829, 27833, 27837, 27841, 27845, + 27849, 27852, 27852, 27852, 27853, 27857, 27861, 27865, 27869, 27873, + 27876, 27876, 27877, 27881, 27885, 27889, 27893, 27897, 27900, 27900, + 27901, 27905, 27909, 27913, 27917, 27921, 27924, 27924, 27925, 27929, + 27933, 27936, 27936, 27936, 27937, 27941, 27945, 27949, 27957, 27961, + 27965, 27968, 27969, 27973, 27977, 27981, 27985, 27989, 27993, 27996, + 27996, 27996, 27996, 27996, 27996, 27996, 27996, 27996, 27996, 27996, + 27996, 27996, 27996, 27996, 27996, 27996, 27996}, + {27996, 27996, 27996, 27996, 27996, 27996, 27996, 27996, 27996, 27996, + 27996, 27996, 27996, 27996, 27996, 27996, 27996, 27996, 27996, 27996, + 27996, 27996, 27996, 27996, 27996, 27996, 27996, 27996, 27996, 27996, + 27996, 27996, 27996, 27996, 27996, 27996, 27996, 27996, 27996, 27996, + 27996, 27996, 27996, 27996, 27996, 27996, 27996, 27996, 27996, 27996, + 27996, 27996, 27996, 27996, 27996, 27996, 27996, 27996, 27996, 27996, + 27996, 27996, 27996, 27996, 27996, 27996, 27996, 27996, 27996, 27996, + 27996, 27996, 27996, 27996, 27996, 27996, 27996, 27996, 27996, 27996, + 27996, 27996, 27996, 27996, 27996, 27996, 27996, 27996, 27996, 27996, + 27996, 27996, 27996, 27996, 27996, 27996, 27996, 27996, 27996, 27996, + 27996, 27996, 27996, 27996, 27996, 27996, 27996, 27996, 27996, 27996, + 27996, 27996, 27996, 27996, 27996, 27996, 27996, 27996, 27996, 27996, + 27996, 27996, 27996, 27996, 27996, 27996, 27996, 27996, 27996, 27997, + 28001, 28005, 28009, 28013, 28016, 28017, 28021, 28025, 28029, 28033, + 28037, 28041, 28045, 28049, 28053, 28057, 28061, 28065, 28069, 28073, + 28077, 28081, 28085, 28089, 28093, 28097, 28101, 28105, 28109, 28113, + 28117, 28121, 28125, 28129, 28133, 28137, 28141, 28145, 28149, 28153, + 28157, 28161, 28165, 28169, 28173, 28177, 28181, 28184, 28185, 28189, + 28193, 28197, 28201, 28205, 28209, 28213, 28217, 28220, 28220, 28220, + 28220, 28220, 28220, 28220, 28220, 28220, 28220, 28220, 28220, 28220, + 28220, 28220, 28220, 28220, 28220, 28220, 28220, 28220, 28220, 28220, + 28220, 28220, 28220, 28220, 28220, 28220, 28220, 28220, 28220, 28220, + 28220, 28220, 28220, 28220, 28220, 28220, 28220, 28220, 28220, 28220, + 28220, 28220, 28220, 28220, 28220, 28220, 28220, 28220, 28220, 28220, + 28220, 28220, 28220, 28220, 28220, 28220, 28220, 28220, 28220, 28220, + 28220, 28220, 28220, 28220, 28220, 28220, 28220}, + {28220, 28220, 28220, 28220, 28220, 28220, 28220, 28220, 28220, 28220, + 28220, 28220, 28220, 28220, 28220, 28220, 28220, 28220, 28220, 28220, + 28220, 28220, 28220, 28220, 28220, 28220, 28220, 28220, 28220, 28220, + 28220, 28220, 28220, 28220, 28220, 28220, 28220, 28220, 28220, 28220, + 28220, 28220, 28220, 28220, 28220, 28220, 28220, 28220, 28220, 28220, + 28220, 28220, 28220, 28220, 28220, 28220, 28220, 28220, 28220, 28220, + 28220, 28220, 28220, 28220, 28220, 28220, 28220, 28220, 28220, 28220, + 28220, 28220, 28220, 28220, 28220, 28220, 28220, 28220, 28220, 28220, + 28220, 28220, 28220, 28220, 28220, 28220, 28220, 28220, 28220, 28220, + 28220, 28220, 28220, 28220, 28220, 28220, 28220, 28220, 28220, 28220, + 28220, 28220, 28220, 28220, 28220, 28220, 28220, 28220, 28220, 28220, + 28220, 28220, 28220, 28220, 28220, 28220, 28220, 28220, 28220, 28220, + 28220, 28220, 28220, 28220, 28220, 28220, 28220, 28220, 28220, 28220, + 28220, 28220, 28220, 28220, 28220, 28220, 28220, 28220, 28220, 28220, + 28220, 28220, 28220, 28220, 28220, 28220, 28220, 28220, 28220, 28220, + 28220, 28220, 28220, 28220, 28220, 28228, 28228, 28236, 28236, 28236, + 28236, 28236, 28236, 28236, 28236, 28236, 28236, 28236, 28236, 28236, + 28236, 28236, 28244, 28244, 28244, 28244, 28244, 28244, 28244, 28244, + 28244, 28244, 28244, 28244, 28244, 28244, 28244, 28244, 28244, 28244, + 28244, 28244, 28244, 28244, 28244, 28244, 28244, 28244, 28244, 28244, + 28244, 28244, 28244, 28244, 28244, 28244, 28244, 28244, 28244, 28244, + 28244, 28244, 28244, 28244, 28244, 28244, 28244, 28244, 28244, 28244, + 28244, 28244, 28244, 28244, 28244, 28244, 28244, 28244, 28244, 28244, + 28244, 28244, 28244, 28244, 28244, 28244, 28244, 28244, 28244, 28244, + 28244, 28244, 28244, 28244, 28244, 28244, 28244, 28244, 28244, 28244, + 28244, 28244, 28244, 28244, 28244, 28244, 28244}, + {28244, 28244, 28244, 28244, 28244, 28244, 28244, 28244, 28244, 28244, + 28244, 28244, 28244, 28244, 28244, 28244, 28244, 28244, 28244, 28244, + 28244, 28244, 28244, 28244, 28244, 28244, 28244, 28244, 28244, 28244, + 28244, 28244, 28244, 28244, 28244, 28244, 28244, 28244, 28244, 28244, + 28244, 28244, 28244, 28244, 28244, 28244, 28244, 28252, 28260, 28260, + 28260, 28260, 28260, 28260, 28260, 28260, 28260, 28260, 28260, 28260, + 28260, 28260, 28260, 28260, 28260, 28260, 28260, 28260, 28260, 28260, + 28260, 28260, 28260, 28260, 28260, 28260, 28260, 28260, 28260, 28260, + 28260, 28260, 28260, 28260, 28260, 28260, 28260, 28260, 28260, 28260, + 28260, 28260, 28260, 28260, 28260, 28260, 28260, 28260, 28260, 28260, + 28260, 28260, 28260, 28260, 28260, 28260, 28260, 28260, 28260, 28260, + 28260, 28260, 28260, 28260, 28260, 28260, 28260, 28260, 28260, 28260, + 28260, 28260, 28260, 28260, 28260, 28260, 28260, 28260, 28260, 28260, + 28260, 28260, 28260, 28260, 28260, 28260, 28260, 28260, 28260, 28260, + 28260, 28260, 28260, 28260, 28260, 28260, 28260, 28260, 28260, 28260, + 28260, 28260, 28260, 28260, 28260, 28260, 28260, 28260, 28260, 28260, + 28260, 28260, 28260, 28260, 28260, 28260, 28260, 28260, 28260, 28260, + 28260, 28260, 28260, 28260, 28260, 28260, 28260, 28260, 28260, 28260, + 28260, 28260, 28260, 28260, 28260, 28260, 28260, 28260, 28260, 28260, + 28260, 28260, 28260, 28260, 28260, 28260, 28260, 28260, 28260, 28260, + 28260, 28260, 28260, 28260, 28260, 28260, 28260, 28260, 28260, 28260, + 28260, 28260, 28260, 28260, 28260, 28260, 28260, 28260, 28260, 28260, + 28260, 28260, 28260, 28260, 28260, 28260, 28260, 28260, 28260, 28260, + 28260, 28260, 28260, 28260, 28260, 28260, 28260, 28260, 28260, 28260, + 28260, 28260, 28260, 28260, 28260, 28260, 28260, 28260, 28260, 28260, + 28260, 28260, 28260, 28260, 28260, 28260, 28260}, + {28260, 28260, 28260, 28260, 28260, 28260, 28260, 28260, 28260, 28260, + 28260, 28260, 28260, 28260, 28260, 28260, 28260, 28260, 28260, 28260, + 28260, 28260, 28260, 28260, 28260, 28260, 28260, 28260, 28260, 28260, + 28260, 28260, 28260, 28260, 28260, 28260, 28260, 28260, 28260, 28260, + 28260, 28260, 28260, 28260, 28260, 28260, 28260, 28260, 28260, 28260, + 28260, 28260, 28260, 28260, 28260, 28260, 28260, 28260, 28260, 28260, + 28260, 28260, 28260, 28260, 28260, 28260, 28260, 28260, 28260, 28260, + 28260, 28260, 28260, 28260, 28260, 28260, 28268, 28276, 28276, 28276, + 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, + 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, + 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, + 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, + 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, + 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, + 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, + 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, + 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, + 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, + 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, + 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, + 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, + 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, + 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, + 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, + 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, + 28276, 28276, 28276, 28276, 28276, 28276, 28276}, + {28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, + 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, + 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, + 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, + 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, + 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, + 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, + 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, + 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, + 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, + 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, + 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, + 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, + 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, + 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, + 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, + 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, + 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, + 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28276, 28284, 28292, + 28292, 28300, 28300, 28300, 28300, 28300, 28300, 28300, 28300, 28300, + 28300, 28300, 28300, 28300, 28300, 28300, 28300, 28300, 28300, 28300, + 28300, 28300, 28300, 28300, 28300, 28300, 28300, 28300, 28300, 28300, + 28300, 28300, 28300, 28300, 28300, 28300, 28300, 28300, 28300, 28300, + 28300, 28300, 28300, 28300, 28300, 28300, 28300, 28300, 28300, 28300, + 28300, 28300, 28300, 28300, 28300, 28300, 28300, 28300, 28300, 28300, + 28300, 28300, 28300, 28300, 28300, 28300, 28300}, + {28300, 28300, 28300, 28300, 28300, 28300, 28300, 28300, 28300, 28300, + 28300, 28300, 28300, 28300, 28300, 28300, 28300, 28300, 28300, 28300, + 28300, 28300, 28300, 28300, 28300, 28300, 28300, 28300, 28300, 28300, + 28300, 28300, 28300, 28300, 28300, 28300, 28300, 28300, 28300, 28300, + 28300, 28300, 28300, 28300, 28300, 28300, 28300, 28300, 28300, 28300, + 28300, 28300, 28300, 28300, 28300, 28300, 28300, 28300, 28300, 28300, + 28300, 28300, 28300, 28300, 28300, 28300, 28300, 28300, 28300, 28300, + 28300, 28300, 28300, 28300, 28300, 28300, 28300, 28300, 28300, 28300, + 28300, 28300, 28300, 28300, 28300, 28300, 28300, 28300, 28300, 28300, + 28300, 28300, 28300, 28300, 28300, 28300, 28300, 28300, 28300, 28300, + 28300, 28300, 28300, 28300, 28300, 28300, 28300, 28300, 28300, 28300, + 28300, 28300, 28300, 28300, 28300, 28300, 28300, 28300, 28300, 28300, + 28300, 28300, 28300, 28300, 28300, 28300, 28300, 28300, 28300, 28300, + 28300, 28300, 28300, 28300, 28300, 28300, 28300, 28300, 28300, 28300, + 28300, 28300, 28300, 28300, 28300, 28300, 28300, 28300, 28300, 28300, + 28300, 28300, 28300, 28300, 28300, 28300, 28300, 28300, 28300, 28300, + 28300, 28300, 28300, 28300, 28300, 28300, 28300, 28300, 28300, 28300, + 28300, 28300, 28300, 28300, 28300, 28300, 28300, 28300, 28300, 28300, + 28300, 28300, 28300, 28300, 28300, 28300, 28300, 28308, 28316, 28316, + 28316, 28316, 28316, 28316, 28316, 28316, 28316, 28316, 28316, 28316, + 28316, 28316, 28316, 28316, 28316, 28316, 28316, 28316, 28316, 28316, + 28316, 28316, 28316, 28316, 28316, 28316, 28316, 28316, 28316, 28316, + 28316, 28316, 28316, 28316, 28316, 28316, 28316, 28316, 28316, 28316, + 28316, 28316, 28316, 28316, 28316, 28316, 28316, 28316, 28316, 28316, + 28316, 28316, 28316, 28316, 28316, 28316, 28316, 28316, 28316, 28316, + 28316, 28316, 28316, 28316, 28316, 28316, 28316}, + {28316, 28316, 28316, 28316, 28316, 28316, 28316, 28316, 28316, 28316, + 28316, 28316, 28316, 28316, 28316, 28316, 28316, 28316, 28316, 28316, + 28316, 28316, 28316, 28316, 28316, 28316, 28316, 28316, 28316, 28316, + 28316, 28316, 28316, 28316, 28316, 28316, 28316, 28316, 28316, 28316, + 28316, 28316, 28316, 28316, 28316, 28316, 28316, 28316, 28316, 28316, + 28316, 28316, 28316, 28316, 28316, 28316, 28316, 28324, 28324, 28324, + 28324, 28324, 28324, 28324, 28324, 28324, 28324, 28324, 28324, 28324, + 28324, 28324, 28324, 28324, 28324, 28324, 28324, 28324, 28324, 28324, + 28324, 28324, 28324, 28324, 28324, 28324, 28324, 28324, 28324, 28324, + 28324, 28324, 28324, 28324, 28324, 28324, 28324, 28324, 28324, 28324, + 28324, 28324, 28324, 28324, 28324, 28324, 28324, 28324, 28324, 28324, + 28324, 28324, 28324, 28324, 28324, 28324, 28324, 28324, 28324, 28324, + 28324, 28324, 28324, 28324, 28324, 28324, 28324, 28324, 28324, 28324, + 28324, 28324, 28324, 28324, 28324, 28324, 28324, 28324, 28324, 28324, + 28324, 28324, 28324, 28324, 28324, 28324, 28324, 28324, 28324, 28324, + 28324, 28324, 28324, 28324, 28324, 28324, 28324, 28324, 28324, 28324, + 28324, 28324, 28324, 28324, 28324, 28324, 28324, 28324, 28324, 28324, + 28324, 28324, 28324, 28324, 28324, 28324, 28324, 28324, 28324, 28324, + 28324, 28324, 28324, 28324, 28324, 28324, 28324, 28324, 28324, 28324, + 28324, 28324, 28324, 28324, 28324, 28324, 28324, 28324, 28324, 28324, + 28324, 28324, 28324, 28324, 28324, 28324, 28324, 28324, 28324, 28324, + 28324, 28324, 28324, 28324, 28324, 28324, 28324, 28324, 28324, 28324, + 28324, 28324, 28324, 28324, 28324, 28324, 28324, 28324, 28324, 28324, + 28324, 28324, 28324, 28324, 28324, 28324, 28324, 28324, 28324, 28324, + 28324, 28324, 28324, 28324, 28324, 28324, 28324, 28324, 28324, 28324, + 28324, 28324, 28324, 28324, 28324, 28324, 28324}, + {28324, 28324, 28324, 28324, 28324, 28324, 28324, 28324, 28324, 28324, + 28324, 28324, 28324, 28324, 28324, 28324, 28324, 28324, 28324, 28324, + 28324, 28324, 28324, 28324, 28324, 28324, 28324, 28324, 28324, 28324, + 28324, 28324, 28324, 28324, 28324, 28324, 28324, 28324, 28324, 28324, + 28324, 28324, 28324, 28324, 28324, 28324, 28324, 28324, 28324, 28324, + 28324, 28324, 28324, 28324, 28324, 28324, 28324, 28324, 28324, 28324, + 28324, 28324, 28324, 28324, 28324, 28324, 28324, 28324, 28324, 28324, + 28324, 28324, 28324, 28324, 28324, 28324, 28324, 28324, 28324, 28324, + 28324, 28324, 28324, 28324, 28324, 28324, 28324, 28324, 28324, 28324, + 28324, 28324, 28324, 28324, 28324, 28332, 28340, 28352, 28364, 28376, + 28388, 28400, 28400, 28400, 28400, 28400, 28400, 28400, 28400, 28400, + 28400, 28400, 28400, 28400, 28400, 28400, 28400, 28400, 28400, 28400, + 28400, 28400, 28400, 28400, 28400, 28400, 28400, 28400, 28400, 28400, + 28400, 28400, 28400, 28400, 28400, 28400, 28400, 28400, 28400, 28400, + 28400, 28400, 28400, 28400, 28400, 28400, 28400, 28400, 28400, 28400, + 28400, 28400, 28400, 28400, 28400, 28400, 28400, 28400, 28400, 28400, + 28400, 28400, 28400, 28400, 28400, 28400, 28400, 28400, 28400, 28400, + 28400, 28400, 28400, 28400, 28400, 28400, 28400, 28400, 28400, 28400, + 28400, 28400, 28400, 28400, 28400, 28400, 28400, 28400, 28408, 28416, + 28428, 28440, 28452, 28464, 28464, 28464, 28464, 28464, 28464, 28464, + 28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, + 28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, + 28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, + 28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, + 28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, + 28464, 28464, 28464, 28464, 28464, 28464, 28464}, + {28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, + 28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, + 28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, + 28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, + 28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, + 28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, + 28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, + 28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, + 28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, + 28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, + 28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, + 28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, + 28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, + 28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, + 28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, + 28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, + 28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, + 28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, + 28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, + 28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, + 28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, + 28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, + 28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, + 28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, + 28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, 28464, + 28464, 28464, 28464, 28464, 28464, 28464, 28465}, + {28465, 28469, 28473, 28477, 28481, 28485, 28489, 28493, 28497, 28501, + 28505, 28509, 28513, 28517, 28521, 28525, 28529, 28533, 28537, 28541, + 28545, 28549, 28553, 28557, 28561, 28565, 28569, 28573, 28577, 28581, + 28585, 28589, 28593, 28597, 28601, 28605, 28609, 28613, 28617, 28621, + 28625, 28629, 28633, 28637, 28641, 28645, 28649, 28653, 28657, 28661, + 28665, 28669, 28673, 28677, 28681, 28685, 28689, 28693, 28697, 28701, + 28705, 28709, 28713, 28717, 28721, 28725, 28729, 28733, 28737, 28741, + 28745, 28749, 28753, 28757, 28761, 28765, 28769, 28773, 28777, 28781, + 28785, 28789, 28793, 28797, 28801, 28804, 28805, 28809, 28813, 28817, + 28821, 28825, 28829, 28833, 28837, 28841, 28845, 28849, 28853, 28857, + 28861, 28865, 28869, 28873, 28877, 28881, 28885, 28889, 28893, 28897, + 28901, 28905, 28909, 28913, 28917, 28921, 28925, 28929, 28933, 28937, + 28941, 28945, 28949, 28953, 28957, 28961, 28965, 28969, 28973, 28977, + 28981, 28985, 28989, 28993, 28997, 29001, 29005, 29009, 29013, 29017, + 29021, 29025, 29029, 29033, 29037, 29041, 29045, 29049, 29053, 29057, + 29061, 29065, 29069, 29073, 29077, 29081, 29085, 29088, 29089, 29093, + 29096, 29096, 29097, 29100, 29100, 29101, 29105, 29108, 29108, 29109, + 29113, 29117, 29121, 29124, 29125, 29129, 29133, 29137, 29141, 29145, + 29149, 29153, 29157, 29161, 29165, 29169, 29172, 29173, 29176, 29177, + 29181, 29185, 29189, 29193, 29197, 29201, 29204, 29205, 29209, 29213, + 29217, 29221, 29225, 29229, 29233, 29237, 29241, 29245, 29249, 29253, + 29257, 29261, 29265, 29269, 29273, 29277, 29281, 29285, 29289, 29293, + 29297, 29301, 29305, 29309, 29313, 29317, 29321, 29325, 29329, 29333, + 29337, 29341, 29345, 29349, 29353, 29357, 29361, 29365, 29369, 29373, + 29377, 29381, 29385, 29389, 29393, 29397, 29401, 29405, 29409, 29413, + 29417, 29421, 29425, 29429, 29433, 29437, 29441}, + {29441, 29445, 29449, 29453, 29457, 29461, 29464, 29465, 29469, 29473, + 29477, 29480, 29480, 29481, 29485, 29489, 29493, 29497, 29501, 29505, + 29509, 29512, 29513, 29517, 29521, 29525, 29529, 29533, 29537, 29540, + 29541, 29545, 29549, 29553, 29557, 29561, 29565, 29569, 29573, 29577, + 29581, 29585, 29589, 29593, 29597, 29601, 29605, 29609, 29613, 29617, + 29621, 29625, 29629, 29633, 29637, 29641, 29645, 29649, 29652, 29653, + 29657, 29661, 29665, 29668, 29669, 29673, 29677, 29681, 29685, 29688, + 29689, 29692, 29692, 29692, 29693, 29697, 29701, 29705, 29709, 29713, + 29717, 29720, 29721, 29725, 29729, 29733, 29737, 29741, 29745, 29749, + 29753, 29757, 29761, 29765, 29769, 29773, 29777, 29781, 29785, 29789, + 29793, 29797, 29801, 29805, 29809, 29813, 29817, 29821, 29825, 29829, + 29833, 29837, 29841, 29845, 29849, 29853, 29857, 29861, 29865, 29869, + 29873, 29877, 29881, 29885, 29889, 29893, 29897, 29901, 29905, 29909, + 29913, 29917, 29921, 29925, 29929, 29933, 29937, 29941, 29945, 29949, + 29953, 29957, 29961, 29965, 29969, 29973, 29977, 29981, 29985, 29989, + 29993, 29997, 30001, 30005, 30009, 30013, 30017, 30021, 30025, 30029, + 30033, 30037, 30041, 30045, 30049, 30053, 30057, 30061, 30065, 30069, + 30073, 30077, 30081, 30085, 30089, 30093, 30097, 30101, 30105, 30109, + 30113, 30117, 30121, 30125, 30129, 30133, 30137, 30141, 30145, 30149, + 30153, 30157, 30161, 30165, 30169, 30173, 30177, 30181, 30185, 30189, + 30193, 30197, 30201, 30205, 30209, 30213, 30217, 30221, 30225, 30229, + 30233, 30237, 30241, 30245, 30249, 30253, 30257, 30261, 30265, 30269, + 30273, 30277, 30281, 30285, 30289, 30293, 30297, 30301, 30305, 30309, + 30313, 30317, 30321, 30325, 30329, 30333, 30337, 30341, 30345, 30349, + 30353, 30357, 30361, 30365, 30369, 30373, 30377, 30381, 30385, 30389, + 30393, 30397, 30401, 30405, 30409, 30413, 30417}, + {30417, 30421, 30425, 30429, 30433, 30437, 30441, 30445, 30449, 30453, + 30457, 30461, 30465, 30469, 30473, 30477, 30481, 30485, 30489, 30493, + 30497, 30501, 30505, 30509, 30513, 30517, 30521, 30525, 30529, 30533, + 30537, 30541, 30545, 30549, 30553, 30557, 30561, 30565, 30569, 30573, + 30577, 30581, 30585, 30589, 30593, 30597, 30601, 30605, 30609, 30613, + 30617, 30621, 30625, 30629, 30633, 30637, 30641, 30645, 30649, 30653, + 30657, 30661, 30665, 30669, 30673, 30677, 30681, 30685, 30689, 30693, + 30697, 30701, 30705, 30709, 30713, 30717, 30721, 30725, 30729, 30733, + 30737, 30741, 30745, 30749, 30753, 30757, 30761, 30765, 30769, 30773, + 30777, 30781, 30785, 30789, 30793, 30797, 30801, 30805, 30809, 30813, + 30817, 30821, 30825, 30829, 30833, 30837, 30841, 30845, 30849, 30853, + 30857, 30861, 30865, 30869, 30873, 30877, 30881, 30885, 30889, 30893, + 30897, 30901, 30905, 30909, 30913, 30917, 30921, 30925, 30929, 30933, + 30937, 30941, 30945, 30949, 30953, 30957, 30961, 30965, 30969, 30973, + 30977, 30981, 30985, 30989, 30993, 30997, 31001, 31005, 31009, 31013, + 31017, 31021, 31025, 31029, 31033, 31037, 31041, 31045, 31049, 31053, + 31057, 31061, 31065, 31069, 31073, 31077, 31080, 31080, 31081, 31085, + 31089, 31093, 31097, 31101, 31105, 31109, 31113, 31117, 31121, 31125, + 31129, 31133, 31137, 31141, 31145, 31149, 31153, 31157, 31161, 31165, + 31169, 31173, 31177, 31181, 31185, 31189, 31193, 31197, 31201, 31205, + 31209, 31213, 31217, 31221, 31225, 31229, 31233, 31237, 31241, 31245, + 31249, 31253, 31257, 31261, 31265, 31269, 31273, 31277, 31281, 31285, + 31289, 31293, 31297, 31301, 31305, 31309, 31313, 31317, 31321, 31325, + 31329, 31333, 31337, 31341, 31345, 31349, 31353, 31357, 31361, 31365, + 31369, 31373, 31377, 31381, 31385, 31389, 31393, 31397, 31401, 31405, + 31409, 31413, 31417, 31421, 31425, 31429, 31433}, + {31433, 31437, 31441, 31445, 31449, 31453, 31457, 31461, 31465, 31469, + 31473, 31477, 31481, 31485, 31489, 31493, 31497, 31501, 31505, 31509, + 31513, 31517, 31521, 31525, 31529, 31533, 31537, 31541, 31545, 31549, + 31553, 31557, 31561, 31565, 31569, 31573, 31577, 31581, 31585, 31589, + 31593, 31597, 31601, 31605, 31609, 31613, 31617, 31621, 31625, 31629, + 31633, 31637, 31641, 31645, 31649, 31653, 31657, 31661, 31665, 31669, + 31673, 31677, 31681, 31685, 31689, 31693, 31697, 31701, 31705, 31709, + 31713, 31717, 31721, 31725, 31729, 31733, 31737, 31741, 31745, 31749, + 31753, 31757, 31761, 31765, 31769, 31773, 31777, 31781, 31785, 31789, + 31793, 31797, 31801, 31805, 31809, 31813, 31817, 31821, 31825, 31829, + 31833, 31837, 31841, 31845, 31849, 31853, 31857, 31861, 31865, 31869, + 31873, 31877, 31881, 31885, 31889, 31893, 31897, 31901, 31905, 31909, + 31913, 31917, 31921, 31925, 31929, 31933, 31937, 31941, 31945, 31949, + 31953, 31957, 31961, 31965, 31969, 31973, 31977, 31981, 31985, 31989, + 31993, 31997, 32001, 32005, 32009, 32013, 32017, 32021, 32025, 32029, + 32033, 32037, 32041, 32045, 32049, 32053, 32057, 32061, 32065, 32069, + 32073, 32077, 32081, 32085, 32089, 32093, 32097, 32101, 32105, 32109, + 32113, 32117, 32121, 32125, 32129, 32133, 32137, 32141, 32145, 32149, + 32153, 32157, 32161, 32165, 32169, 32173, 32177, 32181, 32185, 32189, + 32193, 32197, 32201, 32205, 32209, 32213, 32217, 32221, 32225, 32229, + 32233, 32237, 32241, 32245, 32248, 32248, 32249, 32253, 32257, 32261, + 32265, 32269, 32273, 32277, 32281, 32285, 32289, 32293, 32297, 32301, + 32305, 32309, 32313, 32317, 32321, 32325, 32329, 32333, 32337, 32341, + 32345, 32349, 32353, 32357, 32361, 32365, 32369, 32373, 32377, 32381, + 32385, 32389, 32393, 32397, 32401, 32405, 32409, 32413, 32417, 32421, + 32425, 32429, 32433, 32437, 32441, 32445, 32448}, + {32448, 32448, 32448, 32448, 32448, 32448, 32448, 32448, 32448, 32448, + 32448, 32448, 32448, 32448, 32448, 32448, 32448, 32448, 32448, 32448, + 32448, 32448, 32448, 32448, 32448, 32448, 32448, 32448, 32448, 32448, + 32448, 32448, 32448, 32448, 32448, 32448, 32448, 32448, 32448, 32448, + 32448, 32448, 32448, 32448, 32448, 32448, 32448, 32448, 32449, 32453, + 32457, 32461, 32465, 32469, 32473, 32477, 32481, 32485, 32489, 32493, + 32497, 32501, 32505, 32509, 32513, 32517, 32521, 32525, 32529, 32533, + 32537, 32541, 32545, 32549, 32553, 32557, 32561, 32565, 32569, 32573, + 32577, 32581, 32585, 32589, 32593, 32597, 32601, 32605, 32609, 32613, + 32617, 32621, 32625, 32629, 32633, 32637, 32641, 32645, 32649, 32653, + 32657, 32661, 32665, 32669, 32673, 32677, 32681, 32685, 32689, 32693, + 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, + 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, + 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, + 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, + 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, + 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, + 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, + 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, + 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, + 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, + 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, + 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, + 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, + 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, + 32696, 32696, 32696, 32696, 32696, 32696, 32696}, + {32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, + 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, + 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, + 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, + 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, + 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, + 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, + 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, + 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, + 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, + 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, + 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, + 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, + 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, + 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, + 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, + 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, + 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, + 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, + 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, + 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, + 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, + 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, + 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, + 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, 32696, + 32696, 32696, 32696, 32696, 32696, 32696, 32697}, + {32697, 32701, 32705, 32709, 32712, 32713, 32717, 32721, 32725, 32729, + 32733, 32737, 32741, 32745, 32749, 32753, 32757, 32761, 32765, 32769, + 32773, 32777, 32781, 32785, 32789, 32793, 32797, 32801, 32805, 32809, + 32813, 32817, 32820, 32821, 32825, 32828, 32829, 32832, 32832, 32833, + 32836, 32837, 32841, 32845, 32849, 32853, 32857, 32861, 32865, 32869, + 32873, 32876, 32877, 32881, 32885, 32889, 32892, 32893, 32896, 32897, + 32900, 32900, 32900, 32900, 32900, 32900, 32901, 32904, 32904, 32904, + 32904, 32905, 32908, 32909, 32912, 32913, 32916, 32917, 32921, 32925, + 32928, 32929, 32933, 32936, 32937, 32940, 32940, 32941, 32944, 32945, + 32948, 32949, 32952, 32953, 32956, 32957, 32960, 32961, 32965, 32968, + 32969, 32972, 32972, 32973, 32977, 32981, 32985, 32988, 32989, 32993, + 32997, 33001, 33005, 33009, 33013, 33016, 33017, 33021, 33025, 33029, + 33032, 33033, 33037, 33041, 33045, 33048, 33049, 33052, 33053, 33057, + 33061, 33065, 33069, 33073, 33077, 33081, 33085, 33089, 33092, 33093, + 33097, 33101, 33105, 33109, 33113, 33117, 33121, 33125, 33129, 33133, + 33137, 33141, 33145, 33149, 33153, 33157, 33160, 33160, 33160, 33160, + 33160, 33161, 33165, 33169, 33172, 33173, 33177, 33181, 33185, 33189, + 33192, 33193, 33197, 33201, 33205, 33209, 33213, 33217, 33221, 33225, + 33229, 33233, 33237, 33241, 33245, 33249, 33253, 33257, 33260, 33260, + 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, + 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, + 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, + 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, + 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, + 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, + 33260, 33260, 33260, 33260, 33260, 33260, 33260}, + {33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, + 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, + 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, + 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, + 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, + 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, + 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, + 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, + 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, + 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, + 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, + 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, + 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, + 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, + 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, + 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, + 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, + 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, + 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, + 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, + 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, + 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, + 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, + 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, + 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, 33260, + 33260, 33260, 33260, 33260, 33260, 33260, 33261}, + {33261, 33269, 33277, 33285, 33293, 33301, 33309, 33317, 33325, 33333, + 33341, 33348, 33348, 33348, 33348, 33348, 33349, 33361, 33373, 33385, + 33397, 33409, 33421, 33433, 33445, 33457, 33469, 33481, 33493, 33505, + 33517, 33529, 33541, 33553, 33565, 33577, 33589, 33601, 33613, 33625, + 33637, 33649, 33661, 33673, 33677, 33681, 33689, 33696, 33697, 33701, + 33705, 33709, 33713, 33717, 33721, 33725, 33729, 33733, 33737, 33741, + 33745, 33749, 33753, 33757, 33761, 33765, 33769, 33773, 33777, 33781, + 33785, 33789, 33793, 33797, 33801, 33809, 33817, 33825, 33833, 33845, + 33852, 33852, 33852, 33852, 33852, 33852, 33852, 33852, 33852, 33852, + 33852, 33852, 33852, 33852, 33852, 33852, 33852, 33852, 33852, 33852, + 33852, 33852, 33852, 33852, 33852, 33852, 33853, 33861, 33869, 33876, + 33876, 33876, 33876, 33876, 33876, 33876, 33876, 33876, 33876, 33876, + 33876, 33876, 33876, 33876, 33876, 33876, 33876, 33876, 33876, 33876, + 33876, 33876, 33876, 33876, 33876, 33876, 33876, 33876, 33876, 33876, + 33876, 33876, 33876, 33876, 33877, 33884, 33884, 33884, 33884, 33884, + 33884, 33884, 33884, 33884, 33884, 33884, 33884, 33884, 33884, 33884, + 33884, 33884, 33884, 33884, 33884, 33884, 33884, 33884, 33884, 33884, + 33884, 33884, 33884, 33884, 33884, 33884, 33884, 33884, 33884, 33884, + 33884, 33884, 33884, 33884, 33884, 33884, 33884, 33884, 33884, 33884, + 33884, 33884, 33884, 33884, 33884, 33884, 33884, 33884, 33884, 33884, + 33884, 33884, 33884, 33884, 33884, 33884, 33884, 33884, 33884, 33884, + 33884, 33884, 33884, 33884, 33884, 33884, 33884, 33884, 33884, 33884, + 33884, 33884, 33884, 33884, 33884, 33884, 33884, 33884, 33884, 33884, + 33884, 33884, 33884, 33884, 33884, 33884, 33884, 33884, 33884, 33884, + 33884, 33884, 33884, 33884, 33884, 33884, 33884, 33884, 33884, 33884, + 33884, 33884, 33884, 33884, 33884, 33884, 33885}, + {33885, 33893, 33901, 33904, 33904, 33904, 33904, 33904, 33904, 33904, + 33904, 33904, 33904, 33904, 33904, 33904, 33905, 33909, 33913, 33917, + 33925, 33929, 33933, 33937, 33941, 33945, 33949, 33953, 33957, 33961, + 33965, 33969, 33973, 33977, 33981, 33985, 33989, 33993, 33997, 34001, + 34005, 34009, 34013, 34017, 34021, 34025, 34029, 34033, 34037, 34041, + 34045, 34049, 34053, 34057, 34061, 34065, 34069, 34073, 34077, 34081, + 34084, 34084, 34084, 34084, 34085, 34097, 34109, 34121, 34133, 34145, + 34157, 34169, 34181, 34192, 34192, 34192, 34192, 34192, 34192, 34192, + 34193, 34197, 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, + 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, + 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, + 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, + 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, + 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, + 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, + 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, + 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, + 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, + 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, + 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, + 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, + 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, + 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, + 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, + 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, + 34200, 34200, 34200, 34200, 34200, 34200, 34200}, + {34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, + 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, + 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, + 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, + 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, + 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, + 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, + 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, + 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, + 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, + 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, + 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, + 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, + 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, + 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, + 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, + 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, + 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, + 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, + 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, + 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, + 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, + 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, + 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, 34200, + 34201, 34205, 34209, 34213, 34217, 34221, 34225, 34229, 34233, 34237, + 34240, 34240, 34240, 34240, 34240, 34240, 34240}, + {34240, 34244, 34248, 34252, 34256, 34260, 34264, 34268, 34272, 34276, + 34280, 34284, 34288, 34292, 34296, 34300, 34304, 34308, 34312, 34316, + 34320, 34324, 34328, 34332, 34336, 34340, 34344, 34348, 34352, 34356, + 34360, 34364, 34368, 34372, 34376, 34380, 34384, 34388, 34392, 34396, + 34400, 34404, 34408, 34412, 34416, 34420, 34424, 34428, 34432, 34436, + 34440, 34444, 34448, 34452, 34456, 34460, 34464, 34468, 34472, 34476, + 34480, 34484, 34488, 34492, 34496, 34500, 34504, 34508, 34512, 34516, + 34520, 34524, 34528, 34532, 34536, 34540, 34544, 34548, 34552, 34556, + 34560, 34564, 34568, 34572, 34576, 34580, 34584, 34588, 34592, 34596, + 34600, 34604, 34608, 34612, 34616, 34620, 34624, 34628, 34632, 34636, + 34640, 34644, 34648, 34652, 34656, 34660, 34664, 34668, 34672, 34676, + 34680, 34684, 34688, 34692, 34696, 34700, 34704, 34708, 34712, 34716, + 34720, 34724, 34728, 34732, 34736, 34740, 34744, 34748, 34752, 34756, + 34760, 34764, 34768, 34772, 34776, 34780, 34784, 34788, 34792, 34796, + 34800, 34804, 34808, 34812, 34816, 34820, 34824, 34828, 34832, 34836, + 34840, 34844, 34848, 34852, 34856, 34860, 34864, 34868, 34872, 34876, + 34880, 34884, 34888, 34892, 34896, 34900, 34904, 34908, 34912, 34916, + 34920, 34924, 34928, 34932, 34936, 34940, 34944, 34948, 34952, 34956, + 34960, 34964, 34968, 34972, 34976, 34980, 34984, 34988, 34992, 34996, + 35000, 35004, 35008, 35012, 35016, 35020, 35024, 35028, 35032, 35036, + 35040, 35044, 35048, 35052, 35056, 35060, 35064, 35068, 35072, 35076, + 35080, 35084, 35088, 35092, 35096, 35100, 35104, 35108, 35112, 35116, + 35120, 35124, 35128, 35132, 35136, 35140, 35144, 35148, 35152, 35156, + 35160, 35164, 35168, 35172, 35176, 35180, 35184, 35188, 35192, 35196, + 35200, 35204, 35208, 35212, 35216, 35220, 35224, 35228, 35232, 35236, + 35240, 35244, 35248, 35252, 35256, 35260, 35264}, + {35264, 35268, 35272, 35276, 35280, 35284, 35288, 35292, 35296, 35300, + 35304, 35308, 35312, 35316, 35320, 35324, 35328, 35332, 35336, 35340, + 35344, 35348, 35352, 35356, 35360, 35364, 35368, 35372, 35376, 35380, + 35384, 35388, 35392, 35396, 35400, 35404, 35408, 35412, 35416, 35420, + 35424, 35428, 35432, 35436, 35440, 35444, 35448, 35452, 35456, 35460, + 35464, 35468, 35472, 35476, 35480, 35484, 35488, 35492, 35496, 35500, + 35504, 35508, 35512, 35516, 35520, 35524, 35528, 35532, 35536, 35540, + 35544, 35548, 35552, 35556, 35560, 35564, 35568, 35572, 35576, 35580, + 35584, 35588, 35592, 35596, 35600, 35604, 35608, 35612, 35616, 35620, + 35624, 35628, 35632, 35636, 35640, 35644, 35648, 35652, 35656, 35660, + 35664, 35668, 35672, 35676, 35680, 35684, 35688, 35692, 35696, 35700, + 35704, 35708, 35712, 35716, 35720, 35724, 35728, 35732, 35736, 35740, + 35744, 35748, 35752, 35756, 35760, 35764, 35768, 35772, 35776, 35780, + 35784, 35788, 35792, 35796, 35800, 35804, 35808, 35812, 35816, 35820, + 35824, 35828, 35832, 35836, 35840, 35844, 35848, 35852, 35856, 35860, + 35864, 35868, 35872, 35876, 35880, 35884, 35888, 35892, 35896, 35900, + 35904, 35908, 35912, 35916, 35920, 35924, 35928, 35932, 35936, 35940, + 35944, 35948, 35952, 35956, 35960, 35964, 35968, 35972, 35976, 35980, + 35984, 35988, 35992, 35996, 36000, 36004, 36008, 36012, 36016, 36020, + 36024, 36028, 36032, 36036, 36040, 36044, 36048, 36052, 36056, 36060, + 36064, 36068, 36072, 36076, 36080, 36084, 36088, 36092, 36096, 36100, + 36104, 36108, 36112, 36116, 36120, 36124, 36128, 36132, 36136, 36140, + 36144, 36148, 36152, 36156, 36160, 36164, 36168, 36172, 36176, 36180, + 36184, 36188, 36192, 36196, 36200, 36204, 36208, 36212, 36216, 36220, + 36224, 36228, 36232, 36236, 36240, 36244, 36248, 36252, 36256, 36260, + 36264, 36268, 36272, 36276, 36280, 36284, 36288}, + {36288, 36292, 36296, 36300, 36304, 36308, 36312, 36316, 36320, 36324, + 36328, 36332, 36336, 36340, 36344, 36348, 36352, 36356, 36360, 36364, + 36368, 36372, 36376, 36380, 36384, 36388, 36392, 36396, 36400, 36404, + 36408, 36408, 36408, 36408, 36408, 36408, 36408, 36408, 36408, 36408, + 36408, 36408, 36408, 36408, 36408, 36408, 36408, 36408, 36408, 36408, + 36408, 36408, 36408, 36408, 36408, 36408, 36408, 36408, 36408, 36408, + 36408, 36408, 36408, 36408, 36408, 36408, 36408, 36408, 36408, 36408, + 36408, 36408, 36408, 36408, 36408, 36408, 36408, 36408, 36408, 36408, + 36408, 36408, 36408, 36408, 36408, 36408, 36408, 36408, 36408, 36408, + 36408, 36408, 36408, 36408, 36408, 36408, 36408, 36408, 36408, 36408, + 36408, 36408, 36408, 36408, 36408, 36408, 36408, 36408, 36408, 36408, + 36408, 36408, 36408, 36408, 36408, 36408, 36408, 36408, 36408, 36408, + 36408, 36408, 36408, 36408, 36408, 36408, 36408, 36408, 36408, 36408, + 36408, 36408, 36408, 36408, 36408, 36408, 36408, 36408, 36408, 36408, + 36408, 36408, 36408, 36408, 36408, 36408, 36408, 36408, 36408, 36408, + 36408, 36408, 36408, 36408, 36408, 36408, 36408, 36408, 36408, 36408, + 36408, 36408, 36408, 36408, 36408, 36408, 36408, 36408, 36408, 36408, + 36408, 36408, 36408, 36408, 36408, 36408, 36408, 36408, 36408, 36408, + 36408, 36408, 36408, 36408, 36408, 36408, 36408, 36408, 36408, 36408, + 36408, 36408, 36408, 36408, 36408, 36408, 36408, 36408, 36408, 36408, + 36408, 36408, 36408, 36408, 36408, 36408, 36408, 36408, 36408, 36408, + 36408, 36408, 36408, 36408, 36408, 36408, 36408, 36408, 36408, 36408, + 36408, 36408, 36408, 36408, 36408, 36408, 36408, 36408, 36408, 36408, + 36408, 36408, 36408, 36408, 36408, 36408, 36408, 36408, 36408, 36408, + 36408, 36408, 36408, 36408, 36408, 36408, 36408, 36408, 36408, 36408, + 36408, 36408, 36408, 36408, 36408, 36408, 36408}}; +const char32_t uninorms::decomposition_data[] = { + 0, 32, 32, 776, 97, 32, 772, 50, 51, + 32, 769, 956, 32, 807, 49, 111, 49, 8260, + 52, 49, 8260, 50, 51, 8260, 52, 65, 768, + 65, 769, 65, 770, 65, 771, 65, 776, 65, + 778, 67, 807, 69, 768, 69, 769, 69, 770, + 69, 776, 73, 768, 73, 769, 73, 770, 73, + 776, 78, 771, 79, 768, 79, 769, 79, 770, + 79, 771, 79, 776, 85, 768, 85, 769, 85, + 770, 85, 776, 89, 769, 97, 768, 97, 769, + 97, 770, 97, 771, 97, 776, 97, 778, 99, + 807, 101, 768, 101, 769, 101, 770, 101, 776, + 105, 768, 105, 769, 105, 770, 105, 776, 110, + 771, 111, 768, 111, 769, 111, 770, 111, 771, + 111, 776, 117, 768, 117, 769, 117, 770, 117, + 776, 121, 769, 121, 776, 65, 772, 97, 772, + 65, 774, 97, 774, 65, 808, 97, 808, 67, + 769, 99, 769, 67, 770, 99, 770, 67, 775, + 99, 775, 67, 780, 99, 780, 68, 780, 100, + 780, 69, 772, 101, 772, 69, 774, 101, 774, + 69, 775, 101, 775, 69, 808, 101, 808, 69, + 780, 101, 780, 71, 770, 103, 770, 71, 774, + 103, 774, 71, 775, 103, 775, 71, 807, 103, + 807, 72, 770, 104, 770, 73, 771, 105, 771, + 73, 772, 105, 772, 73, 774, 105, 774, 73, + 808, 105, 808, 73, 775, 73, 74, 105, 106, + 74, 770, 106, 770, 75, 807, 107, 807, 76, + 769, 108, 769, 76, 807, 108, 807, 76, 780, + 108, 780, 76, 183, 108, 183, 78, 769, 110, + 769, 78, 807, 110, 807, 78, 780, 110, 780, + 700, 110, 79, 772, 111, 772, 79, 774, 111, + 774, 79, 779, 111, 779, 82, 769, 114, 769, + 82, 807, 114, 807, 82, 780, 114, 780, 83, + 769, 115, 769, 83, 770, 115, 770, 83, 807, + 115, 807, 83, 780, 115, 780, 84, 807, 116, + 807, 84, 780, 116, 780, 85, 771, 117, 771, + 85, 772, 117, 772, 85, 774, 117, 774, 85, + 778, 117, 778, 85, 779, 117, 779, 85, 808, + 117, 808, 87, 770, 119, 770, 89, 770, 121, + 770, 89, 776, 90, 769, 122, 769, 90, 775, + 122, 775, 90, 780, 122, 780, 115, 79, 795, + 111, 795, 85, 795, 117, 795, 68, 90, 780, + 68, 122, 780, 100, 122, 780, 76, 74, 76, + 106, 108, 106, 78, 74, 78, 106, 110, 106, + 65, 780, 97, 780, 73, 780, 105, 780, 79, + 780, 111, 780, 85, 780, 117, 780, 85, 776, + 772, 117, 776, 772, 85, 776, 769, 117, 776, + 769, 85, 776, 780, 117, 776, 780, 85, 776, + 768, 117, 776, 768, 65, 776, 772, 97, 776, + 772, 65, 775, 772, 97, 775, 772, 198, 772, + 230, 772, 71, 780, 103, 780, 75, 780, 107, + 780, 79, 808, 111, 808, 79, 808, 772, 111, + 808, 772, 439, 780, 658, 780, 106, 780, 68, + 90, 68, 122, 100, 122, 71, 769, 103, 769, + 78, 768, 110, 768, 65, 778, 769, 97, 778, + 769, 198, 769, 230, 769, 216, 769, 248, 769, + 65, 783, 97, 783, 65, 785, 97, 785, 69, + 783, 101, 783, 69, 785, 101, 785, 73, 783, + 105, 783, 73, 785, 105, 785, 79, 783, 111, + 783, 79, 785, 111, 785, 82, 783, 114, 783, + 82, 785, 114, 785, 85, 783, 117, 783, 85, + 785, 117, 785, 83, 806, 115, 806, 84, 806, + 116, 806, 72, 780, 104, 780, 65, 775, 97, + 775, 69, 807, 101, 807, 79, 776, 772, 111, + 776, 772, 79, 771, 772, 111, 771, 772, 79, + 775, 111, 775, 79, 775, 772, 111, 775, 772, + 89, 772, 121, 772, 104, 614, 106, 114, 633, + 635, 641, 119, 121, 32, 774, 32, 775, 32, + 778, 32, 808, 32, 771, 32, 779, 611, 108, + 115, 120, 661, 768, 769, 787, 776, 769, 697, + 32, 837, 59, 32, 769, 168, 769, 913, 769, + 183, 917, 769, 919, 769, 921, 769, 927, 769, + 933, 769, 937, 769, 953, 776, 769, 921, 776, + 933, 776, 945, 769, 949, 769, 951, 769, 953, + 769, 965, 776, 769, 953, 776, 965, 776, 959, + 769, 965, 769, 969, 769, 946, 952, 933, 978, + 769, 978, 776, 966, 960, 954, 961, 962, 920, + 949, 931, 1045, 768, 1045, 776, 1043, 769, 1030, + 776, 1050, 769, 1048, 768, 1059, 774, 1048, 774, + 1080, 774, 1077, 768, 1077, 776, 1075, 769, 1110, + 776, 1082, 769, 1080, 768, 1091, 774, 1140, 783, + 1141, 783, 1046, 774, 1078, 774, 1040, 774, 1072, + 774, 1040, 776, 1072, 776, 1045, 774, 1077, 774, + 1240, 776, 1241, 776, 1046, 776, 1078, 776, 1047, + 776, 1079, 776, 1048, 772, 1080, 772, 1048, 776, + 1080, 776, 1054, 776, 1086, 776, 1256, 776, 1257, + 776, 1069, 776, 1101, 776, 1059, 772, 1091, 772, + 1059, 776, 1091, 776, 1059, 779, 1091, 779, 1063, + 776, 1095, 776, 1067, 776, 1099, 776, 1381, 1410, + 1575, 1619, 1575, 1620, 1608, 1620, 1575, 1621, 1610, + 1620, 1575, 1652, 1608, 1652, 1735, 1652, 1610, 1652, + 1749, 1620, 1729, 1620, 1746, 1620, 2344, 2364, 2352, + 2364, 2355, 2364, 2325, 2364, 2326, 2364, 2327, 2364, + 2332, 2364, 2337, 2364, 2338, 2364, 2347, 2364, 2351, + 2364, 2503, 2494, 2503, 2519, 2465, 2492, 2466, 2492, + 2479, 2492, 2610, 2620, 2616, 2620, 2582, 2620, 2583, + 2620, 2588, 2620, 2603, 2620, 2887, 2902, 2887, 2878, + 2887, 2903, 2849, 2876, 2850, 2876, 2962, 3031, 3014, + 3006, 3015, 3006, 3014, 3031, 3142, 3158, 3263, 3285, + 3270, 3285, 3270, 3286, 3270, 3266, 3270, 3266, 3285, + 3398, 3390, 3399, 3390, 3398, 3415, 3545, 3530, 3545, + 3535, 3545, 3535, 3530, 3545, 3551, 3661, 3634, 3789, + 3762, 3755, 3737, 3755, 3745, 3851, 3906, 4023, 3916, + 4023, 3921, 4023, 3926, 4023, 3931, 4023, 3904, 4021, + 3953, 3954, 3953, 3956, 4018, 3968, 4018, 3953, 3968, + 4019, 3968, 4019, 3953, 3968, 3953, 3968, 3986, 4023, + 3996, 4023, 4001, 4023, 4006, 4023, 4011, 4023, 3984, + 4021, 4133, 4142, 4316, 6917, 6965, 6919, 6965, 6921, + 6965, 6923, 6965, 6925, 6965, 6929, 6965, 6970, 6965, + 6972, 6965, 6974, 6965, 6975, 6965, 6978, 6965, 65, + 198, 66, 68, 69, 398, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 546, 80, 82, 84, + 85, 87, 97, 592, 593, 7426, 98, 100, 101, + 601, 603, 604, 103, 107, 109, 331, 111, 596, + 7446, 7447, 112, 116, 117, 7453, 623, 118, 7461, + 946, 947, 948, 966, 967, 105, 114, 117, 118, + 946, 947, 961, 966, 967, 1085, 594, 99, 597, + 240, 604, 102, 607, 609, 613, 616, 617, 618, + 7547, 669, 621, 7557, 671, 625, 624, 626, 627, + 628, 629, 632, 642, 643, 427, 649, 650, 7452, + 651, 652, 122, 656, 657, 658, 952, 65, 805, + 97, 805, 66, 775, 98, 775, 66, 803, 98, + 803, 66, 817, 98, 817, 67, 807, 769, 99, + 807, 769, 68, 775, 100, 775, 68, 803, 100, + 803, 68, 817, 100, 817, 68, 807, 100, 807, + 68, 813, 100, 813, 69, 772, 768, 101, 772, + 768, 69, 772, 769, 101, 772, 769, 69, 813, + 101, 813, 69, 816, 101, 816, 69, 807, 774, + 101, 807, 774, 70, 775, 102, 775, 71, 772, + 103, 772, 72, 775, 104, 775, 72, 803, 104, + 803, 72, 776, 104, 776, 72, 807, 104, 807, + 72, 814, 104, 814, 73, 816, 105, 816, 73, + 776, 769, 105, 776, 769, 75, 769, 107, 769, + 75, 803, 107, 803, 75, 817, 107, 817, 76, + 803, 108, 803, 76, 803, 772, 108, 803, 772, + 76, 817, 108, 817, 76, 813, 108, 813, 77, + 769, 109, 769, 77, 775, 109, 775, 77, 803, + 109, 803, 78, 775, 110, 775, 78, 803, 110, + 803, 78, 817, 110, 817, 78, 813, 110, 813, + 79, 771, 769, 111, 771, 769, 79, 771, 776, + 111, 771, 776, 79, 772, 768, 111, 772, 768, + 79, 772, 769, 111, 772, 769, 80, 769, 112, + 769, 80, 775, 112, 775, 82, 775, 114, 775, + 82, 803, 114, 803, 82, 803, 772, 114, 803, + 772, 82, 817, 114, 817, 83, 775, 115, 775, + 83, 803, 115, 803, 83, 769, 775, 115, 769, + 775, 83, 780, 775, 115, 780, 775, 83, 803, + 775, 115, 803, 775, 84, 775, 116, 775, 84, + 803, 116, 803, 84, 817, 116, 817, 84, 813, + 116, 813, 85, 804, 117, 804, 85, 816, 117, + 816, 85, 813, 117, 813, 85, 771, 769, 117, + 771, 769, 85, 772, 776, 117, 772, 776, 86, + 771, 118, 771, 86, 803, 118, 803, 87, 768, + 119, 768, 87, 769, 119, 769, 87, 776, 119, + 776, 87, 775, 119, 775, 87, 803, 119, 803, + 88, 775, 120, 775, 88, 776, 120, 776, 89, + 775, 121, 775, 90, 770, 122, 770, 90, 803, + 122, 803, 90, 817, 122, 817, 104, 817, 116, + 776, 119, 778, 121, 778, 97, 702, 383, 775, + 65, 803, 97, 803, 65, 777, 97, 777, 65, + 770, 769, 97, 770, 769, 65, 770, 768, 97, + 770, 768, 65, 770, 777, 97, 770, 777, 65, + 770, 771, 97, 770, 771, 65, 803, 770, 97, + 803, 770, 65, 774, 769, 97, 774, 769, 65, + 774, 768, 97, 774, 768, 65, 774, 777, 97, + 774, 777, 65, 774, 771, 97, 774, 771, 65, + 803, 774, 97, 803, 774, 69, 803, 101, 803, + 69, 777, 101, 777, 69, 771, 101, 771, 69, + 770, 769, 101, 770, 769, 69, 770, 768, 101, + 770, 768, 69, 770, 777, 101, 770, 777, 69, + 770, 771, 101, 770, 771, 69, 803, 770, 101, + 803, 770, 73, 777, 105, 777, 73, 803, 105, + 803, 79, 803, 111, 803, 79, 777, 111, 777, + 79, 770, 769, 111, 770, 769, 79, 770, 768, + 111, 770, 768, 79, 770, 777, 111, 770, 777, + 79, 770, 771, 111, 770, 771, 79, 803, 770, + 111, 803, 770, 79, 795, 769, 111, 795, 769, + 79, 795, 768, 111, 795, 768, 79, 795, 777, + 111, 795, 777, 79, 795, 771, 111, 795, 771, + 79, 795, 803, 111, 795, 803, 85, 803, 117, + 803, 85, 777, 117, 777, 85, 795, 769, 117, + 795, 769, 85, 795, 768, 117, 795, 768, 85, + 795, 777, 117, 795, 777, 85, 795, 771, 117, + 795, 771, 85, 795, 803, 117, 795, 803, 89, + 768, 121, 768, 89, 803, 121, 803, 89, 777, + 121, 777, 89, 771, 121, 771, 945, 787, 945, + 788, 945, 787, 768, 945, 788, 768, 945, 787, + 769, 945, 788, 769, 945, 787, 834, 945, 788, + 834, 913, 787, 913, 788, 913, 787, 768, 913, + 788, 768, 913, 787, 769, 913, 788, 769, 913, + 787, 834, 913, 788, 834, 949, 787, 949, 788, + 949, 787, 768, 949, 788, 768, 949, 787, 769, + 949, 788, 769, 917, 787, 917, 788, 917, 787, + 768, 917, 788, 768, 917, 787, 769, 917, 788, + 769, 951, 787, 951, 788, 951, 787, 768, 951, + 788, 768, 951, 787, 769, 951, 788, 769, 951, + 787, 834, 951, 788, 834, 919, 787, 919, 788, + 919, 787, 768, 919, 788, 768, 919, 787, 769, + 919, 788, 769, 919, 787, 834, 919, 788, 834, + 953, 787, 953, 788, 953, 787, 768, 953, 788, + 768, 953, 787, 769, 953, 788, 769, 953, 787, + 834, 953, 788, 834, 921, 787, 921, 788, 921, + 787, 768, 921, 788, 768, 921, 787, 769, 921, + 788, 769, 921, 787, 834, 921, 788, 834, 959, + 787, 959, 788, 959, 787, 768, 959, 788, 768, + 959, 787, 769, 959, 788, 769, 927, 787, 927, + 788, 927, 787, 768, 927, 788, 768, 927, 787, + 769, 927, 788, 769, 965, 787, 965, 788, 965, + 787, 768, 965, 788, 768, 965, 787, 769, 965, + 788, 769, 965, 787, 834, 965, 788, 834, 933, + 788, 933, 788, 768, 933, 788, 769, 933, 788, + 834, 969, 787, 969, 788, 969, 787, 768, 969, + 788, 768, 969, 787, 769, 969, 788, 769, 969, + 787, 834, 969, 788, 834, 937, 787, 937, 788, + 937, 787, 768, 937, 788, 768, 937, 787, 769, + 937, 788, 769, 937, 787, 834, 937, 788, 834, + 945, 768, 945, 769, 949, 768, 949, 769, 951, + 768, 951, 769, 953, 768, 953, 769, 959, 768, + 959, 769, 965, 768, 965, 769, 969, 768, 969, + 769, 945, 787, 837, 945, 788, 837, 945, 787, + 768, 837, 945, 788, 768, 837, 945, 787, 769, + 837, 945, 788, 769, 837, 945, 787, 834, 837, + 945, 788, 834, 837, 913, 787, 837, 913, 788, + 837, 913, 787, 768, 837, 913, 788, 768, 837, + 913, 787, 769, 837, 913, 788, 769, 837, 913, + 787, 834, 837, 913, 788, 834, 837, 951, 787, + 837, 951, 788, 837, 951, 787, 768, 837, 951, + 788, 768, 837, 951, 787, 769, 837, 951, 788, + 769, 837, 951, 787, 834, 837, 951, 788, 834, + 837, 919, 787, 837, 919, 788, 837, 919, 787, + 768, 837, 919, 788, 768, 837, 919, 787, 769, + 837, 919, 788, 769, 837, 919, 787, 834, 837, + 919, 788, 834, 837, 969, 787, 837, 969, 788, + 837, 969, 787, 768, 837, 969, 788, 768, 837, + 969, 787, 769, 837, 969, 788, 769, 837, 969, + 787, 834, 837, 969, 788, 834, 837, 937, 787, + 837, 937, 788, 837, 937, 787, 768, 837, 937, + 788, 768, 837, 937, 787, 769, 837, 937, 788, + 769, 837, 937, 787, 834, 837, 937, 788, 834, + 837, 945, 774, 945, 772, 945, 768, 837, 945, + 837, 945, 769, 837, 945, 834, 945, 834, 837, + 913, 774, 913, 772, 913, 768, 913, 769, 913, + 837, 32, 787, 953, 32, 787, 32, 834, 168, + 834, 951, 768, 837, 951, 837, 951, 769, 837, + 951, 834, 951, 834, 837, 917, 768, 917, 769, + 919, 768, 919, 769, 919, 837, 8127, 768, 8127, + 769, 8127, 834, 953, 774, 953, 772, 953, 776, + 768, 953, 776, 769, 953, 834, 953, 776, 834, + 921, 774, 921, 772, 921, 768, 921, 769, 8190, + 768, 8190, 769, 8190, 834, 965, 774, 965, 772, + 965, 776, 768, 965, 776, 769, 961, 787, 961, + 788, 965, 834, 965, 776, 834, 933, 774, 933, + 772, 933, 768, 933, 769, 929, 788, 168, 768, + 168, 769, 96, 969, 768, 837, 969, 837, 969, + 769, 837, 969, 834, 969, 834, 837, 927, 768, + 927, 769, 937, 768, 937, 769, 937, 837, 180, + 32, 788, 8194, 8195, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 8208, 32, 819, 46, 46, + 46, 46, 46, 46, 32, 8242, 8242, 8242, 8242, + 8242, 8245, 8245, 8245, 8245, 8245, 33, 33, 32, + 773, 63, 63, 63, 33, 33, 63, 8242, 8242, + 8242, 8242, 32, 48, 105, 52, 53, 54, 55, + 56, 57, 43, 8722, 61, 40, 41, 110, 48, + 49, 50, 51, 52, 53, 54, 55, 56, 57, + 43, 8722, 61, 40, 41, 97, 101, 111, 120, + 601, 104, 107, 108, 109, 110, 112, 115, 116, + 82, 115, 97, 47, 99, 97, 47, 115, 67, + 176, 67, 99, 47, 111, 99, 47, 117, 400, + 176, 70, 103, 72, 72, 72, 104, 295, 73, + 73, 76, 108, 78, 78, 111, 80, 81, 82, + 82, 82, 83, 77, 84, 69, 76, 84, 77, + 90, 937, 90, 75, 65, 778, 66, 67, 101, + 69, 70, 77, 111, 1488, 1489, 1490, 1491, 105, + 70, 65, 88, 960, 947, 915, 928, 8721, 68, + 100, 101, 105, 106, 49, 8260, 55, 49, 8260, + 57, 49, 8260, 49, 48, 49, 8260, 51, 50, + 8260, 51, 49, 8260, 53, 50, 8260, 53, 51, + 8260, 53, 52, 8260, 53, 49, 8260, 54, 53, + 8260, 54, 49, 8260, 56, 51, 8260, 56, 53, + 8260, 56, 55, 8260, 56, 49, 8260, 73, 73, + 73, 73, 73, 73, 73, 86, 86, 86, 73, + 86, 73, 73, 86, 73, 73, 73, 73, 88, + 88, 88, 73, 88, 73, 73, 76, 67, 68, + 77, 105, 105, 105, 105, 105, 105, 105, 118, + 118, 118, 105, 118, 105, 105, 118, 105, 105, + 105, 105, 120, 120, 120, 105, 120, 105, 105, + 108, 99, 100, 109, 48, 8260, 51, 8592, 824, + 8594, 824, 8596, 824, 8656, 824, 8660, 824, 8658, + 824, 8707, 824, 8712, 824, 8715, 824, 8739, 824, + 8741, 824, 8747, 8747, 8747, 8747, 8747, 8750, 8750, + 8750, 8750, 8750, 8764, 824, 8771, 824, 8773, 824, + 8776, 824, 61, 824, 8801, 824, 8781, 824, 60, + 824, 62, 824, 8804, 824, 8805, 824, 8818, 824, + 8819, 824, 8822, 824, 8823, 824, 8826, 824, 8827, + 824, 8834, 824, 8835, 824, 8838, 824, 8839, 824, + 8866, 824, 8872, 824, 8873, 824, 8875, 824, 8828, + 824, 8829, 824, 8849, 824, 8850, 824, 8882, 824, + 8883, 824, 8884, 824, 8885, 824, 12296, 12297, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 49, + 48, 49, 49, 49, 50, 49, 51, 49, 52, + 49, 53, 49, 54, 49, 55, 49, 56, 49, + 57, 50, 48, 40, 49, 41, 40, 50, 41, + 40, 51, 41, 40, 52, 41, 40, 53, 41, + 40, 54, 41, 40, 55, 41, 40, 56, 41, + 40, 57, 41, 40, 49, 48, 41, 40, 49, + 49, 41, 40, 49, 50, 41, 40, 49, 51, + 41, 40, 49, 52, 41, 40, 49, 53, 41, + 40, 49, 54, 41, 40, 49, 55, 41, 40, + 49, 56, 41, 40, 49, 57, 41, 40, 50, + 48, 41, 49, 46, 50, 46, 51, 46, 52, + 46, 53, 46, 54, 46, 55, 46, 56, 46, + 57, 46, 49, 48, 46, 49, 49, 46, 49, + 50, 46, 49, 51, 46, 49, 52, 46, 49, + 53, 46, 49, 54, 46, 49, 55, 46, 49, + 56, 46, 49, 57, 46, 50, 48, 46, 40, + 97, 41, 40, 98, 41, 40, 99, 41, 40, + 100, 41, 40, 101, 41, 40, 102, 41, 40, + 103, 41, 40, 104, 41, 40, 105, 41, 40, + 106, 41, 40, 107, 41, 40, 108, 41, 40, + 109, 41, 40, 110, 41, 40, 111, 41, 40, + 112, 41, 40, 113, 41, 40, 114, 41, 40, + 115, 41, 40, 116, 41, 40, 117, 41, 40, + 118, 41, 40, 119, 41, 40, 120, 41, 40, + 121, 41, 40, 122, 41, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 48, 8747, 8747, 8747, 8747, 58, + 58, 61, 61, 61, 61, 61, 61, 10973, 824, + 106, 86, 11617, 27597, 40863, 19968, 20008, 20022, 20031, + 20057, 20101, 20108, 20128, 20154, 20799, 20837, 20843, 20866, + 20886, 20907, 20960, 20981, 20992, 21147, 21241, 21269, 21274, + 21304, 21313, 21340, 21353, 21378, 21430, 21448, 21475, 22231, + 22303, 22763, 22786, 22794, 22805, 22823, 22899, 23376, 23424, + 23544, 23567, 23586, 23608, 23662, 23665, 24027, 24037, 24049, + 24062, 24178, 24186, 24191, 24308, 24318, 24331, 24339, 24400, + 24417, 24435, 24515, 25096, 25142, 25163, 25903, 25908, 25991, + 26007, 26020, 26041, 26080, 26085, 26352, 26376, 26408, 27424, + 27490, 27513, 27571, 27595, 27604, 27611, 27663, 27668, 27700, + 28779, 29226, 29238, 29243, 29247, 29255, 29273, 29275, 29356, + 29572, 29577, 29916, 29926, 29976, 29983, 29992, 30000, 30091, + 30098, 30326, 30333, 30382, 30399, 30446, 30683, 30690, 30707, + 31034, 31160, 31166, 31348, 31435, 31481, 31859, 31992, 32566, + 32593, 32650, 32701, 32769, 32780, 32786, 32819, 32895, 32905, + 33251, 33258, 33267, 33276, 33292, 33307, 33311, 33390, 33394, + 33400, 34381, 34411, 34880, 34892, 34915, 35198, 35211, 35282, + 35328, 35895, 35910, 35925, 35960, 35997, 36196, 36208, 36275, + 36523, 36554, 36763, 36784, 36789, 37009, 37193, 37318, 37324, + 37329, 38263, 38272, 38428, 38582, 38585, 38632, 38737, 38750, + 38754, 38761, 38859, 38893, 38899, 38913, 39080, 39131, 39135, + 39318, 39321, 39340, 39592, 39640, 39647, 39717, 39727, 39730, + 39740, 39770, 40165, 40565, 40575, 40613, 40635, 40643, 40653, + 40657, 40697, 40701, 40718, 40723, 40736, 40763, 40778, 40786, + 40845, 40860, 40864, 32, 12306, 21313, 21316, 21317, 12363, + 12441, 12365, 12441, 12367, 12441, 12369, 12441, 12371, 12441, + 12373, 12441, 12375, 12441, 12377, 12441, 12379, 12441, 12381, + 12441, 12383, 12441, 12385, 12441, 12388, 12441, 12390, 12441, + 12392, 12441, 12399, 12441, 12399, 12442, 12402, 12441, 12402, + 12442, 12405, 12441, 12405, 12442, 12408, 12441, 12408, 12442, + 12411, 12441, 12411, 12442, 12358, 12441, 32, 12441, 32, + 12442, 12445, 12441, 12424, 12426, 12459, 12441, 12461, 12441, + 12463, 12441, 12465, 12441, 12467, 12441, 12469, 12441, 12471, + 12441, 12473, 12441, 12475, 12441, 12477, 12441, 12479, 12441, + 12481, 12441, 12484, 12441, 12486, 12441, 12488, 12441, 12495, + 12441, 12495, 12442, 12498, 12441, 12498, 12442, 12501, 12441, + 12501, 12442, 12504, 12441, 12504, 12442, 12507, 12441, 12507, + 12442, 12454, 12441, 12527, 12441, 12528, 12441, 12529, 12441, + 12530, 12441, 12541, 12441, 12467, 12488, 4352, 4353, 4522, + 4354, 4524, 4525, 4355, 4356, 4357, 4528, 4529, 4530, + 4531, 4532, 4533, 4378, 4358, 4359, 4360, 4385, 4361, + 4362, 4363, 4364, 4365, 4366, 4367, 4368, 4369, 4370, + 4449, 4450, 4451, 4452, 4453, 4454, 4455, 4456, 4457, + 4458, 4459, 4460, 4461, 4462, 4463, 4464, 4465, 4466, + 4467, 4468, 4469, 4448, 4372, 4373, 4551, 4552, 4556, + 4558, 4563, 4567, 4569, 4380, 4573, 4575, 4381, 4382, + 4384, 4386, 4387, 4391, 4393, 4395, 4396, 4397, 4398, + 4399, 4402, 4406, 4416, 4423, 4428, 4593, 4594, 4439, + 4440, 4441, 4484, 4485, 4488, 4497, 4498, 4500, 4510, + 4513, 19968, 20108, 19977, 22235, 19978, 20013, 19979, 30002, + 20057, 19993, 19969, 22825, 22320, 20154, 40, 4352, 41, + 40, 4354, 41, 40, 4355, 41, 40, 4357, 41, + 40, 4358, 41, 40, 4359, 41, 40, 4361, 41, + 40, 4363, 41, 40, 4364, 41, 40, 4366, 41, + 40, 4367, 41, 40, 4368, 41, 40, 4369, 41, + 40, 4370, 41, 40, 4352, 4449, 41, 40, 4354, + 4449, 41, 40, 4355, 4449, 41, 40, 4357, 4449, + 41, 40, 4358, 4449, 41, 40, 4359, 4449, 41, + 40, 4361, 4449, 41, 40, 4363, 4449, 41, 40, + 4364, 4449, 41, 40, 4366, 4449, 41, 40, 4367, + 4449, 41, 40, 4368, 4449, 41, 40, 4369, 4449, + 41, 40, 4370, 4449, 41, 40, 4364, 4462, 41, + 40, 4363, 4457, 4364, 4453, 4523, 41, 40, 4363, + 4457, 4370, 4462, 41, 40, 19968, 41, 40, 20108, + 41, 40, 19977, 41, 40, 22235, 41, 40, 20116, + 41, 40, 20845, 41, 40, 19971, 41, 40, 20843, + 41, 40, 20061, 41, 40, 21313, 41, 40, 26376, + 41, 40, 28779, 41, 40, 27700, 41, 40, 26408, + 41, 40, 37329, 41, 40, 22303, 41, 40, 26085, + 41, 40, 26666, 41, 40, 26377, 41, 40, 31038, + 41, 40, 21517, 41, 40, 29305, 41, 40, 36001, + 41, 40, 31069, 41, 40, 21172, 41, 40, 20195, + 41, 40, 21628, 41, 40, 23398, 41, 40, 30435, + 41, 40, 20225, 41, 40, 36039, 41, 40, 21332, + 41, 40, 31085, 41, 40, 20241, 41, 40, 33258, + 41, 40, 33267, 41, 21839, 24188, 25991, 31631, 80, + 84, 69, 50, 49, 50, 50, 50, 51, 50, + 52, 50, 53, 50, 54, 50, 55, 50, 56, + 50, 57, 51, 48, 51, 49, 51, 50, 51, + 51, 51, 52, 51, 53, 4352, 4354, 4355, 4357, + 4358, 4359, 4361, 4363, 4364, 4366, 4367, 4368, 4369, + 4370, 4352, 4449, 4354, 4449, 4355, 4449, 4357, 4449, + 4358, 4449, 4359, 4449, 4361, 4449, 4363, 4449, 4364, + 4449, 4366, 4449, 4367, 4449, 4368, 4449, 4369, 4449, + 4370, 4449, 4366, 4449, 4535, 4352, 4457, 4364, 4462, + 4363, 4468, 4363, 4462, 19968, 20108, 19977, 22235, 20116, + 20845, 19971, 20843, 20061, 21313, 26376, 28779, 27700, 26408, + 37329, 22303, 26085, 26666, 26377, 31038, 21517, 29305, 36001, + 31069, 21172, 31192, 30007, 22899, 36969, 20778, 21360, 27880, + 38917, 20241, 20889, 27491, 19978, 20013, 19979, 24038, 21491, + 21307, 23447, 23398, 30435, 20225, 36039, 21332, 22812, 51, + 54, 51, 55, 51, 56, 51, 57, 52, 48, + 52, 49, 52, 50, 52, 51, 52, 52, 52, + 53, 52, 54, 52, 55, 52, 56, 52, 57, + 53, 48, 49, 26376, 50, 26376, 51, 26376, 52, + 26376, 53, 26376, 54, 26376, 55, 26376, 56, 26376, + 57, 26376, 49, 48, 26376, 49, 49, 26376, 49, + 50, 26376, 72, 103, 101, 114, 103, 101, 86, + 76, 84, 68, 12450, 12452, 12454, 12456, 12458, 12459, + 12461, 12463, 12465, 12467, 12469, 12471, 12473, 12475, 12477, + 12479, 12481, 12484, 12486, 12488, 12490, 12491, 12492, 12493, + 12494, 12495, 12498, 12501, 12504, 12507, 12510, 12511, 12512, + 12513, 12514, 12516, 12518, 12520, 12521, 12522, 12523, 12524, + 12525, 12527, 12528, 12529, 12530, 20196, 21644, 12450, 12495, + 12442, 12540, 12488, 12450, 12523, 12501, 12449, 12450, 12531, + 12504, 12442, 12450, 12450, 12540, 12523, 12452, 12491, 12531, + 12463, 12441, 12452, 12531, 12481, 12454, 12457, 12531, 12456, + 12473, 12463, 12540, 12488, 12441, 12456, 12540, 12459, 12540, + 12458, 12531, 12473, 12458, 12540, 12512, 12459, 12452, 12522, + 12459, 12521, 12483, 12488, 12459, 12525, 12522, 12540, 12459, + 12441, 12525, 12531, 12459, 12441, 12531, 12510, 12461, 12441, + 12459, 12441, 12461, 12441, 12491, 12540, 12461, 12517, 12522, + 12540, 12461, 12441, 12523, 12479, 12441, 12540, 12461, 12525, + 12461, 12525, 12463, 12441, 12521, 12512, 12461, 12525, 12513, + 12540, 12488, 12523, 12461, 12525, 12527, 12483, 12488, 12463, + 12441, 12521, 12512, 12463, 12441, 12521, 12512, 12488, 12531, + 12463, 12523, 12475, 12441, 12452, 12525, 12463, 12525, 12540, + 12493, 12465, 12540, 12473, 12467, 12523, 12490, 12467, 12540, + 12507, 12442, 12469, 12452, 12463, 12523, 12469, 12531, 12481, + 12540, 12512, 12471, 12522, 12531, 12463, 12441, 12475, 12531, + 12481, 12475, 12531, 12488, 12479, 12441, 12540, 12473, 12486, + 12441, 12471, 12488, 12441, 12523, 12488, 12531, 12490, 12494, + 12494, 12483, 12488, 12495, 12452, 12484, 12495, 12442, 12540, + 12475, 12531, 12488, 12495, 12442, 12540, 12484, 12495, 12441, + 12540, 12524, 12523, 12498, 12442, 12450, 12473, 12488, 12523, + 12498, 12442, 12463, 12523, 12498, 12442, 12467, 12498, 12441, + 12523, 12501, 12449, 12521, 12483, 12488, 12441, 12501, 12451, + 12540, 12488, 12501, 12441, 12483, 12471, 12455, 12523, 12501, + 12521, 12531, 12504, 12463, 12479, 12540, 12523, 12504, 12442, + 12477, 12504, 12442, 12491, 12498, 12504, 12523, 12484, 12504, + 12442, 12531, 12473, 12504, 12442, 12540, 12471, 12441, 12504, + 12441, 12540, 12479, 12507, 12442, 12452, 12531, 12488, 12507, + 12441, 12523, 12488, 12507, 12531, 12507, 12442, 12531, 12488, + 12441, 12507, 12540, 12523, 12507, 12540, 12531, 12510, 12452, + 12463, 12525, 12510, 12452, 12523, 12510, 12483, 12495, 12510, + 12523, 12463, 12510, 12531, 12471, 12519, 12531, 12511, 12463, + 12525, 12531, 12511, 12522, 12511, 12522, 12495, 12441, 12540, + 12523, 12513, 12459, 12441, 12513, 12459, 12441, 12488, 12531, + 12513, 12540, 12488, 12523, 12516, 12540, 12488, 12441, 12516, + 12540, 12523, 12518, 12450, 12531, 12522, 12483, 12488, 12523, + 12522, 12521, 12523, 12498, 12442, 12540, 12523, 12540, 12501, + 12441, 12523, 12524, 12512, 12524, 12531, 12488, 12465, 12441, + 12531, 12527, 12483, 12488, 48, 28857, 49, 28857, 50, + 28857, 51, 28857, 52, 28857, 53, 28857, 54, 28857, + 55, 28857, 56, 28857, 57, 28857, 49, 48, 28857, + 49, 49, 28857, 49, 50, 28857, 49, 51, 28857, + 49, 52, 28857, 49, 53, 28857, 49, 54, 28857, + 49, 55, 28857, 49, 56, 28857, 49, 57, 28857, + 50, 48, 28857, 50, 49, 28857, 50, 50, 28857, + 50, 51, 28857, 50, 52, 28857, 104, 80, 97, + 100, 97, 65, 85, 98, 97, 114, 111, 86, + 112, 99, 100, 109, 100, 109, 50, 100, 109, + 51, 73, 85, 24179, 25104, 26157, 21644, 22823, 27491, + 26126, 27835, 26666, 24335, 20250, 31038, 112, 65, 110, + 65, 956, 65, 109, 65, 107, 65, 75, 66, + 77, 66, 71, 66, 99, 97, 108, 107, 99, + 97, 108, 112, 70, 110, 70, 956, 70, 956, + 103, 109, 103, 107, 103, 72, 122, 107, 72, + 122, 77, 72, 122, 71, 72, 122, 84, 72, + 122, 956, 108, 109, 108, 100, 108, 107, 108, + 102, 109, 110, 109, 956, 109, 109, 109, 99, + 109, 107, 109, 109, 109, 50, 99, 109, 50, + 109, 50, 107, 109, 50, 109, 109, 51, 99, + 109, 51, 109, 51, 107, 109, 51, 109, 8725, + 115, 109, 8725, 115, 50, 80, 97, 107, 80, + 97, 77, 80, 97, 71, 80, 97, 114, 97, + 100, 114, 97, 100, 8725, 115, 114, 97, 100, + 8725, 115, 50, 112, 115, 110, 115, 956, 115, + 109, 115, 112, 86, 110, 86, 956, 86, 109, + 86, 107, 86, 77, 86, 112, 87, 110, 87, + 956, 87, 109, 87, 107, 87, 77, 87, 107, + 937, 77, 937, 97, 46, 109, 46, 66, 113, + 99, 99, 99, 100, 67, 8725, 107, 103, 67, + 111, 46, 100, 66, 71, 121, 104, 97, 72, + 80, 105, 110, 75, 75, 75, 77, 107, 116, + 108, 109, 108, 110, 108, 111, 103, 108, 120, + 109, 98, 109, 105, 108, 109, 111, 108, 80, + 72, 112, 46, 109, 46, 80, 80, 77, 80, + 82, 115, 114, 83, 118, 87, 98, 86, 8725, + 109, 65, 8725, 109, 49, 26085, 50, 26085, 51, + 26085, 52, 26085, 53, 26085, 54, 26085, 55, 26085, + 56, 26085, 57, 26085, 49, 48, 26085, 49, 49, + 26085, 49, 50, 26085, 49, 51, 26085, 49, 52, + 26085, 49, 53, 26085, 49, 54, 26085, 49, 55, + 26085, 49, 56, 26085, 49, 57, 26085, 50, 48, + 26085, 50, 49, 26085, 50, 50, 26085, 50, 51, + 26085, 50, 52, 26085, 50, 53, 26085, 50, 54, + 26085, 50, 55, 26085, 50, 56, 26085, 50, 57, + 26085, 51, 48, 26085, 51, 49, 26085, 103, 97, + 108, 1098, 1100, 42863, 67, 70, 81, 294, 339, + 42791, 43831, 619, 43858, 653, 35912, 26356, 36554, 36040, + 28369, 20018, 21477, 40860, 40860, 22865, 37329, 21895, 22856, + 25078, 30313, 32645, 34367, 34746, 35064, 37007, 27138, 27931, + 28889, 29662, 33853, 37226, 39409, 20098, 21365, 27396, 29211, + 34349, 40478, 23888, 28651, 34253, 35172, 25289, 33240, 34847, + 24266, 26391, 28010, 29436, 37070, 20358, 20919, 21214, 25796, + 27347, 29200, 30439, 32769, 34310, 34396, 36335, 38706, 39791, + 40442, 30860, 31103, 32160, 33737, 37636, 40575, 35542, 22751, + 24324, 31840, 32894, 29282, 30922, 36034, 38647, 22744, 23650, + 27155, 28122, 28431, 32047, 32311, 38475, 21202, 32907, 20956, + 20940, 31260, 32190, 33777, 38517, 35712, 25295, 27138, 35582, + 20025, 23527, 24594, 29575, 30064, 21271, 30971, 20415, 24489, + 19981, 27852, 25976, 32034, 21443, 22622, 30465, 33865, 35498, + 27578, 36784, 27784, 25342, 33509, 25504, 30053, 20142, 20841, + 20937, 26753, 31975, 33391, 35538, 37327, 21237, 21570, 22899, + 24300, 26053, 28670, 31018, 38317, 39530, 40599, 40654, 21147, + 26310, 27511, 36706, 24180, 24976, 25088, 25754, 28451, 29001, + 29833, 31178, 32244, 32879, 36646, 34030, 36899, 37706, 21015, + 21155, 21693, 28872, 35010, 35498, 24265, 24565, 25467, 27566, + 31806, 29557, 20196, 22265, 23527, 23994, 24604, 29618, 29801, + 32666, 32838, 37428, 38646, 38728, 38936, 20363, 31150, 37300, + 38584, 24801, 20102, 20698, 23534, 23615, 26009, 27138, 29134, + 30274, 34044, 36988, 40845, 26248, 38446, 21129, 26491, 26611, + 27969, 28316, 29705, 30041, 30827, 32016, 39006, 20845, 25134, + 38520, 20523, 23833, 28138, 36650, 24459, 24900, 26647, 29575, + 38534, 21033, 21519, 23653, 26131, 26446, 26792, 27877, 29702, + 30178, 32633, 35023, 35041, 37324, 38626, 21311, 28346, 21533, + 29136, 29848, 34298, 38563, 40023, 40607, 26519, 28107, 33256, + 31435, 31520, 31890, 29376, 28825, 35672, 20160, 33590, 21050, + 20999, 24230, 25299, 31958, 23429, 27934, 26292, 36667, 34892, + 38477, 35211, 24275, 20800, 21952, 22618, 26228, 20958, 29482, + 30410, 31036, 31070, 31077, 31119, 38742, 31934, 32701, 34322, + 35576, 36920, 37117, 39151, 39164, 39208, 40372, 37086, 38583, + 20398, 20711, 20813, 21193, 21220, 21329, 21917, 22022, 22120, + 22592, 22696, 23652, 23662, 24724, 24936, 24974, 25074, 25935, + 26082, 26257, 26757, 28023, 28186, 28450, 29038, 29227, 29730, + 30865, 31038, 31049, 31048, 31056, 31062, 31069, 31117, 31118, + 31296, 31361, 31680, 32244, 32265, 32321, 32626, 32773, 33261, + 33401, 33401, 33879, 35088, 35222, 35585, 35641, 36051, 36104, + 36790, 36920, 38627, 38911, 38971, 24693, 148206, 33304, 20006, + 20917, 20840, 20352, 20805, 20864, 21191, 21242, 21917, 21845, + 21913, 21986, 22618, 22707, 22852, 22868, 23138, 23336, 24274, + 24281, 24425, 24493, 24792, 24910, 24840, 24974, 24928, 25074, + 25140, 25540, 25628, 25682, 25942, 26228, 26391, 26395, 26454, + 27513, 27578, 27969, 28379, 28363, 28450, 28702, 29038, 30631, + 29237, 29359, 29482, 29809, 29958, 30011, 30237, 30239, 30410, + 30427, 30452, 30538, 30528, 30924, 31409, 31680, 31867, 32091, + 32244, 32574, 32773, 33618, 33775, 34681, 35137, 35206, 35222, + 35519, 35576, 35531, 35585, 35582, 35565, 35641, 35722, 36104, + 36664, 36978, 37273, 37494, 38524, 38627, 38742, 38875, 38911, + 38923, 38971, 39698, 40860, 141386, 141380, 144341, 15261, 16408, + 16441, 152137, 154832, 163539, 40771, 40846, 102, 102, 102, + 105, 102, 108, 102, 102, 105, 102, 102, 108, + 115, 116, 115, 116, 1396, 1398, 1396, 1381, 1396, + 1387, 1406, 1398, 1396, 1389, 1497, 1460, 1522, 1463, + 1506, 1488, 1491, 1492, 1499, 1500, 1501, 1512, 1514, + 43, 1513, 1473, 1513, 1474, 1513, 1468, 1473, 1513, + 1468, 1474, 1488, 1463, 1488, 1464, 1488, 1468, 1489, + 1468, 1490, 1468, 1491, 1468, 1492, 1468, 1493, 1468, + 1494, 1468, 1496, 1468, 1497, 1468, 1498, 1468, 1499, + 1468, 1500, 1468, 1502, 1468, 1504, 1468, 1505, 1468, + 1507, 1468, 1508, 1468, 1510, 1468, 1511, 1468, 1512, + 1468, 1513, 1468, 1514, 1468, 1493, 1465, 1489, 1471, + 1499, 1471, 1508, 1471, 1488, 1500, 1649, 1649, 1659, + 1659, 1659, 1659, 1662, 1662, 1662, 1662, 1664, 1664, + 1664, 1664, 1658, 1658, 1658, 1658, 1663, 1663, 1663, + 1663, 1657, 1657, 1657, 1657, 1700, 1700, 1700, 1700, + 1702, 1702, 1702, 1702, 1668, 1668, 1668, 1668, 1667, + 1667, 1667, 1667, 1670, 1670, 1670, 1670, 1671, 1671, + 1671, 1671, 1677, 1677, 1676, 1676, 1678, 1678, 1672, + 1672, 1688, 1688, 1681, 1681, 1705, 1705, 1705, 1705, + 1711, 1711, 1711, 1711, 1715, 1715, 1715, 1715, 1713, + 1713, 1713, 1713, 1722, 1722, 1723, 1723, 1723, 1723, + 1749, 1620, 1749, 1620, 1729, 1729, 1729, 1729, 1726, + 1726, 1726, 1726, 1746, 1746, 1746, 1620, 1746, 1620, + 1709, 1709, 1709, 1709, 1735, 1735, 1734, 1734, 1736, + 1736, 1735, 1652, 1739, 1739, 1733, 1733, 1737, 1737, + 1744, 1744, 1744, 1744, 1609, 1609, 1610, 1620, 1575, + 1610, 1620, 1575, 1610, 1620, 1749, 1610, 1620, 1749, + 1610, 1620, 1608, 1610, 1620, 1608, 1610, 1620, 1735, + 1610, 1620, 1735, 1610, 1620, 1734, 1610, 1620, 1734, + 1610, 1620, 1736, 1610, 1620, 1736, 1610, 1620, 1744, + 1610, 1620, 1744, 1610, 1620, 1744, 1610, 1620, 1609, + 1610, 1620, 1609, 1610, 1620, 1609, 1740, 1740, 1740, + 1740, 1610, 1620, 1580, 1610, 1620, 1581, 1610, 1620, + 1605, 1610, 1620, 1609, 1610, 1620, 1610, 1576, 1580, + 1576, 1581, 1576, 1582, 1576, 1605, 1576, 1609, 1576, + 1610, 1578, 1580, 1578, 1581, 1578, 1582, 1578, 1605, + 1578, 1609, 1578, 1610, 1579, 1580, 1579, 1605, 1579, + 1609, 1579, 1610, 1580, 1581, 1580, 1605, 1581, 1580, + 1581, 1605, 1582, 1580, 1582, 1581, 1582, 1605, 1587, + 1580, 1587, 1581, 1587, 1582, 1587, 1605, 1589, 1581, + 1589, 1605, 1590, 1580, 1590, 1581, 1590, 1582, 1590, + 1605, 1591, 1581, 1591, 1605, 1592, 1605, 1593, 1580, + 1593, 1605, 1594, 1580, 1594, 1605, 1601, 1580, 1601, + 1581, 1601, 1582, 1601, 1605, 1601, 1609, 1601, 1610, + 1602, 1581, 1602, 1605, 1602, 1609, 1602, 1610, 1603, + 1575, 1603, 1580, 1603, 1581, 1603, 1582, 1603, 1604, + 1603, 1605, 1603, 1609, 1603, 1610, 1604, 1580, 1604, + 1581, 1604, 1582, 1604, 1605, 1604, 1609, 1604, 1610, + 1605, 1580, 1605, 1581, 1605, 1582, 1605, 1605, 1605, + 1609, 1605, 1610, 1606, 1580, 1606, 1581, 1606, 1582, + 1606, 1605, 1606, 1609, 1606, 1610, 1607, 1580, 1607, + 1605, 1607, 1609, 1607, 1610, 1610, 1580, 1610, 1581, + 1610, 1582, 1610, 1605, 1610, 1609, 1610, 1610, 1584, + 1648, 1585, 1648, 1609, 1648, 32, 1612, 1617, 32, + 1613, 1617, 32, 1614, 1617, 32, 1615, 1617, 32, + 1616, 1617, 32, 1617, 1648, 1610, 1620, 1585, 1610, + 1620, 1586, 1610, 1620, 1605, 1610, 1620, 1606, 1610, + 1620, 1609, 1610, 1620, 1610, 1576, 1585, 1576, 1586, + 1576, 1605, 1576, 1606, 1576, 1609, 1576, 1610, 1578, + 1585, 1578, 1586, 1578, 1605, 1578, 1606, 1578, 1609, + 1578, 1610, 1579, 1585, 1579, 1586, 1579, 1605, 1579, + 1606, 1579, 1609, 1579, 1610, 1601, 1609, 1601, 1610, + 1602, 1609, 1602, 1610, 1603, 1575, 1603, 1604, 1603, + 1605, 1603, 1609, 1603, 1610, 1604, 1605, 1604, 1609, + 1604, 1610, 1605, 1575, 1605, 1605, 1606, 1585, 1606, + 1586, 1606, 1605, 1606, 1606, 1606, 1609, 1606, 1610, + 1609, 1648, 1610, 1585, 1610, 1586, 1610, 1605, 1610, + 1606, 1610, 1609, 1610, 1610, 1610, 1620, 1580, 1610, + 1620, 1581, 1610, 1620, 1582, 1610, 1620, 1605, 1610, + 1620, 1607, 1576, 1580, 1576, 1581, 1576, 1582, 1576, + 1605, 1576, 1607, 1578, 1580, 1578, 1581, 1578, 1582, + 1578, 1605, 1578, 1607, 1579, 1605, 1580, 1581, 1580, + 1605, 1581, 1580, 1581, 1605, 1582, 1580, 1582, 1605, + 1587, 1580, 1587, 1581, 1587, 1582, 1587, 1605, 1589, + 1581, 1589, 1582, 1589, 1605, 1590, 1580, 1590, 1581, + 1590, 1582, 1590, 1605, 1591, 1581, 1592, 1605, 1593, + 1580, 1593, 1605, 1594, 1580, 1594, 1605, 1601, 1580, + 1601, 1581, 1601, 1582, 1601, 1605, 1602, 1581, 1602, + 1605, 1603, 1580, 1603, 1581, 1603, 1582, 1603, 1604, + 1603, 1605, 1604, 1580, 1604, 1581, 1604, 1582, 1604, + 1605, 1604, 1607, 1605, 1580, 1605, 1581, 1605, 1582, + 1605, 1605, 1606, 1580, 1606, 1581, 1606, 1582, 1606, + 1605, 1606, 1607, 1607, 1580, 1607, 1605, 1607, 1648, + 1610, 1580, 1610, 1581, 1610, 1582, 1610, 1605, 1610, + 1607, 1610, 1620, 1605, 1610, 1620, 1607, 1576, 1605, + 1576, 1607, 1578, 1605, 1578, 1607, 1579, 1605, 1579, + 1607, 1587, 1605, 1587, 1607, 1588, 1605, 1588, 1607, + 1603, 1604, 1603, 1605, 1604, 1605, 1606, 1605, 1606, + 1607, 1610, 1605, 1610, 1607, 1600, 1614, 1617, 1600, + 1615, 1617, 1600, 1616, 1617, 1591, 1609, 1591, 1610, + 1593, 1609, 1593, 1610, 1594, 1609, 1594, 1610, 1587, + 1609, 1587, 1610, 1588, 1609, 1588, 1610, 1581, 1609, + 1581, 1610, 1580, 1609, 1580, 1610, 1582, 1609, 1582, + 1610, 1589, 1609, 1589, 1610, 1590, 1609, 1590, 1610, + 1588, 1580, 1588, 1581, 1588, 1582, 1588, 1605, 1588, + 1585, 1587, 1585, 1589, 1585, 1590, 1585, 1591, 1609, + 1591, 1610, 1593, 1609, 1593, 1610, 1594, 1609, 1594, + 1610, 1587, 1609, 1587, 1610, 1588, 1609, 1588, 1610, + 1581, 1609, 1581, 1610, 1580, 1609, 1580, 1610, 1582, + 1609, 1582, 1610, 1589, 1609, 1589, 1610, 1590, 1609, + 1590, 1610, 1588, 1580, 1588, 1581, 1588, 1582, 1588, + 1605, 1588, 1585, 1587, 1585, 1589, 1585, 1590, 1585, + 1588, 1580, 1588, 1581, 1588, 1582, 1588, 1605, 1587, + 1607, 1588, 1607, 1591, 1605, 1587, 1580, 1587, 1581, + 1587, 1582, 1588, 1580, 1588, 1581, 1588, 1582, 1591, + 1605, 1592, 1605, 1575, 1611, 1575, 1611, 1578, 1580, + 1605, 1578, 1581, 1580, 1578, 1581, 1580, 1578, 1581, + 1605, 1578, 1582, 1605, 1578, 1605, 1580, 1578, 1605, + 1581, 1578, 1605, 1582, 1580, 1605, 1581, 1580, 1605, + 1581, 1581, 1605, 1610, 1581, 1605, 1609, 1587, 1581, + 1580, 1587, 1580, 1581, 1587, 1580, 1609, 1587, 1605, + 1581, 1587, 1605, 1581, 1587, 1605, 1580, 1587, 1605, + 1605, 1587, 1605, 1605, 1589, 1581, 1581, 1589, 1581, + 1581, 1589, 1605, 1605, 1588, 1581, 1605, 1588, 1581, + 1605, 1588, 1580, 1610, 1588, 1605, 1582, 1588, 1605, + 1582, 1588, 1605, 1605, 1588, 1605, 1605, 1590, 1581, + 1609, 1590, 1582, 1605, 1590, 1582, 1605, 1591, 1605, + 1581, 1591, 1605, 1581, 1591, 1605, 1605, 1591, 1605, + 1610, 1593, 1580, 1605, 1593, 1605, 1605, 1593, 1605, + 1605, 1593, 1605, 1609, 1594, 1605, 1605, 1594, 1605, + 1610, 1594, 1605, 1609, 1601, 1582, 1605, 1601, 1582, + 1605, 1602, 1605, 1581, 1602, 1605, 1605, 1604, 1581, + 1605, 1604, 1581, 1610, 1604, 1581, 1609, 1604, 1580, + 1580, 1604, 1580, 1580, 1604, 1582, 1605, 1604, 1582, + 1605, 1604, 1605, 1581, 1604, 1605, 1581, 1605, 1581, + 1580, 1605, 1581, 1605, 1605, 1581, 1610, 1605, 1580, + 1581, 1605, 1580, 1605, 1605, 1582, 1580, 1605, 1582, + 1605, 1605, 1580, 1582, 1607, 1605, 1580, 1607, 1605, + 1605, 1606, 1581, 1605, 1606, 1581, 1609, 1606, 1580, + 1605, 1606, 1580, 1605, 1606, 1580, 1609, 1606, 1605, + 1610, 1606, 1605, 1609, 1610, 1605, 1605, 1610, 1605, + 1605, 1576, 1582, 1610, 1578, 1580, 1610, 1578, 1580, + 1609, 1578, 1582, 1610, 1578, 1582, 1609, 1578, 1605, + 1610, 1578, 1605, 1609, 1580, 1605, 1610, 1580, 1581, + 1609, 1580, 1605, 1609, 1587, 1582, 1609, 1589, 1581, + 1610, 1588, 1581, 1610, 1590, 1581, 1610, 1604, 1580, + 1610, 1604, 1605, 1610, 1610, 1581, 1610, 1610, 1580, + 1610, 1610, 1605, 1610, 1605, 1605, 1610, 1602, 1605, + 1610, 1606, 1581, 1610, 1602, 1605, 1581, 1604, 1581, + 1605, 1593, 1605, 1610, 1603, 1605, 1610, 1606, 1580, + 1581, 1605, 1582, 1610, 1604, 1580, 1605, 1603, 1605, + 1605, 1604, 1580, 1605, 1606, 1580, 1581, 1580, 1581, + 1610, 1581, 1580, 1610, 1605, 1580, 1610, 1601, 1605, + 1610, 1576, 1581, 1610, 1603, 1605, 1605, 1593, 1580, + 1605, 1589, 1605, 1605, 1587, 1582, 1610, 1606, 1580, + 1610, 1589, 1604, 1746, 1602, 1604, 1746, 1575, 1604, + 1604, 1607, 1575, 1603, 1576, 1585, 1605, 1581, 1605, + 1583, 1589, 1604, 1593, 1605, 1585, 1587, 1608, 1604, + 1593, 1604, 1610, 1607, 1608, 1587, 1604, 1605, 1589, + 1604, 1609, 1589, 1604, 1609, 32, 1575, 1604, 1604, + 1607, 32, 1593, 1604, 1610, 1607, 32, 1608, 1587, + 1604, 1605, 1580, 1604, 32, 1580, 1604, 1575, 1604, + 1607, 1585, 1740, 1575, 1604, 44, 12289, 12290, 58, + 59, 33, 63, 12310, 12311, 46, 46, 46, 46, + 46, 8212, 8211, 95, 95, 40, 41, 123, 125, + 12308, 12309, 12304, 12305, 12298, 12299, 12296, 12297, 12300, + 12301, 12302, 12303, 91, 93, 32, 773, 32, 773, + 32, 773, 32, 773, 95, 95, 95, 44, 12289, + 46, 59, 58, 63, 33, 8212, 40, 41, 123, + 125, 12308, 12309, 35, 38, 42, 43, 45, 60, + 62, 61, 92, 36, 37, 64, 32, 1611, 1600, + 1611, 32, 1612, 32, 1613, 32, 1614, 1600, 1614, + 32, 1615, 1600, 1615, 32, 1616, 1600, 1616, 32, + 1617, 1600, 1617, 32, 1618, 1600, 1618, 1569, 1575, + 1619, 1575, 1619, 1575, 1620, 1575, 1620, 1608, 1620, + 1608, 1620, 1575, 1621, 1575, 1621, 1610, 1620, 1610, + 1620, 1610, 1620, 1610, 1620, 1575, 1575, 1576, 1576, + 1576, 1576, 1577, 1577, 1578, 1578, 1578, 1578, 1579, + 1579, 1579, 1579, 1580, 1580, 1580, 1580, 1581, 1581, + 1581, 1581, 1582, 1582, 1582, 1582, 1583, 1583, 1584, + 1584, 1585, 1585, 1586, 1586, 1587, 1587, 1587, 1587, + 1588, 1588, 1588, 1588, 1589, 1589, 1589, 1589, 1590, + 1590, 1590, 1590, 1591, 1591, 1591, 1591, 1592, 1592, + 1592, 1592, 1593, 1593, 1593, 1593, 1594, 1594, 1594, + 1594, 1601, 1601, 1601, 1601, 1602, 1602, 1602, 1602, + 1603, 1603, 1603, 1603, 1604, 1604, 1604, 1604, 1605, + 1605, 1605, 1605, 1606, 1606, 1606, 1606, 1607, 1607, + 1607, 1607, 1608, 1608, 1609, 1609, 1610, 1610, 1610, + 1610, 1604, 1575, 1619, 1604, 1575, 1619, 1604, 1575, + 1620, 1604, 1575, 1620, 1604, 1575, 1621, 1604, 1575, + 1621, 1604, 1575, 1604, 1575, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, + 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 117, + 118, 119, 120, 121, 122, 123, 124, 125, 126, + 10629, 10630, 12290, 12300, 12301, 12289, 12539, 12530, 12449, + 12451, 12453, 12455, 12457, 12515, 12517, 12519, 12483, 12540, + 12450, 12452, 12454, 12456, 12458, 12459, 12461, 12463, 12465, + 12467, 12469, 12471, 12473, 12475, 12477, 12479, 12481, 12484, + 12486, 12488, 12490, 12491, 12492, 12493, 12494, 12495, 12498, + 12501, 12504, 12507, 12510, 12511, 12512, 12513, 12514, 12516, + 12518, 12520, 12521, 12522, 12523, 12524, 12525, 12527, 12531, + 12441, 12442, 4448, 4352, 4353, 4522, 4354, 4524, 4525, + 4355, 4356, 4357, 4528, 4529, 4530, 4531, 4532, 4533, + 4378, 4358, 4359, 4360, 4385, 4361, 4362, 4363, 4364, + 4365, 4366, 4367, 4368, 4369, 4370, 4449, 4450, 4451, + 4452, 4453, 4454, 4455, 4456, 4457, 4458, 4459, 4460, + 4461, 4462, 4463, 4464, 4465, 4466, 4467, 4468, 4469, + 162, 163, 172, 32, 772, 166, 165, 8361, 9474, + 8592, 8593, 8594, 8595, 9632, 9675, 720, 721, 230, + 665, 595, 675, 43878, 677, 676, 598, 599, 7569, + 600, 606, 681, 612, 610, 608, 667, 295, 668, + 615, 644, 682, 683, 620, 122628, 42894, 622, 122629, + 654, 122630, 248, 630, 631, 113, 634, 122632, 637, + 638, 640, 680, 678, 43879, 679, 648, 11377, 655, + 673, 674, 664, 448, 449, 450, 122634, 122654, 69785, + 69818, 69787, 69818, 69797, 69818, 69937, 69927, 69938, 69927, + 70471, 70462, 70471, 70487, 70841, 70842, 70841, 70832, 70841, + 70845, 71096, 71087, 71097, 71087, 71989, 71984, 119127, 119141, + 119128, 119141, 119128, 119141, 119150, 119128, 119141, 119151, 119128, + 119141, 119152, 119128, 119141, 119153, 119128, 119141, 119154, 119225, + 119141, 119226, 119141, 119225, 119141, 119150, 119226, 119141, 119150, + 119225, 119141, 119151, 119226, 119141, 119151, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, + 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 97, 98, 99, 100, 101, 102, + 103, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, + 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 65, + 67, 68, 71, 74, 75, 78, 79, 80, 81, + 83, 84, 85, 86, 87, 88, 89, 90, 97, + 98, 99, 100, 102, 104, 105, 106, 107, 108, + 109, 110, 112, 113, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, + 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 65, 66, 68, 69, 70, 71, 74, + 75, 76, 77, 78, 79, 80, 81, 83, 84, + 85, 86, 87, 88, 89, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 65, 66, 68, 69, 70, + 71, 73, 74, 75, 76, 77, 79, 83, 84, + 85, 86, 87, 88, 89, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, + 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, + 65, 66, 67, 68, 69, 70, 71, 72, 73, + 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, + 116, 117, 118, 119, 120, 121, 122, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 97, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 117, + 118, 119, 120, 121, 122, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 305, 567, 913, 914, 915, 916, 917, 918, + 919, 920, 921, 922, 923, 924, 925, 926, 927, + 928, 929, 920, 931, 932, 933, 934, 935, 936, + 937, 8711, 945, 946, 947, 948, 949, 950, 951, + 952, 953, 954, 955, 956, 957, 958, 959, 960, + 961, 962, 963, 964, 965, 966, 967, 968, 969, + 8706, 949, 952, 954, 966, 961, 960, 913, 914, + 915, 916, 917, 918, 919, 920, 921, 922, 923, + 924, 925, 926, 927, 928, 929, 920, 931, 932, + 933, 934, 935, 936, 937, 8711, 945, 946, 947, + 948, 949, 950, 951, 952, 953, 954, 955, 956, + 957, 958, 959, 960, 961, 962, 963, 964, 965, + 966, 967, 968, 969, 8706, 949, 952, 954, 966, + 961, 960, 913, 914, 915, 916, 917, 918, 919, + 920, 921, 922, 923, 924, 925, 926, 927, 928, + 929, 920, 931, 932, 933, 934, 935, 936, 937, + 8711, 945, 946, 947, 948, 949, 950, 951, 952, + 953, 954, 955, 956, 957, 958, 959, 960, 961, + 962, 963, 964, 965, 966, 967, 968, 969, 8706, + 949, 952, 954, 966, 961, 960, 913, 914, 915, + 916, 917, 918, 919, 920, 921, 922, 923, 924, + 925, 926, 927, 928, 929, 920, 931, 932, 933, + 934, 935, 936, 937, 8711, 945, 946, 947, 948, + 949, 950, 951, 952, 953, 954, 955, 956, 957, + 958, 959, 960, 961, 962, 963, 964, 965, 966, + 967, 968, 969, 8706, 949, 952, 954, 966, 961, + 960, 913, 914, 915, 916, 917, 918, 919, 920, + 921, 922, 923, 924, 925, 926, 927, 928, 929, + 920, 931, 932, 933, 934, 935, 936, 937, 8711, + 945, 946, 947, 948, 949, 950, 951, 952, 953, + 954, 955, 956, 957, 958, 959, 960, 961, 962, + 963, 964, 965, 966, 967, 968, 969, 8706, 949, + 952, 954, 966, 961, 960, 988, 989, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 48, + 49, 50, 51, 52, 53, 54, 55, 56, 57, + 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 1072, 1073, 1074, 1075, 1076, 1077, + 1078, 1079, 1080, 1082, 1083, 1084, 1086, 1087, 1088, + 1089, 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1099, + 1101, 1102, 42633, 1241, 1110, 1112, 1257, 1199, 1231, + 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, + 1082, 1083, 1086, 1087, 1089, 1091, 1092, 1093, 1094, + 1095, 1096, 1098, 1099, 1169, 1110, 1109, 1119, 1195, + 42577, 1201, 1575, 1576, 1580, 1583, 1608, 1586, 1581, + 1591, 1610, 1603, 1604, 1605, 1606, 1587, 1593, 1601, + 1589, 1602, 1585, 1588, 1578, 1579, 1582, 1584, 1590, + 1592, 1594, 1646, 1722, 1697, 1647, 1576, 1580, 1607, + 1581, 1610, 1603, 1604, 1605, 1606, 1587, 1593, 1601, + 1589, 1602, 1588, 1578, 1579, 1582, 1590, 1594, 1580, + 1581, 1610, 1604, 1606, 1587, 1593, 1589, 1602, 1588, + 1582, 1590, 1594, 1722, 1647, 1576, 1580, 1607, 1581, + 1591, 1610, 1603, 1605, 1606, 1587, 1593, 1601, 1589, + 1602, 1588, 1578, 1579, 1582, 1590, 1592, 1594, 1646, + 1697, 1575, 1576, 1580, 1583, 1607, 1608, 1586, 1581, + 1591, 1610, 1604, 1605, 1606, 1587, 1593, 1601, 1589, + 1602, 1585, 1588, 1578, 1579, 1582, 1584, 1590, 1592, + 1594, 1576, 1580, 1583, 1608, 1586, 1581, 1591, 1610, + 1604, 1605, 1606, 1587, 1593, 1601, 1589, 1602, 1585, + 1588, 1578, 1579, 1582, 1584, 1590, 1592, 1594, 48, + 46, 48, 44, 49, 44, 50, 44, 51, 44, + 52, 44, 53, 44, 54, 44, 55, 44, 56, + 44, 57, 44, 40, 65, 41, 40, 66, 41, + 40, 67, 41, 40, 68, 41, 40, 69, 41, + 40, 70, 41, 40, 71, 41, 40, 72, 41, + 40, 73, 41, 40, 74, 41, 40, 75, 41, + 40, 76, 41, 40, 77, 41, 40, 78, 41, + 40, 79, 41, 40, 80, 41, 40, 81, 41, + 40, 82, 41, 40, 83, 41, 40, 84, 41, + 40, 85, 41, 40, 86, 41, 40, 87, 41, + 40, 88, 41, 40, 89, 41, 40, 90, 41, + 12308, 83, 12309, 67, 82, 67, 68, 87, 90, + 65, 66, 67, 68, 69, 70, 71, 72, 73, + 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 72, + 86, 77, 86, 83, 68, 83, 83, 80, 80, + 86, 87, 67, 77, 67, 77, 68, 77, 82, + 68, 74, 12411, 12363, 12467, 12467, 12469, 25163, 23383, + 21452, 12486, 12441, 20108, 22810, 35299, 22825, 20132, 26144, + 28961, 26009, 21069, 24460, 20877, 26032, 21021, 32066, 29983, + 36009, 22768, 21561, 28436, 25237, 25429, 19968, 19977, 36938, + 24038, 20013, 21491, 25351, 36208, 25171, 31105, 31354, 21512, + 28288, 26377, 26376, 30003, 21106, 21942, 37197, 12308, 26412, + 12309, 12308, 19977, 12309, 12308, 20108, 12309, 12308, 23433, + 12309, 12308, 28857, 12309, 12308, 25171, 12309, 12308, 30423, + 12309, 12308, 21213, 12309, 12308, 25943, 12309, 24471, 21487, + 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 20029, 20024, 20033, 131362, 20320, 20398, 20411, 20482, + 20602, 20633, 20711, 20687, 13470, 132666, 20813, 20820, 20836, + 20855, 132380, 13497, 20839, 20877, 132427, 20887, 20900, 20172, + 20908, 20917, 168415, 20981, 20995, 13535, 21051, 21062, 21106, + 21111, 13589, 21191, 21193, 21220, 21242, 21253, 21254, 21271, + 21321, 21329, 21338, 21363, 21373, 21375, 21375, 21375, 133676, + 28784, 21450, 21471, 133987, 21483, 21489, 21510, 21662, 21560, + 21576, 21608, 21666, 21750, 21776, 21843, 21859, 21892, 21892, + 21913, 21931, 21939, 21954, 22294, 22022, 22295, 22097, 22132, + 20999, 22766, 22478, 22516, 22541, 22411, 22578, 22577, 22700, + 136420, 22770, 22775, 22790, 22810, 22818, 22882, 136872, 136938, + 23020, 23067, 23079, 23000, 23142, 14062, 14076, 23304, 23358, + 23358, 137672, 23491, 23512, 23527, 23539, 138008, 23551, 23558, + 24403, 23586, 14209, 23648, 23662, 23744, 23693, 138724, 23875, + 138726, 23918, 23915, 23932, 24033, 24034, 14383, 24061, 24104, + 24125, 24169, 14434, 139651, 14460, 24240, 24243, 24246, 24266, + 172946, 24318, 140081, 140081, 33281, 24354, 24354, 14535, 144056, + 156122, 24418, 24427, 14563, 24474, 24525, 24535, 24569, 24705, + 14650, 14620, 24724, 141012, 24775, 24904, 24908, 24910, 24908, + 24954, 24974, 25010, 24996, 25007, 25054, 25074, 25078, 25104, + 25115, 25181, 25265, 25300, 25424, 142092, 25405, 25340, 25448, + 25475, 25572, 142321, 25634, 25541, 25513, 14894, 25705, 25726, + 25757, 25719, 14956, 25935, 25964, 143370, 26083, 26360, 26185, + 15129, 26257, 15112, 15076, 20882, 20885, 26368, 26268, 32941, + 17369, 26391, 26395, 26401, 26462, 26451, 144323, 15177, 26618, + 26501, 26706, 26757, 144493, 26766, 26655, 26900, 15261, 26946, + 27043, 27114, 27304, 145059, 27355, 15384, 27425, 145575, 27476, + 15438, 27506, 27551, 27578, 27579, 146061, 138507, 146170, 27726, + 146620, 27839, 27853, 27751, 27926, 27966, 28023, 27969, 28009, + 28024, 28037, 146718, 27956, 28207, 28270, 15667, 28363, 28359, + 147153, 28153, 28526, 147294, 147342, 28614, 28729, 28702, 28699, + 15766, 28746, 28797, 28791, 28845, 132389, 28997, 148067, 29084, + 148395, 29224, 29237, 29264, 149000, 29312, 29333, 149301, 149524, + 29562, 29579, 16044, 29605, 16056, 16056, 29767, 29788, 29809, + 29829, 29898, 16155, 29988, 150582, 30014, 150674, 30064, 139679, + 30224, 151457, 151480, 151620, 16380, 16392, 30452, 151795, 151794, + 151833, 151859, 30494, 30495, 30495, 30538, 16441, 30603, 16454, + 16534, 152605, 30798, 30860, 30924, 16611, 153126, 31062, 153242, + 153285, 31119, 31211, 16687, 31296, 31306, 31311, 153980, 154279, + 154279, 31470, 16898, 154539, 31686, 31689, 16935, 154752, 31954, + 17056, 31976, 31971, 32000, 155526, 32099, 17153, 32199, 32258, + 32325, 17204, 156200, 156231, 17241, 156377, 32634, 156478, 32661, + 32762, 32773, 156890, 156963, 32864, 157096, 32880, 144223, 17365, + 32946, 33027, 17419, 33086, 23221, 157607, 157621, 144275, 144284, + 33281, 33284, 36766, 17515, 33425, 33419, 33437, 21171, 33457, + 33459, 33469, 33510, 158524, 33509, 33565, 33635, 33709, 33571, + 33725, 33767, 33879, 33619, 33738, 33740, 33756, 158774, 159083, + 158933, 17707, 34033, 34035, 34070, 160714, 34148, 159532, 17757, + 17761, 159665, 159954, 17771, 34384, 34396, 34407, 34409, 34473, + 34440, 34574, 34530, 34681, 34600, 34667, 34694, 17879, 34785, + 34817, 17913, 34912, 34915, 161383, 35031, 35038, 17973, 35066, + 13499, 161966, 162150, 18110, 18119, 35488, 35565, 35722, 35925, + 162984, 36011, 36033, 36123, 36215, 163631, 133124, 36299, 36284, + 36336, 133342, 36564, 36664, 165330, 165357, 37012, 37105, 37137, + 165678, 37147, 37432, 37591, 37592, 37500, 37881, 37909, 166906, + 38283, 18837, 38327, 167287, 18918, 38595, 23986, 38691, 168261, + 168474, 19054, 19062, 38880, 168970, 19122, 169110, 38923, 38923, + 38953, 169398, 39138, 19251, 39209, 39335, 39362, 39422, 19406, + 170800, 39698, 40000, 40189, 19662, 19693, 40295, 172238, 19704, + 172293, 172558, 172689, 40635, 19798, 40697, 40702, 40709, 40719, + 40726, 40763, 173568}; + +} // namespace unilib +} // namespace ufal +/* end file src/unilib/uninorms.cpp */ + +namespace ada::idna { + +void normalize(std::u32string& input) { + // [Normalize](https://www.unicode.org/reports/tr46/#ProcessingStepNormalize). + // Normalize + // the domain_name string to Unicode Normalization Form C. + ufal::unilib::uninorms::nfc(input); +} - ada_really_inline bool parse_prepared_path(std::string_view input, ada::scheme::type type, std::string& path) { - ada_log("parse_path ", input); - uint8_t accumulator = checkers::path_signature(input); - // Let us first detect a trivial case. - // If it is special, we check that we have no dot, no %, no \ and no - // character needing percent encoding. Otherwise, we check that we have no %, - // no dot, and no character needing percent encoding. - bool special = type != ada::scheme::NOT_SPECIAL; - bool trivial_path = - (special ? (accumulator == 0) : ((accumulator & 0b11111101) == 0)) && - (type != ada::scheme::type::FILE); - if (trivial_path) { - ada_log("parse_path trivial"); - path += '/'; - path += input; - return true; - } - // We are going to need to look a bit at the path, but let us see if we can - // ignore percent encoding *and* backslashes *and* percent characters. - // Except for the trivial case, this is likely to capture 99% of paths out - // there. - bool fast_path = (special && (accumulator & 0b11111011) == 0) && - (type != ada::scheme::type::FILE); - if (fast_path) { - ada_log("parse_path fast"); - // Here we don't need to worry about \ or percent encoding. - // We also do not have a file protocol. We might have dots, however, - // but dots must as appear as '.', and they cannot be encoded because - // the symbol '%' is not present. - size_t previous_location = 0; // We start at 0. - do { - size_t new_location = input.find('/', previous_location); - //std::string_view path_view = input; - // We process the last segment separately: - if (new_location == std::string_view::npos) { - std::string_view path_view = input.substr(previous_location); - if (path_view == "..") { // The path ends with .. - // e.g., if you receive ".." with an empty path, you go to "/". - if(path.empty()) { path = '/'; return true; } - // Fast case where we have nothing to do: - if(path.back() == '/') { return true; } - // If you have the path "/joe/myfriend", - // then you delete 'myfriend'. - path.resize(path.rfind('/') + 1); - return true; - } - path += '/'; - if (path_view != ".") { - path.append(path_view); - } - return true; - } else { - // This is a non-final segment. - std::string_view path_view = input.substr(previous_location, new_location - previous_location); - previous_location = new_location + 1; - if (path_view == "..") { - if(!path.empty()) { path.erase(path.rfind('/')); } - } else if (path_view != ".") { - path += '/'; - path.append(path_view); - } - } - } while (true); - } else { - ada_log("parse_path slow"); - // we have reached the general case - bool needs_percent_encoding = (accumulator & 1); - std::string path_buffer_tmp; - do { - size_t location = (special && (accumulator & 2)) - ? input.find_first_of("/\\") - : input.find('/'); - std::string_view path_view = input; - if (location != std::string_view::npos) { - path_view.remove_suffix(path_view.size() - location); - input.remove_prefix(location + 1); - } - // path_buffer is either path_view or it might point at a percent encoded temporary file. - std::string_view path_buffer = - (needs_percent_encoding - && ada::unicode::percent_encode(path_view, character_sets::PATH_PERCENT_ENCODE, path_buffer_tmp)) ? - path_buffer_tmp : - path_view; - if (unicode::is_double_dot_path_segment(path_buffer)) { - helpers::shorten_path(path, type); - if (location == std::string_view::npos) { - path += '/'; - } - } else if (unicode::is_single_dot_path_segment(path_buffer) && - (location == std::string_view::npos)) { - path += '/'; - } - // Otherwise, if path_buffer is not a single-dot path segment, then: - else if (!unicode::is_single_dot_path_segment(path_buffer)) { - // If url’s scheme is "file", url’s path is empty, and path_buffer is a - // Windows drive letter, then replace the second code point in - // path_buffer with U+003A (:). - if (type == ada::scheme::type::FILE && path.empty() && - checkers::is_windows_drive_letter(path_buffer)) { - path += '/'; - path += path_buffer[0]; - path += ':'; - path_buffer.remove_prefix(2); - path.append(path_buffer); - } else { - // Append path_buffer to url’s path. - path += '/'; - path.append(path_buffer); - } - } - if (location == std::string_view::npos) { - return true; - } - } while (true); - } - } - - ada_really_inline void strip_trailing_spaces_from_opaque_path(ada::url& url) noexcept { - if (!url.has_opaque_path) return; - if (url.fragment.has_value()) return; - if (url.query.has_value()) return; - while (!url.path.empty() && url.path.back() == ' ') { url.path.resize(url.path.size()-1); } - } - - ada_really_inline size_t find_authority_delimiter_special(std::string_view view) noexcept { - auto has_zero_byte = [](uint64_t v) { - return ((v - 0x0101010101010101) & ~(v)&0x8080808080808080); - }; - auto index_of_first_set_byte = [](uint64_t v) { - return ((((v - 1) & 0x101010101010101) * 0x101010101010101) >> 56) - 1; - }; - auto broadcast = [](uint8_t v) -> uint64_t { return 0x101010101010101 * v; }; - size_t i = 0; - uint64_t mask1 = broadcast('@'); - uint64_t mask2 = broadcast('/'); - uint64_t mask3 = broadcast('?'); - uint64_t mask4 = broadcast('\\'); - - for (; i + 7 < view.size(); i += 8) { - uint64_t word{}; - memcpy(&word, view.data() + i, sizeof(word)); - word = swap_bytes_if_big_endian(word); - uint64_t xor1 = word ^ mask1; - uint64_t xor2 = word ^ mask2; - uint64_t xor3 = word ^ mask3; - uint64_t xor4 = word ^ mask4; - uint64_t is_match = has_zero_byte(xor1) | has_zero_byte(xor2) | has_zero_byte(xor3) | has_zero_byte(xor4); - if (is_match) { - return i + index_of_first_set_byte(is_match); - } - } - - if (i < view.size()) { - uint64_t word{}; - memcpy(&word, view.data() + i, view.size() - i); - word = swap_bytes_if_big_endian(word); - uint64_t xor1 = word ^ mask1; - uint64_t xor2 = word ^ mask2; - uint64_t xor3 = word ^ mask3; - uint64_t xor4 = word ^ mask4; - uint64_t is_match = has_zero_byte(xor1) | has_zero_byte(xor2) | has_zero_byte(xor3) | has_zero_byte(xor4); - if (is_match) { - return i + index_of_first_set_byte(is_match); - } - } - - return view.size(); - } - - ada_really_inline size_t find_authority_delimiter(std::string_view view) noexcept { - auto has_zero_byte = [](uint64_t v) { - return ((v - 0x0101010101010101) & ~(v)&0x8080808080808080); - }; - auto index_of_first_set_byte = [](uint64_t v) { - return ((((v - 1) & 0x101010101010101) * 0x101010101010101) >> 56) - 1; - }; - auto broadcast = [](uint8_t v) -> uint64_t { return 0x101010101010101 * v; }; - size_t i = 0; - uint64_t mask1 = broadcast('@'); - uint64_t mask2 = broadcast('/'); - uint64_t mask3 = broadcast('?'); - - for (; i + 7 < view.size(); i += 8) { - uint64_t word{}; - memcpy(&word, view.data() + i, sizeof(word)); - word = swap_bytes_if_big_endian(word); - uint64_t xor1 = word ^ mask1; - uint64_t xor2 = word ^ mask2; - uint64_t xor3 = word ^ mask3; - uint64_t is_match = has_zero_byte(xor1) | has_zero_byte(xor2) | has_zero_byte(xor3); - if (is_match) { - return i + index_of_first_set_byte(is_match); - } - } - - if (i < view.size()) { - uint64_t word{}; - memcpy(&word, view.data() + i, view.size() - i); - word = swap_bytes_if_big_endian(word); - uint64_t xor1 = word ^ mask1; - uint64_t xor2 = word ^ mask2; - uint64_t xor3 = word ^ mask3; - uint64_t is_match = has_zero_byte(xor1) | has_zero_byte(xor2) | has_zero_byte(xor3); - if (is_match) { - return i + index_of_first_set_byte(is_match); - } - } - - return view.size(); - } -} // namespace ada::helpers +} // namespace ada::idna +/* end file src/normalization.cpp */ +/* begin file src/punycode.cpp */ -namespace ada { - ada_warn_unused std::string to_string(ada::state state) { - return ada::helpers::get_state(state); - } +#include + +namespace ada::idna { + +constexpr int32_t base = 36; +constexpr int32_t tmin = 1; +constexpr int32_t tmax = 26; +constexpr int32_t skew = 38; +constexpr int32_t damp = 700; +constexpr int32_t initial_bias = 72; +constexpr uint32_t initial_n = 128; + +static constexpr int32_t char_to_digit_value(char value) { + if (value >= 'a' && value <= 'z') return value - 'a'; + if (value >= '0' && value <= '9') return value - '0' + 26; + return -1; } -/* end file src/helpers.cpp */ -// dofile: invoked with prepath=/Users/dlemire/CVS/github/ada/src, filename=url.cpp -/* begin file src/url.cpp */ -#include -#include -#include +static constexpr char digit_to_char(int32_t digit) { + return digit < 26 ? char(digit + 97) : char(digit + 22); +} -namespace ada { - ada_really_inline bool url::parse_path(std::string_view input) { - ada_log("parse_path ", input); - std::string tmp_buffer; - std::string_view internal_input; - if(unicode::has_tabs_or_newline(input)) { - tmp_buffer = input; - // Optimization opportunity: Instead of copying and then pruning, we could just directly - // build the string from user_input. - helpers::remove_ascii_tab_or_newline(tmp_buffer); - internal_input = tmp_buffer; - } else { - internal_input = input; - } +static constexpr int32_t adapt(int32_t d, int32_t n, bool firsttime) { + if (firsttime) { + d = d / damp; + } else { + d = d / 2; + } + d += d / n; + int32_t k = 0; + while (d > ((base - tmin) * tmax) / 2) { + d /= base - tmin; + k += base; + } + return k + (((base - tmin + 1) * d) / (d + skew)); +} - // If url is special, then: - if (is_special()) { - if(internal_input.empty()) { - path = "/"; - } else if((internal_input[0] == '/') ||(internal_input[0] == '\\')){ - return helpers::parse_prepared_path(internal_input.substr(1), get_scheme_type(), path); - } else { - return helpers::parse_prepared_path(internal_input, get_scheme_type(), path); +bool punycode_to_utf32(std::string_view input, std::u32string &out) { + int32_t written_out{0}; + out.reserve(out.size() + input.size()); + uint32_t n = initial_n; + int32_t i = 0; + int32_t bias = initial_bias; + // grab ascii content + size_t end_of_ascii = input.find_last_of('-'); + if (end_of_ascii != std::string_view::npos) { + for (uint8_t c : input.substr(0, end_of_ascii)) { + if (c >= 0x80) { + return false; } - } else if (!internal_input.empty()) { - if(internal_input[0] == '/') { - return helpers::parse_prepared_path(internal_input.substr(1), get_scheme_type(), path); - } else { - return helpers::parse_prepared_path(internal_input, get_scheme_type(), path); + out.push_back(c); + written_out++; + } + input.remove_prefix(end_of_ascii + 1); + } + while (!input.empty()) { + int32_t oldi = i; + int32_t w = 1; + for (int32_t k = base;; k += base) { + if (input.empty()) { + return false; } - } else { - if(!host.has_value()) { - path = "/"; + uint8_t code_point = input.front(); + input.remove_prefix(1); + int32_t digit = char_to_digit_value(code_point); + if (digit < 0) { + return false; + } + if (digit > (0x7fffffff - i) / w) { + return false; + } + i = i + digit * w; + int32_t t = k <= bias ? tmin : k >= bias + tmax ? tmax : k - bias; + if (digit < t) { + break; + } + if (w > 0x7fffffff / (base - t)) { + return false; } + w = w * (base - t); } - return true; + bias = adapt(i - oldi, written_out + 1, oldi == 0); + if (i / (written_out + 1) > int32_t(0x7fffffff - n)) { + return false; + } + n = n + i / (written_out + 1); + i = i % (written_out + 1); + if (n < 0x80) { + return false; + } + out.insert(out.begin() + i, n); + written_out++; + ++i; } - bool url::parse_opaque_host(std::string_view input) { - ada_log("parse_opaque_host ", input, "[", input.size(), " bytes]"); - if (std::any_of(input.begin(), input.end(), ada::unicode::is_forbidden_host_code_point)) { - return is_valid = false; - } + return true; +} - // Return the result of running UTF-8 percent-encode on input using the C0 control percent-encode set. - host = ada::unicode::percent_encode(input, ada::character_sets::C0_CONTROL_PERCENT_ENCODE); - return true; - } - - bool url::parse_ipv4(std::string_view input) { - ada_log("parse_ipv4 ", input, "[", input.size(), " bytes]"); - if(input.back()=='.') { - input.remove_suffix(1); - } - size_t digit_count{0}; - int pure_decimal_count = 0; // entries that are decimal - std::string_view original_input = input; // we might use this if pure_decimal_count == 4. - uint64_t ipv4{0}; - // we could unroll for better performance? - for(;(digit_count < 4) && !(input.empty()); digit_count++) { - uint32_t segment_result{}; // If any number exceeds 32 bits, we have an error. - bool is_hex = checkers::has_hex_prefix(input); - if(is_hex && ((input.length() == 2)|| ((input.length() > 2) && (input[2]=='.')))) { - // special case - segment_result = 0; - input.remove_prefix(2); - } else { - std::from_chars_result r; - if(is_hex) { - r = std::from_chars(input.data() + 2, input.data() + input.size(), segment_result, 16); - } else if ((input.length() >= 2) && input[0] == '0' && checkers::is_digit(input[1])) { - r = std::from_chars(input.data() + 1, input.data() + input.size(), segment_result, 8); - } else { - pure_decimal_count++; - r = std::from_chars(input.data(), input.data() + input.size(), segment_result, 10); - } - if (r.ec != std::errc()) { return is_valid = false; } - input.remove_prefix(r.ptr-input.data()); - } - if(input.empty()) { - // We have the last value. - // At this stage, ipv4 contains digit_count*8 bits. - // So we have 32-digit_count*8 bits left. - if(segment_result > (uint64_t(1)<<(32-digit_count*8))) { return is_valid = false; } - ipv4 <<=(32-digit_count*8); - ipv4 |= segment_result; - goto final; - } else { - // There is more, so that the value must no be larger than 255 - // and we must have a '.'. - if ((segment_result>255) || (input[0]!='.')) { return is_valid = false; } - ipv4 <<=8; - ipv4 |= segment_result; - input.remove_prefix(1); // remove '.' - } - } - if((digit_count != 4) || (!input.empty())) {return is_valid = false; } - final: - // We could also check r.ptr to see where the parsing ended. - if(pure_decimal_count == 4) { - host = original_input; // The original input was already all decimal and we validated it. - } else { - host = ada::serializers::ipv4(ipv4); // We have to reserialize the address. +bool verify_punycode(std::string_view input) { + size_t written_out{0}; + uint32_t n = initial_n; + int32_t i = 0; + int32_t bias = initial_bias; + // grab ascii content + size_t end_of_ascii = input.find_last_of('-'); + if (end_of_ascii != std::string_view::npos) { + for (uint8_t c : input.substr(0, end_of_ascii)) { + if (c >= 0x80) { + return false; + } + written_out++; } - return true; + input.remove_prefix(end_of_ascii + 1); } - - bool url::parse_ipv6(std::string_view input) { - ada_log("parse_ipv6 ", input, "[", input.size(), " bytes]"); - - if(input.empty()) { return is_valid = false; } - // Let address be a new IPv6 address whose IPv6 pieces are all 0. - std::array address{}; - - // Let pieceIndex be 0. - int piece_index = 0; - - // Let compress be null. - std::optional compress{}; - - // Let pointer be a pointer for input. - std::string_view::iterator pointer = input.begin(); - - // If c is U+003A (:), then: - if (input[0] == ':') { - // If remaining does not start with U+003A (:), validation error, return failure. - if(input.size() == 1 || input[1] != ':') { - ada_log("parse_ipv6 starts with : but the rest does not start with :"); - return is_valid = false; + while (!input.empty()) { + int32_t oldi = i; + int32_t w = 1; + for (int32_t k = base;; k += base) { + if (input.empty()) { + return false; + } + uint8_t code_point = input.front(); + input.remove_prefix(1); + int32_t digit = char_to_digit_value(code_point); + if (digit < 0) { + return false; + } + if (digit > (0x7fffffff - i) / w) { + return false; } + i = i + digit * w; + int32_t t = k <= bias ? tmin : k >= bias + tmax ? tmax : k - bias; + if (digit < t) { + break; + } + if (w > 0x7fffffff / (base - t)) { + return false; + } + w = w * (base - t); + } + bias = adapt(i - oldi, int32_t(written_out + 1), oldi == 0); + if (i / (written_out + 1) > 0x7fffffff - n) { + return false; + } + n = n + i / int32_t(written_out + 1); + i = i % int32_t(written_out + 1); + if (n < 0x80) { + return false; + } + written_out++; + ++i; + } - // Increase pointer by 2. - pointer += 2; + return true; +} - // Increase pieceIndex by 1 and then set compress to pieceIndex. - compress = ++piece_index; +bool utf32_to_punycode(std::u32string_view input, std::string &out) { + out.reserve(input.size() + out.size()); + uint32_t n = initial_n; + int32_t d = 0; + int32_t bias = initial_bias; + size_t h = 0; + // first push the ascii content + for (uint32_t c : input) { + if (c < 0x80) { + ++h; + out.push_back(char(c)); + } + if (c > 0x10ffff || (c >= 0xd880 && c < 0xe000)) { + return false; + } + } + size_t b = h; + if (b > 0) { + out.push_back('-'); + } + while (h < input.size()) { + uint32_t m = 0x10FFFF; + for (auto code_point : input) { + if (code_point >= n && code_point < m) m = code_point; } - // While c is not the EOF code point: - while (pointer != input.end()) { - // If pieceIndex is 8, validation error, return failure. - if (piece_index == 8) { - ada_log("parse_ipv6 piece_index == 8"); - return is_valid = false; + if ((m - n) > (0x7fffffff - d) / (h + 1)) { + return false; + } + d = d + int32_t((m - n) * (h + 1)); + n = m; + for (auto c : input) { + if (c < n) { + if (d == 0x7fffffff) { + return false; + } + ++d; } + if (c == n) { + int32_t q = d; + for (int32_t k = base;; k += base) { + int32_t t = k <= bias ? tmin : k >= bias + tmax ? tmax : k - bias; - // If c is U+003A (:), then: - if (*pointer == ':') { - // If compress is non-null, validation error, return failure. - if (compress.has_value()) { - ada_log("parse_ipv6 compress is non-null"); - return is_valid = false; + if (q < t) { + break; + } + out.push_back(digit_to_char(t + ((q - t) % (base - t)))); + q = (q - t) / (base - t); } - - // Increase pointer and pieceIndex by 1, set compress to pieceIndex, and then continue. - pointer++; - compress = ++piece_index; - continue; + out.push_back(digit_to_char(q)); + bias = adapt(d, int32_t(h + 1), h == b); + d = 0; + ++h; } + } + ++d; + ++n; + } + return true; +} - // Let value and length be 0. - uint16_t value = 0, length = 0; +} // namespace ada::idna +/* end file src/punycode.cpp */ +/* begin file src/validity.cpp */ - // While length is less than 4 and c is an ASCII hex digit, - // set value to value × 0x10 + c interpreted as hexadecimal number, and increase pointer and length by 1. - while (length < 4 && pointer != input.end() && unicode::is_ascii_hex_digit(*pointer)) { - // https://stackoverflow.com/questions/39060852/why-does-the-addition-of-two-shorts-return-an-int - value = uint16_t(value * 0x10 + unicode::convert_hex_to_binary(*pointer)); - pointer++; - length++; - } +#include +#include - // If c is U+002E (.), then: - if (pointer != input.end() && *pointer == '.') { - // If length is 0, validation error, return failure. - if (length == 0) { - ada_log("parse_ipv6 length is 0"); - return is_valid = false; - } +namespace ada::idna { + +enum direction : uint8_t { + NONE, + BN, + CS, + ES, + ON, + EN, + L, + R, + NSM, + AL, + AN, + ET, + WS, + RLO, + LRO, + PDF, + RLE, + RLI, + FSI, + PDI, + LRI, + B, + S, + LRE +}; + +struct directions { + uint32_t start_code; + uint32_t final_code; + direction direct; +}; + +static directions dir_table[] = { + {0x0, 0x8, direction::BN}, {0x9, 0x9, direction::S}, + {0xa, 0xa, direction::B}, {0xb, 0xb, direction::S}, + {0xc, 0xc, direction::WS}, {0xd, 0xd, direction::B}, + {0xe, 0x1b, direction::BN}, {0x1c, 0x1e, direction::B}, + {0x1f, 0x1f, direction::S}, {0x20, 0x20, direction::WS}, + {0x21, 0x22, direction::ON}, {0x23, 0x25, direction::ET}, + {0x26, 0x2a, direction::ON}, {0x2b, 0x2b, direction::ES}, + {0x2c, 0x2c, direction::CS}, {0x2d, 0x2d, direction::ES}, + {0x2e, 0x2f, direction::CS}, {0x30, 0x39, direction::EN}, + {0x3a, 0x3a, direction::CS}, {0x3b, 0x40, direction::ON}, + {0x41, 0x5a, direction::L}, {0x5b, 0x60, direction::ON}, + {0x61, 0x7a, direction::L}, {0x7b, 0x7e, direction::ON}, + {0x7f, 0x84, direction::BN}, {0x85, 0x85, direction::B}, + {0x86, 0x9f, direction::BN}, {0xa0, 0xa0, direction::CS}, + {0xa1, 0xa1, direction::ON}, {0xa2, 0xa5, direction::ET}, + {0xa6, 0xa9, direction::ON}, {0xaa, 0xaa, direction::L}, + {0xab, 0xac, direction::ON}, {0xad, 0xad, direction::BN}, + {0xae, 0xaf, direction::ON}, {0xb0, 0xb1, direction::ET}, + {0xb2, 0xb3, direction::EN}, {0xb4, 0xb4, direction::ON}, + {0xb5, 0xb5, direction::L}, {0xb6, 0xb8, direction::ON}, + {0xb9, 0xb9, direction::EN}, {0xba, 0xba, direction::L}, + {0xbb, 0xbf, direction::ON}, {0xc0, 0xd6, direction::L}, + {0xd7, 0xd7, direction::ON}, {0xd8, 0xf6, direction::L}, + {0xf7, 0xf7, direction::ON}, {0xf8, 0x2b8, direction::L}, + {0x2b9, 0x2ba, direction::ON}, {0x2bb, 0x2c1, direction::L}, + {0x2c2, 0x2cf, direction::ON}, {0x2d0, 0x2d1, direction::L}, + {0x2d2, 0x2df, direction::ON}, {0x2e0, 0x2e4, direction::L}, + {0x2e5, 0x2ed, direction::ON}, {0x2ee, 0x2ee, direction::L}, + {0x2ef, 0x2ff, direction::ON}, {0x300, 0x36f, direction::NSM}, + {0x370, 0x373, direction::L}, {0x374, 0x375, direction::ON}, + {0x376, 0x377, direction::L}, {0x37a, 0x37d, direction::L}, + {0x37e, 0x37e, direction::ON}, {0x37f, 0x37f, direction::L}, + {0x384, 0x385, direction::ON}, {0x386, 0x386, direction::L}, + {0x387, 0x387, direction::ON}, {0x388, 0x38a, direction::L}, + {0x38c, 0x38c, direction::L}, {0x38e, 0x3a1, direction::L}, + {0x3a3, 0x3f5, direction::L}, {0x3f6, 0x3f6, direction::ON}, + {0x3f7, 0x482, direction::L}, {0x483, 0x489, direction::NSM}, + {0x48a, 0x52f, direction::L}, {0x531, 0x556, direction::L}, + {0x559, 0x589, direction::L}, {0x58a, 0x58a, direction::ON}, + {0x58d, 0x58e, direction::ON}, {0x58f, 0x58f, direction::ET}, + {0x591, 0x5bd, direction::NSM}, {0x5be, 0x5be, direction::R}, + {0x5bf, 0x5bf, direction::NSM}, {0x5c0, 0x5c0, direction::R}, + {0x5c1, 0x5c2, direction::NSM}, {0x5c3, 0x5c3, direction::R}, + {0x5c4, 0x5c5, direction::NSM}, {0x5c6, 0x5c6, direction::R}, + {0x5c7, 0x5c7, direction::NSM}, {0x5d0, 0x5ea, direction::R}, + {0x5ef, 0x5f4, direction::R}, {0x600, 0x605, direction::AN}, + {0x606, 0x607, direction::ON}, {0x608, 0x608, direction::AL}, + {0x609, 0x60a, direction::ET}, {0x60b, 0x60b, direction::AL}, + {0x60c, 0x60c, direction::CS}, {0x60d, 0x60d, direction::AL}, + {0x60e, 0x60f, direction::ON}, {0x610, 0x61a, direction::NSM}, + {0x61b, 0x61c, direction::AL}, {0x61e, 0x64a, direction::AL}, + {0x64b, 0x65f, direction::NSM}, {0x660, 0x669, direction::AN}, + {0x66a, 0x66a, direction::ET}, {0x66b, 0x66c, direction::AN}, + {0x66d, 0x66f, direction::AL}, {0x670, 0x670, direction::NSM}, + {0x671, 0x6d5, direction::AL}, {0x6d6, 0x6dc, direction::NSM}, + {0x6dd, 0x6dd, direction::AN}, {0x6de, 0x6de, direction::ON}, + {0x6df, 0x6e4, direction::NSM}, {0x6e5, 0x6e6, direction::AL}, + {0x6e7, 0x6e8, direction::NSM}, {0x6e9, 0x6e9, direction::ON}, + {0x6ea, 0x6ed, direction::NSM}, {0x6ee, 0x6ef, direction::AL}, + {0x6f0, 0x6f9, direction::EN}, {0x6fa, 0x70d, direction::AL}, + {0x70f, 0x710, direction::AL}, {0x711, 0x711, direction::NSM}, + {0x712, 0x72f, direction::AL}, {0x730, 0x74a, direction::NSM}, + {0x74d, 0x7a5, direction::AL}, {0x7a6, 0x7b0, direction::NSM}, + {0x7b1, 0x7b1, direction::AL}, {0x7c0, 0x7ea, direction::R}, + {0x7eb, 0x7f3, direction::NSM}, {0x7f4, 0x7f5, direction::R}, + {0x7f6, 0x7f9, direction::ON}, {0x7fa, 0x7fa, direction::R}, + {0x7fd, 0x7fd, direction::NSM}, {0x7fe, 0x815, direction::R}, + {0x816, 0x819, direction::NSM}, {0x81a, 0x81a, direction::R}, + {0x81b, 0x823, direction::NSM}, {0x824, 0x824, direction::R}, + {0x825, 0x827, direction::NSM}, {0x828, 0x828, direction::R}, + {0x829, 0x82d, direction::NSM}, {0x830, 0x83e, direction::R}, + {0x840, 0x858, direction::R}, {0x859, 0x85b, direction::NSM}, + {0x85e, 0x85e, direction::R}, {0x860, 0x86a, direction::AL}, + {0x8a0, 0x8b4, direction::AL}, {0x8b6, 0x8c7, direction::AL}, + {0x8d3, 0x8e1, direction::NSM}, {0x8e2, 0x8e2, direction::AN}, + {0x8e3, 0x902, direction::NSM}, {0x903, 0x939, direction::L}, + {0x93a, 0x93a, direction::NSM}, {0x93b, 0x93b, direction::L}, + {0x93c, 0x93c, direction::NSM}, {0x93d, 0x940, direction::L}, + {0x941, 0x948, direction::NSM}, {0x949, 0x94c, direction::L}, + {0x94d, 0x94d, direction::NSM}, {0x94e, 0x950, direction::L}, + {0x951, 0x957, direction::NSM}, {0x958, 0x961, direction::L}, + {0x962, 0x963, direction::NSM}, {0x964, 0x980, direction::L}, + {0x981, 0x981, direction::NSM}, {0x982, 0x983, direction::L}, + {0x985, 0x98c, direction::L}, {0x98f, 0x990, direction::L}, + {0x993, 0x9a8, direction::L}, {0x9aa, 0x9b0, direction::L}, + {0x9b2, 0x9b2, direction::L}, {0x9b6, 0x9b9, direction::L}, + {0x9bc, 0x9bc, direction::NSM}, {0x9bd, 0x9c0, direction::L}, + {0x9c1, 0x9c4, direction::NSM}, {0x9c7, 0x9c8, direction::L}, + {0x9cb, 0x9cc, direction::L}, {0x9cd, 0x9cd, direction::NSM}, + {0x9ce, 0x9ce, direction::L}, {0x9d7, 0x9d7, direction::L}, + {0x9dc, 0x9dd, direction::L}, {0x9df, 0x9e1, direction::L}, + {0x9e2, 0x9e3, direction::NSM}, {0x9e6, 0x9f1, direction::L}, + {0x9f2, 0x9f3, direction::ET}, {0x9f4, 0x9fa, direction::L}, + {0x9fb, 0x9fb, direction::ET}, {0x9fc, 0x9fd, direction::L}, + {0x9fe, 0x9fe, direction::NSM}, {0xa01, 0xa02, direction::NSM}, + {0xa03, 0xa03, direction::L}, {0xa05, 0xa0a, direction::L}, + {0xa0f, 0xa10, direction::L}, {0xa13, 0xa28, direction::L}, + {0xa2a, 0xa30, direction::L}, {0xa32, 0xa33, direction::L}, + {0xa35, 0xa36, direction::L}, {0xa38, 0xa39, direction::L}, + {0xa3c, 0xa3c, direction::NSM}, {0xa3e, 0xa40, direction::L}, + {0xa41, 0xa42, direction::NSM}, {0xa47, 0xa48, direction::NSM}, + {0xa4b, 0xa4d, direction::NSM}, {0xa51, 0xa51, direction::NSM}, + {0xa59, 0xa5c, direction::L}, {0xa5e, 0xa5e, direction::L}, + {0xa66, 0xa6f, direction::L}, {0xa70, 0xa71, direction::NSM}, + {0xa72, 0xa74, direction::L}, {0xa75, 0xa75, direction::NSM}, + {0xa76, 0xa76, direction::L}, {0xa81, 0xa82, direction::NSM}, + {0xa83, 0xa83, direction::L}, {0xa85, 0xa8d, direction::L}, + {0xa8f, 0xa91, direction::L}, {0xa93, 0xaa8, direction::L}, + {0xaaa, 0xab0, direction::L}, {0xab2, 0xab3, direction::L}, + {0xab5, 0xab9, direction::L}, {0xabc, 0xabc, direction::NSM}, + {0xabd, 0xac0, direction::L}, {0xac1, 0xac5, direction::NSM}, + {0xac7, 0xac8, direction::NSM}, {0xac9, 0xac9, direction::L}, + {0xacb, 0xacc, direction::L}, {0xacd, 0xacd, direction::NSM}, + {0xad0, 0xad0, direction::L}, {0xae0, 0xae1, direction::L}, + {0xae2, 0xae3, direction::NSM}, {0xae6, 0xaf0, direction::L}, + {0xaf1, 0xaf1, direction::ET}, {0xaf9, 0xaf9, direction::L}, + {0xafa, 0xaff, direction::NSM}, {0xb01, 0xb01, direction::NSM}, + {0xb02, 0xb03, direction::L}, {0xb05, 0xb0c, direction::L}, + {0xb0f, 0xb10, direction::L}, {0xb13, 0xb28, direction::L}, + {0xb2a, 0xb30, direction::L}, {0xb32, 0xb33, direction::L}, + {0xb35, 0xb39, direction::L}, {0xb3c, 0xb3c, direction::NSM}, + {0xb3d, 0xb3e, direction::L}, {0xb3f, 0xb3f, direction::NSM}, + {0xb40, 0xb40, direction::L}, {0xb41, 0xb44, direction::NSM}, + {0xb47, 0xb48, direction::L}, {0xb4b, 0xb4c, direction::L}, + {0xb4d, 0xb4d, direction::NSM}, {0xb55, 0xb56, direction::NSM}, + {0xb57, 0xb57, direction::L}, {0xb5c, 0xb5d, direction::L}, + {0xb5f, 0xb61, direction::L}, {0xb62, 0xb63, direction::NSM}, + {0xb66, 0xb77, direction::L}, {0xb82, 0xb82, direction::NSM}, + {0xb83, 0xb83, direction::L}, {0xb85, 0xb8a, direction::L}, + {0xb8e, 0xb90, direction::L}, {0xb92, 0xb95, direction::L}, + {0xb99, 0xb9a, direction::L}, {0xb9c, 0xb9c, direction::L}, + {0xb9e, 0xb9f, direction::L}, {0xba3, 0xba4, direction::L}, + {0xba8, 0xbaa, direction::L}, {0xbae, 0xbb9, direction::L}, + {0xbbe, 0xbbf, direction::L}, {0xbc0, 0xbc0, direction::NSM}, + {0xbc1, 0xbc2, direction::L}, {0xbc6, 0xbc8, direction::L}, + {0xbca, 0xbcc, direction::L}, {0xbcd, 0xbcd, direction::NSM}, + {0xbd0, 0xbd0, direction::L}, {0xbd7, 0xbd7, direction::L}, + {0xbe6, 0xbf2, direction::L}, {0xbf3, 0xbf8, direction::ON}, + {0xbf9, 0xbf9, direction::ET}, {0xbfa, 0xbfa, direction::ON}, + {0xc00, 0xc00, direction::NSM}, {0xc01, 0xc03, direction::L}, + {0xc04, 0xc04, direction::NSM}, {0xc05, 0xc0c, direction::L}, + {0xc0e, 0xc10, direction::L}, {0xc12, 0xc28, direction::L}, + {0xc2a, 0xc39, direction::L}, {0xc3d, 0xc3d, direction::L}, + {0xc3e, 0xc40, direction::NSM}, {0xc41, 0xc44, direction::L}, + {0xc46, 0xc48, direction::NSM}, {0xc4a, 0xc4d, direction::NSM}, + {0xc55, 0xc56, direction::NSM}, {0xc58, 0xc5a, direction::L}, + {0xc60, 0xc61, direction::L}, {0xc62, 0xc63, direction::NSM}, + {0xc66, 0xc6f, direction::L}, {0xc77, 0xc77, direction::L}, + {0xc78, 0xc7e, direction::ON}, {0xc7f, 0xc80, direction::L}, + {0xc81, 0xc81, direction::NSM}, {0xc82, 0xc8c, direction::L}, + {0xc8e, 0xc90, direction::L}, {0xc92, 0xca8, direction::L}, + {0xcaa, 0xcb3, direction::L}, {0xcb5, 0xcb9, direction::L}, + {0xcbc, 0xcbc, direction::NSM}, {0xcbd, 0xcc4, direction::L}, + {0xcc6, 0xcc8, direction::L}, {0xcca, 0xccb, direction::L}, + {0xccc, 0xccd, direction::NSM}, {0xcd5, 0xcd6, direction::L}, + {0xcde, 0xcde, direction::L}, {0xce0, 0xce1, direction::L}, + {0xce2, 0xce3, direction::NSM}, {0xce6, 0xcef, direction::L}, + {0xcf1, 0xcf2, direction::L}, {0xd00, 0xd01, direction::NSM}, + {0xd02, 0xd0c, direction::L}, {0xd0e, 0xd10, direction::L}, + {0xd12, 0xd3a, direction::L}, {0xd3b, 0xd3c, direction::NSM}, + {0xd3d, 0xd40, direction::L}, {0xd41, 0xd44, direction::NSM}, + {0xd46, 0xd48, direction::L}, {0xd4a, 0xd4c, direction::L}, + {0xd4d, 0xd4d, direction::NSM}, {0xd4e, 0xd4f, direction::L}, + {0xd54, 0xd61, direction::L}, {0xd62, 0xd63, direction::NSM}, + {0xd66, 0xd7f, direction::L}, {0xd81, 0xd81, direction::NSM}, + {0xd82, 0xd83, direction::L}, {0xd85, 0xd96, direction::L}, + {0xd9a, 0xdb1, direction::L}, {0xdb3, 0xdbb, direction::L}, + {0xdbd, 0xdbd, direction::L}, {0xdc0, 0xdc6, direction::L}, + {0xdca, 0xdca, direction::NSM}, {0xdcf, 0xdd1, direction::L}, + {0xdd2, 0xdd4, direction::NSM}, {0xdd6, 0xdd6, direction::NSM}, + {0xdd8, 0xddf, direction::L}, {0xde6, 0xdef, direction::L}, + {0xdf2, 0xdf4, direction::L}, {0xe01, 0xe30, direction::L}, + {0xe31, 0xe31, direction::NSM}, {0xe32, 0xe33, direction::L}, + {0xe34, 0xe3a, direction::NSM}, {0xe3f, 0xe3f, direction::ET}, + {0xe40, 0xe46, direction::L}, {0xe47, 0xe4e, direction::NSM}, + {0xe4f, 0xe5b, direction::L}, {0xe81, 0xe82, direction::L}, + {0xe84, 0xe84, direction::L}, {0xe86, 0xe8a, direction::L}, + {0xe8c, 0xea3, direction::L}, {0xea5, 0xea5, direction::L}, + {0xea7, 0xeb0, direction::L}, {0xeb1, 0xeb1, direction::NSM}, + {0xeb2, 0xeb3, direction::L}, {0xeb4, 0xebc, direction::NSM}, + {0xebd, 0xebd, direction::L}, {0xec0, 0xec4, direction::L}, + {0xec6, 0xec6, direction::L}, {0xec8, 0xecd, direction::NSM}, + {0xed0, 0xed9, direction::L}, {0xedc, 0xedf, direction::L}, + {0xf00, 0xf17, direction::L}, {0xf18, 0xf19, direction::NSM}, + {0xf1a, 0xf34, direction::L}, {0xf35, 0xf35, direction::NSM}, + {0xf36, 0xf36, direction::L}, {0xf37, 0xf37, direction::NSM}, + {0xf38, 0xf38, direction::L}, {0xf39, 0xf39, direction::NSM}, + {0xf3a, 0xf3d, direction::ON}, {0xf3e, 0xf47, direction::L}, + {0xf49, 0xf6c, direction::L}, {0xf71, 0xf7e, direction::NSM}, + {0xf7f, 0xf7f, direction::L}, {0xf80, 0xf84, direction::NSM}, + {0xf85, 0xf85, direction::L}, {0xf86, 0xf87, direction::NSM}, + {0xf88, 0xf8c, direction::L}, {0xf8d, 0xf97, direction::NSM}, + {0xf99, 0xfbc, direction::NSM}, {0xfbe, 0xfc5, direction::L}, + {0xfc6, 0xfc6, direction::NSM}, {0xfc7, 0xfcc, direction::L}, + {0xfce, 0xfda, direction::L}, {0x1000, 0x102c, direction::L}, + {0x102d, 0x1030, direction::NSM}, {0x1031, 0x1031, direction::L}, + {0x1032, 0x1037, direction::NSM}, {0x1038, 0x1038, direction::L}, + {0x1039, 0x103a, direction::NSM}, {0x103b, 0x103c, direction::L}, + {0x103d, 0x103e, direction::NSM}, {0x103f, 0x1057, direction::L}, + {0x1058, 0x1059, direction::NSM}, {0x105a, 0x105d, direction::L}, + {0x105e, 0x1060, direction::NSM}, {0x1061, 0x1070, direction::L}, + {0x1071, 0x1074, direction::NSM}, {0x1075, 0x1081, direction::L}, + {0x1082, 0x1082, direction::NSM}, {0x1083, 0x1084, direction::L}, + {0x1085, 0x1086, direction::NSM}, {0x1087, 0x108c, direction::L}, + {0x108d, 0x108d, direction::NSM}, {0x108e, 0x109c, direction::L}, + {0x109d, 0x109d, direction::NSM}, {0x109e, 0x10c5, direction::L}, + {0x10c7, 0x10c7, direction::L}, {0x10cd, 0x10cd, direction::L}, + {0x10d0, 0x1248, direction::L}, {0x124a, 0x124d, direction::L}, + {0x1250, 0x1256, direction::L}, {0x1258, 0x1258, direction::L}, + {0x125a, 0x125d, direction::L}, {0x1260, 0x1288, direction::L}, + {0x128a, 0x128d, direction::L}, {0x1290, 0x12b0, direction::L}, + {0x12b2, 0x12b5, direction::L}, {0x12b8, 0x12be, direction::L}, + {0x12c0, 0x12c0, direction::L}, {0x12c2, 0x12c5, direction::L}, + {0x12c8, 0x12d6, direction::L}, {0x12d8, 0x1310, direction::L}, + {0x1312, 0x1315, direction::L}, {0x1318, 0x135a, direction::L}, + {0x135d, 0x135f, direction::NSM}, {0x1360, 0x137c, direction::L}, + {0x1380, 0x138f, direction::L}, {0x1390, 0x1399, direction::ON}, + {0x13a0, 0x13f5, direction::L}, {0x13f8, 0x13fd, direction::L}, + {0x1400, 0x1400, direction::ON}, {0x1401, 0x167f, direction::L}, + {0x1680, 0x1680, direction::WS}, {0x1681, 0x169a, direction::L}, + {0x169b, 0x169c, direction::ON}, {0x16a0, 0x16f8, direction::L}, + {0x1700, 0x170c, direction::L}, {0x170e, 0x1711, direction::L}, + {0x1712, 0x1714, direction::NSM}, {0x1720, 0x1731, direction::L}, + {0x1732, 0x1734, direction::NSM}, {0x1735, 0x1736, direction::L}, + {0x1740, 0x1751, direction::L}, {0x1752, 0x1753, direction::NSM}, + {0x1760, 0x176c, direction::L}, {0x176e, 0x1770, direction::L}, + {0x1772, 0x1773, direction::NSM}, {0x1780, 0x17b3, direction::L}, + {0x17b4, 0x17b5, direction::NSM}, {0x17b6, 0x17b6, direction::L}, + {0x17b7, 0x17bd, direction::NSM}, {0x17be, 0x17c5, direction::L}, + {0x17c6, 0x17c6, direction::NSM}, {0x17c7, 0x17c8, direction::L}, + {0x17c9, 0x17d3, direction::NSM}, {0x17d4, 0x17da, direction::L}, + {0x17db, 0x17db, direction::ET}, {0x17dc, 0x17dc, direction::L}, + {0x17dd, 0x17dd, direction::NSM}, {0x17e0, 0x17e9, direction::L}, + {0x17f0, 0x17f9, direction::ON}, {0x1800, 0x180a, direction::ON}, + {0x180b, 0x180d, direction::NSM}, {0x180e, 0x180e, direction::BN}, + {0x1810, 0x1819, direction::L}, {0x1820, 0x1878, direction::L}, + {0x1880, 0x1884, direction::L}, {0x1885, 0x1886, direction::NSM}, + {0x1887, 0x18a8, direction::L}, {0x18a9, 0x18a9, direction::NSM}, + {0x18aa, 0x18aa, direction::L}, {0x18b0, 0x18f5, direction::L}, + {0x1900, 0x191e, direction::L}, {0x1920, 0x1922, direction::NSM}, + {0x1923, 0x1926, direction::L}, {0x1927, 0x1928, direction::NSM}, + {0x1929, 0x192b, direction::L}, {0x1930, 0x1931, direction::L}, + {0x1932, 0x1932, direction::NSM}, {0x1933, 0x1938, direction::L}, + {0x1939, 0x193b, direction::NSM}, {0x1940, 0x1940, direction::ON}, + {0x1944, 0x1945, direction::ON}, {0x1946, 0x196d, direction::L}, + {0x1970, 0x1974, direction::L}, {0x1980, 0x19ab, direction::L}, + {0x19b0, 0x19c9, direction::L}, {0x19d0, 0x19da, direction::L}, + {0x19de, 0x19ff, direction::ON}, {0x1a00, 0x1a16, direction::L}, + {0x1a17, 0x1a18, direction::NSM}, {0x1a19, 0x1a1a, direction::L}, + {0x1a1b, 0x1a1b, direction::NSM}, {0x1a1e, 0x1a55, direction::L}, + {0x1a56, 0x1a56, direction::NSM}, {0x1a57, 0x1a57, direction::L}, + {0x1a58, 0x1a5e, direction::NSM}, {0x1a60, 0x1a60, direction::NSM}, + {0x1a61, 0x1a61, direction::L}, {0x1a62, 0x1a62, direction::NSM}, + {0x1a63, 0x1a64, direction::L}, {0x1a65, 0x1a6c, direction::NSM}, + {0x1a6d, 0x1a72, direction::L}, {0x1a73, 0x1a7c, direction::NSM}, + {0x1a7f, 0x1a7f, direction::NSM}, {0x1a80, 0x1a89, direction::L}, + {0x1a90, 0x1a99, direction::L}, {0x1aa0, 0x1aad, direction::L}, + {0x1ab0, 0x1ac0, direction::NSM}, {0x1b00, 0x1b03, direction::NSM}, + {0x1b04, 0x1b33, direction::L}, {0x1b34, 0x1b34, direction::NSM}, + {0x1b35, 0x1b35, direction::L}, {0x1b36, 0x1b3a, direction::NSM}, + {0x1b3b, 0x1b3b, direction::L}, {0x1b3c, 0x1b3c, direction::NSM}, + {0x1b3d, 0x1b41, direction::L}, {0x1b42, 0x1b42, direction::NSM}, + {0x1b43, 0x1b4b, direction::L}, {0x1b50, 0x1b6a, direction::L}, + {0x1b6b, 0x1b73, direction::NSM}, {0x1b74, 0x1b7c, direction::L}, + {0x1b80, 0x1b81, direction::NSM}, {0x1b82, 0x1ba1, direction::L}, + {0x1ba2, 0x1ba5, direction::NSM}, {0x1ba6, 0x1ba7, direction::L}, + {0x1ba8, 0x1ba9, direction::NSM}, {0x1baa, 0x1baa, direction::L}, + {0x1bab, 0x1bad, direction::NSM}, {0x1bae, 0x1be5, direction::L}, + {0x1be6, 0x1be6, direction::NSM}, {0x1be7, 0x1be7, direction::L}, + {0x1be8, 0x1be9, direction::NSM}, {0x1bea, 0x1bec, direction::L}, + {0x1bed, 0x1bed, direction::NSM}, {0x1bee, 0x1bee, direction::L}, + {0x1bef, 0x1bf1, direction::NSM}, {0x1bf2, 0x1bf3, direction::L}, + {0x1bfc, 0x1c2b, direction::L}, {0x1c2c, 0x1c33, direction::NSM}, + {0x1c34, 0x1c35, direction::L}, {0x1c36, 0x1c37, direction::NSM}, + {0x1c3b, 0x1c49, direction::L}, {0x1c4d, 0x1c88, direction::L}, + {0x1c90, 0x1cba, direction::L}, {0x1cbd, 0x1cc7, direction::L}, + {0x1cd0, 0x1cd2, direction::NSM}, {0x1cd3, 0x1cd3, direction::L}, + {0x1cd4, 0x1ce0, direction::NSM}, {0x1ce1, 0x1ce1, direction::L}, + {0x1ce2, 0x1ce8, direction::NSM}, {0x1ce9, 0x1cec, direction::L}, + {0x1ced, 0x1ced, direction::NSM}, {0x1cee, 0x1cf3, direction::L}, + {0x1cf4, 0x1cf4, direction::NSM}, {0x1cf5, 0x1cf7, direction::L}, + {0x1cf8, 0x1cf9, direction::NSM}, {0x1cfa, 0x1cfa, direction::L}, + {0x1d00, 0x1dbf, direction::L}, {0x1dc0, 0x1df9, direction::NSM}, + {0x1dfb, 0x1dff, direction::NSM}, {0x1e00, 0x1f15, direction::L}, + {0x1f18, 0x1f1d, direction::L}, {0x1f20, 0x1f45, direction::L}, + {0x1f48, 0x1f4d, direction::L}, {0x1f50, 0x1f57, direction::L}, + {0x1f59, 0x1f59, direction::L}, {0x1f5b, 0x1f5b, direction::L}, + {0x1f5d, 0x1f5d, direction::L}, {0x1f5f, 0x1f7d, direction::L}, + {0x1f80, 0x1fb4, direction::L}, {0x1fb6, 0x1fbc, direction::L}, + {0x1fbd, 0x1fbd, direction::ON}, {0x1fbe, 0x1fbe, direction::L}, + {0x1fbf, 0x1fc1, direction::ON}, {0x1fc2, 0x1fc4, direction::L}, + {0x1fc6, 0x1fcc, direction::L}, {0x1fcd, 0x1fcf, direction::ON}, + {0x1fd0, 0x1fd3, direction::L}, {0x1fd6, 0x1fdb, direction::L}, + {0x1fdd, 0x1fdf, direction::ON}, {0x1fe0, 0x1fec, direction::L}, + {0x1fed, 0x1fef, direction::ON}, {0x1ff2, 0x1ff4, direction::L}, + {0x1ff6, 0x1ffc, direction::L}, {0x1ffd, 0x1ffe, direction::ON}, + {0x2000, 0x200a, direction::WS}, {0x200b, 0x200d, direction::BN}, + {0x200e, 0x200e, direction::L}, {0x200f, 0x200f, direction::R}, + {0x2010, 0x2027, direction::ON}, {0x2028, 0x2028, direction::WS}, + {0x2029, 0x2029, direction::B}, {0x202a, 0x202a, direction::LRE}, + {0x202b, 0x202b, direction::RLE}, {0x202c, 0x202c, direction::PDF}, + {0x202d, 0x202d, direction::LRO}, {0x202e, 0x202e, direction::RLO}, + {0x202f, 0x202f, direction::CS}, {0x2030, 0x2034, direction::ET}, + {0x2035, 0x2043, direction::ON}, {0x2044, 0x2044, direction::CS}, + {0x2045, 0x205e, direction::ON}, {0x205f, 0x205f, direction::WS}, + {0x2060, 0x2064, direction::BN}, {0x2066, 0x2066, direction::LRI}, + {0x2067, 0x2067, direction::RLI}, {0x2068, 0x2068, direction::FSI}, + {0x2069, 0x2069, direction::PDI}, {0x206a, 0x206f, direction::BN}, + {0x2070, 0x2070, direction::EN}, {0x2071, 0x2071, direction::L}, + {0x2074, 0x2079, direction::EN}, {0x207a, 0x207b, direction::ES}, + {0x207c, 0x207e, direction::ON}, {0x207f, 0x207f, direction::L}, + {0x2080, 0x2089, direction::EN}, {0x208a, 0x208b, direction::ES}, + {0x208c, 0x208e, direction::ON}, {0x2090, 0x209c, direction::L}, + {0x20a0, 0x20bf, direction::ET}, {0x20d0, 0x20f0, direction::NSM}, + {0x2100, 0x2101, direction::ON}, {0x2102, 0x2102, direction::L}, + {0x2103, 0x2106, direction::ON}, {0x2107, 0x2107, direction::L}, + {0x2108, 0x2109, direction::ON}, {0x210a, 0x2113, direction::L}, + {0x2114, 0x2114, direction::ON}, {0x2115, 0x2115, direction::L}, + {0x2116, 0x2118, direction::ON}, {0x2119, 0x211d, direction::L}, + {0x211e, 0x2123, direction::ON}, {0x2124, 0x2124, direction::L}, + {0x2125, 0x2125, direction::ON}, {0x2126, 0x2126, direction::L}, + {0x2127, 0x2127, direction::ON}, {0x2128, 0x2128, direction::L}, + {0x2129, 0x2129, direction::ON}, {0x212a, 0x212d, direction::L}, + {0x212e, 0x212e, direction::ET}, {0x212f, 0x2139, direction::L}, + {0x213a, 0x213b, direction::ON}, {0x213c, 0x213f, direction::L}, + {0x2140, 0x2144, direction::ON}, {0x2145, 0x2149, direction::L}, + {0x214a, 0x214d, direction::ON}, {0x214e, 0x214f, direction::L}, + {0x2150, 0x215f, direction::ON}, {0x2160, 0x2188, direction::L}, + {0x2189, 0x218b, direction::ON}, {0x2190, 0x2211, direction::ON}, + {0x2212, 0x2212, direction::ES}, {0x2213, 0x2213, direction::ET}, + {0x2214, 0x2335, direction::ON}, {0x2336, 0x237a, direction::L}, + {0x237b, 0x2394, direction::ON}, {0x2395, 0x2395, direction::L}, + {0x2396, 0x2426, direction::ON}, {0x2440, 0x244a, direction::ON}, + {0x2460, 0x2487, direction::ON}, {0x2488, 0x249b, direction::EN}, + {0x249c, 0x24e9, direction::L}, {0x24ea, 0x26ab, direction::ON}, + {0x26ac, 0x26ac, direction::L}, {0x26ad, 0x27ff, direction::ON}, + {0x2800, 0x28ff, direction::L}, {0x2900, 0x2b73, direction::ON}, + {0x2b76, 0x2b95, direction::ON}, {0x2b97, 0x2bff, direction::ON}, + {0x2c00, 0x2c2e, direction::L}, {0x2c30, 0x2c5e, direction::L}, + {0x2c60, 0x2ce4, direction::L}, {0x2ce5, 0x2cea, direction::ON}, + {0x2ceb, 0x2cee, direction::L}, {0x2cef, 0x2cf1, direction::NSM}, + {0x2cf2, 0x2cf3, direction::L}, {0x2cf9, 0x2cff, direction::ON}, + {0x2d00, 0x2d25, direction::L}, {0x2d27, 0x2d27, direction::L}, + {0x2d2d, 0x2d2d, direction::L}, {0x2d30, 0x2d67, direction::L}, + {0x2d6f, 0x2d70, direction::L}, {0x2d7f, 0x2d7f, direction::NSM}, + {0x2d80, 0x2d96, direction::L}, {0x2da0, 0x2da6, direction::L}, + {0x2da8, 0x2dae, direction::L}, {0x2db0, 0x2db6, direction::L}, + {0x2db8, 0x2dbe, direction::L}, {0x2dc0, 0x2dc6, direction::L}, + {0x2dc8, 0x2dce, direction::L}, {0x2dd0, 0x2dd6, direction::L}, + {0x2dd8, 0x2dde, direction::L}, {0x2de0, 0x2dff, direction::NSM}, + {0x2e00, 0x2e52, direction::ON}, {0x2e80, 0x2e99, direction::ON}, + {0x2e9b, 0x2ef3, direction::ON}, {0x2f00, 0x2fd5, direction::ON}, + {0x2ff0, 0x2ffb, direction::ON}, {0x3000, 0x3000, direction::WS}, + {0x3001, 0x3004, direction::ON}, {0x3005, 0x3007, direction::L}, + {0x3008, 0x3020, direction::ON}, {0x3021, 0x3029, direction::L}, + {0x302a, 0x302d, direction::NSM}, {0x302e, 0x302f, direction::L}, + {0x3030, 0x3030, direction::ON}, {0x3031, 0x3035, direction::L}, + {0x3036, 0x3037, direction::ON}, {0x3038, 0x303c, direction::L}, + {0x303d, 0x303f, direction::ON}, {0x3041, 0x3096, direction::L}, + {0x3099, 0x309a, direction::NSM}, {0x309b, 0x309c, direction::ON}, + {0x309d, 0x309f, direction::L}, {0x30a0, 0x30a0, direction::ON}, + {0x30a1, 0x30fa, direction::L}, {0x30fb, 0x30fb, direction::ON}, + {0x30fc, 0x30ff, direction::L}, {0x3105, 0x312f, direction::L}, + {0x3131, 0x318e, direction::L}, {0x3190, 0x31bf, direction::L}, + {0x31c0, 0x31e3, direction::ON}, {0x31f0, 0x321c, direction::L}, + {0x321d, 0x321e, direction::ON}, {0x3220, 0x324f, direction::L}, + {0x3250, 0x325f, direction::ON}, {0x3260, 0x327b, direction::L}, + {0x327c, 0x327e, direction::ON}, {0x327f, 0x32b0, direction::L}, + {0x32b1, 0x32bf, direction::ON}, {0x32c0, 0x32cb, direction::L}, + {0x32cc, 0x32cf, direction::ON}, {0x32d0, 0x3376, direction::L}, + {0x3377, 0x337a, direction::ON}, {0x337b, 0x33dd, direction::L}, + {0x33de, 0x33df, direction::ON}, {0x33e0, 0x33fe, direction::L}, + {0x33ff, 0x33ff, direction::ON}, {0x3400, 0x4dbf, direction::L}, + {0x4dc0, 0x4dff, direction::ON}, {0x4e00, 0x9ffc, direction::L}, + {0xa000, 0xa48c, direction::L}, {0xa490, 0xa4c6, direction::ON}, + {0xa4d0, 0xa60c, direction::L}, {0xa60d, 0xa60f, direction::ON}, + {0xa610, 0xa62b, direction::L}, {0xa640, 0xa66e, direction::L}, + {0xa66f, 0xa672, direction::NSM}, {0xa673, 0xa673, direction::ON}, + {0xa674, 0xa67d, direction::NSM}, {0xa67e, 0xa67f, direction::ON}, + {0xa680, 0xa69d, direction::L}, {0xa69e, 0xa69f, direction::NSM}, + {0xa6a0, 0xa6ef, direction::L}, {0xa6f0, 0xa6f1, direction::NSM}, + {0xa6f2, 0xa6f7, direction::L}, {0xa700, 0xa721, direction::ON}, + {0xa722, 0xa787, direction::L}, {0xa788, 0xa788, direction::ON}, + {0xa789, 0xa7bf, direction::L}, {0xa7c2, 0xa7ca, direction::L}, + {0xa7f5, 0xa801, direction::L}, {0xa802, 0xa802, direction::NSM}, + {0xa803, 0xa805, direction::L}, {0xa806, 0xa806, direction::NSM}, + {0xa807, 0xa80a, direction::L}, {0xa80b, 0xa80b, direction::NSM}, + {0xa80c, 0xa824, direction::L}, {0xa825, 0xa826, direction::NSM}, + {0xa827, 0xa827, direction::L}, {0xa828, 0xa82b, direction::ON}, + {0xa82c, 0xa82c, direction::NSM}, {0xa830, 0xa837, direction::L}, + {0xa838, 0xa839, direction::ET}, {0xa840, 0xa873, direction::L}, + {0xa874, 0xa877, direction::ON}, {0xa880, 0xa8c3, direction::L}, + {0xa8c4, 0xa8c5, direction::NSM}, {0xa8ce, 0xa8d9, direction::L}, + {0xa8e0, 0xa8f1, direction::NSM}, {0xa8f2, 0xa8fe, direction::L}, + {0xa8ff, 0xa8ff, direction::NSM}, {0xa900, 0xa925, direction::L}, + {0xa926, 0xa92d, direction::NSM}, {0xa92e, 0xa946, direction::L}, + {0xa947, 0xa951, direction::NSM}, {0xa952, 0xa953, direction::L}, + {0xa95f, 0xa97c, direction::L}, {0xa980, 0xa982, direction::NSM}, + {0xa983, 0xa9b2, direction::L}, {0xa9b3, 0xa9b3, direction::NSM}, + {0xa9b4, 0xa9b5, direction::L}, {0xa9b6, 0xa9b9, direction::NSM}, + {0xa9ba, 0xa9bb, direction::L}, {0xa9bc, 0xa9bd, direction::NSM}, + {0xa9be, 0xa9cd, direction::L}, {0xa9cf, 0xa9d9, direction::L}, + {0xa9de, 0xa9e4, direction::L}, {0xa9e5, 0xa9e5, direction::NSM}, + {0xa9e6, 0xa9fe, direction::L}, {0xaa00, 0xaa28, direction::L}, + {0xaa29, 0xaa2e, direction::NSM}, {0xaa2f, 0xaa30, direction::L}, + {0xaa31, 0xaa32, direction::NSM}, {0xaa33, 0xaa34, direction::L}, + {0xaa35, 0xaa36, direction::NSM}, {0xaa40, 0xaa42, direction::L}, + {0xaa43, 0xaa43, direction::NSM}, {0xaa44, 0xaa4b, direction::L}, + {0xaa4c, 0xaa4c, direction::NSM}, {0xaa4d, 0xaa4d, direction::L}, + {0xaa50, 0xaa59, direction::L}, {0xaa5c, 0xaa7b, direction::L}, + {0xaa7c, 0xaa7c, direction::NSM}, {0xaa7d, 0xaaaf, direction::L}, + {0xaab0, 0xaab0, direction::NSM}, {0xaab1, 0xaab1, direction::L}, + {0xaab2, 0xaab4, direction::NSM}, {0xaab5, 0xaab6, direction::L}, + {0xaab7, 0xaab8, direction::NSM}, {0xaab9, 0xaabd, direction::L}, + {0xaabe, 0xaabf, direction::NSM}, {0xaac0, 0xaac0, direction::L}, + {0xaac1, 0xaac1, direction::NSM}, {0xaac2, 0xaac2, direction::L}, + {0xaadb, 0xaaeb, direction::L}, {0xaaec, 0xaaed, direction::NSM}, + {0xaaee, 0xaaf5, direction::L}, {0xaaf6, 0xaaf6, direction::NSM}, + {0xab01, 0xab06, direction::L}, {0xab09, 0xab0e, direction::L}, + {0xab11, 0xab16, direction::L}, {0xab20, 0xab26, direction::L}, + {0xab28, 0xab2e, direction::L}, {0xab30, 0xab69, direction::L}, + {0xab6a, 0xab6b, direction::ON}, {0xab70, 0xabe4, direction::L}, + {0xabe5, 0xabe5, direction::NSM}, {0xabe6, 0xabe7, direction::L}, + {0xabe8, 0xabe8, direction::NSM}, {0xabe9, 0xabec, direction::L}, + {0xabed, 0xabed, direction::NSM}, {0xabf0, 0xabf9, direction::L}, + {0xac00, 0xd7a3, direction::L}, {0xd7b0, 0xd7c6, direction::L}, + {0xd7cb, 0xd7fb, direction::L}, {0xd800, 0xfa6d, direction::L}, + {0xfa70, 0xfad9, direction::L}, {0xfb00, 0xfb06, direction::L}, + {0xfb13, 0xfb17, direction::L}, {0xfb1d, 0xfb1d, direction::R}, + {0xfb1e, 0xfb1e, direction::NSM}, {0xfb1f, 0xfb28, direction::R}, + {0xfb29, 0xfb29, direction::ES}, {0xfb2a, 0xfb36, direction::R}, + {0xfb38, 0xfb3c, direction::R}, {0xfb3e, 0xfb3e, direction::R}, + {0xfb40, 0xfb41, direction::R}, {0xfb43, 0xfb44, direction::R}, + {0xfb46, 0xfb4f, direction::R}, {0xfb50, 0xfbc1, direction::AL}, + {0xfbd3, 0xfd3d, direction::AL}, {0xfd3e, 0xfd3f, direction::ON}, + {0xfd50, 0xfd8f, direction::AL}, {0xfd92, 0xfdc7, direction::AL}, + {0xfdf0, 0xfdfc, direction::AL}, {0xfdfd, 0xfdfd, direction::ON}, + {0xfe00, 0xfe0f, direction::NSM}, {0xfe10, 0xfe19, direction::ON}, + {0xfe20, 0xfe2f, direction::NSM}, {0xfe30, 0xfe4f, direction::ON}, + {0xfe50, 0xfe50, direction::CS}, {0xfe51, 0xfe51, direction::ON}, + {0xfe52, 0xfe52, direction::CS}, {0xfe54, 0xfe54, direction::ON}, + {0xfe55, 0xfe55, direction::CS}, {0xfe56, 0xfe5e, direction::ON}, + {0xfe5f, 0xfe5f, direction::ET}, {0xfe60, 0xfe61, direction::ON}, + {0xfe62, 0xfe63, direction::ES}, {0xfe64, 0xfe66, direction::ON}, + {0xfe68, 0xfe68, direction::ON}, {0xfe69, 0xfe6a, direction::ET}, + {0xfe6b, 0xfe6b, direction::ON}, {0xfe70, 0xfe74, direction::AL}, + {0xfe76, 0xfefc, direction::AL}, {0xfeff, 0xfeff, direction::BN}, + {0xff01, 0xff02, direction::ON}, {0xff03, 0xff05, direction::ET}, + {0xff06, 0xff0a, direction::ON}, {0xff0b, 0xff0b, direction::ES}, + {0xff0c, 0xff0c, direction::CS}, {0xff0d, 0xff0d, direction::ES}, + {0xff0e, 0xff0f, direction::CS}, {0xff10, 0xff19, direction::EN}, + {0xff1a, 0xff1a, direction::CS}, {0xff1b, 0xff20, direction::ON}, + {0xff21, 0xff3a, direction::L}, {0xff3b, 0xff40, direction::ON}, + {0xff41, 0xff5a, direction::L}, {0xff5b, 0xff65, direction::ON}, + {0xff66, 0xffbe, direction::L}, {0xffc2, 0xffc7, direction::L}, + {0xffca, 0xffcf, direction::L}, {0xffd2, 0xffd7, direction::L}, + {0xffda, 0xffdc, direction::L}, {0xffe0, 0xffe1, direction::ET}, + {0xffe2, 0xffe4, direction::ON}, {0xffe5, 0xffe6, direction::ET}, + {0xffe8, 0xffee, direction::ON}, {0xfff9, 0xfffd, direction::ON}, + {0x10000, 0x1000b, direction::L}, {0x1000d, 0x10026, direction::L}, + {0x10028, 0x1003a, direction::L}, {0x1003c, 0x1003d, direction::L}, + {0x1003f, 0x1004d, direction::L}, {0x10050, 0x1005d, direction::L}, + {0x10080, 0x100fa, direction::L}, {0x10100, 0x10100, direction::L}, + {0x10101, 0x10101, direction::ON}, {0x10102, 0x10102, direction::L}, + {0x10107, 0x10133, direction::L}, {0x10137, 0x1013f, direction::L}, + {0x10140, 0x1018c, direction::ON}, {0x1018d, 0x1018e, direction::L}, + {0x10190, 0x1019c, direction::ON}, {0x101a0, 0x101a0, direction::ON}, + {0x101d0, 0x101fc, direction::L}, {0x101fd, 0x101fd, direction::NSM}, + {0x10280, 0x1029c, direction::L}, {0x102a0, 0x102d0, direction::L}, + {0x102e0, 0x102e0, direction::NSM}, {0x102e1, 0x102fb, direction::EN}, + {0x10300, 0x10323, direction::L}, {0x1032d, 0x1034a, direction::L}, + {0x10350, 0x10375, direction::L}, {0x10376, 0x1037a, direction::NSM}, + {0x10380, 0x1039d, direction::L}, {0x1039f, 0x103c3, direction::L}, + {0x103c8, 0x103d5, direction::L}, {0x10400, 0x1049d, direction::L}, + {0x104a0, 0x104a9, direction::L}, {0x104b0, 0x104d3, direction::L}, + {0x104d8, 0x104fb, direction::L}, {0x10500, 0x10527, direction::L}, + {0x10530, 0x10563, direction::L}, {0x1056f, 0x1056f, direction::L}, + {0x10600, 0x10736, direction::L}, {0x10740, 0x10755, direction::L}, + {0x10760, 0x10767, direction::L}, {0x10800, 0x10805, direction::R}, + {0x10808, 0x10808, direction::R}, {0x1080a, 0x10835, direction::R}, + {0x10837, 0x10838, direction::R}, {0x1083c, 0x1083c, direction::R}, + {0x1083f, 0x10855, direction::R}, {0x10857, 0x1089e, direction::R}, + {0x108a7, 0x108af, direction::R}, {0x108e0, 0x108f2, direction::R}, + {0x108f4, 0x108f5, direction::R}, {0x108fb, 0x1091b, direction::R}, + {0x1091f, 0x1091f, direction::ON}, {0x10920, 0x10939, direction::R}, + {0x1093f, 0x1093f, direction::R}, {0x10980, 0x109b7, direction::R}, + {0x109bc, 0x109cf, direction::R}, {0x109d2, 0x10a00, direction::R}, + {0x10a01, 0x10a03, direction::NSM}, {0x10a05, 0x10a06, direction::NSM}, + {0x10a0c, 0x10a0f, direction::NSM}, {0x10a10, 0x10a13, direction::R}, + {0x10a15, 0x10a17, direction::R}, {0x10a19, 0x10a35, direction::R}, + {0x10a38, 0x10a3a, direction::NSM}, {0x10a3f, 0x10a3f, direction::NSM}, + {0x10a40, 0x10a48, direction::R}, {0x10a50, 0x10a58, direction::R}, + {0x10a60, 0x10a9f, direction::R}, {0x10ac0, 0x10ae4, direction::R}, + {0x10ae5, 0x10ae6, direction::NSM}, {0x10aeb, 0x10af6, direction::R}, + {0x10b00, 0x10b35, direction::R}, {0x10b39, 0x10b3f, direction::ON}, + {0x10b40, 0x10b55, direction::R}, {0x10b58, 0x10b72, direction::R}, + {0x10b78, 0x10b91, direction::R}, {0x10b99, 0x10b9c, direction::R}, + {0x10ba9, 0x10baf, direction::R}, {0x10c00, 0x10c48, direction::R}, + {0x10c80, 0x10cb2, direction::R}, {0x10cc0, 0x10cf2, direction::R}, + {0x10cfa, 0x10cff, direction::R}, {0x10d00, 0x10d23, direction::AL}, + {0x10d24, 0x10d27, direction::NSM}, {0x10d30, 0x10d39, direction::AN}, + {0x10e60, 0x10e7e, direction::AN}, {0x10e80, 0x10ea9, direction::R}, + {0x10eab, 0x10eac, direction::NSM}, {0x10ead, 0x10ead, direction::R}, + {0x10eb0, 0x10eb1, direction::R}, {0x10f00, 0x10f27, direction::R}, + {0x10f30, 0x10f45, direction::AL}, {0x10f46, 0x10f50, direction::NSM}, + {0x10f51, 0x10f59, direction::AL}, {0x10fb0, 0x10fcb, direction::R}, + {0x10fe0, 0x10ff6, direction::R}, {0x11000, 0x11000, direction::L}, + {0x11001, 0x11001, direction::NSM}, {0x11002, 0x11037, direction::L}, + {0x11038, 0x11046, direction::NSM}, {0x11047, 0x1104d, direction::L}, + {0x11052, 0x11065, direction::ON}, {0x11066, 0x1106f, direction::L}, + {0x1107f, 0x11081, direction::NSM}, {0x11082, 0x110b2, direction::L}, + {0x110b3, 0x110b6, direction::NSM}, {0x110b7, 0x110b8, direction::L}, + {0x110b9, 0x110ba, direction::NSM}, {0x110bb, 0x110c1, direction::L}, + {0x110cd, 0x110cd, direction::L}, {0x110d0, 0x110e8, direction::L}, + {0x110f0, 0x110f9, direction::L}, {0x11100, 0x11102, direction::NSM}, + {0x11103, 0x11126, direction::L}, {0x11127, 0x1112b, direction::NSM}, + {0x1112c, 0x1112c, direction::L}, {0x1112d, 0x11134, direction::NSM}, + {0x11136, 0x11147, direction::L}, {0x11150, 0x11172, direction::L}, + {0x11173, 0x11173, direction::NSM}, {0x11174, 0x11176, direction::L}, + {0x11180, 0x11181, direction::NSM}, {0x11182, 0x111b5, direction::L}, + {0x111b6, 0x111be, direction::NSM}, {0x111bf, 0x111c8, direction::L}, + {0x111c9, 0x111cc, direction::NSM}, {0x111cd, 0x111ce, direction::L}, + {0x111cf, 0x111cf, direction::NSM}, {0x111d0, 0x111df, direction::L}, + {0x111e1, 0x111f4, direction::L}, {0x11200, 0x11211, direction::L}, + {0x11213, 0x1122e, direction::L}, {0x1122f, 0x11231, direction::NSM}, + {0x11232, 0x11233, direction::L}, {0x11234, 0x11234, direction::NSM}, + {0x11235, 0x11235, direction::L}, {0x11236, 0x11237, direction::NSM}, + {0x11238, 0x1123d, direction::L}, {0x1123e, 0x1123e, direction::NSM}, + {0x11280, 0x11286, direction::L}, {0x11288, 0x11288, direction::L}, + {0x1128a, 0x1128d, direction::L}, {0x1128f, 0x1129d, direction::L}, + {0x1129f, 0x112a9, direction::L}, {0x112b0, 0x112de, direction::L}, + {0x112df, 0x112df, direction::NSM}, {0x112e0, 0x112e2, direction::L}, + {0x112e3, 0x112ea, direction::NSM}, {0x112f0, 0x112f9, direction::L}, + {0x11300, 0x11301, direction::NSM}, {0x11302, 0x11303, direction::L}, + {0x11305, 0x1130c, direction::L}, {0x1130f, 0x11310, direction::L}, + {0x11313, 0x11328, direction::L}, {0x1132a, 0x11330, direction::L}, + {0x11332, 0x11333, direction::L}, {0x11335, 0x11339, direction::L}, + {0x1133b, 0x1133c, direction::NSM}, {0x1133d, 0x1133f, direction::L}, + {0x11340, 0x11340, direction::NSM}, {0x11341, 0x11344, direction::L}, + {0x11347, 0x11348, direction::L}, {0x1134b, 0x1134d, direction::L}, + {0x11350, 0x11350, direction::L}, {0x11357, 0x11357, direction::L}, + {0x1135d, 0x11363, direction::L}, {0x11366, 0x1136c, direction::NSM}, + {0x11370, 0x11374, direction::NSM}, {0x11400, 0x11437, direction::L}, + {0x11438, 0x1143f, direction::NSM}, {0x11440, 0x11441, direction::L}, + {0x11442, 0x11444, direction::NSM}, {0x11445, 0x11445, direction::L}, + {0x11446, 0x11446, direction::NSM}, {0x11447, 0x1145b, direction::L}, + {0x1145d, 0x1145d, direction::L}, {0x1145e, 0x1145e, direction::NSM}, + {0x1145f, 0x11461, direction::L}, {0x11480, 0x114b2, direction::L}, + {0x114b3, 0x114b8, direction::NSM}, {0x114b9, 0x114b9, direction::L}, + {0x114ba, 0x114ba, direction::NSM}, {0x114bb, 0x114be, direction::L}, + {0x114bf, 0x114c0, direction::NSM}, {0x114c1, 0x114c1, direction::L}, + {0x114c2, 0x114c3, direction::NSM}, {0x114c4, 0x114c7, direction::L}, + {0x114d0, 0x114d9, direction::L}, {0x11580, 0x115b1, direction::L}, + {0x115b2, 0x115b5, direction::NSM}, {0x115b8, 0x115bb, direction::L}, + {0x115bc, 0x115bd, direction::NSM}, {0x115be, 0x115be, direction::L}, + {0x115bf, 0x115c0, direction::NSM}, {0x115c1, 0x115db, direction::L}, + {0x115dc, 0x115dd, direction::NSM}, {0x11600, 0x11632, direction::L}, + {0x11633, 0x1163a, direction::NSM}, {0x1163b, 0x1163c, direction::L}, + {0x1163d, 0x1163d, direction::NSM}, {0x1163e, 0x1163e, direction::L}, + {0x1163f, 0x11640, direction::NSM}, {0x11641, 0x11644, direction::L}, + {0x11650, 0x11659, direction::L}, {0x11660, 0x1166c, direction::ON}, + {0x11680, 0x116aa, direction::L}, {0x116ab, 0x116ab, direction::NSM}, + {0x116ac, 0x116ac, direction::L}, {0x116ad, 0x116ad, direction::NSM}, + {0x116ae, 0x116af, direction::L}, {0x116b0, 0x116b5, direction::NSM}, + {0x116b6, 0x116b6, direction::L}, {0x116b7, 0x116b7, direction::NSM}, + {0x116b8, 0x116b8, direction::L}, {0x116c0, 0x116c9, direction::L}, + {0x11700, 0x1171a, direction::L}, {0x1171d, 0x1171f, direction::NSM}, + {0x11720, 0x11721, direction::L}, {0x11722, 0x11725, direction::NSM}, + {0x11726, 0x11726, direction::L}, {0x11727, 0x1172b, direction::NSM}, + {0x11730, 0x1173f, direction::L}, {0x11800, 0x1182e, direction::L}, + {0x1182f, 0x11837, direction::NSM}, {0x11838, 0x11838, direction::L}, + {0x11839, 0x1183a, direction::NSM}, {0x1183b, 0x1183b, direction::L}, + {0x118a0, 0x118f2, direction::L}, {0x118ff, 0x11906, direction::L}, + {0x11909, 0x11909, direction::L}, {0x1190c, 0x11913, direction::L}, + {0x11915, 0x11916, direction::L}, {0x11918, 0x11935, direction::L}, + {0x11937, 0x11938, direction::L}, {0x1193b, 0x1193c, direction::NSM}, + {0x1193d, 0x1193d, direction::L}, {0x1193e, 0x1193e, direction::NSM}, + {0x1193f, 0x11942, direction::L}, {0x11943, 0x11943, direction::NSM}, + {0x11944, 0x11946, direction::L}, {0x11950, 0x11959, direction::L}, + {0x119a0, 0x119a7, direction::L}, {0x119aa, 0x119d3, direction::L}, + {0x119d4, 0x119d7, direction::NSM}, {0x119da, 0x119db, direction::NSM}, + {0x119dc, 0x119df, direction::L}, {0x119e0, 0x119e0, direction::NSM}, + {0x119e1, 0x119e4, direction::L}, {0x11a00, 0x11a00, direction::L}, + {0x11a01, 0x11a06, direction::NSM}, {0x11a07, 0x11a08, direction::L}, + {0x11a09, 0x11a0a, direction::NSM}, {0x11a0b, 0x11a32, direction::L}, + {0x11a33, 0x11a38, direction::NSM}, {0x11a39, 0x11a3a, direction::L}, + {0x11a3b, 0x11a3e, direction::NSM}, {0x11a3f, 0x11a46, direction::L}, + {0x11a47, 0x11a47, direction::NSM}, {0x11a50, 0x11a50, direction::L}, + {0x11a51, 0x11a56, direction::NSM}, {0x11a57, 0x11a58, direction::L}, + {0x11a59, 0x11a5b, direction::NSM}, {0x11a5c, 0x11a89, direction::L}, + {0x11a8a, 0x11a96, direction::NSM}, {0x11a97, 0x11a97, direction::L}, + {0x11a98, 0x11a99, direction::NSM}, {0x11a9a, 0x11aa2, direction::L}, + {0x11ac0, 0x11af8, direction::L}, {0x11c00, 0x11c08, direction::L}, + {0x11c0a, 0x11c2f, direction::L}, {0x11c30, 0x11c36, direction::NSM}, + {0x11c38, 0x11c3d, direction::NSM}, {0x11c3e, 0x11c45, direction::L}, + {0x11c50, 0x11c6c, direction::L}, {0x11c70, 0x11c8f, direction::L}, + {0x11c92, 0x11ca7, direction::NSM}, {0x11ca9, 0x11ca9, direction::L}, + {0x11caa, 0x11cb0, direction::NSM}, {0x11cb1, 0x11cb1, direction::L}, + {0x11cb2, 0x11cb3, direction::NSM}, {0x11cb4, 0x11cb4, direction::L}, + {0x11cb5, 0x11cb6, direction::NSM}, {0x11d00, 0x11d06, direction::L}, + {0x11d08, 0x11d09, direction::L}, {0x11d0b, 0x11d30, direction::L}, + {0x11d31, 0x11d36, direction::NSM}, {0x11d3a, 0x11d3a, direction::NSM}, + {0x11d3c, 0x11d3d, direction::NSM}, {0x11d3f, 0x11d45, direction::NSM}, + {0x11d46, 0x11d46, direction::L}, {0x11d47, 0x11d47, direction::NSM}, + {0x11d50, 0x11d59, direction::L}, {0x11d60, 0x11d65, direction::L}, + {0x11d67, 0x11d68, direction::L}, {0x11d6a, 0x11d8e, direction::L}, + {0x11d90, 0x11d91, direction::NSM}, {0x11d93, 0x11d94, direction::L}, + {0x11d95, 0x11d95, direction::NSM}, {0x11d96, 0x11d96, direction::L}, + {0x11d97, 0x11d97, direction::NSM}, {0x11d98, 0x11d98, direction::L}, + {0x11da0, 0x11da9, direction::L}, {0x11ee0, 0x11ef2, direction::L}, + {0x11ef3, 0x11ef4, direction::NSM}, {0x11ef5, 0x11ef8, direction::L}, + {0x11fb0, 0x11fb0, direction::L}, {0x11fc0, 0x11fd4, direction::L}, + {0x11fd5, 0x11fdc, direction::ON}, {0x11fdd, 0x11fe0, direction::ET}, + {0x11fe1, 0x11ff1, direction::ON}, {0x11fff, 0x12399, direction::L}, + {0x12400, 0x1246e, direction::L}, {0x12470, 0x12474, direction::L}, + {0x12480, 0x12543, direction::L}, {0x13000, 0x1342e, direction::L}, + {0x13430, 0x13438, direction::L}, {0x14400, 0x14646, direction::L}, + {0x16800, 0x16a38, direction::L}, {0x16a40, 0x16a5e, direction::L}, + {0x16a60, 0x16a69, direction::L}, {0x16a6e, 0x16a6f, direction::L}, + {0x16ad0, 0x16aed, direction::L}, {0x16af0, 0x16af4, direction::NSM}, + {0x16af5, 0x16af5, direction::L}, {0x16b00, 0x16b2f, direction::L}, + {0x16b30, 0x16b36, direction::NSM}, {0x16b37, 0x16b45, direction::L}, + {0x16b50, 0x16b59, direction::L}, {0x16b5b, 0x16b61, direction::L}, + {0x16b63, 0x16b77, direction::L}, {0x16b7d, 0x16b8f, direction::L}, + {0x16e40, 0x16e9a, direction::L}, {0x16f00, 0x16f4a, direction::L}, + {0x16f4f, 0x16f4f, direction::NSM}, {0x16f50, 0x16f87, direction::L}, + {0x16f8f, 0x16f92, direction::NSM}, {0x16f93, 0x16f9f, direction::L}, + {0x16fe0, 0x16fe1, direction::L}, {0x16fe2, 0x16fe2, direction::ON}, + {0x16fe3, 0x16fe3, direction::L}, {0x16fe4, 0x16fe4, direction::NSM}, + {0x16ff0, 0x16ff1, direction::L}, {0x17000, 0x187f7, direction::L}, + {0x18800, 0x18cd5, direction::L}, {0x18d00, 0x18d08, direction::L}, + {0x1b000, 0x1b11e, direction::L}, {0x1b150, 0x1b152, direction::L}, + {0x1b164, 0x1b167, direction::L}, {0x1b170, 0x1b2fb, direction::L}, + {0x1bc00, 0x1bc6a, direction::L}, {0x1bc70, 0x1bc7c, direction::L}, + {0x1bc80, 0x1bc88, direction::L}, {0x1bc90, 0x1bc99, direction::L}, + {0x1bc9c, 0x1bc9c, direction::L}, {0x1bc9d, 0x1bc9e, direction::NSM}, + {0x1bc9f, 0x1bc9f, direction::L}, {0x1bca0, 0x1bca3, direction::BN}, + {0x1d000, 0x1d0f5, direction::L}, {0x1d100, 0x1d126, direction::L}, + {0x1d129, 0x1d166, direction::L}, {0x1d167, 0x1d169, direction::NSM}, + {0x1d16a, 0x1d172, direction::L}, {0x1d173, 0x1d17a, direction::BN}, + {0x1d17b, 0x1d182, direction::NSM}, {0x1d183, 0x1d184, direction::L}, + {0x1d185, 0x1d18b, direction::NSM}, {0x1d18c, 0x1d1a9, direction::L}, + {0x1d1aa, 0x1d1ad, direction::NSM}, {0x1d1ae, 0x1d1e8, direction::L}, + {0x1d200, 0x1d241, direction::ON}, {0x1d242, 0x1d244, direction::NSM}, + {0x1d245, 0x1d245, direction::ON}, {0x1d2e0, 0x1d2f3, direction::L}, + {0x1d300, 0x1d356, direction::ON}, {0x1d360, 0x1d378, direction::L}, + {0x1d400, 0x1d454, direction::L}, {0x1d456, 0x1d49c, direction::L}, + {0x1d49e, 0x1d49f, direction::L}, {0x1d4a2, 0x1d4a2, direction::L}, + {0x1d4a5, 0x1d4a6, direction::L}, {0x1d4a9, 0x1d4ac, direction::L}, + {0x1d4ae, 0x1d4b9, direction::L}, {0x1d4bb, 0x1d4bb, direction::L}, + {0x1d4bd, 0x1d4c3, direction::L}, {0x1d4c5, 0x1d505, direction::L}, + {0x1d507, 0x1d50a, direction::L}, {0x1d50d, 0x1d514, direction::L}, + {0x1d516, 0x1d51c, direction::L}, {0x1d51e, 0x1d539, direction::L}, + {0x1d53b, 0x1d53e, direction::L}, {0x1d540, 0x1d544, direction::L}, + {0x1d546, 0x1d546, direction::L}, {0x1d54a, 0x1d550, direction::L}, + {0x1d552, 0x1d6a5, direction::L}, {0x1d6a8, 0x1d6da, direction::L}, + {0x1d6db, 0x1d6db, direction::ON}, {0x1d6dc, 0x1d714, direction::L}, + {0x1d715, 0x1d715, direction::ON}, {0x1d716, 0x1d74e, direction::L}, + {0x1d74f, 0x1d74f, direction::ON}, {0x1d750, 0x1d788, direction::L}, + {0x1d789, 0x1d789, direction::ON}, {0x1d78a, 0x1d7c2, direction::L}, + {0x1d7c3, 0x1d7c3, direction::ON}, {0x1d7c4, 0x1d7cb, direction::L}, + {0x1d7ce, 0x1d7ff, direction::EN}, {0x1d800, 0x1d9ff, direction::L}, + {0x1da00, 0x1da36, direction::NSM}, {0x1da37, 0x1da3a, direction::L}, + {0x1da3b, 0x1da6c, direction::NSM}, {0x1da6d, 0x1da74, direction::L}, + {0x1da75, 0x1da75, direction::NSM}, {0x1da76, 0x1da83, direction::L}, + {0x1da84, 0x1da84, direction::NSM}, {0x1da85, 0x1da8b, direction::L}, + {0x1da9b, 0x1da9f, direction::NSM}, {0x1daa1, 0x1daaf, direction::NSM}, + {0x1e000, 0x1e006, direction::NSM}, {0x1e008, 0x1e018, direction::NSM}, + {0x1e01b, 0x1e021, direction::NSM}, {0x1e023, 0x1e024, direction::NSM}, + {0x1e026, 0x1e02a, direction::NSM}, {0x1e100, 0x1e12c, direction::L}, + {0x1e130, 0x1e136, direction::NSM}, {0x1e137, 0x1e13d, direction::L}, + {0x1e140, 0x1e149, direction::L}, {0x1e14e, 0x1e14f, direction::L}, + {0x1e2c0, 0x1e2eb, direction::L}, {0x1e2ec, 0x1e2ef, direction::NSM}, + {0x1e2f0, 0x1e2f9, direction::L}, {0x1e2ff, 0x1e2ff, direction::ET}, + {0x1e800, 0x1e8c4, direction::R}, {0x1e8c7, 0x1e8cf, direction::R}, + {0x1e8d0, 0x1e8d6, direction::NSM}, {0x1e900, 0x1e943, direction::R}, + {0x1e944, 0x1e94a, direction::NSM}, {0x1e94b, 0x1e94b, direction::R}, + {0x1e950, 0x1e959, direction::R}, {0x1e95e, 0x1e95f, direction::R}, + {0x1ec71, 0x1ecb4, direction::AL}, {0x1ed01, 0x1ed3d, direction::AL}, + {0x1ee00, 0x1ee03, direction::AL}, {0x1ee05, 0x1ee1f, direction::AL}, + {0x1ee21, 0x1ee22, direction::AL}, {0x1ee24, 0x1ee24, direction::AL}, + {0x1ee27, 0x1ee27, direction::AL}, {0x1ee29, 0x1ee32, direction::AL}, + {0x1ee34, 0x1ee37, direction::AL}, {0x1ee39, 0x1ee39, direction::AL}, + {0x1ee3b, 0x1ee3b, direction::AL}, {0x1ee42, 0x1ee42, direction::AL}, + {0x1ee47, 0x1ee47, direction::AL}, {0x1ee49, 0x1ee49, direction::AL}, + {0x1ee4b, 0x1ee4b, direction::AL}, {0x1ee4d, 0x1ee4f, direction::AL}, + {0x1ee51, 0x1ee52, direction::AL}, {0x1ee54, 0x1ee54, direction::AL}, + {0x1ee57, 0x1ee57, direction::AL}, {0x1ee59, 0x1ee59, direction::AL}, + {0x1ee5b, 0x1ee5b, direction::AL}, {0x1ee5d, 0x1ee5d, direction::AL}, + {0x1ee5f, 0x1ee5f, direction::AL}, {0x1ee61, 0x1ee62, direction::AL}, + {0x1ee64, 0x1ee64, direction::AL}, {0x1ee67, 0x1ee6a, direction::AL}, + {0x1ee6c, 0x1ee72, direction::AL}, {0x1ee74, 0x1ee77, direction::AL}, + {0x1ee79, 0x1ee7c, direction::AL}, {0x1ee7e, 0x1ee7e, direction::AL}, + {0x1ee80, 0x1ee89, direction::AL}, {0x1ee8b, 0x1ee9b, direction::AL}, + {0x1eea1, 0x1eea3, direction::AL}, {0x1eea5, 0x1eea9, direction::AL}, + {0x1eeab, 0x1eebb, direction::AL}, {0x1eef0, 0x1eef1, direction::ON}, + {0x1f000, 0x1f02b, direction::ON}, {0x1f030, 0x1f093, direction::ON}, + {0x1f0a0, 0x1f0ae, direction::ON}, {0x1f0b1, 0x1f0bf, direction::ON}, + {0x1f0c1, 0x1f0cf, direction::ON}, {0x1f0d1, 0x1f0f5, direction::ON}, + {0x1f100, 0x1f10a, direction::EN}, {0x1f10b, 0x1f10f, direction::ON}, + {0x1f110, 0x1f12e, direction::L}, {0x1f12f, 0x1f12f, direction::ON}, + {0x1f130, 0x1f169, direction::L}, {0x1f16a, 0x1f16f, direction::ON}, + {0x1f170, 0x1f1ac, direction::L}, {0x1f1ad, 0x1f1ad, direction::ON}, + {0x1f1e6, 0x1f202, direction::L}, {0x1f210, 0x1f23b, direction::L}, + {0x1f240, 0x1f248, direction::L}, {0x1f250, 0x1f251, direction::L}, + {0x1f260, 0x1f265, direction::ON}, {0x1f300, 0x1f6d7, direction::ON}, + {0x1f6e0, 0x1f6ec, direction::ON}, {0x1f6f0, 0x1f6fc, direction::ON}, + {0x1f700, 0x1f773, direction::ON}, {0x1f780, 0x1f7d8, direction::ON}, + {0x1f7e0, 0x1f7eb, direction::ON}, {0x1f800, 0x1f80b, direction::ON}, + {0x1f810, 0x1f847, direction::ON}, {0x1f850, 0x1f859, direction::ON}, + {0x1f860, 0x1f887, direction::ON}, {0x1f890, 0x1f8ad, direction::ON}, + {0x1f8b0, 0x1f8b1, direction::ON}, {0x1f900, 0x1f978, direction::ON}, + {0x1f97a, 0x1f9cb, direction::ON}, {0x1f9cd, 0x1fa53, direction::ON}, + {0x1fa60, 0x1fa6d, direction::ON}, {0x1fa70, 0x1fa74, direction::ON}, + {0x1fa78, 0x1fa7a, direction::ON}, {0x1fa80, 0x1fa86, direction::ON}, + {0x1fa90, 0x1faa8, direction::ON}, {0x1fab0, 0x1fab6, direction::ON}, + {0x1fac0, 0x1fac2, direction::ON}, {0x1fad0, 0x1fad6, direction::ON}, + {0x1fb00, 0x1fb92, direction::ON}, {0x1fb94, 0x1fbca, direction::ON}, + {0x1fbf0, 0x1fbf9, direction::EN}, {0x20000, 0x2a6dd, direction::L}, + {0x2a700, 0x2b734, direction::L}, {0x2b740, 0x2b81d, direction::L}, + {0x2b820, 0x2cea1, direction::L}, {0x2ceb0, 0x2ebe0, direction::L}, + {0x2f800, 0x2fa1d, direction::L}, {0x30000, 0x3134a, direction::L}, + {0xe0001, 0xe0001, direction::BN}, {0xe0020, 0xe007f, direction::BN}, + {0xe0100, 0xe01ef, direction::NSM}, {0xf0000, 0xffffd, direction::L}, + {0x100000, 0x10fffd, direction::L}}; + +// CheckJoiners and CheckBidi are true for URL specification. + +inline static direction find_direction(uint32_t code_point) noexcept { + auto it = std::lower_bound( + std::begin(dir_table), std::end(dir_table), code_point, + [](const directions& d, uint32_t c) { return d.final_code < c; }); + + // next check is almost surely in vain, but we use it for safety. + if (it == std::end(dir_table)) { + return direction::NONE; + } + // We have that d.final_code >= c. + if (code_point >= it->start_code) { + return it->direct; + } + return direction::NONE; +} - // Decrease pointer by length. - pointer -= length; +inline static size_t find_last_not_of_nsm( + const std::u32string_view label) noexcept { + for (int i = label.size() - 1; i >= 0; i--) + if (find_direction(label[i]) != direction::NSM) return i; - // If pieceIndex is greater than 6, validation error, return failure. - if (piece_index > 6) { - ada_log("parse_ipv6 piece_index > 6"); - return is_valid = false; - } + return std::u32string_view::npos; +} - // Let numbersSeen be 0. - int numbers_seen = 0; +// An RTL label is a label that contains at least one character of type R, AL, +// or AN. https://www.rfc-editor.org/rfc/rfc5893#section-2 +inline static bool is_rtl_label(const std::u32string_view label) noexcept { + const size_t mask = + (1u << direction::R) | (1u << direction::AL) | (1u << direction::AN); - // While c is not the EOF code point: - while (pointer != input.end()) { - // Let ipv4Piece be null. - std::optional ipv4_piece{}; + size_t directions = 0; + for (size_t i = 0; i < label.size(); i++) { + directions |= 1u << find_direction(label[i]); + } + return (directions & mask) != 0; +} - // If numbersSeen is greater than 0, then: - if (numbers_seen > 0) { - // If c is a U+002E (.) and numbersSeen is less than 4, then increase pointer by 1. - if (*pointer == '.' && numbers_seen < 4) { - pointer++; - } - // Otherwise, validation error, return failure. - else { - ada_log("parse_ipv6 Otherwise, validation error, return failure"); - return is_valid = false; - } - } +bool is_label_valid(const std::u32string_view label) { + if (label.empty()) { + return true; + } - // If c is not an ASCII digit, validation error, return failure. - if (pointer == input.end() || !checkers::is_digit(*pointer)) { - ada_log("parse_ipv6 If c is not an ASCII digit, validation error, return failure"); - return is_valid = false; - } + /////////////// + // We have a normalization step which ensures that we are in NFC. + // If we receive punycode, we normalize and check that the normalized + // version matches the original. + // -------------------------------------- + // The label must be in Unicode Normalization Form NFC. + + // Current URL standard indicatest that CheckHyphens is set to false. + // --------------------------------------- + // If CheckHyphens, the label must not contain a U+002D HYPHEN-MINUS character + // in both the third and fourth positions. If CheckHyphens, the label must + // neither begin nor end with a U+002D HYPHEN-MINUS character. + + // This is not necessary because we segment the + // labels by '.'. + // --------------------------------------- + // The label must not contain a U+002E ( . ) FULL STOP. + // if (label.find('.') != std::string_view::npos) return false; + + // The label must not begin with a combining mark, that is: + // General_Category=Mark. + constexpr static uint32_t combining[] = { + 0x300, 0x301, 0x302, 0x303, 0x304, 0x305, 0x306, 0x307, + 0x308, 0x309, 0x30a, 0x30b, 0x30c, 0x30d, 0x30e, 0x30f, + 0x310, 0x311, 0x312, 0x313, 0x314, 0x315, 0x316, 0x317, + 0x318, 0x319, 0x31a, 0x31b, 0x31c, 0x31d, 0x31e, 0x31f, + 0x320, 0x321, 0x322, 0x323, 0x324, 0x325, 0x326, 0x327, + 0x328, 0x329, 0x32a, 0x32b, 0x32c, 0x32d, 0x32e, 0x32f, + 0x330, 0x331, 0x332, 0x333, 0x334, 0x335, 0x336, 0x337, + 0x338, 0x339, 0x33a, 0x33b, 0x33c, 0x33d, 0x33e, 0x33f, + 0x340, 0x341, 0x342, 0x343, 0x344, 0x345, 0x346, 0x347, + 0x348, 0x349, 0x34a, 0x34b, 0x34c, 0x34d, 0x34e, 0x34f, + 0x350, 0x351, 0x352, 0x353, 0x354, 0x355, 0x356, 0x357, + 0x358, 0x359, 0x35a, 0x35b, 0x35c, 0x35d, 0x35e, 0x35f, + 0x360, 0x361, 0x362, 0x363, 0x364, 0x365, 0x366, 0x367, + 0x368, 0x369, 0x36a, 0x36b, 0x36c, 0x36d, 0x36e, 0x36f, + 0x483, 0x484, 0x485, 0x486, 0x487, 0x488, 0x489, 0x591, + 0x592, 0x593, 0x594, 0x595, 0x596, 0x597, 0x598, 0x599, + 0x59a, 0x59b, 0x59c, 0x59d, 0x59e, 0x59f, 0x5a0, 0x5a1, + 0x5a2, 0x5a3, 0x5a4, 0x5a5, 0x5a6, 0x5a7, 0x5a8, 0x5a9, + 0x5aa, 0x5ab, 0x5ac, 0x5ad, 0x5ae, 0x5af, 0x5b0, 0x5b1, + 0x5b2, 0x5b3, 0x5b4, 0x5b5, 0x5b6, 0x5b7, 0x5b8, 0x5b9, + 0x5ba, 0x5bb, 0x5bc, 0x5bd, 0x5bf, 0x5c1, 0x5c2, 0x5c4, + 0x5c5, 0x5c7, 0x610, 0x611, 0x612, 0x613, 0x614, 0x615, + 0x616, 0x617, 0x618, 0x619, 0x61a, 0x64b, 0x64c, 0x64d, + 0x64e, 0x64f, 0x650, 0x651, 0x652, 0x653, 0x654, 0x655, + 0x656, 0x657, 0x658, 0x659, 0x65a, 0x65b, 0x65c, 0x65d, + 0x65e, 0x65f, 0x670, 0x6d6, 0x6d7, 0x6d8, 0x6d9, 0x6da, + 0x6db, 0x6dc, 0x6df, 0x6e0, 0x6e1, 0x6e2, 0x6e3, 0x6e4, + 0x6e7, 0x6e8, 0x6ea, 0x6eb, 0x6ec, 0x6ed, 0x711, 0x730, + 0x731, 0x732, 0x733, 0x734, 0x735, 0x736, 0x737, 0x738, + 0x739, 0x73a, 0x73b, 0x73c, 0x73d, 0x73e, 0x73f, 0x740, + 0x741, 0x742, 0x743, 0x744, 0x745, 0x746, 0x747, 0x748, + 0x749, 0x74a, 0x7a6, 0x7a7, 0x7a8, 0x7a9, 0x7aa, 0x7ab, + 0x7ac, 0x7ad, 0x7ae, 0x7af, 0x7b0, 0x7eb, 0x7ec, 0x7ed, + 0x7ee, 0x7ef, 0x7f0, 0x7f1, 0x7f2, 0x7f3, 0x7fd, 0x816, + 0x817, 0x818, 0x819, 0x81b, 0x81c, 0x81d, 0x81e, 0x81f, + 0x820, 0x821, 0x822, 0x823, 0x825, 0x826, 0x827, 0x829, + 0x82a, 0x82b, 0x82c, 0x82d, 0x859, 0x85a, 0x85b, 0x8d3, + 0x8d4, 0x8d5, 0x8d6, 0x8d7, 0x8d8, 0x8d9, 0x8da, 0x8db, + 0x8dc, 0x8dd, 0x8de, 0x8df, 0x8e0, 0x8e1, 0x8e3, 0x8e4, + 0x8e5, 0x8e6, 0x8e7, 0x8e8, 0x8e9, 0x8ea, 0x8eb, 0x8ec, + 0x8ed, 0x8ee, 0x8ef, 0x8f0, 0x8f1, 0x8f2, 0x8f3, 0x8f4, + 0x8f5, 0x8f6, 0x8f7, 0x8f8, 0x8f9, 0x8fa, 0x8fb, 0x8fc, + 0x8fd, 0x8fe, 0x8ff, 0x900, 0x901, 0x902, 0x903, 0x93a, + 0x93b, 0x93c, 0x93e, 0x93f, 0x940, 0x941, 0x942, 0x943, + 0x944, 0x945, 0x946, 0x947, 0x948, 0x949, 0x94a, 0x94b, + 0x94c, 0x94d, 0x94e, 0x94f, 0x951, 0x952, 0x953, 0x954, + 0x955, 0x956, 0x957, 0x962, 0x963, 0x981, 0x982, 0x983, + 0x9bc, 0x9be, 0x9bf, 0x9c0, 0x9c1, 0x9c2, 0x9c3, 0x9c4, + 0x9c7, 0x9c8, 0x9cb, 0x9cc, 0x9cd, 0x9d7, 0x9e2, 0x9e3, + 0x9fe, 0xa01, 0xa02, 0xa03, 0xa3c, 0xa3e, 0xa3f, 0xa40, + 0xa41, 0xa42, 0xa47, 0xa48, 0xa4b, 0xa4c, 0xa4d, 0xa51, + 0xa70, 0xa71, 0xa75, 0xa81, 0xa82, 0xa83, 0xabc, 0xabe, + 0xabf, 0xac0, 0xac1, 0xac2, 0xac3, 0xac4, 0xac5, 0xac7, + 0xac8, 0xac9, 0xacb, 0xacc, 0xacd, 0xae2, 0xae3, 0xafa, + 0xafb, 0xafc, 0xafd, 0xafe, 0xaff, 0xb01, 0xb02, 0xb03, + 0xb3c, 0xb3e, 0xb3f, 0xb40, 0xb41, 0xb42, 0xb43, 0xb44, + 0xb47, 0xb48, 0xb4b, 0xb4c, 0xb4d, 0xb55, 0xb56, 0xb57, + 0xb62, 0xb63, 0xb82, 0xbbe, 0xbbf, 0xbc0, 0xbc1, 0xbc2, + 0xbc6, 0xbc7, 0xbc8, 0xbca, 0xbcb, 0xbcc, 0xbcd, 0xbd7, + 0xc00, 0xc01, 0xc02, 0xc03, 0xc04, 0xc3e, 0xc3f, 0xc40, + 0xc41, 0xc42, 0xc43, 0xc44, 0xc46, 0xc47, 0xc48, 0xc4a, + 0xc4b, 0xc4c, 0xc4d, 0xc55, 0xc56, 0xc62, 0xc63, 0xc81, + 0xc82, 0xc83, 0xcbc, 0xcbe, 0xcbf, 0xcc0, 0xcc1, 0xcc2, + 0xcc3, 0xcc4, 0xcc6, 0xcc7, 0xcc8, 0xcca, 0xccb, 0xccc, + 0xccd, 0xcd5, 0xcd6, 0xce2, 0xce3, 0xd00, 0xd01, 0xd02, + 0xd03, 0xd3b, 0xd3c, 0xd3e, 0xd3f, 0xd40, 0xd41, 0xd42, + 0xd43, 0xd44, 0xd46, 0xd47, 0xd48, 0xd4a, 0xd4b, 0xd4c, + 0xd4d, 0xd57, 0xd62, 0xd63, 0xd81, 0xd82, 0xd83, 0xdca, + 0xdcf, 0xdd0, 0xdd1, 0xdd2, 0xdd3, 0xdd4, 0xdd6, 0xdd8, + 0xdd9, 0xdda, 0xddb, 0xddc, 0xddd, 0xdde, 0xddf, 0xdf2, + 0xdf3, 0xe31, 0xe34, 0xe35, 0xe36, 0xe37, 0xe38, 0xe39, + 0xe3a, 0xe47, 0xe48, 0xe49, 0xe4a, 0xe4b, 0xe4c, 0xe4d, + 0xe4e, 0xeb1, 0xeb4, 0xeb5, 0xeb6, 0xeb7, 0xeb8, 0xeb9, + 0xeba, 0xebb, 0xebc, 0xec8, 0xec9, 0xeca, 0xecb, 0xecc, + 0xecd, 0xf18, 0xf19, 0xf35, 0xf37, 0xf39, 0xf3e, 0xf3f, + 0xf71, 0xf72, 0xf73, 0xf74, 0xf75, 0xf76, 0xf77, 0xf78, + 0xf79, 0xf7a, 0xf7b, 0xf7c, 0xf7d, 0xf7e, 0xf7f, 0xf80, + 0xf81, 0xf82, 0xf83, 0xf84, 0xf86, 0xf87, 0xf8d, 0xf8e, + 0xf8f, 0xf90, 0xf91, 0xf92, 0xf93, 0xf94, 0xf95, 0xf96, + 0xf97, 0xf99, 0xf9a, 0xf9b, 0xf9c, 0xf9d, 0xf9e, 0xf9f, + 0xfa0, 0xfa1, 0xfa2, 0xfa3, 0xfa4, 0xfa5, 0xfa6, 0xfa7, + 0xfa8, 0xfa9, 0xfaa, 0xfab, 0xfac, 0xfad, 0xfae, 0xfaf, + 0xfb0, 0xfb1, 0xfb2, 0xfb3, 0xfb4, 0xfb5, 0xfb6, 0xfb7, + 0xfb8, 0xfb9, 0xfba, 0xfbb, 0xfbc, 0xfc6, 0x102b, 0x102c, + 0x102d, 0x102e, 0x102f, 0x1030, 0x1031, 0x1032, 0x1033, 0x1034, + 0x1035, 0x1036, 0x1037, 0x1038, 0x1039, 0x103a, 0x103b, 0x103c, + 0x103d, 0x103e, 0x1056, 0x1057, 0x1058, 0x1059, 0x105e, 0x105f, + 0x1060, 0x1062, 0x1063, 0x1064, 0x1067, 0x1068, 0x1069, 0x106a, + 0x106b, 0x106c, 0x106d, 0x1071, 0x1072, 0x1073, 0x1074, 0x1082, + 0x1083, 0x1084, 0x1085, 0x1086, 0x1087, 0x1088, 0x1089, 0x108a, + 0x108b, 0x108c, 0x108d, 0x108f, 0x109a, 0x109b, 0x109c, 0x109d, + 0x135d, 0x135e, 0x135f, 0x1712, 0x1713, 0x1714, 0x1732, 0x1733, + 0x1734, 0x1752, 0x1753, 0x1772, 0x1773, 0x17b4, 0x17b5, 0x17b6, + 0x17b7, 0x17b8, 0x17b9, 0x17ba, 0x17bb, 0x17bc, 0x17bd, 0x17be, + 0x17bf, 0x17c0, 0x17c1, 0x17c2, 0x17c3, 0x17c4, 0x17c5, 0x17c6, + 0x17c7, 0x17c8, 0x17c9, 0x17ca, 0x17cb, 0x17cc, 0x17cd, 0x17ce, + 0x17cf, 0x17d0, 0x17d1, 0x17d2, 0x17d3, 0x17dd, 0x180b, 0x180c, + 0x180d, 0x1885, 0x1886, 0x18a9, 0x1920, 0x1921, 0x1922, 0x1923, + 0x1924, 0x1925, 0x1926, 0x1927, 0x1928, 0x1929, 0x192a, 0x192b, + 0x1930, 0x1931, 0x1932, 0x1933, 0x1934, 0x1935, 0x1936, 0x1937, + 0x1938, 0x1939, 0x193a, 0x193b, 0x1a17, 0x1a18, 0x1a19, 0x1a1a, + 0x1a1b, 0x1a55, 0x1a56, 0x1a57, 0x1a58, 0x1a59, 0x1a5a, 0x1a5b, + 0x1a5c, 0x1a5d, 0x1a5e, 0x1a60, 0x1a61, 0x1a62, 0x1a63, 0x1a64, + 0x1a65, 0x1a66, 0x1a67, 0x1a68, 0x1a69, 0x1a6a, 0x1a6b, 0x1a6c, + 0x1a6d, 0x1a6e, 0x1a6f, 0x1a70, 0x1a71, 0x1a72, 0x1a73, 0x1a74, + 0x1a75, 0x1a76, 0x1a77, 0x1a78, 0x1a79, 0x1a7a, 0x1a7b, 0x1a7c, + 0x1a7f, 0x1ab0, 0x1ab1, 0x1ab2, 0x1ab3, 0x1ab4, 0x1ab5, 0x1ab6, + 0x1ab7, 0x1ab8, 0x1ab9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dd0, 0x1dd1, 0x1dd2, 0x1dd3, 0x1dd4, 0x1dd5, 0x1dd6, 0x1dd7, + 0x1dd8, 0x1dd9, 0x1dda, 0x1ddb, 0x1ddc, 0x1ddd, 0x1dde, 0x1ddf, + 0x1de0, 0x1de1, 0x1de2, 0x1de3, 0x1de4, 0x1de5, 0x1de6, 0x1de7, + 0x1de8, 0x1de9, 0x1dea, 0x1deb, 0x1dec, 0x1ded, 0x1dee, 0x1def, + 0x1df0, 0x1df1, 0x1df2, 0x1df3, 0x1df4, 0x1df5, 0x1df6, 0x1df7, + 0x1df8, 0x1df9, 0x1dfb, 0x1dfc, 0x1dfd, 0x1dfe, 0x1dff, 0x20d0, + 0x20d1, 0x20d2, 0x20d3, 0x20d4, 0x20d5, 0x20d6, 0x20d7, 0x20d8, + 0x20d9, 0x20da, 0x20db, 0x20dc, 0x20dd, 0x20de, 0x20df, 0x20e0, + 0x20e1, 0x20e2, 0x20e3, 0x20e4, 0x20e5, 0x20e6, 0x20e7, 0x20e8, + 0x20e9, 0x20ea, 0x20eb, 0x20ec, 0x20ed, 0x20ee, 0x20ef, 0x20f0, + 0x2cef, 0x2cf0, 0x2cf1, 0x2d7f, 0x2de0, 0x2de1, 0x2de2, 0x2de3, + 0x2de4, 0x2de5, 0x2de6, 0x2de7, 0x2de8, 0x2de9, 0x2dea, 0x2deb, + 0x2dec, 0x2ded, 0x2dee, 0x2def, 0x2df0, 0x2df1, 0x2df2, 0x2df3, + 0x2df4, 0x2df5, 0x2df6, 0x2df7, 0x2df8, 0x2df9, 0x2dfa, 0x2dfb, + 0x2dfc, 0x2dfd, 0x2dfe, 0x2dff, 0x302a, 0x302b, 0x302c, 0x302d, + 0x302e, 0x302f, 0x3099, 0x309a, 0xa66f, 0xa670, 0xa671, 0xa672, + 0xa674, 0xa675, 0xa676, 0xa677, 0xa678, 0xa679, 0xa67a, 0xa67b, + 0xa67c, 0xa67d, 0xa69e, 0xa69f, 0xa6f0, 0xa6f1, 0xa802, 0xa806, + 0xa80b, 0xa823, 0xa824, 0xa825, 0xa826, 0xa827, 0xa82c, 0xa880, + 0xa881, 0xa8b4, 0xa8b5, 0xa8b6, 0xa8b7, 0xa8b8, 0xa8b9, 0xa8ba, + 0xa8bb, 0xa8bc, 0xa8bd, 0xa8be, 0xa8bf, 0xa8c0, 0xa8c1, 0xa8c2, + 0xa8c3, 0xa8c4, 0xa8c5, 0xa8e0, 0xa8e1, 0xa8e2, 0xa8e3, 0xa8e4, + 0xa8e5, 0xa8e6, 0xa8e7, 0xa8e8, 0xa8e9, 0xa8ea, 0xa8eb, 0xa8ec, + 0xa8ed, 0xa8ee, 0xa8ef, 0xa8f0, 0xa8f1, 0xa8ff, 0xa926, 0xa927, + 0xa928, 0xa929, 0xa92a, 0xa92b, 0xa92c, 0xa92d, 0xa947, 0xa948, + 0xa949, 0xa94a, 0xa94b, 0xa94c, 0xa94d, 0xa94e, 0xa94f, 0xa950, + 0xa951, 0xa952, 0xa953, 0xa980, 0xa981, 0xa982, 0xa983, 0xa9b3, + 0xa9b4, 0xa9b5, 0xa9b6, 0xa9b7, 0xa9b8, 0xa9b9, 0xa9ba, 0xa9bb, + 0xa9bc, 0xa9bd, 0xa9be, 0xa9bf, 0xa9c0, 0xa9e5, 0xaa29, 0xaa2a, + 0xaa2b, 0xaa2c, 0xaa2d, 0xaa2e, 0xaa2f, 0xaa30, 0xaa31, 0xaa32, + 0xaa33, 0xaa34, 0xaa35, 0xaa36, 0xaa43, 0xaa4c, 0xaa4d, 0xaa7b, + 0xaa7c, 0xaa7d, 0xaab0, 0xaab2, 0xaab3, 0xaab4, 0xaab7, 0xaab8, + 0xaabe, 0xaabf, 0xaac1, 0xaaeb, 0xaaec, 0xaaed, 0xaaee, 0xaaef, + 0xaaf5, 0xaaf6, 0xabe3, 0xabe4, 0xabe5, 0xabe6, 0xabe7, 0xabe8, + 0xabe9, 0xabea, 0xabec, 0xabed, 0xfb1e, 0xfe00, 0xfe01, 0xfe02, + 0xfe03, 0xfe04, 0xfe05, 0xfe06, 0xfe07, 0xfe08, 0xfe09, 0xfe0a, + 0xfe0b, 0xfe0c, 0xfe0d, 0xfe0e, 0xfe0f, 0xfe20, 0xfe21, 0xfe22, + 0xfe23, 0xfe24, 0xfe25, 0xfe26, 0xfe27, 0xfe28, 0xfe29, 0xfe2a, + 0xfe2b, 0xfe2c, 0xfe2d, 0xfe2e, 0xfe2f, 0x101fd, 0x102e0, 0x10376, + 0x10377, 0x10378, 0x10379, 0x1037a, 0x10a01, 0x10a02, 0x10a03, 0x10a05, + 0x10a06, 0x10a0c, 0x10a0d, 0x10a0e, 0x10a0f, 0x10a38, 0x10a39, 0x10a3a, + 0x10a3f, 0x10ae5, 0x10ae6, 0x10d24, 0x10d25, 0x10d26, 0x10d27, 0x10eab, + 0x10eac, 0x10f46, 0x10f47, 0x10f48, 0x10f49, 0x10f4a, 0x10f4b, 0x10f4c, + 0x10f4d, 0x10f4e, 0x10f4f, 0x10f50, 0x11000, 0x11001, 0x11002, 0x11038, + 0x11039, 0x1103a, 0x1103b, 0x1103c, 0x1103d, 0x1103e, 0x1103f, 0x11040, + 0x11041, 0x11042, 0x11043, 0x11044, 0x11045, 0x11046, 0x1107f, 0x11080, + 0x11081, 0x11082, 0x110b0, 0x110b1, 0x110b2, 0x110b3, 0x110b4, 0x110b5, + 0x110b6, 0x110b7, 0x110b8, 0x110b9, 0x110ba, 0x11100, 0x11101, 0x11102, + 0x11127, 0x11128, 0x11129, 0x1112a, 0x1112b, 0x1112c, 0x1112d, 0x1112e, + 0x1112f, 0x11130, 0x11131, 0x11132, 0x11133, 0x11134, 0x11145, 0x11146, + 0x11173, 0x11180, 0x11181, 0x11182, 0x111b3, 0x111b4, 0x111b5, 0x111b6, + 0x111b7, 0x111b8, 0x111b9, 0x111ba, 0x111bb, 0x111bc, 0x111bd, 0x111be, + 0x111bf, 0x111c0, 0x111c9, 0x111ca, 0x111cb, 0x111cc, 0x111ce, 0x111cf, + 0x1122c, 0x1122d, 0x1122e, 0x1122f, 0x11230, 0x11231, 0x11232, 0x11233, + 0x11234, 0x11235, 0x11236, 0x11237, 0x1123e, 0x112df, 0x112e0, 0x112e1, + 0x112e2, 0x112e3, 0x112e4, 0x112e5, 0x112e6, 0x112e7, 0x112e8, 0x112e9, + 0x112ea, 0x11300, 0x11301, 0x11302, 0x11303, 0x1133b, 0x1133c, 0x1133e, + 0x1133f, 0x11340, 0x11341, 0x11342, 0x11343, 0x11344, 0x11347, 0x11348, + 0x1134b, 0x1134c, 0x1134d, 0x11357, 0x11362, 0x11363, 0x11366, 0x11367, + 0x11368, 0x11369, 0x1136a, 0x1136b, 0x1136c, 0x11370, 0x11371, 0x11372, + 0x11373, 0x11374, 0x11435, 0x11436, 0x11437, 0x11438, 0x11439, 0x1143a, + 0x1143b, 0x1143c, 0x1143d, 0x1143e, 0x1143f, 0x11440, 0x11441, 0x11442, + 0x11443, 0x11444, 0x11445, 0x11446, 0x1145e, 0x114b0, 0x114b1, 0x114b2, + 0x114b3, 0x114b4, 0x114b5, 0x114b6, 0x114b7, 0x114b8, 0x114b9, 0x114ba, + 0x114bb, 0x114bc, 0x114bd, 0x114be, 0x114bf, 0x114c0, 0x114c1, 0x114c2, + 0x114c3, 0x115af, 0x115b0, 0x115b1, 0x115b2, 0x115b3, 0x115b4, 0x115b5, + 0x115b8, 0x115b9, 0x115ba, 0x115bb, 0x115bc, 0x115bd, 0x115be, 0x115bf, + 0x115c0, 0x115dc, 0x115dd, 0x11630, 0x11631, 0x11632, 0x11633, 0x11634, + 0x11635, 0x11636, 0x11637, 0x11638, 0x11639, 0x1163a, 0x1163b, 0x1163c, + 0x1163d, 0x1163e, 0x1163f, 0x11640, 0x116ab, 0x116ac, 0x116ad, 0x116ae, + 0x116af, 0x116b0, 0x116b1, 0x116b2, 0x116b3, 0x116b4, 0x116b5, 0x116b6, + 0x116b7, 0x1171d, 0x1171e, 0x1171f, 0x11720, 0x11721, 0x11722, 0x11723, + 0x11724, 0x11725, 0x11726, 0x11727, 0x11728, 0x11729, 0x1172a, 0x1172b, + 0x1182c, 0x1182d, 0x1182e, 0x1182f, 0x11830, 0x11831, 0x11832, 0x11833, + 0x11834, 0x11835, 0x11836, 0x11837, 0x11838, 0x11839, 0x1183a, 0x11930, + 0x11931, 0x11932, 0x11933, 0x11934, 0x11935, 0x11937, 0x11938, 0x1193b, + 0x1193c, 0x1193d, 0x1193e, 0x11940, 0x11942, 0x11943, 0x119d1, 0x119d2, + 0x119d3, 0x119d4, 0x119d5, 0x119d6, 0x119d7, 0x119da, 0x119db, 0x119dc, + 0x119dd, 0x119de, 0x119df, 0x119e0, 0x119e4, 0x11a01, 0x11a02, 0x11a03, + 0x11a04, 0x11a05, 0x11a06, 0x11a07, 0x11a08, 0x11a09, 0x11a0a, 0x11a33, + 0x11a34, 0x11a35, 0x11a36, 0x11a37, 0x11a38, 0x11a39, 0x11a3b, 0x11a3c, + 0x11a3d, 0x11a3e, 0x11a47, 0x11a51, 0x11a52, 0x11a53, 0x11a54, 0x11a55, + 0x11a56, 0x11a57, 0x11a58, 0x11a59, 0x11a5a, 0x11a5b, 0x11a8a, 0x11a8b, + 0x11a8c, 0x11a8d, 0x11a8e, 0x11a8f, 0x11a90, 0x11a91, 0x11a92, 0x11a93, + 0x11a94, 0x11a95, 0x11a96, 0x11a97, 0x11a98, 0x11a99, 0x11c2f, 0x11c30, + 0x11c31, 0x11c32, 0x11c33, 0x11c34, 0x11c35, 0x11c36, 0x11c38, 0x11c39, + 0x11c3a, 0x11c3b, 0x11c3c, 0x11c3d, 0x11c3e, 0x11c3f, 0x11c92, 0x11c93, + 0x11c94, 0x11c95, 0x11c96, 0x11c97, 0x11c98, 0x11c99, 0x11c9a, 0x11c9b, + 0x11c9c, 0x11c9d, 0x11c9e, 0x11c9f, 0x11ca0, 0x11ca1, 0x11ca2, 0x11ca3, + 0x11ca4, 0x11ca5, 0x11ca6, 0x11ca7, 0x11ca9, 0x11caa, 0x11cab, 0x11cac, + 0x11cad, 0x11cae, 0x11caf, 0x11cb0, 0x11cb1, 0x11cb2, 0x11cb3, 0x11cb4, + 0x11cb5, 0x11cb6, 0x11d31, 0x11d32, 0x11d33, 0x11d34, 0x11d35, 0x11d36, + 0x11d3a, 0x11d3c, 0x11d3d, 0x11d3f, 0x11d40, 0x11d41, 0x11d42, 0x11d43, + 0x11d44, 0x11d45, 0x11d47, 0x11d8a, 0x11d8b, 0x11d8c, 0x11d8d, 0x11d8e, + 0x11d90, 0x11d91, 0x11d93, 0x11d94, 0x11d95, 0x11d96, 0x11d97, 0x11ef3, + 0x11ef4, 0x11ef5, 0x11ef6, 0x16af0, 0x16af1, 0x16af2, 0x16af3, 0x16af4, + 0x16b30, 0x16b31, 0x16b32, 0x16b33, 0x16b34, 0x16b35, 0x16b36, 0x16f4f, + 0x16f51, 0x16f52, 0x16f53, 0x16f54, 0x16f55, 0x16f56, 0x16f57, 0x16f58, + 0x16f59, 0x16f5a, 0x16f5b, 0x16f5c, 0x16f5d, 0x16f5e, 0x16f5f, 0x16f60, + 0x16f61, 0x16f62, 0x16f63, 0x16f64, 0x16f65, 0x16f66, 0x16f67, 0x16f68, + 0x16f69, 0x16f6a, 0x16f6b, 0x16f6c, 0x16f6d, 0x16f6e, 0x16f6f, 0x16f70, + 0x16f71, 0x16f72, 0x16f73, 0x16f74, 0x16f75, 0x16f76, 0x16f77, 0x16f78, + 0x16f79, 0x16f7a, 0x16f7b, 0x16f7c, 0x16f7d, 0x16f7e, 0x16f7f, 0x16f80, + 0x16f81, 0x16f82, 0x16f83, 0x16f84, 0x16f85, 0x16f86, 0x16f87, 0x16f8f, + 0x16f90, 0x16f91, 0x16f92, 0x16fe4, 0x16ff0, 0x16ff1, 0x1bc9d, 0x1bc9e, + 0x1d165, 0x1d166, 0x1d167, 0x1d168, 0x1d169, 0x1d16d, 0x1d16e, 0x1d16f, + 0x1d170, 0x1d171, 0x1d172, 0x1d17b, 0x1d17c, 0x1d17d, 0x1d17e, 0x1d17f, + 0x1d180, 0x1d181, 0x1d182, 0x1d185, 0x1d186, 0x1d187, 0x1d188, 0x1d189, + 0x1d18a, 0x1d18b, 0x1d1aa, 0x1d1ab, 0x1d1ac, 0x1d1ad, 0x1d242, 0x1d243, + 0x1d244, 0x1da00, 0x1da01, 0x1da02, 0x1da03, 0x1da04, 0x1da05, 0x1da06, + 0x1da07, 0x1da08, 0x1da09, 0x1da0a, 0x1da0b, 0x1da0c, 0x1da0d, 0x1da0e, + 0x1da0f, 0x1da10, 0x1da11, 0x1da12, 0x1da13, 0x1da14, 0x1da15, 0x1da16, + 0x1da17, 0x1da18, 0x1da19, 0x1da1a, 0x1da1b, 0x1da1c, 0x1da1d, 0x1da1e, + 0x1da1f, 0x1da20, 0x1da21, 0x1da22, 0x1da23, 0x1da24, 0x1da25, 0x1da26, + 0x1da27, 0x1da28, 0x1da29, 0x1da2a, 0x1da2b, 0x1da2c, 0x1da2d, 0x1da2e, + 0x1da2f, 0x1da30, 0x1da31, 0x1da32, 0x1da33, 0x1da34, 0x1da35, 0x1da36, + 0x1da3b, 0x1da3c, 0x1da3d, 0x1da3e, 0x1da3f, 0x1da40, 0x1da41, 0x1da42, + 0x1da43, 0x1da44, 0x1da45, 0x1da46, 0x1da47, 0x1da48, 0x1da49, 0x1da4a, + 0x1da4b, 0x1da4c, 0x1da4d, 0x1da4e, 0x1da4f, 0x1da50, 0x1da51, 0x1da52, + 0x1da53, 0x1da54, 0x1da55, 0x1da56, 0x1da57, 0x1da58, 0x1da59, 0x1da5a, + 0x1da5b, 0x1da5c, 0x1da5d, 0x1da5e, 0x1da5f, 0x1da60, 0x1da61, 0x1da62, + 0x1da63, 0x1da64, 0x1da65, 0x1da66, 0x1da67, 0x1da68, 0x1da69, 0x1da6a, + 0x1da6b, 0x1da6c, 0x1da75, 0x1da84, 0x1da9b, 0x1da9c, 0x1da9d, 0x1da9e, + 0x1da9f, 0x1daa1, 0x1daa2, 0x1daa3, 0x1daa4, 0x1daa5, 0x1daa6, 0x1daa7, + 0x1daa8, 0x1daa9, 0x1daaa, 0x1daab, 0x1daac, 0x1daad, 0x1daae, 0x1daaf, + 0x1e000, 0x1e001, 0x1e002, 0x1e003, 0x1e004, 0x1e005, 0x1e006, 0x1e008, + 0x1e009, 0x1e00a, 0x1e00b, 0x1e00c, 0x1e00d, 0x1e00e, 0x1e00f, 0x1e010, + 0x1e011, 0x1e012, 0x1e013, 0x1e014, 0x1e015, 0x1e016, 0x1e017, 0x1e018, + 0x1e01b, 0x1e01c, 0x1e01d, 0x1e01e, 0x1e01f, 0x1e020, 0x1e021, 0x1e023, + 0x1e024, 0x1e026, 0x1e027, 0x1e028, 0x1e029, 0x1e02a, 0x1e130, 0x1e131, + 0x1e132, 0x1e133, 0x1e134, 0x1e135, 0x1e136, 0x1e2ec, 0x1e2ed, 0x1e2ee, + 0x1e2ef, 0x1e8d0, 0x1e8d1, 0x1e8d2, 0x1e8d3, 0x1e8d4, 0x1e8d5, 0x1e8d6, + 0x1e944, 0x1e945, 0x1e946, 0x1e947, 0x1e948, 0x1e949, 0x1e94a, 0xe0100, + 0xe0101, 0xe0102, 0xe0103, 0xe0104, 0xe0105, 0xe0106, 0xe0107, 0xe0108, + 0xe0109, 0xe010a, 0xe010b, 0xe010c, 0xe010d, 0xe010e, 0xe010f, 0xe0110, + 0xe0111, 0xe0112, 0xe0113, 0xe0114, 0xe0115, 0xe0116, 0xe0117, 0xe0118, + 0xe0119, 0xe011a, 0xe011b, 0xe011c, 0xe011d, 0xe011e, 0xe011f, 0xe0120, + 0xe0121, 0xe0122, 0xe0123, 0xe0124, 0xe0125, 0xe0126, 0xe0127, 0xe0128, + 0xe0129, 0xe012a, 0xe012b, 0xe012c, 0xe012d, 0xe012e, 0xe012f, 0xe0130, + 0xe0131, 0xe0132, 0xe0133, 0xe0134, 0xe0135, 0xe0136, 0xe0137, 0xe0138, + 0xe0139, 0xe013a, 0xe013b, 0xe013c, 0xe013d, 0xe013e, 0xe013f, 0xe0140, + 0xe0141, 0xe0142, 0xe0143, 0xe0144, 0xe0145, 0xe0146, 0xe0147, 0xe0148, + 0xe0149, 0xe014a, 0xe014b, 0xe014c, 0xe014d, 0xe014e, 0xe014f, 0xe0150, + 0xe0151, 0xe0152, 0xe0153, 0xe0154, 0xe0155, 0xe0156, 0xe0157, 0xe0158, + 0xe0159, 0xe015a, 0xe015b, 0xe015c, 0xe015d, 0xe015e, 0xe015f, 0xe0160, + 0xe0161, 0xe0162, 0xe0163, 0xe0164, 0xe0165, 0xe0166, 0xe0167, 0xe0168, + 0xe0169, 0xe016a, 0xe016b, 0xe016c, 0xe016d, 0xe016e, 0xe016f, 0xe0170, + 0xe0171, 0xe0172, 0xe0173, 0xe0174, 0xe0175, 0xe0176, 0xe0177, 0xe0178, + 0xe0179, 0xe017a, 0xe017b, 0xe017c, 0xe017d, 0xe017e, 0xe017f, 0xe0180, + 0xe0181, 0xe0182, 0xe0183, 0xe0184, 0xe0185, 0xe0186, 0xe0187, 0xe0188, + 0xe0189, 0xe018a, 0xe018b, 0xe018c, 0xe018d, 0xe018e, 0xe018f, 0xe0190, + 0xe0191, 0xe0192, 0xe0193, 0xe0194, 0xe0195, 0xe0196, 0xe0197, 0xe0198, + 0xe0199, 0xe019a, 0xe019b, 0xe019c, 0xe019d, 0xe019e, 0xe019f, 0xe01a0, + 0xe01a1, 0xe01a2, 0xe01a3, 0xe01a4, 0xe01a5, 0xe01a6, 0xe01a7, 0xe01a8, + 0xe01a9, 0xe01aa, 0xe01ab, 0xe01ac, 0xe01ad, 0xe01ae, 0xe01af, 0xe01b0, + 0xe01b1, 0xe01b2, 0xe01b3, 0xe01b4, 0xe01b5, 0xe01b6, 0xe01b7, 0xe01b8, + 0xe01b9, 0xe01ba, 0xe01bb, 0xe01bc, 0xe01bd, 0xe01be, 0xe01bf, 0xe01c0, + 0xe01c1, 0xe01c2, 0xe01c3, 0xe01c4, 0xe01c5, 0xe01c6, 0xe01c7, 0xe01c8, + 0xe01c9, 0xe01ca, 0xe01cb, 0xe01cc, 0xe01cd, 0xe01ce, 0xe01cf, 0xe01d0, + 0xe01d1, 0xe01d2, 0xe01d3, 0xe01d4, 0xe01d5, 0xe01d6, 0xe01d7, 0xe01d8, + 0xe01d9, 0xe01da, 0xe01db, 0xe01dc, 0xe01dd, 0xe01de, 0xe01df, 0xe01e0, + 0xe01e1, 0xe01e2, 0xe01e3, 0xe01e4, 0xe01e5, 0xe01e6, 0xe01e7, 0xe01e8, + 0xe01e9, 0xe01ea, 0xe01eb, 0xe01ec, 0xe01ed, 0xe01ee, 0xe01ef}; + if (std::binary_search(std::begin(combining), std::end(combining), + label.front())) { + return false; + } + // We verify this next step as part of the mapping: + // --------------------------------------------- + // Each code point in the label must only have certain status values + // according to Section 5, IDNA Mapping Table: + // - For Transitional Processing, each value must be valid. + // - For Nontransitional Processing, each value must be either valid or + // deviation. + + // If CheckJoiners, the label must satisify the ContextJ rules from Appendix + // A, in The Unicode Code Points and Internationalized Domain Names for + // Applications (IDNA) [IDNA2008]. + constexpr static uint32_t virama[] = { + 0x094D, 0x09CD, 0x0A4D, 0x0ACD, 0x0B4D, 0x0BCD, 0x0C4D, 0x0CCD, + 0x0D3B, 0x0D3C, 0x0D4D, 0x0DCA, 0x0E3A, 0x0EBA, 0x0F84, 0x1039, + 0x103A, 0x1714, 0x1734, 0x17D2, 0x1A60, 0x1B44, 0x1BAA, 0x1BAB, + 0x1BF2, 0x1BF3, 0x2D7F, 0xA806, 0xA82C, 0xA8C4, 0xA953, 0xA9C0, + 0xAAF6, 0xABED, 0x10A3F, 0x11046, 0x1107F, 0x110B9, 0x11133, 0x11134, + 0x111C0, 0x11235, 0x112EA, 0x1134D, 0x11442, 0x114C2, 0x115BF, 0x1163F, + 0x116B6, 0x1172B, 0x11839, 0x1193D, 0x1193E, 0x119E0, 0x11A34, 0x11A47, + 0x11A99, 0x11C3F, 0x11D44, 0x11D45, 0x11D97}; + constexpr static uint32_t R[] = { + 0x622, 0x623, 0x624, 0x625, 0x627, 0x629, 0x62f, 0x630, 0x631, + 0x632, 0x648, 0x671, 0x672, 0x673, 0x675, 0x676, 0x677, 0x688, + 0x689, 0x68a, 0x68b, 0x68c, 0x68d, 0x68e, 0x68f, 0x690, 0x691, + 0x692, 0x693, 0x694, 0x695, 0x696, 0x697, 0x698, 0x699, 0x6c0, + 0x6c3, 0x6c4, 0x6c5, 0x6c6, 0x6c7, 0x6c8, 0x6c9, 0x6ca, 0x6cb, + 0x6cd, 0x6cf, 0x6d2, 0x6d3, 0x6d5, 0x6ee, 0x6ef, 0x710, 0x715, + 0x716, 0x717, 0x718, 0x719, 0x71e, 0x728, 0x72a, 0x72c, 0x72f, + 0x74d, 0x759, 0x75a, 0x75b, 0x854, 0x8aa, 0x8ab, 0x8ac}; + constexpr static uint32_t L[] = {0xa872}; + constexpr static uint32_t D[] = { + 0x620, 0x626, 0x628, 0x62a, 0x62b, 0x62c, 0x62d, 0x62e, 0x633, + 0x634, 0x635, 0x636, 0x637, 0x638, 0x639, 0x63a, 0x63b, 0x63c, + 0x63d, 0x63e, 0x63f, 0x641, 0x642, 0x643, 0x644, 0x645, 0x646, + 0x647, 0x649, 0x64a, 0x66e, 0x66f, 0x678, 0x679, 0x67a, 0x67b, + 0x67c, 0x67d, 0x67e, 0x67f, 0x680, 0x681, 0x682, 0x683, 0x684, + 0x685, 0x686, 0x687, 0x69a, 0x69b, 0x69c, 0x69d, 0x69e, 0x69f, + 0x6a0, 0x6a1, 0x6a2, 0x6a3, 0x6a4, 0x6a5, 0x6a6, 0x6a7, 0x6a8, + 0x6a9, 0x6aa, 0x6ab, 0x6ac, 0x6ad, 0x6ae, 0x6af, 0x6b0, 0x6b1, + 0x6b2, 0x6b3, 0x6b4, 0x6b5, 0x6b6, 0x6b7, 0x6b8, 0x6b9, 0x6ba, + 0x6bb, 0x6bc, 0x6bd, 0x6be, 0x6bf, 0x6c1, 0x6c2, 0x6cc, 0x6ce, + 0x6d0, 0x6d1, 0x6fa, 0x6fb, 0x6fc, 0x6ff, 0x712, 0x713, 0x714, + 0x71a, 0x71b, 0x71c, 0x71d, 0x71f, 0x720, 0x721, 0x722, 0x723, + 0x724, 0x725, 0x726, 0x727, 0x729, 0x72b, 0x72d, 0x72e, 0x74e, + 0x74f, 0x750, 0x751, 0x752, 0x753, 0x754, 0x755, 0x756, 0x757, + 0x758, 0x75c, 0x75d, 0x75e, 0x75f, 0x760, 0x761, 0x762, 0x763, + 0x764, 0x765, 0x766, 0x850, 0x851, 0x852, 0x853, 0x855, 0x8a0, + 0x8a2, 0x8a3, 0x8a4, 0x8a5, 0x8a6, 0x8a7, 0x8a8, 0x8a9, 0x1807, + 0x1820, 0x1821, 0x1822, 0x1823, 0x1824, 0x1825, 0x1826, 0x1827, 0x1828, + 0x1829, 0x182a, 0x182b, 0x182c, 0x182d, 0x182e, 0x182f, 0x1830, 0x1831, + 0x1832, 0x1833, 0x1834, 0x1835, 0x1836, 0x1837, 0x1838, 0x1839, 0x183a, + 0x183b, 0x183c, 0x183d, 0x183e, 0x183f, 0x1840, 0x1841, 0x1842, 0x1843, + 0x1844, 0x1845, 0x1846, 0x1847, 0x1848, 0x1849, 0x184a, 0x184b, 0x184c, + 0x184d, 0x184e, 0x184f, 0x1850, 0x1851, 0x1852, 0x1853, 0x1854, 0x1855, + 0x1856, 0x1857, 0x1858, 0x1859, 0x185a, 0x185b, 0x185c, 0x185d, 0x185e, + 0x185f, 0x1860, 0x1861, 0x1862, 0x1863, 0x1864, 0x1865, 0x1866, 0x1867, + 0x1868, 0x1869, 0x186a, 0x186b, 0x186c, 0x186d, 0x186e, 0x186f, 0x1870, + 0x1871, 0x1872, 0x1873, 0x1874, 0x1875, 0x1876, 0x1877, 0x1887, 0x1888, + 0x1889, 0x188a, 0x188b, 0x188c, 0x188d, 0x188e, 0x188f, 0x1890, 0x1891, + 0x1892, 0x1893, 0x1894, 0x1895, 0x1896, 0x1897, 0x1898, 0x1899, 0x189a, + 0x189b, 0x189c, 0x189d, 0x189e, 0x189f, 0x18a0, 0x18a1, 0x18a2, 0x18a3, + 0x18a4, 0x18a5, 0x18a6, 0x18a7, 0x18a8, 0x18aa, 0xa840, 0xa841, 0xa842, + 0xa843, 0xa844, 0xa845, 0xa846, 0xa847, 0xa848, 0xa849, 0xa84a, 0xa84b, + 0xa84c, 0xa84d, 0xa84e, 0xa84f, 0xa850, 0xa851, 0xa852, 0xa853, 0xa854, + 0xa855, 0xa856, 0xa857, 0xa858, 0xa859, 0xa85a, 0xa85b, 0xa85c, 0xa85d, + 0xa85e, 0xa85f, 0xa860, 0xa861, 0xa862, 0xa863, 0xa864, 0xa865, 0xa866, + 0xa867, 0xa868, 0xa869, 0xa86a, 0xa86b, 0xa86c, 0xa86d, 0xa86e, 0xa86f, + 0xa870, 0xa871}; + + for (size_t i = 0; i < label.size(); i++) { + uint32_t c = label[i]; + if (c == 0x200c) { + if (i > 0) { + if (std::binary_search(std::begin(virama), std::end(virama), + label[i - 1])) { + return true; + } + } + if ((i == 0) || (i + 1 >= label.size())) { + return false; + } + // we go backward looking for L or D + auto is_l_or_d = [](uint32_t code) { + return std::binary_search(std::begin(L), std::end(L), code) || + std::binary_search(std::begin(D), std::end(D), code); + }; + auto is_r_or_d = [](uint32_t code) { + return std::binary_search(std::begin(R), std::end(R), code) || + std::binary_search(std::begin(D), std::end(D), code); + }; + std::u32string_view before = label.substr(0, i); + std::u32string_view after = label.substr(i + 1); + return (std::find_if(before.begin(), before.end(), is_l_or_d) != + before.end()) && + (std::find_if(after.begin(), after.end(), is_r_or_d) != + after.end()); + } else if (c == 0x200d) { + if (i > 0) { + if (std::binary_search(std::begin(virama), std::end(virama), + label[i - 1])) { + return true; + } + } + return false; + } + } - // While c is an ASCII digit: - while (pointer != input.end() && checkers::is_digit(*pointer)) { - // Let number be c interpreted as decimal number. - int number = *pointer - '0'; + // If CheckBidi, and if the domain name is a Bidi domain name, then the label + // must satisfy all six of the numbered conditions in [IDNA2008] RFC 5893, + // Section 2. - // If ipv4Piece is null, then set ipv4Piece to number. - if (!ipv4_piece.has_value()) { - ipv4_piece = number; - } - // Otherwise, if ipv4Piece is 0, validation error, return failure. - else if (ipv4_piece == 0) { - ada_log("parse_ipv6 if ipv4Piece is 0, validation error"); - return is_valid = false; - } - // Otherwise, set ipv4Piece to ipv4Piece × 10 + number. - else { - ipv4_piece = *ipv4_piece * 10 + number; - } + // The following rule, consisting of six conditions, applies to labels + // in Bidi domain names. The requirements that this rule satisfies are + // described in Section 3. All of the conditions must be satisfied for + // the rule to be satisfied. + // + // 1. The first character must be a character with Bidi property L, R, + // or AL. If it has the R or AL property, it is an RTL label; if it + // has the L property, it is an LTR label. + // + // 2. In an RTL label, only characters with the Bidi properties R, AL, + // AN, EN, ES, CS, ET, ON, BN, or NSM are allowed. + // + // 3. In an RTL label, the end of the label must be a character with + // Bidi property R, AL, EN, or AN, followed by zero or more + // characters with Bidi property NSM. + // + // 4. In an RTL label, if an EN is present, no AN may be present, and + // vice versa. + // + // 5. In an LTR label, only characters with the Bidi properties L, EN, + // ES, CS, ET, ON, BN, or NSM are allowed. + // + // 6. In an LTR label, the end of the label must be a character with + // Bidi property L or EN, followed by zero or more characters with + // Bidi property NSM. - // If ipv4Piece is greater than 255, validation error, return failure. - if (ipv4_piece > 255) { - ada_log("parse_ipv6 ipv4_piece > 255"); - return is_valid = false; - } + size_t last_non_nsm_char = find_last_not_of_nsm(label); + if (last_non_nsm_char == std::u32string_view::npos) { + return false; + } - // Increase pointer by 1. - pointer++; - } + // A "Bidi domain name" is a domain name that contains at least one RTL label. + // The following rule, consisting of six conditions, applies to labels in Bidi + // domain names. + if (is_rtl_label(label)) { + // The first character must be a character with Bidi property L, R, + // or AL. If it has the R or AL property, it is an RTL label; if it + // has the L property, it is an LTR label. + + if (find_direction(label[0]) == direction::L) { + // Eval as LTR + + // In an LTR label, only characters with the Bidi properties L, EN, + // ES, CS, ET, ON, BN, or NSM are allowed. + for (size_t i = 0; i < last_non_nsm_char; i++) { + const direction d = find_direction(label[i]); + if (!(d == direction::L || d == direction::EN || d == direction::ES || + d == direction::CS || d == direction::ET || d == direction::ON || + d == direction::BN || d == direction::NSM)) { + return false; + } + + if ((i == last_non_nsm_char) && + !(d == direction::L || d == direction::EN)) { + return false; + } + } - // Set address[pieceIndex] to address[pieceIndex] × 0x100 + ipv4Piece. - // https://stackoverflow.com/questions/39060852/why-does-the-addition-of-two-shorts-return-an-int - address[piece_index] = uint16_t(address[piece_index] * 0x100 + *ipv4_piece); + return true; - // Increase numbersSeen by 1. - numbers_seen++; + } else { + // Eval as RTL - // If numbersSeen is 2 or 4, then increase pieceIndex by 1. - if (numbers_seen == 2 || numbers_seen == 4) { - piece_index++; - } - } + bool has_an = false; + bool has_en = false; + for (size_t i = 0; i <= last_non_nsm_char; i++) { + const direction d = find_direction(label[i]); - // If numbersSeen is not 4, validation error, return failure. - if (numbers_seen != 4) { - return is_valid = false; + // In an RTL label, if an EN is present, no AN may be present, and vice + // versa. + if ((d == direction::EN && ((has_en = true) && has_an)) || + (d == direction::AN && ((has_an = true) && has_en))) { + return false; } - // Break. - break; - } - // Otherwise, if c is U+003A (:): - else if ((pointer != input.end()) && (*pointer == ':')) { - // Increase pointer by 1. - pointer++; + if (!(d == direction::R || d == direction::AL || d == direction::AN || + d == direction::EN || d == direction::ES || d == direction::CS || + d == direction::ET || d == direction::ON || d == direction::BN || + d == direction::NSM)) { + return false; + } - // If c is the EOF code point, validation error, return failure. - if (pointer == input.end()) { - ada_log("parse_ipv6 If c is the EOF code point, validation error, return failure"); - return is_valid = false; + if (i == last_non_nsm_char && + !(d == direction::R || d == direction::AL || d == direction::AN || + d == direction::EN)) { + return false; } } - // Otherwise, if c is not the EOF code point, validation error, return failure. - else if (pointer != input.end()) { - ada_log("parse_ipv6 Otherwise, if c is not the EOF code point, validation error, return failure"); - return is_valid = false; - } - // Set address[pieceIndex] to value. - address[piece_index] = value; - - // Increase pieceIndex by 1. - piece_index++; + return true; } + } - // If compress is non-null, then: - if (compress.has_value()) { - // Let swaps be pieceIndex − compress. - int swaps = piece_index - *compress; + return true; +} - // Set pieceIndex to 7. - piece_index = 7; +} // namespace ada::idna +/* end file src/validity.cpp */ +/* begin file src/to_ascii.cpp */ - // While pieceIndex is not 0 and swaps is greater than 0, - // swap address[pieceIndex] with address[compress + swaps − 1], and then decrease both pieceIndex and swaps by 1. - while (piece_index != 0 && swaps > 0) { - std::swap(address[piece_index], address[*compress + swaps - 1]); - piece_index--; - swaps--; - } - } - // Otherwise, if compress is null and pieceIndex is not 8, validation error, return failure. - else if (piece_index != 8) { - ada_log("parse_ipv6 if compress is null and pieceIndex is not 8, validation error, return failure"); - return is_valid = false; - } - host = ada::serializers::ipv6(address); - ada_log("parse_ipv6 ", *host); - return true; - } +#include +#include - ada_really_inline bool url::parse_host(std::string_view input) { - ada_log("parse_host ", input, "[", input.size(), " bytes]"); - if(input.empty()) { return is_valid = false; } // technically unnecessary. - // If input starts with U+005B ([), then: - if (input[0] == '[') { - // If input does not end with U+005D (]), validation error, return failure. - if (input.back() != ']') { - return is_valid = false; - } - ada_log("parse_host ipv6"); - // Return the result of IPv6 parsing input with its leading U+005B ([) and trailing U+005D (]) removed. - input.remove_prefix(1); - input.remove_suffix(1); - return parse_ipv6(input); - } +namespace ada::idna { - // If isNotSpecial is true, then return the result of opaque-host parsing input. - if (!is_special()) { - return parse_opaque_host(input); - } - // Let domain be the result of running UTF-8 decode without BOM on the percent-decoding of input. - // Let asciiDomain be the result of running domain to ASCII with domain and false. - // The most common case is an ASCII input, in which case we do not need to call the expensive 'to_ascii' - // if a few conditions are met: no '%' and no 'xn-' subsequence. - std::string buffer = std::string(input); - // This next function checks that the result is ascii, but we are going to - // to check anyhow with is_forbidden. - // bool is_ascii = - unicode::to_lower_ascii(buffer.data(), buffer.size()); - bool is_forbidden = unicode::contains_forbidden_domain_code_point(buffer.data(), buffer.size()); - if (is_forbidden == 0 && buffer.find("xn-") == std::string_view::npos) { - // fast path - host = std::move(buffer); - if (checkers::is_ipv4(host.value())) { - ada_log("parse_host fast path ipv4"); - return parse_ipv4(host.value()); - } - ada_log("parse_host fast path ", *host); - return true; - } - ada_log("parse_host calling to_ascii"); - is_valid = ada::unicode::to_ascii(host, input, false, input.find('%')); - if (!is_valid) { - ada_log("parse_host to_ascii returns false"); - return is_valid = false; - } +bool constexpr begins_with(std::u32string_view view, + std::u32string_view prefix) { + if (view.size() < prefix.size()) { + return false; + } + return view.substr(0, prefix.size()) == prefix; +} - if(std::any_of(host.value().begin(), host.value().end(), ada::unicode::is_forbidden_domain_code_point)) { - host = std::nullopt; - return is_valid = false; - } +bool constexpr begins_with(std::string_view view, std::string_view prefix) { + if (view.size() < prefix.size()) { + return false; + } + return view.substr(0, prefix.size()) == prefix; +} - // If asciiDomain ends in a number, then return the result of IPv4 parsing asciiDomain. - if(checkers::is_ipv4(host.value())) { - ada_log("parse_host got ipv4", *host); - return parse_ipv4(host.value()); +bool constexpr is_ascii(std::u32string_view view) { + for (uint32_t c : view) { + if (c >= 0x80) { + return false; } - - return true; } + return true; +} - template - ada_really_inline bool url::parse_scheme(const std::string_view input) { - auto parsed_type = ada::scheme::get_scheme_type(input); - bool is_input_special = (parsed_type != ada::scheme::NOT_SPECIAL); - /** - * In the common case, we will immediately recognize a special scheme (e.g., http, https), - * in which case, we can go really fast. - **/ - if(is_input_special) { // fast path!!! - if (has_state_override) { - // If url’s scheme is not a special scheme and buffer is a special scheme, then return. - if (is_special() != is_input_special) { - return true; - } +bool constexpr is_ascii(std::string_view view) { + for (uint8_t c : view) { + if (c >= 0x80) { + return false; + } + } + return true; +} - // If url includes credentials or has a non-null port, and buffer is "file", then return. - if ((includes_credentials() || port.has_value()) && parsed_type == ada::scheme::type::FILE) { - return true; - } +constexpr static uint8_t is_forbidden_domain_code_point_table[] = { + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; - // If url’s scheme is "file" and its host is an empty host, then return. - // An empty host is the empty string. - if (get_scheme_type() == ada::scheme::type::FILE && host.has_value() && host.value().empty()) { - return true; - } - } +static_assert(sizeof(is_forbidden_domain_code_point_table) == 256); - type = parsed_type; +inline constexpr bool is_forbidden_domain_code_point(const char c) noexcept { + return is_forbidden_domain_code_point_table[uint8_t(c)]; +} - if (has_state_override) { - // This is uncommon. - uint16_t urls_scheme_port = get_special_port(); +// We return "" on error. For now. +std::string from_ascii_to_ascii(std::string_view ut8_string) { + static const std::string error = ""; + if (std::any_of(ut8_string.begin(), ut8_string.end(), + is_forbidden_domain_code_point)) { + return error; + } - if (urls_scheme_port) { - // If url’s port is url’s scheme’s default port, then set url’s port to null. - if (port.has_value() && *port == urls_scheme_port) { - port = std::nullopt; - } - } + // copy and map + // we could be more efficient by avoiding the copy when unnecessary. + std::string mapped_string = std::string(ut8_string); + ascii_map(mapped_string.data(), mapped_string.size()); + std::string out; + size_t label_start = 0; + + while (label_start != mapped_string.size()) { + size_t loc_dot = mapped_string.find('.', label_start); + bool is_last_label = (loc_dot == std::string_view::npos); + size_t label_size = is_last_label ? mapped_string.size() - label_start + : loc_dot - label_start; + size_t label_size_with_dot = is_last_label ? label_size : label_size + 1; + std::string_view label_view(mapped_string.data() + label_start, label_size); + label_start += label_size_with_dot; + if (label_size == 0) { + // empty label? Nothing to do. + } else if (begins_with(label_view, "xn--")) { + // The xn-- part is the expensive game. + out.append(label_view); + std::string_view puny_segment_ascii( + out.data() + out.size() - label_view.size() + 4, + label_view.size() - 4); + std::u32string tmp_buffer; + bool is_ok = ada::idna::punycode_to_utf32(puny_segment_ascii, tmp_buffer); + if (!is_ok) { + return error; + } + std::u32string post_map = ada::idna::map(tmp_buffer); + if (tmp_buffer != post_map) { + return error; } - } else { // slow path - std::string _buffer = std::string(input); - // Next function is only valid if the input is ASCII and returns false - // otherwise, but it seems that we always have ascii content so we do not need - // to check the return value. - //bool is_ascii = - unicode::to_lower_ascii(_buffer.data(), _buffer.size()); + std::u32string pre_normal = post_map; + normalize(post_map); + if (post_map != pre_normal) { + return error; + } + if (post_map.empty()) { + return error; + } + if (!is_label_valid(post_map)) { + return error; + } + } else { + out.append(label_view); + } + if (!is_last_label) { + out.push_back('.'); + } + } + return out; +} - if (has_state_override) { - // If url’s scheme is a special scheme and buffer is not a special scheme, then return. - // If url’s scheme is not a special scheme and buffer is a special scheme, then return. - if (is_special() != ada::scheme::is_special(_buffer)) { - return true; +// We return "" on error. For now. +std::string to_ascii(std::string_view ut8_string) { + if (is_ascii(ut8_string)) { + return from_ascii_to_ascii(ut8_string); + } + static const std::string error = ""; + // We convert to UTF-32 + size_t utf32_length = + ada::idna::utf32_length_from_utf8(ut8_string.data(), ut8_string.size()); + std::u32string utf32(utf32_length, '\0'); + size_t actual_utf32_length = ada::idna::utf8_to_utf32( + ut8_string.data(), ut8_string.size(), utf32.data()); + if (actual_utf32_length == 0) { + return error; + } + // mapping + utf32 = ada::idna::map(utf32); + normalize(utf32); + std::string out; + size_t label_start = 0; + + while (label_start != utf32.size()) { + size_t loc_dot = utf32.find('.', label_start); + bool is_last_label = (loc_dot == std::string_view::npos); + size_t label_size = + is_last_label ? utf32.size() - label_start : loc_dot - label_start; + size_t label_size_with_dot = is_last_label ? label_size : label_size + 1; + std::u32string_view label_view(utf32.data() + label_start, label_size); + label_start += label_size_with_dot; + if (label_size == 0) { + // empty label? Nothing to do. + } else if (begins_with(label_view, U"xn--")) { + // we do not need to check, e.g., Xn-- because mapping goes to lower case + for (char32_t c : label_view) { + if (c >= 0x80) { + return error; } - - // If url includes credentials or has a non-null port, and buffer is "file", then return. - if ((includes_credentials() || port.has_value()) && _buffer == "file") { - return true; + out += (unsigned char)(c); + } + std::string_view puny_segment_ascii( + out.data() + out.size() - label_view.size() + 4, + label_view.size() - 4); + std::u32string tmp_buffer; + bool is_ok = ada::idna::punycode_to_utf32(puny_segment_ascii, tmp_buffer); + if (!is_ok) { + return error; + } + std::u32string post_map = ada::idna::map(tmp_buffer); + if (tmp_buffer != post_map) { + return error; + } + std::u32string pre_normal = post_map; + normalize(post_map); + if (post_map != pre_normal) { + return error; + } + if (post_map.empty()) { + return error; + } + if (!is_label_valid(post_map)) { + return error; + } + } else { + // The fast path here is an ascii label. + if (is_ascii(label_view)) { + // no validation needed. + for (char32_t c : label_view) { + out += (unsigned char)(c); } - - // If url’s scheme is "file" and its host is an empty host, then return. - // An empty host is the empty string. - if (get_scheme_type() == ada::scheme::type::FILE && host.has_value() && host.value().empty()) { - return true; + } else { + // slow path. + // first check validity. + if (!is_label_valid(label_view)) { + return error; } - } - - set_scheme(std::move(_buffer)); - - if (has_state_override) { - // This is uncommon. - uint16_t urls_scheme_port = get_special_port(); - - if (urls_scheme_port) { - // If url’s port is url’s scheme’s default port, then set url’s port to null. - if (port.has_value() && *port == urls_scheme_port) { - port = std::nullopt; - } + // It is valid! So now we must encode it as punycode... + out.append("xn--"); + bool is_ok = ada::idna::utf32_to_punycode(label_view, out); + if (!is_ok) { + return error; } } } - - return true; - } - - std::string url::to_string() const { - if (!is_valid) { - return "null"; - } - std::string answer; - auto back = std::back_insert_iterator(answer); - answer.append("{\n"); - answer.append("\t\"scheme\":\""); - helpers::encode_json(get_scheme(), back); - answer.append("\",\n"); - if(includes_credentials()) { - answer.append("\t\"username\":\""); - helpers::encode_json(username, back); - answer.append("\",\n"); - answer.append("\t\"password\":\""); - helpers::encode_json(password, back); - answer.append("\",\n"); - } - if(host.has_value()) { - answer.append("\t\"host\":\""); - helpers::encode_json(host.value(), back); - answer.append("\",\n"); - } - if(port.has_value()) { - answer.append("\t\"port\":\""); - answer.append(std::to_string(port.value())); - answer.append("\",\n"); - } - answer.append("\t\"path\":\""); - helpers::encode_json(path, back); - answer.append("\",\n"); - answer.append("\t\"opaque path\":"); - answer.append((has_opaque_path ? "true" : "false")); - if(query.has_value()) { - answer.append(",\n"); - answer.append("\t\"query\":\""); - helpers::encode_json(query.value(), back); - answer.append("\""); - } - if(fragment.has_value()) { - answer.append(",\n"); - answer.append("\t\"fragment\":\""); - helpers::encode_json(fragment.value(), back); - answer.append("\""); + if (!is_last_label) { + out.push_back('.'); } - answer.append("\n}"); - return answer; } - [[nodiscard]] bool url::has_valid_domain() const noexcept { - if(!host.has_value()) { return false; } - return checkers::verify_dns_length(host.value()); + if (std::any_of(out.begin(), out.end(), is_forbidden_domain_code_point)) { + return error; } -} // namespace ada -/* end file src/url.cpp */ -// dofile: invoked with prepath=/Users/dlemire/CVS/github/ada/src, filename=url-getters.cpp -/* begin file src/url-getters.cpp */ -/** - * @file url-getters.cpp - * Includes all the getters of `ada::url` - */ + + return out; +} +} // namespace ada::idna +/* end file src/to_ascii.cpp */ +/* begin file src/to_unicode.cpp */ #include #include -namespace ada { - - [[nodiscard]] std::string url::get_href() const noexcept { - std::string output = get_protocol(); - size_t url_delimiter_count = std::count(path.begin(), path.end(), '/'); - if (host.has_value()) { - output += "//"; - if (includes_credentials()) { - output += get_username(); - if (!get_password().empty()) { - output += ":" + get_password(); +namespace ada::idna { +std::string to_unicode(std::string_view input) { + std::string output; + output.reserve(input.size()); + + size_t label_start = 0; + while (label_start < input.size()) { + size_t loc_dot = input.find('.', label_start); + bool is_last_label = (loc_dot == std::string_view::npos); + size_t label_size = + is_last_label ? input.size() - label_start : loc_dot - label_start; + auto label_view = std::string_view(input.data() + label_start, label_size); + + if (ada::idna::begins_with(label_view, "xn--") && + ada::idna::is_ascii(label_view)) { + label_view.remove_prefix(4); + if (ada::idna::verify_punycode(label_view)) { + std::u32string tmp_buffer; + if (ada::idna::punycode_to_utf32(label_view, tmp_buffer)) { + auto utf8_size = ada::idna::utf8_length_from_utf32(tmp_buffer.data(), + tmp_buffer.size()); + std::string final_utf8(utf8_size, '\0'); + ada::idna::utf32_to_utf8(tmp_buffer.data(), tmp_buffer.size(), + final_utf8.data()); + output.append(final_utf8); + } else { + // ToUnicode never fails. If any step fails, then the original input + // sequence is returned immediately in that step. + output.append( + std::string_view(input.data() + label_start, label_size)); } - output += "@"; + } else { + output.append(std::string_view(input.data() + label_start, label_size)); } + } else { + output.append(label_view); + } - output += get_host(); - } else if (!has_opaque_path && url_delimiter_count > 1 && path.length() >= 2 && path[0] == '/' && path[1] == '/') { - // If url’s host is null, url does not have an opaque path, url’s path’s size is greater than 1, - // and url’s path[0] is the empty string, then append U+002F (/) followed by U+002E (.) to output. - output += "/."; + if (!is_last_label) { + output.push_back('.'); } - output += get_pathname() - // If query is non-null, then set this’s query object’s list to the result of parsing query. - + (query.has_value() ? "?" + query.value() : "") - // If url’s fragment is non-null, then append U+0023 (#), followed by url’s fragment, to output. - + (fragment.has_value() ? "#" + fragment.value() : ""); - return output; + label_start += label_size + 1; } - [[nodiscard]] std::string url::get_origin() const noexcept { - if (is_special()) { - // Return a new opaque origin. - if (get_scheme_type() == scheme::FILE) { return "null"; } - - return get_protocol() + "//" + get_host(); - } + return output; +} +} // namespace ada::idna +/* end file src/to_unicode.cpp */ +/* end file src/idna.cpp */ +/* end file src/ada_idna.cpp */ +ADA_POP_DISABLE_WARNINGS - if (get_scheme() == "blob") { - if (path.length() > 0) { - url path_result = ada::parser::parse_url(get_pathname()); - if (path_result.is_valid) { - if (path_result.is_special()) { - return path_result.get_protocol() + "//" + path_result.get_host(); - } - } - } - } +#include - // Return a new opaque origin. - return "null"; - } +namespace ada::unicode { - [[nodiscard]] std::string url::get_protocol() const noexcept { - return std::string(get_scheme()) + ":"; +constexpr bool to_lower_ascii(char* input, size_t length) noexcept { + auto broadcast = [](uint8_t v) -> uint64_t { return 0x101010101010101 * v; }; + uint64_t broadcast_80 = broadcast(0x80); + uint64_t broadcast_Ap = broadcast(128 - 'A'); + uint64_t broadcast_Zp = broadcast(128 - 'Z'); + uint64_t non_ascii = 0; + size_t i = 0; + + for (; i + 7 < length; i += 8) { + uint64_t word{}; + memcpy(&word, input + i, sizeof(word)); + non_ascii |= (word & broadcast_80); + word ^= + (((word + broadcast_Ap) ^ (word + broadcast_Zp)) & broadcast_80) >> 2; + memcpy(input + i, &word, sizeof(word)); } - - [[nodiscard]] std::string url::get_host() const noexcept { - // If url’s host is null, then return the empty string. - // If url’s port is null, return url’s host, serialized. - // Return url’s host, serialized, followed by U+003A (:) and url’s port, serialized. - if (!host.has_value()) { return ""; } - return host.value() + (port.has_value() ? ":" + get_port() : ""); + if (i < length) { + uint64_t word{}; + memcpy(&word, input + i, length - i); + non_ascii |= (word & broadcast_80); + word ^= + (((word + broadcast_Ap) ^ (word + broadcast_Zp)) & broadcast_80) >> 2; + memcpy(input + i, &word, length - i); } + return non_ascii == 0; +} - [[nodiscard]] std::string url::get_hostname() const noexcept { - return host.value_or(""); +ada_really_inline constexpr bool has_tabs_or_newline( + std::string_view user_input) noexcept { + auto has_zero_byte = [](uint64_t v) { + return ((v - 0x0101010101010101) & ~(v)&0x8080808080808080); + }; + auto broadcast = [](uint8_t v) -> uint64_t { return 0x101010101010101 * v; }; + size_t i = 0; + uint64_t mask1 = broadcast('\r'); + uint64_t mask2 = broadcast('\n'); + uint64_t mask3 = broadcast('\t'); + uint64_t running{0}; + for (; i + 7 < user_input.size(); i += 8) { + uint64_t word{}; + memcpy(&word, user_input.data() + i, sizeof(word)); + uint64_t xor1 = word ^ mask1; + uint64_t xor2 = word ^ mask2; + uint64_t xor3 = word ^ mask3; + running |= has_zero_byte(xor1) | has_zero_byte(xor2) | has_zero_byte(xor3); } - - [[nodiscard]] std::string url::get_pathname() const noexcept { - return path; + if (i < user_input.size()) { + uint64_t word{}; + memcpy(&word, user_input.data() + i, user_input.size() - i); + uint64_t xor1 = word ^ mask1; + uint64_t xor2 = word ^ mask2; + uint64_t xor3 = word ^ mask3; + running |= has_zero_byte(xor1) | has_zero_byte(xor2) | has_zero_byte(xor3); } + return running; +} - [[nodiscard]] std::string url::get_search() const noexcept { - // If this’s URL’s query is either null or the empty string, then return the empty string. - // Return U+003F (?), followed by this’s URL’s query. - return (!query.has_value() || (query.value().empty())) ? "" : "?" + query.value(); - } +// A forbidden host code point is U+0000 NULL, U+0009 TAB, U+000A LF, U+000D CR, +// U+0020 SPACE, U+0023 (#), U+002F (/), U+003A (:), U+003C (<), U+003E (>), +// U+003F (?), U+0040 (@), U+005B ([), U+005C (\), U+005D (]), U+005E (^), or +// U+007C (|). +constexpr static bool is_forbidden_host_code_point_table[] = { + 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; +static_assert(sizeof(is_forbidden_host_code_point_table) == 256); - [[nodiscard]] std::string url::get_username() const noexcept { - return username; - } +ada_really_inline constexpr bool is_forbidden_host_code_point( + const char c) noexcept { + return is_forbidden_host_code_point_table[uint8_t(c)]; +} - [[nodiscard]] std::string url::get_password() const noexcept { - return password; - } +static_assert(unicode::is_forbidden_host_code_point('\0')); +static_assert(unicode::is_forbidden_host_code_point('\t')); +static_assert(unicode::is_forbidden_host_code_point('\n')); +static_assert(unicode::is_forbidden_host_code_point('\r')); +static_assert(unicode::is_forbidden_host_code_point(' ')); +static_assert(unicode::is_forbidden_host_code_point('#')); +static_assert(unicode::is_forbidden_host_code_point('/')); +static_assert(unicode::is_forbidden_host_code_point(':')); +static_assert(unicode::is_forbidden_host_code_point('?')); +static_assert(unicode::is_forbidden_host_code_point('@')); +static_assert(unicode::is_forbidden_host_code_point('[')); +static_assert(unicode::is_forbidden_host_code_point('?')); +static_assert(unicode::is_forbidden_host_code_point('<')); +static_assert(unicode::is_forbidden_host_code_point('>')); +static_assert(unicode::is_forbidden_host_code_point('\\')); +static_assert(unicode::is_forbidden_host_code_point(']')); +static_assert(unicode::is_forbidden_host_code_point('^')); +static_assert(unicode::is_forbidden_host_code_point('|')); - [[nodiscard]] std::string url::get_port() const noexcept { - return port.has_value() ? std::to_string(port.value()) : ""; - } +constexpr static uint8_t is_forbidden_domain_code_point_table[] = { + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; + +static_assert(sizeof(is_forbidden_domain_code_point_table) == 256); - [[nodiscard]] std::string url::get_hash() const noexcept { - // If this’s URL’s fragment is either null or the empty string, then return the empty string. - // Return U+0023 (#), followed by this’s URL’s fragment. - return (!fragment.has_value() || (fragment.value().empty())) ? "" : "#" + fragment.value(); +ada_really_inline constexpr bool is_forbidden_domain_code_point( + const char c) noexcept { + return is_forbidden_domain_code_point_table[uint8_t(c)]; +} + +ada_really_inline constexpr bool contains_forbidden_domain_code_point( + char* input, size_t length) noexcept { + size_t i = 0; + uint8_t accumulator{}; + for (; i + 4 <= length; i += 4) { + accumulator |= is_forbidden_domain_code_point_table[uint8_t(input[i])]; + accumulator |= is_forbidden_domain_code_point_table[uint8_t(input[i + 1])]; + accumulator |= is_forbidden_domain_code_point_table[uint8_t(input[i + 2])]; + accumulator |= is_forbidden_domain_code_point_table[uint8_t(input[i + 3])]; } + for (; i < length; i++) { + accumulator |= is_forbidden_domain_code_point_table[uint8_t(input[i])]; + } + return accumulator; +} -} // namespace ada -/* end file src/url-getters.cpp */ -// dofile: invoked with prepath=/Users/dlemire/CVS/github/ada/src, filename=url-setters.cpp -/* begin file src/url-setters.cpp */ -/** - * @file url-setters.cpp - * Includes all the setters of `ada::url` - */ +static_assert(unicode::is_forbidden_domain_code_point('%')); +static_assert(unicode::is_forbidden_domain_code_point('\x7f')); +static_assert(unicode::is_forbidden_domain_code_point('\0')); +static_assert(unicode::is_forbidden_domain_code_point('\t')); +static_assert(unicode::is_forbidden_domain_code_point('\n')); +static_assert(unicode::is_forbidden_domain_code_point('\r')); +static_assert(unicode::is_forbidden_domain_code_point(' ')); +static_assert(unicode::is_forbidden_domain_code_point('#')); +static_assert(unicode::is_forbidden_domain_code_point('/')); +static_assert(unicode::is_forbidden_domain_code_point(':')); +static_assert(unicode::is_forbidden_domain_code_point('?')); +static_assert(unicode::is_forbidden_domain_code_point('@')); +static_assert(unicode::is_forbidden_domain_code_point('[')); +static_assert(unicode::is_forbidden_domain_code_point('?')); +static_assert(unicode::is_forbidden_domain_code_point('<')); +static_assert(unicode::is_forbidden_domain_code_point('>')); +static_assert(unicode::is_forbidden_domain_code_point('\\')); +static_assert(unicode::is_forbidden_domain_code_point(']')); +static_assert(unicode::is_forbidden_domain_code_point('^')); +static_assert(unicode::is_forbidden_domain_code_point('|')); + +constexpr static bool is_alnum_plus_table[] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, + 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; -#include -#include +static_assert(sizeof(is_alnum_plus_table) == 256); -namespace ada { +ada_really_inline constexpr bool is_alnum_plus(const char c) noexcept { + return is_alnum_plus_table[uint8_t(c)]; + // A table is almost surely much faster than the + // following under most compilers: return + // return (std::isalnum(c) || c == '+' || c == '-' || c == '.'); +} +static_assert(unicode::is_alnum_plus('+')); +static_assert(unicode::is_alnum_plus('-')); +static_assert(unicode::is_alnum_plus('.')); +static_assert(unicode::is_alnum_plus('0')); +static_assert(unicode::is_alnum_plus('1')); +static_assert(unicode::is_alnum_plus('a')); +static_assert(unicode::is_alnum_plus('b')); + +ada_really_inline constexpr bool is_ascii_hex_digit(const char c) noexcept { + return (c >= '0' && c <= '9') || (c >= 'A' && c <= 'F') || + (c >= 'a' && c <= 'f'); +} - bool url::set_username(const std::string_view input) { - if (cannot_have_credentials_or_port()) { return false; } - username = ada::unicode::percent_encode(input, character_sets::USERINFO_PERCENT_ENCODE); - return true; - } +ada_really_inline constexpr bool is_c0_control_or_space(const char c) noexcept { + return (unsigned char)c <= ' '; +} - bool url::set_password(const std::string_view input) { - if (cannot_have_credentials_or_port()) { return false; } - password = ada::unicode::percent_encode(input, character_sets::USERINFO_PERCENT_ENCODE); - return true; - } +ada_really_inline constexpr bool is_ascii_tab_or_newline( + const char c) noexcept { + return c == '\t' || c == '\n' || c == '\r'; +} - bool url::set_port(const std::string_view input) { - if (cannot_have_credentials_or_port()) { return false; } - std::string trimmed(input); - helpers::remove_ascii_tab_or_newline(trimmed); - if (trimmed.empty()) { port = std::nullopt; return true; } - // Input should not start with control characters. - if (ada::unicode::is_c0_control_or_space(trimmed.front())) { return false; } - // Input should contain at least one ascii digit. - if (input.find_first_of("0123456789") == std::string_view::npos) { return false; } - - // Revert changes if parse_port fails. - std::optional previous_port = port; - parse_port(trimmed); - if (is_valid) { return true; } - port = previous_port; - is_valid = true; +constexpr std::string_view table_is_double_dot_path_segment[] = { + "..", "%2e.", ".%2e", "%2e%2e"}; + +ada_really_inline ada_constexpr bool is_double_dot_path_segment( + std::string_view input) noexcept { + // This will catch most cases: + // The length must be 2,4 or 6. + // We divide by two and require + // that the result be between 1 and 3 inclusively. + uint64_t half_length = uint64_t(input.size()) / 2; + if (half_length - 1 > 2) { return false; } - - void url::set_hash(const std::string_view input) { - if (input.empty()) { - fragment = std::nullopt; - helpers::strip_trailing_spaces_from_opaque_path(*this); - return; + // We have a string of length 2, 4 or 6. + // We now check the first character: + if ((input[0] != '.') && (input[0] != '%')) { + return false; + } + // We are unlikely the get beyond this point. + int hash_value = (input.size() + (unsigned)(input[0])) & 3; + const std::string_view target = table_is_double_dot_path_segment[hash_value]; + if (target.size() != input.size()) { + return false; + } + // We almost never get here. + // Optimizing the rest is relatively unimportant. + auto prefix_equal_unsafe = [](std::string_view a, std::string_view b) { + uint16_t A, B; + memcpy(&A, a.data(), sizeof(A)); + memcpy(&B, b.data(), sizeof(B)); + return A == B; + }; + if (!prefix_equal_unsafe(input, target)) { + return false; + } + for (size_t i = 2; i < input.size(); i++) { + char c = input[i]; + if ((uint8_t((c | 0x20) - 0x61) <= 25 ? (c | 0x20) : c) != target[i]) { + return false; } + } + return true; + // The above code might be a bit better than the code below. Compilers + // are not stupid and may use the fact that these strings have length 2,4 and + // 6 and other tricks. + // return input == ".." || + // input == ".%2e" || input == ".%2E" || + // input == "%2e." || input == "%2E." || + // input == "%2e%2e" || input == "%2E%2E" || input == "%2E%2e" || input == + // "%2e%2E"; +} - std::string new_value; - new_value = input[0] == '#' ? input.substr(1) : input; - helpers::remove_ascii_tab_or_newline(new_value); - fragment = unicode::percent_encode(new_value, ada::character_sets::FRAGMENT_PERCENT_ENCODE); - return; +ada_really_inline constexpr bool is_single_dot_path_segment( + std::string_view input) noexcept { + return input == "." || input == "%2e" || input == "%2E"; +} + +ada_really_inline constexpr bool is_lowercase_hex(const char c) noexcept { + return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f'); +} + +unsigned constexpr convert_hex_to_binary(const char c) noexcept { + // this code can be optimized. + if (c <= '9') { + return c - '0'; } + char del = c >= 'a' ? 'a' : 'A'; + return 10 + (c - del); +} - void url::set_search(const std::string_view input) { - if (input.empty()) { - query = std::nullopt; - helpers::strip_trailing_spaces_from_opaque_path(*this); - return; +std::string percent_decode(const std::string_view input, size_t first_percent) { + // next line is for safety only, we expect users to avoid calling + // percent_decode when first_percent is outside the range. + if (first_percent == std::string_view::npos) { + return std::string(input); + } + std::string dest(input.substr(0, first_percent)); + dest.reserve(input.length()); + const char* pointer = input.data() + first_percent; + const char* end = input.data() + input.size(); + // Optimization opportunity: if the following code gets + // called often, it can be optimized quite a bit. + while (pointer < end) { + const char ch = pointer[0]; + size_t remaining = end - pointer - 1; + if (ch != '%' || remaining < 2 || + ( // ch == '%' && // It is unnecessary to check that ch == '%'. + (!is_ascii_hex_digit(pointer[1]) || + !is_ascii_hex_digit(pointer[2])))) { + dest += ch; + pointer++; + continue; + } else { + unsigned a = convert_hex_to_binary(pointer[1]); + unsigned b = convert_hex_to_binary(pointer[2]); + char c = static_cast(a * 16 + b); + dest += c; + pointer += 3; } + } + return dest; +} - std::string new_value; - new_value = input[0] == '?' ? input.substr(1) : input; - helpers::remove_ascii_tab_or_newline(new_value); +std::string percent_encode(const std::string_view input, + const uint8_t character_set[]) { + auto pointer = + std::find_if(input.begin(), input.end(), [character_set](const char c) { + return character_sets::bit_at(character_set, c); + }); + // Optimization: Don't iterate if percent encode is not required + if (pointer == input.end()) { + return std::string(input); + } - auto query_percent_encode_set = is_special() ? - ada::character_sets::SPECIAL_QUERY_PERCENT_ENCODE : - ada::character_sets::QUERY_PERCENT_ENCODE; + std::string result(input.substr(0, std::distance(input.begin(), pointer))); + result.reserve(input.length()); // in the worst case, percent encoding might + // produce 3 characters. - query = ada::unicode::percent_encode(std::string_view(new_value), query_percent_encode_set); + for (; pointer != input.end(); pointer++) { + if (character_sets::bit_at(character_set, *pointer)) { + result.append(character_sets::hex + uint8_t(*pointer) * 4, 3); + } else { + result += *pointer; + } } - bool url::set_pathname(const std::string_view input) { - if (has_opaque_path) { return false; } - path = ""; - return parse_path(input); + return result; +} + +template +bool percent_encode(const std::string_view input, const uint8_t character_set[], + std::string& out) { + ada_log("percent_encode ", input, " to output string while ", + append ? "appending" : "overwriting"); + auto pointer = + std::find_if(input.begin(), input.end(), [character_set](const char c) { + return character_sets::bit_at(character_set, c); + }); + ada_log("percent_encode done checking, moved to ", + std::distance(input.begin(), pointer)); + + // Optimization: Don't iterate if percent encode is not required + if (pointer == input.end()) { + ada_log("percent_encode encoding not needed."); + return false; + } + if (!append) { + out.clear(); + } + ada_log("percent_encode appending ", std::distance(input.begin(), pointer), + " bytes"); + out.append(input.data(), std::distance(input.begin(), pointer)); + ada_log("percent_encode processing ", std::distance(pointer, input.end()), + " bytes"); + for (; pointer != input.end(); pointer++) { + if (character_sets::bit_at(character_set, *pointer)) { + out.append(character_sets::hex + uint8_t(*pointer) * 4, 3); + } else { + out += *pointer; + } } + return true; +} - bool url::set_host_or_hostname(const std::string_view input, bool override_hostname) { - if (has_opaque_path) { return false; } +bool to_ascii(std::optional& out, const std::string_view plain, + size_t first_percent) { + std::string percent_decoded_buffer; + std::string_view input = plain; + if (first_percent != std::string_view::npos) { + percent_decoded_buffer = unicode::percent_decode(plain, first_percent); + input = percent_decoded_buffer; + } + // input is a non-empty UTF-8 string, must be percent decoded + std::string idna_ascii = ada::idna::to_ascii(input); + if (idna_ascii.empty()) { + return false; + } + out = std::move(idna_ascii); + return true; +} - std::optional previous_host = host; - std::optional previous_port = port; +std::string percent_encode(const std::string_view input, + const uint8_t character_set[], size_t index) { + std::string out; + out.append(input.data(), index); + auto pointer = input.begin() + index; + for (; pointer != input.end(); pointer++) { + if (character_sets::bit_at(character_set, *pointer)) { + out.append(character_sets::hex + uint8_t(*pointer) * 4, 3); + } else { + out += *pointer; + } + } + return out; +} - size_t host_end_pos = input.find('#'); - std::string _host(input.data(), host_end_pos != std::string_view::npos ? host_end_pos : input.size()); - helpers::remove_ascii_tab_or_newline(_host); - std::string_view new_host(_host); +std::string to_unicode(std::string_view input) { + return ada::idna::to_unicode(input); +} - // If url's scheme is "file", then set state to file host state, instead of host state. - if (get_scheme_type() != ada::scheme::type::FILE) { - std::string_view host_view(_host.data(), _host.length()); - auto [location,found_colon] = helpers::get_host_delimiter_location(is_special(), host_view); +} // namespace ada::unicode +/* end file src/unicode.cpp */ +/* begin file src/serializers.cpp */ - // Otherwise, if c is U+003A (:) and insideBrackets is false, then: - // Note: the 'found_colon' value is true if and only if a colon was encountered - // while not inside brackets. - if (found_colon) { - if (override_hostname) { return false; } - std::string_view buffer = new_host.substr(location+1); - if (!buffer.empty()) { set_port(buffer); } - } - // If url is special and host_view is the empty string, validation error, return failure. - // Otherwise, if state override is given, host_view is the empty string, - // and either url includes credentials or url’s port is non-null, return. - else if (host_view.empty() && (is_special() || includes_credentials() || port.has_value())) { - return false; - } +#include +#include - // Let host be the result of host parsing host_view with url is not special. - if (host_view.empty()) { - host = ""; - return true; - } +namespace ada::serializers { - bool succeeded = parse_host(host_view); - if (!succeeded) { - host = previous_host; - port = previous_port; +void find_longest_sequence_of_ipv6_pieces( + const std::array& address, size_t& compress, + size_t& compress_length) noexcept { + for (size_t i = 0; i < 8; i++) { + if (address[i] == 0) { + size_t next = i + 1; + while (next != 8 && address[next] == 0) ++next; + const size_t count = next - i; + if (compress_length < count) { + compress_length = count; + compress = i; + if (next == 8) break; + i = next; } - return succeeded; } + } +} - size_t location = new_host.find_first_of("/\\?"); - if (location != std::string_view::npos) { new_host.remove_suffix(new_host.length() - location); } +std::string ipv6(const std::array& address) noexcept { + size_t compress_length = 0; // The length of a long sequence of zeros. + size_t compress = 0; // The start of a long sequence of zeros. + find_longest_sequence_of_ipv6_pieces(address, compress, compress_length); - if (new_host.empty()) { - // Set url’s host to the empty string. - host = ""; - } - else { - // Let host be the result of host parsing buffer with url is not special. - if (!parse_host(new_host)) { - host = previous_host; - port = previous_port; - return false; - } + if (compress_length <= 1) { + // Optimization opportunity: Find a faster way then snprintf for imploding + // and return here. + compress = compress_length = 8; + } - // If host is "localhost", then set host to the empty string. - if (host.has_value() && host.value() == "localhost") { - host = ""; + std::string output(4 * 8 + 7 + 2, '\0'); + size_t piece_index = 0; + char* point = output.data(); + char* point_end = output.data() + output.size(); + *point++ = '['; + while (true) { + if (piece_index == compress) { + *point++ = ':'; + // If we skip a value initially, we need to write '::', otherwise + // a single ':' will do since it follows a previous ':'. + if (piece_index == 0) { + *point++ = ':'; + } + piece_index += compress_length; + if (piece_index == 8) { + break; } } - return true; + point = std::to_chars(point, point_end, address[piece_index], 16).ptr; + piece_index++; + if (piece_index == 8) { + break; + } + *point++ = ':'; + } + *point++ = ']'; + output.resize(point - output.data()); + return output; +} + +std::string ipv4(const uint64_t address) noexcept { + std::string output(15, '\0'); + char* point = output.data(); + char* point_end = output.data() + output.size(); + point = std::to_chars(point, point_end, uint8_t(address >> 24)).ptr; + for (int i = 2; i >= 0; i--) { + *point++ = '.'; + point = std::to_chars(point, point_end, uint8_t(address >> (i * 8))).ptr; } + output.resize(point - output.data()); + return output; +} + +} // namespace ada::serializers +/* end file src/serializers.cpp */ +/* begin file src/implementation.cpp */ +#include + + +namespace ada { - bool url::set_host(const std::string_view input) { - return set_host_or_hostname(input, false); +template +ada_warn_unused tl::expected parse( + std::string_view input, const result_type* base_url) { + result_type u = ada::parser::parse_url(input, base_url); + if (!u.is_valid) { + return tl::unexpected(errors::generic_error); } + return u; +} - bool url::set_hostname(const std::string_view input) { - return set_host_or_hostname(input, true); +template ada::result parse(std::string_view input, + const url* base_url = nullptr); +template ada::result parse( + std::string_view input, const url_aggregator* base_url = nullptr); + +std::string href_from_file(std::string_view input) { + // This is going to be much faster than constructing a URL. + std::string tmp_buffer; + std::string_view internal_input; + if (unicode::has_tabs_or_newline(input)) { + tmp_buffer = input; + helpers::remove_ascii_tab_or_newline(tmp_buffer); + internal_input = tmp_buffer; + } else { + internal_input = input; + } + std::string path; + if (internal_input.empty()) { + path = "/"; + } else if ((internal_input[0] == '/') || (internal_input[0] == '\\')) { + helpers::parse_prepared_path(internal_input.substr(1), + ada::scheme::type::FILE, path); + } else { + helpers::parse_prepared_path(internal_input, ada::scheme::type::FILE, path); } + return "file://" + path; +} - bool url::set_protocol(const std::string_view input) { - std::string view(input); - helpers::remove_ascii_tab_or_newline(view); - if (view.empty()) { return true; } +ada_warn_unused std::string to_string(ada::encoding_type type) { + switch (type) { + case ada::encoding_type::UTF8: + return "UTF-8"; + case ada::encoding_type::UTF_16LE: + return "UTF-16LE"; + case ada::encoding_type::UTF_16BE: + return "UTF-16BE"; + default: + unreachable(); + } +} - // Schemes should start with alpha values. - if (!checkers::is_alpha(view[0])) { return false; } +} // namespace ada +/* end file src/implementation.cpp */ +/* begin file src/helpers.cpp */ - view.append(":"); +#include +#include +#include +#include - std::string::iterator pointer = std::find_if_not(view.begin(), view.end(), unicode::is_alnum_plus); +namespace ada::helpers { - if (pointer != view.end() && *pointer == ':') { - return parse_scheme(std::string_view(view.data(), pointer - view.begin())); +template +void encode_json(std::string_view view, out_iter out) { + // trivial implementation. could be faster. + const char* hexvalues = + "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f"; + for (uint8_t c : view) { + if (c == '\\') { + *out++ = '\\'; + *out++ = '\\'; + } else if (c == '"') { + *out++ = '\\'; + *out++ = '"'; + } else if (c <= 0x1f) { + *out++ = '\\'; + *out++ = 'u'; + *out++ = '0'; + *out++ = '0'; + *out++ = hexvalues[2 * c]; + *out++ = hexvalues[2 * c + 1]; + } else { + *out++ = c; } - return false; } +} + +ada_unused std::string get_state(ada::state s) { + switch (s) { + case ada::state::AUTHORITY: + return "Authority"; + case ada::state::SCHEME_START: + return "Scheme Start"; + case ada::state::SCHEME: + return "Scheme"; + case ada::state::HOST: + return "Host"; + case ada::state::NO_SCHEME: + return "No Scheme"; + case ada::state::FRAGMENT: + return "Fragment"; + case ada::state::RELATIVE_SCHEME: + return "Relative Scheme"; + case ada::state::RELATIVE_SLASH: + return "Relative Slash"; + case ada::state::FILE: + return "File"; + case ada::state::FILE_HOST: + return "File Host"; + case ada::state::FILE_SLASH: + return "File Slash"; + case ada::state::PATH_OR_AUTHORITY: + return "Path or Authority"; + case ada::state::SPECIAL_AUTHORITY_IGNORE_SLASHES: + return "Special Authority Ignore Slashes"; + case ada::state::SPECIAL_AUTHORITY_SLASHES: + return "Special Authority Slashes"; + case ada::state::SPECIAL_RELATIVE_OR_AUTHORITY: + return "Special Relative or Authority"; + case ada::state::QUERY: + return "Query"; + case ada::state::PATH: + return "Path"; + case ada::state::PATH_START: + return "Path Start"; + case ada::state::OPAQUE_PATH: + return "Opaque Path"; + case ada::state::PORT: + return "Port"; + default: + return "unknown state"; + } +} - bool url::set_href(const std::string_view input) { - ada::result out = ada::parse(input); +ada_really_inline std::optional prune_fragment( + std::string_view& input) noexcept { + // compiles down to 20--30 instructions including a class to memchr (C + // function). this function should be quite fast. + size_t location_of_first = input.find('#'); + if (location_of_first == std::string_view::npos) { + return std::nullopt; + } + std::string_view fragment = input; + fragment.remove_prefix(location_of_first + 1); + input.remove_suffix(input.size() - location_of_first); + return fragment; +} - if (out) { - username = out->username; - password = out->password; - host = out->host; - port = out->port; - path = out->path; - query = out->query; - fragment = out->fragment; - type = out->type; - non_special_scheme = out->non_special_scheme; - has_opaque_path = out->has_opaque_path; +ada_really_inline bool shorten_path(std::string& path, + ada::scheme::type type) noexcept { + size_t first_delimiter = path.find_first_of('/', 1); + + // Let path be url’s path. + // If url’s scheme is "file", path’s size is 1, and path[0] is a normalized + // Windows drive letter, then return. + if (type == ada::scheme::type::FILE && + first_delimiter == std::string_view::npos) { + if (checkers::is_normalized_windows_drive_letter( + std::string_view(path.data() + 1, first_delimiter - 1))) { + return false; } + } - return out.has_value(); + // Remove path’s last item, if any. + if (!path.empty()) { + path.erase(path.rfind('/')); + return true; } -} // namespace ada -/* end file src/url-setters.cpp */ -// dofile: invoked with prepath=/Users/dlemire/CVS/github/ada/src, filename=parser.cpp -/* begin file src/parser.cpp */ + return false; +} -#include +ada_really_inline bool shorten_path(std::string_view& path, + ada::scheme::type type) noexcept { + size_t first_delimiter = path.find_first_of('/', 1); + + // Let path be url’s path. + // If url’s scheme is "file", path’s size is 1, and path[0] is a normalized + // Windows drive letter, then return. + if (type == ada::scheme::type::FILE && + first_delimiter == std::string_view::npos) { + if (checkers::is_normalized_windows_drive_letter( + std::string_view(path.data() + 1, first_delimiter - 1))) { + return false; + } + } -#include -#include + // Remove path’s last item, if any. + if (!path.empty()) { + size_t slash_loc = path.rfind('/'); + if (slash_loc != std::string_view::npos) { + path.remove_suffix(path.size() - slash_loc); + } + return true; + } -namespace ada::parser { + return false; +} - url parse_url(std::string_view user_input, - const ada::url* base_url, - ada::encoding_type encoding) { - ada_log("ada::parser::parse_url('", user_input, - "' [", user_input.size()," bytes],", (base_url != nullptr ? base_url->to_string() : "null"), - ",", ada::to_string(encoding), ")"); - - ada::state state = ada::state::SCHEME_START; - ada::url url = ada::url(); - - // If we are provided with an invalid base, or the optional_url was invalid, - // we must return. - if(base_url != nullptr) { url.is_valid &= base_url->is_valid; } - if(!url.is_valid) { return url; } - - std::string tmp_buffer; - std::string_view internal_input; - if(unicode::has_tabs_or_newline(user_input)) { - tmp_buffer = user_input; - // Optimization opportunity: Instead of copying and then pruning, we could just directly - // build the string from user_input. - helpers::remove_ascii_tab_or_newline(tmp_buffer); - internal_input = tmp_buffer; - } else { - internal_input = user_input; - } - - // Leading and trailing control characters are uncommon and easy to deal with (no performance concern). - std::string_view url_data = internal_input; - helpers::trim_c0_whitespace(url_data); - - // Optimization opportunity. Most websites do not have fragment. - std::optional fragment = helpers::prune_fragment(url_data); - if(fragment.has_value()) { - url.fragment = unicode::percent_encode(*fragment, - ada::character_sets::FRAGMENT_PERCENT_ENCODE); - } - - // Here url_data no longer has its fragment. - // We are going to access the data from url_data (it is immutable). - // At any given time, we are pointing at byte 'input_position' in url_data. - // The input_position variable should range from 0 to input_size. - // It is illegal to access url_data at input_size. - size_t input_position = 0; - const size_t input_size = url_data.size(); - // Keep running the following state machine by switching on state. - // If after a run pointer points to the EOF code point, go to the next step. - // Otherwise, increase pointer by 1 and continue with the state machine. - // We never decrement input_position. - while(input_position <= input_size) { - switch (state) { - case ada::state::SCHEME_START: { - ada_log("SCHEME_START ", helpers::substring(url_data, input_position)); - // If c is an ASCII alpha, append c, lowercased, to buffer, and set state to scheme state. - if ((input_position != input_size) && checkers::is_alpha(url_data[input_position])) { - state = ada::state::SCHEME; - input_position++; - } else { - // Otherwise, if state override is not given, set state to no scheme state and decrease pointer by 1. - state = ada::state::NO_SCHEME; - } - break; - } - case ada::state::SCHEME: { - ada_log("SCHEME ", helpers::substring(url_data, input_position)); - // If c is an ASCII alphanumeric, U+002B (+), U+002D (-), or U+002E (.), append c, lowercased, to buffer. - while((input_position != input_size) && (ada::unicode::is_alnum_plus(url_data[input_position]))) { - input_position++; - } - // Otherwise, if c is U+003A (:), then: - if ((input_position != input_size) && (url_data[input_position] == ':')) { - ada_log("SCHEME the scheme should be ", url_data.substr(0,input_position)); - if(!url.parse_scheme(url_data.substr(0,input_position))) { return url; } - ada_log("SCHEME the scheme is ", url.get_scheme()); - - // If url’s scheme is "file", then: - if (url.get_scheme_type() == ada::scheme::type::FILE) { - // Set state to file state. - state = ada::state::FILE; - } - // Otherwise, if url is special, base is non-null, and base’s scheme is url’s scheme: - // Note: Doing base_url->scheme is unsafe if base_url != nullptr is false. - else if (url.is_special() && base_url != nullptr && base_url->get_scheme_type() == url.get_scheme_type()) { - // Set state to special relative or authority state. - state = ada::state::SPECIAL_RELATIVE_OR_AUTHORITY; - } - // Otherwise, if url is special, set state to special authority slashes state. - else if (url.is_special()) { - state = ada::state::SPECIAL_AUTHORITY_SLASHES; - } - // Otherwise, if remaining starts with an U+002F (/), set state to path or authority state - // and increase pointer by 1. - else if (input_position + 1 < input_size && url_data[input_position + 1] == '/') { - state = ada::state::PATH_OR_AUTHORITY; - input_position++; - } - // Otherwise, set url’s path to the empty string and set state to opaque path state. - else { - state = ada::state::OPAQUE_PATH; - } - } - // Otherwise, if state override is not given, set buffer to the empty string, state to no scheme state, - // and start over (from the first code point in input). - else { - state = ada::state::NO_SCHEME; - input_position = 0; - break; - } - input_position++; - break; - } - case ada::state::NO_SCHEME: { - ada_log("NO_SCHEME ", helpers::substring(url_data, input_position)); - // If base is null, or base has an opaque path and c is not U+0023 (#), validation error, return failure. - // SCHEME state updates the state to NO_SCHEME and validates url_data is not empty. - if (base_url == nullptr || (base_url->has_opaque_path && url_data[input_position] != '#')) { - ada_log("NO_SCHEME validation error"); - url.is_valid = false; - return url; - } - // Otherwise, if base has an opaque path and c is U+0023 (#), - // set url’s scheme to base’s scheme, url’s path to base’s path, url’s query to base’s query, - // url’s fragment to the empty string, and set state to fragment state. - else if (base_url->has_opaque_path && url.fragment.has_value() && input_position == input_size) { - ada_log("NO_SCHEME opaque base with fragment"); - url.copy_scheme(*base_url); - url.path = base_url->path; - url.has_opaque_path = base_url->has_opaque_path; - url.query = base_url->query; - return url; - } - // Otherwise, if base’s scheme is not "file", set state to relative state and decrease pointer by 1. - else if (base_url->get_scheme_type() != ada::scheme::type::FILE) { - ada_log("NO_SCHEME non-file relative path"); - state = ada::state::RELATIVE_SCHEME; - } - // Otherwise, set state to file state and decrease pointer by 1. - else { - ada_log("NO_SCHEME file base type"); - state = ada::state::FILE; - } - break; - } - case ada::state::AUTHORITY: { - ada_log("AUTHORITY ", helpers::substring(url_data, input_position)); - // most URLs have no @. Having no @ tells us that we don't have to worry about AUTHORITY. Of course, - // we could have @ and still not have to worry about AUTHORITY. - // TODO: Instead of just collecting a bool, collect the location of the '@' and do something useful with it. - // TODO: We could do various processing early on, using a single pass over the string to collect - // information about it, e.g., telling us whether there is a @ and if so, where (or how many). - const bool contains_ampersand = (url_data.find('@', input_position) != std::string_view::npos); +ada_really_inline void remove_ascii_tab_or_newline( + std::string& input) noexcept { + // if this ever becomes a performance issue, we could use an approach similar + // to has_tabs_or_newline + input.erase(std::remove_if(input.begin(), input.end(), + [](char c) { + return ada::unicode::is_ascii_tab_or_newline(c); + }), + input.end()); +} - if(!contains_ampersand) { - state = ada::state::HOST; - break; - } - bool at_sign_seen{false}; - bool password_token_seen{false}; - do { - std::string_view view = helpers::substring(url_data, input_position); - size_t location = url.is_special() ? helpers::find_authority_delimiter_special(view) : helpers::find_authority_delimiter(view); - std::string_view authority_view(view.data(), location); - size_t end_of_authority = input_position + authority_view.size(); - // If c is U+0040 (@), then: - if ((end_of_authority != input_size) && (url_data[end_of_authority] == '@')) { - // If atSignSeen is true, then prepend "%40" to buffer. - if (at_sign_seen) { - if (password_token_seen) { - url.password += "%40"; - } else { - url.username += "%40"; - } - } +ada_really_inline std::string_view substring(std::string_view input, + size_t pos) noexcept { + ADA_ASSERT_TRUE(pos <= input.size()); + // The following is safer but uneeded if we have the above line: + // return pos > input.size() ? std::string_view() : input.substr(pos); + return input.substr(pos); +} - at_sign_seen = true; +ada_really_inline void resize(std::string_view& input, size_t pos) noexcept { + ADA_ASSERT_TRUE(pos <= input.size()); + input.remove_suffix(input.size() - pos); +} - if (!password_token_seen) { - size_t password_token_location = authority_view.find(':'); - password_token_seen = password_token_location != std::string_view::npos; +// Reverse the byte order. +ada_really_inline uint64_t swap_bytes(uint64_t val) noexcept { + // performance: this often compiles to a single instruction (e.g., bswap) + return ((((val)&0xff00000000000000ull) >> 56) | + (((val)&0x00ff000000000000ull) >> 40) | + (((val)&0x0000ff0000000000ull) >> 24) | + (((val)&0x000000ff00000000ull) >> 8) | + (((val)&0x00000000ff000000ull) << 8) | + (((val)&0x0000000000ff0000ull) << 24) | + (((val)&0x000000000000ff00ull) << 40) | + (((val)&0x00000000000000ffull) << 56)); +} - if (!password_token_seen) { - url.username += unicode::percent_encode(authority_view, character_sets::USERINFO_PERCENT_ENCODE); - } else { - url.username += unicode::percent_encode(authority_view.substr(0,password_token_location), character_sets::USERINFO_PERCENT_ENCODE); - url.password += unicode::percent_encode(authority_view.substr(password_token_location+1), character_sets::USERINFO_PERCENT_ENCODE); - } - } - else { - url.password += unicode::percent_encode(authority_view, character_sets::USERINFO_PERCENT_ENCODE); - } - } - // Otherwise, if one of the following is true: - // - c is the EOF code point, U+002F (/), U+003F (?), or U+0023 (#) - // - url is special and c is U+005C (\) - else if (end_of_authority == input_size || url_data[end_of_authority] == '/' || url_data[end_of_authority] == '?' || (url.is_special() && url_data[end_of_authority] == '\\')) { - // If atSignSeen is true and authority_view is the empty string, validation error, return failure. - if (at_sign_seen && authority_view.empty()) { - url.is_valid = false; - return url; - } - state = ada::state::HOST; - break; - } - if(end_of_authority == input_size) { return url; } - input_position = end_of_authority + 1; - } while(true); +ada_really_inline uint64_t swap_bytes_if_big_endian(uint64_t val) noexcept { + // performance: under little-endian systems (most systems), this function + // is free (just returns the input). +#if ADA_IS_BIG_ENDIAN + return swap_bytes(val); +#else + return val; // unchanged (trivial) +#endif +} - break; - } - case ada::state::SPECIAL_RELATIVE_OR_AUTHORITY: { - ada_log("SPECIAL_RELATIVE_OR_AUTHORITY ", helpers::substring(url_data, input_position)); +// starting at index location, this finds the next location of a character +// :, /, \\, ? or [. If none is found, view.size() is returned. +// For use within get_host_delimiter_location. +ada_really_inline size_t find_next_host_delimiter_special( + std::string_view view, size_t location) noexcept { + // performance: if you plan to call find_next_host_delimiter more than once, + // you *really* want find_next_host_delimiter to be inlined, because + // otherwise, the constants may get reloaded each time (bad). + auto has_zero_byte = [](uint64_t v) { + return ((v - 0x0101010101010101) & ~(v)&0x8080808080808080); + }; + auto index_of_first_set_byte = [](uint64_t v) { + return ((((v - 1) & 0x101010101010101) * 0x101010101010101) >> 56) - 1; + }; + auto broadcast = [](uint8_t v) -> uint64_t { return 0x101010101010101 * v; }; + size_t i = location; + uint64_t mask1 = broadcast(':'); + uint64_t mask2 = broadcast('/'); + uint64_t mask3 = broadcast('\\'); + uint64_t mask4 = broadcast('?'); + uint64_t mask5 = broadcast('['); + // This loop will get autovectorized under many optimizing compilers, + // so you get actually SIMD! + for (; i + 7 < view.size(); i += 8) { + uint64_t word{}; + // performance: the next memcpy translates into a single CPU instruction. + memcpy(&word, view.data() + i, sizeof(word)); + // performance: on little-endian systems (most systems), this next line is + // free. + word = swap_bytes_if_big_endian(word); + uint64_t xor1 = word ^ mask1; + uint64_t xor2 = word ^ mask2; + uint64_t xor3 = word ^ mask3; + uint64_t xor4 = word ^ mask4; + uint64_t xor5 = word ^ mask5; + uint64_t is_match = has_zero_byte(xor1) | has_zero_byte(xor2) | + has_zero_byte(xor3) | has_zero_byte(xor4) | + has_zero_byte(xor5); + if (is_match) { + return i + index_of_first_set_byte(is_match); + } + } + if (i < view.size()) { + uint64_t word{}; + // performance: the next memcpy translates into a function call, but + // that is difficult to avoid. Might be a bit expensive. + memcpy(&word, view.data() + i, view.size() - i); + word = swap_bytes_if_big_endian(word); + uint64_t xor1 = word ^ mask1; + uint64_t xor2 = word ^ mask2; + uint64_t xor3 = word ^ mask3; + uint64_t xor4 = word ^ mask4; + uint64_t xor5 = word ^ mask5; + uint64_t is_match = has_zero_byte(xor1) | has_zero_byte(xor2) | + has_zero_byte(xor3) | has_zero_byte(xor4) | + has_zero_byte(xor5); + if (is_match) { + return i + index_of_first_set_byte(is_match); + } + } + return view.size(); +} - // If c is U+002F (/) and remaining starts with U+002F (/), - // then set state to special authority ignore slashes state and increase pointer by 1. - std::string_view view = helpers::substring(url_data, input_position); - if (ada::checkers::begins_with(view, "//")) { - state = ada::state::SPECIAL_AUTHORITY_IGNORE_SLASHES; - input_position += 2; - } else { - // Otherwise, validation error, set state to relative state and decrease pointer by 1. - state = ada::state::RELATIVE_SCHEME; - } +// starting at index location, this finds the next location of a character +// :, /, ? or [. If none is found, view.size() is returned. +// For use within get_host_delimiter_location. +ada_really_inline size_t find_next_host_delimiter(std::string_view view, + size_t location) noexcept { + // performance: if you plan to call find_next_host_delimiter more than once, + // you *really* want find_next_host_delimiter to be inlined, because + // otherwise, the constants may get reloaded each time (bad). + auto has_zero_byte = [](uint64_t v) { + return ((v - 0x0101010101010101) & ~(v)&0x8080808080808080); + }; + auto index_of_first_set_byte = [](uint64_t v) { + return ((((v - 1) & 0x101010101010101) * 0x101010101010101) >> 56) - 1; + }; + auto broadcast = [](uint8_t v) -> uint64_t { return 0x101010101010101 * v; }; + size_t i = location; + uint64_t mask1 = broadcast(':'); + uint64_t mask2 = broadcast('/'); + uint64_t mask4 = broadcast('?'); + uint64_t mask5 = broadcast('['); + // This loop will get autovectorized under many optimizing compilers, + // so you get actually SIMD! + for (; i + 7 < view.size(); i += 8) { + uint64_t word{}; + // performance: the next memcpy translates into a single CPU instruction. + memcpy(&word, view.data() + i, sizeof(word)); + // performance: on little-endian systems (most systems), this next line is + // free. + word = swap_bytes_if_big_endian(word); + uint64_t xor1 = word ^ mask1; + uint64_t xor2 = word ^ mask2; + uint64_t xor4 = word ^ mask4; + uint64_t xor5 = word ^ mask5; + uint64_t is_match = has_zero_byte(xor1) | has_zero_byte(xor2) | + has_zero_byte(xor4) | has_zero_byte(xor5); + if (is_match) { + return i + index_of_first_set_byte(is_match); + } + } + if (i < view.size()) { + uint64_t word{}; + // performance: the next memcpy translates into a function call, but + // that is difficult to avoid. Might be a bit expensive. + memcpy(&word, view.data() + i, view.size() - i); + // performance: on little-endian systems (most systems), this next line is + // free. + word = swap_bytes_if_big_endian(word); + uint64_t xor1 = word ^ mask1; + uint64_t xor2 = word ^ mask2; + uint64_t xor4 = word ^ mask4; + uint64_t xor5 = word ^ mask5; + uint64_t is_match = has_zero_byte(xor1) | has_zero_byte(xor2) | + has_zero_byte(xor4) | has_zero_byte(xor5); + if (is_match) { + return i + index_of_first_set_byte(is_match); + } + } + return view.size(); +} +ada_really_inline std::pair get_host_delimiter_location( + const bool is_special, std::string_view& view) noexcept { + /** + * The spec at https://url.spec.whatwg.org/#hostname-state expects us to + * compute a variable called insideBrackets but this variable is only used + * once, to check whether a ':' character was found outside brackets. Exact + * text: "Otherwise, if c is U+003A (:) and insideBrackets is false, then:". + * It is conceptually simpler and arguably more efficient to just return a + * Boolean indicating whether ':' was found outside brackets. + */ + const size_t view_size = view.size(); + size_t location = 0; + bool found_colon = false; + /** + * Performance analysis: + * + * We are basically seeking the end of the hostname which can be indicated + * by the end of the view, or by one of the characters ':', '/', '?', '\\' + * (where '\\' is only applicable for special URLs). However, these must + * appear outside a bracket range. E.g., if you have [something?]fd: then the + * '?' does not count. + * + * So we can skip ahead to the next delimiter, as long as we include '[' in + * the set of delimiters, and that we handle it first. + * + * So the trick is to have a fast function that locates the next delimiter. + * Unless we find '[', then it only needs to be called once! Ideally, such a + * function would be provided by the C++ standard library, but it seems that + * find_first_of is not very fast, so we are forced to roll our own. + * + * We do not break into two loops for speed, but for clarity. + */ + if (is_special) { + // We move to the next delimiter. + location = find_next_host_delimiter_special(view, location); + // Unless we find '[' then we are going only going to have to call + // find_next_host_delimiter_special once. + for (; location < view_size; + location = find_next_host_delimiter_special(view, location)) { + if (view[location] == '[') { + location = view.find(']', location); + if (location == std::string_view::npos) { + // performance: view.find might get translated to a memchr, which + // has no notion of std::string_view::npos, so the code does not + // reflect the assembly. + location = view_size; break; } - case ada::state::PATH_OR_AUTHORITY: { - ada_log("PATH_OR_AUTHORITY ", helpers::substring(url_data, input_position)); - - // If c is U+002F (/), then set state to authority state. - if ((input_position != input_size) && (url_data[input_position] == '/')) { - state = ada::state::AUTHORITY; - input_position++; - } else { - // Otherwise, set state to path state, and decrease pointer by 1. - state = ada::state::PATH; - } - + } else { + found_colon = view[location] == ':'; + break; + } + } + } else { + // We move to the next delimiter. + location = find_next_host_delimiter(view, location); + // Unless we find '[' then we are going only going to have to call + // find_next_host_delimiter_special once. + for (; location < view_size; + location = find_next_host_delimiter(view, location)) { + if (view[location] == '[') { + location = view.find(']', location); + if (location == std::string_view::npos) { + // performance: view.find might get translated to a memchr, which + // has no notion of std::string_view::npos, so the code does not + // reflect the assembly. + location = view_size; break; } - case ada::state::RELATIVE_SCHEME: { - ada_log("RELATIVE_SCHEME ", helpers::substring(url_data, input_position)); + } else { + found_colon = view[location] == ':'; + break; + } + } + } + // performance: remove_suffix may translate into a single instruction. + view.remove_suffix(view_size - location); + return {location, found_colon}; +} - // Set url’s scheme to base’s scheme. - url.copy_scheme(*base_url); +ada_really_inline void trim_c0_whitespace(std::string_view& input) noexcept { + while (!input.empty() && + ada::unicode::is_c0_control_or_space(input.front())) { + input.remove_prefix(1); + } + while (!input.empty() && ada::unicode::is_c0_control_or_space(input.back())) { + input.remove_suffix(1); + } +} - // If c is U+002F (/), then set state to relative slash state. - if ((input_position != input_size) && (url_data[input_position] == '/')) { - ada_log("RELATIVE_SCHEME if c is U+002F (/), then set state to relative slash state"); - state = ada::state::RELATIVE_SLASH; - } else if (url.is_special() && (input_position != input_size) && (url_data[input_position] == '\\')) { - // Otherwise, if url is special and c is U+005C (\), validation error, set state to relative slash state. - ada_log("RELATIVE_SCHEME if url is special and c is U+005C, validation error, set state to relative slash state"); - state = ada::state::RELATIVE_SLASH; - } else { - ada_log("RELATIVE_SCHEME otherwise"); - // Set url’s username to base’s username, url’s password to base’s password, url’s host to base’s host, - // url’s port to base’s port, url’s path to a clone of base’s path, and url’s query to base’s query. - url.username = base_url->username; - url.password = base_url->password; - url.host = base_url->host; - url.port = base_url->port; - url.path = base_url->path; - url.has_opaque_path = base_url->has_opaque_path; - url.query = base_url->query; +ada_really_inline void parse_prepared_path(std::string_view input, + ada::scheme::type type, + std::string& path) { + ada_log("parse_prepared_path ", input); + uint8_t accumulator = checkers::path_signature(input); + // Let us first detect a trivial case. + // If it is special, we check that we have no dot, no %, no \ and no + // character needing percent encoding. Otherwise, we check that we have no %, + // no dot, and no character needing percent encoding. + constexpr uint8_t need_encoding = 1; + constexpr uint8_t backslash_char = 2; + constexpr uint8_t dot_char = 4; + constexpr uint8_t percent_char = 8; + bool special = type != ada::scheme::NOT_SPECIAL; + bool may_need_slow_file_handling = (type == ada::scheme::type::FILE && + checkers::is_windows_drive_letter(input)); + bool trivial_path = + (special ? (accumulator == 0) + : ((accumulator & (need_encoding | dot_char | percent_char)) == + 0)) && + (!may_need_slow_file_handling); + if (accumulator == dot_char && !may_need_slow_file_handling) { + // '4' means that we have at least one dot, but nothing that requires + // percent encoding or decoding. The only part that is not trivial is + // that we may have single dots and double dots path segments. + // If we have such segments, then we either have a path that begins + // with '.' (easy to check), or we have the sequence './'. + // Note: input cannot be empty, it must at least contain one character ('.') + // Note: we know that '\' is not present. + if (input[0] != '.') { + size_t slashdot = input.find("/."); + if (slashdot == std::string_view::npos) { // common case + trivial_path = true; + } else { // uncommon + // only three cases matter: /./, /.. or a final / + trivial_path = + !(slashdot + 2 == input.size() || input[slashdot + 2] == '.' || + input[slashdot + 2] == '/'); + } + } + } + if (trivial_path) { + ada_log("parse_path trivial"); + path += '/'; + path += input; + return; + } + // We are going to need to look a bit at the path, but let us see if we can + // ignore percent encoding *and* backslashes *and* percent characters. + // Except for the trivial case, this is likely to capture 99% of paths out + // there. + bool fast_path = + (special && + (accumulator & (need_encoding | backslash_char | percent_char)) == 0) && + (type != ada::scheme::type::FILE); + if (fast_path) { + ada_log("parse_prepared_path fast"); + // Here we don't need to worry about \ or percent encoding. + // We also do not have a file protocol. We might have dots, however, + // but dots must as appear as '.', and they cannot be encoded because + // the symbol '%' is not present. + size_t previous_location = 0; // We start at 0. + do { + size_t new_location = input.find('/', previous_location); + // std::string_view path_view = input; + // We process the last segment separately: + if (new_location == std::string_view::npos) { + std::string_view path_view = input.substr(previous_location); + if (path_view == "..") { // The path ends with .. + // e.g., if you receive ".." with an empty path, you go to "/". + if (path.empty()) { + path = '/'; + return; + } + // Fast case where we have nothing to do: + if (path.back() == '/') { + return; + } + // If you have the path "/joe/myfriend", + // then you delete 'myfriend'. + path.resize(path.rfind('/') + 1); + return; + } + path += '/'; + if (path_view != ".") { + path.append(path_view); + } + return; + } else { + // This is a non-final segment. + std::string_view path_view = + input.substr(previous_location, new_location - previous_location); + previous_location = new_location + 1; + if (path_view == "..") { + if (!path.empty()) { + path.erase(path.rfind('/')); + } + } else if (path_view != ".") { + path += '/'; + path.append(path_view); + } + } + } while (true); + } else { + ada_log("parse_path slow"); + // we have reached the general case + bool needs_percent_encoding = (accumulator & 1); + std::string path_buffer_tmp; + do { + size_t location = (special && (accumulator & 2)) + ? input.find_first_of("/\\") + : input.find('/'); + std::string_view path_view = input; + if (location != std::string_view::npos) { + path_view.remove_suffix(path_view.size() - location); + input.remove_prefix(location + 1); + } + // path_buffer is either path_view or it might point at a percent encoded + // temporary file. + std::string_view path_buffer = + (needs_percent_encoding && + ada::unicode::percent_encode( + path_view, character_sets::PATH_PERCENT_ENCODE, path_buffer_tmp)) + ? path_buffer_tmp + : path_view; + if (unicode::is_double_dot_path_segment(path_buffer)) { + helpers::shorten_path(path, type); + if (location == std::string_view::npos) { + path += '/'; + } + } else if (unicode::is_single_dot_path_segment(path_buffer) && + (location == std::string_view::npos)) { + path += '/'; + } + // Otherwise, if path_buffer is not a single-dot path segment, then: + else if (!unicode::is_single_dot_path_segment(path_buffer)) { + // If url’s scheme is "file", url’s path is empty, and path_buffer is a + // Windows drive letter, then replace the second code point in + // path_buffer with U+003A (:). + if (type == ada::scheme::type::FILE && path.empty() && + checkers::is_windows_drive_letter(path_buffer)) { + path += '/'; + path += path_buffer[0]; + path += ':'; + path_buffer.remove_prefix(2); + path.append(path_buffer); + } else { + // Append path_buffer to url’s path. + path += '/'; + path.append(path_buffer); + } + } + if (location == std::string_view::npos) { + return; + } + } while (true); + } +} - // If c is U+003F (?), then set url’s query to the empty string, and state to query state. - if ((input_position != input_size) && (url_data[input_position] == '?')) { - state = ada::state::QUERY; - } - // Otherwise, if c is not the EOF code point: - else if (input_position != input_size) { - // Set url’s query to null. - url.query = std::nullopt; +bool overlaps(std::string_view input1, const std::string& input2) noexcept { + ada_log("helpers::overlaps check if string_view '", input1, "' [", + input1.size(), " bytes] is part of string '", input2, "' [", + input2.size(), " bytes]"); + return !input1.empty() && !input2.empty() && input1.data() >= input2.data() && + input1.data() < input2.data() + input2.size(); +} - // Shorten url’s path. - helpers::shorten_path(url.path, url.get_scheme_type()); +template +ada_really_inline void strip_trailing_spaces_from_opaque_path( + url_type& url) noexcept { + ada_log("helpers::strip_trailing_spaces_from_opaque_path"); + if (!url.has_opaque_path) return; + if (url.base_fragment_has_value()) return; + if (url.base_search_has_value()) return; + + auto path = std::string(url.get_pathname()); + while (!path.empty() && path.back() == ' ') { + path.resize(path.size() - 1); + } + url.update_base_pathname(path); +} - // Set state to path state and decrease pointer by 1. - state = ada::state::PATH; - break; - } - } - input_position++; - break; - } - case ada::state::RELATIVE_SLASH: { - ada_log("RELATIVE_SLASH ", helpers::substring(url_data, input_position)); +ada_really_inline size_t +find_authority_delimiter_special(std::string_view view) noexcept { + auto has_zero_byte = [](uint64_t v) { + return ((v - 0x0101010101010101) & ~(v)&0x8080808080808080); + }; + auto index_of_first_set_byte = [](uint64_t v) { + return ((((v - 1) & 0x101010101010101) * 0x101010101010101) >> 56) - 1; + }; + auto broadcast = [](uint8_t v) -> uint64_t { return 0x101010101010101 * v; }; + size_t i = 0; + uint64_t mask1 = broadcast('@'); + uint64_t mask2 = broadcast('/'); + uint64_t mask3 = broadcast('?'); + uint64_t mask4 = broadcast('\\'); + + for (; i + 7 < view.size(); i += 8) { + uint64_t word{}; + memcpy(&word, view.data() + i, sizeof(word)); + word = swap_bytes_if_big_endian(word); + uint64_t xor1 = word ^ mask1; + uint64_t xor2 = word ^ mask2; + uint64_t xor3 = word ^ mask3; + uint64_t xor4 = word ^ mask4; + uint64_t is_match = has_zero_byte(xor1) | has_zero_byte(xor2) | + has_zero_byte(xor3) | has_zero_byte(xor4); + if (is_match) { + return i + index_of_first_set_byte(is_match); + } + } - // If url is special and c is U+002F (/) or U+005C (\), then: - if (url.is_special() && (input_position != input_size) && (url_data[input_position] == '/' || url_data[input_position] =='\\')) { - // Set state to special authority ignore slashes state. - state = ada::state::SPECIAL_AUTHORITY_IGNORE_SLASHES; - } - // Otherwise, if c is U+002F (/), then set state to authority state. - else if ((input_position != input_size) && (url_data[input_position] == '/')) { - state = ada::state::AUTHORITY; - } - // Otherwise, set - // - url’s username to base’s username, - // - url’s password to base’s password, - // - url’s host to base’s host, - // - url’s port to base’s port, - // - state to path state, and then, decrease pointer by 1. - else { - url.username = base_url->username; - url.password = base_url->password; - url.host = base_url->host; - url.port = base_url->port; - state = ada::state::PATH; - break; - } + if (i < view.size()) { + uint64_t word{}; + memcpy(&word, view.data() + i, view.size() - i); + word = swap_bytes_if_big_endian(word); + uint64_t xor1 = word ^ mask1; + uint64_t xor2 = word ^ mask2; + uint64_t xor3 = word ^ mask3; + uint64_t xor4 = word ^ mask4; + uint64_t is_match = has_zero_byte(xor1) | has_zero_byte(xor2) | + has_zero_byte(xor3) | has_zero_byte(xor4); + if (is_match) { + return i + index_of_first_set_byte(is_match); + } + } - input_position++; - break; - } - case ada::state::SPECIAL_AUTHORITY_SLASHES: { - ada_log("SPECIAL_AUTHORITY_SLASHES ", helpers::substring(url_data, input_position)); + return view.size(); +} - // If c is U+002F (/) and remaining starts with U+002F (/), - // then set state to special authority ignore slashes state and increase pointer by 1. - state = ada::state::SPECIAL_AUTHORITY_IGNORE_SLASHES; - std::string_view view = helpers::substring(url_data, input_position); - if (ada::checkers::begins_with(view, "//")) { - input_position += 2; - } +ada_really_inline size_t +find_authority_delimiter(std::string_view view) noexcept { + auto has_zero_byte = [](uint64_t v) { + return ((v - 0x0101010101010101) & ~(v)&0x8080808080808080); + }; + auto index_of_first_set_byte = [](uint64_t v) { + return ((((v - 1) & 0x101010101010101) * 0x101010101010101) >> 56) - 1; + }; + auto broadcast = [](uint8_t v) -> uint64_t { return 0x101010101010101 * v; }; + size_t i = 0; + uint64_t mask1 = broadcast('@'); + uint64_t mask2 = broadcast('/'); + uint64_t mask3 = broadcast('?'); + + for (; i + 7 < view.size(); i += 8) { + uint64_t word{}; + memcpy(&word, view.data() + i, sizeof(word)); + word = swap_bytes_if_big_endian(word); + uint64_t xor1 = word ^ mask1; + uint64_t xor2 = word ^ mask2; + uint64_t xor3 = word ^ mask3; + uint64_t is_match = + has_zero_byte(xor1) | has_zero_byte(xor2) | has_zero_byte(xor3); + if (is_match) { + return i + index_of_first_set_byte(is_match); + } + } - [[fallthrough]]; - } - case ada::state::SPECIAL_AUTHORITY_IGNORE_SLASHES: { - ada_log("SPECIAL_AUTHORITY_IGNORE_SLASHES ", helpers::substring(url_data, input_position)); + if (i < view.size()) { + uint64_t word{}; + memcpy(&word, view.data() + i, view.size() - i); + word = swap_bytes_if_big_endian(word); + uint64_t xor1 = word ^ mask1; + uint64_t xor2 = word ^ mask2; + uint64_t xor3 = word ^ mask3; + uint64_t is_match = + has_zero_byte(xor1) | has_zero_byte(xor2) | has_zero_byte(xor3); + if (is_match) { + return i + index_of_first_set_byte(is_match); + } + } - // If c is neither U+002F (/) nor U+005C (\), then set state to authority state and decrease pointer by 1. - while ((input_position != input_size) && ((url_data[input_position] == '/') || (url_data[input_position] == '\\'))) { - input_position++; - } - state = ada::state::AUTHORITY; + return view.size(); +} - break; - } - case ada::state::QUERY: { - ada_log("QUERY ", helpers::substring(url_data, input_position)); - // If encoding is not UTF-8 and one of the following is true: - // - url is not special - // - url’s scheme is "ws" or "wss" - if (encoding != ada::encoding_type::UTF8) { - if (!url.is_special() || url.get_scheme_type() == ada::scheme::type::WS || url.get_scheme_type() == ada::scheme::type::WSS) { - // then set encoding to UTF-8. - encoding = ada::encoding_type::UTF8; - } - } - // Let queryPercentEncodeSet be the special-query percent-encode set if url is special; - // otherwise the query percent-encode set. - auto query_percent_encode_set = url.is_special() ? - ada::character_sets::SPECIAL_QUERY_PERCENT_ENCODE : - ada::character_sets::QUERY_PERCENT_ENCODE; +} // namespace ada::helpers - // Percent-encode after encoding, with encoding, buffer, and queryPercentEncodeSet, - // and append the result to url’s query. - url.query = ada::unicode::percent_encode(helpers::substring(url_data, input_position), query_percent_encode_set); +namespace ada { +ada_warn_unused std::string to_string(ada::state state) { + return ada::helpers::get_state(state); +} +} // namespace ada +/* end file src/helpers.cpp */ +/* begin file src/url.cpp */ - return url; - } - case ada::state::HOST: { - ada_log("HOST ", helpers::substring(url_data, input_position)); - - std::string_view host_view = helpers::substring(url_data, input_position); - auto [location, found_colon] = helpers::get_host_delimiter_location(url.is_special(), host_view); - input_position = (location != std::string_view::npos) ? input_position + location : input_size; - // Otherwise, if c is U+003A (:) and insideBrackets is false, then: - // Note: the 'found_colon' value is true if and only if a colon was encountered - // while not inside brackets. - if (found_colon) { - // If buffer is the empty string, validation error, return failure. - // Let host be the result of host parsing buffer with url is not special. - ada_log("HOST parsing ", host_view); - if(!url.parse_host(host_view)) { return url; } - ada_log("HOST parsing results in ", url.host.has_value() ? "none" : url.host.value()); - // Set url’s host to host, buffer to the empty string, and state to port state. - state = ada::state::PORT; - input_position++; - } - // Otherwise, if one of the following is true: - // - c is the EOF code point, U+002F (/), U+003F (?), or U+0023 (#) - // - url is special and c is U+005C (\) - // The get_host_delimiter_location function either brings us to - // the colon outside of the bracket, or to one of those characters. - else { +#include +#include +#include - // If url is special and host_view is the empty string, validation error, return failure. - if (url.is_special() && host_view.empty()) { - url.is_valid = false; - return url; - } +namespace ada { - // Let host be the result of host parsing host_view with url is not special. - if (host_view.empty()) { - url.host = ""; - } else { - if(!url.parse_host(host_view)) { return url; } - } - // Set url’s host to host, and state to path start state. - state = ada::state::PATH_START; - } +bool url::parse_opaque_host(std::string_view input) { + ada_log("parse_opaque_host ", input, "[", input.size(), " bytes]"); + if (std::any_of(input.begin(), input.end(), + ada::unicode::is_forbidden_host_code_point)) { + return is_valid = false; + } - break; - } - case ada::state::OPAQUE_PATH: { - ada_log("OPAQUE_PATH ", helpers::substring(url_data, input_position)); - std::string_view view = helpers::substring(url_data, input_position); - // If c is U+003F (?), then set url’s query to the empty string and state to query state. - size_t location = view.find('?'); - if(location != std::string_view::npos) { - view.remove_suffix(view.size() - location); - state = ada::state::QUERY; - input_position += location + 1; - } else { - input_position = input_size + 1; - } - url.has_opaque_path = true; - url.path = unicode::percent_encode(view, character_sets::C0_CONTROL_PERCENT_ENCODE); - break; - } - case ada::state::PORT: { - ada_log("PORT ", helpers::substring(url_data, input_position)); - std::string_view port_view = helpers::substring(url_data, input_position); - size_t consumed_bytes = url.parse_port(port_view, true); - input_position += consumed_bytes; - if(!url.is_valid) { return url; } - state = state::PATH_START; - [[fallthrough]]; - } - case ada::state::PATH_START: { - ada_log("PATH_START ", helpers::substring(url_data, input_position)); + // Return the result of running UTF-8 percent-encode on input using the C0 + // control percent-encode set. + host = ada::unicode::percent_encode( + input, ada::character_sets::C0_CONTROL_PERCENT_ENCODE); + return true; +} - // If url is special, then: - if (url.is_special()) { - // Set state to path state. - state = ada::state::PATH; +bool url::parse_ipv4(std::string_view input) { + ada_log("parse_ipv4 ", input, "[", input.size(), " bytes]"); + if (input.back() == '.') { + input.remove_suffix(1); + } + size_t digit_count{0}; + int pure_decimal_count = 0; // entries that are decimal + std::string_view original_input = + input; // we might use this if pure_decimal_count == 4. + uint64_t ipv4{0}; + // we could unroll for better performance? + for (; (digit_count < 4) && !(input.empty()); digit_count++) { + uint32_t + segment_result{}; // If any number exceeds 32 bits, we have an error. + bool is_hex = checkers::has_hex_prefix(input); + if (is_hex && ((input.length() == 2) || + ((input.length() > 2) && (input[2] == '.')))) { + // special case + segment_result = 0; + input.remove_prefix(2); + } else { + std::from_chars_result r; + if (is_hex) { + r = std::from_chars(input.data() + 2, input.data() + input.size(), + segment_result, 16); + } else if ((input.length() >= 2) && input[0] == '0' && + checkers::is_digit(input[1])) { + r = std::from_chars(input.data() + 1, input.data() + input.size(), + segment_result, 8); + } else { + pure_decimal_count++; + r = std::from_chars(input.data(), input.data() + input.size(), + segment_result, 10); + } + if (r.ec != std::errc()) { + return is_valid = false; + } + input.remove_prefix(r.ptr - input.data()); + } + if (input.empty()) { + // We have the last value. + // At this stage, ipv4 contains digit_count*8 bits. + // So we have 32-digit_count*8 bits left. + if (segment_result > (uint64_t(1) << (32 - digit_count * 8))) { + return is_valid = false; + } + ipv4 <<= (32 - digit_count * 8); + ipv4 |= segment_result; + goto final; + } else { + // There is more, so that the value must no be larger than 255 + // and we must have a '.'. + if ((segment_result > 255) || (input[0] != '.')) { + return is_valid = false; + } + ipv4 <<= 8; + ipv4 |= segment_result; + input.remove_prefix(1); // remove '.' + } + } + if ((digit_count != 4) || (!input.empty())) { + return is_valid = false; + } +final: + // We could also check r.ptr to see where the parsing ended. + if (pure_decimal_count == 4) { + host = original_input; // The original input was already all decimal and we + // validated it. + } else { + host = ada::serializers::ipv4(ipv4); // We have to reserialize the address. + } + return true; +} - // Optimization: Avoiding going into PATH state improves the performance of urls ending with /. - if (input_position == input_size) { - url.path = "/"; - return url; - } - // If c is neither U+002F (/) nor U+005C (\), then decrease pointer by 1. - // We know that (input_position == input_size) is impossible here, because of the previous if-check. - if ((url_data[input_position] != '/') && (url_data[input_position] != '\\')) { - break; - } - } - // Otherwise, if state override is not given and c is U+003F (?), - // set url’s query to the empty string and state to query state. - else if ((input_position != input_size) && (url_data[input_position] == '?')) { - state = ada::state::QUERY; - } - // Otherwise, if c is not the EOF code point: - else if (input_position != input_size) { - // Set state to path state. - state = ada::state::PATH; +bool url::parse_ipv6(std::string_view input) { + ada_log("parse_ipv6 ", input, "[", input.size(), " bytes]"); - // If c is not U+002F (/), then decrease pointer by 1. - if (url_data[input_position] != '/') { - break; - } - } + if (input.empty()) { + return is_valid = false; + } + // Let address be a new IPv6 address whose IPv6 pieces are all 0. + std::array address{}; - input_position++; - break; - } - case ada::state::PATH: { - std::string_view view = helpers::substring(url_data, input_position); - ada_log("PATH ", helpers::substring(url_data, input_position)); + // Let pieceIndex be 0. + int piece_index = 0; - // Most time, we do not need percent encoding. - // Furthermore, we can immediately locate the '?'. - size_t locofquestionmark = view.find('?'); - if(locofquestionmark != std::string_view::npos) { - state = ada::state::QUERY; - view.remove_suffix(view.size()-locofquestionmark); - input_position += locofquestionmark + 1; - } else { - input_position = input_size + 1; - } - if(!helpers::parse_prepared_path(view, url.get_scheme_type(), url.path)) { return url; } - break; - } - case ada::state::FILE_SLASH: { - ada_log("FILE_SLASH ", helpers::substring(url_data, input_position)); + // Let compress be null. + std::optional compress{}; - // If c is U+002F (/) or U+005C (\), then: - if ((input_position != input_size) && (url_data[input_position] == '/' || url_data[input_position] == '\\')) { - ada_log("FILE_SLASH c is U+002F or U+005C"); - // Set state to file host state. - state = ada::state::FILE_HOST; - input_position++; - } else { - ada_log("FILE_SLASH otherwise"); - // If base is non-null and base’s scheme is "file", then: - // Note: it is unsafe to do base_url->scheme unless you know that - // base_url_has_value() is true. - if (base_url != nullptr && base_url->get_scheme_type() == ada::scheme::type::FILE) { - // Set url’s host to base’s host. - url.host = base_url->host; + // Let pointer be a pointer for input. + std::string_view::iterator pointer = input.begin(); - // If the code point substring from pointer to the end of input does not start with - // a Windows drive letter and base’s path[0] is a normalized Windows drive letter, - // then append base’s path[0] to url’s path. - if (!base_url->path.empty()) { - if (!checkers::is_windows_drive_letter(helpers::substring(url_data, input_position))) { - std::string_view first_base_url_path = base_url->path; - first_base_url_path.remove_prefix(1); - size_t loc = first_base_url_path.find('/'); - if(loc != std::string_view::npos) { - first_base_url_path.remove_suffix(first_base_url_path.size() - loc); - } - if (checkers::is_normalized_windows_drive_letter(first_base_url_path)) { - url.path += '/'; - url.path += first_base_url_path; - } - } - } - } + // If c is U+003A (:), then: + if (input[0] == ':') { + // If remaining does not start with U+003A (:), validation error, return + // failure. + if (input.size() == 1 || input[1] != ':') { + ada_log("parse_ipv6 starts with : but the rest does not start with :"); + return is_valid = false; + } - // Set state to path state, and decrease pointer by 1. - state = ada::state::PATH; - } + // Increase pointer by 2. + pointer += 2; - break; - } - case ada::state::FILE_HOST: { - std::string_view view = helpers::substring(url_data, input_position); - ada_log("FILE_HOST ", helpers::substring(url_data, input_position)); + // Increase pieceIndex by 1 and then set compress to pieceIndex. + compress = ++piece_index; + } - size_t location = view.find_first_of("/\\?"); - std::string_view file_host_buffer(view.data(), (location != std::string_view::npos) ? location : view.size()); + // While c is not the EOF code point: + while (pointer != input.end()) { + // If pieceIndex is 8, validation error, return failure. + if (piece_index == 8) { + ada_log("parse_ipv6 piece_index == 8"); + return is_valid = false; + } - if (checkers::is_windows_drive_letter(file_host_buffer)) { - state = ada::state::PATH; - } else if (file_host_buffer.empty()) { - // Set url’s host to the empty string. - url.host = ""; - // Set state to path start state. - state = ada::state::PATH_START; - } else { - size_t consumed_bytes = file_host_buffer.size(); - input_position += consumed_bytes; - // Let host be the result of host parsing buffer with url is not special. - if(!url.parse_host(file_host_buffer)) { return url; } + // If c is U+003A (:), then: + if (*pointer == ':') { + // If compress is non-null, validation error, return failure. + if (compress.has_value()) { + ada_log("parse_ipv6 compress is non-null"); + return is_valid = false; + } - // If host is "localhost", then set host to the empty string. - if (url.host.has_value() && url.host.value() == "localhost") { - url.host = ""; - } + // Increase pointer and pieceIndex by 1, set compress to pieceIndex, and + // then continue. + pointer++; + compress = ++piece_index; + continue; + } - // Set buffer to the empty string and state to path start state. - state = ada::state::PATH_START; - } + // Let value and length be 0. + uint16_t value = 0, length = 0; + + // While length is less than 4 and c is an ASCII hex digit, + // set value to value × 0x10 + c interpreted as hexadecimal number, and + // increase pointer and length by 1. + while (length < 4 && pointer != input.end() && + unicode::is_ascii_hex_digit(*pointer)) { + // https://stackoverflow.com/questions/39060852/why-does-the-addition-of-two-shorts-return-an-int + value = uint16_t(value * 0x10 + unicode::convert_hex_to_binary(*pointer)); + pointer++; + length++; + } - break; - } - case ada::state::FILE: { - ada_log("FILE ", helpers::substring(url_data, input_position)); - std::string_view file_view = helpers::substring(url_data, input_position); + // If c is U+002E (.), then: + if (pointer != input.end() && *pointer == '.') { + // If length is 0, validation error, return failure. + if (length == 0) { + ada_log("parse_ipv6 length is 0"); + return is_valid = false; + } - // Set url’s scheme to "file". - url.set_scheme("file"); + // Decrease pointer by length. + pointer -= length; - // Set url’s host to the empty string. - url.host = ""; + // If pieceIndex is greater than 6, validation error, return failure. + if (piece_index > 6) { + ada_log("parse_ipv6 piece_index > 6"); + return is_valid = false; + } + + // Let numbersSeen be 0. + int numbers_seen = 0; - // If c is U+002F (/) or U+005C (\), then: - if (input_position != input_size && (url_data[input_position] == '/' || url_data[input_position] == '\\')) { - ada_log("FILE c is U+002F or U+005C"); - // Set state to file slash state. - state = ada::state::FILE_SLASH; + // While c is not the EOF code point: + while (pointer != input.end()) { + // Let ipv4Piece be null. + std::optional ipv4_piece{}; + + // If numbersSeen is greater than 0, then: + if (numbers_seen > 0) { + // If c is a U+002E (.) and numbersSeen is less than 4, then increase + // pointer by 1. + if (*pointer == '.' && numbers_seen < 4) { + pointer++; } - // Otherwise, if base is non-null and base’s scheme is "file": - else if (base_url != nullptr && base_url->get_scheme_type() == ada::scheme::type::FILE) { - // Set url’s host to base’s host, url’s path to a clone of base’s path, and url’s query to base’s query. - ada_log("FILE base non-null"); - url.host = base_url->host; - url.path = base_url->path; - url.has_opaque_path = base_url->has_opaque_path; - url.query = base_url->query; + // Otherwise, validation error, return failure. + else { + ada_log("parse_ipv6 Otherwise, validation error, return failure"); + return is_valid = false; + } + } - // If c is U+003F (?), then set url’s query to the empty string and state to query state. - if (input_position != input_size && url_data[input_position] == '?') { - state = ada::state::QUERY; - } - // Otherwise, if c is not the EOF code point: - else if (input_position != input_size) { - // Set url’s query to null. - url.query = std::nullopt; - - // If the code point substring from pointer to the end of input does not start with a - // Windows drive letter, then shorten url’s path. - if (!checkers::is_windows_drive_letter(file_view)) { - helpers::shorten_path(url.path, url.get_scheme_type()); - } - // Otherwise: - else { - // Set url’s path to an empty list. - url.path.clear(); - url.has_opaque_path = true; - } + // If c is not an ASCII digit, validation error, return failure. + if (pointer == input.end() || !checkers::is_digit(*pointer)) { + ada_log( + "parse_ipv6 If c is not an ASCII digit, validation error, return " + "failure"); + return is_valid = false; + } - // Set state to path state and decrease pointer by 1. - state = ada::state::PATH; - break; - } + // While c is an ASCII digit: + while (pointer != input.end() && checkers::is_digit(*pointer)) { + // Let number be c interpreted as decimal number. + int number = *pointer - '0'; + + // If ipv4Piece is null, then set ipv4Piece to number. + if (!ipv4_piece.has_value()) { + ipv4_piece = number; } - // Otherwise, set state to path state, and decrease pointer by 1. + // Otherwise, if ipv4Piece is 0, validation error, return failure. + else if (ipv4_piece == 0) { + ada_log("parse_ipv6 if ipv4Piece is 0, validation error"); + return is_valid = false; + } + // Otherwise, set ipv4Piece to ipv4Piece × 10 + number. else { - ada_log("FILE go to path"); - state = ada::state::PATH; - break; + ipv4_piece = *ipv4_piece * 10 + number; } - input_position++; - break; + // If ipv4Piece is greater than 255, validation error, return failure. + if (ipv4_piece > 255) { + ada_log("parse_ipv6 ipv4_piece > 255"); + return is_valid = false; + } + + // Increase pointer by 1. + pointer++; + } + + // Set address[pieceIndex] to address[pieceIndex] × 0x100 + ipv4Piece. + // https://stackoverflow.com/questions/39060852/why-does-the-addition-of-two-shorts-return-an-int + address[piece_index] = + uint16_t(address[piece_index] * 0x100 + *ipv4_piece); + + // Increase numbersSeen by 1. + numbers_seen++; + + // If numbersSeen is 2 or 4, then increase pieceIndex by 1. + if (numbers_seen == 2 || numbers_seen == 4) { + piece_index++; } - default: - ada::unreachable(); } + + // If numbersSeen is not 4, validation error, return failure. + if (numbers_seen != 4) { + return is_valid = false; + } + + // Break. + break; } - ada_log("returning ", url.to_string()); - return url; + // Otherwise, if c is U+003A (:): + else if ((pointer != input.end()) && (*pointer == ':')) { + // Increase pointer by 1. + pointer++; + + // If c is the EOF code point, validation error, return failure. + if (pointer == input.end()) { + ada_log( + "parse_ipv6 If c is the EOF code point, validation error, return " + "failure"); + return is_valid = false; + } + } + // Otherwise, if c is not the EOF code point, validation error, return + // failure. + else if (pointer != input.end()) { + ada_log( + "parse_ipv6 Otherwise, if c is not the EOF code point, validation " + "error, return failure"); + return is_valid = false; + } + + // Set address[pieceIndex] to value. + address[piece_index] = value; + + // Increase pieceIndex by 1. + piece_index++; } -} // namespace ada::parser -/* end file src/parser.cpp */ + // If compress is non-null, then: + if (compress.has_value()) { + // Let swaps be pieceIndex − compress. + int swaps = piece_index - *compress; + + // Set pieceIndex to 7. + piece_index = 7; + + // While pieceIndex is not 0 and swaps is greater than 0, + // swap address[pieceIndex] with address[compress + swaps − 1], and then + // decrease both pieceIndex and swaps by 1. + while (piece_index != 0 && swaps > 0) { + std::swap(address[piece_index], address[*compress + swaps - 1]); + piece_index--; + swaps--; + } + } + // Otherwise, if compress is null and pieceIndex is not 8, validation error, + // return failure. + else if (piece_index != 8) { + ada_log( + "parse_ipv6 if compress is null and pieceIndex is not 8, validation " + "error, return failure"); + return is_valid = false; + } + host = ada::serializers::ipv6(address); + ada_log("parse_ipv6 ", *host); + return true; +} + +template +ada_really_inline bool url::parse_scheme(const std::string_view input) { + auto parsed_type = ada::scheme::get_scheme_type(input); + bool is_input_special = (parsed_type != ada::scheme::NOT_SPECIAL); + /** + * In the common case, we will immediately recognize a special scheme (e.g., + *http, https), in which case, we can go really fast. + **/ + if (is_input_special) { // fast path!!! + if (has_state_override) { + // If url’s scheme is not a special scheme and buffer is a special scheme, + // then return. + if (is_special() != is_input_special) { + return true; + } + + // If url includes credentials or has a non-null port, and buffer is + // "file", then return. + if ((includes_credentials() || port.has_value()) && + parsed_type == ada::scheme::type::FILE) { + return true; + } + + // If url’s scheme is "file" and its host is an empty host, then return. + // An empty host is the empty string. + if (type == ada::scheme::type::FILE && host.has_value() && + host.value().empty()) { + return true; + } + } + + type = parsed_type; + + if (has_state_override) { + // This is uncommon. + uint16_t urls_scheme_port = get_special_port(); + + if (urls_scheme_port) { + // If url’s port is url’s scheme’s default port, then set url’s port to + // null. + if (port.has_value() && *port == urls_scheme_port) { + port = std::nullopt; + } + } + } + } else { // slow path + std::string _buffer = std::string(input); + // Next function is only valid if the input is ASCII and returns false + // otherwise, but it seems that we always have ascii content so we do not + // need to check the return value. + // bool is_ascii = + unicode::to_lower_ascii(_buffer.data(), _buffer.size()); + + if (has_state_override) { + // If url’s scheme is a special scheme and buffer is not a special scheme, + // then return. If url’s scheme is not a special scheme and buffer is a + // special scheme, then return. + if (is_special() != ada::scheme::is_special(_buffer)) { + return true; + } + + // If url includes credentials or has a non-null port, and buffer is + // "file", then return. + if ((includes_credentials() || port.has_value()) && _buffer == "file") { + return true; + } + + // If url’s scheme is "file" and its host is an empty host, then return. + // An empty host is the empty string. + if (type == ada::scheme::type::FILE && host.has_value() && + host.value().empty()) { + return true; + } + } + + set_scheme(std::move(_buffer)); + + if (has_state_override) { + // This is uncommon. + uint16_t urls_scheme_port = get_special_port(); + + if (urls_scheme_port) { + // If url’s port is url’s scheme’s default port, then set url’s port to + // null. + if (port.has_value() && *port == urls_scheme_port) { + port = std::nullopt; + } + } + } + } + + return true; +} + +ada_really_inline bool url::parse_host(std::string_view input) { + ada_log("parse_host ", input, "[", input.size(), " bytes]"); + if (input.empty()) { + return is_valid = false; + } // technically unnecessary. + // If input starts with U+005B ([), then: + if (input[0] == '[') { + // If input does not end with U+005D (]), validation error, return failure. + if (input.back() != ']') { + return is_valid = false; + } + ada_log("parse_host ipv6"); + + // Return the result of IPv6 parsing input with its leading U+005B ([) and + // trailing U+005D (]) removed. + input.remove_prefix(1); + input.remove_suffix(1); + return parse_ipv6(input); + } + + // If isNotSpecial is true, then return the result of opaque-host parsing + // input. + if (!is_special()) { + return parse_opaque_host(input); + } + // Let domain be the result of running UTF-8 decode without BOM on the + // percent-decoding of input. Let asciiDomain be the result of running domain + // to ASCII with domain and false. The most common case is an ASCII input, in + // which case we do not need to call the expensive 'to_ascii' if a few + // conditions are met: no '%' and no 'xn-' subsequence. + std::string buffer = std::string(input); + // This next function checks that the result is ascii, but we are going to + // to check anyhow with is_forbidden. + // bool is_ascii = + unicode::to_lower_ascii(buffer.data(), buffer.size()); + bool is_forbidden = unicode::contains_forbidden_domain_code_point( + buffer.data(), buffer.size()); + if (is_forbidden == 0 && buffer.find("xn-") == std::string_view::npos) { + // fast path + host = std::move(buffer); + if (checkers::is_ipv4(host.value())) { + ada_log("parse_host fast path ipv4"); + return parse_ipv4(host.value()); + } + ada_log("parse_host fast path ", *host); + return true; + } + ada_log("parse_host calling to_ascii"); + is_valid = ada::unicode::to_ascii(host, input, input.find('%')); + if (!is_valid) { + ada_log("parse_host to_ascii returns false"); + return is_valid = false; + } + + if (std::any_of(host.value().begin(), host.value().end(), + ada::unicode::is_forbidden_domain_code_point)) { + host = std::nullopt; + return is_valid = false; + } + + // If asciiDomain ends in a number, then return the result of IPv4 parsing + // asciiDomain. + if (checkers::is_ipv4(host.value())) { + ada_log("parse_host got ipv4", *host); + return parse_ipv4(host.value()); + } + + return true; +} + +ada_really_inline void url::parse_path(std::string_view input) { + ada_log("parse_path ", input); + std::string tmp_buffer; + std::string_view internal_input; + if (unicode::has_tabs_or_newline(input)) { + tmp_buffer = input; + // Optimization opportunity: Instead of copying and then pruning, we could + // just directly build the string from user_input. + helpers::remove_ascii_tab_or_newline(tmp_buffer); + internal_input = tmp_buffer; + } else { + internal_input = input; + } + + // If url is special, then: + if (is_special()) { + if (internal_input.empty()) { + path = "/"; + } else if ((internal_input[0] == '/') || (internal_input[0] == '\\')) { + helpers::parse_prepared_path(internal_input.substr(1), type, path); + return; + } else { + helpers::parse_prepared_path(internal_input, type, path); + return; + } + } else if (!internal_input.empty()) { + if (internal_input[0] == '/') { + helpers::parse_prepared_path(internal_input.substr(1), type, path); + return; + } else { + helpers::parse_prepared_path(internal_input, type, path); + return; + } + } else { + if (!host.has_value()) { + path = "/"; + } + } + return; +} + +std::string url::to_string() const { + if (!is_valid) { + return "null"; + } + std::string answer; + auto back = std::back_insert_iterator(answer); + answer.append("{\n"); + answer.append("\t\"protocol\":\""); + helpers::encode_json(get_protocol(), back); + answer.append("\",\n"); + if (includes_credentials()) { + answer.append("\t\"username\":\""); + helpers::encode_json(username, back); + answer.append("\",\n"); + answer.append("\t\"password\":\""); + helpers::encode_json(password, back); + answer.append("\",\n"); + } + if (host.has_value()) { + answer.append("\t\"host\":\""); + helpers::encode_json(host.value(), back); + answer.append("\",\n"); + } + if (port.has_value()) { + answer.append("\t\"port\":\""); + answer.append(std::to_string(port.value())); + answer.append("\",\n"); + } + answer.append("\t\"path\":\""); + helpers::encode_json(path, back); + answer.append("\",\n"); + answer.append("\t\"opaque path\":"); + answer.append((has_opaque_path ? "true" : "false")); + if (base_search_has_value()) { + answer.append(",\n"); + answer.append("\t\"query\":\""); + helpers::encode_json(query.value(), back); + answer.append("\""); + } + if (fragment.has_value()) { + answer.append(",\n"); + answer.append("\t\"fragment\":\""); + helpers::encode_json(fragment.value(), back); + answer.append("\""); + } + answer.append("\n}"); + return answer; +} + +[[nodiscard]] bool url::has_valid_domain() const noexcept { + if (!host.has_value()) { + return false; + } + return checkers::verify_dns_length(host.value()); +} + +} // namespace ada +/* end file src/url.cpp */ +/* begin file src/url-getters.cpp */ +/** + * @file url-getters.cpp + * Includes all the getters of `ada::url` + */ + +#include +#include + +namespace ada { +[[nodiscard]] std::string url::get_origin() const noexcept { + if (is_special()) { + // Return a new opaque origin. + if (type == scheme::FILE) { + return "null"; + } + return ada::helpers::concat(get_protocol(), "//", get_host()); + } + + if (non_special_scheme == "blob") { + if (!path.empty()) { + auto result = ada::parse(path); + if (result && result->is_special()) { + return ada::helpers::concat(result->get_protocol(), "//", + result->get_host()); + } + } + } + + // Return a new opaque origin. + return "null"; +} + +[[nodiscard]] std::string url::get_protocol() const noexcept { + if (is_special()) { + return helpers::concat(ada::scheme::details::is_special_list[type], ":"); + } + // We only move the 'scheme' if it is non-special. + return helpers::concat(non_special_scheme, ":"); +} + +[[nodiscard]] std::string url::get_host() const noexcept { + // If url’s host is null, then return the empty string. + // If url’s port is null, return url’s host, serialized. + // Return url’s host, serialized, followed by U+003A (:) and url’s port, + // serialized. + if (!host.has_value()) { + return ""; + } + if (port.has_value()) { + return host.value() + ":" + get_port(); + } + return host.value(); +} + +[[nodiscard]] std::string url::get_hostname() const noexcept { + return host.value_or(""); +} + +[[nodiscard]] const std::string_view url::get_pathname() const noexcept { + return path; +} + +[[nodiscard]] std::string url::get_search() const noexcept { + // If this’s URL’s query is either null or the empty string, then return the + // empty string. Return U+003F (?), followed by this’s URL’s query. + return (!query.has_value() || (query.value().empty())) ? "" + : "?" + query.value(); +} + +[[nodiscard]] const std::string& url::get_username() const noexcept { + return username; +} + +[[nodiscard]] const std::string& url::get_password() const noexcept { + return password; +} + +[[nodiscard]] std::string url::get_port() const noexcept { + return port.has_value() ? std::to_string(port.value()) : ""; +} + +[[nodiscard]] std::string url::get_hash() const noexcept { + // If this’s URL’s fragment is either null or the empty string, then return + // the empty string. Return U+0023 (#), followed by this’s URL’s fragment. + return (!fragment.has_value() || (fragment.value().empty())) + ? "" + : "#" + fragment.value(); +} + +} // namespace ada +/* end file src/url-getters.cpp */ +/* begin file src/url-setters.cpp */ +/** + * @file url-setters.cpp + * Includes all the setters of `ada::url` + */ + +#include +#include + +namespace ada { + +template +bool url::set_host_or_hostname(const std::string_view input) { + if (has_opaque_path) { + return false; + } + + std::optional previous_host = host; + std::optional previous_port = port; + + size_t host_end_pos = input.find('#'); + std::string _host(input.data(), host_end_pos != std::string_view::npos + ? host_end_pos + : input.size()); + helpers::remove_ascii_tab_or_newline(_host); + std::string_view new_host(_host); + + // If url's scheme is "file", then set state to file host state, instead of + // host state. + if (type != ada::scheme::type::FILE) { + std::string_view host_view(_host.data(), _host.length()); + auto [location, found_colon] = + helpers::get_host_delimiter_location(is_special(), host_view); + + // Otherwise, if c is U+003A (:) and insideBrackets is false, then: + // Note: the 'found_colon' value is true if and only if a colon was + // encountered while not inside brackets. + if (found_colon) { + if (override_hostname) { + return false; + } + std::string_view buffer = new_host.substr(location + 1); + if (!buffer.empty()) { + set_port(buffer); + } + } + // If url is special and host_view is the empty string, validation error, + // return failure. Otherwise, if state override is given, host_view is the + // empty string, and either url includes credentials or url’s port is + // non-null, return. + else if (host_view.empty() && + (is_special() || includes_credentials() || port.has_value())) { + return false; + } + + // Let host be the result of host parsing host_view with url is not special. + if (host_view.empty()) { + host = ""; + return true; + } + + bool succeeded = parse_host(host_view); + if (!succeeded) { + host = previous_host; + update_base_port(previous_port); + } + return succeeded; + } + + size_t location = new_host.find_first_of("/\\?"); + if (location != std::string_view::npos) { + new_host.remove_suffix(new_host.length() - location); + } + + if (new_host.empty()) { + // Set url’s host to the empty string. + host = ""; + } else { + // Let host be the result of host parsing buffer with url is not special. + if (!parse_host(new_host)) { + host = previous_host; + update_base_port(previous_port); + return false; + } + + // If host is "localhost", then set host to the empty string. + if (host.has_value() && host.value() == "localhost") { + host = ""; + } + } + return true; +} + +bool url::set_host(const std::string_view input) { + return set_host_or_hostname(input); +} + +bool url::set_hostname(const std::string_view input) { + return set_host_or_hostname(input); +} + +bool url::set_username(const std::string_view input) { + if (cannot_have_credentials_or_port()) { + return false; + } + username = ada::unicode::percent_encode( + input, character_sets::USERINFO_PERCENT_ENCODE); + return true; +} + +bool url::set_password(const std::string_view input) { + if (cannot_have_credentials_or_port()) { + return false; + } + password = ada::unicode::percent_encode( + input, character_sets::USERINFO_PERCENT_ENCODE); + return true; +} + +bool url::set_port(const std::string_view input) { + if (cannot_have_credentials_or_port()) { + return false; + } + std::string trimmed(input); + helpers::remove_ascii_tab_or_newline(trimmed); + if (trimmed.empty()) { + port = std::nullopt; + return true; + } + // Input should not start with control characters. + if (ada::unicode::is_c0_control_or_space(trimmed.front())) { + return false; + } + // Input should contain at least one ascii digit. + if (input.find_first_of("0123456789") == std::string_view::npos) { + return false; + } + + // Revert changes if parse_port fails. + std::optional previous_port = port; + parse_port(trimmed); + if (is_valid) { + return true; + } + port = previous_port; + is_valid = true; + return false; +} + +void url::set_hash(const std::string_view input) { + if (input.empty()) { + fragment = std::nullopt; + helpers::strip_trailing_spaces_from_opaque_path(*this); + return; + } + + std::string new_value; + new_value = input[0] == '#' ? input.substr(1) : input; + helpers::remove_ascii_tab_or_newline(new_value); + fragment = unicode::percent_encode( + new_value, ada::character_sets::FRAGMENT_PERCENT_ENCODE); + return; +} + +void url::set_search(const std::string_view input) { + if (input.empty()) { + query = std::nullopt; + helpers::strip_trailing_spaces_from_opaque_path(*this); + return; + } + + std::string new_value; + new_value = input[0] == '?' ? input.substr(1) : input; + helpers::remove_ascii_tab_or_newline(new_value); + + auto query_percent_encode_set = + is_special() ? ada::character_sets::SPECIAL_QUERY_PERCENT_ENCODE + : ada::character_sets::QUERY_PERCENT_ENCODE; + + query = ada::unicode::percent_encode(std::string_view(new_value), + query_percent_encode_set); +} + +bool url::set_pathname(const std::string_view input) { + if (has_opaque_path) { + return false; + } + path = ""; + parse_path(input); + return true; +} + +bool url::set_protocol(const std::string_view input) { + std::string view(input); + helpers::remove_ascii_tab_or_newline(view); + if (view.empty()) { + return true; + } + + // Schemes should start with alpha values. + if (!checkers::is_alpha(view[0])) { + return false; + } + + view.append(":"); + + std::string::iterator pointer = + std::find_if_not(view.begin(), view.end(), unicode::is_alnum_plus); + + if (pointer != view.end() && *pointer == ':') { + return parse_scheme( + std::string_view(view.data(), pointer - view.begin())); + } + return false; +} + +bool url::set_href(const std::string_view input) { + ada::result out = ada::parse(input); + + if (out) { + username = out->username; + password = out->password; + host = out->host; + port = out->port; + path = out->path; + query = out->query; + fragment = out->fragment; + type = out->type; + non_special_scheme = out->non_special_scheme; + has_opaque_path = out->has_opaque_path; + } + + return out.has_value(); +} + +} // namespace ada +/* end file src/url-setters.cpp */ +/* begin file src/parser.cpp */ + +#include +#include + +namespace ada::parser { + +template +result_type parse_url(std::string_view user_input, + const result_type* base_url) { + // We can specialize the implementation per type. + // Important: result_type_is_ada_url is evaluated at *compile time*. This + // means that doing if constexpr(result_type_is_ada_url) { something } else { + // something else } is free (at runtime). This means that ada::url_aggregator + // and ada::url **do not have to support the exact same API**. + constexpr bool result_type_is_ada_url = + std::is_same::value; + constexpr bool result_type_is_ada_url_aggregator = + std::is_same::value; + static_assert(result_type_is_ada_url || + result_type_is_ada_url_aggregator); // We don't support + // anything else for now. + + ada_log("ada::parser::parse_url('", user_input, "' [", user_input.size(), + " bytes],", (base_url != nullptr ? base_url->to_string() : "null"), + ")"); + + ada::state state = ada::state::SCHEME_START; + result_type url{}; + + // We refuse to parse URL strings that exceed 4GB. Such strings are almost + // surely the result of a bug or are otherwise a security concern. + if (user_input.size() >= + std::string_view::size_type(std::numeric_limits::max)) { + url.is_valid = false; + } + + // If we are provided with an invalid base, or the optional_url was invalid, + // we must return. + if (base_url != nullptr) { + url.is_valid &= base_url->is_valid; + } + if (!url.is_valid) { + return url; + } + if constexpr (result_type_is_ada_url_aggregator) { + // Most of the time, we just need user_input.size(). + // In some instances, we may need a bit more. + /////////////////////////// + // This is *very* important. This line should be removed + // hastily. There are principled reasons why reserve is important + // for performance. If you have a benchmark with small inputs, + // it may not matter, but in other instances, it could. + //// + // This rounds up to the next power of two. + uint32_t reserve_capacity = + (0xFFFFFFFF >> helpers::leading_zeroes(uint32_t(user_input.size()))) + + 1; + url.reserve(reserve_capacity); + // + // + // + } + std::string tmp_buffer; + std::string_view internal_input; + if (unicode::has_tabs_or_newline(user_input)) { + tmp_buffer = user_input; + // Optimization opportunity: Instead of copying and then pruning, we could + // just directly build the string from user_input. + helpers::remove_ascii_tab_or_newline(tmp_buffer); + internal_input = tmp_buffer; + } else { + internal_input = user_input; + } + + // Leading and trailing control characters are uncommon and easy to deal with + // (no performance concern). + std::string_view url_data = internal_input; + helpers::trim_c0_whitespace(url_data); + + // Optimization opportunity. Most websites do not have fragment. + std::optional fragment = helpers::prune_fragment(url_data); + // We add it last so that an implementation like ada::url_aggregator + // can append it last to its internal buffer, thus improving performance. + + // Here url_data no longer has its fragment. + // We are going to access the data from url_data (it is immutable). + // At any given time, we are pointing at byte 'input_position' in url_data. + // The input_position variable should range from 0 to input_size. + // It is illegal to access url_data at input_size. + size_t input_position = 0; + const size_t input_size = url_data.size(); + // Keep running the following state machine by switching on state. + // If after a run pointer points to the EOF code point, go to the next step. + // Otherwise, increase pointer by 1 and continue with the state machine. + // We never decrement input_position. + while (input_position <= input_size) { + ada_log("In parsing at ", input_position, " out of ", input_size, + " in state ", ada::to_string(state)); + switch (state) { + case ada::state::SCHEME_START: { + ada_log("SCHEME_START ", helpers::substring(url_data, input_position)); + // If c is an ASCII alpha, append c, lowercased, to buffer, and set + // state to scheme state. + if ((input_position != input_size) && + checkers::is_alpha(url_data[input_position])) { + state = ada::state::SCHEME; + input_position++; + } else { + // Otherwise, if state override is not given, set state to no scheme + // state and decrease pointer by 1. + state = ada::state::NO_SCHEME; + } + break; + } + case ada::state::SCHEME: { + ada_log("SCHEME ", helpers::substring(url_data, input_position)); + // If c is an ASCII alphanumeric, U+002B (+), U+002D (-), or U+002E (.), + // append c, lowercased, to buffer. + while ((input_position != input_size) && + (ada::unicode::is_alnum_plus(url_data[input_position]))) { + input_position++; + } + // Otherwise, if c is U+003A (:), then: + if ((input_position != input_size) && + (url_data[input_position] == ':')) { + ada_log("SCHEME the scheme should be ", + url_data.substr(0, input_position)); + if constexpr (result_type_is_ada_url) { + if (!url.parse_scheme(url_data.substr(0, input_position))) { + return url; + } + } else { + // we pass the colon along instead of painfully adding it back. + if (!url.parse_scheme_with_colon( + url_data.substr(0, input_position + 1))) { + return url; + } + } + ada_log("SCHEME the scheme is ", url.get_protocol()); + + // If url’s scheme is "file", then: + if (url.type == ada::scheme::type::FILE) { + // Set state to file state. + state = ada::state::FILE; + } + // Otherwise, if url is special, base is non-null, and base’s scheme + // is url’s scheme: Note: Doing base_url->scheme is unsafe if base_url + // != nullptr is false. + else if (url.is_special() && base_url != nullptr && + base_url->type == url.type) { + // Set state to special relative or authority state. + state = ada::state::SPECIAL_RELATIVE_OR_AUTHORITY; + } + // Otherwise, if url is special, set state to special authority + // slashes state. + else if (url.is_special()) { + state = ada::state::SPECIAL_AUTHORITY_SLASHES; + } + // Otherwise, if remaining starts with an U+002F (/), set state to + // path or authority state and increase pointer by 1. + else if (input_position + 1 < input_size && + url_data[input_position + 1] == '/') { + state = ada::state::PATH_OR_AUTHORITY; + input_position++; + } + // Otherwise, set url’s path to the empty string and set state to + // opaque path state. + else { + state = ada::state::OPAQUE_PATH; + } + } + // Otherwise, if state override is not given, set buffer to the empty + // string, state to no scheme state, and start over (from the first code + // point in input). + else { + state = ada::state::NO_SCHEME; + input_position = 0; + break; + } + input_position++; + break; + } + case ada::state::NO_SCHEME: { + ada_log("NO_SCHEME ", helpers::substring(url_data, input_position)); + // If base is null, or base has an opaque path and c is not U+0023 (#), + // validation error, return failure. + if (base_url == nullptr || + (base_url->has_opaque_path && !fragment.has_value())) { + ada_log("NO_SCHEME validation error"); + url.is_valid = false; + return url; + } + // Otherwise, if base has an opaque path and c is U+0023 (#), + // set url’s scheme to base’s scheme, url’s path to base’s path, url’s + // query to base’s query, and set state to fragment state. + else if (base_url->has_opaque_path && fragment.has_value() && + input_position == input_size) { + ada_log("NO_SCHEME opaque base with fragment"); + url.copy_scheme(*base_url); + url.has_opaque_path = base_url->has_opaque_path; + + if constexpr (result_type_is_ada_url) { + url.path = base_url->path; + url.query = base_url->query; + } else { + url.update_base_pathname(base_url->get_pathname()); + url.update_base_search(base_url->get_search()); + } + url.update_unencoded_base_hash(*fragment); + return url; + } + // Otherwise, if base’s scheme is not "file", set state to relative + // state and decrease pointer by 1. + else if (base_url->type != ada::scheme::type::FILE) { + ada_log("NO_SCHEME non-file relative path"); + state = ada::state::RELATIVE_SCHEME; + } + // Otherwise, set state to file state and decrease pointer by 1. + else { + ada_log("NO_SCHEME file base type"); + state = ada::state::FILE; + } + break; + } + case ada::state::AUTHORITY: { + ada_log("AUTHORITY ", helpers::substring(url_data, input_position)); + // most URLs have no @. Having no @ tells us that we don't have to worry + // about AUTHORITY. Of course, we could have @ and still not have to + // worry about AUTHORITY. + // TODO: Instead of just collecting a bool, collect the location of the + // '@' and do something useful with it. + // TODO: We could do various processing early on, using a single pass + // over the string to collect information about it, e.g., telling us + // whether there is a @ and if so, where (or how many). + const bool contains_ampersand = + (url_data.find('@', input_position) != std::string_view::npos); + + if (!contains_ampersand) { + state = ada::state::HOST; + break; + } + bool at_sign_seen{false}; + bool password_token_seen{false}; + /** + * We expect something of the sort... + * https://user:pass@example.com:1234/foo/bar?baz#quux + * --------^ + */ + do { + std::string_view view = helpers::substring(url_data, input_position); + // The delimiters are @, /, ? \\. + size_t location = + url.is_special() ? helpers::find_authority_delimiter_special(view) + : helpers::find_authority_delimiter(view); + std::string_view authority_view(view.data(), location); + size_t end_of_authority = input_position + authority_view.size(); + // If c is U+0040 (@), then: + if ((end_of_authority != input_size) && + (url_data[end_of_authority] == '@')) { + // If atSignSeen is true, then prepend "%40" to buffer. + if (at_sign_seen) { + if (password_token_seen) { + if constexpr (result_type_is_ada_url) { + url.password += "%40"; + } else { + url.append_base_password("%40"); + } + } else { + if constexpr (result_type_is_ada_url) { + url.username += "%40"; + } else { + url.append_base_username("%40"); + } + } + } + + at_sign_seen = true; + + if (!password_token_seen) { + size_t password_token_location = authority_view.find(':'); + password_token_seen = + password_token_location != std::string_view::npos; + + if (!password_token_seen) { + if constexpr (result_type_is_ada_url) { + url.username += unicode::percent_encode( + authority_view, character_sets::USERINFO_PERCENT_ENCODE); + } else { + url.append_base_username(unicode::percent_encode( + authority_view, character_sets::USERINFO_PERCENT_ENCODE)); + } + } else { + if constexpr (result_type_is_ada_url) { + url.username += unicode::percent_encode( + authority_view.substr(0, password_token_location), + character_sets::USERINFO_PERCENT_ENCODE); + url.password += unicode::percent_encode( + authority_view.substr(password_token_location + 1), + character_sets::USERINFO_PERCENT_ENCODE); + } else { + url.append_base_username(unicode::percent_encode( + authority_view.substr(0, password_token_location), + character_sets::USERINFO_PERCENT_ENCODE)); + url.append_base_password(unicode::percent_encode( + authority_view.substr(password_token_location + 1), + character_sets::USERINFO_PERCENT_ENCODE)); + } + } + } else { + if constexpr (result_type_is_ada_url) { + url.password += unicode::percent_encode( + authority_view, character_sets::USERINFO_PERCENT_ENCODE); + } else { + url.append_base_password(unicode::percent_encode( + authority_view, character_sets::USERINFO_PERCENT_ENCODE)); + } + } + } + // Otherwise, if one of the following is true: + // - c is the EOF code point, U+002F (/), U+003F (?), or U+0023 (#) + // - url is special and c is U+005C (\) + else if (end_of_authority == input_size || + url_data[end_of_authority] == '/' || + url_data[end_of_authority] == '?' || + (url.is_special() && url_data[end_of_authority] == '\\')) { + // If atSignSeen is true and authority_view is the empty string, + // validation error, return failure. + if (at_sign_seen && authority_view.empty()) { + url.is_valid = false; + return url; + } + state = ada::state::HOST; + break; + } + if (end_of_authority == input_size) { + if (fragment.has_value()) { + url.update_unencoded_base_hash(*fragment); + } + return url; + } + input_position = end_of_authority + 1; + } while (true); + + break; + } + case ada::state::SPECIAL_RELATIVE_OR_AUTHORITY: { + ada_log("SPECIAL_RELATIVE_OR_AUTHORITY ", + helpers::substring(url_data, input_position)); + + // If c is U+002F (/) and remaining starts with U+002F (/), + // then set state to special authority ignore slashes state and increase + // pointer by 1. + std::string_view view = helpers::substring(url_data, input_position); + if (ada::checkers::begins_with(view, "//")) { + state = ada::state::SPECIAL_AUTHORITY_IGNORE_SLASHES; + input_position += 2; + } else { + // Otherwise, validation error, set state to relative state and + // decrease pointer by 1. + state = ada::state::RELATIVE_SCHEME; + } + + break; + } + case ada::state::PATH_OR_AUTHORITY: { + ada_log("PATH_OR_AUTHORITY ", + helpers::substring(url_data, input_position)); + + // If c is U+002F (/), then set state to authority state. + if ((input_position != input_size) && + (url_data[input_position] == '/')) { + state = ada::state::AUTHORITY; + input_position++; + } else { + // Otherwise, set state to path state, and decrease pointer by 1. + state = ada::state::PATH; + } + + break; + } + case ada::state::RELATIVE_SCHEME: { + ada_log("RELATIVE_SCHEME ", + helpers::substring(url_data, input_position)); + + // Set url’s scheme to base’s scheme. + url.copy_scheme(*base_url); + + // If c is U+002F (/), then set state to relative slash state. + if ((input_position != input_size) && + (url_data[input_position] == '/')) { + ada_log( + "RELATIVE_SCHEME if c is U+002F (/), then set state to relative " + "slash state"); + state = ada::state::RELATIVE_SLASH; + } else if (url.is_special() && (input_position != input_size) && + (url_data[input_position] == '\\')) { + // Otherwise, if url is special and c is U+005C (\), validation error, + // set state to relative slash state. + ada_log( + "RELATIVE_SCHEME if url is special and c is U+005C, validation " + "error, set state to relative slash state"); + state = ada::state::RELATIVE_SLASH; + } else { + ada_log("RELATIVE_SCHEME otherwise"); + // Set url’s username to base’s username, url’s password to base’s + // password, url’s host to base’s host, url’s port to base’s port, + // url’s path to a clone of base’s path, and url’s query to base’s + // query. + if constexpr (result_type_is_ada_url) { + url.username = base_url->username; + url.password = base_url->password; + url.host = base_url->host; + url.port = base_url->port; + url.path = base_url->path; + url.query = base_url->query; + } else { + url.update_base_authority(base_url->get_href(), + base_url->get_components()); + // TODO: Get rid of set_hostname and replace it with + // update_base_hostname + url.set_hostname(base_url->get_hostname()); + url.update_base_port(base_url->retrieve_base_port()); + url.update_base_pathname(base_url->get_pathname()); + url.update_base_search(base_url->get_search()); + } + + url.has_opaque_path = base_url->has_opaque_path; + + // If c is U+003F (?), then set url’s query to the empty string, and + // state to query state. + if ((input_position != input_size) && + (url_data[input_position] == '?')) { + state = ada::state::QUERY; + } + // Otherwise, if c is not the EOF code point: + else if (input_position != input_size) { + // Set url’s query to null. + url.clear_base_search(); + if constexpr (result_type_is_ada_url) { + // Shorten url’s path. + helpers::shorten_path(url.path, url.type); + } else { + std::string_view path = url.get_pathname(); + if (helpers::shorten_path(path, url.type)) { + url.update_base_pathname(std::string(path)); + } + } + // Set state to path state and decrease pointer by 1. + state = ada::state::PATH; + break; + } + } + input_position++; + break; + } + case ada::state::RELATIVE_SLASH: { + ada_log("RELATIVE_SLASH ", + helpers::substring(url_data, input_position)); + + // If url is special and c is U+002F (/) or U+005C (\), then: + if (url.is_special() && (input_position != input_size) && + (url_data[input_position] == '/' || + url_data[input_position] == '\\')) { + // Set state to special authority ignore slashes state. + state = ada::state::SPECIAL_AUTHORITY_IGNORE_SLASHES; + } + // Otherwise, if c is U+002F (/), then set state to authority state. + else if ((input_position != input_size) && + (url_data[input_position] == '/')) { + state = ada::state::AUTHORITY; + } + // Otherwise, set + // - url’s username to base’s username, + // - url’s password to base’s password, + // - url’s host to base’s host, + // - url’s port to base’s port, + // - state to path state, and then, decrease pointer by 1. + else { + if constexpr (result_type_is_ada_url) { + url.username = base_url->username; + url.password = base_url->password; + url.host = base_url->host; + url.port = base_url->port; + } else { + url.update_base_authority(base_url->get_href(), + base_url->get_components()); + // TODO: Get rid of set_hostname and replace it with + // update_base_hostname + url.set_hostname(base_url->get_hostname()); + url.update_base_port(base_url->retrieve_base_port()); + } + state = ada::state::PATH; + break; + } + + input_position++; + break; + } + case ada::state::SPECIAL_AUTHORITY_SLASHES: { + ada_log("SPECIAL_AUTHORITY_SLASHES ", + helpers::substring(url_data, input_position)); + + // If c is U+002F (/) and remaining starts with U+002F (/), + // then set state to special authority ignore slashes state and increase + // pointer by 1. + state = ada::state::SPECIAL_AUTHORITY_IGNORE_SLASHES; + std::string_view view = helpers::substring(url_data, input_position); + if (ada::checkers::begins_with(view, "//")) { + input_position += 2; + } + + [[fallthrough]]; + } + case ada::state::SPECIAL_AUTHORITY_IGNORE_SLASHES: { + ada_log("SPECIAL_AUTHORITY_IGNORE_SLASHES ", + helpers::substring(url_data, input_position)); + + // If c is neither U+002F (/) nor U+005C (\), then set state to + // authority state and decrease pointer by 1. + while ((input_position != input_size) && + ((url_data[input_position] == '/') || + (url_data[input_position] == '\\'))) { + input_position++; + } + state = ada::state::AUTHORITY; + + break; + } + case ada::state::QUERY: { + ada_log("QUERY ", helpers::substring(url_data, input_position)); + // Let queryPercentEncodeSet be the special-query percent-encode set if + // url is special; otherwise the query percent-encode set. + const uint8_t* query_percent_encode_set = + url.is_special() ? ada::character_sets::SPECIAL_QUERY_PERCENT_ENCODE + : ada::character_sets::QUERY_PERCENT_ENCODE; + + // Percent-encode after encoding, with encoding, buffer, and + // queryPercentEncodeSet, and append the result to url’s query. + url.update_base_search(helpers::substring(url_data, input_position), + query_percent_encode_set); + ada_log("QUERY update_base_search completed "); + if (fragment.has_value()) { + url.update_unencoded_base_hash(*fragment); + } + return url; + } + case ada::state::HOST: { + ada_log("HOST ", helpers::substring(url_data, input_position)); + + std::string_view host_view = + helpers::substring(url_data, input_position); + auto [location, found_colon] = + helpers::get_host_delimiter_location(url.is_special(), host_view); + input_position = (location != std::string_view::npos) + ? input_position + location + : input_size; + // Otherwise, if c is U+003A (:) and insideBrackets is false, then: + // Note: the 'found_colon' value is true if and only if a colon was + // encountered while not inside brackets. + if (found_colon) { + // If buffer is the empty string, validation error, return failure. + // Let host be the result of host parsing buffer with url is not + // special. + ada_log("HOST parsing ", host_view); + if (!url.parse_host(host_view)) { + return url; + } + ada_log("HOST parsing results in ", url.get_hostname()); + // Set url’s host to host, buffer to the empty string, and state to + // port state. + state = ada::state::PORT; + input_position++; + } + // Otherwise, if one of the following is true: + // - c is the EOF code point, U+002F (/), U+003F (?), or U+0023 (#) + // - url is special and c is U+005C (\) + // The get_host_delimiter_location function either brings us to + // the colon outside of the bracket, or to one of those characters. + else { + // If url is special and host_view is the empty string, validation + // error, return failure. + if (url.is_special() && host_view.empty()) { + url.is_valid = false; + return url; + } + ada_log("HOST parsing ", host_view, " href=", url.get_href()); + // Let host be the result of host parsing host_view with url is not + // special. + if (host_view.empty()) { + url.update_base_hostname(""); + } else if (!url.parse_host(host_view)) { + return url; + } + ada_log("HOST parsing results in ", url.get_hostname(), + " href=", url.get_href()); + + // Set url’s host to host, and state to path start state. + state = ada::state::PATH_START; + } + + break; + } + case ada::state::OPAQUE_PATH: { + ada_log("OPAQUE_PATH ", helpers::substring(url_data, input_position)); + std::string_view view = helpers::substring(url_data, input_position); + // If c is U+003F (?), then set url’s query to the empty string and + // state to query state. + size_t location = view.find('?'); + if (location != std::string_view::npos) { + view.remove_suffix(view.size() - location); + state = ada::state::QUERY; + input_position += location + 1; + } else { + input_position = input_size + 1; + } + url.has_opaque_path = true; + // This is a really unlikely scenario in real world. We should not seek + // to optimize it. + url.update_base_pathname(unicode::percent_encode( + view, character_sets::C0_CONTROL_PERCENT_ENCODE)); + break; + } + case ada::state::PORT: { + ada_log("PORT ", helpers::substring(url_data, input_position)); + std::string_view port_view = + helpers::substring(url_data, input_position); + size_t consumed_bytes = url.parse_port(port_view, true); + input_position += consumed_bytes; + if (!url.is_valid) { + return url; + } + state = state::PATH_START; + [[fallthrough]]; + } + case ada::state::PATH_START: { + ada_log("PATH_START ", helpers::substring(url_data, input_position)); + + // If url is special, then: + if (url.is_special()) { + // Set state to path state. + state = ada::state::PATH; + + // Optimization: Avoiding going into PATH state improves the + // performance of urls ending with /. + if (input_position == input_size) { + url.update_base_pathname("/"); + if (fragment.has_value()) { + url.update_unencoded_base_hash(*fragment); + } + return url; + } + // If c is neither U+002F (/) nor U+005C (\), then decrease pointer + // by 1. We know that (input_position == input_size) is impossible + // here, because of the previous if-check. + if ((url_data[input_position] != '/') && + (url_data[input_position] != '\\')) { + break; + } + } + // Otherwise, if state override is not given and c is U+003F (?), + // set url’s query to the empty string and state to query state. + else if ((input_position != input_size) && + (url_data[input_position] == '?')) { + state = ada::state::QUERY; + } + // Otherwise, if c is not the EOF code point: + else if (input_position != input_size) { + // Set state to path state. + state = ada::state::PATH; + + // If c is not U+002F (/), then decrease pointer by 1. + if (url_data[input_position] != '/') { + break; + } + } + + input_position++; + break; + } + case ada::state::PATH: { + std::string_view view = helpers::substring(url_data, input_position); + ada_log("PATH ", helpers::substring(url_data, input_position)); + + // Most time, we do not need percent encoding. + // Furthermore, we can immediately locate the '?'. + size_t locofquestionmark = view.find('?'); + if (locofquestionmark != std::string_view::npos) { + state = ada::state::QUERY; + view.remove_suffix(view.size() - locofquestionmark); + input_position += locofquestionmark + 1; + } else { + input_position = input_size + 1; + } + if constexpr (result_type_is_ada_url) { + helpers::parse_prepared_path(view, url.type, url.path); + } else { + url.consume_prepared_path(view); + ADA_ASSERT_TRUE(url.validate()); + } + break; + } + case ada::state::FILE_SLASH: { + ada_log("FILE_SLASH ", helpers::substring(url_data, input_position)); + + // If c is U+002F (/) or U+005C (\), then: + if ((input_position != input_size) && + (url_data[input_position] == '/' || + url_data[input_position] == '\\')) { + ada_log("FILE_SLASH c is U+002F or U+005C"); + // Set state to file host state. + state = ada::state::FILE_HOST; + input_position++; + } else { + ada_log("FILE_SLASH otherwise"); + // If base is non-null and base’s scheme is "file", then: + // Note: it is unsafe to do base_url->scheme unless you know that + // base_url_has_value() is true. + if (base_url != nullptr && + base_url->type == ada::scheme::type::FILE) { + // Set url’s host to base’s host. + if constexpr (result_type_is_ada_url) { + url.host = base_url->host; + } else { + // TODO: Optimization opportunity. + url.set_host(base_url->get_host()); + } + // If the code point substring from pointer to the end of input does + // not start with a Windows drive letter and base’s path[0] is a + // normalized Windows drive letter, then append base’s path[0] to + // url’s path. + if (!base_url->get_pathname().empty()) { + if (!checkers::is_windows_drive_letter( + helpers::substring(url_data, input_position))) { + std::string_view first_base_url_path = + base_url->get_pathname().substr(1); + size_t loc = first_base_url_path.find('/'); + if (loc != std::string_view::npos) { + helpers::resize(first_base_url_path, loc); + } + if (checkers::is_normalized_windows_drive_letter( + first_base_url_path)) { + if constexpr (result_type_is_ada_url) { + url.path += '/'; + url.path += first_base_url_path; + } else { + url.append_base_pathname( + helpers::concat("/", first_base_url_path)); + } + } + } + } + } + + // Set state to path state, and decrease pointer by 1. + state = ada::state::PATH; + } + + break; + } + case ada::state::FILE_HOST: { + std::string_view view = helpers::substring(url_data, input_position); + ada_log("FILE_HOST ", helpers::substring(url_data, input_position)); + + size_t location = view.find_first_of("/\\?"); + std::string_view file_host_buffer( + view.data(), + (location != std::string_view::npos) ? location : view.size()); + + if (checkers::is_windows_drive_letter(file_host_buffer)) { + state = ada::state::PATH; + } else if (file_host_buffer.empty()) { + // Set url’s host to the empty string. + if constexpr (result_type_is_ada_url) { + url.host = ""; + } else { + url.update_base_hostname(""); + } + // Set state to path start state. + state = ada::state::PATH_START; + } else { + size_t consumed_bytes = file_host_buffer.size(); + input_position += consumed_bytes; + // Let host be the result of host parsing buffer with url is not + // special. + if (!url.parse_host(file_host_buffer)) { + return url; + } + + if constexpr (result_type_is_ada_url) { + // If host is "localhost", then set host to the empty string. + if (url.host.has_value() && url.host.value() == "localhost") { + url.host = ""; + } + } else { + if (url.get_hostname() == "localhost") { + url.update_base_hostname(""); + } + } + + // Set buffer to the empty string and state to path start state. + state = ada::state::PATH_START; + } + + break; + } + case ada::state::FILE: { + ada_log("FILE ", helpers::substring(url_data, input_position)); + std::string_view file_view = + helpers::substring(url_data, input_position); + + url.set_protocol_as_file(); + if constexpr (result_type_is_ada_url) { + // Set url’s host to the empty string. + url.host = ""; + } else { + url.update_base_hostname(""); + } + // If c is U+002F (/) or U+005C (\), then: + if (input_position != input_size && + (url_data[input_position] == '/' || + url_data[input_position] == '\\')) { + ada_log("FILE c is U+002F or U+005C"); + // Set state to file slash state. + state = ada::state::FILE_SLASH; + } + // Otherwise, if base is non-null and base’s scheme is "file": + else if (base_url != nullptr && + base_url->type == ada::scheme::type::FILE) { + // Set url’s host to base’s host, url’s path to a clone of base’s + // path, and url’s query to base’s query. + ada_log("FILE base non-null"); + if constexpr (result_type_is_ada_url) { + url.host = base_url->host; + url.path = base_url->path; + url.query = base_url->query; + } else { + // TODO: Get rid of set_hostname and replace it with + // update_base_hostname + url.set_hostname(base_url->get_hostname()); + url.update_base_pathname(base_url->get_pathname()); + url.update_base_search(base_url->get_search()); + } + url.has_opaque_path = base_url->has_opaque_path; + + // If c is U+003F (?), then set url’s query to the empty string and + // state to query state. + if (input_position != input_size && url_data[input_position] == '?') { + state = ada::state::QUERY; + } + // Otherwise, if c is not the EOF code point: + else if (input_position != input_size) { + // Set url’s query to null. + url.clear_base_search(); + + // If the code point substring from pointer to the end of input does + // not start with a Windows drive letter, then shorten url’s path. + if (!checkers::is_windows_drive_letter(file_view)) { + if constexpr (result_type_is_ada_url) { + helpers::shorten_path(url.path, url.type); + } else { + std::string_view path = url.get_pathname(); + if (helpers::shorten_path(path, url.type)) { + url.update_base_pathname(std::string(path)); + } + } + } + // Otherwise: + else { + // Set url’s path to an empty list. + if constexpr (result_type_is_ada_url) { + url.path.clear(); + } else { + url.clear_base_pathname(); + } + url.has_opaque_path = true; + } + + // Set state to path state and decrease pointer by 1. + state = ada::state::PATH; + break; + } + } + // Otherwise, set state to path state, and decrease pointer by 1. + else { + ada_log("FILE go to path"); + state = ada::state::PATH; + break; + } + + input_position++; + break; + } + default: + ada::unreachable(); + } + } + if (fragment.has_value()) { + url.update_unencoded_base_hash(*fragment); + } + return url; +} + +template url parse_url(std::string_view user_input, + const url* base_url = nullptr); +template url_aggregator parse_url( + std::string_view user_input, const url_aggregator* base_url = nullptr); + +} // namespace ada::parser +/* end file src/parser.cpp */ +/* begin file src/url_components.cpp */ + +#include +#include + +namespace ada { + +bool url_components::check_offset_consistency() const noexcept { + /** + * https://user:pass@example.com:1234/foo/bar?baz#quux + * | | | | ^^^^| | | + * | | | | | | | `----- hash_start + * | | | | | | `--------- search_start + * | | | | | `----------------- pathname_start + * | | | | `--------------------- port + * | | | `----------------------- host_end + * | | `---------------------------------- host_start + * | `--------------------------------------- username_end + * `--------------------------------------------- protocol_end + */ + // These conditions can be made more strict. + uint32_t index = 0; + + if (protocol_end == url_components::omitted) { + return false; + } + if (protocol_end < index) { + return false; + } + index = protocol_end; + + if (username_end == url_components::omitted) { + return false; + } + if (username_end < index) { + return false; + } + index = username_end; + + if (host_start == url_components::omitted) { + return false; + } + if (host_start < index) { + return false; + } + index = host_start; + + if (port != url_components::omitted) { + if (port > 0xffff) { + return false; + } + uint32_t port_length = helpers::fast_digit_count(port) + 1; + if (index + port_length < index) { + return false; + } + index += port_length; + } + + if (pathname_start == url_components::omitted) { + return false; + } + if (pathname_start < index) { + return false; + } + index = pathname_start; + + if (search_start != url_components::omitted) { + if (search_start < index) { + return false; + } + index = search_start; + } + + if (hash_start != url_components::omitted) { + if (hash_start < index) { + return false; + } + index = hash_start; + } + + return true; +} + +std::string url_components::to_string() const { + std::string answer; + auto back = std::back_insert_iterator(answer); + answer.append("{\n"); + + answer.append("\t\"protocol_end\":\""); + helpers::encode_json(std::to_string(protocol_end), back); + answer.append("\",\n"); + + answer.append("\t\"username_end\":\""); + helpers::encode_json(std::to_string(username_end), back); + answer.append("\",\n"); + + answer.append("\t\"host_start\":\""); + helpers::encode_json(std::to_string(host_start), back); + answer.append("\",\n"); + + answer.append("\t\"host_end\":\""); + helpers::encode_json(std::to_string(host_end), back); + answer.append("\",\n"); + + answer.append("\t\"port\":\""); + helpers::encode_json(std::to_string(port), back); + answer.append("\",\n"); + + answer.append("\t\"pathname_start\":\""); + helpers::encode_json(std::to_string(pathname_start), back); + answer.append("\",\n"); + + answer.append("\t\"search_start\":\""); + helpers::encode_json(std::to_string(search_start), back); + answer.append("\",\n"); + + answer.append("\t\"hash_start\":\""); + helpers::encode_json(std::to_string(hash_start), back); + answer.append("\",\n"); + + answer.append("\n}"); + return answer; +} + +} // namespace ada +/* end file src/url_components.cpp */ +/* begin file src/url_aggregator.cpp */ + +#include +#include + +namespace ada { +template +[[nodiscard]] ada_really_inline bool url_aggregator::parse_scheme_with_colon( + const std::string_view input_with_colon) { + ada_log("url_aggregator::parse_scheme_with_colon ", input_with_colon); + ADA_ASSERT_TRUE(validate()); + ADA_ASSERT_TRUE(!helpers::overlaps(input_with_colon, buffer)); + std::string_view input{input_with_colon}; + input.remove_suffix(1); + auto parsed_type = ada::scheme::get_scheme_type(input); + bool is_input_special = (parsed_type != ada::scheme::NOT_SPECIAL); + /** + * In the common case, we will immediately recognize a special scheme (e.g., + *http, https), in which case, we can go really fast. + **/ + if (is_input_special) { // fast path!!! + if (has_state_override) { + // If url’s scheme is not a special scheme and buffer is a special scheme, + // then return. + if (is_special() != is_input_special) { + return true; + } + + // If url includes credentials or has a non-null port, and buffer is + // "file", then return. + if ((includes_credentials() || + components.port != url_components::omitted) && + parsed_type == ada::scheme::type::FILE) { + return true; + } + + // If url’s scheme is "file" and its host is an empty host, then return. + // An empty host is the empty string. + if (type == ada::scheme::type::FILE && + components.host_start == components.host_end) { + return true; + } + } + + type = parsed_type; + set_scheme_from_view_with_colon(input_with_colon); + + if (has_state_override) { + // This is uncommon. + uint16_t urls_scheme_port = get_special_port(); + + // If url’s port is url’s scheme’s default port, then set url’s port to + // null. + if (components.port == urls_scheme_port) { + clear_base_port(); + } + } + } else { // slow path + std::string _buffer = std::string(input); + // Next function is only valid if the input is ASCII and returns false + // otherwise, but it seems that we always have ascii content so we do not + // need to check the return value. + unicode::to_lower_ascii(_buffer.data(), _buffer.size()); + + if (has_state_override) { + // If url’s scheme is a special scheme and buffer is not a special scheme, + // then return. If url’s scheme is not a special scheme and buffer is a + // special scheme, then return. + if (is_special() != ada::scheme::is_special(_buffer)) { + return true; + } + + // If url includes credentials or has a non-null port, and buffer is + // "file", then return. + if ((includes_credentials() || + components.port != url_components::omitted) && + _buffer == "file") { + return true; + } + + // If url’s scheme is "file" and its host is an empty host, then return. + // An empty host is the empty string. + if (type == ada::scheme::type::FILE && + components.host_start == components.host_end) { + return true; + } + } + + set_scheme(_buffer); + + if (has_state_override) { + // This is uncommon. + uint16_t urls_scheme_port = get_special_port(); + + // If url’s port is url’s scheme’s default port, then set url’s port to + // null. + if (components.port == urls_scheme_port) { + clear_base_port(); + } + } + } + ADA_ASSERT_TRUE(validate()); + return true; +} + +inline void url_aggregator::copy_scheme(const url_aggregator& u) noexcept { + ada_log("url_aggregator::copy_scheme ", u.buffer); + ADA_ASSERT_TRUE(validate()); + // next line could overflow but unsigned arithmetic has well-defined + // overflows. + uint32_t new_difference = u.components.protocol_end - components.protocol_end; + type = u.type; + buffer.erase(0, components.protocol_end); + buffer.insert(0, u.get_protocol()); + components.protocol_end = u.components.protocol_end; + + // No need to update the components + if (new_difference == 0) { + return; + } + + // Update the rest of the components. + components.username_end += new_difference; + components.host_start += new_difference; + components.host_end += new_difference; + components.pathname_start += new_difference; + if (components.search_start != url_components::omitted) { + components.search_start += new_difference; + } + if (components.hash_start != url_components::omitted) { + components.hash_start += new_difference; + } + ADA_ASSERT_TRUE(validate()); +} + +inline void url_aggregator::set_scheme_from_view_with_colon( + std::string_view new_scheme_with_colon) noexcept { + ada_log("url_aggregator::set_scheme_from_view_with_colon ", + new_scheme_with_colon); + ADA_ASSERT_TRUE(validate()); + ADA_ASSERT_TRUE(!new_scheme_with_colon.empty() && + new_scheme_with_colon.back() == ':'); + // next line could overflow but unsigned arithmetic has well-defined + // overflows. + uint32_t new_difference = + uint32_t(new_scheme_with_colon.size()) - components.protocol_end; + + if (buffer.empty()) { + buffer.append(new_scheme_with_colon); + } else { + buffer.erase(0, components.protocol_end); + buffer.insert(0, new_scheme_with_colon); + } + components.protocol_end += new_difference; + + // Update the rest of the components. + components.username_end += new_difference; + components.host_start += new_difference; + components.host_end += new_difference; + components.pathname_start += new_difference; + if (components.search_start != url_components::omitted) { + components.search_start += new_difference; + } + if (components.hash_start != url_components::omitted) { + components.hash_start += new_difference; + } + ADA_ASSERT_TRUE(validate()); +} + +inline void url_aggregator::set_scheme(std::string_view new_scheme) noexcept { + ada_log("url_aggregator::set_scheme ", new_scheme); + ADA_ASSERT_TRUE(validate()); + ADA_ASSERT_TRUE(new_scheme.empty() || new_scheme.back() != ':'); + // next line could overflow but unsigned arithmetic has well-defined + // overflows. + uint32_t new_difference = + uint32_t(new_scheme.size()) - components.protocol_end + 1; + + type = ada::scheme::get_scheme_type(new_scheme); + if (buffer.empty()) { + buffer.append(helpers::concat(new_scheme, ":")); + } else { + buffer.erase(0, components.protocol_end); + buffer.insert(0, helpers::concat(new_scheme, ":")); + } + components.protocol_end = uint32_t(new_scheme.size() + 1); + + // Update the rest of the components. + components.username_end += new_difference; + components.host_start += new_difference; + components.host_end += new_difference; + components.pathname_start += new_difference; + if (components.search_start != url_components::omitted) { + components.search_start += new_difference; + } + if (components.hash_start != url_components::omitted) { + components.hash_start += new_difference; + } + ADA_ASSERT_TRUE(validate()); +} + +bool url_aggregator::set_protocol(const std::string_view input) { + ada_log("url_aggregator::set_protocol ", input); + ADA_ASSERT_TRUE(validate()); + ADA_ASSERT_TRUE(!helpers::overlaps(input, buffer)); + std::string view(input); + helpers::remove_ascii_tab_or_newline(view); + if (view.empty()) { + return true; + } + + // Schemes should start with alpha values. + if (!checkers::is_alpha(view[0])) { + return false; + } + + view.append(":"); + + std::string::iterator pointer = + std::find_if_not(view.begin(), view.end(), unicode::is_alnum_plus); + + if (pointer != view.end() && *pointer == ':') { + return parse_scheme_with_colon( + std::string_view(view.data(), pointer - view.begin() + 1)); + } + return false; +} + +bool url_aggregator::set_username(const std::string_view input) { + ada_log("url_aggregator::set_username '", input, "' "); + ADA_ASSERT_TRUE(validate()); + ADA_ASSERT_TRUE(!helpers::overlaps(input, buffer)); + if (cannot_have_credentials_or_port()) { + return false; + } + size_t idx = ada::unicode::percent_encode_index( + input, character_sets::USERINFO_PERCENT_ENCODE); + if (idx == input.size()) { + update_base_username(input); + } else { + // We only create a temporary string if we have to! + update_base_username(ada::unicode::percent_encode( + input, character_sets::USERINFO_PERCENT_ENCODE, idx)); + } + ADA_ASSERT_TRUE(validate()); + return true; +} + +bool url_aggregator::set_password(const std::string_view input) { + ada_log("url_aggregator::set_password '", input, "'"); + ADA_ASSERT_TRUE(validate()); + ADA_ASSERT_TRUE(!helpers::overlaps(input, buffer)); + if (cannot_have_credentials_or_port()) { + return false; + } + size_t idx = ada::unicode::percent_encode_index( + input, character_sets::USERINFO_PERCENT_ENCODE); + if (idx == input.size()) { + update_base_password(input); + } else { + // We only create a temporary string if we have to! + update_base_password(ada::unicode::percent_encode( + input, character_sets::USERINFO_PERCENT_ENCODE, idx)); + } + ADA_ASSERT_TRUE(validate()); + return true; +} + +bool url_aggregator::set_port(const std::string_view input) { + ada_log("url_aggregator::set_port ", input); + ADA_ASSERT_TRUE(validate()); + ADA_ASSERT_TRUE(!helpers::overlaps(input, buffer)); + if (cannot_have_credentials_or_port()) { + return false; + } + std::string trimmed(input); + helpers::remove_ascii_tab_or_newline(trimmed); + if (trimmed.empty()) { + clear_base_port(); + return true; + } + // Input should not start with control characters. + if (ada::unicode::is_c0_control_or_space(trimmed.front())) { + return false; + } + // Input should contain at least one ascii digit. + if (input.find_first_of("0123456789") == std::string_view::npos) { + return false; + } + + // Revert changes if parse_port fails. + uint32_t previous_port = components.port; + parse_port(trimmed); + if (is_valid) { + return true; + } + update_base_port(previous_port); + is_valid = true; + ADA_ASSERT_TRUE(validate()); + return false; +} + +bool url_aggregator::set_pathname(const std::string_view input) { + ada_log("url_aggregator::set_pathname ", input); + ADA_ASSERT_TRUE(validate()); + ADA_ASSERT_TRUE(!helpers::overlaps(input, buffer)); + if (has_opaque_path) { + return false; + } + clear_base_pathname(); + parse_path(input); + if (checkers::begins_with(input, "//") && !has_authority() && + !has_dash_dot()) { + buffer.insert(components.pathname_start, "/."); + components.pathname_start += 2; + } + ADA_ASSERT_TRUE(validate()); + return true; +} + +ada_really_inline void url_aggregator::parse_path(std::string_view input) { + ada_log("url_aggregator::parse_path ", input); + ADA_ASSERT_TRUE(validate()); + ADA_ASSERT_TRUE(!helpers::overlaps(input, buffer)); + std::string tmp_buffer; + std::string_view internal_input; + if (unicode::has_tabs_or_newline(input)) { + tmp_buffer = input; + // Optimization opportunity: Instead of copying and then pruning, we could + // just directly build the string from user_input. + helpers::remove_ascii_tab_or_newline(tmp_buffer); + internal_input = tmp_buffer; + } else { + internal_input = input; + } + + // If url is special, then: + if (is_special()) { + if (internal_input.empty()) { + update_base_pathname("/"); + } else if ((internal_input[0] == '/') || (internal_input[0] == '\\')) { + consume_prepared_path(internal_input.substr(1)); + } else { + consume_prepared_path(internal_input); + } + } else if (!internal_input.empty()) { + if (internal_input[0] == '/') { + consume_prepared_path(internal_input.substr(1)); + } else { + consume_prepared_path(internal_input); + } + } else { + // Non-special URLs with an empty host can have their paths erased + // Path-only URLs cannot have their paths erased + if (components.host_start == components.host_end && !has_authority()) { + update_base_pathname("/"); + } + } + ADA_ASSERT_TRUE(validate()); +} + +void url_aggregator::set_search(const std::string_view input) { + ada_log("url_aggregator::set_search ", input); + ADA_ASSERT_TRUE(validate()); + ADA_ASSERT_TRUE(!helpers::overlaps(input, buffer)); + if (input.empty()) { + clear_base_search(); + helpers::strip_trailing_spaces_from_opaque_path(*this); + return; + } + + std::string new_value; + new_value = input[0] == '?' ? input.substr(1) : input; + helpers::remove_ascii_tab_or_newline(new_value); + + auto query_percent_encode_set = + is_special() ? ada::character_sets::SPECIAL_QUERY_PERCENT_ENCODE + : ada::character_sets::QUERY_PERCENT_ENCODE; + + update_base_search(new_value, query_percent_encode_set); + ADA_ASSERT_TRUE(validate()); +} + +void url_aggregator::set_hash(const std::string_view input) { + ada_log("url_aggregator::set_hash ", input); + ADA_ASSERT_TRUE(validate()); + ADA_ASSERT_TRUE(!helpers::overlaps(input, buffer)); + if (input.empty()) { + if (components.hash_start != url_components::omitted) { + buffer.resize(components.hash_start); + components.hash_start = url_components::omitted; + } + helpers::strip_trailing_spaces_from_opaque_path(*this); + return; + } + + std::string new_value; + new_value = input[0] == '#' ? input.substr(1) : input; + helpers::remove_ascii_tab_or_newline(new_value); + update_unencoded_base_hash(new_value); + ADA_ASSERT_TRUE(validate()); +} + +bool url_aggregator::set_href(const std::string_view input) { + ADA_ASSERT_TRUE(!helpers::overlaps(input, buffer)); + ada_log("url_aggregator::set_href ", input, "[", input.size(), " bytes]"); + ada::result out = ada::parse(input); + ada_log("url_aggregator::set_href, success :", out.has_value()); + + if (out) { + ada_log("url_aggregator::set_href, parsed ", out->to_string()); + // TODO: Figure out why the following line puts test to never finish. + *this = *out; + } + + return out.has_value(); +} + +ada_really_inline bool url_aggregator::parse_host(std::string_view input) { + ada_log("url_aggregator:parse_host ", input, "[", input.size(), " bytes]"); + ADA_ASSERT_TRUE(validate()); + ADA_ASSERT_TRUE(!helpers::overlaps(input, buffer)); + if (input.empty()) { + return is_valid = false; + } // technically unnecessary. + // If input starts with U+005B ([), then: + if (input[0] == '[') { + // If input does not end with U+005D (]), validation error, return failure. + if (input.back() != ']') { + return is_valid = false; + } + ada_log("parse_host ipv6"); + + // Return the result of IPv6 parsing input with its leading U+005B ([) and + // trailing U+005D (]) removed. + input.remove_prefix(1); + input.remove_suffix(1); + return parse_ipv6(input); + } + + // If isNotSpecial is true, then return the result of opaque-host parsing + // input. + if (!is_special()) { + return parse_opaque_host(input); + } + // Let domain be the result of running UTF-8 decode without BOM on the + // percent-decoding of input. Let asciiDomain be the result of running domain + // to ASCII with domain and false. The most common case is an ASCII input, in + // which case we do not need to call the expensive 'to_ascii' if a few + // conditions are met: no '%' and no 'xn-' subsequence. + std::string _buffer = std::string(input); + // This next function checks that the result is ascii, but we are going to + // to check anyhow with is_forbidden. + // bool is_ascii = + unicode::to_lower_ascii(_buffer.data(), _buffer.size()); + bool is_forbidden = unicode::contains_forbidden_domain_code_point( + _buffer.data(), _buffer.size()); + if (is_forbidden == 0 && _buffer.find("xn-") == std::string_view::npos) { + // fast path + update_base_hostname(_buffer); + if (checkers::is_ipv4(get_hostname())) { + ada_log("parse_host fast path ipv4"); + return parse_ipv4(get_hostname()); + } + ada_log("parse_host fast path ", get_hostname()); + return true; + } + ada_log("parse_host calling to_ascii"); + std::optional host = std::string(get_hostname()); + is_valid = ada::unicode::to_ascii(host, input, input.find('%')); + if (!is_valid) { + ada_log("parse_host to_ascii returns false"); + return is_valid = false; + } + + if (std::any_of(host.value().begin(), host.value().end(), + ada::unicode::is_forbidden_domain_code_point)) { + return is_valid = false; + } + + // If asciiDomain ends in a number, then return the result of IPv4 parsing + // asciiDomain. + if (checkers::is_ipv4(host.value())) { + ada_log("parse_host got ipv4", *host); + return parse_ipv4(host.value()); + } + + update_base_hostname(host.value()); + ADA_ASSERT_TRUE(validate()); + return true; +} + +template +bool url_aggregator::set_host_or_hostname(const std::string_view input) { + ada_log("url_aggregator::set_host_or_hostname ", input); + ADA_ASSERT_TRUE(validate()); + ADA_ASSERT_TRUE(!helpers::overlaps(input, buffer)); + if (has_opaque_path) { + return false; + } + + std::string previous_host = std::string(get_hostname()); + uint32_t previous_port = components.port; + + size_t host_end_pos = input.find('#'); + std::string _host(input.data(), host_end_pos != std::string_view::npos + ? host_end_pos + : input.size()); + helpers::remove_ascii_tab_or_newline(_host); + std::string_view new_host(_host); + + // If url's scheme is "file", then set state to file host state, instead of + // host state. + if (type != ada::scheme::type::FILE) { + std::string_view host_view(_host.data(), _host.length()); + auto [location, found_colon] = + helpers::get_host_delimiter_location(is_special(), host_view); + + // Otherwise, if c is U+003A (:) and insideBrackets is false, then: + // Note: the 'found_colon' value is true if and only if a colon was + // encountered while not inside brackets. + if (found_colon) { + if (override_hostname) { + return false; + } + std::string_view sub_buffer = new_host.substr(location + 1); + if (!sub_buffer.empty()) { + set_port(sub_buffer); + } + } + // If url is special and host_view is the empty string, validation error, + // return failure. Otherwise, if state override is given, host_view is the + // empty string, and either url includes credentials or url’s port is + // non-null, return. + else if (host_view.empty() && + (is_special() || includes_credentials() || + components.port != url_components::omitted)) { + return false; + } + + // Let host be the result of host parsing host_view with url is not special. + if (host_view.empty()) { + if (has_hostname()) { + clear_base_hostname(); // easy! + } else if (has_dash_dot()) { + add_authority_slashes_if_needed(); + delete_dash_dot(); + } + return true; + } + + bool succeeded = parse_host(host_view); + if (!succeeded) { + update_base_hostname(previous_host); + update_base_port(previous_port); + } else if (has_dash_dot()) { + // Should remove dash_dot from pathname + delete_dash_dot(); + } + return succeeded; + } + + size_t location = new_host.find_first_of("/\\?"); + if (location != std::string_view::npos) { + new_host.remove_suffix(new_host.length() - location); + } + + if (new_host.empty()) { + // Set url’s host to the empty string. + clear_base_hostname(); + } else { + // Let host be the result of host parsing buffer with url is not special. + if (!parse_host(new_host)) { + update_base_hostname(previous_host); + update_base_port(previous_port); + return false; + } + + // If host is "localhost", then set host to the empty string. + if (helpers::substring(buffer, components.host_start, + components.host_end) == "localhost") { + clear_base_hostname(); + } + } + ADA_ASSERT_TRUE(validate()); + return true; +} + +bool url_aggregator::set_host(const std::string_view input) { + ada_log("url_aggregator::set_host '", input, "'"); + ADA_ASSERT_TRUE(validate()); + ADA_ASSERT_TRUE(!helpers::overlaps(input, buffer)); + return set_host_or_hostname(input); +} + +bool url_aggregator::set_hostname(const std::string_view input) { + ada_log("url_aggregator::set_hostname '", input, "'"); + ADA_ASSERT_TRUE(validate()); + ADA_ASSERT_TRUE(!helpers::overlaps(input, buffer)); + return set_host_or_hostname(input); +} + +[[nodiscard]] std::string url_aggregator::get_origin() const noexcept { + ada_log("url_aggregator::get_origin"); + if (is_special()) { + // Return a new opaque origin. + if (type == scheme::FILE) { + return "null"; + } + + return helpers::concat(get_protocol(), "//", get_host()); + } + + if (get_protocol() == "blob:") { + std::string_view path = get_pathname(); + if (!path.empty()) { + auto out = ada::parse(path); + if (out && out->is_special()) { + return helpers::concat(out->get_protocol(), "//", out->get_host()); + } + } + } + + // Return a new opaque origin. + return "null"; +} + +[[nodiscard]] std::string_view url_aggregator::get_username() const noexcept { + ada_log("url_aggregator::get_username"); + if (has_non_empty_username()) { + return helpers::substring(buffer, components.protocol_end + 2, + components.username_end); + } + return ""; +} + +[[nodiscard]] std::string_view url_aggregator::get_password() const noexcept { + ada_log("url_aggregator::get_password"); + if (has_non_empty_password()) { + return helpers::substring(buffer, components.username_end + 1, + components.host_start); + } + return ""; +} + +[[nodiscard]] std::string_view url_aggregator::get_port() const noexcept { + ada_log("url_aggregator::get_port"); + if (components.port == url_components::omitted) { + return ""; + } + return helpers::substring(buffer, components.host_end + 1, + components.pathname_start); +} + +[[nodiscard]] std::string_view url_aggregator::get_hash() const noexcept { + ada_log("url_aggregator::get_hash"); + // If this’s URL’s fragment is either null or the empty string, then return + // the empty string. Return U+0023 (#), followed by this’s URL’s fragment. + if (components.hash_start == url_components::omitted) { + return ""; + } + if (buffer.size() - components.hash_start <= 1) { + return ""; + } + return helpers::substring(buffer, components.hash_start); +} + +[[nodiscard]] std::string_view url_aggregator::get_host() const noexcept { + ada_log("url_aggregator::get_host"); + size_t start = components.host_start; + if (buffer.size() > components.host_start && + buffer[components.host_start] == '@') { + start++; + } + // if we have an empty host, then the space between components.host_end and + // components.pathname_start may be occupied by /. + if (start == components.host_end) { + return std::string_view(); + } + return helpers::substring(buffer, start, components.pathname_start); +} + +[[nodiscard]] std::string_view url_aggregator::get_hostname() const noexcept { + ada_log("url_aggregator::get_hostname"); + size_t start = components.host_start; + // So host_start is not where the host begins. + if (buffer.size() > components.host_start && + buffer[components.host_start] == '@') { + start++; + } + return helpers::substring(buffer, start, components.host_end); +} + +[[nodiscard]] std::string_view url_aggregator::get_pathname() const noexcept { + ada_log("url_aggregator::get_pathname pathname_start = ", + components.pathname_start, " buffer.size() = ", buffer.size(), + " components.search_start = ", components.search_start, + " components.hash_start = ", components.hash_start); + uint32_t ending_index = uint32_t(buffer.size()); + if (components.search_start != url_components::omitted) { + ending_index = components.search_start; + } else if (components.hash_start != url_components::omitted) { + ending_index = components.hash_start; + } + return helpers::substring(buffer, components.pathname_start, ending_index); +} + +[[nodiscard]] std::string_view url_aggregator::get_search() const noexcept { + ada_log("url_aggregator::get_search"); + // If this’s URL’s query is either null or the empty string, then return the + // empty string. Return U+003F (?), followed by this’s URL’s query. + if (components.search_start == url_components::omitted) { + return ""; + } + uint32_t ending_index = uint32_t(buffer.size()); + if (components.hash_start != url_components::omitted) { + ending_index = components.hash_start; + } + if (ending_index - components.search_start <= 1) { + return ""; + } + return helpers::substring(buffer, components.search_start, ending_index); +} + +[[nodiscard]] std::string_view url_aggregator::get_protocol() const noexcept { + ada_log("url_aggregator::get_protocol"); + return helpers::substring(buffer, 0, components.protocol_end); +} + +std::string ada::url_aggregator::to_string() const { + ada_log("url_aggregator::to_string buffer:", buffer, "[", buffer.size(), + " bytes]"); + if (!is_valid) { + return "null"; + } + + std::string answer; + auto back = std::back_insert_iterator(answer); + answer.append("{\n"); + + answer.append("\t\"buffer\":\""); + helpers::encode_json(buffer, back); + answer.append("\",\n"); + + answer.append("\t\"protocol\":\""); + helpers::encode_json(get_protocol(), back); + answer.append("\",\n"); + + if (includes_credentials()) { + answer.append("\t\"username\":\""); + helpers::encode_json(get_username(), back); + answer.append("\",\n"); + answer.append("\t\"password\":\""); + helpers::encode_json(get_password(), back); + answer.append("\",\n"); + } + + answer.append("\t\"host\":\""); + helpers::encode_json(get_host(), back); + answer.append("\",\n"); + + answer.append("\t\"path\":\""); + helpers::encode_json(get_pathname(), back); + answer.append("\",\n"); + answer.append("\t\"opaque path\":"); + answer.append((has_opaque_path ? "true" : "false")); + answer.append(",\n"); + + if (components.search_start != url_components::omitted) { + answer.append("\t\"query\":\""); + helpers::encode_json(get_search(), back); + answer.append("\",\n"); + } + if (components.hash_start != url_components::omitted) { + answer.append("\t\"fragment\":\""); + helpers::encode_json(get_hash(), back); + answer.append("\",\n"); + } + + auto convert_offset_to_string = [](uint32_t offset) -> std::string { + if (offset == url_components::omitted) { + return "null"; + } else { + return std::to_string(offset); + } + }; + + answer.append("\t\"protocol_end\":"); + answer.append(convert_offset_to_string(components.protocol_end)); + answer.append(",\n"); + + answer.append("\t\"username_end\":"); + answer.append(convert_offset_to_string(components.username_end)); + answer.append(",\n"); + + answer.append("\t\"host_start\":"); + answer.append(convert_offset_to_string(components.host_start)); + answer.append(",\n"); + + answer.append("\t\"host_end\":"); + answer.append(convert_offset_to_string(components.host_end)); + answer.append(",\n"); + + answer.append("\t\"port\":"); + answer.append(convert_offset_to_string(components.port)); + answer.append(",\n"); + + answer.append("\t\"pathname_start\":"); + answer.append(convert_offset_to_string(components.pathname_start)); + answer.append(",\n"); + + answer.append("\t\"search_start\":"); + answer.append(convert_offset_to_string(components.search_start)); + answer.append(",\n"); + + answer.append("\t\"hash_start\":"); + answer.append(convert_offset_to_string(components.hash_start)); + answer.append("\n}"); + + return answer; +} + +[[nodiscard]] bool url_aggregator::has_valid_domain() const noexcept { + if (components.host_start == components.host_end) { + return false; + } + return checkers::verify_dns_length(get_hostname()); +} + +bool url_aggregator::parse_ipv4(std::string_view input) { + ada_log("parse_ipv4 ", input, "[", input.size(), + " bytes], overlaps with buffer: ", + helpers::overlaps(input, buffer) ? "yes" : "no"); + ADA_ASSERT_TRUE(validate()); + const bool trailing_dot = (input.back() == '.'); + if (trailing_dot) { + input.remove_suffix(1); + } + size_t digit_count{0}; + int pure_decimal_count = 0; // entries that are decimal + uint64_t ipv4{0}; + // we could unroll for better performance? + for (; (digit_count < 4) && !(input.empty()); digit_count++) { + uint32_t + segment_result{}; // If any number exceeds 32 bits, we have an error. + bool is_hex = checkers::has_hex_prefix(input); + if (is_hex && ((input.length() == 2) || + ((input.length() > 2) && (input[2] == '.')))) { + // special case + segment_result = 0; + input.remove_prefix(2); + } else { + std::from_chars_result r; + if (is_hex) { + r = std::from_chars(input.data() + 2, input.data() + input.size(), + segment_result, 16); + } else if ((input.length() >= 2) && input[0] == '0' && + checkers::is_digit(input[1])) { + r = std::from_chars(input.data() + 1, input.data() + input.size(), + segment_result, 8); + } else { + pure_decimal_count++; + r = std::from_chars(input.data(), input.data() + input.size(), + segment_result, 10); + } + if (r.ec != std::errc()) { + return is_valid = false; + } + input.remove_prefix(r.ptr - input.data()); + } + if (input.empty()) { + // We have the last value. + // At this stage, ipv4 contains digit_count*8 bits. + // So we have 32-digit_count*8 bits left. + if (segment_result > (uint64_t(1) << (32 - digit_count * 8))) { + return is_valid = false; + } + ipv4 <<= (32 - digit_count * 8); + ipv4 |= segment_result; + goto final; + } else { + // There is more, so that the value must no be larger than 255 + // and we must have a '.'. + if ((segment_result > 255) || (input[0] != '.')) { + return is_valid = false; + } + ipv4 <<= 8; + ipv4 |= segment_result; + input.remove_prefix(1); // remove '.' + } + } + if ((digit_count != 4) || (!input.empty())) { + return is_valid = false; + } +final: + ada_log("url_aggregator::parse_ipv4 completed ", get_href(), + " host: ", get_host()); + + // We could also check r.ptr to see where the parsing ended. + if (pure_decimal_count == 4 && !trailing_dot) { + // The original input was already all decimal and we validated it. So we + // don't need to do anything. + } else { + // Optimization opportunity: Get rid of unnecessary string return in ipv4 + // serializer. + // TODO: This is likely a bug because it goes back update_base_hostname, not + // what we want to do. + update_base_hostname( + ada::serializers::ipv4(ipv4)); // We have to reserialize the address. + } + ADA_ASSERT_TRUE(validate()); + return true; +} + +bool url_aggregator::parse_ipv6(std::string_view input) { + // TODO: Find a way to merge parse_ipv6 with url.cpp implementation. + ada_log("parse_ipv6 ", input, "[", input.size(), " bytes]"); + ADA_ASSERT_TRUE(validate()); + ADA_ASSERT_TRUE(!helpers::overlaps(input, buffer)); + if (input.empty()) { + return is_valid = false; + } + // Let address be a new IPv6 address whose IPv6 pieces are all 0. + std::array address{}; + + // Let pieceIndex be 0. + int piece_index = 0; + + // Let compress be null. + std::optional compress{}; + + // Let pointer be a pointer for input. + std::string_view::iterator pointer = input.begin(); + + // If c is U+003A (:), then: + if (input[0] == ':') { + // If remaining does not start with U+003A (:), validation error, return + // failure. + if (input.size() == 1 || input[1] != ':') { + ada_log("parse_ipv6 starts with : but the rest does not start with :"); + return is_valid = false; + } + + // Increase pointer by 2. + pointer += 2; + + // Increase pieceIndex by 1 and then set compress to pieceIndex. + compress = ++piece_index; + } + + // While c is not the EOF code point: + while (pointer != input.end()) { + // If pieceIndex is 8, validation error, return failure. + if (piece_index == 8) { + ada_log("parse_ipv6 piece_index == 8"); + return is_valid = false; + } + + // If c is U+003A (:), then: + if (*pointer == ':') { + // If compress is non-null, validation error, return failure. + if (compress.has_value()) { + ada_log("parse_ipv6 compress is non-null"); + return is_valid = false; + } + + // Increase pointer and pieceIndex by 1, set compress to pieceIndex, and + // then continue. + pointer++; + compress = ++piece_index; + continue; + } + + // Let value and length be 0. + uint16_t value = 0, length = 0; + + // While length is less than 4 and c is an ASCII hex digit, + // set value to value × 0x10 + c interpreted as hexadecimal number, and + // increase pointer and length by 1. + while (length < 4 && pointer != input.end() && + unicode::is_ascii_hex_digit(*pointer)) { + // https://stackoverflow.com/questions/39060852/why-does-the-addition-of-two-shorts-return-an-int + value = uint16_t(value * 0x10 + unicode::convert_hex_to_binary(*pointer)); + pointer++; + length++; + } + + // If c is U+002E (.), then: + if (pointer != input.end() && *pointer == '.') { + // If length is 0, validation error, return failure. + if (length == 0) { + ada_log("parse_ipv6 length is 0"); + return is_valid = false; + } + + // Decrease pointer by length. + pointer -= length; + + // If pieceIndex is greater than 6, validation error, return failure. + if (piece_index > 6) { + ada_log("parse_ipv6 piece_index > 6"); + return is_valid = false; + } + + // Let numbersSeen be 0. + int numbers_seen = 0; + + // While c is not the EOF code point: + while (pointer != input.end()) { + // Let ipv4Piece be null. + std::optional ipv4_piece{}; + + // If numbersSeen is greater than 0, then: + if (numbers_seen > 0) { + // If c is a U+002E (.) and numbersSeen is less than 4, then increase + // pointer by 1. + if (*pointer == '.' && numbers_seen < 4) { + pointer++; + } else { + // Otherwise, validation error, return failure. + ada_log("parse_ipv6 Otherwise, validation error, return failure"); + return is_valid = false; + } + } + + // If c is not an ASCII digit, validation error, return failure. + if (pointer == input.end() || !checkers::is_digit(*pointer)) { + ada_log( + "parse_ipv6 If c is not an ASCII digit, validation error, return " + "failure"); + return is_valid = false; + } + + // While c is an ASCII digit: + while (pointer != input.end() && checkers::is_digit(*pointer)) { + // Let number be c interpreted as decimal number. + int number = *pointer - '0'; + + // If ipv4Piece is null, then set ipv4Piece to number. + if (!ipv4_piece.has_value()) { + ipv4_piece = number; + } + // Otherwise, if ipv4Piece is 0, validation error, return failure. + else if (ipv4_piece == 0) { + ada_log("parse_ipv6 if ipv4Piece is 0, validation error"); + return is_valid = false; + } + // Otherwise, set ipv4Piece to ipv4Piece × 10 + number. + else { + ipv4_piece = *ipv4_piece * 10 + number; + } + + // If ipv4Piece is greater than 255, validation error, return failure. + if (ipv4_piece > 255) { + ada_log("parse_ipv6 ipv4_piece > 255"); + return is_valid = false; + } + + // Increase pointer by 1. + pointer++; + } + + // Set address[pieceIndex] to address[pieceIndex] × 0x100 + ipv4Piece. + // https://stackoverflow.com/questions/39060852/why-does-the-addition-of-two-shorts-return-an-int + address[piece_index] = + uint16_t(address[piece_index] * 0x100 + *ipv4_piece); + + // Increase numbersSeen by 1. + numbers_seen++; + + // If numbersSeen is 2 or 4, then increase pieceIndex by 1. + if (numbers_seen == 2 || numbers_seen == 4) { + piece_index++; + } + } + + // If numbersSeen is not 4, validation error, return failure. + if (numbers_seen != 4) { + return is_valid = false; + } + + // Break. + break; + } + // Otherwise, if c is U+003A (:): + else if ((pointer != input.end()) && (*pointer == ':')) { + // Increase pointer by 1. + pointer++; + + // If c is the EOF code point, validation error, return failure. + if (pointer == input.end()) { + ada_log( + "parse_ipv6 If c is the EOF code point, validation error, return " + "failure"); + return is_valid = false; + } + } + // Otherwise, if c is not the EOF code point, validation error, return + // failure. + else if (pointer != input.end()) { + ada_log( + "parse_ipv6 Otherwise, if c is not the EOF code point, validation " + "error, return failure"); + return is_valid = false; + } + + // Set address[pieceIndex] to value. + address[piece_index] = value; + + // Increase pieceIndex by 1. + piece_index++; + } + + // If compress is non-null, then: + if (compress.has_value()) { + // Let swaps be pieceIndex − compress. + int swaps = piece_index - *compress; + + // Set pieceIndex to 7. + piece_index = 7; + + // While pieceIndex is not 0 and swaps is greater than 0, + // swap address[pieceIndex] with address[compress + swaps − 1], and then + // decrease both pieceIndex and swaps by 1. + while (piece_index != 0 && swaps > 0) { + std::swap(address[piece_index], address[*compress + swaps - 1]); + piece_index--; + swaps--; + } + } + // Otherwise, if compress is null and pieceIndex is not 8, validation error, + // return failure. + else if (piece_index != 8) { + ada_log( + "parse_ipv6 if compress is null and pieceIndex is not 8, validation " + "error, return failure"); + return is_valid = false; + } + // TODO: Optimization opportunity: Get rid of unnecessary string creation. + // TODO: This is likely a bug because it goes back update_base_hostname, not + // what we want to do. + update_base_hostname(ada::serializers::ipv6(address)); + ada_log("parse_ipv6 ", get_hostname()); + ADA_ASSERT_TRUE(validate()); + return true; +} + +bool url_aggregator::parse_opaque_host(std::string_view input) { + ada_log("parse_opaque_host ", input, "[", input.size(), " bytes]"); + ADA_ASSERT_TRUE(validate()); + ADA_ASSERT_TRUE(!helpers::overlaps(input, buffer)); + if (std::any_of(input.begin(), input.end(), + ada::unicode::is_forbidden_host_code_point)) { + return is_valid = false; + } + + // Return the result of running UTF-8 percent-encode on input using the C0 + // control percent-encode set. + size_t idx = ada::unicode::percent_encode_index( + input, character_sets::C0_CONTROL_PERCENT_ENCODE); + if (idx == input.size()) { + update_base_hostname(input); + } else { + // We only create a temporary string if we need to. + update_base_hostname(ada::unicode::percent_encode( + input, character_sets::C0_CONTROL_PERCENT_ENCODE, idx)); + } + ADA_ASSERT_TRUE(validate()); + return true; +} + +std::string url_aggregator::to_diagram() const { + if (!is_valid) { + return "invalid"; + } + std::string answer; + answer.append(buffer); + answer.append(" ["); + answer.append(std::to_string(buffer.size())); + answer.append(" bytes]"); + answer.append("\n"); + // first line + std::string line1; + line1.resize(buffer.size(), ' '); + if (components.hash_start != url_components::omitted) { + line1[components.hash_start] = '|'; + } + if (components.search_start != url_components::omitted) { + line1[components.search_start] = '|'; + } + if (components.pathname_start != buffer.size()) { + line1[components.pathname_start] = '|'; + } + if (components.host_end != buffer.size()) { + line1[components.host_end] = '|'; + } + if (components.host_start != buffer.size()) { + line1[components.host_start] = '|'; + } + if (components.username_end != buffer.size()) { + line1[components.username_end] = '|'; + } + if (components.protocol_end != buffer.size()) { + line1[components.protocol_end] = '|'; + } + answer.append(line1); + answer.append("\n"); + + std::string line2 = line1; + if (components.hash_start != url_components::omitted) { + line2[components.hash_start] = '`'; + line1[components.hash_start] = ' '; + + for (size_t i = components.hash_start + 1; i < line2.size(); i++) { + line2[i] = '-'; + } + line2.append(" hash_start"); + answer.append(line2); + answer.append("\n"); + } + + std::string line3 = line1; + if (components.search_start != url_components::omitted) { + line3[components.search_start] = '`'; + line1[components.search_start] = ' '; + + for (size_t i = components.search_start + 1; i < line3.size(); i++) { + line3[i] = '-'; + } + line3.append(" search_start "); + line3.append(std::to_string(components.search_start)); + answer.append(line3); + answer.append("\n"); + } + + std::string line4 = line1; + if (components.pathname_start != buffer.size()) { + line4[components.pathname_start] = '`'; + line1[components.pathname_start] = ' '; + for (size_t i = components.pathname_start + 1; i < line4.size(); i++) { + line4[i] = '-'; + } + line4.append(" pathname_start "); + line4.append(std::to_string(components.pathname_start)); + answer.append(line4); + answer.append("\n"); + } + + std::string line5 = line1; + if (components.host_end != buffer.size()) { + line5[components.host_end] = '`'; + line1[components.host_end] = ' '; + + for (size_t i = components.host_end + 1; i < line5.size(); i++) { + line5[i] = '-'; + } + line5.append(" host_end "); + line5.append(std::to_string(components.host_end)); + answer.append(line5); + answer.append("\n"); + } + + std::string line6 = line1; + if (components.host_start != buffer.size()) { + line6[components.host_start] = '`'; + line1[components.host_start] = ' '; + + for (size_t i = components.host_start + 1; i < line6.size(); i++) { + line6[i] = '-'; + } + line6.append(" host_start "); + line6.append(std::to_string(components.host_start)); + answer.append(line6); + answer.append("\n"); + } + + std::string line7 = line1; + if (components.username_end != buffer.size()) { + line7[components.username_end] = '`'; + line1[components.username_end] = ' '; + + for (size_t i = components.username_end + 1; i < line7.size(); i++) { + line7[i] = '-'; + } + line7.append(" username_end "); + line7.append(std::to_string(components.username_end)); + answer.append(line7); + answer.append("\n"); + } + + std::string line8 = line1; + if (components.protocol_end != buffer.size()) { + line8[components.protocol_end] = '`'; + line1[components.protocol_end] = ' '; + + for (size_t i = components.protocol_end + 1; i < line8.size(); i++) { + line8[i] = '-'; + } + line8.append(" protocol_end "); + line8.append(std::to_string(components.protocol_end)); + answer.append(line8); + answer.append("\n"); + } + + if (components.hash_start == url_components::omitted) { + answer.append("note: hash omitted\n"); + } + if (components.search_start == url_components::omitted) { + answer.append("note: search omitted\n"); + } + if (components.protocol_end > buffer.size()) { + answer.append("warning: protocol_end overflows\n"); + } + if (components.username_end > buffer.size()) { + answer.append("warning: username_end overflows\n"); + } + if (components.host_start > buffer.size()) { + answer.append("warning: host_start overflows\n"); + } + if (components.host_end > buffer.size()) { + answer.append("warning: host_end overflows\n"); + } + if (components.pathname_start > buffer.size()) { + answer.append("warning: pathname_start overflows\n"); + } + return answer; +} + +bool url_aggregator::validate() const noexcept { + if (!is_valid) { + return true; + } + if (!components.check_offset_consistency()) { + ada_log("url_aggregator::validate inconsistent components \n", + to_diagram()); + return false; + } + // We have a credible components struct, but let us investivate more + // carefully: + /** + * https://user:pass@example.com:1234/foo/bar?baz#quux + * | | | | ^^^^| | | + * | | | | | | | `----- hash_start + * | | | | | | `--------- search_start + * | | | | | `----------------- pathname_start + * | | | | `--------------------- port + * | | | `----------------------- host_end + * | | `---------------------------------- host_start + * | `--------------------------------------- username_end + * `--------------------------------------------- protocol_end + */ + if (components.protocol_end == url_components::omitted) { + ada_log("url_aggregator::validate omitted protocol_end \n", to_diagram()); + return false; + } + if (components.username_end == url_components::omitted) { + ada_log("url_aggregator::validate omitted username_end \n", to_diagram()); + return false; + } + if (components.host_start == url_components::omitted) { + ada_log("url_aggregator::validate omitted host_start \n", to_diagram()); + return false; + } + if (components.host_end == url_components::omitted) { + ada_log("url_aggregator::validate omitted host_end \n", to_diagram()); + return false; + } + if (components.pathname_start == url_components::omitted) { + ada_log("url_aggregator::validate omitted pathname_start \n", to_diagram()); + return false; + } + + if (components.protocol_end > buffer.size()) { + ada_log("url_aggregator::validate protocol_end overflow \n", to_diagram()); + return false; + } + if (components.username_end > buffer.size()) { + ada_log("url_aggregator::validate username_end overflow \n", to_diagram()); + return false; + } + if (components.host_start > buffer.size()) { + ada_log("url_aggregator::validate host_start overflow \n", to_diagram()); + return false; + } + if (components.host_end > buffer.size()) { + ada_log("url_aggregator::validate host_end overflow \n", to_diagram()); + return false; + } + if (components.pathname_start > buffer.size()) { + ada_log("url_aggregator::validate pathname_start overflow \n", + to_diagram()); + return false; + } + + if (components.protocol_end > 0) { + if (buffer[components.protocol_end - 1] != ':') { + ada_log( + "url_aggregator::validate missing : at the end of the protocol \n", + to_diagram()); + return false; + } + } + + if (components.username_end != buffer.size() && + components.username_end > components.protocol_end + 2) { + if (buffer[components.username_end] != ':' && + buffer[components.username_end] != '@') { + ada_log( + "url_aggregator::validate missing : or @ at the end of the username " + "\n", + to_diagram()); + return false; + } + } + + if (components.host_start != buffer.size()) { + if (components.host_start > components.username_end) { + if (buffer[components.host_start] != '@') { + ada_log( + "url_aggregator::validate missing @ at the end of the password \n", + to_diagram()); + return false; + } + } else if (components.host_start == components.username_end && + components.host_end > components.host_start) { + if (components.host_start == components.protocol_end + 2) { + if (buffer[components.protocol_end] != '/' || + buffer[components.protocol_end + 1] != '/') { + ada_log( + "url_aggregator::validate missing // between protocol and host " + "\n", + to_diagram()); + return false; + } + } else { + if (components.host_start > components.protocol_end && + buffer[components.host_start] != '@') { + ada_log( + "url_aggregator::validate missing @ at the end of the username " + "\n", + to_diagram()); + return false; + } + } + } else { + if (components.host_end != components.host_start) { + ada_log("url_aggregator::validate expected omitted host \n", + to_diagram()); + return false; + } + } + } + if (components.host_end != buffer.size() && + components.pathname_start > components.host_end) { + if (components.pathname_start == components.host_end + 2 && + buffer[components.host_end] == '/' && + buffer[components.host_end + 1] == '.') { + if (components.pathname_start + 1 >= buffer.size() || + buffer[components.pathname_start] != '/' || + buffer[components.pathname_start + 1] != '/') { + ada_log( + "url_aggregator::validate expected the path to begin with // \n", + to_diagram()); + return false; + } + } else if (buffer[components.host_end] != ':') { + ada_log("url_aggregator::validate missing : at the port \n", + to_diagram()); + return false; + } + } + if (components.pathname_start != buffer.size() && + components.pathname_start < components.search_start && + components.pathname_start < components.hash_start && !has_opaque_path) { + if (buffer[components.pathname_start] != '/') { + ada_log("url_aggregator::validate missing / at the path \n", + to_diagram()); + return false; + } + } + if (components.search_start != url_components::omitted) { + if (buffer[components.search_start] != '?') { + ada_log("url_aggregator::validate missing ? at the search \n", + to_diagram()); + return false; + } + } + if (components.hash_start != url_components::omitted) { + if (buffer[components.hash_start] != '#') { + ada_log("url_aggregator::validate missing # at the hash \n", + to_diagram()); + return false; + } + } + + return true; +} + +void url_aggregator::delete_dash_dot() { + ada_log("url_aggregator::delete_dash_dot"); + ADA_ASSERT_TRUE(validate()); + ADA_ASSERT_TRUE(has_dash_dot()); + buffer.erase(components.host_end, 2); + components.pathname_start -= 2; + if (components.search_start != url_components::omitted) { + components.search_start -= 2; + } + if (components.hash_start != url_components::omitted) { + components.hash_start -= 2; + } + ADA_ASSERT_TRUE(validate()); + ADA_ASSERT_TRUE(!has_dash_dot()); +} + +inline void url_aggregator::consume_prepared_path(std::string_view input) { + ada_log("url_aggregator::consume_prepared_path ", input); + /*** + * This is largely duplicated code from helpers::parse_prepared_path, which is + * unfortunate. This particular function is nearly identical, except that it + * is a method on url_aggregator. The idea is that the trivial path (which is + * very common) merely appends to the buffer. This is the same trivial path as + * with helpers::parse_prepared_path, except that we have the additional check + * for is_at_path(). Otherwise, we grab a copy of the current path and we + * modify it, and then insert it back into the buffer. + */ + uint8_t accumulator = checkers::path_signature(input); + // Let us first detect a trivial case. + // If it is special, we check that we have no dot, no %, no \ and no + // character needing percent encoding. Otherwise, we check that we have no %, + // no dot, and no character needing percent encoding. + constexpr uint8_t need_encoding = 1; + constexpr uint8_t backslash_char = 2; + constexpr uint8_t dot_char = 4; + constexpr uint8_t percent_char = 8; + bool special = type != ada::scheme::NOT_SPECIAL; + bool may_need_slow_file_handling = (type == ada::scheme::type::FILE && + checkers::is_windows_drive_letter(input)); + bool trivial_path = + (special ? (accumulator == 0) + : ((accumulator & (need_encoding | dot_char | percent_char)) == + 0)) && + (!may_need_slow_file_handling); + if (accumulator == dot_char && !may_need_slow_file_handling) { + // '4' means that we have at least one dot, but nothing that requires + // percent encoding or decoding. The only part that is not trivial is + // that we may have single dots and double dots path segments. + // If we have such segments, then we either have a path that begins + // with '.' (easy to check), or we have the sequence './'. + // Note: input cannot be empty, it must at least contain one character ('.') + // Note: we know that '\' is not present. + if (input[0] != '.') { + size_t slashdot = input.find("/."); + if (slashdot == std::string_view::npos) { // common case + trivial_path = true; + } else { // uncommon + // only three cases matter: /./, /.. or a final / + trivial_path = + !(slashdot + 2 == input.size() || input[slashdot + 2] == '.' || + input[slashdot + 2] == '/'); + } + } + } + if (trivial_path && is_at_path()) { + ada_log("parse_path trivial"); + buffer += '/'; + buffer += input; + return; + } + std::string path = std::string(get_pathname()); + // We are going to need to look a bit at the path, but let us see if we can + // ignore percent encoding *and* backslashes *and* percent characters. + // Except for the trivial case, this is likely to capture 99% of paths out + // there. + bool fast_path = + (special && + (accumulator & (need_encoding | backslash_char | percent_char)) == 0) && + (type != ada::scheme::type::FILE); + if (fast_path) { + ada_log("parse_prepared_path fast"); + // Here we don't need to worry about \ or percent encoding. + // We also do not have a file protocol. We might have dots, however, + // but dots must as appear as '.', and they cannot be encoded because + // the symbol '%' is not present. + size_t previous_location = 0; // We start at 0. + do { + size_t new_location = input.find('/', previous_location); + // std::string_view path_view = input; + // We process the last segment separately: + if (new_location == std::string_view::npos) { + std::string_view path_view = input.substr(previous_location); + if (path_view == "..") { // The path ends with .. + // e.g., if you receive ".." with an empty path, you go to "/". + if (path.empty()) { + path = '/'; + update_base_pathname(path); + return; + } + // Fast case where we have nothing to do: + if (path.back() == '/') { + update_base_pathname(path); + return; + } + // If you have the path "/joe/myfriend", + // then you delete 'myfriend'. + path.resize(path.rfind('/') + 1); + update_base_pathname(path); + return; + } + path += '/'; + if (path_view != ".") { + path.append(path_view); + } + update_base_pathname(path); + return; + } else { + // This is a non-final segment. + std::string_view path_view = + input.substr(previous_location, new_location - previous_location); + previous_location = new_location + 1; + if (path_view == "..") { + if (!path.empty()) { + path.erase(path.rfind('/')); + } + } else if (path_view != ".") { + path += '/'; + path.append(path_view); + } + } + } while (true); + } else { + ada_log("parse_path slow"); + // we have reached the general case + bool needs_percent_encoding = (accumulator & 1); + std::string path_buffer_tmp; + do { + size_t location = (special && (accumulator & 2)) + ? input.find_first_of("/\\") + : input.find('/'); + std::string_view path_view = input; + if (location != std::string_view::npos) { + path_view.remove_suffix(path_view.size() - location); + input.remove_prefix(location + 1); + } + // path_buffer is either path_view or it might point at a percent encoded + // temporary string. + std::string_view path_buffer = + (needs_percent_encoding && + ada::unicode::percent_encode( + path_view, character_sets::PATH_PERCENT_ENCODE, path_buffer_tmp)) + ? path_buffer_tmp + : path_view; + if (unicode::is_double_dot_path_segment(path_buffer)) { + helpers::shorten_path(path, type); + if (location == std::string_view::npos) { + path += '/'; + } + } else if (unicode::is_single_dot_path_segment(path_buffer) && + (location == std::string_view::npos)) { + path += '/'; + } + // Otherwise, if path_buffer is not a single-dot path segment, then: + else if (!unicode::is_single_dot_path_segment(path_buffer)) { + // If url’s scheme is "file", url’s path is empty, and path_buffer is a + // Windows drive letter, then replace the second code point in + // path_buffer with U+003A (:). + if (type == ada::scheme::type::FILE && path.empty() && + checkers::is_windows_drive_letter(path_buffer)) { + path += '/'; + path += path_buffer[0]; + path += ':'; + path_buffer.remove_prefix(2); + path.append(path_buffer); + } else { + // Append path_buffer to url’s path. + path += '/'; + path.append(path_buffer); + } + } + if (location == std::string_view::npos) { + update_base_pathname(path); + return; + } + } while (true); + } +} +} // namespace ada +/* end file src/url_aggregator.cpp */ /* end file src/ada.cpp */ diff --git a/deps/ada/ada.gyp b/deps/ada/ada.gyp index 1171e8750755e1..55cea0033e4fbd 100644 --- a/deps/ada/ada.gyp +++ b/deps/ada/ada.gyp @@ -1,6 +1,7 @@ { 'variables': { 'v8_enable_i18n_support%': 1, + 'ada_sources': [ 'ada.cpp' ], }, 'targets': [ { @@ -10,23 +11,7 @@ 'direct_dependent_settings': { 'include_dirs': ['.'], }, - 'sources': ['ada.cpp'], - 'conditions': [ - ['v8_enable_i18n_support==0', { - 'defines': ['ADA_HAS_ICU=0'], - }], - ['v8_enable_i18n_support==1', { - 'dependencies': [ - '<(icu_gyp_path):icui18n', - '<(icu_gyp_path):icuuc', - ], - }], - ['OS=="win" and v8_enable_i18n_support==1', { - 'dependencies': [ - '<(icu_gyp_path):icudata', - ], - }], - ] + 'sources': [ '<@(ada_sources)' ] }, ] } diff --git a/deps/ada/ada.h b/deps/ada/ada.h index 9916f41fd23b28..db24fb969c6489 100644 --- a/deps/ada/ada.h +++ b/deps/ada/ada.h @@ -1,5 +1,4 @@ -/* auto-generated on 2023-02-26 15:07:41 -0500. Do not edit! */ -// dofile: invoked with prepath=/Users/dlemire/CVS/github/ada/include, filename=ada.h +/* auto-generated on 2023-03-30 17:00:48 -0400. Do not edit! */ /* begin file include/ada.h */ /** * @file ada.h @@ -8,7 +7,144 @@ #ifndef ADA_H #define ADA_H -// dofile: invoked with prepath=/Users/dlemire/CVS/github/ada/include, filename=ada/character_sets-inl.h +/* begin file include/ada/ada_idna.h */ +/* auto-generated on 2023-03-28 11:03:13 -0400. Do not edit! */ +/* begin file include/idna.h */ +#ifndef ADA_IDNA_H +#define ADA_IDNA_H + +/* begin file include/ada/idna/unicode_transcoding.h */ +#ifndef ADA_IDNA_UNICODE_TRANSCODING_H +#define ADA_IDNA_UNICODE_TRANSCODING_H + +#include +#include + +namespace ada::idna { + +size_t utf8_to_utf32(const char* buf, size_t len, char32_t* utf32_output); + +size_t utf8_length_from_utf32(const char32_t* buf, size_t len); + +size_t utf32_length_from_utf8(const char* buf, size_t len); + +size_t utf32_to_utf8(const char32_t* buf, size_t len, char* utf8_output); + +} // namespace ada::idna + +#endif // ADA_IDNA_UNICODE_TRANSCODING_H +/* end file include/ada/idna/unicode_transcoding.h */ +/* begin file include/ada/idna/mapping.h */ +#ifndef ADA_IDNA_MAPPING_H +#define ADA_IDNA_MAPPING_H + +#include +#include +namespace ada::idna { + +// If the input is ascii, then the mapping is just -> lower case. +void ascii_map(char* input, size_t length); +// check whether an ascii string needs mapping +bool ascii_has_upper_case(char* input, size_t length); +// Map the characters according to IDNA, returning the empty string on error. +std::u32string map(std::u32string_view input); + +} // namespace ada::idna + +#endif +/* end file include/ada/idna/mapping.h */ +/* begin file include/ada/idna/normalization.h */ +#ifndef ADA_IDNA_NORMALIZATION_H +#define ADA_IDNA_NORMALIZATION_H + +#include +#include +namespace ada::idna { + +// Normalize the characters according to IDNA (Unicode Normalization Form C). +void normalize(std::u32string& input); + +} // namespace ada::idna +#endif +/* end file include/ada/idna/normalization.h */ +/* begin file include/ada/idna/punycode.h */ +#ifndef ADA_IDNA_PUNYCODE_H +#define ADA_IDNA_PUNYCODE_H + +#include +#include +namespace ada::idna { + +bool punycode_to_utf32(std::string_view input, std::u32string& out); +bool verify_punycode(std::string_view input); +bool utf32_to_punycode(std::u32string_view input, std::string& out); + +} // namespace ada::idna + +#endif // ADA_IDNA_PUNYCODE_H +/* end file include/ada/idna/punycode.h */ +/* begin file include/ada/idna/validity.h */ +#ifndef ADA_IDNA_VALIDITY_H +#define ADA_IDNA_VALIDITY_H + +#include +#include + +namespace ada::idna { + +/** + * @see https://www.unicode.org/reports/tr46/#Validity_Criteria + */ +bool is_label_valid(const std::u32string_view label); + +} // namespace ada::idna + +#endif // ADA_IDNA_VALIDITY_H +/* end file include/ada/idna/validity.h */ +/* begin file include/ada/idna/to_ascii.h */ +#ifndef ADA_IDNA_TO_ASCII_H +#define ADA_IDNA_TO_ASCII_H + +#include +#include + +namespace ada::idna { +// Converts a domain (e.g., www.google.com) possibly containing international +// characters to an ascii domain (with punycode). It will not do percent +// decoding: percent decoding should be done prior to calling this function. We +// do not remove tabs and spaces, they should have been removed prior to calling +// this function. We also do not trim control characters. We also assume that +// the input is not empty. We return "" on error. For now. +std::string to_ascii(std::string_view ut8_string); + +bool constexpr begins_with(std::u32string_view view, + std::u32string_view prefix); +bool constexpr begins_with(std::string_view view, std::string_view prefix); + +bool constexpr is_ascii(std::u32string_view view); +bool constexpr is_ascii(std::string_view view); + +std::string from_ascii_to_ascii(std::string_view ut8_string); + +} // namespace ada::idna + +#endif // ADA_IDNA_TO_ASCII_H +/* end file include/ada/idna/to_ascii.h */ +/* begin file include/ada/idna/to_unicode.h */ + +#ifndef ADA_IDNA_TO_UNICODE_H +#define ADA_IDNA_TO_UNICODE_H + +namespace ada::idna { +std::string to_unicode(std::string_view input); +} // namespace ada::idna + +#endif // ADA_IDNA_TO_UNICODE_H +/* end file include/ada/idna/to_unicode.h */ + +#endif +/* end file include/idna.h */ +/* end file include/ada/ada_idna.h */ /* begin file include/ada/character_sets-inl.h */ /** * @file character_sets-inl.h @@ -19,7 +155,6 @@ #ifndef ADA_CHARACTER_SETS_INL_H #define ADA_CHARACTER_SETS_INL_H -// dofile: invoked with prepath=/Users/dlemire/CVS/github/ada/include, filename=ada/character_sets.h /* begin file include/ada/character_sets.h */ /** * @file character_sets.h @@ -30,7 +165,6 @@ #ifndef ADA_CHARACTER_SETS_H #define ADA_CHARACTER_SETS_H -// dofile: invoked with prepath=/Users/dlemire/CVS/github/ada/include, filename=ada/common_defs.h /* begin file include/ada/common_defs.h */ /** * @file common_defs.h @@ -52,19 +186,21 @@ #else // just regular visual studio (best guess) #define ADA_REGULAR_VISUAL_STUDIO 1 -#endif // __clang__ -#endif // _MSC_VER - +#endif // __clang__ +#endif // _MSC_VER #if defined(__GNUC__) - // Marks a block with a name so that MCA analysis can see it. - #define ADA_BEGIN_DEBUG_BLOCK(name) __asm volatile("# LLVM-MCA-BEGIN " #name); - #define ADA_END_DEBUG_BLOCK(name) __asm volatile("# LLVM-MCA-END " #name); - #define ADA_DEBUG_BLOCK(name, block) BEGIN_DEBUG_BLOCK(name); block; END_DEBUG_BLOCK(name); +// Marks a block with a name so that MCA analysis can see it. +#define ADA_BEGIN_DEBUG_BLOCK(name) __asm volatile("# LLVM-MCA-BEGIN " #name); +#define ADA_END_DEBUG_BLOCK(name) __asm volatile("# LLVM-MCA-END " #name); +#define ADA_DEBUG_BLOCK(name, block) \ + BEGIN_DEBUG_BLOCK(name); \ + block; \ + END_DEBUG_BLOCK(name); #else - #define ADA_BEGIN_DEBUG_BLOCK(name) - #define ADA_END_DEBUG_BLOCK(name) - #define ADA_DEBUG_BLOCK(name, block) +#define ADA_BEGIN_DEBUG_BLOCK(name) +#define ADA_END_DEBUG_BLOCK(name) +#define ADA_DEBUG_BLOCK(name, block) #endif // Align to N-byte boundary @@ -75,105 +211,119 @@ #if defined(ADA_REGULAR_VISUAL_STUDIO) - #define ada_really_inline __forceinline - #define ada_never_inline __declspec(noinline) - - #define ada_unused - #define ada_warn_unused - - #ifndef ada_likely - #define ada_likely(x) x - #endif - #ifndef ada_unlikely - #define ada_unlikely(x) x - #endif - - #define ADA_PUSH_DISABLE_WARNINGS __pragma(warning( push )) - #define ADA_PUSH_DISABLE_ALL_WARNINGS __pragma(warning( push, 0 )) - #define ADA_DISABLE_VS_WARNING(WARNING_NUMBER) __pragma(warning( disable : WARNING_NUMBER )) - // Get rid of Intellisense-only warnings (Code Analysis) - // Though __has_include is C++17, it is supported in Visual Studio 2017 or better (_MSC_VER>=1910). - #ifdef __has_include - #if __has_include() - #include - #define ADA_DISABLE_UNDESIRED_WARNINGS ADA_DISABLE_VS_WARNING(ALL_CPPCORECHECK_WARNINGS) - #endif - #endif - - #ifndef ADA_DISABLE_UNDESIRED_WARNINGS - #define ADA_DISABLE_UNDESIRED_WARNINGS - #endif - - #define ADA_DISABLE_DEPRECATED_WARNING ADA_DISABLE_VS_WARNING(4996) - #define ADA_DISABLE_STRICT_OVERFLOW_WARNING - #define ADA_POP_DISABLE_WARNINGS __pragma(warning( pop )) - -#else // ADA_REGULAR_VISUAL_STUDIO - - #define ada_really_inline inline __attribute__((always_inline)) - #define ada_never_inline inline __attribute__((noinline)) - - #define ada_unused __attribute__((unused)) - #define ada_warn_unused __attribute__((warn_unused_result)) - - #ifndef ada_likely - #define ada_likely(x) __builtin_expect(!!(x), 1) - #endif - #ifndef ada_unlikely - #define ada_unlikely(x) __builtin_expect(!!(x), 0) - #endif - - #define ADA_PUSH_DISABLE_WARNINGS _Pragma("GCC diagnostic push") - // gcc doesn't seem to disable all warnings with all and extra, add warnings here as necessary - #define ADA_PUSH_DISABLE_ALL_WARNINGS ADA_PUSH_DISABLE_WARNINGS \ - ADA_DISABLE_GCC_WARNING(-Weffc++) \ - ADA_DISABLE_GCC_WARNING(-Wall) \ - ADA_DISABLE_GCC_WARNING(-Wconversion) \ - ADA_DISABLE_GCC_WARNING(-Wextra) \ - ADA_DISABLE_GCC_WARNING(-Wattributes) \ - ADA_DISABLE_GCC_WARNING(-Wimplicit-fallthrough) \ - ADA_DISABLE_GCC_WARNING(-Wnon-virtual-dtor) \ - ADA_DISABLE_GCC_WARNING(-Wreturn-type) \ - ADA_DISABLE_GCC_WARNING(-Wshadow) \ - ADA_DISABLE_GCC_WARNING(-Wunused-parameter) \ - ADA_DISABLE_GCC_WARNING(-Wunused-variable) - #define ADA_PRAGMA(P) _Pragma(#P) - #define ADA_DISABLE_GCC_WARNING(WARNING) ADA_PRAGMA(GCC diagnostic ignored #WARNING) - #if defined(ADA_CLANG_VISUAL_STUDIO) - #define ADA_DISABLE_UNDESIRED_WARNINGS ADA_DISABLE_GCC_WARNING(-Wmicrosoft-include) - #else - #define ADA_DISABLE_UNDESIRED_WARNINGS - #endif - #define ADA_DISABLE_DEPRECATED_WARNING ADA_DISABLE_GCC_WARNING(-Wdeprecated-declarations) - #define ADA_DISABLE_STRICT_OVERFLOW_WARNING ADA_DISABLE_GCC_WARNING(-Wstrict-overflow) - #define ADA_POP_DISABLE_WARNINGS _Pragma("GCC diagnostic pop") - -#endif // MSC_VER +#define ada_really_inline __forceinline +#define ada_never_inline __declspec(noinline) + +#define ada_unused +#define ada_warn_unused + +#ifndef ada_likely +#define ada_likely(x) x +#endif +#ifndef ada_unlikely +#define ada_unlikely(x) x +#endif + +#define ADA_PUSH_DISABLE_WARNINGS __pragma(warning(push)) +#define ADA_PUSH_DISABLE_ALL_WARNINGS __pragma(warning(push, 0)) +#define ADA_DISABLE_VS_WARNING(WARNING_NUMBER) \ + __pragma(warning(disable : WARNING_NUMBER)) +// Get rid of Intellisense-only warnings (Code Analysis) +// Though __has_include is C++17, it is supported in Visual Studio 2017 or +// better (_MSC_VER>=1910). +#ifdef __has_include +#if __has_include() +#include +#define ADA_DISABLE_UNDESIRED_WARNINGS \ + ADA_DISABLE_VS_WARNING(ALL_CPPCORECHECK_WARNINGS) +#endif +#endif + +#ifndef ADA_DISABLE_UNDESIRED_WARNINGS +#define ADA_DISABLE_UNDESIRED_WARNINGS +#endif + +#define ADA_DISABLE_DEPRECATED_WARNING ADA_DISABLE_VS_WARNING(4996) +#define ADA_DISABLE_STRICT_OVERFLOW_WARNING +#define ADA_POP_DISABLE_WARNINGS __pragma(warning(pop)) + +#else // ADA_REGULAR_VISUAL_STUDIO + +#define ada_really_inline inline __attribute__((always_inline)) +#define ada_never_inline inline __attribute__((noinline)) + +#define ada_unused __attribute__((unused)) +#define ada_warn_unused __attribute__((warn_unused_result)) + +#ifndef ada_likely +#define ada_likely(x) __builtin_expect(!!(x), 1) +#endif +#ifndef ada_unlikely +#define ada_unlikely(x) __builtin_expect(!!(x), 0) +#endif + +#define ADA_PUSH_DISABLE_WARNINGS _Pragma("GCC diagnostic push") +// gcc doesn't seem to disable all warnings with all and extra, add warnings +// here as necessary +#define ADA_PUSH_DISABLE_ALL_WARNINGS \ + ADA_PUSH_DISABLE_WARNINGS \ + ADA_DISABLE_GCC_WARNING("-Weffc++") \ + ADA_DISABLE_GCC_WARNING("-Wall") \ + ADA_DISABLE_GCC_WARNING("-Wconversion") \ + ADA_DISABLE_GCC_WARNING("-Wextra") \ + ADA_DISABLE_GCC_WARNING("-Wattributes") \ + ADA_DISABLE_GCC_WARNING("-Wimplicit-fallthrough") \ + ADA_DISABLE_GCC_WARNING("-Wnon-virtual-dtor") \ + ADA_DISABLE_GCC_WARNING("-Wreturn-type") \ + ADA_DISABLE_GCC_WARNING("-Wshadow") \ + ADA_DISABLE_GCC_WARNING("-Wunused-parameter") \ + ADA_DISABLE_GCC_WARNING("-Wunused-variable") +#define ADA_PRAGMA(P) _Pragma(#P) +#define ADA_DISABLE_GCC_WARNING(WARNING) \ + ADA_PRAGMA(GCC diagnostic ignored WARNING) +#if defined(ADA_CLANG_VISUAL_STUDIO) +#define ADA_DISABLE_UNDESIRED_WARNINGS \ + ADA_DISABLE_GCC_WARNING("-Wmicrosoft-include") +#else +#define ADA_DISABLE_UNDESIRED_WARNINGS +#endif +#define ADA_DISABLE_DEPRECATED_WARNING \ + ADA_DISABLE_GCC_WARNING("-Wdeprecated-declarations") +#define ADA_DISABLE_STRICT_OVERFLOW_WARNING \ + ADA_DISABLE_GCC_WARNING("-Wstrict-overflow") +#define ADA_POP_DISABLE_WARNINGS _Pragma("GCC diagnostic pop") + +#endif // MSC_VER #if defined(ADA_VISUAL_STUDIO) - /** - * It does not matter here whether you are using - * the regular visual studio or clang under visual - * studio. - */ - #if ADA_USING_LIBRARY - #define ADA_DLLIMPORTEXPORT __declspec(dllimport) - #else - #define ADA_DLLIMPORTEXPORT __declspec(dllexport) - #endif +/** + * It does not matter here whether you are using + * the regular visual studio or clang under visual + * studio. + */ +#if ADA_USING_LIBRARY +#define ADA_DLLIMPORTEXPORT __declspec(dllimport) +#else +#define ADA_DLLIMPORTEXPORT __declspec(dllexport) +#endif #else - #define ADA_DLLIMPORTEXPORT +#define ADA_DLLIMPORTEXPORT #endif /// If EXPR is an error, returns it. -#define ADA_TRY(EXPR) { auto _err = (EXPR); if (_err) { return _err; } } +#define ADA_TRY(EXPR) \ + { \ + auto _err = (EXPR); \ + if (_err) { \ + return _err; \ + } \ + } // __has_cpp_attribute is part of C++20 #if !defined(__has_cpp_attribute) #define __has_cpp_attribute(x) 0 #endif - #if __has_cpp_attribute(gnu::noinline) #define ADA_ATTRIBUTE_NOINLINE [[gnu::noinline]] #else @@ -181,23 +331,21 @@ #endif namespace ada { - [[noreturn]] inline void unreachable() { +[[noreturn]] inline void unreachable() { #ifdef __GNUC__ - __builtin_unreachable(); + __builtin_unreachable(); #elif defined(_MSC_VER) - __assume(false); + __assume(false); #else #endif - } } - - +} // namespace ada #if defined(__GNUC__) && !defined(__clang__) #if __GNUC__ <= 8 #define ADA_OLD_GCC 1 -#endif // __GNUC__ <= 8 -#endif // defined(__GNUC__) && !defined(__clang__) +#endif // __GNUC__ <= 8 +#endif // defined(__GNUC__) && !defined(__clang__) #if ADA_OLD_GCC #define ada_constexpr @@ -205,56 +353,107 @@ namespace ada { #define ada_constexpr constexpr #endif - #if defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) - #define ADA_IS_BIG_ENDIAN (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__) - #elif defined(_WIN32) - #define ADA_IS_BIG_ENDIAN 0 - #else - #if defined(__APPLE__) || defined(__FreeBSD__) // defined __BYTE_ORDER__ && defined __ORDER_BIG_ENDIAN__ - #include - #elif defined(sun) || defined(__sun) // defined(__APPLE__) || defined(__FreeBSD__) - #include - #else // defined(__APPLE__) || defined(__FreeBSD__) - - #ifdef __has_include - #if __has_include() - #include - #endif //__has_include() - #endif //__has_include - - #endif // defined(__APPLE__) || defined(__FreeBSD__) - - - #ifndef !defined(__BYTE_ORDER__) || !defined(__ORDER_LITTLE_ENDIAN__) - #define ADA_IS_BIG_ENDIAN 0 - #endif - - #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ - #define ADA_IS_BIG_ENDIAN 0 - #else // __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ - #define ADA_IS_BIG_ENDIAN 1 - #endif // __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ - - #endif // defined __BYTE_ORDER__ && defined __ORDER_BIG_ENDIAN__ - - -#ifndef ADA_HAS_ICU -#if __has_include() -#define ADA_HAS_ICU 1 +#if defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) +#define ADA_IS_BIG_ENDIAN (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__) +#elif defined(_WIN32) +#define ADA_IS_BIG_ENDIAN 0 #else -#define ADA_HAS_ICU 0 -#endif // __has_include() -#endif // ADA_HAS_ICU - -#if ADA_HAS_ICU -#include -#include -#include -#endif // ADA_HAS_ICU +#if defined(__APPLE__) || \ + defined(__FreeBSD__) // defined __BYTE_ORDER__ && defined + // __ORDER_BIG_ENDIAN__ +#include +#elif defined(sun) || \ + defined(__sun) // defined(__APPLE__) || defined(__FreeBSD__) +#include +#else // defined(__APPLE__) || defined(__FreeBSD__) + +#ifdef __has_include +#if __has_include() +#include +#endif //__has_include() +#endif //__has_include + +#endif // defined(__APPLE__) || defined(__FreeBSD__) + +#ifndef !defined(__BYTE_ORDER__) || !defined(__ORDER_LITTLE_ENDIAN__) +#define ADA_IS_BIG_ENDIAN 0 +#endif -#define ADA_WINDOWS_TO_ASCII_FALLBACK 0 // we never use anything but ICU. No fallback. +#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ +#define ADA_IS_BIG_ENDIAN 0 +#else // __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ +#define ADA_IS_BIG_ENDIAN 1 +#endif // __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ + +#endif // defined __BYTE_ORDER__ && defined __ORDER_BIG_ENDIAN__ + +// Unless the programmer has already set ADA_DEVELOPMENT_CHECKS, +// we want to set it under debug builds. We detect a debug build +// under Visual Studio when the _DEBUG macro is set. Under the other +// compilers, we use the fact that they define __OPTIMIZE__ whenever +// they allow optimizations. +// It is possible that this could miss some cases where ADA_DEVELOPMENT_CHECKS +// is helpful, but the programmer can set the macro ADA_DEVELOPMENT_CHECKS. +// It could also wrongly set ADA_DEVELOPMENT_CHECKS (e.g., if the programmer +// sets _DEBUG in a release build under Visual Studio, or if some compiler fails +// to set the __OPTIMIZE__ macro). +#if !defined(ADA_DEVELOPMENT_CHECKS) && !defined(NDEBUG) +#ifdef _MSC_VER +// Visual Studio seems to set _DEBUG for debug builds. +#ifdef _DEBUG +#define ADA_DEVELOPMENT_CHECKS 1 +#endif // _DEBUG +#else // _MSC_VER +// All other compilers appear to set __OPTIMIZE__ to a positive integer +// when the compiler is optimizing. +#ifndef __OPTIMIZE__ +#define ADA_DEVELOPMENT_CHECKS 1 +#endif // __OPTIMIZE__ +#endif // _MSC_VER +#endif // SIMDJSON_DEVELOPMENT_CHECKS + +#define ADA_STR(x) #x + +#if ADA_DEVELOPMENT_CHECKS +#define ADA_REQUIRE(EXPR) \ + { \ + if (!(EXPR) { abort(); }) } + +#define ADA_FAIL(MESSAGE) \ + do { \ + std::cerr << "FAIL: " << (MESSAGE) << std::endl; \ + abort(); \ + } while (0); +#define ADA_ASSERT_EQUAL(LHS, RHS, MESSAGE) \ + do { \ + if (LHS != RHS) { \ + std::cerr << "Mismatch: '" << LHS << "' - '" << RHS << "'" << std::endl; \ + ADA_FAIL(MESSAGE); \ + } \ + } while (0); +#define ADA_ASSERT_TRUE(COND) \ + do { \ + if (!(COND)) { \ + std::cerr << "Assert at line " << __LINE__ << " of file " << __FILE__ \ + << std::endl; \ + ADA_FAIL(ADA_STR(COND)); \ + } \ + } while (0); +#else +#define ADA_FAIL(MESSAGE) +#define ADA_ASSERT_EQUAL(LHS, RHS, MESSAGE) +#define ADA_ASSERT_TRUE(COND) +#endif -#endif // ADA_COMMON_DEFS_H +#ifdef ADA_VISUAL_STUDIO +#define ADA_ASSUME(COND) __assume(COND) +#else +#define ADA_ASSUME(COND) \ + do { \ + if (!(COND)) __builtin_unreachable(); \ + } while (0) +#endif +#endif // ADA_COMMON_DEFS_H /* end file include/ada/common_defs.h */ #include @@ -263,148 +462,81 @@ namespace ada { * @brief Includes the definitions for unicode character sets. */ namespace ada::character_sets { - ada_really_inline bool bit_at(const uint8_t a[], const uint8_t i); -} // namespace ada::character_sets +ada_really_inline bool bit_at(const uint8_t a[], const uint8_t i); +} // namespace ada::character_sets -#endif // ADA_CHARACTER_SETS_H +#endif // ADA_CHARACTER_SETS_H /* end file include/ada/character_sets.h */ namespace ada::character_sets { - constexpr char hex[1024] = - "%00\0%01\0%02\0%03\0%04\0%05\0%06\0%07\0" - "%08\0%09\0%0A\0%0B\0%0C\0%0D\0%0E\0%0F\0" - "%10\0%11\0%12\0%13\0%14\0%15\0%16\0%17\0" - "%18\0%19\0%1A\0%1B\0%1C\0%1D\0%1E\0%1F\0" - "%20\0%21\0%22\0%23\0%24\0%25\0%26\0%27\0" - "%28\0%29\0%2A\0%2B\0%2C\0%2D\0%2E\0%2F\0" - "%30\0%31\0%32\0%33\0%34\0%35\0%36\0%37\0" - "%38\0%39\0%3A\0%3B\0%3C\0%3D\0%3E\0%3F\0" - "%40\0%41\0%42\0%43\0%44\0%45\0%46\0%47\0" - "%48\0%49\0%4A\0%4B\0%4C\0%4D\0%4E\0%4F\0" - "%50\0%51\0%52\0%53\0%54\0%55\0%56\0%57\0" - "%58\0%59\0%5A\0%5B\0%5C\0%5D\0%5E\0%5F\0" - "%60\0%61\0%62\0%63\0%64\0%65\0%66\0%67\0" - "%68\0%69\0%6A\0%6B\0%6C\0%6D\0%6E\0%6F\0" - "%70\0%71\0%72\0%73\0%74\0%75\0%76\0%77\0" - "%78\0%79\0%7A\0%7B\0%7C\0%7D\0%7E\0%7F\0" - "%80\0%81\0%82\0%83\0%84\0%85\0%86\0%87\0" - "%88\0%89\0%8A\0%8B\0%8C\0%8D\0%8E\0%8F\0" - "%90\0%91\0%92\0%93\0%94\0%95\0%96\0%97\0" - "%98\0%99\0%9A\0%9B\0%9C\0%9D\0%9E\0%9F\0" - "%A0\0%A1\0%A2\0%A3\0%A4\0%A5\0%A6\0%A7\0" - "%A8\0%A9\0%AA\0%AB\0%AC\0%AD\0%AE\0%AF\0" - "%B0\0%B1\0%B2\0%B3\0%B4\0%B5\0%B6\0%B7\0" - "%B8\0%B9\0%BA\0%BB\0%BC\0%BD\0%BE\0%BF\0" - "%C0\0%C1\0%C2\0%C3\0%C4\0%C5\0%C6\0%C7\0" - "%C8\0%C9\0%CA\0%CB\0%CC\0%CD\0%CE\0%CF\0" - "%D0\0%D1\0%D2\0%D3\0%D4\0%D5\0%D6\0%D7\0" - "%D8\0%D9\0%DA\0%DB\0%DC\0%DD\0%DE\0%DF\0" - "%E0\0%E1\0%E2\0%E3\0%E4\0%E5\0%E6\0%E7\0" - "%E8\0%E9\0%EA\0%EB\0%EC\0%ED\0%EE\0%EF\0" - "%F0\0%F1\0%F2\0%F3\0%F4\0%F5\0%F6\0%F7\0" - "%F8\0%F9\0%FA\0%FB\0%FC\0%FD\0%FE\0%FF"; - - constexpr uint8_t C0_CONTROL_PERCENT_ENCODE[32] = { - // 00 01 02 03 04 05 06 07 - 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // 08 09 0A 0B 0C 0D 0E 0F - 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // 10 11 12 13 14 15 16 17 - 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // 18 19 1A 1B 1C 1D 1E 1F - 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // 20 21 22 23 24 25 26 27 - 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 28 29 2A 2B 2C 2D 2E 2F - 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 30 31 32 33 34 35 36 37 - 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 38 39 3A 3B 3C 3D 3E 3F - 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 40 41 42 43 44 45 46 47 - 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 48 49 4A 4B 4C 4D 4E 4F - 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 50 51 52 53 54 55 56 57 - 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 58 59 5A 5B 5C 5D 5E 5F - 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 60 61 62 63 64 65 66 67 - 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 68 69 6A 6B 6C 6D 6E 6F - 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 70 71 72 73 74 75 76 77 - 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 78 79 7A 7B 7C 7D 7E 7F - 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x80, - // 80 81 82 83 84 85 86 87 - 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // 88 89 8A 8B 8C 8D 8E 8F - 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // 90 91 92 93 94 95 96 97 - 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // 98 99 9A 9B 9C 9D 9E 9F - 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // A0 A1 A2 A3 A4 A5 A6 A7 - 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // A8 A9 AA AB AC AD AE AF - 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // B0 B1 B2 B3 B4 B5 B6 B7 - 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // B8 B9 BA BB BC BD BE BF - 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // C0 C1 C2 C3 C4 C5 C6 C7 - 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // C8 C9 CA CB CC CD CE CF - 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // D0 D1 D2 D3 D4 D5 D6 D7 - 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // D8 D9 DA DB DC DD DE DF - 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // E0 E1 E2 E3 E4 E5 E6 E7 - 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // E8 E9 EA EB EC ED EE EF - 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // F0 F1 F2 F3 F4 F5 F6 F7 - 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // F8 F9 FA FB FC FD FE FF - 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80 - }; - - constexpr uint8_t SPECIAL_QUERY_PERCENT_ENCODE[32] = { - // 00 01 02 03 04 05 06 07 - 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // 08 09 0A 0B 0C 0D 0E 0F - 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // 10 11 12 13 14 15 16 17 - 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // 18 19 1A 1B 1C 1D 1E 1F - 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // 20 21 22 23 24 25 26 27 - 0x01 | 0x00 | 0x04 | 0x08 | 0x00 | 0x00 | 0x00 | 0x80, - // 28 29 2A 2B 2C 2D 2E 2F - 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 30 31 32 33 34 35 36 37 - 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 38 39 3A 3B 3C 3D 3E 3F - 0x00 | 0x00 | 0x00 | 0x00 | 0x10 | 0x00 | 0x40 | 0x00, - // 40 41 42 43 44 45 46 47 - 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 48 49 4A 4B 4C 4D 4E 4F - 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 50 51 52 53 54 55 56 57 - 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 58 59 5A 5B 5C 5D 5E 5F - 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 60 61 62 63 64 65 66 67 - 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 68 69 6A 6B 6C 6D 6E 6F - 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 70 71 72 73 74 75 76 77 - 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 78 79 7A 7B 7C 7D 7E 7F - 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x80, +constexpr char hex[1024] = + "%00\0%01\0%02\0%03\0%04\0%05\0%06\0%07\0" + "%08\0%09\0%0A\0%0B\0%0C\0%0D\0%0E\0%0F\0" + "%10\0%11\0%12\0%13\0%14\0%15\0%16\0%17\0" + "%18\0%19\0%1A\0%1B\0%1C\0%1D\0%1E\0%1F\0" + "%20\0%21\0%22\0%23\0%24\0%25\0%26\0%27\0" + "%28\0%29\0%2A\0%2B\0%2C\0%2D\0%2E\0%2F\0" + "%30\0%31\0%32\0%33\0%34\0%35\0%36\0%37\0" + "%38\0%39\0%3A\0%3B\0%3C\0%3D\0%3E\0%3F\0" + "%40\0%41\0%42\0%43\0%44\0%45\0%46\0%47\0" + "%48\0%49\0%4A\0%4B\0%4C\0%4D\0%4E\0%4F\0" + "%50\0%51\0%52\0%53\0%54\0%55\0%56\0%57\0" + "%58\0%59\0%5A\0%5B\0%5C\0%5D\0%5E\0%5F\0" + "%60\0%61\0%62\0%63\0%64\0%65\0%66\0%67\0" + "%68\0%69\0%6A\0%6B\0%6C\0%6D\0%6E\0%6F\0" + "%70\0%71\0%72\0%73\0%74\0%75\0%76\0%77\0" + "%78\0%79\0%7A\0%7B\0%7C\0%7D\0%7E\0%7F\0" + "%80\0%81\0%82\0%83\0%84\0%85\0%86\0%87\0" + "%88\0%89\0%8A\0%8B\0%8C\0%8D\0%8E\0%8F\0" + "%90\0%91\0%92\0%93\0%94\0%95\0%96\0%97\0" + "%98\0%99\0%9A\0%9B\0%9C\0%9D\0%9E\0%9F\0" + "%A0\0%A1\0%A2\0%A3\0%A4\0%A5\0%A6\0%A7\0" + "%A8\0%A9\0%AA\0%AB\0%AC\0%AD\0%AE\0%AF\0" + "%B0\0%B1\0%B2\0%B3\0%B4\0%B5\0%B6\0%B7\0" + "%B8\0%B9\0%BA\0%BB\0%BC\0%BD\0%BE\0%BF\0" + "%C0\0%C1\0%C2\0%C3\0%C4\0%C5\0%C6\0%C7\0" + "%C8\0%C9\0%CA\0%CB\0%CC\0%CD\0%CE\0%CF\0" + "%D0\0%D1\0%D2\0%D3\0%D4\0%D5\0%D6\0%D7\0" + "%D8\0%D9\0%DA\0%DB\0%DC\0%DD\0%DE\0%DF\0" + "%E0\0%E1\0%E2\0%E3\0%E4\0%E5\0%E6\0%E7\0" + "%E8\0%E9\0%EA\0%EB\0%EC\0%ED\0%EE\0%EF\0" + "%F0\0%F1\0%F2\0%F3\0%F4\0%F5\0%F6\0%F7\0" + "%F8\0%F9\0%FA\0%FB\0%FC\0%FD\0%FE\0%FF"; + +constexpr uint8_t C0_CONTROL_PERCENT_ENCODE[32] = { + // 00 01 02 03 04 05 06 07 + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // 08 09 0A 0B 0C 0D 0E 0F + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // 10 11 12 13 14 15 16 17 + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // 18 19 1A 1B 1C 1D 1E 1F + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // 20 21 22 23 24 25 26 27 + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 28 29 2A 2B 2C 2D 2E 2F + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 30 31 32 33 34 35 36 37 + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 38 39 3A 3B 3C 3D 3E 3F + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 40 41 42 43 44 45 46 47 + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 48 49 4A 4B 4C 4D 4E 4F + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 50 51 52 53 54 55 56 57 + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 58 59 5A 5B 5C 5D 5E 5F + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 60 61 62 63 64 65 66 67 + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 68 69 6A 6B 6C 6D 6E 6F + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 70 71 72 73 74 75 76 77 + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 78 79 7A 7B 7C 7D 7E 7F + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x80, // 80 81 82 83 84 85 86 87 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, // 88 89 8A 8B 8C 8D 8E 8F @@ -436,42 +568,41 @@ namespace ada::character_sets { // F0 F1 F2 F3 F4 F5 F6 F7 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, // F8 F9 FA FB FC FD FE FF - 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80 - }; - - constexpr uint8_t QUERY_PERCENT_ENCODE[32] = { - // 00 01 02 03 04 05 06 07 - 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // 08 09 0A 0B 0C 0D 0E 0F - 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // 10 11 12 13 14 15 16 17 - 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // 18 19 1A 1B 1C 1D 1E 1F - 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // 20 21 22 23 24 25 26 27 - 0x01 | 0x00 | 0x04 | 0x08 | 0x00 | 0x00 | 0x00 | 0x00, - // 28 29 2A 2B 2C 2D 2E 2F - 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 30 31 32 33 34 35 36 37 - 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 38 39 3A 3B 3C 3D 3E 3F - 0x00 | 0x00 | 0x00 | 0x00 | 0x10 | 0x00 | 0x40 | 0x00, - // 40 41 42 43 44 45 46 47 - 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 48 49 4A 4B 4C 4D 4E 4F - 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 50 51 52 53 54 55 56 57 - 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 58 59 5A 5B 5C 5D 5E 5F - 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 60 61 62 63 64 65 66 67 - 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 68 69 6A 6B 6C 6D 6E 6F - 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 70 71 72 73 74 75 76 77 - 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 78 79 7A 7B 7C 7D 7E 7F - 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x80, + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80}; + +constexpr uint8_t SPECIAL_QUERY_PERCENT_ENCODE[32] = { + // 00 01 02 03 04 05 06 07 + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // 08 09 0A 0B 0C 0D 0E 0F + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // 10 11 12 13 14 15 16 17 + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // 18 19 1A 1B 1C 1D 1E 1F + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // 20 21 22 23 24 25 26 27 + 0x01 | 0x00 | 0x04 | 0x08 | 0x00 | 0x00 | 0x00 | 0x80, + // 28 29 2A 2B 2C 2D 2E 2F + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 30 31 32 33 34 35 36 37 + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 38 39 3A 3B 3C 3D 3E 3F + 0x00 | 0x00 | 0x00 | 0x00 | 0x10 | 0x00 | 0x40 | 0x00, + // 40 41 42 43 44 45 46 47 + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 48 49 4A 4B 4C 4D 4E 4F + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 50 51 52 53 54 55 56 57 + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 58 59 5A 5B 5C 5D 5E 5F + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 60 61 62 63 64 65 66 67 + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 68 69 6A 6B 6C 6D 6E 6F + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 70 71 72 73 74 75 76 77 + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 78 79 7A 7B 7C 7D 7E 7F + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x80, // 80 81 82 83 84 85 86 87 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, // 88 89 8A 8B 8C 8D 8E 8F @@ -503,42 +634,41 @@ namespace ada::character_sets { // F0 F1 F2 F3 F4 F5 F6 F7 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, // F8 F9 FA FB FC FD FE FF - 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80 - }; - - constexpr uint8_t FRAGMENT_PERCENT_ENCODE[32] = { - // 00 01 02 03 04 05 06 07 - 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // 08 09 0A 0B 0C 0D 0E 0F - 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // 10 11 12 13 14 15 16 17 - 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // 18 19 1A 1B 1C 1D 1E 1F - 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // 20 21 22 23 24 25 26 27 - 0x01 | 0x00 | 0x04 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 28 29 2A 2B 2C 2D 2E 2F - 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 30 31 32 33 34 35 36 37 - 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 38 39 3A 3B 3C 3D 3E 3F - 0x00 | 0x00 | 0x00 | 0x00 | 0x10 | 0x00 | 0x40 | 0x00, - // 40 41 42 43 44 45 46 47 - 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 48 49 4A 4B 4C 4D 4E 4F - 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 50 51 52 53 54 55 56 57 - 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 58 59 5A 5B 5C 5D 5E 5F - 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 60 61 62 63 64 65 66 67 - 0x01 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 68 69 6A 6B 6C 6D 6E 6F - 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 70 71 72 73 74 75 76 77 - 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 78 79 7A 7B 7C 7D 7E 7F - 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x80, + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80}; + +constexpr uint8_t QUERY_PERCENT_ENCODE[32] = { + // 00 01 02 03 04 05 06 07 + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // 08 09 0A 0B 0C 0D 0E 0F + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // 10 11 12 13 14 15 16 17 + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // 18 19 1A 1B 1C 1D 1E 1F + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // 20 21 22 23 24 25 26 27 + 0x01 | 0x00 | 0x04 | 0x08 | 0x00 | 0x00 | 0x00 | 0x00, + // 28 29 2A 2B 2C 2D 2E 2F + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 30 31 32 33 34 35 36 37 + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 38 39 3A 3B 3C 3D 3E 3F + 0x00 | 0x00 | 0x00 | 0x00 | 0x10 | 0x00 | 0x40 | 0x00, + // 40 41 42 43 44 45 46 47 + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 48 49 4A 4B 4C 4D 4E 4F + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 50 51 52 53 54 55 56 57 + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 58 59 5A 5B 5C 5D 5E 5F + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 60 61 62 63 64 65 66 67 + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 68 69 6A 6B 6C 6D 6E 6F + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 70 71 72 73 74 75 76 77 + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 78 79 7A 7B 7C 7D 7E 7F + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x80, // 80 81 82 83 84 85 86 87 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, // 88 89 8A 8B 8C 8D 8E 8F @@ -570,42 +700,41 @@ namespace ada::character_sets { // F0 F1 F2 F3 F4 F5 F6 F7 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, // F8 F9 FA FB FC FD FE FF - 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80 - }; - - constexpr uint8_t USERINFO_PERCENT_ENCODE[32] = { - // 00 01 02 03 04 05 06 07 - 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // 08 09 0A 0B 0C 0D 0E 0F - 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // 10 11 12 13 14 15 16 17 - 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // 18 19 1A 1B 1C 1D 1E 1F - 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // 20 21 22 23 24 25 26 27 - 0x01 | 0x00 | 0x04 | 0x08 | 0x00 | 0x00 | 0x00 | 0x00, - // 28 29 2A 2B 2C 2D 2E 2F - 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x80, - // 30 31 32 33 34 35 36 37 - 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 38 39 3A 3B 3C 3D 3E 3F - 0x00 | 0x00 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // 40 41 42 43 44 45 46 47 - 0x01 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 48 49 4A 4B 4C 4D 4E 4F - 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 50 51 52 53 54 55 56 57 - 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 58 59 5A 5B 5C 5D 5E 5F - 0x00 | 0x00 | 0x00 | 0x08 | 0x10 | 0x20 | 0x40 | 0x00, - // 60 61 62 63 64 65 66 67 - 0x01 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 68 69 6A 6B 6C 6D 6E 6F - 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 70 71 72 73 74 75 76 77 - 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 78 79 7A 7B 7C 7D 7E 7F - 0x00 | 0x00 | 0x00 | 0x08 | 0x10 | 0x20 | 0x00 | 0x80, + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80}; + +constexpr uint8_t FRAGMENT_PERCENT_ENCODE[32] = { + // 00 01 02 03 04 05 06 07 + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // 08 09 0A 0B 0C 0D 0E 0F + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // 10 11 12 13 14 15 16 17 + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // 18 19 1A 1B 1C 1D 1E 1F + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // 20 21 22 23 24 25 26 27 + 0x01 | 0x00 | 0x04 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 28 29 2A 2B 2C 2D 2E 2F + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 30 31 32 33 34 35 36 37 + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 38 39 3A 3B 3C 3D 3E 3F + 0x00 | 0x00 | 0x00 | 0x00 | 0x10 | 0x00 | 0x40 | 0x00, + // 40 41 42 43 44 45 46 47 + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 48 49 4A 4B 4C 4D 4E 4F + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 50 51 52 53 54 55 56 57 + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 58 59 5A 5B 5C 5D 5E 5F + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 60 61 62 63 64 65 66 67 + 0x01 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 68 69 6A 6B 6C 6D 6E 6F + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 70 71 72 73 74 75 76 77 + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 78 79 7A 7B 7C 7D 7E 7F + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x80, // 80 81 82 83 84 85 86 87 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, // 88 89 8A 8B 8C 8D 8E 8F @@ -637,42 +766,41 @@ namespace ada::character_sets { // F0 F1 F2 F3 F4 F5 F6 F7 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, // F8 F9 FA FB FC FD FE FF - 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80 - }; - - constexpr uint8_t PATH_PERCENT_ENCODE[32] = { - // 00 01 02 03 04 05 06 07 - 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // 08 09 0A 0B 0C 0D 0E 0F - 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // 10 11 12 13 14 15 16 17 - 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // 18 19 1A 1B 1C 1D 1E 1F - 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // 20 21 22 23 24 25 26 27 - 0x01 | 0x00 | 0x04 | 0x08 | 0x00 | 0x00 | 0x00 | 0x00, - // 28 29 2A 2B 2C 2D 2E 2F - 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 30 31 32 33 34 35 36 37 - 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 38 39 3A 3B 3C 3D 3E 3F - 0x00 | 0x00 | 0x00 | 0x00 | 0x10 | 0x00 | 0x40 | 0x80, - // 40 41 42 43 44 45 46 47 - 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 48 49 4A 4B 4C 4D 4E 4F - 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 50 51 52 53 54 55 56 57 - 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 58 59 5A 5B 5C 5D 5E 5F - 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 60 61 62 63 64 65 66 67 - 0x01 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 68 69 6A 6B 6C 6D 6E 6F - 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 70 71 72 73 74 75 76 77 - 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 78 79 7A 7B 7C 7D 7E 7F - 0x00 | 0x00 | 0x00 | 0x08 | 0x00 | 0x20 | 0x00 | 0x80, + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80}; + +constexpr uint8_t USERINFO_PERCENT_ENCODE[32] = { + // 00 01 02 03 04 05 06 07 + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // 08 09 0A 0B 0C 0D 0E 0F + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // 10 11 12 13 14 15 16 17 + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // 18 19 1A 1B 1C 1D 1E 1F + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // 20 21 22 23 24 25 26 27 + 0x01 | 0x00 | 0x04 | 0x08 | 0x00 | 0x00 | 0x00 | 0x00, + // 28 29 2A 2B 2C 2D 2E 2F + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x80, + // 30 31 32 33 34 35 36 37 + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 38 39 3A 3B 3C 3D 3E 3F + 0x00 | 0x00 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // 40 41 42 43 44 45 46 47 + 0x01 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 48 49 4A 4B 4C 4D 4E 4F + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 50 51 52 53 54 55 56 57 + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 58 59 5A 5B 5C 5D 5E 5F + 0x00 | 0x00 | 0x00 | 0x08 | 0x10 | 0x20 | 0x40 | 0x00, + // 60 61 62 63 64 65 66 67 + 0x01 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 68 69 6A 6B 6C 6D 6E 6F + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 70 71 72 73 74 75 76 77 + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 78 79 7A 7B 7C 7D 7E 7F + 0x00 | 0x00 | 0x00 | 0x08 | 0x10 | 0x20 | 0x00 | 0x80, // 80 81 82 83 84 85 86 87 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, // 88 89 8A 8B 8C 8D 8E 8F @@ -704,18 +832,82 @@ namespace ada::character_sets { // F0 F1 F2 F3 F4 F5 F6 F7 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, // F8 F9 FA FB FC FD FE FF - 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80 - }; + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80}; - ada_really_inline bool bit_at(const uint8_t a[], const uint8_t i) { - return !!(a[i >> 3] & (1 << (i & 7))); - } +constexpr uint8_t PATH_PERCENT_ENCODE[32] = { + // 00 01 02 03 04 05 06 07 + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // 08 09 0A 0B 0C 0D 0E 0F + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // 10 11 12 13 14 15 16 17 + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // 18 19 1A 1B 1C 1D 1E 1F + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // 20 21 22 23 24 25 26 27 + 0x01 | 0x00 | 0x04 | 0x08 | 0x00 | 0x00 | 0x00 | 0x00, + // 28 29 2A 2B 2C 2D 2E 2F + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 30 31 32 33 34 35 36 37 + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 38 39 3A 3B 3C 3D 3E 3F + 0x00 | 0x00 | 0x00 | 0x00 | 0x10 | 0x00 | 0x40 | 0x80, + // 40 41 42 43 44 45 46 47 + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 48 49 4A 4B 4C 4D 4E 4F + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 50 51 52 53 54 55 56 57 + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 58 59 5A 5B 5C 5D 5E 5F + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 60 61 62 63 64 65 66 67 + 0x01 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 68 69 6A 6B 6C 6D 6E 6F + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 70 71 72 73 74 75 76 77 + 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, + // 78 79 7A 7B 7C 7D 7E 7F + 0x00 | 0x00 | 0x00 | 0x08 | 0x00 | 0x20 | 0x00 | 0x80, + // 80 81 82 83 84 85 86 87 + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // 88 89 8A 8B 8C 8D 8E 8F + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // 90 91 92 93 94 95 96 97 + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // 98 99 9A 9B 9C 9D 9E 9F + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // A0 A1 A2 A3 A4 A5 A6 A7 + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // A8 A9 AA AB AC AD AE AF + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // B0 B1 B2 B3 B4 B5 B6 B7 + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // B8 B9 BA BB BC BD BE BF + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // C0 C1 C2 C3 C4 C5 C6 C7 + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // C8 C9 CA CB CC CD CE CF + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // D0 D1 D2 D3 D4 D5 D6 D7 + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // D8 D9 DA DB DC DD DE DF + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // E0 E1 E2 E3 E4 E5 E6 E7 + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // E8 E9 EA EB EC ED EE EF + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // F0 F1 F2 F3 F4 F5 F6 F7 + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, + // F8 F9 FA FB FC FD FE FF + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80}; -} // namespace ada::character_sets +ada_really_inline bool bit_at(const uint8_t a[], const uint8_t i) { + return !!(a[i >> 3] & (1 << (i & 7))); +} + +} // namespace ada::character_sets -#endif // ADA_CHARACTER_SETS_H +#endif // ADA_CHARACTER_SETS_H /* end file include/ada/character_sets-inl.h */ -// dofile: invoked with prepath=/Users/dlemire/CVS/github/ada/include, filename=ada/checkers-inl.h /* begin file include/ada/checkers-inl.h */ /** * @file checkers-inl.h @@ -730,47 +922,58 @@ namespace ada::character_sets { namespace ada::checkers { - inline bool has_hex_prefix_unsafe(std::string_view input) { - // This is actualy efficient code, see has_hex_prefix for the assembly. - uint32_t value_one = 1; - bool is_little_endian = (reinterpret_cast(&value_one)[0] == 1); - uint16_t word0x{}; - std::memcpy(&word0x, "0x", 2); // we would use bit_cast in C++20 and the function could be constexpr. - uint16_t two_first_bytes{}; - std::memcpy(&two_first_bytes, input.data(),2); - if(is_little_endian) { two_first_bytes |= 0x2000; } else { two_first_bytes |= 0x020; } - return two_first_bytes == word0x; - } +inline bool has_hex_prefix_unsafe(std::string_view input) { + // This is actualy efficient code, see has_hex_prefix for the assembly. + uint32_t value_one = 1; + bool is_little_endian = (reinterpret_cast(&value_one)[0] == 1); + uint16_t word0x{}; + std::memcpy(&word0x, "0x", 2); // we would use bit_cast in C++20 and the + // function could be constexpr. + uint16_t two_first_bytes{}; + std::memcpy(&two_first_bytes, input.data(), 2); + if (is_little_endian) { + two_first_bytes |= 0x2000; + } else { + two_first_bytes |= 0x020; + } + return two_first_bytes == word0x; +} - inline bool has_hex_prefix(std::string_view input) { - return input.size() >=2 && has_hex_prefix_unsafe(input); - } +inline bool has_hex_prefix(std::string_view input) { + return input.size() >= 2 && has_hex_prefix_unsafe(input); +} - constexpr bool is_digit(char x) noexcept { return (x >= '0') & (x <= '9'); } +constexpr bool is_digit(char x) noexcept { return (x >= '0') & (x <= '9'); } - constexpr char to_lower(char x) noexcept { return (x | 0x20); } +constexpr char to_lower(char x) noexcept { return (x | 0x20); } - constexpr bool is_alpha(char x) noexcept { return (to_lower(x) >= 'a') && (to_lower(x) <= 'z'); } +constexpr bool is_alpha(char x) noexcept { + return (to_lower(x) >= 'a') && (to_lower(x) <= 'z'); +} - inline constexpr bool is_windows_drive_letter(std::string_view input) noexcept { - return input.size() >= 2 && (is_alpha(input[0]) && ((input[1] == ':') || (input[1] == '|'))) - && ((input.size() == 2) || (input[2] == '/' || input[2] == '\\' || input[2] == '?' || input[2] == '#')); - } +inline constexpr bool is_windows_drive_letter(std::string_view input) noexcept { + return input.size() >= 2 && + (is_alpha(input[0]) && ((input[1] == ':') || (input[1] == '|'))) && + ((input.size() == 2) || (input[2] == '/' || input[2] == '\\' || + input[2] == '?' || input[2] == '#')); +} - inline constexpr bool is_normalized_windows_drive_letter(std::string_view input) noexcept { - return input.size() >= 2 && (is_alpha(input[0]) && (input[1] == ':')); - } +inline constexpr bool is_normalized_windows_drive_letter( + std::string_view input) noexcept { + return input.size() >= 2 && (is_alpha(input[0]) && (input[1] == ':')); +} - ada_really_inline constexpr bool begins_with(std::string_view view, std::string_view prefix) { - // in C++20, you have view.begins_with(prefix) - return view.size() >= prefix.size() && (view.substr(0, prefix.size()) == prefix); - } +ada_really_inline constexpr bool begins_with(std::string_view view, + std::string_view prefix) { + // in C++20, you have view.begins_with(prefix) + return view.size() >= prefix.size() && + (view.substr(0, prefix.size()) == prefix); +} -} // namespace ada::checkers +} // namespace ada::checkers -#endif //ADA_CHECKERS_H +#endif // ADA_CHECKERS_H /* end file include/ada/checkers-inl.h */ -// dofile: invoked with prepath=/Users/dlemire/CVS/github/ada/include, filename=ada/log.h /* begin file include/ada/log.h */ /** * @file log.h @@ -795,33 +998,33 @@ namespace ada { template ada_really_inline void inner_log([[maybe_unused]] T t) { #if ADA_LOGGING - std::cout << t << std::endl; + std::cout << t << std::endl; #endif } - /** * Private function used for logging messages. * @private */ -template -ada_really_inline void inner_log([[maybe_unused]] T t, [[maybe_unused]] Args... args) { +template +ada_really_inline void inner_log([[maybe_unused]] T t, + [[maybe_unused]] Args... args) { #if ADA_LOGGING - std::cout << t; - inner_log(args...) ; + std::cout << t; + inner_log(args...); #endif } - /** * Log a message. * @private */ -template -ada_really_inline void log([[maybe_unused]] T t, [[maybe_unused]] Args... args) { +template +ada_really_inline void log([[maybe_unused]] T t, + [[maybe_unused]] Args... args) { #if ADA_LOGGING - std::cout << "ADA_LOG: " << t; - inner_log(args...) ; + std::cout << "ADA_LOG: " << t; + inner_log(args...); #endif } @@ -829,29 +1032,28 @@ ada_really_inline void log([[maybe_unused]] T t, [[maybe_unused]] Args... args) * Log a message. * @private */ -template +template ada_really_inline void log([[maybe_unused]] T t) { #if ADA_LOGGING - std::cout << "ADA_LOG: " << t << std::endl; + std::cout << "ADA_LOG: " << t << std::endl; #endif - -} } +} // namespace ada #if ADA_LOGGING #ifndef ada_log -#define ada_log(...) do { \ +#define ada_log(...) \ + do { \ ada::log(__VA_ARGS__); \ -} while(0) -#endif // ada_log + } while (0) +#endif // ada_log #else #define ada_log(...) -#endif // ADA_LOGGING +#endif // ADA_LOGGING -#endif // ADA_LOG_H +#endif // ADA_LOG_H /* end file include/ada/log.h */ -// dofile: invoked with prepath=/Users/dlemire/CVS/github/ada/include, filename=ada/encoding_type.h /* begin file include/ada/encoding_type.h */ /** * @file encoding_type.h @@ -864,28 +1066,27 @@ ada_really_inline void log([[maybe_unused]] T t) { namespace ada { - /** - * This specification defines three encodings with the same names as encoding schemes defined - * in the Unicode standard: UTF-8, UTF-16LE, and UTF-16BE. - * - * @see https://encoding.spec.whatwg.org/#encodings - */ - enum class encoding_type { - UTF8, - UTF_16LE, - UTF_16BE, - }; +/** + * This specification defines three encodings with the same names as encoding + * schemes defined in the Unicode standard: UTF-8, UTF-16LE, and UTF-16BE. + * + * @see https://encoding.spec.whatwg.org/#encodings + */ +enum class encoding_type { + UTF8, + UTF_16LE, + UTF_16BE, +}; - /** - * Convert a encoding_type to string. - */ - ada_warn_unused std::string to_string(encoding_type type); +/** + * Convert a encoding_type to string. + */ +ada_warn_unused std::string to_string(encoding_type type); -} // ada namespace +} // namespace ada -#endif // ADA_ENCODING_TYPE_H +#endif // ADA_ENCODING_TYPE_H /* end file include/ada/encoding_type.h */ -// dofile: invoked with prepath=/Users/dlemire/CVS/github/ada/include, filename=ada/helpers.h /* begin file include/ada/helpers.h */ /** * @file helpers.h @@ -894,7 +1095,6 @@ namespace ada { #ifndef ADA_HELPERS_H #define ADA_HELPERS_H -// dofile: invoked with prepath=/Users/dlemire/CVS/github/ada/include, filename=ada/url.h /* begin file include/ada/url.h */ /** * @file url.h @@ -903,7 +1103,6 @@ namespace ada { #ifndef ADA_URL_H #define ADA_URL_H -// dofile: invoked with prepath=/Users/dlemire/CVS/github/ada/include, filename=ada/checkers.h /* begin file include/ada/checkers.h */ /** * @file checkers.h @@ -922,85 +1121,96 @@ namespace ada { */ namespace ada::checkers { - /** - * Assuming that x is an ASCII letter, this function returns the lower case equivalent. - * @details More likely to be inlined by the compiler and constexpr. - */ - constexpr char to_lower(char x) noexcept; +/** + * Assuming that x is an ASCII letter, this function returns the lower case + * equivalent. + * @details More likely to be inlined by the compiler and constexpr. + */ +constexpr char to_lower(char x) noexcept; - /** - * Returns true if the character is an ASCII letter. Equivalent to std::isalpha but - * more likely to be inlined by the compiler. - * - * @attention std::isalpha is not constexpr generally. - */ - constexpr bool is_alpha(char x) noexcept; +/** + * Returns true if the character is an ASCII letter. Equivalent to std::isalpha + * but more likely to be inlined by the compiler. + * + * @attention std::isalpha is not constexpr generally. + */ +constexpr bool is_alpha(char x) noexcept; - /** - * Check whether a string starts with 0x or 0X. The function is only - * safe if input.size() >=2. - * - * @see has_hex_prefix - */ - inline bool has_hex_prefix_unsafe(std::string_view input); - /** - * Check whether a string starts with 0x or 0X. - */ - inline bool has_hex_prefix(std::string_view input); +/** + * Check whether a string starts with 0x or 0X. The function is only + * safe if input.size() >=2. + * + * @see has_hex_prefix + */ +inline bool has_hex_prefix_unsafe(std::string_view input); +/** + * Check whether a string starts with 0x or 0X. + */ +inline bool has_hex_prefix(std::string_view input); - /** - * Check whether x is an ASCII digit. More likely to be inlined than std::isdigit. - */ - constexpr bool is_digit(char x) noexcept; +/** + * Check whether x is an ASCII digit. More likely to be inlined than + * std::isdigit. + */ +constexpr bool is_digit(char x) noexcept; - /** - * @details A string starts with a Windows drive letter if all of the following are true: - * - * - its length is greater than or equal to 2 - * - its first two code points are a Windows drive letter - * - its length is 2 or its third code point is U+002F (/), U+005C (\), U+003F (?), or U+0023 (#). - * - * https://url.spec.whatwg.org/#start-with-a-windows-drive-letter - */ - inline constexpr bool is_windows_drive_letter(std::string_view input) noexcept; +/** + * @details A string starts with a Windows drive letter if all of the following + * are true: + * + * - its length is greater than or equal to 2 + * - its first two code points are a Windows drive letter + * - its length is 2 or its third code point is U+002F (/), U+005C (\), U+003F + * (?), or U+0023 (#). + * + * https://url.spec.whatwg.org/#start-with-a-windows-drive-letter + */ +inline constexpr bool is_windows_drive_letter(std::string_view input) noexcept; - /** - * @details A normalized Windows drive letter is a Windows drive letter of which the second code point is U+003A (:). - */ - inline constexpr bool is_normalized_windows_drive_letter(std::string_view input) noexcept; +/** + * @details A normalized Windows drive letter is a Windows drive letter of which + * the second code point is U+003A (:). + */ +inline constexpr bool is_normalized_windows_drive_letter( + std::string_view input) noexcept; - /** - * @warning Will be removed when Ada supports C++20. - */ - ada_really_inline constexpr bool begins_with(std::string_view view, std::string_view prefix); +/** + * @warning Will be removed when Ada supports C++20. + */ +ada_really_inline constexpr bool begins_with(std::string_view view, + std::string_view prefix); - /** - * Returns true if an input is an ipv4 address. - */ - ada_really_inline ada_constexpr bool is_ipv4(std::string_view view) noexcept; +/** + * Returns true if an input is an ipv4 address. + */ +ada_really_inline ada_constexpr bool is_ipv4(std::string_view view) noexcept; - /** - * Returns a bitset. If the first bit is set, then at least one character needs - * percent encoding. If the second bit is set, a \\ is found. If the third bit is set - * then we have a dot. If the fourth bit is set, then we have a percent character. - */ - ada_really_inline constexpr uint8_t path_signature(std::string_view input) noexcept; +/** + * Returns a bitset. If the first bit is set, then at least one character needs + * percent encoding. If the second bit is set, a \\ is found. If the third bit + * is set then we have a dot. If the fourth bit is set, then we have a percent + * character. + */ +ada_really_inline constexpr uint8_t path_signature( + std::string_view input) noexcept; - /** - * Returns true if the length of the domain name and its labels are according to the specifications. - * The length of the domain must be 255 octets (253 characters not including the last 2 which are the empty - * label reserved at the end). When the empty label is included (a dot at the end), the domain name can have - * 254 characters. The length of a label must be at least 1 and at most 63 characters. - * @see section 3.1. of https://www.rfc-editor.org/rfc/rfc1034 - * @see https://www.unicode.org/reports/tr46/#ToASCII - */ - ada_really_inline constexpr bool verify_dns_length(std::string_view input) noexcept; +/** + * Returns true if the length of the domain name and its labels are according to + * the specifications. The length of the domain must be 255 octets (253 + * characters not including the last 2 which are the empty label reserved at the + * end). When the empty label is included (a dot at the end), the domain name + * can have 254 characters. The length of a label must be at least 1 and at most + * 63 characters. + * @see section 3.1. of https://www.rfc-editor.org/rfc/rfc1034 + * @see https://www.unicode.org/reports/tr46/#ToASCII + */ +ada_really_inline constexpr bool verify_dns_length( + std::string_view input) noexcept; -} // namespace ada::checkers +} // namespace ada::checkers -#endif //ADA_CHECKERS_H +#endif // ADA_CHECKERS_H /* end file include/ada/checkers.h */ -// dofile: invoked with prepath=/Users/dlemire/CVS/github/ada/include, filename=ada/scheme.h /* begin file include/ada/scheme.h */ /** * @file scheme.h @@ -1020,59 +1230,65 @@ namespace ada::checkers { */ namespace ada::scheme { - /** - * Type of the scheme as an enum. - * Using strings to represent a scheme type is not ideal because - * checking for types involves string comparisons. It is faster to use - * a simple integer. - */ - enum type { - HTTP = 0, - NOT_SPECIAL = 1, - HTTPS = 2, - WS = 3, - FTP = 4, - WSS = 5, - FILE = 6 - }; - - /** - * A special scheme is an ASCII string that is listed in the first column of the following table. - * The default port for a special scheme is listed in the second column on the same row. - * The default port for any other ASCII string is null. - * - * @see https://url.spec.whatwg.org/#url-miscellaneous - * @param scheme - * @return If scheme is a special scheme - */ - ada_really_inline constexpr bool is_special(std::string_view scheme); +/** + * Type of the scheme as an enum. + * Using strings to represent a scheme type is not ideal because + * checking for types involves string comparisons. It is faster to use + * a simple integer. + * In C++11, we are allowed to specify the underlying type of the enum. + * We pick an 8-bit integer (which allows up to 256 types). Specifying the + * type of the enum may help integration with other systems if the type + * variable is exposed (since its value will not depend on the compiler). + */ +enum type : uint8_t { + HTTP = 0, + NOT_SPECIAL = 1, + HTTPS = 2, + WS = 3, + FTP = 4, + WSS = 5, + FILE = 6 +}; - /** - * A special scheme is an ASCII string that is listed in the first column of the following table. - * The default port for a special scheme is listed in the second column on the same row. - * The default port for any other ASCII string is null. - * - * @see https://url.spec.whatwg.org/#url-miscellaneous - * @param scheme - * @return The special port - */ - constexpr uint16_t get_special_port(std::string_view scheme) noexcept; +/** + * A special scheme is an ASCII string that is listed in the first column of the + * following table. The default port for a special scheme is listed in the + * second column on the same row. The default port for any other ASCII string is + * null. + * + * @see https://url.spec.whatwg.org/#url-miscellaneous + * @param scheme + * @return If scheme is a special scheme + */ +ada_really_inline constexpr bool is_special(std::string_view scheme); - /** - * Returns the port number of a special scheme. - * @see https://url.spec.whatwg.org/#special-scheme - */ - constexpr uint16_t get_special_port(ada::scheme::type type) noexcept; - /** - * Returns the scheme of an input, or NOT_SPECIAL if it's not a special scheme defined by the spec. - */ - constexpr ada::scheme::type get_scheme_type(std::string_view scheme) noexcept; +/** + * A special scheme is an ASCII string that is listed in the first column of the + * following table. The default port for a special scheme is listed in the + * second column on the same row. The default port for any other ASCII string is + * null. + * + * @see https://url.spec.whatwg.org/#url-miscellaneous + * @param scheme + * @return The special port + */ +constexpr uint16_t get_special_port(std::string_view scheme) noexcept; -} // namespace ada::serializers +/** + * Returns the port number of a special scheme. + * @see https://url.spec.whatwg.org/#special-scheme + */ +constexpr uint16_t get_special_port(ada::scheme::type type) noexcept; +/** + * Returns the scheme of an input, or NOT_SPECIAL if it's not a special scheme + * defined by the spec. + */ +constexpr ada::scheme::type get_scheme_type(std::string_view scheme) noexcept; -#endif // ADA_SCHEME_H +} // namespace ada::scheme + +#endif // ADA_SCHEME_H /* end file include/ada/scheme.h */ -// dofile: invoked with prepath=/Users/dlemire/CVS/github/ada/include, filename=ada/serializers.h /* begin file include/ada/serializers.h */ /** * @file serializers.h @@ -1092,30 +1308,33 @@ namespace ada::scheme { */ namespace ada::serializers { - /** - * Finds and returns the longest sequence of 0 values in a ipv6 input. - */ - void find_longest_sequence_of_ipv6_pieces(const std::array& address, size_t& compress, size_t& compress_length) noexcept; +/** + * Finds and returns the longest sequence of 0 values in a ipv6 input. + */ +void find_longest_sequence_of_ipv6_pieces( + const std::array& address, size_t& compress, + size_t& compress_length) noexcept; - /** - * Serializes an ipv6 address. - * @details An IPv6 address is a 128-bit unsigned integer that identifies a network address. - * @see https://url.spec.whatwg.org/#concept-ipv6-serializer - */ - std::string ipv6(const std::array& address) noexcept; +/** + * Serializes an ipv6 address. + * @details An IPv6 address is a 128-bit unsigned integer that identifies a + * network address. + * @see https://url.spec.whatwg.org/#concept-ipv6-serializer + */ +std::string ipv6(const std::array& address) noexcept; - /** - * Serializes an ipv4 address. - * @details An IPv4 address is a 32-bit unsigned integer that identifies a network address. - * @see https://url.spec.whatwg.org/#concept-ipv4-serializer - */ - std::string ipv4(const uint64_t address) noexcept; +/** + * Serializes an ipv4 address. + * @details An IPv4 address is a 32-bit unsigned integer that identifies a + * network address. + * @see https://url.spec.whatwg.org/#concept-ipv4-serializer + */ +std::string ipv4(const uint64_t address) noexcept; -} // namespace ada::serializers +} // namespace ada::serializers -#endif // ADA_SERIALIZERS_H +#endif // ADA_SERIALIZERS_H /* end file include/ada/serializers.h */ -// dofile: invoked with prepath=/Users/dlemire/CVS/github/ada/include, filename=ada/unicode.h /* begin file include/ada/unicode.h */ /** * @file unicode.h @@ -1124,6 +1343,7 @@ namespace ada::serializers { #ifndef ADA_UNICODE_H #define ADA_UNICODE_H + #include #include @@ -1133,3228 +1353,5148 @@ namespace ada::serializers { */ namespace ada::unicode { - /** - * We receive a UTF-8 string representing a domain name. - * If the string is percent encoded, we apply percent decoding. - * - * Given a domain, we need to identify its labels. - * They are separated by label-separators: - * - * U+002E ( . ) FULL STOP - * U+FF0E ( . ) FULLWIDTH FULL STOP - * U+3002 ( 。 ) IDEOGRAPHIC FULL STOP - * U+FF61 ( 。 ) HALFWIDTH IDEOGRAPHIC FULL STOP - * - * They are all mapped to U+002E. - * - * We process each label into a string that should not exceed 63 octets. - * If the string is already punycode (starts with "xn--"), then we must - * scan it to look for unallowed code points. - * Otherwise, if the string is not pure ASCII, we need to transcode it - * to punycode by following RFC 3454 which requires us to - * - Map characters (see section 3), - * - Normalize (see section 4), - * - Reject forbidden characters, - * - Check for right-to-left characters and if so, check all requirements (see section 6), - * - Optionally reject based on unassigned code points (section 7). - * - * The Unicode standard provides a table of code points with a mapping, a list of - * forbidden code points and so forth. This table is subject to change and will - * vary based on the implementation. For Unicode 15, the table is at - * https://www.unicode.org/Public/idna/15.0.0/IdnaMappingTable.txt - * If you use ICU, they parse this table and map it to code using a Python script. - * - * The resulting strings should not exceed 255 octets according to RFC 1035 section 2.3.4. - * ICU checks for label size and domain size, but if we pass "be_strict = false", these - * errors are ignored. - * - * @see https://url.spec.whatwg.org/#concept-domain-to-ascii - * - */ - bool to_ascii(std::optional& out, std::string_view plain, bool be_strict, size_t first_percent); +/** + * We receive a UTF-8 string representing a domain name. + * If the string is percent encoded, we apply percent decoding. + * + * Given a domain, we need to identify its labels. + * They are separated by label-separators: + * + * U+002E ( . ) FULL STOP + * U+FF0E ( . ) FULLWIDTH FULL STOP + * U+3002 ( 。 ) IDEOGRAPHIC FULL STOP + * U+FF61 ( 。 ) HALFWIDTH IDEOGRAPHIC FULL STOP + * + * They are all mapped to U+002E. + * + * We process each label into a string that should not exceed 63 octets. + * If the string is already punycode (starts with "xn--"), then we must + * scan it to look for unallowed code points. + * Otherwise, if the string is not pure ASCII, we need to transcode it + * to punycode by following RFC 3454 which requires us to + * - Map characters (see section 3), + * - Normalize (see section 4), + * - Reject forbidden characters, + * - Check for right-to-left characters and if so, check all requirements (see + * section 6), + * - Optionally reject based on unassigned code points (section 7). + * + * The Unicode standard provides a table of code points with a mapping, a list + * of forbidden code points and so forth. This table is subject to change and + * will vary based on the implementation. For Unicode 15, the table is at + * https://www.unicode.org/Public/idna/15.0.0/IdnaMappingTable.txt + * If you use ICU, they parse this table and map it to code using a Python + * script. + * + * The resulting strings should not exceed 255 octets according to RFC 1035 + * section 2.3.4. ICU checks for label size and domain size, but these errors + * are ignored. + * + * @see https://url.spec.whatwg.org/#concept-domain-to-ascii + * + */ +bool to_ascii(std::optional& out, std::string_view plain, + size_t first_percent); - /** - * Checks if the input has tab or newline characters. - * - * @attention The has_tabs_or_newline function is a bottleneck and it is simple enough that compilers - * like GCC can 'autovectorize it'. - */ - ada_really_inline constexpr bool has_tabs_or_newline(std::string_view user_input) noexcept; +/** + * @see https://www.unicode.org/reports/tr46/#ToUnicode + */ +std::string to_unicode(std::string_view input); - /** - * Checks if the input is a forbidden host code point. - * @see https://url.spec.whatwg.org/#forbidden-host-code-point - */ - ada_really_inline constexpr bool is_forbidden_host_code_point(const char c) noexcept; +/** + * Checks if the input has tab or newline characters. + * + * @attention The has_tabs_or_newline function is a bottleneck and it is simple + * enough that compilers like GCC can 'autovectorize it'. + */ +ada_really_inline constexpr bool has_tabs_or_newline( + std::string_view user_input) noexcept; + +/** + * Checks if the input is a forbidden host code point. + * @see https://url.spec.whatwg.org/#forbidden-host-code-point + */ +ada_really_inline constexpr bool is_forbidden_host_code_point( + const char c) noexcept; +/** + * Checks if the input is a forbidden domain code point. + * @see https://url.spec.whatwg.org/#forbidden-domain-code-point + */ +ada_really_inline constexpr bool contains_forbidden_domain_code_point( + char* input, size_t length) noexcept; - /** - * Checks if the input is a forbidden domain code point. - * @see https://url.spec.whatwg.org/#forbidden-domain-code-point - */ - ada_really_inline constexpr bool contains_forbidden_domain_code_point(char * input, size_t length) noexcept; +/** + * Checks if the input is a forbidden doamin code point. + * @see https://url.spec.whatwg.org/#forbidden-domain-code-point + */ +ada_really_inline constexpr bool is_forbidden_domain_code_point( + const char c) noexcept; + +/** + * Checks if the input is alphanumeric, '+', '-' or '.' + */ +ada_really_inline constexpr bool is_alnum_plus(const char c) noexcept; + +/** + * @details An ASCII hex digit is an ASCII upper hex digit or ASCII lower hex + * digit. An ASCII upper hex digit is an ASCII digit or a code point in the + * range U+0041 (A) to U+0046 (F), inclusive. An ASCII lower hex digit is an + * ASCII digit or a code point in the range U+0061 (a) to U+0066 (f), inclusive. + */ +ada_really_inline constexpr bool is_ascii_hex_digit(const char c) noexcept; + +/** + * Checks if the input is a C0 control or space character. + * + * @details A C0 control or space is a C0 control or U+0020 SPACE. + * A C0 control is a code point in the range U+0000 NULL to U+001F INFORMATION + * SEPARATOR ONE, inclusive. + */ +ada_really_inline constexpr bool is_c0_control_or_space(const char c) noexcept; + +/** + * Checks if the input is a ASCII tab or newline character. + * + * @details An ASCII tab or newline is U+0009 TAB, U+000A LF, or U+000D CR. + */ +ada_really_inline constexpr bool is_ascii_tab_or_newline(const char c) noexcept; + +/** + * @details A double-dot path segment must be ".." or an ASCII case-insensitive + * match for ".%2e", "%2e.", or "%2e%2e". + */ +ada_really_inline ada_constexpr bool is_double_dot_path_segment( + const std::string_view input) noexcept; + +/** + * @details A single-dot path segment must be "." or an ASCII case-insensitive + * match for "%2e". + */ +ada_really_inline constexpr bool is_single_dot_path_segment( + const std::string_view input) noexcept; + +/** + * @details ipv4 character might contain 0-9 or a-f character ranges. + */ +ada_really_inline constexpr bool is_lowercase_hex(const char c) noexcept; + +/** + * @details Convert hex to binary. + */ +unsigned constexpr convert_hex_to_binary(char c) noexcept; + +/** + * first_percent should be = input.find('%') + * + * @todo It would be faster as noexcept maybe, but it could be unsafe since. + * @author Node.js + * @see https://github.com/nodejs/node/blob/main/src/node_url.cc#L245 + * @see https://encoding.spec.whatwg.org/#utf-8-decode-without-bom + */ +std::string percent_decode(const std::string_view input, size_t first_percent); + +/** + * Returns a percent-encoding string whether percent encoding was needed or not. + * @see https://github.com/nodejs/node/blob/main/src/node_url.cc#L226 + */ +std::string percent_encode(const std::string_view input, + const uint8_t character_set[]); +/** + * Returns a percent-encoded string version of input, while starting the percent + * encoding at the provided index. + * @see https://github.com/nodejs/node/blob/main/src/node_url.cc#L226 + */ +std::string percent_encode(const std::string_view input, + const uint8_t character_set[], size_t index); +/** + * Returns true if percent encoding was needed, in which case, we store + * the percent-encoded content in 'out'. If the boolean 'append' is set to + * true, the content is appended to 'out'. + * If percent encoding is not needed, out is left unchanged. + * @see https://github.com/nodejs/node/blob/main/src/node_url.cc#L226 + */ +template +bool percent_encode(const std::string_view input, const uint8_t character_set[], + std::string& out); +/** + * Returns the index at which percent encoding should start, or (equivalently), + * the length of the prefix that does not require percent encoding. + */ +ada_really_inline size_t percent_encode_index(const std::string_view input, + const uint8_t character_set[]); +/** + * Lowers the string in-place, assuming that the content is ASCII. + * Return true if the content was ASCII. + */ +constexpr bool to_lower_ascii(char* input, size_t length) noexcept; +} // namespace ada::unicode + +#endif // ADA_UNICODE_H +/* end file include/ada/unicode.h */ +/* begin file include/ada/url_base.h */ +/** + * @file url_base.h + * @brief Declaration for the basic URL definitions + */ +#ifndef ADA_URL_BASE_H +#define ADA_URL_BASE_H + +/* begin file include/ada/url_components.h */ +/** + * @file url_components.h + * @brief Declaration for the URL Components + */ +#ifndef ADA_URL_COMPONENTS_H +#define ADA_URL_COMPONENTS_H + + +#include +#include + +namespace ada { +/** + * @brief URL Component representations using offsets. + * + * @details We design the url_components struct so that it is as small + * and simple as possible. This version uses 32 bytes. + * + * This struct is used to extract components from a single 'href'. + */ +struct url_components { + constexpr static uint32_t omitted = uint32_t(-1); + + url_components() = default; + url_components(const url_components &u) = default; + url_components(url_components &&u) noexcept = default; + url_components &operator=(url_components &&u) noexcept = default; + url_components &operator=(const url_components &u) = default; + ~url_components() = default; + + /* + * By using 32-bit integers, we implicitly assume that the URL string + * cannot exceed 4 GB. + * + * https://user:pass@example.com:1234/foo/bar?baz#quux + * | | | | ^^^^| | | + * | | | | | | | `----- hash_start + * | | | | | | `--------- search_start + * | | | | | `----------------- pathname_start + * | | | | `--------------------- port + * | | | `----------------------- host_end + * | | `---------------------------------- host_start + * | `--------------------------------------- username_end + * `--------------------------------------------- protocol_end + */ + uint32_t protocol_end{0}; /** - * Checks if the input is a forbidden doamin code point. - * @see https://url.spec.whatwg.org/#forbidden-domain-code-point + * Username end is not `omitted` by default to make username and password + * getters less costly to implement. */ - ada_really_inline constexpr bool is_forbidden_domain_code_point(const char c) noexcept; + uint32_t username_end{0}; + uint32_t host_start{0}; + uint32_t host_end{0}; + uint32_t port{omitted}; + uint32_t pathname_start{0}; + uint32_t search_start{omitted}; + uint32_t hash_start{omitted}; /** - * Checks if the input is alphanumeric, '+', '-' or '.' + * Check the following conditions: + * protocol_end < username_end < ... < hash_start, + * expect when a value is omitted. It also computes + * a lower bound on the possible string length that may match these + * offsets. + * @return true if the offset values are + * consistent with a possible URL string */ - ada_really_inline constexpr bool is_alnum_plus(const char c) noexcept; + bool check_offset_consistency() const noexcept; /** - * @details An ASCII hex digit is an ASCII upper hex digit or ASCII lower hex digit. - * An ASCII upper hex digit is an ASCII digit or a code point in the range U+0041 (A) to U+0046 (F), inclusive. - * An ASCII lower hex digit is an ASCII digit or a code point in the range U+0061 (a) to U+0066 (f), inclusive. + * @private + * Converts a url_components to JSON stringified version. */ - ada_really_inline constexpr bool is_ascii_hex_digit(const char c) noexcept; + std::string to_string() const; + +}; // struct url_components + +} // namespace ada +#endif +/* end file include/ada/url_components.h */ + +#include + +namespace ada { + +/** + * @brief Base class of URL implementations + * + * @details A url_base contains a few attributes: is_valid, has_opaque_path and + * type. All non-trivial implementation details are in derived classes such as + * ada::url and ada::url_aggregator. + * + * It is an abstract class that cannot be instantiated directly. + */ +struct url_base { + virtual ~url_base() = default; /** - * Checks if the input is a C0 control or space character. - * - * @details A C0 control or space is a C0 control or U+0020 SPACE. - * A C0 control is a code point in the range U+0000 NULL to U+001F INFORMATION SEPARATOR ONE, inclusive. + * Used for returning the validity from the result of the URL parser. */ - ada_really_inline constexpr bool is_c0_control_or_space(const char c) noexcept; + bool is_valid{true}; /** - * Checks if the input is a ASCII tab or newline character. - * - * @details An ASCII tab or newline is U+0009 TAB, U+000A LF, or U+000D CR. + * A URL has an opaque path if its path is a string. */ - ada_really_inline constexpr bool is_ascii_tab_or_newline(const char c) noexcept; + bool has_opaque_path{false}; /** - * @details A double-dot path segment must be ".." or an ASCII case-insensitive match for ".%2e", "%2e.", or "%2e%2e". + * @private */ - ada_really_inline ada_constexpr bool is_double_dot_path_segment(const std::string_view input) noexcept; + ada::scheme::type type{ada::scheme::type::NOT_SPECIAL}; /** - * @details A single-dot path segment must be "." or an ASCII case-insensitive match for "%2e". + * A URL is special if its scheme is a special scheme. A URL is not special if + * its scheme is not a special scheme. */ - ada_really_inline constexpr bool is_single_dot_path_segment(const std::string_view input) noexcept; + [[nodiscard]] ada_really_inline bool is_special() const noexcept; /** - * @details ipv4 character might contain 0-9 or a-f character ranges. + * The origin getter steps are to return the serialization of this’s URL’s + * origin. [HTML] + * @return a newly allocated string. + * @see https://url.spec.whatwg.org/#concept-url-origin */ - ada_really_inline constexpr bool is_lowercase_hex(const char c) noexcept; + [[nodiscard]] virtual std::string get_origin() const noexcept = 0; /** - * @details Convert hex to binary. + * Returns true if this URL has a valid domain as per RFC 1034 and + * corresponding specifications. Among other things, it requires + * that the domain string has fewer than 255 octets. */ - unsigned constexpr convert_hex_to_binary(char c) noexcept; + [[nodiscard]] virtual bool has_valid_domain() const noexcept = 0; /** - * first_percent should be = input.find('%') + * @private * - * @todo It would be faster as noexcept maybe, but it could be unsafe since. - * @author Node.js - * @see https://github.com/nodejs/node/blob/main/src/node_url.cc#L245 - * @see https://encoding.spec.whatwg.org/#utf-8-decode-without-bom + * Return the 'special port' if the URL is special and not 'file'. + * Returns 0 otherwise. */ - std::string percent_decode(const std::string_view input, size_t first_percent); + [[nodiscard]] inline uint16_t get_special_port() const noexcept; /** - * Returns a percent-encoding string whether percent encoding was needed or not. - * @see https://github.com/nodejs/node/blob/main/src/node_url.cc#L226 + * @private + * + * Get the default port if the url's scheme has one, returns 0 otherwise. */ - std::string percent_encode(const std::string_view input, const uint8_t character_set[]); + [[nodiscard]] ada_really_inline uint16_t scheme_default_port() const noexcept; /** - * Returns true if percent encoding was needed, in which case, we store - * the percent-encoded content in 'out'. Otherwise, out is left unchanged. - * @see https://github.com/nodejs/node/blob/main/src/node_url.cc#L226 + * @private + * + * Parse a port (16-bit decimal digit) from the provided input. + * We assume that the input does not contain spaces or tabs + * within the ASCII digits. + * It returns how many bytes were consumed when a number is successfully + * parsed. + * @return On failure, it returns zero. + * @see https://url.spec.whatwg.org/#host-parsing */ - bool percent_encode(const std::string_view input, const uint8_t character_set[], std::string& out); + virtual ada_really_inline size_t parse_port( + std::string_view view, bool check_trailing_content = false) noexcept = 0; /** - * Lowers the string in-place, assuming that the content is ASCII. - * Return true if the content was ASCII. + * Returns a JSON string representation of this URL. */ - constexpr bool to_lower_ascii(char * input, size_t length) noexcept; -} // namespace ada::unicode + virtual std::string to_string() const = 0; -#endif // ADA_UNICODE_H -/* end file include/ada/unicode.h */ + /** @private */ + virtual inline void clear_base_pathname() = 0; + + /** @private */ + virtual inline void clear_base_search() = 0; + + /** @private */ + virtual inline bool base_fragment_has_value() const = 0; + + /** @private */ + virtual inline bool base_search_has_value() const = 0; + +}; // url_base + +} // namespace ada + +#endif +/* end file include/ada/url_base.h */ #include #include -#include #include +#include #include #include namespace ada { - /** - * @brief Generic URL struct. - * - * @details To disambiguate from a valid URL string it can also be referred to as a URL record. - * A URL is a struct that represents a universal identifier. - * @see https://url.spec.whatwg.org/#url-representation - */ - struct url { - url() = default; - url(const url &u) = default; - url(url &&u) noexcept = default; - url &operator=(url &&u) noexcept = default; - url &operator=(const url &u) = default; - ADA_ATTRIBUTE_NOINLINE ~url() = default; - - /** - * @private - * A URL’s username is an ASCII string identifying a username. It is initially the empty string. - */ - std::string username{}; - - /** - * @private - * A URL’s password is an ASCII string identifying a password. It is initially the empty string. - */ - std::string password{}; - - /** - * @private - * A URL’s host is null or a host. It is initially null. - */ - std::optional host{}; - - /** - * @private - * A URL’s port is either null or a 16-bit unsigned integer that identifies a networking port. It is initially null. - */ - std::optional port{}; - - /** - * @private - * A URL’s path is either an ASCII string or a list of zero or more ASCII strings, usually identifying a location. - */ - std::string path{}; - - /** - * @private - * A URL’s query is either null or an ASCII string. It is initially null. - */ - std::optional query{}; - - /** - * @private - * A URL’s fragment is either null or an ASCII string that can be used for further processing on the resource - * the URL’s other components identify. It is initially null. - */ - std::optional fragment{}; - - /** - * @see https://url.spec.whatwg.org/#dom-url-href - * @see https://url.spec.whatwg.org/#concept-url-serializer - */ - [[nodiscard]] std::string get_href() const noexcept; - - /** - * The origin getter steps are to return the serialization of this’s URL’s origin. [HTML] - * @see https://url.spec.whatwg.org/#concept-url-origin - */ - [[nodiscard]] std::string get_origin() const noexcept; - - /** - * The protocol getter steps are to return this’s URL’s scheme, followed by U+003A (:). - * @see https://url.spec.whatwg.org/#dom-url-protocol - */ - [[nodiscard]] std::string get_protocol() const noexcept; - - /** - * Return url’s host, serialized, followed by U+003A (:) and url’s port, serialized. - * @see https://url.spec.whatwg.org/#dom-url-host - */ - [[nodiscard]] std::string get_host() const noexcept; - - /** - * Return this’s URL’s host, serialized. - * @see https://url.spec.whatwg.org/#dom-url-hostname - */ - [[nodiscard]] std::string get_hostname() const noexcept; - - /** - * The pathname getter steps are to return the result of URL path serializing this’s URL. - * @see https://url.spec.whatwg.org/#dom-url-pathname - */ - [[nodiscard]] std::string get_pathname() const noexcept; - - /** - * Return U+003F (?), followed by this’s URL’s query. - * @see https://url.spec.whatwg.org/#dom-url-search - */ - [[nodiscard]] std::string get_search() const noexcept; - - /** - * The username getter steps are to return this’s URL’s username. - * @see https://url.spec.whatwg.org/#dom-url-username - */ - [[nodiscard]] std::string get_username() const noexcept; - - /** - * @return Returns true on successful operation. - * @see https://url.spec.whatwg.org/#dom-url-username - */ - bool set_username(const std::string_view input); - - /** - * @return Returns true on success. - * @see https://url.spec.whatwg.org/#dom-url-password - */ - bool set_password(const std::string_view input); - - /** - * @return Returns true on success. - * @see https://url.spec.whatwg.org/#dom-url-port - */ - bool set_port(const std::string_view input); - - /** - * This function always succeeds. - * @see https://url.spec.whatwg.org/#dom-url-hash - */ - void set_hash(const std::string_view input); - - /** - * This function always succeeds. - * @see https://url.spec.whatwg.org/#dom-url-search - */ - void set_search(const std::string_view input); - - /** - * @return Returns true on success. - * @see https://url.spec.whatwg.org/#dom-url-search - */ - bool set_pathname(const std::string_view input); - - /** - * @return Returns true on success. - * @see https://url.spec.whatwg.org/#dom-url-host - */ - bool set_host(const std::string_view input); - - /** - * @return Returns true on success. - * @see https://url.spec.whatwg.org/#dom-url-hostname - */ - bool set_hostname(const std::string_view input); - - /** - * @return Returns true on success. - * @see https://url.spec.whatwg.org/#dom-url-protocol - */ - bool set_protocol(const std::string_view input); - - /** - * @see https://url.spec.whatwg.org/#dom-url-href - */ - bool set_href(const std::string_view input); - - /** - * @private - * - * Sets the host or hostname according to override condition. - * Return true on success. - * @see https://url.spec.whatwg.org/#hostname-state - */ - bool set_host_or_hostname(std::string_view input, bool override_hostname); - - /** - * The password getter steps are to return this’s URL’s password. - * @see https://url.spec.whatwg.org/#dom-url-password - */ - [[nodiscard]] std::string get_password() const noexcept; - - /** - * Return this’s URL’s port, serialized. - * @see https://url.spec.whatwg.org/#dom-url-port - */ - [[nodiscard]] std::string get_port() const noexcept; - - /** - * Return U+0023 (#), followed by this’s URL’s fragment. - * @see https://url.spec.whatwg.org/#dom-url-hash - */ - [[nodiscard]] std::string get_hash() const noexcept; - - /** - * Returns true if this URL has a valid domain as per RFC 1034 and - * corresponding specifications. Among other things, it requires - * that the domain string has fewer than 255 octets. - */ - [[nodiscard]] bool has_valid_domain() const noexcept; - - /** - * Used for returning the validity from the result of the URL parser. - */ - bool is_valid{true}; - - /** - * A URL has an opaque path if its path is a string. - */ - bool has_opaque_path{false}; - - /** - * A URL includes credentials if its username or password is not the empty string. - */ - [[nodiscard]] ada_really_inline bool includes_credentials() const noexcept; - - /** - * A URL is special if its scheme is a special scheme. A URL is not special if its scheme is not a special scheme. - */ - [[nodiscard]] ada_really_inline bool is_special() const noexcept; - - /** - * @private - * - * Return the 'special port' if the URL is special and not 'file'. - * Returns 0 otherwise. - */ - [[nodiscard]] inline uint16_t get_special_port() const; - - /** - * @private - * - * Return the scheme type. Note that it is faster to do - * get_scheme_type() == ada::scheme::type::FILE than to do - * get_scheme() == "file", since the former is a direct integer comparison, - * while the other involves a (cheap) string test. - */ - [[nodiscard]] ada_really_inline ada::scheme::type get_scheme_type() const noexcept; - - /** - * @private - * - * Get the default port if the url's scheme has one, returns 0 otherwise. - */ - [[nodiscard]] ada_really_inline uint16_t scheme_default_port() const noexcept; - /** - * @private - * - * A URL cannot have a username/password/port if its host is null or the empty string, or its scheme is "file". - */ - [[nodiscard]] inline bool cannot_have_credentials_or_port() const; - - /** - * @private - * - * Parse a port (16-bit decimal digit) from the provided input. - * We assume that the input does not contain spaces or tabs - * within the ASCII digits. - * It returns how many bytes were consumed when a number is successfully parsed. - * @return On failure, it returns zero. - * @see https://url.spec.whatwg.org/#host-parsing - */ - ada_really_inline size_t parse_port(std::string_view view, bool check_trailing_content = false) noexcept; - - /** - * @private - * - * Return a string representing the scheme. Note that get_scheme_type() should often be used instead. - * @see https://url.spec.whatwg.org/#dom-url-protocol - */ - [[nodiscard]] inline std::string_view get_scheme() const noexcept; - /** - * Set the scheme for this URL. The provided scheme should be a valid - * scheme string, be lower-cased, not contain spaces or tabs. It should - * have no spurious trailing or leading content. - */ - inline void set_scheme(std::string&& new_scheme) noexcept; - - /** - * @private - * - * Take the scheme from another URL. The scheme string is moved from the - * provided url. - */ - inline void copy_scheme(ada::url&& u) noexcept; - - /** - * @private - * - * Take the scheme from another URL. The scheme string is copied from the - * provided url. - */ - inline void copy_scheme(const ada::url& u); - - /** - * @private - * - * Parse the host from the provided input. We assume that - * the input does not contain spaces or tabs. Control - * characters and spaces are not trimmed (they should have - * been removed if needed). - * Return true on success. - * @see https://url.spec.whatwg.org/#host-parsing - */ - [[nodiscard]] ada_really_inline bool parse_host(std::string_view input); - - /** - * @private - * - * Parse the path from the provided input. - * Return true on success. Control characters not - * trimmed from the ends (they should have - * been removed if needed). - * - * The input is expected to be UTF-8. - * - * @see https://url.spec.whatwg.org/ - */ - [[nodiscard]] ada_really_inline bool parse_path(const std::string_view input); - - /** - * @private - */ - template - [[nodiscard]] ada_really_inline bool parse_scheme(const std::string_view input); - - /** - * Returns a JSON string representation of this URL. - */ - std::string to_string() const; - - private: - - /** - * @private - * - * Return true on success. - * @see https://url.spec.whatwg.org/#concept-ipv4-parser - */ - [[nodiscard]] bool parse_ipv4(std::string_view input); - - /** - * @private - * - * Return true on success. - * @see https://url.spec.whatwg.org/#concept-ipv6-parser - */ - [[nodiscard]] bool parse_ipv6(std::string_view input); - - /** - * @private - * - * Return true on success. - * @see https://url.spec.whatwg.org/#concept-opaque-host-parser - */ - [[nodiscard]] bool parse_opaque_host(std::string_view input); - - /** - * @private - */ - ada::scheme::type type{ada::scheme::type::NOT_SPECIAL}; - - /** - * @private - * - * A URL’s scheme is an ASCII string that identifies the type of URL and can be used to dispatch a - * URL for further processing after parsing. It is initially the empty string. - * We only set non_special_scheme when the scheme is non-special, otherwise we avoid constructing - * string. - * - * Special schemes are stored in ada::scheme::details::is_special_list so we typically do not need - * to store them in each url instance. - */ - std::string non_special_scheme{}; - - }; // struct url - - - inline std::ostream& operator<<(std::ostream& out, const ada::url& u); -} // namespace ada - -#endif // ADA_URL_H -/* end file include/ada/url.h */ -// dofile: invoked with prepath=/Users/dlemire/CVS/github/ada/include, filename=ada/state.h -/* begin file include/ada/state.h */ + /** - * @file state.h - * @brief Definitions for the states of the URL state machine. + * @brief Generic URL struct reliant on std::string instantiation. + * + * @details To disambiguate from a valid URL string it can also be referred to + * as a URL record. A URL is a struct that represents a universal identifier. + * Unlike the url_aggregator, the ada::url represents the different components + * of a parsed URL as independent std::string instances. This makes the + * structure heavier and more reliant on memory allocations. When getting + * components from the parsed URL, a new std::string is typically constructed. + * + * @see https://url.spec.whatwg.org/#url-representation */ -#ifndef ADA_STATE_H -#define ADA_STATE_H - - -#include +struct url : url_base { + url() = default; + url(const url &u) = default; + url(url &&u) noexcept = default; + url &operator=(url &&u) noexcept = default; + url &operator=(const url &u) = default; + ~url() = default; -namespace ada { + /** + * @private + * A URL’s username is an ASCII string identifying a username. It is initially + * the empty string. + */ + std::string username{}; /** - * @see https://url.spec.whatwg.org/#url-parsing + * @private + * A URL’s password is an ASCII string identifying a password. It is initially + * the empty string. */ - enum class state { - AUTHORITY, - SCHEME_START, - SCHEME, - HOST, - NO_SCHEME, - FRAGMENT, - RELATIVE_SCHEME, - RELATIVE_SLASH, - FILE, - FILE_HOST, - FILE_SLASH, - PATH_OR_AUTHORITY, - SPECIAL_AUTHORITY_IGNORE_SLASHES, - SPECIAL_AUTHORITY_SLASHES, - SPECIAL_RELATIVE_OR_AUTHORITY, - QUERY, - PATH, - PATH_START, - OPAQUE_PATH, - PORT, - }; + std::string password{}; /** - * Stringify a URL state machine state. + * @private + * A URL’s host is null or a host. It is initially null. */ - ada_warn_unused std::string to_string(ada::state s); + std::optional host{}; -} // ada namespace + /** + * @private + * A URL’s port is either null or a 16-bit unsigned integer that identifies a + * networking port. It is initially null. + */ + std::optional port{}; -#endif // ADA_STATE_H -/* end file include/ada/state.h */ + /** + * @private + * A URL’s path is either an ASCII string or a list of zero or more ASCII + * strings, usually identifying a location. + */ + std::string path{}; -#include -#include + /** + * @private + * A URL’s query is either null or an ASCII string. It is initially null. + */ + std::optional query{}; -/** - * @namespace ada::helpers - * @brief Includes the definitions for helper functions - */ -namespace ada::helpers { + /** + * @private + * A URL’s fragment is either null or an ASCII string that can be used for + * further processing on the resource the URL’s other components identify. It + * is initially null. + */ + std::optional fragment{}; + + /** @private */ + inline void update_unencoded_base_hash(std::string_view input); + /** @private */ + inline void update_base_hostname(std::string_view input); + /** @private */ + inline void update_base_search(std::string_view input); + /** @private */ + inline void update_base_search(std::string_view input, + const uint8_t query_percent_encode_set[]); + /** @private */ + inline void update_base_search(std::optional input); + /** @private */ + inline void update_base_pathname(const std::string_view input); + /** @private */ + inline void update_base_username(const std::string_view input); + /** @private */ + inline void update_base_password(const std::string_view input); + /** @private */ + inline void update_base_port(std::optional input); + /** @private */ + inline void clear_base_pathname() override; + /** @private */ + inline void clear_base_search() override; + /** @private */ + inline bool base_fragment_has_value() const override; + /** @private */ + inline bool base_search_has_value() const override; + /** @private set this URL's type to file */ + inline void set_protocol_as_file(); + /** @return true if it has an host but it is the empty string */ + [[nodiscard]] inline bool has_empty_hostname() const noexcept; + /** @return true if it has a host (included an empty host) */ + [[nodiscard]] inline bool has_hostname() const noexcept; + [[nodiscard]] bool has_valid_domain() const noexcept override; /** - * This function is used to prune a fragment from a url, and returning the removed string if input has fragment. + * @private + * + * Parse the path from the provided input. + * Return true on success. Control characters not + * trimmed from the ends (they should have + * been removed if needed). * - * @details prune_fragment seeks the first '#' and returns everything after it as a - * string_view, and modifies (in place) the input so that it points at everything - * before the '#'. If no '#' is found, the input is left unchanged and std::nullopt is returned. + * The input is expected to be UTF-8. * - * @attention The function is non-allocating and it does not throw. - * @returns Note that the returned string_view might be empty! + * @see https://url.spec.whatwg.org/ */ - ada_really_inline std::optional prune_fragment(std::string_view& input) noexcept; + ada_really_inline void parse_path(const std::string_view input); /** - * Defined by the URL specification, shorten a URLs paths. - * @see https://url.spec.whatwg.org/#shorten-a-urls-path + * Set the scheme for this URL. The provided scheme should be a valid + * scheme string, be lower-cased, not contain spaces or tabs. It should + * have no spurious trailing or leading content. */ - ada_really_inline void shorten_path(std::string& path, ada::scheme::type type) noexcept; - - - /** - * @private - * - * Parse the path from the provided input and append to the existing - * (possibly empty) path. The input cannot contain tabs and spaces: it - * is the user's responsibility to check. - * - * The input is expected to be UTF-8. - * - * @return true on success. - * @see https://url.spec.whatwg.org/ - */ - ada_really_inline bool parse_prepared_path(const std::string_view input, ada::scheme::type type, std::string& path); + inline void set_scheme(std::string &&new_scheme) noexcept; /** - * Remove and mutate all ASCII tab or newline characters from an input. + * @private + * + * Take the scheme from another URL. The scheme string is moved from the + * provided url. */ - ada_really_inline void remove_ascii_tab_or_newline(std::string& input) noexcept; + inline void copy_scheme(ada::url &&u) noexcept; /** - * Return the substring from input going from index pos to the end. If pos > input.size(), - * it returns an empty string_view. This function cannot throw. + * Returns a JSON string representation of this URL. */ - ada_really_inline std::string_view substring(std::string_view input, size_t pos) noexcept; + std::string to_string() const override; /** - * Returns a host's delimiter location depending on the state of the instance, and - * whether a colon was found outside brackets. - * Used by the host parser. + * @see https://url.spec.whatwg.org/#dom-url-href + * @see https://url.spec.whatwg.org/#concept-url-serializer */ - ada_really_inline std::pair get_host_delimiter_location(const bool is_special, std::string_view& view) noexcept; + [[nodiscard]] ada_really_inline std::string get_href() const noexcept; /** - * Removes leading and trailing C0 control and whitespace characters from string. + * The origin getter steps are to return the serialization of this’s URL’s + * origin. [HTML] + * @return a newly allocated string. + * @see https://url.spec.whatwg.org/#concept-url-origin */ - ada_really_inline void trim_c0_whitespace(std::string_view& input) noexcept; + [[nodiscard]] std::string get_origin() const noexcept override; /** - * @see https://url.spec.whatwg.org/#potentially-strip-trailing-spaces-from-an-opaque-path + * The protocol getter steps are to return this’s URL’s scheme, followed by + * U+003A (:). + * @return a newly allocated string. + * @see https://url.spec.whatwg.org/#dom-url-protocol */ - ada_really_inline void strip_trailing_spaces_from_opaque_path(ada::url& url) noexcept; + [[nodiscard]] std::string get_protocol() const noexcept; /** - * Reverse the order of the bytes. + * Return url’s host, serialized, followed by U+003A (:) and url’s port, + * serialized. + * When there is no host, this function returns the empty string. + * @return a newly allocated string. + * @see https://url.spec.whatwg.org/#dom-url-host */ - ada_really_inline uint64_t swap_bytes(uint64_t val) noexcept; + [[nodiscard]] std::string get_host() const noexcept; /** - * Reverse the order of the bytes but only if the system is big endian + * Return this’s URL’s host, serialized. + * When there is no host, this function returns the empty string. + * @return a newly allocated string. + * @see https://url.spec.whatwg.org/#dom-url-hostname */ - ada_really_inline uint64_t swap_bytes_if_big_endian(uint64_t val) noexcept; - - /** - * Finds the delimiter of a view in authority state. - */ - ada_really_inline size_t find_authority_delimiter_special(std::string_view view) noexcept; + [[nodiscard]] std::string get_hostname() const noexcept; /** - * Finds the delimiter of a view in authority state. + * The pathname getter steps are to return the result of URL path serializing + * this’s URL. + * @return a newly allocated string. + * @see https://url.spec.whatwg.org/#dom-url-pathname */ - ada_really_inline size_t find_authority_delimiter(std::string_view view) noexcept; + [[nodiscard]] const std::string_view get_pathname() const noexcept; -} // namespace ada::helpers + /** + * Compute the pathname length in bytes witout instantiating a view or a + * string. + * @return size of the pathname in bytes + * @see https://url.spec.whatwg.org/#dom-url-pathname + */ + ada_really_inline size_t get_pathname_length() const noexcept; -#endif // ADA_HELPERS_H -/* end file include/ada/helpers.h */ -// dofile: invoked with prepath=/Users/dlemire/CVS/github/ada/include, filename=ada/parser.h -/* begin file include/ada/parser.h */ -/** - * @file parser.h - * @brief Definitions for the parser. - */ -#ifndef ADA_PARSER_H -#define ADA_PARSER_H + /** + * Return U+003F (?), followed by this’s URL’s query. + * @return a newly allocated string. + * @see https://url.spec.whatwg.org/#dom-url-search + */ + [[nodiscard]] std::string get_search() const noexcept; -// dofile: invoked with prepath=/Users/dlemire/CVS/github/ada/include, filename=ada/expected.h -/* begin file include/ada/expected.h */ -/** - * @file expected.h - * @brief Definitions for std::expected - * @private Excluded from docs through the doxygen file. - */ -/// -// expected - An implementation of std::expected with extensions -// Written in 2017 by Sy Brand (tartanllama@gmail.com, @TartanLlama) -// -// Documentation available at http://tl.tartanllama.xyz/ -// -// To the extent possible under law, the author(s) have dedicated all -// copyright and related and neighboring rights to this software to the -// public domain worldwide. This software is distributed without any warranty. -// -// You should have received a copy of the CC0 Public Domain Dedication -// along with this software. If not, see -// . -/// + /** + * The username getter steps are to return this’s URL’s username. + * @return a constant reference to the underlying string. + * @see https://url.spec.whatwg.org/#dom-url-username + */ + [[nodiscard]] const std::string &get_username() const noexcept; -#ifndef TL_EXPECTED_HPP -#define TL_EXPECTED_HPP + /** + * @return Returns true on successful operation. + * @see https://url.spec.whatwg.org/#dom-url-username + */ + bool set_username(const std::string_view input); -#define TL_EXPECTED_VERSION_MAJOR 1 -#define TL_EXPECTED_VERSION_MINOR 0 -#define TL_EXPECTED_VERSION_PATCH 1 + /** + * @return Returns true on success. + * @see https://url.spec.whatwg.org/#dom-url-password + */ + bool set_password(const std::string_view input); -#include -#include -#include -#include + /** + * @return Returns true on success. + * @see https://url.spec.whatwg.org/#dom-url-port + */ + bool set_port(const std::string_view input); -#if defined(__EXCEPTIONS) || defined(_CPPUNWIND) -#define TL_EXPECTED_EXCEPTIONS_ENABLED -#endif + /** + * This function always succeeds. + * @see https://url.spec.whatwg.org/#dom-url-hash + */ + void set_hash(const std::string_view input); -#if (defined(_MSC_VER) && _MSC_VER == 1900) -#define TL_EXPECTED_MSVC2015 -#define TL_EXPECTED_MSVC2015_CONSTEXPR -#else -#define TL_EXPECTED_MSVC2015_CONSTEXPR constexpr -#endif + /** + * This function always succeeds. + * @see https://url.spec.whatwg.org/#dom-url-search + */ + void set_search(const std::string_view input); -#if (defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ <= 9 && \ - !defined(__clang__)) -#define TL_EXPECTED_GCC49 -#endif + /** + * @return Returns true on success. + * @see https://url.spec.whatwg.org/#dom-url-search + */ + bool set_pathname(const std::string_view input); -#if (defined(__GNUC__) && __GNUC__ == 5 && __GNUC_MINOR__ <= 4 && \ - !defined(__clang__)) -#define TL_EXPECTED_GCC54 -#endif + /** + * @return Returns true on success. + * @see https://url.spec.whatwg.org/#dom-url-host + */ + bool set_host(const std::string_view input); -#if (defined(__GNUC__) && __GNUC__ == 5 && __GNUC_MINOR__ <= 5 && \ - !defined(__clang__)) -#define TL_EXPECTED_GCC55 -#endif + /** + * @return Returns true on success. + * @see https://url.spec.whatwg.org/#dom-url-hostname + */ + bool set_hostname(const std::string_view input); -#if (defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ <= 9 && \ - !defined(__clang__)) -// GCC < 5 doesn't support overloading on const&& for member functions + /** + * @return Returns true on success. + * @see https://url.spec.whatwg.org/#dom-url-protocol + */ + bool set_protocol(const std::string_view input); -#define TL_EXPECTED_NO_CONSTRR -// GCC < 5 doesn't support some standard C++11 type traits -#define TL_EXPECTED_IS_TRIVIALLY_COPY_CONSTRUCTIBLE(T) \ - std::has_trivial_copy_constructor -#define TL_EXPECTED_IS_TRIVIALLY_COPY_ASSIGNABLE(T) \ - std::has_trivial_copy_assign + /** + * @see https://url.spec.whatwg.org/#dom-url-href + */ + bool set_href(const std::string_view input); -// This one will be different for GCC 5.7 if it's ever supported -#define TL_EXPECTED_IS_TRIVIALLY_DESTRUCTIBLE(T) \ - std::is_trivially_destructible + /** + * @private + * + * Sets the host or hostname according to override condition. + * Return true on success. + * @see https://url.spec.whatwg.org/#hostname-state + */ + template + bool set_host_or_hostname(std::string_view input); -// GCC 5 < v < 8 has a bug in is_trivially_copy_constructible which breaks -// std::vector for non-copyable types -#elif (defined(__GNUC__) && __GNUC__ < 8 && !defined(__clang__)) -#ifndef TL_GCC_LESS_8_TRIVIALLY_COPY_CONSTRUCTIBLE_MUTEX -#define TL_GCC_LESS_8_TRIVIALLY_COPY_CONSTRUCTIBLE_MUTEX -namespace tl { -namespace detail { -template -struct is_trivially_copy_constructible - : std::is_trivially_copy_constructible {}; -#ifdef _GLIBCXX_VECTOR -template -struct is_trivially_copy_constructible> : std::false_type {}; -#endif -} // namespace detail -} // namespace tl -#endif + /** + * The password getter steps are to return this’s URL’s password. + * @return a constant reference to the underlying string. + * @see https://url.spec.whatwg.org/#dom-url-password + */ + [[nodiscard]] const std::string &get_password() const noexcept; -#define TL_EXPECTED_IS_TRIVIALLY_COPY_CONSTRUCTIBLE(T) \ - tl::detail::is_trivially_copy_constructible -#define TL_EXPECTED_IS_TRIVIALLY_COPY_ASSIGNABLE(T) \ - std::is_trivially_copy_assignable -#define TL_EXPECTED_IS_TRIVIALLY_DESTRUCTIBLE(T) \ - std::is_trivially_destructible -#else -#define TL_EXPECTED_IS_TRIVIALLY_COPY_CONSTRUCTIBLE(T) \ - std::is_trivially_copy_constructible -#define TL_EXPECTED_IS_TRIVIALLY_COPY_ASSIGNABLE(T) \ - std::is_trivially_copy_assignable -#define TL_EXPECTED_IS_TRIVIALLY_DESTRUCTIBLE(T) \ - std::is_trivially_destructible -#endif + /** + * Return this’s URL’s port, serialized. + * @return a newly constructed string representing the port. + * @see https://url.spec.whatwg.org/#dom-url-port + */ + [[nodiscard]] std::string get_port() const noexcept; -#if __cplusplus > 201103L -#define TL_EXPECTED_CXX14 -#endif + /** + * Return U+0023 (#), followed by this’s URL’s fragment. + * @return a newly constructed string representing the hash. + * @see https://url.spec.whatwg.org/#dom-url-hash + */ + [[nodiscard]] std::string get_hash() const noexcept; -#ifdef TL_EXPECTED_GCC49 -#define TL_EXPECTED_GCC49_CONSTEXPR -#else -#define TL_EXPECTED_GCC49_CONSTEXPR constexpr -#endif + /** + * A URL includes credentials if its username or password is not the empty + * string. + */ + [[nodiscard]] ada_really_inline bool includes_credentials() const noexcept; -#if (__cplusplus == 201103L || defined(TL_EXPECTED_MSVC2015) || \ - defined(TL_EXPECTED_GCC49)) -#define TL_EXPECTED_11_CONSTEXPR -#else -#define TL_EXPECTED_11_CONSTEXPR constexpr -#endif + /** + * @private + * + * A URL cannot have a username/password/port if its host is null or the empty + * string, or its scheme is "file". + */ + [[nodiscard]] inline bool cannot_have_credentials_or_port() const; -namespace tl { -template class expected; + /** @private */ + ada_really_inline size_t + parse_port(std::string_view view, + bool check_trailing_content = false) noexcept override; -#ifndef TL_MONOSTATE_INPLACE_MUTEX -#define TL_MONOSTATE_INPLACE_MUTEX -class monostate {}; + /** + * @private + * + * Take the scheme from another URL. The scheme string is copied from the + * provided url. + */ + inline void copy_scheme(const ada::url &u); -struct in_place_t { - explicit in_place_t() = default; -}; -static constexpr in_place_t in_place{}; -#endif + /** + * @private + * + * Parse the host from the provided input. We assume that + * the input does not contain spaces or tabs. Control + * characters and spaces are not trimmed (they should have + * been removed if needed). + * Return true on success. + * @see https://url.spec.whatwg.org/#host-parsing + */ + [[nodiscard]] ada_really_inline bool parse_host(std::string_view input); -template class unexpected { -public: - static_assert(!std::is_same::value, "E must not be void"); + /** @private */ + template + [[nodiscard]] ada_really_inline bool parse_scheme( + const std::string_view input); - unexpected() = delete; - constexpr explicit unexpected(const E &e) : m_val(e) {} + /** + * Useful for implementing efficient serialization for the URL. + * + * https://user:pass@example.com:1234/foo/bar?baz#quux + * | | | | ^^^^| | | + * | | | | | | | `----- hash_start + * | | | | | | `--------- search_start + * | | | | | `----------------- pathname_start + * | | | | `--------------------- port + * | | | `----------------------- host_end + * | | `---------------------------------- host_start + * | `--------------------------------------- username_end + * `--------------------------------------------- protocol_end + * + * Inspired after servo/url + * + * @return a newly constructed component. + * + * @see + * https://github.com/servo/rust-url/blob/b65a45515c10713f6d212e6726719a020203cc98/url/src/quirks.rs#L31 + */ + [[nodiscard]] ada_really_inline ada::url_components get_components() + const noexcept; - constexpr explicit unexpected(E &&e) : m_val(std::move(e)) {} + private: + /** + * @private + * + * Return true on success. + * @see https://url.spec.whatwg.org/#concept-ipv4-parser + */ + [[nodiscard]] bool parse_ipv4(std::string_view input); - template ::value>::type * = nullptr> - constexpr explicit unexpected(Args &&...args) - : m_val(std::forward(args)...) {} - template < - class U, class... Args, - typename std::enable_if &, Args &&...>::value>::type * = nullptr> - constexpr explicit unexpected(std::initializer_list l, Args &&...args) - : m_val(l, std::forward(args)...) {} + /** + * @private + * + * Return true on success. + * @see https://url.spec.whatwg.org/#concept-ipv6-parser + */ + [[nodiscard]] bool parse_ipv6(std::string_view input); - constexpr const E &value() const & { return m_val; } - TL_EXPECTED_11_CONSTEXPR E &value() & { return m_val; } - TL_EXPECTED_11_CONSTEXPR E &&value() && { return std::move(m_val); } - constexpr const E &&value() const && { return std::move(m_val); } + /** + * @private + * + * Return true on success. + * @see https://url.spec.whatwg.org/#concept-opaque-host-parser + */ + [[nodiscard]] bool parse_opaque_host(std::string_view input); -private: - E m_val; -}; + /** + * @private + * + * A URL’s scheme is an ASCII string that identifies the type of URL and can + * be used to dispatch a URL for further processing after parsing. It is + * initially the empty string. We only set non_special_scheme when the scheme + * is non-special, otherwise we avoid constructing string. + * + * Special schemes are stored in ada::scheme::details::is_special_list so we + * typically do not need to store them in each url instance. + */ + std::string non_special_scheme{}; -#ifdef __cpp_deduction_guides -template unexpected(E) -> unexpected; -#endif +}; // struct url -template -constexpr bool operator==(const unexpected &lhs, const unexpected &rhs) { - return lhs.value() == rhs.value(); -} -template -constexpr bool operator!=(const unexpected &lhs, const unexpected &rhs) { - return lhs.value() != rhs.value(); -} -template -constexpr bool operator<(const unexpected &lhs, const unexpected &rhs) { - return lhs.value() < rhs.value(); -} -template -constexpr bool operator<=(const unexpected &lhs, const unexpected &rhs) { - return lhs.value() <= rhs.value(); -} -template -constexpr bool operator>(const unexpected &lhs, const unexpected &rhs) { - return lhs.value() > rhs.value(); -} -template -constexpr bool operator>=(const unexpected &lhs, const unexpected &rhs) { - return lhs.value() >= rhs.value(); -} +inline std::ostream &operator<<(std::ostream &out, const ada::url &u); +} // namespace ada -template -unexpected::type> make_unexpected(E &&e) { - return unexpected::type>(std::forward(e)); -} +#endif // ADA_URL_H +/* end file include/ada/url.h */ +/* begin file include/ada/state.h */ +/** + * @file state.h + * @brief Definitions for the states of the URL state machine. + */ +#ifndef ADA_STATE_H +#define ADA_STATE_H -struct unexpect_t { - unexpect_t() = default; -}; -static constexpr unexpect_t unexpect{}; -namespace detail { -template -[[noreturn]] TL_EXPECTED_11_CONSTEXPR void throw_exception(E &&e) { -#ifdef TL_EXPECTED_EXCEPTIONS_ENABLED - throw std::forward(e); -#else -#ifdef _MSC_VER - __assume(0); -#else - __builtin_unreachable(); -#endif -#endif -} +#include -#ifndef TL_TRAITS_MUTEX -#define TL_TRAITS_MUTEX -// C++14-style aliases for brevity -template using remove_const_t = typename std::remove_const::type; -template -using remove_reference_t = typename std::remove_reference::type; -template using decay_t = typename std::decay::type; -template -using enable_if_t = typename std::enable_if::type; -template -using conditional_t = typename std::conditional::type; +namespace ada { -// std::conjunction from C++17 -template struct conjunction : std::true_type {}; -template struct conjunction : B {}; -template -struct conjunction - : std::conditional, B>::type {}; +/** + * @see https://url.spec.whatwg.org/#url-parsing + */ +enum class state { + AUTHORITY, + SCHEME_START, + SCHEME, + HOST, + NO_SCHEME, + FRAGMENT, + RELATIVE_SCHEME, + RELATIVE_SLASH, + FILE, + FILE_HOST, + FILE_SLASH, + PATH_OR_AUTHORITY, + SPECIAL_AUTHORITY_IGNORE_SLASHES, + SPECIAL_AUTHORITY_SLASHES, + SPECIAL_RELATIVE_OR_AUTHORITY, + QUERY, + PATH, + PATH_START, + OPAQUE_PATH, + PORT, +}; -#if defined(_LIBCPP_VERSION) && __cplusplus == 201103L -#define TL_TRAITS_LIBCXX_MEM_FN_WORKAROUND -#endif +/** + * Stringify a URL state machine state. + */ +ada_warn_unused std::string to_string(ada::state s); -// In C++11 mode, there's an issue in libc++'s std::mem_fn -// which results in a hard-error when using it in a noexcept expression -// in some cases. This is a check to workaround the common failing case. -#ifdef TL_TRAITS_LIBCXX_MEM_FN_WORKAROUND -template -struct is_pointer_to_non_const_member_func : std::false_type {}; -template -struct is_pointer_to_non_const_member_func - : std::true_type {}; -template -struct is_pointer_to_non_const_member_func - : std::true_type {}; -template -struct is_pointer_to_non_const_member_func - : std::true_type {}; -template -struct is_pointer_to_non_const_member_func - : std::true_type {}; -template -struct is_pointer_to_non_const_member_func - : std::true_type {}; -template -struct is_pointer_to_non_const_member_func - : std::true_type {}; +} // namespace ada -template struct is_const_or_const_ref : std::false_type {}; -template struct is_const_or_const_ref : std::true_type {}; -template struct is_const_or_const_ref : std::true_type {}; -#endif +#endif // ADA_STATE_H +/* end file include/ada/state.h */ -// std::invoke from C++17 -// https://stackoverflow.com/questions/38288042/c11-14-invoke-workaround -template < - typename Fn, typename... Args, -#ifdef TL_TRAITS_LIBCXX_MEM_FN_WORKAROUND - typename = enable_if_t::value && - is_const_or_const_ref::value)>, -#endif - typename = enable_if_t>::value>, int = 0> -constexpr auto invoke(Fn &&f, Args &&...args) noexcept( - noexcept(std::mem_fn(f)(std::forward(args)...))) - -> decltype(std::mem_fn(f)(std::forward(args)...)) { - return std::mem_fn(f)(std::forward(args)...); -} +#include +#include -template >::value>> -constexpr auto invoke(Fn &&f, Args &&...args) noexcept( - noexcept(std::forward(f)(std::forward(args)...))) - -> decltype(std::forward(f)(std::forward(args)...)) { - return std::forward(f)(std::forward(args)...); -} +/** + * @private + * @namespace ada::helpers + * @brief Includes the definitions for helper functions + */ +namespace ada::helpers { -// std::invoke_result from C++17 -template struct invoke_result_impl; +/** + * @private + */ +template +void encode_json(std::string_view view, out_iter out); -template -struct invoke_result_impl< - F, - decltype(detail::invoke(std::declval(), std::declval()...), void()), - Us...> { - using type = - decltype(detail::invoke(std::declval(), std::declval()...)); -}; +/** + * @private + * This function is used to prune a fragment from a url, and returning the + * removed string if input has fragment. + * + * @details prune_fragment seeks the first '#' and returns everything after it + * as a string_view, and modifies (in place) the input so that it points at + * everything before the '#'. If no '#' is found, the input is left unchanged + * and std::nullopt is returned. + * + * @attention The function is non-allocating and it does not throw. + * @returns Note that the returned string_view might be empty! + */ +ada_really_inline std::optional prune_fragment( + std::string_view& input) noexcept; -template -using invoke_result = invoke_result_impl; +/** + * @private + * Defined by the URL specification, shorten a URLs paths. + * @see https://url.spec.whatwg.org/#shorten-a-urls-path + * @returns Returns true if path is shortened. + */ +ada_really_inline bool shorten_path(std::string& path, + ada::scheme::type type) noexcept; -template -using invoke_result_t = typename invoke_result::type; - -#if defined(_MSC_VER) && _MSC_VER <= 1900 -// TODO make a version which works with MSVC 2015 -template struct is_swappable : std::true_type {}; - -template struct is_nothrow_swappable : std::true_type {}; -#else -// https://stackoverflow.com/questions/26744589/what-is-a-proper-way-to-implement-is-swappable-to-test-for-the-swappable-concept -namespace swap_adl_tests { -// if swap ADL finds this then it would call std::swap otherwise (same -// signature) -struct tag {}; +/** + * @private + * Defined by the URL specification, shorten a URLs paths. + * @see https://url.spec.whatwg.org/#shorten-a-urls-path + * @returns Returns true if path is shortened. + */ +ada_really_inline bool shorten_path(std::string_view& path, + ada::scheme::type type) noexcept; -template tag swap(T &, T &); -template tag swap(T (&a)[N], T (&b)[N]); +/** + * @private + * + * Parse the path from the provided input and append to the existing + * (possibly empty) path. The input cannot contain tabs and spaces: it + * is the user's responsibility to check. + * + * The input is expected to be UTF-8. + * + * @see https://url.spec.whatwg.org/ + */ +ada_really_inline void parse_prepared_path(const std::string_view input, + ada::scheme::type type, + std::string& path); -// helper functions to test if an unqualified swap is possible, and if it -// becomes std::swap -template std::false_type can_swap(...) noexcept(false); -template (), std::declval()))> -std::true_type can_swap(int) noexcept(noexcept(swap(std::declval(), - std::declval()))); +/** + * @private + * Remove and mutate all ASCII tab or newline characters from an input. + */ +ada_really_inline void remove_ascii_tab_or_newline(std::string& input) noexcept; -template std::false_type uses_std(...); -template -std::is_same(), std::declval())), tag> -uses_std(int); +/** + * @private + * Return the substring from input going from index pos to the end. If pos > + * input.size(), it returns an empty string_view. This function cannot throw. + */ +ada_really_inline std::string_view substring(std::string_view input, + size_t pos) noexcept; -template -struct is_std_swap_noexcept - : std::integral_constant::value && - std::is_nothrow_move_assignable::value> {}; +/** + * @private + * Returns true if the string_view points within the string. + */ +bool overlaps(std::string_view input1, const std::string& input2) noexcept; -template -struct is_std_swap_noexcept : is_std_swap_noexcept {}; +/** + * @private + * Return the substring from input going from index pos1 to the pos2 (non + * included). The length of the substring is pos2 - pos1. + */ +ada_really_inline std::string_view substring(const std::string& input, + size_t pos1, + size_t pos2) noexcept { +#if ADA_DEVELOPMENT_CHECKS + if (pos2 < pos1) { + std::cerr << "Negative-length substring: [" << pos1 << " to " << pos2 << ")" + << std::endl; + abort(); + } +#endif + return std::string_view(input.data() + pos1, pos2 - pos1); +} -template -struct is_adl_swap_noexcept - : std::integral_constant(0))> {}; -} // namespace swap_adl_tests +/** + * @private + * Modify the string_view so that it has the new size pos, assuming that pos <= + * input.size(). This function cannot throw. + */ +ada_really_inline void resize(std::string_view& input, size_t pos) noexcept; -template -struct is_swappable - : std::integral_constant< - bool, - decltype(detail::swap_adl_tests::can_swap(0))::value && - (!decltype(detail::swap_adl_tests::uses_std(0))::value || - (std::is_move_assignable::value && - std::is_move_constructible::value))> {}; +/** + * @private + * Returns a host's delimiter location depending on the state of the instance, + * and whether a colon was found outside brackets. Used by the host parser. + */ +ada_really_inline std::pair get_host_delimiter_location( + const bool is_special, std::string_view& view) noexcept; -template -struct is_swappable - : std::integral_constant< - bool, - decltype(detail::swap_adl_tests::can_swap(0))::value && - (!decltype(detail::swap_adl_tests::uses_std( - 0))::value || - is_swappable::value)> {}; +/** + * @private + * Removes leading and trailing C0 control and whitespace characters from + * string. + */ +ada_really_inline void trim_c0_whitespace(std::string_view& input) noexcept; -template -struct is_nothrow_swappable - : std::integral_constant< - bool, - is_swappable::value && - ((decltype(detail::swap_adl_tests::uses_std(0))::value && - detail::swap_adl_tests::is_std_swap_noexcept::value) || - (!decltype(detail::swap_adl_tests::uses_std(0))::value && - detail::swap_adl_tests::is_adl_swap_noexcept::value))> {}; -#endif -#endif +/** + * @private + * @see + * https://url.spec.whatwg.org/#potentially-strip-trailing-spaces-from-an-opaque-path + */ +template +ada_really_inline void strip_trailing_spaces_from_opaque_path( + url_type& url) noexcept; -// Trait for checking if a type is a tl::expected -template struct is_expected_impl : std::false_type {}; -template -struct is_expected_impl> : std::true_type {}; -template using is_expected = is_expected_impl>; +/** + * @private + * Reverse the order of the bytes. + */ +ada_really_inline uint64_t swap_bytes(uint64_t val) noexcept; -template -using expected_enable_forward_value = detail::enable_if_t< - std::is_constructible::value && - !std::is_same, in_place_t>::value && - !std::is_same, detail::decay_t>::value && - !std::is_same, detail::decay_t>::value>; +/** + * @private + * Reverse the order of the bytes but only if the system is big endian + */ +ada_really_inline uint64_t swap_bytes_if_big_endian(uint64_t val) noexcept; -template -using expected_enable_from_other = detail::enable_if_t< - std::is_constructible::value && - std::is_constructible::value && - !std::is_constructible &>::value && - !std::is_constructible &&>::value && - !std::is_constructible &>::value && - !std::is_constructible &&>::value && - !std::is_convertible &, T>::value && - !std::is_convertible &&, T>::value && - !std::is_convertible &, T>::value && - !std::is_convertible &&, T>::value>; +/** + * @private + * Finds the delimiter of a view in authority state. + */ +ada_really_inline size_t +find_authority_delimiter_special(std::string_view view) noexcept; -template -using is_void_or = conditional_t::value, std::true_type, U>; +/** + * @private + * Finds the delimiter of a view in authority state. + */ +ada_really_inline size_t +find_authority_delimiter(std::string_view view) noexcept; -template -using is_copy_constructible_or_void = - is_void_or>; +/** + * @private + */ +template +inline void inner_concat(std::string& buffer, T t) { + buffer.append(t); +} -template -using is_move_constructible_or_void = - is_void_or>; +/** + * @private + */ +template +inline void inner_concat(std::string& buffer, T t, Args... args) { + buffer.append(t); + return inner_concat(buffer, args...); +} -template -using is_copy_assignable_or_void = is_void_or>; +/** + * Concatenate the arguments and return a string. + * @returns a string + */ +template +std::string concat(Args... args) { + std::string answer; + inner_concat(answer, args...); + return answer; +} -template -using is_move_assignable_or_void = is_void_or>; +/** + * @return Number of leading zeroes. + */ +inline int leading_zeroes(uint32_t input_num) noexcept { +#if ADA_REGULAR_VISUAL_STUDIO + unsigned long leading_zero(0); + unsigned long in(input_num); + return _BitScanReverse(&leading_zero, in) ? int(31 - leading_zero) : 32; +#else + return __builtin_clz(input_num); +#endif // ADA_REGULAR_VISUAL_STUDIO +} -} // namespace detail +/** + * Counts the number of decimal digits necessary to represent x. + * faster than std::to_string(x).size(). + * @return digit count + */ +inline int fast_digit_count(uint32_t x) noexcept { + auto int_log2 = [](uint32_t z) -> int { + return 31 - ada::helpers::leading_zeroes(z | 1); + }; + // Compiles to very few instructions. Note that the + // table is static and thus effectively a constant. + // We leave it inside the function because it is meaningless + // outside of it (this comes at no performance cost). + const static uint64_t table[] = { + 4294967296, 8589934582, 8589934582, 8589934582, 12884901788, + 12884901788, 12884901788, 17179868184, 17179868184, 17179868184, + 21474826480, 21474826480, 21474826480, 21474826480, 25769703776, + 25769703776, 25769703776, 30063771072, 30063771072, 30063771072, + 34349738368, 34349738368, 34349738368, 34349738368, 38554705664, + 38554705664, 38554705664, 41949672960, 41949672960, 41949672960, + 42949672960, 42949672960}; + return int((x + table[int_log2(x)]) >> 32); +} +} // namespace ada::helpers -namespace detail { -struct no_init_t {}; -static constexpr no_init_t no_init{}; +#endif // ADA_HELPERS_H +/* end file include/ada/helpers.h */ +/* begin file include/ada/parser.h */ +/** + * @file parser.h + * @brief Definitions for the parser. + */ +#ifndef ADA_PARSER_H +#define ADA_PARSER_H -// Implements the storage of the values, and ensures that the destructor is -// trivial if it can be. +/* begin file include/ada/expected.h */ +/** + * @file expected.h + * @brief Definitions for std::expected + * @private Excluded from docs through the doxygen file. + */ +/// +// expected - An implementation of std::expected with extensions +// Written in 2017 by Sy Brand (tartanllama@gmail.com, @TartanLlama) // -// This specialization is for where neither `T` or `E` is trivially -// destructible, so the destructors must be called on destruction of the -// `expected` -template ::value, - bool = std::is_trivially_destructible::value> -struct expected_storage_base { - constexpr expected_storage_base() : m_val(T{}), m_has_val(true) {} - constexpr expected_storage_base(no_init_t) : m_no_init(), m_has_val(false) {} +// Documentation available at http://tl.tartanllama.xyz/ +// +// To the extent possible under law, the author(s) have dedicated all +// copyright and related and neighboring rights to this software to the +// public domain worldwide. This software is distributed without any warranty. +// +// You should have received a copy of the CC0 Public Domain Dedication +// along with this software. If not, see +// . +/// - template ::value> * = - nullptr> - constexpr expected_storage_base(in_place_t, Args &&...args) - : m_val(std::forward(args)...), m_has_val(true) {} +#ifndef TL_EXPECTED_HPP +#define TL_EXPECTED_HPP - template &, Args &&...>::value> * = nullptr> - constexpr expected_storage_base(in_place_t, std::initializer_list il, - Args &&...args) - : m_val(il, std::forward(args)...), m_has_val(true) {} - template ::value> * = - nullptr> - constexpr explicit expected_storage_base(unexpect_t, Args &&...args) - : m_unexpect(std::forward(args)...), m_has_val(false) {} +#define TL_EXPECTED_VERSION_MAJOR 1 +#define TL_EXPECTED_VERSION_MINOR 0 +#define TL_EXPECTED_VERSION_PATCH 1 - template &, Args &&...>::value> * = nullptr> - constexpr explicit expected_storage_base(unexpect_t, - std::initializer_list il, - Args &&...args) - : m_unexpect(il, std::forward(args)...), m_has_val(false) {} +#include +#include +#include +#include - ~expected_storage_base() { - if (m_has_val) { - m_val.~T(); - } else { - m_unexpect.~unexpected(); - } - } - union { - T m_val; - unexpected m_unexpect; - char m_no_init; - }; - bool m_has_val; -}; +#if defined(__EXCEPTIONS) || defined(_CPPUNWIND) +#define TL_EXPECTED_EXCEPTIONS_ENABLED +#endif -// This specialization is for when both `T` and `E` are trivially-destructible, -// so the destructor of the `expected` can be trivial. -template struct expected_storage_base { - constexpr expected_storage_base() : m_val(T{}), m_has_val(true) {} - constexpr expected_storage_base(no_init_t) : m_no_init(), m_has_val(false) {} +#if (defined(_MSC_VER) && _MSC_VER == 1900) +#define TL_EXPECTED_MSVC2015 +#define TL_EXPECTED_MSVC2015_CONSTEXPR +#else +#define TL_EXPECTED_MSVC2015_CONSTEXPR constexpr +#endif - template ::value> * = - nullptr> - constexpr expected_storage_base(in_place_t, Args &&...args) - : m_val(std::forward(args)...), m_has_val(true) {} - - template &, Args &&...>::value> * = nullptr> - constexpr expected_storage_base(in_place_t, std::initializer_list il, - Args &&...args) - : m_val(il, std::forward(args)...), m_has_val(true) {} - template ::value> * = - nullptr> - constexpr explicit expected_storage_base(unexpect_t, Args &&...args) - : m_unexpect(std::forward(args)...), m_has_val(false) {} +#if (defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ <= 9 && \ + !defined(__clang__)) +#define TL_EXPECTED_GCC49 +#endif - template &, Args &&...>::value> * = nullptr> - constexpr explicit expected_storage_base(unexpect_t, - std::initializer_list il, - Args &&...args) - : m_unexpect(il, std::forward(args)...), m_has_val(false) {} +#if (defined(__GNUC__) && __GNUC__ == 5 && __GNUC_MINOR__ <= 4 && \ + !defined(__clang__)) +#define TL_EXPECTED_GCC54 +#endif - ~expected_storage_base() = default; - union { - T m_val; - unexpected m_unexpect; - char m_no_init; - }; - bool m_has_val; -}; +#if (defined(__GNUC__) && __GNUC__ == 5 && __GNUC_MINOR__ <= 5 && \ + !defined(__clang__)) +#define TL_EXPECTED_GCC55 +#endif -// T is trivial, E is not. -template struct expected_storage_base { - constexpr expected_storage_base() : m_val(T{}), m_has_val(true) {} - TL_EXPECTED_MSVC2015_CONSTEXPR expected_storage_base(no_init_t) - : m_no_init(), m_has_val(false) {} +#if (defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ <= 9 && \ + !defined(__clang__)) +// GCC < 5 doesn't support overloading on const&& for member functions - template ::value> * = - nullptr> - constexpr expected_storage_base(in_place_t, Args &&...args) - : m_val(std::forward(args)...), m_has_val(true) {} +#define TL_EXPECTED_NO_CONSTRR +// GCC < 5 doesn't support some standard C++11 type traits +#define TL_EXPECTED_IS_TRIVIALLY_COPY_CONSTRUCTIBLE(T) \ + std::has_trivial_copy_constructor +#define TL_EXPECTED_IS_TRIVIALLY_COPY_ASSIGNABLE(T) \ + std::has_trivial_copy_assign - template &, Args &&...>::value> * = nullptr> - constexpr expected_storage_base(in_place_t, std::initializer_list il, - Args &&...args) - : m_val(il, std::forward(args)...), m_has_val(true) {} - template ::value> * = - nullptr> - constexpr explicit expected_storage_base(unexpect_t, Args &&...args) - : m_unexpect(std::forward(args)...), m_has_val(false) {} +// This one will be different for GCC 5.7 if it's ever supported +#define TL_EXPECTED_IS_TRIVIALLY_DESTRUCTIBLE(T) \ + std::is_trivially_destructible - template &, Args &&...>::value> * = nullptr> - constexpr explicit expected_storage_base(unexpect_t, - std::initializer_list il, - Args &&...args) - : m_unexpect(il, std::forward(args)...), m_has_val(false) {} +// GCC 5 < v < 8 has a bug in is_trivially_copy_constructible which breaks +// std::vector for non-copyable types +#elif (defined(__GNUC__) && __GNUC__ < 8 && !defined(__clang__)) +#ifndef TL_GCC_LESS_8_TRIVIALLY_COPY_CONSTRUCTIBLE_MUTEX +#define TL_GCC_LESS_8_TRIVIALLY_COPY_CONSTRUCTIBLE_MUTEX +namespace tl { +namespace detail { +template +struct is_trivially_copy_constructible + : std::is_trivially_copy_constructible {}; +#ifdef _GLIBCXX_VECTOR +template +struct is_trivially_copy_constructible> : std::false_type {}; +#endif +} // namespace detail +} // namespace tl +#endif - ~expected_storage_base() { - if (!m_has_val) { - m_unexpect.~unexpected(); - } - } +#define TL_EXPECTED_IS_TRIVIALLY_COPY_CONSTRUCTIBLE(T) \ + tl::detail::is_trivially_copy_constructible +#define TL_EXPECTED_IS_TRIVIALLY_COPY_ASSIGNABLE(T) \ + std::is_trivially_copy_assignable +#define TL_EXPECTED_IS_TRIVIALLY_DESTRUCTIBLE(T) \ + std::is_trivially_destructible +#else +#define TL_EXPECTED_IS_TRIVIALLY_COPY_CONSTRUCTIBLE(T) \ + std::is_trivially_copy_constructible +#define TL_EXPECTED_IS_TRIVIALLY_COPY_ASSIGNABLE(T) \ + std::is_trivially_copy_assignable +#define TL_EXPECTED_IS_TRIVIALLY_DESTRUCTIBLE(T) \ + std::is_trivially_destructible +#endif - union { - T m_val; - unexpected m_unexpect; - char m_no_init; - }; - bool m_has_val; -}; +#if __cplusplus > 201103L +#define TL_EXPECTED_CXX14 +#endif -// E is trivial, T is not. -template struct expected_storage_base { - constexpr expected_storage_base() : m_val(T{}), m_has_val(true) {} - constexpr expected_storage_base(no_init_t) : m_no_init(), m_has_val(false) {} +#ifdef TL_EXPECTED_GCC49 +#define TL_EXPECTED_GCC49_CONSTEXPR +#else +#define TL_EXPECTED_GCC49_CONSTEXPR constexpr +#endif - template ::value> * = - nullptr> - constexpr expected_storage_base(in_place_t, Args &&...args) - : m_val(std::forward(args)...), m_has_val(true) {} +#if (__cplusplus == 201103L || defined(TL_EXPECTED_MSVC2015) || \ + defined(TL_EXPECTED_GCC49)) +#define TL_EXPECTED_11_CONSTEXPR +#else +#define TL_EXPECTED_11_CONSTEXPR constexpr +#endif - template &, Args &&...>::value> * = nullptr> - constexpr expected_storage_base(in_place_t, std::initializer_list il, - Args &&...args) - : m_val(il, std::forward(args)...), m_has_val(true) {} - template ::value> * = - nullptr> - constexpr explicit expected_storage_base(unexpect_t, Args &&...args) - : m_unexpect(std::forward(args)...), m_has_val(false) {} +namespace tl { +template +class expected; - template &, Args &&...>::value> * = nullptr> - constexpr explicit expected_storage_base(unexpect_t, - std::initializer_list il, - Args &&...args) - : m_unexpect(il, std::forward(args)...), m_has_val(false) {} +#ifndef TL_MONOSTATE_INPLACE_MUTEX +#define TL_MONOSTATE_INPLACE_MUTEX +class monostate {}; - ~expected_storage_base() { - if (m_has_val) { - m_val.~T(); - } - } - union { - T m_val; - unexpected m_unexpect; - char m_no_init; - }; - bool m_has_val; +struct in_place_t { + explicit in_place_t() = default; }; +static constexpr in_place_t in_place{}; +#endif -// `T` is `void`, `E` is trivially-destructible -template struct expected_storage_base { - #if __GNUC__ <= 5 - //no constexpr for GCC 4/5 bug - #else - TL_EXPECTED_MSVC2015_CONSTEXPR - #endif - expected_storage_base() : m_has_val(true) {} - - constexpr expected_storage_base(no_init_t) : m_val(), m_has_val(false) {} +template +class unexpected { + public: + static_assert(!std::is_same::value, "E must not be void"); - constexpr expected_storage_base(in_place_t) : m_has_val(true) {} + unexpected() = delete; + constexpr explicit unexpected(const E &e) : m_val(e) {} - template ::value> * = - nullptr> - constexpr explicit expected_storage_base(unexpect_t, Args &&...args) - : m_unexpect(std::forward(args)...), m_has_val(false) {} + constexpr explicit unexpected(E &&e) : m_val(std::move(e)) {} - template &, Args &&...>::value> * = nullptr> - constexpr explicit expected_storage_base(unexpect_t, - std::initializer_list il, - Args &&...args) - : m_unexpect(il, std::forward(args)...), m_has_val(false) {} + template ::value>::type * = nullptr> + constexpr explicit unexpected(Args &&...args) + : m_val(std::forward(args)...) {} + template < + class U, class... Args, + typename std::enable_if &, Args &&...>::value>::type * = nullptr> + constexpr explicit unexpected(std::initializer_list l, Args &&...args) + : m_val(l, std::forward(args)...) {} - ~expected_storage_base() = default; - struct dummy {}; - union { - unexpected m_unexpect; - dummy m_val; - }; - bool m_has_val; + constexpr const E &value() const & { return m_val; } + TL_EXPECTED_11_CONSTEXPR E &value() & { return m_val; } + TL_EXPECTED_11_CONSTEXPR E &&value() && { return std::move(m_val); } + constexpr const E &&value() const && { return std::move(m_val); } + + private: + E m_val; }; -// `T` is `void`, `E` is not trivially-destructible -template struct expected_storage_base { - constexpr expected_storage_base() : m_dummy(), m_has_val(true) {} - constexpr expected_storage_base(no_init_t) : m_dummy(), m_has_val(false) {} +#ifdef __cpp_deduction_guides +template +unexpected(E) -> unexpected; +#endif - constexpr expected_storage_base(in_place_t) : m_dummy(), m_has_val(true) {} +template +constexpr bool operator==(const unexpected &lhs, const unexpected &rhs) { + return lhs.value() == rhs.value(); +} +template +constexpr bool operator!=(const unexpected &lhs, const unexpected &rhs) { + return lhs.value() != rhs.value(); +} +template +constexpr bool operator<(const unexpected &lhs, const unexpected &rhs) { + return lhs.value() < rhs.value(); +} +template +constexpr bool operator<=(const unexpected &lhs, const unexpected &rhs) { + return lhs.value() <= rhs.value(); +} +template +constexpr bool operator>(const unexpected &lhs, const unexpected &rhs) { + return lhs.value() > rhs.value(); +} +template +constexpr bool operator>=(const unexpected &lhs, const unexpected &rhs) { + return lhs.value() >= rhs.value(); +} - template ::value> * = - nullptr> - constexpr explicit expected_storage_base(unexpect_t, Args &&...args) - : m_unexpect(std::forward(args)...), m_has_val(false) {} +template +unexpected::type> make_unexpected(E &&e) { + return unexpected::type>(std::forward(e)); +} - template &, Args &&...>::value> * = nullptr> - constexpr explicit expected_storage_base(unexpect_t, - std::initializer_list il, - Args &&...args) - : m_unexpect(il, std::forward(args)...), m_has_val(false) {} +struct unexpect_t { + unexpect_t() = default; +}; +static constexpr unexpect_t unexpect{}; - ~expected_storage_base() { - if (!m_has_val) { - m_unexpect.~unexpected(); - } - } +namespace detail { +template +[[noreturn]] TL_EXPECTED_11_CONSTEXPR void throw_exception(E &&e) { +#ifdef TL_EXPECTED_EXCEPTIONS_ENABLED + throw std::forward(e); +#else +#ifdef _MSC_VER + __assume(0); +#else + __builtin_unreachable(); +#endif +#endif +} - union { - unexpected m_unexpect; - char m_dummy; - }; - bool m_has_val; -}; +#ifndef TL_TRAITS_MUTEX +#define TL_TRAITS_MUTEX +// C++14-style aliases for brevity +template +using remove_const_t = typename std::remove_const::type; +template +using remove_reference_t = typename std::remove_reference::type; +template +using decay_t = typename std::decay::type; +template +using enable_if_t = typename std::enable_if::type; +template +using conditional_t = typename std::conditional::type; -// This base class provides some handy member functions which can be used in -// further derived classes -template -struct expected_operations_base : expected_storage_base { - using expected_storage_base::expected_storage_base; +// std::conjunction from C++17 +template +struct conjunction : std::true_type {}; +template +struct conjunction : B {}; +template +struct conjunction + : std::conditional, B>::type {}; - template void construct(Args &&...args) noexcept { - new (std::addressof(this->m_val)) T(std::forward(args)...); - this->m_has_val = true; - } +#if defined(_LIBCPP_VERSION) && __cplusplus == 201103L +#define TL_TRAITS_LIBCXX_MEM_FN_WORKAROUND +#endif - template void construct_with(Rhs &&rhs) noexcept { - new (std::addressof(this->m_val)) T(std::forward(rhs).get()); - this->m_has_val = true; - } +// In C++11 mode, there's an issue in libc++'s std::mem_fn +// which results in a hard-error when using it in a noexcept expression +// in some cases. This is a check to workaround the common failing case. +#ifdef TL_TRAITS_LIBCXX_MEM_FN_WORKAROUND +template +struct is_pointer_to_non_const_member_func : std::false_type {}; +template +struct is_pointer_to_non_const_member_func + : std::true_type {}; +template +struct is_pointer_to_non_const_member_func + : std::true_type {}; +template +struct is_pointer_to_non_const_member_func + : std::true_type {}; +template +struct is_pointer_to_non_const_member_func + : std::true_type {}; +template +struct is_pointer_to_non_const_member_func + : std::true_type {}; +template +struct is_pointer_to_non_const_member_func + : std::true_type {}; - template void construct_error(Args &&...args) noexcept { - new (std::addressof(this->m_unexpect)) - unexpected(std::forward(args)...); - this->m_has_val = false; - } +template +struct is_const_or_const_ref : std::false_type {}; +template +struct is_const_or_const_ref : std::true_type {}; +template +struct is_const_or_const_ref : std::true_type {}; +#endif -#ifdef TL_EXPECTED_EXCEPTIONS_ENABLED +// std::invoke from C++17 +// https://stackoverflow.com/questions/38288042/c11-14-invoke-workaround +template < + typename Fn, typename... Args, +#ifdef TL_TRAITS_LIBCXX_MEM_FN_WORKAROUND + typename = enable_if_t::value && + is_const_or_const_ref::value)>, +#endif + typename = enable_if_t>::value>, int = 0> +constexpr auto invoke(Fn &&f, Args &&...args) noexcept( + noexcept(std::mem_fn(f)(std::forward(args)...))) + -> decltype(std::mem_fn(f)(std::forward(args)...)) { + return std::mem_fn(f)(std::forward(args)...); +} - // These assign overloads ensure that the most efficient assignment - // implementation is used while maintaining the strong exception guarantee. - // The problematic case is where rhs has a value, but *this does not. - // - // This overload handles the case where we can just copy-construct `T` - // directly into place without throwing. - template ::value> - * = nullptr> - void assign(const expected_operations_base &rhs) noexcept { - if (!this->m_has_val && rhs.m_has_val) { - geterr().~unexpected(); - construct(rhs.get()); - } else { - assign_common(rhs); - } - } +template >::value>> +constexpr auto invoke(Fn &&f, Args &&...args) noexcept( + noexcept(std::forward(f)(std::forward(args)...))) + -> decltype(std::forward(f)(std::forward(args)...)) { + return std::forward(f)(std::forward(args)...); +} - // This overload handles the case where we can attempt to create a copy of - // `T`, then no-throw move it into place if the copy was successful. - template ::value && - std::is_nothrow_move_constructible::value> - * = nullptr> - void assign(const expected_operations_base &rhs) noexcept { - if (!this->m_has_val && rhs.m_has_val) { - T tmp = rhs.get(); - geterr().~unexpected(); - construct(std::move(tmp)); - } else { - assign_common(rhs); - } - } +// std::invoke_result from C++17 +template +struct invoke_result_impl; - // This overload is the worst-case, where we have to move-construct the - // unexpected value into temporary storage, then try to copy the T into place. - // If the construction succeeds, then everything is fine, but if it throws, - // then we move the old unexpected value back into place before rethrowing the - // exception. - template ::value && - !std::is_nothrow_move_constructible::value> - * = nullptr> - void assign(const expected_operations_base &rhs) { - if (!this->m_has_val && rhs.m_has_val) { - auto tmp = std::move(geterr()); - geterr().~unexpected(); +template +struct invoke_result_impl< + F, + decltype(detail::invoke(std::declval(), std::declval()...), void()), + Us...> { + using type = + decltype(detail::invoke(std::declval(), std::declval()...)); +}; -#ifdef TL_EXPECTED_EXCEPTIONS_ENABLED - try { - construct(rhs.get()); - } catch (...) { - geterr() = std::move(tmp); - throw; - } -#else - construct(rhs.get()); -#endif - } else { - assign_common(rhs); - } - } +template +using invoke_result = invoke_result_impl; - // These overloads do the same as above, but for rvalues - template ::value> - * = nullptr> - void assign(expected_operations_base &&rhs) noexcept { - if (!this->m_has_val && rhs.m_has_val) { - geterr().~unexpected(); - construct(std::move(rhs).get()); - } else { - assign_common(std::move(rhs)); - } - } +template +using invoke_result_t = typename invoke_result::type; - template ::value> - * = nullptr> - void assign(expected_operations_base &&rhs) { - if (!this->m_has_val && rhs.m_has_val) { - auto tmp = std::move(geterr()); - geterr().~unexpected(); -#ifdef TL_EXPECTED_EXCEPTIONS_ENABLED - try { - construct(std::move(rhs).get()); - } catch (...) { - geterr() = std::move(tmp); - throw; - } -#else - construct(std::move(rhs).get()); -#endif - } else { - assign_common(std::move(rhs)); - } - } +#if defined(_MSC_VER) && _MSC_VER <= 1900 +// TODO make a version which works with MSVC 2015 +template +struct is_swappable : std::true_type {}; +template +struct is_nothrow_swappable : std::true_type {}; #else +// https://stackoverflow.com/questions/26744589/what-is-a-proper-way-to-implement-is-swappable-to-test-for-the-swappable-concept +namespace swap_adl_tests { +// if swap ADL finds this then it would call std::swap otherwise (same +// signature) +struct tag {}; - // If exceptions are disabled then we can just copy-construct - void assign(const expected_operations_base &rhs) noexcept { - if (!this->m_has_val && rhs.m_has_val) { - geterr().~unexpected(); - construct(rhs.get()); - } else { - assign_common(rhs); - } - } +template +tag swap(T &, T &); +template +tag swap(T (&a)[N], T (&b)[N]); - void assign(expected_operations_base &&rhs) noexcept { - if (!this->m_has_val && rhs.m_has_val) { - geterr().~unexpected(); - construct(std::move(rhs).get()); - } else { - assign_common(rhs); - } - } +// helper functions to test if an unqualified swap is possible, and if it +// becomes std::swap +template +std::false_type can_swap(...) noexcept(false); +template (), std::declval()))> +std::true_type can_swap(int) noexcept(noexcept(swap(std::declval(), + std::declval()))); -#endif +template +std::false_type uses_std(...); +template +std::is_same(), std::declval())), tag> +uses_std(int); - // The common part of move/copy assigning - template void assign_common(Rhs &&rhs) { - if (this->m_has_val) { - if (rhs.m_has_val) { - get() = std::forward(rhs).get(); - } else { - destroy_val(); - construct_error(std::forward(rhs).geterr()); - } - } else { - if (!rhs.m_has_val) { - geterr() = std::forward(rhs).geterr(); - } - } - } +template +struct is_std_swap_noexcept + : std::integral_constant::value && + std::is_nothrow_move_assignable::value> {}; - bool has_value() const { return this->m_has_val; } +template +struct is_std_swap_noexcept : is_std_swap_noexcept {}; - TL_EXPECTED_11_CONSTEXPR T &get() & { return this->m_val; } - constexpr const T &get() const & { return this->m_val; } - TL_EXPECTED_11_CONSTEXPR T &&get() && { return std::move(this->m_val); } -#ifndef TL_EXPECTED_NO_CONSTRR - constexpr const T &&get() const && { return std::move(this->m_val); } -#endif +template +struct is_adl_swap_noexcept + : std::integral_constant(0))> {}; +} // namespace swap_adl_tests - TL_EXPECTED_11_CONSTEXPR unexpected &geterr() & { - return this->m_unexpect; - } - constexpr const unexpected &geterr() const & { return this->m_unexpect; } - TL_EXPECTED_11_CONSTEXPR unexpected &&geterr() && { - return std::move(this->m_unexpect); - } -#ifndef TL_EXPECTED_NO_CONSTRR - constexpr const unexpected &&geterr() const && { - return std::move(this->m_unexpect); - } -#endif +template +struct is_swappable + : std::integral_constant< + bool, + decltype(detail::swap_adl_tests::can_swap(0))::value && + (!decltype(detail::swap_adl_tests::uses_std(0))::value || + (std::is_move_assignable::value && + std::is_move_constructible::value))> {}; - TL_EXPECTED_11_CONSTEXPR void destroy_val() { get().~T(); } -}; +template +struct is_swappable + : std::integral_constant< + bool, + decltype(detail::swap_adl_tests::can_swap(0))::value && + (!decltype(detail::swap_adl_tests::uses_std( + 0))::value || + is_swappable::value)> {}; -// This base class provides some handy member functions which can be used in -// further derived classes -template -struct expected_operations_base : expected_storage_base { - using expected_storage_base::expected_storage_base; +template +struct is_nothrow_swappable + : std::integral_constant< + bool, + is_swappable::value && + ((decltype(detail::swap_adl_tests::uses_std(0))::value && + detail::swap_adl_tests::is_std_swap_noexcept::value) || + (!decltype(detail::swap_adl_tests::uses_std(0))::value && + detail::swap_adl_tests::is_adl_swap_noexcept::value))> {}; +#endif +#endif - template void construct() noexcept { this->m_has_val = true; } +// Trait for checking if a type is a tl::expected +template +struct is_expected_impl : std::false_type {}; +template +struct is_expected_impl> : std::true_type {}; +template +using is_expected = is_expected_impl>; - // This function doesn't use its argument, but needs it so that code in - // levels above this can work independently of whether T is void - template void construct_with(Rhs &&) noexcept { - this->m_has_val = true; - } +template +using expected_enable_forward_value = detail::enable_if_t< + std::is_constructible::value && + !std::is_same, in_place_t>::value && + !std::is_same, detail::decay_t>::value && + !std::is_same, detail::decay_t>::value>; - template void construct_error(Args &&...args) noexcept { - new (std::addressof(this->m_unexpect)) - unexpected(std::forward(args)...); - this->m_has_val = false; - } +template +using expected_enable_from_other = detail::enable_if_t< + std::is_constructible::value && + std::is_constructible::value && + !std::is_constructible &>::value && + !std::is_constructible &&>::value && + !std::is_constructible &>::value && + !std::is_constructible &&>::value && + !std::is_convertible &, T>::value && + !std::is_convertible &&, T>::value && + !std::is_convertible &, T>::value && + !std::is_convertible &&, T>::value>; - template void assign(Rhs &&rhs) noexcept { - if (!this->m_has_val) { - if (rhs.m_has_val) { - geterr().~unexpected(); - construct(); - } else { - geterr() = std::forward(rhs).geterr(); - } - } else { - if (!rhs.m_has_val) { - construct_error(std::forward(rhs).geterr()); - } - } - } +template +using is_void_or = conditional_t::value, std::true_type, U>; - bool has_value() const { return this->m_has_val; } +template +using is_copy_constructible_or_void = + is_void_or>; - TL_EXPECTED_11_CONSTEXPR unexpected &geterr() & { - return this->m_unexpect; - } - constexpr const unexpected &geterr() const & { return this->m_unexpect; } - TL_EXPECTED_11_CONSTEXPR unexpected &&geterr() && { - return std::move(this->m_unexpect); - } -#ifndef TL_EXPECTED_NO_CONSTRR - constexpr const unexpected &&geterr() const && { - return std::move(this->m_unexpect); - } -#endif +template +using is_move_constructible_or_void = + is_void_or>; - TL_EXPECTED_11_CONSTEXPR void destroy_val() { - // no-op - } -}; +template +using is_copy_assignable_or_void = is_void_or>; -// This class manages conditionally having a trivial copy constructor -// This specialization is for when T and E are trivially copy constructible -template :: - value &&TL_EXPECTED_IS_TRIVIALLY_COPY_CONSTRUCTIBLE(E)::value> -struct expected_copy_base : expected_operations_base { - using expected_operations_base::expected_operations_base; -}; +template +using is_move_assignable_or_void = is_void_or>; -// This specialization is for when T or E are not trivially copy constructible -template -struct expected_copy_base : expected_operations_base { - using expected_operations_base::expected_operations_base; +} // namespace detail - expected_copy_base() = default; - expected_copy_base(const expected_copy_base &rhs) - : expected_operations_base(no_init) { - if (rhs.has_value()) { - this->construct_with(rhs); - } else { - this->construct_error(rhs.geterr()); - } - } +namespace detail { +struct no_init_t {}; +static constexpr no_init_t no_init{}; - expected_copy_base(expected_copy_base &&rhs) = default; - expected_copy_base &operator=(const expected_copy_base &rhs) = default; - expected_copy_base &operator=(expected_copy_base &&rhs) = default; -}; +// Implements the storage of the values, and ensures that the destructor is +// trivial if it can be. +// +// This specialization is for where neither `T` or `E` is trivially +// destructible, so the destructors must be called on destruction of the +// `expected` +template ::value, + bool = std::is_trivially_destructible::value> +struct expected_storage_base { + constexpr expected_storage_base() : m_val(T{}), m_has_val(true) {} + constexpr expected_storage_base(no_init_t) : m_no_init(), m_has_val(false) {} -// This class manages conditionally having a trivial move constructor -// Unfortunately there's no way to achieve this in GCC < 5 AFAIK, since it -// doesn't implement an analogue to std::is_trivially_move_constructible. We -// have to make do with a non-trivial move constructor even if T is trivially -// move constructible -#ifndef TL_EXPECTED_GCC49 -template >::value - &&std::is_trivially_move_constructible::value> -struct expected_move_base : expected_copy_base { - using expected_copy_base::expected_copy_base; -}; -#else -template struct expected_move_base; -#endif -template -struct expected_move_base : expected_copy_base { - using expected_copy_base::expected_copy_base; + template ::value> * = + nullptr> + constexpr expected_storage_base(in_place_t, Args &&...args) + : m_val(std::forward(args)...), m_has_val(true) {} - expected_move_base() = default; - expected_move_base(const expected_move_base &rhs) = default; + template &, Args &&...>::value> * = nullptr> + constexpr expected_storage_base(in_place_t, std::initializer_list il, + Args &&...args) + : m_val(il, std::forward(args)...), m_has_val(true) {} + template ::value> * = + nullptr> + constexpr explicit expected_storage_base(unexpect_t, Args &&...args) + : m_unexpect(std::forward(args)...), m_has_val(false) {} - expected_move_base(expected_move_base &&rhs) noexcept( - std::is_nothrow_move_constructible::value) - : expected_copy_base(no_init) { - if (rhs.has_value()) { - this->construct_with(std::move(rhs)); + template &, Args &&...>::value> * = nullptr> + constexpr explicit expected_storage_base(unexpect_t, + std::initializer_list il, + Args &&...args) + : m_unexpect(il, std::forward(args)...), m_has_val(false) {} + + ~expected_storage_base() { + if (m_has_val) { + m_val.~T(); } else { - this->construct_error(std::move(rhs.geterr())); + m_unexpect.~unexpected(); } } - expected_move_base &operator=(const expected_move_base &rhs) = default; - expected_move_base &operator=(expected_move_base &&rhs) = default; -}; - -// This class manages conditionally having a trivial copy assignment operator -template >::value - &&TL_EXPECTED_IS_TRIVIALLY_COPY_ASSIGNABLE(E)::value - &&TL_EXPECTED_IS_TRIVIALLY_COPY_CONSTRUCTIBLE(E)::value - &&TL_EXPECTED_IS_TRIVIALLY_DESTRUCTIBLE(E)::value> -struct expected_copy_assign_base : expected_move_base { - using expected_move_base::expected_move_base; + union { + T m_val; + unexpected m_unexpect; + char m_no_init; + }; + bool m_has_val; }; +// This specialization is for when both `T` and `E` are trivially-destructible, +// so the destructor of the `expected` can be trivial. template -struct expected_copy_assign_base : expected_move_base { - using expected_move_base::expected_move_base; +struct expected_storage_base { + constexpr expected_storage_base() : m_val(T{}), m_has_val(true) {} + constexpr expected_storage_base(no_init_t) : m_no_init(), m_has_val(false) {} - expected_copy_assign_base() = default; - expected_copy_assign_base(const expected_copy_assign_base &rhs) = default; + template ::value> * = + nullptr> + constexpr expected_storage_base(in_place_t, Args &&...args) + : m_val(std::forward(args)...), m_has_val(true) {} - expected_copy_assign_base(expected_copy_assign_base &&rhs) = default; - expected_copy_assign_base &operator=(const expected_copy_assign_base &rhs) { - this->assign(rhs); - return *this; - } - expected_copy_assign_base & - operator=(expected_copy_assign_base &&rhs) = default; -}; + template &, Args &&...>::value> * = nullptr> + constexpr expected_storage_base(in_place_t, std::initializer_list il, + Args &&...args) + : m_val(il, std::forward(args)...), m_has_val(true) {} + template ::value> * = + nullptr> + constexpr explicit expected_storage_base(unexpect_t, Args &&...args) + : m_unexpect(std::forward(args)...), m_has_val(false) {} -// This class manages conditionally having a trivial move assignment operator -// Unfortunately there's no way to achieve this in GCC < 5 AFAIK, since it -// doesn't implement an analogue to std::is_trivially_move_assignable. We have -// to make do with a non-trivial move assignment operator even if T is trivially -// move assignable -#ifndef TL_EXPECTED_GCC49 -template , - std::is_trivially_move_constructible, - std::is_trivially_move_assignable>>:: - value &&std::is_trivially_destructible::value - &&std::is_trivially_move_constructible::value - &&std::is_trivially_move_assignable::value> -struct expected_move_assign_base : expected_copy_assign_base { - using expected_copy_assign_base::expected_copy_assign_base; + template &, Args &&...>::value> * = nullptr> + constexpr explicit expected_storage_base(unexpect_t, + std::initializer_list il, + Args &&...args) + : m_unexpect(il, std::forward(args)...), m_has_val(false) {} + + ~expected_storage_base() = default; + union { + T m_val; + unexpected m_unexpect; + char m_no_init; + }; + bool m_has_val; }; -#else -template struct expected_move_assign_base; -#endif +// T is trivial, E is not. template -struct expected_move_assign_base - : expected_copy_assign_base { - using expected_copy_assign_base::expected_copy_assign_base; +struct expected_storage_base { + constexpr expected_storage_base() : m_val(T{}), m_has_val(true) {} + TL_EXPECTED_MSVC2015_CONSTEXPR expected_storage_base(no_init_t) + : m_no_init(), m_has_val(false) {} - expected_move_assign_base() = default; - expected_move_assign_base(const expected_move_assign_base &rhs) = default; + template ::value> * = + nullptr> + constexpr expected_storage_base(in_place_t, Args &&...args) + : m_val(std::forward(args)...), m_has_val(true) {} - expected_move_assign_base(expected_move_assign_base &&rhs) = default; + template &, Args &&...>::value> * = nullptr> + constexpr expected_storage_base(in_place_t, std::initializer_list il, + Args &&...args) + : m_val(il, std::forward(args)...), m_has_val(true) {} + template ::value> * = + nullptr> + constexpr explicit expected_storage_base(unexpect_t, Args &&...args) + : m_unexpect(std::forward(args)...), m_has_val(false) {} - expected_move_assign_base & - operator=(const expected_move_assign_base &rhs) = default; + template &, Args &&...>::value> * = nullptr> + constexpr explicit expected_storage_base(unexpect_t, + std::initializer_list il, + Args &&...args) + : m_unexpect(il, std::forward(args)...), m_has_val(false) {} - expected_move_assign_base & - operator=(expected_move_assign_base &&rhs) noexcept( - std::is_nothrow_move_constructible::value - &&std::is_nothrow_move_assignable::value) { - this->assign(std::move(rhs)); - return *this; + ~expected_storage_base() { + if (!m_has_val) { + m_unexpect.~unexpected(); + } } -}; -// expected_delete_ctor_base will conditionally delete copy and move -// constructors depending on whether T is copy/move constructible -template ::value && - std::is_copy_constructible::value), - bool EnableMove = (is_move_constructible_or_void::value && - std::is_move_constructible::value)> -struct expected_delete_ctor_base { - expected_delete_ctor_base() = default; - expected_delete_ctor_base(const expected_delete_ctor_base &) = default; - expected_delete_ctor_base(expected_delete_ctor_base &&) noexcept = default; - expected_delete_ctor_base & - operator=(const expected_delete_ctor_base &) = default; - expected_delete_ctor_base & - operator=(expected_delete_ctor_base &&) noexcept = default; + union { + T m_val; + unexpected m_unexpect; + char m_no_init; + }; + bool m_has_val; }; +// E is trivial, T is not. template -struct expected_delete_ctor_base { - expected_delete_ctor_base() = default; - expected_delete_ctor_base(const expected_delete_ctor_base &) = default; - expected_delete_ctor_base(expected_delete_ctor_base &&) noexcept = delete; - expected_delete_ctor_base & - operator=(const expected_delete_ctor_base &) = default; - expected_delete_ctor_base & - operator=(expected_delete_ctor_base &&) noexcept = default; -}; +struct expected_storage_base { + constexpr expected_storage_base() : m_val(T{}), m_has_val(true) {} + constexpr expected_storage_base(no_init_t) : m_no_init(), m_has_val(false) {} -template -struct expected_delete_ctor_base { - expected_delete_ctor_base() = default; - expected_delete_ctor_base(const expected_delete_ctor_base &) = delete; - expected_delete_ctor_base(expected_delete_ctor_base &&) noexcept = default; - expected_delete_ctor_base & - operator=(const expected_delete_ctor_base &) = default; - expected_delete_ctor_base & - operator=(expected_delete_ctor_base &&) noexcept = default; -}; + template ::value> * = + nullptr> + constexpr expected_storage_base(in_place_t, Args &&...args) + : m_val(std::forward(args)...), m_has_val(true) {} -template -struct expected_delete_ctor_base { - expected_delete_ctor_base() = default; - expected_delete_ctor_base(const expected_delete_ctor_base &) = delete; - expected_delete_ctor_base(expected_delete_ctor_base &&) noexcept = delete; - expected_delete_ctor_base & - operator=(const expected_delete_ctor_base &) = default; - expected_delete_ctor_base & - operator=(expected_delete_ctor_base &&) noexcept = default; -}; + template &, Args &&...>::value> * = nullptr> + constexpr expected_storage_base(in_place_t, std::initializer_list il, + Args &&...args) + : m_val(il, std::forward(args)...), m_has_val(true) {} + template ::value> * = + nullptr> + constexpr explicit expected_storage_base(unexpect_t, Args &&...args) + : m_unexpect(std::forward(args)...), m_has_val(false) {} -// expected_delete_assign_base will conditionally delete copy and move -// constructors depending on whether T and E are copy/move constructible + -// assignable -template ::value && - std::is_copy_constructible::value && - is_copy_assignable_or_void::value && - std::is_copy_assignable::value), - bool EnableMove = (is_move_constructible_or_void::value && - std::is_move_constructible::value && - is_move_assignable_or_void::value && - std::is_move_assignable::value)> -struct expected_delete_assign_base { - expected_delete_assign_base() = default; - expected_delete_assign_base(const expected_delete_assign_base &) = default; - expected_delete_assign_base(expected_delete_assign_base &&) noexcept = - default; - expected_delete_assign_base & - operator=(const expected_delete_assign_base &) = default; - expected_delete_assign_base & - operator=(expected_delete_assign_base &&) noexcept = default; -}; + template &, Args &&...>::value> * = nullptr> + constexpr explicit expected_storage_base(unexpect_t, + std::initializer_list il, + Args &&...args) + : m_unexpect(il, std::forward(args)...), m_has_val(false) {} -template -struct expected_delete_assign_base { - expected_delete_assign_base() = default; - expected_delete_assign_base(const expected_delete_assign_base &) = default; - expected_delete_assign_base(expected_delete_assign_base &&) noexcept = - default; - expected_delete_assign_base & - operator=(const expected_delete_assign_base &) = default; - expected_delete_assign_base & - operator=(expected_delete_assign_base &&) noexcept = delete; + ~expected_storage_base() { + if (m_has_val) { + m_val.~T(); + } + } + union { + T m_val; + unexpected m_unexpect; + char m_no_init; + }; + bool m_has_val; }; -template -struct expected_delete_assign_base { - expected_delete_assign_base() = default; - expected_delete_assign_base(const expected_delete_assign_base &) = default; - expected_delete_assign_base(expected_delete_assign_base &&) noexcept = - default; - expected_delete_assign_base & - operator=(const expected_delete_assign_base &) = delete; - expected_delete_assign_base & - operator=(expected_delete_assign_base &&) noexcept = default; -}; +// `T` is `void`, `E` is trivially-destructible +template +struct expected_storage_base { +#if __GNUC__ <= 5 +// no constexpr for GCC 4/5 bug +#else + TL_EXPECTED_MSVC2015_CONSTEXPR +#endif + expected_storage_base() : m_has_val(true) {} -template -struct expected_delete_assign_base { - expected_delete_assign_base() = default; - expected_delete_assign_base(const expected_delete_assign_base &) = default; - expected_delete_assign_base(expected_delete_assign_base &&) noexcept = - default; - expected_delete_assign_base & - operator=(const expected_delete_assign_base &) = delete; - expected_delete_assign_base & - operator=(expected_delete_assign_base &&) noexcept = delete; -}; + constexpr expected_storage_base(no_init_t) : m_val(), m_has_val(false) {} -// This is needed to be able to construct the expected_default_ctor_base which -// follows, while still conditionally deleting the default constructor. -struct default_constructor_tag { - explicit constexpr default_constructor_tag() = default; -}; + constexpr expected_storage_base(in_place_t) : m_has_val(true) {} -// expected_default_ctor_base will ensure that expected has a deleted default -// consturctor if T is not default constructible. -// This specialization is for when T is default constructible -template ::value || std::is_void::value> -struct expected_default_ctor_base { - constexpr expected_default_ctor_base() noexcept = default; - constexpr expected_default_ctor_base( - expected_default_ctor_base const &) noexcept = default; - constexpr expected_default_ctor_base(expected_default_ctor_base &&) noexcept = - default; - expected_default_ctor_base & - operator=(expected_default_ctor_base const &) noexcept = default; - expected_default_ctor_base & - operator=(expected_default_ctor_base &&) noexcept = default; + template ::value> * = + nullptr> + constexpr explicit expected_storage_base(unexpect_t, Args &&...args) + : m_unexpect(std::forward(args)...), m_has_val(false) {} - constexpr explicit expected_default_ctor_base(default_constructor_tag) {} -}; - -// This specialization is for when T is not default constructible -template struct expected_default_ctor_base { - constexpr expected_default_ctor_base() noexcept = delete; - constexpr expected_default_ctor_base( - expected_default_ctor_base const &) noexcept = default; - constexpr expected_default_ctor_base(expected_default_ctor_base &&) noexcept = - default; - expected_default_ctor_base & - operator=(expected_default_ctor_base const &) noexcept = default; - expected_default_ctor_base & - operator=(expected_default_ctor_base &&) noexcept = default; + template &, Args &&...>::value> * = nullptr> + constexpr explicit expected_storage_base(unexpect_t, + std::initializer_list il, + Args &&...args) + : m_unexpect(il, std::forward(args)...), m_has_val(false) {} - constexpr explicit expected_default_ctor_base(default_constructor_tag) {} + ~expected_storage_base() = default; + struct dummy {}; + union { + unexpected m_unexpect; + dummy m_val; + }; + bool m_has_val; }; -} // namespace detail -template class bad_expected_access : public std::exception { -public: - explicit bad_expected_access(E e) : m_val(std::move(e)) {} +// `T` is `void`, `E` is not trivially-destructible +template +struct expected_storage_base { + constexpr expected_storage_base() : m_dummy(), m_has_val(true) {} + constexpr expected_storage_base(no_init_t) : m_dummy(), m_has_val(false) {} - virtual const char *what() const noexcept override { - return "Bad expected access"; - } + constexpr expected_storage_base(in_place_t) : m_dummy(), m_has_val(true) {} - const E &error() const & { return m_val; } - E &error() & { return m_val; } - const E &&error() const && { return std::move(m_val); } - E &&error() && { return std::move(m_val); } + template ::value> * = + nullptr> + constexpr explicit expected_storage_base(unexpect_t, Args &&...args) + : m_unexpect(std::forward(args)...), m_has_val(false) {} -private: - E m_val; + template &, Args &&...>::value> * = nullptr> + constexpr explicit expected_storage_base(unexpect_t, + std::initializer_list il, + Args &&...args) + : m_unexpect(il, std::forward(args)...), m_has_val(false) {} + + ~expected_storage_base() { + if (!m_has_val) { + m_unexpect.~unexpected(); + } + } + + union { + unexpected m_unexpect; + char m_dummy; + }; + bool m_has_val; }; -/// An `expected` object is an object that contains the storage for -/// another object and manages the lifetime of this contained object `T`. -/// Alternatively it could contain the storage for another unexpected object -/// `E`. The contained object may not be initialized after the expected object -/// has been initialized, and may not be destroyed before the expected object -/// has been destroyed. The initialization state of the contained object is -/// tracked by the expected object. +// This base class provides some handy member functions which can be used in +// further derived classes template -class expected : private detail::expected_move_assign_base, - private detail::expected_delete_ctor_base, - private detail::expected_delete_assign_base, - private detail::expected_default_ctor_base { - static_assert(!std::is_reference::value, "T must not be a reference"); - static_assert(!std::is_same::type>::value, - "T must not be in_place_t"); - static_assert(!std::is_same::type>::value, - "T must not be unexpect_t"); - static_assert( - !std::is_same>::type>::value, - "T must not be unexpected"); - static_assert(!std::is_reference::value, "E must not be a reference"); +struct expected_operations_base : expected_storage_base { + using expected_storage_base::expected_storage_base; - T *valptr() { return std::addressof(this->m_val); } - const T *valptr() const { return std::addressof(this->m_val); } - unexpected *errptr() { return std::addressof(this->m_unexpect); } - const unexpected *errptr() const { - return std::addressof(this->m_unexpect); + template + void construct(Args &&...args) noexcept { + new (std::addressof(this->m_val)) T(std::forward(args)...); + this->m_has_val = true; } - template ::value> * = nullptr> - TL_EXPECTED_11_CONSTEXPR U &val() { - return this->m_val; + template + void construct_with(Rhs &&rhs) noexcept { + new (std::addressof(this->m_val)) T(std::forward(rhs).get()); + this->m_has_val = true; } - TL_EXPECTED_11_CONSTEXPR unexpected &err() { return this->m_unexpect; } - template ::value> * = nullptr> - constexpr const U &val() const { - return this->m_val; + template + void construct_error(Args &&...args) noexcept { + new (std::addressof(this->m_unexpect)) + unexpected(std::forward(args)...); + this->m_has_val = false; } - constexpr const unexpected &err() const { return this->m_unexpect; } - - using impl_base = detail::expected_move_assign_base; - using ctor_base = detail::expected_default_ctor_base; -public: - typedef T value_type; - typedef E error_type; - typedef unexpected unexpected_type; +#ifdef TL_EXPECTED_EXCEPTIONS_ENABLED -#if defined(TL_EXPECTED_CXX14) && !defined(TL_EXPECTED_GCC49) && \ - !defined(TL_EXPECTED_GCC54) && !defined(TL_EXPECTED_GCC55) - template TL_EXPECTED_11_CONSTEXPR auto and_then(F &&f) & { - return and_then_impl(*this, std::forward(f)); + // These assign overloads ensure that the most efficient assignment + // implementation is used while maintaining the strong exception guarantee. + // The problematic case is where rhs has a value, but *this does not. + // + // This overload handles the case where we can just copy-construct `T` + // directly into place without throwing. + template ::value> + * = nullptr> + void assign(const expected_operations_base &rhs) noexcept { + if (!this->m_has_val && rhs.m_has_val) { + geterr().~unexpected(); + construct(rhs.get()); + } else { + assign_common(rhs); + } } - template TL_EXPECTED_11_CONSTEXPR auto and_then(F &&f) && { - return and_then_impl(std::move(*this), std::forward(f)); + + // This overload handles the case where we can attempt to create a copy of + // `T`, then no-throw move it into place if the copy was successful. + template ::value && + std::is_nothrow_move_constructible::value> + * = nullptr> + void assign(const expected_operations_base &rhs) noexcept { + if (!this->m_has_val && rhs.m_has_val) { + T tmp = rhs.get(); + geterr().~unexpected(); + construct(std::move(tmp)); + } else { + assign_common(rhs); + } } - template constexpr auto and_then(F &&f) const & { - return and_then_impl(*this, std::forward(f)); + + // This overload is the worst-case, where we have to move-construct the + // unexpected value into temporary storage, then try to copy the T into place. + // If the construction succeeds, then everything is fine, but if it throws, + // then we move the old unexpected value back into place before rethrowing the + // exception. + template ::value && + !std::is_nothrow_move_constructible::value> + * = nullptr> + void assign(const expected_operations_base &rhs) { + if (!this->m_has_val && rhs.m_has_val) { + auto tmp = std::move(geterr()); + geterr().~unexpected(); + +#ifdef TL_EXPECTED_EXCEPTIONS_ENABLED + try { + construct(rhs.get()); + } catch (...) { + geterr() = std::move(tmp); + throw; + } +#else + construct(rhs.get()); +#endif + } else { + assign_common(rhs); + } } -#ifndef TL_EXPECTED_NO_CONSTRR - template constexpr auto and_then(F &&f) const && { - return and_then_impl(std::move(*this), std::forward(f)); + // These overloads do the same as above, but for rvalues + template ::value> + * = nullptr> + void assign(expected_operations_base &&rhs) noexcept { + if (!this->m_has_val && rhs.m_has_val) { + geterr().~unexpected(); + construct(std::move(rhs).get()); + } else { + assign_common(std::move(rhs)); + } } -#endif + template ::value> + * = nullptr> + void assign(expected_operations_base &&rhs) { + if (!this->m_has_val && rhs.m_has_val) { + auto tmp = std::move(geterr()); + geterr().~unexpected(); +#ifdef TL_EXPECTED_EXCEPTIONS_ENABLED + try { + construct(std::move(rhs).get()); + } catch (...) { + geterr() = std::move(tmp); + throw; + } #else - template - TL_EXPECTED_11_CONSTEXPR auto - and_then(F &&f) & -> decltype(and_then_impl(std::declval(), - std::forward(f))) { - return and_then_impl(*this, std::forward(f)); - } - template - TL_EXPECTED_11_CONSTEXPR auto - and_then(F &&f) && -> decltype(and_then_impl(std::declval(), - std::forward(f))) { - return and_then_impl(std::move(*this), std::forward(f)); + construct(std::move(rhs).get()); +#endif + } else { + assign_common(std::move(rhs)); + } } - template - constexpr auto and_then(F &&f) const & -> decltype(and_then_impl( - std::declval(), std::forward(f))) { - return and_then_impl(*this, std::forward(f)); + +#else + + // If exceptions are disabled then we can just copy-construct + void assign(const expected_operations_base &rhs) noexcept { + if (!this->m_has_val && rhs.m_has_val) { + geterr().~unexpected(); + construct(rhs.get()); + } else { + assign_common(rhs); + } } -#ifndef TL_EXPECTED_NO_CONSTRR - template - constexpr auto and_then(F &&f) const && -> decltype(and_then_impl( - std::declval(), std::forward(f))) { - return and_then_impl(std::move(*this), std::forward(f)); + void assign(expected_operations_base &&rhs) noexcept { + if (!this->m_has_val && rhs.m_has_val) { + geterr().~unexpected(); + construct(std::move(rhs).get()); + } else { + assign_common(rhs); + } } -#endif + #endif -#if defined(TL_EXPECTED_CXX14) && !defined(TL_EXPECTED_GCC49) && \ - !defined(TL_EXPECTED_GCC54) && !defined(TL_EXPECTED_GCC55) - template TL_EXPECTED_11_CONSTEXPR auto map(F &&f) & { - return expected_map_impl(*this, std::forward(f)); - } - template TL_EXPECTED_11_CONSTEXPR auto map(F &&f) && { - return expected_map_impl(std::move(*this), std::forward(f)); - } - template constexpr auto map(F &&f) const & { - return expected_map_impl(*this, std::forward(f)); - } - template constexpr auto map(F &&f) const && { - return expected_map_impl(std::move(*this), std::forward(f)); - } -#else - template - TL_EXPECTED_11_CONSTEXPR decltype(expected_map_impl( - std::declval(), std::declval())) - map(F &&f) & { - return expected_map_impl(*this, std::forward(f)); - } - template - TL_EXPECTED_11_CONSTEXPR decltype(expected_map_impl(std::declval(), - std::declval())) - map(F &&f) && { - return expected_map_impl(std::move(*this), std::forward(f)); - } - template - constexpr decltype(expected_map_impl(std::declval(), - std::declval())) - map(F &&f) const & { - return expected_map_impl(*this, std::forward(f)); + // The common part of move/copy assigning + template + void assign_common(Rhs &&rhs) { + if (this->m_has_val) { + if (rhs.m_has_val) { + get() = std::forward(rhs).get(); + } else { + destroy_val(); + construct_error(std::forward(rhs).geterr()); + } + } else { + if (!rhs.m_has_val) { + geterr() = std::forward(rhs).geterr(); + } + } } + bool has_value() const { return this->m_has_val; } + + TL_EXPECTED_11_CONSTEXPR T &get() & { return this->m_val; } + constexpr const T &get() const & { return this->m_val; } + TL_EXPECTED_11_CONSTEXPR T &&get() && { return std::move(this->m_val); } #ifndef TL_EXPECTED_NO_CONSTRR - template - constexpr decltype(expected_map_impl(std::declval(), - std::declval())) - map(F &&f) const && { - return expected_map_impl(std::move(*this), std::forward(f)); - } -#endif + constexpr const T &&get() const && { return std::move(this->m_val); } #endif -#if defined(TL_EXPECTED_CXX14) && !defined(TL_EXPECTED_GCC49) && \ - !defined(TL_EXPECTED_GCC54) && !defined(TL_EXPECTED_GCC55) - template TL_EXPECTED_11_CONSTEXPR auto transform(F &&f) & { - return expected_map_impl(*this, std::forward(f)); + TL_EXPECTED_11_CONSTEXPR unexpected &geterr() & { + return this->m_unexpect; } - template TL_EXPECTED_11_CONSTEXPR auto transform(F &&f) && { - return expected_map_impl(std::move(*this), std::forward(f)); + constexpr const unexpected &geterr() const & { return this->m_unexpect; } + TL_EXPECTED_11_CONSTEXPR unexpected &&geterr() && { + return std::move(this->m_unexpect); } - template constexpr auto transform(F &&f) const & { - return expected_map_impl(*this, std::forward(f)); +#ifndef TL_EXPECTED_NO_CONSTRR + constexpr const unexpected &&geterr() const && { + return std::move(this->m_unexpect); } - template constexpr auto transform(F &&f) const && { - return expected_map_impl(std::move(*this), std::forward(f)); +#endif + + TL_EXPECTED_11_CONSTEXPR void destroy_val() { get().~T(); } +}; + +// This base class provides some handy member functions which can be used in +// further derived classes +template +struct expected_operations_base : expected_storage_base { + using expected_storage_base::expected_storage_base; + + template + void construct() noexcept { + this->m_has_val = true; } -#else - template - TL_EXPECTED_11_CONSTEXPR decltype(expected_map_impl( - std::declval(), std::declval())) - transform(F &&f) & { - return expected_map_impl(*this, std::forward(f)); + + // This function doesn't use its argument, but needs it so that code in + // levels above this can work independently of whether T is void + template + void construct_with(Rhs &&) noexcept { + this->m_has_val = true; } - template - TL_EXPECTED_11_CONSTEXPR decltype(expected_map_impl(std::declval(), - std::declval())) - transform(F &&f) && { - return expected_map_impl(std::move(*this), std::forward(f)); + + template + void construct_error(Args &&...args) noexcept { + new (std::addressof(this->m_unexpect)) + unexpected(std::forward(args)...); + this->m_has_val = false; } - template - constexpr decltype(expected_map_impl(std::declval(), - std::declval())) - transform(F &&f) const & { - return expected_map_impl(*this, std::forward(f)); + + template + void assign(Rhs &&rhs) noexcept { + if (!this->m_has_val) { + if (rhs.m_has_val) { + geterr().~unexpected(); + construct(); + } else { + geterr() = std::forward(rhs).geterr(); + } + } else { + if (!rhs.m_has_val) { + construct_error(std::forward(rhs).geterr()); + } + } } + bool has_value() const { return this->m_has_val; } + + TL_EXPECTED_11_CONSTEXPR unexpected &geterr() & { + return this->m_unexpect; + } + constexpr const unexpected &geterr() const & { return this->m_unexpect; } + TL_EXPECTED_11_CONSTEXPR unexpected &&geterr() && { + return std::move(this->m_unexpect); + } #ifndef TL_EXPECTED_NO_CONSTRR - template - constexpr decltype(expected_map_impl(std::declval(), - std::declval())) - transform(F &&f) const && { - return expected_map_impl(std::move(*this), std::forward(f)); + constexpr const unexpected &&geterr() const && { + return std::move(this->m_unexpect); } #endif -#endif -#if defined(TL_EXPECTED_CXX14) && !defined(TL_EXPECTED_GCC49) && \ - !defined(TL_EXPECTED_GCC54) && !defined(TL_EXPECTED_GCC55) - template TL_EXPECTED_11_CONSTEXPR auto map_error(F &&f) & { - return map_error_impl(*this, std::forward(f)); - } - template TL_EXPECTED_11_CONSTEXPR auto map_error(F &&f) && { - return map_error_impl(std::move(*this), std::forward(f)); - } - template constexpr auto map_error(F &&f) const & { - return map_error_impl(*this, std::forward(f)); + TL_EXPECTED_11_CONSTEXPR void destroy_val() { + // no-op } - template constexpr auto map_error(F &&f) const && { - return map_error_impl(std::move(*this), std::forward(f)); +}; + +// This class manages conditionally having a trivial copy constructor +// This specialization is for when T and E are trivially copy constructible +template :: + value &&TL_EXPECTED_IS_TRIVIALLY_COPY_CONSTRUCTIBLE(E)::value> +struct expected_copy_base : expected_operations_base { + using expected_operations_base::expected_operations_base; +}; + +// This specialization is for when T or E are not trivially copy constructible +template +struct expected_copy_base : expected_operations_base { + using expected_operations_base::expected_operations_base; + + expected_copy_base() = default; + expected_copy_base(const expected_copy_base &rhs) + : expected_operations_base(no_init) { + if (rhs.has_value()) { + this->construct_with(rhs); + } else { + this->construct_error(rhs.geterr()); + } } + + expected_copy_base(expected_copy_base &&rhs) = default; + expected_copy_base &operator=(const expected_copy_base &rhs) = default; + expected_copy_base &operator=(expected_copy_base &&rhs) = default; +}; + +// This class manages conditionally having a trivial move constructor +// Unfortunately there's no way to achieve this in GCC < 5 AFAIK, since it +// doesn't implement an analogue to std::is_trivially_move_constructible. We +// have to make do with a non-trivial move constructor even if T is trivially +// move constructible +#ifndef TL_EXPECTED_GCC49 +template >::value + &&std::is_trivially_move_constructible::value> +struct expected_move_base : expected_copy_base { + using expected_copy_base::expected_copy_base; +}; #else - template - TL_EXPECTED_11_CONSTEXPR decltype(map_error_impl(std::declval(), - std::declval())) - map_error(F &&f) & { - return map_error_impl(*this, std::forward(f)); - } - template - TL_EXPECTED_11_CONSTEXPR decltype(map_error_impl(std::declval(), - std::declval())) - map_error(F &&f) && { - return map_error_impl(std::move(*this), std::forward(f)); - } - template - constexpr decltype(map_error_impl(std::declval(), - std::declval())) - map_error(F &&f) const & { - return map_error_impl(*this, std::forward(f)); - } +template +struct expected_move_base; +#endif +template +struct expected_move_base : expected_copy_base { + using expected_copy_base::expected_copy_base; -#ifndef TL_EXPECTED_NO_CONSTRR - template - constexpr decltype(map_error_impl(std::declval(), - std::declval())) - map_error(F &&f) const && { - return map_error_impl(std::move(*this), std::forward(f)); + expected_move_base() = default; + expected_move_base(const expected_move_base &rhs) = default; + + expected_move_base(expected_move_base &&rhs) noexcept( + std::is_nothrow_move_constructible::value) + : expected_copy_base(no_init) { + if (rhs.has_value()) { + this->construct_with(std::move(rhs)); + } else { + this->construct_error(std::move(rhs.geterr())); + } } -#endif -#endif - template expected TL_EXPECTED_11_CONSTEXPR or_else(F &&f) & { - return or_else_impl(*this, std::forward(f)); + expected_move_base &operator=(const expected_move_base &rhs) = default; + expected_move_base &operator=(expected_move_base &&rhs) = default; +}; + +// This class manages conditionally having a trivial copy assignment operator +template >::value + &&TL_EXPECTED_IS_TRIVIALLY_COPY_ASSIGNABLE(E)::value + &&TL_EXPECTED_IS_TRIVIALLY_COPY_CONSTRUCTIBLE(E)::value + &&TL_EXPECTED_IS_TRIVIALLY_DESTRUCTIBLE(E)::value> +struct expected_copy_assign_base : expected_move_base { + using expected_move_base::expected_move_base; +}; + +template +struct expected_copy_assign_base : expected_move_base { + using expected_move_base::expected_move_base; + + expected_copy_assign_base() = default; + expected_copy_assign_base(const expected_copy_assign_base &rhs) = default; + + expected_copy_assign_base(expected_copy_assign_base &&rhs) = default; + expected_copy_assign_base &operator=(const expected_copy_assign_base &rhs) { + this->assign(rhs); + return *this; } + expected_copy_assign_base &operator=(expected_copy_assign_base &&rhs) = + default; +}; + +// This class manages conditionally having a trivial move assignment operator +// Unfortunately there's no way to achieve this in GCC < 5 AFAIK, since it +// doesn't implement an analogue to std::is_trivially_move_assignable. We have +// to make do with a non-trivial move assignment operator even if T is trivially +// move assignable +#ifndef TL_EXPECTED_GCC49 +template , + std::is_trivially_move_constructible, + std::is_trivially_move_assignable>>:: + value &&std::is_trivially_destructible::value + &&std::is_trivially_move_constructible::value + &&std::is_trivially_move_assignable::value> +struct expected_move_assign_base : expected_copy_assign_base { + using expected_copy_assign_base::expected_copy_assign_base; +}; +#else +template +struct expected_move_assign_base; +#endif + +template +struct expected_move_assign_base + : expected_copy_assign_base { + using expected_copy_assign_base::expected_copy_assign_base; + + expected_move_assign_base() = default; + expected_move_assign_base(const expected_move_assign_base &rhs) = default; + + expected_move_assign_base(expected_move_assign_base &&rhs) = default; + + expected_move_assign_base &operator=(const expected_move_assign_base &rhs) = + default; + + expected_move_assign_base & + operator=(expected_move_assign_base &&rhs) noexcept( + std::is_nothrow_move_constructible::value + &&std::is_nothrow_move_assignable::value) { + this->assign(std::move(rhs)); + return *this; + } +}; + +// expected_delete_ctor_base will conditionally delete copy and move +// constructors depending on whether T is copy/move constructible +template ::value && + std::is_copy_constructible::value), + bool EnableMove = (is_move_constructible_or_void::value && + std::is_move_constructible::value)> +struct expected_delete_ctor_base { + expected_delete_ctor_base() = default; + expected_delete_ctor_base(const expected_delete_ctor_base &) = default; + expected_delete_ctor_base(expected_delete_ctor_base &&) noexcept = default; + expected_delete_ctor_base &operator=(const expected_delete_ctor_base &) = + default; + expected_delete_ctor_base &operator=(expected_delete_ctor_base &&) noexcept = + default; +}; + +template +struct expected_delete_ctor_base { + expected_delete_ctor_base() = default; + expected_delete_ctor_base(const expected_delete_ctor_base &) = default; + expected_delete_ctor_base(expected_delete_ctor_base &&) noexcept = delete; + expected_delete_ctor_base &operator=(const expected_delete_ctor_base &) = + default; + expected_delete_ctor_base &operator=(expected_delete_ctor_base &&) noexcept = + default; +}; + +template +struct expected_delete_ctor_base { + expected_delete_ctor_base() = default; + expected_delete_ctor_base(const expected_delete_ctor_base &) = delete; + expected_delete_ctor_base(expected_delete_ctor_base &&) noexcept = default; + expected_delete_ctor_base &operator=(const expected_delete_ctor_base &) = + default; + expected_delete_ctor_base &operator=(expected_delete_ctor_base &&) noexcept = + default; +}; + +template +struct expected_delete_ctor_base { + expected_delete_ctor_base() = default; + expected_delete_ctor_base(const expected_delete_ctor_base &) = delete; + expected_delete_ctor_base(expected_delete_ctor_base &&) noexcept = delete; + expected_delete_ctor_base &operator=(const expected_delete_ctor_base &) = + default; + expected_delete_ctor_base &operator=(expected_delete_ctor_base &&) noexcept = + default; +}; + +// expected_delete_assign_base will conditionally delete copy and move +// constructors depending on whether T and E are copy/move constructible + +// assignable +template ::value && + std::is_copy_constructible::value && + is_copy_assignable_or_void::value && + std::is_copy_assignable::value), + bool EnableMove = (is_move_constructible_or_void::value && + std::is_move_constructible::value && + is_move_assignable_or_void::value && + std::is_move_assignable::value)> +struct expected_delete_assign_base { + expected_delete_assign_base() = default; + expected_delete_assign_base(const expected_delete_assign_base &) = default; + expected_delete_assign_base(expected_delete_assign_base &&) noexcept = + default; + expected_delete_assign_base &operator=(const expected_delete_assign_base &) = + default; + expected_delete_assign_base &operator=( + expected_delete_assign_base &&) noexcept = default; +}; + +template +struct expected_delete_assign_base { + expected_delete_assign_base() = default; + expected_delete_assign_base(const expected_delete_assign_base &) = default; + expected_delete_assign_base(expected_delete_assign_base &&) noexcept = + default; + expected_delete_assign_base &operator=(const expected_delete_assign_base &) = + default; + expected_delete_assign_base &operator=( + expected_delete_assign_base &&) noexcept = delete; +}; + +template +struct expected_delete_assign_base { + expected_delete_assign_base() = default; + expected_delete_assign_base(const expected_delete_assign_base &) = default; + expected_delete_assign_base(expected_delete_assign_base &&) noexcept = + default; + expected_delete_assign_base &operator=(const expected_delete_assign_base &) = + delete; + expected_delete_assign_base &operator=( + expected_delete_assign_base &&) noexcept = default; +}; + +template +struct expected_delete_assign_base { + expected_delete_assign_base() = default; + expected_delete_assign_base(const expected_delete_assign_base &) = default; + expected_delete_assign_base(expected_delete_assign_base &&) noexcept = + default; + expected_delete_assign_base &operator=(const expected_delete_assign_base &) = + delete; + expected_delete_assign_base &operator=( + expected_delete_assign_base &&) noexcept = delete; +}; + +// This is needed to be able to construct the expected_default_ctor_base which +// follows, while still conditionally deleting the default constructor. +struct default_constructor_tag { + explicit constexpr default_constructor_tag() = default; +}; + +// expected_default_ctor_base will ensure that expected has a deleted default +// consturctor if T is not default constructible. +// This specialization is for when T is default constructible +template ::value || std::is_void::value> +struct expected_default_ctor_base { + constexpr expected_default_ctor_base() noexcept = default; + constexpr expected_default_ctor_base( + expected_default_ctor_base const &) noexcept = default; + constexpr expected_default_ctor_base(expected_default_ctor_base &&) noexcept = + default; + expected_default_ctor_base &operator=( + expected_default_ctor_base const &) noexcept = default; + expected_default_ctor_base &operator=( + expected_default_ctor_base &&) noexcept = default; + + constexpr explicit expected_default_ctor_base(default_constructor_tag) {} +}; + +// This specialization is for when T is not default constructible +template +struct expected_default_ctor_base { + constexpr expected_default_ctor_base() noexcept = delete; + constexpr expected_default_ctor_base( + expected_default_ctor_base const &) noexcept = default; + constexpr expected_default_ctor_base(expected_default_ctor_base &&) noexcept = + default; + expected_default_ctor_base &operator=( + expected_default_ctor_base const &) noexcept = default; + expected_default_ctor_base &operator=( + expected_default_ctor_base &&) noexcept = default; + + constexpr explicit expected_default_ctor_base(default_constructor_tag) {} +}; +} // namespace detail + +template +class bad_expected_access : public std::exception { + public: + explicit bad_expected_access(E e) : m_val(std::move(e)) {} + + virtual const char *what() const noexcept override { + return "Bad expected access"; + } + + const E &error() const & { return m_val; } + E &error() & { return m_val; } + const E &&error() const && { return std::move(m_val); } + E &&error() && { return std::move(m_val); } + + private: + E m_val; +}; + +/// An `expected` object is an object that contains the storage for +/// another object and manages the lifetime of this contained object `T`. +/// Alternatively it could contain the storage for another unexpected object +/// `E`. The contained object may not be initialized after the expected object +/// has been initialized, and may not be destroyed before the expected object +/// has been destroyed. The initialization state of the contained object is +/// tracked by the expected object. +template +class expected : private detail::expected_move_assign_base, + private detail::expected_delete_ctor_base, + private detail::expected_delete_assign_base, + private detail::expected_default_ctor_base { + static_assert(!std::is_reference::value, "T must not be a reference"); + static_assert(!std::is_same::type>::value, + "T must not be in_place_t"); + static_assert(!std::is_same::type>::value, + "T must not be unexpect_t"); + static_assert( + !std::is_same>::type>::value, + "T must not be unexpected"); + static_assert(!std::is_reference::value, "E must not be a reference"); + + T *valptr() { return std::addressof(this->m_val); } + const T *valptr() const { return std::addressof(this->m_val); } + unexpected *errptr() { return std::addressof(this->m_unexpect); } + const unexpected *errptr() const { + return std::addressof(this->m_unexpect); + } + + template ::value> * = nullptr> + TL_EXPECTED_11_CONSTEXPR U &val() { + return this->m_val; + } + TL_EXPECTED_11_CONSTEXPR unexpected &err() { return this->m_unexpect; } + + template ::value> * = nullptr> + constexpr const U &val() const { + return this->m_val; + } + constexpr const unexpected &err() const { return this->m_unexpect; } + + using impl_base = detail::expected_move_assign_base; + using ctor_base = detail::expected_default_ctor_base; + + public: + typedef T value_type; + typedef E error_type; + typedef unexpected unexpected_type; + +#if defined(TL_EXPECTED_CXX14) && !defined(TL_EXPECTED_GCC49) && \ + !defined(TL_EXPECTED_GCC54) && !defined(TL_EXPECTED_GCC55) + template + TL_EXPECTED_11_CONSTEXPR auto and_then(F &&f) & { + return and_then_impl(*this, std::forward(f)); + } + template + TL_EXPECTED_11_CONSTEXPR auto and_then(F &&f) && { + return and_then_impl(std::move(*this), std::forward(f)); + } + template + constexpr auto and_then(F &&f) const & { + return and_then_impl(*this, std::forward(f)); + } + +#ifndef TL_EXPECTED_NO_CONSTRR + template + constexpr auto and_then(F &&f) const && { + return and_then_impl(std::move(*this), std::forward(f)); + } +#endif + +#else + template + TL_EXPECTED_11_CONSTEXPR auto and_then(F &&f) & -> decltype(and_then_impl( + std::declval(), std::forward(f))) { + return and_then_impl(*this, std::forward(f)); + } + template + TL_EXPECTED_11_CONSTEXPR auto and_then(F &&f) && -> decltype(and_then_impl( + std::declval(), std::forward(f))) { + return and_then_impl(std::move(*this), std::forward(f)); + } + template + constexpr auto and_then(F &&f) const & -> decltype(and_then_impl( + std::declval(), std::forward(f))) { + return and_then_impl(*this, std::forward(f)); + } + +#ifndef TL_EXPECTED_NO_CONSTRR + template + constexpr auto and_then(F &&f) const && -> decltype(and_then_impl( + std::declval(), std::forward(f))) { + return and_then_impl(std::move(*this), std::forward(f)); + } +#endif +#endif + +#if defined(TL_EXPECTED_CXX14) && !defined(TL_EXPECTED_GCC49) && \ + !defined(TL_EXPECTED_GCC54) && !defined(TL_EXPECTED_GCC55) + template + TL_EXPECTED_11_CONSTEXPR auto map(F &&f) & { + return expected_map_impl(*this, std::forward(f)); + } + template + TL_EXPECTED_11_CONSTEXPR auto map(F &&f) && { + return expected_map_impl(std::move(*this), std::forward(f)); + } + template + constexpr auto map(F &&f) const & { + return expected_map_impl(*this, std::forward(f)); + } + template + constexpr auto map(F &&f) const && { + return expected_map_impl(std::move(*this), std::forward(f)); + } +#else + template + TL_EXPECTED_11_CONSTEXPR decltype(expected_map_impl( + std::declval(), std::declval())) + map(F &&f) & { + return expected_map_impl(*this, std::forward(f)); + } + template + TL_EXPECTED_11_CONSTEXPR decltype(expected_map_impl(std::declval(), + std::declval())) + map(F &&f) && { + return expected_map_impl(std::move(*this), std::forward(f)); + } + template + constexpr decltype(expected_map_impl(std::declval(), + std::declval())) + map(F &&f) const & { + return expected_map_impl(*this, std::forward(f)); + } + +#ifndef TL_EXPECTED_NO_CONSTRR + template + constexpr decltype(expected_map_impl(std::declval(), + std::declval())) + map(F &&f) const && { + return expected_map_impl(std::move(*this), std::forward(f)); + } +#endif +#endif + +#if defined(TL_EXPECTED_CXX14) && !defined(TL_EXPECTED_GCC49) && \ + !defined(TL_EXPECTED_GCC54) && !defined(TL_EXPECTED_GCC55) + template + TL_EXPECTED_11_CONSTEXPR auto transform(F &&f) & { + return expected_map_impl(*this, std::forward(f)); + } + template + TL_EXPECTED_11_CONSTEXPR auto transform(F &&f) && { + return expected_map_impl(std::move(*this), std::forward(f)); + } + template + constexpr auto transform(F &&f) const & { + return expected_map_impl(*this, std::forward(f)); + } + template + constexpr auto transform(F &&f) const && { + return expected_map_impl(std::move(*this), std::forward(f)); + } +#else + template + TL_EXPECTED_11_CONSTEXPR decltype(expected_map_impl( + std::declval(), std::declval())) + transform(F &&f) & { + return expected_map_impl(*this, std::forward(f)); + } + template + TL_EXPECTED_11_CONSTEXPR decltype(expected_map_impl(std::declval(), + std::declval())) + transform(F &&f) && { + return expected_map_impl(std::move(*this), std::forward(f)); + } + template + constexpr decltype(expected_map_impl(std::declval(), + std::declval())) + transform(F &&f) const & { + return expected_map_impl(*this, std::forward(f)); + } + +#ifndef TL_EXPECTED_NO_CONSTRR + template + constexpr decltype(expected_map_impl(std::declval(), + std::declval())) + transform(F &&f) const && { + return expected_map_impl(std::move(*this), std::forward(f)); + } +#endif +#endif + +#if defined(TL_EXPECTED_CXX14) && !defined(TL_EXPECTED_GCC49) && \ + !defined(TL_EXPECTED_GCC54) && !defined(TL_EXPECTED_GCC55) + template + TL_EXPECTED_11_CONSTEXPR auto map_error(F &&f) & { + return map_error_impl(*this, std::forward(f)); + } + template + TL_EXPECTED_11_CONSTEXPR auto map_error(F &&f) && { + return map_error_impl(std::move(*this), std::forward(f)); + } + template + constexpr auto map_error(F &&f) const & { + return map_error_impl(*this, std::forward(f)); + } + template + constexpr auto map_error(F &&f) const && { + return map_error_impl(std::move(*this), std::forward(f)); + } +#else + template + TL_EXPECTED_11_CONSTEXPR decltype(map_error_impl(std::declval(), + std::declval())) + map_error(F &&f) & { + return map_error_impl(*this, std::forward(f)); + } + template + TL_EXPECTED_11_CONSTEXPR decltype(map_error_impl(std::declval(), + std::declval())) + map_error(F &&f) && { + return map_error_impl(std::move(*this), std::forward(f)); + } + template + constexpr decltype(map_error_impl(std::declval(), + std::declval())) + map_error(F &&f) const & { + return map_error_impl(*this, std::forward(f)); + } + +#ifndef TL_EXPECTED_NO_CONSTRR + template + constexpr decltype(map_error_impl(std::declval(), + std::declval())) + map_error(F &&f) const && { + return map_error_impl(std::move(*this), std::forward(f)); + } +#endif +#endif + template + expected TL_EXPECTED_11_CONSTEXPR or_else(F &&f) & { + return or_else_impl(*this, std::forward(f)); + } + + template + expected TL_EXPECTED_11_CONSTEXPR or_else(F &&f) && { + return or_else_impl(std::move(*this), std::forward(f)); + } + + template + expected constexpr or_else(F &&f) const & { + return or_else_impl(*this, std::forward(f)); + } + +#ifndef TL_EXPECTED_NO_CONSTRR + template + expected constexpr or_else(F &&f) const && { + return or_else_impl(std::move(*this), std::forward(f)); + } +#endif + constexpr expected() = default; + constexpr expected(const expected &rhs) = default; + constexpr expected(expected &&rhs) = default; + expected &operator=(const expected &rhs) = default; + expected &operator=(expected &&rhs) = default; + + template ::value> * = + nullptr> + constexpr expected(in_place_t, Args &&...args) + : impl_base(in_place, std::forward(args)...), + ctor_base(detail::default_constructor_tag{}) {} + + template &, Args &&...>::value> * = nullptr> + constexpr expected(in_place_t, std::initializer_list il, Args &&...args) + : impl_base(in_place, il, std::forward(args)...), + ctor_base(detail::default_constructor_tag{}) {} + + template ::value> * = + nullptr, + detail::enable_if_t::value> * = + nullptr> + explicit constexpr expected(const unexpected &e) + : impl_base(unexpect, e.value()), + ctor_base(detail::default_constructor_tag{}) {} + + template < + class G = E, + detail::enable_if_t::value> * = + nullptr, + detail::enable_if_t::value> * = nullptr> + constexpr expected(unexpected const &e) + : impl_base(unexpect, e.value()), + ctor_base(detail::default_constructor_tag{}) {} + + template < + class G = E, + detail::enable_if_t::value> * = nullptr, + detail::enable_if_t::value> * = nullptr> + explicit constexpr expected(unexpected &&e) noexcept( + std::is_nothrow_constructible::value) + : impl_base(unexpect, std::move(e.value())), + ctor_base(detail::default_constructor_tag{}) {} + + template < + class G = E, + detail::enable_if_t::value> * = nullptr, + detail::enable_if_t::value> * = nullptr> + constexpr expected(unexpected &&e) noexcept( + std::is_nothrow_constructible::value) + : impl_base(unexpect, std::move(e.value())), + ctor_base(detail::default_constructor_tag{}) {} + + template ::value> * = + nullptr> + constexpr explicit expected(unexpect_t, Args &&...args) + : impl_base(unexpect, std::forward(args)...), + ctor_base(detail::default_constructor_tag{}) {} + + template &, Args &&...>::value> * = nullptr> + constexpr explicit expected(unexpect_t, std::initializer_list il, + Args &&...args) + : impl_base(unexpect, il, std::forward(args)...), + ctor_base(detail::default_constructor_tag{}) {} + + template ::value && + std::is_convertible::value)> * = + nullptr, + detail::expected_enable_from_other + * = nullptr> + explicit TL_EXPECTED_11_CONSTEXPR expected(const expected &rhs) + : ctor_base(detail::default_constructor_tag{}) { + if (rhs.has_value()) { + this->construct(*rhs); + } else { + this->construct_error(rhs.error()); + } + } + + template ::value && + std::is_convertible::value)> * = + nullptr, + detail::expected_enable_from_other + * = nullptr> + TL_EXPECTED_11_CONSTEXPR expected(const expected &rhs) + : ctor_base(detail::default_constructor_tag{}) { + if (rhs.has_value()) { + this->construct(*rhs); + } else { + this->construct_error(rhs.error()); + } + } + + template < + class U, class G, + detail::enable_if_t::value && + std::is_convertible::value)> * = nullptr, + detail::expected_enable_from_other * = nullptr> + explicit TL_EXPECTED_11_CONSTEXPR expected(expected &&rhs) + : ctor_base(detail::default_constructor_tag{}) { + if (rhs.has_value()) { + this->construct(std::move(*rhs)); + } else { + this->construct_error(std::move(rhs.error())); + } + } + + template < + class U, class G, + detail::enable_if_t<(std::is_convertible::value && + std::is_convertible::value)> * = nullptr, + detail::expected_enable_from_other * = nullptr> + TL_EXPECTED_11_CONSTEXPR expected(expected &&rhs) + : ctor_base(detail::default_constructor_tag{}) { + if (rhs.has_value()) { + this->construct(std::move(*rhs)); + } else { + this->construct_error(std::move(rhs.error())); + } + } + + template < + class U = T, + detail::enable_if_t::value> * = nullptr, + detail::expected_enable_forward_value * = nullptr> + explicit TL_EXPECTED_MSVC2015_CONSTEXPR expected(U &&v) + : expected(in_place, std::forward(v)) {} + + template < + class U = T, + detail::enable_if_t::value> * = nullptr, + detail::expected_enable_forward_value * = nullptr> + TL_EXPECTED_MSVC2015_CONSTEXPR expected(U &&v) + : expected(in_place, std::forward(v)) {} + + template < + class U = T, class G = T, + detail::enable_if_t::value> * = + nullptr, + detail::enable_if_t::value> * = nullptr, + detail::enable_if_t< + (!std::is_same, detail::decay_t>::value && + !detail::conjunction, + std::is_same>>::value && + std::is_constructible::value && + std::is_assignable::value && + std::is_nothrow_move_constructible::value)> * = nullptr> + expected &operator=(U &&v) { + if (has_value()) { + val() = std::forward(v); + } else { + err().~unexpected(); + ::new (valptr()) T(std::forward(v)); + this->m_has_val = true; + } + + return *this; + } + + template < + class U = T, class G = T, + detail::enable_if_t::value> * = + nullptr, + detail::enable_if_t::value> * = nullptr, + detail::enable_if_t< + (!std::is_same, detail::decay_t>::value && + !detail::conjunction, + std::is_same>>::value && + std::is_constructible::value && + std::is_assignable::value && + std::is_nothrow_move_constructible::value)> * = nullptr> + expected &operator=(U &&v) { + if (has_value()) { + val() = std::forward(v); + } else { + auto tmp = std::move(err()); + err().~unexpected(); + +#ifdef TL_EXPECTED_EXCEPTIONS_ENABLED + try { + ::new (valptr()) T(std::forward(v)); + this->m_has_val = true; + } catch (...) { + err() = std::move(tmp); + throw; + } +#else + ::new (valptr()) T(std::forward(v)); + this->m_has_val = true; +#endif + } + + return *this; + } + + template ::value && + std::is_assignable::value> * = nullptr> + expected &operator=(const unexpected &rhs) { + if (!has_value()) { + err() = rhs; + } else { + this->destroy_val(); + ::new (errptr()) unexpected(rhs); + this->m_has_val = false; + } + + return *this; + } + + template ::value && + std::is_move_assignable::value> * = nullptr> + expected &operator=(unexpected &&rhs) noexcept { + if (!has_value()) { + err() = std::move(rhs); + } else { + this->destroy_val(); + ::new (errptr()) unexpected(std::move(rhs)); + this->m_has_val = false; + } + + return *this; + } + + template ::value> * = nullptr> + void emplace(Args &&...args) { + if (has_value()) { + val().~T(); + } else { + err().~unexpected(); + this->m_has_val = true; + } + ::new (valptr()) T(std::forward(args)...); + } + + template ::value> * = nullptr> + void emplace(Args &&...args) { + if (has_value()) { + val().~T(); + ::new (valptr()) T(std::forward(args)...); + } else { + auto tmp = std::move(err()); + err().~unexpected(); + +#ifdef TL_EXPECTED_EXCEPTIONS_ENABLED + try { + ::new (valptr()) T(std::forward(args)...); + this->m_has_val = true; + } catch (...) { + err() = std::move(tmp); + throw; + } +#else + ::new (valptr()) T(std::forward(args)...); + this->m_has_val = true; +#endif + } + } + + template &, Args &&...>::value> * = nullptr> + void emplace(std::initializer_list il, Args &&...args) { + if (has_value()) { + T t(il, std::forward(args)...); + val() = std::move(t); + } else { + err().~unexpected(); + ::new (valptr()) T(il, std::forward(args)...); + this->m_has_val = true; + } + } + + template &, Args &&...>::value> * = nullptr> + void emplace(std::initializer_list il, Args &&...args) { + if (has_value()) { + T t(il, std::forward(args)...); + val() = std::move(t); + } else { + auto tmp = std::move(err()); + err().~unexpected(); + +#ifdef TL_EXPECTED_EXCEPTIONS_ENABLED + try { + ::new (valptr()) T(il, std::forward(args)...); + this->m_has_val = true; + } catch (...) { + err() = std::move(tmp); + throw; + } +#else + ::new (valptr()) T(il, std::forward(args)...); + this->m_has_val = true; +#endif + } + } + + private: + using t_is_void = std::true_type; + using t_is_not_void = std::false_type; + using t_is_nothrow_move_constructible = std::true_type; + using move_constructing_t_can_throw = std::false_type; + using e_is_nothrow_move_constructible = std::true_type; + using move_constructing_e_can_throw = std::false_type; + + void swap_where_both_have_value(expected & /*rhs*/, t_is_void) noexcept { + // swapping void is a no-op + } + + void swap_where_both_have_value(expected &rhs, t_is_not_void) { + using std::swap; + swap(val(), rhs.val()); + } + + void swap_where_only_one_has_value(expected &rhs, t_is_void) noexcept( + std::is_nothrow_move_constructible::value) { + ::new (errptr()) unexpected_type(std::move(rhs.err())); + rhs.err().~unexpected_type(); + std::swap(this->m_has_val, rhs.m_has_val); + } + + void swap_where_only_one_has_value(expected &rhs, t_is_not_void) { + swap_where_only_one_has_value_and_t_is_not_void( + rhs, typename std::is_nothrow_move_constructible::type{}, + typename std::is_nothrow_move_constructible::type{}); + } + + void swap_where_only_one_has_value_and_t_is_not_void( + expected &rhs, t_is_nothrow_move_constructible, + e_is_nothrow_move_constructible) noexcept { + auto temp = std::move(val()); + val().~T(); + ::new (errptr()) unexpected_type(std::move(rhs.err())); + rhs.err().~unexpected_type(); + ::new (rhs.valptr()) T(std::move(temp)); + std::swap(this->m_has_val, rhs.m_has_val); + } + + void swap_where_only_one_has_value_and_t_is_not_void( + expected &rhs, t_is_nothrow_move_constructible, + move_constructing_e_can_throw) { + auto temp = std::move(val()); + val().~T(); +#ifdef TL_EXPECTED_EXCEPTIONS_ENABLED + try { + ::new (errptr()) unexpected_type(std::move(rhs.err())); + rhs.err().~unexpected_type(); + ::new (rhs.valptr()) T(std::move(temp)); + std::swap(this->m_has_val, rhs.m_has_val); + } catch (...) { + val() = std::move(temp); + throw; + } +#else + ::new (errptr()) unexpected_type(std::move(rhs.err())); + rhs.err().~unexpected_type(); + ::new (rhs.valptr()) T(std::move(temp)); + std::swap(this->m_has_val, rhs.m_has_val); +#endif + } + + void swap_where_only_one_has_value_and_t_is_not_void( + expected &rhs, move_constructing_t_can_throw, + e_is_nothrow_move_constructible) { + auto temp = std::move(rhs.err()); + rhs.err().~unexpected_type(); +#ifdef TL_EXPECTED_EXCEPTIONS_ENABLED + try { + ::new (rhs.valptr()) T(std::move(val())); + val().~T(); + ::new (errptr()) unexpected_type(std::move(temp)); + std::swap(this->m_has_val, rhs.m_has_val); + } catch (...) { + rhs.err() = std::move(temp); + throw; + } +#else + ::new (rhs.valptr()) T(std::move(val())); + val().~T(); + ::new (errptr()) unexpected_type(std::move(temp)); + std::swap(this->m_has_val, rhs.m_has_val); +#endif + } + + public: + template + detail::enable_if_t::value && + detail::is_swappable::value && + (std::is_nothrow_move_constructible::value || + std::is_nothrow_move_constructible::value)> + swap(expected &rhs) noexcept( + std::is_nothrow_move_constructible::value + &&detail::is_nothrow_swappable::value + &&std::is_nothrow_move_constructible::value + &&detail::is_nothrow_swappable::value) { + if (has_value() && rhs.has_value()) { + swap_where_both_have_value(rhs, typename std::is_void::type{}); + } else if (!has_value() && rhs.has_value()) { + rhs.swap(*this); + } else if (has_value()) { + swap_where_only_one_has_value(rhs, typename std::is_void::type{}); + } else { + using std::swap; + swap(err(), rhs.err()); + } + } + + constexpr const T *operator->() const { return valptr(); } + TL_EXPECTED_11_CONSTEXPR T *operator->() { return valptr(); } + + template ::value> * = nullptr> + constexpr const U &operator*() const & { + return val(); + } + template ::value> * = nullptr> + TL_EXPECTED_11_CONSTEXPR U &operator*() & { + return val(); + } + template ::value> * = nullptr> + constexpr const U &&operator*() const && { + return std::move(val()); + } + template ::value> * = nullptr> + TL_EXPECTED_11_CONSTEXPR U &&operator*() && { + return std::move(val()); + } + + constexpr bool has_value() const noexcept { return this->m_has_val; } + constexpr explicit operator bool() const noexcept { return this->m_has_val; } + + template ::value> * = nullptr> + TL_EXPECTED_11_CONSTEXPR const U &value() const & { + if (!has_value()) + detail::throw_exception(bad_expected_access(err().value())); + return val(); + } + template ::value> * = nullptr> + TL_EXPECTED_11_CONSTEXPR U &value() & { + if (!has_value()) + detail::throw_exception(bad_expected_access(err().value())); + return val(); + } + template ::value> * = nullptr> + TL_EXPECTED_11_CONSTEXPR const U &&value() const && { + if (!has_value()) + detail::throw_exception(bad_expected_access(std::move(err()).value())); + return std::move(val()); + } + template ::value> * = nullptr> + TL_EXPECTED_11_CONSTEXPR U &&value() && { + if (!has_value()) + detail::throw_exception(bad_expected_access(std::move(err()).value())); + return std::move(val()); + } + + constexpr const E &error() const & { return err().value(); } + TL_EXPECTED_11_CONSTEXPR E &error() & { return err().value(); } + constexpr const E &&error() const && { return std::move(err().value()); } + TL_EXPECTED_11_CONSTEXPR E &&error() && { return std::move(err().value()); } + + template + constexpr T value_or(U &&v) const & { + static_assert(std::is_copy_constructible::value && + std::is_convertible::value, + "T must be copy-constructible and convertible to from U&&"); + return bool(*this) ? **this : static_cast(std::forward(v)); + } + template + TL_EXPECTED_11_CONSTEXPR T value_or(U &&v) && { + static_assert(std::is_move_constructible::value && + std::is_convertible::value, + "T must be move-constructible and convertible to from U&&"); + return bool(*this) ? std::move(**this) : static_cast(std::forward(v)); + } +}; + +namespace detail { +template +using exp_t = typename detail::decay_t::value_type; +template +using err_t = typename detail::decay_t::error_type; +template +using ret_t = expected>; + +#ifdef TL_EXPECTED_CXX14 +template >::value> * = nullptr, + class Ret = decltype(detail::invoke(std::declval(), + *std::declval()))> +constexpr auto and_then_impl(Exp &&exp, F &&f) { + static_assert(detail::is_expected::value, "F must return an expected"); + + return exp.has_value() + ? detail::invoke(std::forward(f), *std::forward(exp)) + : Ret(unexpect, std::forward(exp).error()); +} + +template >::value> * = nullptr, + class Ret = decltype(detail::invoke(std::declval()))> +constexpr auto and_then_impl(Exp &&exp, F &&f) { + static_assert(detail::is_expected::value, "F must return an expected"); + + return exp.has_value() ? detail::invoke(std::forward(f)) + : Ret(unexpect, std::forward(exp).error()); +} +#else +template +struct TC; +template (), + *std::declval())), + detail::enable_if_t>::value> * = nullptr> +auto and_then_impl(Exp &&exp, F &&f) -> Ret { + static_assert(detail::is_expected::value, "F must return an expected"); + + return exp.has_value() + ? detail::invoke(std::forward(f), *std::forward(exp)) + : Ret(unexpect, std::forward(exp).error()); +} + +template ())), + detail::enable_if_t>::value> * = nullptr> +constexpr auto and_then_impl(Exp &&exp, F &&f) -> Ret { + static_assert(detail::is_expected::value, "F must return an expected"); + + return exp.has_value() ? detail::invoke(std::forward(f)) + : Ret(unexpect, std::forward(exp).error()); +} +#endif + +#ifdef TL_EXPECTED_CXX14 +template >::value> * = nullptr, + class Ret = decltype(detail::invoke(std::declval(), + *std::declval())), + detail::enable_if_t::value> * = nullptr> +constexpr auto expected_map_impl(Exp &&exp, F &&f) { + using result = ret_t>; + return exp.has_value() ? result(detail::invoke(std::forward(f), + *std::forward(exp))) + : result(unexpect, std::forward(exp).error()); +} + +template >::value> * = nullptr, + class Ret = decltype(detail::invoke(std::declval(), + *std::declval())), + detail::enable_if_t::value> * = nullptr> +auto expected_map_impl(Exp &&exp, F &&f) { + using result = expected>; + if (exp.has_value()) { + detail::invoke(std::forward(f), *std::forward(exp)); + return result(); + } + + return result(unexpect, std::forward(exp).error()); +} + +template >::value> * = nullptr, + class Ret = decltype(detail::invoke(std::declval())), + detail::enable_if_t::value> * = nullptr> +constexpr auto expected_map_impl(Exp &&exp, F &&f) { + using result = ret_t>; + return exp.has_value() ? result(detail::invoke(std::forward(f))) + : result(unexpect, std::forward(exp).error()); +} + +template >::value> * = nullptr, + class Ret = decltype(detail::invoke(std::declval())), + detail::enable_if_t::value> * = nullptr> +auto expected_map_impl(Exp &&exp, F &&f) { + using result = expected>; + if (exp.has_value()) { + detail::invoke(std::forward(f)); + return result(); + } + + return result(unexpect, std::forward(exp).error()); +} +#else +template >::value> * = nullptr, + class Ret = decltype(detail::invoke(std::declval(), + *std::declval())), + detail::enable_if_t::value> * = nullptr> + +constexpr auto expected_map_impl(Exp &&exp, F &&f) + -> ret_t> { + using result = ret_t>; + + return exp.has_value() ? result(detail::invoke(std::forward(f), + *std::forward(exp))) + : result(unexpect, std::forward(exp).error()); +} + +template >::value> * = nullptr, + class Ret = decltype(detail::invoke(std::declval(), + *std::declval())), + detail::enable_if_t::value> * = nullptr> + +auto expected_map_impl(Exp &&exp, F &&f) -> expected> { + if (exp.has_value()) { + detail::invoke(std::forward(f), *std::forward(exp)); + return {}; + } + + return unexpected>(std::forward(exp).error()); +} + +template >::value> * = nullptr, + class Ret = decltype(detail::invoke(std::declval())), + detail::enable_if_t::value> * = nullptr> + +constexpr auto expected_map_impl(Exp &&exp, F &&f) + -> ret_t> { + using result = ret_t>; + + return exp.has_value() ? result(detail::invoke(std::forward(f))) + : result(unexpect, std::forward(exp).error()); +} + +template >::value> * = nullptr, + class Ret = decltype(detail::invoke(std::declval())), + detail::enable_if_t::value> * = nullptr> + +auto expected_map_impl(Exp &&exp, F &&f) -> expected> { + if (exp.has_value()) { + detail::invoke(std::forward(f)); + return {}; + } + + return unexpected>(std::forward(exp).error()); +} +#endif + +#if defined(TL_EXPECTED_CXX14) && !defined(TL_EXPECTED_GCC49) && \ + !defined(TL_EXPECTED_GCC54) && !defined(TL_EXPECTED_GCC55) +template >::value> * = nullptr, + class Ret = decltype(detail::invoke(std::declval(), + std::declval().error())), + detail::enable_if_t::value> * = nullptr> +constexpr auto map_error_impl(Exp &&exp, F &&f) { + using result = expected, detail::decay_t>; + return exp.has_value() + ? result(*std::forward(exp)) + : result(unexpect, detail::invoke(std::forward(f), + std::forward(exp).error())); +} +template >::value> * = nullptr, + class Ret = decltype(detail::invoke(std::declval(), + std::declval().error())), + detail::enable_if_t::value> * = nullptr> +auto map_error_impl(Exp &&exp, F &&f) { + using result = expected, monostate>; + if (exp.has_value()) { + return result(*std::forward(exp)); + } + + detail::invoke(std::forward(f), std::forward(exp).error()); + return result(unexpect, monostate{}); +} +template >::value> * = nullptr, + class Ret = decltype(detail::invoke(std::declval(), + std::declval().error())), + detail::enable_if_t::value> * = nullptr> +constexpr auto map_error_impl(Exp &&exp, F &&f) { + using result = expected, detail::decay_t>; + return exp.has_value() + ? result() + : result(unexpect, detail::invoke(std::forward(f), + std::forward(exp).error())); +} +template >::value> * = nullptr, + class Ret = decltype(detail::invoke(std::declval(), + std::declval().error())), + detail::enable_if_t::value> * = nullptr> +auto map_error_impl(Exp &&exp, F &&f) { + using result = expected, monostate>; + if (exp.has_value()) { + return result(); + } + + detail::invoke(std::forward(f), std::forward(exp).error()); + return result(unexpect, monostate{}); +} +#else +template >::value> * = nullptr, + class Ret = decltype(detail::invoke(std::declval(), + std::declval().error())), + detail::enable_if_t::value> * = nullptr> +constexpr auto map_error_impl(Exp &&exp, F &&f) + -> expected, detail::decay_t> { + using result = expected, detail::decay_t>; + + return exp.has_value() + ? result(*std::forward(exp)) + : result(unexpect, detail::invoke(std::forward(f), + std::forward(exp).error())); +} + +template >::value> * = nullptr, + class Ret = decltype(detail::invoke(std::declval(), + std::declval().error())), + detail::enable_if_t::value> * = nullptr> +auto map_error_impl(Exp &&exp, F &&f) -> expected, monostate> { + using result = expected, monostate>; + if (exp.has_value()) { + return result(*std::forward(exp)); + } + + detail::invoke(std::forward(f), std::forward(exp).error()); + return result(unexpect, monostate{}); +} + +template >::value> * = nullptr, + class Ret = decltype(detail::invoke(std::declval(), + std::declval().error())), + detail::enable_if_t::value> * = nullptr> +constexpr auto map_error_impl(Exp &&exp, F &&f) + -> expected, detail::decay_t> { + using result = expected, detail::decay_t>; + + return exp.has_value() + ? result() + : result(unexpect, detail::invoke(std::forward(f), + std::forward(exp).error())); +} + +template >::value> * = nullptr, + class Ret = decltype(detail::invoke(std::declval(), + std::declval().error())), + detail::enable_if_t::value> * = nullptr> +auto map_error_impl(Exp &&exp, F &&f) -> expected, monostate> { + using result = expected, monostate>; + if (exp.has_value()) { + return result(); + } + + detail::invoke(std::forward(f), std::forward(exp).error()); + return result(unexpect, monostate{}); +} +#endif + +#ifdef TL_EXPECTED_CXX14 +template (), + std::declval().error())), + detail::enable_if_t::value> * = nullptr> +constexpr auto or_else_impl(Exp &&exp, F &&f) { + static_assert(detail::is_expected::value, "F must return an expected"); + return exp.has_value() ? std::forward(exp) + : detail::invoke(std::forward(f), + std::forward(exp).error()); +} + +template (), + std::declval().error())), + detail::enable_if_t::value> * = nullptr> +detail::decay_t or_else_impl(Exp &&exp, F &&f) { + return exp.has_value() ? std::forward(exp) + : (detail::invoke(std::forward(f), + std::forward(exp).error()), + std::forward(exp)); +} +#else +template (), + std::declval().error())), + detail::enable_if_t::value> * = nullptr> +auto or_else_impl(Exp &&exp, F &&f) -> Ret { + static_assert(detail::is_expected::value, "F must return an expected"); + return exp.has_value() ? std::forward(exp) + : detail::invoke(std::forward(f), + std::forward(exp).error()); +} + +template (), + std::declval().error())), + detail::enable_if_t::value> * = nullptr> +detail::decay_t or_else_impl(Exp &&exp, F &&f) { + return exp.has_value() ? std::forward(exp) + : (detail::invoke(std::forward(f), + std::forward(exp).error()), + std::forward(exp)); +} +#endif +} // namespace detail + +template +constexpr bool operator==(const expected &lhs, + const expected &rhs) { + return (lhs.has_value() != rhs.has_value()) + ? false + : (!lhs.has_value() ? lhs.error() == rhs.error() : *lhs == *rhs); +} +template +constexpr bool operator!=(const expected &lhs, + const expected &rhs) { + return (lhs.has_value() != rhs.has_value()) + ? true + : (!lhs.has_value() ? lhs.error() != rhs.error() : *lhs != *rhs); +} +template +constexpr bool operator==(const expected &lhs, + const expected &rhs) { + return (lhs.has_value() != rhs.has_value()) + ? false + : (!lhs.has_value() ? lhs.error() == rhs.error() : true); +} +template +constexpr bool operator!=(const expected &lhs, + const expected &rhs) { + return (lhs.has_value() != rhs.has_value()) + ? true + : (!lhs.has_value() ? lhs.error() == rhs.error() : false); +} + +template +constexpr bool operator==(const expected &x, const U &v) { + return x.has_value() ? *x == v : false; +} +template +constexpr bool operator==(const U &v, const expected &x) { + return x.has_value() ? *x == v : false; +} +template +constexpr bool operator!=(const expected &x, const U &v) { + return x.has_value() ? *x != v : true; +} +template +constexpr bool operator!=(const U &v, const expected &x) { + return x.has_value() ? *x != v : true; +} + +template +constexpr bool operator==(const expected &x, const unexpected &e) { + return x.has_value() ? false : x.error() == e.value(); +} +template +constexpr bool operator==(const unexpected &e, const expected &x) { + return x.has_value() ? false : x.error() == e.value(); +} +template +constexpr bool operator!=(const expected &x, const unexpected &e) { + return x.has_value() ? true : x.error() != e.value(); +} +template +constexpr bool operator!=(const unexpected &e, const expected &x) { + return x.has_value() ? true : x.error() != e.value(); +} + +template ::value || + std::is_move_constructible::value) && + detail::is_swappable::value && + std::is_move_constructible::value && + detail::is_swappable::value> * = nullptr> +void swap(expected &lhs, + expected &rhs) noexcept(noexcept(lhs.swap(rhs))) { + lhs.swap(rhs); +} +} // namespace tl + +#endif +/* end file include/ada/expected.h */ +/* begin file include/ada/url_aggregator.h */ +/** + * @file url_aggregator.h + * @brief Declaration for the basic URL definitions + */ +#ifndef ADA_URL_AGGREGATOR_H +#define ADA_URL_AGGREGATOR_H + + +#include +#include + +namespace ada { + +/** + * @brief Lightweight URL struct. + * + * @details The url_aggregator class aims to minimize temporary memory + * allocation while representing a parsed URL. Internally, it contains a single + * normalized URL (the href), and it makes available the components, mostly + * using std::string_view. + */ +struct url_aggregator : url_base { + url_aggregator() = default; + url_aggregator(const url_aggregator &u) = default; + url_aggregator(url_aggregator &&u) noexcept = default; + url_aggregator &operator=(url_aggregator &&u) noexcept = default; + url_aggregator &operator=(const url_aggregator &u) = default; + ~url_aggregator() = default; + + bool set_href(const std::string_view input); + bool set_host(const std::string_view input); + bool set_hostname(const std::string_view input); + bool set_protocol(const std::string_view input); + bool set_username(const std::string_view input); + bool set_password(const std::string_view input); + bool set_port(const std::string_view input); + bool set_pathname(const std::string_view input); + void set_search(const std::string_view input); + void set_hash(const std::string_view input); + inline void set_scheme(std::string_view new_scheme) noexcept; + /** @private fast function to set the scheme from a view with a colon in the + * buffer, does not change type */ + inline void set_scheme_from_view_with_colon( + std::string_view new_scheme_with_colon) noexcept; + + inline void copy_scheme(const url_aggregator &u) noexcept; + + [[nodiscard]] bool has_valid_domain() const noexcept override; + + /** @private */ + inline bool has_authority() const noexcept; + /** @private set this URL's type to file */ + inline void set_protocol_as_file(); + /** + * The origin getter steps are to return the serialization of this’s URL’s + * origin. [HTML] + * @return a newly allocated string. + * @see https://url.spec.whatwg.org/#concept-url-origin + */ + [[nodiscard]] std::string get_origin() const noexcept override; + /** + * Return the normalized string. + * This function does not allocate memory. + * It is highly efficient. + * @return a constant reference to the underlying normalized URL. + * @see https://url.spec.whatwg.org/#dom-url-href + * @see https://url.spec.whatwg.org/#concept-url-serializer + */ + inline std::string_view get_href() const noexcept; + /** + * The username getter steps are to return this’s URL’s username. + * This function does not allocate memory. + * @return a lightweight std::string_view. + * @see https://url.spec.whatwg.org/#dom-url-username + */ + [[nodiscard]] std::string_view get_username() const noexcept; + /** + * The password getter steps are to return this’s URL’s password. + * This function does not allocate memory. + * @return a lightweight std::string_view. + * @see https://url.spec.whatwg.org/#dom-url-password + */ + [[nodiscard]] std::string_view get_password() const noexcept; + /** + * Return this’s URL’s port, serialized. + * This function does not allocate memory. + * @return a lightweight std::string_view. + * @see https://url.spec.whatwg.org/#dom-url-port + */ + [[nodiscard]] std::string_view get_port() const noexcept; + /** + * Return U+0023 (#), followed by this’s URL’s fragment. + * This function does not allocate memory. + * @return a lightweight std::string_view.. + * @see https://url.spec.whatwg.org/#dom-url-hash + */ + [[nodiscard]] std::string_view get_hash() const noexcept; + /** + * Return url’s host, serialized, followed by U+003A (:) and url’s port, + * serialized. + * This function does not allocate memory. + * When there is no host, this function returns the empty view. + * @return a lightweight std::string_view. + * @see https://url.spec.whatwg.org/#dom-url-host + */ + [[nodiscard]] std::string_view get_host() const noexcept; + /** + * Return this’s URL’s host, serialized. + * This function does not allocate memory. + * When there is no host, this function returns the empty view. + * @return a lightweight std::string_view. + * @see https://url.spec.whatwg.org/#dom-url-hostname + */ + [[nodiscard]] std::string_view get_hostname() const noexcept; + /** + * The pathname getter steps are to return the result of URL path serializing + * this’s URL. + * This function does not allocate memory. + * @return a lightweight std::string_view. + * @see https://url.spec.whatwg.org/#dom-url-pathname + */ + [[nodiscard]] std::string_view get_pathname() const noexcept; + /** + * Returns true if neither the search, nor the hash nor the pathname + * have been set. + * @return true if the buffer is ready to receive the path. + */ + [[nodiscard]] ada_really_inline bool is_at_path() const noexcept; + /** + * Compute the pathname length in bytes witout instantiating a view or a + * string. + * @return size of the pathname in bytes + * @see https://url.spec.whatwg.org/#dom-url-pathname + */ + ada_really_inline uint32_t get_pathname_length() const noexcept; + /** + * Return U+003F (?), followed by this’s URL’s query. + * This function does not allocate memory. + * @return a lightweight std::string_view. + * @see https://url.spec.whatwg.org/#dom-url-search + */ + [[nodiscard]] std::string_view get_search() const noexcept; + /** + * The protocol getter steps are to return this’s URL’s scheme, followed by + * U+003A (:). + * This function does not allocate memory. + * @return a lightweight std::string_view. + * @see https://url.spec.whatwg.org/#dom-url-protocol + */ + [[nodiscard]] std::string_view get_protocol() const noexcept; + + /** + * A URL includes credentials if its username or password is not the empty + * string. + */ + [[nodiscard]] ada_really_inline bool includes_credentials() const noexcept; + + /** + * @private + * + * A URL cannot have a username/password/port if its host is null or the empty + * string, or its scheme is "file". + */ + [[nodiscard]] inline bool cannot_have_credentials_or_port() const; + + /** @private */ + template + bool set_host_or_hostname(const std::string_view input); + + /** @private */ + ada_really_inline bool parse_host(std::string_view input); + + /** @private */ + inline void update_base_authority(std::string_view base_buffer, + const ada::url_components &base); + /** @private */ + inline void update_unencoded_base_hash(std::string_view input); + /** @private */ + inline void update_base_hostname(std::string_view input); + /** @private */ + inline void update_base_search(std::string_view input); + /** @private */ + inline void update_base_search(std::string_view input, + const uint8_t *query_percent_encode_set); + /** @private */ + inline void update_base_pathname(const std::string_view input); + /** @private */ + inline void update_base_username(const std::string_view input); + /** @private */ + inline void append_base_username(const std::string_view input); + /** @private */ + inline void update_base_password(const std::string_view input); + /** @private */ + inline void append_base_password(const std::string_view input); + /** @private */ + inline void update_base_port(uint32_t input); + /** @private */ + inline void append_base_pathname(const std::string_view input); + /** @private */ + inline uint32_t retrieve_base_port() const; + /** @private */ + inline void clear_base_port(); + /** @private if there is no hostname, then this function does nothing, if + * there is, we make it empty */ + inline void clear_base_hostname(); + /** @private */ + inline void clear_base_hash(); + /** @private */ + inline void clear_base_pathname() override; + /** @private */ + inline void clear_base_search() override; + /** @private */ + inline void clear_base_password(); + /** @private */ + inline bool base_fragment_has_value() const override; + /** @private */ + inline bool base_search_has_value() const override; + /** @private */ + inline bool has_dash_dot() const noexcept; + /** @private */ + void delete_dash_dot(); + /** @return true if it has an host but it is the empty string */ + [[nodiscard]] inline bool has_empty_hostname() const noexcept; + /** @return true if it has a host (included an empty host) */ + [[nodiscard]] inline bool has_hostname() const noexcept; + /** @private */ + [[nodiscard]] inline bool has_non_empty_username() const noexcept; + /** @private */ + [[nodiscard]] inline bool has_non_empty_password() const noexcept; + /** @private */ + [[nodiscard]] inline bool has_password() const noexcept; + /** @return true if the URL has a (non default) port */ + [[nodiscard]] inline bool has_port() const noexcept; + /** @private */ + inline void consume_prepared_path(std::string_view input); + /** @private */ + template + [[nodiscard]] ada_really_inline bool parse_scheme_with_colon( + const std::string_view input); + + /** @private */ + ada_really_inline uint32_t replace_and_resize(uint32_t start, uint32_t end, + std::string_view input); + + /** + * Useful for implementing efficient serialization for the URL. + * + * https://user:pass@example.com:1234/foo/bar?baz#quux + * | | | | ^^^^| | | + * | | | | | | | `----- hash_start + * | | | | | | `--------- search_start + * | | | | | `----------------- pathname_start + * | | | | `--------------------- port + * | | | `----------------------- host_end + * | | `---------------------------------- host_start + * | `--------------------------------------- username_end + * `--------------------------------------------- protocol_end + * + * Inspired after servo/url + * + * @return a constant reference to the underlying component attribute. + * + * @see + * https://github.com/servo/rust-url/blob/b65a45515c10713f6d212e6726719a020203cc98/url/src/quirks.rs#L31 + */ + [[nodiscard]] ada_really_inline const ada::url_components &get_components() + const noexcept; + /** + * Returns a string representation of this URL. + */ + std::string to_string() const override; + /** + * Returns a string diagram of this URL. + */ + std::string to_diagram() const; + + /** + * Verifies that the parsed URL could be valid. Useful for debugging purposes. + * @return true if the URL is valid, otherwise return true of the offsets are + * possible. + */ + bool validate() const noexcept; + + /** @private */ + inline void add_authority_slashes_if_needed() noexcept; + + /** + * @private + * To optimize performance, you may indicate how much memory to allocate + * within this instance. + */ + inline void reserve(uint32_t capacity); + + /** @private */ + ada_really_inline size_t + parse_port(std::string_view view, + bool check_trailing_content = false) noexcept override; + + private: + /** @private */ + std::string buffer{}; + + /** @private */ + url_components components{}; + + /** + * @private + * + * Return true on success. + * @see https://url.spec.whatwg.org/#concept-ipv4-parser + */ + [[nodiscard]] bool parse_ipv4(std::string_view input); + + /** + * @private + * + * Return true on success. + * @see https://url.spec.whatwg.org/#concept-ipv6-parser + */ + [[nodiscard]] bool parse_ipv6(std::string_view input); + + /** + * @private + * + * Return true on success. + * @see https://url.spec.whatwg.org/#concept-opaque-host-parser + */ + [[nodiscard]] bool parse_opaque_host(std::string_view input); - template expected TL_EXPECTED_11_CONSTEXPR or_else(F &&f) && { - return or_else_impl(std::move(*this), std::forward(f)); - } + /** @private */ + ada_really_inline void parse_path(std::string_view input); - template expected constexpr or_else(F &&f) const & { - return or_else_impl(*this, std::forward(f)); - } +}; // url_aggregator + +inline std::ostream &operator<<(std::ostream &out, const ada::url &u); +} // namespace ada -#ifndef TL_EXPECTED_NO_CONSTRR - template expected constexpr or_else(F &&f) const && { - return or_else_impl(std::move(*this), std::forward(f)); - } #endif - constexpr expected() = default; - constexpr expected(const expected &rhs) = default; - constexpr expected(expected &&rhs) = default; - expected &operator=(const expected &rhs) = default; - expected &operator=(expected &&rhs) = default; +/* end file include/ada/url_aggregator.h */ - template ::value> * = - nullptr> - constexpr expected(in_place_t, Args &&...args) - : impl_base(in_place, std::forward(args)...), - ctor_base(detail::default_constructor_tag{}) {} +#include +#include - template &, Args &&...>::value> * = nullptr> - constexpr expected(in_place_t, std::initializer_list il, Args &&...args) - : impl_base(in_place, il, std::forward(args)...), - ctor_base(detail::default_constructor_tag{}) {} +/** + * @namespace ada::parser + * @brief Includes the definitions for supported parsers + */ +namespace ada::parser { - template ::value> * = - nullptr, - detail::enable_if_t::value> * = - nullptr> - explicit constexpr expected(const unexpected &e) - : impl_base(unexpect, e.value()), - ctor_base(detail::default_constructor_tag{}) {} +/** + * Parses a url. + */ +template +result_type parse_url(std::string_view user_input, + const result_type* base_url = nullptr); - template < - class G = E, - detail::enable_if_t::value> * = - nullptr, - detail::enable_if_t::value> * = nullptr> - constexpr expected(unexpected const &e) - : impl_base(unexpect, e.value()), - ctor_base(detail::default_constructor_tag{}) {} +extern template url_aggregator parse_url( + std::string_view user_input, const url_aggregator* base_url); +extern template url parse_url(std::string_view user_input, + const url* base_url); - template < - class G = E, - detail::enable_if_t::value> * = nullptr, - detail::enable_if_t::value> * = nullptr> - explicit constexpr expected(unexpected &&e) noexcept( - std::is_nothrow_constructible::value) - : impl_base(unexpect, std::move(e.value())), - ctor_base(detail::default_constructor_tag{}) {} +} // namespace ada::parser - template < - class G = E, - detail::enable_if_t::value> * = nullptr, - detail::enable_if_t::value> * = nullptr> - constexpr expected(unexpected &&e) noexcept( - std::is_nothrow_constructible::value) - : impl_base(unexpect, std::move(e.value())), - ctor_base(detail::default_constructor_tag{}) {} +#endif // ADA_PARSER_H +/* end file include/ada/parser.h */ +/* begin file include/ada/scheme-inl.h */ +/** + * @file scheme-inl.h + * @brief Definitions for the URL scheme. + */ +#ifndef ADA_SCHEME_INL_H +#define ADA_SCHEME_INL_H - template ::value> * = - nullptr> - constexpr explicit expected(unexpect_t, Args &&...args) - : impl_base(unexpect, std::forward(args)...), - ctor_base(detail::default_constructor_tag{}) {} - template &, Args &&...>::value> * = nullptr> - constexpr explicit expected(unexpect_t, std::initializer_list il, - Args &&...args) - : impl_base(unexpect, il, std::forward(args)...), - ctor_base(detail::default_constructor_tag{}) {} +namespace ada::scheme { - template ::value && - std::is_convertible::value)> * = - nullptr, - detail::expected_enable_from_other - * = nullptr> - explicit TL_EXPECTED_11_CONSTEXPR expected(const expected &rhs) - : ctor_base(detail::default_constructor_tag{}) { - if (rhs.has_value()) { - this->construct(*rhs); - } else { - this->construct_error(rhs.error()); - } +/** + * @namespace ada::scheme::details + * @brief Includes the definitions for scheme specific entities + */ +namespace details { +// for use with is_special and get_special_port +// Spaces, if present, are removed from URL. +constexpr std::string_view is_special_list[] = {"http", " ", "https", "ws", + "ftp", "wss", "file", " "}; +// for use with get_special_port +constexpr uint16_t special_ports[] = {80, 0, 443, 80, 21, 443, 0, 0}; +} // namespace details + +ada_really_inline constexpr bool is_special(std::string_view scheme) { + if (scheme.empty()) { + return false; + } + int hash_value = (2 * scheme.size() + (unsigned)(scheme[0])) & 7; + const std::string_view target = details::is_special_list[hash_value]; + return (target[0] == scheme[0]) && (target.substr(1) == scheme.substr(1)); +} +constexpr uint16_t get_special_port(std::string_view scheme) noexcept { + if (scheme.empty()) { + return 0; } - - template ::value && - std::is_convertible::value)> * = - nullptr, - detail::expected_enable_from_other - * = nullptr> - TL_EXPECTED_11_CONSTEXPR expected(const expected &rhs) - : ctor_base(detail::default_constructor_tag{}) { - if (rhs.has_value()) { - this->construct(*rhs); - } else { - this->construct_error(rhs.error()); - } + int hash_value = (2 * scheme.size() + (unsigned)(scheme[0])) & 7; + const std::string_view target = details::is_special_list[hash_value]; + if ((target[0] == scheme[0]) && (target.substr(1) == scheme.substr(1))) { + return details::special_ports[hash_value]; + } else { + return 0; } - - template < - class U, class G, - detail::enable_if_t::value && - std::is_convertible::value)> * = nullptr, - detail::expected_enable_from_other * = nullptr> - explicit TL_EXPECTED_11_CONSTEXPR expected(expected &&rhs) - : ctor_base(detail::default_constructor_tag{}) { - if (rhs.has_value()) { - this->construct(std::move(*rhs)); - } else { - this->construct_error(std::move(rhs.error())); - } +} +constexpr uint16_t get_special_port(ada::scheme::type type) noexcept { + return details::special_ports[int(type)]; +} +constexpr ada::scheme::type get_scheme_type(std::string_view scheme) noexcept { + if (scheme.empty()) { + return ada::scheme::NOT_SPECIAL; } - - template < - class U, class G, - detail::enable_if_t<(std::is_convertible::value && - std::is_convertible::value)> * = nullptr, - detail::expected_enable_from_other * = nullptr> - TL_EXPECTED_11_CONSTEXPR expected(expected &&rhs) - : ctor_base(detail::default_constructor_tag{}) { - if (rhs.has_value()) { - this->construct(std::move(*rhs)); - } else { - this->construct_error(std::move(rhs.error())); - } + int hash_value = (2 * scheme.size() + (unsigned)(scheme[0])) & 7; + const std::string_view target = details::is_special_list[hash_value]; + if ((target[0] == scheme[0]) && (target.substr(1) == scheme.substr(1))) { + return ada::scheme::type(hash_value); + } else { + return ada::scheme::NOT_SPECIAL; } +} - template < - class U = T, - detail::enable_if_t::value> * = nullptr, - detail::expected_enable_forward_value * = nullptr> - explicit TL_EXPECTED_MSVC2015_CONSTEXPR expected(U &&v) - : expected(in_place, std::forward(v)) {} +} // namespace ada::scheme - template < - class U = T, - detail::enable_if_t::value> * = nullptr, - detail::expected_enable_forward_value * = nullptr> - TL_EXPECTED_MSVC2015_CONSTEXPR expected(U &&v) - : expected(in_place, std::forward(v)) {} +#endif // ADA_SCHEME_H +/* end file include/ada/scheme-inl.h */ +/* begin file include/ada/url_base-inl.h */ +/** + * @file url_base-inl.h + * @brief Inline functions for url base + */ +#ifndef ADA_URL_BASE_INL_H +#define ADA_URL_BASE_INL_H - template < - class U = T, class G = T, - detail::enable_if_t::value> * = - nullptr, - detail::enable_if_t::value> * = nullptr, - detail::enable_if_t< - (!std::is_same, detail::decay_t>::value && - !detail::conjunction, - std::is_same>>::value && - std::is_constructible::value && - std::is_assignable::value && - std::is_nothrow_move_constructible::value)> * = nullptr> - expected &operator=(U &&v) { - if (has_value()) { - val() = std::forward(v); - } else { - err().~unexpected(); - ::new (valptr()) T(std::forward(v)); - this->m_has_val = true; - } - return *this; - } +#include +#include +#if ADA_REGULAR_VISUAL_STUDIO +#include +#endif // ADA_REGULAR_VISUAL_STUDIO - template < - class U = T, class G = T, - detail::enable_if_t::value> * = - nullptr, - detail::enable_if_t::value> * = nullptr, - detail::enable_if_t< - (!std::is_same, detail::decay_t>::value && - !detail::conjunction, - std::is_same>>::value && - std::is_constructible::value && - std::is_assignable::value && - std::is_nothrow_move_constructible::value)> * = nullptr> - expected &operator=(U &&v) { - if (has_value()) { - val() = std::forward(v); - } else { - auto tmp = std::move(err()); - err().~unexpected(); +namespace ada { -#ifdef TL_EXPECTED_EXCEPTIONS_ENABLED - try { - ::new (valptr()) T(std::forward(v)); - this->m_has_val = true; - } catch (...) { - err() = std::move(tmp); - throw; - } -#else - ::new (valptr()) T(std::forward(v)); - this->m_has_val = true; -#endif - } +[[nodiscard]] ada_really_inline bool url_base::is_special() const noexcept { + return type != ada::scheme::NOT_SPECIAL; +} - return *this; +[[nodiscard]] inline uint16_t url_base::get_special_port() const noexcept { + return ada::scheme::get_special_port(type); +} + +[[nodiscard]] ada_really_inline uint16_t +url_base::scheme_default_port() const noexcept { + return scheme::get_special_port(type); +} + +} // namespace ada + +#endif // ADA_URL_BASE_INL_H +/* end file include/ada/url_base-inl.h */ +/* begin file include/ada/url-inl.h */ +/** + * @file url-inl.h + * @brief Definitions for the URL + */ +#ifndef ADA_URL_INL_H +#define ADA_URL_INL_H + + +#include +#include +#if ADA_REGULAR_VISUAL_STUDIO +#include +#endif // ADA_REGULAR_VISUAL_STUDIO + +namespace ada { +[[nodiscard]] ada_really_inline bool url::includes_credentials() + const noexcept { + return !username.empty() || !password.empty(); +} +[[nodiscard]] inline bool url::cannot_have_credentials_or_port() const { + return !host.has_value() || host.value().empty() || + type == ada::scheme::type::FILE; +} +[[nodiscard]] inline bool url::has_empty_hostname() const noexcept { + if (!host.has_value()) { + return false; } + return host.value().empty(); +} +[[nodiscard]] inline bool url::has_hostname() const noexcept { + return host.has_value(); +} +inline std::ostream &operator<<(std::ostream &out, const ada::url &u) { + return out << u.to_string(); +} - template ::value && - std::is_assignable::value> * = nullptr> - expected &operator=(const unexpected &rhs) { - if (!has_value()) { - err() = rhs; - } else { - this->destroy_val(); - ::new (errptr()) unexpected(rhs); - this->m_has_val = false; - } +size_t url::get_pathname_length() const noexcept { return path.size(); } + +[[nodiscard]] ada_really_inline ada::url_components url::get_components() + const noexcept { + url_components out{}; + + // protocol ends with ':'. for example: "https:" + out.protocol_end = uint32_t(get_protocol().size()); - return *this; - } + // Trailing index is always the next character of the current one. + size_t running_index = out.protocol_end; - template ::value && - std::is_move_assignable::value> * = nullptr> - expected &operator=(unexpected &&rhs) noexcept { - if (!has_value()) { - err() = std::move(rhs); - } else { - this->destroy_val(); - ::new (errptr()) unexpected(std::move(rhs)); - this->m_has_val = false; - } + if (host.has_value()) { + // 2 characters for "//" and 1 character for starting index + out.host_start = out.protocol_end + 2; - return *this; - } + if (includes_credentials()) { + out.username_end = uint32_t(out.host_start + username.size()); - template ::value> * = nullptr> - void emplace(Args &&...args) { - if (has_value()) { - val().~T(); - } else { - err().~unexpected(); - this->m_has_val = true; - } - ::new (valptr()) T(std::forward(args)...); - } + out.host_start += uint32_t(username.size()); - template ::value> * = nullptr> - void emplace(Args &&...args) { - if (has_value()) { - val().~T(); - ::new (valptr()) T(std::forward(args)...); + if (!password.empty()) { + out.host_start += uint32_t(password.size() + 1); + } + + out.host_end = uint32_t(out.host_start + host.value().size()); } else { - auto tmp = std::move(err()); - err().~unexpected(); + out.username_end = out.host_start; -#ifdef TL_EXPECTED_EXCEPTIONS_ENABLED - try { - ::new (valptr()) T(std::forward(args)...); - this->m_has_val = true; - } catch (...) { - err() = std::move(tmp); - throw; - } -#else - ::new (valptr()) T(std::forward(args)...); - this->m_has_val = true; -#endif + // Host does not start with "@" if it does not include credentials. + out.host_end = uint32_t(out.host_start + host.value().size()) - 1; } - } - template &, Args &&...>::value> * = nullptr> - void emplace(std::initializer_list il, Args &&...args) { - if (has_value()) { - T t(il, std::forward(args)...); - val() = std::move(t); + running_index = out.host_end + 1; + } else { + // Update host start and end date to the same index, since it does not + // exist. + out.host_start = out.protocol_end; + out.host_end = out.host_start; + + if (!has_opaque_path && checkers::begins_with(path, "//")) { + // If url’s host is null, url does not have an opaque path, url’s path’s + // size is greater than 1, and url’s path[0] is the empty string, then + // append U+002F (/) followed by U+002E (.) to output. + running_index = out.protocol_end + 2; } else { - err().~unexpected(); - ::new (valptr()) T(il, std::forward(args)...); - this->m_has_val = true; + running_index = out.protocol_end; } } - template &, Args &&...>::value> * = nullptr> - void emplace(std::initializer_list il, Args &&...args) { - if (has_value()) { - T t(il, std::forward(args)...); - val() = std::move(t); - } else { - auto tmp = std::move(err()); - err().~unexpected(); - -#ifdef TL_EXPECTED_EXCEPTIONS_ENABLED - try { - ::new (valptr()) T(il, std::forward(args)...); - this->m_has_val = true; - } catch (...) { - err() = std::move(tmp); - throw; - } -#else - ::new (valptr()) T(il, std::forward(args)...); - this->m_has_val = true; -#endif - } + if (port.has_value()) { + out.port = *port; + running_index += helpers::fast_digit_count(*port) + 1; // Port omits ':' } -private: - using t_is_void = std::true_type; - using t_is_not_void = std::false_type; - using t_is_nothrow_move_constructible = std::true_type; - using move_constructing_t_can_throw = std::false_type; - using e_is_nothrow_move_constructible = std::true_type; - using move_constructing_e_can_throw = std::false_type; + out.pathname_start = uint32_t(running_index); - void swap_where_both_have_value(expected & /*rhs*/, t_is_void) noexcept { - // swapping void is a no-op + if (!path.empty()) { + running_index += path.size(); } - void swap_where_both_have_value(expected &rhs, t_is_not_void) { - using std::swap; - swap(val(), rhs.val()); + if (query.has_value()) { + out.search_start = uint32_t(running_index); + running_index += get_search().size(); + if (get_search().size() == 0) { + running_index++; + } } - void swap_where_only_one_has_value(expected &rhs, t_is_void) noexcept( - std::is_nothrow_move_constructible::value) { - ::new (errptr()) unexpected_type(std::move(rhs.err())); - rhs.err().~unexpected_type(); - std::swap(this->m_has_val, rhs.m_has_val); + if (fragment.has_value()) { + out.hash_start = uint32_t(running_index); } - void swap_where_only_one_has_value(expected &rhs, t_is_not_void) { - swap_where_only_one_has_value_and_t_is_not_void( - rhs, typename std::is_nothrow_move_constructible::type{}, - typename std::is_nothrow_move_constructible::type{}); - } + return out; +} - void swap_where_only_one_has_value_and_t_is_not_void( - expected &rhs, t_is_nothrow_move_constructible, - e_is_nothrow_move_constructible) noexcept { - auto temp = std::move(val()); - val().~T(); - ::new (errptr()) unexpected_type(std::move(rhs.err())); - rhs.err().~unexpected_type(); - ::new (rhs.valptr()) T(std::move(temp)); - std::swap(this->m_has_val, rhs.m_has_val); - } +inline void url::update_base_hostname(std::string_view input) { host = input; } - void swap_where_only_one_has_value_and_t_is_not_void( - expected &rhs, t_is_nothrow_move_constructible, - move_constructing_e_can_throw) { - auto temp = std::move(val()); - val().~T(); -#ifdef TL_EXPECTED_EXCEPTIONS_ENABLED - try { - ::new (errptr()) unexpected_type(std::move(rhs.err())); - rhs.err().~unexpected_type(); - ::new (rhs.valptr()) T(std::move(temp)); - std::swap(this->m_has_val, rhs.m_has_val); - } catch (...) { - val() = std::move(temp); - throw; - } -#else - ::new (errptr()) unexpected_type(std::move(rhs.err())); - rhs.err().~unexpected_type(); - ::new (rhs.valptr()) T(std::move(temp)); - std::swap(this->m_has_val, rhs.m_has_val); -#endif - } +inline void url::update_unencoded_base_hash(std::string_view input) { + // We do the percent encoding + fragment = unicode::percent_encode( + input, ada::character_sets::FRAGMENT_PERCENT_ENCODE); +} - void swap_where_only_one_has_value_and_t_is_not_void( - expected &rhs, move_constructing_t_can_throw, - e_is_nothrow_move_constructible) { - auto temp = std::move(rhs.err()); - rhs.err().~unexpected_type(); -#ifdef TL_EXPECTED_EXCEPTIONS_ENABLED - try { - ::new (rhs.valptr()) T(std::move(val())); - val().~T(); - ::new (errptr()) unexpected_type(std::move(temp)); - std::swap(this->m_has_val, rhs.m_has_val); - } catch (...) { - rhs.err() = std::move(temp); - throw; - } -#else - ::new (rhs.valptr()) T(std::move(val())); - val().~T(); - ::new (errptr()) unexpected_type(std::move(temp)); - std::swap(this->m_has_val, rhs.m_has_val); -#endif - } +inline void url::update_base_search(std::string_view input, + const uint8_t query_percent_encode_set[]) { + query = ada::unicode::percent_encode(input, query_percent_encode_set); +} -public: - template - detail::enable_if_t::value && - detail::is_swappable::value && - (std::is_nothrow_move_constructible::value || - std::is_nothrow_move_constructible::value)> - swap(expected &rhs) noexcept( - std::is_nothrow_move_constructible::value - &&detail::is_nothrow_swappable::value - &&std::is_nothrow_move_constructible::value - &&detail::is_nothrow_swappable::value) { - if (has_value() && rhs.has_value()) { - swap_where_both_have_value(rhs, typename std::is_void::type{}); - } else if (!has_value() && rhs.has_value()) { - rhs.swap(*this); - } else if (has_value()) { - swap_where_only_one_has_value(rhs, typename std::is_void::type{}); - } else { - using std::swap; - swap(err(), rhs.err()); - } +inline void url::update_base_search(std::optional input) { + query = input; +} + +inline void url::update_base_pathname(const std::string_view input) { + path = input; +} + +inline void url::update_base_username(const std::string_view input) { + username = input; +} + +inline void url::update_base_password(const std::string_view input) { + password = input; +} + +inline void url::update_base_port(std::optional input) { + port = input; +} + +inline void url::clear_base_pathname() { path = ""; } + +inline void url::clear_base_search() { query = std::nullopt; } + +inline bool url::base_fragment_has_value() const { + return fragment.has_value(); +} + +inline bool url::base_search_has_value() const { return query.has_value(); } + +inline void url::set_protocol_as_file() { type = ada::scheme::type::FILE; } + +inline void url::set_scheme(std::string &&new_scheme) noexcept { + type = ada::scheme::get_scheme_type(new_scheme); + // We only move the 'scheme' if it is non-special. + if (!is_special()) { + non_special_scheme = new_scheme; } +} - constexpr const T *operator->() const { return valptr(); } - TL_EXPECTED_11_CONSTEXPR T *operator->() { return valptr(); } +inline void url::copy_scheme(ada::url &&u) noexcept { + non_special_scheme = u.non_special_scheme; + type = u.type; +} - template ::value> * = nullptr> - constexpr const U &operator*() const & { - return val(); +inline void url::copy_scheme(const ada::url &u) { + non_special_scheme = u.non_special_scheme; + type = u.type; +} + +[[nodiscard]] ada_really_inline std::string url::get_href() const noexcept { + std::string output = get_protocol(); + + if (host.has_value()) { + output += "//"; + if (includes_credentials()) { + output += username; + if (!password.empty()) { + output += ":" + get_password(); + } + output += "@"; + } + output += host.value(); + if (port.has_value()) { + output += ":" + get_port(); + } + } else if (!has_opaque_path && checkers::begins_with(path, "//")) { + // If url’s host is null, url does not have an opaque path, url’s path’s + // size is greater than 1, and url’s path[0] is the empty string, then + // append U+002F (/) followed by U+002E (.) to output. + output += "/."; } - template ::value> * = nullptr> - TL_EXPECTED_11_CONSTEXPR U &operator*() & { - return val(); + output += path; + if (query.has_value()) { + output += "?" + query.value(); } - template ::value> * = nullptr> - constexpr const U &&operator*() const && { - return std::move(val()); + if (fragment.has_value()) { + output += "#" + fragment.value(); } - template ::value> * = nullptr> - TL_EXPECTED_11_CONSTEXPR U &&operator*() && { - return std::move(val()); + return output; +} + +ada_really_inline size_t url::parse_port(std::string_view view, + bool check_trailing_content) noexcept { + ada_log("parse_port('", view, "') ", view.size()); + uint16_t parsed_port{}; + auto r = std::from_chars(view.data(), view.data() + view.size(), parsed_port); + if (r.ec == std::errc::result_out_of_range) { + ada_log("parse_port: std::errc::result_out_of_range"); + is_valid = false; + return 0; + } + ada_log("parse_port: ", parsed_port); + const size_t consumed = size_t(r.ptr - view.data()); + ada_log("parse_port: consumed ", consumed); + if (check_trailing_content) { + is_valid &= + (consumed == view.size() || view[consumed] == '/' || + view[consumed] == '?' || (is_special() && view[consumed] == '\\')); + } + ada_log("parse_port: is_valid = ", is_valid); + if (is_valid) { + port = (r.ec == std::errc() && scheme_default_port() != parsed_port) + ? std::optional(parsed_port) + : std::nullopt; + } + return consumed; +} + +} // namespace ada + +#endif // ADA_URL_H +/* end file include/ada/url-inl.h */ +/* begin file include/ada/url_aggregator-inl.h */ +/** + * @file url_aggregator-inl.h + * @brief Inline functions for url aggregator + */ +#ifndef ADA_URL_AGGREGATOR_INL_H +#define ADA_URL_AGGREGATOR_INL_H + +/* begin file include/ada/unicode-inl.h */ +/** + * @file unicode-inl.h + * @brief Definitions for unicode operations. + */ +#ifndef ADA_UNICODE_INL_H +#define ADA_UNICODE_INL_H +#include + +/** + * @namespace ada::unicode + * @brief Includes the declarations for unicode operations + */ +namespace ada::unicode { +ada_really_inline size_t percent_encode_index(const std::string_view input, + const uint8_t character_set[]) { + return std::distance( + input.begin(), + std::find_if(input.begin(), input.end(), [character_set](const char c) { + return character_sets::bit_at(character_set, c); + })); +} +} // namespace ada::unicode + +#endif // ADA_UNICODE_INL_H +/* end file include/ada/unicode-inl.h */ + +#include +#include + +namespace ada { + +inline void url_aggregator::update_base_authority( + std::string_view base_buffer, const ada::url_components &base) { + std::string_view input = base_buffer.substr( + base.protocol_end, base.host_start - base.protocol_end); + ada_log("url_aggregator::update_base_authority ", input); + + bool input_starts_with_dash = checkers::begins_with(input, "//"); + uint32_t diff = components.host_start - components.protocol_end; + + buffer.erase(components.protocol_end, + components.host_start - components.protocol_end); + components.username_end = components.protocol_end; + + if (input_starts_with_dash) { + input.remove_prefix(2); + diff += 2; // add "//" + buffer.insert(components.protocol_end, "//"); + components.username_end += 2; + } + + size_t password_delimiter = input.find(':'); + + // Check if input contains both username and password by checking the + // delimiter: ":" A typical input that contains authority would be "user:pass" + if (password_delimiter != std::string_view::npos) { + // Insert both username and password + std::string_view username = input.substr(0, password_delimiter); + std::string_view password = input.substr(password_delimiter + 1); + + buffer.insert(components.protocol_end + diff, username); + diff += uint32_t(username.size()); + buffer.insert(components.protocol_end + diff, ":"); + components.username_end = components.protocol_end + diff; + buffer.insert(components.protocol_end + diff + 1, password); + diff += uint32_t(password.size()) + 1; + } else if (!input.empty()) { + // Insert only username + buffer.insert(components.protocol_end + diff, input); + components.username_end = + components.protocol_end + diff + uint32_t(input.size()); + diff += uint32_t(input.size()); } - constexpr bool has_value() const noexcept { return this->m_has_val; } - constexpr explicit operator bool() const noexcept { return this->m_has_val; } + components.host_start += diff; - template ::value> * = nullptr> - TL_EXPECTED_11_CONSTEXPR const U &value() const & { - if (!has_value()) - detail::throw_exception(bad_expected_access(err().value())); - return val(); + if (buffer.size() > base.host_start && buffer[base.host_start] != '@') { + buffer.insert(components.host_start, "@"); + diff++; } - template ::value> * = nullptr> - TL_EXPECTED_11_CONSTEXPR U &value() & { - if (!has_value()) - detail::throw_exception(bad_expected_access(err().value())); - return val(); - } - template ::value> * = nullptr> - TL_EXPECTED_11_CONSTEXPR const U &&value() const && { - if (!has_value()) - detail::throw_exception(bad_expected_access(std::move(err()).value())); - return std::move(val()); + components.host_end += diff; + components.pathname_start += diff; + if (components.search_start != url_components::omitted) { + components.search_start += diff; } - template ::value> * = nullptr> - TL_EXPECTED_11_CONSTEXPR U &&value() && { - if (!has_value()) - detail::throw_exception(bad_expected_access(std::move(err()).value())); - return std::move(val()); + if (components.hash_start != url_components::omitted) { + components.hash_start += diff; } +} - constexpr const E &error() const & { return err().value(); } - TL_EXPECTED_11_CONSTEXPR E &error() & { return err().value(); } - constexpr const E &&error() const && { return std::move(err().value()); } - TL_EXPECTED_11_CONSTEXPR E &&error() && { return std::move(err().value()); } +inline void url_aggregator::update_unencoded_base_hash(std::string_view input) { + ada_log("url_aggregator::update_unencoded_base_hash ", input, " [", + input.size(), " bytes], buffer is '", buffer, "' [", buffer.size(), + " bytes] components.hash_start = ", components.hash_start); + ADA_ASSERT_TRUE(validate()); + ADA_ASSERT_TRUE(!helpers::overlaps(input, buffer)); + if (components.hash_start != url_components::omitted) { + buffer.resize(components.hash_start); + } + components.hash_start = uint32_t(buffer.size()); + buffer += "#"; + bool encoding_required = unicode::percent_encode( + input, ada::character_sets::FRAGMENT_PERCENT_ENCODE, buffer); + // When encoding_required is false, then buffer is left unchanged, and percent + // encoding was not deemed required. + if (!encoding_required) { + buffer.append(input); + } + ada_log("url_aggregator::update_unencoded_base_hash final buffer is '", + buffer, "' [", buffer.size(), " bytes]"); + ADA_ASSERT_TRUE(validate()); +} - template constexpr T value_or(U &&v) const & { - static_assert(std::is_copy_constructible::value && - std::is_convertible::value, - "T must be copy-constructible and convertible to from U&&"); - return bool(*this) ? **this : static_cast(std::forward(v)); - } - template TL_EXPECTED_11_CONSTEXPR T value_or(U &&v) && { - static_assert(std::is_move_constructible::value && - std::is_convertible::value, - "T must be move-constructible and convertible to from U&&"); - return bool(*this) ? std::move(**this) : static_cast(std::forward(v)); - } -}; +ada_really_inline uint32_t url_aggregator::replace_and_resize( + uint32_t start, uint32_t end, std::string_view input) { + uint32_t current_length = end - start; + uint32_t input_size = uint32_t(input.size()); + uint32_t new_difference = input_size - current_length; + + if (current_length == 0) { + buffer.insert(start, input); + } else if (input_size == current_length) { + buffer.replace(start, input_size, input); + } else if (input_size < current_length) { + buffer.erase(start, current_length - input_size); + buffer.replace(start, input_size, input); + } else { + buffer.replace(start, current_length, input.substr(0, current_length)); + buffer.insert(start + current_length, input.substr(current_length)); + } + + return new_difference; +} -namespace detail { -template using exp_t = typename detail::decay_t::value_type; -template using err_t = typename detail::decay_t::error_type; -template using ret_t = expected>; +inline void url_aggregator::update_base_hostname(const std::string_view input) { + ada_log("url_aggregator::update_base_hostname ", input, " [", input.size(), + " bytes], buffer is '", buffer, "' [", buffer.size(), " bytes]"); + ADA_ASSERT_TRUE(validate()); + ADA_ASSERT_TRUE(!helpers::overlaps(input, buffer)); -#ifdef TL_EXPECTED_CXX14 -template >::value> * = nullptr, - class Ret = decltype(detail::invoke(std::declval(), - *std::declval()))> -constexpr auto and_then_impl(Exp &&exp, F &&f) { - static_assert(detail::is_expected::value, "F must return an expected"); + // This next line is required for when parsing a URL like `foo://` + add_authority_slashes_if_needed(); - return exp.has_value() - ? detail::invoke(std::forward(f), *std::forward(exp)) - : Ret(unexpect, std::forward(exp).error()); -} + bool has_credentials = components.protocol_end + 2 < components.host_start; + uint32_t new_difference = + replace_and_resize(components.host_start, components.host_end, input); -template >::value> * = nullptr, - class Ret = decltype(detail::invoke(std::declval()))> -constexpr auto and_then_impl(Exp &&exp, F &&f) { - static_assert(detail::is_expected::value, "F must return an expected"); + if (has_credentials) { + buffer.insert(components.host_start, "@"); + new_difference++; + } + components.host_end += new_difference; + components.pathname_start += new_difference; + if (components.search_start != url_components::omitted) { + components.search_start += new_difference; + } + if (components.hash_start != url_components::omitted) { + components.hash_start += new_difference; + } + ADA_ASSERT_TRUE(validate()); +} - return exp.has_value() ? detail::invoke(std::forward(f)) - : Ret(unexpect, std::forward(exp).error()); +ada_really_inline uint32_t +url_aggregator::get_pathname_length() const noexcept { + ada_log("url_aggregator::get_pathname_length"); + uint32_t ending_index = uint32_t(buffer.size()); + if (components.search_start != url_components::omitted) { + ending_index = components.search_start; + } else if (components.hash_start != url_components::omitted) { + ending_index = components.hash_start; + } + return ending_index - components.pathname_start; } -#else -template struct TC; -template (), - *std::declval())), - detail::enable_if_t>::value> * = nullptr> -auto and_then_impl(Exp &&exp, F &&f) -> Ret { - static_assert(detail::is_expected::value, "F must return an expected"); - return exp.has_value() - ? detail::invoke(std::forward(f), *std::forward(exp)) - : Ret(unexpect, std::forward(exp).error()); +[[nodiscard]] ada_really_inline bool url_aggregator::is_at_path() + const noexcept { + return buffer.size() == components.pathname_start; } -template ())), - detail::enable_if_t>::value> * = nullptr> -constexpr auto and_then_impl(Exp &&exp, F &&f) -> Ret { - static_assert(detail::is_expected::value, "F must return an expected"); +inline void url_aggregator::update_base_search(std::string_view input) { + ada_log("url_aggregator::update_base_search ", input); + ADA_ASSERT_TRUE(validate()); + ADA_ASSERT_TRUE(!helpers::overlaps(input, buffer)); + if (input.empty()) { + clear_base_search(); + return; + } - return exp.has_value() ? detail::invoke(std::forward(f)) - : Ret(unexpect, std::forward(exp).error()); -} -#endif + if (input[0] == '?') { + input.remove_prefix(1); + } -#ifdef TL_EXPECTED_CXX14 -template >::value> * = nullptr, - class Ret = decltype(detail::invoke(std::declval(), - *std::declval())), - detail::enable_if_t::value> * = nullptr> -constexpr auto expected_map_impl(Exp &&exp, F &&f) { - using result = ret_t>; - return exp.has_value() ? result(detail::invoke(std::forward(f), - *std::forward(exp))) - : result(unexpect, std::forward(exp).error()); -} + if (components.hash_start == url_components::omitted) { + if (components.search_start == url_components::omitted) { + components.search_start = uint32_t(buffer.size()); + buffer += "?"; + } else { + buffer.resize(components.search_start + 1); + } -template >::value> * = nullptr, - class Ret = decltype(detail::invoke(std::declval(), - *std::declval())), - detail::enable_if_t::value> * = nullptr> -auto expected_map_impl(Exp &&exp, F &&f) { - using result = expected>; - if (exp.has_value()) { - detail::invoke(std::forward(f), *std::forward(exp)); - return result(); + buffer.append(input); + } else { + if (components.search_start == url_components::omitted) { + components.search_start = components.hash_start; + } else { + buffer.erase(components.search_start, + components.hash_start - components.search_start); + components.hash_start = components.search_start; + } + + buffer.insert(components.search_start, "?"); + buffer.insert(components.search_start + 1, input); + components.hash_start += uint32_t(input.size() + 1); // Do not forget `?` } - return result(unexpect, std::forward(exp).error()); + ADA_ASSERT_TRUE(validate()); } -template >::value> * = nullptr, - class Ret = decltype(detail::invoke(std::declval())), - detail::enable_if_t::value> * = nullptr> -constexpr auto expected_map_impl(Exp &&exp, F &&f) { - using result = ret_t>; - return exp.has_value() ? result(detail::invoke(std::forward(f))) - : result(unexpect, std::forward(exp).error()); -} +inline void url_aggregator::update_base_search( + std::string_view input, const uint8_t query_percent_encode_set[]) { + ada_log("url_aggregator::update_base_search ", input, + " with encoding parameter ", to_string(), "\n", to_diagram()); + ADA_ASSERT_TRUE(validate()); + ADA_ASSERT_TRUE(!helpers::overlaps(input, buffer)); + + if (components.hash_start == url_components::omitted) { + if (components.search_start == url_components::omitted) { + components.search_start = uint32_t(buffer.size()); + buffer += "?"; + } else { + buffer.resize(components.search_start + 1); + } -template >::value> * = nullptr, - class Ret = decltype(detail::invoke(std::declval())), - detail::enable_if_t::value> * = nullptr> -auto expected_map_impl(Exp &&exp, F &&f) { - using result = expected>; - if (exp.has_value()) { - detail::invoke(std::forward(f)); - return result(); + bool encoding_required = + unicode::percent_encode(input, query_percent_encode_set, buffer); + // When encoding_required is false, then buffer is left unchanged, and + // percent encoding was not deemed required. + if (!encoding_required) { + buffer.append(input); + } + } else { + if (components.search_start == url_components::omitted) { + components.search_start = components.hash_start; + } else { + buffer.erase(components.search_start, + components.hash_start - components.search_start); + components.hash_start = components.search_start; + } + + buffer.insert(components.search_start, "?"); + size_t idx = + ada::unicode::percent_encode_index(input, query_percent_encode_set); + if (idx == input.size()) { + buffer.insert(components.search_start + 1, input); + components.hash_start += uint32_t(input.size() + 1); // Do not forget `?` + } else { + buffer.insert(components.search_start + 1, input, 0, idx); + input.remove_prefix(idx); + // We only create a temporary string if we need percent encoding and + // we attempt to create as small a temporary string as we can. + std::string encoded = + ada::unicode::percent_encode(input, query_percent_encode_set); + buffer.insert(components.search_start + idx + 1, encoded); + components.hash_start += + uint32_t(encoded.size() + idx + 1); // Do not forget `?` + } } - return result(unexpect, std::forward(exp).error()); + ADA_ASSERT_TRUE(validate()); } -#else -template >::value> * = nullptr, - class Ret = decltype(detail::invoke(std::declval(), - *std::declval())), - detail::enable_if_t::value> * = nullptr> -constexpr auto expected_map_impl(Exp &&exp, F &&f) - -> ret_t> { - using result = ret_t>; +inline void url_aggregator::update_base_pathname(const std::string_view input) { + ada_log("url_aggregator::update_base_pathname '", input, "' [", input.size(), + " bytes] \n", to_diagram()); + ADA_ASSERT_TRUE(!helpers::overlaps(input, buffer)); + ADA_ASSERT_TRUE(validate()); - return exp.has_value() ? result(detail::invoke(std::forward(f), - *std::forward(exp))) - : result(unexpect, std::forward(exp).error()); -} + const bool begins_with_dashdash = checkers::begins_with(input, "//"); + if (!begins_with_dashdash && has_dash_dot()) { + ada_log("url_aggregator::update_base_pathname has /.: \n", to_diagram()); + // We must delete the ./ + delete_dash_dot(); + } -template >::value> * = nullptr, - class Ret = decltype(detail::invoke(std::declval(), - *std::declval())), - detail::enable_if_t::value> * = nullptr> + if (begins_with_dashdash && !has_opaque_path && !has_authority() && + !has_dash_dot()) { + // If url’s host is null, url does not have an opaque path, url’s path’s + // size is greater than 1, then append U+002F (/) followed by U+002E (.) to + // output. + buffer.insert(components.pathname_start, "/."); + components.pathname_start += 2; + } -auto expected_map_impl(Exp &&exp, F &&f) -> expected> { - if (exp.has_value()) { - detail::invoke(std::forward(f), *std::forward(exp)); - return {}; + uint32_t difference = replace_and_resize( + components.pathname_start, + components.pathname_start + get_pathname_length(), input); + if (components.search_start != url_components::omitted) { + components.search_start += difference; + } + if (components.hash_start != url_components::omitted) { + components.hash_start += difference; } + ada_log("url_aggregator::update_base_pathname end '", input, "' [", + input.size(), " bytes] \n", to_diagram()); + ADA_ASSERT_TRUE(validate()); +} - return unexpected>(std::forward(exp).error()); +inline void url_aggregator::append_base_pathname(const std::string_view input) { + ada_log("url_aggregator::append_base_pathname ", input, " ", to_string(), + "\n", to_diagram()); + ADA_ASSERT_TRUE(validate()); + ADA_ASSERT_TRUE(!helpers::overlaps(input, buffer)); +#if ADA_DEVELOPMENT_CHECKS + // computing the expected password. + std::string path_expected = std::string(get_pathname()); + path_expected.append(input); +#endif // ADA_DEVELOPMENT_CHECKS + uint32_t ending_index = uint32_t(buffer.size()); + if (components.search_start != url_components::omitted) { + ending_index = components.search_start; + } else if (components.hash_start != url_components::omitted) { + ending_index = components.hash_start; + } + buffer.insert(ending_index, input); + + if (components.search_start != url_components::omitted) { + components.search_start += uint32_t(input.size()); + } + if (components.hash_start != url_components::omitted) { + components.hash_start += uint32_t(input.size()); + } +#if ADA_DEVELOPMENT_CHECKS + std::string path_after = std::string(get_pathname()); + ADA_ASSERT_EQUAL( + path_expected, path_after, + "append_base_pathname problem after inserting " + std::string(input)); +#endif // ADA_DEVELOPMENT_CHECKS + ADA_ASSERT_TRUE(validate()); } -template >::value> * = nullptr, - class Ret = decltype(detail::invoke(std::declval())), - detail::enable_if_t::value> * = nullptr> +inline void url_aggregator::update_base_username(const std::string_view input) { + ada_log("url_aggregator::update_base_username '", input, "' ", to_string(), + "\n", to_diagram()); + ADA_ASSERT_TRUE(validate()); + ADA_ASSERT_TRUE(!helpers::overlaps(input, buffer)); -constexpr auto expected_map_impl(Exp &&exp, F &&f) - -> ret_t> { - using result = ret_t>; + add_authority_slashes_if_needed(); - return exp.has_value() ? result(detail::invoke(std::forward(f))) - : result(unexpect, std::forward(exp).error()); -} + bool has_password = has_non_empty_password(); + bool host_starts_with_at = buffer.size() > components.host_start && + buffer[components.host_start] == '@'; + uint32_t diff = replace_and_resize(components.protocol_end + 2, + components.username_end, input); -template >::value> * = nullptr, - class Ret = decltype(detail::invoke(std::declval())), - detail::enable_if_t::value> * = nullptr> + components.username_end += diff; + components.host_start += diff; -auto expected_map_impl(Exp &&exp, F &&f) -> expected> { - if (exp.has_value()) { - detail::invoke(std::forward(f)); - return {}; + if (!input.empty() && !host_starts_with_at) { + buffer.insert(components.host_start, "@"); + diff++; + } else if (input.empty() && host_starts_with_at && !has_password) { + // Input is empty, there is no password, and we need to remove "@" from + // hostname + buffer.erase(components.host_start, 1); + diff--; } - return unexpected>(std::forward(exp).error()); + components.host_end += diff; + components.pathname_start += diff; + if (components.search_start != url_components::omitted) { + components.search_start += diff; + } + if (components.hash_start != url_components::omitted) { + components.hash_start += diff; + } + ADA_ASSERT_TRUE(validate()); } -#endif -#if defined(TL_EXPECTED_CXX14) && !defined(TL_EXPECTED_GCC49) && \ - !defined(TL_EXPECTED_GCC54) && !defined(TL_EXPECTED_GCC55) -template >::value> * = nullptr, - class Ret = decltype(detail::invoke(std::declval(), - std::declval().error())), - detail::enable_if_t::value> * = nullptr> -constexpr auto map_error_impl(Exp &&exp, F &&f) { - using result = expected, detail::decay_t>; - return exp.has_value() - ? result(*std::forward(exp)) - : result(unexpect, detail::invoke(std::forward(f), - std::forward(exp).error())); +inline void url_aggregator::append_base_username(const std::string_view input) { + ada_log("url_aggregator::append_base_username ", input); + ADA_ASSERT_TRUE(validate()); + ADA_ASSERT_TRUE(!helpers::overlaps(input, buffer)); +#if ADA_DEVELOPMENT_CHECKS + // computing the expected password. + std::string username_expected = std::string(get_username()); + username_expected.append(input); +#endif // ADA_DEVELOPMENT_CHECKS + add_authority_slashes_if_needed(); + + // If input is empty, do nothing. + if (input.empty()) { + return; + } + + uint32_t difference = uint32_t(input.size()); + buffer.insert(components.username_end, input); + components.username_end += difference; + components.host_start += difference; + + if (buffer[components.host_start] != '@' && + components.host_start != components.host_end) { + buffer.insert(components.host_start, "@"); + difference++; + } + + components.host_end += difference; + components.pathname_start += difference; + if (components.search_start != url_components::omitted) { + components.search_start += difference; + } + if (components.hash_start != url_components::omitted) { + components.hash_start += difference; + } +#if ADA_DEVELOPMENT_CHECKS + std::string username_after = std::string(get_username()); + ADA_ASSERT_EQUAL( + username_expected, username_after, + "append_base_username problem after inserting " + std::string(input)); +#endif // ADA_DEVELOPMENT_CHECKS + ADA_ASSERT_TRUE(validate()); } -template >::value> * = nullptr, - class Ret = decltype(detail::invoke(std::declval(), - std::declval().error())), - detail::enable_if_t::value> * = nullptr> -auto map_error_impl(Exp &&exp, F &&f) { - using result = expected, monostate>; - if (exp.has_value()) { - return result(*std::forward(exp)); + +inline void url_aggregator::clear_base_password() { + ada_log("url_aggregator::clear_base_password ", to_string(), "\n", + to_diagram()); + ADA_ASSERT_TRUE(validate()); + if (!has_password()) { + return; } - detail::invoke(std::forward(f), std::forward(exp).error()); - return result(unexpect, monostate{}); -} -template >::value> * = nullptr, - class Ret = decltype(detail::invoke(std::declval(), - std::declval().error())), - detail::enable_if_t::value> * = nullptr> -constexpr auto map_error_impl(Exp &&exp, F &&f) { - using result = expected, detail::decay_t>; - return exp.has_value() - ? result() - : result(unexpect, detail::invoke(std::forward(f), - std::forward(exp).error())); + uint32_t diff = components.host_start - components.username_end; + buffer.erase(components.username_end, diff); + components.host_start -= diff; + components.host_end -= diff; + components.pathname_start -= diff; + if (components.search_start != url_components::omitted) { + components.search_start -= diff; + } + if (components.hash_start != url_components::omitted) { + components.hash_start -= diff; + } } -template >::value> * = nullptr, - class Ret = decltype(detail::invoke(std::declval(), - std::declval().error())), - detail::enable_if_t::value> * = nullptr> -auto map_error_impl(Exp &&exp, F &&f) { - using result = expected, monostate>; - if (exp.has_value()) { - return result(); + +inline void url_aggregator::update_base_password(const std::string_view input) { + ada_log("url_aggregator::update_base_password ", input); + ADA_ASSERT_TRUE(validate()); + ADA_ASSERT_TRUE(!helpers::overlaps(input, buffer)); + + add_authority_slashes_if_needed(); + + // TODO: Optimization opportunity. Merge the following removal functions. + if (input.empty()) { + clear_base_password(); + + // Remove username too, if it is empty. + if (!has_non_empty_username()) { + update_base_username(""); + } + + return; + } + + bool password_exists = has_password(); + uint32_t difference = uint32_t(input.size()); + + if (password_exists) { + uint32_t current_length = + components.host_start - components.username_end - 1; + buffer.erase(components.username_end + 1, current_length); + difference -= current_length; + } else { + buffer.insert(components.username_end, ":"); + difference++; + } + + buffer.insert(components.username_end + 1, input); + components.host_start += difference; + + // The following line is required to add "@" to hostname. When updating + // password if hostname does not start with "@", it is "update_base_password"s + // responsibility to set it. + if (buffer[components.host_start] != '@') { + buffer.insert(components.host_start, "@"); + difference++; + } + + components.host_end += difference; + components.pathname_start += difference; + if (components.search_start != url_components::omitted) { + components.search_start += difference; + } + if (components.hash_start != url_components::omitted) { + components.hash_start += difference; } - - detail::invoke(std::forward(f), std::forward(exp).error()); - return result(unexpect, monostate{}); + ADA_ASSERT_TRUE(validate()); } -#else -template >::value> * = nullptr, - class Ret = decltype(detail::invoke(std::declval(), - std::declval().error())), - detail::enable_if_t::value> * = nullptr> -constexpr auto map_error_impl(Exp &&exp, F &&f) - -> expected, detail::decay_t> { - using result = expected, detail::decay_t>; - return exp.has_value() - ? result(*std::forward(exp)) - : result(unexpect, detail::invoke(std::forward(f), - std::forward(exp).error())); +inline void url_aggregator::append_base_password(const std::string_view input) { + ada_log("url_aggregator::append_base_password ", input, " ", to_string(), + "\n", to_diagram()); + ADA_ASSERT_TRUE(validate()); + ADA_ASSERT_TRUE(!helpers::overlaps(input, buffer)); +#if ADA_DEVELOPMENT_CHECKS + // computing the expected password. + std::string password_expected = std::string(get_password()); + password_expected.append(input); +#endif // ADA_DEVELOPMENT_CHECKS + add_authority_slashes_if_needed(); + + // If input is empty, do nothing. + if (input.empty()) { + return; + } + + uint32_t difference = uint32_t(input.size()); + if (has_password()) { + buffer.insert(components.host_start, input); + } else { + difference++; // Increment for ":" + buffer.insert(components.username_end, ":"); + buffer.insert(components.username_end + 1, input); + } + components.host_start += difference; + + // The following line is required to add "@" to hostname. When updating + // password if hostname does not start with "@", it is "append_base_password"s + // responsibility to set it. + if (buffer[components.host_start] != '@') { + buffer.insert(components.host_start, "@"); + difference++; + } + + components.host_end += difference; + components.pathname_start += difference; + if (components.search_start != url_components::omitted) { + components.search_start += difference; + } + if (components.hash_start != url_components::omitted) { + components.hash_start += difference; + } +#if ADA_DEVELOPMENT_CHECKS + std::string password_after = std::string(get_password()); + ADA_ASSERT_EQUAL( + password_expected, password_after, + "append_base_password problem after inserting " + std::string(input)); +#endif // ADA_DEVELOPMENT_CHECKS + ADA_ASSERT_TRUE(validate()); } -template >::value> * = nullptr, - class Ret = decltype(detail::invoke(std::declval(), - std::declval().error())), - detail::enable_if_t::value> * = nullptr> -auto map_error_impl(Exp &&exp, F &&f) -> expected, monostate> { - using result = expected, monostate>; - if (exp.has_value()) { - return result(*std::forward(exp)); +inline void url_aggregator::update_base_port(uint32_t input) { + ada_log("url_aggregator::update_base_port"); + ADA_ASSERT_TRUE(validate()); + if (input == url_components::omitted) { + clear_base_port(); + return; } + // calling std::to_string(input.value()) is unfortunate given that the port + // value is probably already available as a string. + std::string value = helpers::concat(":", std::to_string(input)); + uint32_t difference = uint32_t(value.size()); - detail::invoke(std::forward(f), std::forward(exp).error()); - return result(unexpect, monostate{}); + if (components.port != url_components::omitted) { + difference -= components.pathname_start - components.host_end; + buffer.erase(components.host_end, + components.pathname_start - components.host_end); + } + + buffer.insert(components.host_end, value); + components.pathname_start += difference; + if (components.search_start != url_components::omitted) { + components.search_start += difference; + } + if (components.hash_start != url_components::omitted) { + components.hash_start += difference; + } + components.port = input; + ADA_ASSERT_TRUE(validate()); } -template >::value> * = nullptr, - class Ret = decltype(detail::invoke(std::declval(), - std::declval().error())), - detail::enable_if_t::value> * = nullptr> -constexpr auto map_error_impl(Exp &&exp, F &&f) - -> expected, detail::decay_t> { - using result = expected, detail::decay_t>; +inline void url_aggregator::clear_base_port() { + ada_log("url_aggregator::clear_base_port"); + ADA_ASSERT_TRUE(validate()); + if (components.port == url_components::omitted) { + return; + } + uint32_t length = components.pathname_start - components.host_end; + buffer.erase(components.host_end, length); + components.pathname_start -= length; + if (components.search_start != url_components::omitted) { + components.search_start -= length; + } + if (components.hash_start != url_components::omitted) { + components.hash_start -= length; + } + components.port = url_components::omitted; + ADA_ASSERT_TRUE(validate()); +} - return exp.has_value() - ? result() - : result(unexpect, detail::invoke(std::forward(f), - std::forward(exp).error())); +inline uint32_t url_aggregator::retrieve_base_port() const { + ada_log("url_aggregator::retrieve_base_port"); + return components.port; } -template >::value> * = nullptr, - class Ret = decltype(detail::invoke(std::declval(), - std::declval().error())), - detail::enable_if_t::value> * = nullptr> -auto map_error_impl(Exp &&exp, F &&f) -> expected, monostate> { - using result = expected, monostate>; - if (exp.has_value()) { - return result(); +inline void url_aggregator::clear_base_search() { + ada_log("url_aggregator::clear_base_search"); + ADA_ASSERT_TRUE(validate()); + if (components.search_start == url_components::omitted) { + return; } - detail::invoke(std::forward(f), std::forward(exp).error()); - return result(unexpect, monostate{}); -} + if (components.hash_start == url_components::omitted) { + buffer.resize(components.search_start); + } else { + buffer.erase(components.search_start, + components.hash_start - components.search_start); + components.hash_start = components.search_start; + } + + components.search_start = url_components::omitted; + +#if ADA_DEVELOPMENT_CHECKS + ADA_ASSERT_EQUAL(get_search(), "", + "search should have been cleared on buffer=" + buffer + + " with " + components.to_string() + "\n" + to_diagram()); #endif + ADA_ASSERT_TRUE(validate()); +} -#ifdef TL_EXPECTED_CXX14 -template (), - std::declval().error())), - detail::enable_if_t::value> * = nullptr> -constexpr auto or_else_impl(Exp &&exp, F &&f) { - static_assert(detail::is_expected::value, "F must return an expected"); - return exp.has_value() ? std::forward(exp) - : detail::invoke(std::forward(f), - std::forward(exp).error()); +inline void url_aggregator::clear_base_hash() { + ada_log("url_aggregator::clear_base_hash"); + ADA_ASSERT_TRUE(validate()); + if (components.hash_start == url_components::omitted) { + return; + } + buffer.resize(components.hash_start); + components.hash_start = url_components::omitted; + +#if ADA_DEVELOPMENT_CHECKS + ADA_ASSERT_EQUAL(get_hash(), "", + "hash should have been cleared on buffer=" + buffer + + " with " + components.to_string() + "\n" + to_diagram()); +#endif + ADA_ASSERT_TRUE(validate()); } -template (), - std::declval().error())), - detail::enable_if_t::value> * = nullptr> -detail::decay_t or_else_impl(Exp &&exp, F &&f) { - return exp.has_value() ? std::forward(exp) - : (detail::invoke(std::forward(f), - std::forward(exp).error()), - std::forward(exp)); +inline void url_aggregator::clear_base_pathname() { + ada_log("url_aggregator::clear_base_pathname"); + ADA_ASSERT_TRUE(validate()); + uint32_t ending_index = uint32_t(buffer.size()); + if (components.search_start != url_components::omitted) { + ending_index = components.search_start; + } else if (components.hash_start != url_components::omitted) { + ending_index = components.hash_start; + } + uint32_t pathname_length = ending_index - components.pathname_start; + buffer.erase(components.pathname_start, pathname_length); + uint32_t difference = pathname_length; + if (components.pathname_start == components.host_end + 2 && + buffer[components.host_end] == '/' && + buffer[components.host_end + 1] == '.') { + components.pathname_start -= 2; + buffer.erase(components.host_end, 2); + difference += 2; + } + if (components.search_start != url_components::omitted) { + components.search_start -= difference; + } + if (components.hash_start != url_components::omitted) { + components.hash_start -= difference; + } + ada_log("url_aggregator::clear_base_pathname completed, running checks..."); +#if ADA_DEVELOPMENT_CHECKS + ADA_ASSERT_EQUAL(get_pathname(), "", + "pathname should have been cleared on buffer=" + buffer + + " with " + components.to_string() + "\n" + to_diagram()); +#endif + ADA_ASSERT_TRUE(validate()); + ada_log( + "url_aggregator::clear_base_pathname completed, running checks... ok"); } -#else -template (), - std::declval().error())), - detail::enable_if_t::value> * = nullptr> -auto or_else_impl(Exp &&exp, F &&f) -> Ret { - static_assert(detail::is_expected::value, "F must return an expected"); - return exp.has_value() ? std::forward(exp) - : detail::invoke(std::forward(f), - std::forward(exp).error()); + +inline void url_aggregator::clear_base_hostname() { + ada_log("url_aggregator::clear_base_hostname"); + ADA_ASSERT_TRUE(validate()); + if (!has_authority()) { + return; + } + ADA_ASSERT_TRUE(has_authority()); + + uint32_t hostname_length = components.host_end - components.host_start; + uint32_t start = components.host_start; + + // If hostname starts with "@", we should not remove that character. + if (hostname_length > 0 && buffer[start] == '@') { + start++; + hostname_length--; + } + buffer.erase(start, hostname_length); + components.host_end = start; + components.pathname_start -= hostname_length; + if (components.search_start != url_components::omitted) { + components.search_start -= hostname_length; + } + if (components.hash_start != url_components::omitted) { + components.hash_start -= hostname_length; + } +#if ADA_DEVELOPMENT_CHECKS + ADA_ASSERT_EQUAL(get_hostname(), "", + "hostname should have been cleared on buffer=" + buffer + + " with " + components.to_string() + "\n" + to_diagram()); +#endif + ADA_ASSERT_TRUE(has_authority()); + ADA_ASSERT_TRUE(has_empty_hostname()); + ADA_ASSERT_TRUE(validate()); } -template (), - std::declval().error())), - detail::enable_if_t::value> * = nullptr> -detail::decay_t or_else_impl(Exp &&exp, F &&f) { - return exp.has_value() ? std::forward(exp) - : (detail::invoke(std::forward(f), - std::forward(exp).error()), - std::forward(exp)); +inline bool url_aggregator::base_fragment_has_value() const { + ada_log("url_aggregator::base_fragment_has_value"); + return components.hash_start != url_components::omitted; } -#endif -} // namespace detail -template -constexpr bool operator==(const expected &lhs, - const expected &rhs) { - return (lhs.has_value() != rhs.has_value()) - ? false - : (!lhs.has_value() ? lhs.error() == rhs.error() : *lhs == *rhs); +inline bool url_aggregator::base_search_has_value() const { + ada_log("url_aggregator::base_search_has_value"); + return components.search_start != url_components::omitted; } -template -constexpr bool operator!=(const expected &lhs, - const expected &rhs) { - return (lhs.has_value() != rhs.has_value()) - ? true - : (!lhs.has_value() ? lhs.error() != rhs.error() : *lhs != *rhs); + +ada_really_inline bool url_aggregator::includes_credentials() const noexcept { + ada_log("url_aggregator::includes_credentials"); + return has_non_empty_username() || has_non_empty_password(); } -template -constexpr bool operator==(const expected &lhs, - const expected &rhs) { - return (lhs.has_value() != rhs.has_value()) - ? false - : (!lhs.has_value() ? lhs.error() == rhs.error() : true); + +inline bool url_aggregator::cannot_have_credentials_or_port() const { + ada_log("url_aggregator::cannot_have_credentials_or_port"); + return type == ada::scheme::type::FILE || + components.host_start == components.host_end; } -template -constexpr bool operator!=(const expected &lhs, - const expected &rhs) { - return (lhs.has_value() != rhs.has_value()) - ? true - : (!lhs.has_value() ? lhs.error() == rhs.error() : false); + +[[nodiscard]] ada_really_inline const ada::url_components & +url_aggregator::get_components() const noexcept { + return components; } -template -constexpr bool operator==(const expected &x, const U &v) { - return x.has_value() ? *x == v : false; +[[nodiscard]] inline bool ada::url_aggregator::has_authority() const noexcept { + ada_log("url_aggregator::has_authority"); + // Performance: instead of doing this potentially expensive check, we could + // have a boolean in the struct. + return components.protocol_end + 2 <= components.host_start && + helpers::substring(buffer, components.protocol_end, + components.protocol_end + 2) == "//"; } -template -constexpr bool operator==(const U &v, const expected &x) { - return x.has_value() ? *x == v : false; + +inline void ada::url_aggregator::add_authority_slashes_if_needed() noexcept { + ada_log("url_aggregator::add_authority_slashes_if_needed"); + ADA_ASSERT_TRUE(validate()); + // Protocol setter will insert `http:` to the URL. It is up to hostname setter + // to insert + // `//` initially to the buffer, since it depends on the hostname existance. + if (has_authority()) { + return; + } + // Performance: the common case is components.protocol_end == buffer.size() + // Optimization opportunity: in many cases, the "//" is part of the input and + // the insert could be fused with another insert. + buffer.insert(components.protocol_end, "//"); + components.username_end += 2; + components.host_start += 2; + components.host_end += 2; + components.pathname_start += 2; + if (components.search_start != url_components::omitted) { + components.search_start += 2; + } + if (components.hash_start != url_components::omitted) { + components.hash_start += 2; + } + ADA_ASSERT_TRUE(validate()); } -template -constexpr bool operator!=(const expected &x, const U &v) { - return x.has_value() ? *x != v : true; + +inline void ada::url_aggregator::reserve(uint32_t capacity) { + buffer.reserve(capacity); } -template -constexpr bool operator!=(const U &v, const expected &x) { - return x.has_value() ? *x != v : true; + +inline bool url_aggregator::has_non_empty_username() const noexcept { + ada_log("url_aggregator::has_non_empty_username"); + return components.protocol_end + 2 < components.username_end; } -template -constexpr bool operator==(const expected &x, const unexpected &e) { - return x.has_value() ? false : x.error() == e.value(); +inline bool url_aggregator::has_non_empty_password() const noexcept { + ada_log("url_aggregator::has_non_empty_password"); + return components.host_start - components.username_end > 0; } -template -constexpr bool operator==(const unexpected &e, const expected &x) { - return x.has_value() ? false : x.error() == e.value(); + +inline bool url_aggregator::has_password() const noexcept { + ada_log("url_aggregator::has_password"); + // This function does not care about the length of the password + return components.host_start > components.username_end && + buffer[components.username_end] == ':'; } -template -constexpr bool operator!=(const expected &x, const unexpected &e) { - return x.has_value() ? true : x.error() != e.value(); + +inline bool url_aggregator::has_empty_hostname() const noexcept { + if (!has_hostname()) { + return false; + } + if (components.host_start == components.host_end) { + return true; + } + if (components.host_end > components.host_start + 1) { + return false; + } + return components.username_end != components.host_start; } -template -constexpr bool operator!=(const unexpected &e, const expected &x) { - return x.has_value() ? true : x.error() != e.value(); + +inline bool url_aggregator::has_hostname() const noexcept { + return has_authority(); } -template ::value || - std::is_move_constructible::value) && - detail::is_swappable::value && - std::is_move_constructible::value && - detail::is_swappable::value> * = nullptr> -void swap(expected &lhs, - expected &rhs) noexcept(noexcept(lhs.swap(rhs))) { - lhs.swap(rhs); +inline bool url_aggregator::has_port() const noexcept { + ada_log("url_aggregator::has_port"); + return components.pathname_start != components.host_end; } -} // namespace tl +inline bool url_aggregator::has_dash_dot() const noexcept { + // If url’s host is null, url does not have an opaque path, url’s path’s size + // is greater than 1, and url’s path[0] is the empty string, then append + // U+002F (/) followed by U+002E (.) to output. + ada_log("url_aggregator::has_dash_dot"); + // Performance: instead of doing this potentially expensive check, we could + // just have a boolean value in the structure. +#if ADA_DEVELOPMENT_CHECKS + if (components.pathname_start + 1 < buffer.size() && + components.pathname_start == components.host_end + 2) { + ADA_ASSERT_TRUE(buffer[components.host_end] == '/'); + ADA_ASSERT_TRUE(buffer[components.host_end + 1] == '.'); + ADA_ASSERT_TRUE(buffer[components.pathname_start] == '/'); + ADA_ASSERT_TRUE(buffer[components.pathname_start + 1] == '/'); + } #endif -/* end file include/ada/expected.h */ -#include -#include - -/** - * @namespace ada::parser - * @brief Includes the definitions for supported parsers - */ -namespace ada::parser { - - /** - * Parses a url. - */ - url parse_url(std::string_view user_input, - const ada::url* base_url = nullptr, - ada::encoding_type encoding = ada::encoding_type::UTF8); - -} // namespace ada - -#endif // ADA_PARSER_H -/* end file include/ada/parser.h */ -// dofile: invoked with prepath=/Users/dlemire/CVS/github/ada/include, filename=ada/scheme-inl.h -/* begin file include/ada/scheme-inl.h */ -/** - * @file scheme-inl.h - * @brief Definitions for the URL scheme. - */ -#ifndef ADA_SCHEME_INL_H -#define ADA_SCHEME_INL_H - - -namespace ada::scheme { - - /** - * @namespace ada::scheme::details - * @brief Includes the definitions for scheme specific entities - */ - namespace details { - // for use with is_special and get_special_port - // Spaces, if present, are removed from URL. - constexpr std::string_view is_special_list[] = {"http", " ", "https", - "ws", "ftp", "wss", "file", " "}; - // for use with get_special_port - constexpr uint16_t special_ports[] = {80, 0, 443, 80, 21, 443, 0, 0}; - } - - ada_really_inline constexpr bool is_special(std::string_view scheme) { - if(scheme.empty()) { return false; } - int hash_value = (2*scheme.size() + (unsigned)(scheme[0])) & 7; - const std::string_view target = details::is_special_list[hash_value]; - return (target[0] == scheme[0]) && (target.substr(1) == scheme.substr(1)); - } - constexpr uint16_t get_special_port(std::string_view scheme) noexcept { - if(scheme.empty()) { return 0; } - int hash_value = (2*scheme.size() + (unsigned)(scheme[0])) & 7; - const std::string_view target = details::is_special_list[hash_value]; - if ((target[0] == scheme[0]) && (target.substr(1) == scheme.substr(1))) { - return details::special_ports[hash_value]; - } else { return 0; } - } - constexpr uint16_t get_special_port(ada::scheme::type type) noexcept { - return details::special_ports[int(type)]; - } - constexpr ada::scheme::type get_scheme_type(std::string_view scheme) noexcept { - if(scheme.empty()) { return ada::scheme::NOT_SPECIAL; } - int hash_value = (2*scheme.size() + (unsigned)(scheme[0])) & 7; - const std::string_view target = details::is_special_list[hash_value]; - if ((target[0] == scheme[0]) && (target.substr(1) == scheme.substr(1))) { - return ada::scheme::type(hash_value); - } else { return ada::scheme::NOT_SPECIAL; } - } - -} // namespace ada::serializers - -#endif // ADA_SCHEME_H -/* end file include/ada/scheme-inl.h */ -// dofile: invoked with prepath=/Users/dlemire/CVS/github/ada/include, filename=ada/url-inl.h -/* begin file include/ada/url-inl.h */ -/** - * @file url-inl.h - * @brief Definitions for the URL - */ -#ifndef ADA_URL_INL_H -#define ADA_URL_INL_H + return !has_opaque_path && + components.pathname_start == components.host_end + 2 && + components.pathname_start + 1 < buffer.size(); +} +inline std::string_view url_aggregator::get_href() const noexcept { + ada_log("url_aggregator::get_href"); + return buffer; +} -namespace ada { - [[nodiscard]] ada_really_inline bool url::includes_credentials() const noexcept { - return !username.empty() || !password.empty(); - } - [[nodiscard]] ada_really_inline bool url::is_special() const noexcept { - return type != ada::scheme::NOT_SPECIAL; - } - [[nodiscard]] inline uint16_t url::get_special_port() const { - return ada::scheme::get_special_port(type); - } - [[nodiscard]] ada_really_inline ada::scheme::type url::get_scheme_type() const noexcept { - return type; - } - [[nodiscard]] ada_really_inline uint16_t url::scheme_default_port() const noexcept { - return scheme::get_special_port(type); - } - [[nodiscard]] inline bool url::cannot_have_credentials_or_port() const { - return !host.has_value() || host.value().empty() || type == ada::scheme::type::FILE; - } - ada_really_inline size_t url::parse_port(std::string_view view, bool check_trailing_content) noexcept { - ada_log("parse_port('", view, "') ", view.size()); - uint16_t parsed_port{}; - auto r = std::from_chars(view.data(), view.data() + view.size(), parsed_port); - if(r.ec == std::errc::result_out_of_range) { - ada_log("parse_port: std::errc::result_out_of_range"); - is_valid = false; - return 0; - } - ada_log("parse_port: ", parsed_port); - const size_t consumed = size_t(r.ptr - view.data()); - ada_log("parse_port: consumed ", consumed); - if(check_trailing_content) { - is_valid &= (consumed == view.size() || view[consumed] == '/' || view[consumed] == '?' || (is_special() && view[consumed] == '\\')); - } - ada_log("parse_port: is_valid = ", is_valid); - if(is_valid) { - port = (r.ec == std::errc() && scheme_default_port() != parsed_port) ? - std::optional(parsed_port) : std::nullopt; - } - return consumed; - } - [[nodiscard]] inline std::string_view url::get_scheme() const noexcept { - if(is_special()) { return ada::scheme::details::is_special_list[type]; } - // We only move the 'scheme' if it is non-special. - return non_special_scheme; - } - inline void url::set_scheme(std::string&& new_scheme) noexcept { - type = ada::scheme::get_scheme_type(new_scheme); - // We only move the 'scheme' if it is non-special. - if(!is_special()) { - non_special_scheme = new_scheme; +ada_really_inline size_t url_aggregator::parse_port( + std::string_view view, bool check_trailing_content) noexcept { + ada_log("url_aggregator::parse_port('", view, "') ", view.size()); + uint16_t parsed_port{}; + auto r = std::from_chars(view.data(), view.data() + view.size(), parsed_port); + if (r.ec == std::errc::result_out_of_range) { + ada_log("parse_port: std::errc::result_out_of_range"); + is_valid = false; + return 0; + } + ada_log("parse_port: ", parsed_port); + const size_t consumed = size_t(r.ptr - view.data()); + ada_log("parse_port: consumed ", consumed); + if (check_trailing_content) { + is_valid &= + (consumed == view.size() || view[consumed] == '/' || + view[consumed] == '?' || (is_special() && view[consumed] == '\\')); + } + ada_log("parse_port: is_valid = ", is_valid); + if (is_valid) { + if (r.ec == std::errc() && scheme_default_port() != parsed_port) { + update_base_port(parsed_port); + } else { + clear_base_port(); } } - inline void url::copy_scheme(ada::url&& u) noexcept { - non_special_scheme = u.non_special_scheme; - type = u.type; - } - inline void url::copy_scheme(const ada::url& u) { - non_special_scheme = u.non_special_scheme; - type = u.type; - } + return consumed; +} - inline std::ostream& operator<<(std::ostream& out, const ada::url& u) { - return out << u.to_string(); - } -} // namespace ada +inline void url_aggregator::set_protocol_as_file() { + ada_log("url_aggregator::set_protocol_as_file "); + ADA_ASSERT_TRUE(validate()); + type = ada::scheme::type::FILE; + // next line could overflow but unsigned arithmetic has well-defined + // overflows. + uint32_t new_difference = 5 - components.protocol_end; + + if (buffer.empty()) { + buffer.append("file:"); + } else { + buffer.erase(0, components.protocol_end); + buffer.insert(0, "file:"); + } + components.protocol_end = 5; + + // Update the rest of the components. + components.username_end += new_difference; + components.host_start += new_difference; + components.host_end += new_difference; + components.pathname_start += new_difference; + if (components.search_start != url_components::omitted) { + components.search_start += new_difference; + } + if (components.hash_start != url_components::omitted) { + components.hash_start += new_difference; + } + ADA_ASSERT_TRUE(validate()); +} -#endif // ADA_URL_H -/* end file include/ada/url-inl.h */ +inline std::ostream &operator<<(std::ostream &out, + const ada::url_aggregator &u) { + return out << u.to_string(); +} +} // namespace ada + +#endif // ADA_URL_AGGREGATOR_INL_H +/* end file include/ada/url_aggregator-inl.h */ // Public API -// dofile: invoked with prepath=/Users/dlemire/CVS/github/ada/include, filename=ada/ada_version.h /* begin file include/ada/ada_version.h */ /** * @file ada_version.h @@ -4363,25 +6503,25 @@ namespace ada { #ifndef ADA_ADA_VERSION_H #define ADA_ADA_VERSION_H -#define ADA_VERSION "1.0.4" +#define ADA_VERSION "2.0.0" namespace ada { - enum { - ADA_VERSION_MAJOR = 1, - ADA_VERSION_MINOR = 0, - ADA_VERSION_REVISION = 4, - }; +enum { + ADA_VERSION_MAJOR = 2, + ADA_VERSION_MINOR = 0, + ADA_VERSION_REVISION = 0, +}; -} // namespace ada +} // namespace ada -#endif // ADA_ADA_VERSION_H +#endif // ADA_ADA_VERSION_H /* end file include/ada/ada_version.h */ -// dofile: invoked with prepath=/Users/dlemire/CVS/github/ada/include, filename=ada/implementation.h /* begin file include/ada/implementation.h */ /** * @file implementation.h - * @brief Definitions for user facing functions for parsing URL and it's components. + * @brief Definitions for user facing functions for parsing URL and it's + * components. */ #ifndef ADA_IMPLEMENTATION_H #define ADA_IMPLEMENTATION_H @@ -4391,33 +6531,38 @@ namespace ada { namespace ada { - enum class errors { - generic_error - }; +enum class errors { generic_error }; - using result = tl::expected; +template +using result = tl::expected; - /** - * The URL parser takes a scalar value string input, with an optional null or base URL base (default null) - * and an optional encoding encoding (default UTF-8). - * - * @param input the string input to analyze. - * @param base_url the optional string input to use as a base url. - * @param encoding encoding (default to UTF-8) - * @return a parsed URL. - */ - ada_warn_unused ada::result parse(std::string_view input, - const ada::url* base_url = nullptr, - ada::encoding_type encoding = ada::encoding_type::UTF8); - /** - * Computes a href string from a file path. - * @return a href string (starts with file:://) - */ - std::string href_from_file(std::string_view path); -} +/** + * The URL parser takes a scalar value string input, with an optional null or + * base URL base (default null). The parser assumes the input has an UTF-8 + * encoding. + * + * @param input the string input to analyze. + * @param base_url the optional string input to use as a base url. + * @return a parsed URL. + */ +template +ada_warn_unused ada::result parse( + std::string_view input, const result_type* base_url = nullptr); + +extern template ada::result parse(std::string_view input, + const url* base_url); +extern template ada::result parse( + std::string_view input, const url_aggregator* base_url); + +/** + * Computes a href string from a file path. + * @return a href string (starts with file:://) + */ +std::string href_from_file(std::string_view path); +} // namespace ada -#endif // ADA_IMPLEMENTATION_H +#endif // ADA_IMPLEMENTATION_H /* end file include/ada/implementation.h */ -#endif // ADA_H +#endif // ADA_H /* end file include/ada.h */ diff --git a/deps/base64/base64.gyp b/deps/base64/base64.gyp index be68561708fef0..06b20a142b1679 100644 --- a/deps/base64/base64.gyp +++ b/deps/base64/base64.gyp @@ -2,6 +2,14 @@ 'variables': { 'arm_fpu%': '', 'target_arch%': '', + 'base64_sources_common': [ + 'base64/include/libbase64.h', + 'base64/lib/arch/generic/codec.c', + 'base64/lib/tables/tables.c', + 'base64/lib/codec_choose.c', + 'base64/lib/codecs.h', + 'base64/lib/lib.c', + ], }, 'targets': [ { @@ -14,12 +22,7 @@ }, 'defines': [ 'BASE64_STATIC_DEFINE' ], 'sources': [ - 'base64/include/libbase64.h', - 'base64/lib/arch/generic/codec.c', - 'base64/lib/tables/tables.c', - 'base64/lib/codec_choose.c', - 'base64/lib/codecs.h', - 'base64/lib/lib.c', + '<@(base64_sources_common)', ], 'conditions': [ diff --git a/deps/brotli/brotli.gyp b/deps/brotli/brotli.gyp index 2e6ab9bde3d1b7..9fc9bcdfd54ece 100644 --- a/deps/brotli/brotli.gyp +++ b/deps/brotli/brotli.gyp @@ -1,4 +1,42 @@ { + 'variables': { + 'brotli_sources': [ + # Common + 'c/common/constants.c', + 'c/common/context.c', + 'c/common/dictionary.c', + 'c/common/platform.c', + 'c/common/transform.c', + + # Decoder + 'c/dec/bit_reader.c', + 'c/dec/decode.c', + 'c/dec/huffman.c', + 'c/dec/state.c', + + # Encoder + 'c/enc/backward_references.c', + 'c/enc/backward_references_hq.c', + 'c/enc/bit_cost.c', + 'c/enc/block_splitter.c', + 'c/enc/brotli_bit_stream.c', + 'c/enc/cluster.c', + 'c/enc/command.c', + 'c/enc/compress_fragment.c', + 'c/enc/compress_fragment_two_pass.c', + 'c/enc/dictionary_hash.c', + 'c/enc/encode.c', + 'c/enc/encoder_dict.c', + 'c/enc/entropy_encode.c', + 'c/enc/fast_log.c', + 'c/enc/histogram.c', + 'c/enc/literal_cost.c', + 'c/enc/memory.c', + 'c/enc/metablock.c', + 'c/enc/static_dict.c', + 'c/enc/utf8_util.c', + ] + }, 'targets': [ { 'target_name': 'brotli', @@ -28,40 +66,7 @@ '-lm', ], 'sources': [ - # Common - 'c/common/constants.c', - 'c/common/context.c', - 'c/common/dictionary.c', - 'c/common/platform.c', - 'c/common/transform.c', - - # Decoder - 'c/dec/bit_reader.c', - 'c/dec/decode.c', - 'c/dec/huffman.c', - 'c/dec/state.c', - - # Encoder - 'c/enc/backward_references.c', - 'c/enc/backward_references_hq.c', - 'c/enc/bit_cost.c', - 'c/enc/block_splitter.c', - 'c/enc/brotli_bit_stream.c', - 'c/enc/cluster.c', - 'c/enc/command.c', - 'c/enc/compress_fragment.c', - 'c/enc/compress_fragment_two_pass.c', - 'c/enc/dictionary_hash.c', - 'c/enc/encode.c', - 'c/enc/encoder_dict.c', - 'c/enc/entropy_encode.c', - 'c/enc/fast_log.c', - 'c/enc/histogram.c', - 'c/enc/literal_cost.c', - 'c/enc/memory.c', - 'c/enc/metablock.c', - 'c/enc/static_dict.c', - 'c/enc/utf8_util.c' + '<@(brotli_sources)', ] } ] diff --git a/deps/cares/cares.gyp b/deps/cares/cares.gyp index 6c93a07e60e1a8..22e26c1f2266a5 100644 --- a/deps/cares/cares.gyp +++ b/deps/cares/cares.gyp @@ -1,4 +1,93 @@ { + 'variables': { + 'cares_sources_common': [ + 'include/ares.h', + 'include/ares_dns.h', + 'include/ares_nameser.h', + 'include/ares_rules.h', + 'include/ares_version.h', + 'src/lib/ares__addrinfo2hostent.c', + 'src/lib/ares__addrinfo_localhost.c', + 'src/lib/ares_android.c', + 'src/lib/ares_cancel.c', + 'src/lib/ares__close_sockets.c', + 'src/lib/ares_create_query.c', + 'src/lib/ares_data.c', + 'src/lib/ares_data.h', + 'src/lib/ares_destroy.c', + 'src/lib/ares_expand_name.c', + 'src/lib/ares_expand_string.c', + 'src/lib/ares_fds.c', + 'src/lib/ares_free_hostent.c', + 'src/lib/ares_free_string.c', + 'src/lib/ares_freeaddrinfo.c', + 'src/lib/ares_getenv.h', + 'src/lib/ares_getaddrinfo.c', + 'src/lib/ares_gethostbyaddr.c', + 'src/lib/ares_gethostbyname.c', + 'src/lib/ares__get_hostent.c', + 'src/lib/ares_getnameinfo.c', + 'src/lib/ares_getsock.c', + 'src/lib/ares_init.c', + 'src/lib/ares_ipv6.h', + 'src/lib/ares_library_init.c', + 'src/lib/ares_llist.c', + 'src/lib/ares_llist.h', + 'src/lib/ares_mkquery.c', + 'src/lib/ares_nowarn.c', + 'src/lib/ares_nowarn.h', + 'src/lib/ares_options.c', + 'src/lib/ares__parse_into_addrinfo.c', + 'src/lib/ares_parse_aaaa_reply.c', + 'src/lib/ares_parse_a_reply.c', + 'src/lib/ares_parse_caa_reply.c', + 'src/lib/ares_parse_mx_reply.c', + 'src/lib/ares_parse_naptr_reply.c', + 'src/lib/ares_parse_ns_reply.c', + 'src/lib/ares_parse_ptr_reply.c', + 'src/lib/ares_parse_soa_reply.c', + 'src/lib/ares_parse_srv_reply.c', + 'src/lib/ares_parse_txt_reply.c', + 'src/lib/ares_parse_uri_reply.c', + 'src/lib/ares_platform.h', + 'src/lib/ares_private.h', + 'src/lib/ares_process.c', + 'src/lib/ares_query.c', + 'src/lib/ares__read_line.c', + 'src/lib/ares__readaddrinfo.c', + 'src/lib/ares_search.c', + 'src/lib/ares_send.c', + 'src/lib/ares_setup.h', + 'src/lib/ares__sortaddrinfo.c', + 'src/lib/ares_strcasecmp.c', + 'src/lib/ares_strcasecmp.h', + 'src/lib/ares_strdup.c', + 'src/lib/ares_strdup.h', + 'src/lib/ares_strerror.c', + 'src/lib/ares_strsplit.c', + 'src/lib/ares_timeout.c', + 'src/lib/ares__timeval.c', + 'src/lib/ares_version.c', + 'src/lib/ares_writev.c', + 'src/lib/ares_writev.h', + 'src/lib/bitncmp.c', + 'src/lib/bitncmp.h', + 'src/lib/inet_net_pton.c', + 'src/lib/inet_ntop.c', + 'src/lib/ares_inet_net_pton.h', + 'src/lib/setup_once.h', + 'src/tools/ares_getopt.c', + 'src/tools/ares_getopt.h', + ], + 'cares_sources_win': [ + 'src/lib/config-win32.h', + 'src/lib/windows_port.c', + 'src/lib/ares_getenv.c', + 'src/lib/ares_iphlpapi.h', + 'src/lib/ares_platform.c', + ], + }, + 'target_defaults': { 'conditions': [ ['OS!="win"', { @@ -35,84 +124,7 @@ 'include_dirs': [ 'include' ] }, 'sources': [ - 'include/ares.h', - 'include/ares_dns.h', - 'include/ares_nameser.h', - 'include/ares_rules.h', - 'include/ares_version.h', - 'src/lib/ares__addrinfo2hostent.c', - 'src/lib/ares__addrinfo_localhost.c', - 'src/lib/ares_android.c', - 'src/lib/ares_cancel.c', - 'src/lib/ares__close_sockets.c', - 'src/lib/ares_create_query.c', - 'src/lib/ares_data.c', - 'src/lib/ares_data.h', - 'src/lib/ares_destroy.c', - 'src/lib/ares_expand_name.c', - 'src/lib/ares_expand_string.c', - 'src/lib/ares_fds.c', - 'src/lib/ares_free_hostent.c', - 'src/lib/ares_free_string.c', - 'src/lib/ares_freeaddrinfo.c', - 'src/lib/ares_getenv.h', - 'src/lib/ares_getaddrinfo.c', - 'src/lib/ares_gethostbyaddr.c', - 'src/lib/ares_gethostbyname.c', - 'src/lib/ares__get_hostent.c', - 'src/lib/ares_getnameinfo.c', - 'src/lib/ares_getsock.c', - 'src/lib/ares_init.c', - 'src/lib/ares_ipv6.h', - 'src/lib/ares_library_init.c', - 'src/lib/ares_library_init.h', - 'src/lib/ares_llist.c', - 'src/lib/ares_llist.h', - 'src/lib/ares_mkquery.c', - 'src/lib/ares_nowarn.c', - 'src/lib/ares_nowarn.h', - 'src/lib/ares_options.c', - 'src/lib/ares__parse_into_addrinfo.c', - 'src/lib/ares_parse_aaaa_reply.c', - 'src/lib/ares_parse_a_reply.c', - 'src/lib/ares_parse_caa_reply.c', - 'src/lib/ares_parse_mx_reply.c', - 'src/lib/ares_parse_naptr_reply.c', - 'src/lib/ares_parse_ns_reply.c', - 'src/lib/ares_parse_ptr_reply.c', - 'src/lib/ares_parse_soa_reply.c', - 'src/lib/ares_parse_srv_reply.c', - 'src/lib/ares_parse_txt_reply.c', - 'src/lib/ares_parse_uri_reply.c', - 'src/lib/ares_platform.h', - 'src/lib/ares_private.h', - 'src/lib/ares_process.c', - 'src/lib/ares_query.c', - 'src/lib/ares__read_line.c', - 'src/lib/ares__readaddrinfo.c', - 'src/lib/ares_search.c', - 'src/lib/ares_send.c', - 'src/lib/ares_setup.h', - 'src/lib/ares__sortaddrinfo.c', - 'src/lib/ares_strcasecmp.c', - 'src/lib/ares_strcasecmp.h', - 'src/lib/ares_strdup.c', - 'src/lib/ares_strdup.h', - 'src/lib/ares_strerror.c', - 'src/lib/ares_strsplit.c', - 'src/lib/ares_timeout.c', - 'src/lib/ares__timeval.c', - 'src/lib/ares_version.c', - 'src/lib/ares_writev.c', - 'src/lib/ares_writev.h', - 'src/lib/bitncmp.c', - 'src/lib/bitncmp.h', - 'src/lib/inet_net_pton.c', - 'src/lib/inet_ntop.c', - 'src/lib/ares_inet_net_pton.h', - 'src/lib/setup_once.h', - 'src/tools/ares_getopt.c', - 'src/tools/ares_getopt.h', + '<@(cares_sources_common)', ], 'conditions': [ [ 'library=="static_library"', { @@ -127,11 +139,7 @@ ], 'include_dirs': [ 'config/win32' ], 'sources': [ - 'src/lib/config-win32.h', - 'src/lib/windows_port.c', - 'src/lib/ares_getenv.c', - 'src/lib/ares_iphlpapi.h', - 'src/lib/ares_platform.c' + '<@(cares_sources_win)', ], 'libraries': [ '-lws2_32.lib', diff --git a/deps/corepack/CHANGELOG.md b/deps/corepack/CHANGELOG.md index 71167e79cd6461..ecdc81f8a9ebca 100644 --- a/deps/corepack/CHANGELOG.md +++ b/deps/corepack/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## [0.17.2](https://github.com/nodejs/corepack/compare/v0.17.1...v0.17.2) (2023-04-07) + + +### Features + +* update package manager versions ([#249](https://github.com/nodejs/corepack/issues/249)) ([2507e9b](https://github.com/nodejs/corepack/commit/2507e9b317eacdeb939aee086de5711218ebd794)) + +## [0.17.1](https://github.com/nodejs/corepack/compare/v0.17.0...v0.17.1) (2023-03-17) + + +### Features + +* update package manager versions ([#245](https://github.com/nodejs/corepack/issues/245)) ([673f3b7](https://github.com/nodejs/corepack/commit/673f3b7f18421a49da1e2c55656666a74ce94474)) + ## [0.17.0](https://github.com/nodejs/corepack/compare/v0.16.0...v0.17.0) (2023-02-24) diff --git a/deps/corepack/README.md b/deps/corepack/README.md index 8d76baea4bbf8d..a68555daf5f318 100644 --- a/deps/corepack/README.md +++ b/deps/corepack/README.md @@ -1,21 +1,30 @@ # corepack -Corepack is a zero-runtime-dependency Node.js script that acts as a bridge between Node.js projects and the package managers they are intended to be used with during development. In practical terms, **Corepack will let you use Yarn and pnpm without having to install them** - just like what currently happens with npm, which is shipped by Node.js by default. +Corepack is a zero-runtime-dependency Node.js script that acts as a bridge +between Node.js projects and the package managers they are intended to be used +with during development. In practical terms, **Corepack will let you use Yarn +and pnpm without having to install them** - just like what currently happens +with npm, which is shipped by Node.js by default. -**Important:** At the moment, Corepack only covers Yarn and pnpm. Given that we have little control on the npm project, we prefer to focus on the Yarn and pnpm use cases. As a result, Corepack doesn't have any effect at all on the way you use npm. +**Important:** At the moment, Corepack only covers Yarn and pnpm. Given that we +have little control on the npm project, we prefer to focus on the Yarn and pnpm +use cases. As a result, Corepack doesn't have any effect at all on the way you +use npm. ## How to Install ### Default Installs -Corepack is distributed by default with Node.js 14.19.0 and 16.9.0, but is opt-in for the time being. Run `corepack enable` to install the required shims. +Corepack is distributed by default with Node.js 14.19.0 and 16.9.0, but is +opt-in for the time being. Run `corepack enable` to install the required shims. ### Manual Installs
Click here to see how to install Corepack using npm -First uninstall your global Yarn and pnpm binaries (just leave npm). In general, you'd do this by running the following command: +First uninstall your global Yarn and pnpm binaries (just leave npm). In general, +you'd do this by running the following command: ```shell npm uninstall -g yarn pnpm @@ -30,7 +39,9 @@ Then install Corepack: npm install -g corepack ``` -We do acknowledge the irony and overhead of using npm to install Corepack, which is at least part of why the preferred option is to use the Corepack version that is distributed along with Node.js itself. +We do acknowledge the irony and overhead of using npm to install Corepack, which +is at least part of why the preferred option is to use the Corepack version that +is distributed along with Node.js itself.
@@ -38,13 +49,21 @@ We do acknowledge the irony and overhead of using npm to install Corepack, which ### When Building Packages -Just use your package managers as you usually would. Run `yarn install` in Yarn projects, `pnpm install` in pnpm projects, and `npm` in npm projects. Corepack will catch these calls, and depending on the situation: +Just use your package managers as you usually would. Run `yarn install` in Yarn +projects, `pnpm install` in pnpm projects, and `npm` in npm projects. Corepack +will catch these calls, and depending on the situation: -- **If the local project is configured for the package manager you're using**, Corepack will silently download and cache the latest compatible version. +- **If the local project is configured for the package manager you're using**, + Corepack will silently download and cache the latest compatible version. -- **If the local project is configured for a different package manager**, Corepack will request you to run the command again using the right package manager - thus avoiding corruptions of your install artifacts. +- **If the local project is configured for a different package manager**, + Corepack will request you to run the command again using the right package + manager - thus avoiding corruptions of your install artifacts. -- **If the local project isn't configured for any package manager**, Corepack will assume that you know what you're doing, and will use whatever package manager version has been pinned as "known good release". Check the relevant section for more details. +- **If the local project isn't configured for any package manager**, Corepack + will assume that you know what you're doing, and will use whatever package + manager version has been pinned as "known good release". Check the relevant + section for more details. ### When Authoring Packages @@ -56,13 +75,18 @@ Set your package's manager with the `packageManager` field in `package.json`: } ``` -Here, `yarn` is the name of the package manager, specified at version `3.2.3`, along with the SHA-224 hash of this version for validation. `packageManager@x.y.z` is required. The hash is optional but strongly recommended as a security practice. Permitted values for the package manager are `yarn`, `npm`, and `pnpm`. +Here, `yarn` is the name of the package manager, specified at version `3.2.3`, +along with the SHA-224 hash of this version for validation. +`packageManager@x.y.z` is required. The hash is optional but strongly +recommended as a security practice. Permitted values for the package manager are +`yarn`, `npm`, and `pnpm`. ## Known Good Releases When running Corepack within projects that don't list a supported package manager, it will default to a set of Known Good Releases. In a way, you can -compare this to Node.js, where each version ships with a specific version of npm. +compare this to Node.js, where each version ships with a specific version of +npm. If there is no Known Good Release for the requested package manager, Corepack looks up the npm registry for the latest available version and cache it for @@ -75,53 +99,76 @@ from the `corepack prepare` and `corepack hydrate` commands. The utility commands detailed in the next section. -- Either you can use the network while building your container image, in which case you'll simply run `corepack prepare` to make sure that your image includes the Last Known Good release for the specified package manager. +- Either you can use the network while building your container image, in which + case you'll simply run `corepack prepare` to make sure that your image + includes the Last Known Good release for the specified package manager. - - If you want to have *all* Last Known Good releases for all package managers, just use the `--all` flag which will do just that. + - If you want to have _all_ Last Known Good releases for all package managers, + just use the `--all` flag which will do just that. -- Or you're publishing your project to a system where the network is unavailable, in which case you'll preemptively generate a package manager archive from your local computer (using `corepack prepare -o`) before storing it somewhere your container will be able to access (for example within your repository). After that it'll just be a matter of running `corepack hydrate ` to setup the cache. +- Or you're publishing your project to a system where the network is + unavailable, in which case you'll preemptively generate a package manager + archive from your local computer (using `corepack prepare -o`) before storing + it somewhere your container will be able to access (for example within your + repository). After that it'll just be a matter of running + `corepack hydrate ` to setup the cache. ## Utility Commands ### `corepack [@] [... args]` -This meta-command runs the specified package manager in the local folder. You can use it to force an install to run with a given version, which can be useful when looking for regressions. +This meta-command runs the specified package manager in the local folder. You +can use it to force an install to run with a given version, which can be useful +when looking for regressions. -Note that those commands still check whether the local project is configured for the given package manager (ie you won't be able to run `corepack yarn install` on a project where the `packageManager` field references `pnpm`). +Note that those commands still check whether the local project is configured for +the given package manager (ie you won't be able to run `corepack yarn install` +on a project where the `packageManager` field references `pnpm`). ### `corepack enable [... name]` -| Option | Description | -| --- | --- | +| Option | Description | +| --------------------- | --------------------------------------- | | `--install-directory` | Add the shims to the specified location | -This command will detect where Node.js is installed and will create shims next to it for each of the specified package managers (or all of them if the command is called without parameters). Note that the npm shims will not be installed unless explicitly requested, as npm is currently distributed with Node.js through other means. +This command will detect where Node.js is installed and will create shims next +to it for each of the specified package managers (or all of them if the command +is called without parameters). Note that the npm shims will not be installed +unless explicitly requested, as npm is currently distributed with Node.js +through other means. ### `corepack disable [... name]` -| Option | Description | -| --- | --- | +| Option | Description | +| --------------------- | ------------------------------------------ | | `--install-directory` | Remove the shims to the specified location | -This command will detect where Node.js is installed and will remove the shims from there. +This command will detect where Node.js is installed and will remove the shims +from there. ### `corepack prepare [... name@version]` -| Option | Description | -| --- | --- | -| `--all` | Prepare the "Last Known Good" version of all supported package managers | -| `-o,--output` | Also generate an archive containing the package managers | -| `--activate` | Also update the "Last Known Good" release | +| Option | Description | +| ------------- | ----------------------------------------------------------------------- | +| `--all` | Prepare the "Last Known Good" version of all supported package managers | +| `-o,--output` | Also generate an archive containing the package managers | +| `--activate` | Also update the "Last Known Good" release | -This command will download the given package managers (or the one configured for the local project if no argument is passed in parameter) and store it within the Corepack cache. If the `-o,--output` flag is set (optionally with a path as parameter), an archive will also be generated that can be used by the `corepack hydrate` command. +This command will download the given package managers (or the one configured for +the local project if no argument is passed in parameter) and store it within the +Corepack cache. If the `-o,--output` flag is set (optionally with a path as +parameter), an archive will also be generated that can be used by the +`corepack hydrate` command. ### `corepack hydrate ` -| Option | Description | -| --- | --- | +| Option | Description | +| ------------ | ----------------------------------------- | | `--activate` | Also update the "Last Known Good" release | -This command will retrieve the given package manager from the specified archive and will install it within the Corepack cache, ready to be used without further network interaction. +This command will retrieve the given package manager from the specified archive +and will install it within the Corepack cache, ready to be used without further +network interaction. ## Environment Variables @@ -134,31 +181,41 @@ This command will retrieve the given package manager from the specified archive manager versions that will be required for the projects you'll run, using `corepack hydrate`). -- `COREPACK_ENABLE_STRICT` can be set to `0` to prevent Corepack from throwing error - if the package manager does not correspond to the one defined for the current project. - This means that if a user is using the package manager specified in the current project, - it will use the version specified by the project's `packageManager` field. - But if the user is using other package manager different from the one specified - for the current project, it will use the system-wide package manager version. +- `COREPACK_ENABLE_STRICT` can be set to `0` to prevent Corepack from throwing + error if the package manager does not correspond to the one defined for the + current project. This means that if a user is using the package manager + specified in the current project, it will use the version specified by the + project's `packageManager` field. But if the user is using other package + manager different from the one specified for the current project, it will use + the system-wide package manager version. -- `COREPACK_ENABLE_PROJECT_SPEC` can be set to `0` to prevent Corepack from checking - if the package manager corresponds to the one defined for the current project. - This means that it will always use the system-wide package manager regardless of - what is being specified in the project's `packageManager` field. +- `COREPACK_ENABLE_PROJECT_SPEC` can be set to `0` to prevent Corepack from + checking if the package manager corresponds to the one defined for the current + project. This means that it will always use the system-wide package manager + regardless of what is being specified in the project's `packageManager` field. - `COREPACK_HOME` can be set in order to define where Corepack should install the package managers. By default it is set to `%LOCALAPPDATA%\node\corepack` on Windows, and to `$HOME/.cache/node/corepack` everywhere else. -- `COREPACK_ROOT` has no functional impact on Corepack itself; it's automatically being set in your environment by Corepack when it shells out to the underlying package managers, so that they can feature-detect its presence (useful for commands like `yarn init`). +- `COREPACK_ROOT` has no functional impact on Corepack itself; it's + automatically being set in your environment by Corepack when it shells out to + the underlying package managers, so that they can feature-detect its presence + (useful for commands like `yarn init`). -- `COREPACK_NPM_REGISTRY` sets the registry base url used when retrieving package managers from npm. Default value is `https://registry.npmjs.org` +- `COREPACK_NPM_REGISTRY` sets the registry base url used when retrieving + package managers from npm. Default value is `https://registry.npmjs.org` -- `COREPACK_NPM_TOKEN` sets a Bearer token authorization header when connecting to a npm type registry. +- `COREPACK_NPM_TOKEN` sets a Bearer token authorization header when connecting + to a npm type registry. -- `COREPACK_NPM_USERNAME` and `COREPACK_NPM_PASSWORD` to set a Basic authorization header when connecting to a npm type registry. Note that both environment variables are required and as plain text. If you want to send an empty password, explicitly set `COREPACK_NPM_PASSWORD` to an empty string. +- `COREPACK_NPM_USERNAME` and `COREPACK_NPM_PASSWORD` to set a Basic + authorization header when connecting to a npm type registry. Note that both + environment variables are required and as plain text. If you want to send an + empty password, explicitly set `COREPACK_NPM_PASSWORD` to an empty string. -- `HTTP_PROXY`, `HTTPS_PROXY`, and `NO_PROXY` are supported through [`node-proxy-agent`](https://github.com/TooTallNate/node-proxy-agent). +- `HTTP_PROXY`, `HTTPS_PROXY`, and `NO_PROXY` are supported through + [`node-proxy-agent`](https://github.com/TooTallNate/node-proxy-agent). ## Contributing diff --git a/deps/corepack/dist/corepack.js b/deps/corepack/dist/corepack.js index 79d93830e8278c..9468470f0d7aca 100755 --- a/deps/corepack/dist/corepack.js +++ b/deps/corepack/dist/corepack.js @@ -43737,7 +43737,7 @@ function String2(descriptor, ...args) { } // package.json -var version = "0.17.0"; +var version = "0.17.2"; // sources/Engine.ts var import_fs3 = __toESM(require("fs")); @@ -43749,7 +43749,7 @@ var import_semver3 = __toESM(require_semver2()); var config_default = { definitions: { npm: { - default: "9.5.1+sha1.dc74eb85d07d78e24fadc674968a1ea16b18108c", + default: "9.6.4+sha1.ff4798c9778badac2fae83078ead9a88680978c2", fetchLatestFrom: { type: "npm", package: "npm" @@ -43780,7 +43780,7 @@ var config_default = { } }, pnpm: { - default: "7.27.1+sha1.75c15a7a16389531192dab282e45aacdac1ed4c0", + default: "7.31.0+sha1.ad35cb3e7d298041e54c98924ed3b65e7475b7ce", fetchLatestFrom: { type: "npm", package: "pnpm" @@ -43832,7 +43832,7 @@ var config_default = { package: "yarn" }, transparent: { - default: "3.4.1+sha224.cca891d4a8671d4898aba3426674bb734dbbf88cef82dd4dacd71c9f", + default: "3.5.0+sha224.8f42459cf3e9d5e6b89b7f432466d6b4017c6d948798ba16725e047f", commands: [ [ "yarn", diff --git a/deps/corepack/package.json b/deps/corepack/package.json index bf81b36b4dc6e6..575020af883036 100644 --- a/deps/corepack/package.json +++ b/deps/corepack/package.json @@ -1,6 +1,6 @@ { "name": "corepack", - "version": "0.17.0", + "version": "0.17.2", "homepage": "https://github.com/nodejs/corepack#readme", "bugs": { "url": "https://github.com/nodejs/corepack/issues" diff --git a/deps/googletest/googletest.gyp b/deps/googletest/googletest.gyp index 0b4ef28d582aa7..cf21a665f7ceb4 100644 --- a/deps/googletest/googletest.gyp +++ b/deps/googletest/googletest.gyp @@ -1,45 +1,46 @@ { + 'variables': { + 'googletest_sources': [ + 'include/gtest/gtest-assertion-result.h', + 'include/gtest/gtest-death-test.h', + 'include/gtest/gtest-matchers.h', + 'include/gtest/gtest-message.h', + 'include/gtest/gtest-param-test.h', + 'include/gtest/gtest-printers.h', + 'include/gtest/gtest-spi.h', + 'include/gtest/gtest-test-part.h', + 'include/gtest/gtest-typed-test.h', + 'include/gtest/gtest.h', + 'include/gtest/gtest_pred_impl.h', + 'include/gtest/internal/custom/gtest-port.h', + 'include/gtest/internal/custom/gtest-printers.h', + 'include/gtest/internal/custom/gtest.h', + 'include/gtest/internal/gtest-death-test-internal.h', + 'include/gtest/internal/gtest-filepath.h', + 'include/gtest/internal/gtest-internal.h', + 'include/gtest/internal/gtest-param-util.h', + 'include/gtest/internal/gtest-port-arch.h', + 'include/gtest/internal/gtest-port.h', + 'include/gtest/internal/gtest-string.h', + 'include/gtest/internal/gtest-type-util.h', + 'src/gtest-assertion-result.cc', + 'src/gtest-death-test.cc', + 'src/gtest-filepath.cc', + 'src/gtest-internal-inl.h', + 'src/gtest-matchers.cc', + 'src/gtest-port.cc', + 'src/gtest-printers.cc', + 'src/gtest-test-part.cc', + 'src/gtest-typed-test.cc', + 'src/gtest.cc', + ] + }, 'targets': [ { 'target_name': 'gtest', 'type': 'static_library', 'sources': [ - 'include/gtest/gtest-assertion-result.h', - 'include/gtest/gtest-death-test.h', - 'include/gtest/gtest-matchers.h', - 'include/gtest/gtest-message.h', - 'include/gtest/gtest-param-test.h', - 'include/gtest/gtest-printers.h', - 'include/gtest/gtest-spi.h', - 'include/gtest/gtest-test-part.h', - 'include/gtest/gtest-typed-test.h', - 'include/gtest/gtest.h', - 'include/gtest/gtest_pred_impl.h', - 'include/gtest/internal/custom/gtest-port.h', - 'include/gtest/internal/custom/gtest-printers.h', - 'include/gtest/internal/custom/gtest.h', - 'include/gtest/internal/gtest-death-test-internal.h', - 'include/gtest/internal/gtest-filepath.h', - 'include/gtest/internal/gtest-internal.h', - 'include/gtest/internal/gtest-param-util.h', - 'include/gtest/internal/gtest-port-arch.h', - 'include/gtest/internal/gtest-port.h', - 'include/gtest/internal/gtest-string.h', - 'include/gtest/internal/gtest-type-util.h', - 'src/gtest-all.cc', - 'src/gtest-assertion-result.cc', - 'src/gtest-death-test.cc', - 'src/gtest-filepath.cc', - 'src/gtest-internal-inl.h', - 'src/gtest-matchers.cc', - 'src/gtest-port.cc', - 'src/gtest-printers.cc', - 'src/gtest-test-part.cc', - 'src/gtest-typed-test.cc', - 'src/gtest.cc', - ], - 'sources!': [ - 'src/gtest-all.cc', # Not needed by our build. + '<@(googletest_sources)', ], 'include_dirs': [ '.', # src diff --git a/deps/histogram/histogram.gyp b/deps/histogram/histogram.gyp index e3f5fd7a46bb72..54999412ad99d7 100644 --- a/deps/histogram/histogram.gyp +++ b/deps/histogram/histogram.gyp @@ -1,4 +1,9 @@ { + 'variables': { + 'histogram_sources': [ + 'src/hdr_histogram.c', + ] + }, 'targets': [ { 'target_name': 'histogram', @@ -12,7 +17,7 @@ 'include_dirs': [ 'src' ] }, 'sources': [ - 'src/hdr_histogram.c', + '<@(histogram_sources)', ] } ] diff --git a/deps/histogram/src/hdr_atomic.h b/deps/histogram/src/hdr_atomic.h index ae1056a83612af..11b0cbd3facfdc 100644 --- a/deps/histogram/src/hdr_atomic.h +++ b/deps/histogram/src/hdr_atomic.h @@ -8,7 +8,7 @@ #define HDR_ATOMIC_H__ -#if defined(_MSC_VER) +#if defined(_MSC_VER) && !(defined(__clang__) && (defined(_M_ARM) || defined(_M_ARM64))) #include #include diff --git a/deps/histogram/src/hdr_histogram.c b/deps/histogram/src/hdr_histogram.c index 4bcfbeb049bf59..0132cbeba7c84e 100644 --- a/deps/histogram/src/hdr_histogram.c +++ b/deps/histogram/src/hdr_histogram.c @@ -127,7 +127,7 @@ static int64_t power(int64_t base, int64_t exp) return result; } -#if defined(_MSC_VER) +#if defined(_MSC_VER) && !(defined(__clang__) && (defined(_M_ARM) || defined(_M_ARM64))) # if defined(_WIN64) # pragma intrinsic(_BitScanReverse64) # else @@ -137,7 +137,7 @@ static int64_t power(int64_t base, int64_t exp) static int32_t count_leading_zeros_64(int64_t value) { -#if defined(_MSC_VER) +#if defined(_MSC_VER) && !(defined(__clang__) && (defined(_M_ARM) || defined(_M_ARM64))) uint32_t leading_zero = 0; #if defined(_WIN64) _BitScanReverse64(&leading_zero, value); diff --git a/deps/icu-small/source/data/in/icudt72l.dat.bz2 b/deps/icu-small/source/data/in/icudt72l.dat.bz2 index 1fc12b4e8cd277..eb26b48458649d 100644 Binary files a/deps/icu-small/source/data/in/icudt72l.dat.bz2 and b/deps/icu-small/source/data/in/icudt72l.dat.bz2 differ diff --git a/deps/llhttp/llhttp.gyp b/deps/llhttp/llhttp.gyp index 4acc79bdf399fc..c7b8800a4f18c4 100644 --- a/deps/llhttp/llhttp.gyp +++ b/deps/llhttp/llhttp.gyp @@ -1,4 +1,11 @@ { + 'variables': { + 'llhttp_sources': [ + 'src/llhttp.c', + 'src/api.c', + 'src/http.c', + ] + }, 'targets': [ { 'target_name': 'llhttp', @@ -7,7 +14,9 @@ 'direct_dependent_settings': { 'include_dirs': [ 'include' ], }, - 'sources': [ 'src/llhttp.c', 'src/api.c', 'src/http.c' ], + 'sources': [ + '<@(llhttp_sources)', + ], }, ] } diff --git a/deps/nghttp2/nghttp2.gyp b/deps/nghttp2/nghttp2.gyp index c4a18650efe789..4e48a707cc2197 100644 --- a/deps/nghttp2/nghttp2.gyp +++ b/deps/nghttp2/nghttp2.gyp @@ -1,4 +1,31 @@ { + 'variables': { + 'nghttp2_sources': [ + 'lib/nghttp2_buf.c', + 'lib/nghttp2_callbacks.c', + 'lib/nghttp2_debug.c', + 'lib/nghttp2_extpri.c', + 'lib/nghttp2_frame.c', + 'lib/nghttp2_hd.c', + 'lib/nghttp2_hd_huffman.c', + 'lib/nghttp2_hd_huffman_data.c', + 'lib/nghttp2_helper.c', + 'lib/nghttp2_http.c', + 'lib/nghttp2_map.c', + 'lib/nghttp2_mem.c', + 'lib/nghttp2_npn.c', + 'lib/nghttp2_option.c', + 'lib/nghttp2_outbound_item.c', + 'lib/nghttp2_pq.c', + 'lib/nghttp2_priority_spec.c', + 'lib/nghttp2_queue.c', + 'lib/nghttp2_rcbuf.c', + 'lib/nghttp2_session.c', + 'lib/nghttp2_stream.c', + 'lib/nghttp2_submit.c', + 'lib/nghttp2_version.c', + ] + }, 'target_defaults': { 'defines': [ '_U_=' @@ -35,29 +62,7 @@ 'include_dirs': [ 'lib/includes' ] }, 'sources': [ - 'lib/nghttp2_buf.c', - 'lib/nghttp2_callbacks.c', - 'lib/nghttp2_debug.c', - 'lib/nghttp2_extpri.c', - 'lib/nghttp2_frame.c', - 'lib/nghttp2_hd.c', - 'lib/nghttp2_hd_huffman.c', - 'lib/nghttp2_hd_huffman_data.c', - 'lib/nghttp2_helper.c', - 'lib/nghttp2_http.c', - 'lib/nghttp2_map.c', - 'lib/nghttp2_mem.c', - 'lib/nghttp2_npn.c', - 'lib/nghttp2_option.c', - 'lib/nghttp2_outbound_item.c', - 'lib/nghttp2_pq.c', - 'lib/nghttp2_priority_spec.c', - 'lib/nghttp2_queue.c', - 'lib/nghttp2_rcbuf.c', - 'lib/nghttp2_session.c', - 'lib/nghttp2_stream.c', - 'lib/nghttp2_submit.c', - 'lib/nghttp2_version.c' + '<@(nghttp2_sources)', ] } ] diff --git a/deps/ngtcp2/nghttp3/lib/nghttp3_ringbuf.c b/deps/ngtcp2/nghttp3/lib/nghttp3_ringbuf.c index 9ea91c81c8a1b9..5e7775f1a5a597 100644 --- a/deps/ngtcp2/nghttp3/lib/nghttp3_ringbuf.c +++ b/deps/ngtcp2/nghttp3/lib/nghttp3_ringbuf.c @@ -33,7 +33,7 @@ #include "nghttp3_macro.h" -#if defined(_MSC_VER) && defined(_M_ARM64) +#if defined(_MSC_VER) && !defined(__clang__) && (defined(_M_ARM) || defined(_M_ARM64)) unsigned int __popcnt(unsigned int x) { unsigned int c = 0; for (; x; ++c) { diff --git a/deps/ngtcp2/ngtcp2/lib/ngtcp2_ringbuf.c b/deps/ngtcp2/ngtcp2/lib/ngtcp2_ringbuf.c index a6b3f73e73339c..74e488bce76f24 100644 --- a/deps/ngtcp2/ngtcp2/lib/ngtcp2_ringbuf.c +++ b/deps/ngtcp2/ngtcp2/lib/ngtcp2_ringbuf.c @@ -31,7 +31,7 @@ #include "ngtcp2_macro.h" -#if defined(_MSC_VER) && defined(_M_ARM64) +#if defined(_MSC_VER) && !defined(__clang__) && (defined(_M_ARM) || defined(_M_ARM64)) unsigned int __popcnt(unsigned int x) { unsigned int c = 0; for (; x; ++c) { diff --git a/deps/npm/README.md b/deps/npm/README.md index b88882fadfee09..da46ce7f38075e 100644 --- a/deps/npm/README.md +++ b/deps/npm/README.md @@ -27,17 +27,7 @@ curl -qL https://www.npmjs.com/install.sh | sh #### Node Version Managers -If you're looking to manage multiple versions of **`node`** &/or **`npm`**, consider using a "Node Version Manager" such as: - -* [**`nvm`**](https://github.com/nvm-sh/nvm) -* [**`nvs`**](https://github.com/jasongin/nvs) -* [**`nave`**](https://github.com/isaacs/nave) -* [**`n`**](https://github.com/tj/n) -* [**`volta`**](https://github.com/volta-cli/volta) -* [**`nodenv`**](https://github.com/nodenv/nodenv) -* [**`asdf-nodejs`**](https://github.com/asdf-vm/asdf-nodejs) -* [**`nvm-windows`**](https://github.com/coreybutler/nvm-windows) -* [**`fnm`**](https://github.com/Schniz/fnm) +If you're looking to manage multiple versions of **`Node.js`** &/or **`npm`**, consider using a [node version manager](https://github.com/search?q=node+version+manager+archived%3Afalse&type=repositories&ref=advsearch) ### Usage diff --git a/deps/npm/docs/content/commands/npm-install-ci-test.md b/deps/npm/docs/content/commands/npm-install-ci-test.md index f4db7ee0c54dca..5a8095787a1708 100644 --- a/deps/npm/docs/content/commands/npm-install-ci-test.md +++ b/deps/npm/docs/content/commands/npm-install-ci-test.md @@ -9,7 +9,7 @@ description: Install a project with a clean slate and run tests ```bash npm install-ci-test -alias: cit +aliases: cit, clean-install-test, sit ``` ### Description diff --git a/deps/npm/docs/content/commands/npm-ls.md b/deps/npm/docs/content/commands/npm-ls.md index 139e6ec56e3f87..5fd8b033c91182 100644 --- a/deps/npm/docs/content/commands/npm-ls.md +++ b/deps/npm/docs/content/commands/npm-ls.md @@ -27,7 +27,7 @@ packages will *also* show the paths to the specified packages. For example, running `npm ls promzard` in npm's source tree will show: ```bash -npm@9.5.1 /path/to/npm +npm@9.6.4 /path/to/npm └─┬ init-package-json@0.0.4 └── promzard@0.1.5 ``` diff --git a/deps/npm/docs/content/commands/npm-prefix.md b/deps/npm/docs/content/commands/npm-prefix.md index 2711501625db0b..e17a26d346b875 100644 --- a/deps/npm/docs/content/commands/npm-prefix.md +++ b/deps/npm/docs/content/commands/npm-prefix.md @@ -52,7 +52,6 @@ folder instead of the current working directory. See ### See Also * [npm root](/commands/npm-root) -* [npm bin](/commands/npm-bin) * [npm folders](/configuring-npm/folders) * [npm config](/commands/npm-config) * [npmrc](/configuring-npm/npmrc) diff --git a/deps/npm/docs/content/commands/npm-publish.md b/deps/npm/docs/content/commands/npm-publish.md index 3d88a805fbb497..ec1cf3755b7360 100644 --- a/deps/npm/docs/content/commands/npm-publish.md +++ b/deps/npm/docs/content/commands/npm-publish.md @@ -52,7 +52,7 @@ to the registry. ### Files included in package -To see what will be included in your package, run `npx npm-packlist`. All +To see what will be included in your package, run `npm pack --dry-run`. All files are included by default, with the following exceptions: - Certain files that are relevant to package installation and distribution diff --git a/deps/npm/docs/content/commands/npm-root.md b/deps/npm/docs/content/commands/npm-root.md index b34321eb961394..41777d30255620 100644 --- a/deps/npm/docs/content/commands/npm-root.md +++ b/deps/npm/docs/content/commands/npm-root.md @@ -44,7 +44,6 @@ folder instead of the current working directory. See ### See Also * [npm prefix](/commands/npm-prefix) -* [npm bin](/commands/npm-bin) * [npm folders](/configuring-npm/folders) * [npm config](/commands/npm-config) * [npmrc](/configuring-npm/npmrc) diff --git a/deps/npm/docs/content/commands/npm.md b/deps/npm/docs/content/commands/npm.md index 6d6f5771e3b0c6..579b7771c01b5a 100644 --- a/deps/npm/docs/content/commands/npm.md +++ b/deps/npm/docs/content/commands/npm.md @@ -14,7 +14,7 @@ Note: This command is unaware of workspaces. ### Version -9.5.1 +9.6.4 ### Description diff --git a/deps/npm/docs/content/configuring-npm/install.md b/deps/npm/docs/content/configuring-npm/install.md index 18b4421687ba9a..d9c1d32631fa14 100644 --- a/deps/npm/docs/content/configuring-npm/install.md +++ b/deps/npm/docs/content/configuring-npm/install.md @@ -38,17 +38,8 @@ npm -v Node version managers allow you to install and switch between multiple versions of Node.js and npm on your system so you can test your applications on multiple versions of npm to ensure they work for users on -different versions. - -#### OSX or Linux Node version managers - -* [nvm](https://github.com/creationix/nvm) -* [n](https://github.com/tj/n) - -#### Windows Node version managers - -* [nodist](https://github.com/marcelklehr/nodist) -* [nvm-windows](https://github.com/coreybutler/nvm-windows) +different versions. You can +[search for them on GitHub](https://github.com/search?q=node+version+manager+archived%3Afalse&type=repositories&ref=advsearch). ### Using a Node installer to install Node.js and npm diff --git a/deps/npm/docs/content/configuring-npm/package-lock-json.md b/deps/npm/docs/content/configuring-npm/package-lock-json.md index 61766dea355b36..8904f308870982 100644 --- a/deps/npm/docs/content/configuring-npm/package-lock-json.md +++ b/deps/npm/docs/content/configuring-npm/package-lock-json.md @@ -112,12 +112,9 @@ the npm registry. Lockfiles generated by npm v7 will contain * No version provided: an "ancient" shrinkwrap file from a version of npm prior to npm v5. * `1`: The lockfile version used by npm v5 and v6. -* `2`: The lockfile version used by npm v7, which is backwards compatible - to v1 lockfiles. -* `3`: The lockfile version used by npm v7, _without_ backwards - compatibility affordances. This is used for the hidden lockfile at - `node_modules/.package-lock.json`, and will likely be used in a future - version of npm, once support for npm v6 is no longer relevant. +* `2`: The lockfile version used by npm v7 and v8. Backwards compatible to v1 + lockfiles. +* `3`: The lockfile version used by npm v9. Backwards compatible to npm v7. npm will always attempt to get whatever data it can out of a lockfile, even if it is not a version that it was designed to support. diff --git a/deps/npm/docs/output/commands/npm-install-ci-test.html b/deps/npm/docs/output/commands/npm-install-ci-test.html index b2f6a3affbbafa..20b001f4e856b6 100644 --- a/deps/npm/docs/output/commands/npm-install-ci-test.html +++ b/deps/npm/docs/output/commands/npm-install-ci-test.html @@ -148,7 +148,7 @@

Table of contents

Synopsis

npm install-ci-test
 
-alias: cit
+aliases: cit, clean-install-test, sit
 

Description

This command runs npm ci followed immediately by npm test.

diff --git a/deps/npm/docs/output/commands/npm-ls.html b/deps/npm/docs/output/commands/npm-ls.html index 26d3dce7718e76..fc3101558f5097 100644 --- a/deps/npm/docs/output/commands/npm-ls.html +++ b/deps/npm/docs/output/commands/npm-ls.html @@ -160,7 +160,7 @@

Description

the results to only the paths to the packages named. Note that nested packages will also show the paths to the specified packages. For example, running npm ls promzard in npm's source tree will show:

-
npm@9.5.1 /path/to/npm
+
npm@9.6.4 /path/to/npm
 └─┬ init-package-json@0.0.4
   └── promzard@0.1.5
 
diff --git a/deps/npm/docs/output/commands/npm-prefix.html b/deps/npm/docs/output/commands/npm-prefix.html index ef6dc0fd9de88a..41789e3e315088 100644 --- a/deps/npm/docs/output/commands/npm-prefix.html +++ b/deps/npm/docs/output/commands/npm-prefix.html @@ -180,7 +180,6 @@

global

See Also

  • npm root
  • -
  • npm bin
  • npm folders
  • npm config
  • npmrc
  • diff --git a/deps/npm/docs/output/commands/npm-publish.html b/deps/npm/docs/output/commands/npm-publish.html index a2a4f0aad05647..000fc787123007 100644 --- a/deps/npm/docs/output/commands/npm-publish.html +++ b/deps/npm/docs/output/commands/npm-publish.html @@ -181,7 +181,7 @@

    Description

    out the files to be included and packs them into a tarball to be uploaded to the registry.

    Files included in package

    -

    To see what will be included in your package, run npx npm-packlist. All +

    To see what will be included in your package, run npm pack --dry-run. All files are included by default, with the following exceptions:

    • diff --git a/deps/npm/docs/output/commands/npm-root.html b/deps/npm/docs/output/commands/npm-root.html index 24436056c97676..d300a0caaf8fb6 100644 --- a/deps/npm/docs/output/commands/npm-root.html +++ b/deps/npm/docs/output/commands/npm-root.html @@ -175,7 +175,6 @@

      global

      See Also

      • npm prefix
      • -
      • npm bin
      • npm folders
      • npm config
      • npmrc
      • diff --git a/deps/npm/docs/output/commands/npm.html b/deps/npm/docs/output/commands/npm.html index d16a1cec6c69e8..72218f072d68ae 100644 --- a/deps/npm/docs/output/commands/npm.html +++ b/deps/npm/docs/output/commands/npm.html @@ -150,7 +150,7 @@

        Table of contents

Note: This command is unaware of workspaces.

Version

-

9.5.1

+

9.6.4

Description

npm is the package manager for the Node JavaScript platform. It puts modules in place so that node can find them, and manages dependency diff --git a/deps/npm/docs/output/configuring-npm/install.html b/deps/npm/docs/output/configuring-npm/install.html index 7acebd7fda9950..996082d018ea30 100644 --- a/deps/npm/docs/output/configuring-npm/install.html +++ b/deps/npm/docs/output/configuring-npm/install.html @@ -142,7 +142,7 @@

install

Table of contents

- +

Description

@@ -172,17 +172,8 @@

Using a Node ver

Node version managers allow you to install and switch between multiple versions of Node.js and npm on your system so you can test your applications on multiple versions of npm to ensure they work for users on -different versions.

-

OSX or Linux Node version managers

- -

Windows Node version managers

- +different versions. You can +search for them on GitHub.

Using a Node installer to install Node.js and npm

If you are unable to use a Node version manager, you can use a Node installer to install both Node.js and npm on your system.

diff --git a/deps/npm/docs/output/configuring-npm/package-lock-json.html b/deps/npm/docs/output/configuring-npm/package-lock-json.html index 59b757568f016c..7587b4ad6056a8 100644 --- a/deps/npm/docs/output/configuring-npm/package-lock-json.html +++ b/deps/npm/docs/output/configuring-npm/package-lock-json.html @@ -239,12 +239,9 @@

lockfileVersion

  • No version provided: an "ancient" shrinkwrap file from a version of npm prior to npm v5.
  • 1: The lockfile version used by npm v5 and v6.
  • -
  • 2: The lockfile version used by npm v7, which is backwards compatible -to v1 lockfiles.
  • -
  • 3: The lockfile version used by npm v7, without backwards -compatibility affordances. This is used for the hidden lockfile at -node_modules/.package-lock.json, and will likely be used in a future -version of npm, once support for npm v6 is no longer relevant.
  • +
  • 2: The lockfile version used by npm v7 and v8. Backwards compatible to v1 +lockfiles.
  • +
  • 3: The lockfile version used by npm v9. Backwards compatible to npm v7.
  • npm will always attempt to get whatever data it can out of a lockfile, even if it is not a version that it was designed to support.

    diff --git a/deps/npm/lib/cli.js b/deps/npm/lib/cli.js index 007778aa4b9866..a393626f08291f 100644 --- a/deps/npm/lib/cli.js +++ b/deps/npm/lib/cli.js @@ -1,41 +1,28 @@ -// This is separate to indicate that it should contain code we expect to work in -// all conceivably runnable versions of node. This is a best effort to catch -// syntax errors to give users a good error message if they are using a node -// version that doesn't allow syntax we are using such as private properties, etc -const createEnginesValidation = () => { - const node = process.version.replace(/-.*$/, '') +/* eslint-disable max-len */ +// Code in this file should work in all conceivably runnable versions of node. +// A best effort is made to catch syntax errors to give users a good error message if they are using a node version that doesn't allow syntax we are using in other files such as private properties, etc + +// Separated out for easier unit testing +module.exports = async process => { + // set it here so that regardless of what happens later, we don't + // leak any private CLI configs to other programs + process.title = 'npm' + + // if npm is called as "npmg" or "npm_g", then run in global mode. + if (process.argv[1][process.argv[1].length - 1] === 'g') { + process.argv.splice(1, 1, 'npm', '-g') + } + + const nodeVersion = process.version.replace(/-.*$/, '') const pkg = require('../package.json') const engines = pkg.engines.node - const npm = `v${pkg.version}` - - const cols = Math.min(Math.max(20, process.stdout.columns) || 80, 80) - const wrap = (lines) => lines - .join(' ') - .split(/[ \n]+/) - .reduce((left, right) => { - const last = left.split('\n').pop() - const join = last.length && last.length + right.length > cols ? '\n' : ' ' - return left + join + right - }) - .trim() - - const unsupportedMessage = wrap([ - `npm ${npm} does not support Node.js ${node}.`, - `You should probably upgrade to a newer version of node as we can't make any`, - `promises that npm will work with this version.`, - `This version of npm supports the following node versions: \`${engines}\`.`, - 'You can find the latest version at https://nodejs.org/.', - ]) - - const brokenMessage = wrap([ - `ERROR: npm ${npm} is known not to run on Node.js ${node}.`, - `You'll need to upgrade to a newer Node.js version in order to use this version of npm.`, - `This version of npm supports the following node versions: \`${engines}\`.`, - 'You can find the latest version at https://nodejs.org/.', - ]) - - // coverage ignored because this is only hit in very unsupported node versions - // and it's a best effort attempt to show something nice in those cases + const npmVersion = `v${pkg.version}` + + const unsupportedMessage = `npm ${npmVersion} does not support Node.js ${nodeVersion}. This version of npm supports the following node versions: \`${engines}\`. You can find the latest version at https://nodejs.org/.` + + const brokenMessage = `ERROR: npm ${npmVersion} is known not to run on Node.js ${nodeVersion}. This version of npm supports the following node versions: \`${engines}\`. You can find the latest version at https://nodejs.org/.` + + // Coverage ignored because this is only hit in very unsupported node versions and it's a best effort attempt to show something nice in those cases /* istanbul ignore next */ const syntaxErrorHandler = (err) => { if (err instanceof SyntaxError) { @@ -51,74 +38,42 @@ const createEnginesValidation = () => { process.on('uncaughtException', syntaxErrorHandler) process.on('unhandledRejection', syntaxErrorHandler) - return { - node, - engines, - unsupportedMessage, - off: () => { - process.off('uncaughtException', syntaxErrorHandler) - process.off('unhandledRejection', syntaxErrorHandler) - }, - } -} - -// Separated out for easier unit testing -module.exports = async process => { - // set it here so that regardless of what happens later, we don't - // leak any private CLI configs to other programs - process.title = 'npm' - - // if npm is called as "npmg" or "npm_g", then run in global mode. - if (process.argv[1][process.argv[1].length - 1] === 'g') { - process.argv.splice(1, 1, 'npm', '-g') - } - - // Nothing should happen before this line if we can't guarantee it will - // not have syntax errors in some version of node - const validateEngines = createEnginesValidation() - const satisfies = require('semver/functions/satisfies') const exitHandler = require('./utils/exit-handler.js') const Npm = require('./npm.js') const npm = new Npm() exitHandler.setNpm(npm) - // only log node and npm paths in argv initially since argv can contain - // sensitive info. a cleaned version will be logged later + // only log node and npm paths in argv initially since argv can contain sensitive info. a cleaned version will be logged later const log = require('./utils/log-shim.js') log.verbose('cli', process.argv.slice(0, 2).join(' ')) log.info('using', 'npm@%s', npm.version) log.info('using', 'node@%s', process.version) - // At this point we've required a few files and can be pretty sure - // we dont contain invalid syntax for this version of node. It's - // possible a lazy require would, but that's unlikely enough that - // it's not worth catching anymore and we attach the more important - // exit handlers. - validateEngines.off() + // At this point we've required a few files and can be pretty sure we dont contain invalid syntax for this version of node. It's possible a lazy require would, but that's unlikely enough that it's not worth catching anymore and we attach the more important exit handlers. + process.off('uncaughtException', syntaxErrorHandler) + process.off('unhandledRejection', syntaxErrorHandler) process.on('uncaughtException', exitHandler) process.on('unhandledRejection', exitHandler) - // It is now safe to log a warning if they are using a version of node - // that is not going to fail on syntax errors but is still unsupported - // and untested and might not work reliably. This is safe to use the logger - // now which we want since this will show up in the error log too. - if (!satisfies(validateEngines.node, validateEngines.engines)) { - log.warn('cli', validateEngines.unsupportedMessage) + // It is now safe to log a warning if they are using a version of node that is not going to fail on syntax errors but is still unsupported and untested and might not work reliably. This is safe to use the logger now which we want since this will show up in the error log too. + if (!satisfies(nodeVersion, engines)) { + log.warn('cli', unsupportedMessage) } let cmd - // now actually fire up npm and run the command. - // this is how to use npm programmatically: + // Now actually fire up npm and run the command. + // This is how to use npm programmatically: try { await npm.load() + // npm -v if (npm.config.get('version', 'cli')) { npm.output(npm.version) return exitHandler() } - // npm --versions=cli + // npm --versions if (npm.config.get('versions', 'cli')) { npm.argv = ['version'] npm.config.set('usage', false, 'cli') diff --git a/deps/npm/lib/commands/access.js b/deps/npm/lib/commands/access.js index 23e51f071b1124..318151fc81e2c0 100644 --- a/deps/npm/lib/commands/access.js +++ b/deps/npm/lib/commands/access.js @@ -53,20 +53,22 @@ class Access extends BaseCommand { return commands } - switch (argv[2]) { - case 'grant': - return ['read-only', 'read-write'] - case 'revoke': - return [] - case 'list': - case 'ls': - return ['packages', 'collaborators'] - case 'get': - return ['status'] - case 'set': - return setCommands - default: - throw new Error(argv[2] + ' not recognized') + if (argv.length === 3) { + switch (argv[2]) { + case 'grant': + return ['read-only', 'read-write'] + case 'revoke': + return [] + case 'list': + case 'ls': + return ['packages', 'collaborators'] + case 'get': + return ['status'] + case 'set': + return setCommands + default: + throw new Error(argv[2] + ' not recognized') + } } } @@ -116,11 +118,11 @@ class Access extends BaseCommand { } async #grant (permissions, scope, pkg) { - await libnpmaccess.setPermissions(scope, pkg, permissions) + await libnpmaccess.setPermissions(scope, pkg, permissions, this.npm.flatOptions) } async #revoke (scope, pkg) { - await libnpmaccess.removePermissions(scope, pkg) + await libnpmaccess.removePermissions(scope, pkg, this.npm.flatOptions) } async #listPackages (owner, pkg) { diff --git a/deps/npm/lib/commands/audit.js b/deps/npm/lib/commands/audit.js index 05830fff69c2ea..dab871669eba59 100644 --- a/deps/npm/lib/commands/audit.js +++ b/deps/npm/lib/commands/audit.js @@ -389,11 +389,12 @@ class Audit extends ArboristWorkspaceCmd { const argv = opts.conf.argv.remain if (argv.length === 2) { - return ['fix'] + return ['fix', 'signatures'] } switch (argv[2]) { case 'fix': + case 'signatures': return [] default: throw Object.assign(new Error(argv[2] + ' not recognized'), { diff --git a/deps/npm/lib/commands/completion.js b/deps/npm/lib/commands/completion.js index f5604e099f9a27..efbad9d61001b5 100644 --- a/deps/npm/lib/commands/completion.js +++ b/deps/npm/lib/commands/completion.js @@ -34,9 +34,7 @@ const nopt = require('nopt') const { resolve } = require('path') const { definitions, shorthands } = require('../utils/config/index.js') -const { aliases, commands, plumbing } = require('../utils/cmd-list.js') -const aliasNames = Object.keys(aliases) -const fullList = commands.concat(aliasNames).filter(c => !plumbing.includes(c)) +const { commands, aliases } = require('../utils/cmd-list.js') const configNames = Object.keys(definitions) const shorthandNames = Object.keys(shorthands) const allConfs = configNames.concat(shorthandNames) @@ -79,12 +77,10 @@ class Completion extends BaseCommand { }) } - const { COMP_CWORD, COMP_LINE, COMP_POINT } = process.env + const { COMP_CWORD, COMP_LINE, COMP_POINT, COMP_FISH } = process.env // if the COMP_* isn't in the env, then just dump the script. - if (COMP_CWORD === undefined || - COMP_LINE === undefined || - COMP_POINT === undefined) { + if (COMP_CWORD === undefined || COMP_LINE === undefined || COMP_POINT === undefined) { return dumpScript(resolve(this.npm.npmRoot, 'lib', 'utils', 'completion.sh')) } @@ -111,6 +107,7 @@ class Completion extends BaseCommand { partialWords.push(partialWord) const opts = { + isFish: COMP_FISH === 'true', words, w, word, @@ -264,7 +261,8 @@ const isFlag = word => { // complete against the npm commands // if they all resolve to the same thing, just return the thing it already is const cmdCompl = (opts, npm) => { - const matches = fullList.filter(c => c.startsWith(opts.partialWord)) + const allCommands = commands.concat(Object.keys(aliases)) + const matches = allCommands.filter(c => c.startsWith(opts.partialWord)) if (!matches.length) { return matches } @@ -274,7 +272,7 @@ const cmdCompl = (opts, npm) => { return [...derefs] } - return fullList + return allCommands } module.exports = Completion diff --git a/deps/npm/lib/commands/explain.js b/deps/npm/lib/commands/explain.js index a06ad24152a1e4..44c32c0e5663a1 100644 --- a/deps/npm/lib/commands/explain.js +++ b/deps/npm/lib/commands/explain.js @@ -78,7 +78,7 @@ class Explain extends ArboristWorkspaceCmd { this.npm.output(JSON.stringify(expls, null, 2)) } else { this.npm.output(expls.map(expl => { - return explainNode(expl, Infinity, this.npm.color) + return explainNode(expl, Infinity, this.npm.chalk) }).join('\n\n')) } } diff --git a/deps/npm/lib/commands/fund.js b/deps/npm/lib/commands/fund.js index 12762533c123e6..479ff487ec8b01 100644 --- a/deps/npm/lib/commands/fund.js +++ b/deps/npm/lib/commands/fund.js @@ -1,6 +1,5 @@ const archy = require('archy') const Arborist = require('@npmcli/arborist') -const chalk = require('chalk') const pacote = require('pacote') const semver = require('semver') const npa = require('npm-package-arg') @@ -96,7 +95,6 @@ class Fund extends ArboristWorkspaceCmd { } printHuman (fundingInfo) { - const color = this.npm.color const unicode = this.npm.config.get('unicode') const seenUrls = new Map() @@ -117,7 +115,7 @@ class Fund extends ArboristWorkspaceCmd { if (url) { item.label = tree({ - label: color ? chalk.bgBlack.white(url) : url, + label: this.npm.chalk.bgBlack.white(url), nodes: [pkgRef], }).trim() @@ -154,7 +152,7 @@ class Fund extends ArboristWorkspaceCmd { }) const res = tree(result) - return color ? chalk.reset(res) : res + return this.npm.chalk.reset(res) } async openFundingUrl ({ path, tree, spec, fundingSourceNumber }) { diff --git a/deps/npm/lib/commands/help-search.js b/deps/npm/lib/commands/help-search.js index afb82bfaca9eea..0a706be70a0675 100644 --- a/deps/npm/lib/commands/help-search.js +++ b/deps/npm/lib/commands/help-search.js @@ -1,9 +1,6 @@ -const fs = require('fs') +const { readFile } = require('fs/promises') const path = require('path') -const chalk = require('chalk') -const { promisify } = require('util') -const glob = promisify(require('glob')) -const readFile = promisify(fs.readFile) +const glob = require('glob') const BaseCommand = require('../base-command.js') const globify = pattern => pattern.split('\\').join('/') @@ -20,7 +17,9 @@ class HelpSearch extends BaseCommand { } const docPath = path.resolve(this.npm.npmRoot, 'docs/content') - const files = await glob(`${globify(docPath)}/*/*.md`) + let files = await glob(`${globify(docPath)}/*/*.md`) + // preserve glob@8 behavior + files = files.sort((a, b) => a.localeCompare(b, 'en')) const data = await this.readFiles(files) const results = await this.searchFiles(args, data, files) const formatted = this.formatResults(args, results) @@ -163,10 +162,6 @@ class HelpSearch extends BaseCommand { return } - if (!this.npm.color) { - out.push(line + '\n') - return - } const hilitLine = [] for (const arg of args) { const finder = line.toLowerCase().split(arg.toLowerCase()) @@ -174,7 +169,7 @@ class HelpSearch extends BaseCommand { for (const f of finder) { hilitLine.push(line.slice(p, p + f.length)) const word = line.slice(p + f.length, p + f.length + arg.length) - const hilit = chalk.bgBlack.red(word) + const hilit = this.npm.chalk.bgBlack.red(word) hilitLine.push(hilit) p += f.length + arg.length } diff --git a/deps/npm/lib/commands/help.js b/deps/npm/lib/commands/help.js index 28f18e7edcef70..d89f3f64363480 100644 --- a/deps/npm/lib/commands/help.js +++ b/deps/npm/lib/commands/help.js @@ -1,8 +1,7 @@ const spawn = require('@npmcli/promise-spawn') const path = require('path') const openUrl = require('../utils/open-url.js') -const { promisify } = require('util') -const glob = promisify(require('glob')) +const glob = require('glob') const localeCompare = require('@isaacs/string-locale-compare')('en') const globify = pattern => pattern.split('\\').join('/') @@ -12,8 +11,6 @@ const BaseCommand = require('../base-command.js') // We don't currently compress our man pages but if we ever did this would // seamlessly continue supporting it const manNumberRegex = /\.(\d+)(\.[^/\\]*)?$/ -// Searches for the "npm-" prefix in page names, to prefer those. -const manNpmPrefixRegex = /\/npm-/ // hardcoded names for mansections // XXX: these are used in the docs workspace and should be exported // from npm so section names can changed more easily @@ -34,7 +31,9 @@ class Help extends BaseCommand { return [] } const g = path.resolve(this.npm.npmRoot, 'man/man[0-9]/*.[0-9]') - const files = await glob(globify(g)) + let files = await glob(globify(g)) + // preserve glob@8 behavior + files = files.sort((a, b) => a.localeCompare(b, 'en')) return Object.keys(files.reduce(function (acc, file) { file = path.basename(file).replace(/\.[0-9]+$/, '') @@ -65,31 +64,13 @@ class Help extends BaseCommand { const f = globify(path.resolve(this.npm.npmRoot, `man/${manSearch}/?(npm-)${arg}.[0-9]*`)) const [man] = await glob(f).then(r => r.sort((a, b) => { - // Prefer the page with an npm prefix, if there's only one. - const aHasPrefix = manNpmPrefixRegex.test(a) - const bHasPrefix = manNpmPrefixRegex.test(b) - if (aHasPrefix !== bHasPrefix) { - /* istanbul ignore next */ - return aHasPrefix ? -1 : 1 - } - // Because the glob is (subtly) different from manNumberRegex, // we can't rely on it passing. - const aManNumberMatch = a.match(manNumberRegex) - const bManNumberMatch = b.match(manNumberRegex) - if (aManNumberMatch) { - /* istanbul ignore next */ - if (!bManNumberMatch) { - return -1 - } - // man number sort first so that 1 aka commands are preferred - if (aManNumberMatch[1] !== bManNumberMatch[1]) { - return aManNumberMatch[1] - bManNumberMatch[1] - } - } else if (bManNumberMatch) { - return 1 + const aManNumberMatch = a.match(manNumberRegex)?.[1] || 999 + const bManNumberMatch = b.match(manNumberRegex)?.[1] || 999 + if (aManNumberMatch !== bManNumberMatch) { + return aManNumberMatch - bManNumberMatch } - return localeCompare(a, b) })) diff --git a/deps/npm/lib/commands/ls.js b/deps/npm/lib/commands/ls.js index 2213e7937407a9..a737f44b73b29f 100644 --- a/deps/npm/lib/commands/ls.js +++ b/deps/npm/lib/commands/ls.js @@ -3,7 +3,6 @@ const relativePrefix = `.${sep}` const { EOL } = require('os') const archy = require('archy') -const chalk = require('chalk') const Arborist = require('@npmcli/arborist') const { breadth } = require('treeverse') const npa = require('npm-package-arg') @@ -50,7 +49,7 @@ class LS extends ArboristWorkspaceCmd { async exec (args) { const all = this.npm.config.get('all') - const color = this.npm.color + const chalk = this.npm.chalk const depth = this.npm.config.get('depth') const global = this.npm.global const json = this.npm.config.get('json') @@ -157,7 +156,7 @@ class LS extends ArboristWorkspaceCmd { ? getJsonOutputItem(node, { global, long }) : parseable ? null - : getHumanOutputItem(node, { args, color, global, long }) + : getHumanOutputItem(node, { args, chalk, global, long }) // loop through list of node problems to add them to global list if (node[_include]) { @@ -180,7 +179,7 @@ class LS extends ArboristWorkspaceCmd { this.npm.outputBuffer( json ? jsonOutput({ path, problems, result, rootError, seenItems }) : parseable ? parseableOutput({ seenNodes, global, long }) : - humanOutput({ color, result, seenItems, unicode }) + humanOutput({ chalk, result, seenItems, unicode }) ) // if filtering items, should exit with error code on no results @@ -278,9 +277,9 @@ const augmentItemWithIncludeMetadata = (node, item) => { return item } -const getHumanOutputItem = (node, { args, color, global, long }) => { +const getHumanOutputItem = (node, { args, chalk, global, long }) => { const { pkgid, path } = node - const workspacePkgId = color ? chalk.green(pkgid) : pkgid + const workspacePkgId = chalk.green(pkgid) let printable = node.isWorkspace ? workspacePkgId : pkgid // special formatting for top-level package name @@ -293,8 +292,7 @@ const getHumanOutputItem = (node, { args, color, global, long }) => { } } - const highlightDepName = - color && args.length && node[_filteredBy] + const highlightDepName = args.length && node[_filteredBy] const missingColor = isOptional(node) ? chalk.yellow.bgBlack : chalk.red.bgBlack @@ -308,28 +306,28 @@ const getHumanOutputItem = (node, { args, color, global, long }) => { const label = ( node[_missing] - ? (color ? missingColor(missingMsg) : missingMsg) + ' ' + ? missingColor(missingMsg) + ' ' : '' ) + `${highlightDepName ? chalk.yellow.bgBlack(printable) : printable}` + ( node[_dedupe] - ? ' ' + (color ? chalk.gray('deduped') : 'deduped') + ? ' ' + chalk.gray('deduped') : '' ) + ( invalid - ? ' ' + (color ? chalk.red.bgBlack(invalid) : invalid) + ? ' ' + chalk.red.bgBlack(invalid) : '' ) + ( isExtraneous(node, { global }) - ? ' ' + (color ? chalk.green.bgBlack('extraneous') : 'extraneous') + ? ' ' + chalk.green.bgBlack('extraneous') : '' ) + ( node.overridden - ? ' ' + (color ? chalk.gray('overridden') : 'overridden') + ? ' ' + chalk.gray('overridden') : '' ) + (isGitNode(node) ? ` (${node.resolved})` : '') + @@ -504,7 +502,7 @@ const augmentNodesWithMetadata = ({ const sortAlphabetically = ({ pkgid: a }, { pkgid: b }) => localeCompare(a, b) -const humanOutput = ({ color, result, seenItems, unicode }) => { +const humanOutput = ({ chalk, result, seenItems, unicode }) => { // we need to traverse the entire tree in order to determine which items // should be included (since a nested transitive included dep will make it // so that all its ancestors should be displayed) @@ -520,7 +518,7 @@ const humanOutput = ({ color, result, seenItems, unicode }) => { } const archyOutput = archy(result, '', { unicode }) - return color ? chalk.reset(archyOutput) : archyOutput + return chalk.reset(archyOutput) } const jsonOutput = ({ path, problems, result, rootError, seenItems }) => { diff --git a/deps/npm/lib/commands/outdated.js b/deps/npm/lib/commands/outdated.js index 5e8a4e0d2168c5..49626ebd5e20ed 100644 --- a/deps/npm/lib/commands/outdated.js +++ b/deps/npm/lib/commands/outdated.js @@ -2,7 +2,6 @@ const os = require('os') const { resolve } = require('path') const pacote = require('pacote') const table = require('text-table') -const chalk = require('chalk') const npa = require('npm-package-arg') const pickManifest = require('npm-pick-manifest') const localeCompare = require('@isaacs/string-locale-compare')('en') @@ -104,9 +103,7 @@ class Outdated extends ArboristWorkspaceCmd { } const outTable = [outHead].concat(outList) - if (this.npm.color) { - outTable[0] = outTable[0].map(heading => chalk.underline(heading)) - } + outTable[0] = outTable[0].map(heading => this.npm.chalk.underline(heading)) const tableOpts = { align: ['l', 'r', 'r', 'r', 'l'], @@ -281,8 +278,8 @@ class Outdated extends ArboristWorkspaceCmd { ? node.pkgid : node.name - return this.npm.color && humanOutput - ? chalk.green(workspaceName) + return humanOutput + ? this.npm.chalk.green(workspaceName) : workspaceName } @@ -306,11 +303,9 @@ class Outdated extends ArboristWorkspaceCmd { columns[7] = homepage } - if (this.npm.color) { - columns[0] = chalk[current === wanted ? 'yellow' : 'red'](columns[0]) // current - columns[2] = chalk.green(columns[2]) // wanted - columns[3] = chalk.magenta(columns[3]) // latest - } + columns[0] = this.npm.chalk[current === wanted ? 'yellow' : 'red'](columns[0]) // current + columns[2] = this.npm.chalk.green(columns[2]) // wanted + columns[3] = this.npm.chalk.magenta(columns[3]) // latest return columns } diff --git a/deps/npm/lib/commands/profile.js b/deps/npm/lib/commands/profile.js index e42ebb276d202e..4fba1209e03350 100644 --- a/deps/npm/lib/commands/profile.js +++ b/deps/npm/lib/commands/profile.js @@ -1,6 +1,5 @@ const inspect = require('util').inspect const { URL } = require('url') -const chalk = require('chalk') const log = require('../utils/log-shim.js') const npmProfile = require('npm-profile') const qrcodeTerminal = require('qrcode-terminal') @@ -161,7 +160,7 @@ class Profile extends BaseCommand { } else { const table = new Table() for (const key of Object.keys(cleaned)) { - table.push({ [chalk.bold(key)]: cleaned[key] }) + table.push({ [this.npm.chalk.bold(key)]: cleaned[key] }) } this.npm.output(table.toString()) diff --git a/deps/npm/lib/commands/run-script.js b/deps/npm/lib/commands/run-script.js index 51746c5e5285d9..e1bce0e52a5132 100644 --- a/deps/npm/lib/commands/run-script.js +++ b/deps/npm/lib/commands/run-script.js @@ -1,5 +1,4 @@ const { resolve } = require('path') -const chalk = require('chalk') const runScript = require('@npmcli/run-script') const { isServerPackage } = runScript const rpj = require('read-package-json-fast') @@ -18,14 +17,6 @@ const cmdList = [ 'version', ].reduce((l, p) => l.concat(['pre' + p, p, 'post' + p]), []) -const nocolor = { - reset: s => s, - bold: s => s, - dim: s => s, - blue: s => s, - green: s => s, -} - const BaseCommand = require('../base-command.js') class RunScript extends BaseCommand { static description = 'Run arbitrary package scripts' @@ -51,6 +42,9 @@ class RunScript extends BaseCommand { // find the script name const json = resolve(this.npm.localPrefix, 'package.json') const { scripts = {} } = await rpj(json).catch(er => ({})) + if (opts.isFish) { + return Object.keys(scripts).map(s => `${s}\t${scripts[s].slice(0, 30)}`) + } return Object.keys(scripts) } } @@ -135,7 +129,6 @@ class RunScript extends BaseCommand { path = path || this.npm.localPrefix const { scripts, name, _id } = await rpj(`${path}/package.json`) const pkgid = _id || name - const color = this.npm.color if (!scripts) { return [] @@ -167,7 +160,7 @@ class RunScript extends BaseCommand { const list = cmdList.includes(script) ? cmds : runScripts list.push(script) } - const colorize = color ? chalk : nocolor + const colorize = this.npm.chalk if (cmds.length) { this.npm.output( diff --git a/deps/npm/lib/commands/token.js b/deps/npm/lib/commands/token.js index 8da83118757144..bc2e4f3796364d 100644 --- a/deps/npm/lib/commands/token.js +++ b/deps/npm/lib/commands/token.js @@ -1,5 +1,4 @@ const Table = require('cli-table3') -const chalk = require('chalk') const { v4: isCidrV4, v6: isCidrV6 } = require('is-cidr') const log = require('../utils/log-shim.js') const profile = require('npm-profile') @@ -152,7 +151,7 @@ class Token extends BaseCommand { } else { const table = new Table() for (const k of Object.keys(result)) { - table.push({ [chalk.bold(k)]: String(result[k]) }) + table.push({ [this.npm.chalk.bold(k)]: String(result[k]) }) } this.npm.output(table.toString()) } diff --git a/deps/npm/lib/commands/view.js b/deps/npm/lib/commands/view.js index 855b37b81d42f9..bbe7dcdd18bbf7 100644 --- a/deps/npm/lib/commands/view.js +++ b/deps/npm/lib/commands/view.js @@ -1,4 +1,3 @@ -const chalk = require('chalk') const columns = require('cli-columns') const fs = require('fs') const jsonParse = require('json-parse-even-better-errors') @@ -315,6 +314,7 @@ class View extends BaseCommand { prettyView (packu, manifest) { // More modern, pretty printing of default view const unicode = this.npm.config.get('unicode') + const chalk = this.npm.chalk const tags = [] Object.keys(packu['dist-tags']).forEach((t) => { diff --git a/deps/npm/lib/npm.js b/deps/npm/lib/npm.js index 841d145ddcbad7..5a347a2fd69e8f 100644 --- a/deps/npm/lib/npm.js +++ b/deps/npm/lib/npm.js @@ -5,6 +5,7 @@ const Config = require('@npmcli/config') const chalk = require('chalk') const which = require('which') const fs = require('fs/promises') +const abbrev = require('abbrev') // Patch the global fs module here at the app level require('graceful-fs').gracefulify(require('fs')) @@ -18,7 +19,7 @@ const log = require('./utils/log-shim') const replaceInfo = require('./utils/replace-info.js') const updateNotifier = require('./utils/update-notifier.js') const pkg = require('../package.json') -const cmdList = require('./utils/cmd-list.js') +const { commands, aliases } = require('./utils/cmd-list.js') class Npm extends EventEmitter { static get version () { @@ -36,6 +37,8 @@ class Npm extends EventEmitter { #title = 'npm' #argvClean = [] #chalk = null + #logChalk = null + #noColorChalk = new chalk.Instance({ level: 0 }) #npmRoot = null #warnedNonDashArg = false @@ -84,18 +87,30 @@ class Npm extends EventEmitter { if (!c) { return } + + // Translate camelCase to snake-case (i.e. installTest to install-test) if (c.match(/[A-Z]/)) { c = c.replace(/([A-Z])/g, m => '-' + m.toLowerCase()) } - if (cmdList.plumbing.indexOf(c) !== -1) { + + // if they asked for something exactly we are done + if (commands.includes(c)) { return c } + + // if they asked for a direct alias + if (aliases[c]) { + return aliases[c] + } + + const abbrevs = abbrev(commands.concat(Object.keys(aliases))) + // first deref the abbrev, if there is one // then resolve any aliases // so `npm install-cl` will resolve to `install-clean` then to `ci` - let a = cmdList.abbrevs[c] - while (cmdList.aliases[a]) { - a = cmdList.aliases[a] + let a = abbrevs[c] + while (aliases[a]) { + a = aliases[a] } return a } @@ -248,6 +263,7 @@ class Npm extends EventEmitter { this.#display.load({ // Use logColor since that is based on stderr color: this.logColor, + chalk: this.logChalk, progress: this.flatOptions.progress, silent: this.silent, timing: this.config.get('timing'), @@ -317,17 +333,28 @@ class Npm extends EventEmitter { return this.flatOptions.logColor } + get noColorChalk () { + return this.#noColorChalk + } + get chalk () { if (!this.#chalk) { - let level = chalk.level - if (!this.color) { - level = 0 - } - this.#chalk = new chalk.Instance({ level }) + this.#chalk = new chalk.Instance({ + level: this.color ? chalk.level : 0, + }) } return this.#chalk } + get logChalk () { + if (!this.#logChalk) { + this.#logChalk = new chalk.Instance({ + level: this.logColor ? chalk.stderr.level : 0, + }) + } + return this.#logChalk + } + get global () { return this.config.get('global') || this.config.get('location') === 'global' } diff --git a/deps/npm/lib/utils/audit-error.js b/deps/npm/lib/utils/audit-error.js index 7feccc739b6a9f..aaf35566fc0304 100644 --- a/deps/npm/lib/utils/audit-error.js +++ b/deps/npm/lib/utils/audit-error.js @@ -1,4 +1,5 @@ const log = require('./log-shim') +const replaceInfo = require('./replace-info.js') // print an error or just nothing if the audit report has an error // this is called by the audit command, and by the reify-output util @@ -24,7 +25,7 @@ const auditError = (npm, report) => { npm.output(JSON.stringify({ message: error.message, method: error.method, - uri: error.uri, + uri: replaceInfo(error.uri), headers: error.headers, statusCode: error.statusCode, body, diff --git a/deps/npm/lib/utils/cmd-list.js b/deps/npm/lib/utils/cmd-list.js index 03fe8ed07c930e..e5479139033d57 100644 --- a/deps/npm/lib/utils/cmd-list.js +++ b/deps/npm/lib/utils/cmd-list.js @@ -1,74 +1,5 @@ -const abbrev = require('abbrev') -const localeCompare = require('@isaacs/string-locale-compare')('en') - -// plumbing should not have any aliases -const aliases = { - - // aliases - author: 'owner', - home: 'docs', - issues: 'bugs', - info: 'view', - show: 'view', - find: 'search', - add: 'install', - unlink: 'uninstall', - remove: 'uninstall', - rm: 'uninstall', - r: 'uninstall', - - // short names for common things - un: 'uninstall', - rb: 'rebuild', - list: 'ls', - ln: 'link', - create: 'init', - i: 'install', - it: 'install-test', - cit: 'install-ci-test', - up: 'update', - c: 'config', - s: 'search', - se: 'search', - tst: 'test', - t: 'test', - ddp: 'dedupe', - v: 'view', - run: 'run-script', - 'clean-install': 'ci', - 'clean-install-test': 'cit', - x: 'exec', - why: 'explain', - la: 'll', - verison: 'version', - ic: 'ci', - - // typos - innit: 'init', - // manually abbrev so that install-test doesn't make insta stop working - in: 'install', - ins: 'install', - inst: 'install', - insta: 'install', - instal: 'install', - isnt: 'install', - isnta: 'install', - isntal: 'install', - isntall: 'install', - 'install-clean': 'ci', - 'isntall-clean': 'ci', - hlep: 'help', - 'dist-tags': 'dist-tag', - upgrade: 'update', - udpate: 'update', - rum: 'run-script', - sit: 'cit', - urn: 'run-script', - ogr: 'org', - 'add-user': 'adduser', -} - -// these are filenames in . +// These correspond to filenames in lib/commands +// Please keep this list sorted alphabetically const commands = [ 'access', 'adduser', @@ -92,6 +23,7 @@ const commands = [ 'fund', 'get', 'help', + 'help-search', 'hook', 'init', 'install', @@ -99,7 +31,7 @@ const commands = [ 'install-test', 'link', 'll', - 'login', // This is an alias for `adduser` but it can be confusing + 'login', 'logout', 'ls', 'org', @@ -135,16 +67,76 @@ const commands = [ 'version', 'view', 'whoami', -].sort(localeCompare) +] + +// These must resolve to an entry in commands +const aliases = { + + // aliases + author: 'owner', + home: 'docs', + issues: 'bugs', + info: 'view', + show: 'view', + find: 'search', + add: 'install', + unlink: 'uninstall', + remove: 'uninstall', + rm: 'uninstall', + r: 'uninstall', + + // short names for common things + un: 'uninstall', + rb: 'rebuild', + list: 'ls', + ln: 'link', + create: 'init', + i: 'install', + it: 'install-test', + cit: 'install-ci-test', + up: 'update', + c: 'config', + s: 'search', + se: 'search', + tst: 'test', + t: 'test', + ddp: 'dedupe', + v: 'view', + run: 'run-script', + 'clean-install': 'ci', + 'clean-install-test': 'install-ci-test', + x: 'exec', + why: 'explain', + la: 'll', + verison: 'version', + ic: 'ci', -const plumbing = ['help-search'] -const allCommands = [...commands, ...plumbing].sort(localeCompare) -const abbrevs = abbrev(commands.concat(Object.keys(aliases))) + // typos + innit: 'init', + // manually abbrev so that install-test doesn't make insta stop working + in: 'install', + ins: 'install', + inst: 'install', + insta: 'install', + instal: 'install', + isnt: 'install', + isnta: 'install', + isntal: 'install', + isntall: 'install', + 'install-clean': 'ci', + 'isntall-clean': 'ci', + hlep: 'help', + 'dist-tags': 'dist-tag', + upgrade: 'update', + udpate: 'update', + rum: 'run-script', + sit: 'install-ci-test', + urn: 'run-script', + ogr: 'org', + 'add-user': 'adduser', +} module.exports = { - abbrevs, aliases, commands, - plumbing, - allCommands, } diff --git a/deps/npm/lib/utils/completion.fish b/deps/npm/lib/utils/completion.fish new file mode 100644 index 00000000000000..5e274ad77e5fd0 --- /dev/null +++ b/deps/npm/lib/utils/completion.fish @@ -0,0 +1,40 @@ +# npm completions for Fish shell +# This script is a work in progress and does not fall under the normal semver contract as the rest of npm. + +# __fish_npm_needs_command taken from: +# https://stackoverflow.com/questions/16657803/creating-autocomplete-script-with-sub-commands +function __fish_npm_needs_command + set -l cmd (commandline -opc) + + if test (count $cmd) -eq 1 + return 0 + end + + return 1 +end + +# Taken from https://github.com/fish-shell/fish-shell/blob/HEAD/share/completions/npm.fish +function __fish_complete_npm -d "Complete the commandline using npm's 'completion' tool" + # tell npm we are fish shell + set -lx COMP_FISH true + if command -sq npm + # npm completion is bash-centric, so we need to translate fish's "commandline" stuff to bash's $COMP_* stuff + # COMP_LINE is an array with the words in the commandline + set -lx COMP_LINE (commandline -opc) + # COMP_CWORD is the index of the current word in COMP_LINE + # bash starts arrays with 0, so subtract 1 + set -lx COMP_CWORD (math (count $COMP_LINE) - 1) + # COMP_POINT is the index of point/cursor when the commandline is viewed as a string + set -lx COMP_POINT (commandline -C) + # If the cursor is after the last word, the empty token will disappear in the expansion + # Readd it + if test (commandline -ct) = "" + set COMP_CWORD (math $COMP_CWORD + 1) + set COMP_LINE $COMP_LINE "" + end + command npm completion -- $COMP_LINE 2>/dev/null + end +end + +# flush out what ships with fish +complete -e npm diff --git a/deps/npm/lib/utils/display.js b/deps/npm/lib/utils/display.js index 35d221c09cae89..a41bf903e9a8fa 100644 --- a/deps/npm/lib/utils/display.js +++ b/deps/npm/lib/utils/display.js @@ -4,6 +4,8 @@ const log = require('./log-shim.js') const { explain } = require('./explain-eresolve.js') class Display { + #chalk = null + constructor () { // pause by default until config is loaded this.on() @@ -26,6 +28,7 @@ class Display { load (config) { const { color, + chalk, timing, loglevel, unicode, @@ -34,6 +37,8 @@ class Display { heading = 'npm', } = config + this.#chalk = chalk + // npmlog is still going away someday, so this is a hack to dynamically // set the loglevel of timing based on the timing flag, instead of making // a breaking change to npmlog. The result is that timing logs are never @@ -111,7 +116,7 @@ class Display { expl && typeof expl === 'object' ) { this.#npmlog(level, heading, message) - this.#npmlog(level, '', explain(expl, log.useColor(), 2)) + this.#npmlog(level, '', explain(expl, this.#chalk, 2)) // Return true to short circuit other log in chain return true } diff --git a/deps/npm/lib/utils/error-message.js b/deps/npm/lib/utils/error-message.js index 72c7b9fe4553fd..a2cdb0aa48068c 100644 --- a/deps/npm/lib/utils/error-message.js +++ b/deps/npm/lib/utils/error-message.js @@ -38,7 +38,7 @@ const errorMessage = (er, npm) => { // XXX(display): error messages are logged so we use the logColor since that is based // on stderr. This should be handled solely by the display layer so it could also be // printed to stdout if necessary. - const { explanation, file } = report(er, !!npm.logColor) + const { explanation, file } = report(er, npm.logChalk, npm.noColorChalk) detail.push(['', explanation]) files.push(['eresolve-report.txt', file]) break @@ -247,16 +247,34 @@ const errorMessage = (er, npm) => { break case 'EBADPLATFORM': { - const validOs = - er.required && er.required.os && er.required.os.join - ? er.required.os.join(',') - : er.required.os - const validArch = - er.required && er.required.cpu && er.required.cpu.join - ? er.required.cpu.join(',') - : er.required.cpu - const expected = { os: validOs, arch: validArch } - const actual = { os: process.platform, arch: process.arch } + const actual = er.current + const expected = { ...er.required } + const checkedKeys = [] + for (const key in expected) { + if (Array.isArray(expected[key]) && expected[key].length > 0) { + expected[key] = expected[key].join(',') + checkedKeys.push(key) + } else if (expected[key] === undefined || + Array.isArray(expected[key]) && expected[key].length === 0) { + delete expected[key] + delete actual[key] + } else { + checkedKeys.push(key) + } + } + + const longestKey = Math.max(...checkedKeys.map((key) => key.length)) + const detailEntry = [] + for (const key of checkedKeys) { + const padding = key.length === longestKey + ? 1 + : 1 + (longestKey - key.length) + + // padding + 1 because 'actual' is longer than 'valid' + detailEntry.push(`Valid ${key}:${' '.repeat(padding + 1)}${expected[key]}`) + detailEntry.push(`Actual ${key}:${' '.repeat(padding)}${actual[key]}`) + } + short.push([ 'notsup', [ @@ -270,12 +288,7 @@ const errorMessage = (er, npm) => { ]) detail.push([ 'notsup', - [ - 'Valid OS: ' + validOs, - 'Valid Arch: ' + validArch, - 'Actual OS: ' + process.platform, - 'Actual Arch: ' + process.arch, - ].join('\n'), + detailEntry.join('\n'), ]) break } diff --git a/deps/npm/lib/utils/exit-handler.js b/deps/npm/lib/utils/exit-handler.js index b5fc7042bd0209..b5d6cd030fb5c3 100644 --- a/deps/npm/lib/utils/exit-handler.js +++ b/deps/npm/lib/utils/exit-handler.js @@ -5,8 +5,6 @@ const log = require('./log-shim.js') const errorMessage = require('./error-message.js') const replaceInfo = require('./replace-info.js') -const indent = (val) => Array.isArray(val) ? val.map(v => indent(v)) : ` ${val}` - let npm = null // set by the cli let exitHandlerCalled = false let showLogFileError = false @@ -73,7 +71,7 @@ process.on('exit', code => { const message = [] if (timingFile) { - message.push('Timing info written to:', indent(timingFile)) + message.push(`Timing info written to: ${timingFile}`) } else if (timing) { message.push( `The timing file was not written due to an error writing to the directory: ${timingDir}` @@ -81,7 +79,7 @@ process.on('exit', code => { } if (logFiles.length) { - message.push('A complete log of this run can be found in:', ...indent(logFiles)) + message.push(`A complete log of this run can be found in: ${logFiles}`) } else if (logsMax <= 0) { // user specified no log file message.push(`Log files were not written due to the config logs-max=${logsMax}`) diff --git a/deps/npm/lib/utils/explain-dep.js b/deps/npm/lib/utils/explain-dep.js index 58258026491dc1..86660d5d3ad4b0 100644 --- a/deps/npm/lib/utils/explain-dep.js +++ b/deps/npm/lib/utils/explain-dep.js @@ -1,25 +1,12 @@ -const chalk = require('chalk') -const nocolor = { - bold: s => s, - dim: s => s, - red: s => s, - yellow: s => s, - cyan: s => s, - magenta: s => s, - blue: s => s, - green: s => s, - gray: s => s, -} - const { relative } = require('path') -const explainNode = (node, depth, color) => - printNode(node, color) + - explainDependents(node, depth, color) + - explainLinksIn(node, depth, color) +const explainNode = (node, depth, chalk) => + printNode(node, chalk) + + explainDependents(node, depth, chalk) + + explainLinksIn(node, depth, chalk) -const colorType = (type, color) => { - const { red, yellow, cyan, magenta, blue, green, gray } = color ? chalk : nocolor +const colorType = (type, chalk) => { + const { red, yellow, cyan, magenta, blue, green, gray } = chalk const style = type === 'extraneous' ? red : type === 'dev' ? yellow : type === 'optional' ? cyan @@ -31,7 +18,7 @@ const colorType = (type, color) => { return style(type) } -const printNode = (node, color) => { +const printNode = (node, chalk) => { const { name, version, @@ -44,30 +31,30 @@ const printNode = (node, color) => { isWorkspace, overridden, } = node - const { bold, dim, green } = color ? chalk : nocolor + const { bold, dim, green } = chalk const extra = [] if (extraneous) { - extra.push(' ' + bold(colorType('extraneous', color))) + extra.push(' ' + bold(colorType('extraneous', chalk))) } if (dev) { - extra.push(' ' + bold(colorType('dev', color))) + extra.push(' ' + bold(colorType('dev', chalk))) } if (optional) { - extra.push(' ' + bold(colorType('optional', color))) + extra.push(' ' + bold(colorType('optional', chalk))) } if (peer) { - extra.push(' ' + bold(colorType('peer', color))) + extra.push(' ' + bold(colorType('peer', chalk))) } if (bundled) { - extra.push(' ' + bold(colorType('bundled', color))) + extra.push(' ' + bold(colorType('bundled', chalk))) } if (overridden) { - extra.push(' ' + bold(colorType('overridden', color))) + extra.push(' ' + bold(colorType('overridden', chalk))) } const pkgid = isWorkspace @@ -78,24 +65,24 @@ const printNode = (node, color) => { (location ? dim(`\n${location}`) : '') } -const explainLinksIn = ({ linksIn }, depth, color) => { +const explainLinksIn = ({ linksIn }, depth, chalk) => { if (!linksIn || !linksIn.length || depth <= 0) { return '' } - const messages = linksIn.map(link => explainNode(link, depth - 1, color)) + const messages = linksIn.map(link => explainNode(link, depth - 1, chalk)) const str = '\n' + messages.join('\n') return str.split('\n').join('\n ') } -const explainDependents = ({ name, dependents }, depth, color) => { +const explainDependents = ({ name, dependents }, depth, chalk) => { if (!dependents || !dependents.length || depth <= 0) { return '' } const max = Math.ceil(depth / 2) const messages = dependents.slice(0, max) - .map(edge => explainEdge(edge, depth, color)) + .map(edge => explainEdge(edge, depth, chalk)) // show just the names of the first 5 deps that overflowed the list if (dependents.length > max) { @@ -119,30 +106,30 @@ const explainDependents = ({ name, dependents }, depth, color) => { return str.split('\n').join('\n ') } -const explainEdge = ({ name, type, bundled, from, spec, rawSpec, overridden }, depth, color) => { - const { bold } = color ? chalk : nocolor +const explainEdge = ({ name, type, bundled, from, spec, rawSpec, overridden }, depth, chalk) => { + const { bold } = chalk let dep = type === 'workspace' ? bold(relative(from.location, spec.slice('file:'.length))) : `${bold(name)}@"${bold(spec)}"` if (overridden) { - dep = `${colorType('overridden', color)} ${dep} (was "${rawSpec}")` + dep = `${colorType('overridden', chalk)} ${dep} (was "${rawSpec}")` } - const fromMsg = ` from ${explainFrom(from, depth, color)}` + const fromMsg = ` from ${explainFrom(from, depth, chalk)}` - return (type === 'prod' ? '' : `${colorType(type, color)} `) + - (bundled ? `${colorType('bundled', color)} ` : '') + + return (type === 'prod' ? '' : `${colorType(type, chalk)} `) + + (bundled ? `${colorType('bundled', chalk)} ` : '') + `${dep}${fromMsg}` } -const explainFrom = (from, depth, color) => { +const explainFrom = (from, depth, chalk) => { if (!from.name && !from.version) { return 'the root project' } - return printNode(from, color) + - explainDependents(from, depth - 1, color) + - explainLinksIn(from, depth - 1, color) + return printNode(from, chalk) + + explainDependents(from, depth - 1, chalk) + + explainLinksIn(from, depth - 1, chalk) } module.exports = { explainNode, printNode, explainEdge } diff --git a/deps/npm/lib/utils/explain-eresolve.js b/deps/npm/lib/utils/explain-eresolve.js index 480cd8e5cd4e66..ba46f3480adb36 100644 --- a/deps/npm/lib/utils/explain-eresolve.js +++ b/deps/npm/lib/utils/explain-eresolve.js @@ -7,7 +7,7 @@ const { explainEdge, explainNode, printNode } = require('./explain-dep.js') // Depth is how far we want to want to descend into the object making a report. // The full report (ie, depth=Infinity) is always written to the cache folder // at ${cache}/eresolve-report.txt along with full json. -const explain = (expl, color, depth) => { +const explain = (expl, chalk, depth) => { const { edge, dep, current, peerConflict, currentEdge } = expl const out = [] @@ -15,28 +15,28 @@ const explain = (expl, color, depth) => { current && current.whileInstalling || edge && edge.from && edge.from.whileInstalling if (whileInstalling) { - out.push('While resolving: ' + printNode(whileInstalling, color)) + out.push('While resolving: ' + printNode(whileInstalling, chalk)) } // it "should" be impossible for an ERESOLVE explanation to lack both // current and currentEdge, but better to have a less helpful error // than a crashing failure. if (current) { - out.push('Found: ' + explainNode(current, depth, color)) + out.push('Found: ' + explainNode(current, depth, chalk)) } else if (peerConflict && peerConflict.current) { - out.push('Found: ' + explainNode(peerConflict.current, depth, color)) + out.push('Found: ' + explainNode(peerConflict.current, depth, chalk)) } else if (currentEdge) { - out.push('Found: ' + explainEdge(currentEdge, depth, color)) + out.push('Found: ' + explainEdge(currentEdge, depth, chalk)) } else /* istanbul ignore else - should always have one */ if (edge) { - out.push('Found: ' + explainEdge(edge, depth, color)) + out.push('Found: ' + explainEdge(edge, depth, chalk)) } out.push('\nCould not resolve dependency:\n' + - explainEdge(edge, depth, color)) + explainEdge(edge, depth, chalk)) if (peerConflict) { const heading = '\nConflicting peer dependency:' - const pc = explainNode(peerConflict.peer, depth, color) + const pc = explainNode(peerConflict.peer, depth, chalk) out.push(heading + ' ' + pc) } @@ -44,7 +44,7 @@ const explain = (expl, color, depth) => { } // generate a full verbose report and tell the user how to fix it -const report = (expl, color) => { +const report = (expl, chalk, noColor) => { const flags = [ expl.strictPeerDeps ? '--no-strict-peer-deps' : '', '--force', @@ -60,8 +60,8 @@ this command with ${or(flags)} to accept an incorrect (and potentially broken) dependency resolution.` return { - explanation: `${explain(expl, color, 4)}\n\n${fix}`, - file: `# npm resolution error report\n\n${explain(expl, false, Infinity)}\n\n${fix}`, + explanation: `${explain(expl, chalk, 4)}\n\n${fix}`, + file: `# npm resolution error report\n\n${explain(expl, noColor, Infinity)}\n\n${fix}`, } } diff --git a/deps/npm/lib/utils/log-file.js b/deps/npm/lib/utils/log-file.js index f663997308ed6b..93114e94301f53 100644 --- a/deps/npm/lib/utils/log-file.js +++ b/deps/npm/lib/utils/log-file.js @@ -1,7 +1,7 @@ const os = require('os') const { join, dirname, basename } = require('path') -const { format, promisify } = require('util') -const glob = promisify(require('glob')) +const { format } = require('util') +const glob = require('glob') const MiniPass = require('minipass') const fsMiniPass = require('fs-minipass') const fs = require('fs/promises') @@ -223,7 +223,10 @@ class LogFiles { } } } catch (e) { - log.warn('logfile', 'error cleaning log files', e) + // Disable cleanup failure warnings when log writing is disabled + if (this.#logsMax > 0) { + log.warn('logfile', 'error cleaning log files', e) + } } finally { log.silly('logfile', 'done cleaning log files') } diff --git a/deps/npm/lib/utils/update-notifier.js b/deps/npm/lib/utils/update-notifier.js index a7eaaca64747fe..cb9184bcdb41d4 100644 --- a/deps/npm/lib/utils/update-notifier.js +++ b/deps/npm/lib/utils/update-notifier.js @@ -5,10 +5,7 @@ const pacote = require('pacote') const ciInfo = require('ci-info') const semver = require('semver') -const chalk = require('chalk') -const { promisify } = require('util') -const stat = promisify(require('fs').stat) -const writeFile = promisify(require('fs').writeFile) +const { stat, writeFile } = require('fs/promises') const { resolve } = require('path') const SKIP = Symbol('SKIP') @@ -61,10 +58,6 @@ const updateNotifier = async (npm, spec = 'latest') => { return null } - // if they're currently using a prerelease, nudge to the next prerelease - // otherwise, nudge to latest. - const useColor = npm.logColor - const mani = await pacote.manifest(`npm@${spec}`, { // always prefer latest, even if doing --tag=whatever on the cmd defaultTag: 'latest', @@ -91,6 +84,9 @@ const updateNotifier = async (npm, spec = 'latest') => { return null } + const useColor = npm.logColor + const chalk = npm.logChalk + // ok! notify the user about this update they should get. // The message is saved for printing at process exit so it will not get // lost in any other messages being printed as part of the command. @@ -99,12 +95,11 @@ const updateNotifier = async (npm, spec = 'latest') => { : update.minor !== current.minor ? 'minor' : update.patch !== current.patch ? 'patch' : 'prerelease' - const typec = !useColor ? type - : type === 'major' ? chalk.red(type) + const typec = type === 'major' ? chalk.red(type) : type === 'minor' ? chalk.yellow(type) : chalk.green(type) - const oldc = !useColor ? current : chalk.red(current) - const latestc = !useColor ? latest : chalk.green(latest) + const oldc = chalk.red(current) + const latestc = chalk.green(latest) const changelog = `https://github.com/npm/cli/releases/tag/v${latest}` const changelogc = !useColor ? `<${changelog}>` : chalk.cyan(changelog) const cmd = `npm install -g npm@${latest}` diff --git a/deps/npm/man/man1/npm-access.1 b/deps/npm/man/man1/npm-access.1 index 732813c2b8642f..ad44219bb7d222 100644 --- a/deps/npm/man/man1/npm-access.1 +++ b/deps/npm/man/man1/npm-access.1 @@ -1,4 +1,4 @@ -.TH "NPM-ACCESS" "1" "February 2023" "" "" +.TH "NPM-ACCESS" "1" "April 2023" "" "" .SH "NAME" \fBnpm-access\fR - Set access level on published packages .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-adduser.1 b/deps/npm/man/man1/npm-adduser.1 index 5a4ee97566cc08..d1d05d721d18b6 100644 --- a/deps/npm/man/man1/npm-adduser.1 +++ b/deps/npm/man/man1/npm-adduser.1 @@ -1,4 +1,4 @@ -.TH "NPM-ADDUSER" "1" "February 2023" "" "" +.TH "NPM-ADDUSER" "1" "April 2023" "" "" .SH "NAME" \fBnpm-adduser\fR - Add a registry user account .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-audit.1 b/deps/npm/man/man1/npm-audit.1 index f0c8475937f7fa..a14786b54bfecf 100644 --- a/deps/npm/man/man1/npm-audit.1 +++ b/deps/npm/man/man1/npm-audit.1 @@ -1,4 +1,4 @@ -.TH "NPM-AUDIT" "1" "February 2023" "" "" +.TH "NPM-AUDIT" "1" "April 2023" "" "" .SH "NAME" \fBnpm-audit\fR - Run a security audit .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-bugs.1 b/deps/npm/man/man1/npm-bugs.1 index 1f2ee1642dab02..adcfcb3bc2b081 100644 --- a/deps/npm/man/man1/npm-bugs.1 +++ b/deps/npm/man/man1/npm-bugs.1 @@ -1,4 +1,4 @@ -.TH "NPM-BUGS" "1" "February 2023" "" "" +.TH "NPM-BUGS" "1" "April 2023" "" "" .SH "NAME" \fBnpm-bugs\fR - Report bugs for a package in a web browser .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-cache.1 b/deps/npm/man/man1/npm-cache.1 index 5559b3be352bfb..358451123e84f4 100644 --- a/deps/npm/man/man1/npm-cache.1 +++ b/deps/npm/man/man1/npm-cache.1 @@ -1,4 +1,4 @@ -.TH "NPM-CACHE" "1" "February 2023" "" "" +.TH "NPM-CACHE" "1" "April 2023" "" "" .SH "NAME" \fBnpm-cache\fR - Manipulates packages cache .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-ci.1 b/deps/npm/man/man1/npm-ci.1 index 66b688f9717612..ee05baa60763cf 100644 --- a/deps/npm/man/man1/npm-ci.1 +++ b/deps/npm/man/man1/npm-ci.1 @@ -1,4 +1,4 @@ -.TH "NPM-CI" "1" "February 2023" "" "" +.TH "NPM-CI" "1" "April 2023" "" "" .SH "NAME" \fBnpm-ci\fR - Clean install a project .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-completion.1 b/deps/npm/man/man1/npm-completion.1 index b82899fd35db14..15df619487b254 100644 --- a/deps/npm/man/man1/npm-completion.1 +++ b/deps/npm/man/man1/npm-completion.1 @@ -1,4 +1,4 @@ -.TH "NPM-COMPLETION" "1" "February 2023" "" "" +.TH "NPM-COMPLETION" "1" "April 2023" "" "" .SH "NAME" \fBnpm-completion\fR - Tab Completion for npm .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-config.1 b/deps/npm/man/man1/npm-config.1 index 0cf96143ff8e3b..4280f907442427 100644 --- a/deps/npm/man/man1/npm-config.1 +++ b/deps/npm/man/man1/npm-config.1 @@ -1,4 +1,4 @@ -.TH "NPM-CONFIG" "1" "February 2023" "" "" +.TH "NPM-CONFIG" "1" "April 2023" "" "" .SH "NAME" \fBnpm-config\fR - Manage the npm configuration files .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-dedupe.1 b/deps/npm/man/man1/npm-dedupe.1 index 302d63b3c2c107..3e2596f766c7d2 100644 --- a/deps/npm/man/man1/npm-dedupe.1 +++ b/deps/npm/man/man1/npm-dedupe.1 @@ -1,4 +1,4 @@ -.TH "NPM-DEDUPE" "1" "February 2023" "" "" +.TH "NPM-DEDUPE" "1" "April 2023" "" "" .SH "NAME" \fBnpm-dedupe\fR - Reduce duplication in the package tree .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-deprecate.1 b/deps/npm/man/man1/npm-deprecate.1 index d525e703e841d9..1395f1d6006901 100644 --- a/deps/npm/man/man1/npm-deprecate.1 +++ b/deps/npm/man/man1/npm-deprecate.1 @@ -1,4 +1,4 @@ -.TH "NPM-DEPRECATE" "1" "February 2023" "" "" +.TH "NPM-DEPRECATE" "1" "April 2023" "" "" .SH "NAME" \fBnpm-deprecate\fR - Deprecate a version of a package .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-diff.1 b/deps/npm/man/man1/npm-diff.1 index 5d2c240f839f95..a612fa58f41619 100644 --- a/deps/npm/man/man1/npm-diff.1 +++ b/deps/npm/man/man1/npm-diff.1 @@ -1,4 +1,4 @@ -.TH "NPM-DIFF" "1" "February 2023" "" "" +.TH "NPM-DIFF" "1" "April 2023" "" "" .SH "NAME" \fBnpm-diff\fR - The registry diff command .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-dist-tag.1 b/deps/npm/man/man1/npm-dist-tag.1 index bd700f0fefe5ed..eaeeb0262b72f8 100644 --- a/deps/npm/man/man1/npm-dist-tag.1 +++ b/deps/npm/man/man1/npm-dist-tag.1 @@ -1,4 +1,4 @@ -.TH "NPM-DIST-TAG" "1" "February 2023" "" "" +.TH "NPM-DIST-TAG" "1" "April 2023" "" "" .SH "NAME" \fBnpm-dist-tag\fR - Modify package distribution tags .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-docs.1 b/deps/npm/man/man1/npm-docs.1 index 6ee27d9348b7b1..4dabed0f7a3456 100644 --- a/deps/npm/man/man1/npm-docs.1 +++ b/deps/npm/man/man1/npm-docs.1 @@ -1,4 +1,4 @@ -.TH "NPM-DOCS" "1" "February 2023" "" "" +.TH "NPM-DOCS" "1" "April 2023" "" "" .SH "NAME" \fBnpm-docs\fR - Open documentation for a package in a web browser .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-doctor.1 b/deps/npm/man/man1/npm-doctor.1 index d1b5a4165452af..5a16b939dbdcba 100644 --- a/deps/npm/man/man1/npm-doctor.1 +++ b/deps/npm/man/man1/npm-doctor.1 @@ -1,4 +1,4 @@ -.TH "NPM-DOCTOR" "1" "February 2023" "" "" +.TH "NPM-DOCTOR" "1" "April 2023" "" "" .SH "NAME" \fBnpm-doctor\fR - Check your npm environment .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-edit.1 b/deps/npm/man/man1/npm-edit.1 index de723dfabe983b..d2eefdd4837436 100644 --- a/deps/npm/man/man1/npm-edit.1 +++ b/deps/npm/man/man1/npm-edit.1 @@ -1,4 +1,4 @@ -.TH "NPM-EDIT" "1" "February 2023" "" "" +.TH "NPM-EDIT" "1" "April 2023" "" "" .SH "NAME" \fBnpm-edit\fR - Edit an installed package .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-exec.1 b/deps/npm/man/man1/npm-exec.1 index 10d06ae263408f..86e514ce33172a 100644 --- a/deps/npm/man/man1/npm-exec.1 +++ b/deps/npm/man/man1/npm-exec.1 @@ -1,4 +1,4 @@ -.TH "NPM-EXEC" "1" "February 2023" "" "" +.TH "NPM-EXEC" "1" "April 2023" "" "" .SH "NAME" \fBnpm-exec\fR - Run a command from a local or remote npm package .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-explain.1 b/deps/npm/man/man1/npm-explain.1 index a8f5e0e2b63487..852408d0e58276 100644 --- a/deps/npm/man/man1/npm-explain.1 +++ b/deps/npm/man/man1/npm-explain.1 @@ -1,4 +1,4 @@ -.TH "NPM-EXPLAIN" "1" "February 2023" "" "" +.TH "NPM-EXPLAIN" "1" "April 2023" "" "" .SH "NAME" \fBnpm-explain\fR - Explain installed packages .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-explore.1 b/deps/npm/man/man1/npm-explore.1 index 82452e0cba6eaa..a70274d2f54c42 100644 --- a/deps/npm/man/man1/npm-explore.1 +++ b/deps/npm/man/man1/npm-explore.1 @@ -1,4 +1,4 @@ -.TH "NPM-EXPLORE" "1" "February 2023" "" "" +.TH "NPM-EXPLORE" "1" "April 2023" "" "" .SH "NAME" \fBnpm-explore\fR - Browse an installed package .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-find-dupes.1 b/deps/npm/man/man1/npm-find-dupes.1 index 4834f54df6abd3..f9e61d4e96ac6e 100644 --- a/deps/npm/man/man1/npm-find-dupes.1 +++ b/deps/npm/man/man1/npm-find-dupes.1 @@ -1,4 +1,4 @@ -.TH "NPM-FIND-DUPES" "1" "February 2023" "" "" +.TH "NPM-FIND-DUPES" "1" "April 2023" "" "" .SH "NAME" \fBnpm-find-dupes\fR - Find duplication in the package tree .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-fund.1 b/deps/npm/man/man1/npm-fund.1 index a0a31eebd445ac..790166b3e48187 100644 --- a/deps/npm/man/man1/npm-fund.1 +++ b/deps/npm/man/man1/npm-fund.1 @@ -1,4 +1,4 @@ -.TH "NPM-FUND" "1" "February 2023" "" "" +.TH "NPM-FUND" "1" "April 2023" "" "" .SH "NAME" \fBnpm-fund\fR - Retrieve funding information .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-help-search.1 b/deps/npm/man/man1/npm-help-search.1 index 846f507f51e4d7..88cb8e5c1d8ce7 100644 --- a/deps/npm/man/man1/npm-help-search.1 +++ b/deps/npm/man/man1/npm-help-search.1 @@ -1,4 +1,4 @@ -.TH "NPM-HELP-SEARCH" "1" "February 2023" "" "" +.TH "NPM-HELP-SEARCH" "1" "April 2023" "" "" .SH "NAME" \fBnpm-help-search\fR - Search npm help documentation .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-help.1 b/deps/npm/man/man1/npm-help.1 index cffb33d49f91ef..12fb76cce06dca 100644 --- a/deps/npm/man/man1/npm-help.1 +++ b/deps/npm/man/man1/npm-help.1 @@ -1,4 +1,4 @@ -.TH "NPM-HELP" "1" "February 2023" "" "" +.TH "NPM-HELP" "1" "April 2023" "" "" .SH "NAME" \fBnpm-help\fR - Get help on npm .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-hook.1 b/deps/npm/man/man1/npm-hook.1 index 0cd0935d9498a9..c1a484b7883222 100644 --- a/deps/npm/man/man1/npm-hook.1 +++ b/deps/npm/man/man1/npm-hook.1 @@ -1,4 +1,4 @@ -.TH "NPM-HOOK" "1" "February 2023" "" "" +.TH "NPM-HOOK" "1" "April 2023" "" "" .SH "NAME" \fBnpm-hook\fR - Manage registry hooks .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-init.1 b/deps/npm/man/man1/npm-init.1 index 763e2914fa1e67..bb7c95eedbb68e 100644 --- a/deps/npm/man/man1/npm-init.1 +++ b/deps/npm/man/man1/npm-init.1 @@ -1,4 +1,4 @@ -.TH "NPM-INIT" "1" "February 2023" "" "" +.TH "NPM-INIT" "1" "April 2023" "" "" .SH "NAME" \fBnpm-init\fR - Create a package.json file .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-install-ci-test.1 b/deps/npm/man/man1/npm-install-ci-test.1 index fbe641322dac4b..abfe022914bb70 100644 --- a/deps/npm/man/man1/npm-install-ci-test.1 +++ b/deps/npm/man/man1/npm-install-ci-test.1 @@ -1,4 +1,4 @@ -.TH "NPM-INSTALL-CI-TEST" "1" "February 2023" "" "" +.TH "NPM-INSTALL-CI-TEST" "1" "April 2023" "" "" .SH "NAME" \fBnpm-install-ci-test\fR - Install a project with a clean slate and run tests .SS "Synopsis" @@ -7,7 +7,7 @@ .nf npm install-ci-test -alias: cit +aliases: cit, clean-install-test, sit .fi .RE .SS "Description" diff --git a/deps/npm/man/man1/npm-install-test.1 b/deps/npm/man/man1/npm-install-test.1 index 528ec9b75adf02..334ce2e88859e2 100644 --- a/deps/npm/man/man1/npm-install-test.1 +++ b/deps/npm/man/man1/npm-install-test.1 @@ -1,4 +1,4 @@ -.TH "NPM-INSTALL-TEST" "1" "February 2023" "" "" +.TH "NPM-INSTALL-TEST" "1" "April 2023" "" "" .SH "NAME" \fBnpm-install-test\fR - Install package(s) and run tests .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-install.1 b/deps/npm/man/man1/npm-install.1 index 4eb982a825f3e3..0f90d4870e7aa1 100644 --- a/deps/npm/man/man1/npm-install.1 +++ b/deps/npm/man/man1/npm-install.1 @@ -1,4 +1,4 @@ -.TH "NPM-INSTALL" "1" "February 2023" "" "" +.TH "NPM-INSTALL" "1" "April 2023" "" "" .SH "NAME" \fBnpm-install\fR - Install a package .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-link.1 b/deps/npm/man/man1/npm-link.1 index 84c3e7fd7ccc3c..75abfdc34f6fb4 100644 --- a/deps/npm/man/man1/npm-link.1 +++ b/deps/npm/man/man1/npm-link.1 @@ -1,4 +1,4 @@ -.TH "NPM-LINK" "1" "February 2023" "" "" +.TH "NPM-LINK" "1" "April 2023" "" "" .SH "NAME" \fBnpm-link\fR - Symlink a package folder .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-login.1 b/deps/npm/man/man1/npm-login.1 index 83535a93440fa7..889b203d579c05 100644 --- a/deps/npm/man/man1/npm-login.1 +++ b/deps/npm/man/man1/npm-login.1 @@ -1,4 +1,4 @@ -.TH "NPM-LOGIN" "1" "February 2023" "" "" +.TH "NPM-LOGIN" "1" "April 2023" "" "" .SH "NAME" \fBnpm-login\fR - Login to a registry user account .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-logout.1 b/deps/npm/man/man1/npm-logout.1 index 945b6ef8e02003..63f9da4118fb26 100644 --- a/deps/npm/man/man1/npm-logout.1 +++ b/deps/npm/man/man1/npm-logout.1 @@ -1,4 +1,4 @@ -.TH "NPM-LOGOUT" "1" "February 2023" "" "" +.TH "NPM-LOGOUT" "1" "April 2023" "" "" .SH "NAME" \fBnpm-logout\fR - Log out of the registry .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-ls.1 b/deps/npm/man/man1/npm-ls.1 index ac59cba39a3f50..3c8ef9c5c98b62 100644 --- a/deps/npm/man/man1/npm-ls.1 +++ b/deps/npm/man/man1/npm-ls.1 @@ -1,4 +1,4 @@ -.TH "NPM-LS" "1" "February 2023" "" "" +.TH "NPM-LS" "1" "April 2023" "" "" .SH "NAME" \fBnpm-ls\fR - List installed packages .SS "Synopsis" @@ -20,7 +20,7 @@ Positional arguments are \fBname@version-range\fR identifiers, which will limit .P .RS 2 .nf -npm@9.5.1 /path/to/npm +npm@9.6.4 /path/to/npm └─┬ init-package-json@0.0.4 └── promzard@0.1.5 .fi diff --git a/deps/npm/man/man1/npm-org.1 b/deps/npm/man/man1/npm-org.1 index 2e952687b307ac..cf10076ece4f3f 100644 --- a/deps/npm/man/man1/npm-org.1 +++ b/deps/npm/man/man1/npm-org.1 @@ -1,4 +1,4 @@ -.TH "NPM-ORG" "1" "February 2023" "" "" +.TH "NPM-ORG" "1" "April 2023" "" "" .SH "NAME" \fBnpm-org\fR - Manage orgs .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-outdated.1 b/deps/npm/man/man1/npm-outdated.1 index 683321321f6876..3440ff7ac3e2b2 100644 --- a/deps/npm/man/man1/npm-outdated.1 +++ b/deps/npm/man/man1/npm-outdated.1 @@ -1,4 +1,4 @@ -.TH "NPM-OUTDATED" "1" "February 2023" "" "" +.TH "NPM-OUTDATED" "1" "April 2023" "" "" .SH "NAME" \fBnpm-outdated\fR - Check for outdated packages .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-owner.1 b/deps/npm/man/man1/npm-owner.1 index bf73df68cdf48b..a9be47f4d46ac2 100644 --- a/deps/npm/man/man1/npm-owner.1 +++ b/deps/npm/man/man1/npm-owner.1 @@ -1,4 +1,4 @@ -.TH "NPM-OWNER" "1" "February 2023" "" "" +.TH "NPM-OWNER" "1" "April 2023" "" "" .SH "NAME" \fBnpm-owner\fR - Manage package owners .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-pack.1 b/deps/npm/man/man1/npm-pack.1 index e6b19f2eb061c6..e1fb88fddbdee1 100644 --- a/deps/npm/man/man1/npm-pack.1 +++ b/deps/npm/man/man1/npm-pack.1 @@ -1,4 +1,4 @@ -.TH "NPM-PACK" "1" "February 2023" "" "" +.TH "NPM-PACK" "1" "April 2023" "" "" .SH "NAME" \fBnpm-pack\fR - Create a tarball from a package .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-ping.1 b/deps/npm/man/man1/npm-ping.1 index 4ae24a8cd6eb46..b8ebccbd5ad718 100644 --- a/deps/npm/man/man1/npm-ping.1 +++ b/deps/npm/man/man1/npm-ping.1 @@ -1,4 +1,4 @@ -.TH "NPM-PING" "1" "February 2023" "" "" +.TH "NPM-PING" "1" "April 2023" "" "" .SH "NAME" \fBnpm-ping\fR - Ping npm registry .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-pkg.1 b/deps/npm/man/man1/npm-pkg.1 index d67f473563af1a..5cb8362e452544 100644 --- a/deps/npm/man/man1/npm-pkg.1 +++ b/deps/npm/man/man1/npm-pkg.1 @@ -1,4 +1,4 @@ -.TH "NPM-PKG" "1" "February 2023" "" "" +.TH "NPM-PKG" "1" "April 2023" "" "" .SH "NAME" \fBnpm-pkg\fR - Manages your package.json .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-prefix.1 b/deps/npm/man/man1/npm-prefix.1 index a14aec7c6b3043..840968f8ec28ca 100644 --- a/deps/npm/man/man1/npm-prefix.1 +++ b/deps/npm/man/man1/npm-prefix.1 @@ -1,4 +1,4 @@ -.TH "NPM-PREFIX" "1" "February 2023" "" "" +.TH "NPM-PREFIX" "1" "April 2023" "" "" .SH "NAME" \fBnpm-prefix\fR - Display prefix .SS "Synopsis" @@ -55,8 +55,6 @@ man pages are linked to \fB{prefix}/share/man\fR .IP \(bu 4 npm help root .IP \(bu 4 -npm help bin -.IP \(bu 4 npm help folders .IP \(bu 4 npm help config diff --git a/deps/npm/man/man1/npm-profile.1 b/deps/npm/man/man1/npm-profile.1 index 40bc3df8e842a7..749fcf86f1d73a 100644 --- a/deps/npm/man/man1/npm-profile.1 +++ b/deps/npm/man/man1/npm-profile.1 @@ -1,4 +1,4 @@ -.TH "NPM-PROFILE" "1" "February 2023" "" "" +.TH "NPM-PROFILE" "1" "April 2023" "" "" .SH "NAME" \fBnpm-profile\fR - Change settings on your registry profile .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-prune.1 b/deps/npm/man/man1/npm-prune.1 index 86546ac112f1cd..d7f19ddebc168a 100644 --- a/deps/npm/man/man1/npm-prune.1 +++ b/deps/npm/man/man1/npm-prune.1 @@ -1,4 +1,4 @@ -.TH "NPM-PRUNE" "1" "February 2023" "" "" +.TH "NPM-PRUNE" "1" "April 2023" "" "" .SH "NAME" \fBnpm-prune\fR - Remove extraneous packages .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-publish.1 b/deps/npm/man/man1/npm-publish.1 index 97b912987d0bd0..b5b6aadc51652f 100644 --- a/deps/npm/man/man1/npm-publish.1 +++ b/deps/npm/man/man1/npm-publish.1 @@ -1,4 +1,4 @@ -.TH "NPM-PUBLISH" "1" "February 2023" "" "" +.TH "NPM-PUBLISH" "1" "April 2023" "" "" .SH "NAME" \fBnpm-publish\fR - Publish a package .SS "Synopsis" @@ -42,7 +42,7 @@ As of \fBnpm@5\fR, both a sha1sum and an integrity field with a sha512sum of the Similar to \fB--dry-run\fR see npm help pack, which figures out the files to be included and packs them into a tarball to be uploaded to the registry. .SS "Files included in package" .P -To see what will be included in your package, run \fBnpx npm-packlist\fR. All files are included by default, with the following exceptions: +To see what will be included in your package, run \fBnpm pack --dry-run\fR. All files are included by default, with the following exceptions: .RS 0 .IP \(bu 4 Certain files that are relevant to package installation and distribution are always included. For example, \fBpackage.json\fR, \fBREADME.md\fR, \fBLICENSE\fR, and so on. diff --git a/deps/npm/man/man1/npm-query.1 b/deps/npm/man/man1/npm-query.1 index 24ba7853adba8f..cbf55b52ebe241 100644 --- a/deps/npm/man/man1/npm-query.1 +++ b/deps/npm/man/man1/npm-query.1 @@ -1,4 +1,4 @@ -.TH "NPM-QUERY" "1" "February 2023" "" "" +.TH "NPM-QUERY" "1" "April 2023" "" "" .SH "NAME" \fBnpm-query\fR - Dependency selector query .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-rebuild.1 b/deps/npm/man/man1/npm-rebuild.1 index 1c00566dd1701a..bfd5e27663a6cd 100644 --- a/deps/npm/man/man1/npm-rebuild.1 +++ b/deps/npm/man/man1/npm-rebuild.1 @@ -1,4 +1,4 @@ -.TH "NPM-REBUILD" "1" "February 2023" "" "" +.TH "NPM-REBUILD" "1" "April 2023" "" "" .SH "NAME" \fBnpm-rebuild\fR - Rebuild a package .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-repo.1 b/deps/npm/man/man1/npm-repo.1 index 65bb96687f571e..704a576ba0f9ca 100644 --- a/deps/npm/man/man1/npm-repo.1 +++ b/deps/npm/man/man1/npm-repo.1 @@ -1,4 +1,4 @@ -.TH "NPM-REPO" "1" "February 2023" "" "" +.TH "NPM-REPO" "1" "April 2023" "" "" .SH "NAME" \fBnpm-repo\fR - Open package repository page in the browser .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-restart.1 b/deps/npm/man/man1/npm-restart.1 index 9323e2841a261e..0226bb1e4553c0 100644 --- a/deps/npm/man/man1/npm-restart.1 +++ b/deps/npm/man/man1/npm-restart.1 @@ -1,4 +1,4 @@ -.TH "NPM-RESTART" "1" "February 2023" "" "" +.TH "NPM-RESTART" "1" "April 2023" "" "" .SH "NAME" \fBnpm-restart\fR - Restart a package .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-root.1 b/deps/npm/man/man1/npm-root.1 index bd943bb95a6d9c..00df257f6eb244 100644 --- a/deps/npm/man/man1/npm-root.1 +++ b/deps/npm/man/man1/npm-root.1 @@ -1,4 +1,4 @@ -.TH "NPM-ROOT" "1" "February 2023" "" "" +.TH "NPM-ROOT" "1" "April 2023" "" "" .SH "NAME" \fBnpm-root\fR - Display npm root .SS "Synopsis" @@ -48,8 +48,6 @@ man pages are linked to \fB{prefix}/share/man\fR .IP \(bu 4 npm help prefix .IP \(bu 4 -npm help bin -.IP \(bu 4 npm help folders .IP \(bu 4 npm help config diff --git a/deps/npm/man/man1/npm-run-script.1 b/deps/npm/man/man1/npm-run-script.1 index afcf4d655bf218..2001cd4e38b7af 100644 --- a/deps/npm/man/man1/npm-run-script.1 +++ b/deps/npm/man/man1/npm-run-script.1 @@ -1,4 +1,4 @@ -.TH "NPM-RUN-SCRIPT" "1" "February 2023" "" "" +.TH "NPM-RUN-SCRIPT" "1" "April 2023" "" "" .SH "NAME" \fBnpm-run-script\fR - Run arbitrary package scripts .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-search.1 b/deps/npm/man/man1/npm-search.1 index 2241f81e2250e8..cae1242ed0f076 100644 --- a/deps/npm/man/man1/npm-search.1 +++ b/deps/npm/man/man1/npm-search.1 @@ -1,4 +1,4 @@ -.TH "NPM-SEARCH" "1" "February 2023" "" "" +.TH "NPM-SEARCH" "1" "April 2023" "" "" .SH "NAME" \fBnpm-search\fR - Search for packages .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-shrinkwrap.1 b/deps/npm/man/man1/npm-shrinkwrap.1 index 5192bc1222f3dc..53c1d66b3b1b03 100644 --- a/deps/npm/man/man1/npm-shrinkwrap.1 +++ b/deps/npm/man/man1/npm-shrinkwrap.1 @@ -1,4 +1,4 @@ -.TH "NPM-SHRINKWRAP" "1" "February 2023" "" "" +.TH "NPM-SHRINKWRAP" "1" "April 2023" "" "" .SH "NAME" \fBnpm-shrinkwrap\fR - Lock down dependency versions for publication .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-star.1 b/deps/npm/man/man1/npm-star.1 index ecb2ffe84fa809..f82452e1d16578 100644 --- a/deps/npm/man/man1/npm-star.1 +++ b/deps/npm/man/man1/npm-star.1 @@ -1,4 +1,4 @@ -.TH "NPM-STAR" "1" "February 2023" "" "" +.TH "NPM-STAR" "1" "April 2023" "" "" .SH "NAME" \fBnpm-star\fR - Mark your favorite packages .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-stars.1 b/deps/npm/man/man1/npm-stars.1 index 49ffc90e03ce10..1b4544410bcd68 100644 --- a/deps/npm/man/man1/npm-stars.1 +++ b/deps/npm/man/man1/npm-stars.1 @@ -1,4 +1,4 @@ -.TH "NPM-STARS" "1" "February 2023" "" "" +.TH "NPM-STARS" "1" "April 2023" "" "" .SH "NAME" \fBnpm-stars\fR - View packages marked as favorites .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-start.1 b/deps/npm/man/man1/npm-start.1 index ecf3ad2838266c..889d41fc16eb02 100644 --- a/deps/npm/man/man1/npm-start.1 +++ b/deps/npm/man/man1/npm-start.1 @@ -1,4 +1,4 @@ -.TH "NPM-START" "1" "February 2023" "" "" +.TH "NPM-START" "1" "April 2023" "" "" .SH "NAME" \fBnpm-start\fR - Start a package .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-stop.1 b/deps/npm/man/man1/npm-stop.1 index 4a5f604941e09d..5f4dd7550d7cb9 100644 --- a/deps/npm/man/man1/npm-stop.1 +++ b/deps/npm/man/man1/npm-stop.1 @@ -1,4 +1,4 @@ -.TH "NPM-STOP" "1" "February 2023" "" "" +.TH "NPM-STOP" "1" "April 2023" "" "" .SH "NAME" \fBnpm-stop\fR - Stop a package .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-team.1 b/deps/npm/man/man1/npm-team.1 index 30399634bc8bc8..fe8372f0c40a68 100644 --- a/deps/npm/man/man1/npm-team.1 +++ b/deps/npm/man/man1/npm-team.1 @@ -1,4 +1,4 @@ -.TH "NPM-TEAM" "1" "February 2023" "" "" +.TH "NPM-TEAM" "1" "April 2023" "" "" .SH "NAME" \fBnpm-team\fR - Manage organization teams and team memberships .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-test.1 b/deps/npm/man/man1/npm-test.1 index ddd45f0757b9ff..0e1ca4e4eb6e02 100644 --- a/deps/npm/man/man1/npm-test.1 +++ b/deps/npm/man/man1/npm-test.1 @@ -1,4 +1,4 @@ -.TH "NPM-TEST" "1" "February 2023" "" "" +.TH "NPM-TEST" "1" "April 2023" "" "" .SH "NAME" \fBnpm-test\fR - Test a package .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-token.1 b/deps/npm/man/man1/npm-token.1 index 202f55bd69e68e..4cb66079926aa9 100644 --- a/deps/npm/man/man1/npm-token.1 +++ b/deps/npm/man/man1/npm-token.1 @@ -1,4 +1,4 @@ -.TH "NPM-TOKEN" "1" "February 2023" "" "" +.TH "NPM-TOKEN" "1" "April 2023" "" "" .SH "NAME" \fBnpm-token\fR - Manage your authentication tokens .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-uninstall.1 b/deps/npm/man/man1/npm-uninstall.1 index 9c90a9863215c9..319be77e960e6f 100644 --- a/deps/npm/man/man1/npm-uninstall.1 +++ b/deps/npm/man/man1/npm-uninstall.1 @@ -1,4 +1,4 @@ -.TH "NPM-UNINSTALL" "1" "February 2023" "" "" +.TH "NPM-UNINSTALL" "1" "April 2023" "" "" .SH "NAME" \fBnpm-uninstall\fR - Remove a package .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-unpublish.1 b/deps/npm/man/man1/npm-unpublish.1 index 8b250dd67bcc41..2cfefbc36a094f 100644 --- a/deps/npm/man/man1/npm-unpublish.1 +++ b/deps/npm/man/man1/npm-unpublish.1 @@ -1,4 +1,4 @@ -.TH "NPM-UNPUBLISH" "1" "February 2023" "" "" +.TH "NPM-UNPUBLISH" "1" "April 2023" "" "" .SH "NAME" \fBnpm-unpublish\fR - Remove a package from the registry .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-unstar.1 b/deps/npm/man/man1/npm-unstar.1 index c76968c9050b5b..9c06517d5e4c5a 100644 --- a/deps/npm/man/man1/npm-unstar.1 +++ b/deps/npm/man/man1/npm-unstar.1 @@ -1,4 +1,4 @@ -.TH "NPM-UNSTAR" "1" "February 2023" "" "" +.TH "NPM-UNSTAR" "1" "April 2023" "" "" .SH "NAME" \fBnpm-unstar\fR - Remove an item from your favorite packages .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-update.1 b/deps/npm/man/man1/npm-update.1 index 7819631243fccd..f162153c75ff99 100644 --- a/deps/npm/man/man1/npm-update.1 +++ b/deps/npm/man/man1/npm-update.1 @@ -1,4 +1,4 @@ -.TH "NPM-UPDATE" "1" "February 2023" "" "" +.TH "NPM-UPDATE" "1" "April 2023" "" "" .SH "NAME" \fBnpm-update\fR - Update packages .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-version.1 b/deps/npm/man/man1/npm-version.1 index 66bfdbdc598bdd..6c31270dcdef92 100644 --- a/deps/npm/man/man1/npm-version.1 +++ b/deps/npm/man/man1/npm-version.1 @@ -1,4 +1,4 @@ -.TH "NPM-VERSION" "1" "February 2023" "" "" +.TH "NPM-VERSION" "1" "April 2023" "" "" .SH "NAME" \fBnpm-version\fR - Bump a package version .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-view.1 b/deps/npm/man/man1/npm-view.1 index 6075c163d0e8d2..4ca9436a8b1df8 100644 --- a/deps/npm/man/man1/npm-view.1 +++ b/deps/npm/man/man1/npm-view.1 @@ -1,4 +1,4 @@ -.TH "NPM-VIEW" "1" "February 2023" "" "" +.TH "NPM-VIEW" "1" "April 2023" "" "" .SH "NAME" \fBnpm-view\fR - View registry info .SS "Synopsis" diff --git a/deps/npm/man/man1/npm-whoami.1 b/deps/npm/man/man1/npm-whoami.1 index d96a3648776381..6a9790237e36ba 100644 --- a/deps/npm/man/man1/npm-whoami.1 +++ b/deps/npm/man/man1/npm-whoami.1 @@ -1,4 +1,4 @@ -.TH "NPM-WHOAMI" "1" "February 2023" "" "" +.TH "NPM-WHOAMI" "1" "April 2023" "" "" .SH "NAME" \fBnpm-whoami\fR - Display npm username .SS "Synopsis" diff --git a/deps/npm/man/man1/npm.1 b/deps/npm/man/man1/npm.1 index 631f484d455b98..02023347f3cf07 100644 --- a/deps/npm/man/man1/npm.1 +++ b/deps/npm/man/man1/npm.1 @@ -1,4 +1,4 @@ -.TH "NPM" "1" "February 2023" "" "" +.TH "NPM" "1" "April 2023" "" "" .SH "NAME" \fBnpm\fR - javascript package manager .SS "Synopsis" @@ -12,7 +12,7 @@ npm Note: This command is unaware of workspaces. .SS "Version" .P -9.5.1 +9.6.4 .SS "Description" .P npm is the package manager for the Node JavaScript platform. It puts modules in place so that node can find them, and manages dependency conflicts intelligently. diff --git a/deps/npm/man/man1/npx.1 b/deps/npm/man/man1/npx.1 index 079dffeecdbe2e..d461eac5579d9f 100644 --- a/deps/npm/man/man1/npx.1 +++ b/deps/npm/man/man1/npx.1 @@ -1,4 +1,4 @@ -.TH "NPX" "1" "February 2023" "" "" +.TH "NPX" "1" "April 2023" "" "" .SH "NAME" \fBnpx\fR - Run a command from a local or remote npm package .SS "Synopsis" diff --git a/deps/npm/man/man5/folders.5 b/deps/npm/man/man5/folders.5 index 50bf4c8c7aec20..384c59dd085d82 100644 --- a/deps/npm/man/man5/folders.5 +++ b/deps/npm/man/man5/folders.5 @@ -1,4 +1,4 @@ -.TH "FOLDERS" "5" "February 2023" "" "" +.TH "FOLDERS" "5" "April 2023" "" "" .SH "NAME" \fBfolders\fR - Folder Structures Used by npm .SS "Description" diff --git a/deps/npm/man/man5/install.5 b/deps/npm/man/man5/install.5 index 68af465f5ee21a..8abb6970a3ee89 100644 --- a/deps/npm/man/man5/install.5 +++ b/deps/npm/man/man5/install.5 @@ -1,4 +1,4 @@ -.TH "INSTALL" "5" "February 2023" "" "" +.TH "INSTALL" "5" "April 2023" "" "" .SH "NAME" \fBinstall\fR - Download and install node and npm .SS "Description" @@ -26,23 +26,7 @@ npm -v .RE .SS "Using a Node version manager to install Node.js and npm" .P -Node version managers allow you to install and switch between multiple versions of Node.js and npm on your system so you can test your applications on multiple versions of npm to ensure they work for users on different versions. -.SS "OSX or Linux Node version managers" -.RS 0 -.IP \(bu 4 -\fBnvm\fR \fI\(lahttps://github.com/creationix/nvm\(ra\fR -.IP \(bu 4 -\fBn\fR \fI\(lahttps://github.com/tj/n\(ra\fR -.RE 0 - -.SS "Windows Node version managers" -.RS 0 -.IP \(bu 4 -\fBnodist\fR \fI\(lahttps://github.com/marcelklehr/nodist\(ra\fR -.IP \(bu 4 -\fBnvm-windows\fR \fI\(lahttps://github.com/coreybutler/nvm-windows\(ra\fR -.RE 0 - +Node version managers allow you to install and switch between multiple versions of Node.js and npm on your system so you can test your applications on multiple versions of npm to ensure they work for users on different versions. You can \fBsearch for them on GitHub\fR \fI\(lahttps://github.com/search?q=node+version+manager+archived%3Afalse&type=repositories&ref=advsearch\(ra\fR. .SS "Using a Node installer to install Node.js and npm" .P If you are unable to use a Node version manager, you can use a Node installer to install both Node.js and npm on your system. diff --git a/deps/npm/man/man5/npm-global.5 b/deps/npm/man/man5/npm-global.5 index 50bf4c8c7aec20..384c59dd085d82 100644 --- a/deps/npm/man/man5/npm-global.5 +++ b/deps/npm/man/man5/npm-global.5 @@ -1,4 +1,4 @@ -.TH "FOLDERS" "5" "February 2023" "" "" +.TH "FOLDERS" "5" "April 2023" "" "" .SH "NAME" \fBfolders\fR - Folder Structures Used by npm .SS "Description" diff --git a/deps/npm/man/man5/npm-json.5 b/deps/npm/man/man5/npm-json.5 index 8f7dd8fd5b73e6..a2a7d60a66ca54 100644 --- a/deps/npm/man/man5/npm-json.5 +++ b/deps/npm/man/man5/npm-json.5 @@ -1,4 +1,4 @@ -.TH "PACKAGE.JSON" "5" "February 2023" "" "" +.TH "PACKAGE.JSON" "5" "April 2023" "" "" .SH "NAME" \fBpackage.json\fR - Specifics of npm's package.json handling .SS "Description" diff --git a/deps/npm/man/man5/npm-shrinkwrap-json.5 b/deps/npm/man/man5/npm-shrinkwrap-json.5 index 12a5dc05887fda..0d2ecc15b4d20d 100644 --- a/deps/npm/man/man5/npm-shrinkwrap-json.5 +++ b/deps/npm/man/man5/npm-shrinkwrap-json.5 @@ -1,4 +1,4 @@ -.TH "NPM-SHRINKWRAP.JSON" "5" "February 2023" "" "" +.TH "NPM-SHRINKWRAP.JSON" "5" "April 2023" "" "" .SH "NAME" \fBnpm-shrinkwrap.json\fR - A publishable lockfile .SS "Description" diff --git a/deps/npm/man/man5/npmrc.5 b/deps/npm/man/man5/npmrc.5 index a568984bc80aaa..82e3c704ed45c0 100644 --- a/deps/npm/man/man5/npmrc.5 +++ b/deps/npm/man/man5/npmrc.5 @@ -1,4 +1,4 @@ -.TH "NPMRC" "5" "February 2023" "" "" +.TH "NPMRC" "5" "April 2023" "" "" .SH "NAME" \fBnpmrc\fR - The npm config files .SS "Description" diff --git a/deps/npm/man/man5/package-json.5 b/deps/npm/man/man5/package-json.5 index 8f7dd8fd5b73e6..a2a7d60a66ca54 100644 --- a/deps/npm/man/man5/package-json.5 +++ b/deps/npm/man/man5/package-json.5 @@ -1,4 +1,4 @@ -.TH "PACKAGE.JSON" "5" "February 2023" "" "" +.TH "PACKAGE.JSON" "5" "April 2023" "" "" .SH "NAME" \fBpackage.json\fR - Specifics of npm's package.json handling .SS "Description" diff --git a/deps/npm/man/man5/package-lock-json.5 b/deps/npm/man/man5/package-lock-json.5 index 20be57b80db4fb..3406d41da78d38 100644 --- a/deps/npm/man/man5/package-lock-json.5 +++ b/deps/npm/man/man5/package-lock-json.5 @@ -1,4 +1,4 @@ -.TH "PACKAGE-LOCK.JSON" "5" "February 2023" "" "" +.TH "PACKAGE-LOCK.JSON" "5" "April 2023" "" "" .SH "NAME" \fBpackage-lock.json\fR - A manifestation of the manifest .SS "Description" @@ -67,9 +67,9 @@ No version provided: an "ancient" shrinkwrap file from a version of npm prior to .IP \(bu 4 \fB1\fR: The lockfile version used by npm v5 and v6. .IP \(bu 4 -\fB2\fR: The lockfile version used by npm v7, which is backwards compatible to v1 lockfiles. +\fB2\fR: The lockfile version used by npm v7 and v8. Backwards compatible to v1 lockfiles. .IP \(bu 4 -\fB3\fR: The lockfile version used by npm v7, \fIwithout\fR backwards compatibility affordances. This is used for the hidden lockfile at \fBnode_modules/.package-lock.json\fR, and will likely be used in a future version of npm, once support for npm v6 is no longer relevant. +\fB3\fR: The lockfile version used by npm v9. Backwards compatible to npm v7. .RE 0 .P diff --git a/deps/npm/man/man7/config.7 b/deps/npm/man/man7/config.7 index dc4261c2803a8c..421caf7e085c6d 100644 --- a/deps/npm/man/man7/config.7 +++ b/deps/npm/man/man7/config.7 @@ -1,4 +1,4 @@ -.TH "CONFIG" "7" "February 2023" "" "" +.TH "CONFIG" "7" "April 2023" "" "" .SH "NAME" \fBconfig\fR - More than you probably want to know about npm configuration .SS "Description" diff --git a/deps/npm/man/man7/dependency-selectors.7 b/deps/npm/man/man7/dependency-selectors.7 index f1670a3a20e885..2702ee7bae5120 100644 --- a/deps/npm/man/man7/dependency-selectors.7 +++ b/deps/npm/man/man7/dependency-selectors.7 @@ -1,4 +1,4 @@ -.TH "QUERYING" "7" "February 2023" "" "" +.TH "QUERYING" "7" "April 2023" "" "" .SH "NAME" \fBQuerying\fR - Dependency Selector Syntax & Querying .SS "Description" diff --git a/deps/npm/man/man7/developers.7 b/deps/npm/man/man7/developers.7 index a15142ba205a4b..db066422636f0d 100644 --- a/deps/npm/man/man7/developers.7 +++ b/deps/npm/man/man7/developers.7 @@ -1,4 +1,4 @@ -.TH "DEVELOPERS" "7" "February 2023" "" "" +.TH "DEVELOPERS" "7" "April 2023" "" "" .SH "NAME" \fBdevelopers\fR - Developer Guide .SS "Description" diff --git a/deps/npm/man/man7/logging.7 b/deps/npm/man/man7/logging.7 index d1cc3bdf00d8ca..302edf742906bb 100644 --- a/deps/npm/man/man7/logging.7 +++ b/deps/npm/man/man7/logging.7 @@ -1,4 +1,4 @@ -.TH "LOGGING" "7" "February 2023" "" "" +.TH "LOGGING" "7" "April 2023" "" "" .SH "NAME" \fBLogging\fR - Why, What & How We Log .SS "Description" diff --git a/deps/npm/man/man7/orgs.7 b/deps/npm/man/man7/orgs.7 index 7aa5da2ede48f4..909ae76026ba68 100644 --- a/deps/npm/man/man7/orgs.7 +++ b/deps/npm/man/man7/orgs.7 @@ -1,4 +1,4 @@ -.TH "ORGS" "7" "February 2023" "" "" +.TH "ORGS" "7" "April 2023" "" "" .SH "NAME" \fBorgs\fR - Working with Teams & Orgs .SS "Description" diff --git a/deps/npm/man/man7/package-spec.7 b/deps/npm/man/man7/package-spec.7 index 4ae0095bd13b25..c5d8347458ae9e 100644 --- a/deps/npm/man/man7/package-spec.7 +++ b/deps/npm/man/man7/package-spec.7 @@ -1,4 +1,4 @@ -.TH "PACKAGE-SPEC" "7" "February 2023" "" "" +.TH "PACKAGE-SPEC" "7" "April 2023" "" "" .SH "NAME" \fBpackage-spec\fR - Package name specifier .SS "Description" diff --git a/deps/npm/man/man7/registry.7 b/deps/npm/man/man7/registry.7 index e67c8bb2b01158..fe1fe2d1c49867 100644 --- a/deps/npm/man/man7/registry.7 +++ b/deps/npm/man/man7/registry.7 @@ -1,4 +1,4 @@ -.TH "REGISTRY" "7" "February 2023" "" "" +.TH "REGISTRY" "7" "April 2023" "" "" .SH "NAME" \fBregistry\fR - The JavaScript Package Registry .SS "Description" diff --git a/deps/npm/man/man7/removal.7 b/deps/npm/man/man7/removal.7 index 82e39c8cb1acc3..60bc180f7ba7a3 100644 --- a/deps/npm/man/man7/removal.7 +++ b/deps/npm/man/man7/removal.7 @@ -1,4 +1,4 @@ -.TH "REMOVAL" "7" "February 2023" "" "" +.TH "REMOVAL" "7" "April 2023" "" "" .SH "NAME" \fBremoval\fR - Cleaning the Slate .SS "Synopsis" diff --git a/deps/npm/man/man7/scope.7 b/deps/npm/man/man7/scope.7 index 670b2f88c82116..8b7b1a48fffd83 100644 --- a/deps/npm/man/man7/scope.7 +++ b/deps/npm/man/man7/scope.7 @@ -1,4 +1,4 @@ -.TH "SCOPE" "7" "February 2023" "" "" +.TH "SCOPE" "7" "April 2023" "" "" .SH "NAME" \fBscope\fR - Scoped packages .SS "Description" diff --git a/deps/npm/man/man7/scripts.7 b/deps/npm/man/man7/scripts.7 index 5f0ee7735d6a22..7f6bdcdeb13794 100644 --- a/deps/npm/man/man7/scripts.7 +++ b/deps/npm/man/man7/scripts.7 @@ -1,4 +1,4 @@ -.TH "SCRIPTS" "7" "February 2023" "" "" +.TH "SCRIPTS" "7" "April 2023" "" "" .SH "NAME" \fBscripts\fR - How npm handles the "scripts" field .SS "Description" diff --git a/deps/npm/man/man7/workspaces.7 b/deps/npm/man/man7/workspaces.7 index 6e1e9bf59e08f2..0b315f31e4a9f8 100644 --- a/deps/npm/man/man7/workspaces.7 +++ b/deps/npm/man/man7/workspaces.7 @@ -1,4 +1,4 @@ -.TH "WORKSPACES" "7" "February 2023" "" "" +.TH "WORKSPACES" "7" "April 2023" "" "" .SH "NAME" \fBworkspaces\fR - Working with workspaces .SS "Description" diff --git a/deps/npm/node_modules/@colors/colors/index.d.ts b/deps/npm/node_modules/@colors/colors/index.d.ts deleted file mode 100644 index df3f2e6afc945a..00000000000000 --- a/deps/npm/node_modules/@colors/colors/index.d.ts +++ /dev/null @@ -1,136 +0,0 @@ -// Type definitions for @colors/colors 1.4+ -// Project: https://github.com/Marak/colors.js -// Definitions by: Bart van der Schoor , Staffan Eketorp -// Definitions: https://github.com/DABH/colors.js - -export interface Color { - (text: string): string; - - strip: Color; - stripColors: Color; - - black: Color; - red: Color; - green: Color; - yellow: Color; - blue: Color; - magenta: Color; - cyan: Color; - white: Color; - gray: Color; - grey: Color; - - bgBlack: Color; - bgRed: Color; - bgGreen: Color; - bgYellow: Color; - bgBlue: Color; - bgMagenta: Color; - bgCyan: Color; - bgWhite: Color; - - reset: Color; - bold: Color; - dim: Color; - italic: Color; - underline: Color; - inverse: Color; - hidden: Color; - strikethrough: Color; - - rainbow: Color; - zebra: Color; - america: Color; - trap: Color; - random: Color; - zalgo: Color; -} - -export function enable(): void; -export function disable(): void; -export function setTheme(theme: any): void; - -export let enabled: boolean; - -export const strip: Color; -export const stripColors: Color; - -export const black: Color; -export const red: Color; -export const green: Color; -export const yellow: Color; -export const blue: Color; -export const magenta: Color; -export const cyan: Color; -export const white: Color; -export const gray: Color; -export const grey: Color; - -export const bgBlack: Color; -export const bgRed: Color; -export const bgGreen: Color; -export const bgYellow: Color; -export const bgBlue: Color; -export const bgMagenta: Color; -export const bgCyan: Color; -export const bgWhite: Color; - -export const reset: Color; -export const bold: Color; -export const dim: Color; -export const italic: Color; -export const underline: Color; -export const inverse: Color; -export const hidden: Color; -export const strikethrough: Color; - -export const rainbow: Color; -export const zebra: Color; -export const america: Color; -export const trap: Color; -export const random: Color; -export const zalgo: Color; - -declare global { - interface String { - strip: string; - stripColors: string; - - black: string; - red: string; - green: string; - yellow: string; - blue: string; - magenta: string; - cyan: string; - white: string; - gray: string; - grey: string; - - bgBlack: string; - bgRed: string; - bgGreen: string; - bgYellow: string; - bgBlue: string; - bgMagenta: string; - bgCyan: string; - bgWhite: string; - - reset: string; - // @ts-ignore - bold: string; - dim: string; - italic: string; - underline: string; - inverse: string; - hidden: string; - strikethrough: string; - - rainbow: string; - zebra: string; - america: string; - trap: string; - random: string; - zalgo: string; - } -} diff --git a/deps/npm/node_modules/@colors/colors/safe.d.ts b/deps/npm/node_modules/@colors/colors/safe.d.ts deleted file mode 100644 index 2bafc27984e0ea..00000000000000 --- a/deps/npm/node_modules/@colors/colors/safe.d.ts +++ /dev/null @@ -1,48 +0,0 @@ -// Type definitions for Colors.js 1.2 -// Project: https://github.com/Marak/colors.js -// Definitions by: Bart van der Schoor , Staffan Eketorp -// Definitions: https://github.com/Marak/colors.js - -export const enabled: boolean; -export function enable(): void; -export function disable(): void; -export function setTheme(theme: any): void; - -export function strip(str: string): string; -export function stripColors(str: string): string; - -export function black(str: string): string; -export function red(str: string): string; -export function green(str: string): string; -export function yellow(str: string): string; -export function blue(str: string): string; -export function magenta(str: string): string; -export function cyan(str: string): string; -export function white(str: string): string; -export function gray(str: string): string; -export function grey(str: string): string; - -export function bgBlack(str: string): string; -export function bgRed(str: string): string; -export function bgGreen(str: string): string; -export function bgYellow(str: string): string; -export function bgBlue(str: string): string; -export function bgMagenta(str: string): string; -export function bgCyan(str: string): string; -export function bgWhite(str: string): string; - -export function reset(str: string): string; -export function bold(str: string): string; -export function dim(str: string): string; -export function italic(str: string): string; -export function underline(str: string): string; -export function inverse(str: string): string; -export function hidden(str: string): string; -export function strikethrough(str: string): string; - -export function rainbow(str: string): string; -export function zebra(str: string): string; -export function america(str: string): string; -export function trap(str: string): string; -export function random(str: string): string; -export function zalgo(str: string): string; diff --git a/deps/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js b/deps/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js index 2ea66ac3364149..0d936d8ef77689 100644 --- a/deps/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js +++ b/deps/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js @@ -1243,7 +1243,7 @@ This is a one-time fix-up, please be patient... if (isWorkspace) { const existingNode = this.idealTree.edgesOut.get(spec.name).to if (existingNode && existingNode.isWorkspace && existingNode.satisfies(edge)) { - return edge.to + return existingNode } } diff --git a/deps/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js b/deps/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js index 87993cca876d66..760fa977ecfd91 100644 --- a/deps/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js +++ b/deps/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js @@ -535,9 +535,14 @@ module.exports = cls => class Reifier extends cls { await this[_renamePath](d, retired) } } - const made = await mkdir(node.path, { recursive: true }) this[_sparseTreeDirs].add(node.path) - this[_sparseTreeRoots].add(made) + const made = await mkdir(node.path, { recursive: true }) + // if the directory already exists, made will be undefined. if that's the case + // we don't want to remove it because we aren't the ones who created it so we + // omit it from the _sparseTreeRoots + if (made) { + this[_sparseTreeRoots].add(made) + } })) .then(() => process.emit('timeEnd', 'reify:createSparse')) } diff --git a/deps/npm/node_modules/@npmcli/arborist/package.json b/deps/npm/node_modules/@npmcli/arborist/package.json index aaa69e048432aa..f5706d414ef12b 100644 --- a/deps/npm/node_modules/@npmcli/arborist/package.json +++ b/deps/npm/node_modules/@npmcli/arborist/package.json @@ -1,11 +1,11 @@ { "name": "@npmcli/arborist", - "version": "6.2.3", + "version": "6.2.7", "description": "Manage node_modules trees", "dependencies": { "@isaacs/string-locale-compare": "^1.1.0", "@npmcli/fs": "^3.1.0", - "@npmcli/installed-package-contents": "^2.0.0", + "@npmcli/installed-package-contents": "^2.0.2", "@npmcli/map-workspaces": "^3.0.2", "@npmcli/metavuln-calculator": "^5.0.0", "@npmcli/name-from-folder": "^2.0.0", @@ -19,7 +19,7 @@ "hosted-git-info": "^6.1.1", "json-parse-even-better-errors": "^3.0.0", "json-stringify-nice": "^1.1.4", - "minimatch": "^6.1.6", + "minimatch": "^7.4.2", "nopt": "^7.0.0", "npm-install-checks": "^6.0.0", "npm-package-arg": "^10.1.0", @@ -30,7 +30,7 @@ "parse-conflict-json": "^3.0.0", "proc-log": "^3.0.0", "promise-all-reject-late": "^1.0.0", - "promise-call-limit": "^1.0.1", + "promise-call-limit": "^1.0.2", "read-package-json-fast": "^3.0.2", "semver": "^7.3.7", "ssri": "^10.0.1", @@ -39,7 +39,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.11.4", + "@npmcli/template-oss": "4.12.1", "benchmark": "^2.1.4", "chalk": "^4.1.0", "minify-registry-metadata": "^3.0.0", @@ -98,7 +98,7 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.11.4", + "version": "4.12.1", "content": "../../scripts/template-oss/index.js" } } diff --git a/deps/npm/node_modules/@npmcli/config/lib/parse-field.js b/deps/npm/node_modules/@npmcli/config/lib/parse-field.js index 0c905bf23cb107..099b0b4eaf1a83 100644 --- a/deps/npm/node_modules/@npmcli/config/lib/parse-field.js +++ b/deps/npm/node_modules/@npmcli/config/lib/parse-field.js @@ -20,6 +20,7 @@ const parseField = (f, key, opts, listElement = false) => { const isUmask = typeList.has(typeDefs.Umask.type) const isNumber = typeList.has(typeDefs.Number.type) const isList = !listElement && typeList.has(Array) + const isDate = typeList.has(typeDefs.Date.type) if (Array.isArray(f)) { return !isList ? f : f.map(field => parseField(field, key, opts, true)) @@ -53,6 +54,10 @@ const parseField = (f, key, opts, listElement = false) => { f = envReplace(f, env) + if (isDate) { + return new Date(f) + } + if (isPath) { const homePattern = platform === 'win32' ? /^~(\/|\\)/ : /^~\// if (homePattern.test(f) && home) { diff --git a/deps/npm/node_modules/@npmcli/config/package.json b/deps/npm/node_modules/@npmcli/config/package.json index 38c063e358beb1..d61e4fab839c43 100644 --- a/deps/npm/node_modules/@npmcli/config/package.json +++ b/deps/npm/node_modules/@npmcli/config/package.json @@ -1,6 +1,6 @@ { "name": "@npmcli/config", - "version": "6.1.3", + "version": "6.1.5", "files": [ "bin/", "lib/" @@ -33,7 +33,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.11.4", + "@npmcli/template-oss": "4.12.1", "tap": "^16.3.4" }, "dependencies": { @@ -50,6 +50,6 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.11.4" + "version": "4.12.1" } } diff --git a/deps/npm/node_modules/@npmcli/git/lib/clone.js b/deps/npm/node_modules/@npmcli/git/lib/clone.js index 3f165dd70e3806..e25a4d14268216 100644 --- a/deps/npm/node_modules/@npmcli/git/lib/clone.js +++ b/deps/npm/node_modules/@npmcli/git/lib/clone.js @@ -27,8 +27,7 @@ const spawn = require('./spawn.js') const { isWindows } = require('./utils.js') const pickManifest = require('npm-pick-manifest') -const fs = require('fs') -const mkdirp = require('mkdirp') +const fs = require('fs/promises') module.exports = (repo, ref = 'HEAD', target = null, opts = {}) => getRevs(repo, opts).then(revs => clone( @@ -93,7 +92,7 @@ const other = (repo, revDoc, target, opts) => { .concat(shallow ? ['--depth=1'] : []) const git = (args) => spawn(args, { ...opts, cwd: target }) - return mkdirp(target) + return fs.mkdir(target, { recursive: true }) .then(() => git(['init'])) .then(() => isWindows(opts) ? git(['config', '--local', '--add', 'core.longpaths', 'true']) @@ -141,19 +140,21 @@ const plain = (repo, revDoc, target, opts) => { return spawn(args, opts).then(() => revDoc.sha) } -const updateSubmodules = (target, opts) => new Promise(resolve => - fs.stat(target + '/.gitmodules', er => { - if (er) { - return resolve(null) - } - return resolve(spawn([ - 'submodule', - 'update', - '-q', - '--init', - '--recursive', - ], { ...opts, cwd: target })) - })) +const updateSubmodules = async (target, opts) => { + const hasSubmodules = await fs.stat(`${target}/.gitmodules`) + .then(() => true) + .catch(() => false) + if (!hasSubmodules) { + return null + } + return spawn([ + 'submodule', + 'update', + '-q', + '--init', + '--recursive', + ], { ...opts, cwd: target }) +} const unresolved = (repo, ref, target, opts) => { // can't do this one shallowly, because the ref isn't advertised @@ -161,7 +162,7 @@ const unresolved = (repo, ref, target, opts) => { const lp = isWindows(opts) ? ['--config', 'core.longpaths=true'] : [] const cloneArgs = ['clone', '--mirror', '-q', repo, target + '/.git'] const git = (args) => spawn(args, { ...opts, cwd: target }) - return mkdirp(target) + return fs.mkdir(target, { recursive: true }) .then(() => git(cloneArgs.concat(lp))) .then(() => git(['init'])) .then(() => git(['checkout', ref])) diff --git a/deps/npm/node_modules/@npmcli/git/package.json b/deps/npm/node_modules/@npmcli/git/package.json index f3ce2fcfc92321..41c78dddfa3ccc 100644 --- a/deps/npm/node_modules/@npmcli/git/package.json +++ b/deps/npm/node_modules/@npmcli/git/package.json @@ -1,6 +1,6 @@ { "name": "@npmcli/git", - "version": "4.0.3", + "version": "4.0.4", "main": "lib/index.js", "files": [ "bin/", @@ -32,16 +32,14 @@ }, "devDependencies": { "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.8.0", + "@npmcli/template-oss": "4.12.0", "npm-package-arg": "^10.0.0", - "rimraf": "^3.0.2", "slash": "^3.0.0", "tap": "^16.0.1" }, "dependencies": { "@npmcli/promise-spawn": "^6.0.0", "lru-cache": "^7.4.4", - "mkdirp": "^1.0.4", "npm-pick-manifest": "^8.0.0", "proc-log": "^3.0.0", "promise-inflight": "^1.0.1", @@ -55,6 +53,6 @@ "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", "windowsCI": false, - "version": "4.8.0" + "version": "4.12.0" } } diff --git a/deps/npm/node_modules/@npmcli/installed-package-contents/lib/index.js b/deps/npm/node_modules/@npmcli/installed-package-contents/lib/index.js index e2c545b5ab949c..20b25c4bc8437d 100755 --- a/deps/npm/node_modules/@npmcli/installed-package-contents/lib/index.js +++ b/deps/npm/node_modules/@npmcli/installed-package-contents/lib/index.js @@ -1,3 +1,5 @@ +#! /usr/bin/env node + // to GET CONTENTS for folder at PATH (which may be a PACKAGE): // - if PACKAGE, read path/package.json // - if bins in ../node_modules/.bin, add those to result diff --git a/deps/npm/node_modules/@npmcli/installed-package-contents/package.json b/deps/npm/node_modules/@npmcli/installed-package-contents/package.json index aac2de13042561..3554754123e618 100644 --- a/deps/npm/node_modules/@npmcli/installed-package-contents/package.json +++ b/deps/npm/node_modules/@npmcli/installed-package-contents/package.json @@ -1,6 +1,6 @@ { "name": "@npmcli/installed-package-contents", - "version": "2.0.1", + "version": "2.0.2", "description": "Get the list of files installed in a package in node_modules, including bundled dependencies", "author": "GitHub Inc.", "main": "lib/index.js", @@ -19,8 +19,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.6.2", - "mkdirp": "^1.0.4", + "@npmcli/template-oss": "4.11.4", "require-inject": "^1.4.4", "tap": "^16.3.0" }, @@ -41,7 +40,7 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.6.2" + "version": "4.11.4" }, "tap": { "nyc-arg": [ diff --git a/deps/npm/node_modules/@npmcli/map-workspaces/lib/index.js b/deps/npm/node_modules/@npmcli/map-workspaces/lib/index.js index f93bc2911e89fd..cd9b65db53231c 100644 --- a/deps/npm/node_modules/@npmcli/map-workspaces/lib/index.js +++ b/deps/npm/node_modules/@npmcli/map-workspaces/lib/index.js @@ -1,11 +1,9 @@ -const { promisify } = require('util') const path = require('path') const getName = require('@npmcli/name-from-folder') const minimatch = require('minimatch') const rpj = require('read-package-json-fast') const glob = require('glob') -const pGlob = promisify(glob) function appendNegatedPatterns (patterns) { const results = [] @@ -98,7 +96,9 @@ async function mapWorkspaces (opts = {}) { const getPackagePathname = pkgPathmame(opts) for (const item of patterns) { - const matches = await pGlob(getGlobPattern(item.pattern), getGlobOpts()) + let matches = await glob(getGlobPattern(item.pattern), getGlobOpts()) + // preserves glob@8 behavior + matches = matches.sort((a, b) => a.localeCompare(b, 'en')) for (const match of matches) { let pkg diff --git a/deps/npm/node_modules/@npmcli/map-workspaces/package.json b/deps/npm/node_modules/@npmcli/map-workspaces/package.json index 3f5270360c5fc0..35b7e3fde2362e 100644 --- a/deps/npm/node_modules/@npmcli/map-workspaces/package.json +++ b/deps/npm/node_modules/@npmcli/map-workspaces/package.json @@ -1,6 +1,6 @@ { "name": "@npmcli/map-workspaces", - "version": "3.0.2", + "version": "3.0.3", "main": "lib/index.js", "files": [ "bin/", @@ -43,17 +43,17 @@ }, "devDependencies": { "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.11.3", + "@npmcli/template-oss": "4.12.0", "tap": "^16.0.1" }, "dependencies": { "@npmcli/name-from-folder": "^2.0.0", - "glob": "^8.0.1", - "minimatch": "^6.1.6", + "glob": "^9.3.1", + "minimatch": "^7.4.2", "read-package-json-fast": "^3.0.0" }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.11.3" + "version": "4.12.0" } } diff --git a/deps/npm/node_modules/@sigstore/protobuf-specs/LICENSE b/deps/npm/node_modules/@sigstore/protobuf-specs/LICENSE new file mode 100644 index 00000000000000..e9e7c1679a09df --- /dev/null +++ b/deps/npm/node_modules/@sigstore/protobuf-specs/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2023 The Sigstore Authors + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/deps/npm/node_modules/sigstore/dist/types/sigstore/__generated__/envelope.js b/deps/npm/node_modules/@sigstore/protobuf-specs/dist/__generated__/envelope.js similarity index 100% rename from deps/npm/node_modules/sigstore/dist/types/sigstore/__generated__/envelope.js rename to deps/npm/node_modules/@sigstore/protobuf-specs/dist/__generated__/envelope.js diff --git a/deps/npm/node_modules/sigstore/dist/types/sigstore/__generated__/google/api/field_behavior.js b/deps/npm/node_modules/@sigstore/protobuf-specs/dist/__generated__/google/api/field_behavior.js similarity index 100% rename from deps/npm/node_modules/sigstore/dist/types/sigstore/__generated__/google/api/field_behavior.js rename to deps/npm/node_modules/@sigstore/protobuf-specs/dist/__generated__/google/api/field_behavior.js diff --git a/deps/npm/node_modules/sigstore/dist/types/sigstore/__generated__/google/protobuf/descriptor.js b/deps/npm/node_modules/@sigstore/protobuf-specs/dist/__generated__/google/protobuf/descriptor.js similarity index 100% rename from deps/npm/node_modules/sigstore/dist/types/sigstore/__generated__/google/protobuf/descriptor.js rename to deps/npm/node_modules/@sigstore/protobuf-specs/dist/__generated__/google/protobuf/descriptor.js diff --git a/deps/npm/node_modules/sigstore/dist/types/sigstore/__generated__/google/protobuf/timestamp.js b/deps/npm/node_modules/@sigstore/protobuf-specs/dist/__generated__/google/protobuf/timestamp.js similarity index 100% rename from deps/npm/node_modules/sigstore/dist/types/sigstore/__generated__/google/protobuf/timestamp.js rename to deps/npm/node_modules/@sigstore/protobuf-specs/dist/__generated__/google/protobuf/timestamp.js diff --git a/deps/npm/node_modules/sigstore/dist/types/sigstore/__generated__/sigstore_bundle.js b/deps/npm/node_modules/@sigstore/protobuf-specs/dist/__generated__/sigstore_bundle.js similarity index 100% rename from deps/npm/node_modules/sigstore/dist/types/sigstore/__generated__/sigstore_bundle.js rename to deps/npm/node_modules/@sigstore/protobuf-specs/dist/__generated__/sigstore_bundle.js diff --git a/deps/npm/node_modules/sigstore/dist/types/sigstore/__generated__/sigstore_common.js b/deps/npm/node_modules/@sigstore/protobuf-specs/dist/__generated__/sigstore_common.js similarity index 100% rename from deps/npm/node_modules/sigstore/dist/types/sigstore/__generated__/sigstore_common.js rename to deps/npm/node_modules/@sigstore/protobuf-specs/dist/__generated__/sigstore_common.js diff --git a/deps/npm/node_modules/sigstore/dist/types/sigstore/__generated__/sigstore_rekor.js b/deps/npm/node_modules/@sigstore/protobuf-specs/dist/__generated__/sigstore_rekor.js similarity index 100% rename from deps/npm/node_modules/sigstore/dist/types/sigstore/__generated__/sigstore_rekor.js rename to deps/npm/node_modules/@sigstore/protobuf-specs/dist/__generated__/sigstore_rekor.js diff --git a/deps/npm/node_modules/sigstore/dist/types/sigstore/__generated__/sigstore_trustroot.js b/deps/npm/node_modules/@sigstore/protobuf-specs/dist/__generated__/sigstore_trustroot.js similarity index 100% rename from deps/npm/node_modules/sigstore/dist/types/sigstore/__generated__/sigstore_trustroot.js rename to deps/npm/node_modules/@sigstore/protobuf-specs/dist/__generated__/sigstore_trustroot.js diff --git a/deps/npm/node_modules/sigstore/dist/types/sigstore/__generated__/sigstore_verification.js b/deps/npm/node_modules/@sigstore/protobuf-specs/dist/__generated__/sigstore_verification.js similarity index 100% rename from deps/npm/node_modules/sigstore/dist/types/sigstore/__generated__/sigstore_verification.js rename to deps/npm/node_modules/@sigstore/protobuf-specs/dist/__generated__/sigstore_verification.js diff --git a/deps/npm/node_modules/@sigstore/protobuf-specs/dist/index.js b/deps/npm/node_modules/@sigstore/protobuf-specs/dist/index.js new file mode 100644 index 00000000000000..eafb768c48fcaa --- /dev/null +++ b/deps/npm/node_modules/@sigstore/protobuf-specs/dist/index.js @@ -0,0 +1,37 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +/* +Copyright 2023 The Sigstore Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +__exportStar(require("./__generated__/envelope"), exports); +__exportStar(require("./__generated__/sigstore_bundle"), exports); +__exportStar(require("./__generated__/sigstore_common"), exports); +__exportStar(require("./__generated__/sigstore_rekor"), exports); +__exportStar(require("./__generated__/sigstore_trustroot"), exports); +__exportStar(require("./__generated__/sigstore_verification"), exports); diff --git a/deps/npm/node_modules/@sigstore/protobuf-specs/package.json b/deps/npm/node_modules/@sigstore/protobuf-specs/package.json new file mode 100644 index 00000000000000..7cb4aa9c5364ff --- /dev/null +++ b/deps/npm/node_modules/@sigstore/protobuf-specs/package.json @@ -0,0 +1,31 @@ +{ + "name": "@sigstore/protobuf-specs", + "version": "0.1.0", + "description": "code-signing for npm packages", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "scripts": { + "build": "tsc" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/sigstore/protobuf-specs.git" + }, + "files": [ + "dist" + ], + "author": "bdehamer@github.com", + "license": "Apache-2.0", + "bugs": { + "url": "https://github.com/sigstore/protobuf-specs/issues" + }, + "homepage": "https://github.com/sigstore/protobuf-specs#readme", + "devDependencies": { + "@tsconfig/node14": "^1.0.3", + "@types/node": "^18.14.0", + "typescript": "^4.9.5" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } +} diff --git a/deps/npm/node_modules/@tootallnate/once/dist/index.d.ts b/deps/npm/node_modules/@tootallnate/once/dist/index.d.ts deleted file mode 100644 index 93d02a9a348b50..00000000000000 --- a/deps/npm/node_modules/@tootallnate/once/dist/index.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -/// -import { EventEmitter } from 'events'; -import { EventNames, EventListenerParameters, AbortSignal } from './types'; -export interface OnceOptions { - signal?: AbortSignal; -} -export default function once>(emitter: Emitter, name: Event, { signal }?: OnceOptions): Promise>; diff --git a/deps/npm/node_modules/@tootallnate/once/dist/index.js.map b/deps/npm/node_modules/@tootallnate/once/dist/index.js.map deleted file mode 100644 index 61708ca07f1b09..00000000000000 --- a/deps/npm/node_modules/@tootallnate/once/dist/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AAOA,SAAwB,IAAI,CAI3B,OAAgB,EAChB,IAAW,EACX,EAAE,MAAM,KAAkB,EAAE;IAE5B,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACtC,SAAS,OAAO;YACf,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,mBAAmB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;YAC9C,OAAO,CAAC,cAAc,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;YACtC,OAAO,CAAC,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAC1C,CAAC;QACD,SAAS,OAAO,CAAC,GAAG,IAAW;YAC9B,OAAO,EAAE,CAAC;YACV,OAAO,CAAC,IAA+C,CAAC,CAAC;QAC1D,CAAC;QACD,SAAS,OAAO,CAAC,GAAU;YAC1B,OAAO,EAAE,CAAC;YACV,MAAM,CAAC,GAAG,CAAC,CAAC;QACb,CAAC;QACD,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,gBAAgB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAC3C,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAC1B,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC9B,CAAC,CAAC,CAAC;AACJ,CAAC;AA1BD,uBA0BC"} \ No newline at end of file diff --git a/deps/npm/node_modules/@tootallnate/once/dist/overloaded-parameters.d.ts b/deps/npm/node_modules/@tootallnate/once/dist/overloaded-parameters.d.ts deleted file mode 100644 index eb2bbc6c6275ec..00000000000000 --- a/deps/npm/node_modules/@tootallnate/once/dist/overloaded-parameters.d.ts +++ /dev/null @@ -1,231 +0,0 @@ -export declare type OverloadedParameters = T extends { - (...args: infer A1): any; - (...args: infer A2): any; - (...args: infer A3): any; - (...args: infer A4): any; - (...args: infer A5): any; - (...args: infer A6): any; - (...args: infer A7): any; - (...args: infer A8): any; - (...args: infer A9): any; - (...args: infer A10): any; - (...args: infer A11): any; - (...args: infer A12): any; - (...args: infer A13): any; - (...args: infer A14): any; - (...args: infer A15): any; - (...args: infer A16): any; - (...args: infer A17): any; - (...args: infer A18): any; - (...args: infer A19): any; - (...args: infer A20): any; -} ? A1 | A2 | A3 | A4 | A5 | A6 | A7 | A8 | A9 | A10 | A11 | A12 | A13 | A14 | A15 | A16 | A17 | A18 | A19 | A20 : T extends { - (...args: infer A1): any; - (...args: infer A2): any; - (...args: infer A3): any; - (...args: infer A4): any; - (...args: infer A5): any; - (...args: infer A6): any; - (...args: infer A7): any; - (...args: infer A8): any; - (...args: infer A9): any; - (...args: infer A10): any; - (...args: infer A11): any; - (...args: infer A12): any; - (...args: infer A13): any; - (...args: infer A14): any; - (...args: infer A15): any; - (...args: infer A16): any; - (...args: infer A17): any; - (...args: infer A18): any; - (...args: infer A19): any; -} ? A1 | A2 | A3 | A4 | A5 | A6 | A7 | A8 | A9 | A10 | A11 | A12 | A13 | A14 | A15 | A16 | A17 | A18 | A19 : T extends { - (...args: infer A1): any; - (...args: infer A2): any; - (...args: infer A3): any; - (...args: infer A4): any; - (...args: infer A5): any; - (...args: infer A6): any; - (...args: infer A7): any; - (...args: infer A8): any; - (...args: infer A9): any; - (...args: infer A10): any; - (...args: infer A11): any; - (...args: infer A12): any; - (...args: infer A13): any; - (...args: infer A14): any; - (...args: infer A15): any; - (...args: infer A16): any; - (...args: infer A17): any; - (...args: infer A18): any; -} ? A1 | A2 | A3 | A4 | A5 | A6 | A7 | A8 | A9 | A10 | A11 | A12 | A13 | A14 | A15 | A16 | A17 | A18 : T extends { - (...args: infer A1): any; - (...args: infer A2): any; - (...args: infer A3): any; - (...args: infer A4): any; - (...args: infer A5): any; - (...args: infer A6): any; - (...args: infer A7): any; - (...args: infer A8): any; - (...args: infer A9): any; - (...args: infer A10): any; - (...args: infer A11): any; - (...args: infer A12): any; - (...args: infer A13): any; - (...args: infer A14): any; - (...args: infer A15): any; - (...args: infer A16): any; - (...args: infer A17): any; -} ? A1 | A2 | A3 | A4 | A5 | A6 | A7 | A8 | A9 | A10 | A11 | A12 | A13 | A14 | A15 | A16 | A17 : T extends { - (...args: infer A1): any; - (...args: infer A2): any; - (...args: infer A3): any; - (...args: infer A4): any; - (...args: infer A5): any; - (...args: infer A6): any; - (...args: infer A7): any; - (...args: infer A8): any; - (...args: infer A9): any; - (...args: infer A10): any; - (...args: infer A11): any; - (...args: infer A12): any; - (...args: infer A13): any; - (...args: infer A14): any; - (...args: infer A15): any; - (...args: infer A16): any; -} ? A1 | A2 | A3 | A4 | A5 | A6 | A7 | A8 | A9 | A10 | A11 | A12 | A13 | A14 | A15 | A16 : T extends { - (...args: infer A1): any; - (...args: infer A2): any; - (...args: infer A3): any; - (...args: infer A4): any; - (...args: infer A5): any; - (...args: infer A6): any; - (...args: infer A7): any; - (...args: infer A8): any; - (...args: infer A9): any; - (...args: infer A10): any; - (...args: infer A11): any; - (...args: infer A12): any; - (...args: infer A13): any; - (...args: infer A14): any; - (...args: infer A15): any; -} ? A1 | A2 | A3 | A4 | A5 | A6 | A7 | A8 | A9 | A10 | A11 | A12 | A13 | A14 | A15 : T extends { - (...args: infer A1): any; - (...args: infer A2): any; - (...args: infer A3): any; - (...args: infer A4): any; - (...args: infer A5): any; - (...args: infer A6): any; - (...args: infer A7): any; - (...args: infer A8): any; - (...args: infer A9): any; - (...args: infer A10): any; - (...args: infer A11): any; - (...args: infer A12): any; - (...args: infer A13): any; - (...args: infer A14): any; -} ? A1 | A2 | A3 | A4 | A5 | A6 | A7 | A8 | A9 | A10 | A11 | A12 | A13 | A14 : T extends { - (...args: infer A1): any; - (...args: infer A2): any; - (...args: infer A3): any; - (...args: infer A4): any; - (...args: infer A5): any; - (...args: infer A6): any; - (...args: infer A7): any; - (...args: infer A8): any; - (...args: infer A9): any; - (...args: infer A10): any; - (...args: infer A11): any; - (...args: infer A12): any; - (...args: infer A13): any; -} ? A1 | A2 | A3 | A4 | A5 | A6 | A7 | A8 | A9 | A10 | A11 | A12 | A13 : T extends { - (...args: infer A1): any; - (...args: infer A2): any; - (...args: infer A3): any; - (...args: infer A4): any; - (...args: infer A5): any; - (...args: infer A6): any; - (...args: infer A7): any; - (...args: infer A8): any; - (...args: infer A9): any; - (...args: infer A10): any; - (...args: infer A11): any; - (...args: infer A12): any; -} ? A1 | A2 | A3 | A4 | A5 | A6 | A7 | A8 | A9 | A10 | A11 | A12 : T extends { - (...args: infer A1): any; - (...args: infer A2): any; - (...args: infer A3): any; - (...args: infer A4): any; - (...args: infer A5): any; - (...args: infer A6): any; - (...args: infer A7): any; - (...args: infer A8): any; - (...args: infer A9): any; - (...args: infer A10): any; - (...args: infer A11): any; -} ? A1 | A2 | A3 | A4 | A5 | A6 | A7 | A8 | A9 | A10 | A11 : T extends { - (...args: infer A1): any; - (...args: infer A2): any; - (...args: infer A3): any; - (...args: infer A4): any; - (...args: infer A5): any; - (...args: infer A6): any; - (...args: infer A7): any; - (...args: infer A8): any; - (...args: infer A9): any; - (...args: infer A10): any; -} ? A1 | A2 | A3 | A4 | A5 | A6 | A7 | A8 | A9 | A10 : T extends { - (...args: infer A1): any; - (...args: infer A2): any; - (...args: infer A3): any; - (...args: infer A4): any; - (...args: infer A5): any; - (...args: infer A6): any; - (...args: infer A7): any; - (...args: infer A8): any; - (...args: infer A9): any; -} ? A1 | A2 | A3 | A4 | A5 | A6 | A7 | A8 | A9 : T extends { - (...args: infer A1): any; - (...args: infer A2): any; - (...args: infer A3): any; - (...args: infer A4): any; - (...args: infer A5): any; - (...args: infer A6): any; - (...args: infer A7): any; - (...args: infer A8): any; -} ? A1 | A2 | A3 | A4 | A5 | A6 | A7 | A8 : T extends { - (...args: infer A1): any; - (...args: infer A2): any; - (...args: infer A3): any; - (...args: infer A4): any; - (...args: infer A5): any; - (...args: infer A6): any; - (...args: infer A7): any; -} ? A1 | A2 | A3 | A4 | A5 | A6 | A7 : T extends { - (...args: infer A1): any; - (...args: infer A2): any; - (...args: infer A3): any; - (...args: infer A4): any; - (...args: infer A5): any; - (...args: infer A6): any; -} ? A1 | A2 | A3 | A4 | A5 | A6 : T extends { - (...args: infer A1): any; - (...args: infer A2): any; - (...args: infer A3): any; - (...args: infer A4): any; - (...args: infer A5): any; -} ? A1 | A2 | A3 | A4 | A5 : T extends { - (...args: infer A1): any; - (...args: infer A2): any; - (...args: infer A3): any; - (...args: infer A4): any; -} ? A1 | A2 | A3 | A4 : T extends { - (...args: infer A1): any; - (...args: infer A2): any; - (...args: infer A3): any; -} ? A1 | A2 | A3 : T extends { - (...args: infer A1): any; - (...args: infer A2): any; -} ? A1 | A2 : T extends { - (...args: infer A1): any; -} ? A1 : any; diff --git a/deps/npm/node_modules/@tootallnate/once/dist/overloaded-parameters.js.map b/deps/npm/node_modules/@tootallnate/once/dist/overloaded-parameters.js.map deleted file mode 100644 index 863f146d625f6c..00000000000000 --- a/deps/npm/node_modules/@tootallnate/once/dist/overloaded-parameters.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"overloaded-parameters.js","sourceRoot":"","sources":["../src/overloaded-parameters.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/deps/npm/node_modules/@tootallnate/once/dist/types.d.ts b/deps/npm/node_modules/@tootallnate/once/dist/types.d.ts deleted file mode 100644 index 58be8284ab8d3e..00000000000000 --- a/deps/npm/node_modules/@tootallnate/once/dist/types.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/// -import { EventEmitter } from 'events'; -import { OverloadedParameters } from './overloaded-parameters'; -export declare type FirstParameter = T extends [infer R, ...any[]] ? R : never; -export declare type EventListener = F extends [ - T, - infer R, - ...any[] -] ? R : never; -export declare type EventParameters = OverloadedParameters; -export declare type EventNames = FirstParameter>; -export declare type EventListenerParameters> = WithDefault, Event>>, unknown[]>; -export declare type WithDefault = [T] extends [never] ? D : T; -export interface AbortSignal { - addEventListener: (name: string, listener: (...args: any[]) => any) => void; - removeEventListener: (name: string, listener: (...args: any[]) => any) => void; -} diff --git a/deps/npm/node_modules/@tootallnate/once/dist/types.js.map b/deps/npm/node_modules/@tootallnate/once/dist/types.js.map deleted file mode 100644 index c768b79002615c..00000000000000 --- a/deps/npm/node_modules/@tootallnate/once/dist/types.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/deps/npm/node_modules/@tufjs/models/LICENSE b/deps/npm/node_modules/@tufjs/models/LICENSE new file mode 100644 index 00000000000000..420700f5d37659 --- /dev/null +++ b/deps/npm/node_modules/@tufjs/models/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 GitHub and the TUF Contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/deps/npm/node_modules/tuf-js/dist/models/base.js b/deps/npm/node_modules/@tufjs/models/dist/base.js similarity index 81% rename from deps/npm/node_modules/tuf-js/dist/models/base.js rename to deps/npm/node_modules/@tufjs/models/dist/base.js index 7658567e2d6027..d89a089c330922 100644 --- a/deps/npm/node_modules/tuf-js/dist/models/base.js +++ b/deps/npm/node_modules/@tufjs/models/dist/base.js @@ -3,11 +3,23 @@ var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); -exports.Signed = void 0; +exports.Signed = exports.isMetadataKind = exports.MetadataKind = void 0; const util_1 = __importDefault(require("util")); -const error_1 = require("../error"); -const utils_1 = require("../utils"); +const error_1 = require("./error"); +const utils_1 = require("./utils"); const SPECIFICATION_VERSION = ['1', '0', '31']; +var MetadataKind; +(function (MetadataKind) { + MetadataKind["Root"] = "root"; + MetadataKind["Timestamp"] = "timestamp"; + MetadataKind["Snapshot"] = "snapshot"; + MetadataKind["Targets"] = "targets"; +})(MetadataKind = exports.MetadataKind || (exports.MetadataKind = {})); +function isMetadataKind(value) { + return (typeof value === 'string' && + Object.values(MetadataKind).includes(value)); +} +exports.isMetadataKind = isMetadataKind; /*** * A base class for the signed part of TUF metadata. * diff --git a/deps/npm/node_modules/tuf-js/dist/models/delegations.js b/deps/npm/node_modules/@tufjs/models/dist/delegations.js similarity index 93% rename from deps/npm/node_modules/tuf-js/dist/models/delegations.js rename to deps/npm/node_modules/@tufjs/models/dist/delegations.js index 302bd52d8d885d..7165f1e2443936 100644 --- a/deps/npm/node_modules/tuf-js/dist/models/delegations.js +++ b/deps/npm/node_modules/@tufjs/models/dist/delegations.js @@ -5,10 +5,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) { Object.defineProperty(exports, "__esModule", { value: true }); exports.Delegations = void 0; const util_1 = __importDefault(require("util")); -const error_1 = require("../error"); -const guard_1 = require("../utils/guard"); +const error_1 = require("./error"); const key_1 = require("./key"); const role_1 = require("./role"); +const utils_1 = require("./utils"); /** * A container object storing information about all delegations. * @@ -67,7 +67,7 @@ class Delegations { static fromJSON(data) { const { keys, roles, succinct_roles, ...unrecognizedFields } = data; let succinctRoles; - if ((0, guard_1.isObject)(succinct_roles)) { + if (utils_1.guard.isObject(succinct_roles)) { succinctRoles = role_1.SuccinctRoles.fromJSON(succinct_roles); } return new Delegations({ @@ -89,7 +89,7 @@ function rolesToJSON(roles) { return Object.values(roles).map((role) => role.toJSON()); } function keysFromJSON(data) { - if (!(0, guard_1.isObjectRecord)(data)) { + if (!utils_1.guard.isObjectRecord(data)) { throw new TypeError('keys is malformed'); } return Object.entries(data).reduce((acc, [keyID, keyData]) => ({ @@ -99,8 +99,8 @@ function keysFromJSON(data) { } function rolesFromJSON(data) { let roleMap; - if ((0, guard_1.isDefined)(data)) { - if (!(0, guard_1.isObjectArray)(data)) { + if (utils_1.guard.isDefined(data)) { + if (!utils_1.guard.isObjectArray(data)) { throw new TypeError('roles is malformed'); } roleMap = data.reduce((acc, role) => { diff --git a/deps/npm/node_modules/@tufjs/models/dist/error.js b/deps/npm/node_modules/@tufjs/models/dist/error.js new file mode 100644 index 00000000000000..ba80698747ba06 --- /dev/null +++ b/deps/npm/node_modules/@tufjs/models/dist/error.js @@ -0,0 +1,27 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.UnsupportedAlgorithmError = exports.CryptoError = exports.LengthOrHashMismatchError = exports.UnsignedMetadataError = exports.RepositoryError = exports.ValueError = void 0; +// An error about insufficient values +class ValueError extends Error { +} +exports.ValueError = ValueError; +// An error with a repository's state, such as a missing file. +// It covers all exceptions that come from the repository side when +// looking from the perspective of users of metadata API or ngclient. +class RepositoryError extends Error { +} +exports.RepositoryError = RepositoryError; +// An error about metadata object with insufficient threshold of signatures. +class UnsignedMetadataError extends RepositoryError { +} +exports.UnsignedMetadataError = UnsignedMetadataError; +// An error while checking the length and hash values of an object. +class LengthOrHashMismatchError extends RepositoryError { +} +exports.LengthOrHashMismatchError = LengthOrHashMismatchError; +class CryptoError extends Error { +} +exports.CryptoError = CryptoError; +class UnsupportedAlgorithmError extends CryptoError { +} +exports.UnsupportedAlgorithmError = UnsupportedAlgorithmError; diff --git a/deps/npm/node_modules/tuf-js/dist/models/file.js b/deps/npm/node_modules/@tufjs/models/dist/file.js similarity index 95% rename from deps/npm/node_modules/tuf-js/dist/models/file.js rename to deps/npm/node_modules/@tufjs/models/dist/file.js index d6d535f6ca7872..b35fe5950bbb7e 100644 --- a/deps/npm/node_modules/tuf-js/dist/models/file.js +++ b/deps/npm/node_modules/@tufjs/models/dist/file.js @@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.TargetFile = exports.MetaFile = void 0; const crypto_1 = __importDefault(require("crypto")); const util_1 = __importDefault(require("util")); -const error_1 = require("../error"); -const guard_1 = require("../utils/guard"); +const error_1 = require("./error"); +const utils_1 = require("./utils"); // A container with information about a particular metadata file. // // This class is used for Timestamp and Snapshot metadata. @@ -75,10 +75,10 @@ class MetaFile { if (typeof version !== 'number') { throw new TypeError('version must be a number'); } - if ((0, guard_1.isDefined)(length) && typeof length !== 'number') { + if (utils_1.guard.isDefined(length) && typeof length !== 'number') { throw new TypeError('length must be a number'); } - if ((0, guard_1.isDefined)(hashes) && !(0, guard_1.isStringRecord)(hashes)) { + if (utils_1.guard.isDefined(hashes) && !utils_1.guard.isStringRecord(hashes)) { throw new TypeError('hashes must be string keys and values'); } return new MetaFile({ @@ -163,7 +163,7 @@ class TargetFile { if (typeof length !== 'number') { throw new TypeError('length must be a number'); } - if (!(0, guard_1.isStringRecord)(hashes)) { + if (!utils_1.guard.isStringRecord(hashes)) { throw new TypeError('hashes must have string keys and values'); } return new TargetFile({ diff --git a/deps/npm/node_modules/@tufjs/models/dist/index.js b/deps/npm/node_modules/@tufjs/models/dist/index.js new file mode 100644 index 00000000000000..a4dc783659f045 --- /dev/null +++ b/deps/npm/node_modules/@tufjs/models/dist/index.js @@ -0,0 +1,24 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Timestamp = exports.Targets = exports.Snapshot = exports.Signature = exports.Root = exports.Metadata = exports.Key = exports.TargetFile = exports.MetaFile = exports.ValueError = exports.MetadataKind = void 0; +var base_1 = require("./base"); +Object.defineProperty(exports, "MetadataKind", { enumerable: true, get: function () { return base_1.MetadataKind; } }); +var error_1 = require("./error"); +Object.defineProperty(exports, "ValueError", { enumerable: true, get: function () { return error_1.ValueError; } }); +var file_1 = require("./file"); +Object.defineProperty(exports, "MetaFile", { enumerable: true, get: function () { return file_1.MetaFile; } }); +Object.defineProperty(exports, "TargetFile", { enumerable: true, get: function () { return file_1.TargetFile; } }); +var key_1 = require("./key"); +Object.defineProperty(exports, "Key", { enumerable: true, get: function () { return key_1.Key; } }); +var metadata_1 = require("./metadata"); +Object.defineProperty(exports, "Metadata", { enumerable: true, get: function () { return metadata_1.Metadata; } }); +var root_1 = require("./root"); +Object.defineProperty(exports, "Root", { enumerable: true, get: function () { return root_1.Root; } }); +var signature_1 = require("./signature"); +Object.defineProperty(exports, "Signature", { enumerable: true, get: function () { return signature_1.Signature; } }); +var snapshot_1 = require("./snapshot"); +Object.defineProperty(exports, "Snapshot", { enumerable: true, get: function () { return snapshot_1.Snapshot; } }); +var targets_1 = require("./targets"); +Object.defineProperty(exports, "Targets", { enumerable: true, get: function () { return targets_1.Targets; } }); +var timestamp_1 = require("./timestamp"); +Object.defineProperty(exports, "Timestamp", { enumerable: true, get: function () { return timestamp_1.Timestamp; } }); diff --git a/deps/npm/node_modules/@tufjs/models/dist/key.js b/deps/npm/node_modules/@tufjs/models/dist/key.js new file mode 100644 index 00000000000000..5e55b09d7c6ddc --- /dev/null +++ b/deps/npm/node_modules/@tufjs/models/dist/key.js @@ -0,0 +1,85 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Key = void 0; +const util_1 = __importDefault(require("util")); +const error_1 = require("./error"); +const utils_1 = require("./utils"); +const key_1 = require("./utils/key"); +// A container class representing the public portion of a Key. +class Key { + constructor(options) { + const { keyID, keyType, scheme, keyVal, unrecognizedFields } = options; + this.keyID = keyID; + this.keyType = keyType; + this.scheme = scheme; + this.keyVal = keyVal; + this.unrecognizedFields = unrecognizedFields || {}; + } + // Verifies the that the metadata.signatures contains a signature made with + // this key and is correctly signed. + verifySignature(metadata) { + const signature = metadata.signatures[this.keyID]; + if (!signature) + throw new error_1.UnsignedMetadataError('no signature for key found in metadata'); + if (!this.keyVal.public) + throw new error_1.UnsignedMetadataError('no public key found'); + const publicKey = (0, key_1.getPublicKey)({ + keyType: this.keyType, + scheme: this.scheme, + keyVal: this.keyVal.public, + }); + const signedData = metadata.signed.toJSON(); + try { + if (!utils_1.crypto.verifySignature(signedData, publicKey, signature.sig)) { + throw new error_1.UnsignedMetadataError(`failed to verify ${this.keyID} signature`); + } + } + catch (error) { + if (error instanceof error_1.UnsignedMetadataError) { + throw error; + } + throw new error_1.UnsignedMetadataError(`failed to verify ${this.keyID} signature`); + } + } + equals(other) { + if (!(other instanceof Key)) { + return false; + } + return (this.keyID === other.keyID && + this.keyType === other.keyType && + this.scheme === other.scheme && + util_1.default.isDeepStrictEqual(this.keyVal, other.keyVal) && + util_1.default.isDeepStrictEqual(this.unrecognizedFields, other.unrecognizedFields)); + } + toJSON() { + return { + keytype: this.keyType, + scheme: this.scheme, + keyval: this.keyVal, + ...this.unrecognizedFields, + }; + } + static fromJSON(keyID, data) { + const { keytype, scheme, keyval, ...rest } = data; + if (typeof keytype !== 'string') { + throw new TypeError('keytype must be a string'); + } + if (typeof scheme !== 'string') { + throw new TypeError('scheme must be a string'); + } + if (!utils_1.guard.isStringRecord(keyval)) { + throw new TypeError('keyval must be a string record'); + } + return new Key({ + keyID, + keyType: keytype, + scheme, + keyVal: keyval, + unrecognizedFields: rest, + }); + } +} +exports.Key = Key; diff --git a/deps/npm/node_modules/tuf-js/dist/models/metadata.js b/deps/npm/node_modules/@tufjs/models/dist/metadata.js similarity index 82% rename from deps/npm/node_modules/tuf-js/dist/models/metadata.js rename to deps/npm/node_modules/@tufjs/models/dist/metadata.js index 11c3c546822acc..945d3a42a7cfb2 100644 --- a/deps/npm/node_modules/tuf-js/dist/models/metadata.js +++ b/deps/npm/node_modules/@tufjs/models/dist/metadata.js @@ -5,14 +5,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) { Object.defineProperty(exports, "__esModule", { value: true }); exports.Metadata = void 0; const util_1 = __importDefault(require("util")); -const error_1 = require("../error"); -const guard_1 = require("../utils/guard"); -const types_1 = require("../utils/types"); +const base_1 = require("./base"); +const error_1 = require("./error"); const root_1 = require("./root"); const signature_1 = require("./signature"); const snapshot_1 = require("./snapshot"); const targets_1 = require("./targets"); const timestamp_1 = require("./timestamp"); +const utils_1 = require("./utils"); +const json_1 = require("./utils/json"); /*** * A container for signed TUF metadata. * @@ -43,15 +44,23 @@ class Metadata { this.signatures = signatures || {}; this.unrecognizedFields = unrecognizedFields || {}; } + sign(signer, append = true) { + const bytes = (0, json_1.canonicalize)(this.signed.toJSON()); + const signature = signer(bytes); + if (!append) { + this.signatures = {}; + } + this.signatures[signature.keyID] = signature; + } verifyDelegate(delegatedRole, delegatedMetadata) { let role; let keys = {}; switch (this.signed.type) { - case types_1.MetadataKind.Root: + case base_1.MetadataKind.Root: keys = this.signed.keys; role = this.signed.roles[delegatedRole]; break; - case types_1.MetadataKind.Targets: + case base_1.MetadataKind.Targets: if (!this.signed.delegations) { throw new error_1.ValueError(`No delegations found for ${delegatedRole}`); } @@ -98,9 +107,19 @@ class Metadata { util_1.default.isDeepStrictEqual(this.signatures, other.signatures) && util_1.default.isDeepStrictEqual(this.unrecognizedFields, other.unrecognizedFields)); } + toJSON() { + const signatures = Object.values(this.signatures).map((signature) => { + return signature.toJSON(); + }); + return { + signatures, + signed: this.signed.toJSON(), + ...this.unrecognizedFields, + }; + } static fromJSON(type, data) { const { signed, signatures, ...rest } = data; - if (!(0, guard_1.isDefined)(signed) || !(0, guard_1.isObject)(signed)) { + if (!utils_1.guard.isDefined(signed) || !utils_1.guard.isObject(signed)) { throw new TypeError('signed is not defined'); } if (type !== signed._type) { @@ -108,16 +127,16 @@ class Metadata { } let signedObj; switch (type) { - case types_1.MetadataKind.Root: + case base_1.MetadataKind.Root: signedObj = root_1.Root.fromJSON(signed); break; - case types_1.MetadataKind.Timestamp: + case base_1.MetadataKind.Timestamp: signedObj = timestamp_1.Timestamp.fromJSON(signed); break; - case types_1.MetadataKind.Snapshot: + case base_1.MetadataKind.Snapshot: signedObj = snapshot_1.Snapshot.fromJSON(signed); break; - case types_1.MetadataKind.Targets: + case base_1.MetadataKind.Targets: signedObj = targets_1.Targets.fromJSON(signed); break; default: @@ -129,7 +148,7 @@ class Metadata { } exports.Metadata = Metadata; function signaturesFromJSON(data) { - if (!(0, guard_1.isObjectArray)(data)) { + if (!utils_1.guard.isObjectArray(data)) { throw new TypeError('signatures is not an array'); } return data.reduce((acc, sigData) => { diff --git a/deps/npm/node_modules/tuf-js/dist/models/role.js b/deps/npm/node_modules/@tufjs/models/dist/role.js similarity index 96% rename from deps/npm/node_modules/tuf-js/dist/models/role.js rename to deps/npm/node_modules/@tufjs/models/dist/role.js index da80a09b8b09f6..143c5dc6089665 100644 --- a/deps/npm/node_modules/tuf-js/dist/models/role.js +++ b/deps/npm/node_modules/@tufjs/models/dist/role.js @@ -7,8 +7,8 @@ exports.SuccinctRoles = exports.DelegatedRole = exports.Role = exports.TOP_LEVEL const crypto_1 = __importDefault(require("crypto")); const minimatch_1 = __importDefault(require("minimatch")); const util_1 = __importDefault(require("util")); -const error_1 = require("../error"); -const guard_1 = require("../utils/guard"); +const error_1 = require("./error"); +const utils_1 = require("./utils"); exports.TOP_LEVEL_ROLE_NAMES = [ 'root', 'targets', @@ -51,7 +51,7 @@ class Role { } static fromJSON(data) { const { keyids, threshold, ...rest } = data; - if (!(0, guard_1.isStringArray)(keyids)) { + if (!utils_1.guard.isStringArray(keyids)) { throw new TypeError('keyids must be an array'); } if (typeof threshold !== 'number') { @@ -128,7 +128,7 @@ class DelegatedRole extends Role { } static fromJSON(data) { const { keyids, threshold, name, terminating, paths, path_hash_prefixes, ...rest } = data; - if (!(0, guard_1.isStringArray)(keyids)) { + if (!utils_1.guard.isStringArray(keyids)) { throw new TypeError('keyids must be an array of strings'); } if (typeof threshold !== 'number') { @@ -140,10 +140,11 @@ class DelegatedRole extends Role { if (typeof terminating !== 'boolean') { throw new TypeError('terminating must be a boolean'); } - if ((0, guard_1.isDefined)(paths) && !(0, guard_1.isStringArray)(paths)) { + if (utils_1.guard.isDefined(paths) && !utils_1.guard.isStringArray(paths)) { throw new TypeError('paths must be an array of strings'); } - if ((0, guard_1.isDefined)(path_hash_prefixes) && !(0, guard_1.isStringArray)(path_hash_prefixes)) { + if (utils_1.guard.isDefined(path_hash_prefixes) && + !utils_1.guard.isStringArray(path_hash_prefixes)) { throw new TypeError('path_hash_prefixes must be an array of strings'); } return new DelegatedRole({ @@ -274,7 +275,7 @@ class SuccinctRoles extends Role { } static fromJSON(data) { const { keyids, threshold, bit_length, name_prefix, ...rest } = data; - if (!(0, guard_1.isStringArray)(keyids)) { + if (!utils_1.guard.isStringArray(keyids)) { throw new TypeError('keyids must be an array of strings'); } if (typeof threshold !== 'number') { diff --git a/deps/npm/node_modules/tuf-js/dist/models/root.js b/deps/npm/node_modules/@tufjs/models/dist/root.js similarity index 84% rename from deps/npm/node_modules/tuf-js/dist/models/root.js rename to deps/npm/node_modules/@tufjs/models/dist/root.js index 574ec1acdcc39d..36d0ef0f186d15 100644 --- a/deps/npm/node_modules/tuf-js/dist/models/root.js +++ b/deps/npm/node_modules/@tufjs/models/dist/root.js @@ -5,12 +5,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) { Object.defineProperty(exports, "__esModule", { value: true }); exports.Root = void 0; const util_1 = __importDefault(require("util")); -const error_1 = require("../error"); -const guard_1 = require("../utils/guard"); -const types_1 = require("../utils/types"); const base_1 = require("./base"); +const error_1 = require("./error"); const key_1 = require("./key"); const role_1 = require("./role"); +const utils_1 = require("./utils"); /** * A container for the signed part of root metadata. * @@ -20,7 +19,7 @@ const role_1 = require("./role"); class Root extends base_1.Signed { constructor(options) { super(options); - this.type = types_1.MetadataKind.Root; + this.type = base_1.MetadataKind.Root; this.keys = options.keys || {}; this.consistentSnapshot = options.consistentSnapshot ?? true; if (!options.roles) { @@ -37,6 +36,15 @@ class Root extends base_1.Signed { this.roles = options.roles; } } + addKey(key, role) { + if (!this.roles[role]) { + throw new error_1.ValueError(`role ${role} does not exist`); + } + if (!this.roles[role].keyIDs.includes(key.keyID)) { + this.roles[role].keyIDs.push(key.keyID); + } + this.keys[key.keyID] = key; + } equals(other) { if (!(other instanceof Root)) { return false; @@ -48,6 +56,7 @@ class Root extends base_1.Signed { } toJSON() { return { + _type: this.type, spec_version: this.specVersion, version: this.version, expires: this.expires, @@ -81,8 +90,8 @@ function rolesToJSON(roles) { } function keysFromJSON(data) { let keys; - if ((0, guard_1.isDefined)(data)) { - if (!(0, guard_1.isObjectRecord)(data)) { + if (utils_1.guard.isDefined(data)) { + if (!utils_1.guard.isObjectRecord(data)) { throw new TypeError('keys must be an object'); } keys = Object.entries(data).reduce((acc, [keyID, keyData]) => ({ @@ -94,8 +103,8 @@ function keysFromJSON(data) { } function rolesFromJSON(data) { let roles; - if ((0, guard_1.isDefined)(data)) { - if (!(0, guard_1.isObjectRecord)(data)) { + if (utils_1.guard.isDefined(data)) { + if (!utils_1.guard.isObjectRecord(data)) { throw new TypeError('roles must be an object'); } roles = Object.entries(data).reduce((acc, [roleName, roleData]) => ({ diff --git a/deps/npm/node_modules/tuf-js/dist/models/signature.js b/deps/npm/node_modules/@tufjs/models/dist/signature.js similarity index 89% rename from deps/npm/node_modules/tuf-js/dist/models/signature.js rename to deps/npm/node_modules/@tufjs/models/dist/signature.js index 9550fa7b551fc9..33eb204eb0835e 100644 --- a/deps/npm/node_modules/tuf-js/dist/models/signature.js +++ b/deps/npm/node_modules/@tufjs/models/dist/signature.js @@ -15,6 +15,12 @@ class Signature { this.keyID = keyID; this.sig = sig; } + toJSON() { + return { + keyid: this.keyID, + sig: this.sig, + }; + } static fromJSON(data) { const { keyid, sig } = data; if (typeof keyid !== 'string') { diff --git a/deps/npm/node_modules/tuf-js/dist/models/snapshot.js b/deps/npm/node_modules/@tufjs/models/dist/snapshot.js similarity index 89% rename from deps/npm/node_modules/tuf-js/dist/models/snapshot.js rename to deps/npm/node_modules/@tufjs/models/dist/snapshot.js index 0945a28cd03cc9..e90ea8e729e4e8 100644 --- a/deps/npm/node_modules/tuf-js/dist/models/snapshot.js +++ b/deps/npm/node_modules/@tufjs/models/dist/snapshot.js @@ -5,10 +5,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) { Object.defineProperty(exports, "__esModule", { value: true }); exports.Snapshot = void 0; const util_1 = __importDefault(require("util")); -const guard_1 = require("../utils/guard"); -const types_1 = require("../utils/types"); const base_1 = require("./base"); const file_1 = require("./file"); +const utils_1 = require("./utils"); /** * A container for the signed part of snapshot metadata. * @@ -19,7 +18,7 @@ const file_1 = require("./file"); class Snapshot extends base_1.Signed { constructor(opts) { super(opts); - this.type = types_1.MetadataKind.Snapshot; + this.type = base_1.MetadataKind.Snapshot; this.meta = opts.meta || { 'targets.json': new file_1.MetaFile({ version: 1 }) }; } equals(other) { @@ -30,6 +29,7 @@ class Snapshot extends base_1.Signed { } toJSON() { return { + _type: this.type, meta: metaToJSON(this.meta), spec_version: this.specVersion, version: this.version, @@ -56,8 +56,8 @@ function metaToJSON(meta) { } function metaFromJSON(data) { let meta; - if ((0, guard_1.isDefined)(data)) { - if (!(0, guard_1.isObjectRecord)(data)) { + if (utils_1.guard.isDefined(data)) { + if (!utils_1.guard.isObjectRecord(data)) { throw new TypeError('meta field is malformed'); } else { @@ -66,6 +66,6 @@ function metaFromJSON(data) { [path]: file_1.MetaFile.fromJSON(metadata), }), {}); } - return meta; } + return meta; } diff --git a/deps/npm/node_modules/tuf-js/dist/models/targets.js b/deps/npm/node_modules/@tufjs/models/dist/targets.js similarity index 88% rename from deps/npm/node_modules/tuf-js/dist/models/targets.js rename to deps/npm/node_modules/@tufjs/models/dist/targets.js index 90a2528764708e..54bd8f8c554af5 100644 --- a/deps/npm/node_modules/tuf-js/dist/models/targets.js +++ b/deps/npm/node_modules/@tufjs/models/dist/targets.js @@ -5,11 +5,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) { Object.defineProperty(exports, "__esModule", { value: true }); exports.Targets = void 0; const util_1 = __importDefault(require("util")); -const guard_1 = require("../utils/guard"); -const types_1 = require("../utils/types"); const base_1 = require("./base"); const delegations_1 = require("./delegations"); const file_1 = require("./file"); +const utils_1 = require("./utils"); // Container for the signed part of targets metadata. // // Targets contains verifying information about target files and also delegates @@ -17,10 +16,13 @@ const file_1 = require("./file"); class Targets extends base_1.Signed { constructor(options) { super(options); - this.type = types_1.MetadataKind.Targets; + this.type = base_1.MetadataKind.Targets; this.targets = options.targets || {}; this.delegations = options.delegations; } + addTarget(target) { + this.targets[target.path] = target; + } equals(other) { if (!(other instanceof Targets)) { return false; @@ -31,6 +33,7 @@ class Targets extends base_1.Signed { } toJSON() { const json = { + _type: this.type, spec_version: this.specVersion, version: this.version, expires: this.expires, @@ -62,8 +65,8 @@ function targetsToJSON(targets) { } function targetsFromJSON(data) { let targets; - if ((0, guard_1.isDefined)(data)) { - if (!(0, guard_1.isObjectRecord)(data)) { + if (utils_1.guard.isDefined(data)) { + if (!utils_1.guard.isObjectRecord(data)) { throw new TypeError('targets must be an object'); } else { @@ -77,8 +80,8 @@ function targetsFromJSON(data) { } function delegationsFromJSON(data) { let delegations; - if ((0, guard_1.isDefined)(data)) { - if (!(0, guard_1.isObject)(data)) { + if (utils_1.guard.isDefined(data)) { + if (!utils_1.guard.isObject(data)) { throw new TypeError('delegations must be an object'); } else { diff --git a/deps/npm/node_modules/tuf-js/dist/models/timestamp.js b/deps/npm/node_modules/@tufjs/models/dist/timestamp.js similarity index 86% rename from deps/npm/node_modules/tuf-js/dist/models/timestamp.js rename to deps/npm/node_modules/@tufjs/models/dist/timestamp.js index 84f681b68d16a3..9880c4c9fc2549 100644 --- a/deps/npm/node_modules/tuf-js/dist/models/timestamp.js +++ b/deps/npm/node_modules/@tufjs/models/dist/timestamp.js @@ -1,10 +1,9 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Timestamp = void 0; -const guard_1 = require("../utils/guard"); -const types_1 = require("../utils/types"); const base_1 = require("./base"); const file_1 = require("./file"); +const utils_1 = require("./utils"); /** * A container for the signed part of timestamp metadata. * @@ -14,7 +13,7 @@ const file_1 = require("./file"); class Timestamp extends base_1.Signed { constructor(options) { super(options); - this.type = types_1.MetadataKind.Timestamp; + this.type = base_1.MetadataKind.Timestamp; this.snapshotMeta = options.snapshotMeta || new file_1.MetaFile({ version: 1 }); } equals(other) { @@ -25,6 +24,7 @@ class Timestamp extends base_1.Signed { } toJSON() { return { + _type: this.type, spec_version: this.specVersion, version: this.version, expires: this.expires, @@ -45,9 +45,9 @@ class Timestamp extends base_1.Signed { exports.Timestamp = Timestamp; function snapshotMetaFromJSON(data) { let snapshotMeta; - if ((0, guard_1.isDefined)(data)) { + if (utils_1.guard.isDefined(data)) { const snapshotData = data['snapshot.json']; - if (!(0, guard_1.isDefined)(snapshotData) || !(0, guard_1.isObject)(snapshotData)) { + if (!utils_1.guard.isDefined(snapshotData) || !utils_1.guard.isObject(snapshotData)) { throw new TypeError('missing snapshot.json in meta'); } else { diff --git a/deps/npm/node_modules/@tufjs/models/dist/utils/guard.js b/deps/npm/node_modules/@tufjs/models/dist/utils/guard.js new file mode 100644 index 00000000000000..efe558852303ce --- /dev/null +++ b/deps/npm/node_modules/@tufjs/models/dist/utils/guard.js @@ -0,0 +1,33 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isObjectRecord = exports.isStringRecord = exports.isObjectArray = exports.isStringArray = exports.isObject = exports.isDefined = void 0; +function isDefined(val) { + return val !== undefined; +} +exports.isDefined = isDefined; +function isObject(value) { + return typeof value === 'object' && value !== null; +} +exports.isObject = isObject; +function isStringArray(value) { + return Array.isArray(value) && value.every((v) => typeof v === 'string'); +} +exports.isStringArray = isStringArray; +function isObjectArray(value) { + return Array.isArray(value) && value.every(isObject); +} +exports.isObjectArray = isObjectArray; +function isStringRecord(value) { + return (typeof value === 'object' && + value !== null && + Object.keys(value).every((k) => typeof k === 'string') && + Object.values(value).every((v) => typeof v === 'string')); +} +exports.isStringRecord = isStringRecord; +function isObjectRecord(value) { + return (typeof value === 'object' && + value !== null && + Object.keys(value).every((k) => typeof k === 'string') && + Object.values(value).every((v) => typeof v === 'object' && v !== null)); +} +exports.isObjectRecord = isObjectRecord; diff --git a/deps/npm/node_modules/@tufjs/models/dist/utils/index.js b/deps/npm/node_modules/@tufjs/models/dist/utils/index.js new file mode 100644 index 00000000000000..872aae28049c9c --- /dev/null +++ b/deps/npm/node_modules/@tufjs/models/dist/utils/index.js @@ -0,0 +1,28 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.crypto = exports.guard = void 0; +exports.guard = __importStar(require("./guard")); +exports.crypto = __importStar(require("./verify")); diff --git a/deps/npm/node_modules/tuf-js/dist/utils/json.js b/deps/npm/node_modules/@tufjs/models/dist/utils/json.js similarity index 100% rename from deps/npm/node_modules/tuf-js/dist/utils/json.js rename to deps/npm/node_modules/@tufjs/models/dist/utils/json.js diff --git a/deps/npm/node_modules/tuf-js/dist/utils/key.js b/deps/npm/node_modules/@tufjs/models/dist/utils/key.js similarity index 100% rename from deps/npm/node_modules/tuf-js/dist/utils/key.js rename to deps/npm/node_modules/@tufjs/models/dist/utils/key.js diff --git a/deps/npm/node_modules/tuf-js/dist/utils/oid.js b/deps/npm/node_modules/@tufjs/models/dist/utils/oid.js similarity index 100% rename from deps/npm/node_modules/tuf-js/dist/utils/oid.js rename to deps/npm/node_modules/@tufjs/models/dist/utils/oid.js diff --git a/deps/npm/node_modules/@tufjs/models/dist/utils/types.js b/deps/npm/node_modules/@tufjs/models/dist/utils/types.js new file mode 100644 index 00000000000000..c8ad2e549bdc68 --- /dev/null +++ b/deps/npm/node_modules/@tufjs/models/dist/utils/types.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/deps/npm/node_modules/tuf-js/dist/utils/signer.js b/deps/npm/node_modules/@tufjs/models/dist/utils/verify.js similarity index 100% rename from deps/npm/node_modules/tuf-js/dist/utils/signer.js rename to deps/npm/node_modules/@tufjs/models/dist/utils/verify.js diff --git a/deps/npm/node_modules/@tufjs/models/package.json b/deps/npm/node_modules/@tufjs/models/package.json new file mode 100644 index 00000000000000..d8b2a189a1425c --- /dev/null +++ b/deps/npm/node_modules/@tufjs/models/package.json @@ -0,0 +1,41 @@ +{ + "name": "@tufjs/models", + "version": "1.0.1", + "description": "TUF metadata models", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "files": [ + "dist" + ], + "scripts": { + "build": "tsc --build", + "clean": "rm -rf dist && rm tsconfig.tsbuildinfo", + "test": "jest" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/theupdateframework/tuf-js.git" + }, + "keywords": [ + "tuf", + "security", + "update" + ], + "author": "bdehamer@github.com", + "license": "MIT", + "bugs": { + "url": "https://github.com/theupdateframework/tuf-js/issues" + }, + "homepage": "https://github.com/theupdateframework/tuf-js/tree/main/packages/models#readme", + "devDependencies": { + "@types/minimatch": "^5.1.2", + "@types/node": "^18.15.3", + "typescript": "^4.9.5" + }, + "dependencies": { + "minimatch": "^7.4.2" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } +} diff --git a/deps/npm/node_modules/abort-controller/dist/abort-controller.d.ts b/deps/npm/node_modules/abort-controller/dist/abort-controller.d.ts deleted file mode 100644 index 75852fb59952de..00000000000000 --- a/deps/npm/node_modules/abort-controller/dist/abort-controller.d.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { EventTarget } from "event-target-shim" - -type Events = { - abort: any -} -type EventAttributes = { - onabort: any -} -/** - * The signal class. - * @see https://dom.spec.whatwg.org/#abortsignal - */ -declare class AbortSignal extends EventTarget { - /** - * AbortSignal cannot be constructed directly. - */ - constructor() - /** - * Returns `true` if this `AbortSignal`"s `AbortController` has signaled to abort, and `false` otherwise. - */ - readonly aborted: boolean -} -/** - * The AbortController. - * @see https://dom.spec.whatwg.org/#abortcontroller - */ -declare class AbortController { - /** - * Initialize this controller. - */ - constructor() - /** - * Returns the `AbortSignal` object associated with this object. - */ - readonly signal: AbortSignal - /** - * Abort and signal to any observers that the associated activity is to be aborted. - */ - abort(): void -} - -export default AbortController -export { AbortController, AbortSignal } diff --git a/deps/npm/node_modules/abort-controller/dist/abort-controller.js.map b/deps/npm/node_modules/abort-controller/dist/abort-controller.js.map deleted file mode 100644 index cfdcafdc61167b..00000000000000 --- a/deps/npm/node_modules/abort-controller/dist/abort-controller.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"abort-controller.js","sources":["../src/abort-signal.ts","../src/abort-controller.ts"],"sourcesContent":["import {\n // Event,\n EventTarget,\n // Type,\n defineEventAttribute,\n} from \"event-target-shim\"\n\n// Known Limitation\n// Use `any` because the type of `AbortSignal` in `lib.dom.d.ts` is wrong and\n// to make assignable our `AbortSignal` into that.\n// https://github.com/Microsoft/TSJS-lib-generator/pull/623\ntype Events = {\n abort: any // Event & Type<\"abort\">\n}\ntype EventAttributes = {\n onabort: any // Event & Type<\"abort\">\n}\n\n/**\n * The signal class.\n * @see https://dom.spec.whatwg.org/#abortsignal\n */\nexport default class AbortSignal extends EventTarget {\n /**\n * AbortSignal cannot be constructed directly.\n */\n public constructor() {\n super()\n throw new TypeError(\"AbortSignal cannot be constructed directly\")\n }\n\n /**\n * Returns `true` if this `AbortSignal`'s `AbortController` has signaled to abort, and `false` otherwise.\n */\n public get aborted(): boolean {\n const aborted = abortedFlags.get(this)\n if (typeof aborted !== \"boolean\") {\n throw new TypeError(\n `Expected 'this' to be an 'AbortSignal' object, but got ${\n this === null ? \"null\" : typeof this\n }`,\n )\n }\n return aborted\n }\n}\ndefineEventAttribute(AbortSignal.prototype, \"abort\")\n\n/**\n * Create an AbortSignal object.\n */\nexport function createAbortSignal(): AbortSignal {\n const signal = Object.create(AbortSignal.prototype)\n EventTarget.call(signal)\n abortedFlags.set(signal, false)\n return signal\n}\n\n/**\n * Abort a given signal.\n */\nexport function abortSignal(signal: AbortSignal): void {\n if (abortedFlags.get(signal) !== false) {\n return\n }\n\n abortedFlags.set(signal, true)\n signal.dispatchEvent<\"abort\">({ type: \"abort\" })\n}\n\n/**\n * Aborted flag for each instances.\n */\nconst abortedFlags = new WeakMap()\n\n// Properties should be enumerable.\nObject.defineProperties(AbortSignal.prototype, {\n aborted: { enumerable: true },\n})\n\n// `toString()` should return `\"[object AbortSignal]\"`\nif (typeof Symbol === \"function\" && typeof Symbol.toStringTag === \"symbol\") {\n Object.defineProperty(AbortSignal.prototype, Symbol.toStringTag, {\n configurable: true,\n value: \"AbortSignal\",\n })\n}\n","import AbortSignal, { abortSignal, createAbortSignal } from \"./abort-signal\"\n\n/**\n * The AbortController.\n * @see https://dom.spec.whatwg.org/#abortcontroller\n */\nexport default class AbortController {\n /**\n * Initialize this controller.\n */\n public constructor() {\n signals.set(this, createAbortSignal())\n }\n\n /**\n * Returns the `AbortSignal` object associated with this object.\n */\n public get signal(): AbortSignal {\n return getSignal(this)\n }\n\n /**\n * Abort and signal to any observers that the associated activity is to be aborted.\n */\n public abort(): void {\n abortSignal(getSignal(this))\n }\n}\n\n/**\n * Associated signals.\n */\nconst signals = new WeakMap()\n\n/**\n * Get the associated signal of a given controller.\n */\nfunction getSignal(controller: AbortController): AbortSignal {\n const signal = signals.get(controller)\n if (signal == null) {\n throw new TypeError(\n `Expected 'this' to be an 'AbortController' object, but got ${\n controller === null ? \"null\" : typeof controller\n }`,\n )\n }\n return signal\n}\n\n// Properties should be enumerable.\nObject.defineProperties(AbortController.prototype, {\n signal: { enumerable: true },\n abort: { enumerable: true },\n})\n\nif (typeof Symbol === \"function\" && typeof Symbol.toStringTag === \"symbol\") {\n Object.defineProperty(AbortController.prototype, Symbol.toStringTag, {\n configurable: true,\n value: \"AbortController\",\n })\n}\n\nexport { AbortController, AbortSignal }\n"],"names":["EventTarget","defineEventAttribute"],"mappings":";;;;;;;;;;AAkBA;;;;AAIA,MAAqB,WAAY,SAAQA,2BAAoC;;;;IAIzE;QACI,KAAK,EAAE,CAAA;QACP,MAAM,IAAI,SAAS,CAAC,4CAA4C,CAAC,CAAA;KACpE;;;;IAKD,IAAW,OAAO;QACd,MAAM,OAAO,GAAG,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;QACtC,IAAI,OAAO,OAAO,KAAK,SAAS,EAAE;YAC9B,MAAM,IAAI,SAAS,CACf,0DACI,IAAI,KAAK,IAAI,GAAG,MAAM,GAAG,OAAO,IACpC,EAAE,CACL,CAAA;SACJ;QACD,OAAO,OAAO,CAAA;KACjB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,CAAC,CAAA;KAC/B;CACJ;;;;AAKD,MAAM,OAAO,GAAG,IAAI,OAAO,EAAgC,CAAA;;;;AAK3D,SAAS,SAAS,CAAC,UAA2B;IAC1C,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAA;IACtC,IAAI,MAAM,IAAI,IAAI,EAAE;QAChB,MAAM,IAAI,SAAS,CACf,8DACI,UAAU,KAAK,IAAI,GAAG,MAAM,GAAG,OAAO,UAC1C,EAAE,CACL,CAAA;KACJ;IACD,OAAO,MAAM,CAAA;CAChB;;AAGD,MAAM,CAAC,gBAAgB,CAAC,eAAe,CAAC,SAAS,EAAE;IAC/C,MAAM,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE;IAC5B,KAAK,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE;CAC9B,CAAC,CAAA;AAEF,IAAI,OAAO,MAAM,KAAK,UAAU,IAAI,OAAO,MAAM,CAAC,WAAW,KAAK,QAAQ,EAAE;IACxE,MAAM,CAAC,cAAc,CAAC,eAAe,CAAC,SAAS,EAAE,MAAM,CAAC,WAAW,EAAE;QACjE,YAAY,EAAE,IAAI;QAClB,KAAK,EAAE,iBAAiB;KAC3B,CAAC,CAAA;CACL;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/deps/npm/node_modules/abort-controller/dist/abort-controller.mjs.map b/deps/npm/node_modules/abort-controller/dist/abort-controller.mjs.map deleted file mode 100644 index 1e8fa6b00f6eff..00000000000000 --- a/deps/npm/node_modules/abort-controller/dist/abort-controller.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"abort-controller.mjs","sources":["../src/abort-signal.ts","../src/abort-controller.ts"],"sourcesContent":["import {\n // Event,\n EventTarget,\n // Type,\n defineEventAttribute,\n} from \"event-target-shim\"\n\n// Known Limitation\n// Use `any` because the type of `AbortSignal` in `lib.dom.d.ts` is wrong and\n// to make assignable our `AbortSignal` into that.\n// https://github.com/Microsoft/TSJS-lib-generator/pull/623\ntype Events = {\n abort: any // Event & Type<\"abort\">\n}\ntype EventAttributes = {\n onabort: any // Event & Type<\"abort\">\n}\n\n/**\n * The signal class.\n * @see https://dom.spec.whatwg.org/#abortsignal\n */\nexport default class AbortSignal extends EventTarget {\n /**\n * AbortSignal cannot be constructed directly.\n */\n public constructor() {\n super()\n throw new TypeError(\"AbortSignal cannot be constructed directly\")\n }\n\n /**\n * Returns `true` if this `AbortSignal`'s `AbortController` has signaled to abort, and `false` otherwise.\n */\n public get aborted(): boolean {\n const aborted = abortedFlags.get(this)\n if (typeof aborted !== \"boolean\") {\n throw new TypeError(\n `Expected 'this' to be an 'AbortSignal' object, but got ${\n this === null ? \"null\" : typeof this\n }`,\n )\n }\n return aborted\n }\n}\ndefineEventAttribute(AbortSignal.prototype, \"abort\")\n\n/**\n * Create an AbortSignal object.\n */\nexport function createAbortSignal(): AbortSignal {\n const signal = Object.create(AbortSignal.prototype)\n EventTarget.call(signal)\n abortedFlags.set(signal, false)\n return signal\n}\n\n/**\n * Abort a given signal.\n */\nexport function abortSignal(signal: AbortSignal): void {\n if (abortedFlags.get(signal) !== false) {\n return\n }\n\n abortedFlags.set(signal, true)\n signal.dispatchEvent<\"abort\">({ type: \"abort\" })\n}\n\n/**\n * Aborted flag for each instances.\n */\nconst abortedFlags = new WeakMap()\n\n// Properties should be enumerable.\nObject.defineProperties(AbortSignal.prototype, {\n aborted: { enumerable: true },\n})\n\n// `toString()` should return `\"[object AbortSignal]\"`\nif (typeof Symbol === \"function\" && typeof Symbol.toStringTag === \"symbol\") {\n Object.defineProperty(AbortSignal.prototype, Symbol.toStringTag, {\n configurable: true,\n value: \"AbortSignal\",\n })\n}\n","import AbortSignal, { abortSignal, createAbortSignal } from \"./abort-signal\"\n\n/**\n * The AbortController.\n * @see https://dom.spec.whatwg.org/#abortcontroller\n */\nexport default class AbortController {\n /**\n * Initialize this controller.\n */\n public constructor() {\n signals.set(this, createAbortSignal())\n }\n\n /**\n * Returns the `AbortSignal` object associated with this object.\n */\n public get signal(): AbortSignal {\n return getSignal(this)\n }\n\n /**\n * Abort and signal to any observers that the associated activity is to be aborted.\n */\n public abort(): void {\n abortSignal(getSignal(this))\n }\n}\n\n/**\n * Associated signals.\n */\nconst signals = new WeakMap()\n\n/**\n * Get the associated signal of a given controller.\n */\nfunction getSignal(controller: AbortController): AbortSignal {\n const signal = signals.get(controller)\n if (signal == null) {\n throw new TypeError(\n `Expected 'this' to be an 'AbortController' object, but got ${\n controller === null ? \"null\" : typeof controller\n }`,\n )\n }\n return signal\n}\n\n// Properties should be enumerable.\nObject.defineProperties(AbortController.prototype, {\n signal: { enumerable: true },\n abort: { enumerable: true },\n})\n\nif (typeof Symbol === \"function\" && typeof Symbol.toStringTag === \"symbol\") {\n Object.defineProperty(AbortController.prototype, Symbol.toStringTag, {\n configurable: true,\n value: \"AbortController\",\n })\n}\n\nexport { AbortController, AbortSignal }\n"],"names":[],"mappings":";;;;;;AAkBA;;;;AAIA,MAAqB,WAAY,SAAQ,WAAoC;;;;IAIzE;QACI,KAAK,EAAE,CAAA;QACP,MAAM,IAAI,SAAS,CAAC,4CAA4C,CAAC,CAAA;KACpE;;;;IAKD,IAAW,OAAO;QACd,MAAM,OAAO,GAAG,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;QACtC,IAAI,OAAO,OAAO,KAAK,SAAS,EAAE;YAC9B,MAAM,IAAI,SAAS,CACf,0DACI,IAAI,KAAK,IAAI,GAAG,MAAM,GAAG,OAAO,IACpC,EAAE,CACL,CAAA;SACJ;QACD,OAAO,OAAO,CAAA;KACjB;CACJ;AACD,oBAAoB,CAAC,WAAW,CAAC,SAAS,EAAE,OAAO,CAAC,CAAA;;;;AAKpD,SAAgB,iBAAiB;IAC7B,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,CAAA;IACnD,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IACxB,YAAY,CAAC,GAAG,CAAC,MA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,KAAK,IAAI,GAAG,MAAM,GAAG,OAAO,UAC1C,EAAE,CACL,CAAA;KACJ;IACD,OAAO,MAAM,CAAA;CAChB;;AAGD,MAAM,CAAC,gBAAgB,CAAC,eAAe,CAAC,SAAS,EAAE;IAC/C,MAAM,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE;IAC5B,KAAK,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE;CAC9B,CAAC,CAAA;AAEF,IAAI,OAAO,MAAM,KAAK,UAAU,IAAI,OAAO,MAAM,CAAC,WAAW,KAAK,QAAQ,EAAE;IACxE,MAAM,CAAC,cAAc,CAAC,eAAe,CAAC,SAAS,EAAE,MAAM,CAAC,WAAW,EAAE;QACjE,YAAY,EAAE,IAAI;QAClB,KAAK,EAAE,iBAAiB;KAC3B,CAAC,CAAA;CACL;;;;;"} \ No newline at end of file diff --git a/deps/npm/node_modules/abort-controller/dist/abort-controller.umd.js.map b/deps/npm/node_modules/abort-controller/dist/abort-controller.umd.js.map deleted file mode 100644 index 875ab0283d6ae8..00000000000000 --- a/deps/npm/node_modules/abort-controller/dist/abort-controller.umd.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"abort-controller.umd.js","sources":["../node_modules/event-target-shim/dist/event-target-shim.mjs","../src/abort-signal.ts","../src/abort-controller.ts"],"sourcesContent":["/**\n * @author Toru Nagashima \n * @copyright 2015 Toru Nagashima. All rights reserved.\n * See LICENSE file in root directory for full license.\n */\n/**\n * @typedef {object} PrivateData\n * @property {EventTarget} eventTarget The event target.\n * @property {{type:string}} event The original event object.\n * @property {number} eventPhase The current event phase.\n * @property {EventTarget|null} currentTarget The current event target.\n * @property {boolean} canceled The flag to prevent default.\n * @property {boolean} stopped The flag to stop propagation.\n * @property {boolean} immediateStopped The flag to stop propagation immediately.\n * @property {Function|null} passiveListener The listener if the current listener is passive. Otherwise this is null.\n * @property {number} timeStamp The unix time.\n * @private\n */\n\n/**\n * Private data for event wrappers.\n * @type {WeakMap}\n * @private\n */\nconst privateData = new WeakMap();\n\n/**\n * Cache for wrapper classes.\n * @type {WeakMap}\n * @private\n */\nconst wrappers = new WeakMap();\n\n/**\n * Get private data.\n * @param {Event} event The event object to get private data.\n * @returns {PrivateData} The private data of the event.\n * @private\n */\nfunction pd(event) {\n const retv = privateData.get(event);\n console.assert(\n retv != null,\n \"'this' is expected an Event object, but got\",\n event\n );\n return retv\n}\n\n/**\n * https://dom.spec.whatwg.org/#set-the-canceled-flag\n * @param data {PrivateData} private data.\n */\nfunction setCancelFlag(data) {\n if (data.passiveListener != null) {\n if (\n typeof console !== \"undefined\" &&\n typeof console.error === \"function\"\n ) {\n console.error(\n \"Unable to preventDefault inside passive event listener invocation.\",\n data.passiveListener\n );\n }\n return\n }\n if (!data.event.cancelable) {\n return\n }\n\n data.canceled = true;\n if (typeof data.event.preventDefault === \"function\") {\n data.event.preventDefault();\n }\n}\n\n/**\n * @see https://dom.spec.whatwg.org/#interface-event\n * @private\n */\n/**\n * The event wrapper.\n * @constructor\n * @param {EventTarget} eventTarget The event target of this dispatching.\n * @param {Event|{type:string}} event The original event to wrap.\n */\nfunction Event(eventTarget, event) {\n privateData.set(this, {\n eventTarget,\n event,\n eventPhase: 2,\n currentTarget: eventTarget,\n canceled: false,\n stopped: false,\n immediateStopped: false,\n passiveListener: null,\n timeStamp: event.timeStamp || Date.now(),\n });\n\n // https://heycam.github.io/webidl/#Unforgeable\n Object.defineProperty(this, \"isTrusted\", { value: false, enumerable: true });\n\n // Define accessors\n const keys = Object.keys(event);\n for (let i = 0; i < keys.length; ++i) {\n const key = keys[i];\n if (!(key in this)) {\n Object.defineProperty(this, key, defineRedirectDescriptor(key));\n }\n }\n}\n\n// Should be enumerable, but class methods are not enumerable.\nEvent.prototype = {\n /**\n * The type of this event.\n * @type {string}\n */\n get type() {\n return pd(this).event.type\n },\n\n /**\n * The target of this event.\n * @type {EventTarget}\n */\n get target() {\n return pd(this).eventTarget\n },\n\n /**\n * The target of this event.\n * @type {EventTarget}\n */\n get currentTarget() {\n return pd(this).currentTarget\n },\n\n /**\n * @returns {EventTarget[]} The composed path of this event.\n */\n composedPath() {\n const currentTarget = pd(this).currentTarget;\n if (currentTarget == null) {\n return []\n }\n return [currentTarget]\n },\n\n /**\n * Constant of NONE.\n * @type {number}\n */\n get NONE() {\n return 0\n },\n\n /**\n * Constant of CAPTURING_PHASE.\n * @type {number}\n */\n get CAPTURING_PHASE() {\n return 1\n },\n\n /**\n * Constant of AT_TARGET.\n * @type {number}\n */\n get AT_TARGET() {\n return 2\n },\n\n /**\n * Constant of BUBBLING_PHASE.\n * @type {number}\n */\n get BUBBLING_PHASE() {\n return 3\n },\n\n /**\n * The target of this event.\n * @type {number}\n */\n get eventPhase() {\n return pd(this).eventPhase\n },\n\n /**\n * Stop event bubbling.\n * @returns {void}\n */\n stopPropagation() {\n const data = pd(this);\n\n data.stopped = true;\n if (typeof data.event.stopPropagation === \"function\") {\n data.event.stopPropagation();\n }\n },\n\n /**\n * Stop event bubbling.\n * @returns {void}\n */\n stopImmediatePropagation() {\n const data = pd(this);\n\n data.stopped = true;\n data.immediateStopped = true;\n if (typeof data.event.stopImmediatePropagation === \"function\") {\n data.event.stopImmediatePropagation();\n }\n },\n\n /**\n * The flag to be bubbling.\n * @type {boolean}\n */\n get bubbles() {\n return Boolean(pd(this).event.bubbles)\n },\n\n /**\n * The flag to be cancelable.\n * @type {boolean}\n */\n get cancelable() {\n return Boolean(pd(this).event.cancelable)\n },\n\n /**\n * Cancel this event.\n * @returns {void}\n */\n preventDefault() {\n setCancelFlag(pd(this));\n },\n\n /**\n * The flag to indicate cancellation state.\n * @type {boolean}\n */\n get defaultPrevented() {\n return pd(this).canceled\n },\n\n /**\n * The flag to be composed.\n * @type {boolean}\n */\n get composed() {\n return Boolean(pd(this).event.composed)\n },\n\n /**\n * The unix time of this event.\n * @type {number}\n */\n get timeStamp() {\n return pd(this).timeStamp\n },\n\n /**\n * The target of this event.\n * @type {EventTarget}\n * @deprecated\n */\n get srcElement() {\n return pd(this).eventTarget\n },\n\n /**\n * The flag to stop event bubbling.\n * @type {boolean}\n * @deprecated\n */\n get cancelBubble() {\n return pd(this).stopped\n },\n set cancelBubble(value) {\n if (!value) {\n return\n }\n const data = pd(this);\n\n data.stopped = true;\n if (typeof data.event.cancelBubble === \"boolean\") {\n data.event.cancelBubble = true;\n }\n },\n\n /**\n * The flag to indicate cancellation state.\n * @type {boolean}\n * @deprecated\n */\n get returnValue() {\n return !pd(this).canceled\n },\n set returnValue(value) {\n if (!value) {\n setCancelFlag(pd(this));\n }\n },\n\n /**\n * Initialize this event object. But do nothing under event dispatching.\n * @param {string} type The event type.\n * @param {boolean} [bubbles=false] The flag to be possible to bubble up.\n * @param {boolean} [cancelable=false] The flag to be possible to cancel.\n * @deprecated\n */\n initEvent() {\n // Do nothing.\n },\n};\n\n// `constructor` is not enumerable.\nObject.defineProperty(Event.prototype, \"constructor\", {\n value: Event,\n configurable: true,\n writable: true,\n});\n\n// Ensure `event instanceof window.Event` is `true`.\nif (typeof window !== \"undefined\" && typeof window.Event !== \"undefined\") {\n Object.setPrototypeOf(Event.prototype, window.Event.prototype);\n\n // Make association for wrappers.\n wrappers.set(window.Event.prototype, Event);\n}\n\n/**\n * Get the property descriptor to redirect a given property.\n * @param {string} key Property name to define property descriptor.\n * @returns {PropertyDescriptor} The property descriptor to redirect the property.\n * @private\n */\nfunction defineRedirectDescriptor(key) {\n return {\n get() {\n return pd(this).event[key]\n },\n set(value) {\n pd(this).event[key] = value;\n },\n configurable: true,\n enumerable: true,\n }\n}\n\n/**\n * Get the property descriptor to call a given method property.\n * @param {string} key Property name to define property descriptor.\n * @returns {PropertyDescriptor} The property descriptor to call the method property.\n * @private\n */\nfunction defineCallDescriptor(key) {\n return {\n value() {\n const event = pd(this).event;\n return event[key].apply(event, arguments)\n },\n configurable: true,\n enumerable: true,\n }\n}\n\n/**\n * Define new wrapper class.\n * @param {Function} BaseEvent The base wrapper class.\n * @param {Object} proto The prototype of the original event.\n * @returns {Function} The defined wrapper class.\n * @private\n */\nfunction defineWrapper(BaseEvent, proto) {\n const keys = Object.keys(proto);\n if (keys.length === 0) {\n return BaseEvent\n }\n\n /** CustomEvent */\n function CustomEvent(eventTarget, event) {\n BaseEvent.call(this, eventTarget, event);\n }\n\n CustomEvent.prototype = Object.create(BaseEvent.prototype, {\n constructor: { value: CustomEvent, configurable: true, writable: true },\n });\n\n // Define accessors.\n for (let i = 0; i < keys.length; ++i) {\n const key = keys[i];\n if (!(key in BaseEvent.prototype)) {\n const descriptor = Object.getOwnPropertyDescriptor(proto, key);\n const isFunc = typeof descriptor.value === \"function\";\n Object.defineProperty(\n CustomEvent.prototype,\n key,\n isFunc\n ? defineCallDescriptor(key)\n : defineRedirectDescriptor(key)\n );\n }\n }\n\n return CustomEvent\n}\n\n/**\n * Get the wrapper class of a given prototype.\n * @param {Object} proto The prototype of the original event to get its wrapper.\n * @returns {Function} The wrapper class.\n * @private\n */\nfunction getWrapper(proto) {\n if (proto == null || proto === Object.prototype) {\n return Event\n }\n\n let wrapper = wrappers.get(proto);\n if (wrapper == null) {\n wrapper = defineWrapper(getWrapper(Object.getPrototypeOf(proto)), proto);\n wrappers.set(proto, wrapper);\n }\n return wrapper\n}\n\n/**\n * Wrap a given event to management a dispatching.\n * @param {EventTarget} eventTarget The event target of this dispatching.\n * @param {Object} event The event to wrap.\n * @returns {Event} The wrapper instance.\n * @private\n */\nfunction wrapEvent(eventTarget, event) {\n const Wrapper = getWrapper(Object.getPrototypeOf(event));\n return new Wrapper(eventTarget, event)\n}\n\n/**\n * Get the immediateStopped flag of a given event.\n * @param {Event} event The event to get.\n * @returns {boolean} The flag to stop propagation immediately.\n * @private\n */\nfunction isStopped(event) {\n return pd(event).immediateStopped\n}\n\n/**\n * Set the current event phase of a given event.\n * @param {Event} event The event to set current target.\n * @param {number} eventPhase New event phase.\n * @returns {void}\n * @private\n */\nfunction setEventPhase(event, eventPhase) {\n pd(event).eventPhase = eventPhase;\n}\n\n/**\n * Set the current target of a given event.\n * @param {Event} event The event to set current target.\n * @param {EventTarget|null} currentTarget New current target.\n * @returns {void}\n * @private\n */\nfunction setCurrentTarget(event, currentTarget) {\n pd(event).currentTarget = currentTarget;\n}\n\n/**\n * Set a passive listener of a given event.\n * @param {Event} event The event to set current target.\n * @param {Function|null} passiveListener New passive listener.\n * @returns {void}\n * @private\n */\nfunction setPassiveListener(event, passiveListener) {\n pd(event).passiveListener = passiveListener;\n}\n\n/**\n * @typedef {object} ListenerNode\n * @property {Function} listener\n * @property {1|2|3} listenerType\n * @property {boolean} passive\n * @property {boolean} once\n * @property {ListenerNode|null} next\n * @private\n */\n\n/**\n * @type {WeakMap>}\n * @private\n */\nconst listenersMap = new WeakMap();\n\n// Listener types\nconst CAPTURE = 1;\nconst BUBBLE = 2;\nconst ATTRIBUTE = 3;\n\n/**\n * Check whether a given value is an object or not.\n * @param {any} x The value to check.\n * @returns {boolean} `true` if the value is an object.\n */\nfunction isObject(x) {\n return x !== null && typeof x === \"object\" //eslint-disable-line no-restricted-syntax\n}\n\n/**\n * Get listeners.\n * @param {EventTarget} eventTarget The event target to get.\n * @returns {Map} The listeners.\n * @private\n */\nfunction getListeners(eventTarget) {\n const listeners = listenersMap.get(eventTarget);\n if (listeners == null) {\n throw new TypeError(\n \"'this' is expected an EventTarget object, but got another value.\"\n )\n }\n return listeners\n}\n\n/**\n * Get the property descriptor for the event attribute of a given event.\n * @param {string} eventName The event name to get property descriptor.\n * @returns {PropertyDescriptor} The property descriptor.\n * @private\n */\nfunction defineEventAttributeDescriptor(eventName) {\n return {\n get() {\n const listeners = getListeners(this);\n let node = listeners.get(eventName);\n while (node != null) {\n if (node.listenerType === ATTRIBUTE) {\n return node.listener\n }\n node = node.next;\n }\n return null\n },\n\n set(listener) {\n if (typeof listener !== \"function\" && !isObject(listener)) {\n listener = null; // eslint-disable-line no-param-reassign\n }\n const listeners = getListeners(this);\n\n // Traverse to the tail while removing old value.\n let prev = null;\n let node = listeners.get(eventName);\n while (node != null) {\n if (node.listenerType === ATTRIBUTE) {\n // Remove old value.\n if (prev !== null) {\n prev.next = node.next;\n } else if (node.next !== null) {\n listeners.set(eventName, node.next);\n } else {\n listeners.delete(eventName);\n }\n } else {\n prev = node;\n }\n\n node = node.next;\n }\n\n // Add new value.\n if (listener !== null) {\n const newNode = {\n listener,\n listenerType: ATTRIBUTE,\n passive: false,\n once: false,\n next: null,\n };\n if (prev === null) {\n listeners.set(eventName, newNode);\n } else {\n prev.next = newNode;\n }\n }\n },\n configurable: true,\n enumerable: true,\n }\n}\n\n/**\n * Define an event attribute (e.g. `eventTarget.onclick`).\n * @param {Object} eventTargetPrototype The event target prototype to define an event attrbite.\n * @param {string} eventName The event name to define.\n * @returns {void}\n */\nfunction defineEventAttribute(eventTargetPrototype, eventName) {\n Object.defineProperty(\n eventTargetPrototype,\n `on${eventName}`,\n defineEventAttributeDescriptor(eventName)\n );\n}\n\n/**\n * Define a custom EventTarget with event attributes.\n * @param {string[]} eventNames Event names for event attributes.\n * @returns {EventTarget} The custom EventTarget.\n * @private\n */\nfunction defineCustomEventTarget(eventNames) {\n /** CustomEventTarget */\n function CustomEventTarget() {\n EventTarget.call(this);\n }\n\n CustomEventTarget.prototype = Object.create(EventTarget.prototype, {\n constructor: {\n value: CustomEventTarget,\n configurable: true,\n writable: true,\n },\n });\n\n for (let i = 0; i < eventNames.length; ++i) {\n defineEventAttribute(CustomEventTarget.prototype, eventNames[i]);\n }\n\n return CustomEventTarget\n}\n\n/**\n * EventTarget.\n *\n * - This is constructor if no arguments.\n * - This is a function which returns a CustomEventTarget constructor if there are arguments.\n *\n * For example:\n *\n * class A extends EventTarget {}\n * class B extends EventTarget(\"message\") {}\n * class C extends EventTarget(\"message\", \"error\") {}\n * class D extends EventTarget([\"message\", \"error\"]) {}\n */\nfunction EventTarget() {\n /*eslint-disable consistent-return */\n if (this instanceof EventTarget) {\n listenersMap.set(this, new Map());\n return\n }\n if (arguments.length === 1 && Array.isArray(arguments[0])) {\n return defineCustomEventTarget(arguments[0])\n }\n if (arguments.length > 0) {\n const types = new Array(arguments.length);\n for (let i = 0; i < arguments.length; ++i) {\n types[i] = arguments[i];\n }\n return defineCustomEventTarget(types)\n }\n throw new TypeError(\"Cannot call a class as a function\")\n /*eslint-enable consistent-return */\n}\n\n// Should be enumerable, but class methods are not enumerable.\nEventTarget.prototype = {\n /**\n * Add a given listener to this event target.\n * @param {string} eventName The event name to add.\n * @param {Function} listener The listener to add.\n * @param {boolean|{capture?:boolean,passive?:boolean,once?:boolean}} [options] The options for this listener.\n * @returns {void}\n */\n addEventListener(eventName, listener, options) {\n if (listener == null) {\n return\n }\n if (typeof listener !== \"function\" && !isObject(listener)) {\n throw new TypeError(\"'listener' should be a function or an object.\")\n }\n\n const listeners = getListeners(this);\n const optionsIsObj = isObject(options);\n const capture = optionsIsObj\n ? Boolean(options.capture)\n : Boolean(options);\n const listenerType = capture ? CAPTURE : BUBBLE;\n const newNode = {\n listener,\n listenerType,\n passive: optionsIsObj && Boolean(options.passive),\n once: optionsIsObj && Boolean(options.once),\n next: null,\n };\n\n // Set it as the first node if the first node is null.\n let node = listeners.get(eventName);\n if (node === undefined) {\n listeners.set(eventName, newNode);\n return\n }\n\n // Traverse to the tail while checking duplication..\n let prev = null;\n while (node != null) {\n if (\n node.listener === listener &&\n node.listenerType === listenerType\n ) {\n // Should ignore duplication.\n return\n }\n prev = node;\n node = node.next;\n }\n\n // Add it.\n prev.next = newNode;\n },\n\n /**\n * Remove a given listener from this event target.\n * @param {string} eventName The event name to remove.\n * @param {Function} listener The listener to remove.\n * @param {boolean|{capture?:boolean,passive?:boolean,once?:boolean}} [options] The options for this listener.\n * @returns {void}\n */\n removeEventListener(eventName, listener, options) {\n if (listener == null) {\n return\n }\n\n const listeners = getListeners(this);\n const capture = isObject(options)\n ? Boolean(options.capture)\n : Boolean(options);\n const listenerType = capture ? CAPTURE : BUBBLE;\n\n let prev = null;\n let node = listeners.get(eventName);\n while (node != null) {\n if (\n node.listener === listener &&\n node.listenerType === listenerType\n ) {\n if (prev !== null) {\n prev.next = node.next;\n } else if (node.next !== null) {\n listeners.set(eventName, node.next);\n } else {\n listeners.delete(eventName);\n }\n return\n }\n\n prev = node;\n node = node.next;\n }\n },\n\n /**\n * Dispatch a given event.\n * @param {Event|{type:string}} event The event to dispatch.\n * @returns {boolean} `false` if canceled.\n */\n dispatchEvent(event) {\n if (event == null || typeof event.type !== \"string\") {\n throw new TypeError('\"event.type\" should be a string.')\n }\n\n // If listeners aren't registered, terminate.\n const listeners = getListeners(this);\n const eventName = event.type;\n let node = listeners.get(eventName);\n if (node == null) {\n return true\n }\n\n // Since we cannot rewrite several properties, so wrap object.\n const wrappedEvent = wrapEvent(this, event);\n\n // This doesn't process capturing phase and bubbling phase.\n // This isn't participating in a tree.\n let prev = null;\n while (node != null) {\n // Remove this listener if it's once\n if (node.once) {\n if (prev !== null) {\n prev.next = node.next;\n } else if (node.next !== null) {\n listeners.set(eventName, node.next);\n } else {\n listeners.delete(eventName);\n }\n } else {\n prev = node;\n }\n\n // Call this listener\n setPassiveListener(\n wrappedEvent,\n node.passive ? node.listener : null\n );\n if (typeof node.listener === \"function\") {\n try {\n node.listener.call(this, wrappedEvent);\n } catch (err) {\n if (\n typeof console !== \"undefined\" &&\n typeof console.error === \"function\"\n ) {\n console.error(err);\n }\n }\n } else if (\n node.listenerType !== ATTRIBUTE &&\n typeof node.listener.handleEvent === \"function\"\n ) {\n node.listener.handleEvent(wrappedEvent);\n }\n\n // Break if `event.stopImmediatePropagation` was called.\n if (isStopped(wrappedEvent)) {\n break\n }\n\n node = node.next;\n }\n setPassiveListener(wrappedEvent, null);\n setEventPhase(wrappedEvent, 0);\n setCurrentTarget(wrappedEvent, null);\n\n return !wrappedEvent.defaultPrevented\n },\n};\n\n// `constructor` is not enumerable.\nObject.defineProperty(EventTarget.prototype, \"constructor\", {\n value: EventTarget,\n configurable: true,\n writable: true,\n});\n\n// Ensure `eventTarget instanceof window.EventTarget` is `true`.\nif (\n typeof window !== \"undefined\" &&\n typeof window.EventTarget !== \"undefined\"\n) {\n Object.setPrototypeOf(EventTarget.prototype, window.EventTarget.prototype);\n}\n\nexport default EventTarget;\nexport { defineEventAttribute, EventTarget };\n//# sourceMappingURL=event-target-shim.mjs.map\n","import {\n // Event,\n EventTarget,\n // Type,\n defineEventAttribute,\n} from \"event-target-shim\"\n\n// Known Limitation\n// Use `any` because the type of `AbortSignal` in `lib.dom.d.ts` is wrong and\n// to make assignable our `AbortSignal` into that.\n// https://github.com/Microsoft/TSJS-lib-generator/pull/623\ntype Events = {\n abort: any // Event & Type<\"abort\">\n}\ntype EventAttributes = {\n onabort: any // Event & Type<\"abort\">\n}\n\n/**\n * The signal class.\n * @see https://dom.spec.whatwg.org/#abortsignal\n */\nexport default class AbortSignal extends EventTarget {\n /**\n * AbortSignal cannot be constructed directly.\n */\n public constructor() {\n super()\n throw new TypeError(\"AbortSignal cannot be constructed directly\")\n }\n\n /**\n * Returns `true` if this `AbortSignal`'s `AbortController` has signaled to abort, and `false` otherwise.\n */\n public get aborted(): boolean {\n const aborted = abortedFlags.get(this)\n if (typeof aborted !== \"boolean\") {\n throw new TypeError(\n `Expected 'this' to be an 'AbortSignal' object, but got ${\n this === null ? \"null\" : typeof this\n }`,\n )\n }\n return aborted\n }\n}\ndefineEventAttribute(AbortSignal.prototype, \"abort\")\n\n/**\n * Create an AbortSignal object.\n */\nexport function createAbortSignal(): AbortSignal {\n const signal = Object.create(AbortSignal.prototype)\n EventTarget.call(signal)\n abortedFlags.set(signal, false)\n return signal\n}\n\n/**\n * Abort a given signal.\n */\nexport function abortSignal(signal: AbortSignal): void {\n if (abortedFlags.get(signal) !== false) {\n return\n }\n\n abortedFlags.set(signal, true)\n signal.dispatchEvent<\"abort\">({ type: \"abort\" })\n}\n\n/**\n * Aborted flag for each instances.\n */\nconst abortedFlags = new WeakMap()\n\n// Properties should be enumerable.\nObject.defineProperties(AbortSignal.prototype, {\n aborted: { enumerable: true },\n})\n\n// `toString()` should return `\"[object AbortSignal]\"`\nif (typeof Symbol === \"function\" && typeof Symbol.toStringTag === \"symbol\") {\n Object.defineProperty(AbortSignal.prototype, Symbol.toStringTag, {\n configurable: true,\n value: \"AbortSignal\",\n })\n}\n","import AbortSignal, { abortSignal, createAbortSignal } from \"./abort-signal\"\n\n/**\n * The AbortController.\n * @see https://dom.spec.whatwg.org/#abortcontroller\n */\nexport default class AbortController {\n /**\n * Initialize this controller.\n */\n public constructor() {\n signals.set(this, createAbortSignal())\n }\n\n /**\n * Returns the `AbortSignal` object associated with this object.\n */\n public get signal(): AbortSignal {\n return getSignal(this)\n }\n\n /**\n * Abort and signal to any observers that the associated activity is to be aborted.\n */\n public abort(): void {\n abortSignal(getSignal(this))\n }\n}\n\n/**\n * Associated signals.\n */\nconst signals = new WeakMap()\n\n/**\n * Get the associated signal of a given controller.\n */\nfunction getSignal(controller: AbortController): AbortSignal {\n const signal = signals.get(controller)\n if (signal == null) {\n throw new TypeError(\n `Expected 'this' to be an 'AbortController' object, but got ${\n controller === null ? \"null\" : typeof controller\n }`,\n )\n }\n return signal\n}\n\n// Properties should be enumerable.\nObject.defineProperties(AbortController.prototype, {\n signal: { enumerable: true },\n abort: { enumerable: true },\n})\n\nif (typeof Symbol === \"function\" && typeof Symbol.toStringTag === \"symbol\") {\n Object.defineProperty(AbortController.prototype, Symbol.toStringTag, {\n configurable: true,\n value: \"AbortController\",\n })\n}\n\nexport { AbortController, AbortSignal }\n"],"names":["pd","event","retv","privateData","get","console","assert","setCancelFlag","data","passiveListener","cancelable","canceled","preventDefault","error","Event","eventTarget","set","eventPhase","currentTarget","stopped","immediateStopped","timeStamp","Date","now","Object","defineProperty","value","enumerable","key","keys","i","length","defineRedirectDescriptor","configurable","defineCallDescriptor","apply","arguments","defineWrapper","BaseEvent","proto","CustomEvent","call","prototype","create","constructor","writable","descriptor","getOwnPropertyDescriptor","isFunc","getWrapper","wrapper","wrappers","getPrototypeOf","wrapEvent","Wrapper","isStopped","setEventPhase","setCurrentTarget","setPassiveListener","createAbortSignal","signal","AbortSignal","EventTarget","abortedFlags","abortSignal","dispatchEvent","type","getSignal","controller","signals","TypeError","WeakMap","target","composedPath","NONE","CAPTURING_PHASE","AT_TARGET","BUBBLING_PHASE","stopPropagation","stopImmediatePropagation","bubbles","defaultPrevented","composed","srcElement","cancelBubble","returnValue","initEvent","window","setPrototypeOf","aborted","defineEventAttribute","defineProperties","Symbol","_typeof","toStringTag","AbortController","abort"],"mappings":";;;+3CAkCA,QAASA,CAAAA,CAAT,CAAYC,CAAZ,CAAmB,IACTC,CAAAA,CAAI,CAAGC,CAAW,CAACC,GAAZ,CAAgBH,CAAhB,QACbI,CAAAA,OAAO,CAACC,MAAR,CACY,IAAR,EAAAJ,CADJ,CAEI,6CAFJ,CAGID,CAHJ,EAKOC,EAOX,QAASK,CAAAA,CAAT,CAAuBC,CAAvB,CAA6B,OACG,KAAxB,EAAAA,CAAI,CAACC,eADgB,MAarB,CAACD,CAAI,CAACP,KAAL,CAAWS,UAbS,GAiBzBF,CAAI,CAACG,QAAL,GAjByB,CAkBgB,UAArC,QAAOH,CAAAA,CAAI,CAACP,KAAL,CAAWW,cAlBG,EAmBrBJ,CAAI,CAACP,KAAL,CAAWW,cAAX,EAnBqB,QAGE,WAAnB,QAAOP,CAAAA,OAAP,EACyB,UAAzB,QAAOA,CAAAA,OAAO,CAACQ,KAJE,EAMjBR,OAAO,CAACQ,KAAR,CACI,oEADJ,CAEIL,CAAI,CAACC,eAFT,CANiB,EAiC7B,QAASK,CAAAA,CAAT,CAAeC,CAAf,CAA4Bd,CAA5B,CAAmC,CAC/BE,CAAW,CAACa,GAAZ,CAAgB,IAAhB,CAAsB,CAClBD,WAAW,CAAXA,CADkB,CAElBd,KAAK,CAALA,CAFkB,CAGlBgB,UAAU,CAAE,CAHM,CAIlBC,aAAa,CAAEH,CAJG,CAKlBJ,QAAQ,GALU,CAMlBQ,OAAO,GANW,CAOlBC,gBAAgB,GAPE,CAQlBX,eAAe,CAAE,I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WAkBpB/C,MAAM,CAACmE,gBAAPnE,CAAwBuE,CAAe,CAACrD,SAAxClB,CAAmD,CAC/CoC,MAAM,CAAE,CAAEjC,UAAU,GAAZ,CADuC,CAE/CqE,KAAK,CAAE,CAAErE,UAAU,GAAZ,CAFwC,CAAnDH,EAKsB,UAAlB,QAAOoE,CAAAA,MAAP,EAA8D,QAA9B,GAAAC,EAAOD,MAAM,CAACE,cAC9CtE,MAAM,CAACC,cAAPD,CAAsBuE,CAAe,CAACrD,SAAtClB,CAAiDoE,MAAM,CAACE,WAAxDtE,CAAqE,CACjES,YAAY,GADqD,CAEjEP,KAAK,CAAE,iBAF0D,CAArEF"} \ No newline at end of file diff --git a/deps/npm/node_modules/agent-base/dist/src/index.d.ts b/deps/npm/node_modules/agent-base/dist/src/index.d.ts deleted file mode 100644 index bc4ab744c59c81..00000000000000 --- a/deps/npm/node_modules/agent-base/dist/src/index.d.ts +++ /dev/null @@ -1,78 +0,0 @@ -/// -import net from 'net'; -import http from 'http'; -import https from 'https'; -import { Duplex } from 'stream'; -import { EventEmitter } from 'events'; -declare function createAgent(opts?: createAgent.AgentOptions): createAgent.Agent; -declare function createAgent(callback: createAgent.AgentCallback, opts?: createAgent.AgentOptions): createAgent.Agent; -declare namespace createAgent { - interface ClientRequest extends http.ClientRequest { - _last?: boolean; - _hadError?: boolean; - method: string; - } - interface AgentRequestOptions { - host?: string; - path?: string; - port: number; - } - interface HttpRequestOptions extends AgentRequestOptions, Omit { - secureEndpoint: false; - } - interface HttpsRequestOptions extends AgentRequestOptions, Omit { - secureEndpoint: true; - } - type RequestOptions = HttpRequestOptions | HttpsRequestOptions; - type AgentLike = Pick | http.Agent; - type AgentCallbackReturn = Duplex | AgentLike; - type AgentCallbackCallback = (err?: Error | null, socket?: createAgent.AgentCallbackReturn) => void; - type AgentCallbackPromise = (req: createAgent.ClientRequest, opts: createAgent.RequestOptions) => createAgent.AgentCallbackReturn | Promise; - type AgentCallback = typeof Agent.prototype.callback; - type AgentOptions = { - timeout?: number; - }; - /** - * Base `http.Agent` implementation. - * No pooling/keep-alive is implemented by default. - * - * @param {Function} callback - * @api public - */ - class Agent extends EventEmitter { - timeout: number | null; - maxFreeSockets: number; - maxTotalSockets: number; - maxSockets: number; - sockets: { - [key: string]: net.Socket[]; - }; - freeSockets: { - [key: string]: net.Socket[]; - }; - requests: { - [key: string]: http.IncomingMessage[]; - }; - options: https.AgentOptions; - private promisifiedCallback?; - private explicitDefaultPort?; - private explicitProtocol?; - constructor(callback?: createAgent.AgentCallback | createAgent.AgentOptions, _opts?: createAgent.AgentOptions); - get defaultPort(): number; - set defaultPort(v: number); - get protocol(): string; - set protocol(v: string); - callback(req: createAgent.ClientRequest, opts: createAgent.RequestOptions, fn: createAgent.AgentCallbackCallback): void; - callback(req: createAgent.ClientRequest, opts: createAgent.RequestOptions): createAgent.AgentCallbackReturn | Promise; - /** - * Called by node-core's "_http_client.js" module when creating - * a new HTTP request with this Agent instance. - * - * @api public - */ - addRequest(req: ClientRequest, _opts: RequestOptions): void; - freeSocket(socket: net.Socket, opts: AgentOptions): void; - destroy(): void; - } -} -export = createAgent; diff --git a/deps/npm/node_modules/agent-base/dist/src/index.js.map b/deps/npm/node_modules/agent-base/dist/src/index.js.map deleted file mode 100644 index bd118ab6bb1ce6..00000000000000 --- a/deps/npm/node_modules/agent-base/dist/src/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;AAIA,mCAAsC;AACtC,kDAAgC;AAChC,4DAAoC;AAEpC,MAAM,KAAK,GAAG,eAAW,CAAC,YAAY,CAAC,CAAC;AAExC,SAAS,OAAO,CAAC,CAAM;IACtB,OAAO,OAAO,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,CAAC,UAAU,KAAK,UAAU,CAAC;AACzD,CAAC;AAED,SAAS,gBAAgB;IACxB,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,KAAK,EAAE,CAAC;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C;QAED,OAAO;YACN,KAAK,CAAC,qBAAqB,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QACrD,CAAC;KACD;IAxPY,iBAAK,QAwPjB,CAAA;IAED,uCAAuC;IACvC,WAAW,CAAC,SAAS,GAAG,WAAW,CAAC,KAAK,CAAC,SAAS,CAAC;AACrD,CAAC,EAtTS,WAAW,KAAX,WAAW,QAsTpB;AAED,iBAAS,WAAW,CAAC"} \ No newline at end of file diff --git a/deps/npm/node_modules/agent-base/dist/src/promisify.d.ts b/deps/npm/node_modules/agent-base/dist/src/promisify.d.ts deleted file mode 100644 index 02688696fb4c1a..00000000000000 --- a/deps/npm/node_modules/agent-base/dist/src/promisify.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { ClientRequest, RequestOptions, AgentCallbackCallback, AgentCallbackPromise } from './index'; -declare type LegacyCallback = (req: ClientRequest, opts: RequestOptions, fn: AgentCallbackCallback) => void; -export default function promisify(fn: LegacyCallback): AgentCallbackPromise; -export {}; diff --git a/deps/npm/node_modules/agent-base/dist/src/promisify.js.map b/deps/npm/node_modules/agent-base/dist/src/promisify.js.map deleted file mode 100644 index 4bff9bfcfa2899..00000000000000 --- a/deps/npm/node_modules/agent-base/dist/src/promisify.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"promisify.js","sourceRoot":"","sources":["../../src/promisify.ts"],"names":[],"mappings":";;AAeA,SAAwB,SAAS,CAAC,EAAkB;IACnD,OAAO,UAAsB,GAAkB,EAAE,IAAoB;QACpE,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACtC,EAAE,CAAC,IAAI,CACN,IAAI,EACJ,GAAG,EACH,IAAI,EACJ,CAAC,GAA6B,EAAE,GAAyB,EAAE,EAAE;gBAC5D,IAAI,GAAG,EAAE;oBACR,MAAM,CAAC,GAAG,CAAC,CAAC;iBACZ;qBAAM;oBACN,OAAO,CAAC,GAAG,CAAC,CAAC;iBACb;YACF,CAAC,CACD,CAAC;QACH,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC;AACH,CAAC;AAjBD,4BAiBC"} \ No newline at end of file diff --git a/deps/npm/node_modules/agent-base/src/index.ts b/deps/npm/node_modules/agent-base/src/index.ts deleted file mode 100644 index a47ccd493f90a8..00000000000000 --- a/deps/npm/node_modules/agent-base/src/index.ts +++ /dev/null @@ -1,345 +0,0 @@ -import net from 'net'; -import http from 'http'; -import https from 'https'; -import { Duplex } from 'stream'; -import { EventEmitter } from 'events'; -import createDebug from 'debug'; -import promisify from './promisify'; - -const debug = createDebug('agent-base'); - -function isAgent(v: any): v is createAgent.AgentLike { - return Boolean(v) && typeof v.addRequest === 'function'; -} - -function isSecureEndpoint(): boolean { - const { stack } = new Error(); - if (typeof stack !== 'string') return false; - return stack.split('\n').some(l => l.indexOf('(https.js:') !== -1 || l.indexOf('node:https:') !== -1); -} - -function createAgent(opts?: createAgent.AgentOptions): createAgent.Agent; -function createAgent( - callback: createAgent.AgentCallback, - opts?: createAgent.AgentOptions -): createAgent.Agent; -function createAgent( - callback?: createAgent.AgentCallback | createAgent.AgentOptions, - opts?: createAgent.AgentOptions -) { - return new createAgent.Agent(callback, opts); -} - -namespace createAgent { - export interface ClientRequest extends http.ClientRequest { - _last?: boolean; - _hadError?: boolean; - method: string; - } - - export interface AgentRequestOptions { - host?: string; - path?: string; - // `port` on `http.RequestOptions` can be a string or undefined, - // but `net.TcpNetConnectOpts` expects only a number - port: number; - } - - export interface HttpRequestOptions - extends AgentRequestOptions, - Omit { - secureEndpoint: false; - } - - export interface HttpsRequestOptions - extends AgentRequestOptions, - Omit { - secureEndpoint: true; - } - - export type RequestOptions = HttpRequestOptions | HttpsRequestOptions; - - export type AgentLike = Pick | http.Agent; - - export type AgentCallbackReturn = Duplex | AgentLike; - - export type AgentCallbackCallback = ( - err?: Error | null, - socket?: createAgent.AgentCallbackReturn - ) => void; - - export type AgentCallbackPromise = ( - req: createAgent.ClientRequest, - opts: createAgent.RequestOptions - ) => - | createAgent.AgentCallbackReturn - | Promise; - - export type AgentCallback = typeof Agent.prototype.callback; - - export type AgentOptions = { - timeout?: number; - }; - - /** - * Base `http.Agent` implementation. - * No pooling/keep-alive is implemented by default. - * - * @param {Function} callback - * @api public - */ - export class Agent extends EventEmitter { - public timeout: number | null; - public maxFreeSockets: number; - public maxTotalSockets: number; - public maxSockets: number; - public sockets: { - [key: string]: net.Socket[]; - }; - public freeSockets: { - [key: string]: net.Socket[]; - }; - public requests: { - [key: string]: http.IncomingMessage[]; - }; - public options: https.AgentOptions; - private promisifiedCallback?: createAgent.AgentCallbackPromise; - private explicitDefaultPort?: number; - private explicitProtocol?: string; - - constructor( - callback?: createAgent.AgentCallback | createAgent.AgentOptions, - _opts?: createAgent.AgentOptions - ) { - super(); - - let opts = _opts; - if (typeof callback === 'function') { - this.callback = callback; - } else if (callback) { - opts = callback; - } - - // Timeout for the socket to be returned from the callback - this.timeout = null; - if (opts && typeof opts.timeout === 'number') { - this.timeout = opts.timeout; - } - - // These aren't actually used by `agent-base`, but are required - // for the TypeScript definition files in `@types/node` :/ - this.maxFreeSockets = 1; - this.maxSockets = 1; - this.maxTotalSockets = Infinity; - this.sockets = {}; - this.freeSockets = {}; - this.requests = {}; - this.options = {}; - } - - get defaultPort(): number { - if (typeof this.explicitDefaultPort === 'number') { - return this.explicitDefaultPort; - } - return isSecureEndpoint() ? 443 : 80; - } - - set defaultPort(v: number) { - this.explicitDefaultPort = v; - } - - get protocol(): string { - if (typeof this.explicitProtocol === 'string') { - return this.explicitProtocol; - } - return isSecureEndpoint() ? 'https:' : 'http:'; - } - - set protocol(v: string) { - this.explicitProtocol = v; - } - - callback( - req: createAgent.ClientRequest, - opts: createAgent.RequestOptions, - fn: createAgent.AgentCallbackCallback - ): void; - callback( - req: createAgent.ClientRequest, - opts: createAgent.RequestOptions - ): - | createAgent.AgentCallbackReturn - | Promise; - callback( - req: createAgent.ClientRequest, - opts: createAgent.AgentOptions, - fn?: createAgent.AgentCallbackCallback - ): - | createAgent.AgentCallbackReturn - | Promise - | void { - throw new Error( - '"agent-base" has no default implementation, you must subclass and override `callback()`' - ); - } - - /** - * Called by node-core's "_http_client.js" module when creating - * a new HTTP request with this Agent instance. - * - * @api public - */ - addRequest(req: ClientRequest, _opts: RequestOptions): void { - const opts: RequestOptions = { ..._opts }; - - if (typeof opts.secureEndpoint !== 'boolean') { - opts.secureEndpoint = isSecureEndpoint(); - } - - if (opts.host == null) { - opts.host = 'localhost'; - } - - if (opts.port == null) { - opts.port = opts.secureEndpoint ? 443 : 80; - } - - if (opts.protocol == null) { - opts.protocol = opts.secureEndpoint ? 'https:' : 'http:'; - } - - if (opts.host && opts.path) { - // If both a `host` and `path` are specified then it's most - // likely the result of a `url.parse()` call... we need to - // remove the `path` portion so that `net.connect()` doesn't - // attempt to open that as a unix socket file. - delete opts.path; - } - - delete opts.agent; - delete opts.hostname; - delete opts._defaultAgent; - delete opts.defaultPort; - delete opts.createConnection; - - // Hint to use "Connection: close" - // XXX: non-documented `http` module API :( - req._last = true; - req.shouldKeepAlive = false; - - let timedOut = false; - let timeoutId: ReturnType | null = null; - const timeoutMs = opts.timeout || this.timeout; - - const onerror = (err: NodeJS.ErrnoException) => { - if (req._hadError) return; - req.emit('error', err); - // For Safety. Some additional errors might fire later on - // and we need to make sure we don't double-fire the error event. - req._hadError = true; - }; - - const ontimeout = () => { - timeoutId = null; - timedOut = true; - const err: NodeJS.ErrnoException = new Error( - `A "socket" was not created for HTTP request before ${timeoutMs}ms` - ); - err.code = 'ETIMEOUT'; - onerror(err); - }; - - const callbackError = (err: NodeJS.ErrnoException) => { - if (timedOut) return; - if (timeoutId !== null) { - clearTimeout(timeoutId); - timeoutId = null; - } - onerror(err); - }; - - const onsocket = (socket: AgentCallbackReturn) => { - if (timedOut) return; - if (timeoutId != null) { - clearTimeout(timeoutId); - timeoutId = null; - } - - if (isAgent(socket)) { - // `socket` is actually an `http.Agent` instance, so - // relinquish responsibility for this `req` to the Agent - // from here on - debug( - 'Callback returned another Agent instance %o', - socket.constructor.name - ); - (socket as createAgent.Agent).addRequest(req, opts); - return; - } - - if (socket) { - socket.once('free', () => { - this.freeSocket(socket as net.Socket, opts); - }); - req.onSocket(socket as net.Socket); - return; - } - - const err = new Error( - `no Duplex stream was returned to agent-base for \`${req.method} ${req.path}\`` - ); - onerror(err); - }; - - if (typeof this.callback !== 'function') { - onerror(new Error('`callback` is not defined')); - return; - } - - if (!this.promisifiedCallback) { - if (this.callback.length >= 3) { - debug('Converting legacy callback function to promise'); - this.promisifiedCallback = promisify(this.callback); - } else { - this.promisifiedCallback = this.callback; - } - } - - if (typeof timeoutMs === 'number' && timeoutMs > 0) { - timeoutId = setTimeout(ontimeout, timeoutMs); - } - - if ('port' in opts && typeof opts.port !== 'number') { - opts.port = Number(opts.port); - } - - try { - debug( - 'Resolving socket for %o request: %o', - opts.protocol, - `${req.method} ${req.path}` - ); - Promise.resolve(this.promisifiedCallback(req, opts)).then( - onsocket, - callbackError - ); - } catch (err) { - Promise.reject(err).catch(callbackError); - } - } - - freeSocket(socket: net.Socket, opts: AgentOptions) { - debug('Freeing socket %o %o', socket.constructor.name, opts); - socket.destroy(); - } - - destroy() { - debug('Destroying agent %o', this.constructor.name); - } - } - - // So that `instanceof` works correctly - createAgent.prototype = createAgent.Agent.prototype; -} - -export = createAgent; diff --git a/deps/npm/node_modules/agent-base/src/promisify.ts b/deps/npm/node_modules/agent-base/src/promisify.ts deleted file mode 100644 index 60cc6627100b81..00000000000000 --- a/deps/npm/node_modules/agent-base/src/promisify.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { - Agent, - ClientRequest, - RequestOptions, - AgentCallbackCallback, - AgentCallbackPromise, - AgentCallbackReturn -} from './index'; - -type LegacyCallback = ( - req: ClientRequest, - opts: RequestOptions, - fn: AgentCallbackCallback -) => void; - -export default function promisify(fn: LegacyCallback): AgentCallbackPromise { - return function(this: Agent, req: ClientRequest, opts: RequestOptions) { - return new Promise((resolve, reject) => { - fn.call( - this, - req, - opts, - (err: Error | null | undefined, rtn?: AgentCallbackReturn) => { - if (err) { - reject(err); - } else { - resolve(rtn); - } - } - ); - }); - }; -} diff --git a/deps/npm/node_modules/agentkeepalive/index.d.ts b/deps/npm/node_modules/agentkeepalive/index.d.ts deleted file mode 100644 index c2ce7d207a64b3..00000000000000 --- a/deps/npm/node_modules/agentkeepalive/index.d.ts +++ /dev/null @@ -1,62 +0,0 @@ -import * as http from 'http'; -import * as https from 'https'; - -interface PlainObject { - [key: string]: any; -} - -declare class HttpAgent extends http.Agent { - constructor(opts?: AgentKeepAlive.HttpOptions); - readonly statusChanged: boolean; - createSocket(req: http.IncomingMessage, options: http.RequestOptions, cb: Function): void; - getCurrentStatus(): AgentKeepAlive.AgentStatus; -} - -interface Constants { - CURRENT_ID: Symbol; - CREATE_ID: Symbol; - INIT_SOCKET: Symbol; - CREATE_HTTPS_CONNECTION: Symbol; - SOCKET_CREATED_TIME: Symbol; - SOCKET_NAME: Symbol; - SOCKET_REQUEST_COUNT: Symbol; - SOCKET_REQUEST_FINISHED_COUNT: Symbol; -} - -declare class AgentKeepAlive extends HttpAgent {} - -declare namespace AgentKeepAlive { - export interface AgentStatus { - createSocketCount: number; - createSocketErrorCount: number; - closeSocketCount: number; - errorSocketCount: number; - timeoutSocketCount: number; - requestCount: number; - freeSockets: PlainObject; - sockets: PlainObject; - requests: PlainObject; - } - - interface CommonHttpOption { - keepAlive?: boolean | undefined; - freeSocketTimeout?: number | undefined; - freeSocketKeepAliveTimeout?: number | undefined; - timeout?: number | undefined; - socketActiveTTL?: number | undefined; - } - - export interface HttpOptions extends http.AgentOptions, CommonHttpOption { } - export interface HttpsOptions extends https.AgentOptions, CommonHttpOption { } - - export class HttpsAgent extends https.Agent { - constructor(opts?: HttpsOptions); - readonly statusChanged: boolean; - createSocket(req: http.IncomingMessage, options: http.RequestOptions, cb: Function): void; - getCurrentStatus(): AgentStatus; - } - - export const constants: Constants; -} - -export = AgentKeepAlive; diff --git a/deps/npm/node_modules/agentkeepalive/package.json b/deps/npm/node_modules/agentkeepalive/package.json index efa561d2c6d6c1..3115fee69a0416 100644 --- a/deps/npm/node_modules/agentkeepalive/package.json +++ b/deps/npm/node_modules/agentkeepalive/package.json @@ -1,6 +1,6 @@ { "name": "agentkeepalive", - "version": "4.2.1", + "version": "4.3.0", "description": "Missing keepalive http.Agent", "main": "index.js", "browser": "browser.js", @@ -11,12 +11,12 @@ "lib" ], "scripts": { + "contributor": "git-contributor", "test": "npm run lint && egg-bin test --full-trace", "test-local": "egg-bin test --full-trace", "cov": "cross-env DEBUG=agentkeepalive egg-bin cov --full-trace", "ci": "npm run lint && npm run cov", - "lint": "eslint lib test index.js", - "autod": "autod" + "lint": "eslint lib test index.js" }, "repository": { "type": "git", @@ -36,17 +36,16 @@ ], "dependencies": { "debug": "^4.1.0", - "depd": "^1.1.2", + "depd": "^2.0.0", "humanize-ms": "^1.2.1" }, "devDependencies": { - "autod": "^3.0.1", "coffee": "^5.3.0", "cross-env": "^6.0.3", "egg-bin": "^4.9.0", - "egg-ci": "^1.10.0", "eslint": "^5.7.0", "eslint-config-egg": "^7.1.0", + "git-contributor": "^2.0.0", "mm": "^2.4.1", "pedding": "^1.1.0", "typescript": "^3.8.3" @@ -54,13 +53,6 @@ "engines": { "node": ">= 8.0.0" }, - "ci": { - "type": "github", - "os": { - "github": "linux" - }, - "version": "8, 10, 12, 14, 16" - }, - "author": "fengmk2 (https://fengmk2.com)", + "author": "fengmk2 (https://github.com/fengmk2)", "license": "MIT" } diff --git a/deps/npm/node_modules/aggregate-error/index.d.ts b/deps/npm/node_modules/aggregate-error/index.d.ts deleted file mode 100644 index 502bf7ad1d0dfb..00000000000000 --- a/deps/npm/node_modules/aggregate-error/index.d.ts +++ /dev/null @@ -1,51 +0,0 @@ -/** -Create an error from multiple errors. -*/ -declare class AggregateError extends Error implements Iterable { - readonly name: 'AggregateError'; - - /** - @param errors - If a string, a new `Error` is created with the string as the error message. If a non-Error object, a new `Error` is created with all properties from the object copied over. - @returns An Error that is also an [`Iterable`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Iterators_and_Generators#Iterables) for the individual errors. - - @example - ``` - import AggregateError = require('aggregate-error'); - - const error = new AggregateError([new Error('foo'), 'bar', {message: 'baz'}]); - - throw error; - - // AggregateError: - // Error: foo - // at Object. (/Users/sindresorhus/dev/aggregate-error/example.js:3:33) - // Error: bar - // at Object. (/Users/sindresorhus/dev/aggregate-error/example.js:3:13) - // Error: baz - // at Object. (/Users/sindresorhus/dev/aggregate-error/example.js:3:13) - // at AggregateError (/Users/sindresorhus/dev/aggregate-error/index.js:19:3) - // at Object. (/Users/sindresorhus/dev/aggregate-error/example.js:3:13) - // at Module._compile (module.js:556:32) - // at Object.Module._extensions..js (module.js:565:10) - // at Module.load (module.js:473:32) - // at tryModuleLoad (module.js:432:12) - // at Function.Module._load (module.js:424:3) - // at Module.runMain (module.js:590:10) - // at run (bootstrap_node.js:394:7) - // at startup (bootstrap_node.js:149:9) - - - for (const individualError of error) { - console.log(individualError); - } - //=> [Error: foo] - //=> [Error: bar] - //=> [Error: baz] - ``` - */ - constructor(errors: ReadonlyArray); - - [Symbol.iterator](): IterableIterator; -} - -export = AggregateError; diff --git a/deps/npm/node_modules/ansi-regex/index.d.ts b/deps/npm/node_modules/ansi-regex/index.d.ts deleted file mode 100644 index 2dbf6af2b6f3b5..00000000000000 --- a/deps/npm/node_modules/ansi-regex/index.d.ts +++ /dev/null @@ -1,37 +0,0 @@ -declare namespace ansiRegex { - interface Options { - /** - Match only the first ANSI escape. - - @default false - */ - onlyFirst: boolean; - } -} - -/** -Regular expression for matching ANSI escape codes. - -@example -``` -import ansiRegex = require('ansi-regex'); - -ansiRegex().test('\u001B[4mcake\u001B[0m'); -//=> true - -ansiRegex().test('cake'); -//=> false - -'\u001B[4mcake\u001B[0m'.match(ansiRegex()); -//=> ['\u001B[4m', '\u001B[0m'] - -'\u001B[4mcake\u001B[0m'.match(ansiRegex({onlyFirst: true})); -//=> ['\u001B[4m'] - -'\u001B]8;;https://github.com\u0007click\u001B]8;;\u0007'.match(ansiRegex()); -//=> ['\u001B]8;;https://github.com\u0007', '\u001B]8;;\u0007'] -``` -*/ -declare function ansiRegex(options?: ansiRegex.Options): RegExp; - -export = ansiRegex; diff --git a/deps/npm/node_modules/ansi-styles/index.d.ts b/deps/npm/node_modules/ansi-styles/index.d.ts deleted file mode 100644 index 44a907e580f105..00000000000000 --- a/deps/npm/node_modules/ansi-styles/index.d.ts +++ /dev/null @@ -1,345 +0,0 @@ -declare type CSSColor = - | 'aliceblue' - | 'antiquewhite' - | 'aqua' - | 'aquamarine' - | 'azure' - | 'beige' - | 'bisque' - | 'black' - | 'blanchedalmond' - | 'blue' - | 'blueviolet' - | 'brown' - | 'burlywood' - | 'cadetblue' - | 'chartreuse' - | 'chocolate' - | 'coral' - | 'cornflowerblue' - | 'cornsilk' - | 'crimson' - | 'cyan' - | 'darkblue' - | 'darkcyan' - | 'darkgoldenrod' - | 'darkgray' - | 'darkgreen' - | 'darkgrey' - | 'darkkhaki' - | 'darkmagenta' - | 'darkolivegreen' - | 'darkorange' - | 'darkorchid' - | 'darkred' - | 'darksalmon' - | 'darkseagreen' - | 'darkslateblue' - | 'darkslategray' - | 'darkslategrey' - | 'darkturquoise' - | 'darkviolet' - | 'deeppink' - | 'deepskyblue' - | 'dimgray' - | 'dimgrey' - | 'dodgerblue' - | 'firebrick' - | 'floralwhite' - | 'forestgreen' - | 'fuchsia' - | 'gainsboro' - | 'ghostwhite' - | 'gold' - | 'goldenrod' - | 'gray' - | 'green' - | 'greenyellow' - | 'grey' - | 'honeydew' - | 'hotpink' - | 'indianred' - | 'indigo' - | 'ivory' - | 'khaki' - | 'lavender' - | 'lavenderblush' - | 'lawngreen' - | 'lemonchiffon' - | 'lightblue' - | 'lightcoral' - | 'lightcyan' - | 'lightgoldenrodyellow' - | 'lightgray' - | 'lightgreen' - | 'lightgrey' - | 'lightpink' - | 'lightsalmon' - | 'lightseagreen' - | 'lightskyblue' - | 'lightslategray' - | 'lightslategrey' - | 'lightsteelblue' - | 'lightyellow' - | 'lime' - | 'limegreen' - | 'linen' - | 'magenta' - | 'maroon' - | 'mediumaquamarine' - | 'mediumblue' - | 'mediumorchid' - | 'mediumpurple' - | 'mediumseagreen' - | 'mediumslateblue' - | 'mediumspringgreen' - | 'mediumturquoise' - | 'mediumvioletred' - | 'midnightblue' - | 'mintcream' - | 'mistyrose' - | 'moccasin' - | 'navajowhite' - | 'navy' - | 'oldlace' - | 'olive' - | 'olivedrab' - | 'orange' - | 'orangered' - | 'orchid' - | 'palegoldenrod' - | 'palegreen' - | 'paleturquoise' - | 'palevioletred' - | 'papayawhip' - | 'peachpuff' - | 'peru' - | 'pink' - | 'plum' - | 'powderblue' - | 'purple' - | 'rebeccapurple' - | 'red' - | 'rosybrown' - | 'royalblue' - | 'saddlebrown' - | 'salmon' - | 'sandybrown' - | 'seagreen' - | 'seashell' - | 'sienna' - | 'silver' - | 'skyblue' - | 'slateblue' - | 'slategray' - | 'slategrey' - | 'snow' - | 'springgreen' - | 'steelblue' - | 'tan' - | 'teal' - | 'thistle' - | 'tomato' - | 'turquoise' - | 'violet' - | 'wheat' - | 'white' - | 'whitesmoke' - | 'yellow' - | 'yellowgreen'; - -declare namespace ansiStyles { - interface ColorConvert { - /** - The RGB color space. - - @param red - (`0`-`255`) - @param green - (`0`-`255`) - @param blue - (`0`-`255`) - */ - rgb(red: number, green: number, blue: number): string; - - /** - The RGB HEX color space. - - @param hex - A hexadecimal string containing RGB data. - */ - hex(hex: string): string; - - /** - @param keyword - A CSS color name. - */ - keyword(keyword: CSSColor): string; - - /** - The HSL color space. - - @param hue - (`0`-`360`) - @param saturation - (`0`-`100`) - @param lightness - (`0`-`100`) - */ - hsl(hue: number, saturation: number, lightness: number): string; - - /** - The HSV color space. - - @param hue - (`0`-`360`) - @param saturation - (`0`-`100`) - @param value - (`0`-`100`) - */ - hsv(hue: number, saturation: number, value: number): string; - - /** - The HSV color space. - - @param hue - (`0`-`360`) - @param whiteness - (`0`-`100`) - @param blackness - (`0`-`100`) - */ - hwb(hue: number, whiteness: number, blackness: number): string; - - /** - Use a [4-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#3/4-bit) to set text color. - */ - ansi(ansi: number): string; - - /** - Use an [8-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) to set text color. - */ - ansi256(ansi: number): string; - } - - interface CSPair { - /** - The ANSI terminal control sequence for starting this style. - */ - readonly open: string; - - /** - The ANSI terminal control sequence for ending this style. - */ - readonly close: string; - } - - interface ColorBase { - readonly ansi: ColorConvert; - readonly ansi256: ColorConvert; - readonly ansi16m: ColorConvert; - - /** - The ANSI terminal control sequence for ending this color. - */ - readonly close: string; - } - - interface Modifier { - /** - Resets the current color chain. - */ - readonly reset: CSPair; - - /** - Make text bold. - */ - readonly bold: CSPair; - - /** - Emitting only a small amount of light. - */ - readonly dim: CSPair; - - /** - Make text italic. (Not widely supported) - */ - readonly italic: CSPair; - - /** - Make text underline. (Not widely supported) - */ - readonly underline: CSPair; - - /** - Inverse background and foreground colors. - */ - readonly inverse: CSPair; - - /** - Prints the text, but makes it invisible. - */ - readonly hidden: CSPair; - - /** - Puts a horizontal line through the center of the text. (Not widely supported) - */ - readonly strikethrough: CSPair; - } - - interface ForegroundColor { - readonly black: CSPair; - readonly red: CSPair; - readonly green: CSPair; - readonly yellow: CSPair; - readonly blue: CSPair; - readonly cyan: CSPair; - readonly magenta: CSPair; - readonly white: CSPair; - - /** - Alias for `blackBright`. - */ - readonly gray: CSPair; - - /** - Alias for `blackBright`. - */ - readonly grey: CSPair; - - readonly blackBright: CSPair; - readonly redBright: CSPair; - readonly greenBright: CSPair; - readonly yellowBright: CSPair; - readonly blueBright: CSPair; - readonly cyanBright: CSPair; - readonly magentaBright: CSPair; - readonly whiteBright: CSPair; - } - - interface BackgroundColor { - readonly bgBlack: CSPair; - readonly bgRed: CSPair; - readonly bgGreen: CSPair; - readonly bgYellow: CSPair; - readonly bgBlue: CSPair; - readonly bgCyan: CSPair; - readonly bgMagenta: CSPair; - readonly bgWhite: CSPair; - - /** - Alias for `bgBlackBright`. - */ - readonly bgGray: CSPair; - - /** - Alias for `bgBlackBright`. - */ - readonly bgGrey: CSPair; - - readonly bgBlackBright: CSPair; - readonly bgRedBright: CSPair; - readonly bgGreenBright: CSPair; - readonly bgYellowBright: CSPair; - readonly bgBlueBright: CSPair; - readonly bgCyanBright: CSPair; - readonly bgMagentaBright: CSPair; - readonly bgWhiteBright: CSPair; - } -} - -declare const ansiStyles: { - readonly modifier: ansiStyles.Modifier; - readonly color: ansiStyles.ForegroundColor & ansiStyles.ColorBase; - readonly bgColor: ansiStyles.BackgroundColor & ansiStyles.ColorBase; - readonly codes: ReadonlyMap; -} & ansiStyles.BackgroundColor & ansiStyles.ForegroundColor & ansiStyles.Modifier; - -export = ansiStyles; diff --git a/deps/npm/node_modules/base64-js/index.d.ts b/deps/npm/node_modules/base64-js/index.d.ts deleted file mode 100644 index 7d9fa1d97cb668..00000000000000 --- a/deps/npm/node_modules/base64-js/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function byteLength(b64: string): number; -export function toByteArray(b64: string): Uint8Array; -export function fromByteArray(uint8: Uint8Array): string; diff --git a/deps/npm/node_modules/binary-extensions/binary-extensions.json.d.ts b/deps/npm/node_modules/binary-extensions/binary-extensions.json.d.ts deleted file mode 100644 index 94a248c2bcff7d..00000000000000 --- a/deps/npm/node_modules/binary-extensions/binary-extensions.json.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -declare const binaryExtensionsJson: readonly string[]; - -export = binaryExtensionsJson; diff --git a/deps/npm/node_modules/binary-extensions/index.d.ts b/deps/npm/node_modules/binary-extensions/index.d.ts deleted file mode 100644 index f469ac5fb0fe5f..00000000000000 --- a/deps/npm/node_modules/binary-extensions/index.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -/** -List of binary file extensions. - -@example -``` -import binaryExtensions = require('binary-extensions'); - -console.log(binaryExtensions); -//=> ['3ds', '3g2', …] -``` -*/ -declare const binaryExtensions: readonly string[]; - -export = binaryExtensions; diff --git a/deps/npm/node_modules/buffer/index.d.ts b/deps/npm/node_modules/buffer/index.d.ts deleted file mode 100644 index 07096a2f725aac..00000000000000 --- a/deps/npm/node_modules/buffer/index.d.ts +++ /dev/null @@ -1,194 +0,0 @@ -export class Buffer extends Uint8Array { - length: number - write(string: string, offset?: number, length?: number, encoding?: string): number; - toString(encoding?: string, start?: number, end?: number): string; - toJSON(): { type: 'Buffer', data: any[] }; - equals(otherBuffer: Buffer): boolean; - compare(otherBuffer: Uint8Array, targetStart?: number, targetEnd?: number, sourceStart?: number, sourceEnd?: number): number; - copy(targetBuffer: Buffer, targetStart?: number, sourceStart?: number, sourceEnd?: number): number; - slice(start?: number, end?: number): Buffer; - writeUIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; - writeUIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; - writeIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; - writeIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; - readUIntLE(offset: number, byteLength: number, noAssert?: boolean): number; - readUIntBE(offset: number, byteLength: number, noAssert?: boolean): number; - readIntLE(offset: number, byteLength: number, noAssert?: boolean): number; - readIntBE(offset: number, byteLength: number, noAssert?: boolean): number; - readUInt8(offset: number, noAssert?: boolean): number; - readUInt16LE(offset: number, noAssert?: boolean): number; - readUInt16BE(offset: number, noAssert?: boolean): number; - readUInt32LE(offset: number, noAssert?: boolean): number; - readUInt32BE(offset: number, noAssert?: boolean): number; - readBigUInt64LE(offset: number): BigInt; - readBigUInt64BE(offset: number): BigInt; - readInt8(offset: number, noAssert?: boolean): number; - readInt16LE(offset: number, noAssert?: boolean): number; - readInt16BE(offset: number, noAssert?: boolean): number; - readInt32LE(offset: number, noAssert?: boolean): number; - readInt32BE(offset: number, noAssert?: boolean): number; - readBigInt64LE(offset: number): BigInt; - readBigInt64BE(offset: number): BigInt; - readFloatLE(offset: number, noAssert?: boolean): number; - readFloatBE(offset: number, noAssert?: boolean): number; - readDoubleLE(offset: number, noAssert?: boolean): number; - readDoubleBE(offset: number, noAssert?: boolean): number; - reverse(): this; - swap16(): Buffer; - swap32(): Buffer; - swap64(): Buffer; - writeUInt8(value: number, offset: number, noAssert?: boolean): number; - writeUInt16LE(value: number, offset: number, noAssert?: boolean): number; - writeUInt16BE(value: number, offset: number, noAssert?: boolean): number; - writeUInt32LE(value: number, offset: number, noAssert?: boolean): number; - writeUInt32BE(value: number, offset: number, noAssert?: boolean): number; - writeBigUInt64LE(value: number, offset: number): BigInt; - writeBigUInt64BE(value: number, offset: number): BigInt; - writeInt8(value: number, offset: number, noAssert?: boolean): number; - writeInt16LE(value: number, offset: number, noAssert?: boolean): number; - writeInt16BE(value: number, offset: number, noAssert?: boolean): number; - writeInt32LE(value: number, offset: number, noAssert?: boolean): number; - writeInt32BE(value: number, offset: number, noAssert?: boolean): number; - writeBigInt64LE(value: number, offset: number): BigInt; - writeBigInt64BE(value: number, offset: number): BigInt; - writeFloatLE(value: number, offset: number, noAssert?: boolean): number; - writeFloatBE(value: number, offset: number, noAssert?: boolean): number; - writeDoubleLE(value: number, offset: number, noAssert?: boolean): number; - writeDoubleBE(value: number, offset: number, noAssert?: boolean): number; - fill(value: any, offset?: number, end?: number): this; - indexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number; - lastIndexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number; - includes(value: string | number | Buffer, byteOffset?: number, encoding?: string): boolean; - - /** - * Allocates a new buffer containing the given {str}. - * - * @param str String to store in buffer. - * @param encoding encoding to use, optional. Default is 'utf8' - */ - constructor (str: string, encoding?: string); - /** - * Allocates a new buffer of {size} octets. - * - * @param size count of octets to allocate. - */ - constructor (size: number); - /** - * Allocates a new buffer containing the given {array} of octets. - * - * @param array The octets to store. - */ - constructor (array: Uint8Array); - /** - * Produces a Buffer backed by the same allocated memory as - * the given {ArrayBuffer}. - * - * - * @param arrayBuffer The ArrayBuffer with which to share memory. - */ - constructor (arrayBuffer: ArrayBuffer); - /** - * Allocates a new buffer containing the given {array} of octets. - * - * @param array The octets to store. - */ - constructor (array: any[]); - /** - * Copies the passed {buffer} data onto a new {Buffer} instance. - * - * @param buffer The buffer to copy. - */ - constructor (buffer: Buffer); - prototype: Buffer; - /** - * Allocates a new Buffer using an {array} of octets. - * - * @param array - */ - static from(array: any[]): Buffer; - /** - * When passed a reference to the .buffer property of a TypedArray instance, - * the newly created Buffer will share the same allocated memory as the TypedArray. - * The optional {byteOffset} and {length} arguments specify a memory range - * within the {arrayBuffer} that will be shared by the Buffer. - * - * @param arrayBuffer The .buffer property of a TypedArray or a new ArrayBuffer() - * @param byteOffset - * @param length - */ - static from(arrayBuffer: ArrayBuffer, byteOffset?: number, length?: number): Buffer; - /** - * Copies the passed {buffer} data onto a new Buffer instance. - * - * @param buffer - */ - static from(buffer: Buffer | Uint8Array): Buffer; - /** - * Creates a new Buffer containing the given JavaScript string {str}. - * If provided, the {encoding} parameter identifies the character encoding. - * If not provided, {encoding} defaults to 'utf8'. - * - * @param str - */ - static from(str: string, encoding?: string): Buffer; - /** - * Returns true if {obj} is a Buffer - * - * @param obj object to test. - */ - static isBuffer(obj: any): obj is Buffer; - /** - * Returns true if {encoding} is a valid encoding argument. - * Valid string encodings in Node 0.12: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'binary'(deprecated)|'hex' - * - * @param encoding string to test. - */ - static isEncoding(encoding: string): boolean; - /** - * Gives the actual byte length of a string. encoding defaults to 'utf8'. - * This is not the same as String.prototype.length since that returns the number of characters in a string. - * - * @param string string to test. - * @param encoding encoding used to evaluate (defaults to 'utf8') - */ - static byteLength(string: string, encoding?: string): number; - /** - * Returns a buffer which is the result of concatenating all the buffers in the list together. - * - * If the list has no items, or if the totalLength is 0, then it returns a zero-length buffer. - * If the list has exactly one item, then the first item of the list is returned. - * If the list has more than one item, then a new Buffer is created. - * - * @param list An array of Buffer objects to concatenate - * @param totalLength Total length of the buffers when concatenated. - * If totalLength is not provided, it is read from the buffers in the list. However, this adds an additional loop to the function, so it is faster to provide the length explicitly. - */ - static concat(list: Uint8Array[], totalLength?: number): Buffer; - /** - * The same as buf1.compare(buf2). - */ - static compare(buf1: Uint8Array, buf2: Uint8Array): number; - /** - * Allocates a new buffer of {size} octets. - * - * @param size count of octets to allocate. - * @param fill if specified, buffer will be initialized by calling buf.fill(fill). - * If parameter is omitted, buffer will be filled with zeros. - * @param encoding encoding used for call to buf.fill while initializing - */ - static alloc(size: number, fill?: string | Buffer | number, encoding?: string): Buffer; - /** - * Allocates a new buffer of {size} octets, leaving memory not initialized, so the contents - * of the newly created Buffer are unknown and may contain sensitive data. - * - * @param size count of octets to allocate - */ - static allocUnsafe(size: number): Buffer; - /** - * Allocates a new non-pooled buffer of {size} octets, leaving memory not initialized, so the contents - * of the newly created Buffer are unknown and may contain sensitive data. - * - * @param size count of octets to allocate - */ - static allocUnsafeSlow(size: number): Buffer; -} diff --git a/deps/npm/node_modules/cacache/lib/util/glob.js b/deps/npm/node_modules/cacache/lib/util/glob.js index 8908a3aedb4ee9..38b5459c59b294 100644 --- a/deps/npm/node_modules/cacache/lib/util/glob.js +++ b/deps/npm/node_modules/cacache/lib/util/glob.js @@ -1,7 +1,6 @@ 'use strict' -const { promisify } = require('util') -const glob = promisify(require('glob')) +const glob = require('glob') const globify = (pattern) => pattern.split('//').join('/') module.exports = (path, options) => glob(globify(path), options) diff --git a/deps/npm/node_modules/cacache/package.json b/deps/npm/node_modules/cacache/package.json index 189a19bf315976..e3a0ab6a610039 100644 --- a/deps/npm/node_modules/cacache/package.json +++ b/deps/npm/node_modules/cacache/package.json @@ -1,6 +1,6 @@ { "name": "cacache", - "version": "17.0.4", + "version": "17.0.5", "cache-version": { "content": "2", "index": "5" @@ -47,7 +47,7 @@ "dependencies": { "@npmcli/fs": "^3.1.0", "fs-minipass": "^3.0.0", - "glob": "^8.0.1", + "glob": "^9.3.1", "lru-cache": "^7.7.1", "minipass": "^4.0.0", "minipass-collect": "^1.0.2", @@ -61,7 +61,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.11.0", + "@npmcli/template-oss": "4.12.0", "tap": "^16.0.0" }, "engines": { @@ -70,7 +70,7 @@ "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", "windowsCI": false, - "version": "4.11.0" + "version": "4.12.0" }, "author": "GitHub Inc.", "tap": { diff --git a/deps/npm/node_modules/chalk/index.d.ts b/deps/npm/node_modules/chalk/index.d.ts deleted file mode 100644 index 9cd88f38beea87..00000000000000 --- a/deps/npm/node_modules/chalk/index.d.ts +++ /dev/null @@ -1,415 +0,0 @@ -/** -Basic foreground colors. - -[More colors here.](https://github.com/chalk/chalk/blob/master/readme.md#256-and-truecolor-color-support) -*/ -declare type ForegroundColor = - | 'black' - | 'red' - | 'green' - | 'yellow' - | 'blue' - | 'magenta' - | 'cyan' - | 'white' - | 'gray' - | 'grey' - | 'blackBright' - | 'redBright' - | 'greenBright' - | 'yellowBright' - | 'blueBright' - | 'magentaBright' - | 'cyanBright' - | 'whiteBright'; - -/** -Basic background colors. - -[More colors here.](https://github.com/chalk/chalk/blob/master/readme.md#256-and-truecolor-color-support) -*/ -declare type BackgroundColor = - | 'bgBlack' - | 'bgRed' - | 'bgGreen' - | 'bgYellow' - | 'bgBlue' - | 'bgMagenta' - | 'bgCyan' - | 'bgWhite' - | 'bgGray' - | 'bgGrey' - | 'bgBlackBright' - | 'bgRedBright' - | 'bgGreenBright' - | 'bgYellowBright' - | 'bgBlueBright' - | 'bgMagentaBright' - | 'bgCyanBright' - | 'bgWhiteBright'; - -/** -Basic colors. - -[More colors here.](https://github.com/chalk/chalk/blob/master/readme.md#256-and-truecolor-color-support) -*/ -declare type Color = ForegroundColor | BackgroundColor; - -declare type Modifiers = - | 'reset' - | 'bold' - | 'dim' - | 'italic' - | 'underline' - | 'inverse' - | 'hidden' - | 'strikethrough' - | 'visible'; - -declare namespace chalk { - /** - Levels: - - `0` - All colors disabled. - - `1` - Basic 16 colors support. - - `2` - ANSI 256 colors support. - - `3` - Truecolor 16 million colors support. - */ - type Level = 0 | 1 | 2 | 3; - - interface Options { - /** - Specify the color support for Chalk. - - By default, color support is automatically detected based on the environment. - - Levels: - - `0` - All colors disabled. - - `1` - Basic 16 colors support. - - `2` - ANSI 256 colors support. - - `3` - Truecolor 16 million colors support. - */ - level?: Level; - } - - /** - Return a new Chalk instance. - */ - type Instance = new (options?: Options) => Chalk; - - /** - Detect whether the terminal supports color. - */ - interface ColorSupport { - /** - The color level used by Chalk. - */ - level: Level; - - /** - Return whether Chalk supports basic 16 colors. - */ - hasBasic: boolean; - - /** - Return whether Chalk supports ANSI 256 colors. - */ - has256: boolean; - - /** - Return whether Chalk supports Truecolor 16 million colors. - */ - has16m: boolean; - } - - interface ChalkFunction { - /** - Use a template string. - - @remarks Template literals are unsupported for nested calls (see [issue #341](https://github.com/chalk/chalk/issues/341)) - - @example - ``` - import chalk = require('chalk'); - - log(chalk` - CPU: {red ${cpu.totalPercent}%} - RAM: {green ${ram.used / ram.total * 100}%} - DISK: {rgb(255,131,0) ${disk.used / disk.total * 100}%} - `); - ``` - - @example - ``` - import chalk = require('chalk'); - - log(chalk.red.bgBlack`2 + 3 = {bold ${2 + 3}}`) - ``` - */ - (text: TemplateStringsArray, ...placeholders: unknown[]): string; - - (...text: unknown[]): string; - } - - interface Chalk extends ChalkFunction { - /** - Return a new Chalk instance. - */ - Instance: Instance; - - /** - The color support for Chalk. - - By default, color support is automatically detected based on the environment. - - Levels: - - `0` - All colors disabled. - - `1` - Basic 16 colors support. - - `2` - ANSI 256 colors support. - - `3` - Truecolor 16 million colors support. - */ - level: Level; - - /** - Use HEX value to set text color. - - @param color - Hexadecimal value representing the desired color. - - @example - ``` - import chalk = require('chalk'); - - chalk.hex('#DEADED'); - ``` - */ - hex(color: string): Chalk; - - /** - Use keyword color value to set text color. - - @param color - Keyword value representing the desired color. - - @example - ``` - import chalk = require('chalk'); - - chalk.keyword('orange'); - ``` - */ - keyword(color: string): Chalk; - - /** - Use RGB values to set text color. - */ - rgb(red: number, green: number, blue: number): Chalk; - - /** - Use HSL values to set text color. - */ - hsl(hue: number, saturation: number, lightness: number): Chalk; - - /** - Use HSV values to set text color. - */ - hsv(hue: number, saturation: number, value: number): Chalk; - - /** - Use HWB values to set text color. - */ - hwb(hue: number, whiteness: number, blackness: number): Chalk; - - /** - Use a [Select/Set Graphic Rendition](https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_parameters) (SGR) [color code number](https://en.wikipedia.org/wiki/ANSI_escape_code#3/4_bit) to set text color. - - 30 <= code && code < 38 || 90 <= code && code < 98 - For example, 31 for red, 91 for redBright. - */ - ansi(code: number): Chalk; - - /** - Use a [8-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) to set text color. - */ - ansi256(index: number): Chalk; - - /** - Use HEX value to set background color. - - @param color - Hexadecimal value representing the desired color. - - @example - ``` - import chalk = require('chalk'); - - chalk.bgHex('#DEADED'); - ``` - */ - bgHex(color: string): Chalk; - - /** - Use keyword color value to set background color. - - @param color - Keyword value representing the desired color. - - @example - ``` - import chalk = require('chalk'); - - chalk.bgKeyword('orange'); - ``` - */ - bgKeyword(color: string): Chalk; - - /** - Use RGB values to set background color. - */ - bgRgb(red: number, green: number, blue: number): Chalk; - - /** - Use HSL values to set background color. - */ - bgHsl(hue: number, saturation: number, lightness: number): Chalk; - - /** - Use HSV values to set background color. - */ - bgHsv(hue: number, saturation: number, value: number): Chalk; - - /** - Use HWB values to set background color. - */ - bgHwb(hue: number, whiteness: number, blackness: number): Chalk; - - /** - Use a [Select/Set Graphic Rendition](https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_parameters) (SGR) [color code number](https://en.wikipedia.org/wiki/ANSI_escape_code#3/4_bit) to set background color. - - 30 <= code && code < 38 || 90 <= code && code < 98 - For example, 31 for red, 91 for redBright. - Use the foreground code, not the background code (for example, not 41, nor 101). - */ - bgAnsi(code: number): Chalk; - - /** - Use a [8-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) to set background color. - */ - bgAnsi256(index: number): Chalk; - - /** - Modifier: Resets the current color chain. - */ - readonly reset: Chalk; - - /** - Modifier: Make text bold. - */ - readonly bold: Chalk; - - /** - Modifier: Emitting only a small amount of light. - */ - readonly dim: Chalk; - - /** - Modifier: Make text italic. (Not widely supported) - */ - readonly italic: Chalk; - - /** - Modifier: Make text underline. (Not widely supported) - */ - readonly underline: Chalk; - - /** - Modifier: Inverse background and foreground colors. - */ - readonly inverse: Chalk; - - /** - Modifier: Prints the text, but makes it invisible. - */ - readonly hidden: Chalk; - - /** - Modifier: Puts a horizontal line through the center of the text. (Not widely supported) - */ - readonly strikethrough: Chalk; - - /** - Modifier: Prints the text only when Chalk has a color support level > 0. - Can be useful for things that are purely cosmetic. - */ - readonly visible: Chalk; - - readonly black: Chalk; - readonly red: Chalk; - readonly green: Chalk; - readonly yellow: Chalk; - readonly blue: Chalk; - readonly magenta: Chalk; - readonly cyan: Chalk; - readonly white: Chalk; - - /* - Alias for `blackBright`. - */ - readonly gray: Chalk; - - /* - Alias for `blackBright`. - */ - readonly grey: Chalk; - - readonly blackBright: Chalk; - readonly redBright: Chalk; - readonly greenBright: Chalk; - readonly yellowBright: Chalk; - readonly blueBright: Chalk; - readonly magentaBright: Chalk; - readonly cyanBright: Chalk; - readonly whiteBright: Chalk; - - readonly bgBlack: Chalk; - readonly bgRed: Chalk; - readonly bgGreen: Chalk; - readonly bgYellow: Chalk; - readonly bgBlue: Chalk; - readonly bgMagenta: Chalk; - readonly bgCyan: Chalk; - readonly bgWhite: Chalk; - - /* - Alias for `bgBlackBright`. - */ - readonly bgGray: Chalk; - - /* - Alias for `bgBlackBright`. - */ - readonly bgGrey: Chalk; - - readonly bgBlackBright: Chalk; - readonly bgRedBright: Chalk; - readonly bgGreenBright: Chalk; - readonly bgYellowBright: Chalk; - readonly bgBlueBright: Chalk; - readonly bgMagentaBright: Chalk; - readonly bgCyanBright: Chalk; - readonly bgWhiteBright: Chalk; - } -} - -/** -Main Chalk object that allows to chain styles together. -Call the last one as a method with a string argument. -Order doesn't matter, and later styles take precedent in case of a conflict. -This simply means that `chalk.red.yellow.green` is equivalent to `chalk.green`. -*/ -declare const chalk: chalk.Chalk & chalk.ChalkFunction & { - supportsColor: chalk.ColorSupport | false; - Level: chalk.Level; - Color: Color; - ForegroundColor: ForegroundColor; - BackgroundColor: BackgroundColor; - Modifiers: Modifiers; - stderr: chalk.Chalk & {supportsColor: chalk.ColorSupport | false}; -}; - -export = chalk; diff --git a/deps/npm/node_modules/ci-info/index.d.ts b/deps/npm/node_modules/ci-info/index.d.ts deleted file mode 100644 index 8aebdcf25858d2..00000000000000 --- a/deps/npm/node_modules/ci-info/index.d.ts +++ /dev/null @@ -1,75 +0,0 @@ -// This file is generated at pre-commit by running `node create-typings.js`. - -/** - * Returns a boolean. Will be `true` if the code is running on a CI server, - * otherwise `false`. - * - * Some CI servers not listed here might still trigger the `ci.isCI` - * boolean to be set to `true` if they use certain vendor neutral environment - * variables. In those cases `ci.name` will be `null` and no vendor specific - * boolean will be set to `true`. - */ -export const isCI: boolean; -/** - * Returns a boolean if PR detection is supported for the current CI server. - * Will be `true` if a PR is being tested, otherwise `false`. If PR detection is - * not supported for the current CI server, the value will be `null`. - */ -export const isPR: boolean | null; -/** - * Returns a string containing name of the CI server the code is running on. If - * CI server is not detected, it returns `null`. - * - * Don't depend on the value of this string not to change for a specific vendor. - * If you find your self writing `ci.name === 'Travis CI'`, you most likely want - * to use `ci.TRAVIS` instead. - */ -export const name: string | null; - -export const APPCIRCLE: boolean; -export const APPVEYOR: boolean; -export const CODEBUILD: boolean; -export const AZURE_PIPELINES: boolean; -export const BAMBOO: boolean; -export const BITBUCKET: boolean; -export const BITRISE: boolean; -export const BUDDY: boolean; -export const BUILDKITE: boolean; -export const CIRCLE: boolean; -export const CIRRUS: boolean; -export const CODEFRESH: boolean; -export const CODEMAGIC: boolean; -export const CODESHIP: boolean; -export const DRONE: boolean; -export const DSARI: boolean; -export const EAS: boolean; -export const GERRIT: boolean; -export const GITHUB_ACTIONS: boolean; -export const GITLAB: boolean; -export const GOCD: boolean; -export const GOOGLE_CLOUD_BUILD: boolean; -export const HARNESS: boolean; -export const HEROKU: boolean; -export const HUDSON: boolean; -export const JENKINS: boolean; -export const LAYERCI: boolean; -export const MAGNUM: boolean; -export const NETLIFY: boolean; -export const NEVERCODE: boolean; -export const RELEASEHUB: boolean; -export const RENDER: boolean; -export const SAIL: boolean; -export const SCREWDRIVER: boolean; -export const SEMAPHORE: boolean; -export const SHIPPABLE: boolean; -export const SOLANO: boolean; -export const SOURCEHUT: boolean; -export const STRIDER: boolean; -export const TASKCLUSTER: boolean; -export const TEAMCITY: boolean; -export const TRAVIS: boolean; -export const VERCEL: boolean; -export const APPCENTER: boolean; -export const WOODPECKER: boolean; -export const XCODE_CLOUD: boolean; -export const XCODE_SERVER: boolean; diff --git a/deps/npm/node_modules/cidr-regex/index.d.ts b/deps/npm/node_modules/cidr-regex/index.d.ts deleted file mode 100644 index 9099caecc8e2a2..00000000000000 --- a/deps/npm/node_modules/cidr-regex/index.d.ts +++ /dev/null @@ -1,55 +0,0 @@ -declare namespace ip { - interface Options { - /** - Only match an exact string. Useful with `RegExp#test()` to check if a string is a CIDR IP address. *(`false` matches any CIDR IP address in a string)* - - @default false - */ - readonly exact?: boolean; - } -} - -declare const ip: { - /** - Regular expression for matching IP addresses in CIDR notation. - - @returns A regex for matching both IPv4 and IPv6 CIDR IP addresses. - - @example - ``` - import cidrRegex = require("cidr-regex"); - - // Contains a CIDR IP address? - cidrRegex().test("foo 192.168.0.1/24"); - //=> true - - // Is a CIDR IP address? - cidrRegex({exact: true}).test("foo 192.168.0.1/24"); - //=> false - - "foo 192.168.0.1/24 bar 1:2:3:4:5:6:7:8/64 baz".match(cidrRegex()); - //=> ["192.168.0.1/24", "1:2:3:4:5:6:7:8/64"] - ``` - */ - (options?: ip.Options): RegExp; - - /** - @returns A regex for matching IPv4 CIDR IP addresses. - */ - v4(options?: ip.Options): RegExp; - - /** - @returns A regex for matching IPv6 CIDR IP addresses. - - @example - ``` - import cidrRegex = require("cidr-regex"); - - cidrRegex.v6({exact: true}).test("1:2:3:4:5:6:7:8/64"); - //=> true - ``` - */ - v6(options?: ip.Options): RegExp; -}; - -export = ip; diff --git a/deps/npm/node_modules/clean-stack/index.d.ts b/deps/npm/node_modules/clean-stack/index.d.ts deleted file mode 100644 index ed5899509419c1..00000000000000 --- a/deps/npm/node_modules/clean-stack/index.d.ts +++ /dev/null @@ -1,47 +0,0 @@ -declare namespace cleanStack { - interface Options { - /** - Prettify the file paths in the stack: - - `/Users/sindresorhus/dev/clean-stack/unicorn.js:2:15` → `~/dev/clean-stack/unicorn.js:2:15` - - @default false - */ - readonly pretty?: boolean; - } -} - -/** -Clean up error stack traces. Removes the mostly unhelpful internal Node.js entries. - -@param stack - The `stack` property of an `Error`. - -@example -``` -import cleanStack = require('clean-stack'); - -const error = new Error('Missing unicorn'); - -console.log(error.stack); - -// Error: Missing unicorn -// at Object. (/Users/sindresorhus/dev/clean-stack/unicorn.js:2:15) -// at Module._compile (module.js:409:26) -// at Object.Module._extensions..js (module.js:416:10) -// at Module.load (module.js:343:32) -// at Function.Module._load (module.js:300:12) -// at Function.Module.runMain (module.js:441:10) -// at startup (node.js:139:18) - -console.log(cleanStack(error.stack)); - -// Error: Missing unicorn -// at Object. (/Users/sindresorhus/dev/clean-stack/unicorn.js:2:15) -``` -*/ -declare function cleanStack( - stack: string, - options?: cleanStack.Options -): string; - -export = cleanStack; diff --git a/deps/npm/node_modules/cli-table3/index.d.ts b/deps/npm/node_modules/cli-table3/index.d.ts deleted file mode 100644 index 16980f848cc8ec..00000000000000 --- a/deps/npm/node_modules/cli-table3/index.d.ts +++ /dev/null @@ -1,93 +0,0 @@ -declare namespace CliTable3 { - type CharName = - "top" | - "top-mid" | - "top-left" | - "top-right" | - "bottom" | - "bottom-mid" | - "bottom-left" | - "bottom-right" | - "left" | - "left-mid" | - "mid" | - "mid-mid" | - "right" | - "right-mid" | - "middle"; - - type HorizontalAlignment = "left" | "center" | "right"; - type VerticalAlignment = "top" | "center" | "bottom"; - - interface TableOptions { - truncate: string; - colWidths: Array; - rowHeights: Array; - colAligns: HorizontalAlignment[]; - rowAligns: VerticalAlignment[]; - head: string[]; - wordWrap: boolean; - wrapOnWordBoundary: boolean; - } - - interface TableInstanceOptions extends TableOptions { - chars: Record; - style: { - "padding-left": number; - "padding-right": number; - head: string[]; - border: string[]; - compact: boolean; - }; - } - - interface TableConstructorOptions extends Partial { - chars?: Partial>; - style?: Partial; - } - - type CellValue = boolean | number | string | null | undefined; - - interface CellOptions { - content: CellValue; - chars?: Partial>; - truncate?: string; - colSpan?: number; - rowSpan?: number; - hAlign?: HorizontalAlignment; - vAlign?: VerticalAlignment; - style?: { - "padding-left"?: number; - "padding-right"?: number; - head?: string[]; - border?: string[]; - }; - } - - interface GenericTable extends Array { - options: TableInstanceOptions; - readonly width: number; - } - - type Table = GenericTable; - type Cell = CellValue | CellOptions; - - type HorizontalTableRow = Cell[]; - - interface VerticalTableRow { - [name: string]: Cell; - } - - interface CrossTableRow { - [name: string]: Cell[]; - } -} - -interface CliTable3 { - new (options?: CliTable3.TableConstructorOptions): CliTable3.Table; - readonly prototype: CliTable3.Table; -} - -declare const CliTable3: CliTable3; - -export = CliTable3; diff --git a/deps/npm/node_modules/depd/History.md b/deps/npm/node_modules/depd/History.md index 507ecb8de21d5d..cd9ebaaa9963f7 100644 --- a/deps/npm/node_modules/depd/History.md +++ b/deps/npm/node_modules/depd/History.md @@ -1,3 +1,10 @@ +2.0.0 / 2018-10-26 +================== + + * Drop support for Node.js 0.6 + * Replace internal `eval` usage with `Function` constructor + * Use instance methods on `process` to check for listeners + 1.1.2 / 2018-01-11 ================== diff --git a/deps/npm/node_modules/depd/LICENSE b/deps/npm/node_modules/depd/LICENSE index 84441fbb570926..248de7af2bd16c 100644 --- a/deps/npm/node_modules/depd/LICENSE +++ b/deps/npm/node_modules/depd/LICENSE @@ -1,6 +1,6 @@ (The MIT License) -Copyright (c) 2014-2017 Douglas Christopher Wilson +Copyright (c) 2014-2018 Douglas Christopher Wilson Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff --git a/deps/npm/node_modules/depd/index.js b/deps/npm/node_modules/depd/index.js index d758d3c8f58a60..1bf2fcfdeffc98 100644 --- a/deps/npm/node_modules/depd/index.js +++ b/deps/npm/node_modules/depd/index.js @@ -1,6 +1,6 @@ /*! * depd - * Copyright(c) 2014-2017 Douglas Christopher Wilson + * Copyright(c) 2014-2018 Douglas Christopher Wilson * MIT Licensed */ @@ -8,8 +8,6 @@ * Module dependencies. */ -var callSiteToString = require('./lib/compat').callSiteToString -var eventListenerCount = require('./lib/compat').eventListenerCount var relative = require('path').relative /** @@ -92,7 +90,7 @@ function createStackString (stack) { } for (var i = 0; i < stack.length; i++) { - str += '\n at ' + callSiteToString(stack[i]) + str += '\n at ' + stack[i].toString() } return str @@ -128,12 +126,31 @@ function depd (namespace) { return deprecate } +/** + * Determine if event emitter has listeners of a given type. + * + * The way to do this check is done three different ways in Node.js >= 0.8 + * so this consolidates them into a minimal set using instance methods. + * + * @param {EventEmitter} emitter + * @param {string} type + * @returns {boolean} + * @private + */ + +function eehaslisteners (emitter, type) { + var count = typeof emitter.listenerCount !== 'function' + ? emitter.listeners(type).length + : emitter.listenerCount(type) + + return count > 0 +} + /** * Determine if namespace is ignored. */ function isignored (namespace) { - /* istanbul ignore next: tested in a child processs */ if (process.noDeprecation) { // --no-deprecation support return true @@ -150,7 +167,6 @@ function isignored (namespace) { */ function istraced (namespace) { - /* istanbul ignore next: tested in a child processs */ if (process.traceDeprecation) { // --trace-deprecation support return true @@ -167,7 +183,7 @@ function istraced (namespace) { */ function log (message, site) { - var haslisteners = eventListenerCount(process, 'deprecation') !== 0 + var haslisteners = eehaslisteners(process, 'deprecation') // abort early if no destination if (!haslisteners && this._ignored) { @@ -310,7 +326,7 @@ function formatPlain (msg, caller, stack) { // add stack trace if (this._traced) { for (var i = 0; i < stack.length; i++) { - formatted += '\n at ' + callSiteToString(stack[i]) + formatted += '\n at ' + stack[i].toString() } return formatted @@ -335,7 +351,7 @@ function formatColor (msg, caller, stack) { // add stack trace if (this._traced) { for (var i = 0; i < stack.length; i++) { - formatted += '\n \x1b[36mat ' + callSiteToString(stack[i]) + '\x1b[39m' // cyan + formatted += '\n \x1b[36mat ' + stack[i].toString() + '\x1b[39m' // cyan } return formatted @@ -400,18 +416,18 @@ function wrapfunction (fn, message) { } var args = createArgumentsString(fn.length) - var deprecate = this // eslint-disable-line no-unused-vars var stack = getStack() var site = callSiteLocation(stack[1]) site.name = fn.name - // eslint-disable-next-line no-eval - var deprecatedfn = eval('(function (' + args + ') {\n' + + // eslint-disable-next-line no-new-func + var deprecatedfn = new Function('fn', 'log', 'deprecate', 'message', 'site', '"use strict"\n' + + 'return function (' + args + ') {' + 'log.call(deprecate, message, site)\n' + 'return fn.apply(this, arguments)\n' + - '})') + '}')(fn, log, this, message, site) return deprecatedfn } diff --git a/deps/npm/node_modules/depd/lib/compat/callsite-tostring.js b/deps/npm/node_modules/depd/lib/compat/callsite-tostring.js deleted file mode 100644 index 73186dc644a366..00000000000000 --- a/deps/npm/node_modules/depd/lib/compat/callsite-tostring.js +++ /dev/null @@ -1,103 +0,0 @@ -/*! - * depd - * Copyright(c) 2014 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict' - -/** - * Module exports. - */ - -module.exports = callSiteToString - -/** - * Format a CallSite file location to a string. - */ - -function callSiteFileLocation (callSite) { - var fileName - var fileLocation = '' - - if (callSite.isNative()) { - fileLocation = 'native' - } else if (callSite.isEval()) { - fileName = callSite.getScriptNameOrSourceURL() - if (!fileName) { - fileLocation = callSite.getEvalOrigin() - } - } else { - fileName = callSite.getFileName() - } - - if (fileName) { - fileLocation += fileName - - var lineNumber = callSite.getLineNumber() - if (lineNumber != null) { - fileLocation += ':' + lineNumber - - var columnNumber = callSite.getColumnNumber() - if (columnNumber) { - fileLocation += ':' + columnNumber - } - } - } - - return fileLocation || 'unknown source' -} - -/** - * Format a CallSite to a string. - */ - -function callSiteToString (callSite) { - var addSuffix = true - var fileLocation = callSiteFileLocation(callSite) - var functionName = callSite.getFunctionName() - var isConstructor = callSite.isConstructor() - var isMethodCall = !(callSite.isToplevel() || isConstructor) - var line = '' - - if (isMethodCall) { - var methodName = callSite.getMethodName() - var typeName = getConstructorName(callSite) - - if (functionName) { - if (typeName && functionName.indexOf(typeName) !== 0) { - line += typeName + '.' - } - - line += functionName - - if (methodName && functionName.lastIndexOf('.' + methodName) !== functionName.length - methodName.length - 1) { - line += ' [as ' + methodName + ']' - } - } else { - line += typeName + '.' + (methodName || '') - } - } else if (isConstructor) { - line += 'new ' + (functionName || '') - } else if (functionName) { - line += functionName - } else { - addSuffix = false - line += fileLocation - } - - if (addSuffix) { - line += ' (' + fileLocation + ')' - } - - return line -} - -/** - * Get constructor name of reviver. - */ - -function getConstructorName (obj) { - var receiver = obj.receiver - return (receiver.constructor && receiver.constructor.name) || null -} diff --git a/deps/npm/node_modules/depd/lib/compat/event-listener-count.js b/deps/npm/node_modules/depd/lib/compat/event-listener-count.js deleted file mode 100644 index 3a8925d136ae6e..00000000000000 --- a/deps/npm/node_modules/depd/lib/compat/event-listener-count.js +++ /dev/null @@ -1,22 +0,0 @@ -/*! - * depd - * Copyright(c) 2015 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict' - -/** - * Module exports. - * @public - */ - -module.exports = eventListenerCount - -/** - * Get the count of listeners on an event emitter of a specific type. - */ - -function eventListenerCount (emitter, type) { - return emitter.listeners(type).length -} diff --git a/deps/npm/node_modules/depd/lib/compat/index.js b/deps/npm/node_modules/depd/lib/compat/index.js deleted file mode 100644 index 955b3336b25e79..00000000000000 --- a/deps/npm/node_modules/depd/lib/compat/index.js +++ /dev/null @@ -1,79 +0,0 @@ -/*! - * depd - * Copyright(c) 2014-2015 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict' - -/** - * Module dependencies. - * @private - */ - -var EventEmitter = require('events').EventEmitter - -/** - * Module exports. - * @public - */ - -lazyProperty(module.exports, 'callSiteToString', function callSiteToString () { - var limit = Error.stackTraceLimit - var obj = {} - var prep = Error.prepareStackTrace - - function prepareObjectStackTrace (obj, stack) { - return stack - } - - Error.prepareStackTrace = prepareObjectStackTrace - Error.stackTraceLimit = 2 - - // capture the stack - Error.captureStackTrace(obj) - - // slice the stack - var stack = obj.stack.slice() - - Error.prepareStackTrace = prep - Error.stackTraceLimit = limit - - return stack[0].toString ? toString : require('./callsite-tostring') -}) - -lazyProperty(module.exports, 'eventListenerCount', function eventListenerCount () { - return EventEmitter.listenerCount || require('./event-listener-count') -}) - -/** - * Define a lazy property. - */ - -function lazyProperty (obj, prop, getter) { - function get () { - var val = getter() - - Object.defineProperty(obj, prop, { - configurable: true, - enumerable: true, - value: val - }) - - return val - } - - Object.defineProperty(obj, prop, { - configurable: true, - enumerable: true, - get: get - }) -} - -/** - * Call toString() on the obj - */ - -function toString (obj) { - return obj.toString() -} diff --git a/deps/npm/node_modules/depd/package.json b/deps/npm/node_modules/depd/package.json index 5e3c863216e40f..3857e199184a0a 100644 --- a/deps/npm/node_modules/depd/package.json +++ b/deps/npm/node_modules/depd/package.json @@ -1,7 +1,7 @@ { "name": "depd", "description": "Deprecate all the things", - "version": "1.1.2", + "version": "2.0.0", "author": "Douglas Christopher Wilson ", "license": "MIT", "keywords": [ @@ -13,13 +13,17 @@ "devDependencies": { "benchmark": "2.1.4", "beautify-benchmark": "0.2.4", - "eslint": "3.19.0", - "eslint-config-standard": "7.1.0", + "eslint": "5.7.0", + "eslint-config-standard": "12.0.0", + "eslint-plugin-import": "2.14.0", "eslint-plugin-markdown": "1.0.0-beta.7", - "eslint-plugin-promise": "3.6.0", - "eslint-plugin-standard": "3.0.1", + "eslint-plugin-node": "7.0.1", + "eslint-plugin-promise": "4.0.1", + "eslint-plugin-standard": "4.0.0", "istanbul": "0.4.5", - "mocha": "~1.21.5" + "mocha": "5.2.0", + "safe-buffer": "5.1.2", + "uid-safe": "2.1.5" }, "files": [ "lib/", @@ -29,13 +33,13 @@ "Readme.md" ], "engines": { - "node": ">= 0.6" + "node": ">= 0.8" }, "scripts": { "bench": "node benchmark/index.js", "lint": "eslint --plugin markdown --ext js,md .", "test": "mocha --reporter spec --bail test/", - "test-ci": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --no-exit test/", - "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot test/" + "test-ci": "istanbul cover --print=none node_modules/mocha/bin/_mocha -- --reporter spec test/ && istanbul report lcovonly text-summary", + "test-cov": "istanbul cover --print=none node_modules/mocha/bin/_mocha -- --reporter dot test/ && istanbul report lcov text-summary" } } diff --git a/deps/npm/node_modules/emoji-regex/index.d.ts b/deps/npm/node_modules/emoji-regex/index.d.ts deleted file mode 100644 index 1955b4704ecfc9..00000000000000 --- a/deps/npm/node_modules/emoji-regex/index.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -declare module 'emoji-regex' { - function emojiRegex(): RegExp; - - export default emojiRegex; -} - -declare module 'emoji-regex/text' { - function emojiRegex(): RegExp; - - export default emojiRegex; -} - -declare module 'emoji-regex/es2015' { - function emojiRegex(): RegExp; - - export default emojiRegex; -} - -declare module 'emoji-regex/es2015/text' { - function emojiRegex(): RegExp; - - export default emojiRegex; -} diff --git a/deps/npm/node_modules/env-paths/index.d.ts b/deps/npm/node_modules/env-paths/index.d.ts deleted file mode 100644 index 277ddc0a183c97..00000000000000 --- a/deps/npm/node_modules/env-paths/index.d.ts +++ /dev/null @@ -1,101 +0,0 @@ -declare namespace envPaths { - export interface Options { - /** - __Don't use this option unless you really have to!__ - - Suffix appended to the project name to avoid name conflicts with native apps. Pass an empty string to disable it. - - @default 'nodejs' - */ - readonly suffix?: string; - } - - export interface Paths { - /** - Directory for data files. - - Example locations (with the default `nodejs` suffix): - - - macOS: `~/Library/Application Support/MyApp-nodejs` - - Windows: `%LOCALAPPDATA%\MyApp-nodejs\Data` (for example, `C:\Users\USERNAME\AppData\Local\MyApp-nodejs\Data`) - - Linux: `~/.local/share/MyApp-nodejs` (or `$XDG_DATA_HOME/MyApp-nodejs`) - */ - readonly data: string; - - /** - Directory for data files. - - Example locations (with the default `nodejs` suffix): - - - macOS: `~/Library/Preferences/MyApp-nodejs` - - Windows: `%APPDATA%\MyApp-nodejs\Config` (for example, `C:\Users\USERNAME\AppData\Roaming\MyApp-nodejs\Config`) - - Linux: `~/.config/MyApp-nodejs` (or `$XDG_CONFIG_HOME/MyApp-nodejs`) - */ - readonly config: string; - - /** - Directory for non-essential data files. - - Example locations (with the default `nodejs` suffix): - - - macOS: `~/Library/Caches/MyApp-nodejs` - - Windows: `%LOCALAPPDATA%\MyApp-nodejs\Cache` (for example, `C:\Users\USERNAME\AppData\Local\MyApp-nodejs\Cache`) - - Linux: `~/.cache/MyApp-nodejs` (or `$XDG_CACHE_HOME/MyApp-nodejs`) - */ - readonly cache: string; - - /** - Directory for log files. - - Example locations (with the default `nodejs` suffix): - - - macOS: `~/Library/Logs/MyApp-nodejs` - - Windows: `%LOCALAPPDATA%\MyApp-nodejs\Log` (for example, `C:\Users\USERNAME\AppData\Local\MyApp-nodejs\Log`) - - Linux: `~/.local/state/MyApp-nodejs` (or `$XDG_STATE_HOME/MyApp-nodejs`) - */ - readonly log: string; - - /** - Directory for temporary files. - - Example locations (with the default `nodejs` suffix): - - - macOS: `/var/folders/jf/f2twvvvs5jl_m49tf034ffpw0000gn/T/MyApp-nodejs` - - Windows: `%LOCALAPPDATA%\Temp\MyApp-nodejs` (for example, `C:\Users\USERNAME\AppData\Local\Temp\MyApp-nodejs`) - - Linux: `/tmp/USERNAME/MyApp-nodejs` - */ - readonly temp: string; - } -} - -declare const envPaths: { - /** - Get paths for storing things like data, config, cache, etc. - - Note: It only generates the path strings. It doesn't create the directories for you. You could use [`make-dir`](https://github.com/sindresorhus/make-dir) to create the directories. - - @param name - Name of your project. Used to generate the paths. - @returns The paths to use for your project on current OS. - - @example - ``` - import envPaths = require('env-paths'); - - const paths = envPaths('MyApp'); - - paths.data; - //=> '/home/sindresorhus/.local/share/MyApp-nodejs' - - paths.config - //=> '/home/sindresorhus/.config/MyApp-nodejs' - ``` - */ - (name: string, options?: envPaths.Options): envPaths.Paths; - - // TODO: Remove this for the next major release, refactor the whole definition to: - // declare function envPaths(name: string, options?: envPaths.Options): envPaths.Paths; - // export = envPaths; - default: typeof envPaths; -}; - -export = envPaths; diff --git a/deps/npm/node_modules/event-target-shim/dist/event-target-shim.js.map b/deps/npm/node_modules/event-target-shim/dist/event-target-shim.js.map deleted file mode 100644 index 83c5f626aa6705..00000000000000 --- a/deps/npm/node_modules/event-target-shim/dist/event-target-shim.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"event-target-shim.js","sources":["../src/event.mjs","../src/event-target.mjs"],"sourcesContent":["/**\n * @typedef {object} PrivateData\n * @property {EventTarget} eventTarget The event target.\n * @property {{type:string}} event The original event object.\n * @property {number} eventPhase The current event phase.\n * @property {EventTarget|null} currentTarget The current event target.\n * @property {boolean} canceled The flag to prevent default.\n * @property {boolean} stopped The flag to stop propagation.\n * @property {boolean} immediateStopped The flag to stop propagation immediately.\n * @property {Function|null} passiveListener The listener if the current listener is passive. Otherwise this is null.\n * @property {number} timeStamp The unix time.\n * @private\n */\n\n/**\n * Private data for event wrappers.\n * @type {WeakMap}\n * @private\n */\nconst privateData = new WeakMap()\n\n/**\n * Cache for wrapper classes.\n * @type {WeakMap}\n * @private\n */\nconst wrappers = new WeakMap()\n\n/**\n * Get private data.\n * @param {Event} event The event object to get private data.\n * @returns {PrivateData} The private data of the event.\n * @private\n */\nfunction pd(event) {\n const retv = privateData.get(event)\n console.assert(\n retv != null,\n \"'this' is expected an Event object, but got\",\n event\n )\n return retv\n}\n\n/**\n * https://dom.spec.whatwg.org/#set-the-canceled-flag\n * @param data {PrivateData} private data.\n */\nfunction setCancelFlag(data) {\n if (data.passiveListener != null) {\n if (\n typeof console !== \"undefined\" &&\n typeof console.error === \"function\"\n ) {\n console.error(\n \"Unable to preventDefault inside passive event listener invocation.\",\n data.passiveListener\n )\n }\n return\n }\n if (!data.event.cancelable) {\n return\n }\n\n data.canceled = true\n if (typeof data.event.preventDefault === \"function\") {\n data.event.preventDefault()\n }\n}\n\n/**\n * @see https://dom.spec.whatwg.org/#interface-event\n * @private\n */\n/**\n * The event wrapper.\n * @constructor\n * @param {EventTarget} eventTarget The event target of this dispatching.\n * @param {Event|{type:string}} event The original event to wrap.\n */\nfunction Event(eventTarget, event) {\n privateData.set(this, {\n eventTarget,\n event,\n eventPhase: 2,\n currentTarget: eventTarget,\n canceled: false,\n stopped: false,\n immediateStopped: false,\n passiveListener: null,\n timeStamp: event.timeStamp || Date.now(),\n })\n\n // https://heycam.github.io/webidl/#Unforgeable\n Object.defineProperty(this, \"isTrusted\", { value: false, enumerable: true })\n\n // Define accessors\n const keys = Object.keys(event)\n for (let i = 0; i < keys.length; ++i) {\n const key = keys[i]\n if (!(key in this)) {\n Object.defineProperty(this, key, defineRedirectDescriptor(key))\n }\n }\n}\n\n// Should be enumerable, but class methods are not enumerable.\nEvent.prototype = {\n /**\n * The type of this event.\n * @type {string}\n */\n get type() {\n return pd(this).event.type\n },\n\n /**\n * The target of this event.\n * @type {EventTarget}\n */\n get target() {\n return pd(this).eventTarget\n },\n\n /**\n * The target of this event.\n * @type {EventTarget}\n */\n get currentTarget() {\n return pd(this).currentTarget\n },\n\n /**\n * @returns {EventTarget[]} The composed path of this event.\n */\n composedPath() {\n const currentTarget = pd(this).currentTarget\n if (currentTarget == null) {\n return []\n }\n return [currentTarget]\n },\n\n /**\n * Constant of NONE.\n * @type {number}\n */\n get NONE() {\n return 0\n },\n\n /**\n * Constant of CAPTURING_PHASE.\n * @type {number}\n */\n get CAPTURING_PHASE() {\n return 1\n },\n\n /**\n * Constant of AT_TARGET.\n * @type {number}\n */\n get AT_TARGET() {\n return 2\n },\n\n /**\n * Constant of BUBBLING_PHASE.\n * @type {number}\n */\n get BUBBLING_PHASE() {\n return 3\n },\n\n /**\n * The target of this event.\n * @type {number}\n */\n get eventPhase() {\n return pd(this).eventPhase\n },\n\n /**\n * Stop event bubbling.\n * @returns {void}\n */\n stopPropagation() {\n const data = pd(this)\n\n data.stopped = true\n if (typeof data.event.stopPropagation === \"function\") {\n data.event.stopPropagation()\n }\n },\n\n /**\n * Stop event bubbling.\n * @returns {void}\n */\n stopImmediatePropagation() {\n const data = pd(this)\n\n data.stopped = true\n data.immediateStopped = true\n if (typeof data.event.stopImmediatePropagation === \"function\") {\n data.event.stopImmediatePropagation()\n }\n },\n\n /**\n * The flag to be bubbling.\n * @type {boolean}\n */\n get bubbles() {\n return Boolean(pd(this).event.bubbles)\n },\n\n /**\n * The flag to be cancelable.\n * @type {boolean}\n */\n get cancelable() {\n return Boolean(pd(this).event.cancelable)\n },\n\n /**\n * Cancel this event.\n * @returns {void}\n */\n preventDefault() {\n setCancelFlag(pd(this))\n },\n\n /**\n * The flag to indicate cancellation state.\n * @type {boolean}\n */\n get defaultPrevented() {\n return pd(this).canceled\n },\n\n /**\n * The flag to be composed.\n * @type {boolean}\n */\n get composed() {\n return Boolean(pd(this).event.composed)\n },\n\n /**\n * The unix time of this event.\n * @type {number}\n */\n get timeStamp() {\n return pd(this).timeStamp\n },\n\n /**\n * The target of this event.\n * @type {EventTarget}\n * @deprecated\n */\n get srcElement() {\n return pd(this).eventTarget\n },\n\n /**\n * The flag to stop event bubbling.\n * @type {boolean}\n * @deprecated\n */\n get cancelBubble() {\n return pd(this).stopped\n },\n set cancelBubble(value) {\n if (!value) {\n return\n }\n const data = pd(this)\n\n data.stopped = true\n if (typeof data.event.cancelBubble === \"boolean\") {\n data.event.cancelBubble = true\n }\n },\n\n /**\n * The flag to indicate cancellation state.\n * @type {boolean}\n * @deprecated\n */\n get returnValue() {\n return !pd(this).canceled\n },\n set returnValue(value) {\n if (!value) {\n setCancelFlag(pd(this))\n }\n },\n\n /**\n * Initialize this event object. But do nothing under event dispatching.\n * @param {string} type The event type.\n * @param {boolean} [bubbles=false] The flag to be possible to bubble up.\n * @param {boolean} [cancelable=false] The flag to be possible to cancel.\n * @deprecated\n */\n initEvent() {\n // Do nothing.\n },\n}\n\n// `constructor` is not enumerable.\nObject.defineProperty(Event.prototype, \"constructor\", {\n value: Event,\n configurable: true,\n writable: true,\n})\n\n// Ensure `event instanceof window.Event` is `true`.\nif (typeof window !== \"undefined\" && typeof window.Event !== \"undefined\") {\n Object.setPrototypeOf(Event.prototype, window.Event.prototype)\n\n // Make association for wrappers.\n wrappers.set(window.Event.prototype, Event)\n}\n\n/**\n * Get the property descriptor to redirect a given property.\n * @param {string} key Property name to define property descriptor.\n * @returns {PropertyDescriptor} The property descriptor to redirect the property.\n * @private\n */\nfunction defineRedirectDescriptor(key) {\n return {\n get() {\n return pd(this).event[key]\n },\n set(value) {\n pd(this).event[key] = value\n },\n configurable: true,\n enumerable: true,\n }\n}\n\n/**\n * Get the property descriptor to call a given method property.\n * @param {string} key Property name to define property descriptor.\n * @returns {PropertyDescriptor} The property descriptor to call the method property.\n * @private\n */\nfunction defineCallDescriptor(key) {\n return {\n value() {\n const event = pd(this).event\n return event[key].apply(event, arguments)\n },\n configurable: true,\n enumerable: true,\n }\n}\n\n/**\n * Define new wrapper class.\n * @param {Function} BaseEvent The base wrapper class.\n * @param {Object} proto The prototype of the original event.\n * @returns {Function} The defined wrapper class.\n * @private\n */\nfunction defineWrapper(BaseEvent, proto) {\n const keys = Object.keys(proto)\n if (keys.length === 0) {\n return BaseEvent\n }\n\n /** CustomEvent */\n function CustomEvent(eventTarget, event) {\n BaseEvent.call(this, eventTarget, event)\n }\n\n CustomEvent.prototype = Object.create(BaseEvent.prototype, {\n constructor: { value: CustomEvent, configurable: true, writable: true },\n })\n\n // Define accessors.\n for (let i = 0; i < keys.length; ++i) {\n const key = keys[i]\n if (!(key in BaseEvent.prototype)) {\n const descriptor = Object.getOwnPropertyDescriptor(proto, key)\n const isFunc = typeof descriptor.value === \"function\"\n Object.defineProperty(\n CustomEvent.prototype,\n key,\n isFunc\n ? defineCallDescriptor(key)\n : defineRedirectDescriptor(key)\n )\n }\n }\n\n return CustomEvent\n}\n\n/**\n * Get the wrapper class of a given prototype.\n * @param {Object} proto The prototype of the original event to get its wrapper.\n * @returns {Function} The wrapper class.\n * @private\n */\nfunction getWrapper(proto) {\n if (proto == null || proto === Object.prototype) {\n return Event\n }\n\n let wrapper = wrappers.get(proto)\n if (wrapper == null) {\n wrapper = defineWrapper(getWrapper(Object.getPrototypeOf(proto)), proto)\n wrappers.set(proto, wrapper)\n }\n return wrapper\n}\n\n/**\n * Wrap a given event to management a dispatching.\n * @param {EventTarget} eventTarget The event target of this dispatching.\n * @param {Object} event The event to wrap.\n * @returns {Event} The wrapper instance.\n * @private\n */\nexport function wrapEvent(eventTarget, event) {\n const Wrapper = getWrapper(Object.getPrototypeOf(event))\n return new Wrapper(eventTarget, event)\n}\n\n/**\n * Get the immediateStopped flag of a given event.\n * @param {Event} event The event to get.\n * @returns {boolean} The flag to stop propagation immediately.\n * @private\n */\nexport function isStopped(event) {\n return pd(event).immediateStopped\n}\n\n/**\n * Set the current event phase of a given event.\n * @param {Event} event The event to set current target.\n * @param {number} eventPhase New event phase.\n * @returns {void}\n * @private\n */\nexport function setEventPhase(event, eventPhase) {\n pd(event).eventPhase = eventPhase\n}\n\n/**\n * Set the current target of a given event.\n * @param {Event} event The event to set current target.\n * @param {EventTarget|null} currentTarget New current target.\n * @returns {void}\n * @private\n */\nexport function setCurrentTarget(event, currentTarget) {\n pd(event).currentTarget = currentTarget\n}\n\n/**\n * Set a passive listener of a given event.\n * @param {Event} event The event to set current target.\n * @param {Function|null} passiveListener New passive listener.\n * @returns {void}\n * @private\n */\nexport function setPassiveListener(event, passiveListener) {\n pd(event).passiveListener = passiveListener\n}\n","import {\n isStopped,\n setCurrentTarget,\n setEventPhase,\n setPassiveListener,\n wrapEvent,\n} from \"./event.mjs\"\n\n/**\n * @typedef {object} ListenerNode\n * @property {Function} listener\n * @property {1|2|3} listenerType\n * @property {boolean} passive\n * @property {boolean} once\n * @property {ListenerNode|null} next\n * @private\n */\n\n/**\n * @type {WeakMap>}\n * @private\n */\nconst listenersMap = new WeakMap()\n\n// Listener types\nconst CAPTURE = 1\nconst BUBBLE = 2\nconst ATTRIBUTE = 3\n\n/**\n * Check whether a given value is an object or not.\n * @param {any} x The value to check.\n * @returns {boolean} `true` if the value is an object.\n */\nfunction isObject(x) {\n return x !== null && typeof x === \"object\" //eslint-disable-line no-restricted-syntax\n}\n\n/**\n * Get listeners.\n * @param {EventTarget} eventTarget The event target to get.\n * @returns {Map} The listeners.\n * @private\n */\nfunction getListeners(eventTarget) {\n const listeners = listenersMap.get(eventTarget)\n if (listeners == null) {\n throw new TypeError(\n \"'this' is expected an EventTarget object, but got another value.\"\n )\n }\n return listeners\n}\n\n/**\n * Get the property descriptor for the event attribute of a given event.\n * @param {string} eventName The event name to get property descriptor.\n * @returns {PropertyDescriptor} The property descriptor.\n * @private\n */\nfunction defineEventAttributeDescriptor(eventName) {\n return {\n get() {\n const listeners = getListeners(this)\n let node = listeners.get(eventName)\n while (node != null) {\n if (node.listenerType === ATTRIBUTE) {\n return node.listener\n }\n node = node.next\n }\n return null\n },\n\n set(listener) {\n if (typeof listener !== \"function\" && !isObject(listener)) {\n listener = null // eslint-disable-line no-param-reassign\n }\n const listeners = getListeners(this)\n\n // Traverse to the tail while removing old value.\n let prev = null\n let node = listeners.get(eventName)\n while (node != null) {\n if (node.listenerType === ATTRIBUTE) {\n // Remove old value.\n if (prev !== null) {\n prev.next = node.next\n } else if (node.next !== null) {\n listeners.set(eventName, node.next)\n } else {\n listeners.delete(eventName)\n }\n } else {\n prev = node\n }\n\n node = node.next\n }\n\n // Add new value.\n if (listener !== null) {\n const newNode = {\n listener,\n listenerType: ATTRIBUTE,\n passive: false,\n once: false,\n next: null,\n }\n if (prev === null) {\n listeners.set(eventName, newNode)\n } else {\n prev.next = newNode\n }\n }\n },\n configurable: true,\n enumerable: true,\n }\n}\n\n/**\n * Define an event attribute (e.g. `eventTarget.onclick`).\n * @param {Object} eventTargetPrototype The event target prototype to define an event attrbite.\n * @param {string} eventName The event name to define.\n * @returns {void}\n */\nfunction defineEventAttribute(eventTargetPrototype, eventName) {\n Object.defineProperty(\n eventTargetPrototype,\n `on${eventName}`,\n defineEventAttributeDescriptor(eventName)\n )\n}\n\n/**\n * Define a custom EventTarget with event attributes.\n * @param {string[]} eventNames Event names for event attributes.\n * @returns {EventTarget} The custom EventTarget.\n * @private\n */\nfunction defineCustomEventTarget(eventNames) {\n /** CustomEventTarget */\n function CustomEventTarget() {\n EventTarget.call(this)\n }\n\n CustomEventTarget.prototype = Object.create(EventTarget.prototype, {\n constructor: {\n value: CustomEventTarget,\n configurable: true,\n writable: true,\n },\n })\n\n for (let i = 0; i < eventNames.length; ++i) {\n defineEventAttribute(CustomEventTarget.prototype, eventNames[i])\n }\n\n return CustomEventTarget\n}\n\n/**\n * EventTarget.\n *\n * - This is constructor if no arguments.\n * - This is a function which returns a CustomEventTarget constructor if there are arguments.\n *\n * For example:\n *\n * class A extends EventTarget {}\n * class B extends EventTarget(\"message\") {}\n * class C extends EventTarget(\"message\", \"error\") {}\n * class D extends EventTarget([\"message\", \"error\"]) {}\n */\nfunction EventTarget() {\n /*eslint-disable consistent-return */\n if (this instanceof EventTarget) {\n listenersMap.set(this, new Map())\n return\n }\n if (arguments.length === 1 && Array.isArray(arguments[0])) {\n return defineCustomEventTarget(arguments[0])\n }\n if (arguments.length > 0) {\n const types = new Array(arguments.length)\n for (let i = 0; i < arguments.length; ++i) {\n types[i] = arguments[i]\n }\n return defineCustomEventTarget(types)\n }\n throw new TypeError(\"Cannot call a class as a function\")\n /*eslint-enable consistent-return */\n}\n\n// Should be enumerable, but class methods are not enumerable.\nEventTarget.prototype = {\n /**\n * Add a given listener to this event target.\n * @param {string} eventName The event name to add.\n * @param {Function} listener The listener to add.\n * @param {boolean|{capture?:boolean,passive?:boolean,once?:boolean}} [options] The options for this listener.\n * @returns {void}\n */\n addEventListener(eventName, listener, options) {\n if (listener == null) {\n return\n }\n if (typeof listener !== \"function\" && !isObject(listener)) {\n throw new TypeError(\"'listener' should be a function or an object.\")\n }\n\n const listeners = getListeners(this)\n const optionsIsObj = isObject(options)\n const capture = optionsIsObj\n ? Boolean(options.capture)\n : Boolean(options)\n const listenerType = capture ? CAPTURE : BUBBLE\n const newNode = {\n listener,\n listenerType,\n passive: optionsIsObj && Boolean(options.passive),\n once: optionsIsObj && Boolean(options.once),\n next: null,\n }\n\n // Set it as the first node if the first node is null.\n let node = listeners.get(eventName)\n if (node === undefined) {\n listeners.set(eventName, newNode)\n return\n }\n\n // Traverse to the tail while checking duplication..\n let prev = null\n while (node != null) {\n if (\n node.listener === listener &&\n node.listenerType === listenerType\n ) {\n // Should ignore duplication.\n return\n }\n prev = node\n node = node.next\n }\n\n // Add it.\n prev.next = newNode\n },\n\n /**\n * Remove a given listener from this event target.\n * @param {string} eventName The event name to remove.\n * @param {Function} listener The listener to remove.\n * @param {boolean|{capture?:boolean,passive?:boolean,once?:boolean}} [options] The options for this listener.\n * @returns {void}\n */\n removeEventListener(eventName, listener, options) {\n if (listener == null) {\n return\n }\n\n const listeners = getListeners(this)\n const capture = isObject(options)\n ? Boolean(options.capture)\n : Boolean(options)\n const listenerType = capture ? CAPTURE : BUBBLE\n\n let prev = null\n let node = listeners.get(eventName)\n while (node != null) {\n if (\n node.listener === listener &&\n node.listenerType === listenerType\n ) {\n if (prev !== null) {\n prev.next = node.next\n } else if (node.next !== null) {\n listeners.set(eventName, node.next)\n } else {\n listeners.delete(eventName)\n }\n return\n }\n\n prev = node\n node = node.next\n }\n },\n\n /**\n * Dispatch a given event.\n * @param {Event|{type:string}} event The event to dispatch.\n * @returns {boolean} `false` if canceled.\n */\n dispatchEvent(event) {\n if (event == null || typeof event.type !== \"string\") {\n throw new TypeError('\"event.type\" should be a string.')\n }\n\n // If listeners aren't registered, terminate.\n const listeners = getListeners(this)\n const eventName = event.type\n let node = listeners.get(eventName)\n if (node == null) {\n return true\n }\n\n // Since we cannot rewrite several properties, so wrap object.\n const wrappedEvent = wrapEvent(this, event)\n\n // This doesn't process capturing phase and bubbling phase.\n // This isn't participating in a tree.\n let prev = null\n while (node != null) {\n // Remove this listener if it's once\n if (node.once) {\n if (prev !== null) {\n prev.next = node.next\n } else if (node.next !== null) {\n listeners.set(eventName, node.next)\n } else {\n listeners.delete(eventName)\n }\n } else {\n prev = node\n }\n\n // Call this listener\n setPassiveListener(\n wrappedEvent,\n node.passive ? node.listener : null\n )\n if (typeof node.listener === \"function\") {\n try {\n node.listener.call(this, wrappedEvent)\n } catch (err) {\n if (\n typeof console !== \"undefined\" &&\n typeof console.error === \"function\"\n ) {\n console.error(err)\n }\n }\n } else if (\n node.listenerType !== ATTRIBUTE &&\n typeof node.listener.handleEvent === \"function\"\n ) {\n node.listener.handleEvent(wrappedEvent)\n }\n\n // Break if `event.stopImmediatePropagation` was called.\n if (isStopped(wrappedEvent)) {\n break\n }\n\n node = node.next\n }\n setPassiveListener(wrappedEvent, null)\n setEventPhase(wrappedEvent, 0)\n setCurrentTarget(wrappedEvent, null)\n\n return !wrappedEvent.defaultPrevented\n },\n}\n\n// `constructor` is not enumerable.\nObject.defineProperty(EventTarget.prototype, \"constructor\", {\n value: EventTarget,\n configurable: true,\n writable: true,\n})\n\n// Ensure `eventTarget instanceof window.EventTarget` is `true`.\nif (\n typeof window !== \"undefined\" &&\n typeof window.EventTarget !== \"undefined\"\n) {\n Object.setPrototypeOf(EventTarget.prototype, window.EventTarget.prototype)\n}\n\nexport { defineEventAttribute, EventTarget }\nexport default EventTarget\n"],"names":[],"mappings":";;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;AAmBA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EAAE,IAAI;CACjB,EAAC;;;AAGF;IACI,OAAO,MAAM,KAAK,WAAW;IAC7B,OAAO,MAAM,CAAC,WAAW,KAAK,WAAW;EAC3C;IACE,MAAM,CAAC,cAAc,CAAC,WAAW,CAAC,SAAS,EAAE,MAAM,CAAC,WAAW,CAAC,SAAS,EAAC;CAC7E;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/deps/npm/node_modules/event-target-shim/dist/event-target-shim.mjs.map b/deps/npm/node_modules/event-target-shim/dist/event-target-shim.mjs.map deleted file mode 100644 index 57b3e8f7c028d0..00000000000000 --- a/deps/npm/node_modules/event-target-shim/dist/event-target-shim.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"event-target-shim.mjs","sources":["../src/event.mjs","../src/event-target.mjs"],"sourcesContent":["/**\n * @typedef {object} PrivateData\n * @property {EventTarget} eventTarget The event target.\n * @property {{type:string}} event The original event object.\n * @property {number} eventPhase The current event phase.\n * @property {EventTarget|null} currentTarget The current event target.\n * @property {boolean} canceled The flag to prevent default.\n * @property {boolean} stopped The flag to stop propagation.\n * @property {boolean} immediateStopped The flag to stop propagation immediately.\n * @property {Function|null} passiveListener The listener if the current listener is passive. Otherwise this is null.\n * @property {number} timeStamp The unix time.\n * @private\n */\n\n/**\n * Private data for event wrappers.\n * @type {WeakMap}\n * @private\n */\nconst privateData = new WeakMap()\n\n/**\n * Cache for wrapper classes.\n * @type {WeakMap}\n * @private\n */\nconst wrappers = new WeakMap()\n\n/**\n * Get private data.\n * @param {Event} event The event object to get private data.\n * @returns {PrivateData} The private data of the event.\n * @private\n */\nfunction pd(event) {\n const retv = privateData.get(event)\n console.assert(\n retv != null,\n \"'this' is expected an Event object, but got\",\n event\n )\n return retv\n}\n\n/**\n * https://dom.spec.whatwg.org/#set-the-canceled-flag\n * @param data {PrivateData} private data.\n */\nfunction setCancelFlag(data) {\n if (data.passiveListener != null) {\n if (\n typeof console !== \"undefined\" &&\n typeof console.error === \"function\"\n ) {\n console.error(\n \"Unable to preventDefault inside passive event listener invocation.\",\n data.passiveListener\n )\n }\n return\n }\n if (!data.event.cancelable) {\n return\n }\n\n data.canceled = true\n if (typeof data.event.preventDefault === \"function\") {\n data.event.preventDefault()\n }\n}\n\n/**\n * @see https://dom.spec.whatwg.org/#interface-event\n * @private\n */\n/**\n * The event wrapper.\n * @constructor\n * @param {EventTarget} eventTarget The event target of this dispatching.\n * @param {Event|{type:string}} event The original event to wrap.\n */\nfunction Event(eventTarget, event) {\n privateData.set(this, {\n eventTarget,\n event,\n eventPhase: 2,\n currentTarget: eventTarget,\n canceled: false,\n stopped: false,\n immediateStopped: false,\n passiveListener: null,\n timeStamp: event.timeStamp || Date.now(),\n })\n\n // https://heycam.github.io/webidl/#Unforgeable\n Object.defineProperty(this, \"isTrusted\", { value: false, enumerable: true })\n\n // Define accessors\n const keys = Object.keys(event)\n for (let i = 0; i < keys.length; ++i) {\n const key = keys[i]\n if (!(key in this)) {\n Object.defineProperty(this, key, defineRedirectDescriptor(key))\n }\n }\n}\n\n// Should be enumerable, but class methods are not enumerable.\nEvent.prototype = {\n /**\n * The type of this event.\n * @type {string}\n */\n get type() {\n return pd(this).event.type\n },\n\n /**\n * The target of this event.\n * @type {EventTarget}\n */\n get target() {\n return pd(this).eventTarget\n },\n\n /**\n * The target of this event.\n * @type {EventTarget}\n */\n get currentTarget() {\n return pd(this).currentTarget\n },\n\n /**\n * @returns {EventTarget[]} The composed path of this event.\n */\n composedPath() {\n const currentTarget = pd(this).currentTarget\n if (currentTarget == null) {\n return []\n }\n return [currentTarget]\n },\n\n /**\n * Constant of NONE.\n * @type {number}\n */\n get NONE() {\n return 0\n },\n\n /**\n * Constant of CAPTURING_PHASE.\n * @type {number}\n */\n get CAPTURING_PHASE() {\n return 1\n },\n\n /**\n * Constant of AT_TARGET.\n * @type {number}\n */\n get AT_TARGET() {\n return 2\n },\n\n /**\n * Constant of BUBBLING_PHASE.\n * @type {number}\n */\n get BUBBLING_PHASE() {\n return 3\n },\n\n /**\n * The target of this event.\n * @type {number}\n */\n get eventPhase() {\n return pd(this).eventPhase\n },\n\n /**\n * Stop event bubbling.\n * @returns {void}\n */\n stopPropagation() {\n const data = pd(this)\n\n data.stopped = true\n if (typeof data.event.stopPropagation === \"function\") {\n data.event.stopPropagation()\n }\n },\n\n /**\n * Stop event bubbling.\n * @returns {void}\n */\n stopImmediatePropagation() {\n const data = pd(this)\n\n data.stopped = true\n data.immediateStopped = true\n if (typeof data.event.stopImmediatePropagation === \"function\") {\n data.event.stopImmediatePropagation()\n }\n },\n\n /**\n * The flag to be bubbling.\n * @type {boolean}\n */\n get bubbles() {\n return Boolean(pd(this).event.bubbles)\n },\n\n /**\n * The flag to be cancelable.\n * @type {boolean}\n */\n get cancelable() {\n return Boolean(pd(this).event.cancelable)\n },\n\n /**\n * Cancel this event.\n * @returns {void}\n */\n preventDefault() {\n setCancelFlag(pd(this))\n },\n\n /**\n * The flag to indicate cancellation state.\n * @type {boolean}\n */\n get defaultPrevented() {\n return pd(this).canceled\n },\n\n /**\n * The flag to be composed.\n * @type {boolean}\n */\n get composed() {\n return Boolean(pd(this).event.composed)\n },\n\n /**\n * The unix time of this event.\n * @type {number}\n */\n get timeStamp() {\n return pd(this).timeStamp\n },\n\n /**\n * The target of this event.\n * @type {EventTarget}\n * @deprecated\n */\n get srcElement() {\n return pd(this).eventTarget\n },\n\n /**\n * The flag to stop event bubbling.\n * @type {boolean}\n * @deprecated\n */\n get cancelBubble() {\n return pd(this).stopped\n },\n set cancelBubble(value) {\n if (!value) {\n return\n }\n const data = pd(this)\n\n data.stopped = true\n if (typeof data.event.cancelBubble === \"boolean\") {\n data.event.cancelBubble = true\n }\n },\n\n /**\n * The flag to indicate cancellation state.\n * @type {boolean}\n * @deprecated\n */\n get returnValue() {\n return !pd(this).canceled\n },\n set returnValue(value) {\n if (!value) {\n setCancelFlag(pd(this))\n }\n },\n\n /**\n * Initialize this event object. But do nothing under event dispatching.\n * @param {string} type The event type.\n * @param {boolean} [bubbles=false] The flag to be possible to bubble up.\n * @param {boolean} [cancelable=false] The flag to be possible to cancel.\n * @deprecated\n */\n initEvent() {\n // Do nothing.\n },\n}\n\n// `constructor` is not enumerable.\nObject.defineProperty(Event.prototype, \"constructor\", {\n value: Event,\n configurable: true,\n writable: true,\n})\n\n// Ensure `event instanceof window.Event` is `true`.\nif (typeof window !== \"undefined\" && typeof window.Event !== \"undefined\") {\n Object.setPrototypeOf(Event.prototype, window.Event.prototype)\n\n // Make association for wrappers.\n wrappers.set(window.Event.prototype, Event)\n}\n\n/**\n * Get the property descriptor to redirect a given property.\n * @param {string} key Property name to define property descriptor.\n * @returns {PropertyDescriptor} The property descriptor to redirect the property.\n * @private\n */\nfunction defineRedirectDescriptor(key) {\n return {\n get() {\n return pd(this).event[key]\n },\n set(value) {\n pd(this).event[key] = value\n },\n configurable: true,\n enumerable: true,\n }\n}\n\n/**\n * Get the property descriptor to call a given method property.\n * @param {string} key Property name to define property descriptor.\n * @returns {PropertyDescriptor} The property descriptor to call the method property.\n * @private\n */\nfunction defineCallDescriptor(key) {\n return {\n value() {\n const event = pd(this).event\n return event[key].apply(event, arguments)\n },\n configurable: true,\n enumerable: true,\n }\n}\n\n/**\n * Define new wrapper class.\n * @param {Function} BaseEvent The base wrapper class.\n * @param {Object} proto The prototype of the original event.\n * @returns {Function} The defined wrapper class.\n * @private\n */\nfunction defineWrapper(BaseEvent, proto) {\n const keys = Object.keys(proto)\n if (keys.length === 0) {\n return BaseEvent\n }\n\n /** CustomEvent */\n function CustomEvent(eventTarget, event) {\n BaseEvent.call(this, eventTarget, event)\n }\n\n CustomEvent.prototype = Object.create(BaseEvent.prototype, {\n constructor: { value: CustomEvent, configurable: true, writable: true },\n })\n\n // Define accessors.\n for (let i = 0; i < keys.length; ++i) {\n const key = keys[i]\n if (!(key in BaseEvent.prototype)) {\n const descriptor = Object.getOwnPropertyDescriptor(proto, key)\n const isFunc = typeof descriptor.value === \"function\"\n Object.defineProperty(\n CustomEvent.prototype,\n key,\n isFunc\n ? defineCallDescriptor(key)\n : defineRedirectDescriptor(key)\n )\n }\n }\n\n return CustomEvent\n}\n\n/**\n * Get the wrapper class of a given prototype.\n * @param {Object} proto The prototype of the original event to get its wrapper.\n * @returns {Function} The wrapper class.\n * @private\n */\nfunction getWrapper(proto) {\n if (proto == null || proto === Object.prototype) {\n return Event\n }\n\n let wrapper = wrappers.get(proto)\n if (wrapper == null) {\n wrapper = defineWrapper(getWrapper(Object.getPrototypeOf(proto)), proto)\n wrappers.set(proto, wrapper)\n }\n return wrapper\n}\n\n/**\n * Wrap a given event to management a dispatching.\n * @param {EventTarget} eventTarget The event target of this dispatching.\n * @param {Object} event The event to wrap.\n * @returns {Event} The wrapper instance.\n * @private\n */\nexport function wrapEvent(eventTarget, event) {\n const Wrapper = getWrapper(Object.getPrototypeOf(event))\n return new Wrapper(eventTarget, event)\n}\n\n/**\n * Get the immediateStopped flag of a given event.\n * @param {Event} event The event to get.\n * @returns {boolean} The flag to stop propagation immediately.\n * @private\n */\nexport function isStopped(event) {\n return pd(event).immediateStopped\n}\n\n/**\n * Set the current event phase of a given event.\n * @param {Event} event The event to set current target.\n * @param {number} eventPhase New event phase.\n * @returns {void}\n * @private\n */\nexport function setEventPhase(event, eventPhase) {\n pd(event).eventPhase = eventPhase\n}\n\n/**\n * Set the current target of a given event.\n * @param {Event} event The event to set current target.\n * @param {EventTarget|null} currentTarget New current target.\n * @returns {void}\n * @private\n */\nexport function setCurrentTarget(event, currentTarget) {\n pd(event).currentTarget = currentTarget\n}\n\n/**\n * Set a passive listener of a given event.\n * @param {Event} event The event to set current target.\n * @param {Function|null} passiveListener New passive listener.\n * @returns {void}\n * @private\n */\nexport function setPassiveListener(event, passiveListener) {\n pd(event).passiveListener = passiveListener\n}\n","import {\n isStopped,\n setCurrentTarget,\n setEventPhase,\n setPassiveListener,\n wrapEvent,\n} from \"./event.mjs\"\n\n/**\n * @typedef {object} ListenerNode\n * @property {Function} listener\n * @property {1|2|3} listenerType\n * @property {boolean} passive\n * @property {boolean} once\n * @property {ListenerNode|null} next\n * @private\n */\n\n/**\n * @type {WeakMap>}\n * @private\n */\nconst listenersMap = new WeakMap()\n\n// Listener types\nconst CAPTURE = 1\nconst BUBBLE = 2\nconst ATTRIBUTE = 3\n\n/**\n * Check whether a given value is an object or not.\n * @param {any} x The value to check.\n * @returns {boolean} `true` if the value is an object.\n */\nfunction isObject(x) {\n return x !== null && typeof x === \"object\" //eslint-disable-line no-restricted-syntax\n}\n\n/**\n * Get listeners.\n * @param {EventTarget} eventTarget The event target to get.\n * @returns {Map} The listeners.\n * @private\n */\nfunction getListeners(eventTarget) {\n const listeners = listenersMap.get(eventTarget)\n if (listeners == null) {\n throw new TypeError(\n \"'this' is expected an EventTarget object, but got another value.\"\n )\n }\n return listeners\n}\n\n/**\n * Get the property descriptor for the event attribute of a given event.\n * @param {string} eventName The event name to get property descriptor.\n * @returns {PropertyDescriptor} The property descriptor.\n * @private\n */\nfunction defineEventAttributeDescriptor(eventName) {\n return {\n get() {\n const listeners = getListeners(this)\n let node = listeners.get(eventName)\n while (node != null) {\n if (node.listenerType === ATTRIBUTE) {\n return node.listener\n }\n node = node.next\n }\n return null\n },\n\n set(listener) {\n if (typeof listener !== \"function\" && !isObject(listener)) {\n listener = null // eslint-disable-line no-param-reassign\n }\n const listeners = getListeners(this)\n\n // Traverse to the tail while removing old value.\n let prev = null\n let node = listeners.get(eventName)\n while (node != null) {\n if (node.listenerType === ATTRIBUTE) {\n // Remove old value.\n if (prev !== null) {\n prev.next = node.next\n } else if (node.next !== null) {\n listeners.set(eventName, node.next)\n } else {\n listeners.delete(eventName)\n }\n } else {\n prev = node\n }\n\n node = node.next\n }\n\n // Add new value.\n if (listener !== null) {\n const newNode = {\n listener,\n listenerType: ATTRIBUTE,\n passive: false,\n once: false,\n next: null,\n }\n if (prev === null) {\n listeners.set(eventName, newNode)\n } else {\n prev.next = newNode\n }\n }\n },\n configurable: true,\n enumerable: true,\n }\n}\n\n/**\n * Define an event attribute (e.g. `eventTarget.onclick`).\n * @param {Object} eventTargetPrototype The event target prototype to define an event attrbite.\n * @param {string} eventName The event name to define.\n * @returns {void}\n */\nfunction defineEventAttribute(eventTargetPrototype, eventName) {\n Object.defineProperty(\n eventTargetPrototype,\n `on${eventName}`,\n defineEventAttributeDescriptor(eventName)\n )\n}\n\n/**\n * Define a custom EventTarget with event attributes.\n * @param {string[]} eventNames Event names for event attributes.\n * @returns {EventTarget} The custom EventTarget.\n * @private\n */\nfunction defineCustomEventTarget(eventNames) {\n /** CustomEventTarget */\n function CustomEventTarget() {\n EventTarget.call(this)\n }\n\n CustomEventTarget.prototype = Object.create(EventTarget.prototype, {\n constructor: {\n value: CustomEventTarget,\n configurable: true,\n writable: true,\n },\n })\n\n for (let i = 0; i < eventNames.length; ++i) {\n defineEventAttribute(CustomEventTarget.prototype, eventNames[i])\n }\n\n return CustomEventTarget\n}\n\n/**\n * EventTarget.\n *\n * - This is constructor if no arguments.\n * - This is a function which returns a CustomEventTarget constructor if there are arguments.\n *\n * For example:\n *\n * class A extends EventTarget {}\n * class B extends EventTarget(\"message\") {}\n * class C extends EventTarget(\"message\", \"error\") {}\n * class D extends EventTarget([\"message\", \"error\"]) {}\n */\nfunction EventTarget() {\n /*eslint-disable consistent-return */\n if (this instanceof EventTarget) {\n listenersMap.set(this, new Map())\n return\n }\n if (arguments.length === 1 && Array.isArray(arguments[0])) {\n return defineCustomEventTarget(arguments[0])\n }\n if (arguments.length > 0) {\n const types = new Array(arguments.length)\n for (let i = 0; i < arguments.length; ++i) {\n types[i] = arguments[i]\n }\n return defineCustomEventTarget(types)\n }\n throw new TypeError(\"Cannot call a class as a function\")\n /*eslint-enable consistent-return */\n}\n\n// Should be enumerable, but class methods are not enumerable.\nEventTarget.prototype = {\n /**\n * Add a given listener to this event target.\n * @param {string} eventName The event name to add.\n * @param {Function} listener The listener to add.\n * @param {boolean|{capture?:boolean,passive?:boolean,once?:boolean}} [options] The options for this listener.\n * @returns {void}\n */\n addEventListener(eventName, listener, options) {\n if (listener == null) {\n return\n }\n if (typeof listener !== \"function\" && !isObject(listener)) {\n throw new TypeError(\"'listener' should be a function or an object.\")\n }\n\n const listeners = getListeners(this)\n const optionsIsObj = isObject(options)\n const capture = optionsIsObj\n ? Boolean(options.capture)\n : Boolean(options)\n const listenerType = capture ? CAPTURE : BUBBLE\n const newNode = {\n listener,\n listenerType,\n passive: optionsIsObj && Boolean(options.passive),\n once: optionsIsObj && Boolean(options.once),\n next: null,\n }\n\n // Set it as the first node if the first node is null.\n let node = listeners.get(eventName)\n if (node === undefined) {\n listeners.set(eventName, newNode)\n return\n }\n\n // Traverse to the tail while checking duplication..\n let prev = null\n while (node != null) {\n if (\n node.listener === listener &&\n node.listenerType === listenerType\n ) {\n // Should ignore duplication.\n return\n }\n prev = node\n node = node.next\n }\n\n // Add it.\n prev.next = newNode\n },\n\n /**\n * Remove a given listener from this event target.\n * @param {string} eventName The event name to remove.\n * @param {Function} listener The listener to remove.\n * @param {boolean|{capture?:boolean,passive?:boolean,once?:boolean}} [options] The options for this listener.\n * @returns {void}\n */\n removeEventListener(eventName, listener, options) {\n if (listener == null) {\n return\n }\n\n const listeners = getListeners(this)\n const capture = isObject(options)\n ? Boolean(options.capture)\n : Boolean(options)\n const listenerType = capture ? CAPTURE : BUBBLE\n\n let prev = null\n let node = listeners.get(eventName)\n while (node != null) {\n if (\n node.listener === listener &&\n node.listenerType === listenerType\n ) {\n if (prev !== null) {\n prev.next = node.next\n } else if (node.next !== null) {\n listeners.set(eventName, node.next)\n } else {\n listeners.delete(eventName)\n }\n return\n }\n\n prev = node\n node = node.next\n }\n },\n\n /**\n * Dispatch a given event.\n * @param {Event|{type:string}} event The event to dispatch.\n * @returns {boolean} `false` if canceled.\n */\n dispatchEvent(event) {\n if (event == null || typeof event.type !== \"string\") {\n throw new TypeError('\"event.type\" should be a string.')\n }\n\n // If listeners aren't registered, terminate.\n const listeners = getListeners(this)\n const eventName = event.type\n let node = listeners.get(eventName)\n if (node == null) {\n return true\n }\n\n // Since we cannot rewrite several properties, so wrap object.\n const wrappedEvent = wrapEvent(this, event)\n\n // This doesn't process capturing phase and bubbling phase.\n // This isn't participating in a tree.\n let prev = null\n while (node != null) {\n // Remove this listener if it's once\n if (node.once) {\n if (prev !== null) {\n prev.next = node.next\n } else if (node.next !== null) {\n listeners.set(eventName, node.next)\n } else {\n listeners.delete(eventName)\n }\n } else {\n prev = node\n }\n\n // Call this listener\n setPassiveListener(\n wrappedEvent,\n node.passive ? node.listener : null\n )\n if (typeof node.listener === \"function\") {\n try {\n node.listener.call(this, wrappedEvent)\n } catch (err) {\n if (\n typeof console !== \"undefined\" &&\n typeof console.error === \"function\"\n ) {\n console.error(err)\n }\n }\n } else if (\n node.listenerType !== ATTRIBUTE &&\n typeof node.listener.handleEvent === \"function\"\n ) {\n node.listener.handleEvent(wrappedEvent)\n }\n\n // Break if `event.stopImmediatePropagation` was called.\n if (isStopped(wrappedEvent)) {\n break\n }\n\n node = node.next\n }\n setPassiveListener(wrappedEvent, null)\n setEventPhase(wrappedEvent, 0)\n setCurrentTarget(wrappedEvent, null)\n\n return !wrappedEvent.defaultPrevented\n },\n}\n\n// `constructor` is not enumerable.\nObject.defineProperty(EventTarget.prototype, \"constructor\", {\n value: EventTarget,\n configurable: true,\n writable: true,\n})\n\n// Ensure `eventTarget instanceof window.EventTarget` is `true`.\nif (\n typeof window !== \"undefined\" &&\n typeof window.EventTarget !== \"undefined\"\n) {\n Object.setPrototypeOf(EventTarget.prototype, window.EventTarget.prototype)\n}\n\nexport { defineEventAttribute, EventTarget }\nexport default EventTarget\n"],"names":[],"mappings":";;;;;AAAA;;;;;;;;;;;;;;;;;;;AAmBA,MAAM,WAAW,GAAG,IAAI,OAAO,GAAE;;;;;;;AAOjC,MAAM,QAAQ,GAAG,IAAI,OAAO,GAAE;;;;;;;;AAQ9B,SAAS,EAAE,CAAC,KAAK,EAAE;IACf,MAAM,IAAI,GAAG,WAAW,CAAC,GAAG,CAAC,KA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AC,SAAS,EAAC;CAC7E;;;;;"} \ No newline at end of file diff --git a/deps/npm/node_modules/event-target-shim/dist/event-target-shim.umd.js.map b/deps/npm/node_modules/event-target-shim/dist/event-target-shim.umd.js.map deleted file mode 100644 index c5b2b60a85f0a6..00000000000000 --- a/deps/npm/node_modules/event-target-shim/dist/event-target-shim.umd.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"event-target-shim.umd.js","sources":["../src/event.mjs","../src/event-target.mjs"],"sourcesContent":["/**\n * @typedef {object} PrivateData\n * @property {EventTarget} eventTarget The event target.\n * @property {{type:string}} event The original event object.\n * @property {number} eventPhase The current event phase.\n * @property {EventTarget|null} currentTarget The current event target.\n * @property {boolean} canceled The flag to prevent default.\n * @property {boolean} stopped The flag to stop propagation.\n * @property {boolean} immediateStopped The flag to stop propagation immediately.\n * @property {Function|null} passiveListener The listener if the current listener is passive. Otherwise this is null.\n * @property {number} timeStamp The unix time.\n * @private\n */\n\n/**\n * Private data for event wrappers.\n * @type {WeakMap}\n * @private\n */\nconst privateData = new WeakMap()\n\n/**\n * Cache for wrapper classes.\n * @type {WeakMap}\n * @private\n */\nconst wrappers = new WeakMap()\n\n/**\n * Get private data.\n * @param {Event} event The event object to get private data.\n * @returns {PrivateData} The private data of the event.\n * @private\n */\nfunction pd(event) {\n const retv = privateData.get(event)\n console.assert(\n retv != null,\n \"'this' is expected an Event object, but got\",\n event\n )\n return retv\n}\n\n/**\n * https://dom.spec.whatwg.org/#set-the-canceled-flag\n * @param data {PrivateData} private data.\n */\nfunction setCancelFlag(data) {\n if (data.passiveListener != null) {\n if (\n typeof console !== \"undefined\" &&\n typeof console.error === \"function\"\n ) {\n console.error(\n \"Unable to preventDefault inside passive event listener invocation.\",\n data.passiveListener\n )\n }\n return\n }\n if (!data.event.cancelable) {\n return\n }\n\n data.canceled = true\n if (typeof data.event.preventDefault === \"function\") {\n data.event.preventDefault()\n }\n}\n\n/**\n * @see https://dom.spec.whatwg.org/#interface-event\n * @private\n */\n/**\n * The event wrapper.\n * @constructor\n * @param {EventTarget} eventTarget The event target of this dispatching.\n * @param {Event|{type:string}} event The original event to wrap.\n */\nfunction Event(eventTarget, event) {\n privateData.set(this, {\n eventTarget,\n event,\n eventPhase: 2,\n currentTarget: eventTarget,\n canceled: false,\n stopped: false,\n immediateStopped: false,\n passiveListener: null,\n timeStamp: event.timeStamp || Date.now(),\n })\n\n // https://heycam.github.io/webidl/#Unforgeable\n Object.defineProperty(this, \"isTrusted\", { value: false, enumerable: true })\n\n // Define accessors\n const keys = Object.keys(event)\n for (let i = 0; i < keys.length; ++i) {\n const key = keys[i]\n if (!(key in this)) {\n Object.defineProperty(this, key, defineRedirectDescriptor(key))\n }\n }\n}\n\n// Should be enumerable, but class methods are not enumerable.\nEvent.prototype = {\n /**\n * The type of this event.\n * @type {string}\n */\n get type() {\n return pd(this).event.type\n },\n\n /**\n * The target of this event.\n * @type {EventTarget}\n */\n get target() {\n return pd(this).eventTarget\n },\n\n /**\n * The target of this event.\n * @type {EventTarget}\n */\n get currentTarget() {\n return pd(this).currentTarget\n },\n\n /**\n * @returns {EventTarget[]} The composed path of this event.\n */\n composedPath() {\n const currentTarget = pd(this).currentTarget\n if (currentTarget == null) {\n return []\n }\n return [currentTarget]\n },\n\n /**\n * Constant of NONE.\n * @type {number}\n */\n get NONE() {\n return 0\n },\n\n /**\n * Constant of CAPTURING_PHASE.\n * @type {number}\n */\n get CAPTURING_PHASE() {\n return 1\n },\n\n /**\n * Constant of AT_TARGET.\n * @type {number}\n */\n get AT_TARGET() {\n return 2\n },\n\n /**\n * Constant of BUBBLING_PHASE.\n * @type {number}\n */\n get BUBBLING_PHASE() {\n return 3\n },\n\n /**\n * The target of this event.\n * @type {number}\n */\n get eventPhase() {\n return pd(this).eventPhase\n },\n\n /**\n * Stop event bubbling.\n * @returns {void}\n */\n stopPropagation() {\n const data = pd(this)\n\n data.stopped = true\n if (typeof data.event.stopPropagation === \"function\") {\n data.event.stopPropagation()\n }\n },\n\n /**\n * Stop event bubbling.\n * @returns {void}\n */\n stopImmediatePropagation() {\n const data = pd(this)\n\n data.stopped = true\n data.immediateStopped = true\n if (typeof data.event.stopImmediatePropagation === \"function\") {\n data.event.stopImmediatePropagation()\n }\n },\n\n /**\n * The flag to be bubbling.\n * @type {boolean}\n */\n get bubbles() {\n return Boolean(pd(this).event.bubbles)\n },\n\n /**\n * The flag to be cancelable.\n * @type {boolean}\n */\n get cancelable() {\n return Boolean(pd(this).event.cancelable)\n },\n\n /**\n * Cancel this event.\n * @returns {void}\n */\n preventDefault() {\n setCancelFlag(pd(this))\n },\n\n /**\n * The flag to indicate cancellation state.\n * @type {boolean}\n */\n get defaultPrevented() {\n return pd(this).canceled\n },\n\n /**\n * The flag to be composed.\n * @type {boolean}\n */\n get composed() {\n return Boolean(pd(this).event.composed)\n },\n\n /**\n * The unix time of this event.\n * @type {number}\n */\n get timeStamp() {\n return pd(this).timeStamp\n },\n\n /**\n * The target of this event.\n * @type {EventTarget}\n * @deprecated\n */\n get srcElement() {\n return pd(this).eventTarget\n },\n\n /**\n * The flag to stop event bubbling.\n * @type {boolean}\n * @deprecated\n */\n get cancelBubble() {\n return pd(this).stopped\n },\n set cancelBubble(value) {\n if (!value) {\n return\n }\n const data = pd(this)\n\n data.stopped = true\n if (typeof data.event.cancelBubble === \"boolean\") {\n data.event.cancelBubble = true\n }\n },\n\n /**\n * The flag to indicate cancellation state.\n * @type {boolean}\n * @deprecated\n */\n get returnValue() {\n return !pd(this).canceled\n },\n set returnValue(value) {\n if (!value) {\n setCancelFlag(pd(this))\n }\n },\n\n /**\n * Initialize this event object. But do nothing under event dispatching.\n * @param {string} type The event type.\n * @param {boolean} [bubbles=false] The flag to be possible to bubble up.\n * @param {boolean} [cancelable=false] The flag to be possible to cancel.\n * @deprecated\n */\n initEvent() {\n // Do nothing.\n },\n}\n\n// `constructor` is not enumerable.\nObject.defineProperty(Event.prototype, \"constructor\", {\n value: Event,\n configurable: true,\n writable: true,\n})\n\n// Ensure `event instanceof window.Event` is `true`.\nif (typeof window !== \"undefined\" && typeof window.Event !== \"undefined\") {\n Object.setPrototypeOf(Event.prototype, window.Event.prototype)\n\n // Make association for wrappers.\n wrappers.set(window.Event.prototype, Event)\n}\n\n/**\n * Get the property descriptor to redirect a given property.\n * @param {string} key Property name to define property descriptor.\n * @returns {PropertyDescriptor} The property descriptor to redirect the property.\n * @private\n */\nfunction defineRedirectDescriptor(key) {\n return {\n get() {\n return pd(this).event[key]\n },\n set(value) {\n pd(this).event[key] = value\n },\n configurable: true,\n enumerable: true,\n }\n}\n\n/**\n * Get the property descriptor to call a given method property.\n * @param {string} key Property name to define property descriptor.\n * @returns {PropertyDescriptor} The property descriptor to call the method property.\n * @private\n */\nfunction defineCallDescriptor(key) {\n return {\n value() {\n const event = pd(this).event\n return event[key].apply(event, arguments)\n },\n configurable: true,\n enumerable: true,\n }\n}\n\n/**\n * Define new wrapper class.\n * @param {Function} BaseEvent The base wrapper class.\n * @param {Object} proto The prototype of the original event.\n * @returns {Function} The defined wrapper class.\n * @private\n */\nfunction defineWrapper(BaseEvent, proto) {\n const keys = Object.keys(proto)\n if (keys.length === 0) {\n return BaseEvent\n }\n\n /** CustomEvent */\n function CustomEvent(eventTarget, event) {\n BaseEvent.call(this, eventTarget, event)\n }\n\n CustomEvent.prototype = Object.create(BaseEvent.prototype, {\n constructor: { value: CustomEvent, configurable: true, writable: true },\n })\n\n // Define accessors.\n for (let i = 0; i < keys.length; ++i) {\n const key = keys[i]\n if (!(key in BaseEvent.prototype)) {\n const descriptor = Object.getOwnPropertyDescriptor(proto, key)\n const isFunc = typeof descriptor.value === \"function\"\n Object.defineProperty(\n CustomEvent.prototype,\n key,\n isFunc\n ? defineCallDescriptor(key)\n : defineRedirectDescriptor(key)\n )\n }\n }\n\n return CustomEvent\n}\n\n/**\n * Get the wrapper class of a given prototype.\n * @param {Object} proto The prototype of the original event to get its wrapper.\n * @returns {Function} The wrapper class.\n * @private\n */\nfunction getWrapper(proto) {\n if (proto == null || proto === Object.prototype) {\n return Event\n }\n\n let wrapper = wrappers.get(proto)\n if (wrapper == null) {\n wrapper = defineWrapper(getWrapper(Object.getPrototypeOf(proto)), proto)\n wrappers.set(proto, wrapper)\n }\n return wrapper\n}\n\n/**\n * Wrap a given event to management a dispatching.\n * @param {EventTarget} eventTarget The event target of this dispatching.\n * @param {Object} event The event to wrap.\n * @returns {Event} The wrapper instance.\n * @private\n */\nexport function wrapEvent(eventTarget, event) {\n const Wrapper = getWrapper(Object.getPrototypeOf(event))\n return new Wrapper(eventTarget, event)\n}\n\n/**\n * Get the immediateStopped flag of a given event.\n * @param {Event} event The event to get.\n * @returns {boolean} The flag to stop propagation immediately.\n * @private\n */\nexport function isStopped(event) {\n return pd(event).immediateStopped\n}\n\n/**\n * Set the current event phase of a given event.\n * @param {Event} event The event to set current target.\n * @param {number} eventPhase New event phase.\n * @returns {void}\n * @private\n */\nexport function setEventPhase(event, eventPhase) {\n pd(event).eventPhase = eventPhase\n}\n\n/**\n * Set the current target of a given event.\n * @param {Event} event The event to set current target.\n * @param {EventTarget|null} currentTarget New current target.\n * @returns {void}\n * @private\n */\nexport function setCurrentTarget(event, currentTarget) {\n pd(event).currentTarget = currentTarget\n}\n\n/**\n * Set a passive listener of a given event.\n * @param {Event} event The event to set current target.\n * @param {Function|null} passiveListener New passive listener.\n * @returns {void}\n * @private\n */\nexport function setPassiveListener(event, passiveListener) {\n pd(event).passiveListener = passiveListener\n}\n","import {\n isStopped,\n setCurrentTarget,\n setEventPhase,\n setPassiveListener,\n wrapEvent,\n} from \"./event.mjs\"\n\n/**\n * @typedef {object} ListenerNode\n * @property {Function} listener\n * @property {1|2|3} listenerType\n * @property {boolean} passive\n * @property {boolean} once\n * @property {ListenerNode|null} next\n * @private\n */\n\n/**\n * @type {WeakMap>}\n * @private\n */\nconst listenersMap = new WeakMap()\n\n// Listener types\nconst CAPTURE = 1\nconst BUBBLE = 2\nconst ATTRIBUTE = 3\n\n/**\n * Check whether a given value is an object or not.\n * @param {any} x The value to check.\n * @returns {boolean} `true` if the value is an object.\n */\nfunction isObject(x) {\n return x !== null && typeof x === \"object\" //eslint-disable-line no-restricted-syntax\n}\n\n/**\n * Get listeners.\n * @param {EventTarget} eventTarget The event target to get.\n * @returns {Map} The listeners.\n * @private\n */\nfunction getListeners(eventTarget) {\n const listeners = listenersMap.get(eventTarget)\n if (listeners == null) {\n throw new TypeError(\n \"'this' is expected an EventTarget object, but got another value.\"\n )\n }\n return listeners\n}\n\n/**\n * Get the property descriptor for the event attribute of a given event.\n * @param {string} eventName The event name to get property descriptor.\n * @returns {PropertyDescriptor} The property descriptor.\n * @private\n */\nfunction defineEventAttributeDescriptor(eventName) {\n return {\n get() {\n const listeners = getListeners(this)\n let node = listeners.get(eventName)\n while (node != null) {\n if (node.listenerType === ATTRIBUTE) {\n return node.listener\n }\n node = node.next\n }\n return null\n },\n\n set(listener) {\n if (typeof listener !== \"function\" && !isObject(listener)) {\n listener = null // eslint-disable-line no-param-reassign\n }\n const listeners = getListeners(this)\n\n // Traverse to the tail while removing old value.\n let prev = null\n let node = listeners.get(eventName)\n while (node != null) {\n if (node.listenerType === ATTRIBUTE) {\n // Remove old value.\n if (prev !== null) {\n prev.next = node.next\n } else if (node.next !== null) {\n listeners.set(eventName, node.next)\n } else {\n listeners.delete(eventName)\n }\n } else {\n prev = node\n }\n\n node = node.next\n }\n\n // Add new value.\n if (listener !== null) {\n const newNode = {\n listener,\n listenerType: ATTRIBUTE,\n passive: false,\n once: false,\n next: null,\n }\n if (prev === null) {\n listeners.set(eventName, newNode)\n } else {\n prev.next = newNode\n }\n }\n },\n configurable: true,\n enumerable: true,\n }\n}\n\n/**\n * Define an event attribute (e.g. `eventTarget.onclick`).\n * @param {Object} eventTargetPrototype The event target prototype to define an event attrbite.\n * @param {string} eventName The event name to define.\n * @returns {void}\n */\nfunction defineEventAttribute(eventTargetPrototype, eventName) {\n Object.defineProperty(\n eventTargetPrototype,\n `on${eventName}`,\n defineEventAttributeDescriptor(eventName)\n )\n}\n\n/**\n * Define a custom EventTarget with event attributes.\n * @param {string[]} eventNames Event names for event attributes.\n * @returns {EventTarget} The custom EventTarget.\n * @private\n */\nfunction defineCustomEventTarget(eventNames) {\n /** CustomEventTarget */\n function CustomEventTarget() {\n EventTarget.call(this)\n }\n\n CustomEventTarget.prototype = Object.create(EventTarget.prototype, {\n constructor: {\n value: CustomEventTarget,\n configurable: true,\n writable: true,\n },\n })\n\n for (let i = 0; i < eventNames.length; ++i) {\n defineEventAttribute(CustomEventTarget.prototype, eventNames[i])\n }\n\n return CustomEventTarget\n}\n\n/**\n * EventTarget.\n *\n * - This is constructor if no arguments.\n * - This is a function which returns a CustomEventTarget constructor if there are arguments.\n *\n * For example:\n *\n * class A extends EventTarget {}\n * class B extends EventTarget(\"message\") {}\n * class C extends EventTarget(\"message\", \"error\") {}\n * class D extends EventTarget([\"message\", \"error\"]) {}\n */\nfunction EventTarget() {\n /*eslint-disable consistent-return */\n if (this instanceof EventTarget) {\n listenersMap.set(this, new Map())\n return\n }\n if (arguments.length === 1 && Array.isArray(arguments[0])) {\n return defineCustomEventTarget(arguments[0])\n }\n if (arguments.length > 0) {\n const types = new Array(arguments.length)\n for (let i = 0; i < arguments.length; ++i) {\n types[i] = arguments[i]\n }\n return defineCustomEventTarget(types)\n }\n throw new TypeError(\"Cannot call a class as a function\")\n /*eslint-enable consistent-return */\n}\n\n// Should be enumerable, but class methods are not enumerable.\nEventTarget.prototype = {\n /**\n * Add a given listener to this event target.\n * @param {string} eventName The event name to add.\n * @param {Function} listener The listener to add.\n * @param {boolean|{capture?:boolean,passive?:boolean,once?:boolean}} [options] The options for this listener.\n * @returns {void}\n */\n addEventListener(eventName, listener, options) {\n if (listener == null) {\n return\n }\n if (typeof listener !== \"function\" && !isObject(listener)) {\n throw new TypeError(\"'listener' should be a function or an object.\")\n }\n\n const listeners = getListeners(this)\n const optionsIsObj = isObject(options)\n const capture = optionsIsObj\n ? Boolean(options.capture)\n : Boolean(options)\n const listenerType = capture ? CAPTURE : BUBBLE\n const newNode = {\n listener,\n listenerType,\n passive: optionsIsObj && Boolean(options.passive),\n once: optionsIsObj && Boolean(options.once),\n next: null,\n }\n\n // Set it as the first node if the first node is null.\n let node = listeners.get(eventName)\n if (node === undefined) {\n listeners.set(eventName, newNode)\n return\n }\n\n // Traverse to the tail while checking duplication..\n let prev = null\n while (node != null) {\n if (\n node.listener === listener &&\n node.listenerType === listenerType\n ) {\n // Should ignore duplication.\n return\n }\n prev = node\n node = node.next\n }\n\n // Add it.\n prev.next = newNode\n },\n\n /**\n * Remove a given listener from this event target.\n * @param {string} eventName The event name to remove.\n * @param {Function} listener The listener to remove.\n * @param {boolean|{capture?:boolean,passive?:boolean,once?:boolean}} [options] The options for this listener.\n * @returns {void}\n */\n removeEventListener(eventName, listener, options) {\n if (listener == null) {\n return\n }\n\n const listeners = getListeners(this)\n const capture = isObject(options)\n ? Boolean(options.capture)\n : Boolean(options)\n const listenerType = capture ? CAPTURE : BUBBLE\n\n let prev = null\n let node = listeners.get(eventName)\n while (node != null) {\n if (\n node.listener === listener &&\n node.listenerType === listenerType\n ) {\n if (prev !== null) {\n prev.next = node.next\n } else if (node.next !== null) {\n listeners.set(eventName, node.next)\n } else {\n listeners.delete(eventName)\n }\n return\n }\n\n prev = node\n node = node.next\n }\n },\n\n /**\n * Dispatch a given event.\n * @param {Event|{type:string}} event The event to dispatch.\n * @returns {boolean} `false` if canceled.\n */\n dispatchEvent(event) {\n if (event == null || typeof event.type !== \"string\") {\n throw new TypeError('\"event.type\" should be a string.')\n }\n\n // If listeners aren't registered, terminate.\n const listeners = getListeners(this)\n const eventName = event.type\n let node = listeners.get(eventName)\n if (node == null) {\n return true\n }\n\n // Since we cannot rewrite several properties, so wrap object.\n const wrappedEvent = wrapEvent(this, event)\n\n // This doesn't process capturing phase and bubbling phase.\n // This isn't participating in a tree.\n let prev = null\n while (node != null) {\n // Remove this listener if it's once\n if (node.once) {\n if (prev !== null) {\n prev.next = node.next\n } else if (node.next !== null) {\n listeners.set(eventName, node.next)\n } else {\n listeners.delete(eventName)\n }\n } else {\n prev = node\n }\n\n // Call this listener\n setPassiveListener(\n wrappedEvent,\n node.passive ? node.listener : null\n )\n if (typeof node.listener === \"function\") {\n try {\n node.listener.call(this, wrappedEvent)\n } catch (err) {\n if (\n typeof console !== \"undefined\" &&\n typeof console.error === \"function\"\n ) {\n console.error(err)\n }\n }\n } else if (\n node.listenerType !== ATTRIBUTE &&\n typeof node.listener.handleEvent === \"function\"\n ) {\n node.listener.handleEvent(wrappedEvent)\n }\n\n // Break if `event.stopImmediatePropagation` was called.\n if (isStopped(wrappedEvent)) {\n break\n }\n\n node = node.next\n }\n setPassiveListener(wrappedEvent, null)\n setEventPhase(wrappedEvent, 0)\n setCurrentTarget(wrappedEvent, null)\n\n return !wrappedEvent.defaultPrevented\n },\n}\n\n// `constructor` is not enumerable.\nObject.defineProperty(EventTarget.prototype, \"constructor\", {\n value: EventTarget,\n configurable: true,\n writable: true,\n})\n\n// Ensure `eventTarget instanceof window.EventTarget` is `true`.\nif (\n typeof window !== \"undefined\" &&\n typeof window.EventTarget !== \"undefined\"\n) {\n Object.setPrototypeOf(EventTarget.prototype, window.EventTarget.prototype)\n}\n\nexport { defineEventAttribute, EventTarget }\nexport default EventTarget\n"],"names":["pd","event","retv","privateData","get","console","assert","setCancelFlag","data","passiveListener","cancelable","canceled","preventDefault","error","Event","eventTarget","set","eventPhase","currentTarget","stopped","immediateStopped","timeStamp","Date","now","Object","defineProperty","value","enumerable","key","keys","i","length","defineRedirectDescriptor","configurable","defineCallDescriptor","apply","arguments","defineWrapper","BaseEvent","proto","CustomEvent","call","prototype","create","constructor","writable","descriptor","getOwnPropertyDescriptor","isFunc","getWrapper","wrapper","wrappers","getPrototypeOf","wrapEvent","Wrapper","isStopped","setEventPhase","setCurrentTarget","setPassiveListener","isObject","x","_typeof","getListeners","listeners","listenersMap","TypeError","defineEventAttributeDescriptor","eventName","node","listenerType","listener","next","prev","delete","newNode","passive","once","defineEventAttribute","eventTargetPrototype","defineCustomEventTarget","eventNames","CustomEventTarget","EventTarget","Map","Array","isArray","types","WeakMap","type","target","composedPath","NONE","CAPTURING_PHASE","AT_TARGET","BUBBLING_PHASE","stopPropagation","stopImmediatePropagation","bubbles","defaultPrevented","composed","srcElement","cancelBubble","returnValue","initEvent","window","setPrototypeOf","CAPTURE","BUBBLE","addEventListener","options","optionsIsObj","capture","removeEventListener","dispatchEvent","wrappedEvent","err","handleEvent"],"mappings":";;;;wbAkCA,QAASA,CAAAA,CAAT,CAAYC,CAAZ,CAAmB,IACTC,CAAAA,CAAI,CAAGC,CAAW,CAACC,GAAZD,CAAgBF,CAAhBE,QACbE,CAAAA,OAAO,CAACC,MAARD,CACY,IAARH,EAAAA,CADJG,CAEI,6CAFJA,CAGIJ,CAHJI,EAKOH,EAOX,QAASK,CAAAA,CAAT,CAAuBC,CAAvB,CAA6B,OACG,KAAxBA,EAAAA,CAAI,CAACC,eADgB,MAarB,CAACD,CAAI,CAACP,KAALO,CAAWE,UAbS,GAiBzBF,CAAI,CAACG,QAALH,GAjByB,CAkBgB,UAArC,QAAOA,CAAAA,CAAI,CAACP,KAALO,CAAWI,cAlBG,EAmBrBJ,CAAI,CAACP,KAALO,CAAWI,cAAXJ,EAnBqB,QAGE,WAAnB,QAAOH,CAAAA,OAAP,EACyB,UAAzB,QAAOA,CAAAA,OAAO,CAACQ,KAJE,EAMjBR,OAAO,CAACQ,KAARR,CACI,oEADJA,CAEIG,CAAI,CAACC,eAFTJ,CANiB,EAiC7B,QAASS,CAAAA,CAAT,CAAeC,CAAf,CAA4Bd,CAA5B,CAAmC,CAC/BE,CAAW,CAACa,GAAZb,CAAgB,IAAhBA,CAAsB,CAClBY,WAAW,CAAXA,CADkB,CAElBd,KAAK,CAALA,CAFkB,CAGlBgB,UAAU,CAAE,CAHM,CAIlBC,aAAa,CAAEH,CAJG,CAKlBJ,QAAQ,GALU,CAMlBQ,OAAO,GANW,CAOlBC,gB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iD,CAExDjD,YAAY,GAF4C,CAGxDY,QAAQ,GAHgD,CAA5DrB,EAQsB,WAAlB,QAAOgF,CAAAA,MAAP,EAC8B,WAA9B,QAAOA,CAAAA,MAAM,CAACtB,aAEd1D,MAAM,CAACiF,cAAPjF,CAAsB0D,CAAW,CAACxC,SAAlClB,CAA6CgF,MAAM,CAACtB,WAAPsB,CAAmB9D,SAAhElB"} \ No newline at end of file diff --git a/deps/npm/node_modules/event-target-shim/index.d.ts b/deps/npm/node_modules/event-target-shim/index.d.ts deleted file mode 100644 index a30309782f93c0..00000000000000 --- a/deps/npm/node_modules/event-target-shim/index.d.ts +++ /dev/null @@ -1,399 +0,0 @@ -export as namespace EventTargetShim - -/** - * `Event` interface. - * @see https://dom.spec.whatwg.org/#event - */ -export interface Event { - /** - * The type of this event. - */ - readonly type: string - - /** - * The target of this event. - */ - readonly target: EventTarget<{}, {}, "standard"> | null - - /** - * The current target of this event. - */ - readonly currentTarget: EventTarget<{}, {}, "standard"> | null - - /** - * The target of this event. - * @deprecated - */ - readonly srcElement: any | null - - /** - * The composed path of this event. - */ - composedPath(): EventTarget<{}, {}, "standard">[] - - /** - * Constant of NONE. - */ - readonly NONE: number - - /** - * Constant of CAPTURING_PHASE. - */ - readonly CAPTURING_PHASE: number - - /** - * Constant of BUBBLING_PHASE. - */ - readonly BUBBLING_PHASE: number - - /** - * Constant of AT_TARGET. - */ - readonly AT_TARGET: number - - /** - * Indicates which phase of the event flow is currently being evaluated. - */ - readonly eventPhase: number - - /** - * Stop event bubbling. - */ - stopPropagation(): void - - /** - * Stop event bubbling. - */ - stopImmediatePropagation(): void - - /** - * Initialize event. - * @deprecated - */ - initEvent(type: string, bubbles?: boolean, cancelable?: boolean): void - - /** - * The flag indicating bubbling. - */ - readonly bubbles: boolean - - /** - * Stop event bubbling. - * @deprecated - */ - cancelBubble: boolean - - /** - * Set or get cancellation flag. - * @deprecated - */ - returnValue: boolean - - /** - * The flag indicating whether the event can be canceled. - */ - readonly cancelable: boolean - - /** - * Cancel this event. - */ - preventDefault(): void - - /** - * The flag to indicating whether the event was canceled. - */ - readonly defaultPrevented: boolean - - /** - * The flag to indicating if event is composed. - */ - readonly composed: boolean - - /** - * Indicates whether the event was dispatched by the user agent. - */ - readonly isTrusted: boolean - - /** - * The unix time of this event. - */ - readonly timeStamp: number -} - -/** - * The constructor of `EventTarget` interface. - */ -export type EventTargetConstructor< - TEvents extends EventTarget.EventDefinition = {}, - TEventAttributes extends EventTarget.EventDefinition = {}, - TMode extends EventTarget.Mode = "loose" -> = { - prototype: EventTarget - new(): EventTarget -} - -/** - * `EventTarget` interface. - * @see https://dom.spec.whatwg.org/#interface-eventtarget - */ -export type EventTarget< - TEvents extends EventTarget.EventDefinition = {}, - TEventAttributes extends EventTarget.EventDefinition = {}, - TMode extends EventTarget.Mode = "loose" -> = EventTarget.EventAttributes & { - /** - * Add a given listener to this event target. - * @param eventName The event name to add. - * @param listener The listener to add. - * @param options The options for this listener. - */ - addEventListener>( - type: TEventType, - listener: - | EventTarget.Listener> - | null, - options?: boolean | EventTarget.AddOptions - ): void - - /** - * Remove a given listener from this event target. - * @param eventName The event name to remove. - * @param listener The listener to remove. - * @param options The options for this listener. - */ - removeEventListener>( - type: TEventType, - listener: - | EventTarget.Listener> - | null, - options?: boolean | EventTarget.RemoveOptions - ): void - - /** - * Dispatch a given event. - * @param event The event to dispatch. - * @returns `false` if canceled. - */ - dispatchEvent>( - event: EventTarget.EventData - ): boolean -} - -export const EventTarget: EventTargetConstructor & { - /** - * Create an `EventTarget` instance with detailed event definition. - * - * The detailed event definition requires to use `defineEventAttribute()` - * function later. - * - * Unfortunately, the second type parameter `TEventAttributes` was needed - * because we cannot compute string literal types. - * - * @example - * const signal = new EventTarget<{ abort: Event }, { onabort: Event }>() - * defineEventAttribute(signal, "abort") - */ - new < - TEvents extends EventTarget.EventDefinition, - TEventAttributes extends EventTarget.EventDefinition, - TMode extends EventTarget.Mode = "loose" - >(): EventTarget - - /** - * Define an `EventTarget` constructor with attribute events and detailed event definition. - * - * Unfortunately, the second type parameter `TEventAttributes` was needed - * because we cannot compute string literal types. - * - * @example - * class AbortSignal extends EventTarget<{ abort: Event }, { onabort: Event }>("abort") { - * abort(): void {} - * } - * - * @param events Optional event attributes (e.g. passing in `"click"` adds `onclick` to prototype). - */ - < - TEvents extends EventTarget.EventDefinition = {}, - TEventAttributes extends EventTarget.EventDefinition = {}, - TMode extends EventTarget.Mode = "loose" - >(events: string[]): EventTargetConstructor< - TEvents, - TEventAttributes, - TMode - > - - /** - * Define an `EventTarget` constructor with attribute events and detailed event definition. - * - * Unfortunately, the second type parameter `TEventAttributes` was needed - * because we cannot compute string literal types. - * - * @example - * class AbortSignal extends EventTarget<{ abort: Event }, { onabort: Event }>("abort") { - * abort(): void {} - * } - * - * @param events Optional event attributes (e.g. passing in `"click"` adds `onclick` to prototype). - */ - < - TEvents extends EventTarget.EventDefinition = {}, - TEventAttributes extends EventTarget.EventDefinition = {}, - TMode extends EventTarget.Mode = "loose" - >(event0: string, ...events: string[]): EventTargetConstructor< - TEvents, - TEventAttributes, - TMode - > -} - -export namespace EventTarget { - /** - * Options of `removeEventListener()` method. - */ - export interface RemoveOptions { - /** - * The flag to indicate that the listener is for the capturing phase. - */ - capture?: boolean - } - - /** - * Options of `addEventListener()` method. - */ - export interface AddOptions extends RemoveOptions { - /** - * The flag to indicate that the listener doesn't support - * `event.preventDefault()` operation. - */ - passive?: boolean - /** - * The flag to indicate that the listener will be removed on the first - * event. - */ - once?: boolean - } - - /** - * The type of regular listeners. - */ - export interface FunctionListener { - (event: TEvent): void - } - - /** - * The type of object listeners. - */ - export interface ObjectListener { - handleEvent(event: TEvent): void - } - - /** - * The type of listeners. - */ - export type Listener = - | FunctionListener - | ObjectListener - - /** - * Event definition. - */ - export type EventDefinition = { - readonly [key: string]: Event - } - - /** - * Mapped type for event attributes. - */ - export type EventAttributes = { - [P in keyof TEventAttributes]: - | FunctionListener - | null - } - - /** - * The type of event data for `dispatchEvent()` method. - */ - export type EventData< - TEvents extends EventDefinition, - TEventType extends keyof TEvents | string, - TMode extends Mode - > = - TEventType extends keyof TEvents - ? ( - // Require properties which are not generated automatically. - & Pick< - TEvents[TEventType], - Exclude - > - // Properties which are generated automatically are optional. - & Partial> - ) - : ( - TMode extends "standard" - ? Event - : Event | NonStandardEvent - ) - - /** - * The string literal types of the properties which are generated - * automatically in `dispatchEvent()` method. - */ - export type OmittableEventKeys = Exclude - - /** - * The type of event data. - */ - export type NonStandardEvent = { - [key: string]: any - type: string - } - - /** - * The type of listeners. - */ - export type PickEvent< - TEvents extends EventDefinition, - TEventType extends keyof TEvents | string, - > = - TEventType extends keyof TEvents - ? TEvents[TEventType] - : Event - - /** - * Event type candidates. - */ - export type EventType< - TEvents extends EventDefinition, - TMode extends Mode - > = - TMode extends "strict" - ? keyof TEvents - : keyof TEvents | string - - /** - * - `"strict"` ..... Methods don't accept unknown events. - * `dispatchEvent()` accepts partial objects. - * - `"loose"` ...... Methods accept unknown events. - * `dispatchEvent()` accepts partial objects. - * - `"standard"` ... Methods accept unknown events. - * `dispatchEvent()` doesn't accept partial objects. - */ - export type Mode = "strict" | "standard" | "loose" -} - -/** - * Specialized `type` property. - */ -export type Type = { type: T } - -/** - * Define an event attribute (e.g. `eventTarget.onclick`). - * @param prototype The event target prototype to define an event attribute. - * @param eventName The event name to define. - */ -export function defineEventAttribute( - prototype: EventTarget, - eventName: string -): void - -export default EventTarget diff --git a/deps/npm/node_modules/fastest-levenshtein/esm/mod.d.ts b/deps/npm/node_modules/fastest-levenshtein/esm/mod.d.ts deleted file mode 100644 index 50927ef5005803..00000000000000 --- a/deps/npm/node_modules/fastest-levenshtein/esm/mod.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -declare const distance: (a: string, b: string) => number; -declare const closest: (str: string, arr: readonly string[]) => string; -export { closest, distance }; -//# sourceMappingURL=mod.d.ts.map \ No newline at end of file diff --git a/deps/npm/node_modules/fastest-levenshtein/esm/mod.d.ts.map b/deps/npm/node_modules/fastest-levenshtein/esm/mod.d.ts.map deleted file mode 100644 index 7fd5c175637b30..00000000000000 --- a/deps/npm/node_modules/fastest-levenshtein/esm/mod.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../mod.ts"],"names":[],"mappings":"AAiHA,QAAA,MAAM,QAAQ,MAAO,MAAM,KAAK,MAAM,KAAG,MAaxC,CAAC;AAEF,QAAA,MAAM,OAAO,QAAS,MAAM,OAAO,SAAS,MAAM,EAAE,KAAG,MAWtD,CAAC;AAEF,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC"} \ No newline at end of file diff --git a/deps/npm/node_modules/fastest-levenshtein/mod.d.ts b/deps/npm/node_modules/fastest-levenshtein/mod.d.ts deleted file mode 100644 index b1b5ce7f7de951..00000000000000 --- a/deps/npm/node_modules/fastest-levenshtein/mod.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -declare const distance: (a: string, b: string) => number; -declare const closest: (str: string, arr: readonly string[]) => string; -export { closest, distance }; diff --git a/deps/npm/node_modules/fastest-levenshtein/test.ts b/deps/npm/node_modules/fastest-levenshtein/test.ts deleted file mode 100644 index 41939bcdc8e2be..00000000000000 --- a/deps/npm/node_modules/fastest-levenshtein/test.ts +++ /dev/null @@ -1,67 +0,0 @@ -const { closest, distance } = require("./mod.js"); - -const levenshtein = (a, b) => { - if (a.length === 0) { - return b.length; - } - if (b.length === 0) { - return a.length; - } - - if (a.length > b.length) { - const tmp = a; - a = b; - b = tmp; - } - - const row = []; - for (let i = 0; i <= a.length; i++) { - row[i] = i; - } - - for (let i = 1; i <= b.length; i++) { - let prev = i; - for (let j = 1; j <= a.length; j++) { - let val = 0; - if (b.charAt(i - 1) === a.charAt(j - 1)) { - val = row[j - 1]; - } else { - val = Math.min(row[j - 1] + 1, prev + 1, row[j] + 1); - } - row[j - 1] = prev; - prev = val; - } - row[a.length] = prev; - } - - return row[a.length]; -}; - -const makeid = (length) => { - let result = ""; - const characters = - "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; - const charactersLength = characters.length; - for (let i = 0; i < length; i++) { - result += characters.charAt(Math.floor(Math.random() * charactersLength)); - } - return result; -}; - -test("test compare", () => { - for (let i = 0; i < 1000; i++) { - const rnd_num1 = (Math.random() * 1000) | 0; - const rnd_num2 = (Math.random() * 1000) | 0; - const rnd_string1 = makeid(rnd_num1); - const rnd_string2 = makeid(rnd_num2); - const actual = distance(rnd_string1, rnd_string2); - const expected = levenshtein(rnd_string1, rnd_string2); - expect(actual).toBe(expected); - } -}); - -test("test find", () => { - const actual = closest("fast", ["slow", "faster", "fastest"]); - const expected = "faster"; - expect(actual).toBe(expected); -}); diff --git a/deps/npm/node_modules/glob/LICENSE b/deps/npm/node_modules/glob/LICENSE index 39e8fe16f665ae..ec7df93329abf3 100644 --- a/deps/npm/node_modules/glob/LICENSE +++ b/deps/npm/node_modules/glob/LICENSE @@ -1,6 +1,6 @@ The ISC License -Copyright (c) 2009-2022 Isaac Z. Schlueter and Contributors +Copyright (c) 2009-2023 Isaac Z. Schlueter and Contributors Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above diff --git a/deps/npm/node_modules/glob/common.js b/deps/npm/node_modules/glob/common.js deleted file mode 100644 index 61a4452f097dcd..00000000000000 --- a/deps/npm/node_modules/glob/common.js +++ /dev/null @@ -1,244 +0,0 @@ -exports.setopts = setopts -exports.ownProp = ownProp -exports.makeAbs = makeAbs -exports.finish = finish -exports.mark = mark -exports.isIgnored = isIgnored -exports.childrenIgnored = childrenIgnored - -function ownProp (obj, field) { - return Object.prototype.hasOwnProperty.call(obj, field) -} - -var fs = require("fs") -var path = require("path") -var minimatch = require("minimatch") -var isAbsolute = require("path").isAbsolute -var Minimatch = minimatch.Minimatch - -function alphasort (a, b) { - return a.localeCompare(b, 'en') -} - -function setupIgnores (self, options) { - self.ignore = options.ignore || [] - - if (!Array.isArray(self.ignore)) - self.ignore = [self.ignore] - - if (self.ignore.length) { - self.ignore = self.ignore.map(ignoreMap) - } -} - -// ignore patterns are always in dot:true mode. -function ignoreMap (pattern) { - var gmatcher = null - if (pattern.slice(-3) === '/**') { - var gpattern = pattern.replace(/(\/\*\*)+$/, '') - gmatcher = new Minimatch(gpattern, { dot: true }) - } - - return { - matcher: new Minimatch(pattern, { dot: true }), - gmatcher: gmatcher - } -} - -function setopts (self, pattern, options) { - if (!options) - options = {} - - // base-matching: just use globstar for that. - if (options.matchBase && -1 === pattern.indexOf("/")) { - if (options.noglobstar) { - throw new Error("base matching requires globstar") - } - pattern = "**/" + pattern - } - - self.windowsPathsNoEscape = !!options.windowsPathsNoEscape || - options.allowWindowsEscape === false - if (self.windowsPathsNoEscape) { - pattern = pattern.replace(/\\/g, '/') - } - - self.silent = !!options.silent - self.pattern = pattern - self.strict = options.strict !== false - self.realpath = !!options.realpath - self.realpathCache = options.realpathCache || Object.create(null) - self.follow = !!options.follow - self.dot = !!options.dot - self.mark = !!options.mark - self.nodir = !!options.nodir - if (self.nodir) - self.mark = true - self.sync = !!options.sync - self.nounique = !!options.nounique - self.nonull = !!options.nonull - self.nosort = !!options.nosort - self.nocase = !!options.nocase - self.stat = !!options.stat - self.noprocess = !!options.noprocess - self.absolute = !!options.absolute - self.fs = options.fs || fs - - self.maxLength = options.maxLength || Infinity - self.cache = options.cache || Object.create(null) - self.statCache = options.statCache || Object.create(null) - self.symlinks = options.symlinks || Object.create(null) - - setupIgnores(self, options) - - self.changedCwd = false - var cwd = process.cwd() - if (!ownProp(options, "cwd")) - self.cwd = path.resolve(cwd) - else { - self.cwd = path.resolve(options.cwd) - self.changedCwd = self.cwd !== cwd - } - - self.root = options.root || path.resolve(self.cwd, "/") - self.root = path.resolve(self.root) - - // TODO: is an absolute `cwd` supposed to be resolved against `root`? - // e.g. { cwd: '/test', root: __dirname } === path.join(__dirname, '/test') - self.cwdAbs = isAbsolute(self.cwd) ? self.cwd : makeAbs(self, self.cwd) - self.nomount = !!options.nomount - - if (process.platform === "win32") { - self.root = self.root.replace(/\\/g, "/") - self.cwd = self.cwd.replace(/\\/g, "/") - self.cwdAbs = self.cwdAbs.replace(/\\/g, "/") - } - - // disable comments and negation in Minimatch. - // Note that they are not supported in Glob itself anyway. - options.nonegate = true - options.nocomment = true - - self.minimatch = new Minimatch(pattern, options) - self.options = self.minimatch.options -} - -function finish (self) { - var nou = self.nounique - var all = nou ? [] : Object.create(null) - - for (var i = 0, l = self.matches.length; i < l; i ++) { - var matches = self.matches[i] - if (!matches || Object.keys(matches).length === 0) { - if (self.nonull) { - // do like the shell, and spit out the literal glob - var literal = self.minimatch.globSet[i] - if (nou) - all.push(literal) - else - all[literal] = true - } - } else { - // had matches - var m = Object.keys(matches) - if (nou) - all.push.apply(all, m) - else - m.forEach(function (m) { - all[m] = true - }) - } - } - - if (!nou) - all = Object.keys(all) - - if (!self.nosort) - all = all.sort(alphasort) - - // at *some* point we statted all of these - if (self.mark) { - for (var i = 0; i < all.length; i++) { - all[i] = self._mark(all[i]) - } - if (self.nodir) { - all = all.filter(function (e) { - var notDir = !(/\/$/.test(e)) - var c = self.cache[e] || self.cache[makeAbs(self, e)] - if (notDir && c) - notDir = c !== 'DIR' && !Array.isArray(c) - return notDir - }) - } - } - - if (self.ignore.length) - all = all.filter(function(m) { - return !isIgnored(self, m) - }) - - self.found = all -} - -function mark (self, p) { - var abs = makeAbs(self, p) - var c = self.cache[abs] - var m = p - if (c) { - var isDir = c === 'DIR' || Array.isArray(c) - var slash = p.slice(-1) === '/' - - if (isDir && !slash) - m += '/' - else if (!isDir && slash) - m = m.slice(0, -1) - - if (m !== p) { - var mabs = makeAbs(self, m) - self.statCache[mabs] = self.statCache[abs] - self.cache[mabs] = self.cache[abs] - } - } - - return m -} - -// lotta situps... -function makeAbs (self, f) { - var abs = f - if (f.charAt(0) === '/') { - abs = path.join(self.root, f) - } else if (isAbsolute(f) || f === '') { - abs = f - } else if (self.changedCwd) { - abs = path.resolve(self.cwd, f) - } else { - abs = path.resolve(f) - } - - if (process.platform === 'win32') - abs = abs.replace(/\\/g, '/') - - return abs -} - - -// Return true, if pattern ends with globstar '**', for the accompanying parent directory. -// Ex:- If node_modules/** is the pattern, add 'node_modules' to ignore list along with it's contents -function isIgnored (self, path) { - if (!self.ignore.length) - return false - - return self.ignore.some(function(item) { - return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path)) - }) -} - -function childrenIgnored (self, path) { - if (!self.ignore.length) - return false - - return self.ignore.some(function(item) { - return !!(item.gmatcher && item.gmatcher.match(path)) - }) -} diff --git a/deps/npm/node_modules/glob/dist/cjs/glob.js b/deps/npm/node_modules/glob/dist/cjs/glob.js new file mode 100644 index 00000000000000..5e1d25ed4b33d0 --- /dev/null +++ b/deps/npm/node_modules/glob/dist/cjs/glob.js @@ -0,0 +1,228 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Glob = void 0; +const minimatch_1 = require("minimatch"); +const path_scurry_1 = require("path-scurry"); +const url_1 = require("url"); +const pattern_js_1 = require("./pattern.js"); +const walker_js_1 = require("./walker.js"); +// if no process global, just call it linux. +// so we default to case-sensitive, / separators +const defaultPlatform = typeof process === 'object' && + process && + typeof process.platform === 'string' + ? process.platform + : 'linux'; +/** + * An object that can perform glob pattern traversals. + */ +class Glob { + absolute; + cwd; + root; + dot; + dotRelative; + follow; + ignore; + magicalBraces; + mark; + matchBase; + maxDepth; + nobrace; + nocase; + nodir; + noext; + noglobstar; + pattern; + platform; + realpath; + scurry; + stat; + signal; + windowsPathsNoEscape; + withFileTypes; + /** + * The options provided to the constructor. + */ + opts; + /** + * An array of parsed immutable {@link Pattern} objects. + */ + patterns; + /** + * All options are stored as properties on the `Glob` object. + * + * See {@link GlobOptions} for full options descriptions. + * + * Note that a previous `Glob` object can be passed as the + * `GlobOptions` to another `Glob` instantiation to re-use settings + * and caches with a new pattern. + * + * Traversal functions can be called multiple times to run the walk + * again. + */ + constructor(pattern, opts) { + this.withFileTypes = !!opts.withFileTypes; + this.signal = opts.signal; + this.follow = !!opts.follow; + this.dot = !!opts.dot; + this.dotRelative = !!opts.dotRelative; + this.nodir = !!opts.nodir; + this.mark = !!opts.mark; + if (!opts.cwd) { + this.cwd = ''; + } + else if (opts.cwd instanceof URL || opts.cwd.startsWith('file://')) { + opts.cwd = (0, url_1.fileURLToPath)(opts.cwd); + } + this.cwd = opts.cwd || ''; + this.root = opts.root; + this.magicalBraces = !!opts.magicalBraces; + this.nobrace = !!opts.nobrace; + this.noext = !!opts.noext; + this.realpath = !!opts.realpath; + this.absolute = opts.absolute; + this.noglobstar = !!opts.noglobstar; + this.matchBase = !!opts.matchBase; + this.maxDepth = + typeof opts.maxDepth === 'number' ? opts.maxDepth : Infinity; + this.stat = !!opts.stat; + this.ignore = opts.ignore; + if (this.withFileTypes && this.absolute !== undefined) { + throw new Error('cannot set absolute and withFileTypes:true'); + } + if (typeof pattern === 'string') { + pattern = [pattern]; + } + this.windowsPathsNoEscape = + !!opts.windowsPathsNoEscape || + opts.allowWindowsEscape === false; + if (this.windowsPathsNoEscape) { + pattern = pattern.map(p => p.replace(/\\/g, '/')); + } + if (this.matchBase) { + if (opts.noglobstar) { + throw new TypeError('base matching requires globstar'); + } + pattern = pattern.map(p => (p.includes('/') ? p : `./**/${p}`)); + } + this.pattern = pattern; + this.platform = opts.platform || defaultPlatform; + this.opts = { ...opts, platform: this.platform }; + if (opts.scurry) { + this.scurry = opts.scurry; + if (opts.nocase !== undefined && + opts.nocase !== opts.scurry.nocase) { + throw new Error('nocase option contradicts provided scurry option'); + } + } + else { + const Scurry = opts.platform === 'win32' + ? path_scurry_1.PathScurryWin32 + : opts.platform === 'darwin' + ? path_scurry_1.PathScurryDarwin + : opts.platform + ? path_scurry_1.PathScurryPosix + : path_scurry_1.PathScurry; + this.scurry = new Scurry(this.cwd, { + nocase: opts.nocase, + fs: opts.fs, + }); + } + this.nocase = this.scurry.nocase; + const mmo = { + // default nocase based on platform + ...opts, + dot: this.dot, + matchBase: this.matchBase, + nobrace: this.nobrace, + nocase: this.nocase, + nocaseMagicOnly: true, + nocomment: true, + noext: this.noext, + nonegate: true, + optimizationLevel: 2, + platform: this.platform, + windowsPathsNoEscape: this.windowsPathsNoEscape, + }; + const mms = this.pattern.map(p => new minimatch_1.Minimatch(p, mmo)); + const [matchSet, globParts] = mms.reduce((set, m) => { + set[0].push(...m.set); + set[1].push(...m.globParts); + return set; + }, [[], []]); + this.patterns = matchSet.map((set, i) => { + return new pattern_js_1.Pattern(set, globParts[i], 0, this.platform); + }); + } + async walk() { + // Walkers always return array of Path objects, so we just have to + // coerce them into the right shape. It will have already called + // realpath() if the option was set to do so, so we know that's cached. + // start out knowing the cwd, at least + return [ + ...(await new walker_js_1.GlobWalker(this.patterns, this.scurry.cwd, { + ...this.opts, + maxDepth: this.maxDepth !== Infinity + ? this.maxDepth + this.scurry.cwd.depth() + : Infinity, + platform: this.platform, + nocase: this.nocase, + }).walk()), + ]; + } + walkSync() { + return [ + ...new walker_js_1.GlobWalker(this.patterns, this.scurry.cwd, { + ...this.opts, + maxDepth: this.maxDepth !== Infinity + ? this.maxDepth + this.scurry.cwd.depth() + : Infinity, + platform: this.platform, + nocase: this.nocase, + }).walkSync(), + ]; + } + stream() { + return new walker_js_1.GlobStream(this.patterns, this.scurry.cwd, { + ...this.opts, + maxDepth: this.maxDepth !== Infinity + ? this.maxDepth + this.scurry.cwd.depth() + : Infinity, + platform: this.platform, + nocase: this.nocase, + }).stream(); + } + streamSync() { + return new walker_js_1.GlobStream(this.patterns, this.scurry.cwd, { + ...this.opts, + maxDepth: this.maxDepth !== Infinity + ? this.maxDepth + this.scurry.cwd.depth() + : Infinity, + platform: this.platform, + nocase: this.nocase, + }).streamSync(); + } + /** + * Default sync iteration function. Returns a Generator that + * iterates over the results. + */ + iterateSync() { + return this.streamSync()[Symbol.iterator](); + } + [Symbol.iterator]() { + return this.iterateSync(); + } + /** + * Default async iteration function. Returns an AsyncGenerator that + * iterates over the results. + */ + iterate() { + return this.stream()[Symbol.asyncIterator](); + } + [Symbol.asyncIterator]() { + return this.iterate(); + } +} +exports.Glob = Glob; +//# sourceMappingURL=glob.js.map \ No newline at end of file diff --git a/deps/npm/node_modules/glob/dist/cjs/has-magic.js b/deps/npm/node_modules/glob/dist/cjs/has-magic.js new file mode 100644 index 00000000000000..0918bd57e0f1c2 --- /dev/null +++ b/deps/npm/node_modules/glob/dist/cjs/has-magic.js @@ -0,0 +1,27 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.hasMagic = void 0; +const minimatch_1 = require("minimatch"); +/** + * Return true if the patterns provided contain any magic glob characters, + * given the options provided. + * + * Brace expansion is not considered "magic" unless the `magicalBraces` option + * is set, as brace expansion just turns one string into an array of strings. + * So a pattern like `'x{a,b}y'` would return `false`, because `'xay'` and + * `'xby'` both do not contain any magic glob characters, and it's treated the + * same as if you had called it on `['xay', 'xby']`. When `magicalBraces:true` + * is in the options, brace expansion _is_ treated as a pattern having magic. + */ +const hasMagic = (pattern, options = {}) => { + if (!Array.isArray(pattern)) { + pattern = [pattern]; + } + for (const p of pattern) { + if (new minimatch_1.Minimatch(p, options).hasMagic()) + return true; + } + return false; +}; +exports.hasMagic = hasMagic; +//# sourceMappingURL=has-magic.js.map \ No newline at end of file diff --git a/deps/npm/node_modules/glob/dist/cjs/ignore.js b/deps/npm/node_modules/glob/dist/cjs/ignore.js new file mode 100644 index 00000000000000..0cbcca335e1cca --- /dev/null +++ b/deps/npm/node_modules/glob/dist/cjs/ignore.js @@ -0,0 +1,103 @@ +"use strict"; +// give it a pattern, and it'll be able to tell you if +// a given path should be ignored. +// Ignoring a path ignores its children if the pattern ends in /** +// Ignores are always parsed in dot:true mode +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Ignore = void 0; +const minimatch_1 = require("minimatch"); +const pattern_js_1 = require("./pattern.js"); +const defaultPlatform = typeof process === 'object' && + process && + typeof process.platform === 'string' + ? process.platform + : 'linux'; +/** + * Class used to process ignored patterns + */ +class Ignore { + relative; + relativeChildren; + absolute; + absoluteChildren; + constructor(ignored, { nobrace, nocase, noext, noglobstar, platform = defaultPlatform, }) { + this.relative = []; + this.absolute = []; + this.relativeChildren = []; + this.absoluteChildren = []; + const mmopts = { + dot: true, + nobrace, + nocase, + noext, + noglobstar, + optimizationLevel: 2, + platform, + nocomment: true, + nonegate: true, + }; + // this is a little weird, but it gives us a clean set of optimized + // minimatch matchers, without getting tripped up if one of them + // ends in /** inside a brace section, and it's only inefficient at + // the start of the walk, not along it. + // It'd be nice if the Pattern class just had a .test() method, but + // handling globstars is a bit of a pita, and that code already lives + // in minimatch anyway. + // Another way would be if maybe Minimatch could take its set/globParts + // as an option, and then we could at least just use Pattern to test + // for absolute-ness. + // Yet another way, Minimatch could take an array of glob strings, and + // a cwd option, and do the right thing. + for (const ign of ignored) { + const mm = new minimatch_1.Minimatch(ign, mmopts); + for (let i = 0; i < mm.set.length; i++) { + const parsed = mm.set[i]; + const globParts = mm.globParts[i]; + const p = new pattern_js_1.Pattern(parsed, globParts, 0, platform); + const m = new minimatch_1.Minimatch(p.globString(), mmopts); + const children = globParts[globParts.length - 1] === '**'; + const absolute = p.isAbsolute(); + if (absolute) + this.absolute.push(m); + else + this.relative.push(m); + if (children) { + if (absolute) + this.absoluteChildren.push(m); + else + this.relativeChildren.push(m); + } + } + } + } + ignored(p) { + const fullpath = p.fullpath(); + const fullpaths = `${fullpath}/`; + const relative = p.relative() || '.'; + const relatives = `${relative}/`; + for (const m of this.relative) { + if (m.match(relative) || m.match(relatives)) + return true; + } + for (const m of this.absolute) { + if (m.match(fullpath) || m.match(fullpaths)) + return true; + } + return false; + } + childrenIgnored(p) { + const fullpath = p.fullpath() + '/'; + const relative = (p.relative() || '.') + '/'; + for (const m of this.relativeChildren) { + if (m.match(relative)) + return true; + } + for (const m of this.absoluteChildren) { + if (m.match(fullpath)) + true; + } + return false; + } +} +exports.Ignore = Ignore; +//# sourceMappingURL=ignore.js.map \ No newline at end of file diff --git a/deps/npm/node_modules/glob/dist/cjs/index-cjs.js b/deps/npm/node_modules/glob/dist/cjs/index-cjs.js new file mode 100644 index 00000000000000..e2b324783e8076 --- /dev/null +++ b/deps/npm/node_modules/glob/dist/cjs/index-cjs.js @@ -0,0 +1,7 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const index_js_1 = __importDefault(require("./index.js")); +module.exports = Object.assign(index_js_1.default, { default: index_js_1.default, glob: index_js_1.default }); +//# sourceMappingURL=index-cjs.js.map \ No newline at end of file diff --git a/deps/npm/node_modules/glob/dist/cjs/index.js b/deps/npm/node_modules/glob/dist/cjs/index.js new file mode 100644 index 00000000000000..0b6842da937af4 --- /dev/null +++ b/deps/npm/node_modules/glob/dist/cjs/index.js @@ -0,0 +1,68 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.hasMagic = exports.Glob = exports.unescape = exports.escape = exports.sync = exports.iterate = exports.iterateSync = exports.stream = exports.streamSync = exports.globIterate = exports.globIterateSync = exports.glob = exports.globSync = exports.globStream = exports.globStreamSync = void 0; +const minimatch_1 = require("minimatch"); +const glob_js_1 = require("./glob.js"); +const has_magic_js_1 = require("./has-magic.js"); +function globStreamSync(pattern, options = {}) { + return new glob_js_1.Glob(pattern, options).streamSync(); +} +exports.globStreamSync = globStreamSync; +function globStream(pattern, options = {}) { + return new glob_js_1.Glob(pattern, options).stream(); +} +exports.globStream = globStream; +function globSync(pattern, options = {}) { + return new glob_js_1.Glob(pattern, options).walkSync(); +} +exports.globSync = globSync; +async function glob(pattern, options = {}) { + return new glob_js_1.Glob(pattern, options).walk(); +} +exports.glob = glob; +function globIterateSync(pattern, options = {}) { + return new glob_js_1.Glob(pattern, options).iterateSync(); +} +exports.globIterateSync = globIterateSync; +function globIterate(pattern, options = {}) { + return new glob_js_1.Glob(pattern, options).iterate(); +} +exports.globIterate = globIterate; +// aliases: glob.sync.stream() glob.stream.sync() glob.sync() etc +exports.streamSync = globStreamSync; +exports.stream = Object.assign(globStream, { sync: globStreamSync }); +exports.iterateSync = globIterateSync; +exports.iterate = Object.assign(globIterate, { + sync: globIterateSync, +}); +exports.sync = Object.assign(globSync, { + stream: globStreamSync, + iterate: globIterateSync, +}); +/* c8 ignore start */ +var minimatch_2 = require("minimatch"); +Object.defineProperty(exports, "escape", { enumerable: true, get: function () { return minimatch_2.escape; } }); +Object.defineProperty(exports, "unescape", { enumerable: true, get: function () { return minimatch_2.unescape; } }); +var glob_js_2 = require("./glob.js"); +Object.defineProperty(exports, "Glob", { enumerable: true, get: function () { return glob_js_2.Glob; } }); +var has_magic_js_2 = require("./has-magic.js"); +Object.defineProperty(exports, "hasMagic", { enumerable: true, get: function () { return has_magic_js_2.hasMagic; } }); +/* c8 ignore stop */ +exports.default = Object.assign(glob, { + glob, + globSync, + sync: exports.sync, + globStream, + stream: exports.stream, + globStreamSync, + streamSync: exports.streamSync, + globIterate, + iterate: exports.iterate, + globIterateSync, + iterateSync: exports.iterateSync, + Glob: glob_js_1.Glob, + hasMagic: has_magic_js_1.hasMagic, + escape: minimatch_1.escape, + unescape: minimatch_1.unescape, +}); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/deps/npm/node_modules/glob/dist/cjs/package.json b/deps/npm/node_modules/glob/dist/cjs/package.json new file mode 100644 index 00000000000000..5bbefffbabee39 --- /dev/null +++ b/deps/npm/node_modules/glob/dist/cjs/package.json @@ -0,0 +1,3 @@ +{ + "type": "commonjs" +} diff --git a/deps/npm/node_modules/glob/dist/cjs/pattern.js b/deps/npm/node_modules/glob/dist/cjs/pattern.js new file mode 100644 index 00000000000000..181371293d8605 --- /dev/null +++ b/deps/npm/node_modules/glob/dist/cjs/pattern.js @@ -0,0 +1,219 @@ +"use strict"; +// this is just a very light wrapper around 2 arrays with an offset index +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Pattern = void 0; +const minimatch_1 = require("minimatch"); +const isPatternList = (pl) => pl.length >= 1; +const isGlobList = (gl) => gl.length >= 1; +/** + * An immutable-ish view on an array of glob parts and their parsed + * results + */ +class Pattern { + #patternList; + #globList; + #index; + length; + #platform; + #rest; + #globString; + #isDrive; + #isUNC; + #isAbsolute; + #followGlobstar = true; + constructor(patternList, globList, index, platform) { + if (!isPatternList(patternList)) { + throw new TypeError('empty pattern list'); + } + if (!isGlobList(globList)) { + throw new TypeError('empty glob list'); + } + if (globList.length !== patternList.length) { + throw new TypeError('mismatched pattern list and glob list lengths'); + } + this.length = patternList.length; + if (index < 0 || index >= this.length) { + throw new TypeError('index out of range'); + } + this.#patternList = patternList; + this.#globList = globList; + this.#index = index; + this.#platform = platform; + // normalize root entries of absolute patterns on initial creation. + if (this.#index === 0) { + // c: => ['c:/'] + // C:/ => ['C:/'] + // C:/x => ['C:/', 'x'] + // //host/share => ['//host/share/'] + // //host/share/ => ['//host/share/'] + // //host/share/x => ['//host/share/', 'x'] + // /etc => ['/', 'etc'] + // / => ['/'] + if (this.isUNC()) { + // '' / '' / 'host' / 'share' + const [p0, p1, p2, p3, ...prest] = this.#patternList; + const [g0, g1, g2, g3, ...grest] = this.#globList; + if (prest[0] === '') { + // ends in / + prest.shift(); + grest.shift(); + } + const p = [p0, p1, p2, p3, ''].join('/'); + const g = [g0, g1, g2, g3, ''].join('/'); + this.#patternList = [p, ...prest]; + this.#globList = [g, ...grest]; + this.length = this.#patternList.length; + } + else if (this.isDrive() || this.isAbsolute()) { + const [p1, ...prest] = this.#patternList; + const [g1, ...grest] = this.#globList; + if (prest[0] === '') { + // ends in / + prest.shift(); + grest.shift(); + } + const p = p1 + '/'; + const g = g1 + '/'; + this.#patternList = [p, ...prest]; + this.#globList = [g, ...grest]; + this.length = this.#patternList.length; + } + } + } + /** + * The first entry in the parsed list of patterns + */ + pattern() { + return this.#patternList[this.#index]; + } + /** + * true of if pattern() returns a string + */ + isString() { + return typeof this.#patternList[this.#index] === 'string'; + } + /** + * true of if pattern() returns GLOBSTAR + */ + isGlobstar() { + return this.#patternList[this.#index] === minimatch_1.GLOBSTAR; + } + /** + * true if pattern() returns a regexp + */ + isRegExp() { + return this.#patternList[this.#index] instanceof RegExp; + } + /** + * The /-joined set of glob parts that make up this pattern + */ + globString() { + return (this.#globString = + this.#globString || + (this.#index === 0 + ? this.isAbsolute() + ? this.#globList[0] + this.#globList.slice(1).join('/') + : this.#globList.join('/') + : this.#globList.slice(this.#index).join('/'))); + } + /** + * true if there are more pattern parts after this one + */ + hasMore() { + return this.length > this.#index + 1; + } + /** + * The rest of the pattern after this part, or null if this is the end + */ + rest() { + if (this.#rest !== undefined) + return this.#rest; + if (!this.hasMore()) + return (this.#rest = null); + this.#rest = new Pattern(this.#patternList, this.#globList, this.#index + 1, this.#platform); + this.#rest.#isAbsolute = this.#isAbsolute; + this.#rest.#isUNC = this.#isUNC; + this.#rest.#isDrive = this.#isDrive; + return this.#rest; + } + /** + * true if the pattern represents a //unc/path/ on windows + */ + isUNC() { + const pl = this.#patternList; + return this.#isUNC !== undefined + ? this.#isUNC + : (this.#isUNC = + this.#platform === 'win32' && + this.#index === 0 && + pl[0] === '' && + pl[1] === '' && + typeof pl[2] === 'string' && + !!pl[2] && + typeof pl[3] === 'string' && + !!pl[3]); + } + // pattern like C:/... + // split = ['C:', ...] + // XXX: would be nice to handle patterns like `c:*` to test the cwd + // in c: for *, but I don't know of a way to even figure out what that + // cwd is without actually chdir'ing into it? + /** + * True if the pattern starts with a drive letter on Windows + */ + isDrive() { + const pl = this.#patternList; + return this.#isDrive !== undefined + ? this.#isDrive + : (this.#isDrive = + this.#platform === 'win32' && + this.#index === 0 && + this.length > 1 && + typeof pl[0] === 'string' && + /^[a-z]:$/i.test(pl[0])); + } + // pattern = '/' or '/...' or '/x/...' + // split = ['', ''] or ['', ...] or ['', 'x', ...] + // Drive and UNC both considered absolute on windows + /** + * True if the pattern is rooted on an absolute path + */ + isAbsolute() { + const pl = this.#patternList; + return this.#isAbsolute !== undefined + ? this.#isAbsolute + : (this.#isAbsolute = + (pl[0] === '' && pl.length > 1) || + this.isDrive() || + this.isUNC()); + } + /** + * consume the root of the pattern, and return it + */ + root() { + const p = this.#patternList[0]; + return typeof p === 'string' && this.isAbsolute() && this.#index === 0 + ? p + : ''; + } + /** + * Check to see if the current globstar pattern is allowed to follow + * a symbolic link. + */ + checkFollowGlobstar() { + return !(this.#index === 0 || + !this.isGlobstar() || + !this.#followGlobstar); + } + /** + * Mark that the current globstar pattern is following a symbolic link + */ + markFollowGlobstar() { + if (this.#index === 0 || !this.isGlobstar() || !this.#followGlobstar) + return false; + this.#followGlobstar = false; + return true; + } +} +exports.Pattern = Pattern; +//# sourceMappingURL=pattern.js.map \ No newline at end of file diff --git a/deps/npm/node_modules/glob/dist/cjs/processor.js b/deps/npm/node_modules/glob/dist/cjs/processor.js new file mode 100644 index 00000000000000..bd067e9b9033dc --- /dev/null +++ b/deps/npm/node_modules/glob/dist/cjs/processor.js @@ -0,0 +1,309 @@ +"use strict"; +// synchronous utility for filtering entries and calculating subwalks +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Processor = exports.SubWalks = exports.MatchRecord = exports.HasWalkedCache = void 0; +const minimatch_1 = require("minimatch"); +/** + * A cache of which patterns have been processed for a given Path + */ +class HasWalkedCache { + store; + constructor(store = new Map()) { + this.store = store; + } + copy() { + return new HasWalkedCache(new Map(this.store)); + } + hasWalked(target, pattern) { + return this.store.get(target.fullpath())?.has(pattern.globString()); + } + storeWalked(target, pattern) { + const fullpath = target.fullpath(); + const cached = this.store.get(fullpath); + if (cached) + cached.add(pattern.globString()); + else + this.store.set(fullpath, new Set([pattern.globString()])); + } +} +exports.HasWalkedCache = HasWalkedCache; +/** + * A record of which paths have been matched in a given walk step, + * and whether they only are considered a match if they are a directory, + * and whether their absolute or relative path should be returned. + */ +class MatchRecord { + store = new Map(); + add(target, absolute, ifDir) { + const n = (absolute ? 2 : 0) | (ifDir ? 1 : 0); + const current = this.store.get(target); + this.store.set(target, current === undefined ? n : n & current); + } + // match, absolute, ifdir + entries() { + return [...this.store.entries()].map(([path, n]) => [ + path, + !!(n & 2), + !!(n & 1), + ]); + } +} +exports.MatchRecord = MatchRecord; +/** + * A collection of patterns that must be processed in a subsequent step + * for a given path. + */ +class SubWalks { + store = new Map(); + add(target, pattern) { + if (!target.canReaddir()) { + return; + } + const subs = this.store.get(target); + if (subs) { + if (!subs.find(p => p.globString() === pattern.globString())) { + subs.push(pattern); + } + } + else + this.store.set(target, [pattern]); + } + get(target) { + const subs = this.store.get(target); + /* c8 ignore start */ + if (!subs) { + throw new Error('attempting to walk unknown path'); + } + /* c8 ignore stop */ + return subs; + } + entries() { + return this.keys().map(k => [k, this.store.get(k)]); + } + keys() { + return [...this.store.keys()].filter(t => t.canReaddir()); + } +} +exports.SubWalks = SubWalks; +/** + * The class that processes patterns for a given path. + * + * Handles child entry filtering, and determining whether a path's + * directory contents must be read. + */ +class Processor { + hasWalkedCache; + matches = new MatchRecord(); + subwalks = new SubWalks(); + patterns; + follow; + dot; + opts; + constructor(opts, hasWalkedCache) { + this.opts = opts; + this.follow = !!opts.follow; + this.dot = !!opts.dot; + this.hasWalkedCache = hasWalkedCache + ? hasWalkedCache.copy() + : new HasWalkedCache(); + } + processPatterns(target, patterns) { + this.patterns = patterns; + const processingSet = patterns.map(p => [target, p]); + // map of paths to the magic-starting subwalks they need to walk + // first item in patterns is the filter + for (let [t, pattern] of processingSet) { + this.hasWalkedCache.storeWalked(t, pattern); + const root = pattern.root(); + const absolute = pattern.isAbsolute() && this.opts.absolute !== false; + // start absolute patterns at root + if (root) { + t = t.resolve(root === '/' && this.opts.root !== undefined + ? this.opts.root + : root); + const rest = pattern.rest(); + if (!rest) { + this.matches.add(t, true, false); + continue; + } + else { + pattern = rest; + } + } + if (t.isENOENT()) + continue; + let p; + let rest; + let changed = false; + while (typeof (p = pattern.pattern()) === 'string' && + (rest = pattern.rest())) { + const c = t.resolve(p); + // we can be reasonably sure that .. is a readable dir + if (c.isUnknown() && p !== '..') + break; + t = c; + pattern = rest; + changed = true; + } + p = pattern.pattern(); + rest = pattern.rest(); + if (changed) { + if (this.hasWalkedCache.hasWalked(t, pattern)) + continue; + this.hasWalkedCache.storeWalked(t, pattern); + } + // now we have either a final string for a known entry, + // more strings for an unknown entry, + // or a pattern starting with magic, mounted on t. + if (typeof p === 'string') { + // must be final entry + if (!rest) { + const ifDir = p === '..' || p === '' || p === '.'; + this.matches.add(t.resolve(p), absolute, ifDir); + } + else { + this.subwalks.add(t, pattern); + } + continue; + } + else if (p === minimatch_1.GLOBSTAR) { + // if no rest, match and subwalk pattern + // if rest, process rest and subwalk pattern + // if it's a symlink, but we didn't get here by way of a + // globstar match (meaning it's the first time THIS globstar + // has traversed a symlink), then we follow it. Otherwise, stop. + if (!t.isSymbolicLink() || + this.follow || + pattern.checkFollowGlobstar()) { + this.subwalks.add(t, pattern); + } + const rp = rest?.pattern(); + const rrest = rest?.rest(); + if (!rest || ((rp === '' || rp === '.') && !rrest)) { + // only HAS to be a dir if it ends in **/ or **/. + // but ending in ** will match files as well. + this.matches.add(t, absolute, rp === '' || rp === '.'); + } + else { + if (rp === '..') { + // this would mean you're matching **/.. at the fs root, + // and no thanks, I'm not gonna test that specific case. + /* c8 ignore start */ + const tp = t.parent || t; + /* c8 ignore stop */ + if (!rrest) + this.matches.add(tp, absolute, true); + else if (!this.hasWalkedCache.hasWalked(tp, rrest)) { + this.subwalks.add(tp, rrest); + } + } + } + } + else if (p instanceof RegExp) { + this.subwalks.add(t, pattern); + } + } + return this; + } + subwalkTargets() { + return this.subwalks.keys(); + } + child() { + return new Processor(this.opts, this.hasWalkedCache); + } + // return a new Processor containing the subwalks for each + // child entry, and a set of matches, and + // a hasWalkedCache that's a copy of this one + // then we're going to call + filterEntries(parent, entries) { + const patterns = this.subwalks.get(parent); + // put matches and entry walks into the results processor + const results = this.child(); + for (const e of entries) { + for (const pattern of patterns) { + const absolute = pattern.isAbsolute(); + const p = pattern.pattern(); + const rest = pattern.rest(); + if (p === minimatch_1.GLOBSTAR) { + results.testGlobstar(e, pattern, rest, absolute); + } + else if (p instanceof RegExp) { + results.testRegExp(e, p, rest, absolute); + } + else { + results.testString(e, p, rest, absolute); + } + } + } + return results; + } + testGlobstar(e, pattern, rest, absolute) { + if (this.dot || !e.name.startsWith('.')) { + if (!pattern.hasMore()) { + this.matches.add(e, absolute, false); + } + if (e.canReaddir()) { + // if we're in follow mode or it's not a symlink, just keep + // testing the same pattern. If there's more after the globstar, + // then this symlink consumes the globstar. If not, then we can + // follow at most ONE symlink along the way, so we mark it, which + // also checks to ensure that it wasn't already marked. + if (this.follow || !e.isSymbolicLink()) { + this.subwalks.add(e, pattern); + } + else if (e.isSymbolicLink()) { + if (rest && pattern.checkFollowGlobstar()) { + this.subwalks.add(e, rest); + } + else if (pattern.markFollowGlobstar()) { + this.subwalks.add(e, pattern); + } + } + } + } + // if the NEXT thing matches this entry, then also add + // the rest. + if (rest) { + const rp = rest.pattern(); + if (typeof rp === 'string' && + // dots and empty were handled already + rp !== '..' && + rp !== '' && + rp !== '.') { + this.testString(e, rp, rest.rest(), absolute); + } + else if (rp === '..') { + /* c8 ignore start */ + const ep = e.parent || e; + /* c8 ignore stop */ + this.subwalks.add(ep, rest); + } + else if (rp instanceof RegExp) { + this.testRegExp(e, rp, rest.rest(), absolute); + } + } + } + testRegExp(e, p, rest, absolute) { + if (!p.test(e.name)) + return; + if (!rest) { + this.matches.add(e, absolute, false); + } + else { + this.subwalks.add(e, rest); + } + } + testString(e, p, rest, absolute) { + // should never happen? + if (!e.isNamed(p)) + return; + if (!rest) { + this.matches.add(e, absolute, false); + } + else { + this.subwalks.add(e, rest); + } + } +} +exports.Processor = Processor; +//# sourceMappingURL=processor.js.map \ No newline at end of file diff --git a/deps/npm/node_modules/glob/dist/cjs/walker.js b/deps/npm/node_modules/glob/dist/cjs/walker.js new file mode 100644 index 00000000000000..8c31172cc92fba --- /dev/null +++ b/deps/npm/node_modules/glob/dist/cjs/walker.js @@ -0,0 +1,360 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.GlobStream = exports.GlobWalker = exports.GlobUtil = void 0; +/** + * Single-use utility classes to provide functionality to the {@link Glob} + * methods. + * + * @module + */ +const minipass_1 = __importDefault(require("minipass")); +const ignore_js_1 = require("./ignore.js"); +const processor_js_1 = require("./processor.js"); +const makeIgnore = (ignore, opts) => typeof ignore === 'string' + ? new ignore_js_1.Ignore([ignore], opts) + : Array.isArray(ignore) + ? new ignore_js_1.Ignore(ignore, opts) + : ignore; +/** + * basic walking utilities that all the glob walker types use + */ +class GlobUtil { + path; + patterns; + opts; + seen = new Set(); + paused = false; + aborted = false; + #onResume = []; + #ignore; + #sep; + signal; + maxDepth; + constructor(patterns, path, opts) { + this.patterns = patterns; + this.path = path; + this.opts = opts; + this.#sep = opts.platform === 'win32' ? '\\' : '/'; + if (opts.ignore) { + this.#ignore = makeIgnore(opts.ignore, opts); + } + // ignore, always set with maxDepth, but it's optional on the + // GlobOptions type + /* c8 ignore start */ + this.maxDepth = opts.maxDepth || Infinity; + /* c8 ignore stop */ + if (opts.signal) { + this.signal = opts.signal; + this.signal.addEventListener('abort', () => { + this.#onResume.length = 0; + }); + } + } + #ignored(path) { + return this.seen.has(path) || !!this.#ignore?.ignored?.(path); + } + #childrenIgnored(path) { + return !!this.#ignore?.childrenIgnored?.(path); + } + // backpressure mechanism + pause() { + this.paused = true; + } + resume() { + /* c8 ignore start */ + if (this.signal?.aborted) + return; + /* c8 ignore stop */ + this.paused = false; + let fn = undefined; + while (!this.paused && (fn = this.#onResume.shift())) { + fn(); + } + } + onResume(fn) { + if (this.signal?.aborted) + return; + /* c8 ignore start */ + if (!this.paused) { + fn(); + } + else { + /* c8 ignore stop */ + this.#onResume.push(fn); + } + } + // do the requisite realpath/stat checking, and return the path + // to add or undefined to filter it out. + async matchCheck(e, ifDir) { + if (ifDir && this.opts.nodir) + return undefined; + let rpc; + if (this.opts.realpath) { + rpc = e.realpathCached() || (await e.realpath()); + if (!rpc) + return undefined; + e = rpc; + } + const needStat = e.isUnknown() || this.opts.stat; + return this.matchCheckTest(needStat ? await e.lstat() : e, ifDir); + } + matchCheckTest(e, ifDir) { + return e && + (this.maxDepth === Infinity || e.depth() <= this.maxDepth) && + (!ifDir || e.canReaddir()) && + (!this.opts.nodir || !e.isDirectory()) && + !this.#ignored(e) + ? e + : undefined; + } + matchCheckSync(e, ifDir) { + if (ifDir && this.opts.nodir) + return undefined; + let rpc; + if (this.opts.realpath) { + rpc = e.realpathCached() || e.realpathSync(); + if (!rpc) + return undefined; + e = rpc; + } + const needStat = e.isUnknown() || this.opts.stat; + return this.matchCheckTest(needStat ? e.lstatSync() : e, ifDir); + } + matchFinish(e, absolute) { + if (this.#ignored(e)) + return; + const abs = this.opts.absolute === undefined ? absolute : this.opts.absolute; + this.seen.add(e); + const mark = this.opts.mark && e.isDirectory() ? this.#sep : ''; + // ok, we have what we need! + if (this.opts.withFileTypes) { + this.matchEmit(e); + } + else if (abs) { + this.matchEmit(e.fullpath() + mark); + } + else { + const rel = e.relative(); + const pre = this.opts.dotRelative && !rel.startsWith('..' + this.#sep) + ? '.' + this.#sep + : ''; + this.matchEmit(!rel && mark ? '.' + mark : pre + rel + mark); + } + } + async match(e, absolute, ifDir) { + const p = await this.matchCheck(e, ifDir); + if (p) + this.matchFinish(p, absolute); + } + matchSync(e, absolute, ifDir) { + const p = this.matchCheckSync(e, ifDir); + if (p) + this.matchFinish(p, absolute); + } + walkCB(target, patterns, cb) { + /* c8 ignore start */ + if (this.signal?.aborted) + cb(); + /* c8 ignore stop */ + this.walkCB2(target, patterns, new processor_js_1.Processor(this.opts), cb); + } + walkCB2(target, patterns, processor, cb) { + if (this.#childrenIgnored(target)) + return cb(); + if (this.signal?.aborted) + cb(); + if (this.paused) { + this.onResume(() => this.walkCB2(target, patterns, processor, cb)); + return; + } + processor.processPatterns(target, patterns); + // done processing. all of the above is sync, can be abstracted out. + // subwalks is a map of paths to the entry filters they need + // matches is a map of paths to [absolute, ifDir] tuples. + let tasks = 1; + const next = () => { + if (--tasks === 0) + cb(); + }; + for (const [m, absolute, ifDir] of processor.matches.entries()) { + if (this.#ignored(m)) + continue; + tasks++; + this.match(m, absolute, ifDir).then(() => next()); + } + for (const t of processor.subwalkTargets()) { + if (this.maxDepth !== Infinity && t.depth() >= this.maxDepth) { + continue; + } + tasks++; + const childrenCached = t.readdirCached(); + if (t.calledReaddir()) + this.walkCB3(t, childrenCached, processor, next); + else { + t.readdirCB((_, entries) => this.walkCB3(t, entries, processor, next), true); + } + } + next(); + } + walkCB3(target, entries, processor, cb) { + processor = processor.filterEntries(target, entries); + let tasks = 1; + const next = () => { + if (--tasks === 0) + cb(); + }; + for (const [m, absolute, ifDir] of processor.matches.entries()) { + if (this.#ignored(m)) + continue; + tasks++; + this.match(m, absolute, ifDir).then(() => next()); + } + for (const [target, patterns] of processor.subwalks.entries()) { + tasks++; + this.walkCB2(target, patterns, processor.child(), next); + } + next(); + } + walkCBSync(target, patterns, cb) { + /* c8 ignore start */ + if (this.signal?.aborted) + cb(); + /* c8 ignore stop */ + this.walkCB2Sync(target, patterns, new processor_js_1.Processor(this.opts), cb); + } + walkCB2Sync(target, patterns, processor, cb) { + if (this.#childrenIgnored(target)) + return cb(); + if (this.signal?.aborted) + cb(); + if (this.paused) { + this.onResume(() => this.walkCB2Sync(target, patterns, processor, cb)); + return; + } + processor.processPatterns(target, patterns); + // done processing. all of the above is sync, can be abstracted out. + // subwalks is a map of paths to the entry filters they need + // matches is a map of paths to [absolute, ifDir] tuples. + let tasks = 1; + const next = () => { + if (--tasks === 0) + cb(); + }; + for (const [m, absolute, ifDir] of processor.matches.entries()) { + if (this.#ignored(m)) + continue; + this.matchSync(m, absolute, ifDir); + } + for (const t of processor.subwalkTargets()) { + if (this.maxDepth !== Infinity && t.depth() >= this.maxDepth) { + continue; + } + tasks++; + const children = t.readdirSync(); + this.walkCB3Sync(t, children, processor, next); + } + next(); + } + walkCB3Sync(target, entries, processor, cb) { + processor = processor.filterEntries(target, entries); + let tasks = 1; + const next = () => { + if (--tasks === 0) + cb(); + }; + for (const [m, absolute, ifDir] of processor.matches.entries()) { + if (this.#ignored(m)) + continue; + this.matchSync(m, absolute, ifDir); + } + for (const [target, patterns] of processor.subwalks.entries()) { + tasks++; + this.walkCB2Sync(target, patterns, processor.child(), next); + } + next(); + } +} +exports.GlobUtil = GlobUtil; +class GlobWalker extends GlobUtil { + matches; + constructor(patterns, path, opts) { + super(patterns, path, opts); + this.matches = new Set(); + } + matchEmit(e) { + this.matches.add(e); + } + async walk() { + if (this.signal?.aborted) + throw this.signal.reason; + if (this.path.isUnknown()) { + await this.path.lstat(); + } + await new Promise((res, rej) => { + this.walkCB(this.path, this.patterns, () => { + if (this.signal?.aborted) { + rej(this.signal.reason); + } + else { + res(this.matches); + } + }); + }); + return this.matches; + } + walkSync() { + if (this.signal?.aborted) + throw this.signal.reason; + if (this.path.isUnknown()) { + this.path.lstatSync(); + } + // nothing for the callback to do, because this never pauses + this.walkCBSync(this.path, this.patterns, () => { + if (this.signal?.aborted) + throw this.signal.reason; + }); + return this.matches; + } +} +exports.GlobWalker = GlobWalker; +class GlobStream extends GlobUtil { + results; + constructor(patterns, path, opts) { + super(patterns, path, opts); + this.results = new minipass_1.default({ + signal: this.signal, + objectMode: true, + }); + this.results.on('drain', () => this.resume()); + this.results.on('resume', () => this.resume()); + } + matchEmit(e) { + this.results.write(e); + if (!this.results.flowing) + this.pause(); + } + stream() { + const target = this.path; + if (target.isUnknown()) { + target.lstat().then(() => { + this.walkCB(target, this.patterns, () => this.results.end()); + }); + } + else { + this.walkCB(target, this.patterns, () => this.results.end()); + } + return this.results; + } + streamSync() { + if (this.path.isUnknown()) { + this.path.lstatSync(); + } + this.walkCBSync(this.path, this.patterns, () => this.results.end()); + return this.results; + } +} +exports.GlobStream = GlobStream; +//# sourceMappingURL=walker.js.map \ No newline at end of file diff --git a/deps/npm/node_modules/glob/dist/mjs/glob.js b/deps/npm/node_modules/glob/dist/mjs/glob.js new file mode 100644 index 00000000000000..e1eaf6f4f51697 --- /dev/null +++ b/deps/npm/node_modules/glob/dist/mjs/glob.js @@ -0,0 +1,224 @@ +import { Minimatch } from 'minimatch'; +import { PathScurry, PathScurryDarwin, PathScurryPosix, PathScurryWin32, } from 'path-scurry'; +import { fileURLToPath } from 'url'; +import { Pattern } from './pattern.js'; +import { GlobStream, GlobWalker } from './walker.js'; +// if no process global, just call it linux. +// so we default to case-sensitive, / separators +const defaultPlatform = typeof process === 'object' && + process && + typeof process.platform === 'string' + ? process.platform + : 'linux'; +/** + * An object that can perform glob pattern traversals. + */ +export class Glob { + absolute; + cwd; + root; + dot; + dotRelative; + follow; + ignore; + magicalBraces; + mark; + matchBase; + maxDepth; + nobrace; + nocase; + nodir; + noext; + noglobstar; + pattern; + platform; + realpath; + scurry; + stat; + signal; + windowsPathsNoEscape; + withFileTypes; + /** + * The options provided to the constructor. + */ + opts; + /** + * An array of parsed immutable {@link Pattern} objects. + */ + patterns; + /** + * All options are stored as properties on the `Glob` object. + * + * See {@link GlobOptions} for full options descriptions. + * + * Note that a previous `Glob` object can be passed as the + * `GlobOptions` to another `Glob` instantiation to re-use settings + * and caches with a new pattern. + * + * Traversal functions can be called multiple times to run the walk + * again. + */ + constructor(pattern, opts) { + this.withFileTypes = !!opts.withFileTypes; + this.signal = opts.signal; + this.follow = !!opts.follow; + this.dot = !!opts.dot; + this.dotRelative = !!opts.dotRelative; + this.nodir = !!opts.nodir; + this.mark = !!opts.mark; + if (!opts.cwd) { + this.cwd = ''; + } + else if (opts.cwd instanceof URL || opts.cwd.startsWith('file://')) { + opts.cwd = fileURLToPath(opts.cwd); + } + this.cwd = opts.cwd || ''; + this.root = opts.root; + this.magicalBraces = !!opts.magicalBraces; + this.nobrace = !!opts.nobrace; + this.noext = !!opts.noext; + this.realpath = !!opts.realpath; + this.absolute = opts.absolute; + this.noglobstar = !!opts.noglobstar; + this.matchBase = !!opts.matchBase; + this.maxDepth = + typeof opts.maxDepth === 'number' ? opts.maxDepth : Infinity; + this.stat = !!opts.stat; + this.ignore = opts.ignore; + if (this.withFileTypes && this.absolute !== undefined) { + throw new Error('cannot set absolute and withFileTypes:true'); + } + if (typeof pattern === 'string') { + pattern = [pattern]; + } + this.windowsPathsNoEscape = + !!opts.windowsPathsNoEscape || + opts.allowWindowsEscape === false; + if (this.windowsPathsNoEscape) { + pattern = pattern.map(p => p.replace(/\\/g, '/')); + } + if (this.matchBase) { + if (opts.noglobstar) { + throw new TypeError('base matching requires globstar'); + } + pattern = pattern.map(p => (p.includes('/') ? p : `./**/${p}`)); + } + this.pattern = pattern; + this.platform = opts.platform || defaultPlatform; + this.opts = { ...opts, platform: this.platform }; + if (opts.scurry) { + this.scurry = opts.scurry; + if (opts.nocase !== undefined && + opts.nocase !== opts.scurry.nocase) { + throw new Error('nocase option contradicts provided scurry option'); + } + } + else { + const Scurry = opts.platform === 'win32' + ? PathScurryWin32 + : opts.platform === 'darwin' + ? PathScurryDarwin + : opts.platform + ? PathScurryPosix + : PathScurry; + this.scurry = new Scurry(this.cwd, { + nocase: opts.nocase, + fs: opts.fs, + }); + } + this.nocase = this.scurry.nocase; + const mmo = { + // default nocase based on platform + ...opts, + dot: this.dot, + matchBase: this.matchBase, + nobrace: this.nobrace, + nocase: this.nocase, + nocaseMagicOnly: true, + nocomment: true, + noext: this.noext, + nonegate: true, + optimizationLevel: 2, + platform: this.platform, + windowsPathsNoEscape: this.windowsPathsNoEscape, + }; + const mms = this.pattern.map(p => new Minimatch(p, mmo)); + const [matchSet, globParts] = mms.reduce((set, m) => { + set[0].push(...m.set); + set[1].push(...m.globParts); + return set; + }, [[], []]); + this.patterns = matchSet.map((set, i) => { + return new Pattern(set, globParts[i], 0, this.platform); + }); + } + async walk() { + // Walkers always return array of Path objects, so we just have to + // coerce them into the right shape. It will have already called + // realpath() if the option was set to do so, so we know that's cached. + // start out knowing the cwd, at least + return [ + ...(await new GlobWalker(this.patterns, this.scurry.cwd, { + ...this.opts, + maxDepth: this.maxDepth !== Infinity + ? this.maxDepth + this.scurry.cwd.depth() + : Infinity, + platform: this.platform, + nocase: this.nocase, + }).walk()), + ]; + } + walkSync() { + return [ + ...new GlobWalker(this.patterns, this.scurry.cwd, { + ...this.opts, + maxDepth: this.maxDepth !== Infinity + ? this.maxDepth + this.scurry.cwd.depth() + : Infinity, + platform: this.platform, + nocase: this.nocase, + }).walkSync(), + ]; + } + stream() { + return new GlobStream(this.patterns, this.scurry.cwd, { + ...this.opts, + maxDepth: this.maxDepth !== Infinity + ? this.maxDepth + this.scurry.cwd.depth() + : Infinity, + platform: this.platform, + nocase: this.nocase, + }).stream(); + } + streamSync() { + return new GlobStream(this.patterns, this.scurry.cwd, { + ...this.opts, + maxDepth: this.maxDepth !== Infinity + ? this.maxDepth + this.scurry.cwd.depth() + : Infinity, + platform: this.platform, + nocase: this.nocase, + }).streamSync(); + } + /** + * Default sync iteration function. Returns a Generator that + * iterates over the results. + */ + iterateSync() { + return this.streamSync()[Symbol.iterator](); + } + [Symbol.iterator]() { + return this.iterateSync(); + } + /** + * Default async iteration function. Returns an AsyncGenerator that + * iterates over the results. + */ + iterate() { + return this.stream()[Symbol.asyncIterator](); + } + [Symbol.asyncIterator]() { + return this.iterate(); + } +} +//# sourceMappingURL=glob.js.map \ No newline at end of file diff --git a/deps/npm/node_modules/glob/dist/mjs/has-magic.js b/deps/npm/node_modules/glob/dist/mjs/has-magic.js new file mode 100644 index 00000000000000..ba2321ab868d02 --- /dev/null +++ b/deps/npm/node_modules/glob/dist/mjs/has-magic.js @@ -0,0 +1,23 @@ +import { Minimatch } from 'minimatch'; +/** + * Return true if the patterns provided contain any magic glob characters, + * given the options provided. + * + * Brace expansion is not considered "magic" unless the `magicalBraces` option + * is set, as brace expansion just turns one string into an array of strings. + * So a pattern like `'x{a,b}y'` would return `false`, because `'xay'` and + * `'xby'` both do not contain any magic glob characters, and it's treated the + * same as if you had called it on `['xay', 'xby']`. When `magicalBraces:true` + * is in the options, brace expansion _is_ treated as a pattern having magic. + */ +export const hasMagic = (pattern, options = {}) => { + if (!Array.isArray(pattern)) { + pattern = [pattern]; + } + for (const p of pattern) { + if (new Minimatch(p, options).hasMagic()) + return true; + } + return false; +}; +//# sourceMappingURL=has-magic.js.map \ No newline at end of file diff --git a/deps/npm/node_modules/glob/dist/mjs/ignore.js b/deps/npm/node_modules/glob/dist/mjs/ignore.js new file mode 100644 index 00000000000000..2dbaa16a11460e --- /dev/null +++ b/deps/npm/node_modules/glob/dist/mjs/ignore.js @@ -0,0 +1,99 @@ +// give it a pattern, and it'll be able to tell you if +// a given path should be ignored. +// Ignoring a path ignores its children if the pattern ends in /** +// Ignores are always parsed in dot:true mode +import { Minimatch } from 'minimatch'; +import { Pattern } from './pattern.js'; +const defaultPlatform = typeof process === 'object' && + process && + typeof process.platform === 'string' + ? process.platform + : 'linux'; +/** + * Class used to process ignored patterns + */ +export class Ignore { + relative; + relativeChildren; + absolute; + absoluteChildren; + constructor(ignored, { nobrace, nocase, noext, noglobstar, platform = defaultPlatform, }) { + this.relative = []; + this.absolute = []; + this.relativeChildren = []; + this.absoluteChildren = []; + const mmopts = { + dot: true, + nobrace, + nocase, + noext, + noglobstar, + optimizationLevel: 2, + platform, + nocomment: true, + nonegate: true, + }; + // this is a little weird, but it gives us a clean set of optimized + // minimatch matchers, without getting tripped up if one of them + // ends in /** inside a brace section, and it's only inefficient at + // the start of the walk, not along it. + // It'd be nice if the Pattern class just had a .test() method, but + // handling globstars is a bit of a pita, and that code already lives + // in minimatch anyway. + // Another way would be if maybe Minimatch could take its set/globParts + // as an option, and then we could at least just use Pattern to test + // for absolute-ness. + // Yet another way, Minimatch could take an array of glob strings, and + // a cwd option, and do the right thing. + for (const ign of ignored) { + const mm = new Minimatch(ign, mmopts); + for (let i = 0; i < mm.set.length; i++) { + const parsed = mm.set[i]; + const globParts = mm.globParts[i]; + const p = new Pattern(parsed, globParts, 0, platform); + const m = new Minimatch(p.globString(), mmopts); + const children = globParts[globParts.length - 1] === '**'; + const absolute = p.isAbsolute(); + if (absolute) + this.absolute.push(m); + else + this.relative.push(m); + if (children) { + if (absolute) + this.absoluteChildren.push(m); + else + this.relativeChildren.push(m); + } + } + } + } + ignored(p) { + const fullpath = p.fullpath(); + const fullpaths = `${fullpath}/`; + const relative = p.relative() || '.'; + const relatives = `${relative}/`; + for (const m of this.relative) { + if (m.match(relative) || m.match(relatives)) + return true; + } + for (const m of this.absolute) { + if (m.match(fullpath) || m.match(fullpaths)) + return true; + } + return false; + } + childrenIgnored(p) { + const fullpath = p.fullpath() + '/'; + const relative = (p.relative() || '.') + '/'; + for (const m of this.relativeChildren) { + if (m.match(relative)) + return true; + } + for (const m of this.absoluteChildren) { + if (m.match(fullpath)) + true; + } + return false; + } +} +//# sourceMappingURL=ignore.js.map \ No newline at end of file diff --git a/deps/npm/node_modules/glob/dist/mjs/index.js b/deps/npm/node_modules/glob/dist/mjs/index.js new file mode 100644 index 00000000000000..df9deead1144ce --- /dev/null +++ b/deps/npm/node_modules/glob/dist/mjs/index.js @@ -0,0 +1,55 @@ +import { escape, unescape } from 'minimatch'; +import { Glob } from './glob.js'; +import { hasMagic } from './has-magic.js'; +export function globStreamSync(pattern, options = {}) { + return new Glob(pattern, options).streamSync(); +} +export function globStream(pattern, options = {}) { + return new Glob(pattern, options).stream(); +} +export function globSync(pattern, options = {}) { + return new Glob(pattern, options).walkSync(); +} +export async function glob(pattern, options = {}) { + return new Glob(pattern, options).walk(); +} +export function globIterateSync(pattern, options = {}) { + return new Glob(pattern, options).iterateSync(); +} +export function globIterate(pattern, options = {}) { + return new Glob(pattern, options).iterate(); +} +// aliases: glob.sync.stream() glob.stream.sync() glob.sync() etc +export const streamSync = globStreamSync; +export const stream = Object.assign(globStream, { sync: globStreamSync }); +export const iterateSync = globIterateSync; +export const iterate = Object.assign(globIterate, { + sync: globIterateSync, +}); +export const sync = Object.assign(globSync, { + stream: globStreamSync, + iterate: globIterateSync, +}); +/* c8 ignore start */ +export { escape, unescape } from 'minimatch'; +export { Glob } from './glob.js'; +export { hasMagic } from './has-magic.js'; +/* c8 ignore stop */ +export default Object.assign(glob, { + glob, + globSync, + sync, + globStream, + stream, + globStreamSync, + streamSync, + globIterate, + iterate, + globIterateSync, + iterateSync, + Glob, + hasMagic, + escape, + unescape, +}); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/deps/npm/node_modules/glob/dist/mjs/package.json b/deps/npm/node_modules/glob/dist/mjs/package.json new file mode 100644 index 00000000000000..3dbc1ca591c055 --- /dev/null +++ b/deps/npm/node_modules/glob/dist/mjs/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} diff --git a/deps/npm/node_modules/glob/dist/mjs/pattern.js b/deps/npm/node_modules/glob/dist/mjs/pattern.js new file mode 100644 index 00000000000000..60aa415d92fd12 --- /dev/null +++ b/deps/npm/node_modules/glob/dist/mjs/pattern.js @@ -0,0 +1,215 @@ +// this is just a very light wrapper around 2 arrays with an offset index +import { GLOBSTAR } from 'minimatch'; +const isPatternList = (pl) => pl.length >= 1; +const isGlobList = (gl) => gl.length >= 1; +/** + * An immutable-ish view on an array of glob parts and their parsed + * results + */ +export class Pattern { + #patternList; + #globList; + #index; + length; + #platform; + #rest; + #globString; + #isDrive; + #isUNC; + #isAbsolute; + #followGlobstar = true; + constructor(patternList, globList, index, platform) { + if (!isPatternList(patternList)) { + throw new TypeError('empty pattern list'); + } + if (!isGlobList(globList)) { + throw new TypeError('empty glob list'); + } + if (globList.length !== patternList.length) { + throw new TypeError('mismatched pattern list and glob list lengths'); + } + this.length = patternList.length; + if (index < 0 || index >= this.length) { + throw new TypeError('index out of range'); + } + this.#patternList = patternList; + this.#globList = globList; + this.#index = index; + this.#platform = platform; + // normalize root entries of absolute patterns on initial creation. + if (this.#index === 0) { + // c: => ['c:/'] + // C:/ => ['C:/'] + // C:/x => ['C:/', 'x'] + // //host/share => ['//host/share/'] + // //host/share/ => ['//host/share/'] + // //host/share/x => ['//host/share/', 'x'] + // /etc => ['/', 'etc'] + // / => ['/'] + if (this.isUNC()) { + // '' / '' / 'host' / 'share' + const [p0, p1, p2, p3, ...prest] = this.#patternList; + const [g0, g1, g2, g3, ...grest] = this.#globList; + if (prest[0] === '') { + // ends in / + prest.shift(); + grest.shift(); + } + const p = [p0, p1, p2, p3, ''].join('/'); + const g = [g0, g1, g2, g3, ''].join('/'); + this.#patternList = [p, ...prest]; + this.#globList = [g, ...grest]; + this.length = this.#patternList.length; + } + else if (this.isDrive() || this.isAbsolute()) { + const [p1, ...prest] = this.#patternList; + const [g1, ...grest] = this.#globList; + if (prest[0] === '') { + // ends in / + prest.shift(); + grest.shift(); + } + const p = p1 + '/'; + const g = g1 + '/'; + this.#patternList = [p, ...prest]; + this.#globList = [g, ...grest]; + this.length = this.#patternList.length; + } + } + } + /** + * The first entry in the parsed list of patterns + */ + pattern() { + return this.#patternList[this.#index]; + } + /** + * true of if pattern() returns a string + */ + isString() { + return typeof this.#patternList[this.#index] === 'string'; + } + /** + * true of if pattern() returns GLOBSTAR + */ + isGlobstar() { + return this.#patternList[this.#index] === GLOBSTAR; + } + /** + * true if pattern() returns a regexp + */ + isRegExp() { + return this.#patternList[this.#index] instanceof RegExp; + } + /** + * The /-joined set of glob parts that make up this pattern + */ + globString() { + return (this.#globString = + this.#globString || + (this.#index === 0 + ? this.isAbsolute() + ? this.#globList[0] + this.#globList.slice(1).join('/') + : this.#globList.join('/') + : this.#globList.slice(this.#index).join('/'))); + } + /** + * true if there are more pattern parts after this one + */ + hasMore() { + return this.length > this.#index + 1; + } + /** + * The rest of the pattern after this part, or null if this is the end + */ + rest() { + if (this.#rest !== undefined) + return this.#rest; + if (!this.hasMore()) + return (this.#rest = null); + this.#rest = new Pattern(this.#patternList, this.#globList, this.#index + 1, this.#platform); + this.#rest.#isAbsolute = this.#isAbsolute; + this.#rest.#isUNC = this.#isUNC; + this.#rest.#isDrive = this.#isDrive; + return this.#rest; + } + /** + * true if the pattern represents a //unc/path/ on windows + */ + isUNC() { + const pl = this.#patternList; + return this.#isUNC !== undefined + ? this.#isUNC + : (this.#isUNC = + this.#platform === 'win32' && + this.#index === 0 && + pl[0] === '' && + pl[1] === '' && + typeof pl[2] === 'string' && + !!pl[2] && + typeof pl[3] === 'string' && + !!pl[3]); + } + // pattern like C:/... + // split = ['C:', ...] + // XXX: would be nice to handle patterns like `c:*` to test the cwd + // in c: for *, but I don't know of a way to even figure out what that + // cwd is without actually chdir'ing into it? + /** + * True if the pattern starts with a drive letter on Windows + */ + isDrive() { + const pl = this.#patternList; + return this.#isDrive !== undefined + ? this.#isDrive + : (this.#isDrive = + this.#platform === 'win32' && + this.#index === 0 && + this.length > 1 && + typeof pl[0] === 'string' && + /^[a-z]:$/i.test(pl[0])); + } + // pattern = '/' or '/...' or '/x/...' + // split = ['', ''] or ['', ...] or ['', 'x', ...] + // Drive and UNC both considered absolute on windows + /** + * True if the pattern is rooted on an absolute path + */ + isAbsolute() { + const pl = this.#patternList; + return this.#isAbsolute !== undefined + ? this.#isAbsolute + : (this.#isAbsolute = + (pl[0] === '' && pl.length > 1) || + this.isDrive() || + this.isUNC()); + } + /** + * consume the root of the pattern, and return it + */ + root() { + const p = this.#patternList[0]; + return typeof p === 'string' && this.isAbsolute() && this.#index === 0 + ? p + : ''; + } + /** + * Check to see if the current globstar pattern is allowed to follow + * a symbolic link. + */ + checkFollowGlobstar() { + return !(this.#index === 0 || + !this.isGlobstar() || + !this.#followGlobstar); + } + /** + * Mark that the current globstar pattern is following a symbolic link + */ + markFollowGlobstar() { + if (this.#index === 0 || !this.isGlobstar() || !this.#followGlobstar) + return false; + this.#followGlobstar = false; + return true; + } +} +//# sourceMappingURL=pattern.js.map \ No newline at end of file diff --git a/deps/npm/node_modules/glob/dist/mjs/processor.js b/deps/npm/node_modules/glob/dist/mjs/processor.js new file mode 100644 index 00000000000000..dd2228ad6761a5 --- /dev/null +++ b/deps/npm/node_modules/glob/dist/mjs/processor.js @@ -0,0 +1,302 @@ +// synchronous utility for filtering entries and calculating subwalks +import { GLOBSTAR } from 'minimatch'; +/** + * A cache of which patterns have been processed for a given Path + */ +export class HasWalkedCache { + store; + constructor(store = new Map()) { + this.store = store; + } + copy() { + return new HasWalkedCache(new Map(this.store)); + } + hasWalked(target, pattern) { + return this.store.get(target.fullpath())?.has(pattern.globString()); + } + storeWalked(target, pattern) { + const fullpath = target.fullpath(); + const cached = this.store.get(fullpath); + if (cached) + cached.add(pattern.globString()); + else + this.store.set(fullpath, new Set([pattern.globString()])); + } +} +/** + * A record of which paths have been matched in a given walk step, + * and whether they only are considered a match if they are a directory, + * and whether their absolute or relative path should be returned. + */ +export class MatchRecord { + store = new Map(); + add(target, absolute, ifDir) { + const n = (absolute ? 2 : 0) | (ifDir ? 1 : 0); + const current = this.store.get(target); + this.store.set(target, current === undefined ? n : n & current); + } + // match, absolute, ifdir + entries() { + return [...this.store.entries()].map(([path, n]) => [ + path, + !!(n & 2), + !!(n & 1), + ]); + } +} +/** + * A collection of patterns that must be processed in a subsequent step + * for a given path. + */ +export class SubWalks { + store = new Map(); + add(target, pattern) { + if (!target.canReaddir()) { + return; + } + const subs = this.store.get(target); + if (subs) { + if (!subs.find(p => p.globString() === pattern.globString())) { + subs.push(pattern); + } + } + else + this.store.set(target, [pattern]); + } + get(target) { + const subs = this.store.get(target); + /* c8 ignore start */ + if (!subs) { + throw new Error('attempting to walk unknown path'); + } + /* c8 ignore stop */ + return subs; + } + entries() { + return this.keys().map(k => [k, this.store.get(k)]); + } + keys() { + return [...this.store.keys()].filter(t => t.canReaddir()); + } +} +/** + * The class that processes patterns for a given path. + * + * Handles child entry filtering, and determining whether a path's + * directory contents must be read. + */ +export class Processor { + hasWalkedCache; + matches = new MatchRecord(); + subwalks = new SubWalks(); + patterns; + follow; + dot; + opts; + constructor(opts, hasWalkedCache) { + this.opts = opts; + this.follow = !!opts.follow; + this.dot = !!opts.dot; + this.hasWalkedCache = hasWalkedCache + ? hasWalkedCache.copy() + : new HasWalkedCache(); + } + processPatterns(target, patterns) { + this.patterns = patterns; + const processingSet = patterns.map(p => [target, p]); + // map of paths to the magic-starting subwalks they need to walk + // first item in patterns is the filter + for (let [t, pattern] of processingSet) { + this.hasWalkedCache.storeWalked(t, pattern); + const root = pattern.root(); + const absolute = pattern.isAbsolute() && this.opts.absolute !== false; + // start absolute patterns at root + if (root) { + t = t.resolve(root === '/' && this.opts.root !== undefined + ? this.opts.root + : root); + const rest = pattern.rest(); + if (!rest) { + this.matches.add(t, true, false); + continue; + } + else { + pattern = rest; + } + } + if (t.isENOENT()) + continue; + let p; + let rest; + let changed = false; + while (typeof (p = pattern.pattern()) === 'string' && + (rest = pattern.rest())) { + const c = t.resolve(p); + // we can be reasonably sure that .. is a readable dir + if (c.isUnknown() && p !== '..') + break; + t = c; + pattern = rest; + changed = true; + } + p = pattern.pattern(); + rest = pattern.rest(); + if (changed) { + if (this.hasWalkedCache.hasWalked(t, pattern)) + continue; + this.hasWalkedCache.storeWalked(t, pattern); + } + // now we have either a final string for a known entry, + // more strings for an unknown entry, + // or a pattern starting with magic, mounted on t. + if (typeof p === 'string') { + // must be final entry + if (!rest) { + const ifDir = p === '..' || p === '' || p === '.'; + this.matches.add(t.resolve(p), absolute, ifDir); + } + else { + this.subwalks.add(t, pattern); + } + continue; + } + else if (p === GLOBSTAR) { + // if no rest, match and subwalk pattern + // if rest, process rest and subwalk pattern + // if it's a symlink, but we didn't get here by way of a + // globstar match (meaning it's the first time THIS globstar + // has traversed a symlink), then we follow it. Otherwise, stop. + if (!t.isSymbolicLink() || + this.follow || + pattern.checkFollowGlobstar()) { + this.subwalks.add(t, pattern); + } + const rp = rest?.pattern(); + const rrest = rest?.rest(); + if (!rest || ((rp === '' || rp === '.') && !rrest)) { + // only HAS to be a dir if it ends in **/ or **/. + // but ending in ** will match files as well. + this.matches.add(t, absolute, rp === '' || rp === '.'); + } + else { + if (rp === '..') { + // this would mean you're matching **/.. at the fs root, + // and no thanks, I'm not gonna test that specific case. + /* c8 ignore start */ + const tp = t.parent || t; + /* c8 ignore stop */ + if (!rrest) + this.matches.add(tp, absolute, true); + else if (!this.hasWalkedCache.hasWalked(tp, rrest)) { + this.subwalks.add(tp, rrest); + } + } + } + } + else if (p instanceof RegExp) { + this.subwalks.add(t, pattern); + } + } + return this; + } + subwalkTargets() { + return this.subwalks.keys(); + } + child() { + return new Processor(this.opts, this.hasWalkedCache); + } + // return a new Processor containing the subwalks for each + // child entry, and a set of matches, and + // a hasWalkedCache that's a copy of this one + // then we're going to call + filterEntries(parent, entries) { + const patterns = this.subwalks.get(parent); + // put matches and entry walks into the results processor + const results = this.child(); + for (const e of entries) { + for (const pattern of patterns) { + const absolute = pattern.isAbsolute(); + const p = pattern.pattern(); + const rest = pattern.rest(); + if (p === GLOBSTAR) { + results.testGlobstar(e, pattern, rest, absolute); + } + else if (p instanceof RegExp) { + results.testRegExp(e, p, rest, absolute); + } + else { + results.testString(e, p, rest, absolute); + } + } + } + return results; + } + testGlobstar(e, pattern, rest, absolute) { + if (this.dot || !e.name.startsWith('.')) { + if (!pattern.hasMore()) { + this.matches.add(e, absolute, false); + } + if (e.canReaddir()) { + // if we're in follow mode or it's not a symlink, just keep + // testing the same pattern. If there's more after the globstar, + // then this symlink consumes the globstar. If not, then we can + // follow at most ONE symlink along the way, so we mark it, which + // also checks to ensure that it wasn't already marked. + if (this.follow || !e.isSymbolicLink()) { + this.subwalks.add(e, pattern); + } + else if (e.isSymbolicLink()) { + if (rest && pattern.checkFollowGlobstar()) { + this.subwalks.add(e, rest); + } + else if (pattern.markFollowGlobstar()) { + this.subwalks.add(e, pattern); + } + } + } + } + // if the NEXT thing matches this entry, then also add + // the rest. + if (rest) { + const rp = rest.pattern(); + if (typeof rp === 'string' && + // dots and empty were handled already + rp !== '..' && + rp !== '' && + rp !== '.') { + this.testString(e, rp, rest.rest(), absolute); + } + else if (rp === '..') { + /* c8 ignore start */ + const ep = e.parent || e; + /* c8 ignore stop */ + this.subwalks.add(ep, rest); + } + else if (rp instanceof RegExp) { + this.testRegExp(e, rp, rest.rest(), absolute); + } + } + } + testRegExp(e, p, rest, absolute) { + if (!p.test(e.name)) + return; + if (!rest) { + this.matches.add(e, absolute, false); + } + else { + this.subwalks.add(e, rest); + } + } + testString(e, p, rest, absolute) { + // should never happen? + if (!e.isNamed(p)) + return; + if (!rest) { + this.matches.add(e, absolute, false); + } + else { + this.subwalks.add(e, rest); + } + } +} +//# sourceMappingURL=processor.js.map \ No newline at end of file diff --git a/deps/npm/node_modules/glob/dist/mjs/walker.js b/deps/npm/node_modules/glob/dist/mjs/walker.js new file mode 100644 index 00000000000000..349314e297a106 --- /dev/null +++ b/deps/npm/node_modules/glob/dist/mjs/walker.js @@ -0,0 +1,351 @@ +/** + * Single-use utility classes to provide functionality to the {@link Glob} + * methods. + * + * @module + */ +import Minipass from 'minipass'; +import { Ignore } from './ignore.js'; +import { Processor } from './processor.js'; +const makeIgnore = (ignore, opts) => typeof ignore === 'string' + ? new Ignore([ignore], opts) + : Array.isArray(ignore) + ? new Ignore(ignore, opts) + : ignore; +/** + * basic walking utilities that all the glob walker types use + */ +export class GlobUtil { + path; + patterns; + opts; + seen = new Set(); + paused = false; + aborted = false; + #onResume = []; + #ignore; + #sep; + signal; + maxDepth; + constructor(patterns, path, opts) { + this.patterns = patterns; + this.path = path; + this.opts = opts; + this.#sep = opts.platform === 'win32' ? '\\' : '/'; + if (opts.ignore) { + this.#ignore = makeIgnore(opts.ignore, opts); + } + // ignore, always set with maxDepth, but it's optional on the + // GlobOptions type + /* c8 ignore start */ + this.maxDepth = opts.maxDepth || Infinity; + /* c8 ignore stop */ + if (opts.signal) { + this.signal = opts.signal; + this.signal.addEventListener('abort', () => { + this.#onResume.length = 0; + }); + } + } + #ignored(path) { + return this.seen.has(path) || !!this.#ignore?.ignored?.(path); + } + #childrenIgnored(path) { + return !!this.#ignore?.childrenIgnored?.(path); + } + // backpressure mechanism + pause() { + this.paused = true; + } + resume() { + /* c8 ignore start */ + if (this.signal?.aborted) + return; + /* c8 ignore stop */ + this.paused = false; + let fn = undefined; + while (!this.paused && (fn = this.#onResume.shift())) { + fn(); + } + } + onResume(fn) { + if (this.signal?.aborted) + return; + /* c8 ignore start */ + if (!this.paused) { + fn(); + } + else { + /* c8 ignore stop */ + this.#onResume.push(fn); + } + } + // do the requisite realpath/stat checking, and return the path + // to add or undefined to filter it out. + async matchCheck(e, ifDir) { + if (ifDir && this.opts.nodir) + return undefined; + let rpc; + if (this.opts.realpath) { + rpc = e.realpathCached() || (await e.realpath()); + if (!rpc) + return undefined; + e = rpc; + } + const needStat = e.isUnknown() || this.opts.stat; + return this.matchCheckTest(needStat ? await e.lstat() : e, ifDir); + } + matchCheckTest(e, ifDir) { + return e && + (this.maxDepth === Infinity || e.depth() <= this.maxDepth) && + (!ifDir || e.canReaddir()) && + (!this.opts.nodir || !e.isDirectory()) && + !this.#ignored(e) + ? e + : undefined; + } + matchCheckSync(e, ifDir) { + if (ifDir && this.opts.nodir) + return undefined; + let rpc; + if (this.opts.realpath) { + rpc = e.realpathCached() || e.realpathSync(); + if (!rpc) + return undefined; + e = rpc; + } + const needStat = e.isUnknown() || this.opts.stat; + return this.matchCheckTest(needStat ? e.lstatSync() : e, ifDir); + } + matchFinish(e, absolute) { + if (this.#ignored(e)) + return; + const abs = this.opts.absolute === undefined ? absolute : this.opts.absolute; + this.seen.add(e); + const mark = this.opts.mark && e.isDirectory() ? this.#sep : ''; + // ok, we have what we need! + if (this.opts.withFileTypes) { + this.matchEmit(e); + } + else if (abs) { + this.matchEmit(e.fullpath() + mark); + } + else { + const rel = e.relative(); + const pre = this.opts.dotRelative && !rel.startsWith('..' + this.#sep) + ? '.' + this.#sep + : ''; + this.matchEmit(!rel && mark ? '.' + mark : pre + rel + mark); + } + } + async match(e, absolute, ifDir) { + const p = await this.matchCheck(e, ifDir); + if (p) + this.matchFinish(p, absolute); + } + matchSync(e, absolute, ifDir) { + const p = this.matchCheckSync(e, ifDir); + if (p) + this.matchFinish(p, absolute); + } + walkCB(target, patterns, cb) { + /* c8 ignore start */ + if (this.signal?.aborted) + cb(); + /* c8 ignore stop */ + this.walkCB2(target, patterns, new Processor(this.opts), cb); + } + walkCB2(target, patterns, processor, cb) { + if (this.#childrenIgnored(target)) + return cb(); + if (this.signal?.aborted) + cb(); + if (this.paused) { + this.onResume(() => this.walkCB2(target, patterns, processor, cb)); + return; + } + processor.processPatterns(target, patterns); + // done processing. all of the above is sync, can be abstracted out. + // subwalks is a map of paths to the entry filters they need + // matches is a map of paths to [absolute, ifDir] tuples. + let tasks = 1; + const next = () => { + if (--tasks === 0) + cb(); + }; + for (const [m, absolute, ifDir] of processor.matches.entries()) { + if (this.#ignored(m)) + continue; + tasks++; + this.match(m, absolute, ifDir).then(() => next()); + } + for (const t of processor.subwalkTargets()) { + if (this.maxDepth !== Infinity && t.depth() >= this.maxDepth) { + continue; + } + tasks++; + const childrenCached = t.readdirCached(); + if (t.calledReaddir()) + this.walkCB3(t, childrenCached, processor, next); + else { + t.readdirCB((_, entries) => this.walkCB3(t, entries, processor, next), true); + } + } + next(); + } + walkCB3(target, entries, processor, cb) { + processor = processor.filterEntries(target, entries); + let tasks = 1; + const next = () => { + if (--tasks === 0) + cb(); + }; + for (const [m, absolute, ifDir] of processor.matches.entries()) { + if (this.#ignored(m)) + continue; + tasks++; + this.match(m, absolute, ifDir).then(() => next()); + } + for (const [target, patterns] of processor.subwalks.entries()) { + tasks++; + this.walkCB2(target, patterns, processor.child(), next); + } + next(); + } + walkCBSync(target, patterns, cb) { + /* c8 ignore start */ + if (this.signal?.aborted) + cb(); + /* c8 ignore stop */ + this.walkCB2Sync(target, patterns, new Processor(this.opts), cb); + } + walkCB2Sync(target, patterns, processor, cb) { + if (this.#childrenIgnored(target)) + return cb(); + if (this.signal?.aborted) + cb(); + if (this.paused) { + this.onResume(() => this.walkCB2Sync(target, patterns, processor, cb)); + return; + } + processor.processPatterns(target, patterns); + // done processing. all of the above is sync, can be abstracted out. + // subwalks is a map of paths to the entry filters they need + // matches is a map of paths to [absolute, ifDir] tuples. + let tasks = 1; + const next = () => { + if (--tasks === 0) + cb(); + }; + for (const [m, absolute, ifDir] of processor.matches.entries()) { + if (this.#ignored(m)) + continue; + this.matchSync(m, absolute, ifDir); + } + for (const t of processor.subwalkTargets()) { + if (this.maxDepth !== Infinity && t.depth() >= this.maxDepth) { + continue; + } + tasks++; + const children = t.readdirSync(); + this.walkCB3Sync(t, children, processor, next); + } + next(); + } + walkCB3Sync(target, entries, processor, cb) { + processor = processor.filterEntries(target, entries); + let tasks = 1; + const next = () => { + if (--tasks === 0) + cb(); + }; + for (const [m, absolute, ifDir] of processor.matches.entries()) { + if (this.#ignored(m)) + continue; + this.matchSync(m, absolute, ifDir); + } + for (const [target, patterns] of processor.subwalks.entries()) { + tasks++; + this.walkCB2Sync(target, patterns, processor.child(), next); + } + next(); + } +} +export class GlobWalker extends GlobUtil { + matches; + constructor(patterns, path, opts) { + super(patterns, path, opts); + this.matches = new Set(); + } + matchEmit(e) { + this.matches.add(e); + } + async walk() { + if (this.signal?.aborted) + throw this.signal.reason; + if (this.path.isUnknown()) { + await this.path.lstat(); + } + await new Promise((res, rej) => { + this.walkCB(this.path, this.patterns, () => { + if (this.signal?.aborted) { + rej(this.signal.reason); + } + else { + res(this.matches); + } + }); + }); + return this.matches; + } + walkSync() { + if (this.signal?.aborted) + throw this.signal.reason; + if (this.path.isUnknown()) { + this.path.lstatSync(); + } + // nothing for the callback to do, because this never pauses + this.walkCBSync(this.path, this.patterns, () => { + if (this.signal?.aborted) + throw this.signal.reason; + }); + return this.matches; + } +} +export class GlobStream extends GlobUtil { + results; + constructor(patterns, path, opts) { + super(patterns, path, opts); + this.results = new Minipass({ + signal: this.signal, + objectMode: true, + }); + this.results.on('drain', () => this.resume()); + this.results.on('resume', () => this.resume()); + } + matchEmit(e) { + this.results.write(e); + if (!this.results.flowing) + this.pause(); + } + stream() { + const target = this.path; + if (target.isUnknown()) { + target.lstat().then(() => { + this.walkCB(target, this.patterns, () => this.results.end()); + }); + } + else { + this.walkCB(target, this.patterns, () => this.results.end()); + } + return this.results; + } + streamSync() { + if (this.path.isUnknown()) { + this.path.lstatSync(); + } + this.walkCBSync(this.path, this.patterns, () => this.results.end()); + return this.results; + } +} +//# sourceMappingURL=walker.js.map \ No newline at end of file diff --git a/deps/npm/node_modules/glob/glob.js b/deps/npm/node_modules/glob/glob.js deleted file mode 100644 index 2112a957dc5016..00000000000000 --- a/deps/npm/node_modules/glob/glob.js +++ /dev/null @@ -1,790 +0,0 @@ -// Approach: -// -// 1. Get the minimatch set -// 2. For each pattern in the set, PROCESS(pattern, false) -// 3. Store matches per-set, then uniq them -// -// PROCESS(pattern, inGlobStar) -// Get the first [n] items from pattern that are all strings -// Join these together. This is PREFIX. -// If there is no more remaining, then stat(PREFIX) and -// add to matches if it succeeds. END. -// -// If inGlobStar and PREFIX is symlink and points to dir -// set ENTRIES = [] -// else readdir(PREFIX) as ENTRIES -// If fail, END -// -// with ENTRIES -// If pattern[n] is GLOBSTAR -// // handle the case where the globstar match is empty -// // by pruning it out, and testing the resulting pattern -// PROCESS(pattern[0..n] + pattern[n+1 .. $], false) -// // handle other cases. -// for ENTRY in ENTRIES (not dotfiles) -// // attach globstar + tail onto the entry -// // Mark that this entry is a globstar match -// PROCESS(pattern[0..n] + ENTRY + pattern[n .. $], true) -// -// else // not globstar -// for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot) -// Test ENTRY against pattern[n] -// If fails, continue -// If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $]) -// -// Caveat: -// Cache all stats and readdirs results to minimize syscall. Since all -// we ever care about is existence and directory-ness, we can just keep -// `true` for files, and [children,...] for directories, or `false` for -// things that don't exist. - -module.exports = glob - -var rp = require('fs.realpath') -var minimatch = require('minimatch') -var Minimatch = minimatch.Minimatch -var inherits = require('inherits') -var EE = require('events').EventEmitter -var path = require('path') -var assert = require('assert') -var isAbsolute = require('path').isAbsolute -var globSync = require('./sync.js') -var common = require('./common.js') -var setopts = common.setopts -var ownProp = common.ownProp -var inflight = require('inflight') -var util = require('util') -var childrenIgnored = common.childrenIgnored -var isIgnored = common.isIgnored - -var once = require('once') - -function glob (pattern, options, cb) { - if (typeof options === 'function') cb = options, options = {} - if (!options) options = {} - - if (options.sync) { - if (cb) - throw new TypeError('callback provided to sync glob') - return globSync(pattern, options) - } - - return new Glob(pattern, options, cb) -} - -glob.sync = globSync -var GlobSync = glob.GlobSync = globSync.GlobSync - -// old api surface -glob.glob = glob - -function extend (origin, add) { - if (add === null || typeof add !== 'object') { - return origin - } - - var keys = Object.keys(add) - var i = keys.length - while (i--) { - origin[keys[i]] = add[keys[i]] - } - return origin -} - -glob.hasMagic = function (pattern, options_) { - var options = extend({}, options_) - options.noprocess = true - - var g = new Glob(pattern, options) - var set = g.minimatch.set - - if (!pattern) - return false - - if (set.length > 1) - return true - - for (var j = 0; j < set[0].length; j++) { - if (typeof set[0][j] !== 'string') - return true - } - - return false -} - -glob.Glob = Glob -inherits(Glob, EE) -function Glob (pattern, options, cb) { - if (typeof options === 'function') { - cb = options - options = null - } - - if (options && options.sync) { - if (cb) - throw new TypeError('callback provided to sync glob') - return new GlobSync(pattern, options) - } - - if (!(this instanceof Glob)) - return new Glob(pattern, options, cb) - - setopts(this, pattern, options) - this._didRealPath = false - - // process each pattern in the minimatch set - var n = this.minimatch.set.length - - // The matches are stored as {: true,...} so that - // duplicates are automagically pruned. - // Later, we do an Object.keys() on these. - // Keep them as a list so we can fill in when nonull is set. - this.matches = new Array(n) - - if (typeof cb === 'function') { - cb = once(cb) - this.on('error', cb) - this.on('end', function (matches) { - cb(null, matches) - }) - } - - var self = this - this._processing = 0 - - this._emitQueue = [] - this._processQueue = [] - this.paused = false - - if (this.noprocess) - return this - - if (n === 0) - return done() - - var sync = true - for (var i = 0; i < n; i ++) { - this._process(this.minimatch.set[i], i, false, done) - } - sync = false - - function done () { - --self._processing - if (self._processing <= 0) { - if (sync) { - process.nextTick(function () { - self._finish() - }) - } else { - self._finish() - } - } - } -} - -Glob.prototype._finish = function () { - assert(this instanceof Glob) - if (this.aborted) - return - - if (this.realpath && !this._didRealpath) - return this._realpath() - - common.finish(this) - this.emit('end', this.found) -} - -Glob.prototype._realpath = function () { - if (this._didRealpath) - return - - this._didRealpath = true - - var n = this.matches.length - if (n === 0) - return this._finish() - - var self = this - for (var i = 0; i < this.matches.length; i++) - this._realpathSet(i, next) - - function next () { - if (--n === 0) - self._finish() - } -} - -Glob.prototype._realpathSet = function (index, cb) { - var matchset = this.matches[index] - if (!matchset) - return cb() - - var found = Object.keys(matchset) - var self = this - var n = found.length - - if (n === 0) - return cb() - - var set = this.matches[index] = Object.create(null) - found.forEach(function (p, i) { - // If there's a problem with the stat, then it means that - // one or more of the links in the realpath couldn't be - // resolved. just return the abs value in that case. - p = self._makeAbs(p) - rp.realpath(p, self.realpathCache, function (er, real) { - if (!er) - set[real] = true - else if (er.syscall === 'stat') - set[p] = true - else - self.emit('error', er) // srsly wtf right here - - if (--n === 0) { - self.matches[index] = set - cb() - } - }) - }) -} - -Glob.prototype._mark = function (p) { - return common.mark(this, p) -} - -Glob.prototype._makeAbs = function (f) { - return common.makeAbs(this, f) -} - -Glob.prototype.abort = function () { - this.aborted = true - this.emit('abort') -} - -Glob.prototype.pause = function () { - if (!this.paused) { - this.paused = true - this.emit('pause') - } -} - -Glob.prototype.resume = function () { - if (this.paused) { - this.emit('resume') - this.paused = false - if (this._emitQueue.length) { - var eq = this._emitQueue.slice(0) - this._emitQueue.length = 0 - for (var i = 0; i < eq.length; i ++) { - var e = eq[i] - this._emitMatch(e[0], e[1]) - } - } - if (this._processQueue.length) { - var pq = this._processQueue.slice(0) - this._processQueue.length = 0 - for (var i = 0; i < pq.length; i ++) { - var p = pq[i] - this._processing-- - this._process(p[0], p[1], p[2], p[3]) - } - } - } -} - -Glob.prototype._process = function (pattern, index, inGlobStar, cb) { - assert(this instanceof Glob) - assert(typeof cb === 'function') - - if (this.aborted) - return - - this._processing++ - if (this.paused) { - this._processQueue.push([pattern, index, inGlobStar, cb]) - return - } - - //console.error('PROCESS %d', this._processing, pattern) - - // Get the first [n] parts of pattern that are all strings. - var n = 0 - while (typeof pattern[n] === 'string') { - n ++ - } - // now n is the index of the first one that is *not* a string. - - // see if there's anything else - var prefix - switch (n) { - // if not, then this is rather simple - case pattern.length: - this._processSimple(pattern.join('/'), index, cb) - return - - case 0: - // pattern *starts* with some non-trivial item. - // going to readdir(cwd), but not include the prefix in matches. - prefix = null - break - - default: - // pattern has some string bits in the front. - // whatever it starts with, whether that's 'absolute' like /foo/bar, - // or 'relative' like '../baz' - prefix = pattern.slice(0, n).join('/') - break - } - - var remain = pattern.slice(n) - - // get the list of entries. - var read - if (prefix === null) - read = '.' - else if (isAbsolute(prefix) || - isAbsolute(pattern.map(function (p) { - return typeof p === 'string' ? p : '[*]' - }).join('/'))) { - if (!prefix || !isAbsolute(prefix)) - prefix = '/' + prefix - read = prefix - } else - read = prefix - - var abs = this._makeAbs(read) - - //if ignored, skip _processing - if (childrenIgnored(this, read)) - return cb() - - var isGlobStar = remain[0] === minimatch.GLOBSTAR - if (isGlobStar) - this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb) - else - this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb) -} - -Glob.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar, cb) { - var self = this - this._readdir(abs, inGlobStar, function (er, entries) { - return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb) - }) -} - -Glob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { - - // if the abs isn't a dir, then nothing can match! - if (!entries) - return cb() - - // It will only match dot entries if it starts with a dot, or if - // dot is set. Stuff like @(.foo|.bar) isn't allowed. - var pn = remain[0] - var negate = !!this.minimatch.negate - var rawGlob = pn._glob - var dotOk = this.dot || rawGlob.charAt(0) === '.' - - var matchedEntries = [] - for (var i = 0; i < entries.length; i++) { - var e = entries[i] - if (e.charAt(0) !== '.' || dotOk) { - var m - if (negate && !prefix) { - m = !e.match(pn) - } else { - m = e.match(pn) - } - if (m) - matchedEntries.push(e) - } - } - - //console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries) - - var len = matchedEntries.length - // If there are no matched entries, then nothing matches. - if (len === 0) - return cb() - - // if this is the last remaining pattern bit, then no need for - // an additional stat *unless* the user has specified mark or - // stat explicitly. We know they exist, since readdir returned - // them. - - if (remain.length === 1 && !this.mark && !this.stat) { - if (!this.matches[index]) - this.matches[index] = Object.create(null) - - for (var i = 0; i < len; i ++) { - var e = matchedEntries[i] - if (prefix) { - if (prefix !== '/') - e = prefix + '/' + e - else - e = prefix + e - } - - if (e.charAt(0) === '/' && !this.nomount) { - e = path.join(this.root, e) - } - this._emitMatch(index, e) - } - // This was the last one, and no stats were needed - return cb() - } - - // now test all matched entries as stand-ins for that part - // of the pattern. - remain.shift() - for (var i = 0; i < len; i ++) { - var e = matchedEntries[i] - var newPattern - if (prefix) { - if (prefix !== '/') - e = prefix + '/' + e - else - e = prefix + e - } - this._process([e].concat(remain), index, inGlobStar, cb) - } - cb() -} - -Glob.prototype._emitMatch = function (index, e) { - if (this.aborted) - return - - if (isIgnored(this, e)) - return - - if (this.paused) { - this._emitQueue.push([index, e]) - return - } - - var abs = isAbsolute(e) ? e : this._makeAbs(e) - - if (this.mark) - e = this._mark(e) - - if (this.absolute) - e = abs - - if (this.matches[index][e]) - return - - if (this.nodir) { - var c = this.cache[abs] - if (c === 'DIR' || Array.isArray(c)) - return - } - - this.matches[index][e] = true - - var st = this.statCache[abs] - if (st) - this.emit('stat', e, st) - - this.emit('match', e) -} - -Glob.prototype._readdirInGlobStar = function (abs, cb) { - if (this.aborted) - return - - // follow all symlinked directories forever - // just proceed as if this is a non-globstar situation - if (this.follow) - return this._readdir(abs, false, cb) - - var lstatkey = 'lstat\0' + abs - var self = this - var lstatcb = inflight(lstatkey, lstatcb_) - - if (lstatcb) - self.fs.lstat(abs, lstatcb) - - function lstatcb_ (er, lstat) { - if (er && er.code === 'ENOENT') - return cb() - - var isSym = lstat && lstat.isSymbolicLink() - self.symlinks[abs] = isSym - - // If it's not a symlink or a dir, then it's definitely a regular file. - // don't bother doing a readdir in that case. - if (!isSym && lstat && !lstat.isDirectory()) { - self.cache[abs] = 'FILE' - cb() - } else - self._readdir(abs, false, cb) - } -} - -Glob.prototype._readdir = function (abs, inGlobStar, cb) { - if (this.aborted) - return - - cb = inflight('readdir\0'+abs+'\0'+inGlobStar, cb) - if (!cb) - return - - //console.error('RD %j %j', +inGlobStar, abs) - if (inGlobStar && !ownProp(this.symlinks, abs)) - return this._readdirInGlobStar(abs, cb) - - if (ownProp(this.cache, abs)) { - var c = this.cache[abs] - if (!c || c === 'FILE') - return cb() - - if (Array.isArray(c)) - return cb(null, c) - } - - var self = this - self.fs.readdir(abs, readdirCb(this, abs, cb)) -} - -function readdirCb (self, abs, cb) { - return function (er, entries) { - if (er) - self._readdirError(abs, er, cb) - else - self._readdirEntries(abs, entries, cb) - } -} - -Glob.prototype._readdirEntries = function (abs, entries, cb) { - if (this.aborted) - return - - // if we haven't asked to stat everything, then just - // assume that everything in there exists, so we can avoid - // having to stat it a second time. - if (!this.mark && !this.stat) { - for (var i = 0; i < entries.length; i ++) { - var e = entries[i] - if (abs === '/') - e = abs + e - else - e = abs + '/' + e - this.cache[e] = true - } - } - - this.cache[abs] = entries - return cb(null, entries) -} - -Glob.prototype._readdirError = function (f, er, cb) { - if (this.aborted) - return - - // handle errors, and cache the information - switch (er.code) { - case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 - case 'ENOTDIR': // totally normal. means it *does* exist. - var abs = this._makeAbs(f) - this.cache[abs] = 'FILE' - if (abs === this.cwdAbs) { - var error = new Error(er.code + ' invalid cwd ' + this.cwd) - error.path = this.cwd - error.code = er.code - this.emit('error', error) - this.abort() - } - break - - case 'ENOENT': // not terribly unusual - case 'ELOOP': - case 'ENAMETOOLONG': - case 'UNKNOWN': - this.cache[this._makeAbs(f)] = false - break - - default: // some unusual error. Treat as failure. - this.cache[this._makeAbs(f)] = false - if (this.strict) { - this.emit('error', er) - // If the error is handled, then we abort - // if not, we threw out of here - this.abort() - } - if (!this.silent) - console.error('glob error', er) - break - } - - return cb() -} - -Glob.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar, cb) { - var self = this - this._readdir(abs, inGlobStar, function (er, entries) { - self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb) - }) -} - - -Glob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { - //console.error('pgs2', prefix, remain[0], entries) - - // no entries means not a dir, so it can never have matches - // foo.txt/** doesn't match foo.txt - if (!entries) - return cb() - - // test without the globstar, and with every child both below - // and replacing the globstar. - var remainWithoutGlobStar = remain.slice(1) - var gspref = prefix ? [ prefix ] : [] - var noGlobStar = gspref.concat(remainWithoutGlobStar) - - // the noGlobStar pattern exits the inGlobStar state - this._process(noGlobStar, index, false, cb) - - var isSym = this.symlinks[abs] - var len = entries.length - - // If it's a symlink, and we're in a globstar, then stop - if (isSym && inGlobStar) - return cb() - - for (var i = 0; i < len; i++) { - var e = entries[i] - if (e.charAt(0) === '.' && !this.dot) - continue - - // these two cases enter the inGlobStar state - var instead = gspref.concat(entries[i], remainWithoutGlobStar) - this._process(instead, index, true, cb) - - var below = gspref.concat(entries[i], remain) - this._process(below, index, true, cb) - } - - cb() -} - -Glob.prototype._processSimple = function (prefix, index, cb) { - // XXX review this. Shouldn't it be doing the mounting etc - // before doing stat? kinda weird? - var self = this - this._stat(prefix, function (er, exists) { - self._processSimple2(prefix, index, er, exists, cb) - }) -} -Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) { - - //console.error('ps2', prefix, exists) - - if (!this.matches[index]) - this.matches[index] = Object.create(null) - - // If it doesn't exist, then just mark the lack of results - if (!exists) - return cb() - - if (prefix && isAbsolute(prefix) && !this.nomount) { - var trail = /[\/\\]$/.test(prefix) - if (prefix.charAt(0) === '/') { - prefix = path.join(this.root, prefix) - } else { - prefix = path.resolve(this.root, prefix) - if (trail) - prefix += '/' - } - } - - if (process.platform === 'win32') - prefix = prefix.replace(/\\/g, '/') - - // Mark this as a match - this._emitMatch(index, prefix) - cb() -} - -// Returns either 'DIR', 'FILE', or false -Glob.prototype._stat = function (f, cb) { - var abs = this._makeAbs(f) - var needDir = f.slice(-1) === '/' - - if (f.length > this.maxLength) - return cb() - - if (!this.stat && ownProp(this.cache, abs)) { - var c = this.cache[abs] - - if (Array.isArray(c)) - c = 'DIR' - - // It exists, but maybe not how we need it - if (!needDir || c === 'DIR') - return cb(null, c) - - if (needDir && c === 'FILE') - return cb() - - // otherwise we have to stat, because maybe c=true - // if we know it exists, but not what it is. - } - - var exists - var stat = this.statCache[abs] - if (stat !== undefined) { - if (stat === false) - return cb(null, stat) - else { - var type = stat.isDirectory() ? 'DIR' : 'FILE' - if (needDir && type === 'FILE') - return cb() - else - return cb(null, type, stat) - } - } - - var self = this - var statcb = inflight('stat\0' + abs, lstatcb_) - if (statcb) - self.fs.lstat(abs, statcb) - - function lstatcb_ (er, lstat) { - if (lstat && lstat.isSymbolicLink()) { - // If it's a symlink, then treat it as the target, unless - // the target does not exist, then treat it as a file. - return self.fs.stat(abs, function (er, stat) { - if (er) - self._stat2(f, abs, null, lstat, cb) - else - self._stat2(f, abs, er, stat, cb) - }) - } else { - self._stat2(f, abs, er, lstat, cb) - } - } -} - -Glob.prototype._stat2 = function (f, abs, er, stat, cb) { - if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) { - this.statCache[abs] = false - return cb() - } - - var needDir = f.slice(-1) === '/' - this.statCache[abs] = stat - - if (abs.slice(-1) === '/' && stat && !stat.isDirectory()) - return cb(null, false, stat) - - var c = true - if (stat) - c = stat.isDirectory() ? 'DIR' : 'FILE' - this.cache[abs] = this.cache[abs] || c - - if (needDir && c === 'FILE') - return cb() - - return cb(null, c, stat) -} diff --git a/deps/npm/node_modules/glob/node_modules/minimatch/LICENSE b/deps/npm/node_modules/glob/node_modules/minimatch/LICENSE deleted file mode 100644 index 1493534e60dce4..00000000000000 --- a/deps/npm/node_modules/glob/node_modules/minimatch/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) 2011-2023 Isaac Z. Schlueter and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/deps/npm/node_modules/glob/node_modules/minimatch/lib/path.js b/deps/npm/node_modules/glob/node_modules/minimatch/lib/path.js deleted file mode 100644 index ffe453d9e05577..00000000000000 --- a/deps/npm/node_modules/glob/node_modules/minimatch/lib/path.js +++ /dev/null @@ -1,4 +0,0 @@ -const isWindows = typeof process === 'object' && - process && - process.platform === 'win32' -module.exports = isWindows ? { sep: '\\' } : { sep: '/' } diff --git a/deps/npm/node_modules/glob/node_modules/minimatch/minimatch.js b/deps/npm/node_modules/glob/node_modules/minimatch/minimatch.js deleted file mode 100644 index 6c8bfc35181c6d..00000000000000 --- a/deps/npm/node_modules/glob/node_modules/minimatch/minimatch.js +++ /dev/null @@ -1,944 +0,0 @@ -const minimatch = module.exports = (p, pattern, options = {}) => { - assertValidPattern(pattern) - - // shortcut: comments match nothing. - if (!options.nocomment && pattern.charAt(0) === '#') { - return false - } - - return new Minimatch(pattern, options).match(p) -} - -module.exports = minimatch - -const path = require('./lib/path.js') -minimatch.sep = path.sep - -const GLOBSTAR = Symbol('globstar **') -minimatch.GLOBSTAR = GLOBSTAR -const expand = require('brace-expansion') - -const plTypes = { - '!': { open: '(?:(?!(?:', close: '))[^/]*?)'}, - '?': { open: '(?:', close: ')?' }, - '+': { open: '(?:', close: ')+' }, - '*': { open: '(?:', close: ')*' }, - '@': { open: '(?:', close: ')' } -} - -// any single thing other than / -// don't need to escape / when using new RegExp() -const qmark = '[^/]' - -// * => any number of characters -const star = qmark + '*?' - -// ** when dots are allowed. Anything goes, except .. and . -// not (^ or / followed by one or two dots followed by $ or /), -// followed by anything, any number of times. -const twoStarDot = '(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?' - -// not a ^ or / followed by a dot, -// followed by anything, any number of times. -const twoStarNoDot = '(?:(?!(?:\\\/|^)\\.).)*?' - -// "abc" -> { a:true, b:true, c:true } -const charSet = s => s.split('').reduce((set, c) => { - set[c] = true - return set -}, {}) - -// characters that need to be escaped in RegExp. -const reSpecials = charSet('().*{}+?[]^$\\!') - -// characters that indicate we have to add the pattern start -const addPatternStartSet = charSet('[.(') - -// normalizes slashes. -const slashSplit = /\/+/ - -minimatch.filter = (pattern, options = {}) => - (p, i, list) => minimatch(p, pattern, options) - -const ext = (a, b = {}) => { - const t = {} - Object.keys(a).forEach(k => t[k] = a[k]) - Object.keys(b).forEach(k => t[k] = b[k]) - return t -} - -minimatch.defaults = def => { - if (!def || typeof def !== 'object' || !Object.keys(def).length) { - return minimatch - } - - const orig = minimatch - - const m = (p, pattern, options) => orig(p, pattern, ext(def, options)) - m.Minimatch = class Minimatch extends orig.Minimatch { - constructor (pattern, options) { - super(pattern, ext(def, options)) - } - } - m.Minimatch.defaults = options => orig.defaults(ext(def, options)).Minimatch - m.filter = (pattern, options) => orig.filter(pattern, ext(def, options)) - m.defaults = options => orig.defaults(ext(def, options)) - m.makeRe = (pattern, options) => orig.makeRe(pattern, ext(def, options)) - m.braceExpand = (pattern, options) => orig.braceExpand(pattern, ext(def, options)) - m.match = (list, pattern, options) => orig.match(list, pattern, ext(def, options)) - - return m -} - - - - - -// Brace expansion: -// a{b,c}d -> abd acd -// a{b,}c -> abc ac -// a{0..3}d -> a0d a1d a2d a3d -// a{b,c{d,e}f}g -> abg acdfg acefg -// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg -// -// Invalid sets are not expanded. -// a{2..}b -> a{2..}b -// a{b}c -> a{b}c -minimatch.braceExpand = (pattern, options) => braceExpand(pattern, options) - -const braceExpand = (pattern, options = {}) => { - assertValidPattern(pattern) - - // Thanks to Yeting Li for - // improving this regexp to avoid a ReDOS vulnerability. - if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) { - // shortcut. no need to expand. - return [pattern] - } - - return expand(pattern) -} - -const MAX_PATTERN_LENGTH = 1024 * 64 -const assertValidPattern = pattern => { - if (typeof pattern !== 'string') { - throw new TypeError('invalid pattern') - } - - if (pattern.length > MAX_PATTERN_LENGTH) { - throw new TypeError('pattern is too long') - } -} - -// parse a component of the expanded set. -// At this point, no pattern may contain "/" in it -// so we're going to return a 2d array, where each entry is the full -// pattern, split on '/', and then turned into a regular expression. -// A regexp is made at the end which joins each array with an -// escaped /, and another full one which joins each regexp with |. -// -// Following the lead of Bash 4.1, note that "**" only has special meaning -// when it is the *only* thing in a path portion. Otherwise, any series -// of * is equivalent to a single *. Globstar behavior is enabled by -// default, and can be disabled by setting options.noglobstar. -const SUBPARSE = Symbol('subparse') - -minimatch.makeRe = (pattern, options) => - new Minimatch(pattern, options || {}).makeRe() - -minimatch.match = (list, pattern, options = {}) => { - const mm = new Minimatch(pattern, options) - list = list.filter(f => mm.match(f)) - if (mm.options.nonull && !list.length) { - list.push(pattern) - } - return list -} - -// replace stuff like \* with * -const globUnescape = s => s.replace(/\\(.)/g, '$1') -const charUnescape = s => s.replace(/\\([^-\]])/g, '$1') -const regExpEscape = s => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&') -const braExpEscape = s => s.replace(/[[\]\\]/g, '\\$&') - -class Minimatch { - constructor (pattern, options) { - assertValidPattern(pattern) - - if (!options) options = {} - - this.options = options - this.set = [] - this.pattern = pattern - this.windowsPathsNoEscape = !!options.windowsPathsNoEscape || - options.allowWindowsEscape === false - if (this.windowsPathsNoEscape) { - this.pattern = this.pattern.replace(/\\/g, '/') - } - this.regexp = null - this.negate = false - this.comment = false - this.empty = false - this.partial = !!options.partial - - // make the set of regexps etc. - this.make() - } - - debug () {} - - make () { - const pattern = this.pattern - const options = this.options - - // empty patterns and comments match nothing. - if (!options.nocomment && pattern.charAt(0) === '#') { - this.comment = true - return - } - if (!pattern) { - this.empty = true - return - } - - // step 1: figure out negation, etc. - this.parseNegate() - - // step 2: expand braces - let set = this.globSet = this.braceExpand() - - if (options.debug) this.debug = (...args) => console.error(...args) - - this.debug(this.pattern, set) - - // step 3: now we have a set, so turn each one into a series of path-portion - // matching patterns. - // These will be regexps, except in the case of "**", which is - // set to the GLOBSTAR object for globstar behavior, - // and will not contain any / characters - set = this.globParts = set.map(s => s.split(slashSplit)) - - this.debug(this.pattern, set) - - // glob --> regexps - set = set.map((s, si, set) => s.map(this.parse, this)) - - this.debug(this.pattern, set) - - // filter out everything that didn't compile properly. - set = set.filter(s => s.indexOf(false) === -1) - - this.debug(this.pattern, set) - - this.set = set - } - - parseNegate () { - if (this.options.nonegate) return - - const pattern = this.pattern - let negate = false - let negateOffset = 0 - - for (let i = 0; i < pattern.length && pattern.charAt(i) === '!'; i++) { - negate = !negate - negateOffset++ - } - - if (negateOffset) this.pattern = pattern.slice(negateOffset) - this.negate = negate - } - - // set partial to true to test if, for example, - // "/a/b" matches the start of "/*/b/*/d" - // Partial means, if you run out of file before you run - // out of pattern, then that's fine, as long as all - // the parts match. - matchOne (file, pattern, partial) { - var options = this.options - - this.debug('matchOne', - { 'this': this, file: file, pattern: pattern }) - - this.debug('matchOne', file.length, pattern.length) - - for (var fi = 0, - pi = 0, - fl = file.length, - pl = pattern.length - ; (fi < fl) && (pi < pl) - ; fi++, pi++) { - this.debug('matchOne loop') - var p = pattern[pi] - var f = file[fi] - - this.debug(pattern, p, f) - - // should be impossible. - // some invalid regexp stuff in the set. - /* istanbul ignore if */ - if (p === false) return false - - if (p === GLOBSTAR) { - this.debug('GLOBSTAR', [pattern, p, f]) - - // "**" - // a/**/b/**/c would match the following: - // a/b/x/y/z/c - // a/x/y/z/b/c - // a/b/x/b/x/c - // a/b/c - // To do this, take the rest of the pattern after - // the **, and see if it would match the file remainder. - // If so, return success. - // If not, the ** "swallows" a segment, and try again. - // This is recursively awful. - // - // a/**/b/**/c matching a/b/x/y/z/c - // - a matches a - // - doublestar - // - matchOne(b/x/y/z/c, b/**/c) - // - b matches b - // - doublestar - // - matchOne(x/y/z/c, c) -> no - // - matchOne(y/z/c, c) -> no - // - matchOne(z/c, c) -> no - // - matchOne(c, c) yes, hit - var fr = fi - var pr = pi + 1 - if (pr === pl) { - this.debug('** at the end') - // a ** at the end will just swallow the rest. - // We have found a match. - // however, it will not swallow /.x, unless - // options.dot is set. - // . and .. are *never* matched by **, for explosively - // exponential reasons. - for (; fi < fl; fi++) { - if (file[fi] === '.' || file[fi] === '..' || - (!options.dot && file[fi].charAt(0) === '.')) return false - } - return true - } - - // ok, let's see if we can swallow whatever we can. - while (fr < fl) { - var swallowee = file[fr] - - this.debug('\nglobstar while', file, fr, pattern, pr, swallowee) - - // XXX remove this slice. Just pass the start index. - if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { - this.debug('globstar found match!', fr, fl, swallowee) - // found a match. - return true - } else { - // can't swallow "." or ".." ever. - // can only swallow ".foo" when explicitly asked. - if (swallowee === '.' || swallowee === '..' || - (!options.dot && swallowee.charAt(0) === '.')) { - this.debug('dot detected!', file, fr, pattern, pr) - break - } - - // ** swallows a segment, and continue. - this.debug('globstar swallow a segment, and continue') - fr++ - } - } - - // no match was found. - // However, in partial mode, we can't say this is necessarily over. - // If there's more *pattern* left, then - /* istanbul ignore if */ - if (partial) { - // ran out of file - this.debug('\n>>> no match, partial?', file, fr, pattern, pr) - if (fr === fl) return true - } - return false - } - - // something other than ** - // non-magic patterns just have to match exactly - // patterns with magic have been turned into regexps. - var hit - if (typeof p === 'string') { - hit = f === p - this.debug('string match', p, f, hit) - } else { - hit = f.match(p) - this.debug('pattern match', p, f, hit) - } - - if (!hit) return false - } - - // Note: ending in / means that we'll get a final "" - // at the end of the pattern. This can only match a - // corresponding "" at the end of the file. - // If the file ends in /, then it can only match a - // a pattern that ends in /, unless the pattern just - // doesn't have any more for it. But, a/b/ should *not* - // match "a/b/*", even though "" matches against the - // [^/]*? pattern, except in partial mode, where it might - // simply not be reached yet. - // However, a/b/ should still satisfy a/* - - // now either we fell off the end of the pattern, or we're done. - if (fi === fl && pi === pl) { - // ran out of pattern and filename at the same time. - // an exact hit! - return true - } else if (fi === fl) { - // ran out of file, but still had pattern left. - // this is ok if we're doing the match as part of - // a glob fs traversal. - return partial - } else /* istanbul ignore else */ if (pi === pl) { - // ran out of pattern, still have file left. - // this is only acceptable if we're on the very last - // empty segment of a file with a trailing slash. - // a/* should match a/b/ - return (fi === fl - 1) && (file[fi] === '') - } - - // should be unreachable. - /* istanbul ignore next */ - throw new Error('wtf?') - } - - braceExpand () { - return braceExpand(this.pattern, this.options) - } - - parse (pattern, isSub) { - assertValidPattern(pattern) - - const options = this.options - - // shortcuts - if (pattern === '**') { - if (!options.noglobstar) - return GLOBSTAR - else - pattern = '*' - } - if (pattern === '') return '' - - let re = '' - let hasMagic = false - let escaping = false - // ? => one single character - const patternListStack = [] - const negativeLists = [] - let stateChar - let inClass = false - let reClassStart = -1 - let classStart = -1 - let cs - let pl - let sp - // . and .. never match anything that doesn't start with ., - // even when options.dot is set. However, if the pattern - // starts with ., then traversal patterns can match. - let dotTravAllowed = pattern.charAt(0) === '.' - let dotFileAllowed = options.dot || dotTravAllowed - const patternStart = () => - dotTravAllowed - ? '' - : dotFileAllowed - ? '(?!(?:^|\\/)\\.{1,2}(?:$|\\/))' - : '(?!\\.)' - const subPatternStart = (p) => - p.charAt(0) === '.' - ? '' - : options.dot - ? '(?!(?:^|\\/)\\.{1,2}(?:$|\\/))' - : '(?!\\.)' - - - const clearStateChar = () => { - if (stateChar) { - // we had some state-tracking character - // that wasn't consumed by this pass. - switch (stateChar) { - case '*': - re += star - hasMagic = true - break - case '?': - re += qmark - hasMagic = true - break - default: - re += '\\' + stateChar - break - } - this.debug('clearStateChar %j %j', stateChar, re) - stateChar = false - } - } - - for (let i = 0, c; (i < pattern.length) && (c = pattern.charAt(i)); i++) { - this.debug('%s\t%s %s %j', pattern, i, re, c) - - // skip over any that are escaped. - if (escaping) { - /* istanbul ignore next - completely not allowed, even escaped. */ - if (c === '/') { - return false - } - - if (reSpecials[c]) { - re += '\\' - } - re += c - escaping = false - continue - } - - switch (c) { - /* istanbul ignore next */ - case '/': { - // Should already be path-split by now. - return false - } - - case '\\': - if (inClass && pattern.charAt(i + 1) === '-') { - re += c - continue - } - - clearStateChar() - escaping = true - continue - - // the various stateChar values - // for the "extglob" stuff. - case '?': - case '*': - case '+': - case '@': - case '!': - this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c) - - // all of those are literals inside a class, except that - // the glob [!a] means [^a] in regexp - if (inClass) { - this.debug(' in class') - if (c === '!' && i === classStart + 1) c = '^' - re += c - continue - } - - // if we already have a stateChar, then it means - // that there was something like ** or +? in there. - // Handle the stateChar, then proceed with this one. - this.debug('call clearStateChar %j', stateChar) - clearStateChar() - stateChar = c - // if extglob is disabled, then +(asdf|foo) isn't a thing. - // just clear the statechar *now*, rather than even diving into - // the patternList stuff. - if (options.noext) clearStateChar() - continue - - case '(': { - if (inClass) { - re += '(' - continue - } - - if (!stateChar) { - re += '\\(' - continue - } - - const plEntry = { - type: stateChar, - start: i - 1, - reStart: re.length, - open: plTypes[stateChar].open, - close: plTypes[stateChar].close, - } - this.debug(this.pattern, '\t', plEntry) - patternListStack.push(plEntry) - // negation is (?:(?!(?:js)(?:))[^/]*) - re += plEntry.open - // next entry starts with a dot maybe? - if (plEntry.start === 0 && plEntry.type !== '!') { - dotTravAllowed = true - re += subPatternStart(pattern.slice(i + 1)) - } - this.debug('plType %j %j', stateChar, re) - stateChar = false - continue - } - - case ')': { - const plEntry = patternListStack[patternListStack.length - 1] - if (inClass || !plEntry) { - re += '\\)' - continue - } - patternListStack.pop() - - // closing an extglob - clearStateChar() - hasMagic = true - pl = plEntry - // negation is (?:(?!js)[^/]*) - // The others are (?:) - re += pl.close - if (pl.type === '!') { - negativeLists.push(Object.assign(pl, { reEnd: re.length })) - } - continue - } - - case '|': { - const plEntry = patternListStack[patternListStack.length - 1] - if (inClass || !plEntry) { - re += '\\|' - continue - } - - clearStateChar() - re += '|' - // next subpattern can start with a dot? - if (plEntry.start === 0 && plEntry.type !== '!') { - dotTravAllowed = true - re += subPatternStart(pattern.slice(i + 1)) - } - continue - } - - // these are mostly the same in regexp and glob - case '[': - // swallow any state-tracking char before the [ - clearStateChar() - - if (inClass) { - re += '\\' + c - continue - } - - inClass = true - classStart = i - reClassStart = re.length - re += c - continue - - case ']': - // a right bracket shall lose its special - // meaning and represent itself in - // a bracket expression if it occurs - // first in the list. -- POSIX.2 2.8.3.2 - if (i === classStart + 1 || !inClass) { - re += '\\' + c - continue - } - - // split where the last [ was, make sure we don't have - // an invalid re. if so, re-walk the contents of the - // would-be class to re-translate any characters that - // were passed through as-is - // TODO: It would probably be faster to determine this - // without a try/catch and a new RegExp, but it's tricky - // to do safely. For now, this is safe and works. - cs = pattern.substring(classStart + 1, i) - try { - RegExp('[' + braExpEscape(charUnescape(cs)) + ']') - // looks good, finish up the class. - re += c - } catch (er) { - // out of order ranges in JS are errors, but in glob syntax, - // they're just a range that matches nothing. - re = re.substring(0, reClassStart) + '(?:$.)' // match nothing ever - } - hasMagic = true - inClass = false - continue - - default: - // swallow any state char that wasn't consumed - clearStateChar() - - if (reSpecials[c] && !(c === '^' && inClass)) { - re += '\\' - } - - re += c - break - - } // switch - } // for - - // handle the case where we left a class open. - // "[abc" is valid, equivalent to "\[abc" - if (inClass) { - // split where the last [ was, and escape it - // this is a huge pita. We now have to re-walk - // the contents of the would-be class to re-translate - // any characters that were passed through as-is - cs = pattern.slice(classStart + 1) - sp = this.parse(cs, SUBPARSE) - re = re.substring(0, reClassStart) + '\\[' + sp[0] - hasMagic = hasMagic || sp[1] - } - - // handle the case where we had a +( thing at the *end* - // of the pattern. - // each pattern list stack adds 3 chars, and we need to go through - // and escape any | chars that were passed through as-is for the regexp. - // Go through and escape them, taking care not to double-escape any - // | chars that were already escaped. - for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { - let tail - tail = re.slice(pl.reStart + pl.open.length) - this.debug('setting tail', re, pl) - // maybe some even number of \, then maybe 1 \, followed by a | - tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, (_, $1, $2) => { - /* istanbul ignore else - should already be done */ - if (!$2) { - // the | isn't already escaped, so escape it. - $2 = '\\' - } - - // need to escape all those slashes *again*, without escaping the - // one that we need for escaping the | character. As it works out, - // escaping an even number of slashes can be done by simply repeating - // it exactly after itself. That's why this trick works. - // - // I am sorry that you have to see this. - return $1 + $1 + $2 + '|' - }) - - this.debug('tail=%j\n %s', tail, tail, pl, re) - const t = pl.type === '*' ? star - : pl.type === '?' ? qmark - : '\\' + pl.type - - hasMagic = true - re = re.slice(0, pl.reStart) + t + '\\(' + tail - } - - // handle trailing things that only matter at the very end. - clearStateChar() - if (escaping) { - // trailing \\ - re += '\\\\' - } - - // only need to apply the nodot start if the re starts with - // something that could conceivably capture a dot - const addPatternStart = addPatternStartSet[re.charAt(0)] - - // Hack to work around lack of negative lookbehind in JS - // A pattern like: *.!(x).!(y|z) needs to ensure that a name - // like 'a.xyz.yz' doesn't match. So, the first negative - // lookahead, has to look ALL the way ahead, to the end of - // the pattern. - for (let n = negativeLists.length - 1; n > -1; n--) { - const nl = negativeLists[n] - - const nlBefore = re.slice(0, nl.reStart) - const nlFirst = re.slice(nl.reStart, nl.reEnd - 8) - let nlAfter = re.slice(nl.reEnd) - const nlLast = re.slice(nl.reEnd - 8, nl.reEnd) + nlAfter - - // Handle nested stuff like *(*.js|!(*.json)), where open parens - // mean that we should *not* include the ) in the bit that is considered - // "after" the negated section. - const closeParensBefore = nlBefore.split(')').length - const openParensBefore = nlBefore.split('(').length - closeParensBefore - let cleanAfter = nlAfter - for (let i = 0; i < openParensBefore; i++) { - cleanAfter = cleanAfter.replace(/\)[+*?]?/, '') - } - nlAfter = cleanAfter - - const dollar = nlAfter === '' && isSub !== SUBPARSE ? '(?:$|\\/)' : '' - - re = nlBefore + nlFirst + nlAfter + dollar + nlLast - } - - // if the re is not "" at this point, then we need to make sure - // it doesn't match against an empty path part. - // Otherwise a/* will match a/, which it should not. - if (re !== '' && hasMagic) { - re = '(?=.)' + re - } - - if (addPatternStart) { - re = patternStart() + re - } - - // parsing just a piece of a larger pattern. - if (isSub === SUBPARSE) { - return [re, hasMagic] - } - - // if it's nocase, and the lcase/uppercase don't match, it's magic - if (options.nocase && !hasMagic) { - hasMagic = pattern.toUpperCase() !== pattern.toLowerCase() - } - - // skip the regexp for non-magical patterns - // unescape anything in it, though, so that it'll be - // an exact match against a file etc. - if (!hasMagic) { - return globUnescape(pattern) - } - - const flags = options.nocase ? 'i' : '' - try { - return Object.assign(new RegExp('^' + re + '$', flags), { - _glob: pattern, - _src: re, - }) - } catch (er) /* istanbul ignore next - should be impossible */ { - // If it was an invalid regular expression, then it can't match - // anything. This trick looks for a character after the end of - // the string, which is of course impossible, except in multi-line - // mode, but it's not a /m regex. - return new RegExp('$.') - } - } - - makeRe () { - if (this.regexp || this.regexp === false) return this.regexp - - // at this point, this.set is a 2d array of partial - // pattern strings, or "**". - // - // It's better to use .match(). This function shouldn't - // be used, really, but it's pretty convenient sometimes, - // when you just want to work with a regex. - const set = this.set - - if (!set.length) { - this.regexp = false - return this.regexp - } - const options = this.options - - const twoStar = options.noglobstar ? star - : options.dot ? twoStarDot - : twoStarNoDot - const flags = options.nocase ? 'i' : '' - - // coalesce globstars and regexpify non-globstar patterns - // if it's the only item, then we just do one twoStar - // if it's the first, and there are more, prepend (\/|twoStar\/)? to next - // if it's the last, append (\/twoStar|) to previous - // if it's in the middle, append (\/|\/twoStar\/) to previous - // then filter out GLOBSTAR symbols - let re = set.map(pattern => { - pattern = pattern.map(p => - typeof p === 'string' ? regExpEscape(p) - : p === GLOBSTAR ? GLOBSTAR - : p._src - ).reduce((set, p) => { - if (!(set[set.length - 1] === GLOBSTAR && p === GLOBSTAR)) { - set.push(p) - } - return set - }, []) - pattern.forEach((p, i) => { - if (p !== GLOBSTAR || pattern[i-1] === GLOBSTAR) { - return - } - if (i === 0) { - if (pattern.length > 1) { - pattern[i+1] = '(?:\\\/|' + twoStar + '\\\/)?' + pattern[i+1] - } else { - pattern[i] = twoStar - } - } else if (i === pattern.length - 1) { - pattern[i-1] += '(?:\\\/|' + twoStar + ')?' - } else { - pattern[i-1] += '(?:\\\/|\\\/' + twoStar + '\\\/)' + pattern[i+1] - pattern[i+1] = GLOBSTAR - } - }) - return pattern.filter(p => p !== GLOBSTAR).join('/') - }).join('|') - - // must match entire pattern - // ending in a * or ** will make it less strict. - re = '^(?:' + re + ')$' - - // can match anything, as long as it's not this. - if (this.negate) re = '^(?!' + re + ').*$' - - try { - this.regexp = new RegExp(re, flags) - } catch (ex) /* istanbul ignore next - should be impossible */ { - this.regexp = false - } - return this.regexp - } - - match (f, partial = this.partial) { - this.debug('match', f, this.pattern) - // short-circuit in the case of busted things. - // comments, etc. - if (this.comment) return false - if (this.empty) return f === '' - - if (f === '/' && partial) return true - - const options = this.options - - // windows: need to use /, not \ - if (path.sep !== '/') { - f = f.split(path.sep).join('/') - } - - // treat the test path as a set of pathparts. - f = f.split(slashSplit) - this.debug(this.pattern, 'split', f) - - // just ONE of the pattern sets in this.set needs to match - // in order for it to be valid. If negating, then just one - // match means that we have failed. - // Either way, return on the first hit. - - const set = this.set - this.debug(this.pattern, 'set', set) - - // Find the basename of the path by looking for the last non-empty segment - let filename - for (let i = f.length - 1; i >= 0; i--) { - filename = f[i] - if (filename) break - } - - for (let i = 0; i < set.length; i++) { - const pattern = set[i] - let file = f - if (options.matchBase && pattern.length === 1) { - file = [filename] - } - const hit = this.matchOne(file, pattern, partial) - if (hit) { - if (options.flipNegate) return true - return !this.negate - } - } - - // didn't get any hits. this is success if it's a negative - // pattern, failure otherwise. - if (options.flipNegate) return false - return this.negate - } - - static defaults (def) { - return minimatch.defaults(def).Minimatch - } -} - -minimatch.Minimatch = Minimatch diff --git a/deps/npm/node_modules/glob/node_modules/minimatch/package.json b/deps/npm/node_modules/glob/node_modules/minimatch/package.json deleted file mode 100644 index c8809dbb3119d9..00000000000000 --- a/deps/npm/node_modules/glob/node_modules/minimatch/package.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "author": "Isaac Z. Schlueter (http://blog.izs.me)", - "name": "minimatch", - "description": "a glob matcher in javascript", - "publishConfig": { - "tag": "legacy-v5" - }, - "version": "5.1.6", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/minimatch.git" - }, - "main": "minimatch.js", - "scripts": { - "test": "tap", - "snap": "tap", - "preversion": "npm test", - "postversion": "npm publish", - "prepublishOnly": "git push origin --follow-tags" - }, - "engines": { - "node": ">=10" - }, - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "devDependencies": { - "tap": "^16.3.2" - }, - "license": "ISC", - "files": [ - "minimatch.js", - "lib" - ] -} diff --git a/deps/npm/node_modules/glob/package.json b/deps/npm/node_modules/glob/package.json index ca0fd916211b51..e675cebdbd4e73 100644 --- a/deps/npm/node_modules/glob/package.json +++ b/deps/npm/node_modules/glob/package.json @@ -1,55 +1,97 @@ { "author": "Isaac Z. Schlueter (http://blog.izs.me/)", "name": "glob", - "description": "a little globber", - "version": "8.1.0", + "description": "the most correct and second fastest glob implementation in JavaScript", + "version": "9.3.2", "repository": { "type": "git", "url": "git://github.com/isaacs/node-glob.git" }, - "main": "glob.js", + "main": "./dist/cjs/index-cjs.js", + "module": "./dist/mjs/index.js", + "types": "./dist/mjs/index.d.ts", + "exports": { + ".": { + "import": { + "types": "./dist/mjs/index.d.ts", + "default": "./dist/mjs/index.js" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index-cjs.js" + } + } + }, "files": [ - "glob.js", - "sync.js", - "common.js" + "dist" ], - "engines": { - "node": ">=12" + "scripts": { + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags", + "preprepare": "rm -rf dist", + "prepare": "tsc -p tsconfig.json && tsc -p tsconfig-esm.json", + "postprepare": "bash fixup.sh", + "pretest": "npm run prepare", + "presnap": "npm run prepare", + "test": "c8 tap", + "snap": "c8 tap", + "format": "prettier --write . --loglevel warn", + "typedoc": "typedoc --tsconfig tsconfig-esm.json ./src/*.ts", + "prepublish": "npm run benchclean", + "profclean": "rm -f v8.log profile.txt", + "test-regen": "npm run profclean && TEST_REGEN=1 node --no-warnings --loader ts-node/esm test/00-setup.ts", + "prebench": "npm run prepare", + "bench": "bash benchmark.sh", + "preprof": "npm run prepare", + "prof": "bash prof.sh", + "benchclean": "node benchclean.js" + }, + "prettier": { + "semi": false, + "printWidth": 75, + "tabWidth": 2, + "useTabs": false, + "singleQuote": true, + "jsxSingleQuote": false, + "bracketSameLine": true, + "arrowParens": "avoid", + "endOfLine": "lf" }, "dependencies": { "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^5.0.1", - "once": "^1.3.0" + "minimatch": "^7.4.1", + "minipass": "^4.2.4", + "path-scurry": "^1.6.1" }, "devDependencies": { - "memfs": "^3.2.0", - "mkdirp": "0", - "rimraf": "^2.2.8", - "tap": "^16.0.1", - "tick": "0.0.6" + "@types/node": "^18.11.18", + "@types/tap": "^15.0.7", + "c8": "^7.12.0", + "memfs": "^3.4.13", + "mkdirp": "^2.1.4", + "prettier": "^2.8.3", + "rimraf": "^4.1.3", + "tap": "^16.3.4", + "ts-node": "^10.9.1", + "typedoc": "^0.23.24", + "typescript": "^4.9.4" }, "tap": { - "before": "test/00-setup.js", - "after": "test/zz-cleanup.js", - "statements": 90, - "branches": 90, - "functions": 90, - "lines": 90, - "jobs": 1 - }, - "scripts": { - "prepublish": "npm run benchclean", - "profclean": "rm -f v8.log profile.txt", - "test": "tap", - "test-regen": "npm run profclean && TEST_REGEN=1 node test/00-setup.js", - "bench": "bash benchmark.sh", - "prof": "bash prof.sh && cat profile.txt", - "benchclean": "node benchclean.js" + "before": "test/00-setup.ts", + "coverage": false, + "node-arg": [ + "--no-warnings", + "--loader", + "ts-node/esm" + ], + "ts": false }, "license": "ISC", "funding": { "url": "https://github.com/sponsors/isaacs" + }, + "engines": { + "node": ">=16 || 14 >=14.17" } } diff --git a/deps/npm/node_modules/glob/sync.js b/deps/npm/node_modules/glob/sync.js deleted file mode 100644 index af4600dd595081..00000000000000 --- a/deps/npm/node_modules/glob/sync.js +++ /dev/null @@ -1,486 +0,0 @@ -module.exports = globSync -globSync.GlobSync = GlobSync - -var rp = require('fs.realpath') -var minimatch = require('minimatch') -var Minimatch = minimatch.Minimatch -var Glob = require('./glob.js').Glob -var util = require('util') -var path = require('path') -var assert = require('assert') -var isAbsolute = require('path').isAbsolute -var common = require('./common.js') -var setopts = common.setopts -var ownProp = common.ownProp -var childrenIgnored = common.childrenIgnored -var isIgnored = common.isIgnored - -function globSync (pattern, options) { - if (typeof options === 'function' || arguments.length === 3) - throw new TypeError('callback provided to sync glob\n'+ - 'See: https://github.com/isaacs/node-glob/issues/167') - - return new GlobSync(pattern, options).found -} - -function GlobSync (pattern, options) { - if (!pattern) - throw new Error('must provide pattern') - - if (typeof options === 'function' || arguments.length === 3) - throw new TypeError('callback provided to sync glob\n'+ - 'See: https://github.com/isaacs/node-glob/issues/167') - - if (!(this instanceof GlobSync)) - return new GlobSync(pattern, options) - - setopts(this, pattern, options) - - if (this.noprocess) - return this - - var n = this.minimatch.set.length - this.matches = new Array(n) - for (var i = 0; i < n; i ++) { - this._process(this.minimatch.set[i], i, false) - } - this._finish() -} - -GlobSync.prototype._finish = function () { - assert.ok(this instanceof GlobSync) - if (this.realpath) { - var self = this - this.matches.forEach(function (matchset, index) { - var set = self.matches[index] = Object.create(null) - for (var p in matchset) { - try { - p = self._makeAbs(p) - var real = rp.realpathSync(p, self.realpathCache) - set[real] = true - } catch (er) { - if (er.syscall === 'stat') - set[self._makeAbs(p)] = true - else - throw er - } - } - }) - } - common.finish(this) -} - - -GlobSync.prototype._process = function (pattern, index, inGlobStar) { - assert.ok(this instanceof GlobSync) - - // Get the first [n] parts of pattern that are all strings. - var n = 0 - while (typeof pattern[n] === 'string') { - n ++ - } - // now n is the index of the first one that is *not* a string. - - // See if there's anything else - var prefix - switch (n) { - // if not, then this is rather simple - case pattern.length: - this._processSimple(pattern.join('/'), index) - return - - case 0: - // pattern *starts* with some non-trivial item. - // going to readdir(cwd), but not include the prefix in matches. - prefix = null - break - - default: - // pattern has some string bits in the front. - // whatever it starts with, whether that's 'absolute' like /foo/bar, - // or 'relative' like '../baz' - prefix = pattern.slice(0, n).join('/') - break - } - - var remain = pattern.slice(n) - - // get the list of entries. - var read - if (prefix === null) - read = '.' - else if (isAbsolute(prefix) || - isAbsolute(pattern.map(function (p) { - return typeof p === 'string' ? p : '[*]' - }).join('/'))) { - if (!prefix || !isAbsolute(prefix)) - prefix = '/' + prefix - read = prefix - } else - read = prefix - - var abs = this._makeAbs(read) - - //if ignored, skip processing - if (childrenIgnored(this, read)) - return - - var isGlobStar = remain[0] === minimatch.GLOBSTAR - if (isGlobStar) - this._processGlobStar(prefix, read, abs, remain, index, inGlobStar) - else - this._processReaddir(prefix, read, abs, remain, index, inGlobStar) -} - - -GlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar) { - var entries = this._readdir(abs, inGlobStar) - - // if the abs isn't a dir, then nothing can match! - if (!entries) - return - - // It will only match dot entries if it starts with a dot, or if - // dot is set. Stuff like @(.foo|.bar) isn't allowed. - var pn = remain[0] - var negate = !!this.minimatch.negate - var rawGlob = pn._glob - var dotOk = this.dot || rawGlob.charAt(0) === '.' - - var matchedEntries = [] - for (var i = 0; i < entries.length; i++) { - var e = entries[i] - if (e.charAt(0) !== '.' || dotOk) { - var m - if (negate && !prefix) { - m = !e.match(pn) - } else { - m = e.match(pn) - } - if (m) - matchedEntries.push(e) - } - } - - var len = matchedEntries.length - // If there are no matched entries, then nothing matches. - if (len === 0) - return - - // if this is the last remaining pattern bit, then no need for - // an additional stat *unless* the user has specified mark or - // stat explicitly. We know they exist, since readdir returned - // them. - - if (remain.length === 1 && !this.mark && !this.stat) { - if (!this.matches[index]) - this.matches[index] = Object.create(null) - - for (var i = 0; i < len; i ++) { - var e = matchedEntries[i] - if (prefix) { - if (prefix.slice(-1) !== '/') - e = prefix + '/' + e - else - e = prefix + e - } - - if (e.charAt(0) === '/' && !this.nomount) { - e = path.join(this.root, e) - } - this._emitMatch(index, e) - } - // This was the last one, and no stats were needed - return - } - - // now test all matched entries as stand-ins for that part - // of the pattern. - remain.shift() - for (var i = 0; i < len; i ++) { - var e = matchedEntries[i] - var newPattern - if (prefix) - newPattern = [prefix, e] - else - newPattern = [e] - this._process(newPattern.concat(remain), index, inGlobStar) - } -} - - -GlobSync.prototype._emitMatch = function (index, e) { - if (isIgnored(this, e)) - return - - var abs = this._makeAbs(e) - - if (this.mark) - e = this._mark(e) - - if (this.absolute) { - e = abs - } - - if (this.matches[index][e]) - return - - if (this.nodir) { - var c = this.cache[abs] - if (c === 'DIR' || Array.isArray(c)) - return - } - - this.matches[index][e] = true - - if (this.stat) - this._stat(e) -} - - -GlobSync.prototype._readdirInGlobStar = function (abs) { - // follow all symlinked directories forever - // just proceed as if this is a non-globstar situation - if (this.follow) - return this._readdir(abs, false) - - var entries - var lstat - var stat - try { - lstat = this.fs.lstatSync(abs) - } catch (er) { - if (er.code === 'ENOENT') { - // lstat failed, doesn't exist - return null - } - } - - var isSym = lstat && lstat.isSymbolicLink() - this.symlinks[abs] = isSym - - // If it's not a symlink or a dir, then it's definitely a regular file. - // don't bother doing a readdir in that case. - if (!isSym && lstat && !lstat.isDirectory()) - this.cache[abs] = 'FILE' - else - entries = this._readdir(abs, false) - - return entries -} - -GlobSync.prototype._readdir = function (abs, inGlobStar) { - var entries - - if (inGlobStar && !ownProp(this.symlinks, abs)) - return this._readdirInGlobStar(abs) - - if (ownProp(this.cache, abs)) { - var c = this.cache[abs] - if (!c || c === 'FILE') - return null - - if (Array.isArray(c)) - return c - } - - try { - return this._readdirEntries(abs, this.fs.readdirSync(abs)) - } catch (er) { - this._readdirError(abs, er) - return null - } -} - -GlobSync.prototype._readdirEntries = function (abs, entries) { - // if we haven't asked to stat everything, then just - // assume that everything in there exists, so we can avoid - // having to stat it a second time. - if (!this.mark && !this.stat) { - for (var i = 0; i < entries.length; i ++) { - var e = entries[i] - if (abs === '/') - e = abs + e - else - e = abs + '/' + e - this.cache[e] = true - } - } - - this.cache[abs] = entries - - // mark and cache dir-ness - return entries -} - -GlobSync.prototype._readdirError = function (f, er) { - // handle errors, and cache the information - switch (er.code) { - case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 - case 'ENOTDIR': // totally normal. means it *does* exist. - var abs = this._makeAbs(f) - this.cache[abs] = 'FILE' - if (abs === this.cwdAbs) { - var error = new Error(er.code + ' invalid cwd ' + this.cwd) - error.path = this.cwd - error.code = er.code - throw error - } - break - - case 'ENOENT': // not terribly unusual - case 'ELOOP': - case 'ENAMETOOLONG': - case 'UNKNOWN': - this.cache[this._makeAbs(f)] = false - break - - default: // some unusual error. Treat as failure. - this.cache[this._makeAbs(f)] = false - if (this.strict) - throw er - if (!this.silent) - console.error('glob error', er) - break - } -} - -GlobSync.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar) { - - var entries = this._readdir(abs, inGlobStar) - - // no entries means not a dir, so it can never have matches - // foo.txt/** doesn't match foo.txt - if (!entries) - return - - // test without the globstar, and with every child both below - // and replacing the globstar. - var remainWithoutGlobStar = remain.slice(1) - var gspref = prefix ? [ prefix ] : [] - var noGlobStar = gspref.concat(remainWithoutGlobStar) - - // the noGlobStar pattern exits the inGlobStar state - this._process(noGlobStar, index, false) - - var len = entries.length - var isSym = this.symlinks[abs] - - // If it's a symlink, and we're in a globstar, then stop - if (isSym && inGlobStar) - return - - for (var i = 0; i < len; i++) { - var e = entries[i] - if (e.charAt(0) === '.' && !this.dot) - continue - - // these two cases enter the inGlobStar state - var instead = gspref.concat(entries[i], remainWithoutGlobStar) - this._process(instead, index, true) - - var below = gspref.concat(entries[i], remain) - this._process(below, index, true) - } -} - -GlobSync.prototype._processSimple = function (prefix, index) { - // XXX review this. Shouldn't it be doing the mounting etc - // before doing stat? kinda weird? - var exists = this._stat(prefix) - - if (!this.matches[index]) - this.matches[index] = Object.create(null) - - // If it doesn't exist, then just mark the lack of results - if (!exists) - return - - if (prefix && isAbsolute(prefix) && !this.nomount) { - var trail = /[\/\\]$/.test(prefix) - if (prefix.charAt(0) === '/') { - prefix = path.join(this.root, prefix) - } else { - prefix = path.resolve(this.root, prefix) - if (trail) - prefix += '/' - } - } - - if (process.platform === 'win32') - prefix = prefix.replace(/\\/g, '/') - - // Mark this as a match - this._emitMatch(index, prefix) -} - -// Returns either 'DIR', 'FILE', or false -GlobSync.prototype._stat = function (f) { - var abs = this._makeAbs(f) - var needDir = f.slice(-1) === '/' - - if (f.length > this.maxLength) - return false - - if (!this.stat && ownProp(this.cache, abs)) { - var c = this.cache[abs] - - if (Array.isArray(c)) - c = 'DIR' - - // It exists, but maybe not how we need it - if (!needDir || c === 'DIR') - return c - - if (needDir && c === 'FILE') - return false - - // otherwise we have to stat, because maybe c=true - // if we know it exists, but not what it is. - } - - var exists - var stat = this.statCache[abs] - if (!stat) { - var lstat - try { - lstat = this.fs.lstatSync(abs) - } catch (er) { - if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) { - this.statCache[abs] = false - return false - } - } - - if (lstat && lstat.isSymbolicLink()) { - try { - stat = this.fs.statSync(abs) - } catch (er) { - stat = lstat - } - } else { - stat = lstat - } - } - - this.statCache[abs] = stat - - var c = true - if (stat) - c = stat.isDirectory() ? 'DIR' : 'FILE' - - this.cache[abs] = this.cache[abs] || c - - if (needDir && c === 'FILE') - return false - - return c -} - -GlobSync.prototype._mark = function (p) { - return common.mark(this, p) -} - -GlobSync.prototype._makeAbs = function (f) { - return common.makeAbs(this, f) -} diff --git a/deps/npm/node_modules/graceful-fs/package.json b/deps/npm/node_modules/graceful-fs/package.json index 305785687247ce..87babf0248563c 100644 --- a/deps/npm/node_modules/graceful-fs/package.json +++ b/deps/npm/node_modules/graceful-fs/package.json @@ -1,7 +1,7 @@ { "name": "graceful-fs", "description": "A drop-in replacement for fs, making various improvements.", - "version": "4.2.10", + "version": "4.2.11", "repository": { "type": "git", "url": "https://github.com/isaacs/node-graceful-fs" @@ -38,7 +38,7 @@ "import-fresh": "^2.0.0", "mkdirp": "^0.5.0", "rimraf": "^2.2.8", - "tap": "^12.7.0" + "tap": "^16.3.4" }, "files": [ "fs.js", @@ -46,5 +46,8 @@ "legacy-streams.js", "polyfills.js", "clone.js" - ] + ], + "tap": { + "reporter": "classic" + } } diff --git a/deps/npm/node_modules/graceful-fs/polyfills.js b/deps/npm/node_modules/graceful-fs/polyfills.js index 46dea36cc490f4..453f1a9e702d1a 100644 --- a/deps/npm/node_modules/graceful-fs/polyfills.js +++ b/deps/npm/node_modules/graceful-fs/polyfills.js @@ -101,7 +101,7 @@ function patch (fs) { var backoff = 0; fs$rename(from, to, function CB (er) { if (er - && (er.code === "EACCES" || er.code === "EPERM") + && (er.code === "EACCES" || er.code === "EPERM" || er.code === "EBUSY") && Date.now() - start < 60000) { setTimeout(function() { fs.stat(to, function (stater, st) { diff --git a/deps/npm/node_modules/has-flag/index.d.ts b/deps/npm/node_modules/has-flag/index.d.ts deleted file mode 100644 index a0a48c89112785..00000000000000 --- a/deps/npm/node_modules/has-flag/index.d.ts +++ /dev/null @@ -1,39 +0,0 @@ -/** -Check if [`argv`](https://nodejs.org/docs/latest/api/process.html#process_process_argv) has a specific flag. - -@param flag - CLI flag to look for. The `--` prefix is optional. -@param argv - CLI arguments. Default: `process.argv`. -@returns Whether the flag exists. - -@example -``` -// $ ts-node foo.ts -f --unicorn --foo=bar -- --rainbow - -// foo.ts -import hasFlag = require('has-flag'); - -hasFlag('unicorn'); -//=> true - -hasFlag('--unicorn'); -//=> true - -hasFlag('f'); -//=> true - -hasFlag('-f'); -//=> true - -hasFlag('foo=bar'); -//=> true - -hasFlag('foo'); -//=> false - -hasFlag('rainbow'); -//=> false -``` -*/ -declare function hasFlag(flag: string, argv?: string[]): boolean; - -export = hasFlag; diff --git a/deps/npm/node_modules/http-proxy-agent/dist/agent.d.ts b/deps/npm/node_modules/http-proxy-agent/dist/agent.d.ts deleted file mode 100644 index 3f043f7f9f7561..00000000000000 --- a/deps/npm/node_modules/http-proxy-agent/dist/agent.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -/// -import net from 'net'; -import { Agent, ClientRequest, RequestOptions } from 'agent-base'; -import { HttpProxyAgentOptions } from '.'; -interface HttpProxyAgentClientRequest extends ClientRequest { - path: string; - output?: string[]; - outputData?: { - data: string; - }[]; - _header?: string | null; - _implicitHeader(): void; -} -/** - * The `HttpProxyAgent` implements an HTTP Agent subclass that connects - * to the specified "HTTP proxy server" in order to proxy HTTP requests. - * - * @api public - */ -export default class HttpProxyAgent extends Agent { - private secureProxy; - private proxy; - constructor(_opts: string | HttpProxyAgentOptions); - /** - * Called when the node-core HTTP client library is creating a - * new HTTP request. - * - * @api protected - */ - callback(req: HttpProxyAgentClientRequest, opts: RequestOptions): Promise; -} -export {}; diff --git a/deps/npm/node_modules/http-proxy-agent/dist/agent.js.map b/deps/npm/node_modules/http-proxy-agent/dist/agent.js.map deleted file mode 100644 index bd3b56aa6dfdbc..00000000000000 --- a/deps/npm/node_modules/http-proxy-agent/dist/agent.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"agent.js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AI,GAAG,CAAC,UAAU,IAAI,GAAG,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE;oBACvD,aAAa;oBACb,KAAK,CACJ,+DAA+D,CAC/D,CAAC;oBACF,KAAK,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;oBAC/B,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;oBAC7C,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI;wBACrB,GAAG,CAAC,OAAO,GAAG,KAAK,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;oBAC7C,KAAK,CAAC,mBAAmB,EAAE,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;iBACnD;aACD;YAED,mEAAmE;YACnE,mEAAmE;YACnE,qEAAqE;YACrE,qDAAqD;YACrD,MAAM,IAAA,cAAI,EAAC,MAAM,EAAE,SAAS,CAAC,CAAC;YAE9B,OAAO,MAAM,CAAC;QACf,CAAC;KAAA;CACD;AA1ID,iCA0IC"} \ No newline at end of file diff --git a/deps/npm/node_modules/http-proxy-agent/dist/index.d.ts b/deps/npm/node_modules/http-proxy-agent/dist/index.d.ts deleted file mode 100644 index 24bdb52efcedcb..00000000000000 --- a/deps/npm/node_modules/http-proxy-agent/dist/index.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -/// -import net from 'net'; -import tls from 'tls'; -import { Url } from 'url'; -import { AgentOptions } from 'agent-base'; -import _HttpProxyAgent from './agent'; -declare function createHttpProxyAgent(opts: string | createHttpProxyAgent.HttpProxyAgentOptions): _HttpProxyAgent; -declare namespace createHttpProxyAgent { - interface BaseHttpProxyAgentOptions { - secureProxy?: boolean; - host?: string | null; - path?: string | null; - port?: string | number | null; - } - export interface HttpProxyAgentOptions extends AgentOptions, BaseHttpProxyAgentOptions, Partial> { - } - export type HttpProxyAgent = _HttpProxyAgent; - export const HttpProxyAgent: typeof _HttpProxyAgent; - export {}; -} -export = createHttpProxyAgent; diff --git a/deps/npm/node_modules/http-proxy-agent/dist/index.js.map b/deps/npm/node_modules/http-proxy-agent/dist/index.js.map deleted file mode 100644 index e07dae5b08455a..00000000000000 --- a/deps/npm/node_modules/http-proxy-agent/dist/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AAIA,oDAAsC;AAEtC,SAAS,oBAAoB,CAC5B,IAAyD;IAEzD,OAAO,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC;AAClC,CAAC;AAED,WAAU,oBAAoB;IAmBhB,mCAAc,GAAG,eAAe,CAAC;IAE9C,oBAAoB,CAAC,SAAS,GAAG,eAAe,CAAC,SAAS,CAAC;AAC5D,CAAC,EAtBS,oBAAoB,KAApB,oBAAoB,QAsB7B;AAED,iBAAS,oBAAoB,CAAC"} \ No newline at end of file diff --git a/deps/npm/node_modules/https-proxy-agent/dist/agent.d.ts b/deps/npm/node_modules/https-proxy-agent/dist/agent.d.ts deleted file mode 100644 index 4f1c63624117f0..00000000000000 --- a/deps/npm/node_modules/https-proxy-agent/dist/agent.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -/// -import net from 'net'; -import { Agent, ClientRequest, RequestOptions } from 'agent-base'; -import { HttpsProxyAgentOptions } from '.'; -/** - * The `HttpsProxyAgent` implements an HTTP Agent subclass that connects to - * the specified "HTTP(s) proxy server" in order to proxy HTTPS requests. - * - * Outgoing HTTP requests are first tunneled through the proxy server using the - * `CONNECT` HTTP request method to establish a connection to the proxy server, - * and then the proxy server connects to the destination target and issues the - * HTTP request from the proxy server. - * - * `https:` requests have their socket connection upgraded to TLS once - * the connection to the proxy server has been established. - * - * @api public - */ -export default class HttpsProxyAgent extends Agent { - private secureProxy; - private proxy; - constructor(_opts: string | HttpsProxyAgentOptions); - /** - * Called when the node-core HTTP client library is creating a - * new HTTP request. - * - * @api protected - */ - callback(req: ClientRequest, opts: RequestOptions): Promise; -} diff --git a/deps/npm/node_modules/https-proxy-agent/dist/agent.js.map b/deps/npm/node_modules/https-proxy-agent/dist/agent.js.map deleted file mode 100644 index 0af6c17a3e78a3..00000000000000 --- a/deps/npm/node_modules/https-proxy-agent/dist/agent.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"agent.js","sourceRoot":"","sources":["../src/agent.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,8CAAsB;AACtB,8CAAsB;AACtB,8CAAsB;AACtB,oDAA4B;AAC5B,kDAAgC;AAEhC,2CAAkE;AAElE,kFAAwD;AAExD,MAAM,KAAK,GAAG,eAAW,CAAC,yBAAyB,CAAC,CAAC;AAErD;;;;;;;;;;;;;GAaG;AACH,MAAqB,eAAgB,SAAQ,kBAAK;IAIjD,YAAY,KAAsC;QACjD,IAAI,IAA4B,CAAC;QACjC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;YAC9B,IAAI,GAAG,aAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;SACxB;aAAM;YACN,IAAI,GAAG,KAAK,CAAC;SACb;QACD,IAAI,CAAC,IAAI,EAAE;YACV,MAAM,IAAI,KAAK,CACd,8DAA8D,CAC9D,CAAC;SACF;QACD,KAAK,CAAC,2CAA2C,EAAE,IAAI,CAAC,CAAC;QACzD,KAAK,CAAC,IAAI,CAAC,CAAC;QAEZ,MAAM,KAAK,qBAAgC,IAAI,CAAE,CAAC;QAElD,wDAAwD;QACxD,uBAAuB;QACvB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,IAAI,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QAE/D,+DAA+D;QAC/D,KAAK,CAAC,IAAI,GAAG,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,IAAI,CAAC;QAC1C,IAAI,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ,EAAE;YACnC,KAAK,CAAC,IAAI,GAAG,QAAQ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AQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;AAC3E,CAAC;AAED,SAAS,IAAI,CACZ,GAAM,EACN,GAAG,IAAO;IAIV,MAAM,GAAG,GAAG,EAEX,CAAC;IACF,IAAI,GAAqB,CAAC;IAC1B,KAAK,GAAG,IAAI,GAAG,EAAE;QAChB,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;YACxB,GAAG,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;SACpB;KACD;IACD,OAAO,GAAG,CAAC;AACZ,CAAC"} \ No newline at end of file diff --git a/deps/npm/node_modules/https-proxy-agent/dist/index.d.ts b/deps/npm/node_modules/https-proxy-agent/dist/index.d.ts deleted file mode 100644 index 0d60062ee20794..00000000000000 --- a/deps/npm/node_modules/https-proxy-agent/dist/index.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -/// -import net from 'net'; -import tls from 'tls'; -import { Url } from 'url'; -import { AgentOptions } from 'agent-base'; -import { OutgoingHttpHeaders } from 'http'; -import _HttpsProxyAgent from './agent'; -declare function createHttpsProxyAgent(opts: string | createHttpsProxyAgent.HttpsProxyAgentOptions): _HttpsProxyAgent; -declare namespace createHttpsProxyAgent { - interface BaseHttpsProxyAgentOptions { - headers?: OutgoingHttpHeaders; - secureProxy?: boolean; - host?: string | null; - path?: string | null; - port?: string | number | null; - } - export interface HttpsProxyAgentOptions extends AgentOptions, BaseHttpsProxyAgentOptions, Partial> { - } - export type HttpsProxyAgent = _HttpsProxyAgent; - export const HttpsProxyAgent: typeof _HttpsProxyAgent; - export {}; -} -export = createHttpsProxyAgent; diff --git a/deps/npm/node_modules/https-proxy-agent/dist/index.js.map b/deps/npm/node_modules/https-proxy-agent/dist/index.js.map deleted file mode 100644 index f3ce559de0200d..00000000000000 --- a/deps/npm/node_modules/https-proxy-agent/dist/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AAKA,oDAAuC;AAEvC,SAAS,qBAAqB,CAC7B,IAA2D;IAE3D,OAAO,IAAI,eAAgB,CAAC,IAAI,CAAC,CAAC;AACnC,CAAC;AAED,WAAU,qBAAqB;IAoBjB,qCAAe,GAAG,eAAgB,CAAC;IAEhD,qBAAqB,CAAC,SAAS,GAAG,eAAgB,CAAC,SAAS,CAAC;AAC9D,CAAC,EAvBS,qBAAqB,KAArB,qBAAqB,QAuB9B;AAED,iBAAS,qBAAqB,CAAC"} \ No newline at end of file diff --git a/deps/npm/node_modules/https-proxy-agent/dist/parse-proxy-response.d.ts b/deps/npm/node_modules/https-proxy-agent/dist/parse-proxy-response.d.ts deleted file mode 100644 index 7565674a338cb1..00000000000000 --- a/deps/npm/node_modules/https-proxy-agent/dist/parse-proxy-response.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -/// -import { Readable } from 'stream'; -export interface ProxyResponse { - statusCode: number; - buffered: Buffer; -} -export default function parseProxyResponse(socket: Readable): Promise; diff --git a/deps/npm/node_modules/https-proxy-agent/dist/parse-proxy-response.js.map b/deps/npm/node_modules/https-proxy-agent/dist/parse-proxy-response.js.map deleted file mode 100644 index bacdb84b9ec2fd..00000000000000 --- a/deps/npm/node_modules/https-proxy-agent/dist/parse-proxy-response.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"parse-proxy-response.js","sourceRoot":"","sources":["../src/parse-proxy-response.ts"],"names":[],"mappings":";;;;;AAAA,kDAAgC;AAGhC,MAAM,KAAK,GAAG,eAAW,CAAC,wCAAwC,CAAC,CAAC;AAOpE,SAAwB,kBAAkB,CACzC,MAAgB;IAEhB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACtC,+EAA+E;QAC/E,gFAAgF;QAChF,8EAA8E;QAC9E,8BAA8B;QAC9B,IAAI,aAAa,GAAG,CAAC,CAAC;QACtB,MAAM,OAAO,GAAa,EAAE,CAAC;QAE7B,SA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,CAAC,EACD,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,CACxB,CAAC;YACF,MAAM,UAAU,GAAG,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;YAC5C,KAAK,CAAC,+BAA+B,EAAE,SAAS,CAAC,CAAC;YAClD,OAAO,CAAC;gBACP,UAAU;gBACV,QAAQ;aACR,CAAC,CAAC;QACJ,CAAC;QAED,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAC5B,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAC5B,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QAExB,IAAI,EAAE,CAAC;IACR,CAAC,CAAC,CAAC;AACJ,CAAC;AAvED,qCAuEC"} \ No newline at end of file diff --git a/deps/npm/node_modules/iconv-lite/lib/index.d.ts b/deps/npm/node_modules/iconv-lite/lib/index.d.ts deleted file mode 100644 index 99f200f4ab04c3..00000000000000 --- a/deps/npm/node_modules/iconv-lite/lib/index.d.ts +++ /dev/null @@ -1,41 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. - * REQUIREMENT: This definition is dependent on the @types/node definition. - * Install with `npm install @types/node --save-dev` - *--------------------------------------------------------------------------------------------*/ - -declare module 'iconv-lite' { - // Basic API - export function decode(buffer: Buffer, encoding: string, options?: Options): string; - - export function encode(content: string, encoding: string, options?: Options): Buffer; - - export function encodingExists(encoding: string): boolean; - - // Stream API - export function decodeStream(encoding: string, options?: Options): NodeJS.ReadWriteStream; - - export function encodeStream(encoding: string, options?: Options): NodeJS.ReadWriteStream; - - // Low-level stream APIs - export function getEncoder(encoding: string, options?: Options): EncoderStream; - - export function getDecoder(encoding: string, options?: Options): DecoderStream; -} - -export interface Options { - stripBOM?: boolean; - addBOM?: boolean; - defaultEncoding?: string; -} - -export interface EncoderStream { - write(str: string): Buffer; - end(): Buffer | undefined; -} - -export interface DecoderStream { - write(buf: Buffer): string; - end(): string | undefined; -} diff --git a/deps/npm/node_modules/ieee754/index.d.ts b/deps/npm/node_modules/ieee754/index.d.ts deleted file mode 100644 index 8d4f440975987c..00000000000000 --- a/deps/npm/node_modules/ieee754/index.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -declare namespace ieee754 { - export function read( - buffer: Uint8Array, offset: number, isLE: boolean, mLen: number, - nBytes: number): number; - export function write( - buffer: Uint8Array, value: number, offset: number, isLE: boolean, - mLen: number, nBytes: number): void; - } - - export = ieee754; \ No newline at end of file diff --git a/deps/npm/node_modules/ignore-walk/package.json b/deps/npm/node_modules/ignore-walk/package.json index 97a2854857939b..ae68746218cd8d 100644 --- a/deps/npm/node_modules/ignore-walk/package.json +++ b/deps/npm/node_modules/ignore-walk/package.json @@ -1,24 +1,19 @@ { "name": "ignore-walk", - "version": "6.0.1", + "version": "6.0.2", "description": "Nested/recursive `.gitignore`/`.npmignore` parsing and filtering.", "main": "lib/index.js", "devDependencies": { "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.11.3", - "mkdirp": "^1.0.4", + "@npmcli/template-oss": "4.12.0", "mutate-fs": "^2.1.1", - "rimraf": "^3.0.2", "tap": "^16.0.1" }, "scripts": { "test": "tap", "posttest": "npm run lint", "lint": "eslint \"**/*.js\"", - "eslint": "eslint", "lintfix": "npm run lint -- --fix", - "npmclilint": "npmcli-lint", - "postsnap": "npm run lintfix --", "postlint": "template-oss-check", "template-oss-apply": "template-oss-apply --force", "test:windows-coverage": "npm pkg set tap.statements=99 --json && npm pkg set tap.branches=98 --json && npm pkg set tap.lines=99 --json", @@ -43,7 +38,7 @@ "lib/" ], "dependencies": { - "minimatch": "^6.1.6" + "minimatch": "^7.4.2" }, "tap": { "test-env": "LC_ALL=sk", @@ -61,7 +56,7 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.11.3", + "version": "4.12.0", "content": "scripts/template-oss" } } diff --git a/deps/npm/node_modules/indent-string/index.d.ts b/deps/npm/node_modules/indent-string/index.d.ts deleted file mode 100644 index 118523115645a0..00000000000000 --- a/deps/npm/node_modules/indent-string/index.d.ts +++ /dev/null @@ -1,42 +0,0 @@ -declare namespace indentString { - interface Options { - /** - The string to use for the indent. - - @default ' ' - */ - readonly indent?: string; - - /** - Also indent empty lines. - - @default false - */ - readonly includeEmptyLines?: boolean; - } -} - -/** -Indent each line in a string. - -@param string - The string to indent. -@param count - How many times you want `options.indent` repeated. Default: `1`. - -@example -``` -import indentString = require('indent-string'); - -indentString('Unicorns\nRainbows', 4); -//=> ' Unicorns\n Rainbows' - -indentString('Unicorns\nRainbows', 4, {indent: '♥'}); -//=> '♥♥♥♥Unicorns\n♥♥♥♥Rainbows' -``` -*/ -declare function indentString( - string: string, - count?: number, - options?: indentString.Options -): string; - -export = indentString; diff --git a/deps/npm/node_modules/ip-regex/index.d.ts b/deps/npm/node_modules/ip-regex/index.d.ts deleted file mode 100644 index 0999ed287f790f..00000000000000 --- a/deps/npm/node_modules/ip-regex/index.d.ts +++ /dev/null @@ -1,70 +0,0 @@ -declare namespace ip { - interface Options { - /** - Only match an exact string. Useful with `RegExp#test()` to check if a string is an IP address. *(`false` matches any IP address in a string)* - - @default false - */ - readonly exact?: boolean; - - /** - Include boundaries in the regex. When `true`, `192.168.0.2000000000` will report as an invalid IPv4 address. If this option is not set, the mentioned IPv4 address would report as valid (ignoring the trailing zeros). - - @default false - */ - readonly includeBoundaries?: boolean; - } -} - -declare const ip: { - /** - Regular expression for matching IP addresses. - - @returns A regex for matching both IPv4 and IPv6. - - @example - ``` - import ipRegex = require('ip-regex'); - - // Contains an IP address? - ipRegex().test('unicorn 192.168.0.1'); - //=> true - - // Is an IP address? - ipRegex({exact: true}).test('unicorn 192.168.0.1'); - //=> false - - 'unicorn 192.168.0.1 cake 1:2:3:4:5:6:7:8 rainbow'.match(ipRegex()); - //=> ['192.168.0.1', '1:2:3:4:5:6:7:8'] - - // Contains an IP address? - ipRegex({includeBoundaries: true}).test('192.168.0.2000000000'); - //=> false - - // Matches an IP address? - '192.168.0.2000000000'.match(ipRegex({includeBoundaries: true})); - //=> null - ``` - */ - (options?: ip.Options): RegExp; - - /** - @returns A regex for matching IPv4. - */ - v4(options?: ip.Options): RegExp; - - /** - @returns A regex for matching IPv6. - - @example - ``` - import ipRegex = require('ip-regex'); - - ipRegex.v6({exact: true}).test('1:2:3:4:5:6:7:8'); - //=> true - ``` - */ - v6(options?: ip.Options): RegExp; -}; - -export = ip; diff --git a/deps/npm/node_modules/is-cidr/index.d.ts b/deps/npm/node_modules/is-cidr/index.d.ts deleted file mode 100644 index c4ba96a1fe82bc..00000000000000 --- a/deps/npm/node_modules/is-cidr/index.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -declare const isCidr: { - /** - Check if `string` is a IPv4 or IPv6 CIDR address. - @returns Either `4`, `6` (indicating the IP version) or `0` if the string is not a CIDR. - @example - ``` - import isCidr = require('is-cidr'); - isCidr('192.168.0.1/24'); //=> 4 - isCidr('1:2:3:4:5:6:7:8/64'); //=> 6 - isCidr('10.0.0.0'); //=> 0 - ``` - */ - (string: string): 6 | 4 | 0; - - /** - Check if `string` is a IPv4 CIDR address. - */ - v4(string: string): boolean; - - /** - Check if `string` is a IPv6 CIDR address. - @example - ``` - import isCidr = require('is-cidr'); - isCidr.v6('10.0.0.0/24'); //=> false - ``` - */ - v6(string: string): boolean; -}; - -export = isCidr; diff --git a/deps/npm/node_modules/is-fullwidth-code-point/index.d.ts b/deps/npm/node_modules/is-fullwidth-code-point/index.d.ts deleted file mode 100644 index 729d2020516f0b..00000000000000 --- a/deps/npm/node_modules/is-fullwidth-code-point/index.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** -Check if the character represented by a given [Unicode code point](https://en.wikipedia.org/wiki/Code_point) is [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms). - -@param codePoint - The [code point](https://en.wikipedia.org/wiki/Code_point) of a character. - -@example -``` -import isFullwidthCodePoint from 'is-fullwidth-code-point'; - -isFullwidthCodePoint('谢'.codePointAt(0)); -//=> true - -isFullwidthCodePoint('a'.codePointAt(0)); -//=> false -``` -*/ -export default function isFullwidthCodePoint(codePoint: number): boolean; diff --git a/deps/npm/node_modules/just-diff-apply/index.d.ts b/deps/npm/node_modules/just-diff-apply/index.d.ts deleted file mode 100644 index 7547b722f484fb..00000000000000 --- a/deps/npm/node_modules/just-diff-apply/index.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -// Definitions by: Eddie Atkinson - -type Operation = "add" | "replace" | "remove" | "move"; - -type DiffOps = Array<{ - op: Operation; - path: Array; - value?: any; -}>; -type PathConverter = (path: string) => string[]; - -export function diffApply( - obj: T, - diff: DiffOps, - pathConverter?: PathConverter -): T; -export const jsonPatchPathConverter: PathConverter; diff --git a/deps/npm/node_modules/just-diff-apply/index.tests.ts b/deps/npm/node_modules/just-diff-apply/index.tests.ts deleted file mode 100644 index d02ba89b838cdd..00000000000000 --- a/deps/npm/node_modules/just-diff-apply/index.tests.ts +++ /dev/null @@ -1,108 +0,0 @@ -import * as diffObj from "./index"; - -const { diffApply, jsonPatchPathConverter } = diffObj; -const obj1 = { - a: 2, - b: 3, - c: { - d: 5 - } -}; -const arr1 = [1, "bee"]; - -const objOps: diffObj.DiffOps = [ - { - op: "replace", - path: ["a"], - value: 10 - }, - { - op: "remove", - path: ["b"] - }, - { - op: "add", - path: ["e"], - value: 15 - }, - { - op: "remove", - path: ["c", "d"] - } -]; - -const arrOps: diffObj.DiffOps = [ - { - op: "replace", - path: [1], - value: 10 - }, - { - op: "remove", - path: [2] - }, - { - op: "add", - path: [7], - value: 15 - } -]; - -//OK -diffApply(obj1, objOps); -diffApply(obj1, []); -diffApply(arr1, arrOps); -diffApply(arr1, []); -diffApply(obj1, objOps, jsonPatchPathConverter); -diffApply(arr1, arrOps, jsonPatchPathConverter); - -// not OK -// @ts-expect-error -diffApply(obj1); -// @ts-expect-error -diffApply(arr2); -// @ts-expect-error -diffApply("a"); -// @ts-expect-error -diffApply(true); - -// @ts-expect-error -diffApply(obj1, 1); -// @ts-expect-error -diffApply(3, arr2); -// @ts-expect-error -diffApply(obj1, "a"); -// @ts-expect-error -diffApply("b", arr2); - -// @ts-expect-error -diffApply(obj1, [{ op: "delete", path: ["a"] }]); -// @ts-expect-error -diffApply(obj1, [{ op: "delete", path: ["a"] }], jsonPatchPathConverter); -// @ts-expect-error -diffApply(obj1, "a", jsonPatchPathConverter); -// @ts-expect-error -diffApply(obj1, ["a", "b", "c"], jsonPatchPathConverter); - -// @ts-expect-error -diff("a", jsonPatchPathConverter); -// @ts-expect-error -diff(true, jsonPatchPathConverter); - -// @ts-expect-error -diff(obj1, 1, jsonPatchPathConverter); -// @ts-expect-error -diff(3, arr2, jsonPatchPathConverter); -// @ts-expect-error -diff(obj1, "a", jsonPatchPathConverter); -// @ts-expect-error -diff("b", arr2, jsonPatchPathConverter); - -// @ts-expect-error -diff(obj1, obj2, "a"); -// @ts-expect-error -diff(arr1, arr2, 1); -// @ts-expect-error -diff(obj1, arr1, "bee"); -// @ts-expect-error -diff(obj2, arr2, "nope"); diff --git a/deps/npm/node_modules/just-diff/index.cjs b/deps/npm/node_modules/just-diff/index.cjs index 11ad3710b98f4a..b74099de2b2afa 100644 --- a/deps/npm/node_modules/just-diff/index.cjs +++ b/deps/npm/node_modules/just-diff/index.cjs @@ -79,75 +79,152 @@ function diff(obj1, obj2, pathConverter) { return arr; }); - function getDiff(obj1, obj2, basePath, diffs) { + function getDiff({obj1, obj2, basePath, basePathForRemoves, diffs}) { var obj1Keys = Object.keys(obj1); var obj1KeysLength = obj1Keys.length; var obj2Keys = Object.keys(obj2); var obj2KeysLength = obj2Keys.length; var path; - for (var i = 0; i < obj1KeysLength; i++) { - var key = Array.isArray(obj1) ? Number(obj1Keys[i]) : obj1Keys[i]; - if (!(key in obj2)) { - path = basePath.concat(key); + var lengthDelta = obj1.length - obj2.length; + + if (trimFromRight(obj1, obj2)) { + for (var i = 0; i < obj1KeysLength; i++) { + var key = Array.isArray(obj1) ? Number(obj1Keys[i]) : obj1Keys[i]; + if (!(key in obj2)) { + path = basePathForRemoves.concat(key); + diffs.remove.push({ + op: 'remove', + path: pathConverter(path), + }); + } + } + + for (var i = 0; i < obj2KeysLength; i++) { + var key = Array.isArray(obj2) ? Number(obj2Keys[i]) : obj2Keys[i]; + pushReplaces({ + key, + obj1, + obj2, + path: basePath.concat(key), + pathForRemoves: basePath.concat(key), + diffs, + }); + } + } else { + // trim from left, objects are both arrays + for (var i = 0; i < lengthDelta; i++) { + path = basePathForRemoves.concat(i); diffs.remove.push({ op: 'remove', path: pathConverter(path), }); } - } - for (var i = 0; i < obj2KeysLength; i++) { - var key = Array.isArray(obj2) ? Number(obj2Keys[i]) : obj2Keys[i]; - var obj1AtKey = obj1[key]; - var obj2AtKey = obj2[key]; - if (!(key in obj1)) { - path = basePath.concat(key); - var obj2Value = obj2[key]; - diffs.add.push({ - op: 'add', - path: pathConverter(path), - value: obj2Value, + // now make a copy of obj1 with excess elements left trimmed and see if there any replaces + var obj1Trimmed = obj1.slice(lengthDelta);; + for (var i = 0; i < obj2KeysLength; i++) { + pushReplaces({ + key: i, + obj1: obj1Trimmed, + obj2, + path: basePath.concat(i), + // since list of removes are reversed before presenting result, + // we need to ignore existing parent removes when doing nested removes + pathForRemoves: basePath.concat(i + lengthDelta), + diffs, }); - } else if (obj1AtKey !== obj2AtKey) { - if ( - Object(obj1AtKey) !== obj1AtKey || - Object(obj2AtKey) !== obj2AtKey - ) { - path = pushReplace(path, basePath, key, diffs, pathConverter, obj2); + } + } + } + + var diffs = {remove: [], replace: [], add: []}; + getDiff({ + obj1, + obj2, + basePath: [], + basePathForRemoves: [], + diffs, + }); + + // reverse removes since we want to maintain indexes + return diffs.remove + .reverse() + .concat(diffs.replace) + .concat(diffs.add); + + function pushReplaces({key, obj1, obj2, path, pathForRemoves, diffs}) { + var obj1AtKey = obj1[key]; + var obj2AtKey = obj2[key]; + + if(!(key in obj1) && (key in obj2)) { + var obj2Value = obj2AtKey; + diffs.add.push({ + op: 'add', + path: pathConverter(path), + value: obj2Value, + }); + } else if(obj1AtKey !== obj2AtKey) { + if(Object(obj1AtKey) !== obj1AtKey || + Object(obj2AtKey) !== obj2AtKey || differentTypes(obj1AtKey, obj2AtKey) + ) { + pushReplace(path, diffs, obj2AtKey); + } else { + if(!Object.keys(obj1AtKey).length && + !Object.keys(obj2AtKey).length && + String(obj1AtKey) != String(obj2AtKey)) { + pushReplace(path, diffs, obj2AtKey); } else { - if ( - !Object.keys(obj1AtKey).length && - !Object.keys(obj2AtKey).length && - String(obj1AtKey) != String(obj2AtKey) - ) { - path = pushReplace(path, basePath, key, diffs, pathConverter, obj2); - } else { - getDiff(obj1[key], obj2[key], basePath.concat(key), diffs); - } + getDiff({ + obj1: obj1[key], + obj2: obj2[key], + basePath: path, + basePathForRemoves: pathForRemoves, + diffs}); } } } - - return diffs; } - const finalDiffs = getDiff(obj1, obj2, [], {remove: [], replace: [], add: []}); - return finalDiffs.remove - .reverse() - .concat(finalDiffs.replace) - .concat(finalDiffs.add); -} -function pushReplace(path, basePath, key, diffs, pathConverter, obj2) { - path = basePath.concat(key); - diffs.replace.push({ - op: 'replace', - path: pathConverter(path), - value: obj2[key], - }); - return path; + function pushReplace(path, diffs, newValue) { + diffs.replace.push({ + op: 'replace', + path: pathConverter(path), + value: newValue, + }); + } } function jsonPatchPathConverter(arrayPath) { return [''].concat(arrayPath).join('/'); } + +function differentTypes(a, b) { + return Object.prototype.toString.call(a) != Object.prototype.toString.call(b); +} + +function trimFromRight(obj1, obj2) { + var lengthDelta = obj1.length - obj2.length; + if (Array.isArray(obj1) && Array.isArray(obj2) && lengthDelta > 0) { + var leftMatches = 0; + var rightMatches = 0; + for (var i = 0; i < obj2.length; i++) { + if (String(obj1[i]) === String(obj2[i])) { + leftMatches++; + } else { + break; + } + } + for (var j = obj2.length; j > 0; j--) { + if (String(obj1[j + lengthDelta]) === String(obj2[j])) { + rightMatches++; + } else { + break; + } + } + + // bias to trim right becase it requires less index shifting + return leftMatches >= rightMatches; + } + return true; +} diff --git a/deps/npm/node_modules/just-diff/index.d.ts b/deps/npm/node_modules/just-diff/index.d.ts deleted file mode 100644 index 576ddc54957fcc..00000000000000 --- a/deps/npm/node_modules/just-diff/index.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -// Definitions by: Cameron Hunter -// Modified by: Angus Croll -type Operation = "add" | "replace" | "remove"; - -type JSONPatchPathConverter = ( - arrayPath: Array -) => OUTPUT; - -export function diff( - a: object | Array, - b: object | Array, -): Array<{ op: Operation; path: Array; value: any }>; - -export function diff( - a: object | Array, - b: object | Array, - jsonPatchPathConverter: JSONPatchPathConverter -): Array<{ op: Operation; path: PATH; value: any }>; - -export const jsonPatchPathConverter: JSONPatchPathConverter; \ No newline at end of file diff --git a/deps/npm/node_modules/just-diff/index.mjs b/deps/npm/node_modules/just-diff/index.mjs index a0c5834475fea6..4a847874c3504f 100644 --- a/deps/npm/node_modules/just-diff/index.mjs +++ b/deps/npm/node_modules/just-diff/index.mjs @@ -74,77 +74,154 @@ function diff(obj1, obj2, pathConverter) { return arr; }); - function getDiff(obj1, obj2, basePath, diffs) { + function getDiff({obj1, obj2, basePath, basePathForRemoves, diffs}) { var obj1Keys = Object.keys(obj1); var obj1KeysLength = obj1Keys.length; var obj2Keys = Object.keys(obj2); var obj2KeysLength = obj2Keys.length; var path; - for (var i = 0; i < obj1KeysLength; i++) { - var key = Array.isArray(obj1) ? Number(obj1Keys[i]) : obj1Keys[i]; - if (!(key in obj2)) { - path = basePath.concat(key); + var lengthDelta = obj1.length - obj2.length; + + if (trimFromRight(obj1, obj2)) { + for (var i = 0; i < obj1KeysLength; i++) { + var key = Array.isArray(obj1) ? Number(obj1Keys[i]) : obj1Keys[i]; + if (!(key in obj2)) { + path = basePathForRemoves.concat(key); + diffs.remove.push({ + op: 'remove', + path: pathConverter(path), + }); + } + } + + for (var i = 0; i < obj2KeysLength; i++) { + var key = Array.isArray(obj2) ? Number(obj2Keys[i]) : obj2Keys[i]; + pushReplaces({ + key, + obj1, + obj2, + path: basePath.concat(key), + pathForRemoves: basePath.concat(key), + diffs, + }); + } + } else { + // trim from left, objects are both arrays + for (var i = 0; i < lengthDelta; i++) { + path = basePathForRemoves.concat(i); diffs.remove.push({ op: 'remove', path: pathConverter(path), }); } - } - for (var i = 0; i < obj2KeysLength; i++) { - var key = Array.isArray(obj2) ? Number(obj2Keys[i]) : obj2Keys[i]; - var obj1AtKey = obj1[key]; - var obj2AtKey = obj2[key]; - if (!(key in obj1)) { - path = basePath.concat(key); - var obj2Value = obj2[key]; - diffs.add.push({ - op: 'add', - path: pathConverter(path), - value: obj2Value, + // now make a copy of obj1 with excess elements left trimmed and see if there any replaces + var obj1Trimmed = obj1.slice(lengthDelta);; + for (var i = 0; i < obj2KeysLength; i++) { + pushReplaces({ + key: i, + obj1: obj1Trimmed, + obj2, + path: basePath.concat(i), + // since list of removes are reversed before presenting result, + // we need to ignore existing parent removes when doing nested removes + pathForRemoves: basePath.concat(i + lengthDelta), + diffs, }); - } else if (obj1AtKey !== obj2AtKey) { - if ( - Object(obj1AtKey) !== obj1AtKey || - Object(obj2AtKey) !== obj2AtKey - ) { - path = pushReplace(path, basePath, key, diffs, pathConverter, obj2); + } + } + } + + var diffs = {remove: [], replace: [], add: []}; + getDiff({ + obj1, + obj2, + basePath: [], + basePathForRemoves: [], + diffs, + }); + + // reverse removes since we want to maintain indexes + return diffs.remove + .reverse() + .concat(diffs.replace) + .concat(diffs.add); + + function pushReplaces({key, obj1, obj2, path, pathForRemoves, diffs}) { + var obj1AtKey = obj1[key]; + var obj2AtKey = obj2[key]; + + if(!(key in obj1) && (key in obj2)) { + var obj2Value = obj2AtKey; + diffs.add.push({ + op: 'add', + path: pathConverter(path), + value: obj2Value, + }); + } else if(obj1AtKey !== obj2AtKey) { + if(Object(obj1AtKey) !== obj1AtKey || + Object(obj2AtKey) !== obj2AtKey || differentTypes(obj1AtKey, obj2AtKey) + ) { + pushReplace(path, diffs, obj2AtKey); + } else { + if(!Object.keys(obj1AtKey).length && + !Object.keys(obj2AtKey).length && + String(obj1AtKey) != String(obj2AtKey)) { + pushReplace(path, diffs, obj2AtKey); } else { - if ( - !Object.keys(obj1AtKey).length && - !Object.keys(obj2AtKey).length && - String(obj1AtKey) != String(obj2AtKey) - ) { - path = pushReplace(path, basePath, key, diffs, pathConverter, obj2); - } else { - getDiff(obj1[key], obj2[key], basePath.concat(key), diffs); - } + getDiff({ + obj1: obj1[key], + obj2: obj2[key], + basePath: path, + basePathForRemoves: pathForRemoves, + diffs}); } } } - - return diffs; } - const finalDiffs = getDiff(obj1, obj2, [], {remove: [], replace: [], add: []}); - return finalDiffs.remove - .reverse() - .concat(finalDiffs.replace) - .concat(finalDiffs.add); -} -function pushReplace(path, basePath, key, diffs, pathConverter, obj2) { - path = basePath.concat(key); - diffs.replace.push({ - op: 'replace', - path: pathConverter(path), - value: obj2[key], - }); - return path; + function pushReplace(path, diffs, newValue) { + diffs.replace.push({ + op: 'replace', + path: pathConverter(path), + value: newValue, + }); + } } function jsonPatchPathConverter(arrayPath) { return [''].concat(arrayPath).join('/'); } +function differentTypes(a, b) { + return Object.prototype.toString.call(a) != Object.prototype.toString.call(b); +} + +function trimFromRight(obj1, obj2) { + var lengthDelta = obj1.length - obj2.length; + if (Array.isArray(obj1) && Array.isArray(obj2) && lengthDelta > 0) { + var leftMatches = 0; + var rightMatches = 0; + for (var i = 0; i < obj2.length; i++) { + if (String(obj1[i]) === String(obj2[i])) { + leftMatches++; + } else { + break; + } + } + for (var j = obj2.length; j > 0; j--) { + if (String(obj1[j + lengthDelta]) === String(obj2[j])) { + rightMatches++; + } else { + break; + } + } + + // bias to trim right becase it requires less index shifting + return leftMatches >= rightMatches; + } + return true; +} + export {diff, jsonPatchPathConverter}; diff --git a/deps/npm/node_modules/just-diff/index.tests.ts b/deps/npm/node_modules/just-diff/index.tests.ts deleted file mode 100644 index 91eaecd8d49e8b..00000000000000 --- a/deps/npm/node_modules/just-diff/index.tests.ts +++ /dev/null @@ -1,65 +0,0 @@ -import * as diffObj from './index' - -const {diff, jsonPatchPathConverter} = diffObj; -const obj1 = {a: 2, b: 3}; -const obj2 = {a: 2, c: 1}; -const arr1 = [1, 'bee']; -const arr2 = [2, 'bee']; - - -//OK -diff(obj1, obj2); -diff(arr1, arr2); -diff(obj1, arr1); -diff(obj2, arr2); -diff(/yes/, arr1); -diff(new Date(), arr2); - - -diff(obj1, obj2, jsonPatchPathConverter); -diff(arr1, arr2, jsonPatchPathConverter); -diff(obj1, arr1, jsonPatchPathConverter); -diff(obj2, arr2, jsonPatchPathConverter); - -// not OK -// @ts-expect-error -diff(obj1); -// @ts-expect-error -diff(arr2); -// @ts-expect-error -diff('a'); -// @ts-expect-error -diff(true); - -// @ts-expect-error -diff(obj1, 1); -// @ts-expect-error -diff(3, arr2); -// @ts-expect-error -diff(obj1, 'a'); -// @ts-expect-error -diff('b', arr2); - -// @ts-expect-error -diff('a', jsonPatchPathConverter); -// @ts-expect-error -diff(true, jsonPatchPathConverter); - -// @ts-expect-error -diff(obj1, 1, jsonPatchPathConverter); -// @ts-expect-error -diff(3, arr2, jsonPatchPathConverter); -// @ts-expect-error -diff(obj1, 'a', jsonPatchPathConverter); -// @ts-expect-error -diff('b', arr2, jsonPatchPathConverter); - -// @ts-expect-error -diff(obj1, obj2, 'a'); -// @ts-expect-error -diff(arr1, arr2, 1); -// @ts-expect-error -diff(obj1, arr1, 'bee'); -// @ts-expect-error -diff(obj2, arr2, 'nope'); - diff --git a/deps/npm/node_modules/just-diff/package.json b/deps/npm/node_modules/just-diff/package.json index 4456df5db5215a..0403b04cfeeb9e 100644 --- a/deps/npm/node_modules/just-diff/package.json +++ b/deps/npm/node_modules/just-diff/package.json @@ -1,6 +1,6 @@ { "name": "just-diff", - "version": "5.2.0", + "version": "6.0.2", "description": "Return an object representing the diffs between two objects. Supports jsonPatch protocol", "type": "module", "exports": { diff --git a/deps/npm/node_modules/libnpmaccess/package.json b/deps/npm/node_modules/libnpmaccess/package.json index ae4cb8b21eb4bb..15581fe03ae4d0 100644 --- a/deps/npm/node_modules/libnpmaccess/package.json +++ b/deps/npm/node_modules/libnpmaccess/package.json @@ -17,7 +17,7 @@ "devDependencies": { "@npmcli/eslint-config": "^4.0.0", "@npmcli/mock-registry": "^1.0.0", - "@npmcli/template-oss": "4.11.4", + "@npmcli/template-oss": "4.12.1", "nock": "^13.3.0", "tap": "^16.3.4" }, @@ -41,7 +41,7 @@ ], "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.11.4", + "version": "4.12.1", "content": "../../scripts/template-oss/index.js" }, "tap": { diff --git a/deps/npm/node_modules/libnpmdiff/package.json b/deps/npm/node_modules/libnpmdiff/package.json index cdd01c25c3ae54..8fc6d7a0b50464 100644 --- a/deps/npm/node_modules/libnpmdiff/package.json +++ b/deps/npm/node_modules/libnpmdiff/package.json @@ -1,6 +1,6 @@ { "name": "libnpmdiff", - "version": "5.0.11", + "version": "5.0.15", "description": "The registry diff", "repository": { "type": "git", @@ -42,23 +42,23 @@ }, "devDependencies": { "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.11.4", + "@npmcli/template-oss": "4.12.1", "tap": "^16.3.4" }, "dependencies": { - "@npmcli/arborist": "^6.2.3", + "@npmcli/arborist": "^6.2.7", "@npmcli/disparity-colors": "^3.0.0", - "@npmcli/installed-package-contents": "^2.0.0", + "@npmcli/installed-package-contents": "^2.0.2", "binary-extensions": "^2.2.0", "diff": "^5.1.0", - "minimatch": "^6.1.6", + "minimatch": "^7.4.2", "npm-package-arg": "^10.1.0", "pacote": "^15.0.8", "tar": "^6.1.13" }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.11.4", + "version": "4.12.1", "content": "../../scripts/template-oss/index.js" }, "tap": { diff --git a/deps/npm/node_modules/libnpmexec/package.json b/deps/npm/node_modules/libnpmexec/package.json index f13b16ed17e529..2582a253f906ca 100644 --- a/deps/npm/node_modules/libnpmexec/package.json +++ b/deps/npm/node_modules/libnpmexec/package.json @@ -1,6 +1,6 @@ { "name": "libnpmexec", - "version": "5.0.11", + "version": "5.0.15", "files": [ "bin/", "lib/" @@ -52,7 +52,7 @@ "devDependencies": { "@npmcli/eslint-config": "^4.0.0", "@npmcli/mock-registry": "^1.0.0", - "@npmcli/template-oss": "4.11.4", + "@npmcli/template-oss": "4.12.1", "bin-links": "^4.0.1", "just-extend": "^6.2.0", "just-safe-set": "^4.2.1", @@ -60,7 +60,7 @@ "tap": "^16.3.4" }, "dependencies": { - "@npmcli/arborist": "^6.2.3", + "@npmcli/arborist": "^6.2.7", "@npmcli/run-script": "^6.0.0", "chalk": "^4.1.0", "ci-info": "^3.7.1", @@ -75,7 +75,7 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.11.4", + "version": "4.12.1", "content": "../../scripts/template-oss/index.js" } } diff --git a/deps/npm/node_modules/libnpmfund/package.json b/deps/npm/node_modules/libnpmfund/package.json index 36ec66de751031..60fc641d2778ac 100644 --- a/deps/npm/node_modules/libnpmfund/package.json +++ b/deps/npm/node_modules/libnpmfund/package.json @@ -1,6 +1,6 @@ { "name": "libnpmfund", - "version": "4.0.11", + "version": "4.0.15", "main": "lib/index.js", "files": [ "bin/", @@ -41,18 +41,18 @@ }, "devDependencies": { "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.11.4", + "@npmcli/template-oss": "4.12.1", "tap": "^16.3.4" }, "dependencies": { - "@npmcli/arborist": "^6.2.3" + "@npmcli/arborist": "^6.2.7" }, "engines": { "node": "^14.17.0 || ^16.13.0 || >=18.0.0" }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.11.4", + "version": "4.12.1", "content": "../../scripts/template-oss/index.js" }, "tap": { diff --git a/deps/npm/node_modules/libnpmhook/package.json b/deps/npm/node_modules/libnpmhook/package.json index 493b64359cc220..24f2d309ffd982 100644 --- a/deps/npm/node_modules/libnpmhook/package.json +++ b/deps/npm/node_modules/libnpmhook/package.json @@ -35,7 +35,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.11.4", + "@npmcli/template-oss": "4.12.1", "nock": "^13.3.0", "tap": "^16.3.4" }, @@ -44,7 +44,7 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.11.4", + "version": "4.12.1", "content": "../../scripts/template-oss/index.js" }, "tap": { diff --git a/deps/npm/node_modules/libnpmorg/package.json b/deps/npm/node_modules/libnpmorg/package.json index 97d957492eae91..00d3f9f72e80c4 100644 --- a/deps/npm/node_modules/libnpmorg/package.json +++ b/deps/npm/node_modules/libnpmorg/package.json @@ -28,7 +28,7 @@ ], "devDependencies": { "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.11.4", + "@npmcli/template-oss": "4.12.1", "minipass": "^4.0.2", "nock": "^13.3.0", "tap": "^16.3.4" @@ -49,7 +49,7 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.11.4", + "version": "4.12.1", "content": "../../scripts/template-oss/index.js" }, "tap": { diff --git a/deps/npm/node_modules/libnpmpack/package.json b/deps/npm/node_modules/libnpmpack/package.json index ef256ad38df7af..9c2e909aac4f10 100644 --- a/deps/npm/node_modules/libnpmpack/package.json +++ b/deps/npm/node_modules/libnpmpack/package.json @@ -1,6 +1,6 @@ { "name": "libnpmpack", - "version": "5.0.11", + "version": "5.0.15", "description": "Programmatic API for the bits behind npm pack", "author": "GitHub Inc.", "main": "lib/index.js", @@ -23,7 +23,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.11.4", + "@npmcli/template-oss": "4.12.1", "nock": "^13.3.0", "spawk": "^1.7.1", "tap": "^16.3.4" @@ -36,7 +36,7 @@ "bugs": "https://github.com/npm/libnpmpack/issues", "homepage": "https://npmjs.com/package/libnpmpack", "dependencies": { - "@npmcli/arborist": "^6.2.3", + "@npmcli/arborist": "^6.2.7", "@npmcli/run-script": "^6.0.0", "npm-package-arg": "^10.1.0", "pacote": "^15.0.8" @@ -46,7 +46,7 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.11.4", + "version": "4.12.1", "content": "../../scripts/template-oss/index.js" }, "tap": { diff --git a/deps/npm/node_modules/libnpmpublish/lib/provenance.js b/deps/npm/node_modules/libnpmpublish/lib/provenance.js index d11d210478b651..1eb870da5f24f7 100644 --- a/deps/npm/node_modules/libnpmpublish/lib/provenance.js +++ b/deps/npm/node_modules/libnpmpublish/lib/provenance.js @@ -4,39 +4,40 @@ const INTOTO_PAYLOAD_TYPE = 'application/vnd.in-toto+json' const INTOTO_STATEMENT_TYPE = 'https://in-toto.io/Statement/v0.1' const SLSA_PREDICATE_TYPE = 'https://slsa.dev/provenance/v0.2' -const BUILDER_ID_PREFIX = 'https://github.com/npm/cli' +const BUILDER_ID = 'https://github.com/actions/runner' const BUILD_TYPE_PREFIX = 'https://github.com/npm/cli/gha' -const BUILD_TYPE_VERSION = 'v1' +const BUILD_TYPE_VERSION = 'v2' const generateProvenance = async (subject, opts) => { const { env } = process + /* istanbul ignore next - not covering missing env var case */ + const [workflowPath] = (env.GITHUB_WORKFLOW_REF || '') + .replace(env.GITHUB_REPOSITORY + '/', '') + .split('@') const payload = { _type: INTOTO_STATEMENT_TYPE, subject, predicateType: SLSA_PREDICATE_TYPE, predicate: { - buildType: `${BUILD_TYPE_PREFIX}@${BUILD_TYPE_VERSION}`, - builder: { id: `${BUILDER_ID_PREFIX}@${opts.npmVersion}` }, + buildType: `${BUILD_TYPE_PREFIX}/${BUILD_TYPE_VERSION}`, + builder: { id: BUILDER_ID }, invocation: { configSource: { uri: `git+${env.GITHUB_SERVER_URL}/${env.GITHUB_REPOSITORY}@${env.GITHUB_REF}`, digest: { sha1: env.GITHUB_SHA, }, - entryPoint: env.GITHUB_WORKFLOW_REF, + entryPoint: workflowPath, }, parameters: {}, environment: { - GITHUB_ACTOR_ID: env.GITHUB_ACTOR_ID, GITHUB_EVENT_NAME: env.GITHUB_EVENT_NAME, GITHUB_REF: env.GITHUB_REF, - GITHUB_REF_TYPE: env.GITHUB_REF_TYPE, GITHUB_REPOSITORY: env.GITHUB_REPOSITORY, GITHUB_REPOSITORY_ID: env.GITHUB_REPOSITORY_ID, GITHUB_REPOSITORY_OWNER_ID: env.GITHUB_REPOSITORY_OWNER_ID, GITHUB_RUN_ATTEMPT: env.GITHUB_RUN_ATTEMPT, GITHUB_RUN_ID: env.GITHUB_RUN_ID, - GITHUB_RUN_NUMBER: env.GITHUB_RUN_NUMBER, GITHUB_SHA: env.GITHUB_SHA, GITHUB_WORKFLOW_REF: env.GITHUB_WORKFLOW_REF, GITHUB_WORKFLOW_SHA: env.GITHUB_WORKFLOW_SHA, @@ -53,7 +54,7 @@ const generateProvenance = async (subject, opts) => { }, materials: [ { - uri: `git+${env.GITHUB_SERVER_URL}/${env.GITHUB_REPOSITORY}`, + uri: `git+${env.GITHUB_SERVER_URL}/${env.GITHUB_REPOSITORY}@${env.GITHUB_REF}`, digest: { sha1: env.GITHUB_SHA, }, diff --git a/deps/npm/node_modules/libnpmpublish/lib/publish.js b/deps/npm/node_modules/libnpmpublish/lib/publish.js index 353688a10eac19..89ca01662cdb57 100644 --- a/deps/npm/node_modules/libnpmpublish/lib/publish.js +++ b/deps/npm/node_modules/libnpmpublish/lib/publish.js @@ -1,6 +1,7 @@ const { fixer } = require('normalize-package-data') const npmFetch = require('npm-registry-fetch') const npa = require('npm-package-arg') +const log = require('proc-log') const semver = require('semver') const { URL } = require('url') const ssri = require('ssri') @@ -8,6 +9,8 @@ const ciInfo = require('ci-info') const { generateProvenance } = require('./provenance') +const TLOG_BASE_URL = 'https://search.sigstore.dev/' + const publish = async (manifest, tarballData, opts) => { if (manifest.private) { throw Object.assign( @@ -141,15 +144,23 @@ const buildMetadata = async (registry, manifest, tarballData, spec, opts) => { digest: { sha512: integrity.sha512[0].hexDigest() }, } - // Ensure that we're running in GHA and an OIDC token is available, - // currently the only supported build environment - if (ciInfo.name !== 'GitHub Actions' || !process.env.ACTIONS_ID_TOKEN_REQUEST_URL) { + // Ensure that we're running in GHA, currently the only supported build environment + if (ciInfo.name !== 'GitHub Actions') { throw Object.assign( new Error('Automatic provenance generation not supported outside of GitHub Actions'), { code: 'EUSAGE' } ) } + // Ensure that the GHA OIDC token is available + if (!process.env.ACTIONS_ID_TOKEN_REQUEST_URL) { + throw Object.assign( + /* eslint-disable-next-line max-len */ + new Error('Provenance generation in GitHub Actions requires "write" access to the "id-token" permission'), + { code: 'EUSAGE' } + ) + } + const visibility = await npmFetch.json(`${registry}/-/package/${spec.escapedName}/visibility`, opts) if (!visibility.public && opts.provenance === true && opts.access !== 'public') { @@ -161,6 +172,16 @@ const buildMetadata = async (registry, manifest, tarballData, spec, opts) => { } const provenanceBundle = await generateProvenance([subject], opts) + /* eslint-disable-next-line max-len */ + log.notice('publish', 'Signed provenance statement with source and build information from GitHub Actions') + + const tlogEntry = provenanceBundle?.verificationMaterial?.tlogEntries[0] + /* istanbul ignore else */ + if (tlogEntry) { + const logUrl = `${TLOG_BASE_URL}?logIndex=${tlogEntry.logIndex}` + log.notice('publish', `Provenance statement published to transparency log: ${logUrl}`) + } + const serializedBundle = JSON.stringify(provenanceBundle) root._attachments[provenanceBundleName] = { content_type: provenanceBundle.mediaType, diff --git a/deps/npm/node_modules/libnpmpublish/package.json b/deps/npm/node_modules/libnpmpublish/package.json index 1b6a53eae61561..1557b8403d1043 100644 --- a/deps/npm/node_modules/libnpmpublish/package.json +++ b/deps/npm/node_modules/libnpmpublish/package.json @@ -1,6 +1,6 @@ { "name": "libnpmpublish", - "version": "7.1.0", + "version": "7.1.3", "description": "Programmatic API for the bits behind npm publish and unpublish", "author": "GitHub Inc.", "main": "lib/index.js", @@ -25,7 +25,7 @@ "devDependencies": { "@npmcli/eslint-config": "^4.0.0", "@npmcli/mock-registry": "^1.0.0", - "@npmcli/template-oss": "4.11.4", + "@npmcli/template-oss": "4.12.1", "lodash.clonedeep": "^4.5.0", "nock": "^13.3.0", "tap": "^16.3.4" @@ -42,6 +42,7 @@ "normalize-package-data": "^5.0.0", "npm-package-arg": "^10.1.0", "npm-registry-fetch": "^14.0.3", + "proc-log": "^3.0.0", "semver": "^7.3.7", "sigstore": "^1.0.0", "ssri": "^10.0.1" @@ -51,7 +52,7 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.11.4", + "version": "4.12.1", "content": "../../scripts/template-oss/index.js" }, "tap": { diff --git a/deps/npm/node_modules/libnpmsearch/package.json b/deps/npm/node_modules/libnpmsearch/package.json index 51e1d0adf9348f..765c6897360b6b 100644 --- a/deps/npm/node_modules/libnpmsearch/package.json +++ b/deps/npm/node_modules/libnpmsearch/package.json @@ -26,7 +26,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.11.4", + "@npmcli/template-oss": "4.12.1", "nock": "^13.3.0", "tap": "^16.3.4" }, @@ -45,7 +45,7 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.11.4", + "version": "4.12.1", "content": "../../scripts/template-oss/index.js" }, "tap": { diff --git a/deps/npm/node_modules/libnpmteam/package.json b/deps/npm/node_modules/libnpmteam/package.json index 4d98dc9dc52f32..ff4f5a7852a82a 100644 --- a/deps/npm/node_modules/libnpmteam/package.json +++ b/deps/npm/node_modules/libnpmteam/package.json @@ -16,7 +16,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.11.4", + "@npmcli/template-oss": "4.12.1", "nock": "^13.3.0", "tap": "^16.3.4" }, @@ -39,7 +39,7 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.11.4", + "version": "4.12.1", "content": "../../scripts/template-oss/index.js" }, "tap": { diff --git a/deps/npm/node_modules/libnpmversion/package.json b/deps/npm/node_modules/libnpmversion/package.json index 8fce14cebff382..46362ae10b1044 100644 --- a/deps/npm/node_modules/libnpmversion/package.json +++ b/deps/npm/node_modules/libnpmversion/package.json @@ -32,7 +32,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.11.4", + "@npmcli/template-oss": "4.12.1", "require-inject": "^1.4.4", "tap": "^16.3.4" }, @@ -48,7 +48,7 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.11.4", + "version": "4.12.1", "content": "../../scripts/template-oss/index.js" } } diff --git a/deps/npm/node_modules/lru-cache/index.d.ts b/deps/npm/node_modules/lru-cache/index.d.ts deleted file mode 100644 index e8af7c4de82f99..00000000000000 --- a/deps/npm/node_modules/lru-cache/index.d.ts +++ /dev/null @@ -1,667 +0,0 @@ -// Project: https://github.com/isaacs/node-lru-cache -// Based initially on @types/lru-cache -// https://github.com/DefinitelyTyped/DefinitelyTyped -// used under the terms of the MIT License, shown below. -// -// DefinitelyTyped license: -// ------ -// MIT License -// -// Copyright (c) Microsoft Corporation. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the "Software"), -// to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, -// and/or sell copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE -// ------ -// -// Changes by Isaac Z. Schlueter released under the terms found in the -// LICENSE file within this project. - -/** - * Integer greater than 0, representing some number of milliseconds, or the - * time at which a TTL started counting from. - */ -declare type LRUMilliseconds = number - -/** - * An integer greater than 0, reflecting the calculated size of items - */ -declare type LRUSize = number - -/** - * An integer greater than 0, reflecting a number of items - */ -declare type LRUCount = number - -declare class LRUCache implements Iterable<[K, V]> { - constructor(options: LRUCache.Options) - - /** - * Number of items in the cache. - * Alias for {@link size} - * - * @deprecated since 7.0 use {@link size} instead - */ - public readonly length: LRUCount - - public readonly max: LRUCount - public readonly maxSize: LRUSize - public readonly maxEntrySize: LRUSize - public readonly sizeCalculation: - | LRUCache.SizeCalculator - | undefined - public readonly dispose: LRUCache.Disposer - /** - * @since 7.4.0 - */ - public readonly disposeAfter: LRUCache.Disposer | null - public readonly noDisposeOnSet: boolean - public readonly ttl: LRUMilliseconds - public readonly ttlResolution: LRUMilliseconds - public readonly ttlAutopurge: boolean - public readonly allowStale: boolean - public readonly updateAgeOnGet: boolean - /** - * @since 7.11.0 - */ - public readonly noDeleteOnStaleGet: boolean - /** - * @since 7.6.0 - */ - public readonly fetchMethod: LRUCache.Fetcher | null - - /** - * The total number of items held in the cache at the current moment. - */ - public readonly size: LRUCount - - /** - * The total size of items in cache when using size tracking. - */ - public readonly calculatedSize: LRUSize - - /** - * Add a value to the cache. - */ - public set( - key: K, - value: V, - options?: LRUCache.SetOptions - ): this - - /** - * Return a value from the cache. Will update the recency of the cache entry - * found. - * - * If the key is not found, {@link get} will return `undefined`. This can be - * confusing when setting values specifically to `undefined`, as in - * `cache.set(key, undefined)`. Use {@link has} to determine whether a key is - * present in the cache at all. - */ - public get(key: K, options?: LRUCache.GetOptions): V | undefined - - /** - * Like {@link get} but doesn't update recency or delete stale items. - * Returns `undefined` if the item is stale, unless {@link allowStale} is set - * either on the cache or in the options object. - */ - public peek(key: K, options?: LRUCache.PeekOptions): V | undefined - - /** - * Check if a key is in the cache, without updating the recency of use. - * Will return false if the item is stale, even though it is technically - * in the cache. - * - * Will not update item age unless {@link updateAgeOnHas} is set in the - * options or constructor. - */ - public has(key: K, options?: LRUCache.HasOptions): boolean - - /** - * Deletes a key out of the cache. - * Returns true if the key was deleted, false otherwise. - */ - public delete(key: K): boolean - - /** - * Clear the cache entirely, throwing away all values. - */ - public clear(): void - - /** - * Delete any stale entries. Returns true if anything was removed, false - * otherwise. - */ - public purgeStale(): boolean - - /** - * Find a value for which the supplied fn method returns a truthy value, - * similar to Array.find(). fn is called as fn(value, key, cache). - */ - public find( - callbackFn: ( - value: V, - key: K, - cache: this - ) => boolean | undefined | void, - options?: LRUCache.GetOptions - ): V | undefined - - /** - * Call the supplied function on each item in the cache, in order from - * most recently used to least recently used. fn is called as - * fn(value, key, cache). Does not update age or recenty of use. - */ - public forEach( - callbackFn: (this: T, value: V, key: K, cache: this) => void, - thisArg?: T - ): void - - /** - * The same as {@link forEach} but items are iterated over in reverse - * order. (ie, less recently used items are iterated over first.) - */ - public rforEach( - callbackFn: (this: T, value: V, key: K, cache: this) => void, - thisArg?: T - ): void - - /** - * Return a generator yielding the keys in the cache, - * in order from most recently used to least recently used. - */ - public keys(): Generator - - /** - * Inverse order version of {@link keys} - * - * Return a generator yielding the keys in the cache, - * in order from least recently used to most recently used. - */ - public rkeys(): Generator - - /** - * Return a generator yielding the values in the cache, - * in order from most recently used to least recently used. - */ - public values(): Generator - - /** - * Inverse order version of {@link values} - * - * Return a generator yielding the values in the cache, - * in order from least recently used to most recently used. - */ - public rvalues(): Generator - - /** - * Return a generator yielding `[key, value]` pairs, - * in order from most recently used to least recently used. - */ - public entries(): Generator<[K, V], void, void> - - /** - * Inverse order version of {@link entries} - * - * Return a generator yielding `[key, value]` pairs, - * in order from least recently used to most recently used. - */ - public rentries(): Generator<[K, V], void, void> - - /** - * Iterating over the cache itself yields the same results as - * {@link entries} - */ - public [Symbol.iterator](): Generator<[K, V], void, void> - - /** - * Return an array of [key, entry] objects which can be passed to - * cache.load() - */ - public dump(): Array<[K, LRUCache.Entry]> - - /** - * Reset the cache and load in the items in entries in the order listed. - * Note that the shape of the resulting cache may be different if the - * same options are not used in both caches. - */ - public load( - cacheEntries: ReadonlyArray<[K, LRUCache.Entry]> - ): void - - /** - * Evict the least recently used item, returning its value or `undefined` - * if cache is empty. - */ - public pop(): V | undefined - - /** - * Deletes a key out of the cache. - * - * @deprecated since 7.0 use delete() instead - */ - public del(key: K): boolean - - /** - * Clear the cache entirely, throwing away all values. - * - * @deprecated since 7.0 use clear() instead - */ - public reset(): void - - /** - * Manually iterates over the entire cache proactively pruning old entries. - * - * @deprecated since 7.0 use purgeStale() instead - */ - public prune(): boolean - - /** - * since: 7.6.0 - */ - public fetch( - key: K, - options?: LRUCache.FetchOptions - ): Promise - - /** - * since: 7.6.0 - */ - public getRemainingTTL(key: K): LRUMilliseconds -} - -declare namespace LRUCache { - type DisposeReason = 'evict' | 'set' | 'delete' - - type SizeCalculator = (value: V, key: K) => LRUSize - type Disposer = ( - value: V, - key: K, - reason: DisposeReason - ) => void - type Fetcher = ( - key: K, - staleValue: V | undefined, - options: FetcherOptions - ) => Promise | V | void | undefined - - interface DeprecatedOptions { - /** - * alias for ttl - * - * @deprecated since 7.0 use options.ttl instead - */ - maxAge?: LRUMilliseconds - - /** - * alias for {@link sizeCalculation} - * - * @deprecated since 7.0 use {@link sizeCalculation} instead - */ - length?: SizeCalculator - - /** - * alias for allowStale - * - * @deprecated since 7.0 use options.allowStale instead - */ - stale?: boolean - } - - interface LimitedByCount { - /** - * The number of most recently used items to keep. - * Note that we may store fewer items than this if maxSize is hit. - */ - max: LRUCount - } - - type MaybeMaxEntrySizeLimit = - | { - /** - * The maximum allowed size for any single item in the cache. - * - * If a larger item is passed to {@link set} or returned by a - * {@link fetchMethod}, then it will not be stored in the cache. - */ - maxEntrySize: LRUSize - sizeCalculation?: SizeCalculator - } - | {} - - interface LimitedBySize { - /** - * If you wish to track item size, you must provide a maxSize - * note that we still will only keep up to max *actual items*, - * if max is set, so size tracking may cause fewer than max items - * to be stored. At the extreme, a single item of maxSize size - * will cause everything else in the cache to be dropped when it - * is added. Use with caution! - * - * Note also that size tracking can negatively impact performance, - * though for most cases, only minimally. - */ - maxSize: LRUSize - - /** - * Function to calculate size of items. Useful if storing strings or - * buffers or other items where memory size depends on the object itself. - * - * Items larger than {@link maxEntrySize} will not be stored in the cache. - * - * Note that when {@link maxSize} or {@link maxEntrySize} are set, every - * item added MUST have a size specified, either via a `sizeCalculation` in - * the constructor, or `sizeCalculation` or {@link size} options to - * {@link set}. - */ - sizeCalculation?: SizeCalculator - } - - interface LimitedByTTL { - /** - * Max time in milliseconds for items to live in cache before they are - * considered stale. Note that stale items are NOT preemptively removed - * by default, and MAY live in the cache, contributing to its LRU max, - * long after they have expired. - * - * Also, as this cache is optimized for LRU/MRU operations, some of - * the staleness/TTL checks will reduce performance, as they will incur - * overhead by deleting items. - * - * Must be an integer number of ms, defaults to 0, which means "no TTL" - */ - ttl: LRUMilliseconds - - /** - * Boolean flag to tell the cache to not update the TTL when - * setting a new value for an existing key (ie, when updating a value - * rather than inserting a new value). Note that the TTL value is - * _always_ set (if provided) when adding a new entry into the cache. - * - * @default false - * @since 7.4.0 - */ - noUpdateTTL?: boolean - - /** - * Minimum amount of time in ms in which to check for staleness. - * Defaults to 1, which means that the current time is checked - * at most once per millisecond. - * - * Set to 0 to check the current time every time staleness is tested. - * (This reduces performance, and is theoretically unnecessary.) - * - * Setting this to a higher value will improve performance somewhat - * while using ttl tracking, albeit at the expense of keeping stale - * items around a bit longer than their TTLs would indicate. - * - * @default 1 - * @since 7.1.0 - */ - ttlResolution?: LRUMilliseconds - - /** - * Preemptively remove stale items from the cache. - * Note that this may significantly degrade performance, - * especially if the cache is storing a large number of items. - * It is almost always best to just leave the stale items in - * the cache, and let them fall out as new items are added. - * - * Note that this means that {@link allowStale} is a bit pointless, - * as stale items will be deleted almost as soon as they expire. - * - * Use with caution! - * - * @default false - * @since 7.1.0 - */ - ttlAutopurge?: boolean - - /** - * Return stale items from {@link get} before disposing of them. - * Return stale values from {@link fetch} while performing a call - * to the {@link fetchMethod} in the background. - * - * @default false - */ - allowStale?: boolean - - /** - * Update the age of items on {@link get}, renewing their TTL - * - * @default false - */ - updateAgeOnGet?: boolean - - /** - * Do not delete stale items when they are retrieved with {@link get}. - * Note that the {@link get} return value will still be `undefined` unless - * allowStale is true. - * - * @default false - * @since 7.11.0 - */ - noDeleteOnStaleGet?: boolean - - /** - * Update the age of items on {@link has}, renewing their TTL - * - * @default false - */ - updateAgeOnHas?: boolean - } - - type SafetyBounds = - | LimitedByCount - | LimitedBySize - | LimitedByTTL - - // options shared by all three of the limiting scenarios - interface SharedOptions { - /** - * Function that is called on items when they are dropped from the cache. - * This can be handy if you want to close file descriptors or do other - * cleanup tasks when items are no longer accessible. Called with `key, - * value`. It's called before actually removing the item from the - * internal cache, so it is *NOT* safe to re-add them. - * Use {@link disposeAfter} if you wish to dispose items after they have - * been full removed, when it is safe to add them back to the cache. - */ - dispose?: Disposer - - /** - * The same as dispose, but called *after* the entry is completely - * removed and the cache is once again in a clean state. It is safe to - * add an item right back into the cache at this point. - * However, note that it is *very* easy to inadvertently create infinite - * recursion this way. - * - * @since 7.3.0 - */ - disposeAfter?: Disposer - - /** - * Set to true to suppress calling the dispose() function if the entry - * key is still accessible within the cache. - * This may be overridden by passing an options object to {@link set}. - * - * @default false - */ - noDisposeOnSet?: boolean - - /** - * Function that is used to make background asynchronous fetches. Called - * with `fetchMethod(key, staleValue, { signal, options, context })`. - * - * If `fetchMethod` is not provided, then {@link fetch} is - * equivalent to `Promise.resolve(cache.get(key))`. - * - * The `fetchMethod` should ONLY return `undefined` in cases where the - * abort controller has sent an abort signal. - * - * @since 7.6.0 - */ - fetchMethod?: LRUCache.Fetcher - - /** - * Set to true to suppress the deletion of stale data when a - * {@link fetchMethod} throws an error or returns a rejected promise - * - * @default false - * @since 7.10.0 - */ - noDeleteOnFetchRejection?: boolean - - /** - * Set to true to allow returning stale data when a {@link fetchMethod} - * throws an error or returns a rejected promise. Note that this - * differs from using {@link allowStale} in that stale data will - * ONLY be returned in the case that the fetch fails, not any other - * times. - * - * @default false - * @since 7.16.0 - */ - allowStaleOnFetchRejection?: boolean - - /** - * Set to any value in the constructor or {@link fetch} options to - * pass arbitrary data to the {@link fetchMethod} in the {@link context} - * options field. - * - * @since 7.12.0 - */ - fetchContext?: any - } - - type Options = SharedOptions & - DeprecatedOptions & - SafetyBounds & - MaybeMaxEntrySizeLimit - - /** - * options which override the options set in the LRUCache constructor - * when making calling {@link set}. - */ - interface SetOptions { - /** - * A value for the size of the entry, prevents calls to - * {@link sizeCalculation}. - * - * Items larger than {@link maxEntrySize} will not be stored in the cache. - * - * Note that when {@link maxSize} or {@link maxEntrySize} are set, every - * item added MUST have a size specified, either via a `sizeCalculation` in - * the constructor, or {@link sizeCalculation} or `size` options to - * {@link set}. - */ - size?: LRUSize - /** - * Overrides the {@link sizeCalculation} method set in the constructor. - * - * Items larger than {@link maxEntrySize} will not be stored in the cache. - * - * Note that when {@link maxSize} or {@link maxEntrySize} are set, every - * item added MUST have a size specified, either via a `sizeCalculation` in - * the constructor, or `sizeCalculation` or {@link size} options to - * {@link set}. - */ - sizeCalculation?: SizeCalculator - ttl?: LRUMilliseconds - start?: LRUMilliseconds - noDisposeOnSet?: boolean - noUpdateTTL?: boolean - } - - /** - * options which override the options set in the LRUCAche constructor - * when calling {@link has}. - */ - interface HasOptions { - updateAgeOnHas?: boolean - } - - /** - * options which override the options set in the LRUCache constructor - * when calling {@link get}. - */ - interface GetOptions { - allowStale?: boolean - updateAgeOnGet?: boolean - noDeleteOnStaleGet?: boolean - } - - /** - * options which override the options set in the LRUCache constructor - * when calling {@link peek}. - */ - interface PeekOptions { - allowStale?: boolean - } - - /** - * Options object passed to the {@link fetchMethod} - * - * May be mutated by the {@link fetchMethod} to affect the behavior of the - * resulting {@link set} operation on resolution, or in the case of - * {@link noDeleteOnFetchRejection} and {@link allowStaleOnFetchRejection}, - * the handling of failure. - */ - interface FetcherFetchOptions { - allowStale?: boolean - updateAgeOnGet?: boolean - noDeleteOnStaleGet?: boolean - size?: LRUSize - sizeCalculation?: SizeCalculator - ttl?: LRUMilliseconds - noDisposeOnSet?: boolean - noUpdateTTL?: boolean - noDeleteOnFetchRejection?: boolean - allowStaleOnFetchRejection?: boolean - } - - /** - * options which override the options set in the LRUCache constructor - * when calling {@link fetch}. - * - * This is the union of GetOptions and SetOptions, plus - * {@link noDeleteOnFetchRejection}, {@link allowStaleOnFetchRejection}, - * {@link forceRefresh}, and {@link fetchContext} - */ - interface FetchOptions extends FetcherFetchOptions { - forceRefresh?: boolean - fetchContext?: any - } - - interface FetcherOptions { - signal: AbortSignal - options: FetcherFetchOptions - /** - * Object provided in the {@link fetchContext} option - */ - context: any - } - - interface Entry { - value: V - ttl?: LRUMilliseconds - size?: LRUSize - start?: LRUMilliseconds - } -} - -export = LRUCache diff --git a/deps/npm/node_modules/lru-cache/index.js b/deps/npm/node_modules/lru-cache/index.js index f4be3476d4dbc1..48e99fe5e5a70c 100644 --- a/deps/npm/node_modules/lru-cache/index.js +++ b/deps/npm/node_modules/lru-cache/index.js @@ -18,7 +18,8 @@ const AC = hasAbortController this.signal = new AS() } abort(reason = new Error('This operation was aborted')) { - this.signal.reason = reason + this.signal.reason = this.signal.reason || reason + this.signal.aborted = true this.signal.dispatchEvent({ type: 'abort', target: this.signal, @@ -168,6 +169,8 @@ class LRUCache { noDeleteOnFetchRejection, noDeleteOnStaleGet, allowStaleOnFetchRejection, + allowStaleOnFetchAbort, + ignoreFetchAbort, } = options // deprecated options, don't trigger a warning for getting them if @@ -238,6 +241,8 @@ class LRUCache { this.noUpdateTTL = !!noUpdateTTL this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection + this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort + this.ignoreFetchAbort = !!ignoreFetchAbort // NB: maxEntrySize is set to maxSize if it's set if (this.maxEntrySize !== 0) { @@ -331,6 +336,15 @@ class LRUCache { this.starts[index] = this.ttls[index] !== 0 ? perf.now() : 0 } + this.statusTTL = (status, index) => { + if (status) { + status.ttl = this.ttls[index] + status.start = this.starts[index] + status.now = cachedNow || getNow() + status.remainingTTL = status.now + status.ttl - status.start + } + } + // debounce calls to perf.now() to 1s so we're not hitting // that costly call repeatedly. let cachedNow = 0 @@ -372,6 +386,7 @@ class LRUCache { } } updateItemAge(_index) {} + statusTTL(_status, _index) {} setItemTTL(_index, _ttl, _start) {} isStale(_index) { return false @@ -411,7 +426,7 @@ class LRUCache { } return size } - this.addItemSize = (index, size) => { + this.addItemSize = (index, size, status) => { this.sizes[index] = size if (this.maxSize) { const maxSize = this.maxSize - this.sizes[index] @@ -420,6 +435,10 @@ class LRUCache { } } this.calculatedSize += this.sizes[index] + if (status) { + status.entrySize = size + status.totalCalculatedSize = this.calculatedSize + } } } removeItemSize(_index) {} @@ -469,19 +488,30 @@ class LRUCache { } isValidIndex(index) { - return this.keyMap.get(this.keyList[index]) === index + return ( + index !== undefined && + this.keyMap.get(this.keyList[index]) === index + ) } *entries() { for (const i of this.indexes()) { - if (!this.isBackgroundFetch(this.valList[i])) { + if ( + this.valList[i] !== undefined && + this.keyList[i] !== undefined && + !this.isBackgroundFetch(this.valList[i]) + ) { yield [this.keyList[i], this.valList[i]] } } } *rentries() { for (const i of this.rindexes()) { - if (!this.isBackgroundFetch(this.valList[i])) { + if ( + this.valList[i] !== undefined && + this.keyList[i] !== undefined && + !this.isBackgroundFetch(this.valList[i]) + ) { yield [this.keyList[i], this.valList[i]] } } @@ -489,14 +519,20 @@ class LRUCache { *keys() { for (const i of this.indexes()) { - if (!this.isBackgroundFetch(this.valList[i])) { + if ( + this.keyList[i] !== undefined && + !this.isBackgroundFetch(this.valList[i]) + ) { yield this.keyList[i] } } } *rkeys() { for (const i of this.rindexes()) { - if (!this.isBackgroundFetch(this.valList[i])) { + if ( + this.keyList[i] !== undefined && + !this.isBackgroundFetch(this.valList[i]) + ) { yield this.keyList[i] } } @@ -504,14 +540,20 @@ class LRUCache { *values() { for (const i of this.indexes()) { - if (!this.isBackgroundFetch(this.valList[i])) { + if ( + this.valList[i] !== undefined && + !this.isBackgroundFetch(this.valList[i]) + ) { yield this.valList[i] } } } *rvalues() { for (const i of this.rindexes()) { - if (!this.isBackgroundFetch(this.valList[i])) { + if ( + this.valList[i] !== undefined && + !this.isBackgroundFetch(this.valList[i]) + ) { yield this.valList[i] } } @@ -521,9 +563,14 @@ class LRUCache { return this.entries() } - find(fn, getOptions = {}) { + find(fn, getOptions) { for (const i of this.indexes()) { - if (fn(this.valList[i], this.keyList[i], this)) { + const v = this.valList[i] + const value = this.isBackgroundFetch(v) + ? v.__staleWhileFetching + : v + if (value === undefined) continue + if (fn(value, this.keyList[i], this)) { return this.get(this.keyList[i], getOptions) } } @@ -531,13 +578,23 @@ class LRUCache { forEach(fn, thisp = this) { for (const i of this.indexes()) { - fn.call(thisp, this.valList[i], this.keyList[i], this) + const v = this.valList[i] + const value = this.isBackgroundFetch(v) + ? v.__staleWhileFetching + : v + if (value === undefined) continue + fn.call(thisp, value, this.keyList[i], this) } } rforEach(fn, thisp = this) { for (const i of this.rindexes()) { - fn.call(thisp, this.valList[i], this.keyList[i], this) + const v = this.valList[i] + const value = this.isBackgroundFetch(v) + ? v.__staleWhileFetching + : v + if (value === undefined) continue + fn.call(thisp, value, this.keyList[i], this) } } @@ -608,12 +665,17 @@ class LRUCache { size = 0, sizeCalculation = this.sizeCalculation, noUpdateTTL = this.noUpdateTTL, + status, } = {} ) { size = this.requireSize(k, v, size, sizeCalculation) // if the item doesn't fit, don't do anything // NB: maxEntrySize set to maxSize by default if (this.maxEntrySize && size > this.maxEntrySize) { + if (status) { + status.set = 'miss' + status.maxEntrySizeExceeded = true + } // have to delete, in case a background fetch is there already. // in non-async cases, this is a no-op this.delete(k) @@ -630,7 +692,10 @@ class LRUCache { this.prev[index] = this.tail this.tail = index this.size++ - this.addItemSize(index, size) + this.addItemSize(index, size, status) + if (status) { + status.set = 'add' + } noUpdateTTL = false } else { // update @@ -649,7 +714,17 @@ class LRUCache { } this.removeItemSize(index) this.valList[index] = v - this.addItemSize(index, size) + this.addItemSize(index, size, status) + if (status) { + status.set = 'replace' + const oldValue = + oldVal && this.isBackgroundFetch(oldVal) + ? oldVal.__staleWhileFetching + : oldVal + if (oldValue !== undefined) status.oldValue = oldValue + } + } else if (status) { + status.set = 'update' } } if (ttl !== 0 && this.ttl === 0 && !this.ttls) { @@ -658,6 +733,7 @@ class LRUCache { if (!noUpdateTTL) { this.setItemTTL(index, ttl, start) } + this.statusTTL(status, index) if (this.disposeAfter) { while (this.disposed.length) { this.disposeAfter(...this.disposed.shift()) @@ -713,15 +789,22 @@ class LRUCache { return head } - has(k, { updateAgeOnHas = this.updateAgeOnHas } = {}) { + has(k, { updateAgeOnHas = this.updateAgeOnHas, status } = {}) { const index = this.keyMap.get(k) if (index !== undefined) { if (!this.isStale(index)) { if (updateAgeOnHas) { this.updateItemAge(index) } + if (status) status.has = 'hit' + this.statusTTL(status, index) return true + } else if (status) { + status.has = 'stale' + this.statusTTL(status, index) } + } else if (status) { + status.has = 'miss' } return false } @@ -742,51 +825,109 @@ class LRUCache { return v } const ac = new AC() + if (options.signal) { + options.signal.addEventListener('abort', () => + ac.abort(options.signal.reason) + ) + } const fetchOpts = { signal: ac.signal, options, context, } - const cb = v => { - if (!ac.signal.aborted) { - this.set(k, v, fetchOpts.options) - return v - } else { - return eb(ac.signal.reason) + const cb = (v, updateCache = false) => { + const { aborted } = ac.signal + const ignoreAbort = options.ignoreFetchAbort && v !== undefined + if (options.status) { + if (aborted && !updateCache) { + options.status.fetchAborted = true + options.status.fetchError = ac.signal.reason + if (ignoreAbort) options.status.fetchAbortIgnored = true + } else { + options.status.fetchResolved = true + } + } + if (aborted && !ignoreAbort && !updateCache) { + return fetchFail(ac.signal.reason) + } + // either we didn't abort, and are still here, or we did, and ignored + if (this.valList[index] === p) { + if (v === undefined) { + if (p.__staleWhileFetching) { + this.valList[index] = p.__staleWhileFetching + } else { + this.delete(k) + } + } else { + if (options.status) options.status.fetchUpdated = true + this.set(k, v, fetchOpts.options) + } } + return v } const eb = er => { + if (options.status) { + options.status.fetchRejected = true + options.status.fetchError = er + } + return fetchFail(er) + } + const fetchFail = er => { + const { aborted } = ac.signal + const allowStaleAborted = + aborted && options.allowStaleOnFetchAbort + const allowStale = + allowStaleAborted || options.allowStaleOnFetchRejection + const noDelete = allowStale || options.noDeleteOnFetchRejection if (this.valList[index] === p) { // if we allow stale on fetch rejections, then we need to ensure that // the stale value is not removed from the cache when the fetch fails. - const noDelete = - options.noDeleteOnFetchRejection || - options.allowStaleOnFetchRejection const del = !noDelete || p.__staleWhileFetching === undefined if (del) { this.delete(k) - } else { + } else if (!allowStaleAborted) { // still replace the *promise* with the stale value, // since we are done with the promise at this point. + // leave it untouched if we're still waiting for an + // aborted background fetch that hasn't yet returned. this.valList[index] = p.__staleWhileFetching } } - if (options.allowStaleOnFetchRejection) { + if (allowStale) { + if (options.status && p.__staleWhileFetching !== undefined) { + options.status.returnedStale = true + } return p.__staleWhileFetching } else if (p.__returned === p) { throw er } } const pcall = (res, rej) => { - ac.signal.addEventListener('abort', () => res()) - this.fetchMethod(k, v, fetchOpts).then(res, rej) + this.fetchMethod(k, v, fetchOpts).then(v => res(v), rej) + // ignored, we go until we finish, regardless. + // defer check until we are actually aborting, + // so fetchMethod can override. + ac.signal.addEventListener('abort', () => { + if ( + !options.ignoreFetchAbort || + options.allowStaleOnFetchAbort + ) { + res() + // when it eventually resolves, update the cache. + if (options.allowStaleOnFetchAbort) { + res = v => cb(v, true) + } + } + }) } + if (options.status) options.status.fetchDispatched = true const p = new Promise(pcall).then(cb, eb) p.__abortController = ac p.__staleWhileFetching = v p.__returned = null if (index === undefined) { - this.set(k, p, fetchOpts.options) + // internal, don't expose status. + this.set(k, p, { ...fetchOpts.options, status: undefined }) index = this.keyMap.get(k) } else { this.valList[index] = p @@ -825,16 +966,21 @@ class LRUCache { // fetch exclusive options noDeleteOnFetchRejection = this.noDeleteOnFetchRejection, allowStaleOnFetchRejection = this.allowStaleOnFetchRejection, + ignoreFetchAbort = this.ignoreFetchAbort, + allowStaleOnFetchAbort = this.allowStaleOnFetchAbort, fetchContext = this.fetchContext, forceRefresh = false, + status, signal, } = {} ) { if (!this.fetchMethod) { + if (status) status.fetch = 'get' return this.get(k, { allowStale, updateAgeOnGet, noDeleteOnStaleGet, + status, }) } @@ -849,38 +995,53 @@ class LRUCache { noUpdateTTL, noDeleteOnFetchRejection, allowStaleOnFetchRejection, + allowStaleOnFetchAbort, + ignoreFetchAbort, + status, signal, } let index = this.keyMap.get(k) if (index === undefined) { + if (status) status.fetch = 'miss' const p = this.backgroundFetch(k, index, options, fetchContext) return (p.__returned = p) } else { // in cache, maybe already fetching const v = this.valList[index] if (this.isBackgroundFetch(v)) { - return allowStale && v.__staleWhileFetching !== undefined - ? v.__staleWhileFetching - : (v.__returned = v) + const stale = + allowStale && v.__staleWhileFetching !== undefined + if (status) { + status.fetch = 'inflight' + if (stale) status.returnedStale = true + } + return stale ? v.__staleWhileFetching : (v.__returned = v) } // if we force a refresh, that means do NOT serve the cached value, // unless we are already in the process of refreshing the cache. - if (!forceRefresh && !this.isStale(index)) { + const isStale = this.isStale(index) + if (!forceRefresh && !isStale) { + if (status) status.fetch = 'hit' this.moveToTail(index) if (updateAgeOnGet) { this.updateItemAge(index) } + this.statusTTL(status, index) return v } // ok, it is stale or a forced refresh, and not already fetching. // refresh the cache. const p = this.backgroundFetch(k, index, options, fetchContext) - return allowStale && p.__staleWhileFetching !== undefined - ? p.__staleWhileFetching - : (p.__returned = p) + const hasStale = p.__staleWhileFetching !== undefined + const staleVal = hasStale && allowStale + if (status) { + status.fetch = hasStale && isStale ? 'stale' : 'refresh' + if (staleVal && isStale) status.returnedStale = true + } + return staleVal ? p.__staleWhileFetching : (p.__returned = p) } } @@ -890,28 +1051,39 @@ class LRUCache { allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, + status, } = {} ) { const index = this.keyMap.get(k) if (index !== undefined) { const value = this.valList[index] const fetching = this.isBackgroundFetch(value) + this.statusTTL(status, index) if (this.isStale(index)) { + if (status) status.get = 'stale' // delete only if not an in-flight background fetch if (!fetching) { if (!noDeleteOnStaleGet) { this.delete(k) } + if (status) status.returnedStale = allowStale return allowStale ? value : undefined } else { + if (status) { + status.returnedStale = + allowStale && value.__staleWhileFetching !== undefined + } return allowStale ? value.__staleWhileFetching : undefined } } else { + if (status) status.get = 'hit' // if we're currently fetching it, we don't actually have it yet - // it's not stale, which means this isn't a staleWhileRefetching, - // so we just return undefined + // it's not stale, which means this isn't a staleWhileRefetching. + // If it's not stale, and fetching, AND has a __staleWhileFetching + // value, then that means the user fetched with {forceRefresh:true}, + // so it's safe to return that value. if (fetching) { - return undefined + return value.__staleWhileFetching } this.moveToTail(index) if (updateAgeOnGet) { @@ -919,6 +1091,8 @@ class LRUCache { } return value } + } else if (status) { + status.get = 'miss' } } diff --git a/deps/npm/node_modules/lru-cache/index.mjs b/deps/npm/node_modules/lru-cache/index.mjs index e69e77fbb34566..4a0b4813ec5157 100644 --- a/deps/npm/node_modules/lru-cache/index.mjs +++ b/deps/npm/node_modules/lru-cache/index.mjs @@ -18,7 +18,8 @@ const AC = hasAbortController this.signal = new AS() } abort(reason = new Error('This operation was aborted')) { - this.signal.reason = reason + this.signal.reason = this.signal.reason || reason + this.signal.aborted = true this.signal.dispatchEvent({ type: 'abort', target: this.signal, @@ -168,6 +169,8 @@ class LRUCache { noDeleteOnFetchRejection, noDeleteOnStaleGet, allowStaleOnFetchRejection, + allowStaleOnFetchAbort, + ignoreFetchAbort, } = options // deprecated options, don't trigger a warning for getting them if @@ -238,6 +241,8 @@ class LRUCache { this.noUpdateTTL = !!noUpdateTTL this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection + this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort + this.ignoreFetchAbort = !!ignoreFetchAbort // NB: maxEntrySize is set to maxSize if it's set if (this.maxEntrySize !== 0) { @@ -331,6 +336,15 @@ class LRUCache { this.starts[index] = this.ttls[index] !== 0 ? perf.now() : 0 } + this.statusTTL = (status, index) => { + if (status) { + status.ttl = this.ttls[index] + status.start = this.starts[index] + status.now = cachedNow || getNow() + status.remainingTTL = status.now + status.ttl - status.start + } + } + // debounce calls to perf.now() to 1s so we're not hitting // that costly call repeatedly. let cachedNow = 0 @@ -372,6 +386,7 @@ class LRUCache { } } updateItemAge(_index) {} + statusTTL(_status, _index) {} setItemTTL(_index, _ttl, _start) {} isStale(_index) { return false @@ -411,7 +426,7 @@ class LRUCache { } return size } - this.addItemSize = (index, size) => { + this.addItemSize = (index, size, status) => { this.sizes[index] = size if (this.maxSize) { const maxSize = this.maxSize - this.sizes[index] @@ -420,6 +435,10 @@ class LRUCache { } } this.calculatedSize += this.sizes[index] + if (status) { + status.entrySize = size + status.totalCalculatedSize = this.calculatedSize + } } } removeItemSize(_index) {} @@ -469,19 +488,30 @@ class LRUCache { } isValidIndex(index) { - return this.keyMap.get(this.keyList[index]) === index + return ( + index !== undefined && + this.keyMap.get(this.keyList[index]) === index + ) } *entries() { for (const i of this.indexes()) { - if (!this.isBackgroundFetch(this.valList[i])) { + if ( + this.valList[i] !== undefined && + this.keyList[i] !== undefined && + !this.isBackgroundFetch(this.valList[i]) + ) { yield [this.keyList[i], this.valList[i]] } } } *rentries() { for (const i of this.rindexes()) { - if (!this.isBackgroundFetch(this.valList[i])) { + if ( + this.valList[i] !== undefined && + this.keyList[i] !== undefined && + !this.isBackgroundFetch(this.valList[i]) + ) { yield [this.keyList[i], this.valList[i]] } } @@ -489,14 +519,20 @@ class LRUCache { *keys() { for (const i of this.indexes()) { - if (!this.isBackgroundFetch(this.valList[i])) { + if ( + this.keyList[i] !== undefined && + !this.isBackgroundFetch(this.valList[i]) + ) { yield this.keyList[i] } } } *rkeys() { for (const i of this.rindexes()) { - if (!this.isBackgroundFetch(this.valList[i])) { + if ( + this.keyList[i] !== undefined && + !this.isBackgroundFetch(this.valList[i]) + ) { yield this.keyList[i] } } @@ -504,14 +540,20 @@ class LRUCache { *values() { for (const i of this.indexes()) { - if (!this.isBackgroundFetch(this.valList[i])) { + if ( + this.valList[i] !== undefined && + !this.isBackgroundFetch(this.valList[i]) + ) { yield this.valList[i] } } } *rvalues() { for (const i of this.rindexes()) { - if (!this.isBackgroundFetch(this.valList[i])) { + if ( + this.valList[i] !== undefined && + !this.isBackgroundFetch(this.valList[i]) + ) { yield this.valList[i] } } @@ -521,9 +563,14 @@ class LRUCache { return this.entries() } - find(fn, getOptions = {}) { + find(fn, getOptions) { for (const i of this.indexes()) { - if (fn(this.valList[i], this.keyList[i], this)) { + const v = this.valList[i] + const value = this.isBackgroundFetch(v) + ? v.__staleWhileFetching + : v + if (value === undefined) continue + if (fn(value, this.keyList[i], this)) { return this.get(this.keyList[i], getOptions) } } @@ -531,13 +578,23 @@ class LRUCache { forEach(fn, thisp = this) { for (const i of this.indexes()) { - fn.call(thisp, this.valList[i], this.keyList[i], this) + const v = this.valList[i] + const value = this.isBackgroundFetch(v) + ? v.__staleWhileFetching + : v + if (value === undefined) continue + fn.call(thisp, value, this.keyList[i], this) } } rforEach(fn, thisp = this) { for (const i of this.rindexes()) { - fn.call(thisp, this.valList[i], this.keyList[i], this) + const v = this.valList[i] + const value = this.isBackgroundFetch(v) + ? v.__staleWhileFetching + : v + if (value === undefined) continue + fn.call(thisp, value, this.keyList[i], this) } } @@ -608,12 +665,17 @@ class LRUCache { size = 0, sizeCalculation = this.sizeCalculation, noUpdateTTL = this.noUpdateTTL, + status, } = {} ) { size = this.requireSize(k, v, size, sizeCalculation) // if the item doesn't fit, don't do anything // NB: maxEntrySize set to maxSize by default if (this.maxEntrySize && size > this.maxEntrySize) { + if (status) { + status.set = 'miss' + status.maxEntrySizeExceeded = true + } // have to delete, in case a background fetch is there already. // in non-async cases, this is a no-op this.delete(k) @@ -630,7 +692,10 @@ class LRUCache { this.prev[index] = this.tail this.tail = index this.size++ - this.addItemSize(index, size) + this.addItemSize(index, size, status) + if (status) { + status.set = 'add' + } noUpdateTTL = false } else { // update @@ -649,7 +714,17 @@ class LRUCache { } this.removeItemSize(index) this.valList[index] = v - this.addItemSize(index, size) + this.addItemSize(index, size, status) + if (status) { + status.set = 'replace' + const oldValue = + oldVal && this.isBackgroundFetch(oldVal) + ? oldVal.__staleWhileFetching + : oldVal + if (oldValue !== undefined) status.oldValue = oldValue + } + } else if (status) { + status.set = 'update' } } if (ttl !== 0 && this.ttl === 0 && !this.ttls) { @@ -658,6 +733,7 @@ class LRUCache { if (!noUpdateTTL) { this.setItemTTL(index, ttl, start) } + this.statusTTL(status, index) if (this.disposeAfter) { while (this.disposed.length) { this.disposeAfter(...this.disposed.shift()) @@ -713,15 +789,22 @@ class LRUCache { return head } - has(k, { updateAgeOnHas = this.updateAgeOnHas } = {}) { + has(k, { updateAgeOnHas = this.updateAgeOnHas, status } = {}) { const index = this.keyMap.get(k) if (index !== undefined) { if (!this.isStale(index)) { if (updateAgeOnHas) { this.updateItemAge(index) } + if (status) status.has = 'hit' + this.statusTTL(status, index) return true + } else if (status) { + status.has = 'stale' + this.statusTTL(status, index) } + } else if (status) { + status.has = 'miss' } return false } @@ -742,51 +825,109 @@ class LRUCache { return v } const ac = new AC() + if (options.signal) { + options.signal.addEventListener('abort', () => + ac.abort(options.signal.reason) + ) + } const fetchOpts = { signal: ac.signal, options, context, } - const cb = v => { - if (!ac.signal.aborted) { - this.set(k, v, fetchOpts.options) - return v - } else { - return eb(ac.signal.reason) + const cb = (v, updateCache = false) => { + const { aborted } = ac.signal + const ignoreAbort = options.ignoreFetchAbort && v !== undefined + if (options.status) { + if (aborted && !updateCache) { + options.status.fetchAborted = true + options.status.fetchError = ac.signal.reason + if (ignoreAbort) options.status.fetchAbortIgnored = true + } else { + options.status.fetchResolved = true + } + } + if (aborted && !ignoreAbort && !updateCache) { + return fetchFail(ac.signal.reason) + } + // either we didn't abort, and are still here, or we did, and ignored + if (this.valList[index] === p) { + if (v === undefined) { + if (p.__staleWhileFetching) { + this.valList[index] = p.__staleWhileFetching + } else { + this.delete(k) + } + } else { + if (options.status) options.status.fetchUpdated = true + this.set(k, v, fetchOpts.options) + } } + return v } const eb = er => { + if (options.status) { + options.status.fetchRejected = true + options.status.fetchError = er + } + return fetchFail(er) + } + const fetchFail = er => { + const { aborted } = ac.signal + const allowStaleAborted = + aborted && options.allowStaleOnFetchAbort + const allowStale = + allowStaleAborted || options.allowStaleOnFetchRejection + const noDelete = allowStale || options.noDeleteOnFetchRejection if (this.valList[index] === p) { // if we allow stale on fetch rejections, then we need to ensure that // the stale value is not removed from the cache when the fetch fails. - const noDelete = - options.noDeleteOnFetchRejection || - options.allowStaleOnFetchRejection const del = !noDelete || p.__staleWhileFetching === undefined if (del) { this.delete(k) - } else { + } else if (!allowStaleAborted) { // still replace the *promise* with the stale value, // since we are done with the promise at this point. + // leave it untouched if we're still waiting for an + // aborted background fetch that hasn't yet returned. this.valList[index] = p.__staleWhileFetching } } - if (options.allowStaleOnFetchRejection) { + if (allowStale) { + if (options.status && p.__staleWhileFetching !== undefined) { + options.status.returnedStale = true + } return p.__staleWhileFetching } else if (p.__returned === p) { throw er } } const pcall = (res, rej) => { - ac.signal.addEventListener('abort', () => res()) - this.fetchMethod(k, v, fetchOpts).then(res, rej) + this.fetchMethod(k, v, fetchOpts).then(v => res(v), rej) + // ignored, we go until we finish, regardless. + // defer check until we are actually aborting, + // so fetchMethod can override. + ac.signal.addEventListener('abort', () => { + if ( + !options.ignoreFetchAbort || + options.allowStaleOnFetchAbort + ) { + res() + // when it eventually resolves, update the cache. + if (options.allowStaleOnFetchAbort) { + res = v => cb(v, true) + } + } + }) } + if (options.status) options.status.fetchDispatched = true const p = new Promise(pcall).then(cb, eb) p.__abortController = ac p.__staleWhileFetching = v p.__returned = null if (index === undefined) { - this.set(k, p, fetchOpts.options) + // internal, don't expose status. + this.set(k, p, { ...fetchOpts.options, status: undefined }) index = this.keyMap.get(k) } else { this.valList[index] = p @@ -825,16 +966,21 @@ class LRUCache { // fetch exclusive options noDeleteOnFetchRejection = this.noDeleteOnFetchRejection, allowStaleOnFetchRejection = this.allowStaleOnFetchRejection, + ignoreFetchAbort = this.ignoreFetchAbort, + allowStaleOnFetchAbort = this.allowStaleOnFetchAbort, fetchContext = this.fetchContext, forceRefresh = false, + status, signal, } = {} ) { if (!this.fetchMethod) { + if (status) status.fetch = 'get' return this.get(k, { allowStale, updateAgeOnGet, noDeleteOnStaleGet, + status, }) } @@ -849,38 +995,53 @@ class LRUCache { noUpdateTTL, noDeleteOnFetchRejection, allowStaleOnFetchRejection, + allowStaleOnFetchAbort, + ignoreFetchAbort, + status, signal, } let index = this.keyMap.get(k) if (index === undefined) { + if (status) status.fetch = 'miss' const p = this.backgroundFetch(k, index, options, fetchContext) return (p.__returned = p) } else { // in cache, maybe already fetching const v = this.valList[index] if (this.isBackgroundFetch(v)) { - return allowStale && v.__staleWhileFetching !== undefined - ? v.__staleWhileFetching - : (v.__returned = v) + const stale = + allowStale && v.__staleWhileFetching !== undefined + if (status) { + status.fetch = 'inflight' + if (stale) status.returnedStale = true + } + return stale ? v.__staleWhileFetching : (v.__returned = v) } // if we force a refresh, that means do NOT serve the cached value, // unless we are already in the process of refreshing the cache. - if (!forceRefresh && !this.isStale(index)) { + const isStale = this.isStale(index) + if (!forceRefresh && !isStale) { + if (status) status.fetch = 'hit' this.moveToTail(index) if (updateAgeOnGet) { this.updateItemAge(index) } + this.statusTTL(status, index) return v } // ok, it is stale or a forced refresh, and not already fetching. // refresh the cache. const p = this.backgroundFetch(k, index, options, fetchContext) - return allowStale && p.__staleWhileFetching !== undefined - ? p.__staleWhileFetching - : (p.__returned = p) + const hasStale = p.__staleWhileFetching !== undefined + const staleVal = hasStale && allowStale + if (status) { + status.fetch = hasStale && isStale ? 'stale' : 'refresh' + if (staleVal && isStale) status.returnedStale = true + } + return staleVal ? p.__staleWhileFetching : (p.__returned = p) } } @@ -890,28 +1051,39 @@ class LRUCache { allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, + status, } = {} ) { const index = this.keyMap.get(k) if (index !== undefined) { const value = this.valList[index] const fetching = this.isBackgroundFetch(value) + this.statusTTL(status, index) if (this.isStale(index)) { + if (status) status.get = 'stale' // delete only if not an in-flight background fetch if (!fetching) { if (!noDeleteOnStaleGet) { this.delete(k) } + if (status) status.returnedStale = allowStale return allowStale ? value : undefined } else { + if (status) { + status.returnedStale = + allowStale && value.__staleWhileFetching !== undefined + } return allowStale ? value.__staleWhileFetching : undefined } } else { + if (status) status.get = 'hit' // if we're currently fetching it, we don't actually have it yet - // it's not stale, which means this isn't a staleWhileRefetching, - // so we just return undefined + // it's not stale, which means this isn't a staleWhileRefetching. + // If it's not stale, and fetching, AND has a __staleWhileFetching + // value, then that means the user fetched with {forceRefresh:true}, + // so it's safe to return that value. if (fetching) { - return undefined + return value.__staleWhileFetching } this.moveToTail(index) if (updateAgeOnGet) { @@ -919,6 +1091,8 @@ class LRUCache { } return value } + } else if (status) { + status.get = 'miss' } } diff --git a/deps/npm/node_modules/lru-cache/package.json b/deps/npm/node_modules/lru-cache/package.json index fb90c93901b093..9684991727e7a2 100644 --- a/deps/npm/node_modules/lru-cache/package.json +++ b/deps/npm/node_modules/lru-cache/package.json @@ -1,7 +1,7 @@ { "name": "lru-cache", "description": "A cache object that deletes the least-recently-used items.", - "version": "7.16.2", + "version": "7.18.3", "author": "Isaac Z. Schlueter ", "keywords": [ "mru", @@ -13,7 +13,7 @@ "build": "npm run prepare", "pretest": "npm run prepare", "presnap": "npm run prepare", - "prepare": "node ./scripts/transpile-to-esm.mjs", + "prepare": "node ./scripts/transpile-to-esm.js", "size": "size-limit", "test": "tap", "snap": "tap", diff --git a/deps/npm/node_modules/minimatch/dist/cjs/_parse.js b/deps/npm/node_modules/minimatch/dist/cjs/_parse.js new file mode 100644 index 00000000000000..4387a26171dfe8 --- /dev/null +++ b/deps/npm/node_modules/minimatch/dist/cjs/_parse.js @@ -0,0 +1,300 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.parse = void 0; +// parse a single path portion +const brace_expressions_js_1 = require("./brace-expressions.js"); +const assert_valid_pattern_js_1 = require("./assert-valid-pattern.js"); +const globUnescape = (s) => s.replace(/\\(.)/g, '$1'); +const regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); +// "abc" -> { a:true, b:true, c:true } +const charSet = (s) => s.split('').reduce((set, c) => { + set[c] = true; + return set; +}, {}); +const plTypes = { + '!': { open: '(?:(?!(?:', close: '))[^/]*?)' }, + '?': { open: '(?:', close: ')?' }, + '+': { open: '(?:', close: ')+' }, + '*': { open: '(?:', close: ')*' }, + '@': { open: '(?:', close: ')' }, +}; +// characters that need to be escaped in RegExp. +const reSpecials = charSet('().*{}+?[]^$\\!'); +// characters that indicate we have to add the pattern start +const addPatternStartSet = charSet('[.('); +// any single thing other than / +// don't need to escape / when using new RegExp() +const qmark = '[^/]'; +// * => any number of characters +const star = qmark + '*?'; +// TODO: take an offset and length, so we can sub-parse the extglobs +const parse = (options, pattern, debug) => { + (0, assert_valid_pattern_js_1.assertValidPattern)(pattern); + if (pattern === '') + return ''; + let re = ''; + let hasMagic = false; + let escaping = false; + // ? => one single character + const patternListStack = []; + const negativeLists = []; + let stateChar = false; + let uflag = false; + let pl; + // . and .. never match anything that doesn't start with ., + // even when options.dot is set. However, if the pattern + // starts with ., then traversal patterns can match. + let dotTravAllowed = pattern.charAt(0) === '.'; + let dotFileAllowed = options.dot || dotTravAllowed; + const patternStart = () => dotTravAllowed + ? '' + : dotFileAllowed + ? '(?!(?:^|\\/)\\.{1,2}(?:$|\\/))' + : '(?!\\.)'; + const subPatternStart = (p) => p.charAt(0) === '.' + ? '' + : options.dot + ? '(?!(?:^|\\/)\\.{1,2}(?:$|\\/))' + : '(?!\\.)'; + const clearStateChar = () => { + if (stateChar) { + // we had some state-tracking character + // that wasn't consumed by this pass. + switch (stateChar) { + case '*': + re += star; + hasMagic = true; + break; + case '?': + re += qmark; + hasMagic = true; + break; + default: + re += '\\' + stateChar; + break; + } + debug('clearStateChar %j %j', stateChar, re); + stateChar = false; + } + }; + for (let i = 0, c; i < pattern.length && (c = pattern.charAt(i)); i++) { + debug('%s\t%s %s %j', pattern, i, re, c); + // skip over any that are escaped. + if (escaping) { + // completely not allowed, even escaped. + // should be impossible. + /* c8 ignore start */ + if (c === '/') { + return false; + } + /* c8 ignore stop */ + if (reSpecials[c]) { + re += '\\'; + } + re += c; + escaping = false; + continue; + } + switch (c) { + // Should already be path-split by now. + /* c8 ignore start */ + case '/': { + return false; + } + /* c8 ignore stop */ + case '\\': + clearStateChar(); + escaping = true; + continue; + // the various stateChar values + // for the "extglob" stuff. + case '?': + case '*': + case '+': + case '@': + case '!': + debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c); + // if we already have a stateChar, then it means + // that there was something like ** or +? in there. + // Handle the stateChar, then proceed with this one. + debug('call clearStateChar %j', stateChar); + clearStateChar(); + stateChar = c; + // if extglob is disabled, then +(asdf|foo) isn't a thing. + // just clear the statechar *now*, rather than even diving into + // the patternList stuff. + if (options.noext) + clearStateChar(); + continue; + case '(': { + if (!stateChar) { + re += '\\('; + continue; + } + const plEntry = { + type: stateChar, + start: i - 1, + reStart: re.length, + open: plTypes[stateChar].open, + close: plTypes[stateChar].close, + }; + debug(pattern, '\t', plEntry); + patternListStack.push(plEntry); + // negation is (?:(?!(?:js)(?:))[^/]*) + re += plEntry.open; + // next entry starts with a dot maybe? + if (plEntry.start === 0 && plEntry.type !== '!') { + dotTravAllowed = true; + re += subPatternStart(pattern.slice(i + 1)); + } + debug('plType %j %j', stateChar, re); + stateChar = false; + continue; + } + case ')': { + const plEntry = patternListStack[patternListStack.length - 1]; + if (!plEntry) { + re += '\\)'; + continue; + } + patternListStack.pop(); + // closing an extglob + clearStateChar(); + hasMagic = true; + pl = plEntry; + // negation is (?:(?!js)[^/]*) + // The others are (?:) + re += pl.close; + if (pl.type === '!') { + negativeLists.push(Object.assign(pl, { reEnd: re.length })); + } + continue; + } + case '|': { + const plEntry = patternListStack[patternListStack.length - 1]; + if (!plEntry) { + re += '\\|'; + continue; + } + clearStateChar(); + re += '|'; + // next subpattern can start with a dot? + if (plEntry.start === 0 && plEntry.type !== '!') { + dotTravAllowed = true; + re += subPatternStart(pattern.slice(i + 1)); + } + continue; + } + // these are mostly the same in regexp and glob + case '[': + // swallow any state-tracking char before the [ + clearStateChar(); + const [src, needUflag, consumed, magic] = (0, brace_expressions_js_1.parseClass)(pattern, i); + if (consumed) { + re += src; + uflag = uflag || needUflag; + i += consumed - 1; + hasMagic = hasMagic || magic; + } + else { + re += '\\['; + } + continue; + case ']': + re += '\\' + c; + continue; + default: + // swallow any state char that wasn't consumed + clearStateChar(); + re += regExpEscape(c); + break; + } // switch + } // for + // handle the case where we had a +( thing at the *end* + // of the pattern. + // each pattern list stack adds 3 chars, and we need to go through + // and escape any | chars that were passed through as-is for the regexp. + // Go through and escape them, taking care not to double-escape any + // | chars that were already escaped. + for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { + let tail; + tail = re.slice(pl.reStart + pl.open.length); + debug(pattern, 'setting tail', re, pl); + // maybe some even number of \, then maybe 1 \, followed by a | + tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, (_, $1, $2) => { + if (!$2) { + // the | isn't already escaped, so escape it. + $2 = '\\'; + // should already be done + /* c8 ignore start */ + } + /* c8 ignore stop */ + // need to escape all those slashes *again*, without escaping the + // one that we need for escaping the | character. As it works out, + // escaping an even number of slashes can be done by simply repeating + // it exactly after itself. That's why this trick works. + // + // I am sorry that you have to see this. + return $1 + $1 + $2 + '|'; + }); + debug('tail=%j\n %s', tail, tail, pl, re); + const t = pl.type === '*' ? star : pl.type === '?' ? qmark : '\\' + pl.type; + hasMagic = true; + re = re.slice(0, pl.reStart) + t + '\\(' + tail; + } + // handle trailing things that only matter at the very end. + clearStateChar(); + if (escaping) { + // trailing \\ + re += '\\\\'; + } + // only need to apply the nodot start if the re starts with + // something that could conceivably capture a dot + const addPatternStart = addPatternStartSet[re.charAt(0)]; + // Hack to work around lack of negative lookbehind in JS + // A pattern like: *.!(x).!(y|z) needs to ensure that a name + // like 'a.xyz.yz' doesn't match. So, the first negative + // lookahead, has to look ALL the way ahead, to the end of + // the pattern. + for (let n = negativeLists.length - 1; n > -1; n--) { + const nl = negativeLists[n]; + const nlBefore = re.slice(0, nl.reStart); + const nlFirst = re.slice(nl.reStart, nl.reEnd - 8); + let nlAfter = re.slice(nl.reEnd); + const nlLast = re.slice(nl.reEnd - 8, nl.reEnd) + nlAfter; + // Handle nested stuff like *(*.js|!(*.json)), where open parens + // mean that we should *not* include the ) in the bit that is considered + // "after" the negated section. + const closeParensBefore = nlBefore.split(')').length; + const openParensBefore = nlBefore.split('(').length - closeParensBefore; + let cleanAfter = nlAfter; + for (let i = 0; i < openParensBefore; i++) { + cleanAfter = cleanAfter.replace(/\)[+*?]?/, ''); + } + nlAfter = cleanAfter; + const dollar = nlAfter === '' ? '(?:$|\\/)' : ''; + re = nlBefore + nlFirst + nlAfter + dollar + nlLast; + } + // if the re is not "" at this point, then we need to make sure + // it doesn't match against an empty path part. + // Otherwise a/* will match a/, which it should not. + if (re !== '' && hasMagic) { + re = '(?=.)' + re; + } + if (addPatternStart) { + re = patternStart() + re; + } + // if it's nocase, and the lcase/uppercase don't match, it's magic + if (options.nocase && !hasMagic && !options.nocaseMagicOnly) { + hasMagic = pattern.toUpperCase() !== pattern.toLowerCase(); + } + // skip the regexp for non-magical patterns + // unescape anything in it, though, so that it'll be + // an exact match against a file etc. + if (!hasMagic) { + return globUnescape(re); + } + return re; +}; +exports.parse = parse; +//# sourceMappingURL=_parse.js.map \ No newline at end of file diff --git a/deps/npm/node_modules/minimatch/dist/cjs/assert-valid-pattern.js b/deps/npm/node_modules/minimatch/dist/cjs/assert-valid-pattern.js new file mode 100644 index 00000000000000..5fc86bbd0116c9 --- /dev/null +++ b/deps/npm/node_modules/minimatch/dist/cjs/assert-valid-pattern.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.assertValidPattern = void 0; +const MAX_PATTERN_LENGTH = 1024 * 64; +const assertValidPattern = (pattern) => { + if (typeof pattern !== 'string') { + throw new TypeError('invalid pattern'); + } + if (pattern.length > MAX_PATTERN_LENGTH) { + throw new TypeError('pattern is too long'); + } +}; +exports.assertValidPattern = assertValidPattern; +//# sourceMappingURL=assert-valid-pattern.js.map \ No newline at end of file diff --git a/deps/npm/node_modules/minimatch/dist/cjs/brace-expressions.js b/deps/npm/node_modules/minimatch/dist/cjs/brace-expressions.js new file mode 100644 index 00000000000000..0e13eefc4cfee2 --- /dev/null +++ b/deps/npm/node_modules/minimatch/dist/cjs/brace-expressions.js @@ -0,0 +1,152 @@ +"use strict"; +// translate the various posix character classes into unicode properties +// this works across all unicode locales +Object.defineProperty(exports, "__esModule", { value: true }); +exports.parseClass = void 0; +// { : [, /u flag required, negated] +const posixClasses = { + '[:alnum:]': ['\\p{L}\\p{Nl}\\p{Nd}', true], + '[:alpha:]': ['\\p{L}\\p{Nl}', true], + '[:ascii:]': ['\\x' + '00-\\x' + '7f', false], + '[:blank:]': ['\\p{Zs}\\t', true], + '[:cntrl:]': ['\\p{Cc}', true], + '[:digit:]': ['\\p{Nd}', true], + '[:graph:]': ['\\p{Z}\\p{C}', true, true], + '[:lower:]': ['\\p{Ll}', true], + '[:print:]': ['\\p{C}', true], + '[:punct:]': ['\\p{P}', true], + '[:space:]': ['\\p{Z}\\t\\r\\n\\v\\f', true], + '[:upper:]': ['\\p{Lu}', true], + '[:word:]': ['\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}', true], + '[:xdigit:]': ['A-Fa-f0-9', false], +}; +// only need to escape a few things inside of brace expressions +// escapes: [ \ ] - +const braceEscape = (s) => s.replace(/[[\]\\-]/g, '\\$&'); +// escape all regexp magic characters +const regexpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); +// everything has already been escaped, we just have to join +const rangesToString = (ranges) => ranges.join(''); +// takes a glob string at a posix brace expression, and returns +// an equivalent regular expression source, and boolean indicating +// whether the /u flag needs to be applied, and the number of chars +// consumed to parse the character class. +// This also removes out of order ranges, and returns ($.) if the +// entire class just no good. +const parseClass = (glob, position) => { + const pos = position; + /* c8 ignore start */ + if (glob.charAt(pos) !== '[') { + throw new Error('not in a brace expression'); + } + /* c8 ignore stop */ + const ranges = []; + const negs = []; + let i = pos + 1; + let sawStart = false; + let uflag = false; + let escaping = false; + let negate = false; + let endPos = pos; + let rangeStart = ''; + WHILE: while (i < glob.length) { + const c = glob.charAt(i); + if ((c === '!' || c === '^') && i === pos + 1) { + negate = true; + i++; + continue; + } + if (c === ']' && sawStart && !escaping) { + endPos = i + 1; + break; + } + sawStart = true; + if (c === '\\') { + if (!escaping) { + escaping = true; + i++; + continue; + } + // escaped \ char, fall through and treat like normal char + } + if (c === '[' && !escaping) { + // either a posix class, a collation equivalent, or just a [ + for (const [cls, [unip, u, neg]] of Object.entries(posixClasses)) { + if (glob.startsWith(cls, i)) { + // invalid, [a-[] is fine, but not [a-[:alpha]] + if (rangeStart) { + return ['$.', false, glob.length - pos, true]; + } + i += cls.length; + if (neg) + negs.push(unip); + else + ranges.push(unip); + uflag = uflag || u; + continue WHILE; + } + } + } + // now it's just a normal character, effectively + escaping = false; + if (rangeStart) { + // throw this range away if it's not valid, but others + // can still match. + if (c > rangeStart) { + ranges.push(braceEscape(rangeStart) + '-' + braceEscape(c)); + } + else if (c === rangeStart) { + ranges.push(braceEscape(c)); + } + rangeStart = ''; + i++; + continue; + } + // now might be the start of a range. + // can be either c-d or c-] or c] or c] at this point + if (glob.startsWith('-]', i + 1)) { + ranges.push(braceEscape(c + '-')); + i += 2; + continue; + } + if (glob.startsWith('-', i + 1)) { + rangeStart = c; + i += 2; + continue; + } + // not the start of a range, just a single character + ranges.push(braceEscape(c)); + i++; + } + if (endPos < i) { + // didn't see the end of the class, not a valid class, + // but might still be valid as a literal match. + return ['', false, 0, false]; + } + // if we got no ranges and no negates, then we have a range that + // cannot possibly match anything, and that poisons the whole glob + if (!ranges.length && !negs.length) { + return ['$.', false, glob.length - pos, true]; + } + // if we got one positive range, and it's a single character, then that's + // not actually a magic pattern, it's just that one literal character. + // we should not treat that as "magic", we should just return the literal + // character. [_] is a perfectly valid way to escape glob magic chars. + if (negs.length === 0 && + ranges.length === 1 && + /^\\?.$/.test(ranges[0]) && + !negate) { + const r = ranges[0].length === 2 ? ranges[0].slice(-1) : ranges[0]; + return [regexpEscape(r), false, endPos - pos, false]; + } + const sranges = '[' + (negate ? '^' : '') + rangesToString(ranges) + ']'; + const snegs = '[' + (negate ? '' : '^') + rangesToString(negs) + ']'; + const comb = ranges.length && negs.length + ? '(' + sranges + '|' + snegs + ')' + : ranges.length + ? sranges + : snegs; + return [comb, uflag, endPos - pos, true]; +}; +exports.parseClass = parseClass; +//# sourceMappingURL=brace-expressions.js.map \ No newline at end of file diff --git a/deps/npm/node_modules/minimatch/dist/cjs/escape.js b/deps/npm/node_modules/minimatch/dist/cjs/escape.js new file mode 100644 index 00000000000000..02a4f8a8e0a588 --- /dev/null +++ b/deps/npm/node_modules/minimatch/dist/cjs/escape.js @@ -0,0 +1,22 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.escape = void 0; +/** + * Escape all magic characters in a glob pattern. + * + * If the {@link windowsPathsNoEscape | GlobOptions.windowsPathsNoEscape} + * option is used, then characters are escaped by wrapping in `[]`, because + * a magic character wrapped in a character class can only be satisfied by + * that exact character. In this mode, `\` is _not_ escaped, because it is + * not interpreted as a magic character, but instead as a path separator. + */ +const escape = (s, { windowsPathsNoEscape = false, } = {}) => { + // don't need to escape +@! because we escape the parens + // that make those magic, and escaping ! as [!] isn't valid, + // because [!]] is a valid glob class meaning not ']'. + return windowsPathsNoEscape + ? s.replace(/[?*()[\]]/g, '[$&]') + : s.replace(/[?*()[\]\\]/g, '\\$&'); +}; +exports.escape = escape; +//# sourceMappingURL=escape.js.map \ No newline at end of file diff --git a/deps/npm/node_modules/minimatch/dist/cjs/extglob.js b/deps/npm/node_modules/minimatch/dist/cjs/extglob.js new file mode 100644 index 00000000000000..8d7607b7f7ead4 --- /dev/null +++ b/deps/npm/node_modules/minimatch/dist/cjs/extglob.js @@ -0,0 +1,4 @@ +"use strict"; +// translate an extglob into a regular expression +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=extglob.js.map \ No newline at end of file diff --git a/deps/npm/node_modules/minimatch/dist/cjs/index-cjs.d.ts b/deps/npm/node_modules/minimatch/dist/cjs/index-cjs.d.ts deleted file mode 100644 index 29fdd1d95838fd..00000000000000 --- a/deps/npm/node_modules/minimatch/dist/cjs/index-cjs.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -declare const _default: { - (p: string, pattern: string, options?: import("./index.js").MinimatchOptions): boolean; - sep: string; - GLOBSTAR: typeof import("./index.js").GLOBSTAR; - filter: (pattern: string, options?: import("./index.js").MinimatchOptions) => (p: string) => boolean; - defaults: (def: import("./index.js").MinimatchOptions) => any; - braceExpand: (pattern: string, options?: import("./index.js").MinimatchOptions) => string[]; - makeRe: (pattern: string, options?: import("./index.js").MinimatchOptions) => false | import("./index.js").MMRegExp; - match: (list: string[], pattern: string, options?: import("./index.js").MinimatchOptions) => string[]; - Minimatch: typeof import("./index.js").Minimatch; -} & { - default: { - (p: string, pattern: string, options?: import("./index.js").MinimatchOptions): boolean; - sep: string; - GLOBSTAR: typeof import("./index.js").GLOBSTAR; - filter: (pattern: string, options?: import("./index.js").MinimatchOptions) => (p: string) => boolean; - defaults: (def: import("./index.js").MinimatchOptions) => any; - braceExpand: (pattern: string, options?: import("./index.js").MinimatchOptions) => string[]; - makeRe: (pattern: string, options?: import("./index.js").MinimatchOptions) => false | import("./index.js").MMRegExp; - match: (list: string[], pattern: string, options?: import("./index.js").MinimatchOptions) => string[]; - Minimatch: typeof import("./index.js").Minimatch; - }; - minimatch: { - (p: string, pattern: string, options?: import("./index.js").MinimatchOptions): boolean; - sep: string; - GLOBSTAR: typeof import("./index.js").GLOBSTAR; - filter: (pattern: string, options?: import("./index.js").MinimatchOptions) => (p: string) => boolean; - defaults: (def: import("./index.js").MinimatchOptions) => any; - braceExpand: (pattern: string, options?: import("./index.js").MinimatchOptions) => string[]; - makeRe: (pattern: string, options?: import("./index.js").MinimatchOptions) => false | import("./index.js").MMRegExp; - match: (list: string[], pattern: string, options?: import("./index.js").MinimatchOptions) => string[]; - Minimatch: typeof import("./index.js").Minimatch; - }; -}; -export = _default; diff --git a/deps/npm/node_modules/minimatch/dist/cjs/index-cjs.js.map b/deps/npm/node_modules/minimatch/dist/cjs/index-cjs.js.map deleted file mode 100644 index 1a054859a1341b..00000000000000 --- a/deps/npm/node_modules/minimatch/dist/cjs/index-cjs.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index-cjs.js","sourceRoot":"","sources":["../../src/index-cjs.ts"],"names":[],"mappings":";;;;AAAA,0DAAkC;AAElC,iBAAS,MAAM,CAAC,MAAM,CAAC,kBAAS,EAAE,EAAE,OAAO,EAAE,kBAAS,EAAE,SAAS,EAAT,kBAAS,EAAE,CAAC,CAAA"} \ No newline at end of file diff --git a/deps/npm/node_modules/minimatch/dist/cjs/index.d.ts b/deps/npm/node_modules/minimatch/dist/cjs/index.d.ts deleted file mode 100644 index cca07a8280d896..00000000000000 --- a/deps/npm/node_modules/minimatch/dist/cjs/index.d.ts +++ /dev/null @@ -1,71 +0,0 @@ -export interface MinimatchOptions { - nobrace?: boolean; - nocomment?: boolean; - nonegate?: boolean; - debug?: boolean; - noglobstar?: boolean; - noext?: boolean; - nonull?: boolean; - windowsPathsNoEscape?: boolean; - allowWindowsEscape?: boolean; - partial?: boolean; - dot?: boolean; - nocase?: boolean; - nocaseMagicOnly?: boolean; - matchBase?: boolean; - flipNegate?: boolean; - preserveMultipleSlashes?: boolean; -} -export declare const minimatch: { - (p: string, pattern: string, options?: MinimatchOptions): boolean; - sep: string; - GLOBSTAR: typeof GLOBSTAR; - filter: (pattern: string, options?: MinimatchOptions) => (p: string) => boolean; - defaults: (def: MinimatchOptions) => typeof minimatch; - braceExpand: (pattern: string, options?: MinimatchOptions) => string[]; - makeRe: (pattern: string, options?: MinimatchOptions) => false | MMRegExp; - match: (list: string[], pattern: string, options?: MinimatchOptions) => string[]; - Minimatch: typeof Minimatch; -}; -export default minimatch; -export declare const sep: string; -export declare const GLOBSTAR: unique symbol; -export declare const filter: (pattern: string, options?: MinimatchOptions) => (p: string) => boolean; -export declare const defaults: (def: MinimatchOptions) => typeof minimatch; -export declare const braceExpand: (pattern: string, options?: MinimatchOptions) => string[]; -declare const SUBPARSE: unique symbol; -export declare const makeRe: (pattern: string, options?: MinimatchOptions) => false | MMRegExp; -export declare const match: (list: string[], pattern: string, options?: MinimatchOptions) => string[]; -export type MMRegExp = RegExp & { - _src?: string; - _glob?: string; -}; -type SubparseReturn = [string, boolean]; -type ParseReturnFiltered = string | MMRegExp | typeof GLOBSTAR; -type ParseReturn = ParseReturnFiltered | false; -export declare class Minimatch { - options: MinimatchOptions; - set: ParseReturnFiltered[][]; - pattern: string; - windowsPathsNoEscape: boolean; - nonegate: boolean; - negate: boolean; - comment: boolean; - empty: boolean; - preserveMultipleSlashes: boolean; - partial: boolean; - globSet: string[]; - globParts: string[][]; - regexp: false | null | MMRegExp; - constructor(pattern: string, options?: MinimatchOptions); - debug(..._: any[]): void; - make(): void; - parseNegate(): void; - matchOne(file: string[], pattern: ParseReturn[], partial?: boolean): boolean; - braceExpand(): string[]; - parse(pattern: string, isSub?: typeof SUBPARSE): ParseReturn | SubparseReturn; - makeRe(): false | MMRegExp; - slashSplit(p: string): string[]; - match(f: string, partial?: boolean): boolean; - static defaults(def: MinimatchOptions): typeof Minimatch; -} diff --git a/deps/npm/node_modules/minimatch/dist/cjs/index.js b/deps/npm/node_modules/minimatch/dist/cjs/index.js index 63fc3bdd0b109a..3bb6c3dee58b86 100644 --- a/deps/npm/node_modules/minimatch/dist/cjs/index.js +++ b/deps/npm/node_modules/minimatch/dist/cjs/index.js @@ -3,7 +3,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); -exports.Minimatch = exports.match = exports.makeRe = exports.braceExpand = exports.defaults = exports.filter = exports.GLOBSTAR = exports.sep = exports.minimatch = void 0; +exports.unescape = exports.escape = exports.Minimatch = exports.match = exports.makeRe = exports.braceExpand = exports.defaults = exports.filter = exports.GLOBSTAR = exports.sep = exports.minimatch = void 0; +const brace_expansion_1 = __importDefault(require("brace-expansion")); +const brace_expressions_js_1 = require("./brace-expressions.js"); +const escape_js_1 = require("./escape.js"); +const unescape_js_1 = require("./unescape.js"); const minimatch = (p, pattern, options = {}) => { assertValidPattern(pattern); // shortcut: comments match nothing. @@ -66,20 +70,21 @@ const qmarksTestNoExtDot = ([$0]) => { return (f) => f.length === len && f !== '.' && f !== '..'; }; /* c8 ignore start */ -const platform = typeof process === 'object' && process +const defaultPlatform = (typeof process === 'object' && process ? (typeof process.env === 'object' && process.env && process.env.__MINIMATCH_TESTING_PLATFORM__) || process.platform - : 'posix'; -const isWindows = platform === 'win32'; -const path = isWindows ? { sep: '\\' } : { sep: '/' }; + : 'posix'); +const path = { + win32: { sep: '\\' }, + posix: { sep: '/' }, +}; /* c8 ignore stop */ -exports.sep = path.sep; +exports.sep = defaultPlatform === 'win32' ? path.win32.sep : path.posix.sep; exports.minimatch.sep = exports.sep; exports.GLOBSTAR = Symbol('globstar **'); exports.minimatch.GLOBSTAR = exports.GLOBSTAR; -const brace_expansion_1 = __importDefault(require("brace-expansion")); const plTypes = { '!': { open: '(?:(?!(?:', close: '))[^/]*?)' }, '?': { open: '(?:', close: ')?' }, @@ -127,6 +132,8 @@ const defaults = (def) => { return orig.defaults(ext(def, options)).Minimatch; } }, + unescape: (s, options = {}) => orig.unescape(s, ext(def, options)), + escape: (s, options = {}) => orig.escape(s, ext(def, options)), filter: (pattern, options = {}) => orig.filter(pattern, ext(def, options)), defaults: (options) => orig.defaults(ext(def, options)), makeRe: (pattern, options = {}) => orig.makeRe(pattern, ext(def, options)), @@ -180,7 +187,6 @@ const assertValidPattern = (pattern) => { // when it is the *only* thing in a path portion. Otherwise, any series // of * is equivalent to a single *. Globstar behavior is enabled by // default, and can be disabled by setting options.noglobstar. -const SUBPARSE = Symbol('subparse'); const makeRe = (pattern, options = {}) => new Minimatch(pattern, options).makeRe(); exports.makeRe = makeRe; exports.minimatch.makeRe = exports.makeRe; @@ -196,9 +202,8 @@ exports.match = match; exports.minimatch.match = exports.match; // replace stuff like \* with * const globUnescape = (s) => s.replace(/\\(.)/g, '$1'); -const charUnescape = (s) => s.replace(/\\([^-\]])/g, '$1'); +const globMagic = /[?*]|[+@!]\(.*?\)|\[|\]/; const regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); -const braExpEscape = (s) => s.replace(/[[\]\\]/g, '\\$&'); class Minimatch { options; set; @@ -212,12 +217,18 @@ class Minimatch { partial; globSet; globParts; + nocase; + isWindows; + platform; + windowsNoMagicRoot; regexp; constructor(pattern, options = {}) { assertValidPattern(pattern); options = options || {}; this.options = options; this.pattern = pattern; + this.platform = options.platform || defaultPlatform; + this.isWindows = this.platform === 'win32'; this.windowsPathsNoEscape = !!options.windowsPathsNoEscape || options.allowWindowsEscape === false; if (this.windowsPathsNoEscape) { @@ -230,12 +241,29 @@ class Minimatch { this.comment = false; this.empty = false; this.partial = !!options.partial; + this.nocase = !!this.options.nocase; + this.windowsNoMagicRoot = + options.windowsNoMagicRoot !== undefined + ? options.windowsNoMagicRoot + : !!(this.isWindows && this.nocase); this.globSet = []; this.globParts = []; this.set = []; // make the set of regexps etc. this.make(); } + hasMagic() { + if (this.options.magicalBraces && this.set.length > 1) { + return true; + } + for (const pattern of this.set) { + for (const part of pattern) { + if (typeof part !== 'string') + return true; + } + } + return false; + } debug(..._) { } make() { const pattern = this.pattern; @@ -252,73 +280,46 @@ class Minimatch { // step 1: figure out negation, etc. this.parseNegate(); // step 2: expand braces - this.globSet = this.braceExpand(); + this.globSet = [...new Set(this.braceExpand())]; if (options.debug) { this.debug = (...args) => console.error(...args); } this.debug(this.pattern, this.globSet); - // step 3: now we have a set, so turn each one into a series of path-portion - // matching patterns. + // step 3: now we have a set, so turn each one into a series of + // path-portion matching patterns. // These will be regexps, except in the case of "**", which is // set to the GLOBSTAR object for globstar behavior, // and will not contain any / characters + // + // First, we preprocess to make the glob pattern sets a bit simpler + // and deduped. There are some perf-killing patterns that can cause + // problems with a glob walk, but we can simplify them down a bit. const rawGlobParts = this.globSet.map(s => this.slashSplit(s)); - // consecutive globstars are an unncessary perf killer - // also, **/*/... is equivalent to */**/..., so swap all of those - // this turns a pattern like **/*/**/*/x into */*/**/x - // and a pattern like **/x/**/*/y becomes **/x/*/**/y - // the *later* we can push the **, the more efficient it is, - // because we can avoid having to do a recursive walk until - // the walked tree is as shallow as possible. - // Note that this is only true up to the last pattern, though, because - // a/*/** will only match a/b if b is a dir, but a/**/* will match a/b - // regardless, since it's "0 or more path segments" if it's not final. - if (this.options.noglobstar) { - // ** is * anyway - this.globParts = rawGlobParts; - } - else { - // do this swap BEFORE the reduce, so that we can turn a string - // of **/*/**/* into */*/**/** and then reduce the **'s into one - for (const parts of rawGlobParts) { - let swapped; - do { - swapped = false; - for (let i = 0; i < parts.length - 1; i++) { - if (parts[i] === '*' && parts[i - 1] === '**') { - parts[i] = '**'; - parts[i - 1] = '*'; - swapped = true; - } - } - } while (swapped); - } - this.globParts = rawGlobParts.map(parts => { - parts = parts.reduce((set, part) => { - const prev = set[set.length - 1]; - if (part === '**' && prev === '**') { - return set; - } - if (part === '..') { - if (prev && prev !== '..' && prev !== '.' && prev !== '**') { - set.pop(); - return set; - } - } - set.push(part); - return set; - }, []); - return parts.length === 0 ? [''] : parts; - }); - } + this.globParts = this.preprocess(rawGlobParts); this.debug(this.pattern, this.globParts); // glob --> regexps - let set = this.globParts.map((s, _, __) => s.map(ss => this.parse(ss))); + let set = this.globParts.map((s, _, __) => { + if (this.isWindows && this.windowsNoMagicRoot) { + // check if it's a drive or unc path. + const isUNC = s[0] === '' && + s[1] === '' && + (s[2] === '?' || !globMagic.test(s[2])) && + !globMagic.test(s[3]); + const isDrive = /^[a-z]:/i.test(s[0]); + if (isUNC) { + return [...s.slice(0, 4), ...s.slice(4).map(ss => this.parse(ss))]; + } + else if (isDrive) { + return [s[0], ...s.slice(1).map(ss => this.parse(ss))]; + } + } + return s.map(ss => this.parse(ss)); + }); this.debug(this.pattern, set); // filter out everything that didn't compile properly. this.set = set.filter(s => s.indexOf(false) === -1); // do not treat the ? in UNC paths as magic - if (isWindows) { + if (this.isWindows) { for (let i = 0; i < this.set.length; i++) { const p = this.set[i]; if (p[0] === '' && @@ -332,6 +333,276 @@ class Minimatch { } this.debug(this.pattern, this.set); } + // various transforms to equivalent pattern sets that are + // faster to process in a filesystem walk. The goal is to + // eliminate what we can, and push all ** patterns as far + // to the right as possible, even if it increases the number + // of patterns that we have to process. + preprocess(globParts) { + // if we're not in globstar mode, then turn all ** into * + if (this.options.noglobstar) { + for (let i = 0; i < globParts.length; i++) { + for (let j = 0; j < globParts[i].length; j++) { + if (globParts[i][j] === '**') { + globParts[i][j] = '*'; + } + } + } + } + const { optimizationLevel = 1 } = this.options; + if (optimizationLevel >= 2) { + // aggressive optimization for the purpose of fs walking + globParts = this.firstPhasePreProcess(globParts); + globParts = this.secondPhasePreProcess(globParts); + } + else if (optimizationLevel >= 1) { + // just basic optimizations to remove some .. parts + globParts = this.levelOneOptimize(globParts); + } + else { + globParts = this.adjascentGlobstarOptimize(globParts); + } + return globParts; + } + // just get rid of adjascent ** portions + adjascentGlobstarOptimize(globParts) { + return globParts.map(parts => { + let gs = -1; + while (-1 !== (gs = parts.indexOf('**', gs + 1))) { + let i = gs; + while (parts[i + 1] === '**') { + i++; + } + if (i !== gs) { + parts.splice(gs, i - gs); + } + } + return parts; + }); + } + // get rid of adjascent ** and resolve .. portions + levelOneOptimize(globParts) { + return globParts.map(parts => { + parts = parts.reduce((set, part) => { + const prev = set[set.length - 1]; + if (part === '**' && prev === '**') { + return set; + } + if (part === '..') { + if (prev && prev !== '..' && prev !== '.' && prev !== '**') { + set.pop(); + return set; + } + } + set.push(part); + return set; + }, []); + return parts.length === 0 ? [''] : parts; + }); + } + levelTwoFileOptimize(parts) { + if (!Array.isArray(parts)) { + parts = this.slashSplit(parts); + } + let didSomething = false; + do { + didSomething = false; + //
    // -> 
    /
    +            if (!this.preserveMultipleSlashes) {
    +                for (let i = 1; i < parts.length - 1; i++) {
    +                    const p = parts[i];
    +                    // don't squeeze out UNC patterns
    +                    if (i === 1 && p === '' && parts[0] === '')
    +                        continue;
    +                    if (p === '.' || p === '') {
    +                        didSomething = true;
    +                        parts.splice(i, 1);
    +                        i--;
    +                    }
    +                }
    +                if (parts[0] === '.' &&
    +                    parts.length === 2 &&
    +                    (parts[1] === '.' || parts[1] === '')) {
    +                    didSomething = true;
    +                    parts.pop();
    +                }
    +            }
    +            // 
    /

    /../ ->

    /
    +            let dd = 0;
    +            while (-1 !== (dd = parts.indexOf('..', dd + 1))) {
    +                const p = parts[dd - 1];
    +                if (p && p !== '.' && p !== '..' && p !== '**') {
    +                    didSomething = true;
    +                    parts.splice(dd - 1, 2);
    +                    dd -= 2;
    +                }
    +            }
    +        } while (didSomething);
    +        return parts.length === 0 ? [''] : parts;
    +    }
    +    // First phase: single-pattern processing
    +    // 
     is 1 or more portions
    +    //  is 1 or more portions
    +    // 

    is any portion other than ., .., '', or ** + // is . or '' + // + // **/.. is *brutal* for filesystem walking performance, because + // it effectively resets the recursive walk each time it occurs, + // and ** cannot be reduced out by a .. pattern part like a regexp + // or most strings (other than .., ., and '') can be. + // + //

    /**/../

    /

    / -> {

    /../

    /

    /,

    /**/

    /

    /} + //

    // -> 
    /
    +    // 
    /

    /../ ->

    /
    +    // **/**/ -> **/
    +    //
    +    // **/*/ -> */**/ <== not valid because ** doesn't follow
    +    // this WOULD be allowed if ** did follow symlinks, or * didn't
    +    firstPhasePreProcess(globParts) {
    +        let didSomething = false;
    +        do {
    +            didSomething = false;
    +            // 
    /**/../

    /

    / -> {

    /../

    /

    /,

    /**/

    /

    /} + for (let parts of globParts) { + let gs = -1; + while (-1 !== (gs = parts.indexOf('**', gs + 1))) { + let gss = gs; + while (parts[gss + 1] === '**') { + //

    /**/**/ -> 
    /**/
    +                        gss++;
    +                    }
    +                    // eg, if gs is 2 and gss is 4, that means we have 3 **
    +                    // parts, and can remove 2 of them.
    +                    if (gss > gs) {
    +                        parts.splice(gs + 1, gss - gs);
    +                    }
    +                    let next = parts[gs + 1];
    +                    const p = parts[gs + 2];
    +                    const p2 = parts[gs + 3];
    +                    if (next !== '..')
    +                        continue;
    +                    if (!p ||
    +                        p === '.' ||
    +                        p === '..' ||
    +                        !p2 ||
    +                        p2 === '.' ||
    +                        p2 === '..') {
    +                        continue;
    +                    }
    +                    didSomething = true;
    +                    // edit parts in place, and push the new one
    +                    parts.splice(gs, 1);
    +                    const other = parts.slice(0);
    +                    other[gs] = '**';
    +                    globParts.push(other);
    +                    gs--;
    +                }
    +                // 
    // -> 
    /
    +                if (!this.preserveMultipleSlashes) {
    +                    for (let i = 1; i < parts.length - 1; i++) {
    +                        const p = parts[i];
    +                        // don't squeeze out UNC patterns
    +                        if (i === 1 && p === '' && parts[0] === '')
    +                            continue;
    +                        if (p === '.' || p === '') {
    +                            didSomething = true;
    +                            parts.splice(i, 1);
    +                            i--;
    +                        }
    +                    }
    +                    if (parts[0] === '.' &&
    +                        parts.length === 2 &&
    +                        (parts[1] === '.' || parts[1] === '')) {
    +                        didSomething = true;
    +                        parts.pop();
    +                    }
    +                }
    +                // 
    /

    /../ ->

    /
    +                let dd = 0;
    +                while (-1 !== (dd = parts.indexOf('..', dd + 1))) {
    +                    const p = parts[dd - 1];
    +                    if (p && p !== '.' && p !== '..' && p !== '**') {
    +                        didSomething = true;
    +                        const needDot = dd === 1 && parts[dd + 1] === '**';
    +                        const splin = needDot ? ['.'] : [];
    +                        parts.splice(dd - 1, 2, ...splin);
    +                        if (parts.length === 0)
    +                            parts.push('');
    +                        dd -= 2;
    +                    }
    +                }
    +            }
    +        } while (didSomething);
    +        return globParts;
    +    }
    +    // second phase: multi-pattern dedupes
    +    // {
    /*/,
    /

    /} ->

    /*/
    +    // {
    /,
    /} -> 
    /
    +    // {
    /**/,
    /} -> 
    /**/
    +    //
    +    // {
    /**/,
    /**/

    /} ->

    /**/
    +    // ^-- not valid because ** doens't follow symlinks
    +    secondPhasePreProcess(globParts) {
    +        for (let i = 0; i < globParts.length - 1; i++) {
    +            for (let j = i + 1; j < globParts.length; j++) {
    +                const matched = this.partsMatch(globParts[i], globParts[j], !this.preserveMultipleSlashes);
    +                if (!matched)
    +                    continue;
    +                globParts[i] = matched;
    +                globParts[j] = [];
    +            }
    +        }
    +        return globParts.filter(gs => gs.length);
    +    }
    +    partsMatch(a, b, emptyGSMatch = false) {
    +        let ai = 0;
    +        let bi = 0;
    +        let result = [];
    +        let which = '';
    +        while (ai < a.length && bi < b.length) {
    +            if (a[ai] === b[bi]) {
    +                result.push(which === 'b' ? b[bi] : a[ai]);
    +                ai++;
    +                bi++;
    +            }
    +            else if (emptyGSMatch && a[ai] === '**' && b[bi] === a[ai + 1]) {
    +                result.push(a[ai]);
    +                ai++;
    +            }
    +            else if (emptyGSMatch && b[bi] === '**' && a[ai] === b[bi + 1]) {
    +                result.push(b[bi]);
    +                bi++;
    +            }
    +            else if (a[ai] === '*' &&
    +                b[bi] &&
    +                (this.options.dot || !b[bi].startsWith('.')) &&
    +                b[bi] !== '**') {
    +                if (which === 'b')
    +                    return false;
    +                which = 'a';
    +                result.push(a[ai]);
    +                ai++;
    +                bi++;
    +            }
    +            else if (b[bi] === '*' &&
    +                a[ai] &&
    +                (this.options.dot || !a[ai].startsWith('.')) &&
    +                a[ai] !== '**') {
    +                if (which === 'a')
    +                    return false;
    +                which = 'b';
    +                result.push(b[bi]);
    +                ai++;
    +                bi++;
    +            }
    +            else {
    +                return false;
    +            }
    +        }
    +        // if we fall out of the loop, it means they two are identical
    +        // as long as their lengths match
    +        return a.length === b.length && result;
    +    }
         parseNegate() {
             if (this.nonegate)
                 return;
    @@ -355,7 +626,7 @@ class Minimatch {
             const options = this.options;
             // a UNC pattern like //?/c:/* can match a path like c:/x
             // and vice versa
    -        if (isWindows) {
    +        if (this.isWindows) {
                 const fileUNC = file[0] === '' &&
                     file[1] === '' &&
                     file[2] === '?' &&
    @@ -389,6 +660,12 @@ class Minimatch {
                     }
                 }
             }
    +        // resolve and reduce . and .. portions in the file as well.
    +        // dont' need to do the second phase, because it's only one string[]
    +        const { optimizationLevel = 1 } = this.options;
    +        if (optimizationLevel >= 2) {
    +            file = this.levelTwoFileOptimize(file);
    +        }
             this.debug('matchOne', this, { file, pattern });
             this.debug('matchOne', file.length, pattern.length);
             for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
    @@ -536,50 +813,44 @@ class Minimatch {
         braceExpand() {
             return (0, exports.braceExpand)(this.pattern, this.options);
         }
    -    parse(pattern, isSub) {
    +    parse(pattern) {
             assertValidPattern(pattern);
             const options = this.options;
             // shortcuts
    -        if (pattern === '**') {
    -            if (!options.noglobstar)
    -                return exports.GLOBSTAR;
    -            else
    -                pattern = '*';
    -        }
    +        if (pattern === '**')
    +            return exports.GLOBSTAR;
             if (pattern === '')
                 return '';
             // far and away, the most common glob pattern parts are
             // *, *.*, and *.  Add a fast check method for those.
             let m;
             let fastTest = null;
    -        if (isSub !== SUBPARSE) {
    -            if ((m = pattern.match(starRE))) {
    -                fastTest = options.dot ? starTestDot : starTest;
    -            }
    -            else if ((m = pattern.match(starDotExtRE))) {
    -                fastTest = (options.nocase
    -                    ? options.dot
    -                        ? starDotExtTestNocaseDot
    -                        : starDotExtTestNocase
    -                    : options.dot
    -                        ? starDotExtTestDot
    -                        : starDotExtTest)(m[1]);
    -            }
    -            else if ((m = pattern.match(qmarksRE))) {
    -                fastTest = (options.nocase
    -                    ? options.dot
    -                        ? qmarksTestNocaseDot
    -                        : qmarksTestNocase
    -                    : options.dot
    -                        ? qmarksTestDot
    -                        : qmarksTest)(m);
    -            }
    -            else if ((m = pattern.match(starDotStarRE))) {
    -                fastTest = options.dot ? starDotStarTestDot : starDotStarTest;
    -            }
    -            else if ((m = pattern.match(dotStarRE))) {
    -                fastTest = dotStarTest;
    -            }
    +        if ((m = pattern.match(starRE))) {
    +            fastTest = options.dot ? starTestDot : starTest;
    +        }
    +        else if ((m = pattern.match(starDotExtRE))) {
    +            fastTest = (options.nocase
    +                ? options.dot
    +                    ? starDotExtTestNocaseDot
    +                    : starDotExtTestNocase
    +                : options.dot
    +                    ? starDotExtTestDot
    +                    : starDotExtTest)(m[1]);
    +        }
    +        else if ((m = pattern.match(qmarksRE))) {
    +            fastTest = (options.nocase
    +                ? options.dot
    +                    ? qmarksTestNocaseDot
    +                    : qmarksTestNocase
    +                : options.dot
    +                    ? qmarksTestDot
    +                    : qmarksTest)(m);
    +        }
    +        else if ((m = pattern.match(starDotStarRE))) {
    +            fastTest = options.dot ? starDotStarTestDot : starDotStarTest;
    +        }
    +        else if ((m = pattern.match(dotStarRE))) {
    +            fastTest = dotStarTest;
             }
             let re = '';
             let hasMagic = false;
    @@ -588,12 +859,8 @@ class Minimatch {
             const patternListStack = [];
             const negativeLists = [];
             let stateChar = false;
    -        let inClass = false;
    -        let reClassStart = -1;
    -        let classStart = -1;
    -        let cs;
    +        let uflag = false;
             let pl;
    -        let sp;
             // . and .. never match anything that doesn't start with .,
             // even when options.dot is set.  However, if the pattern
             // starts with ., then traversal patterns can match.
    @@ -656,10 +923,6 @@ class Minimatch {
                     }
                     /* c8 ignore stop */
                     case '\\':
    -                    if (inClass && pattern.charAt(i + 1) === '-') {
    -                        re += c;
    -                        continue;
    -                    }
                         clearStateChar();
                         escaping = true;
                         continue;
    @@ -671,15 +934,6 @@ class Minimatch {
                     case '@':
                     case '!':
                         this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c);
    -                    // all of those are literals inside a class, except that
    -                    // the glob [!a] means [^a] in regexp
    -                    if (inClass) {
    -                        this.debug('  in class');
    -                        if (c === '!' && i === classStart + 1)
    -                            c = '^';
    -                        re += c;
    -                        continue;
    -                    }
                         // if we already have a stateChar, then it means
                         // that there was something like ** or +? in there.
                         // Handle the stateChar, then proceed with this one.
    @@ -693,10 +947,6 @@ class Minimatch {
                             clearStateChar();
                         continue;
                     case '(': {
    -                    if (inClass) {
    -                        re += '(';
    -                        continue;
    -                    }
                         if (!stateChar) {
                             re += '\\(';
                             continue;
    @@ -723,7 +973,7 @@ class Minimatch {
                     }
                     case ')': {
                         const plEntry = patternListStack[patternListStack.length - 1];
    -                    if (inClass || !plEntry) {
    +                    if (!plEntry) {
                             re += '\\)';
                             continue;
                         }
    @@ -742,7 +992,7 @@ class Minimatch {
                     }
                     case '|': {
                         const plEntry = patternListStack[patternListStack.length - 1];
    -                    if (inClass || !plEntry) {
    +                    if (!plEntry) {
                             re += '\\|';
                             continue;
                         }
    @@ -759,67 +1009,27 @@ class Minimatch {
                     case '[':
                         // swallow any state-tracking char before the [
                         clearStateChar();
    -                    if (inClass) {
    -                        re += '\\' + c;
    -                        continue;
    +                    const [src, needUflag, consumed, magic] = (0, brace_expressions_js_1.parseClass)(pattern, i);
    +                    if (consumed) {
    +                        re += src;
    +                        uflag = uflag || needUflag;
    +                        i += consumed - 1;
    +                        hasMagic = hasMagic || magic;
    +                    }
    +                    else {
    +                        re += '\\[';
                         }
    -                    inClass = true;
    -                    classStart = i;
    -                    reClassStart = re.length;
    -                    re += c;
                         continue;
                     case ']':
    -                    //  a right bracket shall lose its special
    -                    //  meaning and represent itself in
    -                    //  a bracket expression if it occurs
    -                    //  first in the list.  -- POSIX.2 2.8.3.2
    -                    if (i === classStart + 1 || !inClass) {
    -                        re += '\\' + c;
    -                        continue;
    -                    }
    -                    // split where the last [ was, make sure we don't have
    -                    // an invalid re. if so, re-walk the contents of the
    -                    // would-be class to re-translate any characters that
    -                    // were passed through as-is
    -                    // TODO: It would probably be faster to determine this
    -                    // without a try/catch and a new RegExp, but it's tricky
    -                    // to do safely.  For now, this is safe and works.
    -                    cs = pattern.substring(classStart + 1, i);
    -                    try {
    -                        RegExp('[' + braExpEscape(charUnescape(cs)) + ']');
    -                        // looks good, finish up the class.
    -                        re += c;
    -                    }
    -                    catch (er) {
    -                        // out of order ranges in JS are errors, but in glob syntax,
    -                        // they're just a range that matches nothing.
    -                        re = re.substring(0, reClassStart) + '(?:$.)'; // match nothing ever
    -                    }
    -                    hasMagic = true;
    -                    inClass = false;
    +                    re += '\\' + c;
                         continue;
                     default:
                         // swallow any state char that wasn't consumed
                         clearStateChar();
    -                    if (reSpecials[c] && !(c === '^' && inClass)) {
    -                        re += '\\';
    -                    }
    -                    re += c;
    +                    re += regExpEscape(c);
                         break;
                 } // switch
             } // for
    -        // handle the case where we left a class open.
    -        // "[abc" is valid, equivalent to "\[abc"
    -        if (inClass) {
    -            // split where the last [ was, and escape it
    -            // this is a huge pita.  We now have to re-walk
    -            // the contents of the would-be class to re-translate
    -            // any characters that were passed through as-is
    -            cs = pattern.slice(classStart + 1);
    -            sp = this.parse(cs, SUBPARSE);
    -            re = re.substring(0, reClassStart) + '\\[' + sp[0];
    -            hasMagic = hasMagic || sp[1];
    -        }
             // handle the case where we had a +( thing at the *end*
             // of the pattern.
             // each pattern list stack adds 3 chars, and we need to go through
    @@ -882,7 +1092,7 @@ class Minimatch {
                     cleanAfter = cleanAfter.replace(/\)[+*?]?/, '');
                 }
                 nlAfter = cleanAfter;
    -            const dollar = nlAfter === '' && isSub !== SUBPARSE ? '(?:$|\\/)' : '';
    +            const dollar = nlAfter === '' ? '(?:$|\\/)' : '';
                 re = nlBefore + nlFirst + nlAfter + dollar + nlLast;
             }
             // if the re is not "" at this point, then we need to make sure
    @@ -894,10 +1104,6 @@ class Minimatch {
             if (addPatternStart) {
                 re = patternStart() + re;
             }
    -        // parsing just a piece of a larger pattern.
    -        if (isSub === SUBPARSE) {
    -            return [re, hasMagic];
    -        }
             // if it's nocase, and the lcase/uppercase don't match, it's magic
             if (options.nocase && !hasMagic && !options.nocaseMagicOnly) {
                 hasMagic = pattern.toUpperCase() !== pattern.toLowerCase();
    @@ -906,9 +1112,9 @@ class Minimatch {
             // unescape anything in it, though, so that it'll be
             // an exact match against a file etc.
             if (!hasMagic) {
    -            return globUnescape(pattern);
    +            return globUnescape(re);
             }
    -        const flags = options.nocase ? 'i' : '';
    +        const flags = (options.nocase ? 'i' : '') + (uflag ? 'u' : '');
             try {
                 const ext = fastTest
                     ? {
    @@ -1018,7 +1224,7 @@ class Minimatch {
             if (this.preserveMultipleSlashes) {
                 return p.split('/');
             }
    -        else if (isWindows && /^\/\/[^\/]+/.test(p)) {
    +        else if (this.isWindows && /^\/\/[^\/]+/.test(p)) {
                 // add an extra '' for the one we lose
                 return ['', ...p.split(/\/+/)];
             }
    @@ -1041,8 +1247,8 @@ class Minimatch {
             }
             const options = this.options;
             // windows: need to use /, not \
    -        if (path.sep !== '/') {
    -            f = f.split(path.sep).join('/');
    +        if (this.isWindows) {
    +            f = f.split('\\').join('/');
             }
             // treat the test path as a set of pathparts.
             const ff = this.slashSplit(f);
    @@ -1086,5 +1292,13 @@ class Minimatch {
         }
     }
     exports.Minimatch = Minimatch;
    +/* c8 ignore start */
    +var escape_js_2 = require("./escape.js");
    +Object.defineProperty(exports, "escape", { enumerable: true, get: function () { return escape_js_2.escape; } });
    +var unescape_js_2 = require("./unescape.js");
    +Object.defineProperty(exports, "unescape", { enumerable: true, get: function () { return unescape_js_2.unescape; } });
    +/* c8 ignore stop */
     exports.minimatch.Minimatch = Minimatch;
    +exports.minimatch.escape = escape_js_1.escape;
    +exports.minimatch.unescape = unescape_js_1.unescape;
     //# sourceMappingURL=index.js.map
    \ No newline at end of file
    diff --git a/deps/npm/node_modules/minimatch/dist/cjs/index.js.map b/deps/npm/node_modules/minimatch/dist/cjs/index.js.map
    deleted file mode 100644
    index 0f561db44c2027..00000000000000
    --- a/deps/npm/node_modules/minimatch/dist/cjs/index.js.map
    +++ /dev/null
    @@ -1 +0,0 @@
    -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;AAmBO,MAAM,SAAS,GAAG,CACvB,CAAS,EACT,OAAe,EACf,UAA4B,EAAE,EAC9B,EAAE;IACF,kBAAkB,CAAC,OAAO,CAAC,CAAA;IAE3B,oCAAoC;IACpC,IAAI,CAAC,OAAO,CAAC,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE;QACnD,OAAO,KAAK,CAAA;KACb;IAED,OAAO,IAAI,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;AACjD,CAAC,CAAA;AAbY,QAAA,SAAS,aAarB;AAED,kBAAe,iBAAS,CAAA;AAExB,wDAAwD;AACxD,MAAM,YAAY,GAAG,uBAAuB,CAAA;AAC5C,MAAM,cAAc,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,CAA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AAK,CAAA;SACb;QACD,OAAO,IAAI,CAAC,MAAM,CAAA;IACpB,CAAC;IAED,MAAM,CAAC,QAAQ,CAAC,GAAqB;QACnC,OAAO,iBAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,SAAS,CAAA;IAC1C,CAAC;CACF;AAt+BD,8BAs+BC;AAED,iBAAS,CAAC,SAAS,GAAG,SAAS,CAAA"}
    \ No newline at end of file
    diff --git a/deps/npm/node_modules/minimatch/dist/cjs/parse.js b/deps/npm/node_modules/minimatch/dist/cjs/parse.js
    new file mode 100644
    index 00000000000000..2fff625bcbb6e9
    --- /dev/null
    +++ b/deps/npm/node_modules/minimatch/dist/cjs/parse.js
    @@ -0,0 +1,650 @@
    +"use strict";
    +// parse a single path portion
    +Object.defineProperty(exports, "__esModule", { value: true });
    +exports.AST = void 0;
    +const brace_expressions_1 = require("./brace-expressions");
    +const types = new Set(['!', '?', '+', '*', '@']);
    +const isExtglobType = (c) => types.has(c);
    +// characters that indicate a start of pattern needs the "no dots" bit
    +const addPatternStart = new Set(['[', '.']);
    +const justDots = new Set(['..', '.']);
    +const reSpecials = new Set('().*{}+?[]^$\\!');
    +const regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
    +// any single thing other than /
    +// don't need to escape / when using new RegExp()
    +const qmark = '[^/]';
    +// * => any number of characters
    +const star = qmark + '*?';
    +class AST {
    +    type;
    +    #root;
    +    #parts = [];
    +    #parent;
    +    #parentIndex;
    +    #negs;
    +    #filledNegs = false;
    +    #options;
    +    constructor(type, parent, options = {}) {
    +        this.type = type;
    +        this.#parent = parent;
    +        this.#root = this.#parent ? this.#parent.#root : this;
    +        this.#options = this.#root === this ? options : this.#root.#options;
    +        this.#negs = this.#root === this ? [] : this.#root.#negs;
    +        if (type === '!' && !this.#root.#filledNegs)
    +            this.#negs.push(this);
    +        this.#parentIndex = this.#parent ? this.#parent.#parts.length : 0;
    +    }
    +    fillNegs() {
    +        if (this !== this.#root) {
    +            this.#root.fillNegs();
    +            return this;
    +        }
    +        if (this.#filledNegs)
    +            return this;
    +        this.#filledNegs = true;
    +        let n;
    +        while ((n = this.#negs.pop())) {
    +            if (n.type !== '!')
    +                continue;
    +            // walk up the tree, appending everthing that comes AFTER parentIndex
    +            let p = n;
    +            let pp = p.#parent;
    +            while (pp) {
    +                for (let i = p.#parentIndex + 1; !pp.type && i < pp.#parts.length; i++) {
    +                    for (const part of n.#parts) {
    +                        /* c8 ignore start */
    +                        if (typeof part === 'string') {
    +                            throw new Error('string part in extglob AST??');
    +                        }
    +                        /* c8 ignore stop */
    +                        part.copyIn(pp.#parts[i]);
    +                    }
    +                }
    +                p = pp;
    +                pp = p.#parent;
    +            }
    +        }
    +        return this;
    +    }
    +    push(...parts) {
    +        for (const p of parts) {
    +            if (p === '')
    +                continue;
    +            /* c8 ignore start */
    +            if (typeof p !== 'string' && !(p instanceof AST && p.#parent === this)) {
    +                throw new Error('invalid part: ' + p);
    +            }
    +            /* c8 ignore stop */
    +            this.#parts.push(p);
    +        }
    +    }
    +    toJSON() {
    +        const ret = this.type === null ? this.#parts.slice() : [this.type, ...this.#parts];
    +        if (this.isStart() && !this.type)
    +            ret.unshift([]);
    +        if (this.isEnd() &&
    +            (this === this.#root ||
    +                (this.#root.#filledNegs && this.#parent?.type === '!'))) {
    +            ret.push({});
    +        }
    +        return ret;
    +    }
    +    isStart() {
    +        if (this.#root === this)
    +            return true;
    +        // if (this.type) return !!this.#parent?.isStart()
    +        if (!this.#parent?.isStart())
    +            return false;
    +        return this.#parentIndex === 0;
    +    }
    +    isEnd() {
    +        if (this.#root === this)
    +            return true;
    +        if (this.#parent?.type === '!')
    +            return true;
    +        if (!this.#parent?.isEnd())
    +            return false;
    +        if (!this.type)
    +            return this.#parent?.isEnd();
    +        return (this.#parentIndex === (this.#parent ? this.#parent.#parts.length : 0) - 1);
    +    }
    +    copyIn(part) {
    +        if (typeof part === 'string')
    +            this.push(part);
    +        else
    +            this.push(part.clone(this));
    +    }
    +    clone(parent) {
    +        const c = new AST(this.type, parent);
    +        for (const p of this.#parts) {
    +            c.copyIn(p);
    +        }
    +        return c;
    +    }
    +    static #parseAST(str, ast, pos, opt) {
    +        let escaping = false;
    +        if (ast.type === null) {
    +            // outside of a extglob, append until we find a start
    +            let i = pos;
    +            let acc = '';
    +            while (i < str.length) {
    +                const c = str.charAt(i++);
    +                // still accumulate escapes at this point, but we do ignore
    +                // starts that are escaped
    +                if (escaping || c === '\\') {
    +                    escaping = !escaping;
    +                    acc += c;
    +                    continue;
    +                }
    +                if (!opt.noext && isExtglobType(c) && str.charAt(i) === '(') {
    +                    ast.push(acc);
    +                    acc = '';
    +                    const ext = new AST(c, ast);
    +                    i = AST.#parseAST(str, ext, i, opt);
    +                    ast.push(ext);
    +                    continue;
    +                }
    +                acc += c;
    +            }
    +            ast.push(acc);
    +            return i;
    +        }
    +        // some kind of extglob, pos is at the (
    +        // find the next | or )
    +        let i = pos + 1;
    +        let part = new AST(null, ast);
    +        const parts = [];
    +        let acc = '';
    +        while (i < str.length) {
    +            const c = str.charAt(i++);
    +            // still accumulate escapes at this point, but we do ignore
    +            // starts that are escaped
    +            if (escaping || c === '\\') {
    +                escaping = !escaping;
    +                acc += c;
    +                continue;
    +            }
    +            if (isExtglobType(c) && str.charAt(i) === '(') {
    +                part.push(acc);
    +                acc = '';
    +                const ext = new AST(c, part);
    +                part.push(ext);
    +                i = AST.#parseAST(str, ext, i, opt);
    +                continue;
    +            }
    +            if (c === '|') {
    +                part.push(acc);
    +                acc = '';
    +                parts.push(part);
    +                part = new AST(null, ast);
    +                continue;
    +            }
    +            if (c === ')') {
    +                part.push(acc);
    +                acc = '';
    +                ast.push(...parts, part);
    +                return i;
    +            }
    +            acc += c;
    +        }
    +        // if we got here, it was a malformed extglob! not an extglob, but
    +        // maybe something else in there.
    +        ast.type = null;
    +        ast.#parts = [str.substring(pos)];
    +        return i;
    +    }
    +    static fromGlob(pattern, options = {}) {
    +        const ast = new AST(null, undefined, options);
    +        AST.#parseAST(pattern, ast, 0, options);
    +        console.log('parsed', pattern, JSON.stringify(ast));
    +        return ast;
    +    }
    +    toRegExpSource() {
    +        if (this.#root === this)
    +            this.fillNegs();
    +        if (!this.type) {
    +            const src = this.#parts
    +                .map(p => {
    +                if (typeof p === 'string')
    +                    return AST.#parseGlob(p, this.#options);
    +                else
    +                    return p.toRegExpSource();
    +            })
    +                .join('');
    +            let start = '';
    +            if (this.isStart() && typeof this.#parts[0] === 'string') {
    +                // '.' and '..' cannot match unless the pattern is that exactly
    +                const dotTravAllowed = this.#parts.length === 1 && justDots.has(this.#parts[0]);
    +                if (dotTravAllowed) {
    +                    start = '(?:^|\\/)';
    +                }
    +                else {
    +                    const dotsAllowed = this.#options.dot ||
    +                        // no need to prevent dots if it can't match a dot, or if a sub-pattern
    +                        // will be preventing it anyway.
    +                        !addPatternStart.has(src.charAt(0));
    +                    start = dotsAllowed ? '(?!(?:^|\\/)\\.{1,2}(?:$|\\/))' : '(?!\\.)';
    +                }
    +            }
    +            let end = '';
    +            if (this.isEnd() &&
    +                (this === this.#root ||
    +                    (this.#root.#filledNegs && this.#parent?.type === '!'))) {
    +                end = '(?:$|\\/)';
    +            }
    +            return start + src + end;
    +        }
    +        // some kind of extglob
    +        const start = this.type === '!' ? '(?:(?!(?:' : '(?:';
    +        const body = this.#parts
    +            .map(p => {
    +            /* c8 ignore start */
    +            if (typeof p === 'string') {
    +                throw new Error('string type in extglob ast??');
    +            }
    +            /* c8 ignore stop */
    +            return p.toRegExpSource();
    +        })
    +            .join('|');
    +        const close = this.type === '!'
    +            ? '))[^/]*?)'
    +            : this.type === '@'
    +                ? ')'
    +                : `)${this.type}`;
    +        return start + body + close;
    +    }
    +    static #parseGlob(glob, options) {
    +        let escaping = false;
    +        let re = '';
    +        let uflag = false;
    +        let hasMagic = false;
    +        for (let i = 0; i < glob.length; i++) {
    +            const c = glob.charAt(i);
    +            if (escaping) {
    +                escaping = false;
    +                re += (reSpecials.has(c) ? '\\' : '') + c;
    +                continue;
    +            }
    +            if (c === '\\') {
    +                if (i === glob.length - 1) {
    +                    re += '\\\\';
    +                }
    +                else {
    +                    escaping = true;
    +                }
    +                continue;
    +            }
    +            if (c === '[') {
    +                const [src, needUflag, consumed, magic] = (0, brace_expressions_1.parseClass)(glob, i);
    +                if (consumed) {
    +                    re += src;
    +                    uflag = uflag || needUflag;
    +                    i += consumed - 1;
    +                    hasMagic = hasMagic || magic;
    +                    continue;
    +                }
    +            }
    +            if (c === '*') {
    +                re += star;
    +                hasMagic = true;
    +                continue;
    +            }
    +            if (c === '?') {
    +                re += qmark;
    +                hasMagic = true;
    +                continue;
    +            }
    +            re += regExpEscape(c);
    +        }
    +        return re;
    +    }
    +}
    +exports.AST = AST;
    +const pattern = 'a@(i|w!(x|y)z+(l|m)|j)';
    +const ast = AST.fromGlob(pattern).fillNegs();
    +console.log('negged', pattern, JSON.stringify(ast));
    +console.log('to re src', pattern, ast.toRegExpSource());
    +// // the type (exttype or null for strings), and array of children tokens
    +//
    +// // append everything after a negative extglob to each of the parts
    +// // of the negative extglob node.  So, eg, [a, [!, x, y], z]
    +//
    +// //
    +// //
    +// //
    +// //
    +//
    +// const globUnescape = (s: string) => s.replace(/\\(.)/g, '$1')
    +// const regExpEscape = (s: string) =>
    +//   s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&')
    +//
    +// // "abc" -> { a:true, b:true, c:true }
    +// const charSet = (s: string) =>
    +//   s.split('').reduce((set: { [k: string]: boolean }, c) => {
    +//     set[c] = true
    +//     return set
    +//   }, {})
    +//
    +// // characters that need to be escaped in RegExp.
    +// const reSpecials = charSet('().*{}+?[]^$\\!')
    +//
    +// // characters that indicate we have to add the pattern start
    +// const addPatternStartSet = charSet('[.(')
    +//
    +// // any single thing other than /
    +// // don't need to escape / when using new RegExp()
    +// const qmark = '[^/]'
    +//
    +// // * => any number of characters
    +// const star = qmark + '*?'
    +//
    +// // TODO: take an offset and length, so we can sub-parse the extglobs
    +// const parse = (
    +//   options: MinimatchOptions,
    +//   pattern: string,
    +//   debug: (...a: any[]) => void
    +// ): false | string => {
    +//   assertValidPattern(pattern)
    +//
    +//   if (pattern === '') return ''
    +//
    +//   let re = ''
    +//   let hasMagic = false
    +//   let escaping = false
    +//   // ? => one single character
    +//   let uflag = false
    +//
    +//   // . and .. never match anything that doesn't start with .,
    +//   // even when options.dot is set.  However, if the pattern
    +//   // starts with ., then traversal patterns can match.
    +//   let dotTravAllowed = pattern.charAt(0) === '.'
    +//   let dotFileAllowed = options.dot || dotTravAllowed
    +//   const patternStart = () =>
    +//     dotTravAllowed
    +//       ? ''
    +//       : dotFileAllowed
    +//       ? '(?!(?:^|\\/)\\.{1,2}(?:$|\\/))'
    +//       : '(?!\\.)'
    +//   const subPatternStart = (p: string) =>
    +//     p.charAt(0) === '.'
    +//       ? ''
    +//       : options.dot
    +//       ? '(?!(?:^|\\/)\\.{1,2}(?:$|\\/))'
    +//       : '(?!\\.)'
    +//
    +//   const clearStateChar = () => {
    +//     if (stateChar) {
    +//       // we had some state-tracking character
    +//       // that wasn't consumed by this pass.
    +//       switch (stateChar) {
    +//         case '*':
    +//           re += star
    +//           hasMagic = true
    +//           break
    +//         case '?':
    +//           re += qmark
    +//           hasMagic = true
    +//           break
    +//         default:
    +//           re += '\\' + stateChar
    +//           break
    +//       }
    +//       debug('clearStateChar %j %j', stateChar, re)
    +//       stateChar = false
    +//     }
    +//   }
    +//
    +//   for (
    +//     let i = 0, c: string;
    +//     i < pattern.length && (c = pattern.charAt(i));
    +//     i++
    +//   ) {
    +//     debug('%s\t%s %s %j', pattern, i, re, c)
    +//
    +//     // skip over any that are escaped.
    +//     if (escaping) {
    +//       // completely not allowed, even escaped.
    +//       // should be impossible.
    +//       /* c8 ignore start */
    +//       if (c === '/') {
    +//         return false
    +//       }
    +//       /* c8 ignore stop */
    +//
    +//       if (reSpecials[c]) {
    +//         re += '\\'
    +//       }
    +//       re += c
    +//       escaping = false
    +//       continue
    +//     }
    +//
    +//     switch (c) {
    +//       // Should already be path-split by now.
    +//       /* c8 ignore start */
    +//       case '/': {
    +//         return false
    +//       }
    +//       /* c8 ignore stop */
    +//
    +//       case '\\':
    +//         clearStateChar()
    +//         escaping = true
    +//         continue
    +//
    +//       // the various stateChar values
    +//       // for the "extglob" stuff.
    +//       case '?':
    +//       case '*':
    +//       case '+':
    +//       case '@':
    +//       case '!':
    +//         debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c)
    +//
    +//         // if we already have a stateChar, then it means
    +//         // that there was something like ** or +? in there.
    +//         // Handle the stateChar, then proceed with this one.
    +//         debug('call clearStateChar %j', stateChar)
    +//         clearStateChar()
    +//         stateChar = c
    +//         // if extglob is disabled, then +(asdf|foo) isn't a thing.
    +//         // just clear the statechar *now*, rather than even diving into
    +//         // the patternList stuff.
    +//         if (options.noext) clearStateChar()
    +//         continue
    +//
    +//       case '(': {
    +//         if (!stateChar) {
    +//           re += '\\('
    +//           continue
    +//         }
    +//
    +//         const plEntry: PatternListEntry = {
    +//           type: stateChar,
    +//           start: i - 1,
    +//           reStart: re.length,
    +//           open: plTypes[stateChar].open,
    +//           close: plTypes[stateChar].close,
    +//         }
    +//         debug(pattern, '\t', plEntry)
    +//         patternListStack.push(plEntry)
    +//         // negation is (?:(?!(?:js)(?:))[^/]*)
    +//         re += plEntry.open
    +//         // next entry starts with a dot maybe?
    +//         if (plEntry.start === 0 && plEntry.type !== '!') {
    +//           dotTravAllowed = true
    +//           re += subPatternStart(pattern.slice(i + 1))
    +//         }
    +//         debug('plType %j %j', stateChar, re)
    +//         stateChar = false
    +//         continue
    +//       }
    +//
    +//       case ')': {
    +//         const plEntry = patternListStack[patternListStack.length - 1]
    +//         if (!plEntry) {
    +//           re += '\\)'
    +//           continue
    +//         }
    +//         patternListStack.pop()
    +//
    +//         // closing an extglob
    +//         clearStateChar()
    +//         hasMagic = true
    +//         pl = plEntry
    +//         // negation is (?:(?!js)[^/]*)
    +//         // The others are (?:)
    +//         re += pl.close
    +//         if (pl.type === '!') {
    +//           negativeLists.push(Object.assign(pl, { reEnd: re.length }))
    +//         }
    +//         continue
    +//       }
    +//
    +//       case '|': {
    +//         const plEntry = patternListStack[patternListStack.length - 1]
    +//         if (!plEntry) {
    +//           re += '\\|'
    +//           continue
    +//         }
    +//
    +//         clearStateChar()
    +//         re += '|'
    +//         // next subpattern can start with a dot?
    +//         if (plEntry.start === 0 && plEntry.type !== '!') {
    +//           dotTravAllowed = true
    +//           re += subPatternStart(pattern.slice(i + 1))
    +//         }
    +//         continue
    +//       }
    +//
    +//       // these are mostly the same in regexp and glob
    +//       case '[':
    +//         // swallow any state-tracking char before the [
    +//         clearStateChar()
    +//         const [src, needUflag, consumed, magic] = parseClass(pattern, i)
    +//         if (consumed) {
    +//           re += src
    +//           uflag = uflag || needUflag
    +//           i += consumed - 1
    +//           hasMagic = hasMagic || magic
    +//         } else {
    +//           re += '\\['
    +//         }
    +//         continue
    +//
    +//       case ']':
    +//         re += '\\' + c
    +//         continue
    +//
    +//       default:
    +//         // swallow any state char that wasn't consumed
    +//         clearStateChar()
    +//
    +//         re += regExpEscape(c)
    +//         break
    +//     } // switch
    +//   } // for
    +//
    +//   // handle the case where we had a +( thing at the *end*
    +//   // of the pattern.
    +//   // each pattern list stack adds 3 chars, and we need to go through
    +//   // and escape any | chars that were passed through as-is for the regexp.
    +//   // Go through and escape them, taking care not to double-escape any
    +//   // | chars that were already escaped.
    +//   for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) {
    +//     let tail: string
    +//     tail = re.slice(pl.reStart + pl.open.length)
    +//     debug(pattern, 'setting tail', re, pl)
    +//     // maybe some even number of \, then maybe 1 \, followed by a |
    +//     tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, (_, $1, $2) => {
    +//       if (!$2) {
    +//         // the | isn't already escaped, so escape it.
    +//         $2 = '\\'
    +//         // should already be done
    +//         /* c8 ignore start */
    +//       }
    +//       /* c8 ignore stop */
    +//
    +//       // need to escape all those slashes *again*, without escaping the
    +//       // one that we need for escaping the | character.  As it works out,
    +//       // escaping an even number of slashes can be done by simply repeating
    +//       // it exactly after itself.  That's why this trick works.
    +//       //
    +//       // I am sorry that you have to see this.
    +//       return $1 + $1 + $2 + '|'
    +//     })
    +//
    +//     debug('tail=%j\n   %s', tail, tail, pl, re)
    +//     const t = pl.type === '*' ? star : pl.type === '?' ? qmark : '\\' + pl.type
    +//
    +//     hasMagic = true
    +//     re = re.slice(0, pl.reStart) + t + '\\(' + tail
    +//   }
    +//
    +//   // handle trailing things that only matter at the very end.
    +//   clearStateChar()
    +//   if (escaping) {
    +//     // trailing \\
    +//     re += '\\\\'
    +//   }
    +//
    +//   // only need to apply the nodot start if the re starts with
    +//   // something that could conceivably capture a dot
    +//   const addPatternStart = addPatternStartSet[re.charAt(0)]
    +//
    +//   // Hack to work around lack of negative lookbehind in JS
    +//   // A pattern like: *.!(x).!(y|z) needs to ensure that a name
    +//   // like 'a.xyz.yz' doesn't match.  So, the first negative
    +//   // lookahead, has to look ALL the way ahead, to the end of
    +//   // the pattern.
    +//   for (let n = negativeLists.length - 1; n > -1; n--) {
    +//     const nl = negativeLists[n]
    +//
    +//     const nlBefore = re.slice(0, nl.reStart)
    +//     const nlFirst = re.slice(nl.reStart, nl.reEnd - 8)
    +//     let nlAfter = re.slice(nl.reEnd)
    +//     const nlLast = re.slice(nl.reEnd - 8, nl.reEnd) + nlAfter
    +//
    +//     // Handle nested stuff like *(*.js|!(*.json)), where open parens
    +//     // mean that we should *not* include the ) in the bit that is considered
    +//     // "after" the negated section.
    +//     const closeParensBefore = nlBefore.split(')').length
    +//     const openParensBefore = nlBefore.split('(').length - closeParensBefore
    +//     let cleanAfter = nlAfter
    +//     for (let i = 0; i < openParensBefore; i++) {
    +//       cleanAfter = cleanAfter.replace(/\)[+*?]?/, '')
    +//     }
    +//     nlAfter = cleanAfter
    +//
    +//     const dollar = nlAfter === '' ? '(?:$|\\/)' : ''
    +//
    +//     re = nlBefore + nlFirst + nlAfter + dollar + nlLast
    +//   }
    +//
    +//   // if the re is not "" at this point, then we need to make sure
    +//   // it doesn't match against an empty path part.
    +//   // Otherwise a/* will match a/, which it should not.
    +//   if (re !== '' && hasMagic) {
    +//     re = '(?=.)' + re
    +//   }
    +//
    +//   if (addPatternStart) {
    +//     re = patternStart() + re
    +//   }
    +//
    +//   // if it's nocase, and the lcase/uppercase don't match, it's magic
    +//   if (options.nocase && !hasMagic && !options.nocaseMagicOnly) {
    +//     hasMagic = pattern.toUpperCase() !== pattern.toLowerCase()
    +//   }
    +//
    +//   // skip the regexp for non-magical patterns
    +//   // unescape anything in it, though, so that it'll be
    +//   // an exact match against a file etc.
    +//   if (!hasMagic) {
    +//     return globUnescape(re)
    +//   }
    +//
    +//   return re
    +// }
    +//# sourceMappingURL=parse.js.map
    \ No newline at end of file
    diff --git a/deps/npm/node_modules/minimatch/dist/cjs/unescape.js b/deps/npm/node_modules/minimatch/dist/cjs/unescape.js
    new file mode 100644
    index 00000000000000..47c36bcee5a02a
    --- /dev/null
    +++ b/deps/npm/node_modules/minimatch/dist/cjs/unescape.js
    @@ -0,0 +1,24 @@
    +"use strict";
    +Object.defineProperty(exports, "__esModule", { value: true });
    +exports.unescape = void 0;
    +/**
    + * Un-escape a string that has been escaped with {@link escape}.
    + *
    + * If the {@link windowsPathsNoEscape} option is used, then square-brace
    + * escapes are removed, but not backslash escapes.  For example, it will turn
    + * the string `'[*]'` into `*`, but it will not turn `'\\*'` into `'*'`,
    + * becuase `\` is a path separator in `windowsPathsNoEscape` mode.
    + *
    + * When `windowsPathsNoEscape` is not set, then both brace escapes and
    + * backslash escapes are removed.
    + *
    + * Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot be escaped
    + * or unescaped.
    + */
    +const unescape = (s, { windowsPathsNoEscape = false, } = {}) => {
    +    return windowsPathsNoEscape
    +        ? s.replace(/\[([^\/\\])\]/g, '$1')
    +        : s.replace(/((?!\\).|^)\[([^\/\\])\]/g, '$1$2').replace(/\\([^\/])/g, '$1');
    +};
    +exports.unescape = unescape;
    +//# sourceMappingURL=unescape.js.map
    \ No newline at end of file
    diff --git a/deps/npm/node_modules/minimatch/dist/mjs/_parse.js b/deps/npm/node_modules/minimatch/dist/mjs/_parse.js
    new file mode 100644
    index 00000000000000..db6a28ab08a74e
    --- /dev/null
    +++ b/deps/npm/node_modules/minimatch/dist/mjs/_parse.js
    @@ -0,0 +1,296 @@
    +// parse a single path portion
    +import { parseClass } from './brace-expressions.js';
    +import { assertValidPattern } from './assert-valid-pattern.js';
    +const globUnescape = (s) => s.replace(/\\(.)/g, '$1');
    +const regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
    +// "abc" -> { a:true, b:true, c:true }
    +const charSet = (s) => s.split('').reduce((set, c) => {
    +    set[c] = true;
    +    return set;
    +}, {});
    +const plTypes = {
    +    '!': { open: '(?:(?!(?:', close: '))[^/]*?)' },
    +    '?': { open: '(?:', close: ')?' },
    +    '+': { open: '(?:', close: ')+' },
    +    '*': { open: '(?:', close: ')*' },
    +    '@': { open: '(?:', close: ')' },
    +};
    +// characters that need to be escaped in RegExp.
    +const reSpecials = charSet('().*{}+?[]^$\\!');
    +// characters that indicate we have to add the pattern start
    +const addPatternStartSet = charSet('[.(');
    +// any single thing other than /
    +// don't need to escape / when using new RegExp()
    +const qmark = '[^/]';
    +// * => any number of characters
    +const star = qmark + '*?';
    +// TODO: take an offset and length, so we can sub-parse the extglobs
    +export const parse = (options, pattern, debug) => {
    +    assertValidPattern(pattern);
    +    if (pattern === '')
    +        return '';
    +    let re = '';
    +    let hasMagic = false;
    +    let escaping = false;
    +    // ? => one single character
    +    const patternListStack = [];
    +    const negativeLists = [];
    +    let stateChar = false;
    +    let uflag = false;
    +    let pl;
    +    // . and .. never match anything that doesn't start with .,
    +    // even when options.dot is set.  However, if the pattern
    +    // starts with ., then traversal patterns can match.
    +    let dotTravAllowed = pattern.charAt(0) === '.';
    +    let dotFileAllowed = options.dot || dotTravAllowed;
    +    const patternStart = () => dotTravAllowed
    +        ? ''
    +        : dotFileAllowed
    +            ? '(?!(?:^|\\/)\\.{1,2}(?:$|\\/))'
    +            : '(?!\\.)';
    +    const subPatternStart = (p) => p.charAt(0) === '.'
    +        ? ''
    +        : options.dot
    +            ? '(?!(?:^|\\/)\\.{1,2}(?:$|\\/))'
    +            : '(?!\\.)';
    +    const clearStateChar = () => {
    +        if (stateChar) {
    +            // we had some state-tracking character
    +            // that wasn't consumed by this pass.
    +            switch (stateChar) {
    +                case '*':
    +                    re += star;
    +                    hasMagic = true;
    +                    break;
    +                case '?':
    +                    re += qmark;
    +                    hasMagic = true;
    +                    break;
    +                default:
    +                    re += '\\' + stateChar;
    +                    break;
    +            }
    +            debug('clearStateChar %j %j', stateChar, re);
    +            stateChar = false;
    +        }
    +    };
    +    for (let i = 0, c; i < pattern.length && (c = pattern.charAt(i)); i++) {
    +        debug('%s\t%s %s %j', pattern, i, re, c);
    +        // skip over any that are escaped.
    +        if (escaping) {
    +            // completely not allowed, even escaped.
    +            // should be impossible.
    +            /* c8 ignore start */
    +            if (c === '/') {
    +                return false;
    +            }
    +            /* c8 ignore stop */
    +            if (reSpecials[c]) {
    +                re += '\\';
    +            }
    +            re += c;
    +            escaping = false;
    +            continue;
    +        }
    +        switch (c) {
    +            // Should already be path-split by now.
    +            /* c8 ignore start */
    +            case '/': {
    +                return false;
    +            }
    +            /* c8 ignore stop */
    +            case '\\':
    +                clearStateChar();
    +                escaping = true;
    +                continue;
    +            // the various stateChar values
    +            // for the "extglob" stuff.
    +            case '?':
    +            case '*':
    +            case '+':
    +            case '@':
    +            case '!':
    +                debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c);
    +                // if we already have a stateChar, then it means
    +                // that there was something like ** or +? in there.
    +                // Handle the stateChar, then proceed with this one.
    +                debug('call clearStateChar %j', stateChar);
    +                clearStateChar();
    +                stateChar = c;
    +                // if extglob is disabled, then +(asdf|foo) isn't a thing.
    +                // just clear the statechar *now*, rather than even diving into
    +                // the patternList stuff.
    +                if (options.noext)
    +                    clearStateChar();
    +                continue;
    +            case '(': {
    +                if (!stateChar) {
    +                    re += '\\(';
    +                    continue;
    +                }
    +                const plEntry = {
    +                    type: stateChar,
    +                    start: i - 1,
    +                    reStart: re.length,
    +                    open: plTypes[stateChar].open,
    +                    close: plTypes[stateChar].close,
    +                };
    +                debug(pattern, '\t', plEntry);
    +                patternListStack.push(plEntry);
    +                // negation is (?:(?!(?:js)(?:))[^/]*)
    +                re += plEntry.open;
    +                // next entry starts with a dot maybe?
    +                if (plEntry.start === 0 && plEntry.type !== '!') {
    +                    dotTravAllowed = true;
    +                    re += subPatternStart(pattern.slice(i + 1));
    +                }
    +                debug('plType %j %j', stateChar, re);
    +                stateChar = false;
    +                continue;
    +            }
    +            case ')': {
    +                const plEntry = patternListStack[patternListStack.length - 1];
    +                if (!plEntry) {
    +                    re += '\\)';
    +                    continue;
    +                }
    +                patternListStack.pop();
    +                // closing an extglob
    +                clearStateChar();
    +                hasMagic = true;
    +                pl = plEntry;
    +                // negation is (?:(?!js)[^/]*)
    +                // The others are (?:)
    +                re += pl.close;
    +                if (pl.type === '!') {
    +                    negativeLists.push(Object.assign(pl, { reEnd: re.length }));
    +                }
    +                continue;
    +            }
    +            case '|': {
    +                const plEntry = patternListStack[patternListStack.length - 1];
    +                if (!plEntry) {
    +                    re += '\\|';
    +                    continue;
    +                }
    +                clearStateChar();
    +                re += '|';
    +                // next subpattern can start with a dot?
    +                if (plEntry.start === 0 && plEntry.type !== '!') {
    +                    dotTravAllowed = true;
    +                    re += subPatternStart(pattern.slice(i + 1));
    +                }
    +                continue;
    +            }
    +            // these are mostly the same in regexp and glob
    +            case '[':
    +                // swallow any state-tracking char before the [
    +                clearStateChar();
    +                const [src, needUflag, consumed, magic] = parseClass(pattern, i);
    +                if (consumed) {
    +                    re += src;
    +                    uflag = uflag || needUflag;
    +                    i += consumed - 1;
    +                    hasMagic = hasMagic || magic;
    +                }
    +                else {
    +                    re += '\\[';
    +                }
    +                continue;
    +            case ']':
    +                re += '\\' + c;
    +                continue;
    +            default:
    +                // swallow any state char that wasn't consumed
    +                clearStateChar();
    +                re += regExpEscape(c);
    +                break;
    +        } // switch
    +    } // for
    +    // handle the case where we had a +( thing at the *end*
    +    // of the pattern.
    +    // each pattern list stack adds 3 chars, and we need to go through
    +    // and escape any | chars that were passed through as-is for the regexp.
    +    // Go through and escape them, taking care not to double-escape any
    +    // | chars that were already escaped.
    +    for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) {
    +        let tail;
    +        tail = re.slice(pl.reStart + pl.open.length);
    +        debug(pattern, 'setting tail', re, pl);
    +        // maybe some even number of \, then maybe 1 \, followed by a |
    +        tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, (_, $1, $2) => {
    +            if (!$2) {
    +                // the | isn't already escaped, so escape it.
    +                $2 = '\\';
    +                // should already be done
    +                /* c8 ignore start */
    +            }
    +            /* c8 ignore stop */
    +            // need to escape all those slashes *again*, without escaping the
    +            // one that we need for escaping the | character.  As it works out,
    +            // escaping an even number of slashes can be done by simply repeating
    +            // it exactly after itself.  That's why this trick works.
    +            //
    +            // I am sorry that you have to see this.
    +            return $1 + $1 + $2 + '|';
    +        });
    +        debug('tail=%j\n   %s', tail, tail, pl, re);
    +        const t = pl.type === '*' ? star : pl.type === '?' ? qmark : '\\' + pl.type;
    +        hasMagic = true;
    +        re = re.slice(0, pl.reStart) + t + '\\(' + tail;
    +    }
    +    // handle trailing things that only matter at the very end.
    +    clearStateChar();
    +    if (escaping) {
    +        // trailing \\
    +        re += '\\\\';
    +    }
    +    // only need to apply the nodot start if the re starts with
    +    // something that could conceivably capture a dot
    +    const addPatternStart = addPatternStartSet[re.charAt(0)];
    +    // Hack to work around lack of negative lookbehind in JS
    +    // A pattern like: *.!(x).!(y|z) needs to ensure that a name
    +    // like 'a.xyz.yz' doesn't match.  So, the first negative
    +    // lookahead, has to look ALL the way ahead, to the end of
    +    // the pattern.
    +    for (let n = negativeLists.length - 1; n > -1; n--) {
    +        const nl = negativeLists[n];
    +        const nlBefore = re.slice(0, nl.reStart);
    +        const nlFirst = re.slice(nl.reStart, nl.reEnd - 8);
    +        let nlAfter = re.slice(nl.reEnd);
    +        const nlLast = re.slice(nl.reEnd - 8, nl.reEnd) + nlAfter;
    +        // Handle nested stuff like *(*.js|!(*.json)), where open parens
    +        // mean that we should *not* include the ) in the bit that is considered
    +        // "after" the negated section.
    +        const closeParensBefore = nlBefore.split(')').length;
    +        const openParensBefore = nlBefore.split('(').length - closeParensBefore;
    +        let cleanAfter = nlAfter;
    +        for (let i = 0; i < openParensBefore; i++) {
    +            cleanAfter = cleanAfter.replace(/\)[+*?]?/, '');
    +        }
    +        nlAfter = cleanAfter;
    +        const dollar = nlAfter === '' ? '(?:$|\\/)' : '';
    +        re = nlBefore + nlFirst + nlAfter + dollar + nlLast;
    +    }
    +    // if the re is not "" at this point, then we need to make sure
    +    // it doesn't match against an empty path part.
    +    // Otherwise a/* will match a/, which it should not.
    +    if (re !== '' && hasMagic) {
    +        re = '(?=.)' + re;
    +    }
    +    if (addPatternStart) {
    +        re = patternStart() + re;
    +    }
    +    // if it's nocase, and the lcase/uppercase don't match, it's magic
    +    if (options.nocase && !hasMagic && !options.nocaseMagicOnly) {
    +        hasMagic = pattern.toUpperCase() !== pattern.toLowerCase();
    +    }
    +    // skip the regexp for non-magical patterns
    +    // unescape anything in it, though, so that it'll be
    +    // an exact match against a file etc.
    +    if (!hasMagic) {
    +        return globUnescape(re);
    +    }
    +    return re;
    +};
    +//# sourceMappingURL=_parse.js.map
    \ No newline at end of file
    diff --git a/deps/npm/node_modules/minimatch/dist/mjs/assert-valid-pattern.js b/deps/npm/node_modules/minimatch/dist/mjs/assert-valid-pattern.js
    new file mode 100644
    index 00000000000000..7b534fc30200bb
    --- /dev/null
    +++ b/deps/npm/node_modules/minimatch/dist/mjs/assert-valid-pattern.js
    @@ -0,0 +1,10 @@
    +const MAX_PATTERN_LENGTH = 1024 * 64;
    +export const assertValidPattern = (pattern) => {
    +    if (typeof pattern !== 'string') {
    +        throw new TypeError('invalid pattern');
    +    }
    +    if (pattern.length > MAX_PATTERN_LENGTH) {
    +        throw new TypeError('pattern is too long');
    +    }
    +};
    +//# sourceMappingURL=assert-valid-pattern.js.map
    \ No newline at end of file
    diff --git a/deps/npm/node_modules/minimatch/dist/mjs/brace-expressions.js b/deps/npm/node_modules/minimatch/dist/mjs/brace-expressions.js
    new file mode 100644
    index 00000000000000..c629d6ae816e27
    --- /dev/null
    +++ b/deps/npm/node_modules/minimatch/dist/mjs/brace-expressions.js
    @@ -0,0 +1,148 @@
    +// translate the various posix character classes into unicode properties
    +// this works across all unicode locales
    +// { : [, /u flag required, negated]
    +const posixClasses = {
    +    '[:alnum:]': ['\\p{L}\\p{Nl}\\p{Nd}', true],
    +    '[:alpha:]': ['\\p{L}\\p{Nl}', true],
    +    '[:ascii:]': ['\\x' + '00-\\x' + '7f', false],
    +    '[:blank:]': ['\\p{Zs}\\t', true],
    +    '[:cntrl:]': ['\\p{Cc}', true],
    +    '[:digit:]': ['\\p{Nd}', true],
    +    '[:graph:]': ['\\p{Z}\\p{C}', true, true],
    +    '[:lower:]': ['\\p{Ll}', true],
    +    '[:print:]': ['\\p{C}', true],
    +    '[:punct:]': ['\\p{P}', true],
    +    '[:space:]': ['\\p{Z}\\t\\r\\n\\v\\f', true],
    +    '[:upper:]': ['\\p{Lu}', true],
    +    '[:word:]': ['\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}', true],
    +    '[:xdigit:]': ['A-Fa-f0-9', false],
    +};
    +// only need to escape a few things inside of brace expressions
    +// escapes: [ \ ] -
    +const braceEscape = (s) => s.replace(/[[\]\\-]/g, '\\$&');
    +// escape all regexp magic characters
    +const regexpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
    +// everything has already been escaped, we just have to join
    +const rangesToString = (ranges) => ranges.join('');
    +// takes a glob string at a posix brace expression, and returns
    +// an equivalent regular expression source, and boolean indicating
    +// whether the /u flag needs to be applied, and the number of chars
    +// consumed to parse the character class.
    +// This also removes out of order ranges, and returns ($.) if the
    +// entire class just no good.
    +export const parseClass = (glob, position) => {
    +    const pos = position;
    +    /* c8 ignore start */
    +    if (glob.charAt(pos) !== '[') {
    +        throw new Error('not in a brace expression');
    +    }
    +    /* c8 ignore stop */
    +    const ranges = [];
    +    const negs = [];
    +    let i = pos + 1;
    +    let sawStart = false;
    +    let uflag = false;
    +    let escaping = false;
    +    let negate = false;
    +    let endPos = pos;
    +    let rangeStart = '';
    +    WHILE: while (i < glob.length) {
    +        const c = glob.charAt(i);
    +        if ((c === '!' || c === '^') && i === pos + 1) {
    +            negate = true;
    +            i++;
    +            continue;
    +        }
    +        if (c === ']' && sawStart && !escaping) {
    +            endPos = i + 1;
    +            break;
    +        }
    +        sawStart = true;
    +        if (c === '\\') {
    +            if (!escaping) {
    +                escaping = true;
    +                i++;
    +                continue;
    +            }
    +            // escaped \ char, fall through and treat like normal char
    +        }
    +        if (c === '[' && !escaping) {
    +            // either a posix class, a collation equivalent, or just a [
    +            for (const [cls, [unip, u, neg]] of Object.entries(posixClasses)) {
    +                if (glob.startsWith(cls, i)) {
    +                    // invalid, [a-[] is fine, but not [a-[:alpha]]
    +                    if (rangeStart) {
    +                        return ['$.', false, glob.length - pos, true];
    +                    }
    +                    i += cls.length;
    +                    if (neg)
    +                        negs.push(unip);
    +                    else
    +                        ranges.push(unip);
    +                    uflag = uflag || u;
    +                    continue WHILE;
    +                }
    +            }
    +        }
    +        // now it's just a normal character, effectively
    +        escaping = false;
    +        if (rangeStart) {
    +            // throw this range away if it's not valid, but others
    +            // can still match.
    +            if (c > rangeStart) {
    +                ranges.push(braceEscape(rangeStart) + '-' + braceEscape(c));
    +            }
    +            else if (c === rangeStart) {
    +                ranges.push(braceEscape(c));
    +            }
    +            rangeStart = '';
    +            i++;
    +            continue;
    +        }
    +        // now might be the start of a range.
    +        // can be either c-d or c-] or c] or c] at this point
    +        if (glob.startsWith('-]', i + 1)) {
    +            ranges.push(braceEscape(c + '-'));
    +            i += 2;
    +            continue;
    +        }
    +        if (glob.startsWith('-', i + 1)) {
    +            rangeStart = c;
    +            i += 2;
    +            continue;
    +        }
    +        // not the start of a range, just a single character
    +        ranges.push(braceEscape(c));
    +        i++;
    +    }
    +    if (endPos < i) {
    +        // didn't see the end of the class, not a valid class,
    +        // but might still be valid as a literal match.
    +        return ['', false, 0, false];
    +    }
    +    // if we got no ranges and no negates, then we have a range that
    +    // cannot possibly match anything, and that poisons the whole glob
    +    if (!ranges.length && !negs.length) {
    +        return ['$.', false, glob.length - pos, true];
    +    }
    +    // if we got one positive range, and it's a single character, then that's
    +    // not actually a magic pattern, it's just that one literal character.
    +    // we should not treat that as "magic", we should just return the literal
    +    // character. [_] is a perfectly valid way to escape glob magic chars.
    +    if (negs.length === 0 &&
    +        ranges.length === 1 &&
    +        /^\\?.$/.test(ranges[0]) &&
    +        !negate) {
    +        const r = ranges[0].length === 2 ? ranges[0].slice(-1) : ranges[0];
    +        return [regexpEscape(r), false, endPos - pos, false];
    +    }
    +    const sranges = '[' + (negate ? '^' : '') + rangesToString(ranges) + ']';
    +    const snegs = '[' + (negate ? '' : '^') + rangesToString(negs) + ']';
    +    const comb = ranges.length && negs.length
    +        ? '(' + sranges + '|' + snegs + ')'
    +        : ranges.length
    +            ? sranges
    +            : snegs;
    +    return [comb, uflag, endPos - pos, true];
    +};
    +//# sourceMappingURL=brace-expressions.js.map
    \ No newline at end of file
    diff --git a/deps/npm/node_modules/minimatch/dist/mjs/escape.js b/deps/npm/node_modules/minimatch/dist/mjs/escape.js
    new file mode 100644
    index 00000000000000..16f7c8c7bdc646
    --- /dev/null
    +++ b/deps/npm/node_modules/minimatch/dist/mjs/escape.js
    @@ -0,0 +1,18 @@
    +/**
    + * Escape all magic characters in a glob pattern.
    + *
    + * If the {@link windowsPathsNoEscape | GlobOptions.windowsPathsNoEscape}
    + * option is used, then characters are escaped by wrapping in `[]`, because
    + * a magic character wrapped in a character class can only be satisfied by
    + * that exact character.  In this mode, `\` is _not_ escaped, because it is
    + * not interpreted as a magic character, but instead as a path separator.
    + */
    +export const escape = (s, { windowsPathsNoEscape = false, } = {}) => {
    +    // don't need to escape +@! because we escape the parens
    +    // that make those magic, and escaping ! as [!] isn't valid,
    +    // because [!]] is a valid glob class meaning not ']'.
    +    return windowsPathsNoEscape
    +        ? s.replace(/[?*()[\]]/g, '[$&]')
    +        : s.replace(/[?*()[\]\\]/g, '\\$&');
    +};
    +//# sourceMappingURL=escape.js.map
    \ No newline at end of file
    diff --git a/deps/npm/node_modules/minimatch/dist/mjs/extglob.js b/deps/npm/node_modules/minimatch/dist/mjs/extglob.js
    new file mode 100644
    index 00000000000000..4033f4d60e34d5
    --- /dev/null
    +++ b/deps/npm/node_modules/minimatch/dist/mjs/extglob.js
    @@ -0,0 +1,3 @@
    +// translate an extglob into a regular expression
    +export {};
    +//# sourceMappingURL=extglob.js.map
    \ No newline at end of file
    diff --git a/deps/npm/node_modules/minimatch/dist/mjs/index.d.ts b/deps/npm/node_modules/minimatch/dist/mjs/index.d.ts
    deleted file mode 100644
    index cca07a8280d896..00000000000000
    --- a/deps/npm/node_modules/minimatch/dist/mjs/index.d.ts
    +++ /dev/null
    @@ -1,71 +0,0 @@
    -export interface MinimatchOptions {
    -    nobrace?: boolean;
    -    nocomment?: boolean;
    -    nonegate?: boolean;
    -    debug?: boolean;
    -    noglobstar?: boolean;
    -    noext?: boolean;
    -    nonull?: boolean;
    -    windowsPathsNoEscape?: boolean;
    -    allowWindowsEscape?: boolean;
    -    partial?: boolean;
    -    dot?: boolean;
    -    nocase?: boolean;
    -    nocaseMagicOnly?: boolean;
    -    matchBase?: boolean;
    -    flipNegate?: boolean;
    -    preserveMultipleSlashes?: boolean;
    -}
    -export declare const minimatch: {
    -    (p: string, pattern: string, options?: MinimatchOptions): boolean;
    -    sep: string;
    -    GLOBSTAR: typeof GLOBSTAR;
    -    filter: (pattern: string, options?: MinimatchOptions) => (p: string) => boolean;
    -    defaults: (def: MinimatchOptions) => typeof minimatch;
    -    braceExpand: (pattern: string, options?: MinimatchOptions) => string[];
    -    makeRe: (pattern: string, options?: MinimatchOptions) => false | MMRegExp;
    -    match: (list: string[], pattern: string, options?: MinimatchOptions) => string[];
    -    Minimatch: typeof Minimatch;
    -};
    -export default minimatch;
    -export declare const sep: string;
    -export declare const GLOBSTAR: unique symbol;
    -export declare const filter: (pattern: string, options?: MinimatchOptions) => (p: string) => boolean;
    -export declare const defaults: (def: MinimatchOptions) => typeof minimatch;
    -export declare const braceExpand: (pattern: string, options?: MinimatchOptions) => string[];
    -declare const SUBPARSE: unique symbol;
    -export declare const makeRe: (pattern: string, options?: MinimatchOptions) => false | MMRegExp;
    -export declare const match: (list: string[], pattern: string, options?: MinimatchOptions) => string[];
    -export type MMRegExp = RegExp & {
    -    _src?: string;
    -    _glob?: string;
    -};
    -type SubparseReturn = [string, boolean];
    -type ParseReturnFiltered = string | MMRegExp | typeof GLOBSTAR;
    -type ParseReturn = ParseReturnFiltered | false;
    -export declare class Minimatch {
    -    options: MinimatchOptions;
    -    set: ParseReturnFiltered[][];
    -    pattern: string;
    -    windowsPathsNoEscape: boolean;
    -    nonegate: boolean;
    -    negate: boolean;
    -    comment: boolean;
    -    empty: boolean;
    -    preserveMultipleSlashes: boolean;
    -    partial: boolean;
    -    globSet: string[];
    -    globParts: string[][];
    -    regexp: false | null | MMRegExp;
    -    constructor(pattern: string, options?: MinimatchOptions);
    -    debug(..._: any[]): void;
    -    make(): void;
    -    parseNegate(): void;
    -    matchOne(file: string[], pattern: ParseReturn[], partial?: boolean): boolean;
    -    braceExpand(): string[];
    -    parse(pattern: string, isSub?: typeof SUBPARSE): ParseReturn | SubparseReturn;
    -    makeRe(): false | MMRegExp;
    -    slashSplit(p: string): string[];
    -    match(f: string, partial?: boolean): boolean;
    -    static defaults(def: MinimatchOptions): typeof Minimatch;
    -}
    diff --git a/deps/npm/node_modules/minimatch/dist/mjs/index.js b/deps/npm/node_modules/minimatch/dist/mjs/index.js
    index 59ac1968b5ded3..34d53abafc8ea4 100644
    --- a/deps/npm/node_modules/minimatch/dist/mjs/index.js
    +++ b/deps/npm/node_modules/minimatch/dist/mjs/index.js
    @@ -1,3 +1,7 @@
    +import expand from 'brace-expansion';
    +import { parseClass } from './brace-expressions.js';
    +import { escape } from './escape.js';
    +import { unescape } from './unescape.js';
     export const minimatch = (p, pattern, options = {}) => {
         assertValidPattern(pattern);
         // shortcut: comments match nothing.
    @@ -59,20 +63,21 @@ const qmarksTestNoExtDot = ([$0]) => {
         return (f) => f.length === len && f !== '.' && f !== '..';
     };
     /* c8 ignore start */
    -const platform = typeof process === 'object' && process
    +const defaultPlatform = (typeof process === 'object' && process
         ? (typeof process.env === 'object' &&
             process.env &&
             process.env.__MINIMATCH_TESTING_PLATFORM__) ||
             process.platform
    -    : 'posix';
    -const isWindows = platform === 'win32';
    -const path = isWindows ? { sep: '\\' } : { sep: '/' };
    +    : 'posix');
    +const path = {
    +    win32: { sep: '\\' },
    +    posix: { sep: '/' },
    +};
     /* c8 ignore stop */
    -export const sep = path.sep;
    +export const sep = defaultPlatform === 'win32' ? path.win32.sep : path.posix.sep;
     minimatch.sep = sep;
     export const GLOBSTAR = Symbol('globstar **');
     minimatch.GLOBSTAR = GLOBSTAR;
    -import expand from 'brace-expansion';
     const plTypes = {
         '!': { open: '(?:(?!(?:', close: '))[^/]*?)' },
         '?': { open: '(?:', close: ')?' },
    @@ -119,6 +124,8 @@ export const defaults = (def) => {
                     return orig.defaults(ext(def, options)).Minimatch;
                 }
             },
    +        unescape: (s, options = {}) => orig.unescape(s, ext(def, options)),
    +        escape: (s, options = {}) => orig.escape(s, ext(def, options)),
             filter: (pattern, options = {}) => orig.filter(pattern, ext(def, options)),
             defaults: (options) => orig.defaults(ext(def, options)),
             makeRe: (pattern, options = {}) => orig.makeRe(pattern, ext(def, options)),
    @@ -170,7 +177,6 @@ const assertValidPattern = (pattern) => {
     // when it is the *only* thing in a path portion.  Otherwise, any series
     // of * is equivalent to a single *.  Globstar behavior is enabled by
     // default, and can be disabled by setting options.noglobstar.
    -const SUBPARSE = Symbol('subparse');
     export const makeRe = (pattern, options = {}) => new Minimatch(pattern, options).makeRe();
     minimatch.makeRe = makeRe;
     export const match = (list, pattern, options = {}) => {
    @@ -184,9 +190,8 @@ export const match = (list, pattern, options = {}) => {
     minimatch.match = match;
     // replace stuff like \* with *
     const globUnescape = (s) => s.replace(/\\(.)/g, '$1');
    -const charUnescape = (s) => s.replace(/\\([^-\]])/g, '$1');
    +const globMagic = /[?*]|[+@!]\(.*?\)|\[|\]/;
     const regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
    -const braExpEscape = (s) => s.replace(/[[\]\\]/g, '\\$&');
     export class Minimatch {
         options;
         set;
    @@ -200,12 +205,18 @@ export class Minimatch {
         partial;
         globSet;
         globParts;
    +    nocase;
    +    isWindows;
    +    platform;
    +    windowsNoMagicRoot;
         regexp;
         constructor(pattern, options = {}) {
             assertValidPattern(pattern);
             options = options || {};
             this.options = options;
             this.pattern = pattern;
    +        this.platform = options.platform || defaultPlatform;
    +        this.isWindows = this.platform === 'win32';
             this.windowsPathsNoEscape =
                 !!options.windowsPathsNoEscape || options.allowWindowsEscape === false;
             if (this.windowsPathsNoEscape) {
    @@ -218,12 +229,29 @@ export class Minimatch {
             this.comment = false;
             this.empty = false;
             this.partial = !!options.partial;
    +        this.nocase = !!this.options.nocase;
    +        this.windowsNoMagicRoot =
    +            options.windowsNoMagicRoot !== undefined
    +                ? options.windowsNoMagicRoot
    +                : !!(this.isWindows && this.nocase);
             this.globSet = [];
             this.globParts = [];
             this.set = [];
             // make the set of regexps etc.
             this.make();
         }
    +    hasMagic() {
    +        if (this.options.magicalBraces && this.set.length > 1) {
    +            return true;
    +        }
    +        for (const pattern of this.set) {
    +            for (const part of pattern) {
    +                if (typeof part !== 'string')
    +                    return true;
    +            }
    +        }
    +        return false;
    +    }
         debug(..._) { }
         make() {
             const pattern = this.pattern;
    @@ -240,73 +268,46 @@ export class Minimatch {
             // step 1: figure out negation, etc.
             this.parseNegate();
             // step 2: expand braces
    -        this.globSet = this.braceExpand();
    +        this.globSet = [...new Set(this.braceExpand())];
             if (options.debug) {
                 this.debug = (...args) => console.error(...args);
             }
             this.debug(this.pattern, this.globSet);
    -        // step 3: now we have a set, so turn each one into a series of path-portion
    -        // matching patterns.
    +        // step 3: now we have a set, so turn each one into a series of
    +        // path-portion matching patterns.
             // These will be regexps, except in the case of "**", which is
             // set to the GLOBSTAR object for globstar behavior,
             // and will not contain any / characters
    +        //
    +        // First, we preprocess to make the glob pattern sets a bit simpler
    +        // and deduped.  There are some perf-killing patterns that can cause
    +        // problems with a glob walk, but we can simplify them down a bit.
             const rawGlobParts = this.globSet.map(s => this.slashSplit(s));
    -        // consecutive globstars are an unncessary perf killer
    -        // also, **/*/... is equivalent to */**/..., so swap all of those
    -        // this turns a pattern like **/*/**/*/x into */*/**/x
    -        // and a pattern like **/x/**/*/y becomes **/x/*/**/y
    -        // the *later* we can push the **, the more efficient it is,
    -        // because we can avoid having to do a recursive walk until
    -        // the walked tree is as shallow as possible.
    -        // Note that this is only true up to the last pattern, though, because
    -        // a/*/** will only match a/b if b is a dir, but a/**/* will match a/b
    -        // regardless, since it's "0 or more path segments" if it's not final.
    -        if (this.options.noglobstar) {
    -            // ** is * anyway
    -            this.globParts = rawGlobParts;
    -        }
    -        else {
    -            // do this swap BEFORE the reduce, so that we can turn a string
    -            // of **/*/**/* into */*/**/** and then reduce the **'s into one
    -            for (const parts of rawGlobParts) {
    -                let swapped;
    -                do {
    -                    swapped = false;
    -                    for (let i = 0; i < parts.length - 1; i++) {
    -                        if (parts[i] === '*' && parts[i - 1] === '**') {
    -                            parts[i] = '**';
    -                            parts[i - 1] = '*';
    -                            swapped = true;
    -                        }
    -                    }
    -                } while (swapped);
    -            }
    -            this.globParts = rawGlobParts.map(parts => {
    -                parts = parts.reduce((set, part) => {
    -                    const prev = set[set.length - 1];
    -                    if (part === '**' && prev === '**') {
    -                        return set;
    -                    }
    -                    if (part === '..') {
    -                        if (prev && prev !== '..' && prev !== '.' && prev !== '**') {
    -                            set.pop();
    -                            return set;
    -                        }
    -                    }
    -                    set.push(part);
    -                    return set;
    -                }, []);
    -                return parts.length === 0 ? [''] : parts;
    -            });
    -        }
    +        this.globParts = this.preprocess(rawGlobParts);
             this.debug(this.pattern, this.globParts);
             // glob --> regexps
    -        let set = this.globParts.map((s, _, __) => s.map(ss => this.parse(ss)));
    +        let set = this.globParts.map((s, _, __) => {
    +            if (this.isWindows && this.windowsNoMagicRoot) {
    +                // check if it's a drive or unc path.
    +                const isUNC = s[0] === '' &&
    +                    s[1] === '' &&
    +                    (s[2] === '?' || !globMagic.test(s[2])) &&
    +                    !globMagic.test(s[3]);
    +                const isDrive = /^[a-z]:/i.test(s[0]);
    +                if (isUNC) {
    +                    return [...s.slice(0, 4), ...s.slice(4).map(ss => this.parse(ss))];
    +                }
    +                else if (isDrive) {
    +                    return [s[0], ...s.slice(1).map(ss => this.parse(ss))];
    +                }
    +            }
    +            return s.map(ss => this.parse(ss));
    +        });
             this.debug(this.pattern, set);
             // filter out everything that didn't compile properly.
             this.set = set.filter(s => s.indexOf(false) === -1);
             // do not treat the ? in UNC paths as magic
    -        if (isWindows) {
    +        if (this.isWindows) {
                 for (let i = 0; i < this.set.length; i++) {
                     const p = this.set[i];
                     if (p[0] === '' &&
    @@ -320,6 +321,276 @@ export class Minimatch {
             }
             this.debug(this.pattern, this.set);
         }
    +    // various transforms to equivalent pattern sets that are
    +    // faster to process in a filesystem walk.  The goal is to
    +    // eliminate what we can, and push all ** patterns as far
    +    // to the right as possible, even if it increases the number
    +    // of patterns that we have to process.
    +    preprocess(globParts) {
    +        // if we're not in globstar mode, then turn all ** into *
    +        if (this.options.noglobstar) {
    +            for (let i = 0; i < globParts.length; i++) {
    +                for (let j = 0; j < globParts[i].length; j++) {
    +                    if (globParts[i][j] === '**') {
    +                        globParts[i][j] = '*';
    +                    }
    +                }
    +            }
    +        }
    +        const { optimizationLevel = 1 } = this.options;
    +        if (optimizationLevel >= 2) {
    +            // aggressive optimization for the purpose of fs walking
    +            globParts = this.firstPhasePreProcess(globParts);
    +            globParts = this.secondPhasePreProcess(globParts);
    +        }
    +        else if (optimizationLevel >= 1) {
    +            // just basic optimizations to remove some .. parts
    +            globParts = this.levelOneOptimize(globParts);
    +        }
    +        else {
    +            globParts = this.adjascentGlobstarOptimize(globParts);
    +        }
    +        return globParts;
    +    }
    +    // just get rid of adjascent ** portions
    +    adjascentGlobstarOptimize(globParts) {
    +        return globParts.map(parts => {
    +            let gs = -1;
    +            while (-1 !== (gs = parts.indexOf('**', gs + 1))) {
    +                let i = gs;
    +                while (parts[i + 1] === '**') {
    +                    i++;
    +                }
    +                if (i !== gs) {
    +                    parts.splice(gs, i - gs);
    +                }
    +            }
    +            return parts;
    +        });
    +    }
    +    // get rid of adjascent ** and resolve .. portions
    +    levelOneOptimize(globParts) {
    +        return globParts.map(parts => {
    +            parts = parts.reduce((set, part) => {
    +                const prev = set[set.length - 1];
    +                if (part === '**' && prev === '**') {
    +                    return set;
    +                }
    +                if (part === '..') {
    +                    if (prev && prev !== '..' && prev !== '.' && prev !== '**') {
    +                        set.pop();
    +                        return set;
    +                    }
    +                }
    +                set.push(part);
    +                return set;
    +            }, []);
    +            return parts.length === 0 ? [''] : parts;
    +        });
    +    }
    +    levelTwoFileOptimize(parts) {
    +        if (!Array.isArray(parts)) {
    +            parts = this.slashSplit(parts);
    +        }
    +        let didSomething = false;
    +        do {
    +            didSomething = false;
    +            // 
    // -> 
    /
    +            if (!this.preserveMultipleSlashes) {
    +                for (let i = 1; i < parts.length - 1; i++) {
    +                    const p = parts[i];
    +                    // don't squeeze out UNC patterns
    +                    if (i === 1 && p === '' && parts[0] === '')
    +                        continue;
    +                    if (p === '.' || p === '') {
    +                        didSomething = true;
    +                        parts.splice(i, 1);
    +                        i--;
    +                    }
    +                }
    +                if (parts[0] === '.' &&
    +                    parts.length === 2 &&
    +                    (parts[1] === '.' || parts[1] === '')) {
    +                    didSomething = true;
    +                    parts.pop();
    +                }
    +            }
    +            // 
    /

    /../ ->

    /
    +            let dd = 0;
    +            while (-1 !== (dd = parts.indexOf('..', dd + 1))) {
    +                const p = parts[dd - 1];
    +                if (p && p !== '.' && p !== '..' && p !== '**') {
    +                    didSomething = true;
    +                    parts.splice(dd - 1, 2);
    +                    dd -= 2;
    +                }
    +            }
    +        } while (didSomething);
    +        return parts.length === 0 ? [''] : parts;
    +    }
    +    // First phase: single-pattern processing
    +    // 
     is 1 or more portions
    +    //  is 1 or more portions
    +    // 

    is any portion other than ., .., '', or ** + // is . or '' + // + // **/.. is *brutal* for filesystem walking performance, because + // it effectively resets the recursive walk each time it occurs, + // and ** cannot be reduced out by a .. pattern part like a regexp + // or most strings (other than .., ., and '') can be. + // + //

    /**/../

    /

    / -> {

    /../

    /

    /,

    /**/

    /

    /} + //

    // -> 
    /
    +    // 
    /

    /../ ->

    /
    +    // **/**/ -> **/
    +    //
    +    // **/*/ -> */**/ <== not valid because ** doesn't follow
    +    // this WOULD be allowed if ** did follow symlinks, or * didn't
    +    firstPhasePreProcess(globParts) {
    +        let didSomething = false;
    +        do {
    +            didSomething = false;
    +            // 
    /**/../

    /

    / -> {

    /../

    /

    /,

    /**/

    /

    /} + for (let parts of globParts) { + let gs = -1; + while (-1 !== (gs = parts.indexOf('**', gs + 1))) { + let gss = gs; + while (parts[gss + 1] === '**') { + //

    /**/**/ -> 
    /**/
    +                        gss++;
    +                    }
    +                    // eg, if gs is 2 and gss is 4, that means we have 3 **
    +                    // parts, and can remove 2 of them.
    +                    if (gss > gs) {
    +                        parts.splice(gs + 1, gss - gs);
    +                    }
    +                    let next = parts[gs + 1];
    +                    const p = parts[gs + 2];
    +                    const p2 = parts[gs + 3];
    +                    if (next !== '..')
    +                        continue;
    +                    if (!p ||
    +                        p === '.' ||
    +                        p === '..' ||
    +                        !p2 ||
    +                        p2 === '.' ||
    +                        p2 === '..') {
    +                        continue;
    +                    }
    +                    didSomething = true;
    +                    // edit parts in place, and push the new one
    +                    parts.splice(gs, 1);
    +                    const other = parts.slice(0);
    +                    other[gs] = '**';
    +                    globParts.push(other);
    +                    gs--;
    +                }
    +                // 
    // -> 
    /
    +                if (!this.preserveMultipleSlashes) {
    +                    for (let i = 1; i < parts.length - 1; i++) {
    +                        const p = parts[i];
    +                        // don't squeeze out UNC patterns
    +                        if (i === 1 && p === '' && parts[0] === '')
    +                            continue;
    +                        if (p === '.' || p === '') {
    +                            didSomething = true;
    +                            parts.splice(i, 1);
    +                            i--;
    +                        }
    +                    }
    +                    if (parts[0] === '.' &&
    +                        parts.length === 2 &&
    +                        (parts[1] === '.' || parts[1] === '')) {
    +                        didSomething = true;
    +                        parts.pop();
    +                    }
    +                }
    +                // 
    /

    /../ ->

    /
    +                let dd = 0;
    +                while (-1 !== (dd = parts.indexOf('..', dd + 1))) {
    +                    const p = parts[dd - 1];
    +                    if (p && p !== '.' && p !== '..' && p !== '**') {
    +                        didSomething = true;
    +                        const needDot = dd === 1 && parts[dd + 1] === '**';
    +                        const splin = needDot ? ['.'] : [];
    +                        parts.splice(dd - 1, 2, ...splin);
    +                        if (parts.length === 0)
    +                            parts.push('');
    +                        dd -= 2;
    +                    }
    +                }
    +            }
    +        } while (didSomething);
    +        return globParts;
    +    }
    +    // second phase: multi-pattern dedupes
    +    // {
    /*/,
    /

    /} ->

    /*/
    +    // {
    /,
    /} -> 
    /
    +    // {
    /**/,
    /} -> 
    /**/
    +    //
    +    // {
    /**/,
    /**/

    /} ->

    /**/
    +    // ^-- not valid because ** doens't follow symlinks
    +    secondPhasePreProcess(globParts) {
    +        for (let i = 0; i < globParts.length - 1; i++) {
    +            for (let j = i + 1; j < globParts.length; j++) {
    +                const matched = this.partsMatch(globParts[i], globParts[j], !this.preserveMultipleSlashes);
    +                if (!matched)
    +                    continue;
    +                globParts[i] = matched;
    +                globParts[j] = [];
    +            }
    +        }
    +        return globParts.filter(gs => gs.length);
    +    }
    +    partsMatch(a, b, emptyGSMatch = false) {
    +        let ai = 0;
    +        let bi = 0;
    +        let result = [];
    +        let which = '';
    +        while (ai < a.length && bi < b.length) {
    +            if (a[ai] === b[bi]) {
    +                result.push(which === 'b' ? b[bi] : a[ai]);
    +                ai++;
    +                bi++;
    +            }
    +            else if (emptyGSMatch && a[ai] === '**' && b[bi] === a[ai + 1]) {
    +                result.push(a[ai]);
    +                ai++;
    +            }
    +            else if (emptyGSMatch && b[bi] === '**' && a[ai] === b[bi + 1]) {
    +                result.push(b[bi]);
    +                bi++;
    +            }
    +            else if (a[ai] === '*' &&
    +                b[bi] &&
    +                (this.options.dot || !b[bi].startsWith('.')) &&
    +                b[bi] !== '**') {
    +                if (which === 'b')
    +                    return false;
    +                which = 'a';
    +                result.push(a[ai]);
    +                ai++;
    +                bi++;
    +            }
    +            else if (b[bi] === '*' &&
    +                a[ai] &&
    +                (this.options.dot || !a[ai].startsWith('.')) &&
    +                a[ai] !== '**') {
    +                if (which === 'a')
    +                    return false;
    +                which = 'b';
    +                result.push(b[bi]);
    +                ai++;
    +                bi++;
    +            }
    +            else {
    +                return false;
    +            }
    +        }
    +        // if we fall out of the loop, it means they two are identical
    +        // as long as their lengths match
    +        return a.length === b.length && result;
    +    }
         parseNegate() {
             if (this.nonegate)
                 return;
    @@ -343,7 +614,7 @@ export class Minimatch {
             const options = this.options;
             // a UNC pattern like //?/c:/* can match a path like c:/x
             // and vice versa
    -        if (isWindows) {
    +        if (this.isWindows) {
                 const fileUNC = file[0] === '' &&
                     file[1] === '' &&
                     file[2] === '?' &&
    @@ -377,6 +648,12 @@ export class Minimatch {
                     }
                 }
             }
    +        // resolve and reduce . and .. portions in the file as well.
    +        // dont' need to do the second phase, because it's only one string[]
    +        const { optimizationLevel = 1 } = this.options;
    +        if (optimizationLevel >= 2) {
    +            file = this.levelTwoFileOptimize(file);
    +        }
             this.debug('matchOne', this, { file, pattern });
             this.debug('matchOne', file.length, pattern.length);
             for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
    @@ -524,50 +801,44 @@ export class Minimatch {
         braceExpand() {
             return braceExpand(this.pattern, this.options);
         }
    -    parse(pattern, isSub) {
    +    parse(pattern) {
             assertValidPattern(pattern);
             const options = this.options;
             // shortcuts
    -        if (pattern === '**') {
    -            if (!options.noglobstar)
    -                return GLOBSTAR;
    -            else
    -                pattern = '*';
    -        }
    +        if (pattern === '**')
    +            return GLOBSTAR;
             if (pattern === '')
                 return '';
             // far and away, the most common glob pattern parts are
             // *, *.*, and *.  Add a fast check method for those.
             let m;
             let fastTest = null;
    -        if (isSub !== SUBPARSE) {
    -            if ((m = pattern.match(starRE))) {
    -                fastTest = options.dot ? starTestDot : starTest;
    -            }
    -            else if ((m = pattern.match(starDotExtRE))) {
    -                fastTest = (options.nocase
    -                    ? options.dot
    -                        ? starDotExtTestNocaseDot
    -                        : starDotExtTestNocase
    -                    : options.dot
    -                        ? starDotExtTestDot
    -                        : starDotExtTest)(m[1]);
    -            }
    -            else if ((m = pattern.match(qmarksRE))) {
    -                fastTest = (options.nocase
    -                    ? options.dot
    -                        ? qmarksTestNocaseDot
    -                        : qmarksTestNocase
    -                    : options.dot
    -                        ? qmarksTestDot
    -                        : qmarksTest)(m);
    -            }
    -            else if ((m = pattern.match(starDotStarRE))) {
    -                fastTest = options.dot ? starDotStarTestDot : starDotStarTest;
    -            }
    -            else if ((m = pattern.match(dotStarRE))) {
    -                fastTest = dotStarTest;
    -            }
    +        if ((m = pattern.match(starRE))) {
    +            fastTest = options.dot ? starTestDot : starTest;
    +        }
    +        else if ((m = pattern.match(starDotExtRE))) {
    +            fastTest = (options.nocase
    +                ? options.dot
    +                    ? starDotExtTestNocaseDot
    +                    : starDotExtTestNocase
    +                : options.dot
    +                    ? starDotExtTestDot
    +                    : starDotExtTest)(m[1]);
    +        }
    +        else if ((m = pattern.match(qmarksRE))) {
    +            fastTest = (options.nocase
    +                ? options.dot
    +                    ? qmarksTestNocaseDot
    +                    : qmarksTestNocase
    +                : options.dot
    +                    ? qmarksTestDot
    +                    : qmarksTest)(m);
    +        }
    +        else if ((m = pattern.match(starDotStarRE))) {
    +            fastTest = options.dot ? starDotStarTestDot : starDotStarTest;
    +        }
    +        else if ((m = pattern.match(dotStarRE))) {
    +            fastTest = dotStarTest;
             }
             let re = '';
             let hasMagic = false;
    @@ -576,12 +847,8 @@ export class Minimatch {
             const patternListStack = [];
             const negativeLists = [];
             let stateChar = false;
    -        let inClass = false;
    -        let reClassStart = -1;
    -        let classStart = -1;
    -        let cs;
    +        let uflag = false;
             let pl;
    -        let sp;
             // . and .. never match anything that doesn't start with .,
             // even when options.dot is set.  However, if the pattern
             // starts with ., then traversal patterns can match.
    @@ -644,10 +911,6 @@ export class Minimatch {
                     }
                     /* c8 ignore stop */
                     case '\\':
    -                    if (inClass && pattern.charAt(i + 1) === '-') {
    -                        re += c;
    -                        continue;
    -                    }
                         clearStateChar();
                         escaping = true;
                         continue;
    @@ -659,15 +922,6 @@ export class Minimatch {
                     case '@':
                     case '!':
                         this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c);
    -                    // all of those are literals inside a class, except that
    -                    // the glob [!a] means [^a] in regexp
    -                    if (inClass) {
    -                        this.debug('  in class');
    -                        if (c === '!' && i === classStart + 1)
    -                            c = '^';
    -                        re += c;
    -                        continue;
    -                    }
                         // if we already have a stateChar, then it means
                         // that there was something like ** or +? in there.
                         // Handle the stateChar, then proceed with this one.
    @@ -681,10 +935,6 @@ export class Minimatch {
                             clearStateChar();
                         continue;
                     case '(': {
    -                    if (inClass) {
    -                        re += '(';
    -                        continue;
    -                    }
                         if (!stateChar) {
                             re += '\\(';
                             continue;
    @@ -711,7 +961,7 @@ export class Minimatch {
                     }
                     case ')': {
                         const plEntry = patternListStack[patternListStack.length - 1];
    -                    if (inClass || !plEntry) {
    +                    if (!plEntry) {
                             re += '\\)';
                             continue;
                         }
    @@ -730,7 +980,7 @@ export class Minimatch {
                     }
                     case '|': {
                         const plEntry = patternListStack[patternListStack.length - 1];
    -                    if (inClass || !plEntry) {
    +                    if (!plEntry) {
                             re += '\\|';
                             continue;
                         }
    @@ -747,67 +997,27 @@ export class Minimatch {
                     case '[':
                         // swallow any state-tracking char before the [
                         clearStateChar();
    -                    if (inClass) {
    -                        re += '\\' + c;
    -                        continue;
    +                    const [src, needUflag, consumed, magic] = parseClass(pattern, i);
    +                    if (consumed) {
    +                        re += src;
    +                        uflag = uflag || needUflag;
    +                        i += consumed - 1;
    +                        hasMagic = hasMagic || magic;
    +                    }
    +                    else {
    +                        re += '\\[';
                         }
    -                    inClass = true;
    -                    classStart = i;
    -                    reClassStart = re.length;
    -                    re += c;
                         continue;
                     case ']':
    -                    //  a right bracket shall lose its special
    -                    //  meaning and represent itself in
    -                    //  a bracket expression if it occurs
    -                    //  first in the list.  -- POSIX.2 2.8.3.2
    -                    if (i === classStart + 1 || !inClass) {
    -                        re += '\\' + c;
    -                        continue;
    -                    }
    -                    // split where the last [ was, make sure we don't have
    -                    // an invalid re. if so, re-walk the contents of the
    -                    // would-be class to re-translate any characters that
    -                    // were passed through as-is
    -                    // TODO: It would probably be faster to determine this
    -                    // without a try/catch and a new RegExp, but it's tricky
    -                    // to do safely.  For now, this is safe and works.
    -                    cs = pattern.substring(classStart + 1, i);
    -                    try {
    -                        RegExp('[' + braExpEscape(charUnescape(cs)) + ']');
    -                        // looks good, finish up the class.
    -                        re += c;
    -                    }
    -                    catch (er) {
    -                        // out of order ranges in JS are errors, but in glob syntax,
    -                        // they're just a range that matches nothing.
    -                        re = re.substring(0, reClassStart) + '(?:$.)'; // match nothing ever
    -                    }
    -                    hasMagic = true;
    -                    inClass = false;
    +                    re += '\\' + c;
                         continue;
                     default:
                         // swallow any state char that wasn't consumed
                         clearStateChar();
    -                    if (reSpecials[c] && !(c === '^' && inClass)) {
    -                        re += '\\';
    -                    }
    -                    re += c;
    +                    re += regExpEscape(c);
                         break;
                 } // switch
             } // for
    -        // handle the case where we left a class open.
    -        // "[abc" is valid, equivalent to "\[abc"
    -        if (inClass) {
    -            // split where the last [ was, and escape it
    -            // this is a huge pita.  We now have to re-walk
    -            // the contents of the would-be class to re-translate
    -            // any characters that were passed through as-is
    -            cs = pattern.slice(classStart + 1);
    -            sp = this.parse(cs, SUBPARSE);
    -            re = re.substring(0, reClassStart) + '\\[' + sp[0];
    -            hasMagic = hasMagic || sp[1];
    -        }
             // handle the case where we had a +( thing at the *end*
             // of the pattern.
             // each pattern list stack adds 3 chars, and we need to go through
    @@ -870,7 +1080,7 @@ export class Minimatch {
                     cleanAfter = cleanAfter.replace(/\)[+*?]?/, '');
                 }
                 nlAfter = cleanAfter;
    -            const dollar = nlAfter === '' && isSub !== SUBPARSE ? '(?:$|\\/)' : '';
    +            const dollar = nlAfter === '' ? '(?:$|\\/)' : '';
                 re = nlBefore + nlFirst + nlAfter + dollar + nlLast;
             }
             // if the re is not "" at this point, then we need to make sure
    @@ -882,10 +1092,6 @@ export class Minimatch {
             if (addPatternStart) {
                 re = patternStart() + re;
             }
    -        // parsing just a piece of a larger pattern.
    -        if (isSub === SUBPARSE) {
    -            return [re, hasMagic];
    -        }
             // if it's nocase, and the lcase/uppercase don't match, it's magic
             if (options.nocase && !hasMagic && !options.nocaseMagicOnly) {
                 hasMagic = pattern.toUpperCase() !== pattern.toLowerCase();
    @@ -894,9 +1100,9 @@ export class Minimatch {
             // unescape anything in it, though, so that it'll be
             // an exact match against a file etc.
             if (!hasMagic) {
    -            return globUnescape(pattern);
    +            return globUnescape(re);
             }
    -        const flags = options.nocase ? 'i' : '';
    +        const flags = (options.nocase ? 'i' : '') + (uflag ? 'u' : '');
             try {
                 const ext = fastTest
                     ? {
    @@ -1006,7 +1212,7 @@ export class Minimatch {
             if (this.preserveMultipleSlashes) {
                 return p.split('/');
             }
    -        else if (isWindows && /^\/\/[^\/]+/.test(p)) {
    +        else if (this.isWindows && /^\/\/[^\/]+/.test(p)) {
                 // add an extra '' for the one we lose
                 return ['', ...p.split(/\/+/)];
             }
    @@ -1029,8 +1235,8 @@ export class Minimatch {
             }
             const options = this.options;
             // windows: need to use /, not \
    -        if (path.sep !== '/') {
    -            f = f.split(path.sep).join('/');
    +        if (this.isWindows) {
    +            f = f.split('\\').join('/');
             }
             // treat the test path as a set of pathparts.
             const ff = this.slashSplit(f);
    @@ -1073,5 +1279,11 @@ export class Minimatch {
             return minimatch.defaults(def).Minimatch;
         }
     }
    +/* c8 ignore start */
    +export { escape } from './escape.js';
    +export { unescape } from './unescape.js';
    +/* c8 ignore stop */
     minimatch.Minimatch = Minimatch;
    +minimatch.escape = escape;
    +minimatch.unescape = unescape;
     //# sourceMappingURL=index.js.map
    \ No newline at end of file
    diff --git a/deps/npm/node_modules/minimatch/dist/mjs/index.js.map b/deps/npm/node_modules/minimatch/dist/mjs/index.js.map
    deleted file mode 100644
    index 854172c5bd0f01..00000000000000
    --- a/deps/npm/node_modules/minimatch/dist/mjs/index.js.map
    +++ /dev/null
    @@ -1 +0,0 @@
    -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAmBA,MAAM,CAAC,MAAM,SAAS,GAAG,CACvB,CAAS,EACT,OAAe,EACf,UAA4B,EAAE,EAC9B,EAAE;IACF,kBAAkB,CAAC,OAAO,CAAC,CAAA;IAE3B,oCAAoC;IACpC,IAAI,CAAC,OAAO,CAAC,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE;QACnD,OAAO,KAAK,CAAA;KACb;IAED,OAAO,IAAI,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;AACjD,CAAC,CAAA;AAED,eAAe,SAAS,CAAA;AAExB,wDAAwD;AACxD,MAAM,YAAY,GAAG,uBAAuB,CAAA;AAC5C,MAAM,cAAc,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,CAAC,CAAS,EAAE,EAAE,CACpD,CAAC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AAC,GAAqB;QACnC,OAAO,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,SAAS,CAAA;IAC1C,CAAC;CACF;AAED,SAAS,CAAC,SAAS,GAAG,SAAS,CAAA"}
    \ No newline at end of file
    diff --git a/deps/npm/node_modules/minimatch/dist/mjs/parse.js b/deps/npm/node_modules/minimatch/dist/mjs/parse.js
    new file mode 100644
    index 00000000000000..70a26dee58f30b
    --- /dev/null
    +++ b/deps/npm/node_modules/minimatch/dist/mjs/parse.js
    @@ -0,0 +1,646 @@
    +// parse a single path portion
    +import { parseClass } from './brace-expressions';
    +const types = new Set(['!', '?', '+', '*', '@']);
    +const isExtglobType = (c) => types.has(c);
    +// characters that indicate a start of pattern needs the "no dots" bit
    +const addPatternStart = new Set(['[', '.']);
    +const justDots = new Set(['..', '.']);
    +const reSpecials = new Set('().*{}+?[]^$\\!');
    +const regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
    +// any single thing other than /
    +// don't need to escape / when using new RegExp()
    +const qmark = '[^/]';
    +// * => any number of characters
    +const star = qmark + '*?';
    +export class AST {
    +    type;
    +    #root;
    +    #parts = [];
    +    #parent;
    +    #parentIndex;
    +    #negs;
    +    #filledNegs = false;
    +    #options;
    +    constructor(type, parent, options = {}) {
    +        this.type = type;
    +        this.#parent = parent;
    +        this.#root = this.#parent ? this.#parent.#root : this;
    +        this.#options = this.#root === this ? options : this.#root.#options;
    +        this.#negs = this.#root === this ? [] : this.#root.#negs;
    +        if (type === '!' && !this.#root.#filledNegs)
    +            this.#negs.push(this);
    +        this.#parentIndex = this.#parent ? this.#parent.#parts.length : 0;
    +    }
    +    fillNegs() {
    +        if (this !== this.#root) {
    +            this.#root.fillNegs();
    +            return this;
    +        }
    +        if (this.#filledNegs)
    +            return this;
    +        this.#filledNegs = true;
    +        let n;
    +        while ((n = this.#negs.pop())) {
    +            if (n.type !== '!')
    +                continue;
    +            // walk up the tree, appending everthing that comes AFTER parentIndex
    +            let p = n;
    +            let pp = p.#parent;
    +            while (pp) {
    +                for (let i = p.#parentIndex + 1; !pp.type && i < pp.#parts.length; i++) {
    +                    for (const part of n.#parts) {
    +                        /* c8 ignore start */
    +                        if (typeof part === 'string') {
    +                            throw new Error('string part in extglob AST??');
    +                        }
    +                        /* c8 ignore stop */
    +                        part.copyIn(pp.#parts[i]);
    +                    }
    +                }
    +                p = pp;
    +                pp = p.#parent;
    +            }
    +        }
    +        return this;
    +    }
    +    push(...parts) {
    +        for (const p of parts) {
    +            if (p === '')
    +                continue;
    +            /* c8 ignore start */
    +            if (typeof p !== 'string' && !(p instanceof AST && p.#parent === this)) {
    +                throw new Error('invalid part: ' + p);
    +            }
    +            /* c8 ignore stop */
    +            this.#parts.push(p);
    +        }
    +    }
    +    toJSON() {
    +        const ret = this.type === null ? this.#parts.slice() : [this.type, ...this.#parts];
    +        if (this.isStart() && !this.type)
    +            ret.unshift([]);
    +        if (this.isEnd() &&
    +            (this === this.#root ||
    +                (this.#root.#filledNegs && this.#parent?.type === '!'))) {
    +            ret.push({});
    +        }
    +        return ret;
    +    }
    +    isStart() {
    +        if (this.#root === this)
    +            return true;
    +        // if (this.type) return !!this.#parent?.isStart()
    +        if (!this.#parent?.isStart())
    +            return false;
    +        return this.#parentIndex === 0;
    +    }
    +    isEnd() {
    +        if (this.#root === this)
    +            return true;
    +        if (this.#parent?.type === '!')
    +            return true;
    +        if (!this.#parent?.isEnd())
    +            return false;
    +        if (!this.type)
    +            return this.#parent?.isEnd();
    +        return (this.#parentIndex === (this.#parent ? this.#parent.#parts.length : 0) - 1);
    +    }
    +    copyIn(part) {
    +        if (typeof part === 'string')
    +            this.push(part);
    +        else
    +            this.push(part.clone(this));
    +    }
    +    clone(parent) {
    +        const c = new AST(this.type, parent);
    +        for (const p of this.#parts) {
    +            c.copyIn(p);
    +        }
    +        return c;
    +    }
    +    static #parseAST(str, ast, pos, opt) {
    +        let escaping = false;
    +        if (ast.type === null) {
    +            // outside of a extglob, append until we find a start
    +            let i = pos;
    +            let acc = '';
    +            while (i < str.length) {
    +                const c = str.charAt(i++);
    +                // still accumulate escapes at this point, but we do ignore
    +                // starts that are escaped
    +                if (escaping || c === '\\') {
    +                    escaping = !escaping;
    +                    acc += c;
    +                    continue;
    +                }
    +                if (!opt.noext && isExtglobType(c) && str.charAt(i) === '(') {
    +                    ast.push(acc);
    +                    acc = '';
    +                    const ext = new AST(c, ast);
    +                    i = AST.#parseAST(str, ext, i, opt);
    +                    ast.push(ext);
    +                    continue;
    +                }
    +                acc += c;
    +            }
    +            ast.push(acc);
    +            return i;
    +        }
    +        // some kind of extglob, pos is at the (
    +        // find the next | or )
    +        let i = pos + 1;
    +        let part = new AST(null, ast);
    +        const parts = [];
    +        let acc = '';
    +        while (i < str.length) {
    +            const c = str.charAt(i++);
    +            // still accumulate escapes at this point, but we do ignore
    +            // starts that are escaped
    +            if (escaping || c === '\\') {
    +                escaping = !escaping;
    +                acc += c;
    +                continue;
    +            }
    +            if (isExtglobType(c) && str.charAt(i) === '(') {
    +                part.push(acc);
    +                acc = '';
    +                const ext = new AST(c, part);
    +                part.push(ext);
    +                i = AST.#parseAST(str, ext, i, opt);
    +                continue;
    +            }
    +            if (c === '|') {
    +                part.push(acc);
    +                acc = '';
    +                parts.push(part);
    +                part = new AST(null, ast);
    +                continue;
    +            }
    +            if (c === ')') {
    +                part.push(acc);
    +                acc = '';
    +                ast.push(...parts, part);
    +                return i;
    +            }
    +            acc += c;
    +        }
    +        // if we got here, it was a malformed extglob! not an extglob, but
    +        // maybe something else in there.
    +        ast.type = null;
    +        ast.#parts = [str.substring(pos)];
    +        return i;
    +    }
    +    static fromGlob(pattern, options = {}) {
    +        const ast = new AST(null, undefined, options);
    +        AST.#parseAST(pattern, ast, 0, options);
    +        console.log('parsed', pattern, JSON.stringify(ast));
    +        return ast;
    +    }
    +    toRegExpSource() {
    +        if (this.#root === this)
    +            this.fillNegs();
    +        if (!this.type) {
    +            const src = this.#parts
    +                .map(p => {
    +                if (typeof p === 'string')
    +                    return AST.#parseGlob(p, this.#options);
    +                else
    +                    return p.toRegExpSource();
    +            })
    +                .join('');
    +            let start = '';
    +            if (this.isStart() && typeof this.#parts[0] === 'string') {
    +                // '.' and '..' cannot match unless the pattern is that exactly
    +                const dotTravAllowed = this.#parts.length === 1 && justDots.has(this.#parts[0]);
    +                if (dotTravAllowed) {
    +                    start = '(?:^|\\/)';
    +                }
    +                else {
    +                    const dotsAllowed = this.#options.dot ||
    +                        // no need to prevent dots if it can't match a dot, or if a sub-pattern
    +                        // will be preventing it anyway.
    +                        !addPatternStart.has(src.charAt(0));
    +                    start = dotsAllowed ? '(?!(?:^|\\/)\\.{1,2}(?:$|\\/))' : '(?!\\.)';
    +                }
    +            }
    +            let end = '';
    +            if (this.isEnd() &&
    +                (this === this.#root ||
    +                    (this.#root.#filledNegs && this.#parent?.type === '!'))) {
    +                end = '(?:$|\\/)';
    +            }
    +            return start + src + end;
    +        }
    +        // some kind of extglob
    +        const start = this.type === '!' ? '(?:(?!(?:' : '(?:';
    +        const body = this.#parts
    +            .map(p => {
    +            /* c8 ignore start */
    +            if (typeof p === 'string') {
    +                throw new Error('string type in extglob ast??');
    +            }
    +            /* c8 ignore stop */
    +            return p.toRegExpSource();
    +        })
    +            .join('|');
    +        const close = this.type === '!'
    +            ? '))[^/]*?)'
    +            : this.type === '@'
    +                ? ')'
    +                : `)${this.type}`;
    +        return start + body + close;
    +    }
    +    static #parseGlob(glob, options) {
    +        let escaping = false;
    +        let re = '';
    +        let uflag = false;
    +        let hasMagic = false;
    +        for (let i = 0; i < glob.length; i++) {
    +            const c = glob.charAt(i);
    +            if (escaping) {
    +                escaping = false;
    +                re += (reSpecials.has(c) ? '\\' : '') + c;
    +                continue;
    +            }
    +            if (c === '\\') {
    +                if (i === glob.length - 1) {
    +                    re += '\\\\';
    +                }
    +                else {
    +                    escaping = true;
    +                }
    +                continue;
    +            }
    +            if (c === '[') {
    +                const [src, needUflag, consumed, magic] = parseClass(glob, i);
    +                if (consumed) {
    +                    re += src;
    +                    uflag = uflag || needUflag;
    +                    i += consumed - 1;
    +                    hasMagic = hasMagic || magic;
    +                    continue;
    +                }
    +            }
    +            if (c === '*') {
    +                re += star;
    +                hasMagic = true;
    +                continue;
    +            }
    +            if (c === '?') {
    +                re += qmark;
    +                hasMagic = true;
    +                continue;
    +            }
    +            re += regExpEscape(c);
    +        }
    +        return re;
    +    }
    +}
    +const pattern = 'a@(i|w!(x|y)z+(l|m)|j)';
    +const ast = AST.fromGlob(pattern).fillNegs();
    +console.log('negged', pattern, JSON.stringify(ast));
    +console.log('to re src', pattern, ast.toRegExpSource());
    +// // the type (exttype or null for strings), and array of children tokens
    +//
    +// // append everything after a negative extglob to each of the parts
    +// // of the negative extglob node.  So, eg, [a, [!, x, y], z]
    +//
    +// //
    +// //
    +// //
    +// //
    +//
    +// const globUnescape = (s: string) => s.replace(/\\(.)/g, '$1')
    +// const regExpEscape = (s: string) =>
    +//   s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&')
    +//
    +// // "abc" -> { a:true, b:true, c:true }
    +// const charSet = (s: string) =>
    +//   s.split('').reduce((set: { [k: string]: boolean }, c) => {
    +//     set[c] = true
    +//     return set
    +//   }, {})
    +//
    +// // characters that need to be escaped in RegExp.
    +// const reSpecials = charSet('().*{}+?[]^$\\!')
    +//
    +// // characters that indicate we have to add the pattern start
    +// const addPatternStartSet = charSet('[.(')
    +//
    +// // any single thing other than /
    +// // don't need to escape / when using new RegExp()
    +// const qmark = '[^/]'
    +//
    +// // * => any number of characters
    +// const star = qmark + '*?'
    +//
    +// // TODO: take an offset and length, so we can sub-parse the extglobs
    +// const parse = (
    +//   options: MinimatchOptions,
    +//   pattern: string,
    +//   debug: (...a: any[]) => void
    +// ): false | string => {
    +//   assertValidPattern(pattern)
    +//
    +//   if (pattern === '') return ''
    +//
    +//   let re = ''
    +//   let hasMagic = false
    +//   let escaping = false
    +//   // ? => one single character
    +//   let uflag = false
    +//
    +//   // . and .. never match anything that doesn't start with .,
    +//   // even when options.dot is set.  However, if the pattern
    +//   // starts with ., then traversal patterns can match.
    +//   let dotTravAllowed = pattern.charAt(0) === '.'
    +//   let dotFileAllowed = options.dot || dotTravAllowed
    +//   const patternStart = () =>
    +//     dotTravAllowed
    +//       ? ''
    +//       : dotFileAllowed
    +//       ? '(?!(?:^|\\/)\\.{1,2}(?:$|\\/))'
    +//       : '(?!\\.)'
    +//   const subPatternStart = (p: string) =>
    +//     p.charAt(0) === '.'
    +//       ? ''
    +//       : options.dot
    +//       ? '(?!(?:^|\\/)\\.{1,2}(?:$|\\/))'
    +//       : '(?!\\.)'
    +//
    +//   const clearStateChar = () => {
    +//     if (stateChar) {
    +//       // we had some state-tracking character
    +//       // that wasn't consumed by this pass.
    +//       switch (stateChar) {
    +//         case '*':
    +//           re += star
    +//           hasMagic = true
    +//           break
    +//         case '?':
    +//           re += qmark
    +//           hasMagic = true
    +//           break
    +//         default:
    +//           re += '\\' + stateChar
    +//           break
    +//       }
    +//       debug('clearStateChar %j %j', stateChar, re)
    +//       stateChar = false
    +//     }
    +//   }
    +//
    +//   for (
    +//     let i = 0, c: string;
    +//     i < pattern.length && (c = pattern.charAt(i));
    +//     i++
    +//   ) {
    +//     debug('%s\t%s %s %j', pattern, i, re, c)
    +//
    +//     // skip over any that are escaped.
    +//     if (escaping) {
    +//       // completely not allowed, even escaped.
    +//       // should be impossible.
    +//       /* c8 ignore start */
    +//       if (c === '/') {
    +//         return false
    +//       }
    +//       /* c8 ignore stop */
    +//
    +//       if (reSpecials[c]) {
    +//         re += '\\'
    +//       }
    +//       re += c
    +//       escaping = false
    +//       continue
    +//     }
    +//
    +//     switch (c) {
    +//       // Should already be path-split by now.
    +//       /* c8 ignore start */
    +//       case '/': {
    +//         return false
    +//       }
    +//       /* c8 ignore stop */
    +//
    +//       case '\\':
    +//         clearStateChar()
    +//         escaping = true
    +//         continue
    +//
    +//       // the various stateChar values
    +//       // for the "extglob" stuff.
    +//       case '?':
    +//       case '*':
    +//       case '+':
    +//       case '@':
    +//       case '!':
    +//         debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c)
    +//
    +//         // if we already have a stateChar, then it means
    +//         // that there was something like ** or +? in there.
    +//         // Handle the stateChar, then proceed with this one.
    +//         debug('call clearStateChar %j', stateChar)
    +//         clearStateChar()
    +//         stateChar = c
    +//         // if extglob is disabled, then +(asdf|foo) isn't a thing.
    +//         // just clear the statechar *now*, rather than even diving into
    +//         // the patternList stuff.
    +//         if (options.noext) clearStateChar()
    +//         continue
    +//
    +//       case '(': {
    +//         if (!stateChar) {
    +//           re += '\\('
    +//           continue
    +//         }
    +//
    +//         const plEntry: PatternListEntry = {
    +//           type: stateChar,
    +//           start: i - 1,
    +//           reStart: re.length,
    +//           open: plTypes[stateChar].open,
    +//           close: plTypes[stateChar].close,
    +//         }
    +//         debug(pattern, '\t', plEntry)
    +//         patternListStack.push(plEntry)
    +//         // negation is (?:(?!(?:js)(?:))[^/]*)
    +//         re += plEntry.open
    +//         // next entry starts with a dot maybe?
    +//         if (plEntry.start === 0 && plEntry.type !== '!') {
    +//           dotTravAllowed = true
    +//           re += subPatternStart(pattern.slice(i + 1))
    +//         }
    +//         debug('plType %j %j', stateChar, re)
    +//         stateChar = false
    +//         continue
    +//       }
    +//
    +//       case ')': {
    +//         const plEntry = patternListStack[patternListStack.length - 1]
    +//         if (!plEntry) {
    +//           re += '\\)'
    +//           continue
    +//         }
    +//         patternListStack.pop()
    +//
    +//         // closing an extglob
    +//         clearStateChar()
    +//         hasMagic = true
    +//         pl = plEntry
    +//         // negation is (?:(?!js)[^/]*)
    +//         // The others are (?:)
    +//         re += pl.close
    +//         if (pl.type === '!') {
    +//           negativeLists.push(Object.assign(pl, { reEnd: re.length }))
    +//         }
    +//         continue
    +//       }
    +//
    +//       case '|': {
    +//         const plEntry = patternListStack[patternListStack.length - 1]
    +//         if (!plEntry) {
    +//           re += '\\|'
    +//           continue
    +//         }
    +//
    +//         clearStateChar()
    +//         re += '|'
    +//         // next subpattern can start with a dot?
    +//         if (plEntry.start === 0 && plEntry.type !== '!') {
    +//           dotTravAllowed = true
    +//           re += subPatternStart(pattern.slice(i + 1))
    +//         }
    +//         continue
    +//       }
    +//
    +//       // these are mostly the same in regexp and glob
    +//       case '[':
    +//         // swallow any state-tracking char before the [
    +//         clearStateChar()
    +//         const [src, needUflag, consumed, magic] = parseClass(pattern, i)
    +//         if (consumed) {
    +//           re += src
    +//           uflag = uflag || needUflag
    +//           i += consumed - 1
    +//           hasMagic = hasMagic || magic
    +//         } else {
    +//           re += '\\['
    +//         }
    +//         continue
    +//
    +//       case ']':
    +//         re += '\\' + c
    +//         continue
    +//
    +//       default:
    +//         // swallow any state char that wasn't consumed
    +//         clearStateChar()
    +//
    +//         re += regExpEscape(c)
    +//         break
    +//     } // switch
    +//   } // for
    +//
    +//   // handle the case where we had a +( thing at the *end*
    +//   // of the pattern.
    +//   // each pattern list stack adds 3 chars, and we need to go through
    +//   // and escape any | chars that were passed through as-is for the regexp.
    +//   // Go through and escape them, taking care not to double-escape any
    +//   // | chars that were already escaped.
    +//   for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) {
    +//     let tail: string
    +//     tail = re.slice(pl.reStart + pl.open.length)
    +//     debug(pattern, 'setting tail', re, pl)
    +//     // maybe some even number of \, then maybe 1 \, followed by a |
    +//     tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, (_, $1, $2) => {
    +//       if (!$2) {
    +//         // the | isn't already escaped, so escape it.
    +//         $2 = '\\'
    +//         // should already be done
    +//         /* c8 ignore start */
    +//       }
    +//       /* c8 ignore stop */
    +//
    +//       // need to escape all those slashes *again*, without escaping the
    +//       // one that we need for escaping the | character.  As it works out,
    +//       // escaping an even number of slashes can be done by simply repeating
    +//       // it exactly after itself.  That's why this trick works.
    +//       //
    +//       // I am sorry that you have to see this.
    +//       return $1 + $1 + $2 + '|'
    +//     })
    +//
    +//     debug('tail=%j\n   %s', tail, tail, pl, re)
    +//     const t = pl.type === '*' ? star : pl.type === '?' ? qmark : '\\' + pl.type
    +//
    +//     hasMagic = true
    +//     re = re.slice(0, pl.reStart) + t + '\\(' + tail
    +//   }
    +//
    +//   // handle trailing things that only matter at the very end.
    +//   clearStateChar()
    +//   if (escaping) {
    +//     // trailing \\
    +//     re += '\\\\'
    +//   }
    +//
    +//   // only need to apply the nodot start if the re starts with
    +//   // something that could conceivably capture a dot
    +//   const addPatternStart = addPatternStartSet[re.charAt(0)]
    +//
    +//   // Hack to work around lack of negative lookbehind in JS
    +//   // A pattern like: *.!(x).!(y|z) needs to ensure that a name
    +//   // like 'a.xyz.yz' doesn't match.  So, the first negative
    +//   // lookahead, has to look ALL the way ahead, to the end of
    +//   // the pattern.
    +//   for (let n = negativeLists.length - 1; n > -1; n--) {
    +//     const nl = negativeLists[n]
    +//
    +//     const nlBefore = re.slice(0, nl.reStart)
    +//     const nlFirst = re.slice(nl.reStart, nl.reEnd - 8)
    +//     let nlAfter = re.slice(nl.reEnd)
    +//     const nlLast = re.slice(nl.reEnd - 8, nl.reEnd) + nlAfter
    +//
    +//     // Handle nested stuff like *(*.js|!(*.json)), where open parens
    +//     // mean that we should *not* include the ) in the bit that is considered
    +//     // "after" the negated section.
    +//     const closeParensBefore = nlBefore.split(')').length
    +//     const openParensBefore = nlBefore.split('(').length - closeParensBefore
    +//     let cleanAfter = nlAfter
    +//     for (let i = 0; i < openParensBefore; i++) {
    +//       cleanAfter = cleanAfter.replace(/\)[+*?]?/, '')
    +//     }
    +//     nlAfter = cleanAfter
    +//
    +//     const dollar = nlAfter === '' ? '(?:$|\\/)' : ''
    +//
    +//     re = nlBefore + nlFirst + nlAfter + dollar + nlLast
    +//   }
    +//
    +//   // if the re is not "" at this point, then we need to make sure
    +//   // it doesn't match against an empty path part.
    +//   // Otherwise a/* will match a/, which it should not.
    +//   if (re !== '' && hasMagic) {
    +//     re = '(?=.)' + re
    +//   }
    +//
    +//   if (addPatternStart) {
    +//     re = patternStart() + re
    +//   }
    +//
    +//   // if it's nocase, and the lcase/uppercase don't match, it's magic
    +//   if (options.nocase && !hasMagic && !options.nocaseMagicOnly) {
    +//     hasMagic = pattern.toUpperCase() !== pattern.toLowerCase()
    +//   }
    +//
    +//   // skip the regexp for non-magical patterns
    +//   // unescape anything in it, though, so that it'll be
    +//   // an exact match against a file etc.
    +//   if (!hasMagic) {
    +//     return globUnescape(re)
    +//   }
    +//
    +//   return re
    +// }
    +//# sourceMappingURL=parse.js.map
    \ No newline at end of file
    diff --git a/deps/npm/node_modules/minimatch/dist/mjs/unescape.js b/deps/npm/node_modules/minimatch/dist/mjs/unescape.js
    new file mode 100644
    index 00000000000000..0faf9a2b7306f7
    --- /dev/null
    +++ b/deps/npm/node_modules/minimatch/dist/mjs/unescape.js
    @@ -0,0 +1,20 @@
    +/**
    + * Un-escape a string that has been escaped with {@link escape}.
    + *
    + * If the {@link windowsPathsNoEscape} option is used, then square-brace
    + * escapes are removed, but not backslash escapes.  For example, it will turn
    + * the string `'[*]'` into `*`, but it will not turn `'\\*'` into `'*'`,
    + * becuase `\` is a path separator in `windowsPathsNoEscape` mode.
    + *
    + * When `windowsPathsNoEscape` is not set, then both brace escapes and
    + * backslash escapes are removed.
    + *
    + * Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot be escaped
    + * or unescaped.
    + */
    +export const unescape = (s, { windowsPathsNoEscape = false, } = {}) => {
    +    return windowsPathsNoEscape
    +        ? s.replace(/\[([^\/\\])\]/g, '$1')
    +        : s.replace(/((?!\\).|^)\[([^\/\\])\]/g, '$1$2').replace(/\\([^\/])/g, '$1');
    +};
    +//# sourceMappingURL=unescape.js.map
    \ No newline at end of file
    diff --git a/deps/npm/node_modules/minimatch/package.json b/deps/npm/node_modules/minimatch/package.json
    index 58f289adf75e76..95364b15482463 100644
    --- a/deps/npm/node_modules/minimatch/package.json
    +++ b/deps/npm/node_modules/minimatch/package.json
    @@ -2,7 +2,7 @@
       "author": "Isaac Z. Schlueter  (http://blog.izs.me)",
       "name": "minimatch",
       "description": "a glob matcher in javascript",
    -  "version": "6.2.0",
    +  "version": "7.4.3",
       "repository": {
         "type": "git",
         "url": "git://github.com/isaacs/minimatch.git"
    @@ -17,7 +17,7 @@
             "default": "./dist/mjs/index.js"
           },
           "require": {
    -        "types": "./dist/cjs/index-cjs.d.ts",
    +        "types": "./dist/cjs/index.d.ts",
             "default": "./dist/cjs/index-cjs.js"
           }
         }
    diff --git a/deps/npm/node_modules/minipass-collect/node_modules/minipass/index.d.ts b/deps/npm/node_modules/minipass-collect/node_modules/minipass/index.d.ts
    deleted file mode 100644
    index 65faf63686c213..00000000000000
    --- a/deps/npm/node_modules/minipass-collect/node_modules/minipass/index.d.ts
    +++ /dev/null
    @@ -1,155 +0,0 @@
    -/// 
    -import { EventEmitter } from 'events'
    -import { Stream } from 'stream'
    -
    -declare namespace Minipass {
    -  type Encoding = BufferEncoding | 'buffer' | null
    -
    -  interface Writable extends EventEmitter {
    -    end(): any
    -    write(chunk: any, ...args: any[]): any
    -  }
    -
    -  interface Readable extends EventEmitter {
    -    pause(): any
    -    resume(): any
    -    pipe(): any
    -  }
    -
    -  interface Pipe {
    -    src: Minipass
    -    dest: Writable
    -    opts: PipeOptions
    -  }
    -
    -  type DualIterable = Iterable & AsyncIterable
    -
    -  type ContiguousData = Buffer | ArrayBufferLike | ArrayBufferView | string
    -
    -  type BufferOrString = Buffer | string
    -
    -  interface StringOptions {
    -    encoding: BufferEncoding
    -    objectMode?: boolean
    -    async?: boolean
    -  }
    -
    -  interface BufferOptions {
    -    encoding?: null | 'buffer'
    -    objectMode?: boolean
    -    async?: boolean
    -  }
    -
    -  interface ObjectModeOptions {
    -    objectMode: true
    -    async?: boolean
    -  }
    -
    -  interface PipeOptions {
    -    end?: boolean
    -    proxyErrors?: boolean
    -  }
    -
    -  type Options = T extends string
    -    ? StringOptions
    -    : T extends Buffer
    -    ? BufferOptions
    -    : ObjectModeOptions
    -}
    -
    -declare class Minipass<
    -    RType extends any = Buffer,
    -    WType extends any = RType extends Minipass.BufferOrString
    -      ? Minipass.ContiguousData
    -      : RType
    -  >
    -  extends Stream
    -  implements Minipass.DualIterable
    -{
    -  static isStream(stream: any): stream is Minipass.Readable | Minipass.Writable
    -
    -  readonly bufferLength: number
    -  readonly flowing: boolean
    -  readonly writable: boolean
    -  readonly readable: boolean
    -  readonly paused: boolean
    -  readonly emittedEnd: boolean
    -  readonly destroyed: boolean
    -
    -  /**
    -   * Not technically private or readonly, but not safe to mutate.
    -   */
    -  private readonly buffer: RType[]
    -  private readonly pipes: Minipass.Pipe[]
    -
    -  /**
    -   * Technically writable, but mutating it can change the type,
    -   * so is not safe to do in TypeScript.
    -   */
    -  readonly objectMode: boolean
    -  async: boolean
    -
    -  /**
    -   * Note: encoding is not actually read-only, and setEncoding(enc)
    -   * exists. However, this type definition will insist that TypeScript
    -   * programs declare the type of a Minipass stream up front, and if
    -   * that type is string, then an encoding MUST be set in the ctor. If
    -   * the type is Buffer, then the encoding must be missing, or set to
    -   * 'buffer' or null. If the type is anything else, then objectMode
    -   * must be set in the constructor options.  So there is effectively
    -   * no allowed way that a TS program can set the encoding after
    -   * construction, as doing so will destroy any hope of type safety.
    -   * TypeScript does not provide many options for changing the type of
    -   * an object at run-time, which is what changing the encoding does.
    -   */
    -  readonly encoding: Minipass.Encoding
    -  // setEncoding(encoding: Encoding): void
    -
    -  // Options required if not reading buffers
    -  constructor(
    -    ...args: RType extends Buffer
    -      ? [] | [Minipass.Options]
    -      : [Minipass.Options]
    -  )
    -
    -  write(chunk: WType, cb?: () => void): boolean
    -  write(chunk: WType, encoding?: Minipass.Encoding, cb?: () => void): boolean
    -  read(size?: number): RType
    -  end(cb?: () => void): this
    -  end(chunk: any, cb?: () => void): this
    -  end(chunk: any, encoding?: Minipass.Encoding, cb?: () => void): this
    -  pause(): void
    -  resume(): void
    -  promise(): Promise
    -  collect(): Promise
    -
    -  concat(): RType extends Minipass.BufferOrString ? Promise : never
    -  destroy(er?: any): void
    -  pipe(dest: W, opts?: Minipass.PipeOptions): W
    -  unpipe(dest: W): void
    -
    -  /**
    -   * alias for on()
    -   */
    -  addEventHandler(event: string, listener: (...args: any[]) => any): this
    -
    -  on(event: string, listener: (...args: any[]) => any): this
    -  on(event: 'data', listener: (chunk: RType) => any): this
    -  on(event: 'error', listener: (error: any) => any): this
    -  on(
    -    event:
    -      | 'readable'
    -      | 'drain'
    -      | 'resume'
    -      | 'end'
    -      | 'prefinish'
    -      | 'finish'
    -      | 'close',
    -    listener: () => any
    -  ): this
    -
    -  [Symbol.iterator](): Iterator
    -  [Symbol.asyncIterator](): AsyncIterator
    -}
    -
    -export = Minipass
    diff --git a/deps/npm/node_modules/minipass-flush/node_modules/minipass/index.d.ts b/deps/npm/node_modules/minipass-flush/node_modules/minipass/index.d.ts
    deleted file mode 100644
    index 65faf63686c213..00000000000000
    --- a/deps/npm/node_modules/minipass-flush/node_modules/minipass/index.d.ts
    +++ /dev/null
    @@ -1,155 +0,0 @@
    -/// 
    -import { EventEmitter } from 'events'
    -import { Stream } from 'stream'
    -
    -declare namespace Minipass {
    -  type Encoding = BufferEncoding | 'buffer' | null
    -
    -  interface Writable extends EventEmitter {
    -    end(): any
    -    write(chunk: any, ...args: any[]): any
    -  }
    -
    -  interface Readable extends EventEmitter {
    -    pause(): any
    -    resume(): any
    -    pipe(): any
    -  }
    -
    -  interface Pipe {
    -    src: Minipass
    -    dest: Writable
    -    opts: PipeOptions
    -  }
    -
    -  type DualIterable = Iterable & AsyncIterable
    -
    -  type ContiguousData = Buffer | ArrayBufferLike | ArrayBufferView | string
    -
    -  type BufferOrString = Buffer | string
    -
    -  interface StringOptions {
    -    encoding: BufferEncoding
    -    objectMode?: boolean
    -    async?: boolean
    -  }
    -
    -  interface BufferOptions {
    -    encoding?: null | 'buffer'
    -    objectMode?: boolean
    -    async?: boolean
    -  }
    -
    -  interface ObjectModeOptions {
    -    objectMode: true
    -    async?: boolean
    -  }
    -
    -  interface PipeOptions {
    -    end?: boolean
    -    proxyErrors?: boolean
    -  }
    -
    -  type Options = T extends string
    -    ? StringOptions
    -    : T extends Buffer
    -    ? BufferOptions
    -    : ObjectModeOptions
    -}
    -
    -declare class Minipass<
    -    RType extends any = Buffer,
    -    WType extends any = RType extends Minipass.BufferOrString
    -      ? Minipass.ContiguousData
    -      : RType
    -  >
    -  extends Stream
    -  implements Minipass.DualIterable
    -{
    -  static isStream(stream: any): stream is Minipass.Readable | Minipass.Writable
    -
    -  readonly bufferLength: number
    -  readonly flowing: boolean
    -  readonly writable: boolean
    -  readonly readable: boolean
    -  readonly paused: boolean
    -  readonly emittedEnd: boolean
    -  readonly destroyed: boolean
    -
    -  /**
    -   * Not technically private or readonly, but not safe to mutate.
    -   */
    -  private readonly buffer: RType[]
    -  private readonly pipes: Minipass.Pipe[]
    -
    -  /**
    -   * Technically writable, but mutating it can change the type,
    -   * so is not safe to do in TypeScript.
    -   */
    -  readonly objectMode: boolean
    -  async: boolean
    -
    -  /**
    -   * Note: encoding is not actually read-only, and setEncoding(enc)
    -   * exists. However, this type definition will insist that TypeScript
    -   * programs declare the type of a Minipass stream up front, and if
    -   * that type is string, then an encoding MUST be set in the ctor. If
    -   * the type is Buffer, then the encoding must be missing, or set to
    -   * 'buffer' or null. If the type is anything else, then objectMode
    -   * must be set in the constructor options.  So there is effectively
    -   * no allowed way that a TS program can set the encoding after
    -   * construction, as doing so will destroy any hope of type safety.
    -   * TypeScript does not provide many options for changing the type of
    -   * an object at run-time, which is what changing the encoding does.
    -   */
    -  readonly encoding: Minipass.Encoding
    -  // setEncoding(encoding: Encoding): void
    -
    -  // Options required if not reading buffers
    -  constructor(
    -    ...args: RType extends Buffer
    -      ? [] | [Minipass.Options]
    -      : [Minipass.Options]
    -  )
    -
    -  write(chunk: WType, cb?: () => void): boolean
    -  write(chunk: WType, encoding?: Minipass.Encoding, cb?: () => void): boolean
    -  read(size?: number): RType
    -  end(cb?: () => void): this
    -  end(chunk: any, cb?: () => void): this
    -  end(chunk: any, encoding?: Minipass.Encoding, cb?: () => void): this
    -  pause(): void
    -  resume(): void
    -  promise(): Promise
    -  collect(): Promise
    -
    -  concat(): RType extends Minipass.BufferOrString ? Promise : never
    -  destroy(er?: any): void
    -  pipe(dest: W, opts?: Minipass.PipeOptions): W
    -  unpipe(dest: W): void
    -
    -  /**
    -   * alias for on()
    -   */
    -  addEventHandler(event: string, listener: (...args: any[]) => any): this
    -
    -  on(event: string, listener: (...args: any[]) => any): this
    -  on(event: 'data', listener: (chunk: RType) => any): this
    -  on(event: 'error', listener: (error: any) => any): this
    -  on(
    -    event:
    -      | 'readable'
    -      | 'drain'
    -      | 'resume'
    -      | 'end'
    -      | 'prefinish'
    -      | 'finish'
    -      | 'close',
    -    listener: () => any
    -  ): this
    -
    -  [Symbol.iterator](): Iterator
    -  [Symbol.asyncIterator](): AsyncIterator
    -}
    -
    -export = Minipass
    diff --git a/deps/npm/node_modules/minipass-json-stream/node_modules/minipass/index.d.ts b/deps/npm/node_modules/minipass-json-stream/node_modules/minipass/index.d.ts
    deleted file mode 100644
    index 65faf63686c213..00000000000000
    --- a/deps/npm/node_modules/minipass-json-stream/node_modules/minipass/index.d.ts
    +++ /dev/null
    @@ -1,155 +0,0 @@
    -/// 
    -import { EventEmitter } from 'events'
    -import { Stream } from 'stream'
    -
    -declare namespace Minipass {
    -  type Encoding = BufferEncoding | 'buffer' | null
    -
    -  interface Writable extends EventEmitter {
    -    end(): any
    -    write(chunk: any, ...args: any[]): any
    -  }
    -
    -  interface Readable extends EventEmitter {
    -    pause(): any
    -    resume(): any
    -    pipe(): any
    -  }
    -
    -  interface Pipe {
    -    src: Minipass
    -    dest: Writable
    -    opts: PipeOptions
    -  }
    -
    -  type DualIterable = Iterable & AsyncIterable
    -
    -  type ContiguousData = Buffer | ArrayBufferLike | ArrayBufferView | string
    -
    -  type BufferOrString = Buffer | string
    -
    -  interface StringOptions {
    -    encoding: BufferEncoding
    -    objectMode?: boolean
    -    async?: boolean
    -  }
    -
    -  interface BufferOptions {
    -    encoding?: null | 'buffer'
    -    objectMode?: boolean
    -    async?: boolean
    -  }
    -
    -  interface ObjectModeOptions {
    -    objectMode: true
    -    async?: boolean
    -  }
    -
    -  interface PipeOptions {
    -    end?: boolean
    -    proxyErrors?: boolean
    -  }
    -
    -  type Options = T extends string
    -    ? StringOptions
    -    : T extends Buffer
    -    ? BufferOptions
    -    : ObjectModeOptions
    -}
    -
    -declare class Minipass<
    -    RType extends any = Buffer,
    -    WType extends any = RType extends Minipass.BufferOrString
    -      ? Minipass.ContiguousData
    -      : RType
    -  >
    -  extends Stream
    -  implements Minipass.DualIterable
    -{
    -  static isStream(stream: any): stream is Minipass.Readable | Minipass.Writable
    -
    -  readonly bufferLength: number
    -  readonly flowing: boolean
    -  readonly writable: boolean
    -  readonly readable: boolean
    -  readonly paused: boolean
    -  readonly emittedEnd: boolean
    -  readonly destroyed: boolean
    -
    -  /**
    -   * Not technically private or readonly, but not safe to mutate.
    -   */
    -  private readonly buffer: RType[]
    -  private readonly pipes: Minipass.Pipe[]
    -
    -  /**
    -   * Technically writable, but mutating it can change the type,
    -   * so is not safe to do in TypeScript.
    -   */
    -  readonly objectMode: boolean
    -  async: boolean
    -
    -  /**
    -   * Note: encoding is not actually read-only, and setEncoding(enc)
    -   * exists. However, this type definition will insist that TypeScript
    -   * programs declare the type of a Minipass stream up front, and if
    -   * that type is string, then an encoding MUST be set in the ctor. If
    -   * the type is Buffer, then the encoding must be missing, or set to
    -   * 'buffer' or null. If the type is anything else, then objectMode
    -   * must be set in the constructor options.  So there is effectively
    -   * no allowed way that a TS program can set the encoding after
    -   * construction, as doing so will destroy any hope of type safety.
    -   * TypeScript does not provide many options for changing the type of
    -   * an object at run-time, which is what changing the encoding does.
    -   */
    -  readonly encoding: Minipass.Encoding
    -  // setEncoding(encoding: Encoding): void
    -
    -  // Options required if not reading buffers
    -  constructor(
    -    ...args: RType extends Buffer
    -      ? [] | [Minipass.Options]
    -      : [Minipass.Options]
    -  )
    -
    -  write(chunk: WType, cb?: () => void): boolean
    -  write(chunk: WType, encoding?: Minipass.Encoding, cb?: () => void): boolean
    -  read(size?: number): RType
    -  end(cb?: () => void): this
    -  end(chunk: any, cb?: () => void): this
    -  end(chunk: any, encoding?: Minipass.Encoding, cb?: () => void): this
    -  pause(): void
    -  resume(): void
    -  promise(): Promise
    -  collect(): Promise
    -
    -  concat(): RType extends Minipass.BufferOrString ? Promise : never
    -  destroy(er?: any): void
    -  pipe(dest: W, opts?: Minipass.PipeOptions): W
    -  unpipe(dest: W): void
    -
    -  /**
    -   * alias for on()
    -   */
    -  addEventHandler(event: string, listener: (...args: any[]) => any): this
    -
    -  on(event: string, listener: (...args: any[]) => any): this
    -  on(event: 'data', listener: (chunk: RType) => any): this
    -  on(event: 'error', listener: (error: any) => any): this
    -  on(
    -    event:
    -      | 'readable'
    -      | 'drain'
    -      | 'resume'
    -      | 'end'
    -      | 'prefinish'
    -      | 'finish'
    -      | 'close',
    -    listener: () => any
    -  ): this
    -
    -  [Symbol.iterator](): Iterator
    -  [Symbol.asyncIterator](): AsyncIterator
    -}
    -
    -export = Minipass
    diff --git a/deps/npm/node_modules/minipass-pipeline/node_modules/minipass/index.d.ts b/deps/npm/node_modules/minipass-pipeline/node_modules/minipass/index.d.ts
    deleted file mode 100644
    index 65faf63686c213..00000000000000
    --- a/deps/npm/node_modules/minipass-pipeline/node_modules/minipass/index.d.ts
    +++ /dev/null
    @@ -1,155 +0,0 @@
    -/// 
    -import { EventEmitter } from 'events'
    -import { Stream } from 'stream'
    -
    -declare namespace Minipass {
    -  type Encoding = BufferEncoding | 'buffer' | null
    -
    -  interface Writable extends EventEmitter {
    -    end(): any
    -    write(chunk: any, ...args: any[]): any
    -  }
    -
    -  interface Readable extends EventEmitter {
    -    pause(): any
    -    resume(): any
    -    pipe(): any
    -  }
    -
    -  interface Pipe {
    -    src: Minipass
    -    dest: Writable
    -    opts: PipeOptions
    -  }
    -
    -  type DualIterable = Iterable & AsyncIterable
    -
    -  type ContiguousData = Buffer | ArrayBufferLike | ArrayBufferView | string
    -
    -  type BufferOrString = Buffer | string
    -
    -  interface StringOptions {
    -    encoding: BufferEncoding
    -    objectMode?: boolean
    -    async?: boolean
    -  }
    -
    -  interface BufferOptions {
    -    encoding?: null | 'buffer'
    -    objectMode?: boolean
    -    async?: boolean
    -  }
    -
    -  interface ObjectModeOptions {
    -    objectMode: true
    -    async?: boolean
    -  }
    -
    -  interface PipeOptions {
    -    end?: boolean
    -    proxyErrors?: boolean
    -  }
    -
    -  type Options = T extends string
    -    ? StringOptions
    -    : T extends Buffer
    -    ? BufferOptions
    -    : ObjectModeOptions
    -}
    -
    -declare class Minipass<
    -    RType extends any = Buffer,
    -    WType extends any = RType extends Minipass.BufferOrString
    -      ? Minipass.ContiguousData
    -      : RType
    -  >
    -  extends Stream
    -  implements Minipass.DualIterable
    -{
    -  static isStream(stream: any): stream is Minipass.Readable | Minipass.Writable
    -
    -  readonly bufferLength: number
    -  readonly flowing: boolean
    -  readonly writable: boolean
    -  readonly readable: boolean
    -  readonly paused: boolean
    -  readonly emittedEnd: boolean
    -  readonly destroyed: boolean
    -
    -  /**
    -   * Not technically private or readonly, but not safe to mutate.
    -   */
    -  private readonly buffer: RType[]
    -  private readonly pipes: Minipass.Pipe[]
    -
    -  /**
    -   * Technically writable, but mutating it can change the type,
    -   * so is not safe to do in TypeScript.
    -   */
    -  readonly objectMode: boolean
    -  async: boolean
    -
    -  /**
    -   * Note: encoding is not actually read-only, and setEncoding(enc)
    -   * exists. However, this type definition will insist that TypeScript
    -   * programs declare the type of a Minipass stream up front, and if
    -   * that type is string, then an encoding MUST be set in the ctor. If
    -   * the type is Buffer, then the encoding must be missing, or set to
    -   * 'buffer' or null. If the type is anything else, then objectMode
    -   * must be set in the constructor options.  So there is effectively
    -   * no allowed way that a TS program can set the encoding after
    -   * construction, as doing so will destroy any hope of type safety.
    -   * TypeScript does not provide many options for changing the type of
    -   * an object at run-time, which is what changing the encoding does.
    -   */
    -  readonly encoding: Minipass.Encoding
    -  // setEncoding(encoding: Encoding): void
    -
    -  // Options required if not reading buffers
    -  constructor(
    -    ...args: RType extends Buffer
    -      ? [] | [Minipass.Options]
    -      : [Minipass.Options]
    -  )
    -
    -  write(chunk: WType, cb?: () => void): boolean
    -  write(chunk: WType, encoding?: Minipass.Encoding, cb?: () => void): boolean
    -  read(size?: number): RType
    -  end(cb?: () => void): this
    -  end(chunk: any, cb?: () => void): this
    -  end(chunk: any, encoding?: Minipass.Encoding, cb?: () => void): this
    -  pause(): void
    -  resume(): void
    -  promise(): Promise
    -  collect(): Promise
    -
    -  concat(): RType extends Minipass.BufferOrString ? Promise : never
    -  destroy(er?: any): void
    -  pipe(dest: W, opts?: Minipass.PipeOptions): W
    -  unpipe(dest: W): void
    -
    -  /**
    -   * alias for on()
    -   */
    -  addEventHandler(event: string, listener: (...args: any[]) => any): this
    -
    -  on(event: string, listener: (...args: any[]) => any): this
    -  on(event: 'data', listener: (chunk: RType) => any): this
    -  on(event: 'error', listener: (error: any) => any): this
    -  on(
    -    event:
    -      | 'readable'
    -      | 'drain'
    -      | 'resume'
    -      | 'end'
    -      | 'prefinish'
    -      | 'finish'
    -      | 'close',
    -    listener: () => any
    -  ): this
    -
    -  [Symbol.iterator](): Iterator
    -  [Symbol.asyncIterator](): AsyncIterator
    -}
    -
    -export = Minipass
    diff --git a/deps/npm/node_modules/minipass-sized/node_modules/minipass/index.d.ts b/deps/npm/node_modules/minipass-sized/node_modules/minipass/index.d.ts
    deleted file mode 100644
    index 65faf63686c213..00000000000000
    --- a/deps/npm/node_modules/minipass-sized/node_modules/minipass/index.d.ts
    +++ /dev/null
    @@ -1,155 +0,0 @@
    -/// 
    -import { EventEmitter } from 'events'
    -import { Stream } from 'stream'
    -
    -declare namespace Minipass {
    -  type Encoding = BufferEncoding | 'buffer' | null
    -
    -  interface Writable extends EventEmitter {
    -    end(): any
    -    write(chunk: any, ...args: any[]): any
    -  }
    -
    -  interface Readable extends EventEmitter {
    -    pause(): any
    -    resume(): any
    -    pipe(): any
    -  }
    -
    -  interface Pipe {
    -    src: Minipass
    -    dest: Writable
    -    opts: PipeOptions
    -  }
    -
    -  type DualIterable = Iterable & AsyncIterable
    -
    -  type ContiguousData = Buffer | ArrayBufferLike | ArrayBufferView | string
    -
    -  type BufferOrString = Buffer | string
    -
    -  interface StringOptions {
    -    encoding: BufferEncoding
    -    objectMode?: boolean
    -    async?: boolean
    -  }
    -
    -  interface BufferOptions {
    -    encoding?: null | 'buffer'
    -    objectMode?: boolean
    -    async?: boolean
    -  }
    -
    -  interface ObjectModeOptions {
    -    objectMode: true
    -    async?: boolean
    -  }
    -
    -  interface PipeOptions {
    -    end?: boolean
    -    proxyErrors?: boolean
    -  }
    -
    -  type Options = T extends string
    -    ? StringOptions
    -    : T extends Buffer
    -    ? BufferOptions
    -    : ObjectModeOptions
    -}
    -
    -declare class Minipass<
    -    RType extends any = Buffer,
    -    WType extends any = RType extends Minipass.BufferOrString
    -      ? Minipass.ContiguousData
    -      : RType
    -  >
    -  extends Stream
    -  implements Minipass.DualIterable
    -{
    -  static isStream(stream: any): stream is Minipass.Readable | Minipass.Writable
    -
    -  readonly bufferLength: number
    -  readonly flowing: boolean
    -  readonly writable: boolean
    -  readonly readable: boolean
    -  readonly paused: boolean
    -  readonly emittedEnd: boolean
    -  readonly destroyed: boolean
    -
    -  /**
    -   * Not technically private or readonly, but not safe to mutate.
    -   */
    -  private readonly buffer: RType[]
    -  private readonly pipes: Minipass.Pipe[]
    -
    -  /**
    -   * Technically writable, but mutating it can change the type,
    -   * so is not safe to do in TypeScript.
    -   */
    -  readonly objectMode: boolean
    -  async: boolean
    -
    -  /**
    -   * Note: encoding is not actually read-only, and setEncoding(enc)
    -   * exists. However, this type definition will insist that TypeScript
    -   * programs declare the type of a Minipass stream up front, and if
    -   * that type is string, then an encoding MUST be set in the ctor. If
    -   * the type is Buffer, then the encoding must be missing, or set to
    -   * 'buffer' or null. If the type is anything else, then objectMode
    -   * must be set in the constructor options.  So there is effectively
    -   * no allowed way that a TS program can set the encoding after
    -   * construction, as doing so will destroy any hope of type safety.
    -   * TypeScript does not provide many options for changing the type of
    -   * an object at run-time, which is what changing the encoding does.
    -   */
    -  readonly encoding: Minipass.Encoding
    -  // setEncoding(encoding: Encoding): void
    -
    -  // Options required if not reading buffers
    -  constructor(
    -    ...args: RType extends Buffer
    -      ? [] | [Minipass.Options]
    -      : [Minipass.Options]
    -  )
    -
    -  write(chunk: WType, cb?: () => void): boolean
    -  write(chunk: WType, encoding?: Minipass.Encoding, cb?: () => void): boolean
    -  read(size?: number): RType
    -  end(cb?: () => void): this
    -  end(chunk: any, cb?: () => void): this
    -  end(chunk: any, encoding?: Minipass.Encoding, cb?: () => void): this
    -  pause(): void
    -  resume(): void
    -  promise(): Promise
    -  collect(): Promise
    -
    -  concat(): RType extends Minipass.BufferOrString ? Promise : never
    -  destroy(er?: any): void
    -  pipe(dest: W, opts?: Minipass.PipeOptions): W
    -  unpipe(dest: W): void
    -
    -  /**
    -   * alias for on()
    -   */
    -  addEventHandler(event: string, listener: (...args: any[]) => any): this
    -
    -  on(event: string, listener: (...args: any[]) => any): this
    -  on(event: 'data', listener: (chunk: RType) => any): this
    -  on(event: 'error', listener: (error: any) => any): this
    -  on(
    -    event:
    -      | 'readable'
    -      | 'drain'
    -      | 'resume'
    -      | 'end'
    -      | 'prefinish'
    -      | 'finish'
    -      | 'close',
    -    listener: () => any
    -  ): this
    -
    -  [Symbol.iterator](): Iterator
    -  [Symbol.asyncIterator](): AsyncIterator
    -}
    -
    -export = Minipass
    diff --git a/deps/npm/node_modules/minipass/index.d.ts b/deps/npm/node_modules/minipass/index.d.ts
    deleted file mode 100644
    index 93a06eb357109b..00000000000000
    --- a/deps/npm/node_modules/minipass/index.d.ts
    +++ /dev/null
    @@ -1,147 +0,0 @@
    -/// 
    -
    -// Note: marking anything protected or private in the exported
    -// class will limit Minipass's ability to be used as the base
    -// for mixin classes.
    -import { EventEmitter } from 'events'
    -import { Stream } from 'stream'
    -
    -declare namespace Minipass {
    -  type Encoding = BufferEncoding | 'buffer' | null
    -
    -  interface Writable extends EventEmitter {
    -    end(): any
    -    write(chunk: any, ...args: any[]): any
    -  }
    -
    -  interface Readable extends EventEmitter {
    -    pause(): any
    -    resume(): any
    -    pipe(): any
    -  }
    -
    -  type DualIterable = Iterable & AsyncIterable
    -
    -  type ContiguousData = Buffer | ArrayBufferLike | ArrayBufferView | string
    -
    -  type BufferOrString = Buffer | string
    -
    -  interface StringOptions {
    -    encoding: BufferEncoding
    -    objectMode?: boolean
    -    async?: boolean
    -  }
    -
    -  interface BufferOptions {
    -    encoding?: null | 'buffer'
    -    objectMode?: boolean
    -    async?: boolean
    -  }
    -
    -  interface ObjectModeOptions {
    -    objectMode: true
    -    async?: boolean
    -  }
    -
    -  interface PipeOptions {
    -    end?: boolean
    -    proxyErrors?: boolean
    -  }
    -
    -  type Options = T extends string
    -    ? StringOptions
    -    : T extends Buffer
    -    ? BufferOptions
    -    : ObjectModeOptions
    -}
    -
    -declare class Minipass<
    -    RType extends any = Buffer,
    -    WType extends any = RType extends Minipass.BufferOrString
    -      ? Minipass.ContiguousData
    -      : RType
    -  >
    -  extends Stream
    -  implements Minipass.DualIterable
    -{
    -  static isStream(stream: any): stream is Minipass.Readable | Minipass.Writable
    -
    -  readonly bufferLength: number
    -  readonly flowing: boolean
    -  readonly writable: boolean
    -  readonly readable: boolean
    -  readonly paused: boolean
    -  readonly emittedEnd: boolean
    -  readonly destroyed: boolean
    -
    -  /**
    -   * Technically writable, but mutating it can change the type,
    -   * so is not safe to do in TypeScript.
    -   */
    -  readonly objectMode: boolean
    -  async: boolean
    -
    -  /**
    -   * Note: encoding is not actually read-only, and setEncoding(enc)
    -   * exists. However, this type definition will insist that TypeScript
    -   * programs declare the type of a Minipass stream up front, and if
    -   * that type is string, then an encoding MUST be set in the ctor. If
    -   * the type is Buffer, then the encoding must be missing, or set to
    -   * 'buffer' or null. If the type is anything else, then objectMode
    -   * must be set in the constructor options.  So there is effectively
    -   * no allowed way that a TS program can set the encoding after
    -   * construction, as doing so will destroy any hope of type safety.
    -   * TypeScript does not provide many options for changing the type of
    -   * an object at run-time, which is what changing the encoding does.
    -   */
    -  readonly encoding: Minipass.Encoding
    -  // setEncoding(encoding: Encoding): void
    -
    -  // Options required if not reading buffers
    -  constructor(
    -    ...args: RType extends Buffer
    -      ? [] | [Minipass.Options]
    -      : [Minipass.Options]
    -  )
    -
    -  write(chunk: WType, cb?: () => void): boolean
    -  write(chunk: WType, encoding?: Minipass.Encoding, cb?: () => void): boolean
    -  read(size?: number): RType
    -  end(cb?: () => void): this
    -  end(chunk: any, cb?: () => void): this
    -  end(chunk: any, encoding?: Minipass.Encoding, cb?: () => void): this
    -  pause(): void
    -  resume(): void
    -  promise(): Promise
    -  collect(): Promise
    -
    -  concat(): RType extends Minipass.BufferOrString ? Promise : never
    -  destroy(er?: any): void
    -  pipe(dest: W, opts?: Minipass.PipeOptions): W
    -  unpipe(dest: W): void
    -
    -  /**
    -   * alias for on()
    -   */
    -  addEventHandler(event: string, listener: (...args: any[]) => any): this
    -
    -  on(event: string, listener: (...args: any[]) => any): this
    -  on(event: 'data', listener: (chunk: RType) => any): this
    -  on(event: 'error', listener: (error: any) => any): this
    -  on(
    -    event:
    -      | 'readable'
    -      | 'drain'
    -      | 'resume'
    -      | 'end'
    -      | 'prefinish'
    -      | 'finish'
    -      | 'close',
    -    listener: () => any
    -  ): this
    -
    -  [Symbol.iterator](): Generator
    -  [Symbol.asyncIterator](): AsyncGenerator
    -}
    -
    -export = Minipass
    diff --git a/deps/npm/node_modules/minipass/index.js b/deps/npm/node_modules/minipass/index.js
    index 5d45de8d39f76e..5e192c2824586c 100644
    --- a/deps/npm/node_modules/minipass/index.js
    +++ b/deps/npm/node_modules/minipass/index.js
    @@ -8,7 +8,8 @@ const proc =
           }
     const EE = require('events')
     const Stream = require('stream')
    -const SD = require('string_decoder').StringDecoder
    +const stringdecoder = require('string_decoder')
    +const SD = stringdecoder.StringDecoder
     
     const EOF = Symbol('EOF')
     const MAYBE_EMIT_END = Symbol('maybeEmitEnd')
    @@ -38,6 +39,9 @@ const EMITDATA = Symbol('emitData')
     const EMITEND = Symbol('emitEnd')
     const EMITEND2 = Symbol('emitEnd2')
     const ASYNC = Symbol('async')
    +const ABORT = Symbol('abort')
    +const ABORTED = Symbol('aborted')
    +const SIGNAL = Symbol('signal')
     
     const defer = fn => Promise.resolve().then(fn)
     
    @@ -93,7 +97,7 @@ class PipeProxyErrors extends Pipe {
       }
     }
     
    -module.exports = class Minipass extends Stream {
    +class Minipass extends Stream {
       constructor(options) {
         super()
         this[FLOWING] = false
    @@ -122,6 +126,14 @@ module.exports = class Minipass extends Stream {
         if (options && options.debugExposePipes === true) {
           Object.defineProperty(this, 'pipes', { get: () => this[PIPES] })
         }
    +    this[SIGNAL] = options && options.signal
    +    this[ABORTED] = false
    +    if (this[SIGNAL]) {
    +      this[SIGNAL].addEventListener('abort', () => this[ABORT]())
    +      if (this[SIGNAL].aborted) {
    +        this[ABORT]()
    +      }
    +    }
       }
     
       get bufferLength() {
    @@ -168,7 +180,20 @@ module.exports = class Minipass extends Stream {
         this[ASYNC] = this[ASYNC] || !!a
       }
     
    +  // drop everything and get out of the flow completely
    +  [ABORT]() {
    +    this[ABORTED] = true
    +    this.emit('abort', this[SIGNAL].reason)
    +    this.destroy(this[SIGNAL].reason)
    +  }
    +
    +  get aborted() {
    +    return this[ABORTED]
    +  }
    +  set aborted(_) {}
    +
       write(chunk, encoding, cb) {
    +    if (this[ABORTED]) return false
         if (this[EOF]) throw new Error('write after end')
     
         if (this[DESTROYED]) {
    @@ -342,21 +367,20 @@ module.exports = class Minipass extends Stream {
       }
     
       [BUFFERSHIFT]() {
    -    if (this[BUFFER].length) {
    -      if (this[OBJECTMODE]) this[BUFFERLENGTH] -= 1
    -      else this[BUFFERLENGTH] -= this[BUFFER][0].length
    -    }
    +    if (this[OBJECTMODE]) this[BUFFERLENGTH] -= 1
    +    else this[BUFFERLENGTH] -= this[BUFFER][0].length
         return this[BUFFER].shift()
       }
     
       [FLUSH](noDrain) {
    -    do {} while (this[FLUSHCHUNK](this[BUFFERSHIFT]()))
    +    do {} while (this[FLUSHCHUNK](this[BUFFERSHIFT]()) && this[BUFFER].length)
     
         if (!noDrain && !this[BUFFER].length && !this[EOF]) this.emit('drain')
       }
     
       [FLUSHCHUNK](chunk) {
    -    return chunk ? (this.emit('data', chunk), this.flowing) : false
    +    this.emit('data', chunk)
    +    return this.flowing
       }
     
       pipe(dest, opts) {
    @@ -437,7 +461,7 @@ module.exports = class Minipass extends Stream {
         if (ev !== 'error' && ev !== 'close' && ev !== DESTROYED && this[DESTROYED])
           return
         else if (ev === 'data') {
    -      return !data
    +      return !this[OBJECTMODE] && !data
             ? false
             : this[ASYNC]
             ? defer(() => this[EMITDATA](data))
    @@ -454,7 +478,10 @@ module.exports = class Minipass extends Stream {
         } else if (ev === 'error') {
           this[EMITTED_ERROR] = data
           super.emit(ERROR, data)
    -      const ret = super.emit('error', data)
    +      const ret =
    +        !this[SIGNAL] || this.listeners('error').length
    +          ? super.emit('error', data)
    +          : false
           this[MAYBE_EMIT_END]()
           return ret
         } else if (ev === 'resume') {
    @@ -566,18 +593,21 @@ module.exports = class Minipass extends Stream {
           const onerr = er => {
             this.removeListener('data', ondata)
             this.removeListener('end', onend)
    +        this.removeListener(DESTROYED, ondestroy)
             stop()
             reject(er)
           }
           const ondata = value => {
             this.removeListener('error', onerr)
             this.removeListener('end', onend)
    +        this.removeListener(DESTROYED, ondestroy)
             this.pause()
             resolve({ value: value, done: !!this[EOF] })
           }
           const onend = () => {
             this.removeListener('error', onerr)
             this.removeListener('data', ondata)
    +        this.removeListener(DESTROYED, ondestroy)
             stop()
             resolve({ done: true })
           }
    @@ -608,6 +638,7 @@ module.exports = class Minipass extends Stream {
         const stop = () => {
           this.pause()
           this.removeListener(ERROR, stop)
    +      this.removeListener(DESTROYED, stop)
           this.removeListener('end', stop)
           stopped = true
           return { done: true }
    @@ -620,6 +651,7 @@ module.exports = class Minipass extends Stream {
         }
         this.once('end', stop)
         this.once(ERROR, stop)
    +    this.once(DESTROYED, stop)
     
         return {
           next,
    @@ -659,8 +691,12 @@ module.exports = class Minipass extends Stream {
           (s instanceof Minipass ||
             s instanceof Stream ||
             (s instanceof EE &&
    -          (typeof s.pipe === 'function' || // readable
    -            (typeof s.write === 'function' && typeof s.end === 'function')))) // writable
    +          // readable
    +          (typeof s.pipe === 'function' ||
    +            // writable
    +            (typeof s.write === 'function' && typeof s.end === 'function'))))
         )
       }
     }
    +
    +module.exports = Minipass
    diff --git a/deps/npm/node_modules/minipass/index.mjs b/deps/npm/node_modules/minipass/index.mjs
    new file mode 100644
    index 00000000000000..d5c58fc9814c00
    --- /dev/null
    +++ b/deps/npm/node_modules/minipass/index.mjs
    @@ -0,0 +1,702 @@
    +'use strict'
    +const proc =
    +  typeof process === 'object' && process
    +    ? process
    +    : {
    +        stdout: null,
    +        stderr: null,
    +      }
    +import EE from 'events'
    +import Stream from 'stream'
    +import stringdecoder from 'string_decoder'
    +const SD = stringdecoder.StringDecoder
    +
    +const EOF = Symbol('EOF')
    +const MAYBE_EMIT_END = Symbol('maybeEmitEnd')
    +const EMITTED_END = Symbol('emittedEnd')
    +const EMITTING_END = Symbol('emittingEnd')
    +const EMITTED_ERROR = Symbol('emittedError')
    +const CLOSED = Symbol('closed')
    +const READ = Symbol('read')
    +const FLUSH = Symbol('flush')
    +const FLUSHCHUNK = Symbol('flushChunk')
    +const ENCODING = Symbol('encoding')
    +const DECODER = Symbol('decoder')
    +const FLOWING = Symbol('flowing')
    +const PAUSED = Symbol('paused')
    +const RESUME = Symbol('resume')
    +const BUFFER = Symbol('buffer')
    +const PIPES = Symbol('pipes')
    +const BUFFERLENGTH = Symbol('bufferLength')
    +const BUFFERPUSH = Symbol('bufferPush')
    +const BUFFERSHIFT = Symbol('bufferShift')
    +const OBJECTMODE = Symbol('objectMode')
    +// internal event when stream is destroyed
    +const DESTROYED = Symbol('destroyed')
    +// internal event when stream has an error
    +const ERROR = Symbol('error')
    +const EMITDATA = Symbol('emitData')
    +const EMITEND = Symbol('emitEnd')
    +const EMITEND2 = Symbol('emitEnd2')
    +const ASYNC = Symbol('async')
    +const ABORT = Symbol('abort')
    +const ABORTED = Symbol('aborted')
    +const SIGNAL = Symbol('signal')
    +
    +const defer = fn => Promise.resolve().then(fn)
    +
    +// TODO remove when Node v8 support drops
    +const doIter = global._MP_NO_ITERATOR_SYMBOLS_ !== '1'
    +const ASYNCITERATOR =
    +  (doIter && Symbol.asyncIterator) || Symbol('asyncIterator not implemented')
    +const ITERATOR =
    +  (doIter && Symbol.iterator) || Symbol('iterator not implemented')
    +
    +// events that mean 'the stream is over'
    +// these are treated specially, and re-emitted
    +// if they are listened for after emitting.
    +const isEndish = ev => ev === 'end' || ev === 'finish' || ev === 'prefinish'
    +
    +const isArrayBuffer = b =>
    +  b instanceof ArrayBuffer ||
    +  (typeof b === 'object' &&
    +    b.constructor &&
    +    b.constructor.name === 'ArrayBuffer' &&
    +    b.byteLength >= 0)
    +
    +const isArrayBufferView = b => !Buffer.isBuffer(b) && ArrayBuffer.isView(b)
    +
    +class Pipe {
    +  constructor(src, dest, opts) {
    +    this.src = src
    +    this.dest = dest
    +    this.opts = opts
    +    this.ondrain = () => src[RESUME]()
    +    dest.on('drain', this.ondrain)
    +  }
    +  unpipe() {
    +    this.dest.removeListener('drain', this.ondrain)
    +  }
    +  // istanbul ignore next - only here for the prototype
    +  proxyErrors() {}
    +  end() {
    +    this.unpipe()
    +    if (this.opts.end) this.dest.end()
    +  }
    +}
    +
    +class PipeProxyErrors extends Pipe {
    +  unpipe() {
    +    this.src.removeListener('error', this.proxyErrors)
    +    super.unpipe()
    +  }
    +  constructor(src, dest, opts) {
    +    super(src, dest, opts)
    +    this.proxyErrors = er => dest.emit('error', er)
    +    src.on('error', this.proxyErrors)
    +  }
    +}
    +
    +class Minipass extends Stream {
    +  constructor(options) {
    +    super()
    +    this[FLOWING] = false
    +    // whether we're explicitly paused
    +    this[PAUSED] = false
    +    this[PIPES] = []
    +    this[BUFFER] = []
    +    this[OBJECTMODE] = (options && options.objectMode) || false
    +    if (this[OBJECTMODE]) this[ENCODING] = null
    +    else this[ENCODING] = (options && options.encoding) || null
    +    if (this[ENCODING] === 'buffer') this[ENCODING] = null
    +    this[ASYNC] = (options && !!options.async) || false
    +    this[DECODER] = this[ENCODING] ? new SD(this[ENCODING]) : null
    +    this[EOF] = false
    +    this[EMITTED_END] = false
    +    this[EMITTING_END] = false
    +    this[CLOSED] = false
    +    this[EMITTED_ERROR] = null
    +    this.writable = true
    +    this.readable = true
    +    this[BUFFERLENGTH] = 0
    +    this[DESTROYED] = false
    +    if (options && options.debugExposeBuffer === true) {
    +      Object.defineProperty(this, 'buffer', { get: () => this[BUFFER] })
    +    }
    +    if (options && options.debugExposePipes === true) {
    +      Object.defineProperty(this, 'pipes', { get: () => this[PIPES] })
    +    }
    +    this[SIGNAL] = options && options.signal
    +    this[ABORTED] = false
    +    if (this[SIGNAL]) {
    +      this[SIGNAL].addEventListener('abort', () => this[ABORT]())
    +      if (this[SIGNAL].aborted) {
    +        this[ABORT]()
    +      }
    +    }
    +  }
    +
    +  get bufferLength() {
    +    return this[BUFFERLENGTH]
    +  }
    +
    +  get encoding() {
    +    return this[ENCODING]
    +  }
    +  set encoding(enc) {
    +    if (this[OBJECTMODE]) throw new Error('cannot set encoding in objectMode')
    +
    +    if (
    +      this[ENCODING] &&
    +      enc !== this[ENCODING] &&
    +      ((this[DECODER] && this[DECODER].lastNeed) || this[BUFFERLENGTH])
    +    )
    +      throw new Error('cannot change encoding')
    +
    +    if (this[ENCODING] !== enc) {
    +      this[DECODER] = enc ? new SD(enc) : null
    +      if (this[BUFFER].length)
    +        this[BUFFER] = this[BUFFER].map(chunk => this[DECODER].write(chunk))
    +    }
    +
    +    this[ENCODING] = enc
    +  }
    +
    +  setEncoding(enc) {
    +    this.encoding = enc
    +  }
    +
    +  get objectMode() {
    +    return this[OBJECTMODE]
    +  }
    +  set objectMode(om) {
    +    this[OBJECTMODE] = this[OBJECTMODE] || !!om
    +  }
    +
    +  get ['async']() {
    +    return this[ASYNC]
    +  }
    +  set ['async'](a) {
    +    this[ASYNC] = this[ASYNC] || !!a
    +  }
    +
    +  // drop everything and get out of the flow completely
    +  [ABORT]() {
    +    this[ABORTED] = true
    +    this.emit('abort', this[SIGNAL].reason)
    +    this.destroy(this[SIGNAL].reason)
    +  }
    +
    +  get aborted() {
    +    return this[ABORTED]
    +  }
    +  set aborted(_) {}
    +
    +  write(chunk, encoding, cb) {
    +    if (this[ABORTED]) return false
    +    if (this[EOF]) throw new Error('write after end')
    +
    +    if (this[DESTROYED]) {
    +      this.emit(
    +        'error',
    +        Object.assign(
    +          new Error('Cannot call write after a stream was destroyed'),
    +          { code: 'ERR_STREAM_DESTROYED' }
    +        )
    +      )
    +      return true
    +    }
    +
    +    if (typeof encoding === 'function') (cb = encoding), (encoding = 'utf8')
    +
    +    if (!encoding) encoding = 'utf8'
    +
    +    const fn = this[ASYNC] ? defer : f => f()
    +
    +    // convert array buffers and typed array views into buffers
    +    // at some point in the future, we may want to do the opposite!
    +    // leave strings and buffers as-is
    +    // anything else switches us into object mode
    +    if (!this[OBJECTMODE] && !Buffer.isBuffer(chunk)) {
    +      if (isArrayBufferView(chunk))
    +        chunk = Buffer.from(chunk.buffer, chunk.byteOffset, chunk.byteLength)
    +      else if (isArrayBuffer(chunk)) chunk = Buffer.from(chunk)
    +      else if (typeof chunk !== 'string')
    +        // use the setter so we throw if we have encoding set
    +        this.objectMode = true
    +    }
    +
    +    // handle object mode up front, since it's simpler
    +    // this yields better performance, fewer checks later.
    +    if (this[OBJECTMODE]) {
    +      /* istanbul ignore if - maybe impossible? */
    +      if (this.flowing && this[BUFFERLENGTH] !== 0) this[FLUSH](true)
    +
    +      if (this.flowing) this.emit('data', chunk)
    +      else this[BUFFERPUSH](chunk)
    +
    +      if (this[BUFFERLENGTH] !== 0) this.emit('readable')
    +
    +      if (cb) fn(cb)
    +
    +      return this.flowing
    +    }
    +
    +    // at this point the chunk is a buffer or string
    +    // don't buffer it up or send it to the decoder
    +    if (!chunk.length) {
    +      if (this[BUFFERLENGTH] !== 0) this.emit('readable')
    +      if (cb) fn(cb)
    +      return this.flowing
    +    }
    +
    +    // fast-path writing strings of same encoding to a stream with
    +    // an empty buffer, skipping the buffer/decoder dance
    +    if (
    +      typeof chunk === 'string' &&
    +      // unless it is a string already ready for us to use
    +      !(encoding === this[ENCODING] && !this[DECODER].lastNeed)
    +    ) {
    +      chunk = Buffer.from(chunk, encoding)
    +    }
    +
    +    if (Buffer.isBuffer(chunk) && this[ENCODING])
    +      chunk = this[DECODER].write(chunk)
    +
    +    // Note: flushing CAN potentially switch us into not-flowing mode
    +    if (this.flowing && this[BUFFERLENGTH] !== 0) this[FLUSH](true)
    +
    +    if (this.flowing) this.emit('data', chunk)
    +    else this[BUFFERPUSH](chunk)
    +
    +    if (this[BUFFERLENGTH] !== 0) this.emit('readable')
    +
    +    if (cb) fn(cb)
    +
    +    return this.flowing
    +  }
    +
    +  read(n) {
    +    if (this[DESTROYED]) return null
    +
    +    if (this[BUFFERLENGTH] === 0 || n === 0 || n > this[BUFFERLENGTH]) {
    +      this[MAYBE_EMIT_END]()
    +      return null
    +    }
    +
    +    if (this[OBJECTMODE]) n = null
    +
    +    if (this[BUFFER].length > 1 && !this[OBJECTMODE]) {
    +      if (this.encoding) this[BUFFER] = [this[BUFFER].join('')]
    +      else this[BUFFER] = [Buffer.concat(this[BUFFER], this[BUFFERLENGTH])]
    +    }
    +
    +    const ret = this[READ](n || null, this[BUFFER][0])
    +    this[MAYBE_EMIT_END]()
    +    return ret
    +  }
    +
    +  [READ](n, chunk) {
    +    if (n === chunk.length || n === null) this[BUFFERSHIFT]()
    +    else {
    +      this[BUFFER][0] = chunk.slice(n)
    +      chunk = chunk.slice(0, n)
    +      this[BUFFERLENGTH] -= n
    +    }
    +
    +    this.emit('data', chunk)
    +
    +    if (!this[BUFFER].length && !this[EOF]) this.emit('drain')
    +
    +    return chunk
    +  }
    +
    +  end(chunk, encoding, cb) {
    +    if (typeof chunk === 'function') (cb = chunk), (chunk = null)
    +    if (typeof encoding === 'function') (cb = encoding), (encoding = 'utf8')
    +    if (chunk) this.write(chunk, encoding)
    +    if (cb) this.once('end', cb)
    +    this[EOF] = true
    +    this.writable = false
    +
    +    // if we haven't written anything, then go ahead and emit,
    +    // even if we're not reading.
    +    // we'll re-emit if a new 'end' listener is added anyway.
    +    // This makes MP more suitable to write-only use cases.
    +    if (this.flowing || !this[PAUSED]) this[MAYBE_EMIT_END]()
    +    return this
    +  }
    +
    +  // don't let the internal resume be overwritten
    +  [RESUME]() {
    +    if (this[DESTROYED]) return
    +
    +    this[PAUSED] = false
    +    this[FLOWING] = true
    +    this.emit('resume')
    +    if (this[BUFFER].length) this[FLUSH]()
    +    else if (this[EOF]) this[MAYBE_EMIT_END]()
    +    else this.emit('drain')
    +  }
    +
    +  resume() {
    +    return this[RESUME]()
    +  }
    +
    +  pause() {
    +    this[FLOWING] = false
    +    this[PAUSED] = true
    +  }
    +
    +  get destroyed() {
    +    return this[DESTROYED]
    +  }
    +
    +  get flowing() {
    +    return this[FLOWING]
    +  }
    +
    +  get paused() {
    +    return this[PAUSED]
    +  }
    +
    +  [BUFFERPUSH](chunk) {
    +    if (this[OBJECTMODE]) this[BUFFERLENGTH] += 1
    +    else this[BUFFERLENGTH] += chunk.length
    +    this[BUFFER].push(chunk)
    +  }
    +
    +  [BUFFERSHIFT]() {
    +    if (this[OBJECTMODE]) this[BUFFERLENGTH] -= 1
    +    else this[BUFFERLENGTH] -= this[BUFFER][0].length
    +    return this[BUFFER].shift()
    +  }
    +
    +  [FLUSH](noDrain) {
    +    do {} while (this[FLUSHCHUNK](this[BUFFERSHIFT]()) && this[BUFFER].length)
    +
    +    if (!noDrain && !this[BUFFER].length && !this[EOF]) this.emit('drain')
    +  }
    +
    +  [FLUSHCHUNK](chunk) {
    +    this.emit('data', chunk)
    +    return this.flowing
    +  }
    +
    +  pipe(dest, opts) {
    +    if (this[DESTROYED]) return
    +
    +    const ended = this[EMITTED_END]
    +    opts = opts || {}
    +    if (dest === proc.stdout || dest === proc.stderr) opts.end = false
    +    else opts.end = opts.end !== false
    +    opts.proxyErrors = !!opts.proxyErrors
    +
    +    // piping an ended stream ends immediately
    +    if (ended) {
    +      if (opts.end) dest.end()
    +    } else {
    +      this[PIPES].push(
    +        !opts.proxyErrors
    +          ? new Pipe(this, dest, opts)
    +          : new PipeProxyErrors(this, dest, opts)
    +      )
    +      if (this[ASYNC]) defer(() => this[RESUME]())
    +      else this[RESUME]()
    +    }
    +
    +    return dest
    +  }
    +
    +  unpipe(dest) {
    +    const p = this[PIPES].find(p => p.dest === dest)
    +    if (p) {
    +      this[PIPES].splice(this[PIPES].indexOf(p), 1)
    +      p.unpipe()
    +    }
    +  }
    +
    +  addListener(ev, fn) {
    +    return this.on(ev, fn)
    +  }
    +
    +  on(ev, fn) {
    +    const ret = super.on(ev, fn)
    +    if (ev === 'data' && !this[PIPES].length && !this.flowing) this[RESUME]()
    +    else if (ev === 'readable' && this[BUFFERLENGTH] !== 0)
    +      super.emit('readable')
    +    else if (isEndish(ev) && this[EMITTED_END]) {
    +      super.emit(ev)
    +      this.removeAllListeners(ev)
    +    } else if (ev === 'error' && this[EMITTED_ERROR]) {
    +      if (this[ASYNC]) defer(() => fn.call(this, this[EMITTED_ERROR]))
    +      else fn.call(this, this[EMITTED_ERROR])
    +    }
    +    return ret
    +  }
    +
    +  get emittedEnd() {
    +    return this[EMITTED_END]
    +  }
    +
    +  [MAYBE_EMIT_END]() {
    +    if (
    +      !this[EMITTING_END] &&
    +      !this[EMITTED_END] &&
    +      !this[DESTROYED] &&
    +      this[BUFFER].length === 0 &&
    +      this[EOF]
    +    ) {
    +      this[EMITTING_END] = true
    +      this.emit('end')
    +      this.emit('prefinish')
    +      this.emit('finish')
    +      if (this[CLOSED]) this.emit('close')
    +      this[EMITTING_END] = false
    +    }
    +  }
    +
    +  emit(ev, data, ...extra) {
    +    // error and close are only events allowed after calling destroy()
    +    if (ev !== 'error' && ev !== 'close' && ev !== DESTROYED && this[DESTROYED])
    +      return
    +    else if (ev === 'data') {
    +      return !this[OBJECTMODE] && !data
    +        ? false
    +        : this[ASYNC]
    +        ? defer(() => this[EMITDATA](data))
    +        : this[EMITDATA](data)
    +    } else if (ev === 'end') {
    +      return this[EMITEND]()
    +    } else if (ev === 'close') {
    +      this[CLOSED] = true
    +      // don't emit close before 'end' and 'finish'
    +      if (!this[EMITTED_END] && !this[DESTROYED]) return
    +      const ret = super.emit('close')
    +      this.removeAllListeners('close')
    +      return ret
    +    } else if (ev === 'error') {
    +      this[EMITTED_ERROR] = data
    +      super.emit(ERROR, data)
    +      const ret =
    +        !this[SIGNAL] || this.listeners('error').length
    +          ? super.emit('error', data)
    +          : false
    +      this[MAYBE_EMIT_END]()
    +      return ret
    +    } else if (ev === 'resume') {
    +      const ret = super.emit('resume')
    +      this[MAYBE_EMIT_END]()
    +      return ret
    +    } else if (ev === 'finish' || ev === 'prefinish') {
    +      const ret = super.emit(ev)
    +      this.removeAllListeners(ev)
    +      return ret
    +    }
    +
    +    // Some other unknown event
    +    const ret = super.emit(ev, data, ...extra)
    +    this[MAYBE_EMIT_END]()
    +    return ret
    +  }
    +
    +  [EMITDATA](data) {
    +    for (const p of this[PIPES]) {
    +      if (p.dest.write(data) === false) this.pause()
    +    }
    +    const ret = super.emit('data', data)
    +    this[MAYBE_EMIT_END]()
    +    return ret
    +  }
    +
    +  [EMITEND]() {
    +    if (this[EMITTED_END]) return
    +
    +    this[EMITTED_END] = true
    +    this.readable = false
    +    if (this[ASYNC]) defer(() => this[EMITEND2]())
    +    else this[EMITEND2]()
    +  }
    +
    +  [EMITEND2]() {
    +    if (this[DECODER]) {
    +      const data = this[DECODER].end()
    +      if (data) {
    +        for (const p of this[PIPES]) {
    +          p.dest.write(data)
    +        }
    +        super.emit('data', data)
    +      }
    +    }
    +
    +    for (const p of this[PIPES]) {
    +      p.end()
    +    }
    +    const ret = super.emit('end')
    +    this.removeAllListeners('end')
    +    return ret
    +  }
    +
    +  // const all = await stream.collect()
    +  collect() {
    +    const buf = []
    +    if (!this[OBJECTMODE]) buf.dataLength = 0
    +    // set the promise first, in case an error is raised
    +    // by triggering the flow here.
    +    const p = this.promise()
    +    this.on('data', c => {
    +      buf.push(c)
    +      if (!this[OBJECTMODE]) buf.dataLength += c.length
    +    })
    +    return p.then(() => buf)
    +  }
    +
    +  // const data = await stream.concat()
    +  concat() {
    +    return this[OBJECTMODE]
    +      ? Promise.reject(new Error('cannot concat in objectMode'))
    +      : this.collect().then(buf =>
    +          this[OBJECTMODE]
    +            ? Promise.reject(new Error('cannot concat in objectMode'))
    +            : this[ENCODING]
    +            ? buf.join('')
    +            : Buffer.concat(buf, buf.dataLength)
    +        )
    +  }
    +
    +  // stream.promise().then(() => done, er => emitted error)
    +  promise() {
    +    return new Promise((resolve, reject) => {
    +      this.on(DESTROYED, () => reject(new Error('stream destroyed')))
    +      this.on('error', er => reject(er))
    +      this.on('end', () => resolve())
    +    })
    +  }
    +
    +  // for await (let chunk of stream)
    +  [ASYNCITERATOR]() {
    +    let stopped = false
    +    const stop = () => {
    +      this.pause()
    +      stopped = true
    +      return Promise.resolve({ done: true })
    +    }
    +    const next = () => {
    +      if (stopped) return stop()
    +      const res = this.read()
    +      if (res !== null) return Promise.resolve({ done: false, value: res })
    +
    +      if (this[EOF]) return stop()
    +
    +      let resolve = null
    +      let reject = null
    +      const onerr = er => {
    +        this.removeListener('data', ondata)
    +        this.removeListener('end', onend)
    +        this.removeListener(DESTROYED, ondestroy)
    +        stop()
    +        reject(er)
    +      }
    +      const ondata = value => {
    +        this.removeListener('error', onerr)
    +        this.removeListener('end', onend)
    +        this.removeListener(DESTROYED, ondestroy)
    +        this.pause()
    +        resolve({ value: value, done: !!this[EOF] })
    +      }
    +      const onend = () => {
    +        this.removeListener('error', onerr)
    +        this.removeListener('data', ondata)
    +        this.removeListener(DESTROYED, ondestroy)
    +        stop()
    +        resolve({ done: true })
    +      }
    +      const ondestroy = () => onerr(new Error('stream destroyed'))
    +      return new Promise((res, rej) => {
    +        reject = rej
    +        resolve = res
    +        this.once(DESTROYED, ondestroy)
    +        this.once('error', onerr)
    +        this.once('end', onend)
    +        this.once('data', ondata)
    +      })
    +    }
    +
    +    return {
    +      next,
    +      throw: stop,
    +      return: stop,
    +      [ASYNCITERATOR]() {
    +        return this
    +      },
    +    }
    +  }
    +
    +  // for (let chunk of stream)
    +  [ITERATOR]() {
    +    let stopped = false
    +    const stop = () => {
    +      this.pause()
    +      this.removeListener(ERROR, stop)
    +      this.removeListener(DESTROYED, stop)
    +      this.removeListener('end', stop)
    +      stopped = true
    +      return { done: true }
    +    }
    +
    +    const next = () => {
    +      if (stopped) return stop()
    +      const value = this.read()
    +      return value === null ? stop() : { value }
    +    }
    +    this.once('end', stop)
    +    this.once(ERROR, stop)
    +    this.once(DESTROYED, stop)
    +
    +    return {
    +      next,
    +      throw: stop,
    +      return: stop,
    +      [ITERATOR]() {
    +        return this
    +      },
    +    }
    +  }
    +
    +  destroy(er) {
    +    if (this[DESTROYED]) {
    +      if (er) this.emit('error', er)
    +      else this.emit(DESTROYED)
    +      return this
    +    }
    +
    +    this[DESTROYED] = true
    +
    +    // throw away all buffered data, it's never coming out
    +    this[BUFFER].length = 0
    +    this[BUFFERLENGTH] = 0
    +
    +    if (typeof this.close === 'function' && !this[CLOSED]) this.close()
    +
    +    if (er) this.emit('error', er)
    +    // if no error to emit, still reject pending promises
    +    else this.emit(DESTROYED)
    +
    +    return this
    +  }
    +
    +  static isStream(s) {
    +    return (
    +      !!s &&
    +      (s instanceof Minipass ||
    +        s instanceof Stream ||
    +        (s instanceof EE &&
    +          // readable
    +          (typeof s.pipe === 'function' ||
    +            // writable
    +            (typeof s.write === 'function' && typeof s.end === 'function'))))
    +    )
    +  }
    +}
    +
    +export default Minipass
    diff --git a/deps/npm/node_modules/minipass/package.json b/deps/npm/node_modules/minipass/package.json
    index 43051ad5b6c831..1286b88ed5d8fc 100644
    --- a/deps/npm/node_modules/minipass/package.json
    +++ b/deps/npm/node_modules/minipass/package.json
    @@ -1,12 +1,27 @@
     {
       "name": "minipass",
    -  "version": "4.0.3",
    +  "version": "4.2.5",
       "description": "minimal implementation of a PassThrough stream",
    -  "main": "index.js",
    -  "types": "index.d.ts",
    +  "main": "./index.js",
    +  "module": "./index.mjs",
    +  "types": "./index.d.ts",
    +  "exports": {
    +    ".": {
    +      "import": {
    +        "types": "./index.d.ts",
    +        "default": "./index.mjs"
    +      },
    +      "require": {
    +        "types": "./index.d.ts",
    +        "default": "./index.js"
    +      }
    +    },
    +    "./package.json": "./package.json"
    +  },
       "devDependencies": {
         "@types/node": "^17.0.41",
         "end-of-stream": "^1.4.0",
    +    "node-abort-controller": "^3.1.1",
         "prettier": "^2.6.2",
         "tap": "^16.2.0",
         "through2": "^2.0.3",
    @@ -15,6 +30,10 @@
         "typescript": "^4.7.3"
       },
       "scripts": {
    +    "pretest": "npm run prepare",
    +    "presnap": "npm run prepare",
    +    "prepare": "node ./scripts/transpile-to-esm.js",
    +    "snap": "tap",
         "test": "tap",
         "preversion": "npm test",
         "postversion": "npm publish",
    @@ -34,7 +53,8 @@
       "license": "ISC",
       "files": [
         "index.d.ts",
    -    "index.js"
    +    "index.js",
    +    "index.mjs"
       ],
       "tap": {
         "check-coverage": true
    diff --git a/deps/npm/node_modules/minizlib/node_modules/minipass/index.d.ts b/deps/npm/node_modules/minizlib/node_modules/minipass/index.d.ts
    deleted file mode 100644
    index 65faf63686c213..00000000000000
    --- a/deps/npm/node_modules/minizlib/node_modules/minipass/index.d.ts
    +++ /dev/null
    @@ -1,155 +0,0 @@
    -/// 
    -import { EventEmitter } from 'events'
    -import { Stream } from 'stream'
    -
    -declare namespace Minipass {
    -  type Encoding = BufferEncoding | 'buffer' | null
    -
    -  interface Writable extends EventEmitter {
    -    end(): any
    -    write(chunk: any, ...args: any[]): any
    -  }
    -
    -  interface Readable extends EventEmitter {
    -    pause(): any
    -    resume(): any
    -    pipe(): any
    -  }
    -
    -  interface Pipe {
    -    src: Minipass
    -    dest: Writable
    -    opts: PipeOptions
    -  }
    -
    -  type DualIterable = Iterable & AsyncIterable
    -
    -  type ContiguousData = Buffer | ArrayBufferLike | ArrayBufferView | string
    -
    -  type BufferOrString = Buffer | string
    -
    -  interface StringOptions {
    -    encoding: BufferEncoding
    -    objectMode?: boolean
    -    async?: boolean
    -  }
    -
    -  interface BufferOptions {
    -    encoding?: null | 'buffer'
    -    objectMode?: boolean
    -    async?: boolean
    -  }
    -
    -  interface ObjectModeOptions {
    -    objectMode: true
    -    async?: boolean
    -  }
    -
    -  interface PipeOptions {
    -    end?: boolean
    -    proxyErrors?: boolean
    -  }
    -
    -  type Options = T extends string
    -    ? StringOptions
    -    : T extends Buffer
    -    ? BufferOptions
    -    : ObjectModeOptions
    -}
    -
    -declare class Minipass<
    -    RType extends any = Buffer,
    -    WType extends any = RType extends Minipass.BufferOrString
    -      ? Minipass.ContiguousData
    -      : RType
    -  >
    -  extends Stream
    -  implements Minipass.DualIterable
    -{
    -  static isStream(stream: any): stream is Minipass.Readable | Minipass.Writable
    -
    -  readonly bufferLength: number
    -  readonly flowing: boolean
    -  readonly writable: boolean
    -  readonly readable: boolean
    -  readonly paused: boolean
    -  readonly emittedEnd: boolean
    -  readonly destroyed: boolean
    -
    -  /**
    -   * Not technically private or readonly, but not safe to mutate.
    -   */
    -  private readonly buffer: RType[]
    -  private readonly pipes: Minipass.Pipe[]
    -
    -  /**
    -   * Technically writable, but mutating it can change the type,
    -   * so is not safe to do in TypeScript.
    -   */
    -  readonly objectMode: boolean
    -  async: boolean
    -
    -  /**
    -   * Note: encoding is not actually read-only, and setEncoding(enc)
    -   * exists. However, this type definition will insist that TypeScript
    -   * programs declare the type of a Minipass stream up front, and if
    -   * that type is string, then an encoding MUST be set in the ctor. If
    -   * the type is Buffer, then the encoding must be missing, or set to
    -   * 'buffer' or null. If the type is anything else, then objectMode
    -   * must be set in the constructor options.  So there is effectively
    -   * no allowed way that a TS program can set the encoding after
    -   * construction, as doing so will destroy any hope of type safety.
    -   * TypeScript does not provide many options for changing the type of
    -   * an object at run-time, which is what changing the encoding does.
    -   */
    -  readonly encoding: Minipass.Encoding
    -  // setEncoding(encoding: Encoding): void
    -
    -  // Options required if not reading buffers
    -  constructor(
    -    ...args: RType extends Buffer
    -      ? [] | [Minipass.Options]
    -      : [Minipass.Options]
    -  )
    -
    -  write(chunk: WType, cb?: () => void): boolean
    -  write(chunk: WType, encoding?: Minipass.Encoding, cb?: () => void): boolean
    -  read(size?: number): RType
    -  end(cb?: () => void): this
    -  end(chunk: any, cb?: () => void): this
    -  end(chunk: any, encoding?: Minipass.Encoding, cb?: () => void): this
    -  pause(): void
    -  resume(): void
    -  promise(): Promise
    -  collect(): Promise
    -
    -  concat(): RType extends Minipass.BufferOrString ? Promise : never
    -  destroy(er?: any): void
    -  pipe(dest: W, opts?: Minipass.PipeOptions): W
    -  unpipe(dest: W): void
    -
    -  /**
    -   * alias for on()
    -   */
    -  addEventHandler(event: string, listener: (...args: any[]) => any): this
    -
    -  on(event: string, listener: (...args: any[]) => any): this
    -  on(event: 'data', listener: (chunk: RType) => any): this
    -  on(event: 'error', listener: (error: any) => any): this
    -  on(
    -    event:
    -      | 'readable'
    -      | 'drain'
    -      | 'resume'
    -      | 'end'
    -      | 'prefinish'
    -      | 'finish'
    -      | 'close',
    -    listener: () => any
    -  ): this
    -
    -  [Symbol.iterator](): Iterator
    -  [Symbol.asyncIterator](): AsyncIterator
    -}
    -
    -export = Minipass
    diff --git a/deps/npm/node_modules/node-gyp/node_modules/minipass/index.d.ts b/deps/npm/node_modules/node-gyp/node_modules/minipass/index.d.ts
    deleted file mode 100644
    index 65faf63686c213..00000000000000
    --- a/deps/npm/node_modules/node-gyp/node_modules/minipass/index.d.ts
    +++ /dev/null
    @@ -1,155 +0,0 @@
    -/// 
    -import { EventEmitter } from 'events'
    -import { Stream } from 'stream'
    -
    -declare namespace Minipass {
    -  type Encoding = BufferEncoding | 'buffer' | null
    -
    -  interface Writable extends EventEmitter {
    -    end(): any
    -    write(chunk: any, ...args: any[]): any
    -  }
    -
    -  interface Readable extends EventEmitter {
    -    pause(): any
    -    resume(): any
    -    pipe(): any
    -  }
    -
    -  interface Pipe {
    -    src: Minipass
    -    dest: Writable
    -    opts: PipeOptions
    -  }
    -
    -  type DualIterable = Iterable & AsyncIterable
    -
    -  type ContiguousData = Buffer | ArrayBufferLike | ArrayBufferView | string
    -
    -  type BufferOrString = Buffer | string
    -
    -  interface StringOptions {
    -    encoding: BufferEncoding
    -    objectMode?: boolean
    -    async?: boolean
    -  }
    -
    -  interface BufferOptions {
    -    encoding?: null | 'buffer'
    -    objectMode?: boolean
    -    async?: boolean
    -  }
    -
    -  interface ObjectModeOptions {
    -    objectMode: true
    -    async?: boolean
    -  }
    -
    -  interface PipeOptions {
    -    end?: boolean
    -    proxyErrors?: boolean
    -  }
    -
    -  type Options = T extends string
    -    ? StringOptions
    -    : T extends Buffer
    -    ? BufferOptions
    -    : ObjectModeOptions
    -}
    -
    -declare class Minipass<
    -    RType extends any = Buffer,
    -    WType extends any = RType extends Minipass.BufferOrString
    -      ? Minipass.ContiguousData
    -      : RType
    -  >
    -  extends Stream
    -  implements Minipass.DualIterable
    -{
    -  static isStream(stream: any): stream is Minipass.Readable | Minipass.Writable
    -
    -  readonly bufferLength: number
    -  readonly flowing: boolean
    -  readonly writable: boolean
    -  readonly readable: boolean
    -  readonly paused: boolean
    -  readonly emittedEnd: boolean
    -  readonly destroyed: boolean
    -
    -  /**
    -   * Not technically private or readonly, but not safe to mutate.
    -   */
    -  private readonly buffer: RType[]
    -  private readonly pipes: Minipass.Pipe[]
    -
    -  /**
    -   * Technically writable, but mutating it can change the type,
    -   * so is not safe to do in TypeScript.
    -   */
    -  readonly objectMode: boolean
    -  async: boolean
    -
    -  /**
    -   * Note: encoding is not actually read-only, and setEncoding(enc)
    -   * exists. However, this type definition will insist that TypeScript
    -   * programs declare the type of a Minipass stream up front, and if
    -   * that type is string, then an encoding MUST be set in the ctor. If
    -   * the type is Buffer, then the encoding must be missing, or set to
    -   * 'buffer' or null. If the type is anything else, then objectMode
    -   * must be set in the constructor options.  So there is effectively
    -   * no allowed way that a TS program can set the encoding after
    -   * construction, as doing so will destroy any hope of type safety.
    -   * TypeScript does not provide many options for changing the type of
    -   * an object at run-time, which is what changing the encoding does.
    -   */
    -  readonly encoding: Minipass.Encoding
    -  // setEncoding(encoding: Encoding): void
    -
    -  // Options required if not reading buffers
    -  constructor(
    -    ...args: RType extends Buffer
    -      ? [] | [Minipass.Options]
    -      : [Minipass.Options]
    -  )
    -
    -  write(chunk: WType, cb?: () => void): boolean
    -  write(chunk: WType, encoding?: Minipass.Encoding, cb?: () => void): boolean
    -  read(size?: number): RType
    -  end(cb?: () => void): this
    -  end(chunk: any, cb?: () => void): this
    -  end(chunk: any, encoding?: Minipass.Encoding, cb?: () => void): this
    -  pause(): void
    -  resume(): void
    -  promise(): Promise
    -  collect(): Promise
    -
    -  concat(): RType extends Minipass.BufferOrString ? Promise : never
    -  destroy(er?: any): void
    -  pipe(dest: W, opts?: Minipass.PipeOptions): W
    -  unpipe(dest: W): void
    -
    -  /**
    -   * alias for on()
    -   */
    -  addEventHandler(event: string, listener: (...args: any[]) => any): this
    -
    -  on(event: string, listener: (...args: any[]) => any): this
    -  on(event: 'data', listener: (chunk: RType) => any): this
    -  on(event: 'error', listener: (error: any) => any): this
    -  on(
    -    event:
    -      | 'readable'
    -      | 'drain'
    -      | 'resume'
    -      | 'end'
    -      | 'prefinish'
    -      | 'finish'
    -      | 'close',
    -    listener: () => any
    -  ): this
    -
    -  [Symbol.iterator](): Iterator
    -  [Symbol.asyncIterator](): AsyncIterator
    -}
    -
    -export = Minipass
    diff --git a/deps/npm/node_modules/node-gyp/node_modules/readable-stream/lib/_stream_duplex.js b/deps/npm/node_modules/node-gyp/node_modules/readable-stream/lib/_stream_duplex.js
    index 67525192250f6d..19abfa604d5ef7 100644
    --- a/deps/npm/node_modules/node-gyp/node_modules/readable-stream/lib/_stream_duplex.js
    +++ b/deps/npm/node_modules/node-gyp/node_modules/readable-stream/lib/_stream_duplex.js
    @@ -18,60 +18,48 @@
     // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
     // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
     // USE OR OTHER DEALINGS IN THE SOFTWARE.
    +
     // a duplex stream is just a stream that is both readable and writable.
     // Since JS doesn't have multiple prototypal inheritance, this class
     // prototypally inherits from Readable, and then parasitically from
     // Writable.
    +
     'use strict';
    -/**/
     
    +/**/
     var objectKeys = Object.keys || function (obj) {
       var keys = [];
    -
    -  for (var key in obj) {
    -    keys.push(key);
    -  }
    -
    +  for (var key in obj) keys.push(key);
       return keys;
     };
     /**/
     
    -
     module.exports = Duplex;
    -
     var Readable = require('./_stream_readable');
    -
     var Writable = require('./_stream_writable');
    -
     require('inherits')(Duplex, Readable);
    -
     {
       // Allow the keys array to be GC'ed.
       var keys = objectKeys(Writable.prototype);
    -
       for (var v = 0; v < keys.length; v++) {
         var method = keys[v];
         if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];
       }
     }
    -
     function Duplex(options) {
       if (!(this instanceof Duplex)) return new Duplex(options);
       Readable.call(this, options);
       Writable.call(this, options);
       this.allowHalfOpen = true;
    -
       if (options) {
         if (options.readable === false) this.readable = false;
         if (options.writable === false) this.writable = false;
    -
         if (options.allowHalfOpen === false) {
           this.allowHalfOpen = false;
           this.once('end', onend);
         }
       }
     }
    -
     Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', {
       // making it explicit this property is not enumerable
       // because otherwise some prototype manipulation in
    @@ -98,20 +86,20 @@ Object.defineProperty(Duplex.prototype, 'writableLength', {
       get: function get() {
         return this._writableState.length;
       }
    -}); // the no-half-open enforcer
    +});
     
    +// the no-half-open enforcer
     function onend() {
       // If the writable side ended, then we're ok.
    -  if (this._writableState.ended) return; // no more data can be written.
    -  // But allow more writes to happen in this tick.
    +  if (this._writableState.ended) return;
     
    +  // no more data can be written.
    +  // But allow more writes to happen in this tick.
       process.nextTick(onEndNT, this);
     }
    -
     function onEndNT(self) {
       self.end();
     }
    -
     Object.defineProperty(Duplex.prototype, 'destroyed', {
       // making it explicit this property is not enumerable
       // because otherwise some prototype manipulation in
    @@ -121,7 +109,6 @@ Object.defineProperty(Duplex.prototype, 'destroyed', {
         if (this._readableState === undefined || this._writableState === undefined) {
           return false;
         }
    -
         return this._readableState.destroyed && this._writableState.destroyed;
       },
       set: function set(value) {
    @@ -129,10 +116,10 @@ Object.defineProperty(Duplex.prototype, 'destroyed', {
         // has not been initialized yet
         if (this._readableState === undefined || this._writableState === undefined) {
           return;
    -    } // backward compatibility, the user is explicitly
    -    // managing destroyed
    -
    +    }
     
    +    // backward compatibility, the user is explicitly
    +    // managing destroyed
         this._readableState.destroyed = value;
         this._writableState.destroyed = value;
       }
    diff --git a/deps/npm/node_modules/node-gyp/node_modules/readable-stream/lib/_stream_passthrough.js b/deps/npm/node_modules/node-gyp/node_modules/readable-stream/lib/_stream_passthrough.js
    index 32e7414c5a8271..24a6bdde2903fa 100644
    --- a/deps/npm/node_modules/node-gyp/node_modules/readable-stream/lib/_stream_passthrough.js
    +++ b/deps/npm/node_modules/node-gyp/node_modules/readable-stream/lib/_stream_passthrough.js
    @@ -18,22 +18,20 @@
     // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
     // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
     // USE OR OTHER DEALINGS IN THE SOFTWARE.
    +
     // a passthrough stream.
     // basically just the most minimal sort of Transform stream.
     // Every written chunk gets output as-is.
    +
     'use strict';
     
     module.exports = PassThrough;
    -
     var Transform = require('./_stream_transform');
    -
     require('inherits')(PassThrough, Transform);
    -
     function PassThrough(options) {
       if (!(this instanceof PassThrough)) return new PassThrough(options);
       Transform.call(this, options);
     }
    -
     PassThrough.prototype._transform = function (chunk, encoding, cb) {
       cb(null, chunk);
     };
    \ No newline at end of file
    diff --git a/deps/npm/node_modules/node-gyp/node_modules/readable-stream/lib/_stream_readable.js b/deps/npm/node_modules/node-gyp/node_modules/readable-stream/lib/_stream_readable.js
    index 192d451488f208..df1f608d532606 100644
    --- a/deps/npm/node_modules/node-gyp/node_modules/readable-stream/lib/_stream_readable.js
    +++ b/deps/npm/node_modules/node-gyp/node_modules/readable-stream/lib/_stream_readable.js
    @@ -18,49 +18,40 @@
     // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
     // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
     // USE OR OTHER DEALINGS IN THE SOFTWARE.
    +
     'use strict';
     
     module.exports = Readable;
    -/**/
     
    +/**/
     var Duplex;
     /**/
     
     Readable.ReadableState = ReadableState;
    -/**/
     
    +/**/
     var EE = require('events').EventEmitter;
    -
     var EElistenerCount = function EElistenerCount(emitter, type) {
       return emitter.listeners(type).length;
     };
     /**/
     
     /**/
    -
    -
     var Stream = require('./internal/streams/stream');
     /**/
     
    -
     var Buffer = require('buffer').Buffer;
    -
    -var OurUint8Array = global.Uint8Array || function () {};
    -
    +var OurUint8Array = (typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : typeof self !== 'undefined' ? self : {}).Uint8Array || function () {};
     function _uint8ArrayToBuffer(chunk) {
       return Buffer.from(chunk);
     }
    -
     function _isUint8Array(obj) {
       return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
     }
    -/**/
    -
     
    +/**/
     var debugUtil = require('util');
    -
     var debug;
    -
     if (debugUtil && debugUtil.debuglog) {
       debug = debugUtil.debuglog('stream');
     } else {
    @@ -68,60 +59,57 @@ if (debugUtil && debugUtil.debuglog) {
     }
     /**/
     
    -
     var BufferList = require('./internal/streams/buffer_list');
    -
     var destroyImpl = require('./internal/streams/destroy');
    -
     var _require = require('./internal/streams/state'),
    -    getHighWaterMark = _require.getHighWaterMark;
    -
    +  getHighWaterMark = _require.getHighWaterMark;
     var _require$codes = require('../errors').codes,
    -    ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE,
    -    ERR_STREAM_PUSH_AFTER_EOF = _require$codes.ERR_STREAM_PUSH_AFTER_EOF,
    -    ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED,
    -    ERR_STREAM_UNSHIFT_AFTER_END_EVENT = _require$codes.ERR_STREAM_UNSHIFT_AFTER_END_EVENT; // Lazy loaded to improve the startup performance.
    -
    +  ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE,
    +  ERR_STREAM_PUSH_AFTER_EOF = _require$codes.ERR_STREAM_PUSH_AFTER_EOF,
    +  ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED,
    +  ERR_STREAM_UNSHIFT_AFTER_END_EVENT = _require$codes.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;
     
    +// Lazy loaded to improve the startup performance.
     var StringDecoder;
     var createReadableStreamAsyncIterator;
     var from;
    -
     require('inherits')(Readable, Stream);
    -
     var errorOrDestroy = destroyImpl.errorOrDestroy;
     var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume'];
    -
     function prependListener(emitter, event, fn) {
       // Sadly this is not cacheable as some libraries bundle their own
       // event emitter implementation with them.
    -  if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn); // This is a hack to make sure that our error handler is attached before any
    +  if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn);
    +
    +  // This is a hack to make sure that our error handler is attached before any
       // userland ones.  NEVER DO THIS. This is here only because this code needs
       // to continue to work with older versions of Node.js that do not include
       // the prependListener() method. The goal is to eventually remove this hack.
    -
       if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (Array.isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]];
     }
    -
     function ReadableState(options, stream, isDuplex) {
       Duplex = Duplex || require('./_stream_duplex');
    -  options = options || {}; // Duplex streams are both readable and writable, but share
    +  options = options || {};
    +
    +  // Duplex streams are both readable and writable, but share
       // the same options object.
       // However, some cases require setting options to different
       // values for the readable and the writable sides of the duplex stream.
       // These options can be provided separately as readableXXX and writableXXX.
    +  if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof Duplex;
     
    -  if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof Duplex; // object stream flag. Used to make read(n) ignore n and to
    +  // object stream flag. Used to make read(n) ignore n and to
       // make all the buffer merging and length checks go away
    -
       this.objectMode = !!options.objectMode;
    -  if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode; // the point at which it stops calling _read() to fill the buffer
    +  if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode;
    +
    +  // the point at which it stops calling _read() to fill the buffer
       // Note: 0 is a valid value, means "don't call _read preemptively ever"
    +  this.highWaterMark = getHighWaterMark(this, options, 'readableHighWaterMark', isDuplex);
     
    -  this.highWaterMark = getHighWaterMark(this, options, 'readableHighWaterMark', isDuplex); // A linked list is used to store data chunks instead of an array because the
    +  // A linked list is used to store data chunks instead of an array because the
       // linked list can remove elements from the beginning faster than
       // array.shift()
    -
       this.buffer = new BufferList();
       this.length = 0;
       this.pipes = null;
    @@ -129,61 +117,66 @@ function ReadableState(options, stream, isDuplex) {
       this.flowing = null;
       this.ended = false;
       this.endEmitted = false;
    -  this.reading = false; // a flag to be able to tell if the event 'readable'/'data' is emitted
    +  this.reading = false;
    +
    +  // a flag to be able to tell if the event 'readable'/'data' is emitted
       // immediately, or on a later tick.  We set this to true at first, because
       // any actions that shouldn't happen until "later" should generally also
       // not happen before the first read call.
    +  this.sync = true;
     
    -  this.sync = true; // whenever we return null, then we set a flag to say
    +  // whenever we return null, then we set a flag to say
       // that we're awaiting a 'readable' event emission.
    -
       this.needReadable = false;
       this.emittedReadable = false;
       this.readableListening = false;
       this.resumeScheduled = false;
    -  this.paused = true; // Should close be emitted on destroy. Defaults to true.
    +  this.paused = true;
     
    -  this.emitClose = options.emitClose !== false; // Should .destroy() be called after 'end' (and potentially 'finish')
    +  // Should close be emitted on destroy. Defaults to true.
    +  this.emitClose = options.emitClose !== false;
     
    -  this.autoDestroy = !!options.autoDestroy; // has it been destroyed
    +  // Should .destroy() be called after 'end' (and potentially 'finish')
    +  this.autoDestroy = !!options.autoDestroy;
     
    -  this.destroyed = false; // Crypto is kind of old and crusty.  Historically, its default string
    +  // has it been destroyed
    +  this.destroyed = false;
    +
    +  // Crypto is kind of old and crusty.  Historically, its default string
       // encoding is 'binary' so we have to make this configurable.
       // Everything else in the universe uses 'utf8', though.
    +  this.defaultEncoding = options.defaultEncoding || 'utf8';
     
    -  this.defaultEncoding = options.defaultEncoding || 'utf8'; // the number of writers that are awaiting a drain event in .pipe()s
    -
    -  this.awaitDrain = 0; // if true, a maybeReadMore has been scheduled
    +  // the number of writers that are awaiting a drain event in .pipe()s
    +  this.awaitDrain = 0;
     
    +  // if true, a maybeReadMore has been scheduled
       this.readingMore = false;
       this.decoder = null;
       this.encoding = null;
    -
       if (options.encoding) {
         if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder;
         this.decoder = new StringDecoder(options.encoding);
         this.encoding = options.encoding;
       }
     }
    -
     function Readable(options) {
       Duplex = Duplex || require('./_stream_duplex');
    -  if (!(this instanceof Readable)) return new Readable(options); // Checking for a Stream.Duplex instance is faster here instead of inside
    -  // the ReadableState constructor, at least with V8 6.5
    +  if (!(this instanceof Readable)) return new Readable(options);
     
    +  // Checking for a Stream.Duplex instance is faster here instead of inside
    +  // the ReadableState constructor, at least with V8 6.5
       var isDuplex = this instanceof Duplex;
    -  this._readableState = new ReadableState(options, this, isDuplex); // legacy
    +  this._readableState = new ReadableState(options, this, isDuplex);
     
    +  // legacy
       this.readable = true;
    -
       if (options) {
         if (typeof options.read === 'function') this._read = options.read;
         if (typeof options.destroy === 'function') this._destroy = options.destroy;
       }
    -
       Stream.call(this);
     }
    -
     Object.defineProperty(Readable.prototype, 'destroyed', {
       // making it explicit this property is not enumerable
       // because otherwise some prototype manipulation in
    @@ -193,7 +186,6 @@ Object.defineProperty(Readable.prototype, 'destroyed', {
         if (this._readableState === undefined) {
           return false;
         }
    -
         return this._readableState.destroyed;
       },
       set: function set(value) {
    @@ -201,69 +193,60 @@ Object.defineProperty(Readable.prototype, 'destroyed', {
         // has not been initialized yet
         if (!this._readableState) {
           return;
    -    } // backward compatibility, the user is explicitly
    -    // managing destroyed
    -
    +    }
     
    +    // backward compatibility, the user is explicitly
    +    // managing destroyed
         this._readableState.destroyed = value;
       }
     });
     Readable.prototype.destroy = destroyImpl.destroy;
     Readable.prototype._undestroy = destroyImpl.undestroy;
    -
     Readable.prototype._destroy = function (err, cb) {
       cb(err);
    -}; // Manually shove something into the read() buffer.
    +};
    +
    +// Manually shove something into the read() buffer.
     // This returns true if the highWaterMark has not been hit yet,
     // similar to how Writable.write() returns true if you should
     // write() some more.
    -
    -
     Readable.prototype.push = function (chunk, encoding) {
       var state = this._readableState;
       var skipChunkCheck;
    -
       if (!state.objectMode) {
         if (typeof chunk === 'string') {
           encoding = encoding || state.defaultEncoding;
    -
           if (encoding !== state.encoding) {
             chunk = Buffer.from(chunk, encoding);
             encoding = '';
           }
    -
           skipChunkCheck = true;
         }
       } else {
         skipChunkCheck = true;
       }
    -
       return readableAddChunk(this, chunk, encoding, false, skipChunkCheck);
    -}; // Unshift should *always* be something directly out of read()
    -
    +};
     
    +// Unshift should *always* be something directly out of read()
     Readable.prototype.unshift = function (chunk) {
       return readableAddChunk(this, chunk, null, true, false);
     };
    -
     function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {
       debug('readableAddChunk', chunk);
       var state = stream._readableState;
    -
       if (chunk === null) {
         state.reading = false;
         onEofChunk(stream, state);
       } else {
         var er;
         if (!skipChunkCheck) er = chunkInvalid(state, chunk);
    -
         if (er) {
           errorOrDestroy(stream, er);
         } else if (state.objectMode || chunk && chunk.length > 0) {
           if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) {
             chunk = _uint8ArrayToBuffer(chunk);
           }
    -
           if (addToFront) {
             if (state.endEmitted) errorOrDestroy(stream, new ERR_STREAM_UNSHIFT_AFTER_END_EVENT());else addChunk(stream, state, chunk, true);
           } else if (state.ended) {
    @@ -272,7 +255,6 @@ function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {
             return false;
           } else {
             state.reading = false;
    -
             if (state.decoder && !encoding) {
               chunk = state.decoder.write(chunk);
               if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state);
    @@ -284,14 +266,13 @@ function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {
           state.reading = false;
           maybeReadMore(stream, state);
         }
    -  } // We can push more data if we are below the highWaterMark.
    +  }
    +
    +  // We can push more data if we are below the highWaterMark.
       // Also, if we have no data yet, we can stand some more bytes.
       // This is to work around cases where hwm=0, such as the repl.
    -
    -
       return !state.ended && (state.length < state.highWaterMark || state.length === 0);
     }
    -
     function addChunk(stream, state, chunk, addToFront) {
       if (state.flowing && state.length === 0 && !state.sync) {
         state.awaitDrain = 0;
    @@ -302,50 +283,42 @@ function addChunk(stream, state, chunk, addToFront) {
         if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk);
         if (state.needReadable) emitReadable(stream);
       }
    -
       maybeReadMore(stream, state);
     }
    -
     function chunkInvalid(state, chunk) {
       var er;
    -
       if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {
         er = new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer', 'Uint8Array'], chunk);
       }
    -
       return er;
     }
    -
     Readable.prototype.isPaused = function () {
       return this._readableState.flowing === false;
    -}; // backwards compatibility.
    -
    +};
     
    +// backwards compatibility.
     Readable.prototype.setEncoding = function (enc) {
       if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder;
       var decoder = new StringDecoder(enc);
    -  this._readableState.decoder = decoder; // If setEncoding(null), decoder.encoding equals utf8
    -
    -  this._readableState.encoding = this._readableState.decoder.encoding; // Iterate over current buffer to convert already stored Buffers:
    +  this._readableState.decoder = decoder;
    +  // If setEncoding(null), decoder.encoding equals utf8
    +  this._readableState.encoding = this._readableState.decoder.encoding;
     
    +  // Iterate over current buffer to convert already stored Buffers:
       var p = this._readableState.buffer.head;
       var content = '';
    -
       while (p !== null) {
         content += decoder.write(p.data);
         p = p.next;
       }
    -
       this._readableState.buffer.clear();
    -
       if (content !== '') this._readableState.buffer.push(content);
       this._readableState.length = content.length;
       return this;
    -}; // Don't raise the hwm > 1GB
    -
    +};
     
    +// Don't raise the hwm > 1GB
     var MAX_HWM = 0x40000000;
    -
     function computeNewHighWaterMark(n) {
       if (n >= MAX_HWM) {
         // TODO(ronag): Throw ERR_VALUE_OUT_OF_RANGE.
    @@ -361,55 +334,54 @@ function computeNewHighWaterMark(n) {
         n |= n >>> 16;
         n++;
       }
    -
       return n;
    -} // This function is designed to be inlinable, so please take care when making
    -// changes to the function body.
    -
    +}
     
    +// This function is designed to be inlinable, so please take care when making
    +// changes to the function body.
     function howMuchToRead(n, state) {
       if (n <= 0 || state.length === 0 && state.ended) return 0;
       if (state.objectMode) return 1;
    -
       if (n !== n) {
         // Only flow one buffer at a time
         if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;
    -  } // If we're asking for more than the current hwm, then raise the hwm.
    -
    -
    +  }
    +  // If we're asking for more than the current hwm, then raise the hwm.
       if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);
    -  if (n <= state.length) return n; // Don't have enough
    -
    +  if (n <= state.length) return n;
    +  // Don't have enough
       if (!state.ended) {
         state.needReadable = true;
         return 0;
       }
    -
       return state.length;
    -} // you can override either this method, or the async _read(n) below.
    -
    +}
     
    +// you can override either this method, or the async _read(n) below.
     Readable.prototype.read = function (n) {
       debug('read', n);
       n = parseInt(n, 10);
       var state = this._readableState;
       var nOrig = n;
    -  if (n !== 0) state.emittedReadable = false; // if we're doing read(0) to trigger a readable event, but we
    +  if (n !== 0) state.emittedReadable = false;
    +
    +  // if we're doing read(0) to trigger a readable event, but we
       // already have a bunch of data in the buffer, then just trigger
       // the 'readable' event and move on.
    -
       if (n === 0 && state.needReadable && ((state.highWaterMark !== 0 ? state.length >= state.highWaterMark : state.length > 0) || state.ended)) {
         debug('read: emitReadable', state.length, state.ended);
         if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this);
         return null;
       }
    +  n = howMuchToRead(n, state);
     
    -  n = howMuchToRead(n, state); // if we've ended, and we're now clear, then finish it up.
    -
    +  // if we've ended, and we're now clear, then finish it up.
       if (n === 0 && state.ended) {
         if (state.length === 0) endReadable(this);
         return null;
    -  } // All the actual chunk generation logic needs to be
    +  }
    +
    +  // All the actual chunk generation logic needs to be
       // *below* the call to _read.  The reason is that in certain
       // synthetic stream cases, such as passthrough streams, _read
       // may be a completely synchronous operation which may change
    @@ -430,40 +402,37 @@ Readable.prototype.read = function (n) {
       // 'readable' etc.
       //
       // 3. Actually pull the requested chunks out of the buffer and return.
    -  // if we need a readable event, then we need to do some reading.
    -
     
    +  // if we need a readable event, then we need to do some reading.
       var doRead = state.needReadable;
    -  debug('need readable', doRead); // if we currently have less than the highWaterMark, then also read some
    +  debug('need readable', doRead);
     
    +  // if we currently have less than the highWaterMark, then also read some
       if (state.length === 0 || state.length - n < state.highWaterMark) {
         doRead = true;
         debug('length less than watermark', doRead);
    -  } // however, if we've ended, then there's no point, and if we're already
    -  // reading, then it's unnecessary.
    -
    +  }
     
    +  // however, if we've ended, then there's no point, and if we're already
    +  // reading, then it's unnecessary.
       if (state.ended || state.reading) {
         doRead = false;
         debug('reading or ended', doRead);
       } else if (doRead) {
         debug('do read');
         state.reading = true;
    -    state.sync = true; // if the length is currently zero, then we *need* a readable event.
    -
    -    if (state.length === 0) state.needReadable = true; // call internal read method
    -
    +    state.sync = true;
    +    // if the length is currently zero, then we *need* a readable event.
    +    if (state.length === 0) state.needReadable = true;
    +    // call internal read method
         this._read(state.highWaterMark);
    -
    -    state.sync = false; // If _read pushed data synchronously, then `reading` will be false,
    +    state.sync = false;
    +    // If _read pushed data synchronously, then `reading` will be false,
         // and we need to re-evaluate how much data we can return to the user.
    -
         if (!state.reading) n = howMuchToRead(nOrig, state);
       }
    -
       var ret;
       if (n > 0) ret = fromList(n, state);else ret = null;
    -
       if (ret === null) {
         state.needReadable = state.length <= state.highWaterMark;
         n = 0;
    @@ -471,34 +440,28 @@ Readable.prototype.read = function (n) {
         state.length -= n;
         state.awaitDrain = 0;
       }
    -
       if (state.length === 0) {
         // If we have nothing in the buffer, then we want to know
         // as soon as we *do* get something into the buffer.
    -    if (!state.ended) state.needReadable = true; // If we tried to read() past the EOF, then emit end on the next tick.
    +    if (!state.ended) state.needReadable = true;
     
    +    // If we tried to read() past the EOF, then emit end on the next tick.
         if (nOrig !== n && state.ended) endReadable(this);
       }
    -
       if (ret !== null) this.emit('data', ret);
       return ret;
     };
    -
     function onEofChunk(stream, state) {
       debug('onEofChunk');
       if (state.ended) return;
    -
       if (state.decoder) {
         var chunk = state.decoder.end();
    -
         if (chunk && chunk.length) {
           state.buffer.push(chunk);
           state.length += state.objectMode ? 1 : chunk.length;
         }
       }
    -
       state.ended = true;
    -
       if (state.sync) {
         // if we are sync, wait until next tick to emit the data.
         // Otherwise we risk emitting data in the flow()
    @@ -507,61 +470,56 @@ function onEofChunk(stream, state) {
       } else {
         // emit 'readable' now to make sure it gets picked up.
         state.needReadable = false;
    -
         if (!state.emittedReadable) {
           state.emittedReadable = true;
           emitReadable_(stream);
         }
       }
    -} // Don't emit readable right away in sync mode, because this can trigger
    +}
    +
    +// Don't emit readable right away in sync mode, because this can trigger
     // another read() call => stack overflow.  This way, it might trigger
     // a nextTick recursion warning, but that's not so bad.
    -
    -
     function emitReadable(stream) {
       var state = stream._readableState;
       debug('emitReadable', state.needReadable, state.emittedReadable);
       state.needReadable = false;
    -
       if (!state.emittedReadable) {
         debug('emitReadable', state.flowing);
         state.emittedReadable = true;
         process.nextTick(emitReadable_, stream);
       }
     }
    -
     function emitReadable_(stream) {
       var state = stream._readableState;
       debug('emitReadable_', state.destroyed, state.length, state.ended);
    -
       if (!state.destroyed && (state.length || state.ended)) {
         stream.emit('readable');
         state.emittedReadable = false;
    -  } // The stream needs another readable event if
    +  }
    +
    +  // The stream needs another readable event if
       // 1. It is not flowing, as the flow mechanism will take
       //    care of it.
       // 2. It is not ended.
       // 3. It is below the highWaterMark, so we can schedule
       //    another readable later.
    -
    -
       state.needReadable = !state.flowing && !state.ended && state.length <= state.highWaterMark;
       flow(stream);
    -} // at this point, the user has presumably seen the 'readable' event,
    +}
    +
    +// at this point, the user has presumably seen the 'readable' event,
     // and called read() to consume some data.  that may have triggered
     // in turn another _read(n) call, in which case reading = true if
     // it's in progress.
     // However, if we're not ended, or reading, and the length < hwm,
     // then go ahead and try to read some more preemptively.
    -
    -
     function maybeReadMore(stream, state) {
       if (!state.readingMore) {
         state.readingMore = true;
         process.nextTick(maybeReadMore_, stream, state);
       }
     }
    -
     function maybeReadMore_(stream, state) {
       // Attempt to read more data if we should.
       //
    @@ -590,49 +548,42 @@ function maybeReadMore_(stream, state) {
         var len = state.length;
         debug('maybeReadMore read 0');
         stream.read(0);
    -    if (len === state.length) // didn't get any data, stop spinning.
    +    if (len === state.length)
    +      // didn't get any data, stop spinning.
           break;
       }
    -
       state.readingMore = false;
    -} // abstract method.  to be overridden in specific implementation classes.
    +}
    +
    +// abstract method.  to be overridden in specific implementation classes.
     // call cb(er, data) where data is <= n in length.
     // for virtual (non-string, non-buffer) streams, "length" is somewhat
     // arbitrary, and perhaps not very meaningful.
    -
    -
     Readable.prototype._read = function (n) {
       errorOrDestroy(this, new ERR_METHOD_NOT_IMPLEMENTED('_read()'));
     };
    -
     Readable.prototype.pipe = function (dest, pipeOpts) {
       var src = this;
       var state = this._readableState;
    -
       switch (state.pipesCount) {
         case 0:
           state.pipes = dest;
           break;
    -
         case 1:
           state.pipes = [state.pipes, dest];
           break;
    -
         default:
           state.pipes.push(dest);
           break;
       }
    -
       state.pipesCount += 1;
       debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts);
       var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;
       var endFn = doEnd ? onend : unpipe;
       if (state.endEmitted) process.nextTick(endFn);else src.once('end', endFn);
       dest.on('unpipe', onunpipe);
    -
       function onunpipe(readable, unpipeInfo) {
         debug('onunpipe');
    -
         if (readable === src) {
           if (unpipeInfo && unpipeInfo.hasUnpiped === false) {
             unpipeInfo.hasUnpiped = true;
    @@ -640,23 +591,21 @@ Readable.prototype.pipe = function (dest, pipeOpts) {
           }
         }
       }
    -
       function onend() {
         debug('onend');
         dest.end();
    -  } // when the dest drains, it reduces the awaitDrain counter
    +  }
    +
    +  // when the dest drains, it reduces the awaitDrain counter
       // on the source.  This would be more elegant with a .once()
       // handler in flow(), but adding and removing repeatedly is
       // too slow.
    -
    -
       var ondrain = pipeOnDrain(src);
       dest.on('drain', ondrain);
       var cleanedUp = false;
    -
       function cleanup() {
    -    debug('cleanup'); // cleanup event handlers once the pipe is broken
    -
    +    debug('cleanup');
    +    // cleanup event handlers once the pipe is broken
         dest.removeListener('close', onclose);
         dest.removeListener('finish', onfinish);
         dest.removeListener('drain', ondrain);
    @@ -665,22 +614,20 @@ Readable.prototype.pipe = function (dest, pipeOpts) {
         src.removeListener('end', onend);
         src.removeListener('end', unpipe);
         src.removeListener('data', ondata);
    -    cleanedUp = true; // if the reader is waiting for a drain event from this
    +    cleanedUp = true;
    +
    +    // if the reader is waiting for a drain event from this
         // specific writer, then it would cause it to never start
         // flowing again.
         // So, if this is awaiting a drain, then we just call it now.
         // If we don't know, then assume that we are waiting for one.
    -
         if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();
       }
    -
       src.on('data', ondata);
    -
       function ondata(chunk) {
         debug('ondata');
         var ret = dest.write(chunk);
         debug('dest.write', ret);
    -
         if (ret === false) {
           // If the user unpiped during `dest.write()`, it is possible
           // to get stuck in a permanently paused state if that write
    @@ -690,87 +637,84 @@ Readable.prototype.pipe = function (dest, pipeOpts) {
             debug('false write response, pause', state.awaitDrain);
             state.awaitDrain++;
           }
    -
           src.pause();
         }
    -  } // if the dest has an error, then stop piping into it.
    -  // however, don't suppress the throwing behavior for this.
    -
    +  }
     
    +  // if the dest has an error, then stop piping into it.
    +  // however, don't suppress the throwing behavior for this.
       function onerror(er) {
         debug('onerror', er);
         unpipe();
         dest.removeListener('error', onerror);
         if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);
    -  } // Make sure our error handler is attached before userland ones.
    -
    +  }
     
    -  prependListener(dest, 'error', onerror); // Both close and finish should trigger unpipe, but only once.
    +  // Make sure our error handler is attached before userland ones.
    +  prependListener(dest, 'error', onerror);
     
    +  // Both close and finish should trigger unpipe, but only once.
       function onclose() {
         dest.removeListener('finish', onfinish);
         unpipe();
       }
    -
       dest.once('close', onclose);
    -
       function onfinish() {
         debug('onfinish');
         dest.removeListener('close', onclose);
         unpipe();
       }
    -
       dest.once('finish', onfinish);
    -
       function unpipe() {
         debug('unpipe');
         src.unpipe(dest);
    -  } // tell the dest that it's being piped to
    -
    +  }
     
    -  dest.emit('pipe', src); // start the flow if it hasn't been started already.
    +  // tell the dest that it's being piped to
    +  dest.emit('pipe', src);
     
    +  // start the flow if it hasn't been started already.
       if (!state.flowing) {
         debug('pipe resume');
         src.resume();
       }
    -
       return dest;
     };
    -
     function pipeOnDrain(src) {
       return function pipeOnDrainFunctionResult() {
         var state = src._readableState;
         debug('pipeOnDrain', state.awaitDrain);
         if (state.awaitDrain) state.awaitDrain--;
    -
         if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) {
           state.flowing = true;
           flow(src);
         }
       };
     }
    -
     Readable.prototype.unpipe = function (dest) {
       var state = this._readableState;
       var unpipeInfo = {
         hasUnpiped: false
    -  }; // if we're not piping anywhere, then do nothing.
    +  };
     
    -  if (state.pipesCount === 0) return this; // just one destination.  most common case.
    +  // if we're not piping anywhere, then do nothing.
    +  if (state.pipesCount === 0) return this;
     
    +  // just one destination.  most common case.
       if (state.pipesCount === 1) {
         // passed in one, but it's not the right one.
         if (dest && dest !== state.pipes) return this;
    -    if (!dest) dest = state.pipes; // got a match.
    +    if (!dest) dest = state.pipes;
     
    +    // got a match.
         state.pipes = null;
         state.pipesCount = 0;
         state.flowing = false;
         if (dest) dest.emit('unpipe', this, unpipeInfo);
         return this;
    -  } // slow case. multiple pipe destinations.
    +  }
     
    +  // slow case. multiple pipe destinations.
     
       if (!dest) {
         // remove all.
    @@ -779,17 +723,13 @@ Readable.prototype.unpipe = function (dest) {
         state.pipes = null;
         state.pipesCount = 0;
         state.flowing = false;
    -
    -    for (var i = 0; i < len; i++) {
    -      dests[i].emit('unpipe', this, {
    -        hasUnpiped: false
    -      });
    -    }
    -
    +    for (var i = 0; i < len; i++) dests[i].emit('unpipe', this, {
    +      hasUnpiped: false
    +    });
         return this;
    -  } // try to find the right one.
    -
    +  }
     
    +  // try to find the right one.
       var index = indexOf(state.pipes, dest);
       if (index === -1) return this;
       state.pipes.splice(index, 1);
    @@ -797,19 +737,19 @@ Readable.prototype.unpipe = function (dest) {
       if (state.pipesCount === 1) state.pipes = state.pipes[0];
       dest.emit('unpipe', this, unpipeInfo);
       return this;
    -}; // set up data events if they are asked for
    -// Ensure readable listeners eventually get something
    -
    +};
     
    +// set up data events if they are asked for
    +// Ensure readable listeners eventually get something
     Readable.prototype.on = function (ev, fn) {
       var res = Stream.prototype.on.call(this, ev, fn);
       var state = this._readableState;
    -
       if (ev === 'data') {
         // update readableListening so that resume() may be a no-op
         // a few lines down. This is needed to support once('readable').
    -    state.readableListening = this.listenerCount('readable') > 0; // Try start flowing on next tick if stream isn't explicitly paused
    +    state.readableListening = this.listenerCount('readable') > 0;
     
    +    // Try start flowing on next tick if stream isn't explicitly paused
         if (state.flowing !== false) this.resume();
       } else if (ev === 'readable') {
         if (!state.endEmitted && !state.readableListening) {
    @@ -817,7 +757,6 @@ Readable.prototype.on = function (ev, fn) {
           state.flowing = false;
           state.emittedReadable = false;
           debug('on readable', state.length, state.reading);
    -
           if (state.length) {
             emitReadable(this);
           } else if (!state.reading) {
    @@ -825,15 +764,11 @@ Readable.prototype.on = function (ev, fn) {
           }
         }
       }
    -
       return res;
     };
    -
     Readable.prototype.addListener = Readable.prototype.on;
    -
     Readable.prototype.removeListener = function (ev, fn) {
       var res = Stream.prototype.removeListener.call(this, ev, fn);
    -
       if (ev === 'readable') {
         // We need to check if there is someone still listening to
         // readable and reset the state. However this needs to happen
    @@ -843,13 +778,10 @@ Readable.prototype.removeListener = function (ev, fn) {
         // effect.
         process.nextTick(updateReadableListening, this);
       }
    -
       return res;
     };
    -
     Readable.prototype.removeAllListeners = function (ev) {
       var res = Stream.prototype.removeAllListeners.apply(this, arguments);
    -
       if (ev === 'readable' || ev === undefined) {
         // We need to check if there is someone still listening to
         // readable and reset the state. However this needs to happen
    @@ -859,121 +791,103 @@ Readable.prototype.removeAllListeners = function (ev) {
         // effect.
         process.nextTick(updateReadableListening, this);
       }
    -
       return res;
     };
    -
     function updateReadableListening(self) {
       var state = self._readableState;
       state.readableListening = self.listenerCount('readable') > 0;
    -
       if (state.resumeScheduled && !state.paused) {
         // flowing needs to be set to true now, otherwise
         // the upcoming resume will not flow.
    -    state.flowing = true; // crude way to check if we should resume
    +    state.flowing = true;
    +
    +    // crude way to check if we should resume
       } else if (self.listenerCount('data') > 0) {
         self.resume();
       }
     }
    -
     function nReadingNextTick(self) {
       debug('readable nexttick read 0');
       self.read(0);
    -} // pause() and resume() are remnants of the legacy readable stream API
    -// If the user uses them, then switch into old mode.
    -
    +}
     
    +// pause() and resume() are remnants of the legacy readable stream API
    +// If the user uses them, then switch into old mode.
     Readable.prototype.resume = function () {
       var state = this._readableState;
    -
       if (!state.flowing) {
    -    debug('resume'); // we flow only if there is no one listening
    +    debug('resume');
    +    // we flow only if there is no one listening
         // for readable, but we still have to call
         // resume()
    -
         state.flowing = !state.readableListening;
         resume(this, state);
       }
    -
       state.paused = false;
       return this;
     };
    -
     function resume(stream, state) {
       if (!state.resumeScheduled) {
         state.resumeScheduled = true;
         process.nextTick(resume_, stream, state);
       }
     }
    -
     function resume_(stream, state) {
       debug('resume', state.reading);
    -
       if (!state.reading) {
         stream.read(0);
       }
    -
       state.resumeScheduled = false;
       stream.emit('resume');
       flow(stream);
       if (state.flowing && !state.reading) stream.read(0);
     }
    -
     Readable.prototype.pause = function () {
       debug('call pause flowing=%j', this._readableState.flowing);
    -
       if (this._readableState.flowing !== false) {
         debug('pause');
         this._readableState.flowing = false;
         this.emit('pause');
       }
    -
       this._readableState.paused = true;
       return this;
     };
    -
     function flow(stream) {
       var state = stream._readableState;
       debug('flow', state.flowing);
    +  while (state.flowing && stream.read() !== null);
    +}
     
    -  while (state.flowing && stream.read() !== null) {
    -    ;
    -  }
    -} // wrap an old-style stream as the async data source.
    +// wrap an old-style stream as the async data source.
     // This is *not* part of the readable stream interface.
     // It is an ugly unfortunate mess of history.
    -
    -
     Readable.prototype.wrap = function (stream) {
       var _this = this;
    -
       var state = this._readableState;
       var paused = false;
       stream.on('end', function () {
         debug('wrapped end');
    -
         if (state.decoder && !state.ended) {
           var chunk = state.decoder.end();
           if (chunk && chunk.length) _this.push(chunk);
         }
    -
         _this.push(null);
       });
       stream.on('data', function (chunk) {
         debug('wrapped data');
    -    if (state.decoder) chunk = state.decoder.write(chunk); // don't skip over falsy values in objectMode
    +    if (state.decoder) chunk = state.decoder.write(chunk);
     
    +    // don't skip over falsy values in objectMode
         if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return;
    -
         var ret = _this.push(chunk);
    -
         if (!ret) {
           paused = true;
           stream.pause();
         }
    -  }); // proxy all the other methods.
    -  // important when wrapping filters and duplexes.
    +  });
     
    +  // proxy all the other methods.
    +  // important when wrapping filters and duplexes.
       for (var i in stream) {
         if (this[i] === undefined && typeof stream[i] === 'function') {
           this[i] = function methodWrap(method) {
    @@ -982,37 +896,32 @@ Readable.prototype.wrap = function (stream) {
             };
           }(i);
         }
    -  } // proxy certain important events.
    -
    +  }
     
    +  // proxy certain important events.
       for (var n = 0; n < kProxyEvents.length; n++) {
         stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n]));
    -  } // when we try to consume some more bytes, simply unpause the
    -  // underlying stream.
    -
    +  }
     
    +  // when we try to consume some more bytes, simply unpause the
    +  // underlying stream.
       this._read = function (n) {
         debug('wrapped _read', n);
    -
         if (paused) {
           paused = false;
           stream.resume();
         }
       };
    -
       return this;
     };
    -
     if (typeof Symbol === 'function') {
       Readable.prototype[Symbol.asyncIterator] = function () {
         if (createReadableStreamAsyncIterator === undefined) {
           createReadableStreamAsyncIterator = require('./internal/streams/async_iterator');
         }
    -
         return createReadableStreamAsyncIterator(this);
       };
     }
    -
     Object.defineProperty(Readable.prototype, 'readableHighWaterMark', {
       // making it explicit this property is not enumerable
       // because otherwise some prototype manipulation in
    @@ -1044,8 +953,9 @@ Object.defineProperty(Readable.prototype, 'readableFlowing', {
           this._readableState.flowing = state;
         }
       }
    -}); // exposed for testing purposes only.
    +});
     
    +// exposed for testing purposes only.
     Readable._fromList = fromList;
     Object.defineProperty(Readable.prototype, 'readableLength', {
       // making it explicit this property is not enumerable
    @@ -1055,11 +965,12 @@ Object.defineProperty(Readable.prototype, 'readableLength', {
       get: function get() {
         return this._readableState.length;
       }
    -}); // Pluck off n bytes from an array of buffers.
    +});
    +
    +// Pluck off n bytes from an array of buffers.
     // Length is the combined lengths of all the buffers in the list.
     // This function is designed to be inlinable, so please take care when making
     // changes to the function body.
    -
     function fromList(n, state) {
       // nothing buffered
       if (state.length === 0) return null;
    @@ -1074,51 +985,43 @@ function fromList(n, state) {
       }
       return ret;
     }
    -
     function endReadable(stream) {
       var state = stream._readableState;
       debug('endReadable', state.endEmitted);
    -
       if (!state.endEmitted) {
         state.ended = true;
         process.nextTick(endReadableNT, state, stream);
       }
     }
    -
     function endReadableNT(state, stream) {
    -  debug('endReadableNT', state.endEmitted, state.length); // Check that we didn't get one last unshift.
    +  debug('endReadableNT', state.endEmitted, state.length);
     
    +  // Check that we didn't get one last unshift.
       if (!state.endEmitted && state.length === 0) {
         state.endEmitted = true;
         stream.readable = false;
         stream.emit('end');
    -
         if (state.autoDestroy) {
           // In case of duplex streams we need a way to detect
           // if the writable side is ready for autoDestroy as well
           var wState = stream._writableState;
    -
           if (!wState || wState.autoDestroy && wState.finished) {
             stream.destroy();
           }
         }
       }
     }
    -
     if (typeof Symbol === 'function') {
       Readable.from = function (iterable, opts) {
         if (from === undefined) {
           from = require('./internal/streams/from');
         }
    -
         return from(Readable, iterable, opts);
       };
     }
    -
     function indexOf(xs, x) {
       for (var i = 0, l = xs.length; i < l; i++) {
         if (xs[i] === x) return i;
       }
    -
       return -1;
     }
    \ No newline at end of file
    diff --git a/deps/npm/node_modules/node-gyp/node_modules/readable-stream/lib/_stream_transform.js b/deps/npm/node_modules/node-gyp/node_modules/readable-stream/lib/_stream_transform.js
    index 41a738c4e93599..1ccb7157be8b8c 100644
    --- a/deps/npm/node_modules/node-gyp/node_modules/readable-stream/lib/_stream_transform.js
    +++ b/deps/npm/node_modules/node-gyp/node_modules/readable-stream/lib/_stream_transform.js
    @@ -18,6 +18,7 @@
     // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
     // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
     // USE OR OTHER DEALINGS IN THE SOFTWARE.
    +
     // a transform stream is a readable/writable stream where you do
     // something with the data.  Sometimes it's called a "filter",
     // but that's not a great name for it, since that implies a thing where
    @@ -59,42 +60,36 @@
     // However, even in such a pathological case, only a single written chunk
     // would be consumed, and then the rest would wait (un-transformed) until
     // the results of the previous transformed chunk were consumed.
    +
     'use strict';
     
     module.exports = Transform;
    -
     var _require$codes = require('../errors').codes,
    -    ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED,
    -    ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK,
    -    ERR_TRANSFORM_ALREADY_TRANSFORMING = _require$codes.ERR_TRANSFORM_ALREADY_TRANSFORMING,
    -    ERR_TRANSFORM_WITH_LENGTH_0 = _require$codes.ERR_TRANSFORM_WITH_LENGTH_0;
    -
    +  ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED,
    +  ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK,
    +  ERR_TRANSFORM_ALREADY_TRANSFORMING = _require$codes.ERR_TRANSFORM_ALREADY_TRANSFORMING,
    +  ERR_TRANSFORM_WITH_LENGTH_0 = _require$codes.ERR_TRANSFORM_WITH_LENGTH_0;
     var Duplex = require('./_stream_duplex');
    -
     require('inherits')(Transform, Duplex);
    -
     function afterTransform(er, data) {
       var ts = this._transformState;
       ts.transforming = false;
       var cb = ts.writecb;
    -
       if (cb === null) {
         return this.emit('error', new ERR_MULTIPLE_CALLBACK());
       }
    -
       ts.writechunk = null;
       ts.writecb = null;
    -  if (data != null) // single equals check for both `null` and `undefined`
    +  if (data != null)
    +    // single equals check for both `null` and `undefined`
         this.push(data);
       cb(er);
       var rs = this._readableState;
       rs.reading = false;
    -
       if (rs.needReadable || rs.length < rs.highWaterMark) {
         this._read(rs.highWaterMark);
       }
     }
    -
     function Transform(options) {
       if (!(this instanceof Transform)) return new Transform(options);
       Duplex.call(this, options);
    @@ -105,26 +100,25 @@ function Transform(options) {
         writecb: null,
         writechunk: null,
         writeencoding: null
    -  }; // start out asking for a readable event once data is transformed.
    +  };
    +
    +  // start out asking for a readable event once data is transformed.
    +  this._readableState.needReadable = true;
     
    -  this._readableState.needReadable = true; // we have implemented the _read method, and done the other things
    +  // we have implemented the _read method, and done the other things
       // that Readable wants before the first _read call, so unset the
       // sync guard flag.
    -
       this._readableState.sync = false;
    -
       if (options) {
         if (typeof options.transform === 'function') this._transform = options.transform;
         if (typeof options.flush === 'function') this._flush = options.flush;
    -  } // When the writable side finishes, then flush out anything remaining.
    -
    +  }
     
    +  // When the writable side finishes, then flush out anything remaining.
       this.on('prefinish', prefinish);
     }
    -
     function prefinish() {
       var _this = this;
    -
       if (typeof this._flush === 'function' && !this._readableState.destroyed) {
         this._flush(function (er, data) {
           done(_this, er, data);
    @@ -133,11 +127,12 @@ function prefinish() {
         done(this, null, null);
       }
     }
    -
     Transform.prototype.push = function (chunk, encoding) {
       this._transformState.needTransform = false;
       return Duplex.prototype.push.call(this, chunk, encoding);
    -}; // This is the part where you do stuff!
    +};
    +
    +// This is the part where you do stuff!
     // override this function in implementation classes.
     // 'chunk' is an input chunk.
     //
    @@ -147,33 +142,27 @@ Transform.prototype.push = function (chunk, encoding) {
     // Call `cb(err)` when you are done with this chunk.  If you pass
     // an error, then that'll put the hurt on the whole operation.  If you
     // never call cb(), then you'll never get another chunk.
    -
    -
     Transform.prototype._transform = function (chunk, encoding, cb) {
       cb(new ERR_METHOD_NOT_IMPLEMENTED('_transform()'));
     };
    -
     Transform.prototype._write = function (chunk, encoding, cb) {
       var ts = this._transformState;
       ts.writecb = cb;
       ts.writechunk = chunk;
       ts.writeencoding = encoding;
    -
       if (!ts.transforming) {
         var rs = this._readableState;
         if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);
       }
    -}; // Doesn't matter what the args are here.
    +};
    +
    +// Doesn't matter what the args are here.
     // _transform does all the work.
     // That we got here means that the readable side wants more data.
    -
    -
     Transform.prototype._read = function (n) {
       var ts = this._transformState;
    -
       if (ts.writechunk !== null && !ts.transforming) {
         ts.transforming = true;
    -
         this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);
       } else {
         // mark that we need a transform, so that any data that comes in
    @@ -181,20 +170,20 @@ Transform.prototype._read = function (n) {
         ts.needTransform = true;
       }
     };
    -
     Transform.prototype._destroy = function (err, cb) {
       Duplex.prototype._destroy.call(this, err, function (err2) {
         cb(err2);
       });
     };
    -
     function done(stream, er, data) {
       if (er) return stream.emit('error', er);
    -  if (data != null) // single equals check for both `null` and `undefined`
    -    stream.push(data); // TODO(BridgeAR): Write a test for these two error cases
    +  if (data != null)
    +    // single equals check for both `null` and `undefined`
    +    stream.push(data);
    +
    +  // TODO(BridgeAR): Write a test for these two error cases
       // if there's nothing in the write buffer, then that means
       // that nothing more will ever be provided
    -
       if (stream._writableState.length) throw new ERR_TRANSFORM_WITH_LENGTH_0();
       if (stream._transformState.transforming) throw new ERR_TRANSFORM_ALREADY_TRANSFORMING();
       return stream.push(null);
    diff --git a/deps/npm/node_modules/node-gyp/node_modules/readable-stream/lib/_stream_writable.js b/deps/npm/node_modules/node-gyp/node_modules/readable-stream/lib/_stream_writable.js
    index a2634d7c24fd5e..292415e23a192b 100644
    --- a/deps/npm/node_modules/node-gyp/node_modules/readable-stream/lib/_stream_writable.js
    +++ b/deps/npm/node_modules/node-gyp/node_modules/readable-stream/lib/_stream_writable.js
    @@ -18,29 +18,29 @@
     // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
     // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
     // USE OR OTHER DEALINGS IN THE SOFTWARE.
    +
     // A bit simpler than readable streams.
     // Implement an async ._write(chunk, encoding, cb), and it'll handle all
     // the drain event emission and buffering.
    +
     'use strict';
     
     module.exports = Writable;
    -/*  */
     
    +/*  */
     function WriteReq(chunk, encoding, cb) {
       this.chunk = chunk;
       this.encoding = encoding;
       this.callback = cb;
       this.next = null;
    -} // It seems a linked list but it is not
    -// there will be only 2 of these for each stream
    -
    +}
     
    +// It seems a linked list but it is not
    +// there will be only 2 of these for each stream
     function CorkedRequest(state) {
       var _this = this;
    -
       this.next = null;
       this.entry = null;
    -
       this.finish = function () {
         onCorkedFinish(_this, state);
       };
    @@ -48,155 +48,159 @@ function CorkedRequest(state) {
     /*  */
     
     /**/
    -
    -
     var Duplex;
     /**/
     
     Writable.WritableState = WritableState;
    -/**/
     
    +/**/
     var internalUtil = {
       deprecate: require('util-deprecate')
     };
     /**/
     
     /**/
    -
     var Stream = require('./internal/streams/stream');
     /**/
     
    -
     var Buffer = require('buffer').Buffer;
    -
    -var OurUint8Array = global.Uint8Array || function () {};
    -
    +var OurUint8Array = (typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : typeof self !== 'undefined' ? self : {}).Uint8Array || function () {};
     function _uint8ArrayToBuffer(chunk) {
       return Buffer.from(chunk);
     }
    -
     function _isUint8Array(obj) {
       return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
     }
    -
     var destroyImpl = require('./internal/streams/destroy');
    -
     var _require = require('./internal/streams/state'),
    -    getHighWaterMark = _require.getHighWaterMark;
    -
    +  getHighWaterMark = _require.getHighWaterMark;
     var _require$codes = require('../errors').codes,
    -    ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE,
    -    ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED,
    -    ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK,
    -    ERR_STREAM_CANNOT_PIPE = _require$codes.ERR_STREAM_CANNOT_PIPE,
    -    ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED,
    -    ERR_STREAM_NULL_VALUES = _require$codes.ERR_STREAM_NULL_VALUES,
    -    ERR_STREAM_WRITE_AFTER_END = _require$codes.ERR_STREAM_WRITE_AFTER_END,
    -    ERR_UNKNOWN_ENCODING = _require$codes.ERR_UNKNOWN_ENCODING;
    -
    +  ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE,
    +  ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED,
    +  ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK,
    +  ERR_STREAM_CANNOT_PIPE = _require$codes.ERR_STREAM_CANNOT_PIPE,
    +  ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED,
    +  ERR_STREAM_NULL_VALUES = _require$codes.ERR_STREAM_NULL_VALUES,
    +  ERR_STREAM_WRITE_AFTER_END = _require$codes.ERR_STREAM_WRITE_AFTER_END,
    +  ERR_UNKNOWN_ENCODING = _require$codes.ERR_UNKNOWN_ENCODING;
     var errorOrDestroy = destroyImpl.errorOrDestroy;
    -
     require('inherits')(Writable, Stream);
    -
     function nop() {}
    -
     function WritableState(options, stream, isDuplex) {
       Duplex = Duplex || require('./_stream_duplex');
    -  options = options || {}; // Duplex streams are both readable and writable, but share
    +  options = options || {};
    +
    +  // Duplex streams are both readable and writable, but share
       // the same options object.
       // However, some cases require setting options to different
       // values for the readable and the writable sides of the duplex stream,
       // e.g. options.readableObjectMode vs. options.writableObjectMode, etc.
    +  if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof Duplex;
     
    -  if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof Duplex; // object stream flag to indicate whether or not this stream
    +  // object stream flag to indicate whether or not this stream
       // contains buffers or objects.
    -
       this.objectMode = !!options.objectMode;
    -  if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode; // the point at which write() starts returning false
    +  if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode;
    +
    +  // the point at which write() starts returning false
       // Note: 0 is a valid value, means that we always return false if
       // the entire buffer is not flushed immediately on write()
    +  this.highWaterMark = getHighWaterMark(this, options, 'writableHighWaterMark', isDuplex);
     
    -  this.highWaterMark = getHighWaterMark(this, options, 'writableHighWaterMark', isDuplex); // if _final has been called
    +  // if _final has been called
    +  this.finalCalled = false;
     
    -  this.finalCalled = false; // drain event flag.
    +  // drain event flag.
    +  this.needDrain = false;
    +  // at the start of calling end()
    +  this.ending = false;
    +  // when end() has been called, and returned
    +  this.ended = false;
    +  // when 'finish' is emitted
    +  this.finished = false;
     
    -  this.needDrain = false; // at the start of calling end()
    +  // has it been destroyed
    +  this.destroyed = false;
     
    -  this.ending = false; // when end() has been called, and returned
    -
    -  this.ended = false; // when 'finish' is emitted
    -
    -  this.finished = false; // has it been destroyed
    -
    -  this.destroyed = false; // should we decode strings into buffers before passing to _write?
    +  // should we decode strings into buffers before passing to _write?
       // this is here so that some node-core streams can optimize string
       // handling at a lower level.
    -
       var noDecode = options.decodeStrings === false;
    -  this.decodeStrings = !noDecode; // Crypto is kind of old and crusty.  Historically, its default string
    +  this.decodeStrings = !noDecode;
    +
    +  // Crypto is kind of old and crusty.  Historically, its default string
       // encoding is 'binary' so we have to make this configurable.
       // Everything else in the universe uses 'utf8', though.
    +  this.defaultEncoding = options.defaultEncoding || 'utf8';
     
    -  this.defaultEncoding = options.defaultEncoding || 'utf8'; // not an actual buffer we keep track of, but a measurement
    +  // not an actual buffer we keep track of, but a measurement
       // of how much we're waiting to get pushed to some underlying
       // socket or file.
    +  this.length = 0;
     
    -  this.length = 0; // a flag to see when we're in the middle of a write.
    +  // a flag to see when we're in the middle of a write.
    +  this.writing = false;
     
    -  this.writing = false; // when true all writes will be buffered until .uncork() call
    +  // when true all writes will be buffered until .uncork() call
    +  this.corked = 0;
     
    -  this.corked = 0; // a flag to be able to tell if the onwrite cb is called immediately,
    +  // a flag to be able to tell if the onwrite cb is called immediately,
       // or on a later tick.  We set this to true at first, because any
       // actions that shouldn't happen until "later" should generally also
       // not happen before the first write call.
    +  this.sync = true;
     
    -  this.sync = true; // a flag to know if we're processing previously buffered items, which
    +  // a flag to know if we're processing previously buffered items, which
       // may call the _write() callback in the same tick, so that we don't
       // end up in an overlapped onwrite situation.
    +  this.bufferProcessing = false;
     
    -  this.bufferProcessing = false; // the callback that's passed to _write(chunk,cb)
    -
    +  // the callback that's passed to _write(chunk,cb)
       this.onwrite = function (er) {
         onwrite(stream, er);
    -  }; // the callback that the user supplies to write(chunk,encoding,cb)
    -
    +  };
     
    -  this.writecb = null; // the amount that is being written when _write is called.
    +  // the callback that the user supplies to write(chunk,encoding,cb)
    +  this.writecb = null;
     
    +  // the amount that is being written when _write is called.
       this.writelen = 0;
       this.bufferedRequest = null;
    -  this.lastBufferedRequest = null; // number of pending user-supplied write callbacks
    +  this.lastBufferedRequest = null;
    +
    +  // number of pending user-supplied write callbacks
       // this must be 0 before 'finish' can be emitted
    +  this.pendingcb = 0;
     
    -  this.pendingcb = 0; // emit prefinish if the only thing we're waiting for is _write cbs
    +  // emit prefinish if the only thing we're waiting for is _write cbs
       // This is relevant for synchronous Transform streams
    +  this.prefinished = false;
     
    -  this.prefinished = false; // True if the error was already emitted and should not be thrown again
    +  // True if the error was already emitted and should not be thrown again
    +  this.errorEmitted = false;
     
    -  this.errorEmitted = false; // Should close be emitted on destroy. Defaults to true.
    +  // Should close be emitted on destroy. Defaults to true.
    +  this.emitClose = options.emitClose !== false;
     
    -  this.emitClose = options.emitClose !== false; // Should .destroy() be called after 'finish' (and potentially 'end')
    +  // Should .destroy() be called after 'finish' (and potentially 'end')
    +  this.autoDestroy = !!options.autoDestroy;
     
    -  this.autoDestroy = !!options.autoDestroy; // count buffered requests
    +  // count buffered requests
    +  this.bufferedRequestCount = 0;
     
    -  this.bufferedRequestCount = 0; // allocate the first CorkedRequest, there is always
    +  // allocate the first CorkedRequest, there is always
       // one allocated and free to use, and we maintain at most two
    -
       this.corkedRequestsFree = new CorkedRequest(this);
     }
    -
     WritableState.prototype.getBuffer = function getBuffer() {
       var current = this.bufferedRequest;
       var out = [];
    -
       while (current) {
         out.push(current);
         current = current.next;
       }
    -
       return out;
     };
    -
     (function () {
       try {
         Object.defineProperty(WritableState.prototype, 'buffer', {
    @@ -205,12 +209,11 @@ WritableState.prototype.getBuffer = function getBuffer() {
           }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003')
         });
       } catch (_) {}
    -})(); // Test _writableState for inheritance to account for Duplex streams,
    -// whose prototype chain only points to Readable.
    -
    +})();
     
    +// Test _writableState for inheritance to account for Duplex streams,
    +// whose prototype chain only points to Readable.
     var realHasInstance;
    -
     if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') {
       realHasInstance = Function.prototype[Symbol.hasInstance];
       Object.defineProperty(Writable, Symbol.hasInstance, {
    @@ -225,81 +228,73 @@ if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.protot
         return object instanceof this;
       };
     }
    -
     function Writable(options) {
    -  Duplex = Duplex || require('./_stream_duplex'); // Writable ctor is applied to Duplexes, too.
    +  Duplex = Duplex || require('./_stream_duplex');
    +
    +  // Writable ctor is applied to Duplexes, too.
       // `realHasInstance` is necessary because using plain `instanceof`
       // would return false, as no `_writableState` property is attached.
    +
       // Trying to use the custom `instanceof` for Writable here will also break the
       // Node.js LazyTransform implementation, which has a non-trivial getter for
       // `_writableState` that would lead to infinite recursion.
    +
       // Checking for a Stream.Duplex instance is faster here instead of inside
       // the WritableState constructor, at least with V8 6.5
    -
       var isDuplex = this instanceof Duplex;
       if (!isDuplex && !realHasInstance.call(Writable, this)) return new Writable(options);
    -  this._writableState = new WritableState(options, this, isDuplex); // legacy.
    +  this._writableState = new WritableState(options, this, isDuplex);
     
    +  // legacy.
       this.writable = true;
    -
       if (options) {
         if (typeof options.write === 'function') this._write = options.write;
         if (typeof options.writev === 'function') this._writev = options.writev;
         if (typeof options.destroy === 'function') this._destroy = options.destroy;
         if (typeof options.final === 'function') this._final = options.final;
       }
    -
       Stream.call(this);
    -} // Otherwise people can pipe Writable streams, which is just wrong.
    -
    +}
     
    +// Otherwise people can pipe Writable streams, which is just wrong.
     Writable.prototype.pipe = function () {
       errorOrDestroy(this, new ERR_STREAM_CANNOT_PIPE());
     };
    -
     function writeAfterEnd(stream, cb) {
    -  var er = new ERR_STREAM_WRITE_AFTER_END(); // TODO: defer error events consistently everywhere, not just the cb
    -
    +  var er = new ERR_STREAM_WRITE_AFTER_END();
    +  // TODO: defer error events consistently everywhere, not just the cb
       errorOrDestroy(stream, er);
       process.nextTick(cb, er);
    -} // Checks that a user-supplied chunk is valid, especially for the particular
    +}
    +
    +// Checks that a user-supplied chunk is valid, especially for the particular
     // mode the stream is in. Currently this means that `null` is never accepted
     // and undefined/non-string values are only allowed in object mode.
    -
    -
     function validChunk(stream, state, chunk, cb) {
       var er;
    -
       if (chunk === null) {
         er = new ERR_STREAM_NULL_VALUES();
       } else if (typeof chunk !== 'string' && !state.objectMode) {
         er = new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer'], chunk);
       }
    -
       if (er) {
         errorOrDestroy(stream, er);
         process.nextTick(cb, er);
         return false;
       }
    -
       return true;
     }
    -
     Writable.prototype.write = function (chunk, encoding, cb) {
       var state = this._writableState;
       var ret = false;
    -
       var isBuf = !state.objectMode && _isUint8Array(chunk);
    -
       if (isBuf && !Buffer.isBuffer(chunk)) {
         chunk = _uint8ArrayToBuffer(chunk);
       }
    -
       if (typeof encoding === 'function') {
         cb = encoding;
         encoding = null;
       }
    -
       if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding;
       if (typeof cb !== 'function') cb = nop;
       if (state.ending) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) {
    @@ -308,20 +303,16 @@ Writable.prototype.write = function (chunk, encoding, cb) {
       }
       return ret;
     };
    -
     Writable.prototype.cork = function () {
       this._writableState.corked++;
     };
    -
     Writable.prototype.uncork = function () {
       var state = this._writableState;
    -
       if (state.corked) {
         state.corked--;
         if (!state.writing && !state.corked && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state);
       }
     };
    -
     Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {
       // node::ParseEncoding() requires lower case.
       if (typeof encoding === 'string') encoding = encoding.toLowerCase();
    @@ -329,7 +320,6 @@ Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {
       this._writableState.defaultEncoding = encoding;
       return this;
     };
    -
     Object.defineProperty(Writable.prototype, 'writableBuffer', {
       // making it explicit this property is not enumerable
       // because otherwise some prototype manipulation in
    @@ -339,15 +329,12 @@ Object.defineProperty(Writable.prototype, 'writableBuffer', {
         return this._writableState && this._writableState.getBuffer();
       }
     });
    -
     function decodeChunk(state, chunk, encoding) {
       if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') {
         chunk = Buffer.from(chunk, encoding);
       }
    -
       return chunk;
     }
    -
     Object.defineProperty(Writable.prototype, 'writableHighWaterMark', {
       // making it explicit this property is not enumerable
       // because otherwise some prototype manipulation in
    @@ -356,27 +343,25 @@ Object.defineProperty(Writable.prototype, 'writableHighWaterMark', {
       get: function get() {
         return this._writableState.highWaterMark;
       }
    -}); // if we're already writing something, then just put this
    +});
    +
    +// if we're already writing something, then just put this
     // in the queue, and wait our turn.  Otherwise, call _write
     // If we return false, then we need a drain event, so set that flag.
    -
     function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {
       if (!isBuf) {
         var newChunk = decodeChunk(state, chunk, encoding);
    -
         if (chunk !== newChunk) {
           isBuf = true;
           encoding = 'buffer';
           chunk = newChunk;
         }
       }
    -
       var len = state.objectMode ? 1 : chunk.length;
       state.length += len;
    -  var ret = state.length < state.highWaterMark; // we must ensure that previous needDrain will not be reset to false.
    -
    +  var ret = state.length < state.highWaterMark;
    +  // we must ensure that previous needDrain will not be reset to false.
       if (!ret) state.needDrain = true;
    -
       if (state.writing || state.corked) {
         var last = state.lastBufferedRequest;
         state.lastBufferedRequest = {
    @@ -386,21 +371,17 @@ function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {
           callback: cb,
           next: null
         };
    -
         if (last) {
           last.next = state.lastBufferedRequest;
         } else {
           state.bufferedRequest = state.lastBufferedRequest;
         }
    -
         state.bufferedRequestCount += 1;
       } else {
         doWrite(stream, state, false, len, chunk, encoding, cb);
       }
    -
       return ret;
     }
    -
     function doWrite(stream, state, writev, len, chunk, encoding, cb) {
       state.writelen = len;
       state.writecb = cb;
    @@ -409,16 +390,14 @@ function doWrite(stream, state, writev, len, chunk, encoding, cb) {
       if (state.destroyed) state.onwrite(new ERR_STREAM_DESTROYED('write'));else if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite);
       state.sync = false;
     }
    -
     function onwriteError(stream, state, sync, er, cb) {
       --state.pendingcb;
    -
       if (sync) {
         // defer the callback if we are being called synchronously
         // to avoid piling up things on the stack
    -    process.nextTick(cb, er); // this can emit finish, and it will always happen
    +    process.nextTick(cb, er);
    +    // this can emit finish, and it will always happen
         // after error
    -
         process.nextTick(finishMaybe, stream, state);
         stream._writableState.errorEmitted = true;
         errorOrDestroy(stream, er);
    @@ -427,20 +406,18 @@ function onwriteError(stream, state, sync, er, cb) {
         // it is async
         cb(er);
         stream._writableState.errorEmitted = true;
    -    errorOrDestroy(stream, er); // this can emit finish, but finish must
    +    errorOrDestroy(stream, er);
    +    // this can emit finish, but finish must
         // always follow error
    -
         finishMaybe(stream, state);
       }
     }
    -
     function onwriteStateUpdate(state) {
       state.writing = false;
       state.writecb = null;
       state.length -= state.writelen;
       state.writelen = 0;
     }
    -
     function onwrite(stream, er) {
       var state = stream._writableState;
       var sync = state.sync;
    @@ -450,11 +427,9 @@ function onwrite(stream, er) {
       if (er) onwriteError(stream, state, sync, er, cb);else {
         // Check if we're actually ready to finish, but don't emit yet
         var finished = needFinish(state) || stream.destroyed;
    -
         if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {
           clearBuffer(stream, state);
         }
    -
         if (sync) {
           process.nextTick(afterWrite, stream, state, finished, cb);
         } else {
    @@ -462,29 +437,27 @@ function onwrite(stream, er) {
         }
       }
     }
    -
     function afterWrite(stream, state, finished, cb) {
       if (!finished) onwriteDrain(stream, state);
       state.pendingcb--;
       cb();
       finishMaybe(stream, state);
    -} // Must force callback to be called on nextTick, so that we don't
    +}
    +
    +// Must force callback to be called on nextTick, so that we don't
     // emit 'drain' before the write() consumer gets the 'false' return
     // value, and has a chance to attach a 'drain' listener.
    -
    -
     function onwriteDrain(stream, state) {
       if (state.length === 0 && state.needDrain) {
         state.needDrain = false;
         stream.emit('drain');
       }
    -} // if there's something in the buffer waiting, then process it
    -
    +}
     
    +// if there's something in the buffer waiting, then process it
     function clearBuffer(stream, state) {
       state.bufferProcessing = true;
       var entry = state.bufferedRequest;
    -
       if (stream._writev && entry && entry.next) {
         // Fast case, write everything using _writev()
         var l = state.bufferedRequestCount;
    @@ -493,28 +466,25 @@ function clearBuffer(stream, state) {
         holder.entry = entry;
         var count = 0;
         var allBuffers = true;
    -
         while (entry) {
           buffer[count] = entry;
           if (!entry.isBuf) allBuffers = false;
           entry = entry.next;
           count += 1;
         }
    -
         buffer.allBuffers = allBuffers;
    -    doWrite(stream, state, true, state.length, buffer, '', holder.finish); // doWrite is almost always async, defer these to save a bit of time
    -    // as the hot path ends with doWrite
    +    doWrite(stream, state, true, state.length, buffer, '', holder.finish);
     
    +    // doWrite is almost always async, defer these to save a bit of time
    +    // as the hot path ends with doWrite
         state.pendingcb++;
         state.lastBufferedRequest = null;
    -
         if (holder.next) {
           state.corkedRequestsFree = holder.next;
           holder.next = null;
         } else {
           state.corkedRequestsFree = new CorkedRequest(state);
         }
    -
         state.bufferedRequestCount = 0;
       } else {
         // Slow case, write chunks one-by-one
    @@ -525,32 +495,26 @@ function clearBuffer(stream, state) {
           var len = state.objectMode ? 1 : chunk.length;
           doWrite(stream, state, false, len, chunk, encoding, cb);
           entry = entry.next;
    -      state.bufferedRequestCount--; // if we didn't call the onwrite immediately, then
    +      state.bufferedRequestCount--;
    +      // if we didn't call the onwrite immediately, then
           // it means that we need to wait until it does.
           // also, that means that the chunk and cb are currently
           // being processed, so move the buffer counter past them.
    -
           if (state.writing) {
             break;
           }
         }
    -
         if (entry === null) state.lastBufferedRequest = null;
       }
    -
       state.bufferedRequest = entry;
       state.bufferProcessing = false;
     }
    -
     Writable.prototype._write = function (chunk, encoding, cb) {
       cb(new ERR_METHOD_NOT_IMPLEMENTED('_write()'));
     };
    -
     Writable.prototype._writev = null;
    -
     Writable.prototype.end = function (chunk, encoding, cb) {
       var state = this._writableState;
    -
       if (typeof chunk === 'function') {
         cb = chunk;
         chunk = null;
    @@ -559,19 +523,18 @@ Writable.prototype.end = function (chunk, encoding, cb) {
         cb = encoding;
         encoding = null;
       }
    +  if (chunk !== null && chunk !== undefined) this.write(chunk, encoding);
     
    -  if (chunk !== null && chunk !== undefined) this.write(chunk, encoding); // .end() fully uncorks
    -
    +  // .end() fully uncorks
       if (state.corked) {
         state.corked = 1;
         this.uncork();
    -  } // ignore unnecessary end() calls.
    -
    +  }
     
    +  // ignore unnecessary end() calls.
       if (!state.ending) endWritable(this, state, cb);
       return this;
     };
    -
     Object.defineProperty(Writable.prototype, 'writableLength', {
       // making it explicit this property is not enumerable
       // because otherwise some prototype manipulation in
    @@ -581,25 +544,20 @@ Object.defineProperty(Writable.prototype, 'writableLength', {
         return this._writableState.length;
       }
     });
    -
     function needFinish(state) {
       return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;
     }
    -
     function callFinal(stream, state) {
       stream._final(function (err) {
         state.pendingcb--;
    -
         if (err) {
           errorOrDestroy(stream, err);
         }
    -
         state.prefinished = true;
         stream.emit('prefinish');
         finishMaybe(stream, state);
       });
     }
    -
     function prefinish(stream, state) {
       if (!state.prefinished && !state.finalCalled) {
         if (typeof stream._final === 'function' && !state.destroyed) {
    @@ -612,59 +570,47 @@ function prefinish(stream, state) {
         }
       }
     }
    -
     function finishMaybe(stream, state) {
       var need = needFinish(state);
    -
       if (need) {
         prefinish(stream, state);
    -
         if (state.pendingcb === 0) {
           state.finished = true;
           stream.emit('finish');
    -
           if (state.autoDestroy) {
             // In case of duplex streams we need a way to detect
             // if the readable side is ready for autoDestroy as well
             var rState = stream._readableState;
    -
             if (!rState || rState.autoDestroy && rState.endEmitted) {
               stream.destroy();
             }
           }
         }
       }
    -
       return need;
     }
    -
     function endWritable(stream, state, cb) {
       state.ending = true;
       finishMaybe(stream, state);
    -
       if (cb) {
         if (state.finished) process.nextTick(cb);else stream.once('finish', cb);
       }
    -
       state.ended = true;
       stream.writable = false;
     }
    -
     function onCorkedFinish(corkReq, state, err) {
       var entry = corkReq.entry;
       corkReq.entry = null;
    -
       while (entry) {
         var cb = entry.callback;
         state.pendingcb--;
         cb(err);
         entry = entry.next;
    -  } // reuse the free corkReq.
    -
    +  }
     
    +  // reuse the free corkReq.
       state.corkedRequestsFree.next = corkReq;
     }
    -
     Object.defineProperty(Writable.prototype, 'destroyed', {
       // making it explicit this property is not enumerable
       // because otherwise some prototype manipulation in
    @@ -674,7 +620,6 @@ Object.defineProperty(Writable.prototype, 'destroyed', {
         if (this._writableState === undefined) {
           return false;
         }
    -
         return this._writableState.destroyed;
       },
       set: function set(value) {
    @@ -682,16 +627,15 @@ Object.defineProperty(Writable.prototype, 'destroyed', {
         // has not been initialized yet
         if (!this._writableState) {
           return;
    -    } // backward compatibility, the user is explicitly
    -    // managing destroyed
    -
    +    }
     
    +    // backward compatibility, the user is explicitly
    +    // managing destroyed
         this._writableState.destroyed = value;
       }
     });
     Writable.prototype.destroy = destroyImpl.destroy;
     Writable.prototype._undestroy = destroyImpl.undestroy;
    -
     Writable.prototype._destroy = function (err, cb) {
       cb(err);
     };
    \ No newline at end of file
    diff --git a/deps/npm/node_modules/node-gyp/node_modules/readable-stream/lib/internal/streams/async_iterator.js b/deps/npm/node_modules/node-gyp/node_modules/readable-stream/lib/internal/streams/async_iterator.js
    index 9fb615a2f3bc44..742c5a4674794d 100644
    --- a/deps/npm/node_modules/node-gyp/node_modules/readable-stream/lib/internal/streams/async_iterator.js
    +++ b/deps/npm/node_modules/node-gyp/node_modules/readable-stream/lib/internal/streams/async_iterator.js
    @@ -1,11 +1,10 @@
     'use strict';
     
     var _Object$setPrototypeO;
    -
    -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
    -
    +function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
    +function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
    +function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
     var finished = require('./end-of-stream');
    -
     var kLastResolve = Symbol('lastResolve');
     var kLastReject = Symbol('lastReject');
     var kError = Symbol('error');
    @@ -13,22 +12,19 @@ var kEnded = Symbol('ended');
     var kLastPromise = Symbol('lastPromise');
     var kHandlePromise = Symbol('handlePromise');
     var kStream = Symbol('stream');
    -
     function createIterResult(value, done) {
       return {
         value: value,
         done: done
       };
     }
    -
     function readAndResolve(iter) {
       var resolve = iter[kLastResolve];
    -
       if (resolve !== null) {
    -    var data = iter[kStream].read(); // we defer if data is null
    +    var data = iter[kStream].read();
    +    // we defer if data is null
         // we can be expecting either 'end' or
         // 'error'
    -
         if (data !== null) {
           iter[kLastPromise] = null;
           iter[kLastResolve] = null;
    @@ -37,13 +33,11 @@ function readAndResolve(iter) {
         }
       }
     }
    -
     function onReadable(iter) {
       // we wait for the next tick, because it might
       // emit an error with process.nextTick
       process.nextTick(readAndResolve, iter);
     }
    -
     function wrapForNext(lastPromise, iter) {
       return function (resolve, reject) {
         lastPromise.then(function () {
    @@ -51,33 +45,26 @@ function wrapForNext(lastPromise, iter) {
             resolve(createIterResult(undefined, true));
             return;
           }
    -
           iter[kHandlePromise](resolve, reject);
         }, reject);
       };
     }
    -
     var AsyncIteratorPrototype = Object.getPrototypeOf(function () {});
     var ReadableStreamAsyncIteratorPrototype = Object.setPrototypeOf((_Object$setPrototypeO = {
       get stream() {
         return this[kStream];
       },
    -
       next: function next() {
         var _this = this;
    -
         // if we have detected an error in the meanwhile
         // reject straight away
         var error = this[kError];
    -
         if (error !== null) {
           return Promise.reject(error);
         }
    -
         if (this[kEnded]) {
           return Promise.resolve(createIterResult(undefined, true));
         }
    -
         if (this[kStream].destroyed) {
           // We need to defer via nextTick because if .destroy(err) is
           // called, the error will be emitted via nextTick, and
    @@ -92,29 +79,25 @@ var ReadableStreamAsyncIteratorPrototype = Object.setPrototypeOf((_Object$setPro
               }
             });
           });
    -    } // if we have multiple next() calls
    +    }
    +
    +    // if we have multiple next() calls
         // we will wait for the previous Promise to finish
         // this logic is optimized to support for await loops,
         // where next() is only called once at a time
    -
    -
         var lastPromise = this[kLastPromise];
         var promise;
    -
         if (lastPromise) {
           promise = new Promise(wrapForNext(lastPromise, this));
         } else {
           // fast path needed to support multiple this.push()
           // without triggering the next() queue
           var data = this[kStream].read();
    -
           if (data !== null) {
             return Promise.resolve(createIterResult(data, false));
           }
    -
           promise = new Promise(this[kHandlePromise]);
         }
    -
         this[kLastPromise] = promise;
         return promise;
       }
    @@ -122,7 +105,6 @@ var ReadableStreamAsyncIteratorPrototype = Object.setPrototypeOf((_Object$setPro
       return this;
     }), _defineProperty(_Object$setPrototypeO, "return", function _return() {
       var _this2 = this;
    -
       // destroy(err, cb) is a private API
       // we can guarantee we have that here, because we control the
       // Readable class this is attached to
    @@ -132,15 +114,12 @@ var ReadableStreamAsyncIteratorPrototype = Object.setPrototypeOf((_Object$setPro
             reject(err);
             return;
           }
    -
           resolve(createIterResult(undefined, true));
         });
       });
     }), _Object$setPrototypeO), AsyncIteratorPrototype);
    -
     var createReadableStreamAsyncIterator = function createReadableStreamAsyncIterator(stream) {
       var _Object$create;
    -
       var iterator = Object.create(ReadableStreamAsyncIteratorPrototype, (_Object$create = {}, _defineProperty(_Object$create, kStream, {
         value: stream,
         writable: true
    @@ -159,7 +138,6 @@ var createReadableStreamAsyncIterator = function createReadableStreamAsyncIterat
       }), _defineProperty(_Object$create, kHandlePromise, {
         value: function value(resolve, reject) {
           var data = iterator[kStream].read();
    -
           if (data) {
             iterator[kLastPromise] = null;
             iterator[kLastResolve] = null;
    @@ -175,33 +153,28 @@ var createReadableStreamAsyncIterator = function createReadableStreamAsyncIterat
       iterator[kLastPromise] = null;
       finished(stream, function (err) {
         if (err && err.code !== 'ERR_STREAM_PREMATURE_CLOSE') {
    -      var reject = iterator[kLastReject]; // reject if we are waiting for data in the Promise
    +      var reject = iterator[kLastReject];
    +      // reject if we are waiting for data in the Promise
           // returned by next() and store the error
    -
           if (reject !== null) {
             iterator[kLastPromise] = null;
             iterator[kLastResolve] = null;
             iterator[kLastReject] = null;
             reject(err);
           }
    -
           iterator[kError] = err;
           return;
         }
    -
         var resolve = iterator[kLastResolve];
    -
         if (resolve !== null) {
           iterator[kLastPromise] = null;
           iterator[kLastResolve] = null;
           iterator[kLastReject] = null;
           resolve(createIterResult(undefined, true));
         }
    -
         iterator[kEnded] = true;
       });
       stream.on('readable', onReadable.bind(null, iterator));
       return iterator;
     };
    -
     module.exports = createReadableStreamAsyncIterator;
    \ No newline at end of file
    diff --git a/deps/npm/node_modules/node-gyp/node_modules/readable-stream/lib/internal/streams/buffer_list.js b/deps/npm/node_modules/node-gyp/node_modules/readable-stream/lib/internal/streams/buffer_list.js
    index cdea425f19dd96..69bda497d35f34 100644
    --- a/deps/npm/node_modules/node-gyp/node_modules/readable-stream/lib/internal/streams/buffer_list.js
    +++ b/deps/npm/node_modules/node-gyp/node_modules/readable-stream/lib/internal/streams/buffer_list.js
    @@ -1,40 +1,28 @@
     'use strict';
     
    -function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
    -
    -function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
    -
    -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
    -
    +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
    +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
    +function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
     function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
    -
    -function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
    -
    -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
    -
    +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
    +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
    +function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
    +function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
     var _require = require('buffer'),
    -    Buffer = _require.Buffer;
    -
    +  Buffer = _require.Buffer;
     var _require2 = require('util'),
    -    inspect = _require2.inspect;
    -
    +  inspect = _require2.inspect;
     var custom = inspect && inspect.custom || 'inspect';
    -
     function copyBuffer(src, target, offset) {
       Buffer.prototype.copy.call(src, target, offset);
     }
    -
    -module.exports =
    -/*#__PURE__*/
    -function () {
    +module.exports = /*#__PURE__*/function () {
       function BufferList() {
         _classCallCheck(this, BufferList);
    -
         this.head = null;
         this.tail = null;
         this.length = 0;
       }
    -
       _createClass(BufferList, [{
         key: "push",
         value: function push(v) {
    @@ -78,11 +66,7 @@ function () {
           if (this.length === 0) return '';
           var p = this.head;
           var ret = '' + p.data;
    -
    -      while (p = p.next) {
    -        ret += s + p.data;
    -      }
    -
    +      while (p = p.next) ret += s + p.data;
           return ret;
         }
       }, {
    @@ -92,21 +76,19 @@ function () {
           var ret = Buffer.allocUnsafe(n >>> 0);
           var p = this.head;
           var i = 0;
    -
           while (p) {
             copyBuffer(p.data, ret, i);
             i += p.data.length;
             p = p.next;
           }
    -
           return ret;
    -    } // Consumes a specified amount of bytes or characters from the buffered data.
    +    }
     
    +    // Consumes a specified amount of bytes or characters from the buffered data.
       }, {
         key: "consume",
         value: function consume(n, hasStrings) {
           var ret;
    -
           if (n < this.head.data.length) {
             // `slice` is the same for buffers and strings.
             ret = this.head.data.slice(0, n);
    @@ -118,15 +100,15 @@ function () {
             // Result spans more than one buffer.
             ret = hasStrings ? this._getString(n) : this._getBuffer(n);
           }
    -
           return ret;
         }
       }, {
         key: "first",
         value: function first() {
           return this.head.data;
    -    } // Consumes a specified amount of characters from the buffered data.
    +    }
     
    +    // Consumes a specified amount of characters from the buffered data.
       }, {
         key: "_getString",
         value: function _getString(n) {
    @@ -134,13 +116,11 @@ function () {
           var c = 1;
           var ret = p.data;
           n -= ret.length;
    -
           while (p = p.next) {
             var str = p.data;
             var nb = n > str.length ? str.length : n;
             if (nb === str.length) ret += str;else ret += str.slice(0, n);
             n -= nb;
    -
             if (n === 0) {
               if (nb === str.length) {
                 ++c;
    @@ -149,17 +129,15 @@ function () {
                 this.head = p;
                 p.data = str.slice(nb);
               }
    -
               break;
             }
    -
             ++c;
           }
    -
           this.length -= c;
           return ret;
    -    } // Consumes a specified amount of bytes from the buffered data.
    +    }
     
    +    // Consumes a specified amount of bytes from the buffered data.
       }, {
         key: "_getBuffer",
         value: function _getBuffer(n) {
    @@ -168,13 +146,11 @@ function () {
           var c = 1;
           p.data.copy(ret);
           n -= p.data.length;
    -
           while (p = p.next) {
             var buf = p.data;
             var nb = n > buf.length ? buf.length : n;
             buf.copy(ret, ret.length - n, 0, nb);
             n -= nb;
    -
             if (n === 0) {
               if (nb === buf.length) {
                 ++c;
    @@ -183,21 +159,19 @@ function () {
                 this.head = p;
                 p.data = buf.slice(nb);
               }
    -
               break;
             }
    -
             ++c;
           }
    -
           this.length -= c;
           return ret;
    -    } // Make sure the linked list only shows the minimal necessary information.
    +    }
     
    +    // Make sure the linked list only shows the minimal necessary information.
       }, {
         key: custom,
         value: function value(_, options) {
    -      return inspect(this, _objectSpread({}, options, {
    +      return inspect(this, _objectSpread(_objectSpread({}, options), {}, {
             // Only inspect one level.
             depth: 0,
             // It should not recurse.
    @@ -205,6 +179,5 @@ function () {
           }));
         }
       }]);
    -
       return BufferList;
     }();
    \ No newline at end of file
    diff --git a/deps/npm/node_modules/node-gyp/node_modules/readable-stream/lib/internal/streams/destroy.js b/deps/npm/node_modules/node-gyp/node_modules/readable-stream/lib/internal/streams/destroy.js
    index 3268a16f3b6f23..31a17c4dc46388 100644
    --- a/deps/npm/node_modules/node-gyp/node_modules/readable-stream/lib/internal/streams/destroy.js
    +++ b/deps/npm/node_modules/node-gyp/node_modules/readable-stream/lib/internal/streams/destroy.js
    @@ -1,11 +1,10 @@
    -'use strict'; // undocumented cb() API, needed for core, not for public API
    +'use strict';
     
    +// undocumented cb() API, needed for core, not for public API
     function destroy(err, cb) {
       var _this = this;
    -
       var readableDestroyed = this._readableState && this._readableState.destroyed;
       var writableDestroyed = this._writableState && this._writableState.destroyed;
    -
       if (readableDestroyed || writableDestroyed) {
         if (cb) {
           cb(err);
    @@ -17,21 +16,20 @@ function destroy(err, cb) {
             process.nextTick(emitErrorNT, this, err);
           }
         }
    -
         return this;
    -  } // we set destroyed to true before firing error callbacks in order
    -  // to make it re-entrance safe in case destroy() is called within callbacks
    +  }
     
    +  // we set destroyed to true before firing error callbacks in order
    +  // to make it re-entrance safe in case destroy() is called within callbacks
     
       if (this._readableState) {
         this._readableState.destroyed = true;
    -  } // if this is a duplex stream mark the writable part as destroyed as well
    -
    +  }
     
    +  // if this is a duplex stream mark the writable part as destroyed as well
       if (this._writableState) {
         this._writableState.destroyed = true;
       }
    -
       this._destroy(err || null, function (err) {
         if (!cb && err) {
           if (!_this._writableState) {
    @@ -49,21 +47,17 @@ function destroy(err, cb) {
           process.nextTick(emitCloseNT, _this);
         }
       });
    -
       return this;
     }
    -
     function emitErrorAndCloseNT(self, err) {
       emitErrorNT(self, err);
       emitCloseNT(self);
     }
    -
     function emitCloseNT(self) {
       if (self._writableState && !self._writableState.emitClose) return;
       if (self._readableState && !self._readableState.emitClose) return;
       self.emit('close');
     }
    -
     function undestroy() {
       if (this._readableState) {
         this._readableState.destroyed = false;
    @@ -71,7 +65,6 @@ function undestroy() {
         this._readableState.ended = false;
         this._readableState.endEmitted = false;
       }
    -
       if (this._writableState) {
         this._writableState.destroyed = false;
         this._writableState.ended = false;
    @@ -82,22 +75,20 @@ function undestroy() {
         this._writableState.errorEmitted = false;
       }
     }
    -
     function emitErrorNT(self, err) {
       self.emit('error', err);
     }
    -
     function errorOrDestroy(stream, err) {
       // We have tests that rely on errors being emitted
       // in the same tick, so changing this is semver major.
       // For now when you opt-in to autoDestroy we allow
       // the error to be emitted nextTick. In a future
       // semver major update we should change the default to this.
    +
       var rState = stream._readableState;
       var wState = stream._writableState;
       if (rState && rState.autoDestroy || wState && wState.autoDestroy) stream.destroy(err);else stream.emit('error', err);
     }
    -
     module.exports = {
       destroy: destroy,
       undestroy: undestroy,
    diff --git a/deps/npm/node_modules/node-gyp/node_modules/readable-stream/lib/internal/streams/end-of-stream.js b/deps/npm/node_modules/node-gyp/node_modules/readable-stream/lib/internal/streams/end-of-stream.js
    index 831f286d98fa95..59c671b5af769b 100644
    --- a/deps/npm/node_modules/node-gyp/node_modules/readable-stream/lib/internal/streams/end-of-stream.js
    +++ b/deps/npm/node_modules/node-gyp/node_modules/readable-stream/lib/internal/streams/end-of-stream.js
    @@ -1,78 +1,62 @@
     // Ported from https://github.com/mafintosh/end-of-stream with
     // permission from the author, Mathias Buus (@mafintosh).
    +
     'use strict';
     
     var ERR_STREAM_PREMATURE_CLOSE = require('../../../errors').codes.ERR_STREAM_PREMATURE_CLOSE;
    -
     function once(callback) {
       var called = false;
       return function () {
         if (called) return;
         called = true;
    -
         for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
           args[_key] = arguments[_key];
         }
    -
         callback.apply(this, args);
       };
     }
    -
     function noop() {}
    -
     function isRequest(stream) {
       return stream.setHeader && typeof stream.abort === 'function';
     }
    -
     function eos(stream, opts, callback) {
       if (typeof opts === 'function') return eos(stream, null, opts);
       if (!opts) opts = {};
       callback = once(callback || noop);
       var readable = opts.readable || opts.readable !== false && stream.readable;
       var writable = opts.writable || opts.writable !== false && stream.writable;
    -
       var onlegacyfinish = function onlegacyfinish() {
         if (!stream.writable) onfinish();
       };
    -
       var writableEnded = stream._writableState && stream._writableState.finished;
    -
       var onfinish = function onfinish() {
         writable = false;
         writableEnded = true;
         if (!readable) callback.call(stream);
       };
    -
       var readableEnded = stream._readableState && stream._readableState.endEmitted;
    -
       var onend = function onend() {
         readable = false;
         readableEnded = true;
         if (!writable) callback.call(stream);
       };
    -
       var onerror = function onerror(err) {
         callback.call(stream, err);
       };
    -
       var onclose = function onclose() {
         var err;
    -
         if (readable && !readableEnded) {
           if (!stream._readableState || !stream._readableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE();
           return callback.call(stream, err);
         }
    -
         if (writable && !writableEnded) {
           if (!stream._writableState || !stream._writableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE();
           return callback.call(stream, err);
         }
       };
    -
       var onrequest = function onrequest() {
         stream.req.on('finish', onfinish);
       };
    -
       if (isRequest(stream)) {
         stream.on('complete', onfinish);
         stream.on('abort', onclose);
    @@ -82,7 +66,6 @@ function eos(stream, opts, callback) {
         stream.on('end', onlegacyfinish);
         stream.on('close', onlegacyfinish);
       }
    -
       stream.on('end', onend);
       stream.on('finish', onfinish);
       if (opts.error !== false) stream.on('error', onerror);
    @@ -100,5 +83,4 @@ function eos(stream, opts, callback) {
         stream.removeListener('close', onclose);
       };
     }
    -
     module.exports = eos;
    \ No newline at end of file
    diff --git a/deps/npm/node_modules/node-gyp/node_modules/readable-stream/lib/internal/streams/from.js b/deps/npm/node_modules/node-gyp/node_modules/readable-stream/lib/internal/streams/from.js
    index 6c41284416799c..0a34ee92e3df85 100644
    --- a/deps/npm/node_modules/node-gyp/node_modules/readable-stream/lib/internal/streams/from.js
    +++ b/deps/npm/node_modules/node-gyp/node_modules/readable-stream/lib/internal/streams/from.js
    @@ -1,52 +1,42 @@
     'use strict';
     
     function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
    -
     function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
    -
    -function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
    -
    -function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
    -
    -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
    -
    +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
    +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
    +function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
    +function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
    +function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
     var ERR_INVALID_ARG_TYPE = require('../../../errors').codes.ERR_INVALID_ARG_TYPE;
    -
     function from(Readable, iterable, opts) {
       var iterator;
    -
       if (iterable && typeof iterable.next === 'function') {
         iterator = iterable;
       } else if (iterable && iterable[Symbol.asyncIterator]) iterator = iterable[Symbol.asyncIterator]();else if (iterable && iterable[Symbol.iterator]) iterator = iterable[Symbol.iterator]();else throw new ERR_INVALID_ARG_TYPE('iterable', ['Iterable'], iterable);
    -
       var readable = new Readable(_objectSpread({
         objectMode: true
    -  }, opts)); // Reading boolean to protect against _read
    +  }, opts));
    +  // Reading boolean to protect against _read
       // being called before last iteration completion.
    -
       var reading = false;
    -
       readable._read = function () {
         if (!reading) {
           reading = true;
           next();
         }
       };
    -
       function next() {
         return _next2.apply(this, arguments);
       }
    -
       function _next2() {
         _next2 = _asyncToGenerator(function* () {
           try {
    -        var _ref = yield iterator.next(),
    -            value = _ref.value,
    -            done = _ref.done;
    -
    +        var _yield$iterator$next = yield iterator.next(),
    +          value = _yield$iterator$next.value,
    +          done = _yield$iterator$next.done;
             if (done) {
               readable.push(null);
    -        } else if (readable.push((yield value))) {
    +        } else if (readable.push(yield value)) {
               next();
             } else {
               reading = false;
    @@ -57,8 +47,6 @@ function from(Readable, iterable, opts) {
         });
         return _next2.apply(this, arguments);
       }
    -
       return readable;
     }
    -
    -module.exports = from;
    \ No newline at end of file
    +module.exports = from;
    diff --git a/deps/npm/node_modules/node-gyp/node_modules/readable-stream/lib/internal/streams/pipeline.js b/deps/npm/node_modules/node-gyp/node_modules/readable-stream/lib/internal/streams/pipeline.js
    index 6589909889c585..e6f39241f98dd8 100644
    --- a/deps/npm/node_modules/node-gyp/node_modules/readable-stream/lib/internal/streams/pipeline.js
    +++ b/deps/npm/node_modules/node-gyp/node_modules/readable-stream/lib/internal/streams/pipeline.js
    @@ -1,9 +1,9 @@
     // Ported from https://github.com/mafintosh/pump with
     // permission from the author, Mathias Buus (@mafintosh).
    +
     'use strict';
     
     var eos;
    -
     function once(callback) {
       var called = false;
       return function () {
    @@ -12,20 +12,16 @@ function once(callback) {
         callback.apply(void 0, arguments);
       };
     }
    -
     var _require$codes = require('../../../errors').codes,
    -    ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS,
    -    ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED;
    -
    +  ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS,
    +  ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED;
     function noop(err) {
       // Rethrow the error if it exists to avoid swallowing it
       if (err) throw err;
     }
    -
     function isRequest(stream) {
       return stream.setHeader && typeof stream.abort === 'function';
     }
    -
     function destroyer(stream, reading, writing, callback) {
       callback = once(callback);
       var closed = false;
    @@ -45,40 +41,34 @@ function destroyer(stream, reading, writing, callback) {
       return function (err) {
         if (closed) return;
         if (destroyed) return;
    -    destroyed = true; // request.destroy just do .end - .abort is what we want
    +    destroyed = true;
     
    +    // request.destroy just do .end - .abort is what we want
         if (isRequest(stream)) return stream.abort();
         if (typeof stream.destroy === 'function') return stream.destroy();
         callback(err || new ERR_STREAM_DESTROYED('pipe'));
       };
     }
    -
     function call(fn) {
       fn();
     }
    -
     function pipe(from, to) {
       return from.pipe(to);
     }
    -
     function popCallback(streams) {
       if (!streams.length) return noop;
       if (typeof streams[streams.length - 1] !== 'function') return noop;
       return streams.pop();
     }
    -
     function pipeline() {
       for (var _len = arguments.length, streams = new Array(_len), _key = 0; _key < _len; _key++) {
         streams[_key] = arguments[_key];
       }
    -
       var callback = popCallback(streams);
       if (Array.isArray(streams[0])) streams = streams[0];
    -
       if (streams.length < 2) {
         throw new ERR_MISSING_ARGS('streams');
       }
    -
       var error;
       var destroys = streams.map(function (stream, i) {
         var reading = i < streams.length - 1;
    @@ -93,5 +83,4 @@ function pipeline() {
       });
       return streams.reduce(pipe);
     }
    -
     module.exports = pipeline;
    \ No newline at end of file
    diff --git a/deps/npm/node_modules/node-gyp/node_modules/readable-stream/lib/internal/streams/state.js b/deps/npm/node_modules/node-gyp/node_modules/readable-stream/lib/internal/streams/state.js
    index 19887eb8a9070e..3fbf8927e00179 100644
    --- a/deps/npm/node_modules/node-gyp/node_modules/readable-stream/lib/internal/streams/state.js
    +++ b/deps/npm/node_modules/node-gyp/node_modules/readable-stream/lib/internal/streams/state.js
    @@ -1,27 +1,22 @@
     'use strict';
     
     var ERR_INVALID_OPT_VALUE = require('../../../errors').codes.ERR_INVALID_OPT_VALUE;
    -
     function highWaterMarkFrom(options, isDuplex, duplexKey) {
       return options.highWaterMark != null ? options.highWaterMark : isDuplex ? options[duplexKey] : null;
     }
    -
     function getHighWaterMark(state, options, duplexKey, isDuplex) {
       var hwm = highWaterMarkFrom(options, isDuplex, duplexKey);
    -
       if (hwm != null) {
         if (!(isFinite(hwm) && Math.floor(hwm) === hwm) || hwm < 0) {
           var name = isDuplex ? duplexKey : 'highWaterMark';
           throw new ERR_INVALID_OPT_VALUE(name, hwm);
         }
    -
         return Math.floor(hwm);
    -  } // Default value
    -
    +  }
     
    +  // Default value
       return state.objectMode ? 16 : 16 * 1024;
     }
    -
     module.exports = {
       getHighWaterMark: getHighWaterMark
     };
    \ No newline at end of file
    diff --git a/deps/npm/node_modules/node-gyp/node_modules/readable-stream/package.json b/deps/npm/node_modules/node-gyp/node_modules/readable-stream/package.json
    index 0b0c4bd207ace3..ade59e71aa0f17 100644
    --- a/deps/npm/node_modules/node-gyp/node_modules/readable-stream/package.json
    +++ b/deps/npm/node_modules/node-gyp/node_modules/readable-stream/package.json
    @@ -1,6 +1,6 @@
     {
       "name": "readable-stream",
    -  "version": "3.6.0",
    +  "version": "3.6.2",
       "description": "Streams3, a user-land copy of the stream library from Node.js",
       "main": "readable.js",
       "engines": {
    diff --git a/deps/npm/node_modules/nopt/lib/debug.js b/deps/npm/node_modules/nopt/lib/debug.js
    new file mode 100644
    index 00000000000000..194d0c68818829
    --- /dev/null
    +++ b/deps/npm/node_modules/nopt/lib/debug.js
    @@ -0,0 +1,6 @@
    +/* istanbul ignore next */
    +module.exports = process.env.DEBUG_NOPT || process.env.NOPT_DEBUG
    +  ? function () {
    +    console.error.apply(console, arguments)
    +  }
    +  : function () {}
    diff --git a/deps/npm/node_modules/nopt/lib/nopt-lib.js b/deps/npm/node_modules/nopt/lib/nopt-lib.js
    new file mode 100644
    index 00000000000000..89d269fb43f1a1
    --- /dev/null
    +++ b/deps/npm/node_modules/nopt/lib/nopt-lib.js
    @@ -0,0 +1,428 @@
    +var abbrev = require('abbrev')
    +const debug = require('./debug')
    +const defaultTypeDefs = require('./type-defs')
    +
    +function nopt (args, { types, shorthands, typeDefs, invalidHandler }) {
    +  debug(types, shorthands, args, typeDefs)
    +
    +  var data = {}
    +  var argv = {
    +    remain: [],
    +    cooked: args,
    +    original: args.slice(0),
    +  }
    +
    +  parse(args, data, argv.remain, { typeDefs, types, shorthands })
    +
    +  // now data is full
    +  clean(data, { types, typeDefs, invalidHandler })
    +  data.argv = argv
    +
    +  Object.defineProperty(data.argv, 'toString', {
    +    value: function () {
    +      return this.original.map(JSON.stringify).join(' ')
    +    },
    +    enumerable: false,
    +  })
    +
    +  return data
    +}
    +
    +function clean (data, { types, typeDefs, invalidHandler }) {
    +  const StringType = typeDefs.String.type
    +  const NumberType = typeDefs.Number.type
    +  const ArrayType = typeDefs.Array.type
    +  const BooleanType = typeDefs.Boolean.type
    +  const DateType = typeDefs.Date.type
    +
    +  var remove = {}
    +  var typeDefault = [false, true, null, StringType, ArrayType]
    +
    +  Object.keys(data).forEach(function (k) {
    +    if (k === 'argv') {
    +      return
    +    }
    +    var val = data[k]
    +    var isArray = Array.isArray(val)
    +    var type = types[k]
    +    if (!isArray) {
    +      val = [val]
    +    }
    +    if (!type) {
    +      type = typeDefault
    +    }
    +    if (type === ArrayType) {
    +      type = typeDefault.concat(ArrayType)
    +    }
    +    if (!Array.isArray(type)) {
    +      type = [type]
    +    }
    +
    +    debug('val=%j', val)
    +    debug('types=', type)
    +    val = val.map(function (v) {
    +      // if it's an unknown value, then parse false/true/null/numbers/dates
    +      if (typeof v === 'string') {
    +        debug('string %j', v)
    +        v = v.trim()
    +        if ((v === 'null' && ~type.indexOf(null))
    +            || (v === 'true' &&
    +               (~type.indexOf(true) || ~type.indexOf(BooleanType)))
    +            || (v === 'false' &&
    +               (~type.indexOf(false) || ~type.indexOf(BooleanType)))) {
    +          v = JSON.parse(v)
    +          debug('jsonable %j', v)
    +        } else if (~type.indexOf(NumberType) && !isNaN(v)) {
    +          debug('convert to number', v)
    +          v = +v
    +        } else if (~type.indexOf(DateType) && !isNaN(Date.parse(v))) {
    +          debug('convert to date', v)
    +          v = new Date(v)
    +        }
    +      }
    +
    +      if (!Object.prototype.hasOwnProperty.call(types, k)) {
    +        return v
    +      }
    +
    +      // allow `--no-blah` to set 'blah' to null if null is allowed
    +      if (v === false && ~type.indexOf(null) &&
    +          !(~type.indexOf(false) || ~type.indexOf(BooleanType))) {
    +        v = null
    +      }
    +
    +      var d = {}
    +      d[k] = v
    +      debug('prevalidated val', d, v, types[k])
    +      if (!validate(d, k, v, types[k], { typeDefs })) {
    +        if (invalidHandler) {
    +          invalidHandler(k, v, types[k], data)
    +        } else if (invalidHandler !== false) {
    +          debug('invalid: ' + k + '=' + v, types[k])
    +        }
    +        return remove
    +      }
    +      debug('validated v', d, v, types[k])
    +      return d[k]
    +    }).filter(function (v) {
    +      return v !== remove
    +    })
    +
    +    // if we allow Array specifically, then an empty array is how we
    +    // express 'no value here', not null.  Allow it.
    +    if (!val.length && type.indexOf(ArrayType) === -1) {
    +      debug('VAL HAS NO LENGTH, DELETE IT', val, k, type.indexOf(ArrayType))
    +      delete data[k]
    +    } else if (isArray) {
    +      debug(isArray, data[k], val)
    +      data[k] = val
    +    } else {
    +      data[k] = val[0]
    +    }
    +
    +    debug('k=%s val=%j', k, val, data[k])
    +  })
    +}
    +
    +function validate (data, k, val, type, { typeDefs }) {
    +  const ArrayType = typeDefs.Array.type
    +  // arrays are lists of types.
    +  if (Array.isArray(type)) {
    +    for (let i = 0, l = type.length; i < l; i++) {
    +      if (type[i] === ArrayType) {
    +        continue
    +      }
    +      if (validate(data, k, val, type[i], { typeDefs })) {
    +        return true
    +      }
    +    }
    +    delete data[k]
    +    return false
    +  }
    +
    +  // an array of anything?
    +  if (type === ArrayType) {
    +    return true
    +  }
    +
    +  // Original comment:
    +  // NaN is poisonous.  Means that something is not allowed.
    +  // New comment: Changing this to an isNaN check breaks a lot of tests.
    +  // Something is being assumed here that is not actually what happens in
    +  // practice.  Fixing it is outside the scope of getting linting to pass in
    +  // this repo. Leaving as-is for now.
    +  /* eslint-disable-next-line no-self-compare */
    +  if (type !== type) {
    +    debug('Poison NaN', k, val, type)
    +    delete data[k]
    +    return false
    +  }
    +
    +  // explicit list of values
    +  if (val === type) {
    +    debug('Explicitly allowed %j', val)
    +    data[k] = val
    +    return true
    +  }
    +
    +  // now go through the list of typeDefs, validate against each one.
    +  var ok = false
    +  var types = Object.keys(typeDefs)
    +  for (let i = 0, l = types.length; i < l; i++) {
    +    debug('test type %j %j %j', k, val, types[i])
    +    var t = typeDefs[types[i]]
    +    if (t && (
    +      (type && type.name && t.type && t.type.name) ?
    +        (type.name === t.type.name) :
    +        (type === t.type)
    +    )) {
    +      var d = {}
    +      ok = t.validate(d, k, val) !== false
    +      val = d[k]
    +      if (ok) {
    +        data[k] = val
    +        break
    +      }
    +    }
    +  }
    +  debug('OK? %j (%j %j %j)', ok, k, val, types[types.length - 1])
    +
    +  if (!ok) {
    +    delete data[k]
    +  }
    +  return ok
    +}
    +
    +function parse (args, data, remain, { typeDefs, types, shorthands }) {
    +  const StringType = typeDefs.String.type
    +  const NumberType = typeDefs.String.type
    +  const ArrayType = typeDefs.Array.type
    +  const BooleanType = typeDefs.Boolean.type
    +
    +  debug('parse', args, data, remain)
    +
    +  var abbrevs = abbrev(Object.keys(types))
    +  var shortAbbr = abbrev(Object.keys(shorthands))
    +
    +  for (var i = 0; i < args.length; i++) {
    +    var arg = args[i]
    +    debug('arg', arg)
    +
    +    if (arg.match(/^-{2,}$/)) {
    +      // done with keys.
    +      // the rest are args.
    +      remain.push.apply(remain, args.slice(i + 1))
    +      args[i] = '--'
    +      break
    +    }
    +    var hadEq = false
    +    if (arg.charAt(0) === '-' && arg.length > 1) {
    +      var at = arg.indexOf('=')
    +      if (at > -1) {
    +        hadEq = true
    +        var v = arg.slice(at + 1)
    +        arg = arg.slice(0, at)
    +        args.splice(i, 1, arg, v)
    +      }
    +
    +      // see if it's a shorthand
    +      // if so, splice and back up to re-parse it.
    +      var shRes = resolveShort(arg, shortAbbr, abbrevs, { shorthands })
    +      debug('arg=%j shRes=%j', arg, shRes)
    +      if (shRes) {
    +        debug(arg, shRes)
    +        args.splice.apply(args, [i, 1].concat(shRes))
    +        if (arg !== shRes[0]) {
    +          i--
    +          continue
    +        }
    +      }
    +      arg = arg.replace(/^-+/, '')
    +      var no = null
    +      while (arg.toLowerCase().indexOf('no-') === 0) {
    +        no = !no
    +        arg = arg.slice(3)
    +      }
    +
    +      if (abbrevs[arg]) {
    +        arg = abbrevs[arg]
    +      }
    +
    +      var argType = types[arg]
    +      var isTypeArray = Array.isArray(argType)
    +      if (isTypeArray && argType.length === 1) {
    +        isTypeArray = false
    +        argType = argType[0]
    +      }
    +
    +      var isArray = argType === ArrayType ||
    +        isTypeArray && argType.indexOf(ArrayType) !== -1
    +
    +      // allow unknown things to be arrays if specified multiple times.
    +      if (
    +        !Object.prototype.hasOwnProperty.call(types, arg) &&
    +        Object.prototype.hasOwnProperty.call(data, arg)
    +      ) {
    +        if (!Array.isArray(data[arg])) {
    +          data[arg] = [data[arg]]
    +        }
    +        isArray = true
    +      }
    +
    +      var val
    +      var la = args[i + 1]
    +
    +      var isBool = typeof no === 'boolean' ||
    +        argType === BooleanType ||
    +        isTypeArray && argType.indexOf(BooleanType) !== -1 ||
    +        (typeof argType === 'undefined' && !hadEq) ||
    +        (la === 'false' &&
    +         (argType === null ||
    +          isTypeArray && ~argType.indexOf(null)))
    +
    +      if (isBool) {
    +        // just set and move along
    +        val = !no
    +        // however, also support --bool true or --bool false
    +        if (la === 'true' || la === 'false') {
    +          val = JSON.parse(la)
    +          la = null
    +          if (no) {
    +            val = !val
    +          }
    +          i++
    +        }
    +
    +        // also support "foo":[Boolean, "bar"] and "--foo bar"
    +        if (isTypeArray && la) {
    +          if (~argType.indexOf(la)) {
    +            // an explicit type
    +            val = la
    +            i++
    +          } else if (la === 'null' && ~argType.indexOf(null)) {
    +            // null allowed
    +            val = null
    +            i++
    +          } else if (!la.match(/^-{2,}[^-]/) &&
    +                      !isNaN(la) &&
    +                      ~argType.indexOf(NumberType)) {
    +            // number
    +            val = +la
    +            i++
    +          } else if (!la.match(/^-[^-]/) && ~argType.indexOf(StringType)) {
    +            // string
    +            val = la
    +            i++
    +          }
    +        }
    +
    +        if (isArray) {
    +          (data[arg] = data[arg] || []).push(val)
    +        } else {
    +          data[arg] = val
    +        }
    +
    +        continue
    +      }
    +
    +      if (argType === StringType) {
    +        if (la === undefined) {
    +          la = ''
    +        } else if (la.match(/^-{1,2}[^-]+/)) {
    +          la = ''
    +          i--
    +        }
    +      }
    +
    +      if (la && la.match(/^-{2,}$/)) {
    +        la = undefined
    +        i--
    +      }
    +
    +      val = la === undefined ? true : la
    +      if (isArray) {
    +        (data[arg] = data[arg] || []).push(val)
    +      } else {
    +        data[arg] = val
    +      }
    +
    +      i++
    +      continue
    +    }
    +    remain.push(arg)
    +  }
    +}
    +
    +function resolveShort (arg, shortAbbr, abbrevs, { shorthands }) {
    +  // handle single-char shorthands glommed together, like
    +  // npm ls -glp, but only if there is one dash, and only if
    +  // all of the chars are single-char shorthands, and it's
    +  // not a match to some other abbrev.
    +  arg = arg.replace(/^-+/, '')
    +
    +  // if it's an exact known option, then don't go any further
    +  if (abbrevs[arg] === arg) {
    +    return null
    +  }
    +
    +  // if it's an exact known shortopt, same deal
    +  if (shorthands[arg]) {
    +    // make it an array, if it's a list of words
    +    if (shorthands[arg] && !Array.isArray(shorthands[arg])) {
    +      shorthands[arg] = shorthands[arg].split(/\s+/)
    +    }
    +
    +    return shorthands[arg]
    +  }
    +
    +  // first check to see if this arg is a set of single-char shorthands
    +  var singles = shorthands.___singles
    +  if (!singles) {
    +    singles = Object.keys(shorthands).filter(function (s) {
    +      return s.length === 1
    +    }).reduce(function (l, r) {
    +      l[r] = true
    +      return l
    +    }, {})
    +    shorthands.___singles = singles
    +    debug('shorthand singles', singles)
    +  }
    +
    +  var chrs = arg.split('').filter(function (c) {
    +    return singles[c]
    +  })
    +
    +  if (chrs.join('') === arg) {
    +    return chrs.map(function (c) {
    +      return shorthands[c]
    +    }).reduce(function (l, r) {
    +      return l.concat(r)
    +    }, [])
    +  }
    +
    +  // if it's an arg abbrev, and not a literal shorthand, then prefer the arg
    +  if (abbrevs[arg] && !shorthands[arg]) {
    +    return null
    +  }
    +
    +  // if it's an abbr for a shorthand, then use that
    +  if (shortAbbr[arg]) {
    +    arg = shortAbbr[arg]
    +  }
    +
    +  // make it an array, if it's a list of words
    +  if (shorthands[arg] && !Array.isArray(shorthands[arg])) {
    +    shorthands[arg] = shorthands[arg].split(/\s+/)
    +  }
    +
    +  return shorthands[arg]
    +}
    +
    +module.exports = {
    +  nopt,
    +  clean,
    +  parse,
    +  validate,
    +  resolveShort,
    +  typeDefs: defaultTypeDefs,
    +}
    diff --git a/deps/npm/node_modules/nopt/lib/nopt.js b/deps/npm/node_modules/nopt/lib/nopt.js
    index 5829c2fe0f6379..70fd809bc111e6 100644
    --- a/deps/npm/node_modules/nopt/lib/nopt.js
    +++ b/deps/npm/node_modules/nopt/lib/nopt.js
    @@ -1,515 +1,30 @@
    -// info about each config option.
    +const lib = require('./nopt-lib')
    +const defaultTypeDefs = require('./type-defs')
     
    -var debug = process.env.DEBUG_NOPT || process.env.NOPT_DEBUG
    -  ? function () {
    -    console.error.apply(console, arguments)
    -  }
    -  : function () {}
    -
    -var url = require('url')
    -var path = require('path')
    -var Stream = require('stream').Stream
    -var abbrev = require('abbrev')
    -var os = require('os')
    +// This is the version of nopt's API that requires setting typeDefs and invalidHandler
    +// on the required `nopt` object since it is a singleton. To not do a breaking change
    +// an API that requires all options be passed in is located in `nopt-lib.js` and
    +// exported here as lib.
    +// TODO(breaking): make API only work in non-singleton mode
     
     module.exports = exports = nopt
     exports.clean = clean
    -
    -exports.typeDefs =
    -  { String: { type: String, validate: validateString },
    -    Boolean: { type: Boolean, validate: validateBoolean },
    -    url: { type: url, validate: validateUrl },
    -    Number: { type: Number, validate: validateNumber },
    -    path: { type: path, validate: validatePath },
    -    Stream: { type: Stream, validate: validateStream },
    -    Date: { type: Date, validate: validateDate },
    -  }
    -
    -function nopt (types, shorthands, args, slice) {
    -  args = args || process.argv
    -  types = types || {}
    -  shorthands = shorthands || {}
    -  if (typeof slice !== 'number') {
    -    slice = 2
    -  }
    -
    -  debug(types, shorthands, args, slice)
    -
    -  args = args.slice(slice)
    -  var data = {}
    -  var argv = {
    -    remain: [],
    -    cooked: args,
    -    original: args.slice(0),
    -  }
    -
    -  parse(args, data, argv.remain, types, shorthands)
    -  // now data is full
    -  clean(data, types, exports.typeDefs)
    -  data.argv = argv
    -  Object.defineProperty(data.argv, 'toString', { value: function () {
    -    return this.original.map(JSON.stringify).join(' ')
    -  },
    -  enumerable: false })
    -  return data
    -}
    -
    -function clean (data, types, typeDefs) {
    -  typeDefs = typeDefs || exports.typeDefs
    -  var remove = {}
    -  var typeDefault = [false, true, null, String, Array]
    -
    -  Object.keys(data).forEach(function (k) {
    -    if (k === 'argv') {
    -      return
    -    }
    -    var val = data[k]
    -    var isArray = Array.isArray(val)
    -    var type = types[k]
    -    if (!isArray) {
    -      val = [val]
    -    }
    -    if (!type) {
    -      type = typeDefault
    -    }
    -    if (type === Array) {
    -      type = typeDefault.concat(Array)
    -    }
    -    if (!Array.isArray(type)) {
    -      type = [type]
    -    }
    -
    -    debug('val=%j', val)
    -    debug('types=', type)
    -    val = val.map(function (v) {
    -      // if it's an unknown value, then parse false/true/null/numbers/dates
    -      if (typeof v === 'string') {
    -        debug('string %j', v)
    -        v = v.trim()
    -        if ((v === 'null' && ~type.indexOf(null))
    -            || (v === 'true' &&
    -               (~type.indexOf(true) || ~type.indexOf(Boolean)))
    -            || (v === 'false' &&
    -               (~type.indexOf(false) || ~type.indexOf(Boolean)))) {
    -          v = JSON.parse(v)
    -          debug('jsonable %j', v)
    -        } else if (~type.indexOf(Number) && !isNaN(v)) {
    -          debug('convert to number', v)
    -          v = +v
    -        } else if (~type.indexOf(Date) && !isNaN(Date.parse(v))) {
    -          debug('convert to date', v)
    -          v = new Date(v)
    -        }
    -      }
    -
    -      if (!Object.prototype.hasOwnProperty.call(types, k)) {
    -        return v
    -      }
    -
    -      // allow `--no-blah` to set 'blah' to null if null is allowed
    -      if (v === false && ~type.indexOf(null) &&
    -          !(~type.indexOf(false) || ~type.indexOf(Boolean))) {
    -        v = null
    -      }
    -
    -      var d = {}
    -      d[k] = v
    -      debug('prevalidated val', d, v, types[k])
    -      if (!validate(d, k, v, types[k], typeDefs)) {
    -        if (exports.invalidHandler) {
    -          exports.invalidHandler(k, v, types[k], data)
    -        } else if (exports.invalidHandler !== false) {
    -          debug('invalid: ' + k + '=' + v, types[k])
    -        }
    -        return remove
    -      }
    -      debug('validated v', d, v, types[k])
    -      return d[k]
    -    }).filter(function (v) {
    -      return v !== remove
    -    })
    -
    -    // if we allow Array specifically, then an empty array is how we
    -    // express 'no value here', not null.  Allow it.
    -    if (!val.length && type.indexOf(Array) === -1) {
    -      debug('VAL HAS NO LENGTH, DELETE IT', val, k, type.indexOf(Array))
    -      delete data[k]
    -    } else if (isArray) {
    -      debug(isArray, data[k], val)
    -      data[k] = val
    -    } else {
    -      data[k] = val[0]
    -    }
    -
    -    debug('k=%s val=%j', k, val, data[k])
    +exports.typeDefs = defaultTypeDefs
    +exports.lib = lib
    +
    +function nopt (types = {}, shorthands = {}, args = process.argv, slice = 2) {
    +  return lib.nopt(args.slice(slice), {
    +    types,
    +    shorthands: shorthands || {},
    +    typeDefs: exports.typeDefs,
    +    invalidHandler: exports.invalidHandler,
       })
     }
     
    -function validateString (data, k, val) {
    -  data[k] = String(val)
    -}
    -
    -function validatePath (data, k, val) {
    -  if (val === true) {
    -    return false
    -  }
    -  if (val === null) {
    -    return true
    -  }
    -
    -  val = String(val)
    -
    -  var isWin = process.platform === 'win32'
    -  var homePattern = isWin ? /^~(\/|\\)/ : /^~\//
    -  var home = os.homedir()
    -
    -  if (home && val.match(homePattern)) {
    -    data[k] = path.resolve(home, val.slice(2))
    -  } else {
    -    data[k] = path.resolve(val)
    -  }
    -  return true
    -}
    -
    -function validateNumber (data, k, val) {
    -  debug('validate Number %j %j %j', k, val, isNaN(val))
    -  if (isNaN(val)) {
    -    return false
    -  }
    -  data[k] = +val
    -}
    -
    -function validateDate (data, k, val) {
    -  var s = Date.parse(val)
    -  debug('validate Date %j %j %j', k, val, s)
    -  if (isNaN(s)) {
    -    return false
    -  }
    -  data[k] = new Date(val)
    -}
    -
    -function validateBoolean (data, k, val) {
    -  if (val instanceof Boolean) {
    -    val = val.valueOf()
    -  } else if (typeof val === 'string') {
    -    if (!isNaN(val)) {
    -      val = !!(+val)
    -    } else if (val === 'null' || val === 'false') {
    -      val = false
    -    } else {
    -      val = true
    -    }
    -  } else {
    -    val = !!val
    -  }
    -  data[k] = val
    -}
    -
    -function validateUrl (data, k, val) {
    -  // Changing this would be a breaking change in the npm cli
    -  /* eslint-disable-next-line node/no-deprecated-api */
    -  val = url.parse(String(val))
    -  if (!val.host) {
    -    return false
    -  }
    -  data[k] = val.href
    -}
    -
    -function validateStream (data, k, val) {
    -  if (!(val instanceof Stream)) {
    -    return false
    -  }
    -  data[k] = val
    -}
    -
    -function validate (data, k, val, type, typeDefs) {
    -  // arrays are lists of types.
    -  if (Array.isArray(type)) {
    -    for (let i = 0, l = type.length; i < l; i++) {
    -      if (type[i] === Array) {
    -        continue
    -      }
    -      if (validate(data, k, val, type[i], typeDefs)) {
    -        return true
    -      }
    -    }
    -    delete data[k]
    -    return false
    -  }
    -
    -  // an array of anything?
    -  if (type === Array) {
    -    return true
    -  }
    -
    -  // Original comment:
    -  // NaN is poisonous.  Means that something is not allowed.
    -  // New comment: Changing this to an isNaN check breaks a lot of tests.
    -  // Something is being assumed here that is not actually what happens in
    -  // practice.  Fixing it is outside the scope of getting linting to pass in
    -  // this repo. Leaving as-is for now.
    -  /* eslint-disable-next-line no-self-compare */
    -  if (type !== type) {
    -    debug('Poison NaN', k, val, type)
    -    delete data[k]
    -    return false
    -  }
    -
    -  // explicit list of values
    -  if (val === type) {
    -    debug('Explicitly allowed %j', val)
    -    // if (isArray) (data[k] = data[k] || []).push(val)
    -    // else data[k] = val
    -    data[k] = val
    -    return true
    -  }
    -
    -  // now go through the list of typeDefs, validate against each one.
    -  var ok = false
    -  var types = Object.keys(typeDefs)
    -  for (let i = 0, l = types.length; i < l; i++) {
    -    debug('test type %j %j %j', k, val, types[i])
    -    var t = typeDefs[types[i]]
    -    if (t && (
    -      (type && type.name && t.type && t.type.name) ?
    -        (type.name === t.type.name) :
    -        (type === t.type)
    -    )) {
    -      var d = {}
    -      ok = t.validate(d, k, val) !== false
    -      val = d[k]
    -      if (ok) {
    -        // if (isArray) (data[k] = data[k] || []).push(val)
    -        // else data[k] = val
    -        data[k] = val
    -        break
    -      }
    -    }
    -  }
    -  debug('OK? %j (%j %j %j)', ok, k, val, types[types.length - 1])
    -
    -  if (!ok) {
    -    delete data[k]
    -  }
    -  return ok
    -}
    -
    -function parse (args, data, remain, types, shorthands) {
    -  debug('parse', args, data, remain)
    -
    -  var abbrevs = abbrev(Object.keys(types))
    -  var shortAbbr = abbrev(Object.keys(shorthands))
    -
    -  for (var i = 0; i < args.length; i++) {
    -    var arg = args[i]
    -    debug('arg', arg)
    -
    -    if (arg.match(/^-{2,}$/)) {
    -      // done with keys.
    -      // the rest are args.
    -      remain.push.apply(remain, args.slice(i + 1))
    -      args[i] = '--'
    -      break
    -    }
    -    var hadEq = false
    -    if (arg.charAt(0) === '-' && arg.length > 1) {
    -      var at = arg.indexOf('=')
    -      if (at > -1) {
    -        hadEq = true
    -        var v = arg.slice(at + 1)
    -        arg = arg.slice(0, at)
    -        args.splice(i, 1, arg, v)
    -      }
    -
    -      // see if it's a shorthand
    -      // if so, splice and back up to re-parse it.
    -      var shRes = resolveShort(arg, shorthands, shortAbbr, abbrevs)
    -      debug('arg=%j shRes=%j', arg, shRes)
    -      if (shRes) {
    -        debug(arg, shRes)
    -        args.splice.apply(args, [i, 1].concat(shRes))
    -        if (arg !== shRes[0]) {
    -          i--
    -          continue
    -        }
    -      }
    -      arg = arg.replace(/^-+/, '')
    -      var no = null
    -      while (arg.toLowerCase().indexOf('no-') === 0) {
    -        no = !no
    -        arg = arg.slice(3)
    -      }
    -
    -      if (abbrevs[arg]) {
    -        arg = abbrevs[arg]
    -      }
    -
    -      var argType = types[arg]
    -      var isTypeArray = Array.isArray(argType)
    -      if (isTypeArray && argType.length === 1) {
    -        isTypeArray = false
    -        argType = argType[0]
    -      }
    -
    -      var isArray = argType === Array ||
    -        isTypeArray && argType.indexOf(Array) !== -1
    -
    -      // allow unknown things to be arrays if specified multiple times.
    -      if (
    -        !Object.prototype.hasOwnProperty.call(types, arg) &&
    -        Object.prototype.hasOwnProperty.call(data, arg)
    -      ) {
    -        if (!Array.isArray(data[arg])) {
    -          data[arg] = [data[arg]]
    -        }
    -        isArray = true
    -      }
    -
    -      var val
    -      var la = args[i + 1]
    -
    -      var isBool = typeof no === 'boolean' ||
    -        argType === Boolean ||
    -        isTypeArray && argType.indexOf(Boolean) !== -1 ||
    -        (typeof argType === 'undefined' && !hadEq) ||
    -        (la === 'false' &&
    -         (argType === null ||
    -          isTypeArray && ~argType.indexOf(null)))
    -
    -      if (isBool) {
    -        // just set and move along
    -        val = !no
    -        // however, also support --bool true or --bool false
    -        if (la === 'true' || la === 'false') {
    -          val = JSON.parse(la)
    -          la = null
    -          if (no) {
    -            val = !val
    -          }
    -          i++
    -        }
    -
    -        // also support "foo":[Boolean, "bar"] and "--foo bar"
    -        if (isTypeArray && la) {
    -          if (~argType.indexOf(la)) {
    -            // an explicit type
    -            val = la
    -            i++
    -          } else if (la === 'null' && ~argType.indexOf(null)) {
    -            // null allowed
    -            val = null
    -            i++
    -          } else if (!la.match(/^-{2,}[^-]/) &&
    -                      !isNaN(la) &&
    -                      ~argType.indexOf(Number)) {
    -            // number
    -            val = +la
    -            i++
    -          } else if (!la.match(/^-[^-]/) && ~argType.indexOf(String)) {
    -            // string
    -            val = la
    -            i++
    -          }
    -        }
    -
    -        if (isArray) {
    -          (data[arg] = data[arg] || []).push(val)
    -        } else {
    -          data[arg] = val
    -        }
    -
    -        continue
    -      }
    -
    -      if (argType === String) {
    -        if (la === undefined) {
    -          la = ''
    -        } else if (la.match(/^-{1,2}[^-]+/)) {
    -          la = ''
    -          i--
    -        }
    -      }
    -
    -      if (la && la.match(/^-{2,}$/)) {
    -        la = undefined
    -        i--
    -      }
    -
    -      val = la === undefined ? true : la
    -      if (isArray) {
    -        (data[arg] = data[arg] || []).push(val)
    -      } else {
    -        data[arg] = val
    -      }
    -
    -      i++
    -      continue
    -    }
    -    remain.push(arg)
    -  }
    -}
    -
    -function resolveShort (arg, shorthands, shortAbbr, abbrevs) {
    -  // handle single-char shorthands glommed together, like
    -  // npm ls -glp, but only if there is one dash, and only if
    -  // all of the chars are single-char shorthands, and it's
    -  // not a match to some other abbrev.
    -  arg = arg.replace(/^-+/, '')
    -
    -  // if it's an exact known option, then don't go any further
    -  if (abbrevs[arg] === arg) {
    -    return null
    -  }
    -
    -  // if it's an exact known shortopt, same deal
    -  if (shorthands[arg]) {
    -    // make it an array, if it's a list of words
    -    if (shorthands[arg] && !Array.isArray(shorthands[arg])) {
    -      shorthands[arg] = shorthands[arg].split(/\s+/)
    -    }
    -
    -    return shorthands[arg]
    -  }
    -
    -  // first check to see if this arg is a set of single-char shorthands
    -  var singles = shorthands.___singles
    -  if (!singles) {
    -    singles = Object.keys(shorthands).filter(function (s) {
    -      return s.length === 1
    -    }).reduce(function (l, r) {
    -      l[r] = true
    -      return l
    -    }, {})
    -    shorthands.___singles = singles
    -    debug('shorthand singles', singles)
    -  }
    -
    -  var chrs = arg.split('').filter(function (c) {
    -    return singles[c]
    +function clean (data, types, typeDefs = exports.typeDefs) {
    +  return lib.clean(data, {
    +    types,
    +    typeDefs,
    +    invalidHandler: exports.invalidHandler,
       })
    -
    -  if (chrs.join('') === arg) {
    -    return chrs.map(function (c) {
    -      return shorthands[c]
    -    }).reduce(function (l, r) {
    -      return l.concat(r)
    -    }, [])
    -  }
    -
    -  // if it's an arg abbrev, and not a literal shorthand, then prefer the arg
    -  if (abbrevs[arg] && !shorthands[arg]) {
    -    return null
    -  }
    -
    -  // if it's an abbr for a shorthand, then use that
    -  if (shortAbbr[arg]) {
    -    arg = shortAbbr[arg]
    -  }
    -
    -  // make it an array, if it's a list of words
    -  if (shorthands[arg] && !Array.isArray(shorthands[arg])) {
    -    shorthands[arg] = shorthands[arg].split(/\s+/)
    -  }
    -
    -  return shorthands[arg]
     }
    diff --git a/deps/npm/node_modules/nopt/lib/type-defs.js b/deps/npm/node_modules/nopt/lib/type-defs.js
    new file mode 100644
    index 00000000000000..6acf5e0a5b9d46
    --- /dev/null
    +++ b/deps/npm/node_modules/nopt/lib/type-defs.js
    @@ -0,0 +1,91 @@
    +var url = require('url')
    +var path = require('path')
    +var Stream = require('stream').Stream
    +var os = require('os')
    +const debug = require('./debug')
    +
    +function validateString (data, k, val) {
    +  data[k] = String(val)
    +}
    +
    +function validatePath (data, k, val) {
    +  if (val === true) {
    +    return false
    +  }
    +  if (val === null) {
    +    return true
    +  }
    +
    +  val = String(val)
    +
    +  var isWin = process.platform === 'win32'
    +  var homePattern = isWin ? /^~(\/|\\)/ : /^~\//
    +  var home = os.homedir()
    +
    +  if (home && val.match(homePattern)) {
    +    data[k] = path.resolve(home, val.slice(2))
    +  } else {
    +    data[k] = path.resolve(val)
    +  }
    +  return true
    +}
    +
    +function validateNumber (data, k, val) {
    +  debug('validate Number %j %j %j', k, val, isNaN(val))
    +  if (isNaN(val)) {
    +    return false
    +  }
    +  data[k] = +val
    +}
    +
    +function validateDate (data, k, val) {
    +  var s = Date.parse(val)
    +  debug('validate Date %j %j %j', k, val, s)
    +  if (isNaN(s)) {
    +    return false
    +  }
    +  data[k] = new Date(val)
    +}
    +
    +function validateBoolean (data, k, val) {
    +  if (typeof val === 'string') {
    +    if (!isNaN(val)) {
    +      val = !!(+val)
    +    } else if (val === 'null' || val === 'false') {
    +      val = false
    +    } else {
    +      val = true
    +    }
    +  } else {
    +    val = !!val
    +  }
    +  data[k] = val
    +}
    +
    +function validateUrl (data, k, val) {
    +  // Changing this would be a breaking change in the npm cli
    +  /* eslint-disable-next-line node/no-deprecated-api */
    +  val = url.parse(String(val))
    +  if (!val.host) {
    +    return false
    +  }
    +  data[k] = val.href
    +}
    +
    +function validateStream (data, k, val) {
    +  if (!(val instanceof Stream)) {
    +    return false
    +  }
    +  data[k] = val
    +}
    +
    +module.exports = {
    +  String: { type: String, validate: validateString },
    +  Boolean: { type: Boolean, validate: validateBoolean },
    +  url: { type: url, validate: validateUrl },
    +  Number: { type: Number, validate: validateNumber },
    +  path: { type: path, validate: validatePath },
    +  Stream: { type: Stream, validate: validateStream },
    +  Date: { type: Date, validate: validateDate },
    +  Array: { type: Array },
    +}
    diff --git a/deps/npm/node_modules/nopt/package.json b/deps/npm/node_modules/nopt/package.json
    index f12fb3374b322a..a61cae4535f880 100644
    --- a/deps/npm/node_modules/nopt/package.json
    +++ b/deps/npm/node_modules/nopt/package.json
    @@ -1,6 +1,6 @@
     {
       "name": "nopt",
    -  "version": "7.0.0",
    +  "version": "7.1.0",
       "description": "Option parsing for Node, supporting types, shorthands, etc. Used by npm.",
       "author": "GitHub Inc.",
       "main": "lib/nopt.js",
    @@ -26,14 +26,13 @@
       },
       "devDependencies": {
         "@npmcli/eslint-config": "^4.0.0",
    -    "@npmcli/template-oss": "4.8.0",
    +    "@npmcli/template-oss": "4.12.0",
         "tap": "^16.3.0"
       },
       "tap": {
    -    "lines": 87,
    -    "functions": 91,
    -    "branches": 81,
    -    "statements": 87,
    +    "lines": 91,
    +    "branches": 87,
    +    "statements": 91,
         "nyc-arg": [
           "--exclude",
           "tap-snapshots/**"
    @@ -49,6 +48,6 @@
       "templateOSS": {
         "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
         "windowsCI": false,
    -    "version": "4.8.0"
    +    "version": "4.12.0"
       }
     }
    diff --git a/deps/npm/node_modules/npm-install-checks/lib/index.js b/deps/npm/node_modules/npm-install-checks/lib/index.js
    index 728e8cf3f86826..37530bb52d19a4 100644
    --- a/deps/npm/node_modules/npm-install-checks/lib/index.js
    +++ b/deps/npm/node_modules/npm-install-checks/lib/index.js
    @@ -20,6 +20,8 @@ const checkEngine = (target, npmVer, nodeVer, force = false) => {
       }
     }
     
    +const isMusl = (file) => file.includes('libc.musl-') || file.includes('ld-musl-')
    +
     const checkPlatform = (target, force = false) => {
       if (force) {
         return
    @@ -30,16 +32,35 @@ const checkPlatform = (target, force = false) => {
       const osOk = target.os ? checkList(platform, target.os) : true
       const cpuOk = target.cpu ? checkList(arch, target.cpu) : true
     
    -  if (!osOk || !cpuOk) {
    +  let libcOk = true
    +  let libcFamily = null
    +  if (target.libc) {
    +    // libc checks only work in linux, any value is a failure if we aren't
    +    if (platform !== 'linux') {
    +      libcOk = false
    +    } else {
    +      const report = process.report.getReport()
    +      if (report.header?.glibcRuntimeVersion) {
    +        libcFamily = 'glibc'
    +      } else if (Array.isArray(report.sharedObjects) && report.sharedObjects.some(isMusl)) {
    +        libcFamily = 'musl'
    +      }
    +      libcOk = libcFamily ? checkList(libcFamily, target.libc) : false
    +    }
    +  }
    +
    +  if (!osOk || !cpuOk || !libcOk) {
         throw Object.assign(new Error('Unsupported platform'), {
           pkgid: target._id,
           current: {
             os: platform,
             cpu: arch,
    +        libc: libcFamily,
           },
           required: {
             os: target.os,
             cpu: target.cpu,
    +        libc: target.libc,
           },
           code: 'EBADPLATFORM',
         })
    diff --git a/deps/npm/node_modules/npm-install-checks/package.json b/deps/npm/node_modules/npm-install-checks/package.json
    index 1003b107763d96..d9304ebf2a284d 100644
    --- a/deps/npm/node_modules/npm-install-checks/package.json
    +++ b/deps/npm/node_modules/npm-install-checks/package.json
    @@ -1,14 +1,14 @@
     {
       "name": "npm-install-checks",
    -  "version": "6.0.0",
    +  "version": "6.1.0",
       "description": "Check the engines and platform fields in package.json",
       "main": "lib/index.js",
       "dependencies": {
         "semver": "^7.1.1"
       },
       "devDependencies": {
    -    "@npmcli/eslint-config": "^3.0.1",
    -    "@npmcli/template-oss": "4.5.1",
    +    "@npmcli/eslint-config": "^4.0.0",
    +    "@npmcli/template-oss": "4.12.0",
         "tap": "^16.0.1"
       },
       "scripts": {
    @@ -39,7 +39,7 @@
       "author": "GitHub Inc.",
       "templateOSS": {
         "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
    -    "version": "4.5.1"
    +    "version": "4.12.0"
       },
       "tap": {
         "nyc-arg": [
    diff --git a/deps/npm/node_modules/p-map/index.d.ts b/deps/npm/node_modules/p-map/index.d.ts
    deleted file mode 100644
    index bcbe0afcee88d9..00000000000000
    --- a/deps/npm/node_modules/p-map/index.d.ts
    +++ /dev/null
    @@ -1,67 +0,0 @@
    -declare namespace pMap {
    -	interface Options {
    -		/**
    -		Number of concurrently pending promises returned by `mapper`.
    -
    -		Must be an integer from 1 and up or `Infinity`.
    -
    -		@default Infinity
    -		*/
    -		readonly concurrency?: number;
    -
    -		/**
    -		When set to `false`, instead of stopping when a promise rejects, it will wait for all the promises to settle and then reject with an [aggregated error](https://github.com/sindresorhus/aggregate-error) containing all the errors from the rejected promises.
    -
    -		@default true
    -		*/
    -		readonly stopOnError?: boolean;
    -	}
    -
    -	/**
    -	Function which is called for every item in `input`. Expected to return a `Promise` or value.
    -
    -	@param element - Iterated element.
    -	@param index - Index of the element in the source array.
    -	*/
    -	type Mapper = (
    -		element: Element,
    -		index: number
    -	) => NewElement | Promise;
    -}
    -
    -/**
    -@param input - Iterated over concurrently in the `mapper` function.
    -@param mapper - Function which is called for every item in `input`. Expected to return a `Promise` or value.
    -@returns A `Promise` that is fulfilled when all promises in `input` and ones returned from `mapper` are fulfilled, or rejects if any of the promises reject. The fulfilled value is an `Array` of the fulfilled values returned from `mapper` in `input` order.
    -
    -@example
    -```
    -import pMap = require('p-map');
    -import got = require('got');
    -
    -const sites = [
    -	getWebsiteFromUsername('https://sindresorhus'), //=> Promise
    -	'https://ava.li',
    -	'https://github.com'
    -];
    -
    -(async () => {
    -	const mapper = async site => {
    -		const {requestUrl} = await got.head(site);
    -		return requestUrl;
    -	};
    -
    -	const result = await pMap(sites, mapper, {concurrency: 2});
    -
    -	console.log(result);
    -	//=> ['https://sindresorhus.com/', 'https://ava.li/', 'https://github.com/']
    -})();
    -```
    -*/
    -declare function pMap(
    -	input: Iterable,
    -	mapper: pMap.Mapper,
    -	options?: pMap.Options
    -): Promise;
    -
    -export = pMap;
    diff --git a/deps/npm/node_modules/parse-conflict-json/package.json b/deps/npm/node_modules/parse-conflict-json/package.json
    index 7b86df89edb398..32584d3e6401b3 100644
    --- a/deps/npm/node_modules/parse-conflict-json/package.json
    +++ b/deps/npm/node_modules/parse-conflict-json/package.json
    @@ -1,6 +1,6 @@
     {
       "name": "parse-conflict-json",
    -  "version": "3.0.0",
    +  "version": "3.0.1",
       "description": "Parse a JSON string that has git merge conflicts, resolving if possible",
       "author": "GitHub Inc.",
       "license": "ISC",
    @@ -22,13 +22,13 @@
         ]
       },
       "devDependencies": {
    -    "@npmcli/eslint-config": "^3.0.1",
    -    "@npmcli/template-oss": "4.5.1",
    +    "@npmcli/eslint-config": "^4.0.0",
    +    "@npmcli/template-oss": "4.12.0",
         "tap": "^16.0.1"
       },
       "dependencies": {
         "json-parse-even-better-errors": "^3.0.0",
    -    "just-diff": "^5.0.1",
    +    "just-diff": "^6.0.0",
         "just-diff-apply": "^5.2.0"
       },
       "repository": {
    @@ -44,6 +44,6 @@
       },
       "templateOSS": {
         "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
    -    "version": "4.5.1"
    +    "version": "4.12.0"
       }
     }
    diff --git a/deps/npm/node_modules/path-scurry/LICENSE.md b/deps/npm/node_modules/path-scurry/LICENSE.md
    new file mode 100644
    index 00000000000000..c5402b9577a8cd
    --- /dev/null
    +++ b/deps/npm/node_modules/path-scurry/LICENSE.md
    @@ -0,0 +1,55 @@
    +# Blue Oak Model License
    +
    +Version 1.0.0
    +
    +## Purpose
    +
    +This license gives everyone as much permission to work with
    +this software as possible, while protecting contributors
    +from liability.
    +
    +## Acceptance
    +
    +In order to receive this license, you must agree to its
    +rules.  The rules of this license are both obligations
    +under that agreement and conditions to your license.
    +You must not do anything with this software that triggers
    +a rule that you cannot or will not follow.
    +
    +## Copyright
    +
    +Each contributor licenses you to do everything with this
    +software that would otherwise infringe that contributor's
    +copyright in it.
    +
    +## Notices
    +
    +You must ensure that everyone who gets a copy of
    +any part of this software from you, with or without
    +changes, also gets the text of this license or a link to
    +.
    +
    +## Excuse
    +
    +If anyone notifies you in writing that you have not
    +complied with [Notices](#notices), you can keep your
    +license by taking all practical steps to comply within 30
    +days after the notice.  If you do not do so, your license
    +ends immediately.
    +
    +## Patent
    +
    +Each contributor licenses you to do everything with this
    +software that would otherwise infringe any patent claims
    +they can license or become able to license.
    +
    +## Reliability
    +
    +No contributor can revoke this license.
    +
    +## No Liability
    +
    +***As far as the law allows, this software comes as is,
    +without any warranty or condition, and no contributor
    +will be liable to anyone for any damages related to this
    +software or this license, under any kind of legal claim.***
    diff --git a/deps/npm/node_modules/path-scurry/dist/cjs/index.js b/deps/npm/node_modules/path-scurry/dist/cjs/index.js
    new file mode 100644
    index 00000000000000..54901bd8ae578c
    --- /dev/null
    +++ b/deps/npm/node_modules/path-scurry/dist/cjs/index.js
    @@ -0,0 +1,1865 @@
    +"use strict";
    +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    +    if (k2 === undefined) k2 = k;
    +    var desc = Object.getOwnPropertyDescriptor(m, k);
    +    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
    +      desc = { enumerable: true, get: function() { return m[k]; } };
    +    }
    +    Object.defineProperty(o, k2, desc);
    +}) : (function(o, m, k, k2) {
    +    if (k2 === undefined) k2 = k;
    +    o[k2] = m[k];
    +}));
    +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    +    Object.defineProperty(o, "default", { enumerable: true, value: v });
    +}) : function(o, v) {
    +    o["default"] = v;
    +});
    +var __importStar = (this && this.__importStar) || function (mod) {
    +    if (mod && mod.__esModule) return mod;
    +    var result = {};
    +    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    +    __setModuleDefault(result, mod);
    +    return result;
    +};
    +var __importDefault = (this && this.__importDefault) || function (mod) {
    +    return (mod && mod.__esModule) ? mod : { "default": mod };
    +};
    +Object.defineProperty(exports, "__esModule", { value: true });
    +exports.PathScurry = exports.Path = exports.PathScurryDarwin = exports.PathScurryPosix = exports.PathScurryWin32 = exports.PathScurryBase = exports.PathPosix = exports.PathWin32 = exports.PathBase = exports.ChildrenCache = exports.ResolveCache = void 0;
    +const lru_cache_1 = __importDefault(require("lru-cache"));
    +const path_1 = require("path");
    +const url_1 = require("url");
    +const actualFS = __importStar(require("fs"));
    +const fs_1 = require("fs");
    +const realpathSync = fs_1.realpathSync.native;
    +// TODO: test perf of fs/promises realpath vs realpathCB,
    +// since the promises one uses realpath.native
    +const promises_1 = require("fs/promises");
    +const minipass_1 = __importDefault(require("minipass"));
    +const defaultFS = {
    +    lstatSync: fs_1.lstatSync,
    +    readdir: fs_1.readdir,
    +    readdirSync: fs_1.readdirSync,
    +    readlinkSync: fs_1.readlinkSync,
    +    realpathSync,
    +    promises: {
    +        lstat: promises_1.lstat,
    +        readdir: promises_1.readdir,
    +        readlink: promises_1.readlink,
    +        realpath: promises_1.realpath,
    +    },
    +};
    +// if they just gave us require('fs') then use our default
    +const fsFromOption = (fsOption) => !fsOption || fsOption === defaultFS || fsOption === actualFS
    +    ? defaultFS
    +    : {
    +        ...defaultFS,
    +        ...fsOption,
    +        promises: {
    +            ...defaultFS.promises,
    +            ...(fsOption.promises || {}),
    +        },
    +    };
    +// turn something like //?/c:/ into c:\
    +const uncDriveRegexp = /^\\\\\?\\([a-z]:)\\?$/i;
    +const uncToDrive = (rootPath) => rootPath.replace(/\//g, '\\').replace(uncDriveRegexp, '$1\\');
    +// windows paths are separated by either / or \
    +const eitherSep = /[\\\/]/;
    +const UNKNOWN = 0; // may not even exist, for all we know
    +const IFIFO = 0b0001;
    +const IFCHR = 0b0010;
    +const IFDIR = 0b0100;
    +const IFBLK = 0b0110;
    +const IFREG = 0b1000;
    +const IFLNK = 0b1010;
    +const IFSOCK = 0b1100;
    +const IFMT = 0b1111;
    +// mask to unset low 4 bits
    +const IFMT_UNKNOWN = ~IFMT;
    +// set after successfully calling readdir() and getting entries.
    +const READDIR_CALLED = 16;
    +// set after a successful lstat()
    +const LSTAT_CALLED = 32;
    +// set if an entry (or one of its parents) is definitely not a dir
    +const ENOTDIR = 64;
    +// set if an entry (or one of its parents) does not exist
    +// (can also be set on lstat errors like EACCES or ENAMETOOLONG)
    +const ENOENT = 128;
    +// cannot have child entries -- also verify &IFMT is either IFDIR or IFLNK
    +// set if we fail to readlink
    +const ENOREADLINK = 256;
    +// set if we know realpath() will fail
    +const ENOREALPATH = 512;
    +const ENOCHILD = ENOTDIR | ENOENT | ENOREALPATH;
    +const TYPEMASK = 1023;
    +const entToType = (s) => s.isFile()
    +    ? IFREG
    +    : s.isDirectory()
    +        ? IFDIR
    +        : s.isSymbolicLink()
    +            ? IFLNK
    +            : s.isCharacterDevice()
    +                ? IFCHR
    +                : s.isBlockDevice()
    +                    ? IFBLK
    +                    : s.isSocket()
    +                        ? IFSOCK
    +                        : s.isFIFO()
    +                            ? IFIFO
    +                            : UNKNOWN;
    +// normalize unicode path names
    +const normalizeCache = new Map();
    +const normalize = (s) => {
    +    const c = normalizeCache.get(s);
    +    if (c)
    +        return c;
    +    const n = s.normalize('NFKD');
    +    normalizeCache.set(s, n);
    +    return n;
    +};
    +const normalizeNocaseCache = new Map();
    +const normalizeNocase = (s) => {
    +    const c = normalizeNocaseCache.get(s);
    +    if (c)
    +        return c;
    +    const n = normalize(s.toLowerCase());
    +    normalizeNocaseCache.set(s, n);
    +    return n;
    +};
    +/**
    + * An LRUCache for storing resolved path strings or Path objects.
    + * @internal
    + */
    +class ResolveCache extends lru_cache_1.default {
    +    constructor() {
    +        super({ max: 256 });
    +    }
    +}
    +exports.ResolveCache = ResolveCache;
    +// In order to prevent blowing out the js heap by allocating hundreds of
    +// thousands of Path entries when walking extremely large trees, the "children"
    +// in this tree are represented by storing an array of Path entries in an
    +// LRUCache, indexed by the parent.  At any time, Path.children() may return an
    +// empty array, indicating that it doesn't know about any of its children, and
    +// thus has to rebuild that cache.  This is fine, it just means that we don't
    +// benefit as much from having the cached entries, but huge directory walks
    +// don't blow out the stack, and smaller ones are still as fast as possible.
    +//
    +//It does impose some complexity when building up the readdir data, because we
    +//need to pass a reference to the children array that we started with.
    +/**
    + * an LRUCache for storing child entries.
    + * @internal
    + */
    +class ChildrenCache extends lru_cache_1.default {
    +    constructor(maxSize = 16 * 1024) {
    +        super({
    +            maxSize,
    +            // parent + children
    +            sizeCalculation: a => a.length + 1,
    +        });
    +    }
    +}
    +exports.ChildrenCache = ChildrenCache;
    +/**
    + * Path objects are sort of like a super-powered
    + * {@link https://nodejs.org/docs/latest/api/fs.html#class-fsdirent fs.Dirent}
    + *
    + * Each one represents a single filesystem entry on disk, which may or may not
    + * exist. It includes methods for reading various types of information via
    + * lstat, readlink, and readdir, and caches all information to the greatest
    + * degree possible.
    + *
    + * Note that fs operations that would normally throw will instead return an
    + * "empty" value. This is in order to prevent excessive overhead from error
    + * stack traces.
    + */
    +class PathBase {
    +    /**
    +     * the basename of this path
    +     *
    +     * **Important**: *always* test the path name against any test string
    +     * usingthe {@link isNamed} method, and not by directly comparing this
    +     * string. Otherwise, unicode path strings that the system sees as identical
    +     * will not be properly treated as the same path, leading to incorrect
    +     * behavior and possible security issues.
    +     */
    +    name;
    +    /**
    +     * the Path entry corresponding to the path root.
    +     *
    +     * @internal
    +     */
    +    root;
    +    /**
    +     * All roots found within the current PathScurry family
    +     *
    +     * @internal
    +     */
    +    roots;
    +    /**
    +     * a reference to the parent path, or undefined in the case of root entries
    +     *
    +     * @internal
    +     */
    +    parent;
    +    /**
    +     * boolean indicating whether paths are compared case-insensitively
    +     * @internal
    +     */
    +    nocase;
    +    // potential default fs override
    +    #fs;
    +    // Stats fields
    +    #dev;
    +    get dev() {
    +        return this.#dev;
    +    }
    +    #mode;
    +    get mode() {
    +        return this.#mode;
    +    }
    +    #nlink;
    +    get nlink() {
    +        return this.#nlink;
    +    }
    +    #uid;
    +    get uid() {
    +        return this.#uid;
    +    }
    +    #gid;
    +    get gid() {
    +        return this.#gid;
    +    }
    +    #rdev;
    +    get rdev() {
    +        return this.#rdev;
    +    }
    +    #blksize;
    +    get blksize() {
    +        return this.#blksize;
    +    }
    +    #ino;
    +    get ino() {
    +        return this.#ino;
    +    }
    +    #size;
    +    get size() {
    +        return this.#size;
    +    }
    +    #blocks;
    +    get blocks() {
    +        return this.#blocks;
    +    }
    +    #atimeMs;
    +    get atimeMs() {
    +        return this.#atimeMs;
    +    }
    +    #mtimeMs;
    +    get mtimeMs() {
    +        return this.#mtimeMs;
    +    }
    +    #ctimeMs;
    +    get ctimeMs() {
    +        return this.#ctimeMs;
    +    }
    +    #birthtimeMs;
    +    get birthtimeMs() {
    +        return this.#birthtimeMs;
    +    }
    +    #atime;
    +    get atime() {
    +        return this.#atime;
    +    }
    +    #mtime;
    +    get mtime() {
    +        return this.#mtime;
    +    }
    +    #ctime;
    +    get ctime() {
    +        return this.#ctime;
    +    }
    +    #birthtime;
    +    get birthtime() {
    +        return this.#birthtime;
    +    }
    +    #matchName;
    +    #depth;
    +    #fullpath;
    +    #relative;
    +    #type;
    +    #children;
    +    #linkTarget;
    +    #realpath;
    +    /**
    +     * Do not create new Path objects directly.  They should always be accessed
    +     * via the PathScurry class or other methods on the Path class.
    +     *
    +     * @internal
    +     */
    +    constructor(name, type = UNKNOWN, root, roots, nocase, children, opts) {
    +        this.name = name;
    +        this.#matchName = nocase ? normalizeNocase(name) : normalize(name);
    +        this.#type = type & TYPEMASK;
    +        this.nocase = nocase;
    +        this.roots = roots;
    +        this.root = root || this;
    +        this.#children = children;
    +        this.#fullpath = opts.fullpath;
    +        this.#relative = opts.relative;
    +        this.parent = opts.parent;
    +        if (this.parent) {
    +            this.#fs = this.parent.#fs;
    +        }
    +        else {
    +            this.#fs = fsFromOption(opts.fs);
    +        }
    +    }
    +    /**
    +     * Returns the depth of the Path object from its root.
    +     *
    +     * For example, a path at `/foo/bar` would have a depth of 2.
    +     */
    +    depth() {
    +        if (this.#depth !== undefined)
    +            return this.#depth;
    +        if (!this.parent)
    +            return (this.#depth = 0);
    +        return (this.#depth = this.parent.depth() + 1);
    +    }
    +    /**
    +     * @internal
    +     */
    +    childrenCache() {
    +        return this.#children;
    +    }
    +    /**
    +     * Get the Path object referenced by the string path, resolved from this Path
    +     */
    +    resolve(path) {
    +        if (!path) {
    +            return this;
    +        }
    +        const rootPath = this.getRootString(path);
    +        const dir = path.substring(rootPath.length);
    +        const dirParts = dir.split(this.splitSep);
    +        const result = rootPath
    +            ? this.getRoot(rootPath).#resolveParts(dirParts)
    +            : this.#resolveParts(dirParts);
    +        return result;
    +    }
    +    #resolveParts(dirParts) {
    +        let p = this;
    +        for (const part of dirParts) {
    +            p = p.child(part);
    +        }
    +        return p;
    +    }
    +    /**
    +     * Returns the cached children Path objects, if still available.  If they
    +     * have fallen out of the cache, then returns an empty array, and resets the
    +     * READDIR_CALLED bit, so that future calls to readdir() will require an fs
    +     * lookup.
    +     *
    +     * @internal
    +     */
    +    children() {
    +        const cached = this.#children.get(this);
    +        if (cached) {
    +            return cached;
    +        }
    +        const children = Object.assign([], { provisional: 0 });
    +        this.#children.set(this, children);
    +        this.#type &= ~READDIR_CALLED;
    +        return children;
    +    }
    +    /**
    +     * Resolves a path portion and returns or creates the child Path.
    +     *
    +     * Returns `this` if pathPart is `''` or `'.'`, or `parent` if pathPart is
    +     * `'..'`.
    +     *
    +     * This should not be called directly.  If `pathPart` contains any path
    +     * separators, it will lead to unsafe undefined behavior.
    +     *
    +     * Use `Path.resolve()` instead.
    +     *
    +     * @internal
    +     */
    +    child(pathPart, opts) {
    +        if (pathPart === '' || pathPart === '.') {
    +            return this;
    +        }
    +        if (pathPart === '..') {
    +            return this.parent || this;
    +        }
    +        // find the child
    +        const children = this.children();
    +        const name = this.nocase
    +            ? normalizeNocase(pathPart)
    +            : normalize(pathPart);
    +        for (const p of children) {
    +            if (p.#matchName === name) {
    +                return p;
    +            }
    +        }
    +        // didn't find it, create provisional child, since it might not
    +        // actually exist.  If we know the parent isn't a dir, then
    +        // in fact it CAN'T exist.
    +        const s = this.parent ? this.sep : '';
    +        const fullpath = this.#fullpath
    +            ? this.#fullpath + s + pathPart
    +            : undefined;
    +        const pchild = this.newChild(pathPart, UNKNOWN, {
    +            ...opts,
    +            parent: this,
    +            fullpath,
    +        });
    +        if (!this.canReaddir()) {
    +            pchild.#type |= ENOENT;
    +        }
    +        // don't have to update provisional, because if we have real children,
    +        // then provisional is set to children.length, otherwise a lower number
    +        children.push(pchild);
    +        return pchild;
    +    }
    +    /**
    +     * The relative path from the cwd. If it does not share an ancestor with
    +     * the cwd, then this ends up being equivalent to the fullpath()
    +     */
    +    // TODO: instead of taking a param here, set it to '' in the constructor
    +    // for the CWD, and set it to this.name for any roots.
    +    relative() {
    +        if (this.#relative !== undefined) {
    +            return this.#relative;
    +        }
    +        const name = this.name;
    +        const p = this.parent;
    +        if (!p) {
    +            return (this.#relative = this.name);
    +        }
    +        const pv = p.relative();
    +        const rp = pv + (!pv || !p.parent ? '' : this.sep) + name;
    +        return (this.#relative = rp);
    +    }
    +    /**
    +     * The fully resolved path string for this Path entry
    +     */
    +    fullpath() {
    +        if (this.#fullpath !== undefined) {
    +            return this.#fullpath;
    +        }
    +        const name = this.name;
    +        const p = this.parent;
    +        if (!p) {
    +            return (this.#fullpath = this.name);
    +        }
    +        const pv = p.fullpath();
    +        const fp = pv + (!p.parent ? '' : this.sep) + name;
    +        return (this.#fullpath = fp);
    +    }
    +    /**
    +     * Is the Path of an unknown type?
    +     *
    +     * Note that we might know *something* about it if there has been a previous
    +     * filesystem operation, for example that it does not exist, or is not a
    +     * link, or whether it has child entries.
    +     */
    +    isUnknown() {
    +        return (this.#type & IFMT) === UNKNOWN;
    +    }
    +    /**
    +     * Is the Path a regular file?
    +     */
    +    isFile() {
    +        return (this.#type & IFMT) === IFREG;
    +    }
    +    /**
    +     * Is the Path a directory?
    +     */
    +    isDirectory() {
    +        return (this.#type & IFMT) === IFDIR;
    +    }
    +    /**
    +     * Is the path a character device?
    +     */
    +    isCharacterDevice() {
    +        return (this.#type & IFMT) === IFCHR;
    +    }
    +    /**
    +     * Is the path a block device?
    +     */
    +    isBlockDevice() {
    +        return (this.#type & IFMT) === IFBLK;
    +    }
    +    /**
    +     * Is the path a FIFO pipe?
    +     */
    +    isFIFO() {
    +        return (this.#type & IFMT) === IFIFO;
    +    }
    +    /**
    +     * Is the path a socket?
    +     */
    +    isSocket() {
    +        return (this.#type & IFMT) === IFSOCK;
    +    }
    +    /**
    +     * Is the path a symbolic link?
    +     */
    +    isSymbolicLink() {
    +        return (this.#type & IFLNK) === IFLNK;
    +    }
    +    /**
    +     * Return the entry if it has been subject of a successful lstat, or
    +     * undefined otherwise.
    +     *
    +     * Does not read the filesystem, so an undefined result *could* simply
    +     * mean that we haven't called lstat on it.
    +     */
    +    lstatCached() {
    +        return this.#type & LSTAT_CALLED ? this : undefined;
    +    }
    +    /**
    +     * Return the cached link target if the entry has been the subject of a
    +     * successful readlink, or undefined otherwise.
    +     *
    +     * Does not read the filesystem, so an undefined result *could* just mean we
    +     * don't have any cached data. Only use it if you are very sure that a
    +     * readlink() has been called at some point.
    +     */
    +    readlinkCached() {
    +        return this.#linkTarget;
    +    }
    +    /**
    +     * Returns the cached realpath target if the entry has been the subject
    +     * of a successful realpath, or undefined otherwise.
    +     *
    +     * Does not read the filesystem, so an undefined result *could* just mean we
    +     * don't have any cached data. Only use it if you are very sure that a
    +     * realpath() has been called at some point.
    +     */
    +    realpathCached() {
    +        return this.#realpath;
    +    }
    +    /**
    +     * Returns the cached child Path entries array if the entry has been the
    +     * subject of a successful readdir(), or [] otherwise.
    +     *
    +     * Does not read the filesystem, so an empty array *could* just mean we
    +     * don't have any cached data. Only use it if you are very sure that a
    +     * readdir() has been called recently enough to still be valid.
    +     */
    +    readdirCached() {
    +        const children = this.children();
    +        return children.slice(0, children.provisional);
    +    }
    +    /**
    +     * Return true if it's worth trying to readlink.  Ie, we don't (yet) have
    +     * any indication that readlink will definitely fail.
    +     *
    +     * Returns false if the path is known to not be a symlink, if a previous
    +     * readlink failed, or if the entry does not exist.
    +     */
    +    canReadlink() {
    +        if (this.#linkTarget)
    +            return true;
    +        if (!this.parent)
    +            return false;
    +        // cases where it cannot possibly succeed
    +        const ifmt = this.#type & IFMT;
    +        return !((ifmt !== UNKNOWN && ifmt !== IFLNK) ||
    +            this.#type & ENOREADLINK ||
    +            this.#type & ENOENT);
    +    }
    +    /**
    +     * Return true if readdir has previously been successfully called on this
    +     * path, indicating that cachedReaddir() is likely valid.
    +     */
    +    calledReaddir() {
    +        return !!(this.#type & READDIR_CALLED);
    +    }
    +    /**
    +     * Returns true if the path is known to not exist. That is, a previous lstat
    +     * or readdir failed to verify its existence when that would have been
    +     * expected, or a parent entry was marked either enoent or enotdir.
    +     */
    +    isENOENT() {
    +        return !!(this.#type & ENOENT);
    +    }
    +    /**
    +     * Return true if the path is a match for the given path name.  This handles
    +     * case sensitivity and unicode normalization.
    +     *
    +     * Note: even on case-sensitive systems, it is **not** safe to test the
    +     * equality of the `.name` property to determine whether a given pathname
    +     * matches, due to unicode normalization mismatches.
    +     *
    +     * Always use this method instead of testing the `path.name` property
    +     * directly.
    +     */
    +    isNamed(n) {
    +        return !this.nocase
    +            ? this.#matchName === normalize(n)
    +            : this.#matchName === normalizeNocase(n);
    +    }
    +    /**
    +     * Return the Path object corresponding to the target of a symbolic link.
    +     *
    +     * If the Path is not a symbolic link, or if the readlink call fails for any
    +     * reason, `undefined` is returned.
    +     *
    +     * Result is cached, and thus may be outdated if the filesystem is mutated.
    +     */
    +    async readlink() {
    +        const target = this.#linkTarget;
    +        if (target) {
    +            return target;
    +        }
    +        if (!this.canReadlink()) {
    +            return undefined;
    +        }
    +        /* c8 ignore start */
    +        // already covered by the canReadlink test, here for ts grumples
    +        if (!this.parent) {
    +            return undefined;
    +        }
    +        /* c8 ignore stop */
    +        try {
    +            const read = await this.#fs.promises.readlink(this.fullpath());
    +            const linkTarget = this.parent.resolve(read);
    +            if (linkTarget) {
    +                return (this.#linkTarget = linkTarget);
    +            }
    +        }
    +        catch (er) {
    +            this.#readlinkFail(er.code);
    +            return undefined;
    +        }
    +    }
    +    /**
    +     * Synchronous {@link PathBase.readlink}
    +     */
    +    readlinkSync() {
    +        const target = this.#linkTarget;
    +        if (target) {
    +            return target;
    +        }
    +        if (!this.canReadlink()) {
    +            return undefined;
    +        }
    +        /* c8 ignore start */
    +        // already covered by the canReadlink test, here for ts grumples
    +        if (!this.parent) {
    +            return undefined;
    +        }
    +        /* c8 ignore stop */
    +        try {
    +            const read = this.#fs.readlinkSync(this.fullpath());
    +            const linkTarget = this.parent.resolve(read);
    +            if (linkTarget) {
    +                return (this.#linkTarget = linkTarget);
    +            }
    +        }
    +        catch (er) {
    +            this.#readlinkFail(er.code);
    +            return undefined;
    +        }
    +    }
    +    #readdirSuccess(children) {
    +        // succeeded, mark readdir called bit
    +        this.#type |= READDIR_CALLED;
    +        // mark all remaining provisional children as ENOENT
    +        for (let p = children.provisional; p < children.length; p++) {
    +            children[p].#markENOENT();
    +        }
    +    }
    +    #markENOENT() {
    +        // mark as UNKNOWN and ENOENT
    +        if (this.#type & ENOENT)
    +            return;
    +        this.#type = (this.#type | ENOENT) & IFMT_UNKNOWN;
    +        this.#markChildrenENOENT();
    +    }
    +    #markChildrenENOENT() {
    +        // all children are provisional and do not exist
    +        const children = this.children();
    +        children.provisional = 0;
    +        for (const p of children) {
    +            p.#markENOENT();
    +        }
    +    }
    +    #markENOREALPATH() {
    +        this.#type |= ENOREALPATH;
    +        this.#markENOTDIR();
    +    }
    +    // save the information when we know the entry is not a dir
    +    #markENOTDIR() {
    +        // entry is not a directory, so any children can't exist.
    +        // this *should* be impossible, since any children created
    +        // after it's been marked ENOTDIR should be marked ENOENT,
    +        // so it won't even get to this point.
    +        /* c8 ignore start */
    +        if (this.#type & ENOTDIR)
    +            return;
    +        /* c8 ignore stop */
    +        let t = this.#type;
    +        // this could happen if we stat a dir, then delete it,
    +        // then try to read it or one of its children.
    +        if ((t & IFMT) === IFDIR)
    +            t &= IFMT_UNKNOWN;
    +        this.#type = t | ENOTDIR;
    +        this.#markChildrenENOENT();
    +    }
    +    #readdirFail(code = '') {
    +        // markENOTDIR and markENOENT also set provisional=0
    +        if (code === 'ENOTDIR' || code === 'EPERM') {
    +            this.#markENOTDIR();
    +        }
    +        else if (code === 'ENOENT') {
    +            this.#markENOENT();
    +        }
    +        else {
    +            this.children().provisional = 0;
    +        }
    +    }
    +    #lstatFail(code = '') {
    +        // Windows just raises ENOENT in this case, disable for win CI
    +        /* c8 ignore start */
    +        if (code === 'ENOTDIR') {
    +            // already know it has a parent by this point
    +            const p = this.parent;
    +            p.#markENOTDIR();
    +        }
    +        else if (code === 'ENOENT') {
    +            /* c8 ignore stop */
    +            this.#markENOENT();
    +        }
    +    }
    +    #readlinkFail(code = '') {
    +        let ter = this.#type;
    +        ter |= ENOREADLINK;
    +        if (code === 'ENOENT')
    +            ter |= ENOENT;
    +        // windows gets a weird error when you try to readlink a file
    +        if (code === 'EINVAL' || code === 'UNKNOWN') {
    +            // exists, but not a symlink, we don't know WHAT it is, so remove
    +            // all IFMT bits.
    +            ter &= IFMT_UNKNOWN;
    +        }
    +        this.#type = ter;
    +        // windows just gets ENOENT in this case.  We do cover the case,
    +        // just disabled because it's impossible on Windows CI
    +        /* c8 ignore start */
    +        if (code === 'ENOTDIR' && this.parent) {
    +            this.parent.#markENOTDIR();
    +        }
    +        /* c8 ignore stop */
    +    }
    +    #readdirAddChild(e, c) {
    +        return (this.#readdirMaybePromoteChild(e, c) ||
    +            this.#readdirAddNewChild(e, c));
    +    }
    +    #readdirAddNewChild(e, c) {
    +        // alloc new entry at head, so it's never provisional
    +        const type = entToType(e);
    +        const child = this.newChild(e.name, type, { parent: this });
    +        const ifmt = child.#type & IFMT;
    +        if (ifmt !== IFDIR && ifmt !== IFLNK && ifmt !== UNKNOWN) {
    +            child.#type |= ENOTDIR;
    +        }
    +        c.unshift(child);
    +        c.provisional++;
    +        return child;
    +    }
    +    #readdirMaybePromoteChild(e, c) {
    +        for (let p = c.provisional; p < c.length; p++) {
    +            const pchild = c[p];
    +            const name = this.nocase
    +                ? normalizeNocase(e.name)
    +                : normalize(e.name);
    +            if (name !== pchild.#matchName) {
    +                continue;
    +            }
    +            return this.#readdirPromoteChild(e, pchild, p, c);
    +        }
    +    }
    +    #readdirPromoteChild(e, p, index, c) {
    +        const v = p.name;
    +        // retain any other flags, but set ifmt from dirent
    +        p.#type = (p.#type & IFMT_UNKNOWN) | entToType(e);
    +        // case sensitivity fixing when we learn the true name.
    +        if (v !== e.name)
    +            p.name = e.name;
    +        // just advance provisional index (potentially off the list),
    +        // otherwise we have to splice/pop it out and re-insert at head
    +        if (index !== c.provisional) {
    +            if (index === c.length - 1)
    +                c.pop();
    +            else
    +                c.splice(index, 1);
    +            c.unshift(p);
    +        }
    +        c.provisional++;
    +        return p;
    +    }
    +    /**
    +     * Call lstat() on this Path, and update all known information that can be
    +     * determined.
    +     *
    +     * Note that unlike `fs.lstat()`, the returned value does not contain some
    +     * information, such as `mode`, `dev`, `nlink`, and `ino`.  If that
    +     * information is required, you will need to call `fs.lstat` yourself.
    +     *
    +     * If the Path refers to a nonexistent file, or if the lstat call fails for
    +     * any reason, `undefined` is returned.  Otherwise the updated Path object is
    +     * returned.
    +     *
    +     * Results are cached, and thus may be out of date if the filesystem is
    +     * mutated.
    +     */
    +    async lstat() {
    +        if ((this.#type & ENOENT) === 0) {
    +            try {
    +                this.#applyStat(await this.#fs.promises.lstat(this.fullpath()));
    +                return this;
    +            }
    +            catch (er) {
    +                this.#lstatFail(er.code);
    +            }
    +        }
    +    }
    +    /**
    +     * synchronous {@link PathBase.lstat}
    +     */
    +    lstatSync() {
    +        if ((this.#type & ENOENT) === 0) {
    +            try {
    +                this.#applyStat(this.#fs.lstatSync(this.fullpath()));
    +                return this;
    +            }
    +            catch (er) {
    +                this.#lstatFail(er.code);
    +            }
    +        }
    +    }
    +    #applyStat(st) {
    +        const { atime, atimeMs, birthtime, birthtimeMs, blksize, blocks, ctime, ctimeMs, dev, gid, ino, mode, mtime, mtimeMs, nlink, rdev, size, uid, } = st;
    +        this.#atime = atime;
    +        this.#atimeMs = atimeMs;
    +        this.#birthtime = birthtime;
    +        this.#birthtimeMs = birthtimeMs;
    +        this.#blksize = blksize;
    +        this.#blocks = blocks;
    +        this.#ctime = ctime;
    +        this.#ctimeMs = ctimeMs;
    +        this.#dev = dev;
    +        this.#gid = gid;
    +        this.#ino = ino;
    +        this.#mode = mode;
    +        this.#mtime = mtime;
    +        this.#mtimeMs = mtimeMs;
    +        this.#nlink = nlink;
    +        this.#rdev = rdev;
    +        this.#size = size;
    +        this.#uid = uid;
    +        const ifmt = entToType(st);
    +        // retain any other flags, but set the ifmt
    +        this.#type = (this.#type & IFMT_UNKNOWN) | ifmt | LSTAT_CALLED;
    +        if (ifmt !== UNKNOWN && ifmt !== IFDIR && ifmt !== IFLNK) {
    +            this.#type |= ENOTDIR;
    +        }
    +    }
    +    #onReaddirCB = [];
    +    #readdirCBInFlight = false;
    +    #callOnReaddirCB(children) {
    +        this.#readdirCBInFlight = false;
    +        const cbs = this.#onReaddirCB.slice();
    +        this.#onReaddirCB.length = 0;
    +        cbs.forEach(cb => cb(null, children));
    +    }
    +    /**
    +     * Standard node-style callback interface to get list of directory entries.
    +     *
    +     * If the Path cannot or does not contain any children, then an empty array
    +     * is returned.
    +     *
    +     * Results are cached, and thus may be out of date if the filesystem is
    +     * mutated.
    +     *
    +     * @param cb The callback called with (er, entries).  Note that the `er`
    +     * param is somewhat extraneous, as all readdir() errors are handled and
    +     * simply result in an empty set of entries being returned.
    +     * @param allowZalgo Boolean indicating that immediately known results should
    +     * *not* be deferred with `queueMicrotask`. Defaults to `false`. Release
    +     * zalgo at your peril, the dark pony lord is devious and unforgiving.
    +     */
    +    readdirCB(cb, allowZalgo = false) {
    +        if (!this.canReaddir()) {
    +            if (allowZalgo)
    +                cb(null, []);
    +            else
    +                queueMicrotask(() => cb(null, []));
    +            return;
    +        }
    +        const children = this.children();
    +        if (this.calledReaddir()) {
    +            const c = children.slice(0, children.provisional);
    +            if (allowZalgo)
    +                cb(null, c);
    +            else
    +                queueMicrotask(() => cb(null, c));
    +            return;
    +        }
    +        // don't have to worry about zalgo at this point.
    +        this.#onReaddirCB.push(cb);
    +        if (this.#readdirCBInFlight) {
    +            return;
    +        }
    +        this.#readdirCBInFlight = true;
    +        // else read the directory, fill up children
    +        // de-provisionalize any provisional children.
    +        const fullpath = this.fullpath();
    +        this.#fs.readdir(fullpath, { withFileTypes: true }, (er, entries) => {
    +            if (er) {
    +                this.#readdirFail(er.code);
    +                children.provisional = 0;
    +            }
    +            else {
    +                // if we didn't get an error, we always get entries.
    +                //@ts-ignore
    +                for (const e of entries) {
    +                    this.#readdirAddChild(e, children);
    +                }
    +                this.#readdirSuccess(children);
    +            }
    +            this.#callOnReaddirCB(children.slice(0, children.provisional));
    +            return;
    +        });
    +    }
    +    #asyncReaddirInFlight;
    +    /**
    +     * Return an array of known child entries.
    +     *
    +     * If the Path cannot or does not contain any children, then an empty array
    +     * is returned.
    +     *
    +     * Results are cached, and thus may be out of date if the filesystem is
    +     * mutated.
    +     */
    +    async readdir() {
    +        if (!this.canReaddir()) {
    +            return [];
    +        }
    +        const children = this.children();
    +        if (this.calledReaddir()) {
    +            return children.slice(0, children.provisional);
    +        }
    +        // else read the directory, fill up children
    +        // de-provisionalize any provisional children.
    +        const fullpath = this.fullpath();
    +        if (this.#asyncReaddirInFlight) {
    +            await this.#asyncReaddirInFlight;
    +        }
    +        else {
    +            /* c8 ignore start */
    +            let resolve = () => { };
    +            /* c8 ignore stop */
    +            this.#asyncReaddirInFlight = new Promise(res => (resolve = res));
    +            try {
    +                for (const e of await this.#fs.promises.readdir(fullpath, {
    +                    withFileTypes: true,
    +                })) {
    +                    this.#readdirAddChild(e, children);
    +                }
    +                this.#readdirSuccess(children);
    +            }
    +            catch (er) {
    +                this.#readdirFail(er.code);
    +                children.provisional = 0;
    +            }
    +            this.#asyncReaddirInFlight = undefined;
    +            resolve();
    +        }
    +        return children.slice(0, children.provisional);
    +    }
    +    /**
    +     * synchronous {@link PathBase.readdir}
    +     */
    +    readdirSync() {
    +        if (!this.canReaddir()) {
    +            return [];
    +        }
    +        const children = this.children();
    +        if (this.calledReaddir()) {
    +            return children.slice(0, children.provisional);
    +        }
    +        // else read the directory, fill up children
    +        // de-provisionalize any provisional children.
    +        const fullpath = this.fullpath();
    +        try {
    +            for (const e of this.#fs.readdirSync(fullpath, {
    +                withFileTypes: true,
    +            })) {
    +                this.#readdirAddChild(e, children);
    +            }
    +            this.#readdirSuccess(children);
    +        }
    +        catch (er) {
    +            this.#readdirFail(er.code);
    +            children.provisional = 0;
    +        }
    +        return children.slice(0, children.provisional);
    +    }
    +    canReaddir() {
    +        if (this.#type & ENOCHILD)
    +            return false;
    +        const ifmt = IFMT & this.#type;
    +        // we always set ENOTDIR when setting IFMT, so should be impossible
    +        /* c8 ignore start */
    +        if (!(ifmt === UNKNOWN || ifmt === IFDIR || ifmt === IFLNK)) {
    +            return false;
    +        }
    +        /* c8 ignore stop */
    +        return true;
    +    }
    +    shouldWalk(dirs, walkFilter) {
    +        return ((this.#type & IFDIR) === IFDIR &&
    +            !(this.#type & ENOCHILD) &&
    +            !dirs.has(this) &&
    +            (!walkFilter || walkFilter(this)));
    +    }
    +    /**
    +     * Return the Path object corresponding to path as resolved
    +     * by realpath(3).
    +     *
    +     * If the realpath call fails for any reason, `undefined` is returned.
    +     *
    +     * Result is cached, and thus may be outdated if the filesystem is mutated.
    +     * On success, returns a Path object.
    +     */
    +    async realpath() {
    +        if (this.#realpath)
    +            return this.#realpath;
    +        if ((ENOREALPATH | ENOREADLINK | ENOENT) & this.#type)
    +            return undefined;
    +        try {
    +            const rp = await this.#fs.promises.realpath(this.fullpath());
    +            return (this.#realpath = this.resolve(rp));
    +        }
    +        catch (_) {
    +            this.#markENOREALPATH();
    +        }
    +    }
    +    /**
    +     * Synchronous {@link realpath}
    +     */
    +    realpathSync() {
    +        if (this.#realpath)
    +            return this.#realpath;
    +        if ((ENOREALPATH | ENOREADLINK | ENOENT) & this.#type)
    +            return undefined;
    +        try {
    +            const rp = this.#fs.realpathSync(this.fullpath());
    +            return (this.#realpath = this.resolve(rp));
    +        }
    +        catch (_) {
    +            this.#markENOREALPATH();
    +        }
    +    }
    +}
    +exports.PathBase = PathBase;
    +/**
    + * Path class used on win32 systems
    + *
    + * Uses `'\\'` as the path separator for returned paths, either `'\\'` or `'/'`
    + * as the path separator for parsing paths.
    + */
    +class PathWin32 extends PathBase {
    +    /**
    +     * Separator for generating path strings.
    +     */
    +    sep = '\\';
    +    /**
    +     * Separator for parsing path strings.
    +     */
    +    splitSep = eitherSep;
    +    /**
    +     * Do not create new Path objects directly.  They should always be accessed
    +     * via the PathScurry class or other methods on the Path class.
    +     *
    +     * @internal
    +     */
    +    constructor(name, type = UNKNOWN, root, roots, nocase, children, opts) {
    +        super(name, type, root, roots, nocase, children, opts);
    +    }
    +    /**
    +     * @internal
    +     */
    +    newChild(name, type = UNKNOWN, opts = {}) {
    +        return new PathWin32(name, type, this.root, this.roots, this.nocase, this.childrenCache(), opts);
    +    }
    +    /**
    +     * @internal
    +     */
    +    getRootString(path) {
    +        return path_1.win32.parse(path).root;
    +    }
    +    /**
    +     * @internal
    +     */
    +    getRoot(rootPath) {
    +        rootPath = uncToDrive(rootPath.toUpperCase());
    +        if (rootPath === this.root.name) {
    +            return this.root;
    +        }
    +        // ok, not that one, check if it matches another we know about
    +        for (const [compare, root] of Object.entries(this.roots)) {
    +            if (this.sameRoot(rootPath, compare)) {
    +                return (this.roots[rootPath] = root);
    +            }
    +        }
    +        // otherwise, have to create a new one.
    +        return (this.roots[rootPath] = new PathScurryWin32(rootPath, this).root);
    +    }
    +    /**
    +     * @internal
    +     */
    +    sameRoot(rootPath, compare = this.root.name) {
    +        // windows can (rarely) have case-sensitive filesystem, but
    +        // UNC and drive letters are always case-insensitive, and canonically
    +        // represented uppercase.
    +        rootPath = rootPath
    +            .toUpperCase()
    +            .replace(/\//g, '\\')
    +            .replace(uncDriveRegexp, '$1\\');
    +        return rootPath === compare;
    +    }
    +}
    +exports.PathWin32 = PathWin32;
    +/**
    + * Path class used on all posix systems.
    + *
    + * Uses `'/'` as the path separator.
    + */
    +class PathPosix extends PathBase {
    +    /**
    +     * separator for parsing path strings
    +     */
    +    splitSep = '/';
    +    /**
    +     * separator for generating path strings
    +     */
    +    sep = '/';
    +    /**
    +     * Do not create new Path objects directly.  They should always be accessed
    +     * via the PathScurry class or other methods on the Path class.
    +     *
    +     * @internal
    +     */
    +    constructor(name, type = UNKNOWN, root, roots, nocase, children, opts) {
    +        super(name, type, root, roots, nocase, children, opts);
    +    }
    +    /**
    +     * @internal
    +     */
    +    getRootString(path) {
    +        return path.startsWith('/') ? '/' : '';
    +    }
    +    /**
    +     * @internal
    +     */
    +    getRoot(_rootPath) {
    +        return this.root;
    +    }
    +    /**
    +     * @internal
    +     */
    +    newChild(name, type = UNKNOWN, opts = {}) {
    +        return new PathPosix(name, type, this.root, this.roots, this.nocase, this.childrenCache(), opts);
    +    }
    +}
    +exports.PathPosix = PathPosix;
    +/**
    + * The base class for all PathScurry classes, providing the interface for path
    + * resolution and filesystem operations.
    + *
    + * Typically, you should *not* instantiate this class directly, but rather one
    + * of the platform-specific classes, or the exported {@link PathScurry} which
    + * defaults to the current platform.
    + */
    +class PathScurryBase {
    +    /**
    +     * The root Path entry for the current working directory of this Scurry
    +     */
    +    root;
    +    /**
    +     * The string path for the root of this Scurry's current working directory
    +     */
    +    rootPath;
    +    /**
    +     * A collection of all roots encountered, referenced by rootPath
    +     */
    +    roots;
    +    /**
    +     * The Path entry corresponding to this PathScurry's current working directory.
    +     */
    +    cwd;
    +    #resolveCache;
    +    #children;
    +    /**
    +     * Perform path comparisons case-insensitively.
    +     *
    +     * Defaults true on Darwin and Windows systems, false elsewhere.
    +     */
    +    nocase;
    +    #fs;
    +    /**
    +     * This class should not be instantiated directly.
    +     *
    +     * Use PathScurryWin32, PathScurryDarwin, PathScurryPosix, or PathScurry
    +     *
    +     * @internal
    +     */
    +    constructor(cwd = process.cwd(), pathImpl, sep, { nocase, childrenCacheSize = 16 * 1024, fs = defaultFS, } = {}) {
    +        this.#fs = fsFromOption(fs);
    +        if (cwd instanceof URL || cwd.startsWith('file://')) {
    +            cwd = (0, url_1.fileURLToPath)(cwd);
    +        }
    +        // resolve and split root, and then add to the store.
    +        // this is the only time we call path.resolve()
    +        const cwdPath = pathImpl.resolve(cwd);
    +        this.roots = Object.create(null);
    +        this.rootPath = this.parseRootPath(cwdPath);
    +        this.#resolveCache = new ResolveCache();
    +        this.#children = new ChildrenCache(childrenCacheSize);
    +        const split = cwdPath.substring(this.rootPath.length).split(sep);
    +        // resolve('/') leaves '', splits to [''], we don't want that.
    +        if (split.length === 1 && !split[0]) {
    +            split.pop();
    +        }
    +        /* c8 ignore start */
    +        if (nocase === undefined) {
    +            throw new TypeError('must provide nocase setting to PathScurryBase ctor');
    +        }
    +        /* c8 ignore stop */
    +        this.nocase = nocase;
    +        this.root = this.newRoot(this.#fs);
    +        this.roots[this.rootPath] = this.root;
    +        let prev = this.root;
    +        let len = split.length - 1;
    +        const joinSep = pathImpl.sep;
    +        let abs = this.rootPath;
    +        let sawFirst = false;
    +        for (const part of split) {
    +            prev = prev.child(part, {
    +                relative: new Array(len--).fill('..').join(joinSep),
    +                fullpath: (abs += (sawFirst ? '' : joinSep) + part),
    +            });
    +            sawFirst = true;
    +        }
    +        this.cwd = prev;
    +    }
    +    /**
    +     * Get the depth of a provided path, string, or the cwd
    +     */
    +    depth(path = this.cwd) {
    +        if (typeof path === 'string') {
    +            path = this.cwd.resolve(path);
    +        }
    +        return path.depth();
    +    }
    +    /**
    +     * Return the cache of child entries.  Exposed so subclasses can create
    +     * child Path objects in a platform-specific way.
    +     *
    +     * @internal
    +     */
    +    childrenCache() {
    +        return this.#children;
    +    }
    +    /**
    +     * Resolve one or more path strings to a resolved string
    +     *
    +     * Same interface as require('path').resolve.
    +     *
    +     * Much faster than path.resolve() when called multiple times for the same
    +     * path, because the resolved Path objects are cached.  Much slower
    +     * otherwise.
    +     */
    +    resolve(...paths) {
    +        // first figure out the minimum number of paths we have to test
    +        // we always start at cwd, but any absolutes will bump the start
    +        let r = '';
    +        for (let i = paths.length - 1; i >= 0; i--) {
    +            const p = paths[i];
    +            if (!p || p === '.')
    +                continue;
    +            r = r ? `${p}/${r}` : p;
    +            if (this.isAbsolute(p)) {
    +                break;
    +            }
    +        }
    +        const cached = this.#resolveCache.get(r);
    +        if (cached !== undefined) {
    +            return cached;
    +        }
    +        const result = this.cwd.resolve(r).fullpath();
    +        this.#resolveCache.set(r, result);
    +        return result;
    +    }
    +    /**
    +     * find the relative path from the cwd to the supplied path string or entry
    +     */
    +    relative(entry = this.cwd) {
    +        if (typeof entry === 'string') {
    +            entry = this.cwd.resolve(entry);
    +        }
    +        return entry.relative();
    +    }
    +    /**
    +     * Return the basename for the provided string or Path object
    +     */
    +    basename(entry = this.cwd) {
    +        if (typeof entry === 'string') {
    +            entry = this.cwd.resolve(entry);
    +        }
    +        return entry.name;
    +    }
    +    /**
    +     * Return the dirname for the provided string or Path object
    +     */
    +    dirname(entry = this.cwd) {
    +        if (typeof entry === 'string') {
    +            entry = this.cwd.resolve(entry);
    +        }
    +        return (entry.parent || entry).fullpath();
    +    }
    +    async readdir(entry = this.cwd, opts = {
    +        withFileTypes: true,
    +    }) {
    +        if (typeof entry === 'string') {
    +            entry = this.cwd.resolve(entry);
    +        }
    +        else if (!(entry instanceof PathBase)) {
    +            opts = entry;
    +            entry = this.cwd;
    +        }
    +        const { withFileTypes } = opts;
    +        if (!entry.canReaddir()) {
    +            return [];
    +        }
    +        else {
    +            const p = await entry.readdir();
    +            return withFileTypes ? p : p.map(e => e.name);
    +        }
    +    }
    +    readdirSync(entry = this.cwd, opts = {
    +        withFileTypes: true,
    +    }) {
    +        if (typeof entry === 'string') {
    +            entry = this.cwd.resolve(entry);
    +        }
    +        else if (!(entry instanceof PathBase)) {
    +            opts = entry;
    +            entry = this.cwd;
    +        }
    +        const { withFileTypes = true } = opts;
    +        if (!entry.canReaddir()) {
    +            return [];
    +        }
    +        else if (withFileTypes) {
    +            return entry.readdirSync();
    +        }
    +        else {
    +            return entry.readdirSync().map(e => e.name);
    +        }
    +    }
    +    /**
    +     * Call lstat() on the string or Path object, and update all known
    +     * information that can be determined.
    +     *
    +     * Note that unlike `fs.lstat()`, the returned value does not contain some
    +     * information, such as `mode`, `dev`, `nlink`, and `ino`.  If that
    +     * information is required, you will need to call `fs.lstat` yourself.
    +     *
    +     * If the Path refers to a nonexistent file, or if the lstat call fails for
    +     * any reason, `undefined` is returned.  Otherwise the updated Path object is
    +     * returned.
    +     *
    +     * Results are cached, and thus may be out of date if the filesystem is
    +     * mutated.
    +     */
    +    async lstat(entry = this.cwd) {
    +        if (typeof entry === 'string') {
    +            entry = this.cwd.resolve(entry);
    +        }
    +        return entry.lstat();
    +    }
    +    /**
    +     * synchronous {@link PathScurryBase.lstat}
    +     */
    +    lstatSync(entry = this.cwd) {
    +        if (typeof entry === 'string') {
    +            entry = this.cwd.resolve(entry);
    +        }
    +        return entry.lstatSync();
    +    }
    +    async readlink(entry = this.cwd, { withFileTypes } = {
    +        withFileTypes: false,
    +    }) {
    +        if (typeof entry === 'string') {
    +            entry = this.cwd.resolve(entry);
    +        }
    +        else if (!(entry instanceof PathBase)) {
    +            withFileTypes = entry.withFileTypes;
    +            entry = this.cwd;
    +        }
    +        const e = await entry.readlink();
    +        return withFileTypes ? e : e?.fullpath();
    +    }
    +    readlinkSync(entry = this.cwd, { withFileTypes } = {
    +        withFileTypes: false,
    +    }) {
    +        if (typeof entry === 'string') {
    +            entry = this.cwd.resolve(entry);
    +        }
    +        else if (!(entry instanceof PathBase)) {
    +            withFileTypes = entry.withFileTypes;
    +            entry = this.cwd;
    +        }
    +        const e = entry.readlinkSync();
    +        return withFileTypes ? e : e?.fullpath();
    +    }
    +    async realpath(entry = this.cwd, { withFileTypes } = {
    +        withFileTypes: false,
    +    }) {
    +        if (typeof entry === 'string') {
    +            entry = this.cwd.resolve(entry);
    +        }
    +        else if (!(entry instanceof PathBase)) {
    +            withFileTypes = entry.withFileTypes;
    +            entry = this.cwd;
    +        }
    +        const e = await entry.realpath();
    +        return withFileTypes ? e : e?.fullpath();
    +    }
    +    realpathSync(entry = this.cwd, { withFileTypes } = {
    +        withFileTypes: false,
    +    }) {
    +        if (typeof entry === 'string') {
    +            entry = this.cwd.resolve(entry);
    +        }
    +        else if (!(entry instanceof PathBase)) {
    +            withFileTypes = entry.withFileTypes;
    +            entry = this.cwd;
    +        }
    +        const e = entry.realpathSync();
    +        return withFileTypes ? e : e?.fullpath();
    +    }
    +    async walk(entry = this.cwd, opts = {}) {
    +        if (typeof entry === 'string') {
    +            entry = this.cwd.resolve(entry);
    +        }
    +        else if (!(entry instanceof PathBase)) {
    +            opts = entry;
    +            entry = this.cwd;
    +        }
    +        const { withFileTypes = true, follow = false, filter, walkFilter, } = opts;
    +        const results = [];
    +        if (!filter || filter(entry)) {
    +            results.push(withFileTypes ? entry : entry.fullpath());
    +        }
    +        const dirs = new Set();
    +        const walk = (dir, cb) => {
    +            dirs.add(dir);
    +            dir.readdirCB((er, entries) => {
    +                /* c8 ignore start */
    +                if (er) {
    +                    return cb(er);
    +                }
    +                /* c8 ignore stop */
    +                let len = entries.length;
    +                if (!len)
    +                    return cb();
    +                const next = () => {
    +                    if (--len === 0) {
    +                        cb();
    +                    }
    +                };
    +                for (const e of entries) {
    +                    if (!filter || filter(e)) {
    +                        results.push(withFileTypes ? e : e.fullpath());
    +                    }
    +                    if (follow && e.isSymbolicLink()) {
    +                        e.realpath()
    +                            .then(r => (r?.isUnknown() ? r.lstat() : r))
    +                            .then(r => r?.shouldWalk(dirs, walkFilter) ? walk(r, next) : next());
    +                    }
    +                    else {
    +                        if (e.shouldWalk(dirs, walkFilter)) {
    +                            walk(e, next);
    +                        }
    +                        else {
    +                            next();
    +                        }
    +                    }
    +                }
    +            }, true); // zalgooooooo
    +        };
    +        const start = entry;
    +        return new Promise((res, rej) => {
    +            walk(start, er => {
    +                /* c8 ignore start */
    +                if (er)
    +                    return rej(er);
    +                /* c8 ignore stop */
    +                res(results);
    +            });
    +        });
    +    }
    +    walkSync(entry = this.cwd, opts = {}) {
    +        if (typeof entry === 'string') {
    +            entry = this.cwd.resolve(entry);
    +        }
    +        else if (!(entry instanceof PathBase)) {
    +            opts = entry;
    +            entry = this.cwd;
    +        }
    +        const { withFileTypes = true, follow = false, filter, walkFilter, } = opts;
    +        const results = [];
    +        if (!filter || filter(entry)) {
    +            results.push(withFileTypes ? entry : entry.fullpath());
    +        }
    +        const dirs = new Set([entry]);
    +        for (const dir of dirs) {
    +            const entries = dir.readdirSync();
    +            for (const e of entries) {
    +                if (!filter || filter(e)) {
    +                    results.push(withFileTypes ? e : e.fullpath());
    +                }
    +                let r = e;
    +                if (e.isSymbolicLink()) {
    +                    if (!(follow && (r = e.realpathSync())))
    +                        continue;
    +                    if (r.isUnknown())
    +                        r.lstatSync();
    +                }
    +                if (r.shouldWalk(dirs, walkFilter)) {
    +                    dirs.add(r);
    +                }
    +            }
    +        }
    +        return results;
    +    }
    +    /**
    +     * Support for `for await`
    +     *
    +     * Alias for {@link PathScurryBase.iterate}
    +     *
    +     * Note: As of Node 19, this is very slow, compared to other methods of
    +     * walking.  Consider using {@link PathScurryBase.stream} if memory overhead
    +     * and backpressure are concerns, or {@link PathScurryBase.walk} if not.
    +     */
    +    [Symbol.asyncIterator]() {
    +        return this.iterate();
    +    }
    +    iterate(entry = this.cwd, options = {}) {
    +        // iterating async over the stream is significantly more performant,
    +        // especially in the warm-cache scenario, because it buffers up directory
    +        // entries in the background instead of waiting for a yield for each one.
    +        if (typeof entry === 'string') {
    +            entry = this.cwd.resolve(entry);
    +        }
    +        else if (!(entry instanceof PathBase)) {
    +            options = entry;
    +            entry = this.cwd;
    +        }
    +        return this.stream(entry, options)[Symbol.asyncIterator]();
    +    }
    +    /**
    +     * Iterating over a PathScurry performs a synchronous walk.
    +     *
    +     * Alias for {@link PathScurryBase.iterateSync}
    +     */
    +    [Symbol.iterator]() {
    +        return this.iterateSync();
    +    }
    +    *iterateSync(entry = this.cwd, opts = {}) {
    +        if (typeof entry === 'string') {
    +            entry = this.cwd.resolve(entry);
    +        }
    +        else if (!(entry instanceof PathBase)) {
    +            opts = entry;
    +            entry = this.cwd;
    +        }
    +        const { withFileTypes = true, follow = false, filter, walkFilter, } = opts;
    +        if (!filter || filter(entry)) {
    +            yield withFileTypes ? entry : entry.fullpath();
    +        }
    +        const dirs = new Set([entry]);
    +        for (const dir of dirs) {
    +            const entries = dir.readdirSync();
    +            for (const e of entries) {
    +                if (!filter || filter(e)) {
    +                    yield withFileTypes ? e : e.fullpath();
    +                }
    +                let r = e;
    +                if (e.isSymbolicLink()) {
    +                    if (!(follow && (r = e.realpathSync())))
    +                        continue;
    +                    if (r.isUnknown())
    +                        r.lstatSync();
    +                }
    +                if (r.shouldWalk(dirs, walkFilter)) {
    +                    dirs.add(r);
    +                }
    +            }
    +        }
    +    }
    +    stream(entry = this.cwd, opts = {}) {
    +        if (typeof entry === 'string') {
    +            entry = this.cwd.resolve(entry);
    +        }
    +        else if (!(entry instanceof PathBase)) {
    +            opts = entry;
    +            entry = this.cwd;
    +        }
    +        const { withFileTypes = true, follow = false, filter, walkFilter, } = opts;
    +        const results = new minipass_1.default({ objectMode: true });
    +        if (!filter || filter(entry)) {
    +            results.write(withFileTypes ? entry : entry.fullpath());
    +        }
    +        const dirs = new Set();
    +        const queue = [entry];
    +        let processing = 0;
    +        const process = () => {
    +            let paused = false;
    +            while (!paused) {
    +                const dir = queue.shift();
    +                if (!dir) {
    +                    if (processing === 0)
    +                        results.end();
    +                    return;
    +                }
    +                processing++;
    +                dirs.add(dir);
    +                const onReaddir = (er, entries, didRealpaths = false) => {
    +                    /* c8 ignore start */
    +                    if (er)
    +                        return results.emit('error', er);
    +                    /* c8 ignore stop */
    +                    if (follow && !didRealpaths) {
    +                        const promises = [];
    +                        for (const e of entries) {
    +                            if (e.isSymbolicLink()) {
    +                                promises.push(e
    +                                    .realpath()
    +                                    .then((r) => r?.isUnknown() ? r.lstat() : r));
    +                            }
    +                        }
    +                        if (promises.length) {
    +                            Promise.all(promises).then(() => onReaddir(null, entries, true));
    +                            return;
    +                        }
    +                    }
    +                    for (const e of entries) {
    +                        if (e && (!filter || filter(e))) {
    +                            if (!results.write(withFileTypes ? e : e.fullpath())) {
    +                                paused = true;
    +                            }
    +                        }
    +                    }
    +                    processing--;
    +                    for (const e of entries) {
    +                        const r = e.realpathCached() || e;
    +                        if (r.shouldWalk(dirs, walkFilter)) {
    +                            queue.push(r);
    +                        }
    +                    }
    +                    if (paused && !results.flowing) {
    +                        results.once('drain', process);
    +                    }
    +                    else if (!sync) {
    +                        process();
    +                    }
    +                };
    +                // zalgo containment
    +                let sync = true;
    +                dir.readdirCB(onReaddir, true);
    +                sync = false;
    +            }
    +        };
    +        process();
    +        return results;
    +    }
    +    streamSync(entry = this.cwd, opts = {}) {
    +        if (typeof entry === 'string') {
    +            entry = this.cwd.resolve(entry);
    +        }
    +        else if (!(entry instanceof PathBase)) {
    +            opts = entry;
    +            entry = this.cwd;
    +        }
    +        const { withFileTypes = true, follow = false, filter, walkFilter, } = opts;
    +        const results = new minipass_1.default({ objectMode: true });
    +        const dirs = new Set();
    +        if (!filter || filter(entry)) {
    +            results.write(withFileTypes ? entry : entry.fullpath());
    +        }
    +        const queue = [entry];
    +        let processing = 0;
    +        const process = () => {
    +            let paused = false;
    +            while (!paused) {
    +                const dir = queue.shift();
    +                if (!dir) {
    +                    if (processing === 0)
    +                        results.end();
    +                    return;
    +                }
    +                processing++;
    +                dirs.add(dir);
    +                const entries = dir.readdirSync();
    +                for (const e of entries) {
    +                    if (!filter || filter(e)) {
    +                        if (!results.write(withFileTypes ? e : e.fullpath())) {
    +                            paused = true;
    +                        }
    +                    }
    +                }
    +                processing--;
    +                for (const e of entries) {
    +                    let r = e;
    +                    if (e.isSymbolicLink()) {
    +                        if (!(follow && (r = e.realpathSync())))
    +                            continue;
    +                        if (r.isUnknown())
    +                            r.lstatSync();
    +                    }
    +                    if (r.shouldWalk(dirs, walkFilter)) {
    +                        queue.push(r);
    +                    }
    +                }
    +            }
    +            if (paused && !results.flowing)
    +                results.once('drain', process);
    +        };
    +        process();
    +        return results;
    +    }
    +}
    +exports.PathScurryBase = PathScurryBase;
    +/**
    + * Windows implementation of {@link PathScurryBase}
    + *
    + * Defaults to case insensitve, uses `'\\'` to generate path strings.  Uses
    + * {@link PathWin32} for Path objects.
    + */
    +class PathScurryWin32 extends PathScurryBase {
    +    /**
    +     * separator for generating path strings
    +     */
    +    sep = '\\';
    +    constructor(cwd = process.cwd(), opts = {}) {
    +        const { nocase = true } = opts;
    +        super(cwd, path_1.win32, '\\', { ...opts, nocase });
    +        this.nocase = nocase;
    +        for (let p = this.cwd; p; p = p.parent) {
    +            p.nocase = this.nocase;
    +        }
    +    }
    +    /**
    +     * @internal
    +     */
    +    parseRootPath(dir) {
    +        // if the path starts with a single separator, it's not a UNC, and we'll
    +        // just get separator as the root, and driveFromUNC will return \
    +        // In that case, mount \ on the root from the cwd.
    +        return path_1.win32.parse(dir).root.toUpperCase();
    +    }
    +    /**
    +     * @internal
    +     */
    +    newRoot(fs) {
    +        return new PathWin32(this.rootPath, IFDIR, undefined, this.roots, this.nocase, this.childrenCache(), { fs });
    +    }
    +    /**
    +     * Return true if the provided path string is an absolute path
    +     */
    +    isAbsolute(p) {
    +        return (p.startsWith('/') || p.startsWith('\\') || /^[a-z]:(\/|\\)/i.test(p));
    +    }
    +}
    +exports.PathScurryWin32 = PathScurryWin32;
    +/**
    + * {@link PathScurryBase} implementation for all posix systems other than Darwin.
    + *
    + * Defaults to case-sensitive matching, uses `'/'` to generate path strings.
    + *
    + * Uses {@link PathPosix} for Path objects.
    + */
    +class PathScurryPosix extends PathScurryBase {
    +    /**
    +     * separator for generating path strings
    +     */
    +    sep = '/';
    +    constructor(cwd = process.cwd(), opts = {}) {
    +        const { nocase = false } = opts;
    +        super(cwd, path_1.posix, '/', { ...opts, nocase });
    +        this.nocase = nocase;
    +    }
    +    /**
    +     * @internal
    +     */
    +    parseRootPath(_dir) {
    +        return '/';
    +    }
    +    /**
    +     * @internal
    +     */
    +    newRoot(fs) {
    +        return new PathPosix(this.rootPath, IFDIR, undefined, this.roots, this.nocase, this.childrenCache(), { fs });
    +    }
    +    /**
    +     * Return true if the provided path string is an absolute path
    +     */
    +    isAbsolute(p) {
    +        return p.startsWith('/');
    +    }
    +}
    +exports.PathScurryPosix = PathScurryPosix;
    +/**
    + * {@link PathScurryBase} implementation for Darwin (macOS) systems.
    + *
    + * Defaults to case-insensitive matching, uses `'/'` for generating path
    + * strings.
    + *
    + * Uses {@link PathPosix} for Path objects.
    + */
    +class PathScurryDarwin extends PathScurryPosix {
    +    constructor(cwd = process.cwd(), opts = {}) {
    +        const { nocase = true } = opts;
    +        super(cwd, { ...opts, nocase });
    +    }
    +}
    +exports.PathScurryDarwin = PathScurryDarwin;
    +/**
    + * Default {@link PathBase} implementation for the current platform.
    + *
    + * {@link PathWin32} on Windows systems, {@link PathPosix} on all others.
    + */
    +exports.Path = process.platform === 'win32' ? PathWin32 : PathPosix;
    +/**
    + * Default {@link PathScurryBase} implementation for the current platform.
    + *
    + * {@link PathScurryWin32} on Windows systems, {@link PathScurryDarwin} on
    + * Darwin (macOS) systems, {@link PathScurryPosix} on all others.
    + */
    +exports.PathScurry = process.platform === 'win32'
    +    ? PathScurryWin32
    +    : process.platform === 'darwin'
    +        ? PathScurryDarwin
    +        : PathScurryPosix;
    +//# sourceMappingURL=index.js.map
    \ No newline at end of file
    diff --git a/deps/npm/node_modules/path-scurry/dist/cjs/package.json b/deps/npm/node_modules/path-scurry/dist/cjs/package.json
    new file mode 100644
    index 00000000000000..5bbefffbabee39
    --- /dev/null
    +++ b/deps/npm/node_modules/path-scurry/dist/cjs/package.json
    @@ -0,0 +1,3 @@
    +{
    +  "type": "commonjs"
    +}
    diff --git a/deps/npm/node_modules/path-scurry/dist/mjs/index.js b/deps/npm/node_modules/path-scurry/dist/mjs/index.js
    new file mode 100644
    index 00000000000000..b6a2cf9c8a08e1
    --- /dev/null
    +++ b/deps/npm/node_modules/path-scurry/dist/mjs/index.js
    @@ -0,0 +1,1827 @@
    +import LRUCache from 'lru-cache';
    +import { posix, win32 } from 'path';
    +import { fileURLToPath } from 'url';
    +import * as actualFS from 'fs';
    +import { lstatSync, readdir as readdirCB, readdirSync, readlinkSync, realpathSync as rps, } from 'fs';
    +const realpathSync = rps.native;
    +// TODO: test perf of fs/promises realpath vs realpathCB,
    +// since the promises one uses realpath.native
    +import { lstat, readdir, readlink, realpath } from 'fs/promises';
    +import Minipass from 'minipass';
    +const defaultFS = {
    +    lstatSync,
    +    readdir: readdirCB,
    +    readdirSync,
    +    readlinkSync,
    +    realpathSync,
    +    promises: {
    +        lstat,
    +        readdir,
    +        readlink,
    +        realpath,
    +    },
    +};
    +// if they just gave us require('fs') then use our default
    +const fsFromOption = (fsOption) => !fsOption || fsOption === defaultFS || fsOption === actualFS
    +    ? defaultFS
    +    : {
    +        ...defaultFS,
    +        ...fsOption,
    +        promises: {
    +            ...defaultFS.promises,
    +            ...(fsOption.promises || {}),
    +        },
    +    };
    +// turn something like //?/c:/ into c:\
    +const uncDriveRegexp = /^\\\\\?\\([a-z]:)\\?$/i;
    +const uncToDrive = (rootPath) => rootPath.replace(/\//g, '\\').replace(uncDriveRegexp, '$1\\');
    +// windows paths are separated by either / or \
    +const eitherSep = /[\\\/]/;
    +const UNKNOWN = 0; // may not even exist, for all we know
    +const IFIFO = 0b0001;
    +const IFCHR = 0b0010;
    +const IFDIR = 0b0100;
    +const IFBLK = 0b0110;
    +const IFREG = 0b1000;
    +const IFLNK = 0b1010;
    +const IFSOCK = 0b1100;
    +const IFMT = 0b1111;
    +// mask to unset low 4 bits
    +const IFMT_UNKNOWN = ~IFMT;
    +// set after successfully calling readdir() and getting entries.
    +const READDIR_CALLED = 16;
    +// set after a successful lstat()
    +const LSTAT_CALLED = 32;
    +// set if an entry (or one of its parents) is definitely not a dir
    +const ENOTDIR = 64;
    +// set if an entry (or one of its parents) does not exist
    +// (can also be set on lstat errors like EACCES or ENAMETOOLONG)
    +const ENOENT = 128;
    +// cannot have child entries -- also verify &IFMT is either IFDIR or IFLNK
    +// set if we fail to readlink
    +const ENOREADLINK = 256;
    +// set if we know realpath() will fail
    +const ENOREALPATH = 512;
    +const ENOCHILD = ENOTDIR | ENOENT | ENOREALPATH;
    +const TYPEMASK = 1023;
    +const entToType = (s) => s.isFile()
    +    ? IFREG
    +    : s.isDirectory()
    +        ? IFDIR
    +        : s.isSymbolicLink()
    +            ? IFLNK
    +            : s.isCharacterDevice()
    +                ? IFCHR
    +                : s.isBlockDevice()
    +                    ? IFBLK
    +                    : s.isSocket()
    +                        ? IFSOCK
    +                        : s.isFIFO()
    +                            ? IFIFO
    +                            : UNKNOWN;
    +// normalize unicode path names
    +const normalizeCache = new Map();
    +const normalize = (s) => {
    +    const c = normalizeCache.get(s);
    +    if (c)
    +        return c;
    +    const n = s.normalize('NFKD');
    +    normalizeCache.set(s, n);
    +    return n;
    +};
    +const normalizeNocaseCache = new Map();
    +const normalizeNocase = (s) => {
    +    const c = normalizeNocaseCache.get(s);
    +    if (c)
    +        return c;
    +    const n = normalize(s.toLowerCase());
    +    normalizeNocaseCache.set(s, n);
    +    return n;
    +};
    +/**
    + * An LRUCache for storing resolved path strings or Path objects.
    + * @internal
    + */
    +export class ResolveCache extends LRUCache {
    +    constructor() {
    +        super({ max: 256 });
    +    }
    +}
    +// In order to prevent blowing out the js heap by allocating hundreds of
    +// thousands of Path entries when walking extremely large trees, the "children"
    +// in this tree are represented by storing an array of Path entries in an
    +// LRUCache, indexed by the parent.  At any time, Path.children() may return an
    +// empty array, indicating that it doesn't know about any of its children, and
    +// thus has to rebuild that cache.  This is fine, it just means that we don't
    +// benefit as much from having the cached entries, but huge directory walks
    +// don't blow out the stack, and smaller ones are still as fast as possible.
    +//
    +//It does impose some complexity when building up the readdir data, because we
    +//need to pass a reference to the children array that we started with.
    +/**
    + * an LRUCache for storing child entries.
    + * @internal
    + */
    +export class ChildrenCache extends LRUCache {
    +    constructor(maxSize = 16 * 1024) {
    +        super({
    +            maxSize,
    +            // parent + children
    +            sizeCalculation: a => a.length + 1,
    +        });
    +    }
    +}
    +/**
    + * Path objects are sort of like a super-powered
    + * {@link https://nodejs.org/docs/latest/api/fs.html#class-fsdirent fs.Dirent}
    + *
    + * Each one represents a single filesystem entry on disk, which may or may not
    + * exist. It includes methods for reading various types of information via
    + * lstat, readlink, and readdir, and caches all information to the greatest
    + * degree possible.
    + *
    + * Note that fs operations that would normally throw will instead return an
    + * "empty" value. This is in order to prevent excessive overhead from error
    + * stack traces.
    + */
    +export class PathBase {
    +    /**
    +     * the basename of this path
    +     *
    +     * **Important**: *always* test the path name against any test string
    +     * usingthe {@link isNamed} method, and not by directly comparing this
    +     * string. Otherwise, unicode path strings that the system sees as identical
    +     * will not be properly treated as the same path, leading to incorrect
    +     * behavior and possible security issues.
    +     */
    +    name;
    +    /**
    +     * the Path entry corresponding to the path root.
    +     *
    +     * @internal
    +     */
    +    root;
    +    /**
    +     * All roots found within the current PathScurry family
    +     *
    +     * @internal
    +     */
    +    roots;
    +    /**
    +     * a reference to the parent path, or undefined in the case of root entries
    +     *
    +     * @internal
    +     */
    +    parent;
    +    /**
    +     * boolean indicating whether paths are compared case-insensitively
    +     * @internal
    +     */
    +    nocase;
    +    // potential default fs override
    +    #fs;
    +    // Stats fields
    +    #dev;
    +    get dev() {
    +        return this.#dev;
    +    }
    +    #mode;
    +    get mode() {
    +        return this.#mode;
    +    }
    +    #nlink;
    +    get nlink() {
    +        return this.#nlink;
    +    }
    +    #uid;
    +    get uid() {
    +        return this.#uid;
    +    }
    +    #gid;
    +    get gid() {
    +        return this.#gid;
    +    }
    +    #rdev;
    +    get rdev() {
    +        return this.#rdev;
    +    }
    +    #blksize;
    +    get blksize() {
    +        return this.#blksize;
    +    }
    +    #ino;
    +    get ino() {
    +        return this.#ino;
    +    }
    +    #size;
    +    get size() {
    +        return this.#size;
    +    }
    +    #blocks;
    +    get blocks() {
    +        return this.#blocks;
    +    }
    +    #atimeMs;
    +    get atimeMs() {
    +        return this.#atimeMs;
    +    }
    +    #mtimeMs;
    +    get mtimeMs() {
    +        return this.#mtimeMs;
    +    }
    +    #ctimeMs;
    +    get ctimeMs() {
    +        return this.#ctimeMs;
    +    }
    +    #birthtimeMs;
    +    get birthtimeMs() {
    +        return this.#birthtimeMs;
    +    }
    +    #atime;
    +    get atime() {
    +        return this.#atime;
    +    }
    +    #mtime;
    +    get mtime() {
    +        return this.#mtime;
    +    }
    +    #ctime;
    +    get ctime() {
    +        return this.#ctime;
    +    }
    +    #birthtime;
    +    get birthtime() {
    +        return this.#birthtime;
    +    }
    +    #matchName;
    +    #depth;
    +    #fullpath;
    +    #relative;
    +    #type;
    +    #children;
    +    #linkTarget;
    +    #realpath;
    +    /**
    +     * Do not create new Path objects directly.  They should always be accessed
    +     * via the PathScurry class or other methods on the Path class.
    +     *
    +     * @internal
    +     */
    +    constructor(name, type = UNKNOWN, root, roots, nocase, children, opts) {
    +        this.name = name;
    +        this.#matchName = nocase ? normalizeNocase(name) : normalize(name);
    +        this.#type = type & TYPEMASK;
    +        this.nocase = nocase;
    +        this.roots = roots;
    +        this.root = root || this;
    +        this.#children = children;
    +        this.#fullpath = opts.fullpath;
    +        this.#relative = opts.relative;
    +        this.parent = opts.parent;
    +        if (this.parent) {
    +            this.#fs = this.parent.#fs;
    +        }
    +        else {
    +            this.#fs = fsFromOption(opts.fs);
    +        }
    +    }
    +    /**
    +     * Returns the depth of the Path object from its root.
    +     *
    +     * For example, a path at `/foo/bar` would have a depth of 2.
    +     */
    +    depth() {
    +        if (this.#depth !== undefined)
    +            return this.#depth;
    +        if (!this.parent)
    +            return (this.#depth = 0);
    +        return (this.#depth = this.parent.depth() + 1);
    +    }
    +    /**
    +     * @internal
    +     */
    +    childrenCache() {
    +        return this.#children;
    +    }
    +    /**
    +     * Get the Path object referenced by the string path, resolved from this Path
    +     */
    +    resolve(path) {
    +        if (!path) {
    +            return this;
    +        }
    +        const rootPath = this.getRootString(path);
    +        const dir = path.substring(rootPath.length);
    +        const dirParts = dir.split(this.splitSep);
    +        const result = rootPath
    +            ? this.getRoot(rootPath).#resolveParts(dirParts)
    +            : this.#resolveParts(dirParts);
    +        return result;
    +    }
    +    #resolveParts(dirParts) {
    +        let p = this;
    +        for (const part of dirParts) {
    +            p = p.child(part);
    +        }
    +        return p;
    +    }
    +    /**
    +     * Returns the cached children Path objects, if still available.  If they
    +     * have fallen out of the cache, then returns an empty array, and resets the
    +     * READDIR_CALLED bit, so that future calls to readdir() will require an fs
    +     * lookup.
    +     *
    +     * @internal
    +     */
    +    children() {
    +        const cached = this.#children.get(this);
    +        if (cached) {
    +            return cached;
    +        }
    +        const children = Object.assign([], { provisional: 0 });
    +        this.#children.set(this, children);
    +        this.#type &= ~READDIR_CALLED;
    +        return children;
    +    }
    +    /**
    +     * Resolves a path portion and returns or creates the child Path.
    +     *
    +     * Returns `this` if pathPart is `''` or `'.'`, or `parent` if pathPart is
    +     * `'..'`.
    +     *
    +     * This should not be called directly.  If `pathPart` contains any path
    +     * separators, it will lead to unsafe undefined behavior.
    +     *
    +     * Use `Path.resolve()` instead.
    +     *
    +     * @internal
    +     */
    +    child(pathPart, opts) {
    +        if (pathPart === '' || pathPart === '.') {
    +            return this;
    +        }
    +        if (pathPart === '..') {
    +            return this.parent || this;
    +        }
    +        // find the child
    +        const children = this.children();
    +        const name = this.nocase
    +            ? normalizeNocase(pathPart)
    +            : normalize(pathPart);
    +        for (const p of children) {
    +            if (p.#matchName === name) {
    +                return p;
    +            }
    +        }
    +        // didn't find it, create provisional child, since it might not
    +        // actually exist.  If we know the parent isn't a dir, then
    +        // in fact it CAN'T exist.
    +        const s = this.parent ? this.sep : '';
    +        const fullpath = this.#fullpath
    +            ? this.#fullpath + s + pathPart
    +            : undefined;
    +        const pchild = this.newChild(pathPart, UNKNOWN, {
    +            ...opts,
    +            parent: this,
    +            fullpath,
    +        });
    +        if (!this.canReaddir()) {
    +            pchild.#type |= ENOENT;
    +        }
    +        // don't have to update provisional, because if we have real children,
    +        // then provisional is set to children.length, otherwise a lower number
    +        children.push(pchild);
    +        return pchild;
    +    }
    +    /**
    +     * The relative path from the cwd. If it does not share an ancestor with
    +     * the cwd, then this ends up being equivalent to the fullpath()
    +     */
    +    // TODO: instead of taking a param here, set it to '' in the constructor
    +    // for the CWD, and set it to this.name for any roots.
    +    relative() {
    +        if (this.#relative !== undefined) {
    +            return this.#relative;
    +        }
    +        const name = this.name;
    +        const p = this.parent;
    +        if (!p) {
    +            return (this.#relative = this.name);
    +        }
    +        const pv = p.relative();
    +        const rp = pv + (!pv || !p.parent ? '' : this.sep) + name;
    +        return (this.#relative = rp);
    +    }
    +    /**
    +     * The fully resolved path string for this Path entry
    +     */
    +    fullpath() {
    +        if (this.#fullpath !== undefined) {
    +            return this.#fullpath;
    +        }
    +        const name = this.name;
    +        const p = this.parent;
    +        if (!p) {
    +            return (this.#fullpath = this.name);
    +        }
    +        const pv = p.fullpath();
    +        const fp = pv + (!p.parent ? '' : this.sep) + name;
    +        return (this.#fullpath = fp);
    +    }
    +    /**
    +     * Is the Path of an unknown type?
    +     *
    +     * Note that we might know *something* about it if there has been a previous
    +     * filesystem operation, for example that it does not exist, or is not a
    +     * link, or whether it has child entries.
    +     */
    +    isUnknown() {
    +        return (this.#type & IFMT) === UNKNOWN;
    +    }
    +    /**
    +     * Is the Path a regular file?
    +     */
    +    isFile() {
    +        return (this.#type & IFMT) === IFREG;
    +    }
    +    /**
    +     * Is the Path a directory?
    +     */
    +    isDirectory() {
    +        return (this.#type & IFMT) === IFDIR;
    +    }
    +    /**
    +     * Is the path a character device?
    +     */
    +    isCharacterDevice() {
    +        return (this.#type & IFMT) === IFCHR;
    +    }
    +    /**
    +     * Is the path a block device?
    +     */
    +    isBlockDevice() {
    +        return (this.#type & IFMT) === IFBLK;
    +    }
    +    /**
    +     * Is the path a FIFO pipe?
    +     */
    +    isFIFO() {
    +        return (this.#type & IFMT) === IFIFO;
    +    }
    +    /**
    +     * Is the path a socket?
    +     */
    +    isSocket() {
    +        return (this.#type & IFMT) === IFSOCK;
    +    }
    +    /**
    +     * Is the path a symbolic link?
    +     */
    +    isSymbolicLink() {
    +        return (this.#type & IFLNK) === IFLNK;
    +    }
    +    /**
    +     * Return the entry if it has been subject of a successful lstat, or
    +     * undefined otherwise.
    +     *
    +     * Does not read the filesystem, so an undefined result *could* simply
    +     * mean that we haven't called lstat on it.
    +     */
    +    lstatCached() {
    +        return this.#type & LSTAT_CALLED ? this : undefined;
    +    }
    +    /**
    +     * Return the cached link target if the entry has been the subject of a
    +     * successful readlink, or undefined otherwise.
    +     *
    +     * Does not read the filesystem, so an undefined result *could* just mean we
    +     * don't have any cached data. Only use it if you are very sure that a
    +     * readlink() has been called at some point.
    +     */
    +    readlinkCached() {
    +        return this.#linkTarget;
    +    }
    +    /**
    +     * Returns the cached realpath target if the entry has been the subject
    +     * of a successful realpath, or undefined otherwise.
    +     *
    +     * Does not read the filesystem, so an undefined result *could* just mean we
    +     * don't have any cached data. Only use it if you are very sure that a
    +     * realpath() has been called at some point.
    +     */
    +    realpathCached() {
    +        return this.#realpath;
    +    }
    +    /**
    +     * Returns the cached child Path entries array if the entry has been the
    +     * subject of a successful readdir(), or [] otherwise.
    +     *
    +     * Does not read the filesystem, so an empty array *could* just mean we
    +     * don't have any cached data. Only use it if you are very sure that a
    +     * readdir() has been called recently enough to still be valid.
    +     */
    +    readdirCached() {
    +        const children = this.children();
    +        return children.slice(0, children.provisional);
    +    }
    +    /**
    +     * Return true if it's worth trying to readlink.  Ie, we don't (yet) have
    +     * any indication that readlink will definitely fail.
    +     *
    +     * Returns false if the path is known to not be a symlink, if a previous
    +     * readlink failed, or if the entry does not exist.
    +     */
    +    canReadlink() {
    +        if (this.#linkTarget)
    +            return true;
    +        if (!this.parent)
    +            return false;
    +        // cases where it cannot possibly succeed
    +        const ifmt = this.#type & IFMT;
    +        return !((ifmt !== UNKNOWN && ifmt !== IFLNK) ||
    +            this.#type & ENOREADLINK ||
    +            this.#type & ENOENT);
    +    }
    +    /**
    +     * Return true if readdir has previously been successfully called on this
    +     * path, indicating that cachedReaddir() is likely valid.
    +     */
    +    calledReaddir() {
    +        return !!(this.#type & READDIR_CALLED);
    +    }
    +    /**
    +     * Returns true if the path is known to not exist. That is, a previous lstat
    +     * or readdir failed to verify its existence when that would have been
    +     * expected, or a parent entry was marked either enoent or enotdir.
    +     */
    +    isENOENT() {
    +        return !!(this.#type & ENOENT);
    +    }
    +    /**
    +     * Return true if the path is a match for the given path name.  This handles
    +     * case sensitivity and unicode normalization.
    +     *
    +     * Note: even on case-sensitive systems, it is **not** safe to test the
    +     * equality of the `.name` property to determine whether a given pathname
    +     * matches, due to unicode normalization mismatches.
    +     *
    +     * Always use this method instead of testing the `path.name` property
    +     * directly.
    +     */
    +    isNamed(n) {
    +        return !this.nocase
    +            ? this.#matchName === normalize(n)
    +            : this.#matchName === normalizeNocase(n);
    +    }
    +    /**
    +     * Return the Path object corresponding to the target of a symbolic link.
    +     *
    +     * If the Path is not a symbolic link, or if the readlink call fails for any
    +     * reason, `undefined` is returned.
    +     *
    +     * Result is cached, and thus may be outdated if the filesystem is mutated.
    +     */
    +    async readlink() {
    +        const target = this.#linkTarget;
    +        if (target) {
    +            return target;
    +        }
    +        if (!this.canReadlink()) {
    +            return undefined;
    +        }
    +        /* c8 ignore start */
    +        // already covered by the canReadlink test, here for ts grumples
    +        if (!this.parent) {
    +            return undefined;
    +        }
    +        /* c8 ignore stop */
    +        try {
    +            const read = await this.#fs.promises.readlink(this.fullpath());
    +            const linkTarget = this.parent.resolve(read);
    +            if (linkTarget) {
    +                return (this.#linkTarget = linkTarget);
    +            }
    +        }
    +        catch (er) {
    +            this.#readlinkFail(er.code);
    +            return undefined;
    +        }
    +    }
    +    /**
    +     * Synchronous {@link PathBase.readlink}
    +     */
    +    readlinkSync() {
    +        const target = this.#linkTarget;
    +        if (target) {
    +            return target;
    +        }
    +        if (!this.canReadlink()) {
    +            return undefined;
    +        }
    +        /* c8 ignore start */
    +        // already covered by the canReadlink test, here for ts grumples
    +        if (!this.parent) {
    +            return undefined;
    +        }
    +        /* c8 ignore stop */
    +        try {
    +            const read = this.#fs.readlinkSync(this.fullpath());
    +            const linkTarget = this.parent.resolve(read);
    +            if (linkTarget) {
    +                return (this.#linkTarget = linkTarget);
    +            }
    +        }
    +        catch (er) {
    +            this.#readlinkFail(er.code);
    +            return undefined;
    +        }
    +    }
    +    #readdirSuccess(children) {
    +        // succeeded, mark readdir called bit
    +        this.#type |= READDIR_CALLED;
    +        // mark all remaining provisional children as ENOENT
    +        for (let p = children.provisional; p < children.length; p++) {
    +            children[p].#markENOENT();
    +        }
    +    }
    +    #markENOENT() {
    +        // mark as UNKNOWN and ENOENT
    +        if (this.#type & ENOENT)
    +            return;
    +        this.#type = (this.#type | ENOENT) & IFMT_UNKNOWN;
    +        this.#markChildrenENOENT();
    +    }
    +    #markChildrenENOENT() {
    +        // all children are provisional and do not exist
    +        const children = this.children();
    +        children.provisional = 0;
    +        for (const p of children) {
    +            p.#markENOENT();
    +        }
    +    }
    +    #markENOREALPATH() {
    +        this.#type |= ENOREALPATH;
    +        this.#markENOTDIR();
    +    }
    +    // save the information when we know the entry is not a dir
    +    #markENOTDIR() {
    +        // entry is not a directory, so any children can't exist.
    +        // this *should* be impossible, since any children created
    +        // after it's been marked ENOTDIR should be marked ENOENT,
    +        // so it won't even get to this point.
    +        /* c8 ignore start */
    +        if (this.#type & ENOTDIR)
    +            return;
    +        /* c8 ignore stop */
    +        let t = this.#type;
    +        // this could happen if we stat a dir, then delete it,
    +        // then try to read it or one of its children.
    +        if ((t & IFMT) === IFDIR)
    +            t &= IFMT_UNKNOWN;
    +        this.#type = t | ENOTDIR;
    +        this.#markChildrenENOENT();
    +    }
    +    #readdirFail(code = '') {
    +        // markENOTDIR and markENOENT also set provisional=0
    +        if (code === 'ENOTDIR' || code === 'EPERM') {
    +            this.#markENOTDIR();
    +        }
    +        else if (code === 'ENOENT') {
    +            this.#markENOENT();
    +        }
    +        else {
    +            this.children().provisional = 0;
    +        }
    +    }
    +    #lstatFail(code = '') {
    +        // Windows just raises ENOENT in this case, disable for win CI
    +        /* c8 ignore start */
    +        if (code === 'ENOTDIR') {
    +            // already know it has a parent by this point
    +            const p = this.parent;
    +            p.#markENOTDIR();
    +        }
    +        else if (code === 'ENOENT') {
    +            /* c8 ignore stop */
    +            this.#markENOENT();
    +        }
    +    }
    +    #readlinkFail(code = '') {
    +        let ter = this.#type;
    +        ter |= ENOREADLINK;
    +        if (code === 'ENOENT')
    +            ter |= ENOENT;
    +        // windows gets a weird error when you try to readlink a file
    +        if (code === 'EINVAL' || code === 'UNKNOWN') {
    +            // exists, but not a symlink, we don't know WHAT it is, so remove
    +            // all IFMT bits.
    +            ter &= IFMT_UNKNOWN;
    +        }
    +        this.#type = ter;
    +        // windows just gets ENOENT in this case.  We do cover the case,
    +        // just disabled because it's impossible on Windows CI
    +        /* c8 ignore start */
    +        if (code === 'ENOTDIR' && this.parent) {
    +            this.parent.#markENOTDIR();
    +        }
    +        /* c8 ignore stop */
    +    }
    +    #readdirAddChild(e, c) {
    +        return (this.#readdirMaybePromoteChild(e, c) ||
    +            this.#readdirAddNewChild(e, c));
    +    }
    +    #readdirAddNewChild(e, c) {
    +        // alloc new entry at head, so it's never provisional
    +        const type = entToType(e);
    +        const child = this.newChild(e.name, type, { parent: this });
    +        const ifmt = child.#type & IFMT;
    +        if (ifmt !== IFDIR && ifmt !== IFLNK && ifmt !== UNKNOWN) {
    +            child.#type |= ENOTDIR;
    +        }
    +        c.unshift(child);
    +        c.provisional++;
    +        return child;
    +    }
    +    #readdirMaybePromoteChild(e, c) {
    +        for (let p = c.provisional; p < c.length; p++) {
    +            const pchild = c[p];
    +            const name = this.nocase
    +                ? normalizeNocase(e.name)
    +                : normalize(e.name);
    +            if (name !== pchild.#matchName) {
    +                continue;
    +            }
    +            return this.#readdirPromoteChild(e, pchild, p, c);
    +        }
    +    }
    +    #readdirPromoteChild(e, p, index, c) {
    +        const v = p.name;
    +        // retain any other flags, but set ifmt from dirent
    +        p.#type = (p.#type & IFMT_UNKNOWN) | entToType(e);
    +        // case sensitivity fixing when we learn the true name.
    +        if (v !== e.name)
    +            p.name = e.name;
    +        // just advance provisional index (potentially off the list),
    +        // otherwise we have to splice/pop it out and re-insert at head
    +        if (index !== c.provisional) {
    +            if (index === c.length - 1)
    +                c.pop();
    +            else
    +                c.splice(index, 1);
    +            c.unshift(p);
    +        }
    +        c.provisional++;
    +        return p;
    +    }
    +    /**
    +     * Call lstat() on this Path, and update all known information that can be
    +     * determined.
    +     *
    +     * Note that unlike `fs.lstat()`, the returned value does not contain some
    +     * information, such as `mode`, `dev`, `nlink`, and `ino`.  If that
    +     * information is required, you will need to call `fs.lstat` yourself.
    +     *
    +     * If the Path refers to a nonexistent file, or if the lstat call fails for
    +     * any reason, `undefined` is returned.  Otherwise the updated Path object is
    +     * returned.
    +     *
    +     * Results are cached, and thus may be out of date if the filesystem is
    +     * mutated.
    +     */
    +    async lstat() {
    +        if ((this.#type & ENOENT) === 0) {
    +            try {
    +                this.#applyStat(await this.#fs.promises.lstat(this.fullpath()));
    +                return this;
    +            }
    +            catch (er) {
    +                this.#lstatFail(er.code);
    +            }
    +        }
    +    }
    +    /**
    +     * synchronous {@link PathBase.lstat}
    +     */
    +    lstatSync() {
    +        if ((this.#type & ENOENT) === 0) {
    +            try {
    +                this.#applyStat(this.#fs.lstatSync(this.fullpath()));
    +                return this;
    +            }
    +            catch (er) {
    +                this.#lstatFail(er.code);
    +            }
    +        }
    +    }
    +    #applyStat(st) {
    +        const { atime, atimeMs, birthtime, birthtimeMs, blksize, blocks, ctime, ctimeMs, dev, gid, ino, mode, mtime, mtimeMs, nlink, rdev, size, uid, } = st;
    +        this.#atime = atime;
    +        this.#atimeMs = atimeMs;
    +        this.#birthtime = birthtime;
    +        this.#birthtimeMs = birthtimeMs;
    +        this.#blksize = blksize;
    +        this.#blocks = blocks;
    +        this.#ctime = ctime;
    +        this.#ctimeMs = ctimeMs;
    +        this.#dev = dev;
    +        this.#gid = gid;
    +        this.#ino = ino;
    +        this.#mode = mode;
    +        this.#mtime = mtime;
    +        this.#mtimeMs = mtimeMs;
    +        this.#nlink = nlink;
    +        this.#rdev = rdev;
    +        this.#size = size;
    +        this.#uid = uid;
    +        const ifmt = entToType(st);
    +        // retain any other flags, but set the ifmt
    +        this.#type = (this.#type & IFMT_UNKNOWN) | ifmt | LSTAT_CALLED;
    +        if (ifmt !== UNKNOWN && ifmt !== IFDIR && ifmt !== IFLNK) {
    +            this.#type |= ENOTDIR;
    +        }
    +    }
    +    #onReaddirCB = [];
    +    #readdirCBInFlight = false;
    +    #callOnReaddirCB(children) {
    +        this.#readdirCBInFlight = false;
    +        const cbs = this.#onReaddirCB.slice();
    +        this.#onReaddirCB.length = 0;
    +        cbs.forEach(cb => cb(null, children));
    +    }
    +    /**
    +     * Standard node-style callback interface to get list of directory entries.
    +     *
    +     * If the Path cannot or does not contain any children, then an empty array
    +     * is returned.
    +     *
    +     * Results are cached, and thus may be out of date if the filesystem is
    +     * mutated.
    +     *
    +     * @param cb The callback called with (er, entries).  Note that the `er`
    +     * param is somewhat extraneous, as all readdir() errors are handled and
    +     * simply result in an empty set of entries being returned.
    +     * @param allowZalgo Boolean indicating that immediately known results should
    +     * *not* be deferred with `queueMicrotask`. Defaults to `false`. Release
    +     * zalgo at your peril, the dark pony lord is devious and unforgiving.
    +     */
    +    readdirCB(cb, allowZalgo = false) {
    +        if (!this.canReaddir()) {
    +            if (allowZalgo)
    +                cb(null, []);
    +            else
    +                queueMicrotask(() => cb(null, []));
    +            return;
    +        }
    +        const children = this.children();
    +        if (this.calledReaddir()) {
    +            const c = children.slice(0, children.provisional);
    +            if (allowZalgo)
    +                cb(null, c);
    +            else
    +                queueMicrotask(() => cb(null, c));
    +            return;
    +        }
    +        // don't have to worry about zalgo at this point.
    +        this.#onReaddirCB.push(cb);
    +        if (this.#readdirCBInFlight) {
    +            return;
    +        }
    +        this.#readdirCBInFlight = true;
    +        // else read the directory, fill up children
    +        // de-provisionalize any provisional children.
    +        const fullpath = this.fullpath();
    +        this.#fs.readdir(fullpath, { withFileTypes: true }, (er, entries) => {
    +            if (er) {
    +                this.#readdirFail(er.code);
    +                children.provisional = 0;
    +            }
    +            else {
    +                // if we didn't get an error, we always get entries.
    +                //@ts-ignore
    +                for (const e of entries) {
    +                    this.#readdirAddChild(e, children);
    +                }
    +                this.#readdirSuccess(children);
    +            }
    +            this.#callOnReaddirCB(children.slice(0, children.provisional));
    +            return;
    +        });
    +    }
    +    #asyncReaddirInFlight;
    +    /**
    +     * Return an array of known child entries.
    +     *
    +     * If the Path cannot or does not contain any children, then an empty array
    +     * is returned.
    +     *
    +     * Results are cached, and thus may be out of date if the filesystem is
    +     * mutated.
    +     */
    +    async readdir() {
    +        if (!this.canReaddir()) {
    +            return [];
    +        }
    +        const children = this.children();
    +        if (this.calledReaddir()) {
    +            return children.slice(0, children.provisional);
    +        }
    +        // else read the directory, fill up children
    +        // de-provisionalize any provisional children.
    +        const fullpath = this.fullpath();
    +        if (this.#asyncReaddirInFlight) {
    +            await this.#asyncReaddirInFlight;
    +        }
    +        else {
    +            /* c8 ignore start */
    +            let resolve = () => { };
    +            /* c8 ignore stop */
    +            this.#asyncReaddirInFlight = new Promise(res => (resolve = res));
    +            try {
    +                for (const e of await this.#fs.promises.readdir(fullpath, {
    +                    withFileTypes: true,
    +                })) {
    +                    this.#readdirAddChild(e, children);
    +                }
    +                this.#readdirSuccess(children);
    +            }
    +            catch (er) {
    +                this.#readdirFail(er.code);
    +                children.provisional = 0;
    +            }
    +            this.#asyncReaddirInFlight = undefined;
    +            resolve();
    +        }
    +        return children.slice(0, children.provisional);
    +    }
    +    /**
    +     * synchronous {@link PathBase.readdir}
    +     */
    +    readdirSync() {
    +        if (!this.canReaddir()) {
    +            return [];
    +        }
    +        const children = this.children();
    +        if (this.calledReaddir()) {
    +            return children.slice(0, children.provisional);
    +        }
    +        // else read the directory, fill up children
    +        // de-provisionalize any provisional children.
    +        const fullpath = this.fullpath();
    +        try {
    +            for (const e of this.#fs.readdirSync(fullpath, {
    +                withFileTypes: true,
    +            })) {
    +                this.#readdirAddChild(e, children);
    +            }
    +            this.#readdirSuccess(children);
    +        }
    +        catch (er) {
    +            this.#readdirFail(er.code);
    +            children.provisional = 0;
    +        }
    +        return children.slice(0, children.provisional);
    +    }
    +    canReaddir() {
    +        if (this.#type & ENOCHILD)
    +            return false;
    +        const ifmt = IFMT & this.#type;
    +        // we always set ENOTDIR when setting IFMT, so should be impossible
    +        /* c8 ignore start */
    +        if (!(ifmt === UNKNOWN || ifmt === IFDIR || ifmt === IFLNK)) {
    +            return false;
    +        }
    +        /* c8 ignore stop */
    +        return true;
    +    }
    +    shouldWalk(dirs, walkFilter) {
    +        return ((this.#type & IFDIR) === IFDIR &&
    +            !(this.#type & ENOCHILD) &&
    +            !dirs.has(this) &&
    +            (!walkFilter || walkFilter(this)));
    +    }
    +    /**
    +     * Return the Path object corresponding to path as resolved
    +     * by realpath(3).
    +     *
    +     * If the realpath call fails for any reason, `undefined` is returned.
    +     *
    +     * Result is cached, and thus may be outdated if the filesystem is mutated.
    +     * On success, returns a Path object.
    +     */
    +    async realpath() {
    +        if (this.#realpath)
    +            return this.#realpath;
    +        if ((ENOREALPATH | ENOREADLINK | ENOENT) & this.#type)
    +            return undefined;
    +        try {
    +            const rp = await this.#fs.promises.realpath(this.fullpath());
    +            return (this.#realpath = this.resolve(rp));
    +        }
    +        catch (_) {
    +            this.#markENOREALPATH();
    +        }
    +    }
    +    /**
    +     * Synchronous {@link realpath}
    +     */
    +    realpathSync() {
    +        if (this.#realpath)
    +            return this.#realpath;
    +        if ((ENOREALPATH | ENOREADLINK | ENOENT) & this.#type)
    +            return undefined;
    +        try {
    +            const rp = this.#fs.realpathSync(this.fullpath());
    +            return (this.#realpath = this.resolve(rp));
    +        }
    +        catch (_) {
    +            this.#markENOREALPATH();
    +        }
    +    }
    +}
    +/**
    + * Path class used on win32 systems
    + *
    + * Uses `'\\'` as the path separator for returned paths, either `'\\'` or `'/'`
    + * as the path separator for parsing paths.
    + */
    +export class PathWin32 extends PathBase {
    +    /**
    +     * Separator for generating path strings.
    +     */
    +    sep = '\\';
    +    /**
    +     * Separator for parsing path strings.
    +     */
    +    splitSep = eitherSep;
    +    /**
    +     * Do not create new Path objects directly.  They should always be accessed
    +     * via the PathScurry class or other methods on the Path class.
    +     *
    +     * @internal
    +     */
    +    constructor(name, type = UNKNOWN, root, roots, nocase, children, opts) {
    +        super(name, type, root, roots, nocase, children, opts);
    +    }
    +    /**
    +     * @internal
    +     */
    +    newChild(name, type = UNKNOWN, opts = {}) {
    +        return new PathWin32(name, type, this.root, this.roots, this.nocase, this.childrenCache(), opts);
    +    }
    +    /**
    +     * @internal
    +     */
    +    getRootString(path) {
    +        return win32.parse(path).root;
    +    }
    +    /**
    +     * @internal
    +     */
    +    getRoot(rootPath) {
    +        rootPath = uncToDrive(rootPath.toUpperCase());
    +        if (rootPath === this.root.name) {
    +            return this.root;
    +        }
    +        // ok, not that one, check if it matches another we know about
    +        for (const [compare, root] of Object.entries(this.roots)) {
    +            if (this.sameRoot(rootPath, compare)) {
    +                return (this.roots[rootPath] = root);
    +            }
    +        }
    +        // otherwise, have to create a new one.
    +        return (this.roots[rootPath] = new PathScurryWin32(rootPath, this).root);
    +    }
    +    /**
    +     * @internal
    +     */
    +    sameRoot(rootPath, compare = this.root.name) {
    +        // windows can (rarely) have case-sensitive filesystem, but
    +        // UNC and drive letters are always case-insensitive, and canonically
    +        // represented uppercase.
    +        rootPath = rootPath
    +            .toUpperCase()
    +            .replace(/\//g, '\\')
    +            .replace(uncDriveRegexp, '$1\\');
    +        return rootPath === compare;
    +    }
    +}
    +/**
    + * Path class used on all posix systems.
    + *
    + * Uses `'/'` as the path separator.
    + */
    +export class PathPosix extends PathBase {
    +    /**
    +     * separator for parsing path strings
    +     */
    +    splitSep = '/';
    +    /**
    +     * separator for generating path strings
    +     */
    +    sep = '/';
    +    /**
    +     * Do not create new Path objects directly.  They should always be accessed
    +     * via the PathScurry class or other methods on the Path class.
    +     *
    +     * @internal
    +     */
    +    constructor(name, type = UNKNOWN, root, roots, nocase, children, opts) {
    +        super(name, type, root, roots, nocase, children, opts);
    +    }
    +    /**
    +     * @internal
    +     */
    +    getRootString(path) {
    +        return path.startsWith('/') ? '/' : '';
    +    }
    +    /**
    +     * @internal
    +     */
    +    getRoot(_rootPath) {
    +        return this.root;
    +    }
    +    /**
    +     * @internal
    +     */
    +    newChild(name, type = UNKNOWN, opts = {}) {
    +        return new PathPosix(name, type, this.root, this.roots, this.nocase, this.childrenCache(), opts);
    +    }
    +}
    +/**
    + * The base class for all PathScurry classes, providing the interface for path
    + * resolution and filesystem operations.
    + *
    + * Typically, you should *not* instantiate this class directly, but rather one
    + * of the platform-specific classes, or the exported {@link PathScurry} which
    + * defaults to the current platform.
    + */
    +export class PathScurryBase {
    +    /**
    +     * The root Path entry for the current working directory of this Scurry
    +     */
    +    root;
    +    /**
    +     * The string path for the root of this Scurry's current working directory
    +     */
    +    rootPath;
    +    /**
    +     * A collection of all roots encountered, referenced by rootPath
    +     */
    +    roots;
    +    /**
    +     * The Path entry corresponding to this PathScurry's current working directory.
    +     */
    +    cwd;
    +    #resolveCache;
    +    #children;
    +    /**
    +     * Perform path comparisons case-insensitively.
    +     *
    +     * Defaults true on Darwin and Windows systems, false elsewhere.
    +     */
    +    nocase;
    +    #fs;
    +    /**
    +     * This class should not be instantiated directly.
    +     *
    +     * Use PathScurryWin32, PathScurryDarwin, PathScurryPosix, or PathScurry
    +     *
    +     * @internal
    +     */
    +    constructor(cwd = process.cwd(), pathImpl, sep, { nocase, childrenCacheSize = 16 * 1024, fs = defaultFS, } = {}) {
    +        this.#fs = fsFromOption(fs);
    +        if (cwd instanceof URL || cwd.startsWith('file://')) {
    +            cwd = fileURLToPath(cwd);
    +        }
    +        // resolve and split root, and then add to the store.
    +        // this is the only time we call path.resolve()
    +        const cwdPath = pathImpl.resolve(cwd);
    +        this.roots = Object.create(null);
    +        this.rootPath = this.parseRootPath(cwdPath);
    +        this.#resolveCache = new ResolveCache();
    +        this.#children = new ChildrenCache(childrenCacheSize);
    +        const split = cwdPath.substring(this.rootPath.length).split(sep);
    +        // resolve('/') leaves '', splits to [''], we don't want that.
    +        if (split.length === 1 && !split[0]) {
    +            split.pop();
    +        }
    +        /* c8 ignore start */
    +        if (nocase === undefined) {
    +            throw new TypeError('must provide nocase setting to PathScurryBase ctor');
    +        }
    +        /* c8 ignore stop */
    +        this.nocase = nocase;
    +        this.root = this.newRoot(this.#fs);
    +        this.roots[this.rootPath] = this.root;
    +        let prev = this.root;
    +        let len = split.length - 1;
    +        const joinSep = pathImpl.sep;
    +        let abs = this.rootPath;
    +        let sawFirst = false;
    +        for (const part of split) {
    +            prev = prev.child(part, {
    +                relative: new Array(len--).fill('..').join(joinSep),
    +                fullpath: (abs += (sawFirst ? '' : joinSep) + part),
    +            });
    +            sawFirst = true;
    +        }
    +        this.cwd = prev;
    +    }
    +    /**
    +     * Get the depth of a provided path, string, or the cwd
    +     */
    +    depth(path = this.cwd) {
    +        if (typeof path === 'string') {
    +            path = this.cwd.resolve(path);
    +        }
    +        return path.depth();
    +    }
    +    /**
    +     * Return the cache of child entries.  Exposed so subclasses can create
    +     * child Path objects in a platform-specific way.
    +     *
    +     * @internal
    +     */
    +    childrenCache() {
    +        return this.#children;
    +    }
    +    /**
    +     * Resolve one or more path strings to a resolved string
    +     *
    +     * Same interface as require('path').resolve.
    +     *
    +     * Much faster than path.resolve() when called multiple times for the same
    +     * path, because the resolved Path objects are cached.  Much slower
    +     * otherwise.
    +     */
    +    resolve(...paths) {
    +        // first figure out the minimum number of paths we have to test
    +        // we always start at cwd, but any absolutes will bump the start
    +        let r = '';
    +        for (let i = paths.length - 1; i >= 0; i--) {
    +            const p = paths[i];
    +            if (!p || p === '.')
    +                continue;
    +            r = r ? `${p}/${r}` : p;
    +            if (this.isAbsolute(p)) {
    +                break;
    +            }
    +        }
    +        const cached = this.#resolveCache.get(r);
    +        if (cached !== undefined) {
    +            return cached;
    +        }
    +        const result = this.cwd.resolve(r).fullpath();
    +        this.#resolveCache.set(r, result);
    +        return result;
    +    }
    +    /**
    +     * find the relative path from the cwd to the supplied path string or entry
    +     */
    +    relative(entry = this.cwd) {
    +        if (typeof entry === 'string') {
    +            entry = this.cwd.resolve(entry);
    +        }
    +        return entry.relative();
    +    }
    +    /**
    +     * Return the basename for the provided string or Path object
    +     */
    +    basename(entry = this.cwd) {
    +        if (typeof entry === 'string') {
    +            entry = this.cwd.resolve(entry);
    +        }
    +        return entry.name;
    +    }
    +    /**
    +     * Return the dirname for the provided string or Path object
    +     */
    +    dirname(entry = this.cwd) {
    +        if (typeof entry === 'string') {
    +            entry = this.cwd.resolve(entry);
    +        }
    +        return (entry.parent || entry).fullpath();
    +    }
    +    async readdir(entry = this.cwd, opts = {
    +        withFileTypes: true,
    +    }) {
    +        if (typeof entry === 'string') {
    +            entry = this.cwd.resolve(entry);
    +        }
    +        else if (!(entry instanceof PathBase)) {
    +            opts = entry;
    +            entry = this.cwd;
    +        }
    +        const { withFileTypes } = opts;
    +        if (!entry.canReaddir()) {
    +            return [];
    +        }
    +        else {
    +            const p = await entry.readdir();
    +            return withFileTypes ? p : p.map(e => e.name);
    +        }
    +    }
    +    readdirSync(entry = this.cwd, opts = {
    +        withFileTypes: true,
    +    }) {
    +        if (typeof entry === 'string') {
    +            entry = this.cwd.resolve(entry);
    +        }
    +        else if (!(entry instanceof PathBase)) {
    +            opts = entry;
    +            entry = this.cwd;
    +        }
    +        const { withFileTypes = true } = opts;
    +        if (!entry.canReaddir()) {
    +            return [];
    +        }
    +        else if (withFileTypes) {
    +            return entry.readdirSync();
    +        }
    +        else {
    +            return entry.readdirSync().map(e => e.name);
    +        }
    +    }
    +    /**
    +     * Call lstat() on the string or Path object, and update all known
    +     * information that can be determined.
    +     *
    +     * Note that unlike `fs.lstat()`, the returned value does not contain some
    +     * information, such as `mode`, `dev`, `nlink`, and `ino`.  If that
    +     * information is required, you will need to call `fs.lstat` yourself.
    +     *
    +     * If the Path refers to a nonexistent file, or if the lstat call fails for
    +     * any reason, `undefined` is returned.  Otherwise the updated Path object is
    +     * returned.
    +     *
    +     * Results are cached, and thus may be out of date if the filesystem is
    +     * mutated.
    +     */
    +    async lstat(entry = this.cwd) {
    +        if (typeof entry === 'string') {
    +            entry = this.cwd.resolve(entry);
    +        }
    +        return entry.lstat();
    +    }
    +    /**
    +     * synchronous {@link PathScurryBase.lstat}
    +     */
    +    lstatSync(entry = this.cwd) {
    +        if (typeof entry === 'string') {
    +            entry = this.cwd.resolve(entry);
    +        }
    +        return entry.lstatSync();
    +    }
    +    async readlink(entry = this.cwd, { withFileTypes } = {
    +        withFileTypes: false,
    +    }) {
    +        if (typeof entry === 'string') {
    +            entry = this.cwd.resolve(entry);
    +        }
    +        else if (!(entry instanceof PathBase)) {
    +            withFileTypes = entry.withFileTypes;
    +            entry = this.cwd;
    +        }
    +        const e = await entry.readlink();
    +        return withFileTypes ? e : e?.fullpath();
    +    }
    +    readlinkSync(entry = this.cwd, { withFileTypes } = {
    +        withFileTypes: false,
    +    }) {
    +        if (typeof entry === 'string') {
    +            entry = this.cwd.resolve(entry);
    +        }
    +        else if (!(entry instanceof PathBase)) {
    +            withFileTypes = entry.withFileTypes;
    +            entry = this.cwd;
    +        }
    +        const e = entry.readlinkSync();
    +        return withFileTypes ? e : e?.fullpath();
    +    }
    +    async realpath(entry = this.cwd, { withFileTypes } = {
    +        withFileTypes: false,
    +    }) {
    +        if (typeof entry === 'string') {
    +            entry = this.cwd.resolve(entry);
    +        }
    +        else if (!(entry instanceof PathBase)) {
    +            withFileTypes = entry.withFileTypes;
    +            entry = this.cwd;
    +        }
    +        const e = await entry.realpath();
    +        return withFileTypes ? e : e?.fullpath();
    +    }
    +    realpathSync(entry = this.cwd, { withFileTypes } = {
    +        withFileTypes: false,
    +    }) {
    +        if (typeof entry === 'string') {
    +            entry = this.cwd.resolve(entry);
    +        }
    +        else if (!(entry instanceof PathBase)) {
    +            withFileTypes = entry.withFileTypes;
    +            entry = this.cwd;
    +        }
    +        const e = entry.realpathSync();
    +        return withFileTypes ? e : e?.fullpath();
    +    }
    +    async walk(entry = this.cwd, opts = {}) {
    +        if (typeof entry === 'string') {
    +            entry = this.cwd.resolve(entry);
    +        }
    +        else if (!(entry instanceof PathBase)) {
    +            opts = entry;
    +            entry = this.cwd;
    +        }
    +        const { withFileTypes = true, follow = false, filter, walkFilter, } = opts;
    +        const results = [];
    +        if (!filter || filter(entry)) {
    +            results.push(withFileTypes ? entry : entry.fullpath());
    +        }
    +        const dirs = new Set();
    +        const walk = (dir, cb) => {
    +            dirs.add(dir);
    +            dir.readdirCB((er, entries) => {
    +                /* c8 ignore start */
    +                if (er) {
    +                    return cb(er);
    +                }
    +                /* c8 ignore stop */
    +                let len = entries.length;
    +                if (!len)
    +                    return cb();
    +                const next = () => {
    +                    if (--len === 0) {
    +                        cb();
    +                    }
    +                };
    +                for (const e of entries) {
    +                    if (!filter || filter(e)) {
    +                        results.push(withFileTypes ? e : e.fullpath());
    +                    }
    +                    if (follow && e.isSymbolicLink()) {
    +                        e.realpath()
    +                            .then(r => (r?.isUnknown() ? r.lstat() : r))
    +                            .then(r => r?.shouldWalk(dirs, walkFilter) ? walk(r, next) : next());
    +                    }
    +                    else {
    +                        if (e.shouldWalk(dirs, walkFilter)) {
    +                            walk(e, next);
    +                        }
    +                        else {
    +                            next();
    +                        }
    +                    }
    +                }
    +            }, true); // zalgooooooo
    +        };
    +        const start = entry;
    +        return new Promise((res, rej) => {
    +            walk(start, er => {
    +                /* c8 ignore start */
    +                if (er)
    +                    return rej(er);
    +                /* c8 ignore stop */
    +                res(results);
    +            });
    +        });
    +    }
    +    walkSync(entry = this.cwd, opts = {}) {
    +        if (typeof entry === 'string') {
    +            entry = this.cwd.resolve(entry);
    +        }
    +        else if (!(entry instanceof PathBase)) {
    +            opts = entry;
    +            entry = this.cwd;
    +        }
    +        const { withFileTypes = true, follow = false, filter, walkFilter, } = opts;
    +        const results = [];
    +        if (!filter || filter(entry)) {
    +            results.push(withFileTypes ? entry : entry.fullpath());
    +        }
    +        const dirs = new Set([entry]);
    +        for (const dir of dirs) {
    +            const entries = dir.readdirSync();
    +            for (const e of entries) {
    +                if (!filter || filter(e)) {
    +                    results.push(withFileTypes ? e : e.fullpath());
    +                }
    +                let r = e;
    +                if (e.isSymbolicLink()) {
    +                    if (!(follow && (r = e.realpathSync())))
    +                        continue;
    +                    if (r.isUnknown())
    +                        r.lstatSync();
    +                }
    +                if (r.shouldWalk(dirs, walkFilter)) {
    +                    dirs.add(r);
    +                }
    +            }
    +        }
    +        return results;
    +    }
    +    /**
    +     * Support for `for await`
    +     *
    +     * Alias for {@link PathScurryBase.iterate}
    +     *
    +     * Note: As of Node 19, this is very slow, compared to other methods of
    +     * walking.  Consider using {@link PathScurryBase.stream} if memory overhead
    +     * and backpressure are concerns, or {@link PathScurryBase.walk} if not.
    +     */
    +    [Symbol.asyncIterator]() {
    +        return this.iterate();
    +    }
    +    iterate(entry = this.cwd, options = {}) {
    +        // iterating async over the stream is significantly more performant,
    +        // especially in the warm-cache scenario, because it buffers up directory
    +        // entries in the background instead of waiting for a yield for each one.
    +        if (typeof entry === 'string') {
    +            entry = this.cwd.resolve(entry);
    +        }
    +        else if (!(entry instanceof PathBase)) {
    +            options = entry;
    +            entry = this.cwd;
    +        }
    +        return this.stream(entry, options)[Symbol.asyncIterator]();
    +    }
    +    /**
    +     * Iterating over a PathScurry performs a synchronous walk.
    +     *
    +     * Alias for {@link PathScurryBase.iterateSync}
    +     */
    +    [Symbol.iterator]() {
    +        return this.iterateSync();
    +    }
    +    *iterateSync(entry = this.cwd, opts = {}) {
    +        if (typeof entry === 'string') {
    +            entry = this.cwd.resolve(entry);
    +        }
    +        else if (!(entry instanceof PathBase)) {
    +            opts = entry;
    +            entry = this.cwd;
    +        }
    +        const { withFileTypes = true, follow = false, filter, walkFilter, } = opts;
    +        if (!filter || filter(entry)) {
    +            yield withFileTypes ? entry : entry.fullpath();
    +        }
    +        const dirs = new Set([entry]);
    +        for (const dir of dirs) {
    +            const entries = dir.readdirSync();
    +            for (const e of entries) {
    +                if (!filter || filter(e)) {
    +                    yield withFileTypes ? e : e.fullpath();
    +                }
    +                let r = e;
    +                if (e.isSymbolicLink()) {
    +                    if (!(follow && (r = e.realpathSync())))
    +                        continue;
    +                    if (r.isUnknown())
    +                        r.lstatSync();
    +                }
    +                if (r.shouldWalk(dirs, walkFilter)) {
    +                    dirs.add(r);
    +                }
    +            }
    +        }
    +    }
    +    stream(entry = this.cwd, opts = {}) {
    +        if (typeof entry === 'string') {
    +            entry = this.cwd.resolve(entry);
    +        }
    +        else if (!(entry instanceof PathBase)) {
    +            opts = entry;
    +            entry = this.cwd;
    +        }
    +        const { withFileTypes = true, follow = false, filter, walkFilter, } = opts;
    +        const results = new Minipass({ objectMode: true });
    +        if (!filter || filter(entry)) {
    +            results.write(withFileTypes ? entry : entry.fullpath());
    +        }
    +        const dirs = new Set();
    +        const queue = [entry];
    +        let processing = 0;
    +        const process = () => {
    +            let paused = false;
    +            while (!paused) {
    +                const dir = queue.shift();
    +                if (!dir) {
    +                    if (processing === 0)
    +                        results.end();
    +                    return;
    +                }
    +                processing++;
    +                dirs.add(dir);
    +                const onReaddir = (er, entries, didRealpaths = false) => {
    +                    /* c8 ignore start */
    +                    if (er)
    +                        return results.emit('error', er);
    +                    /* c8 ignore stop */
    +                    if (follow && !didRealpaths) {
    +                        const promises = [];
    +                        for (const e of entries) {
    +                            if (e.isSymbolicLink()) {
    +                                promises.push(e
    +                                    .realpath()
    +                                    .then((r) => r?.isUnknown() ? r.lstat() : r));
    +                            }
    +                        }
    +                        if (promises.length) {
    +                            Promise.all(promises).then(() => onReaddir(null, entries, true));
    +                            return;
    +                        }
    +                    }
    +                    for (const e of entries) {
    +                        if (e && (!filter || filter(e))) {
    +                            if (!results.write(withFileTypes ? e : e.fullpath())) {
    +                                paused = true;
    +                            }
    +                        }
    +                    }
    +                    processing--;
    +                    for (const e of entries) {
    +                        const r = e.realpathCached() || e;
    +                        if (r.shouldWalk(dirs, walkFilter)) {
    +                            queue.push(r);
    +                        }
    +                    }
    +                    if (paused && !results.flowing) {
    +                        results.once('drain', process);
    +                    }
    +                    else if (!sync) {
    +                        process();
    +                    }
    +                };
    +                // zalgo containment
    +                let sync = true;
    +                dir.readdirCB(onReaddir, true);
    +                sync = false;
    +            }
    +        };
    +        process();
    +        return results;
    +    }
    +    streamSync(entry = this.cwd, opts = {}) {
    +        if (typeof entry === 'string') {
    +            entry = this.cwd.resolve(entry);
    +        }
    +        else if (!(entry instanceof PathBase)) {
    +            opts = entry;
    +            entry = this.cwd;
    +        }
    +        const { withFileTypes = true, follow = false, filter, walkFilter, } = opts;
    +        const results = new Minipass({ objectMode: true });
    +        const dirs = new Set();
    +        if (!filter || filter(entry)) {
    +            results.write(withFileTypes ? entry : entry.fullpath());
    +        }
    +        const queue = [entry];
    +        let processing = 0;
    +        const process = () => {
    +            let paused = false;
    +            while (!paused) {
    +                const dir = queue.shift();
    +                if (!dir) {
    +                    if (processing === 0)
    +                        results.end();
    +                    return;
    +                }
    +                processing++;
    +                dirs.add(dir);
    +                const entries = dir.readdirSync();
    +                for (const e of entries) {
    +                    if (!filter || filter(e)) {
    +                        if (!results.write(withFileTypes ? e : e.fullpath())) {
    +                            paused = true;
    +                        }
    +                    }
    +                }
    +                processing--;
    +                for (const e of entries) {
    +                    let r = e;
    +                    if (e.isSymbolicLink()) {
    +                        if (!(follow && (r = e.realpathSync())))
    +                            continue;
    +                        if (r.isUnknown())
    +                            r.lstatSync();
    +                    }
    +                    if (r.shouldWalk(dirs, walkFilter)) {
    +                        queue.push(r);
    +                    }
    +                }
    +            }
    +            if (paused && !results.flowing)
    +                results.once('drain', process);
    +        };
    +        process();
    +        return results;
    +    }
    +}
    +/**
    + * Windows implementation of {@link PathScurryBase}
    + *
    + * Defaults to case insensitve, uses `'\\'` to generate path strings.  Uses
    + * {@link PathWin32} for Path objects.
    + */
    +export class PathScurryWin32 extends PathScurryBase {
    +    /**
    +     * separator for generating path strings
    +     */
    +    sep = '\\';
    +    constructor(cwd = process.cwd(), opts = {}) {
    +        const { nocase = true } = opts;
    +        super(cwd, win32, '\\', { ...opts, nocase });
    +        this.nocase = nocase;
    +        for (let p = this.cwd; p; p = p.parent) {
    +            p.nocase = this.nocase;
    +        }
    +    }
    +    /**
    +     * @internal
    +     */
    +    parseRootPath(dir) {
    +        // if the path starts with a single separator, it's not a UNC, and we'll
    +        // just get separator as the root, and driveFromUNC will return \
    +        // In that case, mount \ on the root from the cwd.
    +        return win32.parse(dir).root.toUpperCase();
    +    }
    +    /**
    +     * @internal
    +     */
    +    newRoot(fs) {
    +        return new PathWin32(this.rootPath, IFDIR, undefined, this.roots, this.nocase, this.childrenCache(), { fs });
    +    }
    +    /**
    +     * Return true if the provided path string is an absolute path
    +     */
    +    isAbsolute(p) {
    +        return (p.startsWith('/') || p.startsWith('\\') || /^[a-z]:(\/|\\)/i.test(p));
    +    }
    +}
    +/**
    + * {@link PathScurryBase} implementation for all posix systems other than Darwin.
    + *
    + * Defaults to case-sensitive matching, uses `'/'` to generate path strings.
    + *
    + * Uses {@link PathPosix} for Path objects.
    + */
    +export class PathScurryPosix extends PathScurryBase {
    +    /**
    +     * separator for generating path strings
    +     */
    +    sep = '/';
    +    constructor(cwd = process.cwd(), opts = {}) {
    +        const { nocase = false } = opts;
    +        super(cwd, posix, '/', { ...opts, nocase });
    +        this.nocase = nocase;
    +    }
    +    /**
    +     * @internal
    +     */
    +    parseRootPath(_dir) {
    +        return '/';
    +    }
    +    /**
    +     * @internal
    +     */
    +    newRoot(fs) {
    +        return new PathPosix(this.rootPath, IFDIR, undefined, this.roots, this.nocase, this.childrenCache(), { fs });
    +    }
    +    /**
    +     * Return true if the provided path string is an absolute path
    +     */
    +    isAbsolute(p) {
    +        return p.startsWith('/');
    +    }
    +}
    +/**
    + * {@link PathScurryBase} implementation for Darwin (macOS) systems.
    + *
    + * Defaults to case-insensitive matching, uses `'/'` for generating path
    + * strings.
    + *
    + * Uses {@link PathPosix} for Path objects.
    + */
    +export class PathScurryDarwin extends PathScurryPosix {
    +    constructor(cwd = process.cwd(), opts = {}) {
    +        const { nocase = true } = opts;
    +        super(cwd, { ...opts, nocase });
    +    }
    +}
    +/**
    + * Default {@link PathBase} implementation for the current platform.
    + *
    + * {@link PathWin32} on Windows systems, {@link PathPosix} on all others.
    + */
    +export const Path = process.platform === 'win32' ? PathWin32 : PathPosix;
    +/**
    + * Default {@link PathScurryBase} implementation for the current platform.
    + *
    + * {@link PathScurryWin32} on Windows systems, {@link PathScurryDarwin} on
    + * Darwin (macOS) systems, {@link PathScurryPosix} on all others.
    + */
    +export const PathScurry = process.platform === 'win32'
    +    ? PathScurryWin32
    +    : process.platform === 'darwin'
    +        ? PathScurryDarwin
    +        : PathScurryPosix;
    +//# sourceMappingURL=index.js.map
    \ No newline at end of file
    diff --git a/deps/npm/node_modules/path-scurry/dist/mjs/package.json b/deps/npm/node_modules/path-scurry/dist/mjs/package.json
    new file mode 100644
    index 00000000000000..3dbc1ca591c055
    --- /dev/null
    +++ b/deps/npm/node_modules/path-scurry/dist/mjs/package.json
    @@ -0,0 +1,3 @@
    +{
    +  "type": "module"
    +}
    diff --git a/deps/npm/node_modules/path-scurry/package.json b/deps/npm/node_modules/path-scurry/package.json
    new file mode 100644
    index 00000000000000..aea462a316a4a8
    --- /dev/null
    +++ b/deps/npm/node_modules/path-scurry/package.json
    @@ -0,0 +1,87 @@
    +{
    +  "name": "path-scurry",
    +  "version": "1.6.3",
    +  "description": "walk paths fast and efficiently",
    +  "author": "Isaac Z. Schlueter  (https://blog.izs.me)",
    +  "main": "./dist/cjs/index.js",
    +  "module": "./dist/mjs/index.js",
    +  "exports": {
    +    ".": {
    +      "import": {
    +        "types": "./dist/mjs/index.d.ts",
    +        "default": "./dist/mjs/index.js"
    +      },
    +      "require": {
    +        "types": "./dist/cjs/index.d.ts",
    +        "default": "./dist/cjs/index.js"
    +      }
    +    }
    +  },
    +  "files": [
    +    "dist"
    +  ],
    +  "license": "BlueOak-1.0.0",
    +  "scripts": {
    +    "preversion": "npm test",
    +    "postversion": "npm publish",
    +    "prepublishOnly": "git push origin --follow-tags",
    +    "preprepare": "rm -rf dist",
    +    "prepare": "tsc -p tsconfig.json && tsc -p tsconfig-esm.json",
    +    "postprepare": "bash ./scripts/fixup.sh",
    +    "pretest": "npm run prepare",
    +    "presnap": "npm run prepare",
    +    "test": "c8 tap",
    +    "snap": "c8 tap",
    +    "format": "prettier --write . --loglevel warn",
    +    "typedoc": "typedoc --tsconfig tsconfig-esm.json ./src/*.ts",
    +    "bench": "bash ./scripts/bench.sh"
    +  },
    +  "prettier": {
    +    "semi": false,
    +    "printWidth": 75,
    +    "tabWidth": 2,
    +    "useTabs": false,
    +    "singleQuote": true,
    +    "jsxSingleQuote": false,
    +    "bracketSameLine": true,
    +    "arrowParens": "avoid",
    +    "endOfLine": "lf"
    +  },
    +  "tap": {
    +    "coverage": false,
    +    "node-arg": [
    +      "--no-warnings",
    +      "--loader",
    +      "ts-node/esm"
    +    ],
    +    "ts": false
    +  },
    +  "devDependencies": {
    +    "@nodelib/fs.walk": "^1.2.8",
    +    "@types/node": "^18.11.18",
    +    "@types/tap": "^15.0.7",
    +    "c8": "^7.12.0",
    +    "eslint-config-prettier": "^8.6.0",
    +    "mkdirp": "^2.1.3",
    +    "prettier": "^2.8.3",
    +    "rimraf": "^4.1.2",
    +    "tap": "^16.3.4",
    +    "ts-node": "^10.9.1",
    +    "typedoc": "^0.23.24",
    +    "typescript": "^4.9.4"
    +  },
    +  "engines": {
    +    "node": ">=16 || 14 >=14.17"
    +  },
    +  "funding": {
    +    "url": "https://github.com/sponsors/isaacs"
    +  },
    +  "repository": {
    +    "type": "git",
    +    "url": "git+https://github.com/isaacs/path-walker"
    +  },
    +  "dependencies": {
    +    "lru-cache": "^7.14.1",
    +    "minipass": "^4.0.2"
    +  }
    +}
    diff --git a/deps/npm/node_modules/postcss-selector-parser/postcss-selector-parser.d.ts b/deps/npm/node_modules/postcss-selector-parser/postcss-selector-parser.d.ts
    deleted file mode 100644
    index 89a2c5239edb16..00000000000000
    --- a/deps/npm/node_modules/postcss-selector-parser/postcss-selector-parser.d.ts
    +++ /dev/null
    @@ -1,555 +0,0 @@
    -// Type definitions for postcss-selector-parser 2.2.3
    -// Definitions by: Chris Eppstein 
    -
    -/*~ Note that ES6 modules cannot directly export callable functions.
    - *~ This file should be imported using the CommonJS-style:
    - *~   import x = require('someLibrary');
    - *~
    - *~ Refer to the documentation to understand common
    - *~ workarounds for this limitation of ES6 modules.
    - */
    -
    -/*~ This declaration specifies that the function
    - *~ is the exported object from the file
    - */
    -export = parser;
    -
    -// A type that's T but not U.
    -type Diff = T extends U ? never : T;
    -
    -// TODO: Conditional types in TS 1.8 will really clean this up.
    -declare function parser(): parser.Processor;
    -declare function parser(processor: parser.AsyncProcessor): parser.Processor;
    -declare function parser(processor: parser.AsyncProcessor): parser.Processor;
    -declare function parser(processor: parser.SyncProcessor): parser.Processor;
    -declare function parser(processor: parser.SyncProcessor): parser.Processor;
    -declare function parser(processor?: parser.SyncProcessor | parser.AsyncProcessor): parser.Processor;
    -
    -/*~ If you want to expose types from your module as well, you can
    - *~ place them in this block. Often you will want to describe the
    - *~ shape of the return type of the function; that type should
    - *~ be declared in here, as this example shows.
    - */
    -declare namespace parser {
    -    /* copied from postcss -- so we don't need to add a dependency */
    -    type ErrorOptions = {
    -        plugin?: string;
    -        word?: string;
    -        index?: number
    -    };
    -    /* the bits we use of postcss.Rule, copied from postcss -- so we don't need to add a dependency */
    -    type PostCSSRuleNode = {
    -        selector: string
    -        /**
    -         * @returns postcss.CssSyntaxError but it's a complex object, caller
    -         *   should cast to it if they have a dependency on postcss.
    -         */
    -        error(message: string, options?: ErrorOptions): Error;
    -    };
    -    /** Accepts a string  */
    -    type Selectors = string | PostCSSRuleNode
    -    type ProcessorFn = (root: parser.Root) => ReturnType;
    -    type SyncProcessor = ProcessorFn;
    -    type AsyncProcessor = ProcessorFn>;
    -
    -    const TAG: "tag";
    -    const STRING: "string";
    -    const SELECTOR: "selector";
    -    const ROOT: "root";
    -    const PSEUDO: "pseudo";
    -    const NESTING: "nesting";
    -    const ID: "id";
    -    const COMMENT: "comment";
    -    const COMBINATOR: "combinator";
    -    const CLASS: "class";
    -    const ATTRIBUTE: "attribute";
    -    const UNIVERSAL: "universal";
    -
    -    interface NodeTypes {
    -        tag: Tag,
    -        string: String,
    -        selector: Selector,
    -        root: Root,
    -        pseudo: Pseudo,
    -        nesting: Nesting,
    -        id: Identifier,
    -        comment: Comment,
    -        combinator: Combinator,
    -        class: ClassName,
    -        attribute: Attribute,
    -        universal: Universal
    -    }
    -
    -    type Node = NodeTypes[keyof NodeTypes];
    -
    -    function isNode(node: any): node is Node;
    -
    -    interface Options {
    -        /**
    -         * Preserve whitespace when true. Default: false;
    -         */
    -        lossless: boolean;
    -        /**
    -         * When true and a postcss.Rule is passed, set the result of
    -         * processing back onto the rule when done. Default: false.
    -         */
    -        updateSelector: boolean;
    -    }
    -    class Processor<
    -        TransformType = never,
    -        SyncSelectorsType extends Selectors | never = Selectors
    -    > {
    -        res: Root;
    -        readonly result: String;
    -        ast(selectors: Selectors, options?: Partial): Promise;
    -        astSync(selectors: SyncSelectorsType, options?: Partial): Root;
    -        transform(selectors: Selectors, options?: Partial): Promise;
    -        transformSync(selectors: SyncSelectorsType, options?: Partial): TransformType;
    -        process(selectors: Selectors, options?: Partial): Promise;
    -        processSync(selectors: SyncSelectorsType, options?: Partial): string;
    -    }
    -    interface ParserOptions {
    -        css: string;
    -        error: (message: string, options: ErrorOptions) => Error;
    -        options: Options;
    -    }
    -    class Parser {
    -        input: ParserOptions;
    -        lossy: boolean;
    -        position: number;
    -        root: Root;
    -        selectors: string;
    -        current: Selector;
    -        constructor(input: ParserOptions);
    -        /**
    -         * Raises an error, if the processor is invoked on
    -         * a postcss Rule node, a better error message is raised.
    -         */
    -        error(message: string, options?: ErrorOptions): void;
    -    }
    -    interface NodeSource {
    -        start?: {
    -            line: number,
    -            column: number
    -        },
    -        end?: {
    -            line: number,
    -            column: number
    -        }
    -    }
    -    interface SpaceAround {
    -      before: string;
    -      after: string;
    -    }
    -    interface Spaces extends SpaceAround {
    -      [spaceType: string]: string | Partial | undefined;
    -    }
    -    interface NodeOptions {
    -        value: Value;
    -        spaces?: Partial;
    -        source?: NodeSource;
    -        sourceIndex?: number;
    -    }
    -    interface Base<
    -        Value extends string | undefined = string,
    -        ParentType extends Container | undefined = Container | undefined
    -    > {
    -        type: keyof NodeTypes;
    -        parent: ParentType;
    -        value: Value;
    -        spaces: Spaces;
    -        source?: NodeSource;
    -        sourceIndex: number;
    -        rawSpaceBefore: string;
    -        rawSpaceAfter: string;
    -        remove(): Node;
    -        replaceWith(...nodes: Node[]): Node;
    -        next(): Node;
    -        prev(): Node;
    -        clone(opts: {[override: string]:any}): Node;
    -        /**
    -         * Return whether this node includes the character at the position of the given line and column.
    -         * Returns undefined if the nodes lack sufficient source metadata to determine the position.
    -         * @param line 1-index based line number relative to the start of the selector.
    -         * @param column 1-index based column number relative to the start of the selector.
    -         */
    -        isAtPosition(line: number, column: number): boolean | undefined;
    -        /**
    -         * Some non-standard syntax doesn't follow normal escaping rules for css,
    -         * this allows the escaped value to be specified directly, allowing illegal characters to be
    -         * directly inserted into css output.
    -         * @param name the property to set
    -         * @param value the unescaped value of the property
    -         * @param valueEscaped optional. the escaped value of the property.
    -         */
    -        setPropertyAndEscape(name: string, value: any, valueEscaped: string): void;
    -        /**
    -         * When you want a value to passed through to CSS directly. This method
    -         * deletes the corresponding raw value causing the stringifier to fallback
    -         * to the unescaped value.
    -         * @param name the property to set.
    -         * @param value The value that is both escaped and unescaped.
    -         */
    -        setPropertyWithoutEscape(name: string, value: any): void;
    -        /**
    -         * Some non-standard syntax doesn't follow normal escaping rules for css.
    -         * This allows non standard syntax to be appended to an existing property
    -         * by specifying the escaped value. By specifying the escaped value,
    -         * illegal characters are allowed to be directly inserted into css output.
    -         * @param {string} name the property to set
    -         * @param {any} value the unescaped value of the property
    -         * @param {string} valueEscaped optional. the escaped value of the property.
    -         */
    -        appendToPropertyAndEscape(name: string, value: any, valueEscaped: string): void;
    -        toString(): string;
    -    }
    -    interface ContainerOptions extends NodeOptions {
    -        nodes?: Array;
    -    }
    -    interface Container<
    -        Value extends string | undefined = string,
    -        Child extends Node = Node
    -    > extends Base {
    -        nodes: Array;
    -        append(selector: Selector): this;
    -        prepend(selector: Selector): this;
    -        at(index: number): Child;
    -        /**
    -         * Return the most specific node at the line and column number given.
    -         * The source location is based on the original parsed location, locations aren't
    -         * updated as selector nodes are mutated.
    -         *
    -         * Note that this location is relative to the location of the first character
    -         * of the selector, and not the location of the selector in the overall document
    -         * when used in conjunction with postcss.
    -         *
    -         * If not found, returns undefined.
    -         * @param line The line number of the node to find. (1-based index)
    -         * @param col  The column number of the node to find. (1-based index)
    -         */
    -        atPosition(line: number, column: number): Child;
    -        index(child: Child): number;
    -        readonly first: Child;
    -        readonly last: Child;
    -        readonly length: number;
    -        removeChild(child: Child): this;
    -        removeAll(): Container;
    -        empty(): Container;
    -        insertAfter(oldNode: Child, newNode: Child): this;
    -        insertBefore(oldNode: Child, newNode: Child): this;
    -        each(callback: (node: Child) => boolean | void): boolean | undefined;
    -        walk(
    -            callback: (node: Node) => boolean | void
    -        ): boolean | undefined;
    -        walkAttributes(
    -            callback: (node: Attribute) => boolean | void
    -        ): boolean | undefined;
    -        walkClasses(
    -            callback: (node: ClassName) => boolean | void
    -        ): boolean | undefined;
    -        walkCombinators(
    -            callback: (node: Combinator) => boolean | void
    -        ): boolean | undefined;
    -        walkComments(
    -            callback: (node: Comment) => boolean | void
    -        ): boolean | undefined;
    -        walkIds(
    -            callback: (node: Identifier) => boolean | void
    -        ): boolean | undefined;
    -        walkNesting(
    -            callback: (node: Nesting) => boolean | void
    -        ): boolean | undefined;
    -        walkPseudos(
    -            callback: (node: Pseudo) => boolean | void
    -        ): boolean | undefined;
    -        walkTags(callback: (node: Tag) => boolean | void): boolean | undefined;
    -        split(callback: (node: Child) => boolean): [Child[], Child[]];
    -        map(callback: (node: Child) => T): T[];
    -        reduce(
    -            callback: (
    -                previousValue: Child,
    -                currentValue: Child,
    -                currentIndex: number,
    -                array: readonly Child[]
    -            ) => Child
    -        ): Child;
    -        reduce(
    -            callback: (
    -                previousValue: Child,
    -                currentValue: Child,
    -                currentIndex: number,
    -                array: readonly Child[]
    -            ) => Child,
    -            initialValue: Child
    -        ): Child;
    -        reduce(
    -            callback: (
    -                previousValue: T,
    -                currentValue: Child,
    -                currentIndex: number,
    -                array: readonly Child[]
    -            ) => T,
    -            initialValue: T
    -        ): T;
    -        every(callback: (node: Child) => boolean): boolean;
    -        some(callback: (node: Child) => boolean): boolean;
    -        filter(callback: (node: Child) => boolean): Child[];
    -        sort(callback: (nodeA: Child, nodeB: Child) => number): Child[];
    -        toString(): string;
    -    }
    -    function isContainer(node: any): node is Root | Selector | Pseudo;
    -
    -    interface NamespaceOptions extends NodeOptions {
    -        namespace?: string | true;
    -    }
    -    interface Namespace extends Base {
    -        /** alias for namespace */
    -        ns: string | true;
    -        /**
    -         *  namespace prefix.
    -         */
    -        namespace: string | true;
    -        /**
    -         * If a namespace exists, prefix the value provided with it, separated by |.
    -         */
    -        qualifiedName(value: string): string;
    -        /**
    -         * A string representing the namespace suitable for output.
    -         */
    -        readonly namespaceString: string;
    -    }
    -    function isNamespace(node: any): node is Attribute | Tag;
    -
    -    interface Root extends Container {
    -        type: "root";
    -        /**
    -         * Raises an error, if the processor is invoked on
    -         * a postcss Rule node, a better error message is raised.
    -         */
    -        error(message: string, options?: ErrorOptions): Error;
    -        nodeAt(line: number, column: number): Node
    -    }
    -    function root(opts: ContainerOptions): Root;
    -    function isRoot(node: any): node is Root;
    -
    -    interface _Selector extends Container> {
    -        type: "selector";
    -    }
    -    type Selector = _Selector;
    -    function selector(opts: ContainerOptions): Selector;
    -    function isSelector(node: any): node is Selector;
    -
    -    interface CombinatorRaws {
    -        value?: string;
    -        spaces?: {
    -            before?: string;
    -            after?: string;
    -        };
    -    }
    -    interface Combinator extends Base {
    -        type: "combinator";
    -        raws?: CombinatorRaws;
    -    }
    -    function combinator(opts: NodeOptions): Combinator;
    -    function isCombinator(node: any): node is Combinator;
    -
    -    interface ClassName extends Base {
    -        type: "class";
    -    }
    -    function className(opts: NamespaceOptions): ClassName;
    -    function isClassName(node: any): node is ClassName;
    -
    -    type AttributeOperator = "=" | "~=" | "|=" | "^=" | "$=" | "*=";
    -    type QuoteMark = '"' | "'" | null;
    -    interface PreferredQuoteMarkOptions {
    -        quoteMark?: QuoteMark;
    -        preferCurrentQuoteMark?: boolean;
    -    }
    -    interface SmartQuoteMarkOptions extends PreferredQuoteMarkOptions {
    -        smart?: boolean;
    -    }
    -    interface AttributeOptions extends NamespaceOptions {
    -        attribute: string;
    -        operator?: AttributeOperator;
    -        insensitive?: boolean;
    -        quoteMark?: QuoteMark;
    -        /** @deprecated Use quoteMark instead. */
    -        quoted?: boolean;
    -        spaces?: {
    -            before?: string;
    -            after?: string;
    -            attribute?: Partial;
    -            operator?: Partial;
    -            value?: Partial;
    -            insensitive?: Partial;
    -        }
    -        raws: {
    -            unquoted?: string;
    -            attribute?: string;
    -            operator?: string;
    -            value?: string;
    -            insensitive?: string;
    -            spaces?: {
    -                attribute?: Partial;
    -                operator?: Partial;
    -                value?: Partial;
    -                insensitive?: Partial;
    -            }
    -        };
    -    }
    -    interface Attribute extends Namespace {
    -        type: "attribute";
    -        attribute: string;
    -        operator?: AttributeOperator;
    -        insensitive?: boolean;
    -        quoteMark: QuoteMark;
    -        quoted?: boolean;
    -        spaces: {
    -            before: string;
    -            after: string;
    -            attribute?: Partial;
    -            operator?: Partial;
    -            value?: Partial;
    -            insensitive?: Partial;
    -        }
    -        raws: {
    -            /** @deprecated The attribute value is unquoted, use that instead.. */
    -            unquoted?: string;
    -            attribute?: string;
    -            operator?: string;
    -            /** The value of the attribute with quotes and escapes. */
    -            value?: string;
    -            insensitive?: string;
    -            spaces?: {
    -                attribute?: Partial;
    -                operator?: Partial;
    -                value?: Partial;
    -                insensitive?: Partial;
    -            }
    -        };
    -        /**
    -         * The attribute name after having been qualified with a namespace.
    -         */
    -        readonly qualifiedAttribute: string;
    -
    -        /**
    -         * The case insensitivity flag or an empty string depending on whether this
    -         * attribute is case insensitive.
    -         */
    -        readonly insensitiveFlag : 'i' | '';
    -
    -        /**
    -         * Returns the attribute's value quoted such that it would be legal to use
    -         * in the value of a css file. The original value's quotation setting
    -         * used for stringification is left unchanged. See `setValue(value, options)`
    -         * if you want to control the quote settings of a new value for the attribute or
    -         * `set quoteMark(mark)` if you want to change the quote settings of the current
    -         * value.
    -         *
    -         * You can also change the quotation used for the current value by setting quoteMark.
    -         **/
    -        getQuotedValue(options?: SmartQuoteMarkOptions): string;
    -
    -        /**
    -         * Set the unescaped value with the specified quotation options. The value
    -         * provided must not include any wrapping quote marks -- those quotes will
    -         * be interpreted as part of the value and escaped accordingly.
    -         * @param value
    -         */
    -        setValue(value: string, options?: SmartQuoteMarkOptions): void;
    -
    -        /**
    -         * Intelligently select a quoteMark value based on the value's contents. If
    -         * the value is a legal CSS ident, it will not be quoted. Otherwise a quote
    -         * mark will be picked that minimizes the number of escapes.
    -         *
    -         * If there's no clear winner, the quote mark from these options is used,
    -         * then the source quote mark (this is inverted if `preferCurrentQuoteMark` is
    -         * true). If the quoteMark is unspecified, a double quote is used.
    -         **/
    -        smartQuoteMark(options: PreferredQuoteMarkOptions): QuoteMark;
    -
    -        /**
    -         * Selects the preferred quote mark based on the options and the current quote mark value.
    -         * If you want the quote mark to depend on the attribute value, call `smartQuoteMark(opts)`
    -         * instead.
    -         */
    -        preferredQuoteMark(options: PreferredQuoteMarkOptions): QuoteMark
    -
    -        /**
    -         * returns the offset of the attribute part specified relative to the
    -         * start of the node of the output string.
    -         *
    -         * * "ns" - alias for "namespace"
    -         * * "namespace" - the namespace if it exists.
    -         * * "attribute" - the attribute name
    -         * * "attributeNS" - the start of the attribute or its namespace
    -         * * "operator" - the match operator of the attribute
    -         * * "value" - The value (string or identifier)
    -         * * "insensitive" - the case insensitivity flag;
    -         * @param part One of the possible values inside an attribute.
    -         * @returns -1 if the name is invalid or the value doesn't exist in this attribute.
    -         */
    -        offsetOf(part: "ns" | "namespace" | "attribute" | "attributeNS" | "operator" | "value" | "insensitive"): number;
    -    }
    -    function attribute(opts: AttributeOptions): Attribute;
    -    function isAttribute(node: any): node is Attribute;
    -
    -    interface Pseudo extends Container {
    -        type: "pseudo";
    -    }
    -    function pseudo(opts: ContainerOptions): Pseudo;
    -    /**
    -     * Checks wether the node is the Psuedo subtype of node.
    -     */
    -    function isPseudo(node: any): node is Pseudo;
    -
    -    /**
    -     * Checks wether the node is, specifically, a pseudo element instead of
    -     * pseudo class.
    -     */
    -    function isPseudoElement(node: any): node is Pseudo;
    -
    -    /**
    -     * Checks wether the node is, specifically, a pseudo class instead of
    -     * pseudo element.
    -     */
    -    function isPseudoClass(node: any): node is Pseudo;
    -
    -
    -    interface Tag extends Namespace {
    -        type: "tag";
    -    }
    -    function tag(opts: NamespaceOptions): Tag;
    -    function isTag(node: any): node is Tag;
    -
    -    interface Comment extends Base {
    -        type: "comment";
    -    }
    -    function comment(opts: NodeOptions): Comment;
    -    function isComment(node: any): node is Comment;
    -
    -    interface Identifier extends Base {
    -        type: "id";
    -    }
    -    function id(opts: any): any;
    -    function isIdentifier(node: any): node is Identifier;
    -
    -    interface Nesting extends Base {
    -        type: "nesting";
    -    }
    -    function nesting(opts: any): any;
    -    function isNesting(node: any): node is Nesting;
    -
    -    interface String extends Base {
    -        type: "string";
    -    }
    -    function string(opts: NodeOptions): String;
    -    function isString(node: any): node is String;
    -
    -    interface Universal extends Base {
    -        type: "universal";
    -    }
    -    function universal(opts?: NamespaceOptions): any;
    -    function isUniversal(node: any): node is Universal;
    -}
    diff --git a/deps/npm/node_modules/promise-call-limit/index.js b/deps/npm/node_modules/promise-call-limit/index.js
    index a093c2481c451d..85ba319ea54d22 100644
    --- a/deps/npm/node_modules/promise-call-limit/index.js
    +++ b/deps/npm/node_modules/promise-call-limit/index.js
    @@ -1,4 +1,13 @@
    -const defLimit = require('os').cpus().length
    +const os = require('os')
    +// availableParallelism available only since node v19, for older versions use
    +// cpus() cpus() can return an empty list if /proc is not mounted, use 1 in
    +// this case
    +
    +/* istanbul ignore next - version-specific workaround */
    +const defLimit = 'availableParallelism' in os
    +  ? os.availableParallelism()
    +  : Math.max(1, os.cpus().length)
    +
     const callLimit = (queue, limit = defLimit) => new Promise((res, rej) => {
       let active = 0
       let current = 0
    diff --git a/deps/npm/node_modules/promise-call-limit/package.json b/deps/npm/node_modules/promise-call-limit/package.json
    index ae5e4617fbbd9e..412c6db1777150 100644
    --- a/deps/npm/node_modules/promise-call-limit/package.json
    +++ b/deps/npm/node_modules/promise-call-limit/package.json
    @@ -1,6 +1,6 @@
     {
       "name": "promise-call-limit",
    -  "version": "1.0.1",
    +  "version": "1.0.2",
       "files": [
         "index.js"
       ],
    @@ -21,7 +21,7 @@
         "check-coverage": true
       },
       "devDependencies": {
    -    "tap": "^14.10.6"
    +    "tap": "^16.0.0"
       },
       "funding": {
         "url": "https://github.com/sponsors/isaacs"
    diff --git a/deps/npm/node_modules/read-package-json/lib/read-json.js b/deps/npm/node_modules/read-package-json/lib/read-json.js
    index c55eca32259edf..e47a1bb2febca4 100644
    --- a/deps/npm/node_modules/read-package-json/lib/read-json.js
    +++ b/deps/npm/node_modules/read-package-json/lib/read-json.js
    @@ -218,15 +218,12 @@ function gypfile (file, data, cb) {
         return cb(null, data)
       }
     
    -  glob('*.gyp', { cwd: dir }, function (er, files) {
    -    if (er) {
    -      return cb(er)
    -    }
    -    if (data.gypfile === false) {
    -      return cb(null, data)
    -    }
    -    gypfile_(file, data, files, cb)
    -  })
    +  if (data.gypfile === false) {
    +    return cb(null, data)
    +  }
    +  glob('*.gyp', { cwd: dir })
    +    .then(files => gypfile_(file, data, files, cb))
    +    .catch(er => cb(er))
     }
     
     function gypfile_ (file, data, files, cb) {
    @@ -246,22 +243,13 @@ function serverjs (file, data, cb) {
       if (s.start) {
         return cb(null, data)
       }
    -  glob('server.js', { cwd: dir }, function (er, files) {
    -    if (er) {
    -      return cb(er)
    +  fs.access(path.join(dir, 'server.js'), (err) => {
    +    if (!err) {
    +      s.start = 'node server.js'
    +      data.scripts = s
         }
    -    serverjs_(file, data, files, cb)
    -  })
    -}
    -
    -function serverjs_ (file, data, files, cb) {
    -  if (!files.length) {
         return cb(null, data)
    -  }
    -  var s = data.scripts || {}
    -  s.start = 'node server.js'
    -  data.scripts = s
    -  return cb(null, data)
    +  })
     }
     
     function authors (file, data, cb) {
    @@ -294,21 +282,20 @@ function readme (file, data, cb) {
       }
       var dir = path.dirname(file)
       var globOpts = { cwd: dir, nocase: true, mark: true }
    -  glob('{README,README.*}', globOpts, function (er, files) {
    -    if (er) {
    -      return cb(er)
    -    }
    -    // don't accept directories.
    -    files = files.filter(function (filtered) {
    -      return !filtered.match(/\/$/)
    +  glob('{README,README.*}', globOpts)
    +    .then(files => {
    +      // don't accept directories.
    +      files = files.filter(function (filtered) {
    +        return !filtered.match(/\/$/)
    +      })
    +      if (!files.length) {
    +        return cb()
    +      }
    +      var fn = preferMarkdownReadme(files)
    +      var rm = path.resolve(dir, fn)
    +      return readme_(file, data, rm, cb)
         })
    -    if (!files.length) {
    -      return cb()
    -    }
    -    var fn = preferMarkdownReadme(files)
    -    var rm = path.resolve(dir, fn)
    -    readme_(file, data, rm, cb)
    -  })
    +    .catch(er => cb(er))
     }
     
     function preferMarkdownReadme (files) {
    @@ -346,15 +333,14 @@ function mans (file, data, cb) {
       }
       const dirname = path.dirname(file)
       cwd = path.resolve(path.dirname(file), cwd)
    -  glob('**/*.[0-9]', { cwd }, function (er, mansGlob) {
    -    if (er) {
    -      return cb(er)
    -    }
    -    data.man = mansGlob.map(man =>
    -      path.relative(dirname, path.join(cwd, man)).split(path.sep).join('/')
    -    )
    -    return cb(null, data)
    -  })
    +  glob('**/*.[0-9]', { cwd })
    +    .then(mansGlob => {
    +      data.man = mansGlob.map(man =>
    +        path.relative(dirname, path.join(cwd, man)).split(path.sep).join('/')
    +      )
    +      return cb(null, data)
    +    })
    +    .catch(er => cb(er))
     }
     
     function bins (file, data, cb) {
    @@ -366,12 +352,9 @@ function bins (file, data, cb) {
       }
     
       m = path.resolve(path.dirname(file), m)
    -  glob('**', { cwd: m }, function (er, binsGlob) {
    -    if (er) {
    -      return cb(er)
    -    }
    -    bins_(file, data, binsGlob, cb)
    -  })
    +  glob('**', { cwd: m })
    +    .then(binsGlob => bins_(file, data, binsGlob, cb))
    +    .catch(er => cb(er))
     }
     
     function bins_ (file, data, binsGlob, cb) {
    diff --git a/deps/npm/node_modules/read-package-json/package.json b/deps/npm/node_modules/read-package-json/package.json
    index 09829fa3fbf785..d1618e3f8977fc 100644
    --- a/deps/npm/node_modules/read-package-json/package.json
    +++ b/deps/npm/node_modules/read-package-json/package.json
    @@ -1,6 +1,6 @@
     {
       "name": "read-package-json",
    -  "version": "6.0.0",
    +  "version": "6.0.1",
       "author": "GitHub Inc.",
       "description": "The thing npm uses to read package.json files with semantics and defaults and validation",
       "repository": {
    @@ -23,14 +23,14 @@
         "template-oss-apply": "template-oss-apply --force"
       },
       "dependencies": {
    -    "glob": "^8.0.1",
    +    "glob": "^9.3.0",
         "json-parse-even-better-errors": "^3.0.0",
         "normalize-package-data": "^5.0.0",
         "npm-normalize-package-bin": "^3.0.0"
       },
       "devDependencies": {
         "@npmcli/eslint-config": "^4.0.0",
    -    "@npmcli/template-oss": "4.5.1",
    +    "@npmcli/template-oss": "4.12.0",
         "tap": "^16.0.1"
       },
       "license": "ISC",
    @@ -43,9 +43,9 @@
       },
       "tap": {
         "branches": 68,
    -    "functions": 83,
    -    "lines": 76,
    -    "statements": 77,
    +    "functions": 74,
    +    "lines": 74,
    +    "statements": 74,
         "nyc-arg": [
           "--exclude",
           "tap-snapshots/**"
    @@ -53,6 +53,6 @@
       },
       "templateOSS": {
         "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
    -    "version": "4.5.1"
    +    "version": "4.12.0"
       }
     }
    diff --git a/deps/npm/node_modules/safe-buffer/index.d.ts b/deps/npm/node_modules/safe-buffer/index.d.ts
    deleted file mode 100644
    index e9fed809a5ab51..00000000000000
    --- a/deps/npm/node_modules/safe-buffer/index.d.ts
    +++ /dev/null
    @@ -1,187 +0,0 @@
    -declare module "safe-buffer" {
    -  export class Buffer {
    -    length: number
    -    write(string: string, offset?: number, length?: number, encoding?: string): number;
    -    toString(encoding?: string, start?: number, end?: number): string;
    -    toJSON(): { type: 'Buffer', data: any[] };
    -    equals(otherBuffer: Buffer): boolean;
    -    compare(otherBuffer: Buffer, targetStart?: number, targetEnd?: number, sourceStart?: number, sourceEnd?: number): number;
    -    copy(targetBuffer: Buffer, targetStart?: number, sourceStart?: number, sourceEnd?: number): number;
    -    slice(start?: number, end?: number): Buffer;
    -    writeUIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
    -    writeUIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
    -    writeIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
    -    writeIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
    -    readUIntLE(offset: number, byteLength: number, noAssert?: boolean): number;
    -    readUIntBE(offset: number, byteLength: number, noAssert?: boolean): number;
    -    readIntLE(offset: number, byteLength: number, noAssert?: boolean): number;
    -    readIntBE(offset: number, byteLength: number, noAssert?: boolean): number;
    -    readUInt8(offset: number, noAssert?: boolean): number;
    -    readUInt16LE(offset: number, noAssert?: boolean): number;
    -    readUInt16BE(offset: number, noAssert?: boolean): number;
    -    readUInt32LE(offset: number, noAssert?: boolean): number;
    -    readUInt32BE(offset: number, noAssert?: boolean): number;
    -    readInt8(offset: number, noAssert?: boolean): number;
    -    readInt16LE(offset: number, noAssert?: boolean): number;
    -    readInt16BE(offset: number, noAssert?: boolean): number;
    -    readInt32LE(offset: number, noAssert?: boolean): number;
    -    readInt32BE(offset: number, noAssert?: boolean): number;
    -    readFloatLE(offset: number, noAssert?: boolean): number;
    -    readFloatBE(offset: number, noAssert?: boolean): number;
    -    readDoubleLE(offset: number, noAssert?: boolean): number;
    -    readDoubleBE(offset: number, noAssert?: boolean): number;
    -    swap16(): Buffer;
    -    swap32(): Buffer;
    -    swap64(): Buffer;
    -    writeUInt8(value: number, offset: number, noAssert?: boolean): number;
    -    writeUInt16LE(value: number, offset: number, noAssert?: boolean): number;
    -    writeUInt16BE(value: number, offset: number, noAssert?: boolean): number;
    -    writeUInt32LE(value: number, offset: number, noAssert?: boolean): number;
    -    writeUInt32BE(value: number, offset: number, noAssert?: boolean): number;
    -    writeInt8(value: number, offset: number, noAssert?: boolean): number;
    -    writeInt16LE(value: number, offset: number, noAssert?: boolean): number;
    -    writeInt16BE(value: number, offset: number, noAssert?: boolean): number;
    -    writeInt32LE(value: number, offset: number, noAssert?: boolean): number;
    -    writeInt32BE(value: number, offset: number, noAssert?: boolean): number;
    -    writeFloatLE(value: number, offset: number, noAssert?: boolean): number;
    -    writeFloatBE(value: number, offset: number, noAssert?: boolean): number;
    -    writeDoubleLE(value: number, offset: number, noAssert?: boolean): number;
    -    writeDoubleBE(value: number, offset: number, noAssert?: boolean): number;
    -    fill(value: any, offset?: number, end?: number): this;
    -    indexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number;
    -    lastIndexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number;
    -    includes(value: string | number | Buffer, byteOffset?: number, encoding?: string): boolean;
    -
    -    /**
    -     * Allocates a new buffer containing the given {str}.
    -     *
    -     * @param str String to store in buffer.
    -     * @param encoding encoding to use, optional.  Default is 'utf8'
    -     */
    -     constructor (str: string, encoding?: string);
    -    /**
    -     * Allocates a new buffer of {size} octets.
    -     *
    -     * @param size count of octets to allocate.
    -     */
    -    constructor (size: number);
    -    /**
    -     * Allocates a new buffer containing the given {array} of octets.
    -     *
    -     * @param array The octets to store.
    -     */
    -    constructor (array: Uint8Array);
    -    /**
    -     * Produces a Buffer backed by the same allocated memory as
    -     * the given {ArrayBuffer}.
    -     *
    -     *
    -     * @param arrayBuffer The ArrayBuffer with which to share memory.
    -     */
    -    constructor (arrayBuffer: ArrayBuffer);
    -    /**
    -     * Allocates a new buffer containing the given {array} of octets.
    -     *
    -     * @param array The octets to store.
    -     */
    -    constructor (array: any[]);
    -    /**
    -     * Copies the passed {buffer} data onto a new {Buffer} instance.
    -     *
    -     * @param buffer The buffer to copy.
    -     */
    -    constructor (buffer: Buffer);
    -    prototype: Buffer;
    -    /**
    -     * Allocates a new Buffer using an {array} of octets.
    -     *
    -     * @param array
    -     */
    -    static from(array: any[]): Buffer;
    -    /**
    -     * When passed a reference to the .buffer property of a TypedArray instance,
    -     * the newly created Buffer will share the same allocated memory as the TypedArray.
    -     * The optional {byteOffset} and {length} arguments specify a memory range
    -     * within the {arrayBuffer} that will be shared by the Buffer.
    -     *
    -     * @param arrayBuffer The .buffer property of a TypedArray or a new ArrayBuffer()
    -     * @param byteOffset
    -     * @param length
    -     */
    -    static from(arrayBuffer: ArrayBuffer, byteOffset?: number, length?: number): Buffer;
    -    /**
    -     * Copies the passed {buffer} data onto a new Buffer instance.
    -     *
    -     * @param buffer
    -     */
    -    static from(buffer: Buffer): Buffer;
    -    /**
    -     * Creates a new Buffer containing the given JavaScript string {str}.
    -     * If provided, the {encoding} parameter identifies the character encoding.
    -     * If not provided, {encoding} defaults to 'utf8'.
    -     *
    -     * @param str
    -     */
    -    static from(str: string, encoding?: string): Buffer;
    -    /**
    -     * Returns true if {obj} is a Buffer
    -     *
    -     * @param obj object to test.
    -     */
    -    static isBuffer(obj: any): obj is Buffer;
    -    /**
    -     * Returns true if {encoding} is a valid encoding argument.
    -     * Valid string encodings in Node 0.12: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'binary'(deprecated)|'hex'
    -     *
    -     * @param encoding string to test.
    -     */
    -    static isEncoding(encoding: string): boolean;
    -    /**
    -     * Gives the actual byte length of a string. encoding defaults to 'utf8'.
    -     * This is not the same as String.prototype.length since that returns the number of characters in a string.
    -     *
    -     * @param string string to test.
    -     * @param encoding encoding used to evaluate (defaults to 'utf8')
    -     */
    -    static byteLength(string: string, encoding?: string): number;
    -    /**
    -     * Returns a buffer which is the result of concatenating all the buffers in the list together.
    -     *
    -     * If the list has no items, or if the totalLength is 0, then it returns a zero-length buffer.
    -     * If the list has exactly one item, then the first item of the list is returned.
    -     * If the list has more than one item, then a new Buffer is created.
    -     *
    -     * @param list An array of Buffer objects to concatenate
    -     * @param totalLength Total length of the buffers when concatenated.
    -     *   If totalLength is not provided, it is read from the buffers in the list. However, this adds an additional loop to the function, so it is faster to provide the length explicitly.
    -     */
    -    static concat(list: Buffer[], totalLength?: number): Buffer;
    -    /**
    -     * The same as buf1.compare(buf2).
    -     */
    -    static compare(buf1: Buffer, buf2: Buffer): number;
    -    /**
    -     * Allocates a new buffer of {size} octets.
    -     *
    -     * @param size count of octets to allocate.
    -     * @param fill if specified, buffer will be initialized by calling buf.fill(fill).
    -     *    If parameter is omitted, buffer will be filled with zeros.
    -     * @param encoding encoding used for call to buf.fill while initalizing
    -     */
    -    static alloc(size: number, fill?: string | Buffer | number, encoding?: string): Buffer;
    -    /**
    -     * Allocates a new buffer of {size} octets, leaving memory not initialized, so the contents
    -     * of the newly created Buffer are unknown and may contain sensitive data.
    -     *
    -     * @param size count of octets to allocate
    -     */
    -    static allocUnsafe(size: number): Buffer;
    -    /**
    -     * Allocates a new non-pooled buffer of {size} octets, leaving memory not initialized, so the contents
    -     * of the newly created Buffer are unknown and may contain sensitive data.
    -     *
    -     * @param size count of octets to allocate
    -     */
    -    static allocUnsafeSlow(size: number): Buffer;
    -  }
    -}
    \ No newline at end of file
    diff --git a/deps/npm/node_modules/sigstore/LICENSE b/deps/npm/node_modules/sigstore/LICENSE
    index d645695673349e..e9e7c1679a09df 100644
    --- a/deps/npm/node_modules/sigstore/LICENSE
    +++ b/deps/npm/node_modules/sigstore/LICENSE
    @@ -187,7 +187,7 @@
           same "printed page" as the copyright notice for easier
           identification within third-party archives.
     
    -   Copyright [yyyy] [name of copyright owner]
    +   Copyright 2023 The Sigstore Authors
     
        Licensed under the Apache License, Version 2.0 (the "License");
        you may not use this file except in compliance with the License.
    diff --git a/deps/npm/node_modules/sigstore/README.md b/deps/npm/node_modules/sigstore/README.md
    index 0a8b690423a0f3..5ade0dc5ab45f5 100644
    --- a/deps/npm/node_modules/sigstore/README.md
    +++ b/deps/npm/node_modules/sigstore/README.md
    @@ -1,4 +1,4 @@
    -# sigstore-js
    +# sigstore-js · [![npm version](https://img.shields.io/npm/v/sigstore.svg?style=flat)](https://www.npmjs.com/package/sigstore) [![CI Status](https://github.com/sigstore/sigstore-js/workflows/CI/badge.svg)](https://github.com/sigstore/sigstore-js/actions/workflows/ci.yml) [![Smoke Test Status](https://github.com/sigstore/sigstore-js/workflows/smoke-test/badge.svg)](https://github.com/sigstore/sigstore-js/actions/workflows/smoke-test.yml)
     
     A JavaScript library for generating and verifying Sigstore signatures. One of
     the intended uses is to sign and verify npm packages but it can be used to sign
    @@ -101,29 +101,16 @@ sigstore  
     
     ## Development
     
    -### Updating protobufs
    +### Changesets
    +If you are contributing a user-facing or noteworthy change that should be added to the changelog, you should include a changeset with your PR by running the following command:
     
    -[Docker](https://docs.docker.com/engine/install/) is required to generate protobufs for the `.sigstore` bundle format.
    -
    -Install Docker on MacOS using [Homebrew](https://brew.sh/):
    -
    -```
    -brew install --cask docker && open -a Docker
    +```console
    +npx changeset add
     ```
     
    -View [Docker install instructions](https://docs.docker.com/engine/install/) for other platforms.
    -
    -#### Updating Sigstore Protobufs
    -
    -Update the Git `REF` in `hack/generate-bundle-types` from the [sigstore/protobuf-specs][5] repository.
    +Follow the prompts to specify whether the change is a major, minor or patch change. This will create a file in the `.changesets` directory of the repo. This change should be committed and included with your PR.
     
    -Generate TypeScript protobufs (should update files in scr/types/sigstore/\_\_generated\_\_):
    -
    -```
    -npm run codegen:bundle
    -```
    -
    -#### Updating Rekor Types
    +### Updating Rekor Types
     
     Update the git `REF` in `hack/generate-rekor-types` from the [sigstore/rekor][1] repository.
     
    @@ -135,16 +122,10 @@ npm run codegen:rekor
     
     ### Release Steps
     
    -1. Update the version inside `package.json` and run `npm i` to update `package-lock.json`.
    -2. PR the changes above and merge to the "main" branch when approved.
    -3. Use either the "[Create a new release](https://github.com/sigstore/sigstore-js/releases/new)" link or the `gh release create` CLI command to start a new release.
    -4. Tag the release with a label matching the version in the `package.json` (with a `v` prefix).
    -5. Add a title matching the tag.
    -6. Add release notes.
    -7. Mark as pre-release as appropriate.
    -8. Publish release.
    +Whenever a new changeset is merged to the "main" branch, the `release` workflow will open a PR (or append to the existing PR if one is already open) with the all of the pending changesets.
    +
    +Publishing a release simply requires that you approve/merge this PR. This will trigger the publishing of the package to the npm registry and the creation of the GitHub release.
     
    -After publishing the release, a new npm package will be built and published automatically to the npm registry.
     ## Licensing
     
     `sigstore-js` is licensed under the Apache 2.0 License.
    diff --git a/deps/npm/node_modules/sigstore/dist/ca/format.d.ts b/deps/npm/node_modules/sigstore/dist/ca/format.d.ts
    index 185b4c260afb40..9a20bf8f71dc56 100644
    --- a/deps/npm/node_modules/sigstore/dist/ca/format.d.ts
    +++ b/deps/npm/node_modules/sigstore/dist/ca/format.d.ts
    @@ -1,5 +1,5 @@
     /// 
     /// 
     import { KeyObject } from 'crypto';
    -import { CertificateRequest } from '../client/fulcio';
    -export declare function toCertificateRequest(publicKey: KeyObject, challenge: Buffer): CertificateRequest;
    +import { SigningCertificateRequest } from '../client/fulcio';
    +export declare function toCertificateRequest(identityToken: string, publicKey: KeyObject, challenge: Buffer): SigningCertificateRequest;
    diff --git a/deps/npm/node_modules/sigstore/dist/ca/format.js b/deps/npm/node_modules/sigstore/dist/ca/format.js
    index f168cbe3154792..6374243e80e026 100644
    --- a/deps/npm/node_modules/sigstore/dist/ca/format.js
    +++ b/deps/npm/node_modules/sigstore/dist/ca/format.js
    @@ -1,14 +1,20 @@
     "use strict";
     Object.defineProperty(exports, "__esModule", { value: true });
     exports.toCertificateRequest = void 0;
    -function toCertificateRequest(publicKey, challenge) {
    +function toCertificateRequest(identityToken, publicKey, challenge) {
         return {
    -        publicKey: {
    -            content: publicKey
    -                .export({ type: 'spki', format: 'der' })
    -                .toString('base64'),
    +        credentials: {
    +            oidcIdentityToken: identityToken,
    +        },
    +        publicKeyRequest: {
    +            publicKey: {
    +                algorithm: 'ECDSA',
    +                content: publicKey
    +                    .export({ format: 'pem', type: 'spki' })
    +                    .toString('ascii'),
    +            },
    +            proofOfPossession: challenge.toString('base64'),
             },
    -        signedEmailAddress: challenge.toString('base64'),
         };
     }
     exports.toCertificateRequest = toCertificateRequest;
    diff --git a/deps/npm/node_modules/sigstore/dist/ca/index.js b/deps/npm/node_modules/sigstore/dist/ca/index.js
    index 3b90f864f08916..6c6e267011e2cc 100644
    --- a/deps/npm/node_modules/sigstore/dist/ca/index.js
    +++ b/deps/npm/node_modules/sigstore/dist/ca/index.js
    @@ -3,17 +3,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
     exports.CAClient = void 0;
     const client_1 = require("../client");
     const error_1 = require("../error");
    -const util_1 = require("../util");
     const format_1 = require("./format");
     class CAClient {
         constructor(options) {
             this.fulcio = new client_1.Fulcio({ baseURL: options.fulcioBaseURL });
         }
         async createSigningCertificate(identityToken, publicKey, challenge) {
    -        const request = (0, format_1.toCertificateRequest)(publicKey, challenge);
    +        const request = (0, format_1.toCertificateRequest)(identityToken, publicKey, challenge);
             try {
    -            const certificate = await this.fulcio.createSigningCertificate(identityToken, request);
    -            return util_1.pem.split(certificate);
    +            const certificate = await this.fulcio.createSigningCertificate(request);
    +            return certificate.signedCertificateEmbeddedSct.chain.certificates;
             }
             catch (err) {
                 throw new error_1.InternalError('error creating signing certificate', err);
    diff --git a/deps/npm/node_modules/sigstore/dist/cli/index.js b/deps/npm/node_modules/sigstore/dist/cli/index.js
    index 0937d3603a2a93..d7d6c76d73f6a1 100644
    --- a/deps/npm/node_modules/sigstore/dist/cli/index.js
    +++ b/deps/npm/node_modules/sigstore/dist/cli/index.js
    @@ -65,6 +65,7 @@ function printUsage() {
     const signOptions = {
         oidcClientID: 'sigstore',
         oidcIssuer: 'https://oauth2.sigstore.dev/auth',
    +    oidcRedirectURL: process.env.OIDC_REDIRECT_URL,
         rekorURL: index_1.sigstore.DEFAULT_REKOR_URL,
     };
     async function sign(artifactPath) {
    diff --git a/deps/npm/node_modules/sigstore/dist/client/fulcio.d.ts b/deps/npm/node_modules/sigstore/dist/client/fulcio.d.ts
    index 72ed51ae75d312..91fe53e69f9387 100644
    --- a/deps/npm/node_modules/sigstore/dist/client/fulcio.d.ts
    +++ b/deps/npm/node_modules/sigstore/dist/client/fulcio.d.ts
    @@ -1,11 +1,24 @@
     export interface FulcioOptions {
         baseURL: string;
     }
    -export interface CertificateRequest {
    -    publicKey: {
    -        content: string;
    +export interface SigningCertificateRequest {
    +    credentials: {
    +        oidcIdentityToken: string;
    +    };
    +    publicKeyRequest: {
    +        publicKey: {
    +            algorithm: string;
    +            content: string;
    +        };
    +        proofOfPossession: string;
    +    };
    +}
    +export interface SigningCertificateResponse {
    +    signedCertificateEmbeddedSct: {
    +        chain: {
    +            certificates: string[];
    +        };
         };
    -    signedEmailAddress: string;
     }
     /**
      * Fulcio API client.
    @@ -14,5 +27,5 @@ export declare class Fulcio {
         private fetch;
         private baseUrl;
         constructor(options: FulcioOptions);
    -    createSigningCertificate(idToken: string, request: CertificateRequest): Promise;
    +    createSigningCertificate(request: SigningCertificateRequest): Promise;
     }
    diff --git a/deps/npm/node_modules/sigstore/dist/client/fulcio.js b/deps/npm/node_modules/sigstore/dist/client/fulcio.js
    index 04041387f1a0b8..288ca32caaea78 100644
    --- a/deps/npm/node_modules/sigstore/dist/client/fulcio.js
    +++ b/deps/npm/node_modules/sigstore/dist/client/fulcio.js
    @@ -31,22 +31,20 @@ class Fulcio {
                 retry: { retries: 2 },
                 timeout: 5000,
                 headers: {
    -                Accept: 'application/pem-certificate-chain',
                     'Content-Type': 'application/json',
                     'User-Agent': util_1.ua.getUserAgent(),
                 },
             });
             this.baseUrl = options.baseURL;
         }
    -    async createSigningCertificate(idToken, request) {
    -        const url = `${this.baseUrl}/api/v1/signingCert`;
    +    async createSigningCertificate(request) {
    +        const url = `${this.baseUrl}/api/v2/signingCert`;
             const response = await this.fetch(url, {
                 method: 'POST',
    -            headers: { Authorization: `Bearer ${idToken}` },
                 body: JSON.stringify(request),
             });
             (0, error_1.checkStatus)(response);
    -        const data = await response.text();
    +        const data = await response.json();
             return data;
         }
     }
    diff --git a/deps/npm/node_modules/sigstore/dist/identity/index.d.ts b/deps/npm/node_modules/sigstore/dist/identity/index.d.ts
    index e3d23b4dbf8c6f..3eb0b444d120ff 100644
    --- a/deps/npm/node_modules/sigstore/dist/identity/index.d.ts
    +++ b/deps/npm/node_modules/sigstore/dist/identity/index.d.ts
    @@ -8,7 +8,12 @@ import { Provider } from './provider';
      * @param clientSecret Client secret for the issuer (optional)
      * @returns {Provider}
      */
    -declare function oauthProvider(issuer: string, clientID: string, clientSecret?: string): Provider;
    +declare function oauthProvider(options: {
    +    issuer: string;
    +    clientID: string;
    +    clientSecret?: string;
    +    redirectURL?: string;
    +}): Provider;
     /**
      * ciContextProvider returns a new Provider instance which attempts to retrieve
      * an identity token from the CI context.
    diff --git a/deps/npm/node_modules/sigstore/dist/identity/index.js b/deps/npm/node_modules/sigstore/dist/identity/index.js
    index bfb203aa39e8ce..351d607106700f 100644
    --- a/deps/npm/node_modules/sigstore/dist/identity/index.js
    +++ b/deps/npm/node_modules/sigstore/dist/identity/index.js
    @@ -27,8 +27,13 @@ const oauth_1 = require("./oauth");
      * @param clientSecret Client secret for the issuer (optional)
      * @returns {Provider}
      */
    -function oauthProvider(issuer, clientID, clientSecret) {
    -    return new oauth_1.OAuthProvider(new issuer_1.Issuer(issuer), clientID, clientSecret);
    +function oauthProvider(options) {
    +    return new oauth_1.OAuthProvider({
    +        issuer: new issuer_1.Issuer(options.issuer),
    +        clientID: options.clientID,
    +        clientSecret: options.clientSecret,
    +        redirectURL: options.redirectURL,
    +    });
     }
     /**
      * ciContextProvider returns a new Provider instance which attempts to retrieve
    diff --git a/deps/npm/node_modules/sigstore/dist/identity/oauth.d.ts b/deps/npm/node_modules/sigstore/dist/identity/oauth.d.ts
    index d02e212a7f88e7..3c9fae9ac15387 100644
    --- a/deps/npm/node_modules/sigstore/dist/identity/oauth.d.ts
    +++ b/deps/npm/node_modules/sigstore/dist/identity/oauth.d.ts
    @@ -1,5 +1,11 @@
     import { Issuer } from './issuer';
     import { Provider } from './provider';
    +interface OAuthProviderOptions {
    +    issuer: Issuer;
    +    clientID: string;
    +    clientSecret?: string;
    +    redirectURL?: string;
    +}
     export declare class OAuthProvider implements Provider {
         private clientID;
         private clientSecret;
    @@ -7,7 +13,7 @@ export declare class OAuthProvider implements Provider {
         private codeVerifier;
         private state;
         private redirectURI?;
    -    constructor(issuer: Issuer, clientID: string, clientSecret?: string);
    +    constructor(options: OAuthProviderOptions);
         getToken(): Promise;
         private initiateAuthRequest;
         private getIDToken;
    @@ -17,3 +23,4 @@ export declare class OAuthProvider implements Provider {
         private getCodeChallenge;
         private openURL;
     }
    +export {};
    diff --git a/deps/npm/node_modules/sigstore/dist/identity/oauth.js b/deps/npm/node_modules/sigstore/dist/identity/oauth.js
    index 651a0c7e80f1b7..7cb5a00cdb6942 100644
    --- a/deps/npm/node_modules/sigstore/dist/identity/oauth.js
    +++ b/deps/npm/node_modules/sigstore/dist/identity/oauth.js
    @@ -26,10 +26,11 @@ const make_fetch_happen_1 = __importDefault(require("make-fetch-happen"));
     const url_1 = require("url");
     const util_1 = require("../util");
     class OAuthProvider {
    -    constructor(issuer, clientID, clientSecret) {
    -        this.clientID = clientID;
    -        this.clientSecret = clientSecret || '';
    -        this.issuer = issuer;
    +    constructor(options) {
    +        this.clientID = options.clientID;
    +        this.clientSecret = options.clientSecret || '';
    +        this.issuer = options.issuer;
    +        this.redirectURI = options.redirectURL;
             this.codeVerifier = generateRandomString(32);
             this.state = generateRandomString(16);
         }
    @@ -43,9 +44,20 @@ class OAuthProvider {
         async initiateAuthRequest() {
             const server = http_1.default.createServer();
             const sockets = new Set();
    -        // Start server and wait till it is listening
    +        // Start server and wait till it is listening. If a redirect URL was
    +        // provided, use that. Otherwise, use a random port and construct the
    +        // redirect URL.
             await new Promise((resolve) => {
    -            server.listen(0, resolve);
    +            if (this.redirectURI) {
    +                const url = new url_1.URL(this.redirectURI);
    +                server.listen(Number(url.port), url.hostname, resolve);
    +            }
    +            else {
    +                server.listen(0, resolve);
    +                // Get port the server is listening on and construct the server URL
    +                const port = server.address().port;
    +                this.redirectURI = `http://localhost:${port}`;
    +            }
             });
             // Keep track of connections to the server so we can force a shutdown
             server.on('connection', (socket) => {
    @@ -54,9 +66,6 @@ class OAuthProvider {
                     sockets.delete(socket);
                 });
             });
    -        // Get port the server is listening on and construct the server URL
    -        const port = server.address().port;
    -        this.redirectURI = `http://localhost:${port}`;
             const result = new Promise((resolve, reject) => {
                 // Set-up handler for post-auth redirect
                 server.on('request', (req, res) => {
    diff --git a/deps/npm/node_modules/sigstore/dist/sigstore.d.ts b/deps/npm/node_modules/sigstore/dist/sigstore.d.ts
    index bb3034383e6956..69a28f7243048a 100644
    --- a/deps/npm/node_modules/sigstore/dist/sigstore.d.ts
    +++ b/deps/npm/node_modules/sigstore/dist/sigstore.d.ts
    @@ -8,12 +8,17 @@ export declare const DEFAULT_REKOR_URL = "https://rekor.sigstore.dev";
     interface TLogOptions {
         rekorURL?: string;
     }
    +interface TUFOptions {
    +    tufMirrorURL?: string;
    +    tufRootPath?: string;
    +}
     export type SignOptions = {
         fulcioURL?: string;
         identityToken?: string;
         oidcIssuer?: string;
         oidcClientID?: string;
         oidcClientSecret?: string;
    +    oidcRedirectURL?: string;
     } & TLogOptions;
     export type VerifyOptions = {
         ctLogThreshold?: number;
    @@ -23,7 +28,7 @@ export type VerifyOptions = {
         certificateIdentityURI?: string;
         certificateOIDs?: Record;
         keySelector?: KeySelector;
    -} & TLogOptions;
    +} & TLogOptions & TUFOptions;
     type Bundle = sigstore.SerializedBundle;
     export declare function sign(payload: Buffer, options?: SignOptions): Promise;
     export declare function attest(payload: Buffer, payloadType: string, options?: SignOptions): Promise;
    diff --git a/deps/npm/node_modules/sigstore/dist/sigstore.js b/deps/npm/node_modules/sigstore/dist/sigstore.js
    index ef8fb2058a47e9..cf8c90c309148e 100644
    --- a/deps/npm/node_modules/sigstore/dist/sigstore.js
    +++ b/deps/npm/node_modules/sigstore/dist/sigstore.js
    @@ -42,15 +42,13 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
     */
    -const fs_1 = __importDefault(require("fs"));
    -const os_1 = __importDefault(require("os"));
    -const path_1 = __importDefault(require("path"));
     const ca_1 = require("./ca");
     const identity_1 = __importDefault(require("./identity"));
     const sign_1 = require("./sign");
     const tlog_1 = require("./tlog");
     const tuf = __importStar(require("./tuf"));
     const sigstore = __importStar(require("./types/sigstore"));
    +const util_1 = require("./util");
     const verify_1 = require("./verify");
     exports.utils = __importStar(require("./sigstore-utils"));
     exports.DEFAULT_FULCIO_URL = 'https://fulcio.sigstore.dev';
    @@ -65,6 +63,7 @@ function createTLogClient(options) {
             rekorBaseURL: options.rekorURL || exports.DEFAULT_REKOR_URL,
         });
     }
    +const tufCacheDir = util_1.appdata.appDataPath('sigstore-js');
     async function sign(payload, options = {}) {
         const ca = createCAClient(options);
         const tlog = createTLogClient(options);
    @@ -92,8 +91,10 @@ async function attest(payload, payloadType, options = {}) {
     }
     exports.attest = attest;
     async function verify(bundle, payload, options = {}) {
    -    const cacheDir = defaultCacheDir();
    -    const trustedRoot = await tuf.getTrustedRoot(cacheDir);
    +    const trustedRoot = await tuf.getTrustedRoot(tufCacheDir, {
    +        mirrorURL: options.tufMirrorURL,
    +        rootPath: options.tufRootPath,
    +    });
         const verifier = new verify_1.Verifier(trustedRoot, options.keySelector);
         const deserializedBundle = sigstore.bundleFromJSON(bundle);
         const opts = collectArtifactVerificationOptions(options);
    @@ -114,21 +115,16 @@ function configureIdentityProviders(options) {
         else {
             idps.push(identity_1.default.ciContextProvider());
             if (options.oidcIssuer && options.oidcClientID) {
    -            idps.push(identity_1.default.oauthProvider(options.oidcIssuer, options.oidcClientID, options.oidcClientSecret));
    +            idps.push(identity_1.default.oauthProvider({
    +                issuer: options.oidcIssuer,
    +                clientID: options.oidcClientID,
    +                clientSecret: options.oidcClientSecret,
    +                redirectURL: options.oidcRedirectURL,
    +            }));
             }
         }
         return idps;
     }
    -function defaultCacheDir() {
    -    let cacheRootDir = os_1.default.homedir();
    -    try {
    -        fs_1.default.accessSync(os_1.default.homedir(), fs_1.default.constants.W_OK | fs_1.default.constants.R_OK);
    -    }
    -    catch (e) {
    -        cacheRootDir = os_1.default.tmpdir();
    -    }
    -    return path_1.default.join(cacheRootDir, '.sigstore', 'js-root');
    -}
     // Assembles the AtifactVerificationOptions from the supplied VerifyOptions.
     function collectArtifactVerificationOptions(options) {
         // The trusted signers are only used if the options contain a certificate
    diff --git a/deps/npm/node_modules/sigstore/dist/tlog/types/__generated__/hashedrekord.js b/deps/npm/node_modules/sigstore/dist/tlog/types/__generated__/hashedrekord.js
    index 5383a370094cdf..61923a61cd8dee 100644
    --- a/deps/npm/node_modules/sigstore/dist/tlog/types/__generated__/hashedrekord.js
    +++ b/deps/npm/node_modules/sigstore/dist/tlog/types/__generated__/hashedrekord.js
    @@ -1,5 +1,5 @@
     "use strict";
    -/* tslint:disable */
    +/* eslint-disable */
     /**
      * This file was automatically generated by json-schema-to-typescript.
      * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
    diff --git a/deps/npm/node_modules/sigstore/dist/tlog/types/__generated__/intoto.js b/deps/npm/node_modules/sigstore/dist/tlog/types/__generated__/intoto.js
    index 5383a370094cdf..61923a61cd8dee 100644
    --- a/deps/npm/node_modules/sigstore/dist/tlog/types/__generated__/intoto.js
    +++ b/deps/npm/node_modules/sigstore/dist/tlog/types/__generated__/intoto.js
    @@ -1,5 +1,5 @@
     "use strict";
    -/* tslint:disable */
    +/* eslint-disable */
     /**
      * This file was automatically generated by json-schema-to-typescript.
      * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
    diff --git a/deps/npm/node_modules/sigstore/dist/tuf/index.d.ts b/deps/npm/node_modules/sigstore/dist/tuf/index.d.ts
    index 349ff08b3be4bb..455fc6af06c54e 100644
    --- a/deps/npm/node_modules/sigstore/dist/tuf/index.d.ts
    +++ b/deps/npm/node_modules/sigstore/dist/tuf/index.d.ts
    @@ -1,2 +1,6 @@
     import * as sigstore from '../types/sigstore';
    -export declare function getTrustedRoot(cacheDir: string): Promise;
    +export interface TUFOptions {
    +    mirrorURL?: string;
    +    rootPath?: string;
    +}
    +export declare function getTrustedRoot(cachePath: string, options?: TUFOptions): Promise;
    diff --git a/deps/npm/node_modules/sigstore/dist/tuf/index.js b/deps/npm/node_modules/sigstore/dist/tuf/index.js
    index 1aea238ef32ff2..824bce9105ed8e 100644
    --- a/deps/npm/node_modules/sigstore/dist/tuf/index.js
    +++ b/deps/npm/node_modules/sigstore/dist/tuf/index.js
    @@ -1,4 +1,27 @@
     "use strict";
    +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    +    if (k2 === undefined) k2 = k;
    +    var desc = Object.getOwnPropertyDescriptor(m, k);
    +    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
    +      desc = { enumerable: true, get: function() { return m[k]; } };
    +    }
    +    Object.defineProperty(o, k2, desc);
    +}) : (function(o, m, k, k2) {
    +    if (k2 === undefined) k2 = k;
    +    o[k2] = m[k];
    +}));
    +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    +    Object.defineProperty(o, "default", { enumerable: true, value: v });
    +}) : function(o, v) {
    +    o["default"] = v;
    +});
    +var __importStar = (this && this.__importStar) || function (mod) {
    +    if (mod && mod.__esModule) return mod;
    +    var result = {};
    +    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    +    __setModuleDefault(result, mod);
    +    return result;
    +};
     var __importDefault = (this && this.__importDefault) || function (mod) {
         return (mod && mod.__esModule) ? mod : { "default": mod };
     };
    @@ -22,55 +45,62 @@ limitations under the License.
     const fs_1 = __importDefault(require("fs"));
     const path_1 = __importDefault(require("path"));
     const tuf_js_1 = require("tuf-js");
    -const trustroot_1 = require("./trustroot");
    -async function getTrustedRoot(cacheDir) {
    -    initTufCache(cacheDir);
    -    const repoMap = initRepoMap(cacheDir);
    -    const repoClients = Object.entries(repoMap.repositories).map(([name, urls]) => initClient(name, urls[0], cacheDir));
    -    // TODO: Add support for multiple repositories. For now, we just use the first
    -    // one (the production Sigstore TUF repository).
    -    const fetcher = new trustroot_1.TrustedRootFetcher(repoClients[0]);
    -    return fetcher.getTrustedRoot();
    +const sigstore = __importStar(require("../types/sigstore"));
    +const target_1 = require("./target");
    +const TRUSTED_ROOT_TARGET = 'trusted_root.json';
    +const DEFAULT_MIRROR_URL = 'https://sigstore-tuf-root.storage.googleapis.com';
    +const DEFAULT_TUF_ROOT_PATH = '../../store/public-good-instance-root.json';
    +async function getTrustedRoot(cachePath, options = {}) {
    +    const tufRootPath = options.rootPath || require.resolve(DEFAULT_TUF_ROOT_PATH);
    +    const mirrorURL = options.mirrorURL || DEFAULT_MIRROR_URL;
    +    initTufCache(cachePath, tufRootPath);
    +    const remote = initRemoteConfig(cachePath, mirrorURL);
    +    const repoClient = initClient(cachePath, remote);
    +    const trustedRoot = await (0, target_1.getTarget)(repoClient, TRUSTED_ROOT_TARGET);
    +    return sigstore.TrustedRoot.fromJSON(JSON.parse(trustedRoot));
     }
     exports.getTrustedRoot = getTrustedRoot;
    -// Initializes the root TUF cache directory
    -function initTufCache(cacheDir) {
    -    if (!fs_1.default.existsSync(cacheDir)) {
    -        fs_1.default.mkdirSync(cacheDir, { recursive: true });
    +// Initializes the TUF cache directory structure including the initial
    +// root.json file. If the cache directory does not exist, it will be
    +// created. If the targets directory does not exist, it will be created.
    +// If the root.json file does not exist, it will be copied from the
    +// rootPath argument.
    +function initTufCache(cachePath, tufRootPath) {
    +    const targetsPath = path_1.default.join(cachePath, 'targets');
    +    const cachedRootPath = path_1.default.join(cachePath, 'root.json');
    +    if (!fs_1.default.existsSync(cachePath)) {
    +        fs_1.default.mkdirSync(cachePath, { recursive: true });
         }
    -}
    -// Initializes the repo map (copying it to the cache root dir) and returns the
    -// content of the repository map.
    -function initRepoMap(rootDir) {
    -    const mapDest = path_1.default.join(rootDir, 'map.json');
    -    if (!fs_1.default.existsSync(mapDest)) {
    -        const mapSrc = require.resolve('../../store/map.json');
    -        fs_1.default.copyFileSync(mapSrc, mapDest);
    +    if (!fs_1.default.existsSync(targetsPath)) {
    +        fs_1.default.mkdirSync(targetsPath);
         }
    -    const buf = fs_1.default.readFileSync(mapDest);
    -    return JSON.parse(buf.toString('utf-8'));
    +    if (!fs_1.default.existsSync(cachedRootPath)) {
    +        fs_1.default.copyFileSync(tufRootPath, cachedRootPath);
    +    }
    +    return cachePath;
     }
    -function initClient(name, url, rootDir) {
    -    const repoCachePath = path_1.default.join(rootDir, name);
    -    const targetCachePath = path_1.default.join(repoCachePath, 'targets');
    -    const tufRootDest = path_1.default.join(repoCachePath, 'root.json');
    -    // Only copy the TUF trusted root if it doesn't already exist. It's possible
    -    // that the cached root has already been updated, so we don't want to roll it
    -    // back.
    -    if (!fs_1.default.existsSync(tufRootDest)) {
    -        const tufRootSrc = require.resolve(`../../store/${name}-root.json`);
    -        fs_1.default.mkdirSync(repoCachePath);
    -        fs_1.default.copyFileSync(tufRootSrc, tufRootDest);
    +// Initializes the remote.json file, which contains the URL of the TUF
    +// repository. If the file does not exist, it will be created. If the file
    +// exists, it will be parsed and returned.
    +function initRemoteConfig(rootDir, mirrorURL) {
    +    let remoteConfig;
    +    const remoteConfigPath = path_1.default.join(rootDir, 'remote.json');
    +    if (fs_1.default.existsSync(remoteConfigPath)) {
    +        const data = fs_1.default.readFileSync(remoteConfigPath, 'utf-8');
    +        remoteConfig = JSON.parse(data);
         }
    -    if (!fs_1.default.existsSync(targetCachePath)) {
    -        fs_1.default.mkdirSync(targetCachePath);
    +    if (!remoteConfig) {
    +        remoteConfig = { mirror: mirrorURL };
    +        fs_1.default.writeFileSync(remoteConfigPath, JSON.stringify(remoteConfig));
         }
    -    // TODO: Is there some better way to derive the base URL for the targets?
    -    // Hard-coding for now based on current Sigstore TUF repo layout.
    +    return remoteConfig;
    +}
    +function initClient(cachePath, remote) {
    +    const baseURL = remote.mirror;
         return new tuf_js_1.Updater({
    -        metadataBaseUrl: url,
    -        targetBaseUrl: `${url}/targets`,
    -        metadataDir: repoCachePath,
    -        targetDir: targetCachePath,
    +        metadataBaseUrl: baseURL,
    +        targetBaseUrl: `${baseURL}/targets`,
    +        metadataDir: cachePath,
    +        targetDir: path_1.default.join(cachePath, 'targets'),
         });
     }
    diff --git a/deps/npm/node_modules/sigstore/dist/tuf/target.d.ts b/deps/npm/node_modules/sigstore/dist/tuf/target.d.ts
    new file mode 100644
    index 00000000000000..aed81654f3be0b
    --- /dev/null
    +++ b/deps/npm/node_modules/sigstore/dist/tuf/target.d.ts
    @@ -0,0 +1,2 @@
    +import { Updater } from 'tuf-js';
    +export declare function getTarget(tuf: Updater, targetPath: string): Promise;
    diff --git a/deps/npm/node_modules/sigstore/dist/tuf/target.js b/deps/npm/node_modules/sigstore/dist/tuf/target.js
    new file mode 100644
    index 00000000000000..ac708cdbcf1cef
    --- /dev/null
    +++ b/deps/npm/node_modules/sigstore/dist/tuf/target.js
    @@ -0,0 +1,60 @@
    +"use strict";
    +var __importDefault = (this && this.__importDefault) || function (mod) {
    +    return (mod && mod.__esModule) ? mod : { "default": mod };
    +};
    +Object.defineProperty(exports, "__esModule", { value: true });
    +exports.getTarget = void 0;
    +/*
    +Copyright 2023 The Sigstore Authors.
    +
    +Licensed under the Apache License, Version 2.0 (the "License");
    +you may not use this file except in compliance with the License.
    +You may obtain a copy of the License at
    +
    +    http://www.apache.org/licenses/LICENSE-2.0
    +
    +Unless required by applicable law or agreed to in writing, software
    +distributed under the License is distributed on an "AS IS" BASIS,
    +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    +See the License for the specific language governing permissions and
    +limitations under the License.
    +*/
    +const fs_1 = __importDefault(require("fs"));
    +const error_1 = require("../error");
    +// Returns the local path to the specified target. If the target is not yet
    +// cached locally, the provided TUF Updater will be used to download and
    +// cache the target.
    +async function getTarget(tuf, targetPath) {
    +    const path = await getTargetPath(tuf, targetPath);
    +    try {
    +        return fs_1.default.readFileSync(path, 'utf-8');
    +    }
    +    catch (err) {
    +        throw new error_1.InternalError(`error reading trusted root: ${err}`);
    +    }
    +}
    +exports.getTarget = getTarget;
    +async function getTargetPath(tuf, target) {
    +    let targetInfo;
    +    try {
    +        targetInfo = await tuf.refresh().then(() => tuf.getTargetInfo(target));
    +    }
    +    catch (err) {
    +        throw new error_1.InternalError(`error refreshing TUF metadata: ${err}`);
    +    }
    +    if (!targetInfo) {
    +        throw new error_1.InternalError(`target ${target} not found`);
    +    }
    +    let path = await tuf.findCachedTarget(targetInfo);
    +    // An empty path here means the target has not been cached locally, or is
    +    // out of date. In either case, we need to download it.
    +    if (!path) {
    +        try {
    +            path = await tuf.downloadTarget(targetInfo);
    +        }
    +        catch (err) {
    +            throw new error_1.InternalError(`error downloading target: ${err}`);
    +        }
    +    }
    +    return path;
    +}
    diff --git a/deps/npm/node_modules/sigstore/dist/tuf/trustroot.d.ts b/deps/npm/node_modules/sigstore/dist/tuf/trustroot.d.ts
    deleted file mode 100644
    index 615fffae62a80e..00000000000000
    --- a/deps/npm/node_modules/sigstore/dist/tuf/trustroot.d.ts
    +++ /dev/null
    @@ -1,11 +0,0 @@
    -import { Updater } from 'tuf-js';
    -import * as sigstore from '../types/sigstore';
    -export declare class TrustedRootFetcher {
    -    private tuf;
    -    constructor(tuf: Updater);
    -    getTrustedRoot(): Promise;
    -    private allTargets;
    -    private getTLogKeys;
    -    private getCAKeys;
    -    private readTargetBytes;
    -}
    diff --git a/deps/npm/node_modules/sigstore/dist/tuf/trustroot.js b/deps/npm/node_modules/sigstore/dist/tuf/trustroot.js
    deleted file mode 100644
    index dcf491cdaefe8d..00000000000000
    --- a/deps/npm/node_modules/sigstore/dist/tuf/trustroot.js
    +++ /dev/null
    @@ -1,163 +0,0 @@
    -"use strict";
    -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    -    if (k2 === undefined) k2 = k;
    -    var desc = Object.getOwnPropertyDescriptor(m, k);
    -    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
    -      desc = { enumerable: true, get: function() { return m[k]; } };
    -    }
    -    Object.defineProperty(o, k2, desc);
    -}) : (function(o, m, k, k2) {
    -    if (k2 === undefined) k2 = k;
    -    o[k2] = m[k];
    -}));
    -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    -    Object.defineProperty(o, "default", { enumerable: true, value: v });
    -}) : function(o, v) {
    -    o["default"] = v;
    -});
    -var __importStar = (this && this.__importStar) || function (mod) {
    -    if (mod && mod.__esModule) return mod;
    -    var result = {};
    -    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    -    __setModuleDefault(result, mod);
    -    return result;
    -};
    -var __importDefault = (this && this.__importDefault) || function (mod) {
    -    return (mod && mod.__esModule) ? mod : { "default": mod };
    -};
    -Object.defineProperty(exports, "__esModule", { value: true });
    -exports.TrustedRootFetcher = void 0;
    -/*
    -Copyright 2023 The Sigstore Authors.
    -
    -Licensed under the Apache License, Version 2.0 (the "License");
    -you may not use this file except in compliance with the License.
    -You may obtain a copy of the License at
    -
    -    http://www.apache.org/licenses/LICENSE-2.0
    -
    -Unless required by applicable law or agreed to in writing, software
    -distributed under the License is distributed on an "AS IS" BASIS,
    -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    -See the License for the specific language governing permissions and
    -limitations under the License.
    -*/
    -const fs_1 = __importDefault(require("fs"));
    -const error_1 = require("../error");
    -const sigstore = __importStar(require("../types/sigstore"));
    -const util_1 = require("../util");
    -const TRUSTED_ROOT_MEDIA_TYPE = 'application/vnd.dev.sigstore.trustedroot+json;version=0.1';
    -// Type guard for SigstoreTargetMetadata
    -function isTargetMetadata(m) {
    -    return (m !== undefined &&
    -        m !== null &&
    -        typeof m === 'object' &&
    -        'status' in m &&
    -        'usage' in m &&
    -        'uri' in m);
    -}
    -class TrustedRootFetcher {
    -    constructor(tuf) {
    -        this.tuf = tuf;
    -    }
    -    // Assembles a TrustedRoot from the targets in the TUF repo
    -    async getTrustedRoot() {
    -        // Get all available targets
    -        const targets = await this.allTargets();
    -        const cas = await this.getCAKeys(targets, 'Fulcio');
    -        const ctlogs = await this.getTLogKeys(targets, 'CTFE');
    -        const tlogs = await this.getTLogKeys(targets, 'Rekor');
    -        return {
    -            mediaType: TRUSTED_ROOT_MEDIA_TYPE,
    -            certificateAuthorities: cas,
    -            ctlogs: ctlogs,
    -            tlogs: tlogs,
    -            timestampAuthorities: [],
    -        };
    -    }
    -    // Retrieves the list of TUF targets.
    -    // NOTE: This is a HACK to get around the fact that the TUF library doesn't
    -    // expose the list of targets. This is a temporary solution until TUF comes up
    -    // with a story for target discovery.
    -    // https://docs.google.com/document/d/1rWHAM2qCUtnjWD4lOrGWE2EIDLoA7eSy4-jB66Wgh0o
    -    async allTargets() {
    -        try {
    -            await this.tuf.refresh();
    -        }
    -        catch (e) {
    -            throw new error_1.InternalError('error refreshing trust metadata');
    -        }
    -        return Object.values(
    -        // eslint-disable-next-line @typescript-eslint/no-explicit-any
    -        this.tuf.trustedSet.targets?.signed.targets || {});
    -    }
    -    // Filters the supplied list of targets to those with the specified usage
    -    // and returns a new TransparencyLogInstance for each with the associated
    -    // public key populated.
    -    async getTLogKeys(targets, usage) {
    -        const filteredTargets = filterByUsage(targets, usage);
    -        return Promise.all(filteredTargets.map(async (target) => {
    -            const keyBytes = await this.readTargetBytes(target);
    -            const uri = isTargetMetadata(target.custom.sigstore)
    -                ? target.custom.sigstore.uri
    -                : '';
    -            // The log ID is not present in the Sigstore target metadata, but
    -            // can be derived by hashing the contents of the public key.
    -            return {
    -                baseUrl: uri,
    -                hashAlgorithm: sigstore.HashAlgorithm.SHA2_256,
    -                logId: { keyId: util_1.crypto.hash(keyBytes) },
    -                publicKey: {
    -                    keyDetails: sigstore.PublicKeyDetails.PKIX_ECDSA_P256_SHA_256,
    -                    rawBytes: keyBytes,
    -                },
    -            };
    -        }));
    -    }
    -    // Filters the supplied list of targets to those with the specified usage
    -    // and returns a new CertificateAuthority populated with all of the associated
    -    // certificates.
    -    // NOTE: The Sigstore target metadata does NOT provide any mechanism to link
    -    // related certificates (e.g. a root and intermediate). As a result, we
    -    // assume that all certificates located here are part of the same chain.
    -    // This works out OK since our certificate chain verification code tries all
    -    // possible permutations of the certificates until it finds one that results
    -    // in a valid, trusted chain.
    -    async getCAKeys(targets, usage) {
    -        const filteredTargets = filterByUsage(targets, usage);
    -        const certs = await Promise.all(filteredTargets.map(async (target) => await this.readTargetBytes(target)));
    -        return [
    -            {
    -                uri: '',
    -                subject: undefined,
    -                validFor: { start: new Date(0) },
    -                certChain: {
    -                    certificates: certs.map((cert) => ({ rawBytes: cert })),
    -                },
    -            },
    -        ];
    -    }
    -    // Reads the contents of the specified target file as a DER-encoded buffer.
    -    async readTargetBytes(target) {
    -        try {
    -            let path = await this.tuf.findCachedTarget(target);
    -            // An empty path here means the target has not been cached locally, or is
    -            // out of date. In either case, we need to download it.
    -            if (!path) {
    -                path = await this.tuf.downloadTarget(target);
    -            }
    -            const file = fs_1.default.readFileSync(path);
    -            return util_1.pem.toDER(file.toString('utf-8'));
    -        }
    -        catch (err) {
    -            throw new error_1.InternalError(`error reading key/certificate for ${target.path}`);
    -        }
    -    }
    -}
    -exports.TrustedRootFetcher = TrustedRootFetcher;
    -function filterByUsage(targets, usage) {
    -    return targets.filter((target) => {
    -        const meta = target.custom.sigstore;
    -        return isTargetMetadata(meta) && meta.usage === usage;
    -    });
    -}
    diff --git a/deps/npm/node_modules/sigstore/dist/types/sigstore/__generated__/envelope.d.ts b/deps/npm/node_modules/sigstore/dist/types/sigstore/__generated__/envelope.d.ts
    deleted file mode 100644
    index 81422a00759628..00000000000000
    --- a/deps/npm/node_modules/sigstore/dist/types/sigstore/__generated__/envelope.d.ts
    +++ /dev/null
    @@ -1,46 +0,0 @@
    -/// 
    -/** An authenticated message of arbitrary type. */
    -export interface Envelope {
    -    /**
    -     * Message to be signed. (In JSON, this is encoded as base64.)
    -     * REQUIRED.
    -     */
    -    payload: Buffer;
    -    /**
    -     * String unambiguously identifying how to interpret payload.
    -     * REQUIRED.
    -     */
    -    payloadType: string;
    -    /**
    -     * Signature over:
    -     *     PAE(type, body)
    -     * Where PAE is defined as:
    -     * PAE(type, body) = "DSSEv1" + SP + LEN(type) + SP + type + SP + LEN(body) + SP + body
    -     * +               = concatenation
    -     * SP              = ASCII space [0x20]
    -     * "DSSEv1"        = ASCII [0x44, 0x53, 0x53, 0x45, 0x76, 0x31]
    -     * LEN(s)          = ASCII decimal encoding of the byte length of s, with no leading zeros
    -     * REQUIRED (length >= 1).
    -     */
    -    signatures: Signature[];
    -}
    -export interface Signature {
    -    /**
    -     * Signature itself. (In JSON, this is encoded as base64.)
    -     * REQUIRED.
    -     */
    -    sig: Buffer;
    -    /**
    -     * Unauthenticated* hint identifying which public key was used.
    -     * OPTIONAL.
    -     */
    -    keyid: string;
    -}
    -export declare const Envelope: {
    -    fromJSON(object: any): Envelope;
    -    toJSON(message: Envelope): unknown;
    -};
    -export declare const Signature: {
    -    fromJSON(object: any): Signature;
    -    toJSON(message: Signature): unknown;
    -};
    diff --git a/deps/npm/node_modules/sigstore/dist/types/sigstore/__generated__/google/api/field_behavior.d.ts b/deps/npm/node_modules/sigstore/dist/types/sigstore/__generated__/google/api/field_behavior.d.ts
    deleted file mode 100644
    index 1b4ed47aadebc6..00000000000000
    --- a/deps/npm/node_modules/sigstore/dist/types/sigstore/__generated__/google/api/field_behavior.d.ts
    +++ /dev/null
    @@ -1,52 +0,0 @@
    -/**
    - * An indicator of the behavior of a given field (for example, that a field
    - * is required in requests, or given as output but ignored as input).
    - * This **does not** change the behavior in protocol buffers itself; it only
    - * denotes the behavior and may affect how API tooling handles the field.
    - *
    - * Note: This enum **may** receive new values in the future.
    - */
    -export declare enum FieldBehavior {
    -    /** FIELD_BEHAVIOR_UNSPECIFIED - Conventional default for enums. Do not use this. */
    -    FIELD_BEHAVIOR_UNSPECIFIED = 0,
    -    /**
    -     * OPTIONAL - Specifically denotes a field as optional.
    -     * While all fields in protocol buffers are optional, this may be specified
    -     * for emphasis if appropriate.
    -     */
    -    OPTIONAL = 1,
    -    /**
    -     * REQUIRED - Denotes a field as required.
    -     * This indicates that the field **must** be provided as part of the request,
    -     * and failure to do so will cause an error (usually `INVALID_ARGUMENT`).
    -     */
    -    REQUIRED = 2,
    -    /**
    -     * OUTPUT_ONLY - Denotes a field as output only.
    -     * This indicates that the field is provided in responses, but including the
    -     * field in a request does nothing (the server *must* ignore it and
    -     * *must not* throw an error as a result of the field's presence).
    -     */
    -    OUTPUT_ONLY = 3,
    -    /**
    -     * INPUT_ONLY - Denotes a field as input only.
    -     * This indicates that the field is provided in requests, and the
    -     * corresponding field is not included in output.
    -     */
    -    INPUT_ONLY = 4,
    -    /**
    -     * IMMUTABLE - Denotes a field as immutable.
    -     * This indicates that the field may be set once in a request to create a
    -     * resource, but may not be changed thereafter.
    -     */
    -    IMMUTABLE = 5,
    -    /**
    -     * UNORDERED_LIST - Denotes that a (repeated) field is an unordered list.
    -     * This indicates that the service may provide the elements of the list
    -     * in any arbitrary order, rather than the order the user originally
    -     * provided. Additionally, the list's order may or may not be stable.
    -     */
    -    UNORDERED_LIST = 6
    -}
    -export declare function fieldBehaviorFromJSON(object: any): FieldBehavior;
    -export declare function fieldBehaviorToJSON(object: FieldBehavior): string;
    diff --git a/deps/npm/node_modules/sigstore/dist/types/sigstore/__generated__/google/protobuf/descriptor.d.ts b/deps/npm/node_modules/sigstore/dist/types/sigstore/__generated__/google/protobuf/descriptor.d.ts
    deleted file mode 100644
    index ef43bf01c10c3b..00000000000000
    --- a/deps/npm/node_modules/sigstore/dist/types/sigstore/__generated__/google/protobuf/descriptor.d.ts
    +++ /dev/null
    @@ -1,939 +0,0 @@
    -/// 
    -/**
    - * The protocol compiler can output a FileDescriptorSet containing the .proto
    - * files it parses.
    - */
    -export interface FileDescriptorSet {
    -    file: FileDescriptorProto[];
    -}
    -/** Describes a complete .proto file. */
    -export interface FileDescriptorProto {
    -    /** file name, relative to root of source tree */
    -    name: string;
    -    /** e.g. "foo", "foo.bar", etc. */
    -    package: string;
    -    /** Names of files imported by this file. */
    -    dependency: string[];
    -    /** Indexes of the public imported files in the dependency list above. */
    -    publicDependency: number[];
    -    /**
    -     * Indexes of the weak imported files in the dependency list.
    -     * For Google-internal migration only. Do not use.
    -     */
    -    weakDependency: number[];
    -    /** All top-level definitions in this file. */
    -    messageType: DescriptorProto[];
    -    enumType: EnumDescriptorProto[];
    -    service: ServiceDescriptorProto[];
    -    extension: FieldDescriptorProto[];
    -    options: FileOptions | undefined;
    -    /**
    -     * This field contains optional information about the original source code.
    -     * You may safely remove this entire field without harming runtime
    -     * functionality of the descriptors -- the information is needed only by
    -     * development tools.
    -     */
    -    sourceCodeInfo: SourceCodeInfo | undefined;
    -    /**
    -     * The syntax of the proto file.
    -     * The supported values are "proto2" and "proto3".
    -     */
    -    syntax: string;
    -}
    -/** Describes a message type. */
    -export interface DescriptorProto {
    -    name: string;
    -    field: FieldDescriptorProto[];
    -    extension: FieldDescriptorProto[];
    -    nestedType: DescriptorProto[];
    -    enumType: EnumDescriptorProto[];
    -    extensionRange: DescriptorProto_ExtensionRange[];
    -    oneofDecl: OneofDescriptorProto[];
    -    options: MessageOptions | undefined;
    -    reservedRange: DescriptorProto_ReservedRange[];
    -    /**
    -     * Reserved field names, which may not be used by fields in the same message.
    -     * A given name may only be reserved once.
    -     */
    -    reservedName: string[];
    -}
    -export interface DescriptorProto_ExtensionRange {
    -    /** Inclusive. */
    -    start: number;
    -    /** Exclusive. */
    -    end: number;
    -    options: ExtensionRangeOptions | undefined;
    -}
    -/**
    - * Range of reserved tag numbers. Reserved tag numbers may not be used by
    - * fields or extension ranges in the same message. Reserved ranges may
    - * not overlap.
    - */
    -export interface DescriptorProto_ReservedRange {
    -    /** Inclusive. */
    -    start: number;
    -    /** Exclusive. */
    -    end: number;
    -}
    -export interface ExtensionRangeOptions {
    -    /** The parser stores options it doesn't recognize here. See above. */
    -    uninterpretedOption: UninterpretedOption[];
    -}
    -/** Describes a field within a message. */
    -export interface FieldDescriptorProto {
    -    name: string;
    -    number: number;
    -    label: FieldDescriptorProto_Label;
    -    /**
    -     * If type_name is set, this need not be set.  If both this and type_name
    -     * are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP.
    -     */
    -    type: FieldDescriptorProto_Type;
    -    /**
    -     * For message and enum types, this is the name of the type.  If the name
    -     * starts with a '.', it is fully-qualified.  Otherwise, C++-like scoping
    -     * rules are used to find the type (i.e. first the nested types within this
    -     * message are searched, then within the parent, on up to the root
    -     * namespace).
    -     */
    -    typeName: string;
    -    /**
    -     * For extensions, this is the name of the type being extended.  It is
    -     * resolved in the same manner as type_name.
    -     */
    -    extendee: string;
    -    /**
    -     * For numeric types, contains the original text representation of the value.
    -     * For booleans, "true" or "false".
    -     * For strings, contains the default text contents (not escaped in any way).
    -     * For bytes, contains the C escaped value.  All bytes >= 128 are escaped.
    -     */
    -    defaultValue: string;
    -    /**
    -     * If set, gives the index of a oneof in the containing type's oneof_decl
    -     * list.  This field is a member of that oneof.
    -     */
    -    oneofIndex: number;
    -    /**
    -     * JSON name of this field. The value is set by protocol compiler. If the
    -     * user has set a "json_name" option on this field, that option's value
    -     * will be used. Otherwise, it's deduced from the field's name by converting
    -     * it to camelCase.
    -     */
    -    jsonName: string;
    -    options: FieldOptions | undefined;
    -    /**
    -     * If true, this is a proto3 "optional". When a proto3 field is optional, it
    -     * tracks presence regardless of field type.
    -     *
    -     * When proto3_optional is true, this field must be belong to a oneof to
    -     * signal to old proto3 clients that presence is tracked for this field. This
    -     * oneof is known as a "synthetic" oneof, and this field must be its sole
    -     * member (each proto3 optional field gets its own synthetic oneof). Synthetic
    -     * oneofs exist in the descriptor only, and do not generate any API. Synthetic
    -     * oneofs must be ordered after all "real" oneofs.
    -     *
    -     * For message fields, proto3_optional doesn't create any semantic change,
    -     * since non-repeated message fields always track presence. However it still
    -     * indicates the semantic detail of whether the user wrote "optional" or not.
    -     * This can be useful for round-tripping the .proto file. For consistency we
    -     * give message fields a synthetic oneof also, even though it is not required
    -     * to track presence. This is especially important because the parser can't
    -     * tell if a field is a message or an enum, so it must always create a
    -     * synthetic oneof.
    -     *
    -     * Proto2 optional fields do not set this flag, because they already indicate
    -     * optional with `LABEL_OPTIONAL`.
    -     */
    -    proto3Optional: boolean;
    -}
    -export declare enum FieldDescriptorProto_Type {
    -    /**
    -     * TYPE_DOUBLE - 0 is reserved for errors.
    -     * Order is weird for historical reasons.
    -     */
    -    TYPE_DOUBLE = 1,
    -    TYPE_FLOAT = 2,
    -    /**
    -     * TYPE_INT64 - Not ZigZag encoded.  Negative numbers take 10 bytes.  Use TYPE_SINT64 if
    -     * negative values are likely.
    -     */
    -    TYPE_INT64 = 3,
    -    TYPE_UINT64 = 4,
    -    /**
    -     * TYPE_INT32 - Not ZigZag encoded.  Negative numbers take 10 bytes.  Use TYPE_SINT32 if
    -     * negative values are likely.
    -     */
    -    TYPE_INT32 = 5,
    -    TYPE_FIXED64 = 6,
    -    TYPE_FIXED32 = 7,
    -    TYPE_BOOL = 8,
    -    TYPE_STRING = 9,
    -    /**
    -     * TYPE_GROUP - Tag-delimited aggregate.
    -     * Group type is deprecated and not supported in proto3. However, Proto3
    -     * implementations should still be able to parse the group wire format and
    -     * treat group fields as unknown fields.
    -     */
    -    TYPE_GROUP = 10,
    -    /** TYPE_MESSAGE - Length-delimited aggregate. */
    -    TYPE_MESSAGE = 11,
    -    /** TYPE_BYTES - New in version 2. */
    -    TYPE_BYTES = 12,
    -    TYPE_UINT32 = 13,
    -    TYPE_ENUM = 14,
    -    TYPE_SFIXED32 = 15,
    -    TYPE_SFIXED64 = 16,
    -    /** TYPE_SINT32 - Uses ZigZag encoding. */
    -    TYPE_SINT32 = 17,
    -    /** TYPE_SINT64 - Uses ZigZag encoding. */
    -    TYPE_SINT64 = 18
    -}
    -export declare function fieldDescriptorProto_TypeFromJSON(object: any): FieldDescriptorProto_Type;
    -export declare function fieldDescriptorProto_TypeToJSON(object: FieldDescriptorProto_Type): string;
    -export declare enum FieldDescriptorProto_Label {
    -    /** LABEL_OPTIONAL - 0 is reserved for errors */
    -    LABEL_OPTIONAL = 1,
    -    LABEL_REQUIRED = 2,
    -    LABEL_REPEATED = 3
    -}
    -export declare function fieldDescriptorProto_LabelFromJSON(object: any): FieldDescriptorProto_Label;
    -export declare function fieldDescriptorProto_LabelToJSON(object: FieldDescriptorProto_Label): string;
    -/** Describes a oneof. */
    -export interface OneofDescriptorProto {
    -    name: string;
    -    options: OneofOptions | undefined;
    -}
    -/** Describes an enum type. */
    -export interface EnumDescriptorProto {
    -    name: string;
    -    value: EnumValueDescriptorProto[];
    -    options: EnumOptions | undefined;
    -    /**
    -     * Range of reserved numeric values. Reserved numeric values may not be used
    -     * by enum values in the same enum declaration. Reserved ranges may not
    -     * overlap.
    -     */
    -    reservedRange: EnumDescriptorProto_EnumReservedRange[];
    -    /**
    -     * Reserved enum value names, which may not be reused. A given name may only
    -     * be reserved once.
    -     */
    -    reservedName: string[];
    -}
    -/**
    - * Range of reserved numeric values. Reserved values may not be used by
    - * entries in the same enum. Reserved ranges may not overlap.
    - *
    - * Note that this is distinct from DescriptorProto.ReservedRange in that it
    - * is inclusive such that it can appropriately represent the entire int32
    - * domain.
    - */
    -export interface EnumDescriptorProto_EnumReservedRange {
    -    /** Inclusive. */
    -    start: number;
    -    /** Inclusive. */
    -    end: number;
    -}
    -/** Describes a value within an enum. */
    -export interface EnumValueDescriptorProto {
    -    name: string;
    -    number: number;
    -    options: EnumValueOptions | undefined;
    -}
    -/** Describes a service. */
    -export interface ServiceDescriptorProto {
    -    name: string;
    -    method: MethodDescriptorProto[];
    -    options: ServiceOptions | undefined;
    -}
    -/** Describes a method of a service. */
    -export interface MethodDescriptorProto {
    -    name: string;
    -    /**
    -     * Input and output type names.  These are resolved in the same way as
    -     * FieldDescriptorProto.type_name, but must refer to a message type.
    -     */
    -    inputType: string;
    -    outputType: string;
    -    options: MethodOptions | undefined;
    -    /** Identifies if client streams multiple client messages */
    -    clientStreaming: boolean;
    -    /** Identifies if server streams multiple server messages */
    -    serverStreaming: boolean;
    -}
    -export interface FileOptions {
    -    /**
    -     * Sets the Java package where classes generated from this .proto will be
    -     * placed.  By default, the proto package is used, but this is often
    -     * inappropriate because proto packages do not normally start with backwards
    -     * domain names.
    -     */
    -    javaPackage: string;
    -    /**
    -     * Controls the name of the wrapper Java class generated for the .proto file.
    -     * That class will always contain the .proto file's getDescriptor() method as
    -     * well as any top-level extensions defined in the .proto file.
    -     * If java_multiple_files is disabled, then all the other classes from the
    -     * .proto file will be nested inside the single wrapper outer class.
    -     */
    -    javaOuterClassname: string;
    -    /**
    -     * If enabled, then the Java code generator will generate a separate .java
    -     * file for each top-level message, enum, and service defined in the .proto
    -     * file.  Thus, these types will *not* be nested inside the wrapper class
    -     * named by java_outer_classname.  However, the wrapper class will still be
    -     * generated to contain the file's getDescriptor() method as well as any
    -     * top-level extensions defined in the file.
    -     */
    -    javaMultipleFiles: boolean;
    -    /**
    -     * This option does nothing.
    -     *
    -     * @deprecated
    -     */
    -    javaGenerateEqualsAndHash: boolean;
    -    /**
    -     * If set true, then the Java2 code generator will generate code that
    -     * throws an exception whenever an attempt is made to assign a non-UTF-8
    -     * byte sequence to a string field.
    -     * Message reflection will do the same.
    -     * However, an extension field still accepts non-UTF-8 byte sequences.
    -     * This option has no effect on when used with the lite runtime.
    -     */
    -    javaStringCheckUtf8: boolean;
    -    optimizeFor: FileOptions_OptimizeMode;
    -    /**
    -     * Sets the Go package where structs generated from this .proto will be
    -     * placed. If omitted, the Go package will be derived from the following:
    -     *   - The basename of the package import path, if provided.
    -     *   - Otherwise, the package statement in the .proto file, if present.
    -     *   - Otherwise, the basename of the .proto file, without extension.
    -     */
    -    goPackage: string;
    -    /**
    -     * Should generic services be generated in each language?  "Generic" services
    -     * are not specific to any particular RPC system.  They are generated by the
    -     * main code generators in each language (without additional plugins).
    -     * Generic services were the only kind of service generation supported by
    -     * early versions of google.protobuf.
    -     *
    -     * Generic services are now considered deprecated in favor of using plugins
    -     * that generate code specific to your particular RPC system.  Therefore,
    -     * these default to false.  Old code which depends on generic services should
    -     * explicitly set them to true.
    -     */
    -    ccGenericServices: boolean;
    -    javaGenericServices: boolean;
    -    pyGenericServices: boolean;
    -    phpGenericServices: boolean;
    -    /**
    -     * Is this file deprecated?
    -     * Depending on the target platform, this can emit Deprecated annotations
    -     * for everything in the file, or it will be completely ignored; in the very
    -     * least, this is a formalization for deprecating files.
    -     */
    -    deprecated: boolean;
    -    /**
    -     * Enables the use of arenas for the proto messages in this file. This applies
    -     * only to generated classes for C++.
    -     */
    -    ccEnableArenas: boolean;
    -    /**
    -     * Sets the objective c class prefix which is prepended to all objective c
    -     * generated classes from this .proto. There is no default.
    -     */
    -    objcClassPrefix: string;
    -    /** Namespace for generated classes; defaults to the package. */
    -    csharpNamespace: string;
    -    /**
    -     * By default Swift generators will take the proto package and CamelCase it
    -     * replacing '.' with underscore and use that to prefix the types/symbols
    -     * defined. When this options is provided, they will use this value instead
    -     * to prefix the types/symbols defined.
    -     */
    -    swiftPrefix: string;
    -    /**
    -     * Sets the php class prefix which is prepended to all php generated classes
    -     * from this .proto. Default is empty.
    -     */
    -    phpClassPrefix: string;
    -    /**
    -     * Use this option to change the namespace of php generated classes. Default
    -     * is empty. When this option is empty, the package name will be used for
    -     * determining the namespace.
    -     */
    -    phpNamespace: string;
    -    /**
    -     * Use this option to change the namespace of php generated metadata classes.
    -     * Default is empty. When this option is empty, the proto file name will be
    -     * used for determining the namespace.
    -     */
    -    phpMetadataNamespace: string;
    -    /**
    -     * Use this option to change the package of ruby generated classes. Default
    -     * is empty. When this option is not set, the package name will be used for
    -     * determining the ruby package.
    -     */
    -    rubyPackage: string;
    -    /**
    -     * The parser stores options it doesn't recognize here.
    -     * See the documentation for the "Options" section above.
    -     */
    -    uninterpretedOption: UninterpretedOption[];
    -}
    -/** Generated classes can be optimized for speed or code size. */
    -export declare enum FileOptions_OptimizeMode {
    -    /** SPEED - Generate complete code for parsing, serialization, */
    -    SPEED = 1,
    -    /** CODE_SIZE - etc. */
    -    CODE_SIZE = 2,
    -    /** LITE_RUNTIME - Generate code using MessageLite and the lite runtime. */
    -    LITE_RUNTIME = 3
    -}
    -export declare function fileOptions_OptimizeModeFromJSON(object: any): FileOptions_OptimizeMode;
    -export declare function fileOptions_OptimizeModeToJSON(object: FileOptions_OptimizeMode): string;
    -export interface MessageOptions {
    -    /**
    -     * Set true to use the old proto1 MessageSet wire format for extensions.
    -     * This is provided for backwards-compatibility with the MessageSet wire
    -     * format.  You should not use this for any other reason:  It's less
    -     * efficient, has fewer features, and is more complicated.
    -     *
    -     * The message must be defined exactly as follows:
    -     *   message Foo {
    -     *     option message_set_wire_format = true;
    -     *     extensions 4 to max;
    -     *   }
    -     * Note that the message cannot have any defined fields; MessageSets only
    -     * have extensions.
    -     *
    -     * All extensions of your type must be singular messages; e.g. they cannot
    -     * be int32s, enums, or repeated messages.
    -     *
    -     * Because this is an option, the above two restrictions are not enforced by
    -     * the protocol compiler.
    -     */
    -    messageSetWireFormat: boolean;
    -    /**
    -     * Disables the generation of the standard "descriptor()" accessor, which can
    -     * conflict with a field of the same name.  This is meant to make migration
    -     * from proto1 easier; new code should avoid fields named "descriptor".
    -     */
    -    noStandardDescriptorAccessor: boolean;
    -    /**
    -     * Is this message deprecated?
    -     * Depending on the target platform, this can emit Deprecated annotations
    -     * for the message, or it will be completely ignored; in the very least,
    -     * this is a formalization for deprecating messages.
    -     */
    -    deprecated: boolean;
    -    /**
    -     * Whether the message is an automatically generated map entry type for the
    -     * maps field.
    -     *
    -     * For maps fields:
    -     *     map map_field = 1;
    -     * The parsed descriptor looks like:
    -     *     message MapFieldEntry {
    -     *         option map_entry = true;
    -     *         optional KeyType key = 1;
    -     *         optional ValueType value = 2;
    -     *     }
    -     *     repeated MapFieldEntry map_field = 1;
    -     *
    -     * Implementations may choose not to generate the map_entry=true message, but
    -     * use a native map in the target language to hold the keys and values.
    -     * The reflection APIs in such implementations still need to work as
    -     * if the field is a repeated message field.
    -     *
    -     * NOTE: Do not set the option in .proto files. Always use the maps syntax
    -     * instead. The option should only be implicitly set by the proto compiler
    -     * parser.
    -     */
    -    mapEntry: boolean;
    -    /** The parser stores options it doesn't recognize here. See above. */
    -    uninterpretedOption: UninterpretedOption[];
    -}
    -export interface FieldOptions {
    -    /**
    -     * The ctype option instructs the C++ code generator to use a different
    -     * representation of the field than it normally would.  See the specific
    -     * options below.  This option is not yet implemented in the open source
    -     * release -- sorry, we'll try to include it in a future version!
    -     */
    -    ctype: FieldOptions_CType;
    -    /**
    -     * The packed option can be enabled for repeated primitive fields to enable
    -     * a more efficient representation on the wire. Rather than repeatedly
    -     * writing the tag and type for each element, the entire array is encoded as
    -     * a single length-delimited blob. In proto3, only explicit setting it to
    -     * false will avoid using packed encoding.
    -     */
    -    packed: boolean;
    -    /**
    -     * The jstype option determines the JavaScript type used for values of the
    -     * field.  The option is permitted only for 64 bit integral and fixed types
    -     * (int64, uint64, sint64, fixed64, sfixed64).  A field with jstype JS_STRING
    -     * is represented as JavaScript string, which avoids loss of precision that
    -     * can happen when a large value is converted to a floating point JavaScript.
    -     * Specifying JS_NUMBER for the jstype causes the generated JavaScript code to
    -     * use the JavaScript "number" type.  The behavior of the default option
    -     * JS_NORMAL is implementation dependent.
    -     *
    -     * This option is an enum to permit additional types to be added, e.g.
    -     * goog.math.Integer.
    -     */
    -    jstype: FieldOptions_JSType;
    -    /**
    -     * Should this field be parsed lazily?  Lazy applies only to message-type
    -     * fields.  It means that when the outer message is initially parsed, the
    -     * inner message's contents will not be parsed but instead stored in encoded
    -     * form.  The inner message will actually be parsed when it is first accessed.
    -     *
    -     * This is only a hint.  Implementations are free to choose whether to use
    -     * eager or lazy parsing regardless of the value of this option.  However,
    -     * setting this option true suggests that the protocol author believes that
    -     * using lazy parsing on this field is worth the additional bookkeeping
    -     * overhead typically needed to implement it.
    -     *
    -     * This option does not affect the public interface of any generated code;
    -     * all method signatures remain the same.  Furthermore, thread-safety of the
    -     * interface is not affected by this option; const methods remain safe to
    -     * call from multiple threads concurrently, while non-const methods continue
    -     * to require exclusive access.
    -     *
    -     * Note that implementations may choose not to check required fields within
    -     * a lazy sub-message.  That is, calling IsInitialized() on the outer message
    -     * may return true even if the inner message has missing required fields.
    -     * This is necessary because otherwise the inner message would have to be
    -     * parsed in order to perform the check, defeating the purpose of lazy
    -     * parsing.  An implementation which chooses not to check required fields
    -     * must be consistent about it.  That is, for any particular sub-message, the
    -     * implementation must either *always* check its required fields, or *never*
    -     * check its required fields, regardless of whether or not the message has
    -     * been parsed.
    -     *
    -     * As of 2021, lazy does no correctness checks on the byte stream during
    -     * parsing.  This may lead to crashes if and when an invalid byte stream is
    -     * finally parsed upon access.
    -     *
    -     * TODO(b/211906113):  Enable validation on lazy fields.
    -     */
    -    lazy: boolean;
    -    /**
    -     * unverified_lazy does no correctness checks on the byte stream. This should
    -     * only be used where lazy with verification is prohibitive for performance
    -     * reasons.
    -     */
    -    unverifiedLazy: boolean;
    -    /**
    -     * Is this field deprecated?
    -     * Depending on the target platform, this can emit Deprecated annotations
    -     * for accessors, or it will be completely ignored; in the very least, this
    -     * is a formalization for deprecating fields.
    -     */
    -    deprecated: boolean;
    -    /** For Google-internal migration only. Do not use. */
    -    weak: boolean;
    -    /** The parser stores options it doesn't recognize here. See above. */
    -    uninterpretedOption: UninterpretedOption[];
    -}
    -export declare enum FieldOptions_CType {
    -    /** STRING - Default mode. */
    -    STRING = 0,
    -    CORD = 1,
    -    STRING_PIECE = 2
    -}
    -export declare function fieldOptions_CTypeFromJSON(object: any): FieldOptions_CType;
    -export declare function fieldOptions_CTypeToJSON(object: FieldOptions_CType): string;
    -export declare enum FieldOptions_JSType {
    -    /** JS_NORMAL - Use the default type. */
    -    JS_NORMAL = 0,
    -    /** JS_STRING - Use JavaScript strings. */
    -    JS_STRING = 1,
    -    /** JS_NUMBER - Use JavaScript numbers. */
    -    JS_NUMBER = 2
    -}
    -export declare function fieldOptions_JSTypeFromJSON(object: any): FieldOptions_JSType;
    -export declare function fieldOptions_JSTypeToJSON(object: FieldOptions_JSType): string;
    -export interface OneofOptions {
    -    /** The parser stores options it doesn't recognize here. See above. */
    -    uninterpretedOption: UninterpretedOption[];
    -}
    -export interface EnumOptions {
    -    /**
    -     * Set this option to true to allow mapping different tag names to the same
    -     * value.
    -     */
    -    allowAlias: boolean;
    -    /**
    -     * Is this enum deprecated?
    -     * Depending on the target platform, this can emit Deprecated annotations
    -     * for the enum, or it will be completely ignored; in the very least, this
    -     * is a formalization for deprecating enums.
    -     */
    -    deprecated: boolean;
    -    /** The parser stores options it doesn't recognize here. See above. */
    -    uninterpretedOption: UninterpretedOption[];
    -}
    -export interface EnumValueOptions {
    -    /**
    -     * Is this enum value deprecated?
    -     * Depending on the target platform, this can emit Deprecated annotations
    -     * for the enum value, or it will be completely ignored; in the very least,
    -     * this is a formalization for deprecating enum values.
    -     */
    -    deprecated: boolean;
    -    /** The parser stores options it doesn't recognize here. See above. */
    -    uninterpretedOption: UninterpretedOption[];
    -}
    -export interface ServiceOptions {
    -    /**
    -     * Is this service deprecated?
    -     * Depending on the target platform, this can emit Deprecated annotations
    -     * for the service, or it will be completely ignored; in the very least,
    -     * this is a formalization for deprecating services.
    -     */
    -    deprecated: boolean;
    -    /** The parser stores options it doesn't recognize here. See above. */
    -    uninterpretedOption: UninterpretedOption[];
    -}
    -export interface MethodOptions {
    -    /**
    -     * Is this method deprecated?
    -     * Depending on the target platform, this can emit Deprecated annotations
    -     * for the method, or it will be completely ignored; in the very least,
    -     * this is a formalization for deprecating methods.
    -     */
    -    deprecated: boolean;
    -    idempotencyLevel: MethodOptions_IdempotencyLevel;
    -    /** The parser stores options it doesn't recognize here. See above. */
    -    uninterpretedOption: UninterpretedOption[];
    -}
    -/**
    - * Is this method side-effect-free (or safe in HTTP parlance), or idempotent,
    - * or neither? HTTP based RPC implementation may choose GET verb for safe
    - * methods, and PUT verb for idempotent methods instead of the default POST.
    - */
    -export declare enum MethodOptions_IdempotencyLevel {
    -    IDEMPOTENCY_UNKNOWN = 0,
    -    /** NO_SIDE_EFFECTS - implies idempotent */
    -    NO_SIDE_EFFECTS = 1,
    -    /** IDEMPOTENT - idempotent, but may have side effects */
    -    IDEMPOTENT = 2
    -}
    -export declare function methodOptions_IdempotencyLevelFromJSON(object: any): MethodOptions_IdempotencyLevel;
    -export declare function methodOptions_IdempotencyLevelToJSON(object: MethodOptions_IdempotencyLevel): string;
    -/**
    - * A message representing a option the parser does not recognize. This only
    - * appears in options protos created by the compiler::Parser class.
    - * DescriptorPool resolves these when building Descriptor objects. Therefore,
    - * options protos in descriptor objects (e.g. returned by Descriptor::options(),
    - * or produced by Descriptor::CopyTo()) will never have UninterpretedOptions
    - * in them.
    - */
    -export interface UninterpretedOption {
    -    name: UninterpretedOption_NamePart[];
    -    /**
    -     * The value of the uninterpreted option, in whatever type the tokenizer
    -     * identified it as during parsing. Exactly one of these should be set.
    -     */
    -    identifierValue: string;
    -    positiveIntValue: string;
    -    negativeIntValue: string;
    -    doubleValue: number;
    -    stringValue: Buffer;
    -    aggregateValue: string;
    -}
    -/**
    - * The name of the uninterpreted option.  Each string represents a segment in
    - * a dot-separated name.  is_extension is true iff a segment represents an
    - * extension (denoted with parentheses in options specs in .proto files).
    - * E.g.,{ ["foo", false], ["bar.baz", true], ["moo", false] } represents
    - * "foo.(bar.baz).moo".
    - */
    -export interface UninterpretedOption_NamePart {
    -    namePart: string;
    -    isExtension: boolean;
    -}
    -/**
    - * Encapsulates information about the original source file from which a
    - * FileDescriptorProto was generated.
    - */
    -export interface SourceCodeInfo {
    -    /**
    -     * A Location identifies a piece of source code in a .proto file which
    -     * corresponds to a particular definition.  This information is intended
    -     * to be useful to IDEs, code indexers, documentation generators, and similar
    -     * tools.
    -     *
    -     * For example, say we have a file like:
    -     *   message Foo {
    -     *     optional string foo = 1;
    -     *   }
    -     * Let's look at just the field definition:
    -     *   optional string foo = 1;
    -     *   ^       ^^     ^^  ^  ^^^
    -     *   a       bc     de  f  ghi
    -     * We have the following locations:
    -     *   span   path               represents
    -     *   [a,i)  [ 4, 0, 2, 0 ]     The whole field definition.
    -     *   [a,b)  [ 4, 0, 2, 0, 4 ]  The label (optional).
    -     *   [c,d)  [ 4, 0, 2, 0, 5 ]  The type (string).
    -     *   [e,f)  [ 4, 0, 2, 0, 1 ]  The name (foo).
    -     *   [g,h)  [ 4, 0, 2, 0, 3 ]  The number (1).
    -     *
    -     * Notes:
    -     * - A location may refer to a repeated field itself (i.e. not to any
    -     *   particular index within it).  This is used whenever a set of elements are
    -     *   logically enclosed in a single code segment.  For example, an entire
    -     *   extend block (possibly containing multiple extension definitions) will
    -     *   have an outer location whose path refers to the "extensions" repeated
    -     *   field without an index.
    -     * - Multiple locations may have the same path.  This happens when a single
    -     *   logical declaration is spread out across multiple places.  The most
    -     *   obvious example is the "extend" block again -- there may be multiple
    -     *   extend blocks in the same scope, each of which will have the same path.
    -     * - A location's span is not always a subset of its parent's span.  For
    -     *   example, the "extendee" of an extension declaration appears at the
    -     *   beginning of the "extend" block and is shared by all extensions within
    -     *   the block.
    -     * - Just because a location's span is a subset of some other location's span
    -     *   does not mean that it is a descendant.  For example, a "group" defines
    -     *   both a type and a field in a single declaration.  Thus, the locations
    -     *   corresponding to the type and field and their components will overlap.
    -     * - Code which tries to interpret locations should probably be designed to
    -     *   ignore those that it doesn't understand, as more types of locations could
    -     *   be recorded in the future.
    -     */
    -    location: SourceCodeInfo_Location[];
    -}
    -export interface SourceCodeInfo_Location {
    -    /**
    -     * Identifies which part of the FileDescriptorProto was defined at this
    -     * location.
    -     *
    -     * Each element is a field number or an index.  They form a path from
    -     * the root FileDescriptorProto to the place where the definition occurs.
    -     * For example, this path:
    -     *   [ 4, 3, 2, 7, 1 ]
    -     * refers to:
    -     *   file.message_type(3)  // 4, 3
    -     *       .field(7)         // 2, 7
    -     *       .name()           // 1
    -     * This is because FileDescriptorProto.message_type has field number 4:
    -     *   repeated DescriptorProto message_type = 4;
    -     * and DescriptorProto.field has field number 2:
    -     *   repeated FieldDescriptorProto field = 2;
    -     * and FieldDescriptorProto.name has field number 1:
    -     *   optional string name = 1;
    -     *
    -     * Thus, the above path gives the location of a field name.  If we removed
    -     * the last element:
    -     *   [ 4, 3, 2, 7 ]
    -     * this path refers to the whole field declaration (from the beginning
    -     * of the label to the terminating semicolon).
    -     */
    -    path: number[];
    -    /**
    -     * Always has exactly three or four elements: start line, start column,
    -     * end line (optional, otherwise assumed same as start line), end column.
    -     * These are packed into a single field for efficiency.  Note that line
    -     * and column numbers are zero-based -- typically you will want to add
    -     * 1 to each before displaying to a user.
    -     */
    -    span: number[];
    -    /**
    -     * If this SourceCodeInfo represents a complete declaration, these are any
    -     * comments appearing before and after the declaration which appear to be
    -     * attached to the declaration.
    -     *
    -     * A series of line comments appearing on consecutive lines, with no other
    -     * tokens appearing on those lines, will be treated as a single comment.
    -     *
    -     * leading_detached_comments will keep paragraphs of comments that appear
    -     * before (but not connected to) the current element. Each paragraph,
    -     * separated by empty lines, will be one comment element in the repeated
    -     * field.
    -     *
    -     * Only the comment content is provided; comment markers (e.g. //) are
    -     * stripped out.  For block comments, leading whitespace and an asterisk
    -     * will be stripped from the beginning of each line other than the first.
    -     * Newlines are included in the output.
    -     *
    -     * Examples:
    -     *
    -     *   optional int32 foo = 1;  // Comment attached to foo.
    -     *   // Comment attached to bar.
    -     *   optional int32 bar = 2;
    -     *
    -     *   optional string baz = 3;
    -     *   // Comment attached to baz.
    -     *   // Another line attached to baz.
    -     *
    -     *   // Comment attached to moo.
    -     *   //
    -     *   // Another line attached to moo.
    -     *   optional double moo = 4;
    -     *
    -     *   // Detached comment for corge. This is not leading or trailing comments
    -     *   // to moo or corge because there are blank lines separating it from
    -     *   // both.
    -     *
    -     *   // Detached comment for corge paragraph 2.
    -     *
    -     *   optional string corge = 5;
    -     *   /* Block comment attached
    -     *    * to corge.  Leading asterisks
    -     *    * will be removed. * /
    -     *   /* Block comment attached to
    -     *    * grault. * /
    -     *   optional int32 grault = 6;
    -     *
    -     *   // ignored detached comments.
    -     */
    -    leadingComments: string;
    -    trailingComments: string;
    -    leadingDetachedComments: string[];
    -}
    -/**
    - * Describes the relationship between generated code and its original source
    - * file. A GeneratedCodeInfo message is associated with only one generated
    - * source file, but may contain references to different source .proto files.
    - */
    -export interface GeneratedCodeInfo {
    -    /**
    -     * An Annotation connects some span of text in generated code to an element
    -     * of its generating .proto file.
    -     */
    -    annotation: GeneratedCodeInfo_Annotation[];
    -}
    -export interface GeneratedCodeInfo_Annotation {
    -    /**
    -     * Identifies the element in the original source .proto file. This field
    -     * is formatted the same as SourceCodeInfo.Location.path.
    -     */
    -    path: number[];
    -    /** Identifies the filesystem path to the original source .proto. */
    -    sourceFile: string;
    -    /**
    -     * Identifies the starting offset in bytes in the generated code
    -     * that relates to the identified object.
    -     */
    -    begin: number;
    -    /**
    -     * Identifies the ending offset in bytes in the generated code that
    -     * relates to the identified offset. The end offset should be one past
    -     * the last relevant byte (so the length of the text = end - begin).
    -     */
    -    end: number;
    -}
    -export declare const FileDescriptorSet: {
    -    fromJSON(object: any): FileDescriptorSet;
    -    toJSON(message: FileDescriptorSet): unknown;
    -};
    -export declare const FileDescriptorProto: {
    -    fromJSON(object: any): FileDescriptorProto;
    -    toJSON(message: FileDescriptorProto): unknown;
    -};
    -export declare const DescriptorProto: {
    -    fromJSON(object: any): DescriptorProto;
    -    toJSON(message: DescriptorProto): unknown;
    -};
    -export declare const DescriptorProto_ExtensionRange: {
    -    fromJSON(object: any): DescriptorProto_ExtensionRange;
    -    toJSON(message: DescriptorProto_ExtensionRange): unknown;
    -};
    -export declare const DescriptorProto_ReservedRange: {
    -    fromJSON(object: any): DescriptorProto_ReservedRange;
    -    toJSON(message: DescriptorProto_ReservedRange): unknown;
    -};
    -export declare const ExtensionRangeOptions: {
    -    fromJSON(object: any): ExtensionRangeOptions;
    -    toJSON(message: ExtensionRangeOptions): unknown;
    -};
    -export declare const FieldDescriptorProto: {
    -    fromJSON(object: any): FieldDescriptorProto;
    -    toJSON(message: FieldDescriptorProto): unknown;
    -};
    -export declare const OneofDescriptorProto: {
    -    fromJSON(object: any): OneofDescriptorProto;
    -    toJSON(message: OneofDescriptorProto): unknown;
    -};
    -export declare const EnumDescriptorProto: {
    -    fromJSON(object: any): EnumDescriptorProto;
    -    toJSON(message: EnumDescriptorProto): unknown;
    -};
    -export declare const EnumDescriptorProto_EnumReservedRange: {
    -    fromJSON(object: any): EnumDescriptorProto_EnumReservedRange;
    -    toJSON(message: EnumDescriptorProto_EnumReservedRange): unknown;
    -};
    -export declare const EnumValueDescriptorProto: {
    -    fromJSON(object: any): EnumValueDescriptorProto;
    -    toJSON(message: EnumValueDescriptorProto): unknown;
    -};
    -export declare const ServiceDescriptorProto: {
    -    fromJSON(object: any): ServiceDescriptorProto;
    -    toJSON(message: ServiceDescriptorProto): unknown;
    -};
    -export declare const MethodDescriptorProto: {
    -    fromJSON(object: any): MethodDescriptorProto;
    -    toJSON(message: MethodDescriptorProto): unknown;
    -};
    -export declare const FileOptions: {
    -    fromJSON(object: any): FileOptions;
    -    toJSON(message: FileOptions): unknown;
    -};
    -export declare const MessageOptions: {
    -    fromJSON(object: any): MessageOptions;
    -    toJSON(message: MessageOptions): unknown;
    -};
    -export declare const FieldOptions: {
    -    fromJSON(object: any): FieldOptions;
    -    toJSON(message: FieldOptions): unknown;
    -};
    -export declare const OneofOptions: {
    -    fromJSON(object: any): OneofOptions;
    -    toJSON(message: OneofOptions): unknown;
    -};
    -export declare const EnumOptions: {
    -    fromJSON(object: any): EnumOptions;
    -    toJSON(message: EnumOptions): unknown;
    -};
    -export declare const EnumValueOptions: {
    -    fromJSON(object: any): EnumValueOptions;
    -    toJSON(message: EnumValueOptions): unknown;
    -};
    -export declare const ServiceOptions: {
    -    fromJSON(object: any): ServiceOptions;
    -    toJSON(message: ServiceOptions): unknown;
    -};
    -export declare const MethodOptions: {
    -    fromJSON(object: any): MethodOptions;
    -    toJSON(message: MethodOptions): unknown;
    -};
    -export declare const UninterpretedOption: {
    -    fromJSON(object: any): UninterpretedOption;
    -    toJSON(message: UninterpretedOption): unknown;
    -};
    -export declare const UninterpretedOption_NamePart: {
    -    fromJSON(object: any): UninterpretedOption_NamePart;
    -    toJSON(message: UninterpretedOption_NamePart): unknown;
    -};
    -export declare const SourceCodeInfo: {
    -    fromJSON(object: any): SourceCodeInfo;
    -    toJSON(message: SourceCodeInfo): unknown;
    -};
    -export declare const SourceCodeInfo_Location: {
    -    fromJSON(object: any): SourceCodeInfo_Location;
    -    toJSON(message: SourceCodeInfo_Location): unknown;
    -};
    -export declare const GeneratedCodeInfo: {
    -    fromJSON(object: any): GeneratedCodeInfo;
    -    toJSON(message: GeneratedCodeInfo): unknown;
    -};
    -export declare const GeneratedCodeInfo_Annotation: {
    -    fromJSON(object: any): GeneratedCodeInfo_Annotation;
    -    toJSON(message: GeneratedCodeInfo_Annotation): unknown;
    -};
    diff --git a/deps/npm/node_modules/sigstore/dist/types/sigstore/__generated__/google/protobuf/timestamp.d.ts b/deps/npm/node_modules/sigstore/dist/types/sigstore/__generated__/google/protobuf/timestamp.d.ts
    deleted file mode 100644
    index 1ab812b4a9407f..00000000000000
    --- a/deps/npm/node_modules/sigstore/dist/types/sigstore/__generated__/google/protobuf/timestamp.d.ts
    +++ /dev/null
    @@ -1,110 +0,0 @@
    -/**
    - * A Timestamp represents a point in time independent of any time zone or local
    - * calendar, encoded as a count of seconds and fractions of seconds at
    - * nanosecond resolution. The count is relative to an epoch at UTC midnight on
    - * January 1, 1970, in the proleptic Gregorian calendar which extends the
    - * Gregorian calendar backwards to year one.
    - *
    - * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap
    - * second table is needed for interpretation, using a [24-hour linear
    - * smear](https://developers.google.com/time/smear).
    - *
    - * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
    - * restricting to that range, we ensure that we can convert to and from [RFC
    - * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.
    - *
    - * # Examples
    - *
    - * Example 1: Compute Timestamp from POSIX `time()`.
    - *
    - *     Timestamp timestamp;
    - *     timestamp.set_seconds(time(NULL));
    - *     timestamp.set_nanos(0);
    - *
    - * Example 2: Compute Timestamp from POSIX `gettimeofday()`.
    - *
    - *     struct timeval tv;
    - *     gettimeofday(&tv, NULL);
    - *
    - *     Timestamp timestamp;
    - *     timestamp.set_seconds(tv.tv_sec);
    - *     timestamp.set_nanos(tv.tv_usec * 1000);
    - *
    - * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
    - *
    - *     FILETIME ft;
    - *     GetSystemTimeAsFileTime(&ft);
    - *     UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
    - *
    - *     // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
    - *     // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
    - *     Timestamp timestamp;
    - *     timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
    - *     timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
    - *
    - * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
    - *
    - *     long millis = System.currentTimeMillis();
    - *
    - *     Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
    - *         .setNanos((int) ((millis % 1000) * 1000000)).build();
    - *
    - * Example 5: Compute Timestamp from Java `Instant.now()`.
    - *
    - *     Instant now = Instant.now();
    - *
    - *     Timestamp timestamp =
    - *         Timestamp.newBuilder().setSeconds(now.getEpochSecond())
    - *             .setNanos(now.getNano()).build();
    - *
    - * Example 6: Compute Timestamp from current time in Python.
    - *
    - *     timestamp = Timestamp()
    - *     timestamp.GetCurrentTime()
    - *
    - * # JSON Mapping
    - *
    - * In JSON format, the Timestamp type is encoded as a string in the
    - * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the
    - * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z"
    - * where {year} is always expressed using four digits while {month}, {day},
    - * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
    - * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
    - * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
    - * is required. A proto3 JSON serializer should always use UTC (as indicated by
    - * "Z") when printing the Timestamp type and a proto3 JSON parser should be
    - * able to accept both UTC and other timezones (as indicated by an offset).
    - *
    - * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
    - * 01:30 UTC on January 15, 2017.
    - *
    - * In JavaScript, one can convert a Date object to this format using the
    - * standard
    - * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
    - * method. In Python, a standard `datetime.datetime` object can be converted
    - * to this format using
    - * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
    - * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
    - * the Joda Time's [`ISODateTimeFormat.dateTime()`](
    - * http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D
    - * ) to obtain a formatter capable of generating timestamps in this format.
    - */
    -export interface Timestamp {
    -    /**
    -     * Represents seconds of UTC time since Unix epoch
    -     * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
    -     * 9999-12-31T23:59:59Z inclusive.
    -     */
    -    seconds: string;
    -    /**
    -     * Non-negative fractions of a second at nanosecond resolution. Negative
    -     * second values with fractions must still have non-negative nanos values
    -     * that count forward in time. Must be from 0 to 999,999,999
    -     * inclusive.
    -     */
    -    nanos: number;
    -}
    -export declare const Timestamp: {
    -    fromJSON(object: any): Timestamp;
    -    toJSON(message: Timestamp): unknown;
    -};
    diff --git a/deps/npm/node_modules/sigstore/dist/types/sigstore/__generated__/sigstore_bundle.d.ts b/deps/npm/node_modules/sigstore/dist/types/sigstore/__generated__/sigstore_bundle.d.ts
    deleted file mode 100644
    index 51f748f4591309..00000000000000
    --- a/deps/npm/node_modules/sigstore/dist/types/sigstore/__generated__/sigstore_bundle.d.ts
    +++ /dev/null
    @@ -1,72 +0,0 @@
    -import { Envelope } from "./envelope";
    -import { MessageSignature, PublicKeyIdentifier, RFC3161SignedTimestamp, X509CertificateChain } from "./sigstore_common";
    -import { TransparencyLogEntry } from "./sigstore_rekor";
    -/**
    - * Various timestamped counter signatures over the artifacts signature.
    - * Currently only RFC3161 signatures are provided. More formats may be added
    - * in the future.
    - */
    -export interface TimestampVerificationData {
    -    /**
    -     * A list of RFC3161 signed timestamps provided by the user.
    -     * This can be used when the entry has not been stored on a
    -     * transparency log, or in conjunction for a stronger trust model.
    -     * Clients MUST verify the hashed message in the message imprint
    -     * against the signature in the bundle.
    -     */
    -    rfc3161Timestamps: RFC3161SignedTimestamp[];
    -}
    -/**
    - * VerificationMaterial captures details on the materials used to verify
    - * signatures.
    - */
    -export interface VerificationMaterial {
    -    content?: {
    -        $case: "publicKey";
    -        publicKey: PublicKeyIdentifier;
    -    } | {
    -        $case: "x509CertificateChain";
    -        x509CertificateChain: X509CertificateChain;
    -    };
    -    /**
    -     * This is the inclusion promise and/or proof, where
    -     * the timestamp is coming from the transparency log.
    -     */
    -    tlogEntries: TransparencyLogEntry[];
    -    /** Timestamp verification data, over the artifact's signature. */
    -    timestampVerificationData: TimestampVerificationData | undefined;
    -}
    -export interface Bundle {
    -    /**
    -     * MUST be application/vnd.dev.sigstore.bundle+json;version=0.1
    -     * when encoded as JSON.
    -     */
    -    mediaType: string;
    -    /**
    -     * When a signer is identified by a X.509 certificate, a verifier MUST
    -     * verify that the signature was computed at the time the certificate
    -     * was valid as described in the Sigstore client spec: "Verification
    -     * using a Bundle".
    -     * 
    -     */
    -    verificationMaterial: VerificationMaterial | undefined;
    -    content?: {
    -        $case: "messageSignature";
    -        messageSignature: MessageSignature;
    -    } | {
    -        $case: "dsseEnvelope";
    -        dsseEnvelope: Envelope;
    -    };
    -}
    -export declare const TimestampVerificationData: {
    -    fromJSON(object: any): TimestampVerificationData;
    -    toJSON(message: TimestampVerificationData): unknown;
    -};
    -export declare const VerificationMaterial: {
    -    fromJSON(object: any): VerificationMaterial;
    -    toJSON(message: VerificationMaterial): unknown;
    -};
    -export declare const Bundle: {
    -    fromJSON(object: any): Bundle;
    -    toJSON(message: Bundle): unknown;
    -};
    diff --git a/deps/npm/node_modules/sigstore/dist/types/sigstore/__generated__/sigstore_common.d.ts b/deps/npm/node_modules/sigstore/dist/types/sigstore/__generated__/sigstore_common.d.ts
    deleted file mode 100644
    index 0d8c2d5ebde7d2..00000000000000
    --- a/deps/npm/node_modules/sigstore/dist/types/sigstore/__generated__/sigstore_common.d.ts
    +++ /dev/null
    @@ -1,228 +0,0 @@
    -/// 
    -/**
    - * Only a subset of the secure hash standard algorithms are supported.
    - * See  for more
    - * details.
    - * UNSPECIFIED SHOULD not be used, primary reason for inclusion is to force
    - * any proto JSON serialization to emit the used hash algorithm, as default
    - * option is to *omit* the default value of an enum (which is the first
    - * value, represented by '0'.
    - */
    -export declare enum HashAlgorithm {
    -    HASH_ALGORITHM_UNSPECIFIED = 0,
    -    SHA2_256 = 1
    -}
    -export declare function hashAlgorithmFromJSON(object: any): HashAlgorithm;
    -export declare function hashAlgorithmToJSON(object: HashAlgorithm): string;
    -/**
    - * Details of a specific public key, capturing the the key encoding method,
    - * and signature algorithm.
    - * To avoid the possibility of contradicting formats such as PKCS1 with
    - * ED25519 the valid permutations are listed as a linear set instead of a
    - * cartesian set (i.e one combined variable instead of two, one for encoding
    - * and one for the signature algorithm).
    - */
    -export declare enum PublicKeyDetails {
    -    PUBLIC_KEY_DETAILS_UNSPECIFIED = 0,
    -    /** PKCS1_RSA_PKCS1V5 - RSA */
    -    PKCS1_RSA_PKCS1V5 = 1,
    -    /** PKCS1_RSA_PSS - See RFC8017 */
    -    PKCS1_RSA_PSS = 2,
    -    PKIX_RSA_PKCS1V5 = 3,
    -    PKIX_RSA_PSS = 4,
    -    /** PKIX_ECDSA_P256_SHA_256 - ECDSA */
    -    PKIX_ECDSA_P256_SHA_256 = 5,
    -    /** PKIX_ECDSA_P256_HMAC_SHA_256 - See RFC6979 */
    -    PKIX_ECDSA_P256_HMAC_SHA_256 = 6,
    -    /** PKIX_ED25519 - Ed 25519 */
    -    PKIX_ED25519 = 7
    -}
    -export declare function publicKeyDetailsFromJSON(object: any): PublicKeyDetails;
    -export declare function publicKeyDetailsToJSON(object: PublicKeyDetails): string;
    -export declare enum SubjectAlternativeNameType {
    -    SUBJECT_ALTERNATIVE_NAME_TYPE_UNSPECIFIED = 0,
    -    EMAIL = 1,
    -    URI = 2,
    -    /**
    -     * OTHER_NAME - OID 1.3.6.1.4.1.57264.1.7
    -     * See https://github.com/sigstore/fulcio/blob/main/docs/oid-info.md#1361415726417--othername-san
    -     * for more details.
    -     */
    -    OTHER_NAME = 3
    -}
    -export declare function subjectAlternativeNameTypeFromJSON(object: any): SubjectAlternativeNameType;
    -export declare function subjectAlternativeNameTypeToJSON(object: SubjectAlternativeNameType): string;
    -/**
    - * HashOutput captures a digest of a 'message' (generic octet sequence)
    - * and the corresponding hash algorithm used.
    - */
    -export interface HashOutput {
    -    algorithm: HashAlgorithm;
    -    /**
    -     * This is the raw octets of the message digest as computed by
    -     * the hash algorithm.
    -     */
    -    digest: Buffer;
    -}
    -/** MessageSignature stores the computed signature over a message. */
    -export interface MessageSignature {
    -    /** Message digest can be used to identify the artifact. */
    -    messageDigest: HashOutput | undefined;
    -    /**
    -     * The raw bytes as returned from the signature algorithm.
    -     * The signature algorithm (and so the format of the signature bytes)
    -     * are determined by the contents of the 'verification_material',
    -     * either a key-pair or a certificate. If using a certificate, the
    -     * certificate contains the required information on the signature
    -     * algorithm.
    -     * When using a key pair, the algorithm MUST be part of the public
    -     * key, which MUST be communicated out-of-band.
    -     */
    -    signature: Buffer;
    -}
    -/** LogId captures the identity of a transparency log. */
    -export interface LogId {
    -    /**
    -     * The unique id of the log, represented as the SHA-256 hash
    -     * of the log's public key, computed over the DER encoding.
    -     * 
    -     */
    -    keyId: Buffer;
    -}
    -/** This message holds a RFC 3161 timestamp. */
    -export interface RFC3161SignedTimestamp {
    -    /**
    -     * Signed timestamp is the DER encoded TimeStampResponse.
    -     * See https://www.rfc-editor.org/rfc/rfc3161.html#section-2.4.2
    -     */
    -    signedTimestamp: Buffer;
    -}
    -export interface PublicKey {
    -    /**
    -     * DER-encoded public key, encoding method is specified by the
    -     * key_details attribute.
    -     */
    -    rawBytes?: Buffer | undefined;
    -    /** Key encoding and signature algorithm to use for this key. */
    -    keyDetails: PublicKeyDetails;
    -    /** Optional validity period for this key. */
    -    validFor?: TimeRange | undefined;
    -}
    -/**
    - * PublicKeyIdentifier can be used to identify an (out of band) delivered
    - * key, to verify a signature.
    - */
    -export interface PublicKeyIdentifier {
    -    /**
    -     * Optional unauthenticated hint on which key to use.
    -     * The format of the hint must be agreed upon out of band by the
    -     * signer and the verifiers, and so is not subject to this
    -     * specification.
    -     * Example use-case is to specify the public key to use, from a
    -     * trusted key-ring.
    -     * Implementors are RECOMMENDED to derive the value from the public
    -     * key as described in RFC 6962.
    -     * See: 
    -     */
    -    hint: string;
    -}
    -/** An ASN.1 OBJECT IDENTIFIER */
    -export interface ObjectIdentifier {
    -    id: number[];
    -}
    -/** An OID and the corresponding (byte) value. */
    -export interface ObjectIdentifierValuePair {
    -    oid: ObjectIdentifier | undefined;
    -    value: Buffer;
    -}
    -export interface DistinguishedName {
    -    organization: string;
    -    commonName: string;
    -}
    -export interface X509Certificate {
    -    /** DER-encoded X.509 certificate. */
    -    rawBytes: Buffer;
    -}
    -export interface SubjectAlternativeName {
    -    type: SubjectAlternativeNameType;
    -    identity?: {
    -        $case: "regexp";
    -        regexp: string;
    -    } | {
    -        $case: "value";
    -        value: string;
    -    };
    -}
    -/** A chain of X.509 certificates. */
    -export interface X509CertificateChain {
    -    /**
    -     * The chain of certificates, with indices 0 to n.
    -     * The first certificate in the array must be the leaf
    -     * certificate used for signing. Any intermediate certificates
    -     * must be stored as offset 1 to n-1, and the root certificate at
    -     * position n.
    -     */
    -    certificates: X509Certificate[];
    -}
    -/**
    - * The time range is half-open and does not include the end timestamp,
    - * i.e [start, end).
    - * End is optional to be able to capture a period that has started but
    - * has no known end.
    - */
    -export interface TimeRange {
    -    start: Date | undefined;
    -    end?: Date | undefined;
    -}
    -export declare const HashOutput: {
    -    fromJSON(object: any): HashOutput;
    -    toJSON(message: HashOutput): unknown;
    -};
    -export declare const MessageSignature: {
    -    fromJSON(object: any): MessageSignature;
    -    toJSON(message: MessageSignature): unknown;
    -};
    -export declare const LogId: {
    -    fromJSON(object: any): LogId;
    -    toJSON(message: LogId): unknown;
    -};
    -export declare const RFC3161SignedTimestamp: {
    -    fromJSON(object: any): RFC3161SignedTimestamp;
    -    toJSON(message: RFC3161SignedTimestamp): unknown;
    -};
    -export declare const PublicKey: {
    -    fromJSON(object: any): PublicKey;
    -    toJSON(message: PublicKey): unknown;
    -};
    -export declare const PublicKeyIdentifier: {
    -    fromJSON(object: any): PublicKeyIdentifier;
    -    toJSON(message: PublicKeyIdentifier): unknown;
    -};
    -export declare const ObjectIdentifier: {
    -    fromJSON(object: any): ObjectIdentifier;
    -    toJSON(message: ObjectIdentifier): unknown;
    -};
    -export declare const ObjectIdentifierValuePair: {
    -    fromJSON(object: any): ObjectIdentifierValuePair;
    -    toJSON(message: ObjectIdentifierValuePair): unknown;
    -};
    -export declare const DistinguishedName: {
    -    fromJSON(object: any): DistinguishedName;
    -    toJSON(message: DistinguishedName): unknown;
    -};
    -export declare const X509Certificate: {
    -    fromJSON(object: any): X509Certificate;
    -    toJSON(message: X509Certificate): unknown;
    -};
    -export declare const SubjectAlternativeName: {
    -    fromJSON(object: any): SubjectAlternativeName;
    -    toJSON(message: SubjectAlternativeName): unknown;
    -};
    -export declare const X509CertificateChain: {
    -    fromJSON(object: any): X509CertificateChain;
    -    toJSON(message: X509CertificateChain): unknown;
    -};
    -export declare const TimeRange: {
    -    fromJSON(object: any): TimeRange;
    -    toJSON(message: TimeRange): unknown;
    -};
    diff --git a/deps/npm/node_modules/sigstore/dist/types/sigstore/__generated__/sigstore_rekor.d.ts b/deps/npm/node_modules/sigstore/dist/types/sigstore/__generated__/sigstore_rekor.d.ts
    deleted file mode 100644
    index 9e33bb80e2a867..00000000000000
    --- a/deps/npm/node_modules/sigstore/dist/types/sigstore/__generated__/sigstore_rekor.d.ts
    +++ /dev/null
    @@ -1,129 +0,0 @@
    -/// 
    -import { LogId } from "./sigstore_common";
    -/** KindVersion contains the entry's kind and api version. */
    -export interface KindVersion {
    -    /**
    -     * Kind is the type of entry being stored in the log.
    -     * See here for a list: https://github.com/sigstore/rekor/tree/main/pkg/types
    -     */
    -    kind: string;
    -    /** The specific api version of the type. */
    -    version: string;
    -}
    -/**
    - * The checkpoint contains a signature of the tree head (root hash),
    - * size of the tree, the transparency log's unique identifier (log ID),
    - * hostname and the current time.
    - * The result is a string, the format is described here
    - * https://github.com/transparency-dev/formats/blob/main/log/README.md
    - * The details are here https://github.com/sigstore/rekor/blob/a6e58f72b6b18cc06cefe61808efd562b9726330/pkg/util/signed_note.go#L114
    - * The signature has the same format as
    - * InclusionPromise.signed_entry_timestamp. See below for more details.
    - */
    -export interface Checkpoint {
    -    envelope: string;
    -}
    -/**
    - * InclusionProof is the proof returned from the transparency log. Can
    - * be used for on line verification against the log.
    - */
    -export interface InclusionProof {
    -    /** The index of the entry in the log. */
    -    logIndex: string;
    -    /**
    -     * The hash digest stored at the root of the merkle tree at the time
    -     * the proof was generated.
    -     */
    -    rootHash: Buffer;
    -    /** The size of the merkle tree at the time the proof was generated. */
    -    treeSize: string;
    -    /**
    -     * A list of hashes required to compute the inclusion proof, sorted
    -     * in order from leaf to root.
    -     * Not that leaf and root hashes are not included.
    -     * The root has is available separately in this message, and the
    -     * leaf hash should be calculated by the client.
    -     */
    -    hashes: Buffer[];
    -    /**
    -     * Signature of the tree head, as of the time of this proof was
    -     * generated. See above info on 'Checkpoint' for more details.
    -     */
    -    checkpoint: Checkpoint | undefined;
    -}
    -/**
    - * The inclusion promise is calculated by Rekor. It's calculated as a
    - * signature over a canonical JSON serialization of the persisted entry, the
    - * log ID, log index and the integration timestamp.
    - * See https://github.com/sigstore/rekor/blob/a6e58f72b6b18cc06cefe61808efd562b9726330/pkg/api/entries.go#L54
    - * The format of the signature depends on the transparency log's public key.
    - * If the signature algorithm requires a hash function and/or a signature
    - * scheme (e.g. RSA) those has to be retrieved out-of-band from the log's
    - * operators, together with the public key.
    - * This is used to verify the integration timestamp's value and that the log
    - * has promised to include the entry.
    - */
    -export interface InclusionPromise {
    -    signedEntryTimestamp: Buffer;
    -}
    -/**
    - * TransparencyLogEntry captures all the details required from Rekor to
    - * reconstruct an entry, given that the payload is provided via other means.
    - * This type can easily be created from the existing response from Rekor.
    - * Future iterations could rely on Rekor returning the minimal set of
    - * attributes (excluding the payload) that are required for verifying the
    - * inclusion promise. The inclusion promise (called SignedEntryTimestamp in
    - * the response from Rekor) is similar to a Signed Certificate Timestamp
    - * as described here https://www.rfc-editor.org/rfc/rfc9162#name-signed-certificate-timestam.
    - */
    -export interface TransparencyLogEntry {
    -    /** The index of the entry in the log. */
    -    logIndex: string;
    -    /** The unique identifier of the log. */
    -    logId: LogId | undefined;
    -    /**
    -     * The kind (type) and version of the object associated with this
    -     * entry. These values are required to construct the entry during
    -     * verification.
    -     */
    -    kindVersion: KindVersion | undefined;
    -    /** The UNIX timestamp from the log when the entry was persisted. */
    -    integratedTime: string;
    -    /** The inclusion promise/signed entry timestamp from the log. */
    -    inclusionPromise: InclusionPromise | undefined;
    -    /**
    -     * The inclusion proof can be used for online verification that the
    -     * entry was appended to the log, and that the log has not been
    -     * altered.
    -     */
    -    inclusionProof: InclusionProof | undefined;
    -    /**
    -     * The canonicalized Rekor entry body, used for SET verification. This
    -     * is the same as the body returned by Rekor. It's included here for
    -     * cases where the client cannot deterministically reconstruct the
    -     * bundle from the other fields. Clients MUST verify that the signature
    -     * referenced in the canonicalized_body matches the signature provided
    -     * in the bundle content.
    -     */
    -    canonicalizedBody: Buffer;
    -}
    -export declare const KindVersion: {
    -    fromJSON(object: any): KindVersion;
    -    toJSON(message: KindVersion): unknown;
    -};
    -export declare const Checkpoint: {
    -    fromJSON(object: any): Checkpoint;
    -    toJSON(message: Checkpoint): unknown;
    -};
    -export declare const InclusionProof: {
    -    fromJSON(object: any): InclusionProof;
    -    toJSON(message: InclusionProof): unknown;
    -};
    -export declare const InclusionPromise: {
    -    fromJSON(object: any): InclusionPromise;
    -    toJSON(message: InclusionPromise): unknown;
    -};
    -export declare const TransparencyLogEntry: {
    -    fromJSON(object: any): TransparencyLogEntry;
    -    toJSON(message: TransparencyLogEntry): unknown;
    -};
    diff --git a/deps/npm/node_modules/sigstore/dist/types/sigstore/__generated__/sigstore_trustroot.d.ts b/deps/npm/node_modules/sigstore/dist/types/sigstore/__generated__/sigstore_trustroot.d.ts
    deleted file mode 100644
    index 152d08f5c67515..00000000000000
    --- a/deps/npm/node_modules/sigstore/dist/types/sigstore/__generated__/sigstore_trustroot.d.ts
    +++ /dev/null
    @@ -1,89 +0,0 @@
    -import { DistinguishedName, HashAlgorithm, LogId, PublicKey, TimeRange, X509CertificateChain } from "./sigstore_common";
    -/**
    - * TransparencyLogInstance describes the immutable parameters from a
    - * transparency log.
    - * See https://www.rfc-editor.org/rfc/rfc9162.html#name-log-parameters
    - * for more details.
    - * The incluced parameters are the minimal set required to identify a log,
    - * and verify an inclusion promise.
    - */
    -export interface TransparencyLogInstance {
    -    /** The base URL at which can be used to URLs for the client. */
    -    baseUrl: string;
    -    /** The hash algorithm used for the Merkle Tree. */
    -    hashAlgorithm: HashAlgorithm;
    -    /**
    -     * The public key used to verify signatures generated by the log.
    -     * This attribute contains the signature algorithm used by the log.
    -     */
    -    publicKey: PublicKey | undefined;
    -    /** The unique identifier for this transparency log. */
    -    logId: LogId | undefined;
    -}
    -/**
    - * CertificateAuthority enlists the information required to identify which
    - * CA to use and perform signature verification.
    - */
    -export interface CertificateAuthority {
    -    /**
    -     * The root certificate MUST be self-signed, and so the subject and
    -     * issuer are the same.
    -     */
    -    subject: DistinguishedName | undefined;
    -    /** The URI at which the CA can be accessed. */
    -    uri: string;
    -    /** The certificate chain for this CA. */
    -    certChain: X509CertificateChain | undefined;
    -    /**
    -     * The time the *entire* chain was valid. This is at max the
    -     * longest interval when *all* certificates in the chain were valid,
    -     * but it MAY be shorter.
    -     */
    -    validFor: TimeRange | undefined;
    -}
    -/**
    - * TrustedRoot describes the client's complete set of trusted entities.
    - * How the TrustedRoot is populated is not specified, but can be a
    - * combination of many sources such as TUF repositories, files on disk etc.
    - *
    - * The TrustedRoot is not meant to be used for any artifact verification, only
    - * to capture the complete/global set of trusted verification materials.
    - * When verifying an artifact, based on the artifact and policies, a selection
    - * of keys/authorities are expected to be extracted and provided to the
    - * verification function. This way the set of keys/authorities kan be kept to
    - * a minimal set by the policy to gain better control over what signatures
    - * that are allowed.
    - */
    -export interface TrustedRoot {
    -    /** MUST be application/vnd.dev.sigstore.trustedroot+json;version=0.1 */
    -    mediaType: string;
    -    /** A set of trusted Rekor servers. */
    -    tlogs: TransparencyLogInstance[];
    -    /**
    -     * A set of trusted certificate authorites (e.g Fulcio), and any
    -     * intermediate certificates they provide.
    -     * If a CA is issuing multiple intermediate certificate, each
    -     * combination shall be represented as separate chain. I.e, a single
    -     * root cert may appear in multiple chains but with different
    -     * intermediate and/or leaf certificates.
    -     * The certificates are intended to be used for verifying artifact
    -     * signatures.
    -     */
    -    certificateAuthorities: CertificateAuthority[];
    -    /** A set of trusted certificate transparency logs. */
    -    ctlogs: TransparencyLogInstance[];
    -    /** A set of trusted timestamping authorities. */
    -    timestampAuthorities: CertificateAuthority[];
    -}
    -export declare const TransparencyLogInstance: {
    -    fromJSON(object: any): TransparencyLogInstance;
    -    toJSON(message: TransparencyLogInstance): unknown;
    -};
    -export declare const CertificateAuthority: {
    -    fromJSON(object: any): CertificateAuthority;
    -    toJSON(message: CertificateAuthority): unknown;
    -};
    -export declare const TrustedRoot: {
    -    fromJSON(object: any): TrustedRoot;
    -    toJSON(message: TrustedRoot): unknown;
    -};
    diff --git a/deps/npm/node_modules/sigstore/dist/types/sigstore/__generated__/sigstore_verification.d.ts b/deps/npm/node_modules/sigstore/dist/types/sigstore/__generated__/sigstore_verification.d.ts
    deleted file mode 100644
    index 8ee32d8e666921..00000000000000
    --- a/deps/npm/node_modules/sigstore/dist/types/sigstore/__generated__/sigstore_verification.d.ts
    +++ /dev/null
    @@ -1,156 +0,0 @@
    -/// 
    -import { Bundle } from "./sigstore_bundle";
    -import { ObjectIdentifierValuePair, PublicKey, SubjectAlternativeName } from "./sigstore_common";
    -import { TrustedRoot } from "./sigstore_trustroot";
    -/** The identity of a X.509 Certificate signer. */
    -export interface CertificateIdentity {
    -    /** The X.509v3 issuer extension (OID 1.3.6.1.4.1.57264.1.1) */
    -    issuer: string;
    -    san: SubjectAlternativeName | undefined;
    -    /**
    -     * An unordered list of OIDs that must be verified.
    -     * All OID/values provided in this list MUST exactly match against
    -     * the values in the certificate for verification to be successful.
    -     */
    -    oids: ObjectIdentifierValuePair[];
    -}
    -export interface CertificateIdentities {
    -    identities: CertificateIdentity[];
    -}
    -export interface PublicKeyIdentities {
    -    publicKeys: PublicKey[];
    -}
    -/**
    - * A light-weight set of options/policies for identifying trusted signers,
    - * used during verification of a single artifact.
    - */
    -export interface ArtifactVerificationOptions {
    -    signers?: {
    -        $case: "certificateIdentities";
    -        certificateIdentities: CertificateIdentities;
    -    } | {
    -        $case: "publicKeys";
    -        publicKeys: PublicKeyIdentities;
    -    };
    -    /**
    -     * Optional options for artifact transparency log verification.
    -     * If none is provided, the default verification options are:
    -     * Threshold: 1
    -     * Online verification: false
    -     * Disable: false
    -     */
    -    tlogOptions?: ArtifactVerificationOptions_TlogOptions | undefined;
    -    /**
    -     * Optional options for certificate transparency log verification.
    -     * If none is provided, the default verification options are:
    -     * Threshold: 1
    -     * Detached SCT: false
    -     * Disable: false
    -     */
    -    ctlogOptions?: ArtifactVerificationOptions_CtlogOptions | undefined;
    -    /**
    -     * Optional options for certificate signed timestamp verification.
    -     * If none is provided, the default verification options are:
    -     * Threshold: 1
    -     * Disable: false
    -     */
    -    tsaOptions?: ArtifactVerificationOptions_TimestampAuthorityOptions | undefined;
    -}
    -export interface ArtifactVerificationOptions_TlogOptions {
    -    /** Number of transparency logs the entry must appear on. */
    -    threshold: number;
    -    /** Perform an online inclusion proof. */
    -    performOnlineVerification: boolean;
    -    /** Disable verification for transparency logs. */
    -    disable: boolean;
    -}
    -export interface ArtifactVerificationOptions_CtlogOptions {
    -    /**
    -     * The number of ct transparency logs the certificate must
    -     * appear on.
    -     */
    -    threshold: number;
    -    /**
    -     * Expect detached SCTs.
    -     * This is not supported right now as we can't capture an
    -     * detached SCT in the bundle.
    -     */
    -    detachedSct: boolean;
    -    /** Disable ct transparency log verification */
    -    disable: boolean;
    -}
    -export interface ArtifactVerificationOptions_TimestampAuthorityOptions {
    -    /** The number of signed timestamps that are expected. */
    -    threshold: number;
    -    /** Disable signed timestamp verification. */
    -    disable: boolean;
    -}
    -export interface Artifact {
    -    data?: {
    -        $case: "artifactUri";
    -        artifactUri: string;
    -    } | {
    -        $case: "artifact";
    -        artifact: Buffer;
    -    };
    -}
    -/**
    - * Input captures all that is needed to call the bundle verification method,
    - * to verify a single artifact referenced by the bundle.
    - */
    -export interface Input {
    -    /**
    -     * The verification materials provided during a bundle verification.
    -     * The running process is usually preloaded with a "global"
    -     * dev.sisgtore.trustroot.TrustedRoot.v1 instance. Prior to
    -     * verifying an artifact (i.e a bundle), and/or based on current
    -     * policy, some selection is expected to happen, to filter out the
    -     * exact certificate authority to use, which transparency logs are
    -     * relevant etc. The result should b ecaptured in the
    -     * `artifact_trust_root`.
    -     */
    -    artifactTrustRoot: TrustedRoot | undefined;
    -    artifactVerificationOptions: ArtifactVerificationOptions | undefined;
    -    bundle: Bundle | undefined;
    -    /**
    -     * If the bundle contains a message signature, the artifact must be
    -     * provided.
    -     */
    -    artifact?: Artifact | undefined;
    -}
    -export declare const CertificateIdentity: {
    -    fromJSON(object: any): CertificateIdentity;
    -    toJSON(message: CertificateIdentity): unknown;
    -};
    -export declare const CertificateIdentities: {
    -    fromJSON(object: any): CertificateIdentities;
    -    toJSON(message: CertificateIdentities): unknown;
    -};
    -export declare const PublicKeyIdentities: {
    -    fromJSON(object: any): PublicKeyIdentities;
    -    toJSON(message: PublicKeyIdentities): unknown;
    -};
    -export declare const ArtifactVerificationOptions: {
    -    fromJSON(object: any): ArtifactVerificationOptions;
    -    toJSON(message: ArtifactVerificationOptions): unknown;
    -};
    -export declare const ArtifactVerificationOptions_TlogOptions: {
    -    fromJSON(object: any): ArtifactVerificationOptions_TlogOptions;
    -    toJSON(message: ArtifactVerificationOptions_TlogOptions): unknown;
    -};
    -export declare const ArtifactVerificationOptions_CtlogOptions: {
    -    fromJSON(object: any): ArtifactVerificationOptions_CtlogOptions;
    -    toJSON(message: ArtifactVerificationOptions_CtlogOptions): unknown;
    -};
    -export declare const ArtifactVerificationOptions_TimestampAuthorityOptions: {
    -    fromJSON(object: any): ArtifactVerificationOptions_TimestampAuthorityOptions;
    -    toJSON(message: ArtifactVerificationOptions_TimestampAuthorityOptions): unknown;
    -};
    -export declare const Artifact: {
    -    fromJSON(object: any): Artifact;
    -    toJSON(message: Artifact): unknown;
    -};
    -export declare const Input: {
    -    fromJSON(object: any): Input;
    -    toJSON(message: Input): unknown;
    -};
    diff --git a/deps/npm/node_modules/sigstore/dist/types/sigstore/index.d.ts b/deps/npm/node_modules/sigstore/dist/types/sigstore/index.d.ts
    index 26dd2150d548eb..70b2896fbdcbae 100644
    --- a/deps/npm/node_modules/sigstore/dist/types/sigstore/index.d.ts
    +++ b/deps/npm/node_modules/sigstore/dist/types/sigstore/index.d.ts
    @@ -1,21 +1,13 @@
     /// 
    +import { ArtifactVerificationOptions, Bundle, Envelope, TransparencyLogEntry, VerificationMaterial } from '@sigstore/protobuf-specs';
     import { Entry } from '../../tlog';
     import { x509Certificate } from '../../x509/cert';
     import { SignatureMaterial } from '../signature';
     import { WithRequired } from '../utility';
     import { ValidBundle } from './validate';
    -import { Envelope } from './__generated__/envelope';
    -import { Bundle, VerificationMaterial } from './__generated__/sigstore_bundle';
    -import { TransparencyLogEntry } from './__generated__/sigstore_rekor';
    -import { ArtifactVerificationOptions } from './__generated__/sigstore_verification';
    +export * from '@sigstore/protobuf-specs';
     export * from './serialized';
     export * from './validate';
    -export * from './__generated__/envelope';
    -export * from './__generated__/sigstore_bundle';
    -export * from './__generated__/sigstore_common';
    -export { TransparencyLogEntry } from './__generated__/sigstore_rekor';
    -export * from './__generated__/sigstore_trustroot';
    -export * from './__generated__/sigstore_verification';
     export declare const bundleToJSON: (message: Bundle) => unknown;
     export declare const bundleFromJSON: (obj: any) => ValidBundle;
     export declare const envelopeToJSON: (message: Envelope) => unknown;
    diff --git a/deps/npm/node_modules/sigstore/dist/types/sigstore/index.js b/deps/npm/node_modules/sigstore/dist/types/sigstore/index.js
    index df07d6dc9fc295..55df7e744de197 100644
    --- a/deps/npm/node_modules/sigstore/dist/types/sigstore/index.js
    +++ b/deps/npm/node_modules/sigstore/dist/types/sigstore/index.js
    @@ -14,32 +14,39 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
         for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
     };
     Object.defineProperty(exports, "__esModule", { value: true });
    -exports.signingCertificate = exports.bundle = exports.isVerifiableTransparencyLogEntry = exports.isCAVerificationOptions = exports.isBundleWithCertificateChain = exports.isBundleWithVerificationMaterial = exports.envelopeFromJSON = exports.envelopeToJSON = exports.bundleFromJSON = exports.bundleToJSON = exports.TransparencyLogEntry = void 0;
    +exports.signingCertificate = exports.bundle = exports.isVerifiableTransparencyLogEntry = exports.isCAVerificationOptions = exports.isBundleWithCertificateChain = exports.isBundleWithVerificationMaterial = exports.envelopeFromJSON = exports.envelopeToJSON = exports.bundleFromJSON = exports.bundleToJSON = void 0;
    +/*
    +Copyright 2023 The Sigstore Authors.
    +
    +Licensed under the Apache License, Version 2.0 (the "License");
    +you may not use this file except in compliance with the License.
    +You may obtain a copy of the License at
    +
    +    http://www.apache.org/licenses/LICENSE-2.0
    +
    +Unless required by applicable law or agreed to in writing, software
    +distributed under the License is distributed on an "AS IS" BASIS,
    +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    +See the License for the specific language governing permissions and
    +limitations under the License.
    +*/
    +const protobuf_specs_1 = require("@sigstore/protobuf-specs");
     const util_1 = require("../../util");
     const cert_1 = require("../../x509/cert");
     const validate_1 = require("./validate");
    -const envelope_1 = require("./__generated__/envelope");
    -const sigstore_bundle_1 = require("./__generated__/sigstore_bundle");
    -const sigstore_common_1 = require("./__generated__/sigstore_common");
    +__exportStar(require("@sigstore/protobuf-specs"), exports);
     __exportStar(require("./serialized"), exports);
     __exportStar(require("./validate"), exports);
    -__exportStar(require("./__generated__/envelope"), exports);
    -__exportStar(require("./__generated__/sigstore_bundle"), exports);
    -__exportStar(require("./__generated__/sigstore_common"), exports);
    -var sigstore_rekor_1 = require("./__generated__/sigstore_rekor");
    -Object.defineProperty(exports, "TransparencyLogEntry", { enumerable: true, get: function () { return sigstore_rekor_1.TransparencyLogEntry; } });
    -__exportStar(require("./__generated__/sigstore_trustroot"), exports);
    -__exportStar(require("./__generated__/sigstore_verification"), exports);
    -exports.bundleToJSON = sigstore_bundle_1.Bundle.toJSON;
    +exports.bundleToJSON = protobuf_specs_1.Bundle.toJSON;
     // eslint-disable-next-line @typescript-eslint/no-explicit-any
     const bundleFromJSON = (obj) => {
    -    const bundle = sigstore_bundle_1.Bundle.fromJSON(obj);
    +    const bundle = protobuf_specs_1.Bundle.fromJSON(obj);
         (0, validate_1.assertValidBundle)(bundle);
         return bundle;
     };
     exports.bundleFromJSON = bundleFromJSON;
    -exports.envelopeToJSON = envelope_1.Envelope.toJSON;
    -exports.envelopeFromJSON = envelope_1.Envelope.fromJSON;
    +exports.envelopeToJSON = protobuf_specs_1.Envelope.toJSON;
    +exports.envelopeFromJSON = protobuf_specs_1.Envelope.fromJSON;
     const BUNDLE_MEDIA_TYPE = 'application/vnd.dev.sigstore.bundle+json;version=0.1';
     // Type guard for narrowing a Bundle to a BundleWithVerificationMaterial
     function isBundleWithVerificationMaterial(bundle) {
    @@ -80,7 +87,7 @@ exports.bundle = {
                 $case: 'messageSignature',
                 messageSignature: {
                     messageDigest: {
    -                    algorithm: sigstore_common_1.HashAlgorithm.SHA2_256,
    +                    algorithm: protobuf_specs_1.HashAlgorithm.SHA2_256,
                         digest: digest,
                     },
                     signature: signature.signature,
    diff --git a/deps/npm/node_modules/sigstore/dist/types/sigstore/validate.d.ts b/deps/npm/node_modules/sigstore/dist/types/sigstore/validate.d.ts
    index fd0a354282426d..7d8316fd2e6a2b 100644
    --- a/deps/npm/node_modules/sigstore/dist/types/sigstore/validate.d.ts
    +++ b/deps/npm/node_modules/sigstore/dist/types/sigstore/validate.d.ts
    @@ -1,6 +1,5 @@
    +import { Bundle, MessageSignature, VerificationMaterial } from '@sigstore/protobuf-specs';
     import { WithRequired } from '../utility';
    -import { Bundle, VerificationMaterial } from './__generated__/sigstore_bundle';
    -import { MessageSignature } from './__generated__/sigstore_common';
     export type ValidBundle = Bundle & {
         verificationMaterial: VerificationMaterial & {
             content: NonNullable;
    diff --git a/deps/npm/node_modules/sigstore/dist/types/sigstore/validate.js b/deps/npm/node_modules/sigstore/dist/types/sigstore/validate.js
    index a19d8ad3ec7021..efd873ab657018 100644
    --- a/deps/npm/node_modules/sigstore/dist/types/sigstore/validate.js
    +++ b/deps/npm/node_modules/sigstore/dist/types/sigstore/validate.js
    @@ -1,21 +1,6 @@
     "use strict";
     Object.defineProperty(exports, "__esModule", { value: true });
     exports.assertValidBundle = void 0;
    -/*
    -Copyright 2023 The Sigstore Authors.
    -
    -Licensed under the Apache License, Version 2.0 (the "License");
    -you may not use this file except in compliance with the License.
    -You may obtain a copy of the License at
    -
    -    http://www.apache.org/licenses/LICENSE-2.0
    -
    -Unless required by applicable law or agreed to in writing, software
    -distributed under the License is distributed on an "AS IS" BASIS,
    -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    -See the License for the specific language governing permissions and
    -limitations under the License.
    -*/
     const error_1 = require("../../error");
     // Performs basic validation of a Sigstore bundle to ensure that all required
     // fields are populated. This is not a complete validation of the bundle, but
    diff --git a/deps/npm/node_modules/sigstore/dist/util/appdata.d.ts b/deps/npm/node_modules/sigstore/dist/util/appdata.d.ts
    new file mode 100644
    index 00000000000000..dcdaeef418bd68
    --- /dev/null
    +++ b/deps/npm/node_modules/sigstore/dist/util/appdata.d.ts
    @@ -0,0 +1 @@
    +export declare function appDataPath(name: string): string;
    diff --git a/deps/npm/node_modules/sigstore/dist/util/appdata.js b/deps/npm/node_modules/sigstore/dist/util/appdata.js
    new file mode 100644
    index 00000000000000..d0c7f6f079e501
    --- /dev/null
    +++ b/deps/npm/node_modules/sigstore/dist/util/appdata.js
    @@ -0,0 +1,26 @@
    +"use strict";
    +var __importDefault = (this && this.__importDefault) || function (mod) {
    +    return (mod && mod.__esModule) ? mod : { "default": mod };
    +};
    +Object.defineProperty(exports, "__esModule", { value: true });
    +exports.appDataPath = void 0;
    +const os_1 = __importDefault(require("os"));
    +const path_1 = __importDefault(require("path"));
    +function appDataPath(name) {
    +    const homedir = os_1.default.homedir();
    +    switch (process.platform) {
    +        case 'darwin': {
    +            const appSupport = path_1.default.join(homedir, 'Library', 'Application Support');
    +            return path_1.default.join(appSupport, name);
    +        }
    +        case 'win32': {
    +            const localAppData = process.env.LOCALAPPDATA || path_1.default.join(homedir, 'AppData', 'Local');
    +            return path_1.default.join(localAppData, name, 'Data');
    +        }
    +        default: {
    +            const localData = process.env.XDG_DATA_HOME || path_1.default.join(homedir, '.local', 'share');
    +            return path_1.default.join(localData, name);
    +        }
    +    }
    +}
    +exports.appDataPath = appDataPath;
    diff --git a/deps/npm/node_modules/sigstore/dist/util/index.d.ts b/deps/npm/node_modules/sigstore/dist/util/index.d.ts
    index 786a19630cd603..02e4ddc69b15c6 100644
    --- a/deps/npm/node_modules/sigstore/dist/util/index.d.ts
    +++ b/deps/npm/node_modules/sigstore/dist/util/index.d.ts
    @@ -1,3 +1,4 @@
    +export * as appdata from './appdata';
     export * as crypto from './crypto';
     export * as dsse from './dsse';
     export * as encoding from './encoding';
    diff --git a/deps/npm/node_modules/sigstore/dist/util/index.js b/deps/npm/node_modules/sigstore/dist/util/index.js
    index 2c02116cbf07dd..74ef9c0b1121b2 100644
    --- a/deps/npm/node_modules/sigstore/dist/util/index.js
    +++ b/deps/npm/node_modules/sigstore/dist/util/index.js
    @@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
         return result;
     };
     Object.defineProperty(exports, "__esModule", { value: true });
    -exports.ua = exports.promise = exports.pem = exports.oidc = exports.json = exports.encoding = exports.dsse = exports.crypto = void 0;
    +exports.ua = exports.promise = exports.pem = exports.oidc = exports.json = exports.encoding = exports.dsse = exports.crypto = exports.appdata = void 0;
     /*
     Copyright 2022 The Sigstore Authors.
     
    @@ -39,6 +39,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
     */
    +exports.appdata = __importStar(require("./appdata"));
     exports.crypto = __importStar(require("./crypto"));
     exports.dsse = __importStar(require("./dsse"));
     exports.encoding = __importStar(require("./encoding"));
    diff --git a/deps/npm/node_modules/sigstore/dist/util/pem.d.ts b/deps/npm/node_modules/sigstore/dist/util/pem.d.ts
    index cb438c7937551c..6910679cae0654 100644
    --- a/deps/npm/node_modules/sigstore/dist/util/pem.d.ts
    +++ b/deps/npm/node_modules/sigstore/dist/util/pem.d.ts
    @@ -1,4 +1,3 @@
     /// 
    -export declare function split(certificate: string): string[];
     export declare function toDER(certificate: string): Buffer;
     export declare function fromDER(certificate: Buffer, type?: string): string;
    diff --git a/deps/npm/node_modules/sigstore/dist/util/pem.js b/deps/npm/node_modules/sigstore/dist/util/pem.js
    index 6bb8eda62a2ef6..8b03b364cd7efb 100644
    --- a/deps/npm/node_modules/sigstore/dist/util/pem.js
    +++ b/deps/npm/node_modules/sigstore/dist/util/pem.js
    @@ -1,6 +1,6 @@
     "use strict";
     Object.defineProperty(exports, "__esModule", { value: true });
    -exports.fromDER = exports.toDER = exports.split = void 0;
    +exports.fromDER = exports.toDER = void 0;
     /*
     Copyright 2022 The Sigstore Authors.
     
    @@ -18,27 +18,6 @@ limitations under the License.
     */
     const PEM_HEADER = /-----BEGIN (.*)-----/;
     const PEM_FOOTER = /-----END (.*)-----/;
    -// Given a set of PEM-encoded certificates bundled in a single string, returns
    -// an array of certificates. Standard PEM encoding dictates that each certificate
    -// should have a trailing newline after the footer.
    -function split(certificate) {
    -    const certs = [];
    -    let cert = [];
    -    certificate.split('\n').forEach((line) => {
    -        line.includes;
    -        if (line.match(PEM_HEADER)) {
    -            cert = [];
    -        }
    -        if (line.length > 0) {
    -            cert.push(line);
    -        }
    -        if (line.match(PEM_FOOTER)) {
    -            certs.push(cert.join('\n').concat('\n'));
    -        }
    -    });
    -    return certs;
    -}
    -exports.split = split;
     function toDER(certificate) {
         let der = '';
         certificate.split('\n').forEach((line) => {
    diff --git a/deps/npm/node_modules/sigstore/dist/util/stream.js b/deps/npm/node_modules/sigstore/dist/util/stream.js
    index b5c881bb388d43..d5c8236123cdfa 100644
    --- a/deps/npm/node_modules/sigstore/dist/util/stream.js
    +++ b/deps/npm/node_modules/sigstore/dist/util/stream.js
    @@ -112,5 +112,5 @@ class ByteStream {
             this.view = newView;
         }
     }
    -exports.ByteStream = ByteStream;
     ByteStream.BLOCK_SIZE = 1024;
    +exports.ByteStream = ByteStream;
    diff --git a/deps/npm/node_modules/sigstore/dist/verify.js b/deps/npm/node_modules/sigstore/dist/verify.js
    index 1bcef03b5f7ba6..9d21b553ac5232 100644
    --- a/deps/npm/node_modules/sigstore/dist/verify.js
    +++ b/deps/npm/node_modules/sigstore/dist/verify.js
    @@ -37,7 +37,7 @@ class Verifier {
         // Verifies the bundle signature, the bundle's certificate chain (if present)
         // and the bundle's transparency log entries.
         verify(bundle, options, data) {
    -        this.verifyArtifactSignature(bundle, options, data);
    +        this.verifyArtifactSignature(bundle, data);
             if (sigstore.isBundleWithCertificateChain(bundle)) {
                 this.verifySigningCertificate(bundle, options);
             }
    @@ -45,8 +45,8 @@ class Verifier {
         }
         // Performs bundle signature verification. Determines the type of the bundle
         // content and delegates to the appropriate signature verification function.
    -    verifyArtifactSignature(bundle, options, data) {
    -        const publicKey = this.getPublicKey(bundle, options);
    +    verifyArtifactSignature(bundle, data) {
    +        const publicKey = this.getPublicKey(bundle);
             switch (bundle.content?.$case) {
                 case 'messageSignature':
                     if (!data) {
    @@ -79,7 +79,7 @@ class Verifier {
         // Returns the public key which will be used to verify the bundle signature.
         // The public key is selected based on the verification material in the bundle
         // and the options provided.
    -    getPublicKey(bundle, options) {
    +    getPublicKey(bundle) {
             // Select the key which will be used to verify the signature
             switch (bundle.verificationMaterial?.content?.$case) {
                 // If the bundle contains a certificate chain, the public key is the
    @@ -89,7 +89,7 @@ class Verifier {
                 // If the bundle contains a public key hint, the public key is selected
                 // from the list of trusted keys in the options
                 case 'publicKey':
    -                return getPublicKeyFromHint(bundle.verificationMaterial.content.publicKey, options, this.keySelector);
    +                return getPublicKeyFromHint(bundle.verificationMaterial.content.publicKey, this.keySelector);
             }
         }
     }
    @@ -101,7 +101,7 @@ function getPublicKeyFromCertificateChain(certificateChain) {
     }
     // Retrieves the public key through the key selector callback, passing the
     // public key hint from the bundle
    -function getPublicKeyFromHint(publicKeyID, options, keySelector) {
    +function getPublicKeyFromHint(publicKeyID, keySelector) {
         const key = keySelector(publicKeyID.hint);
         if (!key) {
             throw new error_1.VerificationError('no public key found for signature verification');
    diff --git a/deps/npm/node_modules/sigstore/dist/x509/asn1/obj.d.ts b/deps/npm/node_modules/sigstore/dist/x509/asn1/obj.d.ts
    index 7f70a0ac3047bd..de54996c87faac 100644
    --- a/deps/npm/node_modules/sigstore/dist/x509/asn1/obj.d.ts
    +++ b/deps/npm/node_modules/sigstore/dist/x509/asn1/obj.d.ts
    @@ -3,12 +3,9 @@ import { ASN1Tag } from './tag';
     export declare class ASN1Obj {
         readonly tag: ASN1Tag;
         readonly subs: ASN1Obj[];
    -    private buf;
    -    private headerLength;
    -    constructor(tag: ASN1Tag, headerLength: number, buf: Buffer, subs: ASN1Obj[]);
    +    readonly value: Buffer;
    +    constructor(tag: ASN1Tag, value: Buffer, subs: ASN1Obj[]);
         static parseBuffer(buf: Buffer): ASN1Obj;
    -    get value(): Buffer;
    -    get raw(): Buffer;
         toDER(): Buffer;
         toBoolean(): boolean;
         toInteger(): bigint;
    diff --git a/deps/npm/node_modules/sigstore/dist/x509/asn1/obj.js b/deps/npm/node_modules/sigstore/dist/x509/asn1/obj.js
    index 9e67edcf60a0c2..712acf105adfc7 100644
    --- a/deps/npm/node_modules/sigstore/dist/x509/asn1/obj.js
    +++ b/deps/npm/node_modules/sigstore/dist/x509/asn1/obj.js
    @@ -22,28 +22,15 @@ const length_1 = require("./length");
     const parse_1 = require("./parse");
     const tag_1 = require("./tag");
     class ASN1Obj {
    -    constructor(tag, headerLength, buf, subs) {
    +    constructor(tag, value, subs) {
             this.tag = tag;
    -        this.headerLength = headerLength;
    -        this.buf = buf;
    +        this.value = value;
             this.subs = subs;
         }
         // Constructs an ASN.1 object from a Buffer of DER-encoded bytes.
         static parseBuffer(buf) {
             return parseStream(new stream_1.ByteStream(buf));
         }
    -    // Returns the raw bytes of the ASN.1 object's value. For constructed objects,
    -    // this is the concatenation of the raw bytes of the values of its children.
    -    // For primitive objects, this is the raw bytes of the object's value.
    -    // Use the various to* methods to parse the value into a specific type.
    -    get value() {
    -        return this.buf.subarray(this.headerLength);
    -    }
    -    // Returns the raw bytes of the entire ASN.1 object (including tag, length,
    -    // and value)
    -    get raw() {
    -        return this.buf;
    -    }
         toDER() {
             const valueStream = new stream_1.ByteStream();
             if (this.subs.length > 0) {
    @@ -114,13 +101,11 @@ exports.ASN1Obj = ASN1Obj;
     /////////////////////////////////////////////////////////////////////////////
     // Internal stream parsing functions
     function parseStream(stream) {
    -    // Capture current stream position so we know where this object starts
    -    const startPos = stream.position;
    -    // Parse tag and length from stream
    +    // Parse tag, length, and value from stream
         const tag = new tag_1.ASN1Tag(stream.getUint8());
         const len = (0, length_1.decodeLength)(stream);
    -    // Calculate length of header (tag + length)
    -    const header = stream.position - startPos;
    +    const value = stream.slice(stream.position, len);
    +    const start = stream.position;
         let subs = [];
         // If the object is constructed, parse its children. Sometimes, children
         // are embedded in OCTESTRING objects, so we need to check those
    @@ -140,11 +125,9 @@ function parseStream(stream) {
         }
         // If there are no children, move stream cursor to the end of the object
         if (subs.length === 0) {
    -        stream.seek(startPos + header + len);
    +        stream.seek(start + len);
         }
    -    // Capture the raw bytes of the object (including tag, length, and value)
    -    const buf = stream.slice(startPos, header + len);
    -    return new ASN1Obj(tag, header, buf, subs);
    +    return new ASN1Obj(tag, value, subs);
     }
     function collectSubs(stream, len) {
         // Calculate end of object content
    diff --git a/deps/npm/node_modules/sigstore/dist/x509/cert.js b/deps/npm/node_modules/sigstore/dist/x509/cert.js
    index 55cf22f62e27e5..0b8ab54740a069 100644
    --- a/deps/npm/node_modules/sigstore/dist/x509/cert.js
    +++ b/deps/npm/node_modules/sigstore/dist/x509/cert.js
    @@ -59,7 +59,7 @@ class x509Certificate {
             return this.subjectObj.value;
         }
         get publicKey() {
    -        return this.subjectPublicKeyInfoObj.raw;
    +        return this.subjectPublicKeyInfoObj.toDER();
         }
         get signatureAlgorithm() {
             const oid = this.signatureAlgorithmObj.subs[0].toOID();
    @@ -115,13 +115,13 @@ class x509Certificate {
             // Use the issuer's public key if provided, otherwise use the subject's
             const publicKey = issuerCertificate?.publicKey || this.publicKey;
             const key = util_1.crypto.createPublicKey(publicKey);
    -        return util_1.crypto.verifyBlob(this.tbsCertificate.raw, key, this.signatureValue, this.signatureAlgorithm);
    +        return util_1.crypto.verifyBlob(this.tbsCertificate.toDER(), key, this.signatureValue, this.signatureAlgorithm);
         }
         validForDate(date) {
             return this.notBefore <= date && date <= this.notAfter;
         }
         equals(other) {
    -        return this.root.raw.equals(other.root.raw);
    +        return this.root.toDER().equals(other.root.toDER());
         }
         verifySCTs(issuer, logs) {
             let extSCT;
    @@ -167,8 +167,9 @@ class x509Certificate {
         }
         // Creates a copy of the certificate with a new buffer
         clone() {
    -        const clone = Buffer.alloc(this.root.raw.length);
    -        this.root.raw.copy(clone);
    +        const der = this.root.toDER();
    +        const clone = Buffer.alloc(der.length);
    +        der.copy(clone);
             return x509Certificate.parse(clone);
         }
         findExtension(oid) {
    diff --git a/deps/npm/node_modules/sigstore/package.json b/deps/npm/node_modules/sigstore/package.json
    index 1a5960822eb0ee..0ef3fe90f467e7 100644
    --- a/deps/npm/node_modules/sigstore/package.json
    +++ b/deps/npm/node_modules/sigstore/package.json
    @@ -1,6 +1,6 @@
     {
       "name": "sigstore",
    -  "version": "1.0.0",
    +  "version": "1.2.0",
       "description": "code-signing for npm packages",
       "main": "dist/index.js",
       "types": "dist/index.d.ts",
    @@ -12,7 +12,7 @@
         "lint": "eslint --fix --ext .ts src/**",
         "lint:check": "eslint --max-warnings 0 --ext .ts src/**",
         "format": "prettier --write \"src/**/*\"",
    -    "codegen:sigstore": "./hack/generate-sigstore-types",
    +    "release": "npm run build && changeset publish",
         "codegen:rekor": "./hack/generate-rekor-types"
       },
       "bin": {
    @@ -22,6 +22,9 @@
         "type": "git",
         "url": "git+https://github.com/sigstore/sigstore-js.git"
       },
    +  "publishConfig": {
    +    "provenance": true
    +  },
       "files": [
         "dist",
         "store"
    @@ -33,6 +36,7 @@
       },
       "homepage": "https://github.com/sigstore/sigstore-js#readme",
       "devDependencies": {
    +    "@changesets/cli": "^2.26.0",
         "@tsconfig/node14": "^1.0.3",
         "@types/jest": "^29.4.0",
         "@types/make-fetch-happen": "^10.0.0",
    @@ -43,13 +47,14 @@
         "eslint-config-prettier": "^8.5.0",
         "eslint-plugin-prettier": "^4.0.0",
         "jest": "^29.4.1",
    -    "json-schema-to-typescript": "^11.0.2",
    +    "json-schema-to-typescript": "^12.0.0",
         "nock": "^13.2.4",
         "prettier": "^2.6.2",
         "ts-jest": "^29.0.5",
    -    "typescript": "^4.7.2"
    +    "typescript": "^5.0.2"
       },
       "dependencies": {
    +    "@sigstore/protobuf-specs": "^0.1.0",
         "make-fetch-happen": "^11.0.1",
         "tuf-js": "^1.0.0"
       },
    diff --git a/deps/npm/node_modules/sigstore/store/map.json b/deps/npm/node_modules/sigstore/store/map.json
    deleted file mode 100644
    index 620bf0bedbf442..00000000000000
    --- a/deps/npm/node_modules/sigstore/store/map.json
    +++ /dev/null
    @@ -1,19 +0,0 @@
    -{
    -  "repositories": {
    -    "public-good-instance": [
    -      "https://sigstore-tuf-root.storage.googleapis.com"
    -    ]
    -  },
    -  "mapping": [
    -    {
    -      "paths": [
    -        "*"
    -      ],
    -      "repositories": [
    -        "public-good-instance"
    -      ],
    -      "terminating": true,
    -      "threshold": 1
    -    }
    -  ]
    -}
    diff --git a/deps/npm/node_modules/smart-buffer/build/smartbuffer.js.map b/deps/npm/node_modules/smart-buffer/build/smartbuffer.js.map
    deleted file mode 100644
    index 37f0d6e16fc682..00000000000000
    --- a/deps/npm/node_modules/smart-buffer/build/smartbuffer.js.map
    +++ /dev/null
    @@ -1 +0,0 @@
    -{"version":3,"file":"smartbuffer.js","sourceRoot":"","sources":["../src/smartbuffer.ts"],"names":[],"mappings":";;AAAA,mCAGiB;AAcjB,kDAAkD;AAClD,MAAM,wBAAwB,GAAW,IAAI,CAAC;AAE9C,kEAAkE;AAClE,MAAM,4BAA4B,GAAmB,MAAM,CAAC;AAE5D,MAAM,WAAW;IAQf;;;;OAIG;IACH,YAAY,OAA4B;QAZjC,WAAM,GAAW,CAAC,CAAC;QAElB,cAAS,GAAmB,4BAA4B,CAAC;QAEzD,iBAAY,GAAW,CAAC,CAAC;QACzB,gBAAW,GAAW,CAAC,CAAC;QAQ9B,IAAI,WAAW,CAAC,oBAAoB,CAAC,OAAO,CAAC,EAAE;YAC7C,sBAAsB;YACtB,IAAI,OAAO,CAAC,QAAQ,EAAE;gBACpB,qBAAa,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;gBAChC,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,QAAQ,CAAC;aACnC;YAED,iCAAiC;YACjC,IAAI,OAAO,CAAC,IAAI,EAAE;gBAChB,IAAI,uBAAe,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,IAAI,GAAG,CAAC,EAAE;oBACrD,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;iBAC/C;qBAAM;oBACL,MAAM,IAAI,KAAK,CAAC,cAAM,CAAC,wBAAwB,CAAC,CAAC;iBAClD;gBACD,2BAA2B;aAC5B;iBAAM,IAAI,OAAO,CAAC,IAAI,EAAE;gBACvB,IAAI,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,EA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AY,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,YAAY,EAAE,SAAS,GAAG,QAAQ,CAAC,CAAC;SACvE;aAAM;YACL,mGAAmG;YACnG,IAAI,CAAC,YAAY,IAAI,QAAQ,CAAC;SAC/B;QAED,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAE4B,kCAAW"}
    \ No newline at end of file
    diff --git a/deps/npm/node_modules/smart-buffer/build/utils.js.map b/deps/npm/node_modules/smart-buffer/build/utils.js.map
    deleted file mode 100644
    index fc7388d3b7010c..00000000000000
    --- a/deps/npm/node_modules/smart-buffer/build/utils.js.map
    +++ /dev/null
    @@ -1 +0,0 @@
    -{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";;AACA,mCAAgC;AAEhC;;GAEG;AACH,MAAM,MAAM,GAAG;IACb,gBAAgB,EAAE,kGAAkG;IACpH,wBAAwB,EAAE,wEAAwE;IAClG,0BAA0B,EAAE,gDAAgD;IAC5E,0BAA0B,EAAE,2FAA2F;IACvH,cAAc,EAAE,uCAAuC;IACvD,yBAAyB,EAAE,oEAAoE;IAC/F,cAAc,EAAE,uCAAuC;IACvD,yBAAyB,EAAE,oEAAoE;IAC/F,qBAAqB,EAAE,sEAAsE;IAC7F,qBAAqB,EAAE,yFAAyF;IAChH,0BAA0B,EAAE,0DAA0D;IACtF,2BAA2B,EAAE,2DAA2D;CACzF,CAAC;AAuGA,wBAAM;AArGR;;;;GAIG;AACH,SAAS,aAAa,CAAC,QAAwB;IAC7C,IAAI,CAAC,eAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE;QAChC,MAAM,IAAI,KAAK,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC;KAC1C;AACH,CAAC;AA4F0B,sCAAa;AA1FxC;;;;GAIG;AACH,SAAS,eAAe,CAAC,KAAa;IACpC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,SAAS,CA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CAAC,YAA0B;IAC3D,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;QACjC,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC;KAC9D;IAED,IAAI,OAAO,eAAM,CAAC,SAAS,CAAC,YAAY,CAAC,KAAK,WAAW,EAAE;QACzD,MAAM,IAAI,KAAK,CAAC,8CAA8C,YAAY,GAAG,CAAC,CAAC;KAChF;AACH,CAAC;AAIsC,8DAAyB"}
    \ No newline at end of file
    diff --git a/deps/npm/node_modules/smart-buffer/typings/smartbuffer.d.ts b/deps/npm/node_modules/smart-buffer/typings/smartbuffer.d.ts
    deleted file mode 100644
    index d07379b2983a44..00000000000000
    --- a/deps/npm/node_modules/smart-buffer/typings/smartbuffer.d.ts
    +++ /dev/null
    @@ -1,755 +0,0 @@
    -/// 
    -/**
    - * Object interface for constructing new SmartBuffer instances.
    - */
    -interface SmartBufferOptions {
    -    encoding?: BufferEncoding;
    -    size?: number;
    -    buff?: Buffer;
    -}
    -declare class SmartBuffer {
    -    length: number;
    -    private _encoding;
    -    private _buff;
    -    private _writeOffset;
    -    private _readOffset;
    -    /**
    -     * Creates a new SmartBuffer instance.
    -     *
    -     * @param options { SmartBufferOptions } The SmartBufferOptions to apply to this instance.
    -     */
    -    constructor(options?: SmartBufferOptions);
    -    /**
    -     * Creates a new SmartBuffer instance with the provided internal Buffer size and optional encoding.
    -     *
    -     * @param size { Number } The size of the internal Buffer.
    -     * @param encoding { String } The BufferEncoding to use for strings.
    -     *
    -     * @return { SmartBuffer }
    -     */
    -    static fromSize(size: number, encoding?: BufferEncoding): SmartBuffer;
    -    /**
    -     * Creates a new SmartBuffer instance with the provided Buffer and optional encoding.
    -     *
    -     * @param buffer { Buffer } The Buffer to use as the internal Buffer value.
    -     * @param encoding { String } The BufferEncoding to use for strings.
    -     *
    -     * @return { SmartBuffer }
    -     */
    -    static fromBuffer(buff: Buffer, encoding?: BufferEncoding): SmartBuffer;
    -    /**
    -     * Creates a new SmartBuffer instance with the provided SmartBufferOptions options.
    -     *
    -     * @param options { SmartBufferOptions } The options to use when creating the SmartBuffer instance.
    -     */
    -    static fromOptions(options: SmartBufferOptions): SmartBuffer;
    -    /**
    -     * Type checking function that determines if an object is a SmartBufferOptions object.
    -     */
    -    static isSmartBufferOptions(options: SmartBufferOptions): options is SmartBufferOptions;
    -    /**
    -     * Reads an Int8 value from the current read position or an optionally provided offset.
    -     *
    -     * @param offset { Number } The offset to read data from (optional)
    -     * @return { Number }
    -     */
    -    readInt8(offset?: number): number;
    -    /**
    -     * Reads an Int16BE value from the current read position or an optionally provided offset.
    -     *
    -     * @param offset { Number } The offset to read data from (optional)
    -     * @return { Number }
    -     */
    -    readInt16BE(offset?: number): number;
    -    /**
    -     * Reads an Int16LE value from the current read position or an optionally provided offset.
    -     *
    -     * @param offset { Number } The offset to read data from (optional)
    -     * @return { Number }
    -     */
    -    readInt16LE(offset?: number): number;
    -    /**
    -     * Reads an Int32BE value from the current read position or an optionally provided offset.
    -     *
    -     * @param offset { Number } The offset to read data from (optional)
    -     * @return { Number }
    -     */
    -    readInt32BE(offset?: number): number;
    -    /**
    -     * Reads an Int32LE value from the current read position or an optionally provided offset.
    -     *
    -     * @param offset { Number } The offset to read data from (optional)
    -     * @return { Number }
    -     */
    -    readInt32LE(offset?: number): number;
    -    /**
    -     * Reads a BigInt64BE value from the current read position or an optionally provided offset.
    -     *
    -     * @param offset { Number } The offset to read data from (optional)
    -     * @return { BigInt }
    -     */
    -    readBigInt64BE(offset?: number): bigint;
    -    /**
    -     * Reads a BigInt64LE value from the current read position or an optionally provided offset.
    -     *
    -     * @param offset { Number } The offset to read data from (optional)
    -     * @return { BigInt }
    -     */
    -    readBigInt64LE(offset?: number): bigint;
    -    /**
    -     * Writes an Int8 value to the current write position (or at optional offset).
    -     *
    -     * @param value { Number } The value to write.
    -     * @param offset { Number } The offset to write the value at.
    -     *
    -     * @return this
    -     */
    -    writeInt8(value: number, offset?: number): SmartBuffer;
    -    /**
    -     * Inserts an Int8 value at the given offset value.
    -     *
    -     * @param value { Number } The value to insert.
    -     * @param offset { Number } The offset to insert the value at.
    -     *
    -     * @return this
    -     */
    -    insertInt8(value: number, offset: number): SmartBuffer;
    -    /**
    -     * Writes an Int16BE value to the current write position (or at optional offset).
    -     *
    -     * @param value { Number } The value to write.
    -     * @param offset { Number } The offset to write the value at.
    -     *
    -     * @return this
    -     */
    -    writeInt16BE(value: number, offset?: number): SmartBuffer;
    -    /**
    -     * Inserts an Int16BE value at the given offset value.
    -     *
    -     * @param value { Number } The value to insert.
    -     * @param offset { Number } The offset to insert the value at.
    -     *
    -     * @return this
    -     */
    -    insertInt16BE(value: number, offset: number): SmartBuffer;
    -    /**
    -     * Writes an Int16LE value to the current write position (or at optional offset).
    -     *
    -     * @param value { Number } The value to write.
    -     * @param offset { Number } The offset to write the value at.
    -     *
    -     * @return this
    -     */
    -    writeInt16LE(value: number, offset?: number): SmartBuffer;
    -    /**
    -     * Inserts an Int16LE value at the given offset value.
    -     *
    -     * @param value { Number } The value to insert.
    -     * @param offset { Number } The offset to insert the value at.
    -     *
    -     * @return this
    -     */
    -    insertInt16LE(value: number, offset: number): SmartBuffer;
    -    /**
    -     * Writes an Int32BE value to the current write position (or at optional offset).
    -     *
    -     * @param value { Number } The value to write.
    -     * @param offset { Number } The offset to write the value at.
    -     *
    -     * @return this
    -     */
    -    writeInt32BE(value: number, offset?: number): SmartBuffer;
    -    /**
    -     * Inserts an Int32BE value at the given offset value.
    -     *
    -     * @param value { Number } The value to insert.
    -     * @param offset { Number } The offset to insert the value at.
    -     *
    -     * @return this
    -     */
    -    insertInt32BE(value: number, offset: number): SmartBuffer;
    -    /**
    -     * Writes an Int32LE value to the current write position (or at optional offset).
    -     *
    -     * @param value { Number } The value to write.
    -     * @param offset { Number } The offset to write the value at.
    -     *
    -     * @return this
    -     */
    -    writeInt32LE(value: number, offset?: number): SmartBuffer;
    -    /**
    -     * Inserts an Int32LE value at the given offset value.
    -     *
    -     * @param value { Number } The value to insert.
    -     * @param offset { Number } The offset to insert the value at.
    -     *
    -     * @return this
    -     */
    -    insertInt32LE(value: number, offset: number): SmartBuffer;
    -    /**
    -     * Writes a BigInt64BE value to the current write position (or at optional offset).
    -     *
    -     * @param value { BigInt } The value to write.
    -     * @param offset { Number } The offset to write the value at.
    -     *
    -     * @return this
    -     */
    -    writeBigInt64BE(value: bigint, offset?: number): SmartBuffer;
    -    /**
    -     * Inserts a BigInt64BE value at the given offset value.
    -     *
    -     * @param value { BigInt } The value to insert.
    -     * @param offset { Number } The offset to insert the value at.
    -     *
    -     * @return this
    -     */
    -    insertBigInt64BE(value: bigint, offset: number): SmartBuffer;
    -    /**
    -     * Writes a BigInt64LE value to the current write position (or at optional offset).
    -     *
    -     * @param value { BigInt } The value to write.
    -     * @param offset { Number } The offset to write the value at.
    -     *
    -     * @return this
    -     */
    -    writeBigInt64LE(value: bigint, offset?: number): SmartBuffer;
    -    /**
    -     * Inserts a Int64LE value at the given offset value.
    -     *
    -     * @param value { BigInt } The value to insert.
    -     * @param offset { Number } The offset to insert the value at.
    -     *
    -     * @return this
    -     */
    -    insertBigInt64LE(value: bigint, offset: number): SmartBuffer;
    -    /**
    -     * Reads an UInt8 value from the current read position or an optionally provided offset.
    -     *
    -     * @param offset { Number } The offset to read data from (optional)
    -     * @return { Number }
    -     */
    -    readUInt8(offset?: number): number;
    -    /**
    -     * Reads an UInt16BE value from the current read position or an optionally provided offset.
    -     *
    -     * @param offset { Number } The offset to read data from (optional)
    -     * @return { Number }
    -     */
    -    readUInt16BE(offset?: number): number;
    -    /**
    -     * Reads an UInt16LE value from the current read position or an optionally provided offset.
    -     *
    -     * @param offset { Number } The offset to read data from (optional)
    -     * @return { Number }
    -     */
    -    readUInt16LE(offset?: number): number;
    -    /**
    -     * Reads an UInt32BE value from the current read position or an optionally provided offset.
    -     *
    -     * @param offset { Number } The offset to read data from (optional)
    -     * @return { Number }
    -     */
    -    readUInt32BE(offset?: number): number;
    -    /**
    -     * Reads an UInt32LE value from the current read position or an optionally provided offset.
    -     *
    -     * @param offset { Number } The offset to read data from (optional)
    -     * @return { Number }
    -     */
    -    readUInt32LE(offset?: number): number;
    -    /**
    -     * Reads a BigUInt64BE value from the current read position or an optionally provided offset.
    -     *
    -     * @param offset { Number } The offset to read data from (optional)
    -     * @return { BigInt }
    -     */
    -    readBigUInt64BE(offset?: number): bigint;
    -    /**
    -     * Reads a BigUInt64LE value from the current read position or an optionally provided offset.
    -     *
    -     * @param offset { Number } The offset to read data from (optional)
    -     * @return { BigInt }
    -     */
    -    readBigUInt64LE(offset?: number): bigint;
    -    /**
    -     * Writes an UInt8 value to the current write position (or at optional offset).
    -     *
    -     * @param value { Number } The value to write.
    -     * @param offset { Number } The offset to write the value at.
    -     *
    -     * @return this
    -     */
    -    writeUInt8(value: number, offset?: number): SmartBuffer;
    -    /**
    -     * Inserts an UInt8 value at the given offset value.
    -     *
    -     * @param value { Number } The value to insert.
    -     * @param offset { Number } The offset to insert the value at.
    -     *
    -     * @return this
    -     */
    -    insertUInt8(value: number, offset: number): SmartBuffer;
    -    /**
    -     * Writes an UInt16BE value to the current write position (or at optional offset).
    -     *
    -     * @param value { Number } The value to write.
    -     * @param offset { Number } The offset to write the value at.
    -     *
    -     * @return this
    -     */
    -    writeUInt16BE(value: number, offset?: number): SmartBuffer;
    -    /**
    -     * Inserts an UInt16BE value at the given offset value.
    -     *
    -     * @param value { Number } The value to insert.
    -     * @param offset { Number } The offset to insert the value at.
    -     *
    -     * @return this
    -     */
    -    insertUInt16BE(value: number, offset: number): SmartBuffer;
    -    /**
    -     * Writes an UInt16LE value to the current write position (or at optional offset).
    -     *
    -     * @param value { Number } The value to write.
    -     * @param offset { Number } The offset to write the value at.
    -     *
    -     * @return this
    -     */
    -    writeUInt16LE(value: number, offset?: number): SmartBuffer;
    -    /**
    -     * Inserts an UInt16LE value at the given offset value.
    -     *
    -     * @param value { Number } The value to insert.
    -     * @param offset { Number } The offset to insert the value at.
    -     *
    -     * @return this
    -     */
    -    insertUInt16LE(value: number, offset: number): SmartBuffer;
    -    /**
    -     * Writes an UInt32BE value to the current write position (or at optional offset).
    -     *
    -     * @param value { Number } The value to write.
    -     * @param offset { Number } The offset to write the value at.
    -     *
    -     * @return this
    -     */
    -    writeUInt32BE(value: number, offset?: number): SmartBuffer;
    -    /**
    -     * Inserts an UInt32BE value at the given offset value.
    -     *
    -     * @param value { Number } The value to insert.
    -     * @param offset { Number } The offset to insert the value at.
    -     *
    -     * @return this
    -     */
    -    insertUInt32BE(value: number, offset: number): SmartBuffer;
    -    /**
    -     * Writes an UInt32LE value to the current write position (or at optional offset).
    -     *
    -     * @param value { Number } The value to write.
    -     * @param offset { Number } The offset to write the value at.
    -     *
    -     * @return this
    -     */
    -    writeUInt32LE(value: number, offset?: number): SmartBuffer;
    -    /**
    -     * Inserts an UInt32LE value at the given offset value.
    -     *
    -     * @param value { Number } The value to insert.
    -     * @param offset { Number } The offset to insert the value at.
    -     *
    -     * @return this
    -     */
    -    insertUInt32LE(value: number, offset: number): SmartBuffer;
    -    /**
    -     * Writes a BigUInt64BE value to the current write position (or at optional offset).
    -     *
    -     * @param value { Number } The value to write.
    -     * @param offset { Number } The offset to write the value at.
    -     *
    -     * @return this
    -     */
    -    writeBigUInt64BE(value: bigint, offset?: number): SmartBuffer;
    -    /**
    -     * Inserts a BigUInt64BE value at the given offset value.
    -     *
    -     * @param value { Number } The value to insert.
    -     * @param offset { Number } The offset to insert the value at.
    -     *
    -     * @return this
    -     */
    -    insertBigUInt64BE(value: bigint, offset: number): SmartBuffer;
    -    /**
    -     * Writes a BigUInt64LE value to the current write position (or at optional offset).
    -     *
    -     * @param value { Number } The value to write.
    -     * @param offset { Number } The offset to write the value at.
    -     *
    -     * @return this
    -     */
    -    writeBigUInt64LE(value: bigint, offset?: number): SmartBuffer;
    -    /**
    -     * Inserts a BigUInt64LE value at the given offset value.
    -     *
    -     * @param value { Number } The value to insert.
    -     * @param offset { Number } The offset to insert the value at.
    -     *
    -     * @return this
    -     */
    -    insertBigUInt64LE(value: bigint, offset: number): SmartBuffer;
    -    /**
    -     * Reads an FloatBE value from the current read position or an optionally provided offset.
    -     *
    -     * @param offset { Number } The offset to read data from (optional)
    -     * @return { Number }
    -     */
    -    readFloatBE(offset?: number): number;
    -    /**
    -     * Reads an FloatLE value from the current read position or an optionally provided offset.
    -     *
    -     * @param offset { Number } The offset to read data from (optional)
    -     * @return { Number }
    -     */
    -    readFloatLE(offset?: number): number;
    -    /**
    -     * Writes a FloatBE value to the current write position (or at optional offset).
    -     *
    -     * @param value { Number } The value to write.
    -     * @param offset { Number } The offset to write the value at.
    -     *
    -     * @return this
    -     */
    -    writeFloatBE(value: number, offset?: number): SmartBuffer;
    -    /**
    -     * Inserts a FloatBE value at the given offset value.
    -     *
    -     * @param value { Number } The value to insert.
    -     * @param offset { Number } The offset to insert the value at.
    -     *
    -     * @return this
    -     */
    -    insertFloatBE(value: number, offset: number): SmartBuffer;
    -    /**
    -     * Writes a FloatLE value to the current write position (or at optional offset).
    -     *
    -     * @param value { Number } The value to write.
    -     * @param offset { Number } The offset to write the value at.
    -     *
    -     * @return this
    -     */
    -    writeFloatLE(value: number, offset?: number): SmartBuffer;
    -    /**
    -     * Inserts a FloatLE value at the given offset value.
    -     *
    -     * @param value { Number } The value to insert.
    -     * @param offset { Number } The offset to insert the value at.
    -     *
    -     * @return this
    -     */
    -    insertFloatLE(value: number, offset: number): SmartBuffer;
    -    /**
    -     * Reads an DoublEBE value from the current read position or an optionally provided offset.
    -     *
    -     * @param offset { Number } The offset to read data from (optional)
    -     * @return { Number }
    -     */
    -    readDoubleBE(offset?: number): number;
    -    /**
    -     * Reads an DoubleLE value from the current read position or an optionally provided offset.
    -     *
    -     * @param offset { Number } The offset to read data from (optional)
    -     * @return { Number }
    -     */
    -    readDoubleLE(offset?: number): number;
    -    /**
    -     * Writes a DoubleBE value to the current write position (or at optional offset).
    -     *
    -     * @param value { Number } The value to write.
    -     * @param offset { Number } The offset to write the value at.
    -     *
    -     * @return this
    -     */
    -    writeDoubleBE(value: number, offset?: number): SmartBuffer;
    -    /**
    -     * Inserts a DoubleBE value at the given offset value.
    -     *
    -     * @param value { Number } The value to insert.
    -     * @param offset { Number } The offset to insert the value at.
    -     *
    -     * @return this
    -     */
    -    insertDoubleBE(value: number, offset: number): SmartBuffer;
    -    /**
    -     * Writes a DoubleLE value to the current write position (or at optional offset).
    -     *
    -     * @param value { Number } The value to write.
    -     * @param offset { Number } The offset to write the value at.
    -     *
    -     * @return this
    -     */
    -    writeDoubleLE(value: number, offset?: number): SmartBuffer;
    -    /**
    -     * Inserts a DoubleLE value at the given offset value.
    -     *
    -     * @param value { Number } The value to insert.
    -     * @param offset { Number } The offset to insert the value at.
    -     *
    -     * @return this
    -     */
    -    insertDoubleLE(value: number, offset: number): SmartBuffer;
    -    /**
    -     * Reads a String from the current read position.
    -     *
    -     * @param arg1 { Number | String } The number of bytes to read as a String, or the BufferEncoding to use for
    -     *             the string (Defaults to instance level encoding).
    -     * @param encoding { String } The BufferEncoding to use for the string (Defaults to instance level encoding).
    -     *
    -     * @return { String }
    -     */
    -    readString(arg1?: number | BufferEncoding, encoding?: BufferEncoding): string;
    -    /**
    -     * Inserts a String
    -     *
    -     * @param value { String } The String value to insert.
    -     * @param offset { Number } The offset to insert the string at.
    -     * @param encoding { String } The BufferEncoding to use for writing strings (defaults to instance encoding).
    -     *
    -     * @return this
    -     */
    -    insertString(value: string, offset: number, encoding?: BufferEncoding): SmartBuffer;
    -    /**
    -     * Writes a String
    -     *
    -     * @param value { String } The String value to write.
    -     * @param arg2 { Number | String } The offset to write the string at, or the BufferEncoding to use.
    -     * @param encoding { String } The BufferEncoding to use for writing strings (defaults to instance encoding).
    -     *
    -     * @return this
    -     */
    -    writeString(value: string, arg2?: number | BufferEncoding, encoding?: BufferEncoding): SmartBuffer;
    -    /**
    -     * Reads a null-terminated String from the current read position.
    -     *
    -     * @param encoding { String } The BufferEncoding to use for the string (Defaults to instance level encoding).
    -     *
    -     * @return { String }
    -     */
    -    readStringNT(encoding?: BufferEncoding): string;
    -    /**
    -     * Inserts a null-terminated String.
    -     *
    -     * @param value { String } The String value to write.
    -     * @param arg2 { Number | String } The offset to write the string to, or the BufferEncoding to use.
    -     * @param encoding { String } The BufferEncoding to use for writing strings (defaults to instance encoding).
    -     *
    -     * @return this
    -     */
    -    insertStringNT(value: string, offset: number, encoding?: BufferEncoding): SmartBuffer;
    -    /**
    -     * Writes a null-terminated String.
    -     *
    -     * @param value { String } The String value to write.
    -     * @param arg2 { Number | String } The offset to write the string to, or the BufferEncoding to use.
    -     * @param encoding { String } The BufferEncoding to use for writing strings (defaults to instance encoding).
    -     *
    -     * @return this
    -     */
    -    writeStringNT(value: string, arg2?: number | BufferEncoding, encoding?: BufferEncoding): SmartBuffer;
    -    /**
    -     * Reads a Buffer from the internal read position.
    -     *
    -     * @param length { Number } The length of data to read as a Buffer.
    -     *
    -     * @return { Buffer }
    -     */
    -    readBuffer(length?: number): Buffer;
    -    /**
    -     * Writes a Buffer to the current write position.
    -     *
    -     * @param value { Buffer } The Buffer to write.
    -     * @param offset { Number } The offset to write the Buffer to.
    -     *
    -     * @return this
    -     */
    -    insertBuffer(value: Buffer, offset: number): SmartBuffer;
    -    /**
    -     * Writes a Buffer to the current write position.
    -     *
    -     * @param value { Buffer } The Buffer to write.
    -     * @param offset { Number } The offset to write the Buffer to.
    -     *
    -     * @return this
    -     */
    -    writeBuffer(value: Buffer, offset?: number): SmartBuffer;
    -    /**
    -     * Reads a null-terminated Buffer from the current read poisiton.
    -     *
    -     * @return { Buffer }
    -     */
    -    readBufferNT(): Buffer;
    -    /**
    -     * Inserts a null-terminated Buffer.
    -     *
    -     * @param value { Buffer } The Buffer to write.
    -     * @param offset { Number } The offset to write the Buffer to.
    -     *
    -     * @return this
    -     */
    -    insertBufferNT(value: Buffer, offset: number): SmartBuffer;
    -    /**
    -     * Writes a null-terminated Buffer.
    -     *
    -     * @param value { Buffer } The Buffer to write.
    -     * @param offset { Number } The offset to write the Buffer to.
    -     *
    -     * @return this
    -     */
    -    writeBufferNT(value: Buffer, offset?: number): SmartBuffer;
    -    /**
    -     * Clears the SmartBuffer instance to its original empty state.
    -     */
    -    clear(): SmartBuffer;
    -    /**
    -     * Gets the remaining data left to be read from the SmartBuffer instance.
    -     *
    -     * @return { Number }
    -     */
    -    remaining(): number;
    -    /**
    -     * Gets the current read offset value of the SmartBuffer instance.
    -     *
    -     * @return { Number }
    -     */
    -    /**
    -    * Sets the read offset value of the SmartBuffer instance.
    -    *
    -    * @param offset { Number } - The offset value to set.
    -    */
    -    readOffset: number;
    -    /**
    -     * Gets the current write offset value of the SmartBuffer instance.
    -     *
    -     * @return { Number }
    -     */
    -    /**
    -    * Sets the write offset value of the SmartBuffer instance.
    -    *
    -    * @param offset { Number } - The offset value to set.
    -    */
    -    writeOffset: number;
    -    /**
    -     * Gets the currently set string encoding of the SmartBuffer instance.
    -     *
    -     * @return { BufferEncoding } The string Buffer encoding currently set.
    -     */
    -    /**
    -    * Sets the string encoding of the SmartBuffer instance.
    -    *
    -    * @param encoding { BufferEncoding } The string Buffer encoding to set.
    -    */
    -    encoding: BufferEncoding;
    -    /**
    -     * Gets the underlying internal Buffer. (This includes unmanaged data in the Buffer)
    -     *
    -     * @return { Buffer } The Buffer value.
    -     */
    -    readonly internalBuffer: Buffer;
    -    /**
    -     * Gets the value of the internal managed Buffer (Includes managed data only)
    -     *
    -     * @param { Buffer }
    -     */
    -    toBuffer(): Buffer;
    -    /**
    -     * Gets the String value of the internal managed Buffer
    -     *
    -     * @param encoding { String } The BufferEncoding to display the Buffer as (defaults to instance level encoding).
    -     */
    -    toString(encoding?: BufferEncoding): string;
    -    /**
    -     * Destroys the SmartBuffer instance.
    -     */
    -    destroy(): SmartBuffer;
    -    /**
    -     * Handles inserting and writing strings.
    -     *
    -     * @param value { String } The String value to insert.
    -     * @param isInsert { Boolean } True if inserting a string, false if writing.
    -     * @param arg2 { Number | String } The offset to insert the string at, or the BufferEncoding to use.
    -     * @param encoding { String } The BufferEncoding to use for writing strings (defaults to instance encoding).
    -     */
    -    private _handleString;
    -    /**
    -     * Handles writing or insert of a Buffer.
    -     *
    -     * @param value { Buffer } The Buffer to write.
    -     * @param offset { Number } The offset to write the Buffer to.
    -     */
    -    private _handleBuffer;
    -    /**
    -     * Ensures that the internal Buffer is large enough to read data.
    -     *
    -     * @param length { Number } The length of the data that needs to be read.
    -     * @param offset { Number } The offset of the data that needs to be read.
    -     */
    -    private ensureReadable;
    -    /**
    -     * Ensures that the internal Buffer is large enough to insert data.
    -     *
    -     * @param dataLength { Number } The length of the data that needs to be written.
    -     * @param offset { Number } The offset of the data to be written.
    -     */
    -    private ensureInsertable;
    -    /**
    -     * Ensures that the internal Buffer is large enough to write data.
    -     *
    -     * @param dataLength { Number } The length of the data that needs to be written.
    -     * @param offset { Number } The offset of the data to be written (defaults to writeOffset).
    -     */
    -    private _ensureWriteable;
    -    /**
    -     * Ensures that the internal Buffer is large enough to write at least the given amount of data.
    -     *
    -     * @param minLength { Number } The minimum length of the data needs to be written.
    -     */
    -    private _ensureCapacity;
    -    /**
    -     * Reads a numeric number value using the provided function.
    -     *
    -     * @typeparam T { number | bigint } The type of the value to be read
    -     *
    -     * @param func { Function(offset: number) => number } The function to read data on the internal Buffer with.
    -     * @param byteSize { Number } The number of bytes read.
    -     * @param offset { Number } The offset to read from (optional). When this is not provided, the managed readOffset is used instead.
    -     *
    -     * @returns { T } the number value
    -     */
    -    private _readNumberValue;
    -    /**
    -     * Inserts a numeric number value based on the given offset and value.
    -     *
    -     * @typeparam T { number | bigint } The type of the value to be written
    -     *
    -     * @param func { Function(offset: T, offset?) => number} The function to write data on the internal Buffer with.
    -     * @param byteSize { Number } The number of bytes written.
    -     * @param value { T } The number value to write.
    -     * @param offset { Number } the offset to write the number at (REQUIRED).
    -     *
    -     * @returns SmartBuffer this buffer
    -     */
    -    private _insertNumberValue;
    -    /**
    -     * Writes a numeric number value based on the given offset and value.
    -     *
    -     * @typeparam T { number | bigint } The type of the value to be written
    -     *
    -     * @param func { Function(offset: T, offset?) => number} The function to write data on the internal Buffer with.
    -     * @param byteSize { Number } The number of bytes written.
    -     * @param value { T } The number value to write.
    -     * @param offset { Number } the offset to write the number at (REQUIRED).
    -     *
    -     * @returns SmartBuffer this buffer
    -     */
    -    private _writeNumberValue;
    -}
    -export { SmartBufferOptions, SmartBuffer };
    diff --git a/deps/npm/node_modules/smart-buffer/typings/utils.d.ts b/deps/npm/node_modules/smart-buffer/typings/utils.d.ts
    deleted file mode 100644
    index b32b4d44c04c1d..00000000000000
    --- a/deps/npm/node_modules/smart-buffer/typings/utils.d.ts
    +++ /dev/null
    @@ -1,66 +0,0 @@
    -/// 
    -import { SmartBuffer } from './smartbuffer';
    -import { Buffer } from 'buffer';
    -/**
    - * Error strings
    - */
    -declare const ERRORS: {
    -    INVALID_ENCODING: string;
    -    INVALID_SMARTBUFFER_SIZE: string;
    -    INVALID_SMARTBUFFER_BUFFER: string;
    -    INVALID_SMARTBUFFER_OBJECT: string;
    -    INVALID_OFFSET: string;
    -    INVALID_OFFSET_NON_NUMBER: string;
    -    INVALID_LENGTH: string;
    -    INVALID_LENGTH_NON_NUMBER: string;
    -    INVALID_TARGET_OFFSET: string;
    -    INVALID_TARGET_LENGTH: string;
    -    INVALID_READ_BEYOND_BOUNDS: string;
    -    INVALID_WRITE_BEYOND_BOUNDS: string;
    -};
    -/**
    - * Checks if a given encoding is a valid Buffer encoding. (Throws an exception if check fails)
    - *
    - * @param { String } encoding The encoding string to check.
    - */
    -declare function checkEncoding(encoding: BufferEncoding): void;
    -/**
    - * Checks if a given number is a finite integer. (Throws an exception if check fails)
    - *
    - * @param { Number } value The number value to check.
    - */
    -declare function isFiniteInteger(value: number): boolean;
    -/**
    - * Checks if a length value is valid. (Throws an exception if check fails)
    - *
    - * @param { Number } length The value to check.
    - */
    -declare function checkLengthValue(length: any): void;
    -/**
    - * Checks if a offset value is valid. (Throws an exception if check fails)
    - *
    - * @param { Number } offset The value to check.
    - */
    -declare function checkOffsetValue(offset: any): void;
    -/**
    - * Checks if a target offset value is out of bounds. (Throws an exception if check fails)
    - *
    - * @param { Number } offset The offset value to check.
    - * @param { SmartBuffer } buff The SmartBuffer instance to check against.
    - */
    -declare function checkTargetOffset(offset: number, buff: SmartBuffer): void;
    -interface Buffer {
    -    readBigInt64BE(offset?: number): bigint;
    -    readBigInt64LE(offset?: number): bigint;
    -    readBigUInt64BE(offset?: number): bigint;
    -    readBigUInt64LE(offset?: number): bigint;
    -    writeBigInt64BE(value: bigint, offset?: number): number;
    -    writeBigInt64LE(value: bigint, offset?: number): number;
    -    writeBigUInt64BE(value: bigint, offset?: number): number;
    -    writeBigUInt64LE(value: bigint, offset?: number): number;
    -}
    -/**
    - * Throws if Node.js version is too low to support bigint
    - */
    -declare function bigIntAndBufferInt64Check(bufferMethod: keyof Buffer): void;
    -export { ERRORS, isFiniteInteger, checkEncoding, checkOffsetValue, checkLengthValue, checkTargetOffset, bigIntAndBufferInt64Check };
    diff --git a/deps/npm/node_modules/socks-proxy-agent/dist/index.d.ts b/deps/npm/node_modules/socks-proxy-agent/dist/index.d.ts
    deleted file mode 100644
    index 4de33b1252a18c..00000000000000
    --- a/deps/npm/node_modules/socks-proxy-agent/dist/index.d.ts
    +++ /dev/null
    @@ -1,33 +0,0 @@
    -/// 
    -import { SocksProxy } from 'socks';
    -import { Agent, ClientRequest, RequestOptions } from 'agent-base';
    -import { AgentOptions } from 'agent-base';
    -import { Url } from 'url';
    -import net from 'net';
    -import tls from 'tls';
    -interface BaseSocksProxyAgentOptions {
    -    host?: string | null;
    -    port?: string | number | null;
    -    username?: string | null;
    -    tls?: tls.ConnectionOptions | null;
    -}
    -interface SocksProxyAgentOptionsExtra {
    -    timeout?: number;
    -}
    -export interface SocksProxyAgentOptions extends AgentOptions, BaseSocksProxyAgentOptions, Partial> {
    -}
    -export declare class SocksProxyAgent extends Agent {
    -    private readonly shouldLookup;
    -    private readonly proxy;
    -    private readonly tlsConnectionOptions;
    -    timeout: number | null;
    -    constructor(input: string | SocksProxyAgentOptions, options?: SocksProxyAgentOptionsExtra);
    -    /**
    -     * Initiates a SOCKS connection to the specified SOCKS proxy server,
    -     * which in turn connects to the specified remote host and port.
    -     *
    -     * @api protected
    -     */
    -    callback(req: ClientRequest, opts: RequestOptions): Promise;
    -}
    -export {};
    diff --git a/deps/npm/node_modules/socks-proxy-agent/dist/index.js.map b/deps/npm/node_modules/socks-proxy-agent/dist/index.js.map
    deleted file mode 100644
    index e183e8e7a13ce0..00000000000000
    --- a/deps/npm/node_modules/socks-proxy-agent/dist/index.js.map
    +++ /dev/null
    @@ -1 +0,0 @@
    -{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,iCAAmE;AACnE,2CAAiE;AAEjE,kDAA+B;AAE/B,8CAAqB;AAErB,8CAAqB;AAarB,MAAM,KAAK,GAAG,IAAA,eAAW,EAAC,mBAAmB,CAAC,CAAA;AAE9C,SAAS,eAAe,CAAE,IAA4B;;IACpD,IAAI,IAAI,GAAG,CAAC,CAAA;IACZ,IAAI,MAAM,GAAG,KAAK,CAAA;IAClB,IAAI,IAAI,GAAuB,CAAC,CAAA;IAEhC,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAA;IAE1B,IAAI,IAAI,IAAI,IAAI,EAAE;QAChB,MAAM,IAAI,SAAS,CAAC,WAAW,CAAC,CAAA;KACjC;IAED,IAAI,OAAO,IAAI,CAAC,IAAI,KAAK,QAAQ,EAAE;QACjC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAA;KACjB;SAAM,IAAI,OAAO,IAAI,CAAC,IAAI,KAAK,QAAQ,EAAE;QACxC,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,CAAC,CAAA;KAC/B;IAED,0EAA0E;IAC1E,iEAAiE;IACjE,IAAI,IAAI,IAAI,IAAI,EAAE;QAChB,IAAI,GAAG,IAAI,CAAA;K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QAAQ,CAAC,GAAG,CAAC,EAAE;YACvB,GAAG,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,CAAA;SACpB;KACF;IACD,OAAO,GAAG,CAAA;AACZ,CAAC"}
    \ No newline at end of file
    diff --git a/deps/npm/node_modules/socks/build/client/socksclient.js.map b/deps/npm/node_modules/socks/build/client/socksclient.js.map
    deleted file mode 100644
    index f01f317e651bd2..00000000000000
    --- a/deps/npm/node_modules/socks/build/client/socksclient.js.map
    +++ /dev/null
    @@ -1 +0,0 @@
    -{"version":3,"file":"socksclient.js","sourceRoot":"","sources":["../../src/client/socksclient.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mCAAoC;AACpC,2BAA2B;AAC3B,yBAAyB;AACzB,+CAAyC;AACzC,mDAkB6B;AAC7B,+CAG2B;AAC3B,2DAAsD;AACtD,yCAA8D;AAw7B5D,iGAx7BM,uBAAgB,OAw7BN;AA95BlB,MAAM,WAAY,SAAQ,qBAAY;IAgBpC,YAAY,OAA2B;QACrC,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,OAAO,qBACP,OAAO,CACX,CAAC;QAEF,8BAA8B;QAC9B,IAAA,oCAA0B,EAAC,OAAO,CAAC,CAAC;QAEpC,gBAAgB;QAChB,IAAI,CAAC,QAAQ,CAAC,4BAAgB,CAAC,OAAO,CAAC,CAAC;IAC1C,CAAC;IAED;;;;;;;OAOG;IACH,MAAM,CAAC,gBAAgB,CACrB,OAA2B,EAC3B,QAGS;QAET,OAAO,IAAI,OAAO,CAA8B,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YAClE,8BAA8B;YAC9B,IAAI;gBACF,IAAA,oCAA0B,EAAC,OAAO,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;aAClD;YAAC,OAAO,GAAG,EAAE;gBACZ,IAAI,OAAO,QAAQ,KAAK,UAAU,EAAE;oBAClC,QAAQ,CAAC,GAAG,CAAC,CAAC;oBACd,8DAA8D;oBAC9D,OAAO,OA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J,CAAC;CACF;AAGC,kCAAW"}
    \ No newline at end of file
    diff --git a/deps/npm/node_modules/socks/build/common/constants.js.map b/deps/npm/node_modules/socks/build/common/constants.js.map
    deleted file mode 100644
    index c1e070dea4ac3c..00000000000000
    --- a/deps/npm/node_modules/socks/build/common/constants.js.map
    +++ /dev/null
    @@ -1 +0,0 @@
    -{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/common/constants.ts"],"names":[],"mappings":";;;AAIA,MAAM,eAAe,GAAG,KAAK,CAAC;AA4M5B,0CAAe;AAxMjB,kBAAkB;AAClB,MAAM,MAAM,GAAG;IACb,mBAAmB,EAAE,wFAAwF;IAC7G,+BAA+B,EAAE,oGAAoG;IACrI,wBAAwB,EAAE,8FAA8F;IACxH,oCAAoC,EAAE,2CAA2C;IACjF,uCAAuC,EAAE,uFAAuF;IAChI,8BAA8B,EAAE,4CAA4C;IAC5E,gCAAgC,EAAE,8EAA8E;IAChH,sCAAsC,EAAE,2DAA2D;IACnG,wCAAwC,EAAE,oDAAoD;IAC9F,0CAA0C,EAAE,kKAAkK;IAC9M,gBAAgB,EAAE,mBAAmB;IACrC,YAAY,EAAE,eAAe;IAC7B,uBAAuB,EAAE,4BAA4B;IACrD,aAAa,EAAE,qDAAqD;IACpE,8BAA8B,EAAE,4CAA4C;IAC5E,6BAA6B,EAAE,kCAAkC;IACjE,uCAAuC,EAAE,6CAA6C;IACtF,0CAA0C,EAAE,iDAAiD;IAC7F,qCAAqC,EAAE,oDAAoD;IAC3F,yCAAyC,EAAE,mEAAmE;IAC9G,+CAA+C,EAAE,6EAA6E;IAC9H,4CAA4C,EAAE,yEAAyE;IACvH,0BAA0B,EAAE,8BAA8B;IAC1D,2BAA2B,EAAE,kDAAkD;IAC/E,mCAAmC,EAAE,kCAAkC;IACvE,uCAAuC,EAAE,sDAAsD;IAC/F,0CAA0C,EAAE,iDAAiD;CAC9F,CAAC;AA4KA,wBAAM;AA1KR,MAAM,2BAA2B,GAAG;IAClC,8BAA8B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;AAJD,WAAK,cAAc;IACjB,mDAAW,CAAA;IACX,2DAAe,CAAA;IACf,mDAAW,CAAA;AACb,CAAC,EAJI,cAAc,KAAd,cAAc,QAIlB;AAyHC,wCAAc;AAvHhB,IAAK,gBAcJ;AAdD,WAAK,gBAAgB;IACnB,6DAAW,CAAA;IACX,mEAAc,CAAA;IACd,iEAAa,CAAA;IACb,uFAAwB,CAAA;IACxB,+GAAoC,CAAA;IACpC,mFAAsB,CAAA;IACtB,2GAAkC,CAAA;IAClC,mFAAsB,CAAA;IACtB,yFAAyB,CAAA;IACzB,iGAA6B,CAAA;IAC7B,sEAAgB,CAAA;IAChB,wEAAiB,CAAA;IACjB,0DAAU,CAAA;AACZ,CAAC,EAdI,gBAAgB,KAAhB,gBAAgB,QAcpB;AA2GC,4CAAgB"}
    \ No newline at end of file
    diff --git a/deps/npm/node_modules/socks/build/common/helpers.js.map b/deps/npm/node_modules/socks/build/common/helpers.js.map
    deleted file mode 100644
    index dae124861aa90f..00000000000000
    --- a/deps/npm/node_modules/socks/build/common/helpers.js.map
    +++ /dev/null
    @@ -1 +0,0 @@
    -{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/common/helpers.ts"],"names":[],"mappings":";;;AAKA,iCAAwC;AACxC,2CAMqB;AACrB,iCAAiC;AAEjC;;;;GAIG;AACH,SAAS,0BAA0B,CACjC,OAA2B,EAC3B,gBAAgB,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,CAAC;IAEnD,8BAA8B;IAC9B,IAAI,CAAC,wBAAY,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;QAClC,MAAM,IAAI,uBAAgB,CAAC,kBAAM,CAAC,mBAAmB,EAAE,OAAO,CAAC,CAAC;KACjE;IAED,6CAA6C;IAC7C,IAAI,gBAAgB,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE;QACpD,MAAM,IAAI,uBAAgB,CAAC,kBAAM,CAAC,+BAA+B,E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AAK,CAAC,yBAAyB,KAAK,SAAS,EAAE;YACjD,MAAM,IAAI,uBAAgB,CACxB,kBAAM,CAAC,0CAA0C,EACjD,OAAO,CACR,CAAC;SACH;QAED,+CAA+C;QAC/C,IACE,KAAK,CAAC,4BAA4B,KAAK,SAAS;YAChD,OAAO,KAAK,CAAC,4BAA4B,KAAK,UAAU,EACxD;YACA,MAAM,IAAI,uBAAgB,CACxB,kBAAM,CAAC,0CAA0C,EACjD,OAAO,CACR,CAAC;SACH;KACF;AACH,CAAC;AAED;;;GAGG;AACH,SAAS,sBAAsB,CAAC,UAA2B;IACzD,OAAO,CACL,UAAU;QACV,OAAO,UAAU,CAAC,IAAI,KAAK,QAAQ;QACnC,OAAO,UAAU,CAAC,IAAI,KAAK,QAAQ;QACnC,UAAU,CAAC,IAAI,IAAI,CAAC;QACpB,UAAU,CAAC,IAAI,IAAI,KAAK,CACzB,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,SAAS,iBAAiB,CAAC,KAAiB;IAC1C,OAAO,CACL,KAAK;QACL,CAAC,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ,IAAI,OAAO,KAAK,CAAC,SAAS,KAAK,QAAQ,CAAC;QACvE,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ;QAC9B,KAAK,CAAC,IAAI,IAAI,CAAC;QACf,KAAK,CAAC,IAAI,IAAI,KAAK;QACnB,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,IAAI,KAAK,CAAC,IAAI,KAAK,CAAC,CAAC,CACvC,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,SAAS,mBAAmB,CAAC,KAAa;IACxC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,GAAG,CAAC,CAAC;AAChD,CAAC"}
    \ No newline at end of file
    diff --git a/deps/npm/node_modules/socks/build/common/receivebuffer.js.map b/deps/npm/node_modules/socks/build/common/receivebuffer.js.map
    deleted file mode 100644
    index af5e2209016951..00000000000000
    --- a/deps/npm/node_modules/socks/build/common/receivebuffer.js.map
    +++ /dev/null
    @@ -1 +0,0 @@
    -{"version":3,"file":"receivebuffer.js","sourceRoot":"","sources":["../../src/common/receivebuffer.ts"],"names":[],"mappings":";;;AAAA,MAAM,aAAa;IAKjB,YAAY,IAAI,GAAG,IAAI;QACrB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QACvC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;QAChB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;IAC3B,CAAC;IAED,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED,MAAM,CAAC,IAAY;QACjB,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;YAC1B,MAAM,IAAI,KAAK,CACb,6DAA6D,CAC9D,CAAC;SACH;QAED,IAAI,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE;YACnD,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC;YACxB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,WAAW,CAC9B,IAAI,CAAC,GAAG,CACN,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,YAAY,EACtC,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CACjC,CACF,CAAC;YACF,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;SACvB;QAED,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;QACpC,OAAO,CAAC,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC,CAAC;IACtC,CAAC;IAED,IAAI,CAAC,MAAc;QACjB,IAAI,MAAM,GAAG,IAAI,CAAC,MAAM,EAAE;YACxB,MAAM,IAAI,KAAK,CACb,mEAAmE,CACpE,CAAC;SACH;QACD,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;IACtC,CAAC;IAED,GAAG,CAAC,MAAc;QAChB,IAAI,MAAM,GAAG,IAAI,CAAC,MAAM,EAAE;YACxB,MAAM,IAAI,KAAK,CACb,mEAAmE,CACpE,CAAC;SACH;QAED,MAAM,KAAK,GAAG,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;QACzC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACzC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;QACjE,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC;QAEtB,OAAO,KAAK,CAAC;IACf,CAAC;CACF;AAEO,sCAAa"}
    \ No newline at end of file
    diff --git a/deps/npm/node_modules/socks/build/common/util.js.map b/deps/npm/node_modules/socks/build/common/util.js.map
    deleted file mode 100644
    index f1993233d693d9..00000000000000
    --- a/deps/npm/node_modules/socks/build/common/util.js.map
    +++ /dev/null
    @@ -1 +0,0 @@
    -{"version":3,"file":"util.js","sourceRoot":"","sources":["../../src/common/util.ts"],"names":[],"mappings":";;;AAEA;;GAEG;AACH,MAAM,gBAAiB,SAAQ,KAAK;IAClC,YACE,OAAe,EACR,OAAqD;QAE5D,KAAK,CAAC,OAAO,CAAC,CAAC;QAFR,YAAO,GAAP,OAAO,CAA8C;IAG9D,CAAC;CACF;AAuBuB,4CAAgB;AArBxC;;;GAGG;AACH,SAAS,YAAY,CAAC,KAAgB;IACpC,KAAK,IAAI,CAAC,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;QACzC,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAC9C,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;KAC7C;AACH,CAAC;AAYyC,oCAAY"}
    \ No newline at end of file
    diff --git a/deps/npm/node_modules/socks/build/index.js.map b/deps/npm/node_modules/socks/build/index.js.map
    deleted file mode 100644
    index 0e2bcb27b8ba12..00000000000000
    --- a/deps/npm/node_modules/socks/build/index.js.map
    +++ /dev/null
    @@ -1 +0,0 @@
    -{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAqC"}
    \ No newline at end of file
    diff --git a/deps/npm/node_modules/socks/typings/client/socksclient.d.ts b/deps/npm/node_modules/socks/typings/client/socksclient.d.ts
    deleted file mode 100644
    index b886d95710b31c..00000000000000
    --- a/deps/npm/node_modules/socks/typings/client/socksclient.d.ts
    +++ /dev/null
    @@ -1,162 +0,0 @@
    -/// 
    -/// 
    -/// 
    -import { EventEmitter } from 'events';
    -import { SocksClientOptions, SocksClientChainOptions, SocksRemoteHost, SocksProxy, SocksClientBoundEvent, SocksClientEstablishedEvent, SocksUDPFrameDetails } from '../common/constants';
    -import { SocksClientError } from '../common/util';
    -import { Duplex } from 'stream';
    -declare interface SocksClient {
    -    on(event: 'error', listener: (err: SocksClientError) => void): this;
    -    on(event: 'bound', listener: (info: SocksClientBoundEvent) => void): this;
    -    on(event: 'established', listener: (info: SocksClientEstablishedEvent) => void): this;
    -    once(event: string, listener: (...args: unknown[]) => void): this;
    -    once(event: 'error', listener: (err: SocksClientError) => void): this;
    -    once(event: 'bound', listener: (info: SocksClientBoundEvent) => void): this;
    -    once(event: 'established', listener: (info: SocksClientEstablishedEvent) => void): this;
    -    emit(event: string | symbol, ...args: unknown[]): boolean;
    -    emit(event: 'error', err: SocksClientError): boolean;
    -    emit(event: 'bound', info: SocksClientBoundEvent): boolean;
    -    emit(event: 'established', info: SocksClientEstablishedEvent): boolean;
    -}
    -declare class SocksClient extends EventEmitter implements SocksClient {
    -    private options;
    -    private socket;
    -    private state;
    -    private receiveBuffer;
    -    private nextRequiredPacketBufferSize;
    -    private socks5ChosenAuthType;
    -    private onDataReceived;
    -    private onClose;
    -    private onError;
    -    private onConnect;
    -    constructor(options: SocksClientOptions);
    -    /**
    -     * Creates a new SOCKS connection.
    -     *
    -     * Note: Supports callbacks and promises. Only supports the connect command.
    -     * @param options { SocksClientOptions } Options.
    -     * @param callback { Function } An optional callback function.
    -     * @returns { Promise }
    -     */
    -    static createConnection(options: SocksClientOptions, callback?: (error: Error | null, info?: SocksClientEstablishedEvent) => void): Promise;
    -    /**
    -     * Creates a new SOCKS connection chain to a destination host through 2 or more SOCKS proxies.
    -     *
    -     * Note: Supports callbacks and promises. Only supports the connect method.
    -     * Note: Implemented via createConnection() factory function.
    -     * @param options { SocksClientChainOptions } Options
    -     * @param callback { Function } An optional callback function.
    -     * @returns { Promise }
    -     */
    -    static createConnectionChain(options: SocksClientChainOptions, callback?: (error: Error | null, socket?: SocksClientEstablishedEvent) => void): Promise;
    -    /**
    -     * Creates a SOCKS UDP Frame.
    -     * @param options
    -     */
    -    static createUDPFrame(options: SocksUDPFrameDetails): Buffer;
    -    /**
    -     * Parses a SOCKS UDP frame.
    -     * @param data
    -     */
    -    static parseUDPFrame(data: Buffer): SocksUDPFrameDetails;
    -    /**
    -     * Internal state setter. If the SocksClient is in an error state, it cannot be changed to a non error state.
    -     */
    -    private setState;
    -    /**
    -     * Starts the connection establishment to the proxy and destination.
    -     * @param existingSocket Connected socket to use instead of creating a new one (internal use).
    -     */
    -    connect(existingSocket?: Duplex): void;
    -    private getSocketOptions;
    -    /**
    -     * Handles internal Socks timeout callback.
    -     * Note: If the Socks client is not BoundWaitingForConnection or Established, the connection will be closed.
    -     */
    -    private onEstablishedTimeout;
    -    /**
    -     * Handles Socket connect event.
    -     */
    -    private onConnectHandler;
    -    /**
    -     * Handles Socket data event.
    -     * @param data
    -     */
    -    private onDataReceivedHandler;
    -    /**
    -     * Handles processing of the data we have received.
    -     */
    -    private processData;
    -    /**
    -     * Handles Socket close event.
    -     * @param had_error
    -     */
    -    private onCloseHandler;
    -    /**
    -     * Handles Socket error event.
    -     * @param err
    -     */
    -    private onErrorHandler;
    -    /**
    -     * Removes internal event listeners on the underlying Socket.
    -     */
    -    private removeInternalSocketHandlers;
    -    /**
    -     * Closes and destroys the underlying Socket. Emits an error event.
    -     * @param err { String } An error string to include in error event.
    -     */
    -    private closeSocket;
    -    /**
    -     * Sends initial Socks v4 handshake request.
    -     */
    -    private sendSocks4InitialHandshake;
    -    /**
    -     * Handles Socks v4 handshake response.
    -     * @param data
    -     */
    -    private handleSocks4FinalHandshakeResponse;
    -    /**
    -     * Handles Socks v4 incoming connection request (BIND)
    -     * @param data
    -     */
    -    private handleSocks4IncomingConnectionResponse;
    -    /**
    -     * Sends initial Socks v5 handshake request.
    -     */
    -    private sendSocks5InitialHandshake;
    -    /**
    -     * Handles initial Socks v5 handshake response.
    -     * @param data
    -     */
    -    private handleInitialSocks5HandshakeResponse;
    -    /**
    -     * Sends Socks v5 user & password auth handshake.
    -     *
    -     * Note: No auth and user/pass are currently supported.
    -     */
    -    private sendSocks5UserPassAuthentication;
    -    private sendSocks5CustomAuthentication;
    -    private handleSocks5CustomAuthHandshakeResponse;
    -    private handleSocks5AuthenticationNoAuthHandshakeResponse;
    -    private handleSocks5AuthenticationUserPassHandshakeResponse;
    -    /**
    -     * Handles Socks v5 auth handshake response.
    -     * @param data
    -     */
    -    private handleInitialSocks5AuthenticationHandshakeResponse;
    -    /**
    -     * Sends Socks v5 final handshake request.
    -     */
    -    private sendSocks5CommandRequest;
    -    /**
    -     * Handles Socks v5 final handshake response.
    -     * @param data
    -     */
    -    private handleSocks5FinalHandshakeResponse;
    -    /**
    -     * Handles Socks v5 incoming connection request (BIND).
    -     */
    -    private handleSocks5IncomingConnectionResponse;
    -    get socksClientOptions(): SocksClientOptions;
    -}
    -export { SocksClient, SocksClientOptions, SocksClientChainOptions, SocksClientError, SocksRemoteHost, SocksProxy, SocksUDPFrameDetails, };
    diff --git a/deps/npm/node_modules/socks/typings/common/constants.d.ts b/deps/npm/node_modules/socks/typings/common/constants.d.ts
    deleted file mode 100644
    index 32a57052835076..00000000000000
    --- a/deps/npm/node_modules/socks/typings/common/constants.d.ts
    +++ /dev/null
    @@ -1,152 +0,0 @@
    -/// 
    -/// 
    -/// 
    -import { Duplex } from 'stream';
    -import { Socket, SocketConnectOpts } from 'net';
    -import { RequireOnlyOne } from './util';
    -declare const DEFAULT_TIMEOUT = 30000;
    -declare type SocksProxyType = 4 | 5;
    -declare const ERRORS: {
    -    InvalidSocksCommand: string;
    -    InvalidSocksCommandForOperation: string;
    -    InvalidSocksCommandChain: string;
    -    InvalidSocksClientOptionsDestination: string;
    -    InvalidSocksClientOptionsExistingSocket: string;
    -    InvalidSocksClientOptionsProxy: string;
    -    InvalidSocksClientOptionsTimeout: string;
    -    InvalidSocksClientOptionsProxiesLength: string;
    -    InvalidSocksClientOptionsCustomAuthRange: string;
    -    InvalidSocksClientOptionsCustomAuthOptions: string;
    -    NegotiationError: string;
    -    SocketClosed: string;
    -    ProxyConnectionTimedOut: string;
    -    InternalError: string;
    -    InvalidSocks4HandshakeResponse: string;
    -    Socks4ProxyRejectedConnection: string;
    -    InvalidSocks4IncomingConnectionResponse: string;
    -    Socks4ProxyRejectedIncomingBoundConnection: string;
    -    InvalidSocks5InitialHandshakeResponse: string;
    -    InvalidSocks5IntiailHandshakeSocksVersion: string;
    -    InvalidSocks5InitialHandshakeNoAcceptedAuthType: string;
    -    InvalidSocks5InitialHandshakeUnknownAuthType: string;
    -    Socks5AuthenticationFailed: string;
    -    InvalidSocks5FinalHandshake: string;
    -    InvalidSocks5FinalHandshakeRejected: string;
    -    InvalidSocks5IncomingConnectionResponse: string;
    -    Socks5ProxyRejectedIncomingBoundConnection: string;
    -};
    -declare const SOCKS_INCOMING_PACKET_SIZES: {
    -    Socks5InitialHandshakeResponse: number;
    -    Socks5UserPassAuthenticationResponse: number;
    -    Socks5ResponseHeader: number;
    -    Socks5ResponseIPv4: number;
    -    Socks5ResponseIPv6: number;
    -    Socks5ResponseHostname: (hostNameLength: number) => number;
    -    Socks4Response: number;
    -};
    -declare type SocksCommandOption = 'connect' | 'bind' | 'associate';
    -declare enum SocksCommand {
    -    connect = 1,
    -    bind = 2,
    -    associate = 3
    -}
    -declare enum Socks4Response {
    -    Granted = 90,
    -    Failed = 91,
    -    Rejected = 92,
    -    RejectedIdent = 93
    -}
    -declare enum Socks5Auth {
    -    NoAuth = 0,
    -    GSSApi = 1,
    -    UserPass = 2
    -}
    -declare const SOCKS5_CUSTOM_AUTH_START = 128;
    -declare const SOCKS5_CUSTOM_AUTH_END = 254;
    -declare const SOCKS5_NO_ACCEPTABLE_AUTH = 255;
    -declare enum Socks5Response {
    -    Granted = 0,
    -    Failure = 1,
    -    NotAllowed = 2,
    -    NetworkUnreachable = 3,
    -    HostUnreachable = 4,
    -    ConnectionRefused = 5,
    -    TTLExpired = 6,
    -    CommandNotSupported = 7,
    -    AddressNotSupported = 8
    -}
    -declare enum Socks5HostType {
    -    IPv4 = 1,
    -    Hostname = 3,
    -    IPv6 = 4
    -}
    -declare enum SocksClientState {
    -    Created = 0,
    -    Connecting = 1,
    -    Connected = 2,
    -    SentInitialHandshake = 3,
    -    ReceivedInitialHandshakeResponse = 4,
    -    SentAuthentication = 5,
    -    ReceivedAuthenticationResponse = 6,
    -    SentFinalHandshake = 7,
    -    ReceivedFinalResponse = 8,
    -    BoundWaitingForConnection = 9,
    -    Established = 10,
    -    Disconnected = 11,
    -    Error = 99
    -}
    -/**
    - * Represents a SocksProxy
    - */
    -declare type SocksProxy = RequireOnlyOne<{
    -    ipaddress?: string;
    -    host?: string;
    -    port: number;
    -    type: SocksProxyType;
    -    userId?: string;
    -    password?: string;
    -    custom_auth_method?: number;
    -    custom_auth_request_handler?: () => Promise;
    -    custom_auth_response_size?: number;
    -    custom_auth_response_handler?: (data: Buffer) => Promise;
    -}, 'host' | 'ipaddress'>;
    -/**
    - * Represents a remote host
    - */
    -interface SocksRemoteHost {
    -    host: string;
    -    port: number;
    -}
    -/**
    - * SocksClient connection options.
    - */
    -interface SocksClientOptions {
    -    command: SocksCommandOption;
    -    destination: SocksRemoteHost;
    -    proxy: SocksProxy;
    -    timeout?: number;
    -    existing_socket?: Duplex;
    -    set_tcp_nodelay?: boolean;
    -    socket_options?: SocketConnectOpts;
    -}
    -/**
    - * SocksClient chain connection options.
    - */
    -interface SocksClientChainOptions {
    -    command: 'connect';
    -    destination: SocksRemoteHost;
    -    proxies: SocksProxy[];
    -    timeout?: number;
    -    randomizeChain?: false;
    -}
    -interface SocksClientEstablishedEvent {
    -    socket: Socket;
    -    remoteHost?: SocksRemoteHost;
    -}
    -declare type SocksClientBoundEvent = SocksClientEstablishedEvent;
    -interface SocksUDPFrameDetails {
    -    frameNumber?: number;
    -    remoteHost: SocksRemoteHost;
    -    data: Buffer;
    -}
    -export { DEFAULT_TIMEOUT, ERRORS, SocksProxyType, SocksCommand, Socks4Response, Socks5Auth, Socks5HostType, Socks5Response, SocksClientState, SocksProxy, SocksRemoteHost, SocksCommandOption, SocksClientOptions, SocksClientChainOptions, SocksClientEstablishedEvent, SocksClientBoundEvent, SocksUDPFrameDetails, SOCKS_INCOMING_PACKET_SIZES, SOCKS5_CUSTOM_AUTH_START, SOCKS5_CUSTOM_AUTH_END, SOCKS5_NO_ACCEPTABLE_AUTH, };
    diff --git a/deps/npm/node_modules/socks/typings/common/helpers.d.ts b/deps/npm/node_modules/socks/typings/common/helpers.d.ts
    deleted file mode 100644
    index 8c3a106979df17..00000000000000
    --- a/deps/npm/node_modules/socks/typings/common/helpers.d.ts
    +++ /dev/null
    @@ -1,13 +0,0 @@
    -import { SocksClientOptions, SocksClientChainOptions } from '../client/socksclient';
    -/**
    - * Validates the provided SocksClientOptions
    - * @param options { SocksClientOptions }
    - * @param acceptedCommands { string[] } A list of accepted SocksProxy commands.
    - */
    -declare function validateSocksClientOptions(options: SocksClientOptions, acceptedCommands?: string[]): void;
    -/**
    - * Validates the SocksClientChainOptions
    - * @param options { SocksClientChainOptions }
    - */
    -declare function validateSocksClientChainOptions(options: SocksClientChainOptions): void;
    -export { validateSocksClientOptions, validateSocksClientChainOptions };
    diff --git a/deps/npm/node_modules/socks/typings/common/receivebuffer.d.ts b/deps/npm/node_modules/socks/typings/common/receivebuffer.d.ts
    deleted file mode 100644
    index 756e98b5893ed8..00000000000000
    --- a/deps/npm/node_modules/socks/typings/common/receivebuffer.d.ts
    +++ /dev/null
    @@ -1,12 +0,0 @@
    -/// 
    -declare class ReceiveBuffer {
    -    private buffer;
    -    private offset;
    -    private originalSize;
    -    constructor(size?: number);
    -    get length(): number;
    -    append(data: Buffer): number;
    -    peek(length: number): Buffer;
    -    get(length: number): Buffer;
    -}
    -export { ReceiveBuffer };
    diff --git a/deps/npm/node_modules/socks/typings/common/util.d.ts b/deps/npm/node_modules/socks/typings/common/util.d.ts
    deleted file mode 100644
    index 83f20e7b5978e8..00000000000000
    --- a/deps/npm/node_modules/socks/typings/common/util.d.ts
    +++ /dev/null
    @@ -1,17 +0,0 @@
    -import { SocksClientOptions, SocksClientChainOptions } from './constants';
    -/**
    - * Error wrapper for SocksClient
    - */
    -declare class SocksClientError extends Error {
    -    options: SocksClientOptions | SocksClientChainOptions;
    -    constructor(message: string, options: SocksClientOptions | SocksClientChainOptions);
    -}
    -/**
    - * Shuffles a given array.
    - * @param array The array to shuffle.
    - */
    -declare function shuffleArray(array: unknown[]): void;
    -declare type RequireOnlyOne = Pick> & {
    -    [K in Keys]?: Required> & Partial, undefined>>;
    -}[Keys];
    -export { RequireOnlyOne, SocksClientError, shuffleArray };
    diff --git a/deps/npm/node_modules/socks/typings/index.d.ts b/deps/npm/node_modules/socks/typings/index.d.ts
    deleted file mode 100644
    index fbf9006ef1d3de..00000000000000
    --- a/deps/npm/node_modules/socks/typings/index.d.ts
    +++ /dev/null
    @@ -1 +0,0 @@
    -export * from './client/socksclient';
    diff --git a/deps/npm/node_modules/spdx-correct/index.js b/deps/npm/node_modules/spdx-correct/index.js
    index c51a79f5d1c80a..4d9037e0cc4355 100644
    --- a/deps/npm/node_modules/spdx-correct/index.js
    +++ b/deps/npm/node_modules/spdx-correct/index.js
    @@ -25,6 +25,18 @@ function valid (string) {
       }
     }
     
    +// Sorting function that orders the given array of transpositions such
    +// that a transposition with the longer pattern comes before a transposition
    +// with a shorter pattern. This is to prevent e.g. the transposition
    +// ["General Public License", "GPL"] from matching to "Lesser General Public License"
    +// before a longer and more accurate transposition ["Lesser General Public License", "LGPL"]
    +// has a chance to be recognized.
    +function sortTranspositions(a, b) {
    +  var length = b[0].length - a[0].length
    +  if (length !== 0) return length
    +  return a[0].toUpperCase().localeCompare(b[0].toUpperCase())
    +}
    +
     // Common transpositions of license identifier acronyms
     var transpositions = [
       ['APGL', 'AGPL'],
    @@ -41,8 +53,17 @@ var transpositions = [
       ['GUN', 'GPL'],
       ['+', ''],
       ['GNU GPL', 'GPL'],
    +  ['GNU LGPL', 'LGPL'],
       ['GNU/GPL', 'GPL'],
       ['GNU GLP', 'GPL'],
    +  ['GNU LESSER GENERAL PUBLIC LICENSE', 'LGPL'],
    +  ['GNU Lesser General Public License', 'LGPL'],
    +  ['GNU LESSER GENERAL PUBLIC LICENSE', 'LGPL-2.1'],
    +  ['GNU Lesser General Public License', 'LGPL-2.1'],
    +  ['LESSER GENERAL PUBLIC LICENSE', 'LGPL'],
    +  ['Lesser General Public License', 'LGPL'],
    +  ['LESSER GENERAL PUBLIC LICENSE', 'LGPL-2.1'],
    +  ['Lesser General Public License', 'LGPL-2.1'],
       ['GNU General Public License', 'GPL'],
       ['Gnu public license', 'GPL'],
       ['GNU Public License', 'GPL'],
    @@ -51,8 +72,9 @@ var transpositions = [
       ['Mozilla Public License', 'MPL'],
       ['Universal Permissive License', 'UPL'],
       ['WTH', 'WTF'],
    +  ['WTFGPL', 'WTFPL'],
       ['-License', '']
    -]
    +].sort(sortTranspositions)
     
     var TRANSPOSED = 0
     var CORRECT = 1
    @@ -254,7 +276,7 @@ var lastResorts = [
       ['MPL', 'MPL-2.0'],
       ['X11', 'X11'],
       ['ZLIB', 'Zlib']
    -].concat(licensesWithOneVersion)
    +].concat(licensesWithOneVersion).sort(sortTranspositions)
     
     var SUBSTRING = 0
     var IDENTIFIER = 1
    diff --git a/deps/npm/node_modules/spdx-correct/package.json b/deps/npm/node_modules/spdx-correct/package.json
    index 35c68bdaa6c61a..d77615638be66d 100644
    --- a/deps/npm/node_modules/spdx-correct/package.json
    +++ b/deps/npm/node_modules/spdx-correct/package.json
    @@ -1,24 +1,17 @@
     {
       "name": "spdx-correct",
       "description": "correct invalid SPDX expressions",
    -  "version": "3.1.1",
    -  "author": "Kyle E. Mitchell  (https://kemitchell.com)",
    -  "contributors": [
    -    "Kyle E. Mitchell  (https://kemitchell.com)",
    -    "Christian Zommerfelds ",
    -    "Tal Einat ",
    -    "Dan Butvinik "
    -  ],
    +  "version": "3.2.0",
       "dependencies": {
         "spdx-expression-parse": "^3.0.0",
         "spdx-license-ids": "^3.0.0"
       },
       "devDependencies": {
    -    "defence-cli": "^2.0.1",
    +    "defence-cli": "^3.0.1",
         "replace-require-self": "^1.0.0",
    -    "standard": "^11.0.0",
    -    "standard-markdown": "^4.0.2",
    -    "tape": "^4.9.0"
    +    "standard": "^14.3.4",
    +    "standard-markdown": "^6.0.0",
    +    "tape": "^5.0.1"
       },
       "files": [
         "index.js"
    diff --git a/deps/npm/node_modules/spdx-license-ids/index.json b/deps/npm/node_modules/spdx-license-ids/index.json
    index fdd78fa0329faf..04c03126d98eb8 100644
    --- a/deps/npm/node_modules/spdx-license-ids/index.json
    +++ b/deps/npm/node_modules/spdx-license-ids/index.json
    @@ -23,6 +23,7 @@
     	"APSL-1.2",
     	"APSL-2.0",
     	"Abstyles",
    +	"AdaCore-doc",
     	"Adobe-2006",
     	"Adobe-Glyph",
     	"Afmparse",
    @@ -53,6 +54,10 @@
     	"BSD-4-Clause",
     	"BSD-4-Clause-Shortened",
     	"BSD-4-Clause-UC",
    +	"BSD-4.3RENO",
    +	"BSD-4.3TAHOE",
    +	"BSD-Advertising-Acknowledgement",
    +	"BSD-Attribution-HPND-disclaimer",
     	"BSD-Protection",
     	"BSD-Source-Code",
     	"BSL-1.0",
    @@ -63,9 +68,11 @@
     	"Beerware",
     	"BitTorrent-1.0",
     	"BitTorrent-1.1",
    +	"Bitstream-Charter",
     	"Bitstream-Vera",
     	"BlueOak-1.0.0",
     	"Borceux",
    +	"Brian-Gladman-3-Clause",
     	"C-UDA-1.0",
     	"CAL-1.0",
     	"CAL-1.0-Combined-Work-Exception",
    @@ -96,6 +103,7 @@
     	"CC-BY-NC-ND-4.0",
     	"CC-BY-NC-SA-1.0",
     	"CC-BY-NC-SA-2.0",
    +	"CC-BY-NC-SA-2.0-DE",
     	"CC-BY-NC-SA-2.0-FR",
     	"CC-BY-NC-SA-2.0-UK",
     	"CC-BY-NC-SA-2.5",
    @@ -137,6 +145,8 @@
     	"CERN-OHL-P-2.0",
     	"CERN-OHL-S-2.0",
     	"CERN-OHL-W-2.0",
    +	"CFITSIO",
    +	"CMU-Mach",
     	"CNRI-Jython",
     	"CNRI-Python",
     	"CNRI-Python-GPL-Compatible",
    @@ -147,8 +157,10 @@
     	"CUA-OPL-1.0",
     	"Caldera",
     	"ClArtistic",
    +	"Clips",
     	"Community-Spec-1.0",
     	"Condor-1.1",
    +	"Cornell-Lossless-JPEG",
     	"Crossword",
     	"CrystalStacker",
     	"Cube",
    @@ -177,6 +189,7 @@
     	"FSFAP",
     	"FSFUL",
     	"FSFULLR",
    +	"FSFULLRWD",
     	"FTL",
     	"Fair",
     	"Frameworx-1.0",
    @@ -212,14 +225,21 @@
     	"Giftware",
     	"Glide",
     	"Glulxe",
    +	"Graphics-Gems",
    +	"HP-1986",
     	"HPND",
    +	"HPND-Markus-Kuhn",
    +	"HPND-export-US",
     	"HPND-sell-variant",
    +	"HPND-sell-variant-MIT-disclaimer",
     	"HTMLTIDY",
     	"HaskellReport",
     	"Hippocratic-2.1",
     	"IBM-pibs",
     	"ICU",
    +	"IEC-Code-Components-EULA",
     	"IJG",
    +	"IJG-short",
     	"IPA",
     	"IPL-1.0",
     	"ISC",
    @@ -229,10 +249,13 @@
     	"Intel",
     	"Intel-ACPI",
     	"Interbase-1.0",
    +	"JPL-image",
     	"JPNIC",
     	"JSON",
     	"Jam",
     	"JasPer-2.0",
    +	"Kazlib",
    +	"Knuth-CTAN",
     	"LAL-1.2",
     	"LAL-1.3",
     	"LGPL-2.0-only",
    @@ -242,6 +265,7 @@
     	"LGPL-3.0-only",
     	"LGPL-3.0-or-later",
     	"LGPLLR",
    +	"LOOP",
     	"LPL-1.0",
     	"LPL-1.02",
     	"LPPL-1.0",
    @@ -263,6 +287,7 @@
     	"MIT-0",
     	"MIT-CMU",
     	"MIT-Modern-Variant",
    +	"MIT-Wu",
     	"MIT-advertising",
     	"MIT-enna",
     	"MIT-feh",
    @@ -277,6 +302,7 @@
     	"MS-RL",
     	"MTLL",
     	"MakeIndex",
    +	"Martin-Birgmeier",
     	"Minpack",
     	"MirOS",
     	"Motosoto",
    @@ -314,6 +340,7 @@
     	"OCLC-2.0",
     	"ODC-By-1.0",
     	"ODbL-1.0",
    +	"OFFIS",
     	"OFL-1.0",
     	"OFL-1.0-RFN",
     	"OFL-1.0-no-RFN",
    @@ -352,6 +379,7 @@
     	"OSL-2.0",
     	"OSL-2.1",
     	"OSL-3.0",
    +	"OpenPBS-2.3",
     	"OpenSSL",
     	"PDDL-1.0",
     	"PHP-3.0",
    @@ -366,6 +394,7 @@
     	"Python-2.0",
     	"Python-2.0.1",
     	"QPL-1.0",
    +	"QPL-1.0-INRIA-2004",
     	"Qhull",
     	"RHeCos-1.1",
     	"RPL-1.1",
    @@ -402,14 +431,20 @@
     	"Spencer-94",
     	"Spencer-99",
     	"SugarCRM-1.1.3",
    +	"SunPro",
    +	"Symlinks",
     	"TAPR-OHL-1.0",
     	"TCL",
     	"TCP-wrappers",
     	"TMate",
     	"TORQUE-1.1",
     	"TOSL",
    +	"TPDL",
    +	"TPL-1.0",
    +	"TTWL",
     	"TU-Berlin-1.0",
     	"TU-Berlin-2.0",
    +	"UCAR",
     	"UCL-1.0",
     	"UPL-1.0",
     	"Unicode-DFS-2015",
    @@ -443,6 +478,7 @@
     	"Zlib",
     	"blessing",
     	"bzip2-1.0.6",
    +	"checkmk",
     	"copyleft-next-0.3.0",
     	"copyleft-next-0.3.1",
     	"curl",
    @@ -456,12 +492,16 @@
     	"libpng-2.0",
     	"libselinux-1.0",
     	"libtiff",
    +	"libutil-David-Nugent",
     	"mpi-permissive",
     	"mpich2",
     	"mplus",
     	"psfrag",
     	"psutils",
    +	"snprintf",
    +	"w3m",
     	"xinetd",
    +	"xlock",
     	"xpp",
     	"zlib-acknowledgement"
     ]
    diff --git a/deps/npm/node_modules/spdx-license-ids/package.json b/deps/npm/node_modules/spdx-license-ids/package.json
    index e3622fccaf7bc4..ea060776d9cf76 100644
    --- a/deps/npm/node_modules/spdx-license-ids/package.json
    +++ b/deps/npm/node_modules/spdx-license-ids/package.json
    @@ -1,6 +1,6 @@
     {
     	"name": "spdx-license-ids",
    -	"version": "3.0.12",
    +	"version": "3.0.13",
     	"description": "A list of SPDX license identifiers",
     	"repository": "jslicense/spdx-license-ids",
     	"author": "Shinnosuke Watanabe (https://github.com/shinnn)",
    diff --git a/deps/npm/node_modules/ssri/lib/index.js b/deps/npm/node_modules/ssri/lib/index.js
    index 222861a021bfd0..e1424316802d05 100644
    --- a/deps/npm/node_modules/ssri/lib/index.js
    +++ b/deps/npm/node_modules/ssri/lib/index.js
    @@ -3,7 +3,8 @@
     const crypto = require('crypto')
     const MiniPass = require('minipass')
     
    -const SPEC_ALGORITHMS = ['sha256', 'sha384', 'sha512']
    +const SPEC_ALGORITHMS = ['sha512', 'sha384', 'sha256']
    +const DEFAULT_ALGORITHMS = ['sha512']
     
     // TODO: this should really be a hardcoded list of algorithms we support,
     // rather than [a-z0-9].
    @@ -12,72 +13,50 @@ const SRI_REGEX = /^([a-z0-9]+)-([^?]+)([?\S*]*)$/
     const STRICT_SRI_REGEX = /^([a-z0-9]+)-([A-Za-z0-9+/=]{44,88})(\?[\x21-\x7E]*)?$/
     const VCHAR_REGEX = /^[\x21-\x7E]+$/
     
    -const defaultOpts = {
    -  algorithms: ['sha512'],
    -  error: false,
    -  options: [],
    -  pickAlgorithm: getPrioritizedHash,
    -  sep: ' ',
    -  single: false,
    -  strict: false,
    -}
    -
    -const ssriOpts = (opts = {}) => ({ ...defaultOpts, ...opts })
    -
    -const getOptString = options => !options || !options.length
    -  ? ''
    -  : `?${options.join('?')}`
    -
    -const _onEnd = Symbol('_onEnd')
    -const _getOptions = Symbol('_getOptions')
    -const _emittedSize = Symbol('_emittedSize')
    -const _emittedIntegrity = Symbol('_emittedIntegrity')
    -const _emittedVerified = Symbol('_emittedVerified')
    +const getOptString = options => options?.length ? `?${options.join('?')}` : ''
     
     class IntegrityStream extends MiniPass {
    +  #emittedIntegrity
    +  #emittedSize
    +  #emittedVerified
    +
       constructor (opts) {
         super()
         this.size = 0
         this.opts = opts
     
         // may be overridden later, but set now for class consistency
    -    this[_getOptions]()
    +    this.#getOptions()
     
         // options used for calculating stream.  can't be changed.
    -    const { algorithms = defaultOpts.algorithms } = opts
    +    const algorithms = opts?.algorithms || DEFAULT_ALGORITHMS
         this.algorithms = Array.from(
           new Set(algorithms.concat(this.algorithm ? [this.algorithm] : []))
         )
         this.hashes = this.algorithms.map(crypto.createHash)
       }
     
    -  [_getOptions] () {
    -    const {
    -      integrity,
    -      size,
    -      options,
    -    } = { ...defaultOpts, ...this.opts }
    -
    +  #getOptions () {
         // For verification
    -    this.sri = integrity ? parse(integrity, this.opts) : null
    -    this.expectedSize = size
    +    this.sri = this.opts?.integrity ? parse(this.opts?.integrity, this.opts) : null
    +    this.expectedSize = this.opts?.size
         this.goodSri = this.sri ? !!Object.keys(this.sri).length : false
         this.algorithm = this.goodSri ? this.sri.pickAlgorithm(this.opts) : null
         this.digests = this.goodSri ? this.sri[this.algorithm] : null
    -    this.optString = getOptString(options)
    +    this.optString = getOptString(this.opts?.options)
       }
     
       on (ev, handler) {
    -    if (ev === 'size' && this[_emittedSize]) {
    -      return handler(this[_emittedSize])
    +    if (ev === 'size' && this.#emittedSize) {
    +      return handler(this.#emittedSize)
         }
     
    -    if (ev === 'integrity' && this[_emittedIntegrity]) {
    -      return handler(this[_emittedIntegrity])
    +    if (ev === 'integrity' && this.#emittedIntegrity) {
    +      return handler(this.#emittedIntegrity)
         }
     
    -    if (ev === 'verified' && this[_emittedVerified]) {
    -      return handler(this[_emittedVerified])
    +    if (ev === 'verified' && this.#emittedVerified) {
    +      return handler(this.#emittedVerified)
         }
     
         return super.on(ev, handler)
    @@ -85,7 +64,7 @@ class IntegrityStream extends MiniPass {
     
       emit (ev, data) {
         if (ev === 'end') {
    -      this[_onEnd]()
    +      this.#onEnd()
         }
         return super.emit(ev, data)
       }
    @@ -96,9 +75,9 @@ class IntegrityStream extends MiniPass {
         return super.write(data)
       }
     
    -  [_onEnd] () {
    +  #onEnd () {
         if (!this.goodSri) {
    -      this[_getOptions]()
    +      this.#getOptions()
         }
         const newSri = parse(this.hashes.map((h, i) => {
           return `${this.algorithms[i]}-${h.digest('base64')}${this.optString}`
    @@ -123,12 +102,12 @@ class IntegrityStream extends MiniPass {
           err.sri = this.sri
           this.emit('error', err)
         } else {
    -      this[_emittedSize] = this.size
    +      this.#emittedSize = this.size
           this.emit('size', this.size)
    -      this[_emittedIntegrity] = newSri
    +      this.#emittedIntegrity = newSri
           this.emit('integrity', newSri)
           if (match) {
    -        this[_emittedVerified] = match
    +        this.#emittedVerified = match
             this.emit('verified', match)
           }
         }
    @@ -141,8 +120,7 @@ class Hash {
       }
     
       constructor (hash, opts) {
    -    opts = ssriOpts(opts)
    -    const strict = !!opts.strict
    +    const strict = opts?.strict
         this.source = hash.trim()
     
         // set default values so that we make V8 happy to
    @@ -161,7 +139,7 @@ class Hash {
         if (!match) {
           return
         }
    -    if (strict && !SPEC_ALGORITHMS.some(a => a === match[1])) {
    +    if (strict && !SPEC_ALGORITHMS.includes(match[1])) {
           return
         }
         this.algorithm = match[1]
    @@ -182,14 +160,13 @@ class Hash {
       }
     
       toString (opts) {
    -    opts = ssriOpts(opts)
    -    if (opts.strict) {
    +    if (opts?.strict) {
           // Strict mode enforces the standard as close to the foot of the
           // letter as it can.
           if (!(
             // The spec has very restricted productions for algorithms.
             // https://www.w3.org/TR/CSP2/#source-list-syntax
    -        SPEC_ALGORITHMS.some(x => x === this.algorithm) &&
    +        SPEC_ALGORITHMS.includes(this.algorithm) &&
             // Usually, if someone insists on using a "different" base64, we
             // leave it as-is, since there's multiple standards, and the
             // specified is not a URL-safe variant.
    @@ -203,11 +180,41 @@ class Hash {
             return ''
           }
         }
    -    const options = this.options && this.options.length
    -      ? `?${this.options.join('?')}`
    -      : ''
    -    return `${this.algorithm}-${this.digest}${options}`
    +    return `${this.algorithm}-${this.digest}${getOptString(this.options)}`
    +  }
    +}
    +
    +function integrityHashToString (toString, sep, opts, hashes) {
    +  const toStringIsNotEmpty = toString !== ''
    +
    +  let shouldAddFirstSep = false
    +  let complement = ''
    +
    +  const lastIndex = hashes.length - 1
    +
    +  for (let i = 0; i < lastIndex; i++) {
    +    const hashString = Hash.prototype.toString.call(hashes[i], opts)
    +
    +    if (hashString) {
    +      shouldAddFirstSep = true
    +
    +      complement += hashString
    +      complement += sep
    +    }
    +  }
    +
    +  const finalHashString = Hash.prototype.toString.call(hashes[lastIndex], opts)
    +
    +  if (finalHashString) {
    +    shouldAddFirstSep = true
    +    complement += finalHashString
       }
    +
    +  if (toStringIsNotEmpty && shouldAddFirstSep) {
    +    return toString + sep + complement
    +  }
    +
    +  return toString + complement
     }
     
     class Integrity {
    @@ -224,21 +231,28 @@ class Integrity {
       }
     
       toString (opts) {
    -    opts = ssriOpts(opts)
    -    let sep = opts.sep || ' '
    -    if (opts.strict) {
    +    let sep = opts?.sep || ' '
    +    let toString = ''
    +
    +    if (opts?.strict) {
           // Entries must be separated by whitespace, according to spec.
           sep = sep.replace(/\S+/g, ' ')
    +
    +      for (const hash of SPEC_ALGORITHMS) {
    +        if (this[hash]) {
    +          toString = integrityHashToString(toString, sep, opts, this[hash])
    +        }
    +      }
    +    } else {
    +      for (const hash of Object.keys(this)) {
    +        toString = integrityHashToString(toString, sep, opts, this[hash])
    +      }
         }
    -    return Object.keys(this).map(k => {
    -      return this[k].map(hash => {
    -        return Hash.prototype.toString.call(hash, opts)
    -      }).filter(x => x.length).join(sep)
    -    }).filter(x => x.length).join(sep)
    +
    +    return toString
       }
     
       concat (integrity, opts) {
    -    opts = ssriOpts(opts)
         const other = typeof integrity === 'string'
           ? integrity
           : stringify(integrity, opts)
    @@ -252,7 +266,6 @@ class Integrity {
       // add additional hashes to an integrity value, but prevent
       // *changing* an existing integrity hash.
       merge (integrity, opts) {
    -    opts = ssriOpts(opts)
         const other = parse(integrity, opts)
         for (const algo in other) {
           if (this[algo]) {
    @@ -268,7 +281,6 @@ class Integrity {
       }
     
       match (integrity, opts) {
    -    opts = ssriOpts(opts)
         const other = parse(integrity, opts)
         if (!other) {
           return false
    @@ -286,8 +298,7 @@ class Integrity {
       }
     
       pickAlgorithm (opts) {
    -    opts = ssriOpts(opts)
    -    const pickAlgorithm = opts.pickAlgorithm
    +    const pickAlgorithm = opts?.pickAlgorithm || getPrioritizedHash
         const keys = Object.keys(this)
         return keys.reduce((acc, algo) => {
           return pickAlgorithm(acc, algo) || acc
    @@ -300,7 +311,6 @@ function parse (sri, opts) {
       if (!sri) {
         return null
       }
    -  opts = ssriOpts(opts)
       if (typeof sri === 'string') {
         return _parse(sri, opts)
       } else if (sri.algorithm && sri.digest) {
    @@ -315,7 +325,7 @@ function parse (sri, opts) {
     function _parse (integrity, opts) {
       // 3.4.3. Parse metadata
       // https://w3c.github.io/webappsec-subresource-integrity/#parse-metadata
    -  if (opts.single) {
    +  if (opts?.single) {
         return new Hash(integrity, opts)
       }
       const hashes = integrity.trim().split(/\s+/).reduce((acc, string) => {
    @@ -334,7 +344,6 @@ function _parse (integrity, opts) {
     
     module.exports.stringify = stringify
     function stringify (obj, opts) {
    -  opts = ssriOpts(opts)
       if (obj.algorithm && obj.digest) {
         return Hash.prototype.toString.call(obj, opts)
       } else if (typeof obj === 'string') {
    @@ -346,8 +355,7 @@ function stringify (obj, opts) {
     
     module.exports.fromHex = fromHex
     function fromHex (hexDigest, algorithm, opts) {
    -  opts = ssriOpts(opts)
    -  const optString = getOptString(opts.options)
    +  const optString = getOptString(opts?.options)
       return parse(
         `${algorithm}-${
           Buffer.from(hexDigest, 'hex').toString('base64')
    @@ -357,9 +365,8 @@ function fromHex (hexDigest, algorithm, opts) {
     
     module.exports.fromData = fromData
     function fromData (data, opts) {
    -  opts = ssriOpts(opts)
    -  const algorithms = opts.algorithms
    -  const optString = getOptString(opts.options)
    +  const algorithms = opts?.algorithms || DEFAULT_ALGORITHMS
    +  const optString = getOptString(opts?.options)
       return algorithms.reduce((acc, algo) => {
         const digest = crypto.createHash(algo).update(data).digest('base64')
         const hash = new Hash(
    @@ -382,7 +389,6 @@ function fromData (data, opts) {
     
     module.exports.fromStream = fromStream
     function fromStream (stream, opts) {
    -  opts = ssriOpts(opts)
       const istream = integrityStream(opts)
       return new Promise((resolve, reject) => {
         stream.pipe(istream)
    @@ -399,10 +405,9 @@ function fromStream (stream, opts) {
     
     module.exports.checkData = checkData
     function checkData (data, sri, opts) {
    -  opts = ssriOpts(opts)
       sri = parse(sri, opts)
       if (!sri || !Object.keys(sri).length) {
    -    if (opts.error) {
    +    if (opts?.error) {
           throw Object.assign(
             new Error('No valid integrity hashes to check against'), {
               code: 'EINTEGRITY',
    @@ -416,7 +421,8 @@ function checkData (data, sri, opts) {
       const digest = crypto.createHash(algorithm).update(data).digest('base64')
       const newSri = parse({ algorithm, digest })
       const match = newSri.match(sri, opts)
    -  if (match || !opts.error) {
    +  opts = opts || {}
    +  if (match || !(opts.error)) {
         return match
       } else if (typeof opts.size === 'number' && (data.length !== opts.size)) {
         /* eslint-disable-next-line max-len */
    @@ -440,7 +446,7 @@ function checkData (data, sri, opts) {
     
     module.exports.checkStream = checkStream
     function checkStream (stream, sri, opts) {
    -  opts = ssriOpts(opts)
    +  opts = opts || Object.create(null)
       opts.integrity = sri
       sri = parse(sri, opts)
       if (!sri || !Object.keys(sri).length) {
    @@ -465,15 +471,14 @@ function checkStream (stream, sri, opts) {
     }
     
     module.exports.integrityStream = integrityStream
    -function integrityStream (opts = {}) {
    +function integrityStream (opts = Object.create(null)) {
       return new IntegrityStream(opts)
     }
     
     module.exports.create = createIntegrity
     function createIntegrity (opts) {
    -  opts = ssriOpts(opts)
    -  const algorithms = opts.algorithms
    -  const optString = getOptString(opts.options)
    +  const algorithms = opts?.algorithms || DEFAULT_ALGORITHMS
    +  const optString = getOptString(opts?.options)
     
       const hashes = algorithms.map(crypto.createHash)
     
    diff --git a/deps/npm/node_modules/ssri/package.json b/deps/npm/node_modules/ssri/package.json
    index 65b14bc5a79705..4d5963e9a0e74d 100644
    --- a/deps/npm/node_modules/ssri/package.json
    +++ b/deps/npm/node_modules/ssri/package.json
    @@ -1,6 +1,6 @@
     {
       "name": "ssri",
    -  "version": "10.0.1",
    +  "version": "10.0.2",
       "description": "Standard Subresource Integrity library -- parses, serializes, generates, and verifies integrity metadata according to the SRI spec.",
       "main": "lib/index.js",
       "files": [
    @@ -51,7 +51,7 @@
       },
       "devDependencies": {
         "@npmcli/eslint-config": "^4.0.0",
    -    "@npmcli/template-oss": "4.10.0",
    +    "@npmcli/template-oss": "4.13.0",
         "tap": "^16.0.1"
       },
       "engines": {
    @@ -59,6 +59,7 @@
       },
       "templateOSS": {
         "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
    -    "version": "4.10.0"
    +    "version": "4.13.0",
    +    "publish": "true"
       }
     }
    diff --git a/deps/npm/node_modules/string-width/index.d.ts b/deps/npm/node_modules/string-width/index.d.ts
    deleted file mode 100644
    index 12b5309751dd50..00000000000000
    --- a/deps/npm/node_modules/string-width/index.d.ts
    +++ /dev/null
    @@ -1,29 +0,0 @@
    -declare const stringWidth: {
    -	/**
    -	Get the visual width of a string - the number of columns required to display it.
    -
    -	Some Unicode characters are [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) and use double the normal width. [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) are stripped and doesn't affect the width.
    -
    -	@example
    -	```
    -	import stringWidth = require('string-width');
    -
    -	stringWidth('a');
    -	//=> 1
    -
    -	stringWidth('古');
    -	//=> 2
    -
    -	stringWidth('\u001B[1m古\u001B[22m');
    -	//=> 2
    -	```
    -	*/
    -	(string: string): number;
    -
    -	// TODO: remove this in the next major version, refactor the whole definition to:
    -	// declare function stringWidth(string: string): number;
    -	// export = stringWidth;
    -	default: typeof stringWidth;
    -}
    -
    -export = stringWidth;
    diff --git a/deps/npm/node_modules/strip-ansi/index.d.ts b/deps/npm/node_modules/strip-ansi/index.d.ts
    deleted file mode 100644
    index 907fccc29269eb..00000000000000
    --- a/deps/npm/node_modules/strip-ansi/index.d.ts
    +++ /dev/null
    @@ -1,17 +0,0 @@
    -/**
    -Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) from a string.
    -
    -@example
    -```
    -import stripAnsi = require('strip-ansi');
    -
    -stripAnsi('\u001B[4mUnicorn\u001B[0m');
    -//=> 'Unicorn'
    -
    -stripAnsi('\u001B]8;;https://github.com\u0007Click\u001B]8;;\u0007');
    -//=> 'Click'
    -```
    -*/
    -declare function stripAnsi(string: string): string;
    -
    -export = stripAnsi;
    diff --git a/deps/npm/node_modules/tar/node_modules/fs-minipass/node_modules/minipass/index.d.ts b/deps/npm/node_modules/tar/node_modules/fs-minipass/node_modules/minipass/index.d.ts
    deleted file mode 100644
    index 65faf63686c213..00000000000000
    --- a/deps/npm/node_modules/tar/node_modules/fs-minipass/node_modules/minipass/index.d.ts
    +++ /dev/null
    @@ -1,155 +0,0 @@
    -/// 
    -import { EventEmitter } from 'events'
    -import { Stream } from 'stream'
    -
    -declare namespace Minipass {
    -  type Encoding = BufferEncoding | 'buffer' | null
    -
    -  interface Writable extends EventEmitter {
    -    end(): any
    -    write(chunk: any, ...args: any[]): any
    -  }
    -
    -  interface Readable extends EventEmitter {
    -    pause(): any
    -    resume(): any
    -    pipe(): any
    -  }
    -
    -  interface Pipe {
    -    src: Minipass
    -    dest: Writable
    -    opts: PipeOptions
    -  }
    -
    -  type DualIterable = Iterable & AsyncIterable
    -
    -  type ContiguousData = Buffer | ArrayBufferLike | ArrayBufferView | string
    -
    -  type BufferOrString = Buffer | string
    -
    -  interface StringOptions {
    -    encoding: BufferEncoding
    -    objectMode?: boolean
    -    async?: boolean
    -  }
    -
    -  interface BufferOptions {
    -    encoding?: null | 'buffer'
    -    objectMode?: boolean
    -    async?: boolean
    -  }
    -
    -  interface ObjectModeOptions {
    -    objectMode: true
    -    async?: boolean
    -  }
    -
    -  interface PipeOptions {
    -    end?: boolean
    -    proxyErrors?: boolean
    -  }
    -
    -  type Options = T extends string
    -    ? StringOptions
    -    : T extends Buffer
    -    ? BufferOptions
    -    : ObjectModeOptions
    -}
    -
    -declare class Minipass<
    -    RType extends any = Buffer,
    -    WType extends any = RType extends Minipass.BufferOrString
    -      ? Minipass.ContiguousData
    -      : RType
    -  >
    -  extends Stream
    -  implements Minipass.DualIterable
    -{
    -  static isStream(stream: any): stream is Minipass.Readable | Minipass.Writable
    -
    -  readonly bufferLength: number
    -  readonly flowing: boolean
    -  readonly writable: boolean
    -  readonly readable: boolean
    -  readonly paused: boolean
    -  readonly emittedEnd: boolean
    -  readonly destroyed: boolean
    -
    -  /**
    -   * Not technically private or readonly, but not safe to mutate.
    -   */
    -  private readonly buffer: RType[]
    -  private readonly pipes: Minipass.Pipe[]
    -
    -  /**
    -   * Technically writable, but mutating it can change the type,
    -   * so is not safe to do in TypeScript.
    -   */
    -  readonly objectMode: boolean
    -  async: boolean
    -
    -  /**
    -   * Note: encoding is not actually read-only, and setEncoding(enc)
    -   * exists. However, this type definition will insist that TypeScript
    -   * programs declare the type of a Minipass stream up front, and if
    -   * that type is string, then an encoding MUST be set in the ctor. If
    -   * the type is Buffer, then the encoding must be missing, or set to
    -   * 'buffer' or null. If the type is anything else, then objectMode
    -   * must be set in the constructor options.  So there is effectively
    -   * no allowed way that a TS program can set the encoding after
    -   * construction, as doing so will destroy any hope of type safety.
    -   * TypeScript does not provide many options for changing the type of
    -   * an object at run-time, which is what changing the encoding does.
    -   */
    -  readonly encoding: Minipass.Encoding
    -  // setEncoding(encoding: Encoding): void
    -
    -  // Options required if not reading buffers
    -  constructor(
    -    ...args: RType extends Buffer
    -      ? [] | [Minipass.Options]
    -      : [Minipass.Options]
    -  )
    -
    -  write(chunk: WType, cb?: () => void): boolean
    -  write(chunk: WType, encoding?: Minipass.Encoding, cb?: () => void): boolean
    -  read(size?: number): RType
    -  end(cb?: () => void): this
    -  end(chunk: any, cb?: () => void): this
    -  end(chunk: any, encoding?: Minipass.Encoding, cb?: () => void): this
    -  pause(): void
    -  resume(): void
    -  promise(): Promise
    -  collect(): Promise
    -
    -  concat(): RType extends Minipass.BufferOrString ? Promise : never
    -  destroy(er?: any): void
    -  pipe(dest: W, opts?: Minipass.PipeOptions): W
    -  unpipe(dest: W): void
    -
    -  /**
    -   * alias for on()
    -   */
    -  addEventHandler(event: string, listener: (...args: any[]) => any): this
    -
    -  on(event: string, listener: (...args: any[]) => any): this
    -  on(event: 'data', listener: (chunk: RType) => any): this
    -  on(event: 'error', listener: (error: any) => any): this
    -  on(
    -    event:
    -      | 'readable'
    -      | 'drain'
    -      | 'resume'
    -      | 'end'
    -      | 'prefinish'
    -      | 'finish'
    -      | 'close',
    -    listener: () => any
    -  ): this
    -
    -  [Symbol.iterator](): Iterator
    -  [Symbol.asyncIterator](): AsyncIterator
    -}
    -
    -export = Minipass
    diff --git a/deps/npm/node_modules/tuf-js/LICENSE b/deps/npm/node_modules/tuf-js/LICENSE
    index f28ab0914a319d..420700f5d37659 100644
    --- a/deps/npm/node_modules/tuf-js/LICENSE
    +++ b/deps/npm/node_modules/tuf-js/LICENSE
    @@ -1,6 +1,6 @@
     MIT License
     
    -Copyright GitHub
    +Copyright (c) 2022 GitHub and the TUF Contributors
     
     Permission is hereby granted, free of charge, to any person obtaining a copy
     of this software and associated documentation files (the "Software"), to deal
    diff --git a/deps/npm/node_modules/tuf-js/dist/utils/config.js b/deps/npm/node_modules/tuf-js/dist/config.js
    similarity index 100%
    rename from deps/npm/node_modules/tuf-js/dist/utils/config.js
    rename to deps/npm/node_modules/tuf-js/dist/config.js
    diff --git a/deps/npm/node_modules/tuf-js/dist/error.d.ts b/deps/npm/node_modules/tuf-js/dist/error.d.ts
    deleted file mode 100644
    index 130e49ab9dfd27..00000000000000
    --- a/deps/npm/node_modules/tuf-js/dist/error.d.ts
    +++ /dev/null
    @@ -1,30 +0,0 @@
    -export declare class ValueError extends Error {
    -}
    -export declare class RuntimeError extends Error {
    -}
    -export declare class PersistError extends Error {
    -}
    -export declare class RepositoryError extends Error {
    -}
    -export declare class UnsignedMetadataError extends RepositoryError {
    -}
    -export declare class BadVersionError extends RepositoryError {
    -}
    -export declare class EqualVersionError extends BadVersionError {
    -}
    -export declare class ExpiredMetadataError extends RepositoryError {
    -}
    -export declare class LengthOrHashMismatchError extends RepositoryError {
    -}
    -export declare class CryptoError extends Error {
    -}
    -export declare class UnsupportedAlgorithmError extends CryptoError {
    -}
    -export declare class DownloadError extends Error {
    -}
    -export declare class DownloadLengthMismatchError extends DownloadError {
    -}
    -export declare class DownloadHTTPError extends DownloadError {
    -    statusCode: number;
    -    constructor(message: string, statusCode: number);
    -}
    diff --git a/deps/npm/node_modules/tuf-js/dist/error.js b/deps/npm/node_modules/tuf-js/dist/error.js
    index ce7ca5ea06cebc..f4b10fa2028950 100644
    --- a/deps/npm/node_modules/tuf-js/dist/error.js
    +++ b/deps/npm/node_modules/tuf-js/dist/error.js
    @@ -1,6 +1,6 @@
     "use strict";
     Object.defineProperty(exports, "__esModule", { value: true });
    -exports.DownloadHTTPError = exports.DownloadLengthMismatchError = exports.DownloadError = exports.UnsupportedAlgorithmError = exports.CryptoError = exports.LengthOrHashMismatchError = exports.ExpiredMetadataError = exports.EqualVersionError = exports.BadVersionError = exports.UnsignedMetadataError = exports.RepositoryError = exports.PersistError = exports.RuntimeError = exports.ValueError = void 0;
    +exports.DownloadHTTPError = exports.DownloadLengthMismatchError = exports.DownloadError = exports.ExpiredMetadataError = exports.EqualVersionError = exports.BadVersionError = exports.RepositoryError = exports.PersistError = exports.RuntimeError = exports.ValueError = void 0;
     // An error about insufficient values
     class ValueError extends Error {
     }
    @@ -17,10 +17,6 @@ exports.PersistError = PersistError;
     class RepositoryError extends Error {
     }
     exports.RepositoryError = RepositoryError;
    -// An error about metadata object with insufficient threshold of signatures.
    -class UnsignedMetadataError extends RepositoryError {
    -}
    -exports.UnsignedMetadataError = UnsignedMetadataError;
     // An error for metadata that contains an invalid version number.
     class BadVersionError extends RepositoryError {
     }
    @@ -33,16 +29,6 @@ exports.EqualVersionError = EqualVersionError;
     class ExpiredMetadataError extends RepositoryError {
     }
     exports.ExpiredMetadataError = ExpiredMetadataError;
    -// An error while checking the length and hash values of an object.
    -class LengthOrHashMismatchError extends RepositoryError {
    -}
    -exports.LengthOrHashMismatchError = LengthOrHashMismatchError;
    -class CryptoError extends Error {
    -}
    -exports.CryptoError = CryptoError;
    -class UnsupportedAlgorithmError extends CryptoError {
    -}
    -exports.UnsupportedAlgorithmError = UnsupportedAlgorithmError;
     //----- Download Errors -------------------------------------------------------
     // An error occurred while attempting to download a file.
     class DownloadError extends Error {
    diff --git a/deps/npm/node_modules/tuf-js/dist/fetcher.d.ts b/deps/npm/node_modules/tuf-js/dist/fetcher.d.ts
    deleted file mode 100644
    index 2b52cbef523267..00000000000000
    --- a/deps/npm/node_modules/tuf-js/dist/fetcher.d.ts
    +++ /dev/null
    @@ -1,19 +0,0 @@
    -/// 
    -/// 
    -type DownloadFileHandler = (file: string) => Promise;
    -export declare abstract class BaseFetcher {
    -    abstract fetch(url: string): Promise;
    -    downloadFile(url: string, maxLength: number, handler: DownloadFileHandler): Promise;
    -    downloadBytes(url: string, maxLength: number): Promise;
    -}
    -interface FetcherOptions {
    -    timeout?: number;
    -    retries?: number;
    -}
    -export declare class Fetcher extends BaseFetcher {
    -    private timeout?;
    -    private retries?;
    -    constructor(options?: FetcherOptions);
    -    fetch(url: string): Promise;
    -}
    -export {};
    diff --git a/deps/npm/node_modules/tuf-js/dist/fetcher.js b/deps/npm/node_modules/tuf-js/dist/fetcher.js
    index cb42ab22a1d312..7a7405ac53e720 100644
    --- a/deps/npm/node_modules/tuf-js/dist/fetcher.js
    +++ b/deps/npm/node_modules/tuf-js/dist/fetcher.js
    @@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
         return (mod && mod.__esModule) ? mod : { "default": mod };
     };
     Object.defineProperty(exports, "__esModule", { value: true });
    -exports.Fetcher = exports.BaseFetcher = void 0;
    +exports.DefaultFetcher = exports.BaseFetcher = void 0;
     const fs_1 = __importDefault(require("fs"));
     const make_fetch_happen_1 = __importDefault(require("make-fetch-happen"));
     const util_1 = __importDefault(require("util"));
    @@ -51,7 +51,7 @@ class BaseFetcher {
         }
     }
     exports.BaseFetcher = BaseFetcher;
    -class Fetcher extends BaseFetcher {
    +class DefaultFetcher extends BaseFetcher {
         constructor(options = {}) {
             super();
             this.timeout = options.timeout;
    @@ -68,7 +68,7 @@ class Fetcher extends BaseFetcher {
             return response.body;
         }
     }
    -exports.Fetcher = Fetcher;
    +exports.DefaultFetcher = DefaultFetcher;
     const writeBufferToStream = async (stream, buffer) => {
         return new Promise((resolve, reject) => {
             stream.write(buffer, (err) => {
    diff --git a/deps/npm/node_modules/tuf-js/dist/index.d.ts b/deps/npm/node_modules/tuf-js/dist/index.d.ts
    deleted file mode 100644
    index bfe3adcac2aef1..00000000000000
    --- a/deps/npm/node_modules/tuf-js/dist/index.d.ts
    +++ /dev/null
    @@ -1,3 +0,0 @@
    -export { BaseFetcher } from './fetcher';
    -export { TargetFile } from './models/file';
    -export { Updater } from './updater';
    diff --git a/deps/npm/node_modules/tuf-js/dist/index.js b/deps/npm/node_modules/tuf-js/dist/index.js
    index 6245d1724a2089..5a83b91f355d88 100644
    --- a/deps/npm/node_modules/tuf-js/dist/index.js
    +++ b/deps/npm/node_modules/tuf-js/dist/index.js
    @@ -1,9 +1,9 @@
     "use strict";
     Object.defineProperty(exports, "__esModule", { value: true });
    -exports.Updater = exports.TargetFile = exports.BaseFetcher = void 0;
    +exports.Updater = exports.BaseFetcher = exports.TargetFile = void 0;
    +var models_1 = require("@tufjs/models");
    +Object.defineProperty(exports, "TargetFile", { enumerable: true, get: function () { return models_1.TargetFile; } });
     var fetcher_1 = require("./fetcher");
     Object.defineProperty(exports, "BaseFetcher", { enumerable: true, get: function () { return fetcher_1.BaseFetcher; } });
    -var file_1 = require("./models/file");
    -Object.defineProperty(exports, "TargetFile", { enumerable: true, get: function () { return file_1.TargetFile; } });
     var updater_1 = require("./updater");
     Object.defineProperty(exports, "Updater", { enumerable: true, get: function () { return updater_1.Updater; } });
    diff --git a/deps/npm/node_modules/tuf-js/dist/models/base.d.ts b/deps/npm/node_modules/tuf-js/dist/models/base.d.ts
    deleted file mode 100644
    index 4c5e0aaf4faaad..00000000000000
    --- a/deps/npm/node_modules/tuf-js/dist/models/base.d.ts
    +++ /dev/null
    @@ -1,30 +0,0 @@
    -import { JSONObject, JSONValue } from '../utils/types';
    -import { Signature } from './signature';
    -export interface Signable {
    -    signatures: Record;
    -    signed: Signed;
    -}
    -export interface SignedOptions {
    -    version?: number;
    -    specVersion?: string;
    -    expires?: string;
    -    unrecognizedFields?: Record;
    -}
    -/***
    - * A base class for the signed part of TUF metadata.
    - *
    - * Objects with base class Signed are usually included in a ``Metadata`` object
    - * on the signed attribute. This class provides attributes and methods that
    - * are common for all TUF metadata types (roles).
    - */
    -export declare abstract class Signed {
    -    readonly specVersion: string;
    -    readonly expires: string;
    -    readonly version: number;
    -    readonly unrecognizedFields: Record;
    -    constructor(options: SignedOptions);
    -    equals(other: Signed): boolean;
    -    isExpired(referenceTime?: Date): boolean;
    -    static commonFieldsFromJSON(data: JSONObject): SignedOptions;
    -    abstract toJSON(): JSONObject;
    -}
    diff --git a/deps/npm/node_modules/tuf-js/dist/models/delegations.d.ts b/deps/npm/node_modules/tuf-js/dist/models/delegations.d.ts
    deleted file mode 100644
    index b53862aa865bec..00000000000000
    --- a/deps/npm/node_modules/tuf-js/dist/models/delegations.d.ts
    +++ /dev/null
    @@ -1,32 +0,0 @@
    -import { JSONObject, JSONValue } from '../utils/types';
    -import { Key } from './key';
    -import { DelegatedRole, SuccinctRoles } from './role';
    -type DelegatedRoleMap = Record;
    -type KeyMap = Record;
    -interface DelegationsOptions {
    -    keys: KeyMap;
    -    roles?: DelegatedRoleMap;
    -    succinctRoles?: SuccinctRoles;
    -    unrecognizedFields?: Record;
    -}
    -/**
    - * A container object storing information about all delegations.
    - *
    - * Targets roles that are trusted to provide signed metadata files
    - * describing targets with designated pathnames and/or further delegations.
    - */
    -export declare class Delegations {
    -    readonly keys: KeyMap;
    -    readonly roles?: DelegatedRoleMap;
    -    readonly unrecognizedFields?: Record;
    -    readonly succinctRoles?: SuccinctRoles;
    -    constructor(options: DelegationsOptions);
    -    equals(other: Delegations): boolean;
    -    rolesForTarget(targetPath: string): Generator<{
    -        role: string;
    -        terminating: boolean;
    -    }>;
    -    toJSON(): JSONObject;
    -    static fromJSON(data: JSONObject): Delegations;
    -}
    -export {};
    diff --git a/deps/npm/node_modules/tuf-js/dist/models/file.d.ts b/deps/npm/node_modules/tuf-js/dist/models/file.d.ts
    deleted file mode 100644
    index 9678cf1efefd59..00000000000000
    --- a/deps/npm/node_modules/tuf-js/dist/models/file.d.ts
    +++ /dev/null
    @@ -1,40 +0,0 @@
    -/// 
    -/// 
    -import { Readable } from 'stream';
    -import { JSONObject, JSONValue } from '../utils/types';
    -interface MetaFileOptions {
    -    version: number;
    -    length?: number;
    -    hashes?: Record;
    -    unrecognizedFields?: Record;
    -}
    -export declare class MetaFile {
    -    readonly version: number;
    -    readonly length?: number;
    -    readonly hashes?: Record;
    -    readonly unrecognizedFields?: Record;
    -    constructor(opts: MetaFileOptions);
    -    equals(other: MetaFile): boolean;
    -    verify(data: Buffer): void;
    -    toJSON(): JSONObject;
    -    static fromJSON(data: JSONObject): MetaFile;
    -}
    -interface TargetFileOptions {
    -    length: number;
    -    path: string;
    -    hashes: Record;
    -    unrecognizedFields?: Record;
    -}
    -export declare class TargetFile {
    -    readonly length: number;
    -    readonly path: string;
    -    readonly hashes: Record;
    -    readonly unrecognizedFields: Record;
    -    constructor(opts: TargetFileOptions);
    -    get custom(): Record;
    -    equals(other: TargetFile): boolean;
    -    verify(stream: Readable): Promise;
    -    toJSON(): JSONObject;
    -    static fromJSON(path: string, data: JSONObject): TargetFile;
    -}
    -export {};
    diff --git a/deps/npm/node_modules/tuf-js/dist/models/index.d.ts b/deps/npm/node_modules/tuf-js/dist/models/index.d.ts
    deleted file mode 100644
    index 58d779159215b1..00000000000000
    --- a/deps/npm/node_modules/tuf-js/dist/models/index.d.ts
    +++ /dev/null
    @@ -1,5 +0,0 @@
    -export { Metadata } from './metadata';
    -export { Root } from './root';
    -export { Snapshot } from './snapshot';
    -export { Targets } from './targets';
    -export { Timestamp } from './timestamp';
    diff --git a/deps/npm/node_modules/tuf-js/dist/models/index.js b/deps/npm/node_modules/tuf-js/dist/models/index.js
    deleted file mode 100644
    index aa3d828cf9b43a..00000000000000
    --- a/deps/npm/node_modules/tuf-js/dist/models/index.js
    +++ /dev/null
    @@ -1,13 +0,0 @@
    -"use strict";
    -Object.defineProperty(exports, "__esModule", { value: true });
    -exports.Timestamp = exports.Targets = exports.Snapshot = exports.Root = exports.Metadata = void 0;
    -var metadata_1 = require("./metadata");
    -Object.defineProperty(exports, "Metadata", { enumerable: true, get: function () { return metadata_1.Metadata; } });
    -var root_1 = require("./root");
    -Object.defineProperty(exports, "Root", { enumerable: true, get: function () { return root_1.Root; } });
    -var snapshot_1 = require("./snapshot");
    -Object.defineProperty(exports, "Snapshot", { enumerable: true, get: function () { return snapshot_1.Snapshot; } });
    -var targets_1 = require("./targets");
    -Object.defineProperty(exports, "Targets", { enumerable: true, get: function () { return targets_1.Targets; } });
    -var timestamp_1 = require("./timestamp");
    -Object.defineProperty(exports, "Timestamp", { enumerable: true, get: function () { return timestamp_1.Timestamp; } });
    diff --git a/deps/npm/node_modules/tuf-js/dist/models/key.d.ts b/deps/npm/node_modules/tuf-js/dist/models/key.d.ts
    deleted file mode 100644
    index 160407ae70ee3f..00000000000000
    --- a/deps/npm/node_modules/tuf-js/dist/models/key.d.ts
    +++ /dev/null
    @@ -1,21 +0,0 @@
    -import { JSONObject, JSONValue } from '../utils/types';
    -import { Signable } from './base';
    -export interface KeyOptions {
    -    keyID: string;
    -    keyType: string;
    -    scheme: string;
    -    keyVal: Record;
    -    unrecognizedFields?: Record;
    -}
    -export declare class Key {
    -    readonly keyID: string;
    -    readonly keyType: string;
    -    readonly scheme: string;
    -    readonly keyVal: Record;
    -    readonly unrecognizedFields?: Record;
    -    constructor(options: KeyOptions);
    -    verifySignature(metadata: Signable): void;
    -    equals(other: Key): boolean;
    -    toJSON(): JSONObject;
    -    static fromJSON(keyID: string, data: JSONObject): Key;
    -}
    diff --git a/deps/npm/node_modules/tuf-js/dist/models/key.js b/deps/npm/node_modules/tuf-js/dist/models/key.js
    deleted file mode 100644
    index 33ff514fc178fa..00000000000000
    --- a/deps/npm/node_modules/tuf-js/dist/models/key.js
    +++ /dev/null
    @@ -1,109 +0,0 @@
    -"use strict";
    -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    -    if (k2 === undefined) k2 = k;
    -    var desc = Object.getOwnPropertyDescriptor(m, k);
    -    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
    -      desc = { enumerable: true, get: function() { return m[k]; } };
    -    }
    -    Object.defineProperty(o, k2, desc);
    -}) : (function(o, m, k, k2) {
    -    if (k2 === undefined) k2 = k;
    -    o[k2] = m[k];
    -}));
    -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    -    Object.defineProperty(o, "default", { enumerable: true, value: v });
    -}) : function(o, v) {
    -    o["default"] = v;
    -});
    -var __importStar = (this && this.__importStar) || function (mod) {
    -    if (mod && mod.__esModule) return mod;
    -    var result = {};
    -    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    -    __setModuleDefault(result, mod);
    -    return result;
    -};
    -var __importDefault = (this && this.__importDefault) || function (mod) {
    -    return (mod && mod.__esModule) ? mod : { "default": mod };
    -};
    -Object.defineProperty(exports, "__esModule", { value: true });
    -exports.Key = void 0;
    -const util_1 = __importDefault(require("util"));
    -const error_1 = require("../error");
    -const guard_1 = require("../utils/guard");
    -const key_1 = require("../utils/key");
    -const signer = __importStar(require("../utils/signer"));
    -// A container class representing the public portion of a Key.
    -class Key {
    -    constructor(options) {
    -        const { keyID, keyType, scheme, keyVal, unrecognizedFields } = options;
    -        this.keyID = keyID;
    -        this.keyType = keyType;
    -        this.scheme = scheme;
    -        this.keyVal = keyVal;
    -        this.unrecognizedFields = unrecognizedFields || {};
    -    }
    -    // Verifies the that the metadata.signatures contains a signature made with
    -    // this key and is correctly signed.
    -    verifySignature(metadata) {
    -        const signature = metadata.signatures[this.keyID];
    -        if (!signature)
    -            throw new error_1.UnsignedMetadataError('no signature for key found in metadata');
    -        if (!this.keyVal.public)
    -            throw new error_1.UnsignedMetadataError('no public key found');
    -        const publicKey = (0, key_1.getPublicKey)({
    -            keyType: this.keyType,
    -            scheme: this.scheme,
    -            keyVal: this.keyVal.public,
    -        });
    -        const signedData = metadata.signed.toJSON();
    -        try {
    -            if (!signer.verifySignature(signedData, publicKey, signature.sig)) {
    -                throw new error_1.UnsignedMetadataError(`failed to verify ${this.keyID} signature`);
    -            }
    -        }
    -        catch (error) {
    -            if (error instanceof error_1.UnsignedMetadataError) {
    -                throw error;
    -            }
    -            throw new error_1.UnsignedMetadataError(`failed to verify ${this.keyID} signature`);
    -        }
    -    }
    -    equals(other) {
    -        if (!(other instanceof Key)) {
    -            return false;
    -        }
    -        return (this.keyID === other.keyID &&
    -            this.keyType === other.keyType &&
    -            this.scheme === other.scheme &&
    -            util_1.default.isDeepStrictEqual(this.keyVal, other.keyVal) &&
    -            util_1.default.isDeepStrictEqual(this.unrecognizedFields, other.unrecognizedFields));
    -    }
    -    toJSON() {
    -        return {
    -            keytype: this.keyType,
    -            scheme: this.scheme,
    -            keyval: this.keyVal,
    -            ...this.unrecognizedFields,
    -        };
    -    }
    -    static fromJSON(keyID, data) {
    -        const { keytype, scheme, keyval, ...rest } = data;
    -        if (typeof keytype !== 'string') {
    -            throw new TypeError('keytype must be a string');
    -        }
    -        if (typeof scheme !== 'string') {
    -            throw new TypeError('scheme must be a string');
    -        }
    -        if (!(0, guard_1.isStringRecord)(keyval)) {
    -            throw new TypeError('keyval must be a string record');
    -        }
    -        return new Key({
    -            keyID,
    -            keyType: keytype,
    -            scheme,
    -            keyVal: keyval,
    -            unrecognizedFields: rest,
    -        });
    -    }
    -}
    -exports.Key = Key;
    diff --git a/deps/npm/node_modules/tuf-js/dist/models/metadata.d.ts b/deps/npm/node_modules/tuf-js/dist/models/metadata.d.ts
    deleted file mode 100644
    index 39abf034064496..00000000000000
    --- a/deps/npm/node_modules/tuf-js/dist/models/metadata.d.ts
    +++ /dev/null
    @@ -1,45 +0,0 @@
    -import { JSONObject, JSONValue, MetadataKind } from '../utils/types';
    -import { Signable } from './base';
    -import { Root } from './root';
    -import { Signature } from './signature';
    -import { Snapshot } from './snapshot';
    -import { Targets } from './targets';
    -import { Timestamp } from './timestamp';
    -type MetadataType = Root | Timestamp | Snapshot | Targets;
    -/***
    - * A container for signed TUF metadata.
    - *
    - * Provides methods to convert to and from json, read and write to and
    - * from JSON and to create and verify metadata signatures.
    - *
    - * ``Metadata[T]`` is a generic container type where T can be any one type of
    - * [``Root``, ``Timestamp``, ``Snapshot``, ``Targets``]. The purpose of this
    - * is to allow static type checking of the signed attribute in code using
    - * Metadata::
    - *
    - * root_md = Metadata[Root].fromJSON("root.json")
    - * # root_md type is now Metadata[Root]. This means signed and its
    - * # attributes like consistent_snapshot are now statically typed and the
    - * # types can be verified by static type checkers and shown by IDEs
    - *
    - * Using a type constraint is not required but not doing so means T is not a
    - * specific type so static typing cannot happen. Note that the type constraint
    - * ``[Root]`` is not validated at runtime (as pure annotations are not available
    - * then).
    - *
    - * Apart from ``expires`` all of the arguments to the inner constructors have
    - * reasonable default values for new metadata.
    - */
    -export declare class Metadata implements Signable {
    -    signed: T;
    -    signatures: Record;
    -    unrecognizedFields: Record;
    -    constructor(signed: T, signatures?: Record, unrecognizedFields?: Record);
    -    verifyDelegate(delegatedRole: string, delegatedMetadata: Metadata): void;
    -    equals(other: T): boolean;
    -    static fromJSON(type: MetadataKind.Root, data: JSONObject): Metadata;
    -    static fromJSON(type: MetadataKind.Timestamp, data: JSONObject): Metadata;
    -    static fromJSON(type: MetadataKind.Snapshot, data: JSONObject): Metadata;
    -    static fromJSON(type: MetadataKind.Targets, data: JSONObject): Metadata;
    -}
    -export {};
    diff --git a/deps/npm/node_modules/tuf-js/dist/models/role.d.ts b/deps/npm/node_modules/tuf-js/dist/models/role.d.ts
    deleted file mode 100644
    index 4575300fb972f9..00000000000000
    --- a/deps/npm/node_modules/tuf-js/dist/models/role.d.ts
    +++ /dev/null
    @@ -1,103 +0,0 @@
    -import { JSONObject, JSONValue } from '../utils/types';
    -export declare const TOP_LEVEL_ROLE_NAMES: string[];
    -export interface RoleOptions {
    -    keyIDs: string[];
    -    threshold: number;
    -    unrecognizedFields?: Record;
    -}
    -/**
    - * Container that defines which keys are required to sign roles metadata.
    - *
    - * Role defines how many keys are required to successfully sign the roles
    - * metadata, and which keys are accepted.
    - */
    -export declare class Role {
    -    readonly keyIDs: string[];
    -    readonly threshold: number;
    -    readonly unrecognizedFields?: Record;
    -    constructor(options: RoleOptions);
    -    equals(other: Role): boolean;
    -    toJSON(): JSONObject;
    -    static fromJSON(data: JSONObject): Role;
    -}
    -interface DelegatedRoleOptions extends RoleOptions {
    -    name: string;
    -    terminating: boolean;
    -    paths?: string[];
    -    pathHashPrefixes?: string[];
    -}
    -/**
    - * A container with information about a delegated role.
    - *
    - * A delegation can happen in two ways:
    - *   - ``paths`` is set: delegates targets matching any path pattern in ``paths``
    - *   - ``pathHashPrefixes`` is set: delegates targets whose target path hash
    - *      starts with any of the prefixes in ``pathHashPrefixes``
    - *
    - *   ``paths`` and ``pathHashPrefixes`` are mutually exclusive: both cannot be
    - *   set, at least one of them must be set.
    - */
    -export declare class DelegatedRole extends Role {
    -    readonly name: string;
    -    readonly terminating: boolean;
    -    readonly paths?: string[];
    -    readonly pathHashPrefixes?: string[];
    -    constructor(opts: DelegatedRoleOptions);
    -    equals(other: DelegatedRole): boolean;
    -    isDelegatedPath(targetFilepath: string): boolean;
    -    toJSON(): JSONObject;
    -    static fromJSON(data: JSONObject): DelegatedRole;
    -}
    -interface SuccinctRolesOption extends RoleOptions {
    -    bitLength: number;
    -    namePrefix: string;
    -}
    -/**
    - * Succinctly defines a hash bin delegation graph.
    - *
    - * A ``SuccinctRoles`` object describes a delegation graph that covers all
    - * targets, distributing them uniformly over the delegated roles (i.e. bins)
    - * in the graph.
    - *
    - * The total number of bins is 2 to the power of the passed ``bit_length``.
    - *
    - * Bin names are the concatenation of the passed ``name_prefix`` and a
    - * zero-padded hex representation of the bin index separated by a hyphen.
    - *
    - * The passed ``keyids`` and ``threshold`` is used for each bin, and each bin
    - * is 'terminating'.
    - *
    - * For details: https://github.com/theupdateframework/taps/blob/master/tap15.md
    - */
    -export declare class SuccinctRoles extends Role {
    -    readonly bitLength: number;
    -    readonly namePrefix: string;
    -    readonly numberOfBins: number;
    -    readonly suffixLen: number;
    -    constructor(opts: SuccinctRolesOption);
    -    equals(other: SuccinctRoles): boolean;
    -    /***
    -     * Calculates the name of the delegated role responsible for 'target_filepath'.
    -     *
    -     * The target at path ''target_filepath' is assigned to a bin by casting
    -     * the left-most 'bit_length' of bits of the file path hash digest to
    -     * int, using it as bin index between 0 and '2**bit_length - 1'.
    -     *
    -     * Args:
    -     *  target_filepath: URL path to a target file, relative to a base
    -     *  targets URL.
    -     */
    -    getRoleForTarget(targetFilepath: string): string;
    -    getRoles(): Generator;
    -    /***
    -     * Determines whether the given ``role_name`` is in one of
    -     * the delegated roles that ``SuccinctRoles`` represents.
    -     *
    -     * Args:
    -     *  role_name: The name of the role to check against.
    -     */
    -    isDelegatedRole(roleName: string): boolean;
    -    toJSON(): JSONObject;
    -    static fromJSON(data: JSONObject): SuccinctRoles;
    -}
    -export {};
    diff --git a/deps/npm/node_modules/tuf-js/dist/models/root.d.ts b/deps/npm/node_modules/tuf-js/dist/models/root.d.ts
    deleted file mode 100644
    index 66356628f4b8a5..00000000000000
    --- a/deps/npm/node_modules/tuf-js/dist/models/root.d.ts
    +++ /dev/null
    @@ -1,28 +0,0 @@
    -import { JSONObject, MetadataKind } from '../utils/types';
    -import { Signed, SignedOptions } from './base';
    -import { Key } from './key';
    -import { Role } from './role';
    -type KeyMap = Record;
    -type RoleMap = Record;
    -export interface RootOptions extends SignedOptions {
    -    keys?: Record;
    -    roles?: Record;
    -    consistentSnapshot?: boolean;
    -}
    -/**
    - * A container for the signed part of root metadata.
    - *
    - * The top-level role and metadata file signed by the root keys.
    - * This role specifies trusted keys for all other top-level roles, which may further delegate trust.
    - */
    -export declare class Root extends Signed {
    -    readonly type = MetadataKind.Root;
    -    readonly keys: KeyMap;
    -    readonly roles: RoleMap;
    -    readonly consistentSnapshot: boolean;
    -    constructor(options: RootOptions);
    -    equals(other: Root): boolean;
    -    toJSON(): JSONObject;
    -    static fromJSON(data: JSONObject): Root;
    -}
    -export {};
    diff --git a/deps/npm/node_modules/tuf-js/dist/models/signature.d.ts b/deps/npm/node_modules/tuf-js/dist/models/signature.d.ts
    deleted file mode 100644
    index 1d78e2d8e55d08..00000000000000
    --- a/deps/npm/node_modules/tuf-js/dist/models/signature.d.ts
    +++ /dev/null
    @@ -1,19 +0,0 @@
    -import { JSONObject } from '../utils/types';
    -export interface SignatureOptions {
    -    keyID: string;
    -    sig: string;
    -}
    -/**
    - * A container class containing information about a signature.
    - *
    - * Contains a signature and the keyid uniquely identifying the key used
    - * to generate the signature.
    - *
    - * Provide a `fromJSON` method to create a Signature from a JSON object.
    - */
    -export declare class Signature {
    -    readonly keyID: string;
    -    readonly sig: string;
    -    constructor(options: SignatureOptions);
    -    static fromJSON(data: JSONObject): Signature;
    -}
    diff --git a/deps/npm/node_modules/tuf-js/dist/models/snapshot.d.ts b/deps/npm/node_modules/tuf-js/dist/models/snapshot.d.ts
    deleted file mode 100644
    index 79bc07359509bd..00000000000000
    --- a/deps/npm/node_modules/tuf-js/dist/models/snapshot.d.ts
    +++ /dev/null
    @@ -1,23 +0,0 @@
    -import { JSONObject, MetadataKind } from '../utils/types';
    -import { Signed, SignedOptions } from './base';
    -import { MetaFile } from './file';
    -type MetaFileMap = Record;
    -export interface SnapshotOptions extends SignedOptions {
    -    meta?: MetaFileMap;
    -}
    -/**
    - * A container for the signed part of snapshot metadata.
    - *
    - * Snapshot contains information about all target Metadata files.
    - * A top-level role that specifies the latest versions of all targets metadata files,
    - * and hence the latest versions of all targets (including any dependencies between them) on the repository.
    - */
    -export declare class Snapshot extends Signed {
    -    readonly type = MetadataKind.Snapshot;
    -    readonly meta: MetaFileMap;
    -    constructor(opts: SnapshotOptions);
    -    equals(other: Snapshot): boolean;
    -    toJSON(): JSONObject;
    -    static fromJSON(data: JSONObject): Snapshot;
    -}
    -export {};
    diff --git a/deps/npm/node_modules/tuf-js/dist/models/targets.d.ts b/deps/npm/node_modules/tuf-js/dist/models/targets.d.ts
    deleted file mode 100644
    index 24dba9ac715805..00000000000000
    --- a/deps/npm/node_modules/tuf-js/dist/models/targets.d.ts
    +++ /dev/null
    @@ -1,19 +0,0 @@
    -import { JSONObject, MetadataKind } from '../utils/types';
    -import { Signed, SignedOptions } from './base';
    -import { Delegations } from './delegations';
    -import { TargetFile } from './file';
    -type TargetFileMap = Record;
    -interface TargetsOptions extends SignedOptions {
    -    targets?: TargetFileMap;
    -    delegations?: Delegations;
    -}
    -export declare class Targets extends Signed {
    -    readonly type = MetadataKind.Targets;
    -    readonly targets: TargetFileMap;
    -    readonly delegations?: Delegations;
    -    constructor(options: TargetsOptions);
    -    equals(other: Targets): boolean;
    -    toJSON(): JSONObject;
    -    static fromJSON(data: JSONObject): Targets;
    -}
    -export {};
    diff --git a/deps/npm/node_modules/tuf-js/dist/models/timestamp.d.ts b/deps/npm/node_modules/tuf-js/dist/models/timestamp.d.ts
    deleted file mode 100644
    index 481ada8e238d53..00000000000000
    --- a/deps/npm/node_modules/tuf-js/dist/models/timestamp.d.ts
    +++ /dev/null
    @@ -1,21 +0,0 @@
    -import { JSONObject, MetadataKind } from '../utils/types';
    -import { Signed, SignedOptions } from './base';
    -import { MetaFile } from './file';
    -interface TimestampOptions extends SignedOptions {
    -    snapshotMeta?: MetaFile;
    -}
    -/**
    - * A container for the signed part of timestamp metadata.
    - *
    - * A top-level that specifies the latest version of the snapshot role metadata file,
    - * and hence the latest versions of all metadata and targets on the repository.
    - */
    -export declare class Timestamp extends Signed {
    -    readonly type = MetadataKind.Timestamp;
    -    readonly snapshotMeta: MetaFile;
    -    constructor(options: TimestampOptions);
    -    equals(other: Timestamp): boolean;
    -    toJSON(): JSONObject;
    -    static fromJSON(data: JSONObject): Timestamp;
    -}
    -export {};
    diff --git a/deps/npm/node_modules/tuf-js/dist/store.d.ts b/deps/npm/node_modules/tuf-js/dist/store.d.ts
    deleted file mode 100644
    index a6e20ae559c8b8..00000000000000
    --- a/deps/npm/node_modules/tuf-js/dist/store.d.ts
    +++ /dev/null
    @@ -1,19 +0,0 @@
    -/// 
    -import { Metadata, Root, Snapshot, Targets, Timestamp } from './models';
    -export declare class TrustedMetadataStore {
    -    private trustedSet;
    -    private referenceTime;
    -    constructor(rootData: Buffer);
    -    get root(): Metadata;
    -    get timestamp(): Metadata | undefined;
    -    get snapshot(): Metadata | undefined;
    -    get targets(): Metadata | undefined;
    -    getRole(name: string): Metadata | undefined;
    -    updateRoot(bytesBuffer: Buffer): Metadata;
    -    updateTimestamp(bytesBuffer: Buffer): Metadata;
    -    updateSnapshot(bytesBuffer: Buffer, trusted?: boolean): Metadata;
    -    updateDelegatedTargets(bytesBuffer: Buffer, roleName: string, delegatorName: string): void;
    -    private loadTrustedRoot;
    -    private checkFinalTimestamp;
    -    private checkFinalSnapsnot;
    -}
    diff --git a/deps/npm/node_modules/tuf-js/dist/store.js b/deps/npm/node_modules/tuf-js/dist/store.js
    index 351a1961730bc9..85673361087095 100644
    --- a/deps/npm/node_modules/tuf-js/dist/store.js
    +++ b/deps/npm/node_modules/tuf-js/dist/store.js
    @@ -1,9 +1,8 @@
     "use strict";
     Object.defineProperty(exports, "__esModule", { value: true });
     exports.TrustedMetadataStore = void 0;
    +const models_1 = require("@tufjs/models");
     const error_1 = require("./error");
    -const models_1 = require("./models");
    -const types_1 = require("./utils/types");
     class TrustedMetadataStore {
         constructor(rootData) {
             this.trustedSet = {};
    @@ -32,18 +31,18 @@ class TrustedMetadataStore {
         }
         updateRoot(bytesBuffer) {
             const data = JSON.parse(bytesBuffer.toString('utf8'));
    -        const newRoot = models_1.Metadata.fromJSON(types_1.MetadataKind.Root, data);
    -        if (newRoot.signed.type != types_1.MetadataKind.Root) {
    +        const newRoot = models_1.Metadata.fromJSON(models_1.MetadataKind.Root, data);
    +        if (newRoot.signed.type != models_1.MetadataKind.Root) {
                 throw new error_1.RepositoryError(`Expected 'root', got ${newRoot.signed.type}`);
             }
             // Client workflow 5.4: check for arbitrary software attack
    -        this.root.verifyDelegate(types_1.MetadataKind.Root, newRoot);
    +        this.root.verifyDelegate(models_1.MetadataKind.Root, newRoot);
             // Client workflow 5.5: check for rollback attack
             if (newRoot.signed.version != this.root.signed.version + 1) {
                 throw new error_1.BadVersionError(`Expected version ${this.root.signed.version + 1}, got ${newRoot.signed.version}`);
             }
             // Check that new root is signed by self
    -        newRoot.verifyDelegate(types_1.MetadataKind.Root, newRoot);
    +        newRoot.verifyDelegate(models_1.MetadataKind.Root, newRoot);
             // Client workflow 5.7: set new root as trusted root
             this.trustedSet.root = newRoot;
             return newRoot;
    @@ -56,12 +55,12 @@ class TrustedMetadataStore {
                 throw new error_1.ExpiredMetadataError('Final root.json is expired');
             }
             const data = JSON.parse(bytesBuffer.toString('utf8'));
    -        const newTimestamp = models_1.Metadata.fromJSON(types_1.MetadataKind.Timestamp, data);
    -        if (newTimestamp.signed.type != types_1.MetadataKind.Timestamp) {
    +        const newTimestamp = models_1.Metadata.fromJSON(models_1.MetadataKind.Timestamp, data);
    +        if (newTimestamp.signed.type != models_1.MetadataKind.Timestamp) {
                 throw new error_1.RepositoryError(`Expected 'timestamp', got ${newTimestamp.signed.type}`);
             }
             // Client workflow 5.4.2: check for arbitrary software attack
    -        this.root.verifyDelegate(types_1.MetadataKind.Timestamp, newTimestamp);
    +        this.root.verifyDelegate(models_1.MetadataKind.Timestamp, newTimestamp);
             if (this.timestamp) {
                 // Prevent rolling back timestamp version
                 // Client workflow 5.4.3.1: check for rollback attack
    @@ -104,12 +103,12 @@ class TrustedMetadataStore {
                 snapshotMeta.verify(bytesBuffer);
             }
             const data = JSON.parse(bytesBuffer.toString('utf8'));
    -        const newSnapshot = models_1.Metadata.fromJSON(types_1.MetadataKind.Snapshot, data);
    -        if (newSnapshot.signed.type != types_1.MetadataKind.Snapshot) {
    +        const newSnapshot = models_1.Metadata.fromJSON(models_1.MetadataKind.Snapshot, data);
    +        if (newSnapshot.signed.type != models_1.MetadataKind.Snapshot) {
                 throw new error_1.RepositoryError(`Expected 'snapshot', got ${newSnapshot.signed.type}`);
             }
             // Client workflow 5.5.3: check for arbitrary software attack
    -        this.root.verifyDelegate(types_1.MetadataKind.Snapshot, newSnapshot);
    +        this.root.verifyDelegate(models_1.MetadataKind.Snapshot, newSnapshot);
             // version check against meta version (5.5.4) is deferred to allow old
             // snapshot to be used in rollback protection
             // Client workflow 5.5.5: check for rollback attack
    @@ -149,8 +148,8 @@ class TrustedMetadataStore {
             // Client workflow 5.6.2: check against snapshot role's targets hash
             meta.verify(bytesBuffer);
             const data = JSON.parse(bytesBuffer.toString('utf8'));
    -        const newDelegate = models_1.Metadata.fromJSON(types_1.MetadataKind.Targets, data);
    -        if (newDelegate.signed.type != types_1.MetadataKind.Targets) {
    +        const newDelegate = models_1.Metadata.fromJSON(models_1.MetadataKind.Targets, data);
    +        if (newDelegate.signed.type != models_1.MetadataKind.Targets) {
                 throw new error_1.RepositoryError(`Expected 'targets', got ${newDelegate.signed.type}`);
             }
             // Client workflow 5.6.3: check for arbitrary software attack
    @@ -170,11 +169,11 @@ class TrustedMetadataStore {
         // Note that an expired initial root is still considered valid.
         loadTrustedRoot(bytesBuffer) {
             const data = JSON.parse(bytesBuffer.toString('utf8'));
    -        const root = models_1.Metadata.fromJSON(types_1.MetadataKind.Root, data);
    -        if (root.signed.type != types_1.MetadataKind.Root) {
    +        const root = models_1.Metadata.fromJSON(models_1.MetadataKind.Root, data);
    +        if (root.signed.type != models_1.MetadataKind.Root) {
                 throw new error_1.RepositoryError(`Expected 'root', got ${root.signed.type}`);
             }
    -        root.verifyDelegate(types_1.MetadataKind.Root, root);
    +        root.verifyDelegate(models_1.MetadataKind.Root, root);
             this.trustedSet['root'] = root;
         }
         checkFinalTimestamp() {
    diff --git a/deps/npm/node_modules/tuf-js/dist/updater.d.ts b/deps/npm/node_modules/tuf-js/dist/updater.d.ts
    deleted file mode 100644
    index e49dca22a43d35..00000000000000
    --- a/deps/npm/node_modules/tuf-js/dist/updater.d.ts
    +++ /dev/null
    @@ -1,33 +0,0 @@
    -import { BaseFetcher } from './fetcher';
    -import { TargetFile } from './models/file';
    -import { Config } from './utils/config';
    -export interface UpdaterOptions {
    -    metadataDir: string;
    -    metadataBaseUrl: string;
    -    targetDir?: string;
    -    targetBaseUrl?: string;
    -    fetcher?: BaseFetcher;
    -    config?: Partial;
    -}
    -export declare class Updater {
    -    private dir;
    -    private metadataBaseUrl;
    -    private targetDir?;
    -    private targetBaseUrl?;
    -    private trustedSet;
    -    private config;
    -    private fetcher;
    -    constructor(options: UpdaterOptions);
    -    refresh(): Promise;
    -    getTargetInfo(targetPath: string): Promise;
    -    downloadTarget(targetInfo: TargetFile, filePath?: string, targetBaseUrl?: string): Promise;
    -    findCachedTarget(targetInfo: TargetFile, filePath?: string): Promise;
    -    private loadLocalMetadata;
    -    private loadRoot;
    -    private loadTimestamp;
    -    private loadSnapshot;
    -    private loadTargets;
    -    private preorderDepthFirstWalk;
    -    private generateTargetPath;
    -    private persistMetadata;
    -}
    diff --git a/deps/npm/node_modules/tuf-js/dist/updater.js b/deps/npm/node_modules/tuf-js/dist/updater.js
    index 9f33c667ce9b2e..7f8b6bedeedd3e 100644
    --- a/deps/npm/node_modules/tuf-js/dist/updater.js
    +++ b/deps/npm/node_modules/tuf-js/dist/updater.js
    @@ -24,13 +24,13 @@ var __importStar = (this && this.__importStar) || function (mod) {
     };
     Object.defineProperty(exports, "__esModule", { value: true });
     exports.Updater = void 0;
    +const models_1 = require("@tufjs/models");
     const fs = __importStar(require("fs"));
     const path = __importStar(require("path"));
    +const config_1 = require("./config");
     const error_1 = require("./error");
     const fetcher_1 = require("./fetcher");
     const store_1 = require("./store");
    -const config_1 = require("./utils/config");
    -const types_1 = require("./utils/types");
     class Updater {
         constructor(options) {
             const { metadataDir, metadataBaseUrl, targetDir, targetBaseUrl, fetcher, config, } = options;
    @@ -38,12 +38,12 @@ class Updater {
             this.metadataBaseUrl = metadataBaseUrl;
             this.targetDir = targetDir;
             this.targetBaseUrl = targetBaseUrl;
    -        const data = this.loadLocalMetadata(types_1.MetadataKind.Root);
    +        const data = this.loadLocalMetadata(models_1.MetadataKind.Root);
             this.trustedSet = new store_1.TrustedMetadataStore(data);
             this.config = { ...config_1.defaultConfig, ...config };
             this.fetcher =
                 fetcher ||
    -                new fetcher_1.Fetcher({
    +                new fetcher_1.DefaultFetcher({
                         timeout: this.config.fetchTimeout,
                         retries: this.config.fetchRetries,
                     });
    @@ -52,7 +52,7 @@ class Updater {
             await this.loadRoot();
             await this.loadTimestamp();
             await this.loadSnapshot();
    -        await this.loadTargets(types_1.MetadataKind.Targets, types_1.MetadataKind.Root);
    +        await this.loadTargets(models_1.MetadataKind.Targets, models_1.MetadataKind.Root);
         }
         // Returns the TargetFile instance with information for the given target path.
         //
    @@ -123,7 +123,7 @@ class Updater {
                     // Client workflow 5.3.4 - 5.4.7
                     this.trustedSet.updateRoot(bytesData);
                     // Client workflow 5.3.8: persist root metadata file
    -                this.persistMetadata(types_1.MetadataKind.Root, bytesData);
    +                this.persistMetadata(models_1.MetadataKind.Root, bytesData);
                 }
                 catch (error) {
                     break;
    @@ -135,7 +135,7 @@ class Updater {
         async loadTimestamp() {
             // Load local and remote timestamp metadata
             try {
    -            const data = this.loadLocalMetadata(types_1.MetadataKind.Timestamp);
    +            const data = this.loadLocalMetadata(models_1.MetadataKind.Timestamp);
                 this.trustedSet.updateTimestamp(data);
             }
             catch (error) {
    @@ -159,14 +159,14 @@ class Updater {
                 throw error;
             }
             // Client workflow 5.4.5: persist timestamp metadata
    -        this.persistMetadata(types_1.MetadataKind.Timestamp, bytesData);
    +        this.persistMetadata(models_1.MetadataKind.Timestamp, bytesData);
         }
         // Load local and remote snapshot metadata.
         // Client workflow 5.5: update snapshot role
         async loadSnapshot() {
             //Load local (and if needed remote) snapshot metadata
             try {
    -            const data = this.loadLocalMetadata(types_1.MetadataKind.Snapshot);
    +            const data = this.loadLocalMetadata(models_1.MetadataKind.Snapshot);
                 this.trustedSet.updateSnapshot(data, true);
             }
             catch (error) {
    @@ -185,7 +185,7 @@ class Updater {
                     // Client workflow 5.5.2 - 5.5.6
                     this.trustedSet.updateSnapshot(bytesData);
                     // Client workflow 5.5.7: persist snapshot metadata file
    -                this.persistMetadata(types_1.MetadataKind.Snapshot, bytesData);
    +                this.persistMetadata(models_1.MetadataKind.Snapshot, bytesData);
                 }
                 catch (error) {
                     throw new error_1.RuntimeError(`Unable to load snapshot metadata error ${error}`);
    @@ -236,8 +236,8 @@ class Updater {
             // is needed to load and verify the delegated targets metadata.
             const delegationsToVisit = [
                 {
    -                roleName: types_1.MetadataKind.Targets,
    -                parentRoleName: types_1.MetadataKind.Root,
    +                roleName: models_1.MetadataKind.Targets,
    +                parentRoleName: models_1.MetadataKind.Root,
                 },
             ];
             const visitedRoleNames = new Set();
    diff --git a/deps/npm/node_modules/tuf-js/dist/utils/config.d.ts b/deps/npm/node_modules/tuf-js/dist/utils/config.d.ts
    deleted file mode 100644
    index 2a906c7c28d86b..00000000000000
    --- a/deps/npm/node_modules/tuf-js/dist/utils/config.d.ts
    +++ /dev/null
    @@ -1,12 +0,0 @@
    -export declare const defaultConfig: {
    -    maxRootRotations: number;
    -    maxDelegations: number;
    -    rootMaxLength: number;
    -    timestampMaxLength: number;
    -    snapshotMaxLength: number;
    -    targetsMaxLength: number;
    -    prefixTargetsWithHash: boolean;
    -    fetchTimeout: number;
    -    fetchRetries: number;
    -};
    -export type Config = typeof defaultConfig;
    diff --git a/deps/npm/node_modules/tuf-js/dist/utils/guard.d.ts b/deps/npm/node_modules/tuf-js/dist/utils/guard.d.ts
    deleted file mode 100644
    index 17bc4ce3c7ea53..00000000000000
    --- a/deps/npm/node_modules/tuf-js/dist/utils/guard.d.ts
    +++ /dev/null
    @@ -1,8 +0,0 @@
    -import { JSONObject, MetadataKind } from './types';
    -export declare function isDefined(val: T | undefined): val is T;
    -export declare function isObject(value: unknown): value is JSONObject;
    -export declare function isStringArray(value: unknown): value is string[];
    -export declare function isObjectArray(value: unknown): value is JSONObject[];
    -export declare function isStringRecord(value: unknown): value is Record;
    -export declare function isObjectRecord(value: unknown): value is Record;
    -export declare function isMetadataKind(value: unknown): value is MetadataKind;
    diff --git a/deps/npm/node_modules/tuf-js/dist/utils/guard.js b/deps/npm/node_modules/tuf-js/dist/utils/guard.js
    deleted file mode 100644
    index f2207af18690ac..00000000000000
    --- a/deps/npm/node_modules/tuf-js/dist/utils/guard.js
    +++ /dev/null
    @@ -1,39 +0,0 @@
    -"use strict";
    -Object.defineProperty(exports, "__esModule", { value: true });
    -exports.isMetadataKind = exports.isObjectRecord = exports.isStringRecord = exports.isObjectArray = exports.isStringArray = exports.isObject = exports.isDefined = void 0;
    -const types_1 = require("./types");
    -function isDefined(val) {
    -    return val !== undefined;
    -}
    -exports.isDefined = isDefined;
    -function isObject(value) {
    -    return typeof value === 'object' && value !== null;
    -}
    -exports.isObject = isObject;
    -function isStringArray(value) {
    -    return Array.isArray(value) && value.every((v) => typeof v === 'string');
    -}
    -exports.isStringArray = isStringArray;
    -function isObjectArray(value) {
    -    return Array.isArray(value) && value.every(isObject);
    -}
    -exports.isObjectArray = isObjectArray;
    -function isStringRecord(value) {
    -    return (typeof value === 'object' &&
    -        value !== null &&
    -        Object.keys(value).every((k) => typeof k === 'string') &&
    -        Object.values(value).every((v) => typeof v === 'string'));
    -}
    -exports.isStringRecord = isStringRecord;
    -function isObjectRecord(value) {
    -    return (typeof value === 'object' &&
    -        value !== null &&
    -        Object.keys(value).every((k) => typeof k === 'string') &&
    -        Object.values(value).every((v) => typeof v === 'object' && v !== null));
    -}
    -exports.isObjectRecord = isObjectRecord;
    -function isMetadataKind(value) {
    -    return (typeof value === 'string' &&
    -        Object.values(types_1.MetadataKind).includes(value));
    -}
    -exports.isMetadataKind = isMetadataKind;
    diff --git a/deps/npm/node_modules/tuf-js/dist/utils/index.d.ts b/deps/npm/node_modules/tuf-js/dist/utils/index.d.ts
    deleted file mode 100644
    index e2232bc5cceab8..00000000000000
    --- a/deps/npm/node_modules/tuf-js/dist/utils/index.d.ts
    +++ /dev/null
    @@ -1,5 +0,0 @@
    -export * as config from './config';
    -export * as guard from './guard';
    -export * as json from './json';
    -export * as signer from './signer';
    -export * as types from './types';
    diff --git a/deps/npm/node_modules/tuf-js/dist/utils/index.js b/deps/npm/node_modules/tuf-js/dist/utils/index.js
    deleted file mode 100644
    index 604696a30565b4..00000000000000
    --- a/deps/npm/node_modules/tuf-js/dist/utils/index.js
    +++ /dev/null
    @@ -1,31 +0,0 @@
    -"use strict";
    -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    -    if (k2 === undefined) k2 = k;
    -    var desc = Object.getOwnPropertyDescriptor(m, k);
    -    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
    -      desc = { enumerable: true, get: function() { return m[k]; } };
    -    }
    -    Object.defineProperty(o, k2, desc);
    -}) : (function(o, m, k, k2) {
    -    if (k2 === undefined) k2 = k;
    -    o[k2] = m[k];
    -}));
    -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    -    Object.defineProperty(o, "default", { enumerable: true, value: v });
    -}) : function(o, v) {
    -    o["default"] = v;
    -});
    -var __importStar = (this && this.__importStar) || function (mod) {
    -    if (mod && mod.__esModule) return mod;
    -    var result = {};
    -    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    -    __setModuleDefault(result, mod);
    -    return result;
    -};
    -Object.defineProperty(exports, "__esModule", { value: true });
    -exports.types = exports.signer = exports.json = exports.guard = exports.config = void 0;
    -exports.config = __importStar(require("./config"));
    -exports.guard = __importStar(require("./guard"));
    -exports.json = __importStar(require("./json"));
    -exports.signer = __importStar(require("./signer"));
    -exports.types = __importStar(require("./types"));
    diff --git a/deps/npm/node_modules/tuf-js/dist/utils/json.d.ts b/deps/npm/node_modules/tuf-js/dist/utils/json.d.ts
    deleted file mode 100644
    index ecddbee17c4469..00000000000000
    --- a/deps/npm/node_modules/tuf-js/dist/utils/json.d.ts
    +++ /dev/null
    @@ -1,2 +0,0 @@
    -/// 
    -export declare function canonicalize(object: any): Buffer;
    diff --git a/deps/npm/node_modules/tuf-js/dist/utils/key.d.ts b/deps/npm/node_modules/tuf-js/dist/utils/key.d.ts
    deleted file mode 100644
    index 7b631281a34086..00000000000000
    --- a/deps/npm/node_modules/tuf-js/dist/utils/key.d.ts
    +++ /dev/null
    @@ -1,9 +0,0 @@
    -/// 
    -import { VerifyKeyObjectInput } from 'crypto';
    -interface KeyInfo {
    -    keyType: string;
    -    scheme: string;
    -    keyVal: string;
    -}
    -export declare function getPublicKey(keyInfo: KeyInfo): VerifyKeyObjectInput;
    -export {};
    diff --git a/deps/npm/node_modules/tuf-js/dist/utils/oid.d.ts b/deps/npm/node_modules/tuf-js/dist/utils/oid.d.ts
    deleted file mode 100644
    index f20456a978f0ee..00000000000000
    --- a/deps/npm/node_modules/tuf-js/dist/utils/oid.d.ts
    +++ /dev/null
    @@ -1,2 +0,0 @@
    -/// 
    -export declare function encodeOIDString(oid: string): Buffer;
    diff --git a/deps/npm/node_modules/tuf-js/dist/utils/signer.d.ts b/deps/npm/node_modules/tuf-js/dist/utils/signer.d.ts
    deleted file mode 100644
    index 376ef113c49110..00000000000000
    --- a/deps/npm/node_modules/tuf-js/dist/utils/signer.d.ts
    +++ /dev/null
    @@ -1,3 +0,0 @@
    -import crypto from 'crypto';
    -import { JSONObject } from '../utils/types';
    -export declare const verifySignature: (metaDataSignedData: JSONObject, key: crypto.VerifyKeyObjectInput, signature: string) => boolean;
    diff --git a/deps/npm/node_modules/tuf-js/dist/utils/tmpfile.d.ts b/deps/npm/node_modules/tuf-js/dist/utils/tmpfile.d.ts
    deleted file mode 100644
    index 4d5ee8abb84a6b..00000000000000
    --- a/deps/npm/node_modules/tuf-js/dist/utils/tmpfile.d.ts
    +++ /dev/null
    @@ -1,3 +0,0 @@
    -type TempFileHandler = (file: string) => Promise;
    -export declare const withTempFile: (handler: TempFileHandler) => Promise;
    -export {};
    diff --git a/deps/npm/node_modules/tuf-js/dist/utils/types.d.ts b/deps/npm/node_modules/tuf-js/dist/utils/types.d.ts
    deleted file mode 100644
    index 24319ddf7bb6bc..00000000000000
    --- a/deps/npm/node_modules/tuf-js/dist/utils/types.d.ts
    +++ /dev/null
    @@ -1,10 +0,0 @@
    -export declare enum MetadataKind {
    -    Root = "root",
    -    Timestamp = "timestamp",
    -    Snapshot = "snapshot",
    -    Targets = "targets"
    -}
    -export type JSONObject = {
    -    [key: string]: JSONValue;
    -};
    -export type JSONValue = null | boolean | number | string | JSONValue[] | JSONObject;
    diff --git a/deps/npm/node_modules/tuf-js/dist/utils/types.js b/deps/npm/node_modules/tuf-js/dist/utils/types.js
    deleted file mode 100644
    index 469f580743f652..00000000000000
    --- a/deps/npm/node_modules/tuf-js/dist/utils/types.js
    +++ /dev/null
    @@ -1,10 +0,0 @@
    -"use strict";
    -Object.defineProperty(exports, "__esModule", { value: true });
    -exports.MetadataKind = void 0;
    -var MetadataKind;
    -(function (MetadataKind) {
    -    MetadataKind["Root"] = "root";
    -    MetadataKind["Timestamp"] = "timestamp";
    -    MetadataKind["Snapshot"] = "snapshot";
    -    MetadataKind["Targets"] = "targets";
    -})(MetadataKind = exports.MetadataKind || (exports.MetadataKind = {}));
    diff --git a/deps/npm/node_modules/tuf-js/package.json b/deps/npm/node_modules/tuf-js/package.json
    index 758e71223e40f6..4396e202369b8b 100644
    --- a/deps/npm/node_modules/tuf-js/package.json
    +++ b/deps/npm/node_modules/tuf-js/package.json
    @@ -1,56 +1,42 @@
     {
       "name": "tuf-js",
    -  "version": "1.0.0",
    +  "version": "1.1.2",
       "description": "JavaScript implementation of The Update Framework (TUF)",
       "main": "dist/index.js",
       "types": "dist/index.d.ts",
       "scripts": {
    -    "build": "tsc",
    -    "test": "jest",
    -    "test:watch": "jest --watch",
    -    "test:ci": "jest --maxWorkers=2 --coverage",
    -    "lint": "eslint --fix --ext .ts src/**",
    -    "lint:check": "eslint --max-warnings 0 --ext .ts src/**",
    -    "format": "prettier --write \"src/**/*\""
    +    "build": "tsc --build",
    +    "clean": "rm -rf dist",
    +    "test": "jest"
       },
       "repository": {
         "type": "git",
    -    "url": "git+https://github.com/github/tuf-js.git"
    +    "url": "git+https://github.com/theupdateframework/tuf-js.git"
       },
       "files": [
         "dist"
       ],
       "keywords": [
    -    "tuf"
    +    "tuf",
    +    "security",
    +    "update"
       ],
       "author": "bdehamer@github.com",
       "license": "MIT",
       "bugs": {
    -    "url": "https://github.com/github/tuf-js/issues"
    +    "url": "https://github.com/theupdateframework/tuf-js/issues"
       },
    -  "homepage": "https://github.com/github/tuf-js#readme",
    +  "homepage": "https://github.com/theupdateframework/tuf-js/tree/main/packages/client#readme",
       "devDependencies": {
    -    "@tsconfig/node14": "^1.0.3",
    -    "@types/jest": "^28.1.8",
    -    "@types/lodash.isequal": "^4.5.6",
    +    "@tufjs/repo-mock": "1.0.1",
         "@types/make-fetch-happen": "^10.0.1",
    -    "@types/minimatch": "^5.1.2",
    -    "@types/node": "^18.11.10",
    -    "@typescript-eslint/eslint-plugin": "^5.45.0",
    -    "@typescript-eslint/parser": "^5.45.0",
    -    "eslint": "^8.28.0",
    -    "eslint-config-prettier": "^8.5.0",
    -    "eslint-plugin-prettier": "^4.2.1",
    -    "http-server": "^14.1.1",
    -    "jest": "^28.1.3",
    +    "@types/node": "^18.15.3",
         "nock": "^13.2.9",
    -    "prettier": "^2.8.0",
    -    "ts-jest": "^28.0.8",
    -    "typescript": "^4.9.3"
    +    "typescript": "^4.9.5"
       },
       "dependencies": {
         "make-fetch-happen": "^11.0.1",
    -    "minimatch": "^6.1.0"
    +    "@tufjs/models": "1.0.1"
       },
       "engines": {
         "node": "^14.17.0 || ^16.13.0 || >=18.0.0"
    diff --git a/deps/npm/package.json b/deps/npm/package.json
    index 851d7de8b80134..4cbc0fc20913ac 100644
    --- a/deps/npm/package.json
    +++ b/deps/npm/package.json
    @@ -1,5 +1,5 @@
     {
    -  "version": "9.5.1",
    +  "version": "9.6.4",
       "name": "npm",
       "description": "a package manager for JavaScript",
       "workspaces": [
    @@ -53,14 +53,14 @@
       },
       "dependencies": {
         "@isaacs/string-locale-compare": "^1.1.0",
    -    "@npmcli/arborist": "^6.2.3",
    -    "@npmcli/config": "^6.1.3",
    -    "@npmcli/map-workspaces": "^3.0.2",
    +    "@npmcli/arborist": "^6.2.7",
    +    "@npmcli/config": "^6.1.5",
    +    "@npmcli/map-workspaces": "^3.0.3",
         "@npmcli/package-json": "^3.0.0",
         "@npmcli/run-script": "^6.0.0",
         "abbrev": "^2.0.0",
         "archy": "~1.0.0",
    -    "cacache": "^17.0.4",
    +    "cacache": "^17.0.5",
         "chalk": "^4.1.2",
         "ci-info": "^3.8.0",
         "cli-columns": "^4.0.0",
    @@ -68,33 +68,33 @@
         "columnify": "^1.6.0",
         "fastest-levenshtein": "^1.0.16",
         "fs-minipass": "^3.0.1",
    -    "glob": "^8.1.0",
    -    "graceful-fs": "^4.2.10",
    +    "glob": "^9.3.2",
    +    "graceful-fs": "^4.2.11",
         "hosted-git-info": "^6.1.1",
         "ini": "^3.0.1",
         "init-package-json": "^5.0.0",
         "is-cidr": "^4.0.2",
         "json-parse-even-better-errors": "^3.0.0",
         "libnpmaccess": "^7.0.2",
    -    "libnpmdiff": "^5.0.11",
    -    "libnpmexec": "^5.0.11",
    -    "libnpmfund": "^4.0.11",
    +    "libnpmdiff": "^5.0.15",
    +    "libnpmexec": "^5.0.15",
    +    "libnpmfund": "^4.0.15",
         "libnpmhook": "^9.0.3",
         "libnpmorg": "^5.0.3",
    -    "libnpmpack": "^5.0.11",
    -    "libnpmpublish": "^7.1.0",
    +    "libnpmpack": "^5.0.15",
    +    "libnpmpublish": "^7.1.3",
         "libnpmsearch": "^6.0.2",
         "libnpmteam": "^5.0.3",
         "libnpmversion": "^4.0.2",
         "make-fetch-happen": "^11.0.3",
    -    "minimatch": "^6.2.0",
    -    "minipass": "^4.0.3",
    +    "minimatch": "^7.4.3",
    +    "minipass": "^4.2.5",
         "minipass-pipeline": "^1.2.4",
         "ms": "^2.1.2",
         "node-gyp": "^9.3.1",
    -    "nopt": "^7.0.0",
    +    "nopt": "^7.1.0",
         "npm-audit-report": "^4.0.0",
    -    "npm-install-checks": "^6.0.0",
    +    "npm-install-checks": "^6.1.0",
         "npm-package-arg": "^10.1.0",
         "npm-pick-manifest": "^8.0.1",
         "npm-profile": "^7.0.1",
    @@ -103,14 +103,14 @@
         "npmlog": "^7.0.1",
         "p-map": "^4.0.0",
         "pacote": "^15.1.1",
    -    "parse-conflict-json": "^3.0.0",
    +    "parse-conflict-json": "^3.0.1",
         "proc-log": "^3.0.0",
         "qrcode-terminal": "^0.12.0",
         "read": "^2.0.0",
    -    "read-package-json": "^6.0.0",
    +    "read-package-json": "^6.0.1",
         "read-package-json-fast": "^3.0.2",
         "semver": "^7.3.8",
    -    "ssri": "^10.0.1",
    +    "ssri": "^10.0.2",
         "tar": "^6.1.13",
         "text-table": "~0.2.0",
         "tiny-relative-date": "^1.3.0",
    @@ -191,10 +191,10 @@
         "@npmcli/docs": "^1.0.0",
         "@npmcli/eslint-config": "^4.0.0",
         "@npmcli/fs": "^3.1.0",
    -    "@npmcli/git": "^4.0.1",
    +    "@npmcli/git": "^4.0.4",
         "@npmcli/mock-registry": "^1.0.0",
         "@npmcli/promise-spawn": "^6.0.2",
    -    "@npmcli/template-oss": "4.11.4",
    +    "@npmcli/template-oss": "4.12.1",
         "licensee": "^10.0.0",
         "nock": "^13.3.0",
         "npm-packlist": "^7.0.4",
    @@ -248,7 +248,7 @@
       },
       "templateOSS": {
         "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
    -    "version": "4.11.4",
    +    "version": "4.12.1",
         "content": "./scripts/template-oss/root.js"
       },
       "license": "Artistic-2.0",
    diff --git a/deps/npm/tap-snapshots/test/lib/commands/completion.js.test.cjs b/deps/npm/tap-snapshots/test/lib/commands/completion.js.test.cjs
    index 3e7125bc33ba97..b21e378b1cfbe8 100644
    --- a/deps/npm/tap-snapshots/test/lib/commands/completion.js.test.cjs
    +++ b/deps/npm/tap-snapshots/test/lib/commands/completion.js.test.cjs
    @@ -66,6 +66,7 @@ Array [
           fund
           get
           help
    +      help-search
           hook
           init
           install
    diff --git a/deps/npm/tap-snapshots/test/lib/commands/profile.js.test.cjs b/deps/npm/tap-snapshots/test/lib/commands/profile.js.test.cjs
    index 4959f7cdd2cc32..4530dbf95cec24 100644
    --- a/deps/npm/tap-snapshots/test/lib/commands/profile.js.test.cjs
    +++ b/deps/npm/tap-snapshots/test/lib/commands/profile.js.test.cjs
    @@ -31,6 +31,19 @@ exports[`test/lib/commands/profile.js TAP profile get multiple args default outp
     foo	foo@github.com (verified)	https://github.com/npm
     `
     
    +exports[`test/lib/commands/profile.js TAP profile get no args --color > should output all profile info with color result 1`] = `
    +name: foo
    +email: foo@github.com (verified)
    +two-factor auth: auth-and-writes
    +fullname: Foo Bar
    +homepage: https://github.com
    +freenode: foobar
    +twitter: https://twitter.com/npmjs
    +github: https://github.com/npm
    +created: 2015-02-26T01:26:37.384Z
    +updated: 2020-08-12T16:19:35.326Z
    +`
    +
     exports[`test/lib/commands/profile.js TAP profile get no args --parseable > should output all profile info as parseable result 1`] = `
     tfa	auth-and-writes
     name	foo
    @@ -46,56 +59,56 @@ github	https://github.com/npm
     `
     
     exports[`test/lib/commands/profile.js TAP profile get no args default output > should output table with contents 1`] = `
    -name: foo
    -email: foo@github.com (verified)
    -two-factor auth: auth-and-writes
    -fullname: Foo Bar
    -homepage: https://github.com
    -freenode: foobar
    -twitter: https://twitter.com/npmjs
    -github: https://github.com/npm
    -created: 2015-02-26T01:26:37.384Z
    -updated: 2020-08-12T16:19:35.326Z
    +name: foo
    +email: foo@github.com (verified)
    +two-factor auth: auth-and-writes
    +fullname: Foo Bar
    +homepage: https://github.com
    +freenode: foobar
    +twitter: https://twitter.com/npmjs
    +github: https://github.com/npm
    +created: 2015-02-26T01:26:37.384Z
    +updated: 2020-08-12T16:19:35.326Z
     `
     
     exports[`test/lib/commands/profile.js TAP profile get no args no tfa enabled > should output expected profile values 1`] = `
    -name: foo
    -email: foo@github.com (verified)
    -two-factor auth: disabled
    -fullname: Foo Bar
    -homepage: https://github.com
    -freenode: foobar
    -twitter: https://twitter.com/npmjs
    -github: https://github.com/npm
    -created: 2015-02-26T01:26:37.384Z
    -updated: 2020-08-12T16:19:35.326Z
    +name: foo
    +email: foo@github.com (verified)
    +two-factor auth: disabled
    +fullname: Foo Bar
    +homepage: https://github.com
    +freenode: foobar
    +twitter: https://twitter.com/npmjs
    +github: https://github.com/npm
    +created: 2015-02-26T01:26:37.384Z
    +updated: 2020-08-12T16:19:35.326Z
     `
     
     exports[`test/lib/commands/profile.js TAP profile get no args profile has cidr_whitelist item > should output table with contents 1`] = `
    -name: foo
    -email: foo@github.com (verified)
    -two-factor auth: auth-and-writes
    -fullname: Foo Bar
    -homepage: https://github.com
    -freenode: foobar
    -twitter: https://twitter.com/npmjs
    -github: https://github.com/npm
    -created: 2015-02-26T01:26:37.384Z
    -updated: 2020-08-12T16:19:35.326Z
    -cidr_whitelist: 192.168.1.1
    +name: foo
    +email: foo@github.com (verified)
    +two-factor auth: auth-and-writes
    +fullname: Foo Bar
    +homepage: https://github.com
    +freenode: foobar
    +twitter: https://twitter.com/npmjs
    +github: https://github.com/npm
    +created: 2015-02-26T01:26:37.384Z
    +updated: 2020-08-12T16:19:35.326Z
    +cidr_whitelist: 192.168.1.1
     `
     
     exports[`test/lib/commands/profile.js TAP profile get no args unverified email > should output table with contents 1`] = `
    -name: foo
    -email: foo@github.com(unverified)
    -two-factor auth: auth-and-writes
    -fullname: Foo Bar
    -homepage: https://github.com
    -freenode: foobar
    -twitter: https://twitter.com/npmjs
    -github: https://github.com/npm
    -created: 2015-02-26T01:26:37.384Z
    -updated: 2020-08-12T16:19:35.326Z
    +name: foo
    +email: foo@github.com(unverified)
    +two-factor auth: auth-and-writes
    +fullname: Foo Bar
    +homepage: https://github.com
    +freenode: foobar
    +twitter: https://twitter.com/npmjs
    +github: https://github.com/npm
    +created: 2015-02-26T01:26:37.384Z
    +updated: 2020-08-12T16:19:35.326Z
     `
     
     exports[`test/lib/commands/profile.js TAP profile set   writable key --parseable > should output parseable set key success msg 1`] = `
    diff --git a/deps/npm/tap-snapshots/test/lib/docs.js.test.cjs b/deps/npm/tap-snapshots/test/lib/docs.js.test.cjs
    index dfd287eaa69648..94b429988def4b 100644
    --- a/deps/npm/tap-snapshots/test/lib/docs.js.test.cjs
    +++ b/deps/npm/tap-snapshots/test/lib/docs.js.test.cjs
    @@ -33,349 +33,6 @@ Configuration fields: npm help 7 config
     npm@{VERSION} {BASEDIR}
     `
     
    -exports[`test/lib/docs.js TAP command list > abbrevs 1`] = `
    -Object {
    -  "ac": "access",
    -  "acc": "access",
    -  "acce": "access",
    -  "acces": "access",
    -  "access": "access",
    -  "add": "add",
    -  "add-": "add-user",
    -  "add-u": "add-user",
    -  "add-us": "add-user",
    -  "add-use": "add-user",
    -  "add-user": "add-user",
    -  "addu": "adduser",
    -  "addus": "adduser",
    -  "adduse": "adduser",
    -  "adduser": "adduser",
    -  "aud": "audit",
    -  "audi": "audit",
    -  "audit": "audit",
    -  "aut": "author",
    -  "auth": "author",
    -  "autho": "author",
    -  "author": "author",
    -  "b": "bugs",
    -  "bu": "bugs",
    -  "bug": "bugs",
    -  "bugs": "bugs",
    -  "c": "c",
    -  "ca": "cache",
    -  "cac": "cache",
    -  "cach": "cache",
    -  "cache": "cache",
    -  "ci": "ci",
    -  "cit": "cit",
    -  "clean-install": "clean-install",
    -  "clean-install-": "clean-install-test",
    -  "clean-install-t": "clean-install-test",
    -  "clean-install-te": "clean-install-test",
    -  "clean-install-tes": "clean-install-test",
    -  "clean-install-test": "clean-install-test",
    -  "com": "completion",
    -  "comp": "completion",
    -  "compl": "completion",
    -  "comple": "completion",
    -  "complet": "completion",
    -  "completi": "completion",
    -  "completio": "completion",
    -  "completion": "completion",
    -  "con": "config",
    -  "conf": "config",
    -  "confi": "config",
    -  "config": "config",
    -  "cr": "create",
    -  "cre": "create",
    -  "crea": "create",
    -  "creat": "create",
    -  "create": "create",
    -  "dd": "ddp",
    -  "ddp": "ddp",
    -  "ded": "dedupe",
    -  "dedu": "dedupe",
    -  "dedup": "dedupe",
    -  "dedupe": "dedupe",
    -  "dep": "deprecate",
    -  "depr": "deprecate",
    -  "depre": "deprecate",
    -  "deprec": "deprecate",
    -  "depreca": "deprecate",
    -  "deprecat": "deprecate",
    -  "deprecate": "deprecate",
    -  "dif": "diff",
    -  "diff": "diff",
    -  "dist-tag": "dist-tag",
    -  "dist-tags": "dist-tags",
    -  "docs": "docs",
    -  "doct": "doctor",
    -  "docto": "doctor",
    -  "doctor": "doctor",
    -  "ed": "edit",
    -  "edi": "edit",
    -  "edit": "edit",
    -  "exe": "exec",
    -  "exec": "exec",
    -  "expla": "explain",
    -  "explai": "explain",
    -  "explain": "explain",
    -  "explo": "explore",
    -  "explor": "explore",
    -  "explore": "explore",
    -  "find": "find",
    -  "find-": "find-dupes",
    -  "find-d": "find-dupes",
    -  "find-du": "find-dupes",
    -  "find-dup": "find-dupes",
    -  "find-dupe": "find-dupes",
    -  "find-dupes": "find-dupes",
    -  "fu": "fund",
    -  "fun": "fund",
    -  "fund": "fund",
    -  "g": "get",
    -  "ge": "get",
    -  "get": "get",
    -  "he": "help",
    -  "hel": "help",
    -  "help": "help",
    -  "hl": "hlep",
    -  "hle": "hlep",
    -  "hlep": "hlep",
    -  "hom": "home",
    -  "home": "home",
    -  "hoo": "hook",
    -  "hook": "hook",
    -  "i": "i",
    -  "ic": "ic",
    -  "in": "in",
    -  "inf": "info",
    -  "info": "info",
    -  "ini": "init",
    -  "init": "init",
    -  "inn": "innit",
    -  "inni": "innit",
    -  "innit": "innit",
    -  "ins": "ins",
    -  "inst": "inst",
    -  "insta": "insta",
    -  "instal": "instal",
    -  "install": "install",
    -  "install-ci": "install-ci-test",
    -  "install-ci-": "install-ci-test",
    -  "install-ci-t": "install-ci-test",
    -  "install-ci-te": "install-ci-test",
    -  "install-ci-tes": "install-ci-test",
    -  "install-ci-test": "install-ci-test",
    -  "install-cl": "install-clean",
    -  "install-cle": "install-clean",
    -  "install-clea": "install-clean",
    -  "install-clean": "install-clean",
    -  "install-t": "install-test",
    -  "install-te": "install-test",
    -  "install-tes": "install-test",
    -  "install-test": "install-test",
    -  "isnt": "isnt",
    -  "isnta": "isnta",
    -  "isntal": "isntal",
    -  "isntall": "isntall",
    -  "isntall-": "isntall-clean",
    -  "isntall-c": "isntall-clean",
    -  "isntall-cl": "isntall-clean",
    -  "isntall-cle": "isntall-clean",
    -  "isntall-clea": "isntall-clean",
    -  "isntall-clean": "isntall-clean",
    -  "iss": "issues",
    -  "issu": "issues",
    -  "issue": "issues",
    -  "issues": "issues",
    -  "it": "it",
    -  "la": "la",
    -  "lin": "link",
    -  "link": "link",
    -  "lis": "list",
    -  "list": "list",
    -  "ll": "ll",
    -  "ln": "ln",
    -  "logi": "login",
    -  "login": "login",
    -  "logo": "logout",
    -  "logou": "logout",
    -  "logout": "logout",
    -  "ls": "ls",
    -  "og": "ogr",
    -  "ogr": "ogr",
    -  "or": "org",
    -  "org": "org",
    -  "ou": "outdated",
    -  "out": "outdated",
    -  "outd": "outdated",
    -  "outda": "outdated",
    -  "outdat": "outdated",
    -  "outdate": "outdated",
    -  "outdated": "outdated",
    -  "ow": "owner",
    -  "own": "owner",
    -  "owne": "owner",
    -  "owner": "owner",
    -  "pa": "pack",
    -  "pac": "pack",
    -  "pack": "pack",
    -  "pi": "ping",
    -  "pin": "ping",
    -  "ping": "ping",
    -  "pk": "pkg",
    -  "pkg": "pkg",
    -  "pre": "prefix",
    -  "pref": "prefix",
    -  "prefi": "prefix",
    -  "prefix": "prefix",
    -  "pro": "profile",
    -  "prof": "profile",
    -  "profi": "profile",
    -  "profil": "profile",
    -  "profile": "profile",
    -  "pru": "prune",
    -  "prun": "prune",
    -  "prune": "prune",
    -  "pu": "publish",
    -  "pub": "publish",
    -  "publ": "publish",
    -  "publi": "publish",
    -  "publis": "publish",
    -  "publish": "publish",
    -  "q": "query",
    -  "qu": "query",
    -  "que": "query",
    -  "quer": "query",
    -  "query": "query",
    -  "r": "r",
    -  "rb": "rb",
    -  "reb": "rebuild",
    -  "rebu": "rebuild",
    -  "rebui": "rebuild",
    -  "rebuil": "rebuild",
    -  "rebuild": "rebuild",
    -  "rem": "remove",
    -  "remo": "remove",
    -  "remov": "remove",
    -  "remove": "remove",
    -  "rep": "repo",
    -  "repo": "repo",
    -  "res": "restart",
    -  "rest": "restart",
    -  "resta": "restart",
    -  "restar": "restart",
    -  "restart": "restart",
    -  "rm": "rm",
    -  "ro": "root",
    -  "roo": "root",
    -  "root": "root",
    -  "rum": "rum",
    -  "run": "run",
    -  "run-": "run-script",
    -  "run-s": "run-script",
    -  "run-sc": "run-script",
    -  "run-scr": "run-script",
    -  "run-scri": "run-script",
    -  "run-scrip": "run-script",
    -  "run-script": "run-script",
    -  "s": "s",
    -  "se": "se",
    -  "sea": "search",
    -  "sear": "search",
    -  "searc": "search",
    -  "search": "search",
    -  "set": "set",
    -  "sho": "show",
    -  "show": "show",
    -  "shr": "shrinkwrap",
    -  "shri": "shrinkwrap",
    -  "shrin": "shrinkwrap",
    -  "shrink": "shrinkwrap",
    -  "shrinkw": "shrinkwrap",
    -  "shrinkwr": "shrinkwrap",
    -  "shrinkwra": "shrinkwrap",
    -  "shrinkwrap": "shrinkwrap",
    -  "si": "sit",
    -  "sit": "sit",
    -  "star": "star",
    -  "stars": "stars",
    -  "start": "start",
    -  "sto": "stop",
    -  "stop": "stop",
    -  "t": "t",
    -  "tea": "team",
    -  "team": "team",
    -  "tes": "test",
    -  "test": "test",
    -  "to": "token",
    -  "tok": "token",
    -  "toke": "token",
    -  "token": "token",
    -  "ts": "tst",
    -  "tst": "tst",
    -  "ud": "udpate",
    -  "udp": "udpate",
    -  "udpa": "udpate",
    -  "udpat": "udpate",
    -  "udpate": "udpate",
    -  "un": "un",
    -  "uni": "uninstall",
    -  "unin": "uninstall",
    -  "unins": "uninstall",
    -  "uninst": "uninstall",
    -  "uninsta": "uninstall",
    -  "uninstal": "uninstall",
    -  "uninstall": "uninstall",
    -  "unl": "unlink",
    -  "unli": "unlink",
    -  "unlin": "unlink",
    -  "unlink": "unlink",
    -  "unp": "unpublish",
    -  "unpu": "unpublish",
    -  "unpub": "unpublish",
    -  "unpubl": "unpublish",
    -  "unpubli": "unpublish",
    -  "unpublis": "unpublish",
    -  "unpublish": "unpublish",
    -  "uns": "unstar",
    -  "unst": "unstar",
    -  "unsta": "unstar",
    -  "unstar": "unstar",
    -  "up": "up",
    -  "upd": "update",
    -  "upda": "update",
    -  "updat": "update",
    -  "update": "update",
    -  "upg": "upgrade",
    -  "upgr": "upgrade",
    -  "upgra": "upgrade",
    -  "upgrad": "upgrade",
    -  "upgrade": "upgrade",
    -  "ur": "urn",
    -  "urn": "urn",
    -  "v": "v",
    -  "veri": "verison",
    -  "veris": "verison",
    -  "veriso": "verison",
    -  "verison": "verison",
    -  "vers": "version",
    -  "versi": "version",
    -  "versio": "version",
    -  "version": "version",
    -  "vi": "view",
    -  "vie": "view",
    -  "view": "view",
    -  "who": "whoami",
    -  "whoa": "whoami",
    -  "whoam": "whoami",
    -  "whoami": "whoami",
    -  "why": "why",
    -  "x": "x",
    -}
    -`
    -
     exports[`test/lib/docs.js TAP command list > aliases 1`] = `
     Object {
       "add": "install",
    @@ -384,7 +41,7 @@ Object {
       "c": "config",
       "cit": "install-ci-test",
       "clean-install": "ci",
    -  "clean-install-test": "cit",
    +  "clean-install-test": "install-ci-test",
       "create": "init",
       "ddp": "dedupe",
       "dist-tags": "dist-tag",
    @@ -421,7 +78,7 @@ Object {
       "s": "search",
       "se": "search",
       "show": "view",
    -  "sit": "cit",
    +  "sit": "install-ci-test",
       "t": "test",
       "tst": "test",
       "udpate": "update",
    @@ -437,77 +94,6 @@ Object {
     }
     `
     
    -exports[`test/lib/docs.js TAP command list > allCommands 1`] = `
    -Array [
    -  "access",
    -  "adduser",
    -  "audit",
    -  "bugs",
    -  "cache",
    -  "ci",
    -  "completion",
    -  "config",
    -  "dedupe",
    -  "deprecate",
    -  "diff",
    -  "dist-tag",
    -  "docs",
    -  "doctor",
    -  "edit",
    -  "exec",
    -  "explain",
    -  "explore",
    -  "find-dupes",
    -  "fund",
    -  "get",
    -  "help",
    -  "help-search",
    -  "hook",
    -  "init",
    -  "install",
    -  "install-ci-test",
    -  "install-test",
    -  "link",
    -  "ll",
    -  "login",
    -  "logout",
    -  "ls",
    -  "org",
    -  "outdated",
    -  "owner",
    -  "pack",
    -  "ping",
    -  "pkg",
    -  "prefix",
    -  "profile",
    -  "prune",
    -  "publish",
    -  "query",
    -  "rebuild",
    -  "repo",
    -  "restart",
    -  "root",
    -  "run-script",
    -  "search",
    -  "set",
    -  "shrinkwrap",
    -  "star",
    -  "stars",
    -  "start",
    -  "stop",
    -  "team",
    -  "test",
    -  "token",
    -  "uninstall",
    -  "unpublish",
    -  "unstar",
    -  "update",
    -  "version",
    -  "view",
    -  "whoami",
    -]
    -`
    -
     exports[`test/lib/docs.js TAP command list > commands 1`] = `
     Array [
       "access",
    @@ -532,6 +118,7 @@ Array [
       "fund",
       "get",
       "help",
    +  "help-search",
       "hook",
       "init",
       "install",
    @@ -578,12 +165,6 @@ Array [
     ]
     `
     
    -exports[`test/lib/docs.js TAP command list > plumbing 1`] = `
    -Array [
    -  "help-search",
    -]
    -`
    -
     exports[`test/lib/docs.js TAP config > all definitions 1`] = `
     #### \`_auth\`
     
    @@ -3239,14 +2820,14 @@ Options:
     [-w|--workspace  [-w|--workspace  ...]]
     [-ws|--workspaces] [--include-workspace-root] [--install-links]
     
    -alias: cit
    +aliases: cit, clean-install-test, sit
     
     Run "npm help install-ci-test" for more info
     
     \`\`\`bash
     npm install-ci-test
     
    -alias: cit
    +aliases: cit, clean-install-test, sit
     \`\`\`
     
     #### \`save\`
    diff --git a/deps/npm/tap-snapshots/test/lib/npm.js.test.cjs b/deps/npm/tap-snapshots/test/lib/npm.js.test.cjs
    new file mode 100644
    index 00000000000000..7bebf9b78f2bb4
    --- /dev/null
    +++ b/deps/npm/tap-snapshots/test/lib/npm.js.test.cjs
    @@ -0,0 +1,450 @@
    +/* IMPORTANT
    + * This snapshot file is auto-generated, but designed for humans.
    + * It should be checked into source control and tracked carefully.
    + * Re-generate by setting TAP_SNAPSHOT=1 and running tests.
    + * Make sure to inspect the output below.  Do not ignore changes!
    + */
    +'use strict'
    +exports[`test/lib/npm.js TAP usage set process.stdout.columns column width 0 > must match snapshot 1`] = `
    +npm 
    +
    +Usage:
    +
    +npm install        install all the dependencies in your project
    +npm install   add the  dependency to your project
    +npm test           run this project's tests
    +npm run       run the script named 
    +npm  -h   quick help on 
    +npm -l             display usage info for all commands
    +npm help     search for help on 
    +npm help npm       more involved overview
    +
    +All commands:
    +
    +    access, adduser, audit, bugs, cache, ci, completion,
    +    config, dedupe, deprecate, diff, dist-tag, docs, doctor,
    +    edit, exec, explain, explore, find-dupes, fund, get, help,
    +    help-search, hook, init, install, install-ci-test,
    +    install-test, link, ll, login, logout, ls, org, outdated,
    +    owner, pack, ping, pkg, prefix, profile, prune, publish,
    +    query, rebuild, repo, restart, root, run-script, search,
    +    set, shrinkwrap, star, stars, start, stop, team, test,
    +    token, uninstall, unpublish, unstar, update, version, view,
    +    whoami
    +
    +Specify configs in the ini-formatted file:
    +    {USERCONFIG}
    +or on the command line via: npm  --key=value
    +
    +More configuration info: npm help config
    +Configuration fields: npm help 7 config
    +
    +npm@{VERSION} {NPMROOT}
    +`
    +
    +exports[`test/lib/npm.js TAP usage set process.stdout.columns column width 1 > must match snapshot 1`] = `
    +npm 
    +
    +Usage:
    +
    +npm install        install all the dependencies in your project
    +npm install   add the  dependency to your project
    +npm test           run this project's tests
    +npm run       run the script named 
    +npm  -h   quick help on 
    +npm -l             display usage info for all commands
    +npm help     search for help on 
    +npm help npm       more involved overview
    +
    +All commands:
    +
    +    access, adduser,
    +    audit, bugs, cache, ci,
    +    completion, config,
    +    dedupe, deprecate, diff,
    +    dist-tag, docs, doctor,
    +    edit, exec, explain,
    +    explore, find-dupes,
    +    fund, get, help,
    +    help-search, hook, init,
    +    install,
    +    install-ci-test,
    +    install-test, link, ll,
    +    login, logout, ls, org,
    +    outdated, owner, pack,
    +    ping, pkg, prefix,
    +    profile, prune, publish,
    +    query, rebuild, repo,
    +    restart, root,
    +    run-script, search, set,
    +    shrinkwrap, star, stars,
    +    start, stop, team, test,
    +    token, uninstall,
    +    unpublish, unstar,
    +    update, version, view,
    +    whoami
    +
    +Specify configs in the ini-formatted file:
    +    {USERCONFIG}
    +or on the command line via: npm  --key=value
    +
    +More configuration info: npm help config
    +Configuration fields: npm help 7 config
    +
    +npm@{VERSION} {NPMROOT}
    +`
    +
    +exports[`test/lib/npm.js TAP usage set process.stdout.columns column width 10 > must match snapshot 1`] = `
    +npm 
    +
    +Usage:
    +
    +npm install        install all the dependencies in your project
    +npm install   add the  dependency to your project
    +npm test           run this project's tests
    +npm run       run the script named 
    +npm  -h   quick help on 
    +npm -l             display usage info for all commands
    +npm help     search for help on 
    +npm help npm       more involved overview
    +
    +All commands:
    +
    +    access, adduser,
    +    audit, bugs, cache, ci,
    +    completion, config,
    +    dedupe, deprecate, diff,
    +    dist-tag, docs, doctor,
    +    edit, exec, explain,
    +    explore, find-dupes,
    +    fund, get, help,
    +    help-search, hook, init,
    +    install,
    +    install-ci-test,
    +    install-test, link, ll,
    +    login, logout, ls, org,
    +    outdated, owner, pack,
    +    ping, pkg, prefix,
    +    profile, prune, publish,
    +    query, rebuild, repo,
    +    restart, root,
    +    run-script, search, set,
    +    shrinkwrap, star, stars,
    +    start, stop, team, test,
    +    token, uninstall,
    +    unpublish, unstar,
    +    update, version, view,
    +    whoami
    +
    +Specify configs in the ini-formatted file:
    +    {USERCONFIG}
    +or on the command line via: npm  --key=value
    +
    +More configuration info: npm help config
    +Configuration fields: npm help 7 config
    +
    +npm@{VERSION} {NPMROOT}
    +`
    +
    +exports[`test/lib/npm.js TAP usage set process.stdout.columns column width 100 > must match snapshot 1`] = `
    +npm 
    +
    +Usage:
    +
    +npm install        install all the dependencies in your project
    +npm install   add the  dependency to your project
    +npm test           run this project's tests
    +npm run       run the script named 
    +npm  -h   quick help on 
    +npm -l             display usage info for all commands
    +npm help     search for help on 
    +npm help npm       more involved overview
    +
    +All commands:
    +
    +    access, adduser, audit, bugs, cache, ci, completion,
    +    config, dedupe, deprecate, diff, dist-tag, docs, doctor,
    +    edit, exec, explain, explore, find-dupes, fund, get, help,
    +    help-search, hook, init, install, install-ci-test,
    +    install-test, link, ll, login, logout, ls, org, outdated,
    +    owner, pack, ping, pkg, prefix, profile, prune, publish,
    +    query, rebuild, repo, restart, root, run-script, search,
    +    set, shrinkwrap, star, stars, start, stop, team, test,
    +    token, uninstall, unpublish, unstar, update, version, view,
    +    whoami
    +
    +Specify configs in the ini-formatted file:
    +    {USERCONFIG}
    +or on the command line via: npm  --key=value
    +
    +More configuration info: npm help config
    +Configuration fields: npm help 7 config
    +
    +npm@{VERSION} {NPMROOT}
    +`
    +
    +exports[`test/lib/npm.js TAP usage set process.stdout.columns column width 24 > must match snapshot 1`] = `
    +npm 
    +
    +Usage:
    +
    +npm install        install all the dependencies in your project
    +npm install   add the  dependency to your project
    +npm test           run this project's tests
    +npm run       run the script named 
    +npm  -h   quick help on 
    +npm -l             display usage info for all commands
    +npm help     search for help on 
    +npm help npm       more involved overview
    +
    +All commands:
    +
    +    access, adduser,
    +    audit, bugs, cache, ci,
    +    completion, config,
    +    dedupe, deprecate, diff,
    +    dist-tag, docs, doctor,
    +    edit, exec, explain,
    +    explore, find-dupes,
    +    fund, get, help,
    +    help-search, hook, init,
    +    install,
    +    install-ci-test,
    +    install-test, link, ll,
    +    login, logout, ls, org,
    +    outdated, owner, pack,
    +    ping, pkg, prefix,
    +    profile, prune, publish,
    +    query, rebuild, repo,
    +    restart, root,
    +    run-script, search, set,
    +    shrinkwrap, star, stars,
    +    start, stop, team, test,
    +    token, uninstall,
    +    unpublish, unstar,
    +    update, version, view,
    +    whoami
    +
    +Specify configs in the ini-formatted file:
    +    {USERCONFIG}
    +or on the command line via: npm  --key=value
    +
    +More configuration info: npm help config
    +Configuration fields: npm help 7 config
    +
    +npm@{VERSION} {NPMROOT}
    +`
    +
    +exports[`test/lib/npm.js TAP usage set process.stdout.columns column width 40 > must match snapshot 1`] = `
    +npm 
    +
    +Usage:
    +
    +npm install        install all the dependencies in your project
    +npm install   add the  dependency to your project
    +npm test           run this project's tests
    +npm run       run the script named 
    +npm  -h   quick help on 
    +npm -l             display usage info for all commands
    +npm help     search for help on 
    +npm help npm       more involved overview
    +
    +All commands:
    +
    +    access, adduser,
    +    audit, bugs, cache, ci,
    +    completion, config,
    +    dedupe, deprecate, diff,
    +    dist-tag, docs, doctor,
    +    edit, exec, explain,
    +    explore, find-dupes,
    +    fund, get, help,
    +    help-search, hook, init,
    +    install,
    +    install-ci-test,
    +    install-test, link, ll,
    +    login, logout, ls, org,
    +    outdated, owner, pack,
    +    ping, pkg, prefix,
    +    profile, prune, publish,
    +    query, rebuild, repo,
    +    restart, root,
    +    run-script, search, set,
    +    shrinkwrap, star, stars,
    +    start, stop, team, test,
    +    token, uninstall,
    +    unpublish, unstar,
    +    update, version, view,
    +    whoami
    +
    +Specify configs in the ini-formatted file:
    +    {USERCONFIG}
    +or on the command line via: npm  --key=value
    +
    +More configuration info: npm help config
    +Configuration fields: npm help 7 config
    +
    +npm@{VERSION} {NPMROOT}
    +`
    +
    +exports[`test/lib/npm.js TAP usage set process.stdout.columns column width 41 > must match snapshot 1`] = `
    +npm 
    +
    +Usage:
    +
    +npm install        install all the dependencies in your project
    +npm install   add the  dependency to your project
    +npm test           run this project's tests
    +npm run       run the script named 
    +npm  -h   quick help on 
    +npm -l             display usage info for all commands
    +npm help     search for help on 
    +npm help npm       more involved overview
    +
    +All commands:
    +
    +    access, adduser, audit,
    +    bugs, cache, ci,
    +    completion, config,
    +    dedupe, deprecate, diff,
    +    dist-tag, docs, doctor,
    +    edit, exec, explain,
    +    explore, find-dupes,
    +    fund, get, help,
    +    help-search, hook, init,
    +    install, install-ci-test,
    +    install-test, link, ll,
    +    login, logout, ls, org,
    +    outdated, owner, pack,
    +    ping, pkg, prefix,
    +    profile, prune, publish,
    +    query, rebuild, repo,
    +    restart, root,
    +    run-script, search, set,
    +    shrinkwrap, star, stars,
    +    start, stop, team, test,
    +    token, uninstall,
    +    unpublish, unstar,
    +    update, version, view,
    +    whoami
    +
    +Specify configs in the ini-formatted file:
    +    {USERCONFIG}
    +or on the command line via: npm  --key=value
    +
    +More configuration info: npm help config
    +Configuration fields: npm help 7 config
    +
    +npm@{VERSION} {NPMROOT}
    +`
    +
    +exports[`test/lib/npm.js TAP usage set process.stdout.columns column width 75 > must match snapshot 1`] = `
    +npm 
    +
    +Usage:
    +
    +npm install        install all the dependencies in your project
    +npm install   add the  dependency to your project
    +npm test           run this project's tests
    +npm run       run the script named 
    +npm  -h   quick help on 
    +npm -l             display usage info for all commands
    +npm help     search for help on 
    +npm help npm       more involved overview
    +
    +All commands:
    +
    +    access, adduser, audit, bugs, cache, ci, completion,
    +    config, dedupe, deprecate, diff, dist-tag, docs, doctor,
    +    edit, exec, explain, explore, find-dupes, fund, get, help,
    +    help-search, hook, init, install, install-ci-test,
    +    install-test, link, ll, login, logout, ls, org, outdated,
    +    owner, pack, ping, pkg, prefix, profile, prune, publish,
    +    query, rebuild, repo, restart, root, run-script, search,
    +    set, shrinkwrap, star, stars, start, stop, team, test,
    +    token, uninstall, unpublish, unstar, update, version, view,
    +    whoami
    +
    +Specify configs in the ini-formatted file:
    +    {USERCONFIG}
    +or on the command line via: npm  --key=value
    +
    +More configuration info: npm help config
    +Configuration fields: npm help 7 config
    +
    +npm@{VERSION} {NPMROOT}
    +`
    +
    +exports[`test/lib/npm.js TAP usage set process.stdout.columns column width 76 > must match snapshot 1`] = `
    +npm 
    +
    +Usage:
    +
    +npm install        install all the dependencies in your project
    +npm install   add the  dependency to your project
    +npm test           run this project's tests
    +npm run       run the script named 
    +npm  -h   quick help on 
    +npm -l             display usage info for all commands
    +npm help     search for help on 
    +npm help npm       more involved overview
    +
    +All commands:
    +
    +    access, adduser, audit, bugs, cache, ci, completion,
    +    config, dedupe, deprecate, diff, dist-tag, docs, doctor,
    +    edit, exec, explain, explore, find-dupes, fund, get, help,
    +    help-search, hook, init, install, install-ci-test,
    +    install-test, link, ll, login, logout, ls, org, outdated,
    +    owner, pack, ping, pkg, prefix, profile, prune, publish,
    +    query, rebuild, repo, restart, root, run-script, search,
    +    set, shrinkwrap, star, stars, start, stop, team, test,
    +    token, uninstall, unpublish, unstar, update, version, view,
    +    whoami
    +
    +Specify configs in the ini-formatted file:
    +    {USERCONFIG}
    +or on the command line via: npm  --key=value
    +
    +More configuration info: npm help config
    +Configuration fields: npm help 7 config
    +
    +npm@{VERSION} {NPMROOT}
    +`
    +
    +exports[`test/lib/npm.js TAP usage set process.stdout.columns column width 90 > must match snapshot 1`] = `
    +npm 
    +
    +Usage:
    +
    +npm install        install all the dependencies in your project
    +npm install   add the  dependency to your project
    +npm test           run this project's tests
    +npm run       run the script named 
    +npm  -h   quick help on 
    +npm -l             display usage info for all commands
    +npm help     search for help on 
    +npm help npm       more involved overview
    +
    +All commands:
    +
    +    access, adduser, audit, bugs, cache, ci, completion,
    +    config, dedupe, deprecate, diff, dist-tag, docs, doctor,
    +    edit, exec, explain, explore, find-dupes, fund, get, help,
    +    help-search, hook, init, install, install-ci-test,
    +    install-test, link, ll, login, logout, ls, org, outdated,
    +    owner, pack, ping, pkg, prefix, profile, prune, publish,
    +    query, rebuild, repo, restart, root, run-script, search,
    +    set, shrinkwrap, star, stars, start, stop, team, test,
    +    token, uninstall, unpublish, unstar, update, version, view,
    +    whoami
    +
    +Specify configs in the ini-formatted file:
    +    {USERCONFIG}
    +or on the command line via: npm  --key=value
    +
    +More configuration info: npm help config
    +Configuration fields: npm help 7 config
    +
    +npm@{VERSION} {NPMROOT}
    +`
    diff --git a/deps/npm/tap-snapshots/test/lib/utils/error-message.js.test.cjs b/deps/npm/tap-snapshots/test/lib/utils/error-message.js.test.cjs
    index 5fe20969fce315..0ffcba239f52ff 100644
    --- a/deps/npm/tap-snapshots/test/lib/utils/error-message.js.test.cjs
    +++ b/deps/npm/tap-snapshots/test/lib/utils/error-message.js.test.cjs
    @@ -241,17 +241,37 @@ Object {
         Array [
           "notsup",
           String(
    -        Valid OS:    !yours,mine
    -        Valid Arch:  x867,x5309
    -        Actual OS:   posix
    -        Actual Arch: x64
    +        Valid os:   !yours,mine
    +        Actual os:  posix
    +        Valid cpu:  x867,x5309
    +        Actual cpu: x64
           ),
         ],
       ],
       "summary": Array [
         Array [
           "notsup",
    -      "Unsupported platform for lodash@1.0.0: wanted {/"os/":/"!yours,mine/",/"arch/":/"x867,x5309/"} (current: {/"os/":/"posix/",/"arch/":/"x64/"})",
    +      "Unsupported platform for lodash@1.0.0: wanted {/"os/":/"!yours,mine/",/"cpu/":/"x867,x5309/"} (current: {/"os/":/"posix/",/"cpu/":/"x64/"})",
    +    ],
    +  ],
    +}
    +`
    +
    +exports[`test/lib/utils/error-message.js TAP bad platform omits keys with no required value > must match snapshot 1`] = `
    +Object {
    +  "detail": Array [
    +    Array [
    +      "notsup",
    +      String(
    +        Valid os:  !yours,mine
    +        Actual os: posix
    +      ),
    +    ],
    +  ],
    +  "summary": Array [
    +    Array [
    +      "notsup",
    +      "Unsupported platform for lodash@1.0.0: wanted {/"os/":/"!yours,mine/"} (current: {/"os/":/"posix/"})",
         ],
       ],
     }
    @@ -263,17 +283,17 @@ Object {
         Array [
           "notsup",
           String(
    -        Valid OS:    !yours
    -        Valid Arch:  x420
    -        Actual OS:   posix
    -        Actual Arch: x64
    +        Valid os:   !yours
    +        Actual os:  posix
    +        Valid cpu:  x420
    +        Actual cpu: x64
           ),
         ],
       ],
       "summary": Array [
         Array [
           "notsup",
    -      "Unsupported platform for lodash@1.0.0: wanted {/"os/":/"!yours/",/"arch/":/"x420/"} (current: {/"os/":/"posix/",/"arch/":/"x64/"})",
    +      "Unsupported platform for lodash@1.0.0: wanted {/"os/":/"!yours/",/"cpu/":/"x420/"} (current: {/"os/":/"posix/",/"cpu/":/"x64/"})",
         ],
       ],
     }
    diff --git a/deps/npm/tap-snapshots/test/lib/utils/exit-handler.js.test.cjs b/deps/npm/tap-snapshots/test/lib/utils/exit-handler.js.test.cjs
    index 4c163e7df5593d..93711275392339 100644
    --- a/deps/npm/tap-snapshots/test/lib/utils/exit-handler.js.test.cjs
    +++ b/deps/npm/tap-snapshots/test/lib/utils/exit-handler.js.test.cjs
    @@ -6,35 +6,33 @@
      */
     'use strict'
     exports[`test/lib/utils/exit-handler.js TAP handles unknown error with logs and debug file > debug file contents 1`] = `
    -0 timing npm:load:whichnode Completed in {TIME}ms
    -13 timing config:load Completed in {TIME}ms
    -14 timing npm:load:configload Completed in {TIME}ms
    -15 timing npm:load:mkdirpcache Completed in {TIME}ms
    -16 timing npm:load:mkdirplogs Completed in {TIME}ms
    -17 verbose title npm
    -18 verbose argv "--fetch-retries" "0" "--cache" "{CWD}/cache" "--loglevel" "notice"
    -19 timing npm:load:setTitle Completed in {TIME}ms
    -21 timing npm:load:display Completed in {TIME}ms
    -22 verbose logfile logs-max:10 dir:{CWD}/cache/_logs/{DATE}-
    -23 verbose logfile {CWD}/cache/_logs/{DATE}-debug-0.log
    -24 timing npm:load:logFile Completed in {TIME}ms
    -25 timing npm:load:timers Completed in {TIME}ms
    -26 timing npm:load:configScope Completed in {TIME}ms
    -27 timing npm:load Completed in {TIME}ms
    -28 silly logfile done cleaning log files
    -29 verbose stack Error: Unknown error
    -30 verbose cwd {CWD}/prefix
    -31 verbose Foo 1.0.0
    -32 verbose node v1.0.0
    -33 verbose npm  v1.0.0
    -34 error code ECODE
    -35 error ERR SUMMARY Unknown error
    -36 error ERR DETAIL Unknown error
    -37 verbose exit 1
    -38 timing npm Completed in {TIME}ms
    -39 verbose code 1
    -40 error A complete log of this run can be found in:
    -40 error     {CWD}/cache/_logs/{DATE}-debug-0.log
    +XX timing npm:load:whichnode Completed in {TIME}ms
    +XX timing config:load Completed in {TIME}ms
    +XX timing npm:load:configload Completed in {TIME}ms
    +XX timing npm:load:mkdirpcache Completed in {TIME}ms
    +XX timing npm:load:mkdirplogs Completed in {TIME}ms
    +XX verbose title npm
    +XX verbose argv "--fetch-retries" "0" "--cache" "{CWD}/cache" "--loglevel" "notice"
    +XX timing npm:load:setTitle Completed in {TIME}ms
    +XX timing npm:load:display Completed in {TIME}ms
    +XX verbose logfile logs-max:10 dir:{CWD}/cache/_logs/{DATE}-
    +XX verbose logfile {CWD}/cache/_logs/{DATE}-debug-0.log
    +XX timing npm:load:logFile Completed in {TIME}ms
    +XX timing npm:load:timers Completed in {TIME}ms
    +XX timing npm:load:configScope Completed in {TIME}ms
    +XX timing npm:load Completed in {TIME}ms
    +XX verbose stack Error: Unknown error
    +XX verbose cwd {CWD}/prefix
    +XX verbose Foo 1.0.0
    +XX verbose node v1.0.0
    +XX verbose npm  v1.0.0
    +XX error code ECODE
    +XX error ERR SUMMARY Unknown error
    +XX error ERR DETAIL Unknown error
    +XX verbose exit 1
    +XX timing npm Completed in {TIME}ms
    +XX verbose code 1
    +XX error A complete log of this run can be found in: {CWD}/cache/_logs/{DATE}-debug-0.log
     `
     
     exports[`test/lib/utils/exit-handler.js TAP handles unknown error with logs and debug file > logs 1`] = `
    @@ -53,7 +51,6 @@ timing npm:load:logFile Completed in {TIME}ms
     timing npm:load:timers Completed in {TIME}ms
     timing npm:load:configScope Completed in {TIME}ms
     timing npm:load Completed in {TIME}ms
    -silly logfile done cleaning log files
     verbose stack Error: Unknown error
     verbose cwd {CWD}/prefix
     verbose  Foo 1.0.0
    @@ -65,6 +62,5 @@ error ERR DETAIL Unknown error
     verbose exit 1
     timing npm Completed in {TIME}ms
     verbose code 1
    -error  A complete log of this run can be found in:
    -    {CWD}/cache/_logs/{DATE}-debug-0.log
    +error  A complete log of this run can be found in: {CWD}/cache/_logs/{DATE}-debug-0.log
     `
    diff --git a/deps/npm/tap-snapshots/test/lib/utils/update-notifier.js.test.cjs b/deps/npm/tap-snapshots/test/lib/utils/update-notifier.js.test.cjs
    index 157390997d7936..e5e9dd77569e00 100644
    --- a/deps/npm/tap-snapshots/test/lib/utils/update-notifier.js.test.cjs
    +++ b/deps/npm/tap-snapshots/test/lib/utils/update-notifier.js.test.cjs
    @@ -5,7 +5,7 @@
      * Make sure to inspect the output below.  Do not ignore changes!
      */
     'use strict'
    -exports[`test/lib/utils/update-notifier.js TAP notification situations major to current > color 1`] = `
    +exports[`test/lib/utils/update-notifier.js TAP notification situations 122.420.69 - color=always > must match snapshot 1`] = `
     
     New major version of npm available! 122.420.69 -> 123.420.69
     Changelog: https://github.com/npm/cli/releases/tag/v123.420.69
    @@ -13,7 +13,7 @@ Run npm install -g npm@123.420.69 to update!
     
     `
     
    -exports[`test/lib/utils/update-notifier.js TAP notification situations major to current > no color 1`] = `
    +exports[`test/lib/utils/update-notifier.js TAP notification situations 122.420.69 - color=false > must match snapshot 1`] = `
     
     New major version of npm available! 122.420.69 -> 123.420.69
     Changelog: 
    @@ -21,7 +21,7 @@ Run \`npm install -g npm@123.420.69\` to update!
     
     `
     
    -exports[`test/lib/utils/update-notifier.js TAP notification situations minor to current > color 1`] = `
    +exports[`test/lib/utils/update-notifier.js TAP notification situations 123.419.69 - color=always > must match snapshot 1`] = `
     
     New minor version of npm available! 123.419.69 -> 123.420.69
     Changelog: https://github.com/npm/cli/releases/tag/v123.420.69
    @@ -29,7 +29,7 @@ Run npm install -g npm@123.420.69 to update!
     
     `
     
    -exports[`test/lib/utils/update-notifier.js TAP notification situations minor to current > no color 1`] = `
    +exports[`test/lib/utils/update-notifier.js TAP notification situations 123.419.69 - color=false > must match snapshot 1`] = `
     
     New minor version of npm available! 123.419.69 -> 123.420.69
     Changelog: 
    @@ -37,66 +37,66 @@ Run \`npm install -g npm@123.420.69\` to update!
     
     `
     
    -exports[`test/lib/utils/update-notifier.js TAP notification situations minor to next version > color 1`] = `
    +exports[`test/lib/utils/update-notifier.js TAP notification situations 123.420.68 - color=always > must match snapshot 1`] = `
     
    -New minor version of npm available! 123.420.70 -> 123.421.70
    -Changelog: https://github.com/npm/cli/releases/tag/v123.421.70
    -Run npm install -g npm@123.421.70 to update!
    +New patch version of npm available! 123.420.68 -> 123.420.69
    +Changelog: https://github.com/npm/cli/releases/tag/v123.420.69
    +Run npm install -g npm@123.420.69 to update!
     
     `
     
    -exports[`test/lib/utils/update-notifier.js TAP notification situations minor to next version > no color 1`] = `
    +exports[`test/lib/utils/update-notifier.js TAP notification situations 123.420.68 - color=false > must match snapshot 1`] = `
     
    -New minor version of npm available! 123.420.70 -> 123.421.70
    -Changelog: 
    -Run \`npm install -g npm@123.421.70\` to update!
    +New patch version of npm available! 123.420.68 -> 123.420.69
    +Changelog: 
    +Run \`npm install -g npm@123.420.69\` to update!
     
     `
     
    -exports[`test/lib/utils/update-notifier.js TAP notification situations new beta available > color 1`] = `
    +exports[`test/lib/utils/update-notifier.js TAP notification situations 123.420.70 - color=always > must match snapshot 1`] = `
     
    -New prerelease version of npm available! 124.0.0-beta.0 -> 124.0.0-beta.99999
    -Changelog: https://github.com/npm/cli/releases/tag/v124.0.0-beta.99999
    -Run npm install -g npm@124.0.0-beta.99999 to update!
    +New minor version of npm available! 123.420.70 -> 123.421.70
    +Changelog: https://github.com/npm/cli/releases/tag/v123.421.70
    +Run npm install -g npm@123.421.70 to update!
     
     `
     
    -exports[`test/lib/utils/update-notifier.js TAP notification situations new beta available > no color 1`] = `
    +exports[`test/lib/utils/update-notifier.js TAP notification situations 123.420.70 - color=false > must match snapshot 1`] = `
     
    -New prerelease version of npm available! 124.0.0-beta.0 -> 124.0.0-beta.99999
    -Changelog: 
    -Run \`npm install -g npm@124.0.0-beta.99999\` to update!
    +New minor version of npm available! 123.420.70 -> 123.421.70
    +Changelog: 
    +Run \`npm install -g npm@123.421.70\` to update!
     
     `
     
    -exports[`test/lib/utils/update-notifier.js TAP notification situations patch to current > color 1`] = `
    +exports[`test/lib/utils/update-notifier.js TAP notification situations 123.421.69 - color=always > must match snapshot 1`] = `
     
    -New patch version of npm available! 123.420.68 -> 123.420.69
    -Changelog: https://github.com/npm/cli/releases/tag/v123.420.69
    -Run npm install -g npm@123.420.69 to update!
    +New patch version of npm available! 123.421.69 -> 123.421.70
    +Changelog: https://github.com/npm/cli/releases/tag/v123.421.70
    +Run npm install -g npm@123.421.70 to update!
     
     `
     
    -exports[`test/lib/utils/update-notifier.js TAP notification situations patch to current > no color 1`] = `
    +exports[`test/lib/utils/update-notifier.js TAP notification situations 123.421.69 - color=false > must match snapshot 1`] = `
     
    -New patch version of npm available! 123.420.68 -> 123.420.69
    -Changelog: 
    -Run \`npm install -g npm@123.420.69\` to update!
    +New patch version of npm available! 123.421.69 -> 123.421.70
    +Changelog: 
    +Run \`npm install -g npm@123.421.70\` to update!
     
     `
     
    -exports[`test/lib/utils/update-notifier.js TAP notification situations patch to next version > color 1`] = `
    +exports[`test/lib/utils/update-notifier.js TAP notification situations 124.0.0-beta.0 - color=always > must match snapshot 1`] = `
     
    -New patch version of npm available! 123.421.69 -> 123.421.70
    -Changelog: https://github.com/npm/cli/releases/tag/v123.421.70
    -Run npm install -g npm@123.421.70 to update!
    +New prerelease version of npm available! 124.0.0-beta.0 -> 124.0.0-beta.99999
    +Changelog: https://github.com/npm/cli/releases/tag/v124.0.0-beta.99999
    +Run npm install -g npm@124.0.0-beta.99999 to update!
     
     `
     
    -exports[`test/lib/utils/update-notifier.js TAP notification situations patch to next version > no color 1`] = `
    +exports[`test/lib/utils/update-notifier.js TAP notification situations 124.0.0-beta.0 - color=false > must match snapshot 1`] = `
     
    -New patch version of npm available! 123.421.69 -> 123.421.70
    -Changelog: 
    -Run \`npm install -g npm@123.421.70\` to update!
    +New prerelease version of npm available! 124.0.0-beta.0 -> 124.0.0-beta.99999
    +Changelog: 
    +Run \`npm install -g npm@124.0.0-beta.99999\` to update!
     
     `
    diff --git a/deps/npm/test/lib/commands/access.js b/deps/npm/test/lib/commands/access.js
    index b0057545ba0268..d1839aaaef2199 100644
    --- a/deps/npm/test/lib/commands/access.js
    +++ b/deps/npm/test/lib/commands/access.js
    @@ -30,6 +30,7 @@ t.test('completion', async t => {
       ])
       testComp(['npm', 'access', 'grant'], ['read-only', 'read-write'])
       testComp(['npm', 'access', 'revoke'], [])
    +  testComp(['npm', 'access', 'grant', ''], [])
     
       await t.rejects(
         access.completion({ conf: { argv: { remain: ['npm', 'access', 'foobar'] } } }),
    @@ -70,10 +71,16 @@ t.test('grant', t => {
       })
     
       t.test('read-only', async t => {
    -    const { npm } = await loadMockNpm(t)
    +    const authToken = 'abcd1234'
    +    const { npm } = await loadMockNpm(t, {
    +      config: {
    +        '//registry.npmjs.org/:_authToken': authToken,
    +      },
    +    })
         const registry = new MockRegistry({
           tap: t,
           registry: npm.config.get('registry'),
    +      authorization: authToken,
         })
         const permissions = 'read-only'
         registry.setPermissions({ spec: '@npmcli/test-package', team: '@npm:test-team', permissions })
    @@ -84,10 +91,16 @@ t.test('grant', t => {
     
     t.test('revoke', t => {
       t.test('success', async t => {
    -    const { npm } = await loadMockNpm(t)
    +    const authToken = 'abcd1234'
    +    const { npm } = await loadMockNpm(t, {
    +      config: {
    +        '//registry.npmjs.org/:_authToken': authToken,
    +      },
    +    })
         const registry = new MockRegistry({
           tap: t,
           registry: npm.config.get('registry'),
    +      authorization: authToken,
         })
         registry.removePermissions({ spec: '@npmcli/test-package', team: '@npm:test-team' })
         await npm.exec('access', ['revoke', '@npm:test-team', '@npmcli/test-package'])
    diff --git a/deps/npm/test/lib/commands/explain.js b/deps/npm/test/lib/commands/explain.js
    index 3262dfdce87af8..79c917a1cd4527 100644
    --- a/deps/npm/test/lib/commands/explain.js
    +++ b/deps/npm/test/lib/commands/explain.js
    @@ -7,7 +7,8 @@ const mockExplain = async (t, opts) => {
         mocks: {
           // keep the snapshots pared down a bit, since this has its own tests.
           '{LIB}/utils/explain-dep.js': {
    -        explainNode: (expl, depth, color) => {
    +        explainNode: (expl, depth, chalk) => {
    +          const color = chalk.level !== 0
               return `${expl.name}@${expl.version} depth=${depth} color=${color}`
             },
           },
    diff --git a/deps/npm/test/lib/commands/help.js b/deps/npm/test/lib/commands/help.js
    index d4e7a81f84a4cd..e38f1bbce24d46 100644
    --- a/deps/npm/test/lib/commands/help.js
    +++ b/deps/npm/test/lib/commands/help.js
    @@ -29,8 +29,8 @@ const genManPages = (obj) => {
     
     const mockHelp = async (t, {
       man = {
    -    1: ['whoami', 'install', 'star', 'unstar', 'uninstall', 'unpublish'].map(p => `npm-${p}`),
         5: ['npmrc', 'install', 'package-json'],
    +    1: ['whoami', 'install', 'star', 'unstar', 'uninstall', 'unpublish'].map(p => `npm-${p}`),
         7: ['disputes', 'config'],
       },
       browser = false,
    @@ -113,7 +113,7 @@ t.test('npm help whoami', async t => {
       const [spawnBin, spawnArgs] = getArgs()
       t.equal(spawnBin, 'man', 'calls man by default')
       t.equal(spawnArgs.length, 1)
    -  t.match(spawnArgs[0], /\/man\/man1\/npm-whoami\.1$/)
    +  t.match(spawnArgs[0], /npm-whoami\.1$/)
     })
     
     t.test('npm help 1 install', async t => {
    @@ -155,7 +155,7 @@ t.test('npm help package.json redirects to package-json', async t => {
       const [spawnBin, spawnArgs] = getArgs()
       t.equal(spawnBin, 'man', 'calls man by default')
       t.equal(spawnArgs.length, 1)
    -  t.match(spawnArgs[0], /\/man\/man5\/package-json\.5$/)
    +  t.match(spawnArgs[0], /package-json\.5$/)
     })
     
     t.test('npm help ?(un)star', async t => {
    @@ -168,7 +168,7 @@ t.test('npm help ?(un)star', async t => {
       t.equal(spawnBin, 'emacsclient', 'maps woman to emacs correctly')
       t.equal(spawnArgs.length, 2)
       t.match(spawnArgs[1], /^\(woman-find-file '/)
    -  t.match(spawnArgs[1], /\/man\/man1\/npm-star.1'\)$/)
    +  t.match(spawnArgs[1], /npm-star.1'\)$/)
     })
     
     t.test('npm help un*', async t => {
    @@ -179,15 +179,16 @@ t.test('npm help un*', async t => {
       const [spawnBin, spawnArgs] = getArgs()
       t.equal(spawnBin, 'man', 'calls man by default')
       t.equal(spawnArgs.length, 1)
    -  t.match(spawnArgs[0], /\/man\/man1\/npm-uninstall\.1$/)
    +  t.match(spawnArgs[0], /npm-uninstall\.1$/)
     })
     
    -t.test('npm help - prefers npm help pages', async t => {
    +t.test('npm help - prefers lowest numbered npm prefixed help pages', async t => {
       const { getArgs } = await mockHelp(t, {
         man: {
           6: ['npm-install'],
    -      1: ['install'],
    -      5: ['install', 'npm-install'],
    +      1: ['npm-install'],
    +      5: ['install'],
    +      7: ['npm-install'],
         },
         exec: ['install'],
       })
    @@ -195,15 +196,15 @@ t.test('npm help - prefers npm help pages', async t => {
       const [spawnBin, spawnArgs] = getArgs()
       t.equal(spawnBin, 'man', 'calls man by default')
       t.equal(spawnArgs.length, 1)
    -  t.match(spawnArgs[0], /\/man\/man5\/npm-install\.5$/)
    +  t.match(spawnArgs[0], /npm-install\.1$/)
     })
     
     t.test('npm help - works in the presence of strange man pages', async t => {
       const { getArgs } = await mockHelp(t, {
         man: {
    -      '6strange': ['config'],
    -      1: ['config'],
    -      '5ssl': ['config'],
    +      '1strange': ['config'],
    +      5: ['config'],
    +      '6ssl': ['config'],
         },
         exec: ['config'],
       })
    @@ -211,7 +212,7 @@ t.test('npm help - works in the presence of strange man pages', async t => {
       const [spawnBin, spawnArgs] = getArgs()
       t.equal(spawnBin, 'man', 'calls man by default')
       t.equal(spawnArgs.length, 1)
    -  t.match(spawnArgs[0], /\/man\/man1\/config\.1$/)
    +  t.match(spawnArgs[0], /config\.5$/)
     })
     
     t.test('rejects with code', async t => {
    diff --git a/deps/npm/test/lib/commands/profile.js b/deps/npm/test/lib/commands/profile.js
    index 00ccf2607524ad..1152acfdc5c468 100644
    --- a/deps/npm/test/lib/commands/profile.js
    +++ b/deps/npm/test/lib/commands/profile.js
    @@ -1,7 +1,7 @@
     const t = require('tap')
     const mockNpm = require('../../fixtures/mock-npm')
     
    -const mockProfile = async (t, { npmProfile, readUserInfo, qrcode, ...opts } = {}) => {
    +const mockProfile = async (t, { npmProfile, readUserInfo, qrcode, config, ...opts } = {}) => {
       const mocks = {
         'npm-profile': npmProfile || {
           async get () {},
    @@ -24,6 +24,10 @@ const mockProfile = async (t, { npmProfile, readUserInfo, qrcode, ...opts } = {}
     
       const mock = await mockNpm(t, {
         ...opts,
    +    config: {
    +      color: false,
    +      ...config,
    +    },
         mocks: {
           ...mocks,
           ...opts.mocks,
    @@ -95,6 +99,16 @@ t.test('profile get no args', async t => {
         t.matchSnapshot(result(), 'should output all profile info as parseable result')
       })
     
    +  t.test('--color', async t => {
    +    const { profile, result } = await mockProfile(t, {
    +      npmProfile: defaultNpmProfile,
    +      config: { color: 'always' },
    +    })
    +
    +    await profile.exec(['get'])
    +    t.matchSnapshot(result(), 'should output all profile info with color result')
    +  })
    +
       t.test('no tfa enabled', async t => {
         const npmProfile = {
           async get () {
    diff --git a/deps/npm/test/lib/commands/run-script.js b/deps/npm/test/lib/commands/run-script.js
    index a265db3cc040da..6e2bf22adddcf8 100644
    --- a/deps/npm/test/lib/commands/run-script.js
    +++ b/deps/npm/test/lib/commands/run-script.js
    @@ -34,12 +34,12 @@ const mockRs = async (t, { windows = false, runScript, ...opts } = {}) => {
     }
     
     t.test('completion', async t => {
    -  const completion = async (t, remain, pkg) => {
    +  const completion = async (t, remain, pkg, isFish = false) => {
         const { npm } = await mockRs(t,
           pkg ? { prefixDir: { 'package.json': JSON.stringify(pkg) } } : {}
         )
         const cmd = await npm.cmd('run-script')
    -    return cmd.completion({ conf: { argv: { remain } } })
    +    return cmd.completion({ conf: { argv: { remain } }, isFish })
       }
     
       t.test('already have a script name', async t => {
    @@ -60,6 +60,13 @@ t.test('completion', async t => {
         })
         t.strictSame(res, ['hello', 'world'])
       })
    +
    +  t.test('fish shell', async t => {
    +    const res = await completion(t, ['npm', 'run'], {
    +      scripts: { hello: 'echo hello', world: 'echo world' },
    +    }, true)
    +    t.strictSame(res, ['hello\techo hello', 'world\techo world'])
    +  })
     })
     
     t.test('fail if no package.json', async t => {
    diff --git a/deps/npm/test/lib/commands/view.js b/deps/npm/test/lib/commands/view.js
    index c6a4bf8fb79f44..51bc130df24e5e 100644
    --- a/deps/npm/test/lib/commands/view.js
    +++ b/deps/npm/test/lib/commands/view.js
    @@ -270,6 +270,10 @@ const loadMockNpm = async function (t, opts = {}) {
           },
         },
         ...opts,
    +    config: {
    +      color: 'always',
    +      ...opts.config,
    +    },
       })
       return mockNpm
     }
    @@ -374,7 +378,7 @@ t.test('package in cwd', async t => {
     })
     
     t.test('specific field names', async t => {
    -  const { view, outputs } = await loadMockNpm(t)
    +  const { view, outputs } = await loadMockNpm(t, { config: { color: false } })
       t.afterEach(() => outputs.length = 0)
     
       t.test('readme', async t => {
    diff --git a/deps/npm/test/lib/docs.js b/deps/npm/test/lib/docs.js
    index e8a188b6ad8c48..b8a1a4fc600747 100644
    --- a/deps/npm/test/lib/docs.js
    +++ b/deps/npm/test/lib/docs.js
    @@ -66,12 +66,12 @@ t.test('usage', async t => {
       // are all in sync. eg, this will error if a command is removed but not its docs file
       t.strictSame(
         fsCommands.sort(localeCompare),
    -    cmdList.allCommands,
    +    cmdList.commands,
         'command list and fs are the same'
       )
       t.strictSame(
         allDocs.filter(f => !bareCommands.includes(f)).sort(localeCompare),
    -    cmdList.allCommands,
    +    cmdList.commands,
         'command list and docs files are the same'
       )
     
    diff --git a/deps/npm/test/lib/load-all-commands.js b/deps/npm/test/lib/load-all-commands.js
    index dd55560369310e..1742376a36e69d 100644
    --- a/deps/npm/test/lib/load-all-commands.js
    +++ b/deps/npm/test/lib/load-all-commands.js
    @@ -5,12 +5,12 @@
     const t = require('tap')
     const util = require('util')
     const { load: loadMockNpm } = require('../fixtures/mock-npm.js')
    -const { allCommands } = require('../../lib/utils/cmd-list.js')
    +const { commands } = require('../../lib/utils/cmd-list.js')
     
     const isAsyncFn = (v) => typeof v === 'function' && /^\[AsyncFunction:/.test(util.inspect(v))
     
     t.test('load each command', async t => {
    -  for (const cmd of allCommands) {
    +  for (const cmd of commands) {
         t.test(cmd, async t => {
           const { npm, outputs, cmd: impl } = await loadMockNpm(t, {
             command: cmd,
    diff --git a/deps/npm/test/lib/npm.js b/deps/npm/test/lib/npm.js
    index e6936b3e36d5f8..61b31be6200286 100644
    --- a/deps/npm/test/lib/npm.js
    +++ b/deps/npm/test/lib/npm.js
    @@ -561,6 +561,7 @@ t.test('aliases and typos', async t => {
       await t.resolves(npm.cmd('it'), { name: 'install-test' })
       await t.resolves(npm.cmd('installTe'), { name: 'install-test' })
       await t.resolves(npm.cmd('access'), { name: 'access' })
    +  await t.resolves(npm.cmd('auth'), { name: 'owner' })
     })
     
     t.test('explicit workspace rejection', async t => {
    @@ -706,40 +707,21 @@ t.test('usage', async t => {
       })
     
       t.test('set process.stdout.columns', async t => {
    -    const { npm } = await loadMockNpm(t)
    -
    -    const colUsage = async (cols) => {
    -      const usages = []
    -      for (const col of cols) {
    -        mockGlobals(t, { 'process.stdout.columns': col })
    +    const { npm } = await loadMockNpm(t, {
    +      config: { viewer: 'man' },
    +    })
    +    t.cleanSnapshot = str =>
    +      str.replace(npm.config.get('userconfig'), '{USERCONFIG}')
    +        .replace(npm.npmRoot, '{NPMROOT}')
    +        .replace(`npm@${npm.version}`, 'npm@{VERSION}')
    +
    +    const widths = [0, 1, 10, 24, 40, 41, 75, 76, 90, 100]
    +    for (const width of widths) {
    +      t.test(`column width ${width}`, async t => {
    +        mockGlobals(t, { 'process.stdout.columns': width })
             const usage = await npm.usage
    -        usages.push(usage)
    -      }
    -      return usages
    +        t.matchSnapshot(usage)
    +      })
         }
    -
    -    t.test('max size', async t => {
    -      const usages = await colUsage([0, 76, 90, 100])
    -      t.equal(usages.filter(Boolean).length, 4)
    -      t.equal(new Set([...usages]).size, 1)
    -    })
    -
    -    t.test('across max boundary', async t => {
    -      const usages = await colUsage([75, 76])
    -      t.equal(usages.filter(Boolean).length, 2)
    -      t.equal(new Set([...usages]).size, 2)
    -    })
    -
    -    t.test('min size', async t => {
    -      const usages = await colUsage([1, 10, 24, 40])
    -      t.equal(usages.filter(Boolean).length, 4)
    -      t.equal(new Set([...usages]).size, 1)
    -    })
    -
    -    t.test('different cols within min/max', async t => {
    -      const usages = await colUsage([40, 41])
    -      t.equal(usages.filter(Boolean).length, 2)
    -      t.equal(new Set([...usages]).size, 2)
    -    })
       })
     })
    diff --git a/deps/npm/test/lib/utils/audit-error.js b/deps/npm/test/lib/utils/audit-error.js
    index 46a9dbc38cd7d3..1cb29a0857d752 100644
    --- a/deps/npm/test/lib/utils/audit-error.js
    +++ b/deps/npm/test/lib/utils/audit-error.js
    @@ -87,7 +87,7 @@ t.test('error, audit command, json', async t => {
           message: 'message',
           body: { response: 'body' },
           method: 'POST',
    -      uri: 'https://example.com/not/a/registry',
    +      uri: 'https://username:password@example.com/not/a/registry',
           headers: {
             head: ['ers'],
           },
    @@ -101,7 +101,7 @@ t.test('error, audit command, json', async t => {
         '{\n' +
           '  "message": "message",\n' +
           '  "method": "POST",\n' +
    -      '  "uri": "https://example.com/not/a/registry",\n' +
    +      '  "uri": "https://username:***@example.com/not/a/registry",\n' +
           '  "headers": {\n' +
           '    "head": [\n' +
           '      "ers"\n' +
    diff --git a/deps/npm/test/lib/utils/display.js b/deps/npm/test/lib/utils/display.js
    index cfe0181e23e79f..7a99dcb679c09c 100644
    --- a/deps/npm/test/lib/utils/display.js
    +++ b/deps/npm/test/lib/utils/display.js
    @@ -58,7 +58,7 @@ t.test('can log', async (t) => {
     
       display.log('warn', 'ERESOLVE', 'hello', { some: 'object' })
       t.match(logs.warn, [['ERESOLVE', 'hello']])
    -  t.match(explains, [[{ some: 'object' }, false, 2]])
    +  t.match(explains, [[{ some: 'object' }, null, 2]])
     })
     
     t.test('handles log throwing', async (t) => {
    diff --git a/deps/npm/test/lib/utils/error-message.js b/deps/npm/test/lib/utils/error-message.js
    index 9d07693989ea84..37b3bc6afeddc1 100644
    --- a/deps/npm/test/lib/utils/error-message.js
    +++ b/deps/npm/test/lib/utils/error-message.js
    @@ -384,6 +384,27 @@ t.test('bad platform', async t => {
         t.matchSnapshot(errorMessage(er))
         t.end()
       })
    +  t.test('omits keys with no required value', t => {
    +    const er = Object.assign(new Error('a bad plat'), {
    +      pkgid: 'lodash@1.0.0',
    +      current: {
    +        os: 'posix',
    +        cpu: 'x64',
    +        libc: 'musl',
    +      },
    +      required: {
    +        os: ['!yours', 'mine'],
    +        libc: [], // empty arrays should also lead to a key being removed
    +        cpu: undefined, // XXX npm-install-checks sets unused keys to undefined
    +      },
    +      code: 'EBADPLATFORM',
    +    })
    +    const msg = errorMessage(er)
    +    t.matchSnapshot(msg)
    +    t.notMatch(msg, /Valid cpu/, 'omits cpu from message')
    +    t.notMatch(msg, /Valid libc/, 'omits libc from message')
    +    t.end()
    +  })
     })
     
     t.test('explain ERESOLVE errors', async t => {
    @@ -393,11 +414,14 @@ t.test('explain ERESOLVE errors', async t => {
         errorMocks: {
           '{LIB}/utils/explain-eresolve.js': {
             report: (...args) => {
    -          EXPLAIN_CALLED.push(args)
    +          EXPLAIN_CALLED.push(...args)
               return { explanation: 'explanation', file: 'report' }
             },
           },
         },
    +    config: {
    +      color: 'always',
    +    },
       })
     
       const er = Object.assign(new Error('could not resolve'), {
    @@ -405,5 +429,8 @@ t.test('explain ERESOLVE errors', async t => {
       })
     
       t.matchSnapshot(errorMessage(er))
    -  t.match(EXPLAIN_CALLED, [[er, false]])
    +  t.equal(EXPLAIN_CALLED.length, 3)
    +  t.match(EXPLAIN_CALLED, [er, Function, Function])
    +  t.not(EXPLAIN_CALLED[1].level, 0, 'color chalk level is not 0')
    +  t.equal(EXPLAIN_CALLED[2].level, 0, 'colorless chalk level is 0')
     })
    diff --git a/deps/npm/test/lib/utils/exit-handler.js b/deps/npm/test/lib/utils/exit-handler.js
    index 76d5fec4c099a8..969bd05a98ceaa 100644
    --- a/deps/npm/test/lib/utils/exit-handler.js
    +++ b/deps/npm/test/lib/utils/exit-handler.js
    @@ -27,6 +27,9 @@ t.formatSnapshot = (obj) => {
     t.cleanSnapshot = (path) => cleanDate(cleanCwd(path))
       // Config loading is dependent on env so strip those from snapshots
       .replace(/.*timing config:load:.*\n/gm, '')
    +  // logfile cleaning is not awaited so it races with the process.exit
    +  // in this test and can cause snapshot failures so we always remove them
    +  .replace(/.*silly logfile.*cleaning.*\n/gm, '')
       .replace(/(Completed in )\d+(ms)/g, '$1{TIME}$2')
       .replace(/(removing )\d+( files)/g, '$1${NUM}2')
     
    @@ -106,13 +109,11 @@ const mockExitHandler = async (t, { init, load, testdir, config, mocks, files }
         errors,
         npm,
         // Make it async to make testing ergonomics a little easier so we dont need
    -    // to t.plan() every test to make sure we get process.exit called. Also
    -    // introduce a small artificial delay so the logs are consistently finished
    -    // by the time the exit handler forces process.exit
    -    exitHandler: (...args) => new Promise(res => setTimeout(() => {
    +    // to t.plan() every test to make sure we get process.exit called.
    +    exitHandler: (...args) => new Promise(res => {
           process.once('exit', res)
           exitHandler(...args)
    -    }, 50)),
    +    }),
       }
     }
     
    @@ -134,30 +135,32 @@ t.test('handles unknown error with logs and debug file', async (t) => {
     
       await exitHandler(err('Unknown error', 'ECODE'))
     
    -  const debugContent = await debugFile()
    +  const fileLogs = await debugFile()
    +  const fileLines = fileLogs.split('\n')
    +
    +  const lineNumber = /^(\d+)\s/
    +  const lastLog = fileLines[fileLines.length - 1].match(lineNumber)[1]
     
       t.equal(process.exitCode, 1)
    +
       logs.forEach((logItem, i) => {
         const logLines = format(i, ...logItem).trim().split(os.EOL)
         logLines.forEach((line) => {
    -      t.match(debugContent.trim(), line, 'log appears in debug file')
    +      t.match(fileLogs.trim(), line, 'log appears in debug file')
         })
       })
     
    -  const lastLog = debugContent
    -    .split('\n')
    -    .reduce((__, l) => parseInt(l.match(/^(\d+)\s/)[1]))
    -  t.equal(logs.length, lastLog + 1)
    +  t.equal(logs.length, parseInt(lastLog) + 1)
       t.match(logs.error, [
         ['code', 'ECODE'],
         ['ERR SUMMARY', 'Unknown error'],
         ['ERR DETAIL', 'Unknown error'],
       ])
    -  t.match(debugContent, /\d+ error code ECODE/)
    -  t.match(debugContent, /\d+ error ERR SUMMARY Unknown error/)
    -  t.match(debugContent, /\d+ error ERR DETAIL Unknown error/)
    +  t.match(fileLogs, /\d+ error code ECODE/)
    +  t.match(fileLogs, /\d+ error ERR SUMMARY Unknown error/)
    +  t.match(fileLogs, /\d+ error ERR DETAIL Unknown error/)
       t.matchSnapshot(logs, 'logs')
    -  t.matchSnapshot(debugContent, 'debug file contents')
    +  t.matchSnapshot(fileLines.map(l => l.replace(lineNumber, 'XX ')), 'debug file contents')
     })
     
     t.test('exit handler never called - loglevel silent', async (t) => {
    diff --git a/deps/npm/test/lib/utils/explain-dep.js b/deps/npm/test/lib/utils/explain-dep.js
    index 514f28d125a0d7..e5389fd26d7967 100644
    --- a/deps/npm/test/lib/utils/explain-dep.js
    +++ b/deps/npm/test/lib/utils/explain-dep.js
    @@ -1,9 +1,12 @@
     const { resolve } = require('path')
     const t = require('tap')
    +const Chalk = require('chalk')
     const { explainNode, printNode } = require('../../../lib/utils/explain-dep.js')
     const { cleanCwd } = require('../../fixtures/clean-snapshot')
     
     const testdir = t.testdirName
    +const color = new Chalk.Instance({ level: Chalk.level })
    +const noColor = new Chalk.Instance({ level: 0 })
     
     t.cleanSnapshot = (str) => cleanCwd(str)
     
    @@ -250,10 +253,10 @@ cases.workspaces = {
     
     for (const [name, expl] of Object.entries(cases)) {
       t.test(name, t => {
    -    t.matchSnapshot(printNode(expl, true), 'print color')
    -    t.matchSnapshot(printNode(expl, false), 'print nocolor')
    -    t.matchSnapshot(explainNode(expl, Infinity, true), 'explain color deep')
    -    t.matchSnapshot(explainNode(expl, 2, false), 'explain nocolor shallow')
    +    t.matchSnapshot(printNode(expl, color), 'print color')
    +    t.matchSnapshot(printNode(expl, noColor), 'print nocolor')
    +    t.matchSnapshot(explainNode(expl, Infinity, color), 'explain color deep')
    +    t.matchSnapshot(explainNode(expl, 2, noColor), 'explain nocolor shallow')
         t.end()
       })
     }
    @@ -261,6 +264,6 @@ for (const [name, expl] of Object.entries(cases)) {
     // make sure that we show the last one if it's the only one that would
     // hit the ...
     cases.manyDeps.dependents.pop()
    -t.matchSnapshot(explainNode(cases.manyDeps, 2, false), 'ellipses test one')
    +t.matchSnapshot(explainNode(cases.manyDeps, 2, noColor), 'ellipses test one')
     cases.manyDeps.dependents.pop()
    -t.matchSnapshot(explainNode(cases.manyDeps, 2, false), 'ellipses test two')
    +t.matchSnapshot(explainNode(cases.manyDeps, 2, noColor), 'ellipses test two')
    diff --git a/deps/npm/test/lib/utils/explain-eresolve.js b/deps/npm/test/lib/utils/explain-eresolve.js
    index 2c1fed77899e9e..0f60556ef2ac98 100644
    --- a/deps/npm/test/lib/utils/explain-eresolve.js
    +++ b/deps/npm/test/lib/utils/explain-eresolve.js
    @@ -1,9 +1,11 @@
     const t = require('tap')
    -const { resolve } = require('path')
    +const Chalk = require('chalk')
     const { explain, report } = require('../../../lib/utils/explain-eresolve.js')
     
     const cases = require('../../fixtures/eresolve-explanations.js')
    -const { cleanDate } = require('../../fixtures/clean-snapshot.js')
    +
    +const color = new Chalk.Instance({ level: Chalk.level })
    +const noColor = new Chalk.Instance({ level: 0 })
     
     for (const [name, expl] of Object.entries(cases)) {
       // no sense storing the whole contents of each object in the snapshot
    @@ -11,22 +13,16 @@ for (const [name, expl] of Object.entries(cases)) {
       expl.toJSON = () => ({ name, json: true })
     
       t.test(name, t => {
    -    const dir = t.testdir()
    -    const fileReport = resolve(dir, 'eresolve-report.txt')
    -    const opts = { file: fileReport, date: new Date().toISOString() }
    -
    -    t.cleanSnapshot = str => cleanDate(str.split(fileReport).join('${REPORT}'))
    -
    -    const color = report(expl, true, opts)
    -    t.matchSnapshot(color.explanation, 'report with color')
    -    t.matchSnapshot(color.file, 'report from color')
    +    const colorReport = report(expl, color, noColor)
    +    t.matchSnapshot(colorReport.explanation, 'report with color')
    +    t.matchSnapshot(colorReport.file, 'report from color')
     
    -    const noColor = report(expl, false, opts)
    -    t.matchSnapshot(noColor.explanation, 'report with no color')
    -    t.equal(noColor.file, color.file, 'same report written for object')
    +    const noColorReport = report(expl, noColor, noColor)
    +    t.matchSnapshot(noColorReport.explanation, 'report with no color')
    +    t.equal(noColorReport.file, colorReport.file, 'same report written for object')
     
    -    t.matchSnapshot(explain(expl, true, 2), 'explain with color, depth of 2')
    -    t.matchSnapshot(explain(expl, false, 6), 'explain with no color, depth of 6')
    +    t.matchSnapshot(explain(expl, color, 2), 'explain with color, depth of 2')
    +    t.matchSnapshot(explain(expl, noColor, 6), 'explain with no color, depth of 6')
     
         t.end()
       })
    diff --git a/deps/npm/test/lib/utils/log-file.js b/deps/npm/test/lib/utils/log-file.js
    index e134fe8790bd53..fde17dee96b029 100644
    --- a/deps/npm/test/lib/utils/log-file.js
    +++ b/deps/npm/test/lib/utils/log-file.js
    @@ -255,6 +255,20 @@ t.test('glob error', async t => {
       t.match(last(logs).content, /error cleaning log files .* bad glob/)
     })
     
    +t.test('do not log cleaning errors when logging is disabled', async t => {
    +  const { readLogs } = await loadLogFile(t, {
    +    logsMax: 0,
    +    mocks: {
    +      glob: () => {
    +        throw new Error('should not be logged')
    +      },
    +    },
    +  })
    +
    +  const logs = await readLogs()
    +  t.equal(logs.length, 0)
    +})
    +
     t.test('cleans old style logs too', async t => {
       const logsMax = 5
       const oldLogs = 10
    diff --git a/deps/npm/test/lib/utils/update-notifier.js b/deps/npm/test/lib/utils/update-notifier.js
    index e7830e6d9d66e0..9c12433a2d1177 100644
    --- a/deps/npm/test/lib/utils/update-notifier.js
    +++ b/deps/npm/test/lib/utils/update-notifier.js
    @@ -1,10 +1,8 @@
     const t = require('tap')
    +const { basename } = require('path')
     const tmock = require('../../fixtures/tmock')
    +const mockNpm = require('../../fixtures/mock-npm')
     
    -let ciMock = {}
    -const flatOptions = { global: false, cache: t.testdir() + '/_cacache' }
    -
    -const MANIFEST_REQUEST = []
     const CURRENT_VERSION = '123.420.69'
     const CURRENT_MAJOR = '122.420.69'
     const CURRENT_MINOR = '123.419.69'
    @@ -15,238 +13,196 @@ const NEXT_PATCH = '123.421.69'
     const CURRENT_BETA = '124.0.0-beta.99999'
     const HAVE_BETA = '124.0.0-beta.0'
     
    -let PACOTE_ERROR = null
    -const pacote = {
    -  manifest: async (spec, opts) => {
    -    if (!spec.match(/^npm@/)) {
    -      process.exit(1)
    -    }
    -    MANIFEST_REQUEST.push(spec)
    -    if (PACOTE_ERROR) {
    -      throw PACOTE_ERROR
    -    }
    -
    -    return {
    -      version:
    -        spec === 'npm@latest'
    -          ? CURRENT_VERSION
    -          : /-/.test(spec)
    -            ? CURRENT_BETA
    -            : NEXT_VERSION,
    -    }
    -  },
    -}
    -
    -const defaultNpm = {
    -  flatOptions,
    -  version: CURRENT_VERSION,
    -  config: { get: k => k !== 'global' },
    -  command: 'view',
    -  argv: ['npm'],
    -}
    -
    -const { basename } = require('path')
    -
    -let STAT_ERROR = null
    -let STAT_MTIME = null
    -let WRITE_ERROR = null
    -const fs = {
    -  ...require('fs'),
    -  stat: (path, cb) => {
    -    if (basename(path) !== '_update-notifier-last-checked') {
    -      process.exit(1)
    -    }
    -    process.nextTick(() => cb(STAT_ERROR, { mtime: new Date(STAT_MTIME) }))
    -  },
    -  writeFile: (path, content, cb) => {
    -    if (content !== '') {
    -      process.exit(1)
    -    }
    -    if (basename(path) !== '_update-notifier-last-checked') {
    -      process.exit(1)
    -    }
    -    process.nextTick(() => cb(WRITE_ERROR))
    -  },
    +const runUpdateNotifier = async (t, {
    +  STAT_ERROR,
    +  WRITE_ERROR,
    +  PACOTE_ERROR,
    +  STAT_MTIME = 0,
    +  mocks: _mocks = {},
    +  command = 'view',
    +  version = CURRENT_VERSION,
    +  argv = [],
    +  ...config
    +} = {}) => {
    +  const mockFs = {
    +    ...require('fs/promises'),
    +    stat: async (path) => {
    +      if (basename(path) !== '_update-notifier-last-checked') {
    +        t.fail('no stat allowed for non upate notifier files')
    +      }
    +      if (STAT_ERROR) {
    +        throw STAT_ERROR
    +      }
    +      return { mtime: new Date(STAT_MTIME) }
    +    },
    +    writeFile: async (path, content) => {
    +      if (content !== '') {
    +        t.fail('no write file content allowed')
    +      }
    +      if (basename(path) !== '_update-notifier-last-checked') {
    +        t.fail('no writefile allowed for non upate notifier files')
    +      }
    +      if (WRITE_ERROR) {
    +        throw WRITE_ERROR
    +      }
    +    },
    +  }
    +
    +  const MANIFEST_REQUEST = []
    +  const mockPacote = {
    +    manifest: async (spec) => {
    +      if (!spec.match(/^npm@/)) {
    +        t.fail('no pacote manifest allowed for non npm packages')
    +      }
    +      MANIFEST_REQUEST.push(spec)
    +      if (PACOTE_ERROR) {
    +        throw PACOTE_ERROR
    +      }
    +      const manifestV = spec === 'npm@latest' ? CURRENT_VERSION
    +        : /-/.test(spec) ? CURRENT_BETA : NEXT_VERSION
    +      return { version: manifestV }
    +    },
    +  }
    +
    +  const mocks = {
    +    pacote: mockPacote,
    +    'fs/promises': mockFs,
    +    '{ROOT}/package.json': { version },
    +    'ci-info': { isCI: false, name: null },
    +    ..._mocks,
    +  }
    +
    +  const mock = await mockNpm(t, {
    +    command,
    +    mocks,
    +    config,
    +    argv,
    +  })
    +  const updateNotifier = tmock(t, '{LIB}/utils/update-notifier.js', mocks)
    +
    +  const result = await updateNotifier(mock.npm)
    +
    +  return {
    +    result,
    +    MANIFEST_REQUEST,
    +  }
     }
     
    -t.afterEach(() => {
    -  MANIFEST_REQUEST.length = 0
    -  STAT_ERROR = null
    -  PACOTE_ERROR = null
    -  STAT_MTIME = null
    -  WRITE_ERROR = null
    +t.test('does not notify by default', async t => {
    +  const { result, MANIFEST_REQUEST } = await runUpdateNotifier(t)
    +  t.not(result)
    +  t.equal(MANIFEST_REQUEST.length, 1)
     })
     
    -const runUpdateNotifier = async ({ color = true, ...npmOptions } = {}) => {
    -  const _npm = { ...defaultNpm, ...npmOptions, logColor: color }
    -  return tmock(t, '{LIB}/utils/update-notifier.js', {
    -    'ci-info': ciMock,
    -    pacote,
    -    fs,
    -  })(_npm)
    -}
    -
     t.test('situations in which we do not notify', t => {
       t.test('nothing to do if notifier disabled', async t => {
    -    t.equal(
    -      await runUpdateNotifier({
    -        config: { get: k => k !== 'update-notifier' },
    -      }),
    -      null
    -    )
    +    const { result, MANIFEST_REQUEST } = await runUpdateNotifier(t, {
    +      'update-notifier': false,
    +    })
    +    t.equal(result, null)
         t.strictSame(MANIFEST_REQUEST, [], 'no requests for manifests')
       })
     
       t.test('do not suggest update if already updating', async t => {
    -    t.equal(
    -      await runUpdateNotifier({
    -        flatOptions: { ...flatOptions, global: true },
    -        command: 'install',
    -        argv: ['npm'],
    -      }),
    -      null
    -    )
    +    const { result, MANIFEST_REQUEST } = await runUpdateNotifier(t, {
    +      command: 'install',
    +      argv: ['npm'],
    +      global: true,
    +    })
    +    t.equal(result, null)
         t.strictSame(MANIFEST_REQUEST, [], 'no requests for manifests')
       })
     
       t.test('do not suggest update if already updating with spec', async t => {
    -    t.equal(
    -      await runUpdateNotifier({
    -        flatOptions: { ...flatOptions, global: true },
    -        command: 'install',
    -        argv: ['npm@latest'],
    -      }),
    -      null
    -    )
    +    const { result, MANIFEST_REQUEST } = await runUpdateNotifier(t, {
    +      command: 'install',
    +      argv: ['npm@latest'],
    +      global: true,
    +    })
    +    t.equal(result, null)
         t.strictSame(MANIFEST_REQUEST, [], 'no requests for manifests')
       })
     
       t.test('do not update if same as latest', async t => {
    -    t.equal(await runUpdateNotifier(), null)
    +    const { result, MANIFEST_REQUEST } = await runUpdateNotifier(t)
    +    t.equal(result, null)
         t.strictSame(MANIFEST_REQUEST, ['npm@latest'], 'requested latest version')
       })
       t.test('check if stat errors (here for coverage)', async t => {
    -    STAT_ERROR = new Error('blorg')
    -    t.equal(await runUpdateNotifier(), null)
    +    const STAT_ERROR = new Error('blorg')
    +    const { result, MANIFEST_REQUEST } = await runUpdateNotifier(t, { STAT_ERROR })
    +    t.equal(result, null)
         t.strictSame(MANIFEST_REQUEST, ['npm@latest'], 'requested latest version')
       })
       t.test('ok if write errors (here for coverage)', async t => {
    -    WRITE_ERROR = new Error('grolb')
    -    t.equal(await runUpdateNotifier(), null)
    +    const WRITE_ERROR = new Error('grolb')
    +    const { result, MANIFEST_REQUEST } = await runUpdateNotifier(t, { WRITE_ERROR })
    +    t.equal(result, null)
         t.strictSame(MANIFEST_REQUEST, ['npm@latest'], 'requested latest version')
       })
       t.test('ignore pacote failures (here for coverage)', async t => {
    -    PACOTE_ERROR = new Error('pah-KO-tchay')
    -    t.equal(await runUpdateNotifier(), null)
    +    const PACOTE_ERROR = new Error('pah-KO-tchay')
    +    const { result, MANIFEST_REQUEST } = await runUpdateNotifier(t, { PACOTE_ERROR })
    +    t.equal(result, null)
         t.strictSame(MANIFEST_REQUEST, ['npm@latest'], 'requested latest version')
       })
       t.test('do not update if newer than latest, but same as next', async t => {
    -    t.equal(await runUpdateNotifier({ version: NEXT_VERSION }), null)
    +    const { result, MANIFEST_REQUEST } = await runUpdateNotifier(t, { version: NEXT_VERSION })
    +    t.equal(result, null)
         const reqs = ['npm@latest', `npm@^${NEXT_VERSION}`]
         t.strictSame(MANIFEST_REQUEST, reqs, 'requested latest and next versions')
       })
       t.test('do not update if on the latest beta', async t => {
    -    t.equal(await runUpdateNotifier({ version: CURRENT_BETA }), null)
    +    const { result, MANIFEST_REQUEST } = await runUpdateNotifier(t, { version: CURRENT_BETA })
    +    t.equal(result, null)
         const reqs = [`npm@^${CURRENT_BETA}`]
         t.strictSame(MANIFEST_REQUEST, reqs, 'requested latest and next versions')
       })
     
       t.test('do not update in CI', async t => {
    -    t.teardown(() => {
    -      ciMock = {}
    -    })
    -    ciMock = { isCI: true, name: 'something' }
    -    t.equal(await runUpdateNotifier(), null)
    +    const { result, MANIFEST_REQUEST } = await runUpdateNotifier(t, { mocks: {
    +      'ci-info': { isCI: true, name: 'something' },
    +    } })
    +    t.equal(result, null)
         t.strictSame(MANIFEST_REQUEST, [], 'no requests for manifests')
       })
     
       t.test('only check weekly for GA releases', async t => {
         // One week (plus five minutes to account for test environment fuzziness)
    -    STAT_MTIME = Date.now() - 1000 * 60 * 60 * 24 * 7 + 1000 * 60 * 5
    -    t.equal(await runUpdateNotifier(), null)
    +    const STAT_MTIME = Date.now() - 1000 * 60 * 60 * 24 * 7 + 1000 * 60 * 5
    +    const { result, MANIFEST_REQUEST } = await runUpdateNotifier(t, { STAT_MTIME })
    +    t.equal(result, null)
         t.strictSame(MANIFEST_REQUEST, [], 'no requests for manifests')
       })
     
       t.test('only check daily for betas', async t => {
         // One day (plus five minutes to account for test environment fuzziness)
    -    STAT_MTIME = Date.now() - 1000 * 60 * 60 * 24 + 1000 * 60 * 5
    -    t.equal(await runUpdateNotifier({ version: HAVE_BETA }), null)
    -    t.strictSame(MANIFEST_REQUEST, [], 'no requests for manifests')
    +    const STAT_MTIME = Date.now() - 1000 * 60 * 60 * 24 + 1000 * 60 * 5
    +    const res = await runUpdateNotifier(t, { STAT_MTIME, version: HAVE_BETA })
    +    t.equal(res.result, null)
    +    t.strictSame(res.MANIFEST_REQUEST, [], 'no requests for manifests')
       })
     
       t.end()
     })
     
    -t.test('notification situations', t => {
    -  t.test('new beta available', async t => {
    -    const version = HAVE_BETA
    -    t.matchSnapshot(await runUpdateNotifier({ version }), 'color')
    -    t.matchSnapshot(
    -      await runUpdateNotifier({ version, color: false }),
    -      'no color'
    -    )
    -    t.strictSame(MANIFEST_REQUEST, [`npm@^${version}`, `npm@^${version}`])
    -  })
    -
    -  t.test('patch to next version', async t => {
    -    const version = NEXT_PATCH
    -    t.matchSnapshot(await runUpdateNotifier({ version }), 'color')
    -    t.matchSnapshot(
    -      await runUpdateNotifier({ version, color: false }),
    -      'no color'
    -    )
    -    t.strictSame(MANIFEST_REQUEST, [
    -      'npm@latest',
    -      `npm@^${version}`,
    -      'npm@latest',
    -      `npm@^${version}`,
    -    ])
    -  })
    -
    -  t.test('minor to next version', async t => {
    -    const version = NEXT_MINOR
    -    t.matchSnapshot(await runUpdateNotifier({ version }), 'color')
    -    t.matchSnapshot(
    -      await runUpdateNotifier({ version, color: false }),
    -      'no color'
    -    )
    -    t.strictSame(MANIFEST_REQUEST, [
    -      'npm@latest',
    -      `npm@^${version}`,
    -      'npm@latest',
    -      `npm@^${version}`,
    -    ])
    -  })
    -
    -  t.test('patch to current', async t => {
    -    const version = CURRENT_PATCH
    -    t.matchSnapshot(await runUpdateNotifier({ version }), 'color')
    -    t.matchSnapshot(
    -      await runUpdateNotifier({ version, color: false }),
    -      'no color'
    -    )
    -    t.strictSame(MANIFEST_REQUEST, ['npm@latest', 'npm@latest'])
    -  })
    -
    -  t.test('minor to current', async t => {
    -    const version = CURRENT_MINOR
    -    t.matchSnapshot(await runUpdateNotifier({ version }), 'color')
    -    t.matchSnapshot(
    -      await runUpdateNotifier({ version, color: false }),
    -      'no color'
    -    )
    -    t.strictSame(MANIFEST_REQUEST, ['npm@latest', 'npm@latest'])
    -  })
    -
    -  t.test('major to current', async t => {
    -    const version = CURRENT_MAJOR
    -    t.matchSnapshot(await runUpdateNotifier({ version }), 'color')
    -    t.matchSnapshot(
    -      await runUpdateNotifier({ version, color: false }),
    -      'no color'
    -    )
    -    t.strictSame(MANIFEST_REQUEST, ['npm@latest', 'npm@latest'])
    -  })
    -
    -  t.end()
    +t.test('notification situations', async t => {
    +  const cases = {
    +    [HAVE_BETA]: [`^{V}`],
    +    [NEXT_PATCH]: [`latest`, `^{V}`],
    +    [NEXT_MINOR]: [`latest`, `^{V}`],
    +    [CURRENT_PATCH]: ['latest'],
    +    [CURRENT_MINOR]: ['latest'],
    +    [CURRENT_MAJOR]: ['latest'],
    +  }
    +
    +  for (const [version, reqs] of Object.entries(cases)) {
    +    for (const color of [false, 'always']) {
    +      await t.test(`${version} - color=${color}`, async t => {
    +        const { result, MANIFEST_REQUEST } = await runUpdateNotifier(t, { version, color })
    +        t.matchSnapshot(result)
    +        t.strictSame(MANIFEST_REQUEST, reqs.map(r => `npm@${r.replace('{V}', version)}`))
    +      })
    +    }
    +  }
     })
    diff --git a/deps/openssl/openssl-cli.gypi b/deps/openssl/openssl-cli.gypi
    index 1209d64e46dbc2..b4c278b4fe8f9f 100644
    --- a/deps/openssl/openssl-cli.gypi
    +++ b/deps/openssl/openssl-cli.gypi
    @@ -21,5 +21,9 @@
             ],
           },
         }],
    +    # Avoid excessive LTO
    +    ['enable_lto=="true"', {
    +      'ldflags': [ '-fno-lto' ],
    +    }],
       ],
     }
    diff --git a/deps/openssl/openssl.gyp b/deps/openssl/openssl.gyp
    index 861bbc5844ca7b..f6b157f8d60813 100644
    --- a/deps/openssl/openssl.gyp
    +++ b/deps/openssl/openssl.gyp
    @@ -79,6 +79,10 @@
             }, {
               'includes': ['./openssl-cl_asm.gypi'],
             }],
    +        # Avoid excessive LTO
    +        ['enable_lto=="true"', {
    +          'ldflags': [ '-fno-lto' ],
    +        }],
          ]
         }, {
           # openssl-fipsmodule target
    diff --git a/deps/simdutf/simdutf.cpp b/deps/simdutf/simdutf.cpp
    index d3100c1561d350..3065bcdfbb3857 100644
    --- a/deps/simdutf/simdutf.cpp
    +++ b/deps/simdutf/simdutf.cpp
    @@ -1,4 +1,4 @@
    -/* auto-generated on 2023-02-24 17:01:43 -0500. Do not edit! */
    +/* auto-generated on 2023-03-30 20:31:03 -0400. Do not edit! */
     // dofile: invoked with prepath=/Users/dlemire/CVS/github/simdutf/src, filename=simdutf.cpp
     /* begin file src/simdutf.cpp */
     #include "simdutf.h"
    @@ -17218,7 +17218,7 @@ std::pair avx512_convert_utf32_to_utf8(const char32_t* b
       __m256i running_max = _mm256_setzero_si256();
       __m256i forbidden_bytemask = _mm256_setzero_si256();
     
    -  const size_t safety_margin = 11; // to avoid overruns, see issue https://github.com/simdutf/simdutf/issues/92
    +  const size_t safety_margin = 12; // to avoid overruns, see issue https://github.com/simdutf/simdutf/issues/92
     
       while (buf + 16 + safety_margin <= end) {
         __m256i in = _mm256_loadu_si256((__m256i*)buf);
    @@ -17459,7 +17459,7 @@ std::pair avx512_convert_utf32_to_utf8_with_errors(const char32_t
       const __m256i v_7fffffff = _mm256_set1_epi32((uint32_t)0x7fffffff);
       const __m256i v_10ffff = _mm256_set1_epi32((uint32_t)0x10ffff);
     
    -  const size_t safety_margin = 11; // to avoid overruns, see issue https://github.com/simdutf/simdutf/issues/92
    +  const size_t safety_margin = 12; // to avoid overruns, see issue https://github.com/simdutf/simdutf/issues/92
     
       while (buf + 16 + safety_margin <= end) {
         __m256i in = _mm256_loadu_si256((__m256i*)buf);
    @@ -17697,7 +17697,7 @@ template 
     std::pair avx512_convert_utf32_to_utf16(const char32_t* buf, size_t len, char16_t* utf16_output) {
       const char32_t* end = buf + len;
     
    -  const size_t safety_margin = 11; // to avoid overruns, see issue https://github.com/simdutf/simdutf/issues/92
    +  const size_t safety_margin = 12; // to avoid overruns, see issue https://github.com/simdutf/simdutf/issues/92
       __m256i forbidden_bytemask = _mm256_setzero_si256();
     
     
    @@ -17764,7 +17764,7 @@ std::pair avx512_convert_utf32_to_utf16_with_errors(const cha
       const char32_t* start = buf;
       const char32_t* end = buf + len;
     
    -  const size_t safety_margin = 11; // to avoid overruns, see issue https://github.com/simdutf/simdutf/issues/92
    +  const size_t safety_margin = 12; // to avoid overruns, see issue https://github.com/simdutf/simdutf/issues/92
     
       while (buf + 8 + safety_margin <= end) {
         __m256i in = _mm256_loadu_si256((__m256i*)buf);
    @@ -20064,7 +20064,7 @@ std::pair avx2_convert_utf16_to_utf8(const char16_t* buf
       const __m256i v_f800 = _mm256_set1_epi16((int16_t)0xf800);
       const __m256i v_d800 = _mm256_set1_epi16((int16_t)0xd800);
       const __m256i v_c080 = _mm256_set1_epi16((int16_t)0xc080);
    -  const size_t safety_margin = 11; // to avoid overruns, see issue https://github.com/simdutf/simdutf/issues/92
    +  const size_t safety_margin = 12; // to avoid overruns, see issue https://github.com/simdutf/simdutf/issues/92
     
       while (buf + 16 + safety_margin <= end) {
         __m256i in = _mm256_loadu_si256((__m256i*)buf);
    @@ -20307,7 +20307,7 @@ std::pair avx2_convert_utf16_to_utf8_with_errors(const char16_t*
       const __m256i v_f800 = _mm256_set1_epi16((int16_t)0xf800);
       const __m256i v_d800 = _mm256_set1_epi16((int16_t)0xd800);
       const __m256i v_c080 = _mm256_set1_epi16((int16_t)0xc080);
    -  const size_t safety_margin = 11; // to avoid overruns, see issue https://github.com/simdutf/simdutf/issues/92
    +  const size_t safety_margin = 12; // to avoid overruns, see issue https://github.com/simdutf/simdutf/issues/92
     
       while (buf + 16 + safety_margin <= end) {
         __m256i in = _mm256_loadu_si256((__m256i*)buf);
    @@ -20732,7 +20732,7 @@ std::pair avx2_convert_utf32_to_utf8(const char32_t* buf
       __m256i running_max = _mm256_setzero_si256();
       __m256i forbidden_bytemask = _mm256_setzero_si256();
     
    -  const size_t safety_margin = 11; // to avoid overruns, see issue https://github.com/simdutf/simdutf/issues/92
    +  const size_t safety_margin = 12; // to avoid overruns, see issue https://github.com/simdutf/simdutf/issues/92
     
       while (buf + 16 + safety_margin <= end) {
         __m256i in = _mm256_loadu_si256((__m256i*)buf);
    @@ -20973,7 +20973,7 @@ std::pair avx2_convert_utf32_to_utf8_with_errors(const char32_t*
       const __m256i v_7fffffff = _mm256_set1_epi32((uint32_t)0x7fffffff);
       const __m256i v_10ffff = _mm256_set1_epi32((uint32_t)0x10ffff);
     
    -  const size_t safety_margin = 11; // to avoid overruns, see issue https://github.com/simdutf/simdutf/issues/92
    +  const size_t safety_margin = 12; // to avoid overruns, see issue https://github.com/simdutf/simdutf/issues/92
     
       while (buf + 16 + safety_margin <= end) {
         __m256i in = _mm256_loadu_si256((__m256i*)buf);
    @@ -21208,7 +21208,7 @@ template 
     std::pair avx2_convert_utf32_to_utf16(const char32_t* buf, size_t len, char16_t* utf16_output) {
       const char32_t* end = buf + len;
     
    -  const size_t safety_margin = 11; // to avoid overruns, see issue https://github.com/simdutf/simdutf/issues/92
    +  const size_t safety_margin = 12; // to avoid overruns, see issue https://github.com/simdutf/simdutf/issues/92
       __m256i forbidden_bytemask = _mm256_setzero_si256();
     
     
    @@ -21275,7 +21275,7 @@ std::pair avx2_convert_utf32_to_utf16_with_errors(const char3
       const char32_t* start = buf;
       const char32_t* end = buf + len;
     
    -  const size_t safety_margin = 11; // to avoid overruns, see issue https://github.com/simdutf/simdutf/issues/92
    +  const size_t safety_margin = 12; // to avoid overruns, see issue https://github.com/simdutf/simdutf/issues/92
     
       while (buf + 8 + safety_margin <= end) {
         __m256i in = _mm256_loadu_si256((__m256i*)buf);
    @@ -25394,7 +25394,7 @@ std::pair sse_convert_utf16_to_utf8(const char16_t* buf,
       const __m128i v_f800 = _mm_set1_epi16((int16_t)0xf800);
       const __m128i v_d800 = _mm_set1_epi16((int16_t)0xd800);
       const __m128i v_c080 = _mm_set1_epi16((int16_t)0xc080);
    -  const size_t safety_margin = 11; // to avoid overruns, see issue https://github.com/simdutf/simdutf/issues/92
    +  const size_t safety_margin = 12; // to avoid overruns, see issue https://github.com/simdutf/simdutf/issues/92
     
       while (buf + 16 + safety_margin <= end) {
         __m128i in = _mm_loadu_si128((__m128i*)buf);
    @@ -25634,7 +25634,7 @@ std::pair sse_convert_utf16_to_utf8_with_errors(const char16_t* b
       const __m128i v_f800 = _mm_set1_epi16((int16_t)0xf800);
       const __m128i v_d800 = _mm_set1_epi16((int16_t)0xd800);
       const __m128i v_c080 = _mm_set1_epi16((int16_t)0xc080);
    -  const size_t safety_margin = 11; // to avoid overruns, see issue https://github.com/simdutf/simdutf/issues/92
    +  const size_t safety_margin = 12; // to avoid overruns, see issue https://github.com/simdutf/simdutf/issues/92
     
       while (buf + 16 + safety_margin <= end) {
         __m128i in = _mm_loadu_si128((__m128i*)buf);
    @@ -26056,7 +26056,7 @@ std::pair sse_convert_utf32_to_utf8(const char32_t* buf,
       const __m128i v_7fffffff = _mm_set1_epi32((uint32_t)0x7fffffff);
       __m128i running_max = _mm_setzero_si128();
       __m128i forbidden_bytemask = _mm_setzero_si128();
    -  const size_t safety_margin = 11; // to avoid overruns, see issue https://github.com/simdutf/simdutf/issues/92
    +  const size_t safety_margin = 12; // to avoid overruns, see issue https://github.com/simdutf/simdutf/issues/92
     
       while (buf + 16 + safety_margin <= end) {
         __m128i in = _mm_loadu_si128((__m128i*)buf);
    @@ -26297,7 +26297,7 @@ std::pair sse_convert_utf32_to_utf8_with_errors(const char32_t* b
       const __m128i v_7fffffff = _mm_set1_epi32((uint32_t)0x7fffffff);
       const __m128i v_10ffff = _mm_set1_epi32((uint32_t)0x10ffff);
     
    -  const size_t safety_margin = 11; // to avoid overruns, see issue https://github.com/simdutf/simdutf/issues/92
    +  const size_t safety_margin = 12; // to avoid overruns, see issue https://github.com/simdutf/simdutf/issues/92
     
       while (buf + 16 + safety_margin <= end) {
         __m128i in = _mm_loadu_si128((__m128i*)buf);
    diff --git a/deps/simdutf/simdutf.gyp b/deps/simdutf/simdutf.gyp
    index baa6ad7e437956..a86e92eb608d7e 100644
    --- a/deps/simdutf/simdutf.gyp
    +++ b/deps/simdutf/simdutf.gyp
    @@ -1,4 +1,9 @@
     {
    +  'variables': {
    +    'simdutf_sources': [
    +      'simdutf.cpp',
    +    ]
    +  },
       'targets': [
         {
           'target_name': 'simdutf',
    @@ -7,7 +12,9 @@
           'direct_dependent_settings': {
             'include_dirs': ['.'],
           },
    -      'sources': ['simdutf.cpp'],
    +      'sources': [
    +        '<@(simdutf_sources)',
    +      ],
         },
       ]
     }
    diff --git a/deps/simdutf/simdutf.h b/deps/simdutf/simdutf.h
    index 80189d316cba8c..bc18418fbf52cb 100644
    --- a/deps/simdutf/simdutf.h
    +++ b/deps/simdutf/simdutf.h
    @@ -1,4 +1,4 @@
    -/* auto-generated on 2023-02-24 17:01:43 -0500. Do not edit! */
    +/* auto-generated on 2023-03-30 20:31:03 -0400. Do not edit! */
     // dofile: invoked with prepath=/Users/dlemire/CVS/github/simdutf/include, filename=simdutf.h
     /* begin file include/simdutf.h */
     #ifndef SIMDUTF_H
    @@ -572,7 +572,7 @@ SIMDUTF_DISABLE_UNDESIRED_WARNINGS
     #define SIMDUTF_SIMDUTF_VERSION_H
     
     /** The version of simdutf being used (major.minor.revision) */
    -#define SIMDUTF_VERSION "3.2.2"
    +#define SIMDUTF_VERSION "3.2.3"
     
     namespace simdutf {
     enum {
    @@ -587,7 +587,7 @@ enum {
       /**
        * The revision (major.minor.REVISION) of simdutf being used.
        */
    -  SIMDUTF_VERSION_REVISION = 2
    +  SIMDUTF_VERSION_REVISION = 3
     };
     } // namespace simdutf
     
    diff --git a/deps/uv/uv.gyp b/deps/uv/uv.gyp
    index c1adbc1b714d68..ad13f89dfa5bde 100644
    --- a/deps/uv/uv.gyp
    +++ b/deps/uv/uv.gyp
    @@ -34,6 +34,129 @@
             'shared_zos_defines': [ ],
           }],
         ],
    +    'uv_sources_common': [
    +      'include/uv.h',
    +      'include/uv/tree.h',
    +      'include/uv/errno.h',
    +      'include/uv/threadpool.h',
    +      'include/uv/version.h',
    +      'src/fs-poll.c',
    +      'src/heap-inl.h',
    +      'src/idna.c',
    +      'src/idna.h',
    +      'src/inet.c',
    +      'src/queue.h',
    +      'src/random.c',
    +      'src/strscpy.c',
    +      'src/strscpy.h',
    +      'src/strtok.c',
    +      'src/strtok.h',
    +      'src/threadpool.c',
    +      'src/timer.c',
    +      'src/uv-data-getter-setters.c',
    +      'src/uv-common.c',
    +      'src/uv-common.h',
    +      'src/version.c',
    +    ],
    +    'uv_sources_win': [
    +      'include/uv/win.h',
    +      'src/win/async.c',
    +      'src/win/atomicops-inl.h',
    +      'src/win/core.c',
    +      'src/win/detect-wakeup.c',
    +      'src/win/dl.c',
    +      'src/win/error.c',
    +      'src/win/fs.c',
    +      'src/win/fs-event.c',
    +      'src/win/getaddrinfo.c',
    +      'src/win/getnameinfo.c',
    +      'src/win/handle.c',
    +      'src/win/handle-inl.h',
    +      'src/win/internal.h',
    +      'src/win/loop-watcher.c',
    +      'src/win/pipe.c',
    +      'src/win/thread.c',
    +      'src/win/poll.c',
    +      'src/win/process.c',
    +      'src/win/process-stdio.c',
    +      'src/win/req-inl.h',
    +      'src/win/signal.c',
    +      'src/win/snprintf.c',
    +      'src/win/stream.c',
    +      'src/win/stream-inl.h',
    +      'src/win/tcp.c',
    +      'src/win/tty.c',
    +      'src/win/udp.c',
    +      'src/win/util.c',
    +      'src/win/winapi.c',
    +      'src/win/winapi.h',
    +      'src/win/winsock.c',
    +      'src/win/winsock.h',
    +    ],
    +    'uv_sources_posix': [
    +      'include/uv/unix.h',
    +      'include/uv/linux.h',
    +      'include/uv/sunos.h',
    +      'include/uv/darwin.h',
    +      'include/uv/bsd.h',
    +      'include/uv/aix.h',
    +      'src/unix/async.c',
    +      'src/unix/atomic-ops.h',
    +      'src/unix/core.c',
    +      'src/unix/dl.c',
    +      'src/unix/fs.c',
    +      'src/unix/getaddrinfo.c',
    +      'src/unix/getnameinfo.c',
    +      'src/unix/internal.h',
    +      'src/unix/loop.c',
    +      'src/unix/loop-watcher.c',
    +      'src/unix/pipe.c',
    +      'src/unix/poll.c',
    +      'src/unix/process.c',
    +      'src/unix/random-devurandom.c',
    +      'src/unix/signal.c',
    +      'src/unix/spinlock.h',
    +      'src/unix/stream.c',
    +      'src/unix/tcp.c',
    +      'src/unix/thread.c',
    +      'src/unix/tty.c',
    +      'src/unix/udp.c',
    +    ],
    +    'uv_sources_apple': [
    +      'src/unix/darwin.c',
    +      'src/unix/fsevents.c',
    +      'src/unix/darwin-proctitle.c',
    +      'src/unix/random-getentropy.c',
    +    ],
    +    'uv_sources_linux': [
    +      'src/unix/epoll.c',
    +      'src/unix/linux-core.c',
    +      'src/unix/linux-inotify.c',
    +      'src/unix/linux-syscalls.c',
    +      'src/unix/linux-syscalls.h',
    +      'src/unix/procfs-exepath.c',
    +      'src/unix/random-getrandom.c',
    +      'src/unix/random-sysctl-linux.c',
    +    ],
    +    'uv_sources_android': [
    +      'src/unix/linux-core.c',
    +      'src/unix/linux-inotify.c',
    +      'src/unix/linux-syscalls.c',
    +      'src/unix/procfs-exepath.c',
    +      'src/unix/pthread-fixes.c',
    +      'src/unix/random-getentropy.c',
    +      'src/unix/random-getrandom.c',
    +      'src/unix/random-sysctl-linux.c',
    +      'src/unix/epoll.c',
    +    ],
    +    'uv_sources_solaris': [
    +      'src/unix/no-proctitle.c',
    +      'src/unix/sunos.c',
    +    ],
    +    'uv_sources_bsd_common': [
    +      'src/unix/bsd-ifaddrs.c',
    +      'src/unix/kqueue.c',
    +    ],
       },
     
       'targets': [
    @@ -64,28 +187,7 @@
           },
           'sources': [
             'common.gypi',
    -        'include/uv.h',
    -        'include/uv/tree.h',
    -        'include/uv/errno.h',
    -        'include/uv/threadpool.h',
    -        'include/uv/version.h',
    -        'src/fs-poll.c',
    -        'src/heap-inl.h',
    -        'src/idna.c',
    -        'src/idna.h',
    -        'src/inet.c',
    -        'src/queue.h',
    -        'src/random.c',
    -        'src/strscpy.c',
    -        'src/strscpy.h',
    -        'src/strtok.c',
    -        'src/strtok.h',
    -        'src/threadpool.c',
    -        'src/timer.c',
    -        'src/uv-data-getter-setters.c',
    -        'src/uv-common.c',
    -        'src/uv-common.h',
    -        'src/version.c'
    +        '<@(uv_sources_common)',
           ],
           'xcode_settings': {
             'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES',  # -fvisibility=hidden
    @@ -104,39 +206,7 @@
                 '_GNU_SOURCE',
               ],
               'sources': [
    -            'include/uv/win.h',
    -            'src/win/async.c',
    -            'src/win/atomicops-inl.h',
    -            'src/win/core.c',
    -            'src/win/detect-wakeup.c',
    -            'src/win/dl.c',
    -            'src/win/error.c',
    -            'src/win/fs.c',
    -            'src/win/fs-event.c',
    -            'src/win/getaddrinfo.c',
    -            'src/win/getnameinfo.c',
    -            'src/win/handle.c',
    -            'src/win/handle-inl.h',
    -            'src/win/internal.h',
    -            'src/win/loop-watcher.c',
    -            'src/win/pipe.c',
    -            'src/win/thread.c',
    -            'src/win/poll.c',
    -            'src/win/process.c',
    -            'src/win/process-stdio.c',
    -            'src/win/req-inl.h',
    -            'src/win/signal.c',
    -            'src/win/snprintf.c',
    -            'src/win/stream.c',
    -            'src/win/stream-inl.h',
    -            'src/win/tcp.c',
    -            'src/win/tty.c',
    -            'src/win/udp.c',
    -            'src/win/util.c',
    -            'src/win/winapi.c',
    -            'src/win/winapi.h',
    -            'src/win/winsock.c',
    -            'src/win/winsock.h',
    +            '<@(uv_sources_win)',
               ],
               'link_settings': {
                 'libraries': [
    @@ -151,33 +221,7 @@
               },
             }, { # Not Windows i.e. POSIX
               'sources': [
    -            'include/uv/unix.h',
    -            'include/uv/linux.h',
    -            'include/uv/sunos.h',
    -            'include/uv/darwin.h',
    -            'include/uv/bsd.h',
    -            'include/uv/aix.h',
    -            'src/unix/async.c',
    -            'src/unix/atomic-ops.h',
    -            'src/unix/core.c',
    -            'src/unix/dl.c',
    -            'src/unix/fs.c',
    -            'src/unix/getaddrinfo.c',
    -            'src/unix/getnameinfo.c',
    -            'src/unix/internal.h',
    -            'src/unix/loop.c',
    -            'src/unix/loop-watcher.c',
    -            'src/unix/pipe.c',
    -            'src/unix/poll.c',
    -            'src/unix/process.c',
    -            'src/unix/random-devurandom.c',
    -            'src/unix/signal.c',
    -            'src/unix/spinlock.h',
    -            'src/unix/stream.c',
    -            'src/unix/tcp.c',
    -            'src/unix/thread.c',
    -            'src/unix/tty.c',
    -            'src/unix/udp.c',
    +            '<@(uv_sources_posix)',
               ],
               'link_settings': {
                 'libraries': [ '-lm' ],
    @@ -228,10 +272,7 @@
             }],
             [ 'OS in "mac ios"', {
               'sources': [
    -            'src/unix/darwin.c',
    -            'src/unix/fsevents.c',
    -            'src/unix/darwin-proctitle.c',
    -            'src/unix/random-getentropy.c',
    +            '<@(uv_sources_apple)',
               ],
               'defines': [
                 '_DARWIN_USE_64_BIT_INODE=1',
    @@ -241,14 +282,7 @@
             [ 'OS=="linux"', {
               'defines': [ '_GNU_SOURCE' ],
               'sources': [
    -            'src/unix/epoll.c',
    -            'src/unix/linux-core.c',
    -            'src/unix/linux-inotify.c',
    -            'src/unix/linux-syscalls.c',
    -            'src/unix/linux-syscalls.h',
    -            'src/unix/procfs-exepath.c',
    -            'src/unix/random-getrandom.c',
    -            'src/unix/random-sysctl-linux.c',
    +            '<@(uv_sources_linux)',
               ],
               'link_settings': {
                 'libraries': [ '-ldl', '-lrt' ],
    @@ -259,15 +293,7 @@
                 '_GNU_SOURCE',
               ],
               'sources': [
    -            'src/unix/linux-core.c',
    -            'src/unix/linux-inotify.c',
    -            'src/unix/linux-syscalls.c',
    -            'src/unix/procfs-exepath.c',
    -            'src/unix/pthread-fixes.c',
    -            'src/unix/random-getentropy.c',
    -            'src/unix/random-getrandom.c',
    -            'src/unix/random-sysctl-linux.c',
    -            'src/unix/epoll.c',
    +            '<@(uv_sources_android)',
               ],
               'link_settings': {
                 'libraries': [ '-ldl' ],
    @@ -275,8 +301,7 @@
             }],
             [ 'OS=="solaris"', {
               'sources': [
    -            'src/unix/no-proctitle.c',
    -            'src/unix/sunos.c',
    +            '<@(uv_sources_solaris)',
               ],
               'defines': [
                 '__EXTENSIONS__',
    @@ -369,8 +394,7 @@
             }],
             [ 'OS in "ios mac freebsd dragonflybsd openbsd netbsd".split()', {
               'sources': [
    -            'src/unix/bsd-ifaddrs.c',
    -            'src/unix/kqueue.c',
    +            '<@(uv_sources_bsd_common)',
               ],
             }],
             ['uv_library=="shared_library"', {
    diff --git a/deps/uvwasi/uvwasi.gyp b/deps/uvwasi/uvwasi.gyp
    index 5822f8d59bd9e9..229dc9f41f8de8 100644
    --- a/deps/uvwasi/uvwasi.gyp
    +++ b/deps/uvwasi/uvwasi.gyp
    @@ -1,4 +1,16 @@
     {
    +  'variables': {
    +    'uvwasi_sources': [
    +      'src/clocks.c',
    +      'src/fd_table.c',
    +      'src/path_resolver.c',
    +      'src/poll_oneoff.c',
    +      'src/uv_mapping.c',
    +      'src/uvwasi.c',
    +      'src/wasi_rights.c',
    +      'src/wasi_serdes.c',
    +    ]
    +  },
       'targets': [
         {
           'target_name': 'uvwasi',
    @@ -9,14 +21,7 @@
           },
           'include_dirs': ['include'],
           'sources': [
    -        'src/clocks.c',
    -        'src/fd_table.c',
    -        'src/path_resolver.c',
    -        'src/poll_oneoff.c',
    -        'src/uv_mapping.c',
    -        'src/uvwasi.c',
    -        'src/wasi_rights.c',
    -        'src/wasi_serdes.c',
    +        '<@(uvwasi_sources)',
           ],
           'direct_dependent_settings': {
             'include_dirs': ['include']
    diff --git a/deps/v8/.git-blame-ignore-revs b/deps/v8/.git-blame-ignore-revs
    index 4c53e208e3acec..29372f34c1813d 100644
    --- a/deps/v8/.git-blame-ignore-revs
    +++ b/deps/v8/.git-blame-ignore-revs
    @@ -18,11 +18,106 @@
     # - Because you must use a hash, you need to append to this list in a follow-up
     #   CL to the actual reformatting CL that you are trying to ignore.
     
    +# objects.h splitting
    +0604031eb1d01c52b6c1c9ae3012d80b23d74a68
    +09e405453359000d66cc0faaa102854e626bebeb
    +766ef168fbcac6bd0728cc2c9bb3ae7cbd74278a
    +b5a2839b927be04bdb50a236071c11764e4d6400
    +c911f91b5b6219e038c0117b05a8375bdf3db0b0
    +1bb48bf91ba8c887884a0fbd674c91f64964d8a5
    +19da9f24df7b59fec72b9dd8a979ad0ce5639c87
    +b090d7e7468236ffce0afdb55bb496bf0073f2ee
    +f40638d148b7a435522d5b714993908061e3b10d
    +e8a1c25f6afae9b77921abb70fad49da252eb6f0
    +6fa8283d0e031c9585d190f751907ed45bf85de0
    +9aa861c4bcfed612039259f93c2cd2b01337e99e
    +8175648018bd9f70af866f9fa433f1d79644d86b
    +c7b1ceb801ec7f639a093468d8e6424212cc197c
    +e39d2cbe1b1baa6513ddce2d73c981e335cc34fb
    +eda00a5c499b7a83479115eb275a816b8a2ed104
    +68deca9b418976ca8b3375e81058a9e0a815357f
    +0525e17847f39f80e3fd163021a58f68d8fcaf06
    +81a3c699d6eef936452ac3d10c7c59a2c1e38c0c
    +01452bedfca2b5447a7f62bda87edbbb76259a6e
    +1baf1050113a5418696839c273e05ea5ad1b5c4d
    +4b39fe3d608916b1cfea015de287511a1623fc7f
    +c6effdbba9b301244475553538f6eb1b3d9670b9
    +71e4c573199466ea4541e3d6b307c9b33d7bb785
    +efc92f0d4aa77bb90f5b56606b6f0d0819fba4af
    +a9db2c74b5bae2345ac52be404748954a3b5050d
    +0a01b6202226bbe99c0b83acf6c5a80344f5fb6a
    +a6c44361c8f2dc07b935e3f2bb3e0d3ad4f4a383
    +10d8aab1de430695a69e9d75af6ea42c2cdc9d6d
    +dd3c4fca2f0a2761b8b95cd47fcd62836d714890
    +e9c932233980866074025e65051003d1f298516c
    +2b1f79881c3f0b69bfb9274bda57ea50f7304982
    +7f031160d71a3d836667dc98288eaff4c94e6f56
    +490fabb4578f8a3c4096fdccff688c17ed5ed00d
    +d953b2ab726acca0b3abe90ce090a16d7ccc2ae3
    +bb514c426b9438cfb1149d219ac4ec2d8d1c8458
    +dfb453d713d8a05e76f720a6aae2871eec210276
    +b490fd66b873c89fca37b21eab58502b6367a864
    +9a71683d9c8ff9470eda6be5b2b11babac7b9863
    +37945f731c4d800ef788e3c32f8663773a93450e
    +b90c98fc29a8d896354de4a22c055f6d98376171
    +35f3e9d0e654e84646a0b98f29e4a2786cdca4b1
    +260eb5bb9b62ea3d5fa6ad0b0e8c2de75d48bad4
    +cc2c11441ce352360acce8638a19f58edf361f7d
    +7be0159e4b1e0b064e215ae4ced34d649cb2552e
    +95a7cfe0eaabbcff0f730ed60e1805779f6cfe41
    +8f54d18ba4ad10770e9537a2803459feccfe79a3
    +f44759d9ff52a3e5563e5f2bb23ee2c08222fcfd
    +09050c8a967f5f2956305e5d016b304d7bf5e669
    +c769745d5856a7eb3a0dbe6af5376c7638944364
    +a1547aa914aeedd7862f74124c18d2bbaf432c36
    +5f950698c0dc7c36b855961feb929022f74102fb
    +4aedeb1bd50c12ebcd6cf954c4cbef1205fff5ac
    +7366d8954cb1bd277d3283241da2fae62b886c48
    +bc35251f5e55a65c3a4acf7cba52cee505c86a46
    +4fb60b215801db70c694a799e735b64bfead59bb
    +03762b8488de0e393077e3f40fe7b63e675b3af3
    +a8a45d875f0a98b192cf0063ceda12aaf75ddfaf
    +a48e5ab8804e9e97b5ea577d6f2667bacee92eb2
    +
     # Update of quotations in DEPS file.
     e50b49a0e38b34e2b28e026f4d1c7e0da0c7bb1a
     
     # Rewrite code base to use "." instead of "->" to access Object members.
     878ccb33bd3cf0e6dc018ff8d15843f585ac07be
     
    +# Splitting src/ into subfolders
    +632239011db501e76475d82ff6492f37fa8c1edc
    +f455f86d899716df3b9550950ce172f5b867619a
    +24a51e1eee4e286165dd0bba6afb4c35e8177a25
    +f9a88acbc928f0fc5e9a3acbcd3b4ece52355f3d
    +dec3298d9cfbe95759774a0e00302a08836b5f3d
    +a0c3797461810e3159662851e64946e17654236e
    +b72941e8b0d2843adf768442024d8950da798db1
    +4c986c625f19e35c95f3492c662822f4695218b4
    +0fa243af7096ee5b748b194476be2e4efecaec59
    +786ce26341b7ab11b4d42f1c77202530d5138ad2
    +a6eeea35cb7ff0c29b6cfdd1c786f382110241ce
    +be014256adea1552d4a044ef80616cdab6a7d549
    +93d3b7173fec7d010539057cdbd78d497f09fa9b
    +5bfe84a0dab60289b3470c080908ce83ac2212d4
    +a7695520556665ba73ab02c497ab73b162a5fb13
    +61523c45a335fe3be76498e0b16bf8e7aec0d058
    +bf372a73d8a5f4029fc9f4f69b675ef0cad80ada
    +8ad6b335376c6275ffb3361c662a1a45c853f4fc
    +06bf8261cf2c94fc071652652600b5790f719c05
    +81a0102fe8586071cc68e9595b26c5c1207ee5b3
    +5f28539599f6a6a265e18b8c897cc96ccbeec9c4
    +3253767622a784866dc34aeb7b5d0f02ebdff61e
    +9ac8b20086f95f1158a1901eefe12e25fd0333e4
    +3cb560adfe26edb586a0e6e655e5a7c4755cad1a
    +7bbd0bfe5161d57bcf268716ce4d1ce14d6786e6
    +c39cabbcbea26891558b81fd2236c38a7aeada08
    +a3187716d31a0ab9d7051adde6be9bd2b2c6fec1
    +
     # Move test/mjsunit/regress-*.js => test/mjsunit/regress/
     cb67be1a3842fcf6a0da18aee444e3b7ea789e04
    +
    +# [include] Split out v8.h
    +d1b27019d3bf86360ea838c317f8505fac6d3a7e
    +44fe02ced6e4c6b49d627807e3b3fd0edbbeb36e
    +ec06bb6ce5641cf65e400ec55b7421f87d04b999
    diff --git a/deps/v8/.gitignore b/deps/v8/.gitignore
    index f1bd2f33fe771a..ed10b522706058 100644
    --- a/deps/v8/.gitignore
    +++ b/deps/v8/.gitignore
    @@ -28,6 +28,7 @@
     .clangd
     .cpplint-cache
     .cproject
    +.DS_Store
     .gclient_entries
     .gdb_history
     .idea
    @@ -67,6 +68,7 @@
     /third_party/jsoncpp/source
     !/third_party/colorama
     /third_party/colorama/src
    +!/third_party/glibc
     !/third_party/googletest
     /third_party/googletest/src/*
     !/third_party/googletest/src/googletest
    @@ -79,6 +81,7 @@
     !/third_party/test262-harness
     !/third_party/v8
     !/third_party/wasm-api
    +/tools/builtins-pgo/profiles/*.profile
     /tools/clang
     /tools/gcmole/bootstrap
     /tools/gcmole/gcmole-tools
    diff --git a/deps/v8/.style.yapf b/deps/v8/.style.yapf
    index de0c6a70f38b94..fdd07237cbe373 100644
    --- a/deps/v8/.style.yapf
    +++ b/deps/v8/.style.yapf
    @@ -1,2 +1,2 @@
     [style]
    -based_on_style = chromium
    +based_on_style = yapf
    diff --git a/deps/v8/AUTHORS b/deps/v8/AUTHORS
    index 9696fc61d54d8f..d84c722b8dcb7b 100644
    --- a/deps/v8/AUTHORS
    +++ b/deps/v8/AUTHORS
    @@ -44,6 +44,7 @@ CodeWeavers, Inc. <*@codeweavers.com>
     Alibaba, Inc. <*@alibaba-inc.com>
     SiFive, Inc. <*@sifive.com>
     
    +Aapo Alasuutari 
     Aaron Bieber 
     Aaron O'Mullan 
     Abdulla Kamar 
    @@ -81,6 +82,7 @@ Burcu Dogan 
     Caitlin Potter 
     Chao Wang 
     Charles Kerr 
    +Cheng Zhao 
     Chengzhong Wu 
     Choongwoo Han 
     Chris Nardi 
    @@ -98,6 +100,7 @@ Darshan Sen 
     David Carlier 
     David Manouchehri 
     David Sanders 
    +Debadree Chatterjee 
     Deepak Mohan 
     Deon Dior 
     Derek Tu 
    @@ -152,6 +155,8 @@ Jiawen Geng 
     Jiaxun Yang 
     Joel Stanley 
     Johan Bergström 
    +Johan Levin 
    +John Paul Adrian Glaubitz 
     Jonathan Liu 
     Juan Arboleda 
     Julien Brianceau 
    @@ -255,6 +260,7 @@ Ujjwal Sharma 
     Vadim Gorbachev 
     Varun Varada 
     Victor Costan 
    +Victor Polevoy 
     Vlad Burlik 
     Vladimir Krivosheev 
     Vladimir Shutoff 
    @@ -285,3 +291,5 @@ Zheng Liu 
     Zhongping Wang 
     柳荣一 
     Yang Xiang 
    +Kotaro Ohsugi 
    +Jing Peiyang 
    diff --git a/deps/v8/BUILD.bazel b/deps/v8/BUILD.bazel
    index 3be7da8f3bb11f..81a9286d2670de 100644
    --- a/deps/v8/BUILD.bazel
    +++ b/deps/v8/BUILD.bazel
    @@ -16,7 +16,8 @@ load(
         "v8_library",
         "v8_mksnapshot",
         "v8_string",
    -    "v8_torque",
    +    "v8_torque_definitions",
    +    "v8_torque_initializers",
     )
     load(":bazel/v8-non-pointer-compression.bzl", "v8_binary_non_pointer_compression")
     
    @@ -42,6 +43,7 @@ load(":bazel/v8-non-pointer-compression.bzl", "v8_binary_non_pointer_compression
     # v8_enable_conservative_stack_scanning
     # v8_enable_concurrent_marking
     # v8_enable_ignition_dispatch_counting
    +# v8_enable_builtins_optimization
     # v8_enable_builtins_profiling
     # v8_enable_builtins_profiling_verbose
     # v8_builtins_profiling_log_file
    @@ -68,6 +70,7 @@ load(":bazel/v8-non-pointer-compression.bzl", "v8_binary_non_pointer_compression
     # v8_enable_sandbox
     # cppgc_enable_caged_heap
     # cppgc_enable_check_assignments_in_prefinalizers
    +# cppgc_enable_slim_write_barrier
     # cppgc_enable_object_names
     # cppgc_enable_pointer_compression
     # cppgc_enable_verify_heap
    @@ -132,6 +135,8 @@ v8_flag(name = "v8_enable_snapshot_code_comments")
     
     v8_flag(name = "v8_enable_snapshot_native_code_counters")
     
    +v8_flag(name = "v8_enable_static_roots")
    +
     v8_flag(name = "v8_enable_trace_maps")
     
     v8_flag(name = "v8_enable_v8_checks")
    @@ -144,11 +149,21 @@ v8_flag(name = "v8_enable_verify_predictable")
     
     v8_flag(name = "v8_enable_test_features")
     
    +v8_flag(
    +    name = "v8_enable_turbofan",
    +    default = True,
    +)
    +
     v8_flag(
         name = "v8_enable_webassembly",
         default = True,
     )
     
    +v8_flag(
    +    name = "v8_jitless",
    +    default = False,
    +)
    +
     v8_int(
         name = "v8_typed_array_max_size_in_heap",
         default = 64,
    @@ -316,16 +331,18 @@ v8_config(
             "v8_enable_slow_dchecks": "ENABLE_SLOW_DCHECKS",
             "v8_enable_runtime_call_stats": "V8_RUNTIME_CALL_STATS",
             "v8_enable_snapshot_native_code_counters": "V8_SNAPSHOT_NATIVE_CODE_COUNTERS",
    +        "v8_enable_static_roots": "V8_STATIC_ROOTS",
             "v8_enable_trace_maps": "V8_TRACE_MAPS",
    +        "v8_enable_turbofan": "V8_ENABLE_TURBOFAN",
             "v8_enable_v8_checks": "V8_ENABLE_CHECKS",
             "v8_enable_verify_csa": "ENABLE_VERIFY_CSA",
             "v8_enable_verify_heap": "VERIFY_HEAP",
             "v8_enable_verify_predictable": "VERIFY_PREDICTABLE",
             "v8_enable_webassembly": "V8_ENABLE_WEBASSEMBLY",
    +        "v8_jitless": "V8_JITLESS",
         },
         defines = [
             "GOOGLE3",
    -        "ENABLE_DEBUGGER_SUPPORT",
             "V8_ADVANCED_BIGINT_ALGORITHMS",
             "V8_CONCURRENT_MARKING",
         ] + select({
    @@ -595,6 +612,7 @@ filegroup(
             "src/base/build_config.h",
             "src/base/compiler-specific.h",
             "src/base/container-utils.h",
    +        "src/base/contextual.h",
             "src/base/cpu.cc",
             "src/base/cpu.h",
             "src/base/debug/stack_trace.cc",
    @@ -653,6 +671,7 @@ filegroup(
             "src/base/platform/mutex.cc",
             "src/base/platform/mutex.h",
             "src/base/platform/platform.h",
    +        "src/base/platform/platform.cc",
             "src/base/platform/semaphore.cc",
             "src/base/platform/semaphore.h",
             "src/base/platform/time.cc",
    @@ -706,7 +725,6 @@ filegroup(
             "@v8//bazel/config:is_macos": [
                 "src/base/debug/stack_trace_posix.cc",
                 "src/base/platform/platform-darwin.cc",
    -            "src/base/platform/platform-macos.cc",
             ],
             "@v8//bazel/config:is_windows": [
                 "src/base/win32-headers.h",
    @@ -816,6 +834,8 @@ filegroup(
             "src/builtins/internal-coverage.tq",
             "src/builtins/internal.tq",
             "src/builtins/iterator.tq",
    +        "src/builtins/iterator-from.tq",
    +        "src/builtins/iterator-helpers.tq",
             "src/builtins/math.tq",
             "src/builtins/number.tq",
             "src/builtins/object-fromentries.tq",
    @@ -859,6 +879,7 @@ filegroup(
             "src/builtins/string-html.tq",
             "src/builtins/string-includes.tq",
             "src/builtins/string-indexof.tq",
    +        "src/builtins/string-iswellformed.tq",
             "src/builtins/string-iterator.tq",
             "src/builtins/string-match-search.tq",
             "src/builtins/string-pad.tq",
    @@ -868,6 +889,7 @@ filegroup(
             "src/builtins/string-startswith.tq",
             "src/builtins/string-substr.tq",
             "src/builtins/string-substring.tq",
    +        "src/builtins/string-towellformed.tq",
             "src/builtins/string-trim.tq",
             "src/builtins/symbol.tq",
             "src/builtins/torque-internal.tq",
    @@ -924,6 +946,7 @@ filegroup(
             "src/objects/js-collection.tq",
             "src/objects/js-function.tq",
             "src/objects/js-generator.tq",
    +        "src/objects/js-iterator-helpers.tq",
             "src/objects/js-objects.tq",
             "src/objects/js-promise.tq",
             "src/objects/js-proxy.tq",
    @@ -963,6 +986,7 @@ filegroup(
             "src/objects/templates.tq",
             "src/objects/torque-defined-classes.tq",
             "src/objects/turbofan-types.tq",
    +        "src/objects/turboshaft-types.tq",
             "test/torque/test-torque.tq",
             "third_party/v8/builtins/array-sort.tq",
         ] + select({
    @@ -1008,7 +1032,6 @@ filegroup(
             "src/torque/cfg.h",
             "src/torque/class-debug-reader-generator.cc",
             "src/torque/constants.h",
    -        "src/torque/contextual.h",
             "src/torque/cpp-builder.cc",
             "src/torque/cpp-builder.h",
             "src/torque/csa-generator.cc",
    @@ -1152,7 +1175,6 @@ filegroup(
             "src/builtins/builtins-utils-inl.h",
             "src/builtins/builtins-utils.h",
             "src/builtins/builtins-weak-refs.cc",
    -        "src/builtins/builtins-web-snapshots.cc",
             "src/builtins/builtins.cc",
             "src/builtins/builtins.h",
             "src/builtins/constants-table-builder.cc",
    @@ -1231,8 +1253,8 @@ filegroup(
             "src/codegen/tick-counter.h",
             "src/codegen/tnode.cc",
             "src/codegen/tnode.h",
    -        "src/codegen/turbo-assembler.cc",
    -        "src/codegen/turbo-assembler.h",
    +        "src/codegen/macro-assembler-base.cc",
    +        "src/codegen/macro-assembler-base.h",
             "src/codegen/unoptimized-compilation-info.cc",
             "src/codegen/unoptimized-compilation-info.h",
             "src/common/assert-scope.cc",
    @@ -1245,11 +1267,13 @@ filegroup(
             "src/common/message-template.h",
             "src/common/operation.h",
             "src/common/ptr-compr-inl.h",
    +        "src/common/ptr-compr.cc",
             "src/common/ptr-compr.h",
             "src/compiler-dispatcher/lazy-compile-dispatcher.cc",
             "src/compiler-dispatcher/lazy-compile-dispatcher.h",
             "src/compiler-dispatcher/optimizing-compile-dispatcher.cc",
             "src/compiler-dispatcher/optimizing-compile-dispatcher.h",
    +        "src/compiler/turbofan.h",
             "src/date/date.cc",
             "src/date/date.h",
             "src/date/dateparser-inl.h",
    @@ -1429,6 +1453,8 @@ filegroup(
             "src/heap/cppgc-js/cpp-marking-state-inl.h",
             "src/heap/cppgc-js/cpp-snapshot.cc",
             "src/heap/cppgc-js/cpp-snapshot.h",
    +        "src/heap/cppgc-js/cross-heap-remembered-set.cc",
    +        "src/heap/cppgc-js/cross-heap-remembered-set.h",
             "src/heap/cppgc-js/unified-heap-marking-state.cc",
             "src/heap/cppgc-js/unified-heap-marking-state.h",
             "src/heap/cppgc-js/unified-heap-marking-state-inl.h",
    @@ -1436,9 +1462,8 @@ filegroup(
             "src/heap/cppgc-js/unified-heap-marking-verifier.h",
             "src/heap/cppgc-js/unified-heap-marking-visitor.cc",
             "src/heap/cppgc-js/unified-heap-marking-visitor.h",
    -        "src/heap/embedder-tracing.cc",
    -        "src/heap/embedder-tracing.h",
    -        "src/heap/embedder-tracing-inl.h",
    +        "src/heap/cppgc-js/wrappable-info.h",
    +        "src/heap/cppgc-js/wrappable-info-inl.h",
             "src/heap/evacuation-verifier.cc",
             "src/heap/evacuation-verifier.h",
             "src/heap/evacuation-verifier-inl.h",
    @@ -1459,8 +1484,6 @@ filegroup(
             "src/heap/gc-tracer.cc",
             "src/heap/gc-tracer-inl.h",
             "src/heap/gc-tracer.h",
    -        "src/heap/global-handle-marking-visitor.cc",
    -        "src/heap/global-handle-marking-visitor.h",
             "src/heap/heap-allocator-inl.h",
             "src/heap/heap-allocator.cc",
             "src/heap/heap-allocator.h",
    @@ -1528,6 +1551,7 @@ filegroup(
             "src/heap/new-spaces-inl.h",
             "src/heap/new-spaces.cc",
             "src/heap/new-spaces.h",
    +        "src/heap/object-lock.h",
             "src/heap/object-stats.cc",
             "src/heap/object-stats.h",
             "src/heap/objects-visiting-inl.h",
    @@ -1551,8 +1575,8 @@ filegroup(
             "src/heap/remembered-set.h",
             "src/heap/safepoint.cc",
             "src/heap/safepoint.h",
    -        "src/heap/scavenge-job.cc",
    -        "src/heap/scavenge-job.h",
    +        "src/heap/minor-gc-job.cc",
    +        "src/heap/minor-gc-job.h",
             "src/heap/scavenger-inl.h",
             "src/heap/scavenger.cc",
             "src/heap/scavenger.h",
    @@ -1561,12 +1585,12 @@ filegroup(
             "src/heap/spaces-inl.h",
             "src/heap/spaces.cc",
             "src/heap/spaces.h",
    -        "src/heap/stress-marking-observer.cc",
    -        "src/heap/stress-marking-observer.h",
             "src/heap/stress-scavenge-observer.cc",
             "src/heap/stress-scavenge-observer.h",
             "src/heap/sweeper.cc",
             "src/heap/sweeper.h",
    +        "src/heap/traced-handles-marking-visitor.cc",
    +        "src/heap/traced-handles-marking-visitor.h",
             "src/heap/weak-object-worklists.cc",
             "src/heap/weak-object-worklists.h",
             "src/ic/call-optimization.cc",
    @@ -1662,6 +1686,8 @@ filegroup(
             "src/numbers/conversions.cc",
             "src/numbers/conversions.h",
             "src/numbers/hash-seed-inl.h",
    +        "src/numbers/integer-literal-inl.h",
    +        "src/numbers/integer-literal.h",
             "src/numbers/math-random.cc",
             "src/numbers/math-random.h",
             "src/objects/all-objects-inl.h",
    @@ -1758,6 +1784,8 @@ filegroup(
             "src/objects/js-function.h",
             "src/objects/js-generator-inl.h",
             "src/objects/js-generator.h",
    +        "src/objects/js-iterator-helpers-inl.h",
    +        "src/objects/js-iterator-helpers.h",
             "src/objects/js-objects-inl.h",
             "src/objects/js-objects.cc",
             "src/objects/js-objects.h",
    @@ -1777,6 +1805,7 @@ filegroup(
             "src/objects/js-shadow-realm-inl.h",
             "src/objects/js-shared-array.h",
             "src/objects/js-shared-array-inl.h",
    +        "src/objects/js-struct.cc",
             "src/objects/js-struct.h",
             "src/objects/js-struct-inl.h",
             "src/objects/js-temporal-objects.h",
    @@ -1915,6 +1944,8 @@ filegroup(
             "src/objects/transitions.h",
             "src/objects/turbofan-types-inl.h",
             "src/objects/turbofan-types.h",
    +        "src/objects/turboshaft-types-inl.h",
    +        "src/objects/turboshaft-types.h",
             "src/objects/type-hints.cc",
             "src/objects/type-hints.h",
             "src/objects/value-serializer.cc",
    @@ -2031,6 +2062,7 @@ filegroup(
             "src/roots/roots-inl.h",
             "src/roots/roots.cc",
             "src/roots/roots.h",
    +        "src/roots/static-roots.h",
             "src/runtime/runtime-array.cc",
             "src/runtime/runtime-atomics.cc",
             "src/runtime/runtime-bigint.cc",
    @@ -2190,8 +2222,6 @@ filegroup(
             "src/utils/utils.h",
             "src/utils/version.cc",
             "src/utils/version.h",
    -        "src/web-snapshot/web-snapshot.h",
    -        "src/web-snapshot/web-snapshot.cc",
             "src/zone/accounting-allocator.cc",
             "src/zone/accounting-allocator.h",
             "src/zone/compressed-zone-ptr.h",
    @@ -2233,10 +2263,6 @@ filegroup(
                 "src/codegen/ia32/macro-assembler-ia32.h",
                 "src/codegen/ia32/register-ia32.h",
                 "src/codegen/ia32/reglist-ia32.h",
    -            "src/compiler/backend/ia32/code-generator-ia32.cc",
    -            "src/compiler/backend/ia32/instruction-codes-ia32.h",
    -            "src/compiler/backend/ia32/instruction-scheduler-ia32.cc",
    -            "src/compiler/backend/ia32/instruction-selector-ia32.cc",
                 "src/deoptimizer/ia32/deoptimizer-ia32.cc",
                 "src/diagnostics/ia32/disasm-ia32.cc",
                 "src/diagnostics/ia32/unwinder-ia32.cc",
    @@ -2263,12 +2289,6 @@ filegroup(
                 "src/codegen/x64/macro-assembler-x64.h",
                 "src/codegen/x64/register-x64.h",
                 "src/codegen/x64/reglist-x64.h",
    -            "src/compiler/backend/x64/code-generator-x64.cc",
    -            "src/compiler/backend/x64/instruction-codes-x64.h",
    -            "src/compiler/backend/x64/instruction-scheduler-x64.cc",
    -            "src/compiler/backend/x64/instruction-selector-x64.cc",
    -            "src/compiler/backend/x64/unwinding-info-writer-x64.cc",
    -            "src/compiler/backend/x64/unwinding-info-writer-x64.h",
                 "src/deoptimizer/x64/deoptimizer-x64.cc",
                 "src/diagnostics/x64/disasm-x64.cc",
                 "src/diagnostics/x64/eh-frame-x64.cc",
    @@ -2293,12 +2313,6 @@ filegroup(
                 "src/codegen/arm/macro-assembler-arm.h",
                 "src/codegen/arm/register-arm.h",
                 "src/codegen/arm/reglist-arm.h",
    -            "src/compiler/backend/arm/code-generator-arm.cc",
    -            "src/compiler/backend/arm/instruction-codes-arm.h",
    -            "src/compiler/backend/arm/instruction-scheduler-arm.cc",
    -            "src/compiler/backend/arm/instruction-selector-arm.cc",
    -            "src/compiler/backend/arm/unwinding-info-writer-arm.cc",
    -            "src/compiler/backend/arm/unwinding-info-writer-arm.h",
                 "src/deoptimizer/arm/deoptimizer-arm.cc",
                 "src/diagnostics/arm/disasm-arm.cc",
                 "src/diagnostics/arm/eh-frame-arm.cc",
    @@ -2334,12 +2348,6 @@ filegroup(
                 "src/codegen/arm64/reglist-arm64.h",
                 "src/codegen/arm64/utils-arm64.cc",
                 "src/codegen/arm64/utils-arm64.h",
    -            "src/compiler/backend/arm64/code-generator-arm64.cc",
    -            "src/compiler/backend/arm64/instruction-codes-arm64.h",
    -            "src/compiler/backend/arm64/instruction-scheduler-arm64.cc",
    -            "src/compiler/backend/arm64/instruction-selector-arm64.cc",
    -            "src/compiler/backend/arm64/unwinding-info-writer-arm64.cc",
    -            "src/compiler/backend/arm64/unwinding-info-writer-arm64.h",
                 "src/deoptimizer/arm64/deoptimizer-arm64.cc",
                 "src/diagnostics/arm64/disasm-arm64.cc",
                 "src/diagnostics/arm64/disasm-arm64.h",
    @@ -2369,12 +2377,6 @@ filegroup(
                 "src/codegen/s390/macro-assembler-s390.h",
                 "src/codegen/s390/register-s390.h",
                 "src/codegen/s390/reglist-s390.h",
    -            "src/compiler/backend/s390/code-generator-s390.cc",
    -            "src/compiler/backend/s390/instruction-codes-s390.h",
    -            "src/compiler/backend/s390/instruction-scheduler-s390.cc",
    -            "src/compiler/backend/s390/instruction-selector-s390.cc",
    -            "src/compiler/backend/s390/unwinding-info-writer-s390.cc",
    -            "src/compiler/backend/s390/unwinding-info-writer-s390.h",
                 "src/deoptimizer/s390/deoptimizer-s390.cc",
                 "src/diagnostics/s390/disasm-s390.cc",
                 "src/diagnostics/s390/eh-frame-s390.cc",
    @@ -2401,10 +2403,6 @@ filegroup(
                 "src/codegen/riscv64/macro-assembler-riscv64.h",
                 "src/codegen/riscv64/register-riscv64.h",
                 "src/codegen/riscv64/reglist-riscv64.h",
    -            "src/compiler/backend/riscv64/code-generator-riscv64.cc",
    -            "src/compiler/backend/riscv64/instruction-codes-riscv64.h",
    -            "src/compiler/backend/riscv64/instruction-scheduler-riscv64.cc",
    -            "src/compiler/backend/riscv64/instruction-selector-riscv64.cc",
                 "src/deoptimizer/riscv64/deoptimizer-riscv64.cc",
                 "src/diagnostics/riscv64/disasm-riscv64.cc",
                 "src/diagnostics/riscv64/unwinder-riscv64.cc",
    @@ -2430,12 +2428,6 @@ filegroup(
                 "src/codegen/ppc/macro-assembler-ppc.h",
                 "src/codegen/ppc/register-ppc.h",
                 "src/codegen/ppc/reglist-ppc.h",
    -            "src/compiler/backend/ppc/code-generator-ppc.cc",
    -            "src/compiler/backend/ppc/instruction-codes-ppc.h",
    -            "src/compiler/backend/ppc/instruction-scheduler-ppc.cc",
    -            "src/compiler/backend/ppc/instruction-selector-ppc.cc",
    -            "src/compiler/backend/ppc/unwinding-info-writer-ppc.cc",
    -            "src/compiler/backend/ppc/unwinding-info-writer-ppc.h",
                 "src/deoptimizer/ppc/deoptimizer-ppc.cc",
                 "src/diagnostics/ppc/disasm-ppc.cc",
                 "src/diagnostics/ppc/eh-frame-ppc.cc",
    @@ -2598,6 +2590,8 @@ filegroup(
                 "src/wasm/wasm-subtyping.h",
                 "src/wasm/wasm-tier.h",
                 "src/wasm/wasm-value.h",
    +            "src/wasm/well-known-imports.cc",
    +            "src/wasm/well-known-imports.h",
             ],
             "//conditions:default": [],
         }),
    @@ -2607,7 +2601,6 @@ filegroup(
         name = "icu/v8_base_without_compiler_files",
         srcs = [
             "src/builtins/builtins-intl.cc",
    -        "src/builtins/builtins-intl-gen.cc",
             "src/objects/intl-objects.cc",
             "src/objects/intl-objects.h",
             "src/objects/js-break-iterator.cc",
    @@ -2849,6 +2842,7 @@ filegroup(
             "src/compiler/osr.h",
             "src/compiler/per-isolate-compiler-cache.h",
             "src/compiler/persistent-map.h",
    +        "src/compiler/phase.h",
             "src/compiler/pipeline.cc",
             "src/compiler/pipeline.h",
             "src/compiler/pipeline-statistics.cc",
    @@ -2881,36 +2875,91 @@ filegroup(
             "src/compiler/state-values-utils.cc",
             "src/compiler/state-values-utils.h",
             "src/compiler/store-store-elimination.cc",
    +        "src/compiler/string-builder-optimizer.cc",
    +        "src/compiler/string-builder-optimizer.h",
             "src/compiler/store-store-elimination.h",
    +        "src/compiler/turbofan-enabled.cc",
    +        "src/compiler/turbofan.h",
    +        "src/compiler/turboshaft/assembler.cc",
             "src/compiler/turboshaft/assembler.h",
    +        "src/compiler/turboshaft/assert-types-reducer.h",
    +        "src/compiler/turboshaft/branch-elimination-reducer.h",
    +        "src/compiler/turboshaft/build-graph-phase.cc",
    +        "src/compiler/turboshaft/build-graph-phase.h",
    +        "src/compiler/turboshaft/builtin-call-descriptors.h",
    +        "src/compiler/turboshaft/dead-code-elimination-phase.cc",
    +        "src/compiler/turboshaft/dead-code-elimination-phase.h",
    +        "src/compiler/turboshaft/dead-code-elimination-reducer.h",
             "src/compiler/turboshaft/decompression-optimization.cc",
             "src/compiler/turboshaft/decompression-optimization.h",
    +        "src/compiler/turboshaft/decompression-optimization-phase.cc",
    +        "src/compiler/turboshaft/decompression-optimization-phase.h",
    +        "src/compiler/turboshaft/define-assembler-macros.inc",
             "src/compiler/turboshaft/deopt-data.h",
             "src/compiler/turboshaft/fast-hash.h",
             "src/compiler/turboshaft/graph-builder.cc",
             "src/compiler/turboshaft/graph-builder.h",
             "src/compiler/turboshaft/graph.cc",
             "src/compiler/turboshaft/graph.h",
    +        "src/compiler/turboshaft/index.h",
             "src/compiler/turboshaft/graph-visualizer.cc",
             "src/compiler/turboshaft/graph-visualizer.h",
    +        "src/compiler/turboshaft/late-escape-analysis-reducer.h",
    +        "src/compiler/turboshaft/late-escape-analysis-reducer.cc",
    +        "src/compiler/turboshaft/late-optimization-phase.cc",
    +        "src/compiler/turboshaft/late-optimization-phase.h",
    +        "src/compiler/turboshaft/layered-hash-map.h",
    +        "src/compiler/turboshaft/machine-lowering-phase.cc",
    +        "src/compiler/turboshaft/machine-lowering-phase.h",
    +        "src/compiler/turboshaft/machine-lowering-reducer.h",
             "src/compiler/turboshaft/machine-optimization-reducer.h",
    +        "src/compiler/turboshaft/memory-optimization-reducer.cc",
    +        "src/compiler/turboshaft/memory-optimization-reducer.h",
             "src/compiler/turboshaft/operations.cc",
             "src/compiler/turboshaft/operations.h",
             "src/compiler/turboshaft/operation-matching.h",
             "src/compiler/turboshaft/optimization-phase.cc",
             "src/compiler/turboshaft/optimization-phase.h",
    +        "src/compiler/turboshaft/optimize-phase.cc",
    +        "src/compiler/turboshaft/optimize-phase.h",
    +        "src/compiler/turboshaft/phase.cc",
    +        "src/compiler/turboshaft/phase.h",
             "src/compiler/turboshaft/recreate-schedule.cc",
             "src/compiler/turboshaft/recreate-schedule.h",
    +        "src/compiler/turboshaft/recreate-schedule-phase.cc",
    +        "src/compiler/turboshaft/recreate-schedule-phase.h",
    +        "src/compiler/turboshaft/reducer-traits.h",
             "src/compiler/turboshaft/representations.cc",
             "src/compiler/turboshaft/representations.h",
    +        "src/compiler/turboshaft/runtime-call-descriptors.h",
             "src/compiler/turboshaft/select-lowering-reducer.h",
             "src/compiler/turboshaft/sidetable.h",
             "src/compiler/turboshaft/simplify-tf-loops.cc",
             "src/compiler/turboshaft/simplify-tf-loops.h",
             "src/compiler/turboshaft/snapshot-table.h",
    +        "src/compiler/turboshaft/tag-untag-lowering-phase.cc",
    +        "src/compiler/turboshaft/tag-untag-lowering-phase.h",
    +        "src/compiler/turboshaft/tag-untag-lowering-reducer.h",
    +        "src/compiler/turboshaft/tracing.h",
    +        "src/compiler/turboshaft/type-inference-analysis.h",
    +        "src/compiler/turboshaft/type-inference-reducer.h",
    +        "src/compiler/turboshaft/typer.cc",
    +        "src/compiler/turboshaft/typer.h",
    +        "src/compiler/turboshaft/type-assertions-phase.cc",
    +        "src/compiler/turboshaft/type-assertions-phase.h",
    +        "src/compiler/turboshaft/type-parser.cc",
    +        "src/compiler/turboshaft/type-parser.h",
    +        "src/compiler/turboshaft/typed-optimizations-phase.cc",
    +        "src/compiler/turboshaft/typed-optimizations-phase.h",
    +        "src/compiler/turboshaft/typed-optimizations-reducer.h",
    +        "src/compiler/turboshaft/types.cc",
    +        "src/compiler/turboshaft/types.h",
    +        "src/compiler/turboshaft/undef-assembler-macros.inc",
    +        "src/compiler/turboshaft/uniform-reducer-adapter.h",
             "src/compiler/turboshaft/utils.cc",
             "src/compiler/turboshaft/utils.h",
             "src/compiler/turboshaft/value-numbering-reducer.h",
    +        "src/compiler/turboshaft/variable-reducer.h",
             "src/compiler/type-cache.cc",
             "src/compiler/type-cache.h",
             "src/compiler/type-narrowing-reducer.cc",
    @@ -2930,14 +2979,71 @@ filegroup(
             "src/compiler/zone-stats.cc",
             "src/compiler/zone-stats.h",
         ] + select({
    +        "@v8//bazel/config:v8_target_ia32": [
    +            "src/compiler/backend/ia32/code-generator-ia32.cc",
    +            "src/compiler/backend/ia32/instruction-codes-ia32.h",
    +            "src/compiler/backend/ia32/instruction-scheduler-ia32.cc",
    +            "src/compiler/backend/ia32/instruction-selector-ia32.cc",
    +        ],
    +        "@v8//bazel/config:v8_target_x64": [
    +            "src/compiler/backend/x64/code-generator-x64.cc",
    +            "src/compiler/backend/x64/instruction-codes-x64.h",
    +            "src/compiler/backend/x64/instruction-scheduler-x64.cc",
    +            "src/compiler/backend/x64/instruction-selector-x64.cc",
    +            "src/compiler/backend/x64/unwinding-info-writer-x64.cc",
    +            "src/compiler/backend/x64/unwinding-info-writer-x64.h",
    +        ],
    +        "@v8//bazel/config:v8_target_arm": [
    +            "src/compiler/backend/arm/code-generator-arm.cc",
    +            "src/compiler/backend/arm/instruction-codes-arm.h",
    +            "src/compiler/backend/arm/instruction-scheduler-arm.cc",
    +            "src/compiler/backend/arm/instruction-selector-arm.cc",
    +            "src/compiler/backend/arm/unwinding-info-writer-arm.cc",
    +            "src/compiler/backend/arm/unwinding-info-writer-arm.h",
    +        ],
    +        "@v8//bazel/config:v8_target_arm64": [
    +            "src/compiler/backend/arm64/code-generator-arm64.cc",
    +            "src/compiler/backend/arm64/instruction-codes-arm64.h",
    +            "src/compiler/backend/arm64/instruction-scheduler-arm64.cc",
    +            "src/compiler/backend/arm64/instruction-selector-arm64.cc",
    +            "src/compiler/backend/arm64/unwinding-info-writer-arm64.cc",
    +            "src/compiler/backend/arm64/unwinding-info-writer-arm64.h",
    +        ],
    +        "@v8//bazel/config:v8_target_s390x": [
    +            "src/compiler/backend/s390/code-generator-s390.cc",
    +            "src/compiler/backend/s390/instruction-codes-s390.h",
    +            "src/compiler/backend/s390/instruction-scheduler-s390.cc",
    +            "src/compiler/backend/s390/instruction-selector-s390.cc",
    +            "src/compiler/backend/s390/unwinding-info-writer-s390.cc",
    +            "src/compiler/backend/s390/unwinding-info-writer-s390.h",
    +        ],
    +        "@v8//bazel/config:v8_target_riscv64": [
    +            "src/compiler/backend/riscv64/code-generator-riscv64.cc",
    +            "src/compiler/backend/riscv64/instruction-codes-riscv64.h",
    +            "src/compiler/backend/riscv64/instruction-scheduler-riscv64.cc",
    +            "src/compiler/backend/riscv64/instruction-selector-riscv64.cc",
    +        ],
    +        "@v8//bazel/config:v8_target_ppc64le": [
    +            "src/compiler/backend/ppc/code-generator-ppc.cc",
    +            "src/compiler/backend/ppc/instruction-codes-ppc.h",
    +            "src/compiler/backend/ppc/instruction-scheduler-ppc.cc",
    +            "src/compiler/backend/ppc/instruction-selector-ppc.cc",
    +            "src/compiler/backend/ppc/unwinding-info-writer-ppc.cc",
    +            "src/compiler/backend/ppc/unwinding-info-writer-ppc.h",
    +        ],
    +    }) + select({
             ":is_v8_enable_webassembly": [
                 "src/compiler/int64-lowering.cc",
                 "src/compiler/int64-lowering.h",
    +            "src/compiler/wasm-call-descriptors.cc",
    +            "src/compiler/wasm-call-descriptors.h",
                 "src/compiler/wasm-compiler-definitions.h",
                 "src/compiler/wasm-compiler.cc",
                 "src/compiler/wasm-compiler.h",
                 "src/compiler/wasm-escape-analysis.cc",
                 "src/compiler/wasm-escape-analysis.h",
    +            "src/compiler/wasm-load-elimination.cc",
    +            "src/compiler/wasm-load-elimination.h",
                 "src/compiler/wasm-loop-peeling.cc",
                 "src/compiler/wasm-loop-peeling.h",
                 "src/compiler/wasm-gc-lowering.cc",
    @@ -2948,6 +3054,8 @@ filegroup(
                 "src/compiler/wasm-graph-assembler.h",
                 "src/compiler/wasm-inlining.cc",
                 "src/compiler/wasm-inlining.h",
    +            "src/compiler/wasm-inlining-into-js.cc",
    +            "src/compiler/wasm-inlining-into-js.h",
                 "src/compiler/wasm-typer.cc",
                 "src/compiler/wasm-typer.h",
             ],
    @@ -2956,7 +3064,7 @@ filegroup(
     )
     
     filegroup(
    -    name = "v8_initializers_files",
    +    name = "noicu/v8_initializers_files",
         srcs = [
             "src/builtins/builtins-array-gen.cc",
             "src/builtins/builtins-array-gen.h",
    @@ -2990,6 +3098,7 @@ filegroup(
             "src/builtins/builtins-microtask-queue-gen.cc",
             "src/builtins/builtins-number-gen.cc",
             "src/builtins/builtins-object-gen.cc",
    +        "src/builtins/builtins-object-gen.h",
             "src/builtins/builtins-promise-gen.cc",
             "src/builtins/builtins-promise-gen.h",
             "src/builtins/builtins-proxy-gen.cc",
    @@ -3046,6 +3155,14 @@ filegroup(
         }),
     )
     
    +filegroup(
    +    name = "icu/v8_initializers_files",
    +    srcs = [
    +        "src/builtins/builtins-intl-gen.cc",
    +        ":noicu/v8_initializers_files",
    +    ],
    +)
    +
     filegroup(
         name = "cppgc_base_files",
         srcs = [
    @@ -3160,16 +3277,16 @@ filegroup(
             # Note these cannot be v8_target_is_* selects because these contain
             # inline assembly that runs inside the executable. Since these are
             # linked directly into mksnapshot, they must use the actual target cpu.
    -        "@v8//bazel/config:is_inline_asm_ia32": ["src/heap/base/asm/ia32/save_registers_asm.cc"],
    -        "@v8//bazel/config:is_inline_asm_x64": ["src/heap/base/asm/x64/save_registers_asm.cc"],
    -        "@v8//bazel/config:is_inline_asm_arm": ["src/heap/base/asm/arm/save_registers_asm.cc"],
    -        "@v8//bazel/config:is_inline_asm_arm64": ["src/heap/base/asm/arm64/save_registers_asm.cc"],
    -        "@v8//bazel/config:is_inline_asm_s390x": ["src/heap/base/asm/s390/save_registers_asm.cc"],
    -        "@v8//bazel/config:is_inline_asm_riscv64": ["src/heap/base/asm/riscv64/save_registers_asm.cc"],
    -        "@v8//bazel/config:is_inline_asm_ppc64le": ["src/heap/base/asm/ppc/save_registers_asm.cc"],
    -        "@v8//bazel/config:is_msvc_asm_ia32": ["src/heap/base/asm/ia32/save_registers_masm.asm"],
    -        "@v8//bazel/config:is_msvc_asm_x64": ["src/heap/base/asm/x64/save_registers_masm.asm"],
    -        "@v8//bazel/config:is_msvc_asm_arm64": ["src/heap/base/asm/arm64/save_registers_masm.S"],
    +        "@v8//bazel/config:is_inline_asm_ia32": ["src/heap/base/asm/ia32/push_registers_asm.cc"],
    +        "@v8//bazel/config:is_inline_asm_x64": ["src/heap/base/asm/x64/push_registers_asm.cc"],
    +        "@v8//bazel/config:is_inline_asm_arm": ["src/heap/base/asm/arm/push_registers_asm.cc"],
    +        "@v8//bazel/config:is_inline_asm_arm64": ["src/heap/base/asm/arm64/push_registers_asm.cc"],
    +        "@v8//bazel/config:is_inline_asm_s390x": ["src/heap/base/asm/s390/push_registers_asm.cc"],
    +        "@v8//bazel/config:is_inline_asm_riscv64": ["src/heap/base/asm/riscv64/push_registers_asm.cc"],
    +        "@v8//bazel/config:is_inline_asm_ppc64le": ["src/heap/base/asm/ppc/push_registers_asm.cc"],
    +        "@v8//bazel/config:is_msvc_asm_ia32": ["src/heap/base/asm/ia32/push_registers_masm.asm"],
    +        "@v8//bazel/config:is_msvc_asm_x64": ["src/heap/base/asm/x64/push_registers_masm.asm"],
    +        "@v8//bazel/config:is_msvc_asm_arm64": ["src/heap/base/asm/arm64/push_registers_masm.S"],
         }),
     )
     
    @@ -3215,6 +3332,8 @@ filegroup(
             "src/snapshot/embedded/platform-embedded-file-writer-mac.h",
             "src/snapshot/embedded/platform-embedded-file-writer-win.cc",
             "src/snapshot/embedded/platform-embedded-file-writer-win.h",
    +        "src/snapshot/static-roots-gen.cc",
    +        "src/snapshot/static-roots-gen.h",
             "src/snapshot/mksnapshot.cc",
             "src/snapshot/snapshot-empty.cc",
         ],
    @@ -3223,6 +3342,8 @@ filegroup(
     filegroup(
         name = "v8_inspector_files",
         srcs = [
    +        "src/inspector/crc32.cc",
    +        "src/inspector/crc32.h",
             "src/inspector/custom-preview.cc",
             "src/inspector/custom-preview.h",
             "src/inspector/injected-script.cc",
    @@ -3249,6 +3370,8 @@ filegroup(
             "src/inspector/v8-debugger.h",
             "src/inspector/v8-debugger-agent-impl.cc",
             "src/inspector/v8-debugger-agent-impl.h",
    +        "src/inspector/v8-debugger-barrier.cc",
    +        "src/inspector/v8-debugger-barrier.h",
             "src/inspector/v8-debugger-id.cc",
             "src/inspector/v8-debugger-id.h",
             "src/inspector/v8-debugger-script.cc",
    @@ -3374,8 +3497,8 @@ filegroup(
     
     # TODO(victorgomes): Add support to tools/debug_helper,
     # which needs class-debug-readers and debug-macros.
    -v8_torque(
    -    name = "generated_torque_files",
    +v8_torque_definitions(
    +    name = "generated_torque_definitions",
         args = select({
             ":is_v8_annotate_torque_ir": ["-annotate-ir"],
             "//conditions:default": [],
    @@ -3391,12 +3514,8 @@ v8_torque(
             "class-forward-declarations.h",
             "class-verifiers.cc",
             "class-verifiers.h",
    -        "csa-types.h",
             # "debug-macros.cc",
             # "debug-macros.h",
    -        "enum-verifiers.cc",
    -        "exported-macros-assembler.cc",
    -        "exported-macros-assembler.h",
             "factory.cc",
             "factory.inc",
             "instance-types.h",
    @@ -3409,8 +3528,28 @@ v8_torque(
         noicu_srcs = [":noicu/torque_files"],
     )
     
    +v8_torque_initializers(
    +    name = "generated_torque_initializers",
    +    args = select({
    +        ":is_v8_annotate_torque_ir": ["-annotate-ir"],
    +        "//conditions:default": [],
    +    }) + select({
    +        "@v8//bazel/config:v8_target_is_32_bits": ["-m32"],
    +        "//conditions:default": [],
    +    }),
    +    extras = [
    +        "csa-types.h",
    +        "enum-verifiers.cc",
    +        "exported-macros-assembler.cc",
    +        "exported-macros-assembler.h",
    +    ],
    +    icu_srcs = [":icu/torque_files"],
    +    noicu_srcs = [":noicu/torque_files"],
    +)
    +
     py_binary(
         name = "code_generator",
    +    python_version = "PY3",
         srcs = [
             "third_party/inspector_protocol/code_generator.py",
             "third_party/inspector_protocol/pdl.py",
    @@ -3476,8 +3615,6 @@ filegroup(
         name = "v8_common_libshared_files",
         srcs = [
             ":torque_runtime_support_files",
    -        ":v8_compiler_files",
    -        ":v8_initializers_files",
             ":v8_libplatform_files",
             ":v8_libsampler_files",
             ":v8_shared_internal_headers",
    @@ -3547,14 +3684,16 @@ v8_mksnapshot(
     
     # NOTE: This allow headers to be accessed without the icu/noicu prefixes.
     cc_library(
    -    name = "icu/generated_torque_headers",
    -    hdrs = [":icu/generated_torque_files"],
    +    name = "icu/generated_torque_definitions_headers",
    +    hdrs = [":icu/generated_torque_definitions"],
    +    copts = ["-Wno-implicit-fallthrough"],
         strip_include_prefix = "icu",
     )
     
     cc_library(
    -    name = "noicu/generated_torque_headers",
    -    hdrs = [":noicu/generated_torque_files"],
    +    name = "noicu/generated_torque_definitions_headers",
    +    hdrs = [":noicu/generated_torque_definitions"],
    +    copts = ["-Wno-implicit-fallthrough"],
         strip_include_prefix = "noicu",
     )
     
    @@ -3564,6 +3703,7 @@ v8_library(
             ":v8_libbase_files",
             ":v8_shared_internal_headers",
         ],
    +    copts = ["-Wno-implicit-fallthrough"],
     )
     
     cc_library(
    @@ -3572,6 +3712,7 @@ cc_library(
             "src/torque/kythe-data.h",
             "src/torque/torque-compiler.h",
         ],
    +    copts = ["-Wno-implicit-fallthrough"],
         include_prefix = "third_party/v8",
         includes = ["."],
     )
    @@ -3581,7 +3722,7 @@ cc_library(
         srcs = [
             ":torque_base_files",
         ],
    -    copts = select({
    +    copts = ["-Wno-implicit-fallthrough"] + select({
             "@v8//bazel/config:is_posix": ["-fexceptions"],
             "//conditions:default": [],
         }),
    @@ -3597,21 +3738,27 @@ v8_library(
         srcs = [
             ":v8_base_without_compiler_files",
             ":v8_common_libshared_files",
    -    ],
    +    ] + select({
    +        ":is_v8_enable_turbofan": [
    +            ":v8_compiler_files",
    +        ],
    +        "//conditions:default": [],
    +    }),
    +    copts = ["-Wno-implicit-fallthrough"],
         icu_deps = [
    -        ":icu/generated_torque_headers",
    +        ":icu/generated_torque_definitions_headers",
             "//external:icu",
         ],
         icu_srcs = [
             ":generated_regexp_special_case",
    -        ":icu/generated_torque_files",
    +        ":icu/generated_torque_definitions",
             ":icu/v8_base_without_compiler_files",
         ],
         noicu_deps = [
    -        ":noicu/generated_torque_headers",
    +        ":noicu/generated_torque_definitions_headers",
         ],
         noicu_srcs = [
    -        ":noicu/generated_torque_files",
    +        ":noicu/generated_torque_definitions",
         ],
         deps = [
             ":v8_libbase",
    @@ -3621,8 +3768,17 @@ v8_library(
     
     v8_library(
         name = "v8",
    -    srcs = [":v8_inspector_files"],
    +    srcs = [
    +        ":v8_inspector_files",
    +    ] + select({
    +        ":is_not_v8_enable_turbofan": [
    +            # With Turbofan disabled, we only include the stubbed-out API.
    +            "src/compiler/turbofan-disabled.cc",
    +        ],
    +        "//conditions:default": [],
    +    }),
         hdrs = [":public_header_files"],
    +    copts = ["-Wno-implicit-fallthrough"],
         icu_deps = [":icu/v8_libshared"],
         icu_srcs = [":icu/snapshot_files"],
         noicu_deps = [":noicu/v8_libshared"],
    @@ -3635,6 +3791,7 @@ v8_library(
         name = "wee8",
         srcs = [":wee8_files"],
         hdrs = [":public_wasm_c_api_header_files"],
    +    copts = ["-Wno-implicit-fallthrough"],
         strip_include_prefix = "third_party",
         visibility = ["//visibility:public"],
         deps = [":noicu/v8"],
    @@ -3664,6 +3821,7 @@ v8_binary(
             "src/interpreter/bytecodes.cc",
             "src/interpreter/bytecodes.h",
         ],
    +    copts = ["-Wno-implicit-fallthrough"],
         deps = ["v8_libbase"],
     )
     
    @@ -3675,6 +3833,7 @@ v8_binary(
             ":v8_libbase_files",
             ":v8_shared_internal_headers",
         ],
    +    copts = ["-Wno-implicit-fallthrough"],
         defines = [
             "V8_INTL_SUPPORT",
             "ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC",
    @@ -3693,10 +3852,11 @@ v8_binary(
             "src/torque/torque.cc",
             ":torque_base_files",
         ],
    -    copts = select({
    +    copts = ["-Wno-implicit-fallthrough"] + select({
             "@v8//bazel/config:is_posix": ["-fexceptions"],
             "//conditions:default": [],
         }),
    +    icu_defines = [ "V8_INTL_SUPPORT" ],
         features = ["-use_header_modules"],
         linkopts = select({
             "@v8//bazel/config:is_android": ["-llog"],
    @@ -3707,26 +3867,49 @@ v8_binary(
     
     v8_binary(
         name = "mksnapshot",
    -    srcs = [":mksnapshot_files"],
    +    srcs = [
    +        ":mksnapshot_files",
    +    ] + select({
    +        ":is_not_v8_enable_turbofan": [
    +            # Turbofan is needed to generate builtins.
    +            ":v8_compiler_files",
    +        ],
    +        "//conditions:default": [],
    +    }),
    +    copts = ["-Wno-implicit-fallthrough"],
         icu_deps = [":icu/v8_libshared"],
         linkopts = select({
             "@v8//bazel/config:is_android": ["-llog"],
             "//conditions:default": [],
         }),
    +    icu_srcs = [
    +        ":icu/generated_torque_initializers",
    +        ":icu/v8_initializers_files",
    +    ],
         noicu_deps = [":v8_libshared_noicu"],
    +    noicu_srcs = [
    +        ":noicu/generated_torque_initializers",
    +        ":noicu/v8_initializers_files",
    +    ],
     )
     
     v8_binary(
         name = "d8",
         srcs = [":d8_files"],
    +    copts = ["-Wno-implicit-fallthrough"],
         icu_deps = [":icu/v8"],
         noicu_deps = [":noicu/v8"],
     )
     
     # This target forces torque to be compiled without pointer compression.
     v8_binary_non_pointer_compression(
    -    name = "torque_non_pointer_compression",
    -    binary = "torque",
    +    name = "noicu/torque_non_pointer_compression",
    +    binary = "noicu/torque",
    +)
    +
    +v8_binary_non_pointer_compression(
    +    name = "icu/torque_non_pointer_compression",
    +    binary = "icu/torque",
     )
     
     alias(
    diff --git a/deps/v8/BUILD.gn b/deps/v8/BUILD.gn
    index 78fd8cd2d38790..8f9377940796a5 100644
    --- a/deps/v8/BUILD.gn
    +++ b/deps/v8/BUILD.gn
    @@ -4,16 +4,14 @@
     
     import("//build/config/android/config.gni")
     import("//build/config/arm.gni")
    +import("//build/config/coverage/coverage.gni")
     import("//build/config/dcheck_always_on.gni")
     import("//build/config/host_byteorder.gni")
     import("//build/config/mips.gni")
    +import("//build/config/riscv.gni")
     import("//build/config/sanitizers/sanitizers.gni")
     import("//build_overrides/build.gni")
     
    -if (is_android) {
    -  import("//build/config/android/rules.gni")
    -}
    -
     import("gni/snapshot_toolchain.gni")
     import("gni/v8.gni")
     
    @@ -120,6 +118,13 @@ declare_args() {
       # as per the --native-code-counters flag.
       v8_enable_snapshot_native_code_counters = ""
     
    +  # Use pre-generated static root pointer values from static-roots.h.
    +  v8_enable_static_roots = ""
    +
    +  # Mode used by gen-static-roots.py to have a heap layout which is identical
    +  # to when v8_enable_static_roots is enabled.
    +  v8_enable_static_root_generation = false
    +
       # Enable code-generation-time checking of types in the CodeStubAssembler.
       v8_enable_verify_csa = false
     
    @@ -204,10 +209,6 @@ declare_args() {
       # Sets -dV8_EXTERNAL_CODE_SPACE
       v8_enable_external_code_space = ""
     
    -  # Enable the Maglev compiler.
    -  # Sets -dV8_ENABLE_MAGLEV
    -  v8_enable_maglev = ""
    -
       # With post mortem support enabled, metadata is embedded into libv8 that
       # describes various parameters of the VM for use by debuggers. See
       # tools/gen-postmortem-metadata.py for details.
    @@ -272,6 +273,9 @@ declare_args() {
       # Use switch-based dispatch if this is false
       v8_enable_regexp_interpreter_threaded_dispatch = true
     
    +  # Check mksnapshot determinism by running it multiple times.
    +  v8_verify_deterministic_mksnapshot = false
    +
       # Enable additional targets necessary for verification of torque
       # file generation
       v8_verify_torque_generation_invariance = false
    @@ -310,9 +314,6 @@ declare_args() {
       # Sets -DV8_ENABLE_SANDBOX.
       v8_enable_sandbox = ""
     
    -  # Enable all available sandbox features. Implies v8_enable_sandbox.
    -  v8_enable_sandbox_future = false
    -
       # Expose the memory corruption API to JavaScript. Useful for testing the sandbox.
       # WARNING This will expose builtins that (by design) cause memory corruption.
       # Sets -DV8_EXPOSE_MEMORY_CORRUPTION_API
    @@ -376,6 +377,17 @@ declare_args() {
       # Compile V8 using zlib as dependency.
       # Sets -DV8_USE_ZLIB
       v8_use_zlib = true
    +
    +  # Make ValueDeserializer crash if the data to deserialize is invalid.
    +  v8_value_deserializer_hard_fail = false
    +
    +  # Enable jitless mode, including compile-time optimizations. Note that even
    +  # when this is set to 'false', one can run V8 in jitless mode at runtime by
    +  # passing the `--jitless` flag; but then you miss out on compile-time
    +  # optimizations.
    +  # iOS (non-simulator) does not have executable pages for 3rd party
    +  # applications yet so disable jit.
    +  v8_jitless = v8_enable_lite_mode || target_is_ios_device
     }
     
     # Derived defaults.
    @@ -459,20 +471,17 @@ if (v8_enable_external_code_space == "") {
            (target_os != "fuchsia" && v8_current_cpu == "arm64"))
     }
     if (v8_enable_maglev == "") {
    -  v8_enable_maglev = v8_current_cpu == "x64" && v8_enable_pointer_compression
    -}
    -if (v8_builtins_profiling_log_file == "default") {
    -  v8_builtins_profiling_log_file = ""
    -  if (is_debug == false) {
    -    if (v8_current_cpu == "x64") {
    -      v8_builtins_profiling_log_file = "tools/builtins-pgo/x64.profile"
    -    } else if (v8_current_cpu == "arm64") {
    -      v8_builtins_profiling_log_file = "tools/builtins-pgo/arm64.profile"
    -    } else if (v8_current_cpu == "arm") {
    -      v8_builtins_profiling_log_file = "tools/builtins-pgo/arm.profile"
    -    }
    -  }
    +  v8_enable_maglev = v8_enable_turbofan &&
    +                     (v8_current_cpu == "x64" || v8_current_cpu == "arm64") &&
    +                     v8_enable_pointer_compression
     }
    +assert(v8_enable_turbofan || !v8_enable_maglev,
    +       "Maglev is not available when Turbofan is disabled.")
    +
    +assert(!v8_jitless ||
    +           (!v8_enable_maglev && !v8_enable_turbofan && !v8_enable_webassembly),
    +       "Maglev, Turbofan and Wasm are not available in jitless mode")
    +
     if (v8_enable_single_generation == "") {
       v8_enable_single_generation = v8_disable_write_barriers
     }
    @@ -500,6 +509,10 @@ assert(!v8_enable_trace_ignition || v8_enable_trace_unoptimized,
            "Ignition tracing requires unoptimized tracing to be enabled.")
     assert(!v8_enable_trace_baseline_exec || v8_enable_trace_unoptimized,
            "Baseline tracing requires unoptimized tracing to be enabled.")
    +assert(
    +    v8_enable_debugging_features == true || dcheck_always_on ||
    +        !v8_enable_slow_dchecks,
    +    "v8_enable_slow_dchecks requires v8_enable_debugging_features or dcheck_always_on.")
     
     if (v8_enable_short_builtin_calls &&
         (!v8_enable_pointer_compression && v8_current_cpu != "x64")) {
    @@ -522,9 +535,64 @@ if (v8_enable_sandbox == "") {
                           v8_enable_external_code_space && target_os != "fuchsia"
     }
     
    -# Enable all available sandbox features if sandbox future is enabled.
    -if (v8_enable_sandbox_future) {
    -  v8_enable_sandbox = true
    +if (v8_enable_static_roots == "") {
    +  # Static roots are only valid for builds with pointer compression and a
    +  # shared read-only heap.
    +  # TODO(olivf, v8:13466) Some configurations could be supported if we
    +  # introduce different static root files for different build configurations:
    +  # Non-wasm and non-i18n builds have fewer read only roots. Configurations
    +  # without external code space allocate read only roots at a further
    +  # location relative to the cage base.
    +  v8_enable_static_roots =
    +      v8_enable_pointer_compression && v8_enable_shared_ro_heap &&
    +      v8_enable_pointer_compression_shared_cage &&
    +      v8_enable_external_code_space && v8_enable_webassembly &&
    +      v8_enable_i18n_support
    +}
    +
    +assert(!v8_enable_static_roots ||
    +           (v8_enable_pointer_compression && v8_enable_shared_ro_heap &&
    +                v8_enable_pointer_compression_shared_cage &&
    +                v8_enable_external_code_space && v8_enable_webassembly &&
    +                v8_enable_i18n_support),
    +       "Trying to enable static roots in a configuration that is not supported")
    +
    +assert(
    +    !(v8_enable_static_roots && v8_enable_static_root_generation),
    +    "Static root values must be generated in a build that does not rely on static roots itself")
    +
    +if (v8_builtins_profiling_log_file == "default") {
    +  v8_builtins_profiling_log_file = ""
    +
    +  # Don't use existing profile when
    +  # * v8_enable_builtins_optimization is disabled,
    +  # * generating a new one (i.e. v8_enable_builtins_profiling),
    +  # * is_debug or dcheck_always_on because they add more checks to the
    +  #   builtins control flow which we don't want to generate,
    +  # * !v8_enable_sandbox because it affects the way how external pointer values
    +  #   are accessed,
    +  # * v8_enable_webassembly because it changes the set of opcodes which affects
    +  #   graphs hashes,
    +  # * !is_clang because it might affect argument evaluation order, which
    +  #    makes node IDs not predictable for subgraphs like Op1(Op2(), Op3()) and
    +  #    as a result different graph hash.
    +  if (v8_enable_builtins_optimization && !v8_enable_builtins_profiling &&
    +      is_clang && !is_debug && !dcheck_always_on && v8_enable_webassembly) {
    +    if ((v8_current_cpu == "x64" || v8_current_cpu == "arm64") &&
    +        v8_enable_pointer_compression && v8_enable_external_code_space &&
    +        v8_enable_sandbox) {
    +      # Note, currently x64 profile can be applied to arm64 but not the other
    +      # way round.
    +      v8_builtins_profiling_log_file = "tools/builtins-pgo/profiles/x64.profile"
    +    } else if (v8_current_cpu == "x86" || v8_current_cpu == "arm") {
    +      # Note, x86 profile can be applied to arm but not the other way round.
    +      v8_builtins_profiling_log_file = "tools/builtins-pgo/profiles/x86.profile"
    +    }
    +  }
    +}
    +
    +if (v8_enable_webassembly && !target_is_simulator && v8_current_cpu == "x64") {
    +  v8_enable_wasm_simd256_revec = true
     }
     
     assert(!v8_disable_write_barriers || v8_enable_single_generation,
    @@ -567,8 +635,9 @@ assert(
     
     assert(
         !v8_enable_pointer_compression_shared_cage || v8_current_cpu == "x64" ||
    -        v8_current_cpu == "arm64" || v8_current_cpu == "riscv64",
    -    "Sharing a pointer compression cage is only supported on x64,arm64 and riscv64")
    +        v8_current_cpu == "arm64" || v8_current_cpu == "riscv64" ||
    +        v8_current_cpu == "ppc64",
    +    "Sharing a pointer compression cage is only supported on x64,arm64, ppc64 and riscv64")
     
     assert(!v8_enable_unconditional_write_barriers || !v8_disable_write_barriers,
            "Write barriers can't be both enabled and disabled")
    @@ -583,12 +652,6 @@ assert(!cppgc_enable_young_generation || cppgc_enable_caged_heap,
     assert(!cppgc_enable_pointer_compression || cppgc_enable_caged_heap,
            "Pointer compression in CppGC requires caged heap")
     
    -assert(
    -    !v8_enable_conservative_stack_scanning ||
    -        v8_enable_inner_pointer_resolution_osb ||
    -        v8_enable_inner_pointer_resolution_mb,
    -    "Conservative stack scanning requires inner pointer resolution (OSB or MB)")
    -
     if (v8_enable_single_generation == true) {
       assert(
           v8_enable_unconditional_write_barriers || v8_disable_write_barriers,
    @@ -741,6 +804,7 @@ external_v8_defines = [
       "V8_USE_PERFETTO",
       "V8_MAP_PACKING",
       "V8_IS_TSAN",
    +  "V8_ENABLE_CONSERVATIVE_STACK_SCANNING",
     ]
     
     enabled_external_v8_defines = []
    @@ -780,6 +844,9 @@ if (v8_enable_map_packing) {
     if (is_tsan) {
       enabled_external_v8_defines += [ "V8_IS_TSAN" ]
     }
    +if (v8_enable_conservative_stack_scanning) {
    +  enabled_external_v8_defines += [ "V8_ENABLE_CONSERVATIVE_STACK_SCANNING" ]
    +}
     
     disabled_external_v8_defines = external_v8_defines - enabled_external_v8_defines
     
    @@ -800,6 +867,7 @@ config("v8_header_features") {
     external_cppgc_defines = [
       "CPPGC_SUPPORTS_OBJECT_NAMES",
       "CPPGC_CAGED_HEAP",
    +  "CPPGC_SLIM_WRITE_BARRIER",
       "CPPGC_YOUNG_GENERATION",
       "CPPGC_POINTER_COMPRESSION",
     ]
    @@ -829,6 +897,9 @@ if (cppgc_enable_pointer_compression) {
     if (cppgc_enable_2gb_cage) {
       enabled_external_cppgc_defines += [ "CPPGC_2GB_CAGE" ]
     }
    +if (cppgc_enable_slim_write_barrier) {
    +  enabled_external_cppgc_defines += [ "CPPGC_SLIM_WRITE_BARRIER" ]
    +}
     
     disabled_external_cppgc_defines =
         external_cppgc_defines - enabled_external_cppgc_defines
    @@ -944,15 +1015,6 @@ config("features") {
       if (v8_enable_single_generation) {
         defines += [ "V8_ENABLE_SINGLE_GENERATION" ]
       }
    -  if (v8_enable_conservative_stack_scanning) {
    -    defines += [ "V8_ENABLE_CONSERVATIVE_STACK_SCANNING" ]
    -  }
    -  if (v8_enable_inner_pointer_resolution_osb) {
    -    defines += [ "V8_ENABLE_INNER_POINTER_RESOLUTION_OSB" ]
    -  }
    -  if (v8_enable_inner_pointer_resolution_mb) {
    -    defines += [ "V8_ENABLE_INNER_POINTER_RESOLUTION_MB" ]
    -  }
       if (v8_disable_write_barriers) {
         defines += [ "V8_DISABLE_WRITE_BARRIERS" ]
       }
    @@ -1010,6 +1072,12 @@ config("features") {
       if (v8_enable_maglev) {
         defines += [ "V8_ENABLE_MAGLEV" ]
       }
    +  if (v8_enable_turbofan) {
    +    defines += [ "V8_ENABLE_TURBOFAN" ]
    +  }
    +  if (v8_jitless) {
    +    defines += [ "V8_JITLESS" ]
    +  }
       if (v8_enable_swiss_name_dictionary) {
         defines += [ "V8_ENABLE_SWISS_NAME_DICTIONARY" ]
       }
    @@ -1052,9 +1120,24 @@ config("features") {
       if (v8_enable_pointer_compression_8gb) {
         defines += [ "V8_COMPRESS_POINTERS_8GB" ]
       }
    +  if (v8_enable_static_roots) {
    +    defines += [ "V8_STATIC_ROOTS" ]
    +  }
    +  if (v8_enable_static_root_generation) {
    +    defines += [ "V8_STATIC_ROOT_GENERATION" ]
    +  }
       if (v8_use_zlib) {
         defines += [ "V8_USE_ZLIB" ]
       }
    +  if (v8_use_libm_trig_functions) {
    +    defines += [ "V8_USE_LIBM_TRIG_FUNCTIONS" ]
    +  }
    +  if (v8_value_deserializer_hard_fail) {
    +    defines += [ "V8_VALUE_DESERIALIZER_HARD_FAIL" ]
    +  }
    +  if (v8_enable_wasm_simd256_revec) {
    +    defines += [ "V8_ENABLE_WASM_SIMD256_REVEC" ]
    +  }
     }
     
     config("toolchain") {
    @@ -1189,8 +1272,9 @@ config("toolchain") {
         if (!is_clang) {
           cflags += [ "-ffp-contract=off" ]
         }
    -    if (target_is_simulator) {
    +    if (riscv_use_rvv || target_is_simulator) {
           defines += [ "CAN_USE_RVV_INSTRUCTIONS" ]
    +      defines += [ "RVV_VLEN=${riscv_rvv_vlen}" ]
         }
       }
     
    @@ -1242,6 +1326,9 @@ config("toolchain") {
       } else if (target_os == "win") {
         defines += [ "V8_HAVE_TARGET_OS" ]
         defines += [ "V8_TARGET_OS_WIN" ]
    +  } else if (target_os == "chromeos") {
    +    defines += [ "V8_HAVE_TARGET_OS" ]
    +    defines += [ "V8_TARGET_OS_CHROMEOS" ]
       }
     
       # TODO(infra): Support v8_enable_prof on Windows.
    @@ -1251,13 +1338,12 @@ config("toolchain") {
         if ((is_linux || is_chromeos) && v8_enable_backtrace) {
           ldflags += [ "-rdynamic" ]
         }
    -
    +  }
    +  if (v8_enable_debugging_features || dcheck_always_on) {
         defines += [ "DEBUG" ]
         if (v8_enable_slow_dchecks) {
           defines += [ "ENABLE_SLOW_DCHECKS" ]
         }
    -  } else if (dcheck_always_on) {
    -    defines += [ "DEBUG" ]
       }
     
       if (v8_enable_verify_csa) {
    @@ -1508,23 +1594,6 @@ config("always_turbofanimize") {
       }
     }
     
    -# Configs for code coverage with gcov. Separate configs for cflags and ldflags
    -# to selectively influde cflags in non-test targets only.
    -config("v8_gcov_coverage_cflags") {
    -  cflags = [
    -    "-fprofile-arcs",
    -    "-ftest-coverage",
    -
    -    # We already block on gcc warnings on other bots. Let's not block here to
    -    # always generate coverage reports.
    -    "-Wno-error",
    -  ]
    -}
    -
    -config("v8_gcov_coverage_ldflags") {
    -  ldflags = [ "-fprofile-arcs" ]
    -}
    -
     ###############################################################################
     # Actions
     #
    @@ -1556,108 +1625,91 @@ template("asm_to_inline_asm") {
       }
     }
     
    -if (is_android && enable_java_templates) {
    -  android_assets("v8_external_startup_data_assets") {
    -    if (v8_use_external_startup_data) {
    -      deps = [ "//v8" ]
    -      renaming_sources = [ "$root_out_dir/snapshot_blob.bin" ]
    -      if (current_cpu == "arm" || current_cpu == "x86") {
    -        renaming_destinations = [ "snapshot_blob_32.bin" ]
    -      } else {
    -        renaming_destinations = [ "snapshot_blob_64.bin" ]
    -      }
    -      disable_compression = true
    -    }
    -  }
    -}
    -
    -action("postmortem-metadata") {
    -  # Only targets in this file and the top-level visibility target can
    -  # depend on this.
    -  visibility = [
    -    ":*",
    -    "//:gn_visibility",
    -  ]
    -
    -  script = "tools/gen-postmortem-metadata.py"
    -
    -  # NOSORT
    -  sources = [
    -    "$target_gen_dir/torque-generated/instance-types.h",
    -    "src/objects/allocation-site.h",
    -    "src/objects/allocation-site-inl.h",
    -    "src/objects/cell.h",
    -    "src/objects/cell-inl.h",
    -    "src/objects/code.h",
    -    "src/objects/code-inl.h",
    -    "src/objects/data-handler.h",
    -    "src/objects/data-handler-inl.h",
    -    "src/objects/descriptor-array.h",
    -    "src/objects/descriptor-array-inl.h",
    -    "src/objects/feedback-cell.h",
    -    "src/objects/feedback-cell-inl.h",
    -    "src/objects/fixed-array.h",
    -    "src/objects/fixed-array-inl.h",
    -    "src/objects/heap-number.h",
    -    "src/objects/heap-number-inl.h",
    -    "src/objects/heap-object.h",
    -    "src/objects/heap-object-inl.h",
    -    "src/objects/instance-type.h",
    -    "src/objects/js-array-buffer.h",
    -    "src/objects/js-array-buffer-inl.h",
    -    "src/objects/js-array.h",
    -    "src/objects/js-array-inl.h",
    -    "src/objects/js-function-inl.h",
    -    "src/objects/js-function.cc",
    -    "src/objects/js-function.h",
    -    "src/objects/js-objects.cc",
    -    "src/objects/js-objects.h",
    -    "src/objects/js-objects-inl.h",
    -    "src/objects/js-promise.h",
    -    "src/objects/js-promise-inl.h",
    -    "src/objects/js-raw-json.cc",
    -    "src/objects/js-raw-json.h",
    -    "src/objects/js-raw-json-inl.h",
    -    "src/objects/js-regexp.cc",
    -    "src/objects/js-regexp.h",
    -    "src/objects/js-regexp-inl.h",
    -    "src/objects/js-regexp-string-iterator.h",
    -    "src/objects/js-regexp-string-iterator-inl.h",
    -    "src/objects/map.cc",
    -    "src/objects/map.h",
    -    "src/objects/map-inl.h",
    -    "src/objects/megadom-handler.h",
    -    "src/objects/megadom-handler-inl.h",
    -    "src/objects/name.h",
    -    "src/objects/name-inl.h",
    -    "src/objects/objects.h",
    -    "src/objects/objects-inl.h",
    -    "src/objects/oddball.h",
    -    "src/objects/oddball-inl.h",
    -    "src/objects/primitive-heap-object.h",
    -    "src/objects/primitive-heap-object-inl.h",
    -    "src/objects/scope-info.h",
    -    "src/objects/scope-info-inl.h",
    -    "src/objects/script.h",
    -    "src/objects/script-inl.h",
    -    "src/objects/shared-function-info.cc",
    -    "src/objects/shared-function-info.h",
    -    "src/objects/shared-function-info-inl.h",
    -    "src/objects/string.cc",
    -    "src/objects/string-comparator.cc",
    -    "src/objects/string-comparator.h",
    -    "src/objects/string.h",
    -    "src/objects/string-inl.h",
    -    "src/objects/struct.h",
    -    "src/objects/struct-inl.h",
    -  ]
    -
    -  outputs = [ "$target_gen_dir/debug-support.cc" ]
    +if (v8_postmortem_support) {
    +  action("postmortem-metadata") {
    +    # Only targets in this file can depend on this.
    +    visibility = [ ":*" ]
     
    -  args = rebase_path(outputs, root_build_dir) +
    -         rebase_path(sources, root_build_dir)
    +    script = "tools/gen-postmortem-metadata.py"
     
    -  deps = [ ":run_torque" ]
    +    # NOSORT
    +    sources = [
    +      "$target_gen_dir/torque-generated/instance-types.h",
    +      "src/objects/allocation-site.h",
    +      "src/objects/allocation-site-inl.h",
    +      "src/objects/cell.h",
    +      "src/objects/cell-inl.h",
    +      "src/objects/code.h",
    +      "src/objects/code-inl.h",
    +      "src/objects/data-handler.h",
    +      "src/objects/data-handler-inl.h",
    +      "src/objects/descriptor-array.h",
    +      "src/objects/descriptor-array-inl.h",
    +      "src/objects/feedback-cell.h",
    +      "src/objects/feedback-cell-inl.h",
    +      "src/objects/fixed-array.h",
    +      "src/objects/fixed-array-inl.h",
    +      "src/objects/heap-number.h",
    +      "src/objects/heap-number-inl.h",
    +      "src/objects/heap-object.h",
    +      "src/objects/heap-object-inl.h",
    +      "src/objects/instance-type.h",
    +      "src/objects/js-array-buffer.h",
    +      "src/objects/js-array-buffer-inl.h",
    +      "src/objects/js-array.h",
    +      "src/objects/js-array-inl.h",
    +      "src/objects/js-function-inl.h",
    +      "src/objects/js-function.cc",
    +      "src/objects/js-function.h",
    +      "src/objects/js-objects.cc",
    +      "src/objects/js-objects.h",
    +      "src/objects/js-objects-inl.h",
    +      "src/objects/js-promise.h",
    +      "src/objects/js-promise-inl.h",
    +      "src/objects/js-raw-json.cc",
    +      "src/objects/js-raw-json.h",
    +      "src/objects/js-raw-json-inl.h",
    +      "src/objects/js-regexp.cc",
    +      "src/objects/js-regexp.h",
    +      "src/objects/js-regexp-inl.h",
    +      "src/objects/js-regexp-string-iterator.h",
    +      "src/objects/js-regexp-string-iterator-inl.h",
    +      "src/objects/map.cc",
    +      "src/objects/map.h",
    +      "src/objects/map-inl.h",
    +      "src/objects/megadom-handler.h",
    +      "src/objects/megadom-handler-inl.h",
    +      "src/objects/name.h",
    +      "src/objects/name-inl.h",
    +      "src/objects/objects.h",
    +      "src/objects/objects-inl.h",
    +      "src/objects/oddball.h",
    +      "src/objects/oddball-inl.h",
    +      "src/objects/primitive-heap-object.h",
    +      "src/objects/primitive-heap-object-inl.h",
    +      "src/objects/scope-info.h",
    +      "src/objects/scope-info-inl.h",
    +      "src/objects/script.h",
    +      "src/objects/script-inl.h",
    +      "src/objects/shared-function-info.cc",
    +      "src/objects/shared-function-info.h",
    +      "src/objects/shared-function-info-inl.h",
    +      "src/objects/string.cc",
    +      "src/objects/string-comparator.cc",
    +      "src/objects/string-comparator.h",
    +      "src/objects/string.h",
    +      "src/objects/string-inl.h",
    +      "src/objects/struct.h",
    +      "src/objects/struct-inl.h",
    +    ]
    +
    +    outputs = [ "$target_gen_dir/debug-support.cc" ]
    +
    +    args = rebase_path(outputs, root_build_dir) +
    +           rebase_path(sources, root_build_dir)
    +
    +    deps = [ ":run_torque" ]
    +  }
     }
     
     torque_files = [
    @@ -1713,6 +1765,8 @@ torque_files = [
       "src/builtins/internal-coverage.tq",
       "src/builtins/internal.tq",
       "src/builtins/iterator.tq",
    +  "src/builtins/iterator-from.tq",
    +  "src/builtins/iterator-helpers.tq",
       "src/builtins/math.tq",
       "src/builtins/number.tq",
       "src/builtins/object-fromentries.tq",
    @@ -1756,6 +1810,7 @@ torque_files = [
       "src/builtins/string-html.tq",
       "src/builtins/string-includes.tq",
       "src/builtins/string-indexof.tq",
    +  "src/builtins/string-iswellformed.tq",
       "src/builtins/string-iterator.tq",
       "src/builtins/string-match-search.tq",
       "src/builtins/string-pad.tq",
    @@ -1765,6 +1820,7 @@ torque_files = [
       "src/builtins/string-startswith.tq",
       "src/builtins/string-substr.tq",
       "src/builtins/string-substring.tq",
    +  "src/builtins/string-towellformed.tq",
       "src/builtins/string-trim.tq",
       "src/builtins/symbol.tq",
       "src/builtins/torque-internal.tq",
    @@ -1821,6 +1877,7 @@ torque_files = [
       "src/objects/js-collection.tq",
       "src/objects/js-function.tq",
       "src/objects/js-generator.tq",
    +  "src/objects/js-iterator-helpers.tq",
       "src/objects/js-objects.tq",
       "src/objects/js-promise.tq",
       "src/objects/js-proxy.tq",
    @@ -1860,6 +1917,7 @@ torque_files = [
       "src/objects/templates.tq",
       "src/objects/torque-defined-classes.tq",
       "src/objects/turbofan-types.tq",
    +  "src/objects/turboshaft-types.tq",
       "test/torque/test-torque.tq",
       "third_party/v8/builtins/array-sort.tq",
     ]
    @@ -2005,7 +2063,7 @@ if (v8_verify_torque_generation_invariance) {
     
     group("v8_maybe_icu") {
       if (v8_enable_i18n_support) {
    -    public_deps = [ "//third_party/icu" ]
    +    public_deps = [ v8_icu_path ]
       }
     }
     
    @@ -2114,12 +2172,6 @@ template("run_mksnapshot") {
         suffix = "_$name"
       }
       action("run_mksnapshot_" + name) {
    -    # Only targets in this file and running mkgrokdump can depend on this.
    -    visibility = [
    -      ":*",
    -      "tools/debug_helper:run_mkgrokdump",
    -    ]
    -
         deps = [ ":mksnapshot($v8_snapshot_toolchain)" ]
     
         script = "tools/run.py"
    @@ -2159,6 +2211,12 @@ template("run_mksnapshot") {
             "--turbo-profiling-input",
             rebase_path(v8_builtins_profiling_log_file, root_build_dir),
           ]
    +
    +      # Replace this with --warn-about-builtin-profile-data to see the full
    +      # list of builtins with incompatible profiles.
    +      # TODO(crbug.com/v8/13647): Do not fail for invalid profiles
    +      # args += [ "--abort-on-bad-builtin-profile-data" ]
    +      args += [ "--warn-about-builtin-profile-data" ]
         }
     
         # This is needed to distinguish between generating code for the simulator
    @@ -2253,10 +2311,45 @@ if (emit_builtins_as_inline_asm) {
       }
     }
     
    +if (v8_verify_deterministic_mksnapshot) {
    +  runs = [
    +    "run_0",
    +    "run_1",
    +    "run_2",
    +    "run_3",
    +    "run_4",
    +    "run_5",
    +    "run_6",
    +  ]
    +
    +  foreach(i, runs) {
    +    run_mksnapshot(i) {
    +      args = []
    +      embedded_variant = "Default"
    +    }
    +  }
    +
    +  action("verify_deterministic_mksnapshot") {
    +    deps = []
    +    foreach(i, runs) {
    +      deps += [ ":run_mksnapshot_$i" ]
    +    }
    +    report_file = "$target_gen_dir/mksnapshot_comparison.txt"
    +    script = "tools/snapshot/compare_mksnapshot_output.py"
    +    args = [
    +      rebase_path("$report_file", root_build_dir),
    +      rebase_path("$target_gen_dir", root_build_dir),
    +      rebase_path("$root_out_dir", root_build_dir),
    +      "7",  # Length of the 'runs' list.
    +    ]
    +    outputs = [ report_file ]
    +  }
    +}
    +
     action("v8_dump_build_config") {
       script = "tools/testrunner/utils/dump_build_config.py"
       outputs = [ "$root_out_dir/v8_build_config.json" ]
    -  is_gcov_coverage = v8_code_coverage && !is_clang
    +  is_DEBUG_defined = v8_enable_debugging_features || dcheck_always_on
       is_full_debug = v8_enable_debugging_features && !v8_optimized_debug
       args = [
         rebase_path("$root_out_dir/v8_build_config.json", root_build_dir),
    @@ -2266,37 +2359,48 @@ action("v8_dump_build_config") {
         "is_asan=$is_asan",
         "is_cfi=$is_cfi",
         "is_clang=$is_clang",
    +    "is_clang_coverage=$use_clang_coverage",
         "is_component_build=$is_component_build",
         "is_debug=$v8_enable_debugging_features",
    +    "is_DEBUG_defined=$is_DEBUG_defined",
         "is_full_debug=$is_full_debug",
    -    "is_gcov_coverage=$is_gcov_coverage",
         "is_msan=$is_msan",
         "is_tsan=$is_tsan",
         "is_ubsan_vptr=$is_ubsan_vptr",
         "target_cpu=\"$target_cpu\"",
    +    "v8_code_comments=$v8_code_comments",
    +    "v8_control_flow_integrity=$v8_control_flow_integrity",
         "v8_current_cpu=\"$v8_current_cpu\"",
    +    "v8_dict_property_const_tracking=$v8_dict_property_const_tracking",
    +    "v8_disable_write_barriers=$v8_disable_write_barriers",
         "v8_enable_atomic_object_field_writes=" +
             "$v8_enable_atomic_object_field_writes",
    +    "v8_enable_cet_shadow_stack=$v8_enable_cet_shadow_stack",
    +    "v8_enable_concurrent_marking=$v8_enable_concurrent_marking",
         "v8_enable_conservative_stack_scanning=" +
             "$v8_enable_conservative_stack_scanning",
    -    "v8_enable_concurrent_marking=$v8_enable_concurrent_marking",
    -    "v8_enable_single_generation=$v8_enable_single_generation",
    +    "v8_enable_debug_code=$v8_enable_debug_code",
    +    "v8_enable_disassembler=$v8_enable_disassembler",
    +    "v8_enable_gdbjit=$v8_enable_gdbjit",
         "v8_enable_i18n_support=$v8_enable_i18n_support",
    -    "v8_enable_verify_predictable=$v8_enable_verify_predictable",
    -    "v8_enable_verify_csa=$v8_enable_verify_csa",
         "v8_enable_lite_mode=$v8_enable_lite_mode",
    -    "v8_enable_runtime_call_stats=$v8_enable_runtime_call_stats",
    +    "v8_enable_maglev=$v8_enable_maglev",
         "v8_enable_pointer_compression=$v8_enable_pointer_compression",
         "v8_enable_pointer_compression_shared_cage=" +
             "$v8_enable_pointer_compression_shared_cage",
    +    "v8_enable_runtime_call_stats=$v8_enable_runtime_call_stats",
         "v8_enable_sandbox=$v8_enable_sandbox",
         "v8_enable_shared_ro_heap=$v8_enable_shared_ro_heap",
    +    "v8_enable_single_generation=$v8_enable_single_generation",
    +    "v8_enable_slow_dchecks=$v8_enable_slow_dchecks",
         "v8_enable_third_party_heap=$v8_enable_third_party_heap",
    +    "v8_enable_turbofan=$v8_enable_turbofan",
    +    "v8_enable_verify_csa=$v8_enable_verify_csa",
    +    "v8_enable_verify_heap=$v8_enable_verify_heap",
    +    "v8_enable_verify_predictable=$v8_enable_verify_predictable",
         "v8_enable_webassembly=$v8_enable_webassembly",
    -    "v8_dict_property_const_tracking=$v8_dict_property_const_tracking",
    -    "v8_control_flow_integrity=$v8_control_flow_integrity",
    +    "v8_jitless=$v8_jitless",
         "v8_target_cpu=\"$v8_target_cpu\"",
    -    "v8_enable_cet_shadow_stack=$v8_enable_cet_shadow_stack",
       ]
     
       if (v8_current_cpu == "mips64" || v8_current_cpu == "mips64el") {
    @@ -2312,11 +2416,15 @@ action("v8_dump_build_config") {
     #
     
     v8_source_set("v8_snapshot") {
    -  visibility = [ ":*" ]  # Targets in this file can depend on this.
    +  # Let external targets depend on v8_snapshot.
    +  if (v8_use_external_startup_data) {
    +    visibility = [ ":*" ]  # Targets in this file can depend on this.
    +  }
     
       deps = [
         ":v8_internal_headers",
         ":v8_libbase",
    +    ":v8_tracing",
       ]
       public_deps = [
         # This should be public so downstream targets can declare the snapshot
    @@ -2345,9 +2453,6 @@ v8_source_set("v8_snapshot") {
     
         sources += [ "src/snapshot/snapshot-external.cc" ]
       } else {
    -    # Also top-level visibility targets can depend on this.
    -    visibility += [ "//:gn_visibility" ]
    -
         public_deps += [ ":v8_maybe_icu" ]
     
         sources += [ "$target_gen_dir/snapshot.cc" ]
    @@ -2404,6 +2509,7 @@ v8_source_set("v8_initializers") {
         "src/builtins/builtins-microtask-queue-gen.cc",
         "src/builtins/builtins-number-gen.cc",
         "src/builtins/builtins-object-gen.cc",
    +    "src/builtins/builtins-object-gen.h",
         "src/builtins/builtins-promise-gen.cc",
         "src/builtins/builtins-promise-gen.h",
         "src/builtins/builtins-proxy-gen.cc",
    @@ -2454,57 +2560,57 @@ v8_source_set("v8_initializers") {
     
       if (v8_current_cpu == "x86") {
         sources += [
    -      ### gcmole(arch:ia32) ###
    +      ### gcmole(ia32) ###
           "src/builtins/ia32/builtins-ia32.cc",
         ]
       } else if (v8_current_cpu == "x64") {
         sources += [
    -      ### gcmole(arch:x64) ###
    +      ### gcmole(x64) ###
           "src/builtins/x64/builtins-x64.cc",
         ]
       } else if (v8_current_cpu == "arm") {
         sources += [
    -      ### gcmole(arch:arm) ###
    +      ### gcmole(arm) ###
           "src/builtins/arm/builtins-arm.cc",
         ]
       } else if (v8_current_cpu == "arm64") {
         sources += [
    -      ### gcmole(arch:arm64) ###
    +      ### gcmole(arm64) ###
           "src/builtins/arm64/builtins-arm64.cc",
         ]
       } else if (v8_current_cpu == "mips64" || v8_current_cpu == "mips64el") {
         sources += [
    -      ### gcmole(arch:mips64el) ###
    +      ### gcmole(mips64el) ###
           "src/builtins/mips64/builtins-mips64.cc",
         ]
       } else if (v8_current_cpu == "loong64") {
         sources += [
    -      ### gcmole(arch:loong64) ###
    +      ### gcmole(loong64) ###
           "src/builtins/loong64/builtins-loong64.cc",
         ]
       } else if (v8_current_cpu == "ppc") {
         sources += [
    -      ### gcmole(arch:ppc) ###
    +      ### gcmole(ppc) ###
           "src/builtins/ppc/builtins-ppc.cc",
         ]
       } else if (v8_current_cpu == "ppc64") {
         sources += [
    -      ### gcmole(arch:ppc64) ###
    +      ### gcmole(ppc64) ###
           "src/builtins/ppc/builtins-ppc.cc",
         ]
       } else if (v8_current_cpu == "s390" || v8_current_cpu == "s390x") {
         sources += [
    -      ### gcmole(arch:s390) ###
    +      ### gcmole(s390) ###
           "src/builtins/s390/builtins-s390.cc",
         ]
       } else if (v8_current_cpu == "riscv64") {
         sources += [
    -      ### gcmole(arch:riscv64) ###
    +      ### gcmole(riscv64) ###
           "src/builtins/riscv/builtins-riscv.cc",
         ]
       } else if (v8_current_cpu == "riscv32") {
         sources += [
    -      ### gcmole(arch:riscv32) ###
    +      ### gcmole(riscv32) ###
           "src/builtins/riscv/builtins-riscv.cc",
         ]
       }
    @@ -2775,6 +2881,7 @@ v8_header_set("v8_internal_headers") {
         "src/codegen/interface-descriptors.h",
         "src/codegen/label.h",
         "src/codegen/machine-type.h",
    +    "src/codegen/macro-assembler-base.h",
         "src/codegen/macro-assembler-inl.h",
         "src/codegen/macro-assembler.h",
         "src/codegen/maglev-safepoint-table.h",
    @@ -2795,7 +2902,6 @@ v8_header_set("v8_internal_headers") {
         "src/codegen/source-position.h",
         "src/codegen/tick-counter.h",
         "src/codegen/tnode.h",
    -    "src/codegen/turbo-assembler.h",
         "src/codegen/unoptimized-compilation-info.h",
         "src/common/assert-scope.h",
         "src/common/checks.h",
    @@ -2911,6 +3017,7 @@ v8_header_set("v8_internal_headers") {
         "src/compiler/osr.h",
         "src/compiler/per-isolate-compiler-cache.h",
         "src/compiler/persistent-map.h",
    +    "src/compiler/phase.h",
         "src/compiler/pipeline-statistics.h",
         "src/compiler/pipeline.h",
         "src/compiler/processed-feedback.h",
    @@ -2928,25 +3035,61 @@ v8_header_set("v8_internal_headers") {
         "src/compiler/simplified-operator.h",
         "src/compiler/state-values-utils.h",
         "src/compiler/store-store-elimination.h",
    +    "src/compiler/string-builder-optimizer.h",
    +    "src/compiler/turbofan.h",
         "src/compiler/turboshaft/assembler.h",
    +    "src/compiler/turboshaft/assert-types-reducer.h",
    +    "src/compiler/turboshaft/branch-elimination-reducer.h",
    +    "src/compiler/turboshaft/build-graph-phase.h",
    +    "src/compiler/turboshaft/builtin-call-descriptors.h",
    +    "src/compiler/turboshaft/dead-code-elimination-phase.h",
    +    "src/compiler/turboshaft/dead-code-elimination-reducer.h",
    +    "src/compiler/turboshaft/decompression-optimization-phase.h",
         "src/compiler/turboshaft/decompression-optimization.h",
    +    "src/compiler/turboshaft/define-assembler-macros.inc",
         "src/compiler/turboshaft/deopt-data.h",
         "src/compiler/turboshaft/fast-hash.h",
         "src/compiler/turboshaft/graph-builder.h",
         "src/compiler/turboshaft/graph-visualizer.h",
         "src/compiler/turboshaft/graph.h",
    +    "src/compiler/turboshaft/index.h",
    +    "src/compiler/turboshaft/late-escape-analysis-reducer.h",
    +    "src/compiler/turboshaft/late-optimization-phase.h",
    +    "src/compiler/turboshaft/layered-hash-map.h",
    +    "src/compiler/turboshaft/machine-lowering-phase.h",
    +    "src/compiler/turboshaft/machine-lowering-reducer.h",
         "src/compiler/turboshaft/machine-optimization-reducer.h",
    +    "src/compiler/turboshaft/memory-optimization-reducer.h",
         "src/compiler/turboshaft/operation-matching.h",
         "src/compiler/turboshaft/operations.h",
         "src/compiler/turboshaft/optimization-phase.h",
    +    "src/compiler/turboshaft/optimize-phase.h",
    +    "src/compiler/turboshaft/phase.h",
    +    "src/compiler/turboshaft/recreate-schedule-phase.h",
         "src/compiler/turboshaft/recreate-schedule.h",
    +    "src/compiler/turboshaft/reducer-traits.h",
         "src/compiler/turboshaft/representations.h",
    +    "src/compiler/turboshaft/runtime-call-descriptors.h",
         "src/compiler/turboshaft/select-lowering-reducer.h",
         "src/compiler/turboshaft/sidetable.h",
         "src/compiler/turboshaft/simplify-tf-loops.h",
         "src/compiler/turboshaft/snapshot-table.h",
    +    "src/compiler/turboshaft/tag-untag-lowering-phase.h",
    +    "src/compiler/turboshaft/tag-untag-lowering-reducer.h",
    +    "src/compiler/turboshaft/tracing.h",
    +    "src/compiler/turboshaft/type-assertions-phase.h",
    +    "src/compiler/turboshaft/type-inference-analysis.h",
    +    "src/compiler/turboshaft/type-inference-reducer.h",
    +    "src/compiler/turboshaft/type-parser.h",
    +    "src/compiler/turboshaft/typed-optimizations-phase.h",
    +    "src/compiler/turboshaft/typed-optimizations-reducer.h",
    +    "src/compiler/turboshaft/typer.h",
    +    "src/compiler/turboshaft/types.h",
    +    "src/compiler/turboshaft/undef-assembler.macros.inc",
    +    "src/compiler/turboshaft/uniform-reducer-adapater.h",
         "src/compiler/turboshaft/utils.h",
         "src/compiler/turboshaft/value-numbering-reducer.h",
    +    "src/compiler/turboshaft/variable-reducer.h",
         "src/compiler/type-cache.h",
         "src/compiler/type-narrowing-reducer.h",
         "src/compiler/typed-optimization.h",
    @@ -3057,12 +3200,13 @@ v8_header_set("v8_internal_headers") {
         "src/heap/cppgc-js/cpp-marking-state-inl.h",
         "src/heap/cppgc-js/cpp-marking-state.h",
         "src/heap/cppgc-js/cpp-snapshot.h",
    +    "src/heap/cppgc-js/cross-heap-remembered-set.h",
         "src/heap/cppgc-js/unified-heap-marking-state-inl.h",
         "src/heap/cppgc-js/unified-heap-marking-state.h",
         "src/heap/cppgc-js/unified-heap-marking-verifier.h",
         "src/heap/cppgc-js/unified-heap-marking-visitor.h",
    -    "src/heap/embedder-tracing-inl.h",
    -    "src/heap/embedder-tracing.h",
    +    "src/heap/cppgc-js/wrappable-info-inl.h",
    +    "src/heap/cppgc-js/wrappable-info.h",
         "src/heap/evacuation-allocator-inl.h",
         "src/heap/evacuation-allocator.h",
         "src/heap/evacuation-verifier-inl.h",
    @@ -3078,7 +3222,6 @@ v8_header_set("v8_internal_headers") {
         "src/heap/gc-idle-time-handler.h",
         "src/heap/gc-tracer-inl.h",
         "src/heap/gc-tracer.h",
    -    "src/heap/global-handle-marking-visitor.h",
         "src/heap/heap-allocator-inl.h",
         "src/heap/heap-allocator.h",
         "src/heap/heap-controller.h",
    @@ -3118,8 +3261,10 @@ v8_header_set("v8_internal_headers") {
         "src/heap/memory-measurement-inl.h",
         "src/heap/memory-measurement.h",
         "src/heap/memory-reducer.h",
    +    "src/heap/minor-gc-job.h",
         "src/heap/new-spaces-inl.h",
         "src/heap/new-spaces.h",
    +    "src/heap/object-lock.h",
         "src/heap/object-stats.h",
         "src/heap/objects-visiting-inl.h",
         "src/heap/objects-visiting.h",
    @@ -3136,15 +3281,13 @@ v8_header_set("v8_internal_headers") {
         "src/heap/remembered-set-inl.h",
         "src/heap/remembered-set.h",
         "src/heap/safepoint.h",
    -    "src/heap/scavenge-job.h",
         "src/heap/scavenger-inl.h",
         "src/heap/scavenger.h",
         "src/heap/slot-set.h",
         "src/heap/spaces-inl.h",
         "src/heap/spaces.h",
    -    "src/heap/stress-marking-observer.h",
    -    "src/heap/stress-scavenge-observer.h",
         "src/heap/sweeper.h",
    +    "src/heap/traced-handles-marking-visitor.h",
         "src/heap/weak-object-worklists.h",
         "src/ic/call-optimization.h",
         "src/ic/handler-configuration-inl.h",
    @@ -3281,6 +3424,8 @@ v8_header_set("v8_internal_headers") {
         "src/objects/js-function.h",
         "src/objects/js-generator-inl.h",
         "src/objects/js-generator.h",
    +    "src/objects/js-iterator-helpers-inl.h",
    +    "src/objects/js-iterator-helpers.h",
         "src/objects/js-objects-inl.h",
         "src/objects/js-objects.h",
         "src/objects/js-promise-inl.h",
    @@ -3406,6 +3551,8 @@ v8_header_set("v8_internal_headers") {
         "src/objects/transitions.h",
         "src/objects/turbofan-types-inl.h",
         "src/objects/turbofan-types.h",
    +    "src/objects/turboshaft-types-inl.h",
    +    "src/objects/turboshaft-types.h",
         "src/objects/type-hints.h",
         "src/objects/value-serializer.h",
         "src/objects/visitors-inl.h",
    @@ -3473,6 +3620,7 @@ v8_header_set("v8_internal_headers") {
         "src/regexp/special-case.h",
         "src/roots/roots-inl.h",
         "src/roots/roots.h",
    +    "src/roots/static-roots.h",
         "src/runtime/runtime-utils.h",
         "src/runtime/runtime.h",
         "src/sandbox/bounded-size-inl.h",
    @@ -3592,12 +3740,17 @@ v8_header_set("v8_internal_headers") {
           "src/maglev/maglev-interpreter-frame-state.h",
           "src/maglev/maglev-ir-inl.h",
           "src/maglev/maglev-ir.h",
    +      "src/maglev/maglev-phi-representation-selector.h",
           "src/maglev/maglev-regalloc-data.h",
           "src/maglev/maglev-regalloc.h",
           "src/maglev/maglev-register-frame-array.h",
    -      "src/maglev/maglev-vreg-allocator.h",
           "src/maglev/maglev.h",
         ]
    +    if (v8_current_cpu == "arm64") {
    +      sources += [ "src/maglev/arm64/maglev-assembler-arm64-inl.h" ]
    +    } else if (v8_current_cpu == "x64") {
    +      sources += [ "src/maglev/x64/maglev-assembler-x64-inl.h" ]
    +    }
       }
     
       if (v8_enable_webassembly) {
    @@ -3608,13 +3761,16 @@ v8_header_set("v8_internal_headers") {
           "src/asmjs/asm-scanner.h",
           "src/asmjs/asm-types.h",
           "src/compiler/int64-lowering.h",
    +      "src/compiler/wasm-call-descriptors.h",
           "src/compiler/wasm-compiler-definitions.h",
           "src/compiler/wasm-compiler.h",
           "src/compiler/wasm-escape-analysis.h",
           "src/compiler/wasm-gc-lowering.h",
           "src/compiler/wasm-gc-operator-reducer.h",
           "src/compiler/wasm-graph-assembler.h",
    +      "src/compiler/wasm-inlining-into-js.h",
           "src/compiler/wasm-inlining.h",
    +      "src/compiler/wasm-load-elimination.h",
           "src/compiler/wasm-loop-peeling.h",
           "src/compiler/wasm-typer.h",
           "src/debug/debug-wasm-objects-inl.h",
    @@ -3680,11 +3836,15 @@ v8_header_set("v8_internal_headers") {
           "src/wasm/wasm-subtyping.h",
           "src/wasm/wasm-tier.h",
           "src/wasm/wasm-value.h",
    +      "src/wasm/well-known-imports.h",
         ]
       }
     
       if (v8_enable_wasm_simd256_revec) {
    -    sources += [ "src/compiler/linear-scheduler.h" ]
    +    sources += [
    +      "src/compiler/linear-scheduler.h",
    +      "src/compiler/revectorizer.h",
    +    ]
       }
     
       if (!v8_enable_third_party_heap) {
    @@ -3720,8 +3880,6 @@ v8_header_set("v8_internal_headers") {
           "src/objects/js-segment-iterator.h",
           "src/objects/js-segmenter-inl.h",
           "src/objects/js-segmenter.h",
    -      "src/objects/js-segments-inl.h",
    -      "src/objects/js-segments.h",
         ]
       }
     
    @@ -3733,13 +3891,6 @@ v8_header_set("v8_internal_headers") {
         sources += [ "src/heap/conservative-stack-visitor.h" ]
       }
     
    -  if (v8_enable_inner_pointer_resolution_osb) {
    -    sources += [
    -      "src/heap/object-start-bitmap-inl.h",
    -      "src/heap/object-start-bitmap.h",
    -    ]
    -  }
    -
       if (v8_enable_wasm_gdb_remote_debugging) {
         sources += [
           "src/debug/wasm/gdb-server/gdb-remote-util.h",
    @@ -3758,7 +3909,8 @@ v8_header_set("v8_internal_headers") {
       }
     
       if (v8_current_cpu == "x86") {
    -    sources += [  ### gcmole(arch:ia32) ###
    +    sources += [
    +      ### gcmole(ia32) ###
           "src/baseline/ia32/baseline-assembler-ia32-inl.h",
           "src/baseline/ia32/baseline-compiler-ia32-inl.h",
           "src/codegen/ia32/assembler-ia32-inl.h",
    @@ -3776,7 +3928,8 @@ v8_header_set("v8_internal_headers") {
           "src/wasm/baseline/ia32/liftoff-assembler-ia32.h",
         ]
       } else if (v8_current_cpu == "x64") {
    -    sources += [  ### gcmole(arch:x64) ###
    +    sources += [
    +      ### gcmole(x64) ###
           "src/baseline/x64/baseline-assembler-x64-inl.h",
           "src/baseline/x64/baseline-compiler-x64-inl.h",
           "src/codegen/shared-ia32-x64/macro-assembler-shared-ia32-x64.h",
    @@ -3812,7 +3965,8 @@ v8_header_set("v8_internal_headers") {
           }
         }
       } else if (v8_current_cpu == "arm") {
    -    sources += [  ### gcmole(arch:arm) ###
    +    sources += [
    +      ### gcmole(arm) ###
           "src/baseline/arm/baseline-assembler-arm-inl.h",
           "src/baseline/arm/baseline-compiler-arm-inl.h",
           "src/codegen/arm/assembler-arm-inl.h",
    @@ -3830,7 +3984,8 @@ v8_header_set("v8_internal_headers") {
           "src/wasm/baseline/arm/liftoff-assembler-arm.h",
         ]
       } else if (v8_current_cpu == "arm64") {
    -    sources += [  ### gcmole(arch:arm64) ###
    +    sources += [
    +      ### gcmole(arm64) ###
           "src/baseline/arm64/baseline-assembler-arm64-inl.h",
           "src/baseline/arm64/baseline-compiler-arm64-inl.h",
           "src/codegen/arm64/assembler-arm64-inl.h",
    @@ -3859,7 +4014,7 @@ v8_header_set("v8_internal_headers") {
         if (v8_enable_webassembly) {
           # Trap handling is enabled on arm64 Mac and in simulators on x64 on Linux
           # and Mac.
    -      if ((current_cpu == "arm64" && is_mac) ||
    +      if ((current_cpu == "arm64" && (is_mac || is_ios)) ||
               (current_cpu == "x64" && (is_linux || is_chromeos || is_mac))) {
             sources += [ "src/trap-handler/handler-inside-posix.h" ]
           }
    @@ -3872,7 +4027,8 @@ v8_header_set("v8_internal_headers") {
           sources += [ "src/diagnostics/unwinding-info-win64.h" ]
         }
       } else if (v8_current_cpu == "mips64" || v8_current_cpu == "mips64el") {
    -    sources += [  ### gcmole(arch:mips64el) ###
    +    sources += [
    +      ### gcmole(mips64el) ###
           "src/baseline/mips64/baseline-assembler-mips64-inl.h",
           "src/baseline/mips64/baseline-compiler-mips64-inl.h",
           "src/codegen/mips64/assembler-mips64-inl.h",
    @@ -3888,7 +4044,8 @@ v8_header_set("v8_internal_headers") {
           "src/wasm/baseline/mips64/liftoff-assembler-mips64.h",
         ]
       } else if (v8_current_cpu == "loong64") {
    -    sources += [  ### gcmole(arch:loong64) ###
    +    sources += [
    +      ### gcmole(loong64) ###
           "src/baseline/loong64/baseline-assembler-loong64-inl.h",
           "src/baseline/loong64/baseline-compiler-loong64-inl.h",
           "src/codegen/loong64/assembler-loong64-inl.h",
    @@ -3904,7 +4061,8 @@ v8_header_set("v8_internal_headers") {
           "src/wasm/baseline/loong64/liftoff-assembler-loong64.h",
         ]
       } else if (v8_current_cpu == "ppc") {
    -    sources += [  ### gcmole(arch:ppc) ###
    +    sources += [
    +      ### gcmole(ppc) ###
           "src/codegen/ppc/assembler-ppc-inl.h",
           "src/codegen/ppc/assembler-ppc.h",
           "src/codegen/ppc/constants-ppc.h",
    @@ -3920,7 +4078,8 @@ v8_header_set("v8_internal_headers") {
           "src/wasm/baseline/ppc/liftoff-assembler-ppc.h",
         ]
       } else if (v8_current_cpu == "ppc64") {
    -    sources += [  ### gcmole(arch:ppc64) ###
    +    sources += [
    +      ### gcmole(ppc64) ###
           "src/baseline/ppc/baseline-assembler-ppc-inl.h",
           "src/baseline/ppc/baseline-compiler-ppc-inl.h",
           "src/codegen/ppc/assembler-ppc-inl.h",
    @@ -3938,7 +4097,8 @@ v8_header_set("v8_internal_headers") {
           "src/wasm/baseline/ppc/liftoff-assembler-ppc.h",
         ]
       } else if (v8_current_cpu == "s390" || v8_current_cpu == "s390x") {
    -    sources += [  ### gcmole(arch:s390) ###
    +    sources += [
    +      ### gcmole(s390) ###
           "src/baseline/s390/baseline-assembler-s390-inl.h",
           "src/baseline/s390/baseline-compiler-s390-inl.h",
           "src/codegen/s390/assembler-s390-inl.h",
    @@ -3956,16 +4116,15 @@ v8_header_set("v8_internal_headers") {
           "src/wasm/baseline/s390/liftoff-assembler-s390.h",
         ]
       } else if (v8_current_cpu == "riscv64") {
    -    sources += [  ### gcmole(arch:riscv64) ###
    +    sources += [
    +      ### gcmole(riscv64) ###
           "src/baseline/riscv/baseline-assembler-riscv-inl.h",
           "src/baseline/riscv/baseline-compiler-riscv-inl.h",
           "src/codegen/riscv/assembler-riscv-inl.h",
    -      "src/codegen/riscv/assembler-riscv-inl.h",
           "src/codegen/riscv/assembler-riscv.h",
           "src/codegen/riscv/base-assembler-riscv.h",
           "src/codegen/riscv/base-constants-riscv.h",
           "src/codegen/riscv/base-riscv-i.h",
    -      "src/codegen/riscv/base-riscv-i.h",
           "src/codegen/riscv/constant-riscv-a.h",
           "src/codegen/riscv/constant-riscv-c.h",
           "src/codegen/riscv/constant-riscv-d.h",
    @@ -3978,7 +4137,7 @@ v8_header_set("v8_internal_headers") {
           "src/codegen/riscv/extension-riscv-a.h",
           "src/codegen/riscv/extension-riscv-c.h",
           "src/codegen/riscv/extension-riscv-d.h",
    -      "src/codegen/riscv/extension-riscv-d.h",
    +      "src/codegen/riscv/extension-riscv-f.h",
           "src/codegen/riscv/extension-riscv-inl.h",
           "src/codegen/riscv/extension-riscv-m.h",
           "src/codegen/riscv/extension-riscv-v.h",
    @@ -3995,11 +4154,12 @@ v8_header_set("v8_internal_headers") {
           "src/wasm/baseline/riscv64/liftoff-assembler-riscv64.h",
         ]
       } else if (v8_current_cpu == "riscv32") {
    -    sources += [  ### gcmole(arch:riscv32) ###
    +    sources += [
    +      ### gcmole(riscv32) ###
           "src/baseline/riscv/baseline-assembler-riscv-inl.h",
           "src/baseline/riscv/baseline-compiler-riscv-inl.h",
    +      "src/codegen/riscv/assembler-riscv-inl.h",
           "src/codegen/riscv/assembler-riscv.h",
    -      "src/codegen/riscv/assembler-riscv32-inl.h",
           "src/codegen/riscv/base-assembler-riscv.h",
           "src/codegen/riscv/base-constants-riscv.h",
           "src/codegen/riscv/base-riscv-i.h",
    @@ -4157,6 +4317,8 @@ v8_compiler_sources = [
       "src/compiler/simplified-operator.cc",
       "src/compiler/state-values-utils.cc",
       "src/compiler/store-store-elimination.cc",
    +  "src/compiler/string-builder-optimizer.cc",
    +  "src/compiler/turbofan-enabled.cc",
       "src/compiler/type-cache.cc",
       "src/compiler/type-narrowing-reducer.cc",
       "src/compiler/typed-optimization.cc",
    @@ -4165,30 +4327,123 @@ v8_compiler_sources = [
       "src/compiler/value-numbering-reducer.cc",
       "src/compiler/verifier.cc",
       "src/compiler/zone-stats.cc",
    -  "src/utils/hex-format.cc",
    -  "src/utils/sha-256.cc",
     ]
     
    +if (v8_current_cpu == "x86") {
    +  v8_compiler_sources += [
    +    ### gcmole(ia32) ###
    +    "src/compiler/backend/ia32/code-generator-ia32.cc",
    +    "src/compiler/backend/ia32/instruction-scheduler-ia32.cc",
    +    "src/compiler/backend/ia32/instruction-selector-ia32.cc",
    +  ]
    +} else if (v8_current_cpu == "x64") {
    +  v8_compiler_sources += [
    +    ### gcmole(x64) ###
    +    "src/compiler/backend/x64/code-generator-x64.cc",
    +    "src/compiler/backend/x64/instruction-scheduler-x64.cc",
    +    "src/compiler/backend/x64/instruction-selector-x64.cc",
    +    "src/compiler/backend/x64/unwinding-info-writer-x64.cc",
    +  ]
    +} else if (v8_current_cpu == "arm") {
    +  v8_compiler_sources += [
    +    ### gcmole(arm) ###
    +    "src/compiler/backend/arm/code-generator-arm.cc",
    +    "src/compiler/backend/arm/instruction-scheduler-arm.cc",
    +    "src/compiler/backend/arm/instruction-selector-arm.cc",
    +    "src/compiler/backend/arm/unwinding-info-writer-arm.cc",
    +  ]
    +} else if (v8_current_cpu == "arm64") {
    +  v8_compiler_sources += [
    +    ### gcmole(arm64) ###
    +    "src/compiler/backend/arm64/code-generator-arm64.cc",
    +    "src/compiler/backend/arm64/instruction-scheduler-arm64.cc",
    +    "src/compiler/backend/arm64/instruction-selector-arm64.cc",
    +    "src/compiler/backend/arm64/unwinding-info-writer-arm64.cc",
    +  ]
    +} else if (v8_current_cpu == "mips64" || v8_current_cpu == "mips64el") {
    +  v8_compiler_sources += [
    +    ### gcmole(mips64el) ###
    +    "src/compiler/backend/mips64/code-generator-mips64.cc",
    +    "src/compiler/backend/mips64/instruction-scheduler-mips64.cc",
    +    "src/compiler/backend/mips64/instruction-selector-mips64.cc",
    +  ]
    +} else if (v8_current_cpu == "loong64") {
    +  v8_compiler_sources += [
    +    ### gcmole(loong64) ###
    +    "src/compiler/backend/loong64/code-generator-loong64.cc",
    +    "src/compiler/backend/loong64/instruction-scheduler-loong64.cc",
    +    "src/compiler/backend/loong64/instruction-selector-loong64.cc",
    +  ]
    +} else if (v8_current_cpu == "ppc") {
    +  v8_compiler_sources += [
    +    ### gcmole(ppc) ###
    +    "src/compiler/backend/ppc/code-generator-ppc.cc",
    +    "src/compiler/backend/ppc/instruction-scheduler-ppc.cc",
    +    "src/compiler/backend/ppc/instruction-selector-ppc.cc",
    +    "src/compiler/backend/ppc/unwinding-info-writer-ppc.cc",
    +  ]
    +} else if (v8_current_cpu == "ppc64") {
    +  v8_compiler_sources += [
    +    ### gcmole(ppc64) ###
    +    "src/compiler/backend/ppc/code-generator-ppc.cc",
    +    "src/compiler/backend/ppc/instruction-scheduler-ppc.cc",
    +    "src/compiler/backend/ppc/instruction-selector-ppc.cc",
    +    "src/compiler/backend/ppc/unwinding-info-writer-ppc.cc",
    +  ]
    +} else if (v8_current_cpu == "s390" || v8_current_cpu == "s390x") {
    +  v8_compiler_sources += [
    +    ### gcmole(s390) ###
    +    "src/compiler/backend/s390/code-generator-s390.cc",
    +    "src/compiler/backend/s390/instruction-scheduler-s390.cc",
    +    "src/compiler/backend/s390/instruction-selector-s390.cc",
    +    "src/compiler/backend/s390/unwinding-info-writer-s390.cc",
    +  ]
    +} else if (v8_current_cpu == "riscv64") {
    +  v8_compiler_sources += [
    +    ### gcmole(riscv64) ###
    +    "src/compiler/backend/riscv/code-generator-riscv.cc",
    +    "src/compiler/backend/riscv/instruction-scheduler-riscv.cc",
    +    "src/compiler/backend/riscv/instruction-selector-riscv64.cc",
    +  ]
    +} else if (v8_current_cpu == "riscv32") {
    +  v8_compiler_sources += [
    +    ### gcmole(riscv32) ###
    +    "src/compiler/backend/riscv/code-generator-riscv.cc",
    +    "src/compiler/backend/riscv/instruction-scheduler-riscv.cc",
    +    "src/compiler/backend/riscv/instruction-selector-riscv32.cc",
    +  ]
    +}
    +
     if (v8_enable_webassembly) {
       v8_compiler_sources += [
         "src/compiler/int64-lowering.cc",
    +    "src/compiler/wasm-call-descriptors.cc",
         "src/compiler/wasm-compiler.cc",
         "src/compiler/wasm-escape-analysis.cc",
         "src/compiler/wasm-gc-lowering.cc",
         "src/compiler/wasm-gc-operator-reducer.cc",
         "src/compiler/wasm-graph-assembler.cc",
    +    "src/compiler/wasm-inlining-into-js.cc",
         "src/compiler/wasm-inlining.cc",
    +    "src/compiler/wasm-load-elimination.cc",
         "src/compiler/wasm-loop-peeling.cc",
         "src/compiler/wasm-typer.cc",
       ]
     }
     
     if (v8_enable_wasm_simd256_revec) {
    -  v8_compiler_sources += [ "src/compiler/linear-scheduler.cc" ]
    +  v8_compiler_sources += [
    +    "src/compiler/linear-scheduler.cc",
    +    "src/compiler/revectorizer.cc",
    +  ]
     }
     
    -# The src/compiler files with optimizations.
    -v8_source_set("v8_compiler_opt") {
    +# The src/compiler files for use in mksnapshot.
    +# - These might be built with additional optimizations if
    +#   v8_enable_fast_mksnapshot is set.
    +# - We always include Turbofan even if v8_enable_turbofan is unset s.t.
    +#   builtins can be generated by mksnapshot.
    +v8_source_set("v8_compiler_for_mksnapshot_source_set") {
       visibility = [ ":*" ]  # Only targets in this file can depend on this.
     
       sources = v8_compiler_sources
    @@ -4219,11 +4474,16 @@ v8_source_set("v8_compiler_opt") {
       }
     }
     
    -# The src/compiler files with default optimization behavior.
    +# The src/compiler files with default behavior.
     v8_source_set("v8_compiler") {
       visibility = [ ":*" ]  # Only targets in this file can depend on this.
     
    -  sources = v8_compiler_sources
    +  if (v8_enable_turbofan) {
    +    sources = v8_compiler_sources
    +  } else {
    +    # With Turbofan disabled, we only include the stubbed-out API.
    +    sources = [ "src/compiler/turbofan-disabled.cc" ]
    +  }
     
       public_deps = [
         ":generate_bytecode_builtins_list",
    @@ -4247,15 +4507,32 @@ v8_source_set("v8_turboshaft") {
       visibility = [ ":*" ]  # Only targets in this file can depend on this.
     
       sources = [
    +    "src/compiler/turboshaft/assembler.cc",
    +    "src/compiler/turboshaft/build-graph-phase.cc",
    +    "src/compiler/turboshaft/dead-code-elimination-phase.cc",
    +    "src/compiler/turboshaft/decompression-optimization-phase.cc",
         "src/compiler/turboshaft/decompression-optimization.cc",
         "src/compiler/turboshaft/graph-builder.cc",
         "src/compiler/turboshaft/graph-visualizer.cc",
         "src/compiler/turboshaft/graph.cc",
    +    "src/compiler/turboshaft/late-escape-analysis-reducer.cc",
    +    "src/compiler/turboshaft/late-optimization-phase.cc",
    +    "src/compiler/turboshaft/machine-lowering-phase.cc",
    +    "src/compiler/turboshaft/memory-optimization-reducer.cc",
         "src/compiler/turboshaft/operations.cc",
         "src/compiler/turboshaft/optimization-phase.cc",
    +    "src/compiler/turboshaft/optimize-phase.cc",
    +    "src/compiler/turboshaft/phase.cc",
    +    "src/compiler/turboshaft/recreate-schedule-phase.cc",
         "src/compiler/turboshaft/recreate-schedule.cc",
         "src/compiler/turboshaft/representations.cc",
         "src/compiler/turboshaft/simplify-tf-loops.cc",
    +    "src/compiler/turboshaft/tag-untag-lowering-phase.cc",
    +    "src/compiler/turboshaft/type-assertions-phase.cc",
    +    "src/compiler/turboshaft/type-parser.cc",
    +    "src/compiler/turboshaft/typed-optimizations-phase.cc",
    +    "src/compiler/turboshaft/typer.cc",
    +    "src/compiler/turboshaft/types.cc",
         "src/compiler/turboshaft/utils.cc",
       ]
     
    @@ -4277,8 +4554,14 @@ v8_source_set("v8_turboshaft") {
     }
     
     group("v8_compiler_for_mksnapshot") {
    -  if (is_debug && !v8_optimized_debug && v8_enable_fast_mksnapshot) {
    -    deps = [ ":v8_compiler_opt" ]
    +  if ((is_debug && !v8_optimized_debug && v8_enable_fast_mksnapshot) ||
    +      !v8_enable_turbofan) {
    +    # mksnapshot needs its own version of the compiler, either because
    +    # a) we're optimizing for mksnapshot execution speed and the compiler
    +    #    should be optimized even if the rest of V8 is not; or
    +    # b) Turbofan is disabled and thus not compiled into the rest of V8, yet
    +    #    mksnapshot still needs TF to generate builtins.
    +    deps = [ ":v8_compiler_for_mksnapshot_source_set" ]
       } else {
         deps = [ ":v8_compiler" ]
       }
    @@ -4297,7 +4580,11 @@ group("v8_tracing") {
     }
     
     v8_source_set("v8_base_without_compiler") {
    -  visibility = [ ":*" ]  # Only targets in this file can depend on this.
    +  # Only targets in this file and gcmole can depend on this.
    +  visibility = [
    +    ":*",
    +    "tools/gcmole/:*",
    +  ]
     
       # Split static libraries on windows into two.
       split_count = 2
    @@ -4351,7 +4638,6 @@ v8_source_set("v8_base_without_compiler") {
         "src/builtins/builtins-trace.cc",
         "src/builtins/builtins-typed-array.cc",
         "src/builtins/builtins-weak-refs.cc",
    -    "src/builtins/builtins-web-snapshots.cc",
         "src/builtins/builtins.cc",
         "src/builtins/constants-table-builder.cc",
         "src/codegen/aligned-slot-allocator.cc",
    @@ -4371,6 +4657,7 @@ v8_source_set("v8_base_without_compiler") {
         "src/codegen/handler-table.cc",
         "src/codegen/interface-descriptors.cc",
         "src/codegen/machine-type.cc",
    +    "src/codegen/macro-assembler-base.cc",
         "src/codegen/maglev-safepoint-table.cc",
         "src/codegen/optimized-compilation-info.cc",
         "src/codegen/pending-optimization-table.cc",
    @@ -4381,10 +4668,10 @@ v8_source_set("v8_base_without_compiler") {
         "src/codegen/source-position.cc",
         "src/codegen/tick-counter.cc",
         "src/codegen/tnode.cc",
    -    "src/codegen/turbo-assembler.cc",
         "src/codegen/unoptimized-compilation-info.cc",
         "src/common/assert-scope.cc",
         "src/common/code-memory-access.cc",
    +    "src/common/ptr-compr.cc",
         "src/compiler-dispatcher/lazy-compile-dispatcher.cc",
         "src/compiler-dispatcher/optimizing-compile-dispatcher.cc",
         "src/date/date.cc",
    @@ -4460,10 +4747,10 @@ v8_source_set("v8_base_without_compiler") {
         "src/heap/concurrent-marking.cc",
         "src/heap/cppgc-js/cpp-heap.cc",
         "src/heap/cppgc-js/cpp-snapshot.cc",
    +    "src/heap/cppgc-js/cross-heap-remembered-set.cc",
         "src/heap/cppgc-js/unified-heap-marking-state.cc",
         "src/heap/cppgc-js/unified-heap-marking-verifier.cc",
         "src/heap/cppgc-js/unified-heap-marking-visitor.cc",
    -    "src/heap/embedder-tracing.cc",
         "src/heap/evacuation-verifier.cc",
         "src/heap/factory-base.cc",
         "src/heap/factory.cc",
    @@ -4471,7 +4758,6 @@ v8_source_set("v8_base_without_compiler") {
         "src/heap/free-list.cc",
         "src/heap/gc-idle-time-handler.cc",
         "src/heap/gc-tracer.cc",
    -    "src/heap/global-handle-marking-visitor.cc",
         "src/heap/heap-allocator.cc",
         "src/heap/heap-controller.cc",
         "src/heap/heap-layout-tracer.cc",
    @@ -4494,6 +4780,7 @@ v8_source_set("v8_base_without_compiler") {
         "src/heap/memory-chunk.cc",
         "src/heap/memory-measurement.cc",
         "src/heap/memory-reducer.cc",
    +    "src/heap/minor-gc-job.cc",
         "src/heap/new-spaces.cc",
         "src/heap/object-stats.cc",
         "src/heap/objects-visiting.cc",
    @@ -4502,13 +4789,12 @@ v8_source_set("v8_base_without_compiler") {
         "src/heap/read-only-heap.cc",
         "src/heap/read-only-spaces.cc",
         "src/heap/safepoint.cc",
    -    "src/heap/scavenge-job.cc",
         "src/heap/scavenger.cc",
         "src/heap/slot-set.cc",
         "src/heap/spaces.cc",
    -    "src/heap/stress-marking-observer.cc",
         "src/heap/stress-scavenge-observer.cc",
         "src/heap/sweeper.cc",
    +    "src/heap/traced-handles-marking-visitor.cc",
         "src/heap/weak-object-worklists.cc",
         "src/ic/call-optimization.cc",
         "src/ic/handler-configuration.cc",
    @@ -4584,6 +4870,7 @@ v8_source_set("v8_base_without_compiler") {
         "src/objects/js-segment-iterator.cc",
         "src/objects/js-segmenter.cc",
         "src/objects/js-segments.cc",
    +    "src/objects/js-struct.cc",
         "src/objects/js-temporal-objects.cc",
         "src/objects/keys.cc",
         "src/objects/literal-objects.cc",
    @@ -4736,13 +5023,13 @@ v8_source_set("v8_base_without_compiler") {
         "src/utils/allocation.cc",
         "src/utils/bit-vector.cc",
         "src/utils/detachable-vector.cc",
    +    "src/utils/hex-format.cc",
         "src/utils/identity-map.cc",
         "src/utils/memcopy.cc",
         "src/utils/ostreams.cc",
    +    "src/utils/sha-256.cc",
         "src/utils/utils.cc",
         "src/utils/version.cc",
    -    "src/web-snapshot/web-snapshot.cc",
    -    "src/web-snapshot/web-snapshot.h",
         "src/zone/accounting-allocator.cc",
         "src/zone/type-stats.cc",
         "src/zone/zone-segment.cc",
    @@ -4765,13 +5052,26 @@ v8_source_set("v8_base_without_compiler") {
           "src/maglev/maglev-graph-printer.cc",
           "src/maglev/maglev-interpreter-frame-state.cc",
           "src/maglev/maglev-ir.cc",
    +      "src/maglev/maglev-phi-representation-selector.cc",
           "src/maglev/maglev-regalloc.cc",
           "src/maglev/maglev.cc",
         ]
    +    if (v8_current_cpu == "arm64") {
    +      sources += [
    +        "src/maglev/arm64/maglev-assembler-arm64.cc",
    +        "src/maglev/arm64/maglev-ir-arm64.cc",
    +      ]
    +    } else if (v8_current_cpu == "x64") {
    +      sources += [
    +        "src/maglev/x64/maglev-assembler-x64.cc",
    +        "src/maglev/x64/maglev-ir-x64.cc",
    +      ]
    +    }
       }
     
       if (v8_enable_webassembly) {
    -    sources += [  ### gcmole(all) ###
    +    sources += [
    +      ### gcmole(all) ###
           "src/asmjs/asm-js.cc",
           "src/asmjs/asm-parser.cc",
           "src/asmjs/asm-scanner.cc",
    @@ -4822,6 +5122,7 @@ v8_source_set("v8_base_without_compiler") {
           "src/wasm/wasm-result.cc",
           "src/wasm/wasm-serialization.cc",
           "src/wasm/wasm-subtyping.cc",
    +      "src/wasm/well-known-imports.cc",
         ]
       }
     
    @@ -4853,14 +5154,12 @@ v8_source_set("v8_base_without_compiler") {
       }
     
       if (v8_current_cpu == "x86") {
    -    sources += [  ### gcmole(arch:ia32) ###
    +    sources += [
    +      ### gcmole(ia32) ###
           "src/codegen/ia32/assembler-ia32.cc",
           "src/codegen/ia32/cpu-ia32.cc",
           "src/codegen/ia32/macro-assembler-ia32.cc",
           "src/codegen/shared-ia32-x64/macro-assembler-shared-ia32-x64.cc",
    -      "src/compiler/backend/ia32/code-generator-ia32.cc",
    -      "src/compiler/backend/ia32/instruction-scheduler-ia32.cc",
    -      "src/compiler/backend/ia32/instruction-selector-ia32.cc",
           "src/deoptimizer/ia32/deoptimizer-ia32.cc",
           "src/diagnostics/ia32/disasm-ia32.cc",
           "src/diagnostics/ia32/unwinder-ia32.cc",
    @@ -4868,15 +5167,12 @@ v8_source_set("v8_base_without_compiler") {
           "src/regexp/ia32/regexp-macro-assembler-ia32.cc",
         ]
       } else if (v8_current_cpu == "x64") {
    -    sources += [  ### gcmole(arch:x64) ###
    +    sources += [
    +      ### gcmole(x64) ###
           "src/codegen/shared-ia32-x64/macro-assembler-shared-ia32-x64.cc",
           "src/codegen/x64/assembler-x64.cc",
           "src/codegen/x64/cpu-x64.cc",
           "src/codegen/x64/macro-assembler-x64.cc",
    -      "src/compiler/backend/x64/code-generator-x64.cc",
    -      "src/compiler/backend/x64/instruction-scheduler-x64.cc",
    -      "src/compiler/backend/x64/instruction-selector-x64.cc",
    -      "src/compiler/backend/x64/unwinding-info-writer-x64.cc",
           "src/deoptimizer/x64/deoptimizer-x64.cc",
           "src/diagnostics/x64/disasm-x64.cc",
           "src/diagnostics/x64/eh-frame-x64.cc",
    @@ -4906,15 +5202,12 @@ v8_source_set("v8_base_without_compiler") {
           }
         }
       } else if (v8_current_cpu == "arm") {
    -    sources += [  ### gcmole(arch:arm) ###
    +    sources += [
    +      ### gcmole(arm) ###
           "src/codegen/arm/assembler-arm.cc",
           "src/codegen/arm/constants-arm.cc",
           "src/codegen/arm/cpu-arm.cc",
           "src/codegen/arm/macro-assembler-arm.cc",
    -      "src/compiler/backend/arm/code-generator-arm.cc",
    -      "src/compiler/backend/arm/instruction-scheduler-arm.cc",
    -      "src/compiler/backend/arm/instruction-selector-arm.cc",
    -      "src/compiler/backend/arm/unwinding-info-writer-arm.cc",
           "src/deoptimizer/arm/deoptimizer-arm.cc",
           "src/diagnostics/arm/disasm-arm.cc",
           "src/diagnostics/arm/eh-frame-arm.cc",
    @@ -4924,7 +5217,8 @@ v8_source_set("v8_base_without_compiler") {
           "src/regexp/arm/regexp-macro-assembler-arm.cc",
         ]
       } else if (v8_current_cpu == "arm64") {
    -    sources += [  ### gcmole(arch:arm64) ###
    +    sources += [
    +      ### gcmole(arm64) ###
           "src/codegen/arm64/assembler-arm64.cc",
           "src/codegen/arm64/cpu-arm64.cc",
           "src/codegen/arm64/decoder-arm64.cc",
    @@ -4933,10 +5227,6 @@ v8_source_set("v8_base_without_compiler") {
           "src/codegen/arm64/macro-assembler-arm64.cc",
           "src/codegen/arm64/register-arm64.cc",
           "src/codegen/arm64/utils-arm64.cc",
    -      "src/compiler/backend/arm64/code-generator-arm64.cc",
    -      "src/compiler/backend/arm64/instruction-scheduler-arm64.cc",
    -      "src/compiler/backend/arm64/instruction-selector-arm64.cc",
    -      "src/compiler/backend/arm64/unwinding-info-writer-arm64.cc",
           "src/deoptimizer/arm64/deoptimizer-arm64.cc",
           "src/diagnostics/arm64/disasm-arm64.cc",
           "src/diagnostics/arm64/eh-frame-arm64.cc",
    @@ -4950,7 +5240,7 @@ v8_source_set("v8_base_without_compiler") {
         if (v8_enable_webassembly) {
           # Trap handling is enabled on arm64 Mac and in simulators on x64 on Linux,
           # Mac, and Windows.
    -      if ((current_cpu == "arm64" && is_mac) ||
    +      if ((current_cpu == "arm64" && is_apple) ||
               (current_cpu == "x64" && (is_linux || is_chromeos || is_mac))) {
             sources += [
               "src/trap-handler/handler-inside-posix.cc",
    @@ -4971,15 +5261,13 @@ v8_source_set("v8_base_without_compiler") {
           sources += [ "src/diagnostics/unwinding-info-win64.cc" ]
         }
       } else if (v8_current_cpu == "mips64" || v8_current_cpu == "mips64el") {
    -    sources += [  ### gcmole(arch:mips64el) ###
    +    sources += [
    +      ### gcmole(mips64el) ###
           "src/codegen/mips64/assembler-mips64.cc",
           "src/codegen/mips64/constants-mips64.cc",
           "src/codegen/mips64/cpu-mips64.cc",
           "src/codegen/mips64/interface-descriptors-mips64-inl.h",
           "src/codegen/mips64/macro-assembler-mips64.cc",
    -      "src/compiler/backend/mips64/code-generator-mips64.cc",
    -      "src/compiler/backend/mips64/instruction-scheduler-mips64.cc",
    -      "src/compiler/backend/mips64/instruction-selector-mips64.cc",
           "src/deoptimizer/mips64/deoptimizer-mips64.cc",
           "src/diagnostics/mips64/disasm-mips64.cc",
           "src/diagnostics/mips64/unwinder-mips64.cc",
    @@ -4988,15 +5276,13 @@ v8_source_set("v8_base_without_compiler") {
           "src/regexp/mips64/regexp-macro-assembler-mips64.cc",
         ]
       } else if (v8_current_cpu == "loong64") {
    -    sources += [  ### gcmole(arch:loong64) ###
    +    sources += [
    +      ### gcmole(loong64) ###
           "src/codegen/loong64/assembler-loong64.cc",
           "src/codegen/loong64/constants-loong64.cc",
           "src/codegen/loong64/cpu-loong64.cc",
           "src/codegen/loong64/interface-descriptors-loong64-inl.h",
           "src/codegen/loong64/macro-assembler-loong64.cc",
    -      "src/compiler/backend/loong64/code-generator-loong64.cc",
    -      "src/compiler/backend/loong64/instruction-scheduler-loong64.cc",
    -      "src/compiler/backend/loong64/instruction-selector-loong64.cc",
           "src/deoptimizer/loong64/deoptimizer-loong64.cc",
           "src/diagnostics/loong64/disasm-loong64.cc",
           "src/diagnostics/loong64/unwinder-loong64.cc",
    @@ -5005,15 +5291,12 @@ v8_source_set("v8_base_without_compiler") {
           "src/regexp/loong64/regexp-macro-assembler-loong64.cc",
         ]
       } else if (v8_current_cpu == "ppc") {
    -    sources += [  ### gcmole(arch:ppc) ###
    +    sources += [
    +      ### gcmole(ppc) ###
           "src/codegen/ppc/assembler-ppc.cc",
           "src/codegen/ppc/constants-ppc.cc",
           "src/codegen/ppc/cpu-ppc.cc",
           "src/codegen/ppc/macro-assembler-ppc.cc",
    -      "src/compiler/backend/ppc/code-generator-ppc.cc",
    -      "src/compiler/backend/ppc/instruction-scheduler-ppc.cc",
    -      "src/compiler/backend/ppc/instruction-selector-ppc.cc",
    -      "src/compiler/backend/ppc/unwinding-info-writer-ppc.cc",
           "src/deoptimizer/ppc/deoptimizer-ppc.cc",
           "src/diagnostics/ppc/disasm-ppc.cc",
           "src/diagnostics/ppc/eh-frame-ppc.cc",
    @@ -5023,15 +5306,12 @@ v8_source_set("v8_base_without_compiler") {
           "src/regexp/ppc/regexp-macro-assembler-ppc.cc",
         ]
       } else if (v8_current_cpu == "ppc64") {
    -    sources += [  ### gcmole(arch:ppc64) ###
    +    sources += [
    +      ### gcmole(ppc64) ###
           "src/codegen/ppc/assembler-ppc.cc",
           "src/codegen/ppc/constants-ppc.cc",
           "src/codegen/ppc/cpu-ppc.cc",
           "src/codegen/ppc/macro-assembler-ppc.cc",
    -      "src/compiler/backend/ppc/code-generator-ppc.cc",
    -      "src/compiler/backend/ppc/instruction-scheduler-ppc.cc",
    -      "src/compiler/backend/ppc/instruction-selector-ppc.cc",
    -      "src/compiler/backend/ppc/unwinding-info-writer-ppc.cc",
           "src/deoptimizer/ppc/deoptimizer-ppc.cc",
           "src/diagnostics/ppc/disasm-ppc.cc",
           "src/diagnostics/ppc/eh-frame-ppc.cc",
    @@ -5041,15 +5321,12 @@ v8_source_set("v8_base_without_compiler") {
           "src/regexp/ppc/regexp-macro-assembler-ppc.cc",
         ]
       } else if (v8_current_cpu == "s390" || v8_current_cpu == "s390x") {
    -    sources += [  ### gcmole(arch:s390) ###
    +    sources += [
    +      ### gcmole(s390) ###
           "src/codegen/s390/assembler-s390.cc",
           "src/codegen/s390/constants-s390.cc",
           "src/codegen/s390/cpu-s390.cc",
           "src/codegen/s390/macro-assembler-s390.cc",
    -      "src/compiler/backend/s390/code-generator-s390.cc",
    -      "src/compiler/backend/s390/instruction-scheduler-s390.cc",
    -      "src/compiler/backend/s390/instruction-selector-s390.cc",
    -      "src/compiler/backend/s390/unwinding-info-writer-s390.cc",
           "src/deoptimizer/s390/deoptimizer-s390.cc",
           "src/diagnostics/s390/disasm-s390.cc",
           "src/diagnostics/s390/eh-frame-s390.cc",
    @@ -5059,7 +5336,8 @@ v8_source_set("v8_base_without_compiler") {
           "src/regexp/s390/regexp-macro-assembler-s390.cc",
         ]
       } else if (v8_current_cpu == "riscv64") {
    -    sources += [  ### gcmole(arch:riscv64) ###
    +    sources += [
    +      ### gcmole(riscv64) ###
           "src/codegen/riscv/assembler-riscv.cc",
           "src/codegen/riscv/base-assembler-riscv.cc",
           "src/codegen/riscv/base-constants-riscv.cc",
    @@ -5074,9 +5352,6 @@ v8_source_set("v8_base_without_compiler") {
           "src/codegen/riscv/extension-riscv-zicsr.cc",
           "src/codegen/riscv/extension-riscv-zifencei.cc",
           "src/codegen/riscv/macro-assembler-riscv.cc",
    -      "src/compiler/backend/riscv/code-generator-riscv.cc",
    -      "src/compiler/backend/riscv/instruction-scheduler-riscv.cc",
    -      "src/compiler/backend/riscv/instruction-selector-riscv64.cc",
           "src/deoptimizer/riscv/deoptimizer-riscv.cc",
           "src/diagnostics/riscv/disasm-riscv.cc",
           "src/diagnostics/riscv/unwinder-riscv.cc",
    @@ -5085,7 +5360,8 @@ v8_source_set("v8_base_without_compiler") {
           "src/regexp/riscv/regexp-macro-assembler-riscv.cc",
         ]
       } else if (v8_current_cpu == "riscv32") {
    -    sources += [  ### gcmole(arch:riscv32) ###
    +    sources += [
    +      ### gcmole(riscv32) ###
           "src/codegen/riscv/assembler-riscv.cc",
           "src/codegen/riscv/base-assembler-riscv.cc",
           "src/codegen/riscv/base-constants-riscv.cc",
    @@ -5100,9 +5376,6 @@ v8_source_set("v8_base_without_compiler") {
           "src/codegen/riscv/extension-riscv-zicsr.cc",
           "src/codegen/riscv/extension-riscv-zifencei.cc",
           "src/codegen/riscv/macro-assembler-riscv.cc",
    -      "src/compiler/backend/riscv/code-generator-riscv.cc",
    -      "src/compiler/backend/riscv/instruction-scheduler-riscv.cc",
    -      "src/compiler/backend/riscv/instruction-selector-riscv32.cc",
           "src/deoptimizer/riscv/deoptimizer-riscv.cc",
           "src/diagnostics/riscv/disasm-riscv.cc",
           "src/diagnostics/riscv/unwinder-riscv.cc",
    @@ -5152,7 +5425,7 @@ v8_source_set("v8_base_without_compiler") {
         deps += [ ":run_gen-regexp-special-case" ]
         sources += [ "$target_gen_dir/src/regexp/special-case.cc" ]
         if (is_win) {
    -      deps += [ "//third_party/icu:icudata" ]
    +      deps += [ "$v8_icu_path:icudata" ]
         }
       } else {
         sources -= [
    @@ -5178,8 +5451,8 @@ v8_source_set("v8_base_without_compiler") {
     
       if (v8_use_zlib) {
         deps += [
    -      "//third_party/zlib",
    -      "//third_party/zlib/google:compression_utils_portable",
    +      "$v8_zlib_path",
    +      "$v8_zlib_path/google:compression_utils_portable",
         ]
       }
     
    @@ -5223,8 +5496,11 @@ group("v8_base") {
       public_deps = [
         ":v8_base_without_compiler",
         ":v8_compiler",
    -    ":v8_turboshaft",
       ]
    +
    +  if (v8_enable_turbofan) {
    +    public_deps += [ ":v8_turboshaft" ]
    +  }
     }
     
     v8_source_set("torque_base") {
    @@ -5240,7 +5516,6 @@ v8_source_set("torque_base") {
         "src/torque/cfg.h",
         "src/torque/class-debug-reader-generator.cc",
         "src/torque/constants.h",
    -    "src/torque/contextual.h",
         "src/torque/cpp-builder.cc",
         "src/torque/cpp-builder.h",
         "src/torque/csa-generator.cc",
    @@ -5370,6 +5645,7 @@ v8_component("v8_libbase") {
         "src/base/build_config.h",
         "src/base/compiler-specific.h",
         "src/base/container-utils.h",
    +    "src/base/contextual.h",
         "src/base/cpu.cc",
         "src/base/cpu.h",
         "src/base/debug/stack_trace.cc",
    @@ -5427,6 +5703,7 @@ v8_component("v8_libbase") {
         "src/base/platform/memory.h",
         "src/base/platform/mutex.cc",
         "src/base/platform/mutex.h",
    +    "src/base/platform/platform.cc",
         "src/base/platform/platform.h",
         "src/base/platform/semaphore.cc",
         "src/base/platform/semaphore.h",
    @@ -5528,7 +5805,6 @@ v8_component("v8_libbase") {
             sources += [
               "src/base/debug/stack_trace_posix.cc",
               "src/base/platform/platform-darwin.cc",
    -          "src/base/platform/platform-macos.cc",
             ]
           } else {
             sources += [
    @@ -5556,12 +5832,12 @@ v8_component("v8_libbase") {
         sources += [
           "src/base/debug/stack_trace_posix.cc",
           "src/base/platform/platform-darwin.cc",
    -      "src/base/platform/platform-macos.cc",
         ]
       } else if (is_ios) {
         sources += [
           "src/base/debug/stack_trace_posix.cc",
           "src/base/platform/platform-darwin.cc",
    +      "src/base/platform/platform-ios.cc",
         ]
       } else if (is_win) {
         # TODO(infra): Add support for cygwin.
    @@ -5612,9 +5888,35 @@ v8_component("v8_libbase") {
             [ "//build/config/clang:llvm-symbolizer_data($host_toolchain)" ]
       }
     
    +  if (v8_use_libm_trig_functions) {
    +    deps += [ ":libm" ]
    +  }
    +
       # TODO(infra): Add support for qnx, freebsd, openbsd, netbsd, and solaris.
     }
     
    +if (v8_use_libm_trig_functions) {
    +  source_set("libm") {
    +    sources = [
    +      "third_party/glibc/src/sysdeps/ieee754/dbl-64/branred.c",
    +      "third_party/glibc/src/sysdeps/ieee754/dbl-64/branred.h",
    +      "third_party/glibc/src/sysdeps/ieee754/dbl-64/dla.h",
    +      "third_party/glibc/src/sysdeps/ieee754/dbl-64/endian.h",
    +      "third_party/glibc/src/sysdeps/ieee754/dbl-64/mydefs.h",
    +      "third_party/glibc/src/sysdeps/ieee754/dbl-64/s_sin.c",
    +      "third_party/glibc/src/sysdeps/ieee754/dbl-64/sincostab.c",
    +      "third_party/glibc/src/sysdeps/ieee754/dbl-64/trig.h",
    +      "third_party/glibc/src/sysdeps/ieee754/dbl-64/usncs.h",
    +    ]
    +    configs += [ "//build/config/compiler:no_chromium_code" ]
    +    configs -= [ "//build/config/compiler:chromium_code" ]
    +    if (!is_debug) {
    +      # Build code using -O3, see: crbug.com/1084371.
    +      configs += [ "//build/config/compiler:optimize_speed" ]
    +    }
    +  }
    +}
    +
     v8_component("v8_libplatform") {
       sources = [
         "//base/trace_event/common/trace_event_common.h",
    @@ -5764,31 +6066,31 @@ v8_source_set("v8_heap_base") {
     
       if (is_clang || !is_win) {
         if (current_cpu == "x64") {
    -      sources += [ "src/heap/base/asm/x64/save_registers_asm.cc" ]
    +      sources += [ "src/heap/base/asm/x64/push_registers_asm.cc" ]
         } else if (current_cpu == "x86") {
    -      sources += [ "src/heap/base/asm/ia32/save_registers_asm.cc" ]
    +      sources += [ "src/heap/base/asm/ia32/push_registers_asm.cc" ]
         } else if (current_cpu == "arm") {
    -      sources += [ "src/heap/base/asm/arm/save_registers_asm.cc" ]
    +      sources += [ "src/heap/base/asm/arm/push_registers_asm.cc" ]
         } else if (current_cpu == "arm64") {
    -      sources += [ "src/heap/base/asm/arm64/save_registers_asm.cc" ]
    +      sources += [ "src/heap/base/asm/arm64/push_registers_asm.cc" ]
         } else if (current_cpu == "ppc64") {
    -      sources += [ "src/heap/base/asm/ppc/save_registers_asm.cc" ]
    +      sources += [ "src/heap/base/asm/ppc/push_registers_asm.cc" ]
         } else if (current_cpu == "s390x") {
    -      sources += [ "src/heap/base/asm/s390/save_registers_asm.cc" ]
    +      sources += [ "src/heap/base/asm/s390/push_registers_asm.cc" ]
         } else if (current_cpu == "mips64el") {
    -      sources += [ "src/heap/base/asm/mips64/save_registers_asm.cc" ]
    +      sources += [ "src/heap/base/asm/mips64/push_registers_asm.cc" ]
         } else if (current_cpu == "loong64") {
    -      sources += [ "src/heap/base/asm/loong64/save_registers_asm.cc" ]
    +      sources += [ "src/heap/base/asm/loong64/push_registers_asm.cc" ]
         } else if (current_cpu == "riscv64" || current_cpu == "riscv32") {
    -      sources += [ "src/heap/base/asm/riscv/save_registers_asm.cc" ]
    +      sources += [ "src/heap/base/asm/riscv/push_registers_asm.cc" ]
         }
       } else if (is_win) {
         if (current_cpu == "x64") {
    -      sources += [ "src/heap/base/asm/x64/save_registers_masm.asm" ]
    +      sources += [ "src/heap/base/asm/x64/push_registers_masm.asm" ]
         } else if (current_cpu == "x86") {
    -      sources += [ "src/heap/base/asm/ia32/save_registers_masm.asm" ]
    +      sources += [ "src/heap/base/asm/ia32/push_registers_masm.asm" ]
         } else if (current_cpu == "arm64") {
    -      sources += [ "src/heap/base/asm/arm64/save_registers_masm.S" ]
    +      sources += [ "src/heap/base/asm/arm64/push_registers_masm.S" ]
         }
       }
     
    @@ -6033,11 +6335,12 @@ if (v8_check_header_includes) {
     #
     
     if (v8_monolithic) {
    -  # A component build is not monolithic.
    -  assert(!is_component_build)
    +  assert(!is_component_build,
    +         "Set `is_component_build = false` for v8_monolithic.")
     
       # Using external startup data would produce separate files.
    -  assert(!v8_use_external_startup_data)
    +  assert(!v8_use_external_startup_data,
    +         "Set `v8_use_external_startup_data = false` for v8_monolithic.")
       v8_static_library("v8_monolith") {
         deps = [
           ":v8",
    @@ -6124,6 +6427,8 @@ if (current_toolchain == v8_snapshot_toolchain) {
           "src/snapshot/embedded/platform-embedded-file-writer-win.h",
           "src/snapshot/mksnapshot.cc",
           "src/snapshot/snapshot-empty.cc",
    +      "src/snapshot/static-roots-gen.cc",
    +      "src/snapshot/static-roots-gen.h",
         ]
     
         if (v8_control_flow_integrity) {
    @@ -6222,7 +6527,7 @@ if (v8_enable_i18n_support) {
             ":v8_libbase",
             ":v8_shared_internal_headers",
             "//build/win:default_exe_manifest",
    -        "//third_party/icu",
    +        v8_icu_path,
           ]
     
           configs = [ ":internal_config" ]
    @@ -6402,10 +6707,14 @@ if (is_component_build) {
           ":torque_ls_base",
           ":v8_base",
           ":v8_headers",
    -      ":v8_initializers",
           ":v8_snapshot",
         ]
     
    +    if (v8_enable_turbofan) {
    +      # For cctest/test-serialize.
    +      public_deps += [ ":v8_initializers" ]
    +    }
    +
         configs = [ ":internal_config" ]
     
         public_configs = [ ":external_config" ]
    @@ -6458,10 +6767,14 @@ if (is_component_build) {
           ":torque_base",
           ":torque_ls_base",
           ":v8_base",
    -      ":v8_initializers",
           ":v8_snapshot",
         ]
     
    +    if (v8_enable_turbofan) {
    +      # For cctest/test-serialize.
    +      public_deps += [ ":v8_initializers" ]
    +    }
    +
         public_configs = [ ":external_config" ]
       }
     
    diff --git a/deps/v8/DEPS b/deps/v8/DEPS
    index ab0a9bf5431112..05b32b571c84e2 100644
    --- a/deps/v8/DEPS
    +++ b/deps/v8/DEPS
    @@ -30,8 +30,18 @@ vars = {
     
       'checkout_instrumented_libraries': False,
       'checkout_ittapi': False,
    +
    +  # Fetch the prebuilt binaries for llvm-cov and llvm-profdata. Needed to
    +  # process the raw profiles produced by instrumented targets (built with
    +  # the gn arg 'use_clang_coverage').
    +  'checkout_clang_coverage_tools': False,
    +
       # Fetch clang-tidy into the same bin/ directory as our clang binary.
       'checkout_clang_tidy': False,
    +
    +  # Fetch and build V8 builtins with PGO profiles
    +  'checkout_v8_builtins_pgo_profiles': False,
    +
       'chromium_url': 'https://chromium.googlesource.com',
       'android_url': 'https://android.googlesource.com',
       'download_gcmole': False,
    @@ -43,22 +53,22 @@ vars = {
       'fuchsia_sdk_cipd_prefix': 'fuchsia/sdk/gn/',
     
       # reclient CIPD package version
    -  'reclient_version': 're_client_version:0.83.0.da55f4f-gomaip',
    +  'reclient_version': 're_client_version:0.99.0.3f95625-gomaip',
     
       # GN CIPD package version.
    -  'gn_version': 'git_revision:a4d67be044b42963de801001e7146f9657c7fad4',
    +  'gn_version': 'git_revision:41fef642de70ecdcaaa26be96d56a0398f95abd4',
     
       # ninja CIPD package version
       # https://chrome-infra-packages.appspot.com/p/infra/3pp/tools/ninja
    -  'ninja_version': 'version:2@1.8.2.chromium.3',
    +  'ninja_version': 'version:2@1.11.1.chromium.6',
     
       # luci-go CIPD package version.
    -  'luci_go': 'git_revision:f8f64a8c560d2bf68a3ad1137979d17cffb36d30',
    +  'luci_go': 'git_revision:320bf3ed60cd4d24549d0ea9ee3a94394f2665ce',
     
       # Three lines of non-changing comments so that
       # the commit queue can handle CLs rolling Fuchsia sdk
       # and whatever else without interference from each other.
    -  'fuchsia_version': 'version:10.20221109.1.1',
    +  'fuchsia_version': 'version:12.20230322.3.1',
     
       # Three lines of non-changing comments so that
       # the commit queue can handle CLs rolling android_sdk_build-tools_version
    @@ -91,18 +101,18 @@ vars = {
       # Three lines of non-changing comments so that
       # the commit queue can handle CLs rolling android_sdk_tools-lint_version
       # and whatever else without interference from each other.
    -  'android_sdk_cmdline-tools_version': 'IPzAG-uU5zVMxohpg9-7-N0tQC1TCSW1VbrBFw7Ld04C',
    +  'android_sdk_cmdline-tools_version': '3Yn5Sn7BMObm8gsoZCF0loJMKg9_PpgU07G9DObCLdQC',
     }
     
     deps = {
       'base/trace_event/common':
    -    Var('chromium_url') + '/chromium/src/base/trace_event/common.git' + '@' + '521ac34ebd795939c7e16b37d9d3ddb40e8ed556',
    +    Var('chromium_url') + '/chromium/src/base/trace_event/common.git' + '@' + '147f65333c38ddd1ebf554e89965c243c8ce50b3',
       'build':
    -    Var('chromium_url') + '/chromium/src/build.git' + '@' + '875cb19167f2e0d7b1eca89a4d5b5693421424c6',
    +    Var('chromium_url') + '/chromium/src/build.git' + '@' + '9e9a4341dd24e68cba0f228567a6edbaff1c665b',
       'buildtools':
    -    Var('chromium_url') + '/chromium/src/buildtools.git' + '@' + '49ac7cf34ab2e59a10629a7a722cfb94348c4996',
    +    Var('chromium_url') + '/chromium/src/buildtools.git' + '@' + '0a6c69640f1841d9109eac70a25af310d4c1d8c7',
       'buildtools/clang_format/script':
    -    Var('chromium_url') + '/external/github.com/llvm/llvm-project/clang/tools/clang-format.git' + '@' + '8b525d2747f2584fc35d8c7e612e66f377858df7',
    +    Var('chromium_url') + '/external/github.com/llvm/llvm-project/clang/tools/clang-format.git' + '@' + 'f97059df7f8b205064625cdb5f97b56668a125ef',
       'buildtools/linux64': {
         'packages': [
           {
    @@ -124,11 +134,11 @@ deps = {
         'condition': 'host_os == "mac"',
       },
       'buildtools/third_party/libc++/trunk':
    -    Var('chromium_url') + '/external/github.com/llvm/llvm-project/libcxx.git' + '@' + '4218f3525ad438b22b0e173d963515a09d143398',
    +    Var('chromium_url') + '/external/github.com/llvm/llvm-project/libcxx.git' + '@' + 'e44019bfac2b2d3ebe1618628884f85c8600e322',
       'buildtools/third_party/libc++abi/trunk':
    -    Var('chromium_url') + '/external/github.com/llvm/llvm-project/libcxxabi.git' + '@' + '1a32724f721e1c3b6c590a07fe4a954344f15e48',
    +    Var('chromium_url') + '/external/github.com/llvm/llvm-project/libcxxabi.git' + '@' + '9643f2cf13d6935a84a30b7da7de53327733e190',
       'buildtools/third_party/libunwind/trunk':
    -    Var('chromium_url') + '/external/github.com/llvm/llvm-project/libunwind.git' + '@' + 'a318d6a4c283a9d342d2a1e20292c1496fe12997',
    +    Var('chromium_url') + '/external/github.com/llvm/llvm-project/libunwind.git' + '@' + '29a6dda8c6588ba4abeafdb21be531e757983e31',
       'buildtools/win': {
         'packages': [
           {
    @@ -147,14 +157,14 @@ deps = {
           }
         ],
         'dep_type': 'cipd',
    -    'condition': '(host_os == "linux" or host_os == "mac" or host_os == "win") and host_cpu != "s390" and host_cpu != "ppc"',
    +    'condition': '(host_os == "linux" or host_os == "mac" or host_os == "win") and host_cpu != "s390" and host_cpu != "ppc" and host_cpu != "arm64"',
       },
       'test/benchmarks/data':
         Var('chromium_url') + '/v8/deps/third_party/benchmarks.git' + '@' + '05d7188267b4560491ff9155c5ee13e207ecd65f',
       'test/mozilla/data':
         Var('chromium_url') + '/v8/deps/third_party/mozilla-tests.git' + '@' + 'f6c578a10ea707b1a8ab0b88943fe5115ce2b9be',
       'test/test262/data':
    -    Var('chromium_url') + '/external/github.com/tc39/test262.git' + '@' + 'ade328d530525333751e8a3b58f02e18624da085',
    +    Var('chromium_url') + '/external/github.com/tc39/test262.git' + '@' + 'd216cc197269fc41eb6eca14710529c3d6650535',
       'third_party/android_ndk': {
         'url': Var('chromium_url') + '/android_ndk.git' + '@' + '8388a2be5421311dc75c5f937aae13d821a27f3d',
         'condition': 'checkout_android',
    @@ -202,15 +212,15 @@ deps = {
           'dep_type': 'cipd',
       },
       'third_party/catapult': {
    -    'url': Var('chromium_url') + '/catapult.git' + '@' + 'f0b11967c94cba8f7cca91d2da20c98d4420fc25',
    +    'url': Var('chromium_url') + '/catapult.git' + '@' + '018d397758e54d6a6d3b6ddf28a1784664d63f83',
         'condition': 'checkout_android',
       },
       'third_party/colorama/src': {
    -    'url': Var('chromium_url') + '/external/colorama.git' + '@' + '799604a1041e9b3bc5d2789ecbd7e8db2e18e6b8',
    +    'url': Var('chromium_url') + '/external/colorama.git' + '@' + '3de9f013df4b470069d03d250224062e8cf15c49',
         'condition': 'checkout_android',
       },
       'third_party/depot_tools':
    -    Var('chromium_url') + '/chromium/tools/depot_tools.git' + '@' + 'ae1a70891738fb14f64fbb884e00b87ac663aa15',
    +    Var('chromium_url') + '/chromium/tools/depot_tools.git' + '@' + '479e1e9055020c8d1351bf2194d0a606aeca93d5',
       'third_party/fuchsia-sdk/sdk': {
         'packages': [
             {
    @@ -227,9 +237,9 @@ deps = {
       'third_party/googletest/src':
         Var('chromium_url') + '/external/github.com/google/googletest.git' + '@' + 'af29db7ec28d6df1c7f0f745186884091e602e07',
       'third_party/icu':
    -    Var('chromium_url') + '/chromium/deps/icu.git' + '@' + 'da07448619763d1cde255b361324242646f5b268',
    +    Var('chromium_url') + '/chromium/deps/icu.git' + '@' + '1e49ac26ddc712b1ab702f69023cbc57e9ae6628',
       'third_party/instrumented_libraries':
    -    Var('chromium_url') + '/chromium/src/third_party/instrumented_libraries.git' + '@' + '7bb87a375ffc3effd17a50f690099dcfb9ee280b',
    +    Var('chromium_url') + '/chromium/src/third_party/instrumented_libraries.git' + '@' + '0f536d22dbed454b1254c7e6d7130eab28fba1fa',
       'third_party/ittapi': {
         # Force checkout ittapi libraries to pass v8 header includes check on
         # bots that has check_v8_header_includes enabled.
    @@ -237,7 +247,7 @@ deps = {
         'condition': "checkout_ittapi or check_v8_header_includes",
       },
       'third_party/jinja2':
    -    Var('chromium_url') + '/chromium/src/third_party/jinja2.git' + '@' + '4633bf431193690c3491244f5a0acbe9ac776233',
    +    Var('chromium_url') + '/chromium/src/third_party/jinja2.git' + '@' + '264c07d7e64f2874434a3b8039e101ddf1b01e7e',
       'third_party/jsoncpp/source':
         Var('chromium_url') + '/external/github.com/open-source-parsers/jsoncpp.git'+ '@' + '42e892d96e47b1f6e29844cc705e148ec4856448',
       'third_party/logdog/logdog':
    @@ -255,7 +265,7 @@ deps = {
         'condition': 'host_cpu != "s390" and host_cpu != "ppc"'
       },
       'third_party/perfetto':
    -    Var('android_url') + '/platform/external/perfetto.git' + '@' + '0eba417b2c72264fa825dc21067b9adc9b8adf70',
    +    Var('android_url') + '/platform/external/perfetto.git' + '@' + '0d180f46481a96cbe8340734fa5cdce3bba636c8',
       'third_party/protobuf':
         Var('chromium_url') + '/external/github.com/google/protobuf'+ '@' + '6a59a2ad1f61d9696092f79b6d74368b4d7970a3',
       'third_party/requests': {
    @@ -263,9 +273,9 @@ deps = {
           'condition': 'checkout_android',
       },
       'third_party/zlib':
    -    Var('chromium_url') + '/chromium/src/third_party/zlib.git'+ '@' + '8bbd6c3129b5146489f2321f054e855c347857f4',
    +    Var('chromium_url') + '/chromium/src/third_party/zlib.git'+ '@' + '5edb52d4302d7aef232d585ec9ae27ef5c3c5438',
       'tools/clang':
    -    Var('chromium_url') + '/chromium/src/tools/clang.git' + '@' + 'd3df9cc5362e0af4cda798b0612dde39783b3dc0',
    +    Var('chromium_url') + '/chromium/src/tools/clang.git' + '@' + '7a7207a7f2eb0f7f5c9f304a51077a2fd504b3ed',
       'tools/luci-go': {
           'packages': [
             {
    @@ -499,7 +509,7 @@ hooks = [
                    '--arch=x64'],
       },
       {
    -    'name': 'msan_chained_origins',
    +    'name': 'msan_chained_origins_focal',
         'pattern': '.',
         'condition': 'checkout_instrumented_libraries',
         'action': [ 'python3',
    @@ -507,11 +517,11 @@ hooks = [
                     '--no_resume',
                     '--no_auth',
                     '--bucket', 'chromium-instrumented-libraries',
    -                '-s', 'third_party/instrumented_libraries/binaries/msan-chained-origins.tgz.sha1',
    +                '-s', 'third_party/instrumented_libraries/binaries/msan-chained-origins-focal.tgz.sha1',
                   ],
       },
       {
    -    'name': 'msan_no_origins',
    +    'name': 'msan_no_origins_focal',
         'pattern': '.',
         'condition': 'checkout_instrumented_libraries',
         'action': [ 'python3',
    @@ -519,7 +529,7 @@ hooks = [
                     '--no_resume',
                     '--no_auth',
                     '--bucket', 'chromium-instrumented-libraries',
    -                '-s', 'third_party/instrumented_libraries/binaries/msan-no-origins.tgz.sha1',
    +                '-s', 'third_party/instrumented_libraries/binaries/msan-no-origins-focal.tgz.sha1',
                   ],
       },
       {
    @@ -557,6 +567,14 @@ hooks = [
         'condition': 'host_os != "aix"',
         'action': ['python3', 'tools/clang/scripts/update.py'],
       },
    +  {
    +    # This is supposed to support the same set of platforms as 'clang' above.
    +    'name': 'clang_coverage',
    +    'pattern': '.',
    +    'condition': 'checkout_clang_coverage_tools',
    +    'action': ['python3', 'tools/clang/scripts/update.py',
    +               '--package=coverage_tools'],
    +  },
       {
         'name': 'clang_tidy',
         'pattern': '.',
    @@ -606,6 +624,16 @@ hooks = [
           'tools/generate-header-include-checks.py',
         ],
       },
    +  {
    +    'name': 'checkout_v8_builtins_pgo_profiles',
    +    'pattern': '.',
    +    'condition': 'checkout_v8_builtins_pgo_profiles',
    +    'action': [
    +      'python3',
    +      'tools/builtins-pgo/download_profiles.py',
    +      'download',
    +    ],
    +  },
       {
         # Clean up build dirs for crbug.com/1337238.
         # After a libc++ roll and revert, .ninja_deps would get into a state
    diff --git a/deps/v8/PPC_OWNERS b/deps/v8/PPC_OWNERS
    index 02c2cd757c9cb7..6edd45a6ef2e04 100644
    --- a/deps/v8/PPC_OWNERS
    +++ b/deps/v8/PPC_OWNERS
    @@ -2,4 +2,3 @@ junyan@redhat.com
     joransiu@ca.ibm.com
     midawson@redhat.com
     mfarazma@redhat.com
    -vasili.skurydzin@ibm.com
    diff --git a/deps/v8/PRESUBMIT.py b/deps/v8/PRESUBMIT.py
    index 03db4c126f346d..5c31d4dfabd776 100644
    --- a/deps/v8/PRESUBMIT.py
    +++ b/deps/v8/PRESUBMIT.py
    @@ -85,6 +85,7 @@ def _V8PresubmitChecks(input_api, output_api):
       sys.path.append(input_api.os_path.join(
             input_api.PresubmitLocalPath(), 'tools'))
       from v8_presubmit import CppLintProcessor
    +  from v8_presubmit import GCMoleProcessor
       from v8_presubmit import JSLintProcessor
       from v8_presubmit import TorqueLintProcessor
       from v8_presubmit import SourceProcessor
    @@ -126,6 +127,9 @@ def FilterJSFile(affected_file):
       if not StatusFilesProcessor().RunOnFiles(
           input_api.AffectedFiles(include_deletes=True)):
         results.append(output_api.PresubmitError("Status file check failed"))
    +  if not GCMoleProcessor().RunOnFiles(
    +      input_api.AffectedFiles(include_deletes=False)):
    +    results.append(output_api.PresubmitError("GCMole pattern check failed"))
       results.extend(input_api.canned_checks.CheckAuthorizedAuthor(
           input_api, output_api, bot_allowlist=[
             'v8-ci-autoroll-builder@chops-service-accounts.iam.gserviceaccount.com'
    @@ -257,8 +261,9 @@ def FilterFile(affected_file):
           files_to_check=(file_inclusion_pattern, ),
           files_to_skip=files_to_skip)
     
    -  leading_src_pattern = input_api.re.compile(r'^src/')
    -  dash_dot_slash_pattern = input_api.re.compile(r'[-./]')
    +  leading_src_pattern = input_api.re.compile(r'^src[\\\/]')
    +  dash_dot_slash_pattern = input_api.re.compile(r'[-.\\\/]')
    +
       def PathToGuardMacro(path):
         """Guards should be of the form V8_PATH_TO_FILE_WITHOUT_SRC_H_."""
         x = input_api.re.sub(leading_src_pattern, 'v8_', path)
    diff --git a/deps/v8/S390_OWNERS b/deps/v8/S390_OWNERS
    index 02c2cd757c9cb7..6edd45a6ef2e04 100644
    --- a/deps/v8/S390_OWNERS
    +++ b/deps/v8/S390_OWNERS
    @@ -2,4 +2,3 @@ junyan@redhat.com
     joransiu@ca.ibm.com
     midawson@redhat.com
     mfarazma@redhat.com
    -vasili.skurydzin@ibm.com
    diff --git a/deps/v8/WATCHLISTS b/deps/v8/WATCHLISTS
    index a078c5568e4707..d853a0de2a2e36 100644
    --- a/deps/v8/WATCHLISTS
    +++ b/deps/v8/WATCHLISTS
    @@ -101,11 +101,16 @@
                       '|test/unittests/heap/cppgc/' \
                       '|test/unittests/heap/cppgc-js/',
         },
    +    'trap-handler': {
    +      'filepath': 'src/trap-handler/',
    +    },
    +    'tests': {
    +      'filepath': 'test/',
    +    },
       },
     
       'WATCHLISTS': {
         'maglev': [
    -      'jgruber+watch@chromium.org',
           'leszeks+watch@chromium.org',
           'verwaest+watch@chromium.org',
           'victorgomes+watch@chromium.org',
    @@ -122,6 +127,7 @@
         ],
         'feature_shipping_status': [
           'hablich@chromium.org',
    +      'saelo+watch@chromium.org',
         ],
         'heap_changes': [
           'hpayer@chromium.org',
    @@ -168,5 +174,14 @@
         'cppgc': [
           'oilpan-reviews+v8@chromium.org',
         ],
    +    'trap-handler': [
    +      'ahaas@chromium.org',
    +      'clemensb@chromium.org',
    +      'mark@chromium.org',
    +      'mseaborn@chromium.org',
    +    ],
    +    'tests': [
    +      'almuthanna+watch@chromium.org',
    +    ],
       },
     }
    diff --git a/deps/v8/base/trace_event/common/trace_event_common.h b/deps/v8/base/trace_event/common/trace_event_common.h
    index f07f19b3095f57..f2ee4d36b317db 100644
    --- a/deps/v8/base/trace_event/common/trace_event_common.h
    +++ b/deps/v8/base/trace_event/common/trace_event_common.h
    @@ -208,9 +208,6 @@
     #include "base/time/time.h"
     #include "build/build_config.h"
     
    -// Export Perfetto symbols in the same way as //base symbols.
    -#define PERFETTO_COMPONENT_EXPORT BASE_EXPORT
    -
     // Enable legacy trace event macros (e.g., TRACE_EVENT{0,1,2}).
     #define PERFETTO_ENABLE_LEGACY_TRACE_EVENTS 1
     
    @@ -224,11 +221,6 @@
     // variable a unique name based on the line number to prevent name collisions.
     #define INTERNAL_TRACE_EVENT_UID(name_prefix) PERFETTO_UID(name_prefix)
     
    -// Special trace event macro to trace log messages.
    -// TODO(skyostil): Convert this into a regular typed trace event.
    -#define TRACE_LOG_MESSAGE(file, message, line) \
    -  INTERNAL_TRACE_LOG_MESSAGE(file, message, line)
    -
     // Declare debug annotation converters for base time types, so they can be
     // passed as trace event arguments.
     // TODO(skyostil): Serialize timestamps using perfetto::TracedValue instead.
    @@ -250,7 +242,8 @@ WriteDebugAnnotation(protos::pbzero::DebugAnnotation* annotation, ::base::Time);
     }  // namespace perfetto
     
     // Pull in the tracing macro definitions from Perfetto.
    -#include "third_party/perfetto/include/perfetto/tracing.h"
    +#include "third_party/perfetto/include/perfetto/tracing/track_event.h"
    +#include "third_party/perfetto/include/perfetto/tracing/track_event_legacy.h"
     
     namespace perfetto {
     namespace legacy {
    @@ -983,10 +976,6 @@ struct BASE_EXPORT TraceTimestampTraits<::base::TimeTicks> {
                                        category_group, name, id,             \
                                        TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val)
     
    -// Special trace event macro to trace log messages.
    -#define TRACE_LOG_MESSAGE(file, message, line) \
    -  INTERNAL_TRACE_LOG_MESSAGE(file, message, line)
    -
     // TRACE_EVENT_METADATA* events are information related to other
     // injected events, not events in their own right.
     #define TRACE_EVENT_METADATA1(category_group, name, arg1_name, arg1_val) \
    diff --git a/deps/v8/bazel/config/BUILD.bazel b/deps/v8/bazel/config/BUILD.bazel
    index 448260de88465d..67454fa90eea46 100644
    --- a/deps/v8/bazel/config/BUILD.bazel
    +++ b/deps/v8/bazel/config/BUILD.bazel
    @@ -22,6 +22,13 @@ config_setting(
         },
     )
     
    +config_setting(
    +    name = "is_opt",
    +    values = {
    +        "compilation_mode": "opt",
    +    },
    +)
    +
     config_setting(
         name = "is_debug",
         values = {
    @@ -29,6 +36,14 @@ config_setting(
         },
     )
     
    +selects.config_setting_group(
    +    name = "is_opt_android",
    +    match_all = [
    +        ":is_opt",
    +        ":is_android",
    +    ],
    +)
    +
     config_setting(
         name = "platform_cpu_x64",
         constraint_values = ["@platforms//cpu:x86_64"],
    diff --git a/deps/v8/bazel/defs.bzl b/deps/v8/bazel/defs.bzl
    index 77e86ef6f2e646..d4ff96887e7ca7 100644
    --- a/deps/v8/bazel/defs.bzl
    +++ b/deps/v8/bazel/defs.bzl
    @@ -2,7 +2,12 @@
     # Use of this source code is governed by a BSD-style license that can be
     # found in the LICENSE file.
     
    -FlagInfo = provider(fields = ["value"])
    +"""
    +This module contains helper functions to compile V8.
    +"""
    +
    +FlagInfo = provider("The value of an option.",
    +fields = ["value"])
     
     def _options_impl(ctx):
         return FlagInfo(value = ctx.build_setting_value)
    @@ -151,6 +156,13 @@ def _default_args():
                     "-fno-integrated-as",
                 ],
                 "//conditions:default": [],
    +        }) +  select({
    +            "@v8//bazel/config:is_opt_android": [
    +                "-fvisibility=hidden",
    +                "-fvisibility-inlines-hidden",
    +            ],
    +            "//conditions:default": [
    +            ],
             }),
             includes = ["include"],
             linkopts = select({
    @@ -175,29 +187,33 @@ ENABLE_I18N_SUPPORT_DEFINES = [
         "-DUNISTR_FROM_CHAR_EXPLICIT=",
     ]
     
    -def _should_emit_noicu_and_icu(noicu_srcs, noicu_deps, icu_srcs, icu_deps):
    -    return noicu_srcs != [] or noicu_deps != [] or icu_srcs != [] or icu_deps != []
    +def _should_emit_noicu_and_icu(noicu_srcs, noicu_deps, noicu_defines, icu_srcs, icu_deps, icu_defines):
    +     return noicu_srcs != [] or noicu_deps != [] or noicu_defines != [] or icu_srcs != [] or icu_deps != [] or icu_defines != []
     
     # buildifier: disable=function-docstring
     def v8_binary(
             name,
             srcs,
             deps = [],
    +        defines = [],
             includes = [],
             copts = [],
             linkopts = [],
             noicu_srcs = [],
             noicu_deps = [],
    +        noicu_defines = [],
             icu_srcs = [],
             icu_deps = [],
    +        icu_defines = [],
             **kwargs):
         default = _default_args()
    -    if _should_emit_noicu_and_icu(noicu_srcs, noicu_deps, icu_srcs, icu_deps):
    +    if _should_emit_noicu_and_icu(noicu_srcs, noicu_deps, noicu_defines, icu_srcs, icu_deps, icu_defines):
             native.cc_binary(
                 name = "noicu/" + name,
                 srcs = srcs + noicu_srcs,
                 deps = deps + noicu_deps + default.deps,
    -            includes = includes + default.includes,
    +            defines = defines + noicu_defines + default.defines,
    +            includes = includes + ["noicu/"] + default.includes,
                 copts = copts + default.copts,
                 linkopts = linkopts + default.linkopts,
                 **kwargs
    @@ -206,7 +222,8 @@ def v8_binary(
                 name = "icu/" + name,
                 srcs = srcs + icu_srcs,
                 deps = deps + icu_deps + default.deps,
    -            includes = includes + default.includes,
    +            includes = includes + ["icu/"] + default.includes,
    +            defines = defines + icu_defines + default.defines,
                 copts = copts + default.copts + ENABLE_I18N_SUPPORT_DEFINES,
                 linkopts = linkopts + default.linkopts,
                 **kwargs
    @@ -216,6 +233,7 @@ def v8_binary(
                 name = name,
                 srcs = srcs,
                 deps = deps + default.deps,
    +            defines = defines + default.defines,
                 includes = includes + default.includes,
                 copts = copts + default.copts,
                 linkopts = linkopts + default.linkopts,
    @@ -232,16 +250,18 @@ def v8_library(
             linkopts = [],
             noicu_srcs = [],
             noicu_deps = [],
    +        noicu_defines = [],
             icu_srcs = [],
             icu_deps = [],
    +        icu_defines = [],
             **kwargs):
         default = _default_args()
    -    if _should_emit_noicu_and_icu(noicu_srcs, noicu_deps, icu_srcs, icu_deps):
    +    if _should_emit_noicu_and_icu(noicu_srcs, noicu_deps, noicu_defines, icu_srcs, icu_deps, icu_defines):
             native.cc_library(
                 name = name + "_noicu",
                 srcs = srcs + noicu_srcs,
                 deps = deps + noicu_deps + default.deps,
    -            includes = includes + default.includes,
    +            includes = includes + ["noicu/"] + default.includes,
                 copts = copts + default.copts,
                 linkopts = linkopts + default.linkopts,
                 alwayslink = 1,
    @@ -260,7 +280,7 @@ def v8_library(
                 name = name + "_icu",
                 srcs = srcs + icu_srcs,
                 deps = deps + icu_deps + default.deps,
    -            includes = includes + default.includes,
    +            includes = includes + ["icu/"] + default.includes,
                 copts = copts + default.copts + ENABLE_I18N_SUPPORT_DEFINES,
                 linkopts = linkopts + default.linkopts,
                 alwayslink = 1,
    @@ -288,7 +308,7 @@ def v8_library(
                 **kwargs
             )
     
    -def _torque_impl(ctx):
    +def _torque_initializers_impl(ctx):
         if ctx.workspace_name == "v8":
             v8root = "."
         else:
    @@ -309,7 +329,7 @@ def _torque_impl(ctx):
         # Generate/declare output files
         outs = []
         for src in ctx.files.srcs:
    -        root, period, ext = src.path.rpartition(".")
    +        root, _period, _ext = src.path.rpartition(".")
     
             # Strip v8root
             if root[:len(v8root)] == v8root:
    @@ -317,6 +337,84 @@ def _torque_impl(ctx):
             file = ctx.attr.prefix + "/torque-generated/" + root
             outs.append(ctx.actions.declare_file(file + "-tq-csa.cc"))
             outs.append(ctx.actions.declare_file(file + "-tq-csa.h"))
    +    outs += [ctx.actions.declare_file(ctx.attr.prefix + "/torque-generated/" + f) for f in ctx.attr.extras]
    +    ctx.actions.run(
    +        outputs = outs,
    +        inputs = ctx.files.srcs,
    +        arguments = args,
    +        executable = ctx.executable.tool,
    +        mnemonic = "GenTorqueInitializers",
    +        progress_message = "Generating Torque initializers",
    +    )
    +    return [DefaultInfo(files = depset(outs))]
    +
    +_v8_torque_initializers = rule(
    +    implementation = _torque_initializers_impl,
    +    # cfg = v8_target_cpu_transition,
    +    attrs = {
    +        "prefix": attr.string(mandatory = True),
    +        "srcs": attr.label_list(allow_files = True, mandatory = True),
    +        "extras": attr.string_list(),
    +        "tool": attr.label(
    +            allow_files = True,
    +            executable = True,
    +            cfg = "exec",
    +        ),
    +        "args": attr.string_list(),
    +    },
    +)
    +
    +def v8_torque_initializers(name, noicu_srcs, icu_srcs, args, extras):
    +    _v8_torque_initializers(
    +        name = "noicu/" + name,
    +        prefix = "noicu",
    +        srcs = noicu_srcs,
    +        args = args,
    +        extras = extras,
    +        tool = select({
    +            "@v8//bazel/config:v8_target_is_32_bits": ":noicu/torque_non_pointer_compression",
    +            "//conditions:default": ":noicu/torque",
    +        }),
    +    )
    +    _v8_torque_initializers(
    +        name = "icu/" + name,
    +        prefix = "icu",
    +        srcs = icu_srcs,
    +        args = args,
    +        extras = extras,
    +        tool = select({
    +            "@v8//bazel/config:v8_target_is_32_bits": ":icu/torque_non_pointer_compression",
    +            "//conditions:default": ":icu/torque",
    +        }),
    +    )
    +
    +def _torque_definitions_impl(ctx):
    +    if ctx.workspace_name == "v8":
    +        v8root = "."
    +    else:
    +        v8root = "external/v8"
    +
    +    # Arguments
    +    args = []
    +    args += ctx.attr.args
    +    args.append("-o")
    +    args.append(ctx.bin_dir.path + "/" + v8root + "/" + ctx.attr.prefix + "/torque-generated")
    +    args.append("-strip-v8-root")
    +    args.append("-v8-root")
    +    args.append(v8root)
    +
    +    # Sources
    +    args += [f.path for f in ctx.files.srcs]
    +
    +    # Generate/declare output files
    +    outs = []
    +    for src in ctx.files.srcs:
    +        root, _period, _ext = src.path.rpartition(".")
    +
    +        # Strip v8root
    +        if root[:len(v8root)] == v8root:
    +            root = root[len(v8root):]
    +        file = ctx.attr.prefix + "/torque-generated/" + root
             outs.append(ctx.actions.declare_file(file + "-tq-inl.inc"))
             outs.append(ctx.actions.declare_file(file + "-tq.inc"))
             outs.append(ctx.actions.declare_file(file + "-tq.cc"))
    @@ -326,13 +424,13 @@ def _torque_impl(ctx):
             inputs = ctx.files.srcs,
             arguments = args,
             executable = ctx.executable.tool,
    -        mnemonic = "GenTorque",
    -        progress_message = "Generating Torque files",
    +        mnemonic = "GenTorqueDefinitions",
    +        progress_message = "Generating Torque definitions",
         )
         return [DefaultInfo(files = depset(outs))]
     
    -_v8_torque = rule(
    -    implementation = _torque_impl,
    +_v8_torque_definitions = rule(
    +    implementation = _torque_definitions_impl,
         # cfg = v8_target_cpu_transition,
         attrs = {
             "prefix": attr.string(mandatory = True),
    @@ -347,31 +445,33 @@ _v8_torque = rule(
         },
     )
     
    -def v8_torque(name, noicu_srcs, icu_srcs, args, extras):
    -    _v8_torque(
    +def v8_torque_definitions(name, noicu_srcs, icu_srcs, args, extras):
    +    _v8_torque_definitions(
             name = "noicu/" + name,
             prefix = "noicu",
             srcs = noicu_srcs,
             args = args,
             extras = extras,
             tool = select({
    -            "@v8//bazel/config:v8_target_is_32_bits": ":torque_non_pointer_compression",
    -            "//conditions:default": ":torque",
    +            "@v8//bazel/config:v8_target_is_32_bits": ":noicu/torque_non_pointer_compression",
    +            "//conditions:default": ":noicu/torque",
             }),
         )
    -    _v8_torque(
    +    _v8_torque_definitions(
             name = "icu/" + name,
             prefix = "icu",
             srcs = icu_srcs,
             args = args,
             extras = extras,
             tool = select({
    -            "@v8//bazel/config:v8_target_is_32_bits": ":torque_non_pointer_compression",
    -            "//conditions:default": ":torque",
    +            "@v8//bazel/config:v8_target_is_32_bits": ":icu/torque_non_pointer_compression",
    +            "//conditions:default": ":icu/torque",
             }),
         )
     
    -def _v8_target_cpu_transition_impl(settings, attr):
    +def _v8_target_cpu_transition_impl(settings,
    +                                   attr, # @unused
    +                                  ):
         # Check for an existing v8_target_cpu flag.
         if "@v8//bazel/config:v8_target_cpu" in settings:
             if settings["@v8//bazel/config:v8_target_cpu"] != "none":
    @@ -499,10 +599,10 @@ def build_config_content(cpu, icu):
             ("is_asan", "false"),
             ("is_cfi", "false"),
             ("is_clang", "true"),
    +        ("is_clang_coverage", "false"),
             ("is_component_build", "false"),
             ("is_debug", "false"),
             ("is_full_debug", "false"),
    -        ("is_gcov_coverage", "false"),
             ("is_msan", "false"),
             ("is_tsan", "false"),
             ("is_ubsan_vptr", "false"),
    @@ -525,7 +625,18 @@ def build_config_content(cpu, icu):
             ("v8_enable_single_generation", "false"),
             ("v8_enable_sandbox", "false"),
             ("v8_enable_shared_ro_heap", "false"),
    +        ("v8_disable_write_barriers", "false"),
             ("v8_target_cpu", cpu),
    +        ("v8_code_comments", "false"),
    +        ("v8_enable_debug_code", "false"),
    +        ("v8_enable_verify_heap", "false"),
    +        ("v8_enable_slow_dchecks", "false"),
    +        ("v8_enable_maglev", "false"),
    +        ("v8_enable_turbofan", "true"),
    +        ("v8_enable_disassembler", "false"),
    +        ("is_DEBUG_defined", "false"),
    +        ("v8_enable_gdbjit", "false"),
    +        ("v8_jitless", "false"),
         ])
     
     # TODO(victorgomes): Create a rule (instead of a macro), that can
    diff --git a/deps/v8/build_overrides/build.gni b/deps/v8/build_overrides/build.gni
    index 4e0c284efaeae9..64abd3e92a5dd8 100644
    --- a/deps/v8/build_overrides/build.gni
    +++ b/deps/v8/build_overrides/build.gni
    @@ -32,6 +32,9 @@ use_perfetto_client_library = false
     # Some non-Chromium builds don't support building java targets.
     enable_java_templates = false
     
    +# Enables assertions on safety checks in libc++.
    +enable_safe_libcxx = true
    +
     # Allows different projects to specify their own suppressions files.
     asan_suppressions_file = "//build/sanitizers/asan_suppressions.cc"
     lsan_suppressions_file = "//build/sanitizers/lsan_suppressions.cc"
    diff --git a/deps/v8/gni/snapshot_toolchain.gni b/deps/v8/gni/snapshot_toolchain.gni
    index 99de816372bf9c..c7faa8ca5897a6 100644
    --- a/deps/v8/gni/snapshot_toolchain.gni
    +++ b/deps/v8/gni/snapshot_toolchain.gni
    @@ -104,6 +104,10 @@ if (v8_snapshot_toolchain == "") {
           # cross compile Windows arm64 with host toolchain.
           v8_snapshot_toolchain = host_toolchain
         }
    +  } else if (host_cpu == "arm64" && current_cpu == "arm64" &&
    +             host_os == "mac") {
    +    # cross compile iOS arm64 with host_toolchain
    +    v8_snapshot_toolchain = host_toolchain
       }
     }
     
    diff --git a/deps/v8/gni/v8.gni b/deps/v8/gni/v8.gni
    index 3f093597faccdc..d38f376b94ae4c 100644
    --- a/deps/v8/gni/v8.gni
    +++ b/deps/v8/gni/v8.gni
    @@ -2,17 +2,15 @@
     # Use of this source code is governed by a BSD-style license that can be
     # found in the LICENSE file.
     
    +import("//build/config/compiler/pgo/pgo.gni")
     import("//build/config/gclient_args.gni")
    +import("//build/config/ios/config.gni")
     import("//build/config/sanitizers/sanitizers.gni")
     import("//build/config/v8_target_cpu.gni")
     import("release_branch_toggle.gni")
     import("split_static_library.gni")
     
     declare_args() {
    -  # Set flags for tracking code coverage. Uses gcov with gcc and sanitizer
    -  # coverage with clang.
    -  v8_code_coverage = false
    -
       # Includes files needed for correctness fuzzing.
       v8_correctness_fuzzer = false
     
    @@ -36,6 +34,9 @@ declare_args() {
       # the JS builtins sources and the start snapshot.
       v8_use_external_startup_data = ""
     
    +  # Includes profiles to optimize builtins.
    +  v8_enable_builtins_optimization = ""
    +
       # Enable ECMAScript Internationalization API. Enabling this feature will
       # add a dependency on the ICU library.
       v8_enable_i18n_support = true
    @@ -63,10 +64,19 @@ declare_args() {
       # Sets -DV8_LITE_MODE.
       v8_enable_lite_mode = false
     
    +  # Enable the Turbofan compiler.
    +  # Sets -dV8_ENABLE_TURBOFAN.
    +  v8_enable_turbofan = ""
    +
    +  # Enable the Maglev compiler.
    +  # Sets -dV8_ENABLE_MAGLEV
    +  v8_enable_maglev = ""
    +
       # Include support for WebAssembly. If disabled, the 'WebAssembly' global
       # will not be available, and embedder APIs to generate WebAssembly modules
       # will fail. Also, asm.js will not be translated to WebAssembly and will be
       # executed as standard JavaScript instead.
    +  # Sets -dV8_ENABLE_WEBASSEMBLY.
       v8_enable_webassembly = ""
     
       # Enable 256-bit long vector re-vectorization pass in WASM compilation pipeline.
    @@ -81,12 +91,6 @@ declare_args() {
       # Scan the call stack conservatively during garbage collection.
       v8_enable_conservative_stack_scanning = false
     
    -  # Use the object start bitmap for inner pointer resolution.
    -  v8_enable_inner_pointer_resolution_osb = false
    -
    -  # Use the marking bitmap for inner pointer resolution.
    -  v8_enable_inner_pointer_resolution_mb = false
    -
       v8_enable_google_benchmark = false
     
       cppgc_is_standalone = false
    @@ -97,6 +101,12 @@ declare_args() {
       # Enable young generation in cppgc.
       cppgc_enable_young_generation = false
     
    +  # Enables a slim write barrier that only performs a single check in the fast
    +  # path and delegates all further checks to a slow path call. This is fast
    +  # in a setting with few slow-path checks, i.e., with disabled young generation
    +  # GC.
    +  cppgc_enable_slim_write_barrier = true
    +
       # Enable pointer compression in cppgc.
       cppgc_enable_pointer_compression = false
     
    @@ -107,6 +117,20 @@ declare_args() {
       # Enable advanced BigInt algorithms, costing about 10-30 KB binary size
       # depending on platform. Disabled on Android to save binary size.
       v8_advanced_bigint_algorithms = !is_android
    +
    +  # TODO: macros for determining endian type are clang specific.
    +  v8_use_libm_trig_functions = is_clang
    +
    +  # iOS device does not support executable code pages. Not we
    +  # use target_os == "ios" here because it isn't equivalent
    +  # to is_ios (is_ios is based on host_os).
    +  target_is_ios_device = target_os == "ios" && target_environment == "device"
    +
    +  # Location of icu.
    +  v8_icu_path = "//third_party/icu"
    +
    +  # Location of zlib.
    +  v8_zlib_path = "//third_party/zlib"
     }
     
     if (v8_use_external_startup_data == "") {
    @@ -125,13 +149,36 @@ if (build_with_chromium && use_perfetto_client_library) {
       v8_use_perfetto = true
     }
     
    +# Includes profiles to optimize builtins if
    +#   * it is a Chromium build, and
    +#   * Chromium builds with optimization.
    +# If no profiles are downloaded during gclient runhooks, optimization fails
    +# silently.
    +if (v8_enable_builtins_optimization == "") {
    +  v8_enable_builtins_optimization = build_with_chromium && chrome_pgo_phase == 2
    +}
    +
    +# TODO(jgruber): Move v8_jitless from BUILD.gn here as these
    +# all depend on each other and really should be derived from
    +# v8_jitless.
     # WebAssembly is enabled by default, except in lite mode.
     if (v8_enable_webassembly == "") {
    -  v8_enable_webassembly = !v8_enable_lite_mode
    +  # iOS (non-simulator) does not have executable pages for 3rd party
    +  # applications yet so disable webassembly.
    +  v8_enable_webassembly = !v8_enable_lite_mode && !target_is_ios_device
     }
     assert(!(v8_enable_webassembly && v8_enable_lite_mode),
            "Webassembly is not available in lite mode.")
     
    +# Turbofan is enabled by default, except in lite mode.
    +if (v8_enable_turbofan == "") {
    +  # iOS (non-simulator) does not have executable pages for 3rd party
    +  # applications yet so disable turbofan.
    +  v8_enable_turbofan = !v8_enable_lite_mode && !target_is_ios_device
    +}
    +assert(v8_enable_turbofan || !v8_enable_webassembly,
    +       "Webassembly is not available when Turbofan is disabled.")
    +
     # Points to // in v8 stand-alone or to //v8/ in chromium. We need absolute
     # paths for all configs in templates as they are shared in different
     # subdirectories.
    @@ -172,13 +219,6 @@ if (!is_debug) {
       ]
     }
     
    -if (v8_code_coverage && !is_clang) {
    -  v8_add_configs += [
    -    v8_path_prefix + ":v8_gcov_coverage_cflags",
    -    v8_path_prefix + ":v8_gcov_coverage_ldflags",
    -  ]
    -}
    -
     if (v8_symbol_level != symbol_level) {
       v8_remove_configs += [ "//build/config/compiler:default_symbols" ]
       if (v8_symbol_level == 0) {
    @@ -260,23 +300,13 @@ template("v8_executable") {
           # For enabling ASLR.
           ldflags = [ "-pie" ]
         }
    -    if (defined(testonly) && testonly && v8_code_coverage) {
    -      # Only add code coverage cflags for non-test files for performance
    -      # reasons.
    -      if (is_clang) {
    -        configs -= [ "//build/config/sanitizers:default_sanitizer_flags" ]
    -        configs +=
    -            [ "//build/config/sanitizers:default_sanitizer_flags_but_coverage" ]
    -      } else {
    -        configs -= [ v8_path_prefix + ":v8_gcov_coverage_cflags" ]
    -      }
    -    }
         deps += [ v8_path_prefix + ":v8_dump_build_config" ]
       }
     }
     
     template("v8_component") {
       component(target_name) {
    +    output_name = target_name
         forward_variables_from(invoker,
                                "*",
                                [
    diff --git a/deps/v8/include/cppgc/cross-thread-persistent.h b/deps/v8/include/cppgc/cross-thread-persistent.h
    index 1fa28afa136eb4..a5f8bac0b1013e 100644
    --- a/deps/v8/include/cppgc/cross-thread-persistent.h
    +++ b/deps/v8/include/cppgc/cross-thread-persistent.h
    @@ -148,10 +148,11 @@ class BasicCrossThreadPersistent final : public CrossThreadPersistentBase,
     
       template ::value>>
       BasicCrossThreadPersistent(
           internal::BasicMember
    +                            MemberCheckingPolicy, MemberStorageType>
               member,
           const SourceLocation& loc = SourceLocation::Current())
           : BasicCrossThreadPersistent(member.Get(), loc) {}
    @@ -230,10 +231,11 @@ class BasicCrossThreadPersistent final : public CrossThreadPersistentBase,
       // Assignment from member.
       template ::value>>
       BasicCrossThreadPersistent& operator=(
           internal::BasicMember
    +                            MemberCheckingPolicy, MemberStorageType>
               member) {
         return operator=(member.Get());
       }
    diff --git a/deps/v8/include/cppgc/heap-consistency.h b/deps/v8/include/cppgc/heap-consistency.h
    index 35c59ed1ad417f..eb7fdaee8c3c02 100644
    --- a/deps/v8/include/cppgc/heap-consistency.h
    +++ b/deps/v8/include/cppgc/heap-consistency.h
    @@ -62,10 +62,10 @@ class HeapConsistency final {
        * \returns whether a write barrier is needed and which barrier to invoke.
        */
       template 
    +            typename CheckingPolicy, typename StorageType>
       static V8_INLINE WriteBarrierType GetWriteBarrierType(
           const internal::BasicMember& value,
    +                                  CheckingPolicy, StorageType>& value,
           WriteBarrierParams& params) {
         return internal::WriteBarrier::GetWriteBarrierType(
             value.GetRawSlot(), value.GetRawStorage(), params);
    diff --git a/deps/v8/include/cppgc/internal/api-constants.h b/deps/v8/include/cppgc/internal/api-constants.h
    index 023426e94b04c9..453ab88b461eb7 100644
    --- a/deps/v8/include/cppgc/internal/api-constants.h
    +++ b/deps/v8/include/cppgc/internal/api-constants.h
    @@ -32,7 +32,7 @@ static constexpr uint16_t kFullyConstructedBitMask = uint16_t{1};
     
     static constexpr size_t kPageSize = size_t{1} << 17;
     
    -#if defined(V8_TARGET_ARCH_ARM64) && defined(V8_OS_MACOS)
    +#if defined(V8_TARGET_ARCH_ARM64) && defined(V8_OS_DARWIN)
     constexpr size_t kGuardPageSize = 0;
     #else
     constexpr size_t kGuardPageSize = 4096;
    @@ -57,6 +57,9 @@ static constexpr size_t kMaxSupportedAlignment = 2 * kDefaultAlignment;
     // Granularity of heap allocations.
     constexpr size_t kAllocationGranularity = sizeof(void*);
     
    +// Default cacheline size.
    +constexpr size_t kCachelineSize = 64;
    +
     }  // namespace api_constants
     
     }  // namespace internal
    diff --git a/deps/v8/include/cppgc/internal/gc-info.h b/deps/v8/include/cppgc/internal/gc-info.h
    index e8f90fed57109f..08ffd411a8efab 100644
    --- a/deps/v8/include/cppgc/internal/gc-info.h
    +++ b/deps/v8/include/cppgc/internal/gc-info.h
    @@ -10,6 +10,7 @@
     #include 
     
     #include "cppgc/internal/finalizer-trait.h"
    +#include "cppgc/internal/logging.h"
     #include "cppgc/internal/name-trait.h"
     #include "cppgc/trace-trait.h"
     #include "v8config.h"  // NOLINT(build/include_directory)
    @@ -20,12 +21,12 @@ namespace internal {
     using GCInfoIndex = uint16_t;
     
     struct V8_EXPORT EnsureGCInfoIndexTrait final {
    -  // Acquires a new GC info object and returns the index. In addition, also
    -  // updates `registered_index` atomically.
    +  // Acquires a new GC info object and updates `registered_index` with the index
    +  // that identifies that new info accordingly.
       template 
    -  V8_INLINE static GCInfoIndex EnsureIndex(
    +  V8_INLINE static void EnsureIndex(
           std::atomic& registered_index) {
    -    return EnsureGCInfoIndexTraitDispatch{}(registered_index);
    +    EnsureGCInfoIndexTraitDispatch{}(registered_index);
       }
     
      private:
    @@ -34,38 +35,32 @@ struct V8_EXPORT EnsureGCInfoIndexTrait final {
                 bool = NameTrait::HasNonHiddenName()>
       struct EnsureGCInfoIndexTraitDispatch;
     
    -  static GCInfoIndex EnsureGCInfoIndexPolymorphic(std::atomic&,
    -                                                  TraceCallback,
    -                                                  FinalizationCallback,
    -                                                  NameCallback);
    -  static GCInfoIndex EnsureGCInfoIndexPolymorphic(std::atomic&,
    -                                                  TraceCallback,
    -                                                  FinalizationCallback);
    -  static GCInfoIndex EnsureGCInfoIndexPolymorphic(std::atomic&,
    -                                                  TraceCallback, NameCallback);
    -  static GCInfoIndex EnsureGCInfoIndexPolymorphic(std::atomic&,
    -                                                  TraceCallback);
    -  static GCInfoIndex EnsureGCInfoIndexNonPolymorphic(std::atomic&,
    -                                                     TraceCallback,
    -                                                     FinalizationCallback,
    -                                                     NameCallback);
    -  static GCInfoIndex EnsureGCInfoIndexNonPolymorphic(std::atomic&,
    -                                                     TraceCallback,
    -                                                     FinalizationCallback);
    -  static GCInfoIndex EnsureGCInfoIndexNonPolymorphic(std::atomic&,
    -                                                     TraceCallback,
    -                                                     NameCallback);
    -  static GCInfoIndex EnsureGCInfoIndexNonPolymorphic(std::atomic&,
    -                                                     TraceCallback);
    +  static void V8_PRESERVE_MOST
    +  EnsureGCInfoIndexPolymorphic(std::atomic&, TraceCallback,
    +                               FinalizationCallback, NameCallback);
    +  static void V8_PRESERVE_MOST EnsureGCInfoIndexPolymorphic(
    +      std::atomic&, TraceCallback, FinalizationCallback);
    +  static void V8_PRESERVE_MOST EnsureGCInfoIndexPolymorphic(
    +      std::atomic&, TraceCallback, NameCallback);
    +  static void V8_PRESERVE_MOST
    +  EnsureGCInfoIndexPolymorphic(std::atomic&, TraceCallback);
    +  static void V8_PRESERVE_MOST
    +  EnsureGCInfoIndexNonPolymorphic(std::atomic&, TraceCallback,
    +                                  FinalizationCallback, NameCallback);
    +  static void V8_PRESERVE_MOST EnsureGCInfoIndexNonPolymorphic(
    +      std::atomic&, TraceCallback, FinalizationCallback);
    +  static void V8_PRESERVE_MOST EnsureGCInfoIndexNonPolymorphic(
    +      std::atomic&, TraceCallback, NameCallback);
    +  static void V8_PRESERVE_MOST
    +  EnsureGCInfoIndexNonPolymorphic(std::atomic&, TraceCallback);
     };
     
     #define DISPATCH(is_polymorphic, has_finalizer, has_non_hidden_name, function) \
       template                                                         \
       struct EnsureGCInfoIndexTrait::EnsureGCInfoIndexTraitDispatch<               \
           T, is_polymorphic, has_finalizer, has_non_hidden_name> {                 \
    -    V8_INLINE GCInfoIndex                                                      \
    -    operator()(std::atomic& registered_index) {                   \
    -      return function;                                                         \
    +    V8_INLINE void operator()(std::atomic& registered_index) {    \
    +      function;                                                                \
         }                                                                          \
       };
     
    @@ -143,9 +138,16 @@ struct GCInfoTrait final {
         static_assert(sizeof(T), "T must be fully defined");
         static std::atomic
             registered_index;  // Uses zero initialization.
    -    const GCInfoIndex index = registered_index.load(std::memory_order_acquire);
    -    return index ? index
    -                 : EnsureGCInfoIndexTrait::EnsureIndex(registered_index);
    +    GCInfoIndex index = registered_index.load(std::memory_order_acquire);
    +    if (V8_UNLIKELY(!index)) {
    +      EnsureGCInfoIndexTrait::EnsureIndex(registered_index);
    +      // Slow path call uses V8_PRESERVE_MOST which does not support return
    +      // values (also preserves RAX). Avoid out parameter by just reloading the
    +      // value here which at this point is guaranteed to be set.
    +      index = registered_index.load(std::memory_order_acquire);
    +      CPPGC_DCHECK(index != 0);
    +    }
    +    return index;
       }
     };
     
    diff --git a/deps/v8/include/cppgc/internal/member-storage.h b/deps/v8/include/cppgc/internal/member-storage.h
    index 0eb6382070c4da..3dfafc4b08cd11 100644
    --- a/deps/v8/include/cppgc/internal/member-storage.h
    +++ b/deps/v8/include/cppgc/internal/member-storage.h
    @@ -17,6 +17,11 @@
     namespace cppgc {
     namespace internal {
     
    +enum class WriteBarrierSlotType {
    +  kCompressed,
    +  kUncompressed,
    +};
    +
     #if defined(CPPGC_POINTER_COMPRESSION)
     
     #if defined(__clang__)
    @@ -30,16 +35,16 @@ namespace internal {
     #define CPPGC_REQUIRE_CONSTANT_INIT
     #endif  // defined(__clang__)
     
    -class CageBaseGlobal final {
    +class V8_EXPORT CageBaseGlobal final {
      public:
       V8_INLINE CPPGC_CONST static uintptr_t Get() {
         CPPGC_DCHECK(IsBaseConsistent());
    -    return g_base_;
    +    return g_base_.base;
       }
     
       V8_INLINE CPPGC_CONST static bool IsSet() {
         CPPGC_DCHECK(IsBaseConsistent());
    -    return (g_base_ & ~kLowerHalfWordMask) != 0;
    +    return (g_base_.base & ~kLowerHalfWordMask) != 0;
       }
     
      private:
    @@ -47,12 +52,15 @@ class CageBaseGlobal final {
       static constexpr uintptr_t kLowerHalfWordMask =
           (api_constants::kCagedHeapReservationAlignment - 1);
     
    -  static V8_EXPORT uintptr_t g_base_ CPPGC_REQUIRE_CONSTANT_INIT;
    +  static union alignas(api_constants::kCachelineSize) Base {
    +    uintptr_t base;
    +    char cache_line[api_constants::kCachelineSize];
    +  } g_base_ CPPGC_REQUIRE_CONSTANT_INIT;
     
       CageBaseGlobal() = delete;
     
       V8_INLINE static bool IsBaseConsistent() {
    -    return kLowerHalfWordMask == (g_base_ & kLowerHalfWordMask);
    +    return kLowerHalfWordMask == (g_base_.base & kLowerHalfWordMask);
       }
     
       friend class CageBaseGlobalUpdater;
    @@ -64,6 +72,8 @@ class CageBaseGlobal final {
     class V8_TRIVIAL_ABI CompressedPointer final {
      public:
       using IntegralType = uint32_t;
    +  static constexpr auto kWriteBarrierSlotType =
    +      WriteBarrierSlotType::kCompressed;
     
       V8_INLINE CompressedPointer() : value_(0u) {}
       V8_INLINE explicit CompressedPointer(const void* ptr)
    @@ -173,6 +183,8 @@ class V8_TRIVIAL_ABI CompressedPointer final {
     class V8_TRIVIAL_ABI RawPointer final {
      public:
       using IntegralType = uintptr_t;
    +  static constexpr auto kWriteBarrierSlotType =
    +      WriteBarrierSlotType::kUncompressed;
     
       V8_INLINE RawPointer() : ptr_(nullptr) {}
       V8_INLINE explicit RawPointer(const void* ptr) : ptr_(ptr) {}
    @@ -225,9 +237,9 @@ class V8_TRIVIAL_ABI RawPointer final {
     };
     
     #if defined(CPPGC_POINTER_COMPRESSION)
    -using MemberStorage = CompressedPointer;
    +using DefaultMemberStorage = CompressedPointer;
     #else   // !defined(CPPGC_POINTER_COMPRESSION)
    -using MemberStorage = RawPointer;
    +using DefaultMemberStorage = RawPointer;
     #endif  // !defined(CPPGC_POINTER_COMPRESSION)
     
     }  // namespace internal
    diff --git a/deps/v8/include/cppgc/internal/pointer-policies.h b/deps/v8/include/cppgc/internal/pointer-policies.h
    index 8455b3df8196b4..06fa884f49f34b 100644
    --- a/deps/v8/include/cppgc/internal/pointer-policies.h
    +++ b/deps/v8/include/cppgc/internal/pointer-policies.h
    @@ -33,20 +33,53 @@ struct DijkstraWriteBarrierPolicy {
         // barrier doesn't break the tri-color invariant.
       }
     
    +  template 
       V8_INLINE static void AssigningBarrier(const void* slot, const void* value) {
    +#ifdef CPPGC_SLIM_WRITE_BARRIER
    +    if (V8_UNLIKELY(WriteBarrier::IsEnabled()))
    +      WriteBarrier::CombinedWriteBarrierSlow(slot);
    +#else   // !CPPGC_SLIM_WRITE_BARRIER
         WriteBarrier::Params params;
         const WriteBarrier::Type type =
             WriteBarrier::GetWriteBarrierType(slot, value, params);
         WriteBarrier(type, params, slot, value);
    +#endif  // !CPPGC_SLIM_WRITE_BARRIER
       }
     
    +  template 
    +  V8_INLINE static void AssigningBarrier(const void* slot, RawPointer storage) {
    +    static_assert(
    +        SlotType == WriteBarrierSlotType::kUncompressed,
    +        "Assigning storages of Member and UncompressedMember is not supported");
    +#ifdef CPPGC_SLIM_WRITE_BARRIER
    +    if (V8_UNLIKELY(WriteBarrier::IsEnabled()))
    +      WriteBarrier::CombinedWriteBarrierSlow(slot);
    +#else   // !CPPGC_SLIM_WRITE_BARRIER
    +    WriteBarrier::Params params;
    +    const WriteBarrier::Type type =
    +        WriteBarrier::GetWriteBarrierType(slot, storage, params);
    +    WriteBarrier(type, params, slot, storage.Load());
    +#endif  // !CPPGC_SLIM_WRITE_BARRIER
    +  }
    +
    +#if defined(CPPGC_POINTER_COMPRESSION)
    +  template 
       V8_INLINE static void AssigningBarrier(const void* slot,
    -                                         MemberStorage storage) {
    +                                         CompressedPointer storage) {
    +    static_assert(
    +        SlotType == WriteBarrierSlotType::kCompressed,
    +        "Assigning storages of Member and UncompressedMember is not supported");
    +#ifdef CPPGC_SLIM_WRITE_BARRIER
    +    if (V8_UNLIKELY(WriteBarrier::IsEnabled()))
    +      WriteBarrier::CombinedWriteBarrierSlow(slot);
    +#else   // !CPPGC_SLIM_WRITE_BARRIER
         WriteBarrier::Params params;
         const WriteBarrier::Type type =
             WriteBarrier::GetWriteBarrierType(slot, storage, params);
         WriteBarrier(type, params, slot, storage.Load());
    +#endif  // !CPPGC_SLIM_WRITE_BARRIER
       }
    +#endif  // defined(CPPGC_POINTER_COMPRESSION)
     
      private:
       V8_INLINE static void WriteBarrier(WriteBarrier::Type type,
    @@ -68,7 +101,9 @@ struct DijkstraWriteBarrierPolicy {
     
     struct NoWriteBarrierPolicy {
       V8_INLINE static void InitializingBarrier(const void*, const void*) {}
    +  template 
       V8_INLINE static void AssigningBarrier(const void*, const void*) {}
    +  template 
       V8_INLINE static void AssigningBarrier(const void*, MemberStorage) {}
     };
     
    @@ -197,7 +232,8 @@ template 
     class BasicPersistent;
     template 
    +          typename CheckingPolicy = DefaultMemberCheckingPolicy,
    +          typename StorageType = DefaultMemberStorage>
     class BasicMember;
     
     }  // namespace internal
    diff --git a/deps/v8/include/cppgc/internal/write-barrier.h b/deps/v8/include/cppgc/internal/write-barrier.h
    index 37bc5c973ef995..566724d30a0901 100644
    --- a/deps/v8/include/cppgc/internal/write-barrier.h
    +++ b/deps/v8/include/cppgc/internal/write-barrier.h
    @@ -70,6 +70,7 @@ class V8_EXPORT WriteBarrier final {
       static V8_INLINE Type GetWriteBarrierType(const void* slot, const void* value,
                                                 Params& params);
       // Returns the required write barrier for a given `slot` and `value`.
    +  template 
       static V8_INLINE Type GetWriteBarrierType(const void* slot, MemberStorage,
                                                 Params& params);
       // Returns the required write barrier for a given `slot`.
    @@ -79,6 +80,15 @@ class V8_EXPORT WriteBarrier final {
       // Returns the required write barrier for a given  `value`.
       static V8_INLINE Type GetWriteBarrierType(const void* value, Params& params);
     
    +#ifdef CPPGC_SLIM_WRITE_BARRIER
    +  // A write barrier that combines `GenerationalBarrier()` and
    +  // `DijkstraMarkingBarrier()`. We only pass a single parameter here to clobber
    +  // as few registers as possible.
    +  template 
    +  static V8_NOINLINE void V8_PRESERVE_MOST
    +  CombinedWriteBarrierSlow(const void* slot);
    +#endif  // CPPGC_SLIM_WRITE_BARRIER
    +
       static V8_INLINE void DijkstraMarkingBarrier(const Params& params,
                                                    const void* object);
       static V8_INLINE void DijkstraMarkingBarrierRange(
    @@ -163,7 +173,8 @@ class V8_EXPORT WriteBarrierTypeForCagedHeapPolicy final {
         return ValueModeDispatch::Get(slot, value, params, callback);
       }
     
    -  template 
    +  template 
       static V8_INLINE WriteBarrier::Type Get(const void* slot, MemberStorage value,
                                               WriteBarrier::Params& params,
                                               HeapHandleCallback callback) {
    @@ -207,7 +218,7 @@ class V8_EXPORT WriteBarrierTypeForCagedHeapPolicy final {
     template <>
     struct WriteBarrierTypeForCagedHeapPolicy::ValueModeDispatch<
         WriteBarrier::ValueMode::kValuePresent> {
    -  template 
    +  template 
       static V8_INLINE WriteBarrier::Type Get(const void* slot,
                                               MemberStorage storage,
                                               WriteBarrier::Params& params,
    @@ -305,11 +316,9 @@ class V8_EXPORT WriteBarrierTypeForNonCagedHeapPolicy final {
       }
     
       template 
    -  static V8_INLINE WriteBarrier::Type Get(const void* slot, MemberStorage value,
    +  static V8_INLINE WriteBarrier::Type Get(const void* slot, RawPointer value,
                                               WriteBarrier::Params& params,
                                               HeapHandleCallback callback) {
    -    // `MemberStorage` will always be `RawPointer` for non-caged heap builds.
    -    // Just convert to `void*` in this case.
         return ValueModeDispatch::Get(slot, value.Load(), params,
                                                   callback);
       }
    @@ -383,6 +392,7 @@ WriteBarrier::Type WriteBarrier::GetWriteBarrierType(
     }
     
     // static
    +template 
     WriteBarrier::Type WriteBarrier::GetWriteBarrierType(
         const void* slot, MemberStorage value, WriteBarrier::Params& params) {
       return WriteBarrierTypePolicy::Get(slot, value,
    diff --git a/deps/v8/include/cppgc/macros.h b/deps/v8/include/cppgc/macros.h
    index 030f397e3df15c..a9ac22d7af0d0b 100644
    --- a/deps/v8/include/cppgc/macros.h
    +++ b/deps/v8/include/cppgc/macros.h
    @@ -11,7 +11,10 @@
     
     namespace cppgc {
     
    -// Use if the object is only stack allocated.
    +// Use CPPGC_STACK_ALLOCATED if the object is only stack allocated.
    +// Add the CPPGC_STACK_ALLOCATED_IGNORE annotation on a case-by-case basis when
    +// enforcement of CPPGC_STACK_ALLOCATED should be suppressed.
    +#if defined(__clang__)
     #define CPPGC_STACK_ALLOCATED()                        \
      public:                                               \
       using IsStackAllocatedTypeMarker CPPGC_UNUSED = int; \
    @@ -20,6 +23,12 @@ namespace cppgc {
       void* operator new(size_t) = delete;                 \
       void* operator new(size_t, void*) = delete;          \
       static_assert(true, "Force semicolon.")
    +#define CPPGC_STACK_ALLOCATED_IGNORE(bug_or_reason) \
    +  __attribute__((annotate("stack_allocated_ignore")))
    +#else  // !defined(__clang__)
    +#define CPPGC_STACK_ALLOCATED() static_assert(true, "Force semicolon.")
    +#define CPPGC_STACK_ALLOCATED_IGNORE(bug_or_reason)
    +#endif  // !defined(__clang__)
     
     }  // namespace cppgc
     
    diff --git a/deps/v8/include/cppgc/member.h b/deps/v8/include/cppgc/member.h
    index 9bc383634f18ea..b6382a02358744 100644
    --- a/deps/v8/include/cppgc/member.h
    +++ b/deps/v8/include/cppgc/member.h
    @@ -28,13 +28,11 @@ namespace internal {
     
     // MemberBase always refers to the object as const object and defers to
     // BasicMember on casting to the right type as needed.
    +template 
     class V8_TRIVIAL_ABI MemberBase {
      public:
    -#if defined(CPPGC_POINTER_COMPRESSION)
    -  using RawStorage = CompressedPointer;
    -#else   // !defined(CPPGC_POINTER_COMPRESSION)
    -  using RawStorage = RawPointer;
    -#endif  // !defined(CPPGC_POINTER_COMPRESSION)
    +  using RawStorage = StorageType;
    +
      protected:
       struct AtomicInitializerTag {};
     
    @@ -75,16 +73,19 @@ class V8_TRIVIAL_ABI MemberBase {
     
     // The basic class from which all Member classes are 'generated'.
     template 
    -class V8_TRIVIAL_ABI BasicMember final : private MemberBase,
    +          typename CheckingPolicy, typename StorageType>
    +class V8_TRIVIAL_ABI BasicMember final : private MemberBase,
                                              private CheckingPolicy {
    +  using Base = MemberBase;
    +
      public:
       using PointeeType = T;
    +  using RawStorage = typename Base::RawStorage;
     
       V8_INLINE constexpr BasicMember() = default;
    -  V8_INLINE constexpr BasicMember(std::nullptr_t) {}           // NOLINT
    -  V8_INLINE BasicMember(SentinelPointer s) : MemberBase(s) {}  // NOLINT
    -  V8_INLINE BasicMember(T* raw) : MemberBase(raw) {            // NOLINT
    +  V8_INLINE constexpr BasicMember(std::nullptr_t) {}     // NOLINT
    +  V8_INLINE BasicMember(SentinelPointer s) : Base(s) {}  // NOLINT
    +  V8_INLINE BasicMember(T* raw) : Base(raw) {            // NOLINT
         InitializingWriteBarrier(raw);
         this->CheckPointer(Get());
       }
    @@ -94,13 +95,13 @@ class V8_TRIVIAL_ABI BasicMember final : private MemberBase,
       // Atomic ctor. Using the AtomicInitializerTag forces BasicMember to
       // initialize using atomic assignments. This is required for preventing
       // data races with concurrent marking.
    -  using AtomicInitializerTag = MemberBase::AtomicInitializerTag;
    +  using AtomicInitializerTag = typename Base::AtomicInitializerTag;
       V8_INLINE BasicMember(std::nullptr_t, AtomicInitializerTag atomic)
    -      : MemberBase(nullptr, atomic) {}
    +      : Base(nullptr, atomic) {}
       V8_INLINE BasicMember(SentinelPointer s, AtomicInitializerTag atomic)
    -      : MemberBase(s, atomic) {}
    +      : Base(s, atomic) {}
       V8_INLINE BasicMember(T* raw, AtomicInitializerTag atomic)
    -      : MemberBase(raw, atomic) {
    +      : Base(raw, atomic) {
         InitializingWriteBarrier(raw);
         this->CheckPointer(Get());
       }
    @@ -119,7 +120,7 @@ class V8_TRIVIAL_ABI BasicMember final : private MemberBase,
                 std::enable_if_t>* = nullptr>
       V8_INLINE BasicMember(  // NOLINT
           const BasicMember& other)
    +                        OtherCheckingPolicy, StorageType>& other)
           : BasicMember(other.GetRawStorage()) {}
     
       template >* = nullptr>
       V8_INLINE BasicMember(  // NOLINT
           const BasicMember& other)
    +                        OtherCheckingPolicy, StorageType>& other)
           : BasicMember(other.Get()) {}
     
       // Move ctor.
    @@ -142,8 +143,9 @@ class V8_TRIVIAL_ABI BasicMember final : private MemberBase,
       template >* = nullptr>
    -  V8_INLINE BasicMember(BasicMember&& other) noexcept
    +  V8_INLINE BasicMember(
    +      BasicMember&& other) noexcept
           : BasicMember(other.GetRawStorage()) {
         other.Clear();
       }
    @@ -151,8 +153,9 @@ class V8_TRIVIAL_ABI BasicMember final : private MemberBase,
       template >* = nullptr>
    -  V8_INLINE BasicMember(BasicMember&& other) noexcept
    +  V8_INLINE BasicMember(
    +      BasicMember&& other) noexcept
           : BasicMember(other.Get()) {
         other.Clear();
       }
    @@ -179,7 +182,7 @@ class V8_TRIVIAL_ABI BasicMember final : private MemberBase,
                 typename OtherCheckingPolicy>
       V8_INLINE BasicMember& operator=(
           const BasicMember& other) {
    +                        OtherCheckingPolicy, StorageType>& other) {
         if constexpr (internal::IsDecayedSameV) {
           return operator=(other.GetRawStorage());
         } else {
    @@ -201,8 +204,8 @@ class V8_TRIVIAL_ABI BasicMember final : private MemberBase,
       template 
       V8_INLINE BasicMember& operator=(
    -      BasicMember&& other) noexcept {
    +      BasicMember&& other) noexcept {
         if constexpr (internal::IsDecayedSameV) {
           operator=(other.GetRawStorage());
         } else {
    @@ -226,7 +229,7 @@ class V8_TRIVIAL_ABI BasicMember final : private MemberBase,
       }
     
       V8_INLINE BasicMember& operator=(T* other) {
    -    SetRawAtomic(other);
    +    Base::SetRawAtomic(other);
         AssigningWriteBarrier(other);
         this->CheckPointer(Get());
         return *this;
    @@ -237,20 +240,20 @@ class V8_TRIVIAL_ABI BasicMember final : private MemberBase,
         return *this;
       }
       V8_INLINE BasicMember& operator=(SentinelPointer s) {
    -    SetRawAtomic(s);
    +    Base::SetRawAtomic(s);
         return *this;
       }
     
       template 
       V8_INLINE void Swap(BasicMember& other) {
    +                                  OtherCheckingPolicy, StorageType>& other) {
         auto tmp = GetRawStorage();
         *this = other;
         other = tmp;
       }
     
    -  V8_INLINE explicit operator bool() const { return !IsCleared(); }
    +  V8_INLINE explicit operator bool() const { return !Base::IsCleared(); }
       V8_INLINE operator T*() const { return Get(); }
       V8_INLINE T* operator->() const { return Get(); }
       V8_INLINE T& operator*() const { return *Get(); }
    @@ -264,10 +267,12 @@ class V8_TRIVIAL_ABI BasicMember final : private MemberBase,
         // The const_cast below removes the constness from MemberBase storage. The
         // following static_cast re-adds any constness if specified through the
         // user-visible template parameter T.
    -    return static_cast(const_cast(MemberBase::GetRaw()));
    +    return static_cast(const_cast(Base::GetRaw()));
       }
     
    -  V8_INLINE void Clear() { SetRawStorageAtomic(RawStorage{}); }
    +  V8_INLINE void Clear() {
    +    Base::SetRawStorageAtomic(RawStorage{});
    +  }
     
       V8_INLINE T* Release() {
         T* result = Get();
    @@ -276,41 +281,44 @@ class V8_TRIVIAL_ABI BasicMember final : private MemberBase,
       }
     
       V8_INLINE const T** GetSlotForTesting() const {
    -    return reinterpret_cast(GetRawSlot());
    +    return reinterpret_cast(Base::GetRawSlot());
       }
     
       V8_INLINE RawStorage GetRawStorage() const {
    -    return MemberBase::GetRawStorage();
    +    return Base::GetRawStorage();
       }
     
      private:
    -  V8_INLINE explicit BasicMember(RawStorage raw) : MemberBase(raw) {
    +  V8_INLINE explicit BasicMember(RawStorage raw) : Base(raw) {
         InitializingWriteBarrier(Get());
         this->CheckPointer(Get());
       }
     
       V8_INLINE BasicMember& operator=(RawStorage other) {
    -    SetRawStorageAtomic(other);
    +    Base::SetRawStorageAtomic(other);
         AssigningWriteBarrier();
         this->CheckPointer(Get());
         return *this;
       }
     
       V8_INLINE const T* GetRawAtomic() const {
    -    return static_cast(MemberBase::GetRawAtomic());
    +    return static_cast(Base::GetRawAtomic());
       }
     
       V8_INLINE void InitializingWriteBarrier(T* value) const {
    -    WriteBarrierPolicy::InitializingBarrier(GetRawSlot(), value);
    +    WriteBarrierPolicy::InitializingBarrier(Base::GetRawSlot(), value);
       }
       V8_INLINE void AssigningWriteBarrier(T* value) const {
    -    WriteBarrierPolicy::AssigningBarrier(GetRawSlot(), value);
    +    WriteBarrierPolicy::template AssigningBarrier<
    +        StorageType::kWriteBarrierSlotType>(Base::GetRawSlot(), value);
       }
       V8_INLINE void AssigningWriteBarrier() const {
    -    WriteBarrierPolicy::AssigningBarrier(GetRawSlot(), GetRawStorage());
    +    WriteBarrierPolicy::template AssigningBarrier<
    +        StorageType::kWriteBarrierSlotType>(Base::GetRawSlot(),
    +                                            Base::GetRawStorage());
       }
     
    -  V8_INLINE void ClearFromGC() const { MemberBase::ClearFromGC(); }
    +  V8_INLINE void ClearFromGC() const { Base::ClearFromGC(); }
     
       V8_INLINE T* GetFromGC() const { return Get(); }
     
    @@ -319,19 +327,20 @@ class V8_TRIVIAL_ABI BasicMember final : private MemberBase,
       template 
       friend struct cppgc::TraceTrait;
       template 
    +            typename CheckingPolicy1, typename StorageType1>
       friend class BasicMember;
     };
     
     // Member equality operators.
     template 
    +          typename WriteBarrierPolicy2, typename CheckingPolicy2,
    +          typename StorageType>
     V8_INLINE bool operator==(
    -    const BasicMember&
    -        member1,
    -    const BasicMember&
    -        member2) {
    +    const BasicMember& member1,
    +    const BasicMember& member2) {
       if constexpr (internal::IsDecayedSameV) {
         // Check compressed pointers if types are the same.
         return member1.GetRawStorage() == member2.GetRawStorage();
    @@ -345,31 +354,32 @@ V8_INLINE bool operator==(
     
     template 
    +          typename WriteBarrierPolicy2, typename CheckingPolicy2,
    +          typename StorageType>
     V8_INLINE bool operator!=(
    -    const BasicMember&
    -        member1,
    -    const BasicMember&
    -        member2) {
    +    const BasicMember& member1,
    +    const BasicMember& member2) {
       return !(member1 == member2);
     }
     
     // Equality with raw pointers.
     template 
    -V8_INLINE bool operator==(const BasicMember& member,
    -                          U* raw) {
    +          typename CheckingPolicy, typename StorageType, typename U>
    +V8_INLINE bool operator==(
    +    const BasicMember& member,
    +    U* raw) {
       // Never allow comparison with erased pointers.
       static_assert(!internal::IsDecayedSameV);
     
       if constexpr (internal::IsDecayedSameV) {
         // Check compressed pointers if types are the same.
    -    return member.GetRawStorage() == MemberBase::RawStorage(raw);
    +    return member.GetRawStorage() == StorageType(raw);
       } else if constexpr (internal::IsStrictlyBaseOfV) {
         // Cast the raw pointer to T, which may adjust the pointer.
    -    return member.GetRawStorage() ==
    -           MemberBase::RawStorage(static_cast(raw));
    +    return member.GetRawStorage() == StorageType(static_cast(raw));
       } else {
         // Otherwise, decompressed the member.
         return member.Get() == raw;
    @@ -377,104 +387,112 @@ V8_INLINE bool operator==(const BasicMember
    -V8_INLINE bool operator!=(const BasicMember& member,
    -                          U* raw) {
    +          typename CheckingPolicy, typename StorageType, typename U>
    +V8_INLINE bool operator!=(
    +    const BasicMember& member,
    +    U* raw) {
       return !(member == raw);
     }
     
     template 
    -V8_INLINE bool operator==(T* raw,
    -                          const BasicMember& member) {
    +          typename WriteBarrierPolicy, typename CheckingPolicy,
    +          typename StorageType>
    +V8_INLINE bool operator==(
    +    T* raw, const BasicMember& member) {
       return member == raw;
     }
     
     template 
    -V8_INLINE bool operator!=(T* raw,
    -                          const BasicMember& member) {
    +          typename WriteBarrierPolicy, typename CheckingPolicy,
    +          typename StorageType>
    +V8_INLINE bool operator!=(
    +    T* raw, const BasicMember& member) {
       return !(raw == member);
     }
     
     // Equality with sentinel.
     template 
    -V8_INLINE bool operator==(const BasicMember& member,
    -                          SentinelPointer) {
    +          typename CheckingPolicy, typename StorageType>
    +V8_INLINE bool operator==(
    +    const BasicMember& member,
    +    SentinelPointer) {
       return member.GetRawStorage().IsSentinel();
     }
     
     template 
    -V8_INLINE bool operator!=(const BasicMember& member,
    -                          SentinelPointer s) {
    +          typename CheckingPolicy, typename StorageType>
    +V8_INLINE bool operator!=(
    +    const BasicMember& member,
    +    SentinelPointer s) {
       return !(member == s);
     }
     
     template 
    -V8_INLINE bool operator==(SentinelPointer s,
    -                          const BasicMember& member) {
    +          typename CheckingPolicy, typename StorageType>
    +V8_INLINE bool operator==(
    +    SentinelPointer s, const BasicMember& member) {
       return member == s;
     }
     
     template 
    -V8_INLINE bool operator!=(SentinelPointer s,
    -                          const BasicMember& member) {
    +          typename CheckingPolicy, typename StorageType>
    +V8_INLINE bool operator!=(
    +    SentinelPointer s, const BasicMember& member) {
       return !(s == member);
     }
     
     // Equality with nullptr.
     template 
    -V8_INLINE bool operator==(const BasicMember& member,
    -                          std::nullptr_t) {
    +          typename CheckingPolicy, typename StorageType>
    +V8_INLINE bool operator==(
    +    const BasicMember& member,
    +    std::nullptr_t) {
       return !static_cast(member);
     }
     
     template 
    -V8_INLINE bool operator!=(const BasicMember& member,
    -                          std::nullptr_t n) {
    +          typename CheckingPolicy, typename StorageType>
    +V8_INLINE bool operator!=(
    +    const BasicMember& member,
    +    std::nullptr_t n) {
       return !(member == n);
     }
     
     template 
    -V8_INLINE bool operator==(std::nullptr_t n,
    -                          const BasicMember& member) {
    +          typename CheckingPolicy, typename StorageType>
    +V8_INLINE bool operator==(
    +    std::nullptr_t n, const BasicMember& member) {
       return member == n;
     }
     
     template 
    -V8_INLINE bool operator!=(std::nullptr_t n,
    -                          const BasicMember& member) {
    +          typename CheckingPolicy, typename StorageType>
    +V8_INLINE bool operator!=(
    +    std::nullptr_t n, const BasicMember& member) {
       return !(n == member);
     }
     
     // Relational operators.
     template 
    +          typename WriteBarrierPolicy2, typename CheckingPolicy2,
    +          typename StorageType>
     V8_INLINE bool operator<(
    -    const BasicMember&
    -        member1,
    -    const BasicMember&
    -        member2) {
    +    const BasicMember& member1,
    +    const BasicMember& member2) {
       static_assert(
           internal::IsDecayedSameV,
           "Comparison works only for same pointer type modulo cv-qualifiers");
    @@ -483,12 +501,13 @@ V8_INLINE bool operator<(
     
     template 
    +          typename WriteBarrierPolicy2, typename CheckingPolicy2,
    +          typename StorageType>
     V8_INLINE bool operator<=(
    -    const BasicMember&
    -        member1,
    -    const BasicMember&
    -        member2) {
    +    const BasicMember& member1,
    +    const BasicMember& member2) {
       static_assert(
           internal::IsDecayedSameV,
           "Comparison works only for same pointer type modulo cv-qualifiers");
    @@ -497,12 +516,13 @@ V8_INLINE bool operator<=(
     
     template 
    +          typename WriteBarrierPolicy2, typename CheckingPolicy2,
    +          typename StorageType>
     V8_INLINE bool operator>(
    -    const BasicMember&
    -        member1,
    -    const BasicMember&
    -        member2) {
    +    const BasicMember& member1,
    +    const BasicMember& member2) {
       static_assert(
           internal::IsDecayedSameV,
           "Comparison works only for same pointer type modulo cv-qualifiers");
    @@ -511,21 +531,23 @@ V8_INLINE bool operator>(
     
     template 
    +          typename WriteBarrierPolicy2, typename CheckingPolicy2,
    +          typename StorageType>
     V8_INLINE bool operator>=(
    -    const BasicMember&
    -        member1,
    -    const BasicMember&
    -        member2) {
    +    const BasicMember& member1,
    +    const BasicMember& member2) {
       static_assert(
           internal::IsDecayedSameV,
           "Comparison works only for same pointer type modulo cv-qualifiers");
       return member1.GetRawStorage() >= member2.GetRawStorage();
     }
     
    -template 
    -struct IsWeak<
    -    internal::BasicMember>
    +template 
    +struct IsWeak>
         : std::true_type {};
     
     }  // namespace internal
    @@ -536,8 +558,9 @@ struct IsWeak<
      * trace method.
      */
     template 
    -using Member = internal::BasicMember;
    +using Member = internal::BasicMember<
    +    T, internal::StrongMemberTag, internal::DijkstraWriteBarrierPolicy,
    +    internal::DefaultMemberCheckingPolicy, internal::DefaultMemberStorage>;
     
     /**
      * WeakMember is similar to Member in that it is used to point to other garbage
    @@ -548,8 +571,9 @@ using Member = internal::BasicMember
    -using WeakMember = internal::BasicMember;
    +using WeakMember = internal::BasicMember<
    +    T, internal::WeakMemberTag, internal::DijkstraWriteBarrierPolicy,
    +    internal::DefaultMemberCheckingPolicy, internal::DefaultMemberStorage>;
     
     /**
      * UntracedMember is a pointer to an on-heap object that is not traced for some
    @@ -558,8 +582,22 @@ using WeakMember = internal::BasicMember
    -using UntracedMember = internal::BasicMember;
    +using UntracedMember = internal::BasicMember<
    +    T, internal::UntracedMemberTag, internal::NoWriteBarrierPolicy,
    +    internal::DefaultMemberCheckingPolicy, internal::DefaultMemberStorage>;
    +
    +namespace subtle {
    +
    +/**
    + * UncompressedMember. Use with care in hot paths that would otherwise cause
    + * many decompression cycles.
    + */
    +template 
    +using UncompressedMember = internal::BasicMember<
    +    T, internal::StrongMemberTag, internal::DijkstraWriteBarrierPolicy,
    +    internal::DefaultMemberCheckingPolicy, internal::RawPointer>;
    +
    +}  // namespace subtle
     
     }  // namespace cppgc
     
    diff --git a/deps/v8/include/cppgc/persistent.h b/deps/v8/include/cppgc/persistent.h
    index 3a66ccc0864328..709f3fd6ab0996 100644
    --- a/deps/v8/include/cppgc/persistent.h
    +++ b/deps/v8/include/cppgc/persistent.h
    @@ -114,11 +114,12 @@ class BasicPersistent final : public PersistentBase,
       // Constructor from member.
       template ::value>>
    -  BasicPersistent(
    -      const internal::BasicMember& member,
    -      const SourceLocation& loc = SourceLocation::Current())
    +  BasicPersistent(const internal::BasicMember<
    +                      U, MemberBarrierPolicy, MemberWeaknessTag,
    +                      MemberCheckingPolicy, MemberStorageType>& member,
    +                  const SourceLocation& loc = SourceLocation::Current())
           : BasicPersistent(member.Get(), loc) {}
     
       ~BasicPersistent() { Clear(); }
    @@ -154,10 +155,12 @@ class BasicPersistent final : public PersistentBase,
       // Assignment from member.
       template ::value>>
       BasicPersistent& operator=(
           const internal::BasicMember& member) {
    +                                  MemberCheckingPolicy, MemberStorageType>&
    +          member) {
         return operator=(member.Get());
       }
     
    @@ -286,36 +289,39 @@ bool operator!=(const BasicPersistent
    +          typename MemberWeaknessTag, typename MemberCheckingPolicy,
    +          typename MemberStorageType>
     bool operator==(
         const BasicPersistent&
             p,
         const BasicMember& m) {
    +                      MemberCheckingPolicy, MemberStorageType>& m) {
       return p.Get() == m.Get();
     }
     
     template 
    +          typename MemberWeaknessTag, typename MemberCheckingPolicy,
    +          typename MemberStorageType>
     bool operator!=(
         const BasicPersistent&
             p,
         const BasicMember& m) {
    +                      MemberCheckingPolicy, MemberStorageType>& m) {
       return !(p == m);
     }
     
     template 
    +          typename MemberStorageType, typename T2,
    +          typename PersistentWeaknessPolicy, typename PersistentLocationPolicy,
    +          typename PersistentCheckingPolicy>
     bool operator==(
         const BasicMember& m,
    +                      MemberCheckingPolicy, MemberStorageType>& m,
         const BasicPersistent&
             p) {
    @@ -324,11 +330,12 @@ bool operator==(
     
     template 
    +          typename MemberStorageType, typename T2,
    +          typename PersistentWeaknessPolicy, typename PersistentLocationPolicy,
    +          typename PersistentCheckingPolicy>
     bool operator!=(
         const BasicMember& m,
    +                      MemberCheckingPolicy, MemberStorageType>& m,
         const BasicPersistent&
             p) {
    diff --git a/deps/v8/include/cppgc/type-traits.h b/deps/v8/include/cppgc/type-traits.h
    index 2f499e6886b929..4651435390058f 100644
    --- a/deps/v8/include/cppgc/type-traits.h
    +++ b/deps/v8/include/cppgc/type-traits.h
    @@ -16,7 +16,7 @@ class Visitor;
     
     namespace internal {
     template 
    +          typename CheckingPolicy, typename StorageType>
     class BasicMember;
     struct DijkstraWriteBarrierPolicy;
     struct NoWriteBarrierPolicy;
    @@ -126,9 +126,10 @@ template 
     struct IsSubclassOfBasicMemberTemplate {
      private:
    -  template 
    +  template 
       static std::true_type SubclassCheck(
    -      BasicMember*);
    +      BasicMember*);
       static std::false_type SubclassCheck(...);
     
      public:
    diff --git a/deps/v8/include/cppgc/visitor.h b/deps/v8/include/cppgc/visitor.h
    index f7ebc1d01f566e..9b135e39a0be1c 100644
    --- a/deps/v8/include/cppgc/visitor.h
    +++ b/deps/v8/include/cppgc/visitor.h
    @@ -99,6 +99,20 @@ class V8_EXPORT Visitor {
                   &HandleWeak>, &weak_member);
       }
     
    +#if defined(CPPGC_POINTER_COMPRESSION)
    +  /**
    +   * Trace method for UncompressedMember.
    +   *
    +   * \param member UncompressedMember reference retaining an object.
    +   */
    +  template 
    +  void Trace(const subtle::UncompressedMember& member) {
    +    const T* value = member.GetRawAtomic();
    +    CPPGC_DCHECK(value != kSentinelPointer);
    +    TraceImpl(value);
    +  }
    +#endif  // defined(CPPGC_POINTER_COMPRESSION)
    +
       /**
        * Trace method for inlined objects that are not allocated themselves but
        * otherwise follow managed heap layout and have a Trace() method.
    @@ -229,7 +243,8 @@ class V8_EXPORT Visitor {
       }
     
       /**
    -   * Trace method for retaining containers weakly.
    +   * Trace method for retaining containers weakly. Note that weak containers
    +   * should emit write barriers.
        *
        * \param object reference to the container.
        * \param callback to be invoked.
    diff --git a/deps/v8/include/js_protocol.pdl b/deps/v8/include/js_protocol.pdl
    index 6efcf787854dac..6285d9b6f24f63 100644
    --- a/deps/v8/include/js_protocol.pdl
    +++ b/deps/v8/include/js_protocol.pdl
    @@ -511,6 +511,7 @@ domain Debugger
             CompileError
             BlockedByActiveGenerator
             BlockedByActiveFunction
    +        BlockedByTopLevelEsModuleChange
           # Exception details if any. Only present when `status` is `CompileError`.
           optional Runtime.ExceptionDetails exceptionDetails
     
    @@ -1402,6 +1403,13 @@ domain Runtime
           optional string objectGroup
           # Whether to throw an exception if side effect cannot be ruled out during evaluation.
           experimental optional boolean throwOnSideEffect
    +      # An alternative way to specify the execution context to call function on.
    +      # Compared to contextId that may be reused across processes, this is guaranteed to be
    +      # system-unique, so it can be used to prevent accidental function call
    +      # in context different than intended (e.g. as a result of navigation across process
    +      # boundaries).
    +      # This is mutually exclusive with `executionContextId`.
    +      experimental optional string uniqueContextId
           # Whether the result should contain `webDriverValue`, serialized according to
           # https://w3c.github.io/webdriver-bidi. This is mutually exclusive with `returnByValue`, but
           # resulting `objectId` is still provided.
    @@ -1734,7 +1742,9 @@ domain Runtime
       event executionContextDestroyed
         parameters
           # Id of the destroyed context
    -      ExecutionContextId executionContextId
    +      deprecated ExecutionContextId executionContextId
    +      # Unique Id of the destroyed context
    +      experimental string executionContextUniqueId
     
       # Issued when all executionContexts were cleared in browser
       event executionContextsCleared
    diff --git a/deps/v8/include/libplatform/v8-tracing.h b/deps/v8/include/libplatform/v8-tracing.h
    index 12489327c54210..6039a9c520b6a3 100644
    --- a/deps/v8/include/libplatform/v8-tracing.h
    +++ b/deps/v8/include/libplatform/v8-tracing.h
    @@ -282,12 +282,12 @@ class V8_PLATFORM_EXPORT TracingController
                                     const char* name, uint64_t handle) override;
     
       static const char* GetCategoryGroupName(const uint8_t* category_enabled_flag);
    -#endif  // !defined(V8_USE_PERFETTO)
     
       void AddTraceStateObserver(
           v8::TracingController::TraceStateObserver* observer) override;
       void RemoveTraceStateObserver(
           v8::TracingController::TraceStateObserver* observer) override;
    +#endif  // !defined(V8_USE_PERFETTO)
     
       void StartTracing(TraceConfig* trace_config);
       void StopTracing();
    @@ -307,7 +307,6 @@ class V8_PLATFORM_EXPORT TracingController
       std::unique_ptr mutex_;
       std::unique_ptr trace_config_;
       std::atomic_bool recording_{false};
    -  std::unordered_set observers_;
     
     #if defined(V8_USE_PERFETTO)
       std::ostream* output_stream_ = nullptr;
    @@ -316,6 +315,7 @@ class V8_PLATFORM_EXPORT TracingController
       TraceEventListener* listener_for_testing_ = nullptr;
       std::unique_ptr tracing_session_;
     #else   // !defined(V8_USE_PERFETTO)
    +  std::unordered_set observers_;
       std::unique_ptr trace_buffer_;
     #endif  // !defined(V8_USE_PERFETTO)
     
    diff --git a/deps/v8/include/v8-array-buffer.h b/deps/v8/include/v8-array-buffer.h
    index 841bd02a793333..804fc42c4b56dd 100644
    --- a/deps/v8/include/v8-array-buffer.h
    +++ b/deps/v8/include/v8-array-buffer.h
    @@ -53,12 +53,28 @@ class V8_EXPORT BackingStore : public v8::internal::BackingStoreBase {
        */
       size_t ByteLength() const;
     
    +  /**
    +   * The maximum length (in bytes) that this backing store may grow to.
    +   *
    +   * If this backing store was created for a resizable ArrayBuffer or a growable
    +   * SharedArrayBuffer, it is >= ByteLength(). Otherwise it is ==
    +   * ByteLength().
    +   */
    +  size_t MaxByteLength() const;
    +
       /**
        * Indicates whether the backing store was created for an ArrayBuffer or
        * a SharedArrayBuffer.
        */
       bool IsShared() const;
     
    +  /**
    +   * Indicates whether the backing store was created for a resizable ArrayBuffer
    +   * or a growable SharedArrayBuffer, and thus may be resized by user JavaScript
    +   * code.
    +   */
    +  bool IsResizableByUserJavaScript() const;
    +
       /**
        * Prevent implicit instantiation of operator delete with size_t argument.
        * The size_t argument would be incorrect because ptr points to the
    @@ -189,6 +205,11 @@ class V8_EXPORT ArrayBuffer : public Object {
        */
       size_t ByteLength() const;
     
    +  /**
    +   * Maximum length in bytes.
    +   */
    +  size_t MaxByteLength() const;
    +
       /**
        * Create a new ArrayBuffer. Allocate |byte_length| bytes.
        * Allocated memory will be owned by a created ArrayBuffer and
    @@ -235,6 +256,21 @@ class V8_EXPORT ArrayBuffer : public Object {
           void* data, size_t byte_length, v8::BackingStore::DeleterCallback deleter,
           void* deleter_data);
     
    +  /**
    +   * Returns a new resizable standalone BackingStore that is allocated using the
    +   * array buffer allocator of the isolate. The result can be later passed to
    +   * ArrayBuffer::New.
    +   *
    +   * |byte_length| must be <= |max_byte_length|.
    +   *
    +   * This function is usable without an isolate. Unlike |NewBackingStore| calls
    +   * with an isolate, GCs cannot be triggered, and there are no
    +   * retries. Allocation failure will cause the function to crash with an
    +   * out-of-memory error.
    +   */
    +  static std::unique_ptr NewResizableBackingStore(
    +      size_t byte_length, size_t max_byte_length);
    +
       /**
        * Returns true if this ArrayBuffer may be detached.
        */
    @@ -392,6 +428,11 @@ class V8_EXPORT SharedArrayBuffer : public Object {
        */
       size_t ByteLength() const;
     
    +  /**
    +   * Maximum length in bytes.
    +   */
    +  size_t MaxByteLength() const;
    +
       /**
        * Create a new SharedArrayBuffer. Allocate |byte_length| bytes.
        * Allocated memory will be owned by a created SharedArrayBuffer and
    diff --git a/deps/v8/include/v8-callbacks.h b/deps/v8/include/v8-callbacks.h
    index 0ffdfb6656fc64..f0fa561a3d76fb 100644
    --- a/deps/v8/include/v8-callbacks.h
    +++ b/deps/v8/include/v8-callbacks.h
    @@ -7,6 +7,7 @@
     
     #include 
     
    +#include 
     #include 
     
     #include "cppgc/common.h"
    @@ -328,6 +329,10 @@ using WasmSimdEnabledCallback = bool (*)(Local context);
     // --- Callback for checking if WebAssembly exceptions are enabled ---
     using WasmExceptionsEnabledCallback = bool (*)(Local context);
     
    +// --- Callback for checking if WebAssembly GC is enabled ---
    +// If the callback returns true, it will also enable Wasm stringrefs.
    +using WasmGCEnabledCallback = bool (*)(Local context);
    +
     // --- Callback for checking if the SharedArrayBuffer constructor is enabled ---
     using SharedArrayBufferConstructorEnabledCallback =
         bool (*)(Local context);
    @@ -368,6 +373,13 @@ using HostImportModuleDynamicallyCallback = MaybeLocal (*)(
         Local resource_name, Local specifier,
         Local import_assertions);
     
    +/**
    + * Callback for requesting a compile hint for a function from the embedder. The
    + * first parameter is the position of the function in source code and the second
    + * parameter is embedder data to be passed back.
    + */
    +using CompileHintCallback = bool (*)(int, void*);
    +
     /**
      * HostInitializeImportMetaObjectCallback is called the first time import.meta
      * is accessed for a module. Subsequent access will reuse the same value.
    diff --git a/deps/v8/include/v8-context.h b/deps/v8/include/v8-context.h
    index 3ce0eb0af38c67..3589caabd4b7c1 100644
    --- a/deps/v8/include/v8-context.h
    +++ b/deps/v8/include/v8-context.h
    @@ -7,8 +7,11 @@
     
     #include 
     
    +#include 
    +
     #include "v8-data.h"          // NOLINT(build/include_directory)
     #include "v8-local-handle.h"  // NOLINT(build/include_directory)
    +#include "v8-maybe.h"         // NOLINT(build/include_directory)
     #include "v8-snapshot.h"      // NOLINT(build/include_directory)
     #include "v8config.h"         // NOLINT(build/include_directory)
     
    @@ -163,6 +166,42 @@ class V8_EXPORT Context : public Data {
        */
       void Exit();
     
    +  /**
    +   * Delegate to help with Deep freezing embedder-specific objects (such as
    +   * JSApiObjects) that can not be frozen natively.
    +   */
    +  class DeepFreezeDelegate {
    +   public:
    +    /**
    +     * Performs embedder-specific operations to freeze the provided embedder
    +     * object. The provided object *will* be frozen by DeepFreeze after this
    +     * function returns, so only embedder-specific objects need to be frozen.
    +     * This function *may not* create new JS objects or perform JS allocations.
    +     * Any v8 objects reachable from the provided embedder object that should
    +     * also be considered for freezing should be added to the children_out
    +     * parameter. Returns true if the operation completed successfully.
    +     */
    +    virtual bool FreezeEmbedderObjectAndGetChildren(
    +        Local obj, std::vector>& children_out) = 0;
    +  };
    +
    +  /**
    +   * Attempts to recursively freeze all objects reachable from this context.
    +   * Some objects (generators, iterators, non-const closures) can not be frozen
    +   * and will cause this method to throw an error. An optional delegate can be
    +   * provided to help freeze embedder-specific objects.
    +   *
    +   * Freezing occurs in two steps:
    +   * 1. "Marking" where we iterate through all objects reachable by this
    +   *    context, accumulating a list of objects that need to be frozen and
    +   *    looking for objects that can't be frozen. This step is separated because
    +   *    it is more efficient when we can assume there is no garbage collection.
    +   * 2. "Freezing" where we go through the list of objects and freezing them.
    +   *    This effectively requires copying them so it may trigger garbage
    +   *    collection.
    +   */
    +  Maybe DeepFreeze(DeepFreezeDelegate* delegate = nullptr);
    +
       /** Returns the isolate associated with a current context. */
       Isolate* GetIsolate();
     
    @@ -365,13 +404,18 @@ Local Context::GetEmbedderData(int index) {
     #ifdef V8_COMPRESS_POINTERS
       // We read the full pointer value and then decompress it in order to avoid
       // dealing with potential endiannes issues.
    -  value =
    -      I::DecompressTaggedAnyField(embedder_data, static_cast(value));
    +  value = I::DecompressTaggedField(embedder_data, static_cast(value));
     #endif
    +
    +#ifdef V8_ENABLE_CONSERVATIVE_STACK_SCANNING
    +  return Local(reinterpret_cast(value));
    +#else
       internal::Isolate* isolate = internal::IsolateFromNeverReadOnlySpaceObject(
           *reinterpret_cast(this));
       A* result = HandleScope::CreateHandle(isolate, value);
       return Local(reinterpret_cast(result));
    +#endif
    +
     #else
       return SlowGetEmbedderData(index);
     #endif
    @@ -381,7 +425,7 @@ void* Context::GetAlignedPointerFromEmbedderData(int index) {
     #if !defined(V8_ENABLE_CHECKS)
       using A = internal::Address;
       using I = internal::Internals;
    -  A ctx = *reinterpret_cast(this);
    +  A ctx = internal::ValueHelper::ValueAsAddress(this);
       A embedder_data =
           I::ReadTaggedPointerField(ctx, I::kNativeContextEmbedderDataOffset);
       int value_offset = I::kEmbedderDataArrayHeaderSize +
    diff --git a/deps/v8/include/v8-cppgc.h b/deps/v8/include/v8-cppgc.h
    index 3a6582cd258496..4a457027c9f76b 100644
    --- a/deps/v8/include/v8-cppgc.h
    +++ b/deps/v8/include/v8-cppgc.h
    @@ -77,6 +77,12 @@ struct WrapperDescriptor final {
     };
     
     struct V8_EXPORT CppHeapCreateParams {
    +  CppHeapCreateParams(
    +      std::vector> custom_spaces,
    +      WrapperDescriptor wrapper_descriptor)
    +      : custom_spaces(std::move(custom_spaces)),
    +        wrapper_descriptor(wrapper_descriptor) {}
    +
       CppHeapCreateParams(const CppHeapCreateParams&) = delete;
       CppHeapCreateParams& operator=(const CppHeapCreateParams&) = delete;
     
    diff --git a/deps/v8/include/v8-embedder-heap.h b/deps/v8/include/v8-embedder-heap.h
    index f994cdfdf34376..9e2e3ef58c4341 100644
    --- a/deps/v8/include/v8-embedder-heap.h
    +++ b/deps/v8/include/v8-embedder-heap.h
    @@ -5,27 +5,14 @@
     #ifndef INCLUDE_V8_EMBEDDER_HEAP_H_
     #define INCLUDE_V8_EMBEDDER_HEAP_H_
     
    -#include 
    -#include 
    -
    -#include 
    -#include 
    -
    -#include "cppgc/common.h"
    -#include "v8-local-handle.h"   // NOLINT(build/include_directory)
     #include "v8-traced-handle.h"  // NOLINT(build/include_directory)
     #include "v8config.h"          // NOLINT(build/include_directory)
     
     namespace v8 {
     
    -class Data;
     class Isolate;
     class Value;
     
    -namespace internal {
    -class LocalEmbedderHeapTracer;
    -}  // namespace internal
    -
     /**
      * Handler for embedder roots on non-unified heap garbage collections.
      */
    @@ -62,162 +49,6 @@ class V8_EXPORT EmbedderRootsHandler {
       virtual void ResetRoot(const v8::TracedReference& handle) = 0;
     };
     
    -/**
    - * Interface for tracing through the embedder heap. During a V8 garbage
    - * collection, V8 collects hidden fields of all potential wrappers, and at the
    - * end of its marking phase iterates the collection and asks the embedder to
    - * trace through its heap and use reporter to report each JavaScript object
    - * reachable from any of the given wrappers.
    - */
    -class V8_EXPORT
    -// GCC doesn't like combining __attribute__(()) with [[deprecated]].
    -#ifdef __clang__
    -V8_DEPRECATED("Use CppHeap when working with v8::TracedReference.")
    -#endif  // __clang__
    -    EmbedderHeapTracer {
    - public:
    -  using EmbedderStackState = cppgc::EmbedderStackState;
    -
    -  enum TraceFlags : uint64_t {
    -    kNoFlags = 0,
    -    kReduceMemory = 1 << 0,
    -    kForced = 1 << 2,
    -  };
    -
    -  /**
    -   * Interface for iterating through |TracedReference| handles.
    -   */
    -  class V8_EXPORT TracedGlobalHandleVisitor {
    -   public:
    -    virtual ~TracedGlobalHandleVisitor() = default;
    -    virtual void VisitTracedReference(const TracedReference& handle) {}
    -  };
    -
    -  /**
    -   * Summary of a garbage collection cycle. See |TraceEpilogue| on how the
    -   * summary is reported.
    -   */
    -  struct TraceSummary {
    -    /**
    -     * Time spent managing the retained memory in milliseconds. This can e.g.
    -     * include the time tracing through objects in the embedder.
    -     */
    -    double time = 0.0;
    -
    -    /**
    -     * Memory retained by the embedder through the |EmbedderHeapTracer|
    -     * mechanism in bytes.
    -     */
    -    size_t allocated_size = 0;
    -  };
    -
    -  virtual ~EmbedderHeapTracer() = default;
    -
    -  /**
    -   * Iterates all |TracedReference| handles created for the |v8::Isolate| the
    -   * tracer is attached to.
    -   */
    -  void IterateTracedGlobalHandles(TracedGlobalHandleVisitor* visitor);
    -
    -  /**
    -   * Called by the embedder to set the start of the stack which is e.g. used by
    -   * V8 to determine whether handles are used from stack or heap.
    -   */
    -  void SetStackStart(void* stack_start);
    -
    -  /**
    -   * Called by v8 to register internal fields of found wrappers.
    -   *
    -   * The embedder is expected to store them somewhere and trace reachable
    -   * wrappers from them when called through |AdvanceTracing|.
    -   */
    -  virtual void RegisterV8References(
    -      const std::vector>& embedder_fields) = 0;
    -
    -  void RegisterEmbedderReference(const BasicTracedReference& ref);
    -
    -  /**
    -   * Called at the beginning of a GC cycle.
    -   */
    -  virtual void TracePrologue(TraceFlags flags) {}
    -
    -  /**
    -   * Called to advance tracing in the embedder.
    -   *
    -   * The embedder is expected to trace its heap starting from wrappers reported
    -   * by RegisterV8References method, and report back all reachable wrappers.
    -   * Furthermore, the embedder is expected to stop tracing by the given
    -   * deadline. A deadline of infinity means that tracing should be finished.
    -   *
    -   * Returns |true| if tracing is done, and false otherwise.
    -   */
    -  virtual bool AdvanceTracing(double deadline_in_ms) = 0;
    -
    -  /*
    -   * Returns true if there no more tracing work to be done (see AdvanceTracing)
    -   * and false otherwise.
    -   */
    -  virtual bool IsTracingDone() = 0;
    -
    -  /**
    -   * Called at the end of a GC cycle.
    -   *
    -   * Note that allocation is *not* allowed within |TraceEpilogue|. Can be
    -   * overriden to fill a |TraceSummary| that is used by V8 to schedule future
    -   * garbage collections.
    -   */
    -  virtual void TraceEpilogue(TraceSummary* trace_summary) {}
    -
    -  /**
    -   * Called upon entering the final marking pause. No more incremental marking
    -   * steps will follow this call.
    -   */
    -  virtual void EnterFinalPause(EmbedderStackState stack_state) = 0;
    -
    -  /*
    -   * Called by the embedder to request immediate finalization of the currently
    -   * running tracing phase that has been started with TracePrologue and not
    -   * yet finished with TraceEpilogue.
    -   *
    -   * Will be a noop when currently not in tracing.
    -   *
    -   * This is an experimental feature.
    -   */
    -  void FinalizeTracing();
    -
    -  /**
    -   * See documentation on EmbedderRootsHandler.
    -   */
    -  virtual bool IsRootForNonTracingGC(
    -      const v8::TracedReference& handle);
    -
    -  /**
    -   * See documentation on EmbedderRootsHandler.
    -   */
    -  virtual void ResetHandleInNonTracingGC(
    -      const v8::TracedReference& handle);
    -
    -  /*
    -   * Called by the embedder to signal newly allocated or freed memory. Not bound
    -   * to tracing phases. Embedders should trade off when increments are reported
    -   * as V8 may consult global heuristics on whether to trigger garbage
    -   * collection on this change.
    -   */
    -  void IncreaseAllocatedSize(size_t bytes);
    -  void DecreaseAllocatedSize(size_t bytes);
    -
    -  /*
    -   * Returns the v8::Isolate this tracer is attached too and |nullptr| if it
    -   * is not attached to any v8::Isolate.
    -   */
    -  v8::Isolate* isolate() const { return v8_isolate_; }
    -
    - protected:
    -  v8::Isolate* v8_isolate_ = nullptr;
    -
    -  friend class internal::LocalEmbedderHeapTracer;
    -};
    -
     }  // namespace v8
     
     #endif  // INCLUDE_V8_EMBEDDER_HEAP_H_
    diff --git a/deps/v8/include/v8-fast-api-calls.h b/deps/v8/include/v8-fast-api-calls.h
    index 9ea43fe2535397..0fe7cd2489b05e 100644
    --- a/deps/v8/include/v8-fast-api-calls.h
    +++ b/deps/v8/include/v8-fast-api-calls.h
    @@ -247,6 +247,7 @@ class CTypeInfo {
         kUint64,
         kFloat32,
         kFloat64,
    +    kPointer,
         kV8Value,
         kSeqOneByteString,
         kApiObject,  // This will be deprecated once all users have
    @@ -435,6 +436,7 @@ struct AnyCType {
         uint64_t uint64_value;
         float float_value;
         double double_value;
    +    void* pointer_value;
         Local object_value;
         Local sequence_value;
         const FastApiTypedArray* uint8_ta_value;
    @@ -620,6 +622,7 @@ class CFunctionInfoImpl : public CFunctionInfo {
                           kReturnType == CTypeInfo::Type::kUint32 ||
                           kReturnType == CTypeInfo::Type::kFloat32 ||
                           kReturnType == CTypeInfo::Type::kFloat64 ||
    +                      kReturnType == CTypeInfo::Type::kPointer ||
                           kReturnType == CTypeInfo::Type::kAny,
                       "64-bit int, string and api object values are not currently "
                       "supported return types.");
    @@ -658,13 +661,14 @@ struct CTypeInfoTraits {};
     
     #define PRIMITIVE_C_TYPES(V) \
       V(bool, kBool)             \
    +  V(uint8_t, kUint8)         \
       V(int32_t, kInt32)         \
       V(uint32_t, kUint32)       \
       V(int64_t, kInt64)         \
       V(uint64_t, kUint64)       \
       V(float, kFloat32)         \
       V(double, kFloat64)        \
    -  V(uint8_t, kUint8)
    +  V(void*, kPointer)
     
     // Same as above, but includes deprecated types for compatibility.
     #define ALL_C_TYPES(V)               \
    @@ -698,13 +702,13 @@ PRIMITIVE_C_TYPES(DEFINE_TYPE_INFO_TRAITS)
       };
     
     #define TYPED_ARRAY_C_TYPES(V) \
    +  V(uint8_t, kUint8)           \
       V(int32_t, kInt32)           \
       V(uint32_t, kUint32)         \
       V(int64_t, kInt64)           \
       V(uint64_t, kUint64)         \
       V(float, kFloat32)           \
    -  V(double, kFloat64)          \
    -  V(uint8_t, kUint8)
    +  V(double, kFloat64)
     
     TYPED_ARRAY_C_TYPES(SPECIALIZE_GET_TYPE_INFO_HELPER_FOR_TA)
     
    diff --git a/deps/v8/include/v8-function-callback.h b/deps/v8/include/v8-function-callback.h
    index 2adff99b1cbb82..60ecca1fd2a34f 100644
    --- a/deps/v8/include/v8-function-callback.h
    +++ b/deps/v8/include/v8-function-callback.h
    @@ -21,6 +21,7 @@ class Value;
     namespace internal {
     class FunctionCallbackArguments;
     class PropertyCallbackArguments;
    +class Builtins;
     }  // namespace internal
     
     namespace debug {
    @@ -74,6 +75,11 @@ class ReturnValue {
       V8_INLINE void SetInternal(internal::Address value) { *value_ = value; }
       V8_INLINE internal::Address GetDefaultValue();
       V8_INLINE explicit ReturnValue(internal::Address* slot);
    +
    +  // See FunctionCallbackInfo.
    +  static constexpr int kIsolateValueIndex = -2;
    +  static constexpr int kDefaultValueValueIndex = -1;
    +
       internal::Address* value_;
     };
     
    @@ -116,19 +122,35 @@ class FunctionCallbackInfo {
       V8_INLINE Isolate* GetIsolate() const;
       /** The ReturnValue for the call. */
       V8_INLINE ReturnValue GetReturnValue() const;
    -  // This shouldn't be public, but the arm compiler needs it.
    -  static const int kArgsLength = 6;
     
    - protected:
    + private:
       friend class internal::FunctionCallbackArguments;
       friend class internal::CustomArguments;
       friend class debug::ConsoleCallArguments;
    -  static const int kHolderIndex = 0;
    -  static const int kIsolateIndex = 1;
    -  static const int kReturnValueDefaultValueIndex = 2;
    -  static const int kReturnValueIndex = 3;
    -  static const int kDataIndex = 4;
    -  static const int kNewTargetIndex = 5;
    +  friend class internal::Builtins;
    +  static constexpr int kHolderIndex = 0;
    +  static constexpr int kIsolateIndex = 1;
    +  static constexpr int kReturnValueDefaultValueIndex = 2;
    +  static constexpr int kReturnValueIndex = 3;
    +  static constexpr int kDataIndex = 4;
    +  static constexpr int kNewTargetIndex = 5;
    +
    +  static constexpr int kArgsLength = 6;
    +  static constexpr int kArgsLengthWithReceiver = 7;
    +
    +  // Codegen constants:
    +  static constexpr int kSize = 3 * internal::kApiSystemPointerSize;
    +  static constexpr int kImplicitArgsOffset = 0;
    +  static constexpr int kValuesOffset =
    +      kImplicitArgsOffset + internal::kApiSystemPointerSize;
    +  static constexpr int kLengthOffset =
    +      kValuesOffset + internal::kApiSystemPointerSize;
    +
    +  static constexpr int kThisValuesIndex = -1;
    +  static_assert(ReturnValue::kDefaultValueValueIndex ==
    +                kReturnValueDefaultValueIndex - kReturnValueIndex);
    +  static_assert(ReturnValue::kIsolateValueIndex ==
    +                kIsolateIndex - kReturnValueIndex);
     
       V8_INLINE FunctionCallbackInfo(internal::Address* implicit_args,
                                      internal::Address* values, int length);
    @@ -229,22 +251,24 @@ class PropertyCallbackInfo {
        */
       V8_INLINE bool ShouldThrowOnError() const;
     
    -  // This shouldn't be public, but the arm compiler needs it.
    -  static const int kArgsLength = 7;
    -
    - protected:
    + private:
       friend class MacroAssembler;
       friend class internal::PropertyCallbackArguments;
       friend class internal::CustomArguments;
    -  static const int kShouldThrowOnErrorIndex = 0;
    -  static const int kHolderIndex = 1;
    -  static const int kIsolateIndex = 2;
    -  static const int kReturnValueDefaultValueIndex = 3;
    -  static const int kReturnValueIndex = 4;
    -  static const int kDataIndex = 5;
    -  static const int kThisIndex = 6;
    -
    -  V8_INLINE PropertyCallbackInfo(internal::Address* args) : args_(args) {}
    +  static constexpr int kShouldThrowOnErrorIndex = 0;
    +  static constexpr int kHolderIndex = 1;
    +  static constexpr int kIsolateIndex = 2;
    +  static constexpr int kReturnValueDefaultValueIndex = 3;
    +  static constexpr int kReturnValueIndex = 4;
    +  static constexpr int kDataIndex = 5;
    +  static constexpr int kThisIndex = 6;
    +
    +  static constexpr int kArgsLength = 7;
    +
    +  static constexpr int kSize = 1 * internal::kApiSystemPointerSize;
    +
    +  V8_INLINE explicit PropertyCallbackInfo(internal::Address* args)
    +      : args_(args) {}
       internal::Address* args_;
     };
     
    @@ -285,7 +309,7 @@ void ReturnValue::Set(const Local handle) {
       if (V8_UNLIKELY(handle.IsEmpty())) {
         *value_ = GetDefaultValue();
       } else {
    -    *value_ = *reinterpret_cast(*handle);
    +    *value_ = internal::ValueHelper::ValueAsAddress(*handle);
       }
     }
     
    @@ -328,41 +352,46 @@ void ReturnValue::Set(bool value) {
       } else {
         root_index = I::kFalseValueRootIndex;
       }
    -  *value_ = *I::GetRoot(GetIsolate(), root_index);
    +  *value_ = I::GetRoot(GetIsolate(), root_index);
     }
     
     template 
     void ReturnValue::SetNull() {
       static_assert(std::is_base_of::value, "type check");
       using I = internal::Internals;
    -  *value_ = *I::GetRoot(GetIsolate(), I::kNullValueRootIndex);
    +  *value_ = I::GetRoot(GetIsolate(), I::kNullValueRootIndex);
     }
     
     template 
     void ReturnValue::SetUndefined() {
       static_assert(std::is_base_of::value, "type check");
       using I = internal::Internals;
    -  *value_ = *I::GetRoot(GetIsolate(), I::kUndefinedValueRootIndex);
    +  *value_ = I::GetRoot(GetIsolate(), I::kUndefinedValueRootIndex);
     }
     
     template 
     void ReturnValue::SetEmptyString() {
       static_assert(std::is_base_of::value, "type check");
       using I = internal::Internals;
    -  *value_ = *I::GetRoot(GetIsolate(), I::kEmptyStringRootIndex);
    +  *value_ = I::GetRoot(GetIsolate(), I::kEmptyStringRootIndex);
     }
     
     template 
     Isolate* ReturnValue::GetIsolate() const {
       // Isolate is always the pointer below the default value on the stack.
    -  return *reinterpret_cast(&value_[-2]);
    +  return *reinterpret_cast(&value_[kIsolateValueIndex]);
     }
     
     template 
     Local ReturnValue::Get() const {
       using I = internal::Internals;
    -  if (*value_ == *I::GetRoot(GetIsolate(), I::kTheHoleValueRootIndex))
    -    return Local(*Undefined(GetIsolate()));
    +#if V8_STATIC_ROOTS_BOOL
    +  if (I::is_identical(*value_, I::StaticReadOnlyRoot::kTheHoleValue)) {
    +#else
    +  if (*value_ == I::GetRoot(GetIsolate(), I::kTheHoleValueRootIndex)) {
    +#endif
    +    return Undefined(GetIsolate());
    +  }
       return Local::New(GetIsolate(), reinterpret_cast(value_));
     }
     
    @@ -375,7 +404,7 @@ void ReturnValue::Set(S* whatever) {
     template 
     internal::Address ReturnValue::GetDefaultValue() {
       // Default value is always the pointer below value_ on the stack.
    -  return value_[-1];
    +  return value_[kDefaultValueValueIndex];
     }
     
     template 
    @@ -387,31 +416,29 @@ FunctionCallbackInfo::FunctionCallbackInfo(internal::Address* implicit_args,
     template 
     Local FunctionCallbackInfo::operator[](int i) const {
       // values_ points to the first argument (not the receiver).
    -  if (i < 0 || length_ <= i) return Local(*Undefined(GetIsolate()));
    -  return Local(reinterpret_cast(values_ + i));
    +  if (i < 0 || length_ <= i) return Undefined(GetIsolate());
    +  return Local::FromSlot(values_ + i);
     }
     
     template 
     Local FunctionCallbackInfo::This() const {
       // values_ points to the first argument (not the receiver).
    -  return Local(reinterpret_cast(values_ - 1));
    +  return Local::FromSlot(values_ + kThisValuesIndex);
     }
     
     template 
     Local FunctionCallbackInfo::Holder() const {
    -  return Local(
    -      reinterpret_cast(&implicit_args_[kHolderIndex]));
    +  return Local::FromSlot(&implicit_args_[kHolderIndex]);
     }
     
     template 
     Local FunctionCallbackInfo::NewTarget() const {
    -  return Local(
    -      reinterpret_cast(&implicit_args_[kNewTargetIndex]));
    +  return Local::FromSlot(&implicit_args_[kNewTargetIndex]);
     }
     
     template 
     Local FunctionCallbackInfo::Data() const {
    -  return Local(reinterpret_cast(&implicit_args_[kDataIndex]));
    +  return Local::FromSlot(&implicit_args_[kDataIndex]);
     }
     
     template 
    @@ -441,17 +468,17 @@ Isolate* PropertyCallbackInfo::GetIsolate() const {
     
     template 
     Local PropertyCallbackInfo::Data() const {
    -  return Local(reinterpret_cast(&args_[kDataIndex]));
    +  return Local::FromSlot(&args_[kDataIndex]);
     }
     
     template 
     Local PropertyCallbackInfo::This() const {
    -  return Local(reinterpret_cast(&args_[kThisIndex]));
    +  return Local::FromSlot(&args_[kThisIndex]);
     }
     
     template 
     Local PropertyCallbackInfo::Holder() const {
    -  return Local(reinterpret_cast(&args_[kHolderIndex]));
    +  return Local::FromSlot(&args_[kHolderIndex]);
     }
     
     template 
    diff --git a/deps/v8/include/v8-function.h b/deps/v8/include/v8-function.h
    index 2dc7e722bb9e8c..1e35bfc8bfa272 100644
    --- a/deps/v8/include/v8-function.h
    +++ b/deps/v8/include/v8-function.h
    @@ -59,6 +59,7 @@ class V8_EXPORT Function : public Object {
       void SetName(Local name);
       Local GetName() const;
     
    +  V8_DEPRECATED("No direct replacement")
       MaybeLocal GetUnboundScript() const;
     
       /**
    diff --git a/deps/v8/include/v8-inspector.h b/deps/v8/include/v8-inspector.h
    index aa5a044afb61c4..563ad196d6e607 100644
    --- a/deps/v8/include/v8-inspector.h
    +++ b/deps/v8/include/v8-inspector.h
    @@ -32,19 +32,19 @@ namespace Debugger {
     namespace API {
     class SearchMatch;
     }
    -}
    +}  // namespace Debugger
     namespace Runtime {
     namespace API {
     class RemoteObject;
     class StackTrace;
     class StackTraceId;
    -}
    -}
    +}  // namespace API
    +}  // namespace Runtime
     namespace Schema {
     namespace API {
     class Domain;
     }
    -}
    +}  // namespace Schema
     }  // namespace protocol
     
     class V8_EXPORT StringView {
    @@ -134,6 +134,13 @@ class V8_EXPORT V8DebuggerId {
       int64_t m_second = 0;
     };
     
    +struct V8_EXPORT V8StackFrame {
    +  StringView sourceURL;
    +  StringView functionName;
    +  int lineNumber;
    +  int columnNumber;
    +};
    +
     class V8_EXPORT V8StackTrace {
      public:
       virtual StringView firstNonEmptySourceURL() const = 0;
    @@ -151,6 +158,8 @@ class V8_EXPORT V8StackTrace {
     
       // Safe to pass between threads, drops async chain.
       virtual std::unique_ptr clone() = 0;
    +
    +  virtual std::vector frames() const = 0;
     };
     
     class V8_EXPORT V8InspectorSession {
    @@ -203,6 +212,9 @@ class V8_EXPORT V8InspectorSession {
                                 std::unique_ptr* objectGroup) = 0;
       virtual void releaseObjectGroup(StringView) = 0;
       virtual void triggerPreciseCoverageDeltaUpdate(StringView occasion) = 0;
    +
    +  // Prepare for shutdown (disables debugger pausing, etc.).
    +  virtual void stop() = 0;
     };
     
     class V8_EXPORT WebDriverValue {
    @@ -365,9 +377,12 @@ class V8_EXPORT V8Inspector {
         virtual void flushProtocolNotifications() = 0;
       };
       enum ClientTrustLevel { kUntrusted, kFullyTrusted };
    +  enum SessionPauseState { kWaitingForDebugger, kNotWaitingForDebugger };
    +  // TODO(chromium:1352175): remove default value once downstream change lands.
       virtual std::unique_ptr connect(
           int contextGroupId, Channel*, StringView state,
    -      ClientTrustLevel client_trust_level) {
    +      ClientTrustLevel client_trust_level,
    +      SessionPauseState = kNotWaitingForDebugger) {
         return nullptr;
       }
     
    diff --git a/deps/v8/include/v8-internal.h b/deps/v8/include/v8-internal.h
    index a4b8ee0824d81d..e61bb6e4154eb0 100644
    --- a/deps/v8/include/v8-internal.h
    +++ b/deps/v8/include/v8-internal.h
    @@ -21,15 +21,13 @@ class Array;
     class Context;
     class Data;
     class Isolate;
    -template 
    -class Local;
     
     namespace internal {
     
     class Isolate;
     
     typedef uintptr_t Address;
    -static const Address kNullAddress = 0;
    +static constexpr Address kNullAddress = 0;
     
     constexpr int KB = 1024;
     constexpr int MB = KB * 1024;
    @@ -82,7 +80,7 @@ struct SmiTagging<4> {
           static_cast(kUintptrAllBitsSet << (kSmiValueSize - 1));
       static constexpr intptr_t kSmiMaxValue = -(kSmiMinValue + 1);
     
    -  V8_INLINE static int SmiToInt(const internal::Address value) {
    +  V8_INLINE static int SmiToInt(Address value) {
         int shift_bits = kSmiTagSize + kSmiShiftSize;
         // Truncate and shift down (requires >> to be sign extending).
         return static_cast(static_cast(value)) >> shift_bits;
    @@ -107,7 +105,7 @@ struct SmiTagging<8> {
           static_cast(kUintptrAllBitsSet << (kSmiValueSize - 1));
       static constexpr intptr_t kSmiMaxValue = -(kSmiMinValue + 1);
     
    -  V8_INLINE static int SmiToInt(const internal::Address value) {
    +  V8_INLINE static int SmiToInt(Address value) {
         int shift_bits = kSmiTagSize + kSmiShiftSize;
         // Shift down and throw away top 32 bits.
         return static_cast(static_cast(value) >> shift_bits);
    @@ -150,8 +148,9 @@ const int kSmiMinValue = static_cast(PlatformSmiTagging::kSmiMinValue);
     const int kSmiMaxValue = static_cast(PlatformSmiTagging::kSmiMaxValue);
     constexpr bool SmiValuesAre31Bits() { return kSmiValueSize == 31; }
     constexpr bool SmiValuesAre32Bits() { return kSmiValueSize == 32; }
    +constexpr bool Is64() { return kApiSystemPointerSize == sizeof(int64_t); }
     
    -V8_INLINE static constexpr internal::Address IntToSmi(int value) {
    +V8_INLINE static constexpr Address IntToSmi(int value) {
       return (static_cast
    (value) << (kSmiTagSize + kSmiShiftSize)) | kSmiTag; } @@ -242,6 +241,7 @@ static_assert(1ULL << (64 - kBoundedSizeShift) == #ifdef V8_COMPRESS_POINTERS +#ifdef V8_TARGET_OS_ANDROID // The size of the virtual memory reservation for an external pointer table. // This determines the maximum number of entries in a table. Using a maximum // size allows omitting bounds checks on table accesses if the indices are @@ -249,14 +249,18 @@ static_assert(1ULL << (64 - kBoundedSizeShift) == // value must be a power of two. static const size_t kExternalPointerTableReservationSize = 512 * MB; -// The maximum number of entries in an external pointer table. -static const size_t kMaxExternalPointers = - kExternalPointerTableReservationSize / kApiSystemPointerSize; - // The external pointer table indices stored in HeapObjects as external // pointers are shifted to the left by this amount to guarantee that they are // smaller than the maximum table size. static const uint32_t kExternalPointerIndexShift = 6; +#else +static const size_t kExternalPointerTableReservationSize = 1024 * MB; +static const uint32_t kExternalPointerIndexShift = 5; +#endif // V8_TARGET_OS_ANDROID + +// The maximum number of entries in an external pointer table. +static const size_t kMaxExternalPointers = + kExternalPointerTableReservationSize / kApiSystemPointerSize; static_assert((1 << (32 - kExternalPointerIndexShift)) == kMaxExternalPointers, "kExternalPointerTableReservationSize and " "kExternalPointerIndexShift don't match"); @@ -345,6 +349,14 @@ using ExternalPointer_t = Address; // that the Embedder is not using this byte (really only this one bit) for any // other purpose. This bit also does not collide with the memory tagging // extension (MTE) which would use bits [56, 60). +// +// External pointer tables are also available even when the sandbox is off but +// pointer compression is on. In that case, the mechanism can be used to easy +// alignment requirements as it turns unaligned 64-bit raw pointers into +// aligned 32-bit indices. To "opt-in" to the external pointer table mechanism +// for this purpose, instead of using the ExternalPointer accessors one needs to +// use ExternalPointerHandles directly and use them to access the pointers in an +// ExternalPointerTable. constexpr uint64_t kExternalPointerMarkBit = 1ULL << 62; constexpr uint64_t kExternalPointerTagMask = 0x40ff000000000000; constexpr uint64_t kExternalPointerTagShift = 48; @@ -367,71 +379,58 @@ constexpr uint64_t kAllExternalPointerTypeTags[] = { 0b11001100, 0b11010001, 0b11010010, 0b11010100, 0b11011000, 0b11100001, 0b11100010, 0b11100100, 0b11101000, 0b11110000}; +#define TAG(i) \ + ((kAllExternalPointerTypeTags[i] << kExternalPointerTagShift) | \ + kExternalPointerMarkBit) + // clang-format off -// New entries should be added with state "sandboxed". + // When adding new tags, please ensure that the code using these tags is // "substitution-safe", i.e. still operate safely if external pointers of the // same type are swapped by an attacker. See comment above for more details. -#define TAG(i) (kAllExternalPointerTypeTags[i]) // Shared external pointers are owned by the shared Isolate and stored in the // shared external pointer table associated with that Isolate, where they can // be accessed from multiple threads at the same time. The objects referenced // in this way must therefore always be thread-safe. -#define SHARED_EXTERNAL_POINTER_TAGS(V) \ - V(kFirstSharedTag, sandboxed, TAG(0)) \ - V(kWaiterQueueNodeTag, sandboxed, TAG(0)) \ - V(kExternalStringResourceTag, sandboxed, TAG(1)) \ - V(kExternalStringResourceDataTag, sandboxed, TAG(2)) \ - V(kLastSharedTag, sandboxed, TAG(2)) +#define SHARED_EXTERNAL_POINTER_TAGS(V) \ + V(kFirstSharedTag, TAG(0)) \ + V(kWaiterQueueNodeTag, TAG(0)) \ + V(kExternalStringResourceTag, TAG(1)) \ + V(kExternalStringResourceDataTag, TAG(2)) \ + V(kLastSharedTag, TAG(2)) // External pointers using these tags are kept in a per-Isolate external // pointer table and can only be accessed when this Isolate is active. -#define PER_ISOLATE_EXTERNAL_POINTER_TAGS(V) \ - V(kForeignForeignAddressTag, sandboxed, TAG(10)) \ - V(kNativeContextMicrotaskQueueTag, sandboxed, TAG(11)) \ - V(kEmbedderDataSlotPayloadTag, sandboxed, TAG(12)) \ - V(kExternalObjectValueTag, sandboxed, TAG(13)) \ - V(kCallHandlerInfoCallbackTag, sandboxed, TAG(14)) \ - V(kAccessorInfoGetterTag, sandboxed, TAG(15)) \ - V(kAccessorInfoSetterTag, sandboxed, TAG(16)) \ - V(kWasmInternalFunctionCallTargetTag, sandboxed, TAG(17)) \ - V(kWasmTypeInfoNativeTypeTag, sandboxed, TAG(18)) \ - V(kWasmExportedFunctionDataSignatureTag, sandboxed, TAG(19)) \ - V(kWasmContinuationJmpbufTag, sandboxed, TAG(20)) \ - V(kArrayBufferExtensionTag, sandboxed, TAG(21)) +#define PER_ISOLATE_EXTERNAL_POINTER_TAGS(V) \ + V(kForeignForeignAddressTag, TAG(10)) \ + V(kNativeContextMicrotaskQueueTag, TAG(11)) \ + V(kEmbedderDataSlotPayloadTag, TAG(12)) \ +/* This tag essentially stands for a `void*` pointer in the V8 API, and */ \ +/* it is the Embedder's responsibility to ensure type safety (against */ \ +/* substitution) and lifetime validity of these objects. */ \ + V(kExternalObjectValueTag, TAG(13)) \ + V(kCallHandlerInfoCallbackTag, TAG(14)) \ + V(kAccessorInfoGetterTag, TAG(15)) \ + V(kAccessorInfoSetterTag, TAG(16)) \ + V(kWasmInternalFunctionCallTargetTag, TAG(17)) \ + V(kWasmTypeInfoNativeTypeTag, TAG(18)) \ + V(kWasmExportedFunctionDataSignatureTag, TAG(19)) \ + V(kWasmContinuationJmpbufTag, TAG(20)) \ + V(kArrayBufferExtensionTag, TAG(21)) // All external pointer tags. #define ALL_EXTERNAL_POINTER_TAGS(V) \ SHARED_EXTERNAL_POINTER_TAGS(V) \ PER_ISOLATE_EXTERNAL_POINTER_TAGS(V) -// When the sandbox is enabled, external pointers marked as "sandboxed" above -// use the external pointer table (i.e. are sandboxed). This allows a gradual -// rollout of external pointer sandboxing. If the sandbox is off, no external -// pointers are sandboxed. -// -// Sandboxed external pointer tags are available when compressing pointers even -// when the sandbox is off. Some tags (e.g. kWaiterQueueNodeTag) are used -// manually with the external pointer table even when the sandbox is off to ease -// alignment requirements. -#define sandboxed(X) (X << kExternalPointerTagShift) | kExternalPointerMarkBit -#define unsandboxed(X) kUnsandboxedExternalPointerTag -#if defined(V8_COMPRESS_POINTERS) -#define EXTERNAL_POINTER_TAG_ENUM(Name, State, Bits) Name = State(Bits), -#else -#define EXTERNAL_POINTER_TAG_ENUM(Name, State, Bits) Name = unsandboxed(Bits), -#endif - +#define EXTERNAL_POINTER_TAG_ENUM(Name, Tag) Name = Tag, #define MAKE_TAG(HasMarkBit, TypeTag) \ ((static_cast(TypeTag) << kExternalPointerTagShift) | \ (HasMarkBit ? kExternalPointerMarkBit : 0)) enum ExternalPointerTag : uint64_t { // Empty tag value. Mostly used as placeholder. kExternalPointerNullTag = MAKE_TAG(0, 0b00000000), - // Tag to use for unsandboxed external pointers, which are still stored as - // raw pointers on the heap. - kUnsandboxedExternalPointerTag = MAKE_TAG(0, 0b00000000), // External pointer tag that will match any external pointer. Use with care! kAnyExternalPointerTag = MAKE_TAG(1, 0b11111111), // The free entry tag has all type bits set so every type check with a @@ -445,20 +444,11 @@ enum ExternalPointerTag : uint64_t { }; #undef MAKE_TAG -#undef unsandboxed -#undef sandboxed #undef TAG #undef EXTERNAL_POINTER_TAG_ENUM // clang-format on -// True if the external pointer is sandboxed and so must be referenced through -// an external pointer table. -V8_INLINE static constexpr bool IsSandboxedExternalPointerType( - ExternalPointerTag tag) { - return tag != kUnsandboxedExternalPointerTag; -} - // True if the external pointer must be accessed from the shared isolate's // external pointer table. V8_INLINE static constexpr bool IsSharedExternalPointerType( @@ -467,12 +457,10 @@ V8_INLINE static constexpr bool IsSharedExternalPointerType( } // Sanity checks. -#define CHECK_SHARED_EXTERNAL_POINTER_TAGS(Tag, ...) \ - static_assert(!IsSandboxedExternalPointerType(Tag) || \ - IsSharedExternalPointerType(Tag)); +#define CHECK_SHARED_EXTERNAL_POINTER_TAGS(Tag, ...) \ + static_assert(IsSharedExternalPointerType(Tag)); #define CHECK_NON_SHARED_EXTERNAL_POINTER_TAGS(Tag, ...) \ - static_assert(!IsSandboxedExternalPointerType(Tag) || \ - !IsSharedExternalPointerType(Tag)); + static_assert(!IsSharedExternalPointerType(Tag)); SHARED_EXTERNAL_POINTER_TAGS(CHECK_SHARED_EXTERNAL_POINTER_TAGS) PER_ISOLATE_EXTERNAL_POINTER_TAGS(CHECK_NON_SHARED_EXTERNAL_POINTER_TAGS) @@ -490,7 +478,7 @@ V8_EXPORT internal::Isolate* IsolateFromNeverReadOnlySpaceObject(Address obj); // Returns if we need to throw when an error occurs. This infers the language // mode based on the current context and the closure. This returns true if the // language mode is strict. -V8_EXPORT bool ShouldThrowOnError(v8::internal::Isolate* isolate); +V8_EXPORT bool ShouldThrowOnError(internal::Isolate* isolate); /** * This class exports constants and functionality from within v8 that * is necessary to implement inline functions in the v8 api. Don't @@ -498,8 +486,7 @@ V8_EXPORT bool ShouldThrowOnError(v8::internal::Isolate* isolate); */ class Internals { #ifdef V8_MAP_PACKING - V8_INLINE static constexpr internal::Address UnpackMapWord( - internal::Address mapword) { + V8_INLINE static constexpr Address UnpackMapWord(Address mapword) { // TODO(wenyuzhao): Clear header metadata. return mapword ^ kMapWordXorMask; } @@ -533,6 +520,8 @@ class Internals { static const int kStackGuardSize = 7 * kApiSystemPointerSize; static const int kBuiltinTier0EntryTableSize = 7 * kApiSystemPointerSize; static const int kBuiltinTier0TableSize = 7 * kApiSystemPointerSize; + static const int kLinearAllocationAreaSize = 3 * kApiSystemPointerSize; + static const int kThreadLocalTopSize = 25 * kApiSystemPointerSize; // ExternalPointerTable layout guarantees. static const int kExternalPointerTableBufferOffset = 0; @@ -545,31 +534,60 @@ class Internals { static const int kVariousBooleanFlagsOffset = kIsolateStackGuardOffset + kStackGuardSize; static const int kBuiltinTier0EntryTableOffset = - kVariousBooleanFlagsOffset + kApiSystemPointerSize; + kVariousBooleanFlagsOffset + 8; static const int kBuiltinTier0TableOffset = kBuiltinTier0EntryTableOffset + kBuiltinTier0EntryTableSize; - static const int kIsolateEmbedderDataOffset = + static const int kNewAllocationInfoOffset = kBuiltinTier0TableOffset + kBuiltinTier0TableSize; + static const int kOldAllocationInfoOffset = + kNewAllocationInfoOffset + kLinearAllocationAreaSize; static const int kIsolateFastCCallCallerFpOffset = - kIsolateEmbedderDataOffset + kNumIsolateDataSlots * kApiSystemPointerSize; + kOldAllocationInfoOffset + kLinearAllocationAreaSize; static const int kIsolateFastCCallCallerPcOffset = kIsolateFastCCallCallerFpOffset + kApiSystemPointerSize; static const int kIsolateFastApiCallTargetOffset = kIsolateFastCCallCallerPcOffset + kApiSystemPointerSize; static const int kIsolateLongTaskStatsCounterOffset = kIsolateFastApiCallTargetOffset + kApiSystemPointerSize; + static const int kIsolateThreadLocalTopOffset = + kIsolateLongTaskStatsCounterOffset + kApiSizetSize; + static const int kIsolateEmbedderDataOffset = + kIsolateThreadLocalTopOffset + kThreadLocalTopSize; #ifdef V8_COMPRESS_POINTERS static const int kIsolateExternalPointerTableOffset = - kIsolateLongTaskStatsCounterOffset + kApiSizetSize; + kIsolateEmbedderDataOffset + kNumIsolateDataSlots * kApiSystemPointerSize; static const int kIsolateSharedExternalPointerTableAddressOffset = kIsolateExternalPointerTableOffset + kExternalPointerTableSize; static const int kIsolateRootsOffset = kIsolateSharedExternalPointerTableAddressOffset + kApiSystemPointerSize; #else static const int kIsolateRootsOffset = - kIsolateLongTaskStatsCounterOffset + kApiSizetSize; + kIsolateEmbedderDataOffset + kNumIsolateDataSlots * kApiSystemPointerSize; #endif +#if V8_STATIC_ROOTS_BOOL + +// These constants need to be initialized in api.cc. +#define EXPORTED_STATIC_ROOTS_PTR_LIST(V) \ + V(UndefinedValue) \ + V(NullValue) \ + V(TrueValue) \ + V(FalseValue) \ + V(EmptyString) \ + V(TheHoleValue) + + using Tagged_t = uint32_t; + struct StaticReadOnlyRoot { +#define DEF_ROOT(name) V8_EXPORT static const Tagged_t k##name; + EXPORTED_STATIC_ROOTS_PTR_LIST(DEF_ROOT) +#undef DEF_ROOT + + V8_EXPORT static const Tagged_t kFirstStringMap; + V8_EXPORT static const Tagged_t kLastStringMap; + }; + +#endif // V8_STATIC_ROOTS_BOOL + static const int kUndefinedValueRootIndex = 4; static const int kTheHoleValueRootIndex = 5; static const int kNullValueRootIndex = 6; @@ -623,15 +641,15 @@ class Internals { #endif } - V8_INLINE static bool HasHeapObjectTag(const internal::Address value) { + V8_INLINE static bool HasHeapObjectTag(Address value) { return (value & kHeapObjectTagMask) == static_cast
    (kHeapObjectTag); } - V8_INLINE static int SmiValue(const internal::Address value) { + V8_INLINE static int SmiValue(Address value) { return PlatformSmiTagging::SmiToInt(value); } - V8_INLINE static constexpr internal::Address IntToSmi(int value) { + V8_INLINE static constexpr Address IntToSmi(int value) { return internal::IntToSmi(value); } @@ -639,16 +657,30 @@ class Internals { return PlatformSmiTagging::IsValidSmi(value); } - V8_INLINE static int GetInstanceType(const internal::Address obj) { - typedef internal::Address A; - A map = ReadTaggedPointerField(obj, kHeapObjectMapOffset); +#if V8_STATIC_ROOTS_BOOL + V8_INLINE static bool is_identical(Address obj, Tagged_t constant) { + return static_cast(obj) == constant; + } + + V8_INLINE static bool CheckInstanceMapRange(Address obj, Tagged_t first_map, + Tagged_t last_map) { + auto map = ReadRawField(obj, kHeapObjectMapOffset); +#ifdef V8_MAP_PACKING + map = UnpackMapWord(map); +#endif + return map >= first_map && map <= last_map; + } +#endif + + V8_INLINE static int GetInstanceType(Address obj) { + Address map = ReadTaggedPointerField(obj, kHeapObjectMapOffset); #ifdef V8_MAP_PACKING map = UnpackMapWord(map); #endif return ReadRawField(map, kMapInstanceTypeOffset); } - V8_INLINE static int GetOddballKind(const internal::Address obj) { + V8_INLINE static int GetOddballKind(Address obj) { return SmiValue(ReadTaggedSignedField(obj, kOddballKindOffset)); } @@ -669,80 +701,92 @@ class Internals { static_cast(kLastJSApiObjectType - kJSObjectType)); } - V8_INLINE static uint8_t GetNodeFlag(internal::Address* obj, int shift) { + V8_INLINE static uint8_t GetNodeFlag(Address* obj, int shift) { uint8_t* addr = reinterpret_cast(obj) + kNodeFlagsOffset; return *addr & static_cast(1U << shift); } - V8_INLINE static void UpdateNodeFlag(internal::Address* obj, bool value, - int shift) { + V8_INLINE static void UpdateNodeFlag(Address* obj, bool value, int shift) { uint8_t* addr = reinterpret_cast(obj) + kNodeFlagsOffset; uint8_t mask = static_cast(1U << shift); *addr = static_cast((*addr & ~mask) | (value << shift)); } - V8_INLINE static uint8_t GetNodeState(internal::Address* obj) { + V8_INLINE static uint8_t GetNodeState(Address* obj) { uint8_t* addr = reinterpret_cast(obj) + kNodeFlagsOffset; return *addr & kNodeStateMask; } - V8_INLINE static void UpdateNodeState(internal::Address* obj, uint8_t value) { + V8_INLINE static void UpdateNodeState(Address* obj, uint8_t value) { uint8_t* addr = reinterpret_cast(obj) + kNodeFlagsOffset; *addr = static_cast((*addr & ~kNodeStateMask) | value); } V8_INLINE static void SetEmbedderData(v8::Isolate* isolate, uint32_t slot, void* data) { - internal::Address addr = reinterpret_cast(isolate) + - kIsolateEmbedderDataOffset + - slot * kApiSystemPointerSize; + Address addr = reinterpret_cast
    (isolate) + + kIsolateEmbedderDataOffset + slot * kApiSystemPointerSize; *reinterpret_cast(addr) = data; } V8_INLINE static void* GetEmbedderData(const v8::Isolate* isolate, uint32_t slot) { - internal::Address addr = reinterpret_cast(isolate) + - kIsolateEmbedderDataOffset + - slot * kApiSystemPointerSize; + Address addr = reinterpret_cast
    (isolate) + + kIsolateEmbedderDataOffset + slot * kApiSystemPointerSize; return *reinterpret_cast(addr); } V8_INLINE static void IncrementLongTasksStatsCounter(v8::Isolate* isolate) { - internal::Address addr = reinterpret_cast(isolate) + - kIsolateLongTaskStatsCounterOffset; + Address addr = + reinterpret_cast
    (isolate) + kIsolateLongTaskStatsCounterOffset; ++(*reinterpret_cast(addr)); } - V8_INLINE static internal::Address* GetRoot(v8::Isolate* isolate, int index) { - internal::Address addr = reinterpret_cast(isolate) + - kIsolateRootsOffset + - index * kApiSystemPointerSize; - return reinterpret_cast(addr); + V8_INLINE static Address* GetRootSlot(v8::Isolate* isolate, int index) { + Address addr = reinterpret_cast
    (isolate) + kIsolateRootsOffset + + index * kApiSystemPointerSize; + return reinterpret_cast(addr); + } + + V8_INLINE static Address GetRoot(v8::Isolate* isolate, int index) { +#if V8_STATIC_ROOTS_BOOL + Address base = *reinterpret_cast( + reinterpret_cast(isolate) + kIsolateCageBaseOffset); + switch (index) { +#define DECOMPRESS_ROOT(name) \ + case k##name##RootIndex: \ + return base + StaticReadOnlyRoot::k##name; + EXPORTED_STATIC_ROOTS_PTR_LIST(DECOMPRESS_ROOT) +#undef DECOMPRESS_ROOT + default: + break; + } +#undef EXPORTED_STATIC_ROOTS_PTR_LIST +#endif // V8_STATIC_ROOTS_BOOL + return *GetRootSlot(isolate, index); } #ifdef V8_ENABLE_SANDBOX - V8_INLINE static internal::Address* GetExternalPointerTableBase( - v8::Isolate* isolate) { - internal::Address addr = reinterpret_cast(isolate) + - kIsolateExternalPointerTableOffset + - kExternalPointerTableBufferOffset; - return *reinterpret_cast(addr); + V8_INLINE static Address* GetExternalPointerTableBase(v8::Isolate* isolate) { + Address addr = reinterpret_cast
    (isolate) + + kIsolateExternalPointerTableOffset + + kExternalPointerTableBufferOffset; + return *reinterpret_cast(addr); } - V8_INLINE static internal::Address* GetSharedExternalPointerTableBase( + V8_INLINE static Address* GetSharedExternalPointerTableBase( v8::Isolate* isolate) { - internal::Address addr = reinterpret_cast(isolate) + - kIsolateSharedExternalPointerTableAddressOffset; - addr = *reinterpret_cast(addr); + Address addr = reinterpret_cast
    (isolate) + + kIsolateSharedExternalPointerTableAddressOffset; + addr = *reinterpret_cast(addr); addr += kExternalPointerTableBufferOffset; - return *reinterpret_cast(addr); + return *reinterpret_cast(addr); } #endif template - V8_INLINE static T ReadRawField(internal::Address heap_object_ptr, - int offset) { - internal::Address addr = heap_object_ptr + offset - kHeapObjectTag; + V8_INLINE static T ReadRawField(Address heap_object_ptr, int offset) { + Address addr = heap_object_ptr + offset - kHeapObjectTag; #ifdef V8_COMPRESS_POINTERS if (sizeof(T) > kApiTaggedSize) { // TODO(ishell, v8:8875): When pointer compression is enabled 8-byte size @@ -757,29 +801,28 @@ class Internals { return *reinterpret_cast(addr); } - V8_INLINE static internal::Address ReadTaggedPointerField( - internal::Address heap_object_ptr, int offset) { + V8_INLINE static Address ReadTaggedPointerField(Address heap_object_ptr, + int offset) { #ifdef V8_COMPRESS_POINTERS uint32_t value = ReadRawField(heap_object_ptr, offset); - internal::Address base = - GetPtrComprCageBaseFromOnHeapAddress(heap_object_ptr); - return base + static_cast(static_cast(value)); + Address base = GetPtrComprCageBaseFromOnHeapAddress(heap_object_ptr); + return base + static_cast
    (static_cast(value)); #else - return ReadRawField(heap_object_ptr, offset); + return ReadRawField
    (heap_object_ptr, offset); #endif } - V8_INLINE static internal::Address ReadTaggedSignedField( - internal::Address heap_object_ptr, int offset) { + V8_INLINE static Address ReadTaggedSignedField(Address heap_object_ptr, + int offset) { #ifdef V8_COMPRESS_POINTERS uint32_t value = ReadRawField(heap_object_ptr, offset); - return static_cast(static_cast(value)); + return static_cast
    (static_cast(value)); #else - return ReadRawField(heap_object_ptr, offset); + return ReadRawField
    (heap_object_ptr, offset); #endif } - V8_INLINE static v8::Isolate* GetIsolateForSandbox(internal::Address obj) { + V8_INLINE static v8::Isolate* GetIsolateForSandbox(Address obj) { #ifdef V8_ENABLE_SANDBOX return reinterpret_cast( internal::IsolateFromNeverReadOnlySpaceObject(obj)); @@ -790,40 +833,37 @@ class Internals { } template - V8_INLINE static internal::Address ReadExternalPointerField( - v8::Isolate* isolate, internal::Address heap_object_ptr, int offset) { + V8_INLINE static Address ReadExternalPointerField(v8::Isolate* isolate, + Address heap_object_ptr, + int offset) { #ifdef V8_ENABLE_SANDBOX - if (IsSandboxedExternalPointerType(tag)) { - // See src/sandbox/external-pointer-table-inl.h. Logic duplicated here so - // it can be inlined and doesn't require an additional call. - internal::Address* table = - IsSharedExternalPointerType(tag) - ? GetSharedExternalPointerTableBase(isolate) - : GetExternalPointerTableBase(isolate); - internal::ExternalPointerHandle handle = - ReadRawField(heap_object_ptr, offset); - uint32_t index = handle >> kExternalPointerIndexShift; - std::atomic* ptr = - reinterpret_cast*>(&table[index]); - internal::Address entry = - std::atomic_load_explicit(ptr, std::memory_order_relaxed); - return entry & ~tag; - } -#endif + static_assert(tag != kExternalPointerNullTag); + // See src/sandbox/external-pointer-table-inl.h. Logic duplicated here so + // it can be inlined and doesn't require an additional call. + Address* table = IsSharedExternalPointerType(tag) + ? GetSharedExternalPointerTableBase(isolate) + : GetExternalPointerTableBase(isolate); + internal::ExternalPointerHandle handle = + ReadRawField(heap_object_ptr, offset); + uint32_t index = handle >> kExternalPointerIndexShift; + std::atomic
    * ptr = + reinterpret_cast*>(&table[index]); + Address entry = std::atomic_load_explicit(ptr, std::memory_order_relaxed); + return entry & ~tag; +#else return ReadRawField
    (heap_object_ptr, offset); +#endif // V8_ENABLE_SANDBOX } #ifdef V8_COMPRESS_POINTERS - V8_INLINE static internal::Address GetPtrComprCageBaseFromOnHeapAddress( - internal::Address addr) { + V8_INLINE static Address GetPtrComprCageBaseFromOnHeapAddress(Address addr) { return addr & -static_cast(kPtrComprCageBaseAlignment); } - V8_INLINE static internal::Address DecompressTaggedAnyField( - internal::Address heap_object_ptr, uint32_t value) { - internal::Address base = - GetPtrComprCageBaseFromOnHeapAddress(heap_object_ptr); - return base + static_cast(static_cast(value)); + V8_INLINE static Address DecompressTaggedField(Address heap_object_ptr, + uint32_t value) { + Address base = GetPtrComprCageBaseFromOnHeapAddress(heap_object_ptr); + return base + static_cast
    (static_cast(value)); } #endif // V8_COMPRESS_POINTERS @@ -861,8 +901,58 @@ class BackingStoreBase {}; // This is needed for histograms sampling garbage collection reasons. constexpr int kGarbageCollectionReasonMaxValue = 27; -} // namespace internal +// Helper functions about values contained in handles. +class ValueHelper final { + public: +#ifdef V8_ENABLE_CONSERVATIVE_STACK_SCANNING + static constexpr Address kLocalTaggedNullAddress = 1; + + template + static constexpr T* EmptyValue() { + return reinterpret_cast(kLocalTaggedNullAddress); + } + + template + V8_INLINE static Address ValueAsAddress(const T* value) { + return reinterpret_cast
    (value); + } + + template + V8_INLINE static T* SlotAsValue(S* slot) { + return *reinterpret_cast(slot); + } + + template + V8_INLINE static T* ValueAsSlot(T* const& value) { + return reinterpret_cast(const_cast(&value)); + } + +#else // !V8_ENABLE_CONSERVATIVE_STACK_SCANNING + + template + static constexpr T* EmptyValue() { + return nullptr; + } + + template + V8_INLINE static Address ValueAsAddress(const T* value) { + return *reinterpret_cast(value); + } + + template + V8_INLINE static T* SlotAsValue(S* slot) { + return reinterpret_cast(slot); + } + + template + V8_INLINE static T* ValueAsSlot(T* const& value) { + return value; + } +#endif // V8_ENABLE_CONSERVATIVE_STACK_SCANNING +}; + +} // namespace internal } // namespace v8 #endif // INCLUDE_V8_INTERNAL_H_ diff --git a/deps/v8/include/v8-isolate.h b/deps/v8/include/v8-isolate.h index e9f531973b2eef..0284e6e769c819 100644 --- a/deps/v8/include/v8-isolate.h +++ b/deps/v8/include/v8-isolate.h @@ -233,7 +233,7 @@ class V8_EXPORT Isolate { * Explicitly specify a startup snapshot blob. The embedder owns the blob. * The embedder *must* ensure that the snapshot is from a trusted source. */ - StartupData* snapshot_blob = nullptr; + const StartupData* snapshot_blob = nullptr; /** * Enables the host application to provide a mechanism for recording @@ -333,12 +333,9 @@ class V8_EXPORT Isolate { const DisallowJavascriptExecutionScope&) = delete; private: - OnFailure on_failure_; - v8::Isolate* v8_isolate_; - - bool was_execution_allowed_assert_; - bool was_execution_allowed_throws_; - bool was_execution_allowed_dump_; + v8::Isolate* const v8_isolate_; + const OnFailure on_failure_; + bool was_execution_allowed_; }; /** @@ -356,7 +353,7 @@ class V8_EXPORT Isolate { const AllowJavascriptExecutionScope&) = delete; private: - Isolate* v8_isolate_; + Isolate* const v8_isolate_; bool was_execution_allowed_assert_; bool was_execution_allowed_throws_; bool was_execution_allowed_dump_; @@ -537,6 +534,8 @@ class V8_EXPORT Isolate { kTurboFanOsrCompileStarted = 115, kAsyncStackTaggingCreateTaskCall = 116, kDurationFormat = 117, + kInvalidatedNumberStringPrototypeNoReplaceProtector = 118, + kRegExpUnicodeSetIncompatibilitiesWithUnicodeMode = 119, // Unused. // If you add new values here, you'll also need to update Chromium's: // web_feature.mojom, use_counter_callback.cc, and enums.xml. V8 changes to @@ -924,27 +923,10 @@ class V8_EXPORT Isolate { void RemoveGCPrologueCallback(GCCallbackWithData, void* data = nullptr); void RemoveGCPrologueCallback(GCCallback callback); - START_ALLOW_USE_DEPRECATED() - /** - * Sets the embedder heap tracer for the isolate. - * SetEmbedderHeapTracer cannot be used simultaneously with AttachCppHeap. - */ - void SetEmbedderHeapTracer(EmbedderHeapTracer* tracer); - - /* - * Gets the currently active heap tracer for the isolate that was set with - * SetEmbedderHeapTracer. - */ - EmbedderHeapTracer* GetEmbedderHeapTracer(); - END_ALLOW_USE_DEPRECATED() - /** * Sets an embedder roots handle that V8 should consider when performing - * non-unified heap garbage collections. - * - * Using only EmbedderHeapTracer automatically sets up a default handler. - * The intended use case is for setting a custom handler after invoking - * `AttachCppHeap()`. + * non-unified heap garbage collections. The intended use case is for setting + * a custom handler after invoking `AttachCppHeap()`. * * V8 does not take ownership of the handler. */ @@ -955,8 +937,6 @@ class V8_EXPORT Isolate { * embedder maintains ownership of the CppHeap. At most one C++ heap can be * attached to V8. * - * AttachCppHeap cannot be used simultaneously with SetEmbedderHeapTracer. - * * Multi-threaded use requires the use of v8::Locker/v8::Unlocker, see * CppHeap. */ @@ -1143,9 +1123,8 @@ class V8_EXPORT Isolate { * * This should only be used for testing purposes and not to enforce a garbage * collection schedule. It has strong negative impact on the garbage - * collection performance. Use IdleNotificationDeadline() or - * LowMemoryNotification() instead to influence the garbage collection - * schedule. + * collection performance. Use MemoryPressureNotification() instead to + * influence the garbage collection schedule. */ void RequestGarbageCollectionForTesting(GarbageCollectionType type); @@ -1156,9 +1135,8 @@ class V8_EXPORT Isolate { * * This should only be used for testing purposes and not to enforce a garbage * collection schedule. It has strong negative impact on the garbage - * collection performance. Use IdleNotificationDeadline() or - * LowMemoryNotification() instead to influence the garbage collection - * schedule. + * collection performance. Use MemoryPressureNotification() instead to + * influence the garbage collection schedule. */ void RequestGarbageCollectionForTesting(GarbageCollectionType type, StackState stack_state); @@ -1310,6 +1288,8 @@ class V8_EXPORT Isolate { * that function. There is no guarantee that the actual work will be done * within the time limit. */ + V8_DEPRECATE_SOON( + "Use MemoryPressureNotification() to influence the GC schedule.") bool IdleNotificationDeadline(double deadline_in_seconds); /** @@ -1346,11 +1326,13 @@ class V8_EXPORT Isolate { * V8 uses this notification to guide heuristics which may result in a * smaller memory footprint at the cost of reduced runtime performance. */ + V8_DEPRECATED("Use IsolateInBackgroundNotification() instead") void EnableMemorySavingsMode(); /** * Optional notification which will disable the memory savings mode. */ + V8_DEPRECATED("Use IsolateInBackgroundNotification() instead") void DisableMemorySavingsMode(); /** @@ -1530,6 +1512,13 @@ class V8_EXPORT Isolate { V8_DEPRECATED("Wasm exceptions are always enabled") void SetWasmExceptionsEnabledCallback(WasmExceptionsEnabledCallback callback); + /** + * Register callback to control whehter Wasm GC is enabled. + * The callback overwrites the value of the flag. + * If the callback returns true, it will also enable Wasm stringrefs. + */ + void SetWasmGCEnabledCallback(WasmGCEnabledCallback callback); + void SetSharedArrayBufferConstructorEnabledCallback( SharedArrayBufferConstructorEnabledCallback callback); @@ -1684,7 +1673,8 @@ uint32_t Isolate::GetNumberOfDataSlots() { template MaybeLocal Isolate::GetDataFromSnapshotOnce(size_t index) { - T* data = reinterpret_cast(GetDataFromSnapshotOnce(index)); + T* data = + internal::ValueHelper::SlotAsValue(GetDataFromSnapshotOnce(index)); if (data) internal::PerformCastCheck(data); return Local(data); } diff --git a/deps/v8/include/v8-local-handle.h b/deps/v8/include/v8-local-handle.h index cbf87f949d09fa..0dbbfdbc9f7513 100644 --- a/deps/v8/include/v8-local-handle.h +++ b/deps/v8/include/v8-local-handle.h @@ -50,9 +50,14 @@ class TracedReference; class TracedReferenceBase; class Utils; +namespace debug { +class ConsoleCallArguments; +} + namespace internal { template class CustomArguments; +class SamplingHeapProfiler; } // namespace internal namespace api_internal { @@ -92,6 +97,9 @@ class V8_EXPORT V8_NODISCARD HandleScope { HandleScope(const HandleScope&) = delete; void operator=(const HandleScope&) = delete; + static internal::Address* CreateHandleForCurrentIsolate( + internal::Address value); + protected: V8_INLINE HandleScope() = default; @@ -122,6 +130,33 @@ class V8_EXPORT V8_NODISCARD HandleScope { friend class Context; }; +namespace internal { + +/** + * Helper functions about handles. + */ +class HandleHelper final { + public: + /** + * Checks whether two handles are equal. + * They are equal iff they are both empty or they are both non-empty and the + * objects to which they refer are physically equal. + * + * If both handles refer to JS objects, this is the same as strict equality. + * For primitives, such as numbers or strings, a `false` return value does not + * indicate that the values aren't equal in the JavaScript sense. + * Use `Value::StrictEquals()` to check primitives for equality. + */ + template + V8_INLINE static bool EqualHandles(const T1& lhs, const T2& rhs) { + if (lhs.IsEmpty()) return rhs.IsEmpty(); + if (rhs.IsEmpty()) return false; + return lhs.address() == rhs.address(); + } +}; + +} // namespace internal + /** * An object reference managed by the v8 garbage collector. * @@ -154,7 +189,8 @@ class V8_EXPORT V8_NODISCARD HandleScope { template class Local { public: - V8_INLINE Local() : val_(nullptr) {} + V8_INLINE Local() : val_(internal::ValueHelper::EmptyValue()) {} + template V8_INLINE Local(Local that) : val_(reinterpret_cast(*that)) { /** @@ -168,55 +204,40 @@ class Local { /** * Returns true if the handle is empty. */ - V8_INLINE bool IsEmpty() const { return val_ == nullptr; } + V8_INLINE bool IsEmpty() const { + return val_ == internal::ValueHelper::EmptyValue(); + } /** * Sets the handle to be empty. IsEmpty() will then return true. */ - V8_INLINE void Clear() { val_ = nullptr; } + V8_INLINE void Clear() { val_ = internal::ValueHelper::EmptyValue(); } V8_INLINE T* operator->() const { return val_; } V8_INLINE T* operator*() const { return val_; } /** - * Checks whether two handles are the same. - * Returns true if both are empty, or if the objects to which they refer - * are identical. + * Checks whether two handles are equal or different. + * They are equal iff they are both empty or they are both non-empty and the + * objects to which they refer are physically equal. * - * If both handles refer to JS objects, this is the same as strict equality. - * For primitives, such as numbers or strings, a `false` return value does not - * indicate that the values aren't equal in the JavaScript sense. - * Use `Value::StrictEquals()` to check primitives for equality. + * If both handles refer to JS objects, this is the same as strict + * non-equality. For primitives, such as numbers or strings, a `true` return + * value does not indicate that the values aren't equal in the JavaScript + * sense. Use `Value::StrictEquals()` to check primitives for equality. */ + template V8_INLINE bool operator==(const Local& that) const { - internal::Address* a = reinterpret_cast(this->val_); - internal::Address* b = reinterpret_cast(that.val_); - if (a == nullptr) return b == nullptr; - if (b == nullptr) return false; - return *a == *b; + return internal::HandleHelper::EqualHandles(*this, that); } template V8_INLINE bool operator==(const PersistentBase& that) const { - internal::Address* a = reinterpret_cast(this->val_); - internal::Address* b = reinterpret_cast(that.val_); - if (a == nullptr) return b == nullptr; - if (b == nullptr) return false; - return *a == *b; + return internal::HandleHelper::EqualHandles(*this, that); } - /** - * Checks whether two handles are different. - * Returns true if only one of the handles is empty, or if - * the objects to which they refer are different. - * - * If both handles refer to JS objects, this is the same as strict - * non-equality. For primitives, such as numbers or strings, a `true` return - * value does not indicate that the values aren't equal in the JavaScript - * sense. Use `Value::StrictEquals()` to check primitives for equality. - */ template V8_INLINE bool operator!=(const Local& that) const { return !operator==(that); @@ -263,12 +284,12 @@ class Local { V8_INLINE static Local New(Isolate* isolate, const PersistentBase& that) { - return New(isolate, that.val_); + return New(isolate, internal::ValueHelper::SlotAsValue(that.val_)); } V8_INLINE static Local New(Isolate* isolate, const BasicTracedReference& that) { - return New(isolate, *that); + return New(isolate, internal::ValueHelper::SlotAsValue(*that)); } private: @@ -277,12 +298,6 @@ class Local { template friend class Eternal; template - friend class PersistentBase; - template - friend class Persistent; - template - friend class Local; - template friend class MaybeLocal; template friend class FunctionCallbackInfo; @@ -309,19 +324,31 @@ class Local { friend class ReturnValue; template friend class Traced; - template - friend class BasicTracedReference; - template - friend class TracedReference; + friend class internal::SamplingHeapProfiler; + friend class internal::HandleHelper; + friend class debug::ConsoleCallArguments; explicit V8_INLINE Local(T* that) : val_(that) {} + + V8_INLINE internal::Address address() const { + return internal::ValueHelper::ValueAsAddress(val_); + } + + V8_INLINE static Local FromSlot(internal::Address* slot) { + return Local(internal::ValueHelper::SlotAsValue(slot)); + } + V8_INLINE static Local New(Isolate* isolate, T* that) { +#ifdef V8_ENABLE_CONSERVATIVE_STACK_SCANNING + return Local(that); +#else if (that == nullptr) return Local(); - T* that_ptr = that; - internal::Address* p = reinterpret_cast(that_ptr); + internal::Address* p = reinterpret_cast(that); return Local(reinterpret_cast(HandleScope::CreateHandle( reinterpret_cast(isolate), *p))); +#endif } + T* val_; }; @@ -344,13 +371,15 @@ using Handle = Local; template class MaybeLocal { public: - V8_INLINE MaybeLocal() : val_(nullptr) {} + V8_INLINE MaybeLocal() : val_(internal::ValueHelper::EmptyValue()) {} template V8_INLINE MaybeLocal(Local that) : val_(reinterpret_cast(*that)) { static_assert(std::is_base_of::value, "type check"); } - V8_INLINE bool IsEmpty() const { return val_ == nullptr; } + V8_INLINE bool IsEmpty() const { + return val_ == internal::ValueHelper::EmptyValue(); + } /** * Converts this MaybeLocal<> to a Local<>. If this MaybeLocal<> is empty, @@ -358,7 +387,7 @@ class MaybeLocal { */ template V8_WARN_UNUSED_RESULT V8_INLINE bool ToLocal(Local* out) const { - out->val_ = IsEmpty() ? nullptr : this->val_; + out->val_ = IsEmpty() ? internal::ValueHelper::EmptyValue() : this->val_; return !IsEmpty(); } @@ -367,7 +396,7 @@ class MaybeLocal { * V8 will crash the process. */ V8_INLINE Local ToLocalChecked() { - if (V8_UNLIKELY(val_ == nullptr)) api_internal::ToLocalEmpty(); + if (V8_UNLIKELY(IsEmpty())) api_internal::ToLocalEmpty(); return Local(val_); } @@ -399,9 +428,13 @@ class V8_EXPORT V8_NODISCARD EscapableHandleScope : public HandleScope { */ template V8_INLINE Local Escape(Local value) { +#ifdef V8_ENABLE_CONSERVATIVE_STACK_SCANNING + return value; +#else internal::Address* slot = Escape(reinterpret_cast(*value)); return Local(reinterpret_cast(slot)); +#endif } template diff --git a/deps/v8/include/v8-metrics.h b/deps/v8/include/v8-metrics.h index 887012ac8c3a0b..5c6c1c4705e38b 100644 --- a/deps/v8/include/v8-metrics.h +++ b/deps/v8/include/v8-metrics.h @@ -12,6 +12,7 @@ #include "v8-internal.h" // NOLINT(build/include_directory) #include "v8-local-handle.h" // NOLINT(build/include_directory) +#include "v8config.h" // NOLINT(build/include_directory) namespace v8 { @@ -96,16 +97,42 @@ struct GarbageCollectionYoungCycle { }; struct WasmModuleDecoded { + WasmModuleDecoded() = default; + WasmModuleDecoded(bool async, bool streamed, bool success, + size_t module_size_in_bytes, size_t function_count, + int64_t wall_clock_duration_in_us) + : async(async), + streamed(streamed), + success(success), + module_size_in_bytes(module_size_in_bytes), + function_count(function_count), + wall_clock_duration_in_us(wall_clock_duration_in_us) {} + bool async = false; bool streamed = false; bool success = false; size_t module_size_in_bytes = 0; size_t function_count = 0; int64_t wall_clock_duration_in_us = -1; - int64_t cpu_duration_in_us = -1; }; struct WasmModuleCompiled { + WasmModuleCompiled() = default; + + WasmModuleCompiled(bool async, bool streamed, bool cached, bool deserialized, + bool lazy, bool success, size_t code_size_in_bytes, + size_t liftoff_bailout_count, + int64_t wall_clock_duration_in_us) + : async(async), + streamed(streamed), + cached(cached), + deserialized(deserialized), + lazy(lazy), + success(success), + code_size_in_bytes(code_size_in_bytes), + liftoff_bailout_count(liftoff_bailout_count), + wall_clock_duration_in_us(wall_clock_duration_in_us) {} + bool async = false; bool streamed = false; bool cached = false; @@ -115,7 +142,6 @@ struct WasmModuleCompiled { size_t code_size_in_bytes = 0; size_t liftoff_bailout_count = 0; int64_t wall_clock_duration_in_us = -1; - int64_t cpu_duration_in_us = -1; }; struct WasmModuleInstantiated { diff --git a/deps/v8/include/v8-object.h b/deps/v8/include/v8-object.h index d7332ba0c88d12..d805dbe9e7d818 100644 --- a/deps/v8/include/v8-object.h +++ b/deps/v8/include/v8-object.h @@ -607,6 +607,19 @@ class V8_EXPORT Object : public Value { return object.val_->GetCreationContext(); } + /** + * Gets the context in which the object was created (see GetCreationContext()) + * and if it's available reads respective embedder field value. + * If the context can't be obtained nullptr is returned. + * Basically it's a shortcut for + * obj->GetCreationContext().GetAlignedPointerFromEmbedderData(index) + * which doesn't create a handle for Context object on the way and doesn't + * try to expand the embedder data attached to the context. + * In case the Local is already available because of other reasons, + * it's fine to keep using Context::GetAlignedPointerFromEmbedderData(). + */ + void* GetAlignedPointerFromEmbedderDataInCreationContext(int index); + /** * Checks whether a callback is set by the * ObjectTemplate::SetCallAsFunctionHandler method. @@ -707,7 +720,7 @@ Local Object::GetInternalField(int index) { #ifndef V8_ENABLE_CHECKS using A = internal::Address; using I = internal::Internals; - A obj = *reinterpret_cast(this); + A obj = internal::ValueHelper::ValueAsAddress(this); // Fast path: If the object is a plain JSObject, which is the common case, we // know where to find the internal fields and can return the value directly. int instance_type = I::GetInstanceType(obj); @@ -717,12 +730,17 @@ Local Object::GetInternalField(int index) { #ifdef V8_COMPRESS_POINTERS // We read the full pointer value and then decompress it in order to avoid // dealing with potential endiannes issues. - value = I::DecompressTaggedAnyField(obj, static_cast(value)); + value = I::DecompressTaggedField(obj, static_cast(value)); #endif + +#ifdef V8_ENABLE_CONSERVATIVE_STACK_SCANNING + return Local(reinterpret_cast(value)); +#else internal::Isolate* isolate = internal::IsolateFromNeverReadOnlySpaceObject(obj); A* result = HandleScope::CreateHandle(isolate, value); return Local(reinterpret_cast(result)); +#endif } #endif return SlowGetInternalField(index); @@ -732,7 +750,7 @@ void* Object::GetAlignedPointerFromInternalField(int index) { #if !defined(V8_ENABLE_CHECKS) using A = internal::Address; using I = internal::Internals; - A obj = *reinterpret_cast(this); + A obj = internal::ValueHelper::ValueAsAddress(this); // Fast path: If the object is a plain JSObject, which is the common case, we // know where to find the internal fields and can return the value directly. auto instance_type = I::GetInstanceType(obj); diff --git a/deps/v8/include/v8-persistent-handle.h b/deps/v8/include/v8-persistent-handle.h index dbda4edb9baf4e..fbae1aa6f284e2 100644 --- a/deps/v8/include/v8-persistent-handle.h +++ b/deps/v8/include/v8-persistent-handle.h @@ -55,7 +55,7 @@ class Eternal { V8_INLINE Local Get(Isolate* isolate) const { // The eternal handle will never go away, so as with the roots, we don't // even need to open a handle. - return Local(val_); + return Local(internal::ValueHelper::SlotAsValue(val_)); } V8_INLINE bool IsEmpty() const { return val_ == nullptr; } @@ -68,6 +68,10 @@ class Eternal { } private: + V8_INLINE internal::Address address() const { + return *reinterpret_cast(val_); + } + T* val_; }; @@ -122,20 +126,12 @@ class PersistentBase { template V8_INLINE bool operator==(const PersistentBase& that) const { - internal::Address* a = reinterpret_cast(this->val_); - internal::Address* b = reinterpret_cast(that.val_); - if (a == nullptr) return b == nullptr; - if (b == nullptr) return false; - return *a == *b; + return internal::HandleHelper::EqualHandles(*this, that); } template V8_INLINE bool operator==(const Local& that) const { - internal::Address* a = reinterpret_cast(this->val_); - internal::Address* b = reinterpret_cast(that.val_); - if (a == nullptr) return b == nullptr; - if (b == nullptr) return false; - return *a == *b; + return internal::HandleHelper::EqualHandles(*this, that); } template @@ -221,8 +217,15 @@ class PersistentBase { template friend class PersistentValueVector; friend class Object; + friend class internal::HandleHelper; explicit V8_INLINE PersistentBase(T* val) : val_(val) {} + V8_INLINE T* operator*() const { return this->val_; } + V8_INLINE internal::Address address() const { + return *reinterpret_cast(val_); + } + + V8_INLINE static T* New(Isolate* isolate, Local that); V8_INLINE static T* New(Isolate* isolate, T* that); T* val_; @@ -282,11 +285,13 @@ class Persistent : public PersistentBase { * When the Local is non-empty, a new storage cell is created * pointing to the same object, and no flags are set. */ + template V8_INLINE Persistent(Isolate* isolate, Local that) - : PersistentBase(PersistentBase::New(isolate, *that)) { + : PersistentBase(PersistentBase::New(isolate, that)) { static_assert(std::is_base_of::value, "type check"); } + /** * Construct a Persistent from a Persistent. * When the Persistent is non-empty, a new storage cell is created @@ -356,7 +361,6 @@ class Persistent : public PersistentBase { friend class ReturnValue; explicit V8_INLINE Persistent(T* that) : PersistentBase(that) {} - V8_INLINE T* operator*() const { return this->val_; } template V8_INLINE void Copy(const Persistent& that); }; @@ -381,7 +385,7 @@ class Global : public PersistentBase { */ template V8_INLINE Global(Isolate* isolate, Local that) - : PersistentBase(PersistentBase::New(isolate, *that)) { + : PersistentBase(PersistentBase::New(isolate, that)) { static_assert(std::is_base_of::value, "type check"); } @@ -425,7 +429,6 @@ class Global : public PersistentBase { private: template friend class ReturnValue; - V8_INLINE T* operator*() const { return this->val_; } }; // UniquePersistent is an alias for Global for historical reason. @@ -442,6 +445,12 @@ class V8_EXPORT PersistentHandleVisitor { uint16_t class_id) {} }; +template +T* PersistentBase::New(Isolate* isolate, Local that) { + return PersistentBase::New(isolate, + internal::ValueHelper::ValueAsSlot(*that)); +} + template T* PersistentBase::New(Isolate* isolate, T* that) { if (that == nullptr) return nullptr; @@ -486,7 +495,7 @@ void PersistentBase::Reset(Isolate* isolate, const Local& other) { static_assert(std::is_base_of::value, "type check"); Reset(); if (other.IsEmpty()) return; - this->val_ = New(isolate, other.val_); + this->val_ = New(isolate, internal::ValueHelper::ValueAsSlot(*other)); } /** diff --git a/deps/v8/include/v8-platform.h b/deps/v8/include/v8-platform.h index 32a82f881e7f93..4f476f5c3c3e73 100644 --- a/deps/v8/include/v8-platform.h +++ b/deps/v8/include/v8-platform.h @@ -5,9 +5,11 @@ #ifndef V8_V8_PLATFORM_H_ #define V8_V8_PLATFORM_H_ +#include #include #include #include // For abort. + #include #include @@ -265,6 +267,38 @@ class JobTask { virtual size_t GetMaxConcurrency(size_t worker_count) const = 0; }; +/** + * A "blocking call" refers to any call that causes the calling thread to wait + * off-CPU. It includes but is not limited to calls that wait on synchronous + * file I/O operations: read or write a file from disk, interact with a pipe or + * a socket, rename or delete a file, enumerate files in a directory, etc. + * Acquiring a low contention lock is not considered a blocking call. + */ + +/** + * BlockingType indicates the likelihood that a blocking call will actually + * block. + */ +enum class BlockingType { + // The call might block (e.g. file I/O that might hit in memory cache). + kMayBlock, + // The call will definitely block (e.g. cache already checked and now pinging + // server synchronously). + kWillBlock +}; + +/** + * This class is instantiated with CreateBlockingScope() in every scope where a + * blocking call is made and serves as a precise annotation of the scope that + * may/will block. May be implemented by an embedder to adjust the thread count. + * CPU usage should be minimal within that scope. ScopedBlockingCalls can be + * nested. + */ +class ScopedBlockingCall { + public: + virtual ~ScopedBlockingCall() = default; +}; + /** * The interface represents complex arguments to trace events. */ @@ -285,6 +319,8 @@ class ConvertableToTraceFormat { * V8 Tracing controller. * * Can be implemented by an embedder to record trace events from V8. + * + * Will become obsolete in Perfetto SDK build (v8_use_perfetto = true). */ class TracingController { public: @@ -348,10 +384,16 @@ class TracingController { virtual void OnTraceDisabled() = 0; }; - /** Adds tracing state change observer. */ + /** + * Adds tracing state change observer. + * Does nothing in Perfetto SDK build (v8_use_perfetto = true). + */ virtual void AddTraceStateObserver(TraceStateObserver*) {} - /** Removes tracing state change observer. */ + /** + * Removes tracing state change observer. + * Does nothing in Perfetto SDK build (v8_use_perfetto = true). + */ virtual void RemoveTraceStateObserver(TraceStateObserver*) {} }; @@ -534,7 +576,7 @@ static constexpr PlatformSharedMemoryHandle kInvalidSharedMemoryHandle = -1; // to avoid pulling in large OS header files into this header file. Instead, // the users of these routines are expected to include the respecitve OS // headers in addition to this one. -#if V8_OS_MACOS +#if V8_OS_DARWIN // Convert between a shared memory handle and a mach_port_t referencing a memory // entry object. inline PlatformSharedMemoryHandle SharedMemoryHandleFromMachMemoryEntry( @@ -945,11 +987,12 @@ class Platform { virtual void OnCriticalMemoryPressure() {} /** - * Gets the number of worker threads used by - * Call(BlockingTask)OnWorkerThread(). This can be used to estimate the number - * of tasks a work package should be split into. A return value of 0 means - * that there are no worker threads available. Note that a value of 0 won't - * prohibit V8 from posting tasks using |CallOnWorkerThread|. + * Gets the max number of worker threads that may be used to execute + * concurrent work scheduled for any single TaskPriority by + * Call(BlockingTask)OnWorkerThread() or PostJob(). This can be used to + * estimate the number of tasks a work package should be split into. A return + * value of 0 means that there are no worker threads available. Note that a + * value of 0 won't prohibit V8 from posting tasks using |CallOnWorkerThread|. */ virtual int NumberOfWorkerThreads() = 0; @@ -1064,6 +1107,14 @@ class Platform { virtual std::unique_ptr CreateJob( TaskPriority priority, std::unique_ptr job_task) = 0; + /** + * Instantiates a ScopedBlockingCall to annotate a scope that may/will block. + */ + virtual std::unique_ptr CreateBlockingScope( + BlockingType blocking_type) { + return nullptr; + } + /** * Monotonically increasing time in seconds from an arbitrary fixed point in * the past. This function is expected to return at least @@ -1074,11 +1125,28 @@ class Platform { virtual double MonotonicallyIncreasingTime() = 0; /** - * Current wall-clock time in milliseconds since epoch. - * This function is expected to return at least millisecond-precision values. + * Current wall-clock time in milliseconds since epoch. Use + * CurrentClockTimeMillisHighResolution() when higher precision is + * required. + */ + virtual int64_t CurrentClockTimeMilliseconds() { + return floor(CurrentClockTimeMillis()); + } + + /** + * This function is deprecated and will be deleted. Use either + * CurrentClockTimeMilliseconds() or + * CurrentClockTimeMillisecondsHighResolution(). */ virtual double CurrentClockTimeMillis() = 0; + /** + * Same as CurrentClockTimeMilliseconds(), but with more precision. + */ + virtual double CurrentClockTimeMillisecondsHighResolution() { + return CurrentClockTimeMillis(); + } + typedef void (*StackTracePrinter)(); /** diff --git a/deps/v8/include/v8-primitive.h b/deps/v8/include/v8-primitive.h index 4fef8da7f8d5e7..4148a7053a267f 100644 --- a/deps/v8/include/v8-primitive.h +++ b/deps/v8/include/v8-primitive.h @@ -493,8 +493,15 @@ class V8_EXPORT String : public Name { /** * Returns true if this string can be made external. */ + V8_DEPRECATE_SOON("Use the version that takes an encoding as argument.") bool CanMakeExternal() const; + /** + * Returns true if this string can be made external, given the encoding for + * the external string resource. + */ + bool CanMakeExternal(Encoding encoding) const; + /** * Returns true if the strings values are equal. Same as JS ==/===. */ @@ -776,14 +783,14 @@ Local String::Empty(Isolate* isolate) { using S = internal::Address; using I = internal::Internals; I::CheckInitialized(isolate); - S* slot = I::GetRoot(isolate, I::kEmptyStringRootIndex); - return Local(reinterpret_cast(slot)); + S* slot = I::GetRootSlot(isolate, I::kEmptyStringRootIndex); + return Local::FromSlot(slot); } String::ExternalStringResource* String::GetExternalStringResource() const { using A = internal::Address; using I = internal::Internals; - A obj = *reinterpret_cast(this); + A obj = internal::ValueHelper::ValueAsAddress(this); ExternalStringResource* result; if (I::IsExternalTwoByteString(I::GetInstanceType(obj))) { @@ -804,7 +811,7 @@ String::ExternalStringResourceBase* String::GetExternalStringResourceBase( String::Encoding* encoding_out) const { using A = internal::Address; using I = internal::Internals; - A obj = *reinterpret_cast(this); + A obj = internal::ValueHelper::ValueAsAddress(this); int type = I::GetInstanceType(obj) & I::kStringRepresentationAndEncodingMask; *encoding_out = static_cast(type & I::kStringEncodingMask); ExternalStringResourceBase* resource; @@ -829,32 +836,32 @@ V8_INLINE Local Undefined(Isolate* isolate) { using S = internal::Address; using I = internal::Internals; I::CheckInitialized(isolate); - S* slot = I::GetRoot(isolate, I::kUndefinedValueRootIndex); - return Local(reinterpret_cast(slot)); + S* slot = I::GetRootSlot(isolate, I::kUndefinedValueRootIndex); + return Local::FromSlot(slot); } V8_INLINE Local Null(Isolate* isolate) { using S = internal::Address; using I = internal::Internals; I::CheckInitialized(isolate); - S* slot = I::GetRoot(isolate, I::kNullValueRootIndex); - return Local(reinterpret_cast(slot)); + S* slot = I::GetRootSlot(isolate, I::kNullValueRootIndex); + return Local::FromSlot(slot); } V8_INLINE Local True(Isolate* isolate) { using S = internal::Address; using I = internal::Internals; I::CheckInitialized(isolate); - S* slot = I::GetRoot(isolate, I::kTrueValueRootIndex); - return Local(reinterpret_cast(slot)); + S* slot = I::GetRootSlot(isolate, I::kTrueValueRootIndex); + return Local::FromSlot(slot); } V8_INLINE Local False(Isolate* isolate) { using S = internal::Address; using I = internal::Internals; I::CheckInitialized(isolate); - S* slot = I::GetRoot(isolate, I::kFalseValueRootIndex); - return Local(reinterpret_cast(slot)); + S* slot = I::GetRootSlot(isolate, I::kFalseValueRootIndex); + return Local::FromSlot(slot); } Local Boolean::New(Isolate* isolate, bool value) { diff --git a/deps/v8/include/v8-profiler.h b/deps/v8/include/v8-profiler.h index 6b73fc60bf2c21..d3941512218342 100644 --- a/deps/v8/include/v8-profiler.h +++ b/deps/v8/include/v8-profiler.h @@ -596,6 +596,7 @@ class V8_EXPORT HeapGraphNode { kBigInt = 13, // BigInt. kObjectShape = 14, // Internal data used for tracking the shapes (or // "hidden classes") of JS objects. + kWasmObject = 15, // A WasmGC struct or array. }; /** Returns node type (see HeapGraphNode::Type). */ diff --git a/deps/v8/include/v8-script.h b/deps/v8/include/v8-script.h index e2ba845268d921..4a8ccab7e28d1d 100644 --- a/deps/v8/include/v8-script.h +++ b/deps/v8/include/v8-script.h @@ -11,6 +11,7 @@ #include #include +#include "v8-callbacks.h" // NOLINT(build/include_directory) #include "v8-data.h" // NOLINT(build/include_directory) #include "v8-local-handle.h" // NOLINT(build/include_directory) #include "v8-maybe.h" // NOLINT(build/include_directory) @@ -347,6 +348,12 @@ class V8_EXPORT Script { * ScriptOrigin. This can be either a v8::String or v8::Undefined. */ Local GetResourceName(); + + /** + * If the script was compiled, returns the positions of lazy functions which + * were eventually compiled and executed. + */ + std::vector GetProducedCompileHints() const; }; enum class ScriptType { kClassic, kModule }; @@ -407,6 +414,8 @@ class V8_EXPORT ScriptCompiler { V8_INLINE explicit Source( Local source_string, CachedData* cached_data = nullptr, ConsumeCodeCacheTask* consume_cache_task = nullptr); + V8_INLINE Source(Local source_string, const ScriptOrigin& origin, + CompileHintCallback callback, void* callback_data); V8_INLINE ~Source() = default; // Ownership of the CachedData or its buffers is *not* transferred to the @@ -434,6 +443,10 @@ class V8_EXPORT ScriptCompiler { // set when calling a compile method. std::unique_ptr cached_data; std::unique_ptr consume_cache_task; + + // For requesting compile hints from the embedder. + CompileHintCallback compile_hint_callback = nullptr; + void* compile_hint_callback_data = nullptr; }; /** @@ -562,7 +575,9 @@ class V8_EXPORT ScriptCompiler { enum CompileOptions { kNoCompileOptions = 0, kConsumeCodeCache, - kEagerCompile + kEagerCompile, + kProduceCompileHints, + kConsumeCompileHints }; /** @@ -775,6 +790,19 @@ ScriptCompiler::Source::Source(Local string, CachedData* data, cached_data(data), consume_cache_task(consume_cache_task) {} +ScriptCompiler::Source::Source(Local string, const ScriptOrigin& origin, + CompileHintCallback callback, + void* callback_data) + : source_string(string), + resource_name(origin.ResourceName()), + resource_line_offset(origin.LineOffset()), + resource_column_offset(origin.ColumnOffset()), + resource_options(origin.Options()), + source_map_url(origin.SourceMapUrl()), + host_defined_options(origin.GetHostDefinedOptions()), + compile_hint_callback(callback), + compile_hint_callback_data(callback_data) {} + const ScriptCompiler::CachedData* ScriptCompiler::Source::GetCachedData() const { return cached_data.get(); diff --git a/deps/v8/include/v8-snapshot.h b/deps/v8/include/v8-snapshot.h index 2400357cf6e069..d47bcbaec9e976 100644 --- a/deps/v8/include/v8-snapshot.h +++ b/deps/v8/include/v8-snapshot.h @@ -91,7 +91,7 @@ class V8_EXPORT SnapshotCreator { */ SnapshotCreator(Isolate* isolate, const intptr_t* external_references = nullptr, - StartupData* existing_blob = nullptr); + const StartupData* existing_blob = nullptr); /** * Create and enter an isolate, and set it up for serialization. @@ -102,7 +102,7 @@ class V8_EXPORT SnapshotCreator { * that must be equivalent to CreateParams::external_references. */ SnapshotCreator(const intptr_t* external_references = nullptr, - StartupData* existing_blob = nullptr); + const StartupData* existing_blob = nullptr); /** * Destroy the snapshot creator, and exit and dispose of the Isolate @@ -179,16 +179,12 @@ class V8_EXPORT SnapshotCreator { template size_t SnapshotCreator::AddData(Local context, Local object) { - T* object_ptr = *object; - internal::Address* p = reinterpret_cast(object_ptr); - return AddData(context, *p); + return AddData(context, internal::ValueHelper::ValueAsAddress(*object)); } template size_t SnapshotCreator::AddData(Local object) { - T* object_ptr = *object; - internal::Address* p = reinterpret_cast(object_ptr); - return AddData(*p); + return AddData(internal::ValueHelper::ValueAsAddress(*object)); } } // namespace v8 diff --git a/deps/v8/include/v8-template.h b/deps/v8/include/v8-template.h index 669012a9814465..11296cd48896dd 100644 --- a/deps/v8/include/v8-template.h +++ b/deps/v8/include/v8-template.h @@ -30,7 +30,9 @@ class Signature; F(AsyncIteratorPrototype, initial_async_iterator_prototype) \ F(ErrorPrototype, initial_error_prototype) \ F(IteratorPrototype, initial_iterator_prototype) \ - F(ObjProto_valueOf, object_value_of_function) + F(MapIteratorPrototype, initial_map_iterator_prototype) \ + F(ObjProto_valueOf, object_value_of_function) \ + F(SetIteratorPrototype, initial_set_iterator_prototype) enum Intrinsic { #define V8_DECL_INTRINSIC(name, iname) k##name, diff --git a/deps/v8/include/v8-traced-handle.h b/deps/v8/include/v8-traced-handle.h index e0fd57c49d4c55..d92c3fdc867df5 100644 --- a/deps/v8/include/v8-traced-handle.h +++ b/deps/v8/include/v8-traced-handle.h @@ -62,7 +62,8 @@ class TracedReferenceBase { */ V8_INLINE v8::Local Get(v8::Isolate* isolate) const { if (IsEmpty()) return Local(); - return Local::New(isolate, reinterpret_cast(val_)); + return Local::New(isolate, + internal::ValueHelper::SlotAsValue(val_)); } /** @@ -103,10 +104,13 @@ class TracedReferenceBase { V8_EXPORT void CheckValue() const; + V8_INLINE internal::Address address() const { return *val_; } + // val_ points to a GlobalHandles node. internal::Address* val_ = nullptr; friend class internal::BasicTracedReferenceExtractor; + friend class internal::HandleHelper; template friend class Local; template @@ -117,11 +121,11 @@ class TracedReferenceBase { /** * A traced handle with copy and move semantics. The handle is to be used - * together with |v8::EmbedderHeapTracer| or as part of GarbageCollected objects - * (see v8-cppgc.h) and specifies edges from C++ objects to JavaScript. + * together as part of GarbageCollected objects (see v8-cppgc.h) or from stack + * and specifies edges from C++ objects to JavaScript. * * The exact semantics are: - * - Tracing garbage collections use |v8::EmbedderHeapTracer| or cppgc. + * - Tracing garbage collections using CppHeap. * - Non-tracing garbage collections refer to * |v8::EmbedderRootsHandler::IsRoot()| whether the handle should * be treated as root or not. @@ -135,7 +139,12 @@ class BasicTracedReference : public TracedReferenceBase { /** * Construct a Local from this handle. */ - Local Get(Isolate* isolate) const { return Local::New(isolate, *this); } + Local Get(Isolate* isolate) const { +#ifdef V8_ENABLE_CONSERVATIVE_STACK_SCANNING + if (val_ == nullptr) return Local(); +#endif + return Local::New(isolate, *this); + } template V8_INLINE BasicTracedReference& As() const { @@ -166,7 +175,6 @@ class BasicTracedReference : public TracedReferenceBase { Isolate* isolate, T* that, void* slot, internal::GlobalHandleStoreMode store_mode); - friend class EmbedderHeapTracer; template friend class Local; friend class Object; @@ -181,13 +189,7 @@ class BasicTracedReference : public TracedReferenceBase { /** * A traced handle without destructor that clears the handle. The embedder needs * to ensure that the handle is not accessed once the V8 object has been - * reclaimed. This can happen when the handle is not passed through the - * EmbedderHeapTracer. For more details see BasicTracedReference. - * - * The reference assumes the embedder has precise knowledge about references at - * all times. In case V8 needs to separately handle on-stack references, the - * embedder is required to set the stack start through - * |EmbedderHeapTracer::SetStackStart|. + * reclaimed. For more details see BasicTracedReference. */ template class TracedReference : public BasicTracedReference { @@ -207,7 +209,7 @@ class TracedReference : public BasicTracedReference { */ template TracedReference(Isolate* isolate, Local that) : BasicTracedReference() { - this->val_ = this->New(isolate, that.val_, &this->val_, + this->val_ = this->New(isolate, *that, &this->val_, internal::GlobalHandleStoreMode::kInitializingStore); static_assert(std::is_base_of::value, "type check"); } @@ -291,7 +293,7 @@ template internal::Address* BasicTracedReference::New( Isolate* isolate, T* that, void* slot, internal::GlobalHandleStoreMode store_mode) { - if (that == nullptr) return nullptr; + if (that == internal::ValueHelper::EmptyValue()) return nullptr; internal::Address* p = reinterpret_cast(that); return internal::GlobalizeTracedReference( reinterpret_cast(isolate), p, @@ -306,21 +308,13 @@ void TracedReferenceBase::Reset() { V8_INLINE bool operator==(const TracedReferenceBase& lhs, const TracedReferenceBase& rhs) { - v8::internal::Address* a = reinterpret_cast(lhs.val_); - v8::internal::Address* b = reinterpret_cast(rhs.val_); - if (a == nullptr) return b == nullptr; - if (b == nullptr) return false; - return *a == *b; + return internal::HandleHelper::EqualHandles(lhs, rhs); } template V8_INLINE bool operator==(const TracedReferenceBase& lhs, const v8::Local& rhs) { - v8::internal::Address* a = reinterpret_cast(lhs.val_); - v8::internal::Address* b = reinterpret_cast(*rhs); - if (a == nullptr) return b == nullptr; - if (b == nullptr) return false; - return *a == *b; + return internal::HandleHelper::EqualHandles(lhs, rhs); } template @@ -353,7 +347,7 @@ void TracedReference::Reset(Isolate* isolate, const Local& other) { this->Reset(); if (other.IsEmpty()) return; this->SetSlotThreadSafe( - this->New(isolate, other.val_, &this->val_, + this->New(isolate, *other, &this->val_, internal::GlobalHandleStoreMode::kAssigningStore)); } diff --git a/deps/v8/include/v8-util.h b/deps/v8/include/v8-util.h index 159027d31786ff..36611697632296 100644 --- a/deps/v8/include/v8-util.h +++ b/deps/v8/include/v8-util.h @@ -181,7 +181,11 @@ class PersistentValueMapBase { * Get value stored in map. */ Local Get(const K& key) { - return Local::New(isolate_, FromVal(Traits::Get(&impl_, key))); + V* p = FromVal(Traits::Get(&impl_, key)); +#ifdef V8_ENABLE_CONSERVATIVE_STACK_SCANNING + if (p == nullptr) return Local(); +#endif + return Local::New(isolate_, p); } /** @@ -236,7 +240,8 @@ class PersistentValueMapBase { : value_(other.value_) { } Local NewLocal(Isolate* isolate) const { - return Local::New(isolate, FromVal(value_)); + return Local::New( + isolate, internal::ValueHelper::SlotAsValue(FromVal(value_))); } bool IsEmpty() const { return value_ == kPersistentContainerNotFound; @@ -613,7 +618,8 @@ class V8_DEPRECATE_SOON("Use std::vector>.") PersistentValueVector { * Retrieve the i-th value in the vector. */ Local Get(size_t index) const { - return Local::New(isolate_, FromVal(Traits::Get(&impl_, index))); + return Local::New(isolate_, internal::ValueHelper::SlotAsValue( + FromVal(Traits::Get(&impl_, index)))); } /** diff --git a/deps/v8/include/v8-value.h b/deps/v8/include/v8-value.h index 866da201245877..c80ae064ee7ba9 100644 --- a/deps/v8/include/v8-value.h +++ b/deps/v8/include/v8-value.h @@ -344,6 +344,11 @@ class V8_EXPORT Value : public Data { */ bool IsWasmModuleObject() const; + /** + * Returns true if this value is the WasmNull object. + */ + bool IsWasmNull() const; + /** * Returns true if the value is a Module Namespace Object. */ @@ -469,10 +474,14 @@ bool Value::IsUndefined() const { bool Value::QuickIsUndefined() const { using A = internal::Address; using I = internal::Internals; - A obj = *reinterpret_cast(this); + A obj = internal::ValueHelper::ValueAsAddress(this); +#if V8_STATIC_ROOTS_BOOL + return I::is_identical(obj, I::StaticReadOnlyRoot::kUndefinedValue); +#else if (!I::HasHeapObjectTag(obj)) return false; if (I::GetInstanceType(obj) != I::kOddballType) return false; return (I::GetOddballKind(obj) == I::kUndefinedOddballKind); +#endif // V8_STATIC_ROOTS_BOOL } bool Value::IsNull() const { @@ -486,10 +495,14 @@ bool Value::IsNull() const { bool Value::QuickIsNull() const { using A = internal::Address; using I = internal::Internals; - A obj = *reinterpret_cast(this); + A obj = internal::ValueHelper::ValueAsAddress(this); +#if V8_STATIC_ROOTS_BOOL + return I::is_identical(obj, I::StaticReadOnlyRoot::kNullValue); +#else if (!I::HasHeapObjectTag(obj)) return false; if (I::GetInstanceType(obj) != I::kOddballType) return false; return (I::GetOddballKind(obj) == I::kNullOddballKind); +#endif // V8_STATIC_ROOTS_BOOL } bool Value::IsNullOrUndefined() const { @@ -501,13 +514,17 @@ bool Value::IsNullOrUndefined() const { } bool Value::QuickIsNullOrUndefined() const { +#if V8_STATIC_ROOTS_BOOL + return QuickIsNull() || QuickIsUndefined(); +#else using A = internal::Address; using I = internal::Internals; - A obj = *reinterpret_cast(this); + A obj = internal::ValueHelper::ValueAsAddress(this); if (!I::HasHeapObjectTag(obj)) return false; if (I::GetInstanceType(obj) != I::kOddballType) return false; int kind = I::GetOddballKind(obj); return kind == I::kNullOddballKind || kind == I::kUndefinedOddballKind; +#endif // V8_STATIC_ROOTS_BOOL } bool Value::IsString() const { @@ -521,9 +538,14 @@ bool Value::IsString() const { bool Value::QuickIsString() const { using A = internal::Address; using I = internal::Internals; - A obj = *reinterpret_cast(this); + A obj = internal::ValueHelper::ValueAsAddress(this); if (!I::HasHeapObjectTag(obj)) return false; +#if V8_STATIC_ROOTS_BOOL && !V8_MAP_PACKING + return I::CheckInstanceMapRange(obj, I::StaticReadOnlyRoot::kFirstStringMap, + I::StaticReadOnlyRoot::kLastStringMap); +#else return (I::GetInstanceType(obj) < I::kFirstNonstringType); +#endif // V8_STATIC_ROOTS_BOOL } } // namespace v8 diff --git a/deps/v8/include/v8-version.h b/deps/v8/include/v8-version.h index a9d6f92aff4599..f2146fa1ea3326 100644 --- a/deps/v8/include/v8-version.h +++ b/deps/v8/include/v8-version.h @@ -8,10 +8,10 @@ // These macros define the version number for the current version. // NOTE these macros are used by some of the tool scripts and the build // system so their names cannot be changed without changing the scripts. -#define V8_MAJOR_VERSION 10 -#define V8_MINOR_VERSION 9 -#define V8_BUILD_NUMBER 194 -#define V8_PATCH_LEVEL 9 +#define V8_MAJOR_VERSION 11 +#define V8_MINOR_VERSION 3 +#define V8_BUILD_NUMBER 244 +#define V8_PATCH_LEVEL 4 // Use 1 for candidates and 0 otherwise. // (Boolean macro values are not supported by all preprocessors.) diff --git a/deps/v8/include/v8-wasm.h b/deps/v8/include/v8-wasm.h index 05acd2e86deff8..71514615466eb3 100644 --- a/deps/v8/include/v8-wasm.h +++ b/deps/v8/include/v8-wasm.h @@ -144,7 +144,7 @@ class V8_EXPORT WasmStreaming final { /** * {Finish} should be called after all received bytes where passed to * {OnBytesReceived} to tell V8 that there will be no more bytes. {Finish} - * does not have to be called after {Abort} has been called already. + * must not be called after {Abort} has been called already. * If {can_use_compiled_module} is true and {SetCompiledModuleBytes} was * previously called, the compiled module bytes can be used. * If {can_use_compiled_module} is false, the compiled module bytes previously @@ -156,6 +156,7 @@ class V8_EXPORT WasmStreaming final { * Abort streaming compilation. If {exception} has a value, then the promise * associated with streaming compilation is rejected with that value. If * {exception} does not have value, the promise does not get rejected. + * {Abort} must not be called repeatedly, or after {Finish}. */ void Abort(MaybeLocal exception); diff --git a/deps/v8/include/v8config.h b/deps/v8/include/v8config.h index 2ac27b36b47ee3..bee208ffa95a78 100644 --- a/deps/v8/include/v8config.h +++ b/deps/v8/include/v8config.h @@ -173,6 +173,7 @@ path. Add it with -I to the command line // V8_TARGET_OS_LINUX // V8_TARGET_OS_MACOS // V8_TARGET_OS_WIN +// V8_TARGET_OS_CHROMEOS // // If not set explicitly, these fall back to corresponding V8_OS_ values. @@ -184,7 +185,8 @@ path. Add it with -I to the command line && !defined(V8_TARGET_OS_IOS) \ && !defined(V8_TARGET_OS_LINUX) \ && !defined(V8_TARGET_OS_MACOS) \ - && !defined(V8_TARGET_OS_WIN) + && !defined(V8_TARGET_OS_WIN) \ + && !defined(V8_TARGET_OS_CHROMEOS) # error No known target OS defined. # endif @@ -195,7 +197,8 @@ path. Add it with -I to the command line || defined(V8_TARGET_OS_IOS) \ || defined(V8_TARGET_OS_LINUX) \ || defined(V8_TARGET_OS_MACOS) \ - || defined(V8_TARGET_OS_WIN) + || defined(V8_TARGET_OS_WIN) \ + || defined(V8_TARGET_OS_CHROMEOS) # error A target OS is defined but V8_HAVE_TARGET_OS is unset. # endif @@ -308,6 +311,9 @@ path. Add it with -I to the command line // V8_HAS_BUILTIN_EXPECT - __builtin_expect() supported // V8_HAS_BUILTIN_FRAME_ADDRESS - __builtin_frame_address() supported // V8_HAS_BUILTIN_POPCOUNT - __builtin_popcount() supported +// V8_HAS_BUILTIN_ADD_OVERFLOW - __builtin_add_overflow() supported +// V8_HAS_BUILTIN_SUB_OVERFLOW - __builtin_sub_overflow() supported +// V8_HAS_BUILTIN_MUL_OVERFLOW - __builtin_mul_overflow() supported // V8_HAS_BUILTIN_SADD_OVERFLOW - __builtin_sadd_overflow() supported // V8_HAS_BUILTIN_SSUB_OVERFLOW - __builtin_ssub_overflow() supported // V8_HAS_BUILTIN_UADD_OVERFLOW - __builtin_uadd_overflow() supported @@ -339,9 +345,25 @@ path. Add it with -I to the command line # define V8_HAS_ATTRIBUTE_ALWAYS_INLINE (__has_attribute(always_inline)) # define V8_HAS_ATTRIBUTE_CONSTINIT \ (__has_attribute(require_constant_initialization)) +# define V8_HAS_ATTRIBUTE_CONST (__has_attribute(const)) # define V8_HAS_ATTRIBUTE_NONNULL (__has_attribute(nonnull)) # define V8_HAS_ATTRIBUTE_NOINLINE (__has_attribute(noinline)) # define V8_HAS_ATTRIBUTE_UNUSED (__has_attribute(unused)) +// Support for the "preserve_most" attribute is limited: +// - 32-bit platforms do not implement it, +// - component builds fail because _dl_runtime_resolve clobbers registers, +// - we see crashes on arm64 on Windows (https://crbug.com/1409934), which can +// hopefully be fixed in the future. +// Additionally, the initial implementation in clang <= 16 overwrote the return +// register(s) in the epilogue of a preserve_most function, so we only use +// preserve_most in clang >= 17 (see https://reviews.llvm.org/D143425). +#if (defined(_M_X64) || defined(__x86_64__) /* x64 (everywhere) */ \ + || ((defined(__AARCH64EL__) || defined(_M_ARM64)) /* arm64, but ... */ \ + && !defined(_WIN32))) /* not on windows */ \ + && !defined(COMPONENT_BUILD) /* no component build */\ + && __clang_major__ >= 17 /* clang >= 17 */ +# define V8_HAS_ATTRIBUTE_PRESERVE_MOST (__has_attribute(preserve_most)) +#endif # define V8_HAS_ATTRIBUTE_VISIBILITY (__has_attribute(visibility)) # define V8_HAS_ATTRIBUTE_WARN_UNUSED_RESULT \ (__has_attribute(warn_unused_result)) @@ -360,6 +382,9 @@ path. Add it with -I to the command line # define V8_HAS_BUILTIN_EXPECT (__has_builtin(__builtin_expect)) # define V8_HAS_BUILTIN_FRAME_ADDRESS (__has_builtin(__builtin_frame_address)) # define V8_HAS_BUILTIN_POPCOUNT (__has_builtin(__builtin_popcount)) +# define V8_HAS_BUILTIN_ADD_OVERFLOW (__has_builtin(__builtin_add_overflow)) +# define V8_HAS_BUILTIN_SUB_OVERFLOW (__has_builtin(__builtin_sub_overflow)) +# define V8_HAS_BUILTIN_MUL_OVERFLOW (__has_builtin(__builtin_mul_overflow)) # define V8_HAS_BUILTIN_SADD_OVERFLOW (__has_builtin(__builtin_sadd_overflow)) # define V8_HAS_BUILTIN_SSUB_OVERFLOW (__has_builtin(__builtin_ssub_overflow)) # define V8_HAS_BUILTIN_UADD_OVERFLOW (__has_builtin(__builtin_uadd_overflow)) @@ -455,6 +480,16 @@ path. Add it with -I to the command line #endif +// A macro to mark functions whose values don't change (e.g. across calls) +// and thereby compiler is free to hoist and fold multiple calls together. +// Use like: +// V8_CONST int foo() { ... } +#if V8_HAS_ATTRIBUTE_CONST +# define V8_CONST __attribute__((const)) +#else +# define V8_CONST +#endif + // A macro to mark a declaration as requiring constant initialization. // Use like: // int* foo V8_CONSTINIT; @@ -487,6 +522,21 @@ path. Add it with -I to the command line #endif +// A macro used to change the calling conventions to preserve all registers (no +// caller-saved registers). Use this for cold functions called from hot +// functions. +// Note: The attribute is considered experimental, so apply with care. Also, +// "preserve_most" is currently not handling the return value correctly, so only +// use it for functions returning void (see https://reviews.llvm.org/D141020). +// Use like: +// V8_NOINLINE V8_PRESERVE_MOST void UnlikelyMethod(); +#if V8_HAS_ATTRIBUTE_PRESERVE_MOST +# define V8_PRESERVE_MOST __attribute__((preserve_most)) +#else +# define V8_PRESERVE_MOST /* NOT SUPPORTED */ +#endif + + // A macro (V8_DEPRECATED) to mark classes or functions as deprecated. #if defined(V8_DEPRECATION_WARNINGS) # define V8_DEPRECATED(message) [[deprecated(message)]] @@ -884,4 +934,10 @@ V8 shared library set USING_V8_SHARED. #undef V8_HAS_CPP_ATTRIBUTE +#if !defined(V8_STATIC_ROOTS) +#define V8_STATIC_ROOTS_BOOL false +#else +#define V8_STATIC_ROOTS_BOOL true +#endif + #endif // V8CONFIG_H_ diff --git a/deps/v8/infra/mb/gn_isolate_map.pyl b/deps/v8/infra/mb/gn_isolate_map.pyl index 5732d862189c1a..40df0f013f7d49 100644 --- a/deps/v8/infra/mb/gn_isolate_map.pyl +++ b/deps/v8/infra/mb/gn_isolate_map.pyl @@ -31,6 +31,10 @@ "label": "//test:v8_d8_default", "type": "script", }, + "d8_pgo": { + "label": "//test:d8_pgo", + "type": "script", + }, "generate-bytecode-expectations": { "label": "//test/unittests:generate-bytecode-expectations", "type": "script", @@ -72,7 +76,7 @@ "type": "script", }, "unittests": { - "label": "//test/unittests:unittests", + "label": "//test/unittests:v8_unittests", "type": "script", }, "fuchsia-unittests": { diff --git a/deps/v8/infra/mb/mb_config.pyl b/deps/v8/infra/mb/mb_config.pyl index b5d6231600488a..741ae615cbd2cb 100644 --- a/deps/v8/infra/mb/mb_config.pyl +++ b/deps/v8/infra/mb/mb_config.pyl @@ -52,6 +52,10 @@ 'linux-v8-dr': 'release_x64', }, 'client.v8': { + # PGO + 'V8 Linux PGO instrumentation - builder' : 'builtins_profiling_x86', + 'V8 Linux64 PGO instrumentation - builder' : 'builtins_profiling_x64', + # Linux. 'V8 Linux - builder': 'release_x86_gcmole', 'V8 Linux - debug builder': 'debug_x86', @@ -59,14 +63,13 @@ 'V8 Linux - noi18n - debug builder': 'debug_x86_no_i18n', 'V8 Linux - verify csa - builder': 'release_x86_verify_csa', # Linux64. - 'V8 Linux64 - builder': 'release_x64', + 'V8 Linux64 - builder': 'release_x64_gcmole', 'V8 Linux64 - builder (goma cache silo)': 'release_x64', 'V8 Linux64 - builder (reclient)': 'release_x64_reclient', 'V8 Linux64 - builder (reclient compare)': 'release_x64_reclient', 'V8 Linux64 - debug builder': 'debug_x64', 'V8 Linux64 - external code space - debug - builder': 'debug_x64_external_code_space', 'V8 Linux64 - custom snapshot - debug builder': 'debug_x64_custom', - 'V8 Linux64 - heap sandbox - debug - builder': 'debug_x64_heap_sandbox', 'V8 Linux64 - internal snapshot - builder': 'release_x64_internal', 'V8 Linux64 - debug - header includes - builder': 'debug_x64_header_includes', 'V8 Linux64 - no sandbox - debug builder': 'debug_x64_no_sandbox', @@ -80,6 +83,7 @@ 'V8 Win32 - builder (reclient)': 'release_x86_minimal_symbols_reclient', 'V8 Win32 - builder (reclient compare)': 'release_x86_minimal_symbols_reclient', 'V8 Win32 - debug builder': 'debug_x86_minimal_symbols', + 'V8 Win32 - msvc - debug builder': 'debug_x86_msvc', # TODO(machenbach): Remove after switching to x64 on infra side. 'V8 Win64 ASAN - builder': 'release_x64_asan_no_lsan', 'V8 Win64 - builder': 'release_x64_minimal_symbols', @@ -103,14 +107,16 @@ # Sanitizers. 'V8 Linux64 ASAN - builder': 'release_x64_asan', 'V8 Linux64 TSAN - builder': 'release_x64_tsan', + 'V8 Linux64 TSAN - debug builder': 'debug_x64_tsan_minimal_symbols', 'V8 Linux64 TSAN - no-concurrent-marking - builder': 'release_x64_tsan_no_cm', 'V8 Linux - arm64 - sim - CFI - builder': 'release_simulate_arm64_cfi', 'V8 Linux - arm64 - sim - MSAN - builder': 'release_simulate_arm64_msan', # FYI. 'V8 iOS - sim - builder': 'release_x64_ios_simulator', - 'V8 Linux64 - arm64 - sim - heap sandbox - debug - builder': 'debug_x64_heap_sandbox_arm64_sim', 'V8 Linux64 - arm64 - sim - no pointer compression - builder': 'release_simulate_arm64_no_pointer_compression', + 'V8 Linux64 - coverage': 'release_x64_coverage', + 'V8 Linux64 - coverage - debug': 'debug_x64_coverage', 'V8 Linux64 - cppgc-non-default - debug - builder': 'debug_x64_non_default_cppgc', 'V8 Linux64 - debug - perfetto - builder': 'debug_x64_perfetto', 'V8 Linux64 - disable runtime call stats - builder': 'release_x64_disable_runtime_call_stats', @@ -125,9 +131,9 @@ 'V8 Linux64 - cfi - builder': 'release_x64_cfi', 'V8 Linux64 UBSan - builder': 'release_x64_ubsan', 'V8 Linux - vtunejit': 'debug_x86_vtunejit', - 'V8 Linux64 - gcov coverage': 'release_x64_gcc_coverage', 'V8 Linux64 - Fuzzilli - builder': 'release_x64_fuzzilli', 'V8 Linux64 - predictable - builder': 'release_x64_predictable', + 'V8 Linux64 - verify deterministic': 'release_x64_verify_deterministic', 'V8 Linux - full debug builder': 'full_debug_x86', 'V8 Mac64 - full debug builder': 'full_debug_x64', 'V8 Random Deopt Fuzzer - debug': 'debug_x64', @@ -168,22 +174,28 @@ 'V8 Clusterfuzz Linux64 UBSan - release builder': 'release_x64_ubsan_recover', 'V8 Clusterfuzz Linux64 ASAN sandbox testing - release builder': - 'release_x64_asan_sandbox_testing', + 'release_x64_asan_symbolized_expose_memory_corruption', }, 'client.v8.perf' : { 'V8 Arm - builder - perf': 'official_arm', + 'V8 Arm - builder - pgo - perf': 'official_arm_pgo', 'V8 Android Arm - builder - perf': 'official_android_arm', + 'V8 Android Arm - builder - pgo - perf': 'official_android_arm_pgo', 'V8 Android Arm64 - builder - perf': 'official_android_arm64', + 'V8 Android Arm64 - builder - pgo - perf': 'official_android_arm64_pgo', 'V8 Linux - builder - perf': 'official_x86', + 'V8 Linux - builder - pgo - perf': 'official_x86_pgo', 'V8 Linux64 - builder - perf': 'official_x64', + 'V8 Linux64 - builder - pgo - perf': 'official_x64_pgo', 'V8 Mac Arm64 - builder - perf': 'official_mac_arm64', + 'V8 Mac Arm64 - builder - pgo - perf': 'official_mac_arm64_pgo', }, 'client.v8.ports': { # Arm. 'V8 Arm - builder': 'release_arm', 'V8 Arm - debug builder': 'debug_arm', 'V8 Android Arm - builder': 'release_android_arm', - 'V8 Linux - arm - sim - builder': 'release_simulate_arm', + 'V8 Linux - arm - sim - builder': 'release_simulate_arm_gcmole', 'V8 Linux - arm - sim - debug builder': 'debug_simulate_arm', 'V8 Linux - arm - sim - lite - builder': 'release_simulate_arm_lite', 'V8 Linux - arm - sim - lite - debug builder': 'debug_simulate_arm_lite', @@ -191,7 +203,7 @@ 'V8 Android Arm64 - builder': 'release_android_arm64', 'V8 Android Arm64 - debug builder': 'debug_android_arm64', 'V8 Arm64 - builder': 'release_arm64_hard_float', - 'V8 Linux - arm64 - sim - builder': 'release_simulate_arm64', + 'V8 Linux - arm64 - sim - builder': 'release_simulate_arm64_gcmole', 'V8 Linux - arm64 - sim - debug builder': 'debug_simulate_arm64', 'V8 Linux - arm64 - sim - gc stress - builder': 'debug_simulate_arm64', # Mips. @@ -209,6 +221,7 @@ 'v8_android_arm_compile_rel': 'release_android_arm', 'v8_android_arm64_compile_dbg': 'debug_android_arm64', 'v8_android_arm64_n5x_compile_rel': 'release_android_arm64', + 'v8_android_arm64_d8_compile_rel': 'release_android_arm64', 'v8_fuchsia_compile_rel': 'release_x64_fuchsia_trybot', 'v8_ios_simulator': 'release_x64_ios_simulator', 'v8_linux_compile_rel': 'release_x86_gcmole_trybot', @@ -225,6 +238,8 @@ 'release_simulate_arm64_no_pointer_compression', 'v8_linux64_cppgc_non_default_compile_dbg': 'debug_x64_non_default_cppgc', 'v8_linux64_compile_dbg': 'debug_x64_trybot', + 'v8_linux64_coverage_dbg': 'debug_x64_coverage', + 'v8_linux64_coverage_rel': 'release_x64_coverage', 'v8_linux64_no_sandbox_compile_dbg': 'debug_x64_no_sandbox', 'v8_linux64_dict_tracking_compile_dbg': 'debug_x64_dict_tracking_trybot', 'v8_linux64_disable_runtime_call_stats_compile_rel': 'release_x64_disable_runtime_call_stats', @@ -235,16 +250,13 @@ 'v8_linux64_gcc_compile_dbg': 'debug_x64_gcc', 'v8_linux64_gcc_light_compile_dbg': 'debug_x64_gcc', 'v8_linux64_gcc_compile_rel': 'release_x64_gcc', - 'v8_linux64_gcov_coverage': 'release_x64_gcc_coverage', 'v8_linux64_header_includes_dbg': 'debug_x64_header_includes', - 'v8_linux64_heap_sandbox_compile_dbg': 'debug_x64_heap_sandbox', 'v8_linux64_minor_mc_compile_dbg': 'debug_x64_trybot', - 'v8_linux_arm64_sim_heap_sandbox_compile_dbg': 'debug_x64_heap_sandbox_arm64_sim', 'v8_linux64_fyi_compile_rel': 'release_x64_test_features_trybot', 'v8_linux64_nodcheck_compile_rel': 'release_x64', 'v8_linux64_perfetto_compile_dbg': 'debug_x64_perfetto', 'v8_linux64_no_pointer_compression_compile_rel': 'release_x64_no_pointer_compression', - 'v8_linux64_compile_rel': 'release_x64_test_features_trybot', + 'v8_linux64_compile_rel': 'release_x64_test_features_gcmole_trybot', 'v8_linux64_no_sandbox_compile_rel': 'release_x64_no_sandbox', 'v8_linux64_predictable_compile_rel': 'release_x64_predictable', 'v8_linux64_shared_compile_rel': 'release_x64_shared_verify_heap', @@ -259,15 +271,18 @@ 'v8_linux_riscv32_compile_rel': 'release_simulate_riscv32', 'v8_linux64_riscv64_compile_rel': 'release_simulate_riscv64', 'v8_linux64_tsan_compile_rel': 'release_x64_tsan_minimal_symbols', + 'v8_linux64_tsan_compile_dbg': 'debug_x64_tsan_minimal_symbols', 'v8_linux64_tsan_no_cm_compile_rel': 'release_x64_tsan_no_cm', 'v8_linux64_tsan_isolates_compile_rel': 'release_x64_tsan_minimal_symbols', 'v8_linux64_ubsan_compile_rel': 'release_x64_ubsan_minimal_symbols', + 'v8_linux64_verify_deterministic_rel': 'release_x64_verify_deterministic', 'v8_odroid_arm_compile_rel': 'release_arm', 'v8_linux_torque_compare': 'torque_compare', # TODO(machenbach): Remove after switching to x64 on infra side. 'v8_win_compile_dbg': 'debug_x86_trybot', 'v8_win_compile_rel': 'release_x86_trybot', + 'v8_win_msvc_light_compile_dbg': 'debug_x86_msvc', 'v8_win64_asan_compile_rel': 'release_x64_asan_no_lsan', 'v8_win64_msvc_light_compile_rel': 'release_x64_msvc', 'v8_win64_compile_dbg': 'debug_x64_minimal_symbols', @@ -284,15 +299,15 @@ 'v8_mac64_compile_rel': 'release_x64_trybot', 'v8_mac64_dbg': 'debug_x64', 'v8_mac64_compile_dbg': 'debug_x64', - 'v8_mac64_compile_full_compile_dbg': 'full_debug_x64', + 'v8_mac64_noopt_compile_dbg': 'full_debug_x64', 'v8_mac64_asan_compile_rel': 'release_x64_asan_no_lsan', - 'v8_linux_arm_compile_rel': 'release_simulate_arm_trybot', + 'v8_linux_arm_compile_rel': 'release_simulate_arm_gcmole_trybot', 'v8_linux_arm_lite_compile_dbg': 'debug_simulate_arm_lite', 'v8_linux_arm_lite_compile_rel': 'release_simulate_arm_lite_trybot', 'v8_linux_arm_compile_dbg': 'debug_simulate_arm', 'v8_linux_arm_armv8a_rel': 'release_simulate_arm_trybot', 'v8_linux_arm_armv8a_dbg': 'debug_simulate_arm', - 'v8_linux_arm64_compile_rel': 'release_simulate_arm64_trybot', + 'v8_linux_arm64_compile_rel': 'release_simulate_arm64_gcmole_trybot', 'v8_linux_arm64_cfi_compile_rel' : 'release_simulate_arm64_cfi', 'v8_linux_arm64_compile_dbg': 'debug_simulate_arm64', 'v8_linux_arm64_gc_stress_compile_dbg': 'debug_simulate_arm64', @@ -399,20 +414,26 @@ 'debug_bot', 'simulate_arm64', 'asan', 'lsan'], # Release configs for simulators. - 'release_simulate_arm': [ - 'release_bot', 'simulate_arm'], + 'release_simulate_arm_gcmole': [ + 'release_bot', 'simulate_arm', 'gcmole'], 'release_simulate_arm_lite': [ 'release_bot', 'simulate_arm', 'v8_enable_lite_mode'], - 'release_simulate_arm_trybot': [ - 'release_trybot', 'simulate_arm'], + 'release_simulate_arm_gcmole_trybot': [ + 'release_trybot', 'simulate_arm', 'gcmole'], 'release_simulate_arm_lite_trybot': [ 'release_trybot', 'simulate_arm', 'v8_enable_lite_mode'], + 'release_simulate_arm_trybot': [ + 'release_trybot', 'simulate_arm'], 'release_simulate_arm64': [ 'release_bot', 'simulate_arm64'], 'release_simulate_arm64_cfi': [ 'release_bot', 'simulate_arm64', 'v8_control_flow_integrity'], + 'release_simulate_arm64_gcmole': [ + 'release_bot', 'simulate_arm64', 'gcmole'], + 'release_simulate_arm64_gcmole_trybot': [ + 'release_trybot', 'simulate_arm64', 'gcmole'], 'release_simulate_arm64_no_pointer_compression': [ - 'release_bot', 'simulate_arm64_no_sandbox', 'dcheck_always_on', + 'release_bot', 'simulate_arm64', 'no_sandbox', 'dcheck_always_on', 'v8_enable_slow_dchecks', 'v8_disable_pointer_compression'], 'release_simulate_arm64_msan': [ 'release_bot', 'simulate_arm64', 'msan'], @@ -445,7 +466,7 @@ 'debug_arm64': [ 'debug_bot', 'arm64'], 'debug_arm64_no_pointer_compression': [ - 'debug_bot', 'arm64_no_sandbox', 'dcheck_always_on', 'v8_enable_slow_dchecks', 'v8_enable_javascript_promise_hooks', + 'debug_bot', 'arm64', 'no_sandbox', 'dcheck_always_on', 'v8_enable_slow_dchecks', 'v8_enable_javascript_promise_hooks', 'v8_disable_pointer_compression'], 'full_debug_arm64': [ 'debug_bot', 'arm64', 'v8_full_debug'], @@ -466,15 +487,29 @@ # Official configs for arm 'official_arm': [ - 'release_bot', 'arm', 'hard_float', 'official', 'disable_pgo'], + 'release_bot', 'arm', 'hard_float', 'official', 'disable_chrome_pgo'], + 'official_arm_pgo': [ + 'release_bot', 'arm', 'hard_float', 'official', 'disable_chrome_pgo', + 'builtins_optimization'], 'official_android_arm': [ 'release_bot', 'arm', 'android', 'minimal_symbols', - 'android_strip_outputs', 'official', 'disable_pgo'], + 'android_strip_outputs', 'official', 'disable_chrome_pgo'], + 'official_android_arm_pgo': [ + 'release_bot', 'arm', 'android', 'minimal_symbols', + 'android_strip_outputs', 'official', 'disable_chrome_pgo', + 'builtins_optimization'], 'official_android_arm64': [ 'release_bot', 'arm64', 'android', 'minimal_symbols', - 'android_strip_outputs', 'official', 'disable_pgo'], + 'android_strip_outputs', 'official', 'disable_chrome_pgo'], + 'official_android_arm64_pgo': [ + 'release_bot', 'arm64', 'android', 'minimal_symbols', + 'android_strip_outputs', 'official', 'disable_chrome_pgo', + 'builtins_optimization'], 'official_mac_arm64': [ - 'release_bot', 'arm64', 'official', 'disable_pgo'], + 'release_bot', 'arm64', 'official', 'disable_chrome_pgo'], + 'official_mac_arm64_pgo': [ + 'release_bot', 'arm64', 'official', 'disable_chrome_pgo', + 'builtins_optimization'], # Release configs for x64. 'release_x64': [ @@ -492,6 +527,9 @@ 'release_x64_asan_no_lsan_verify_heap_dchecks': [ 'release_bot', 'x64', 'asan', 'dcheck_always_on', 'v8_enable_slow_dchecks', 'v8_verify_heap'], + 'release_x64_asan_symbolized_expose_memory_corruption': [ + 'release_bot', 'x64', 'asan', 'symbolized', + 'v8_expose_memory_corruption_api'], 'release_x64_asan_symbolized_verify_heap': [ 'release_bot', 'x64', 'asan', 'lsan', 'symbolized', 'v8_verify_heap'], @@ -499,9 +537,13 @@ 'release_bot', 'x64', 'cfi'], 'release_x64_cfi_clusterfuzz': [ 'release_bot', 'x64', 'cfi_clusterfuzz'], + 'release_x64_coverage': [ + 'release_bot', 'x64', 'clang_coverage'], 'release_x64_fuzzilli': [ 'release_bot', 'x64', 'dcheck_always_on', 'v8_enable_slow_dchecks', 'v8_verify_heap', 'v8_verify_csa', 'fuzzilli'], + 'release_x64_gcmole': [ + 'release_bot', 'x64', 'gcmole'], 'release_x64_msvc': [ 'release_bot_no_goma', 'x64', 'minimal_symbols', 'msvc'], 'release_x64_correctness_fuzzer' : [ @@ -514,9 +556,6 @@ 'release_trybot', 'x64', 'fuchsia'], 'release_x64_gcc': [ 'release_bot_no_goma', 'x64', 'gcc', 'lld', 'no_custom_libcxx'], - 'release_x64_gcc_coverage': [ - 'release_bot_no_goma', 'x64', 'coverage', 'gcc', 'lld', - 'no_custom_libcxx', 'no_sysroot'], 'release_x64_ios_simulator': [ 'release_bot', 'x64', 'ios_simulator'], 'release_x64_internal': [ @@ -526,14 +565,16 @@ 'release_x64_minimal_symbols_reclient': [ 'release_bot_reclient', 'x64', 'minimal_symbols'], 'release_x64_no_pointer_compression': [ - 'release_bot', 'x64_no_sandbox', 'dcheck_always_on', 'v8_enable_slow_dchecks', 'v8_enable_javascript_promise_hooks', - 'v8_disable_pointer_compression'], + 'release_bot', 'x64', 'no_sandbox', 'dcheck_always_on', 'v8_enable_slow_dchecks', + 'v8_enable_javascript_promise_hooks', 'v8_disable_pointer_compression'], 'release_x64_reclient': [ 'release_bot_reclient', 'x64'], 'release_x64_no_sandbox': [ - 'release_bot', 'x64_no_sandbox'], + 'release_bot', 'x64', 'no_sandbox'], 'release_x64_trybot': [ 'release_trybot', 'x64'], + 'release_x64_test_features_gcmole_trybot': [ + 'release_trybot', 'x64', 'v8_enable_test_features', 'gcmole'], 'release_x64_test_features_trybot': [ 'release_trybot', 'x64', 'v8_enable_test_features'], 'release_x64_tsan': [ @@ -553,15 +594,17 @@ 'release_x64_verify_csa': [ 'release_bot', 'x64', 'dcheck_always_on', 'v8_enable_slow_dchecks', 'v8_verify_csa'], + 'release_x64_verify_deterministic': [ + 'release_bot', 'x64', 'v8_verify_deterministic'], 'release_x64_webassembly_disabled': [ 'release_bot', 'x64', 'webassembly_disabled'], - 'release_x64_asan_sandbox_testing': [ - 'release_bot', 'x64', 'asan', 'symbolized', 'v8_enable_sandbox_future', - 'v8_expose_memory_corruption_api'], # Official configs for x64. 'official_x64': [ - 'release_bot', 'x64', 'official', 'disable_pgo'], + 'release_bot', 'x64', 'official', 'disable_chrome_pgo'], + 'official_x64_pgo': [ + 'release_bot', 'x64', 'official', 'disable_chrome_pgo', + 'builtins_optimization'], # Debug configs for x64. 'debug_x64': [ @@ -573,6 +616,8 @@ 'x64', 'asan'], 'debug_x64_conservative_stack_scanning': [ 'debug_bot', 'x64', 'conservative_stack_scanning'], + 'debug_x64_coverage': [ + 'debug_bot', 'x64', 'clang_coverage'], 'debug_x64_custom': [ 'debug_bot', 'x64', 'v8_snapshot_custom'], 'debug_x64_external_code_space': [ @@ -583,10 +628,6 @@ 'debug_bot_no_goma', 'x64', 'gcc', 'lld', 'no_custom_libcxx'], 'debug_x64_header_includes': [ 'debug_bot', 'x64', 'v8_check_header_includes'], - 'debug_x64_heap_sandbox': [ - 'debug_bot', 'x64', 'v8_enable_sandbox_future', 'v8_expose_memory_corruption_api'], - 'debug_x64_heap_sandbox_arm64_sim': [ - 'debug_bot', 'simulate_arm64', 'v8_enable_sandbox_future', 'v8_expose_memory_corruption_api'], 'debug_x64_minimal_symbols': [ 'debug_bot', 'x64', 'minimal_symbols'], 'debug_x64_non_default_cppgc': [ @@ -594,7 +635,7 @@ 'debug_x64_perfetto': [ 'debug_bot', 'x64', 'perfetto'], 'debug_x64_no_sandbox': [ - 'debug_bot', 'x64_no_sandbox'], + 'debug_bot', 'x64', 'no_sandbox'], 'debug_x64_single_generation': [ 'debug_bot', 'x64', 'v8_enable_single_generation'], 'debug_x64_trybot': [ @@ -603,6 +644,9 @@ 'debug_trybot', 'x64', 'v8_enable_dict_property_const_tracking'], 'debug_x64_trybot_custom': [ 'debug_trybot', 'x64', 'v8_snapshot_custom'], + 'debug_x64_tsan_minimal_symbols': [ + 'debug_bot_no_slow_dchecks', 'minimal_symbols', 'x64', 'dcheck_always_on', + 'tsan', 'v8_disable_verify_heap', 'v8_fast_mksnapshot'], 'full_debug_x64': [ 'debug_bot', 'x64', 'v8_full_debug'], @@ -613,6 +657,8 @@ 'debug_bot', 'x86', 'asan', 'lsan'], 'debug_x86_minimal_symbols': [ 'debug_bot', 'x86', 'minimal_symbols'], + 'debug_x86_msvc': [ + 'debug_bot_no_goma', 'x86', 'minimal_symbols', 'msvc'], 'debug_x86_no_i18n': [ 'debug_bot', 'x86', 'v8_no_i18n'], 'debug_x86_trybot': [ @@ -650,11 +696,18 @@ # Official configs for x86. 'official_x86': [ - 'release_bot', 'x86', 'official', 'disable_pgo'], + 'release_bot', 'x86', 'official', 'disable_chrome_pgo'], + 'official_x86_pgo': [ + 'release_bot', 'x86', 'official', 'disable_chrome_pgo', + 'builtins_optimization'], # Torque compare test 'torque_compare': [ - 'release_bot', 'verify_torque'] + 'release_bot', 'verify_torque'], + + # PGO + 'builtins_profiling_x86': ['builtins_profiling', 'x86'], + 'builtins_profiling_x64': ['builtins_profiling', 'x64'], }, 'mixins': { @@ -671,11 +724,7 @@ }, 'arm64': { - 'gn_args': 'target_cpu="arm64" v8_enable_sandbox=true', - }, - - 'arm64_no_sandbox': { - 'gn_args': 'target_cpu="arm64" v8_enable_sandbox=false', + 'gn_args': 'target_cpu="arm64"', }, 'asan': { @@ -683,6 +732,15 @@ 'gn_args': 'is_asan=true', }, + 'builtins_profiling': { + 'mixins' : ['release_bot_reclient'], + 'gn_args': 'v8_enable_builtins_profiling=true', + }, + + 'builtins_optimization': { + 'gn_args': 'v8_enable_builtins_optimization=true', + }, + 'cfi': { 'mixins': ['v8_enable_test_features'], 'gn_args': ('is_cfi=true use_cfi_cast=true use_cfi_icall=true ' @@ -699,13 +757,12 @@ 'gn_args': 'is_clang=true', }, - 'conservative_stack_scanning': { - 'gn_args': 'v8_enable_conservative_stack_scanning=true ' - 'v8_enable_inner_pointer_resolution_mb=true', + 'clang_coverage': { + 'gn_args': 'use_clang_coverage=true', }, - 'coverage': { - 'gn_args': 'v8_code_coverage=true', + 'conservative_stack_scanning': { + 'gn_args': 'v8_enable_conservative_stack_scanning=true', }, 'dcheck_always_on': { @@ -716,6 +773,12 @@ 'gn_args': 'is_debug=true v8_enable_backtrace=true', }, + 'debug_bot_no_slow_dchecks': { + 'mixins': [ + 'debug', 'shared', 'goma', 'v8_disable_slow_dchecks', + 'v8_optimized_debug', 'v8_enable_google_benchmark'], + }, + 'debug_bot': { 'mixins': [ 'debug', 'shared', 'goma', 'v8_enable_slow_dchecks', @@ -741,7 +804,7 @@ 'v8_enable_atomic_object_field_writes=false ', }, - 'disable_pgo': { + 'disable_chrome_pgo': { 'gn_args': 'chrome_pgo_phase=0', }, @@ -793,12 +856,12 @@ 'msan': { 'mixins': ['v8_enable_test_features'], - 'gn_args': 'is_msan=true msan_track_origins=2', + 'gn_args': 'is_msan=true msan_track_origins=2 instrumented_libraries_release="focal"', }, 'msan_no_origins': { 'mixins': ['v8_enable_test_features'], - 'gn_args': 'is_msan=true msan_track_origins=0', + 'gn_args': 'is_msan=true msan_track_origins=0 instrumented_libraries_release="focal"', }, 'msvc': { @@ -813,8 +876,8 @@ 'gn_args': 'use_goma=false', }, - 'no_sysroot': { - 'gn_args': 'use_sysroot=false', + 'no_sandbox': { + 'gn_args': 'v8_enable_sandbox=false', }, 'non_default_cppgc': { @@ -862,11 +925,7 @@ }, 'simulate_arm64': { - 'gn_args': 'target_cpu="x64" v8_target_cpu="arm64" v8_enable_sandbox=true', - }, - - 'simulate_arm64_no_sandbox': { - 'gn_args': 'target_cpu="x64" v8_target_cpu="arm64" v8_enable_sandbox=false', + 'gn_args': 'target_cpu="x64" v8_target_cpu="arm64"', }, 'simulate_loong64': { @@ -938,8 +997,8 @@ 'gn_args': 'v8_enable_runtime_call_stats=false', }, - 'v8_enable_sandbox_future': { - 'gn_args': 'v8_enable_sandbox_future=true', + 'v8_disable_verify_heap': { + 'gn_args': 'v8_enable_verify_heap=false', }, 'v8_expose_memory_corruption_api': { @@ -954,6 +1013,10 @@ 'gn_args': 'v8_enable_slow_dchecks=true', }, + 'v8_disable_slow_dchecks': { + 'gn_args': 'v8_enable_slow_dchecks=false', + }, + 'v8_enable_javascript_promise_hooks': { 'gn_args': 'v8_enable_javascript_promise_hooks=true', }, @@ -989,6 +1052,10 @@ 'gn_args': 'v8_enable_vtunejit=true v8_enable_vtunetracemark=true', }, + 'v8_fast_mksnapshot': { + 'gn_args': 'v8_enable_fast_mksnapshot=true', + }, + 'v8_full_debug': { 'gn_args': 'v8_optimized_debug=false', }, @@ -1018,6 +1085,10 @@ 'gn_args': 'v8_enable_verify_csa=true', }, + 'v8_verify_deterministic': { + 'gn_args': 'v8_verify_deterministic_mksnapshot=true', + }, + 's390x': { 'gn_args': 'target_cpu="s390x" v8_target_cpu="s390x"', }, @@ -1031,11 +1102,7 @@ }, 'x64': { - 'gn_args': 'target_cpu="x64" v8_enable_sandbox=true', - }, - - 'x64_no_sandbox': { - 'gn_args': 'target_cpu="x64" v8_enable_sandbox=false', + 'gn_args': 'target_cpu="x64"', }, 'x86': { diff --git a/deps/v8/infra/testing/builders.pyl b/deps/v8/infra/testing/builders.pyl index 19d5e1845249ec..63d675bddd23dd 100644 --- a/deps/v8/infra/testing/builders.pyl +++ b/deps/v8/infra/testing/builders.pyl @@ -89,7 +89,8 @@ 'name': 'test262', 'suffix': 'noavx', 'variant': 'default', - 'test_args': ['--extra-flags', '--noenable-avx'] + 'test_args': ['--extra-flags', '--noenable-avx'], + 'shards': 2 }, { 'name': 'v8testing', @@ -128,8 +129,8 @@ {'name': 'benchmarks', 'variant': 'extra'}, {'name': 'mozilla'}, {'name': 'mozilla', 'variant': 'extra'}, - {'name': 'test262', 'shards': 2}, - {'name': 'test262', 'variant': 'extra', 'shards': 2}, + {'name': 'test262', 'shards': 4}, + {'name': 'test262', 'variant': 'extra', 'shards': 4}, {'name': 'v8testing', 'shards': 2}, {'name': 'v8testing', 'variant': 'extra'}, { @@ -149,7 +150,7 @@ }, 'tests': [ {'name': 'mozilla', 'variant': 'default'}, - {'name': 'test262', 'variant': 'default'}, + {'name': 'test262', 'variant': 'default', 'shards': 2}, {'name': 'v8testing', 'variant': 'default', 'shards': 2}, ], }, @@ -179,7 +180,7 @@ ], 'shards': 4, }, - {'name': 'gcmole'}, + {'name': 'gcmole_v3', 'variant': 'ia32', 'shards': 4}, ], }, 'v8_linux_optional_rel': { @@ -210,6 +211,7 @@ '--extra-flags', '--noenable-sse3 --noenable-ssse3 --noenable-sse4-1 --noenable-avx', ], + 'shards': 2, }, { 'name': 'v8testing', @@ -237,6 +239,7 @@ '--extra-flags', '--noenable-ssse3 --noenable-sse4-1 --noenable-avx', ], + 'shards': 2, }, { 'name': 'v8testing', @@ -258,6 +261,7 @@ 'suffix': 'nosse4', 'variant': 'default', 'test_args': ['--extra-flags', '--noenable-sse4-1 --noenable-avx'], + 'shards': 2, }, { 'name': 'v8testing', @@ -275,7 +279,8 @@ 'name': 'test262', 'suffix': 'noavx', 'variant': 'default', - 'test_args': ['--extra-flags', '--noenable-avx'] + 'test_args': ['--extra-flags', '--noenable-avx'], + 'shards': 2, }, { 'name': 'v8testing', @@ -325,6 +330,7 @@ {'name': 'test262', 'variant': 'default', 'shards': 2}, {'name': 'v8testing', 'shards': 10}, {'name': 'v8testing', 'variant': 'extra', 'shards': 10}, + {'name': 'gcmole_v3', 'variant': 'arm', 'shards': 4}, ], }, ############################################################################## @@ -348,10 +354,28 @@ {'name': 'benchmarks'}, {'name': 'mozilla'}, {'name': 'optimize_for_size'}, - {'name': 'test262', 'variant': 'default'}, + {'name': 'test262', 'variant': 'default', 'shards': 2}, {'name': 'v8testing', 'shards': 3}, ], }, + 'v8_linux64_coverage_dbg': { + 'swarming_dimensions' : { + 'os': 'Ubuntu-18.04', + }, + 'tests': [ + {'name': 'v8testing', 'variant': 'default'}, + {'name': 'v8testing', 'variant': 'future'}, + ], + }, + 'v8_linux64_coverage_rel': { + 'swarming_dimensions' : { + 'os': 'Ubuntu-18.04', + }, + 'tests': [ + {'name': 'v8testing', 'variant': 'default'}, + {'name': 'v8testing', 'variant': 'future'}, + ], + }, 'v8_linux64_cppgc_non_default_dbg': { 'swarming_dimensions' : { 'cpu': 'x86-64-avx2', @@ -361,6 +385,14 @@ {'name': 'v8testing', 'shards': 3}, ], }, + 'v8_linux64_css_dbg': { + 'swarming_dimensions' : { + 'os': 'Ubuntu-18.04', + }, + 'tests': [ + {'name': 'v8testing', 'shards': 5}, + ], + }, 'v8_linux64_dbg': { 'swarming_dimensions' : { 'cpu': 'x86-64-avx2', @@ -368,12 +400,12 @@ }, 'tests': [ {'name': 'benchmarks', 'shards': 2}, - {'name': 'benchmarks', 'variant': 'extra'}, + {'name': 'benchmarks', 'variant': 'extra', 'shards': 2}, {'name': 'mjsunit_sp_frame_access', 'shards': 2}, {'name': 'mozilla'}, {'name': 'mozilla', 'variant': 'extra'}, - {'name': 'test262', 'variant': 'default', 'shards': 2}, - {'name': 'test262', 'variant': 'extra', 'shards': 9}, + {'name': 'test262', 'variant': 'default', 'shards': 3}, + {'name': 'test262', 'variant': 'extra', 'shards': 12}, {'name': 'v8testing', 'shards': 5}, {'name': 'v8testing', 'variant': 'extra', 'shards': 5}, {'name': 'v8testing', 'variant': 'minor_mc'}, @@ -383,6 +415,7 @@ {'name': 'v8testing', 'variant': 'stress_concurrent_inlining'}, # Maglev -- move to extra once more architectures are supported. {'name': 'mjsunit', 'variant': 'maglev'}, + {'name': 'mjsunit', 'variant': 'stress_maglev'}, ], }, 'v8_linux64_dict_tracking_dbg': { @@ -430,14 +463,10 @@ {'name': 'webkit', 'variant': 'stress_sampling'}, # Stress snapshot. {'name': 'mjsunit', 'variant': 'stress_snapshot'}, - # Maglev. - {'name': 'mjsunit', 'variant': 'maglev'}, - # Stress maglev. - {'name': 'mjsunit', 'variant': 'stress_maglev'}, + # Stress maglev-future. + {'name': 'mjsunit', 'variant': 'maglev_future'}, # Experimental regexp engine. {'name': 'mjsunit', 'variant': 'experimental_regexp'}, - # Wasm write protect code space. - {'name': 'mjsunit', 'variant': 'wasm_write_protect_code'}, ], }, 'v8_linux64_gc_stress_custom_snapshot_dbg': { @@ -481,22 +510,6 @@ {'name': 'v8testing'}, ], }, - 'v8_linux64_gcov_coverage': { - 'swarming_dimensions' : { - 'os': 'Ubuntu-18.04', - }, - 'tests': [ - {'name': 'v8testing'}, - ], - }, - 'v8_linux64_heap_sandbox_dbg': { - 'swarming_dimensions' : { - 'os': 'Ubuntu-18.04', - }, - 'tests': [ - {'name': 'v8testing', 'shards': 4}, - ], - }, 'v8_linux64_minor_mc_dbg': { 'swarming_dimensions' : { 'cpu': 'x86-64-avx2', @@ -512,11 +525,11 @@ }, 'v8_linux64_msan_rel': { 'swarming_dimensions' : { - 'os': 'Ubuntu-18.04', + 'os': 'Ubuntu-20.04', }, 'tests': [ - {'name': 'test262', 'variant': 'default', 'shards': 2}, - {'name': 'v8testing', 'shards': 5}, + {'name': 'test262', 'variant': 'default', 'shards': 4}, + {'name': 'v8testing', 'shards': 4}, ], }, 'v8_linux64_nodcheck_rel': { @@ -533,9 +546,9 @@ {'name': 'mozilla', 'variant': 'assert_types'}, {'name': 'mozilla', 'variant': 'extra'}, {'name': 'perf_integration'}, - {'name': 'test262', 'shards': 2}, - {'name': 'test262', 'variant': 'assert_types', 'shards': 2}, - {'name': 'test262', 'variant': 'extra', 'shards': 2}, + {'name': 'test262', 'shards': 4}, + {'name': 'test262', 'variant': 'assert_types'}, + {'name': 'test262', 'variant': 'extra', 'shards': 4}, {'name': 'v8testing', 'shards': 2}, {'name': 'v8testing', 'variant': 'assert_types'}, {'name': 'v8testing', 'variant': 'extra'}, @@ -543,6 +556,7 @@ {'name': 'v8testing', 'variant': 'stress_instruction_scheduling'}, # Maglev -- move to extra once more architectures are supported. {'name': 'mjsunit', 'variant': 'maglev'}, + {'name': 'mjsunit', 'variant': 'stress_maglev'}, ], }, 'v8_linux64_perfetto_dbg': { @@ -589,7 +603,7 @@ {'name': 'mjsunit_sp_frame_access'}, {'name': 'optimize_for_size'}, {'name': 'test262', 'shards': 4}, - {'name': 'test262', 'variant': 'extra', 'shards': 3}, + {'name': 'test262', 'variant': 'extra', 'shards': 4}, {'name': 'v8initializers'}, {'name': 'v8testing', 'shards': 2}, {'name': 'v8testing', 'variant': 'extra', 'shards': 2}, @@ -599,6 +613,21 @@ {'name': 'v8testing', 'variant': 'stress_instruction_scheduling'}, # Maglev -- move to extra once more architectures are supported. {'name': 'mjsunit', 'variant': 'maglev'}, + {'name': 'mjsunit', 'variant': 'stress_maglev'}, + # GCMole. + {'name': 'gcmole_v3', 'variant': 'x64', 'shards': 4}, + { + 'name': 'gcmole_v2', + 'variant': 'x64', + 'suffix': 'test single host', + 'test_args': ['--test-run'], + }, + { + 'name': 'gcmole_v3', + 'variant': 'x64', + 'suffix': 'test multi host', + 'test_args': ['--test-run'], + }, ], }, 'v8_linux64_predictable_rel': { @@ -630,11 +659,23 @@ {'name': 'mozilla', 'shards': 2}, {'name': 'test262', 'variant': 'default', 'shards': 5}, {'name': 'v8testing', 'shards': 6}, - {'name': 'v8testing', 'variant': 'extra', 'shards': 5}, + {'name': 'v8testing', 'variant': 'extra', 'shards': 6}, {'name': 'v8testing', 'variant': 'slow_path', 'shards': 2}, {'name': 'v8testing', 'variant': 'stress_concurrent_allocation', 'shards': 2}, ], }, + 'v8_linux64_tsan_dbg': { + 'swarming_dimensions' : { + 'os': 'Ubuntu-18.04', + }, + 'tests': [ + {'name': 'benchmarks', 'shards': 2}, + {'name': 'mozilla', 'shards': 4}, + {'name': 'test262', 'variant': 'default', 'shards': 5}, + {'name': 'v8testing', 'shards': 12}, + {'name': 'v8testing', 'variant': 'extra', 'shards': 10}, + ], + }, 'v8_linux64_tsan_no_cm_rel': { 'swarming_dimensions' : { 'os': 'Ubuntu-18.04', @@ -699,14 +740,6 @@ {'name': 'd8testing', 'test_args': ['--gc-stress'], 'shards': 12}, ], }, - 'v8_linux_arm64_sim_heap_sandbox_dbg': { - 'swarming_dimensions' : { - 'os': 'Ubuntu-18.04', - }, - 'tests': [ - {'name': 'v8testing', 'shards': 14}, - ], - }, 'v8_linux_arm64_rel': { 'swarming_dimensions' : { 'os': 'Ubuntu-18.04', @@ -717,6 +750,7 @@ {'name': 'test262', 'variant': 'default', 'shards': 4}, {'name': 'v8testing', 'shards': 14}, {'name': 'v8testing', 'variant': 'extra', 'shards': 14}, + {'name': 'gcmole_v3', 'variant': 'arm64', 'shards': 4}, ], }, 'v8_linux_arm64_cfi_rel': { @@ -787,7 +821,7 @@ 'v8_win_dbg': { 'swarming_dimensions' : { 'cpu': 'x86-64', - 'os': 'Windows-7-SP1', + 'os': 'Windows-10-19045', }, 'tests': [ {'name': 'mozilla'}, @@ -797,7 +831,7 @@ 'v8_win_rel': { 'swarming_dimensions' : { 'cpu': 'x86-64', - 'os': 'Windows-7-SP1', + 'os': 'Windows-10-19045', }, 'tests': [ {'name': 'mozilla'}, @@ -809,7 +843,7 @@ # Win64 'v8_win64_asan_rel': { 'swarming_dimensions' : { - 'os': 'Windows-10-19042', + 'os': 'Windows-10-19045', }, 'tests': [ {'name': 'v8testing', 'shards': 5}, @@ -818,7 +852,7 @@ 'v8_win64_dbg': { 'swarming_dimensions' : { 'cpu': 'x86-64', - 'os': 'Windows-10-19042', + 'os': 'Windows-10-19045', }, 'tests': [ {'name': 'mozilla'}, @@ -830,7 +864,7 @@ 'v8_win64_msvc_rel': { 'swarming_dimensions' : { 'cpu': 'x86-64', - 'os': 'Windows-10-19042', + 'os': 'Windows-10-19045', }, 'tests': [ {'name': 'mozilla'}, @@ -841,7 +875,7 @@ 'v8_win64_rel': { 'swarming_dimensions' : { 'cpu': 'x86-64', - 'os': 'Windows-10-19042', + 'os': 'Windows-10-19045', }, 'tests': [ {'name': 'mozilla'}, @@ -855,7 +889,7 @@ 'v8_mac64_asan_rel': { 'swarming_dimensions' : { 'cpu': 'x86-64', - 'os': 'Mac-10.15', + 'os': 'Mac-12', }, 'tests': [ {'name': 'v8testing', 'shards': 8}, @@ -864,7 +898,7 @@ 'v8_mac64_dbg': { 'swarming_dimensions' : { 'cpu': 'x86-64', - 'os': 'Mac-10.15', + 'os': 'Mac-12', }, 'tests': [ {'name': 'mozilla'}, @@ -876,16 +910,25 @@ 'v8_mac64_gc_stress_dbg': { 'swarming_dimensions' : { 'cpu': 'x86-64', - 'os': 'Mac-10.15', + 'os': 'Mac-12', }, 'tests': [ {'name': 'd8testing', 'test_args': ['--gc-stress'], 'shards': 6}, ], }, + 'v8_mac64_noopt_dbg': { + 'swarming_dimensions' : { + 'cpu': 'x86-64', + 'os': 'Mac-12', + }, + 'tests': [ + {'name': 'v8testing', 'shards': 6}, + ], + }, 'v8_mac64_rel': { 'swarming_dimensions' : { 'cpu': 'x86-64', - 'os': 'Mac-10.15', + 'os': 'Mac-12', }, 'tests': [ {'name': 'mozilla'}, @@ -902,6 +945,9 @@ }, 'tests': [ {'name': 'v8testing'}, + # Maglev -- move to extra once more architectures are supported. + {'name': 'mjsunit', 'variant': 'maglev'}, + {'name': 'mjsunit', 'variant': 'stress_maglev'}, ], }, 'v8_mac_arm64_dbg': { @@ -912,6 +958,9 @@ }, 'tests': [ {'name': 'v8testing'}, + # Maglev -- move to extra once more architectures are supported. + {'name': 'mjsunit', 'variant': 'maglev'}, + {'name': 'mjsunit', 'variant': 'stress_maglev'}, ], }, 'v8_mac_arm64_full_dbg': { @@ -922,6 +971,9 @@ }, 'tests': [ {'name': 'v8testing'}, + # Maglev -- move to extra once more architectures are supported. + {'name': 'mjsunit', 'variant': 'maglev'}, + {'name': 'mjsunit', 'variant': 'stress_maglev'}, ], }, 'v8_mac_arm64_no_pointer_compression_dbg': { @@ -937,7 +989,7 @@ 'v8_mac_arm64_sim_rel': { 'swarming_dimensions' : { 'cpu': 'x86-64', - 'os': 'Mac-10.15', + 'os': 'Mac-12', }, 'tests': [ {'name': 'v8testing', 'shards': 8}, @@ -947,7 +999,7 @@ 'v8_mac_arm64_sim_dbg': { 'swarming_dimensions' : { 'cpu': 'x86-64', - 'os': 'Mac-10.15', + 'os': 'Mac-12', }, 'tests': [ {'name': 'v8testing', 'shards': 8}, @@ -957,7 +1009,7 @@ 'v8_mac_arm64_sim_nodcheck_rel': { 'swarming_dimensions' : { 'cpu': 'x86-64', - 'os': 'Mac-10.15', + 'os': 'Mac-12', }, 'tests': [ {'name': 'v8testing', 'shards': 8}, @@ -1042,7 +1094,8 @@ 'name': 'test262', 'suffix': 'noavx', 'variant': 'default', - 'test_args': ['--extra-flags', '--noenable-avx'] + 'test_args': ['--extra-flags', '--noenable-avx'], + 'shards': 2 }, { 'name': 'v8testing', @@ -1050,7 +1103,7 @@ 'test_args': ['--extra-flags', '--noenable-avx'], 'shards': 2 }, - {'name': 'gcmole'}, + {'name': 'gcmole_v3', 'variant': 'ia32', 'shards': 4}, ], }, 'V8 Linux - arm64 - sim - CFI': { @@ -1064,10 +1117,10 @@ }, 'V8 Linux - arm64 - sim - MSAN': { 'swarming_dimensions': { - 'os': 'Ubuntu-18.04', + 'os': 'Ubuntu-20.04', }, 'tests': [ - {'name': 'test262', 'variant': 'default', 'shards': 3}, + {'name': 'test262', 'variant': 'default', 'shards': 4}, {'name': 'v8testing', 'shards': 4}, ], }, @@ -1086,9 +1139,9 @@ {'name': 'mozilla', 'variant': 'code_serializer', 'shards': 1}, {'name': 'mozilla', 'variant': 'extra'}, {'name': 'optimize_for_size'}, - {'name': 'test262', 'shards': 6}, + {'name': 'test262', 'shards': 12}, {'name': 'test262', 'variant': 'code_serializer', 'shards': 2}, - {'name': 'test262', 'variant': 'extra', 'shards': 5}, + {'name': 'test262', 'variant': 'extra', 'shards': 10}, {'name': 'v8testing', 'shards': 3}, { 'name': 'v8testing', @@ -1096,7 +1149,7 @@ 'test_args': ['--isolates'], 'shards': 4 }, - {'name': 'v8testing', 'variant': 'extra', 'shards': 2}, + {'name': 'v8testing', 'variant': 'extra', 'shards': 4}, # Nosse3. { 'name': 'mozilla', @@ -1107,7 +1160,8 @@ 'name': 'test262', 'suffix': 'nosse3', 'variant': 'default', - 'test_args': ['--extra-flags', '--noenable-sse3 --noenable-ssse3 --noenable-sse4-1 --noenable-avx'] + 'test_args': ['--extra-flags', '--noenable-sse3 --noenable-ssse3 --noenable-sse4-1 --noenable-avx'], + 'shards': 2 }, { 'name': 'v8testing', @@ -1125,7 +1179,8 @@ 'name': 'test262', 'suffix': 'nossse3', 'variant': 'default', - 'test_args': ['--extra-flags', '--noenable-ssse3 --noenable-sse4-1 --noenable-avx'] + 'test_args': ['--extra-flags', '--noenable-ssse3 --noenable-sse4-1 --noenable-avx'], + 'shards': 2 }, { 'name': 'v8testing', @@ -1143,7 +1198,8 @@ 'name': 'test262', 'suffix': 'nosse4', 'variant': 'default', - 'test_args': ['--extra-flags', '--noenable-sse4-1 --noenable-avx'] + 'test_args': ['--extra-flags', '--noenable-sse4-1 --noenable-avx'], + 'shards': 2 }, { 'name': 'v8testing', @@ -1161,7 +1217,8 @@ 'name': 'test262', 'suffix': 'noavx', 'variant': 'default', - 'test_args': ['--extra-flags', '--noenable-avx'] + 'test_args': ['--extra-flags', '--noenable-avx'], + 'shards': 2 }, { 'name': 'v8testing', @@ -1203,7 +1260,7 @@ }, 'tests': [ {'name': 'mozilla', 'variant': 'default'}, - {'name': 'test262', 'variant': 'default'}, + {'name': 'test262', 'variant': 'default', 'shards': 2}, {'name': 'v8testing', 'variant': 'default'}, ], }, @@ -1224,7 +1281,7 @@ }, 'tests': [ {'name': 'mozilla'}, - {'name': 'test262', 'variant': 'default'}, + {'name': 'test262', 'variant': 'default', 'shards': 2}, {'name': 'v8testing'}, ], }, @@ -1236,6 +1293,14 @@ {'name': 'v8testing'}, ], }, + 'V8 Linux PGO instrumentation - builder' : { + 'swarming_dimensions': { + 'os': 'Ubuntu-18.04', + }, + 'tests': [ + {'name': 'pgo_instrumentation'} + ], + }, 'V8 Linux64': { 'swarming_dimensions': { 'cpu': 'x86-64-avx2', @@ -1253,7 +1318,7 @@ {'name': 'optimize_for_size'}, {'name': 'perf_integration'}, {'name': 'test262', 'shards': 2}, - {'name': 'test262', 'variant': 'assert_types'}, + {'name': 'test262', 'variant': 'assert_types', 'shards': 2}, {'name': 'test262', 'variant': 'extra', 'shards': 2}, {'name': 'v8initializers'}, {'name': 'v8testing'}, @@ -1264,6 +1329,7 @@ {'name': 'v8testing', 'variant': 'stress_instruction_scheduling'}, # Maglev -- move to extra once more architectures are supported. {'name': 'mjsunit', 'variant': 'maglev'}, + {'name': 'mjsunit', 'variant': 'stress_maglev'}, # Noavx. { 'name': 'mozilla', @@ -1274,13 +1340,28 @@ 'name': 'test262', 'suffix': 'noavx', 'variant': 'default', - 'test_args': ['--extra-flags', '--noenable-avx'] + 'test_args': ['--extra-flags', '--noenable-avx'], + 'shards': 2 }, { 'name': 'v8testing', 'suffix': 'noavx', 'test_args': ['--extra-flags', '--noenable-avx'] }, + # GCMole. + {'name': 'gcmole_v3', 'variant': 'x64', 'shards': 4}, + { + 'name': 'gcmole_v2', + 'variant': 'x64', + 'suffix': 'test single host', + 'test_args': ['--test-run'], + }, + { + 'name': 'gcmole_v3', + 'variant': 'x64', + 'suffix': 'test multi host', + 'test_args': ['--test-run'], + }, ], }, 'V8 Linux64 - cfi': { @@ -1291,10 +1372,28 @@ {'name': 'benchmarks'}, {'name': 'mozilla'}, {'name': 'optimize_for_size'}, - {'name': 'test262', 'variant': 'default'}, + {'name': 'test262', 'variant': 'default', 'shards': 2}, {'name': 'v8testing', 'shards': 2}, ], }, + 'V8 Linux64 - coverage': { + 'swarming_dimensions' : { + 'os': 'Ubuntu-18.04', + }, + 'tests': [ + {'name': 'v8testing', 'variant': 'default'}, + {'name': 'v8testing', 'variant': 'future'}, + ], + }, + 'V8 Linux64 - coverage - debug': { + 'swarming_dimensions' : { + 'os': 'Ubuntu-18.04', + }, + 'tests': [ + {'name': 'v8testing', 'variant': 'default'}, + {'name': 'v8testing', 'variant': 'future'}, + ], + }, 'V8 Linux64 - custom snapshot - debug': { 'swarming_dimensions' : { 'os': 'Ubuntu-18.04', @@ -1318,15 +1417,16 @@ {'name': 'test262', 'shards': 7}, {'name': 'test262', 'variant': 'extra', 'shards': 5}, {'name': 'v8testing', 'shards': 2}, - {'name': 'v8testing', 'variant': 'extra', 'shards': 2}, + {'name': 'v8testing', 'variant': 'extra', 'shards': 4}, {'name': 'v8testing', 'variant': 'minor_mc'}, {'name': 'v8testing', 'variant': 'no_lfa'}, {'name': 'v8testing', 'variant': 'slow_path'}, {'name': 'v8testing', 'variant': 'stress_instruction_scheduling'}, {'name': 'v8testing', 'variant': 'stress_concurrent_allocation'}, - {'name': 'v8testing', 'variant': 'stress_concurrent_inlining'}, + {'name': 'v8testing', 'variant': 'stress_concurrent_inlining', 'shards': 2}, # Maglev -- move to extra once more architectures are supported. {'name': 'mjsunit', 'variant': 'maglev'}, + {'name': 'mjsunit', 'variant': 'stress_maglev'}, # Noavx. { 'name': 'mozilla', @@ -1337,7 +1437,8 @@ 'name': 'test262', 'suffix': 'noavx', 'variant': 'default', - 'test_args': ['--extra-flags', '--noenable-avx'] + 'test_args': ['--extra-flags', '--noenable-avx'], + 'shards': 2 }, { 'name': 'v8testing', @@ -1380,14 +1481,10 @@ {'name': 'webkit', 'variant': 'stress_sampling'}, # Stress snapshot. {'name': 'mjsunit', 'variant': 'stress_snapshot'}, - # Maglev. - {'name': 'mjsunit', 'variant': 'maglev'}, - # Stress maglev. - {'name': 'mjsunit', 'variant': 'stress_maglev'}, + # Stress maglev-future. + {'name': 'mjsunit', 'variant': 'maglev_future'}, # Experimental regexp engine. {'name': 'mjsunit', 'variant': 'experimental_regexp'}, - # Wasm write protect code space. - {'name': 'mjsunit', 'variant': 'wasm_write_protect_code'}, ], }, 'V8 Linux64 - cppgc-non-default - debug': { @@ -1446,14 +1543,10 @@ {'name': 'webkit', 'variant': 'stress_sampling'}, # Stress snapshot. {'name': 'mjsunit', 'variant': 'stress_snapshot'}, - # Maglev. - {'name': 'mjsunit', 'variant': 'maglev'}, - # Stress maglev. - {'name': 'mjsunit', 'variant': 'stress_maglev'}, + # Stress maglev-future. + {'name': 'mjsunit', 'variant': 'maglev_future'}, # Experimental regexp engine. {'name': 'mjsunit', 'variant': 'experimental_regexp'}, - # Wasm write protect code space. - {'name': 'mjsunit', 'variant': 'wasm_write_protect_code'}, ], }, 'V8 Linux64 gcc': { @@ -1489,22 +1582,6 @@ }, ], }, - 'V8 Linux64 - gcov coverage': { - 'swarming_dimensions' : { - 'os': 'Ubuntu-18.04', - }, - 'tests': [ - {'name': 'v8testing'}, - ], - }, - 'V8 Linux64 - heap sandbox - debug': { - 'swarming_dimensions' : { - 'os': 'Ubuntu-18.04', - }, - 'tests': [ - {'name': 'v8testing', 'shards': 2}, - ], - }, 'V8 Linux64 - internal snapshot': { 'swarming_dimensions' : { 'os': 'Ubuntu-18.04', @@ -1545,7 +1622,7 @@ }, 'tests': [ {'name': 'mozilla'}, - {'name': 'test262', 'variant': 'default'}, + {'name': 'test262', 'variant': 'default', 'shards': 2}, {'name': 'v8testing'}, ], }, @@ -1568,6 +1645,14 @@ {'name': 'v8testing', 'variant': 'slow_path', 'shards': 1}, ], }, + 'V8 Linux64 css - debug': { + 'swarming_dimensions' : { + 'os': 'Ubuntu-18.04', + }, + 'tests': [ + {'name': 'v8testing', 'shards': 5}, + ], + }, 'V8 Linux64 GC Stress - custom snapshot': { 'swarming_dimensions' : { 'os': 'Ubuntu-18.04', @@ -1580,6 +1665,14 @@ }, ], }, + 'V8 Linux64 PGO instrumentation - builder' : { + 'swarming_dimensions' : { + 'os': 'Ubuntu-18.04', + }, + 'tests': [ + {'name': 'pgo_instrumentation'} + ], + }, 'V8 Linux64 TSAN': { 'swarming_dimensions' : { 'os': 'Ubuntu-18.04', @@ -1594,6 +1687,18 @@ {'name': 'v8testing', 'variant': 'stress_concurrent_allocation', 'shards': 2}, ], }, + 'V8 Linux64 TSAN - debug': { + 'swarming_dimensions' : { + 'os': 'Ubuntu-18.04', + }, + 'tests': [ + {'name': 'benchmarks', 'shards': 2}, + {'name': 'mozilla', 'shards': 4}, + {'name': 'test262', 'variant': 'default', 'shards': 5}, + {'name': 'v8testing', 'shards': 12}, + {'name': 'v8testing', 'variant': 'extra', 'shards': 10}, + ], + }, 'V8 Linux64 TSAN - stress-incremental-marking': { 'swarming_dimensions' : { 'os': 'Ubuntu-18.04', @@ -1667,7 +1772,7 @@ 'V8 Mac64': { 'swarming_dimensions': { 'cpu': 'x86-64', - 'os': 'Mac-10.15', + 'os': 'Mac-12', }, 'tests': [ {'name': 'mozilla'}, @@ -1679,7 +1784,7 @@ 'V8 Mac64 - debug': { 'swarming_dimensions': { 'cpu': 'x86-64', - 'os': 'Mac-10.15', + 'os': 'Mac-12', }, 'tests': [ {'name': 'mozilla'}, @@ -1691,7 +1796,7 @@ 'V8 Mac64 ASAN': { 'swarming_dimensions': { 'cpu': 'x86-64', - 'os': 'Mac-10.15', + 'os': 'Mac-12', }, 'tests': [ {'name': 'v8testing', 'shards': 10}, @@ -1700,7 +1805,7 @@ 'V8 Mac64 GC Stress': { 'swarming_dimensions': { 'cpu': 'x86-64', - 'os': 'Mac-10.15', + 'os': 'Mac-12', }, 'tests': [ {'name': 'd8testing', 'test_args': ['--gc-stress'], 'shards': 6}, @@ -1720,6 +1825,9 @@ 'tests': [ {'name': 'v8testing'}, {'name': 'v8testing', 'variant': 'extra'}, + # Maglev -- move to extra once more architectures are supported. + {'name': 'mjsunit', 'variant': 'maglev'}, + {'name': 'mjsunit', 'variant': 'stress_maglev'}, ], }, 'V8 Mac - arm64 - debug': { @@ -1736,6 +1844,9 @@ 'tests': [ {'name': 'v8testing', 'shards': 2}, {'name': 'v8testing', 'variant': 'extra', 'shards': 2}, + # Maglev -- move to extra once more architectures are supported. + {'name': 'mjsunit', 'variant': 'maglev'}, + {'name': 'mjsunit', 'variant': 'stress_maglev'}, ], }, 'V8 Mac - arm64 - no pointer compression debug': { @@ -1751,7 +1862,7 @@ 'V8 Mac - arm64 - sim - debug': { 'swarming_dimensions' : { 'cpu': 'x86-64', - 'os': 'Mac-10.15', + 'os': 'Mac-12', }, 'swarming_task_attrs': { 'expiration': 14400, @@ -1766,7 +1877,7 @@ 'V8 Mac - arm64 - sim - release': { 'swarming_dimensions' : { 'cpu': 'x86-64', - 'os': 'Mac-10.15', + 'os': 'Mac-12', }, 'swarming_task_attrs': { 'expiration': 14400, @@ -1781,39 +1892,39 @@ 'V8 Win32': { 'swarming_dimensions': { 'cpu': 'x86-64', - 'os': 'Windows-7-SP1', + 'os': 'Windows-10-19045', }, 'tests': [ {'name': 'mozilla'}, - {'name': 'test262', 'variant': 'default'}, + {'name': 'test262', 'variant': 'default', 'shards': 2}, {'name': 'v8testing'}, ], }, 'V8 Win32 - debug': { 'swarming_dimensions': { 'cpu': 'x86-64', - 'os': 'Windows-7-SP1', + 'os': 'Windows-10-19045', }, 'tests': [ {'name': 'mozilla'}, - {'name': 'test262', 'variant': 'default'}, + {'name': 'test262', 'variant': 'default', 'shards': 2}, {'name': 'v8testing', 'shards': 5}, ], }, 'V8 Win64': { 'swarming_dimensions': { - 'os': 'Windows-10-19042', + 'os': 'Windows-10-19045', }, 'tests': [ {'name': 'mozilla'}, - {'name': 'test262', 'variant': 'default'}, + {'name': 'test262', 'variant': 'default', 'shards': 2}, {'name': 'v8testing', 'shards': 2}, {'name': 'v8testing', 'variant': 'extra', 'shards': 2}, ], }, 'V8 Win64 - debug': { 'swarming_dimensions': { - 'os': 'Windows-10-19042', + 'os': 'Windows-10-19045', }, 'tests': [ {'name': 'mozilla'}, @@ -1824,17 +1935,17 @@ }, 'V8 Win64 - msvc': { 'swarming_dimensions': { - 'os': 'Windows-10-19042', + 'os': 'Windows-10-19045', }, 'tests': [ {'name': 'mozilla'}, - {'name': 'test262', 'variant': 'default'}, + {'name': 'test262', 'variant': 'default', 'shards': 2}, {'name': 'v8testing', 'shards': 2}, ], }, 'V8 Win64 ASAN': { 'swarming_dimensions': { - 'os': 'Windows-10-19042', + 'os': 'Windows-10-19045', }, 'tests': [ {'name': 'v8testing', 'shards': 5}, @@ -1951,7 +2062,8 @@ 'name': 'test262', 'suffix': 'armv8-a', 'variant': 'default', - 'test_args': ['--extra-flags', '--enable-armv8'] + 'test_args': ['--extra-flags', '--enable-armv8'], + 'shards': 2 }, { 'name': 'v8testing', @@ -1970,6 +2082,7 @@ 'suffix': 'novfp3', 'variant': 'default', 'test_args': ['--novfp3'], + 'shards': 2 }, { 'name': 'v8testing', @@ -1977,6 +2090,8 @@ 'test_args': ['--novfp3'], 'shards': 6 }, + # GCMole. + {'name': 'gcmole_v3', 'variant': 'arm', 'shards': 4}, ], }, 'V8 Linux - arm - sim - debug': { @@ -2055,9 +2170,10 @@ 'tests': [ {'name': 'mjsunit_sp_frame_access'}, {'name': 'mozilla'}, - {'name': 'test262', 'variant': 'default'}, + {'name': 'test262', 'variant': 'default', 'shards': 2}, {'name': 'v8testing', 'shards': 3}, {'name': 'v8testing', 'variant': 'extra', 'shards': 2}, + {'name': 'gcmole_v3', 'variant': 'arm64', 'shards': 4}, ], }, 'V8 Linux - arm64 - sim - debug': { @@ -2093,19 +2209,6 @@ }, ], }, - 'V8 Linux64 - arm64 - sim - heap sandbox - debug': { - 'swarming_dimensions' : { - 'os': 'Ubuntu-18.04', - }, - 'swarming_task_attrs': { - 'expiration': 14400, - 'hard_timeout': 7200, - 'priority': 35, - }, - 'tests': [ - {'name': 'v8testing', 'shards': 14}, - ], - }, 'V8 Linux - loong64 - sim': { 'swarming_dimensions': { 'os': 'Ubuntu-18.04', @@ -2129,7 +2232,7 @@ 'priority': 35, }, 'tests': [ - {'name': 'test262', 'variant': 'default'}, + {'name': 'test262', 'variant': 'default', 'shards': 2}, {'name': 'v8testing', 'shards': 4}, ], }, diff --git a/deps/v8/src/DEPS b/deps/v8/src/DEPS index 8912d7fb25186c..ebe2dd0dc5442c 100644 --- a/deps/v8/src/DEPS +++ b/deps/v8/src/DEPS @@ -10,19 +10,20 @@ include_rules = [ "-src/bigint", "+src/bigint/bigint.h", "-src/compiler", - "+src/compiler/pipeline.h", "+src/compiler/code-assembler.h", + "+src/compiler/turbofan.h", "+src/compiler/wasm-compiler-definitions.h", "+src/compiler/wasm-compiler.h", "-src/heap", "+src/heap/basic-memory-chunk.h", "+src/heap/code-range.h", "+src/heap/combined-heap.h", - "+src/heap/embedder-tracing.h", "+src/heap/factory.h", "+src/heap/factory-inl.h", # TODO(v8:10496): Don't expose so much (through transitive includes) outside # of heap/. + "+src/heap/gc-tracer.h", + "+src/heap/gc-tracer-inl.h", "+src/heap/heap.h", "+src/heap/heap-verifier.h", "+src/heap/heap-inl.h", @@ -76,6 +77,7 @@ include_rules = [ "+starboard", # Using cppgc inside v8 is not (yet) allowed. "-include/cppgc", + "+include/cppgc/common.h", "+include/cppgc/platform.h", "+include/cppgc/source-location.h", ] @@ -84,7 +86,8 @@ specific_include_rules = { "d8\.cc": [ "+include/libplatform/libplatform.h", "+include/libplatform/v8-tracing.h", - "+perfetto/tracing.h" + "+perfetto/tracing/track_event.h", + "+perfetto/tracing/track_event_legacy.h" ], "d8-platforms\.cc": [ "+include/libplatform/libplatform.h", diff --git a/deps/v8/src/api/api-arguments-inl.h b/deps/v8/src/api/api-arguments-inl.h index 470ab95e181e84..31daa9a39cae89 100644 --- a/deps/v8/src/api/api-arguments-inl.h +++ b/deps/v8/src/api/api-arguments-inl.h @@ -11,51 +11,51 @@ #include "src/execution/vm-state-inl.h" #include "src/logging/runtime-call-stats-scope.h" #include "src/objects/api-callbacks.h" +#include "src/objects/instance-type.h" #include "src/objects/slots-inl.h" +#include "v8-isolate.h" namespace v8 { namespace internal { -void Object::VerifyApiCallResultType() { #if DEBUG - if (IsSmi()) return; +bool Object::IsApiCallResultType() const { + if (IsSmi()) return true; DCHECK(IsHeapObject()); - if (!(IsString() || IsSymbol() || IsJSReceiver() || IsHeapNumber() || - IsBigInt() || IsUndefined() || IsTrue() || IsFalse() || IsNull())) { - FATAL("API call returned invalid object"); - } -#endif // DEBUG + return (IsString() || IsSymbol() || IsJSReceiver() || IsHeapNumber() || + IsBigInt() || IsUndefined() || IsTrue() || IsFalse() || IsNull()); } +#endif // DEBUG CustomArgumentsBase::CustomArgumentsBase(Isolate* isolate) : Relocatable(isolate) {} template CustomArguments::~CustomArguments() { - slot_at(kReturnValueOffset).store(Object(kHandleZapValue)); + slot_at(kReturnValueIndex).store(Object(kHandleZapValue)); } template template -Handle CustomArguments::GetReturnValue(Isolate* isolate) { +Handle CustomArguments::GetReturnValue(Isolate* isolate) const { // Check the ReturnValue. - FullObjectSlot slot = slot_at(kReturnValueOffset); + FullObjectSlot slot = slot_at(kReturnValueIndex); // Nothing was set, return empty handle as per previous behaviour. - if ((*slot).IsTheHole(isolate)) return Handle(); - Handle result = Handle::cast(Handle(slot.location())); - result->VerifyApiCallResultType(); - return result; + Object raw_object = *slot; + if (raw_object.IsTheHole(isolate)) return Handle(); + DCHECK(raw_object.IsApiCallResultType()); + return Handle::cast(Handle(slot.location())); } -inline JSObject PropertyCallbackArguments::holder() { +inline JSObject PropertyCallbackArguments::holder() const { return JSObject::cast(*slot_at(T::kHolderIndex)); } -inline Object PropertyCallbackArguments::receiver() { +inline Object PropertyCallbackArguments::receiver() const { return *slot_at(T::kThisIndex); } -inline JSReceiver FunctionCallbackArguments::holder() { +inline JSReceiver FunctionCallbackArguments::holder() const { return JSReceiver::cast(*slot_at(T::kHolderIndex)); } diff --git a/deps/v8/src/api/api-arguments.h b/deps/v8/src/api/api-arguments.h index 39958964fd4233..9caf5decb0b0ae 100644 --- a/deps/v8/src/api/api-arguments.h +++ b/deps/v8/src/api/api-arguments.h @@ -6,6 +6,7 @@ #define V8_API_API_ARGUMENTS_H_ #include "include/v8-template.h" +#include "src/builtins/builtins-utils.h" #include "src/execution/isolate.h" #include "src/objects/slots.h" #include "src/objects/visitors.h" @@ -24,7 +25,8 @@ class CustomArgumentsBase : public Relocatable { template class CustomArguments : public CustomArgumentsBase { public: - static const int kReturnValueOffset = T::kReturnValueIndex; + static constexpr int kReturnValueIndex = T::kReturnValueIndex; + static_assert(T::kSize == sizeof(T)); ~CustomArguments() override; @@ -38,19 +40,20 @@ class CustomArguments : public CustomArgumentsBase { : CustomArgumentsBase(isolate) {} template - Handle GetReturnValue(Isolate* isolate); + Handle GetReturnValue(Isolate* isolate) const; - inline Isolate* isolate() { + inline Isolate* isolate() const { return reinterpret_cast((*slot_at(T::kIsolateIndex)).ptr()); } - inline FullObjectSlot slot_at(int index) { + inline FullObjectSlot slot_at(int index) const { // This allows index == T::kArgsLength so "one past the end" slots // can be retrieved for iterating purposes. DCHECK_LE(static_cast(index), static_cast(T::kArgsLength)); return FullObjectSlot(values_ + index); } + Address values_[T::kArgsLength]; }; @@ -69,14 +72,14 @@ class PropertyCallbackArguments final public: using T = PropertyCallbackInfo; using Super = CustomArguments; - static const int kArgsLength = T::kArgsLength; - static const int kThisIndex = T::kThisIndex; - static const int kHolderIndex = T::kHolderIndex; - static const int kDataIndex = T::kDataIndex; - static const int kReturnValueDefaultValueIndex = + static constexpr int kArgsLength = T::kArgsLength; + static constexpr int kThisIndex = T::kThisIndex; + static constexpr int kHolderIndex = T::kHolderIndex; + static constexpr int kDataIndex = T::kDataIndex; + static constexpr int kReturnValueDefaultValueIndex = T::kReturnValueDefaultValueIndex; - static const int kIsolateIndex = T::kIsolateIndex; - static const int kShouldThrowOnErrorIndex = T::kShouldThrowOnErrorIndex; + static constexpr int kIsolateIndex = T::kIsolateIndex; + static constexpr int kShouldThrowOnErrorIndex = T::kShouldThrowOnErrorIndex; PropertyCallbackArguments(Isolate* isolate, Object data, Object self, JSObject holder, Maybe should_throw); @@ -161,13 +164,13 @@ class PropertyCallbackArguments final GenericNamedPropertyGetterCallback f, Handle name, Handle info, Handle receiver = Handle()); - inline JSObject holder(); - inline Object receiver(); + inline JSObject holder() const; + inline Object receiver() const; #ifdef DEBUG // This stores current value of Isolate::javascript_execution_counter(). // It's used for detecting whether JavaScript code was executed between - // PropertyCallbackArguments's constructior and destructor. + // PropertyCallbackArguments's constructor and destructor. uint32_t javascript_execution_counter_; #endif // DEBUG }; @@ -177,13 +180,21 @@ class FunctionCallbackArguments public: using T = FunctionCallbackInfo; using Super = CustomArguments; - static const int kArgsLength = T::kArgsLength; - static const int kHolderIndex = T::kHolderIndex; - static const int kDataIndex = T::kDataIndex; - static const int kReturnValueDefaultValueIndex = + static constexpr int kArgsLength = T::kArgsLength; + static constexpr int kArgsLengthWithReceiver = T::kArgsLengthWithReceiver; + + static constexpr int kHolderIndex = T::kHolderIndex; + static constexpr int kDataIndex = T::kDataIndex; + static constexpr int kReturnValueDefaultValueIndex = T::kReturnValueDefaultValueIndex; - static const int kIsolateIndex = T::kIsolateIndex; - static const int kNewTargetIndex = T::kNewTargetIndex; + static constexpr int kIsolateIndex = T::kIsolateIndex; + static constexpr int kNewTargetIndex = T::kNewTargetIndex; + + static_assert(T::kThisValuesIndex == BuiltinArguments::kReceiverArgsOffset); + // Make sure all FunctionCallbackInfo constants are in sync. + static_assert(T::kImplicitArgsOffset == offsetof(T, implicit_args_)); + static_assert(T::kValuesOffset == offsetof(T, values_)); + static_assert(T::kLengthOffset == offsetof(T, length_)); FunctionCallbackArguments(Isolate* isolate, Object data, Object holder, HeapObject new_target, Address* argv, int argc); @@ -199,12 +210,17 @@ class FunctionCallbackArguments inline Handle Call(CallHandlerInfo handler); private: - inline JSReceiver holder(); + inline JSReceiver holder() const; internal::Address* argv_; - int argc_; + int const argc_; }; +static_assert(BuiltinArguments::kNumExtraArgs == + BuiltinExitFrameConstants::kNumExtraArgsWithoutReceiver); +static_assert(BuiltinArguments::kNumExtraArgsWithReceiver == + BuiltinExitFrameConstants::kNumExtraArgsWithReceiver); + } // namespace internal } // namespace v8 diff --git a/deps/v8/src/api/api-inl.h b/deps/v8/src/api/api-inl.h index ac675a87fc82ba..73be24cbe0718e 100644 --- a/deps/v8/src/api/api-inl.h +++ b/deps/v8/src/api/api-inl.h @@ -7,8 +7,10 @@ #include "include/v8-fast-api-calls.h" #include "src/api/api.h" +#include "src/common/assert-scope.h" #include "src/execution/interrupts-scope.h" #include "src/execution/microtask-queue.h" +#include "src/flags/flags.h" #include "src/handles/handles-inl.h" #include "src/heap/heap-inl.h" #include "src/objects/foreign-inl.h" @@ -51,7 +53,10 @@ inline v8::internal::Handle FromCData( template inline Local Utils::Convert(v8::internal::Handle obj) { DCHECK(obj.is_null() || (obj->IsSmi() || !obj->IsTheHole())); - return Local(reinterpret_cast(obj.location())); +#ifdef V8_ENABLE_CONSERVATIVE_STACK_SCANNING + if (obj.is_null()) return Local(); +#endif + return Local(internal::ValueHelper::SlotAsValue(obj.location())); } // Implementations of ToLocal @@ -61,6 +66,8 @@ inline Local Utils::Convert(v8::internal::Handle obj) { return Convert(obj); \ } +TO_LOCAL_LIST(MAKE_TO_LOCAL) + #define MAKE_TO_LOCAL_TYPED_ARRAY(Type, typeName, TYPE, ctype) \ Local Utils::ToLocal##Type##Array( \ v8::internal::Handle obj) { \ @@ -68,65 +75,51 @@ inline Local Utils::Convert(v8::internal::Handle obj) { return Convert(obj); \ } -MAKE_TO_LOCAL(ToLocal, AccessorPair, debug::AccessorPair) -MAKE_TO_LOCAL(ToLocal, Context, Context) -MAKE_TO_LOCAL(ToLocal, Object, Value) -MAKE_TO_LOCAL(ToLocal, Module, Module) -MAKE_TO_LOCAL(ToLocal, Name, Name) -MAKE_TO_LOCAL(ToLocal, String, String) -MAKE_TO_LOCAL(ToLocal, Symbol, Symbol) -MAKE_TO_LOCAL(ToLocal, JSRegExp, RegExp) -MAKE_TO_LOCAL(ToLocal, JSReceiver, Object) -MAKE_TO_LOCAL(ToLocal, JSObject, Object) -MAKE_TO_LOCAL(ToLocal, JSFunction, Function) -MAKE_TO_LOCAL(ToLocal, JSArray, Array) -MAKE_TO_LOCAL(ToLocal, JSMap, Map) -MAKE_TO_LOCAL(ToLocal, JSSet, Set) -MAKE_TO_LOCAL(ToLocal, JSProxy, Proxy) -MAKE_TO_LOCAL(ToLocal, JSArrayBuffer, ArrayBuffer) -MAKE_TO_LOCAL(ToLocal, JSArrayBufferView, ArrayBufferView) -MAKE_TO_LOCAL(ToLocal, JSDataView, DataView) -MAKE_TO_LOCAL(ToLocal, JSTypedArray, TypedArray) -MAKE_TO_LOCAL(ToLocalShared, JSArrayBuffer, SharedArrayBuffer) - TYPED_ARRAYS(MAKE_TO_LOCAL_TYPED_ARRAY) -MAKE_TO_LOCAL(ToLocal, FunctionTemplateInfo, FunctionTemplate) -MAKE_TO_LOCAL(ToLocal, ObjectTemplateInfo, ObjectTemplate) -MAKE_TO_LOCAL(SignatureToLocal, FunctionTemplateInfo, Signature) -MAKE_TO_LOCAL(MessageToLocal, Object, Message) -MAKE_TO_LOCAL(PromiseToLocal, JSObject, Promise) -MAKE_TO_LOCAL(StackTraceToLocal, FixedArray, StackTrace) -MAKE_TO_LOCAL(StackFrameToLocal, StackFrameInfo, StackFrame) -MAKE_TO_LOCAL(NumberToLocal, Object, Number) -MAKE_TO_LOCAL(IntegerToLocal, Object, Integer) -MAKE_TO_LOCAL(Uint32ToLocal, Object, Uint32) -MAKE_TO_LOCAL(ToLocal, BigInt, BigInt) -MAKE_TO_LOCAL(ExternalToLocal, JSObject, External) -MAKE_TO_LOCAL(CallableToLocal, JSReceiver, Function) -MAKE_TO_LOCAL(ToLocalPrimitive, Object, Primitive) -MAKE_TO_LOCAL(FixedArrayToLocal, FixedArray, FixedArray) -MAKE_TO_LOCAL(PrimitiveArrayToLocal, FixedArray, PrimitiveArray) -MAKE_TO_LOCAL(ToLocal, ScriptOrModule, ScriptOrModule) - #undef MAKE_TO_LOCAL_TYPED_ARRAY #undef MAKE_TO_LOCAL +#undef TO_LOCAL_LIST // Implementations of OpenHandle -#define MAKE_OPEN_HANDLE(From, To) \ - v8::internal::Handle Utils::OpenHandle( \ - const v8::From* that, bool allow_empty_handle) { \ - DCHECK(allow_empty_handle || that != nullptr); \ - DCHECK(that == nullptr || \ - v8::internal::Object( \ - *reinterpret_cast(that)) \ - .Is##To()); \ - return v8::internal::Handle( \ - reinterpret_cast( \ - const_cast(that))); \ +#ifdef V8_ENABLE_CONSERVATIVE_STACK_SCANNING + +#define MAKE_OPEN_HANDLE(From, To) \ + v8::internal::Handle Utils::OpenHandle( \ + const v8::From* that, bool allow_empty_handle) { \ + DCHECK(allow_empty_handle || \ + that != v8::internal::ValueHelper::EmptyValue()); \ + DCHECK( \ + that == v8::internal::ValueHelper::EmptyValue() || \ + v8::internal::Object(v8::internal::ValueHelper::ValueAsAddress(that)) \ + .Is##To()); \ + if (that == v8::internal::ValueHelper::EmptyValue()) { \ + return v8::internal::Handle::null(); \ + } \ + return v8::internal::Handle( \ + v8::HandleScope::CreateHandleForCurrentIsolate( \ + reinterpret_cast(that))); \ } +#else + +#define MAKE_OPEN_HANDLE(From, To) \ + v8::internal::Handle Utils::OpenHandle( \ + const v8::From* that, bool allow_empty_handle) { \ + DCHECK(allow_empty_handle || \ + that != v8::internal::ValueHelper::EmptyValue()); \ + DCHECK( \ + that == v8::internal::ValueHelper::EmptyValue() || \ + v8::internal::Object(v8::internal::ValueHelper::ValueAsAddress(that)) \ + .Is##To()); \ + return v8::internal::Handle( \ + reinterpret_cast( \ + const_cast(that))); \ + } + +#endif + OPEN_HANDLE_LIST(MAKE_OPEN_HANDLE) #undef MAKE_OPEN_HANDLE @@ -150,12 +143,13 @@ class V8_NODISCARD CallDepthScope { isolate_->thread_local_top()->IncrementCallDepth(this); isolate_->set_next_v8_call_is_safe_for_termination(false); if (!context.IsEmpty()) { - i::Handle env = Utils::OpenHandle(*context); + i::DisallowGarbageCollection no_gc; + i::Context env = *Utils::OpenHandle(*context); i::HandleScopeImplementer* impl = isolate->handle_scope_implementer(); if (isolate->context().is_null() || - isolate->context().native_context() != env->native_context()) { + isolate->context().native_context() != env.native_context()) { impl->SaveContext(isolate->context()); - isolate->set_context(*env); + isolate->set_context(env); did_enter_context_ = true; } } @@ -207,7 +201,8 @@ class V8_NODISCARD CallDepthScope { bool did_perform_microtask_checkpoint = isolate_->thread_local_top()->CallDepthIsZero() && do_callback && microtask_queue && - microtask_queue->microtasks_policy() == MicrotasksPolicy::kAuto; + microtask_queue->microtasks_policy() == MicrotasksPolicy::kAuto && + !isolate_->is_execution_terminating(); return !did_perform_microtask_checkpoint || isolate_->heap()->weak_refs_keep_during_job().IsUndefined(isolate_); } diff --git a/deps/v8/src/api/api-macros.h b/deps/v8/src/api/api-macros.h index 149dd0555a69be..bcad7df2881231 100644 --- a/deps/v8/src/api/api-macros.h +++ b/deps/v8/src/api/api-macros.h @@ -41,7 +41,8 @@ #define ENTER_V8_BASIC(i_isolate) \ /* Embedders should never enter V8 after terminating it */ \ - DCHECK(!i_isolate->is_execution_terminating()); \ + DCHECK_IMPLIES(i::v8_flags.strict_termination_checks, \ + !i_isolate->is_execution_terminating()); \ i::VMState __state__((i_isolate)) #define ENTER_V8_HELPER_INTERNAL(i_isolate, context, class_name, \ @@ -91,29 +92,19 @@ bailout_value, HandleScopeClass, false); \ i::DisallowJavascriptExecutionDebugOnly __no_script__((i_isolate)) -#define DCHECK_NO_SCRIPT_NO_EXCEPTION_MAYBE_TEARDOWN(i_isolate) \ +// Lightweight version for APIs that don't require an active context. +#define DCHECK_NO_SCRIPT_NO_EXCEPTION(i_isolate) \ i::DisallowJavascriptExecutionDebugOnly __no_script__((i_isolate)); \ i::DisallowExceptions __no_exceptions__((i_isolate)) -// Lightweight version for APIs that don't require an active context. -#define DCHECK_NO_SCRIPT_NO_EXCEPTION(i_isolate) \ - /* Embedders should never enter V8 after terminating it */ \ - DCHECK(!i_isolate->is_execution_terminating()); \ - DCHECK_NO_SCRIPT_NO_EXCEPTION_MAYBE_TEARDOWN(i_isolate) - #define ENTER_V8_NO_SCRIPT_NO_EXCEPTION(i_isolate) \ i::VMState __state__((i_isolate)); \ DCHECK_NO_SCRIPT_NO_EXCEPTION(i_isolate) -// Used instead of ENTER_V8_NO_SCRIPT_NO_EXCEPTION where the V8 Api is entered -// during termination sequences. -#define ENTER_V8_MAYBE_TEARDOWN(i_isolate) \ - i::VMState __state__((i_isolate)); \ - DCHECK_NO_SCRIPT_NO_EXCEPTION_MAYBE_TEARDOWN(i_isolate) - -#define ENTER_V8_FOR_NEW_CONTEXT(i_isolate) \ - DCHECK(!(i_isolate)->is_execution_terminating()); \ - i::VMState __state__((i_isolate)); \ +#define ENTER_V8_FOR_NEW_CONTEXT(i_isolate) \ + DCHECK_IMPLIES(i::v8_flags.strict_termination_checks, \ + !(i_isolate)->is_execution_terminating()); \ + i::VMState __state__((i_isolate)); \ i::DisallowExceptions __no_exceptions__((i_isolate)) #else // DEBUG #define ENTER_V8_NO_SCRIPT(i_isolate, context, class_name, function_name, \ @@ -122,14 +113,10 @@ bailout_value, HandleScopeClass, false) #define DCHECK_NO_SCRIPT_NO_EXCEPTION(i_isolate) -#define DCHECK_NO_SCRIPT_NO_EXCEPTION_MAYBE_TEARDOWN(i_isolate) #define ENTER_V8_NO_SCRIPT_NO_EXCEPTION(i_isolate) \ i::VMState __state__((i_isolate)); -#define ENTER_V8_MAYBE_TEARDOWN(i_isolate) \ - i::VMState __state__((i_isolate)); - #define ENTER_V8_FOR_NEW_CONTEXT(i_isolate) \ i::VMState __state__((i_isolate)); #endif // DEBUG diff --git a/deps/v8/src/api/api-natives.cc b/deps/v8/src/api/api-natives.cc index d0b298723423e9..05a883f2d560e3 100644 --- a/deps/v8/src/api/api-natives.cc +++ b/deps/v8/src/api/api-natives.cc @@ -83,7 +83,7 @@ MaybeHandle DefineAccessorProperty(Isolate* isolate, InstantiateFunction(isolate, Handle::cast(getter)), Object); - Handle trampoline = BUILTIN_CODE(isolate, DebugBreakTrampoline); + Handle trampoline = BUILTIN_CODE(isolate, DebugBreakTrampoline); Handle::cast(getter)->set_code(*trampoline); } if (setter->IsFunctionTemplateInfo() && @@ -93,7 +93,7 @@ MaybeHandle DefineAccessorProperty(Isolate* isolate, InstantiateFunction(isolate, Handle::cast(setter)), Object); - Handle trampoline = BUILTIN_CODE(isolate, DebugBreakTrampoline); + Handle trampoline = BUILTIN_CODE(isolate, DebugBreakTrampoline); Handle::cast(setter)->set_code(*trampoline); } RETURN_ON_EXCEPTION( diff --git a/deps/v8/src/api/api.cc b/deps/v8/src/api/api.cc index da75db119baf10..e286ccd254497a 100644 --- a/deps/v8/src/api/api.cc +++ b/deps/v8/src/api/api.cc @@ -38,6 +38,7 @@ #include "src/baseline/baseline-batch-compiler.h" #include "src/builtins/accessors.h" #include "src/builtins/builtins-utils.h" +#include "src/codegen/compilation-cache.h" #include "src/codegen/compiler.h" #include "src/codegen/cpu-features.h" #include "src/codegen/script-details.h" @@ -45,10 +46,6 @@ #include "src/common/globals.h" #include "src/compiler-dispatcher/lazy-compile-dispatcher.h" #include "src/date/date.h" -#include "src/objects/primitive-heap-object.h" -#if V8_ENABLE_WEBASSEMBLY -#include "src/debug/debug-wasm-objects.h" -#endif // V8_ENABLE_WEBASSEMBLY #include "src/debug/liveedit.h" #include "src/deoptimizer/deoptimizer.h" #include "src/execution/embedder-state.h" @@ -64,7 +61,6 @@ #include "src/handles/persistent-handles.h" #include "src/handles/shared-object-conveyor-handles.h" #include "src/handles/traced-handles.h" -#include "src/heap/embedder-tracing.h" #include "src/heap/heap-inl.h" #include "src/heap/heap-write-barrier.h" #include "src/heap/safepoint.h" @@ -85,6 +81,8 @@ #include "src/objects/embedder-data-slot-inl.h" #include "src/objects/hash-table-inl.h" #include "src/objects/heap-object.h" +#include "src/objects/instance-type-inl.h" +#include "src/objects/instance-type.h" #include "src/objects/js-array-buffer-inl.h" #include "src/objects/js-array-inl.h" #include "src/objects/js-collection-inl.h" @@ -95,6 +93,7 @@ #include "src/objects/objects-inl.h" #include "src/objects/oddball.h" #include "src/objects/ordered-hash-table-inl.h" +#include "src/objects/primitive-heap-object.h" #include "src/objects/property-descriptor.h" #include "src/objects/property-details.h" #include "src/objects/property.h" @@ -115,6 +114,7 @@ #include "src/profiler/profile-generator-inl.h" #include "src/profiler/tick-sample.h" #include "src/regexp/regexp-utils.h" +#include "src/roots/static-roots.h" #include "src/runtime/runtime.h" #include "src/sandbox/external-pointer.h" #include "src/sandbox/sandbox.h" @@ -127,10 +127,11 @@ #include "src/strings/unicode-inl.h" #include "src/tracing/trace-event.h" #include "src/utils/detachable-vector.h" +#include "src/utils/identity-map.h" #include "src/utils/version.h" -#include "src/web-snapshot/web-snapshot.h" #if V8_ENABLE_WEBASSEMBLY +#include "src/debug/debug-wasm-objects.h" #include "src/trap-handler/trap-handler.h" #include "src/wasm/streaming-decoder.h" #include "src/wasm/value-type.h" @@ -143,6 +144,7 @@ #if V8_OS_LINUX || V8_OS_DARWIN || V8_OS_FREEBSD #include +#include #if V8_ENABLE_WEBASSEMBLY #include "include/v8-wasm-trap-handler-posix.h" @@ -337,7 +339,7 @@ void Utils::ReportOOMFailure(i::Isolate* i_isolate, const char* location, #ifdef V8_FUZZILLI // Ignore OOM crashes for fuzzing but exit with an error such that // samples are discarded by Fuzzilli. - exit(1); + _exit(1); #else base::OS::Abort(); #endif // V8_FUZZILLI @@ -358,19 +360,12 @@ void V8::SetSnapshotDataBlob(StartupData* snapshot_blob) { namespace { #ifdef V8_ENABLE_SANDBOX -// ArrayBufferAllocator to use when sandboxed pointers are used in which case -// all ArrayBuffer backing stores need to be allocated inside the sandbox. -// Note, the current implementation is extremely inefficient as it uses the -// BoundedPageAllocator. In the future, we'll need a proper allocator -// implementation. +// ArrayBufferAllocator to use when the sandbox is enabled in which case all +// ArrayBuffer backing stores need to be allocated inside the sandbox. class ArrayBufferAllocator : public v8::ArrayBuffer::Allocator { public: - ArrayBufferAllocator() { CHECK(page_allocator_); } - void* Allocate(size_t length) override { - return page_allocator_->AllocatePages(nullptr, RoundUp(length, page_size_), - page_size_, - PageAllocator::kReadWrite); + return allocator_->Allocate(length); } void* AllocateUninitialized(size_t length) override { @@ -378,12 +373,136 @@ class ArrayBufferAllocator : public v8::ArrayBuffer::Allocator { } void Free(void* data, size_t length) override { - page_allocator_->FreePages(data, RoundUp(length, page_size_)); + return allocator_->Free(data); } private: - PageAllocator* page_allocator_ = internal::GetArrayBufferPageAllocator(); - const size_t page_size_ = page_allocator_->AllocatePageSize(); + // Backend allocator shared by all ArrayBufferAllocator instances. This way, + // there is a single region of virtual addres space reserved inside the + // sandbox from which all ArrayBufferAllocators allocate their memory, + // instead of each allocator creating their own region, which may cause + // address space exhaustion inside the sandbox. + // TODO(chromium:1340224): replace this with a more efficient allocator. + class BackendAllocator { + public: + BackendAllocator() { + CHECK(i::GetProcessWideSandbox()->is_initialized()); + VirtualAddressSpace* vas = i::GetProcessWideSandbox()->address_space(); + constexpr size_t max_backing_memory_size = 8ULL * i::GB; + constexpr size_t min_backing_memory_size = 1ULL * i::GB; + size_t backing_memory_size = max_backing_memory_size; + i::Address backing_memory_base = 0; + while (!backing_memory_base && + backing_memory_size >= min_backing_memory_size) { + backing_memory_base = vas->AllocatePages( + VirtualAddressSpace::kNoHint, backing_memory_size, kChunkSize, + PagePermissions::kNoAccess); + if (!backing_memory_base) { + backing_memory_size /= 2; + } + } + if (!backing_memory_base) { + i::V8::FatalProcessOutOfMemory( + nullptr, + "Could not reserve backing memory for ArrayBufferAllocators"); + } + DCHECK(IsAligned(backing_memory_base, kChunkSize)); + + region_alloc_ = std::make_unique( + backing_memory_base, backing_memory_size, kAllocationGranularity); + end_of_accessible_region_ = region_alloc_->begin(); + + // Install a on-merge callback to discard or decommit unused pages. + region_alloc_->set_on_merge_callback([this](i::Address start, + size_t size) { + mutex_.AssertHeld(); + VirtualAddressSpace* vas = i::GetProcessWideSandbox()->address_space(); + i::Address end = start + size; + if (end == region_alloc_->end() && + start <= end_of_accessible_region_ - kChunkSize) { + // Can shrink the accessible region. + i::Address new_end_of_accessible_region = RoundUp(start, kChunkSize); + size_t size = + end_of_accessible_region_ - new_end_of_accessible_region; + CHECK(vas->DecommitPages(new_end_of_accessible_region, size)); + end_of_accessible_region_ = new_end_of_accessible_region; + } else if (size >= 2 * kChunkSize) { + // Can discard pages. The pages stay accessible, so the size of the + // accessible region doesn't change. + i::Address chunk_start = RoundUp(start, kChunkSize); + i::Address chunk_end = RoundDown(start + size, kChunkSize); + CHECK(vas->DiscardSystemPages(chunk_start, chunk_end - chunk_start)); + } + }); + } + + ~BackendAllocator() { + // The sandbox may already have been torn down, in which case there's no + // need to free any memory. + if (i::GetProcessWideSandbox()->is_initialized()) { + VirtualAddressSpace* vas = i::GetProcessWideSandbox()->address_space(); + vas->FreePages(region_alloc_->begin(), region_alloc_->size()); + } + } + + BackendAllocator(const BackendAllocator&) = delete; + BackendAllocator& operator=(const BackendAllocator&) = delete; + + void* Allocate(size_t length) { + base::MutexGuard guard(&mutex_); + + length = RoundUp(length, kAllocationGranularity); + i::Address region = region_alloc_->AllocateRegion(length); + if (region == base::RegionAllocator::kAllocationFailure) return nullptr; + + // Check if the memory is inside the accessible region. If not, grow it. + i::Address end = region + length; + size_t length_to_memset = length; + if (end > end_of_accessible_region_) { + VirtualAddressSpace* vas = i::GetProcessWideSandbox()->address_space(); + i::Address new_end_of_accessible_region = RoundUp(end, kChunkSize); + size_t size = new_end_of_accessible_region - end_of_accessible_region_; + if (!vas->SetPagePermissions(end_of_accessible_region_, size, + PagePermissions::kReadWrite)) { + CHECK(region_alloc_->FreeRegion(region)); + return nullptr; + } + + // The pages that were inaccessible are guaranteed to be zeroed, so only + // memset until the previous end of the accessible region. + length_to_memset = end_of_accessible_region_ - region; + end_of_accessible_region_ = new_end_of_accessible_region; + } + + void* mem = reinterpret_cast(region); + memset(mem, 0, length_to_memset); + return mem; + } + + void Free(void* data) { + base::MutexGuard guard(&mutex_); + region_alloc_->FreeRegion(reinterpret_cast(data)); + } + + static BackendAllocator* SharedInstance() { + static base::LeakyObject instance; + return instance.get(); + } + + private: + // Use a region allocator with a "page size" of 128 bytes as a reasonable + // compromise between the number of regions it has to manage and the amount + // of memory wasted due to rounding allocation sizes up to the page size. + static constexpr size_t kAllocationGranularity = 128; + // The backing memory's accessible region is grown in chunks of this size. + static constexpr size_t kChunkSize = 1 * i::MB; + + std::unique_ptr region_alloc_; + size_t end_of_accessible_region_; + base::Mutex mutex_; + }; + + BackendAllocator* allocator_ = BackendAllocator::SharedInstance(); }; #else @@ -429,7 +548,7 @@ struct SnapshotCreatorData { SnapshotCreator::SnapshotCreator(Isolate* v8_isolate, const intptr_t* external_references, - StartupData* existing_snapshot) { + const StartupData* existing_snapshot) { SnapshotCreatorData* data = new SnapshotCreatorData(v8_isolate); i::Isolate* i_isolate = reinterpret_cast(v8_isolate); i_isolate->set_array_buffer_allocator(&data->allocator_); @@ -451,7 +570,7 @@ SnapshotCreator::SnapshotCreator(Isolate* v8_isolate, } SnapshotCreator::SnapshotCreator(const intptr_t* external_references, - StartupData* existing_snapshot) + const StartupData* existing_snapshot) : SnapshotCreator(Isolate::Allocate(), external_references, existing_snapshot) {} @@ -617,7 +736,7 @@ StartupData SnapshotCreator::CreateBlob( i::Snapshot::ClearReconstructableDataForSerialization( i_isolate, function_code_handling == FunctionCodeHandling::kClear); - i::SafepointKind safepoint_kind = i_isolate->has_shared_heap() + i::SafepointKind safepoint_kind = i_isolate->has_shared_space() ? i::SafepointKind::kGlobal : i::SafepointKind::kIsolate; i::SafepointScope safepoint_scope(i_isolate, safepoint_kind); @@ -796,10 +915,11 @@ i::Address* GlobalizeTracedReference(i::Isolate* i_isolate, i::Address* obj, Utils::ApiCheck((slot != nullptr), "v8::GlobalizeTracedReference", "the address slot must be not null"); #endif - auto result = i_isolate->traced_handles()->Create(*obj, slot, store_mode); + auto obj_addr = internal::ValueHelper::ValueAsAddress(obj); + auto result = i_isolate->traced_handles()->Create(obj_addr, slot, store_mode); #ifdef VERIFY_HEAP if (i::v8_flags.verify_heap) { - i::Object(*obj).ObjectVerify(i_isolate); + i::Object(obj_addr).ObjectVerify(i_isolate); } #endif // VERIFY_HEAP return result.location(); @@ -818,6 +938,41 @@ void DisposeTracedReference(internal::Address* location) { TracedHandles::Destroy(location); } +#if V8_STATIC_ROOTS_BOOL + +// Initialize static root constants exposed in v8-internal.h. + +namespace { +constexpr InstanceTypeChecker::RootIndexRange kStringMapRange = + *InstanceTypeChecker::UniqueMapRangeOfInstanceTypeRange(FIRST_STRING_TYPE, + LAST_STRING_TYPE); +constexpr Tagged_t kFirstStringMapPtr = + StaticReadOnlyRootsPointerTable[static_cast(kStringMapRange.first)]; +constexpr Tagged_t kLastStringMapPtr = + StaticReadOnlyRootsPointerTable[static_cast( + kStringMapRange.second)]; +} // namespace + +#define EXPORTED_STATIC_ROOTS_MAPPING(V) \ + V(UndefinedValue, i::StaticReadOnlyRoot::kUndefinedValue) \ + V(NullValue, i::StaticReadOnlyRoot::kNullValue) \ + V(TrueValue, i::StaticReadOnlyRoot::kTrueValue) \ + V(FalseValue, i::StaticReadOnlyRoot::kFalseValue) \ + V(EmptyString, i::StaticReadOnlyRoot::kempty_string) \ + V(TheHoleValue, i::StaticReadOnlyRoot::kTheHoleValue) \ + V(FirstStringMap, kFirstStringMapPtr) \ + V(LastStringMap, kLastStringMapPtr) + +static_assert(std::is_same::value); +#define DEF_STATIC_ROOT(name, internal_value) \ + const Internals::Tagged_t Internals::StaticReadOnlyRoot::k##name = \ + internal_value; +EXPORTED_STATIC_ROOTS_MAPPING(DEF_STATIC_ROOT) +#undef DEF_STATIC_ROOT +#undef EXPORTED_STATIC_ROOTS_MAPPING + +#endif // V8_STATIC_ROOTS_BOOL + } // namespace internal namespace api_internal { @@ -930,6 +1085,15 @@ i::Address* HandleScope::CreateHandle(i::Isolate* i_isolate, i::Address value) { return i::HandleScope::CreateHandle(i_isolate, value); } +#ifdef V8_ENABLE_CONSERVATIVE_STACK_SCANNING + +i::Address* HandleScope::CreateHandleForCurrentIsolate(i::Address value) { + i::Isolate* i_isolate = i::Isolate::Current(); + return i::HandleScope::CreateHandle(i_isolate, value); +} + +#endif + EscapableHandleScope::EscapableHandleScope(Isolate* v8_isolate) { i::Isolate* i_isolate = reinterpret_cast(v8_isolate); escape_slot_ = CreateHandle( @@ -1013,10 +1177,7 @@ void Context::Enter() { i::DisallowGarbageCollection no_gc; i::Context env = *Utils::OpenHandle(this); i::Isolate* i_isolate = env.GetIsolate(); - // TODO(cbruni): Use ENTER_V8_NO_SCRIPT_NO_EXCEPTION which also checks - // Isolate::is_execution_terminating - // ENTER_V8_NO_SCRIPT_NO_EXCEPTION(i_isolate); - ENTER_V8_MAYBE_TEARDOWN(i_isolate); + ENTER_V8_NO_SCRIPT_NO_EXCEPTION(i_isolate); i::HandleScopeImplementer* impl = i_isolate->handle_scope_implementer(); impl->EnterContext(env); impl->SaveContext(i_isolate->context()); @@ -1026,7 +1187,7 @@ void Context::Enter() { void Context::Exit() { i::Handle env = Utils::OpenHandle(this); i::Isolate* i_isolate = env->GetIsolate(); - ENTER_V8_MAYBE_TEARDOWN(i_isolate); + ENTER_V8_NO_SCRIPT_NO_EXCEPTION(i_isolate); i::HandleScopeImplementer* impl = i_isolate->handle_scope_implementer(); if (!Utils::ApiCheck(impl->LastEnteredContextWas(*env), "v8::Context::Exit()", "Cannot exit non-entered context")) { @@ -1069,7 +1230,7 @@ static i::Handle EmbedderDataFor(Context* context, const char* location) { i::Handle env = Utils::OpenHandle(context); i::Isolate* i_isolate = env->GetIsolate(); - DCHECK_NO_SCRIPT_NO_EXCEPTION_MAYBE_TEARDOWN(i_isolate); + DCHECK_NO_SCRIPT_NO_EXCEPTION(i_isolate); bool ok = Utils::ApiCheck(env->IsNativeContext(), location, "Not a native context") && Utils::ApiCheck(index >= 0, location, "Negative index"); @@ -1942,30 +2103,6 @@ void ObjectTemplate::SetCodeLike() { // Internally, UnboundScript and UnboundModuleScript are SharedFunctionInfos, // and Script is a JSFunction. -namespace { -inline Local GetSharedFunctionInfoSourceMappingURL( - i::Isolate* isolate, i::Handle obj) { - ENTER_V8_NO_SCRIPT_NO_EXCEPTION(isolate); - if (obj->script().IsScript()) { - i::Object url = i::Script::cast(obj->script()).source_mapping_url(); - return Utils::ToLocal(i::Handle(url, isolate)); - } else { - return Local(); - } -} - -inline Local GetSharedFunctionInfoSourceURL( - i::Isolate* isolate, i::Handle obj) { - ENTER_V8_NO_SCRIPT_NO_EXCEPTION(isolate); - if (obj->script().IsScript()) { - i::Object url = i::Script::cast(obj->script()).source_url(); - return Utils::ToLocal(i::Handle(url, isolate)); - } else { - return Local(); - } -} -} // namespace - ScriptCompiler::CachedData::CachedData(const uint8_t* data_, int length_, BufferPolicy buffer_policy_) : data(data_), @@ -1986,9 +2123,10 @@ ScriptCompiler::StreamedSource::StreamedSource( ScriptCompiler::StreamedSource::~StreamedSource() = default; Local